@emilgroup/billing-sdk 1.46.1-beta.1 → 1.46.1-beta.10
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 +1 -0
- package/README.md +2 -2
- package/api/invoices-api.ts +4 -4
- package/api/termination-invoices-api.ts +179 -0
- package/api.ts +2 -0
- package/base.ts +45 -1
- package/dist/api/invoices-api.d.ts +4 -4
- package/dist/api/invoices-api.js +3 -3
- package/dist/api/termination-invoices-api.d.ts +106 -0
- package/dist/api/termination-invoices-api.js +230 -0
- package/dist/api.d.ts +1 -0
- package/dist/api.js +1 -0
- package/dist/base.d.ts +10 -1
- package/dist/base.js +41 -1
- package/dist/models/create-termination-invoice-request-dto.d.ts +6 -0
- package/models/create-termination-invoice-request-dto.ts +6 -0
- package/package.json +1 -1
package/.openapi-generator/FILES
CHANGED
package/README.md
CHANGED
|
@@ -17,11 +17,11 @@ Although this package can be used in both TypeScript and JavaScript, it is inten
|
|
|
17
17
|
Navigate to the folder of your consuming project and run one of the following commands:
|
|
18
18
|
|
|
19
19
|
```
|
|
20
|
-
npm install @emilgroup/billing-sdk@1.46.1-beta.
|
|
20
|
+
npm install @emilgroup/billing-sdk@1.46.1-beta.10 --save
|
|
21
21
|
```
|
|
22
22
|
or
|
|
23
23
|
```
|
|
24
|
-
yarn add @emilgroup/billing-sdk@1.46.1-beta.
|
|
24
|
+
yarn add @emilgroup/billing-sdk@1.46.1-beta.10
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
And then you can import `InvoicesApi`.
|
package/api/invoices-api.ts
CHANGED
|
@@ -149,7 +149,7 @@ export const InvoicesApiAxiosParamCreator = function (configuration?: Configurat
|
|
|
149
149
|
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: code, policyCode, invoiceNumber, id, type, accountNumber, status, billingIntervalFrom, billingIntervalTo, createdAt</i>
|
|
150
150
|
* @param {string} [search] To search the list by any field, pass search=xxx to fetch the result.
|
|
151
151
|
* @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.<br/> <br/> <i>Allowed values: invoiceNumber, status, netAmount, grossAmount, createdAt, dueDate, id</i>
|
|
152
|
-
* @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/> <i>Allowed values: statuses, payments<i>
|
|
152
|
+
* @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/> <i>Allowed values: statuses, payments, invoiceItems<i>
|
|
153
153
|
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: code, policyCode, invoiceNumber, id, type, accountNumber, status, billingIntervalFrom, billingIntervalTo, createdAt</i>
|
|
154
154
|
* @param {*} [options] Override http request option.
|
|
155
155
|
* @throws {RequiredError}
|
|
@@ -338,7 +338,7 @@ export const InvoicesApiFp = function(configuration?: Configuration) {
|
|
|
338
338
|
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: code, policyCode, invoiceNumber, id, type, accountNumber, status, billingIntervalFrom, billingIntervalTo, createdAt</i>
|
|
339
339
|
* @param {string} [search] To search the list by any field, pass search=xxx to fetch the result.
|
|
340
340
|
* @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.<br/> <br/> <i>Allowed values: invoiceNumber, status, netAmount, grossAmount, createdAt, dueDate, id</i>
|
|
341
|
-
* @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/> <i>Allowed values: statuses, payments<i>
|
|
341
|
+
* @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/> <i>Allowed values: statuses, payments, invoiceItems<i>
|
|
342
342
|
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: code, policyCode, invoiceNumber, id, type, accountNumber, status, billingIntervalFrom, billingIntervalTo, createdAt</i>
|
|
343
343
|
* @param {*} [options] Override http request option.
|
|
344
344
|
* @throws {RequiredError}
|
|
@@ -409,7 +409,7 @@ export const InvoicesApiFactory = function (configuration?: Configuration, baseP
|
|
|
409
409
|
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: code, policyCode, invoiceNumber, id, type, accountNumber, status, billingIntervalFrom, billingIntervalTo, createdAt</i>
|
|
410
410
|
* @param {string} [search] To search the list by any field, pass search=xxx to fetch the result.
|
|
411
411
|
* @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.<br/> <br/> <i>Allowed values: invoiceNumber, status, netAmount, grossAmount, createdAt, dueDate, id</i>
|
|
412
|
-
* @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/> <i>Allowed values: statuses, payments<i>
|
|
412
|
+
* @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/> <i>Allowed values: statuses, payments, invoiceItems<i>
|
|
413
413
|
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: code, policyCode, invoiceNumber, id, type, accountNumber, status, billingIntervalFrom, billingIntervalTo, createdAt</i>
|
|
414
414
|
* @param {*} [options] Override http request option.
|
|
415
415
|
* @throws {RequiredError}
|
|
@@ -543,7 +543,7 @@ export interface InvoicesApiListInvoicesRequest {
|
|
|
543
543
|
readonly order?: string
|
|
544
544
|
|
|
545
545
|
/**
|
|
546
|
-
* Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/> <i>Allowed values: statuses, payments<i>
|
|
546
|
+
* Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/> <i>Allowed values: statuses, payments, invoiceItems<i>
|
|
547
547
|
* @type {string}
|
|
548
548
|
* @memberof InvoicesApiListInvoices
|
|
549
549
|
*/
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* EMIL BillingService
|
|
5
|
+
* The EMIL BillingService API description
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0
|
|
8
|
+
* Contact: kontakt@emil.de
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
17
|
+
import { Configuration } from '../configuration';
|
|
18
|
+
// Some imports not used depending on template conditions
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
|
|
21
|
+
// @ts-ignore
|
|
22
|
+
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
import { CreateInvoiceForPolicyRequestDto } from '../models';
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
import { CreateInvoiceResponseClass } from '../models';
|
|
27
|
+
/**
|
|
28
|
+
* TerminationInvoicesApi - axios parameter creator
|
|
29
|
+
* @export
|
|
30
|
+
*/
|
|
31
|
+
export const TerminationInvoicesApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
32
|
+
return {
|
|
33
|
+
/**
|
|
34
|
+
* This will create termination invoice. It will be generated on a cyclical basis during the lifetime of a policy. **Required Permissions** \"billing-management.invoices.create\"
|
|
35
|
+
* @summary Create the Termination invoice
|
|
36
|
+
* @param {CreateInvoiceForPolicyRequestDto} createInvoiceForPolicyRequestDto
|
|
37
|
+
* @param {string} [authorization] Bearer Token
|
|
38
|
+
* @param {string} [idempotencyKey] Idempotency Key used to make the request idempotent. The key should be unique. Usually, a generated v4 UUID is enough.
|
|
39
|
+
* @param {*} [options] Override http request option.
|
|
40
|
+
* @throws {RequiredError}
|
|
41
|
+
*/
|
|
42
|
+
createTerminationInvoice: async (createInvoiceForPolicyRequestDto: CreateInvoiceForPolicyRequestDto, authorization?: string, idempotencyKey?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
43
|
+
// verify required parameter 'createInvoiceForPolicyRequestDto' is not null or undefined
|
|
44
|
+
assertParamExists('createTerminationInvoice', 'createInvoiceForPolicyRequestDto', createInvoiceForPolicyRequestDto)
|
|
45
|
+
const localVarPath = `/billingservice/v1/termination-invoices`;
|
|
46
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
47
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
48
|
+
let baseOptions;
|
|
49
|
+
let baseAccessToken;
|
|
50
|
+
if (configuration) {
|
|
51
|
+
baseOptions = configuration.baseOptions;
|
|
52
|
+
baseAccessToken = configuration.accessToken;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
|
56
|
+
const localVarHeaderParameter = {} as any;
|
|
57
|
+
const localVarQueryParameter = {} as any;
|
|
58
|
+
|
|
59
|
+
// authentication bearer required
|
|
60
|
+
// http bearer authentication required
|
|
61
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
62
|
+
|
|
63
|
+
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
64
|
+
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (idempotencyKey !== undefined && idempotencyKey !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
68
|
+
localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey ? idempotencyKey : baseAccessToken);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
74
|
+
|
|
75
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
76
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
77
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
78
|
+
localVarRequestOptions.data = serializeDataIfNeeded(createInvoiceForPolicyRequestDto, localVarRequestOptions, configuration)
|
|
79
|
+
|
|
80
|
+
return {
|
|
81
|
+
url: toPathString(localVarUrlObj),
|
|
82
|
+
options: localVarRequestOptions,
|
|
83
|
+
};
|
|
84
|
+
},
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* TerminationInvoicesApi - functional programming interface
|
|
90
|
+
* @export
|
|
91
|
+
*/
|
|
92
|
+
export const TerminationInvoicesApiFp = function(configuration?: Configuration) {
|
|
93
|
+
const localVarAxiosParamCreator = TerminationInvoicesApiAxiosParamCreator(configuration)
|
|
94
|
+
return {
|
|
95
|
+
/**
|
|
96
|
+
* This will create termination invoice. It will be generated on a cyclical basis during the lifetime of a policy. **Required Permissions** \"billing-management.invoices.create\"
|
|
97
|
+
* @summary Create the Termination invoice
|
|
98
|
+
* @param {CreateInvoiceForPolicyRequestDto} createInvoiceForPolicyRequestDto
|
|
99
|
+
* @param {string} [authorization] Bearer Token
|
|
100
|
+
* @param {string} [idempotencyKey] Idempotency Key used to make the request idempotent. The key should be unique. Usually, a generated v4 UUID is enough.
|
|
101
|
+
* @param {*} [options] Override http request option.
|
|
102
|
+
* @throws {RequiredError}
|
|
103
|
+
*/
|
|
104
|
+
async createTerminationInvoice(createInvoiceForPolicyRequestDto: CreateInvoiceForPolicyRequestDto, authorization?: string, idempotencyKey?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateInvoiceResponseClass>> {
|
|
105
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.createTerminationInvoice(createInvoiceForPolicyRequestDto, authorization, idempotencyKey, options);
|
|
106
|
+
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
107
|
+
},
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* TerminationInvoicesApi - factory interface
|
|
113
|
+
* @export
|
|
114
|
+
*/
|
|
115
|
+
export const TerminationInvoicesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
116
|
+
const localVarFp = TerminationInvoicesApiFp(configuration)
|
|
117
|
+
return {
|
|
118
|
+
/**
|
|
119
|
+
* This will create termination invoice. It will be generated on a cyclical basis during the lifetime of a policy. **Required Permissions** \"billing-management.invoices.create\"
|
|
120
|
+
* @summary Create the Termination invoice
|
|
121
|
+
* @param {CreateInvoiceForPolicyRequestDto} createInvoiceForPolicyRequestDto
|
|
122
|
+
* @param {string} [authorization] Bearer Token
|
|
123
|
+
* @param {string} [idempotencyKey] Idempotency Key used to make the request idempotent. The key should be unique. Usually, a generated v4 UUID is enough.
|
|
124
|
+
* @param {*} [options] Override http request option.
|
|
125
|
+
* @throws {RequiredError}
|
|
126
|
+
*/
|
|
127
|
+
createTerminationInvoice(createInvoiceForPolicyRequestDto: CreateInvoiceForPolicyRequestDto, authorization?: string, idempotencyKey?: string, options?: any): AxiosPromise<CreateInvoiceResponseClass> {
|
|
128
|
+
return localVarFp.createTerminationInvoice(createInvoiceForPolicyRequestDto, authorization, idempotencyKey, options).then((request) => request(axios, basePath));
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Request parameters for createTerminationInvoice operation in TerminationInvoicesApi.
|
|
135
|
+
* @export
|
|
136
|
+
* @interface TerminationInvoicesApiCreateTerminationInvoiceRequest
|
|
137
|
+
*/
|
|
138
|
+
export interface TerminationInvoicesApiCreateTerminationInvoiceRequest {
|
|
139
|
+
/**
|
|
140
|
+
*
|
|
141
|
+
* @type {CreateInvoiceForPolicyRequestDto}
|
|
142
|
+
* @memberof TerminationInvoicesApiCreateTerminationInvoice
|
|
143
|
+
*/
|
|
144
|
+
readonly createInvoiceForPolicyRequestDto: CreateInvoiceForPolicyRequestDto
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Bearer Token
|
|
148
|
+
* @type {string}
|
|
149
|
+
* @memberof TerminationInvoicesApiCreateTerminationInvoice
|
|
150
|
+
*/
|
|
151
|
+
readonly authorization?: string
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Idempotency Key used to make the request idempotent. The key should be unique. Usually, a generated v4 UUID is enough.
|
|
155
|
+
* @type {string}
|
|
156
|
+
* @memberof TerminationInvoicesApiCreateTerminationInvoice
|
|
157
|
+
*/
|
|
158
|
+
readonly idempotencyKey?: string
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* TerminationInvoicesApi - object-oriented interface
|
|
163
|
+
* @export
|
|
164
|
+
* @class TerminationInvoicesApi
|
|
165
|
+
* @extends {BaseAPI}
|
|
166
|
+
*/
|
|
167
|
+
export class TerminationInvoicesApi extends BaseAPI {
|
|
168
|
+
/**
|
|
169
|
+
* This will create termination invoice. It will be generated on a cyclical basis during the lifetime of a policy. **Required Permissions** \"billing-management.invoices.create\"
|
|
170
|
+
* @summary Create the Termination invoice
|
|
171
|
+
* @param {TerminationInvoicesApiCreateTerminationInvoiceRequest} requestParameters Request parameters.
|
|
172
|
+
* @param {*} [options] Override http request option.
|
|
173
|
+
* @throws {RequiredError}
|
|
174
|
+
* @memberof TerminationInvoicesApi
|
|
175
|
+
*/
|
|
176
|
+
public createTerminationInvoice(requestParameters: TerminationInvoicesApiCreateTerminationInvoiceRequest, options?: AxiosRequestConfig) {
|
|
177
|
+
return TerminationInvoicesApiFp(this.configuration).createTerminationInvoice(requestParameters.createInvoiceForPolicyRequestDto, requestParameters.authorization, requestParameters.idempotencyKey, options).then((request) => request(this.axios, this.basePath));
|
|
178
|
+
}
|
|
179
|
+
}
|
package/api.ts
CHANGED
|
@@ -28,6 +28,7 @@ import { InitialInvoicesApi } from './api';
|
|
|
28
28
|
import { InvoicesApi } from './api';
|
|
29
29
|
import { PolicyBillingApi } from './api';
|
|
30
30
|
import { RecurringInvoicesApi } from './api';
|
|
31
|
+
import { TerminationInvoicesApi } from './api';
|
|
31
32
|
|
|
32
33
|
|
|
33
34
|
export * from './api/correction-invoices-api';
|
|
@@ -38,4 +39,5 @@ export * from './api/initial-invoices-api';
|
|
|
38
39
|
export * from './api/invoices-api';
|
|
39
40
|
export * from './api/policy-billing-api';
|
|
40
41
|
export * from './api/recurring-invoices-api';
|
|
42
|
+
export * from './api/termination-invoices-api';
|
|
41
43
|
|
package/base.ts
CHANGED
|
@@ -37,6 +37,16 @@ export interface LoginClass {
|
|
|
37
37
|
permissions: string;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
export interface SwitchWorkspaceRequest {
|
|
41
|
+
username: string;
|
|
42
|
+
targetWorkspace: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface SwitchWorkspaceResponseClass {
|
|
46
|
+
accessToken: string;
|
|
47
|
+
permissions: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
40
50
|
export enum Environment {
|
|
41
51
|
Production = 'https://apiv2.emil.de',
|
|
42
52
|
Test = 'https://apiv2-test.emil.de',
|
|
@@ -119,7 +129,7 @@ export class BaseAPI {
|
|
|
119
129
|
return this.tokenData.permissions.split(',');
|
|
120
130
|
}
|
|
121
131
|
|
|
122
|
-
async authorize(username: string, password: string): Promise<void> {
|
|
132
|
+
async authorize(username: string, password: string, targetWorkspace?: string): Promise<void> {
|
|
123
133
|
const options: AxiosRequestConfig = {
|
|
124
134
|
method: 'POST',
|
|
125
135
|
url: `${this.configuration.basePath}/authservice/v1/login`,
|
|
@@ -141,6 +151,40 @@ export class BaseAPI {
|
|
|
141
151
|
this.tokenData.accessToken = accessToken;
|
|
142
152
|
this.tokenData.permissions = permissions;
|
|
143
153
|
|
|
154
|
+
// Switch workspace if provided
|
|
155
|
+
if (targetWorkspace) {
|
|
156
|
+
await this.switchWorkspace(targetWorkspace);
|
|
157
|
+
} else {
|
|
158
|
+
// Only store if no workspace switch (since switchWorkspace will store after switching)
|
|
159
|
+
this.storeTokenData({
|
|
160
|
+
...this.tokenData
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
async switchWorkspace(targetWorkspace: string): Promise<void> {
|
|
166
|
+
const options: AxiosRequestConfig = {
|
|
167
|
+
method: 'POST',
|
|
168
|
+
url: `${this.configuration.basePath}/authservice/v1/workspaces/switch`,
|
|
169
|
+
headers: {
|
|
170
|
+
'Content-Type': 'application/json',
|
|
171
|
+
'Authorization': `Bearer ${this.configuration.accessToken}`,
|
|
172
|
+
},
|
|
173
|
+
data: {
|
|
174
|
+
username: this.configuration.username,
|
|
175
|
+
targetWorkspace,
|
|
176
|
+
} as SwitchWorkspaceRequest,
|
|
177
|
+
withCredentials: true,
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
const response = await globalAxios.request<SwitchWorkspaceResponseClass>(options);
|
|
181
|
+
|
|
182
|
+
const { data: { accessToken, permissions } } = response;
|
|
183
|
+
|
|
184
|
+
this.configuration.accessToken = `Bearer ${accessToken}`;
|
|
185
|
+
this.tokenData.accessToken = accessToken;
|
|
186
|
+
this.tokenData.permissions = permissions;
|
|
187
|
+
|
|
144
188
|
this.storeTokenData({
|
|
145
189
|
...this.tokenData
|
|
146
190
|
});
|
|
@@ -51,7 +51,7 @@ export declare const InvoicesApiAxiosParamCreator: (configuration?: Configuratio
|
|
|
51
51
|
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: code, policyCode, invoiceNumber, id, type, accountNumber, status, billingIntervalFrom, billingIntervalTo, createdAt</i>
|
|
52
52
|
* @param {string} [search] To search the list by any field, pass search=xxx to fetch the result.
|
|
53
53
|
* @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.<br/> <br/> <i>Allowed values: invoiceNumber, status, netAmount, grossAmount, createdAt, dueDate, id</i>
|
|
54
|
-
* @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/> <i>Allowed values: statuses, payments<i>
|
|
54
|
+
* @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/> <i>Allowed values: statuses, payments, invoiceItems<i>
|
|
55
55
|
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: code, policyCode, invoiceNumber, id, type, accountNumber, status, billingIntervalFrom, billingIntervalTo, createdAt</i>
|
|
56
56
|
* @param {*} [options] Override http request option.
|
|
57
57
|
* @throws {RequiredError}
|
|
@@ -108,7 +108,7 @@ export declare const InvoicesApiFp: (configuration?: Configuration) => {
|
|
|
108
108
|
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: code, policyCode, invoiceNumber, id, type, accountNumber, status, billingIntervalFrom, billingIntervalTo, createdAt</i>
|
|
109
109
|
* @param {string} [search] To search the list by any field, pass search=xxx to fetch the result.
|
|
110
110
|
* @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.<br/> <br/> <i>Allowed values: invoiceNumber, status, netAmount, grossAmount, createdAt, dueDate, id</i>
|
|
111
|
-
* @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/> <i>Allowed values: statuses, payments<i>
|
|
111
|
+
* @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/> <i>Allowed values: statuses, payments, invoiceItems<i>
|
|
112
112
|
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: code, policyCode, invoiceNumber, id, type, accountNumber, status, billingIntervalFrom, billingIntervalTo, createdAt</i>
|
|
113
113
|
* @param {*} [options] Override http request option.
|
|
114
114
|
* @throws {RequiredError}
|
|
@@ -165,7 +165,7 @@ export declare const InvoicesApiFactory: (configuration?: Configuration, basePat
|
|
|
165
165
|
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: code, policyCode, invoiceNumber, id, type, accountNumber, status, billingIntervalFrom, billingIntervalTo, createdAt</i>
|
|
166
166
|
* @param {string} [search] To search the list by any field, pass search=xxx to fetch the result.
|
|
167
167
|
* @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.<br/> <br/> <i>Allowed values: invoiceNumber, status, netAmount, grossAmount, createdAt, dueDate, id</i>
|
|
168
|
-
* @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/> <i>Allowed values: statuses, payments<i>
|
|
168
|
+
* @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/> <i>Allowed values: statuses, payments, invoiceItems<i>
|
|
169
169
|
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: code, policyCode, invoiceNumber, id, type, accountNumber, status, billingIntervalFrom, billingIntervalTo, createdAt</i>
|
|
170
170
|
* @param {*} [options] Override http request option.
|
|
171
171
|
* @throws {RequiredError}
|
|
@@ -281,7 +281,7 @@ export interface InvoicesApiListInvoicesRequest {
|
|
|
281
281
|
*/
|
|
282
282
|
readonly order?: string;
|
|
283
283
|
/**
|
|
284
|
-
* Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/> <i>Allowed values: statuses, payments<i>
|
|
284
|
+
* Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/> <i>Allowed values: statuses, payments, invoiceItems<i>
|
|
285
285
|
* @type {string}
|
|
286
286
|
* @memberof InvoicesApiListInvoices
|
|
287
287
|
*/
|
package/dist/api/invoices-api.js
CHANGED
|
@@ -208,7 +208,7 @@ var InvoicesApiAxiosParamCreator = function (configuration) {
|
|
|
208
208
|
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: code, policyCode, invoiceNumber, id, type, accountNumber, status, billingIntervalFrom, billingIntervalTo, createdAt</i>
|
|
209
209
|
* @param {string} [search] To search the list by any field, pass search=xxx to fetch the result.
|
|
210
210
|
* @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.<br/> <br/> <i>Allowed values: invoiceNumber, status, netAmount, grossAmount, createdAt, dueDate, id</i>
|
|
211
|
-
* @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/> <i>Allowed values: statuses, payments<i>
|
|
211
|
+
* @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/> <i>Allowed values: statuses, payments, invoiceItems<i>
|
|
212
212
|
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: code, policyCode, invoiceNumber, id, type, accountNumber, status, billingIntervalFrom, billingIntervalTo, createdAt</i>
|
|
213
213
|
* @param {*} [options] Override http request option.
|
|
214
214
|
* @throws {RequiredError}
|
|
@@ -407,7 +407,7 @@ var InvoicesApiFp = function (configuration) {
|
|
|
407
407
|
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: code, policyCode, invoiceNumber, id, type, accountNumber, status, billingIntervalFrom, billingIntervalTo, createdAt</i>
|
|
408
408
|
* @param {string} [search] To search the list by any field, pass search=xxx to fetch the result.
|
|
409
409
|
* @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.<br/> <br/> <i>Allowed values: invoiceNumber, status, netAmount, grossAmount, createdAt, dueDate, id</i>
|
|
410
|
-
* @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/> <i>Allowed values: statuses, payments<i>
|
|
410
|
+
* @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/> <i>Allowed values: statuses, payments, invoiceItems<i>
|
|
411
411
|
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: code, policyCode, invoiceNumber, id, type, accountNumber, status, billingIntervalFrom, billingIntervalTo, createdAt</i>
|
|
412
412
|
* @param {*} [options] Override http request option.
|
|
413
413
|
* @throws {RequiredError}
|
|
@@ -496,7 +496,7 @@ var InvoicesApiFactory = function (configuration, basePath, axios) {
|
|
|
496
496
|
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: code, policyCode, invoiceNumber, id, type, accountNumber, status, billingIntervalFrom, billingIntervalTo, createdAt</i>
|
|
497
497
|
* @param {string} [search] To search the list by any field, pass search=xxx to fetch the result.
|
|
498
498
|
* @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.<br/> <br/> <i>Allowed values: invoiceNumber, status, netAmount, grossAmount, createdAt, dueDate, id</i>
|
|
499
|
-
* @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/> <i>Allowed values: statuses, payments<i>
|
|
499
|
+
* @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/> <i>Allowed values: statuses, payments, invoiceItems<i>
|
|
500
500
|
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: code, policyCode, invoiceNumber, id, type, accountNumber, status, billingIntervalFrom, billingIntervalTo, createdAt</i>
|
|
501
501
|
* @param {*} [options] Override http request option.
|
|
502
502
|
* @throws {RequiredError}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EMIL BillingService
|
|
3
|
+
* The EMIL BillingService 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 { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
13
|
+
import { Configuration } from '../configuration';
|
|
14
|
+
import { RequestArgs, BaseAPI } from '../base';
|
|
15
|
+
import { CreateInvoiceForPolicyRequestDto } from '../models';
|
|
16
|
+
import { CreateInvoiceResponseClass } from '../models';
|
|
17
|
+
/**
|
|
18
|
+
* TerminationInvoicesApi - axios parameter creator
|
|
19
|
+
* @export
|
|
20
|
+
*/
|
|
21
|
+
export declare const TerminationInvoicesApiAxiosParamCreator: (configuration?: Configuration) => {
|
|
22
|
+
/**
|
|
23
|
+
* This will create termination invoice. It will be generated on a cyclical basis during the lifetime of a policy. **Required Permissions** \"billing-management.invoices.create\"
|
|
24
|
+
* @summary Create the Termination invoice
|
|
25
|
+
* @param {CreateInvoiceForPolicyRequestDto} createInvoiceForPolicyRequestDto
|
|
26
|
+
* @param {string} [authorization] Bearer Token
|
|
27
|
+
* @param {string} [idempotencyKey] Idempotency Key used to make the request idempotent. The key should be unique. Usually, a generated v4 UUID is enough.
|
|
28
|
+
* @param {*} [options] Override http request option.
|
|
29
|
+
* @throws {RequiredError}
|
|
30
|
+
*/
|
|
31
|
+
createTerminationInvoice: (createInvoiceForPolicyRequestDto: CreateInvoiceForPolicyRequestDto, authorization?: string, idempotencyKey?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* TerminationInvoicesApi - functional programming interface
|
|
35
|
+
* @export
|
|
36
|
+
*/
|
|
37
|
+
export declare const TerminationInvoicesApiFp: (configuration?: Configuration) => {
|
|
38
|
+
/**
|
|
39
|
+
* This will create termination invoice. It will be generated on a cyclical basis during the lifetime of a policy. **Required Permissions** \"billing-management.invoices.create\"
|
|
40
|
+
* @summary Create the Termination invoice
|
|
41
|
+
* @param {CreateInvoiceForPolicyRequestDto} createInvoiceForPolicyRequestDto
|
|
42
|
+
* @param {string} [authorization] Bearer Token
|
|
43
|
+
* @param {string} [idempotencyKey] Idempotency Key used to make the request idempotent. The key should be unique. Usually, a generated v4 UUID is enough.
|
|
44
|
+
* @param {*} [options] Override http request option.
|
|
45
|
+
* @throws {RequiredError}
|
|
46
|
+
*/
|
|
47
|
+
createTerminationInvoice(createInvoiceForPolicyRequestDto: CreateInvoiceForPolicyRequestDto, authorization?: string, idempotencyKey?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateInvoiceResponseClass>>;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* TerminationInvoicesApi - factory interface
|
|
51
|
+
* @export
|
|
52
|
+
*/
|
|
53
|
+
export declare const TerminationInvoicesApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
|
|
54
|
+
/**
|
|
55
|
+
* This will create termination invoice. It will be generated on a cyclical basis during the lifetime of a policy. **Required Permissions** \"billing-management.invoices.create\"
|
|
56
|
+
* @summary Create the Termination invoice
|
|
57
|
+
* @param {CreateInvoiceForPolicyRequestDto} createInvoiceForPolicyRequestDto
|
|
58
|
+
* @param {string} [authorization] Bearer Token
|
|
59
|
+
* @param {string} [idempotencyKey] Idempotency Key used to make the request idempotent. The key should be unique. Usually, a generated v4 UUID is enough.
|
|
60
|
+
* @param {*} [options] Override http request option.
|
|
61
|
+
* @throws {RequiredError}
|
|
62
|
+
*/
|
|
63
|
+
createTerminationInvoice(createInvoiceForPolicyRequestDto: CreateInvoiceForPolicyRequestDto, authorization?: string, idempotencyKey?: string, options?: any): AxiosPromise<CreateInvoiceResponseClass>;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Request parameters for createTerminationInvoice operation in TerminationInvoicesApi.
|
|
67
|
+
* @export
|
|
68
|
+
* @interface TerminationInvoicesApiCreateTerminationInvoiceRequest
|
|
69
|
+
*/
|
|
70
|
+
export interface TerminationInvoicesApiCreateTerminationInvoiceRequest {
|
|
71
|
+
/**
|
|
72
|
+
*
|
|
73
|
+
* @type {CreateInvoiceForPolicyRequestDto}
|
|
74
|
+
* @memberof TerminationInvoicesApiCreateTerminationInvoice
|
|
75
|
+
*/
|
|
76
|
+
readonly createInvoiceForPolicyRequestDto: CreateInvoiceForPolicyRequestDto;
|
|
77
|
+
/**
|
|
78
|
+
* Bearer Token
|
|
79
|
+
* @type {string}
|
|
80
|
+
* @memberof TerminationInvoicesApiCreateTerminationInvoice
|
|
81
|
+
*/
|
|
82
|
+
readonly authorization?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Idempotency Key used to make the request idempotent. The key should be unique. Usually, a generated v4 UUID is enough.
|
|
85
|
+
* @type {string}
|
|
86
|
+
* @memberof TerminationInvoicesApiCreateTerminationInvoice
|
|
87
|
+
*/
|
|
88
|
+
readonly idempotencyKey?: string;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* TerminationInvoicesApi - object-oriented interface
|
|
92
|
+
* @export
|
|
93
|
+
* @class TerminationInvoicesApi
|
|
94
|
+
* @extends {BaseAPI}
|
|
95
|
+
*/
|
|
96
|
+
export declare class TerminationInvoicesApi extends BaseAPI {
|
|
97
|
+
/**
|
|
98
|
+
* This will create termination invoice. It will be generated on a cyclical basis during the lifetime of a policy. **Required Permissions** \"billing-management.invoices.create\"
|
|
99
|
+
* @summary Create the Termination invoice
|
|
100
|
+
* @param {TerminationInvoicesApiCreateTerminationInvoiceRequest} requestParameters Request parameters.
|
|
101
|
+
* @param {*} [options] Override http request option.
|
|
102
|
+
* @throws {RequiredError}
|
|
103
|
+
* @memberof TerminationInvoicesApi
|
|
104
|
+
*/
|
|
105
|
+
createTerminationInvoice(requestParameters: TerminationInvoicesApiCreateTerminationInvoiceRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateInvoiceResponseClass, any>>;
|
|
106
|
+
}
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* EMIL BillingService
|
|
6
|
+
* The EMIL BillingService 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.TerminationInvoicesApi = exports.TerminationInvoicesApiFactory = exports.TerminationInvoicesApiFp = exports.TerminationInvoicesApiAxiosParamCreator = void 0;
|
|
82
|
+
var axios_1 = __importDefault(require("axios"));
|
|
83
|
+
// Some imports not used depending on template conditions
|
|
84
|
+
// @ts-ignore
|
|
85
|
+
var common_1 = require("../common");
|
|
86
|
+
// @ts-ignore
|
|
87
|
+
var base_1 = require("../base");
|
|
88
|
+
/**
|
|
89
|
+
* TerminationInvoicesApi - axios parameter creator
|
|
90
|
+
* @export
|
|
91
|
+
*/
|
|
92
|
+
var TerminationInvoicesApiAxiosParamCreator = function (configuration) {
|
|
93
|
+
var _this = this;
|
|
94
|
+
return {
|
|
95
|
+
/**
|
|
96
|
+
* This will create termination invoice. It will be generated on a cyclical basis during the lifetime of a policy. **Required Permissions** \"billing-management.invoices.create\"
|
|
97
|
+
* @summary Create the Termination invoice
|
|
98
|
+
* @param {CreateInvoiceForPolicyRequestDto} createInvoiceForPolicyRequestDto
|
|
99
|
+
* @param {string} [authorization] Bearer Token
|
|
100
|
+
* @param {string} [idempotencyKey] Idempotency Key used to make the request idempotent. The key should be unique. Usually, a generated v4 UUID is enough.
|
|
101
|
+
* @param {*} [options] Override http request option.
|
|
102
|
+
* @throws {RequiredError}
|
|
103
|
+
*/
|
|
104
|
+
createTerminationInvoice: function (createInvoiceForPolicyRequestDto, authorization, idempotencyKey, options) {
|
|
105
|
+
if (options === void 0) { options = {}; }
|
|
106
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
107
|
+
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
108
|
+
return __generator(this, function (_a) {
|
|
109
|
+
switch (_a.label) {
|
|
110
|
+
case 0:
|
|
111
|
+
// verify required parameter 'createInvoiceForPolicyRequestDto' is not null or undefined
|
|
112
|
+
(0, common_1.assertParamExists)('createTerminationInvoice', 'createInvoiceForPolicyRequestDto', createInvoiceForPolicyRequestDto);
|
|
113
|
+
localVarPath = "/billingservice/v1/termination-invoices";
|
|
114
|
+
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
115
|
+
if (configuration) {
|
|
116
|
+
baseOptions = configuration.baseOptions;
|
|
117
|
+
baseAccessToken = configuration.accessToken;
|
|
118
|
+
}
|
|
119
|
+
localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
|
|
120
|
+
localVarHeaderParameter = {};
|
|
121
|
+
localVarQueryParameter = {};
|
|
122
|
+
// authentication bearer required
|
|
123
|
+
// http bearer authentication required
|
|
124
|
+
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
|
|
125
|
+
case 1:
|
|
126
|
+
// authentication bearer required
|
|
127
|
+
// http bearer authentication required
|
|
128
|
+
_a.sent();
|
|
129
|
+
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
130
|
+
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
131
|
+
}
|
|
132
|
+
if (idempotencyKey !== undefined && idempotencyKey !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
133
|
+
localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey ? idempotencyKey : baseAccessToken);
|
|
134
|
+
}
|
|
135
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
136
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
137
|
+
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
138
|
+
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
139
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createInvoiceForPolicyRequestDto, localVarRequestOptions, configuration);
|
|
140
|
+
return [2 /*return*/, {
|
|
141
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
142
|
+
options: localVarRequestOptions,
|
|
143
|
+
}];
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
exports.TerminationInvoicesApiAxiosParamCreator = TerminationInvoicesApiAxiosParamCreator;
|
|
151
|
+
/**
|
|
152
|
+
* TerminationInvoicesApi - functional programming interface
|
|
153
|
+
* @export
|
|
154
|
+
*/
|
|
155
|
+
var TerminationInvoicesApiFp = function (configuration) {
|
|
156
|
+
var localVarAxiosParamCreator = (0, exports.TerminationInvoicesApiAxiosParamCreator)(configuration);
|
|
157
|
+
return {
|
|
158
|
+
/**
|
|
159
|
+
* This will create termination invoice. It will be generated on a cyclical basis during the lifetime of a policy. **Required Permissions** \"billing-management.invoices.create\"
|
|
160
|
+
* @summary Create the Termination invoice
|
|
161
|
+
* @param {CreateInvoiceForPolicyRequestDto} createInvoiceForPolicyRequestDto
|
|
162
|
+
* @param {string} [authorization] Bearer Token
|
|
163
|
+
* @param {string} [idempotencyKey] Idempotency Key used to make the request idempotent. The key should be unique. Usually, a generated v4 UUID is enough.
|
|
164
|
+
* @param {*} [options] Override http request option.
|
|
165
|
+
* @throws {RequiredError}
|
|
166
|
+
*/
|
|
167
|
+
createTerminationInvoice: function (createInvoiceForPolicyRequestDto, authorization, idempotencyKey, options) {
|
|
168
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
169
|
+
var localVarAxiosArgs;
|
|
170
|
+
return __generator(this, function (_a) {
|
|
171
|
+
switch (_a.label) {
|
|
172
|
+
case 0: return [4 /*yield*/, localVarAxiosParamCreator.createTerminationInvoice(createInvoiceForPolicyRequestDto, authorization, idempotencyKey, options)];
|
|
173
|
+
case 1:
|
|
174
|
+
localVarAxiosArgs = _a.sent();
|
|
175
|
+
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
});
|
|
179
|
+
},
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
exports.TerminationInvoicesApiFp = TerminationInvoicesApiFp;
|
|
183
|
+
/**
|
|
184
|
+
* TerminationInvoicesApi - factory interface
|
|
185
|
+
* @export
|
|
186
|
+
*/
|
|
187
|
+
var TerminationInvoicesApiFactory = function (configuration, basePath, axios) {
|
|
188
|
+
var localVarFp = (0, exports.TerminationInvoicesApiFp)(configuration);
|
|
189
|
+
return {
|
|
190
|
+
/**
|
|
191
|
+
* This will create termination invoice. It will be generated on a cyclical basis during the lifetime of a policy. **Required Permissions** \"billing-management.invoices.create\"
|
|
192
|
+
* @summary Create the Termination invoice
|
|
193
|
+
* @param {CreateInvoiceForPolicyRequestDto} createInvoiceForPolicyRequestDto
|
|
194
|
+
* @param {string} [authorization] Bearer Token
|
|
195
|
+
* @param {string} [idempotencyKey] Idempotency Key used to make the request idempotent. The key should be unique. Usually, a generated v4 UUID is enough.
|
|
196
|
+
* @param {*} [options] Override http request option.
|
|
197
|
+
* @throws {RequiredError}
|
|
198
|
+
*/
|
|
199
|
+
createTerminationInvoice: function (createInvoiceForPolicyRequestDto, authorization, idempotencyKey, options) {
|
|
200
|
+
return localVarFp.createTerminationInvoice(createInvoiceForPolicyRequestDto, authorization, idempotencyKey, options).then(function (request) { return request(axios, basePath); });
|
|
201
|
+
},
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
exports.TerminationInvoicesApiFactory = TerminationInvoicesApiFactory;
|
|
205
|
+
/**
|
|
206
|
+
* TerminationInvoicesApi - object-oriented interface
|
|
207
|
+
* @export
|
|
208
|
+
* @class TerminationInvoicesApi
|
|
209
|
+
* @extends {BaseAPI}
|
|
210
|
+
*/
|
|
211
|
+
var TerminationInvoicesApi = /** @class */ (function (_super) {
|
|
212
|
+
__extends(TerminationInvoicesApi, _super);
|
|
213
|
+
function TerminationInvoicesApi() {
|
|
214
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* This will create termination invoice. It will be generated on a cyclical basis during the lifetime of a policy. **Required Permissions** \"billing-management.invoices.create\"
|
|
218
|
+
* @summary Create the Termination invoice
|
|
219
|
+
* @param {TerminationInvoicesApiCreateTerminationInvoiceRequest} requestParameters Request parameters.
|
|
220
|
+
* @param {*} [options] Override http request option.
|
|
221
|
+
* @throws {RequiredError}
|
|
222
|
+
* @memberof TerminationInvoicesApi
|
|
223
|
+
*/
|
|
224
|
+
TerminationInvoicesApi.prototype.createTerminationInvoice = function (requestParameters, options) {
|
|
225
|
+
var _this = this;
|
|
226
|
+
return (0, exports.TerminationInvoicesApiFp)(this.configuration).createTerminationInvoice(requestParameters.createInvoiceForPolicyRequestDto, requestParameters.authorization, requestParameters.idempotencyKey, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
227
|
+
};
|
|
228
|
+
return TerminationInvoicesApi;
|
|
229
|
+
}(base_1.BaseAPI));
|
|
230
|
+
exports.TerminationInvoicesApi = TerminationInvoicesApi;
|
package/dist/api.d.ts
CHANGED
package/dist/api.js
CHANGED
|
@@ -35,3 +35,4 @@ __exportStar(require("./api/initial-invoices-api"), exports);
|
|
|
35
35
|
__exportStar(require("./api/invoices-api"), exports);
|
|
36
36
|
__exportStar(require("./api/policy-billing-api"), exports);
|
|
37
37
|
__exportStar(require("./api/recurring-invoices-api"), exports);
|
|
38
|
+
__exportStar(require("./api/termination-invoices-api"), exports);
|
package/dist/base.d.ts
CHANGED
|
@@ -26,6 +26,14 @@ export interface LoginClass {
|
|
|
26
26
|
accessToken: string;
|
|
27
27
|
permissions: string;
|
|
28
28
|
}
|
|
29
|
+
export interface SwitchWorkspaceRequest {
|
|
30
|
+
username: string;
|
|
31
|
+
targetWorkspace: string;
|
|
32
|
+
}
|
|
33
|
+
export interface SwitchWorkspaceResponseClass {
|
|
34
|
+
accessToken: string;
|
|
35
|
+
permissions: string;
|
|
36
|
+
}
|
|
29
37
|
export declare enum Environment {
|
|
30
38
|
Production = "https://apiv2.emil.de",
|
|
31
39
|
Test = "https://apiv2-test.emil.de",
|
|
@@ -57,7 +65,8 @@ export declare class BaseAPI {
|
|
|
57
65
|
selectEnvironment(env: Environment): void;
|
|
58
66
|
selectBasePath(path: string): void;
|
|
59
67
|
getPermissions(): Array<string>;
|
|
60
|
-
authorize(username: string, password: string): Promise<void>;
|
|
68
|
+
authorize(username: string, password: string, targetWorkspace?: string): Promise<void>;
|
|
69
|
+
switchWorkspace(targetWorkspace: string): Promise<void>;
|
|
61
70
|
refreshTokenInternal(): Promise<LoginClass>;
|
|
62
71
|
private storeTokenData;
|
|
63
72
|
loadTokenData(): void;
|
package/dist/base.js
CHANGED
|
@@ -151,7 +151,7 @@ var BaseAPI = /** @class */ (function () {
|
|
|
151
151
|
}
|
|
152
152
|
return this.tokenData.permissions.split(',');
|
|
153
153
|
};
|
|
154
|
-
BaseAPI.prototype.authorize = function (username, password) {
|
|
154
|
+
BaseAPI.prototype.authorize = function (username, password, targetWorkspace) {
|
|
155
155
|
return __awaiter(this, void 0, void 0, function () {
|
|
156
156
|
var options, response, _a, accessToken, permissions;
|
|
157
157
|
return __generator(this, function (_b) {
|
|
@@ -176,6 +176,46 @@ var BaseAPI = /** @class */ (function () {
|
|
|
176
176
|
this.tokenData.username = username;
|
|
177
177
|
this.tokenData.accessToken = accessToken;
|
|
178
178
|
this.tokenData.permissions = permissions;
|
|
179
|
+
if (!targetWorkspace) return [3 /*break*/, 3];
|
|
180
|
+
return [4 /*yield*/, this.switchWorkspace(targetWorkspace)];
|
|
181
|
+
case 2:
|
|
182
|
+
_b.sent();
|
|
183
|
+
return [3 /*break*/, 4];
|
|
184
|
+
case 3:
|
|
185
|
+
// Only store if no workspace switch (since switchWorkspace will store after switching)
|
|
186
|
+
this.storeTokenData(__assign({}, this.tokenData));
|
|
187
|
+
_b.label = 4;
|
|
188
|
+
case 4: return [2 /*return*/];
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
};
|
|
193
|
+
BaseAPI.prototype.switchWorkspace = function (targetWorkspace) {
|
|
194
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
195
|
+
var options, response, _a, accessToken, permissions;
|
|
196
|
+
return __generator(this, function (_b) {
|
|
197
|
+
switch (_b.label) {
|
|
198
|
+
case 0:
|
|
199
|
+
options = {
|
|
200
|
+
method: 'POST',
|
|
201
|
+
url: "".concat(this.configuration.basePath, "/authservice/v1/workspaces/switch"),
|
|
202
|
+
headers: {
|
|
203
|
+
'Content-Type': 'application/json',
|
|
204
|
+
'Authorization': "Bearer ".concat(this.configuration.accessToken),
|
|
205
|
+
},
|
|
206
|
+
data: {
|
|
207
|
+
username: this.configuration.username,
|
|
208
|
+
targetWorkspace: targetWorkspace,
|
|
209
|
+
},
|
|
210
|
+
withCredentials: true,
|
|
211
|
+
};
|
|
212
|
+
return [4 /*yield*/, axios_1.default.request(options)];
|
|
213
|
+
case 1:
|
|
214
|
+
response = _b.sent();
|
|
215
|
+
_a = response.data, accessToken = _a.accessToken, permissions = _a.permissions;
|
|
216
|
+
this.configuration.accessToken = "Bearer ".concat(accessToken);
|
|
217
|
+
this.tokenData.accessToken = accessToken;
|
|
218
|
+
this.tokenData.permissions = permissions;
|
|
179
219
|
this.storeTokenData(__assign({}, this.tokenData));
|
|
180
220
|
return [2 /*return*/];
|
|
181
221
|
}
|
|
@@ -51,4 +51,10 @@ export interface CreateTerminationInvoiceRequestDto {
|
|
|
51
51
|
* @memberof CreateTerminationInvoiceRequestDto
|
|
52
52
|
*/
|
|
53
53
|
'policyNumber': string;
|
|
54
|
+
/**
|
|
55
|
+
*
|
|
56
|
+
* @type {string}
|
|
57
|
+
* @memberof CreateTerminationInvoiceRequestDto
|
|
58
|
+
*/
|
|
59
|
+
'invoiceNumber': string;
|
|
54
60
|
}
|
|
@@ -56,5 +56,11 @@ export interface CreateTerminationInvoiceRequestDto {
|
|
|
56
56
|
* @memberof CreateTerminationInvoiceRequestDto
|
|
57
57
|
*/
|
|
58
58
|
'policyNumber': string;
|
|
59
|
+
/**
|
|
60
|
+
*
|
|
61
|
+
* @type {string}
|
|
62
|
+
* @memberof CreateTerminationInvoiceRequestDto
|
|
63
|
+
*/
|
|
64
|
+
'invoiceNumber': string;
|
|
59
65
|
}
|
|
60
66
|
|