jd_platform_sdk 0.1.6 → 0.1.8
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.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/sdk/configs/jdConfig.js +1 -0
- package/dist/sdk/jdConnector.js +47 -64
- package/dist/sdk/models/dashboard/geolocation/jdCity.js +21 -42
- package/dist/sdk/models/dashboard/geolocation/jdCountry.js +24 -45
- package/dist/sdk/models/dashboard/geolocation/jdDistrict.js +18 -37
- package/dist/sdk/models/dashboard/geolocation/jdGeolocationCombinations.js +2 -13
- package/dist/sdk/models/dashboard/geolocation/jdState.js +21 -42
- package/dist/sdk/models/dashboard/jdApplication.js +31 -50
- package/dist/sdk/models/dashboard/jdCallbackNotification.js +36 -55
- package/dist/sdk/models/dashboard/jdDashboardCombinations.js +2 -13
- package/dist/sdk/models/dashboard/jdKtvShop.js +32 -51
- package/dist/sdk/models/dashboard/jdModule.js +19 -38
- package/dist/sdk/models/dashboard/jdPlatform.js +19 -38
- package/dist/sdk/models/dashboard/jdRadioStation.js +32 -51
- package/dist/sdk/models/dashboard/jdSmsVerification.js +21 -40
- package/dist/sdk/models/dashboard/user/jdAccessToken.js +20 -39
- package/dist/sdk/models/dashboard/user/jdModerator.js +27 -46
- package/dist/sdk/models/dashboard/user/jdPermission.js +25 -44
- package/dist/sdk/models/dashboard/user/jdPermissionGroup.js +26 -47
- package/dist/sdk/models/dashboard/user/jdSessionAccessToken.js +22 -41
- package/dist/sdk/models/dashboard/user/jdSessionUser.js +38 -63
- package/dist/sdk/models/dashboard/user/jdUser.js +39 -64
- package/dist/sdk/models/dashboard/user/jdUserRole.js +23 -46
- package/dist/sdk/models/jdResource.js +56 -74
- package/dist/sdk/models/modules/music/jdAlbum.js +50 -71
- package/dist/sdk/models/modules/music/jdArtist.js +37 -60
- package/dist/sdk/models/modules/music/jdComposer.js +37 -60
- package/dist/sdk/models/modules/music/jdMusicCombinations.js +2 -13
- package/dist/sdk/models/modules/music/jdSong.js +56 -75
- package/dist/sdk/utilities/browserUtils.js +6 -17
- package/dist/sdk/utilities/globalEventHandler.js +1 -3
- package/dist/sdk/utilities/utils.js +13 -14
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AAEvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AAGtC,cAAc,yBAAyB,CAAC;AAKxC,cAAc,sCAAsC,CAAC;AACrD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,0CAA0C,CAAC;AAGzD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,yCAAyC,CAAC;AACxD,cAAc,0CAA0C,CAAC;AACzD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,kDAAkD,CAAC;AACjE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC;AAGvD,cAAc,kCAAkC,CAAC;AACjD,cAAc,uCAAuC,CAAC;AAGtD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,8DAA8D,CAAC;AAO7E,cAAc,oCAAoC,CAAC;AACnD,cAAc,mCAAmC,CAAC;AAClD,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,gDAAgD,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/sdk/jdConnector.js
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
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
1
|
import { globalEventEmitter } from "./utilities/globalEventHandler";
|
|
11
2
|
import { Utils } from "./utilities/utils";
|
|
12
3
|
import JDConfig from "./configs/jdConfig";
|
|
13
4
|
export class SimpleResponse {
|
|
5
|
+
body;
|
|
6
|
+
statusCode;
|
|
14
7
|
constructor(body, statusCode) {
|
|
15
8
|
this.body = body;
|
|
16
9
|
this.statusCode = statusCode;
|
|
@@ -20,67 +13,57 @@ export class SimpleResponse {
|
|
|
20
13
|
}
|
|
21
14
|
}
|
|
22
15
|
export class JDConnector {
|
|
23
|
-
httpGetDirectAsync(
|
|
24
|
-
return
|
|
25
|
-
return yield this.httpASyncCallDirect(0 /* JDHttpType.GET */, url, params, headers, {}, bShowErrorMessage, true, false, bForceRefresh, bAutoHideBusyIndicator, overrideVersion);
|
|
26
|
-
});
|
|
16
|
+
async httpGetDirectAsync(url, headers, params, bShowErrorMessage, bForceRefresh = true, bAutoHideBusyIndicator = true, overrideVersion = '') {
|
|
17
|
+
return await this.httpASyncCallDirect(0 /* JDHttpType.GET */, url, params, headers, {}, bShowErrorMessage, true, false, bForceRefresh, bAutoHideBusyIndicator, overrideVersion);
|
|
27
18
|
}
|
|
28
|
-
httpPostDirectAsync(
|
|
29
|
-
return
|
|
30
|
-
return yield this.httpASyncCallDirect(1 /* JDHttpType.POST */, url, {}, headers, body, bShowErrorMessage, true, false, true, bAutoHideBusyIndicator, overrideVersion);
|
|
31
|
-
});
|
|
19
|
+
async httpPostDirectAsync(url, headers, body, bShowErrorMessage, bAutoHideBusyIndicator = true, overrideVersion = '') {
|
|
20
|
+
return await this.httpASyncCallDirect(1 /* JDHttpType.POST */, url, {}, headers, body, bShowErrorMessage, true, false, true, bAutoHideBusyIndicator, overrideVersion);
|
|
32
21
|
}
|
|
33
|
-
httpGetRelativeAsync(
|
|
34
|
-
return
|
|
35
|
-
return yield this.httpASyncCallDirect(0 /* JDHttpType.GET */, url, params, headers, {}, bShowErrorMessage, false, true, bForceRefresh, bAutoHideBusyIndicator, overrideVersion);
|
|
36
|
-
});
|
|
22
|
+
async httpGetRelativeAsync(url, headers, params, bShowErrorMessage, bForceRefresh = false, bAutoHideBusyIndicator = true, overrideVersion = '') {
|
|
23
|
+
return await this.httpASyncCallDirect(0 /* JDHttpType.GET */, url, params, headers, {}, bShowErrorMessage, false, true, bForceRefresh, bAutoHideBusyIndicator, overrideVersion);
|
|
37
24
|
}
|
|
38
|
-
httpPostRelativeAsync(
|
|
39
|
-
return
|
|
40
|
-
return yield this.httpASyncCallDirect(1 /* JDHttpType.POST */, url, {}, headers, body, bShowErrorMessage, false, true, false, bAutoHideBusyIndicator, overrideVersion);
|
|
41
|
-
});
|
|
25
|
+
async httpPostRelativeAsync(url, headers, body, bShowErrorMessage, bAutoHideBusyIndicator = true, overrideVersion = '') {
|
|
26
|
+
return await this.httpASyncCallDirect(1 /* JDHttpType.POST */, url, {}, headers, body, bShowErrorMessage, false, true, false, bAutoHideBusyIndicator, overrideVersion);
|
|
42
27
|
}
|
|
43
|
-
httpASyncCallDirect(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
finalResponse = new SimpleResponse(responseText, response.status);
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
//Request with GET/HEAD method cannot have body.
|
|
65
|
-
const response = yield fetch(finalURL, {
|
|
66
|
-
method: 'GET',
|
|
67
|
-
headers: headers
|
|
68
|
-
});
|
|
69
|
-
const responseText = yield response.text();
|
|
70
|
-
finalResponse = new SimpleResponse(responseText, response.status);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
catch (ex) {
|
|
74
|
-
console.log(ex);
|
|
75
|
-
finalResponse = new SimpleResponse(finalURL, 403);
|
|
28
|
+
async httpASyncCallDirect(httpType, url, params, headers, body, bShowErrorMessage, bBuildParams, bRelativeURL = true, bForceRefresh = true, bAutoHideBusyIndicator = true, overrideVersion = '') {
|
|
29
|
+
const finalURL = this.buildURL(httpType, url, params, true, bRelativeURL);
|
|
30
|
+
// console.log(bRelativeURL);
|
|
31
|
+
// console.log(`Final URL: ${finalURL}`);
|
|
32
|
+
//Only for debugging purposes only
|
|
33
|
+
if (globalThis.bForceRefreshGetRequests) {
|
|
34
|
+
bForceRefresh = true;
|
|
35
|
+
}
|
|
36
|
+
let finalResponse = new SimpleResponse('failed', 400);
|
|
37
|
+
try {
|
|
38
|
+
if (httpType == 1 /* JDHttpType.POST */) {
|
|
39
|
+
const response = await fetch(finalURL, {
|
|
40
|
+
method: 'POST',
|
|
41
|
+
body: JSON.stringify(body), // string or object
|
|
42
|
+
headers: headers
|
|
43
|
+
});
|
|
44
|
+
const responseText = await response.text();
|
|
45
|
+
finalResponse = new SimpleResponse(responseText, response.status);
|
|
76
46
|
}
|
|
77
|
-
|
|
78
|
-
//
|
|
79
|
-
|
|
47
|
+
else {
|
|
48
|
+
//Request with GET/HEAD method cannot have body.
|
|
49
|
+
const response = await fetch(finalURL, {
|
|
50
|
+
method: 'GET',
|
|
51
|
+
headers: headers
|
|
52
|
+
});
|
|
53
|
+
const responseText = await response.text();
|
|
54
|
+
finalResponse = new SimpleResponse(responseText, response.status);
|
|
80
55
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
56
|
+
}
|
|
57
|
+
catch (ex) {
|
|
58
|
+
console.log(ex);
|
|
59
|
+
finalResponse = new SimpleResponse(finalURL, 403);
|
|
60
|
+
}
|
|
61
|
+
if (bShowErrorMessage && finalResponse.statusCode != 200) {
|
|
62
|
+
//Emit event so that the client can listen and show the actual dialog
|
|
63
|
+
globalEventEmitter.emit("show_alert_dialog", { type: "error", message: finalResponse.body });
|
|
64
|
+
}
|
|
65
|
+
// console.log(finalResponse);
|
|
66
|
+
return finalResponse;
|
|
84
67
|
}
|
|
85
68
|
// ////////////////////////////////////////////////////////////////////////////////////////////////
|
|
86
69
|
// ////////////////////////// Connector Utilities Functions //////////////////////////
|
|
@@ -1,22 +1,13 @@
|
|
|
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
1
|
import JDResource, { ConnectorInfo } from "../../jdResource";
|
|
11
2
|
import { Utils } from "../../../utilities/utils";
|
|
12
3
|
export class JDCity extends JDResource {
|
|
4
|
+
stateId = "";
|
|
5
|
+
state = {};
|
|
13
6
|
get localisedStateTitle() { return globalThis.language == 'en' ? this.stateTitleEN : this.stateTitleMM; }
|
|
14
7
|
get stateTitleEN() { return Utils.getString(Utils.getObject(this.state, 'title'), 'en'); }
|
|
15
8
|
get stateTitleMM() { return Utils.getString(Utils.getObject(this.state, 'title'), 'mm'); }
|
|
16
9
|
constructor(data = {}, connectorInfo = new ConnectorInfo("", "")) {
|
|
17
10
|
super(connectorInfo);
|
|
18
|
-
this.stateId = "";
|
|
19
|
-
this.state = {};
|
|
20
11
|
this.setData(data);
|
|
21
12
|
}
|
|
22
13
|
setData(data) {
|
|
@@ -24,41 +15,29 @@ export class JDCity extends JDResource {
|
|
|
24
15
|
this.stateId = Utils.getString(data, "state_id");
|
|
25
16
|
this.state = Utils.getObject(data, "state");
|
|
26
17
|
}
|
|
27
|
-
getContents() {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return yield this.getRelative('/dashboard/geolocation/cities', queryParams);
|
|
31
|
-
});
|
|
18
|
+
async getContents(params = {}) {
|
|
19
|
+
const queryParams = this.getSortParameters(params);
|
|
20
|
+
return await this.getRelative('/dashboard/geolocation/cities', queryParams);
|
|
32
21
|
}
|
|
33
|
-
paginateContents() {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return yield this.getRelative('/dashboard/geolocation/cities/paginate', queryParams);
|
|
39
|
-
});
|
|
22
|
+
async paginateContents(params = {}) {
|
|
23
|
+
const queryParams = this.getSortParameters(params);
|
|
24
|
+
if (params.name)
|
|
25
|
+
queryParams['name'] = params.name;
|
|
26
|
+
return await this.getRelative('/dashboard/geolocation/cities/paginate', queryParams);
|
|
40
27
|
}
|
|
41
|
-
findContents(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return yield this.getRelative('/dashboard/geolocation/cities/find', queryParams);
|
|
46
|
-
});
|
|
28
|
+
async findContents(title, params = {}) {
|
|
29
|
+
const queryParams = this.getSortParameters(params);
|
|
30
|
+
queryParams['title'] = title;
|
|
31
|
+
return await this.getRelative('/dashboard/geolocation/cities/find', queryParams);
|
|
47
32
|
}
|
|
48
|
-
getDistricts(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
return yield this.getRelative(`/dashboard/geolocation/cities/${stateId}/districts`, queryParams);
|
|
52
|
-
});
|
|
33
|
+
async getDistricts(stateId, params = {}) {
|
|
34
|
+
const queryParams = this.getSortParameters(params);
|
|
35
|
+
return await this.getRelative(`/dashboard/geolocation/cities/${stateId}/districts`, queryParams);
|
|
53
36
|
}
|
|
54
|
-
getInfo(id) {
|
|
55
|
-
return
|
|
56
|
-
return yield this.getRelative(`/dashboard/geolocation/cities/${id}`, {});
|
|
57
|
-
});
|
|
37
|
+
async getInfo(id) {
|
|
38
|
+
return await this.getRelative(`/dashboard/geolocation/cities/${id}`, {});
|
|
58
39
|
}
|
|
59
|
-
updateFields(
|
|
60
|
-
return
|
|
61
|
-
return yield this.postRelative(`/dashboard/geolocation/cities/${id}/update`, body);
|
|
62
|
-
});
|
|
40
|
+
async updateFields(id, body = {}) {
|
|
41
|
+
return await this.postRelative(`/dashboard/geolocation/cities/${id}/update`, body);
|
|
63
42
|
}
|
|
64
43
|
}
|
|
@@ -1,12 +1,3 @@
|
|
|
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
1
|
import JDResource, { ConnectorInfo } from "../../jdResource";
|
|
11
2
|
export class JDCountry extends JDResource {
|
|
12
3
|
constructor(data = {}, connectorInfo = new ConnectorInfo("", "")) {
|
|
@@ -16,41 +7,29 @@ export class JDCountry extends JDResource {
|
|
|
16
7
|
setData(data) {
|
|
17
8
|
super.setData(data);
|
|
18
9
|
}
|
|
19
|
-
getContents() {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
return yield this.getRelative(`/dashboard/geolocation/countries/${countryId}/states`, queryParams);
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
getInfo(id) {
|
|
47
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
-
return yield this.getRelative(`/dashboard/geolocation/countries/${id}`, {});
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
updateFields(id_1) {
|
|
52
|
-
return __awaiter(this, arguments, void 0, function* (id, body = {}) {
|
|
53
|
-
return yield this.postRelative(`/dashboard/geolocation/countries/${id}/update`, body);
|
|
54
|
-
});
|
|
10
|
+
async getContents(params = {}) {
|
|
11
|
+
const queryParams = this.getSortParameters(params);
|
|
12
|
+
return await this.getRelative('/dashboard/geolocation/countries', queryParams);
|
|
13
|
+
}
|
|
14
|
+
async paginateContents(params = {}) {
|
|
15
|
+
const queryParams = this.getSortParameters(params);
|
|
16
|
+
if (params.name)
|
|
17
|
+
queryParams['name'] = params.name;
|
|
18
|
+
return await this.getRelative('/dashboard/geolocation/countries/paginate', queryParams);
|
|
19
|
+
}
|
|
20
|
+
async findContents(title, params = {}) {
|
|
21
|
+
const queryParams = this.getSortParameters(params);
|
|
22
|
+
queryParams['title'] = title;
|
|
23
|
+
return await this.getRelative('/dashboard/geolocation/countries/find', queryParams);
|
|
24
|
+
}
|
|
25
|
+
async getStates(countryId, params = {}) {
|
|
26
|
+
const queryParams = this.getSortParameters(params);
|
|
27
|
+
return await this.getRelative(`/dashboard/geolocation/countries/${countryId}/states`, queryParams);
|
|
28
|
+
}
|
|
29
|
+
async getInfo(id) {
|
|
30
|
+
return await this.getRelative(`/dashboard/geolocation/countries/${id}`, {});
|
|
31
|
+
}
|
|
32
|
+
async updateFields(id, body = {}) {
|
|
33
|
+
return await this.postRelative(`/dashboard/geolocation/countries/${id}/update`, body);
|
|
55
34
|
}
|
|
56
35
|
}
|
|
@@ -1,22 +1,13 @@
|
|
|
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
1
|
import JDResource, { ConnectorInfo } from "../../jdResource";
|
|
11
2
|
import { Utils } from "../../../utilities/utils";
|
|
12
3
|
export class JDDistrict extends JDResource {
|
|
4
|
+
cityId = "";
|
|
5
|
+
city = {};
|
|
13
6
|
get localisedCityTitle() { return globalThis.language == 'en' ? this.cityTitleEN : this.cityTitleMM; }
|
|
14
7
|
get cityTitleEN() { return Utils.getString(Utils.getObject(this.city, 'title'), 'en'); }
|
|
15
8
|
get cityTitleMM() { return Utils.getString(Utils.getObject(this.city, 'title'), 'mm'); }
|
|
16
9
|
constructor(data = {}, connectorInfo = new ConnectorInfo("", "")) {
|
|
17
10
|
super(connectorInfo);
|
|
18
|
-
this.cityId = "";
|
|
19
|
-
this.city = {};
|
|
20
11
|
this.setData(data);
|
|
21
12
|
}
|
|
22
13
|
setData(data) {
|
|
@@ -24,35 +15,25 @@ export class JDDistrict extends JDResource {
|
|
|
24
15
|
this.cityId = Utils.getString(data, "city_id");
|
|
25
16
|
this.city = Utils.getObject(data, "city");
|
|
26
17
|
}
|
|
27
|
-
getContents() {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return yield this.getRelative('/dashboard/geolocation/districts', queryParams);
|
|
31
|
-
});
|
|
18
|
+
async getContents(params = {}) {
|
|
19
|
+
const queryParams = this.getSortParameters(params);
|
|
20
|
+
return await this.getRelative('/dashboard/geolocation/districts', queryParams);
|
|
32
21
|
}
|
|
33
|
-
paginateContents() {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return yield this.getRelative('/dashboard/geolocation/districts/paginate', queryParams);
|
|
39
|
-
});
|
|
22
|
+
async paginateContents(params = {}) {
|
|
23
|
+
const queryParams = this.getSortParameters(params);
|
|
24
|
+
if (params.name)
|
|
25
|
+
queryParams['name'] = params.name;
|
|
26
|
+
return await this.getRelative('/dashboard/geolocation/districts/paginate', queryParams);
|
|
40
27
|
}
|
|
41
|
-
findContents(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return yield this.getRelative('/dashboard/geolocation/districts/find', queryParams);
|
|
46
|
-
});
|
|
28
|
+
async findContents(title, params = {}) {
|
|
29
|
+
const queryParams = this.getSortParameters(params);
|
|
30
|
+
queryParams['title'] = title;
|
|
31
|
+
return await this.getRelative('/dashboard/geolocation/districts/find', queryParams);
|
|
47
32
|
}
|
|
48
|
-
getInfo(id) {
|
|
49
|
-
return
|
|
50
|
-
return yield this.getRelative(`/dashboard/geolocation/districts/${id}`, {});
|
|
51
|
-
});
|
|
33
|
+
async getInfo(id) {
|
|
34
|
+
return await this.getRelative(`/dashboard/geolocation/districts/${id}`, {});
|
|
52
35
|
}
|
|
53
|
-
updateFields(
|
|
54
|
-
return
|
|
55
|
-
return yield this.postRelative(`/dashboard/geolocation/districts/${id}/update`, body);
|
|
56
|
-
});
|
|
36
|
+
async updateFields(id, body = {}) {
|
|
37
|
+
return await this.postRelative(`/dashboard/geolocation/districts/${id}/update`, body);
|
|
57
38
|
}
|
|
58
39
|
}
|
|
@@ -1,21 +1,10 @@
|
|
|
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
1
|
import JDResource, { ConnectorInfo } from "../../jdResource";
|
|
11
2
|
export class JdGeolocationCombinations extends JDResource {
|
|
12
3
|
constructor(data = {}, connectorInfo = new ConnectorInfo("", "")) {
|
|
13
4
|
super(connectorInfo);
|
|
14
5
|
this.setData(data);
|
|
15
6
|
}
|
|
16
|
-
getOverview() {
|
|
17
|
-
return
|
|
18
|
-
return yield this.getRelative('/dashboard/geolocation/combinations/overview', {});
|
|
19
|
-
});
|
|
7
|
+
async getOverview() {
|
|
8
|
+
return await this.getRelative('/dashboard/geolocation/combinations/overview', {});
|
|
20
9
|
}
|
|
21
10
|
}
|
|
@@ -1,22 +1,13 @@
|
|
|
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
1
|
import JDResource, { ConnectorInfo } from "../../jdResource";
|
|
11
2
|
import { Utils } from "../../../utilities/utils";
|
|
12
3
|
export class JDState extends JDResource {
|
|
4
|
+
countryId = "";
|
|
5
|
+
country = {};
|
|
13
6
|
get localisedCountryTitle() { return globalThis.language == 'en' ? this.countryTitleEN : this.countryTitleMM; }
|
|
14
7
|
get countryTitleEN() { return Utils.getString(Utils.getObject(this.country, 'title'), 'en'); }
|
|
15
8
|
get countryTitleMM() { return Utils.getString(Utils.getObject(this.country, 'title'), 'mm'); }
|
|
16
9
|
constructor(data = {}, connectorInfo = new ConnectorInfo("", "")) {
|
|
17
10
|
super(connectorInfo);
|
|
18
|
-
this.countryId = "";
|
|
19
|
-
this.country = {};
|
|
20
11
|
this.setData(data);
|
|
21
12
|
}
|
|
22
13
|
setData(data) {
|
|
@@ -24,41 +15,29 @@ export class JDState extends JDResource {
|
|
|
24
15
|
this.countryId = Utils.getString(data, "country_id");
|
|
25
16
|
this.country = Utils.getObject(data, "country");
|
|
26
17
|
}
|
|
27
|
-
getContents() {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return yield this.getRelative('/dashboard/geolocation/states', queryParams);
|
|
31
|
-
});
|
|
18
|
+
async getContents(params = {}) {
|
|
19
|
+
const queryParams = this.getSortParameters(params);
|
|
20
|
+
return await this.getRelative('/dashboard/geolocation/states', queryParams);
|
|
32
21
|
}
|
|
33
|
-
paginateContents() {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return yield this.getRelative('/dashboard/geolocation/states/paginate', queryParams);
|
|
39
|
-
});
|
|
22
|
+
async paginateContents(params = {}) {
|
|
23
|
+
const queryParams = this.getSortParameters(params);
|
|
24
|
+
if (params.name)
|
|
25
|
+
queryParams['name'] = params.name;
|
|
26
|
+
return await this.getRelative('/dashboard/geolocation/states/paginate', queryParams);
|
|
40
27
|
}
|
|
41
|
-
findContents(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return yield this.getRelative('/dashboard/geolocation/states/find', queryParams);
|
|
46
|
-
});
|
|
28
|
+
async findContents(title, params = {}) {
|
|
29
|
+
const queryParams = this.getSortParameters(params);
|
|
30
|
+
queryParams['title'] = title;
|
|
31
|
+
return await this.getRelative('/dashboard/geolocation/states/find', queryParams);
|
|
47
32
|
}
|
|
48
|
-
getCities(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
return yield this.getRelative(`/dashboard/geolocation/states/${countryId}/cities`, queryParams);
|
|
52
|
-
});
|
|
33
|
+
async getCities(countryId, params = {}) {
|
|
34
|
+
const queryParams = this.getSortParameters(params);
|
|
35
|
+
return await this.getRelative(`/dashboard/geolocation/states/${countryId}/cities`, queryParams);
|
|
53
36
|
}
|
|
54
|
-
getInfo(id) {
|
|
55
|
-
return
|
|
56
|
-
return yield this.getRelative(`/dashboard/geolocation/states/${id}`, {});
|
|
57
|
-
});
|
|
37
|
+
async getInfo(id) {
|
|
38
|
+
return await this.getRelative(`/dashboard/geolocation/states/${id}`, {});
|
|
58
39
|
}
|
|
59
|
-
updateFields(
|
|
60
|
-
return
|
|
61
|
-
return yield this.postRelative(`/dashboard/geolocation/states/${id}/update`, body);
|
|
62
|
-
});
|
|
40
|
+
async updateFields(id, body = {}) {
|
|
41
|
+
return await this.postRelative(`/dashboard/geolocation/states/${id}/update`, body);
|
|
63
42
|
}
|
|
64
43
|
}
|
|
@@ -1,27 +1,18 @@
|
|
|
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
1
|
import JDResource, { ConnectorInfo } from "../jdResource";
|
|
11
2
|
import { Utils } from "../../utilities/utils";
|
|
12
3
|
export class JDApplication extends JDResource {
|
|
4
|
+
appId = '';
|
|
5
|
+
appKey = '';
|
|
6
|
+
appSecret = '';
|
|
7
|
+
storeLinks = {};
|
|
8
|
+
urls = {};
|
|
9
|
+
orientation = '';
|
|
10
|
+
version = '';
|
|
11
|
+
versionCode = 0;
|
|
12
|
+
bundleCodeAndroid = 0;
|
|
13
|
+
bundleCodeIos = 0;
|
|
13
14
|
constructor(data = {}, connectorInfo = new ConnectorInfo("", "")) {
|
|
14
15
|
super(connectorInfo);
|
|
15
|
-
this.appId = '';
|
|
16
|
-
this.appKey = '';
|
|
17
|
-
this.appSecret = '';
|
|
18
|
-
this.storeLinks = {};
|
|
19
|
-
this.urls = {};
|
|
20
|
-
this.orientation = '';
|
|
21
|
-
this.version = '';
|
|
22
|
-
this.versionCode = 0;
|
|
23
|
-
this.bundleCodeAndroid = 0;
|
|
24
|
-
this.bundleCodeIos = 0;
|
|
25
16
|
this.setData(data);
|
|
26
17
|
}
|
|
27
18
|
setData(data) {
|
|
@@ -37,40 +28,30 @@ export class JDApplication extends JDResource {
|
|
|
37
28
|
this.bundleCodeAndroid = Utils.getInteger(data, 'bundle_code_android');
|
|
38
29
|
this.bundleCodeIos = Utils.getInteger(data, 'bundle_code_ios');
|
|
39
30
|
}
|
|
40
|
-
getContents() {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
return yield this.getRelative('/dashboard/applications', queryParams);
|
|
44
|
-
});
|
|
31
|
+
async getContents(params = {}) {
|
|
32
|
+
const queryParams = this.getSortParameters(params);
|
|
33
|
+
return await this.getRelative('/dashboard/applications', queryParams);
|
|
45
34
|
}
|
|
46
|
-
paginateContents() {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return yield this.getRelative('/dashboard/applications', queryParams);
|
|
56
|
-
});
|
|
35
|
+
async paginateContents(params = {}) {
|
|
36
|
+
const queryParams = this.getSortParameters(params);
|
|
37
|
+
if (params.name)
|
|
38
|
+
queryParams['name'] = params.name;
|
|
39
|
+
if (params.sandbox)
|
|
40
|
+
queryParams['sandbox'] = params.sandbox;
|
|
41
|
+
if (params.featured)
|
|
42
|
+
queryParams['featured'] = params.featured;
|
|
43
|
+
return await this.getRelative('/dashboard/applications', queryParams);
|
|
57
44
|
}
|
|
58
|
-
findContents() {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return yield this.getRelative('/dashboard/applications', queryParams);
|
|
64
|
-
});
|
|
45
|
+
async findContents(params = {}) {
|
|
46
|
+
const queryParams = this.getSortParameters(params);
|
|
47
|
+
if (params.title)
|
|
48
|
+
queryParams['name'] = params.title;
|
|
49
|
+
return await this.getRelative('/dashboard/applications', queryParams);
|
|
65
50
|
}
|
|
66
|
-
getInfo(id) {
|
|
67
|
-
return
|
|
68
|
-
return yield this.getRelative(`/dashboard/applications/${id}`, {});
|
|
69
|
-
});
|
|
51
|
+
async getInfo(id) {
|
|
52
|
+
return await this.getRelative(`/dashboard/applications/${id}`, {});
|
|
70
53
|
}
|
|
71
|
-
updateFields(
|
|
72
|
-
return
|
|
73
|
-
return yield this.postRelative(`/dashboard/applications/${id}/update`, body);
|
|
74
|
-
});
|
|
54
|
+
async updateFields(id, body = {}) {
|
|
55
|
+
return await this.postRelative(`/dashboard/applications/${id}/update`, body);
|
|
75
56
|
}
|
|
76
57
|
}
|