open-index/open-npm huggingface dataset:
npm package: @foxzilla/fireblog-sdk
Description: Some tools for FireBlog.
Author: FoXZilla
Latest version: 0.0.1-alpha.5

# fireblog-sdk

Some tools for FireBlog. Includes:

1. FireBean
1. FormDictator: Check & Format the js object

---

## Firebean

```js
import * as FireBean from '@foxzilla/fireblog-sdk/firebean';
```

### APIs

#### Methods

- stringify
- parse
- exec

#### Options

- DefaultData
- Actions

## FormDictator

```js
import FormDictator from '@foxzilla/fireblog-sdk/form-dictator';
```
### APIs

- FormDictator#pick
- FormDictator#clone

- FormDictator#noUndefined
- FormDictator#noNull
- FormDictator#noEmptyStr
- FormDictator#noEmpty

- FormDictator#changeIfExist
- FormDictator#require

- FormDictator#check
- FormDictator#checkIfExist

- FormDictator#waitResult
- FormDictator#hasFail
- FormDictator#witchFail

- FormDictator.diff

### Example

Here is the express router. It will create a comment.

```ts
router.post(`/comment/create`,async function(req,res,next){
    res.json(await async function(){
        var checker =new FormDictator(req.body)
            .pick(['article_id','md_content','reply_to'])
        ;
        if(
            (await checker
            .checkIfExist('reply_to',Comment.isExist) // Comment.isExist is the async method that check that the comment is exist or not from Database
            .waitResult())
            .hasFail()
        )return {
            errcode:Errcode.CommentNotFound,
            errmsg :`The comment that be replied is not exist.`,
        };if(
            (await checker
            .checkIfExist('reply_to',Comment.canBeReply)
            .waitResult())
            .hasFail()
        )return {
            errcode:Errcode.AccessDeny,
            errmsg :`Comment can't be replied.`,
        };if(
            (await checker
            .require('article_id')
            .check('article_id',Article.isExist) // like Comment.isExist
            .waitResult())
            .hasFail()
        )return {
            errcode:Errcode.ArticleNotFound,
            errmsg :`Article is not exist.`
        };if(
            (await checker
            .check('article_id',Article.canBeReply)
            .waitResult())
            .hasFail()
        )return {
            errcode:Errcode.AccessDeny,
            errmsg :`This Article disabled comment.`,
        };

        await Comment.create(checker.data));

        return {
            errcode:Errcode.Ok,
            errmsg :'ok',
        };
    }());
});
```
npm package: @foxzilla/polar-day
Description: A very sample timeline using short-night as engine.
Latest version: 0.0.8-alpha.0

# polar-day

There is a very simple and basic timeline generator using [short-night](https://github.com/FoXZilla/short-night/) as engine.

Given events data:

```ts
const events = [
    {
        date: '2017-5',
        title: 'Axis example 1',
        endDate: '2017-8',
        endText: 'The axis can avoid for each others',
    },
    {
        date: '2017-6',
        title: 'Axis example 2',
        endDate: '2017-9-1',
        endText: 'End point is 2017.9',
    },
    {
        date: '2017-9-1',
        title: 'Start of 2017.9',
    },
    {
        date: '2017-1-2',
        title: 'Near the milestone',
    },
    {
        date: '2016-12-15',
        endDate: '2017-2',
        title: 'Near the milestone',
        description: 'The date of end is 2017.2.',
    },
    {
        date: '2018-8-15',
        title: 'Close together 1',
    },
    {
        date: '2018-8-1',
        title: 'Close together 2',
    },
    {
        date: '2018-7-15',
        title: 'Close together 3',
        description: 'The event description.',
    },
    {
        date: '2018-7-1',
        title: 'Close together 4',
        description: 'The event description.',
    },
    {
        date: '2016-8-1',
        title: 'Close together 5',
        description:
            'The event description. The event description. The event description. The event description. The event description.',
    },
    {
        date: '2016-8-15',
        title: 'Close together 6',
        description:
            'The event description. The event description. The event description. The event description. The event description.',
    },
    {
        date: '2018-4-2',
        title: 'A event which title is very very very very very very very very very very long',
    },
    {
        date: '2018-3-9',
        title: '39s Day two years!',
    },
    {
        date: '2017-3-9',
        title: '39s Day one years!',
    },
    {
        date: '2016-3-9',
        title: '39s Day!',
        description:
            'In japan and chinese, the pronunciation  of 39 is very like "Thank You". ' +
            'So some people call as Giving Day.',
    },
];
```

Draws a timeline:

![](./example.png)

# install

```sh
npm install @foxzilla/polar-day
```

# Usage

In webpack:

```ts
import { draw } from '@foxzilla/polar-day';

const events = [
    // ...
];

const timeline = await draw('#app', events);
```

In static html:

```html
<div id="app"></div>
<script src="./node_modules/@foxzilla/polar-day/dist/polar-day.js"></script>
<script>
    const events = [
        // ...
    ];
    PolarDay.draw('#app', events);
