@emilgroup/billing-sdk-node 1.63.1-beta.28 → 1.63.1-beta.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/.openapi-generator/FILES +3 -0
  2. package/README.md +2 -2
  3. package/api/correction-invoices-api.ts +12 -6
  4. package/api/draft-invoice-api.ts +12 -6
  5. package/api/estimated-invoices-api.ts +16 -8
  6. package/api/initial-invoices-api.ts +8 -4
  7. package/api/invoices-api.ts +20 -10
  8. package/api/policy-billing-api.ts +12 -6
  9. package/api/recurring-invoices-api.ts +8 -4
  10. package/api/termination-invoices-api.ts +8 -4
  11. package/api/withdraw-invoices-api.ts +187 -0
  12. package/api.ts +2 -0
  13. package/common.ts +3 -2
  14. package/dist/api/correction-invoices-api.d.ts +2 -2
  15. package/dist/api/correction-invoices-api.js +17 -10
  16. package/dist/api/draft-invoice-api.d.ts +3 -3
  17. package/dist/api/draft-invoice-api.js +21 -12
  18. package/dist/api/estimated-invoices-api.d.ts +4 -4
  19. package/dist/api/estimated-invoices-api.js +28 -16
  20. package/dist/api/health-api.d.ts +1 -1
  21. package/dist/api/initial-invoices-api.d.ts +1 -1
  22. package/dist/api/initial-invoices-api.js +10 -6
  23. package/dist/api/invoices-api.d.ts +4 -4
  24. package/dist/api/invoices-api.js +22 -15
  25. package/dist/api/policy-billing-api.d.ts +3 -3
  26. package/dist/api/policy-billing-api.js +18 -11
  27. package/dist/api/recurring-invoices-api.d.ts +1 -1
  28. package/dist/api/recurring-invoices-api.js +10 -6
  29. package/dist/api/termination-invoices-api.d.ts +1 -1
  30. package/dist/api/termination-invoices-api.js +10 -6
  31. package/dist/api/withdraw-invoices-api.d.ts +106 -0
  32. package/dist/api/withdraw-invoices-api.js +238 -0
  33. package/dist/api.d.ts +1 -0
  34. package/dist/api.js +1 -0
  35. package/dist/common.d.ts +1 -1
  36. package/dist/common.js +1 -0
  37. package/dist/models/create-withdraw-invoice-request-dto-rest.d.ts +50 -0
  38. package/dist/models/create-withdraw-invoice-request-dto-rest.js +15 -0
  39. package/dist/models/create-withdraw-invoice-request-dto.d.ts +50 -0
  40. package/dist/models/create-withdraw-invoice-request-dto.js +15 -0
  41. package/dist/models/index.d.ts +2 -0
  42. package/dist/models/index.js +2 -0
  43. package/dist/models/invoice-item-class.d.ts +6 -0
  44. package/models/create-withdraw-invoice-request-dto-rest.ts +54 -0
  45. package/models/create-withdraw-invoice-request-dto.ts +54 -0
  46. package/models/index.ts +2 -0
  47. package/models/invoice-item-class.ts +6 -0
  48. package/package.json +2 -2
@@ -12,6 +12,7 @@ api/invoices-api.ts
12
12
  api/policy-billing-api.ts
13
13
  api/recurring-invoices-api.ts
14
14
  api/termination-invoices-api.ts
15
+ api/withdraw-invoices-api.ts
15
16
  base.ts
16
17
  common.ts
17
18
  configuration.ts
@@ -36,6 +37,8 @@ models/create-policy-billing-response-class.ts
36
37
  models/create-product-estimated-invoice-request-dto.ts
37
38
  models/create-product-estimated-invoice-response-class.ts
38
39
  models/create-termination-invoice-request-dto.ts
40
+ models/create-withdraw-invoice-request-dto-rest.ts
41
+ models/create-withdraw-invoice-request-dto.ts
39
42
  models/get-invoice-response-class.ts
40
43
  models/index.ts
41
44
  models/inline-response200.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.63.1-beta.28 --save
20
+ npm install @emilgroup/billing-sdk-node@1.63.1-beta.31 --save
21
21
  ```
22
22
  or
23
23
  ```
