@qelos/sdk 3.8.2 → 3.9.0

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.
@@ -2,16 +2,15 @@ import QelosSDK from '../index';
2
2
  import { QelosSDKOptions } from '../types';
3
3
  import QlDrafts from './drafts';
4
4
  import QlEvents from './events';
5
- import QlManageLayouts from './manage-layouts';
6
5
  import QlUsers from './users';
7
6
  import QlManageConfigurations from './manage-configurations';
8
7
  import QlAdminWorkspaces from './workspaces';
9
8
  import QlManageBlueprints from './manage-blueprints';
10
9
  import { QlRoles } from './roles';
11
10
  import QlIntegrationSources from './integration-sources';
11
+ import QlManagePlugins from './manage-plugins';
12
12
  export default class QelosAdministratorSDK<T = any> extends QelosSDK {
13
13
  users: QlUsers<T>;
14
- manageLayouts: QlManageLayouts;
15
14
  manageConfigurations: QlManageConfigurations;
16
15
  manageBlueprints: QlManageBlueprints;
17
16
  drafts: QlDrafts;
@@ -19,6 +18,7 @@ export default class QelosAdministratorSDK<T = any> extends QelosSDK {
19
18
  adminWorkspaces: QlAdminWorkspaces;
20
19
  roles: QlRoles;
21
20
  integrationSources: QlIntegrationSources;
21
+ managePlugins: QlManagePlugins;
22
22
  constructor(options: QelosSDKOptions);
23
23
  impersonateUser(userId: string, workspaceId?: string): void;
24
24
  clearImpersonation(): void;
@@ -1,16 +1,15 @@
1
1
  import QelosSDK from '../index';
2
2
  import QlDrafts from './drafts';
3
3
  import QlEvents from './events';
4
- import QlManageLayouts from './manage-layouts';
5
4
  import QlUsers from './users';
6
5
  import QlManageConfigurations from './manage-configurations';
7
6
  import QlAdminWorkspaces from './workspaces';
8
7
  import QlManageBlueprints from './manage-blueprints';
9
8
  import { QlRoles } from './roles';
10
9
  import QlIntegrationSources from './integration-sources';
10
+ import QlManagePlugins from './manage-plugins';
11
11
  export default class QelosAdministratorSDK extends QelosSDK {
12
12
  users;
13
- manageLayouts;
14
13
  manageConfigurations;
15
14
  manageBlueprints;
16
15
  drafts;
@@ -18,10 +17,10 @@ export default class QelosAdministratorSDK extends QelosSDK {
18
17
  adminWorkspaces;
19
18
  roles;
20
19
  integrationSources;
20
+ managePlugins;
21
21
  constructor(options) {
22
22
  super(options);
23
23
  this.users = new QlUsers(options);
24
- this.manageLayouts = new QlManageLayouts(options);
25
24
  this.manageConfigurations = new QlManageConfigurations(options);
26
25
  this.manageBlueprints = new QlManageBlueprints(options);
27
26
  this.drafts = new QlDrafts(options);
@@ -29,6 +28,7 @@ export default class QelosAdministratorSDK extends QelosSDK {
29
28
  this.adminWorkspaces = new QlAdminWorkspaces(options);
30
29
  this.roles = new QlRoles(options);
31
30
  this.integrationSources = new QlIntegrationSources(options);
31
+ this.managePlugins = new QlManagePlugins(options);
32
32
  if (!options.extraQueryParams) {
33
33
  options.extraQueryParams = () => ({
34
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;AAClC,OAAO,oBAAoB,MAAM,uBAAuB,CAAC;AAEzD,MAAM,CAAC,OAAO,OAAO,qBAA+B,SAAQ,QAAQ;IAClE,KAAK,CAAa;IAClB,aAAa,CAAkB;IAC/B,oBAAoB,CAAyB;IAC7C,gBAAgB,CAAqB;IACrC,MAAM,CAAW;IACjB,MAAM,CAAW;IACjB,eAAe,CAAoB;IACnC,KAAK,CAAU;IACf,kBAAk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AC,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: '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.endsWith('/') ? qlOptions.appUrl.slice(0, -1) : 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) {
@@ -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,yBAAyB;CACnD,CAAA;AAED,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;QAElC,IAAI,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE;YAC/B,IAAI;gBACF,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,SAAS,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AAC,OAAO,GAAY,EAAE;YACrB,+BAA+B;YAC/B,IAAI,GAAG,YAAY,KAAK,IAAI,GAAG,CAAC,OAAO,KAAK,MAAM,CAAC,aAAa,EAAE;gBAChE,+CAA+C;gBAC/C,MAAM,IAAI,CAAC,wBAAwB,EAAE,CAAC;gBAEtC,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;gBAClD,OAAO,IAAI,CAAC,aAAa,CAAI,GAAG,CAAC,CAAC;aACnC;YAED,MAAM,GAAG,CAAC;SACX;IACH,CAAC;IAED,cAAc,CAAC,SAA+B;QAC5C,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE,EAAE,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;QACxH,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,eAAe,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACjD,CAAC;CACF"}
@@ -1,14 +1,23 @@
1
1
  import { QelosSDKOptions, RequestExtra } from './types';
2
2
  import BaseSDK from './base-sdk';
3
3
  import type { ICommonQueryFilters } from '@qelos/global-types';
4
+ export interface IBaseBlueprintEntity {
5
+ identifier: string;
6
+ user?: string;
7
+ workspace?: string;
8
+ tenant?: string;
9
+ created: Date;
10
+ updated: Date;
11
+ metadata: any;
12
+ }
4
13
  export default class QlBlueprintEntities<T = any> extends BaseSDK {
5
14
  private options;
6
15
  private blueprintKey;
7
16
  private relativePath;
8
17
  constructor(options: QelosSDKOptions, blueprintKey: string);
9
- getEntity(identifier: string, extra?: RequestExtra): Promise<T>;
10
- getList(query?: ICommonQueryFilters & Record<string, any>, extra?: RequestExtra): Promise<T[]>;
18
+ getEntity(identifier: string, extra?: RequestExtra): Promise<IBaseBlueprintEntity & T>;
19
+ getList(query?: ICommonQueryFilters & Record<string, any>, extra?: RequestExtra): Promise<(IBaseBlueprintEntity & T)[]>;
11
20
  remove(identifier: string, extra?: RequestExtra): Promise<any>;
12
- update(identifier: string, changes: Partial<T>, extra?: RequestExtra): Promise<T>;
13
- create(entity: T, extra?: Partial<RequestInit>): Promise<T>;
21
+ update(identifier: string, changes: Partial<T & IBaseBlueprintEntity>, extra?: RequestExtra): Promise<IBaseBlueprintEntity & T>;
22
+ create(entity: T & IBaseBlueprintEntity, extra?: RequestExtra): Promise<IBaseBlueprintEntity & T>;
14
23
  }
@@ -26,7 +26,7 @@ export default class QlBlueprintEntities extends BaseSDK {
26
26
  });
27
27
  }
28
28
  create(entity, extra) {
29
- return this.callJsonApi(`${this.relativePath}/${this.blueprintKey}/entities${this.getQueryParams()}`, {
29
+ return this.callJsonApi(`${this.relativePath}/${this.blueprintKey}/entities${this.getQueryParams(extra?.query)}`, {
30
30
  method: 'post',
31
31
  headers: { 'content-type': 'application/json' },
32
32
  body: JSON.stringify(entity),
@@ -1 +1 @@
1
- {"version":3,"file":"blueprints-entities.js","sourceRoot":"","sources":["../src/blueprints-entities.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,YAAY,CAAC;AAGjC,MAAM,CAAC,OAAO,OAAO,mBAA6B,SAAQ,OAAO;IAG3C;IAAkC;IAF9C,YAAY,GAAG,iBAAiB,CAAC;IAEzC,YAAoB,OAAwB,EAAU,YAAoB;QACxE,KAAK,CAAC,OAAO,CAAC,CAAA;QADI,YAAO,GAAP,OAAO,CAAiB;QAAU,iBAAY,GAAZ,YAAY,CAAQ;IAE1E,CAAC;IAED,SAAS,CAAC,UAAkB,EAAE,KAAoB;QAChD,OAAO,IAAI,CAAC,WAAW,CAAI,GAAG,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY,aAAa,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,C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aAAa,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,EACtG;YACE,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;YAC/C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;YAC7B,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;SACjB,CACF,CAAA;IACH,CAAC;IAED,MAAM,CAAC,MAAgC,EAAE,KAAoB;QAC3D,OAAO,IAAI,CAAC,WAAW,CAA2B,GAAG,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY,YAAY,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE;YAC1I,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;YAC/C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;YAC5B,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;SACjB,CAAC,CAAA;IACJ,CAAC;CACF"}
package/dist/index.d.ts CHANGED
@@ -2,7 +2,6 @@ import { QelosSDKOptions } from './types';
2
2
  import BaseSDK from './base-sdk';
3
3
  import QlAppConfigurations from './configurations';
4
4
  import QlBlocks from './blocks';
5
- import QlLayouts from './administrator/layouts';
6
5
  import QlAuthentication from './authentication';
7
6
  import QlWorkspaces from './workspaces';
8
7
  import QlInvites from './invites';
@@ -11,7 +10,6 @@ export default class QelosSDK extends BaseSDK {
11
10
  #private;
12
11
  private options;
13
12
  blocks: QlBlocks;
14
- layouts: QlLayouts;
15
13
  appConfigurations: QlAppConfigurations;
16
14
  authentication: QlAuthentication;
17
15
  workspaces: QlWorkspaces;
package/dist/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import BaseSDK from './base-sdk';
2
2
  import QlAppConfigurations from './configurations';
3
3
  import QlBlocks from './blocks';
4
- import QlLayouts from './administrator/layouts';
5
4
  import QlAuthentication from './authentication';
6
5
  import QlWorkspaces from './workspaces';
7
6
  import QlInvites from './invites';
@@ -11,7 +10,6 @@ export default class QelosSDK extends BaseSDK {
11
10
  options;
12
11
  #customHeaders = {};
13
12
  blocks;
14
- layouts;
15
13
  appConfigurations;
16
14
  authentication;
17
15
  workspaces;
@@ -21,7 +19,6 @@ export default class QelosSDK extends BaseSDK {
21
19
  super(options);
22
20
  this.options = options;
23
21
  this.blocks = new QlBlocks(this.options);
24
- this.layouts = new QlLayouts(this.options);
25
22
  this.appConfigurations = new QlAppConfigurations(this.options);
26
23
  this.authentication = new QlAuthentication(this.options);
27
24
  this.workspaces = new QlWorkspaces(this.options);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,mBAAmB,MAAM,kBAAkB,CAAC;AACnD,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,gBAAgB,MAAM,kBAAkB,CAAC;AAChD,OAAO,YAAY,MAAM,cAAc,CAAC;AACxC,OAAO,SAAS,MAAM,WAAW,CAAC;AAClC,OAAO,YAAY,MAAM,cAAc,CAAC;AAExC,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,oBAAoB,EAAE,aAAa,EAAE,aAAa,CAAC,CAAC,CAAA;AAExF,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,OAAO;IAWvB;IAVpB,cAAc,GAAG,EAAE,CAAA;IAEnB,MAAM,CAAW;IACjB,OAAO,CAAY;IACnB,iBAAiB,CAAsB;IACvC,cAAc,CAAmB;IACjC,UAAU,CAAe;IACzB,OAAO,CAAY;IACnB,UAAU,CAAe;IAEzB,YAAoB,OAAwB;QAC1C,KAAK,CAAC,OAAO,CAAC,CAAC;QADG,YAAO,GAAP,OAAO,CAAiB;QAE1C,IAAI,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IAAI,CAAC,cAAc,EAAE,CAAA;iBACpE;gBACD,OAAO,EAAE,GAAG,IAAI,CAAC,cAAc,EAAE,CAAA;YACnC,CAAC,CAAA;SACF;IACH,CAAC;IAED,eAAe,CAAC,GAAW,EAAE,KAAa;QACxC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACnC,CAAC;IAED,kBAAkB,CAAC,GAAW;QAC5B,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;IAClC,CAAC;CAEF"}
@@ -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
  });
@@ -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,GAA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qelos API",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {
7
7
  "test": "node --import tsx --test **/**/*.test.ts",
8
- "build": "tsc"
8
+ "type-check": "tsc --noEmit",
9
+ "build": "npm run type-check && tsc"
9
10
  },
10
11
  "author": "David Meir-Levy <davidmeirlevy@gmail.com>",
11
12
  "license": "MIT",
@@ -13,11 +14,11 @@
13
14
  "access": "public"
14
15
  },
15
16
  "dependencies": {
16
- "@qelos/global-types": "^3.8.2"
17
+ "@qelos/global-types": "^3.9.0"
17
18
  },
18
19
  "devDependencies": {
19
- "tsx": "^3.12.7",
20
+ "tsx": "^4.19.4",
20
21
  "typescript": "^4.9.5"
21
22
  },
22
- "gitHead": "dc75ba76bdb68c07b640d4469d9dffecf61759b1"
23
+ "gitHead": "13468bc51557291935b96b1aeaa837b8b52861e8"
23
24
  }
@@ -2,17 +2,16 @@ import QelosSDK from '../index';
2
2
  import { QelosSDKOptions } from '../types';
3
3
  import QlDrafts from './drafts';
4
4
  import QlEvents from './events';
5
- import QlManageLayouts from './manage-layouts';
6
5
  import QlUsers from './users';
7
6
  import QlManageConfigurations from './manage-configurations';
8
7
  import QlAdminWorkspaces from './workspaces';
9
8
  import QlManageBlueprints from './manage-blueprints';
10
9
  import { QlRoles } from './roles';
11
10
  import QlIntegrationSources from './integration-sources';
11
+ import QlManagePlugins from './manage-plugins';
12
12
 
13
13
  export default class QelosAdministratorSDK<T = any> extends QelosSDK {
14
14
  users: QlUsers<T>;
15
- manageLayouts: QlManageLayouts;
16
15
  manageConfigurations: QlManageConfigurations;
17
16
  manageBlueprints: QlManageBlueprints;
18
17
  drafts: QlDrafts;
@@ -20,11 +19,11 @@ export default class QelosAdministratorSDK<T = any> extends QelosSDK {
20
19
  adminWorkspaces: QlAdminWorkspaces;
21
20
  roles: QlRoles;
22
21
  integrationSources: QlIntegrationSources;
22
+ managePlugins: QlManagePlugins;
23
23
 
24
24
  constructor(options: QelosSDKOptions) {
25
25
  super(options);
26
26
  this.users = new QlUsers<T>(options);
27
- this.manageLayouts = new QlManageLayouts(options);
28
27
  this.manageConfigurations = new QlManageConfigurations(options);
29
28
  this.manageBlueprints = new QlManageBlueprints(options);
30
29
  this.drafts = new QlDrafts(options);
@@ -32,6 +31,7 @@ export default class QelosAdministratorSDK<T = any> extends QelosSDK {
32
31
  this.adminWorkspaces = new QlAdminWorkspaces(options);
33
32
  this.roles = new QlRoles(options);
34
33
  this.integrationSources = new QlIntegrationSources(options);
34
+ this.managePlugins = new QlManagePlugins(options);
35
35
 
36
36
  if (!options.extraQueryParams) {
37
37
  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.endsWith('/') ? qlOptions.appUrl.slice(0, -1) : 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
 
@@ -2,6 +2,16 @@ import { QelosSDKOptions, RequestExtra } from './types';
2
2
  import BaseSDK from './base-sdk';
3
3
  import type { ICommonQueryFilters } from '@qelos/global-types';
4
4
 
5
+ export interface IBaseBlueprintEntity {
6
+ identifier: string;
7
+ user?: string;
8
+ workspace?: string;
9
+ tenant?: string;
10
+ created: Date;
11
+ updated: Date;
12
+ metadata: any;
13
+ }
14
+
5
15
  export default class QlBlueprintEntities<T = any> extends BaseSDK {
6
16
  private relativePath = '/api/blueprints';
7
17
 
@@ -10,19 +20,19 @@ export default class QlBlueprintEntities<T = any> extends BaseSDK {
10
20
  }
11
21
 
12
22
  getEntity(identifier: string, extra?: RequestExtra) {
13
- return this.callJsonApi<T>(`${this.relativePath}/${this.blueprintKey}/entities/${identifier}${this.getQueryParams(extra?.query)}`, extra)
23
+ return this.callJsonApi<IBaseBlueprintEntity & T>(`${this.relativePath}/${this.blueprintKey}/entities/${identifier}${this.getQueryParams(extra?.query)}`, extra)
14
24
  }
15
25
 
16
26
  getList(query?: ICommonQueryFilters & Record<string, any>, extra?: RequestExtra) {
17
- return this.callJsonApi<T[]>(`${this.relativePath}/${this.blueprintKey}/entities${this.getQueryParams(query)}`, extra);
27
+ return this.callJsonApi<(IBaseBlueprintEntity & T)[]>(`${this.relativePath}/${this.blueprintKey}/entities${this.getQueryParams(query)}`, extra);
18
28
  }
19
29
 
20
30
  remove(identifier: string, extra?: RequestExtra): Promise<any> {
21
31
  return this.callApi(`${this.relativePath}/${this.blueprintKey}/entities/${identifier}${this.getQueryParams(extra?.query)}`, { method: 'delete' });
22
32
  }
23
33
 
24
- update(identifier: string, changes: Partial<T>, extra?: RequestExtra): Promise<T> {
25
- return this.callJsonApi<T>(
34
+ update(identifier: string, changes: Partial<T & IBaseBlueprintEntity>, extra?: RequestExtra): Promise<IBaseBlueprintEntity & T> {
35
+ return this.callJsonApi<IBaseBlueprintEntity & T>(
26
36
  `${this.relativePath}/${this.blueprintKey}/entities/${identifier}${this.getQueryParams(extra?.query)}`,
27
37
  {
28
38
  method: 'put',
@@ -33,8 +43,8 @@ export default class QlBlueprintEntities<T = any> extends BaseSDK {
33
43
  )
34
44
  }
35
45
 
36
- create(entity: T, extra?: Partial<RequestInit>): Promise<T> {
37
- return this.callJsonApi<T>(`${this.relativePath}/${this.blueprintKey}/entities${this.getQueryParams()}`, {
46
+ create(entity: T & IBaseBlueprintEntity, extra?: RequestExtra): Promise<IBaseBlueprintEntity & T> {
47
+ return this.callJsonApi<IBaseBlueprintEntity & T>(`${this.relativePath}/${this.blueprintKey}/entities${this.getQueryParams(extra?.query)}`, {
38
48
  method: 'post',
39
49
  headers: { 'content-type': 'application/json' },
40
50
  body: JSON.stringify(entity),
package/src/index.ts CHANGED
@@ -2,7 +2,6 @@ import { QelosSDKOptions } from './types';
2
2
  import BaseSDK from './base-sdk';
3
3
  import QlAppConfigurations from './configurations';
4
4
  import QlBlocks from './blocks';
5
- import QlLayouts from './administrator/layouts';
6
5
  import QlAuthentication from './authentication';
7
6
  import QlWorkspaces from './workspaces';
8
7
  import QlInvites from './invites';
@@ -14,7 +13,6 @@ export default class QelosSDK extends BaseSDK {
14
13
  #customHeaders = {}
15
14
 
16
15
  blocks: QlBlocks;
17
- layouts: QlLayouts;
18
16
  appConfigurations: QlAppConfigurations;
19
17
  authentication: QlAuthentication;
20
18
  workspaces: QlWorkspaces;
@@ -24,7 +22,6 @@ export default class QelosSDK extends BaseSDK {
24
22
  constructor(private options: QelosSDKOptions) {
25
23
  super(options);
26
24
  this.blocks = new QlBlocks(this.options);
27
- this.layouts = new QlLayouts(this.options);
28
25
  this.appConfigurations = new QlAppConfigurations(this.options);
29
26
  this.authentication = new QlAuthentication(this.options);
30
27
  this.workspaces = new QlWorkspaces(this.options);
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'},
@@ -27,7 +27,6 @@ test('QelosSDK', async (t) => {
27
27
  setup();
28
28
  assert.ok(sdk);
29
29
  assert.ok(sdk.blocks);
30
- assert.ok(sdk.layouts);
31
30
  assert.ok(sdk.appConfigurations);
32
31
  assert.ok(sdk.authentication);
33
32
  assert.ok(sdk.workspaces);
@@ -1,45 +0,0 @@
1
- import { QelosSDKOptions } from "../types";
2
- import BaseSDK from "../base-sdk";
3
- export declare enum LayoutKind {
4
- INDEX = "index",
5
- SEARCH = "search",
6
- TAG = "tag",
7
- CATEGORY = "category",
8
- POST = "post"
9
- }
10
- export declare enum LayoutConnectedDataKind {
11
- MENU = "menu",
12
- BLOCK = "block",
13
- HTTP = "http",
14
- POSTS = "posts",
15
- CATEGORY_POSTS = "categoryPosts",
16
- CATEGORY = "category",
17
- POST = "post"
18
- }
19
- export interface ILayoutContent {
20
- component: string;
21
- predefined: boolean;
22
- stick?: boolean;
23
- classes: string;
24
- children?: ILayoutContent[];
25
- props: {
26
- [key: string]: any;
27
- };
28
- }
29
- export interface ILayout {
30
- kind: LayoutKind;
31
- connectedData: Array<{
32
- kind: LayoutConnectedDataKind;
33
- data?: any;
34
- identifier: string;
35
- reference: string;
36
- context?: any;
37
- }>;
38
- content: ILayoutContent[];
39
- [key: string]: any;
40
- }
41
- export default class QlLayouts extends BaseSDK {
42
- private relativePath;
43
- constructor(options: QelosSDKOptions);
44
- getLayout(kind: LayoutKind, extra?: Partial<RequestInit>): Promise<ILayout>;
45
- }
@@ -1,29 +0,0 @@
1
- import BaseSDK from "../base-sdk";
2
- export var LayoutKind;
3
- (function (LayoutKind) {
4
- LayoutKind["INDEX"] = "index";
5
- LayoutKind["SEARCH"] = "search";
6
- LayoutKind["TAG"] = "tag";
7
- LayoutKind["CATEGORY"] = "category";
8
- LayoutKind["POST"] = "post";
9
- })(LayoutKind || (LayoutKind = {}));
10
- export var LayoutConnectedDataKind;
11
- (function (LayoutConnectedDataKind) {
12
- LayoutConnectedDataKind["MENU"] = "menu";
13
- LayoutConnectedDataKind["BLOCK"] = "block";
14
- LayoutConnectedDataKind["HTTP"] = "http";
15
- LayoutConnectedDataKind["POSTS"] = "posts";
16
- LayoutConnectedDataKind["CATEGORY_POSTS"] = "categoryPosts";
17
- LayoutConnectedDataKind["CATEGORY"] = "category";
18
- LayoutConnectedDataKind["POST"] = "post";
19
- })(LayoutConnectedDataKind || (LayoutConnectedDataKind = {}));
20
- export default class QlLayouts extends BaseSDK {
21
- relativePath = "/api/layouts";
22
- constructor(options) {
23
- super(options);
24
- }
25
- getLayout(kind, extra) {
26
- return this.callJsonApi(`${this.relativePath}/${kind}`, extra);
27
- }
28
- }
29
- //# sourceMappingURL=layouts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"layouts.js","sourceRoot":"","sources":["../../src/administrator/layouts.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,aAAa,CAAC;AAElC,MAAM,CAAN,IAAY,UAMX;AAND,WAAY,UAAU;IACpB,6BAAe,CAAA;IACf,+BAAiB,CAAA;IACjB,yBAAW,CAAA;IACX,mCAAqB,CAAA;IACrB,2BAAa,CAAA;AACf,CAAC,EANW,UAAU,KAAV,UAAU,QAMrB;AAED,MAAM,CAAN,IAAY,uBAQX;AARD,WAAY,uBAAuB;IACjC,wCAAa,CAAA;IACb,0CAAe,CAAA;IACf,wCAAa,CAAA;IACb,0CAAe,CAAA;IACf,2DAAgC,CAAA;IAChC,gDAAqB,CAAA;IACrB,wCAAa,CAAA;AACf,CAAC,EARW,uBAAuB,KAAvB,uBAAuB,QAQlC;AA2BD,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,OAAO;IACpC,YAAY,GAAG,cAAc,CAAC;IAEtC,YAAY,OAAwB;QAClC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAED,SAAS,CAAC,IAAgB,EAAE,KAA4B;QACtD,OAAO,IAAI,CAAC,WAAW,CAAU,GAAG,IAAI,CAAC,YAAY,IAAI,IAAI,EAAE,EAAE,KAAK,CAAC,CAAC;IAC1E,CAAC;CACF"}
@@ -1,12 +0,0 @@
1
- import { QelosSDKOptions, RequestExtra } from '../types';
2
- import BaseSDK from '../base-sdk';
3
- import { ILayout, LayoutKind } from './layouts';
4
- export default class QlManageLayouts extends BaseSDK {
5
- private relativePath;
6
- constructor(options: QelosSDKOptions);
7
- getLayout(kind: LayoutKind, extra?: Partial<RequestInit>): Promise<ILayout>;
8
- getList(extra?: Partial<RequestInit>): Promise<ILayout[]>;
9
- remove(kind: LayoutKind, extra?: Partial<RequestInit>): Promise<any>;
10
- update(kind: LayoutKind, changes: Partial<ILayout>, extra?: RequestExtra): Promise<ILayout>;
11
- create(layout: ILayout, extra?: RequestExtra): Promise<ILayout>;
12
- }
@@ -1,36 +0,0 @@
1
- import BaseSDK from '../base-sdk';
2
- export default class QlManageLayouts extends BaseSDK {
3
- relativePath = '/api/layouts';
4
- constructor(options) {
5
- super(options);
6
- }
7
- getLayout(kind, extra) {
8
- return this.callJsonApi(`${this.relativePath}/${kind}`, extra);
9
- }
10
- getList(extra) {
11
- return this.callJsonApi(this.relativePath, extra);
12
- }
13
- remove(kind, extra) {
14
- return this.callApi(`${this.relativePath}/${kind}`, {
15
- method: 'delete',
16
- ...(extra || {}),
17
- });
18
- }
19
- update(kind, changes, extra) {
20
- return this.callJsonApi(`${this.relativePath}/${kind}`, {
21
- method: 'put',
22
- headers: { 'content-type': 'application/json' },
23
- body: JSON.stringify(changes),
24
- ...(extra || {}),
25
- });
26
- }
27
- create(layout, extra) {
28
- return this.callJsonApi(this.relativePath, {
29
- method: 'post',
30
- headers: { 'content-type': 'application/json' },
31
- body: JSON.stringify(layout),
32
- ...(extra || {}),
33
- });
34
- }
35
- }
36
- //# sourceMappingURL=manage-layouts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"manage-layouts.js","sourceRoot":"","sources":["../../src/administrator/manage-layouts.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,aAAa,CAAC;AAGlC,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,OAAO;IAC1C,YAAY,GAAG,cAAc,CAAC;IAEtC,YAAY,OAAwB;QAClC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAED,SAA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ARCH = "search",
7
- TAG = "tag",
8
- CATEGORY = "category",
9
- POST = "post",
10
- }
11
-
12
- export enum LayoutConnectedDataKind {
13
- MENU = "menu",
14
- BLOCK = "block",
15
- HTTP = "http",
16
- POSTS = "posts",
17
- CATEGORY_POSTS = "categoryPosts",
18
- CATEGORY = "category",
19
- POST = "post",
20
- }
21
-
22
- export interface ILayoutContent {
23
- component: string;
24
- predefined: boolean;
25
- stick?: boolean;
26
- classes: string;
27
- children?: ILayoutContent[];
28
- props: {
29
- [key: string]: any;
30
- };
31
- }
32
-
33
- export interface ILayout {
34
- kind: LayoutKind;
35
- connectedData: Array<{
36
- kind: LayoutConnectedDataKind;
37
- data?: any;
38
- identifier: string;
39
- reference: string;
40
- context?: any;
41
- }>;
42
- content: ILayoutContent[];
43
-
44
- [key: string]: any;
45
- }
46
-
47
- export default class QlLayouts extends BaseSDK {
48
- private relativePath = "/api/layouts";
49
-
50
- constructor(options: QelosSDKOptions) {
51
- super(options);
52
- }
53
-
54
- getLayout(kind: LayoutKind, extra?: Partial<RequestInit>) {
55
- return this.callJsonApi<ILayout>(`${this.relativePath}/${kind}`, extra);
56
- }
57
- }
@@ -1,48 +0,0 @@
1
- import { QelosSDKOptions, RequestExtra } from '../types';
2
- import BaseSDK from '../base-sdk';
3
- import { ILayout, LayoutKind } from './layouts';
4
-
5
- export default class QlManageLayouts extends BaseSDK {
6
- private relativePath = '/api/layouts';
7
-
8
- constructor(options: QelosSDKOptions) {
9
- super(options);
10
- }
11
-
12
- getLayout(kind: LayoutKind, extra?: Partial<RequestInit>) {
13
- return this.callJsonApi<ILayout>(`${this.relativePath}/${kind}`, extra);
14
- }
15
-
16
- getList(extra?: Partial<RequestInit>) {
17
- return this.callJsonApi<ILayout[]>(this.relativePath, extra);
18
- }
19
-
20
- remove(kind: LayoutKind, extra?: Partial<RequestInit>): Promise<any> {
21
- return this.callApi(`${this.relativePath}/${kind}`, {
22
- method: 'delete',
23
- ...(extra || {}),
24
- });
25
- }
26
-
27
- update(
28
- kind: LayoutKind,
29
- changes: Partial<ILayout>,
30
- extra?: RequestExtra
31
- ): Promise<ILayout> {
32
- return this.callJsonApi<ILayout>(`${this.relativePath}/${kind}`, {
33
- method: 'put',
34
- headers: { 'content-type': 'application/json' },
35
- body: JSON.stringify(changes),
36
- ...(extra || {}),
37
- });
38
- }
39
-
40
- create(layout: ILayout, extra?: RequestExtra): Promise<ILayout> {
41
- return this.callJsonApi<ILayout>(this.relativePath, {
42
- method: 'post',
43
- headers: { 'content-type': 'application/json' },
44
- body: JSON.stringify(layout),
45
- ...(extra || {}),
46
- });
47
- }
48
- }