@emilgroup/document-sdk-node 1.49.1-beta.28 → 1.49.1-beta.29

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 DocumentsApiAxiosParamCreator = function (configuration) {
107
107
  createDocument: function (createDocumentRequestDto, 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, authorizationValue, 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 'createDocumentRequestDto' is not null or undefined
115
116
  (0, common_1.assertParamExists)('createDocument', 'createDocumentRequestDto', createDocumentRequestDto);
@@ -125,14 +126,17 @@ var DocumentsApiAxiosParamCreator = function (configuration) {
125
126
  // authentication bearer required
126
127
  // http bearer authentication required
127
128
  return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
128
- // Only Authorization falls back to the configured token; an empty value is never sent.
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.
129
131
  ];
130
132
  case 1:
131
133
  // authentication bearer required
132
134
  // http bearer authentication required
133
- _a.sent();
134
- authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
135
- if (authorizationValue) {
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) {
136
140
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
137
141
  }
138
142
  localVarHeaderParameter['Content-Type'] = 'application/json';
@@ -159,9 +163,10 @@ var DocumentsApiAxiosParamCreator = function (configuration) {
159
163
  createPresignedPost: function (createPresignedPostRequestDto, authorization, options) {
160
164
  if (options === void 0) { options = {}; }
161
165
  return __awaiter(_this, void 0, void 0, function () {
162
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
163
- return __generator(this, function (_a) {
164
- 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) {
165
170
  case 0:
166
171
  // verify required parameter 'createPresignedPostRequestDto' is not null or undefined
167
172
  (0, common_1.assertParamExists)('createPresignedPost', 'createPresignedPostRequestDto', createPresignedPostRequestDto);
@@ -177,14 +182,17 @@ var DocumentsApiAxiosParamCreator = function (configuration) {
177
182
  // authentication bearer required
178
183
  // http bearer authentication required
179
184
  return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
180
- // Only Authorization falls back to the configured token; an empty value is never sent.
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.
181
187
  ];
182
188
  case 1:
183
189
  // authentication bearer required
184
190
  // http bearer authentication required
185
- _a.sent();
186
- authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
187
- if (authorizationValue) {
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) {
188
196
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
189
197
  }
190
198
  localVarHeaderParameter['Content-Type'] = 'application/json';
@@ -211,9 +219,10 @@ var DocumentsApiAxiosParamCreator = function (configuration) {
211
219
  createQrBillDocument: function (createQrBillDocumentRequestDto, authorization, options) {
212
220
  if (options === void 0) { options = {}; }
213
221
  return __awaiter(_this, void 0, void 0, function () {
214
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
215
- return __generator(this, function (_a) {
216
- 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) {
217
226
  case 0:
218
227
  // verify required parameter 'createQrBillDocumentRequestDto' is not null or undefined
219
228
  (0, common_1.assertParamExists)('createQrBillDocument', 'createQrBillDocumentRequestDto', createQrBillDocumentRequestDto);
@@ -229,14 +238,17 @@ var DocumentsApiAxiosParamCreator = function (configuration) {
229
238
  // authentication bearer required
230
239
  // http bearer authentication required
231
240
  return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
232
- // Only Authorization falls back to the configured token; an empty value is never sent.
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.
233
243
  ];
234
244
  case 1:
235
245
  // authentication bearer required
236
246
  // http bearer authentication required
237
- _a.sent();
238
- authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
239
- if (authorizationValue) {
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) {
240
252
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
241
253
  }
242
254
  localVarHeaderParameter['Content-Type'] = 'application/json';
@@ -263,9 +275,10 @@ var DocumentsApiAxiosParamCreator = function (configuration) {
263
275
  deleteDocument: function (code, authorization, options) {
264
276
  if (options === void 0) { options = {}; }
265
277
  return __awaiter(_this, void 0, void 0, function () {
266
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
267
- return __generator(this, function (_a) {
268
- switch (_a.label) {
278
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
279
+ var _a;
280
+ return __generator(this, function (_b) {
281
+ switch (_b.label) {
269
282
  case 0:
270
283
  // verify required parameter 'code' is not null or undefined
271
284
  (0, common_1.assertParamExists)('deleteDocument', 'code', code);
@@ -282,14 +295,17 @@ var DocumentsApiAxiosParamCreator = function (configuration) {
282
295
  // authentication bearer required
283
296
  // http bearer authentication required
284
297
  return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
285
- // Only Authorization falls back to the configured token; an empty value is never sent.
298
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
299
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
286
300
  ];
287
301
  case 1:
288
302
  // authentication bearer required
289
303
  // http bearer authentication required
290
- _a.sent();
291
- authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
292
- if (authorizationValue) {
304
+ _b.sent();
305
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
306
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
307
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
308
+ if (authorizationValue || authorizationKeepEmpty) {
293
309
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
294
310
  }
295
311
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
@@ -315,9 +331,10 @@ var DocumentsApiAxiosParamCreator = function (configuration) {
315
331
  exportDocument: function (code, exportDocumentRequestDto, authorization, options) {
316
332
  if (options === void 0) { options = {}; }
317
333
  return __awaiter(_this, void 0, void 0, function () {
318
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
319
- return __generator(this, function (_a) {
320
- switch (_a.label) {
334
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
335
+ var _a;
336
+ return __generator(this, function (_b) {
337
+ switch (_b.label) {
321
338
  case 0:
322
339
  // verify required parameter 'code' is not null or undefined
323
340
  (0, common_1.assertParamExists)('exportDocument', 'code', code);
@@ -336,14 +353,17 @@ var DocumentsApiAxiosParamCreator = function (configuration) {
336
353
  // authentication bearer required
337
354
  // http bearer authentication required
338
355
  return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
339
- // Only Authorization falls back to the configured token; an empty value is never sent.
356
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
357
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
340
358
  ];
341
359
  case 1:
342
360
  // authentication bearer required
343
361
  // http bearer authentication required
344
- _a.sent();
345
- authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
346
- if (authorizationValue) {
362
+ _b.sent();
363
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
364
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
365
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
366
+ if (authorizationValue || authorizationKeepEmpty) {
347
367
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
348
368
  }
349
369
  localVarHeaderParameter['Content-Type'] = 'application/json';
@@ -371,9 +391,10 @@ var DocumentsApiAxiosParamCreator = function (configuration) {
371
391
  getDocumentDownloadUrl: function (code, authorization, contentDisposition, options) {
372
392
  if (options === void 0) { options = {}; }
373
393
  return __awaiter(_this, void 0, void 0, function () {
374
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
375
- return __generator(this, function (_a) {
376
- switch (_a.label) {
394
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
395
+ var _a;
396
+ return __generator(this, function (_b) {
397
+ switch (_b.label) {
377
398
  case 0:
378
399
  // verify required parameter 'code' is not null or undefined
379
400
  (0, common_1.assertParamExists)('getDocumentDownloadUrl', 'code', code);
@@ -393,12 +414,14 @@ var DocumentsApiAxiosParamCreator = function (configuration) {
393
414
  case 1:
394
415
  // authentication bearer required
395
416
  // http bearer authentication required
396
- _a.sent();
417
+ _b.sent();
397
418
  if (contentDisposition !== undefined) {
398
419
  localVarQueryParameter['contentDisposition'] = contentDisposition;
399
420
  }
400
- authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
401
- if (authorizationValue) {
421
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
422
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
423
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
424
+ if (authorizationValue || authorizationKeepEmpty) {
402
425
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
403
426
  }
404
427
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
@@ -424,9 +447,10 @@ var DocumentsApiAxiosParamCreator = function (configuration) {
424
447
  getSignedS3keyUrl: function (s3Key, authorization, contentDisposition, options) {
425
448
  if (options === void 0) { options = {}; }
426
449
  return __awaiter(_this, void 0, void 0, function () {
427
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
428
- return __generator(this, function (_a) {
429
- switch (_a.label) {
450
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
451
+ var _a;
452
+ return __generator(this, function (_b) {
453
+ switch (_b.label) {
430
454
  case 0:
431
455
  // verify required parameter 's3Key' is not null or undefined
432
456
  (0, common_1.assertParamExists)('getSignedS3keyUrl', 's3Key', s3Key);
@@ -445,15 +469,17 @@ var DocumentsApiAxiosParamCreator = function (configuration) {
445
469
  case 1:
446
470
  // authentication bearer required
447
471
  // http bearer authentication required
448
- _a.sent();
472
+ _b.sent();
449
473
  if (s3Key !== undefined) {
450
474
  localVarQueryParameter['s3Key'] = s3Key;
451
475
  }
452
476
  if (contentDisposition !== undefined) {
453
477
  localVarQueryParameter['contentDisposition'] = contentDisposition;
454
478
  }
455
- authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
456
- if (authorizationValue) {
479
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
480
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
481
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
482
+ if (authorizationValue || authorizationKeepEmpty) {
457
483
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
458
484
  }
459
485
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
@@ -484,9 +510,10 @@ var DocumentsApiAxiosParamCreator = function (configuration) {
484
510
  listDocuments: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
485
511
  if (options === void 0) { options = {}; }
486
512
  return __awaiter(_this, void 0, void 0, function () {
487
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
488
- return __generator(this, function (_a) {
489
- switch (_a.label) {
513
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
514
+ var _a;
515
+ return __generator(this, function (_b) {
516
+ switch (_b.label) {
490
517
  case 0:
491
518
  localVarPath = "/documentservice/v1/documents";
492
519
  localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
@@ -503,7 +530,7 @@ var DocumentsApiAxiosParamCreator = function (configuration) {
503
530
  case 1:
504
531
  // authentication bearer required
505
532
  // http bearer authentication required
506
- _a.sent();
533
+ _b.sent();
507
534
  if (pageSize !== undefined) {
508
535
  localVarQueryParameter['pageSize'] = pageSize;
509
536
  }
@@ -525,8 +552,10 @@ var DocumentsApiAxiosParamCreator = function (configuration) {
525
552
  if (filters !== undefined) {
526
553
  localVarQueryParameter['filters'] = filters;
527
554
  }
528
- authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
529
- if (authorizationValue) {
555
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
556
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
557
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
558
+ if (authorizationValue || authorizationKeepEmpty) {
530
559
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
531
560
  }
532
561
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
@@ -551,9 +580,10 @@ var DocumentsApiAxiosParamCreator = function (configuration) {
551
580
  mergeDocuments: function (mergeDocumentsRequestDto, authorization, options) {
552
581
  if (options === void 0) { options = {}; }
553
582
  return __awaiter(_this, void 0, void 0, function () {
554
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
555
- return __generator(this, function (_a) {
556
- switch (_a.label) {
583
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
584
+ var _a;
585
+ return __generator(this, function (_b) {
586
+ switch (_b.label) {
557
587
  case 0:
558
588
  // verify required parameter 'mergeDocumentsRequestDto' is not null or undefined
559
589
  (0, common_1.assertParamExists)('mergeDocuments', 'mergeDocumentsRequestDto', mergeDocumentsRequestDto);
@@ -569,14 +599,17 @@ var DocumentsApiAxiosParamCreator = function (configuration) {
569
599
  // authentication bearer required
570
600
  // http bearer authentication required
571
601
  return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
572
- // Only Authorization falls back to the configured token; an empty value is never sent.
602
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
603
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
573
604
  ];
574
605
  case 1:
575
606
  // authentication bearer required
576
607
  // http bearer authentication required
577
- _a.sent();
578
- authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
579
- if (authorizationValue) {
608
+ _b.sent();
609
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
610
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
611
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
612
+ if (authorizationValue || authorizationKeepEmpty) {
580
613
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
581
614
  }
582
615
  localVarHeaderParameter['Content-Type'] = 'application/json';
@@ -603,9 +636,10 @@ var DocumentsApiAxiosParamCreator = function (configuration) {
603
636
  saveExternalDocument: function (saveExternalDocumentRequestDto, authorization, options) {
604
637
  if (options === void 0) { options = {}; }
605
638
  return __awaiter(_this, void 0, void 0, function () {
606
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
607
- return __generator(this, function (_a) {
608
- switch (_a.label) {
639
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
640
+ var _a;
641
+ return __generator(this, function (_b) {
642
+ switch (_b.label) {
609
643
  case 0:
610
644
  // verify required parameter 'saveExternalDocumentRequestDto' is not null or undefined
611
645
  (0, common_1.assertParamExists)('saveExternalDocument', 'saveExternalDocumentRequestDto', saveExternalDocumentRequestDto);
@@ -621,14 +655,17 @@ var DocumentsApiAxiosParamCreator = function (configuration) {
621
655
  // authentication bearer required
622
656
  // http bearer authentication required
623
657
  return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
624
- // Only Authorization falls back to the configured token; an empty value is never sent.
658
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
659
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
625
660
  ];
626
661
  case 1:
627
662
  // authentication bearer required
628
663
  // http bearer authentication required
629
- _a.sent();
630
- authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
631
- if (authorizationValue) {
664
+ _b.sent();
665
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
666
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
667
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
668
+ if (authorizationValue || authorizationKeepEmpty) {
632
669
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
633
670
  }
634
671
  localVarHeaderParameter['Content-Type'] = 'application/json';
@@ -656,9 +693,10 @@ var DocumentsApiAxiosParamCreator = function (configuration) {
656
693
  updateDocument: function (code, updateDocumentRequestDto, authorization, options) {
657
694
  if (options === void 0) { options = {}; }
658
695
  return __awaiter(_this, void 0, void 0, function () {
659
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
660
- return __generator(this, function (_a) {
661
- switch (_a.label) {
696
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
697
+ var _a;
698
+ return __generator(this, function (_b) {
699
+ switch (_b.label) {
662
700
  case 0:
663
701
  // verify required parameter 'code' is not null or undefined
664
702
  (0, common_1.assertParamExists)('updateDocument', 'code', code);
@@ -677,14 +715,17 @@ var DocumentsApiAxiosParamCreator = function (configuration) {
677
715
  // authentication bearer required
678
716
  // http bearer authentication required
679
717
  return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
680
- // Only Authorization falls back to the configured token; an empty value is never sent.
718
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
719
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
681
720
  ];
682
721
  case 1:
683
722
  // authentication bearer required
684
723
  // http bearer authentication required
685
- _a.sent();
686
- authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
687
- if (authorizationValue) {
724
+ _b.sent();
725
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
726
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
727
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
728
+ if (authorizationValue || authorizationKeepEmpty) {
688
729
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
689
730
  }
690
731
  localVarHeaderParameter['Content-Type'] = 'application/json';
@@ -1116,7 +1157,7 @@ var DocumentsApi = /** @class */ (function (_super) {
1116
1157
  */
1117
1158
  DocumentsApi.prototype.createDocument = function (requestParameters, options) {
1118
1159
  var _this = this;
1119
- return (0, exports.DocumentsApiFp)(this.configuration).createDocument(requestParameters.createDocumentRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
1160
+ return (0, exports.DocumentsApiFp)(this.configuration).createDocument(requestParameters.createDocumentRequestDto, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
1120
1161
  };
1121
1162
  /**
1122
1163
  * This will create a URL that allows user upload its documents in Database.The URL will be expires between 5 minutes to 7 days. **Required Permissions** \"document-management.documents.create\"
@@ -1128,7 +1169,7 @@ var DocumentsApi = /** @class */ (function (_super) {
1128
1169
  */
1129
1170
  DocumentsApi.prototype.createPresignedPost = function (requestParameters, options) {
1130
1171
  var _this = this;
1131
- return (0, exports.DocumentsApiFp)(this.configuration).createPresignedPost(requestParameters.createPresignedPostRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
1172
+ return (0, exports.DocumentsApiFp)(this.configuration).createPresignedPost(requestParameters.createPresignedPostRequestDto, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
1132
1173
  };
1133
1174
  /**
1134
1175
  * Creates a Swiss QR bill PDF document **Required Permissions** \"document-management.documents.create\"
@@ -1140,7 +1181,7 @@ var DocumentsApi = /** @class */ (function (_super) {
1140
1181
  */
1141
1182
  DocumentsApi.prototype.createQrBillDocument = function (requestParameters, options) {
1142
1183
  var _this = this;
1143
- return (0, exports.DocumentsApiFp)(this.configuration).createQrBillDocument(requestParameters.createQrBillDocumentRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
1184
+ return (0, exports.DocumentsApiFp)(this.configuration).createQrBillDocument(requestParameters.createQrBillDocumentRequestDto, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
1144
1185
  };
1145
1186
  /**
1146
1187
  * Permanently deletes the document. Supply the unique code that was returned when you created the document and this will delete it. **Required Permissions** \"document-management.documents.delete\"
@@ -1152,7 +1193,7 @@ var DocumentsApi = /** @class */ (function (_super) {
1152
1193
  */
1153
1194
  DocumentsApi.prototype.deleteDocument = function (requestParameters, options) {
1154
1195
  var _this = this;
1155
- return (0, exports.DocumentsApiFp)(this.configuration).deleteDocument(requestParameters.code, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
1196
+ return (0, exports.DocumentsApiFp)(this.configuration).deleteDocument(requestParameters.code, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
1156
1197
  };
1157
1198
  /**
1158
1199
  * This will fetch an internal document and export it to a third party API **Required Permissions** \"document-management.documents.create\"
@@ -1164,7 +1205,7 @@ var DocumentsApi = /** @class */ (function (_super) {
1164
1205
  */
1165
1206
  DocumentsApi.prototype.exportDocument = function (requestParameters, options) {
1166
1207
  var _this = this;
1167
- return (0, exports.DocumentsApiFp)(this.configuration).exportDocument(requestParameters.code, requestParameters.exportDocumentRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
1208
+ return (0, exports.DocumentsApiFp)(this.configuration).exportDocument(requestParameters.code, requestParameters.exportDocumentRequestDto, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
1168
1209
  };
1169
1210
  /**
1170
1211
  * This will return a presigned URL to download the document. **Required Permissions** \"document-management.documents.view\"
@@ -1176,7 +1217,7 @@ var DocumentsApi = /** @class */ (function (_super) {
1176
1217
  */
1177
1218
  DocumentsApi.prototype.getDocumentDownloadUrl = function (requestParameters, options) {
1178
1219
  var _this = this;
1179
- return (0, exports.DocumentsApiFp)(this.configuration).getDocumentDownloadUrl(requestParameters.code, requestParameters.authorization, requestParameters.contentDisposition, options).then(function (request) { return request(_this.axios, _this.basePath); });
1220
+ return (0, exports.DocumentsApiFp)(this.configuration).getDocumentDownloadUrl(requestParameters.code, requestParameters.authorization, requestParameters.contentDisposition, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
1180
1221
  };
1181
1222
  /**
1182
1223
  * This will return a presigned URL for a random S3 key
@@ -1188,7 +1229,7 @@ var DocumentsApi = /** @class */ (function (_super) {
1188
1229
  */
1189
1230
  DocumentsApi.prototype.getSignedS3keyUrl = function (requestParameters, options) {
1190
1231
  var _this = this;
1191
- return (0, exports.DocumentsApiFp)(this.configuration).getSignedS3keyUrl(requestParameters.s3Key, requestParameters.authorization, requestParameters.contentDisposition, options).then(function (request) { return request(_this.axios, _this.basePath); });
1232
+ return (0, exports.DocumentsApiFp)(this.configuration).getSignedS3keyUrl(requestParameters.s3Key, requestParameters.authorization, requestParameters.contentDisposition, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
1192
1233
  };
1193
1234
  /**
1194
1235
  * Returns a list of documents you have previously created. The documents are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation. **Required Permissions** \"document-management.documents.view\"
@@ -1201,7 +1242,7 @@ var DocumentsApi = /** @class */ (function (_super) {
1201
1242
  DocumentsApi.prototype.listDocuments = function (requestParameters, options) {
1202
1243
  var _this = this;
1203
1244
  if (requestParameters === void 0) { requestParameters = {}; }
1204
- return (0, exports.DocumentsApiFp)(this.configuration).listDocuments(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); });
1245
+ return (0, exports.DocumentsApiFp)(this.configuration).listDocuments(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); });
1205
1246
  };
1206
1247
  /**
1207
1248
  * Merges 2-5 PDF documents into a single PDF **Required Permissions** \"document-management.documents.delete\"
@@ -1213,7 +1254,7 @@ var DocumentsApi = /** @class */ (function (_super) {
1213
1254
  */
1214
1255
  DocumentsApi.prototype.mergeDocuments = function (requestParameters, options) {
1215
1256
  var _this = this;
1216
- return (0, exports.DocumentsApiFp)(this.configuration).mergeDocuments(requestParameters.mergeDocumentsRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
1257
+ return (0, exports.DocumentsApiFp)(this.configuration).mergeDocuments(requestParameters.mergeDocumentsRequestDto, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
1217
1258
  };
1218
1259
  /**
1219
1260
  * This will save an external document in the database and return it. This is useful if one needs to call a third party API and store the document in EIS and then, for instance, send it to a client. **Required Permissions** \"document-management.documents.create\"
@@ -1225,7 +1266,7 @@ var DocumentsApi = /** @class */ (function (_super) {
1225
1266
  */
1226
1267
  DocumentsApi.prototype.saveExternalDocument = function (requestParameters, options) {
1227
1268
  var _this = this;
1228
- return (0, exports.DocumentsApiFp)(this.configuration).saveExternalDocument(requestParameters.saveExternalDocumentRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
1269
+ return (0, exports.DocumentsApiFp)(this.configuration).saveExternalDocument(requestParameters.saveExternalDocumentRequestDto, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
1229
1270
  };
1230
1271
  /**
1231
1272
  * Updates the specified document by setting the values of the parameters passed. Any parameters not provided will be left unchanged. **Required Permissions** \"document-management.documents.update\"
@@ -1237,7 +1278,7 @@ var DocumentsApi = /** @class */ (function (_super) {
1237
1278
  */
1238
1279
  DocumentsApi.prototype.updateDocument = function (requestParameters, options) {
1239
1280
  var _this = this;
1240
- return (0, exports.DocumentsApiFp)(this.configuration).updateDocument(requestParameters.code, requestParameters.updateDocumentRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
1281
+ return (0, exports.DocumentsApiFp)(this.configuration).updateDocument(requestParameters.code, requestParameters.updateDocumentRequestDto, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
1241
1282
  };
1242
1283
  return DocumentsApi;
1243
1284
  }(base_1.BaseAPI));