</script>
```

# Develop polar-day

```sh
npm install
npm run dev
# then open example/index.html into your browser
```
npm package: @foxzilla/wordpress-helper
Description: Porting your data to FireBlog from Wordpress.
Author: FoXZilla
Latest version: 0.0.1-alpha.8

# Wordpress Helper

Porting your data to FireBlog from Wordpress.

# Usage

Export the `.xml` file from Wordpress first, then ues this to translate that to FireBlogData.

```
npm install -g @foxzilla/wordpress-helper
wxr2fbd --help
```

# Example

```
npm install -g @foxzilla/wordpress-helper
wxr2fbd pea.wordpress.2018-02-20.xml --out out.fbd..json
```

There will generate the `out.fbd.json` file from `pea.wordpress.2018-02-20.xml`.
npm package: @foyer-inc/api-sdk
Description: TypeScript SDK for interacting with Foyer API services.
Latest version: 1.6.0

# Foyer API

[![npm](https://img.shields.io/npm/v/@foyer-inc/api-sdk.svg)](https://www.npmjs.com/package/@foyer-inc/api-sdk) [![MIT License](https://img.shields.io/npm/l/@foyer-inc/api-sdk.svg)](https://gitlab.com/foyerinc/foyer/api-sdks)

Additional documentation at [Docs](https://foyerinc.gitlab.io/foyer/api-sdks)

Additional details on filter structure available at [Sequelize](https://sequelize.org/docs/v6/core-concepts/model-querying-basics)

### Listed below is example usage of the Foyer api-sdk

```js
import { OpenAPI, PropertyService } from '@foyer-inc/api-sdk';

//usually will not need to change this but it is available for redirecting requests away from the main production api
OpenAPI.BASE = 'remote api endpoint';

//use auth token from Okta or from UserService.login
//needed to access protected endpoints
//set statically and globally
OpenAPI.TOKEN = 'token';

//use await/async  or Promise callback
const properties = await PropertyService.getProperties();

PropertyService.getProperties().then((value) => console.log(value));

//Typically used with a filter to specify which Properties to return
//The filter is also used to indicate which related models should also be returned

const filter = {
  // For more granularity, all fields on Property are able to be included as search criteria.
  where: {
    BedroomsTotal: 2
    BathroomsTotalInteger: {
      gt: 2
    }
  },
  //an array of column names to return. helpful to limit returning unnecessary information
  attributes: ["ListingKey", "StreetNumber"],
  //an array of associated models to return,
  //elements in this array can also be narrowed by including a similarly structured filter
  include: [
    { association: "Media" }
  ],
  // an integer for how many entries to return
  limit: 10,
  // an integer for how many entries to skip, useful for pagination
  offset: 10,
};

const properties = await PropertyService.getProperties(JSON.stringify(filter));
//example usage with verbosity param instead of filter object
PropertyService.getProperties(undefined, 'card').then((value) =>
  console.log(value)
);
```

RESO
Available Foyer models comply with RESO Spec

See [RESO Data Dictionary](https://ddwiki.reso.org/display/DDW17/RESO+Data+Dictionary+Wiki+1.7) for a comprehensive look at RESO

See [Reference Worksheet](https://docs.google.com/spreadsheets/d/1SZ0b6T4_lz6ti6qB2Je7NSz_9iNOaV_v9dbfhPwWgXA/edit?usp=sharing) for Standard Relationships
npm package: @foyer/commitizen-config
Description: Base commitizen config for @foyer
Author: Foyer Developers
Latest version: 1.0.1

# Semantic release Config Foyer

> A [Commitizen config](https://github.com/commitizen/cz-cli#adapters) for Foyer

## Installation

> Dependent on `husky commitizen cz-customizable cz-customizable-ghooks`
> Install `cz-customizable-ghooks` from path `git+https://github.com/pramod-ie/cz-customizable-ghooks.git#master`.
> `"cz-customizable-ghooks": "git+https://github.com/pramod-ie/cz-customizable-ghooks.git#master",` this is because husky v4 isn't supported by actual `cz-customizable-ghooks` as it needs minor change but maintainer of this repo isn't active.

```sh
npm install @foyer/commitizen-config husky commitizen cz-customizable cz-customizable-ghooks --save-dev
```

## Usage

In `package.json`:

```json
"scripts": {
  "postinstall:husky": "node node_modules/husky/lib/installer/bin install"
},
"config": {
  "commitizen": {
    "path": "node_modules/cz-customizable"
  },
  "cz-customizable": {
    "config": "node_modules/@foyer/commitizen-config"
  }
}
```

In `husky.config.js`:

```js
module.exports = {
  hooks: {
    'commit-msg': 'cz-customizable-ghooks',
    // Any other custom hooks you need
  },
}
```

Execute:
`npm run postinstall:husky`
to init husky hooks

