@emilgroup/billing-sdk-node 1.63.1-beta.38 → 1.63.1-beta.39

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 (53) hide show
  1. package/.openapi-generator/FILES +3 -0
  2. package/README.md +2 -2
  3. package/api/correction-invoices-api.ts +23 -8
  4. package/api/draft-invoice-api.ts +24 -9
  5. package/api/estimated-invoices-api.ts +32 -12
  6. package/api/health-api.ts +1 -1
  7. package/api/initial-invoices-api.ts +15 -5
  8. package/api/invoices-api.ts +39 -14
  9. package/api/policy-billing-api.ts +24 -9
  10. package/api/recurring-invoices-api.ts +15 -5
  11. package/api/termination-invoices-api.ts +15 -5
  12. package/api/withdraw-invoices-api.ts +193 -0
  13. package/api.ts +2 -0
  14. package/base.ts +4 -0
  15. package/common.ts +3 -2
  16. package/dist/api/correction-invoices-api.d.ts +2 -2
  17. package/dist/api/correction-invoices-api.js +35 -18
  18. package/dist/api/draft-invoice-api.d.ts +3 -3
  19. package/dist/api/draft-invoice-api.js +45 -24
  20. package/dist/api/estimated-invoices-api.d.ts +4 -4
  21. package/dist/api/estimated-invoices-api.js +60 -32
  22. package/dist/api/health-api.d.ts +1 -1
  23. package/dist/api/health-api.js +1 -1
  24. package/dist/api/initial-invoices-api.d.ts +1 -1
  25. package/dist/api/initial-invoices-api.js +20 -10
  26. package/dist/api/invoices-api.d.ts +4 -4
  27. package/dist/api/invoices-api.js +53 -31
  28. package/dist/api/policy-billing-api.d.ts +3 -3
  29. package/dist/api/policy-billing-api.js +41 -23
  30. package/dist/api/recurring-invoices-api.d.ts +1 -1
  31. package/dist/api/recurring-invoices-api.js +20 -10
  32. package/dist/api/termination-invoices-api.d.ts +1 -1
  33. package/dist/api/termination-invoices-api.js +20 -10
  34. package/dist/api/withdraw-invoices-api.d.ts +106 -0
  35. package/dist/api/withdraw-invoices-api.js +244 -0
  36. package/dist/api.d.ts +1 -0
  37. package/dist/api.js +1 -0
  38. package/dist/base.d.ts +1 -0
  39. package/dist/base.js +3 -0
  40. package/dist/common.d.ts +1 -1
  41. package/dist/common.js +1 -0
  42. package/dist/models/create-withdraw-invoice-request-dto-rest.d.ts +50 -0
  43. package/dist/models/create-withdraw-invoice-request-dto-rest.js +15 -0
  44. package/dist/models/create-withdraw-invoice-request-dto.d.ts +50 -0
  45. package/dist/models/create-withdraw-invoice-request-dto.js +15 -0
  46. package/dist/models/index.d.ts +2 -0
  47. package/dist/models/index.js +2 -0
  48. package/dist/models/invoice-item-class.d.ts +12 -0
  49. package/models/create-withdraw-invoice-request-dto-rest.ts +54 -0
  50. package/models/create-withdraw-invoice-request-dto.ts +54 -0
  51. package/models/index.ts +2 -0
  52. package/models/invoice-item-class.ts +12 -0
  53. package/package.json +2 -2
