@emilgroup/notification-sdk 0.8.1-beta.62 → 0.8.1-beta.64

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.
package/README.md CHANGED
@@ -17,11 +17,11 @@ Although this package can be used in both TypeScript and JavaScript, it is inten
17
17
  Navigate to the folder of your consuming project and run one of the following commands:
18
18
 
19
19
  ```
20
- npm install @emilgroup/notification-sdk@0.8.1-beta.62 --save
20
+ npm install @emilgroup/notification-sdk@0.8.1-beta.64 --save
21
21
  ```
22
22
  or
23
23
  ```
24
- yarn add @emilgroup/notification-sdk@0.8.1-beta.62
24
+ yarn add @emilgroup/notification-sdk@0.8.1-beta.64
25
25
  ```
26
26
 
27
27
  And then you can import ``.
@@ -54,9 +54,12 @@ export const EmailMailboxesApiAxiosParamCreator = function (configuration?: Conf
54
54
  // http bearer authentication required
55
55
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
56
56
 
57
- // Only Authorization falls back to the configured token; an empty value is never sent.
58
- const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
59
- if (authorizationValue) {
57
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
58
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
59
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
60
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
61
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
62
+ if (authorizationValue || authorizationKeepEmpty) {
60
63
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
61
64
  }
62
65
 
@@ -72,9 +72,12 @@ export const EmailMessagesApiAxiosParamCreator = function (configuration?: Confi
72
72
  // http bearer authentication required
73
73
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
74
74
 
75
- // Only Authorization falls back to the configured token; an empty value is never sent.
76
- const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
77
- if (authorizationValue) {
75
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
76
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
77
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
78
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
79
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
80
+ if (authorizationValue || authorizationKeepEmpty) {
78
81
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
79
82
  }
80
83
 
@@ -119,9 +122,12 @@ export const EmailMessagesApiAxiosParamCreator = function (configuration?: Confi
119
122
  // http bearer authentication required
120
123
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
121
124
 
122
- // Only Authorization falls back to the configured token; an empty value is never sent.
123
- const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
124
- if (authorizationValue) {
125
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
126
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
127
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
128
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
129
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
130
+ if (authorizationValue || authorizationKeepEmpty) {
125
131
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
126
132
  }
127
133
 
@@ -166,9 +172,12 @@ export const EmailMessagesApiAxiosParamCreator = function (configuration?: Confi
166
172
  // http bearer authentication required
167
173
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
168
174
 
169
- // Only Authorization falls back to the configured token; an empty value is never sent.
170
- const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
171
- if (authorizationValue) {
175
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
176
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
177
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
178
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
179
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
180
+ if (authorizationValue || authorizationKeepEmpty) {
172
181
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
173
182
  }
174
183
 
@@ -244,9 +253,12 @@ export const EmailMessagesApiAxiosParamCreator = function (configuration?: Confi
244
253
  localVarQueryParameter['filters'] = filters;
245
254
  }
246
255
 
247
- // Only Authorization falls back to the configured token; an empty value is never sent.
248
- const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
249
- if (authorizationValue) {
256
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
257
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
258
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
259
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
260
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
261
+ if (authorizationValue || authorizationKeepEmpty) {
250
262
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
251
263
  }
252
264
 
@@ -294,9 +306,12 @@ export const EmailMessagesApiAxiosParamCreator = function (configuration?: Confi
294
306
  // http bearer authentication required
295
307
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
296
308
 
297
- // Only Authorization falls back to the configured token; an empty value is never sent.
298
- const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
299
- if (authorizationValue) {
309
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
310
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
311
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
312
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
313
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
314
+ if (authorizationValue || authorizationKeepEmpty) {
300
315
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
301
316
  }
302
317
 
@@ -72,9 +72,12 @@ export const EmailSubscriptionsApiAxiosParamCreator = function (configuration?:
72
72
  // http bearer authentication required
73
73
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
74
74
 
75
- // Only Authorization falls back to the configured token; an empty value is never sent.
76
- const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
77
- if (authorizationValue) {
75
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
76
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
77
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
78
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
79
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
80
+ if (authorizationValue || authorizationKeepEmpty) {
78
81
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
79
82
  }
80
83
 
@@ -118,9 +121,12 @@ export const EmailSubscriptionsApiAxiosParamCreator = function (configuration?:
118
121
  // http bearer authentication required
119
122
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
120
123
 
121
- // Only Authorization falls back to the configured token; an empty value is never sent.
122
- const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
123
- if (authorizationValue) {
124
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
125
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
126
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
127
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
128
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
129
+ if (authorizationValue || authorizationKeepEmpty) {
124
130
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
125
131
  }
126
132
 
@@ -168,9 +174,12 @@ export const EmailSubscriptionsApiAxiosParamCreator = function (configuration?:
168
174
  // http bearer authentication required
169
175
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
170
176
 
171
- // Only Authorization falls back to the configured token; an empty value is never sent.
172
- const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
173
- if (authorizationValue) {
177
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
178
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
179
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
180
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
181
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
182
+ if (authorizationValue || authorizationKeepEmpty) {
174
183
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
175
184
  }
176
185
 
@@ -246,9 +255,12 @@ export const EmailSubscriptionsApiAxiosParamCreator = function (configuration?:
246
255
  localVarQueryParameter['filters'] = filters;
247
256
  }
248
257
 
249
- // Only Authorization falls back to the configured token; an empty value is never sent.
250
- const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
251
- if (authorizationValue) {
258
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
259
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
260
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
261
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
262
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
263
+ if (authorizationValue || authorizationKeepEmpty) {
252
264
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
253
265
  }
254
266
 
@@ -292,9 +304,12 @@ export const EmailSubscriptionsApiAxiosParamCreator = function (configuration?:
292
304
  // http bearer authentication required
293
305
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
294
306
 
295
- // Only Authorization falls back to the configured token; an empty value is never sent.
296
- const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
297
- if (authorizationValue) {
307
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
308
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
309
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
310
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
311
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
312
+ if (authorizationValue || authorizationKeepEmpty) {
298
313
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
299
314
  }
300
315
 
@@ -342,9 +357,12 @@ export const EmailSubscriptionsApiAxiosParamCreator = function (configuration?:
342
357
  // http bearer authentication required
343
358
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
344
359
 
345
- // Only Authorization falls back to the configured token; an empty value is never sent.
346
- const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
347
- if (authorizationValue) {
360
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
361
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
362
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
363
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
364
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
365
+ if (authorizationValue || authorizationKeepEmpty) {
348
366
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
349
367
  }
350
368
 
@@ -71,9 +71,12 @@ export const EmailTrackingApiAxiosParamCreator = function (configuration?: Confi
71
71
  // http bearer authentication required
72
72
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
73
73
 
74
- // Only Authorization falls back to the configured token; an empty value is never sent.
75
- const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
76
- if (authorizationValue) {
74
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
75
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
76
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
77
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
78
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
79
+ if (authorizationValue || authorizationKeepEmpty) {
77
80
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
78
81
  }
79
82
 
@@ -121,9 +124,12 @@ export const EmailTrackingApiAxiosParamCreator = function (configuration?: Confi
121
124
  // http bearer authentication required
122
125
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
123
126
 
124
- // Only Authorization falls back to the configured token; an empty value is never sent.
125
- const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
126
- if (authorizationValue) {
127
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
128
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
129
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
130
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
131
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
132
+ if (authorizationValue || authorizationKeepEmpty) {
127
133
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
128
134
  }
129
135
 
@@ -168,9 +174,12 @@ export const EmailTrackingApiAxiosParamCreator = function (configuration?: Confi
168
174
  // http bearer authentication required
169
175
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
170
176
 
171
- // Only Authorization falls back to the configured token; an empty value is never sent.
172
- const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
173
- if (authorizationValue) {
177
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
178
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
179
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
180
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
181
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
182
+ if (authorizationValue || authorizationKeepEmpty) {
174
183
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
175
184
  }
176
185
 
@@ -235,9 +244,12 @@ export const EmailTrackingApiAxiosParamCreator = function (configuration?: Confi
235
244
  localVarQueryParameter['expand'] = expand;
236
245
  }
237
246
 
238
- // Only Authorization falls back to the configured token; an empty value is never sent.
239
- const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
240
- if (authorizationValue) {
247
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
248
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
249
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
250
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
251
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
252
+ if (authorizationValue || authorizationKeepEmpty) {
241
253
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
242
254
  }
243
255
 
@@ -313,9 +325,12 @@ export const EmailTrackingApiAxiosParamCreator = function (configuration?: Confi
313
325
  localVarQueryParameter['filters'] = filters;
314
326
  }
315
327
 
316
- // Only Authorization falls back to the configured token; an empty value is never sent.
317
- const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
318
- if (authorizationValue) {
328
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
329
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
330
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
331
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
332
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
333
+ if (authorizationValue || authorizationKeepEmpty) {
319
334
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
320
335
  }
321
336
 
@@ -360,9 +375,12 @@ export const EmailTrackingApiAxiosParamCreator = function (configuration?: Confi
360
375
  // http bearer authentication required
361
376
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
362
377
 
363
- // Only Authorization falls back to the configured token; an empty value is never sent.
364
- const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
365
- if (authorizationValue) {
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.
380
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
381
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
382
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
383
+ if (authorizationValue || authorizationKeepEmpty) {
366
384
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
367
385
  }
368
386
 
@@ -63,9 +63,12 @@ export const EmailVerificationsApiAxiosParamCreator = function (configuration?:
63
63
  // http bearer authentication required
64
64
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
65
65
 
66
- // Only Authorization falls back to the configured token; an empty value is never sent.
67
- const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
68
- if (authorizationValue) {
66
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
67
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
68
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
69
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
70
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
71
+ if (authorizationValue || authorizationKeepEmpty) {
69
72
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
70
73
  }
71
74
 
@@ -112,9 +115,12 @@ export const EmailVerificationsApiAxiosParamCreator = function (configuration?:
112
115
  // http bearer authentication required
113
116
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
114
117
 
115
- // Only Authorization falls back to the configured token; an empty value is never sent.
116
- const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
117
- if (authorizationValue) {
118
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
119
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
120
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
121
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
122
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
123
+ if (authorizationValue || authorizationKeepEmpty) {
118
124
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
119
125
  }
120
126
 
@@ -67,9 +67,12 @@ export const LayoutsApiAxiosParamCreator = function (configuration?: Configurati
67
67
  // http bearer authentication required
68
68
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
69
69
 
70
- // Only Authorization falls back to the configured token; an empty value is never sent.
71
- const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
72
- if (authorizationValue) {
70
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
71
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
72
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
73
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
74
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
75
+ if (authorizationValue || authorizationKeepEmpty) {
73
76
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
74
77
  }
75
78
 
@@ -117,9 +120,12 @@ export const LayoutsApiAxiosParamCreator = function (configuration?: Configurati
117
120
  // http bearer authentication required
118
121
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
119
122
 
120
- // Only Authorization falls back to the configured token; an empty value is never sent.
121
- const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
122
- if (authorizationValue) {
123
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
124
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
125
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
126
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
127
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
128
+ if (authorizationValue || authorizationKeepEmpty) {
123
129
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
124
130
  }
125
131
 
@@ -171,9 +177,12 @@ export const LayoutsApiAxiosParamCreator = function (configuration?: Configurati
171
177
  localVarQueryParameter['id'] = id2;
172
178
  }
173
179
 
174
- // Only Authorization falls back to the configured token; an empty value is never sent.
175
- const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
176
- if (authorizationValue) {
180
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
181
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
182
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
183
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
184
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
185
+ if (authorizationValue || authorizationKeepEmpty) {
177
186
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
178
187
  }
179
188
 
@@ -249,9 +258,12 @@ export const LayoutsApiAxiosParamCreator = function (configuration?: Configurati
249
258
  localVarQueryParameter['filters'] = filters;
250
259
  }
251
260
 
252
- // Only Authorization falls back to the configured token; an empty value is never sent.
253
- const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
254
- if (authorizationValue) {
261
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
262
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
263
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
264
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
265
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
266
+ if (authorizationValue || authorizationKeepEmpty) {
255
267
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
256
268
  }
257
269
 
@@ -299,9 +311,12 @@ export const LayoutsApiAxiosParamCreator = function (configuration?: Configurati
299
311
  // http bearer authentication required
300
312
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
301
313
 
302
- // Only Authorization falls back to the configured token; an empty value is never sent.
303
- const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
304
- if (authorizationValue) {
314
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
315
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
316
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
317
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
318
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
319
+ if (authorizationValue || authorizationKeepEmpty) {
305
320
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
306
321
  }
307
322
 
@@ -67,9 +67,12 @@ export const NotificationTemplatesApiAxiosParamCreator = function (configuration
67
67
  // http bearer authentication required
68
68
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
69
69
 
70
- // Only Authorization falls back to the configured token; an empty value is never sent.
71
- const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
72
- if (authorizationValue) {
70
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
71
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
72
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
73
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
74
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
75
+ if (authorizationValue || authorizationKeepEmpty) {
73
76
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
74
77
  }
75
78
 
@@ -117,9 +120,12 @@ export const NotificationTemplatesApiAxiosParamCreator = function (configuration
117
120
  // http bearer authentication required
118
121
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
119
122
 
120
- // Only Authorization falls back to the configured token; an empty value is never sent.
121
- const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
122
- if (authorizationValue) {
123
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
124
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
125
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
126
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
127
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
128
+ if (authorizationValue || authorizationKeepEmpty) {
123
129
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
124
130
  }
125
131
 
@@ -176,9 +182,12 @@ export const NotificationTemplatesApiAxiosParamCreator = function (configuration
176
182
  localVarQueryParameter['expand'] = expand;
177
183
  }
178
184
 
179
- // Only Authorization falls back to the configured token; an empty value is never sent.
180
- const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
181
- if (authorizationValue) {
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.
187
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
188
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
189
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
190
+ if (authorizationValue || authorizationKeepEmpty) {
182
191
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
183
192
  }
184
193
 
@@ -254,9 +263,12 @@ export const NotificationTemplatesApiAxiosParamCreator = function (configuration
254
263
  localVarQueryParameter['filters'] = filters;
255
264
  }
256
265
 
257
- // Only Authorization falls back to the configured token; an empty value is never sent.
258
- const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
259
- if (authorizationValue) {
266
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
267
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
268
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
269
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
270
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
271
+ if (authorizationValue || authorizationKeepEmpty) {
260
272
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
261
273
  }
262
274
 
@@ -304,9 +316,12 @@ export const NotificationTemplatesApiAxiosParamCreator = function (configuration
304
316
  // http bearer authentication required
305
317
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
306
318
 
307
- // Only Authorization falls back to the configured token; an empty value is never sent.
308
- const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
309
- if (authorizationValue) {
319
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
320
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
321
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
322
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
323
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
324
+ if (authorizationValue || authorizationKeepEmpty) {
310
325
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
311
326
  }
312
327
 
@@ -63,9 +63,12 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi
63
63
  // http bearer authentication required
64
64
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
65
65
 
66
- // Only Authorization falls back to the configured token; an empty value is never sent.
67
- const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
68
- if (authorizationValue) {
66
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
67
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
68
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
69
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
70
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
71
+ if (authorizationValue || authorizationKeepEmpty) {
69
72
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
70
73
  }
71
74
 
@@ -112,9 +115,12 @@ export const NotificationsApiAxiosParamCreator = function (configuration?: Confi
112
115
  // http bearer authentication required
113
116
  await setBearerAuthToObject(localVarHeaderParameter, configuration)
114
117
 
115
- // Only Authorization falls back to the configured token; an empty value is never sent.
116
- const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
117
- if (authorizationValue) {
118
+ // Only Authorization falls back to the configured token. Without a session it is sent as before, empty when
119
+ // no token is stored, so a refused call still refreshes; a session call (account header) sends none.
120
+ const authorizationIsAuth = 'Authorization'.toLowerCase() === 'authorization';
121
+ const authorizationValue = authorizationIsAuth ? (authorization || baseAccessToken) : authorization;
122
+ const authorizationKeepEmpty = authorizationIsAuth && authorizationValue === '' && !baseOptions?.headers?.['X-Emil-Account'];
123
+ if (authorizationValue || authorizationKeepEmpty) {
118
124
  localVarHeaderParameter['Authorization'] = String(authorizationValue);
119
125
  }
120
126
 
package/base.ts CHANGED
@@ -120,6 +120,15 @@ export class BaseAPI {
120
120
  this.loadTokenData();
121
121
 
122
122
  if (configuration) {
123
+ // Two accounts in one browser share APP_TOKEN: never take the token or session account saved for
124
+ // another account. The mode stays (an app naming its account keeps its session). Saved with the next refresh.
125
+ const ownUser = configuration.username;
126
+ const storedUser = this.tokenData.username;
127
+ if (ownUser && storedUser && ownUser.toLowerCase() !== storedUser.toLowerCase()) {
128
+ delete this.tokenData.accessToken;
129
+ delete this.tokenData.sub;
130
+ this.tokenData.username = ownUser;
131
+ }
123
132
  const { accessToken } = this.tokenData;
124
133
  this.configuration = configuration;
125
134
  this.basePath = configuration.basePath || this.basePath;
@@ -434,8 +443,13 @@ export class BaseAPI {
434
443
  this.applyTokenReply(reply);
435
444
  this.storeTokenData(this.tokenData);
436
445
 
446
+ // The limit is for refreshes that do not help; one that worked starts the count again.
447
+ // Not awaited, so a failed retry reaches the app as the same axios error as before.
437
448
  return axios.request({
438
449
  ...this.withCurrentAuth(originalConfig),
450
+ }).then((retried) => {
451
+ _retry_count = 0;
452
+ return retried;
439
453
  });
440
454
  } catch (_error) {
441
455
  if (_error.response && _error.response.data) {