@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,483 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ {{>licenseInfo}}
4
+
5
+
6
+ import * as runtime from '../runtime{{importFileExtension}}';
7
+ {{#if imports}}
8
+ import type {
9
+ {{#imports}}
10
+ {{className}},
11
+ {{/imports}}
12
+ } from '../models/index{{importFileExtension}}';
13
+ {{^withoutRuntimeChecks}}
14
+ import {
15
+ {{#imports}}
16
+ {{className}}FromJSON,
17
+ {{className}}ToJSON,
18
+ {{/imports}}
19
+ } from '../models/index{{importFileExtension}}';
20
+ {{/withoutRuntimeChecks}}
21
+ {{/if}}
22
+
23
+ {{#operations}}
24
+ {{#operation}}
25
+ {{#if allParams}}
26
+ export interface {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}Request {
27
+ {{#allParams}}
28
+ {{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{#hasReadOnly}}Omit<{{{dataType}}}, {{#readOnlyVars}}'{{baseName}}'{{#unless @last}}|{{/unless}}{{/readOnlyVars}}>{{/hasReadOnly}}{{^hasReadOnly}}{{{dataType}}}{{/hasReadOnly}}{{#isNullable}} | null{{/isNullable}}{{/isEnum}};
29
+ {{/allParams}}
30
+ }
31
+
32
+ {{/if}}
33
+ {{/operation}}
34
+ {{/operations}}
35
+ {{#withInterfaces}}
36
+ {{#operations}}
37
+ /**
38
+ * {{classname}} - interface
39
+ * {{#indented_1}}{{{unescapedDescription}}}{{/indented_1}}
40
+ * @export
41
+ * @interface {{classname}}Interface
42
+ */
43
+ export interface {{classname}}Interface {
44
+ {{#operation}}
45
+ /**
46
+ * {{&notes}}
47
+ {{#if summary}}
48
+ * @summary {{&summary}}
49
+ {{/if}}
50
+ {{#allParams}}
51
+ * @param {{braceWrap dataType}} {{^required}}[{{/required}}{{paramName}}{{^required}}]{{/required}} {{description}}
52
+ {{/allParams}}
53
+ * @param {*} [options] Override http request option.
54
+ {{#isDeprecated}}
55
+ * @deprecated
56
+ {{/isDeprecated}}
57
+ * @throws {RequiredError}
58
+ * @memberof {{classname}}Interface
59
+ */
60
+ {{nickname}}Raw({{#if allParams}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}Request, {{/if}}initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<{{{returnType}}}{{#unless returnType}}void{{/unless}}>>;
61
+
62
+ /**
63
+ {{#if notes}}
64
+ * {{&notes}}
65
+ {{/if}}
66
+ {{#if summary}}
67
+ * {{&summary}}
68
+ {{/if}}
69
+ {{#isDeprecated}}
70
+ * @deprecated
71
+ {{/isDeprecated}}
72
+ */
73
+ {{^useSingleRequestParameter}}
74
+ {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{#isNullable}} | null{{/isNullable}}{{/isEnum}}, {{/allParams}}initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{{{returnType}}}{{#if returnType}}{{#isResponseOptional}} | null | undefined {{/isResponseOptional}}{{/if}}{{#unless returnType}}void{{/unless}}>;
75
+ {{/useSingleRequestParameter}}
76
+ {{#useSingleRequestParameter}}
77
+ {{nickname}}({{#if allParams}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}Request, {{/if}}initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{{{returnType}}}{{#if returnType}}{{#isResponseOptional}} | null | undefined {{/isResponseOptional}}{{/if}}{{#unless returnType}}void{{/unless}}>;
78
+ {{/useSingleRequestParameter}}
79
+
80
+ {{/operation}}
81
+ }
82
+
83
+ {{/operations}}
84
+ {{/withInterfaces}}
85
+ {{#operations}}
86
+ /**
87
+ * {{#indented_star_1}}{{{unescapedDescription}}}{{/indented_star_1}}
88
+ */
89
+ {{#withInterfaces}}
90
+ export class {{classname}} extends runtime.BaseAPI implements {{classname}}Interface {
91
+ {{/withInterfaces}}
92
+ {{^withInterfaces}}
93
+ export class {{classname}} extends runtime.BaseAPI {
94
+ {{/withInterfaces}}
95
+
96
+ {{#operation}}
97
+ /**
98
+ {{#if notes}}
99
+ * {{&notes}}
100
+ {{/if}}
101
+ {{#if summary}}
102
+ * {{&summary}}
103
+ {{/if}}
104
+ {{#isDeprecated}}
105
+ * @deprecated
106
+ {{/isDeprecated}}
107
+ */
108
+ async {{nickname}}Raw({{#if allParams}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}Request, {{/if}}initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<{{{returnType}}}{{#unless returnType}}void{{/unless}}>> {
109
+ {{#allParams}}
110
+ {{#required}}
111
+ if (requestParameters['{{paramName}}'] == null) {
112
+ throw new runtime.RequiredError(
113
+ '{{paramName}}',
114
+ 'Required parameter "{{paramName}}" was null or undefined when calling {{nickname}}().'
115
+ );
116
+ }
117
+
118
+ {{/required}}
119
+ {{/allParams}}
120
+ const queryParameters: any = {};
121
+
122
+ {{#queryParams}}
123
+ {{#isArray}}
124
+ if (requestParameters['{{paramName}}'] != null) {
125
+ {{#isCollectionFormatMulti}}
126
+ queryParameters['{{baseName}}'] = requestParameters['{{paramName}}'];
127
+ {{/isCollectionFormatMulti}}
128
+ {{^isCollectionFormatMulti}}
129
+ queryParameters['{{baseName}}'] = {{#uniqueItems}}Array.from({{/uniqueItems}}requestParameters['{{paramName}}']{{#uniqueItems}}){{/uniqueItems}}!.join(runtime.COLLECTION_FORMATS["{{collectionFormat}}"]);
130
+ {{/isCollectionFormatMulti}}
131
+ }
132
+
133
+ {{/isArray}}
134
+ {{^isArray}}
135
+ if (requestParameters['{{paramName}}'] != null) {
136
+ {{#isExplode}}
137
+ {{#isContainer}}
138
+ for (let key of Object.keys(requestParameters['{{paramName}}'])) {
139
+ queryParameters[key] = requestParameters['{{paramName}}'][key];
140
+ }
141
+ {{/isContainer}}
142
+ {{^isContainer}}
143
+ {{>apisAssignQueryParam}}
144
+ {{/isContainer}}
145
+ {{/isExplode}}
146
+ {{^isExplode}}
147
+ {{>apisAssignQueryParam}}
148
+ {{/isExplode}}
149
+ }
150
+
151
+ {{/isArray}}
152
+ {{/queryParams}}
153
+ const headerParameters: runtime.HTTPHeaders = {};
154
+
155
+ {{#bodyParam}}
156
+ {{^consumes}}
157
+ headerParameters['Content-Type'] = 'application/json';
158
+
159
+ {{/consumes}}
160
+ {{#if consumes}}
161
+ headerParameters['Content-Type'] = '{{{mediaType}}}';
162
+
163
+ {{/if}}
164
+ {{/bodyParam}}
165
+ {{#headerParams}}
166
+ {{#isArray}}
167
+ if (requestParameters['{{paramName}}'] != null) {
168
+ headerParameters['{{baseName}}'] = {{#uniqueItems}}Array.from({{/uniqueItems}}requestParameters['{{paramName}}']{{#uniqueItems}}){{/uniqueItems}}!.join(runtime.COLLECTION_FORMATS["{{collectionFormat}}"]);
169
+ }
170
+
171
+ {{/isArray}}
172
+ {{^isArray}}
173
+ if (requestParameters['{{paramName}}'] != null) {
174
+ headerParameters['{{baseName}}'] = String(requestParameters['{{paramName}}']);
175
+ }
176
+
177
+ {{/isArray}}
178
+ {{/headerParams}}
179
+ {{#authMethods}}
180
+ {{#isBasic}}
181
+ {{#isBasicBasic}}
182
+ if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
183
+ headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
184
+ }
185
+ {{/isBasicBasic}}
186
+ {{#isBasicBearer}}
187
+ if (this.configuration && this.configuration.accessToken) {
188
+ const token = this.configuration.accessToken;
189
+ const tokenString = await token("{{name}}", [{{#scopes}}"{{{scope}}}"{{#unless @last}}, {{/unless}}{{/scopes}}]);
190
+
191
+ if (tokenString) {
192
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
193
+ }
194
+ }
195
+ {{/isBasicBearer}}
196
+ {{/isBasic}}
197
+ {{#isApiKey}}
198
+ {{#isKeyInHeader}}
199
+ if (this.configuration && this.configuration.apiKey) {
200
+ headerParameters["{{keyParamName}}"] = await this.configuration.apiKey("{{keyParamName}}"); // {{name}} authentication
201
+ }
202
+
203
+ {{/isKeyInHeader}}
204
+ {{#isKeyInQuery}}
205
+ if (this.configuration && this.configuration.apiKey) {
206
+ queryParameters["{{keyParamName}}"] = await this.configuration.apiKey("{{keyParamName}}"); // {{name}} authentication
207
+ }
208
+
209
+ {{/isKeyInQuery}}
210
+ {{/isApiKey}}
211
+ {{#isOAuth}}
212
+ if (this.configuration && this.configuration.accessToken) {
213
+ // oauth required
214
+ headerParameters["Authorization"] = await this.configuration.accessToken("{{name}}", [{{#scopes}}"{{{scope}}}"{{#unless @last}}, {{/unless}}{{/scopes}}]);
215
+ }
216
+
217
+ {{/isOAuth}}
218
+ {{/authMethods}}
219
+ {{#hasFormParams}}
220
+ const consumes: runtime.Consume[] = [
221
+ {{#consumes}}
222
+ { contentType: '{{{mediaType}}}' },
223
+ {{/consumes}}
224
+ ];
225
+ // @ts-ignore: canConsumeForm may be unused
226
+ const canConsumeForm = runtime.canConsumeForm(consumes);
227
+
228
+ let formParams: { append(param: string, value: any): any };
229
+ let useForm = false;
230
+ {{#formParams}}
231
+ {{#isFile}}
232
+ // use FormData to transmit files using content-type "multipart/form-data"
233
+ useForm = canConsumeForm;
234
+ {{/isFile}}
235
+ {{/formParams}}
236
+ if (useForm) {
237
+ formParams = new FormData();
238
+ } else {
239
+ formParams = new URLSearchParams();
240
+ }
241
+
242
+ {{#formParams}}
243
+ {{#isArray}}
244
+ if (requestParameters['{{paramName}}'] != null) {
245
+ {{#isCollectionFormatMulti}}
246
+ requestParameters['{{paramName}}'].forEach((element) => {
247
+ formParams.append('{{baseName}}{{#useSquareBracketsInArrayNames}}[]{{/useSquareBracketsInArrayNames}}', element as any);
248
+ })
249
+ {{/isCollectionFormatMulti}}
250
+ {{^isCollectionFormatMulti}}
251
+ formParams.append('{{baseName}}{{#useSquareBracketsInArrayNames}}[]{{/useSquareBracketsInArrayNames}}', {{#uniqueItems}}Array.from({{/uniqueItems}}requestParameters['{{paramName}}']{{#uniqueItems}}){{/uniqueItems}}!.join(runtime.COLLECTION_FORMATS["{{collectionFormat}}"]));
252
+ {{/isCollectionFormatMulti}}
253
+ }
254
+
255
+ {{/isArray}}
256
+ {{^isArray}}
257
+ if (requestParameters['{{paramName}}'] != null) {
258
+ {{#isDateTimeType}}
259
+ formParams.append('{{baseName}}', (requestParameters['{{paramName}}'] as any).toISOString());
260
+ {{/isDateTimeType}}
261
+ {{^isDateTimeType}}
262
+ {{#isPrimitiveType}}
263
+ formParams.append('{{baseName}}', requestParameters['{{paramName}}'] as any);
264
+ {{/isPrimitiveType}}
265
+ {{^isPrimitiveType}}
266
+ {{#isEnumRef}}
267
+ formParams.append('{{baseName}}', requestParameters['{{paramName}}'] as any);
268
+ {{/isEnumRef}}
269
+ {{^isEnumRef}}
270
+ {{^withoutRuntimeChecks}}
271
+ formParams.append('{{baseName}}', new Blob([JSON.stringify({{{dataType}}}ToJSON(requestParameters['{{paramName}}']))], { type: "application/json", }));
272
+ {{/withoutRuntimeChecks}}{{#withoutRuntimeChecks}}
273
+ formParams.append('{{baseName}}', new Blob([JSON.stringify(requestParameters['{{paramName}}'])], { type: "application/json", }));
274
+ {{/withoutRuntimeChecks}}
275
+ {{/isEnumRef}}
276
+ {{/isPrimitiveType}}
277
+ {{/isDateTimeType}}
278
+ }
279
+
280
+ {{/isArray}}
281
+ {{/formParams}}
282
+ {{/hasFormParams}}
283
+
284
+ let urlPath = `{{{path}}}`;
285
+ {{#pathParams}}
286
+ {{#isDateTimeType}}
287
+ if (requestParameters['{{paramName}}'] instanceof Date) {
288
+ urlPath = urlPath.replace(`{${"{{baseName}}"}}`, encodeURIComponent(requestParameters['{{paramName}}'].toISOString()));
289
+ } else {
290
+ urlPath = urlPath.replace(`{${"{{baseName}}"}}`, encodeURIComponent(String(requestParameters['{{paramName}}'])));
291
+ }
292
+ {{/isDateTimeType}}
293
+ {{^isDateTimeType}}
294
+ {{#isDateType}}
295
+ if (requestParameters['{{paramName}}'] instanceof Date) {
296
+ urlPath = urlPath.replace(`{${"{{baseName}}"}}`, encodeURIComponent(requestParameters['{{paramName}}'].toISOString().substring(0,10)));
297
+ } else {
298
+ urlPath = urlPath.replace(`{${"{{baseName}}"}}`, encodeURIComponent(String(requestParameters['{{paramName}}'])));
299
+ }
300
+ {{/isDateType}}
301
+ {{^isDateType}}
302
+ urlPath = urlPath.replace(`{${"{{baseName}}"}}`, encodeURIComponent(String(requestParameters['{{paramName}}'])));
303
+ {{/isDateType}}
304
+ {{/isDateTimeType}}
305
+ {{/pathParams}}
306
+
307
+ const response = await this.request({
308
+ path: urlPath,
309
+ method: '{{httpMethod}}',
310
+ headers: headerParameters,
311
+ query: queryParameters,
312
+ {{#hasBodyParam}}
313
+ {{#bodyParam}}
314
+ {{#isContainer}}
315
+ {{^withoutRuntimeChecks}}
316
+ body: requestParameters['{{paramName}}']{{#isArray}}{{#items}}{{^isPrimitiveType}}!.map({{datatype}}ToJSON){{/isPrimitiveType}}{{/items}}{{/isArray}},
317
+ {{/withoutRuntimeChecks}}
318
+ {{#withoutRuntimeChecks}}
319
+ body: requestParameters['{{paramName}}'],
320
+ {{/withoutRuntimeChecks}}
321
+ {{/isContainer}}
322
+ {{^isContainer}}
323
+ {{^isPrimitiveType}}
324
+ {{^withoutRuntimeChecks}}
325
+ body: {{dataType}}ToJSON(requestParameters['{{paramName}}']),
326
+ {{/withoutRuntimeChecks}}
327
+ {{#withoutRuntimeChecks}}
328
+ body: requestParameters['{{paramName}}'],
329
+ {{/withoutRuntimeChecks}}
330
+ {{/isPrimitiveType}}
331
+ {{#isPrimitiveType}}
332
+ body: requestParameters['{{paramName}}'] as any,
333
+ {{/isPrimitiveType}}
334
+ {{/isContainer}}
335
+ {{/bodyParam}}
336
+ {{/hasBodyParam}}
337
+ {{#hasFormParams}}
338
+ body: formParams,
339
+ {{/hasFormParams}}
340
+ }, initOverrides);
341
+
342
+ {{#if returnType}}
343
+ {{#isResponseFile}}
344
+ return new runtime.BlobApiResponse(response);
345
+ {{/isResponseFile}}
346
+ {{^isResponseFile}}
347
+ {{#returnTypeIsPrimitive}}
348
+ {{#isMap}}
349
+ return new runtime.JSONApiResponse<any>(response);
350
+ {{/isMap}}
351
+ {{#isArray}}
352
+ return new runtime.JSONApiResponse<any>(response);
353
+ {{/isArray}}
354
+ {{#returnSimpleType}}
355
+ if (this.isJsonMime(response.headers.get('content-type'))) {
356
+ return new runtime.JSONApiResponse<{{returnType}}>(response);
357
+ } else {
358
+ return new runtime.TextApiResponse(response) as any;
359
+ }
360
+ {{/returnSimpleType}}
361
+ {{/returnTypeIsPrimitive}}
362
+ {{^returnTypeIsPrimitive}}
363
+ {{#isArray}}
364
+ return new runtime.JSONApiResponse(response{{^withoutRuntimeChecks}}, (jsonValue) => {{#uniqueItems}}new Set({{/uniqueItems}}jsonValue.map({{returnBaseType}}FromJSON){{/withoutRuntimeChecks}}){{#uniqueItems}}){{/uniqueItems}};
365
+ {{/isArray}}
366
+ {{^isArray}}
367
+ {{#isMap}}
368
+ return new runtime.JSONApiResponse(response{{^withoutRuntimeChecks}}, (jsonValue) => runtime.mapValues(jsonValue, {{returnBaseType}}FromJSON){{/withoutRuntimeChecks}});
369
+ {{/isMap}}
370
+ {{^isMap}}
371
+ return new runtime.JSONApiResponse(response{{^withoutRuntimeChecks}}, (jsonValue) => {{returnBaseType}}FromJSON(jsonValue){{/withoutRuntimeChecks}});
372
+ {{/isMap}}
373
+ {{/isArray}}
374
+ {{/returnTypeIsPrimitive}}
375
+ {{/isResponseFile}}
376
+ {{/if}}
377
+ {{#unless returnType}}
378
+ return new runtime.VoidApiResponse(response);
379
+ {{/unless}}
380
+ }
381
+
382
+ /**
383
+ {{#if notes}}
384
+ * {{&notes}}
385
+ {{/if}}
386
+ {{#if summary}}
387
+ * {{&summary}}
388
+ {{/if}}
389
+ {{#isDeprecated}}
390
+ * @deprecated
391
+ {{/isDeprecated}}
392
+ */
393
+ {{^useSingleRequestParameter}}
394
+ async {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{#isNullable}} | null{{/isNullable}}{{/isEnum}}, {{/allParams}}initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{{{returnType}}}{{#if returnType}}{{#isResponseOptional}} | null | undefined {{/isResponseOptional}}{{/if}}{{#unless returnType}}void{{/unless}}> {
395
+ {{#if returnType}}
396
+ const response = await this.{{nickname}}Raw({{#if allParams}}{ {{#allParams}}{{paramName}}: {{paramName}}{{#unless @last}}, {{/unless}}{{/allParams}} }, {{/if}}initOverrides);
397
+ {{#isResponseOptional}}
398
+ switch (response.raw.status) {
399
+ {{#responses}}
400
+ {{#is2xx}}
401
+ case {{code}}:
402
+ return {{#dataType}}await response.value(){{/dataType}}{{^dataType}}null{{/dataType}};
403
+ {{/is2xx}}
404
+ {{/responses}}
405
+ default:
406
+ return await response.value();
407
+ }
408
+ {{/isResponseOptional}}
409
+ {{^isResponseOptional}}
410
+ return await response.value();
411
+ {{/isResponseOptional}}
412
+ {{/if}}
413
+ {{#unless returnType}}
414
+ await this.{{nickname}}Raw({{#if allParams}}{ {{#allParams}}{{paramName}}: {{paramName}}{{#unless @last}}, {{/unless}}{{/allParams}} }, {{/if}}initOverrides);
415
+ {{/unless}}
416
+ }
417
+ {{/useSingleRequestParameter}}
418
+ {{#useSingleRequestParameter}}
419
+ async {{nickname}}({{#if allParams}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}Request{{^hasRequiredParams}} = {}{{/hasRequiredParams}}, {{/if}}initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{{{returnType}}}{{#if returnType}}{{#isResponseOptional}} | null | undefined {{/isResponseOptional}}{{/if}}{{#unless returnType}}void{{/unless}}> {
420
+ {{#if returnType}}
421
+ const response = await this.{{nickname}}Raw({{#if allParams}}requestParameters, {{/if}}initOverrides);
422
+ {{#isResponseOptional}}
423
+ switch (response.raw.status) {
424
+ {{#responses}}
425
+ {{#is2xx}}
426
+ case {{code}}:
427
+ return {{#dataType}}await response.value(){{/dataType}}{{^dataType}}null{{/dataType}};
428
+ {{/is2xx}}
429
+ {{/responses}}
430
+ default:
431
+ return await response.value();
432
+ }
433
+ {{/isResponseOptional}}
434
+ {{^isResponseOptional}}
435
+ return await response.value();
436
+ {{/isResponseOptional}}
437
+ {{/if}}
438
+ {{#unless returnType}}
439
+ await this.{{nickname}}Raw({{#if allParams}}requestParameters, {{/if}}initOverrides);
440
+ {{/unless}}
441
+ }
442
+ {{/useSingleRequestParameter}}
443
+
444
+ {{/operation}}
445
+ }
446
+ {{/operations}}
447
+ {{#hasEnums}}
448
+
449
+ {{#operations}}
450
+ {{#operation}}
451
+ {{#allParams}}
452
+ {{#isEnum}}
453
+ {{#stringEnums}}
454
+ /**
455
+ * @export
456
+ * @enum {string}
457
+ */
458
+ export enum {{operationIdCamelCase}}{{enumName}} {
459
+ {{#allowableValues}}
460
+ {{#enumVars}}
461
+ {{{name}}} = {{{value}}}{{#unless @last}},{{/unless}}
462
+ {{/enumVars}}
463
+ {{/allowableValues}}
464
+ }
465
+ {{/stringEnums}}
466
+ {{^stringEnums}}
467
+ /**
468
+ * @export
469
+ */
470
+ export const {{operationIdCamelCase}}{{enumName}} = {
471
+ {{#allowableValues}}
472
+ {{#enumVars}}
473
+ {{{name}}}: {{{value}}}{{#unless @last}},{{/unless}}
474
+ {{/enumVars}}
475
+ {{/allowableValues}}
476
+ } as const;
477
+ export type {{operationIdCamelCase}}{{enumName}} = typeof {{operationIdCamelCase}}{{enumName}}[keyof typeof {{operationIdCamelCase}}{{enumName}}];
478
+ {{/stringEnums}}
479
+ {{/isEnum}}
480
+ {{/allParams}}
481
+ {{/operation}}
482
+ {{/operations}}
483
+ {{/hasEnums}}
@@ -0,0 +1,12 @@
1
+ {{! Assign query parameters based on their type }}
2
+ {{#isDateTimeType}}
3
+ queryParameters['{{baseName}}'] = (requestParameters['{{paramName}}'] as any).toISOString();
4
+ {{/isDateTimeType}}
5
+ {{^isDateTimeType}}
6
+ {{#isDateType}}
7
+ queryParameters['{{baseName}}'] = (requestParameters['{{paramName}}'] as any).toISOString().substring(0,10);
8
+ {{/isDateType}}
9
+ {{^isDateType}}
10
+ queryParameters['{{baseName}}'] = requestParameters['{{paramName}}'];
11
+ {{/isDateType}}
12
+ {{/isDateTimeType}}
@@ -0,0 +1,4 @@
1
+ wwwroot/*.js
2
+ node_modules
3
+ typings
4
+ dist
@@ -0,0 +1,17 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export * from './runtime{{importFileExtension}}';
4
+ {{#useSagaAndRecords}}
5
+ export * from './runtimeSagasAndRecords{{importFileExtension}}';
6
+ export * from './ApiEntitiesRecord{{importFileExtension}}';
7
+ export * from './ApiEntitiesReducer{{importFileExtension}}';
8
+ export * from './ApiEntitiesSelectors{{importFileExtension}}';
9
+ {{/useSagaAndRecords}}
10
+ {{#apiInfo}}
11
+ {{#if apis}}
12
+ export * from './apis/index{{importFileExtension}}';
13
+ {{/if}}
14
+ {{/apiInfo}}
15
+ {{#if models}}
16
+ export * from './models/index{{importFileExtension}}';
17
+ {{/if}}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * {{{appName}}}
3
+ * {{{appDescription}}}
4
+ *
5
+ * {{#if version}}The version of the OpenAPI document: {{{version}}}{{/if}}
6
+ * {{#if infoEmail}}Contact: {{{infoEmail}}}{{/if}}
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
@@ -0,0 +1,28 @@
1
+ {{>modelEnumInterfaces}}
2
+
3
+ export function instanceOf{{classname}}(value: any): boolean {
4
+ for (const key in {{classname}}) {
5
+ if (Object.prototype.hasOwnProperty.call({{classname}}, key)) {
6
+ if ({{classname}}[key as keyof typeof {{classname}}] === value) {
7
+ return true;
8
+ }
9
+ }
10
+ }
11
+ return false;
12
+ }
13
+
14
+ export function {{classname}}FromJSON(json: any): {{classname}} {
15
+ return {{classname}}FromJSONTyped(json, false);
16
+ }
17
+
18
+ export function {{classname}}FromJSONTyped(json: any, ignoreDiscriminator: boolean): {{classname}} {
19
+ return json as {{classname}};
20
+ }
21
+
22
+ export function {{classname}}ToJSON(value?: {{classname}} | null): any {
23
+ return value as any;
24
+ }
25
+
26
+ export function {{classname}}ToJSONTyped(value: any, ignoreDiscriminator: boolean): {{classname}} {
27
+ return value as {{classname}};
28
+ }
@@ -0,0 +1,37 @@
1
+ {{#stringEnums}}
2
+ /**
3
+ * {{#indented_star_1}}{{{unescapedDescription}}}{{/indented_star_1}}
4
+ * @export
5
+ * @enum {string}
6
+ */
7
+ export enum {{classname}} {
8
+ {{#allowableValues}}
9
+ {{#enumVars}}
10
+ {{#enumDescription}}
11
+ /**
12
+ * {{enumDescription}}
13
+ */
14
+ {{/enumDescription}}
15
+ {{{name}}} = {{{value}}}{{#unless @last}},{{/unless}}
16
+ {{/enumVars}}
17
+ {{/allowableValues}}
18
+ }
19
+ {{/stringEnums}}{{^stringEnums}}
20
+ /**
21
+ * {{#indented_star_1}}{{{unescapedDescription}}}{{/indented_star_1}}
22
+ * @export
23
+ */
24
+ export const {{classname}} = {
25
+ {{#allowableValues}}
26
+ {{#enumVars}}
27
+ {{#enumDescription}}
28
+ /**
29
+ * {{enumDescription}}
30
+ */
31
+ {{/enumDescription}}
32
+ {{{name}}}: {{{value}}}{{#unless @last}},{{/unless}}
33
+ {{/enumVars}}
34
+ {{/allowableValues}}
35
+ } as const;
36
+ export type {{classname}} = typeof {{classname}}[keyof typeof {{classname}}];
37
+ {{/stringEnums}}