@emilgroup/billing-sdk-node 1.48.1-beta.0 → 1.48.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.
@@ -11,6 +11,7 @@ api/initial-invoices-api.ts
11
11
  api/invoices-api.ts
12
12
  api/policy-billing-api.ts
13
13
  api/recurring-invoices-api.ts
14
+ api/termination-invoices-api.ts
14
15
  base.ts
15
16
  common.ts
16
17
  configuration.ts
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-node@1.48.1-beta.0 --save
20
+ npm install @emilgroup/billing-sdk-node@1.48.1-beta.10 --save
21
21
  ```
22
22
  or
23
23
  ```
24
- yarn add @emilgroup/billing-sdk-node@1.48.1-beta.0
24
+ yarn add @emilgroup/billing-sdk-node@1.48.1-beta.10
25
25
  ```
26
26
 
27
27
  And then you can import `InvoicesApi`.
@@ -153,7 +153,7 @@ export const InvoicesApiAxiosParamCreator = function (configuration?: Configurat
153
153
  * @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>
154
154
  * @param {string} [search] To search the list by any field, pass search=xxx to fetch the result.
155
155
  * @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>
156
- * @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>
156
+ * @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>
157
157
  * @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>
158
158
  * @param {*} [options] Override http request option.
159
159
  * @throws {RequiredError}
@@ -342,7 +342,7 @@ export const InvoicesApiFp = function(configuration?: Configuration) {
342
342
  * @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>
343
343
  * @param {string} [search] To search the list by any field, pass search=xxx to fetch the result.
344
344
  * @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>
345
- * @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>
345
+ * @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>
346
346
  * @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>
347
347
  * @param {*} [options] Override http request option.
348
348
  * @throws {RequiredError}
@@ -413,7 +413,7 @@ export const InvoicesApiFactory = function (configuration?: Configuration, baseP
413
413
  * @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>
414
414
  * @param {string} [search] To search the list by any field, pass search=xxx to fetch the result.
415
415
  * @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>
416
- * @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>
416
+ * @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>
417
417
  * @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>
418
418
  * @param {*} [options] Override http request option.
419
419
  * @throws {RequiredError}
@@ -547,7 +547,7 @@ export interface InvoicesApiListInvoicesRequest {
547
547
  readonly order?: string
548
548
 
549
549
  /**
550
- * 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>
550
+ * 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>
551
551
  * @type {string}
552
552
  * @memberof InvoicesApiListInvoices
553
553
  */
@@ -0,0 +1,183 @@
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
+ // URLSearchParams not necessarily used
28
+ // @ts-ignore
29
+ import { URL, URLSearchParams } from 'url';
30
+ const FormData = require('form-data');
31
+ /**
32
+ * TerminationInvoicesApi - axios parameter creator
33
+ * @export
34
+ */
35
+ export const TerminationInvoicesApiAxiosParamCreator = function (configuration?: Configuration) {
36
+ return {
37
+ /**
38
+ * 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\"
39
+ * @summary Create the Termination invoice
40
+ * @param {CreateInvoiceForPolicyRequestDto} createInvoiceForPolicyRequestDto
41
+ * @param {string} [authorization] Bearer Token
42
+ * @param {string} [idempotencyKey] Idempotency Key used to make the request idempotent. The key should be unique. Usually, a generated v4 UUID is enough.
43
+ * @param {*} [options] Override http request option.
44
+ * @throws {RequiredError}
45
+ */
46
+ createTerminationInvoice: async (createInvoiceForPolicyRequestDto: CreateInvoiceForPolicyRequestDto, authorization?: string, idempotencyKey?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
47
+ // verify required parameter 'createInvoiceForPolicyRequestDto' is not null or undefined
48
+ assertParamExists('createTerminationInvoice', 'createInvoiceForPolicyRequestDto', createInvoiceForPolicyRequestDto)
49
+ const localVarPath = `/billingservice/v1/termination-invoices`;
50
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
51
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
52
+ let baseOptions;
53
+ let baseAccessToken;
54
+ if (configuration) {
55
+ baseOptions = configuration.baseOptions;
56
+ baseAccessToken = configuration.accessToken;
57
+ }
58
+
59
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
60
+ const localVarHeaderParameter = {} as any;
61
+ const localVarQueryParameter = {} as any;
62
+
63
+ // authentication bearer required
64
+ // http bearer authentication required
65
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
66
+
67
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
68
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
69
+ }
70
+
71
+ if (idempotencyKey !== undefined && idempotencyKey !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
72
+ localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey ? idempotencyKey : baseAccessToken);
73
+ }
74
+
75
+
76
+
77
+ localVarHeaderParameter['Content-Type'] = 'application/json';
78
+
79
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
80
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
81
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
82
+ localVarRequestOptions.data = serializeDataIfNeeded(createInvoiceForPolicyRequestDto, localVarRequestOptions, configuration)
83
+
84
+ return {
85
+ url: toPathString(localVarUrlObj),
86
+ options: localVarRequestOptions,
87
+ };
88
+ },
89
+ }
90
+ };
91
+
92
+ /**
93
+ * TerminationInvoicesApi - functional programming interface
94
+ * @export
95
+ */
96
+ export const TerminationInvoicesApiFp = function(configuration?: Configuration) {
97
+ const localVarAxiosParamCreator = TerminationInvoicesApiAxiosParamCreator(configuration)
98
+ return {
99
+ /**
100
+ * 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\"
101
+ * @summary Create the Termination invoice
102
+ * @param {CreateInvoiceForPolicyRequestDto} createInvoiceForPolicyRequestDto
103
+ * @param {string} [authorization] Bearer Token
104
+ * @param {string} [idempotencyKey] Idempotency Key used to make the request idempotent. The key should be unique. Usually, a generated v4 UUID is enough.
105
+ * @param {*} [options] Override http request option.
106
+ * @throws {RequiredError}
107
+ */
108
+ async createTerminationInvoice(createInvoiceForPolicyRequestDto: CreateInvoiceForPolicyRequestDto, authorization?: string, idempotencyKey?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateInvoiceResponseClass>> {
109
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createTerminationInvoice(createInvoiceForPolicyRequestDto, authorization, idempotencyKey, options);
110
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
111
+ },
112
+ }
113
+ };
114
+
115
+ /**
116
+ * TerminationInvoicesApi - factory interface
117
+ * @export
118
+ */
119
+ export const TerminationInvoicesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
120
+ const localVarFp = TerminationInvoicesApiFp(configuration)
121
+ return {
122
+ /**
123
+ * 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\"
124
+ * @summary Create the Termination invoice
125
+ * @param {CreateInvoiceForPolicyRequestDto} createInvoiceForPolicyRequestDto
126
+ * @param {string} [authorization] Bearer Token
127
+ * @param {string} [idempotencyKey] Idempotency Key used to make the request idempotent. The key should be unique. Usually, a generated v4 UUID is enough.
128
+ * @param {*} [options] Override http request option.
129
+ * @throws {RequiredError}
130
+ */
131
+ createTerminationInvoice(createInvoiceForPolicyRequestDto: CreateInvoiceForPolicyRequestDto, authorization?: string, idempotencyKey?: string, options?: any): AxiosPromise<CreateInvoiceResponseClass> {
132
+ return localVarFp.createTerminationInvoice(createInvoiceForPolicyRequestDto, authorization, idempotencyKey, options).then((request) => request(axios, basePath));
133
+ },
134
+ };
135
+ };
136
+
137
+ /**
138
+ * Request parameters for createTerminationInvoice operation in TerminationInvoicesApi.
139
+ * @export
140
+ * @interface TerminationInvoicesApiCreateTerminationInvoiceRequest
141
+ */
142
+ export interface TerminationInvoicesApiCreateTerminationInvoiceRequest {
143
+ /**
144
+ *
145
+ * @type {CreateInvoiceForPolicyRequestDto}
146
+ * @memberof TerminationInvoicesApiCreateTerminationInvoice
147
+ */
148
+ readonly createInvoiceForPolicyRequestDto: CreateInvoiceForPolicyRequestDto
149
+
150
+ /**
151
+ * Bearer Token
152
+ * @type {string}
153
+ * @memberof TerminationInvoicesApiCreateTerminationInvoice
154
+ */
155
+ readonly authorization?: string
156
+
157
+ /**
158
+ * Idempotency Key used to make the request idempotent. The key should be unique. Usually, a generated v4 UUID is enough.
159
+ * @type {string}
160
+ * @memberof TerminationInvoicesApiCreateTerminationInvoice
161
+ */
162
+ readonly idempotencyKey?: string
163
+ }
164
+
165
+ /**
166
+ * TerminationInvoicesApi - object-oriented interface
167
+ * @export
168
+ * @class TerminationInvoicesApi
169
+ * @extends {BaseAPI}
170
+ */
171
+ export class TerminationInvoicesApi extends BaseAPI {
172
+ /**
173
+ * 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\"
174
+ * @summary Create the Termination invoice
175
+ * @param {TerminationInvoicesApiCreateTerminationInvoiceRequest} requestParameters Request parameters.
176
+ * @param {*} [options] Override http request option.
177
+ * @throws {RequiredError}
178
+ * @memberof TerminationInvoicesApi
179
+ */
180
+ public createTerminationInvoice(requestParameters: TerminationInvoicesApiCreateTerminationInvoiceRequest, options?: AxiosRequestConfig) {
181
+ return TerminationInvoicesApiFp(this.configuration).createTerminationInvoice(requestParameters.createInvoiceForPolicyRequestDto, requestParameters.authorization, requestParameters.idempotencyKey, options).then((request) => request(this.axios, this.basePath));
182
+ }
183
+ }
package/api.ts CHANGED
@@ -32,6 +32,7 @@ import { InitialInvoicesApi } from './api';
32
32
  import { InvoicesApi } from './api';
33
33
  import { PolicyBillingApi } from './api';
34
34
  import { RecurringInvoicesApi } from './api';
35
+ import { TerminationInvoicesApi } from './api';
35
36
 
36
37
 
37
38
  export * from './api/correction-invoices-api';
@@ -42,4 +43,5 @@ export * from './api/initial-invoices-api';
42
43
  export * from './api/invoices-api';
43
44
  export * from './api/policy-billing-api';
44
45
  export * from './api/recurring-invoices-api';
46
+ export * from './api/termination-invoices-api';
45
47
 
package/base.ts CHANGED
@@ -44,6 +44,16 @@ export interface LoginClass {
44
44
  permissions: string;
45
45
  }
46
46
 
47
+ export interface SwitchWorkspaceRequest {
48
+ username: string;
49
+ targetWorkspace: string;
50
+ }
51
+
52
+ export interface SwitchWorkspaceResponseClass {
53
+ accessToken: string;
54
+ permissions: string;
55
+ }
56
+
47
57
  export enum Environment {
48
58
  Production = 'https://apiv2.emil.de',
49
59
  Test = 'https://apiv2-test.emil.de',
@@ -94,13 +104,13 @@ export class BaseAPI {
94
104
  this.attachInterceptor(axios);
95
105
  }
96
106
 
97
- async initialize(env: Environment = Environment.Production) {
107
+ async initialize(env: Environment = Environment.Production, targetWorkspace?: string) {
98
108
  this.configuration.basePath = env;
99
109
 
100
110
  await this.loadCredentials();
101
111
 
102
112
  if (this.username) {
103
- await this.authorize(this.username, this.password);
113
+ await this.authorize(this.username, this.password, targetWorkspace);
104
114
  this.password = null; // to avoid keeping password loaded in memory.
105
115
  }
106
116
  }
@@ -150,7 +160,7 @@ export class BaseAPI {
150
160
  this.configuration.basePath = env;
151
161
  }
152
162
 
153
- async authorize(username: string, password: string): Promise<void> {
163
+ async authorize(username: string, password: string, targetWorkspace?: string): Promise<void> {
154
164
  const options: AxiosRequestConfig = {
155
165
  method: 'POST',
156
166
  url: `${this.configuration.basePath}/authservice/v1/login`,
@@ -170,6 +180,38 @@ export class BaseAPI {
170
180
 
171
181
  const refreshToken = this.extractRefreshToken(response)
172
182
  this.configuration.refreshToken = refreshToken;
183
+
184
+ // Switch workspace if provided
185
+ if (targetWorkspace) {
186
+ await this.switchWorkspace(targetWorkspace);
187
+ }
188
+ }
189
+
190
+ async switchWorkspace(targetWorkspace: string): Promise<void> {
191
+ const options: AxiosRequestConfig = {
192
+ method: 'POST',
193
+ url: `${this.configuration.basePath}/authservice/v1/workspaces/switch`,
194
+ headers: {
195
+ 'Content-Type': 'application/json',
196
+ 'Authorization': `Bearer ${this.configuration.accessToken}`,
197
+ 'Cookie': this.configuration.refreshToken,
198
+ },
199
+ data: {
200
+ username: this.configuration.username,
201
+ targetWorkspace,
202
+ } as SwitchWorkspaceRequest,
203
+ withCredentials: true,
204
+ };
205
+
206
+ const response = await globalAxios.request<SwitchWorkspaceResponseClass>(options);
207
+
208
+ const { data: { accessToken } } = response;
209
+ this.configuration.accessToken = `Bearer ${accessToken}`;
210
+
211
+ const refreshToken = this.extractRefreshToken(response);
212
+ if (refreshToken) {
213
+ this.configuration.refreshToken = refreshToken;
214
+ }
173
215
  }
174
216
 
175
217
  async refreshTokenInternal(): Promise<string> {
@@ -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.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: code, policyCode, invoiceNumber, id, type, accountNumber, status, billingIntervalFrom, billingIntervalTo, createdAt&lt;/i&gt;
52
52
  * @param {string} [search] To search the list by any field, pass search&#x3D;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.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: invoiceNumber, status, netAmount, grossAmount, createdAt, dueDate, id&lt;/i&gt;
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.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: statuses, payments&lt;i&gt;
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.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: statuses, payments, invoiceItems&lt;i&gt;
55
55
  * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: code, policyCode, invoiceNumber, id, type, accountNumber, status, billingIntervalFrom, billingIntervalTo, createdAt&lt;/i&gt;
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.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: code, policyCode, invoiceNumber, id, type, accountNumber, status, billingIntervalFrom, billingIntervalTo, createdAt&lt;/i&gt;
109
109
  * @param {string} [search] To search the list by any field, pass search&#x3D;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.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: invoiceNumber, status, netAmount, grossAmount, createdAt, dueDate, id&lt;/i&gt;
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.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: statuses, payments&lt;i&gt;
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.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: statuses, payments, invoiceItems&lt;i&gt;
112
112
  * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: code, policyCode, invoiceNumber, id, type, accountNumber, status, billingIntervalFrom, billingIntervalTo, createdAt&lt;/i&gt;
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.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: code, policyCode, invoiceNumber, id, type, accountNumber, status, billingIntervalFrom, billingIntervalTo, createdAt&lt;/i&gt;
166
166
  * @param {string} [search] To search the list by any field, pass search&#x3D;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.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: invoiceNumber, status, netAmount, grossAmount, createdAt, dueDate, id&lt;/i&gt;
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.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: statuses, payments&lt;i&gt;
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.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: statuses, payments, invoiceItems&lt;i&gt;
169
169
  * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: code, policyCode, invoiceNumber, id, type, accountNumber, status, billingIntervalFrom, billingIntervalTo, createdAt&lt;/i&gt;
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.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: statuses, payments&lt;i&gt;
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.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: statuses, payments, invoiceItems&lt;i&gt;
285
285
  * @type {string}
286
286
  * @memberof InvoicesApiListInvoices
287
287
  */
@@ -212,7 +212,7 @@ var InvoicesApiAxiosParamCreator = function (configuration) {
212
212
  * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: code, policyCode, invoiceNumber, id, type, accountNumber, status, billingIntervalFrom, billingIntervalTo, createdAt&lt;/i&gt;
213
213
  * @param {string} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
214
214
  * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: invoiceNumber, status, netAmount, grossAmount, createdAt, dueDate, id&lt;/i&gt;
215
- * @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.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: statuses, payments&lt;i&gt;
215
+ * @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.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: statuses, payments, invoiceItems&lt;i&gt;
216
216
  * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: code, policyCode, invoiceNumber, id, type, accountNumber, status, billingIntervalFrom, billingIntervalTo, createdAt&lt;/i&gt;
217
217
  * @param {*} [options] Override http request option.
218
218
  * @throws {RequiredError}
@@ -411,7 +411,7 @@ var InvoicesApiFp = function (configuration) {
411
411
  * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: code, policyCode, invoiceNumber, id, type, accountNumber, status, billingIntervalFrom, billingIntervalTo, createdAt&lt;/i&gt;
412
412
  * @param {string} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
413
413
  * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: invoiceNumber, status, netAmount, grossAmount, createdAt, dueDate, id&lt;/i&gt;
414
- * @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.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: statuses, payments&lt;i&gt;
414
+ * @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.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: statuses, payments, invoiceItems&lt;i&gt;
415
415
  * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: code, policyCode, invoiceNumber, id, type, accountNumber, status, billingIntervalFrom, billingIntervalTo, createdAt&lt;/i&gt;
416
416
  * @param {*} [options] Override http request option.
417
417
  * @throws {RequiredError}
@@ -500,7 +500,7 @@ var InvoicesApiFactory = function (configuration, basePath, axios) {
500
500
  * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: code, policyCode, invoiceNumber, id, type, accountNumber, status, billingIntervalFrom, billingIntervalTo, createdAt&lt;/i&gt;
501
501
  * @param {string} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
502
502
  * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: invoiceNumber, status, netAmount, grossAmount, createdAt, dueDate, id&lt;/i&gt;
503
- * @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.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: statuses, payments&lt;i&gt;
503
+ * @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.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: statuses, payments, invoiceItems&lt;i&gt;
504
504
  * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: code, policyCode, invoiceNumber, id, type, accountNumber, status, billingIntervalFrom, billingIntervalTo, createdAt&lt;/i&gt;
505
505
  * @param {*} [options] Override http request option.
506
506
  * @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,234 @@
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
+ // URLSearchParams not necessarily used
89
+ // @ts-ignore
90
+ var url_1 = require("url");
91
+ var FormData = require('form-data');
92
+ /**
93
+ * TerminationInvoicesApi - axios parameter creator
94
+ * @export
95
+ */
96
+ var TerminationInvoicesApiAxiosParamCreator = function (configuration) {
97
+ var _this = this;
98
+ return {
99
+ /**
100
+ * 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\"
101
+ * @summary Create the Termination invoice
102
+ * @param {CreateInvoiceForPolicyRequestDto} createInvoiceForPolicyRequestDto
103
+ * @param {string} [authorization] Bearer Token
104
+ * @param {string} [idempotencyKey] Idempotency Key used to make the request idempotent. The key should be unique. Usually, a generated v4 UUID is enough.
105
+ * @param {*} [options] Override http request option.
106
+ * @throws {RequiredError}
107
+ */
108
+ createTerminationInvoice: function (createInvoiceForPolicyRequestDto, authorization, idempotencyKey, options) {
109
+ if (options === void 0) { options = {}; }
110
+ return __awaiter(_this, void 0, void 0, function () {
111
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
112
+ return __generator(this, function (_a) {
113
+ switch (_a.label) {
114
+ case 0:
115
+ // verify required parameter 'createInvoiceForPolicyRequestDto' is not null or undefined
116
+ (0, common_1.assertParamExists)('createTerminationInvoice', 'createInvoiceForPolicyRequestDto', createInvoiceForPolicyRequestDto);
117
+ localVarPath = "/billingservice/v1/termination-invoices";
118
+ localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
119
+ if (configuration) {
120
+ baseOptions = configuration.baseOptions;
121
+ baseAccessToken = configuration.accessToken;
122
+ }
123
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
124
+ localVarHeaderParameter = {};
125
+ localVarQueryParameter = {};
126
+ // authentication bearer required
127
+ // http bearer authentication required
128
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
129
+ case 1:
130
+ // authentication bearer required
131
+ // http bearer authentication required
132
+ _a.sent();
133
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
134
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
135
+ }
136
+ if (idempotencyKey !== undefined && idempotencyKey !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
137
+ localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey ? idempotencyKey : baseAccessToken);
138
+ }
139
+ localVarHeaderParameter['Content-Type'] = 'application/json';
140
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
141
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
142
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
143
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createInvoiceForPolicyRequestDto, localVarRequestOptions, configuration);
144
+ return [2 /*return*/, {
145
+ url: (0, common_1.toPathString)(localVarUrlObj),
146
+ options: localVarRequestOptions,
147
+ }];
148
+ }
149
+ });
150
+ });
151
+ },
152
+ };
153
+ };
154
+ exports.TerminationInvoicesApiAxiosParamCreator = TerminationInvoicesApiAxiosParamCreator;
155
+ /**
156
+ * TerminationInvoicesApi - functional programming interface
157
+ * @export
158
+ */
159
+ var TerminationInvoicesApiFp = function (configuration) {
160
+ var localVarAxiosParamCreator = (0, exports.TerminationInvoicesApiAxiosParamCreator)(configuration);
161
+ return {
162
+ /**
163
+ * 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\"
164
+ * @summary Create the Termination invoice
165
+ * @param {CreateInvoiceForPolicyRequestDto} createInvoiceForPolicyRequestDto
166
+ * @param {string} [authorization] Bearer Token
167
+ * @param {string} [idempotencyKey] Idempotency Key used to make the request idempotent. The key should be unique. Usually, a generated v4 UUID is enough.
168
+ * @param {*} [options] Override http request option.
169
+ * @throws {RequiredError}
170
+ */
171
+ createTerminationInvoice: function (createInvoiceForPolicyRequestDto, authorization, idempotencyKey, options) {
172
+ return __awaiter(this, void 0, void 0, function () {
173
+ var localVarAxiosArgs;
174
+ return __generator(this, function (_a) {
175
+ switch (_a.label) {
176
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.createTerminationInvoice(createInvoiceForPolicyRequestDto, authorization, idempotencyKey, options)];
177
+ case 1:
178
+ localVarAxiosArgs = _a.sent();
179
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
180
+ }
181
+ });
182
+ });
183
+ },
184
+ };
185
+ };
186
+ exports.TerminationInvoicesApiFp = TerminationInvoicesApiFp;
187
+ /**
188
+ * TerminationInvoicesApi - factory interface
189
+ * @export
190
+ */
191
+ var TerminationInvoicesApiFactory = function (configuration, basePath, axios) {
192
+ var localVarFp = (0, exports.TerminationInvoicesApiFp)(configuration);
193
+ return {
194
+ /**
195
+ * 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\"
196
+ * @summary Create the Termination invoice
197
+ * @param {CreateInvoiceForPolicyRequestDto} createInvoiceForPolicyRequestDto
198
+ * @param {string} [authorization] Bearer Token
199
+ * @param {string} [idempotencyKey] Idempotency Key used to make the request idempotent. The key should be unique. Usually, a generated v4 UUID is enough.
200
+ * @param {*} [options] Override http request option.
201
+ * @throws {RequiredError}
202
+ */
203
+ createTerminationInvoice: function (createInvoiceForPolicyRequestDto, authorization, idempotencyKey, options) {
204
+ return localVarFp.createTerminationInvoice(createInvoiceForPolicyRequestDto, authorization, idempotencyKey, options).then(function (request) { return request(axios, basePath); });
205
+ },
206
+ };
207
+ };
208
+ exports.TerminationInvoicesApiFactory = TerminationInvoicesApiFactory;
209
+ /**
210
+ * TerminationInvoicesApi - object-oriented interface
211
+ * @export
212
+ * @class TerminationInvoicesApi
213
+ * @extends {BaseAPI}
214
+ */
215
+ var TerminationInvoicesApi = /** @class */ (function (_super) {
216
+ __extends(TerminationInvoicesApi, _super);
217
+ function TerminationInvoicesApi() {
218
+ return _super !== null && _super.apply(this, arguments) || this;
219
+ }
220
+ /**
221
+ * 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\"
222
+ * @summary Create the Termination invoice
223
+ * @param {TerminationInvoicesApiCreateTerminationInvoiceRequest} requestParameters Request parameters.
224
+ * @param {*} [options] Override http request option.
225
+ * @throws {RequiredError}
226
+ * @memberof TerminationInvoicesApi
227
+ */
228
+ TerminationInvoicesApi.prototype.createTerminationInvoice = function (requestParameters, options) {
229
+ var _this = this;
230
+ return (0, exports.TerminationInvoicesApiFp)(this.configuration).createTerminationInvoice(requestParameters.createInvoiceForPolicyRequestDto, requestParameters.authorization, requestParameters.idempotencyKey, options).then(function (request) { return request(_this.axios, _this.basePath); });
231
+ };
232
+ return TerminationInvoicesApi;
233
+ }(base_1.BaseAPI));
234
+ exports.TerminationInvoicesApi = TerminationInvoicesApi;
package/dist/api.d.ts CHANGED
@@ -17,3 +17,4 @@ export * from './api/initial-invoices-api';
17
17
  export * from './api/invoices-api';
18
18
  export * from './api/policy-billing-api';
19
19
  export * from './api/recurring-invoices-api';
20
+ export * from './api/termination-invoices-api';
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",
@@ -55,12 +63,13 @@ export declare class BaseAPI {
55
63
  private username?;
56
64
  private password?;
57
65
  constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
58
- initialize(env?: Environment): Promise<void>;
66
+ initialize(env?: Environment, targetWorkspace?: string): Promise<void>;
59
67
  private loadCredentials;
60
68
  private readConfigFile;
61
69
  private readEnvVariables;
62
70
  selectEnvironment(env: Environment): void;
63
- authorize(username: string, password: string): Promise<void>;
71
+ authorize(username: string, password: string, targetWorkspace?: string): Promise<void>;
72
+ switchWorkspace(targetWorkspace: string): Promise<void>;
64
73
  refreshTokenInternal(): Promise<string>;
65
74
  private extractRefreshToken;
66
75
  getConfiguration(): Configuration;
package/dist/base.js CHANGED
@@ -162,7 +162,7 @@ var BaseAPI = /** @class */ (function () {
162
162
  }
163
163
  this.attachInterceptor(axios);
164
164
  }
165
- BaseAPI.prototype.initialize = function (env) {
165
+ BaseAPI.prototype.initialize = function (env, targetWorkspace) {
166
166
  if (env === void 0) { env = Environment.Production; }
167
167
  return __awaiter(this, void 0, void 0, function () {
168
168
  return __generator(this, function (_a) {
@@ -173,7 +173,7 @@ var BaseAPI = /** @class */ (function () {
173
173
  case 1:
174
174
  _a.sent();
175
175
  if (!this.username) return [3 /*break*/, 3];
176
- return [4 /*yield*/, this.authorize(this.username, this.password)];
176
+ return [4 /*yield*/, this.authorize(this.username, this.password, targetWorkspace)];
177
177
  case 2:
178
178
  _a.sent();
179
179
  this.password = null; // to avoid keeping password loaded in memory.
@@ -243,7 +243,7 @@ var BaseAPI = /** @class */ (function () {
243
243
  BaseAPI.prototype.selectEnvironment = function (env) {
244
244
  this.configuration.basePath = env;
245
245
  };
246
- BaseAPI.prototype.authorize = function (username, password) {
246
+ BaseAPI.prototype.authorize = function (username, password, targetWorkspace) {
247
247
  return __awaiter(this, void 0, void 0, function () {
248
248
  var options, response, accessToken, refreshToken;
249
249
  return __generator(this, function (_a) {
@@ -267,6 +267,45 @@ var BaseAPI = /** @class */ (function () {
267
267
  this.configuration.accessToken = "Bearer ".concat(accessToken);
268
268
  refreshToken = this.extractRefreshToken(response);
269
269
  this.configuration.refreshToken = refreshToken;
270
+ if (!targetWorkspace) return [3 /*break*/, 3];
271
+ return [4 /*yield*/, this.switchWorkspace(targetWorkspace)];
272
+ case 2:
273
+ _a.sent();
274
+ _a.label = 3;
275
+ case 3: return [2 /*return*/];
276
+ }
277
+ });
278
+ });
279
+ };
280
+ BaseAPI.prototype.switchWorkspace = function (targetWorkspace) {
281
+ return __awaiter(this, void 0, void 0, function () {
282
+ var options, response, accessToken, refreshToken;
283
+ return __generator(this, function (_a) {
284
+ switch (_a.label) {
285
+ case 0:
286
+ options = {
287
+ method: 'POST',
288
+ url: "".concat(this.configuration.basePath, "/authservice/v1/workspaces/switch"),
289
+ headers: {
290
+ 'Content-Type': 'application/json',
291
+ 'Authorization': "Bearer ".concat(this.configuration.accessToken),
292
+ 'Cookie': this.configuration.refreshToken,
293
+ },
294
+ data: {
295
+ username: this.configuration.username,
296
+ targetWorkspace: targetWorkspace,
297
+ },
298
+ withCredentials: true,
299
+ };
300
+ return [4 /*yield*/, axios_1.default.request(options)];
301
+ case 1:
302
+ response = _a.sent();
303
+ accessToken = response.data.accessToken;
304
+ this.configuration.accessToken = "Bearer ".concat(accessToken);
305
+ refreshToken = this.extractRefreshToken(response);
306
+ if (refreshToken) {
307
+ this.configuration.refreshToken = refreshToken;
308
+ }
270
309
  return [2 /*return*/];
271
310
  }
272
311
  });
@@ -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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emilgroup/billing-sdk-node",
3
- "version": "1.48.1-beta.0",
3
+ "version": "1.48.1-beta.10",
4
4
  "description": "OpenAPI client for @emilgroup/billing-sdk-node",
5
5
  "author": "OpenAPI-Generator Contributors",
6
6
  "keywords": [