@emilgroup/discount-sdk-node 1.12.1-beta.15 → 1.12.1-beta.18

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.
@@ -107,9 +107,10 @@ var CampaignsApiAxiosParamCreator = function (configuration) {
107
107
  createCampaign: function (createCampaignRequestDto, 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 'createCampaignRequestDto' is not null or undefined
115
116
  (0, common_1.assertParamExists)('createCampaign', 'createCampaignRequestDto', createCampaignRequestDto);
@@ -124,13 +125,19 @@ var CampaignsApiAxiosParamCreator = 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);
@@ -157,9 +164,10 @@ var CampaignsApiAxiosParamCreator = function (configuration) {
157
164
  createEligibleAccount: function (code, createEligibleAccountRequestDto, authorization, options) {
158
165
  if (options === void 0) { options = {}; }
159
166
  return __awaiter(_this, void 0, void 0, function () {
160
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
161
- return __generator(this, function (_a) {
162
- switch (_a.label) {
167
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
168
+ var _a;
169
+ return __generator(this, function (_b) {
170
+ switch (_b.label) {
163
171
  case 0:
164
172
  // verify required parameter 'code' is not null or undefined
165
173
  (0, common_1.assertParamExists)('createEligibleAccount', 'code', code);
@@ -177,13 +185,19 @@ var CampaignsApiAxiosParamCreator = function (configuration) {
177
185
  localVarQueryParameter = {};
178
186
  // authentication bearer required
179
187
  // http bearer authentication required
180
- return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
188
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
189
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
190
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
191
+ ];
181
192
  case 1:
182
193
  // authentication bearer required
183
194
  // http bearer authentication required
184
- _a.sent();
185
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
186
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
195
+ _b.sent();
196
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
197
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
198
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
199
+ if (authorizationValue || authorizationKeepEmpty) {
200
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
187
201
  }
188
202
  localVarHeaderParameter['Content-Type'] = 'application/json';
189
203
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
@@ -209,9 +223,10 @@ var CampaignsApiAxiosParamCreator = function (configuration) {
209
223
  deleteCampaign: function (code, authorization, options) {
210
224
  if (options === void 0) { options = {}; }
211
225
  return __awaiter(_this, void 0, void 0, function () {
212
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
213
- return __generator(this, function (_a) {
214
- switch (_a.label) {
226
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
227
+ var _a;
228
+ return __generator(this, function (_b) {
229
+ switch (_b.label) {
215
230
  case 0:
216
231
  // verify required parameter 'code' is not null or undefined
217
232
  (0, common_1.assertParamExists)('deleteCampaign', 'code', code);
@@ -227,13 +242,19 @@ var CampaignsApiAxiosParamCreator = function (configuration) {
227
242
  localVarQueryParameter = {};
228
243
  // authentication bearer required
229
244
  // http bearer authentication required
230
- return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
245
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
246
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
247
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
248
+ ];
231
249
  case 1:
232
250
  // authentication bearer required
233
251
  // http bearer authentication required
234
- _a.sent();
235
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
236
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
252
+ _b.sent();
253
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
254
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
255
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
256
+ if (authorizationValue || authorizationKeepEmpty) {
257
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
237
258
  }
238
259
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
239
260
  headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
@@ -258,9 +279,10 @@ var CampaignsApiAxiosParamCreator = function (configuration) {
258
279
  deleteEligibleAccount: function (code, accountCode, authorization, options) {
259
280
  if (options === void 0) { options = {}; }
260
281
  return __awaiter(_this, void 0, void 0, function () {
261
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
262
- return __generator(this, function (_a) {
263
- switch (_a.label) {
282
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
283
+ var _a;
284
+ return __generator(this, function (_b) {
285
+ switch (_b.label) {
264
286
  case 0:
265
287
  // verify required parameter 'code' is not null or undefined
266
288
  (0, common_1.assertParamExists)('deleteEligibleAccount', 'code', code);
@@ -279,13 +301,19 @@ var CampaignsApiAxiosParamCreator = function (configuration) {
279
301
  localVarQueryParameter = {};
280
302
  // authentication bearer required
281
303
  // http bearer authentication required
282
- return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
304
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
305
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
306
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
307
+ ];
283
308
  case 1:
284
309
  // authentication bearer required
285
310
  // http bearer authentication required
286
- _a.sent();
287
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
288
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
311
+ _b.sent();
312
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
313
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
314
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
315
+ if (authorizationValue || authorizationKeepEmpty) {
316
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
289
317
  }
290
318
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
291
319
  headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
@@ -309,9 +337,10 @@ var CampaignsApiAxiosParamCreator = function (configuration) {
309
337
  deleteEligibleAccounts: function (code, authorization, options) {
310
338
  if (options === void 0) { options = {}; }
311
339
  return __awaiter(_this, void 0, void 0, function () {
312
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
313
- return __generator(this, function (_a) {
314
- switch (_a.label) {
340
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
341
+ var _a;
342
+ return __generator(this, function (_b) {
343
+ switch (_b.label) {
315
344
  case 0:
316
345
  // verify required parameter 'code' is not null or undefined
317
346
  (0, common_1.assertParamExists)('deleteEligibleAccounts', 'code', code);
@@ -327,13 +356,19 @@ var CampaignsApiAxiosParamCreator = function (configuration) {
327
356
  localVarQueryParameter = {};
328
357
  // authentication bearer required
329
358
  // http bearer authentication required
330
- return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
359
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
360
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
361
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
362
+ ];
331
363
  case 1:
332
364
  // authentication bearer required
333
365
  // http bearer authentication required
334
- _a.sent();
335
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
336
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
366
+ _b.sent();
367
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
368
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
369
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
370
+ if (authorizationValue || authorizationKeepEmpty) {
371
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
337
372
  }
338
373
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
339
374
  headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
@@ -358,9 +393,10 @@ var CampaignsApiAxiosParamCreator = function (configuration) {
358
393
  getCampaign: function (code, authorization, expand, options) {
359
394
  if (options === void 0) { options = {}; }
360
395
  return __awaiter(_this, void 0, void 0, function () {
361
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
362
- return __generator(this, function (_a) {
363
- switch (_a.label) {
396
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
397
+ var _a;
398
+ return __generator(this, function (_b) {
399
+ switch (_b.label) {
364
400
  case 0:
365
401
  // verify required parameter 'code' is not null or undefined
366
402
  (0, common_1.assertParamExists)('getCampaign', 'code', code);
@@ -380,12 +416,15 @@ var CampaignsApiAxiosParamCreator = function (configuration) {
380
416
  case 1:
381
417
  // authentication bearer required
382
418
  // http bearer authentication required
383
- _a.sent();
419
+ _b.sent();
384
420
  if (expand !== undefined) {
385
421
  localVarQueryParameter['expand'] = expand;
386
422
  }
387
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
388
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
423
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
424
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
425
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
426
+ if (authorizationValue || authorizationKeepEmpty) {
427
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
389
428
  }
390
429
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
391
430
  headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
@@ -415,9 +454,10 @@ var CampaignsApiAxiosParamCreator = function (configuration) {
415
454
  listCampaigns: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
416
455
  if (options === void 0) { options = {}; }
417
456
  return __awaiter(_this, void 0, void 0, function () {
418
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
419
- return __generator(this, function (_a) {
420
- switch (_a.label) {
457
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
458
+ var _a;
459
+ return __generator(this, function (_b) {
460
+ switch (_b.label) {
421
461
  case 0:
422
462
  localVarPath = "/discountservice/v1/campaigns";
423
463
  localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
@@ -434,7 +474,7 @@ var CampaignsApiAxiosParamCreator = function (configuration) {
434
474
  case 1:
435
475
  // authentication bearer required
436
476
  // http bearer authentication required
437
- _a.sent();
477
+ _b.sent();
438
478
  if (pageSize !== undefined) {
439
479
  localVarQueryParameter['pageSize'] = pageSize;
440
480
  }
@@ -456,8 +496,11 @@ var CampaignsApiAxiosParamCreator = function (configuration) {
456
496
  if (filters !== undefined) {
457
497
  localVarQueryParameter['filters'] = filters;
458
498
  }
459
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
460
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
499
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
500
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
501
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
502
+ if (authorizationValue || authorizationKeepEmpty) {
503
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
461
504
  }
462
505
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
463
506
  headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
@@ -487,9 +530,10 @@ var CampaignsApiAxiosParamCreator = function (configuration) {
487
530
  listEligibleAccounts: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
488
531
  if (options === void 0) { options = {}; }
489
532
  return __awaiter(_this, void 0, void 0, function () {
490
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
491
- return __generator(this, function (_a) {
492
- switch (_a.label) {
533
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
534
+ var _a;
535
+ return __generator(this, function (_b) {
536
+ switch (_b.label) {
493
537
  case 0:
494
538
  localVarPath = "/discountservice/v1/campaigns/eligible-accounts";
495
539
  localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
@@ -506,7 +550,7 @@ var CampaignsApiAxiosParamCreator = function (configuration) {
506
550
  case 1:
507
551
  // authentication bearer required
508
552
  // http bearer authentication required
509
- _a.sent();
553
+ _b.sent();
510
554
  if (pageSize !== undefined) {
511
555
  localVarQueryParameter['pageSize'] = pageSize;
512
556
  }
@@ -528,8 +572,11 @@ var CampaignsApiAxiosParamCreator = function (configuration) {
528
572
  if (filters !== undefined) {
529
573
  localVarQueryParameter['filters'] = filters;
530
574
  }
531
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
532
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
575
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
576
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
577
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
578
+ if (authorizationValue || authorizationKeepEmpty) {
579
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
533
580
  }
534
581
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
535
582
  headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
@@ -554,9 +601,10 @@ var CampaignsApiAxiosParamCreator = function (configuration) {
554
601
  updateCampaign: function (code, updateCampaignRequestDto, authorization, options) {
555
602
  if (options === void 0) { options = {}; }
556
603
  return __awaiter(_this, void 0, void 0, function () {
557
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
558
- return __generator(this, function (_a) {
559
- switch (_a.label) {
604
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
605
+ var _a;
606
+ return __generator(this, function (_b) {
607
+ switch (_b.label) {
560
608
  case 0:
561
609
  // verify required parameter 'code' is not null or undefined
562
610
  (0, common_1.assertParamExists)('updateCampaign', 'code', code);
@@ -574,13 +622,19 @@ var CampaignsApiAxiosParamCreator = function (configuration) {
574
622
  localVarQueryParameter = {};
575
623
  // authentication bearer required
576
624
  // http bearer authentication required
577
- return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
625
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
626
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
627
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
628
+ ];
578
629
  case 1:
579
630
  // authentication bearer required
580
631
  // http bearer authentication required
581
- _a.sent();
582
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
583
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
632
+ _b.sent();
633
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
634
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
635
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
636
+ if (authorizationValue || authorizationKeepEmpty) {
637
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
584
638
  }
585
639
  localVarHeaderParameter['Content-Type'] = 'application/json';
586
640
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
@@ -607,9 +661,10 @@ var CampaignsApiAxiosParamCreator = function (configuration) {
607
661
  updateCampaignStatus: function (code, updateCampaignStatusRequestDto, authorization, options) {
608
662
  if (options === void 0) { options = {}; }
609
663
  return __awaiter(_this, void 0, void 0, function () {
610
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
611
- return __generator(this, function (_a) {
612
- switch (_a.label) {
664
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
665
+ var _a;
666
+ return __generator(this, function (_b) {
667
+ switch (_b.label) {
613
668
  case 0:
614
669
  // verify required parameter 'code' is not null or undefined
615
670
  (0, common_1.assertParamExists)('updateCampaignStatus', 'code', code);
@@ -627,13 +682,19 @@ var CampaignsApiAxiosParamCreator = function (configuration) {
627
682
  localVarQueryParameter = {};
628
683
  // authentication bearer required
629
684
  // http bearer authentication required
630
- return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
685
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
686
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
687
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
688
+ ];
631
689
  case 1:
632
690
  // authentication bearer required
633
691
  // http bearer authentication required
634
- _a.sent();
635
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
636
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
692
+ _b.sent();
693
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
694
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
695
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
696
+ if (authorizationValue || authorizationKeepEmpty) {
697
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
637
698
  }
638
699
  localVarHeaderParameter['Content-Type'] = 'application/json';
639
700
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
@@ -659,9 +720,10 @@ var CampaignsApiAxiosParamCreator = function (configuration) {
659
720
  uploadEligibleAccounts: function (code, authorization, options) {
660
721
  if (options === void 0) { options = {}; }
661
722
  return __awaiter(_this, void 0, void 0, function () {
662
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
663
- return __generator(this, function (_a) {
664
- switch (_a.label) {
723
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
724
+ var _a;
725
+ return __generator(this, function (_b) {
726
+ switch (_b.label) {
665
727
  case 0:
666
728
  // verify required parameter 'code' is not null or undefined
667
729
  (0, common_1.assertParamExists)('uploadEligibleAccounts', 'code', code);
@@ -677,13 +739,19 @@ var CampaignsApiAxiosParamCreator = function (configuration) {
677
739
  localVarQueryParameter = {};
678
740
  // authentication bearer required
679
741
  // http bearer authentication required
680
- return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
742
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
743
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
744
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
745
+ ];
681
746
  case 1:
682
747
  // authentication bearer required
683
748
  // http bearer authentication required
684
- _a.sent();
685
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
686
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
749
+ _b.sent();
750
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
751
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
752
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
753
+ if (authorizationValue || authorizationKeepEmpty) {
754
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
687
755
  }
688
756
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
689
757
  headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
@@ -1126,7 +1194,7 @@ var CampaignsApi = /** @class */ (function (_super) {
1126
1194
  */
1127
1195
  CampaignsApi.prototype.createCampaign = function (requestParameters, options) {
1128
1196
  var _this = this;
1129
- return (0, exports.CampaignsApiFp)(this.configuration).createCampaign(requestParameters.createCampaignRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
1197
+ return (0, exports.CampaignsApiFp)(this.configuration).createCampaign(requestParameters.createCampaignRequestDto, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
1130
1198
  };
1131
1199
  /**
1132
1200
  * Creates an account that is eligible to redeem a vouchers from a specific campaign.
@@ -1138,7 +1206,7 @@ var CampaignsApi = /** @class */ (function (_super) {
1138
1206
  */
1139
1207
  CampaignsApi.prototype.createEligibleAccount = function (requestParameters, options) {
1140
1208
  var _this = this;
1141
- return (0, exports.CampaignsApiFp)(this.configuration).createEligibleAccount(requestParameters.code, requestParameters.createEligibleAccountRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
1209
+ return (0, exports.CampaignsApiFp)(this.configuration).createEligibleAccount(requestParameters.code, requestParameters.createEligibleAccountRequestDto, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
1142
1210
  };
1143
1211
  /**
1144
1212
  * Removes a campaign and its associated vouchers. This will prevent any further voucher redemptions.
@@ -1150,7 +1218,7 @@ var CampaignsApi = /** @class */ (function (_super) {
1150
1218
  */
1151
1219
  CampaignsApi.prototype.deleteCampaign = function (requestParameters, options) {
1152
1220
  var _this = this;
1153
- return (0, exports.CampaignsApiFp)(this.configuration).deleteCampaign(requestParameters.code, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
1221
+ return (0, exports.CampaignsApiFp)(this.configuration).deleteCampaign(requestParameters.code, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
1154
1222
  };
1155
1223
  /**
1156
1224
  * Removes an eligible account from a campaign. This will prevent the account from using the assigned voucher code for discounts when the campaign is released.
@@ -1162,7 +1230,7 @@ var CampaignsApi = /** @class */ (function (_super) {
1162
1230
  */
1163
1231
  CampaignsApi.prototype.deleteEligibleAccount = function (requestParameters, options) {
1164
1232
  var _this = this;
1165
- return (0, exports.CampaignsApiFp)(this.configuration).deleteEligibleAccount(requestParameters.code, requestParameters.accountCode, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
1233
+ return (0, exports.CampaignsApiFp)(this.configuration).deleteEligibleAccount(requestParameters.code, requestParameters.accountCode, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
1166
1234
  };
1167
1235
  /**
1168
1236
  * Removes all eligible accounts from a campaign. This will prevent these accounts from using their assigned voucher codes for discounts when the campaign is released.
@@ -1174,7 +1242,7 @@ var CampaignsApi = /** @class */ (function (_super) {
1174
1242
  */
1175
1243
  CampaignsApi.prototype.deleteEligibleAccounts = function (requestParameters, options) {
1176
1244
  var _this = this;
1177
- return (0, exports.CampaignsApiFp)(this.configuration).deleteEligibleAccounts(requestParameters.code, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
1245
+ return (0, exports.CampaignsApiFp)(this.configuration).deleteEligibleAccounts(requestParameters.code, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
1178
1246
  };
1179
1247
  /**
1180
1248
  * Retrieves detailed information about a specific campaign.
@@ -1186,7 +1254,7 @@ var CampaignsApi = /** @class */ (function (_super) {
1186
1254
  */
1187
1255
  CampaignsApi.prototype.getCampaign = function (requestParameters, options) {
1188
1256
  var _this = this;
1189
- return (0, exports.CampaignsApiFp)(this.configuration).getCampaign(requestParameters.code, requestParameters.authorization, requestParameters.expand, options).then(function (request) { return request(_this.axios, _this.basePath); });
1257
+ return (0, exports.CampaignsApiFp)(this.configuration).getCampaign(requestParameters.code, requestParameters.authorization, requestParameters.expand, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
1190
1258
  };
1191
1259
  /**
1192
1260
  * Retrieves a list of campaigns.
@@ -1199,7 +1267,7 @@ var CampaignsApi = /** @class */ (function (_super) {
1199
1267
  CampaignsApi.prototype.listCampaigns = function (requestParameters, options) {
1200
1268
  var _this = this;
1201
1269
  if (requestParameters === void 0) { requestParameters = {}; }
1202
- return (0, exports.CampaignsApiFp)(this.configuration).listCampaigns(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); });
1270
+ return (0, exports.CampaignsApiFp)(this.configuration).listCampaigns(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); });
1203
1271
  };
1204
1272
  /**
1205
1273
  * Retrieves a list of eligible accounts.
@@ -1212,7 +1280,7 @@ var CampaignsApi = /** @class */ (function (_super) {
1212
1280
  CampaignsApi.prototype.listEligibleAccounts = function (requestParameters, options) {
1213
1281
  var _this = this;
1214
1282
  if (requestParameters === void 0) { requestParameters = {}; }
1215
- return (0, exports.CampaignsApiFp)(this.configuration).listEligibleAccounts(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); });
1283
+ return (0, exports.CampaignsApiFp)(this.configuration).listEligibleAccounts(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); });
1216
1284
  };
1217
1285
  /**
1218
1286
  * Updates the data of an existing campaign. Only DRAFT campaigns can be updated.
@@ -1224,7 +1292,7 @@ var CampaignsApi = /** @class */ (function (_super) {
1224
1292
  */
1225
1293
  CampaignsApi.prototype.updateCampaign = function (requestParameters, options) {
1226
1294
  var _this = this;
1227
- return (0, exports.CampaignsApiFp)(this.configuration).updateCampaign(requestParameters.code, requestParameters.updateCampaignRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
1295
+ return (0, exports.CampaignsApiFp)(this.configuration).updateCampaign(requestParameters.code, requestParameters.updateCampaignRequestDto, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
1228
1296
  };
1229
1297
  /**
1230
1298
  * Updates the status of a campaign, which affects whether vouchers can be redeemed.
@@ -1236,7 +1304,7 @@ var CampaignsApi = /** @class */ (function (_super) {
1236
1304
  */
1237
1305
  CampaignsApi.prototype.updateCampaignStatus = function (requestParameters, options) {
1238
1306
  var _this = this;
1239
- return (0, exports.CampaignsApiFp)(this.configuration).updateCampaignStatus(requestParameters.code, requestParameters.updateCampaignStatusRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
1307
+ return (0, exports.CampaignsApiFp)(this.configuration).updateCampaignStatus(requestParameters.code, requestParameters.updateCampaignStatusRequestDto, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
1240
1308
  };
1241
1309
  /**
1242
1310
  * Uploads accounts that are eligible to redeem vouchers from a specific campaign using a CSV file. The CSV file must contain a header row with the following columns: partnerNumber, voucherCode. Separate each column with a comma.
@@ -1248,7 +1316,7 @@ var CampaignsApi = /** @class */ (function (_super) {
1248
1316
  */
1249
1317
  CampaignsApi.prototype.uploadEligibleAccounts = function (requestParameters, options) {
1250
1318
  var _this = this;
1251
- return (0, exports.CampaignsApiFp)(this.configuration).uploadEligibleAccounts(requestParameters.code, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
1319
+ return (0, exports.CampaignsApiFp)(this.configuration).uploadEligibleAccounts(requestParameters.code, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
1252
1320
  };
1253
1321
  return CampaignsApi;
1254
1322
  }(base_1.BaseAPI));
@@ -66,5 +66,5 @@ export declare class HealthApi extends BaseAPI {
66
66
  * @throws {RequiredError}
67
67
  * @memberof HealthApi
68
68
  */
69
- check(options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<InlineResponse200, any, {}>>;
69
+ check(options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<InlineResponse200, any, {}, any>>;
70
70
  }
@@ -197,7 +197,7 @@ var HealthApi = /** @class */ (function (_super) {
197
197
  */
198
198
  HealthApi.prototype.check = function (options) {
199
199
  var _this = this;
200
- return (0, exports.HealthApiFp)(this.configuration).check(options).then(function (request) { return request(_this.axios, _this.basePath); });
200
+ return (0, exports.HealthApiFp)(this.configuration).check(this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
201
201
  };
202
202
  return HealthApi;
203
203
  }(base_1.BaseAPI));
@@ -488,7 +488,7 @@ export declare class PolicyVouchersApi extends BaseAPI {
488
488
  * @throws {RequiredError}
489
489
  * @memberof PolicyVouchersApi
490
490
  */
491
- chargePolicyVoucher(requestParameters: PolicyVouchersApiChargePolicyVoucherRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ChargePolicyVoucherResponseClass, any, {}>>;
491
+ chargePolicyVoucher(requestParameters: PolicyVouchersApiChargePolicyVoucherRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ChargePolicyVoucherResponseClass, any, {}, any>>;
492
492
  /**
493
493
  * This will check if the account is eligible for a specific voucher.
494
494
  * @summary Checks the account eligibility.
@@ -497,7 +497,7 @@ export declare class PolicyVouchersApi extends BaseAPI {
497
497
  * @throws {RequiredError}
498
498
  * @memberof PolicyVouchersApi
499
499
  */
500
- checkAccountEligibility(requestParameters: PolicyVouchersApiCheckAccountEligibilityRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CheckAccountEligibilityResponseClass, any, {}>>;
500
+ checkAccountEligibility(requestParameters: PolicyVouchersApiCheckAccountEligibilityRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CheckAccountEligibilityResponseClass, any, {}, any>>;
501
501
  /**
502
502
  * This will create an policy voucher.
503
503
  * @summary Create the policy voucher
@@ -506,7 +506,7 @@ export declare class PolicyVouchersApi extends BaseAPI {
506
506
  * @throws {RequiredError}
507
507
  * @memberof PolicyVouchersApi
508
508
  */
509
- createPolicyVoucher(requestParameters: PolicyVouchersApiCreatePolicyVoucherRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreatePolicyVoucherResponseClass, any, {}>>;
509
+ createPolicyVoucher(requestParameters: PolicyVouchersApiCreatePolicyVoucherRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreatePolicyVoucherResponseClass, any, {}, any>>;
510
510
  /**
511
511
  * This will delete an policy voucher.
512
512
  * @summary Delete the policy voucher
@@ -515,7 +515,7 @@ export declare class PolicyVouchersApi extends BaseAPI {
515
515
  * @throws {RequiredError}
516
516
  * @memberof PolicyVouchersApi
517
517
  */
518
- deletePolicyVoucher(requestParameters: PolicyVouchersApiDeletePolicyVoucherRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any, {}>>;
518
+ deletePolicyVoucher(requestParameters: PolicyVouchersApiDeletePolicyVoucherRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any, {}, any>>;
519
519
  /**
520
520
  * This will get an policy voucher.
521
521
  * @summary Retrieve the policy voucher
@@ -524,7 +524,7 @@ export declare class PolicyVouchersApi extends BaseAPI {
524
524
  * @throws {RequiredError}
525
525
  * @memberof PolicyVouchersApi
526
526
  */
527
- getPolicyVoucher(requestParameters: PolicyVouchersApiGetPolicyVoucherRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<GetPolicyVoucherResponseClass, any, {}>>;
527
+ getPolicyVoucher(requestParameters: PolicyVouchersApiGetPolicyVoucherRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<GetPolicyVoucherResponseClass, any, {}, any>>;
528
528
  /**
529
529
  * Returns a list of policy vouchers you have previously created. The policy vouchers are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
530
530
  * @summary List policy vouchers
@@ -533,7 +533,7 @@ export declare class PolicyVouchersApi extends BaseAPI {
533
533
  * @throws {RequiredError}
534
534
  * @memberof PolicyVouchersApi
535
535
  */
536
- listPolicyVouchers(requestParameters?: PolicyVouchersApiListPolicyVouchersRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListPolicyVouchersResponseClass, any, {}>>;
536
+ listPolicyVouchers(requestParameters?: PolicyVouchersApiListPolicyVouchersRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListPolicyVouchersResponseClass, any, {}, any>>;
537
537
  /**
538
538
  * This will redeem the policy voucher.
539
539
  * @summary Redeems the policy voucher.
@@ -542,7 +542,7 @@ export declare class PolicyVouchersApi extends BaseAPI {
542
542
  * @throws {RequiredError}
543
543
  * @memberof PolicyVouchersApi
544
544
  */
545
- redeemPolicyVoucher(requestParameters: PolicyVouchersApiRedeemPolicyVoucherRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<RedeemPolicyVoucherResponseClass, any, {}>>;
545
+ redeemPolicyVoucher(requestParameters: PolicyVouchersApiRedeemPolicyVoucherRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<RedeemPolicyVoucherResponseClass, any, {}, any>>;
546
546
  /**
547
547
  * This will withdraw the policy voucher.
548
548
  * @summary Withdraws the policy voucher.
@@ -551,5 +551,5 @@ export declare class PolicyVouchersApi extends BaseAPI {
551
551
  * @throws {RequiredError}
552
552
  * @memberof PolicyVouchersApi
553
553
  */
554
- withdrawPolicyVoucher(requestParameters: PolicyVouchersApiWithdrawPolicyVoucherRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<WithdrawPolicyVoucherResponseClass, any, {}>>;
554
+ withdrawPolicyVoucher(requestParameters: PolicyVouchersApiWithdrawPolicyVoucherRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<WithdrawPolicyVoucherResponseClass, any, {}, any>>;
555
555
  }