## License

MIT
npm package: @foyer/eslint-config
Description: Base eslint config for @foyer
Author: Foyer Developers
Latest version: 1.0.4

# ESLint Config Foyer

> A [ESLint config](https://eslint.org/docs/developer-guide/shareable-configs) for Foyer

## Installation

> Dependent on `eslint` `eslint-plugin-jsx-control-statements` `eslint-plugin-react` `babel-eslint`

```sh
npm install @foyer/eslint-config eslint eslint-plugin-jsx-control-statements eslint-plugin-react babel-eslint --save-dev
```

## Usage

In `.eslintrc`:

```json
{
  "extends": "@foyer/eslint-config"
}
```

## License

MIT
npm package: @foyer/prettier-config
Description: Base prettier config for @foyer
Author: Foyer Developers
Latest version: 0.1.5

# Prettier Config Foyer

> A [Prettier config](https://prettier.io/docs/en/configuration.html#sharing-configurations) for Foyer

## Installation
> Dependent on `prettier`

```sh
npm install @foyer/prettier-config prettier --save-dev
```

## Usage

In `prettier.config.js`:

```js
module.exports = {
  ...require("@foyer/prettier-config"),
  semi: false // any specific overrides
};
```

## License

MIT
npm package: @foyer/semantic-release-config
Description: Base semantic release config for @foyer
Author: Foyer Developers
Latest version: 1.0.4

# Semantic release Config Foyer

> A [Semantic release config](https://semantic-release.gitbook.io/semantic-release/usage/configuration#extends) for Foyer

## Installation

> Dependent on `semantic-release @semantic-release/git @semantic-release/changelog`
> Install `@semantic-release/exec` to run any custom custom scripts on different state of release hooks.

```sh
npm install @foyer/semantic-release-config semantic-release @semantic-release/git @semantic-release/changelog --save-dev
```

## Usage

In `package.json`:

```json
"scripts": {
  "release": "semantic-release --no-ci",
}
```

In `release.config.js`:

```js
module.exports = {
  extends: '@foyer/semantic-release-config',
  branch: 'develop', // any specific overrides
}
```

## Usage with utilizing release hooks

In `release.config.js`:

```js
module.exports = {
  extends: '@foyer/semantic-release-config',
  branch: 'develop', // any specific overrides
  plugins: [
    ...require('@foyer/semantic-release-config')['plugins'],
    [
      '@semantic-release/github',
      {
        assets: [{ path: 'dist/release.zip', name: 'Foyer.zip', label: 'Foyer App' }],
        successComment: 'This ${issue.pull_request ? "pull request" : "issue"} is included in version ${nextRelease.version}',
        failComment: 'This release from branch ${branch} had failed due to the following errors:\n- ${errors.map(err => err.message).join("\\n- ")}',
      },
    ],
    [
      '@semantic-release/exec',
      {
        prepareCmd: './config/release/prepare-publish.sh',
        successCmd: './config/release/success.sh',
      },
    ],
  ],
}
```

## License

MIT

<br>

[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
npm package: @foyer/tsconfig
Description: Base tsconfig config for @foyer
Author: Foyer Developers
Latest version: 0.1.6

# TS Config Foyer

> A [TS config](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) for Foyer

## Installation
> Dependent on `typescript-tslint-plugin`

```sh
npm install @foyer/tsconfig typescript-tslint-plugin --save-dev
```

## Usage

In `tsconfig.json`:
Specify directories path explicily

```json
{
  "extends": "@foyer/tsconfig/tsconfig-base.json",
  "include": ["./src/**/*"],
    "awesomeTypescriptLoaderOptions": {
        "reportFiles": ["./src/**/*"]
    }
}
```

It requires tslint config file `./tslint.json`

### Overried config flags
```json
{
  "extends": "@foyer/tsconfig/tsconfig-base.json",
  "compilerOptions": {
    "outDir": "./dist/",
    "allowJs": false,
    "declaration": true,
    "strictNullChecks": true
  },
  "include": ["./src/**/*"],
  "awesomeTypescriptLoaderOptions": {
      "reportFiles": ["./src/**/*"]
  }
}
```

## License

MIT
npm package: @foyer/tslint-config
Description: Base tslint config for @foyer
Author: Foyer Developers
Latest version: 0.1.6

# TSLint Config Foyer

> A [TSLint config](https://palantir.github.io/tslint/usage/configuration/) for Foyer

## Installation

> Dependent on `tslint` `tslint-config-prettier` `tslint-plugin-prettier` `tslint-react` `tslint-react-hooks`

```sh
npm install @foyer/tslint-config tslint tslint-config-prettier tslint-plugin-prettier tslint-react tslint-react-hooks --save-dev
```

## Usage

In `tslint.json`:

```json
{
  "extends": "@foyer/tslint-config",
  "rules": {
    "object-literal-sort-keys": true
  }
}
```

## License

MIT