open-index/open-npm huggingface dataset:
npm package: @rugo-vn/common
Description: Shareable constants, functions, classes, etc between Rugo packages.
Author: Vu Anh Hao
Latest version: 1.0.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# Rugo Common

Shareable constants, functions, classes, etc between Rugo packages.

_Note: Cannot be used in Rugo Pipeline._

## Constants

- `DEFAULT_LIMIT`

## Functions

- `generateId`
- `wrapComposer`

```js
const composer = {
  argsParser => (...validateArgs) => (...targetArgs) => { return finalArgs; },
  returnParser => result => (...targetArgs) => { return finalResult; }
}
```

## Objects

### EmptyCollection

```js
const EmptyCollection = {
  id(){ },
  create(){ },
  get(){ },
  count(){ },
  list(){ },
  patch(){ },
  remove(){ }
}
```

### BaseCollection

```js
const BaseCollection = {
  id(){ },
  create(data){ },
  get(data, id){ },
  count(data, query),,
  list(data, query, controls){ },
  patch(data, query, controls){ }i,
  remove(data, query){ }
}
```

### BasePlugin

```js
const BasePlugin = {
  name: 'name-of-plugin',
  depends: ['register-1', 'register-2', 'register-3'],
  priority: 1,
  async start(context){ },
  async close(context){ }
}
```


### Composers

- `BaseComposer`
- `KoaComposer`

## API

[Visit API documentation.](./docs/API.md)

## License

MIT
npm package: @rugo-vn/exception
Description: ## List
Author: Vu Anh Hao
Latest version: 1.0.0

# Rugo Exception

## List

### Classes

- `RugoException`
- `ServiceError`
- `ValidationError`
- `AclError`
- `NotFoundError`
- `ForbiddenError`

### Methods

- `ajvError`
- `mongoError`

## License

MIT.
npm package: @rugo-vn/manage
Description: Manage platform tools.
Author: Vu Anh Hao
Latest version: 1.0.0-beta.0

# Rugo Manage

Platform management tools.

## Concept

- The platform share their state named `context`.
- State is passed into a unit called `task`.
- All tasks running together in the `runner`.
- Runner is working with multiple steps called `phrase`.

### Context

- At the begining, it's an empty object.
- Be passed into each `task`, the context attribute (`register`) can be changed.
- Task can be retrived the before task's `register` for read or write.

### Phrases

- `starting`
- `started`
- `closing`
- `closed`

### Runner

- Runner start, the pharse move into `starting`. All task's `starting` hooks will be run.
- After all tasks done, the pharse move into `started`. All task's `started` hooks will be run.
- Runner close, the phrase move into `closing`. All task's `closing` hooks will be run.
- Ater all closed, the phrase move into `closed`. All task's `closed` hooks will be run.

### Task

- Task is defined with many hooks named as same as pharse name.

## Usage

### Define a new task

```js
const task = createTask({
  // attributes
  name: 'name of the task',

  // methods
  starting: async (context) { /* ... */ },
  started: async (context) { /* ... */ },
  closing: async (context) { /* ... */ },
  closed: async (context) { /* ... */ },
});
```

If any hooks is not defined, it's will be used the default empty function.

### Define a runner

```js
const runner = createRunner([
  taskA,
  taskB,
  taskC
]);
```

### Running

```js
await runner.start(); // return stats
await runner.close(); // return stats
```

Results:

- `runner.context` Context of runner.
- 
- `stats[name][phrase].status` State of phrase: `success`, `error`.
- `stats[name][phrase].duration` Duration to run that phrase.

### Exceptions

Each task can has it's own error and not effect to another tasks.

### Logging

- The runner will log task info.
- You can log anything you want in task's methods with `this.log("your-message")` function.

## API

[Visit API documentation.](./docs/API.md)

## License

MIT
npm package: @rugo-vn/schema
Description: Validate and format data.
Latest version: 1.0.2

# Rugo Schema

Schema conversion.

## Rugo Schema

All services of the Rugo Ecosystem are using Rugo Schema as official data modeling.

Inspired of JSON Schema, it shoule be:

```js
const schema = new Schema({
  name: /* tableName, name of schema, use for naming collection */,
  icon: /* icon name of table */,
  /* other custom attributes */,
  type: 'Object', /* by default, it is an object */,
  properties: {
    fieldA: {
      type: 'TypeA', /* some attributes */,
      default: 'Value', /* default when it meet undefined value */,
      required: true, /* if this field is requried */,
      unique: true, /* if this field if unique */,
    },
    fieldB: {
      type: 'Array',
      items: {
        /* ... */,
      },
    },
    fieldC: {
      type: 'Object',
      properties: {
        /* ... */
      }
    },
    /* we have more default properties likes: */,
    id: { type: 'Id' },
    createdAt: { type: 'Date' },
    updatedAt: { type: 'Date' },
    version: { type: 'Number' },
  }
});
```

