open-index/open-npm huggingface dataset:
npm package: @hemanthm/aes-cmac
Description: AES-CMAC implementation in typescript
Author: Krzysztof Rosinski
Latest version: 3.0.3

Originally from https://github.com/rosek86/aes-cmac

# AES-CMAC

AES CMAC implementation in typescript.

## Install

```
npm i aes-cmac
```

## Examples

### NodeJS (CommonJS)

```typescript
(async () => {
  const AesCmac = require("aes-cmac").AesCmac;

  const key = Buffer.from("2b7e151628aed2a6abf7158809cf4f3c", "hex");
  const msg = Buffer.from("6bc1bee22e409f96e93d7e117393172a", "hex");

  const aesCmac = new AesCmac(key);
  const result = Buffer.from(await aesCmac.calculate(msg));

  console.log(result.toString("hex"));
})();
```

### NodeJS (ECMAScript modules)

```typescript
import { AesCmac } from "aes-cmac";

(async () => {
  const key = Buffer.from("2b7e151628aed2a6abf7158809cf4f3c", "hex");
  const msg = Buffer.from("6bc1bee22e409f96e93d7e117393172a", "hex");

  const aesCmac = new AesCmac(key);
  const result = Buffer.from(await aesCmac.calculate(msg));

  console.log(result.toString("hex"));
})();
```

## References

- https://github.com/allan-stewart/node-aes-cmac
- https://tools.ietf.org/html/rfc4493
npm package: @hembrow-innovations/odm-cli
Description: odm-cli
Author: hembrow-innovations
Latest version: 0.0.1

# ODM CLI

The ODM CLI is a command-line tool that helps you manage your Poly-Repositories.

## Installation

To install the ODM CLI, simply use `npm`:

```bash
npm install -g @hembrow-innovations/odm-cli
```

This command installs the tool globally on your system. During the installation, it automatically detects your operating system and architecture to download the correct, pre-compiled binary. This means you don't need to worry about any build steps, it just works.

## Usage

Once installed, you can run the `odm` command from your terminal:

```bash
odm --version
```

Replace `--version` with the specific command you want to run. The binary will automatically be located and executed from your system's path.

---

## How It Works (For the Curious)

This package uses a clever installation strategy to ensure a fast, seamless experience:

1.  **Platform Detection:** When you run `npm install`, the package's `install.js` script checks your `process.platform` and `process.arch` to identify your system (e.g., `linux-x64`, `darwin-arm64`).

2.  **Binary Download:** It then downloads the corresponding pre-compiled binary from the npm registry. The script is designed to handle potential redirects and extract the executable directly from the tarball.

3.  **Path Integration:** The downloaded binary is placed in a location accessible by your system's `PATH`, so you can run `odm` from any terminal window without needing to use `npx`.

This approach provides the best of both worlds: the convenience of a single npm package with the performance of a native, pre-compiled binary.

## Supporeted 'OS' and 'ARCH'

- Mac

  - **`OS=darwin`**
  - **`ARCH=arm64`**: Apple Silicon Macs.
  - **`ARCH=amd64`**: Intel-based Macs.

- Linux

  - **`OS=linux`**
  - **`ARCH=amd64`**: 64-bit Intel/AMD.

- Windows

  - **`OS=windows`**
  - **`ARCH=amd64`**: 64-bit Intel/AMD.
npm package: @hembrow-innovations/odm-cli-darwin-amd64
Description: odm binary for darwin amd 64
Author: hembrow-innovations
Latest version: 0.0.1

# odm-cli-darwin-amd64

odm binary for darwin amd 64

