@qelos/sdk 3.7.4 → 3.7.7
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/dist/administrator/index.d.ts +2 -0
- package/dist/administrator/index.js +5 -2
- package/dist/administrator/index.js.map +1 -1
- package/dist/administrator/integration-sources.d.ts +15 -0
- package/dist/administrator/integration-sources.js +33 -0
- package/dist/administrator/integration-sources.js.map +1 -0
- package/dist/base-sdk.js +1 -1
- package/dist/base-sdk.js.map +1 -1
- package/dist/workspaces.d.ts +1 -0
- package/dist/workspaces.js.map +1 -1
- package/package.json +3 -3
- package/src/administrator/index.ts +5 -2
- package/src/administrator/integration-sources.ts +43 -0
- package/src/base-sdk.ts +1 -1
- package/src/workspaces.ts +1 -0
|
@@ -8,6 +8,7 @@ import QlManageConfigurations from './manage-configurations';
|
|
|
8
8
|
import QlAdminWorkspaces from './workspaces';
|
|
9
9
|
import QlManageBlueprints from './manage-blueprints';
|
|
10
10
|
import { QlRoles } from './roles';
|
|
11
|
+
import QlIntegrationSources from './integration-sources';
|
|
11
12
|
export default class QelosAdministratorSDK<T = any> extends QelosSDK {
|
|
12
13
|
users: QlUsers<T>;
|
|
13
14
|
manageLayouts: QlManageLayouts;
|
|
@@ -17,6 +18,7 @@ export default class QelosAdministratorSDK<T = any> extends QelosSDK {
|
|
|
17
18
|
events: QlEvents;
|
|
18
19
|
adminWorkspaces: QlAdminWorkspaces;
|
|
19
20
|
roles: QlRoles;
|
|
21
|
+
integrationSources: QlIntegrationSources;
|
|
20
22
|
constructor(options: QelosSDKOptions);
|
|
21
23
|
impersonateUser(userId: string, workspaceId?: string): void;
|
|
22
24
|
clearImpersonation(): void;
|
|
@@ -7,6 +7,7 @@ import QlManageConfigurations from './manage-configurations';
|
|
|
7
7
|
import QlAdminWorkspaces from './workspaces';
|
|
8
8
|
import QlManageBlueprints from './manage-blueprints';
|
|
9
9
|
import { QlRoles } from './roles';
|
|
10
|
+
import QlIntegrationSources from './integration-sources';
|
|
10
11
|
export default class QelosAdministratorSDK extends QelosSDK {
|
|
11
12
|
users;
|
|
12
13
|
manageLayouts;
|
|
@@ -15,7 +16,8 @@ export default class QelosAdministratorSDK extends QelosSDK {
|
|
|
15
16
|
drafts;
|
|
16
17
|
events;
|
|
17
18
|
adminWorkspaces;
|
|
18
|
-
roles;
|
|
19
|
+
roles;
|
|
20
|
+
integrationSources;
|
|
19
21
|
constructor(options) {
|
|
20
22
|
super(options);
|
|
21
23
|
this.users = new QlUsers(options);
|
|
@@ -25,7 +27,8 @@ export default class QelosAdministratorSDK extends QelosSDK {
|
|
|
25
27
|
this.drafts = new QlDrafts(options);
|
|
26
28
|
this.events = new QlEvents(options);
|
|
27
29
|
this.adminWorkspaces = new QlAdminWorkspaces(options);
|
|
28
|
-
this.roles = new QlRoles(options);
|
|
30
|
+
this.roles = new QlRoles(options);
|
|
31
|
+
this.integrationSources = new QlIntegrationSources(options);
|
|
29
32
|
if (!options.extraQueryParams) {
|
|
30
33
|
options.extraQueryParams = () => ({
|
|
31
34
|
bypassAdmin: 'true'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/administrator/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,eAAe,MAAM,kBAAkB,CAAC;AAC/C,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,sBAAsB,MAAM,yBAAyB,CAAC;AAC7D,OAAO,iBAAiB,MAAM,cAAc,CAAC;AAC7C,OAAO,kBAAkB,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/administrator/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU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G,IAAI,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAE5D,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE;YAC7B,OAAO,CAAC,gBAAgB,GAAG,GAAG,EAAE,CAAC,CAAC;gBAChC,WAAW,EAAE,MAAM;aACpB,CAAC,CAAA;SACH;IACH,CAAC;IAED,eAAe,CAAC,MAAc,EAAE,WAAoB;QAClD,IAAI,CAAC,eAAe,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC;QACnD,IAAI,WAAW,EAAE;YACf,IAAI,CAAC,eAAe,CAAC,yBAAyB,EAAE,WAAW,CAAC,CAAC;SAC9D;IACH,CAAC;IAED,kBAAkB;QAChB,IAAI,CAAC,kBAAkB,CAAC,oBAAoB,CAAC,CAAC;QAC9C,IAAI,CAAC,kBAAkB,CAAC,yBAAyB,CAAC,CAAC;IACrD,CAAC;CACF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { QelosSDKOptions, RequestExtra } from '../types';
|
|
2
|
+
import BaseSDK from '../base-sdk';
|
|
3
|
+
import { IIntegrationSource } from '@qelos/global-types';
|
|
4
|
+
export default class QlIntegrationSources extends BaseSDK {
|
|
5
|
+
private options;
|
|
6
|
+
private relativePath;
|
|
7
|
+
constructor(options: QelosSDKOptions);
|
|
8
|
+
getIntegrationSource(sourceId: string, extra?: RequestExtra): Promise<IIntegrationSource>;
|
|
9
|
+
getList(query?: {
|
|
10
|
+
kind?: string;
|
|
11
|
+
}, extra?: RequestExtra): Promise<IIntegrationSource[]>;
|
|
12
|
+
remove(sourceId: string): Promise<any>;
|
|
13
|
+
update(sourceId: string, changes: Partial<Pick<IIntegrationSource, 'name' | 'labels' | 'metadata' | 'authentication'>>): Promise<IIntegrationSource>;
|
|
14
|
+
create(source: Pick<IIntegrationSource, 'name' | 'labels' | 'metadata' | 'authentication'>): Promise<IIntegrationSource>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import BaseSDK from '../base-sdk';
|
|
2
|
+
export default class QlIntegrationSources extends BaseSDK {
|
|
3
|
+
options;
|
|
4
|
+
relativePath = '/api/integration-sources';
|
|
5
|
+
constructor(options) {
|
|
6
|
+
super(options);
|
|
7
|
+
this.options = options;
|
|
8
|
+
}
|
|
9
|
+
getIntegrationSource(sourceId, extra) {
|
|
10
|
+
return this.callJsonApi(`${this.relativePath}/${sourceId}`, extra);
|
|
11
|
+
}
|
|
12
|
+
getList(query, extra) {
|
|
13
|
+
return this.callJsonApi(this.relativePath + this.getQueryParams(query), extra);
|
|
14
|
+
}
|
|
15
|
+
remove(sourceId) {
|
|
16
|
+
return this.callApi(`${this.relativePath}/${sourceId}`, { method: 'delete' });
|
|
17
|
+
}
|
|
18
|
+
update(sourceId, changes) {
|
|
19
|
+
return this.callJsonApi(`${this.relativePath}/${sourceId}`, {
|
|
20
|
+
method: 'put',
|
|
21
|
+
headers: { 'content-type': 'application/json' },
|
|
22
|
+
body: JSON.stringify(changes)
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
create(source) {
|
|
26
|
+
return this.callJsonApi(this.relativePath, {
|
|
27
|
+
method: 'post',
|
|
28
|
+
headers: { 'content-type': 'application/json' },
|
|
29
|
+
body: JSON.stringify(source)
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=integration-sources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-sources.js","sourceRoot":"","sources":["../../src/administrator/integration-sources.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,aAAa,CAAC;AAGlC,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,OAAO;IAGnC;IAFZ,YAAY,GAAG,0BAA0B,CAAC;IAElD,YAAoB,OAAwB;QAC1C,KAAK,CAAC,OAAO,CAAC,CAAA;QADI,YAAO,GAAP,OAAO,CAAiB;IAE5C,CAAC;IAED,oBAAoB,CAAC,QAAgB,EAAE,KAAoB;QACzD,OAAO,IAAI,CAAC,WAAW,CAAqB,GAAG,IAAI,CAAC,YAAY,IAAI,QAAQ,EAAE,EAAE,KAAK,CAAC,CAAC;IACzF,CAAC;IAED,OAAO,CAAC,KAAyB,EAAE,KAAoB;QACrD,OAAO,IAAI,CAAC,WAAW,CAAuB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;IACvG,CAAC;IAED,MAAM,CAAC,QAAgB;QACrB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,YAAY,IAAI,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;IAChF,CAAC;IAED,MAAM,CAAC,QAAgB,EAAE,OAA6F;QACpH,OAAO,IAAI,CAAC,WAAW,CACrB,GAAG,IAAI,CAAC,YAAY,IAAI,QAAQ,EAAE,EAClC;YACE,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;YAC/C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;SAC9B,CACF,CAAA;IACH,CAAC;IAED,MAAM,CAAC,MAAmF;QACxF,OAAO,IAAI,CAAC,WAAW,CAAqB,IAAI,CAAC,YAAY,EAAE;YAC7D,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;YAC/C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;SAC7B,CAAC,CAAA;IACJ,CAAC;CAEF"}
|
package/dist/base-sdk.js
CHANGED
|
@@ -15,7 +15,7 @@ export default class BaseSDK {
|
|
|
15
15
|
}
|
|
16
16
|
callJsonApi(relativeUrl, data) {
|
|
17
17
|
return this.callApi(relativeUrl, data).then(async (res) => {
|
|
18
|
-
if (this.qlOptions.forceRefresh && res.status
|
|
18
|
+
if (this.qlOptions.forceRefresh && res.status >= 400 && res.status < 500) {
|
|
19
19
|
const headers = await this.qlOptions.extraHeaders(relativeUrl, true);
|
|
20
20
|
if (!headers.authorization) {
|
|
21
21
|
throw new Error('could not able to refresh token');
|
package/dist/base-sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-sdk.js","sourceRoot":"","sources":["../src/base-sdk.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,OAAO,OAAO;IAIN;IAHpB,OAAO,CAAS;IAChB,MAAM,CAAY;IAElB,YAAoB,SAA0B;QAA1B,cAAS,GAAT,SAAS,CAAiB;QAC5C,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC;QACjG,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,KAAK,IAAI,UAAU,CAAC,KAAK,CAAC;IACpD,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,WAAmB,EAAE,IAAkB;QACnD,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QAClB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC;QAClC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC;QAC5E,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,GAAG,WAAW,EAAE,IAAI,CAAC,CAAC;IACvD,CAAC;IAED,WAAW,CAAI,WAAmB,EAAE,IAAkB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,EAAC,GAAG,EAAC,EAAE;YACtD,IAAI,IAAI,CAAC,SAAS,CAAC,YAAY,IAAI,GAAG,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AAe,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACjD,CAAC;CACF"}
|
package/dist/workspaces.d.ts
CHANGED
package/dist/workspaces.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspaces.js","sourceRoot":"","sources":["../src/workspaces.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"workspaces.js","sourceRoot":"","sources":["../src/workspaces.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,YAAY,CAAC;AA0BjC,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,OAAO;IACvC,YAAY,GAAG,iBAAiB,CAAC;IAEzC,YAAY,OAAwB;QAClC,KAAK,CAAC,OAAO,CAAC,CAAA;IAChB,CAAC;IAED,YAAY,CAAC,WAAmB;QAC9B,OAAO,IAAI,CAAC,WAAW,CAAa,GAAG,IAAI,CAAC,YAAY,IAAI,WAAW,EAAE,CAAC,CAAA;IAC5E,CAAC;IAED,UAAU,CAAC,WAAmB;QAC5B,OAAO,IAAI,CAAC,WAAW,CAAqB,GAAG,IAAI,CAAC,YAAY,IAAI,WAAW,UAAU,CAAC,CAAA;IAC5F,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,WAAW,CAAe,IAAI,CAAC,YAAY,CAAC,CAAC;IAC3D,CAAC;IAED,MAAM,CAAC,WAAmB;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,YAAY,IAAI,WAAW,EAAE,EAAE,EAAC,MAAM,EAAE,QAAQ,EAAC,CAAC,CAAC;IACjF,CAAC;IAED,MAAM,CAAC,WAAmB,EAAE,OAA4B;QACtD,OAAO,IAAI,CAAC,WAAW,CACrB,GAAG,IAAI,CAAC,YAAY,IAAI,WAAW,EAAE,EACrC;YACE,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,EAAC,cAAc,EAAE,kBAAkB,EAAC;YAC7C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;SAC9B,CACF,CAAA;IACH,CAAC;IAED,MAAM,CAAC,SAAiD;QACtD,OAAO,IAAI,CAAC,WAAW,CAAa,IAAI,CAAC,YAAY,EAAE;YACrD,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,EAAC,cAAc,EAAE,kBAAkB,EAAC;YAC7C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC;SAChC,CAAC,CAAA;IACJ,CAAC;IAED,QAAQ,CAAC,WAAmB;QAC1B,OAAO,IAAI,CAAC,WAAW,CACrB,GAAG,IAAI,CAAC,YAAY,IAAI,WAAW,EAAE,EACrC;YACE,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,EAAC,cAAc,EAAE,kBAAkB,EAAC;SAC9C,CACF,CAAA;IACH,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qelos/sdk",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.7",
|
|
4
4
|
"description": "SDK for Qelos API",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
"access": "public"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@qelos/global-types": "^3.7.
|
|
16
|
+
"@qelos/global-types": "^3.7.7"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"tsx": "^3.12.7",
|
|
20
20
|
"typescript": "^4.9.5"
|
|
21
21
|
},
|
|
22
|
-
"gitHead": "
|
|
22
|
+
"gitHead": "3d16633c443daab6a480b7ee511b1154d40afe4d"
|
|
23
23
|
}
|
|
@@ -8,6 +8,7 @@ import QlManageConfigurations from './manage-configurations';
|
|
|
8
8
|
import QlAdminWorkspaces from './workspaces';
|
|
9
9
|
import QlManageBlueprints from './manage-blueprints';
|
|
10
10
|
import { QlRoles } from './roles';
|
|
11
|
+
import QlIntegrationSources from './integration-sources';
|
|
11
12
|
|
|
12
13
|
export default class QelosAdministratorSDK<T = any> extends QelosSDK {
|
|
13
14
|
users: QlUsers<T>;
|
|
@@ -17,7 +18,8 @@ export default class QelosAdministratorSDK<T = any> extends QelosSDK {
|
|
|
17
18
|
drafts: QlDrafts;
|
|
18
19
|
events: QlEvents;
|
|
19
20
|
adminWorkspaces: QlAdminWorkspaces;
|
|
20
|
-
roles: QlRoles;
|
|
21
|
+
roles: QlRoles;
|
|
22
|
+
integrationSources: QlIntegrationSources;
|
|
21
23
|
|
|
22
24
|
constructor(options: QelosSDKOptions) {
|
|
23
25
|
super(options);
|
|
@@ -28,7 +30,8 @@ export default class QelosAdministratorSDK<T = any> extends QelosSDK {
|
|
|
28
30
|
this.drafts = new QlDrafts(options);
|
|
29
31
|
this.events = new QlEvents(options);
|
|
30
32
|
this.adminWorkspaces = new QlAdminWorkspaces(options);
|
|
31
|
-
this.roles = new QlRoles(options)
|
|
33
|
+
this.roles = new QlRoles(options);
|
|
34
|
+
this.integrationSources = new QlIntegrationSources(options);
|
|
32
35
|
|
|
33
36
|
if (!options.extraQueryParams) {
|
|
34
37
|
options.extraQueryParams = () => ({
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { QelosSDKOptions, RequestExtra } from '../types';
|
|
2
|
+
import BaseSDK from '../base-sdk';
|
|
3
|
+
import { IIntegrationSource } from '@qelos/global-types';
|
|
4
|
+
|
|
5
|
+
export default class QlIntegrationSources extends BaseSDK {
|
|
6
|
+
private relativePath = '/api/integration-sources';
|
|
7
|
+
|
|
8
|
+
constructor(private options: QelosSDKOptions) {
|
|
9
|
+
super(options)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
getIntegrationSource(sourceId: string, extra?: RequestExtra) {
|
|
13
|
+
return this.callJsonApi<IIntegrationSource>(`${this.relativePath}/${sourceId}`, extra);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
getList(query?: { kind?: string }, extra?: RequestExtra) {
|
|
17
|
+
return this.callJsonApi<IIntegrationSource[]>(this.relativePath + this.getQueryParams(query), extra);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
remove(sourceId: string): Promise<any> {
|
|
21
|
+
return this.callApi(`${this.relativePath}/${sourceId}`, { method: 'delete' });
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
update(sourceId: string, changes: Partial<Pick<IIntegrationSource, 'name' | 'labels' | 'metadata' | 'authentication'>>): Promise<IIntegrationSource> {
|
|
25
|
+
return this.callJsonApi<IIntegrationSource>(
|
|
26
|
+
`${this.relativePath}/${sourceId}`,
|
|
27
|
+
{
|
|
28
|
+
method: 'put',
|
|
29
|
+
headers: { 'content-type': 'application/json' },
|
|
30
|
+
body: JSON.stringify(changes)
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
create(source: Pick<IIntegrationSource, 'name' | 'labels' | 'metadata' | 'authentication'>): Promise<IIntegrationSource> {
|
|
36
|
+
return this.callJsonApi<IIntegrationSource>(this.relativePath, {
|
|
37
|
+
method: 'post',
|
|
38
|
+
headers: { 'content-type': 'application/json' },
|
|
39
|
+
body: JSON.stringify(source)
|
|
40
|
+
})
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
}
|
package/src/base-sdk.ts
CHANGED
|
@@ -18,7 +18,7 @@ export default class BaseSDK {
|
|
|
18
18
|
|
|
19
19
|
callJsonApi<T>(relativeUrl: string, data?: RequestInit): Promise<T> {
|
|
20
20
|
return this.callApi(relativeUrl, data).then(async res => {
|
|
21
|
-
if (this.qlOptions.forceRefresh && res.status
|
|
21
|
+
if (this.qlOptions.forceRefresh && res.status >= 400 && res.status < 500) {
|
|
22
22
|
const headers = await this.qlOptions.extraHeaders(relativeUrl, true);
|
|
23
23
|
if (!headers.authorization) {
|
|
24
24
|
throw new Error('could not able to refresh token');
|