@emilgroup/insurance-sdk-node 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 (277) hide show
  1. package/.openapi-generator/FILES +97 -0
  2. package/.openapi-generator/VERSION +1 -0
  3. package/.openapi-generator-ignore +23 -0
  4. package/README.md +51 -0
  5. package/api/insured-object-types-api.ts +236 -0
  6. package/api/insured-objects-api.ts +446 -0
  7. package/api/leads-api.ts +402 -0
  8. package/api/policies-api.ts +580 -0
  9. package/api/products-api.ts +3027 -0
  10. package/api.ts +44 -0
  11. package/base.ts +189 -0
  12. package/common.ts +138 -0
  13. package/configuration.ts +109 -0
  14. package/dist/api/insured-object-types-api.d.ts +141 -0
  15. package/dist/api/insured-object-types-api.js +258 -0
  16. package/dist/api/insured-objects-api.d.ts +254 -0
  17. package/dist/api/insured-objects-api.js +443 -0
  18. package/dist/api/leads-api.d.ts +225 -0
  19. package/dist/api/leads-api.js +427 -0
  20. package/dist/api/policies-api.d.ts +329 -0
  21. package/dist/api/policies-api.js +548 -0
  22. package/dist/api/products-api.d.ts +1683 -0
  23. package/dist/api/products-api.js +2521 -0
  24. package/dist/api.d.ts +20 -0
  25. package/dist/api.js +40 -0
  26. package/dist/base.d.ts +69 -0
  27. package/dist/base.js +252 -0
  28. package/dist/common.d.ts +66 -0
  29. package/dist/common.js +244 -0
  30. package/dist/configuration.d.ts +90 -0
  31. package/dist/configuration.js +44 -0
  32. package/dist/index.d.ts +15 -0
  33. package/dist/index.js +35 -0
  34. package/dist/models/calculate-custom-premium-request-dto.d.ts +34 -0
  35. package/dist/models/calculate-custom-premium-request-dto.js +19 -0
  36. package/dist/models/calculate-premium-request-dto.d.ts +31 -0
  37. package/dist/models/calculate-premium-request-dto.js +15 -0
  38. package/dist/models/create-account-request-dto.d.ts +84 -0
  39. package/dist/models/create-account-request-dto.js +15 -0
  40. package/dist/models/create-bank-account-request-dto.d.ts +30 -0
  41. package/dist/models/create-bank-account-request-dto.js +15 -0
  42. package/dist/models/create-claim-request-dto.d.ts +83 -0
  43. package/dist/models/create-claim-request-dto.js +25 -0
  44. package/dist/models/create-custom-application-request-dto.d.ts +40 -0
  45. package/dist/models/create-custom-application-request-dto.js +19 -0
  46. package/dist/models/create-dummy-policy-request-dto.d.ts +31 -0
  47. package/dist/models/create-dummy-policy-request-dto.js +15 -0
  48. package/dist/models/create-insured-object-request-dto.d.ts +42 -0
  49. package/dist/models/create-insured-object-request-dto.js +15 -0
  50. package/dist/models/create-insured-object-response-class.d.ts +25 -0
  51. package/dist/models/create-insured-object-response-class.js +15 -0
  52. package/dist/models/create-lead-request-dto.d.ts +71 -0
  53. package/dist/models/create-lead-request-dto.js +22 -0
  54. package/dist/models/create-policy-request-dto.d.ts +37 -0
  55. package/dist/models/create-policy-request-dto.js +15 -0
  56. package/dist/models/create-policy-response-class.d.ts +25 -0
  57. package/dist/models/create-policy-response-class.js +15 -0
  58. package/dist/models/create-premium-formula-request-dto.d.ts +65 -0
  59. package/dist/models/create-premium-formula-request-dto.js +25 -0
  60. package/dist/models/create-premium-formula-response-class.d.ts +25 -0
  61. package/dist/models/create-premium-formula-response-class.js +15 -0
  62. package/dist/models/create-product-field-request-dto.d.ts +113 -0
  63. package/dist/models/create-product-field-request-dto.js +20 -0
  64. package/dist/models/create-product-field-response-class.d.ts +25 -0
  65. package/dist/models/create-product-field-response-class.js +15 -0
  66. package/dist/models/create-product-request-dto.d.ts +57 -0
  67. package/dist/models/create-product-request-dto.js +30 -0
  68. package/dist/models/create-product-response-class.d.ts +25 -0
  69. package/dist/models/create-product-response-class.js +15 -0
  70. package/dist/models/csv-product-factor-dto.d.ts +48 -0
  71. package/dist/models/csv-product-factor-dto.js +15 -0
  72. package/dist/models/delete-request-dto.d.ts +24 -0
  73. package/dist/models/delete-request-dto.js +15 -0
  74. package/dist/models/get-insured-object-request-dto.d.ts +24 -0
  75. package/dist/models/get-insured-object-request-dto.js +15 -0
  76. package/dist/models/get-insured-object-response-class.d.ts +25 -0
  77. package/dist/models/get-insured-object-response-class.js +15 -0
  78. package/dist/models/get-policy-request-dto.d.ts +30 -0
  79. package/dist/models/get-policy-request-dto.js +15 -0
  80. package/dist/models/get-policy-response-class.d.ts +25 -0
  81. package/dist/models/get-policy-response-class.js +15 -0
  82. package/dist/models/get-premium-formula-request-dto.d.ts +24 -0
  83. package/dist/models/get-premium-formula-request-dto.js +15 -0
  84. package/dist/models/get-premium-formula-response-class.d.ts +25 -0
  85. package/dist/models/get-premium-formula-response-class.js +15 -0
  86. package/dist/models/get-product-factor-response-class.d.ts +32 -0
  87. package/dist/models/get-product-factor-response-class.js +15 -0
  88. package/dist/models/get-product-factor-value-request-dto.d.ts +42 -0
  89. package/dist/models/get-product-factor-value-request-dto.js +15 -0
  90. package/dist/models/get-product-factor-value-response-class.d.ts +25 -0
  91. package/dist/models/get-product-factor-value-response-class.js +15 -0
  92. package/dist/models/get-product-field-request-dto.d.ts +24 -0
  93. package/dist/models/get-product-field-request-dto.js +15 -0
  94. package/dist/models/get-product-field-response-class.d.ts +25 -0
  95. package/dist/models/get-product-field-response-class.js +15 -0
  96. package/dist/models/get-product-request-dto.d.ts +36 -0
  97. package/dist/models/get-product-request-dto.js +15 -0
  98. package/dist/models/get-product-response-class.d.ts +25 -0
  99. package/dist/models/get-product-response-class.js +15 -0
  100. package/dist/models/get-product-version-request-dto.d.ts +24 -0
  101. package/dist/models/get-product-version-request-dto.js +15 -0
  102. package/dist/models/get-product-version-response-class.d.ts +25 -0
  103. package/dist/models/get-product-version-response-class.js +15 -0
  104. package/dist/models/grouped-product-factor-class.d.ts +37 -0
  105. package/dist/models/grouped-product-factor-class.js +15 -0
  106. package/dist/models/grouped-product-factor-value-class.d.ts +36 -0
  107. package/dist/models/grouped-product-factor-value-class.js +15 -0
  108. package/dist/models/grouped-product-factors-response-class.d.ts +25 -0
  109. package/dist/models/grouped-product-factors-response-class.js +15 -0
  110. package/dist/models/grpc-create-policy-request-dto.d.ts +37 -0
  111. package/dist/models/grpc-create-policy-request-dto.js +15 -0
  112. package/dist/models/index.d.ts +79 -0
  113. package/dist/models/index.js +95 -0
  114. package/dist/models/insured-object-class.d.ts +67 -0
  115. package/dist/models/insured-object-class.js +15 -0
  116. package/dist/models/insured-object-type-class.d.ts +48 -0
  117. package/dist/models/insured-object-type-class.js +15 -0
  118. package/dist/models/list-insured-object-types-response-class.d.ts +31 -0
  119. package/dist/models/list-insured-object-types-response-class.js +15 -0
  120. package/dist/models/list-insured-objects-response-class.d.ts +30 -0
  121. package/dist/models/list-insured-objects-response-class.js +15 -0
  122. package/dist/models/list-policies-response-class.d.ts +31 -0
  123. package/dist/models/list-policies-response-class.js +15 -0
  124. package/dist/models/list-premium-formulas-response-class.d.ts +31 -0
  125. package/dist/models/list-premium-formulas-response-class.js +15 -0
  126. package/dist/models/list-product-factors-response-class.d.ts +31 -0
  127. package/dist/models/list-product-factors-response-class.js +15 -0
  128. package/dist/models/list-product-field-types-response-class.d.ts +30 -0
  129. package/dist/models/list-product-field-types-response-class.js +15 -0
  130. package/dist/models/list-product-fields-response-class.d.ts +31 -0
  131. package/dist/models/list-product-fields-response-class.js +15 -0
  132. package/dist/models/list-products-response-class.d.ts +31 -0
  133. package/dist/models/list-products-response-class.js +15 -0
  134. package/dist/models/list-request-dto.d.ts +54 -0
  135. package/dist/models/list-request-dto.js +15 -0
  136. package/dist/models/policy-class.d.ts +86 -0
  137. package/dist/models/policy-class.js +15 -0
  138. package/dist/models/policy-object-class.d.ts +42 -0
  139. package/dist/models/policy-object-class.js +15 -0
  140. package/dist/models/policy-object-dto.d.ts +30 -0
  141. package/dist/models/policy-object-dto.js +15 -0
  142. package/dist/models/policy-premium-class.d.ts +43 -0
  143. package/dist/models/policy-premium-class.js +15 -0
  144. package/dist/models/policy-premium-item-class.d.ts +49 -0
  145. package/dist/models/policy-premium-item-class.js +15 -0
  146. package/dist/models/policy-version-class.d.ts +55 -0
  147. package/dist/models/policy-version-class.js +15 -0
  148. package/dist/models/premium-formula-class.d.ts +79 -0
  149. package/dist/models/premium-formula-class.js +15 -0
  150. package/dist/models/product-class.d.ts +74 -0
  151. package/dist/models/product-class.js +15 -0
  152. package/dist/models/product-factor-class.d.ts +68 -0
  153. package/dist/models/product-factor-class.js +15 -0
  154. package/dist/models/product-factor-value-class.d.ts +80 -0
  155. package/dist/models/product-factor-value-class.js +15 -0
  156. package/dist/models/product-field-class.d.ts +114 -0
  157. package/dist/models/product-field-class.js +15 -0
  158. package/dist/models/product-version-class.d.ts +54 -0
  159. package/dist/models/product-version-class.js +15 -0
  160. package/dist/models/store-product-factors-request-dto.d.ts +31 -0
  161. package/dist/models/store-product-factors-request-dto.js +15 -0
  162. package/dist/models/store-product-factors-response-class.d.ts +25 -0
  163. package/dist/models/store-product-factors-response-class.js +15 -0
  164. package/dist/models/timeslice-class.d.ts +62 -0
  165. package/dist/models/timeslice-class.js +15 -0
  166. package/dist/models/update-insured-object-request-dto.d.ts +48 -0
  167. package/dist/models/update-insured-object-request-dto.js +15 -0
  168. package/dist/models/update-lead-request-dto.d.ts +71 -0
  169. package/dist/models/update-lead-request-dto.js +22 -0
  170. package/dist/models/update-policy-request-dto.d.ts +43 -0
  171. package/dist/models/update-policy-request-dto.js +15 -0
  172. package/dist/models/update-policy-response-class.d.ts +25 -0
  173. package/dist/models/update-policy-response-class.js +15 -0
  174. package/dist/models/update-premium-formula-request-dto.d.ts +71 -0
  175. package/dist/models/update-premium-formula-request-dto.js +25 -0
  176. package/dist/models/update-premium-formula-response-class.d.ts +25 -0
  177. package/dist/models/update-premium-formula-response-class.js +15 -0
  178. package/dist/models/update-product-field-request-dto.d.ts +119 -0
  179. package/dist/models/update-product-field-request-dto.js +20 -0
  180. package/dist/models/update-product-field-response-class.d.ts +25 -0
  181. package/dist/models/update-product-field-response-class.js +15 -0
  182. package/dist/models/update-product-request-dto.d.ts +42 -0
  183. package/dist/models/update-product-request-dto.js +15 -0
  184. package/dist/models/update-product-response-class.d.ts +25 -0
  185. package/dist/models/update-product-response-class.js +15 -0
  186. package/dist/models/update-product-version-request-dto.d.ts +43 -0
  187. package/dist/models/update-product-version-request-dto.js +22 -0
  188. package/dist/models/update-product-version-response-class.d.ts +25 -0
  189. package/dist/models/update-product-version-response-class.js +15 -0
  190. package/dist/models/uploaded-document-dto.d.ts +24 -0
  191. package/dist/models/uploaded-document-dto.js +15 -0
  192. package/dist/models/validate-product-factors-request-dto.d.ts +31 -0
  193. package/dist/models/validate-product-factors-request-dto.js +15 -0
  194. package/git_push.sh +57 -0
  195. package/index.ts +19 -0
  196. package/models/calculate-custom-premium-request-dto.ts +43 -0
  197. package/models/calculate-premium-request-dto.ts +37 -0
  198. package/models/create-account-request-dto.ts +90 -0
  199. package/models/create-bank-account-request-dto.ts +36 -0
  200. package/models/create-claim-request-dto.ts +93 -0
  201. package/models/create-custom-application-request-dto.ts +49 -0
  202. package/models/create-dummy-policy-request-dto.ts +37 -0
  203. package/models/create-insured-object-request-dto.ts +48 -0
  204. package/models/create-insured-object-response-class.ts +31 -0
  205. package/models/create-lead-request-dto.ts +80 -0
  206. package/models/create-policy-request-dto.ts +43 -0
  207. package/models/create-policy-response-class.ts +31 -0
  208. package/models/create-premium-formula-request-dto.ts +75 -0
  209. package/models/create-premium-formula-response-class.ts +31 -0
  210. package/models/create-product-field-request-dto.ts +122 -0
  211. package/models/create-product-field-response-class.ts +31 -0
  212. package/models/create-product-request-dto.ts +66 -0
  213. package/models/create-product-response-class.ts +31 -0
  214. package/models/csv-product-factor-dto.ts +54 -0
  215. package/models/delete-request-dto.ts +30 -0
  216. package/models/get-insured-object-request-dto.ts +30 -0
  217. package/models/get-insured-object-response-class.ts +31 -0
  218. package/models/get-policy-request-dto.ts +36 -0
  219. package/models/get-policy-response-class.ts +31 -0
  220. package/models/get-premium-formula-request-dto.ts +30 -0
  221. package/models/get-premium-formula-response-class.ts +31 -0
  222. package/models/get-product-factor-response-class.ts +38 -0
  223. package/models/get-product-factor-value-request-dto.ts +48 -0
  224. package/models/get-product-factor-value-response-class.ts +31 -0
  225. package/models/get-product-field-request-dto.ts +30 -0
  226. package/models/get-product-field-response-class.ts +31 -0
  227. package/models/get-product-request-dto.ts +42 -0
  228. package/models/get-product-response-class.ts +31 -0
  229. package/models/get-product-version-request-dto.ts +30 -0
  230. package/models/get-product-version-response-class.ts +31 -0
  231. package/models/grouped-product-factor-class.ts +43 -0
  232. package/models/grouped-product-factor-value-class.ts +42 -0
  233. package/models/grouped-product-factors-response-class.ts +31 -0
  234. package/models/grpc-create-policy-request-dto.ts +43 -0
  235. package/models/index.ts +79 -0
  236. package/models/insured-object-class.ts +73 -0
  237. package/models/insured-object-type-class.ts +54 -0
  238. package/models/list-insured-object-types-response-class.ts +37 -0
  239. package/models/list-insured-objects-response-class.ts +36 -0
  240. package/models/list-policies-response-class.ts +37 -0
  241. package/models/list-premium-formulas-response-class.ts +37 -0
  242. package/models/list-product-factors-response-class.ts +37 -0
  243. package/models/list-product-field-types-response-class.ts +36 -0
  244. package/models/list-product-fields-response-class.ts +37 -0
  245. package/models/list-products-response-class.ts +37 -0
  246. package/models/list-request-dto.ts +60 -0
  247. package/models/policy-class.ts +92 -0
  248. package/models/policy-object-class.ts +48 -0
  249. package/models/policy-object-dto.ts +36 -0
  250. package/models/policy-premium-class.ts +49 -0
  251. package/models/policy-premium-item-class.ts +55 -0
  252. package/models/policy-version-class.ts +61 -0
  253. package/models/premium-formula-class.ts +85 -0
  254. package/models/product-class.ts +80 -0
  255. package/models/product-factor-class.ts +74 -0
  256. package/models/product-factor-value-class.ts +86 -0
  257. package/models/product-field-class.ts +120 -0
  258. package/models/product-version-class.ts +60 -0
  259. package/models/store-product-factors-request-dto.ts +37 -0
  260. package/models/store-product-factors-response-class.ts +31 -0
  261. package/models/timeslice-class.ts +68 -0
  262. package/models/update-insured-object-request-dto.ts +54 -0
  263. package/models/update-lead-request-dto.ts +80 -0
  264. package/models/update-policy-request-dto.ts +49 -0
  265. package/models/update-policy-response-class.ts +31 -0
  266. package/models/update-premium-formula-request-dto.ts +81 -0
  267. package/models/update-premium-formula-response-class.ts +31 -0
  268. package/models/update-product-field-request-dto.ts +128 -0
  269. package/models/update-product-field-response-class.ts +31 -0
  270. package/models/update-product-request-dto.ts +48 -0
  271. package/models/update-product-response-class.ts +31 -0
  272. package/models/update-product-version-request-dto.ts +52 -0
  273. package/models/update-product-version-response-class.ts +31 -0
  274. package/models/uploaded-document-dto.ts +30 -0
  275. package/models/validate-product-factors-request-dto.ts +37 -0
  276. package/package.json +29 -0
  277. package/tsconfig.json +22 -0
