open-index/open-npm huggingface dataset:
npm package: @hapify/cli
Description: Command Line Interface for Hapify
Author: Edouard Demotes-Mainard
Latest version: 1.3.3

# Hapify CLI

## Description

Hapify is a code generation tool based on relational data models. It uses a dedicated templating language.

This package is a command line tool for managing your Hapify projects and templates.

## Usage

Please refer to the [online documentation](https://docs.hapify.io/).
npm package: @hapify/ejs
Description: Sandbox for EJS templates
Author: Edouard Demotes-Mainard
Latest version: 1.3.1

# Hapify EJS

## Description

This repository provides a secured sandbox to render unsafe EJS templates

## Usage

### Basic usage

```typescript
import { HapifyEJS } from '@hapify/ejs';

const script = `hello <%= value %>`;
const result = new HapifyEJS().run(script, { value: 'world' }); // result = 'hello world'
```

### Advanced usage

```typescript
import { HapifyEJS } from '@hapify/ejs';

const script = `hello <%= value %>`;
const result = new HapifyEJS({
  timeout: 200, // Maximum script execution time. Default to 5000ms.
}).run(script, { value: 'world' }); // result = 'hello world'
```
npm package: @hapify/generator
Description: Generator for Hapify templates
Author: Edouard Demotes-Mainard
Latest version: 1.4.3

# Hapify Generator

## Description

This package allows you to generate code using Hapify models and Hapify or JavaScript code templates.

## Usage

```typescript
import { Generator } from '@hapify/generator';

const templates = [
    {
    	path: '/path/to/{snake}',
    	engine: 'hpf',
    	input: 'one',
        content: 'Camel case is <<Model camel>>.',
    }
];
const models = [
    {
        id: 'bdc6c58e-ec49-9193-6b29-6c75518bc3ad',
        name: 'Place bookmark',
        notes: 'A user can only list its own bookmarks',
        fields: [
            {
                name: '_id',
                notes: null,
                type: 'string',
                subtype: null,
                value: null,
                primary: true,
                unique: false,
                label: false,
                nullable: false,
                multiple: false,
                embedded: false,
                searchable: false,
                sortable: false,
                hidden: false,
                internal: true,
                restricted: false,
                ownership: false
            }
        ],
        accesses: {
            create: 'auth',
            read: 'owner',
            update: 'admin',
            remove: 'owner',
            search: 'owner',
            count: 'owner'
        }
    }
];

// Get path & content
Generator.run(templates, models)
    .then(results => {
        // [{ path: '/path/to/place_bookmark', content: 'Camel case is placeBookmark' }]
    });

// Get path only
const path = Generator.path('/path/to/{camel}', models[0]); // '/path/to/placeBookmark'
```

## More

For more information about this module, please refer to the [online documentation](https://docs.hapify.io/).
npm package: @hapify/syntax
Description: Templating syntax optimized for Hapify models handling.
Author: Edouard Demotes-Mainard
Latest version: 1.6.1

# Hapify Syntax

## Description

This package parses templates written with the Hapify Syntax.

## Usage

```typescript
import { HapifySyntax } from '@hapify/syntax';

const template = "Model is <<Model camel>>.";
const model: { [key: string]: any; } = { /* Explicit model from generator */ };
HapifySyntax.run(template, model, { timeout: 2000 }); // Outputs 'Model is userProfile'.
```

## More

For more information about this module, please refer to the [online documentation](https://docs.hapify.io/reference/hapify-syntax/).
npm package: @hapify/vm
Description: Sandbox for JavaScript code
Author: Edouard Demotes-Mainard
Latest version: 1.4.1

# Hapify VM

## Description

This repository provides a secured sandbox to execute unsafe JavaScript code

## Usage

### Basic usage

```typescript
import { HapifyVM } from '@hapify/vm';

const script = `const concat = a + b; return concat;`;
const result = new HapifyVM().run(script, { a: 'hello', b: 'world' }); // result = 'hello world'
```

### Advanced usage

```typescript
import { HapifyVM } from '@hapify/vm';

const script = `const sum = a + b; return sum;`;
const options = {
  timeout: 200, // Maximum script execution time. Default to 5000ms.
  allowAnyOutput: true, // Allow the input script to return any data type. Default to false.
  eval: true, // Allow function constructors (Function, GeneratorFunction, etc)
};
const result = new HapifyVM(options).run(script, { a: 1, b: 2 }); // result = 3
```
npm package: @hapig/chat-vue-storage
Description: chat-vue-storage 提供数组数据的分页读写，及自定义配置
Latest version: 0.0.0-alpha.0

# chat-vue-storage

## 一、简介

提供数组数据的分页读写，及自定义配置

## 二、如何使用

### 安装 install

```Shell
    yarn add chat-vue-storage / npm i chat-vue-storage
```

### 导入 import

```Shell
    import ListStorage  from 'chat-vue-storage'
```

### 使用

1. 创建实例并传入配置：

```js
    const messageListStorage = new ListStorage({
        saveKey: 'chat-vue-history', // 存储的key
        pageSize: 10, // 分页大小
        limitNumber: 100, //最多存储数组的长度
    })
```

2. 读写数据：

```js
    // 存储数组数据
    // arrData 必选 Array， 必须为一个不为空的数组
    messageListStorage.addData(arrData)
    // 按分页读取数据
    // pageIndex 可选 Number，不传默认为 1
    // pageSize 可选 Number，不传默认使用实例化时传入配置中的pageSize
    messageListStorage.getData(pageIndex,pageSize)
```
npm package: @hapipal/avocat
Description: A utility to convert Objection database errors into Boom HTTP errors
Author: Daniel COLE
Latest version: 3.1.0

# avocat

A utility to convert [Objection](https://vincit.github.io/objection.js/) database errors into [Boom](https://hapi.dev/module/boom/) HTTP errors

[![Build Status](https://travis-ci.com/hapipal/avocat.svg?branch=master)](https://travis-ci.com/hapipal/avocat) [![Coverage Status](https://coveralls.io/repos/github/hapipal/avocat/badge.svg?branch=master)](https://coveralls.io/github/hapipal/avocat?branch=master)

Lead Maintainer: [Daniel Cole](https://github.com/optii)

## Installation
```sh
npm install @hapipal/avocat
```

## Usage
> See also the [API Reference](API.md)
>
> Avocat is intended for use with hapi v19+, nodejs v12+, and Objection v2 or v3 (_see v1 for lower support_).

Avocat provides a single utility function [`Avocat.rethrow(error, [options])`](API.md#avocatrethrowerror-options) which transforms database errors from Objection into Boom HTTP errors that are compatible with hapi.

```js
'use strict';

const Hapi = require('@hapi/hapi');
const Avocat = require('@hapipal/avocat');
const User = require('./user-model'); // An Objection model bound to a knex instance

const server = Hapi.server();

server.route({
    method: 'get',
    path: '/users/{id}',
    handler(request) {

        try {
            return await User.query()
                .findById(request.params.id)
                .throwIfNotFound();
        }
        catch (err) {
            Avocat.rethrow(err); // Throws a 404 Not Found if user does not exist
            throw err;
        }
    }
});
```

## Extras
The interface for Avocat is heavily inspired by [Bounce](https://hapi.dev/module/bounce/).
npm package: @hapipal/haute-couture
Description: File-based hapi plugin composer
Author: Devin Ivy
Latest version: 4.3.1

# haute-couture

File-based hapi plugin composer

[![Build Status](https://travis-ci.com/hapipal/haute-couture.svg?branch=main)](https://travis-ci.com/hapipal/haute-couture) [![Coverage Status](https://coveralls.io/repos/hapipal/haute-couture/badge.svg?branch=main&service=github)](https://coveralls.io/github/hapipal/haute-couture?branch=main)

Lead Maintainer - [Devin Ivy](https://github.com/devinivy)

## Installation
```sh
npm install @hapipal/haute-couture
```

## Introduction
This library will wire your hapi plugin together based simply upon where you place files and the contents of those files.  It has the ability to call nearly every configuration-related method in the hapi plugin API.  This means many good things!  Here are a few:

 - Route configurations placed in your `routes/` directory will be registered using `server.route()`.
 - You can place your authentication scheme in `auth/schemes.js` rather than calling `server.auth.scheme()`.
 - You can provision a cache simply by placing its configuration in `caches/my-cache-name.js`, and forget about `server.cache.provision()`.
 - You can still write all the custom plugin code you desire.
 - You can customize many aspects regarding how haute-couture composes your hapi plugin from files.

Haute-couture understands 19 hapi plugin methods: those for server methods, server/request decorations, request lifecycle extensions, route configuration, cookie definitions, [vision](https://github.com/hapijs/vision) view managers, [schwifty](https://github.com/hapipal/schwifty) models, [schmervice](https://github.com/hapipal/schmervice) services, and plenty more.  And if that's not enough, you can always teach it about more through its flexible [amendment](API.md#await-hautecouturecomposeserver-options-composeoptions) system.

## Usage
> See also the [API Reference](API.md)
>
> Haute-couture is intended for use with hapi v19+ and nodejs v12+, in addition to several optional peer hapi plugins noted in package.json (_see v3 for lower support_).

This library is not a hapi plugin: think of it instead as a useful subroutine of any hapi plugin.  The full documentation of the files and directories it recognizes can be found in the [API documentation](API.md#files-and-directories).

### Example
Here's an example of a very simple plugin that registers a single "pinger" route.

#### `index.js`
```js
const HauteCouture = require('@hapipal/haute-couture');

module.exports = {
  name: 'my-hapi-plugin',
  register: async (server, options) => {

    // Custom plugin code can go here

    await HauteCouture.compose(server, options);
  }
};
```

#### `routes/pinger.js`
```js
module.exports = {
  method: 'get',
  path: '/',
  options: {
    handler(request) {

      return { ping: 'pong' };
    }
  }
};
```
npm package: @hapipal/hecks
Description: Mount your express app onto your hapi server, aw heck!
Author: Devin Ivy
Latest version: 3.0.0

# hecks
Mount your express app onto your hapi server, aw heck!

[![Build Status](https://travis-ci.com/hapipal/hecks.svg?branch=master)](https://travis-ci.com/hapipal/hecks) [![Coverage Status](https://coveralls.io/repos/hapipal/hecks/badge.svg?branch=master&service=github)](https://coveralls.io/github/hapipal/hecks?branch=master)

Lead Maintainer - [Devin Ivy](https://github.com/devinivy)

## Usage
> See also the [API Reference](API.md)
>
> Hecks is intended for use with hapi v19+ and nodejs v12+ (see v2 for lower support).

Hecks allows you to seamlessly incorporate express applications into a **hapi v17+** server.  This is particularly useful for testing an express server using [`server.inject()`](https://github.com/hapijs/hapi/blob/master/API.md#server.inject()), for unifying deployment of existing express and hapi applications, and as an initial stepping stone in migrating an express application to hapi.

```js
const Express = require('express');
const BodyParser = require('body-parser');
const Hapi = require('@hapi/hapi');
const Hecks = require('@hapipal/hecks');

(async () => {

    const app = Express();

    app.post('/user', BodyParser.json(), (req, res) => {

        const user = { ...req.body };
        user.saved = true;

        res.json(user);
    });

    const server = Hapi.server();

    await server.register([
        Hecks.toPlugin(app, 'my-express-app')
    ]);

    const { result } = await server.inject({
        method: 'post',
        url: '/user',
        payload: { name: 'Bill', faveFood: 'cactus' }
    });

    console.log(result); // {"name":"Bill","faveFood":"cactus","saved":true}
})();
```
npm package: @hapipal/toys
Description: The hapi utility toy chest
Author: Devin Ivy
Latest version: 4.0.0

# toys

The hapi utility toy chest

[![Build Status](https://app.travis-ci.com/hapipal/toys.svg?branch=main)](https://app.travis-ci.com/hapipal/toys) [![Coverage Status](https://coveralls.io/repos/hapipal/toys/badge.svg?branch=main&service=github)](https://coveralls.io/github/hapipal/toys?branch=main)

Lead Maintainer - [Devin Ivy](https://github.com/devinivy)

## Installation
```sh
npm install @hapipal/toys
```

## Usage
> See also the [API Reference](API.md)
>
> Toys is intended for use with hapi v20+ and nodejs v16+ (_see v3 for lower support_).

Toys is a collection of utilities made to reduce common boilerplate in **hapi v20+** projects.

Below is an example featuring [`Toys.auth.strategy()`](API.md#toysauthstrategyserver-name-authenticate) and [`Toys.withRouteDefaults()`](API.md#toyswithroutedefaultsdefaults).  The [API Reference](API.md) is also filled with examples.

```js
const Hapi = require('@hapi/hapi');
const Boom = require('@hapi/boom');
const Toys = require('@hapipal/toys');

(async () => {

    const server = Hapi.server();

    // Make a one-off auth strategy for testing
    Toys.auth.strategy(server, 'name-from-param', (request, h) => {

        // Yes, perhaps not the most secure
        const { username } = request.params;

        if (!username) {
            throw Boom.unauthorized(null, 'Custom');
        }

        return h.authenticated({ credentials: { user: { name: username } } });
    });

    // Default all route methods to "get", unless otherwise specified
    const defaultToGet = Toys.withRouteDefaults({ method: 'get' });

    server.route(
        defaultToGet([
            {
                method: 'post',
                path: '/',
                handler: (request) => {

                    return { posted: true };
                }
            },
            {   // Look ma, my method is defaulting to "get"!
                path: '/as/{username}',
                options: {
                    auth: 'name-from-param', // Here's our simple auth strategy
                    handler: (request) => {

                        const username = request.auth.credentials?.user?.name;

                        return { username };
                    }
                }
            }
        ])
    );

    await server.start();

    console.log(`Now, go forth and ${server.info.uri}/as/your-name`);
})();
```
npm package: @hapist/ajv
Description: AJV integration for hapi.js
Author: Brian Faust
Latest version: 0.1.0

# hapi-ajv

> AJV integration for hapi.js

[![Latest Version](https://badgen.now.sh/npm/v/@hapist/ajv)](https://www.npmjs.com/package/@hapist/ajv)
[![Node Engine](https://badgen.now.sh/npm/node/@hapist/ajv)](https://www.npmjs.com/package/@hapist/ajv)
[![Build Status](https://badgen.now.sh/circleci/github/hapist/ajv)](https://circleci.com/gh/hapist/ajv)
[![Codecov](https://badgen.now.sh/codecov/c/github/hapist/ajv)](https://codecov.io/gh/hapist/ajv)
[![License: MIT](https://badgen.now.sh/badge/license/MIT/green)](https://opensource.org/licenses/MIT)

## Installation

```bash
yarn add @hapist/ajv
```

## Testing

```bash
yarn test
```

## Security

If you discover a security vulnerability within this package, please send an e-mail to hello@basecode.sh. All security vulnerabilities will be promptly addressed.

## Credits

-   [Brian Faust](https://github.com/faustbrian)
-   [All Contributors](../../../../contributors)

## License

[MIT](LICENSE) © [Brian Faust](https://brianfaust.me)
npm package: @hapist/blacklist
Description: IP address blacklisting for hapi.js
Author: Brian Faust
Latest version: 0.1.0

# @hapist/blacklist

> IP address blacklisting for hapi.js

[![Latest Version](https://badgen.now.sh/npm/v/@hapist/blacklist)](https://www.npmjs.com/package/@hapist/blacklist)
[![Node Engine](https://badgen.now.sh/npm/node/@hapist/blacklist)](https://www.npmjs.com/package/@hapist/blacklist)
[![Build Status](https://badgen.now.sh/circleci/github/hapist/blacklist)](https://circleci.com/gh/hapist/blacklist)
[![Codecov](https://badgen.now.sh/codecov/c/github/hapist/blacklist)](https://codecov.io/gh/hapist/blacklist)
[![License: MIT](https://badgen.now.sh/badge/license/MIT/green)](https://opensource.org/licenses/MIT)

## Installation

```bash
yarn add @hapist/blacklist
```

## Testing

```bash
yarn test
```

## Security

If you discover a security vulnerability within this package, please send an e-mail to hello@basecode.sh. All security vulnerabilities will be promptly addressed.

## Credits

-   [Brian Faust](https://github.com/faustbrian)
-   [All Contributors](../../../../contributors)

## License

[MIT](LICENSE) © [Brian Faust](https://brianfaust.me)
npm package: @hapist/cors
Description: CORS for hapi.js
Author: Brian Faust
Latest version: 0.1.0

# hapi-cors

> CORS for hapi.js

[![Latest Version](https://badgen.now.sh/npm/v/@hapist/cors)](https://www.npmjs.com/package/@hapist/cors)
[![Node Engine](https://badgen.now.sh/npm/node/@hapist/cors)](https://www.npmjs.com/package/@hapist/cors)
[![Build Status](https://badgen.now.sh/circleci/github/hapist/cors)](https://circleci.com/gh/hapist/cors)
[![Codecov](https://badgen.now.sh/codecov/c/github/hapist/cors)](https://codecov.io/gh/hapist/cors)
[![License: MIT](https://badgen.now.sh/badge/license/MIT/green)](https://opensource.org/licenses/MIT)

## Installation

```bash
yarn add @hapist/cors
```

## Testing

```bash
yarn test
```

## Security

If you discover a security vulnerability within this package, please send an e-mail to hello@basecode.sh. All security vulnerabilities will be promptly addressed.

## Credits

-   [Brian Faust](https://github.com/faustbrian)
-   [All Contributors](../../../../contributors)

## License

[MIT](LICENSE) © [Brian Faust](https://brianfaust.me)
npm package: @hapist/json-api
Description: An implementation of the JSON API specification for building APIs with hapi.js
Author: Brian Faust
Latest version: 0.1.2

# @hapist/json-api

> An implementation of the JSON API specification for building APIs with hapi.js

[![Latest Version](https://badgen.now.sh/npm/v/@hapist/json-api)](https://www.npmjs.com/package/@hapist/json-api)
[![Node Engine](https://badgen.now.sh/npm/node/@hapist/json-api)](https://www.npmjs.com/package/@hapist/json-api)
[![Build Status](https://badgen.now.sh/circleci/github/hapist/json-api)](https://circleci.com/gh/hapist/json-api)
[![Codecov](https://badgen.now.sh/codecov/c/github/hapist/json-api)](https://codecov.io/gh/hapist/json-api)
[![License: MIT](https://badgen.now.sh/badge/license/MIT/green)](https://opensource.org/licenses/MIT)

## Installation

```bash
yarn add @hapist/json-api
```

## Testing

```bash
yarn test
```

## Security

If you discover a security vulnerability within this package, please send an e-mail to hello@basecode.sh. All security vulnerabilities will be promptly addressed.

## Credits

-   [Brian Faust](https://github.com/faustbrian)
-   [All Contributors](../../../../contributors)

## License

[MIT](LICENSE) © [Brian Faust](https://brianfaust.me)
npm package: @hapist/json-rpc
Description: An implementation of the JSON-RPC 2.0 specification for building RPCs with hapi.js
Author: Brian Faust
Latest version: 0.2.0

# @hapist/json-rpc

> An implementation of the JSON-RPC 2.0 specification for building RPCs with hapi.js

[![Latest Version](https://badgen.now.sh/npm/v/@hapist/json-rpc)](https://www.npmjs.com/package/@hapist/json-rpc)
[![Node Engine](https://badgen.now.sh/npm/node/@hapist/json-rpc)](https://www.npmjs.com/package/@hapist/json-rpc)
[![Build Status](https://badgen.now.sh/circleci/github/hapist/json-rpc)](https://circleci.com/gh/hapist/json-rpc)
[![Codecov](https://badgen.now.sh/codecov/c/github/hapist/json-rpc)](https://codecov.io/gh/hapist/json-rpc)
[![License: MIT](https://badgen.now.sh/badge/license/MIT/green)](https://opensource.org/licenses/MIT)

## Installation

```bash
yarn add @hapist/json-rpc
```

## Examples

### Joi (Default)

```ts
import * as plugin from "@hapist/json-rpc";
import Joi from "@hapi/joi";

await server.register({
	plugin,
	options: {
		methods: [...],
		processor: {
			schema: Joi.object().keys({
				id: Joi.alternatives().try(Joi.number(), Joi.string()).required(),
				jsonrpc: Joi.string().allow("2.0").required(),
				method: Joi.string().required(),
				params: Joi.object(),
			}),
			validate(data: object, schema: object) {
				return Joi.validate(data, schema);
			},
		},
	},
});
```

### AJV

```ts
import * as plugin from "@hapist/json-rpc";
import Ajv from "ajv";

await server.register({
	plugin,
	options: {
		methods: [...],
		processor: {
			schema: {
				properties: {
					id: {
						type: ["number", "string"],
					},
					jsonrpc: {
						pattern: "2.0",
						type: "string",
					},
					method: {
						type: "string",
					},
					params: {
						type: "object",
					},
				},
				required: ["jsonrpc", "method", "id"],
				type: "object",
			},
			validate(data: object, schema: object) {
				try {
					const ajv = new Ajv({
						$data: true,
						extendRefs: true,
						removeAdditional: true,
					});

					ajv.validate(schema, data);

					return { value: data, error: ajv.errors !== null ? ajv.errorsText() : null };
				} catch (error) {
					return { value: null, error: error.stack };
				}
			},
	},
});
```

## Testing

```bash
yarn test
```

## Security

If you discover a security vulnerability within this package, please send an e-mail to hello@basecode.sh. All security vulnerabilities will be promptly addressed.

## Credits

-   [Brian Faust](https://github.com/faustbrian)
-   [All Contributors](../../../../contributors)

## License

[MIT](LICENSE) © [Brian Faust](https://basecode.sh)
npm package: @hapist/remote-address
Description: A wrapper around @faustbrian/remote-address for hapi.js
Author: Brian Faust
Latest version: 0.1.0

# hapi-remote-address

> A wrapper around @faustbrian/remote-address for hapi.js

[![Latest Version](https://badgen.now.sh/npm/v/@hapist/remote-address)](https://www.npmjs.com/package/@hapist/remote-address)
[![Node Engine](https://badgen.now.sh/npm/node/@hapist/remote-address)](https://www.npmjs.com/package/@hapist/remote-address)
[![Build Status](https://badgen.now.sh/circleci/github/hapist/remote-address)](https://circleci.com/gh/hapist/remote-address)
[![Codecov](https://badgen.now.sh/codecov/c/github/hapist/remote-address)](https://codecov.io/gh/hapist/remote-address)
[![License: MIT](https://badgen.now.sh/badge/license/MIT/green)](https://opensource.org/licenses/MIT)

## Installation

```bash
yarn add @hapist/remote-address
```

## Testing

```bash
yarn test
```

## Security

If you discover a security vulnerability within this package, please send an e-mail to hello@basecode.sh. All security vulnerabilities will be promptly addressed.

## Credits

-   [Brian Faust](https://github.com/faustbrian)
-   [All Contributors](../../../../contributors)

## License

[MIT](LICENSE) © [Brian Faust](https://brianfaust.me)
npm package: @hapist/version
Description: API versioning for hapi.js
Author: Brian Faust
Latest version: 0.1.0

# hapi-version

> API versioning for hapi.js

[![Latest Version](https://badgen.now.sh/npm/v/@hapist/version)](https://www.npmjs.com/package/@hapist/version)
[![Node Engine](https://badgen.now.sh/npm/node/@hapist/version)](https://www.npmjs.com/package/@hapist/version)
[![Build Status](https://badgen.now.sh/circleci/github/hapist/version)](https://circleci.com/gh/hapist/version)
[![Codecov](https://badgen.now.sh/codecov/c/github/hapist/version)](https://codecov.io/gh/hapist/version)
[![License: MIT](https://badgen.now.sh/badge/license/MIT/green)](https://opensource.org/licenses/MIT)

## Installation

```bash
yarn add @hapist/version
```

## Testing

```bash
yarn test
```

## Security

If you discover a security vulnerability within this package, please send an e-mail to hello@basecode.sh. All security vulnerabilities will be promptly addressed.

## Credits

-   [Brian Faust](https://github.com/faustbrian)
-   [All Contributors](../../../../contributors)

## License

[MIT](LICENSE) © [Brian Faust](https://brianfaust.me)
npm package: @hapist/whitelist
Description: IP address whitelisting for hapi.js
Author: Brian Faust
Latest version: 0.1.0

# hapi-whitelist

> IP address whitelisting for hapi.js

[![Latest Version](https://badgen.now.sh/npm/v/@hapist/whitelist)](https://www.npmjs.com/package/@hapist/whitelist)
[![Node Engine](https://badgen.now.sh/npm/node/@hapist/whitelist)](https://www.npmjs.com/package/@hapist/whitelist)
[![Build Status](https://badgen.now.sh/circleci/github/hapist/whitelist)](https://circleci.com/gh/hapist/whitelist)
[![Codecov](https://badgen.now.sh/codecov/c/github/hapist/whitelist)](https://codecov.io/gh/hapist/whitelist)
[![License: MIT](https://badgen.now.sh/badge/license/MIT/green)](https://opensource.org/licenses/MIT)

## Installation

```bash
yarn add @hapist/whitelist
```

## Testing

```bash
yarn test
```

## Security

If you discover a security vulnerability within this package, please send an e-mail to hello@basecode.sh. All security vulnerabilities will be promptly addressed.

## Credits

-   [Brian Faust](https://github.com/faustbrian)
-   [All Contributors](../../../../contributors)

## License

[MIT](LICENSE) © [Brian Faust](https://brianfaust.me)
npm package: @hapl/antd-tabler-icons
Description: Tabler иконки нужны из-за того что в antd скудный набор встроенных иконок.
Author: Alexander Pavlov
Latest version: 1.3.0

# Tabler иконки преобразованные для работы c ant-design

Tabler иконки нужны из-за того что в antd скудный набор встроенных иконок.

[Список всех доступных иконок](https://tabler.io/icons)

[Список добавленных иконок](./ICONS.md)

## Обновление доступных иконок

1. `npm i -D @tabler/icons@latest`
2. Обновить список выбранных иконок в файле `scripts/tabler-icons/selected.js`
3. `npm run tabler-icons`

## Выкладка в NPM

Для выкатки альф во вкладке Actions запустить workflow `Release` для нужной ветки, после завершения в PR добавится номер canary версии.

Для выкатки стабильной версии нужно произвести мерж PR в main c тегом `patch`/`minor`/`major`. Если добавить тег `skip-release`, то релиз не будет создан, если без тега, то по дефолту создается patch версия.
npm package: @hapl/api-queries
Description: Использовать только `nanoid/non-secure`, так как обычный не работает в React Native
Author: Homeapp
Latest version: 1.0.22

# Библиотека с API ручками для использования на фронте

## NANOID

Использовать только `nanoid/non-secure`, так как обычный не работает в React Native

## Выкладка в NPM

Для выкатки альф во вкладке Actions запустить workflow `Release` для нужной ветки, после завершения в PR добавится номер canary версии.

Для выкатки стабильной версии нужно произвести мерж PR в main c тегом `patch`/`minor`/`major`. Если добавить тег `skip-release`, то релиз не будет создан, если без тега, то по дефолту создается patch версия.
npm package: @hapl/icons
Description: Homeapp icons
Author: Ivan Ignatev
Latest version: 1.6.0

# Getting Started with Create React App

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Available Scripts

In the project directory, you can run:

### `yarn start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.\
You will also see any lint errors in the console.

### `yarn test`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `yarn build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `yarn eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).
# icons
npm package: @haply/strapi-provider-upload-aws-s3-cdn
Description: AWS S3 upload provider for Strapi, with support for delivery via a CDN.
Latest version: 4.0.1

This is a fork of [https://www.npmjs.com/package/strapi-provider-upload-aws-s3-cloudfront](). It has been modified to omit any ACL parameters in the object upload step.

# Installation

```
npm i @haply/strapi-provider-upload-aws-s3-cdn
```

## Configuration (required)

config/plugins.js:

```
module.exports = ({ env }) => {
  //...
  upload: {
    config: {
      provider: '@haply/strapi-provider-upload-aws-s3-cdn',
      providerOptions: {
        accessKeyId: env('AWS_S3_ACCESS_KEY_ID'),
        secretAccessKey: env('AWS_S3_SECRET_ACCESS_KEY'),
        region: env('AWS_S3_REGION'),
        params: {
        Bucket: env('AWS_S3_BUCKET'),
        },
        cdn: env('AWS_CLOUDFRONT')
      },
      actionOptions: {
        upload: {},
        uploadStream: {},
        delete: {},
      },
    },
  },
  //...
};
```

config/middlewares.js

```
module.exports = ({ env }) => [
  //...
  {
    name: 'strapi::security',
    config: {
      contentSecurityPolicy: {
        useDefaults: true,
        directives: {
          'connect-src': ["'self'", 'https:'],
          'img-src': ["'self'", 'data:', 'blob:', env('AWS_CLOUDFRONT'), `${env('AWS_AWS_S3_BUCKET')}.s3.${env('AWS_AWS_S3_REGION')}.amazonaws.com`],
          'media-src': ["'self'", 'data:', 'blob:', env('AWS_CLOUDFRONT'), `${env('AWS_AWS_S3_BUCKET')}.s3.${env('AWS_AWS_S3_REGION')}.amazonaws.com`],
          upgradeInsecureRequests: null,
        },
      },
    },
  },
  //...
];
```

### Adding a prefix
- Use `providerOptions: { ..., prefix: 'folder/inside/my/bucket/' }` or `providerOptions: { ..., prefix: 'all_my_object_names_start_with_' }` to set a constant prefix across all objects uploaded. Note that for the time being, modifying the prefix in a project with existing uploads will make deleting those uploads impossible.

### Troubleshooting
- Note that, for the time being, the `.env` value for `AWS_CLOUDFRONT` must be a fully formed URL, e.g. `https://cdn.mysite.xyz/`
  - Be sure not to omit the protocol part (usually `https://`) or final trailing slash `/`
  - This formatting restriction may be eased in a subsequent release
- Check that there are no other discrepancies in your `AWS_...` .env values, and avoid enclosing any of them in `'` or `"` quote marks.
- Ensure that your `provider: ...` setting in config/plugins.js is set to `@haply/strapi-provider-upload-aws-s3-cdn`.

### Restoring `ACL: 'public-read'` upload behaviour
- For projects relying on direct `public-read` access to their bucket for delivery (as opposed a private bucket with content delivered via a secure CloudFront distribution), it should be possible to use the `actionOptions` to specify `upload: { ACL: 'public-read' }` and `uploadStream: { ACL: 'public-read' }`.
npm package: @hapoosjs/api-buckets
Description: API for managing cloud buckets
Author: Padmanabh Dabke
Latest version: 1.1.1

# @hapoosjs/api-buckets
This package is part of Hapoos.js framework. It defines the API for managing cloud buckets related functionality. 
Please visit Hapoos.js project Website at https://www.hapoosjs.com for how it fits in with other Hapoos.js 
framework components and available provider implementations of the API.
npm package: @hapoosjs/api-certs
Description: API for managing SSL certificates
Author: Padmanabh Dabke
Latest version: 1.0.1

# @hapoosjs/api-certs
This package is part of Hapoos.js framework. It defines the API for managing SSL certificates. 
Please visit Hapoos.js project Website at https://www.hapoosjs.com for how it fits in with other Hapoos.js 
framework components and available provider implementations of the API.
npm package: @hapoosjs/api-common
Description: Common classes shared by all other Hapoos.js API modules
Author: Padmanabh Dabke
Latest version: 1.1.1

# @hapoosjs/api-common
This package is part of Hapoos.js framework. It defines base classes that are
inherited by other hapoos.js framework classes. Please visit Hapoos.js project Website at https://www.hapoosjs.com for more details.
npm package: @hapoosjs/aws-buckets
Description: AWS implementation of hapoos.js buckets API
Author: Padmanabh Dabke
Latest version: 1.1.1

# @hapoosjs/aws-buckets
This package is part of Hapoos.js framework. It implements Hapoos.js Buckets API on AWS.  
Please visit Hapoos.js project Website at https://www.hapoosjs.com for how it fits in with other Hapoos.js 
framework components.
npm package: @hapoosjs/aws-certs
Description: AWS implementation of hapoos.js SSL/TLS certificates API
Author: Padmanabh Dabke
Latest version: 1.0.1

# @hapoosjs/aws-certs
This package is part of Hapoos.js framework. It implements Hapoos.js SSL/TLS certificates API on AWS.  
Please visit Hapoos.js project Website at https://www.hapoosjs.com for how it fits in with other Hapoos.js 
framework components.