Skip to content

Commit 6b27ec5

Browse files
authored
Merge pull request #23 from vitwit/dev
Move Sample SDK to examples
2 parents 255800d + cf2fd37 commit 6b27ec5

8 files changed

Lines changed: 2559 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Changelog
2+
3+
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.
4+
5+
### [2.0.4](https://github.com/vitwit/SDKGen/compare/v2.0.1...v2.0.4) (2019-09-26)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ npm install -g js-sdkgen
1919
### Usage
2020

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

2525
Below are the list of parameters available for node cli config while generating SDK.

examples/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## Sample SDK
2+
3+
- Name : SampleSDK
4+
- Version : 1.0.0
5+
6+
## How to generate
7+
8+
Run this following command to generate the sample SDK.
9+
10+
```js
11+
js-sdkgen --json-file=swagger.json --name=SampleSDK --version=1.0.0 --base-url=https://vitwit.com/api --required-headers accountId --optional-headers accessToken
12+
13+
```
File renamed without changes.

sdk/yash.js renamed to examples/sdk/SampleSDK.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
import axios from "axios";
33
import { transformOperations } from './transformOperations'
44

5-
export default class Yash {
6-
constructor( headersObj ={}) {'undefined'
7-
this.requiredHeaders = '';
8-
this.optionalHeaders = '';
9-
this.name = "Yash";
5+
export default class Samplesdk {
6+
constructor( headersObj ={}) {
7+
this.version ='1.0.0'
8+
this.requiredHeaders = 'accountId';
9+
this.optionalHeaders = 'accessToken';
10+
this.name = "Samplesdk";
1011

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

1920
this.configs = {
20-
baseURL: "",
21+
baseURL: "https://vitwit.com/api",
2122
headers: {
2223
...headersObj,
2324
}

0 commit comments

Comments
 (0)