open-index/open-npm huggingface dataset:
npm package: @microflash/gridsome-plugin-feed
Description: Gridsome plugin to generate RSS, Atom and JSON feeds
Latest version: 1.2.2

# Gridsome Feed Plugin 

[![npm](https://img.shields.io/npm/v/@microflash/gridsome-plugin-feed)](https://www.npmjs.com/package/@microflash/gridsome-plugin-feed)
[![license](https://img.shields.io/npm/l/@microflash/gridsome-plugin-feed)](./LICENSE.md)

A Gridsome plugin to generate RSS, Atom and JSON feeds

## Install

```sh
yarn add @microflash/gridsome-plugin-feed
npm install @microflash/gridsome-plugin-feed
```

## Usage

```js
// gridsome.config.js

module.exports = {
  plugins: [
    {
      use: '@microflash/gridsome-plugin-feed',
      options: {

        // (required) Provide GraphQL collection types
        contentTypes: ['BlogPost'],

        // (optional) Properties used by feed API
        // See https://github.com/jpmonette/feed#example for all options
        feedOptions: {
          title: 'My blog',
          description: 'My Personal blog on books, cookies and kittens'
        },

        // Available options with their default values

        // (optional) Options for feed formats
        // RSS is enabled by default
        rss: {
          enabled: true,
          output: '/feed.xml'
        },
        atom: {
          enabled: false,
          output: '/feed.atom'
        },
        json: {
          enabled: false,
          output: '/feed.json'
        },

        // (optional) number of items to include in a feed
        maxItems: 25,

        // (optional) an array of properties to be parsed as HTML
        // Converts relative URLs to absolute URLs
        // You can disable this by omitting the option
        htmlFields: ['content'],

        // (optional) appends a trailing slash to the URLs
        enforceTrailingSlashes: false,

        // (optional) a function to filter out the nodes
        // e.g., filter out all outdated posts, filterNodes: (node) => !!node.outdated
        filterNodes: (node) => true,

        // (optional) sets the properties on each feed item
        // See https://github.com/jpmonette/feed#example for all options
        nodeToFeedItem: (node) => ({
          title: node.title,
          date: node.date,
          content: node.content
        })
      }
    }
  ]
}
```

## Contribute

Feel free to contribute to the project. Take a look at the [contribution guidelines](./CONTRIBUTING.md) to get started.

## Credits

[@onecrayon](https://github.com/onecrayon/gridsome-plugin-feed) for implementing the [original plugin](https://github.com/onecrayon/gridsome-plugin-feed)
npm package: @microflash/preset
Description: A modern CSS preset
Author: Naiyer Asif
Latest version: 8.0.1

<img width="128" alt="Preset" src="icon.png">

[![npm](https://img.shields.io/npm/v/@microflash/preset)](https://www.npmjs.com/package/@microflash/preset)
[![license](https://img.shields.io/github/license/Microflash/preset)](./LICENSE.md)

A modern CSS preset

- [What's this?](#whats-this)
- [Install](#install)
- [Use](#use)
- [Browser support](#browser-support)
- [API](#api)
- [Credits](#credits)
- [License](#license)

## What's this?

`preset` is a CSS reset to baseline the browser styles. It gives you a uniform foundation to build your custom styles on top of.

## Install

In Node.js, install with [npm](https://docs.npmjs.com/cli/install):

```sh
npm install @microflash/preset
```

In Deno, with [unpkg.com](https://unpkg.com):

```js
import "https://unpkg.com/@microflash/preset";
```

In browsers, with [unpkg.com](https://unpkg.com) or [jsdelivr.net](https://jsdelivr.net):

```html
<link rel="stylesheet" href="https://unpkg.com/@microflash/preset">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@microflash/preset">
```

## Use

In Node.js or Deno, import the CSS in the entrypoint file of your application.

```js
import "@microflash/preset";
// or using URL import
import "https://unpkg.com/@microflash/preset";
```

Make sure that this is the first CSS import before including any other CSS files.

## Browser support

`preset` supports [modern browsers](https://browsersl.ist/#q=defaults).

## API

You can customize some aspects of `preset` through CSS properties. You can define these properties in `:root` or `html` scope.

- `--preset-line-height` (default: `calc(0.3rem + 2ex + 0.3rem)`) to set the line-height
- `--preset-tab-size` (default: `2`) to set the width of code block indentation
- `--preset-outline-transition` to set the transition applied on the outline
- `--preset-dialog-backdrop-filter` (default: `blur(25px)`) to set the backdrop filter of the dialog
- `--preset-table-caption-side` (default: `bottom`) to set caption position of a table caption
- `--preset-scroll-offset` (default: `3rem` or `3rlh` depending on browser support) to set `scroll-margin-block` for an element

## Credits

[Adam Argyle](https://github.com/argyleink/open-props/blob/45a735169c62544a176b1d95384aeaf00d81862e/src/extra/normalize.src.css#L1), [Andy Bell](https://andy-bell.co.uk/a-more-modern-css-reset/), [Elly Loel](https://gist.github.com/EllyLoel/4ff8a6472247e6dd2315fd4038926522), [Harry Roberts](https://twitter.com/csswizardry/status/1717841334462005661), [Jeremy Thomas](https://github.com/jgthms/minireset.css), [Jesús Ricarte](https://kittygiraudel.com/2020/05/18/using-calc-to-figure-out-optimal-line-height/), [Josh Comeau](https://www.joshwcomeau.com/css/custom-css-reset/), [Kevin Powell](https://www.youtube.com/watch?v=cCAtD_BAHNw)

## License

[MIT](./LICENSE.md)
npm package: @microfleet/apidoc-plugin-json-schema
Description: The `apidoc` plugin that provides `@jsonSchema` keyword.
Author: Vitaly Aminev
Latest version: 0.1.3

# Microfleet JSON Schema apidoc plugin

The `apidoc` plugin that provides `@jsonSchema` keyword.

## Install
`yarn add @microfleet/apidoc-plugin-json-schema`

## Additional apidoc configuration

```javascript
// apidoc.config.js
const { resolve } = require('path')

module.exports = {
  schemas: {
    path: resolve(__dirname, './schemas') // path to the schemas folder
  }
}

```

## Usage
`@apiSchema {jsonschema={relative path to schemas folder}} api{Request|Response}`

Example:

```javascript
/**
 * @apiSchema {jsonschema=path/to/schema.json} apiRequest
 * @apiSchema {jsonschema=path/to/response/schema.json} apiResponse
 */
export function DoWork() {}
```
npm package: @microfleet/callback-queue
Description: Put your callbacks into queue to make sure that concurrent requests that you might want to perform will only be executed once
Author: Vitaly Aminev
Latest version: 5.0.0

# Callback queue

[![Codacy Badge](https://www.codacy.com/project/badge/a8696114e713425083cdd7cd2d44db34)](https://www.codacy.com/app/v/callback-queue)

Node.js callback queue. Can be used with browserify as well.

Idea is to queue callbacks, when same function wants to be called at the same time
by different callers.

One example would be conserving resources spent on outgoing http requests.

`npm install callback-queue -S`

## Example usage

1. `callbackQueue.add(String, Function)`: queues callbacks based on key attribute
2. `callbackQueue.remove(String, Error)`: calls queued callbacks with Error argument

```js
const callbackQueue = require('callback-queue');
const request = require('request');

function performOutgoingRequest(url, next) {
  const callback = callbackQueue.add(url, next);
  if (!callback) {
    return;
  }

  request(url, callback);
}

for (let i = 0; i < 100; i++) {
  // request itself will be performed just once
  performOutgoingRequest('https://google.com', function niceCallback(err, resp, body) {
    // will be called 100 times
  });
}

for (let x = 0; x < 100; x++) {
  // request itself will be performed just once
  performOutgoingRequest('https://google.com', function niceCallback(err, resp, body) {
      // will be called 100 times with Error object
  });
}

callbackQueue.remove('https://google.com', new Error('cancel it!'));
```
npm package: @microfleet/cli
Description: cli to access microservices over amqp through command line
Author: Vitaly Aminev
Latest version: 2.0.0

# @microfleet/cli

CLI for running commands against AMQP transport in @microfleet/core services.

```sh
Usage: bin/ms-cli.js --q.offset=0 --q.limit=10 -r payments.transactions.common

Options:
  --port, -p      rabbitmq port                                  [default: 5672]
  --host, -h      rabbitmq host                           [default: "localhost"]
  --login, -l     rabbitmq user                               [default: "guest"]
  --password, -P  rabbitmq password                           [default: "guest"]
  --route, -r     rabbitmq routing key                                [required]
  --query, -q     query object                                     [default: {}]
  --timeout, -t   request timeout                               [default: 15000]
  --config        Path to JSON config file
  --help          Show help                                            [boolean]
```

## Usage example

Assuming you are running node 8.x.x, where `npx` is bundled you can do the following
to run commands against AMQP-enabled endpoints

```sh
$ docker exec -it <@microfleet/container-name> sh
$ npx @microfleet/cli -r pdf.render -q '{"meta":false,"context":{},"template":"sample"}'
```

Response will be printed to stdout/stderr based on success/failure of the request
In the real-world you'd likely want to run some less complicated requests or prepare them
elsewhere and just use this cli to issue requests so that they end up correctly serialized
and response is then correctly deserialized and printed
npm package: @microfleet/html-to-pdf
Description: Generates PDF files based on the HTML inputs and arbitrary data. Can be handy to create statements. Features integration with @microfleet/files for distributed storage and access control to such files
Author: Vitaly Aminev
Latest version: 2.0.0

# @microfleet/html-to-pdf

<img alt="Microfleet PDF" src="https://raw.githubusercontent.com/microfleet/html-to-pdf/master/assets/mf-concept-pdf.png" width="412" height="208" />

HTML to PDF @microfleet service is designed to render any provided mustache template with arbitrary context and is able to send back base64 encoded PDF or upload id in case of integration with @microfleet/files

## Configuration

* Consult with [@microfleet/core](https://github.com/microfleet/core) for generic configuration
* [configuration schema](schemas/config.json) - service configuration options

By default delayed-retry on Quality of Service is enabled, which effectively retries actions when
unexpected errors occur up to 5 times by default with exponential delay.

## API

Description of available API methods

### `pdf.render`

Renders `mustache` template with passed context, feeds that document to Chrome & save it as PDF. Then uploads it to storage of choice using [@microfleet/files](https://github.com/makeomatic/ms-files) or returns PDF as base64 encoded data

Following params are accepted:

```js
{
  "template": "name-of-the-template-to-render",
  "context": {
    ... // arbitrary object with data thats passed to template for rendering
  },
  "documentOptions": {
    ... // chrome's printToPdf document options - https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-printToPDF
  },
  "meta": {
    ... // can be boolean `false` to turn off @microfleet/files integration
    ... // or can be an object defining the upload
  },
}
```

For a detailed description of API params look at [validation schema](schemas/render.json)
npm package: @microfleet/mdoc
Description: The CLI tool that Generates documentation in Markdown from `apidoc` generated data.
Author: Vitaly Aminev
Latest version: 0.1.4

# Apidoc Markdown generator

The CLI tool that Generates documentation in Markdown from `apidoc` generated data.

## Install
`yarn add @microfleet/mdoc`


## Usage

```console
Usage: mdoc-markdown -p <path> -o <output_file> [-t <template_path>] [--multi] [--createPath] [--prepend <file_path>]

Options:
  --version         Show version number                                                                                  [boolean]
  --apiDocPath, -p  Path to generated apiDoc output directory. Where `api_data.json` and `api_project.json` resides.
                                                                                                               [string] [required]
  --output, -o      Output file or directory to write output to.                                               [string] [required]
  --template, -t    Path to EJS template file, if not specified default template will be used.
                                [string] [default: "/Users/pajgo/work/pajgo/microfleet_docgen/packages/mdoc/template/default.ejs"]
  --prepend         Path to file content to add before route groups documentation.                                        [string]
  --multi           Output one file per group to the `output` directory.                                [boolean] [default: false]
  --createPath      Recursively create directory to the `output` directory.                [boolean] [default: false]
  -h, --help        Show help                                                                                            [boolean]

Examples:
  mdoc-markdown -p doc/ -o doc.md                     Generate from `doc/` apiDoc output to `./doc.md`
  mdoc-markdown -p doc -o multi --multi --createPath  Generate from `doc/` apiDoc output to `./multi/<group>.md`
```

## Configuration
Cli arguments are read from: `.mdocrc.js`, `.mdocrc.json`, `.mdocrc` files.

Example:

```javascript
module.exports = {
  createPath: true,
  apiDocPath: './apidoc',
  output: 'docs/API.md',
  multi: false,
}
```

## Example

```console
$@: yarn apidoc -i ./src -o ./.apidoc && yarn mdoc-markdown -p ./.apidoc -o docs/API.md
```
npm package: @microfleet/plugin-aws-elasticsearch
Description: Add aws-elasticsearch service support
Author: Vitaly Aminev
Latest version: 8.0.0

# Microfleet AWS-Elasticsearch Plugin

Adds AWS Elastic service support to microfleet. 

## Install

`yarn add @microfleet/plugin-aws-elasticsearch`

## Configuration

To make use of the plugin, adjust microfleet configuration in the following way:

```ts
exports.plugins = [
  ...,
  'aws-elasticsearch'
  ...
]
```

```ts
exports.awsElasticsearch = {
  'awsAccessKey',
  'awsSecretKey',
  'node',
  'region'
}
```
npm package: @microfleet/plugin-consul
Description: hashicorp consul adapter
Author: Vitaly Aminev
Latest version: 9.0.0

# Microfleet Consul Plugin

Adds consul support to microfleet. This can be used to perform
service discovery, leader election and other related tasks
Read more about Consul at https://www.consul.io

## Install

`yarn add @microfleet/plugin-consul`

## Configuration

To make use of the plugin adjust microfleet configuration in the following way:

```ts
exports.plugins = [
  ...,
  'consul',
  ...
]

/* this section is optional */
exports.consul = {
  base: {
    host?: string; // consul-agent host instance
    port?: string; // consul-agent port
    secure?: boolean; // https?
    ca?: string[]; // custom CA
    defaults?: { // used for all queries to consul
      consistent?: boolean;
      dc?: string;
      stale?: boolean;
      token?: string;
      wait?: string;
      wan?: boolean;
      timeout?: number;
    }
  },
  lock: {
    key?: string; // defaults `microfleet/${config.name}/leader`,
    session?: Object | string; // session settings
    value?: string | Buffer; // arbitrary data
    lockwaittime?: string;
    lockretrytime?: string;
  }
}
```

## Interface

Microfleet Consul Plugin extends service interface with the following methods:

### service.consul: consul.Consul

Initialized instance. Look at the docs here - https://www.npmjs.com/package/consul#documentation

### service.consulLeader: consul.Lock

Initialized leader election lock. Detailed docs here - https://www.npmjs.com/package/consul#lock

### service.whenLeader(): Promise<boolean>

Use this to wait until current instance becomes a leader.

```ts
// will lock until instance is a leader
// or until service.close() is called
const isLeader = await service.whenLeader()
if (isLeader === true) {
  ... // means we've acquired leader
} else {
  ... // this means that instance is closing down
}
```
npm package: @microfleet/plugin-couchdb
Description: couchdb adapter for microfleet
Author: Vitaly Aminev
Latest version: 9.0.0

# Microfleet CouchDB Plugin

Adds CouchDB support to microfleet. Learn more at https://github.com/apache/couchdb-nano and
https://couchdb.apache.org/

## Install

`yarn add @microfleet/plugin-couchdb`

## Configuration

To make use of the plugin adjust microfleet configuration in the following way:

```ts
exports.plugins = [
  ...,
  'couchdb',
  ...
]

exports.couchdb = {
  connection: 'http://username:password@database:5984', // will connect to this instance
  database: 'sample', // all operations will be scoped to this database
  indexDefinitions: [{ // optional section for indexes to be created on startup
    fields: ['_id', 'name'],
    name: 'basic',
    ddoc: '_id_for_index', // this is important so that we dont create the same index over and over again
  }]
}
```

## Interface

`service.couchdb` exposes document functions interface as described in here:
https://github.com/apache/couchdb-nano#document-functions
npm package: @microfleet/plugin-dlock
Description: Wrapper for [Distributed callback queue](https://github.com/AVVS/distributed-callback-queue).
Author: Vitaly Aminev
Latest version: 7.0.0

# Microfleet DLock Plugin

Wrapper for [Distributed callback queue](https://github.com/AVVS/distributed-callback-queue).

## Install

`yarn add @microfleet/plugin-dlock`

## Configuration

To make use of the plugin adjust microfleet configuration in the following way:

```ts
exports.plugins = [
  ...,
  'redisCluster', // or 'redisSentinel'
  'dlock',
  ...
]

exports.dlock = {
  // pubsubChannel: string;
  // lock?: {
  //   timeout?: number;
  //   retries?: number;
  //   delay?: number;
  // };
  // lockPrefix: string;
}
```

## Interface

Microfleet DLock Plugin extends service interface with the following methods:

### service.dlock: type of 'dlock'

Initialized instance. Look at the docs here - https://github.com/AVVS/distributed-callback-queue
npm package: @microfleet/plugin-hapi
Description: hapi
Author: Vitaly Aminev
Latest version: 7.0.0

# @microfleet/plugin-hapi

## Usage

```js
const service = new Microfleet({
  name: 'http-server',
  plugins: [
    'validator', // essensial plugin
    'logger', // essensial plugin
    'hapi',
  ],
  hapi: {
    // server: Hapi server options
    // plugins: list of plugins
    // views: list of views (e.g. html templates)
  }
})

await service.connect()

// service.hapi -- instance of Hapi server
```
npm package: @microfleet/plugin-kafka
Description: Apache Kafka adapter for microfleet
Author: Tigran Avetisyan
Latest version: 9.0.0

# Microfleet Kafka Plugin

Adds Kafka support to microfleet. Provides Stream like API for sending messages to Kafka broker.

For more information please read about [node-rdkafka](https://github.com/Blizzard/node-rdkafka).

## Install

`yarn add @microfleet/plugin-kafka`

## Configuration

To make use of the plugin, adjust microfleet configuration in the following way:

```ts
exports.plugins = [
  ...,
  'kafka',
  ...
]

exports.kafka = {
  // librdkafka configuration
  // https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md
  debug: 'consumer,cgrp,topic,fetch',
  'metadata.broker.list': 'kafka:9092',
  'group.id': 'test-group',
}
```

## Interface

Microfleet Kafka Plugin extends service interface with the following methods:

### async service.kafka.createReadStream({ streamOpts, conf, topic }): Readable

Initializes Kafka Consumer stream using provided params and creates a Readable stream.
This is the reimplementation of the `node-rdkafka.ConsumerStream` stream with some addons.
Extra parameters:
```javascript
const streamOpts = {
  checkTopicExists: boolean, // Check whether consumed topics exist.
  stopOnPartitionsEOF: boolean, // Stop stream when all assigned partitions read.
  offsetQueryTimeout: number, // Milliseconds Timeout for Broker requests.
  offsetCommitTimeout: number, // Milliseconds to wait for offset commits received on stream close.
}
```

### async service.kafka.createWriteStream({ streamOpts, conf, topic }): Writable

Initializes Kafka producer using provided params and creates a Writable stream.
Detailed docs here - https://blizzard.github.io/node-rdkafka/current/ProducerStream.html

## Parameter description

For information about parameters passed to the interface methods:

* `streamOpts` - See [this](../plugin-kafka-types/index.d.ts) for `ConsumerStream` or [this](https://blizzard.github.io/node-rdkafka/current/ProducerStream.html) for `ProducerStream`
* `conf` - See [this page](https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md)
* `topic` - See [this page](https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md#topic-configuration-properties)

## Example

```js
producerStream = await service.kafka.createProducerStream({
  streamOptions: { objectMode: true, pollInterval: 10 },
  conf: {'group.id': 'other-group'},
})

consumerStream = await service.kafka.createConsumerStream({
  streamOptions: { topics: topic, streamAsBatch: true, fetchSize: 10 },
  conf: {
    debug: 'consumer',
    'enable.auto.commit': false,
    'client.id': 'someid',
    'group.id': 'other-group',
  },
  topic: {
    'auto.offset.reset': 'earliest', // 'earliest | latest' - earliest will start from las committed offset, latest - will start from last received message.
  }
)

// and then
producerStream.write({
  topic,
  value: Buffer.from(`message at ${Date.now()}`),
}, cb)

// or
producerStream.write(Buffer.from(`message at ${Date.now()}`), cb)

for await (const message of consumer) {
  // process message
}
```
npm package: @microfleet/plugin-knex
Description: knex - universal *sql adapter for microfleet
Author: Vitaly Aminev
Latest version: 9.0.0

# Microfleet Knex Plugin

Adds Knex support to microfleet. This can be used to interact with \*SQL
databases

## Install

`yarn add @microfleet/plugin-knex`

## Configuration

To make use of the plugin adjust microfleet configuration in the following way:

```ts
interface Config {
  debug?: boolean;
  client?: string | typeof Client;
  dialect?: string;
  version?: string;
  connection?:
    | string
    | ConnectionConfig
    | MariaSqlConnectionConfig
    | MySqlConnectionConfig
    | MsSqlConnectionConfig
    | OracleDbConnectionConfig
    | Sqlite3ConnectionConfig
    | SocketConnectionConfig;
  pool?: PoolConfig;
  migrations?: MigratorConfig;
  postProcessResponse?: (result: any, queryContext: any) => any;
  wrapIdentifier?: (
    value: string,
    origImpl: (value: string) => string,
    queryContext: any
  ) => string;
  seeds?: SeedsConfig;
  acquireConnectionTimeout?: number;
  useNullAsDefault?: boolean;
  searchPath?: string | string[];
  asyncStackTraces?: boolean;
  log?: Logger;
}

// make sure to add this to the list of loadable plugins
exports.plugins = [
  ...,
  'knex',
  ...
]

// knex configuration
exports.knex: Config = { ... }
```

## Interface

Microfleet Knex Plugin extends service interface with the following methods:

### service.knex: Knex

Initialized instance. Look at the docs here - http://knexjs.org/
npm package: @microfleet/plugin-router
Description: Router for `Microfleet`. Adds ability to call specific functions - `ServiceAction` - using different transports (`amqp`, `http`, `socketio`).
Author: Vitaly Aminev
Latest version: 7.0.0

# @microfleet/plugin-router

Router for `Microfleet`. Adds ability to call specific functions - `ServiceAction` - using different transports (`amqp`, `http`, `socketio`).

## Usage

```json
// schemas/add-cat.json
{
  "$id": "create-cat",
  "type": "object",
  "required": ["name"],
  "additionalProperties": false,
  "properties": {
    "name": {
      "type": "string"
    },
    "color": {
      "type": "string",
      "default": "gray"
    }
  }
}
```

```js
// src/actions/create-cat.ts
import { Microfleet } from '@microfleet/core'
import { ServiceRequest } from '@microfleet/plugin-router'

const cats = []

export default async function createCatAction(this: Microfleet, request: ServiceRequest): Promise<string> {
  const { color, name } = request.params
  const cat = { color, name }

  cats.push(cat)

  return `${name} was created!`
}
```

```js
// src/index.js
const service = new Microfleet({
  name: 'cats api',
  plugins: [
    'validator',
    'logger',
    'hapi',
    'router',
    'router-hapi',
  ],
})

await service.connect()
```

```sh
$ curl -XPOST "http://0.0.0.0:3000/create-cats" -d '{"name":"perchik","color":"pepper"}' -H "Content-Type: application/json"
Perchik was created!
```

## ServiceAction

Handler for transport request.

### Signature

```js
(this: Microfleet, request: ServiceRequest) => Promise<any>
```

### Additional properties

@todo

## ServiceRequest

Object with the following structure.

```js

```

## Lifecycle

## Extensions
npm package: @microfleet/plugin-router-socketio
Description: Socket.io transport adapter for router
Author: Vitaly Aminev
Latest version: 7.0.0

# Microfleet plugin-router-socketio

Attach socket.io transport to router.

## Typical usage

```js
const service = new Microfleet({
  name: 'tester',
  plugins: [
    'validator', // essential plugin
    'logger', // essential plugin
    'socketio', // init socket.io
    'hapi', // init http and attach socket.io
    'router', // init router
    'router-socketio' // attach socket.io transport to router
  ],
  hapi: {
    attachSocketio: true,
  },
})
```
npm package: @microfleet/schema-tools
Description: This package resolves JSON Schemas that `@microfleet/plugin-validator` and `@microfleet/core` uses for Response and Request validation. Additionally, this package parse resolved JSON Schema into specific data structures for additional schema structure pro
Author: Vitaly Aminev
Latest version: 0.1.3

# Microfleet Json Schema Tools

This package resolves JSON Schemas that `@microfleet/plugin-validator` and `@microfleet/core` uses for Response and Request validation. Additionally, this package parse resolved JSON Schema into specific data structures for additional schema structure processing or documentation generation.

## Install
`yarn add @microfleet/schema-tools`

## Usage

### Resolve references

Example schemas:
```json
// schemas/common.json
{
  "$id": "common",
  "definitions": {
    "myDefinition": {
      "type": "string",
      "minLength": 10,
    }
  }
}
```

```json
// schemas/validation.json
{
  "type": "object",
  "properties": {
    "myProperty": {
      "$ref": "common#/definitions/myDefinition"
    }
  }
}
```

Resolve references:

```javascript
const { RefParser } = require('@microfleet/schema-tools');
const schema = require('schemas/validation.json');

const rp = new RefParser({
  schemaDirs: [ './schemas' ],
})

// Find schemas in provided paths and resolve their local references
await rp.findSchemas()

// Resolve reference and assign `$xRef` property with resolved reference information
const resolved = rp.resolve(schema)
// or
const resolved = rp.resolve(rp.schemas['validation'])
```

Build a Schema tree that will repeat the schema structure but will contain corresponding class instances for each schema type:

```javascript
const { SchemaNode } = require('@microfleet/schema-tools')
const schemaTree = SchemaNode.parse(resolved)
```

For advanced schema tree usage examples, please read project tests or [@microfleet/schema2md](../../schema2md/) sources.
npm package: @microfleet/schema2md
Description: Converts parsed JsonSchema into `json2md` compatible datastructures.
Author: Vitaly Aminev
Latest version: 0.1.3

# Microfleet schema2md

Converts parsed JsonSchema into `json2md` compatible datastructures.

## Install

`yarn add @microfleet/schema2md`

## Configuration

  * `linkTo?`: (ref: SchemaRef) => string - function used when generating link href to the reference.
  * `linkFrom?`: (node: SchemaNode) => string - function used when generating link name for the reference.

## Usage

For full working example please see tests or [@microfleet/mdoc-markdow](../mdoc-markdown).

Please referer [this page](../schema-tools/README.md) for schemas used in this example.

```javascript
const { SchemaNode } = require('@microfleet/schema-tools')
const { Renderer } = require('@microfleet/schema2md')
const json2md = require('json2md')

const schemaTree = SchemaNode.parse(resolved)

const renderer = new Renderer()
const json2mdSchema = renderer.render(schemaTree)

const markdown = json2md(json2mdSchema)
```
npm package: @microfleet/validation
Description: ajv-based validation utils for mservice architecture
Author: Vitaly Aminev
Latest version: 12.0.0

# Microfleet Validation Module

[![Build Status](https://semaphoreci.com/api/v1/microfleet/validation/branches/master/badge.svg)](https://semaphoreci.com/microfleet/validation)

This is basically a wrapper of [ajv](https://github.com/epoberezkin/ajv) module.
What it does - is accepts a directory with schemas, reads it in an async or sync fashion based on your preference
and caches validators under it's name, minus it's extension (to be completely honest - it strips down `.json` only).
Based on the bluebird promises.

## Installation

`npm i @microfleet/validation`

## Usage

```ts
// Lets assume that we have a following file structure:
//
// .
// ./schemas/config.json
// ./schemas/ping.json
// ./index.js
//

import Errors = require('common-errors');
import Validator, { HttpStatusError } from '@microfleet/validation';
const validator = new Validator('./schemas');

await validator.init()

// some logic here
validator.validate('config', {
  configuration: 'string'
})
.then(doc => {
  // all good
  // handle doc, which would eq { configuration: 'string' }
})
.catch(HttpStatusError, (error) => {
  // handle error here
});

const result = validator.validateSync('config', { data: true });
if (result.error) {
  // handle error!
}

// do stuff
// ...

// init filter
validator.init('./dir', null, true); // all schemas in this dir will filter out additional properties instead of throwing an error

// catches when we only have 417 errors
validator.filter('config', { conf: 'string', extra: true })
  .then(result => {
    //  { conf: 'string' }
  });
```
npm package: @microfocus-lre/ui-shared-components
Description: UI shared components for LRE projects
Author: Shlomi masuri
Latest version: 1.0.9

# UiComponents

This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.2.14.

## Code scaffolding

Run `ng generate component component-name --project ui-components` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project ui-components`.
> Note: Don't forget to add `--project ui-components` or else it will be added to the default project in your `angular.json` file. 

## Build

Run `ng build ui-components` to build the project. The build artifacts will be stored in the `dist/` directory.

## Publishing

After building your library with `ng build ui-components`, go to the dist folder `cd dist/ui-components` and run `npm publish`.

## Running unit tests

Run `ng test ui-components` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).