@emilgroup/billing-sdk-node 1.63.1-beta.4 → 1.63.1-beta.41

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 (40) hide show
  1. package/README.md +2 -2
  2. package/api/correction-invoices-api.ts +23 -8
  3. package/api/draft-invoice-api.ts +24 -9
  4. package/api/estimated-invoices-api.ts +32 -12
  5. package/api/health-api.ts +1 -1
  6. package/api/initial-invoices-api.ts +15 -5
  7. package/api/invoices-api.ts +47 -22
  8. package/api/policy-billing-api.ts +24 -9
  9. package/api/recurring-invoices-api.ts +15 -5
  10. package/api/termination-invoices-api.ts +15 -5
  11. package/api/withdraw-invoices-api.ts +15 -5
  12. package/base.ts +4 -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 +35 -18
  16. package/dist/api/draft-invoice-api.d.ts +3 -3
  17. package/dist/api/draft-invoice-api.js +45 -24
  18. package/dist/api/estimated-invoices-api.d.ts +4 -4
  19. package/dist/api/estimated-invoices-api.js +60 -32
  20. package/dist/api/health-api.d.ts +1 -1
  21. package/dist/api/health-api.js +1 -1
  22. package/dist/api/initial-invoices-api.d.ts +1 -1
  23. package/dist/api/initial-invoices-api.js +20 -10
  24. package/dist/api/invoices-api.d.ts +12 -12
  25. package/dist/api/invoices-api.js +59 -37
  26. package/dist/api/policy-billing-api.d.ts +3 -3
  27. package/dist/api/policy-billing-api.js +41 -23
  28. package/dist/api/recurring-invoices-api.d.ts +1 -1
  29. package/dist/api/recurring-invoices-api.js +20 -10
  30. package/dist/api/termination-invoices-api.d.ts +1 -1
  31. package/dist/api/termination-invoices-api.js +20 -10
  32. package/dist/api/withdraw-invoices-api.d.ts +1 -1
  33. package/dist/api/withdraw-invoices-api.js +20 -10
  34. package/dist/base.d.ts +1 -0
  35. package/dist/base.js +3 -0
  36. package/dist/common.d.ts +1 -1
  37. package/dist/common.js +1 -0
  38. package/dist/models/invoice-item-class.d.ts +12 -0
  39. package/models/invoice-item-class.ts +12 -0
  40. package/package.json +2 -2
@@ -64,12 +64,22 @@ 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. Without a session it is sent as before, empty when
68
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
69
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
70
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
71
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
72
+ if (authorizationValue || authorizationKeepEmpty) {
73
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
69
74
  }
70
75
 
71
- if (idempotencyKey !== undefined && idempotencyKey !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
72
- localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey ? idempotencyKey : baseAccessToken);
76
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
77
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
78
+ const idempotencyKeyIsAuth = 'Idempotency-Key'.toLowerCase() === 'authorization';
79
+ const idempotencyKeyValue = idempotencyKeyIsAuth ? (idempotencyKey || baseAccessToken) : idempotencyKey;
80
+ const idempotencyKeyKeepEmpty = idempotencyKeyIsAuth && idempotencyKeyValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
81
+ if (idempotencyKeyValue || idempotencyKeyKeepEmpty) {
82
+ localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKeyValue);
73
83
  }
74
84
 
75
85
 
@@ -178,6 +188,6 @@ export class RecurringInvoicesApi extends BaseAPI {
178
188
  * @memberof RecurringInvoicesApi
179
189
  */
180
190
  public createRecurringInvoice(requestParameters: RecurringInvoicesApiCreateRecurringInvoiceRequest, options?: AxiosRequestConfig) {
181
- return RecurringInvoicesApiFp(this.configuration).createRecurringInvoice(requestParameters.createInvoiceForPolicyRequestDto, requestParameters.authorization, requestParameters.idempotencyKey, options).then((request) => request(this.axios, this.basePath));
191
+ return RecurringInvoicesApiFp(this.configuration).createRecurringInvoice(requestParameters.createInvoiceForPolicyRequestDto, requestParameters.authorization, requestParameters.idempotencyKey, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
182
192
  }
183
193
  }
@@ -64,12 +64,22 @@ 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. Without a session it is sent as before, empty when
68
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
69
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
70
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
71
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
72
+ if (authorizationValue || authorizationKeepEmpty) {
73
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
69
74
  }
70
75
 
71
- if (idempotencyKey !== undefined && idempotencyKey !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
72
- localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey ? idempotencyKey : baseAccessToken);
76
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
77
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
78
+ const idempotencyKeyIsAuth = 'Idempotency-Key'.toLowerCase() === 'authorization';
79
+ const idempotencyKeyValue = idempotencyKeyIsAuth ? (idempotencyKey || baseAccessToken) : idempotencyKey;
80
+ const idempotencyKeyKeepEmpty = idempotencyKeyIsAuth && idempotencyKeyValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
81
+ if (idempotencyKeyValue || idempotencyKeyKeepEmpty) {
82
+ localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKeyValue);
73
83
  }