24
- yarn add @emilgroup/billing-sdk-node@1.63.1-beta.28
24
+ yarn add @emilgroup/billing-sdk-node@1.63.1-beta.31
25
25
  ```
26
26
 
27
27
  And then you can import `InvoicesApi`.
@@ -68,12 +68,16 @@ export const CorrectionInvoicesApiAxiosParamCreator = function (configuration?:
68
68
  // http bearer authentication required
69
69
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
70
70
 
71
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
72
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
71
+ // Only Authorization falls back to the configured token; an empty value is never sent.
72
+ const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
73
+ if (authorizationValue) {
74
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
73
75
  }
74
76
 
75
- if (idempotencyKey !== undefined && idempotencyKey !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
76
- localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey ? idempotencyKey : baseAccessToken);
77
+ // Only Authorization falls back to the configured token; an empty value is never sent.
78
+ const idempotencyKeyValue = 'Idempotency-Key'.toLowerCase() === 'authorization' ? (idempotencyKey || baseAccessToken) : idempotencyKey;
79
+ if (idempotencyKeyValue) {
80
+ localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKeyValue);
77
81
  }
78
82
 
79
83
 
@@ -118,8 +122,10 @@ export const CorrectionInvoicesApiAxiosParamCreator = function (configuration?:
118
122
  // http bearer authentication required
119
123
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
120
124
 
121
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
122
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
125
+ // Only Authorization falls back to the configured token; an empty value is never sent.
126
+ const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
127
+ if (authorizationValue) {
128
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
123
129
  }
124
130
 
125
131
 
@@ -60,8 +60,10 @@ export const DraftInvoiceApiAxiosParamCreator = function (configuration?: Config
60
60
  // http bearer authentication required
61
61
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
62
62
 
63
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
64
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
63
+ // Only Authorization falls back to the configured token; an empty value is never sent.
64
+ const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
65
+ if (authorizationValue) {
66
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
65
67
  }
66
68
 
67
69
 
@@ -103,8 +105,10 @@ export const DraftInvoiceApiAxiosParamCreator = function (configuration?: Config
103
105
  // http bearer authentication required
104
106
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
105
107
 
106
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
107
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
108
+ // Only Authorization falls back to the configured token; an empty value is never sent.
109
+ const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
110
+ if (authorizationValue) {
111
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
108
112
  }
109
113
 
110
114
 
@@ -146,8 +150,10 @@ export const DraftInvoiceApiAxiosParamCreator = function (configuration?: Config
146
150
  // http bearer authentication required
147
151
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
148
152
 
149
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
150
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
153
+ // Only Authorization falls back to the configured token; an empty value is never sent.
154
+ const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
155
+ if (authorizationValue) {
156
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
151
157
  }
152
158
 
153
159
 
@@ -75,8 +75,10 @@ export const EstimatedInvoicesApiAxiosParamCreator = function (configuration?: C
75
75
  // http bearer authentication required
76
76
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
77
77
 
78
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
79
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
78
+ // Only Authorization falls back to the configured token; an empty value is never sent.
79
+ const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
80
+ if (authorizationValue) {
81
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
80
82
  }
81
83
 
82
84
 
@@ -122,8 +124,10 @@ export const EstimatedInvoicesApiAxiosParamCreator = function (configuration?: C
122
124
  // http bearer authentication required
123
125
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
124
126
 
125
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
126
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
127
+ // Only Authorization falls back to the configured token; an empty value is never sent.
128
+ const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
129
+ if (authorizationValue) {
130
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
127
131
  }
128
132
 
129
133
 
@@ -169,8 +173,10 @@ export const EstimatedInvoicesApiAxiosParamCreator = function (configuration?: C
169
173
  // http bearer authentication required
170
174
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
171
175
 
172
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
173
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
176
+ // Only Authorization falls back to the configured token; an empty value is never sent.
177
+ const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
178
+ if (authorizationValue) {
179
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
174
180
  }
175
181
 
176
182
 
@@ -220,8 +226,10 @@ export const EstimatedInvoicesApiAxiosParamCreator = function (configuration?: C
220
226
  // http bearer authentication required
221
227
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
222
228
 
223
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
224
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
229
+ // Only Authorization falls back to the configured token; an empty value is never sent.
230
+ const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
231
+ if (authorizationValue) {
232
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
225
233
  }
226
234
 
227
235
 
@@ -64,12 +64,16 @@ export const InitialInvoicesApiAxiosParamCreator = function (configuration?: Con
64
64
  // http bearer authentication required
65
65
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
66
66
 
67
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
68
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
67
+ // Only Authorization falls back to the configured token; an empty value is never sent.
68
+ const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
69
+ if (authorizationValue) {
70
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
69
71
  }
70
72
 
71
- if (idempotencyKey !== undefined && idempotencyKey !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
72
- localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey ? idempotencyKey : baseAccessToken);
73
+ // Only Authorization falls back to the configured token; an empty value is never sent.
74
+ const idempotencyKeyValue = 'Idempotency-Key'.toLowerCase() === 'authorization' ? (idempotencyKey || baseAccessToken) : idempotencyKey;
75
+ if (idempotencyKeyValue) {
76
+ localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKeyValue);
73
77
  }
74
78
 
75
79
 
@@ -70,12 +70,16 @@ export const InvoicesApiAxiosParamCreator = function (configuration?: Configurat
70
70
  // http bearer authentication required
71
71
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
72
72
 
73
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
74
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
73
+ // Only Authorization falls back to the configured token; an empty value is never sent.
74
+ const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
75
+ if (authorizationValue) {
76
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
75
77
  }
76
78
 
77
- if (idempotencyKey !== undefined && idempotencyKey !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
78
- localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey ? idempotencyKey : baseAccessToken);
79
+ // Only Authorization falls back to the configured token; an empty value is never sent.
80
+ const idempotencyKeyValue = 'Idempotency-Key'.toLowerCase() === 'authorization' ? (idempotencyKey || baseAccessToken) : idempotencyKey;
81
+ if (idempotencyKeyValue) {
82
+ localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKeyValue);
79
83
  }
80
84
 
81
85
 
@@ -129,8 +133,10 @@ export const InvoicesApiAxiosParamCreator = function (configuration?: Configurat
129
133
  localVarQueryParameter['expand'] = expand;
130
134
  }
131
135
 
132
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
133
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
136
+ // Only Authorization falls back to the configured token; an empty value is never sent.
137
+ const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
138
+ if (authorizationValue) {
139
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
134
140
  }
135
141
 
136
142
 
@@ -205,8 +211,10 @@ export const InvoicesApiAxiosParamCreator = function (configuration?: Configurat
205
211
  localVarQueryParameter['filters'] = filters;
206
212
  }
207
213
 
208
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
209
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
214
+ // Only Authorization falls back to the configured token; an empty value is never sent.
215
+ const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
216
+ if (authorizationValue) {
217
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
210
218
  }
211
219
 
212
220
 
@@ -282,8 +290,10 @@ export const InvoicesApiAxiosParamCreator = function (configuration?: Configurat
282
290
  localVarQueryParameter['filters'] = filters;
283
291
  }
284
292
 
285
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
286
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
293
+ // Only Authorization falls back to the configured token; an empty value is never sent.
294
+ const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
295
+ if (authorizationValue) {
296
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
287
297
  }
288
298
 
289
299
 
@@ -67,8 +67,10 @@ export const PolicyBillingApiAxiosParamCreator = function (configuration?: Confi
67
67
  // http bearer authentication required
68
68
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
69
69
 
70
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
71
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
70
+ // Only Authorization falls back to the configured token; an empty value is never sent.
71
+ const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
72
+ if (authorizationValue) {
73
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
72
74
  }
73
75
 
74
76
 
@@ -146,8 +148,10 @@ export const PolicyBillingApiAxiosParamCreator = function (configuration?: Confi
146
148
  localVarQueryParameter['filters'] = filters;
147
149
  }
148
150
 
149
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
150
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
151
+ // Only Authorization falls back to the configured token; an empty value is never sent.
152
+ const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
153
+ if (authorizationValue) {
154
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
151
155
  }
152
156
 
153
157
 
@@ -194,8 +198,10 @@ export const PolicyBillingApiAxiosParamCreator = function (configuration?: Confi
194
198
  // http bearer authentication required
195
199
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
196
200
 
197
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
198
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
201
+ // Only Authorization falls back to the configured token; an empty value is never sent.
202
+ const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
203
+ if (authorizationValue) {
204
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
199
205
  }
200
206
 
201
207
 
@@ -64,12 +64,16 @@ export const RecurringInvoicesApiAxiosParamCreator = function (configuration?: C
64
64
  // http bearer authentication required
65
65
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
66
66
 
67
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
68
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
67
+ // Only Authorization falls back to the configured token; an empty value is never sent.
68
+ const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
69
+ if (authorizationValue) {
70
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
69
71
  }
70
72
 
71
- if (idempotencyKey !== undefined && idempotencyKey !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
72
- localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey ? idempotencyKey : baseAccessToken);
73
+ // Only Authorization falls back to the configured token; an empty value is never sent.
74
+ const idempotencyKeyValue = 'Idempotency-Key'.toLowerCase() === 'authorization' ? (idempotencyKey || baseAccessToken) : idempotencyKey;
75
+ if (idempotencyKeyValue) {
76
+ localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKeyValue);
73
77
  }
74
78
 
75
79
 
@@ -64,12 +64,16 @@ export const TerminationInvoicesApiAxiosParamCreator = function (configuration?:
64
64
  // http bearer authentication required
65
65
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
66
66
 
67
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
68
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
67
+ // Only Authorization falls back to the configured token; an empty value is never sent.
68
+ const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
69
+ if (authorizationValue) {
70
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
69
71
  }
70
72
 
71
- if (idempotencyKey !== undefined && idempotencyKey !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
72
- localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey ? idempotencyKey : baseAccessToken);
73
+ // Only Authorization falls back to the configured token; an empty value is never sent.
74
+ const idempotencyKeyValue = 'Idempotency-Key'.toLowerCase() === 'authorization' ? (idempotencyKey || baseAccessToken) : idempotencyKey;
75
+ if (idempotencyKeyValue) {
76
+ localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKeyValue);
73
77
  }
74
78
 
75
79
 
@@ -0,0 +1,187 @@
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 { CreateInvoiceResponseClass } from '../models';
25
+ // @ts-ignore
26
+ import { CreateWithdrawInvoiceRequestDtoRest } from '../models';
27
+ // URLSearchParams not necessarily used
28
+ // @ts-ignore
29
+ import { URL, URLSearchParams } from 'url';
30
+ const FormData = require('form-data');
31
+ /**
32
+ * WithdrawInvoicesApi - axios parameter creator
33
+ * @export
34
+ */
35
+ export const WithdrawInvoicesApiAxiosParamCreator = function (configuration?: Configuration) {
36
+ return {
37
+ /**
38
+ * This will create a withdraw invoice that negates existing invoice line items for a policy. **Required Permissions** \"billing-management.invoices.create\"
39
+ * @summary Create the Withdraw invoice
40
+ * @param {CreateWithdrawInvoiceRequestDtoRest} createWithdrawInvoiceRequestDtoRest
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
+ createWithdrawInvoice: async (createWithdrawInvoiceRequestDtoRest: CreateWithdrawInvoiceRequestDtoRest, authorization?: string, idempotencyKey?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
47
+ // verify required parameter 'createWithdrawInvoiceRequestDtoRest' is not null or undefined
48
+ assertParamExists('createWithdrawInvoice', 'createWithdrawInvoiceRequestDtoRest', createWithdrawInvoiceRequestDtoRest)
49
+ const localVarPath = `/billingservice/v1/withdraw-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
+ // Only Authorization falls back to the configured token; an empty value is never sent.
68
+ const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
69
+ if (authorizationValue) {
70
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
71
+ }
72
+
73
+ // Only Authorization falls back to the configured token; an empty value is never sent.
74
+ const idempotencyKeyValue = 'Idempotency-Key'.toLowerCase() === 'authorization' ? (idempotencyKey || baseAccessToken) : idempotencyKey;
75
+ if (idempotencyKeyValue) {
76
+ localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKeyValue);
77
+ }
78
+
79
+
80
+
81
+ localVarHeaderParameter['Content-Type'] = 'application/json';
82
+
83
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
84
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
85
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
86
+ localVarRequestOptions.data = serializeDataIfNeeded(createWithdrawInvoiceRequestDtoRest, localVarRequestOptions, configuration)
87
+
88
+ return {
89
+ url: toPathString(localVarUrlObj),
90
+ options: localVarRequestOptions,
91
+ };
92
+ },
93
+ }
94
+ };
95
+
96
+ /**
97
+ * WithdrawInvoicesApi - functional programming interface
98
+ * @export
99
+ */
100
+ export const WithdrawInvoicesApiFp = function(configuration?: Configuration) {
101
+ const localVarAxiosParamCreator = WithdrawInvoicesApiAxiosParamCreator(configuration)
102
+ return {
103
+ /**
104
+ * This will create a withdraw invoice that negates existing invoice line items for a policy. **Required Permissions** \"billing-management.invoices.create\"
105
+ * @summary Create the Withdraw invoice
106
+ * @param {CreateWithdrawInvoiceRequestDtoRest} createWithdrawInvoiceRequestDtoRest
107
+ * @param {string} [authorization] Bearer Token
108
+ * @param {string} [idempotencyKey] Idempotency Key used to make the request idempotent. The key should be unique. Usually, a generated v4 UUID is enough.
109
+ * @param {*} [options] Override http request option.
110
+ * @throws {RequiredError}
111
+ */
112
+ async createWithdrawInvoice(createWithdrawInvoiceRequestDtoRest: CreateWithdrawInvoiceRequestDtoRest, authorization?: string, idempotencyKey?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateInvoiceResponseClass>> {
113
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createWithdrawInvoice(createWithdrawInvoiceRequestDtoRest, authorization, idempotencyKey, options);
114
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
115
+ },
116
+ }
117
+ };
118
+
119
+ /**
120
+ * WithdrawInvoicesApi - factory interface
121
+ * @export
122
+ */
123
+ export const WithdrawInvoicesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
124
+ const localVarFp = WithdrawInvoicesApiFp(configuration)
125
+ return {
126
+ /**
127
+ * This will create a withdraw invoice that negates existing invoice line items for a policy. **Required Permissions** \"billing-management.invoices.create\"
128
+ * @summary Create the Withdraw invoice
129
+ * @param {CreateWithdrawInvoiceRequestDtoRest} createWithdrawInvoiceRequestDtoRest
130
+ * @param {string} [authorization] Bearer Token
131
+ * @param {string} [idempotencyKey] Idempotency Key used to make the request idempotent. The key should be unique. Usually, a generated v4 UUID is enough.
132
+ * @param {*} [options] Override http request option.
133
+ * @throws {RequiredError}
134
+ */
135
+ createWithdrawInvoice(createWithdrawInvoiceRequestDtoRest: CreateWithdrawInvoiceRequestDtoRest, authorization?: string, idempotencyKey?: string, options?: any): AxiosPromise<CreateInvoiceResponseClass> {
136
+ return localVarFp.createWithdrawInvoice(createWithdrawInvoiceRequestDtoRest, authorization, idempotencyKey, options).then((request) => request(axios, basePath));
137
+ },
138
+ };
139
+ };
140
+
141
+ /**
142
+ * Request parameters for createWithdrawInvoice operation in WithdrawInvoicesApi.
143
+ * @export
144
+ * @interface WithdrawInvoicesApiCreateWithdrawInvoiceRequest
145
+ */
146
+ export interface WithdrawInvoicesApiCreateWithdrawInvoiceRequest {
147
+ /**
148
+ *
149
+ * @type {CreateWithdrawInvoiceRequestDtoRest}
150
+ * @memberof WithdrawInvoicesApiCreateWithdrawInvoice
151
+ */
152
+ readonly createWithdrawInvoiceRequestDtoRest: CreateWithdrawInvoiceRequestDtoRest
153
+
154
+ /**
155
+ * Bearer Token
156
+ * @type {string}
157
+ * @memberof WithdrawInvoicesApiCreateWithdrawInvoice
158
+ */
159
+ readonly authorization?: string
160
+
161
+ /**
162
+ * Idempotency Key used to make the request idempotent. The key should be unique. Usually, a generated v4 UUID is enough.
163
+ * @type {string}
164
+ * @memberof WithdrawInvoicesApiCreateWithdrawInvoice
165
+ */
166
+ readonly idempotencyKey?: string
167
+ }
168
+
169
+ /**
170
+ * WithdrawInvoicesApi - object-oriented interface
171
+ * @export
172
+ * @class WithdrawInvoicesApi
173
+ * @extends {BaseAPI}
174
+ */
175
+ export class WithdrawInvoicesApi extends BaseAPI {
176
+ /**
177
+ * This will create a withdraw invoice that negates existing invoice line items for a policy. **Required Permissions** \"billing-management.invoices.create\"
178
+ * @summary Create the Withdraw invoice
179
+ * @param {WithdrawInvoicesApiCreateWithdrawInvoiceRequest} requestParameters Request parameters.
180
+ * @param {*} [options] Override http request option.
181
+ * @throws {RequiredError}
182
+ * @memberof WithdrawInvoicesApi
183
+ */
184
+ public createWithdrawInvoice(requestParameters: WithdrawInvoicesApiCreateWithdrawInvoiceRequest, options?: AxiosRequestConfig) {
185
+ return WithdrawInvoicesApiFp(this.configuration).createWithdrawInvoice(requestParameters.createWithdrawInvoiceRequestDtoRest, requestParameters.authorization, requestParameters.idempotencyKey, options).then((request) => request(this.axios, this.basePath));
186
+ }
187
+ }
package/api.ts CHANGED
@@ -33,6 +33,7 @@ import { InvoicesApi } from './api';
33
33
  import { PolicyBillingApi } from './api';
