@emilgroup/document-sdk-node 1.49.1-beta.3 → 1.49.1-beta.30

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.
@@ -73,8 +73,13 @@ export const LayoutsApiAxiosParamCreator = function (configuration?: Configurati
73
73
  // http bearer authentication required
74
74
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
75
75
 
76
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
77
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
76
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
77
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
78
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
79
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
80
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
81
+ if (authorizationValue || authorizationKeepEmpty) {
82
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
78
83
  }
79
84
 
80
85
 
@@ -121,8 +126,13 @@ export const LayoutsApiAxiosParamCreator = function (configuration?: Configurati
121
126
  // http bearer authentication required
122
127
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
123
128
 
124
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
125
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
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
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
132
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
133
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
134
+ if (authorizationValue || authorizationKeepEmpty) {
135
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
126
136
  }
127
137
 
128
138
 
@@ -173,8 +183,13 @@ export const LayoutsApiAxiosParamCreator = function (configuration?: Configurati
173
183
  localVarQueryParameter['id'] = id2;
174
184
  }
175
185
 
176
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
177
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
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.
188
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
189
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
190
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
191
+ if (authorizationValue || authorizationKeepEmpty) {
192
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
178
193
  }
179
194
 
180
195
 
@@ -249,8 +264,13 @@ export const LayoutsApiAxiosParamCreator = function (configuration?: Configurati
249
264
  localVarQueryParameter['filters'] = filters;
250
265
  }
251
266
 
252
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
253
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
267
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
268
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
269
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
270
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
271
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
272
+ if (authorizationValue || authorizationKeepEmpty) {
273
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
254
274
  }
255
275
 
256
276
 
@@ -297,8 +317,13 @@ export const LayoutsApiAxiosParamCreator = function (configuration?: Configurati
297
317
  // http bearer authentication required
298
318
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
299
319
 
300
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
301
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
320
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
321
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
322
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
323
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
324
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
325
+ if (authorizationValue || authorizationKeepEmpty) {
326
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
302
327
  }
303
328
 
304
329
 
@@ -646,7 +671,7 @@ export class LayoutsApi extends BaseAPI {
646
671
  * @memberof LayoutsApi
647
672
  */
648
673
  public createLayout(requestParameters: LayoutsApiCreateLayoutRequest, options?: AxiosRequestConfig) {
649
- return LayoutsApiFp(this.configuration).createLayout(requestParameters.createLayoutRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
674
+ return LayoutsApiFp(this.configuration).createLayout(requestParameters.createLayoutRequestDto, requestParameters.authorization, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
650
675
  }
651
676
 
652
677
  /**
@@ -658,7 +683,7 @@ export class LayoutsApi extends BaseAPI {
658
683
  * @memberof LayoutsApi
659
684
  */
660
685
  public deleteLayout(requestParameters: LayoutsApiDeleteLayoutRequest, options?: AxiosRequestConfig) {
661
- return LayoutsApiFp(this.configuration).deleteLayout(requestParameters.id, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
686
+ return LayoutsApiFp(this.configuration).deleteLayout(requestParameters.id, requestParameters.authorization, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
662
687
  }
663
688
 
664
689
  /**
@@ -670,7 +695,7 @@ export class LayoutsApi extends BaseAPI {
670
695
  * @memberof LayoutsApi
671
696
  */
672
697
  public getLayout(requestParameters: LayoutsApiGetLayoutRequest, options?: AxiosRequestConfig) {
673
- return LayoutsApiFp(this.configuration).getLayout(requestParameters.id, requestParameters.id2, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
698
+ return LayoutsApiFp(this.configuration).getLayout(requestParameters.id, requestParameters.id2, requestParameters.authorization, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
674
699
  }
675
700
 
676
701
  /**
@@ -682,7 +707,7 @@ export class LayoutsApi extends BaseAPI {
682
707
  * @memberof LayoutsApi
683
708
  */
684
709
  public listLayouts(requestParameters: LayoutsApiListLayoutsRequest = {}, options?: AxiosRequestConfig) {
685
- return LayoutsApiFp(this.configuration).listLayouts(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, options).then((request) => request(this.axios, this.basePath));
710
+ return LayoutsApiFp(this.configuration).listLayouts(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
686
711
  }
687
712
 
688
713
  /**
@@ -694,6 +719,6 @@ export class LayoutsApi extends BaseAPI {
694
719
  * @memberof LayoutsApi
695
720
  */
696
721
  public updateLayout(requestParameters: LayoutsApiUpdateLayoutRequest, options?: AxiosRequestConfig) {
697
- return LayoutsApiFp(this.configuration).updateLayout(requestParameters.id, requestParameters.updateLayoutRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
722
+ return LayoutsApiFp(this.configuration).updateLayout(requestParameters.id, requestParameters.updateLayoutRequestDto, requestParameters.authorization, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
698
723
  }
699
724
  }
@@ -76,8 +76,13 @@ export const ProductDocumentsApiAxiosParamCreator = function (configuration?: Co
76
76
  // http bearer authentication required
77
77
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
78
78
 
79
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
80
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
79
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
80
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
81
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
82
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
83
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
84
+ if (authorizationValue || authorizationKeepEmpty) {
85
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
81
86
  }
82
87
 
83
88
 
@@ -130,8 +135,13 @@ export const ProductDocumentsApiAxiosParamCreator = function (configuration?: Co
130
135
  localVarQueryParameter['contentDisposition'] = contentDisposition;
131
136
  }
132
137
 
133
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
134
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
138
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
139
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
140
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
141
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
142
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
143
+ if (authorizationValue || authorizationKeepEmpty) {
144
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
135
145
  }
136
146
 
137
147
 
@@ -179,8 +189,13 @@ export const ProductDocumentsApiAxiosParamCreator = function (configuration?: Co
179
189
  // http bearer authentication required
180
190
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
181
191
 
182
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
183
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
192
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
193
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
194
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
195
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
196
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
197
+ if (authorizationValue || authorizationKeepEmpty) {
198
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
184
199
  }
185
200
 
186
201
 
@@ -255,8 +270,13 @@ export const ProductDocumentsApiAxiosParamCreator = function (configuration?: Co
255
270
  localVarQueryParameter['filters'] = filters;
256
271
  }
257
272
 
258
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
259
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
273
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
274
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
275
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
276
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
277
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
278
+ if (authorizationValue || authorizationKeepEmpty) {
279
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
260
280
  }
261
281
 
262
282
 
@@ -335,8 +355,13 @@ export const ProductDocumentsApiAxiosParamCreator = function (configuration?: Co
335
355
  localVarQueryParameter['filters'] = filters;
336
356
  }
337
357
 
338
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
339
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
358
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
359
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
360
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
361
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
362
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
363
+ if (authorizationValue || authorizationKeepEmpty) {
364
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
340
365
  }
341
366
 
342
367
 
@@ -383,8 +408,13 @@ export const ProductDocumentsApiAxiosParamCreator = function (configuration?: Co
383
408
  // http bearer authentication required
384
409
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
385
410
 
386
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
387
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
411
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
412
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
413
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
414
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
415
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
416
+ if (authorizationValue || authorizationKeepEmpty) {
417
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
388
418
  }
389
419
 
390
420
 
@@ -866,7 +896,7 @@ export class ProductDocumentsApi extends BaseAPI {
866
896
  * @memberof ProductDocumentsApi
867
897
  */
868
898
  public deleteProductDocument(requestParameters: ProductDocumentsApiDeleteProductDocumentRequest, options?: AxiosRequestConfig) {
869
- return ProductDocumentsApiFp(this.configuration).deleteProductDocument(requestParameters.code, requestParameters.productSlug, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
899
+ return ProductDocumentsApiFp(this.configuration).deleteProductDocument(requestParameters.code, requestParameters.productSlug, requestParameters.authorization, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
870
900
  }
871
901
 
872
902
  /**
@@ -878,7 +908,7 @@ export class ProductDocumentsApi extends BaseAPI {
878
908
  * @memberof ProductDocumentsApi
879
909
  */
880
910
  public downloadProductDocument(requestParameters: ProductDocumentsApiDownloadProductDocumentRequest, options?: AxiosRequestConfig) {
881
- return ProductDocumentsApiFp(this.configuration).downloadProductDocument(requestParameters.productSlug, requestParameters.code, requestParameters.authorization, requestParameters.contentDisposition, options).then((request) => request(this.axios, this.basePath));
911
+ return ProductDocumentsApiFp(this.configuration).downloadProductDocument(requestParameters.productSlug, requestParameters.code, requestParameters.authorization, requestParameters.contentDisposition, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
882
912
  }
883
913
 
884
914
  /**
@@ -890,7 +920,7 @@ export class ProductDocumentsApi extends BaseAPI {
890
920
  * @memberof ProductDocumentsApi
891
921
  */
892
922
  public getProductDocument(requestParameters: ProductDocumentsApiGetProductDocumentRequest, options?: AxiosRequestConfig) {
893
- return ProductDocumentsApiFp(this.configuration).getProductDocument(requestParameters.productSlug, requestParameters.code, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
923
+ return ProductDocumentsApiFp(this.configuration).getProductDocument(requestParameters.productSlug, requestParameters.code, requestParameters.authorization, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
894
924
  }
895
925
 
896
926
  /**
@@ -902,7 +932,7 @@ export class ProductDocumentsApi extends BaseAPI {
902
932
  * @memberof ProductDocumentsApi
903
933
  */
904
934
  public listProductDocuments(requestParameters: ProductDocumentsApiListProductDocumentsRequest = {}, options?: AxiosRequestConfig) {
905
- return ProductDocumentsApiFp(this.configuration).listProductDocuments(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, options).then((request) => request(this.axios, this.basePath));
935
+ return ProductDocumentsApiFp(this.configuration).listProductDocuments(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
906
936
  }
907
937
 
908
938
  /**
@@ -914,7 +944,7 @@ export class ProductDocumentsApi extends BaseAPI {
914
944
  * @memberof ProductDocumentsApi
915
945
  */
916
946
  public listProductDocumentsByProduct(requestParameters: ProductDocumentsApiListProductDocumentsByProductRequest, options?: AxiosRequestConfig) {
917
- return ProductDocumentsApiFp(this.configuration).listProductDocumentsByProduct(requestParameters.productSlug, requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, options).then((request) => request(this.axios, this.basePath));
947
+ return ProductDocumentsApiFp(this.configuration).listProductDocumentsByProduct(requestParameters.productSlug, requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
918
948
  }
919
949
 
920
950
  /**
@@ -926,6 +956,6 @@ export class ProductDocumentsApi extends BaseAPI {
926
956
  * @memberof ProductDocumentsApi
927
957
  */
928
958
  public uploadProductDocument(requestParameters: ProductDocumentsApiUploadProductDocumentRequest, options?: AxiosRequestConfig) {
929
- return ProductDocumentsApiFp(this.configuration).uploadProductDocument(requestParameters.productSlug, requestParameters.uploadProductDocumentRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
959
+ return ProductDocumentsApiFp(this.configuration).uploadProductDocument(requestParameters.productSlug, requestParameters.uploadProductDocumentRequestDto, requestParameters.authorization, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
930
960
  }
931
961
  }
@@ -65,8 +65,13 @@ export const SearchKeywordsApiAxiosParamCreator = function (configuration?: Conf
65
65
  localVarQueryParameter['searchText'] = searchText;
66
66
  }
67
67
 
68
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
69
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
68
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
69
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
70
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
71
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
72
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
73
+ if (authorizationValue || authorizationKeepEmpty) {
74
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
70
75
  }
71
76
 
72
77
 
@@ -163,6 +168,6 @@ export class SearchKeywordsApi extends BaseAPI {
163
168
  * @memberof SearchKeywordsApi
164
169
  */
165
170
  public listSearchKeywords(requestParameters: SearchKeywordsApiListSearchKeywordsRequest, options?: AxiosRequestConfig) {
166
- return SearchKeywordsApiFp(this.configuration).listSearchKeywords(requestParameters.searchText, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
171
+ return SearchKeywordsApiFp(this.configuration).listSearchKeywords(requestParameters.searchText, requestParameters.authorization, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
167
172
  }
168
173
  }
@@ -93,8 +93,13 @@ export const SearchableDocumentOwnersApiAxiosParamCreator = function (configurat
93
93
  localVarQueryParameter['filters'] = filters;
94
94
  }
95
95
 
96
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
97
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
96
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
97
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
98
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
99
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
100
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
101
+ if (authorizationValue || authorizationKeepEmpty) {
102
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
98
103
  }
99
104
 
100
105
 
@@ -245,6 +250,6 @@ export class SearchableDocumentOwnersApi extends BaseAPI {
245
250
  * @memberof SearchableDocumentOwnersApi
246
251
  */
247
252
  public listSearchableDocumentOwners(requestParameters: SearchableDocumentOwnersApiListSearchableDocumentOwnersRequest = {}, options?: AxiosRequestConfig) {
248
- return SearchableDocumentOwnersApiFp(this.configuration).listSearchableDocumentOwners(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, options).then((request) => request(this.axios, this.basePath));
253
+ return SearchableDocumentOwnersApiFp(this.configuration).listSearchableDocumentOwners(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
249
254
  }
250
255
  }
@@ -77,8 +77,13 @@ export const SearchableDocumentsApiAxiosParamCreator = function (configuration?:
77
77
  localVarQueryParameter['product'] = product;
78
78
  }
79
79
 
80
- if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
81
- localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
80
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
81
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
82
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
83
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
84
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
85
+ if (authorizationValue || authorizationKeepEmpty) {
86
+ localVarHeaderParameter['Authorization'] = String(authorizationValue);
82
87
  }
83
88
 
84
89
 
@@ -193,6 +198,6 @@ export class SearchableDocumentsApi extends BaseAPI {
193
198
  * @memberof SearchableDocumentsApi
194
199
  */
195
200
  public listSearchableDocuments(requestParameters: SearchableDocumentsApiListSearchableDocumentsRequest, options?: AxiosRequestConfig) {
196
- return SearchableDocumentsApiFp(this.configuration).listSearchableDocuments(requestParameters.searchText, requestParameters.ownerIds, requestParameters.authorization, requestParameters.product, options).then((request) => request(this.axios, this.basePath));
201
+ return SearchableDocumentsApiFp(this.configuration).listSearchableDocuments(requestParameters.searchText, requestParameters.ownerIds, requestParameters.authorization, requestParameters.product, this.withOwner(options)).then((request) => request(this.axios, this.basePath));
197
202
  }
198
203
  }
package/base.ts CHANGED
@@ -92,6 +92,10 @@ export class BaseAPI {
92
92
  private username?: string;
93
93
  private password?: string;
94
94
 
95
+ protected withOwner(options?: AxiosRequestConfig): AxiosRequestConfig {
96
+ return { ...options };
97
+ }
98
+
95
99
  constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
96
100
  if (configuration) {
97
101
  this.configuration = configuration;
package/common.ts CHANGED
@@ -131,9 +131,10 @@ export const toPathString = function (url: URL) {
131
131
  * @export
132
132
  */
133
133
  export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
134
- return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
134
+ // Typed by hand: since axios 1.20, request() returns an internal axios type that SDK declarations cannot name.
135
+ return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH): Promise<R> => {
135
136
  const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url};
136
- return axios.request<T, R>(axiosRequestArgs);
137
+ return axios.request<T, R>(axiosRequestArgs) as Promise<R>;
137
138
  };
138
139
  }
139
140
 
@@ -345,7 +345,7 @@ export declare class DocumentTemplatesApi extends BaseAPI {
345
345
  * @throws {RequiredError}
346
346
  * @memberof DocumentTemplatesApi
347
347
  */
348
- createDocTemplate(requestParameters: DocumentTemplatesApiCreateDocTemplateRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateDocTemplateResponseClass, any, {}>>;
348
+ createDocTemplate(requestParameters: DocumentTemplatesApiCreateDocTemplateRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateDocTemplateResponseClass, any, {}, any>>;
349
349
  /**
350
350
  * Permanently deletes the document template. Supply the unique code that was returned when you created the document template and this will delete it. **Required Permissions** \"document-management.templates.delete\"
351
351
  * @summary Delete the document template
@@ -354,7 +354,7 @@ export declare class DocumentTemplatesApi extends BaseAPI {
354
354
  * @throws {RequiredError}
355
355
  * @memberof DocumentTemplatesApi
356
356
  */
357
- deleteDocTemplate(requestParameters: DocumentTemplatesApiDeleteDocTemplateRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<DeleteResponseClass, any, {}>>;
357
+ deleteDocTemplate(requestParameters: DocumentTemplatesApiDeleteDocTemplateRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<DeleteResponseClass, any, {}, any>>;
358
358
  /**
359
359
  * Retrieves the details of the document template that was previously created. Supply the unique document template id that was returned when you created it and Emil Api will return the corresponding document template information. **Required Permissions** \"document-management.templates.view\"
360
360
  * @summary Retrieve the document template
@@ -363,7 +363,7 @@ export declare class DocumentTemplatesApi extends BaseAPI {
363
363
  * @throws {RequiredError}
364
364
  * @memberof DocumentTemplatesApi
365
365
  */
366
- getDocTemplate(requestParameters: DocumentTemplatesApiGetDocTemplateRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<GetDocTemplateResponseClass, any, {}>>;
366
+ getDocTemplate(requestParameters: DocumentTemplatesApiGetDocTemplateRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<GetDocTemplateResponseClass, any, {}, any>>;
367
367
  /**
368
368
  * Returns a list of document templates you have previously created. The document 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.templates.view\"
369
369
  * @summary List document templates
@@ -372,7 +372,7 @@ export declare class DocumentTemplatesApi extends BaseAPI {
372
372
  * @throws {RequiredError}
373
373
  * @memberof DocumentTemplatesApi
374
374
  */
375
- listDocTemplates(requestParameters?: DocumentTemplatesApiListDocTemplatesRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListDocTemplatesResponseClass, any, {}>>;
375
+ listDocTemplates(requestParameters?: DocumentTemplatesApiListDocTemplatesRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListDocTemplatesResponseClass, any, {}, any>>;
376
376
  /**
377
377
  * Updates the specified document template by setting the values of the parameters passed. Any parameters not provided will be left unchanged. **Required Permissions** \"document-management.templates.update\"
378
378
  * @summary Update the document template
@@ -381,5 +381,5 @@ export declare class DocumentTemplatesApi extends BaseAPI {
381
381
  * @throws {RequiredError}
382
382
  * @memberof DocumentTemplatesApi
383
383
  */
384
- updateDocTemplate(requestParameters: DocumentTemplatesApiUpdateDocTemplateRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<UpdateDocTemplateResponseClass, any, {}>>;
384
+ updateDocTemplate(requestParameters: DocumentTemplatesApiUpdateDocTemplateRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<UpdateDocTemplateResponseClass, any, {}, any>>;
385
385
  }