It will throws an error if meet invalid schema.

## Types

All types should be write in PascalCase.

**`Object`**

**`Id`**

- `ref` the name of table that you want to link.
- `lookup` the property of row that you want to show when linked.

## Handles

## Conversion

### To JSON Schema

### To Mongoose Schema

## License

MIT.
npm package: @rugo-vn/shared
Description: Shared modules between Rugo's services.
Author: Vu Anh Hao
Latest version: 1.0.0

# Rugo Shared

Shared modules between Rugo's services.

## Permission

Allow handle policies and permissions.

### Concept

Some part of Rugo Platform requires user's permissions to access. We call user's permissions is `perms`.

When you travel across some services, you receive an identity field into an object called `passport`.

At the end of the service (or action) you want to access, a security gate will check your `passport` and decide that you can access or not.

### `perms`

Each user after authentication will take their permissions from data storage. Format:

```js
const perms = [
  {
    rule: 'value',
  },
];
```

When `value` can be:

- specific value.
<!-- - functional value with `$gt`, `$lt`, `$gte`, `$lte`, `$eq`, `$neq`, `$regex`. -->
- wildcard value `*`.

### `passport`

After check your permissions with infomation data, you will receive:

```js
const passport = {
  rule: 'widest value range',
};
```

Your `passport` is your first matched permission in `perm` which remove checked rules.

E.g.

```js
const passport = {
  rowId: { $in: ['441', '223'] },
  userId: '789',
};
```

## Secure

You can use method in secure to do cryptography.

**`secure.encrypt`**

**`secure.decrypt`**

**`secure.hash`**

**`secure.hashPassword`**

**`secure.comparePassword`**
npm package: @rugo-vn/static
Description: Static file serving from local
Author: Vu Anh Hao
Latest version: 1.0.0

# Rugo Static

Static file serving from local

## Usage

```js
const static = createStatic({ root: '/root/directory/to/serve' });

await static(ctx, next);
```

## API

[Visit API documentation.](./docs/API.md)

## License

MIT
npm package: @rugo-vn/storage
Description: Store Management Service.
Author: Vu Anh Hao
Latest version: 1.0.2

# Rugo Storage

File management for Rugo Platform.

## Concepts

Every space have many items to store file, along with `table`, called `drive`.

## Settings

```js
const settings = {
  storage: /* root directory to store a file, should absolute path */,
}
```

## Commons

### Input Args

As same as `table`, `drive` should have `spaceId` and `driveName` as required args. But, we do not define schema for `drive`.

### Items

Each item in drive can be `file` or `dir` (folder) (called `entry`). But they have same infomation.

- `path`: Location of `entry`, related with `driveName`. Always beginning with slash `/` character.
- `name`: Name of `entry`.
- `mime`: Mime of `entry`, parsed from `path`. `inode/directory` if directory.
- `parent`: Parent path of `entry`, parsed from `path`. Always beginning with slash `/` character.
- `isDir`: Is directory or not.
- `size`: File size, `0` if directory.
- `data`: `FileCursor` to file, `null` if directory.
- `updatedAt`: `ctime` of `entry`.

## Actions

### `setConfig`

Arguments:

- `config`

Return:

- (type: `object`) config object.

### `getConfig`

Return:

- (type: `object`) config object.

### `create`

Arguments:

- `path` (type: `string`) path that you need to create entry.
- `isDir` (type: `boolean`) `true` if you need to create a directory. Default `false`.
- `data` (type: `FileCursor`) data to create a file. Default it will create an empty file.

### `list`

Arguments:

- `path` (type: `string`) path of directory to list.

Return:

- (type: `array`) result entries.

### `get`

Arguments:

- `path` (type: `string`) path of entry to get info.

Return:

- (type: `object`) entry object.

### `remove`

Arguments:

- `path` (type: `string`) path of remove file.

Return:

- (type: `object`) entry object.

### `move`

Arguments:

- `from` (type: `string`) src path to move.
- `to` (type: `string`) dest path move to, this is a new entry.

### `compress`

Arguments:

- `from` (type: `string`) path of entry to compress.
- `to` (type: `string`) dest path to put compress file, it will create a new file.

Return:

