@qelos/sdk 3.8.2 → 3.8.3
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 +3 -0
- package/dist/administrator/index.js.map +1 -1
- package/dist/administrator/manage-plugins.d.ts +25 -0
- package/dist/administrator/manage-plugins.js +33 -0
- package/dist/administrator/manage-plugins.js.map +1 -0
- package/dist/base-sdk.js +2 -2
- package/dist/base-sdk.js.map +1 -1
- package/dist/workspaces.js +1 -1
- package/dist/workspaces.js.map +1 -1
- package/package.json +4 -4
- package/src/administrator/index.ts +3 -0
- package/src/administrator/manage-plugins.ts +58 -0
- package/src/base-sdk.ts +1 -1
- package/src/workspaces.ts +1 -1
|
@@ -9,6 +9,7 @@ import QlAdminWorkspaces from './workspaces';
|
|
|
9
9
|
import QlManageBlueprints from './manage-blueprints';
|
|
10
10
|
import { QlRoles } from './roles';
|
|
11
11
|
import QlIntegrationSources from './integration-sources';
|
|
12
|
+
import QlManagePlugins from './manage-plugins';
|
|
12
13
|
export default class QelosAdministratorSDK<T = any> extends QelosSDK {
|
|
13
14
|
users: QlUsers<T>;
|
|
14
15
|
manageLayouts: QlManageLayouts;
|
|
@@ -19,6 +20,7 @@ export default class QelosAdministratorSDK<T = any> extends QelosSDK {
|
|
|
19
20
|
adminWorkspaces: QlAdminWorkspaces;
|
|
20
21
|
roles: QlRoles;
|
|
21
22
|
integrationSources: QlIntegrationSources;
|
|
23
|
+
managePlugins: QlManagePlugins;
|
|
22
24
|
constructor(options: QelosSDKOptions);
|
|
23
25
|
impersonateUser(userId: string, workspaceId?: string): void;
|
|
24
26
|
clearImpersonation(): void;
|
|
@@ -8,6 +8,7 @@ import QlAdminWorkspaces from './workspaces';
|
|
|
8
8
|
import QlManageBlueprints from './manage-blueprints';
|
|
9
9
|
import { QlRoles } from './roles';
|
|
10
10
|
import QlIntegrationSources from './integration-sources';
|
|
11
|
+
import QlManagePlugins from './manage-plugins';
|
|
11
12
|
export default class QelosAdministratorSDK extends QelosSDK {
|
|
12
13
|
users;
|
|
13
14
|
manageLayouts;
|
|
@@ -18,6 +19,7 @@ export default class QelosAdministratorSDK extends QelosSDK {
|
|
|
18
19
|
adminWorkspaces;
|
|
19
20
|
roles;
|
|
20
21
|
integrationSources;
|
|
22
|
+
managePlugins;
|
|
21
23
|
constructor(options) {
|
|
22
24
|
super(options);
|
|
23
25
|
this.users = new QlUsers(options);
|
|
@@ -29,6 +31,7 @@ export default class QelosAdministratorSDK extends QelosSDK {
|
|
|
29
31
|
this.adminWorkspaces = new QlAdminWorkspaces(options);
|
|
30
32
|
this.roles = new QlRoles(options);
|
|
31
33
|
this.integrationSources = new QlIntegrationSources(options);
|
|
34
|
+
this.managePlugins = new QlManagePlugins(options);
|
|
32
35
|
if (!options.extraQueryParams) {
|
|
33
36
|
options.extraQueryParams = () => ({
|
|
34
37
|
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;AAClC,OAAO,oBAAoB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/administrator/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,QAAQ,MAAM,UA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AI,CAAC,kBAAkB,GAAG,IAAI,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAC5D,IAAI,CAAC,aAAa,GAAG,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC;QAElD,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,25 @@
|
|
|
1
|
+
import BaseSDK from '../base-sdk';
|
|
2
|
+
import { QelosSDKOptions } from '../types';
|
|
3
|
+
import { IPlugin, IEventSubscriber, IMicroFrontend, IPluginCrud, IInjectable, INavbarGroup } from '@qelos/global-types';
|
|
4
|
+
type ServerManagedPluginFields = 'tenant' | 'user' | 'token' | 'auth' | '_id' | 'id' | 'createdAt' | 'updatedAt';
|
|
5
|
+
export type IPluginCreateParams = Omit<IPlugin, ServerManagedPluginFields | 'subscribedEvents' | 'microFrontends' | 'cruds' | 'injectables' | 'navBarGroups'> & {
|
|
6
|
+
subscribedEvents?: Partial<IEventSubscriber>[];
|
|
7
|
+
microFrontends?: Partial<IMicroFrontend>[];
|
|
8
|
+
cruds?: Partial<IPluginCrud>[];
|
|
9
|
+
injectables?: Partial<IInjectable>[];
|
|
10
|
+
navBarGroups?: Partial<INavbarGroup>[];
|
|
11
|
+
version?: string;
|
|
12
|
+
url?: string;
|
|
13
|
+
proxyUrl?: string;
|
|
14
|
+
};
|
|
15
|
+
export type IPluginUpdateParams = Partial<Omit<IPlugin, ServerManagedPluginFields>>;
|
|
16
|
+
export default class QlManagePlugins extends BaseSDK {
|
|
17
|
+
private relativePath;
|
|
18
|
+
constructor(options: QelosSDKOptions);
|
|
19
|
+
create(pluginData: IPluginCreateParams): Promise<IPlugin>;
|
|
20
|
+
update(pluginId: string, pluginData: IPluginUpdateParams): Promise<IPlugin>;
|
|
21
|
+
remove(pluginId: string): Promise<void>;
|
|
22
|
+
getList(): Promise<IPlugin[]>;
|
|
23
|
+
getById(pluginId: string): Promise<IPlugin>;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import BaseSDK from '../base-sdk';
|
|
2
|
+
export default class QlManagePlugins extends BaseSDK {
|
|
3
|
+
relativePath = '/api/plugins'; // Please confirm/adjust this path
|
|
4
|
+
constructor(options) {
|
|
5
|
+
super(options);
|
|
6
|
+
}
|
|
7
|
+
async create(pluginData) {
|
|
8
|
+
return this.callJsonApi(this.relativePath, {
|
|
9
|
+
method: 'POST',
|
|
10
|
+
headers: { 'content-type': 'application/json' },
|
|
11
|
+
body: JSON.stringify(pluginData),
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
async update(pluginId, pluginData) {
|
|
15
|
+
return this.callJsonApi(`${this.relativePath}/${pluginId}`, {
|
|
16
|
+
method: 'PUT',
|
|
17
|
+
headers: { 'content-type': 'application/json' },
|
|
18
|
+
body: JSON.stringify(pluginData),
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
async remove(pluginId) {
|
|
22
|
+
// callApi usually doesn't expect a JSON response, so no <void> generic needed for it.
|
|
23
|
+
// It will throw on non-2xx responses.
|
|
24
|
+
await this.callApi(`${this.relativePath}/${pluginId}`, { method: 'DELETE' });
|
|
25
|
+
}
|
|
26
|
+
async getList() {
|
|
27
|
+
return this.callJsonApi(this.relativePath);
|
|
28
|
+
}
|
|
29
|
+
async getById(pluginId) {
|
|
30
|
+
return this.callJsonApi(`${this.relativePath}/${pluginId}`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=manage-plugins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manage-plugins.js","sourceRoot":"","sources":["../../src/administrator/manage-plugins.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,aAAa,CAAC;AAqBlC,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,OAAO;IAC1C,YAAY,GAAG,cAAc,CAAC,CAAC,kCAAkC;IAEzE,YAAY,OAAwB;QAClC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,UAA+B;QAC1C,OAAO,IAAI,CAAC,WAAW,CAAU,IAAI,CAAC,YAAY,EAAE;YAClD,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;YAC/C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC;SACjC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,QAAgB,EAAE,UAA+B;QAC5D,OAAO,IAAI,CAAC,WAAW,CAAU,GAAG,IAAI,CAAC,YAAY,IAAI,QAAQ,EAAE,EAAE;YACnE,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;YAC/C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC;SACjC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,QAAgB;QAC3B,sFAAsF;QACtF,sCAAsC;QACtC,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,YAAY,IAAI,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC/E,CAAC;IAED,KAAK,CAAC,OAAO;QACX,OAAO,IAAI,CAAC,WAAW,CAAY,IAAI,CAAC,YAAY,CAAC,CAAC;IACxD,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,QAAgB;QAC5B,OAAO,IAAI,CAAC,WAAW,CAAU,GAAG,IAAI,CAAC,YAAY,IAAI,QAAQ,EAAE,CAAC,CAAC;IACvE,CAAC;CACF"}
|
package/dist/base-sdk.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const ERRORS = {
|
|
2
2
|
EXTRA_HEADERS: 'could not get extra headers',
|
|
3
3
|
FAILED_REFRESH_TOKEN: 'could not handle failed refresh token',
|
|
4
|
-
UNABLE_TO_REFRESH_TOKEN: '
|
|
4
|
+
UNABLE_TO_REFRESH_TOKEN: 'could not able to refresh token'
|
|
5
5
|
};
|
|
6
6
|
export default class BaseSDK {
|
|
7
7
|
qlOptions;
|
|
@@ -9,7 +9,7 @@ export default class BaseSDK {
|
|
|
9
9
|
#fetch;
|
|
10
10
|
constructor(qlOptions) {
|
|
11
11
|
this.qlOptions = qlOptions;
|
|
12
|
-
this.#appUrl = qlOptions.appUrl
|
|
12
|
+
this.#appUrl = qlOptions.appUrl?.endsWith('/') ? qlOptions.appUrl.slice(0, -1) : qlOptions.appUrl;
|
|
13
13
|
this.#fetch = qlOptions.fetch || globalThis.fetch;
|
|
14
14
|
}
|
|
15
15
|
async callApi(relativeUrl, data) {
|
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,MAAM,GAAG;IACb,aAAa,EAAE,6BAA6B;IAC5C,oBAAoB,EAAE,uCAAuC;IAC7D,uBAAuB,EAAE,
|
|
1
|
+
{"version":3,"file":"base-sdk.js","sourceRoot":"","sources":["../src/base-sdk.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,GAAG;IACb,aAAa,EAAE,6BAA6B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CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACjD,CAAC;CACF"}
|
package/dist/workspaces.js
CHANGED
|
@@ -31,7 +31,7 @@ export default class QlWorkspaces extends BaseSDK {
|
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
activate(workspaceId) {
|
|
34
|
-
return this.callJsonApi(`${this.relativePath}/${workspaceId}`, {
|
|
34
|
+
return this.callJsonApi(`${this.relativePath}/${workspaceId}/activate`, {
|
|
35
35
|
method: 'post',
|
|
36
36
|
headers: { 'content-type': 'application/json' },
|
|
37
37
|
});
|
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;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;QAC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I,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,WAAW,EAC9C;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.8.
|
|
3
|
+
"version": "3.8.3",
|
|
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.8.
|
|
16
|
+
"@qelos/global-types": "^3.8.3"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"tsx": "^
|
|
19
|
+
"tsx": "^4.19.4",
|
|
20
20
|
"typescript": "^4.9.5"
|
|
21
21
|
},
|
|
22
|
-
"gitHead": "
|
|
22
|
+
"gitHead": "4f4acba1f01d2659431e3149cc6efa927926c5f1"
|
|
23
23
|
}
|
|
@@ -9,6 +9,7 @@ import QlAdminWorkspaces from './workspaces';
|
|
|
9
9
|
import QlManageBlueprints from './manage-blueprints';
|
|
10
10
|
import { QlRoles } from './roles';
|
|
11
11
|
import QlIntegrationSources from './integration-sources';
|
|
12
|
+
import QlManagePlugins from './manage-plugins';
|
|
12
13
|
|
|
13
14
|
export default class QelosAdministratorSDK<T = any> extends QelosSDK {
|
|
14
15
|
users: QlUsers<T>;
|
|
@@ -20,6 +21,7 @@ export default class QelosAdministratorSDK<T = any> extends QelosSDK {
|
|
|
20
21
|
adminWorkspaces: QlAdminWorkspaces;
|
|
21
22
|
roles: QlRoles;
|
|
22
23
|
integrationSources: QlIntegrationSources;
|
|
24
|
+
managePlugins: QlManagePlugins;
|
|
23
25
|
|
|
24
26
|
constructor(options: QelosSDKOptions) {
|
|
25
27
|
super(options);
|
|
@@ -32,6 +34,7 @@ export default class QelosAdministratorSDK<T = any> extends QelosSDK {
|
|
|
32
34
|
this.adminWorkspaces = new QlAdminWorkspaces(options);
|
|
33
35
|
this.roles = new QlRoles(options);
|
|
34
36
|
this.integrationSources = new QlIntegrationSources(options);
|
|
37
|
+
this.managePlugins = new QlManagePlugins(options);
|
|
35
38
|
|
|
36
39
|
if (!options.extraQueryParams) {
|
|
37
40
|
options.extraQueryParams = () => ({
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import BaseSDK from '../base-sdk';
|
|
2
|
+
import { QelosSDKOptions } from '../types';
|
|
3
|
+
import { IPlugin, IEventSubscriber, IMicroFrontend, IPluginCrud, IInjectable, INavbarGroup } from '@qelos/global-types';
|
|
4
|
+
|
|
5
|
+
// Fields that are typically set by the server or not directly updatable by admin
|
|
6
|
+
type ServerManagedPluginFields = 'tenant' | 'user' | 'token' | 'auth' | '_id' | 'id' | 'createdAt' | 'updatedAt';
|
|
7
|
+
|
|
8
|
+
export type IPluginCreateParams = Omit<IPlugin, ServerManagedPluginFields | 'subscribedEvents' | 'microFrontends' | 'cruds' | 'injectables' | 'navBarGroups'> & {
|
|
9
|
+
// Make optional arrays explicitly optional for creation if they can be omitted
|
|
10
|
+
subscribedEvents?: Partial<IEventSubscriber>[];
|
|
11
|
+
microFrontends?: Partial<IMicroFrontend>[];
|
|
12
|
+
cruds?: Partial<IPluginCrud>[];
|
|
13
|
+
injectables?: Partial<IInjectable>[];
|
|
14
|
+
navBarGroups?: Partial<INavbarGroup>[];
|
|
15
|
+
version?: string; // Add version if it's part of creation payload
|
|
16
|
+
url?: string; // Add url if it's part of creation payload (often same as appUrl)
|
|
17
|
+
proxyUrl?: string; // Allow setting proxyUrl during creation
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type IPluginUpdateParams = Partial<Omit<IPlugin, ServerManagedPluginFields>>;
|
|
21
|
+
|
|
22
|
+
export default class QlManagePlugins extends BaseSDK {
|
|
23
|
+
private relativePath = '/api/plugins'; // Please confirm/adjust this path
|
|
24
|
+
|
|
25
|
+
constructor(options: QelosSDKOptions) {
|
|
26
|
+
super(options);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async create(pluginData: IPluginCreateParams): Promise<IPlugin> {
|
|
30
|
+
return this.callJsonApi<IPlugin>(this.relativePath, {
|
|
31
|
+
method: 'POST',
|
|
32
|
+
headers: { 'content-type': 'application/json' },
|
|
33
|
+
body: JSON.stringify(pluginData),
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async update(pluginId: string, pluginData: IPluginUpdateParams): Promise<IPlugin> {
|
|
38
|
+
return this.callJsonApi<IPlugin>(`${this.relativePath}/${pluginId}`, {
|
|
39
|
+
method: 'PUT',
|
|
40
|
+
headers: { 'content-type': 'application/json' },
|
|
41
|
+
body: JSON.stringify(pluginData),
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
async remove(pluginId: string): Promise<void> {
|
|
46
|
+
// callApi usually doesn't expect a JSON response, so no <void> generic needed for it.
|
|
47
|
+
// It will throw on non-2xx responses.
|
|
48
|
+
await this.callApi(`${this.relativePath}/${pluginId}`, { method: 'DELETE' });
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async getList(): Promise<IPlugin[]> {
|
|
52
|
+
return this.callJsonApi<IPlugin[]>(this.relativePath);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async getById(pluginId: string): Promise<IPlugin> {
|
|
56
|
+
return this.callJsonApi<IPlugin>(`${this.relativePath}/${pluginId}`);
|
|
57
|
+
}
|
|
58
|
+
}
|
package/src/base-sdk.ts
CHANGED
|
@@ -11,7 +11,7 @@ export default class BaseSDK {
|
|
|
11
11
|
#fetch: FetchLike;
|
|
12
12
|
|
|
13
13
|
constructor(private qlOptions: QelosSDKOptions) {
|
|
14
|
-
this.#appUrl = qlOptions.appUrl
|
|
14
|
+
this.#appUrl = qlOptions.appUrl?.endsWith('/') ? qlOptions.appUrl.slice(0, -1) : qlOptions.appUrl;
|
|
15
15
|
this.#fetch = qlOptions.fetch || globalThis.fetch;
|
|
16
16
|
}
|
|
17
17
|
|
package/src/workspaces.ts
CHANGED
|
@@ -69,7 +69,7 @@ export default class QlWorkspaces extends BaseSDK {
|
|
|
69
69
|
|
|
70
70
|
activate(workspaceId: string): Promise<IWorkspace> {
|
|
71
71
|
return this.callJsonApi<IWorkspace>(
|
|
72
|
-
`${this.relativePath}/${workspaceId}`,
|
|
72
|
+
`${this.relativePath}/${workspaceId}/activate`,
|
|
73
73
|
{
|
|
74
74
|
method: 'post',
|
|
75
75
|
headers: {'content-type': 'application/json'},
|