jd_platform_sdk 0.0.7 → 0.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.
Files changed (69) hide show
  1. package/dist/index.d.ts +4 -0
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +46 -24
  4. package/dist/sdk/configs/jdConfig.js +5 -1
  5. package/dist/sdk/jdConnector.js +63 -72
  6. package/dist/sdk/jdSdk.js +5 -1
  7. package/dist/sdk/models/jdApplication.d.ts +10 -4
  8. package/dist/sdk/models/jdApplication.d.ts.map +1 -1
  9. package/dist/sdk/models/jdApplication.js +76 -50
  10. package/dist/sdk/models/jdResource.d.ts +44 -1
  11. package/dist/sdk/models/jdResource.d.ts.map +1 -1
  12. package/dist/sdk/models/jdResource.js +131 -103
  13. package/dist/sdk/models/modules/dashboard/jdDashboardCombinations.d.ts +6 -0
  14. package/dist/sdk/models/modules/dashboard/jdDashboardCombinations.d.ts.map +1 -0
  15. package/dist/sdk/models/modules/dashboard/jdDashboardCombinations.js +37 -0
  16. package/dist/sdk/models/modules/geolocation/jdCity.d.ts +8 -4
  17. package/dist/sdk/models/modules/geolocation/jdCity.d.ts.map +1 -1
  18. package/dist/sdk/models/modules/geolocation/jdCity.js +61 -41
  19. package/dist/sdk/models/modules/geolocation/jdCountry.d.ts +8 -4
  20. package/dist/sdk/models/modules/geolocation/jdCountry.d.ts.map +1 -1
  21. package/dist/sdk/models/modules/geolocation/jdCountry.js +53 -33
  22. package/dist/sdk/models/modules/geolocation/jdDistrict.d.ts +7 -3
  23. package/dist/sdk/models/modules/geolocation/jdDistrict.d.ts.map +1 -1
  24. package/dist/sdk/models/modules/geolocation/jdDistrict.js +57 -35
  25. package/dist/sdk/models/modules/geolocation/jdState.d.ts +8 -4
  26. package/dist/sdk/models/modules/geolocation/jdState.d.ts.map +1 -1
  27. package/dist/sdk/models/modules/geolocation/jdState.js +61 -41
  28. package/dist/sdk/models/modules/karaoke/jdKtvShop.d.ts +13 -2
  29. package/dist/sdk/models/modules/karaoke/jdKtvShop.d.ts.map +1 -1
  30. package/dist/sdk/models/modules/karaoke/jdKtvShop.js +91 -62
  31. package/dist/sdk/models/modules/music/jdAlbum.d.ts +9 -51
  32. package/dist/sdk/models/modules/music/jdAlbum.d.ts.map +1 -1
  33. package/dist/sdk/models/modules/music/jdAlbum.js +102 -117
  34. package/dist/sdk/models/modules/music/jdArtist.d.ts +10 -49
  35. package/dist/sdk/models/modules/music/jdArtist.d.ts.map +1 -1
  36. package/dist/sdk/models/modules/music/jdArtist.js +90 -99
  37. package/dist/sdk/models/modules/music/jdComposer.d.ts +9 -49
  38. package/dist/sdk/models/modules/music/jdComposer.d.ts.map +1 -1
  39. package/dist/sdk/models/modules/music/jdComposer.js +87 -99
  40. package/dist/sdk/models/modules/music/jdMusicCombinations.js +31 -15
  41. package/dist/sdk/models/modules/music/jdSong.d.ts +11 -51
  42. package/dist/sdk/models/modules/music/jdSong.d.ts.map +1 -1
  43. package/dist/sdk/models/modules/music/jdSong.js +113 -131
  44. package/dist/sdk/models/modules/radio_station/jdRadioStation.d.ts +42 -0
  45. package/dist/sdk/models/modules/radio_station/jdRadioStation.d.ts.map +1 -0
  46. package/dist/sdk/models/modules/radio_station/jdRadioStation.js +106 -0
  47. package/dist/sdk/models/modules/user/jdPermission.d.ts +9 -21
  48. package/dist/sdk/models/modules/user/jdPermission.d.ts.map +1 -1
  49. package/dist/sdk/models/modules/user/jdPermission.js +63 -58
  50. package/dist/sdk/models/modules/user/jdPermissionGroup.d.ts +19 -0
  51. package/dist/sdk/models/modules/user/jdPermissionGroup.d.ts.map +1 -0
  52. package/dist/sdk/models/modules/user/jdPermissionGroup.js +72 -0
  53. package/dist/sdk/models/modules/user/jdSessionUser.d.ts +15 -2
  54. package/dist/sdk/models/modules/user/jdSessionUser.d.ts.map +1 -1
  55. package/dist/sdk/models/modules/user/jdSessionUser.js +78 -50
  56. package/dist/sdk/models/modules/user/jdUser.d.ts +16 -4
  57. package/dist/sdk/models/modules/user/jdUser.d.ts.map +1 -1
  58. package/dist/sdk/models/modules/user/jdUser.js +77 -56
  59. package/dist/sdk/models/modules/user/jdUserRole.d.ts +16 -0
  60. package/dist/sdk/models/modules/user/jdUserRole.d.ts.map +1 -0
  61. package/dist/sdk/models/modules/user/jdUserRole.js +70 -0
  62. package/dist/sdk/utilities/browserUtils.js +24 -31
  63. package/dist/sdk/utilities/cryptoUtils.js +13 -6
  64. package/dist/sdk/utilities/dateUtils.js +5 -1
  65. package/dist/sdk/utilities/globalEventHandler.js +5 -4
  66. package/dist/sdk/utilities/stringUtils.js +6 -2
  67. package/dist/sdk/utilities/utils.js +22 -19
  68. package/package.json +3 -1
  69. package/readme.md +9 -0
