jd_platform_sdk 0.0.8 → 0.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 (52) hide show
  1. package/dist/sdk/models/jdApplication.d.ts +10 -4
  2. package/dist/sdk/models/jdApplication.d.ts.map +1 -1
  3. package/dist/sdk/models/jdApplication.js +30 -12
  4. package/dist/sdk/models/jdResource.d.ts +44 -1
  5. package/dist/sdk/models/jdResource.d.ts.map +1 -1
  6. package/dist/sdk/models/jdResource.js +60 -19
  7. package/dist/sdk/models/modules/geolocation/jdCity.d.ts +8 -4
  8. package/dist/sdk/models/modules/geolocation/jdCity.d.ts.map +1 -1
  9. package/dist/sdk/models/modules/geolocation/jdCity.js +26 -12
  10. package/dist/sdk/models/modules/geolocation/jdCountry.d.ts +7 -18
  11. package/dist/sdk/models/modules/geolocation/jdCountry.d.ts.map +1 -1
  12. package/dist/sdk/models/modules/geolocation/jdCountry.js +20 -22
  13. package/dist/sdk/models/modules/geolocation/jdDistrict.d.ts +7 -3
  14. package/dist/sdk/models/modules/geolocation/jdDistrict.d.ts.map +1 -1
  15. package/dist/sdk/models/modules/geolocation/jdDistrict.js +22 -8
  16. package/dist/sdk/models/modules/geolocation/jdState.d.ts +8 -4
  17. package/dist/sdk/models/modules/geolocation/jdState.d.ts.map +1 -1
  18. package/dist/sdk/models/modules/geolocation/jdState.js +26 -12
  19. package/dist/sdk/models/modules/karaoke/jdKtvShop.d.ts +10 -16
  20. package/dist/sdk/models/modules/karaoke/jdKtvShop.d.ts.map +1 -1
  21. package/dist/sdk/models/modules/karaoke/jdKtvShop.js +25 -20
  22. package/dist/sdk/models/modules/music/jdAlbum.d.ts +8 -50
  23. package/dist/sdk/models/modules/music/jdAlbum.d.ts.map +1 -1
  24. package/dist/sdk/models/modules/music/jdAlbum.js +30 -51
  25. package/dist/sdk/models/modules/music/jdArtist.d.ts +9 -47
  26. package/dist/sdk/models/modules/music/jdArtist.d.ts.map +1 -1
  27. package/dist/sdk/models/modules/music/jdArtist.js +32 -43
  28. package/dist/sdk/models/modules/music/jdComposer.d.ts +9 -49
  29. package/dist/sdk/models/modules/music/jdComposer.d.ts.map +1 -1
  30. package/dist/sdk/models/modules/music/jdComposer.js +32 -48
  31. package/dist/sdk/models/modules/music/jdSong.d.ts +11 -51
  32. package/dist/sdk/models/modules/music/jdSong.d.ts.map +1 -1
  33. package/dist/sdk/models/modules/music/jdSong.js +31 -57
  34. package/dist/sdk/models/modules/radio_station/jdRadioStation.d.ts +10 -16
  35. package/dist/sdk/models/modules/radio_station/jdRadioStation.d.ts.map +1 -1
  36. package/dist/sdk/models/modules/radio_station/jdRadioStation.js +25 -20
  37. package/dist/sdk/models/modules/user/jdPermission.d.ts +7 -33
  38. package/dist/sdk/models/modules/user/jdPermission.d.ts.map +1 -1
  39. package/dist/sdk/models/modules/user/jdPermission.js +22 -41
  40. package/dist/sdk/models/modules/user/jdPermissionGroup.d.ts +11 -39
  41. package/dist/sdk/models/modules/user/jdPermissionGroup.d.ts.map +1 -1
  42. package/dist/sdk/models/modules/user/jdPermissionGroup.js +30 -30
  43. package/dist/sdk/models/modules/user/jdSessionUser.d.ts +15 -2
  44. package/dist/sdk/models/modules/user/jdSessionUser.d.ts.map +1 -1
  45. package/dist/sdk/models/modules/user/jdSessionUser.js +30 -4
  46. package/dist/sdk/models/modules/user/jdUser.d.ts +7 -17
  47. package/dist/sdk/models/modules/user/jdUser.d.ts.map +1 -1
  48. package/dist/sdk/models/modules/user/jdUser.js +28 -27
  49. package/dist/sdk/models/modules/user/jdUserRole.d.ts +7 -43
  50. package/dist/sdk/models/modules/user/jdUserRole.d.ts.map +1 -1
  51. package/dist/sdk/models/modules/user/jdUserRole.js +26 -32
  52. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import JDResource, { ConnectorInfo } from "./jdResource";