74
84
 
75
85
 
@@ -178,6 +188,6 @@ export class TerminationInvoicesApi extends BaseAPI {
178
188
  * @memberof TerminationInvoicesApi
179
189
  */
180
190
  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));
191
+ return TerminationInvoicesApiFp(this.configuration).createTerminationInvoice(requestParameters.createInvoiceForPolicyRequestDto, requestParameters.authorization, requestParameters.idempotencyKey, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
182
192
  }
183
193
  }
@@ -64,12 +64,22 @@ export const WithdrawInvoicesApiAxiosParamCreator = function (configuration?: Co
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. Without a session it is sent as before, empty when
68
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
69
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
70
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
71
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
72
+ if (authorizationValue || authorizationKeepEmpty) {
73
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
69
74
  }
70
75
 
71
- if (idempotencyKey !== undefined && idempotencyKey !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
72
- localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey ? idempotencyKey : baseAccessToken);
76
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
77
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
78
+ const idempotencyKeyIsAuth = 'Idempotency-Key'.toLowerCase() === 'authorization';
79
+ const idempotencyKeyValue = idempotencyKeyIsAuth ? (idempotencyKey || baseAccessToken) : idempotencyKey;
80
+ const idempotencyKeyKeepEmpty = idempotencyKeyIsAuth && idempotencyKeyValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
81
+ if (idempotencyKeyValue || idempotencyKeyKeepEmpty) {
82
+ localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKeyValue);
73
83
  }
74
84
 
75
85
 
