Skip to content

Commit

Permalink
Merge pull request #23 from vitwit/dev
Browse files Browse the repository at this point in the history
Move Sample SDK to examples
  • Loading branch information
anilcse authored Sep 26, 2019
2 parents 255800d + cf2fd37 commit 6b27ec5
Show file tree
Hide file tree
Showing 8 changed files with 2,559 additions and 10 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [2.0.4](https://github.com/vitwit/SDKGen/compare/v2.0.1...v2.0.4) (2019-09-26)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ npm install -g js-sdkgen
### Usage

```sh
js-sdkgen --json-file=api-docs.json name=MySDK --version=1.0.0 base-url=https://vitwit.com/api --requiredHeaders accoundId,key --optionalHeaders name
js-sdkgen --json-file=swagger.json --name=SampleSDK --version=1.0.0 --base-url=https://vitwit.com/api --required-headers accountId --optional-headers accessToken
```

Below are the list of parameters available for node cli config while generating SDK.
Expand Down
13 changes: 13 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Sample SDK

- Name : SampleSDK
- Version : 1.0.0

## How to generate

Run this following command to generate the sample SDK.

```js
js-sdkgen --json-file=swagger.json --name=SampleSDK --version=1.0.0 --base-url=https://vitwit.com/api --required-headers accountId --optional-headers accessToken

```
File renamed without changes.
13 changes: 7 additions & 6 deletions sdk/yash.js → examples/sdk/SampleSDK.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
import axios from "axios";
import { transformOperations } from './transformOperations'

export default class Yash {
constructor( headersObj ={}) {'undefined'
this.requiredHeaders = '';
this.optionalHeaders = '';
this.name = "Yash";
export default class Samplesdk {
constructor( headersObj ={}) {
this.version ='1.0.0'
this.requiredHeaders = 'accountId';
this.optionalHeaders = 'accessToken';
this.name = "Samplesdk";

if(this.requiredHeaders){
this.requiredHeaders.split(',').forEach(header => {
Expand All @@ -17,7 +18,7 @@ export default class Yash {
}

this.configs = {
baseURL: "",
baseURL: "https://vitwit.com/api",
headers: {
...headersObj,
}
Expand Down
Loading

0 comments on commit 6b27ec5

Please sign in to comment.