Please go to the main package [odm-cli](https://www.npmjs.com/package/@hembrow-innovations/odm-cli)
npm package: @hembrow-innovations/odm-cli-darwin-arm64
Description: odm cli binary for os: darwin and aech: arm64
Author: hembrow-innovations
Latest version: 0.0.1

# odm-cli-darwin-arm64

odm cli binary for os: darwin and aech: arm64

Please go to the main package [odm-cli](https://www.npmjs.com/package/@hembrow-innovations/odm-cli)
npm package: @hembrow-innovations/odm-cli-linux-amd64
Description: odm binary for linux amd64
Author: hembrow-innovations
Latest version: 0.0.1

# odm-cli-linux-amd64

odm binary for linux amd64

Please go to the main package [odm-cli](https://www.npmjs.com/package/@hembrow-innovations/odm-cli)
npm package: @hembrow-innovations/odm-cli-windows-amd64
Description: odm binary for windows amd64
Author: hembrow-innovations
Latest version: 0.0.1

# odm-cli-windows-amd64

odm binary for windows amd64

Please go to the main package [odm-cli](https://www.npmjs.com/package/@hembrow-innovations/odm-cli)
npm package: @hemend/js-library
Description: Hemend js library
Author: Balal Arast
Latest version: 2.0.1

# Hemend js library

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![License][license-src]][license-href]

## Quick Setup

Add `@hemend/js-library` dependency to your project

```bash
# Using npm
npm install --save @hemend/js-library

# Using pnpm
pnpm add --save @hemend/js-library

# Using yarn
yarn add @hemend/js-library
```
## License

[MIT License](./LICENSE)

Copyright (c) Hemend

<!-- Badges -->
[npm-version-src]: https://img.shields.io/npm/v/@hemend/js-library/latest.svg?style=flat&colorA=18181B&colorB=28CF8D
[npm-version-href]: https://npmjs.com/package/@hemend/js-library

[npm-downloads-src]: https://img.shields.io/npm/dm/@hemend/js-library.svg?style=flat&colorA=18181B&colorB=28CF8D
[npm-downloads-href]: https://npmjs.com/package/@hemend/js-library

[license-src]: https://img.shields.io/npm/l/@hemend/js-library.svg?style=flat&colorA=18181B&colorB=28CF8D
[license-href]: https://npmjs.com/package/@hemend/js-library
npm package: @hemergy/core-sdk
Description: TypeScript NPM Module for Hemergy Core
Author: Abdelhamid Attaby
Latest version: 0.0.27

# Hemergy SDK

## Usage

```js
import Hermegy from '@hemergy/core-sdk'

const signer = await ethersProvider.getSigner(); // ethers signer to be used in all endpoint calls as endUserAddress
const hemergy = new Hemergy({ baseURL: 'https://dev-core.hemergy.com', signer });

const account = await hemergy.createAccount(); // Create an account managed by the signer

const isKYCed = await hemergy.isKYCed(account); // Check if the account is KYCed

const project = await hemergy.createProject(account); // Create an project under an account. Note: the account should be KYCed
```

## API

| Function      | Description |
| ----------- | ----------- |
| getContracts      | Return the ether contracts to interact with      |
| getSignerAddress      | Return the signer address      |
| createAccount      | Create an account signer by the signer      |
| isKYCed   | Check if the account is KYCed        |
| createProject   | Create a project under a specific account        |
| addProjectBeneficiaries   | Add beneficiaries to a project        |
| investInProject   | Allow an investor to invest in a project        |
| divestInProject   | Allow an investor to divest in a project        |
| approveAccountAmount   | Approve an amount sent to an account        |
| mint   | Get some amount in user account (Only available in dev and testnet environment )       |
| getBalance   | Get balance of user account (Only available in dev and testnet environment )       |
npm package: @hemers/mcp-toolkit
Description: MCP工具包 - 提供时间查询和系统信息功能的Model Context Protocol服务器
Author: hemers
Latest version: 0.0.6

# MCP 工具包

基于 Model Context Protocol (MCP) 的服务器，提供时间查询和系统信息功能。

## 功能

- **current_time**: 获取当前系统时间（中国时区）
- **system_info**: 获取操作系统、内存、CPU和运行时间等信息

## 快速开始

### 安装使用

```bash
npx @hemers/mcp-toolkit
```

### Claude Desktop 配置

```json
{
  "mcpServers": {
    "mcp-toolkit": {
      "command": "npx",
      "args": ["@hemers/mcp-toolkit"]
    }
  }
}
```

### 开发

```bash
git clone https://github.com/hemers/mcp-toolkit.git
cd mcp-toolkit
npm install
npm run dev
```

## 许可证

MIT License
npm package: @hemes/core
Description: Hemes core package
Author: André Victor
Latest version: 0.0.1-next.10

<p align="center">
  <a href="https://paymetrade.com">
    <img src="https://storage.googleapis.com/payme-trade-hemes/hemes-icon.png" width="175" alt="Hemes" style="margin: 8px 0;" />
  </a>
</p>

<p align="center">Easy peasy highly scalable financial brokers communication! 💸</p>

<div align="center">

[![npm](https://img.shields.io/npm/v/@hemes/core.svg?color=%23BDFA00&style=for-the-badge)](https://www.npmjs.com/package/@hemes/core)<space><space>
[![Coverage Status](https://img.shields.io/coveralls/github/PaymeTrade/hemes?color=BDFA00&style=for-the-badge)](https://coveralls.io/github/PaymeTrade/hemes?branch=main)

</div>

## Overview

Hemes is a performance-focused API for communicating with financial brokers. You can use to do a lot of things inside your broker.

- **[Getting started](https://paymetrade.com)**
- **[Installation](https://paymetrade.com)**

Want to test Hemes before using it?

- **[Playground](https://codesandbox.io)**

## Need help?

We’re using [GitHub Discussions](https://github.com/PaymeTrade/hemes/discussions) to create conversations around Hemes. It is a place for our community to connect with each other around ideas, questions, issues, and suggestions.

## Roadmap

If Hemes currently doesn't have a certain feature you think it's awesome, be sure to check out the [roadmap](https://www.notion.so/paymetrade/Hemes-public-roadmap-68d9166cefa14584829430392158169b) to see if this is already planned for the future. Otherwise, we recommend you [create a discussion](https://github.com/PaymeTrade/hemes/discussions/new?category=ideas) describing your enhancement request.

## Contributing

Thank you for being interested in making this package better. We encourage everyone to help improve this project with new features, bug fixes, or performance improvements. Please take a little bit of your time to read our guide to make this process faster and easier.

### Contribution Guidelines

To understand how to submit an issue, commit and create pull requests, check our [Contribution Guidelines](/.github/CONTRIBUTING.md).

### Code of Conduct

We expect you to follow our [Code of Conduct](/.github/CODE_OF_CONDUCT.md). You can read it to understand what kind of behavior will and will not be tolerated.

## License

MIT © [Payme Trade](https://github.com/PaymeTrade)
npm package: @hemes/iqoption
Description: Hemes IQ Option implementation
Author: André Victor
Latest version: 0.0.1-next.17

<p align="center">
  <a href="https://paymetrade.com">
    <img src="https://storage.googleapis.com/payme-trade-hemes/hemes-icon.png" width="175" alt="Hemes" style="margin: 8px 0;" />
  </a>
</p>

<p align="center">Hemes for IQ Option</p>

<div align="center">

[![npm](https://img.shields.io/npm/v/@hemes/core.svg?color=%23BDFA00&style=for-the-badge)](https://www.npmjs.com/package/@hemes/core)<space><space>
[![Coverage Status](https://img.shields.io/coveralls/github/PaymeTrade/hemes?color=BDFA00&style=for-the-badge)](https://coveralls.io/github/PaymeTrade/hemes?branch=main)

</div>

## Overview

Hemes is a performance-focused API for communicating with financial brokers. You can use to do a lot of things inside your broker.

- **[Getting started](https://paymetrade.com)**
- **[Installation](https://paymetrade.com)**

Want to test Hemes for IQ Option before using it? [Click here](https://codesandbox.io) and try it on CodeSandbox.

## Need help?

We’re using [GitHub Discussions](https://github.com/PaymeTrade/hemes/discussions) to create conversations around Hemes. It is a place for our community to connect with each other around ideas, questions, issues, and suggestions.

## License

MIT © [Payme Trade](https://github.com/PaymeTrade)
npm package: @hemia-web/core-domain
Description: Core domain logic and shared types for Hemia web applications
Author: Hemia Technologies
Latest version: 0.0.1

# README - @hemia-web/core-domain

El paquete `@hemia-web/core-domain` contiene la lógica del dominio central y los tipos compartidos que permiten la comunicación coherente entre los distintos módulos del ecosistema de Hemia. Este paquete está orientado a seguir los principios de DDD (Domain-Driven Design) y promueve la reutilización de modelos de dominio en múltiples contextos, como servicios backend o frontends.

## Características

* Tipos y modelos compartidos reutilizables
* Interfaces de entidades y agregados
* Constantes de dominio y enums comunes
* Ligero, sin dependencias externas en tiempo de ejecución
* Ideal para monorepos y sistemas distribuidos

## Instalación

```bash
npm install @hemia-web/core-domain
```

## Estructura Sugerida

```ts
src/
├── constants/
│   └── userRoles.ts
├── enums/
│   └── Status.ts
├── interfaces/
│   └── User.ts
├── types/
│   └── Pagination.ts
└── index.ts
```

## Ejemplo de uso

```ts
import { UserRole } from '@hemia-web/core-domain';
import { User } from '@hemia-web/core-domain';

const currentUser: User = {
  id: 'u1',
  name: 'Juan',
  role: UserRole.ADMIN
};
```

## Contribución

Este paquete está diseñado para ser consumido por otros paquetes internos. Si necesitas modificar algún tipo o modelo, asegúrate de que el cambio sea compatible con los consumidores existentes y añade pruebas si aplica.

## Licencia

MIT — © Hemia Technologies

---

# CHANGELOG - @hemia-web/core-domain

## \[0.0.1] - 2025-08-01

### Añadido

* Estructura inicial del paquete
* Tipos comunes para usuarios, paginación, roles y estados
* Constantes reutilizables para el dominio compartido
* Configuración básica de Rollup y TypeScript para distribución

---
npm package: @hemia/access-sdk
Description: SDK para gestión de permisos y roles en aplicaciones Vue 3 + Pinia. Soporte para directivas, evaluaciones dinámicas y módulos.
Author: Hemia Technologies
Latest version: 0.0.1

# @hemia/access-sdk

Sistema modular de control de permisos para aplicaciones multiusuario con soporte a roles globales y por sistema. Diseñado para integrarse fácilmente con Vue.js y proporcionar tanto funciones como directivas para gestionar acceso dinámico a funcionalidades UI y lógica de negocio.

## Instalación

```bash
npm install @hemia/access-sdk
```

## Características

* Evaluación de permisos por tipo y acción.
* Soporte para roles globales y roles específicos por sistema.
* Directiva Vue para mostrar/ocultar elementos según permisos.
* Utilidades reactivas para verificación de acceso.
* Lógica condicional con `anyOf` y `allOf`.

## Uso básico

```ts
import { useAccess } from '@hemia/access-sdk';

const access = useAccess();

if (access.hasPermission('document', 'read')) {
  // mostrar algo
}
```

## Verificación de Permisos

### `hasPermission(user, type, action, system?)`

Verifica si un usuario tiene permisos para un tipo y acción.

### `canAnyOf(user, checks, system?)`

Retorna `true` si el usuario cumple **al menos uno** de los permisos dados.

### `canAllOf(user, checks, system?)`

Retorna `true` si el usuario cumple **todos** los permisos dados.

### Ejemplo:

```ts
canAnyOf(user, [
  { type: 'document', action: 'edit' },
  { type: 'comment', action: 'create' }
]);
```

## Directiva Vue: `v-access`

```vue
<button v-access="{ type: 'user', action: 'delete' }">
  Eliminar usuario
</button>
```

Soporta estructuras complejas:

```vue
<div v-access="{ anyOf: [ { type: 'user', action: 'edit' }, { type: 'admin', action: 'impersonate' } ] }">
  Opciones avanzadas
</div>
```

## API `useAccess()`

Función que proporciona métodos reactivos de acceso y control:

```ts
const access = useAccess();

access.hasPermission('user', 'create');
access.canAnyOf([{ type: 'client', action: 'view' }]);
access.clear();
await access.loadIfMissing({ endpoint: '/auth/context', ttlContext: 60000 });
```

## Tipos

```ts
type SingleCheck = {
  type: PermissionType;
  action: ActionType;
  module?: ModuleType;
};

// Composición lógica:
type AccessBinding =
  | SingleCheck
  | { anyOf: SingleCheck[] }
  | { allOf: SingleCheck[] };
```

## Requisitos

* Estructura `UserContext` con `globalRoles` y `systemScopedRoles`.
* Implementación de `loadAccessContext(config)` para cargar el contexto del usuario.

## Licencia

MIT
npm package: @hemia/auth-sso
Description: Autenticación SSO centralizada para entornos multiaplicación desarrollados con Node.js
Author: Hemia Technologies
Latest version: 0.0.2
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @hemia/auth-sso

Cliente de autenticación Single Sign-On (SSO) para entornos web multiaplicación. Este paquete permite validar sesiones, iniciar login usando PKCE, manejar el callback de autenticación, refrescar sesiones y cerrar sesión de forma centralizada.

## Instalación

```bash
npm install @hemia/auth-sso
```

## Uso básico

```ts
import { SSOClient } from '@hemia/auth-sso';

const sso = new SSOClient({
  clientId: 'sistema1',
  redirectUri: 'https://sistema1.com/callback',
  ssoAuthUrl: 'https://sso.miempresa.com/authorize',
  tokenEndpoint: 'https://sistema1.com/api/sso/token',
  sessionEndpoint: 'https://sistema1.com/api/sso/check-session',
  refreshEndpoint: 'https://sistema1.com/api/sso/refresh',
  logoutEndpoint: 'https://sistema1.com/api/sso/logout',
  logoutRedirectUrl: 'https://sistema1.com/',
  scopes: ['openid', 'profile'],
  apiKey: 'mi-api-key'
});
```

## Métodos disponibles

### `validateSession(): Promise<SSOSession>`

Valida si la sesión actual sigue activa, usando una caché de TTL de 1 minuto para evitar llamadas excesivas.

```ts
const session = await sso.validateSession();
if (!session.isAuthenticated) {
  sso.startLogin();
}
```

### `startLogin(auto?: boolean, skip?: boolean): Promise<void>`

Redirige al usuario al flujo de autenticación del SSO usando PKCE.

```ts
sso.startLogin(); // auto y skip son opcionales
```

### `handleCallback(): Promise<{ success: boolean; message?: string, brokenSession?: boolean }>`

Procesa el callback del servidor SSO después de la redirección e intercambia el código de autorización por un token de sesión.

```ts
const result = await sso.handleCallback();
if (!result.success) {
  console.error(result.message);
}
```

### `refreshToken(): Promise<boolean>`

Renueva la sesión actual usando el token de sesión. Ideal para mantener sesiones activas sin necesidad de login constante.

```ts
const ok = await sso.refreshToken();
```

### `logout(): Promise<void>`

Cierra la sesión actual tanto en el cliente como en el backend del sistema, y redirige al usuario.

```ts
await sso.logout();
```

## Requisitos

* Backend del sistema debe implementar los endpoints para: token, sesión, refresh y logout.
* El flujo de autenticación usa PKCE (`code_challenge` y `code_verifier`).
* El cliente guarda datos temporales en `localStorage`.

## Estructura esperada del objeto `SSOConfig`

```ts
interface SSOConfig {
  clientId: string;
  redirectUri: string;
  ssoAuthUrl: string;
  tokenEndpoint: string;
  sessionEndpoint: string;
  refreshEndpoint?: string;
  logoutEndpoint?: string;
  logoutRedirectUrl?: string;
  scopes: string[];
  apiKey?: string;
}
```

## Licencia

MIT
npm package: @hemia/autobind
Description: A lightweight utility for automatic method binding in classes
Author: Hemia Technologies
Latest version: 0.0.1

# @hemia/autobind

**Decoradores de autobind para TypeScript.**

Este paquete proporciona tres decoradores para enlazar automáticamente métodos de clases a su instancia, asegurando que el contexto de `this` siempre apunte correctamente. Ideal para evitar errores comunes cuando se pasan funciones como callbacks.

## Características

* `@BoundMethod`: memoriza y enlaza el método a su instancia.
* `@BoundClass`: enlaza automáticamente todos los métodos de la clase.
* `@Autobind`: funciona como `@BoundMethod` o `@BoundClass` según su uso.

---

## Instalación

```bash
npm install @hemia/autobind
```

Asegúrate de habilitar `experimentalDecorators` en tu `tsconfig.json`:

```json
{
  "compilerOptions": {
    "experimentalDecorators": true,
    "target": "ES6",
    "module": "commonjs"
  }
}
```

---

## Uso básico

### Importación

```ts
import { BoundMethod, BoundClass, Autobind } from '@hemia/autobind';
```

### @BoundMethod

```ts
class MiClase {
  private contador: number = 0;

  @BoundMethod
  incrementar() {
    this.contador++;
    console.log(`Contador: ${this.contador}`);
  }
}

const instancia = new MiClase();
const fn = instancia.incrementar;
fn(); // Contador: 1
fn(); // Contador: 2
```

### @BoundClass

```ts
@BoundClass
class MiClaseAuto {
  private contador: number = 0;

  incrementar() {
    this.contador++;
    console.log(`Contador: ${this.contador}`);
  }

  decrementar() {
    this.contador--;
    console.log(`Contador: ${this.contador}`);
  }
}

const instancia = new MiClaseAuto();
const inc = instancia.incrementar;
const dec = instancia.decrementar;
inc(); // Contador: 1
dec(); // Contador: 0
```

### @Autobind como decorador universal

#### Decorando un método:

```ts
class OtraClase {
  constructor(private nombre: string) {}

  @Autobind
  saludar() {
    console.log(`Hola, soy ${this.nombre}`);
  }
}

const instancia = new OtraClase('Decorador');
const fn = instancia.saludar;
fn(); // Hola, soy Decorador
```

#### Decorando una clase:

```ts
@Autobind
class ClaseCompleta {
  private valor = 10;

  metodo1() {
    console.log('Metodo 1:', this.valor);
  }

  metodo2() {
    console.log('Metodo 2:', this.valor);
  }
}

const instancia = new ClaseCompleta();
instancia.metodo1();
instancia.metodo2();
```

---

## Funcionamiento interno

* `@BoundMethod` crea un getter que memoriza el `this` enlazado al primer acceso.
* `@BoundClass` aplica `@BoundMethod` a todos los métodos del prototipo.
* `@Autobind` detecta si se usa sobre clase o método, y aplica el decorador correspondiente.

---

## Contribuciones

1. Haz un fork del repositorio.
2. Crea una rama con tu funcionalidad: `git checkout -b feature/nueva-funcionalidad`.
3. Aplica tus cambios con commits descriptivos.
4. Abre un pull request.

---

## Licencia

MIT License — Hemia Technologies
npm package: @hemia/cli
Description: Hemia CLI
Author: Hemia Technologies
Latest version: 0.0.1

# @hemia/cli

**Hemia CLI** is a command-line tool to quickly and consistently generate, structure, and manage projects and packages in the Hemia ecosystem.

---

## 🚀 Installation

### Global (recommended)

```bash
npm install -g @hemia/cli
```

### Using NPX

```bash
npx @hemia/cli <command>
```

---

## 📦 Available Commands

### Create a New Project

```bash
hemia new <name> [--vue|--node|--laravel]
```

Generates a new base project depending on the specified type. If not provided, the default type is `vue`.

**Examples:**

```bash
hemia new my-app --vue
hemia new api-service --node
```

### Generate a Resource

Alias: `g`

```bash
hemia g <type> <name> [options]
```

#### Available Types:

* **project**: base project structure

  ```bash
  hemia g project my-app
  ```

* **package**: standalone module (`js`, `ts`, `py`)

  ```bash
  hemia g package utils
  ```

* **api**: backend scaffolding with support for MySQL or MongoDB

  ```bash
  hemia g api auth --mysql
  hemia g api users --mongodb
  ```

* **component**: *(coming soon)* generates a UI component

* **service**: *(coming soon)* business logic module

* **model**: *(coming soon)* data model

* **doc**: *(coming soon)* base documentation

---

## 🛠 Project Structure

All resources use base templates you can find and modify in the directory:

```
templates/
├── vue/
├── node/
├── laravel/
├── package-ts/
├── package-js/
└── package-py/
```

---

## 🔧 Optional Configuration

You can create a `.hemia.json` file in the project root or in your `$HOME` directory to set default values:

```json
{
  "defaultProjectType": "vue",
  "defaultPackageLang": "ts",
  "author": "Hemia Technologies"
}
```

---

## 📖 Help

Display help from the CLI:

```bash
hemia --help
```

---

## 📜 License

MIT — © Hemia Technologies
npm package: @hemia/core-bl
Description: Módulo de lógica de negocio central de Hemia
Author: Hemia Technologies
Latest version: 0.0.1
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @hemia/core-bl

Módulo central de lógica de negocio de Hemia. Este paquete contiene las reglas, flujos y servicios del dominio principal de la plataforma.

---

## 📛 Badges

[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://choosealicense.com/licenses/mit/)
[![Build Status](https://img.shields.io/github/actions/workflow/status/hemia/core-bl/ci.yml)](https://github.com/hemia/core-bl/actions)
[![Coverage](https://img.shields.io/codecov/c/github/hemia/core-bl)](https://codecov.io/gh/hemia/core-bl)
[![NPM Version](https://img.shields.io/npm/v/@hemia-web/core-bl.svg)](https://www.npmjs.com/package/@hemia-web/core-bl)

---

## 📦 Instalación

```bash
npm install @hemia-web/core-bl
```

---

## 🚀 Scripts

### Ejecutar pruebas unitarias

```bash
npm run test
```

### Ejecutar linter

```bash
npm run lint
```

### Compilar el proyecto

```bash
npm run build
```

---

## 📁 Estructura general (sugerida)

```
core-bl/
├── src/
│   ├── services/
│   ├── use-cases/
│   ├── utils/
│   └── index.ts
├── tests/
├── dist/
├── package.json
└── README.md
```

---

## 🤝 Dependencias clave

* [`@hemia/core-domain`](https://www.npmjs.com/package/@hemia/core-domain) – Estructuras y entidades de dominio.
* [`@hemia/network-services`](https://www.npmjs.com/package/@hemia/network-services) – Abstracción de cliente HTTP.

---

## 📝 Licencia

Este proyecto está licenciado bajo la Licencia MIT.
npm package: @hemia/core-domain
Description: Core domain logic and shared types for Hemia web applications
Author: Hemia Technologies
Latest version: 0.0.3

# README - @hemia/core-domain

El paquete `@hemia/core-domain` contiene la lógica del dominio central y los tipos compartidos que permiten la comunicación coherente entre los distintos módulos del ecosistema de Hemia. Este paquete está orientado a seguir los principios de DDD (Domain-Driven Design) y promueve la reutilización de modelos de dominio en múltiples contextos, como servicios backend o frontends.

## Características

* Tipos y modelos compartidos reutilizables
* Interfaces de entidades y agregados
* Constantes de dominio y enums comunes
* Ligero, sin dependencias externas en tiempo de ejecución
* Ideal para monorepos y sistemas distribuidos

## Instalación

```bash
npm install @hemia/core-domain
```

## Estructura Sugerida

```ts
src/
├── constants/
│   └── userRoles.ts
├── enums/
│   └── Status.ts
├── interfaces/
│   └── User.ts
├── types/
│   └── Pagination.ts
└── index.ts
```

## Ejemplo de uso

```ts
import { UserRole } from '@hemia/core-domain';
import { User } from '@hemia/core-domain';

const currentUser: User = {
  id: 'u1',
  name: 'Juan',
  role: UserRole.ADMIN
};
```

## Contribución

Este paquete está diseñado para ser consumido por otros paquetes internos. Si necesitas modificar algún tipo o modelo, asegúrate de que el cambio sea compatible con los consumidores existentes y añade pruebas si aplica.

## Licencia

MIT — © Hemia Technologies

---

# CHANGELOG - @hemia/core-domain

## \[0.0.1] - 2025-08-01

### Añadido

* Estructura inicial del paquete
* Tipos comunes para usuarios, paginación, roles y estados
* Constantes reutilizables para el dominio compartido
* Configuración básica de Rollup y TypeScript para distribución

---
npm package: @hemia/email-sender
Description: Librería de envío de correos compatible con plantillas EJS y MJML, basada en Nodemailer.
Author: Hemia Technologies
Latest version: 0.0.2

# @hemia/email-sender

Una librería ligera y extensible para el envío de correos electrónicos usando Nodemailer, compatible con plantillas EJS y MJML. Soporta múltiples destinatarios, CC, BCC, adjuntos y renderizado dinámico de contenido.

---

## Características

* ✅ Basado en `nodemailer`
* ✅ Soporte para plantillas HTML (EJS, MJML)
* ✅ Múltiples destinatarios (`to`, `cc`, `bcc`)
* ✅ Adjuntos (`attachments`)
* ✅ Configuración SMTP flexible
* ✅ Ideal para sistemas de notificación
* ✅ Separación de lógica de renderizado con `TemplateManager`

---

## Instalación

```bash
npm install @hemia/email-sender
```

---

## Uso básico

```ts
import { EmailSender } from '@hemia/email-sender';

const emailSender = new EmailSender({
  host: 'smtp.example.com',
  port: 465,
  secure: true,
  auth: {
    user: 'user@example.com',
    pass: 'password123'
  }
});

await emailSender.sendEmail({
  to: 'destinatario@correo.com',
  subject: 'Asunto del correo',
  template: 'welcome-template.ejs',
  data: { nombre: 'Juan', link: 'https://ejemplo.com' },
  app: 'MiApp'
});
```

---

## Uso avanzado con CC, BCC y adjuntos

```ts
await emailSender.sendEmail({
  to: ['a@correo.com', 'b@correo.com'],
  cc: 'c@correo.com',
  bcc: ['d@correo.com'],
  subject: 'Con adjuntos',
  template: 'invoice.ejs',
  data: { total: '$99.00' },
  attachments: [
    {
      filename: 'factura.pdf',
      path: '/ruta/factura.pdf'
    }
  ]
});
```

---

## Interfaces disponibles

```ts
interface EmailSenderConfig {
  host: string;
  port: number;
  secure: boolean;
  auth: {
    user: string;
    pass: string;
  };
}

interface EmailOptions {
  to: string | string[];
  subject: string;
  template: string;
  data?: Record<string, any>;
  app?: string;
  cc?: string | string[];
  bcc?: string | string[];
  attachments?: {
    filename: string;
    path?: string;
    content?: string | Buffer;
  }[];
}
```

---

## Estructura de plantillas

```
templates/
  welcome-template.ejs
  reset-password.ejs
```

Puedes personalizar el `TemplateManager` para soportar MJML, EJS u otros motores de renderizado.

---

## Licencia

MIT — © Hemia Technologies

Desarrollado por [Hemia Technologies](https://hemia.mx)