open-index/open-npm huggingface dataset:
npm package: @hexa-ai/node-red-contrib-hexa-data-connector
Description: MQTT Adapter for Hexa-data
Author: jtalbourdet
Latest version: 1.0.5

# node-red-contrib-hexa-data-connector
MQTT Adapter for Hexa-data

Node to format MQTT messages intended to be uploaded to Hexa-data software from Hexa-AI (www.hexa-ai.fr) This node buffers the values and timestamps and publishes the values at the defined interval. If there is no interval set, the default is 5 seconds

### Inputs

payload Object

Contains the value to be returned as well as its description (name, value and data type) Payload Ex:`{name:"testMsg","value":12.3,"type":"real"}`

### Details

`msg.payload.name` Is a string containing the variable name declared in hexa-data

`msg.payload.value` Is the value to publish on hexa-data

`msg.payload.type` Describes the type of value to publish ("boolean", "integer", "real", "string") One thing remains to be improved on the hexa-data side, for reals if there are no decimal places, this node automatically adds 0.1 to the value

### References

*   [GitHub](https://github.com/Hexa-ai/node-red-contrib-hexa-data-connector) - the nodes github repository
npm package: @hexa-framework/adapter-mongoose
Description: Mongoose database adapter for Hexa Framework (MongoDB)
Author: lutfian.rhdn
Latest version: 1.0.0

# @hexa/adapter-mongoose

Mongoose database adapter for Hexa Framework (MongoDB).

## Installation

```bash
npm install @hexa/adapter-mongoose mongoose
```

## Usage

### Setup Adapter

```typescript
import { MongooseAdapter, createMongooseAdapter } from '@hexa/adapter-mongoose';

const adapter = createMongooseAdapter({
  uri: 'mongodb://localhost:27017/mydb',
});

await adapter.connect();
```

### Create Repository

```typescript
import { BaseMongooseRepository, createBaseSchema } from '@hexa/adapter-mongoose';
import mongoose from 'mongoose';

// Define schema
const userSchema = createBaseSchema({
  email: { type: String, required: true, unique: true },
  username: { type: String, required: true },
  password: { type: String, required: true },
});

const UserModel = mongoose.model('User', userSchema);

// Create repository
class UserRepository extends BaseMongooseRepository<User> {
  constructor() {
    super(UserModel);
  }

  async findByEmail(email: string) {
    return this.model.findOne({ email, isActive: true }).exec();
  }
}
```
npm package: @hexa-framework/adapter-prisma
Description: Prisma database adapter for Hexa Framework
Author: lutfian.rhdn
Latest version: 1.0.0

# @hexa/adapter-prisma

Prisma database adapter for Hexa Framework.

## Installation

```bash
npm install @hexa/adapter-prisma @prisma/client
npm install prisma --save-dev
```

## Usage

### Setup Adapter

```typescript
import { PrismaAdapter, createPrismaAdapter } from '@hexa/adapter-prisma';

// Create adapter
const adapter = createPrismaAdapter({
  url: process.env.DATABASE_URL,
  log: ['error', 'warn'],
});

// Connect
await adapter.connect();

// Get Prisma client
const prisma = adapter.getClient();

// Disconnect on shutdown
await adapter.disconnect();
```

### Create Repository

```typescript
import { BasePrismaRepository } from '@hexa/adapter-prisma';
import { IBaseEntity } from '@hexa/common';
import { PrismaClient } from '@prisma/client';

interface User extends IBaseEntity {
  id: number;
  email: string;
  username: string;
  password: string;
}

class UserRepository extends BasePrismaRepository<User> {
  protected modelName = 'user';

  constructor(prisma: PrismaClient) {
    super(prisma);
  }

  // Add custom methods
  async findByEmail(email: string): Promise<User | null> {
    return this.model.findFirst({
      where: { email, isActive: true, deletedAt: null },
    });
  }
}

// Usage
const userRepo = new UserRepository(prisma);
const users = await userRepo.getAll({ 
  pagination: { page: 1, limit: 10 } 
});
```

## API

### PrismaAdapter

- `connect()` - Connect to database
- `disconnect()` - Disconnect from database
- `getClient()` - Get Prisma client instance
- `isConnected()` - Check connection status

### BasePrismaRepository

- `getById(id)` - Get entity by ID
- `getAll(options)` - Get all with pagination, search, filters
- `create(item)` - Create new entity
- `update(id, item)` - Update entity
- `softDelete(id)` - Soft delete (sets isActive=false)
- `hardDelete(id)` - Permanent delete
- `createMany(items)` - Bulk create
- `count(filters)` - Count with filters
- `exists(id)` - Check if exists
npm package: @hexa-framework/adapter-redis
Description: Redis cache adapter for Hexa Framework
Author: lutfian.rhdn
Latest version: 1.0.0

# @hexa/adapter-redis

Redis cache adapter for Hexa Framework.

## Installation

```bash
npm install @hexa/adapter-redis redis
```

## Usage

### Setup Adapter

```typescript
import { RedisAdapter, createRedisAdapter, createRedisCache } from '@hexa/adapter-redis';

const adapter = createRedisAdapter({
  host: 'localhost',
  port: 6379,
  password: 'secret',
  keyPrefix: 'myapp:',
});

await adapter.connect();
```

### Caching

```typescript
const cache = createRedisCache(adapter);

// Set with 1 hour TTL
await cache.set('user:123', { name: 'John' }, 3600);

// Get
const user = await cache.get('user:123');

// Delete
await cache.delete('user:123');

// Check exists
const exists = await cache.exists('user:123');
```

### Session Store

```typescript
import { createSessionStore } from '@hexa/adapter-redis';

const sessionStore = createSessionStore(adapter, {
  prefix: 'session:',
  ttlSeconds: 86400, // 24 hours
});

// Store session
await sessionStore.set('abc123', { userId: 1, role: 'admin' });

// Get session
const session = await sessionStore.get('abc123');

// Destroy session
await sessionStore.destroy('abc123');
```
npm package: @hexa-framework/adapter-typeorm
Description: TypeORM database adapter for Hexa Framework
Author: lutfian.rhdn
Latest version: 1.0.0

# @hexa/adapter-typeorm

TypeORM database adapter for Hexa Framework.

## Installation

```bash
npm install @hexa/adapter-typeorm typeorm reflect-metadata
```

## Usage

### Setup Adapter

```typescript
import 'reflect-metadata';
import { TypeORMAdapter, createTypeORMAdapter } from '@hexa/adapter-typeorm';

const adapter = createTypeORMAdapter({
  type: 'postgres',
  host: 'localhost',
  port: 5432,
  database: 'mydb',
  username: 'user',
  password: 'pass',
  entities: ['src/entities/*.ts'],
  synchronize: false,
});

await adapter.connect();
const dataSource = adapter.getClient();
```

### Create Repository

```typescript
import { BaseTypeORMRepository } from '@hexa/adapter-typeorm';
import { Entity, Column, PrimaryGeneratedColumn } from 'typeorm';

@Entity()
class User {
  @PrimaryGeneratedColumn()
  id: number;

  @Column()
  email: string;

  @Column({ default: true })
  isActive: boolean;
}

class UserRepository extends BaseTypeORMRepository<User> {
  constructor(dataSource: DataSource) {
    super(dataSource, User);
  }
}
```
npm package: @hexa-framework/common
Description: Shared interfaces and types for Hexa Framework ecosystem
Author: lutfian.rhdn
Latest version: 1.0.1

# @hexa/common

Shared interfaces and types for the Hexa Framework ecosystem.

## Installation

```bash
npm install @hexa/common
```

## Usage

```typescript
import { 
  IRepository, 
  IDatabaseAdapter, 
  ITransport,
  IPlugin,
  IEventBus 
} from '@hexa/common';
```

## Interfaces

### Database Adapters
- `IDatabaseAdapter` - Base interface for all database adapters
- `DatabaseAdapterConfig` - Configuration options

### Repository
- `IRepository` - Generic repository interface
- `IBaseEntity` - Base entity type
- `PaginationResult` - Pagination response
- `QueryOptions` - Query parameters

### Transports
- `ITransport` - Base interface for all transports
- `RouteDefinition` - Route configuration
- `TransportOptions` - Transport configuration

### Plugins
- `IPlugin` - Base interface for all plugins
- `PluginConfig` - Plugin configuration
- `PluginMetadata` - Plugin information

### Events
- `IEventBus` - Event bus interface
- `IDomainEvent` - Domain event structure
- `EventHandler` - Event handler type

### Other
- `ILogger` - Logging interface
- `ICache` - Caching interface
- `ApiResponse` - Standard API response
npm package: @hexa-framework/core
Description: Core package for Hexa Framework - Base classes, middleware, and utilities
Author: lutfian.rhdn
Latest version: 2.0.0

# @hexa-framework/core

> Core package for Hexa Framework - Base classes, middleware, and utilities

## Installation

```bash
npm install @hexa-framework/core
```

## What's Included

### Base Classes

- **Controller** - Generic REST controller with CRUD operations
- **Service** - Generic service layer for business logic
- **Repository** - Generic repository interface for data access

### Middleware

- **authMiddleware** - JWT authentication
- **permissionMiddleware** - Role-based access control
- **validationMiddleware** - Zod schema validation

### Types

- `TResponse` - Standard API response format
- `TErrorResponse` - Error response format
- `TMetadataResponse` - Pagination metadata
- `PaginationResult` - Repository pagination result
- And more...

### Utilities

- String transformations (camelCase, snake_case, PascalCase, etc.)
- Async utilities (retry, sleep)
- Object utilities (deepClone, compact, isEmpty)

## Quick Example

```typescript
import {
  Controller,
  Service,
  Repository,
  authMiddleware,
  validateBody,
} from '@hexa-framework/core';
import { z } from 'zod';

// Define entity
interface Post {
  id: number;
  title: string;
  content: string;
}

// Create repository (implement with Prisma, TypeORM, etc.)
class PostRepository extends Repository<Post> {
  // Implement abstract methods
}

// Create service
class PostService extends Service<Post> {
  constructor() {
    super(new PostRepository());
  }
}

// Create controller
class PostController extends Controller<Post, TMetadataResponse> {
  // CRUD methods inherited automatically
}

// Use in routes
const postController = new PostController();
const postService = new PostService();

router.get(
  '/posts',
  authMiddleware,
  postController.findAll(postService, PostMapper)
);

// With validation
const createSchema = z.object({
  title: z.string().min(3),
  content: z.string(),
});

router.post(
  '/posts',
  authMiddleware,
  validateBody(createSchema),
  postController.create(postService, PostMapper)
);
```

## Documentation

See [main documentation](../../docs) for detailed usage.

## License

MIT © lutfian.rhdn
npm package: @hexa-framework/transport-graphql
Description: GraphQL transport layer for Hexa Framework (Apollo Server)
Author: lutfian.rhdn
Latest version: 1.0.0

# @hexa/transport-graphql

GraphQL transport layer for Hexa Framework using Apollo Server.

> ⚠️ **This package is a placeholder** - Full implementation coming in v2.0

## Planned Features

- Apollo Server 4 integration
- Auto-generate schema from entities
- BaseResolver class
- Authentication context
- DataLoader support for N+1 prevention

## Installation (Coming Soon)

```bash
npm install @hexa/transport-graphql @apollo/server graphql
```

## Planned Usage

```typescript
import { GraphQLTransport, BaseResolver } from '@hexa/transport-graphql';

class UserResolver extends BaseResolver<User> {
  async findAll({ page, limit }) {
    return this.userService.findAll(page, limit);
  }
  
  async findById(id) {
    return this.userService.findById(id);
  }
}
```

## Contributing

We welcome contributions! If you'd like to help implement this package:

1. Fork the repository
2. Check the issues for `transport-graphql` tasks
3. Submit a PR

Visit: https://github.com/lutfianrhdn/hexa-framework
npm package: @hexa-framework/transport-rest
Description: REST transport layer for Hexa Framework (Express.js)
Author: lutfian.rhdn
Latest version: 1.0.0

# @hexa/transport-rest

REST transport layer for Hexa Framework using Express.js.

## Installation

```bash
npm install @hexa/transport-rest express
```

## Usage

### Setup Transport

```typescript
import express from 'express';
import { RestTransport, createRestTransport } from '@hexa/transport-rest';

const app = express();
app.use(express.json());

const rest = createRestTransport();
await rest.init(app, { prefix: '/api', version: 'v1' });

app.listen(3000);
```

### Create Controller

```typescript
import { BaseController, AuthRequest } from '@hexa/transport-rest';
import { Request, Response } from 'express';

class UserController extends BaseController {
  getAll = this.asyncHandler(async (req: Request, res: Response) => {
    const users = await this.userService.findAll();
    return this.success(res, users, 'Users retrieved');
  });

  create = this.asyncHandler(async (req: Request, res: Response) => {
    const user = await this.userService.create(req.body);
    return this.created(res, user);
  });
}
```

### Authentication Middleware

```typescript
import { createAuthMiddleware } from '@hexa/transport-rest';

const authMiddleware = createAuthMiddleware({
  jwtSecret: process.env.JWT_SECRET!,
  getUserDetails: async (payload) => {
    // Fetch additional user details
    return { permissions: ['user:read', 'user:write'] };
  },
});

router.get('/protected', authMiddleware, handler);
```

### Validation Middleware

```typescript
import { validateBody } from '@hexa/transport-rest';
import { z } from 'zod';

const createUserSchema = z.object({
  email: z.string().email(),
  password: z.string().min(8),
});

router.post('/users', validateBody(createUserSchema), controller.create);
```
npm package: @hexacubist/svelte-portal-crosscontext
Description: Fork of romkor/svelte-portal
Latest version: 2.3.3

Svelte component for rendering outside the DOM of parent component

Idea borrowed from here: https://github.com/sveltejs/svelte/issues/3088#issuecomment-505785516

# Installation

```sh
npm install --save svelte-portal
```

or

```sh
yarn add svelte-portal
```

# Usage Portal component

The `<Portal />` component has only one property: `target`

target can be a HTMLElement `target={document.body}` or a css selector `target="#modals"` that points to an already existing element.

When no target is given it defaults to: `document.body`.

## Example

```html
<script>
  import Portal from "svelte-portal";
</script>

<Portal target="body">
  <div class="toast">Entity successfully updated!</div>
</Portal>
```

# Usage portal action

The functionality can also be applied to DOM elements directly via a svelte action:

## Example

```html
<script>
  import { portal } from "svelte-portal";
</script>

<div class="toast" use:portal={"body"} hidden>Entity successfully updated!</div>
```

The `hidden` atrribute is only needed when using ssr, when portal has moved the element to it's targetted location it removes the hidden attribute.

## TypeScript support

`<script lang="ts">` users should import from `"svelte-portal/src/Portal.svelte"` instead of `"svelte-portal"` to get typing support.