# jsspbuilder

> A CLI to generate K2 JSSP Broker Code from a Swagger/OpenAPI definition file.

Latest version **1.0.26** (published 2020-05-19) · ISC license · 0 weekly downloads

## Install

```sh
npm install jsspbuilder
pnpm add jsspbuilder
yarn add jsspbuilder
bun add jsspbuilder
```

Provides the command `jsspbuilder`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.26 |
| Published | 2020-05-19 |
| First published | 2020-05-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 81.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | smiddieza |

## Links

- npm: https://www.npmjs.com/package/jsspbuilder
- npm.io page: https://npm.io/package/jsspbuilder

## Dependencies (6)

- [chalk](https://npm.io/package/chalk.md) ^4.0.0
- [clear](https://npm.io/package/clear.md) ^0.1.0
- [figlet](https://npm.io/package/figlet.md) ^1.4.0
- [minimist](https://npm.io/package/minimist.md) ^1.2.5
- [js-beautify](https://npm.io/package/js-beautify.md) ^1.11.0
- [readline-sync](https://npm.io/package/readline-sync.md) ^1.4.10

## Recent versions

- 1.0.26 (latest) — 2020-05-19
- 1.0.25 — 2020-05-18
- 1.0.24 — 2020-05-18
- 1.0.23 — 2020-05-18
- 1.0.22 — 2020-05-15
- 1.0.21 — 2020-05-15
- 1.0.20 — 2020-05-15
- 1.0.19 — 2020-05-14
- 1.0.18 — 2020-05-14
- 1.0.17 — 2020-05-14

## README

# K2 TypeScript Broker Generator
This is a CLI which can be used to generate a K2 Broker by providing a Swagger v2.0 or OpenAPI v3.0 definition as input.

# Features
  
- Generates a TypeScript code file (index.ts) from a Swagger v2.0 or OpenAPI v3.0 definition file (json format)

- Dynamic flattening of complex objects up to user defined level in describe schema

- Dynamic flattening of returned data for complex objects

## Getting Started

This CLI requires [Node.js](https://nodejs.org/) v12.14.1+ to run.

## Usage

1. Clone the K2 JavaScript broker template into a new directory:
```sh
git clone https://github.com/K2Documentation/K2Documentation.Samples.JavascriptBroker.Template.git mynewbroker

cd mynewbroker
```

2. Install K2 Broker dependencies:
```sh
npm install
```


3. Install the JSSPBuilder CLI globally:
```bash
npm install jsspbuilder -g
```

4. Copy/Save you swagger/openAPI definition file to the project folder
```bash
copy [your_definition_file] swagger.json
```

>**Note**: If you want to integrate with an OData v4.0 service, you can make use of our OData v4.0 to >OpenAPI v3.0 		   conversion service.
>The Service can be found at:
>https://odata4edmtoopenapi3converter.azurewebsites.net/swagger/index.html

5. Run the JSSPBuilder CLI:

Interactive...
```bash
jsspbuilder
```

or with parameters
```bash
jsspbuilder --filename=swagger.json --flatten=2 --outputdir=src
```

>**Note**: If an index.ts file existed before running jsspbuilder, it will be renamed index.ts_bak1

  

6. Follow the instructions to build and publish your broker to a K2 Cloud instance :   
https://www.npmjs.com/package/@k2oss/k2-broker-core

---
_Source: https://npm.io/package/jsspbuilder · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
