@emilgroup/auth-sdk 1.14.0 → 1.14.1-beta.1
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/authservice-api.ts +58 -0
- package/base.ts +20 -7
- package/dist/api/authservice-api.d.ts +25 -0
- package/dist/api/authservice-api.js +65 -0
- package/dist/base.d.ts +0 -1
- package/dist/base.js +18 -6
- 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/auth-sdk@1.14.
|
|
20
|
+
npm install @emilgroup/auth-sdk@1.14.1-beta.1 --save
|
|
21
21
|
```
|
|
22
22
|
or
|
|
23
23
|
```
|
|
24
|
-
yarn add @emilgroup/auth-sdk@1.14.
|
|
24
|
+
yarn add @emilgroup/auth-sdk@1.14.1-beta.1
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
And then you can import ``.
|
package/api/authservice-api.ts
CHANGED
|
@@ -164,6 +164,37 @@ export const AuthserviceApiAxiosParamCreator = function (configuration?: Configu
|
|
|
164
164
|
options: localVarRequestOptions,
|
|
165
165
|
};
|
|
166
166
|
},
|
|
167
|
+
/**
|
|
168
|
+
*
|
|
169
|
+
* @param {*} [options] Override http request option.
|
|
170
|
+
* @throws {RequiredError}
|
|
171
|
+
*/
|
|
172
|
+
generateReadmeToken: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
173
|
+
const localVarPath = `/authservice/v1/readme-token`;
|
|
174
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
175
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
176
|
+
let baseOptions;
|
|
177
|
+
let baseAccessToken;
|
|
178
|
+
if (configuration) {
|
|
179
|
+
baseOptions = configuration.baseOptions;
|
|
180
|
+
baseAccessToken = configuration.accessToken;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
|
184
|
+
const localVarHeaderParameter = {} as any;
|
|
185
|
+
const localVarQueryParameter = {} as any;
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
190
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
191
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
192
|
+
|
|
193
|
+
return {
|
|
194
|
+
url: toPathString(localVarUrlObj),
|
|
195
|
+
options: localVarRequestOptions,
|
|
196
|
+
};
|
|
197
|
+
},
|
|
167
198
|
/**
|
|
168
199
|
* Get SAML login link configured for the tenant in cognito as well as tenant settings
|
|
169
200
|
* @summary Get SAML login link for tenant
|
|
@@ -558,6 +589,15 @@ export const AuthserviceApiFp = function(configuration?: Configuration) {
|
|
|
558
589
|
const localVarAxiosArgs = await localVarAxiosParamCreator.forgotPassword(forgotPasswordRequestDto, options);
|
|
559
590
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
560
591
|
},
|
|
592
|
+
/**
|
|
593
|
+
*
|
|
594
|
+
* @param {*} [options] Override http request option.
|
|
595
|
+
* @throws {RequiredError}
|
|
596
|
+
*/
|
|
597
|
+
async generateReadmeToken(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
|
598
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.generateReadmeToken(options);
|
|
599
|
+
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
600
|
+
},
|
|
561
601
|
/**
|
|
562
602
|
* Get SAML login link configured for the tenant in cognito as well as tenant settings
|
|
563
603
|
* @summary Get SAML login link for tenant
|
|
@@ -698,6 +738,14 @@ export const AuthserviceApiFactory = function (configuration?: Configuration, ba
|
|
|
698
738
|
forgotPassword(forgotPasswordRequestDto: ForgotPasswordRequestDto, options?: any): AxiosPromise<void> {
|
|
699
739
|
return localVarFp.forgotPassword(forgotPasswordRequestDto, options).then((request) => request(axios, basePath));
|
|
700
740
|
},
|
|
741
|
+
/**
|
|
742
|
+
*
|
|
743
|
+
* @param {*} [options] Override http request option.
|
|
744
|
+
* @throws {RequiredError}
|
|
745
|
+
*/
|
|
746
|
+
generateReadmeToken(options?: any): AxiosPromise<void> {
|
|
747
|
+
return localVarFp.generateReadmeToken(options).then((request) => request(axios, basePath));
|
|
748
|
+
},
|
|
701
749
|
/**
|
|
702
750
|
* Get SAML login link configured for the tenant in cognito as well as tenant settings
|
|
703
751
|
* @summary Get SAML login link for tenant
|
|
@@ -1010,6 +1058,16 @@ export class AuthserviceApi extends BaseAPI {
|
|
|
1010
1058
|
return AuthserviceApiFp(this.configuration).forgotPassword(requestParameters.forgotPasswordRequestDto, options).then((request) => request(this.axios, this.basePath));
|
|
1011
1059
|
}
|
|
1012
1060
|
|
|
1061
|
+
/**
|
|
1062
|
+
*
|
|
1063
|
+
* @param {*} [options] Override http request option.
|
|
1064
|
+
* @throws {RequiredError}
|
|
1065
|
+
* @memberof AuthserviceApi
|
|
1066
|
+
*/
|
|
1067
|
+
public generateReadmeToken(options?: AxiosRequestConfig) {
|
|
1068
|
+
return AuthserviceApiFp(this.configuration).generateReadmeToken(options).then((request) => request(this.axios, this.basePath));
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1013
1071
|
/**
|
|
1014
1072
|
* Get SAML login link configured for the tenant in cognito as well as tenant settings
|
|
1015
1073
|
* @summary Get SAML login link for tenant
|
package/base.ts
CHANGED
|
@@ -64,6 +64,7 @@ export interface RequestArgs {
|
|
|
64
64
|
interface TokenData {
|
|
65
65
|
accessToken?: string;
|
|
66
66
|
username?: string;
|
|
67
|
+
permissions?: string;
|
|
67
68
|
}
|
|
68
69
|
|
|
69
70
|
const NETWORK_ERROR_MESSAGE = "Network Error";
|
|
@@ -77,7 +78,6 @@ const TOKEN_DATA = 'APP_TOKEN';
|
|
|
77
78
|
export class BaseAPI {
|
|
78
79
|
protected configuration: Configuration | undefined;
|
|
79
80
|
private tokenData?: TokenData;
|
|
80
|
-
private permissions?: string;
|
|
81
81
|
|
|
82
82
|
constructor(configuration?: Configuration,
|
|
83
83
|
protected basePath: string = BASE_PATH,
|
|
@@ -111,7 +111,11 @@ export class BaseAPI {
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
getPermissions(): Array<string> {
|
|
114
|
-
|
|
114
|
+
if (!this.tokenData?.permissions) {
|
|
115
|
+
return [];
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return this.tokenData.permissions.split(',');
|
|
115
119
|
}
|
|
116
120
|
|
|
117
121
|
async authorize(username: string, password: string): Promise<void> {
|
|
@@ -134,7 +138,7 @@ export class BaseAPI {
|
|
|
134
138
|
this.configuration.accessToken = `Bearer ${accessToken}`;
|
|
135
139
|
this.tokenData.username = username;
|
|
136
140
|
this.tokenData.accessToken = accessToken;
|
|
137
|
-
this.permissions = permissions;
|
|
141
|
+
this.tokenData.permissions = permissions;
|
|
138
142
|
|
|
139
143
|
this.storeTokenData({
|
|
140
144
|
...this.tokenData
|
|
@@ -148,6 +152,16 @@ export class BaseAPI {
|
|
|
148
152
|
throw new Error('Failed to refresh token.');
|
|
149
153
|
}
|
|
150
154
|
|
|
155
|
+
const refreshTokenAxios = globalAxios.create()
|
|
156
|
+
refreshTokenAxios.interceptors.response.use(response => {
|
|
157
|
+
const { permissions } = response.data;
|
|
158
|
+
|
|
159
|
+
this.tokenData.permissions = permissions;
|
|
160
|
+
this.storeTokenData(this.tokenData);
|
|
161
|
+
|
|
162
|
+
return response;
|
|
163
|
+
})
|
|
164
|
+
|
|
151
165
|
const options: AxiosRequestConfig = {
|
|
152
166
|
method: 'POST',
|
|
153
167
|
url: `${this.configuration.basePath}/authservice/v1/refresh-token`,
|
|
@@ -158,8 +172,7 @@ export class BaseAPI {
|
|
|
158
172
|
withCredentials: true,
|
|
159
173
|
};
|
|
160
174
|
|
|
161
|
-
const response = await
|
|
162
|
-
|
|
175
|
+
const response = await refreshTokenAxios.request<LoginClass>(options);
|
|
163
176
|
return response.data;
|
|
164
177
|
}
|
|
165
178
|
|
|
@@ -196,7 +209,7 @@ export class BaseAPI {
|
|
|
196
209
|
try {
|
|
197
210
|
const { accessToken: tokenString, permissions } = await this.refreshTokenInternal();
|
|
198
211
|
const accessToken = `Bearer ${tokenString}`;
|
|
199
|
-
this.permissions = permissions;
|
|
212
|
+
this.tokenData.permissions = permissions;
|
|
200
213
|
|
|
201
214
|
delete originalConfig.headers['Authorization']
|
|
202
215
|
|
|
@@ -223,7 +236,7 @@ export class BaseAPI {
|
|
|
223
236
|
try {
|
|
224
237
|
const { accessToken: tokenString, permissions } = await this.refreshTokenInternal();
|
|
225
238
|
const accessToken = `Bearer ${tokenString}`;
|
|
226
|
-
this.permissions = permissions;
|
|
239
|
+
this.tokenData.permissions = permissions;
|
|
227
240
|
|
|
228
241
|
_retry = true;
|
|
229
242
|
originalConfig.headers['Authorization'] = accessToken;
|
|
@@ -53,6 +53,12 @@ export declare const AuthserviceApiAxiosParamCreator: (configuration?: Configura
|
|
|
53
53
|
* @throws {RequiredError}
|
|
54
54
|
*/
|
|
55
55
|
forgotPassword: (forgotPasswordRequestDto: ForgotPasswordRequestDto, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
56
|
+
/**
|
|
57
|
+
*
|
|
58
|
+
* @param {*} [options] Override http request option.
|
|
59
|
+
* @throws {RequiredError}
|
|
60
|
+
*/
|
|
61
|
+
generateReadmeToken: (options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
56
62
|
/**
|
|
57
63
|
* Get SAML login link configured for the tenant in cognito as well as tenant settings
|
|
58
64
|
* @summary Get SAML login link for tenant
|
|
@@ -156,6 +162,12 @@ export declare const AuthserviceApiFp: (configuration?: Configuration) => {
|
|
|
156
162
|
* @throws {RequiredError}
|
|
157
163
|
*/
|
|
158
164
|
forgotPassword(forgotPasswordRequestDto: ForgotPasswordRequestDto, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>>;
|
|
165
|
+
/**
|
|
166
|
+
*
|
|
167
|
+
* @param {*} [options] Override http request option.
|
|
168
|
+
* @throws {RequiredError}
|
|
169
|
+
*/
|
|
170
|
+
generateReadmeToken(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>>;
|
|
159
171
|
/**
|
|
160
172
|
* Get SAML login link configured for the tenant in cognito as well as tenant settings
|
|
161
173
|
* @summary Get SAML login link for tenant
|
|
@@ -259,6 +271,12 @@ export declare const AuthserviceApiFactory: (configuration?: Configuration, base
|
|
|
259
271
|
* @throws {RequiredError}
|
|
260
272
|
*/
|
|
261
273
|
forgotPassword(forgotPasswordRequestDto: ForgotPasswordRequestDto, options?: any): AxiosPromise<void>;
|
|
274
|
+
/**
|
|
275
|
+
*
|
|
276
|
+
* @param {*} [options] Override http request option.
|
|
277
|
+
* @throws {RequiredError}
|
|
278
|
+
*/
|
|
279
|
+
generateReadmeToken(options?: any): AxiosPromise<void>;
|
|
262
280
|
/**
|
|
263
281
|
* Get SAML login link configured for the tenant in cognito as well as tenant settings
|
|
264
282
|
* @summary Get SAML login link for tenant
|
|
@@ -529,6 +547,13 @@ export declare class AuthserviceApi extends BaseAPI {
|
|
|
529
547
|
* @memberof AuthserviceApi
|
|
530
548
|
*/
|
|
531
549
|
forgotPassword(requestParameters: AuthserviceApiForgotPasswordRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any>>;
|
|
550
|
+
/**
|
|
551
|
+
*
|
|
552
|
+
* @param {*} [options] Override http request option.
|
|
553
|
+
* @throws {RequiredError}
|
|
554
|
+
* @memberof AuthserviceApi
|
|
555
|
+
*/
|
|
556
|
+
generateReadmeToken(options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<void, any>>;
|
|
532
557
|
/**
|
|
533
558
|
* Get SAML login link configured for the tenant in cognito as well as tenant settings
|
|
534
559
|
* @summary Get SAML login link for tenant
|
|
@@ -197,6 +197,35 @@ var AuthserviceApiAxiosParamCreator = function (configuration) {
|
|
|
197
197
|
});
|
|
198
198
|
});
|
|
199
199
|
},
|
|
200
|
+
/**
|
|
201
|
+
*
|
|
202
|
+
* @param {*} [options] Override http request option.
|
|
203
|
+
* @throws {RequiredError}
|
|
204
|
+
*/
|
|
205
|
+
generateReadmeToken: function (options) {
|
|
206
|
+
if (options === void 0) { options = {}; }
|
|
207
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
208
|
+
var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
|
|
209
|
+
return __generator(this, function (_a) {
|
|
210
|
+
localVarPath = "/authservice/v1/readme-token";
|
|
211
|
+
localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
212
|
+
if (configuration) {
|
|
213
|
+
baseOptions = configuration.baseOptions;
|
|
214
|
+
baseAccessToken = configuration.accessToken;
|
|
215
|
+
}
|
|
216
|
+
localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
|
|
217
|
+
localVarHeaderParameter = {};
|
|
218
|
+
localVarQueryParameter = {};
|
|
219
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
220
|
+
headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
221
|
+
localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
222
|
+
return [2 /*return*/, {
|
|
223
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
224
|
+
options: localVarRequestOptions,
|
|
225
|
+
}];
|
|
226
|
+
});
|
|
227
|
+
});
|
|
228
|
+
},
|
|
200
229
|
/**
|
|
201
230
|
* Get SAML login link configured for the tenant in cognito as well as tenant settings
|
|
202
231
|
* @summary Get SAML login link for tenant
|
|
@@ -590,6 +619,24 @@ var AuthserviceApiFp = function (configuration) {
|
|
|
590
619
|
});
|
|
591
620
|
});
|
|
592
621
|
},
|
|
622
|
+
/**
|
|
623
|
+
*
|
|
624
|
+
* @param {*} [options] Override http request option.
|
|
625
|
+
* @throws {RequiredError}
|
|
626
|
+
*/
|
|
627
|
+
generateReadmeToken: function (options) {
|
|
628
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
629
|
+
var localVarAxiosArgs;
|
|
630
|
+
return __generator(this, function (_a) {
|
|
631
|
+
switch (_a.label) {
|
|
632
|
+
case 0: return [4 /*yield*/, localVarAxiosParamCreator.generateReadmeToken(options)];
|
|
633
|
+
case 1:
|
|
634
|
+
localVarAxiosArgs = _a.sent();
|
|
635
|
+
return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
|
|
636
|
+
}
|
|
637
|
+
});
|
|
638
|
+
});
|
|
639
|
+
},
|
|
593
640
|
/**
|
|
594
641
|
* Get SAML login link configured for the tenant in cognito as well as tenant settings
|
|
595
642
|
* @summary Get SAML login link for tenant
|
|
@@ -811,6 +858,14 @@ var AuthserviceApiFactory = function (configuration, basePath, axios) {
|
|
|
811
858
|
forgotPassword: function (forgotPasswordRequestDto, options) {
|
|
812
859
|
return localVarFp.forgotPassword(forgotPasswordRequestDto, options).then(function (request) { return request(axios, basePath); });
|
|
813
860
|
},
|
|
861
|
+
/**
|
|
862
|
+
*
|
|
863
|
+
* @param {*} [options] Override http request option.
|
|
864
|
+
* @throws {RequiredError}
|
|
865
|
+
*/
|
|
866
|
+
generateReadmeToken: function (options) {
|
|
867
|
+
return localVarFp.generateReadmeToken(options).then(function (request) { return request(axios, basePath); });
|
|
868
|
+
},
|
|
814
869
|
/**
|
|
815
870
|
* Get SAML login link configured for the tenant in cognito as well as tenant settings
|
|
816
871
|
* @summary Get SAML login link for tenant
|
|
@@ -952,6 +1007,16 @@ var AuthserviceApi = /** @class */ (function (_super) {
|
|
|
952
1007
|
var _this = this;
|
|
953
1008
|
return (0, exports.AuthserviceApiFp)(this.configuration).forgotPassword(requestParameters.forgotPasswordRequestDto, options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
954
1009
|
};
|
|
1010
|
+
/**
|
|
1011
|
+
*
|
|
1012
|
+
* @param {*} [options] Override http request option.
|
|
1013
|
+
* @throws {RequiredError}
|
|
1014
|
+
* @memberof AuthserviceApi
|
|
1015
|
+
*/
|
|
1016
|
+
AuthserviceApi.prototype.generateReadmeToken = function (options) {
|
|
1017
|
+
var _this = this;
|
|
1018
|
+
return (0, exports.AuthserviceApiFp)(this.configuration).generateReadmeToken(options).then(function (request) { return request(_this.axios, _this.basePath); });
|
|
1019
|
+
};
|
|
955
1020
|
/**
|
|
956
1021
|
* Get SAML login link configured for the tenant in cognito as well as tenant settings
|
|
957
1022
|
* @summary Get SAML login link for tenant
|
package/dist/base.d.ts
CHANGED
|
@@ -52,7 +52,6 @@ export declare class BaseAPI {
|
|
|
52
52
|
protected axios: AxiosInstance;
|
|
53
53
|
protected configuration: Configuration | undefined;
|
|
54
54
|
private tokenData?;
|
|
55
|
-
private permissions?;
|
|
56
55
|
constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
|
|
57
56
|
selectEnvironment(env: Environment): void;
|
|
58
57
|
selectBasePath(path: string): void;
|
package/dist/base.js
CHANGED
|
@@ -144,7 +144,11 @@ var BaseAPI = /** @class */ (function () {
|
|
|
144
144
|
this.configuration.basePath = path;
|
|
145
145
|
};
|
|
146
146
|
BaseAPI.prototype.getPermissions = function () {
|
|
147
|
-
|
|
147
|
+
var _a;
|
|
148
|
+
if (!((_a = this.tokenData) === null || _a === void 0 ? void 0 : _a.permissions)) {
|
|
149
|
+
return [];
|
|
150
|
+
}
|
|
151
|
+
return this.tokenData.permissions.split(',');
|
|
148
152
|
};
|
|
149
153
|
BaseAPI.prototype.authorize = function (username, password) {
|
|
150
154
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -170,7 +174,7 @@ var BaseAPI = /** @class */ (function () {
|
|
|
170
174
|
this.configuration.accessToken = "Bearer ".concat(accessToken);
|
|
171
175
|
this.tokenData.username = username;
|
|
172
176
|
this.tokenData.accessToken = accessToken;
|
|
173
|
-
this.permissions = permissions;
|
|
177
|
+
this.tokenData.permissions = permissions;
|
|
174
178
|
this.storeTokenData(__assign({}, this.tokenData));
|
|
175
179
|
return [2 /*return*/];
|
|
176
180
|
}
|
|
@@ -179,7 +183,8 @@ var BaseAPI = /** @class */ (function () {
|
|
|
179
183
|
};
|
|
180
184
|
BaseAPI.prototype.refreshTokenInternal = function () {
|
|
181
185
|
return __awaiter(this, void 0, void 0, function () {
|
|
182
|
-
var username, options, response;
|
|
186
|
+
var username, refreshTokenAxios, options, response;
|
|
187
|
+
var _this = this;
|
|
183
188
|
return __generator(this, function (_a) {
|
|
184
189
|
switch (_a.label) {
|
|
185
190
|
case 0:
|
|
@@ -187,6 +192,13 @@ var BaseAPI = /** @class */ (function () {
|
|
|
187
192
|
if (!username) {
|
|
188
193
|
throw new Error('Failed to refresh token.');
|
|
189
194
|
}
|
|
195
|
+
refreshTokenAxios = axios_1.default.create();
|
|
196
|
+
refreshTokenAxios.interceptors.response.use(function (response) {
|
|
197
|
+
var permissions = response.data.permissions;
|
|
198
|
+
_this.tokenData.permissions = permissions;
|
|
199
|
+
_this.storeTokenData(_this.tokenData);
|
|
200
|
+
return response;
|
|
201
|
+
});
|
|
190
202
|
options = {
|
|
191
203
|
method: 'POST',
|
|
192
204
|
url: "".concat(this.configuration.basePath, "/authservice/v1/refresh-token"),
|
|
@@ -196,7 +208,7 @@ var BaseAPI = /** @class */ (function () {
|
|
|
196
208
|
data: { username: username },
|
|
197
209
|
withCredentials: true,
|
|
198
210
|
};
|
|
199
|
-
return [4 /*yield*/,
|
|
211
|
+
return [4 /*yield*/, refreshTokenAxios.request(options)];
|
|
200
212
|
case 1:
|
|
201
213
|
response = _a.sent();
|
|
202
214
|
return [2 /*return*/, response.data];
|
|
@@ -241,7 +253,7 @@ var BaseAPI = /** @class */ (function () {
|
|
|
241
253
|
case 2:
|
|
242
254
|
_a = _c.sent(), tokenString = _a.accessToken, permissions = _a.permissions;
|
|
243
255
|
accessToken = "Bearer ".concat(tokenString);
|
|
244
|
-
this.permissions = permissions;
|
|
256
|
+
this.tokenData.permissions = permissions;
|
|
245
257
|
delete originalConfig.headers['Authorization'];
|
|
246
258
|
originalConfig.headers['Authorization'] = accessToken;
|
|
247
259
|
this.configuration.accessToken = accessToken;
|
|
@@ -267,7 +279,7 @@ var BaseAPI = /** @class */ (function () {
|
|
|
267
279
|
case 7:
|
|
268
280
|
_b = _c.sent(), tokenString = _b.accessToken, permissions = _b.permissions;
|
|
269
281
|
accessToken = "Bearer ".concat(tokenString);
|
|
270
|
-
this.permissions = permissions;
|
|
282
|
+
this.tokenData.permissions = permissions;
|
|
271
283
|
_retry = true;
|
|
272
284
|
originalConfig.headers['Authorization'] = accessToken;
|
|
273
285
|
this.configuration.accessToken = accessToken;
|