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
package/dist/index.js
CHANGED
|
@@ -1,52 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./sdk/jdConnector"), exports);
|
|
18
|
-
__exportStar(require("./sdk/jdSdk"), exports);
|
|
19
|
-
__exportStar(require("./sdk/configs/jdConfig"), exports);
|
|
1
|
+
export * from "./sdk/jdConnector";
|
|
2
|
+
export * from "./sdk/jdSdk";
|
|
3
|
+
export * from "./sdk/configs/jdConfig";
|
|
20
4
|
// export * from "./sdk/extensions/extensions";
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
5
|
+
export * from "./sdk/utilities/browserUtils";
|
|
6
|
+
export * from "./sdk/utilities/cryptoUtils";
|
|
7
|
+
export * from "./sdk/utilities/dateUtils";
|
|
8
|
+
export * from "./sdk/utilities/globalEventHandler";
|
|
9
|
+
export * from "./sdk/utilities/stringUtils";
|
|
10
|
+
export * from "./sdk/utilities/utils";
|
|
27
11
|
// Generic Models for different possible modules for all platforms
|
|
28
|
-
|
|
29
|
-
|
|
12
|
+
export * from "./sdk/models/jdResource";
|
|
13
|
+
export * from "./sdk/models/jdApplication";
|
|
30
14
|
//Dashboard
|
|
31
|
-
|
|
15
|
+
export * from "./sdk/models/modules/dashboard/jdDashboardCombinations";
|
|
32
16
|
//User
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
17
|
+
export * from "./sdk/models/modules/user/jdUser";
|
|
18
|
+
export * from "./sdk/models/modules/user/jdUserRole";
|
|
19
|
+
export * from "./sdk/models/modules/user/jdSessionUser";
|
|
20
|
+
export * from "./sdk/models/modules/user/jdPermission";
|
|
21
|
+
export * from "./sdk/models/modules/user/jdPermissionGroup";
|
|
38
22
|
//Karaoke
|
|
39
|
-
|
|
23
|
+
export * from "./sdk/models/modules/karaoke/jdKtvShop";
|
|
40
24
|
//Radio Station
|
|
41
|
-
|
|
25
|
+
export * from "./sdk/models/modules/radio_station/jdRadioStation";
|
|
42
26
|
//Music
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
27
|
+
export * from "./sdk/models/modules/music/jdAlbum";
|
|
28
|
+
export * from "./sdk/models/modules/music/jdSong";
|
|
29
|
+
export * from "./sdk/models/modules/music/jdArtist";
|
|
30
|
+
export * from "./sdk/models/modules/music/jdComposer";
|
|
31
|
+
export * from "./sdk/models/modules/music/jdMusicCombinations";
|
|
48
32
|
//Geolocation
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
33
|
+
export * from "./sdk/models/modules/geolocation/jdCountry";
|
|
34
|
+
export * from "./sdk/models/modules/geolocation/jdState";
|
|
35
|
+
export * from "./sdk/models/modules/geolocation/jdCity";
|
|
36
|
+
export * from "./sdk/models/modules/geolocation/jdDistrict";
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
1
|
// Singleton class to be able to call from everywhere with minified compatible
|
|
4
|
-
class JDConfig {
|
|
5
|
-
static _instance;
|
|
2
|
+
export default class JDConfig {
|
|
6
3
|
//Singleton constructor shouldn't be called directly and use JDConfig.instance
|
|
7
4
|
constructor() { }
|
|
8
5
|
static get instance() {
|
|
@@ -39,4 +36,3 @@ class JDConfig {
|
|
|
39
36
|
}
|
|
40
37
|
}
|
|
41
38
|
}
|
|
42
|
-
exports.default = JDConfig;
|
package/dist/sdk/jdConnector.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return (
|
|
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
|
+
});
|
|
4
9
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const jdConfig_1 = __importDefault(require("./configs/jdConfig"));
|
|
10
|
-
class SimpleResponse {
|
|
11
|
-
body;
|
|
12
|
-
statusCode;
|
|
10
|
+
import { globalEventEmitter } from "./utilities/globalEventHandler";
|
|
11
|
+
import { Utils } from "./utilities/utils";
|
|
12
|
+
import JDConfig from "./configs/jdConfig";
|
|
13
|
+
export class SimpleResponse {
|
|
13
14
|
constructor(body, statusCode) {
|
|
14
15
|
this.body = body;
|
|
15
16
|
this.statusCode = statusCode;
|
|
@@ -18,59 +19,68 @@ class SimpleResponse {
|
|
|
18
19
|
return this.body == '' || this.statusCode == -1;
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
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
|
+
});
|
|
25
27
|
}
|
|
26
|
-
|
|
27
|
-
return
|
|
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
|
+
});
|
|
28
32
|
}
|
|
29
|
-
|
|
30
|
-
return
|
|
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
|
+
});
|
|
31
37
|
}
|
|
32
|
-
|
|
33
|
-
return
|
|
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
|
+
});
|
|
34
42
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
let finalResponse = new SimpleResponse('failed', 400);
|
|
44
|
-
try {
|
|
45
|
-
if (httpType == 1 /* JDHttpType.POST */) {
|
|
46
|
-
const response = await fetch(finalURL, {
|
|
47
|
-
method: 'POST',
|
|
48
|
-
body: JSON.stringify(body), // string or object
|
|
49
|
-
headers: headers
|
|
50
|
-
});
|
|
51
|
-
const responseText = await response.text();
|
|
52
|
-
finalResponse = new SimpleResponse(responseText, response.status);
|
|
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;
|
|
53
51
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
+
}
|
|
62
72
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
catch (ex) {
|
|
74
|
+
console.log(ex);
|
|
75
|
+
finalResponse = new SimpleResponse(finalURL, 403);
|
|
76
|
+
}
|
|
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 });
|
|
80
|
+
}
|
|
81
|
+
// console.log(finalResponse);
|
|
82
|
+
return finalResponse;
|
|
83
|
+
});
|
|
74
84
|
}
|
|
75
85
|
// ////////////////////////////////////////////////////////////////////////////////////////////////
|
|
76
86
|
// ////////////////////////// Connector Utilities Functions //////////////////////////
|
|
@@ -81,7 +91,7 @@ class JDConnector {
|
|
|
81
91
|
// Build a query parameters from a Map type to URL encoded string like ?event=test&type=001
|
|
82
92
|
buildParams(params) {
|
|
83
93
|
let finalParams = "";
|
|
84
|
-
if (
|
|
94
|
+
if (Utils.isNotEmpty(params)) {
|
|
85
95
|
let index = 0;
|
|
86
96
|
for (const key in params) {
|
|
87
97
|
const val = params[key];
|
|
@@ -100,14 +110,14 @@ class JDConnector {
|
|
|
100
110
|
//bBuildParams - Whether or not the parameters will be embedded in URL
|
|
101
111
|
//TODO: version should be able to override
|
|
102
112
|
buildURL(httpType, baseUrl, params, bBuildParams = false, bRelativeURL = true, overrideVersion = '') {
|
|
103
|
-
const strHost =
|
|
113
|
+
const strHost = JDConfig.getAPIHost();
|
|
104
114
|
let url = strHost + baseUrl;
|
|
105
115
|
if (!bRelativeURL) {
|
|
106
116
|
url = baseUrl;
|
|
107
117
|
}
|
|
108
118
|
// //Add hashtable form values for GET request
|
|
109
119
|
if (httpType == 0 /* JDHttpType.GET */) {
|
|
110
|
-
if (
|
|
120
|
+
if (Utils.isNotEmpty(params) && bBuildParams) {
|
|
111
121
|
url += this.buildParams(params);
|
|
112
122
|
}
|
|
113
123
|
}
|
|
@@ -121,7 +131,7 @@ class JDConnector {
|
|
|
121
131
|
buildDirectURL(httpType, url, data) {
|
|
122
132
|
//Add hashtable form values for GET request
|
|
123
133
|
if (httpType == 0 /* JDHttpType.GET */) {
|
|
124
|
-
if (
|
|
134
|
+
if (Utils.isNotEmpty(data))
|
|
125
135
|
url += this.buildParams(data);
|
|
126
136
|
}
|
|
127
137
|
// Replace all instances of "\r\n" with "\n"
|
|
@@ -131,4 +141,3 @@ class JDConnector {
|
|
|
131
141
|
return url;
|
|
132
142
|
}
|
|
133
143
|
}
|
|
134
|
-
exports.JDConnector = JDConnector;
|
package/dist/sdk/jdSdk.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.JDSdk = void 0;
|
|
4
|
-
class JDSdk {
|
|
1
|
+
export class JDSdk {
|
|
5
2
|
static initialiseApp(applicationId, appId, appKey, appSecret) {
|
|
6
3
|
globalThis.applicationId = applicationId;
|
|
7
4
|
globalThis.appId = appId;
|
|
@@ -20,4 +17,3 @@ class JDSdk {
|
|
|
20
17
|
globalThis.userId = userId;
|
|
21
18
|
}
|
|
22
19
|
}
|
|
23
|
-
exports.JDSdk = JDSdk;
|
|
@@ -19,7 +19,7 @@ export declare class JDApplication extends JDResource {
|
|
|
19
19
|
featured?: string | null;
|
|
20
20
|
}): Promise<import("../jdConnector").SimpleResponse>;
|
|
21
21
|
findContents(params?: PaginateParams & {
|
|
22
|
-
title?: string;
|
|
22
|
+
title?: string | null;
|
|
23
23
|
}): Promise<import("../jdConnector").SimpleResponse>;
|
|
24
24
|
getInfo(id: string): Promise<import("../jdConnector").SimpleResponse>;
|
|
25
25
|
updateFields(id: string, body?: Partial<typeof defaultUpdateFields>): Promise<import("../jdConnector").SimpleResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jdApplication.d.ts","sourceRoot":"","sources":["../../../src/sdk/models/jdApplication.ts"],"names":[],"mappings":"AACA,OAAO,UAAU,EAAE,EAAC,aAAa,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,cAAc,EAAC,MAAM,cAAc,CAAC;AAE/G,qBAAa,aAAc,SAAQ,UAAU;IAC5C,KAAK,SAAM;IACX,MAAM,SAAM;IACZ,SAAS,SAAM;IACf,UAAU,EAAE,MAAM,CAAM;IACxB,IAAI,EAAE,MAAM,CAAM;IAClB,WAAW,SAAM;IACjB,OAAO,SAAM;IACb,WAAW,SAAK;IAChB,iBAAiB,SAAK;IACtB,aAAa,SAAK;gBAEN,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EAAE,aAAa,GAAE,aAAyC;IAKpG,OAAO,CAAC,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAe1B,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":"jdApplication.d.ts","sourceRoot":"","sources":["../../../src/sdk/models/jdApplication.ts"],"names":[],"mappings":"AACA,OAAO,UAAU,EAAE,EAAC,aAAa,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,cAAc,EAAC,MAAM,cAAc,CAAC;AAE/G,qBAAa,aAAc,SAAQ,UAAU;IAC5C,KAAK,SAAM;IACX,MAAM,SAAM;IACZ,SAAS,SAAM;IACf,UAAU,EAAE,MAAM,CAAM;IACxB,IAAI,EAAE,MAAM,CAAM;IAClB,WAAW,SAAM;IACjB,OAAO,SAAM;IACb,WAAW,SAAK;IAChB,iBAAiB,SAAK;IACtB,aAAa,SAAK;gBAEN,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EAAE,aAAa,GAAE,aAAyC;IAKpG,OAAO,CAAC,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAe1B,WAAW,CAAC,MAAM,GAAE,OAAO,CAAC,OAAO,iBAAiB,CAAM;IAK1D,gBAAgB,CAAC,MAAM,GAAE,cAAc,GAAG;QAAE,IAAI,CAAC,EAAE,MAAM,GAAC,IAAI,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,GAAC,IAAI,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,GAAC,IAAI,CAAC;KAAM;IAQpH,YAAY,CAAC,MAAM,GAAE,cAAc,GAAG;QAAE,KAAK,CAAC,EAAE,MAAM,GAAC,IAAI,CAAC;KAAO;IAMnE,OAAO,CAAC,EAAE,EAAC,MAAM;IAIjB,YAAY,CAAC,EAAE,EAAC,MAAM,EAAE,IAAI,GAAE,OAAO,CAAC,OAAO,mBAAmB,CAAM;CAG5E"}
|
|
@@ -1,84 +1,76 @@
|
|
|
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
|
-
|
|
29
|
-
class JDApplication extends jdResource_1.default {
|
|
30
|
-
appId = '';
|
|
31
|
-
appKey = '';
|
|
32
|
-
appSecret = '';
|
|
33
|
-
storeLinks = {};
|
|
34
|
-
urls = {};
|
|
35
|
-
orientation = '';
|
|
36
|
-
version = '';
|
|
37
|
-
versionCode = 0;
|
|
38
|
-
bundleCodeAndroid = 0;
|
|
39
|
-
bundleCodeIos = 0;
|
|
40
|
-
constructor(data = {}, connectorInfo = new jdResource_1.ConnectorInfo("", "")) {
|
|
10
|
+
import { Utils } from "../utilities/utils";
|
|
11
|
+
import JDResource, { ConnectorInfo } from "./jdResource";
|
|
12
|
+
export class JDApplication extends JDResource {
|
|
13
|
+
constructor(data = {}, connectorInfo = new ConnectorInfo("", "")) {
|
|
41
14
|
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;
|
|
42
25
|
this.setData(data);
|
|
43
26
|
}
|
|
44
27
|
setData(data) {
|
|
45
28
|
super.setData(data);
|
|
46
|
-
this.appId =
|
|
47
|
-
this.appKey =
|
|
48
|
-
this.appSecret =
|
|
49
|
-
this.orientation =
|
|
50
|
-
this.version =
|
|
51
|
-
this.storeLinks =
|
|
52
|
-
this.urls =
|
|
53
|
-
this.versionCode =
|
|
54
|
-
this.bundleCodeAndroid =
|
|
55
|
-
this.bundleCodeIos =
|
|
29
|
+
this.appId = Utils.getString(data, 'app_id');
|
|
30
|
+
this.appKey = Utils.getString(data, 'app_key');
|
|
31
|
+
this.appSecret = Utils.getString(data, 'app_secret');
|
|
32
|
+
this.orientation = Utils.getString(data, 'orientation');
|
|
33
|
+
this.version = Utils.getString(data, 'version');
|
|
34
|
+
this.storeLinks = Utils.getObject(data, 'store_links');
|
|
35
|
+
this.urls = Utils.getObject(data, 'urls');
|
|
36
|
+
this.versionCode = Utils.getInteger(data, 'version_code');
|
|
37
|
+
this.bundleCodeAndroid = Utils.getInteger(data, 'bundle_code_android');
|
|
38
|
+
this.bundleCodeIos = Utils.getInteger(data, 'bundle_code_ios');
|
|
56
39
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
+
});
|
|
60
45
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
+
});
|
|
70
57
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
+
});
|
|
76
65
|
}
|
|
77
|
-
|
|
78
|
-
return
|
|
66
|
+
getInfo(id) {
|
|
67
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
return yield this.getRelative(`/dashboard/applications/${id}`, {});
|
|
69
|
+
});
|
|
79
70
|
}
|
|
80
|
-
|
|
81
|
-
return
|
|
71
|
+
updateFields(id_1) {
|
|
72
|
+
return __awaiter(this, arguments, void 0, function* (id, body = {}) {
|
|
73
|
+
return yield this.postRelative(`/dashboard/applications/${id}/update/single_fields`, body);
|
|
74
|
+
});
|
|
82
75
|
}
|
|
83
76
|
}
|
|
84
|
-
exports.JDApplication = JDApplication;
|
|
@@ -20,14 +20,14 @@ export declare const defaultUpdateFields: {
|
|
|
20
20
|
};
|
|
21
21
|
export interface UpdateFields {
|
|
22
22
|
published?: boolean | null;
|
|
23
|
-
note?: string |
|
|
23
|
+
note?: string | null;
|
|
24
24
|
}
|
|
25
25
|
export interface PaginateParams {
|
|
26
26
|
title_en?: string | undefined;
|
|
27
27
|
title_mm?: string | undefined;
|
|
28
28
|
keywords_en?: string | undefined;
|
|
29
29
|
keywords_mm?: string | undefined;
|
|
30
|
-
published?: boolean |
|
|
30
|
+
published?: boolean | undefined;
|
|
31
31
|
order_by?: string | undefined;
|
|
32
32
|
order?: string | undefined;
|
|
33
33
|
page_index?: number | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jdResource.d.ts","sourceRoot":"","sources":["../../../src/sdk/models/jdResource.ts"],"names":[],"mappings":"AAGA,OAAO,EAAc,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAI3D,eAAO,MAAM,qBAAqB;;;;;;;CAOjC,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;CAM7B,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;CAG/B,CAAC;AAEF,MAAM,WAAW,YAAY;IAC5B,SAAS,CAAC,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"jdResource.d.ts","sourceRoot":"","sources":["../../../src/sdk/models/jdResource.ts"],"names":[],"mappings":"AAGA,OAAO,EAAc,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAI3D,eAAO,MAAM,qBAAqB;;;;;;;CAOjC,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;CAM7B,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;CAG/B,CAAC;AAEF,MAAM,WAAW,YAAY;IAC5B,SAAS,CAAC,EAAE,OAAO,GAAC,IAAI,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,GAAC,IAAI,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,EAAE,MAAM,GAAC,SAAS,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,GAAC,SAAS,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,GAAC,SAAS,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,GAAC,SAAS,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,GAAC,SAAS,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,GAAC,SAAS,CAAC;IA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