jd_platform_sdk 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +28 -44
- package/dist/sdk/configs/jdConfig.js +1 -5
- package/dist/sdk/jdConnector.js +72 -63
- package/dist/sdk/jdSdk.js +1 -5
- package/dist/sdk/models/jdApplication.d.ts +1 -1
- package/dist/sdk/models/jdApplication.d.ts.map +1 -1
- package/dist/sdk/models/jdApplication.js +63 -71
- package/dist/sdk/models/jdResource.d.ts +2 -2
- package/dist/sdk/models/jdResource.d.ts.map +1 -1
- package/dist/sdk/models/jdResource.js +104 -91
- package/dist/sdk/models/modules/dashboard/jdDashboardCombinations.js +15 -31
- package/dist/sdk/models/modules/geolocation/jdCity.d.ts.map +1 -1
- package/dist/sdk/models/modules/geolocation/jdCity.js +49 -55
- package/dist/sdk/models/modules/geolocation/jdCountry.d.ts.map +1 -1
- package/dist/sdk/models/modules/geolocation/jdCountry.js +47 -53
- package/dist/sdk/models/modules/geolocation/jdDistrict.d.ts.map +1 -1
- package/dist/sdk/models/modules/geolocation/jdDistrict.js +49 -57
- package/dist/sdk/models/modules/geolocation/jdState.d.ts.map +1 -1
- package/dist/sdk/models/modules/geolocation/jdState.js +49 -55
- package/dist/sdk/models/modules/karaoke/jdKtvShop.d.ts +5 -6
- package/dist/sdk/models/modules/karaoke/jdKtvShop.d.ts.map +1 -1
- package/dist/sdk/models/modules/karaoke/jdKtvShop.js +75 -89
- package/dist/sdk/models/modules/music/jdAlbum.d.ts +2 -2
- package/dist/sdk/models/modules/music/jdAlbum.d.ts.map +1 -1
- package/dist/sdk/models/modules/music/jdAlbum.js +96 -102
- package/dist/sdk/models/modules/music/jdArtist.d.ts +2 -5
- package/dist/sdk/models/modules/music/jdArtist.d.ts.map +1 -1
- package/dist/sdk/models/modules/music/jdArtist.js +79 -90
- package/dist/sdk/models/modules/music/jdComposer.d.ts +2 -4
- package/dist/sdk/models/modules/music/jdComposer.d.ts.map +1 -1
- package/dist/sdk/models/modules/music/jdComposer.js +79 -87
- package/dist/sdk/models/modules/music/jdMusicCombinations.js +15 -31
- package/dist/sdk/models/modules/music/jdSong.d.ts +1 -1
- package/dist/sdk/models/modules/music/jdSong.d.ts.map +1 -1
- package/dist/sdk/models/modules/music/jdSong.js +105 -113
- package/dist/sdk/models/modules/radio_station/jdRadioStation.d.ts +4 -5
- package/dist/sdk/models/modules/radio_station/jdRadioStation.d.ts.map +1 -1
- package/dist/sdk/models/modules/radio_station/jdRadioStation.js +75 -89
- package/dist/sdk/models/modules/user/jdPermission.d.ts +1 -2
- package/dist/sdk/models/modules/user/jdPermission.d.ts.map +1 -1
- package/dist/sdk/models/modules/user/jdPermission.js +53 -63
- package/dist/sdk/models/modules/user/jdPermissionGroup.d.ts +4 -6
- package/dist/sdk/models/modules/user/jdPermissionGroup.d.ts.map +1 -1
- package/dist/sdk/models/modules/user/jdPermissionGroup.js +48 -60
- package/dist/sdk/models/modules/user/jdSessionUser.d.ts +1 -1
- package/dist/sdk/models/modules/user/jdSessionUser.d.ts.map +1 -1
- package/dist/sdk/models/modules/user/jdSessionUser.js +70 -72
- package/dist/sdk/models/modules/user/jdUser.d.ts +1 -1
- package/dist/sdk/models/modules/user/jdUser.d.ts.map +1 -1
- package/dist/sdk/models/modules/user/jdUser.js +73 -75
- package/dist/sdk/models/modules/user/jdUserRole.d.ts +1 -1
- package/dist/sdk/models/modules/user/jdUserRole.d.ts.map +1 -1
- package/dist/sdk/models/modules/user/jdUserRole.js +50 -54
- package/dist/sdk/utilities/browserUtils.d.ts.map +1 -1
- package/dist/sdk/utilities/browserUtils.js +31 -24
- package/dist/sdk/utilities/cryptoUtils.js +6 -13
- package/dist/sdk/utilities/dateUtils.js +1 -5
- package/dist/sdk/utilities/globalEventHandler.js +4 -5
- package/dist/sdk/utilities/stringUtils.js +2 -6
- package/dist/sdk/utilities/utils.d.ts.map +1 -1
- package/dist/sdk/utilities/utils.js +19 -22
- package/package.json +1 -1
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { Utils } from "../utilities/utils";
|
|
11
|
+
import { DateUtils } from "../utilities/dateUtils";
|
|
12
|
+
import { CryptoUtils } from "../utilities/cryptoUtils";
|
|
13
|
+
import { JDConnector, SimpleResponse } from "../jdConnector";
|
|
14
|
+
export const defaultPaginateParams = {
|
|
9
15
|
order_by: 'updated_at',
|
|
10
16
|
order: 'desc',
|
|
11
17
|
page_index: 0,
|
|
@@ -13,37 +19,26 @@ exports.defaultPaginateParams = {
|
|
|
13
19
|
fields: '',
|
|
14
20
|
published: null,
|
|
15
21
|
};
|
|
16
|
-
|
|
22
|
+
export const defaultSortParams = {
|
|
17
23
|
order_by: 'updated_at',
|
|
18
24
|
order: 'desc',
|
|
19
25
|
page_index: 0,
|
|
20
26
|
count_per_page: 20,
|
|
21
27
|
fields: '',
|
|
22
28
|
};
|
|
23
|
-
|
|
29
|
+
export const defaultUpdateFields = {
|
|
24
30
|
published: null,
|
|
25
31
|
note: '',
|
|
26
32
|
};
|
|
27
|
-
class ConnectorInfo {
|
|
28
|
-
appId = '';
|
|
29
|
-
token = '';
|
|
33
|
+
export class ConnectorInfo {
|
|
30
34
|
constructor(appId, token) {
|
|
35
|
+
this.appId = '';
|
|
36
|
+
this.token = '';
|
|
31
37
|
this.appId = appId;
|
|
32
38
|
this.token = token;
|
|
33
39
|
}
|
|
34
40
|
}
|
|
35
|
-
|
|
36
|
-
class JDResource {
|
|
37
|
-
myId = '';
|
|
38
|
-
slug = '';
|
|
39
|
-
index = 0;
|
|
40
|
-
title = {};
|
|
41
|
-
description = {};
|
|
42
|
-
images = {};
|
|
43
|
-
createdAt = new Date();
|
|
44
|
-
updatedAt = new Date();
|
|
45
|
-
placeholderIconURL = '';
|
|
46
|
-
connectorInfo = new ConnectorInfo("", "");
|
|
41
|
+
export default class JDResource {
|
|
47
42
|
// Properties
|
|
48
43
|
// localisedTitle:string = DPUtility.getStringFromField(this.title, 'en');
|
|
49
44
|
// localisedDescription:string = DPUtility.getStringFromField(this.title, 'en');
|
|
@@ -51,36 +46,46 @@ class JDResource {
|
|
|
51
46
|
// getLocalisedDescription(){ return DPProfile.language == 'Myanmar' ? this.getDescriptionEN() : this.getDescriptionMM(); }
|
|
52
47
|
get localisedTitle() { return globalThis.language == 'mm' ? this.titleMM : this.titleEN; }
|
|
53
48
|
get localisedDescription() { return globalThis.language == 'mm' ? this.descriptionMM : this.descriptionEN; }
|
|
54
|
-
get titleEN() { return
|
|
55
|
-
get titleMM() { return
|
|
56
|
-
get descriptionEN() { return
|
|
57
|
-
get descriptionMM() { return
|
|
58
|
-
get iconURL() { return
|
|
59
|
-
get iconURL100() { return
|
|
60
|
-
get iconURL300() { return
|
|
49
|
+
get titleEN() { return Utils.getString(this.title, 'en'); }
|
|
50
|
+
get titleMM() { return Utils.getString(this.title, 'mm'); }
|
|
51
|
+
get descriptionEN() { return Utils.getString(this.description, 'en'); }
|
|
52
|
+
get descriptionMM() { return Utils.getString(this.description, 'mm'); }
|
|
53
|
+
get iconURL() { return Utils.getString(this.images, 'icon_url'); }
|
|
54
|
+
get iconURL100() { return Utils.getString(this.images, 'icon_url_100'); }
|
|
55
|
+
get iconURL300() { return Utils.getString(this.images, 'icon_url_300'); }
|
|
61
56
|
get cdnIconURL() { return this.iconURL.includes('http') ? this.iconURL : globalThis.cdnHost + this.iconURL; }
|
|
62
57
|
get cdnIconURL100() { return this.iconURL100.includes('http') ? this.iconURL100 : globalThis.cdnHost + this.iconURL100; }
|
|
63
58
|
get cdnIconURL300() { return this.iconURL.includes('http') ? this.iconURL : globalThis.cdnHost + this.iconURL300; }
|
|
64
|
-
get bannerURL() { return
|
|
65
|
-
get bannerURL500() { return
|
|
66
|
-
get bannerURL800() { return
|
|
59
|
+
get bannerURL() { return Utils.getString(this.images, 'banner_url'); }
|
|
60
|
+
get bannerURL500() { return Utils.getString(this.images, 'banner_url_500'); }
|
|
61
|
+
get bannerURL800() { return Utils.getString(this.images, 'banner_url_800'); }
|
|
67
62
|
get cdnBannerURL() { return this.bannerURL.includes('http') ? this.bannerURL : globalThis.cdnHost + this.bannerURL; }
|
|
68
63
|
get cdnBannerURL500() { return this.bannerURL800.includes('http') ? this.bannerURL500 : globalThis.cdnHost + this.bannerURL500; }
|
|
69
64
|
get cdnBannerURL800() { return this.bannerURL800.includes('http') ? this.bannerURL800 : globalThis.cdnHost + this.bannerURL800; }
|
|
70
65
|
getFacebookIconURL(fbId) { return 'https://graph.facebook.com/' + fbId + '/picture?type=square'; }
|
|
71
66
|
constructor(connectorInfo) {
|
|
67
|
+
this.myId = '';
|
|
68
|
+
this.slug = '';
|
|
69
|
+
this.index = 0;
|
|
70
|
+
this.title = {};
|
|
71
|
+
this.description = {};
|
|
72
|
+
this.images = {};
|
|
73
|
+
this.createdAt = new Date();
|
|
74
|
+
this.updatedAt = new Date();
|
|
75
|
+
this.placeholderIconURL = '';
|
|
76
|
+
this.connectorInfo = new ConnectorInfo("", "");
|
|
72
77
|
this.connectorInfo = connectorInfo;
|
|
73
78
|
}
|
|
74
79
|
setData(data) {
|
|
75
80
|
// console.log('Setting super constructor');
|
|
76
|
-
this.myId =
|
|
77
|
-
this.slug =
|
|
78
|
-
this.index =
|
|
79
|
-
this.title =
|
|
80
|
-
this.description =
|
|
81
|
-
this.images =
|
|
82
|
-
this.createdAt =
|
|
83
|
-
this.updatedAt =
|
|
81
|
+
this.myId = Utils.getString(data, "_id");
|
|
82
|
+
this.slug = Utils.getString(data, "slug");
|
|
83
|
+
this.index = Utils.getInteger(data, "index");
|
|
84
|
+
this.title = Utils.getObject(data, 'title');
|
|
85
|
+
this.description = Utils.getObject(data, 'description');
|
|
86
|
+
this.images = Utils.getObject(data, 'images');
|
|
87
|
+
this.createdAt = Utils.getDate(data, 'created_at');
|
|
88
|
+
this.updatedAt = Utils.getDate(data, 'updated_at');
|
|
84
89
|
// console.log(data);
|
|
85
90
|
// console.log(this.createdAt);
|
|
86
91
|
}
|
|
@@ -88,9 +93,9 @@ class JDResource {
|
|
|
88
93
|
getHashBody(remark = '') {
|
|
89
94
|
const body = {};
|
|
90
95
|
//Calculate hashes
|
|
91
|
-
const timestamp =
|
|
96
|
+
const timestamp = DateUtils.getTimeStamp();
|
|
92
97
|
body['timestamp'] = timestamp;
|
|
93
|
-
body['hash_before'] =
|
|
98
|
+
body['hash_before'] = CryptoUtils.generateBeforeHashString([timestamp, remark]);
|
|
94
99
|
return body;
|
|
95
100
|
}
|
|
96
101
|
// Other Utilities
|
|
@@ -99,7 +104,7 @@ class JDResource {
|
|
|
99
104
|
finalHeaders["Content-Type"] = 'application/json';
|
|
100
105
|
finalHeaders["app_id"] = this.connectorInfo.appId;
|
|
101
106
|
finalHeaders["x-auth-token"] = this.connectorInfo.token;
|
|
102
|
-
finalHeaders["random_seed"] =
|
|
107
|
+
finalHeaders["random_seed"] = DateUtils.getTimeStamp();
|
|
103
108
|
return finalHeaders;
|
|
104
109
|
}
|
|
105
110
|
//This is used to make a direct call supported on some APIs
|
|
@@ -109,10 +114,7 @@ class JDResource {
|
|
|
109
114
|
params["random_seed"] = Date.now();
|
|
110
115
|
}
|
|
111
116
|
getSortParameters(params = {}) {
|
|
112
|
-
const mergedParams = {
|
|
113
|
-
...exports.defaultSortParams,
|
|
114
|
-
...params,
|
|
115
|
-
};
|
|
117
|
+
const mergedParams = Object.assign(Object.assign({}, defaultSortParams), params);
|
|
116
118
|
const result = {};
|
|
117
119
|
if (mergedParams.order_by) {
|
|
118
120
|
result['order_by'] = mergedParams.order_by;
|
|
@@ -145,55 +147,66 @@ class JDResource {
|
|
|
145
147
|
return params;
|
|
146
148
|
}
|
|
147
149
|
// Basic structure requirement for the paginated contents
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
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
|
+
});
|
|
161
165
|
}
|
|
162
166
|
// HTTP Calls Utilities
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
167
|
+
getRelative(relativeUrl_1, params_1) {
|
|
168
|
+
return __awaiter(this, arguments, void 0, function* (relativeUrl, params, bShowErrorToast = true, bForceRefresh = false, overrideVersion = '') {
|
|
169
|
+
const finalHeaders = this.getDefaultHeaders();
|
|
170
|
+
const connector = new JDConnector();
|
|
171
|
+
const response = yield connector.httpGetRelativeAsync(relativeUrl, finalHeaders, params, bShowErrorToast, bForceRefresh, true, overrideVersion);
|
|
172
|
+
return new SimpleResponse(response.body, response.statusCode);
|
|
173
|
+
});
|
|
168
174
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
175
|
+
postRelative(relativeUrl_1, body_1) {
|
|
176
|
+
return __awaiter(this, arguments, void 0, function* (relativeUrl, body, bShowErrorToast = true, overrideVersion = '') {
|
|
177
|
+
const headers = this.getDefaultHeaders();
|
|
178
|
+
const connector = new JDConnector();
|
|
179
|
+
const response = yield connector.httpPostRelativeAsync(relativeUrl, headers, body, bShowErrorToast, true, overrideVersion);
|
|
180
|
+
return new SimpleResponse(response.body, response.statusCode);
|
|
181
|
+
});
|
|
174
182
|
}
|
|
175
183
|
// Direct Calls to the URL without using SDK
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
184
|
+
getDirect(directUrl_1, params_1) {
|
|
185
|
+
return __awaiter(this, arguments, void 0, function* (directUrl, params, bShowErrorToast = true, bForceRefresh = false, overrideVersion = '') {
|
|
186
|
+
const response = yield new JDConnector().httpGetDirectAsync(directUrl, {}, params, bShowErrorToast, true, bForceRefresh, overrideVersion);
|
|
187
|
+
return new SimpleResponse(response.body, response.statusCode);
|
|
188
|
+
});
|
|
179
189
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
190
|
+
postDirect(directUrl_1, body_1) {
|
|
191
|
+
return __awaiter(this, arguments, void 0, function* (directUrl, body, bShowErrorToast = true, overrideVersion = '') {
|
|
192
|
+
const response = yield new JDConnector().httpPostDirectAsync(directUrl, { 'Content-Type': 'application/json' }, body, bShowErrorToast, false, overrideVersion);
|
|
193
|
+
return new SimpleResponse(response.body, response.statusCode);
|
|
194
|
+
});
|
|
183
195
|
}
|
|
184
196
|
// Save the token and user information to globals if successful
|
|
185
197
|
// Since this is called from server-side, saving to global doesn't really matter
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
198
|
+
checkUser(response) {
|
|
199
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
200
|
+
if (response.statusCode == 200) {
|
|
201
|
+
// const dataRaw = Utils.stringToObject(response.body);
|
|
202
|
+
// const token = Utils.getString(dataRaw, "token");
|
|
203
|
+
// const dataUser = Utils.getObject(dataRaw, "user");
|
|
204
|
+
// Save to global variables and also in the session so that the user can keep the log in status
|
|
205
|
+
// Note: Do not set the JDUser info as it may lead to circular dependency
|
|
206
|
+
// globalThis.xAuthToken = token;
|
|
207
|
+
// globalThis.userData = dataUser;
|
|
208
|
+
// globalThis.userId = Utils.getString(dataUser, "_id");
|
|
209
|
+
}
|
|
210
|
+
});
|
|
197
211
|
}
|
|
198
212
|
}
|
|
199
|
-
exports.default = JDResource;
|
|
@@ -1,37 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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;
|
|
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
|
+
});
|
|
24
9
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
class JdDashboardCombinations extends jdResource_1.default {
|
|
29
|
-
constructor(data = {}, connectorInfo = new jdResource_1.ConnectorInfo("", "")) {
|
|
10
|
+
import JDResource, { ConnectorInfo } from "../../jdResource";
|
|
11
|
+
export class JdDashboardCombinations extends JDResource {
|
|
12
|
+
constructor(data = {}, connectorInfo = new ConnectorInfo("", "")) {
|
|
30
13
|
super(connectorInfo);
|
|
31
14
|
this.setData(data);
|
|
32
15
|
}
|
|
33
|
-
|
|
34
|
-
return
|
|
16
|
+
getOverview() {
|
|
17
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
return yield this.getRelative('/modules/dashboard/combinations/overview', {});
|
|
19
|
+
});
|
|
35
20
|
}
|
|
36
21
|
}
|
|
37
|
-
exports.JdDashboardCombinations = JdDashboardCombinations;
|
|
@@ -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,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAEnH,qBAAa,MAAO,SAAQ,UAAU;IACrC,OAAO,EAAC,MAAM,CAAM;IACpB,KAAK,EA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,EAAE,MAAM,EAAE,MAAM,GAAE,OAAO,CAAC,OAAO,iBAAiB,CAAM;IAM3E,YAAY,CAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAE,OAAO,CAAC,OAAO,iBAAiB,CAAM;IAK7E,OAAO,CAAC,EAAE,EAAC,MAAM;IAIjB,YAAY,CAAC,EAAE,EAAC,MAAM,EAAE,IAAI,GAAE,OAAO,CAAC,OAAO,mBAAmB,CAAM;CAG5E"}
|
|
@@ -1,70 +1,64 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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;
|
|
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
|
+
});
|
|
24
9
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const utils_1 = require("../../../utilities/utils");
|
|
29
|
-
class JDCity extends jdResource_1.default {
|
|
30
|
-
stateId = "";
|
|
31
|
-
state = {};
|
|
10
|
+
import JDResource, { ConnectorInfo } from "../../jdResource";
|
|
11
|
+
import { Utils } from "../../../utilities/utils";
|
|
12
|
+
export class JDCity extends JDResource {
|
|
32
13
|
get localisedStateTitle() { return globalThis.language == 'en' ? this.stateTitleEN : this.stateTitleMM; }
|
|
33
|
-
get stateTitleEN() { return
|
|
34
|
-
get stateTitleMM() { return
|
|
35
|
-
constructor(data = {}, connectorInfo = new
|
|
14
|
+
get stateTitleEN() { return Utils.getString(Utils.getObject(this.state, 'title'), 'en'); }
|
|
15
|
+
get stateTitleMM() { return Utils.getString(Utils.getObject(this.state, 'title'), 'mm'); }
|
|
16
|
+
constructor(data = {}, connectorInfo = new ConnectorInfo("", "")) {
|
|
36
17
|
super(connectorInfo);
|
|
18
|
+
this.stateId = "";
|
|
19
|
+
this.state = {};
|
|
37
20
|
this.setData(data);
|
|
38
21
|
}
|
|
39
22
|
setData(data) {
|
|
40
23
|
super.setData(data);
|
|
41
|
-
this.stateId =
|
|
42
|
-
this.state =
|
|
24
|
+
this.stateId = Utils.getString(data, "state_id");
|
|
25
|
+
this.state = Utils.getObject(data, "state");
|
|
43
26
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
+
});
|
|
47
32
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
+
});
|
|
53
40
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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);
|
|
46
|
+
});
|
|
58
47
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
48
|
+
getDistricts(stateId_1) {
|
|
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);
|
|
52
|
+
});
|
|
62
53
|
}
|
|
63
|
-
|
|
64
|
-
return
|
|
54
|
+
getInfo(id) {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
return yield this.getRelative(`/modules/geolocation/cities/${id}`, {});
|
|
57
|
+
});
|
|
65
58
|
}
|
|
66
|
-
|
|
67
|
-
return
|
|
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);
|
|
62
|
+
});
|
|
68
63
|
}
|
|
69
64
|
}
|
|
70
|
-
exports.JDCity = JDCity;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jdCountry.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/modules/geolocation/jdCountry.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,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AAO,CAAC,OAAO,mBAAmB,CAAM;CAG5E"}
|
|
@@ -1,62 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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;
|
|
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
|
+
});
|
|
24
9
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
class JDCountry extends jdResource_1.default {
|
|
29
|
-
constructor(data = {}, connectorInfo = new jdResource_1.ConnectorInfo("", "")) {
|
|
10
|
+
import JDResource, { ConnectorInfo } from "../../jdResource";
|
|
11
|
+
export class JDCountry extends JDResource {
|
|
12
|
+
constructor(data = {}, connectorInfo = new ConnectorInfo("", "")) {
|
|
30
13
|
super(connectorInfo);
|
|
31
14
|
this.setData(data);
|
|
32
15
|
}
|
|
33
16
|
setData(data) {
|
|
34
17
|
super.setData(data);
|
|
35
18
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
+
});
|
|
24
|
+
}
|
|
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);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
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);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
getStates(countryId_1) {
|
|
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);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
getInfo(id) {
|
|
47
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
return yield this.getRelative(`/modules/geolocation/countries/${id}`, {});
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
updateFields(id_1) {
|
|
52
|
+
return __awaiter(this, arguments, void 0, function* (id, body = {}) {
|
|
53
|
+
return yield this.postRelative(`/modules/geolocation/countries/${id}/update/single_fields`, body);
|
|
54
|
+
});
|
|
60
55
|
}
|
|
61
56
|
}
|
|
62
|
-
exports.JDCountry = JDCountry;
|
|
@@ -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,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,
|
|
1
|
+
{"version":3,"file":"jdDistrict.d.ts","sourceRoot":"","sources":["../../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