open-index/open-npm huggingface dataset:
npm package: @moinuddin_shaikh/encryptiondecryption
Description: A lightweight Node.js library for encrypting and decrypting data using AES-256-CBC with double-seed-based key generation.
Author: Moinuddin
Latest version: 1.0.1


# Double Seed Encryption

Double Seed Encryption is a lightweight Node.js library for encrypting and decrypting data using the AES-256-CBC algorithm with a double-seed-based key generation approach. This ensures robust data security, making it suitable for a wide range of applications.

## Features
Double-Seed Security: Combines two seeds to generate a strong encryption key.
Data Type Support: Works with text, strings, and JSON objects.
AES-256-CBC Encryption: Provides a secure and widely-used encryption algorithm.
No External Dependencies: Uses the built-in Node.js crypto module.
Simple API: Easy-to-use functions for encryption and decryption.

## Installation
Install the package using NPM:

## bash

npm install double-seed-encryption

## Usage
Encrypting and Decrypting Text Data

javascript

const { encrypt, decrypt } = require('double-seed-encryption');

// Define seeds
const seed1 = 'myFirstSeed';
const seed2 = 'mySecondSeed';

// Data to encrypt
const textData = 'This is some sensitive information';

// Encrypt data
const encryptedData = encrypt(textData, seed1, seed2);
console.log('Encrypted Data:', encryptedData);

// Decrypt data
const decryptedData = decrypt(encryptedData, seed1, seed2);
console.log('Decrypted Data:', decryptedData);


## Encrypting and Decrypting JSON Data

javascript

const jsonData = { username: 'testUser', permissions: ['read', 'write'] };

// Encrypt JSON object
const encryptedJson = encrypt(jsonData, seed1, seed2);
console.log('Encrypted JSON:', encryptedJson);

// Decrypt JSON object
const decryptedJson = decrypt(encryptedJson, seed1, seed2);
console.log('Decrypted JSON:', decryptedJson);

## API Reference

encrypt(data, seed1, seed2)

data: The data to encrypt (string, text, or JSON object).
seed1: The first seed used for key generation.
seed2: The second seed used for key generation.
Returns: An encrypted string in the format IV:EncryptedData.

decrypt(encryptedData, seed1, seed2)

encryptedData: The encrypted string in the format IV:EncryptedData.
seed1: The first seed used during encryption.
seed2: The second seed used during encryption.
Returns: The original data (string or JSON object).

## Example Use Cases

Secure API payloads with JSON data.
Encrypt configuration files or sensitive application data.
Protect user credentials during transmission.

## Testing
Run tests to ensure everything works correctly:

## bash

npm test

## Repository and Issues

Repository: GitHub
Issues: GitHub Issues

## License

This project is licensed under the MIT License. See the LICENSE file for details.
npm package: @moirae/node-plugin
Description: NodeJS port of Moirae Core module to enable usage in non-NestJS environments. Note this is not the ideal configuration and should only be used in edge cases.
Latest version: 0.6.0

# @moirae/node-plugin

NodeJS port of Moirae Core module to enable usage in non-NestJS environments. Note this is not the ideal configuration and should only be used in edge cases.

## Supported Features

- [ ] AggregateFactory
- [ ] Command Execution
- [x] Command Listening
- [ ] Event Listening
- [ ] Event Persistence
- [ ] Event PubSub
- [ ] Query Execution
- [x] Query Listening

## Setup

Moirae requires more advanced configuration when operating in this mode. As an example with RabbitMQ:

```js
const {ObservableFactory} = require('@moirae/core');
const {MoiraePlugin} = require('@moirae/node-plugin');
const {RabbitMQConnection, RabbitMQPublisher} = require('@moirae/rabbitmq');

// Define the parameters of the connection and initialize it
const rabbitMQConfig = {/* config contents */};
const connection = new RabbitMQConnection(rabbitMQConfig);

const moirae = new MoiraePlugin({
    domains: ["myApp"],
    // Provide a way to instantiate new Publisher instances
    getCommandPublisher: () =>
        new RabbitMQPublisher(new ObservableFactory(), rabbitMQConfig, rmqConnection),
    getEventPublisher: () =>
        new RabbitMQPublisher(new ObservableFactory(), rabbitMQConfig, rmqConnection),
    getQueryPublisher: () =>
        new RabbitMQPublisher(new ObservableFactory(), rabbitMQConfig, rmqConnection)
});

// Add Query/Command handlers
moirae.injectCommandHandler(...);
moirae.injectQueryHandler(...);

// Initialize
await rmqConnection.onModuleInit();
await moirae.init();

// ... App logic ...

// Teardown
await rmqConnection.onApplicationShutdown();
await moirae.tearDown();
```

When operating in a non-NestJS environment, the plugin must compensate for the lack of a Dependency Injection container and therefore creates one itself. However the user must provide some key elements: namely the publisher and event store as they must be created independently of Moirae.

