open-index/open-npm huggingface dataset:
npm package: @kamiazya/dot-language-perser
Description: A dot language parser to handle AST so that it can be handled by TypeScript.
Author: kamiazya
Latest version: 0.0.1-0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

[![Build Status](https://travis-ci.com/kamiazya/dot-language-perser.svg?branch=master)](https://travis-ci.com/kamiazya/dot-language-perser)

# dot-language-perser (Experimental)

A dot language parser to handle AST so that it can be handled by TypeScript.

## License

[MIT](https://choosealicense.com/licenses/mit/)
npm package: @kamiazya/vue-highlight
Description: Vue(3+) directive for highlighting keywords in text
Author: Yuki Yamazaki
Latest version: 0.0.2

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com)

# @kamiazya/vue-highlight ✨

Vue(3+) directive for highlighting keywords in text.

> You can highlight matching keywords in the text within a given element with your own CSS.
>
> Internally, it uses the [Custom Highlighting API](https://developer.mozilla.org/en-US/docs/Web/API/CSS_Custom_Highlight_API), so it does not corrupt the DOM.

## Installation 📥

```bash
# By npm
$ npm install @kamiazya/vue-highlight
# By yarn
$ yarn add @kamiazya/vue-highlight
# By pnpm
$ pnpm add @kamiazya/vue-highlight
```

## Usage 📘

### Basic usage

Highlight the keyword `"bar"` in the text `"foo bar baz"`.

```vue
<script setup>
import { ref } from "vue";
import vHighlight from "@kamiazya/vue-highlight";

const keyword = ref("bar");
</script>

<template>
  <div v-highlight="keyword">
    foo bar baz
  </div>
</template>
<style>
::highlight(v-highlight) {
  background-color: yellow;
  color: black;
}
</style>
```

If you want to use `v-highlight` directive in global, you can register the `vHighlight` direvtive to app instance.

```ts
import { vHighlight } from '@kamiazya/vue-highlight'; // Import the directive
import { createApp } from 'vue';

import App from './src/App.vue';

const app = createApp(App);
app.directive('highlight', vHighlight); // Register the directive
app.mount('#container');
```

### Multiple keywords

Highlight the keywords `"foo"` and `"baz"` in the text `"foo bar baz"`.

```vue
<script setup>
import { ref } from "vue";
import vHighlight from "@kamiazya/vue-highlight";

const keyword = ref(["foo", "baz"]);
</script>

<template>
<div v-highlight="keyword">
  foo bar baz
</div>
</template>
<style>
::highlight(v-highlight) {
  background-color: yellow;
  color: black;
}
</style>
```

### Custom highlight name

Highlight the keyword `"bar"` in the text `"foo bar baz"` with a custom highlight name.

```vue
<script setup>
import { ref } from "vue";
import vHighlight from "@kamiazya/vue-highlight";

const keyword = ref("bar");
</script>

<template>
<div v-highlight:my-custom-highlight="keyword">
foo bar baz
</div>
</template>
<style>
::highlight(my-custom-highlight) {
  background-color: yellow;
  color: black;
}
</style>
```

### Multiple highlights

Highlight the keywords `"foo"` and `"baz"` in the text `"foo bar baz"` with multiple highlights.

```vue
<script setup>
import { ref } from "vue";
import vHighlight from "@kamiazya/vue-highlight";

const keyword1 = ref("bar");
const keyword2 = ref("foo");
</script>

<template>
<div
  v-highlight:highlight1="keyword1"
  v-highlight:highlight2="keyword2"
>
foo bar baz
</div>
</template>
<style>
::highlight(highlight1) {
  background-color: yellow;
  color: black;
}
::highlight(highlight2) {
  background-color: red;
  color: white;
}
</style>
```

## License ⚖️

This software is released under the MIT License, see [LICENSE](./LICENSE).
npm package: @kamicane/camelize
Description: camelize & hyphenate
Author: Valerio Proietti
Latest version: 1.0.0

# camelize

stupid simple camelize implementation, dates back to the mootools era

```js
const { camelize, hyphenate } = require('@kamicane/camelize')
```

```js
const camelize = require('@kamicane/camelize/camelize')
const hyphenate = require('@kamicane/camelize/hypenate')
```

```js
camelize("the-quick-brown-fox")
// 'theQuickBrownFox'
camelize("the-quick-brown--fox.jumps---over..the-lazy_dog")
// 'theQuickBrownFoxJumpsOverTheLazyDog'
camelize("-the-quick")
// 'TheQuick'
```

```js
> hyphenate('theQuickBrownFox')
// 'the-quick-brown-fox'
> hyphenate('TheQuickBrownFox')
// '-the-quick-brown-fox'
> hyphenate('theQuickBrownFox', '.')
// 'the.quick.brown.fox'
```
npm package: @kamicane/object
Description: object utils
Author: Valerio Proietti
Latest version: 1.0.3

# object

`[Object: null prototype]` utilities

## require

```js
const object = require('@kamicane/object')
```

## create

```js
object()
object(null)
object({ a: 1, b: 2, c: 3 })
```

## assign

```js
object({ a: 1, b: 2 }, { c: 3 }, { a: 2 })
```

## hasOwn

```js
object.hasOwn({ a: 1 }, 'a')
```

## proper iterators with generator functions

```js
;[...object.keys({ a: 1, b: 2, c: 3 })]
;[...object.values({ a: 1, b: 2, c: 3 })]
;[...object.entries({ a: 1, b: 2, c: 3 })]
```

> While it is easy to imagine that all iterators could be expressed as arrays, this is not true. Arrays must be allocated in their entirety, but iterators are consumed only as necessary and thus can express sequences of unlimited size. - [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators)
npm package: @kamidere/duat
Description: Discord Users Activity Tracker - Bot extension
Author: Kamide.re Laboratory
Latest version: 1.1.1
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

## Discord Users Activity Tracker [DUAT]
Bot extension.

Sample code in sample.ts

```js
const djs = require('discord.js');
const duat = require('@kamidere/duat');

const client = new djs.Client();
let subscription;

client.on('ready', () => {
  subscription = duat.default(client).subscribe((user) => {
    console.log(user) // {userID, timestamp, guildId}
  })
})

client.on('disconnect', () => {
  subscription.unsubscribe();
})

client.login(process.env.DSC_TOKEN);
```

# Features
Track creating/editing/deleting messeges  
Track voice joining/leaving  

# ToDo
Track reactions
Fix exporting

# Thanks to
@soanvig for CR and explaining in RxJS
npm package: @kamidere/eslint-config
Description: ```js module.exports = {   root: true,   env: {     commonjs: false,     es6: true,     node: true,     jest: true,   },   extends: ["@kamidere/eslint-config"],   ignorePatterns: [".eslintrc.cjs"],   parserOptions: {     ecmaVersion: 2022,     sourceType:
Author: Kamide.re Laboratory
Latest version: 0.0.2

## Recommended:

```js
module.exports = {
  root: true,
  env: {
    commonjs: false,
    es6: true,
    node: true,
    jest: true,
  },
  extends: ["@kamidere/eslint-config"],
  ignorePatterns: [".eslintrc.cjs"],
  parserOptions: {
    ecmaVersion: 2022,
    sourceType: "module",
    warnOnUnsupportedTypeScriptVersion: false,
    project: "tsconfig.json",
    tsconfigRootDir: __dirname,
  },
  globals: {
    NodeJS: true,
  },
  settings: {
    "import/resolver": {
      typescript: {
        alwaysTryTypes: true,
        project: "./tsconfig.json",
      },
    },
  },
};
```
npm package: @kamidere/node-args
Description: Most minimalistic parameter processor for node.
Author: Kamide.re Laboratory
Latest version: 3.0.1

Fork of [christiansandor/args](https://github.com/christiansandor/args)  
[![Build Status](https://travis-ci.org/Kamidere-Laboratory/args.svg?branch=master)](https://travis-ci.org/Kamidere-Laboratory/args)
[![Coverage Status](https://coveralls.io/repos/github/Kamidere-Laboratory/args/badge.svg?branch=master)](https://coveralls.io/github/Kamidere-Laboratory/args?branch=master)

# Args
The most minimalistic parameter processor for node. Really.

## Usage
Couldn't be simpler, just install it like:
```
npm install @kamidere/node-args
```

And use it as:
```
const { getArgs } = require('@kamidere/node-args');

const args = getArgs(process.argv);

const anyString = "-a --test nope";
const argsFromString = getArgs(anyString.split(' '));
```

### Call node with
- your named parameters prefixed with **--**
- your shorthand parameters prefixed with **-** (with multiple
  parameters in mind like `-ab = -a -b`)
- your parameters and assigned values separated with a
**space** or an **equals** sign

my.js
```
const { getArgs } = require('@kamidere/node-args');

console.log(getArgs(process.argv));
```

```
node my.js -t -ab=2 -c false -p no some additional data 2 --argsis awesome --another=1
```

So you will get:
```
{
    additional: ['node', 'node file path', 'some', 'additional', 'data', 2],
    t: true,
    a: 2,
    b: 2,
    c: false,
    p: 'no',
    argsis: 'awesome',
    another: 1
};
```

Yay.

*Side note: It's build upon TypeScript and tested thoroughly.*

## Build
The source files are in the *src* folder, and the available
scripts are
- `npm run build:src` to build without tests
- `npm run build:tests` to build with tests
- `npm test` to run tests

Please do contribute if you find a better, faster or easier way
to process arguments.
npm package: @kamidere/typeguard
Description: typeguard
Author: Kamide.re Laboratory
Latest version: 2.0.3

# @kamidere/typeguard

Typeguard based on [Zod](https://github.com/colinhacks/zod) schemas

## Installation

```bash
$ npm i zod @kamidere/typeguard

# or

yarn add zod @kamidere/typeguard
```

## Usage

`create-user.dto.ts`
```ts
import { TypeGuard } from "@kamidere/typeguard"
import { z } from "zod";

export const createUserDto = z.object({
  username: z.string().min(5).max(20),
  password: z.string().min(8),
  email: z.string().email(),
});

export type createUserDto = z.infer<typeof createUserDto>;

// TypeGuard<TYPE> is required to have proper type after use of assert method.

export const createUserDtoTypeGuard: TypeGuard<createUserDto> = new TypeGuard(createUserDto);

```

`create-user.resolver.ts`
```ts
import { createUserDtoTypeGuard } from "./create-user.dto.ts"
import { userService } from "../services/user.service.ts"


export const createUserResolver = ({ data }: Context) => {
  // data?: unknown
  createUserDtoTypeGuard.assert(data);
  // data: createUserDto

  // now we can safely pass our data knowing,
  // that our required parameters are correct
  userService.create(data);

}

```

## Tests
```bash

$ cd ..
$ npm i
$ npx lerna run --scope "@kamidere/typeguard" test

```
npm package: @kamidev/client-cli
Description: CLI interativo para iniciar projetos Expo com cliente definido.
Author: Victor Murakami
Latest version: 1.4.2

# 🧩 Client CLI — por Kami

Uma CLI simples e dinâmica para iniciar e gerenciar builds de clientes no projeto **Expo**.

---

## 🚀 Instalação

Instale globalmente:

```bash
npm install -g @kamidev/client-cli
```

Após isso, você poderá rodar diretamente:

```bash
client
```
---

## ⚙️ Comandos disponíveis

| Ação                          | Descrição                                              |
|-------------------------------|--------------------------------------------------------|
| **Gerar Prebuild (clean)** 🧩 | Gera o prebuild com limpeza (`expo prebuild --clean`)  |
| **Gerar Prebuild** 🧩         | Gera o prebuild normalmente (`expo prebuild`)          |
| **Rodar na Web** 🌐           | Executa o app no navegador (`npm run web`)             |
| **Rodar no iOS** 🍎           | Executa o app no simulador iOS (`expo run:ios`)        |
| **Rodar no Android** 🤖       | Executa o app no emulador Android (`expo run:android`) |

---

## 💻 Uso Interativo

<!--    /\_/\
      =( •.• )=
        /   \    -->

Basta executar:

```bash
client
```

Depois:

1. Selecione o **cliente**
2. Escolha a **ação** que deseja executar

Exemplo de saída:

```
🚀 Executando comando:
> CLIENT=<nome_cliente> npx expo run:ios
```

---

## ⚡ Uso Avançado (com Flags)

Ideal para **automatização de scripts** ou **pipelines CI/CD**.
Você pode pular as perguntas e passar as opções diretamente via linha de comando:

```bash
client --client <nome_cliente> --command ios
```

### 🔧 Flags disponíveis

| Flag        | Descrição                                                                      | Exemplo                    |
|-------------|--------------------------------------------------------------------------------|----------------------------|
| `--client`  | Nome da pasta dentro de `client-configs/`                                      | `--client <nome_cliente>`  |
| `--command` | Comando a ser executado (`prebuild`, `cleanprebuild`, `web`, `ios`, `android`) | `--command <nome_cliente>` |
npm package: @kamikai/eslint-config-natura-typescript
Description: [ESLint](https://eslint.org/) rules to achieve better code, using Typescript Airbnb styles rules.
Author: Natura Cosméticos
Latest version: 0.0.1

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/693bdf5edeec45c6b410be4e7418eda8)](https://www.codacy.com/app/handrus_1938/eslint-config-natura?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=natura-cosmeticos/eslint-config-natura&amp;utm_campaign=Badge_Grade)
[![Build Status](https://travis-ci.org/natura-cosmeticos/eslint-config-natura.svg?branch=master)](https://travis-ci.org/natura-cosmeticos/eslint-config-natura)
[![Known Vulnerabilities](https://snyk.io/test/github/natura-cosmeticos/eslint-config-natura/badge.svg?targetFile=package.json)](https://snyk.io/test/github/natura-cosmeticos/eslint-config-natura?targetFile=package.json)

# Natura ESLint Configuration

## What for

[ESLint](https://eslint.org/) rules to achieve better code, using Airbnb styles rules.

The Natura ESLint configuration extends the
[Airbnb](https://github.com/airbnb/javascript) configuration. While Airbnb
provides a decent style configuration it does not use all the available rules to
help enhance code quality like the following ones among others:

- [max-depth](https://eslint.org/docs/rules/max-depth)
- [max-lines-per-function](https://eslint.org/docs/rules/max-lines-per-function)
- [complexity](https://eslint.org/docs/rules/complexity)

### Why a new eslint-config?

This project helps achieve the `good maintainability` need, offering a default lint for all Node.js projects.

## How to use

To use this configuration install the package on your project using either npm or yarn:

```bash
npm i --save-dev '@naturacosmeticos/eslint-config-natura'

yarn add -D '@naturacosmeticos/eslint-config-natura'
```

We recommend you to install accepting only new patch releases (ex: `~2.0.0`), once new minor releases could add new rules that can broke your pipeline.

Add `@naturacosmeticos/natura` to the eslint `extends` option in the `.eslintrc` file:

```
{
  "env": {
    "es6": true,
    "mocha": true,
    "node": true
  },
  "extends": ["@naturacosmeticos/natura"],
  "parserOptions": {
    "ecmaVersion": 2017
  },
  "settings": {
    "import/resolver": {
      "node": {
        "paths": ["src", "test"]
      }
    }
  }
}
```

Airbnb-base is already included, no need to add it.

## How to contribute

You can contribute submitting [pull requests](https://github.com/natura-cosmeticos/eslint-config-natura/pulls).

### Setup

Run `yarn` or if your use npm `npm i`.
npm package: @kamikazept/router-fork
Description: Next generation Routing for React.
Author: Ryan Florence
Latest version: 1.0.1

<p align="center">
  <a href="https://reach.tech/router/">
    <img alt="Reach Router" src="./logo-horizontal.png" width="400">
  </a>
</p>

<p align="center">
  Next Generation Routing for <a href="https://facebook.github.io/react">React</a>
</p>

<p align="center">
  <a href="https://www.npmjs.com/package/@reach/router"><img src="https://img.shields.io/npm/v/@reach/router.svg?style=flat-square"></a>
  <a href="https://www.npmjs.com/package/@reach/router"><img src="https://img.shields.io/npm/dm/@reach/router.svg?style=flat-square"></a>
  <a href="https://travis-ci.org/reach/router"><img src="https://img.shields.io/travis/reach/router/master.svg?style=flat-square"></a>
</p>

## Documentation

[Documentation Site](https://reach.tech/router)

You can also find the docs in the [website directory](./website/src/markdown).

## Community

[Join us on Spectrum](https://spectrum.chat/reach)

## Legal

MIT License
Copyright (c) 2018-present, Ryan Florence
npm package: @kamikillerto/wait-js
Description: The coolest way to wait
Author: JEGARD Benjamin
Latest version: 0.2.4

# <div><img width="200px" src="waitjs.png">The coolest way to wait</div>

[![BuildStatus](https://travis-ci.org/KamiKillertO/waitjs.svg?branch=develop)](https://travis-ci.org/KamiKillertO/waitjs)
[![](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![](https://img.shields.io/badge/release-v0.2.4-blue.svg)](https://github.com/KamiKillertO/waitjs/releases/tag/v0.2.4)
[![CodacyBadge](https://api.codacy.com/project/badge/Grade/6e45642dc16c4e8c8e199f0c4282b770)](https://www.codacy.com/app/kamikillerto/waitjs?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=KamiKillertO/waitjs&amp;utm_campaign=Badge_Grade)
[![npm version](https://badge.fury.io/js/%40kamikillerto%2Fwait-js.svg)](https://badge.fury.io/js/%40kamikillerto%2Fwait-js)

waitjs provides you a promise-like interface to manage postponed executions.

## Installation

waitjs is available on npm and bower.

```bash
npm install --save @kamikillerto/wait-js
#or
bower install wait-js --save
```

This will install the waitjs library files in your project's bower_components or node_modules folder.  
After you just have to add `<script>` or use `require` with you favorite AMD module loader.

```javascript
var wait = require('@kamikillerto/wait-js');
```

```html
<script src="bower_components/wait-js/src/wait.js"type="text/javascript"></script>
<!-- or -->
<script src="node_modules/@kamikillerto/wait-js/src/wait.js"type="text/javascript"></script>
```

## API

### wait([time[, occurence]])

Do the same thing as ```setTimeout```, delay a function call.

Instead of writing :

```javascript
function delayedFn() {
    //...
};
setTimeout(delayedFn, 500);
```

 You can now write:

 ```javascript
 function delayedFn() {
     //...
 };
 wait(500).then(delayedFn);
 ```

#### time

Type : ```number```

It's the time to wait before executing the registered function.

```javascript
function delayedFn() {
    //...
};
wait(1000).then(delayedFn);
```

Here we wait 1s before calling the function ```delayedFn```.

#### occurence

Type: ```number```

It allow to execute the wait handlers multiples times each time after the waiting time.

Instead of writing :

```javascript
function delayedFn() {
    //...
};

var occurence = 5,
    id = setInterval(function() {
        if(occurence === 0) {
            return clearInterval(id);
        }
        delayedFn();
        occurence--;
        return;
    }, 500);
```

 You can now write:

```javascript
function delayedFn() {
    //...
};

wait(500, 5).then(delayedFn);
```

#### return [```Wait```](Wait)

## Wait

A [promise-like](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promis) object.

### Wait prototype

#### Wait.prototype.catch(onRejected)

Appends a rejection handler callback to the Wait.

#### Wait.prototype.then(onFulfilled, onRejected)

Appends fulfillment and rejection handlers to the Wait.

## License

MIT
npm package: @kamikore/iconfont-builder
Description: 将iconfont的字体文件转码并混合样式，统一压缩生成 iconfont.css
Author: kamikore
Latest version: 1.0.0

# iconfont-builder
一个iconfont 样式生成器
> npm仓库地址：https://www.npmjs.com/package/@kamikore/iconfont-builder

**前言：**

  该工具主要为了尝试npm包的开发、发布、安装，工具参照了作者[@imba97](https://github.com/imba97)的[simple-iconfont-builder](https://github.com/imba97/simple-iconfont-builder)项目

**简述：**

  使用 `iconfont` 项目会生成CDN服务链接，点击链接完全可以直接复制内容粘贴到.css生效。但字体资源是通过外链获取的，为了避免意外的情况，最好是备份本地获取。而把字体文件进一步转`base64`，能够避免ttf,woff等字体文件在android,ios,小程序中可能出现无法使用的问题。而上述一系列的操作，在每次更新`iconfont`时都需重做一遍。借由该该工具可以快捷生成经过压缩后的样式文件。


# 导入⚙️
```javascript
import IconfontBuilder from '@kamikore/iconfont-builder'
```

# 如何使用 ❔
1. 新建一个iconfont.js文件，例如 `src/dev/iconfont.js`，添加如下内容：
```javascript
import path from 'path'
import IconfontBuilder from '@kamikore/iconfont-builder'

/* 
  配置输出路径（如果build没有传入路径参数，默认输出当前执行node命令时候的文件夹地址 ——工作目录）
*/
IconfontBuilder.build(path.resolve(__dirname, 'iconfont.css'))  
```

2. 直接执行或是设置`script`命令
直接执行：
```shell
 node src/index.js //at.alicdn.com/t/c/font_3746531_ihmuv0x54n.css
 ```
 设置`script`命令：
在 `package.json` 的 `scripts` 添加一条：
```json
{
  "scripts": {
    "if": "node dev/iconfont.js"
  }
}
```
使用时执行 `npm run if //at.alicdn.com/t/c/font_3746531_ihmuv0x54n.css`
npm package: @kamil-perczynski/bootstrap-date-picker
Description: Made with create-react-library
Author: kamil-perczynski
Latest version: 1.0.4

# @kamil-perczynski/bootstrap-date-picker

> Made with create-react-library

[![NPM](https://img.shields.io/npm/v/@kamil-perczynski/bootstrap-date-picker.svg)](https://www.npmjs.com/package/@kamil-perczynski/bootstrap-date-picker) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

```bash
npm install --save @kamil-perczynski/bootstrap-date-picker
```

## Usage

```tsx
import React, { useState } from "react";
import { format } from "date-fns";
import { DatePicker, useDatePickerContainer } from "@kamil-perczynski/bootstrap-date-picker";
import "@kamil-perczynski/bootstrap-date-picker/dist/index.css";

const DatePickerFormGroup: React.FC<any> = () => {
  const [isOpen, setOpen] = useState(false);
  const [value, setValue] = useState("2021-05-03T12:00");

  const focuser = useDatePickerContainer(() => setOpen(false));

  return (
    <div
      onClick={focuser.onClick}
      onBlur={focuser.onBlur}
      ref={focuser.containerRef}
      className="form-group"
    >
      <label htmlFor="date-1">Pick a date:</label>
      <input
        value={format(new Date(value), "dd.MM.yyyy HH:mm")}
        onFocus={() => setOpen(true)}
        id="date-1"
        readOnly
        className="form-control bg-white"
      />
      <DatePicker
        type="localdatetime"
        open={isOpen}
        onClose={() => setOpen(false)}
        value={value}
        onChange={setValue}
        locale="hr-HR"
      />
    </div>
  );
};
```

## License

MIT © [kamil-perczynski](https://github.com/kamil-perczynski)
npm package: @kamil.chm/swagger-to-graphql
Description: Swagger2GraphQL converts your existing Swagger schema to GraphQL types where resolvers perform HTTP calls to certain real endpoints. It allows you to move your API to GraphQL with nearly zero effort and maintain both REST and GraphQL APIs.
Author: Roman Krivtsov
Latest version: 1.4.7

# Swagger2GraphQL

Swagger2GraphQL converts your existing Swagger schema to GraphQL types where resolvers perform HTTP calls to certain real endpoints.
It allows you to move your API to GraphQL with nearly zero effort and maintain both REST and GraphQL APIs.

<a href="https://medium.com/@raxwunter/moving-existing-api-from-rest-to-graphql-205bab22c184">Why?</a>

*Looking for contributors!*

# Usage

## Basic server

```js
const express = require('express');
const app = express();
const graphqlHTTP = require('express-graphql');
const graphQLSchema = require('swagger-to-graphql');

const proxyUrl = 'http://petstore.swagger.io/v2';
const pathToSwaggerSchema = './petstore.json';
const customHeaders = {
  // Authorization: 'Basic YWRkOmJhc2ljQXV0aA=='
}

graphQLSchema(pathToSwaggerSchema, proxyUrl, customHeaders).then(schema => {
  app.use('/graphql', graphqlHTTP(() => {
    return {
      schema,
      graphiql: true
    };
  }));

  app.listen(3009, 'localhost', () => {
    console.info('http://localhost:3009/graphql');
  });
}).catch(e => {
  console.log(e);
});
```

Constructor (graphQLSchema) arguments:
* `pathToSwaggerSchema` (string) is a path to your local swagger schema file. *required*
* `proxyUrl` (string) base URL which will be used to hit your HTTP API. Can be taken either from Swagger schema `baseUrl` configuration or from this parameter.
* `customHeaders` (object) key value object of custom headers, which should be included to the HTTP request. Can be used for example for authorization (look at the example above)

## CLI usage

You can use the library just to convert schemas without actually running server

```
npm i -g swagger-to-graphql
swagger-to-graphql --swagger=/path/to/swagger_schema.json > ./types.graphql
```

## Video from O.J. Sousa Rodrigues at Vienna.JS
<a href="https://www.youtube.com/watch?v=551gKWJEsK0&feature=youtu.be&t=1269" target="_blank"><img src="https://s3.eu-central-1.amazonaws.com/yarax-public-assets/2019-02-13_13-01-45.png"/></a>


![Build Status](https://travis-ci.org/yarax/swagger-to-graphql.svg?branch=master)
npm package: @kamil_4/randomid-generator
Description: This package generate an unique ID.
Author: kamil_4
Latest version: 1.0.1

# ID generator

This package generate an unique ID.

# Install

yarn add @kamil_4/randomid-generator

or

npm install @kamil_4/randomid-generator

# Usage

const randomID = require('@kamil_4/randomid-generator');

console.log(randomID(10)); // CfDQ0iO0Cr
npm package: @kamila-lab/component-loader
Description: Loader for Kamila components
Author: ycgarrido@gmail.com
Latest version: 0.0.1

# gatsby-transformer-javascript-frontmatter

Parses Stories files to extract content.

## Install

`npm install --save-dev @kamila-lab/component-loader`

## How to use

To use this plugin you also need [gatsby-source-filesystem](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-source-filesystem) installed and configured.

```javascript
// In your gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: `gatsby-source-filesystem`,
      options: {
        path: `./.stories/`
      }
    },
    "@kamila-lab/component-loader"
  ]
};
```
npm package: @kamila-lab/story-loader
Description: Loader for Kamila stories
Author: ycgarrido@gmail.com
Latest version: 0.0.1

# gatsby-transformer-javascript-frontmatter

Parses Stories files to extract content.

## Install

`npm install --save-dev @kamila-lab/story-loader`

## How to use

To use this plugin you also need [gatsby-source-filesystem](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-source-filesystem) installed and configured.

```javascript
// In your gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: `gatsby-source-filesystem`,
      options: {
        path: `./.stories/`
      }
    },
    "@kamila-lab/story-loader"
  ]
};
```

## Parsing algorithm

In a `index.story.js` (or `index.story.jsx` / `index.story.ts` / `index.story.tsx`) file.

```javascript
export default {
  name: "Sorting",
  summary: "",
  code: `<Icon icon="icon icon-switch"/>`
};
```

## How to query

You'd be able to query your frontmatter like:

```graphql
{
  allStories {
    nodes {
      story {
        code
        component
        name
        summary
      }
    }
  }
}
```

Which would return something like:

```javascript
{
  "data": {
    "allStories": {
      "nodes": [
        "story": {
          "component": {
            "code": `<Icon icon="icon icon-switch"/>`,
            "name":"Sorting",
            "summary":""
          }
        }
      ]
    }
  }
}
```
npm package: @kamila-lab/use-styles
Description: Build dynamic class bassed in css styles for React's components
Author: ycgarrido@gmail.com
Latest version: 2.0.1

# react-use-styles

Build dynamic class bassed in css styles for React's components, with rtl support.

#### Install

```
npm i --save @kamila-lab/use-styles
```

#### Usage

Write css styles like component's prop, writing `style` into prop object.

#### Example

###### Import useStyles and create a component:

```js
// import useStyles
import useStyles from "@kamila-lab/use-styles";

// create a custom component
const MyComponent = {direction,...props} => {
  const styles = useStyles({ props, direction });
  return (
    <div {...styles.props} className={styles.className}>
      This is a <span>component</span>
    </div>
  );
};

export default MyComponent;
```

###### Apply styles:

```js
// Define style
const myComponentStyle = {
  color: "#fff",
  backgroundColor: "#075294",
  padding: "5px",
  "&:hover": {
    border: "1px solid #458CCC !important",
    boxShadow: "0 28px 50px rgba(0,0,0,0.16)"
  },
  "&:focus": {
    border: "1px solid #458CCC !important"
  }
};
// use custom component
const OtherComponent = () => <MyComponent style={myComponentStyle} />;
```

###### Apply styles to nested components:

```js
/*
 * To apply styles to nested components add css selector after state
 */
const style = {
  "&:hover span": { color: "red" },
  "&:focus span": { color: "red" }
};

const OtherComponent = () => <MyComponent style={style} />;
```

#### Right to left

```js
/*
 * To use right to left add a bool prop rtl to componnet
 */
const style = {
  paddingLeft: "10px",
  borderTopLeftRadius: "30px",
  borderBottomLeftRadius: "30px"
};
const OtherComponent = () => <MyComponent style={style} direction="rtl" />;
```

#### Media and animations

```js
const style = {
  display: "inline-block",
    position: "relative",
    width: "80px",
    height: "80px",
    "& div": {
      position: "absolute",
      border: "4px solid #fff",
      opacity: 1,
      borderRadius: "50%",
      animation: "$lds-ripple 1s cubic-bezier(0, 0.2, 0.8, 1) infinite"
    },
    "& div:nth-child(2)": {
      animationDelay: "-0.5s"
    }
  "@media(max-width:400px)": {
    paddingLeft: "10px",
    borderTopLeftRadius: "30px",
    borderBottomLeftRadius: "30px"
  },
  "@keyframes lds-ripple": {
    "0%": {
      top: "36px",
      left: "36px",
      width: 0,
      height: 0,
      opacity: 1
    },
    "100%": {
      top: 0,
      left: 0,
      width: "72px",
      height: "72px",
      opacity: 0
    }
  }
};
const OtherComponent = () => <MyComponent style={style} />;
```
npm package: @kamilatte/disdb
Description: A package to use Discord as a (horrible) database
Author: Sam Teeuwisse, Kami Latte
Latest version: 1.0.3

## DisDB
#### A package to use Discord as a (horrible) database

### Features:
- A simple key value database
- Keys with TTL stored as Guild Events
- Values stored in the cover image of events
- Entirely hosted in Discord
- Horrible performance
- Dirt poor security
- Awful reliability 

### Example:
```js
import { StorageClient } from 'disdb';

let client = new StorageClient({
    logLevel: "INFO",
    discord: {
        // The ID of your storage server here
        storageServer: "id",
		
        bots: {
            // The bot token for your master
            // This bot is used for in-Discord control and setup
            master: "token",
            slaves: [
                // The bot tokens for your slaves
                // At least one slave is required, but more will improve performance
                "token",
                "token",
            ]
        }
    }
});

// Deletes all channels in the storage server and creates the correct layout for the database
// Use this with caution, it should only be used once to create the database, any further use
// will wipe the database.
await client.runServerSetup();

// Connect all clients to Discord and waits until they're ready
await client.connect();

await client.set("key", "value");

await client.get("key"); // returns "value"

await client.exists("test"); // returns true

await client.delete("test");

await client.exists("test"); // returns false
```
### Installation
To install disdb, follow those steps:
1. 
### But why?
Because it's fun!  
It's also interesting to see what you can do with Discord and how I can completely misuse it and have fun with it.
You should probably never use this in an actual project, but I won't stop you.

> it's genius because when discord is down, so is your bot, so you only have access to the data when you need it :4head:
> 
> **- devoxin#0001**
npm package: @kamilic-pkg/toolbox
Description: private project toolbox
Author: kamilic
Latest version: 1.1.0

[![Build Status](https://www.travis-ci.org/kamilic/Toolbox.svg?branch=master)](https://www.travis-ci.org/kamilic/Toolbox)
[![npm version](https://badge.fury.io/js/%40kamilic-pkg%2Ftoolbox.svg)](https://badge.fury.io/js/%40kamilic-pkg%2Ftoolbox)
# toolbox 
My open-source project toolbox.

一个有多种功能的命令行工具集合，预计的功能包括：
- 生成 demo 目录结构 (node-lib/browser-lib/webpage-vue/webpage-normal)
- 构建项目 (webpack)
- 项目开发 (webpack-dev-server)
- 语法检测 (eslint)
- 单元测试运行 (mocha + istanbul + 自定义断言)

## Install
```bash
npm install -g kamilic-toolbox
```

## USAGE

```bash
toolbox
```

### 生成一个 demo 项目
```bash
toolbox generate
```

有交互式菜单帮助选择项目结构:
- ```node-lib``` node 库项目结构
- ```browser-lib``` 浏览器库项目结构
- ```webpage-vue``` 浏览器 vue 项目结构
- ```webpage-normal``` 浏览器普通项目结构 

#### example
生成一个 node 库项目目录结构

```bash
mkdir node-lib
toolbox generate node-lib
```

### 开发及构建

```bash
cd projectDir
toolbox develop <project>
toolbox build <project>
```

```<project>``` 有四个参数，分别是:
- ```node-lib``` node 库项目结构
- ```browser-lib``` 浏览器库项目结构
- ```webpage-vue``` 浏览器 vue 项目结构
- ```webpage-normal``` 浏览器普通项目结构 


### 语法静态检测

```bash
cd projectDir
toolbox lint
```
npm package: @kamilic/blockblock
Description: Representing values use chars.
Author: kamilic
Latest version: 1.0.1

[![npm version](https://badge.fury.io/js/%40kamilic%2Fblockblock.svg)](https://badge.fury.io/js/%40kamilic%2Fblockblock) [![Build Status](https://dev.azure.com/kamilic/blockblock/_apis/build/status/kamilic.blockblock?branchName=master)](https://dev.azure.com/kamilic/blockblock/_build/latest?definitionId=1&branchName=master) [![codecov](https://codecov.io/gh/kamilic/blockblock/branch/master/graph/badge.svg)](https://codecov.io/gh/kamilic/blockblock)
# blockblock
Representing values use chars.

## Usage
### install
```bash
npm install @kamilic/blockblock
```

### default
```javascript
const BB = require('@kamilic/blockblock');
const b = BB();
b.value(10); // ██████████
b.value(10.1); // ██████████
b.value(10.126); // ██████████
b.value(10.25); // ██████████▎

b.percentage(10); // ██████████
```

### custom emoji blockblock
```javascript
const F = require('@kamilic/blockblock');
const b = F({
    max: 12,
    stepBlocks: ["😞", "😔", "😟", "😢", "😑", "😐", "😏", "🙂", "😀", "😆"]
});
b.value(10); // "😆😆😆😆😆😆😆😆😆😆"
b.value(10.125); // "😆😆😆😆😆😆😆😆😆😆😞"
b.value(10.2); // "😆😆😆😆😆😆😆😆😆😆😔"

b.precentage(100) // "😆😆😆😆😆😆😆😆😆😆😆😆"
```

## Options
```javascript
const F = require('@kamilic/blockblock');
const bb = F({
    // Maximum value
    max: 100,
    // Define different chars for represeting value (0 < value <= 1)
    // "▏", "▎", "▍", "▌", "▋", "▊", "▉", "█"
    // 1/8, 2/8, 3/8, 4/8, 5/8, 6/8, 7/8, 8/8
    stepBlocks: ["▏", "▎", "▍", "▌", "▋", "▊", "▉", "█"]
});
```

## Methods
- `bb.value(value: number): string` - get blockblock string.
- `bb.percentage(percent: number): string` - get blockblock string using percentage based on provided `max`.
npm package: @kamilkisiela/accounts-rest-express
Description: Server side REST express middleware for accounts
Author: Tim Mikeladze
Latest version: 0.1.0-beta.6

# @accounts/rest-express

[![npm](https://img.shields.io/npm/v/@accounts/rest-express.svg?maxAge=2592000)](https://www.npmjs.com/package/@accounts/rest-express)
[![CircleCI](https://circleci.com/gh/accounts-js/rest.svg?style=shield)](https://circleci.com/gh/accounts-js/rest)
[![codecov](https://codecov.io/gh/accounts-js/rest/branch/master/graph/badge.svg)](https://codecov.io/gh/accounts-js/rest)
![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)

## Install

```
yarn add @accounts/rest-express
```
npm package: @kamilkisiela/dr7y8ragyzk
Description: The easiest way to get started with Apollo Client in Angular
Author: Kamil Kisiela
Latest version: 1.0.0-beta.0

# Apollo Angular Boost

[![npm version](https://badge.fury.io/js/apollo-angular-boost.svg)](https://badge.fury.io/js/apollo-angular-boost)
[![Get on Slack](https://img.shields.io/badge/slack-join-orange.svg)](http://www.apollodata.com/#slack)

## Purpose

## Installation

`npm install apollo-angular-boost --save`

## Usage

```ts
import {HttpClientModule} from '@angular/common/http';
import {ApolloBoostModule, ApolloBoost} from 'apollo-angular-boost';

@NgModule({
  imports: [HttpClientModule, ApolloBoostModule],
})
export class AppModule {
  constructor(apolloBoost: ApolloBoost) {
    apolloBoost.create({
      uri,
    });
  }
}
```

```ts
import {Apollo, gql} from 'apollo-angular-boost';

export class AppComponent {
  constructor(apollo: Apollo) {
    const allPosts = apollo.watchQuery({
      query: gql`
        query allPosts {
          posts {
            id
            title
            text
          }
        }
      `,
    });

    // ...
  }
}
```
npm package: @kamilkisiela/express-session
Description: Stores the access and refresh tokens as part of the session (`express-session`), this way auth flow could be based on it.
Author: Kamil Kisiela
Latest version: 0.1.0-beta.20

# @accounts/express-session

Stores the access and refresh tokens as part of the session (`express-session`), this way auth flow could be based on it.

[![npm](https://img.shields.io/npm/v/@accounts/express-session.svg?maxAge=2592000)](https://www.npmjs.com/package/@accounts/express-session)
[![CircleCI](https://circleci.com/gh/accounts-js/express-session.svg?style=shield)](https://circleci.com/gh/accounts-js/express-session)
[![codecov](https://codecov.io/gh/accounts-js/express-session/branch/master/graph/badge.svg)](https://codecov.io/gh/accounts-js/express-session)
![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)

## Install

```
yarn add @accounts/express-session
```

## Usage

```ts
import * as express from 'express';
import * as session from 'express-session';
import { Tokens } from '@accounts/types';
import AccountsSession from '@accounts/express-session';
import { accountsServer } from './setup';

const accountsSession = new AccountsSession(accountsServer, {
  user: {
    name: 'currentUser',
    resolve: (tokens: Tokens) => {
      // function that returns a user object
    }
  }
});

const app = express();

app.use(
  session({
    name: 'id',
    secret: 'secret',
    rolling: true,
    cookie: { ... }, // cookie options
  })
);

app.use(accountsSession.middleware())

app.get('/me', (req, res) => {
  const user = req.currentUser; // middleware assings a user object to `req`

  res.json(user);
});

app.post('/login', (req, res) => {
  let tokens: Tokens; // Tokens  AccountsServer

  // ... a logic to log user in

  accountsSession.set(req, tokens); // sets tokens on request so middleware can access that
});

app.get('/logout', (req, res) => {
  accountsSession.destroy(req); // destroys the session and logs user out
});
```

## Options

#### user.name

Specifies the name of a property that holds a user object. For example, By using `currentUser`, a user object is accesible on `req.currentUser`.

By default it uses: `user`

#### user.resolve

Function that receives an access and a refresh tokens to resolve a user object.

```
(tokens: Tokens) => User | Promise<User>
```

By default it uses AccountsServer's API to resolve a user.

#### name

Specifies the name of a property that holds the Tokens. For example, By using `tokens`, tokens are accesible on `req.tokens`.

By default it uses: `accounts-js-tokens`

## License

MIT
npm package: @kamilkisiela/graphql-codegen-apollo-angular-template
Description: This template generates Apollo services (`Query`, `Mutation`, `Subscription`) with TypeScript typings. This template is extended version of TypeScript template, so the configuration is same with `graphql-codegen-typescript-template`.
Latest version: 0.10.8-alpha.2

# TypeScript Apollo Angular Template

This template generates Apollo services (`Query`, `Mutation`, `Subscription`) with TypeScript typings.
This template is extended version of TypeScript template, so the configuration is same with `graphql-codegen-typescript-template`.

- Example Input

```graphql
query MyFeed {
  feed {
    id
    commentCount
  }
}
```

- Example Usage

```ts
import { MyFeedGQL } from './graphql';

@Component({
  selector: 'feed',
  template: `
    <h1>Feed:</h1>
    <ul>
      <li *ngFor="let item of feed | async"> {{item.id}} </li>
    </ul>
  `
})
export class FeedComponent {
  feed: Observable<any>;

  constructor(feedGQL: MyFeedGQL) {
    this.feed = feedGQL.watch().valueChanges.pipe(map(result => result.data.feed));
  }
}
```

## Generator Config

This generator supports custom config and output behavior. Use to following flags/environment variables to modify your output as you wish:

### `noGraphqlTag` (or `CODEGEN_NO_GRAPHQL_TAG`, default value: `false`)

This will cause the codegen to output parsed documents and not use a literal tag of `graphql-tag` package.
npm package: @kamilkisiela/luna-angular
Description: Flux architecture for GraphQL based on Apollo Angular
Author: Kamil Kisiela
Latest version: 1.0.0-alpha.0

# @luna/angular

App State Management done with GraphQL

## Installation

```bash
npm install @luna/angular --save
// or
yarn add @luna/angular
```

## API

### State

```ts
import { State } from '@luna/angular';

@State({
  defaults: {
    currentGame: {
      __typename: 'CurrentGame',
      teamAScore: 0,
      teamBScore: 0,
      teamAName: 'Team A',
      teamBName: 'Team B',
    },
  },
})
export class GameState {}
```

### Mutation

Define an action:

```ts
import gql from 'graphql-tag';

export class Goal {
  static mutation = gql`
    mutation goal($team: String!) {
      goal(team: $team) @client
    }
  `;
  variables: any;
  constructor(team: 'A' | 'B') {
    this.variables = { team };
  }
}
```

Define a mutation:

```ts
import { Mutation } from '@luna/angular';
import { Goal } from './game.actions';

@State({ ... })
export class GameState {
    @Mutation(Goal)
    goal(root, args, context) {
        // ...
    }
}
```

### Query

Define a query:

```ts
import { Query } from '@luna/angular';
import { Goal } from './game.actions';

@State({ ... })
export class GameState {
    @Query()
    gameStatus(root, args, context) {
        // query gameStatus { gameStatus { ... } }
        return {...};
    }
}
```

### Action

Define an action:

```ts
export class StartGame {
  static type = '[Game] start';
}
```

And apply it to a state:

```ts
import { Query } from '@luna/angular';
import { of } from 'rxjs';
import { StartGame, GameStarted } from './game.actions';

@State({ ... })
export class GameState {
    @Action(StartGame)
    onStartGame(state, args) {
        return of(new GameStarted())
    }
}
```

### Luna

How to dispatch an action:

```ts
import { Luna } from '@luna/angular';

import { Goal } from './game.actions';

@Component({...})
export class AppComponent {
    constructor(private luna: Luna) {}

    ngOnInit() {
        this.
    }

    goal() {
        this.luna.dispatch(new Goal('A'))
    }
}
```

How to query data:

```ts
import { Luna } from '@luna/angular';
import { Observable } from 'rxjs';
import { pluck } from 'rxjs/operators';

import { currentGameQuery } from './graphql';
import { CurrentGame } from './interfaces';

@Component({...})
export class AppComponent {
    game: Observable<CurrentGame>;

    constructor(private luna: Luna) {}

    ngOnInit() {
        this.game = this.luna.query({ query: currentGameQuery })
            .valueChanges
            .pipe(pluck('data', 'currentGame'));
    }
}
```
npm package: @kamilmielnik/eslint-config
Description: Kamil Mielnik's ESLint Config
Author: Kamil Mielnik
Latest version: 0.0.11

# @kamilmielnik/eslint-config

## Setup

1. Install the package

```Shell
npm install @kamilmielnik/eslint-config --save-dev
```

2. Add `@kamilmielnik/eslint-config` to `extends` array in [ESLint configuration file](https://eslint.org/docs/latest/use/configure/configuration-files#using-a-shareable-configuration-package).

```js
/* .eslintrc.js */
module.exports = {
  /* ... */
  extends: ['@kamilmielnik/eslint-config'],
};
```

3. Make sure your `tsconfig.json` provides [Type Information](https://typescript-eslint.io/linting/typed-linting/) - your `.eslintrc.js` should enable `parserOptions.project` and specify `parserOptions.tsconfigRootDir`:

```js
/* .eslintrc.js */
module.exports = {
  /* ... */
  parserOptions: {
    project: true,
    tsconfigRootDir: __dirname,
  },
};
```