@kattebak/openapi-generator-ts 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (290) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +189 -0
  3. package/dist/cli/commands/generate.d.ts +23 -0
  4. package/dist/cli/commands/generate.d.ts.map +1 -0
  5. package/dist/cli/commands/generate.js +116 -0
  6. package/dist/cli/commands/generate.js.map +1 -0
  7. package/dist/cli/commands/list.d.ts +2 -0
  8. package/dist/cli/commands/list.d.ts.map +1 -0
  9. package/dist/cli/commands/list.js +26 -0
  10. package/dist/cli/commands/list.js.map +1 -0
  11. package/dist/cli/commands/validate.d.ts +6 -0
  12. package/dist/cli/commands/validate.d.ts.map +1 -0
  13. package/dist/cli/commands/validate.js +80 -0
  14. package/dist/cli/commands/validate.js.map +1 -0
  15. package/dist/cli/convert-template.d.ts +31 -0
  16. package/dist/cli/convert-template.d.ts.map +1 -0
  17. package/dist/cli/convert-template.js +204 -0
  18. package/dist/cli/convert-template.js.map +1 -0
  19. package/dist/cli/convert-template.test.d.ts +2 -0
  20. package/dist/cli/convert-template.test.d.ts.map +1 -0
  21. package/dist/cli/convert-template.test.js +74 -0
  22. package/dist/cli/convert-template.test.js.map +1 -0
  23. package/dist/cli/index.d.ts +3 -0
  24. package/dist/cli/index.d.ts.map +1 -0
  25. package/dist/cli/index.js +246 -0
  26. package/dist/cli/index.js.map +1 -0
  27. package/dist/core/config.d.ts +252 -0
  28. package/dist/core/config.d.ts.map +1 -0
  29. package/dist/core/config.js +31 -0
  30. package/dist/core/config.js.map +1 -0
  31. package/dist/core/generator.d.ts +99 -0
  32. package/dist/core/generator.d.ts.map +1 -0
  33. package/dist/core/generator.js +492 -0
  34. package/dist/core/generator.js.map +1 -0
  35. package/dist/core/index.d.ts +4 -0
  36. package/dist/core/index.d.ts.map +1 -0
  37. package/dist/core/index.js +4 -0
  38. package/dist/core/index.js.map +1 -0
  39. package/dist/core/types.d.ts +47 -0
  40. package/dist/core/types.d.ts.map +1 -0
  41. package/dist/core/types.js +5 -0
  42. package/dist/core/types.js.map +1 -0
  43. package/dist/generators/generators.test.d.ts +6 -0
  44. package/dist/generators/generators.test.d.ts.map +1 -0
  45. package/dist/generators/generators.test.js +247 -0
  46. package/dist/generators/generators.test.js.map +1 -0
  47. package/dist/generators/go.d.ts +10 -0
  48. package/dist/generators/go.d.ts.map +1 -0
  49. package/dist/generators/go.js +327 -0
  50. package/dist/generators/go.js.map +1 -0
  51. package/dist/generators/index.d.ts +29 -0
  52. package/dist/generators/index.d.ts.map +1 -0
  53. package/dist/generators/index.js +58 -0
  54. package/dist/generators/index.js.map +1 -0
  55. package/dist/generators/php.d.ts +14 -0
  56. package/dist/generators/php.d.ts.map +1 -0
  57. package/dist/generators/php.js +241 -0
  58. package/dist/generators/php.js.map +1 -0
  59. package/dist/generators/python.d.ts +10 -0
  60. package/dist/generators/python.d.ts.map +1 -0
  61. package/dist/generators/python.js +273 -0
  62. package/dist/generators/python.js.map +1 -0
  63. package/dist/generators/typescript-fetch.d.ts +14 -0
  64. package/dist/generators/typescript-fetch.d.ts.map +1 -0
  65. package/dist/generators/typescript-fetch.js +217 -0
  66. package/dist/generators/typescript-fetch.js.map +1 -0
  67. package/dist/index.d.ts +14 -0
  68. package/dist/index.d.ts.map +1 -0
  69. package/dist/index.js +16 -0
  70. package/dist/index.js.map +1 -0
  71. package/dist/models/codegen-model.d.ts +123 -0
  72. package/dist/models/codegen-model.d.ts.map +1 -0
  73. package/dist/models/codegen-model.js +64 -0
  74. package/dist/models/codegen-model.js.map +1 -0
  75. package/dist/models/codegen-model.test.d.ts +6 -0
  76. package/dist/models/codegen-model.test.d.ts.map +1 -0
  77. package/dist/models/codegen-model.test.js +143 -0
  78. package/dist/models/codegen-model.test.js.map +1 -0
  79. package/dist/models/codegen-operation.d.ts +95 -0
  80. package/dist/models/codegen-operation.d.ts.map +1 -0
  81. package/dist/models/codegen-operation.js +54 -0
  82. package/dist/models/codegen-operation.js.map +1 -0
  83. package/dist/models/codegen-parameter.d.ts +86 -0
  84. package/dist/models/codegen-parameter.d.ts.map +1 -0
  85. package/dist/models/codegen-parameter.js +47 -0
  86. package/dist/models/codegen-parameter.js.map +1 -0
  87. package/dist/models/codegen-property.d.ts +95 -0
  88. package/dist/models/codegen-property.d.ts.map +1 -0
  89. package/dist/models/codegen-property.js +47 -0
  90. package/dist/models/codegen-property.js.map +1 -0
  91. package/dist/models/codegen-response.d.ts +64 -0
  92. package/dist/models/codegen-response.d.ts.map +1 -0
  93. package/dist/models/codegen-response.js +42 -0
  94. package/dist/models/codegen-response.js.map +1 -0
  95. package/dist/models/codegen-security.d.ts +34 -0
  96. package/dist/models/codegen-security.d.ts.map +1 -0
  97. package/dist/models/codegen-security.js +18 -0
  98. package/dist/models/codegen-security.js.map +1 -0
  99. package/dist/models/index.d.ts +8 -0
  100. package/dist/models/index.d.ts.map +1 -0
  101. package/dist/models/index.js +7 -0
  102. package/dist/models/index.js.map +1 -0
  103. package/dist/parser/index.d.ts +4 -0
  104. package/dist/parser/index.d.ts.map +1 -0
  105. package/dist/parser/index.js +4 -0
  106. package/dist/parser/index.js.map +1 -0
  107. package/dist/parser/openapi-parser.d.ts +71 -0
  108. package/dist/parser/openapi-parser.d.ts.map +1 -0
  109. package/dist/parser/openapi-parser.js +195 -0
  110. package/dist/parser/openapi-parser.js.map +1 -0
  111. package/dist/parser/openapi-parser.test.d.ts +6 -0
  112. package/dist/parser/openapi-parser.test.d.ts.map +1 -0
  113. package/dist/parser/openapi-parser.test.js +238 -0
  114. package/dist/parser/openapi-parser.test.js.map +1 -0
  115. package/dist/parser/operation-transformer.d.ts +95 -0
  116. package/dist/parser/operation-transformer.d.ts.map +1 -0
  117. package/dist/parser/operation-transformer.js +634 -0
  118. package/dist/parser/operation-transformer.js.map +1 -0
  119. package/dist/parser/schema-transformer.d.ts +134 -0
  120. package/dist/parser/schema-transformer.d.ts.map +1 -0
  121. package/dist/parser/schema-transformer.js +557 -0
  122. package/dist/parser/schema-transformer.js.map +1 -0
  123. package/dist/template/engine-adapter.d.ts +55 -0
  124. package/dist/template/engine-adapter.d.ts.map +1 -0
  125. package/dist/template/engine-adapter.js +178 -0
  126. package/dist/template/engine-adapter.js.map +1 -0
  127. package/dist/template/engine-adapter.test.d.ts +6 -0
  128. package/dist/template/engine-adapter.test.d.ts.map +1 -0
  129. package/dist/template/engine-adapter.test.js +186 -0
  130. package/dist/template/engine-adapter.test.js.map +1 -0
  131. package/dist/template/index.d.ts +5 -0
  132. package/dist/template/index.d.ts.map +1 -0
  133. package/dist/template/index.js +5 -0
  134. package/dist/template/index.js.map +1 -0
  135. package/dist/template/lambdas/indent-lambdas.d.ts +40 -0
  136. package/dist/template/lambdas/indent-lambdas.d.ts.map +1 -0
  137. package/dist/template/lambdas/indent-lambdas.js +98 -0
  138. package/dist/template/lambdas/indent-lambdas.js.map +1 -0
  139. package/dist/template/lambdas/index.d.ts +44 -0
  140. package/dist/template/lambdas/index.d.ts.map +1 -0
  141. package/dist/template/lambdas/index.js +79 -0
  142. package/dist/template/lambdas/index.js.map +1 -0
  143. package/dist/template/lambdas/string-lambdas.d.ts +78 -0
  144. package/dist/template/lambdas/string-lambdas.d.ts.map +1 -0
  145. package/dist/template/lambdas/string-lambdas.js +148 -0
  146. package/dist/template/lambdas/string-lambdas.js.map +1 -0
  147. package/dist/template/lambdas/string-lambdas.test.d.ts +6 -0
  148. package/dist/template/lambdas/string-lambdas.test.d.ts.map +1 -0
  149. package/dist/template/lambdas/string-lambdas.test.js +158 -0
  150. package/dist/template/lambdas/string-lambdas.test.js.map +1 -0
  151. package/dist/template/template-locator.d.ts +72 -0
  152. package/dist/template/template-locator.d.ts.map +1 -0
  153. package/dist/template/template-locator.js +173 -0
  154. package/dist/template/template-locator.js.map +1 -0
  155. package/dist/template/template-manager.d.ts +65 -0
  156. package/dist/template/template-manager.d.ts.map +1 -0
  157. package/dist/template/template-manager.js +185 -0
  158. package/dist/template/template-manager.js.map +1 -0
  159. package/package.json +67 -0
  160. package/templates/go/.travis.yml +8 -0
  161. package/templates/go/README.mustache +236 -0
  162. package/templates/go/api.mustache +452 -0
  163. package/templates/go/api_doc.mustache +92 -0
  164. package/templates/go/api_test.mustache +59 -0
  165. package/templates/go/client.mustache +761 -0
  166. package/templates/go/configuration.mustache +332 -0
  167. package/templates/go/git_push.sh.mustache +57 -0
  168. package/templates/go/gitignore.mustache +24 -0
  169. package/templates/go/go.mod.mustache +16 -0
  170. package/templates/go/go.sum.mustache +19 -0
  171. package/templates/go/model.mustache +21 -0
  172. package/templates/go/model_anyof.mustache +93 -0
  173. package/templates/go/model_doc.mustache +97 -0
  174. package/templates/go/model_enum.mustache +101 -0
  175. package/templates/go/model_oneof.mustache +160 -0
  176. package/templates/go/model_simple.mustache +572 -0
  177. package/templates/go/nullable_model.mustache +35 -0
  178. package/templates/go/openapi.mustache +1 -0
  179. package/templates/go/partial_header.mustache +18 -0
  180. package/templates/go/response.mustache +38 -0
  181. package/templates/go/signing.mustache +453 -0
  182. package/templates/go/utils.mustache +352 -0
  183. package/templates/php/.php-cs-fixer.dist.php +29 -0
  184. package/templates/php/.travis.yml +8 -0
  185. package/templates/php/ApiException.mustache +111 -0
  186. package/templates/php/Configuration.mustache +606 -0
  187. package/templates/php/FormDataProcessor.mustache +238 -0
  188. package/templates/php/HeaderSelector.mustache +265 -0
  189. package/templates/php/ModelInterface.mustache +103 -0
  190. package/templates/php/ObjectSerializer.mustache +591 -0
  191. package/templates/php/README.mustache +151 -0
  192. package/templates/php/api.mustache +891 -0
  193. package/templates/php/api_doc.mustache +105 -0
  194. package/templates/php/api_test.mustache +80 -0
  195. package/templates/php/composer.mustache +44 -0
  196. package/templates/php/git_push.sh.mustache +57 -0
  197. package/templates/php/gitignore +15 -0
  198. package/templates/php/libraries/psr-18/ApiException.mustache +114 -0
  199. package/templates/php/libraries/psr-18/DebugPlugin.mustache +93 -0
  200. package/templates/php/libraries/psr-18/README.mustache +161 -0
  201. package/templates/php/libraries/psr-18/api.mustache +833 -0
  202. package/templates/php/libraries/psr-18/api_doc.mustache +79 -0
  203. package/templates/php/libraries/psr-18/composer.mustache +56 -0
  204. package/templates/php/model.mustache +47 -0
  205. package/templates/php/model_doc.mustache +10 -0
  206. package/templates/php/model_enum.mustache +33 -0
  207. package/templates/php/model_generic.mustache +565 -0
  208. package/templates/php/model_test.mustache +88 -0
  209. package/templates/php/partial_header.mustache +18 -0
  210. package/templates/php/php_doc_auth_partial.mustache +23 -0
  211. package/templates/php/phpunit.xml.mustache +18 -0
  212. package/templates/python/README.mustache +60 -0
  213. package/templates/python/README_onlypackage.mustache +50 -0
  214. package/templates/python/__init__.mustache +1 -0
  215. package/templates/python/__init__api.mustache +19 -0
  216. package/templates/python/__init__model.mustache +22 -0
  217. package/templates/python/__init__package.mustache +49 -0
  218. package/templates/python/api.mustache +244 -0
  219. package/templates/python/api_client.mustache +822 -0
  220. package/templates/python/api_doc.mustache +81 -0
  221. package/templates/python/api_doc_example.mustache +38 -0
  222. package/templates/python/api_response.mustache +21 -0
  223. package/templates/python/api_test.mustache +48 -0
  224. package/templates/python/asyncio/rest.mustache +209 -0
  225. package/templates/python/common_README.mustache +85 -0
  226. package/templates/python/configuration.mustache +806 -0
  227. package/templates/python/exceptions.mustache +210 -0
  228. package/templates/python/exports_api.mustache +3 -0
  229. package/templates/python/exports_model.mustache +3 -0
  230. package/templates/python/exports_package.mustache +20 -0
  231. package/templates/python/git_push.sh.mustache +57 -0
  232. package/templates/python/github-workflow.mustache +35 -0
  233. package/templates/python/gitignore.mustache +66 -0
  234. package/templates/python/gitlab-ci.mustache +31 -0
  235. package/templates/python/httpx/rest.mustache +190 -0
  236. package/templates/python/model.mustache +16 -0
  237. package/templates/python/model_anyof.mustache +182 -0
  238. package/templates/python/model_doc.mustache +40 -0
  239. package/templates/python/model_enum.mustache +36 -0
  240. package/templates/python/model_generic.mustache +403 -0
  241. package/templates/python/model_oneof.mustache +209 -0
  242. package/templates/python/model_test.mustache +60 -0
  243. package/templates/python/partial_api.mustache +52 -0
  244. package/templates/python/partial_api_args.mustache +18 -0
  245. package/templates/python/partial_header.mustache +19 -0
  246. package/templates/python/py.typed.mustache +1 -0
  247. package/templates/python/pyproject.mustache +172 -0
  248. package/templates/python/python_doc_auth_partial.mustache +108 -0
  249. package/templates/python/requirements.mustache +23 -0
  250. package/templates/python/rest.mustache +254 -0
  251. package/templates/python/setup.mustache +60 -0
  252. package/templates/python/setup_cfg.mustache +2 -0
  253. package/templates/python/signing.mustache +422 -0
  254. package/templates/python/test-requirements.mustache +6 -0
  255. package/templates/python/tornado/rest.mustache +148 -0
  256. package/templates/python/tox.mustache +9 -0
  257. package/templates/python/travis.mustache +17 -0
  258. package/templates/typescript-fetch/ApiEntitiesRecord.mustache +26 -0
  259. package/templates/typescript-fetch/ApiEntitiesReducer.mustache +21 -0
  260. package/templates/typescript-fetch/ApiEntitiesSelectors.mustache +5 -0
  261. package/templates/typescript-fetch/README.mustache +127 -0
  262. package/templates/typescript-fetch/allSagas.mustache +19 -0
  263. package/templates/typescript-fetch/api_doc.mustache +63 -0
  264. package/templates/typescript-fetch/api_example.mustache +44 -0
  265. package/templates/typescript-fetch/apis.index.mustache +16 -0
  266. package/templates/typescript-fetch/apis.mustache +483 -0
  267. package/templates/typescript-fetch/apisAssignQueryParam.mustache +12 -0
  268. package/templates/typescript-fetch/gitignore +4 -0
  269. package/templates/typescript-fetch/index.mustache +17 -0
  270. package/templates/typescript-fetch/licenseInfo.mustache +11 -0
  271. package/templates/typescript-fetch/modelEnum.mustache +28 -0
  272. package/templates/typescript-fetch/modelEnumInterfaces.mustache +37 -0
  273. package/templates/typescript-fetch/modelGeneric.mustache +261 -0
  274. package/templates/typescript-fetch/modelGenericInterfaces.mustache +50 -0
  275. package/templates/typescript-fetch/modelOneOf.mustache +255 -0
  276. package/templates/typescript-fetch/modelOneOfInterfaces.mustache +6 -0
  277. package/templates/typescript-fetch/model_doc.mustache +41 -0
  278. package/templates/typescript-fetch/models.index.mustache +32 -0
  279. package/templates/typescript-fetch/models.mustache +24 -0
  280. package/templates/typescript-fetch/npmignore.mustache +1 -0
  281. package/templates/typescript-fetch/package.mustache +43 -0
  282. package/templates/typescript-fetch/recordGeneric.mustache +295 -0
  283. package/templates/typescript-fetch/records.mustache +17 -0
  284. package/templates/typescript-fetch/runtime.mustache +424 -0
  285. package/templates/typescript-fetch/runtimeSagasAndRecords.mustache +120 -0
  286. package/templates/typescript-fetch/sagaApiManager.mustache +28 -0
  287. package/templates/typescript-fetch/sagas.mustache +245 -0
  288. package/templates/typescript-fetch/sourceLibraryIndex.mustache +1 -0
  289. package/templates/typescript-fetch/tsconfig.esm.mustache +7 -0
  290. package/templates/typescript-fetch/tsconfig.mustache +25 -0