@@ -178,6 +188,6 @@ export class WithdrawInvoicesApi extends BaseAPI {
178
188
  * @memberof WithdrawInvoicesApi
179
189
  */
180
190
  public createWithdrawInvoice(requestParameters: WithdrawInvoicesApiCreateWithdrawInvoiceRequest, options?: AxiosRequestConfig) {
181
- return WithdrawInvoicesApiFp(this.configuration).createWithdrawInvoice(requestParameters.createWithdrawInvoiceRequestDtoRest, requestParameters.authorization, requestParameters.idempotencyKey, options).then((request) => request(this.axios, this.basePath));
191
+ return WithdrawInvoicesApiFp(this.configuration).createWithdrawInvoice(requestParameters.createWithdrawInvoiceRequestDtoRest, requestParameters.authorization, requestParameters.idempotencyKey, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
182
192
  }
183
193
  }
package/base.ts CHANGED
@@ -92,6 +92,10 @@ export class BaseAPI {
92
92
  private username?: string;
93
93
  private password?: string;
94
94
 
95
+ protected withOwner(options?: AxiosRequestConfig): AxiosRequestConfig {
96
+ return { ...options };
97
+ }
98
+
95
99
  constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
96
100
  if (configuration) {
97
101
  this.configuration = configuration;
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
  }
@@ -108,9 +108,10 @@ var CorrectionInvoicesApiAxiosParamCreator = function (configuration) {
108
108
  createCorrectionInvoice: 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)('createCorrectionInvoice', 'createInvoiceForPolicyRequestDto', createInvoiceForPolicyRequestDto);
@@ -125,16 +126,25 @@ var CorrectionInvoicesApiAxiosParamCreator = 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);
@@ -159,9 +169,10 @@ var CorrectionInvoicesApiAxiosParamCreator = function (configuration) {
159
169
  revertInvoice: function (revertInvoiceRequestDto, authorization, options) {
160
170
  if (options === void 0) { options = {}; }
161
171
  return __awaiter(_this, void 0, void 0, function () {
162
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
163
- return __generator(this, function (_a) {
164
- switch (_a.label) {
172
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
173
+ var _a;
174
+ return __generator(this, function (_b) {
175
+ switch (_b.label) {
165
176
  case 0:
166
177
  // verify required parameter 'revertInvoiceRequestDto' is not null or undefined
167
178
  (0, common_1.assertParamExists)('revertInvoice', 'revertInvoiceRequestDto', revertInvoiceRequestDto);
@@ -176,13 +187,19 @@ var CorrectionInvoicesApiAxiosParamCreator = function (configuration) {
176
187
  localVarQueryParameter = {};
177
188
  // authentication bearer required
178
189
  // http bearer authentication required
179
- return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
190
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
191
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
192
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
193
+ ];
180
194
  case 1:
181
195
  // authentication bearer required
182
196
  // http bearer authentication required
183
- _a.sent();
184
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
185
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
197
+ _b.sent();
198
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
199
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
200
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
201
+ if (authorizationValue || authorizationKeepEmpty) {
202
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
186
203
  }
187
204
  localVarHeaderParameter['Content-Type'] = 'application/json';
188
205
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
@@ -305,7 +322,7 @@ var CorrectionInvoicesApi = /** @class */ (function (_super) {
305
322
  */
306
323
  CorrectionInvoicesApi.prototype.createCorrectionInvoice = function (requestParameters, options) {
307
324
  var _this = this;
308
- return (0, exports.CorrectionInvoicesApiFp)(this.configuration).createCorrectionInvoice(requestParameters.createInvoiceForPolicyRequestDto, requestParameters.authorization, requestParameters.idempotencyKey, options).then(function (request) { return request(_this.axios, _this.basePath); });
325
+ return (0, exports.CorrectionInvoicesApiFp)(this.configuration).createCorrectionInvoice(requestParameters.createInvoiceForPolicyRequestDto, requestParameters.authorization, requestParameters.idempotencyKey, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
309
326
  };
310
327
  /**
311
328
  * undefined **Required Permissions** \"billing-management.invoices.update\"
@@ -316,7 +333,7 @@ var CorrectionInvoicesApi = /** @class */ (function (_super) {
316
333
  */
317
334
  CorrectionInvoicesApi.prototype.revertInvoice = function (requestParameters, options) {
318
335
  var _this = this;
319
- return (0, exports.CorrectionInvoicesApiFp)(this.configuration).revertInvoice(requestParameters.revertInvoiceRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
336
+ return (0, exports.CorrectionInvoicesApiFp)(this.configuration).revertInvoice(requestParameters.revertInvoiceRequestDto, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
320
337
  };
321
338
  return CorrectionInvoicesApi;
322
339
  }(base_1.BaseAPI));
@@ -165,7 +165,7 @@ export declare class DraftInvoiceApi extends BaseAPI {
165
165
  * @throws {RequiredError}
166
166
  * @memberof DraftInvoiceApi
167
167
  */
168
- createDraftInvoice(requestParameters: DraftInvoiceApiCreateDraftInvoiceRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any, {}>>;
168
+ createDraftInvoice(requestParameters: DraftInvoiceApiCreateDraftInvoiceRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any, {}, any>>;
169
169
  /**
170
170
  * undefined **Required Permissions** \"billing-management.invoices.delete\"
171
171
  * @param {DraftInvoiceApiDeleteAllDraftInvoicesRequest} requestParameters Request parameters.
@@ -173,7 +173,7 @@ export declare class DraftInvoiceApi extends BaseAPI {
173
173
  * @throws {RequiredError}
174
174
  * @memberof DraftInvoiceApi
175
175
  */
176
- deleteAllDraftInvoices(requestParameters?: DraftInvoiceApiDeleteAllDraftInvoicesRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any, {}>>;
176
+ deleteAllDraftInvoices(requestParameters?: DraftInvoiceApiDeleteAllDraftInvoicesRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any, {}, any>>;
177
177
  /**
178
178
  * undefined **Required Permissions** \"billing-management.invoices.delete\"
179
179
  * @param {DraftInvoiceApiDeleteDraftInvoiceRequest} requestParameters Request parameters.
@@ -181,5 +181,5 @@ export declare class DraftInvoiceApi extends BaseAPI {
181
181
  * @throws {RequiredError}
182
182
  * @memberof DraftInvoiceApi
183
183
  */
184
- deleteDraftInvoice(requestParameters: DraftInvoiceApiDeleteDraftInvoiceRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any, {}>>;
184
+ deleteDraftInvoice(requestParameters: DraftInvoiceApiDeleteDraftInvoiceRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any, {}, any>>;
185
185
  }
@@ -106,9 +106,10 @@ var DraftInvoiceApiAxiosParamCreator = function (configuration) {
106
106
  createDraftInvoice: function (createDraftInvoiceRequestDto, authorization, options) {
107
107
  if (options === void 0) { options = {}; }
108
108
  return __awaiter(_this, void 0, void 0, function () {
109
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
110
- return __generator(this, function (_a) {
111
- switch (_a.label) {
109
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
110
+ var _a;
111
+ return __generator(this, function (_b) {
112
+ switch (_b.label) {
112
113
  case 0:
113
114
  // verify required parameter 'createDraftInvoiceRequestDto' is not null or undefined
114
115
  (0, common_1.assertParamExists)('createDraftInvoice', 'createDraftInvoiceRequestDto', createDraftInvoiceRequestDto);
@@ -123,13 +124,19 @@ var DraftInvoiceApiAxiosParamCreator = function (configuration) {
123
124
  localVarQueryParameter = {};
124
125
  // authentication bearer required
125
126
  // http bearer authentication required
126
- return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
127
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
128
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
129
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
130
+ ];
127
131
  case 1:
128
132
  // authentication bearer required
129
133
  // http bearer authentication required
130
- _a.sent();
131
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
132
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
134
+ _b.sent();
135
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
136
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
137
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
138
+ if (authorizationValue || authorizationKeepEmpty) {
139
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
133
140
  }
134
141
  localVarHeaderParameter['Content-Type'] = 'application/json';
135
142
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
@@ -153,9 +160,10 @@ var DraftInvoiceApiAxiosParamCreator = function (configuration) {
153
160
  deleteAllDraftInvoices: function (authorization, options) {
154
161
  if (options === void 0) { options = {}; }
155
162
  return __awaiter(_this, void 0, void 0, function () {
156
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
157
- return __generator(this, function (_a) {
158
- switch (_a.label) {
163
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
164
+ var _a;
165
+ return __generator(this, function (_b) {
166
+ switch (_b.label) {
159
167
  case 0:
160
168
  localVarPath = "/billingservice/v1/draft-invoices";
161
169
  localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
@@ -168,13 +176,19 @@ var DraftInvoiceApiAxiosParamCreator = function (configuration) {
168
176
  localVarQueryParameter = {};
169
177
  // authentication bearer required
170
178
  // http bearer authentication required
171
- return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
179
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
180
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
181
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
182
+ ];
172
183
  case 1:
173
184
  // authentication bearer required
174
185
  // http bearer authentication required
175
- _a.sent();
176
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
177
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
186
+ _b.sent();
187
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
188
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
189
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
190
+ if (authorizationValue || authorizationKeepEmpty) {
191
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
178
192
  }
179
193
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
180
194
  headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
@@ -197,9 +211,10 @@ var DraftInvoiceApiAxiosParamCreator = function (configuration) {
197
211
  deleteDraftInvoice: function (body, authorization, options) {
198
212
  if (options === void 0) { options = {}; }
199
213
  return __awaiter(_this, void 0, void 0, function () {
200
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
201
- return __generator(this, function (_a) {
202
- switch (_a.label) {
214
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
215
+ var _a;
216
+ return __generator(this, function (_b) {
217
+ switch (_b.label) {
203
218
  case 0:
204
219
  // verify required parameter 'body' is not null or undefined
205
220
  (0, common_1.assertParamExists)('deleteDraftInvoice', 'body', body);
@@ -214,13 +229,19 @@ var DraftInvoiceApiAxiosParamCreator = function (configuration) {
214
229
  localVarQueryParameter = {};
215
230
  // authentication bearer required
216
231
  // http bearer authentication required
217
- return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
232
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
233
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
234
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
235
+ ];
218
236
  case 1:
219
237
  // authentication bearer required
220
238
  // http bearer authentication required
221
- _a.sent();
222
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
223
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
239
+ _b.sent();
240
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
241
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
242
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
243
+ if (authorizationValue || authorizationKeepEmpty) {
244
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
224
245
  }
225
246
  localVarHeaderParameter['Content-Type'] = 'application/json';
226
247
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
@@ -366,7 +387,7 @@ var DraftInvoiceApi = /** @class */ (function (_super) {
366
387
  */
367
388
  DraftInvoiceApi.prototype.createDraftInvoice = function (requestParameters, options) {
368
389
  var _this = this;
369
- return (0, exports.DraftInvoiceApiFp)(this.configuration).createDraftInvoice(requestParameters.createDraftInvoiceRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
390
+ return (0, exports.DraftInvoiceApiFp)(this.configuration).createDraftInvoice(requestParameters.createDraftInvoiceRequestDto, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
370
391
  };
371
392
  /**
372
393
  * undefined **Required Permissions** \"billing-management.invoices.delete\"
@@ -378,7 +399,7 @@ var DraftInvoiceApi = /** @class */ (function (_super) {
378
399
  DraftInvoiceApi.prototype.deleteAllDraftInvoices = function (requestParameters, options) {
379
400
  var _this = this;
380
401
  if (requestParameters === void 0) { requestParameters = {}; }
381
- return (0, exports.DraftInvoiceApiFp)(this.configuration).deleteAllDraftInvoices(requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
402
+ return (0, exports.DraftInvoiceApiFp)(this.configuration).deleteAllDraftInvoices(requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
382
403
  };
383
404
  /**
384
405
  * undefined **Required Permissions** \"billing-management.invoices.delete\"
@@ -389,7 +410,7 @@ var DraftInvoiceApi = /** @class */ (function (_super) {
389
410
  */
390
411
  DraftInvoiceApi.prototype.deleteDraftInvoice = function (requestParameters, options) {
391
412
  var _this = this;
392
- return (0, exports.DraftInvoiceApiFp)(this.configuration).deleteDraftInvoice(requestParameters.body, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
413
+ return (0, exports.DraftInvoiceApiFp)(this.configuration).deleteDraftInvoice(requestParameters.body, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
393
414
  };
394
415
  return DraftInvoiceApi;
395
416
  }(base_1.BaseAPI));
@@ -246,7 +246,7 @@ export declare class EstimatedInvoicesApi extends BaseAPI {
246
246
  * @throws {RequiredError}
247
247
  * @memberof EstimatedInvoicesApi
248
248
  */
249
- createCustomEstimatedInvoice(requestParameters: EstimatedInvoicesApiCreateCustomEstimatedInvoiceRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateCustomEstimatedInvoiceResponseClass, any, {}>>;
249
+ createCustomEstimatedInvoice(requestParameters: EstimatedInvoicesApiCreateCustomEstimatedInvoiceRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateCustomEstimatedInvoiceResponseClass, any, {}, any>>;
250
250
  /**
251
251
  * This creates an estimated invoice. It will not be saved in the database. **Required Permissions** \"billing-management.invoices.create\"
252
252
  * @summary Create the estimated invoice
@@ -255,7 +255,7 @@ export declare class EstimatedInvoicesApi extends BaseAPI {
255
255
  * @throws {RequiredError}
256
256
  * @memberof EstimatedInvoicesApi
257
257
  */
258
- createEstimatedInvoice(requestParameters: EstimatedInvoicesApiCreateEstimatedInvoiceRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateEstimatedInvoiceResponseClass, any, {}>>;
258
+ createEstimatedInvoice(requestParameters: EstimatedInvoicesApiCreateEstimatedInvoiceRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateEstimatedInvoiceResponseClass, any, {}, any>>;
259
259
  /**
260
260
  * This creates an estimated invoice. It will not be saved in the database. **Required Permissions** \"billing-management.invoices.create\"
261
261
  * @summary Create the estimated invoice
@@ -264,7 +264,7 @@ export declare class EstimatedInvoicesApi extends BaseAPI {
264
264
  * @throws {RequiredError}
265
265
  * @memberof EstimatedInvoicesApi
266
266
  */
267
- createEstimatedInvoiceFromInterval(requestParameters: EstimatedInvoicesApiCreateEstimatedInvoiceFromIntervalRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateEstimatedInvoiceForIntervalResponseClass, any, {}>>;
267
+ createEstimatedInvoiceFromInterval(requestParameters: EstimatedInvoicesApiCreateEstimatedInvoiceFromIntervalRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateEstimatedInvoiceForIntervalResponseClass, any, {}, any>>;
268
268
  /**
269
269
  * This creates an estimated product invoice. It will not be saved in the database. **Required Permissions** \"billing-management.invoices.create\"
270
270
  * @summary Create the estimated invoice
@@ -273,5 +273,5 @@ export declare class EstimatedInvoicesApi extends BaseAPI {
273
273
  * @throws {RequiredError}
274
274
  * @memberof EstimatedInvoicesApi
275
275
  */
276
- createProductEstimatedInvoice(requestParameters: EstimatedInvoicesApiCreateProductEstimatedInvoiceRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateProductEstimatedInvoiceResponseClass, any, {}>>;
276
+ createProductEstimatedInvoice(requestParameters: EstimatedInvoicesApiCreateProductEstimatedInvoiceRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateProductEstimatedInvoiceResponseClass, any, {}, any>>;
277
277
  }