@emilgroup/document-sdk-node 1.30.1-beta.1 → 1.30.1-beta.2
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/product-documents-api.ts +4 -4
- package/base.ts +7 -15
- package/dist/api/product-documents-api.d.ts +4 -4
- package/dist/api/product-documents-api.js +3 -3
- package/dist/base.d.ts +1 -3
- package/dist/base.js +20 -26
- package/package.json +1 -1
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/document-sdk-node@1.30.1-beta.
|
|
20
|
+
npm install @emilgroup/document-sdk-node@1.30.1-beta.2 --save
|
|
21
21
|
```
|
|
22
22
|
or
|
|
23
23
|
```
|
|
24
|
-
yarn add @emilgroup/document-sdk-node@1.30.1-beta.
|
|
24
|
+
yarn add @emilgroup/document-sdk-node@1.30.1-beta.2
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
And then you can import `DocumentsApi`.
|
|
@@ -202,7 +202,7 @@ export const ProductDocumentsApiAxiosParamCreator = function (configuration?: Co
|
|
|
202
202
|
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: code, productSlug, productCode, type, createdAt, slug</i>
|
|
203
203
|
* @param {string} [search] Search query
|
|
204
204
|
* @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.<br/> <br/> <i>Allowed values: id, createdAt, filename</i>
|
|
205
|
-
* @param {string} [expand]
|
|
205
|
+
* @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/>
|
|
206
206
|
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: code, productSlug, productCode, type, createdAt, slug</i>
|
|
207
207
|
* @param {*} [options] Override http request option.
|
|
208
208
|
* @throws {RequiredError}
|
|
@@ -383,7 +383,7 @@ export const ProductDocumentsApiFp = function(configuration?: Configuration) {
|
|
|
383
383
|
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: code, productSlug, productCode, type, createdAt, slug</i>
|
|
384
384
|
* @param {string} [search] Search query
|
|
385
385
|
* @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.<br/> <br/> <i>Allowed values: id, createdAt, filename</i>
|
|
386
|
-
* @param {string} [expand]
|
|
386
|
+
* @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/>
|
|
387
387
|
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: code, productSlug, productCode, type, createdAt, slug</i>
|
|
388
388
|
* @param {*} [options] Override http request option.
|
|
389
389
|
* @throws {RequiredError}
|
|
@@ -462,7 +462,7 @@ export const ProductDocumentsApiFactory = function (configuration?: Configuratio
|
|
|
462
462
|
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: code, productSlug, productCode, type, createdAt, slug</i>
|
|
463
463
|
* @param {string} [search] Search query
|
|
464
464
|
* @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.<br/> <br/> <i>Allowed values: id, createdAt, filename</i>
|
|
465
|
-
* @param {string} [expand]
|
|
465
|
+
* @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/>
|
|
466
466
|
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: code, productSlug, productCode, type, createdAt, slug</i>
|
|
467
467
|
* @param {*} [options] Override http request option.
|
|
468
468
|
* @throws {RequiredError}
|
|
@@ -632,7 +632,7 @@ export interface ProductDocumentsApiListProductDocumentsRequest {
|
|
|
632
632
|
readonly order?: string
|
|
633
633
|
|
|
634
634
|
/**
|
|
635
|
-
*
|
|
635
|
+
* Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/>
|
|
636
636
|
* @type {string}
|
|
637
637
|
* @memberof ProductDocumentsApiListProductDocuments
|
|
638
638
|
*/
|
package/base.ts
CHANGED
|
@@ -79,7 +79,6 @@ export class BaseAPI {
|
|
|
79
79
|
protected configuration: Configuration;
|
|
80
80
|
private username?: string;
|
|
81
81
|
private password?: string;
|
|
82
|
-
private permissions?: string;
|
|
83
82
|
|
|
84
83
|
constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
|
|
85
84
|
if (configuration) {
|
|
@@ -150,10 +149,6 @@ export class BaseAPI {
|
|
|
150
149
|
this.configuration.basePath = env;
|
|
151
150
|
}
|
|
152
151
|
|
|
153
|
-
getPermissions(): Array<string> {
|
|
154
|
-
return this.permissions.split(',');
|
|
155
|
-
}
|
|
156
|
-
|
|
157
152
|
async authorize(username: string, password: string): Promise<void> {
|
|
158
153
|
const options: AxiosRequestConfig = {
|
|
159
154
|
method: 'POST',
|
|
@@ -168,21 +163,20 @@ export class BaseAPI {
|
|
|
168
163
|
|
|
169
164
|
const response = await globalAxios.request<LoginClass>(options);
|
|
170
165
|
|
|
171
|
-
const { data: { accessToken
|
|
166
|
+
const { data: { accessToken } } = response;
|
|
172
167
|
this.configuration.username = username;
|
|
173
168
|
this.configuration.accessToken = `Bearer ${accessToken}`;
|
|
174
|
-
this.permissions = permissions;
|
|
175
169
|
|
|
176
170
|
const refreshToken = this.extractRefreshToken(response)
|
|
177
171
|
this.configuration.refreshToken = refreshToken;
|
|
178
172
|
}
|
|
179
173
|
|
|
180
|
-
async refreshTokenInternal(): Promise<
|
|
174
|
+
async refreshTokenInternal(): Promise<string> {
|
|
181
175
|
const { username, refreshToken } = this.configuration;
|
|
182
176
|
|
|
183
177
|
|
|
184
178
|
if (!username || !refreshToken) {
|
|
185
|
-
|
|
179
|
+
return '';
|
|
186
180
|
}
|
|
187
181
|
|
|
188
182
|
const options: AxiosRequestConfig = {
|
|
@@ -196,9 +190,9 @@ export class BaseAPI {
|
|
|
196
190
|
withCredentials: true,
|
|
197
191
|
};
|
|
198
192
|
|
|
199
|
-
const
|
|
193
|
+
const { data: { accessToken } } = await globalAxios.request<LoginClass>(options);
|
|
200
194
|
|
|
201
|
-
return
|
|
195
|
+
return accessToken;
|
|
202
196
|
}
|
|
203
197
|
|
|
204
198
|
private extractRefreshToken(response: AxiosResponse): string {
|
|
@@ -227,9 +221,8 @@ export class BaseAPI {
|
|
|
227
221
|
if (err.response.status === 401 && !originalConfig._retry) {
|
|
228
222
|
originalConfig._retry = true;
|
|
229
223
|
try {
|
|
230
|
-
const
|
|
224
|
+
const tokenString = await this.refreshTokenInternal();
|
|
231
225
|
const accessToken = `Bearer ${tokenString}`;
|
|
232
|
-
this.permissions = permissions;
|
|
233
226
|
|
|
234
227
|
originalConfig.headers['Authorization'] = `Bearer ${accessToken}`
|
|
235
228
|
|
|
@@ -253,9 +246,8 @@ export class BaseAPI {
|
|
|
253
246
|
){
|
|
254
247
|
_retry_count++;
|
|
255
248
|
try {
|
|
256
|
-
const
|
|
249
|
+
const tokenString = await this.refreshTokenInternal();
|
|
257
250
|
const accessToken = `Bearer ${tokenString}`;
|
|
258
|
-
this.permissions = permissions;
|
|
259
251
|
|
|
260
252
|
_retry = true;
|
|
261
253
|
originalConfig.headers['Authorization'] = accessToken;
|
|
@@ -63,7 +63,7 @@ export declare const ProductDocumentsApiAxiosParamCreator: (configuration?: Conf
|
|
|
63
63
|
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: code, productSlug, productCode, type, createdAt, slug</i>
|
|
64
64
|
* @param {string} [search] Search query
|
|
65
65
|
* @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.<br/> <br/> <i>Allowed values: id, createdAt, filename</i>
|
|
66
|
-
* @param {string} [expand]
|
|
66
|
+
* @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/>
|
|
67
67
|
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: code, productSlug, productCode, type, createdAt, slug</i>
|
|
68
68
|
* @param {*} [options] Override http request option.
|
|
69
69
|
* @throws {RequiredError}
|
|
@@ -126,7 +126,7 @@ export declare const ProductDocumentsApiFp: (configuration?: Configuration) => {
|
|
|
126
126
|
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: code, productSlug, productCode, type, createdAt, slug</i>
|
|
127
127
|
* @param {string} [search] Search query
|
|
128
128
|
* @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.<br/> <br/> <i>Allowed values: id, createdAt, filename</i>
|
|
129
|
-
* @param {string} [expand]
|
|
129
|
+
* @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/>
|
|
130
130
|
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: code, productSlug, productCode, type, createdAt, slug</i>
|
|
131
131
|
* @param {*} [options] Override http request option.
|
|
132
132
|
* @throws {RequiredError}
|
|
@@ -189,7 +189,7 @@ export declare const ProductDocumentsApiFactory: (configuration?: Configuration,
|
|
|
189
189
|
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: code, productSlug, productCode, type, createdAt, slug</i>
|
|
190
190
|
* @param {string} [search] Search query
|
|
191
191
|
* @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.<br/> <br/> <i>Allowed values: id, createdAt, filename</i>
|
|
192
|
-
* @param {string} [expand]
|
|
192
|
+
* @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/>
|
|
193
193
|
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: code, productSlug, productCode, type, createdAt, slug</i>
|
|
194
194
|
* @param {*} [options] Override http request option.
|
|
195
195
|
* @throws {RequiredError}
|
|
@@ -336,7 +336,7 @@ export interface ProductDocumentsApiListProductDocumentsRequest {
|
|
|
336
336
|
*/
|
|
337
337
|
readonly order?: string;
|
|
338
338
|
/**
|
|
339
|
-
*
|
|
339
|
+
* Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/>
|
|
340
340
|
* @type {string}
|
|
341
341
|
* @memberof ProductDocumentsApiListProductDocuments
|
|
342
342
|
*/
|
|
@@ -266,7 +266,7 @@ var ProductDocumentsApiAxiosParamCreator = function (configuration) {
|
|
|
266
266
|
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: code, productSlug, productCode, type, createdAt, slug</i>
|
|
267
267
|
* @param {string} [search] Search query
|
|
268
268
|
* @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.<br/> <br/> <i>Allowed values: id, createdAt, filename</i>
|
|
269
|
-
* @param {string} [expand]
|
|
269
|
+
* @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/>
|
|
270
270
|
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: code, productSlug, productCode, type, createdAt, slug</i>
|
|
271
271
|
* @param {*} [options] Override http request option.
|
|
272
272
|
* @throws {RequiredError}
|
|
@@ -472,7 +472,7 @@ var ProductDocumentsApiFp = function (configuration) {
|
|
|
472
472
|
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: code, productSlug, productCode, type, createdAt, slug</i>
|
|
473
473
|
* @param {string} [search] Search query
|
|
474
474
|
* @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.<br/> <br/> <i>Allowed values: id, createdAt, filename</i>
|
|
475
|
-
* @param {string} [expand]
|
|
475
|
+
* @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/>
|
|
476
476
|
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: code, productSlug, productCode, type, createdAt, slug</i>
|
|
477
477
|
* @param {*} [options] Override http request option.
|
|
478
478
|
* @throws {RequiredError}
|
|
@@ -569,7 +569,7 @@ var ProductDocumentsApiFactory = function (configuration, basePath, axios) {
|
|
|
569
569
|
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.<br/> <br/> <i>Allowed values: code, productSlug, productCode, type, createdAt, slug</i>
|
|
570
570
|
* @param {string} [search] Search query
|
|
571
571
|
* @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.<br/> <br/> <i>Allowed values: id, createdAt, filename</i>
|
|
572
|
-
* @param {string} [expand]
|
|
572
|
+
* @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.<br/> <br/>
|
|
573
573
|
* @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.<br/> <br/> <i>Allowed values: code, productSlug, productCode, type, createdAt, slug</i>
|
|
574
574
|
* @param {*} [options] Override http request option.
|
|
575
575
|
* @throws {RequiredError}
|
package/dist/base.d.ts
CHANGED
|
@@ -53,16 +53,14 @@ export declare class BaseAPI {
|
|
|
53
53
|
protected configuration: Configuration;
|
|
54
54
|
private username?;
|
|
55
55
|
private password?;
|
|
56
|
-
private permissions?;
|
|
57
56
|
constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
|
|
58
57
|
initialize(env?: Environment): Promise<void>;
|
|
59
58
|
private loadCredentials;
|
|
60
59
|
private readConfigFile;
|
|
61
60
|
private readEnvVariables;
|
|
62
61
|
selectEnvironment(env: Environment): void;
|
|
63
|
-
getPermissions(): Array<string>;
|
|
64
62
|
authorize(username: string, password: string): Promise<void>;
|
|
65
|
-
refreshTokenInternal(): Promise<
|
|
63
|
+
refreshTokenInternal(): Promise<string>;
|
|
66
64
|
private extractRefreshToken;
|
|
67
65
|
getConfiguration(): Configuration;
|
|
68
66
|
private attachInterceptor;
|
package/dist/base.js
CHANGED
|
@@ -242,14 +242,11 @@ var BaseAPI = /** @class */ (function () {
|
|
|
242
242
|
BaseAPI.prototype.selectEnvironment = function (env) {
|
|
243
243
|
this.configuration.basePath = env;
|
|
244
244
|
};
|
|
245
|
-
BaseAPI.prototype.getPermissions = function () {
|
|
246
|
-
return this.permissions.split(',');
|
|
247
|
-
};
|
|
248
245
|
BaseAPI.prototype.authorize = function (username, password) {
|
|
249
246
|
return __awaiter(this, void 0, void 0, function () {
|
|
250
|
-
var options, response,
|
|
251
|
-
return __generator(this, function (
|
|
252
|
-
switch (
|
|
247
|
+
var options, response, accessToken, refreshToken;
|
|
248
|
+
return __generator(this, function (_a) {
|
|
249
|
+
switch (_a.label) {
|
|
253
250
|
case 0:
|
|
254
251
|
options = {
|
|
255
252
|
method: 'POST',
|
|
@@ -263,11 +260,10 @@ var BaseAPI = /** @class */ (function () {
|
|
|
263
260
|
};
|
|
264
261
|
return [4 /*yield*/, axios_1.default.request(options)];
|
|
265
262
|
case 1:
|
|
266
|
-
response =
|
|
267
|
-
|
|
263
|
+
response = _a.sent();
|
|
264
|
+
accessToken = response.data.accessToken;
|
|
268
265
|
this.configuration.username = username;
|
|
269
266
|
this.configuration.accessToken = "Bearer ".concat(accessToken);
|
|
270
|
-
this.permissions = permissions;
|
|
271
267
|
refreshToken = this.extractRefreshToken(response);
|
|
272
268
|
this.configuration.refreshToken = refreshToken;
|
|
273
269
|
return [2 /*return*/];
|
|
@@ -277,13 +273,13 @@ var BaseAPI = /** @class */ (function () {
|
|
|
277
273
|
};
|
|
278
274
|
BaseAPI.prototype.refreshTokenInternal = function () {
|
|
279
275
|
return __awaiter(this, void 0, void 0, function () {
|
|
280
|
-
var _a, username, refreshToken, options,
|
|
276
|
+
var _a, username, refreshToken, options, accessToken;
|
|
281
277
|
return __generator(this, function (_b) {
|
|
282
278
|
switch (_b.label) {
|
|
283
279
|
case 0:
|
|
284
280
|
_a = this.configuration, username = _a.username, refreshToken = _a.refreshToken;
|
|
285
281
|
if (!username || !refreshToken) {
|
|
286
|
-
|
|
282
|
+
return [2 /*return*/, ''];
|
|
287
283
|
}
|
|
288
284
|
options = {
|
|
289
285
|
method: 'POST',
|
|
@@ -297,8 +293,8 @@ var BaseAPI = /** @class */ (function () {
|
|
|
297
293
|
};
|
|
298
294
|
return [4 /*yield*/, axios_1.default.request(options)];
|
|
299
295
|
case 1:
|
|
300
|
-
|
|
301
|
-
return [2 /*return*/,
|
|
296
|
+
accessToken = (_b.sent()).data.accessToken;
|
|
297
|
+
return [2 /*return*/, accessToken];
|
|
302
298
|
}
|
|
303
299
|
});
|
|
304
300
|
});
|
|
@@ -318,27 +314,26 @@ var BaseAPI = /** @class */ (function () {
|
|
|
318
314
|
axios.interceptors.response.use(function (res) {
|
|
319
315
|
return res;
|
|
320
316
|
}, function (err) { return __awaiter(_this, void 0, void 0, function () {
|
|
321
|
-
var originalConfig,
|
|
322
|
-
return __generator(this, function (
|
|
323
|
-
switch (
|
|
317
|
+
var originalConfig, tokenString, accessToken, _error_1, tokenString, accessToken, _error_2;
|
|
318
|
+
return __generator(this, function (_a) {
|
|
319
|
+
switch (_a.label) {
|
|
324
320
|
case 0:
|
|
325
321
|
originalConfig = err.config;
|
|
326
322
|
if (!err.response) return [3 /*break*/, 5];
|
|
327
323
|
if (!(err.response.status === 401 && !originalConfig._retry)) return [3 /*break*/, 4];
|
|
328
324
|
originalConfig._retry = true;
|
|
329
|
-
|
|
325
|
+
_a.label = 1;
|
|
330
326
|
case 1:
|
|
331
|
-
|
|
327
|
+
_a.trys.push([1, 3, , 4]);
|
|
332
328
|
return [4 /*yield*/, this.refreshTokenInternal()];
|
|
333
329
|
case 2:
|
|
334
|
-
|
|
330
|
+
tokenString = _a.sent();
|
|
335
331
|
accessToken = "Bearer ".concat(tokenString);
|
|
336
|
-
this.permissions = permissions;
|
|
337
332
|
originalConfig.headers['Authorization'] = "Bearer ".concat(accessToken);
|
|
338
333
|
this.configuration.accessToken = accessToken;
|
|
339
334
|
return [2 /*return*/, axios.request(originalConfig)];
|
|
340
335
|
case 3:
|
|
341
|
-
_error_1 =
|
|
336
|
+
_error_1 = _a.sent();
|
|
342
337
|
if (_error_1.response && _error_1.response.data) {
|
|
343
338
|
return [2 /*return*/, Promise.reject(_error_1.response.data)];
|
|
344
339
|
}
|
|
@@ -354,20 +349,19 @@ var BaseAPI = /** @class */ (function () {
|
|
|
354
349
|
&& originalConfig.headers.hasOwnProperty('Authorization')
|
|
355
350
|
&& _retry_count < 4)) return [3 /*break*/, 9];
|
|
356
351
|
_retry_count++;
|
|
357
|
-
|
|
352
|
+
_a.label = 6;
|
|
358
353
|
case 6:
|
|
359
|
-
|
|
354
|
+
_a.trys.push([6, 8, , 9]);
|
|
360
355
|
return [4 /*yield*/, this.refreshTokenInternal()];
|
|
361
356
|
case 7:
|
|
362
|
-
|
|
357
|
+
tokenString = _a.sent();
|
|
363
358
|
accessToken = "Bearer ".concat(tokenString);
|
|
364
|
-
this.permissions = permissions;
|
|
365
359
|
_retry = true;
|
|
366
360
|
originalConfig.headers['Authorization'] = accessToken;
|
|
367
361
|
this.configuration.accessToken = accessToken;
|
|
368
362
|
return [2 /*return*/, axios.request(__assign({}, originalConfig))];
|
|
369
363
|
case 8:
|
|
370
|
-
_error_2 =
|
|
364
|
+
_error_2 = _a.sent();
|
|
371
365
|
if (_error_2.response && _error_2.response.data) {
|
|
372
366
|
return [2 /*return*/, Promise.reject(_error_2.response.data)];
|
|
373
367
|
}
|