package/dist/api.d.ts ADDED
@@ -0,0 +1,20 @@
1
+ /**
2
+ * EMIL InsuranceService
3
+ * The EMIL InsuranceService API description
4
+ *
5
+ * The version of the OpenAPI document: 1.0
6
+ *
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
+ */
12
+ export * from './api/insured-object-types-api';
13
+ export * from './api/insured-objects-api';
14
+ export * from './api/leads-api';
15
+ export * from './api/policies-api';
16
+ export * from './api/products-api';
17
+ export declare enum Environment {
18
+ Production = "https://apiv2.emil.de",
19
+ Test = "https://apiv2-test.emil.de"
20
+ }
package/dist/api.js ADDED
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * EMIL InsuranceService
6
+ * The EMIL InsuranceService API description
7
+ *
8
+ * The version of the OpenAPI document: 1.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16
+ if (k2 === undefined) k2 = k;
17
+ var desc = Object.getOwnPropertyDescriptor(m, k);
18
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
19
+ desc = { enumerable: true, get: function() { return m[k]; } };
20
+ }
21
+ Object.defineProperty(o, k2, desc);
22
+ }) : (function(o, m, k, k2) {
23
+ if (k2 === undefined) k2 = k;
24
+ o[k2] = m[k];
25
+ }));
26
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
27
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
28
+ };
29
+ Object.defineProperty(exports, "__esModule", { value: true });
30
+ exports.Environment = void 0;
31
+ __exportStar(require("./api/insured-object-types-api"), exports);
32
+ __exportStar(require("./api/insured-objects-api"), exports);
33
+ __exportStar(require("./api/leads-api"), exports);
34
+ __exportStar(require("./api/policies-api"), exports);
35
+ __exportStar(require("./api/products-api"), exports);
36
+ var Environment;
37
+ (function (Environment) {
38
+ Environment["Production"] = "https://apiv2.emil.de";
39
+ Environment["Test"] = "https://apiv2-test.emil.de";
40
+ })(Environment = exports.Environment || (exports.Environment = {}));
package/dist/base.d.ts ADDED
@@ -0,0 +1,69 @@
1
+ /**
2
+ * EMIL InsuranceService
3
+ * The EMIL InsuranceService API description
4
+ *
5
+ * The version of the OpenAPI document: 1.0
6
+ *
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
+ */
12
+ import { Configuration } from "./configuration";
13
+ import { AxiosInstance, AxiosRequestConfig } from 'axios';
14
+ export declare const BASE_PATH: string;
15
+ /**
16
+ *
17
+ * @export
18
+ */
19
+ export declare const COLLECTION_FORMATS: {
20
+ csv: string;
21
+ ssv: string;
22
+ tsv: string;
23
+ pipes: string;
24
+ };
25
+ export interface LoginClass {
26
+ accessToken: string;
27
+ permissions: Array<string>;
28
+ newPasswordRequired: boolean;
29
+ }
30
+ export declare enum Environment {
31
+ Production = "https://apiv2.emil.de",
32
+ Test = "https://apiv2-test.emil.de"
33
+ }
34
+ /**
35
+ *
36
+ * @export
37
+ * @interface RequestArgs
38
+ */
39
+ export interface RequestArgs {
40
+ url: string;
41
+ options: AxiosRequestConfig;
42
+ }
43
+ /**
44
+ *
45
+ * @export
46
+ * @class BaseAPI
47
+ */
48
+ export declare class BaseAPI {
49
+ protected basePath: string;
50
+ protected axios: AxiosInstance;
51
+ protected configuration: Configuration;
52
+ constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
53
+ getConfiguration(): Configuration;
54
+ selectEnvironment(env: Environment): void;
55
+ authorize(username: string, password: string): Promise<void>;
56
+ refreshToken(): Promise<string>;
57
+ private extractRefreshToken;
58
+ }
59
+ /**
60
+ *
61
+ * @export
62
+ * @class RequiredError
63
+ * @extends {Error}
64
+ */
65
+ export declare class RequiredError extends Error {
66
+ field: string;
67
+ name: "RequiredError";
68
+ constructor(field: string, msg?: string);
69
+ }
package/dist/base.js ADDED
@@ -0,0 +1,252 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * EMIL InsuranceService
6
+ * The EMIL InsuranceService API description
7
+ *
8
+ * The version of the OpenAPI document: 1.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __extends = (this && this.__extends) || (function () {
16
+ var extendStatics = function (d, b) {
17
+ extendStatics = Object.setPrototypeOf ||
18
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
19
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
20
+ return extendStatics(d, b);
21
+ };
22
+ return function (d, b) {
23
+ if (typeof b !== "function" && b !== null)
24
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
25
+ extendStatics(d, b);
26
+ function __() { this.constructor = d; }
27
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
28
+ };
29
+ })();
30
+ var __assign = (this && this.__assign) || function () {
31
+ __assign = Object.assign || function(t) {
32
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
33
+ s = arguments[i];
34
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
35
+ t[p] = s[p];
36
+ }
37
+ return t;
38
+ };
39
+ return __assign.apply(this, arguments);
40
+ };
41
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
42
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
43
+ return new (P || (P = Promise))(function (resolve, reject) {
44
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
45
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
46
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
47
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
48
+ });
49
+ };
50
+ var __generator = (this && this.__generator) || function (thisArg, body) {
51
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
52
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
53
+ function verb(n) { return function (v) { return step([n, v]); }; }
54
+ function step(op) {
55
+ if (f) throw new TypeError("Generator is already executing.");
56
+ while (_) try {
57
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
58
+ if (y = 0, t) op = [op[0] & 2, t.value];
59
+ switch (op[0]) {
60
+ case 0: case 1: t = op; break;
61
+ case 4: _.label++; return { value: op[1], done: false };
62
+ case 5: _.label++; y = op[1]; op = [0]; continue;
63
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
64
+ default:
65
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
66
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
67
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
68
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
69
+ if (t[2]) _.ops.pop();
70
+ _.trys.pop(); continue;
71
+ }
72
+ op = body.call(thisArg, _);
73
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
74
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
75
+ }
76
+ };
77
+ var __importDefault = (this && this.__importDefault) || function (mod) {
78
+ return (mod && mod.__esModule) ? mod : { "default": mod };
79
+ };
80
+ Object.defineProperty(exports, "__esModule", { value: true });
81
+ exports.RequiredError = exports.BaseAPI = exports.Environment = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
82
+ var configuration_1 = require("./configuration");
83
+ // Some imports not used depending on template conditions
84
+ // @ts-ignore
85
+ var axios_1 = __importDefault(require("axios"));
86
+ exports.BASE_PATH = "http://localhost".replace(/\/+$/, "");
87
+ /**
88
+ *
89
+ * @export
90
+ */
91
+ exports.COLLECTION_FORMATS = {
92
+ csv: ",",
93
+ ssv: " ",
94
+ tsv: "\t",
95
+ pipes: "|",
96
+ };
97
+ var Environment;
98
+ (function (Environment) {
99
+ Environment["Production"] = "https://apiv2.emil.de";
100
+ Environment["Test"] = "https://apiv2-test.emil.de";
101
+ })(Environment = exports.Environment || (exports.Environment = {}));
102
+ /**
103
+ *
104
+ * @export
105
+ * @class BaseAPI
106
+ */
107
+ var BaseAPI = /** @class */ (function () {
108
+ function BaseAPI(configuration, basePath, axios) {
109
+ if (basePath === void 0) { basePath = exports.BASE_PATH; }
110
+ if (axios === void 0) { axios = axios_1.default; }
111
+ var _this = this;
112
+ this.basePath = basePath;
113
+ this.axios = axios;
114
+ if (configuration) {
115
+ this.configuration = configuration;
116
+ this.basePath = configuration.basePath || this.basePath;
117
+ }
118
+ else {
119
+ this.configuration = new configuration_1.Configuration({
120
+ basePath: this.basePath,
121
+ });
122
+ }
123
+ axios.interceptors.response.use(function (res) {
124
+ return res;
125
+ }, function (err) { return __awaiter(_this, void 0, void 0, function () {
126
+ var originalConfig, tokenString, accessToken, localVarHeaderParameter, _error_1;
127
+ return __generator(this, function (_a) {
128
+ switch (_a.label) {
129
+ case 0:
130
+ originalConfig = err.config;
131
+ if (!err.response) return [3 /*break*/, 5];
132
+ if (!(err.response.status === 401 && !originalConfig._retry)) return [3 /*break*/, 4];
133
+ originalConfig._retry = true;
134
+ _a.label = 1;
135
+ case 1:
136
+ _a.trys.push([1, 3, , 4]);
137
+ return [4 /*yield*/, this.refreshToken()];
138
+ case 2:
139
+ tokenString = _a.sent();
140
+ accessToken = "Bearer ".concat(tokenString);
141
+ localVarHeaderParameter = {};
142
+ localVarHeaderParameter['Authorization'] = accessToken;
143
+ originalConfig.headers = __assign(__assign({}, originalConfig.headers), localVarHeaderParameter);
144
+ this.configuration.accessToken = accessToken;
145
+ return [2 /*return*/, axios(originalConfig)];
146
+ case 3:
147
+ _error_1 = _a.sent();
148
+ if (_error_1.response && _error_1.response.data) {
149
+ return [2 /*return*/, Promise.reject(_error_1.response.data)];
150
+ }
151
+ return [2 /*return*/, Promise.reject(_error_1)];
152
+ case 4:
153
+ if (err.response.status === 403 && err.response.data) {
154
+ return [2 /*return*/, Promise.reject(err.response.data)];
155
+ }
156
+ _a.label = 5;
157
+ case 5: return [2 /*return*/, Promise.reject(err)];
158
+ }
159
+ });
160
+ }); });
161
+ }
162
+ BaseAPI.prototype.getConfiguration = function () {
163
+ return this.configuration;
164
+ };
165
+ BaseAPI.prototype.selectEnvironment = function (env) {
166
+ this.configuration.basePath = env;
167
+ };
168
+ BaseAPI.prototype.authorize = function (username, password) {
169
+ return __awaiter(this, void 0, void 0, function () {
170
+ var options, response, accessToken, refreshToken;
171
+ return __generator(this, function (_a) {
172
+ switch (_a.label) {
173
+ case 0:
174
+ options = {
175
+ method: 'POST',
176
+ url: "".concat(this.configuration.basePath, "/authservice/v1/login"),
177
+ headers: { 'Content-Type': 'application/json' },
178
+ data: {
179
+ username: username,
180
+ password: password,
181
+ },
182
+ withCredentials: true,
183
+ };
184
+ return [4 /*yield*/, axios_1.default.request(options)];
185
+ case 1:
186
+ response = _a.sent();
187
+ accessToken = response.data.accessToken;
188
+ refreshToken = this.extractRefreshToken(response);
189
+ this.configuration.username = username;
190
+ this.configuration.accessToken = "Bearer ".concat(accessToken);
191
+ this.configuration.refreshToken = refreshToken;
192
+ return [2 /*return*/];
193
+ }
194
+ });
195
+ });
196
+ };
197
+ BaseAPI.prototype.refreshToken = function () {
198
+ return __awaiter(this, void 0, void 0, function () {
199
+ var _a, username, refreshToken, options, accessToken;
200
+ return __generator(this, function (_b) {
201
+ switch (_b.label) {
202
+ case 0:
203
+ _a = this.configuration, username = _a.username, refreshToken = _a.refreshToken;
204
+ if (!username || !refreshToken) {
205
+ return [2 /*return*/, ''];
206
+ }
207
+ options = {
208
+ method: 'POST',
209
+ url: "".concat(this.configuration.basePath, "/authservice/v1/refresh-token"),
210
+ headers: {
211
+ 'Content-Type': 'application/json',
212
+ Cookie: refreshToken,
213
+ },
214
+ data: { username: username },
215
+ withCredentials: true,
216
+ };
217
+ return [4 /*yield*/, axios_1.default.request(options)];
218
+ case 1:
219
+ accessToken = (_b.sent()).data.accessToken;
220
+ return [2 /*return*/, accessToken];
221
+ }
222
+ });
223
+ });
224
+ };
225
+ BaseAPI.prototype.extractRefreshToken = function (response) {
226
+ if (response.headers && response.headers['set-cookie']
227
+ && response.headers['set-cookie'].length > 0) {
228
+ return "".concat(response.headers['set-cookie'][0].split(';')[0], ";");
229
+ }
230
+ return '';
231
+ };
232
+ return BaseAPI;
233
+ }());
234
+ exports.BaseAPI = BaseAPI;
235
+ ;
236
+ /**
237
+ *
238
+ * @export
239
+ * @class RequiredError
240
+ * @extends {Error}
241
+ */
242
+ var RequiredError = /** @class */ (function (_super) {
243
+ __extends(RequiredError, _super);
244
+ function RequiredError(field, msg) {
245
+ var _this = _super.call(this, msg) || this;
246
+ _this.field = field;
247
+ _this.name = "RequiredError";
248
+ return _this;
249
+ }
250
+ return RequiredError;
251
+ }(Error));
252
+ exports.RequiredError = RequiredError;
@@ -0,0 +1,66 @@
1
+ /**
2
+ * EMIL InsuranceService
3
+ * The EMIL InsuranceService API description
4
+ *
5
+ * The version of the OpenAPI document: 1.0
6
+ *
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
+ */
12
+ import { Configuration } from "./configuration";
13
+ import { RequestArgs } from "./base";
14
+ import { AxiosInstance, AxiosResponse } from 'axios';
15
+ import { URL } from 'url';
16
+ /**
17
+ *
18
+ * @export
19
+ */
20
+ export declare const DUMMY_BASE_URL = "https://example.com";
21
+ /**
22
+ *
23
+ * @throws {RequiredError}
24
+ * @export
25
+ */
26
+ export declare const assertParamExists: (functionName: string, paramName: string, paramValue: unknown) => void;
27
+ /**
28
+ *
29
+ * @export
30
+ */
31
+ export declare const setApiKeyToObject: (object: any, keyParamName: string, configuration?: Configuration) => Promise<void>;
32
+ /**
33
+ *
34
+ * @export
35
+ */
36
+ export declare const setBasicAuthToObject: (object: any, configuration?: Configuration) => void;
37
+ /**
38
+ *
39
+ * @export
40
+ */
41
+ export declare const setBearerAuthToObject: (object: any, configuration?: Configuration) => Promise<void>;
42
+ /**
43
+ *
44
+ * @export
45
+ */
46
+ export declare const setOAuthToObject: (object: any, name: string, scopes: string[], configuration?: Configuration) => Promise<void>;
47
+ /**
48
+ *
49
+ * @export
50
+ */
51
+ export declare const setSearchParams: (url: URL, ...objects: any[]) => void;
52
+ /**
53
+ *
54
+ * @export
55
+ */
56
+ export declare const serializeDataIfNeeded: (value: any, requestOptions: any, configuration?: Configuration) => any;
57
+ /**
58
+ *
59
+ * @export
60
+ */
61
+ export declare const toPathString: (url: URL) => string;
62
+ /**
63
+ *
64
+ * @export
65
+ */
66
+ export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) => <T = unknown, R = AxiosResponse<T, any>>(axios?: AxiosInstance, basePath?: string) => Promise<R>;
package/dist/common.js ADDED
@@ -0,0 +1,244 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * EMIL InsuranceService
6
+ * The EMIL InsuranceService API description
7
+ *
8
+ * The version of the OpenAPI document: 1.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __assign = (this && this.__assign) || function () {
16
+ __assign = Object.assign || function(t) {
17
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
18
+ s = arguments[i];
19
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
20
+ t[p] = s[p];
21
+ }
22
+ return t;
23
+ };
24
+ return __assign.apply(this, arguments);
25
+ };
26
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
27
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
28
+ return new (P || (P = Promise))(function (resolve, reject) {
29
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
30
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
31
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
32
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
33
+ });
34
+ };
35
+ var __generator = (this && this.__generator) || function (thisArg, body) {
36
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
37
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
38
+ function verb(n) { return function (v) { return step([n, v]); }; }
39
+ function step(op) {
40
+ if (f) throw new TypeError("Generator is already executing.");
41
+ while (_) try {
42
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
43
+ if (y = 0, t) op = [op[0] & 2, t.value];
44
+ switch (op[0]) {
45
+ case 0: case 1: t = op; break;
46
+ case 4: _.label++; return { value: op[1], done: false };
47
+ case 5: _.label++; y = op[1]; op = [0]; continue;
48
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
49
+ default:
50
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
51
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
52
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
53
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
54
+ if (t[2]) _.ops.pop();
55
+ _.trys.pop(); continue;
56
+ }
57
+ op = body.call(thisArg, _);
58
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
59
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
60
+ }
61
+ };
62
+ Object.defineProperty(exports, "__esModule", { value: true });
63
+ exports.createRequestFunction = exports.toPathString = exports.serializeDataIfNeeded = exports.setSearchParams = exports.setOAuthToObject = exports.setBearerAuthToObject = exports.setBasicAuthToObject = exports.setApiKeyToObject = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;
64
+ var base_1 = require("./base");
65
+ var url_1 = require("url");
66
+ /**
67
+ *
68
+ * @export
69
+ */
70
+ exports.DUMMY_BASE_URL = 'https://example.com';
71
+ /**
72
+ *
73
+ * @throws {RequiredError}
74
+ * @export
75
+ */
76
+ var assertParamExists = function (functionName, paramName, paramValue) {
77
+ if (paramValue === null || paramValue === undefined) {
78
+ throw new base_1.RequiredError(paramName, "Required parameter ".concat(paramName, " was null or undefined when calling ").concat(functionName, "."));
79
+ }
80
+ };
81
+ exports.assertParamExists = assertParamExists;
82
+ /**
83
+ *
84
+ * @export
85
+ */
86
+ var setApiKeyToObject = function (object, keyParamName, configuration) {
87
+ return __awaiter(this, void 0, void 0, function () {
88
+ var localVarApiKeyValue, _a;
89
+ return __generator(this, function (_b) {
90
+ switch (_b.label) {
91
+ case 0:
92
+ if (!(configuration && configuration.apiKey)) return [3 /*break*/, 5];
93
+ if (!(typeof configuration.apiKey === 'function')) return [3 /*break*/, 2];
94
+ return [4 /*yield*/, configuration.apiKey(keyParamName)];
95
+ case 1:
96
+ _a = _b.sent();
97
+ return [3 /*break*/, 4];
98
+ case 2: return [4 /*yield*/, configuration.apiKey];
99
+ case 3:
100
+ _a = _b.sent();
101
+ _b.label = 4;
102
+ case 4:
103
+ localVarApiKeyValue = _a;
104
+ object[keyParamName] = localVarApiKeyValue;
105
+ _b.label = 5;
106
+ case 5: return [2 /*return*/];
107
+ }
108
+ });
109
+ });
110
+ };
111
+ exports.setApiKeyToObject = setApiKeyToObject;
112
+ /**
113
+ *
114
+ * @export
115
+ */
116
+ var setBasicAuthToObject = function (object, configuration) {
117
+ if (configuration && (configuration.username || configuration.password)) {
118
+ object["auth"] = { username: configuration.username, password: configuration.password };
119
+ }
120
+ };
121
+ exports.setBasicAuthToObject = setBasicAuthToObject;
122
+ /**
123
+ *
124
+ * @export
125
+ */
126
+ var setBearerAuthToObject = function (object, configuration) {
127
+ return __awaiter(this, void 0, void 0, function () {
128
+ var accessToken, _a;
129
+ return __generator(this, function (_b) {
130
+ switch (_b.label) {
131
+ case 0:
132
+ if (!(configuration && configuration.accessToken)) return [3 /*break*/, 5];
133
+ if (!(typeof configuration.accessToken === 'function')) return [3 /*break*/, 2];
134
+ return [4 /*yield*/, configuration.accessToken()];
135
+ case 1:
136
+ _a = _b.sent();
137
+ return [3 /*break*/, 4];
138
+ case 2: return [4 /*yield*/, configuration.accessToken];
139
+ case 3:
140
+ _a = _b.sent();
141
+ _b.label = 4;
142
+ case 4:
143
+ accessToken = _a;
144
+ object["Authorization"] = "Bearer " + accessToken;
145
+ _b.label = 5;
146
+ case 5: return [2 /*return*/];
147
+ }
148
+ });
149
+ });
150
+ };
151
+ exports.setBearerAuthToObject = setBearerAuthToObject;
152
+ /**
153
+ *
154
+ * @export
155
+ */
156
+ var setOAuthToObject = function (object, name, scopes, configuration) {
157
+ return __awaiter(this, void 0, void 0, function () {
158
+ var localVarAccessTokenValue, _a;
159
+ return __generator(this, function (_b) {
160
+ switch (_b.label) {
161
+ case 0:
162
+ if (!(configuration && configuration.accessToken)) return [3 /*break*/, 5];
163
+ if (!(typeof configuration.accessToken === 'function')) return [3 /*break*/, 2];
164
+ return [4 /*yield*/, configuration.accessToken(name, scopes)];
165
+ case 1:
166
+ _a = _b.sent();
167
+ return [3 /*break*/, 4];
168
+ case 2: return [4 /*yield*/, configuration.accessToken];
169
+ case 3:
170
+ _a = _b.sent();
171
+ _b.label = 4;
172
+ case 4:
173
+ localVarAccessTokenValue = _a;
174
+ object["Authorization"] = "Bearer " + localVarAccessTokenValue;
175
+ _b.label = 5;
176
+ case 5: return [2 /*return*/];
177
+ }
178
+ });
179
+ });
180
+ };
181
+ exports.setOAuthToObject = setOAuthToObject;
182
+ /**
183
+ *
184
+ * @export
185
+ */
186
+ var setSearchParams = function (url) {
187
+ var objects = [];
188
+ for (var _i = 1; _i < arguments.length; _i++) {
189
+ objects[_i - 1] = arguments[_i];
190
+ }
191
+ var searchParams = new url_1.URLSearchParams(url.search);
192
+ for (var _a = 0, objects_1 = objects; _a < objects_1.length; _a++) {
193
+ var object = objects_1[_a];
194
+ for (var key in object) {
195
+ if (Array.isArray(object[key])) {
196
+ searchParams.delete(key);
197
+ for (var _b = 0, _c = object[key]; _b < _c.length; _b++) {
198
+ var item = _c[_b];
199
+ searchParams.append(key, item);
200
+ }
201
+ }
202
+ else {
203
+ searchParams.set(key, object[key]);
204
+ }
205
+ }
206
+ }
207
+ url.search = searchParams.toString();
208
+ };
209
+ exports.setSearchParams = setSearchParams;
210
+ /**
211
+ *
212
+ * @export
213
+ */
214
+ var serializeDataIfNeeded = function (value, requestOptions, configuration) {
215
+ var nonString = typeof value !== 'string';
216
+ var needsSerialization = nonString && configuration && configuration.isJsonMime
217
+ ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
218
+ : nonString;
219
+ return needsSerialization
220
+ ? JSON.stringify(value !== undefined ? value : {})
221
+ : (value || "");
222
+ };
223
+ exports.serializeDataIfNeeded = serializeDataIfNeeded;
224
+ /**
225
+ *
226
+ * @export
227
+ */
228
+ var toPathString = function (url) {
229
+ return url.pathname + url.search + url.hash;
230
+ };
231
+ exports.toPathString = toPathString;
232
+ /**
233
+ *
234
+ * @export
235
+ */
236
+ var createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
237
+ return function (axios, basePath) {
238
+ if (axios === void 0) { axios = globalAxios; }
239
+ if (basePath === void 0) { basePath = BASE_PATH; }
240
+ var axiosRequestArgs = __assign(__assign({}, axiosArgs.options), { url: ((configuration === null || configuration === void 0 ? void 0 : configuration.basePath) || basePath) + axiosArgs.url });
241
+ return axios.request(axiosRequestArgs);
242
+ };
243
+ };
244
+ exports.createRequestFunction = createRequestFunction;