@@ -0,0 +1,127 @@
1
+ # {{npmName}}@{{npmVersion}}
2
+
3
+ A TypeScript SDK client for the {{host}} API.
4
+
5
+ ## Usage
6
+
7
+ First, install the SDK from npm.
8
+
9
+ ```bash
10
+ npm install {{npmName}} --save
11
+ ```
12
+
13
+ Next, try it out.
14
+
15
+ {{#apiInfo}}{{#apis}}{{#if @first}}{{#operations}}{{#operation}}{{#if @first}}
16
+ ```ts
17
+ {{>api_example}}
18
+ ```
19
+ {{/if}}{{/operation}}{{/operations}}{{/if}}{{/apis}}{{/apiInfo}}
20
+
21
+ ## Documentation
22
+
23
+ ### API Endpoints
24
+
25
+ All URIs are relative to *{{basePath}}*
26
+
27
+ | Class | Method | HTTP request | Description
28
+ | ----- | ------ | ------------ | -------------
29
+ {{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}/{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}}
30
+ {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}
31
+
32
+ ### Models
33
+
34
+ {{#models}}{{#model}}- [{{{classname}}}]({{modelDocPath}}/{{{classname}}}.md){{/model}}
35
+ {{/models}}
36
+
37
+ ### Authorization
38
+
39
+ {{^authMethods}}Endpoints do not require authorization.{{/authMethods}}
40
+ {{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}}
41
+ {{#authMethods}}
42
+ <a id="{{name}}{{#isOAuth}}-{{flow}}{{/isOAuth}}"></a>
43
+ #### {{name}}{{#isOAuth}} {{flow}}{{/isOAuth}}
44
+
45
+ {{#isApiKey}}
46
+
47
+ - **Type**: API key
48
+ - **API key parameter name**: `{{keyParamName}}`
49
+ - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}}
50
+ {{/isApiKey}}
51
+ {{#isBasicBasic}}
52
+
53
+ - **Type**: HTTP basic authentication
54
+ {{/isBasicBasic}}
55
+ {{#isBasicBearer}}
56
+
57
+ - **Type**: HTTP Bearer Token authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}}
58
+ {{/isBasicBearer}}
59
+ {{#isHttpSignature}}
60
+
61
+ - **Type**: HTTP signature authentication
62
+ {{/isHttpSignature}}
63
+ {{#isOAuth}}
64
+
65
+ - **Type**: OAuth
66
+ - **Flow**: {{flow}}
67
+ - **Authorization URL**: {{authorizationUrl}}
68
+ - **Scopes**: {{^scopes}}N/A{{/scopes}}
69
+ {{#scopes}} - `{{scope}}`: {{description}}
70
+ {{/scopes}}
71
+ {{/isOAuth}}
72
+ {{/authMethods}}
73
+
74
+ ## About
75
+
76
+ This TypeScript SDK client supports the [Fetch API](https://fetch.spec.whatwg.org/)
77
+ and is automatically generated by the
78
+ [OpenAPI Generator](https://openapi-generator.tech) project:
79
+
80
+ - API version: `{{appVersion}}`
81
+ - Package version: `{{npmVersion}}`
82
+ {{^hideGenerationTimestamp}}
83
+ - Build date: `{{generatedDate}}`
84
+ {{/hideGenerationTimestamp}}
85
+ - Generator version: `{{generatorVersion}}`
86
+ - Build package: `{{generatorClass}}`
87
+
88
+ The generated npm module supports the following:
89
+
90
+ - Environments
91
+ * Node.js
92
+ * Webpack
93
+ * Browserify
94
+ - Language levels
95
+ * ES5 - you must have a Promises/A+ library installed
96
+ * ES6
97
+ - Module systems
98
+ * CommonJS
99
+ * ES6 module system
100
+
101
+ {{#if infoUrl}}
102
+ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
103
+ {{/if}}
104
+
105
+ ## Development
106
+
107
+ ### Building
108
+
109
+ To build the TypeScript source code, you need to have Node.js and npm installed.
110
+ After cloning the repository, navigate to the project directory and run:
111
+
112
+ ```bash
113
+ npm install
114
+ npm run build
115
+ ```
116
+
117
+ ### Publishing
118
+
119
+ Once you've built the package, you can publish it to npm:
120
+
121
+ ```bash
122
+ npm publish
123
+ ```
124
+
125
+ ## License
126
+
127
+ [{{licenseInfo}}]({{{licenseUrl}}})
@@ -0,0 +1,19 @@
1
+ import {all, fork} from "redux-saga/effects";
2
+
3
+ import {
4
+ {{#apiInfo}}
5
+ {{#apis}}
6
+ {{#camelcase}}{{classFilename}}{{/camelcase}}AllSagas,
7
+ {{/apis}}
8
+ {{/apiInfo}}
9
+ } from "./index{{importFileExtension}}";
10
+
11
+ export function *allApiSagas() {
12
+ yield all([
13
+ {{#apiInfo}}
14
+ {{#apis}}
15
+ fork({{#camelcase}}{{classFilename}}{{/camelcase}}AllSagas),
16
+ {{/apis}}
17
+ {{/apiInfo}}
18
+ ]);
19
+ }
@@ -0,0 +1,63 @@
1
+ # {{classname}}{{#if description}}
2
+
3
+ {{description}}{{/if}}
4
+
5
+ All URIs are relative to *{{basePath}}*
6
+
7
+ | Method | HTTP request | Description |
8
+ |------------- | ------------- | -------------|
9
+ {{#operations}}{{#operation}}| [**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{commonPath}}{{path}} | {{summary}} |
10
+ {{/operation}}{{/operations}}
11
+
12
+ {{#operations}}
13
+ {{#operation}}
14
+
15
+ ## {{operationId}}
16
+
17
+ > {{#if returnType}}{{returnType}} {{/if}}{{operationId}}({{#allParams}}{{{paramName}}}{{#unless @last}}, {{/unless}}{{/allParams}})
18
+
19
+ {{summary}}{{#if notes}}
20
+
21
+ {{notes}}{{/if}}
22
+
23
+ ### Example
24
+
25
+ ```ts
26
+ {{>api_example}}
27
+ ```
28
+
29
+ ### Parameters
30
+
31
+ {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#if @last}}
32
+ | Name | Type | Description | Notes |
33
+ |------------- | ------------- | ------------- | -------------|{{/if}}{{/allParams}}
34
+ {{#allParams}}| **{{paramName}}** | {{#isEnum}}{{#allowableValues}}{{#values}}`{{{.}}}`{{#unless @last}}, {{/unless}}{{/values}}{{/allowableValues}}{{/isEnum}}{{^isEnum}}{{#isModel}}[{{baseType}}]({{baseType}}.md){{/isModel}}{{^isModel}}`{{{dataType}}}`{{/isModel}}{{/isEnum}} | {{description}} |{{^required}} [Optional]{{/required}}{{^isContainer}}{{#if defaultValue}} [Defaults to `{{defaultValue}}`]{{/if}}{{/isContainer}}{{#allowableValues}} [Enum: {{#values}}{{{.}}}{{#unless @last}}, {{/unless}}{{/values}}]{{/allowableValues}} |
35
+ {{/allParams}}
36
+
37
+ ### Return type
38
+
39
+ {{#if returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{returnType}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/if}}{{#unless returnType}}`void` (Empty response body){{/unless}}
40
+
41
+ ### Authorization
42
+
43
+ {{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}{{#isOAuth}} {{flow}}{{/isOAuth}}](../README.md#{{{name}}}{{#isOAuth}}-{{flow}}{{/isOAuth}}){{#unless @last}}, {{/unless}}{{/authMethods}}
44
+
45
+ ### HTTP request headers
46
+
47
+ - **Content-Type**: {{#consumes}}`{{{mediaType}}}`{{#unless @last}}, {{/unless}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
48
+ - **Accept**: {{#produces}}`{{{mediaType}}}`{{#unless @last}}, {{/unless}}{{/produces}}{{^produces}}Not defined{{/produces}}
49
+
50
+ {{#if responses}}
51
+
52
+ ### HTTP response details
53
+ | Status code | Description | Response headers |
54
+ |-------------|-------------|------------------|
55
+ {{#responses}}
56
+ | **{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}} <br> {{/headers}}{{#unless headers}} - {{/if}} |
57
+ {{/responses}}
58
+ {{/if}}
59
+
60
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
61
+
62
+ {{/operation}}
63
+ {{/operations}}
@@ -0,0 +1,44 @@
1
+ import {
2
+ Configuration,
3
+ {{classname}},
4
+ } from '{{npmName}}';
5
+ import type { {{operationIdCamelCase}}Request } from '{{npmName}}';
6
+
7
+ async function example() {
8
+ console.log("🚀 Testing {{npmName}} SDK...");
9
+ {{#hasAuthMethods}}
10
+ const config = new Configuration({ {{#authMethods}}{{#isBasicBasic}}
11
+ // To configure HTTP basic authorization: {{{name}}}
12
+ username: "YOUR USERNAME",
13
+ password: "YOUR PASSWORD",{{/isBasicBasic}}{{#isBasicBearer}}
14
+ // Configure HTTP bearer authorization: {{{name}}}
15
+ accessToken: "YOUR BEARER TOKEN",{{/isBasicBearer}}{{#isOAuth}}
16
+ // To configure OAuth2 access token for authorization: {{{name}}} {{{flow}}}
17
+ accessToken: "YOUR ACCESS TOKEN",{{/isOAuth}}{{#isApiKey}}
18
+ // To configure API key authorization: {{{name}}}
19
+ apiKey: "YOUR API KEY",{{/isApiKey}}{{#isHttpSignature}}
20
+ // To configure HTTP signature authorization: {{{name}}}
21
+ headers: { "YOUR HEADER NAME": "YOUR SIGNATURE" },{{/isHttpSignature}}{{/authMethods}}
22
+ });
23
+ {{/hasAuthMethods}}
24
+ const api = new {{classname}}({{#hasAuthMethods}}config{{/hasAuthMethods}});
25
+
26
+ {{#hasParams}}
27
+ const body = {
28
+ {{#allParams}}
29
+ // {{{dataType}}}{{#if description}} | {{{description}}}{{/if}}{{^required}} (optional){{/required}}
30
+ {{paramName}}: {{{example}}}{{#unless example}}...{{/unless}},
31
+ {{/allParams}}
32
+ } satisfies {{operationIdCamelCase}}Request;
33
+
34
+ {{/hasParams}}
35
+ try {
36
+ const data = await api.{{{operationId}}}({{#hasParams}}body{{/hasParams}});
37
+ console.log(data);
38
+ } catch (error) {
39
+ console.error(error);
40
+ }
41
+ }
42
+
43
+ // Run the test
44
+ example().catch(console.error);
@@ -0,0 +1,16 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ {{#useSagaAndRecords}}
4
+ export * from './SagaApiManager{{importFileExtension}}'
5
+ export * from './allSagas{{importFileExtension}}'
6
+ {{/useSagaAndRecords}}
7
+ {{#apiInfo}}
8
+ {{#apis}}
9
+ {{#operations}}
10
+ export * from './{{ classFilename }}{{importFileExtension}}';
11
+ {{#useSagaAndRecords}}
12
+ export * from './{{{ classFilename }}}Sagas{{importFileExtension}}';
13
+ {{/useSagaAndRecords}}
14
+ {{/operations}}
15
+ {{/apis}}
16
+ {{/apiInfo}}