jd_platform_sdk 0.1.5 → 0.1.7

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 (35) hide show
  1. package/dist/sdk/configs/jdConfig.js +1 -0
  2. package/dist/sdk/jdConnector.js +47 -64
  3. package/dist/sdk/models/dashboard/geolocation/jdCity.js +21 -42
  4. package/dist/sdk/models/dashboard/geolocation/jdCountry.js +24 -45
  5. package/dist/sdk/models/dashboard/geolocation/jdDistrict.js +18 -37
  6. package/dist/sdk/models/dashboard/geolocation/jdGeolocationCombinations.js +2 -13
  7. package/dist/sdk/models/dashboard/geolocation/jdState.js +21 -42
  8. package/dist/sdk/models/dashboard/jdApplication.js +31 -50
  9. package/dist/sdk/models/dashboard/jdCallbackNotification.js +36 -55
  10. package/dist/sdk/models/dashboard/jdDashboardCombinations.js +2 -13
  11. package/dist/sdk/models/dashboard/jdKtvShop.js +32 -51
  12. package/dist/sdk/models/dashboard/jdModule.js +19 -38
  13. package/dist/sdk/models/dashboard/jdPlatform.d.ts +1 -1
  14. package/dist/sdk/models/dashboard/jdPlatform.d.ts.map +1 -1
  15. package/dist/sdk/models/dashboard/jdPlatform.js +19 -38
  16. package/dist/sdk/models/dashboard/jdRadioStation.js +32 -51
  17. package/dist/sdk/models/dashboard/jdSmsVerification.js +21 -40
  18. package/dist/sdk/models/dashboard/user/jdAccessToken.js +20 -39
  19. package/dist/sdk/models/dashboard/user/jdModerator.js +27 -46
  20. package/dist/sdk/models/dashboard/user/jdPermission.js +25 -44
  21. package/dist/sdk/models/dashboard/user/jdPermissionGroup.js +26 -47
  22. package/dist/sdk/models/dashboard/user/jdSessionAccessToken.js +22 -41
  23. package/dist/sdk/models/dashboard/user/jdSessionUser.js +38 -63
  24. package/dist/sdk/models/dashboard/user/jdUser.js +39 -64
  25. package/dist/sdk/models/dashboard/user/jdUserRole.js +23 -46
  26. package/dist/sdk/models/jdResource.js +56 -74
  27. package/dist/sdk/models/modules/music/jdAlbum.js +50 -71
  28. package/dist/sdk/models/modules/music/jdArtist.js +37 -60
  29. package/dist/sdk/models/modules/music/jdComposer.js +37 -60
  30. package/dist/sdk/models/modules/music/jdMusicCombinations.js +2 -13
  31. package/dist/sdk/models/modules/music/jdSong.js +56 -75
  32. package/dist/sdk/utilities/browserUtils.js +6 -17
  33. package/dist/sdk/utilities/globalEventHandler.js +1 -3
  34. package/dist/sdk/utilities/utils.js +13 -14
  35. package/package.json +1 -1
@@ -1,5 +1,6 @@
1
1
  // Singleton class to be able to call from everywhere with minified compatible
2
2
  export default class JDConfig {
3
+ static _instance;
3
4
  //Singleton constructor shouldn't be called directly and use JDConfig.instance
4
5
  constructor() { }
5
6
  static get instance() {
@@ -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(url_1, headers_1, params_1, bShowErrorMessage_1) {
24
- return __awaiter(this, arguments, void 0, function* (url, headers, params, bShowErrorMessage, bForceRefresh = true, bAutoHideBusyIndicator = true, overrideVersion = '') {
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(url_1, headers_1, body_1, bShowErrorMessage_1) {
29
- return __awaiter(this, arguments, void 0, function* (url, headers, body, bShowErrorMessage, bAutoHideBusyIndicator = true, overrideVersion = '') {
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(url_1, headers_1, params_1, bShowErrorMessage_1) {
34
- return __awaiter(this, arguments, void 0, function* (url, headers, params, bShowErrorMessage, bForceRefresh = false, bAutoHideBusyIndicator = true, overrideVersion = '') {
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(url_1, headers_1, body_1, bShowErrorMessage_1) {
39
- return __awaiter(this, arguments, void 0, function* (url, headers, body, bShowErrorMessage, bAutoHideBusyIndicator = true, overrideVersion = '') {
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(httpType_1, url_1, params_1, headers_1, body_1, bShowErrorMessage_1, bBuildParams_1) {
44
- return __awaiter(this, arguments, void 0, function* (httpType, url, params, headers, body, bShowErrorMessage, bBuildParams, bRelativeURL = true, bForceRefresh = true, bAutoHideBusyIndicator = true, overrideVersion = '') {
45
- const finalURL = this.buildURL(httpType, url, params, true, bRelativeURL);
46
- // console.log(bRelativeURL);
47
- // console.log(`Final URL: ${finalURL}`);
48
- //Only for debugging purposes only
49
- if (globalThis.bForceRefreshGetRequests) {
50
- bForceRefresh = true;
51
- }
52
- let finalResponse = new SimpleResponse('failed', 400);
53
- try {
54
- if (httpType == 1 /* JDHttpType.POST */) {
55
- const response = yield fetch(finalURL, {
56
- method: 'POST',
57
- body: JSON.stringify(body), // string or object
58
- headers: headers
59
- });
60
- const responseText = yield response.text();
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
- if (bShowErrorMessage && finalResponse.statusCode != 200) {
78
- //Emit event so that the client can listen and show the actual dialog
79
- globalEventEmitter.emit("show_alert_dialog", { type: "error", message: finalResponse.body });
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
- // console.log(finalResponse);
82
- return finalResponse;
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
- return __awaiter(this, arguments, void 0, function* (params = {}) {
29
- const queryParams = this.getSortParameters(params);
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
- 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('/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(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('/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(stateId_1) {
49
- return __awaiter(this, arguments, void 0, function* (stateId, params = {}) {
50
- const queryParams = this.getSortParameters(params);
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 __awaiter(this, void 0, void 0, function* () {
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(id_1) {
60
- return __awaiter(this, arguments, void 0, function* (id, body = {}) {
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
- return __awaiter(this, arguments, void 0, function* (params = {}) {
21
- const queryParams = this.getSortParameters(params);
22
- return yield this.getRelative('/dashboard/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('/dashboard/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('/dashboard/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(`/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
- return __awaiter(this, arguments, void 0, function* (params = {}) {
29
- const queryParams = this.getSortParameters(params);
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
- 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('/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(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('/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 __awaiter(this, void 0, void 0, function* () {
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(id_1) {
54
- return __awaiter(this, arguments, void 0, function* (id, body = {}) {
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 __awaiter(this, void 0, void 0, function* () {
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
- return __awaiter(this, arguments, void 0, function* (params = {}) {
29
- const queryParams = this.getSortParameters(params);
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
- 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('/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(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('/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(countryId_1) {
49
- return __awaiter(this, arguments, void 0, function* (countryId, params = {}) {
50
- const queryParams = this.getSortParameters(params);
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 __awaiter(this, void 0, void 0, function* () {
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(id_1) {
60
- return __awaiter(this, arguments, void 0, function* (id, body = {}) {
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
- return __awaiter(this, arguments, void 0, function* (params = {}) {
42
- const queryParams = this.getSortParameters(params);
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
- 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
- });
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
- 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);
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 __awaiter(this, void 0, void 0, function* () {
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(id_1) {
72
- return __awaiter(this, arguments, void 0, function* (id, body = {}) {
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
  }