@@ -107,9 +107,10 @@ var EstimatedInvoicesApiAxiosParamCreator = function (configuration) {
107
107
  createCustomEstimatedInvoice: function (createCustomEstimatedInvoiceRequestDto, authorization, options) {
108
108
  if (options === void 0) { options = {}; }
109
109
  return __awaiter(_this, void 0, void 0, function () {
110
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
111
- return __generator(this, function (_a) {
112
- switch (_a.label) {
110
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
111
+ var _a;
112
+ return __generator(this, function (_b) {
113
+ switch (_b.label) {
113
114
  case 0:
114
115
  // verify required parameter 'createCustomEstimatedInvoiceRequestDto' is not null or undefined
115
116
  (0, common_1.assertParamExists)('createCustomEstimatedInvoice', 'createCustomEstimatedInvoiceRequestDto', createCustomEstimatedInvoiceRequestDto);
@@ -124,13 +125,19 @@ var EstimatedInvoicesApiAxiosParamCreator = function (configuration) {
124
125
  localVarQueryParameter = {};
125
126
  // authentication bearer required
126
127
  // http bearer authentication required
127
- return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
128
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
129
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
130
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
131
+ ];
128
132
  case 1:
129
133
  // authentication bearer required
130
134
  // http bearer authentication required
131
- _a.sent();
132
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
133
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
135
+ _b.sent();
136
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
137
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
138
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
139
+ if (authorizationValue || authorizationKeepEmpty) {
140
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
134
141
  }
135
142
  localVarHeaderParameter['Content-Type'] = 'application/json';
136
143
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
@@ -156,9 +163,10 @@ var EstimatedInvoicesApiAxiosParamCreator = function (configuration) {
156
163
  createEstimatedInvoice: function (createEstimatedInvoiceRequestDto, authorization, options) {
157
164
  if (options === void 0) { options = {}; }
158
165
  return __awaiter(_this, void 0, void 0, function () {
159
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
160
- return __generator(this, function (_a) {
161
- switch (_a.label) {
166
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
167
+ var _a;
168
+ return __generator(this, function (_b) {
169
+ switch (_b.label) {
162
170
  case 0:
163
171
  // verify required parameter 'createEstimatedInvoiceRequestDto' is not null or undefined
164
172
  (0, common_1.assertParamExists)('createEstimatedInvoice', 'createEstimatedInvoiceRequestDto', createEstimatedInvoiceRequestDto);
@@ -173,13 +181,19 @@ var EstimatedInvoicesApiAxiosParamCreator = function (configuration) {
173
181
  localVarQueryParameter = {};
174
182
  // authentication bearer required
175
183
  // http bearer authentication required
176
- return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
184
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
185
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
186
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
187
+ ];
177
188
  case 1:
178
189
  // authentication bearer required
179
190
  // http bearer authentication required
180
- _a.sent();
181
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
182
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
191
+ _b.sent();
192
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
193
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
194
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
195
+ if (authorizationValue || authorizationKeepEmpty) {
196
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
183
197
  }
184
198
  localVarHeaderParameter['Content-Type'] = 'application/json';
185
199
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
@@ -205,9 +219,10 @@ var EstimatedInvoicesApiAxiosParamCreator = function (configuration) {
205
219
  createEstimatedInvoiceFromInterval: function (createEstimatedInvoiceForIntervalRequestDto, authorization, options) {
206
220
  if (options === void 0) { options = {}; }
207
221
  return __awaiter(_this, void 0, void 0, function () {
208
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
209
- return __generator(this, function (_a) {
210
- switch (_a.label) {
222
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
223
+ var _a;
224
+ return __generator(this, function (_b) {
225
+ switch (_b.label) {
211
226
  case 0:
212
227
  // verify required parameter 'createEstimatedInvoiceForIntervalRequestDto' is not null or undefined
213
228
  (0, common_1.assertParamExists)('createEstimatedInvoiceFromInterval', 'createEstimatedInvoiceForIntervalRequestDto', createEstimatedInvoiceForIntervalRequestDto);
@@ -222,13 +237,19 @@ var EstimatedInvoicesApiAxiosParamCreator = function (configuration) {
222
237
  localVarQueryParameter = {};
223
238
  // authentication bearer required
224
239
  // http bearer authentication required
225
- return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
240
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
241
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
242
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
243
+ ];
226
244
  case 1:
227
245
  // authentication bearer required
228
246
  // http bearer authentication required
229
- _a.sent();
230
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
231
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
247
+ _b.sent();
248
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
249
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
250
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
251
+ if (authorizationValue || authorizationKeepEmpty) {
252
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
232
253
  }
233
254
  localVarHeaderParameter['Content-Type'] = 'application/json';
234
255
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
@@ -255,9 +276,10 @@ var EstimatedInvoicesApiAxiosParamCreator = function (configuration) {
255
276
  createProductEstimatedInvoice: function (productSlug, createProductEstimatedInvoiceRequestDto, authorization, options) {
256
277
  if (options === void 0) { options = {}; }
257
278
  return __awaiter(_this, void 0, void 0, function () {
258
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
259
- return __generator(this, function (_a) {
260
- switch (_a.label) {
279
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
280
+ var _a;
281
+ return __generator(this, function (_b) {
282
+ switch (_b.label) {
261
283
  case 0:
262
284
  // verify required parameter 'productSlug' is not null or undefined
263
285
  (0, common_1.assertParamExists)('createProductEstimatedInvoice', 'productSlug', productSlug);
@@ -275,13 +297,19 @@ var EstimatedInvoicesApiAxiosParamCreator = function (configuration) {
275
297
  localVarQueryParameter = {};
276
298
  // authentication bearer required
277
299
  // http bearer authentication required
278
- return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
300
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
301
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
302
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
303
+ ];
279
304
  case 1:
280
305
  // authentication bearer required
281
306
  // http bearer authentication required
282
- _a.sent();
283
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
284
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
307
+ _b.sent();
308
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
309
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
310
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
311
+ if (authorizationValue || authorizationKeepEmpty) {
312
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
285
313
  }
286
314
  localVarHeaderParameter['Content-Type'] = 'application/json';
287
315
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
@@ -470,7 +498,7 @@ var EstimatedInvoicesApi = /** @class */ (function (_super) {
470
498
  */
471
499
  EstimatedInvoicesApi.prototype.createCustomEstimatedInvoice = function (requestParameters, options) {
472
500
  var _this = this;
473
- return (0, exports.EstimatedInvoicesApiFp)(this.configuration).createCustomEstimatedInvoice(requestParameters.createCustomEstimatedInvoiceRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
501
+ return (0, exports.EstimatedInvoicesApiFp)(this.configuration).createCustomEstimatedInvoice(requestParameters.createCustomEstimatedInvoiceRequestDto, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
474
502
  };
475
503
  /**
476
504
  * This creates an estimated invoice. It will not be saved in the database. **Required Permissions** \"billing-management.invoices.create\"
@@ -482,7 +510,7 @@ var EstimatedInvoicesApi = /** @class */ (function (_super) {
482
510
  */
483
511
  EstimatedInvoicesApi.prototype.createEstimatedInvoice = function (requestParameters, options) {
484
512
  var _this = this;
485
- return (0, exports.EstimatedInvoicesApiFp)(this.configuration).createEstimatedInvoice(requestParameters.createEstimatedInvoiceRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
513
+ return (0, exports.EstimatedInvoicesApiFp)(this.configuration).createEstimatedInvoice(requestParameters.createEstimatedInvoiceRequestDto, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
486
514
  };
487
515
  /**
488
516
  * This creates an estimated invoice. It will not be saved in the database. **Required Permissions** \"billing-management.invoices.create\"
@@ -494,7 +522,7 @@ var EstimatedInvoicesApi = /** @class */ (function (_super) {
494
522
  */
495
523
  EstimatedInvoicesApi.prototype.createEstimatedInvoiceFromInterval = function (requestParameters, options) {
496
524
  var _this = this;
497
- return (0, exports.EstimatedInvoicesApiFp)(this.configuration).createEstimatedInvoiceFromInterval(requestParameters.createEstimatedInvoiceForIntervalRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
525
+ return (0, exports.EstimatedInvoicesApiFp)(this.configuration).createEstimatedInvoiceFromInterval(requestParameters.createEstimatedInvoiceForIntervalRequestDto, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
498
526
  };
499
527
  /**
500
528
  * This creates an estimated product invoice. It will not be saved in the database. **Required Permissions** \"billing-management.invoices.create\"
@@ -506,7 +534,7 @@ var EstimatedInvoicesApi = /** @class */ (function (_super) {
506
534
  */
507
535
  EstimatedInvoicesApi.prototype.createProductEstimatedInvoice = function (requestParameters, options) {
508
536
  var _this = this;
509
- return (0, exports.EstimatedInvoicesApiFp)(this.configuration).createProductEstimatedInvoice(requestParameters.productSlug, requestParameters.createProductEstimatedInvoiceRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
537
+ return (0, exports.EstimatedInvoicesApiFp)(this.configuration).createProductEstimatedInvoice(requestParameters.productSlug, requestParameters.createProductEstimatedInvoiceRequestDto, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
510
538
  };
511
539
  return EstimatedInvoicesApi;
512
540
  }(base_1.BaseAPI));
@@ -62,5 +62,5 @@ export declare class HealthApi extends BaseAPI {
62
62
  * @throws {RequiredError}
63
63
  * @memberof HealthApi
64
64
  */
65
- check(options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<InlineResponse200, any, {}>>;
65
+ check(options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<InlineResponse200, any, {}, any>>;
66
66
  }
@@ -193,7 +193,7 @@ var HealthApi = /** @class */ (function (_super) {
193
193
  */
194
194
  HealthApi.prototype.check = function (options) {
195
195
  var _this = this;
196
- return (0, exports.HealthApiFp)(this.configuration).check(options).then(function (request) { return request(_this.axios, _this.basePath); });
196
+ return (0, exports.HealthApiFp)(this.configuration).check(this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
197
197
  };
198
198
  return HealthApi;
199
199
  }(base_1.BaseAPI));
@@ -102,5 +102,5 @@ export declare class InitialInvoicesApi extends BaseAPI {
102
102
  * @throws {RequiredError}
103
103
  * @memberof InitialInvoicesApi
104
104
  */
105
- createInitialInvoice(requestParameters: InitialInvoicesApiCreateInitialInvoiceRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateInvoiceResponseClass, any, {}>>;
105
+ createInitialInvoice(requestParameters: InitialInvoicesApiCreateInitialInvoiceRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateInvoiceResponseClass, any, {}, any>>;
106
106
  }
@@ -108,9 +108,10 @@ var InitialInvoicesApiAxiosParamCreator = function (configuration) {
108
108
  createInitialInvoice: function (createInvoiceForPolicyRequestDto, authorization, idempotencyKey, options) {
109
109
  if (options === void 0) { options = {}; }
110
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) {
111
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, idempotencyKeyIsAuth, idempotencyKeyValue, idempotencyKeyKeepEmpty, headersFromBaseOptions;
112
+ var _a, _b;
113
+ return __generator(this, function (_c) {
114
+ switch (_c.label) {
114
115
  case 0:
115
116
  // verify required parameter 'createInvoiceForPolicyRequestDto' is not null or undefined
116
117
  (0, common_1.assertParamExists)('createInitialInvoice', 'createInvoiceForPolicyRequestDto', createInvoiceForPolicyRequestDto);
@@ -125,16 +126,25 @@ var InitialInvoicesApiAxiosParamCreator = function (configuration) {
125
126
  localVarQueryParameter = {};
126
127
  // authentication bearer required
127
128
  // http bearer authentication required
128
- return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
129
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
130
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
131
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
132
+ ];
129
133
  case 1:
130
134
  // authentication bearer required
131
135
  // http bearer authentication required
132
- _a.sent();
133
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
134
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
136
+ _c.sent();
137
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
138
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
139
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
140
+ if (authorizationValue || authorizationKeepEmpty) {
141
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
135
142
  }
136
- if (idempotencyKey !== undefined && idempotencyKey !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
137
- localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey ? idempotencyKey : baseAccessToken);
143
+ idempotencyKeyIsAuth = 'Idempotency-Key'.toLowerCase() === 'authorization';
144
+ idempotencyKeyValue = idempotencyKeyIsAuth ? (idempotencyKey || baseAccessToken) : idempotencyKey;
145
+ idempotencyKeyKeepEmpty = idempotencyKeyIsAuth && idempotencyKeyValue === '' && !((_b = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _b === void 0 ? void 0 : _b['X-Emil-Account']);
146
+ if (idempotencyKeyValue || idempotencyKeyKeepEmpty) {
147
+ localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKeyValue);
138
148
  }
139
149
  localVarHeaderParameter['Content-Type'] = 'application/json';
140
150
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
@@ -227,7 +237,7 @@ var InitialInvoicesApi = /** @class */ (function (_super) {
227
237
  */
228
238
  InitialInvoicesApi.prototype.createInitialInvoice = function (requestParameters, options) {
229
239
  var _this = this;
230
- return (0, exports.InitialInvoicesApiFp)(this.configuration).createInitialInvoice(requestParameters.createInvoiceForPolicyRequestDto, requestParameters.authorization, requestParameters.idempotencyKey, options).then(function (request) { return request(_this.axios, _this.basePath); });
240
+ return (0, exports.InitialInvoicesApiFp)(this.configuration).createInitialInvoice(requestParameters.createInvoiceForPolicyRequestDto, requestParameters.authorization, requestParameters.idempotencyKey, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
231
241
  };
232
242
  return InitialInvoicesApi;
233
243
  }(base_1.BaseAPI));
@@ -363,7 +363,7 @@ export declare class InvoicesApi extends BaseAPI {
363
363
  * @throws {RequiredError}
364
364
  * @memberof InvoicesApi
365
365
  */
366
- createInvoice(requestParameters: InvoicesApiCreateInvoiceRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateInvoiceResponseClass, any, {}>>;
366
+ createInvoice(requestParameters: InvoicesApiCreateInvoiceRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateInvoiceResponseClass, any, {}, any>>;
367
367
  /**
368
368
  * Gets an invoice. **Required Permissions** \"billing-management.invoices.view\"
369
369
  * @summary Retrieve the invoice
@@ -372,7 +372,7 @@ export declare class InvoicesApi extends BaseAPI {
372
372
  * @throws {RequiredError}
373
373
  * @memberof InvoicesApi
374
374
  */
375
- getInvoice(requestParameters: InvoicesApiGetInvoiceRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<GetInvoiceResponseClass, any, {}>>;
375
+ getInvoice(requestParameters: InvoicesApiGetInvoiceRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<GetInvoiceResponseClass, any, {}, any>>;
376
376
  /**
377
377
  * Returns a list of invoices you have previously created. The invoices are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation. **Required Permissions** \"billing-management.invoices.view\"
378
378
  * @summary List invoices
@@ -381,7 +381,7 @@ export declare class InvoicesApi extends BaseAPI {
381
381
  * @throws {RequiredError}
382
382
  * @memberof InvoicesApi
383
383
  */
384
- listInvoices(requestParameters?: InvoicesApiListInvoicesRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListInvoicesResponseClass, any, {}>>;
384
+ listInvoices(requestParameters?: InvoicesApiListInvoicesRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListInvoicesResponseClass, any, {}, any>>;
385
385
  /**
386
386
  * Returns a list of policies billing dates you have previously created. The policies billing dates are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation. **Required Permissions** \"billing-management.invoices.view\"
387
387
  * @summary List policies billing dates
@@ -391,5 +391,5 @@ export declare class InvoicesApi extends BaseAPI {
391
391
  * @throws {RequiredError}
392
392
  * @memberof InvoicesApi
393
393
  */
394
- listPoliciesBillingDates(requestParameters?: InvoicesApiListPoliciesBillingDatesRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListPoliciesBillingsResponseClass, any, {}>>;
394
+ listPoliciesBillingDates(requestParameters?: InvoicesApiListPoliciesBillingDatesRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListPoliciesBillingsResponseClass, any, {}, any>>;
395
395
  }
@@ -108,9 +108,10 @@ var InvoicesApiAxiosParamCreator = function (configuration) {
108
108
  createInvoice: function (createInvoiceRequestDto, authorization, idempotencyKey, options) {
109
109
  if (options === void 0) { options = {}; }
110
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) {
111
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, idempotencyKeyIsAuth, idempotencyKeyValue, idempotencyKeyKeepEmpty, headersFromBaseOptions;
112
+ var _a, _b;
113
+ return __generator(this, function (_c) {
114
+ switch (_c.label) {
114
115
  case 0:
115
116
  // verify required parameter 'createInvoiceRequestDto' is not null or undefined
116
117
  (0, common_1.assertParamExists)('createInvoice', 'createInvoiceRequestDto', createInvoiceRequestDto);
@@ -125,16 +126,25 @@ var InvoicesApiAxiosParamCreator = function (configuration) {
125
126
  localVarQueryParameter = {};
126
127
  // authentication bearer required
127
128
  // http bearer authentication required
128
- return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
129
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
130
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
131
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
132
+ ];
129
133
  case 1:
130
134
  // authentication bearer required
131
135
  // http bearer authentication required
132
- _a.sent();
133
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
134
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
136
+ _c.sent();
137
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
138
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
139
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
140
+ if (authorizationValue || authorizationKeepEmpty) {
141
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
135
142
  }
136
- if (idempotencyKey !== undefined && idempotencyKey !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
137
- localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey ? idempotencyKey : baseAccessToken);
143
+ idempotencyKeyIsAuth = 'Idempotency-Key'.toLowerCase() === 'authorization';
144
+ idempotencyKeyValue = idempotencyKeyIsAuth ? (idempotencyKey || baseAccessToken) : idempotencyKey;
145
+ idempotencyKeyKeepEmpty = idempotencyKeyIsAuth && idempotencyKeyValue === '' && !((_b = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _b === void 0 ? void 0 : _b['X-Emil-Account']);
146
+ if (idempotencyKeyValue || idempotencyKeyKeepEmpty) {
147
+ localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKeyValue);
138
148
  }
139
149
  localVarHeaderParameter['Content-Type'] = 'application/json';
140
150
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
@@ -161,9 +171,10 @@ var InvoicesApiAxiosParamCreator = function (configuration) {
161
171
  getInvoice: function (code, expand, authorization, options) {
162
172
  if (options === void 0) { options = {}; }
163
173
  return __awaiter(_this, void 0, void 0, function () {
164
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
165
- return __generator(this, function (_a) {
166
- switch (_a.label) {
174
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
175
+ var _a;
176
+ return __generator(this, function (_b) {
177
+ switch (_b.label) {
167
178
  case 0:
168
179
  // verify required parameter 'code' is not null or undefined
169
180
  (0, common_1.assertParamExists)('getInvoice', 'code', code);
@@ -185,12 +196,15 @@ var InvoicesApiAxiosParamCreator = function (configuration) {
185
196
  case 1:
186
197
  // authentication bearer required
187
198
  // http bearer authentication required
188
- _a.sent();
199
+ _b.sent();
189
200
  if (expand !== undefined) {
190
201
  localVarQueryParameter['expand'] = expand;
191
202
  }
192
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
193
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
203
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
204
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
205
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
206
+ if (authorizationValue || authorizationKeepEmpty) {
207
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
194
208
  }
195
209
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
196
210
  headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
@@ -220,9 +234,10 @@ var InvoicesApiAxiosParamCreator = function (configuration) {
220
234
  listInvoices: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
221
235
  if (options === void 0) { options = {}; }
222
236
  return __awaiter(_this, void 0, void 0, function () {
223
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
224
- return __generator(this, function (_a) {
225
- switch (_a.label) {
237
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
238
+ var _a;
239
+ return __generator(this, function (_b) {
240
+ switch (_b.label) {
226
241
  case 0:
227
242
  localVarPath = "/billingservice/v1/invoices";
228
243
  localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
@@ -239,7 +254,7 @@ var InvoicesApiAxiosParamCreator = function (configuration) {
239
254
  case 1:
240
255
  // authentication bearer required
241
256
  // http bearer authentication required
242
- _a.sent();
257
+ _b.sent();
243
258
  if (pageSize !== undefined) {
244
259
  localVarQueryParameter['pageSize'] = pageSize;
245
260
  }
@@ -261,8 +276,11 @@ var InvoicesApiAxiosParamCreator = function (configuration) {
261
276
  if (filters !== undefined) {
262
277
  localVarQueryParameter['filters'] = filters;
263
278
  }
264
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
265
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
279
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
280
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
281
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
282
+ if (authorizationValue || authorizationKeepEmpty) {
283
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
266
284
  }
267
285
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
268
286
  headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
@@ -293,9 +311,10 @@ var InvoicesApiAxiosParamCreator = function (configuration) {
293
311
  listPoliciesBillingDates: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
294
312
  if (options === void 0) { options = {}; }
295
313
  return __awaiter(_this, void 0, void 0, function () {
296
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
297
- return __generator(this, function (_a) {
298
- switch (_a.label) {
314
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
315
+ var _a;
316
+ return __generator(this, function (_b) {
317
+ switch (_b.label) {
299
318
  case 0:
300
319
  localVarPath = "/billingservice/v1/invoices/policies-billing-dates";
301
320
  localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
@@ -312,7 +331,7 @@ var InvoicesApiAxiosParamCreator = function (configuration) {
312
331
  case 1:
313
332
  // authentication bearer required
314
333
  // http bearer authentication required
315
- _a.sent();
334
+ _b.sent();
316
335
  if (pageSize !== undefined) {
317
336
  localVarQueryParameter['pageSize'] = pageSize;
318
337
  }
@@ -334,8 +353,11 @@ var InvoicesApiAxiosParamCreator = function (configuration) {
334
353
  if (filters !== undefined) {
335
354
  localVarQueryParameter['filters'] = filters;
336
355
  }
337
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
338
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
356
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
357
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
358
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
359
+ if (authorizationValue || authorizationKeepEmpty) {
360
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
339
361
  }
340
362
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
341
363
  headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
@@ -550,7 +572,7 @@ var InvoicesApi = /** @class */ (function (_super) {
550
572
  */
551
573
  InvoicesApi.prototype.createInvoice = function (requestParameters, options) {
552
574
  var _this = this;
553
- return (0, exports.InvoicesApiFp)(this.configuration).createInvoice(requestParameters.createInvoiceRequestDto, requestParameters.authorization, requestParameters.idempotencyKey, options).then(function (request) { return request(_this.axios, _this.basePath); });
575
+ return (0, exports.InvoicesApiFp)(this.configuration).createInvoice(requestParameters.createInvoiceRequestDto, requestParameters.authorization, requestParameters.idempotencyKey, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
554
576
  };
555
577
  /**
556
578
  * Gets an invoice. **Required Permissions** \"billing-management.invoices.view\"
@@ -562,7 +584,7 @@ var InvoicesApi = /** @class */ (function (_super) {
562
584
  */
563
585
  InvoicesApi.prototype.getInvoice = function (requestParameters, options) {
564
586
  var _this = this;
565
- return (0, exports.InvoicesApiFp)(this.configuration).getInvoice(requestParameters.code, requestParameters.expand, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
587
+ return (0, exports.InvoicesApiFp)(this.configuration).getInvoice(requestParameters.code, requestParameters.expand, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
566
588
  };
567
589
  /**
568
590
  * Returns a list of invoices you have previously created. The invoices are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation. **Required Permissions** \"billing-management.invoices.view\"
@@ -575,7 +597,7 @@ var InvoicesApi = /** @class */ (function (_super) {
575
597
  InvoicesApi.prototype.listInvoices = function (requestParameters, options) {
576
598
  var _this = this;
577
599
  if (requestParameters === void 0) { requestParameters = {}; }
578
- return (0, exports.InvoicesApiFp)(this.configuration).listInvoices(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, options).then(function (request) { return request(_this.axios, _this.basePath); });
600
+ return (0, exports.InvoicesApiFp)(this.configuration).listInvoices(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
579
601
  };
580
602
  /**
581
603
  * Returns a list of policies billing dates you have previously created. The policies billing dates are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation. **Required Permissions** \"billing-management.invoices.view\"
@@ -589,7 +611,7 @@ var InvoicesApi = /** @class */ (function (_super) {
589
611
  InvoicesApi.prototype.listPoliciesBillingDates = function (requestParameters, options) {
590
612
  var _this = this;
591
613
  if (requestParameters === void 0) { requestParameters = {}; }
592
- return (0, exports.InvoicesApiFp)(this.configuration).listPoliciesBillingDates(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, options).then(function (request) { return request(_this.axios, _this.basePath); });
614
+ return (0, exports.InvoicesApiFp)(this.configuration).listPoliciesBillingDates(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
593
615
  };
594
616
  return InvoicesApi;
595
617
  }(base_1.BaseAPI));
@@ -250,7 +250,7 @@ export declare class PolicyBillingApi extends BaseAPI {
250
250
  * @throws {RequiredError}
251
251
  * @memberof PolicyBillingApi
252
252
  */
253
- createPolicyBilling(requestParameters: PolicyBillingApiCreatePolicyBillingRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreatePolicyBillingResponseClass, any, {}>>;
253
+ createPolicyBilling(requestParameters: PolicyBillingApiCreatePolicyBillingRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreatePolicyBillingResponseClass, any, {}, any>>;
254
254
  /**
255
255
  * Returns a list of policies billings you have previously created. The policies billings are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation. **Required Permissions** \"billing-management.invoices.view\"
256
256
  * @summary List policies billings
@@ -259,7 +259,7 @@ export declare class PolicyBillingApi extends BaseAPI {
259
259
  * @throws {RequiredError}
260
260
  * @memberof PolicyBillingApi
261
261
  */
262
- listPoliciesBillings(requestParameters?: PolicyBillingApiListPoliciesBillingsRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any, {}>>;
262
+ listPoliciesBillings(requestParameters?: PolicyBillingApiListPoliciesBillingsRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any, {}, any>>;
263
263
  /**
264
264
  * Updates the specified request message by setting the values of the parameters passed. Any parameters not provided will be left unchanged. **Required Permissions** \"billing-management.invoices.update\"
265
265
  * @summary Update the request message
@@ -268,5 +268,5 @@ export declare class PolicyBillingApi extends BaseAPI {
268
268
  * @throws {RequiredError}
269
269
  * @memberof PolicyBillingApi
270
270
  */
271
- updatePolicyBilling(requestParameters: PolicyBillingApiUpdatePolicyBillingRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<UpdatePolicyBillingResponseClass, any, {}>>;
271
+ updatePolicyBilling(requestParameters: PolicyBillingApiUpdatePolicyBillingRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<UpdatePolicyBillingResponseClass, any, {}, any>>;
272
272
  }