jd_platform_sdk 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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.js +63 -71
- 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.js +49 -55
- package/dist/sdk/models/modules/geolocation/jdCountry.js +47 -53
- package/dist/sdk/models/modules/geolocation/jdDistrict.js +49 -57
- package/dist/sdk/models/modules/geolocation/jdState.js +49 -55
- package/dist/sdk/models/modules/karaoke/jdKtvShop.js +82 -88
- package/dist/sdk/models/modules/music/jdAlbum.js +96 -102
- package/dist/sdk/models/modules/music/jdArtist.js +87 -89
- package/dist/sdk/models/modules/music/jdComposer.js +83 -87
- package/dist/sdk/models/modules/music/jdMusicCombinations.js +15 -31
- package/dist/sdk/models/modules/music/jdSong.js +105 -113
- package/dist/sdk/models/modules/radio_station/jdRadioStation.js +82 -88
- package/dist/sdk/models/modules/user/jdPermission.js +55 -63
- package/dist/sdk/models/modules/user/jdPermissionGroup.js +51 -57
- package/dist/sdk/models/modules/user/jdSessionUser.js +70 -72
- package/dist/sdk/models/modules/user/jdUser.js +73 -75
- package/dist/sdk/models/modules/user/jdUserRole.js +50 -54
- 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.js +19 -22
- package/package.json +1 -1
|
@@ -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 JdMusicCombinations extends jdResource_1.default {
|
|
29
|
-
constructor(data = {}, connectorInfo = new jdResource_1.ConnectorInfo("", "")) {
|
|
10
|
+
import JDResource, { ConnectorInfo } from "../../jdResource";
|
|
11
|
+
export class JdMusicCombinations 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/music/combinations/overview', {});
|
|
19
|
+
});
|
|
35
20
|
}
|
|
36
21
|
}
|
|
37
|
-
exports.JdMusicCombinations = JdMusicCombinations;
|
|
@@ -1,126 +1,118 @@
|
|
|
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 JDSong extends jdResource_1.default {
|
|
30
|
-
albumId = "";
|
|
31
|
-
mainArtistId = "";
|
|
32
|
-
languageId = "";
|
|
33
|
-
isrcCode = "";
|
|
34
|
-
note = "";
|
|
35
|
-
hasLyrics = false;
|
|
36
|
-
hasKaraoke = false;
|
|
37
|
-
recommended = false;
|
|
38
|
-
promoted = false;
|
|
39
|
-
downloadable = false;
|
|
40
|
-
durationSeconds = 0;
|
|
41
|
-
channelsCount = 0;
|
|
42
|
-
tracksCount = 0;
|
|
43
|
-
releasedYear = 0;
|
|
44
|
-
keywords = {};
|
|
45
|
-
cdnStorage = {};
|
|
46
|
-
songValidation = {};
|
|
47
|
-
album = {};
|
|
48
|
-
mainArtist = {};
|
|
49
|
-
language = {};
|
|
50
|
-
checksums = {};
|
|
51
|
-
artists = [];
|
|
52
|
-
composers = [];
|
|
53
|
-
bands = [];
|
|
54
|
-
artistIds = [];
|
|
55
|
-
composerIds = [];
|
|
56
|
-
bandIds = [];
|
|
57
|
-
constructor(data = {}, connectorInfo = new jdResource_1.ConnectorInfo("", "")) {
|
|
10
|
+
import JDResource, { ConnectorInfo } from "../../jdResource";
|
|
11
|
+
import { Utils } from "../../../utilities/utils";
|
|
12
|
+
export class JDSong extends JDResource {
|
|
13
|
+
constructor(data = {}, connectorInfo = new ConnectorInfo("", "")) {
|
|
58
14
|
super(connectorInfo);
|
|
15
|
+
this.albumId = "";
|
|
16
|
+
this.mainArtistId = "";
|
|
17
|
+
this.languageId = "";
|
|
18
|
+
this.isrcCode = "";
|
|
19
|
+
this.note = "";
|
|
20
|
+
this.hasLyrics = false;
|
|
21
|
+
this.hasKaraoke = false;
|
|
22
|
+
this.recommended = false;
|
|
23
|
+
this.promoted = false;
|
|
24
|
+
this.downloadable = false;
|
|
25
|
+
this.durationSeconds = 0;
|
|
26
|
+
this.channelsCount = 0;
|
|
27
|
+
this.tracksCount = 0;
|
|
28
|
+
this.releasedYear = 0;
|
|
29
|
+
this.keywords = {};
|
|
30
|
+
this.cdnStorage = {};
|
|
31
|
+
this.songValidation = {};
|
|
32
|
+
this.album = {};
|
|
33
|
+
this.mainArtist = {};
|
|
34
|
+
this.language = {};
|
|
35
|
+
this.checksums = {};
|
|
36
|
+
this.artists = [];
|
|
37
|
+
this.composers = [];
|
|
38
|
+
this.bands = [];
|
|
39
|
+
this.artistIds = [];
|
|
40
|
+
this.composerIds = [];
|
|
41
|
+
this.bandIds = [];
|
|
59
42
|
this.setData(data);
|
|
60
43
|
}
|
|
61
44
|
setData(data) {
|
|
62
45
|
super.setData(data);
|
|
63
|
-
this.albumId =
|
|
64
|
-
this.mainArtistId =
|
|
65
|
-
this.languageId =
|
|
66
|
-
this.isrcCode =
|
|
67
|
-
this.note =
|
|
68
|
-
this.hasLyrics =
|
|
69
|
-
this.hasKaraoke =
|
|
70
|
-
this.recommended =
|
|
71
|
-
this.promoted =
|
|
72
|
-
this.downloadable =
|
|
73
|
-
this.durationSeconds =
|
|
74
|
-
this.channelsCount =
|
|
75
|
-
this.tracksCount =
|
|
76
|
-
this.releasedYear =
|
|
77
|
-
this.keywords =
|
|
78
|
-
this.cdnStorage =
|
|
79
|
-
this.songValidation =
|
|
80
|
-
this.album =
|
|
81
|
-
this.mainArtist =
|
|
82
|
-
this.language =
|
|
83
|
-
this.checksums =
|
|
84
|
-
this.artists =
|
|
85
|
-
this.composers =
|
|
86
|
-
this.bands =
|
|
87
|
-
this.artistIds =
|
|
88
|
-
this.composerIds =
|
|
89
|
-
this.bandIds =
|
|
46
|
+
this.albumId = Utils.getString(data, "album_id");
|
|
47
|
+
this.mainArtistId = Utils.getString(data, "main_artist_id");
|
|
48
|
+
this.languageId = Utils.getString(data, "language_id");
|
|
49
|
+
this.isrcCode = Utils.getString(data, "isrc_code");
|
|
50
|
+
this.note = Utils.getString(data, "note");
|
|
51
|
+
this.hasLyrics = Utils.getBoolean(data, "has_lyrics");
|
|
52
|
+
this.hasKaraoke = Utils.getBoolean(data, "has_karaoke");
|
|
53
|
+
this.recommended = Utils.getBoolean(data, "recommended");
|
|
54
|
+
this.promoted = Utils.getBoolean(data, "promoted");
|
|
55
|
+
this.downloadable = Utils.getBoolean(data, "downloadable");
|
|
56
|
+
this.durationSeconds = Utils.getInteger(data, "duration_seconds");
|
|
57
|
+
this.channelsCount = Utils.getInteger(data, "channels_count");
|
|
58
|
+
this.tracksCount = Utils.getInteger(data, "tracks_count");
|
|
59
|
+
this.releasedYear = Utils.getInteger(data, "released_year");
|
|
60
|
+
this.keywords = Utils.getObject(data, "keywords");
|
|
61
|
+
this.cdnStorage = Utils.getObject(data, "cdn_storage");
|
|
62
|
+
this.songValidation = Utils.getObject(data, "song_validation");
|
|
63
|
+
this.album = Utils.getObject(data, "album");
|
|
64
|
+
this.mainArtist = Utils.getObject(data, "main_artist");
|
|
65
|
+
this.language = Utils.getObject(data, "language");
|
|
66
|
+
this.checksums = Utils.getObject(data, "checksums");
|
|
67
|
+
this.artists = Utils.getArray(data, "artists");
|
|
68
|
+
this.composers = Utils.getArray(data, "composers");
|
|
69
|
+
this.bands = Utils.getArray(data, "bands");
|
|
70
|
+
this.artistIds = Utils.getArray(data, "artist_ids");
|
|
71
|
+
this.composerIds = Utils.getArray(data, "composer_ids");
|
|
72
|
+
this.bandIds = Utils.getArray(data, "band_ids");
|
|
90
73
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
74
|
+
getContents() {
|
|
75
|
+
return __awaiter(this, arguments, void 0, function* (params = {}) {
|
|
76
|
+
const queryParams = this.getSortParameters(params);
|
|
77
|
+
return yield this.getRelative('/modules/music/songs', queryParams);
|
|
78
|
+
});
|
|
94
79
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
80
|
+
paginateContents() {
|
|
81
|
+
return __awaiter(this, arguments, void 0, function* (params = {}) {
|
|
82
|
+
const queryParams = this.getSortParameters(params);
|
|
83
|
+
if (params.languageId)
|
|
84
|
+
queryParams['language_id'] = params.languageId;
|
|
85
|
+
if (params.recommended)
|
|
86
|
+
queryParams['recommended'] = params.recommended;
|
|
87
|
+
if (params.downloadable)
|
|
88
|
+
queryParams['downloadable'] = params.downloadable;
|
|
89
|
+
if (params.has_lyrics)
|
|
90
|
+
queryParams['has_lyrics'] = params.has_lyrics;
|
|
91
|
+
if (params.has_karaoke)
|
|
92
|
+
queryParams['has_karaoke'] = params.has_karaoke;
|
|
93
|
+
if (params.wrong_tracks)
|
|
94
|
+
queryParams['wrong_tracks'] = params.wrong_tracks;
|
|
95
|
+
if (params.released_year)
|
|
96
|
+
queryParams['released_year'] = params.released_year;
|
|
97
|
+
return yield this.getRelative('/modules/music/songs/paginate', queryParams);
|
|
98
|
+
});
|
|
112
99
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
100
|
+
findContents() {
|
|
101
|
+
return __awaiter(this, arguments, void 0, function* (params = {}) {
|
|
102
|
+
const queryParams = this.getSortParameters(params);
|
|
103
|
+
if (params.title)
|
|
104
|
+
queryParams['name'] = params.title;
|
|
105
|
+
return yield this.getRelative('/modules/music/songs/find', queryParams);
|
|
106
|
+
});
|
|
118
107
|
}
|
|
119
|
-
|
|
120
|
-
return
|
|
108
|
+
getInfo(id) {
|
|
109
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
110
|
+
return yield this.getRelative(`/modules/music/songs/${id}`, {});
|
|
111
|
+
});
|
|
121
112
|
}
|
|
122
|
-
|
|
123
|
-
return
|
|
113
|
+
updateFields(id_1) {
|
|
114
|
+
return __awaiter(this, arguments, void 0, function* (id, body = {}) {
|
|
115
|
+
return yield this.postRelative(`/modules/music/composers/${id}/update/single_fields`, body);
|
|
116
|
+
});
|
|
124
117
|
}
|
|
125
118
|
}
|
|
126
|
-
exports.JDSong = JDSong;
|
|
@@ -1,106 +1,100 @@
|
|
|
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 JdRadioStation extends jdResource_1.default {
|
|
30
|
-
licenseKey = "";
|
|
31
|
-
activationsCount = 0;
|
|
32
|
-
maxActivationsCount = 0;
|
|
33
|
-
countryId = "";
|
|
34
|
-
stateId = "";
|
|
35
|
-
cityId = "";
|
|
36
|
-
districtId = "";
|
|
37
|
-
address = {};
|
|
38
|
-
country = {};
|
|
39
|
-
state = {};
|
|
40
|
-
city = {};
|
|
41
|
-
district = {};
|
|
10
|
+
import JDResource, { ConnectorInfo } from "../../jdResource";
|
|
11
|
+
import { Utils } from "../../../utilities/utils";
|
|
12
|
+
export class JdRadioStation extends JDResource {
|
|
42
13
|
get localisedAddress() {
|
|
43
14
|
return globalThis.language != 'en' ? `${this.districtTitleMM}, ${this.stateTitleMM}, ${this.cityTitleMM}, ${this.countryTitleMM},` :
|
|
44
15
|
`${this.districtTitleEN}, ${this.stateTitleEN}, ${this.cityTitleEN}, ${this.countryTitleEN},`;
|
|
45
16
|
}
|
|
46
|
-
get countryTitleEN() { return
|
|
47
|
-
get countryTitleMM() { return
|
|
48
|
-
get stateTitleEN() { return
|
|
49
|
-
get stateTitleMM() { return
|
|
50
|
-
get cityTitleEN() { return
|
|
51
|
-
get cityTitleMM() { return
|
|
52
|
-
get districtTitleEN() { return
|
|
53
|
-
get districtTitleMM() { return
|
|
54
|
-
|
|
55
|
-
constructor(data = {}, connectorInfo = new jdResource_1.ConnectorInfo("", "")) {
|
|
17
|
+
get countryTitleEN() { return Utils.getString(Utils.getObject(this.country, 'title'), 'en'); }
|
|
18
|
+
get countryTitleMM() { return Utils.getString(Utils.getObject(this.country, 'title'), 'mm'); }
|
|
19
|
+
get stateTitleEN() { return Utils.getString(Utils.getObject(this.state, 'title'), 'en'); }
|
|
20
|
+
get stateTitleMM() { return Utils.getString(Utils.getObject(this.state, 'title'), 'mm'); }
|
|
21
|
+
get cityTitleEN() { return Utils.getString(Utils.getObject(this.city, 'title'), 'en'); }
|
|
22
|
+
get cityTitleMM() { return Utils.getString(Utils.getObject(this.city, 'title'), 'mm'); }
|
|
23
|
+
get districtTitleEN() { return Utils.getString(Utils.getObject(this.district, 'title'), 'en'); }
|
|
24
|
+
get districtTitleMM() { return Utils.getString(Utils.getObject(this.district, 'title'), 'mm'); }
|
|
25
|
+
constructor(data = {}, connectorInfo = new ConnectorInfo("", "")) {
|
|
56
26
|
super(connectorInfo);
|
|
27
|
+
this.licenseKey = "";
|
|
28
|
+
this.activationsCount = 0;
|
|
29
|
+
this.maxActivationsCount = 0;
|
|
30
|
+
this.countryId = "";
|
|
31
|
+
this.stateId = "";
|
|
32
|
+
this.cityId = "";
|
|
33
|
+
this.districtId = "";
|
|
34
|
+
this.address = {};
|
|
35
|
+
this.country = {};
|
|
36
|
+
this.state = {};
|
|
37
|
+
this.city = {};
|
|
38
|
+
this.district = {};
|
|
39
|
+
this.expiryDate = new Date();
|
|
57
40
|
this.setData(data);
|
|
58
41
|
}
|
|
59
42
|
setData(data) {
|
|
60
43
|
super.setData(data);
|
|
61
|
-
this.licenseKey =
|
|
62
|
-
this.activationsCount =
|
|
63
|
-
this.maxActivationsCount =
|
|
64
|
-
this.countryId =
|
|
65
|
-
this.stateId =
|
|
66
|
-
this.cityId =
|
|
67
|
-
this.districtId =
|
|
68
|
-
this.address =
|
|
69
|
-
this.country =
|
|
70
|
-
this.state =
|
|
71
|
-
this.city =
|
|
72
|
-
this.district =
|
|
73
|
-
this.expiryDate =
|
|
44
|
+
this.licenseKey = Utils.getString(data, "license_key");
|
|
45
|
+
this.activationsCount = Utils.getInteger(data, "activations_count");
|
|
46
|
+
this.maxActivationsCount = Utils.getInteger(data, "max_activations_count");
|
|
47
|
+
this.countryId = Utils.getString(data, "country_id");
|
|
48
|
+
this.stateId = Utils.getString(data, "state_id");
|
|
49
|
+
this.cityId = Utils.getString(data, "city_id");
|
|
50
|
+
this.districtId = Utils.getString(data, "district_id");
|
|
51
|
+
this.address = Utils.getObject(data, "address");
|
|
52
|
+
this.country = Utils.getObject(data, "country");
|
|
53
|
+
this.state = Utils.getObject(data, "state");
|
|
54
|
+
this.city = Utils.getObject(data, "city");
|
|
55
|
+
this.district = Utils.getObject(data, "district");
|
|
56
|
+
this.expiryDate = Utils.getDate(data, "expiry_date");
|
|
74
57
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
58
|
+
getContents() {
|
|
59
|
+
return __awaiter(this, arguments, void 0, function* (params = {}) {
|
|
60
|
+
const queryParams = this.getSortParameters(params);
|
|
61
|
+
return yield this.getRelative(`/modules/radio_station/radio_stations`, queryParams);
|
|
62
|
+
});
|
|
78
63
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
64
|
+
paginateContents() {
|
|
65
|
+
return __awaiter(this, arguments, void 0, function* (params = {}) {
|
|
66
|
+
const queryParams = this.getSortParameters(params);
|
|
67
|
+
// Add custom filters
|
|
68
|
+
if (params.name)
|
|
69
|
+
queryParams['name'] = params.name;
|
|
70
|
+
if (params.guardName)
|
|
71
|
+
queryParams['guard_name'] = params.guardName;
|
|
72
|
+
if (params.published)
|
|
73
|
+
queryParams['published'] = params.published;
|
|
74
|
+
return yield this.getRelative('/modules/radio_station/radio_stations/paginate', queryParams);
|
|
75
|
+
});
|
|
89
76
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
77
|
+
findContents() {
|
|
78
|
+
return __awaiter(this, arguments, void 0, function* (params = {}) {
|
|
79
|
+
const queryParams = this.getSortParameters(params);
|
|
80
|
+
if (params.name)
|
|
81
|
+
queryParams['name'] = params.name;
|
|
82
|
+
return yield this.getRelative('/modules/radio_station/radio_stations/find', queryParams);
|
|
83
|
+
});
|
|
95
84
|
}
|
|
96
|
-
|
|
97
|
-
return
|
|
85
|
+
getInfo(id) {
|
|
86
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
87
|
+
return yield this.getRelative(`/modules/radio_station/radio_stations/${id}`, {});
|
|
88
|
+
});
|
|
98
89
|
}
|
|
99
|
-
|
|
100
|
-
return
|
|
90
|
+
updateInfo(id, title, slug, expiryDate) {
|
|
91
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
+
return yield this.getRelative(`/modules/radio_station/radio_stations/${id}`, {});
|
|
93
|
+
});
|
|
101
94
|
}
|
|
102
|
-
|
|
103
|
-
return
|
|
95
|
+
updateFields(id_1) {
|
|
96
|
+
return __awaiter(this, arguments, void 0, function* (id, body = {}) {
|
|
97
|
+
return yield this.postRelative(`/modules/radio_station/radio_stations/${id}/update/single_fields`, body);
|
|
98
|
+
});
|
|
104
99
|
}
|
|
105
100
|
}
|
|
106
|
-
exports.JdRadioStation = JdRadioStation;
|
|
@@ -1,78 +1,70 @@
|
|
|
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 JDPermission extends jdResource_1.default {
|
|
30
|
-
name = "";
|
|
31
|
-
guardName = "";
|
|
32
|
-
descriptionPlain = "";
|
|
33
|
-
userPermissionGroupId = "";
|
|
34
|
-
userPermissionGroup = {};
|
|
35
|
-
roleIds = [];
|
|
36
|
-
constructor(data = {}, connectorInfo = new jdResource_1.ConnectorInfo("", "")) {
|
|
10
|
+
import JDResource, { ConnectorInfo } from "../../jdResource";
|
|
11
|
+
import { Utils } from "../../../utilities/utils";
|
|
12
|
+
export class JDPermission extends JDResource {
|
|
13
|
+
constructor(data = {}, connectorInfo = new ConnectorInfo("", "")) {
|
|
37
14
|
super(connectorInfo);
|
|
15
|
+
this.name = "";
|
|
16
|
+
this.guardName = "";
|
|
17
|
+
this.descriptionPlain = "";
|
|
18
|
+
this.userPermissionGroupId = "";
|
|
19
|
+
this.userPermissionGroup = {};
|
|
20
|
+
this.roleIds = [];
|
|
38
21
|
this.setData(data);
|
|
39
22
|
}
|
|
40
23
|
setData(data) {
|
|
41
24
|
super.setData(data);
|
|
42
|
-
this.name =
|
|
43
|
-
this.guardName =
|
|
44
|
-
this.descriptionPlain =
|
|
45
|
-
this.userPermissionGroupId =
|
|
46
|
-
this.userPermissionGroup =
|
|
47
|
-
this.roleIds =
|
|
25
|
+
this.name = Utils.getString(data, "name");
|
|
26
|
+
this.guardName = Utils.getString(data, "guard_name");
|
|
27
|
+
this.descriptionPlain = Utils.getString(data, "description");
|
|
28
|
+
this.userPermissionGroupId = Utils.getString(data, "user_permission_group_id");
|
|
29
|
+
this.userPermissionGroup = Utils.getObject(data, "user_permission_group");
|
|
30
|
+
this.roleIds = Utils.getArray(data, "role_ids");
|
|
48
31
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
32
|
+
getContents() {
|
|
33
|
+
return __awaiter(this, arguments, void 0, function* (params = {}) {
|
|
34
|
+
const queryParams = this.getSortParameters(params);
|
|
35
|
+
return yield this.getRelative(`/modules/user/permissions`, queryParams);
|
|
36
|
+
});
|
|
52
37
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
38
|
+
paginateContents() {
|
|
39
|
+
return __awaiter(this, arguments, void 0, function* (params = {}) {
|
|
40
|
+
const queryParams = this.getSortParameters(params);
|
|
41
|
+
if (params.name)
|
|
42
|
+
queryParams['name'] = params.name;
|
|
43
|
+
if (params.guard_name)
|
|
44
|
+
queryParams['guard_name'] = params.guard_name;
|
|
45
|
+
return yield this.getRelative('/modules/user/permissions/paginate', queryParams);
|
|
46
|
+
});
|
|
60
47
|
}
|
|
61
48
|
// Find the permission with text search index which is a fast way to search the whole word
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
49
|
+
findContents() {
|
|
50
|
+
return __awaiter(this, arguments, void 0, function* (params = {}) {
|
|
51
|
+
const queryParams = this.getSortParameters(params);
|
|
52
|
+
if (params.name)
|
|
53
|
+
queryParams['name'] = params.name;
|
|
54
|
+
if (params.published)
|
|
55
|
+
queryParams['published'] = params.published;
|
|
56
|
+
return yield this.getRelative('/modules/user/permissions/find', queryParams);
|
|
57
|
+
});
|
|
69
58
|
}
|
|
70
59
|
// Get the user information
|
|
71
|
-
|
|
72
|
-
return
|
|
60
|
+
getInfo(id) {
|
|
61
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
62
|
+
return yield this.getRelative(`/modules/user/permissions/${id}`, {});
|
|
63
|
+
});
|
|
73
64
|
}
|
|
74
|
-
|
|
75
|
-
return
|
|
65
|
+
updateSingleFields(id_1) {
|
|
66
|
+
return __awaiter(this, arguments, void 0, function* (id, body = {}) {
|
|
67
|
+
return yield this.postRelative(`/modules/user/permissions/${id}/update/single_fields`, body);
|
|
68
|
+
});
|
|
76
69
|
}
|
|
77
70
|
}
|
|
78
|
-
exports.JDPermission = JDPermission;
|