34
34
  import { RecurringInvoicesApi } from './api';
35
35
  import { TerminationInvoicesApi } from './api';
36
+ import { WithdrawInvoicesApi } from './api';
36
37
 
37
38
 
38
39
  export * from './api/correction-invoices-api';
@@ -44,4 +45,5 @@ export * from './api/invoices-api';
44
45
  export * from './api/policy-billing-api';
45
46
  export * from './api/recurring-invoices-api';
46
47
  export * from './api/termination-invoices-api';
48
+ export * from './api/withdraw-invoices-api';
47
49
 
package/common.ts CHANGED
@@ -131,9 +131,10 @@ export const toPathString = function (url: URL) {
131
131
  * @export
132
132
  */
133
133
  export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
134
- return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
134
+ // Typed by hand: since axios 1.20, request() returns an internal axios type that SDK declarations cannot name.
135
+ return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH): Promise<R> => {
135
136
  const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url};
136
- return axios.request<T, R>(axiosRequestArgs);
137
+ return axios.request<T, R>(axiosRequestArgs) as Promise<R>;
137
138
  };
138
139
  }
139
140
 
@@ -147,7 +147,7 @@ export declare class CorrectionInvoicesApi extends BaseAPI {
147
147
  * @throws {RequiredError}
148
148
  * @memberof CorrectionInvoicesApi
149
149
  */
150
- createCorrectionInvoice(requestParameters: CorrectionInvoicesApiCreateCorrectionInvoiceRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateCorrectionInvoicesResponseClass, any, {}>>;
150
+ createCorrectionInvoice(requestParameters: CorrectionInvoicesApiCreateCorrectionInvoiceRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateCorrectionInvoicesResponseClass, any, {}, any>>;
151
151
  /**
152
152
  * undefined **Required Permissions** \"billing-management.invoices.update\"
153
153
  * @param {CorrectionInvoicesApiRevertInvoiceRequest} requestParameters Request parameters.
@@ -155,5 +155,5 @@ export declare class CorrectionInvoicesApi extends BaseAPI {
155
155
  * @throws {RequiredError}
156
156
  * @memberof CorrectionInvoicesApi
157
157
  */
158
- revertInvoice(requestParameters: CorrectionInvoicesApiRevertInvoiceRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<RevertInvoiceResponseClass, any, {}>>;
158
+ revertInvoice(requestParameters: CorrectionInvoicesApiRevertInvoiceRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<RevertInvoiceResponseClass, any, {}, any>>;
159
159
  }