@emilgroup/account-sdk 1.49.1-beta.13 → 1.49.1-beta.16
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 +2 -2
- package/api/accounts-api.ts +24 -12
- package/base.ts +174 -41
- package/common.ts +3 -2
- package/configuration.ts +20 -0
- package/dist/api/accounts-api.d.ts +6 -6
- package/dist/api/accounts-api.js +33 -21
- package/dist/api/health-api.d.ts +1 -1
- package/dist/base.d.ts +24 -0
- package/dist/base.js +178 -59
- package/dist/common.d.ts +1 -1
- package/dist/common.js +1 -0
- package/dist/configuration.d.ts +17 -0
- package/dist/configuration.js +2 -0
- package/package.json +2 -2
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/account-sdk@1.49.1-beta.
|
|
20
|
+
npm install @emilgroup/account-sdk@1.49.1-beta.16 --save
|
|
21
21
|
```
|
|
22
22
|
or
|
|
23
23
|
```
|
|
24
|
-
yarn add @emilgroup/account-sdk@1.49.1-beta.
|
|
24
|
+
yarn add @emilgroup/account-sdk@1.49.1-beta.16
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
And then you can import `AccountsApi`.
|
package/api/accounts-api.ts
CHANGED
|
@@ -67,8 +67,10 @@ export const AccountsApiAxiosParamCreator = function (configuration?: Configurat
|
|
|
67
67
|
// http bearer authentication required
|
|
68
68
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
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) {
|
|
73
|
+
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
72
74
|
}
|
|
73
75
|
|
|
74
76
|
|
|
@@ -115,8 +117,10 @@ export const AccountsApiAxiosParamCreator = function (configuration?: Configurat
|
|
|
115
117
|
// http bearer authentication required
|
|
116
118
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
117
119
|
|
|
118
|
-
|
|
119
|
-
|
|
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
|
+
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
120
124
|
}
|
|
121
125
|
|
|
122
126
|
|
|
@@ -165,8 +169,10 @@ export const AccountsApiAxiosParamCreator = function (configuration?: Configurat
|
|
|
165
169
|
localVarQueryParameter['expand'] = expand;
|
|
166
170
|
}
|
|
167
171
|
|
|
168
|
-
|
|
169
|
-
|
|
172
|
+
// Only Authorization falls back to the configured token; an empty value is never sent.
|
|
173
|
+
const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
|
|
174
|
+
if (authorizationValue) {
|
|
175
|
+
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
170
176
|
}
|
|
171
177
|
|
|
172
178
|
|
|
@@ -215,8 +221,10 @@ export const AccountsApiAxiosParamCreator = function (configuration?: Configurat
|
|
|
215
221
|
localVarQueryParameter['expand'] = expand;
|
|
216
222
|
}
|
|
217
223
|
|
|
218
|
-
|
|
219
|
-
|
|
224
|
+
// Only Authorization falls back to the configured token; an empty value is never sent.
|
|
225
|
+
const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
|
|
226
|
+
if (authorizationValue) {
|
|
227
|
+
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
220
228
|
}
|
|
221
229
|
|
|
222
230
|
|
|
@@ -291,8 +299,10 @@ export const AccountsApiAxiosParamCreator = function (configuration?: Configurat
|
|
|
291
299
|
localVarQueryParameter['filters'] = filters;
|
|
292
300
|
}
|
|
293
301
|
|
|
294
|
-
|
|
295
|
-
|
|
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) {
|
|
305
|
+
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
296
306
|
}
|
|
297
307
|
|
|
298
308
|
|
|
@@ -339,8 +349,10 @@ export const AccountsApiAxiosParamCreator = function (configuration?: Configurat
|
|
|
339
349
|
// http bearer authentication required
|
|
340
350
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
341
351
|
|
|
342
|
-
|
|
343
|
-
|
|
352
|
+
// Only Authorization falls back to the configured token; an empty value is never sent.
|
|
353
|
+
const authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
|
|
354
|
+
if (authorizationValue) {
|
|
355
|
+
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
344
356
|
}
|
|
345
357
|
|
|
346
358
|
|
package/base.ts
CHANGED
|
@@ -32,9 +32,20 @@ export const COLLECTION_FORMATS = {
|
|
|
32
32
|
pipes: "|",
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
+
export interface SessionClass {
|
|
36
|
+
sub: string;
|
|
37
|
+
username?: string;
|
|
38
|
+
email?: string;
|
|
39
|
+
tenantSlug?: string;
|
|
40
|
+
permissions?: string;
|
|
41
|
+
expiresAt?: number;
|
|
42
|
+
}
|
|
43
|
+
|
|
35
44
|
export interface LoginClass {
|
|
36
45
|
accessToken: string;
|
|
37
46
|
permissions: string;
|
|
47
|
+
authMode?: string;
|
|
48
|
+
session?: SessionClass;
|
|
38
49
|
}
|
|
39
50
|
|
|
40
51
|
export interface SwitchWorkspaceRequest {
|
|
@@ -45,6 +56,8 @@ export interface SwitchWorkspaceRequest {
|
|
|
45
56
|
export interface SwitchWorkspaceResponseClass {
|
|
46
57
|
accessToken: string;
|
|
47
58
|
permissions: string;
|
|
59
|
+
authMode?: string;
|
|
60
|
+
session?: SessionClass;
|
|
48
61
|
}
|
|
49
62
|
|
|
50
63
|
export enum Environment {
|
|
@@ -77,10 +90,19 @@ interface TokenData {
|
|
|
77
90
|
accessToken?: string;
|
|
78
91
|
username?: string;
|
|
79
92
|
permissions?: string;
|
|
93
|
+
// 'both' or 'session' when authservice keeps the tokens in a server session.
|
|
94
|
+
authMode?: string;
|
|
95
|
+
sub?: string;
|
|
80
96
|
}
|
|
81
97
|
|
|
82
98
|
const NETWORK_ERROR_MESSAGE = "Network Error";
|
|
83
99
|
const TOKEN_DATA = 'APP_TOKEN';
|
|
100
|
+
// Sent only to authservice, to ask for a server session.
|
|
101
|
+
const AUTH_MODE_HEADER = 'X-Emil-Auth-Mode';
|
|
102
|
+
// Names the account on every call; one browser session can hold several.
|
|
103
|
+
const ACCOUNT_HEADER = 'X-Emil-Account';
|
|
104
|
+
const SESSION_MODES = ['both', 'session'];
|
|
105
|
+
const RESEND_SAFE_METHODS = ['get', 'head', 'options'];
|
|
84
106
|
|
|
85
107
|
/**
|
|
86
108
|
*
|
|
@@ -102,10 +124,18 @@ export class BaseAPI {
|
|
|
102
124
|
this.configuration = configuration;
|
|
103
125
|
this.basePath = configuration.basePath || this.basePath;
|
|
104
126
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
127
|
+
if (configuration.cookieAuth) {
|
|
128
|
+
this.configuration.username = this.configuration.username || this.tokenData.username;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
if (this.usesSession()) {
|
|
132
|
+
this.useSessionAuth();
|
|
133
|
+
} else {
|
|
134
|
+
// Use config token if provided, otherwise use tokenData token
|
|
135
|
+
const configToken = this.configuration.accessToken;
|
|
136
|
+
const storedToken = accessToken ? `Bearer ${accessToken}` : '';
|
|
137
|
+
this.configuration.accessToken = configToken || storedToken;
|
|
138
|
+
}
|
|
109
139
|
} else {
|
|
110
140
|
const { accessToken, username } = this.tokenData;
|
|
111
141
|
|
|
@@ -119,6 +149,107 @@ export class BaseAPI {
|
|
|
119
149
|
this.attachInterceptor(axios);
|
|
120
150
|
}
|
|
121
151
|
|
|
152
|
+
// The app's own account wins over APP_TOKEN, which holds whichever tab wrote last.
|
|
153
|
+
private sessionAccount(): string | undefined {
|
|
154
|
+
return this.configuration.account || this.tokenData.sub;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// Apps may pass the address as the second argument only; authservice is on the same host.
|
|
158
|
+
private authBasePath(): string {
|
|
159
|
+
return this.configuration.basePath || this.basePath;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
private usesSession(): boolean {
|
|
163
|
+
return !!this.configuration.cookieAuth && SESSION_MODES.indexOf(this.tokenData.authMode) !== -1 && !!this.sessionAccount();
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
private useSessionAuth() {
|
|
167
|
+
const { headers, ...baseOptions } = this.configuration.baseOptions || {};
|
|
168
|
+
this.configuration.accessToken = '';
|
|
169
|
+
this.configuration.baseOptions = {
|
|
170
|
+
...baseOptions,
|
|
171
|
+
withCredentials: true,
|
|
172
|
+
headers: { ...headers, [ACCOUNT_HEADER]: this.sessionAccount() },
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
private useHeaderAuth(accessToken: string) {
|
|
177
|
+
this.configuration.accessToken = accessToken ? `Bearer ${accessToken}` : '';
|
|
178
|
+
this.tokenData.accessToken = accessToken;
|
|
179
|
+
delete this.tokenData.authMode;
|
|
180
|
+
delete this.tokenData.sub;
|
|
181
|
+
if (this.configuration.cookieAuth) {
|
|
182
|
+
const { withCredentials, headers, ...baseOptions } = this.configuration.baseOptions || {};
|
|
183
|
+
const { [ACCOUNT_HEADER]: account, ...otherHeaders } = headers || {};
|
|
184
|
+
this.configuration.baseOptions = { ...baseOptions, headers: otherHeaders };
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
private applyTokenReply({ accessToken, authMode, session }: LoginClass) {
|
|
189
|
+
if (this.configuration.cookieAuth && SESSION_MODES.indexOf(authMode) !== -1 && session?.sub) {
|
|
190
|
+
this.tokenData.authMode = authMode;
|
|
191
|
+
this.tokenData.sub = session.sub;
|
|
192
|
+
if (this.configuration.account) {
|
|
193
|
+
// A workspace switch moves the app to another account.
|
|
194
|
+
this.configuration.account = session.sub;
|
|
195
|
+
}
|
|
196
|
+
// Both keeps the token for apps not moved yet; session mode keeps no token at all.
|
|
197
|
+
if (authMode === 'both' && accessToken) {
|
|
198
|
+
this.tokenData.accessToken = accessToken;
|
|
199
|
+
} else {
|
|
200
|
+
delete this.tokenData.accessToken;
|
|
201
|
+
}
|
|
202
|
+
this.useSessionAuth();
|
|
203
|
+
} else {
|
|
204
|
+
this.useHeaderAuth(accessToken);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
private sessionHeaders(): Record<string, string> {
|
|
209
|
+
if (!this.configuration.cookieAuth) {
|
|
210
|
+
return {};
|
|
211
|
+
}
|
|
212
|
+
return {
|
|
213
|
+
[AUTH_MODE_HEADER]: 'session',
|
|
214
|
+
...(this.usesSession() && { [ACCOUNT_HEADER]: this.sessionAccount() }),
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
private withCurrentAuth(config: AxiosRequestConfig): AxiosRequestConfig {
|
|
219
|
+
delete config.headers['Authorization'];
|
|
220
|
+
delete config.headers[ACCOUNT_HEADER];
|
|
221
|
+
if (this.usesSession()) {
|
|
222
|
+
config.headers[ACCOUNT_HEADER] = this.sessionAccount();
|
|
223
|
+
config.withCredentials = true;
|
|
224
|
+
} else if (this.configuration.accessToken) {
|
|
225
|
+
config.headers['Authorization'] = this.configuration.accessToken;
|
|
226
|
+
}
|
|
227
|
+
return config;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// Both keeps the token, so a session call the browser could not complete can be sent again with it.
|
|
231
|
+
private canRetryWithToken(config: AxiosRequestConfig): boolean {
|
|
232
|
+
return !!config.withCredentials && !!config.headers?.[ACCOUNT_HEADER]
|
|
233
|
+
&& !!this.tokenData.accessToken && this.tokenData.authMode !== 'session';
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// A network error can come after the server ran the call, so only a call that is safe to repeat is sent again.
|
|
237
|
+
private canResend(config: AxiosRequestConfig): boolean {
|
|
238
|
+
return RESEND_SAFE_METHODS.indexOf((config.method || 'get').toLowerCase()) !== -1
|
|
239
|
+
|| Object.keys(config.headers || {}).some((name) => name.toLowerCase() === 'idempotency-key');
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
private switchToToken() {
|
|
243
|
+
this.useHeaderAuth(this.tokenData.accessToken);
|
|
244
|
+
this.storeTokenData(this.tokenData);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
private retryWithToken(axios: AxiosInstance, config: AxiosRequestConfig) {
|
|
248
|
+
this.switchToToken();
|
|
249
|
+
config.withCredentials = false;
|
|
250
|
+
return axios(this.withCurrentAuth(config));
|
|
251
|
+
}
|
|
252
|
+
|
|
122
253
|
selectEnvironment(env: Environment) {
|
|
123
254
|
this.selectBasePath(env);
|
|
124
255
|
}
|
|
@@ -138,8 +269,8 @@ export class BaseAPI {
|
|
|
138
269
|
async authorize(username: string, password: string, targetWorkspace?: string): Promise<void> {
|
|
139
270
|
const options: AxiosRequestConfig = {
|
|
140
271
|
method: 'POST',
|
|
141
|
-
url: `${this.
|
|
142
|
-
headers: { 'Content-Type': 'application/json' },
|
|
272
|
+
url: `${this.authBasePath()}/authservice/v1/login`,
|
|
273
|
+
headers: { 'Content-Type': 'application/json', ...(this.configuration.cookieAuth && { [AUTH_MODE_HEADER]: 'session' }) },
|
|
143
274
|
data: {
|
|
144
275
|
username,
|
|
145
276
|
password,
|
|
@@ -149,13 +280,10 @@ export class BaseAPI {
|
|
|
149
280
|
|
|
150
281
|
const response = await globalAxios.request<LoginClass>(options);
|
|
151
282
|
|
|
152
|
-
const { data: { accessToken, permissions } } = response;
|
|
153
|
-
|
|
154
283
|
this.configuration.username = username;
|
|
155
|
-
this.configuration.accessToken = `Bearer ${accessToken}`;
|
|
156
284
|
this.tokenData.username = username;
|
|
157
|
-
this.tokenData.
|
|
158
|
-
this.
|
|
285
|
+
this.tokenData.permissions = response.data.permissions;
|
|
286
|
+
this.applyTokenReply(response.data);
|
|
159
287
|
|
|
160
288
|
// Switch workspace if provided
|
|
161
289
|
if (targetWorkspace) {
|
|
@@ -175,10 +303,11 @@ export class BaseAPI {
|
|
|
175
303
|
async switchWorkspace(targetWorkspace: string): Promise<void> {
|
|
176
304
|
const options: AxiosRequestConfig = {
|
|
177
305
|
method: 'POST',
|
|
178
|
-
url: `${this.
|
|
306
|
+
url: `${this.authBasePath()}/authservice/v1/workspaces/switch`,
|
|
179
307
|
headers: {
|
|
180
308
|
'Content-Type': 'application/json',
|
|
181
|
-
|
|
309
|
+
...this.sessionHeaders(),
|
|
310
|
+
...(!this.usesSession() && !!this.configuration.accessToken && { 'Authorization': this.configuration.accessToken as string }),
|
|
182
311
|
},
|
|
183
312
|
data: {
|
|
184
313
|
username: this.configuration.username,
|
|
@@ -189,11 +318,8 @@ export class BaseAPI {
|
|
|
189
318
|
|
|
190
319
|
const response = await globalAxios.request<SwitchWorkspaceResponseClass>(options);
|
|
191
320
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
this.configuration.accessToken = `Bearer ${accessToken}`;
|
|
195
|
-
this.tokenData.accessToken = accessToken;
|
|
196
|
-
this.tokenData.permissions = permissions;
|
|
321
|
+
this.tokenData.permissions = response.data.permissions;
|
|
322
|
+
this.applyTokenReply(response.data);
|
|
197
323
|
|
|
198
324
|
this.storeTokenData({
|
|
199
325
|
...this.tokenData
|
|
@@ -219,9 +345,10 @@ export class BaseAPI {
|
|
|
219
345
|
|
|
220
346
|
const options: AxiosRequestConfig = {
|
|
221
347
|
method: 'POST',
|
|
222
|
-
url: `${this.
|
|
348
|
+
url: `${this.authBasePath()}/authservice/v1/refresh-token`,
|
|
223
349
|
headers: {
|
|
224
350
|
'Content-Type': 'application/json',
|
|
351
|
+
...this.sessionHeaders(),
|
|
225
352
|
},
|
|
226
353
|
data: { username: username },
|
|
227
354
|
withCredentials: true,
|
|
@@ -262,20 +389,22 @@ export class BaseAPI {
|
|
|
262
389
|
&& !originalConfig._retry) {
|
|
263
390
|
originalConfig._retry = true;
|
|
264
391
|
try {
|
|
265
|
-
const
|
|
266
|
-
|
|
267
|
-
this.
|
|
268
|
-
|
|
269
|
-
delete originalConfig.headers['Authorization']
|
|
270
|
-
|
|
271
|
-
originalConfig.headers['Authorization'] = accessToken;
|
|
272
|
-
|
|
273
|
-
this.configuration.accessToken = accessToken;
|
|
274
|
-
this.tokenData.accessToken = tokenString;
|
|
275
|
-
|
|
392
|
+
const reply = await this.refreshTokenInternal();
|
|
393
|
+
this.tokenData.permissions = reply.permissions;
|
|
394
|
+
this.applyTokenReply(reply);
|
|
276
395
|
this.storeTokenData(this.tokenData);
|
|
277
396
|
|
|
278
|
-
|
|
397
|
+
if (!this.usesSession()) {
|
|
398
|
+
return axios(this.withCurrentAuth(originalConfig));
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
// Both mode: if the browser does not send the session cookie (another site), use the token.
|
|
402
|
+
return axios(this.withCurrentAuth(originalConfig)).catch((retryError) => {
|
|
403
|
+
if (retryError?.response?.status !== 401 || !this.tokenData.accessToken) {
|
|
404
|
+
return Promise.reject(retryError);
|
|
405
|
+
}
|
|
406
|
+
return this.retryWithToken(axios, originalConfig);
|
|
407
|
+
});
|
|
279
408
|
} catch (_error) {
|
|
280
409
|
if (_error.response && _error.response.data) {
|
|
281
410
|
return Promise.reject(_error.response.data);
|
|
@@ -283,26 +412,30 @@ export class BaseAPI {
|
|
|
283
412
|
return Promise.reject(_error);
|
|
284
413
|
}
|
|
285
414
|
}
|
|
415
|
+
} else if (err.message === NETWORK_ERROR_MESSAGE && this.canRetryWithToken(originalConfig)) {
|
|
416
|
+
// Both mode: the browser blocked the session call or hid its reply; later calls use the token.
|
|
417
|
+
if (!this.canResend(originalConfig)) {
|
|
418
|
+
this.switchToToken();
|
|
419
|
+
return Promise.reject(err);
|
|
420
|
+
}
|
|
421
|
+
return this.retryWithToken(axios, originalConfig);
|
|
286
422
|
} else if (err.message === NETWORK_ERROR_MESSAGE
|
|
287
|
-
&& originalConfig.headers.hasOwnProperty('Authorization')
|
|
423
|
+
&& (originalConfig.headers.hasOwnProperty('Authorization')
|
|
424
|
+
|| (this.configuration.cookieAuth && originalConfig.withCredentials && this.canResend(originalConfig)))
|
|
288
425
|
&& _retry_count < 4
|
|
289
426
|
) {
|
|
290
427
|
_retry_count++;
|
|
291
428
|
try {
|
|
292
|
-
|
|
293
|
-
const
|
|
294
|
-
this.tokenData.permissions = permissions;
|
|
429
|
+
// In session mode an unreadable 401 (no CORS headers on the error reply) also lands here.
|
|
430
|
+
const reply = await this.refreshTokenInternal();
|
|
431
|
+
this.tokenData.permissions = reply.permissions;
|
|
295
432
|
|
|
296
433
|
_retry = true;
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
this.configuration.accessToken = accessToken;
|
|
300
|
-
this.tokenData.accessToken = tokenString;
|
|
301
|
-
|
|
434
|
+
this.applyTokenReply(reply);
|
|
302
435
|
this.storeTokenData(this.tokenData);
|
|
303
436
|
|
|
304
437
|
return axios.request({
|
|
305
|
-
...originalConfig,
|
|
438
|
+
...this.withCurrentAuth(originalConfig),
|
|
306
439
|
});
|
|
307
440
|
} catch (_error) {
|
|
308
441
|
if (_error.response && _error.response.data) {
|
package/common.ts
CHANGED
|
@@ -130,9 +130,10 @@ export const toPathString = function (url: URL) {
|
|
|
130
130
|
* @export
|
|
131
131
|
*/
|
|
132
132
|
export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
|
|
133
|
-
|
|
133
|
+
// Typed by hand: since axios 1.20, request() returns an internal axios type that SDK declarations cannot name.
|
|
134
|
+
return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH): Promise<R> => {
|
|
134
135
|
const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url};
|
|
135
|
-
return axios.request<T, R>(axiosRequestArgs)
|
|
136
|
+
return axios.request<T, R>(axiosRequestArgs) as Promise<R>;
|
|
136
137
|
};
|
|
137
138
|
}
|
|
138
139
|
|
package/configuration.ts
CHANGED
|
@@ -21,6 +21,8 @@ export interface ConfigurationParameters {
|
|
|
21
21
|
basePath?: string;
|
|
22
22
|
baseOptions?: any;
|
|
23
23
|
formDataCtor?: new () => any;
|
|
24
|
+
cookieAuth?: boolean;
|
|
25
|
+
account?: string;
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
export class Configuration {
|
|
@@ -74,6 +76,22 @@ export class Configuration {
|
|
|
74
76
|
*/
|
|
75
77
|
formDataCtor?: new () => any;
|
|
76
78
|
|
|
79
|
+
/**
|
|
80
|
+
* Use a server session when authservice makes one; otherwise the token, as without this option.
|
|
81
|
+
* Set `account` too, so each SDK object keeps its own account.
|
|
82
|
+
*
|
|
83
|
+
* @type {boolean}
|
|
84
|
+
* @memberof Configuration
|
|
85
|
+
*/
|
|
86
|
+
cookieAuth?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* The session account (Cognito sub) this app shows, so the SDK never takes another tab's account.
|
|
89
|
+
*
|
|
90
|
+
* @type {string}
|
|
91
|
+
* @memberof Configuration
|
|
92
|
+
*/
|
|
93
|
+
account?: string;
|
|
94
|
+
|
|
77
95
|
constructor(param: ConfigurationParameters = {}) {
|
|
78
96
|
this.apiKey = param.apiKey;
|
|
79
97
|
this.username = param.username;
|
|
@@ -82,6 +100,8 @@ export class Configuration {
|
|
|
82
100
|
this.basePath = param.basePath;
|
|
83
101
|
this.baseOptions = param.baseOptions;
|
|
84
102
|
this.formDataCtor = param.formDataCtor;
|
|
103
|
+
this.cookieAuth = param.cookieAuth;
|
|
104
|
+
this.account = param.account;
|
|
85
105
|
}
|
|
86
106
|
|
|
87
107
|
/**
|
|
@@ -408,7 +408,7 @@ export declare class AccountsApi extends BaseAPI {
|
|
|
408
408
|
* @throws {RequiredError}
|
|
409
409
|
* @memberof AccountsApi
|
|
410
410
|
*/
|
|
411
|
-
createAccount(requestParameters: AccountsApiCreateAccountRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateAccountResponseClass, any, {}>>;
|
|
411
|
+
createAccount(requestParameters: AccountsApiCreateAccountRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<CreateAccountResponseClass, any, {}, any>>;
|
|
412
412
|
/**
|
|
413
413
|
* Permanently deletes the account. Supply the unique code that was returned when you created the account and this will delete it. **Required Permissions** \"partner-management.partners.delete\"
|
|
414
414
|
* @summary Delete the account
|
|
@@ -417,7 +417,7 @@ export declare class AccountsApi extends BaseAPI {
|
|
|
417
417
|
* @throws {RequiredError}
|
|
418
418
|
* @memberof AccountsApi
|
|
419
419
|
*/
|
|
420
|
-
deleteAccount(requestParameters: AccountsApiDeleteAccountRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any, {}>>;
|
|
420
|
+
deleteAccount(requestParameters: AccountsApiDeleteAccountRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any, {}, any>>;
|
|
421
421
|
/**
|
|
422
422
|
* Retrieves the details of the account that was previously created. Supply the unique account code that was returned when you created it and Emil Api will return the corresponding account information. **Required Permissions** \"partner-management.partners.view\"
|
|
423
423
|
* @summary Retrieve the account
|
|
@@ -426,7 +426,7 @@ export declare class AccountsApi extends BaseAPI {
|
|
|
426
426
|
* @throws {RequiredError}
|
|
427
427
|
* @memberof AccountsApi
|
|
428
428
|
*/
|
|
429
|
-
getAccount(requestParameters: AccountsApiGetAccountRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<GetAccountResponseClass, any, {}>>;
|
|
429
|
+
getAccount(requestParameters: AccountsApiGetAccountRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<GetAccountResponseClass, any, {}, any>>;
|
|
430
430
|
/**
|
|
431
431
|
* Retrieves the details of the account that was previously created. Supply the email that was returned when you created it and Emil Api will return the corresponding account information. Email matching is case-insensitive. **Required Permissions** \"partner-management.partners.view\"
|
|
432
432
|
* @summary Retrieve the account
|
|
@@ -435,7 +435,7 @@ export declare class AccountsApi extends BaseAPI {
|
|
|
435
435
|
* @throws {RequiredError}
|
|
436
436
|
* @memberof AccountsApi
|
|
437
437
|
*/
|
|
438
|
-
getAccountByEmail(requestParameters: AccountsApiGetAccountByEmailRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<GetAccountResponseClass, any, {}>>;
|
|
438
|
+
getAccountByEmail(requestParameters: AccountsApiGetAccountByEmailRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<GetAccountResponseClass, any, {}, any>>;
|
|
439
439
|
/**
|
|
440
440
|
* Returns a list of accounts you have previously created. The accounts are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation. **Required Permissions** \"partner-management.partners.view\"
|
|
441
441
|
* @summary List accounts
|
|
@@ -444,7 +444,7 @@ export declare class AccountsApi extends BaseAPI {
|
|
|
444
444
|
* @throws {RequiredError}
|
|
445
445
|
* @memberof AccountsApi
|
|
446
446
|
*/
|
|
447
|
-
listAccounts(requestParameters?: AccountsApiListAccountsRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListAccountsResponseClass, any, {}>>;
|
|
447
|
+
listAccounts(requestParameters?: AccountsApiListAccountsRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<ListAccountsResponseClass, any, {}, any>>;
|
|
448
448
|
/**
|
|
449
449
|
* Updates the specified account by setting the values of the parameters passed. Any parameters not provided will be left unchanged. **Required Permissions** \"partner-management.partners.update\"
|
|
450
450
|
* @summary Update the account
|
|
@@ -453,5 +453,5 @@ export declare class AccountsApi extends BaseAPI {
|
|
|
453
453
|
* @throws {RequiredError}
|
|
454
454
|
* @memberof AccountsApi
|
|
455
455
|
*/
|
|
456
|
-
updateAccount(requestParameters: AccountsApiUpdateAccountRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<UpdateAccountResponseClass, any, {}>>;
|
|
456
|
+
updateAccount(requestParameters: AccountsApiUpdateAccountRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<UpdateAccountResponseClass, any, {}, any>>;
|
|
457
457
|
}
|
package/dist/api/accounts-api.js
CHANGED
|
@@ -103,7 +103,7 @@ var AccountsApiAxiosParamCreator = function (configuration) {
|
|
|
103
103
|
createAccount: function (createAccountRequestDto, authorization, options) {
|
|
104
104
|
if (options === void 0) { options = {}; }
|
|
105
105
|
return __awaiter(_this, void 0, void 0, function () {
|
|
106
|
-
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
106
|
+
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
|
|
107
107
|
return __generator(this, function (_a) {
|
|
108
108
|
switch (_a.label) {
|
|
109
109
|
case 0:
|
|
@@ -120,13 +120,16 @@ var AccountsApiAxiosParamCreator = function (configuration) {
|
|
|
120
120
|
localVarQueryParameter = {};
|
|
121
121
|
// authentication bearer required
|
|
122
122
|
// http bearer authentication required
|
|
123
|
-
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
|
|
123
|
+
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
|
|
124
|
+
// Only Authorization falls back to the configured token; an empty value is never sent.
|
|
125
|
+
];
|
|
124
126
|
case 1:
|
|
125
127
|
// authentication bearer required
|
|
126
128
|
// http bearer authentication required
|
|
127
129
|
_a.sent();
|
|
128
|
-
|
|
129
|
-
|
|
130
|
+
authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
|
|
131
|
+
if (authorizationValue) {
|
|
132
|
+
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
130
133
|
}
|
|
131
134
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
132
135
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
@@ -152,7 +155,7 @@ var AccountsApiAxiosParamCreator = function (configuration) {
|
|
|
152
155
|
deleteAccount: function (code, authorization, options) {
|
|
153
156
|
if (options === void 0) { options = {}; }
|
|
154
157
|
return __awaiter(_this, void 0, void 0, function () {
|
|
155
|
-
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
158
|
+
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
|
|
156
159
|
return __generator(this, function (_a) {
|
|
157
160
|
switch (_a.label) {
|
|
158
161
|
case 0:
|
|
@@ -170,13 +173,16 @@ var AccountsApiAxiosParamCreator = function (configuration) {
|
|
|
170
173
|
localVarQueryParameter = {};
|
|
171
174
|
// authentication bearer required
|
|
172
175
|
// http bearer authentication required
|
|
173
|
-
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
|
|
176
|
+
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
|
|
177
|
+
// Only Authorization falls back to the configured token; an empty value is never sent.
|
|
178
|
+
];
|
|
174
179
|
case 1:
|
|
175
180
|
// authentication bearer required
|
|
176
181
|
// http bearer authentication required
|
|
177
182
|
_a.sent();
|
|
178
|
-
|
|
179
|
-
|
|
183
|
+
authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
|
|
184
|
+
if (authorizationValue) {
|
|
185
|
+
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
180
186
|
}
|
|
181
187
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
182
188
|
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
@@ -201,7 +207,7 @@ var AccountsApiAxiosParamCreator = function (configuration) {
|
|
|
201
207
|
getAccount: function (code, authorization, expand, options) {
|
|
202
208
|
if (options === void 0) { options = {}; }
|
|
203
209
|
return __awaiter(_this, void 0, void 0, function () {
|
|
204
|
-
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
210
|
+
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
|
|
205
211
|
return __generator(this, function (_a) {
|
|
206
212
|
switch (_a.label) {
|
|
207
213
|
case 0:
|
|
@@ -227,8 +233,9 @@ var AccountsApiAxiosParamCreator = function (configuration) {
|
|
|
227
233
|
if (expand !== undefined) {
|
|
228
234
|
localVarQueryParameter['expand'] = expand;
|
|
229
235
|
}
|
|
230
|
-
|
|
231
|
-
|
|
236
|
+
authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
|
|
237
|
+
if (authorizationValue) {
|
|
238
|
+
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
232
239
|
}
|
|
233
240
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
234
241
|
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
@@ -253,7 +260,7 @@ var AccountsApiAxiosParamCreator = function (configuration) {
|
|
|
253
260
|
getAccountByEmail: function (email, authorization, expand, options) {
|
|
254
261
|
if (options === void 0) { options = {}; }
|
|
255
262
|
return __awaiter(_this, void 0, void 0, function () {
|
|
256
|
-
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
263
|
+
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
|
|
257
264
|
return __generator(this, function (_a) {
|
|
258
265
|
switch (_a.label) {
|
|
259
266
|
case 0:
|
|
@@ -279,8 +286,9 @@ var AccountsApiAxiosParamCreator = function (configuration) {
|
|
|
279
286
|
if (expand !== undefined) {
|
|
280
287
|
localVarQueryParameter['expand'] = expand;
|
|
281
288
|
}
|
|
282
|
-
|
|
283
|
-
|
|
289
|
+
authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
|
|
290
|
+
if (authorizationValue) {
|
|
291
|
+
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
284
292
|
}
|
|
285
293
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
286
294
|
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
@@ -310,7 +318,7 @@ var AccountsApiAxiosParamCreator = function (configuration) {
|
|
|
310
318
|
listAccounts: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
|
|
311
319
|
if (options === void 0) { options = {}; }
|
|
312
320
|
return __awaiter(_this, void 0, void 0, function () {
|
|
313
|
-
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
321
|
+
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
|
|
314
322
|
return __generator(this, function (_a) {
|
|
315
323
|
switch (_a.label) {
|
|
316
324
|
case 0:
|
|
@@ -351,8 +359,9 @@ var AccountsApiAxiosParamCreator = function (configuration) {
|
|
|
351
359
|
if (filters !== undefined) {
|
|
352
360
|
localVarQueryParameter['filters'] = filters;
|
|
353
361
|
}
|
|
354
|
-
|
|
355
|
-
|
|
362
|
+
authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
|
|
363
|
+
if (authorizationValue) {
|
|
364
|
+
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
356
365
|
}
|
|
357
366
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
358
367
|
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
@@ -377,7 +386,7 @@ var AccountsApiAxiosParamCreator = function (configuration) {
|
|
|
377
386
|
updateAccount: function (code, updateAccountRequestDto, authorization, options) {
|
|
378
387
|
if (options === void 0) { options = {}; }
|
|
379
388
|
return __awaiter(_this, void 0, void 0, function () {
|
|
380
|
-
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
389
|
+
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, authorizationValue, headersFromBaseOptions;
|
|
381
390
|
return __generator(this, function (_a) {
|
|
382
391
|
switch (_a.label) {
|
|
383
392
|
case 0:
|
|
@@ -397,13 +406,16 @@ var AccountsApiAxiosParamCreator = function (configuration) {
|
|
|
397
406
|
localVarQueryParameter = {};
|
|
398
407
|
// authentication bearer required
|
|
399
408
|
// http bearer authentication required
|
|
400
|
-
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
|
|
409
|
+
return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)
|
|
410
|
+
// Only Authorization falls back to the configured token; an empty value is never sent.
|
|
411
|
+
];
|
|
401
412
|
case 1:
|
|
402
413
|
// authentication bearer required
|
|
403
414
|
// http bearer authentication required
|
|
404
415
|
_a.sent();
|
|
405
|
-
|
|
406
|
-
|
|
416
|
+
authorizationValue = 'Authorization'.toLowerCase() === 'authorization' ? (authorization || baseAccessToken) : authorization;
|
|
417
|
+
if (authorizationValue) {
|
|
418
|
+
localVarHeaderParameter['Authorization'] = String(authorizationValue);
|
|
407
419
|
}
|
|
408
420
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
409
421
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
package/dist/api/health-api.d.ts
CHANGED
|
@@ -66,5 +66,5 @@ export declare class HealthApi extends BaseAPI {
|
|
|
66
66
|
* @throws {RequiredError}
|
|
67
67
|
* @memberof HealthApi
|
|
68
68
|
*/
|
|
69
|
-
check(options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<InlineResponse200, any, {}>>;
|
|
69
|
+
check(options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<InlineResponse200, any, {}, any>>;
|
|
70
70
|
}
|
package/dist/base.d.ts
CHANGED
|
@@ -22,9 +22,19 @@ export declare const COLLECTION_FORMATS: {
|
|
|
22
22
|
tsv: string;
|
|
23
23
|
pipes: string;
|
|
24
24
|
};
|
|
25
|
+
export interface SessionClass {
|
|
26
|
+
sub: string;
|
|
27
|
+
username?: string;
|
|
28
|
+
email?: string;
|
|
29
|
+
tenantSlug?: string;
|
|
30
|
+
permissions?: string;
|
|
31
|
+
expiresAt?: number;
|
|
32
|
+
}
|
|
25
33
|
export interface LoginClass {
|
|
26
34
|
accessToken: string;
|
|
27
35
|
permissions: string;
|
|
36
|
+
authMode?: string;
|
|
37
|
+
session?: SessionClass;
|
|
28
38
|
}
|
|
29
39
|
export interface SwitchWorkspaceRequest {
|
|
30
40
|
username: string;
|
|
@@ -33,6 +43,8 @@ export interface SwitchWorkspaceRequest {
|
|
|
33
43
|
export interface SwitchWorkspaceResponseClass {
|
|
34
44
|
accessToken: string;
|
|
35
45
|
permissions: string;
|
|
46
|
+
authMode?: string;
|
|
47
|
+
session?: SessionClass;
|
|
36
48
|
}
|
|
37
49
|
export declare enum Environment {
|
|
38
50
|
Production = "https://apiv2.emil.de",
|
|
@@ -63,6 +75,18 @@ export declare class BaseAPI {
|
|
|
63
75
|
protected configuration: Configuration | undefined;
|
|
64
76
|
private tokenData?;
|
|
65
77
|
constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
|
|
78
|
+
private sessionAccount;
|
|
79
|
+
private authBasePath;
|
|
80
|
+
private usesSession;
|
|
81
|
+
private useSessionAuth;
|
|
82
|
+
private useHeaderAuth;
|
|
83
|
+
private applyTokenReply;
|
|
84
|
+
private sessionHeaders;
|
|
85
|
+
private withCurrentAuth;
|
|
86
|
+
private canRetryWithToken;
|
|
87
|
+
private canResend;
|
|
88
|
+
private switchToToken;
|
|
89
|
+
private retryWithToken;
|
|
66
90
|
selectEnvironment(env: Environment): void;
|
|
67
91
|
selectBasePath(path: string): void;
|
|
68
92
|
getPermissions(): Array<string>;
|
package/dist/base.js
CHANGED
|
@@ -74,6 +74,17 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
74
74
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
78
|
+
var t = {};
|
|
79
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
80
|
+
t[p] = s[p];
|
|
81
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
82
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
83
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
84
|
+
t[p[i]] = s[p[i]];
|
|
85
|
+
}
|
|
86
|
+
return t;
|
|
87
|
+
};
|
|
77
88
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
78
89
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
79
90
|
};
|
|
@@ -112,6 +123,12 @@ function resetRetry() {
|
|
|
112
123
|
exports.resetRetry = resetRetry;
|
|
113
124
|
var NETWORK_ERROR_MESSAGE = "Network Error";
|
|
114
125
|
var TOKEN_DATA = 'APP_TOKEN';
|
|
126
|
+
// Sent only to authservice, to ask for a server session.
|
|
127
|
+
var AUTH_MODE_HEADER = 'X-Emil-Auth-Mode';
|
|
128
|
+
// Names the account on every call; one browser session can hold several.
|
|
129
|
+
var ACCOUNT_HEADER = 'X-Emil-Account';
|
|
130
|
+
var SESSION_MODES = ['both', 'session'];
|
|
131
|
+
var RESEND_SAFE_METHODS = ['get', 'head', 'options'];
|
|
115
132
|
/**
|
|
116
133
|
*
|
|
117
134
|
* @export
|
|
@@ -128,10 +145,18 @@ var BaseAPI = /** @class */ (function () {
|
|
|
128
145
|
var accessToken = this.tokenData.accessToken;
|
|
129
146
|
this.configuration = configuration;
|
|
130
147
|
this.basePath = configuration.basePath || this.basePath;
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
this.
|
|
148
|
+
if (configuration.cookieAuth) {
|
|
149
|
+
this.configuration.username = this.configuration.username || this.tokenData.username;
|
|
150
|
+
}
|
|
151
|
+
if (this.usesSession()) {
|
|
152
|
+
this.useSessionAuth();
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
// Use config token if provided, otherwise use tokenData token
|
|
156
|
+
var configToken = this.configuration.accessToken;
|
|
157
|
+
var storedToken = accessToken ? "Bearer ".concat(accessToken) : '';
|
|
158
|
+
this.configuration.accessToken = configToken || storedToken;
|
|
159
|
+
}
|
|
135
160
|
}
|
|
136
161
|
else {
|
|
137
162
|
var _a = this.tokenData, accessToken = _a.accessToken, username = _a.username;
|
|
@@ -143,6 +168,95 @@ var BaseAPI = /** @class */ (function () {
|
|
|
143
168
|
}
|
|
144
169
|
this.attachInterceptor(axios);
|
|
145
170
|
}
|
|
171
|
+
// The app's own account wins over APP_TOKEN, which holds whichever tab wrote last.
|
|
172
|
+
BaseAPI.prototype.sessionAccount = function () {
|
|
173
|
+
return this.configuration.account || this.tokenData.sub;
|
|
174
|
+
};
|
|
175
|
+
// Apps may pass the address as the second argument only; authservice is on the same host.
|
|
176
|
+
BaseAPI.prototype.authBasePath = function () {
|
|
177
|
+
return this.configuration.basePath || this.basePath;
|
|
178
|
+
};
|
|
179
|
+
BaseAPI.prototype.usesSession = function () {
|
|
180
|
+
return !!this.configuration.cookieAuth && SESSION_MODES.indexOf(this.tokenData.authMode) !== -1 && !!this.sessionAccount();
|
|
181
|
+
};
|
|
182
|
+
BaseAPI.prototype.useSessionAuth = function () {
|
|
183
|
+
var _a;
|
|
184
|
+
var _b = this.configuration.baseOptions || {}, headers = _b.headers, baseOptions = __rest(_b, ["headers"]);
|
|
185
|
+
this.configuration.accessToken = '';
|
|
186
|
+
this.configuration.baseOptions = __assign(__assign({}, baseOptions), { withCredentials: true, headers: __assign(__assign({}, headers), (_a = {}, _a[ACCOUNT_HEADER] = this.sessionAccount(), _a)) });
|
|
187
|
+
};
|
|
188
|
+
BaseAPI.prototype.useHeaderAuth = function (accessToken) {
|
|
189
|
+
this.configuration.accessToken = accessToken ? "Bearer ".concat(accessToken) : '';
|
|
190
|
+
this.tokenData.accessToken = accessToken;
|
|
191
|
+
delete this.tokenData.authMode;
|
|
192
|
+
delete this.tokenData.sub;
|
|
193
|
+
if (this.configuration.cookieAuth) {
|
|
194
|
+
var _a = this.configuration.baseOptions || {}, withCredentials = _a.withCredentials, headers = _a.headers, baseOptions = __rest(_a, ["withCredentials", "headers"]);
|
|
195
|
+
var _b = headers || {}, _c = ACCOUNT_HEADER, account = _b[_c], otherHeaders = __rest(_b, [typeof _c === "symbol" ? _c : _c + ""]);
|
|
196
|
+
this.configuration.baseOptions = __assign(__assign({}, baseOptions), { headers: otherHeaders });
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
BaseAPI.prototype.applyTokenReply = function (_a) {
|
|
200
|
+
var accessToken = _a.accessToken, authMode = _a.authMode, session = _a.session;
|
|
201
|
+
if (this.configuration.cookieAuth && SESSION_MODES.indexOf(authMode) !== -1 && (session === null || session === void 0 ? void 0 : session.sub)) {
|
|
202
|
+
this.tokenData.authMode = authMode;
|
|
203
|
+
this.tokenData.sub = session.sub;
|
|
204
|
+
if (this.configuration.account) {
|
|
205
|
+
// A workspace switch moves the app to another account.
|
|
206
|
+
this.configuration.account = session.sub;
|
|
207
|
+
}
|
|
208
|
+
// Both keeps the token for apps not moved yet; session mode keeps no token at all.
|
|
209
|
+
if (authMode === 'both' && accessToken) {
|
|
210
|
+
this.tokenData.accessToken = accessToken;
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
delete this.tokenData.accessToken;
|
|
214
|
+
}
|
|
215
|
+
this.useSessionAuth();
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
this.useHeaderAuth(accessToken);
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
BaseAPI.prototype.sessionHeaders = function () {
|
|
222
|
+
var _a, _b;
|
|
223
|
+
if (!this.configuration.cookieAuth) {
|
|
224
|
+
return {};
|
|
225
|
+
}
|
|
226
|
+
return __assign((_a = {}, _a[AUTH_MODE_HEADER] = 'session', _a), (this.usesSession() && (_b = {}, _b[ACCOUNT_HEADER] = this.sessionAccount(), _b)));
|
|
227
|
+
};
|
|
228
|
+
BaseAPI.prototype.withCurrentAuth = function (config) {
|
|
229
|
+
delete config.headers['Authorization'];
|
|
230
|
+
delete config.headers[ACCOUNT_HEADER];
|
|
231
|
+
if (this.usesSession()) {
|
|
232
|
+
config.headers[ACCOUNT_HEADER] = this.sessionAccount();
|
|
233
|
+
config.withCredentials = true;
|
|
234
|
+
}
|
|
235
|
+
else if (this.configuration.accessToken) {
|
|
236
|
+
config.headers['Authorization'] = this.configuration.accessToken;
|
|
237
|
+
}
|
|
238
|
+
return config;
|
|
239
|
+
};
|
|
240
|
+
// Both keeps the token, so a session call the browser could not complete can be sent again with it.
|
|
241
|
+
BaseAPI.prototype.canRetryWithToken = function (config) {
|
|
242
|
+
var _a;
|
|
243
|
+
return !!config.withCredentials && !!((_a = config.headers) === null || _a === void 0 ? void 0 : _a[ACCOUNT_HEADER])
|
|
244
|
+
&& !!this.tokenData.accessToken && this.tokenData.authMode !== 'session';
|
|
245
|
+
};
|
|
246
|
+
// A network error can come after the server ran the call, so only a call that is safe to repeat is sent again.
|
|
247
|
+
BaseAPI.prototype.canResend = function (config) {
|
|
248
|
+
return RESEND_SAFE_METHODS.indexOf((config.method || 'get').toLowerCase()) !== -1
|
|
249
|
+
|| Object.keys(config.headers || {}).some(function (name) { return name.toLowerCase() === 'idempotency-key'; });
|
|
250
|
+
};
|
|
251
|
+
BaseAPI.prototype.switchToToken = function () {
|
|
252
|
+
this.useHeaderAuth(this.tokenData.accessToken);
|
|
253
|
+
this.storeTokenData(this.tokenData);
|
|
254
|
+
};
|
|
255
|
+
BaseAPI.prototype.retryWithToken = function (axios, config) {
|
|
256
|
+
this.switchToToken();
|
|
257
|
+
config.withCredentials = false;
|
|
258
|
+
return axios(this.withCurrentAuth(config));
|
|
259
|
+
};
|
|
146
260
|
BaseAPI.prototype.selectEnvironment = function (env) {
|
|
147
261
|
this.selectBasePath(env);
|
|
148
262
|
};
|
|
@@ -158,14 +272,15 @@ var BaseAPI = /** @class */ (function () {
|
|
|
158
272
|
};
|
|
159
273
|
BaseAPI.prototype.authorize = function (username, password, targetWorkspace) {
|
|
160
274
|
return __awaiter(this, void 0, void 0, function () {
|
|
161
|
-
var options, response
|
|
275
|
+
var options, response;
|
|
276
|
+
var _a;
|
|
162
277
|
return __generator(this, function (_b) {
|
|
163
278
|
switch (_b.label) {
|
|
164
279
|
case 0:
|
|
165
280
|
options = {
|
|
166
281
|
method: 'POST',
|
|
167
|
-
url: "".concat(this.
|
|
168
|
-
headers: { 'Content-Type': 'application/json' },
|
|
282
|
+
url: "".concat(this.authBasePath(), "/authservice/v1/login"),
|
|
283
|
+
headers: __assign({ 'Content-Type': 'application/json' }, (this.configuration.cookieAuth && (_a = {}, _a[AUTH_MODE_HEADER] = 'session', _a))),
|
|
169
284
|
data: {
|
|
170
285
|
username: username,
|
|
171
286
|
password: password,
|
|
@@ -175,12 +290,10 @@ var BaseAPI = /** @class */ (function () {
|
|
|
175
290
|
return [4 /*yield*/, axios_1.default.request(options)];
|
|
176
291
|
case 1:
|
|
177
292
|
response = _b.sent();
|
|
178
|
-
_a = response.data, accessToken = _a.accessToken, permissions = _a.permissions;
|
|
179
293
|
this.configuration.username = username;
|
|
180
|
-
this.configuration.accessToken = "Bearer ".concat(accessToken);
|
|
181
294
|
this.tokenData.username = username;
|
|
182
|
-
this.tokenData.
|
|
183
|
-
this.
|
|
295
|
+
this.tokenData.permissions = response.data.permissions;
|
|
296
|
+
this.applyTokenReply(response.data);
|
|
184
297
|
if (!targetWorkspace) return [3 /*break*/, 3];
|
|
185
298
|
return [4 /*yield*/, this.switchWorkspace(targetWorkspace)];
|
|
186
299
|
case 2:
|
|
@@ -199,17 +312,14 @@ var BaseAPI = /** @class */ (function () {
|
|
|
199
312
|
};
|
|
200
313
|
BaseAPI.prototype.switchWorkspace = function (targetWorkspace) {
|
|
201
314
|
return __awaiter(this, void 0, void 0, function () {
|
|
202
|
-
var options, response
|
|
203
|
-
return __generator(this, function (
|
|
204
|
-
switch (
|
|
315
|
+
var options, response;
|
|
316
|
+
return __generator(this, function (_a) {
|
|
317
|
+
switch (_a.label) {
|
|
205
318
|
case 0:
|
|
206
319
|
options = {
|
|
207
320
|
method: 'POST',
|
|
208
|
-
url: "".concat(this.
|
|
209
|
-
headers: {
|
|
210
|
-
'Content-Type': 'application/json',
|
|
211
|
-
'Authorization': "Bearer ".concat(this.configuration.accessToken),
|
|
212
|
-
},
|
|
321
|
+
url: "".concat(this.authBasePath(), "/authservice/v1/workspaces/switch"),
|
|
322
|
+
headers: __assign(__assign({ 'Content-Type': 'application/json' }, this.sessionHeaders()), (!this.usesSession() && !!this.configuration.accessToken && { 'Authorization': this.configuration.accessToken })),
|
|
213
323
|
data: {
|
|
214
324
|
username: this.configuration.username,
|
|
215
325
|
targetWorkspace: targetWorkspace,
|
|
@@ -218,11 +328,9 @@ var BaseAPI = /** @class */ (function () {
|
|
|
218
328
|
};
|
|
219
329
|
return [4 /*yield*/, axios_1.default.request(options)];
|
|
220
330
|
case 1:
|
|
221
|
-
response =
|
|
222
|
-
|
|
223
|
-
this.
|
|
224
|
-
this.tokenData.accessToken = accessToken;
|
|
225
|
-
this.tokenData.permissions = permissions;
|
|
331
|
+
response = _a.sent();
|
|
332
|
+
this.tokenData.permissions = response.data.permissions;
|
|
333
|
+
this.applyTokenReply(response.data);
|
|
226
334
|
this.storeTokenData(__assign({}, this.tokenData));
|
|
227
335
|
return [2 /*return*/];
|
|
228
336
|
}
|
|
@@ -249,10 +357,8 @@ var BaseAPI = /** @class */ (function () {
|
|
|
249
357
|
});
|
|
250
358
|
options = {
|
|
251
359
|
method: 'POST',
|
|
252
|
-
url: "".concat(this.
|
|
253
|
-
headers: {
|
|
254
|
-
'Content-Type': 'application/json',
|
|
255
|
-
},
|
|
360
|
+
url: "".concat(this.authBasePath(), "/authservice/v1/refresh-token"),
|
|
361
|
+
headers: __assign({ 'Content-Type': 'application/json' }, this.sessionHeaders()),
|
|
256
362
|
data: { username: username },
|
|
257
363
|
withCredentials: true,
|
|
258
364
|
};
|
|
@@ -285,62 +391,75 @@ var BaseAPI = /** @class */ (function () {
|
|
|
285
391
|
axios.interceptors.response.use(function (res) {
|
|
286
392
|
return res;
|
|
287
393
|
}, function (err) { return __awaiter(_this, void 0, void 0, function () {
|
|
288
|
-
var originalConfig,
|
|
289
|
-
|
|
290
|
-
|
|
394
|
+
var originalConfig, reply, _error_1, reply, _error_2;
|
|
395
|
+
var _this = this;
|
|
396
|
+
return __generator(this, function (_a) {
|
|
397
|
+
switch (_a.label) {
|
|
291
398
|
case 0:
|
|
292
399
|
originalConfig = err.config;
|
|
293
400
|
if (!(err.response && !(err.response instanceof XMLHttpRequest))) return [3 /*break*/, 5];
|
|
294
401
|
if (!((err.response.status === 401 || err.response.status === 403)
|
|
295
402
|
&& !originalConfig._retry)) return [3 /*break*/, 4];
|
|
296
403
|
originalConfig._retry = true;
|
|
297
|
-
|
|
404
|
+
_a.label = 1;
|
|
298
405
|
case 1:
|
|
299
|
-
|
|
406
|
+
_a.trys.push([1, 3, , 4]);
|
|
300
407
|
return [4 /*yield*/, this.refreshTokenInternal()];
|
|
301
408
|
case 2:
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
this.
|
|
305
|
-
delete originalConfig.headers['Authorization'];
|
|
306
|
-
originalConfig.headers['Authorization'] = accessToken;
|
|
307
|
-
this.configuration.accessToken = accessToken;
|
|
308
|
-
this.tokenData.accessToken = tokenString;
|
|
409
|
+
reply = _a.sent();
|
|
410
|
+
this.tokenData.permissions = reply.permissions;
|
|
411
|
+
this.applyTokenReply(reply);
|
|
309
412
|
this.storeTokenData(this.tokenData);
|
|
310
|
-
|
|
413
|
+
if (!this.usesSession()) {
|
|
414
|
+
return [2 /*return*/, axios(this.withCurrentAuth(originalConfig))];
|
|
415
|
+
}
|
|
416
|
+
// Both mode: if the browser does not send the session cookie (another site), use the token.
|
|
417
|
+
return [2 /*return*/, axios(this.withCurrentAuth(originalConfig)).catch(function (retryError) {
|
|
418
|
+
var _a;
|
|
419
|
+
if (((_a = retryError === null || retryError === void 0 ? void 0 : retryError.response) === null || _a === void 0 ? void 0 : _a.status) !== 401 || !_this.tokenData.accessToken) {
|
|
420
|
+
return Promise.reject(retryError);
|
|
421
|
+
}
|
|
422
|
+
return _this.retryWithToken(axios, originalConfig);
|
|
423
|
+
})];
|
|
311
424
|
case 3:
|
|
312
|
-
_error_1 =
|
|
425
|
+
_error_1 = _a.sent();
|
|
313
426
|
if (_error_1.response && _error_1.response.data) {
|
|
314
427
|
return [2 /*return*/, Promise.reject(_error_1.response.data)];
|
|
315
428
|
}
|
|
316
429
|
return [2 /*return*/, Promise.reject(_error_1)];
|
|
317
|
-
case 4: return [3 /*break*/,
|
|
430
|
+
case 4: return [3 /*break*/, 10];
|
|
318
431
|
case 5:
|
|
432
|
+
if (!(err.message === NETWORK_ERROR_MESSAGE && this.canRetryWithToken(originalConfig))) return [3 /*break*/, 6];
|
|
433
|
+
// Both mode: the browser blocked the session call or hid its reply; later calls use the token.
|
|
434
|
+
if (!this.canResend(originalConfig)) {
|
|
435
|
+
this.switchToToken();
|
|
436
|
+
return [2 /*return*/, Promise.reject(err)];
|
|
437
|
+
}
|
|
438
|
+
return [2 /*return*/, this.retryWithToken(axios, originalConfig)];
|
|
439
|
+
case 6:
|
|
319
440
|
if (!(err.message === NETWORK_ERROR_MESSAGE
|
|
320
|
-
&& originalConfig.headers.hasOwnProperty('Authorization')
|
|
321
|
-
|
|
441
|
+
&& (originalConfig.headers.hasOwnProperty('Authorization')
|
|
442
|
+
|| (this.configuration.cookieAuth && originalConfig.withCredentials && this.canResend(originalConfig)))
|
|
443
|
+
&& _retry_count < 4)) return [3 /*break*/, 10];
|
|
322
444
|
_retry_count++;
|
|
323
|
-
|
|
324
|
-
case 6:
|
|
325
|
-
_c.trys.push([6, 8, , 9]);
|
|
326
|
-
return [4 /*yield*/, this.refreshTokenInternal()];
|
|
445
|
+
_a.label = 7;
|
|
327
446
|
case 7:
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
447
|
+
_a.trys.push([7, 9, , 10]);
|
|
448
|
+
return [4 /*yield*/, this.refreshTokenInternal()];
|
|
449
|
+
case 8:
|
|
450
|
+
reply = _a.sent();
|
|
451
|
+
this.tokenData.permissions = reply.permissions;
|
|
331
452
|
_retry = true;
|
|
332
|
-
|
|
333
|
-
this.configuration.accessToken = accessToken;
|
|
334
|
-
this.tokenData.accessToken = tokenString;
|
|
453
|
+
this.applyTokenReply(reply);
|
|
335
454
|
this.storeTokenData(this.tokenData);
|
|
336
|
-
return [2 /*return*/, axios.request(__assign({}, originalConfig))];
|
|
337
|
-
case
|
|
338
|
-
_error_2 =
|
|
455
|
+
return [2 /*return*/, axios.request(__assign({}, this.withCurrentAuth(originalConfig)))];
|
|
456
|
+
case 9:
|
|
457
|
+
_error_2 = _a.sent();
|
|
339
458
|
if (_error_2.response && _error_2.response.data) {
|
|
340
459
|
return [2 /*return*/, Promise.reject(_error_2.response.data)];
|
|
341
460
|
}
|
|
342
461
|
return [2 /*return*/, Promise.reject(_error_2)];
|
|
343
|
-
case
|
|
462
|
+
case 10: return [2 /*return*/, Promise.reject(err)];
|
|
344
463
|
}
|
|
345
464
|
});
|
|
346
465
|
}); });
|
package/dist/common.d.ts
CHANGED
|
@@ -62,7 +62,7 @@ export declare const toPathString: (url: URL) => string;
|
|
|
62
62
|
*
|
|
63
63
|
* @export
|
|
64
64
|
*/
|
|
65
|
-
export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) => <T = unknown, R = AxiosResponse<T, any, {}>>(axios?: AxiosInstance, basePath?: string) => Promise<R>;
|
|
65
|
+
export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) => <T = unknown, R = AxiosResponse<T, any, {}, any>>(axios?: AxiosInstance, basePath?: string) => Promise<R>;
|
|
66
66
|
/**
|
|
67
67
|
* EMIL AccountService
|
|
68
68
|
* The EMIL AccountService API description
|
package/dist/common.js
CHANGED
|
@@ -233,6 +233,7 @@ exports.toPathString = toPathString;
|
|
|
233
233
|
* @export
|
|
234
234
|
*/
|
|
235
235
|
var createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
|
|
236
|
+
// Typed by hand: since axios 1.20, request() returns an internal axios type that SDK declarations cannot name.
|
|
236
237
|
return function (axios, basePath) {
|
|
237
238
|
if (axios === void 0) { axios = globalAxios; }
|
|
238
239
|
if (basePath === void 0) { basePath = BASE_PATH; }
|
package/dist/configuration.d.ts
CHANGED
|
@@ -17,6 +17,8 @@ export interface ConfigurationParameters {
|
|
|
17
17
|
basePath?: string;
|
|
18
18
|
baseOptions?: any;
|
|
19
19
|
formDataCtor?: new () => any;
|
|
20
|
+
cookieAuth?: boolean;
|
|
21
|
+
account?: string;
|
|
20
22
|
}
|
|
21
23
|
export declare class Configuration {
|
|
22
24
|
/**
|
|
@@ -68,6 +70,21 @@ export declare class Configuration {
|
|
|
68
70
|
* @type {new () => FormData}
|
|
69
71
|
*/
|
|
70
72
|
formDataCtor?: new () => any;
|
|
73
|
+
/**
|
|
74
|
+
* Use a server session when authservice makes one; otherwise the token, as without this option.
|
|
75
|
+
* Set `account` too, so each SDK object keeps its own account.
|
|
76
|
+
*
|
|
77
|
+
* @type {boolean}
|
|
78
|
+
* @memberof Configuration
|
|
79
|
+
*/
|
|
80
|
+
cookieAuth?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* The session account (Cognito sub) this app shows, so the SDK never takes another tab's account.
|
|
83
|
+
*
|
|
84
|
+
* @type {string}
|
|
85
|
+
* @memberof Configuration
|
|
86
|
+
*/
|
|
87
|
+
account?: string;
|
|
71
88
|
constructor(param?: ConfigurationParameters);
|
|
72
89
|
/**
|
|
73
90
|
* Check if the given MIME is a JSON MIME.
|
package/dist/configuration.js
CHANGED
|
@@ -24,6 +24,8 @@ var Configuration = /** @class */ (function () {
|
|
|
24
24
|
this.basePath = param.basePath;
|
|
25
25
|
this.baseOptions = param.baseOptions;
|
|
26
26
|
this.formDataCtor = param.formDataCtor;
|
|
27
|
+
this.cookieAuth = param.cookieAuth;
|
|
28
|
+
this.account = param.account;
|
|
27
29
|
}
|
|
28
30
|
/**
|
|
29
31
|
* Check if the given MIME is a JSON MIME.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@emilgroup/account-sdk",
|
|
3
|
-
"version": "1.49.1-beta.
|
|
3
|
+
"version": "1.49.1-beta.16",
|
|
4
4
|
"description": "OpenAPI client for @emilgroup/account-sdk",
|
|
5
5
|
"author": "OpenAPI-Generator Contributors",
|
|
6
6
|
"keywords": [
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"prepare": "npm run build"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"axios": "1.
|
|
21
|
+
"axios": "1.20.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
|