open-index/open-npm huggingface dataset:
npm package: @legworkstudio/eventful
Description: An event helper
Author: Leg Devs
Latest version: 1.0.0

Eventful
================
A helper class for events.

[![Build Status](https://travis-ci.org/legworkstudio/Eventful.svg?branch=master)](https://travis-ci.org/legworkstudio/Eventful)

## Use
<pre>
let Eventful = require('eventful');

class MyClass extends Eventful{
	constructor(){
		super();
	}
}
</pre>

### Listen:
`_myObject.on('some-event', (event) => console.log(event) );`

### Trigger:
`_myObject.trigger('some-event', {foo: bar, fizz: buzz, data: {} });`
`_myObject.trigger('some-other-event');`

### Detach:
`_myObject.off('some-event');`

With Eventful you can attach listeners to any object that you have access to and transfer data between the caller and the object.

## Returns
Will return an object with the event and any data associate with that event.
<pre>
{
	ev_type: 'some-event'
	foo: bar,
	fizz: buzz,
	data: {}
}
</pre>

## Methods
`on('event-type')`: Attach an event (string)
`off('event-type')`: Detaches an event that has been attached (string)
`trigger('event-type', {})`: Triggers an event (string, data)

## Tests
To run tests `npm test`
npm package: @lehelkovach/cpms-core
Description: CPMS core (pure JS): evaluators + hybrid scoring + explain traces + naive pattern matching.
Author: Lehel Kovach
Latest version: 0.1.0

# @lehelkovach/cpms-core

Pure JS matching logic:
- evaluator registry
- hybrid scoring (fuzzy logit + bayes LLR)
- explain traces
- greedy + repair pattern matching

## Install
```bash
npm install @lehelkovach/cpms-core
# or
pnpm add @lehelkovach/cpms-core
```

## Quick start
```js
import { matchConcept, matchPatternGreedyRepair } from "@lehelkovach/cpms-core";

const concept = {
  concept_id: "concept:email@1.0.0",
  signals: [
    { signal_id: "terms", evaluator: "dom.text_contains_any", params: { terms: ["email", "username"] }, mode: "fuzzy", weight: 1.2 }
  ],
  resolution: { score_model: { type: "hybrid_logit", prior_logit: -1, calibration: "sigmoid" }, decision: { policy: "winner_take_all", min_conf: 0.6, min_margin: 0.05 } }
};

const observation = { page_id: "fixture:login", candidates: [{ candidate_id: "cand_email", dom: { label_text: "Email" } }] };
const conceptResult = matchConcept(concept, observation);
// conceptResult.best.candidate_id === "cand_email"

// Patterns combine multiple concepts
const pattern = { pattern_id: "pattern:login@1.0.0", includes: [concept.concept_id], strategy: { type: "greedy_repair", top_k: 5, max_repairs: 5 } };
const patternResult = matchPatternGreedyRepair(pattern, [concept], observation);
// patternResult.assigned["concept:email@1.0.0"] === "cand_email"
```

## API surface
- `matchConcept`, `matchConceptExplain`, `matchPatternGreedyRepair`
- Schema helpers: `generateConceptDraft`, `generatePatternDraft`, `describeConceptSchemaLanguage`, `buildConceptSchemaTemplate`, `validateConceptSchema`, `compileConcept`
- Evaluators in `engine/evaluators` with allowlist in `schema/compiler`
npm package: @lehelkovach/cpms-server-node
Description: CPMS Node API (pure JS): match, match_explain, match_pattern.
Author: Lehel Kovach
Latest version: 0.1.0

# @lehelkovach/cpms-server-node

Fastify API for CPMS. Exposes the concept/pattern matching endpoints along with helpers for generating and validating schema payloads.

## Endpoints
- `GET /health` – liveness probe.
- `POST /cpms/match` – winner-take-all decision for a single concept.
- `POST /cpms/match_explain` – match plus explain trace.
- `POST /cpms/match_pattern` – greedy + repair assignment for a pattern.
- `GET /cpms/schema/concepts/language` – schema description + starter template.
- `POST /cpms/schema/concepts/template` – build a template from intent overrides.
- `POST /cpms/schema/concepts/persist` – lint + compile + persist a concept draft.
- `POST /cpms/concepts/draft` / `POST /cpms/patterns/draft` – helper endpoints for tool-calling.

Swagger UI is served at `/docs`.

## Install
```bash
npm install @lehelkovach/cpms-server-node
# or
pnpm add @lehelkovach/cpms-server-node
```

## Running locally
```bash
node src/server.js
# or
CPMS_API_PORT=8787 node src/server.js
```

Environment variables:
- `CPMS_API_HOST` / `CPMS_API_PORT` – bind address and port (default `0.0.0.0:8787`).
- `CPMS_GRAPH_STORE` – `file` (default) or `arango`.
- `ARANGO_URL`, `ARANGO_DB`, `ARANGO_COLLECTION`, `ARANGO_AUTH` – Arango graph settings.

## Publishing
Publish with npm:
```bash
npm publish --access public
```

Ensure `@lehelkovach/cpms-core` is published first so the dependency range `^0.1.0` resolves on npm.
npm package: @lehenna/auth
Description: Implement a user authentication system in minutes.
Author: Lehenna
Latest version: 1.0.2

# @lehenna/auth

> Implement a user authentication system in minutes.

## Introduction

With `@lehenna/auth` you can implement an authentication system using email or OAuth providers in minutes.

This module is database agnostic, so it can be used in any project.

## Quick start

### 1. Create a new authentication client:

```ts
import { Client } from "@lehenna/auth";

const client = new Client(models, options);
```

### 2. Create models:

```ts
const userModel: UserModel<string, User> = {
  async findByEmail(email) {
    return db.users.findOne({ email });
  },
};

const verificationCodeModel: VerificationCodeModel<string> = {
  async create(data) {
    return db.verificationCodes.create(data);
  },
  async findByUserId(userId) {
    return db.verificationCodes.findOne({ userId });
  },
  async remove(id) {
    return db.verificationCodes.remove({ id });
  },
  async update(id, data) {
    return db.verificationCodes.update({ id }, data);
  },
};

const sessionModel: SessionModel<string, User> = {
  async findById(id) {
    return db.sessions.findOne({ id });
  },
  async remove(id) {
    return db.sessions.remove({ id });
  },
  async update(id, data) {
    return db.sessions.update({ id }, data);
  },
};
```

The models in the database must have a definition equal to the following:

```ts
interface User {
  id: string;
  email: string;
}

interface Session {
  id: string;
  expiresIn: number;
  user: User;
}

interface VerificationCode {
  id: string;
  expiresIn: number;
  userId: string;
  code: string;
}
```

### 3. Options

```ts
interface ClientOptions {
  secret: string;
  mailer: MailerFunction;
  sessionExpiresIn?: number;
  codeExpiresIn?: number;
}

const options: ClientOptions = {
  secret: "my-secret",
  mailer: async (user, code) => {
    const html = `<p>Your code is ${code}</p>`;
    await sendMail(user.email, html);
  },
};
```

## Authentication flow:

### Send Verification Code:

```ts
const user = await client.sendVerificationCode(email);
console.info(user);
```

### Validate Verification Code:

```ts
const session = await client.validateVerificationCode(email, inputCode);
console.info(session);
```

### Validate Session:

```ts
const session = await client.validateUserSession(sessionsId);
console.info(session);
```

## License

[MIT License](/LICENSE.md)
npm package: @lehenna/authorize
Description: Implement a roles and permissions system in minutes.
Author: Lehenna
Latest version: 1.0.0

# @lehenna/authorize

> Implement a roles and permissions system in minutes.

## Installation

```bash
npm install @lehenna/authorize
```

# Usage

## Import and Initialize

You can define permissions and roles, then initialize the `Authorize` class:

```ts
import { Authorize } from "@lehenna/authorize";

const authorize = new Authorize(
  {
    users: {
      read: "",
      create: "",
      update: "",
      remove: "",
    },
    tasks: {
      read: "",
      create: "",
      update: "",
      remove: "",
    },
  },
  {
    admin: {
      all: true,
    },
    taskManager: {
      tasks: true,
    },
    user: {
      tasks: {
        read: true,
      },
    },
  }
);
```

## Check Permissions

Use the `can` method to check if a role has a specific permission:

```ts
const canReadTasks = authorize.can("user", "tasks.read"); // true
const canCreateTasks = authorize.can("user", "tasks.create"); // false
```

## Sort Roles

You can sort roles in ascending or descending order:

```ts
const sortedRolesAsc = authorize.sort(["admin", "user", "taskManager"], "asc");
console.log(sortedRolesAsc); // ['user', 'taskManager', 'admin']

const sortedRolesDesc = authorize.sort(
  ["admin", "user", "taskManager"],
  "desc"
);
console.log(sortedRolesDesc); // ['admin', 'taskManager', 'user']
```

## Compare Roles

Use the `compare` method to compare the hierarchy of two roles:

```ts
const comparisonResult = authorize.compare("taskManager", "user");
console.log(comparisonResult); // 1 (taskManager > user)
```

## Get Role Position

Get the position of a role in the hierarchy:

```ts
const rolePosition = authorize.getPosition("taskManager");
console.log(rolePosition); // 2
```

## License

[MIT License](/LICENSE.md)
npm package: @lehidev/camel-to-snake
Description: CamelCase to snake_case conversion
Author: Lehi Alcantara
Latest version: 1.0.6

# camel-to-snake
CamelCase to snake_case conversion

## Usage
```node
const camelToSnake = require('@lehidev/camel-to-snake');

Usage:
  camelToSnake('camelCase') // returns 'camel_case'
  camelToSnake('thisIsATest') // returns 'this_is_a_test'
  camelToSnake('word') // returns 'word'
  camelToSnake('') // returns ''
  camelToSnake('testHTTPResponse') // returns 'test_http_response'
  camelToSnake('test123Case') // returns 'test123_case'
  camelToSnake('already_snake_case') // returns 'already_snake_case'
```
npm package: @lehidev/cameltosnake
Description: CamelCase to snake_case conversion
Author: Lehi Alcantara
Latest version: 1.0.4

# camelToSnake
CamelCase to snake_case conversion

## Usage
```node
const camelToSnake = require('@lehidev/cameltosnake');

Usage:
  camelToSnake('camelCase') // returns 'camel_case'
  camelToSnake('thisIsATest') // returns 'this_is_a_test'
  camelToSnake('word') // returns 'word'
  camelToSnake('') // returns ''
  camelToSnake('testHTTPResponse') // returns 'test_http_response'
  camelToSnake('test123Case') // returns 'test123_case'
  camelToSnake('already_snake_case') // returns 'already_snake_case'
```
npm package: @lehidev/validator-util
Description: Validator Utilities
Author: Lehi Alcantara
Latest version: 1.0.5

# validator-util
Validator Utilities

```typescript
import { Validator } from "@lehidev/validator-util";

console.log(Validator.isEmail("test@example.com")); // true
console.log(Validator.isEmail("testexample.com")); // false
console.log(Validator.isPhoneNumber("+12345678901")); // true
console.log(Validator.isPhoneNumber("123456")); // false
console.log(Validator.matchesPattern("HELLO", /^[A-Z]+$/)); // true
console.log(Validator.matchesPattern("hello", /^[A-Z]+$/)); // false
```
npm package: @lehidev/validatorutil
Description: Validator Utilities
Author: Lehi Alcantara
Latest version: 1.0.4

# validatorUtil
Validator Utilities

```typescript
import { Validator } from "@lehidev/validatorutil";

console.log(Validator.isEmail("test@example.com")); // true
console.log(Validator.isEmail("testexample.com")); // false
console.log(Validator.isPhoneNumber("+12345678901")); // true
console.log(Validator.isPhoneNumber("123456")); // false
console.log(Validator.matchesPattern("HELLO", /^[A-Z]+$/)); // true
console.log(Validator.matchesPattern("hello", /^[A-Z]+$/)); // false
```