|
| 1 | +## {{npmName}}@{{npmVersion}} |
| 2 | + |
| 3 | +This generator creates TypeScript/JavaScript client that utilizes [axios](https://github.com/axios/axios). The generated Node module can be used in the following environments: |
| 4 | + |
| 5 | +> `typescript-axios-slim` intentionally differs from `typescript-axios`: it removes `AxiosParamCreator`, `Fp`, and `Factory` layers and emits direct class methods with request-parameter schema validation. |
| 6 | + |
| 7 | +Environment |
| 8 | +* Node.js |
| 9 | +* Webpack |
| 10 | +* Browserify |
| 11 | + |
| 12 | +Language level |
| 13 | +* ES5 - you must have a Promises/A+ library installed |
| 14 | +* ES6 |
| 15 | + |
| 16 | +Module system |
| 17 | +* CommonJS |
| 18 | +* ES6 module system |
| 19 | + |
| 20 | +It can be used in both TypeScript and JavaScript. In TypeScript, the definition will be automatically resolved via `package.json`. ([Reference](https://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html)) |
| 21 | + |
| 22 | +### Building |
| 23 | + |
| 24 | +To build and compile the typescript sources to javascript use: |
| 25 | +``` |
| 26 | +npm install |
| 27 | +npm run build |
| 28 | +``` |
| 29 | + |
| 30 | +### Publishing |
| 31 | + |
| 32 | +First build the package then run `npm publish` |
| 33 | + |
| 34 | +### Consuming |
| 35 | + |
| 36 | +navigate to the folder of your consuming project and run one of the following commands. |
| 37 | + |
| 38 | +_published:_ |
| 39 | + |
| 40 | +``` |
| 41 | +npm install {{npmName}}@{{npmVersion}} --save |
| 42 | +``` |
| 43 | + |
| 44 | +_unPublished (not recommended):_ |
| 45 | + |
| 46 | +``` |
| 47 | +npm install PATH_TO_GENERATED_PACKAGE --save |
| 48 | +``` |
| 49 | + |
| 50 | +### Documentation for API Endpoints |
| 51 | + |
| 52 | +All URIs are relative to *{{{basePath}}}* |
| 53 | + |
| 54 | +Class | Method | HTTP request | Description |
| 55 | +------------ | ------------- | ------------- | ------------- |
| 56 | +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} |
| 57 | +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} |
| 58 | + |
| 59 | +### Documentation For Models |
| 60 | + |
| 61 | +{{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) |
| 62 | +{{/model}}{{/models}} |
| 63 | + |
| 64 | +<a id="documentation-for-authorization"></a> |
| 65 | +## Documentation For Authorization |
| 66 | + |
| 67 | +{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} |
| 68 | +{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} |
| 69 | +{{#authMethods}} |
| 70 | +<a id="{{name}}"></a> |
| 71 | +### {{{name}}} |
| 72 | + |
| 73 | +{{#isApiKey}} |
| 74 | +- **Type**: API key |
| 75 | +- **API key parameter name**: {{{keyParamName}}} |
| 76 | +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} |
| 77 | +{{/isApiKey}} |
| 78 | +{{#isBasic}} |
| 79 | +{{#isBasicBasic}} |
| 80 | +- **Type**: HTTP basic authentication |
| 81 | +{{/isBasicBasic}} |
| 82 | +{{#isBasicBearer}} |
| 83 | +- **Type**: Bearer authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} |
| 84 | +{{/isBasicBearer}} |
| 85 | +{{#isHttpSignature}} |
| 86 | +- **Type**: HTTP signature authentication |
| 87 | +{{/isHttpSignature}} |
| 88 | +{{/isBasic}} |
| 89 | +{{#isOAuth}} |
| 90 | +- **Type**: OAuth |
| 91 | +- **Flow**: {{{flow}}} |
| 92 | +- **Authorization URL**: {{{authorizationUrl}}} |
| 93 | +- **Scopes**: {{^scopes}}N/A{{/scopes}} |
| 94 | +{{#scopes}} - **{{{scope}}}**: {{{description}}} |
| 95 | +{{/scopes}} |
| 96 | +{{/isOAuth}} |
| 97 | + |
| 98 | +{{/authMethods}} |
0 commit comments