@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 DocxTemplatesApiAxiosParamCreator = function (configuration) {
107
107
  deleteDocxTemplate: function (code, 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 'code' is not null or undefined
115
116
  (0, common_1.assertParamExists)('deleteDocxTemplate', 'code', code);
@@ -126,14 +127,17 @@ var DocxTemplatesApiAxiosParamCreator = function (configuration) {
126
127
  // authentication bearer required
127
128
  // http bearer authentication required
128
129
  return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
129
- // Only Authorization falls back to the configured token; an empty value is never sent.
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.
130
132
  ];
131
133
  case 1:
132
134
  // authentication bearer required
133
135
  // http bearer authentication required
134
- _a.sent();
135
- authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
136
- if (authorizationValue) {
136
+ _b.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) {
137
141
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
138
142
  }
139
143
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
@@ -158,9 +162,10 @@ var DocxTemplatesApiAxiosParamCreator = function (configuration) {
158
162
  downloadDocxTemplate: function (code, authorization, options) {
159
163
  if (options === void 0) { options = {}; }
160
164
  return __awaiter(_this, void 0, void 0, function () {
161
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
162
- return __generator(this, function (_a) {
163
- switch (_a.label) {
165
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
166
+ var _a;
167
+ return __generator(this, function (_b) {
168
+ switch (_b.label) {
164
169
  case 0:
165
170
  // verify required parameter 'code' is not null or undefined
166
171
  (0, common_1.assertParamExists)('downloadDocxTemplate', 'code', code);
@@ -177,14 +182,17 @@ var DocxTemplatesApiAxiosParamCreator = 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
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
@@ -209,9 +217,10 @@ var DocxTemplatesApiAxiosParamCreator = function (configuration) {
209
217
  getDocxTemplate: function (code, authorization, options) {
210
218
  if (options === void 0) { options = {}; }
211
219
  return __awaiter(_this, void 0, void 0, function () {
212
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
213
- return __generator(this, function (_a) {
214
- switch (_a.label) {
220
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
221
+ var _a;
222
+ return __generator(this, function (_b) {
223
+ switch (_b.label) {
215
224
  case 0:
216
225
  // verify required parameter 'code' is not null or undefined
217
226
  (0, common_1.assertParamExists)('getDocxTemplate', 'code', code);
@@ -228,14 +237,17 @@ var DocxTemplatesApiAxiosParamCreator = function (configuration) {
228
237
  // authentication bearer required
229
238
  // http bearer authentication required
230
239
  return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
231
- // Only Authorization falls back to the configured token; an empty value is never sent.
240
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
241
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
232
242
  ];
233
243
  case 1:
234
244
  // authentication bearer required
235
245
  // http bearer authentication required
236
- _a.sent();
237
- authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
238
- if (authorizationValue) {
246
+ _b.sent();
247
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
248
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
249
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
250
+ if (authorizationValue || authorizationKeepEmpty) {
239
251
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
240
252
  }
241
253
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
@@ -266,9 +278,10 @@ var DocxTemplatesApiAxiosParamCreator = function (configuration) {
266
278
  listDocxTemplates: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
267
279
  if (options === void 0) { options = {}; }
268
280
  return __awaiter(_this, void 0, void 0, function () {
269
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
270
- return __generator(this, function (_a) {
271
- switch (_a.label) {
281
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
282
+ var _a;
283
+ return __generator(this, function (_b) {
284
+ switch (_b.label) {
272
285
  case 0:
273
286
  localVarPath = "/documentservice/v1/docx-templates";
274
287
  localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
@@ -285,7 +298,7 @@ var DocxTemplatesApiAxiosParamCreator = function (configuration) {
285
298
  case 1:
286
299
  // authentication bearer required
287
300
  // http bearer authentication required
288
- _a.sent();
301
+ _b.sent();
289
302
  if (pageSize !== undefined) {
290
303
  localVarQueryParameter['pageSize'] = pageSize;
291
304
  }
@@ -307,8 +320,10 @@ var DocxTemplatesApiAxiosParamCreator = function (configuration) {
307
320
  if (filters !== undefined) {
308
321
  localVarQueryParameter['filters'] = filters;
309
322
  }
310
- authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
311
- if (authorizationValue) {
323
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
324
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
325
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
326
+ if (authorizationValue || authorizationKeepEmpty) {
312
327
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
313
328
  }
314
329
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
@@ -334,9 +349,10 @@ var DocxTemplatesApiAxiosParamCreator = function (configuration) {
334
349
  updateDocxTemplate: function (code, sharedUpdateDocxTemplateRequestDto, authorization, options) {
335
350
  if (options === void 0) { options = {}; }
336
351
  return __awaiter(_this, void 0, void 0, function () {
337
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
338
- return __generator(this, function (_a) {
339
- switch (_a.label) {
352
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
353
+ var _a;
354
+ return __generator(this, function (_b) {
355
+ switch (_b.label) {
340
356
  case 0:
341
357
  // verify required parameter 'code' is not null or undefined
342
358
  (0, common_1.assertParamExists)('updateDocxTemplate', 'code', code);
@@ -355,14 +371,17 @@ var DocxTemplatesApiAxiosParamCreator = function (configuration) {
355
371
  // authentication bearer required
356
372
  // http bearer authentication required
357
373
  return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
358
- // Only Authorization falls back to the configured token; an empty value is never sent.
374
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
375
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
359
376
  ];
360
377
  case 1:
361
378
  // authentication bearer required
362
379
  // http bearer authentication required
363
- _a.sent();
364
- authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
365
- if (authorizationValue) {
380
+ _b.sent();
381
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
382
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
383
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
384
+ if (authorizationValue || authorizationKeepEmpty) {
366
385
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
367
386
  }
368
387
  localVarHeaderParameter['Content-Type'] = 'application/json';
@@ -389,9 +408,10 @@ var DocxTemplatesApiAxiosParamCreator = function (configuration) {
389
408
  uploadDocxTemplate: function (uploadDocxTemplateRequestDto, authorization, options) {
390
409
  if (options === void 0) { options = {}; }
391
410
  return __awaiter(_this, void 0, void 0, function () {
392
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
393
- return __generator(this, function (_a) {
394
- switch (_a.label) {
411
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
412
+ var _a;
413
+ return __generator(this, function (_b) {
414
+ switch (_b.label) {
395
415
  case 0:
396
416
  // verify required parameter 'uploadDocxTemplateRequestDto' is not null or undefined
397
417
  (0, common_1.assertParamExists)('uploadDocxTemplate', 'uploadDocxTemplateRequestDto', uploadDocxTemplateRequestDto);
@@ -407,14 +427,17 @@ var DocxTemplatesApiAxiosParamCreator = function (configuration) {
407
427
  // authentication bearer required
408
428
  // http bearer authentication required
409
429
  return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
410
- // Only Authorization falls back to the configured token; an empty value is never sent.
430
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
431
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
411
432
  ];
412
433
  case 1:
413
434
  // authentication bearer required
414
435
  // http bearer authentication required
415
- _a.sent();
416
- authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
417
- if (authorizationValue) {
436
+ _b.sent();
437
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
438
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
439
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
440
+ if (authorizationValue || authorizationKeepEmpty) {
418
441
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
419
442
  }
420
443
  localVarHeaderParameter['Content-Type'] = 'application/json';
@@ -680,7 +703,7 @@ var DocxTemplatesApi = /** @class */ (function (_super) {
680
703
  */
681
704
  DocxTemplatesApi.prototype.deleteDocxTemplate = function (requestParameters, options) {
682
705
  var _this = this;
683
- return (0, exports.DocxTemplatesApiFp)(this.configuration).deleteDocxTemplate(requestParameters.code, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
706
+ return (0, exports.DocxTemplatesApiFp)(this.configuration).deleteDocxTemplate(requestParameters.code, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
684
707
  };
685
708
  /**
686
709
  * Get a pre-signed download url for the given docx template. **Required Permissions** \"document-management.docx-templates.view\"
@@ -692,7 +715,7 @@ var DocxTemplatesApi = /** @class */ (function (_super) {
692
715
  */
693
716
  DocxTemplatesApi.prototype.downloadDocxTemplate = function (requestParameters, options) {
694
717
  var _this = this;
695
- return (0, exports.DocxTemplatesApiFp)(this.configuration).downloadDocxTemplate(requestParameters.code, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
718
+ return (0, exports.DocxTemplatesApiFp)(this.configuration).downloadDocxTemplate(requestParameters.code, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
696
719
  };
697
720
  /**
698
721
  * Get a docx template. **Required Permissions** \"document-management.docx-templates.view\"
@@ -704,7 +727,7 @@ var DocxTemplatesApi = /** @class */ (function (_super) {
704
727
  */
705
728
  DocxTemplatesApi.prototype.getDocxTemplate = function (requestParameters, options) {
706
729
  var _this = this;
707
- return (0, exports.DocxTemplatesApiFp)(this.configuration).getDocxTemplate(requestParameters.code, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
730
+ return (0, exports.DocxTemplatesApiFp)(this.configuration).getDocxTemplate(requestParameters.code, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
708
731
  };
709
732
  /**
710
733
  * Returns a list of docx templates you have previously created. The docx templates are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation. **Required Permissions** \"document-management.docx-templates.view\"
@@ -717,7 +740,7 @@ var DocxTemplatesApi = /** @class */ (function (_super) {
717
740
  DocxTemplatesApi.prototype.listDocxTemplates = function (requestParameters, options) {
718
741
  var _this = this;
719
742
  if (requestParameters === void 0) { requestParameters = {}; }
720
- return (0, exports.DocxTemplatesApiFp)(this.configuration).listDocxTemplates(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); });
743
+ return (0, exports.DocxTemplatesApiFp)(this.configuration).listDocxTemplates(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); });
721
744
  };
722
745
  /**
723
746
  * Updates a docx template metadata. **Required Permissions** \"document-management.docx-templates.update\"
@@ -729,7 +752,7 @@ var DocxTemplatesApi = /** @class */ (function (_super) {
729
752
  */
730
753
  DocxTemplatesApi.prototype.updateDocxTemplate = function (requestParameters, options) {
731
754
  var _this = this;
732
- return (0, exports.DocxTemplatesApiFp)(this.configuration).updateDocxTemplate(requestParameters.code, requestParameters.sharedUpdateDocxTemplateRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
755
+ return (0, exports.DocxTemplatesApiFp)(this.configuration).updateDocxTemplate(requestParameters.code, requestParameters.sharedUpdateDocxTemplateRequestDto, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
733
756
  };
734
757
  /**
735
758
  * Upload a docx template via a presigned Url. **Required Permissions** \"document-management.docx-templates.create\"
@@ -741,7 +764,7 @@ var DocxTemplatesApi = /** @class */ (function (_super) {
741
764
  */
742
765
  DocxTemplatesApi.prototype.uploadDocxTemplate = function (requestParameters, options) {
743
766
  var _this = this;
744
- return (0, exports.DocxTemplatesApiFp)(this.configuration).uploadDocxTemplate(requestParameters.uploadDocxTemplateRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
767
+ return (0, exports.DocxTemplatesApiFp)(this.configuration).uploadDocxTemplate(requestParameters.uploadDocxTemplateRequestDto, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
745
768
  };
746
769
  return DocxTemplatesApi;
747
770
  }(base_1.BaseAPI));
@@ -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));
@@ -107,9 +107,10 @@ var LayoutsApiAxiosParamCreator = function (configuration) {
107
107
  createLayout: function (createLayoutRequestDto, 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 'createLayoutRequestDto' is not null or undefined
115
116
  (0, common_1.assertParamExists)('createLayout', 'createLayoutRequestDto', createLayoutRequestDto);
@@ -125,14 +126,17 @@ var LayoutsApiAxiosParamCreator = 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 LayoutsApiAxiosParamCreator = function (configuration) {
159
163
  deleteLayout: function (id, 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 'id' is not null or undefined
167
172
  (0, common_1.assertParamExists)('deleteLayout', 'id', id);
@@ -178,14 +183,17 @@ var LayoutsApiAxiosParamCreator = function (configuration) {
178
183
  // authentication bearer required
179
184
  // http bearer authentication required
180
185
  return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
181
- // Only Authorization falls back to the configured token; an empty value is never sent.
186
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
187
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
182
188
  ];
183
189
  case 1:
184
190
  // authentication bearer required
185
191
  // http bearer authentication required
186
- _a.sent();
187
- authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
188
- if (authorizationValue) {
192
+ _b.sent();
193
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
194
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
195
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
196
+ if (authorizationValue || authorizationKeepEmpty) {
189
197
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
190
198
  }
191
199
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
@@ -211,9 +219,10 @@ var LayoutsApiAxiosParamCreator = function (configuration) {
211
219
  getLayout: function (id, id2, 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 'id' is not null or undefined
219
228
  (0, common_1.assertParamExists)('getLayout', 'id', id);
@@ -235,12 +244,14 @@ var LayoutsApiAxiosParamCreator = function (configuration) {
235
244
  case 1:
236
245
  // authentication bearer required
237
246
  // http bearer authentication required
238
- _a.sent();
247
+ _b.sent();
239
248
  if (id2 !== undefined) {
240
249
  localVarQueryParameter['id'] = id2;
241
250
  }
242
- authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
243
- if (authorizationValue) {
251
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
252
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
253
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
254
+ if (authorizationValue || authorizationKeepEmpty) {
244
255
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
245
256
  }
246
257
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
@@ -271,9 +282,10 @@ var LayoutsApiAxiosParamCreator = function (configuration) {
271
282
  listLayouts: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
272
283
  if (options === void 0) { options = {}; }
273
284
  return __awaiter(_this, void 0, void 0, function () {
274
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
275
- return __generator(this, function (_a) {
276
- switch (_a.label) {
285
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
286
+ var _a;
287
+ return __generator(this, function (_b) {
288
+ switch (_b.label) {
277
289
  case 0:
278
290
  localVarPath = "/documentservice/v1/layouts";
279
291
  localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
@@ -290,7 +302,7 @@ var LayoutsApiAxiosParamCreator = function (configuration) {
290
302
  case 1:
291
303
  // authentication bearer required
292
304
  // http bearer authentication required
293
- _a.sent();
305
+ _b.sent();
294
306
  if (pageSize !== undefined) {
295
307
  localVarQueryParameter['pageSize'] = pageSize;
296
308
  }
@@ -312,8 +324,10 @@ var LayoutsApiAxiosParamCreator = function (configuration) {
312
324
  if (filters !== undefined) {
313
325
  localVarQueryParameter['filters'] = filters;
314
326
  }
315
- authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
316
- if (authorizationValue) {
327
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
328
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
329
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
330
+ if (authorizationValue || authorizationKeepEmpty) {
317
331
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
318
332
  }
319
333
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
@@ -339,9 +353,10 @@ var LayoutsApiAxiosParamCreator = function (configuration) {
339
353
  updateLayout: function (id, updateLayoutRequestDto, authorization, options) {
340
354
  if (options === void 0) { options = {}; }
341
355
  return __awaiter(_this, void 0, void 0, function () {
342
- var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
343
- return __generator(this, function (_a) {
344
- switch (_a.label) {
356
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationIsAuth, authorizationValue, authorizationKeepEmpty, headersFromBaseOptions;
357
+ var _a;
358
+ return __generator(this, function (_b) {
359
+ switch (_b.label) {
345
360
  case 0:
346
361
  // verify required parameter 'id' is not null or undefined
347
362
  (0, common_1.assertParamExists)('updateLayout', 'id', id);
@@ -360,14 +375,17 @@ var LayoutsApiAxiosParamCreator = function (configuration) {
360
375
  // authentication bearer required
361
376
  // http bearer authentication required
362
377
  return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
363
- // Only Authorization falls back to the configured token; an empty value is never sent.
378
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
379
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
364
380
  ];
365
381
  case 1:
366
382
  // authentication bearer required
367
383
  // http bearer authentication required
368
- _a.sent();
369
- authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
370
- if (authorizationValue) {
384
+ _b.sent();
385
+ authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
386
+ authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
387
+ authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !((_a = baseOptions === null || baseOptions === void 0 ? void 0 : baseOptions.headers) === null || _a === void 0 ? void 0 : _a['X-Emil-Account']);
388
+ if (authorizationValue || authorizationKeepEmpty) {
371
389
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
372
390
  }
373
391
  localVarHeaderParameter['Content-Type'] = 'application/json';
@@ -603,7 +621,7 @@ var LayoutsApi = /** @class */ (function (_super) {
603
621
  */
604
622
  LayoutsApi.prototype.createLayout = function (requestParameters, options) {
605
623
  var _this = this;
606
- return (0, exports.LayoutsApiFp)(this.configuration).createLayout(requestParameters.createLayoutRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
624
+ return (0, exports.LayoutsApiFp)(this.configuration).createLayout(requestParameters.createLayoutRequestDto, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
607
625
  };
608
626
  /**
609
627
  * Permanently deletes the layout. Supply the unique code that was returned when you created the layout and this will delete it. **Required Permissions** \"document-management.layouts.delete\"
@@ -615,7 +633,7 @@ var LayoutsApi = /** @class */ (function (_super) {
615
633
  */
616
634
  LayoutsApi.prototype.deleteLayout = function (requestParameters, options) {
617
635
  var _this = this;
618
- return (0, exports.LayoutsApiFp)(this.configuration).deleteLayout(requestParameters.id, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
636
+ return (0, exports.LayoutsApiFp)(this.configuration).deleteLayout(requestParameters.id, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
619
637
  };
620
638
  /**
621
639
  * Retrieves the details of the layout that was previously created. Supply the unique layout id that was returned when you created it and Emil Api will return the corresponding layout information. **Required Permissions** \"document-management.layouts.view\"
@@ -627,7 +645,7 @@ var LayoutsApi = /** @class */ (function (_super) {
627
645
  */
628
646
  LayoutsApi.prototype.getLayout = function (requestParameters, options) {
629
647
  var _this = this;
630
- return (0, exports.LayoutsApiFp)(this.configuration).getLayout(requestParameters.id, requestParameters.id2, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
648
+ return (0, exports.LayoutsApiFp)(this.configuration).getLayout(requestParameters.id, requestParameters.id2, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
631
649
  };
632
650
  /**
633
651
  * Returns a list of layouts you have previously created. The layouts are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation. **Required Permissions** \"document-management.layouts.view\"
@@ -640,7 +658,7 @@ var LayoutsApi = /** @class */ (function (_super) {
640
658
  LayoutsApi.prototype.listLayouts = function (requestParameters, options) {
641
659
  var _this = this;
642
660
  if (requestParameters === void 0) { requestParameters = {}; }
643
- return (0, exports.LayoutsApiFp)(this.configuration).listLayouts(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); });
661
+ return (0, exports.LayoutsApiFp)(this.configuration).listLayouts(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); });
644
662
  };
645
663
  /**
646
664
  * Updates the specified layout by setting the values of the parameters passed. Any parameters not provided will be left unchanged. **Required Permissions** \"document-management.layouts.update\"
@@ -652,7 +670,7 @@ var LayoutsApi = /** @class */ (function (_super) {
652
670
  */
653
671
  LayoutsApi.prototype.updateLayout = function (requestParameters, options) {
654
672
  var _this = this;
655
- return (0, exports.LayoutsApiFp)(this.configuration).updateLayout(requestParameters.id, requestParameters.updateLayoutRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
673
+ return (0, exports.LayoutsApiFp)(this.configuration).updateLayout(requestParameters.id, requestParameters.updateLayoutRequestDto, requestParameters.authorization, this.withOwner(options)).then(function (request) { return request(_this.axios, _this.basePath); });
656
674
  };
657
675
  return LayoutsApi;
658
676
  }(base_1.BaseAPI));