@qelos/sdk 3.6.6 → 3.7.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.
@@ -1,5 +1,5 @@
1
- import { QelosSDKOptions } from "../types";
2
- import BaseSDK from "../base-sdk";
1
+ import { QelosSDKOptions, RequestExtra } from '../types';
2
+ import BaseSDK from '../base-sdk';
3
3
  import { ILayout, LayoutKind } from './layouts';
4
4
  export default class QlManageLayouts extends BaseSDK {
5
5
  private relativePath;
@@ -7,6 +7,6 @@ export default class QlManageLayouts extends BaseSDK {
7
7
  getLayout(kind: LayoutKind, extra?: Partial<RequestInit>): Promise<ILayout>;
8
8
  getList(extra?: Partial<RequestInit>): Promise<ILayout[]>;
9
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>;
10
+ update(kind: LayoutKind, changes: Partial<ILayout>, extra?: RequestExtra): Promise<ILayout>;
11
+ create(layout: ILayout, extra?: RequestExtra): Promise<ILayout>;
12
12
  }
@@ -1,6 +1,6 @@
1
- import BaseSDK from "../base-sdk";
1
+ import BaseSDK from '../base-sdk';
2
2
  export default class QlManageLayouts extends BaseSDK {
3
- relativePath = "/api/layouts";
3
+ relativePath = '/api/layouts';
4
4
  constructor(options) {
5
5
  super(options);
6
6
  }
@@ -12,13 +12,13 @@ export default class QlManageLayouts extends BaseSDK {
12
12
  }
13
13
  remove(kind, extra) {
14
14
  return this.callApi(`${this.relativePath}/${kind}`, {
15
- method: "delete",
15
+ method: 'delete',
16
16
  ...(extra || {}),
17
17
  });
18
18
  }
19
19
  update(kind, changes, extra) {
20
20
  return this.callJsonApi(`${this.relativePath}/${kind}`, {
21
- method: "put",
21
+ method: 'put',
22
22
  headers: { 'content-type': 'application/json' },
23
23
  body: JSON.stringify(changes),
24
24
  ...(extra || {}),
@@ -26,7 +26,7 @@ export default class QlManageLayouts extends BaseSDK {
26
26
  }
27
27
  create(layout, extra) {
28
28
  return this.callJsonApi(this.relativePath, {
29
- method: "post",
29
+ method: 'post',
30
30
  headers: { 'content-type': 'application/json' },
31
31
  body: JSON.stringify(layout),
32
32
  ...(extra || {}),
@@ -1 +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;YAC7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AY,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,4 +1,4 @@
1
- import { QelosSDKOptions } from './types';
1
+ import { QelosSDKOptions, RequestExtra } from './types';
2
2
  import BaseSDK from './base-sdk';
3
3
  import type { ICommonQueryFilters } from '@qelos/global-types';
4
4
  export default class QlBlueprintEntities<T = any> extends BaseSDK {
@@ -6,9 +6,9 @@ export default class QlBlueprintEntities<T = any> extends BaseSDK {
6
6
  private blueprintKey;
7
7
  private relativePath;
8
8
  constructor(options: QelosSDKOptions, blueprintKey: string);
9
- getEntity(identifier: string): Promise<T>;
10
- getList(query?: ICommonQueryFilters & Record<string, any>): Promise<T[]>;
11
- remove(identifier: string): Promise<any>;
12
- update(identifier: string, changes: Partial<T>): Promise<T>;
13
- create(entity: T): Promise<T>;
9
+ getEntity(identifier: string, extra?: RequestExtra): Promise<T>;
10
+ getList(query?: ICommonQueryFilters & Record<string, any>, extra?: RequestExtra): Promise<T[]>;
11
+ remove(identifier: string, extra?: RequestExtra): Promise<any>;
12
+ update(identifier: string, changes: Partial<T>, extra?: RequestExtra): Promise<T>;
13
+ create(entity: T, extra?: Partial<RequestInit>): Promise<T>;
14
14
  }
@@ -8,27 +8,29 @@ export default class QlBlueprintEntities extends BaseSDK {
8
8
  this.options = options;
9
9
  this.blueprintKey = blueprintKey;
10
10
  }
11
- getEntity(identifier) {
12
- return this.callJsonApi(`${this.relativePath}/${this.blueprintKey}/entities/${identifier}${this.getQueryParams()}`);
11
+ getEntity(identifier, extra) {
12
+ return this.callJsonApi(`${this.relativePath}/${this.blueprintKey}/entities/${identifier}${this.getQueryParams(extra?.query)}`, extra);
13
13
  }
14
- getList(query) {
15
- return this.callJsonApi(`${this.relativePath}/${this.blueprintKey}/entities${this.getQueryParams(query)}`);
14
+ getList(query, extra) {
15
+ return this.callJsonApi(`${this.relativePath}/${this.blueprintKey}/entities${this.getQueryParams(query)}`, extra);
16
16
  }
17
- remove(identifier) {
18
- return this.callApi(`${this.relativePath}/${this.blueprintKey}/entities/${identifier}${this.getQueryParams()}`, { method: 'delete' });
17
+ remove(identifier, extra) {
18
+ return this.callApi(`${this.relativePath}/${this.blueprintKey}/entities/${identifier}${this.getQueryParams(extra?.query)}`, { method: 'delete' });
19
19
  }
20
- update(identifier, changes) {
21
- return this.callJsonApi(`${this.relativePath}/${this.blueprintKey}/entities/${identifier}${this.getQueryParams()}`, {
20
+ update(identifier, changes, extra) {
21
+ return this.callJsonApi(`${this.relativePath}/${this.blueprintKey}/entities/${identifier}${this.getQueryParams(extra?.query)}`, {
22
22
  method: 'put',
23
23
  headers: { 'content-type': 'application/json' },
24
- body: JSON.stringify(changes)
24
+ body: JSON.stringify(changes),
25
+ ...(extra || {}),
25
26
  });
26
27
  }
27
- create(entity) {
28
+ create(entity, extra) {
28
29
  return this.callJsonApi(`${this.relativePath}/${this.blueprintKey}/entities${this.getQueryParams()}`, {
29
30
  method: 'post',
30
31
  headers: { 'content-type': 'application/json' },
31
- body: JSON.stringify(entity)
32
+ body: JSON.stringify(entity),
33
+ ...(extra || {}),
32
34
  });
33
35
  }
34
36
  }
@@ -1 +1 @@
1
- {"version":3,"file":"blueprints-entities.js","sourceRoot":"","sources":["../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aAAa,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;IACpJ,CAAC;IAED,MAAM,CAAC,UAAkB,EAAE,OAAmB,EAAE,KAAoB;QAClE,OAAO,IAAI,CAAC,WAAW,CACrB,GAAG,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY,aAAa,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,EACtG;YACE,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;YAC/C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;YAC7B,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;SACjB,CACF,CAAA;IACH,CAAC;IAED,MAAM,CAAC,MAAS,EAAE,KAA4B;QAC5C,OAAO,IAAI,CAAC,WAAW,CAAI,GAAG,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY,YAAY,IAAI,CAAC,cAAc,EAAE,EAAE,EAAE;YACvG,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;YAC/C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;YAC5B,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;SACjB,CAAC,CAAA;IACJ,CAAC;CACF"}
package/dist/types.d.ts CHANGED
@@ -11,3 +11,6 @@ export interface QelosSDKOptions {
11
11
  forceRefresh?: boolean;
12
12
  extraQueryParams?: () => Record<string, string>;
13
13
  }
14
+ export type RequestExtra = Partial<RequestInit & {
15
+ query?: Record<string, string>;
16
+ }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qelos/sdk",
3
- "version": "3.6.6",
3
+ "version": "3.7.0",
4
4
  "description": "SDK for Qelos API",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {
@@ -13,11 +13,11 @@
13
13
  "access": "public"
14
14
  },
15
15
  "dependencies": {
16
- "@qelos/global-types": "^3.6.6"
16
+ "@qelos/global-types": "^3.7.0"
17
17
  },
18
18
  "devDependencies": {
19
19
  "tsx": "^3.12.7",
20
20
  "typescript": "^4.9.5"
21
21
  },
22
- "gitHead": "1359351ce7a1092614382cc6ff0db6400855e73b"
22
+ "gitHead": "b9a0b8961bb9ab043b7e3db32adb00060d3870b6"
23
23
  }