@qelos/sdk 3.8.3 → 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.
- package/dist/administrator/index.d.ts +0 -2
- package/dist/administrator/index.js +0 -3
- package/dist/administrator/index.js.map +1 -1
- package/dist/blueprints-entities.d.ts +13 -4
- package/dist/blueprints-entities.js +1 -1
- package/dist/blueprints-entities.js.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -3
- package/dist/index.js.map +1 -1
- package/package.json +5 -4
- package/src/administrator/index.ts +0 -3
- package/src/blueprints-entities.ts +16 -6
- package/src/index.ts +0 -3
- package/test/index.test.ts +0 -1
- package/dist/administrator/layouts.d.ts +0 -45
- package/dist/administrator/layouts.js +0 -29
- package/dist/administrator/layouts.js.map +0 -1
- package/dist/administrator/manage-layouts.d.ts +0 -12
- package/dist/administrator/manage-layouts.js +0 -36
- package/dist/administrator/manage-layouts.js.map +0 -1
- package/src/administrator/layouts.ts +0 -57
- package/src/administrator/manage-layouts.ts +0 -48
|
@@ -2,7 +2,6 @@ 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';
|
|
@@ -12,7 +11,6 @@ import QlIntegrationSources from './integration-sources';
|
|
|
12
11
|
import QlManagePlugins from './manage-plugins';
|
|
13
12
|
export default class QelosAdministratorSDK<T = any> extends QelosSDK {
|
|
14
13
|
users: QlUsers<T>;
|
|
15
|
-
manageLayouts: QlManageLayouts;
|
|
16
14
|
manageConfigurations: QlManageConfigurations;
|
|
17
15
|
manageBlueprints: QlManageBlueprints;
|
|
18
16
|
drafts: QlDrafts;
|
|
@@ -1,7 +1,6 @@
|
|
|
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';
|
|
@@ -11,7 +10,6 @@ import QlIntegrationSources from './integration-sources';
|
|
|
11
10
|
import QlManagePlugins from './manage-plugins';
|
|
12
11
|
export default class QelosAdministratorSDK extends QelosSDK {
|
|
13
12
|
users;
|
|
14
|
-
manageLayouts;
|
|
15
13
|
manageConfigurations;
|
|
16
14
|
manageBlueprints;
|
|
17
15
|
drafts;
|
|
@@ -23,7 +21,6 @@ export default class QelosAdministratorSDK extends QelosSDK {
|
|
|
23
21
|
constructor(options) {
|
|
24
22
|
super(options);
|
|
25
23
|
this.users = new QlUsers(options);
|
|
26
|
-
this.manageLayouts = new QlManageLayouts(options);
|
|
27
24
|
this.manageConfigurations = new QlManageConfigurations(options);
|
|
28
25
|
this.manageBlueprints = new QlManageBlueprints(options);
|
|
29
26
|
this.drafts = new QlDrafts(options);
|
|
@@ -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,
|
|
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,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,sBAAsB,MAAM,yBAAyB,CAAC;AAC7D,OAAO,iBAAiB,MAAM,c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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"}
|
|
@@ -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?:
|
|
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;
|
|
1
|
+
{"version":3,"file":"blueprints-entities.js","sourceRoot":"","sources":["../src/blueprints-entities.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,YAAY,CAAC;AAajC,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,CAA2B,GAAG,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY,aAAa,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,CAA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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,
|
|
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,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;IAUvB;IATpB,cAAc,GAAG,EAAE,CAAA;IAEnB,MAAM,CAAW;IACjB,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,CAAC,MAAM,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzC,IAAI,CAAC,iBAAiB,GAAG,IAAI,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC/D,IAAI,CAAC,cAAc,GAAG,IAAI,gBAAgB,CAAC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AAa;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"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qelos/sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.9.0",
|
|
4
4
|
"description": "SDK for Qelos API",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "node --import tsx --test **/**/*.test.ts",
|
|
8
|
-
"
|
|
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.
|
|
17
|
+
"@qelos/global-types": "^3.9.0"
|
|
17
18
|
},
|
|
18
19
|
"devDependencies": {
|
|
19
20
|
"tsx": "^4.19.4",
|
|
20
21
|
"typescript": "^4.9.5"
|
|
21
22
|
},
|
|
22
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "13468bc51557291935b96b1aeaa837b8b52861e8"
|
|
23
24
|
}
|
|
@@ -2,7 +2,6 @@ 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';
|
|
@@ -13,7 +12,6 @@ import QlManagePlugins from './manage-plugins';
|
|
|
13
12
|
|
|
14
13
|
export default class QelosAdministratorSDK<T = any> extends QelosSDK {
|
|
15
14
|
users: QlUsers<T>;
|
|
16
|
-
manageLayouts: QlManageLayouts;
|
|
17
15
|
manageConfigurations: QlManageConfigurations;
|
|
18
16
|
manageBlueprints: QlManageBlueprints;
|
|
19
17
|
drafts: QlDrafts;
|
|
@@ -26,7 +24,6 @@ export default class QelosAdministratorSDK<T = any> extends QelosSDK {
|
|
|
26
24
|
constructor(options: QelosSDKOptions) {
|
|
27
25
|
super(options);
|
|
28
26
|
this.users = new QlUsers<T>(options);
|
|
29
|
-
this.manageLayouts = new QlManageLayouts(options);
|
|
30
27
|
this.manageConfigurations = new QlManageConfigurations(options);
|
|
31
28
|
this.manageBlueprints = new QlManageBlueprints(options);
|
|
32
29
|
this.drafts = new QlDrafts(options);
|
|
@@ -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?:
|
|
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/test/index.test.ts
CHANGED
|
@@ -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,SAAS,CAAC,IAAgB,EAAE,KAA4B;QACtD,OAAO,IAAI,CAAC,WAAW,CAAU,GAAG,IAAI,CAAC,YAAY,IAAI,IAAI,EAAE,EAAE,KAAK,CAAC,CAAC;IAC1E,CAAC;IAED,OAAO,CAAC,KAA4B;QAClC,OAAO,IAAI,CAAC,WAAW,CAAY,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IAC/D,CAAC;IAED,MAAM,CAAC,IAAgB,EAAE,KAA4B;QACnD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,YAAY,IAAI,IAAI,EAAE,EAAE;YAClD,MAAM,EAAE,QAAQ;YAChB,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;SACjB,CAAC,CAAC;IACL,CAAC;IAED,MAAM,CACJ,IAAgB,EAChB,OAAyB,EACzB,KAAoB;QAEpB,OAAO,IAAI,CAAC,WAAW,CAAU,GAAG,IAAI,CAAC,YAAY,IAAI,IAAI,EAAE,EAAE;YAC/D,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,CAAC,CAAC;IACL,CAAC;IAED,MAAM,CAAC,MAAe,EAAE,KAAoB;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,MAAM,CAAC;YAC5B,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;SACjB,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { QelosSDKOptions } from "../types";
|
|
2
|
-
import BaseSDK from "../base-sdk";
|
|
3
|
-
|
|
4
|
-
export enum LayoutKind {
|
|
5
|
-
INDEX = "index",
|
|
6
|
-
SEARCH = "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
|
-
}
|