- (type: `object`) entry object.

### `extract`

Arguments:

- `from` (type: `string`) path of entry to extract.
- `to` (type: `string`) dest path to put extract content, it will create a new directory.

Return:

- (type: `object`) entry object.

## License

MIT.
npm package: @rugo/caddy
Description: Interaction and mocking caddy server.
Author: HaoVA
Latest version: 1.0.1

# Rugo Caddy

Interaction and mocking caddy server.

## Usage

```bash
npm run dev
```

## Test

In mock env

```bash
npm run test:mock
```

In docker env

```bash
npm run docker:start
```

```bash
npm run docker:exec
npm run test:real
```

## Author

HaoVA <hi@haova.me> (https://www.haova.me)

## License

MIT.
npm package: @rugo/db
Description: DB service for Rugo Platform
Author: Vu Anh Hao
Latest version: 1.0.0-beta.0

# Rugo DB

DB Service for Rugo Platform

## Usage

```bash
node src/start.js

# or

npm run start
```

## Enviroments

- `PORT` port to mount
- `DIRECTORY` or set directory server to get config
- `MONGO` mongo db uri

## Incoming Request

Every request to this service, must have `x-rugo-schema` as a schema.

```json
{
  "name": "collection's name",
  "properties": {
    /* mongoose schema */
  }
}
```

## API

- **`GET /`** -> get/find by query conditions
- **`GET /:id`** -> get/find by query conditions and document id
- **`POST /`** -> create a new document
- **`PUT /:id`** -> replace document which found by document id and query conditions
- **`PATCH /:id`** -> update partial of document which found by document id and query conditions
- **`DELETE /:id`** -> delete a document which found by document id and query conditions

## Exception

```json
{
  "errors": [{ "type": "error type", "message": "error message" /* and more for tracking */ }]
}
```

## License

MIT.
npm package: @rugo/service
Description: Rugo's Service from NodeJS based on KoaJS
Author: Vu Anh Hao
Latest version: 1.0.3

# Rugo Service

## Install

```bash
npm i @rugo/service
```

## Usage

```js
import { createService } from '@rugo/service';

const service = await createService({
  /* required */
  name: /* name of service */,

  /* optional */
  port: /* port info*/,
  keys: /* secret keys */,

  /* or */
  directory: /* directory endpoint to get config */
});

// service is a KoaJS's wrapped

await service.start();
await service.stop();
```

## Directory

Service directory is a special service that manage all service config.

```bash
node ./src/directory.js

# or

npm run directory
```

You should set `PORT` in env, if not, `2023` is default.

## Chain

Run many services in a single instance (Microservices -> Monolithic).

```js
const serviceA = createService(/* config */);
const serviceB = createService(/* config */);
const serviceC = createService(/* config */);

serviceA.use(serviceB).use(serviceC);

/* or */
serviceB.use(serviceC);
serviceA.use(serviceB);

/* then */
await serviceA.start();
await serviceA.stop();
```

## License

MIT.
npm package: @rugpanov/todo-cli
Description: A CLI TODO tracker with Supabase backend
Author: rugpanov
Latest version: 1.4.0

# todo-cli-tracker

A CLI TODO tracker with Supabase backend.

## Installation

```bash
npm install -g todo-cli-tracker
```

## Configuration

Create `~/.todo-cli.env` or `.env` in your working directory:

```env
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
TELEGRAM_CHAT_ID=your-user-id
```

## Usage

```bash
# Add a task (due tomorrow, priority P1)
todo add "Buy groceries"

# Add with specific date
todo add "Meeting" today
todo add "Report" 2026-02-15

# Add with priority
todo add "[P2] Review docs" tomorrow

# List all pending tasks
todo list

# Mark task as done
todo done 5

# Postpone task to tomorrow
todo snooze 3

# Add subtask
todo subtask 2 "Review section A"

# Help
todo help
```

## Commands

| Command | Description |
|---------|-------------|
| `add <task> [date]` | Add task (default: due tomorrow, P1) |
| `list` / `ls` | Show all pending tasks |
| `done <id>` | Mark task as complete |
| `snooze <id>` | Postpone to tomorrow |
| `subtask <id> <task>` | Add subtask to existing task |
| `help` | Show help |

## Priority Levels

- `[P0]` — Emergency
- `[P1]` — High (default)
- `[P2]` — Medium
- `[P3]` — Low
- `[P4]` — Someday

## Date Formats

- `today` — Due today
- `tomorrow` — Due tomorrow (default)
- `YYYY-MM-DD` — Specific date

## License

MIT