@qelos/sdk 3.0.1 → 3.1.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/drafts.d.ts +1 -1
- package/dist/administrator/drafts.js +1 -1
- package/dist/administrator/index.d.ts +8 -6
- package/dist/administrator/index.js +9 -6
- package/dist/administrator/index.js.map +1 -1
- package/dist/administrator/layouts.d.ts +1 -1
- package/dist/administrator/layouts.js +1 -1
- package/dist/administrator/manage-configurations.d.ts +18 -0
- package/dist/administrator/manage-configurations.js +36 -0
- package/dist/administrator/manage-configurations.js.map +1 -0
- package/dist/administrator/manage-layouts.d.ts +12 -0
- package/dist/administrator/manage-layouts.js +36 -0
- package/dist/administrator/manage-layouts.js.map +1 -0
- package/dist/administrator/users.d.ts +1 -1
- package/dist/administrator/users.js +1 -1
- package/dist/authentication.d.ts +1 -1
- package/dist/authentication.js +1 -1
- package/dist/blocks.d.ts +1 -1
- package/dist/blocks.js +1 -1
- package/dist/categories.d.ts +1 -1
- package/dist/categories.js +1 -1
- package/dist/configurations.d.ts +7 -3
- package/dist/configurations.js +2 -2
- package/dist/configurations.js.map +1 -1
- package/dist/index.d.ts +12 -14
- package/dist/index.js +13 -16
- package/dist/index.js.map +1 -1
- package/dist/menus.d.ts +1 -1
- package/dist/menus.js +1 -1
- package/dist/posts.d.ts +1 -1
- package/dist/posts.js +1 -1
- package/package.json +1 -1
- package/src/administrator/drafts.ts +1 -1
- package/src/administrator/index.ts +12 -9
- package/src/administrator/layouts.ts +1 -1
- package/src/administrator/manage-configurations.ts +51 -0
- package/src/{manage-layouts.ts → administrator/manage-layouts.ts} +4 -4
- package/src/administrator/users.ts +1 -1
- package/src/authentication.ts +1 -1
- package/src/blocks.ts +1 -1
- package/src/categories.ts +1 -1
- package/src/configurations.ts +5 -5
- package/src/index.ts +18 -19
- package/src/menus.ts +1 -1
- package/src/posts.ts +1 -1
|
@@ -11,7 +11,7 @@ export interface IDraft extends IDraftMetadata {
|
|
|
11
11
|
user: string;
|
|
12
12
|
tenant?: string;
|
|
13
13
|
}
|
|
14
|
-
export default class
|
|
14
|
+
export default class QlDrafts extends BaseSDK {
|
|
15
15
|
#private;
|
|
16
16
|
private relativePath;
|
|
17
17
|
constructor(options: QelosSDKOptions);
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import QelosSDK from '../index';
|
|
2
2
|
import { QelosSDKOptions } from '../types';
|
|
3
|
-
import
|
|
4
|
-
import GpManageLayouts from '../manage-layouts';
|
|
5
|
-
import GpDrafts from './drafts';
|
|
3
|
+
import QlDrafts from './drafts';
|
|
6
4
|
import QlEvents from './events';
|
|
5
|
+
import QlManageLayouts from './manage-layouts';
|
|
6
|
+
import QlUsers from './users';
|
|
7
|
+
import QlManageConfigurations from './manage-configurations';
|
|
7
8
|
export default class QelosAdministratorSDK<T = any> extends QelosSDK {
|
|
8
|
-
users:
|
|
9
|
-
manageLayouts:
|
|
10
|
-
|
|
9
|
+
users: QlUsers<T>;
|
|
10
|
+
manageLayouts: QlManageLayouts;
|
|
11
|
+
manageConfigurations: QlManageConfigurations;
|
|
12
|
+
drafts: QlDrafts;
|
|
11
13
|
events: QlEvents;
|
|
12
14
|
constructor(options: QelosSDKOptions);
|
|
13
15
|
}
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import QelosSDK from '../index';
|
|
2
|
-
import
|
|
3
|
-
import GpManageLayouts from '../manage-layouts';
|
|
4
|
-
import GpDrafts from './drafts';
|
|
2
|
+
import QlDrafts from './drafts';
|
|
5
3
|
import QlEvents from './events';
|
|
4
|
+
import QlManageLayouts from './manage-layouts';
|
|
5
|
+
import QlUsers from './users';
|
|
6
|
+
import QlManageConfigurations from './manage-configurations';
|
|
6
7
|
export default class QelosAdministratorSDK extends QelosSDK {
|
|
7
8
|
users;
|
|
8
9
|
manageLayouts;
|
|
10
|
+
manageConfigurations;
|
|
9
11
|
drafts;
|
|
10
12
|
events;
|
|
11
13
|
constructor(options) {
|
|
12
14
|
super(options);
|
|
13
|
-
this.users = new
|
|
14
|
-
this.manageLayouts = new
|
|
15
|
-
this.
|
|
15
|
+
this.users = new QlUsers(options);
|
|
16
|
+
this.manageLayouts = new QlManageLayouts(options);
|
|
17
|
+
this.manageConfigurations = new QlManageConfigurations(options);
|
|
18
|
+
this.drafts = new QlDrafts(options);
|
|
16
19
|
this.events = new QlEvents(options);
|
|
17
20
|
}
|
|
18
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/administrator/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,OAAO,MAAM,
|
|
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;AAE7D,MAAM,CAAC,OAAO,OAAO,qBAA+B,SAAQ,QAAQ;IAClE,KAAK,CAAa;IAClB,aAAa,CAAkB;IAC/B,oBAAoB,CAAyB;IAC7C,MAAM,CAAW;IACjB,MAAM,CAAW;IAEjB,YAAY,OAAwB;QAClC,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,IAAI,OAAO,CAAI,OAAO,CAAC,CAAC;QACrC,IAAI,CAAC,aAAa,GAAG,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC;QAClD,IAAI,CAAC,oBAAoB,GAAG,IAAI,sBAAsB,CAAC,OAAO,CAAC,CAAC;QAChE,IAAI,CAAC,MAAM,GAAG,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAC;QACpC,IAAI,CAAC,MAAM,GAAG,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;CACF"}
|
|
@@ -37,7 +37,7 @@ export interface ILayout {
|
|
|
37
37
|
content: ILayoutContent[];
|
|
38
38
|
[key: string]: any;
|
|
39
39
|
}
|
|
40
|
-
export default class
|
|
40
|
+
export default class QlLayouts extends BaseSDK {
|
|
41
41
|
private relativePath;
|
|
42
42
|
constructor(options: QelosSDKOptions);
|
|
43
43
|
getLayout(kind: LayoutKind, extra?: Partial<RequestInit>): Promise<ILayout>;
|
|
@@ -17,7 +17,7 @@ export var LayoutConnectedDataKind;
|
|
|
17
17
|
LayoutConnectedDataKind["CATEGORY"] = "category";
|
|
18
18
|
LayoutConnectedDataKind["POST"] = "post";
|
|
19
19
|
})(LayoutConnectedDataKind || (LayoutConnectedDataKind = {}));
|
|
20
|
-
export default class
|
|
20
|
+
export default class QlLayouts extends BaseSDK {
|
|
21
21
|
relativePath = "/api/layouts";
|
|
22
22
|
constructor(options) {
|
|
23
23
|
super(options);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { QelosSDKOptions } from '../types';
|
|
2
|
+
import BaseSDK from '../base-sdk';
|
|
3
|
+
export interface ICustomConfiguration<T = any> {
|
|
4
|
+
key: string;
|
|
5
|
+
public: boolean;
|
|
6
|
+
kind?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
metadata: T;
|
|
9
|
+
}
|
|
10
|
+
export default class QlManageConfigurations extends BaseSDK {
|
|
11
|
+
private relativePath;
|
|
12
|
+
constructor(options: QelosSDKOptions);
|
|
13
|
+
getList(key: string, extra?: Partial<RequestInit>): Promise<ICustomConfiguration<any>[]>;
|
|
14
|
+
getConfiguration<T = any>(key: string, extra?: Partial<RequestInit>): Promise<ICustomConfiguration<T>>;
|
|
15
|
+
create<T>(config: ICustomConfiguration<T>, extra?: Partial<RequestInit>): Promise<ICustomConfiguration<T>>;
|
|
16
|
+
update<T>(key: string, changes: Partial<ICustomConfiguration<T>>, extra?: Partial<RequestInit>): Promise<ICustomConfiguration<T>>;
|
|
17
|
+
remove(key: string, extra?: Partial<RequestInit>): Promise<unknown>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import BaseSDK from '../base-sdk';
|
|
2
|
+
export default class QlManageConfigurations extends BaseSDK {
|
|
3
|
+
relativePath = '/api/configurations';
|
|
4
|
+
constructor(options) {
|
|
5
|
+
super(options);
|
|
6
|
+
}
|
|
7
|
+
getList(key, extra) {
|
|
8
|
+
return this.callJsonApi(this.relativePath, extra);
|
|
9
|
+
}
|
|
10
|
+
getConfiguration(key, extra) {
|
|
11
|
+
return this.callJsonApi(`${this.relativePath}/${key}`, extra);
|
|
12
|
+
}
|
|
13
|
+
create(config, extra) {
|
|
14
|
+
return this.callJsonApi(this.relativePath, {
|
|
15
|
+
method: 'post',
|
|
16
|
+
headers: { 'content-type': 'application/json' },
|
|
17
|
+
body: JSON.stringify(config),
|
|
18
|
+
...(extra || {}),
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
update(key, changes, extra) {
|
|
22
|
+
return this.callJsonApi(`${this.relativePath}/${key}`, {
|
|
23
|
+
method: 'put',
|
|
24
|
+
headers: { 'content-type': 'application/json' },
|
|
25
|
+
body: JSON.stringify(changes),
|
|
26
|
+
...(extra || {}),
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
remove(key, extra) {
|
|
30
|
+
return this.callJsonApi(`${this.relativePath}/${key}`, {
|
|
31
|
+
method: 'delete',
|
|
32
|
+
...(extra || {}),
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=manage-configurations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manage-configurations.js","sourceRoot":"","sources":["../../src/administrator/manage-configurations.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,aAAa,CAAC;AAUlC,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,OAAO;IACjD,YAAY,GAAG,qBAAqB,CAAC;IAE7C,YAAY,OAAwB;QAClC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAED,OAAO,CAAC,GAAW,EAAE,KAA4B;QAC/C,OAAO,IAAI,CAAC,WAAW,CAAyB,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IAC5E,CAAC;IAED,gBAAgB,CAAU,GAAW,EAAE,KAA4B;QACjE,OAAO,IAAI,CAAC,WAAW,CAA0B,GAAG,IAAI,CAAC,YAAY,IAAI,GAAG,EAAE,EAAE,KAAK,CAAC,CAAC;IACzF,CAAC;IAED,MAAM,CAAI,MAA+B,EAAE,KAA4B;QACrE,OAAO,IAAI,CAAC,WAAW,CAA0B,IAAI,CAAC,YAAY,EAAE;YAClE,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,EAAC,cAAc,EAAE,kBAAkB,EAAC;YAC7C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;YAC5B,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;SACjB,CAAC,CAAC;IACL,CAAC;IAED,MAAM,CAAI,GAAW,EAAE,OAAyC,EAAE,KAA4B;QAC5F,OAAO,IAAI,CAAC,WAAW,CAA0B,GAAG,IAAI,CAAC,YAAY,IAAI,GAAG,EAAE,EAAE;YAC9E,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,EAAC,cAAc,EAAE,kBAAkB,EAAC;YAC7C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;YAC7B,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;SACjB,CAAC,CAAC;IACL,CAAC;IAED,MAAM,CAAC,GAAW,EAAE,KAA4B;QAC9C,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,YAAY,IAAI,GAAG,EAAE,EAAE;YACrD,MAAM,EAAE,QAAQ;YAChB,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;SACjB,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { QelosSDKOptions } 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?: Partial<RequestInit>): Promise<ILayout>;
|
|
11
|
+
create(layout: ILayout, extra?: Partial<RequestInit>): Promise<ILayout>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,KAA4B;QAE5B,OAAO,IAAI,CAAC,WAAW,CAAU,GAAG,IAAI,CAAC,YAAY,IAAI,IAAI,EAAE,EAAE;YAC/D,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,EAAC,cAAc,EAAE,kBAAkB,EAAC;YAC7C,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,KAA4B;QAClD,OAAO,IAAI,CAAC,WAAW,CAAU,IAAI,CAAC,YAAY,EAAE;YAClD,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,EAAC,cAAc,EAAE,kBAAkB,EAAC;YAC7C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;YAC5B,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;SACjB,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -7,7 +7,7 @@ export interface IManagedUser<T = any> extends IUser {
|
|
|
7
7
|
export interface IManagedUserRequest<T = any> extends IManagedUser<T> {
|
|
8
8
|
password?: string;
|
|
9
9
|
}
|
|
10
|
-
export default class
|
|
10
|
+
export default class QlUsers<T = any, E = any> extends BaseSDK {
|
|
11
11
|
private options;
|
|
12
12
|
private relativePath;
|
|
13
13
|
constructor(options: QelosSDKOptions);
|
package/dist/authentication.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export interface ISignupInformation {
|
|
|
26
26
|
lastName: string;
|
|
27
27
|
birthDate: string;
|
|
28
28
|
}
|
|
29
|
-
export default class
|
|
29
|
+
export default class QlAuthentication extends BaseSDK {
|
|
30
30
|
#private;
|
|
31
31
|
get accessToken(): string;
|
|
32
32
|
constructor(options: QelosSDKOptions);
|
package/dist/authentication.js
CHANGED
package/dist/blocks.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export interface IBlock {
|
|
|
7
7
|
contentType?: 'content' | 'html';
|
|
8
8
|
[key: string]: any;
|
|
9
9
|
}
|
|
10
|
-
export default class
|
|
10
|
+
export default class QlBlocks extends BaseSDK {
|
|
11
11
|
private relativePath;
|
|
12
12
|
constructor(options: QelosSDKOptions);
|
|
13
13
|
getBlock(blockId: string): Promise<IBlock>;
|
package/dist/blocks.js
CHANGED
package/dist/categories.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export interface ICategory {
|
|
|
9
9
|
content?: string;
|
|
10
10
|
[key: string]: any;
|
|
11
11
|
}
|
|
12
|
-
export default class
|
|
12
|
+
export default class QlCategories extends BaseSDK {
|
|
13
13
|
private relativePath;
|
|
14
14
|
constructor(options: QelosSDKOptions);
|
|
15
15
|
getByPath(path: string, extra?: Partial<RequestInit>): Promise<ICategory>;
|
package/dist/categories.js
CHANGED
package/dist/configurations.d.ts
CHANGED
|
@@ -15,9 +15,13 @@ export interface IAppConfiguration {
|
|
|
15
15
|
websiteUrls: string[];
|
|
16
16
|
[key: string]: any;
|
|
17
17
|
}
|
|
18
|
-
export default class
|
|
18
|
+
export default class QlAppConfigurations extends BaseSDK {
|
|
19
19
|
private relativePath;
|
|
20
20
|
constructor(options: QelosSDKOptions);
|
|
21
|
-
getAppConfiguration(extra?: Partial<RequestInit>): Promise<
|
|
22
|
-
|
|
21
|
+
getAppConfiguration(extra?: Partial<RequestInit>): Promise<{
|
|
22
|
+
metadata: IAppConfiguration;
|
|
23
|
+
}>;
|
|
24
|
+
update(changes: Partial<IAppConfiguration>, extra?: Partial<RequestInit>): Promise<{
|
|
25
|
+
metadata: IAppConfiguration;
|
|
26
|
+
}>;
|
|
23
27
|
}
|
package/dist/configurations.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import BaseSDK from "./base-sdk";
|
|
2
|
-
export default class
|
|
2
|
+
export default class QlAppConfigurations extends BaseSDK {
|
|
3
3
|
relativePath = "/api/configurations/app-configuration";
|
|
4
4
|
constructor(options) {
|
|
5
5
|
super(options);
|
|
@@ -11,7 +11,7 @@ export default class GpConfigurations extends BaseSDK {
|
|
|
11
11
|
return this.callJsonApi(this.relativePath, {
|
|
12
12
|
method: "put",
|
|
13
13
|
headers: { 'content-type': 'application/json' },
|
|
14
|
-
body: JSON.stringify(changes),
|
|
14
|
+
body: JSON.stringify({ metadata: changes }),
|
|
15
15
|
...(extra || {}),
|
|
16
16
|
});
|
|
17
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configurations.js","sourceRoot":"","sources":["../src/configurations.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,YAAY,CAAC;AAmBjC,MAAM,CAAC,OAAO,OAAO,
|
|
1
|
+
{"version":3,"file":"configurations.js","sourceRoot":"","sources":["../src/configurations.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,YAAY,CAAC;AAmBjC,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,OAAO;IAC9C,YAAY,GAAG,uCAAuC,CAAC;IAE/D,YAAY,OAAwB;QAClC,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAED,mBAAmB,CAAC,KAA4B;QAC9C,OAAO,IAAI,CAAC,WAAW,CAAgC,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IACnF,CAAC;IAED,MAAM,CAAC,OAAmC,EAAE,KAA4B;QACtE,OAAO,IAAI,CAAC,WAAW,CAAgC,IAAI,CAAC,YAAY,EAAE;YACxE,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,EAAC,cAAc,EAAE,kBAAkB,EAAC;YAC7C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAC,QAAQ,EAAE,OAAO,EAAC,CAAC;YACzC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;SACjB,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import { QelosSDKOptions } from './types';
|
|
2
2
|
import BaseSDK from './base-sdk';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import GpLayouts from './administrator/layouts';
|
|
3
|
+
import QlCategories from './categories';
|
|
4
|
+
import QlMenus from './menus';
|
|
5
|
+
import QlAppConfigurations from './configurations';
|
|
6
|
+
import QlBlocks from './blocks';
|
|
7
|
+
import QlLayouts from './administrator/layouts';
|
|
8
|
+
import QlAuthentication from './authentication';
|
|
10
9
|
export default class QelosSDK extends BaseSDK {
|
|
11
10
|
private options;
|
|
12
|
-
categories:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
authentication: GpAuthentication;
|
|
11
|
+
categories: QlCategories;
|
|
12
|
+
menus: QlMenus;
|
|
13
|
+
blocks: QlBlocks;
|
|
14
|
+
layouts: QlLayouts;
|
|
15
|
+
appConfigurations: QlAppConfigurations;
|
|
16
|
+
authentication: QlAuthentication;
|
|
19
17
|
constructor(options: QelosSDKOptions);
|
|
20
18
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,30 +1,27 @@
|
|
|
1
1
|
import BaseSDK from './base-sdk';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import GpLayouts from './administrator/layouts';
|
|
2
|
+
import QlCategories from './categories';
|
|
3
|
+
import QlMenus from './menus';
|
|
4
|
+
import QlAppConfigurations from './configurations';
|
|
5
|
+
import QlBlocks from './blocks';
|
|
6
|
+
import QlLayouts from './administrator/layouts';
|
|
7
|
+
import QlAuthentication from './authentication';
|
|
9
8
|
export default class QelosSDK extends BaseSDK {
|
|
10
9
|
options;
|
|
11
10
|
categories;
|
|
12
|
-
posts;
|
|
13
11
|
menus;
|
|
14
12
|
blocks;
|
|
15
13
|
layouts;
|
|
16
|
-
|
|
14
|
+
appConfigurations;
|
|
17
15
|
authentication;
|
|
18
16
|
constructor(options) {
|
|
19
17
|
super(options);
|
|
20
18
|
this.options = options;
|
|
21
|
-
this.categories = new
|
|
22
|
-
this.
|
|
23
|
-
this.
|
|
24
|
-
this.
|
|
25
|
-
this.
|
|
26
|
-
this.
|
|
27
|
-
this.authentication = new GpAuthentication(this.options);
|
|
19
|
+
this.categories = new QlCategories(this.options);
|
|
20
|
+
this.menus = new QlMenus(this.options);
|
|
21
|
+
this.blocks = new QlBlocks(this.options);
|
|
22
|
+
this.layouts = new QlLayouts(this.options);
|
|
23
|
+
this.appConfigurations = new QlAppConfigurations(this.options);
|
|
24
|
+
this.authentication = new QlAuthentication(this.options);
|
|
28
25
|
if (!options.getAccessToken) {
|
|
29
26
|
options.getAccessToken = () => this.authentication.accessToken;
|
|
30
27
|
}
|
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,YAAY,MAAM,cAAc,CAAC;AACxC,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,YAAY,MAAM,cAAc,CAAC;AACxC,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,mBAAmB,MAAM,kBAAkB,CAAC;AAEnD,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAChD,OAAO,gBAAgB,MAAM,kBAAkB,CAAC;AAEhD,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,OAAO;IASvB;IAPpB,UAAU,CAAe;IACzB,KAAK,CAAU;IACf,MAAM,CAAW;IACjB,OAAO,CAAY;IACnB,iBAAiB,CAAsB;IACvC,cAAc,CAAmB;IAEjC,YAAoB,OAAwB;QAC1C,KAAK,CAAC,OAAO,CAAC,CAAC;QADG,YAAO,GAAP,OAAO,CAAiB;QAE1C,IAAI,CAAC,UAAU,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACjD,IAAI,CAAC,KAAK,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvC,IAAI,CAAC,MAAM,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzC,IAAI,CAAC,OAAO,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC3C,IAAI,CAAC,iBAAiB,GAAG,IAAI,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC/D,IAAI,CAAC,cAAc,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAEzD,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE;YAC3B,OAAO,CAAC,cAAc,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC;SAChE;QACD,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE;YACzB,OAAO,CAAC,YAAY,GAAG,GAAG,EAAE;gBAC1B,MAAM,KAAK,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;gBACvC,IAAI,KAAK,EAAE;oBACT,OAAO,EAAC,aAAa,EAAE,SAAS,GAAG,KAAK,EAAC,CAAA;iBAC1C;gBACD,OAAO,EAAE,CAAA;YACX,CAAC,CAAA;SACF;IACH,CAAC;CAEF"}
|
package/dist/menus.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export interface IMenu {
|
|
|
25
25
|
links: MenuLink[];
|
|
26
26
|
[key: string]: any;
|
|
27
27
|
}
|
|
28
|
-
export default class
|
|
28
|
+
export default class QlMenus extends BaseSDK {
|
|
29
29
|
private relativePath;
|
|
30
30
|
constructor(options: QelosSDKOptions);
|
|
31
31
|
getMenu(name: string): Promise<IMenu>;
|
package/dist/menus.js
CHANGED
package/dist/posts.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export declare type GetPostsListOptions = {
|
|
|
29
29
|
offset?: string;
|
|
30
30
|
category: string;
|
|
31
31
|
};
|
|
32
|
-
export default class
|
|
32
|
+
export default class QlPosts extends BaseSDK {
|
|
33
33
|
private relativePath;
|
|
34
34
|
constructor(options: QelosSDKOptions);
|
|
35
35
|
getByPath(categoryPath: string, postPath: string, extra?: Partial<RequestInit>): Promise<IPost>;
|
package/dist/posts.js
CHANGED
|
@@ -4,7 +4,7 @@ export var PostContentState;
|
|
|
4
4
|
PostContentState["EDITOR"] = "editor";
|
|
5
5
|
PostContentState["HTML"] = "html";
|
|
6
6
|
})(PostContentState || (PostContentState = {}));
|
|
7
|
-
export default class
|
|
7
|
+
export default class QlPosts extends BaseSDK {
|
|
8
8
|
relativePath = "/api/posts";
|
|
9
9
|
constructor(options) {
|
|
10
10
|
super(options);
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@ export interface IDraft extends IDraftMetadata {
|
|
|
14
14
|
tenant?: string;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
export default class
|
|
17
|
+
export default class QlDrafts extends BaseSDK {
|
|
18
18
|
private relativePath = '/api/drafts';
|
|
19
19
|
|
|
20
20
|
constructor(options: QelosSDKOptions) {
|
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
import QelosSDK from '../index';
|
|
2
2
|
import {QelosSDKOptions} from '../types';
|
|
3
|
-
import
|
|
4
|
-
import GpManageLayouts from '../manage-layouts';
|
|
5
|
-
import GpDrafts from './drafts';
|
|
3
|
+
import QlDrafts from './drafts';
|
|
6
4
|
import QlEvents from './events';
|
|
5
|
+
import QlManageLayouts from './manage-layouts';
|
|
6
|
+
import QlUsers from './users';
|
|
7
|
+
import QlManageConfigurations from './manage-configurations';
|
|
7
8
|
|
|
8
9
|
export default class QelosAdministratorSDK<T = any> extends QelosSDK {
|
|
9
|
-
users:
|
|
10
|
-
manageLayouts:
|
|
11
|
-
|
|
10
|
+
users: QlUsers<T>;
|
|
11
|
+
manageLayouts: QlManageLayouts;
|
|
12
|
+
manageConfigurations: QlManageConfigurations;
|
|
13
|
+
drafts: QlDrafts;
|
|
12
14
|
events: QlEvents;
|
|
13
15
|
|
|
14
16
|
constructor(options: QelosSDKOptions) {
|
|
15
17
|
super(options);
|
|
16
|
-
this.users = new
|
|
17
|
-
this.manageLayouts = new
|
|
18
|
-
this.
|
|
18
|
+
this.users = new QlUsers<T>(options);
|
|
19
|
+
this.manageLayouts = new QlManageLayouts(options);
|
|
20
|
+
this.manageConfigurations = new QlManageConfigurations(options);
|
|
21
|
+
this.drafts = new QlDrafts(options);
|
|
19
22
|
this.events = new QlEvents(options);
|
|
20
23
|
}
|
|
21
24
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {QelosSDKOptions} from '../types';
|
|
2
|
+
import BaseSDK from '../base-sdk';
|
|
3
|
+
|
|
4
|
+
export interface ICustomConfiguration<T = any> {
|
|
5
|
+
key: string;
|
|
6
|
+
public: boolean;
|
|
7
|
+
kind?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
metadata: T
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default class QlManageConfigurations extends BaseSDK {
|
|
13
|
+
private relativePath = '/api/configurations';
|
|
14
|
+
|
|
15
|
+
constructor(options: QelosSDKOptions) {
|
|
16
|
+
super(options);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
getList(key: string, extra?: Partial<RequestInit>) {
|
|
20
|
+
return this.callJsonApi<ICustomConfiguration[]>(this.relativePath, extra);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
getConfiguration<T = any>(key: string, extra?: Partial<RequestInit>) {
|
|
24
|
+
return this.callJsonApi<ICustomConfiguration<T>>(`${this.relativePath}/${key}`, extra);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
create<T>(config: ICustomConfiguration<T>, extra?: Partial<RequestInit>) {
|
|
28
|
+
return this.callJsonApi<ICustomConfiguration<T>>(this.relativePath, {
|
|
29
|
+
method: 'post',
|
|
30
|
+
headers: {'content-type': 'application/json'},
|
|
31
|
+
body: JSON.stringify(config),
|
|
32
|
+
...(extra || {}),
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
update<T>(key: string, changes: Partial<ICustomConfiguration<T>>, extra?: Partial<RequestInit>): Promise<ICustomConfiguration<T>> {
|
|
37
|
+
return this.callJsonApi<ICustomConfiguration<T>>(`${this.relativePath}/${key}`, {
|
|
38
|
+
method: 'put',
|
|
39
|
+
headers: {'content-type': 'application/json'},
|
|
40
|
+
body: JSON.stringify(changes),
|
|
41
|
+
...(extra || {}),
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
remove(key: string, extra?: Partial<RequestInit>) {
|
|
46
|
+
return this.callJsonApi(`${this.relativePath}/${key}`, {
|
|
47
|
+
method: 'delete',
|
|
48
|
+
...(extra || {}),
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { QelosSDKOptions } from "
|
|
2
|
-
import BaseSDK from "
|
|
3
|
-
import {ILayout, LayoutKind} from './
|
|
1
|
+
import { QelosSDKOptions } from "../types";
|
|
2
|
+
import BaseSDK from "../base-sdk";
|
|
3
|
+
import {ILayout, LayoutKind} from './layouts';
|
|
4
4
|
|
|
5
|
-
export default class
|
|
5
|
+
export default class QlManageLayouts extends BaseSDK {
|
|
6
6
|
private relativePath = "/api/layouts";
|
|
7
7
|
|
|
8
8
|
constructor(options: QelosSDKOptions) {
|
|
@@ -10,7 +10,7 @@ export interface IManagedUserRequest<T = any> extends IManagedUser<T> {
|
|
|
10
10
|
password?: string;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export default class
|
|
13
|
+
export default class QlUsers<T = any, E = any> extends BaseSDK {
|
|
14
14
|
private relativePath = '/api/users';
|
|
15
15
|
|
|
16
16
|
constructor(private options: QelosSDKOptions) {
|
package/src/authentication.ts
CHANGED
package/src/blocks.ts
CHANGED
package/src/categories.ts
CHANGED
|
@@ -11,7 +11,7 @@ export interface ICategory {
|
|
|
11
11
|
[key: string]: any;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export default class
|
|
14
|
+
export default class QlCategories extends BaseSDK {
|
|
15
15
|
private relativePath = "/api/categories";
|
|
16
16
|
|
|
17
17
|
constructor(options: QelosSDKOptions) {
|
package/src/configurations.ts
CHANGED
|
@@ -18,7 +18,7 @@ export interface IAppConfiguration {
|
|
|
18
18
|
[key: string]: any;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
export default class
|
|
21
|
+
export default class QlAppConfigurations extends BaseSDK {
|
|
22
22
|
private relativePath = "/api/configurations/app-configuration";
|
|
23
23
|
|
|
24
24
|
constructor(options: QelosSDKOptions) {
|
|
@@ -26,14 +26,14 @@ export default class GpConfigurations extends BaseSDK {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
getAppConfiguration(extra?: Partial<RequestInit>) {
|
|
29
|
-
return this.callJsonApi<IAppConfiguration>(this.relativePath, extra);
|
|
29
|
+
return this.callJsonApi<{metadata: IAppConfiguration}>(this.relativePath, extra);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
update(changes: Partial<IAppConfiguration>, extra?: Partial<RequestInit>): Promise<IAppConfiguration> {
|
|
33
|
-
return this.callJsonApi<IAppConfiguration>(this.relativePath, {
|
|
32
|
+
update(changes: Partial<IAppConfiguration>, extra?: Partial<RequestInit>): Promise<{metadata: IAppConfiguration}> {
|
|
33
|
+
return this.callJsonApi<{metadata: IAppConfiguration}>(this.relativePath, {
|
|
34
34
|
method: "put",
|
|
35
35
|
headers: {'content-type': 'application/json'},
|
|
36
|
-
body: JSON.stringify(changes),
|
|
36
|
+
body: JSON.stringify({metadata: changes}),
|
|
37
37
|
...(extra || {}),
|
|
38
38
|
});
|
|
39
39
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,32 +1,31 @@
|
|
|
1
1
|
import {QelosSDKOptions} from './types';
|
|
2
2
|
import BaseSDK from './base-sdk';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import GpConfigurations from './configurations';
|
|
3
|
+
import QlCategories from './categories';
|
|
4
|
+
import QlMenus from './menus';
|
|
5
|
+
import QlAppConfigurations from './configurations';
|
|
7
6
|
import GpAuthentication from './authentication';
|
|
8
|
-
import
|
|
7
|
+
import QlBlocks from './blocks';
|
|
9
8
|
import GpLayouts from './administrator/layouts';
|
|
9
|
+
import QlLayouts from './administrator/layouts';
|
|
10
|
+
import QlAuthentication from './authentication';
|
|
10
11
|
|
|
11
12
|
export default class QelosSDK extends BaseSDK {
|
|
12
13
|
|
|
13
|
-
categories:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
authentication: GpAuthentication;
|
|
14
|
+
categories: QlCategories;
|
|
15
|
+
menus: QlMenus;
|
|
16
|
+
blocks: QlBlocks;
|
|
17
|
+
layouts: QlLayouts;
|
|
18
|
+
appConfigurations: QlAppConfigurations;
|
|
19
|
+
authentication: QlAuthentication;
|
|
20
20
|
|
|
21
21
|
constructor(private options: QelosSDKOptions) {
|
|
22
22
|
super(options);
|
|
23
|
-
this.categories = new
|
|
24
|
-
this.
|
|
25
|
-
this.
|
|
26
|
-
this.
|
|
27
|
-
this.
|
|
28
|
-
this.
|
|
29
|
-
this.authentication = new GpAuthentication(this.options);
|
|
23
|
+
this.categories = new QlCategories(this.options);
|
|
24
|
+
this.menus = new QlMenus(this.options);
|
|
25
|
+
this.blocks = new QlBlocks(this.options);
|
|
26
|
+
this.layouts = new QlLayouts(this.options);
|
|
27
|
+
this.appConfigurations = new QlAppConfigurations(this.options);
|
|
28
|
+
this.authentication = new QlAuthentication(this.options);
|
|
30
29
|
|
|
31
30
|
if (!options.getAccessToken) {
|
|
32
31
|
options.getAccessToken = () => this.authentication.accessToken;
|
package/src/menus.ts
CHANGED
package/src/posts.ts
CHANGED