Additionally the lifecycle methods of NestJS may need to be managed independently. In the above example, the connection lifecycle methods of `onModuleInit` and `onApplicationShutdown` are not called for the RabbitMQConnection automatically. These methods are handled for all elements gotten from the MoiraePlugin, including the Publishers generated on startup.

### Commands, Events, Queries

Commands, Events, and Queries must be duplicated across all systems as the DTOs are key for the usage of Moirae.
npm package: @moirae/rabbitmq
Description: A Moirae publisher leveraging RabbitMQ as a transport layer providing: - RabbitMQConnection: a connection instance for RabbitMQ. Can be resused (e.g. PubSub) - RabbitMQPublisher: Override the default `PUBLISHER` token - RabbitPubSubEngine: Override the de
Latest version: 0.6.0

# @moirae/rabbitmq

A Moirae publisher leveraging RabbitMQ as a transport layer providing:
- RabbitMQConnection: a connection instance for RabbitMQ. Can be resused (e.g. PubSub)
- RabbitMQPublisher: Override the default `PUBLISHER` token
- RabbitPubSubEngine: Override the default `EVENT_PUBSUB_ENGINE` token

## Lifecycle
**`onModuleInit`**
- Initialize connection to RabbitMQ

**`onApplicationBootstrap`**
- Initialize RabbitMQPublisher
- Initialize RabbitPubSubEngine

**`beforeApplicationShutdown`**
- Tear down RabbitMQPublisher
- Tear down RabbitPubSubEngine

**`onApplicationShutdown`**
- Tear down connection to RabbitMQ

## External Systems
In cases where events should be published externally to the application (in the case of analytics for instance), there are two ways to subscribe to the event stream.

### Pre-processing
To subscribe pre-processing, meaning before the core application has processed but after storing the event, first create a queue for the service and bind the queue to the event store exchange.

Related: [Fanout Exchange](https://www.rabbitmq.com/tutorials/tutorial-three-python.html)

### Post-processing
To subscribe post-processing within the core application, simply create a queue and bind it to the pubsub exchange.
npm package: @moirae/redis
Description: A cache provider for Moirae leveraging Redis.
Latest version: 0.6.0

# @moirae/redis

A cache provider for Moirae leveraging Redis.

## Configuration
```ts
{
  /**
   * Connection parameters for the underlying `redis` library
   */
  redis: RedisClientOptions;
  /**
   * Namespace root that prefixes all elements of the cache
   */
  namespaceRoot: string;
  /**
   * Duration in seconds to persist transaction information in the redis cache
   * after last interaction.
   *
   * @default 172800 (48hrs)
   */
  transactionCacheDuration?: number;
  type: "redis";
}
```
npm package: @moirae/typeorm
Description: A Moirae plugin leveraging a SQL database providing: - EventStore: entity model for the database table - TypeORMStore: overriding the default `EVENT_STORE` token
Latest version: 0.6.0

# @moirae/typeorm

A Moirae plugin leveraging a SQL database providing:
- EventStore: entity model for the database table
- TypeORMStore: overriding the default `EVENT_STORE` token

- KeyValue: entity model for a key-value cache
- SetRoot/SetValue: entity models for a set cache
- TypeORMCache: overriding the default `CACHE` token

## Compatibility
The following have been tested with Moirae and are known to be compatible.
- [x] sqlite3
- [x] postgresql

## Usage
When using this module, it's required to explicitly import `TypeOrmModule.forFeature(<EntityArr>)` into the Moirae config. The `<EntityArr>` should contain:
- The `EventStore` entity if using TypeORM as an event store
- The `CACHE_ENTITIES` array if using TypeORM as a cache

The TypeORM plugin may be used as an event store, a cache, or both.

```ts
MoiraeModule.forRootAsync({
    cache: {
        type: "typeorm",
    },
    imports: [TypeOrmModule.forFeature([EventStore, CACHE_ENTITIES])],
    store: {
        type: "typeorm",
    }
})
npm package: @moirei/dobby
Description: GraphQL data models made easy.
Author: Augustus Okoye
Latest version: 1.9.0

# @moirei/dobby

Dobby is a GraphQL query builder and CRUD client that makes working with graphql data sources and object models enjoyable. It's patterned after the [OpenCRUD](https://www.opencrud.org/) standard with [Prisma](https://www.prisma.io/) and [Laravel Lighthouse](https://lighthouse-php.com/) backends in mind.

```javascript
import User form '~/models/user'
...

const users = await User.select('id', 'name', 'email')
                        .with('posts')
                        .findMany();
```



## Documentation

All documentation is available at [the documentation site](https://moirei.github.io/dobby).


## :green_heart: Unique Features

- Basic **CRUD** operations
- Declarative and extensible Data **Models** and Object-relational mapping
- Flexible **Query Builder** for progressively defining complex query fields and relationships
- Models **Attributes** casting and mutation
- **Adapters** to make working with workspaces and different backends easy
- Model **Hooks** make it possible to further configure how individual models handle common CRUD operations.


## Installation

You can install the package via npm:

```bash
npm i @moirei/dobby
```

## Changelog

Please see [CHANGELOG](./CHANGELOG.md).

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.