@@ -1,42 +1,62 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
9
24
  };
10
- import JDResource, { ConnectorInfo } from "../../jdResource";
11
- export class JDCountry extends JDResource {
12
- constructor(data = {}, connectorInfo = new ConnectorInfo("", "")) {
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.JDCountry = void 0;
27
+ const jdResource_1 = __importStar(require("../../jdResource"));
28
+ class JDCountry extends jdResource_1.default {
29
+ constructor(data = {}, connectorInfo = new jdResource_1.ConnectorInfo("", "")) {
13
30
  super(connectorInfo);
14
31
  this.setData(data);
15
32
  }
16
33
  setData(data) {
17
34
  super.setData(data);
18
35
  }
19
- getCountries() {
20
- return __awaiter(this, arguments, void 0, function* (orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '') {
21
- const params = this.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
22
- return yield this.getRelative('/modules/geolocation/countries', params);
23
- });
24
- }
25
- findCountries(title_1) {
26
- return __awaiter(this, arguments, void 0, function* (title, orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '') {
27
- const params = this.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
28
- return yield this.getRelative('/modules/geolocation/countries/find', params);
29
- });
30
- }
31
- getStates(countryId_1) {
32
- return __awaiter(this, arguments, void 0, function* (countryId, orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '') {
33
- const params = this.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
34
- return yield this.getRelative(`/modules/geolocation/countries/${countryId}/states`, params);
35
- });
36
- }
37
- getInfo(id) {
38
- return __awaiter(this, void 0, void 0, function* () {
39
- return yield this.getRelative(`/modules/geolocation/countries/${id}`, {});
40
- });
36
+ async getContents(params = {}) {
37
+ const queryParams = this.getSortParameters(params);
38
+ return await this.getRelative('/modules/geolocation/countries', queryParams);
39
+ }
40
+ async paginateContents(params = {}) {
41
+ const queryParams = this.getSortParameters(params);
42
+ if (params.name)
43
+ queryParams['name'] = params.name;
44
+ return await this.getRelative('/modules/geolocation/countries/paginate', queryParams);
45
+ }
46
+ async findContents(title, params = {}) {
47
+ const queryParams = this.getSortParameters(params);
48
+ queryParams['title'] = title;
49
+ return await this.getRelative('/modules/geolocation/countries/find', queryParams);
50
+ }
51
+ async getStates(countryId, params = {}) {
52
+ const queryParams = this.getSortParameters(params);
53
+ return await this.getRelative(`/modules/geolocation/countries/${countryId}/states`, queryParams);
54
+ }
55
+ async getInfo(id) {
56
+ return await this.getRelative(`/modules/geolocation/countries/${id}`, {});
57
+ }
58
+ async updateFields(id, body = {}) {
59
+ return await this.postRelative(`/modules/geolocation/countries/${id}/update/single_fields`, body);
41
60
  }
42
61
  }
62
+ exports.JDCountry = JDCountry;
@@ -1,4 +1,4 @@
1
- import JDResource, { ConnectorInfo } from "../../jdResource";
1
+ import JDResource, { ConnectorInfo, defaultSortParams, defaultUpdateFields, PaginateParams } from "../../jdResource";
2
2
  export declare class JDDistrict extends JDResource {
3
3
  cityId: string;
4
4
  city: Record<string, any>;
@@ -7,8 +7,12 @@ export declare class JDDistrict extends JDResource {
7
7
  get cityTitleMM(): string;
8
8
  constructor(data?: Record<string, any>, connectorInfo?: ConnectorInfo);
9
9
  setData(data: Record<string, any>): void;
10
- getDistricts(orderBy?: string, order?: string, pageIndex?: number, countPerPage?: number, fields?: string): Promise<import("../../../jdConnector").SimpleResponse>;
11
- findDistricts(title: string, orderBy?: string, order?: string, pageIndex?: number, countPerPage?: number, fields?: string): Promise<import("../../../jdConnector").SimpleResponse>;
10
+ getContents(params?: Partial<typeof defaultSortParams>): Promise<import("../../../jdConnector").SimpleResponse>;
11
+ paginateContents(params?: PaginateParams & {
12
+ name?: string | null;
13
+ }): Promise<import("../../../jdConnector").SimpleResponse>;
14
+ findContents(title: string, params?: Partial<typeof defaultSortParams>): Promise<import("../../../jdConnector").SimpleResponse>;
12
15
  getInfo(id: string): Promise<import("../../../jdConnector").SimpleResponse>;
16
+ updateFields(id: string, body?: Partial<typeof defaultUpdateFields>): Promise<import("../../../jdConnector").SimpleResponse>;
13
17
  }
14
18
  //# sourceMappingURL=jdDistrict.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"jdDistrict.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/modules/geolocation/jdDistrict.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,EAAE,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAE3D,qBAAa,UAAW,SAAQ,UAAU;IACzC,MAAM,EAAC,MAAM,CAAM;IACnB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;IAE/B,IAAI,kBAAkB,IAAG,MAAM,CAA8E;IAC7G,IAAI,WAAW,IAAG,MAAM,CAAsE;IAC9F,IAAI,WAAW,IAAG,MAAM,CAAsE;gBAElF,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EAAE,aAAa,GAAE,aAAyC;IAInG,OAAO,CAAC,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAM3B,YAAY,CAAC,OAAO,SAAe,EAAE,KAAK,SAAS,EAAE,SAAS,SAAI,EAAE,YAAY,SAAK,EAAE,MAAM,SAAK;IAKlG,aAAa,CAAC,KAAK,EAAC,MAAM,EAAE,OAAO,SAAe,EAAE,KAAK,SAAS,EAAE,SAAS,SAAI,EAAE,YAAY,SAAK,EAAE,MAAM,SAAK;IAKjH,OAAO,CAAC,EAAE,EAAC,MAAM;CAGvB"}
1
+ {"version":3,"file":"jdDistrict.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/modules/geolocation/jdDistrict.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,EAAE,EAAC,aAAa,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAEnH,qBAAa,UAAW,SAAQ,UAAU;IACzC,MAAM,EAAC,MAAM,CAAM;IACnB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;IAE/B,IAAI,kBAAkB,IAAG,MAAM,CAA8E;IAC7G,IAAI,WAAW,IAAG,MAAM,CAAsE;IAC9F,IAAI,WAAW,IAAG,MAAM,CAAsE;gBAElF,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EAAE,aAAa,GAAE,aAAyC;IAInG,OAAO,CAAC,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAM3B,WAAW,CAAC,MAAM,GAAE,OAAO,CAAC,OAAO,iBAAiB,CAAM;IAK1D,gBAAgB,CAAC,MAAM,GAAE,cAAc,GAAG;QAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAAO;IAMxE,YAAY,CAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAE,OAAO,CAAC,OAAO,iBAAiB,CAAM;IAM3E,OAAO,CAAC,EAAE,EAAC,MAAM;IAIjB,YAAY,CAAC,EAAE,EAAC,MAAM,EAAE,IAAI,GAAE,OAAO,CAAC,OAAO,mBAAmB,CAAM;CAG5E"}
@@ -1,44 +1,66 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
9
24
  };
10
- import JDResource, { ConnectorInfo } from "../../jdResource";
11
- import { Utils } from "../../../utilities/utils";
12
- export class JDDistrict extends JDResource {
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.JDDistrict = void 0;
27
+ const jdResource_1 = __importStar(require("../../jdResource"));
28
+ const utils_1 = require("../../../utilities/utils");
29
+ class JDDistrict extends jdResource_1.default {
30
+ cityId = "";
31
+ city = {};
13
32
  get localisedCityTitle() { return globalThis.language == 'en' ? this.cityTitleEN : this.cityTitleMM; }
14
- get cityTitleEN() { return Utils.getString(Utils.getObject(this.city, 'title'), 'en'); }
15
- get cityTitleMM() { return Utils.getString(Utils.getObject(this.city, 'title'), 'mm'); }
16
- constructor(data = {}, connectorInfo = new ConnectorInfo("", "")) {
33
+ get cityTitleEN() { return utils_1.Utils.getString(utils_1.Utils.getObject(this.city, 'title'), 'en'); }
34
+ get cityTitleMM() { return utils_1.Utils.getString(utils_1.Utils.getObject(this.city, 'title'), 'mm'); }
35
+ constructor(data = {}, connectorInfo = new jdResource_1.ConnectorInfo("", "")) {
17
36
  super(connectorInfo);
18
- this.cityId = "";
19
- this.city = {};
20
37
  this.setData(data);
21
38
  }
22
39
  setData(data) {
23
40
  super.setData(data);
24
- this.cityId = Utils.getString(data, "city_id");
25
- this.city = Utils.getObject(data, "city");
26
- }
27
- getDistricts() {
28
- return __awaiter(this, arguments, void 0, function* (orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '') {
29
- const params = this.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
30
- return yield this.getRelative('/modules/geolocation/districts', params);
31
- });
32
- }
33
- findDistricts(title_1) {
34
- return __awaiter(this, arguments, void 0, function* (title, orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '') {
35
- const params = this.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
36
- return yield this.getRelative('/modules/geolocation/districts/find', params);
37
- });
38
- }
39
- getInfo(id) {
40
- return __awaiter(this, void 0, void 0, function* () {
41
- return yield this.getRelative(`/modules/geolocation/districts/${id}`, {});
42
- });
41
+ this.cityId = utils_1.Utils.getString(data, "city_id");
42
+ this.city = utils_1.Utils.getObject(data, "city");
43
+ }
44
+ async getContents(params = {}) {
45
+ const queryParams = this.getSortParameters(params);
46
+ return await this.getRelative('/modules/geolocation/districts', queryParams);
47
+ }
48
+ async paginateContents(params = {}) {
49
+ const queryParams = this.getSortParameters(params);
50
+ if (params.name)
51
+ queryParams['name'] = params.name;
52
+ return await this.getRelative('/modules/geolocation/districts/paginate', queryParams);
53
+ }
54
+ async findContents(title, params = {}) {
55
+ const queryParams = this.getSortParameters(params);
56
+ queryParams['title'] = title;
57
+ return await this.getRelative('/modules/geolocation/districts/find', queryParams);
58
+ }
59
+ async getInfo(id) {
60
+ return await this.getRelative(`/modules/geolocation/districts/${id}`, {});
61
+ }
62
+ async updateFields(id, body = {}) {
63
+ return await this.postRelative(`/modules/geolocation/districts/${id}/update/single_fields`, body);
43
64
  }
44
65
  }
66
+ exports.JDDistrict = JDDistrict;
@@ -1,4 +1,4 @@
1
- import JDResource, { ConnectorInfo } from "../../jdResource";
1
+ import JDResource, { ConnectorInfo, defaultSortParams, defaultUpdateFields, PaginateParams } from "../../jdResource";
2
2
  export declare class JDState extends JDResource {
3
3
  countryId: string;
4
4
  country: Record<string, any>;
@@ -7,9 +7,13 @@ export declare class JDState extends JDResource {
7
7
  get countryTitleMM(): string;
8
8
  constructor(data?: Record<string, any>, connectorInfo?: ConnectorInfo);
9
9
  setData(data: Record<string, any>): void;
10
- getStates(orderBy?: string, order?: string, pageIndex?: number, countPerPage?: number, fields?: string): Promise<import("../../../jdConnector").SimpleResponse>;
11
- findStates(title: string, orderBy?: string, order?: string, pageIndex?: number, countPerPage?: number, fields?: string): Promise<import("../../../jdConnector").SimpleResponse>;
12
- getCities(stateId: string, orderBy?: string, order?: string, pageIndex?: number, countPerPage?: number, fields?: string): Promise<import("../../../jdConnector").SimpleResponse>;
10
+ getContents(params?: Partial<typeof defaultSortParams>): Promise<import("../../../jdConnector").SimpleResponse>;
11
+ paginateContents(params?: PaginateParams & {
12
+ name?: string | null;
13
+ }): Promise<import("../../../jdConnector").SimpleResponse>;
14
+ findContents(title: string, params?: Partial<typeof defaultSortParams>): Promise<import("../../../jdConnector").SimpleResponse>;
15
+ getCities(countryId: string, params?: Partial<typeof defaultSortParams>): Promise<import("../../../jdConnector").SimpleResponse>;
13
16
  getInfo(id: string): Promise<import("../../../jdConnector").SimpleResponse>;
17
+ updateFields(id: string, body?: Partial<typeof defaultUpdateFields>): Promise<import("../../../jdConnector").SimpleResponse>;
14
18
  }
15
19
  //# sourceMappingURL=jdState.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"jdState.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/modules/geolocation/jdState.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,EAAE,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAE3D,qBAAa,OAAQ,SAAQ,UAAU;IACtC,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AG,CAAM,EAAE,aAAa,GAAE,aAAyC;IAKpG,OAAO,CAAC,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAM1B,WAAW,CAAC,MAAM,GAAE,OAAO,CAAC,OAAO,iBAAiB,CAAM;IAK1D,gBAAgB,CAAC,MAAM,GAAE,cAAc,GAAG;QAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAAO;IAMxE,YAAY,CAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAE,OAAO,CAAC,OAAO,iBAAiB,CAAM;IAM3E,SAAS,CAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAE,OAAO,CAAC,OAAO,iBAAiB,CAAM;IAK5E,OAAO,CAAC,EAAE,EAAC,MAAM;IAIjB,YAAY,CAAC,EAAE,EAAC,MAAM,EAAE,IAAI,GAAE,OAAO,CAAC,OAAO,mBAAmB,CAAM;CAG5E"}
@@ -1,50 +1,70 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
9
24
  };
10
- import JDResource, { ConnectorInfo } from "../../jdResource";
11
- import { Utils } from "../../../utilities/utils";
12
- export class JDState extends JDResource {
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.JDState = void 0;
27
+ const jdResource_1 = __importStar(require("../../jdResource"));
28
+ const utils_1 = require("../../../utilities/utils");
29
+ class JDState extends jdResource_1.default {
30
+ countryId = "";
31
+ country = {};
13
32
  get localisedCountryTitle() { return globalThis.language == 'en' ? this.countryTitleEN : this.countryTitleMM; }
14
- get countryTitleEN() { return Utils.getString(Utils.getObject(this.country, 'title'), 'en'); }
15
- get countryTitleMM() { return Utils.getString(Utils.getObject(this.country, 'title'), 'mm'); }
16
- constructor(data = {}, connectorInfo = new ConnectorInfo("", "")) {
33
+ get countryTitleEN() { return utils_1.Utils.getString(utils_1.Utils.getObject(this.country, 'title'), 'en'); }
34
+ get countryTitleMM() { return utils_1.Utils.getString(utils_1.Utils.getObject(this.country, 'title'), 'mm'); }
35
+ constructor(data = {}, connectorInfo = new jdResource_1.ConnectorInfo("", "")) {
17
36
  super(connectorInfo);
18
- this.countryId = "";
19
- this.country = {};
20
37
  this.setData(data);
21
38
  }
22
39
  setData(data) {
23
40
  super.setData(data);
24
- this.countryId = Utils.getString(data, "country_id");
25
- this.country = Utils.getObject(data, "country");
26
- }
27
- getStates() {
28
- return __awaiter(this, arguments, void 0, function* (orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '') {
29
- const params = this.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
30
- return yield this.getRelative('/modules/geolocation/states', params);
31
- });
32
- }
33
- findStates(title_1) {
34
- return __awaiter(this, arguments, void 0, function* (title, orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '') {
35
- const params = this.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
36
- return yield this.getRelative('/modules/geolocation/states/find', params);
37
- });
38
- }
39
- getCities(stateId_1) {
40
- return __awaiter(this, arguments, void 0, function* (stateId, orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '') {
41
- const params = this.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
42
- return yield this.getRelative(`/modules/geolocation/states/${stateId}/cities`, params);
43
- });
44
- }
45
- getInfo(id) {
46
- return __awaiter(this, void 0, void 0, function* () {
47
- return yield this.getRelative(`/modules/geolocation/states/${id}`, {});
48
- });
41
+ this.countryId = utils_1.Utils.getString(data, "country_id");
42
+ this.country = utils_1.Utils.getObject(data, "country");
43
+ }
44
+ async getContents(params = {}) {
45
+ const queryParams = this.getSortParameters(params);
46
+ return await this.getRelative('/modules/geolocation/states', queryParams);
47
+ }
48
+ async paginateContents(params = {}) {
49
+ const queryParams = this.getSortParameters(params);
50
+ if (params.name)
51
+ queryParams['name'] = params.name;
52
+ return await this.getRelative('/modules/geolocation/states/paginate', queryParams);
53
+ }
54
+ async findContents(title, params = {}) {
55
+ const queryParams = this.getSortParameters(params);
56
+ queryParams['title'] = title;
57
+ return await this.getRelative('/modules/geolocation/states/find', queryParams);
58
+ }
59
+ async getCities(countryId, params = {}) {
60
+ const queryParams = this.getSortParameters(params);
61
+ return await this.getRelative(`/modules/geolocation/states/${countryId}/cities`, queryParams);
62
+ }
63
+ async getInfo(id) {
64
+ return await this.getRelative(`/modules/geolocation/states/${id}`, {});
65
+ }
66
+ async updateFields(id, body = {}) {
67
+ return await this.postRelative(`/modules/geolocation/states/${id}/update/single_fields`, body);
49
68
  }
50
69
  }
70
+ exports.JDState = JDState;
@@ -1,4 +1,4 @@
1
- import JDResource, { ConnectorInfo } from "../../jdResource";
1
+ import JDResource, { ConnectorInfo, defaultSortParams, PaginateParams, UpdateFields } from "../../jdResource";
2
2
  export declare class JDKtvShop extends JDResource {
3
3
  licenseKey: string;
4
4
  activationsCount: number;
@@ -24,8 +24,19 @@ export declare class JDKtvShop extends JDResource {
24
24
  expiryDate: Date;
25
25
  constructor(data?: Record<string, any>, connectorInfo?: ConnectorInfo);
26
26
  setData(data: Record<string, any>): void;
27
- getKtvShops(isRecommended?: boolean, orderBy?: string, order?: string, pageIndex?: number, countPerPage?: number, fields?: string): Promise<import("../../../jdConnector").SimpleResponse>;
27
+ getContents(params?: Partial<typeof defaultSortParams>): Promise<import("../../../jdConnector").SimpleResponse>;
28
+ paginateContents(params?: PaginateParams & {
29
+ name?: string;
30
+ guardName?: string;
31
+ published?: string;
32
+ }): Promise<import("../../../jdConnector").SimpleResponse>;
33
+ findContents(params?: PaginateParams & {
34
+ name?: string;
35
+ }): Promise<import("../../../jdConnector").SimpleResponse>;
28
36
  getInfo(id: string): Promise<import("../../../jdConnector").SimpleResponse>;
29
37
  updateInfo(id: string, title: Record<string, string>, slug: string, expiryDate: Date): Promise<import("../../../jdConnector").SimpleResponse>;
38
+ updateSingleFields(id: string, body?: UpdateFields & {
39
+ recommended?: boolean | null;
40
+ }): Promise<import("../../../jdConnector").SimpleResponse>;
30
41
  }
31
42
  //# sourceMappingURL=jdKtvShop.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"jdKtvShop.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/modules/karaoke/jdKtvShop.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,EAAE,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAE3D,qBAAa,SAAU,SAAQ,UAAU;IACxC,UAAU,EAAC,MAAM,CAAM;IACvB,gBAAgB,EAAC,MAAM,CAAK;IAC5B,mBAAm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AM,EAAE,aAAa,GAAE,aAAyC;IAKpG,OAAO,CAAC,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAqB1B,WAAW,CAAC,MAAM,GAAE,OAAO,CAAC,OAAO,iBAAiB,CAAM;IAK1D,gBAAgB,CAAC,MAAM,GAAE,cAAc,GAAG;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;KAAO;IAWzG,YAAY,CAAC,MAAM,GAAE,cAAc,GAAG;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;KAAO;IAM7D,OAAO,CAAC,EAAE,EAAC,MAAM;IAIjB,UAAU,CAAC,EAAE,EAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAC,IAAI;IAIlF,kBAAkB,CAAC,EAAE,EAAC,MAAM,EAAE,IAAI,GAAE,YAAY,GAAI;QAAE,WAAW,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;KAAM;CAG/F"}
@@ -1,77 +1,106 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
9
24
  };
10
- import JDResource, { ConnectorInfo } from "../../jdResource";
11
- import { Utils } from "../../../utilities/utils";
12
- export class JDKtvShop extends JDResource {
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.JDKtvShop = void 0;
27
+ const jdResource_1 = __importStar(require("../../jdResource"));
28
+ const utils_1 = require("../../../utilities/utils");
29
+ class JDKtvShop extends jdResource_1.default {
30
+ licenseKey = "";
31
+ activationsCount = 0;
32
+ maxActivationsCount = 0;
33
+ countryId = "";
34
+ stateId = "";
35
+ cityId = "";
36
+ districtId = "";
37
+ address = {};
38
+ country = {};
39
+ state = {};
40
+ city = {};
41
+ district = {};
13
42
  get localisedAddress() {
14
43
  return globalThis.language != 'en' ? `${this.districtTitleMM}, ${this.stateTitleMM}, ${this.cityTitleMM}, ${this.countryTitleMM},` :
15
44
  `${this.districtTitleEN}, ${this.stateTitleEN}, ${this.cityTitleEN}, ${this.countryTitleEN},`;
16
45
  }
17
- get countryTitleEN() { return Utils.getString(Utils.getObject(this.country, 'title'), 'en'); }
18
- get countryTitleMM() { return Utils.getString(Utils.getObject(this.country, 'title'), 'mm'); }
19
- get stateTitleEN() { return Utils.getString(Utils.getObject(this.state, 'title'), 'en'); }
20
- get stateTitleMM() { return Utils.getString(Utils.getObject(this.state, 'title'), 'mm'); }
21
- get cityTitleEN() { return Utils.getString(Utils.getObject(this.city, 'title'), 'en'); }
22
- get cityTitleMM() { return Utils.getString(Utils.getObject(this.city, 'title'), 'mm'); }
23
- get districtTitleEN() { return Utils.getString(Utils.getObject(this.district, 'title'), 'en'); }
24
- get districtTitleMM() { return Utils.getString(Utils.getObject(this.district, 'title'), 'mm'); }
25
- constructor(data = {}, connectorInfo = new ConnectorInfo("", "")) {
46
+ get countryTitleEN() { return utils_1.Utils.getString(utils_1.Utils.getObject(this.country, 'title'), 'en'); }
47
+ get countryTitleMM() { return utils_1.Utils.getString(utils_1.Utils.getObject(this.country, 'title'), 'mm'); }
48
+ get stateTitleEN() { return utils_1.Utils.getString(utils_1.Utils.getObject(this.state, 'title'), 'en'); }
49
+ get stateTitleMM() { return utils_1.Utils.getString(utils_1.Utils.getObject(this.state, 'title'), 'mm'); }
50
+ get cityTitleEN() { return utils_1.Utils.getString(utils_1.Utils.getObject(this.city, 'title'), 'en'); }
51
+ get cityTitleMM() { return utils_1.Utils.getString(utils_1.Utils.getObject(this.city, 'title'), 'mm'); }
52
+ get districtTitleEN() { return utils_1.Utils.getString(utils_1.Utils.getObject(this.district, 'title'), 'en'); }
53
+ get districtTitleMM() { return utils_1.Utils.getString(utils_1.Utils.getObject(this.district, 'title'), 'mm'); }
54
+ expiryDate = new Date();
55
+ constructor(data = {}, connectorInfo = new jdResource_1.ConnectorInfo("", "")) {
26
56
  super(connectorInfo);
27
- this.licenseKey = "";
28
- this.activationsCount = 0;
29
- this.maxActivationsCount = 0;
30
- this.countryId = "";
31
- this.stateId = "";
32
- this.cityId = "";
33
- this.districtId = "";
34
- this.address = {};
35
- this.country = {};
36
- this.state = {};
37
- this.city = {};
38
- this.district = {};
39
- this.expiryDate = new Date();
40
57
  this.setData(data);
41
58
  }
42
59
  setData(data) {
43
60
  super.setData(data);
44
- this.licenseKey = Utils.getString(data, "license_key");
45
- this.activationsCount = Utils.getInteger(data, "activations_count");
46
- this.maxActivationsCount = Utils.getInteger(data, "max_activations_count");
47
- this.countryId = Utils.getString(data, "country_id");
48
- this.stateId = Utils.getString(data, "state_id");
49
- this.cityId = Utils.getString(data, "city_id");
50
- this.districtId = Utils.getString(data, "district_id");
51
- this.address = Utils.getObject(data, "address");
52
- this.country = Utils.getObject(data, "country");
53
- this.state = Utils.getObject(data, "state");
54
- this.city = Utils.getObject(data, "city");
55
- this.district = Utils.getObject(data, "district");
56
- this.expiryDate = Utils.getDate(data, "expiry_date");
61
+ this.licenseKey = utils_1.Utils.getString(data, "license_key");
62
+ this.activationsCount = utils_1.Utils.getInteger(data, "activations_count");
63
+ this.maxActivationsCount = utils_1.Utils.getInteger(data, "max_activations_count");
64
+ this.countryId = utils_1.Utils.getString(data, "country_id");
65
+ this.stateId = utils_1.Utils.getString(data, "state_id");
66
+ this.cityId = utils_1.Utils.getString(data, "city_id");
67
+ this.districtId = utils_1.Utils.getString(data, "district_id");
68
+ this.address = utils_1.Utils.getObject(data, "address");
69
+ this.country = utils_1.Utils.getObject(data, "country");
70
+ this.state = utils_1.Utils.getObject(data, "state");
71
+ this.city = utils_1.Utils.getObject(data, "city");
72
+ this.district = utils_1.Utils.getObject(data, "district");
73
+ this.expiryDate = utils_1.Utils.getDate(data, "expiry_date");
74
+ }
75
+ async getContents(params = {}) {
76
+ const queryParams = this.getSortParameters(params);
77
+ return await this.getRelative(`/modules/karaoke/ktv_shops`, queryParams);
78
+ }
79
+ async paginateContents(params = {}) {
80
+ const queryParams = this.getSortParameters(params);
81
+ // Add custom filters
82
+ if (params.name)
83
+ queryParams['name'] = params.name;
84
+ if (params.guardName)
85
+ queryParams['guard_name'] = params.guardName;
86
+ if (params.published)
87
+ queryParams['published'] = params.published;
88
+ return await this.getRelative('/modules/karaoke/ktv_shops/paginate', queryParams);
89
+ }
90
+ async findContents(params = {}) {
91
+ const queryParams = this.getSortParameters(params);
92
+ if (params.name)
93
+ queryParams['name'] = params.name;
94
+ return await this.getRelative('/modules/karaoke/ktv_shops/find', queryParams);
57
95
  }
58
- getKtvShops() {
59
- return __awaiter(this, arguments, void 0, function* (isRecommended = false, orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '') {
60
- const params = this.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
61
- if (Utils.isset(isRecommended)) {
62
- params['recommended'] = isRecommended ? 'true' : 'false';
63
- }
64
- return yield this.getRelative('/modules/karaoke/ktv_shops', params);
65
- });
96
+ async getInfo(id) {
97
+ return await this.getRelative(`/modules/karaoke/ktv_shops/${id}`, {});
66
98
  }
67
- getInfo(id) {
68
- return __awaiter(this, void 0, void 0, function* () {
69
- return yield this.getRelative(`/modules/karaoke/ktv_shops/${id}`, {});
70
- });
99
+ async updateInfo(id, title, slug, expiryDate) {
100
+ return await this.getRelative(`/modules/karaoke/ktv_shops/${id}`, {});
71
101
  }
72
- updateInfo(id, title, slug, expiryDate) {
73
- return __awaiter(this, void 0, void 0, function* () {
74
- return yield this.getRelative(`/modules/karaoke/ktv_shops/${id}`, {});
75
- });
102
+ async updateSingleFields(id, body = {}) {
103
+ return await this.postRelative(`/modules/karaoke/ktv_shops/${id}/update/single_fields`, body);
76
104
  }
77
105
  }
106
+ exports.JDKtvShop = JDKtvShop;