1
+ import JDResource, { ConnectorInfo, defaultSortParams, defaultUpdateFields, PaginateParams } from "./jdResource";
2
2
  export declare class JDApplication extends JDResource {
3
3
  appId: string;
4
4
  appKey: string;
@@ -12,10 +12,16 @@ export declare class JDApplication extends JDResource {
12
12
  bundleCodeIos: number;
13
13
  constructor(data?: Record<string, any>, connectorInfo?: ConnectorInfo);
14
14
  setData(data: Record<string, any>): void;
15
- getApplications(orderBy: string | undefined, order: string | undefined, pageIndex: number | undefined, countPerPage: number | undefined, fields: string | undefined, { isSandbox, isFeatured, }: {
16
- isSandbox?: boolean | undefined;
17
- isFeatured?: boolean | undefined;
15
+ getContents(params?: Partial<typeof defaultSortParams>): Promise<import("../jdConnector").SimpleResponse>;
16
+ paginateContents(params?: PaginateParams & {
17
+ name?: string | null;
18
+ sandbox?: string | null;
19
+ featured?: string | null;
20
+ }): Promise<import("../jdConnector").SimpleResponse>;
21
+ findContents(params?: PaginateParams & {
22
+ title?: string;
18
23
  }): Promise<import("../jdConnector").SimpleResponse>;
19
24
  getInfo(id: string): Promise<import("../jdConnector").SimpleResponse>;
25
+ updateFields(id: string, body?: Partial<typeof defaultUpdateFields>): Promise<import("../jdConnector").SimpleResponse>;
20
26
  }
21
27
  //# sourceMappingURL=jdApplication.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"jdApplication.d.ts","sourceRoot":"","sources":["../../../src/sdk/models/jdApplication.ts"],"names":[],"mappings":"AACA,OAAO,UAAU,EAAE,EAAC,aAAa,EAAC,MAAM,cAAc,CAAC;AAEvD,qBAAa,aAAc,SAAQ,UAAU;IAC5C,KAAK,SAAM;IACX,MAAM,SAAM;IACZ,SAAS,SAAM;IACf,UAAU,EAAE,MAAM,CAAM;IACxB,IAAI,EAAE,MAAM,CAAM;IAClB,WAAW,SAAM;IACjB,OAAO,SAAM;IACb,WAAW,SAAK;IAChB,iBAAiB,SAAK;IACtB,aAAa,SAAK;gBAEN,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EAAE,aAAa,GAAE,aAAyC;IAKpG,OAAO,CAAC,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GA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AC,OAAO,mBAAmB,CAAM;CAG5E"}
@@ -37,22 +37,40 @@ export class JDApplication extends JDResource {
37
37
  this.bundleCodeAndroid = Utils.getInteger(data, 'bundle_code_android');
38
38
  this.bundleCodeIos = Utils.getInteger(data, 'bundle_code_ios');
39
39
  }
40
- getApplications() {
41
- return __awaiter(this, arguments, void 0, function* (orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '', { isSandbox = false, isFeatured = false, }) {
42
- const params = this.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
43
- if (Utils.isset(isSandbox)) {
44
- params['sandbox'] = isSandbox ? 'true' : 'false';
45
- }
46
- if (Utils.isset(isFeatured)) {
47
- params['featured'] = isFeatured ? 'true' : 'false';
48
- }
49
- // console.log(params);
50
- return yield this.getRelative('/applications', params);
40
+ getContents() {
41
+ return __awaiter(this, arguments, void 0, function* (params = {}) {
42
+ const queryParams = this.getSortParameters(params);
43
+ return yield this.getRelative('/dashboard/applications', queryParams);
44
+ });
45
+ }
46
+ paginateContents() {
47
+ return __awaiter(this, arguments, void 0, function* (params = {}) {
48
+ const queryParams = this.getSortParameters(params);
49
+ if (params.name)
50
+ queryParams['name'] = params.name;
51
+ if (params.sandbox)
52
+ queryParams['sandbox'] = params.sandbox;
53
+ if (params.featured)
54
+ queryParams['featured'] = params.featured;
55
+ return yield this.getRelative('/dashboard/applications', queryParams);
56
+ });
57
+ }
58
+ findContents() {
59
+ return __awaiter(this, arguments, void 0, function* (params = {}) {
60
+ const queryParams = this.getSortParameters(params);
61
+ if (params.title)
62
+ queryParams['name'] = params.title;
63
+ return yield this.getRelative('/dashboard/applications', queryParams);
51
64
  });
52
65
  }
53
66
  getInfo(id) {
54
67
  return __awaiter(this, void 0, void 0, function* () {
55
- return yield this.getRelative(`/applications/${id}`, {});
68
+ return yield this.getRelative(`/dashboard/applications/${id}`, {});
69
+ });
70
+ }
71
+ updateFields(id_1) {
72
+ return __awaiter(this, arguments, void 0, function* (id, body = {}) {
73
+ return yield this.postRelative(`/dashboard/applications/${id}/update/single_fields`, body);
56
74
  });
57
75
  }
58
76
  }
@@ -1,4 +1,39 @@
1
1
  import { SimpleResponse } from "../jdConnector";
2
+ export declare const defaultPaginateParams: {
3
+ order_by: string;
4
+ order: string;
5
+ page_index: number;
6
+ count_per_page: number;
7
+ fields: string;
8
+ published: null;
9
+ };
10
+ export declare const defaultSortParams: {
11
+ order_by: string;
12
+ order: string;
13
+ page_index: number;
14
+ count_per_page: number;
15
+ fields: string;
16
+ };
17
+ export declare const defaultUpdateFields: {
18
+ published: null;
19
+ note: string;
20
+ };
21
+ export interface UpdateFields {
22
+ published?: boolean | null;
23
+ note?: string | undefined;
24
+ }
25
+ export interface PaginateParams {
26
+ title_en?: string | undefined;
27
+ title_mm?: string | undefined;
28
+ keywords_en?: string | undefined;
29
+ keywords_mm?: string | undefined;
30
+ published?: boolean | null;
31
+ order_by?: string | undefined;
32
+ order?: string | undefined;
33
+ page_index?: number | undefined;
34
+ count_per_page?: number | undefined;
35
+ fields?: string | undefined;
36
+ }
2
37
  export declare class ConnectorInfo {
3
38
  appId: string;
4
39
  token: string;
@@ -39,8 +74,16 @@ export default class JDResource {
39
74
  getHashBody(remark?: string): Record<string, any>;
40
75
  getDefaultHeaders(): Record<string, any>;
41
76
  addDefaultParams(params: Record<string, any>): void;
42
- getSortParameters(orderBy: string, order: string, pageIndex: number, countPerPage: number, fields: string): Record<string, any>;
77
+ getSortParameters(params?: Partial<typeof defaultSortParams> & {
78
+ published?: boolean | null;
79
+ title_en?: string | null;
80
+ title_mm?: string | null;
81
+ keywords_en?: string | null;
82
+ keywords_mm?: string | null;
83
+ note?: string | null;
84
+ }): Record<string, any>;
43
85
  static getFieldParameters(fields: string): Record<string, any>;
86
+ paginateContents(params?: PaginateParams): Promise<SimpleResponse>;
44
87
  getRelative(relativeUrl: string, params: Record<string, any>, bShowErrorToast?: boolean, bForceRefresh?: boolean, overrideVersion?: string): Promise<SimpleResponse>;
45
88
  postRelative(relativeUrl: string, body: Record<string, any>, bShowErrorToast?: boolean, overrideVersion?: string): Promise<SimpleResponse>;
46
89
  getDirect(directUrl: string, params: Record<string, any>, bShowErrorToast?: boolean, bForceRefresh?: boolean, overrideVersion?: string): Promise<SimpleResponse>;
@@ -1 +1 @@
1
- {"version":3,"file":"jdResource.d.ts","sourceRoot":"","sources":["../../../src/sdk/models/jdResource.ts"],"names":[],"mappings":"AAGA,OAAO,EAAc,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAI3D,qBAAa,aAAa;IACzB,KAAK,SAAM;IACX,KAAK,SAAM;gBACC,KAAK,EAAC,MAAM,EAAE,KAAK,EAAC,MAAM;CAItC;AAED,MAAM,CAAC,OAAO,OAAO,UAAU;IAC9B,IAAI,SAAM;IACP,IAAI,SAAM;IACV,KAAK,SAAK;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;IAC7B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;IACtC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;IACjC,SAAS,EAAC,IAAI,CAAc;IAC5B,SAAS,EAAC,IAAI,CAAc;IAC5B,kBAAkB,SAAM;IAC3B,aAAa,EAAC,aAAa,CAA6B;IAQxD,IAAI,cAAc,IAAG,MAAM,CAAsE;IACjG,IAAI,oBAAoB,IAAG,MAAM,CAAkF;IACnH,IAAI,OAAO,IAAG,MAAM,CAA8C;IAClE,IAAI,OAAO,IAAG,MAAM,CAA6C;IACjE,IAAI,aAAa,IAAG,MAAM,CAAmD;IAC7E,IAAI,aAAa,IAAG,MAAM,CAAmD;IAE7E,OAAO,KAAK,OAAO,GAA6D;IAChF,OAAO,KAAK,UAAU,GAAiE;IACvF,OAAO,KAAK,UAAU,GAAiE;IAEvF,IAAI,UAAU,IAAG,MAAM,CAA4F;IACnH,IAAI,aAAa,IAAG,MAAM,CAAqG;IAC/H,IAAI,aAAa,IAAG,MAAM,CA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AAE,OAAO,CAAC,OAAO,iBAAiB,CAAC,GAAG;QAC7D,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;QAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACzB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAC5B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAC5B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAChB;IAkCN,MAAM,CAAC,kBAAkB,CAAC,MAAM,EAAC,MAAM;IAOjC,gBAAgB,CAAC,MAAM,GAAE,cAAmB;IAc5C,WAAW,CAAC,WAAW,EAAC,MAAM,EAAE,MAAM,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,eAAe,UAAO,EAAE,aAAa,UAAQ,EAAE,eAAe,SAAK;IAO/H,YAAY,CAAC,WAAW,EAAC,MAAM,EAAE,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAG,eAAe,UAAO,EAAE,eAAe,SAAK;IAQxG,SAAS,CAAC,SAAS,EAAC,MAAM,EAAE,MAAM,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAG,eAAe,UAAO,EAAE,aAAa,UAAQ,EAAE,eAAe,SAAK;IAK5H,UAAU,CAAC,SAAS,EAAC,MAAM,EAAE,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,eAAe,UAAO,EAAG,eAAe,SAAK;IAOpG,SAAS,CAAC,QAAQ,EAAC,cAAc;CAcvC"}
@@ -11,6 +11,25 @@ import { Utils } from "../utilities/utils";
11
11
  import { DateUtils } from "../utilities/dateUtils";
12
12
  import { CryptoUtils } from "../utilities/cryptoUtils";
13
13
  import { JDConnector, SimpleResponse } from "../jdConnector";
14
+ export const defaultPaginateParams = {
15
+ order_by: 'updated_at',
16
+ order: 'desc',
17
+ page_index: 0,
18
+ count_per_page: 20,
19
+ fields: '',
20
+ published: null,
21
+ };
22
+ export const defaultSortParams = {
23
+ order_by: 'updated_at',
24
+ order: 'desc',
25
+ page_index: 0,
26
+ count_per_page: 20,
27
+ fields: '',
28
+ };
29
+ export const defaultUpdateFields = {
30
+ published: null,
31
+ note: '',
32
+ };
14
33
  export class ConnectorInfo {
15
34
  constructor(appId, token) {
16
35
  this.appId = '';
@@ -94,34 +113,56 @@ export default class JDResource {
94
113
  params["token"] = this.connectorInfo.token;
95
114
  params["random_seed"] = Date.now();
96
115
  }
97
- getSortParameters(orderBy, order, pageIndex, countPerPage, fields) {
98
- const params = { 'page_index': pageIndex, 'count_per_page': countPerPage, 'fields': fields };
99
- if (Utils.isset(orderBy) && Utils.isset(order)) {
100
- params['order_by'] = orderBy;
101
- params['order'] = order;
102
- }
103
- if (pageIndex >= 0) {
104
- params["page_index"] = pageIndex;
105
- }
106
- else {
107
- params["page_index"] = 0;
116
+ getSortParameters(params = {}) {
117
+ const mergedParams = Object.assign(Object.assign({}, defaultSortParams), params);
118
+ const result = {};
119
+ if (mergedParams.order_by) {
120
+ result['order_by'] = mergedParams.order_by;
121
+ result['order'] = mergedParams.order;
108
122
  }
109
- if (countPerPage > 0) {
110
- params["count_per_page"] = countPerPage;
123
+ result['page_index'] = mergedParams.page_index;
124
+ result['count_per_page'] = mergedParams.count_per_page;
125
+ if (mergedParams.fields) {
126
+ result['fields'] = mergedParams.fields;
111
127
  }
112
- else {
113
- params["count_per_page"] = 10;
128
+ // Centralized logic for additional filters
129
+ if (mergedParams.published !== undefined) {
130
+ result['published'] = mergedParams.published !== null ? (mergedParams.published ? 'true' : 'false') : '';
114
131
  }
115
- if (Utils.isset(fields)) {
116
- params["fields"] = fields;
117
- }
118
- return params;
132
+ if (mergedParams.title_en)
133
+ result['title.en'] = mergedParams.title_en;
134
+ if (mergedParams.title_mm)
135
+ result['title.mm'] = mergedParams.title_mm;
136
+ if (mergedParams.keywords_en)
137
+ result['keywords.en'] = mergedParams.keywords_en;
138
+ if (mergedParams.keywords_mm)
139
+ result['keywords.mm'] = mergedParams.keywords_mm;
140
+ if (mergedParams.note)
141
+ result['note'] = mergedParams.note;
142
+ return result;
119
143
  }
120
144
  static getFieldParameters(fields) {
121
145
  const params = {};
122
146
  params["fields"] = fields;
123
147
  return params;
124
148
  }
149
+ // Basic structure requirement for the paginated contents
150
+ paginateContents() {
151
+ return __awaiter(this, arguments, void 0, function* (params = {}) {
152
+ // Let getSortParameters handle defaults
153
+ const queryParams = this.getSortParameters(params);
154
+ // Add custom filters
155
+ if (params.title_en)
156
+ queryParams['title.en'] = params.title_en;
157
+ if (params.title_mm)
158
+ queryParams['title.mm'] = params.title_mm;
159
+ if (params.keywords_en)
160
+ queryParams['keywords.en'] = params.keywords_en;
161
+ if (params.keywords_mm)
162
+ queryParams['keywords.mm'] = params.keywords_mm;
163
+ return yield this.getRelative("/modules/contents", queryParams);
164
+ });
165
+ }
125
166
  // HTTP Calls Utilities
126
167
  getRelative(relativeUrl_1, params_1) {
127
168
  return __awaiter(this, arguments, void 0, function* (relativeUrl, params, bShowErrorToast = true, bForceRefresh = false, overrideVersion = '') {
@@ -1,4 +1,4 @@
1
- import JDResource, { ConnectorInfo } from "../../jdResource";
1
+ import JDResource, { ConnectorInfo, defaultSortParams, defaultUpdateFields, PaginateParams } from "../../jdResource";
2
2
  export declare class JDCity extends JDResource {
3
3
  stateId: string;
4
4
  state: Record<string, any>;
@@ -7,9 +7,13 @@ export declare class JDCity extends JDResource {
7
7
  get stateTitleMM(): string;
8
8
  constructor(data?: Record<string, any>, connectorInfo?: ConnectorInfo);
9
9
  setData(data: Record<string, any>): void;
10
- getCities(orderBy?: string, order?: string, pageIndex?: number, countPerPage?: number, fields?: string): Promise<import("../../../jdConnector").SimpleResponse>;
11
- findCities(title: string, orderBy?: string, order?: string, pageIndex?: number, countPerPage?: number, fields?: string): Promise<import("../../../jdConnector").SimpleResponse>;
12
- getDistricts(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
+ getDistricts(stateId: 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=jdCity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"jdCity.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/modules/geolocation/jdCity.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,EAAE,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAE3D,qBAAa,MAAO,SAAQ,UAAU;IACrC,OAAO,EAAC,MAAM,CAAM;IACpB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;IAEhC,IAAI,mBAAmB,IAAG,MAAM,CAAgF;IAChH,IAAI,YAAY,IAAG,MAAM,CAAuE;IAChG,IAAI,YAAY,IAAG,MAAM,CAAuE;gBAEpF,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EAAE,aAAa,GAAE,aAAyC;IAKpG,OAAO,CAAC,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAM1B,SAAS,CAAC,OAAO,SAAe,EAAE,KAAK,SAAS,EAAE,SAAS,SAAI,EAAE,YAAY,SAAK,EAAE,MAAM,SAAK;IAK/F,UAAU,CAAC,KAAK,EAAC,MAAM,EAAE,OAAO,SA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EAAE,EAAC,MAAM,EAAE,IAAI,GAAE,OAAO,CAAC,OAAO,mBAAmB,CAAM;CAG5E"}
@@ -24,27 +24,41 @@ export class JDCity extends JDResource {
24
24
  this.stateId = Utils.getString(data, "state_id");
25
25
  this.state = Utils.getObject(data, "state");
26
26
  }
27
- getCities() {
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/cities', params);
27
+ getContents() {
28
+ return __awaiter(this, arguments, void 0, function* (params = {}) {
29
+ const queryParams = this.getSortParameters(params);
30
+ return yield this.getRelative('/modules/geolocation/cities', queryParams);
31
31
  });
32
32
  }
33
- findCities(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/cities/find', params);
33
+ paginateContents() {
34
+ return __awaiter(this, arguments, void 0, function* (params = {}) {
35
+ const queryParams = this.getSortParameters(params);
36
+ if (params.name)
37
+ queryParams['name'] = params.name;
38
+ return yield this.getRelative('/modules/geolocation/cities/paginate', queryParams);
39
+ });
40
+ }
41
+ findContents(title_1) {
42
+ return __awaiter(this, arguments, void 0, function* (title, params = {}) {
43
+ const queryParams = this.getSortParameters(params);
44
+ queryParams['title'] = title;
45
+ return yield this.getRelative('/modules/geolocation/cities/find', queryParams);
37
46
  });
38
47
  }
39
48
  getDistricts(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/cities/${stateId}/districts`, params);
49
+ return __awaiter(this, arguments, void 0, function* (stateId, params = {}) {
50
+ const queryParams = this.getSortParameters(params);
51
+ return yield this.getRelative(`/modules/geolocation/cities/${stateId}/districts`, queryParams);
43
52
  });
44
53
  }
45
54
  getInfo(id) {
46
55
  return __awaiter(this, void 0, void 0, function* () {
47
- return yield this.getRelative(`/modules/geolocation/states/${id}`, {});
56
+ return yield this.getRelative(`/modules/geolocation/cities/${id}`, {});
57
+ });
58
+ }
59
+ updateFields(id_1) {
60
+ return __awaiter(this, arguments, void 0, function* (id, body = {}) {
61
+ return yield this.postRelative(`/modules/geolocation/cities/${id}/update/single_fields`, body);
48
62
  });
49
63
  }
50
64
  }
@@ -1,25 +1,14 @@
1
- import JDResource, { ConnectorInfo } from "../../jdResource";
1
+ import JDResource, { ConnectorInfo, defaultSortParams, defaultUpdateFields, PaginateParams } from "../../jdResource";
2
2
  export declare class JDCountry extends JDResource {
3
3
  constructor(data?: Record<string, any>, connectorInfo?: ConnectorInfo);
4
4
  setData(data: Record<string, any>): void;
5
- getCountries(orderBy?: string, order?: string, pageIndex?: number, countPerPage?: number, fields?: string): Promise<import("../../../jdConnector").SimpleResponse>;
6
- paginateContents({ title_en, title_mm, published, orderBy, order, pageIndex, countPerPage, fields }: {
7
- title_en?: string | null;
8
- title_mm?: string | null;
9
- published?: boolean | null;
10
- orderBy?: string | null;
11
- order?: string | null;
12
- pageIndex?: number | null;
13
- countPerPage?: number | null;
14
- fields?: string | null;
5
+ getContents(params?: Partial<typeof defaultSortParams>): Promise<import("../../../jdConnector").SimpleResponse>;
6
+ paginateContents(params?: PaginateParams & {
7
+ name?: string | null;
15
8
  }): Promise<import("../../../jdConnector").SimpleResponse>;
16
- findCountries(title: string, orderBy?: string, order?: string, pageIndex?: number, countPerPage?: number, fields?: string): Promise<import("../../../jdConnector").SimpleResponse>;
17
- getStates(countryId: string, orderBy?: string, order?: string, pageIndex?: number, countPerPage?: number, fields?: string): Promise<import("../../../jdConnector").SimpleResponse>;
9
+ findContents(title: string, params?: Partial<typeof defaultSortParams>): Promise<import("../../../jdConnector").SimpleResponse>;
10
+ getStates(countryId: string, params?: Partial<typeof defaultSortParams>): Promise<import("../../../jdConnector").SimpleResponse>;
18
11
  getInfo(id: string): Promise<import("../../../jdConnector").SimpleResponse>;
19
- updateSingleFields(id: string, { published, recommended, note }: {
20
- published?: boolean | null;
21
- recommended?: boolean | null;
22
- note?: string | null;
23
- }): Promise<import("../../../jdConnector").SimpleResponse>;
12
+ updateFields(id: string, body?: Partial<typeof defaultUpdateFields>): Promise<import("../../../jdConnector").SimpleResponse>;
24
13
  }
25
14
  //# sourceMappingURL=jdCountry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"jdCountry.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/modules/geolocation/jdCountry.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,EAAE,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAE3D,qBAAa,SAAU,SAAQ,UAAU;gBAC5B,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EAAE,aAAa,GAAE,aAAyC;IAKpG,OAAO,CAAC,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAI1B,YAAY,CAAC,OAAO,SAAe,EAAE,KAAK,SAAS,EAAE,SAAS,SAAI,EAAE,YAAY,SAAK,EAAE,MAAM,SAAK;IAKlG,gBAAgB,CAAC,EAAE,QAAY,EAAE,QAAY,EAAE,SAAe,EAC3D,OAAsB,EAAE,KAAc,EAAE,SAAa,EAAE,YAAiB,EAAE,MAAW,EAAC,EAAE;QAChG,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACzB,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;QAC3B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAC/C,SAAS,CAAC,EAAE,M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Y,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"}
@@ -16,32 +16,31 @@ export class JDCountry extends JDResource {
16
16
  setData(data) {
17
17
  super.setData(data);
18
18
  }
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);
19
+ getContents() {
20
+ return __awaiter(this, arguments, void 0, function* (params = {}) {
21
+ const queryParams = this.getSortParameters(params);
22
+ return yield this.getRelative('/modules/geolocation/countries', queryParams);
23
23
  });
24
24
  }
25
- paginateContents(_a) {
26
- return __awaiter(this, arguments, void 0, function* ({ title_en = "", title_mm = "", published = null, orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '' }) {
27
- const params = this.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
28
- //Addon filters
29
- params['title.en'] = title_en;
30
- params['title.mm'] = title_mm;
31
- params['published'] = published === null ? '' : published ? 'true' : 'false';
32
- return yield this.getRelative('/modules/geolocation/countries/paginate', params);
25
+ paginateContents() {
26
+ return __awaiter(this, arguments, void 0, function* (params = {}) {
27
+ const queryParams = this.getSortParameters(params);
28
+ if (params.name)
29
+ queryParams['name'] = params.name;
30
+ return yield this.getRelative('/modules/geolocation/countries/paginate', queryParams);
33
31
  });
34
32
  }
35
- findCountries(title_1) {
36
- return __awaiter(this, arguments, void 0, function* (title, orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '') {
37
- const params = this.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
38
- return yield this.getRelative('/modules/geolocation/countries/find', params);
33
+ findContents(title_1) {
34
+ return __awaiter(this, arguments, void 0, function* (title, params = {}) {
35
+ const queryParams = this.getSortParameters(params);
36
+ queryParams['title'] = title;
37
+ return yield this.getRelative('/modules/geolocation/countries/find', queryParams);
39
38
  });
40
39
  }
41
40
  getStates(countryId_1) {
42
- return __awaiter(this, arguments, void 0, function* (countryId, orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '') {
43
- const params = this.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
44
- return yield this.getRelative(`/modules/geolocation/countries/${countryId}/states`, params);
41
+ return __awaiter(this, arguments, void 0, function* (countryId, params = {}) {
42
+ const queryParams = this.getSortParameters(params);
43
+ return yield this.getRelative(`/modules/geolocation/countries/${countryId}/states`, queryParams);
45
44
  });
46
45
  }
47
46
  getInfo(id) {
@@ -49,9 +48,8 @@ export class JDCountry extends JDResource {
49
48
  return yield this.getRelative(`/modules/geolocation/countries/${id}`, {});
50
49
  });
51
50
  }
52
- updateSingleFields(id_1, _a) {
53
- return __awaiter(this, arguments, void 0, function* (id, { published = null, recommended = null, note = null }) {
54
- const body = { published, recommended, note };
51
+ updateFields(id_1) {
52
+ return __awaiter(this, arguments, void 0, function* (id, body = {}) {
55
53
  return yield this.postRelative(`/modules/geolocation/countries/${id}/update/single_fields`, body);
56
54
  });
57
55
  }
@@ -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"}
@@ -24,16 +24,25 @@ export class JDDistrict extends JDResource {
24
24
  this.cityId = Utils.getString(data, "city_id");
25
25
  this.city = Utils.getObject(data, "city");
26
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);
27
+ getContents() {
28
+ return __awaiter(this, arguments, void 0, function* (params = {}) {
29
+ const queryParams = this.getSortParameters(params);
30
+ return yield this.getRelative('/modules/geolocation/districts', queryParams);
31
31
  });
32
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);
33
+ paginateContents() {
34
+ return __awaiter(this, arguments, void 0, function* (params = {}) {
35
+ const queryParams = this.getSortParameters(params);
36
+ if (params.name)
37
+ queryParams['name'] = params.name;
38
+ return yield this.getRelative('/modules/geolocation/districts/paginate', queryParams);
39
+ });
40
+ }
41
+ findContents(title_1) {
42
+ return __awaiter(this, arguments, void 0, function* (title, params = {}) {
43
+ const queryParams = this.getSortParameters(params);
44
+ queryParams['title'] = title;
45
+ return yield this.getRelative('/modules/geolocation/districts/find', queryParams);
37
46
  });
38
47
  }
39
48
  getInfo(id) {
@@ -41,4 +50,9 @@ export class JDDistrict extends JDResource {
41
50
  return yield this.getRelative(`/modules/geolocation/districts/${id}`, {});
42
51
  });
43
52
  }
53
+ updateFields(id_1) {
54
+ return __awaiter(this, arguments, void 0, function* (id, body = {}) {
55
+ return yield this.postRelative(`/modules/geolocation/districts/${id}/update/single_fields`, body);
56
+ });
57
+ }
44
58
  }
@@ -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,SAAS,EAAC,MAAM,CAAM;IACtB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;IAElC,IAAI,qBAAqB,IAAG,MAAM,CAAoF;IACtH,IAAI,cAAc,IAAG,MAAM,CAAyE;IACpG,IA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