open-index/open-npm huggingface dataset:
npm package: @planship/management-fetch-dev
Description: Fetch client for Planship Management API. Autogerated using https://github.com/OpenAPITools/openapi-generator/blob/master/docs/generators/typescript-fetch.md
Latest version: 0.3.9

# planship-management-fetch-client

Fetch client for Planship Management API. Autogerated using https://github.com/OpenAPITools/openapi-generator/blob/master/docs/generators/typescript-fetch.md


## Autogenerate and publish to npmjs

Pre-requisite: Install [openapi-generator](https://openapi-generator.tech/docs/installation/)

Run the Planship API locally and run the following command to autogenerate the client code:

```
pnpm openapi-gen
```

Compile ts code to a distributable js and rebuild the docs
```
pnpm build
pnpm build-docs
```

Increment the package version in package.json, commit all changes (required), and run the following command to publish:

```
pnpm publish
```


## Local dev

Steps to get started in a local dev environment. This assumes that your other project is using pnpm. 

```
pnpm install
pnpm build
pnpm link --global
```

Go to your target project and run the follow to link the client library as a dependency:

```
pnpm link --global planship-management-fetch-client
```

Sample code to import, get a list of orgs from Planship, and  print the result. This assumes that Planship is running on localhost.

```js
import { OrganizationsApi } from 'planship-management-fetch-client';

let organizationsApi = new OrganizationsApi();
organizationsApi.listOrganizations().then((response) => {console.dir(response)});
```

API classes documentation can be found [here](./docs/classes/BaseAPI.md).
npm package: @planship/models
Description: This package contains Planship API interfaces and API response models used by the interface. Response models used by the [`PlanshipApi` interface](./docs/interfaces/PlanshipApi.md) have been auto-generated using the OpenAPI typescript-fetch generator.
Latest version: 0.3.5

# Planship JS models

This package contains Planship API interfaces and API response models used by the interface. Response models used by the [`PlanshipApi` interface](./docs/interfaces/PlanshipApi.md) have been auto-generated using the OpenAPI typescript-fetch generator.
npm package: @plansis/axios-auth-refresh
Description: Этот простой модуль обеспечивает отправку единого запроса на обновление токена даже при обработке одновременных запросов. Кроме того, он предлагает методы для последовательной интеграции запросов Axios с различными библиотеками.
Author: plansis
Latest version: 1.1.4

# axios-auth-refresh

Этот простой модуль обеспечивает отправку единого запроса на обновление токена даже при обработке одновременных запросов.
Кроме того, он предлагает методы для последовательной интеграции запросов Axios с различными библиотеками.

## Basic Usage

```typescript
import axios from "axios";
import { axiosAuthRefresh } from "@plansis/axios-auth-refresh";

const axiosInstance = axios.create({
  withCredentials: true,
  baseURL: "https://example.com/api",
});

const handleRefreshAuthCall = async () => {
  const response = await axiosInstance.post<TData>(
    "/refresh",
    {},
    { skipAuthRefresh: true }
  );
  return response;
};

const onRefreshSuccess = (res: AxiosResponse<TData>) => {
  console.log("success:", res);
};

const onRefreshError = (err: AxiosError<TError>) => {
  console.log("error:", err);
};

axiosAuthRefresh<TData, TError>({
  axiosInstance,
  refreshAuthCall: handleRefreshAuthCall,
  onSuccess: onRefreshSuccess,
  onError: onRefreshError,
  options: {
    statusCodes: [401, 403],
    retryDelayMs: 300,
    maxRetryCount: 3,
    maxCallCount: 3,
  },
});
```
npm package: @plansys/react-scripts
Description: Configuration and scripts for Create React App.
Latest version: 11.0.14

# react-scripts

This package includes scripts and configuration used by [Create React App](https://github.com/facebookincubator/create-react-app).<br>
Please refer to its documentation:

* [Getting Started](https://github.com/facebookincubator/create-react-app/blob/master/README.md#getting-started) – How to create a new app.
* [User Guide](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md) – How to develop apps bootstrapped with Create React App.
npm package: @plant/electron
Description: Listen Electron's protocols
Author: rumkin
Latest version: 0.1.0

# Electron

Helpers to make plant work in Electron, using Electrons streaming API.

## Install

```
npm i @plant/electron
```

## Usage

```js
const Plant = require('@plant/plant')
const {createServer} = require('@plant/electron')

const plant = new Plant()

plant.use(({res}) => {
  res.json({ok: true})
})

createServer(plant)
// Serve requests via https:// protocol
.interceptProtocol('https')
// Serve requests via my:// protocol (made up).
.registerProtocol('my')
```

## License

MIT © [Rumkin](https://rumk.in)
npm package: @plant/electron-adapter
Description: Plant server adapter for Electron
Author: rumkin
Latest version: 0.1.0

# Electron

Adapter to make Plant work in Electron, using Electrons streaming API.

## Install

```
npm i @plant/electron-adapter
```

## Usage

```js
const {protocol, session} = require('electron')
const Plant = require('@plant/plant')
const {createRequestHandler} = require('@plant/electron-adapter')

const plant = new Plant()

plant.use(({res}) => {
  res.json({ok: true})
})

// Serve standard protocol
protocol.interceptStreamProtocol('https', createRequestHandler(plant, session))
// Serve custom protocol
protocol.registerStreamProtocol('plant', createRequestHandler(plant, session))
```

## License

MIT © [Rumkin](https://rumk.in)
npm package: @plant/http
Description: Plant node.js HTTP module's server handler
Author: Rumkin
Latest version: 1.0.4

# Node HTTP for Plant

Plant adapter for native node.js http module. It creates server listener from plant instance.

## Install

```bash
npm i @plant/http
```

## Usage

```javascript
const Plant = require('@plant/plant');
const {createServer} = require('@plant/http');

const plant = new Plant();

plant.use(({res}) => {
  res.body = 'Ok';
});

createServer(plant).listen(80);
```

## License

MIT &copy; [Rumkin](https://rumk.in)
npm package: @plant/http-adapter
Description: Plant web server node.js HTTP adapter
Author: rumkin
Latest version: 1.4.0

# Plant HTTP Adapter

---

This handler connect Plant and native Node's HTTP server.

## Install

Production version from NPM registry:

```bash
npm i @plant/http
```

Adapter has Plant as peer dependency so you need to install it too:

```bash
npm i @plant/plant
```


## Usage

```javascript
const http = require('http');
const Plant = require('@plant/plant');
const {createRequestHandler} = require('@plant/http-adapter');

const plant = new Plant();

// Send text response
plant.use('/greet', async function({res}) {
    res.body = 'Hello World';
});

// Build request handler
http.createServer(createRequestHandler(plant))
.listen(80);
```

## Examples

* [Hello World](https://github.com/rumkin/plant/tree/master/example/hello-world.js).

## API

### `createRequestHandler()`
```text
(plant:Plant, intermediate: Handler) -> HttpRequestListener
```

Return native HTTP server request handler, which pass request through
`intermediate` handlers and then pass to the `plant`. Intermediate handlers
have access to both HTTP (`httpReq`, `httpRes`) and Plant (`req`, `res`)
requests and responses.

### `HttpRequestListener()`
```text
(req: http.Request, res: http.Response) -> void
```

This is standard request listener from Node.js HTTP built-in module.


## License

MIT &copy; [Rumkin](https://rumk.in)
npm package: @plant/http2
Description: Plant node.js HTTP2 module's server handler
Author: Rumkin
Latest version: 1.0.1

# Node HTTP2 for Plant

Plant adapter for node.js http2 module. It creates server listener from plant
instance and `http2.createServer()` options.

## Install

```bash
npm i @plant/http2
```

## Usage

### Hello World Example

```javascript
// Build request handler
const Plant = require('@plant/plant');
const {createServer} = require('@plant/http2');

const plant = new Plant();
plant.use(({res, socket}) => {
  res.body = 'Hello, World!'
})

createServer(plant)
.listen(80)
```

### Enable HTTP1

HTTP package doesn't support HTTP1 support by default and you should enable it manually:

```javascript
createServer(plant, {
  allowHTTP1: true,
})
```

### HTTP2 Push Example

```javascript
plant.use(({res, socket}) => {
  // Send HTTP2 push
  if (socket.canPush) {
    res.push(new Response({
      url: new URL('/style.css', res.url),
      headers: {
        'content-type': 'text/css',
      },
      body: 'html {color: green}',
    }))
  }

  res.body = '<html><head><link href="/style.css" ...'
})
```

## Copyright

MIT &copy; [Rumkin](https://rumk.in)
npm package: @plant/https
Description: Plant node.js HTTP module's server handler
Author: Rumkin
Latest version: 1.0.1

# Node HTTPS for Plant

Plant adapter for node.js https module. It creates server listener from plant instance and https options.

## Install

```bash
npm i @plant/https
```

## Usage

```javascript
const Plant = require('@plant/plant');
const {createServer} = require('@plant/https');

const plant = new Plant();

plant.use(({res}) => {
  res.body = 'Ok';
});

createServer(plant, {
  // get SSL key and cert somehow
  key,
  cert,
})
.listen(443);
```

## Copyright

MIT &copy; [Rumkin](https://rumk.in)
npm package: @plant/https2
Description: Plant node.js HTTP2 module's SSL server handler
Author: Rumkin
Latest version: 1.0.2

# Node HTTP2 TLS/SSL server for Plant

Plant adapter for node.js http2 module. It creates server listener from plant
instance and `http2.createSecureServer()` options.

## Install

```bash
npm i @plant/https2
```

## Usage

### Hello World Example

```javascript
// Build request handler
const Plant = require('@plant/plant');
const {createServer} = require('@plant/https2');

const plant = new Plant();
plant.use(({res, socket}) => {
  res.body = 'Hello, World!'
})

createServer(plant, {
  // get SSL key and cert somehow
  key,
  cert,
}).listen(443)
```

### Enable HTTP1

HTTP package doesn't support HTTP1 support by default and you should enable it manually:

```javascript
createServer(plant, {
  allowHTTP1: true,
})
```

### HTTP2 Push Example

```javascript
plant.use(({res, socket}) => {
  // Send HTTP2 push
  if (socket.canPush) {
    res.push(new Response({
      url: new URL('/style.css', res.url),
      headers: {
        'content-type': 'text/css',
      },
      body: 'html {color: green}',
    }))
  }

  res.body = '<html><head><link href="/style.css" ...'
})
```

## Copyright

MIT &copy; [Rumkin](https://rumk.in)
npm package: @plant/test-http
Description: Simple Node.js native HTTP test server
Author: Rumkin
Latest version: 0.5.3

# Plant Test HTTP Suite

This is a very simple test servers made for Plant development.

## Install

```bash
npm i @plant/test-http
```

## Usage

```javascript
const {createHttp} = require('@plant/test-http')
// or
const createHttp = require('@plant/test-http/http')

const server = createHttp((req, res) => {
  res.end('Hello')
})

server.listen(0)

server.fetch('/index.html')
.then(({status, headers, body, text}) => {
  body.toString('utf8') === text; // true
})
```

## API

* `createHttp()` – create HTTP test server
* `createHttp2()` – create HTTP2 test server
* `createHttps()` – create HTTPS test server
* `createHttps2()` – create HTTPS2 test server (the same as http2, but with HTTP2 test options)
* `fetchHttp()` – fetch HTTP resource using promisified API.
* `fetchHttp2()` – fetch HTTP2 resource using promisified API.
* `fetchHttps()` – fetch HTTPS resource using promisified API.

## Copyright

MIT &copy; [Rumkin](https://rumk.in)
npm package: @plant/test-http-suite
Description: Simple Node.js native HTTP test server
Author: Rumkin
Latest version: 0.5.1

# Plant Test HTTP Suite

This is a very simple test servers made for Plant development.

## Install

```bash
npm i @plant/test-http-suite
```

## Usage

```javascript
const createHttp = require('@plant/test-http-suite/http')

const server = createHttp((req, res) => {
    res.end('Hello')
})

server.listen(0)

server.fetch('/index.html')
.then(({status, headers, body, text}) => {
    body.toString('utf8') === text; // true
})
```

## Copyright

MIT &copy; [Rumkin](https://rumk.in)
npm package: @plantacjabetonu/randomid-generator
Description: A package containing a function for generating a string of randomised characters from the following arrangement: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
Latest version: 1.0.2

A package containing a function for generating a string of randomised characters from the following arrangement:
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789

The output's length depends on entered numerical value (idLength).

## Example:

// import randomID function
const randomID = require('@plantacjabetonu/randomid-generator');

// print out a string of 10 random characters in console
// the value '10' can be replaced with any other number
console.log(randomID(10));

# This package was made for the sake of learning how to create and share NPM packages.