@qelos/sdk 3.0.1 → 3.1.1

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.
Files changed (46) hide show
  1. package/dist/administrator/drafts.d.ts +1 -1
  2. package/dist/administrator/drafts.js +1 -1
  3. package/dist/administrator/index.d.ts +8 -6
  4. package/dist/administrator/index.js +9 -6
  5. package/dist/administrator/index.js.map +1 -1
  6. package/dist/administrator/layouts.d.ts +1 -1
  7. package/dist/administrator/layouts.js +1 -1
  8. package/dist/administrator/manage-configurations.d.ts +18 -0
  9. package/dist/administrator/manage-configurations.js +36 -0
  10. package/dist/administrator/manage-configurations.js.map +1 -0
  11. package/dist/administrator/manage-layouts.d.ts +12 -0
  12. package/dist/administrator/manage-layouts.js +36 -0
  13. package/dist/administrator/manage-layouts.js.map +1 -0
  14. package/dist/administrator/users.d.ts +3 -3
  15. package/dist/administrator/users.js +9 -5
  16. package/dist/administrator/users.js.map +1 -1
  17. package/dist/authentication.d.ts +1 -1
  18. package/dist/authentication.js +1 -1
  19. package/dist/blocks.d.ts +1 -1
  20. package/dist/blocks.js +1 -1
  21. package/dist/categories.d.ts +1 -1
  22. package/dist/categories.js +1 -1
  23. package/dist/configurations.d.ts +7 -3
  24. package/dist/configurations.js +2 -2
  25. package/dist/configurations.js.map +1 -1
  26. package/dist/index.d.ts +12 -14
  27. package/dist/index.js +13 -16
  28. package/dist/index.js.map +1 -1
  29. package/dist/menus.d.ts +1 -1
  30. package/dist/menus.js +1 -1
  31. package/dist/posts.d.ts +1 -1
  32. package/dist/posts.js +1 -1
  33. package/package.json +1 -1
  34. package/src/administrator/drafts.ts +1 -1
  35. package/src/administrator/index.ts +12 -9
  36. package/src/administrator/layouts.ts +1 -1
  37. package/src/administrator/manage-configurations.ts +51 -0
  38. package/src/{manage-layouts.ts → administrator/manage-layouts.ts} +4 -4
  39. package/src/administrator/users.ts +9 -5
  40. package/src/authentication.ts +1 -1
  41. package/src/blocks.ts +1 -1
  42. package/src/categories.ts +1 -1
  43. package/src/configurations.ts +5 -5
  44. package/src/index.ts +18 -19
  45. package/src/menus.ts +1 -1
  46. 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 GpDrafts extends BaseSDK {
14
+ export default class QlDrafts extends BaseSDK {
15
15
  #private;
16
16
  private relativePath;
17
17
  constructor(options: QelosSDKOptions);
@@ -1,5 +1,5 @@
1
1
  import BaseSDK from '../base-sdk';
2
- export default class GpDrafts extends BaseSDK {
2
+ export default class QlDrafts extends BaseSDK {
3
3
  relativePath = '/api/drafts';
4
4
  constructor(options) {
5
5
  super(options);
@@ -1,13 +1,15 @@
1
1
  import QelosSDK from '../index';
2
2
  import { QelosSDKOptions } from '../types';
3
- import GpUsers from './users';
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: GpUsers<T>;
9
- manageLayouts: GpManageLayouts;
10
- drafts: GpDrafts;
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 GpUsers from './users';
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 GpUsers(options);
14
- this.manageLayouts = new GpManageLayouts(options);
15
- this.drafts = new GpDrafts(options);
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,SAAS,CAAC;AAC9B,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,MAAM,CAAC,OAAO,OAAO,qBAA+B,SAAQ,QAAQ;IAClE,KAAK,CAAa;IAClB,aAAa,CAAkB;IAC/B,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,MAAM,GAAG,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAC;QACpC,IAAI,CAAC,MAAM,GAAG,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;CACF"}
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 GpLayouts extends BaseSDK {
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 GpLayouts extends BaseSDK {
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":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;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
+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Ac,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 GpUsers<T = any, E = any> extends BaseSDK {
10
+ export default class QlUsers<T = any, E = any> extends BaseSDK {
11
11
  private options;
12
12
  private relativePath;
13
13
  constructor(options: QelosSDKOptions);
@@ -19,6 +19,6 @@ export default class GpUsers<T = any, E = any> extends BaseSDK {
19
19
  remove(userId: string): Promise<any>;
20
20
  update<Z = T>(userId: string, changes: Partial<IManagedUserRequest<Z>>): Promise<IManagedUser>;
21
21
  create<Z = T>(user: Omit<IManagedUserRequest<Z>, '_id' | 'fullName' | 'birthDate'>): Promise<IManagedUser<Z>>;
22
- getEncryptedData<Z = E>(userId: string): Promise<IManagedUser<Z>>;
23
- setEncryptedData<Z = E>(userId: string, data: Z): Promise<void>;
22
+ getEncryptedData<Z = E>(userId: string, encryptedId?: string): Promise<IManagedUser<Z>>;
23
+ setEncryptedData<Z = E>(userId: string, encryptedId: string, data: Z): Promise<void>;
24
24
  }
@@ -1,5 +1,5 @@
1
1
  import BaseSDK from '../base-sdk';
2
- export default class GpUsers extends BaseSDK {
2
+ export default class QlUsers extends BaseSDK {
3
3
  options;
4
4
  relativePath = '/api/users';
5
5
  constructor(options) {
@@ -32,13 +32,17 @@ export default class GpUsers extends BaseSDK {
32
32
  body: JSON.stringify(user)
33
33
  });
34
34
  }
35
- getEncryptedData(userId) {
36
- return this.callJsonApi(`${this.relativePath}/${userId}/encrypted`);
35
+ getEncryptedData(userId, encryptedId = '') {
36
+ return this.callJsonApi(`${this.relativePath}/${userId}/encrypted`, {
37
+ headers: {
38
+ 'x-encrypted-id': encryptedId
39
+ }
40
+ });
37
41
  }
38
- async setEncryptedData(userId, data) {
42
+ async setEncryptedData(userId, encryptedId = '', data) {
39
43
  const res = await this.callApi(`${this.relativePath}/${userId}/encrypted`, {
40
44
  method: 'post',
41
- headers: { 'content-type': 'application/json' },
45
+ headers: { 'content-type': 'application/json', 'x-encrypted-id': encryptedId },
42
46
  body: JSON.stringify(data)
43
47
  });
44
48
  if (res.status >= 300) {
@@ -1 +1 @@
1
- {"version":3,"file":"users.js","sourceRoot":"","sources":["../../src/administrator/users.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,aAAa,CAAC;AAWlC,MAAM,CAAC,OAAO,OAAO,OAA0B,SAAQ,OAAO;IAGxC;IAFZ,YAAY,GAAG,YAAY,CAAC;IAEpC,YAAoB,OAAwB;QAC1C,KAAK,CAAC,OAAO,CAAC,CAAA;QADI,YAAO,GAAP,OAAO,CAAiB;IAE5C,CAAC;IAED,OAAO,CAAQ,MAAc;QAC3B,OAAO,IAAI,CAAC,WAAW,CAAkB,GAAG,IAAI,CAAC,YAAY,IAAI,MAAM,EAAE,CAAC,CAAA;IAC5E,CAAC;IAED,OAAO,CAAC,OAA4C;QAClD,OAAO,IAAI,CAAC,WAAW,CACrB,IAAI,CAAC,YAAY;YACjB,CAAC,OAAO,CAAC,CAAC;gBACR,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;gBAClF,EAAE,CAAC,CACN,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,MAAc;QACnB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,YAAY,IAAI,MAAM,EAAE,EAAE,EAAC,MAAM,EAAE,QAAQ,EAAC,CAAC,CAAC;IAC5E,CAAC;IAED,MAAM,CAAQ,MAAc,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AAS,CAAC,IAAI,CAAC;SAC3B,CAAC,CAAA;IACJ,CAAC;IAED,gBAAgB,CAAQ,MAAc,EAAE,cAAsB,EAAE;QAC9D,OAAO,IAAI,CAAC,WAAW,CAAkB,GAAG,IAAI,CAAC,YAAY,IAAI,MAAM,YAAY,EAAE;YACnF,OAAO,EAAE;gBACP,gBAAgB,EAAE,WAAW;aAC9B;SACF,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAQ,MAAc,EAAE,cAAsB,EAAE,EAAE,IAAO;QAC7E,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,YAAY,IAAI,MAAM,YAAY,EAAE;YACzE,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,EAAC,cAAc,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,WAAW,EAAC;YAC5E,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;SAC3B,CAAC,CAAA;QACF,IAAI,GAAG,CAAC,MAAM,IAAI,GAAG,EAAE;YACrB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAA;SAChD;IACH,CAAC;CACF"}
@@ -26,7 +26,7 @@ export interface ISignupInformation {
26
26
  lastName: string;
27
27
  birthDate: string;
28
28
  }
29
- export default class GpAuthentication extends BaseSDK {
29
+ export default class QlAuthentication extends BaseSDK {
30
30
  #private;
31
31
  get accessToken(): string;
32
32
  constructor(options: QelosSDKOptions);
@@ -1,5 +1,5 @@
1
1
  import BaseSDK from './base-sdk';
2
- export default class GpAuthentication extends BaseSDK {
2
+ export default class QlAuthentication extends BaseSDK {
3
3
  #refreshToken;
4
4
  #accessToken;
5
5
  get accessToken() {
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 GpBlocks extends BaseSDK {
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
@@ -1,5 +1,5 @@
1
1
  import BaseSDK from './base-sdk';
2
- export default class GpBlocks extends BaseSDK {
2
+ export default class QlBlocks extends BaseSDK {
3
3
  relativePath = '/api/blocks';
4
4
  constructor(options) {
5
5
  super(options);
@@ -9,7 +9,7 @@ export interface ICategory {
9
9
  content?: string;
10
10
  [key: string]: any;
11
11
  }
12
- export default class GpCategories extends BaseSDK {
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>;
@@ -1,5 +1,5 @@
1
1
  import BaseSDK from "./base-sdk";
2
- export default class GpCategories extends BaseSDK {
2
+ export default class QlCategories extends BaseSDK {
3
3
  relativePath = "/api/categories";
4
4
  constructor(options) {
5
5
  super(options);
@@ -15,9 +15,13 @@ export interface IAppConfiguration {
15
15
  websiteUrls: string[];
16
16
  [key: string]: any;
17
17
  }
18
- export default class GpConfigurations extends BaseSDK {
18
+ export default class QlAppConfigurations extends BaseSDK {
19
19
  private relativePath;
20
20
  constructor(options: QelosSDKOptions);
21
- getAppConfiguration(extra?: Partial<RequestInit>): Promise<IAppConfiguration>;
22
- update(changes: Partial<IAppConfiguration>, extra?: Partial<RequestInit>): Promise<IAppConfiguration>;
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
  }
@@ -1,5 +1,5 @@
1
1
  import BaseSDK from "./base-sdk";
2
- export default class GpConfigurations extends BaseSDK {
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,gBAAiB,SAAQ,OAAO;IAC3C,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,CAAoB,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IACvE,CAAC;IAED,MAAM,CAAC,OAAmC,EAAE,KAA4B;QACtE,OAAO,IAAI,CAAC,WAAW,CAAoB,IAAI,CAAC,YAAY,EAAE;YAC5D,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;CACF"}
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 GpCategories from './categories';
4
- import GpPosts from './posts';
5
- import GpMenus from './menus';
6
- import GpConfigurations from './configurations';
7
- import GpAuthentication from './authentication';
8
- import GpBlocks from './blocks';
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: GpCategories;
13
- posts: GpPosts;
14
- menus: GpMenus;
15
- blocks: GpBlocks;
16
- layouts: GpLayouts;
17
- configurations: GpConfigurations;
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 GpCategories from './categories';
3
- import GpPosts from './posts';
4
- import GpMenus from './menus';
5
- import GpConfigurations from './configurations';
6
- import GpAuthentication from './authentication';
7
- import GpBlocks from './blocks';
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
- configurations;
14
+ appConfigurations;
17
15
  authentication;
18
16
  constructor(options) {
19
17
  super(options);
20
18
  this.options = options;
21
- this.categories = new GpCategories(this.options);
22
- this.posts = new GpPosts(this.options);
23
- this.menus = new GpMenus(this.options);
24
- this.blocks = new GpBlocks(this.options);
25
- this.layouts = new GpLayouts(this.options);
26
- this.configurations = new GpConfigurations(this.options);
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,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,gBAAgB,MAAM,kBAAkB,CAAC;AAChD,OAAO,gBAAgB,MAAM,kBAAkB,CAAC;AAChD,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAEhD,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,OAAO;IAUvB;IARpB,UAAU,CAAe;IACzB,KAAK,CAAU;IACf,KAAK,CAAU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G,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 GpMenus extends BaseSDK {
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
@@ -1,5 +1,5 @@
1
1
  import BaseSDK from './base-sdk';
2
- export default class GpMenus extends BaseSDK {
2
+ export default class QlMenus extends BaseSDK {
3
3
  relativePath = '/api/menus';
4
4
  constructor(options) {
5
5
  super(options);
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 GpPosts extends BaseSDK {
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 GpPosts extends BaseSDK {
7
+ export default class QlPosts extends BaseSDK {
8
8
  relativePath = "/api/posts";
9
9
  constructor(options) {
10
10
  super(options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qelos/sdk",
3
- "version": "3.0.1",
3
+ "version": "3.1.1",
4
4
  "description": "SDK for Qelos API",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {
@@ -14,7 +14,7 @@ export interface IDraft extends IDraftMetadata {
14
14
  tenant?: string;
15
15
  }
16
16
 
17
- export default class GpDrafts extends BaseSDK {
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 GpUsers from './users';
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: GpUsers<T>;
10
- manageLayouts: GpManageLayouts;
11
- drafts: GpDrafts;
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 GpUsers<T>(options);
17
- this.manageLayouts = new GpManageLayouts(options);
18
- this.drafts = new GpDrafts(options);
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
  }
@@ -43,7 +43,7 @@ export interface ILayout {
43
43
  [key: string]: any;
44
44
  }
45
45
 
46
- export default class GpLayouts extends BaseSDK {
46
+ export default class QlLayouts extends BaseSDK {
47
47
  private relativePath = "/api/layouts";
48
48
 
49
49
  constructor(options: QelosSDKOptions) {
@@ -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 "./types";
2
- import BaseSDK from "./base-sdk";
3
- import {ILayout, LayoutKind} from './administrator/layouts';
1
+ import { QelosSDKOptions } from "../types";
2
+ import BaseSDK from "../base-sdk";
3
+ import {ILayout, LayoutKind} from './layouts';
4
4
 
5
- export default class GpManageLayouts extends BaseSDK {
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 GpUsers<T = any, E = any> extends BaseSDK {
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) {
@@ -53,14 +53,18 @@ export default class GpUsers<T = any, E = any> extends BaseSDK {
53
53
  })
54
54
  }
55
55
 
56
- getEncryptedData<Z = E>(userId: string) {
57
- return this.callJsonApi<IManagedUser<Z>>(`${this.relativePath}/${userId}/encrypted`)
56
+ getEncryptedData<Z = E>(userId: string, encryptedId: string = '') {
57
+ return this.callJsonApi<IManagedUser<Z>>(`${this.relativePath}/${userId}/encrypted`, {
58
+ headers: {
59
+ 'x-encrypted-id': encryptedId
60
+ }
61
+ })
58
62
  }
59
63
 
60
- async setEncryptedData<Z = E>(userId: string, data: Z): Promise<void> {
64
+ async setEncryptedData<Z = E>(userId: string, encryptedId: string = '', data: Z): Promise<void> {
61
65
  const res = await this.callApi(`${this.relativePath}/${userId}/encrypted`, {
62
66
  method: 'post',
63
- headers: {'content-type': 'application/json'},
67
+ headers: {'content-type': 'application/json', 'x-encrypted-id': encryptedId},
64
68
  body: JSON.stringify(data)
65
69
  })
66
70
  if (res.status >= 300) {
@@ -32,7 +32,7 @@ export interface ISignupInformation {
32
32
  birthDate: string;
33
33
  }
34
34
 
35
- export default class GpAuthentication extends BaseSDK {
35
+ export default class QlAuthentication extends BaseSDK {
36
36
 
37
37
  #refreshToken: string;
38
38
  #accessToken: string;
package/src/blocks.ts CHANGED
@@ -10,7 +10,7 @@ export interface IBlock {
10
10
  [key: string]: any;
11
11
  }
12
12
 
13
- export default class GpBlocks extends BaseSDK {
13
+ export default class QlBlocks extends BaseSDK {
14
14
  private relativePath = '/api/blocks';
15
15
 
16
16
  constructor(options: QelosSDKOptions) {
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 GpCategories extends BaseSDK {
14
+ export default class QlCategories extends BaseSDK {
15
15
  private relativePath = "/api/categories";
16
16
 
17
17
  constructor(options: QelosSDKOptions) {
@@ -18,7 +18,7 @@ export interface IAppConfiguration {
18
18
  [key: string]: any;
19
19
  }
20
20
 
21
- export default class GpConfigurations extends BaseSDK {
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 GpCategories from './categories';
4
- import GpPosts from './posts';
5
- import GpMenus from './menus';
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 GpBlocks from './blocks';
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: GpCategories;
14
- posts: GpPosts;
15
- menus: GpMenus;
16
- blocks: GpBlocks;
17
- layouts: GpLayouts;
18
- configurations: GpConfigurations;
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 GpCategories(this.options);
24
- this.posts = new GpPosts(this.options);
25
- this.menus = new GpMenus(this.options);
26
- this.blocks = new GpBlocks(this.options);
27
- this.layouts = new GpLayouts(this.options);
28
- this.configurations = new GpConfigurations(this.options);
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
@@ -29,7 +29,7 @@ export interface IMenu {
29
29
  [key: string]: any;
30
30
  }
31
31
 
32
- export default class GpMenus extends BaseSDK {
32
+ export default class QlMenus extends BaseSDK {
33
33
  private relativePath = '/api/menus';
34
34
 
35
35
  constructor(options: QelosSDKOptions) {
package/src/posts.ts CHANGED
@@ -34,7 +34,7 @@ export type GetPostsListOptions = {
34
34
  category: string;
35
35
  };
36
36
 
37
- export default class GpPosts extends BaseSDK {
37
+ export default class QlPosts extends BaseSDK {
38
38
  private relativePath = "/api/posts";
39
39
 
40
40
  constructor(options: QelosSDKOptions) {