@qelos/sdk 3.10.0 → 3.11.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.
@@ -0,0 +1,34 @@
1
+ import BaseSDK from '../base-sdk';
2
+ import { QelosSDKOptions } from '../types';
3
+ export interface IComponent {
4
+ _id?: string;
5
+ tenant?: string;
6
+ identifier: string;
7
+ componentName: string;
8
+ description?: string;
9
+ content: string;
10
+ requiredProps: {
11
+ prop: string;
12
+ type: string;
13
+ }[];
14
+ compiledContent?: {
15
+ js: string;
16
+ css: string;
17
+ };
18
+ created: Date;
19
+ updated: Date;
20
+ }
21
+ type IComponentCreateParams = Pick<IComponent, 'identifier' | 'componentName' | 'content'> & {
22
+ description?: string;
23
+ };
24
+ type IComponentUpdateParams = Partial<Pick<IComponent, 'identifier' | 'componentName' | 'description' | 'content'>>;
25
+ export default class QlComponents extends BaseSDK {
26
+ private relativePath;
27
+ constructor(options: QelosSDKOptions);
28
+ getComponent(componentId: string): Promise<IComponent>;
29
+ getList(): Promise<IComponent[]>;
30
+ remove(componentId: string): Promise<IComponent>;
31
+ update(componentId: string, changes: IComponentUpdateParams): Promise<IComponent>;
32
+ create(component: IComponentCreateParams): Promise<IComponent>;
33
+ }
34
+ export {};
@@ -0,0 +1,31 @@
1
+ import BaseSDK from '../base-sdk';
2
+ export default class QlComponents extends BaseSDK {
3
+ relativePath = '/api/components';
4
+ constructor(options) {
5
+ super(options);
6
+ }
7
+ getComponent(componentId) {
8
+ return this.callJsonApi(`${this.relativePath}/${componentId}`);
9
+ }
10
+ getList() {
11
+ return this.callJsonApi(this.relativePath);
12
+ }
13
+ remove(componentId) {
14
+ return this.callJsonApi(`${this.relativePath}/${componentId}`, { method: 'delete' });
15
+ }
16
+ update(componentId, changes) {
17
+ return this.callJsonApi(`${this.relativePath}/${componentId}`, {
18
+ method: 'put',
19
+ headers: { 'content-type': 'application/json' },
20
+ body: JSON.stringify(changes)
21
+ });
22
+ }
23
+ create(component) {
24
+ return this.callJsonApi(this.relativePath, {
25
+ method: 'post',
26
+ headers: { 'content-type': 'application/json' },
27
+ body: JSON.stringify(component)
28
+ });
29
+ }
30
+ }
31
+ //# sourceMappingURL=components.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components.js","sourceRoot":"","sources":["../../src/administrator/components.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,aAAa,CAAC;AA4BlC,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,OAAO;IACvC,YAAY,GAAG,iBAAiB,CAAC;IAEzC,YAAY,OAAwB;QAClC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAED,YAAY,CAAC,WAAmB;QAC9B,OAAO,IAAI,CAAC,WAAW,CAAa,GAAG,IAAI,CAAC,YAAY,IAAI,WAAW,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,WAAW,CAAe,IAAI,CAAC,YAAY,CAAC,CAAC;IAC3D,CAAC;IAED,MAAM,CAAC,WAAmB;QACxB,OAAO,IAAI,CAAC,WAAW,CAAa,GAAG,IAAI,CAAC,YAAY,IAAI,WAAW,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;IACnG,CAAC;IAED,MAAM,CAAC,WAAmB,EAAE,OAA+B;QACzD,OAAO,IAAI,CAAC,WAAW,CACrB,GAAG,IAAI,CAAC,YAAY,IAAI,WAAW,EAAE,EACrC;YACE,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;YAC/C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;SAC9B,CACF,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,SAAiC;QACtC,OAAO,IAAI,CAAC,WAAW,CAAa,IAAI,CAAC,YAAY,EAAE;YACrD,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;YAC/C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC;SAChC,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -9,6 +9,7 @@ import QlManageBlueprints from './manage-blueprints';
9
9
  import { QlRoles } from './roles';
10
10
  import QlIntegrationSources from './integration-sources';
11
11
  import QlManagePlugins from './manage-plugins';
