@emilgroup/public-api-sdk 1.25.0 → 1.26.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.
- package/.openapi-generator/FILES +9 -0
- package/README.md +2 -2
- package/api/booking-funnels-api.ts +161 -0
- package/api/documents-api.ts +36 -22
- package/api/leads-api.ts +4 -4
- package/api/named-ranges-api.ts +250 -0
- package/api/products-api.ts +65 -38
- package/api.ts +4 -0
- package/base.ts +1 -0
- package/dist/api/address-completions-validations-api.d.ts +215 -0
- package/dist/api/address-completions-validations-api.js +369 -0
- package/dist/api/booking-funnels-api.d.ts +96 -0
- package/dist/api/booking-funnels-api.js +223 -0
- package/dist/api/default-api.d.ts +66 -0
- package/dist/api/default-api.js +196 -0
- package/dist/api/documents-api.d.ts +548 -0
- package/dist/api/documents-api.js +857 -0
- package/dist/api/leads-api.d.ts +441 -0
- package/dist/api/leads-api.js +787 -0
- package/dist/api/named-ranges-api.d.ts +150 -0
- package/dist/api/named-ranges-api.js +263 -0
- package/dist/api/notifications-api.d.ts +211 -0
- package/dist/api/notifications-api.js +410 -0
- package/dist/api/payments-setup-api.d.ts +228 -0
- package/dist/api/payments-setup-api.js +422 -0
- package/dist/api/products-api.d.ts +581 -0
- package/dist/api/products-api.js +933 -0
- package/dist/api.d.ts +20 -0
- package/dist/api.js +38 -0
- package/dist/base.d.ts +74 -0
- package/dist/base.js +299 -0
- package/dist/common.d.ts +91 -0
- package/dist/common.js +276 -0
- package/dist/configuration.d.ts +83 -0
- package/dist/configuration.js +44 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +36 -0
- package/dist/models/address-completion-item-class.d.ts +49 -0
- package/dist/models/address-completion-item-class.js +15 -0
- package/dist/models/address-completion-response-class.d.ts +25 -0
- package/dist/models/address-completion-response-class.js +15 -0
- package/dist/models/address-field-score-class.d.ts +48 -0
- package/dist/models/address-field-score-class.js +15 -0
- package/dist/models/booking-funnel-class.d.ts +90 -0
- package/dist/models/booking-funnel-class.js +15 -0
- package/dist/models/calculate-product-fields-request-dto.d.ts +31 -0
- package/dist/models/calculate-product-fields-request-dto.js +15 -0
- package/dist/models/calculate-product-fields-response-class.d.ts +25 -0
- package/dist/models/calculate-product-fields-response-class.js +15 -0
- package/dist/models/complete-braintree-payment-setup-request-dto.d.ts +48 -0
- package/dist/models/complete-braintree-payment-setup-request-dto.js +15 -0
- package/dist/models/complete-email-verification-dto.d.ts +30 -0
- package/dist/models/complete-email-verification-dto.js +15 -0
- package/dist/models/complete-email-verification-response-class.d.ts +24 -0
- package/dist/models/complete-email-verification-response-class.js +15 -0
- package/dist/models/complete-payment-setup-request-dto.d.ts +32 -0
- package/dist/models/complete-payment-setup-request-dto.js +15 -0
- package/dist/models/complete-payment-setup-response-class.d.ts +25 -0
- package/dist/models/complete-payment-setup-response-class.js +15 -0
- package/dist/models/complete-stripe-payment-setup-request-dto.d.ts +60 -0
- package/dist/models/complete-stripe-payment-setup-request-dto.js +15 -0
- package/dist/models/create-account-request-dto.d.ts +132 -0
- package/dist/models/create-account-request-dto.js +31 -0
- package/dist/models/create-bank-account-request-dto.d.ts +30 -0
- package/dist/models/create-bank-account-request-dto.js +15 -0
- package/dist/models/create-custom-application-request-dto.d.ts +35 -0
- package/dist/models/create-custom-application-request-dto.js +20 -0
- package/dist/models/create-custom-application-response-class.d.ts +24 -0
- package/dist/models/create-custom-application-response-class.js +15 -0
- package/dist/models/create-document-request-dto.d.ts +132 -0
- package/dist/models/create-document-request-dto.js +43 -0
- package/dist/models/create-estimated-invoice-request-dto.d.ts +55 -0
- package/dist/models/create-estimated-invoice-request-dto.js +20 -0
- package/dist/models/create-estimated-invoice-response-class.d.ts +38 -0
- package/dist/models/create-estimated-invoice-response-class.js +15 -0
- package/dist/models/create-lead-async-response-class.d.ts +24 -0
- package/dist/models/create-lead-async-response-class.js +15 -0
- package/dist/models/create-lead-request-dto.d.ts +120 -0
- package/dist/models/create-lead-request-dto.js +15 -0
- package/dist/models/create-lead-response-class.d.ts +25 -0
- package/dist/models/create-lead-response-class.js +15 -0
- package/dist/models/create-payment-method-request-dto.d.ts +36 -0
- package/dist/models/create-payment-method-request-dto.js +20 -0
- package/dist/models/create-presigned-post-request-dto.d.ts +128 -0
- package/dist/models/create-presigned-post-request-dto.js +52 -0
- package/dist/models/create-presigned-post-response-class.d.ts +30 -0
- package/dist/models/create-presigned-post-response-class.js +15 -0
- package/dist/models/document-class.d.ts +144 -0
- package/dist/models/document-class.js +49 -0
- package/dist/models/filter-named-range-response-class.d.ts +42 -0
- package/dist/models/filter-named-range-response-class.js +15 -0
- package/dist/models/get-booking-funnel-response-class.d.ts +25 -0
- package/dist/models/get-booking-funnel-response-class.js +15 -0
- package/dist/models/get-custom-css-response-class.d.ts +24 -0
- package/dist/models/get-custom-css-response-class.js +15 -0
- package/dist/models/get-lead-response-class.d.ts +25 -0
- package/dist/models/get-lead-response-class.js +15 -0
- package/dist/models/get-product-document-download-url-response-class.d.ts +24 -0
- package/dist/models/get-product-document-download-url-response-class.js +15 -0
- package/dist/models/get-public-psp-settings-response-class.d.ts +30 -0
- package/dist/models/get-public-psp-settings-response-class.js +15 -0
- package/dist/models/index.d.ts +79 -0
- package/dist/models/index.js +95 -0
- package/dist/models/initiate-braintree-payment-setup-request-dto.d.ts +30 -0
- package/dist/models/initiate-braintree-payment-setup-request-dto.js +15 -0
- package/dist/models/initiate-braintree-payment-setup-response-class.d.ts +24 -0
- package/dist/models/initiate-braintree-payment-setup-response-class.js +15 -0
- package/dist/models/initiate-email-verification-dto.d.ts +30 -0
- package/dist/models/initiate-email-verification-dto.js +15 -0
- package/dist/models/initiate-email-verification-response-class.d.ts +24 -0
- package/dist/models/initiate-email-verification-response-class.js +15 -0
- package/dist/models/initiate-lead-response-class.d.ts +24 -0
- package/dist/models/initiate-lead-response-class.js +15 -0
- package/dist/models/initiate-payment-setup-request-dto.d.ts +32 -0
- package/dist/models/initiate-payment-setup-request-dto.js +15 -0
- package/dist/models/initiate-payment-setup-response-class.d.ts +32 -0
- package/dist/models/initiate-payment-setup-response-class.js +15 -0
- package/dist/models/initiate-stripe-payment-setup-request-dto.d.ts +30 -0
- package/dist/models/initiate-stripe-payment-setup-request-dto.js +15 -0
- package/dist/models/initiate-stripe-payment-setup-response-class.d.ts +30 -0
- package/dist/models/initiate-stripe-payment-setup-response-class.js +15 -0
- package/dist/models/inline-response200.d.ts +54 -0
- package/dist/models/inline-response200.js +15 -0
- package/dist/models/inline-response503.d.ts +54 -0
- package/dist/models/inline-response503.js +15 -0
- package/dist/models/insured-object-class.d.ts +85 -0
- package/dist/models/insured-object-class.js +15 -0
- package/dist/models/insured-object-type-class.d.ts +48 -0
- package/dist/models/insured-object-type-class.js +15 -0
- package/dist/models/invoice-class.d.ts +134 -0
- package/dist/models/invoice-class.js +15 -0
- package/dist/models/invoice-item-class.d.ts +120 -0
- package/dist/models/invoice-item-class.js +15 -0
- package/dist/models/invoice-status-class.d.ts +42 -0
- package/dist/models/invoice-status-class.js +15 -0
- package/dist/models/lead-account-class.d.ts +109 -0
- package/dist/models/lead-account-class.js +22 -0
- package/dist/models/lead-bank-account-class.d.ts +30 -0
- package/dist/models/lead-bank-account-class.js +15 -0
- package/dist/models/lead-class.d.ts +116 -0
- package/dist/models/lead-class.js +15 -0
- package/dist/models/lead-policy-class.d.ts +43 -0
- package/dist/models/lead-policy-class.js +15 -0
- package/dist/models/lead-policy-object-class.d.ts +36 -0
- package/dist/models/lead-policy-object-class.js +15 -0
- package/dist/models/list-documents-response-class.d.ts +31 -0
- package/dist/models/list-documents-response-class.js +15 -0
- package/dist/models/list-product-documents-response-class.d.ts +31 -0
- package/dist/models/list-product-documents-response-class.js +15 -0
- package/dist/models/list-products-response-class.d.ts +31 -0
- package/dist/models/list-products-response-class.js +15 -0
- package/dist/models/partner-class.d.ts +60 -0
- package/dist/models/partner-class.js +15 -0
- package/dist/models/partner-link-class.d.ts +86 -0
- package/dist/models/partner-link-class.js +15 -0
- package/dist/models/partner-role-class.d.ts +54 -0
- package/dist/models/partner-role-class.js +15 -0
- package/dist/models/payment-method-class.d.ts +60 -0
- package/dist/models/payment-method-class.js +15 -0
- package/dist/models/policy-object-request-dto.d.ts +42 -0
- package/dist/models/policy-object-request-dto.js +15 -0
- package/dist/models/policy-object-response-class.d.ts +36 -0
- package/dist/models/policy-object-response-class.js +15 -0
- package/dist/models/premium-override-dto.d.ts +55 -0
- package/dist/models/premium-override-dto.js +27 -0
- package/dist/models/premium-override-request-dto.d.ts +25 -0
- package/dist/models/premium-override-request-dto.js +15 -0
- package/dist/models/product-class.d.ts +80 -0
- package/dist/models/product-class.js +15 -0
- package/dist/models/product-document-class.d.ts +123 -0
- package/dist/models/product-document-class.js +36 -0
- package/dist/models/product-factor-for-version-class.d.ts +61 -0
- package/dist/models/product-factor-for-version-class.js +15 -0
- package/dist/models/product-factor-value-for-version-class.d.ts +42 -0
- package/dist/models/product-factor-value-for-version-class.js +15 -0
- package/dist/models/product-field-class.d.ts +132 -0
- package/dist/models/product-field-class.js +15 -0
- package/dist/models/product-version-class.d.ts +61 -0
- package/dist/models/product-version-class.js +22 -0
- package/dist/models/send-notification-request-dto.d.ts +36 -0
- package/dist/models/send-notification-request-dto.js +15 -0
- package/dist/models/send-notification-response-class.d.ts +24 -0
- package/dist/models/send-notification-response-class.js +15 -0
- package/dist/models/sepa-dto.d.ts +30 -0
- package/dist/models/sepa-dto.js +15 -0
- package/dist/models/structured-address-class.d.ts +54 -0
- package/dist/models/structured-address-class.js +15 -0
- package/dist/models/suggested-address-details-class.d.ts +90 -0
- package/dist/models/suggested-address-details-class.js +15 -0
- package/dist/models/update-lead-request-dto.d.ts +95 -0
- package/dist/models/update-lead-request-dto.js +15 -0
- package/dist/models/update-lead-response-class.d.ts +25 -0
- package/dist/models/update-lead-response-class.js +15 -0
- package/dist/models/uploaded-document-dto.d.ts +24 -0
- package/dist/models/uploaded-document-dto.js +15 -0
- package/dist/models/validate-address-response-class.d.ts +50 -0
- package/dist/models/validate-address-response-class.js +15 -0
- package/models/address-field-score-class.ts +10 -10
- package/models/booking-funnel-class.ts +96 -0
- package/models/create-account-request-dto.ts +1 -1
- package/models/create-document-request-dto.ts +2 -2
- package/models/create-lead-request-dto.ts +13 -1
- package/models/create-presigned-post-request-dto.ts +2 -2
- package/models/document-class.ts +1 -1
- package/models/filter-named-range-response-class.ts +48 -0
- package/models/get-booking-funnel-response-class.ts +31 -0
- package/models/index.ts +7 -0
- package/models/initiate-email-verification-dto.ts +1 -1
- package/models/insured-object-type-class.ts +1 -1
- package/models/lead-account-class.ts +1 -1
- package/models/lead-class.ts +7 -0
- package/models/lead-policy-object-class.ts +2 -2
- package/models/partner-class.ts +66 -0
- package/models/partner-link-class.ts +92 -0
- package/models/partner-role-class.ts +60 -0
- package/models/product-class.ts +1 -1
- package/models/product-document-class.ts +14 -2
- package/models/product-factor-for-version-class.ts +4 -3
- package/models/product-factor-value-for-version-class.ts +48 -0
- package/models/send-notification-request-dto.ts +1 -1
- package/models/update-lead-request-dto.ts +1 -1
- package/package.json +1 -1
package/dist/api.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Emil PublicAPI
|
|
3
|
+
* The Emil Public API description
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0
|
|
6
|
+
* Contact: kontakt@emil.de
|
|
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/address-completions-validations-api';
|
|
13
|
+
export * from './api/booking-funnels-api';
|
|
14
|
+
export * from './api/default-api';
|
|
15
|
+
export * from './api/documents-api';
|
|
16
|
+
export * from './api/leads-api';
|
|
17
|
+
export * from './api/named-ranges-api';
|
|
18
|
+
export * from './api/notifications-api';
|
|
19
|
+
export * from './api/payments-setup-api';
|
|
20
|
+
export * from './api/products-api';
|
package/dist/api.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Emil PublicAPI
|
|
6
|
+
* The Emil Public API description
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0
|
|
9
|
+
* Contact: kontakt@emil.de
|
|
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
|
+
__exportStar(require("./api/address-completions-validations-api"), exports);
|
|
31
|
+
__exportStar(require("./api/booking-funnels-api"), exports);
|
|
32
|
+
__exportStar(require("./api/default-api"), exports);
|
|
33
|
+
__exportStar(require("./api/documents-api"), exports);
|
|
34
|
+
__exportStar(require("./api/leads-api"), exports);
|
|
35
|
+
__exportStar(require("./api/named-ranges-api"), exports);
|
|
36
|
+
__exportStar(require("./api/notifications-api"), exports);
|
|
37
|
+
__exportStar(require("./api/payments-setup-api"), exports);
|
|
38
|
+
__exportStar(require("./api/products-api"), exports);
|
package/dist/base.d.ts
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Emil PublicAPI
|
|
3
|
+
* The Emil Public API description
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0
|
|
6
|
+
* Contact: kontakt@emil.de
|
|
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
|
+
}
|
|
29
|
+
export declare enum Environment {
|
|
30
|
+
Production = "https://apiv2.emil.de",
|
|
31
|
+
Test = "https://apiv2-test.emil.de",
|
|
32
|
+
Development = "https://apiv2-dev.emil.de",
|
|
33
|
+
ProductionZurich = "https://eu-central-2.apiv2.emil.de"
|
|
34
|
+
}
|
|
35
|
+
export declare function resetRetry(): void;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @export
|
|
39
|
+
* @interface RequestArgs
|
|
40
|
+
*/
|
|
41
|
+
export interface RequestArgs {
|
|
42
|
+
url: string;
|
|
43
|
+
options: AxiosRequestConfig;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
*
|
|
47
|
+
* @export
|
|
48
|
+
* @class BaseAPI
|
|
49
|
+
*/
|
|
50
|
+
export declare class BaseAPI {
|
|
51
|
+
protected basePath: string;
|
|
52
|
+
protected axios: AxiosInstance;
|
|
53
|
+
protected configuration: Configuration | undefined;
|
|
54
|
+
private tokenData?;
|
|
55
|
+
constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
|
|
56
|
+
selectEnvironment(env: Environment): void;
|
|
57
|
+
authorize(username: string, password: string): Promise<void>;
|
|
58
|
+
refreshTokenInternal(): Promise<string>;
|
|
59
|
+
private storeTokenData;
|
|
60
|
+
loadTokenData(): void;
|
|
61
|
+
cleanTokenData(): void;
|
|
62
|
+
private attachInterceptor;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
*
|
|
66
|
+
* @export
|
|
67
|
+
* @class RequiredError
|
|
68
|
+
* @extends {Error}
|
|
69
|
+
*/
|
|
70
|
+
export declare class RequiredError extends Error {
|
|
71
|
+
field: string;
|
|
72
|
+
name: "RequiredError";
|
|
73
|
+
constructor(field: string, msg?: string);
|
|
74
|
+
}
|
package/dist/base.js
ADDED
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Emil PublicAPI
|
|
6
|
+
* The Emil Public API description
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0
|
|
9
|
+
* Contact: kontakt@emil.de
|
|
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 (g && (g = 0, op[0] && (_ = 0)), _) 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.resetRetry = exports.Environment = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
|
|
82
|
+
var configuration_1 = require("./configuration");
|
|
83
|
+
var common_1 = require("./common");
|
|
84
|
+
// Some imports not used depending on template conditions
|
|
85
|
+
// @ts-ignore
|
|
86
|
+
var axios_1 = __importDefault(require("axios"));
|
|
87
|
+
exports.BASE_PATH = "https://apiv2.emil.de".replace(/\/+$/, "");
|
|
88
|
+
/**
|
|
89
|
+
*
|
|
90
|
+
* @export
|
|
91
|
+
*/
|
|
92
|
+
exports.COLLECTION_FORMATS = {
|
|
93
|
+
csv: ",",
|
|
94
|
+
ssv: " ",
|
|
95
|
+
tsv: "\t",
|
|
96
|
+
pipes: "|",
|
|
97
|
+
};
|
|
98
|
+
var Environment;
|
|
99
|
+
(function (Environment) {
|
|
100
|
+
Environment["Production"] = "https://apiv2.emil.de";
|
|
101
|
+
Environment["Test"] = "https://apiv2-test.emil.de";
|
|
102
|
+
Environment["Development"] = "https://apiv2-dev.emil.de";
|
|
103
|
+
Environment["ProductionZurich"] = "https://eu-central-2.apiv2.emil.de";
|
|
104
|
+
})(Environment = exports.Environment || (exports.Environment = {}));
|
|
105
|
+
var _retry_count = 0;
|
|
106
|
+
var _retry = null;
|
|
107
|
+
function resetRetry() {
|
|
108
|
+
_retry_count = 0;
|
|
109
|
+
}
|
|
110
|
+
exports.resetRetry = resetRetry;
|
|
111
|
+
var NETWORK_ERROR_MESSAGE = "Network Error";
|
|
112
|
+
var TOKEN_DATA = 'APP_TOKEN';
|
|
113
|
+
/**
|
|
114
|
+
*
|
|
115
|
+
* @export
|
|
116
|
+
* @class BaseAPI
|
|
117
|
+
*/
|
|
118
|
+
var BaseAPI = /** @class */ (function () {
|
|
119
|
+
function BaseAPI(configuration, basePath, axios) {
|
|
120
|
+
if (basePath === void 0) { basePath = exports.BASE_PATH; }
|
|
121
|
+
if (axios === void 0) { axios = axios_1.default; }
|
|
122
|
+
this.basePath = basePath;
|
|
123
|
+
this.axios = axios;
|
|
124
|
+
this.loadTokenData();
|
|
125
|
+
if (configuration) {
|
|
126
|
+
this.configuration = configuration;
|
|
127
|
+
this.basePath = configuration.basePath || this.basePath;
|
|
128
|
+
this.configuration.accessToken = this.tokenData.accessToken ? "Bearer ".concat(this.tokenData.accessToken) : '';
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
var _a = this.tokenData, accessToken = _a.accessToken, username = _a.username;
|
|
132
|
+
this.configuration = new configuration_1.Configuration({
|
|
133
|
+
basePath: this.basePath,
|
|
134
|
+
accessToken: accessToken ? "Bearer ".concat(accessToken) : '',
|
|
135
|
+
username: username,
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
this.attachInterceptor(axios);
|
|
139
|
+
}
|
|
140
|
+
BaseAPI.prototype.selectEnvironment = function (env) {
|
|
141
|
+
this.configuration.basePath = env;
|
|
142
|
+
};
|
|
143
|
+
BaseAPI.prototype.authorize = function (username, password) {
|
|
144
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
145
|
+
var options, response, accessToken;
|
|
146
|
+
return __generator(this, function (_a) {
|
|
147
|
+
switch (_a.label) {
|
|
148
|
+
case 0:
|
|
149
|
+
options = {
|
|
150
|
+
method: 'POST',
|
|
151
|
+
url: "".concat(this.configuration.basePath, "/authservice/v1/login"),
|
|
152
|
+
headers: { 'Content-Type': 'application/json' },
|
|
153
|
+
data: {
|
|
154
|
+
username: username,
|
|
155
|
+
password: password,
|
|
156
|
+
},
|
|
157
|
+
withCredentials: true,
|
|
158
|
+
};
|
|
159
|
+
return [4 /*yield*/, axios_1.default.request(options)];
|
|
160
|
+
case 1:
|
|
161
|
+
response = _a.sent();
|
|
162
|
+
accessToken = response.data.accessToken;
|
|
163
|
+
this.configuration.username = username;
|
|
164
|
+
this.configuration.accessToken = "Bearer ".concat(accessToken);
|
|
165
|
+
this.tokenData.username = username;
|
|
166
|
+
this.tokenData.accessToken = accessToken;
|
|
167
|
+
this.storeTokenData(__assign({}, this.tokenData));
|
|
168
|
+
return [2 /*return*/];
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
};
|
|
173
|
+
BaseAPI.prototype.refreshTokenInternal = function () {
|
|
174
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
175
|
+
var username, options, accessToken;
|
|
176
|
+
return __generator(this, function (_a) {
|
|
177
|
+
switch (_a.label) {
|
|
178
|
+
case 0:
|
|
179
|
+
username = this.configuration.username;
|
|
180
|
+
if (!username) {
|
|
181
|
+
return [2 /*return*/, ''];
|
|
182
|
+
}
|
|
183
|
+
options = {
|
|
184
|
+
method: 'POST',
|
|
185
|
+
url: "".concat(this.configuration.basePath, "/authservice/v1/refresh-token"),
|
|
186
|
+
headers: {
|
|
187
|
+
'Content-Type': 'application/json',
|
|
188
|
+
},
|
|
189
|
+
data: { username: username },
|
|
190
|
+
withCredentials: true,
|
|
191
|
+
};
|
|
192
|
+
return [4 /*yield*/, axios_1.default.request(options)];
|
|
193
|
+
case 1:
|
|
194
|
+
accessToken = (_a.sent()).data.accessToken;
|
|
195
|
+
return [2 /*return*/, accessToken];
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
};
|
|
200
|
+
BaseAPI.prototype.storeTokenData = function (tokenData) {
|
|
201
|
+
if (typeof window !== 'undefined') {
|
|
202
|
+
(0, common_1.defaultStorage)().set(TOKEN_DATA, tokenData);
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
BaseAPI.prototype.loadTokenData = function () {
|
|
206
|
+
if (typeof window !== 'undefined') {
|
|
207
|
+
this.tokenData = (0, common_1.defaultStorage)().get(TOKEN_DATA) || {};
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
this.tokenData = {};
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
BaseAPI.prototype.cleanTokenData = function () {
|
|
214
|
+
this.storeTokenData(null);
|
|
215
|
+
};
|
|
216
|
+
BaseAPI.prototype.attachInterceptor = function (axios) {
|
|
217
|
+
var _this = this;
|
|
218
|
+
axios.interceptors.response.use(function (res) {
|
|
219
|
+
return res;
|
|
220
|
+
}, function (err) { return __awaiter(_this, void 0, void 0, function () {
|
|
221
|
+
var originalConfig, tokenString, accessToken, _error_1, tokenString, accessToken, _error_2;
|
|
222
|
+
return __generator(this, function (_a) {
|
|
223
|
+
switch (_a.label) {
|
|
224
|
+
case 0:
|
|
225
|
+
originalConfig = err.config;
|
|
226
|
+
if (!(err.response && !(err.response instanceof XMLHttpRequest))) return [3 /*break*/, 5];
|
|
227
|
+
if (!((err.response.status === 401 || err.response.status === 403)
|
|
228
|
+
&& !originalConfig._retry)) return [3 /*break*/, 4];
|
|
229
|
+
originalConfig._retry = true;
|
|
230
|
+
_a.label = 1;
|
|
231
|
+
case 1:
|
|
232
|
+
_a.trys.push([1, 3, , 4]);
|
|
233
|
+
return [4 /*yield*/, this.refreshTokenInternal()];
|
|
234
|
+
case 2:
|
|
235
|
+
tokenString = _a.sent();
|
|
236
|
+
accessToken = "Bearer ".concat(tokenString);
|
|
237
|
+
delete originalConfig.headers['Authorization'];
|
|
238
|
+
originalConfig.headers['Authorization'] = accessToken;
|
|
239
|
+
this.configuration.accessToken = accessToken;
|
|
240
|
+
this.tokenData.accessToken = tokenString;
|
|
241
|
+
this.storeTokenData(this.tokenData);
|
|
242
|
+
return [2 /*return*/, axios(originalConfig)];
|
|
243
|
+
case 3:
|
|
244
|
+
_error_1 = _a.sent();
|
|
245
|
+
if (_error_1.response && _error_1.response.data) {
|
|
246
|
+
return [2 /*return*/, Promise.reject(_error_1.response.data)];
|
|
247
|
+
}
|
|
248
|
+
return [2 /*return*/, Promise.reject(_error_1)];
|
|
249
|
+
case 4: return [3 /*break*/, 9];
|
|
250
|
+
case 5:
|
|
251
|
+
if (!(err.message === NETWORK_ERROR_MESSAGE
|
|
252
|
+
&& originalConfig.headers.hasOwnProperty('Authorization')
|
|
253
|
+
&& _retry_count < 4)) return [3 /*break*/, 9];
|
|
254
|
+
_retry_count++;
|
|
255
|
+
_a.label = 6;
|
|
256
|
+
case 6:
|
|
257
|
+
_a.trys.push([6, 8, , 9]);
|
|
258
|
+
return [4 /*yield*/, this.refreshTokenInternal()];
|
|
259
|
+
case 7:
|
|
260
|
+
tokenString = _a.sent();
|
|
261
|
+
accessToken = "Bearer ".concat(tokenString);
|
|
262
|
+
_retry = true;
|
|
263
|
+
originalConfig.headers['Authorization'] = accessToken;
|
|
264
|
+
this.configuration.accessToken = accessToken;
|
|
265
|
+
this.tokenData.accessToken = tokenString;
|
|
266
|
+
this.storeTokenData(this.tokenData);
|
|
267
|
+
return [2 /*return*/, axios.request(__assign({}, originalConfig))];
|
|
268
|
+
case 8:
|
|
269
|
+
_error_2 = _a.sent();
|
|
270
|
+
if (_error_2.response && _error_2.response.data) {
|
|
271
|
+
return [2 /*return*/, Promise.reject(_error_2.response.data)];
|
|
272
|
+
}
|
|
273
|
+
return [2 /*return*/, Promise.reject(_error_2)];
|
|
274
|
+
case 9: return [2 /*return*/, Promise.reject(err)];
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
}); });
|
|
278
|
+
};
|
|
279
|
+
return BaseAPI;
|
|
280
|
+
}());
|
|
281
|
+
exports.BaseAPI = BaseAPI;
|
|
282
|
+
;
|
|
283
|
+
/**
|
|
284
|
+
*
|
|
285
|
+
* @export
|
|
286
|
+
* @class RequiredError
|
|
287
|
+
* @extends {Error}
|
|
288
|
+
*/
|
|
289
|
+
var RequiredError = /** @class */ (function (_super) {
|
|
290
|
+
__extends(RequiredError, _super);
|
|
291
|
+
function RequiredError(field, msg) {
|
|
292
|
+
var _this = _super.call(this, msg) || this;
|
|
293
|
+
_this.field = field;
|
|
294
|
+
_this.name = "RequiredError";
|
|
295
|
+
return _this;
|
|
296
|
+
}
|
|
297
|
+
return RequiredError;
|
|
298
|
+
}(Error));
|
|
299
|
+
exports.RequiredError = RequiredError;
|
package/dist/common.d.ts
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Emil PublicAPI
|
|
3
|
+
* The Emil Public API description
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0
|
|
6
|
+
* Contact: kontakt@emil.de
|
|
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
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @export
|
|
18
|
+
*/
|
|
19
|
+
export declare const DUMMY_BASE_URL = "https://example.com";
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* @throws {RequiredError}
|
|
23
|
+
* @export
|
|
24
|
+
*/
|
|
25
|
+
export declare const assertParamExists: (functionName: string, paramName: string, paramValue: unknown) => void;
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @export
|
|
29
|
+
*/
|
|
30
|
+
export declare const setApiKeyToObject: (object: any, keyParamName: string, configuration?: Configuration) => Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @export
|
|
34
|
+
*/
|
|
35
|
+
export declare const setBasicAuthToObject: (object: any, configuration?: Configuration) => void;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @export
|
|
39
|
+
*/
|
|
40
|
+
export declare const setBearerAuthToObject: (object: any, configuration?: Configuration) => Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
*
|
|
43
|
+
* @export
|
|
44
|
+
*/
|
|
45
|
+
export declare const setOAuthToObject: (object: any, name: string, scopes: string[], configuration?: Configuration) => Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @export
|
|
49
|
+
*/
|
|
50
|
+
export declare const setSearchParams: (url: URL, ...objects: any[]) => void;
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
* @export
|
|
54
|
+
*/
|
|
55
|
+
export declare const serializeDataIfNeeded: (value: any, requestOptions: any, configuration?: Configuration) => any;
|
|
56
|
+
/**
|
|
57
|
+
*
|
|
58
|
+
* @export
|
|
59
|
+
*/
|
|
60
|
+
export declare const toPathString: (url: URL) => string;
|
|
61
|
+
/**
|
|
62
|
+
*
|
|
63
|
+
* @export
|
|
64
|
+
*/
|
|
65
|
+
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>;
|
|
66
|
+
/**
|
|
67
|
+
* Emil PublicAPI
|
|
68
|
+
* The Emil Public API description
|
|
69
|
+
*
|
|
70
|
+
* The version of the OpenAPI document: 1.0
|
|
71
|
+
* Contact: kontakt@emil.de
|
|
72
|
+
*
|
|
73
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
74
|
+
* https://openapi-generator.tech
|
|
75
|
+
* Do not edit the class manually.
|
|
76
|
+
*/
|
|
77
|
+
export interface IStorageConverter<D, SD> {
|
|
78
|
+
toStorageData(data: D): SD;
|
|
79
|
+
fromStorageData(storageData: SD): D;
|
|
80
|
+
}
|
|
81
|
+
export interface IStorage {
|
|
82
|
+
get<T>(key: string, converter?: IStorageConverter<T, any>): T | null;
|
|
83
|
+
set<T>(key: string, value: T, converter?: IStorageConverter<T, any>): void;
|
|
84
|
+
}
|
|
85
|
+
export declare class LocalStorage implements IStorage {
|
|
86
|
+
readonly storage: Storage;
|
|
87
|
+
constructor();
|
|
88
|
+
get<T>(key: string, converter?: IStorageConverter<T, any>): T | null;
|
|
89
|
+
set<T>(key: string, value: T, converter?: IStorageConverter<T, any>): void;
|
|
90
|
+
}
|
|
91
|
+
export declare const defaultStorage: () => IStorage;
|