12
+ import QlComponents from './components';
12
13
  export default class QelosAdministratorSDK<T = any> extends QelosSDK {
13
14
  users: QlUsers<T>;
14
15
  manageConfigurations: QlManageConfigurations;
@@ -19,6 +20,7 @@ export default class QelosAdministratorSDK<T = any> extends QelosSDK {
19
20
  roles: QlRoles;
20
21
  integrationSources: QlIntegrationSources;
21
22
  managePlugins: QlManagePlugins;
23
+ components: QlComponents;
22
24
  constructor(options: QelosSDKOptions);
23
25
  impersonateUser(userId: string, workspaceId?: string): void;
24
26
  clearImpersonation(): void;
@@ -8,6 +8,7 @@ import QlManageBlueprints from './manage-blueprints';
8
8
  import { QlRoles } from './roles';
9
9
  import QlIntegrationSources from './integration-sources';
10
10
  import QlManagePlugins from './manage-plugins';
11
+ import QlComponents from './components';
11
12
  export default class QelosAdministratorSDK extends QelosSDK {
12
13
  users;
13
14
  manageConfigurations;
@@ -18,6 +19,7 @@ export default class QelosAdministratorSDK extends QelosSDK {
18
19
  roles;
19
20
  integrationSources;
20
21
  managePlugins;
22
+ components;
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.roles = new QlRoles(options);
30
32
  this.integrationSources = new QlIntegrationSources(options);
31
33
  this.managePlugins = new QlManagePlugins(options);
34
+ this.components = new QlComponents(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,UAA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C;QAC9C,IAAI,CAAC,kBAAkB,CAAC,yBAAyB,CAAC,CAAC;IACrD,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qelos/sdk",
3
- "version": "3.10.0",
3
+ "version": "3.11.0",
4
4
  "description": "SDK for Qelos API",
5
5
  "main": "./dist/index.js",
6
6
  "author": "David Meir-Levy <davidmeirlevy@gmail.com>",
@@ -0,0 +1,66 @@
1
+ import BaseSDK from '../base-sdk';
2
+ import { QelosSDKOptions } from '../types';
3
+
4
+ export interface IComponent {
5
+ _id?: string;
6
+ tenant?: string;
7
+ identifier: string;
8
+ componentName: string;
9
+ description?: string;
10
+ content: string;
11
+ requiredProps: {
12
+ prop: string;
13
+ type: string;
14
+ }[];
15
+ compiledContent?: {
16
+ js: string;
17
+ css: string;
18
+ };
19
+ created: Date;
20
+ updated: Date;
21
+ }
22
+
23
+ type IComponentCreateParams = Pick<IComponent, 'identifier' | 'componentName' | 'content'> & {
24
+ description?: string;
25
+ };
26
+
27
+ type IComponentUpdateParams = Partial<Pick<IComponent, 'identifier' | 'componentName' | 'description' | 'content'>>;
28
+
29
+ export default class QlComponents extends BaseSDK {
30
+ private relativePath = '/api/components';
31
+
32
+ constructor(options: QelosSDKOptions) {
33
+ super(options);
34
+ }
35
+
36
+ getComponent(componentId: string) {
37
+ return this.callJsonApi<IComponent>(`${this.relativePath}/${componentId}`);
38
+ }
39
+
40
+ getList() {
41
+ return this.callJsonApi<IComponent[]>(this.relativePath);
42
+ }
43
+
44
+ remove(componentId: string): Promise<IComponent> {
45
+ return this.callJsonApi<IComponent>(`${this.relativePath}/${componentId}`, { method: 'delete' });
46
+ }
47
+
48
+ update(componentId: string, changes: IComponentUpdateParams): Promise<IComponent> {
49
+ return this.callJsonApi<IComponent>(
50
+ `${this.relativePath}/${componentId}`,
51
+ {
52
+ method: 'put',
53
+ headers: { 'content-type': 'application/json' },
54
+ body: JSON.stringify(changes)
55
+ }
56
+ );
57
+ }
58
+
59
+ create(component: IComponentCreateParams): Promise<IComponent> {
60
+ return this.callJsonApi<IComponent>(this.relativePath, {
61
+ method: 'post',
62
+ headers: { 'content-type': 'application/json' },
63
+ body: JSON.stringify(component)
64
+ });
65
+ }
66
+ }
@@ -9,6 +9,8 @@ import QlManageBlueprints from './manage-blueprints';
9
9
  import { QlRoles } from './roles';
10
10
  import QlIntegrationSources from './integration-sources';
11
11
  import QlManagePlugins from './manage-plugins';
12
+ import QlComponents from './components';
13
+
12
14
 
13
15
  export default class QelosAdministratorSDK<T = any> extends QelosSDK {
14
16
  users: QlUsers<T>;
@@ -20,6 +22,7 @@ export default class QelosAdministratorSDK<T = any> extends QelosSDK {
20
22
  roles: QlRoles;
21
23
  integrationSources: QlIntegrationSources;
22
24
  managePlugins: QlManagePlugins;
25
+ components: QlComponents;
23
26
 
24
27
  constructor(options: QelosSDKOptions) {
25
28
  super(options);
@@ -32,6 +35,7 @@ export default class QelosAdministratorSDK<T = any> extends QelosSDK {
32
35
  this.roles = new QlRoles(options);
33
36
  this.integrationSources = new QlIntegrationSources(options);
34
37
  this.managePlugins = new QlManagePlugins(options);
38
+ this.components = new QlComponents(options);
35
39
 
36
40
  if (!options.extraQueryParams) {
37
41
  options.extraQueryParams = () => ({