jd_platform_sdk 0.0.7 → 0.1.0
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 +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +46 -24
- package/dist/sdk/configs/jdConfig.js +5 -1
- package/dist/sdk/jdConnector.js +63 -72
- package/dist/sdk/jdSdk.js +5 -1
- package/dist/sdk/models/jdApplication.d.ts +10 -4
- package/dist/sdk/models/jdApplication.d.ts.map +1 -1
- package/dist/sdk/models/jdApplication.js +76 -50
- package/dist/sdk/models/jdResource.d.ts +44 -1
- package/dist/sdk/models/jdResource.d.ts.map +1 -1
- package/dist/sdk/models/jdResource.js +131 -103
- package/dist/sdk/models/modules/dashboard/jdDashboardCombinations.d.ts +6 -0
- package/dist/sdk/models/modules/dashboard/jdDashboardCombinations.d.ts.map +1 -0
- package/dist/sdk/models/modules/dashboard/jdDashboardCombinations.js +37 -0
- package/dist/sdk/models/modules/geolocation/jdCity.d.ts +8 -4
- package/dist/sdk/models/modules/geolocation/jdCity.d.ts.map +1 -1
- package/dist/sdk/models/modules/geolocation/jdCity.js +61 -41
- package/dist/sdk/models/modules/geolocation/jdCountry.d.ts +8 -4
- package/dist/sdk/models/modules/geolocation/jdCountry.d.ts.map +1 -1
- package/dist/sdk/models/modules/geolocation/jdCountry.js +53 -33
- package/dist/sdk/models/modules/geolocation/jdDistrict.d.ts +7 -3
- package/dist/sdk/models/modules/geolocation/jdDistrict.d.ts.map +1 -1
- package/dist/sdk/models/modules/geolocation/jdDistrict.js +57 -35
- package/dist/sdk/models/modules/geolocation/jdState.d.ts +8 -4
- package/dist/sdk/models/modules/geolocation/jdState.d.ts.map +1 -1
- package/dist/sdk/models/modules/geolocation/jdState.js +61 -41
- package/dist/sdk/models/modules/karaoke/jdKtvShop.d.ts +13 -2
- package/dist/sdk/models/modules/karaoke/jdKtvShop.d.ts.map +1 -1
- package/dist/sdk/models/modules/karaoke/jdKtvShop.js +91 -62
- package/dist/sdk/models/modules/music/jdAlbum.d.ts +9 -51
- package/dist/sdk/models/modules/music/jdAlbum.d.ts.map +1 -1
- package/dist/sdk/models/modules/music/jdAlbum.js +102 -117
- package/dist/sdk/models/modules/music/jdArtist.d.ts +10 -49
- package/dist/sdk/models/modules/music/jdArtist.d.ts.map +1 -1
- package/dist/sdk/models/modules/music/jdArtist.js +90 -99
- package/dist/sdk/models/modules/music/jdComposer.d.ts +9 -49
- package/dist/sdk/models/modules/music/jdComposer.d.ts.map +1 -1
- package/dist/sdk/models/modules/music/jdComposer.js +87 -99
- package/dist/sdk/models/modules/music/jdMusicCombinations.js +31 -15
- package/dist/sdk/models/modules/music/jdSong.d.ts +11 -51
- package/dist/sdk/models/modules/music/jdSong.d.ts.map +1 -1
- package/dist/sdk/models/modules/music/jdSong.js +113 -131
- package/dist/sdk/models/modules/radio_station/jdRadioStation.d.ts +42 -0
- package/dist/sdk/models/modules/radio_station/jdRadioStation.d.ts.map +1 -0
- package/dist/sdk/models/modules/radio_station/jdRadioStation.js +106 -0
- package/dist/sdk/models/modules/user/jdPermission.d.ts +9 -21
- package/dist/sdk/models/modules/user/jdPermission.d.ts.map +1 -1
- package/dist/sdk/models/modules/user/jdPermission.js +63 -58
- package/dist/sdk/models/modules/user/jdPermissionGroup.d.ts +19 -0
- package/dist/sdk/models/modules/user/jdPermissionGroup.d.ts.map +1 -0
- package/dist/sdk/models/modules/user/jdPermissionGroup.js +72 -0
- package/dist/sdk/models/modules/user/jdSessionUser.d.ts +15 -2
- package/dist/sdk/models/modules/user/jdSessionUser.d.ts.map +1 -1
- package/dist/sdk/models/modules/user/jdSessionUser.js +78 -50
- package/dist/sdk/models/modules/user/jdUser.d.ts +16 -4
- package/dist/sdk/models/modules/user/jdUser.d.ts.map +1 -1
- package/dist/sdk/models/modules/user/jdUser.js +77 -56
- package/dist/sdk/models/modules/user/jdUserRole.d.ts +16 -0
- package/dist/sdk/models/modules/user/jdUserRole.d.ts.map +1 -0
- package/dist/sdk/models/modules/user/jdUserRole.js +70 -0
- package/dist/sdk/utilities/browserUtils.js +24 -31
- package/dist/sdk/utilities/cryptoUtils.js +13 -6
- package/dist/sdk/utilities/dateUtils.js +5 -1
- package/dist/sdk/utilities/globalEventHandler.js +5 -4
- package/dist/sdk/utilities/stringUtils.js +6 -2
- package/dist/sdk/utilities/utils.js +22 -19
- package/package.json +3 -1
- package/readme.md +9 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import JDResource, { ConnectorInfo } from "../../jdResource";
|
|
1
|
+
import JDResource, { ConnectorInfo, defaultSortParams, defaultUpdateFields, PaginateParams } from "../../jdResource";
|
|
2
2
|
export declare class JDAlbum extends JDResource {
|
|
3
3
|
albumTypeId: string;
|
|
4
4
|
languageId: string;
|
|
@@ -24,61 +24,19 @@ export declare class JDAlbum extends JDResource {
|
|
|
24
24
|
bandIds: any[];
|
|
25
25
|
constructor(data?: Record<string, any>, connectorInfo?: ConnectorInfo);
|
|
26
26
|
setData(data: Record<string, any>): void;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
published?: string | undefined;
|
|
31
|
-
recommended?: string | undefined;
|
|
32
|
-
downloadable?: string | undefined;
|
|
33
|
-
languageId?: string | undefined;
|
|
34
|
-
year?: string | undefined;
|
|
35
|
-
orderBy?: string | undefined;
|
|
36
|
-
order?: string | undefined;
|
|
37
|
-
pageIndex?: number | undefined;
|
|
38
|
-
countPerPage?: number | undefined;
|
|
39
|
-
fields?: string | undefined;
|
|
40
|
-
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
41
|
-
paginateAlbums({ titleEN, titleMM, keywordsEN, keywordsMM, published, recommended, downloadable, not_validated, languageId, year, note, orderBy, order, pageIndex, countPerPage, fields }: {
|
|
42
|
-
titleEN?: string | null;
|
|
43
|
-
titleMM?: string | null;
|
|
44
|
-
keywordsEN?: string | null;
|
|
45
|
-
keywordsMM?: string | null;
|
|
46
|
-
published?: boolean | null;
|
|
27
|
+
getContents(params?: Partial<typeof defaultSortParams>): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
28
|
+
paginateContents(params?: PaginateParams & {
|
|
29
|
+
languageId?: string | null;
|
|
47
30
|
recommended?: boolean | null;
|
|
48
31
|
downloadable?: boolean | null;
|
|
49
32
|
not_validated?: boolean | null;
|
|
50
|
-
|
|
51
|
-
year?: number | null;
|
|
52
|
-
note?: string | null;
|
|
53
|
-
orderBy?: string | null;
|
|
54
|
-
order?: string | null;
|
|
55
|
-
pageIndex?: number | null;
|
|
56
|
-
countPerPage?: number | null;
|
|
57
|
-
fields?: string | null;
|
|
58
|
-
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
59
|
-
getSongs(albumId: string, { orderBy, order, pageIndex, countPerPage, fields }: {
|
|
60
|
-
orderBy?: string | undefined;
|
|
61
|
-
order?: string | undefined;
|
|
62
|
-
pageIndex?: number | undefined;
|
|
63
|
-
countPerPage?: number | undefined;
|
|
64
|
-
fields?: string | undefined;
|
|
33
|
+
released_year?: number | null;
|
|
65
34
|
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
66
|
-
|
|
67
|
-
title?: string
|
|
68
|
-
published?: string | undefined;
|
|
69
|
-
orderBy?: string | undefined;
|
|
70
|
-
order?: string | undefined;
|
|
71
|
-
pageIndex?: number | undefined;
|
|
72
|
-
countPerPage?: number | undefined;
|
|
73
|
-
fields?: string | undefined;
|
|
35
|
+
findContents(params?: PaginateParams & {
|
|
36
|
+
title?: string;
|
|
74
37
|
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
38
|
+
getSongs(albumId: string, params?: Partial<typeof defaultSortParams>): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
75
39
|
getInfo(id: string): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
76
|
-
|
|
77
|
-
updateSingleFields(id: string, { published, recommended, downloadable, note }: {
|
|
78
|
-
published?: boolean | null;
|
|
79
|
-
recommended?: boolean | null;
|
|
80
|
-
downloadable?: boolean | null;
|
|
81
|
-
note?: string | null;
|
|
82
|
-
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
40
|
+
updateFields(id: string, body?: Partial<typeof defaultUpdateFields>): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
83
41
|
}
|
|
84
42
|
//# sourceMappingURL=jdAlbum.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jdAlbum.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/modules/music/jdAlbum.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,EAAE,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"jdAlbum.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/modules/music/jdAlbum.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,EAAE,EAAC,aAAa,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAEnH,qBAAa,OAAQ,SAAQ,UAAU;IACtC,WAAW,EAAC,MAAM,CAAM;IACxB,UAAU,EAAC,MAAM,CAAM;IACvB,IAAI,EAAC,MAAM,CAAM;IAEjB,WAAW,EAAC,OAAO,CAAS;IAC5B,QAAQ,EAAC,OAAO,CAAS;IACzB,YAAY,EAAC,OAAO,CAAS;IAE7B,WAAW,EAAC,MAAM,CAAK;IACvB,oBAAoB,EAAC,MAAM,CAAK;IAChC,eAAe,EAAC,MAAM,CAAK;IAC3B,YAAY,EAAC,MAAM,CAAK;IACxB,YAAY,EAAC,MAAM,CAAK;IAExB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;IACnC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;IACnC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;IAEpC,cAAc,EAAE,GAAG,EAAE,CAAM;IAC3B,OAAO,EAAE,GAAG,EAAE,CAA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k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
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 __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;
|
|
9
24
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.JDAlbum = void 0;
|
|
27
|
+
const jdResource_1 = __importStar(require("../../jdResource"));
|
|
28
|
+
const utils_1 = require("../../../utilities/utils");
|
|
29
|
+
class JDAlbum extends jdResource_1.default {
|
|
30
|
+
albumTypeId = "";
|
|
31
|
+
languageId = "";
|
|
32
|
+
note = "";
|
|
33
|
+
recommended = false;
|
|
34
|
+
promoted = false;
|
|
35
|
+
downloadable = false;
|
|
36
|
+
tracksCount = 0;
|
|
37
|
+
validatedTracksCount = 0;
|
|
38
|
+
durationSeconds = 0;
|
|
39
|
+
releasedYear = 0;
|
|
40
|
+
listensCount = 0;
|
|
41
|
+
language = {};
|
|
42
|
+
keywords = {};
|
|
43
|
+
albumType = {};
|
|
44
|
+
categoryMusics = [];
|
|
45
|
+
artists = [];
|
|
46
|
+
composers = [];
|
|
47
|
+
bands = [];
|
|
48
|
+
categoryMusicIds = [];
|
|
49
|
+
artistIds = [];
|
|
50
|
+
composerIds = [];
|
|
51
|
+
bandIds = [];
|
|
52
|
+
constructor(data = {}, connectorInfo = new jdResource_1.ConnectorInfo("", "")) {
|
|
14
53
|
super(connectorInfo);
|
|
15
|
-
this.albumTypeId = "";
|
|
16
|
-
this.languageId = "";
|
|
17
|
-
this.note = "";
|
|
18
|
-
this.recommended = false;
|
|
19
|
-
this.promoted = false;
|
|
20
|
-
this.downloadable = false;
|
|
21
|
-
this.tracksCount = 0;
|
|
22
|
-
this.validatedTracksCount = 0;
|
|
23
|
-
this.durationSeconds = 0;
|
|
24
|
-
this.releasedYear = 0;
|
|
25
|
-
this.listensCount = 0;
|
|
26
|
-
this.language = {};
|
|
27
|
-
this.keywords = {};
|
|
28
|
-
this.albumType = {};
|
|
29
|
-
this.categoryMusics = [];
|
|
30
|
-
this.artists = [];
|
|
31
|
-
this.composers = [];
|
|
32
|
-
this.bands = [];
|
|
33
|
-
this.categoryMusicIds = [];
|
|
34
|
-
this.artistIds = [];
|
|
35
|
-
this.composerIds = [];
|
|
36
|
-
this.bandIds = [];
|
|
37
54
|
this.setData(data);
|
|
38
55
|
}
|
|
39
56
|
setData(data) {
|
|
40
57
|
super.setData(data);
|
|
41
|
-
this.albumTypeId = Utils.getString(data, "album_type_id");
|
|
42
|
-
this.languageId = Utils.getString(data, "language_id");
|
|
43
|
-
this.note = Utils.getString(data, "note");
|
|
44
|
-
this.recommended = Utils.getBoolean(data, "recommended");
|
|
45
|
-
this.promoted = Utils.getBoolean(data, "promoted");
|
|
46
|
-
this.downloadable = Utils.getBoolean(data, "downloadable");
|
|
47
|
-
this.durationSeconds = Utils.getInteger(data, "duration_seconds");
|
|
48
|
-
this.tracksCount = Utils.getInteger(data, "tracks_count");
|
|
49
|
-
this.validatedTracksCount = Utils.getInteger(data, "validated_tracks_count");
|
|
50
|
-
this.releasedYear = Utils.getInteger(data, "released_year");
|
|
51
|
-
this.listensCount = Utils.getInteger(data, "listens_count");
|
|
52
|
-
this.language = Utils.getObject(data, "language");
|
|
53
|
-
this.keywords = Utils.getObject(data, "keywords");
|
|
54
|
-
this.albumType = Utils.getObject(data, "album_type");
|
|
55
|
-
this.categoryMusics = Utils.getArray(data, "category_musics");
|
|
56
|
-
this.artists = Utils.getArray(data, "artists");
|
|
57
|
-
this.composers = Utils.getArray(data, "composers");
|
|
58
|
-
this.bands = Utils.getArray(data, "bands");
|
|
59
|
-
this.categoryMusicIds = Utils.getArray(data, "category_music_ids");
|
|
60
|
-
this.artistIds = Utils.getArray(data, "artist_ids");
|
|
61
|
-
this.composerIds = Utils.getArray(data, "composer_ids");
|
|
62
|
-
this.bandIds = Utils.getArray(data, "band_ids");
|
|
63
|
-
}
|
|
64
|
-
// Filter albums
|
|
65
|
-
getAlbums(_a) {
|
|
66
|
-
return __awaiter(this, arguments, void 0, function* ({ titleEn = "", keywordEn = "", published = "", recommended = "", downloadable = "", languageId = "", year = "", orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '' }) {
|
|
67
|
-
const params = this.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
|
|
68
|
-
//Addon filters
|
|
69
|
-
params['title.en'] = titleEn;
|
|
70
|
-
params['keyword.en'] = keywordEn;
|
|
71
|
-
params['published'] = published;
|
|
72
|
-
params['recommended'] = recommended;
|
|
73
|
-
params['downloadable'] = downloadable;
|
|
74
|
-
params['language_id'] = languageId;
|
|
75
|
-
params['year'] = year;
|
|
76
|
-
return yield this.getRelative('/modules/music/albums', params);
|
|
77
|
-
});
|
|
58
|
+
this.albumTypeId = utils_1.Utils.getString(data, "album_type_id");
|
|
59
|
+
this.languageId = utils_1.Utils.getString(data, "language_id");
|
|
60
|
+
this.note = utils_1.Utils.getString(data, "note");
|
|
61
|
+
this.recommended = utils_1.Utils.getBoolean(data, "recommended");
|
|
62
|
+
this.promoted = utils_1.Utils.getBoolean(data, "promoted");
|
|
63
|
+
this.downloadable = utils_1.Utils.getBoolean(data, "downloadable");
|
|
64
|
+
this.durationSeconds = utils_1.Utils.getInteger(data, "duration_seconds");
|
|
65
|
+
this.tracksCount = utils_1.Utils.getInteger(data, "tracks_count");
|
|
66
|
+
this.validatedTracksCount = utils_1.Utils.getInteger(data, "validated_tracks_count");
|
|
67
|
+
this.releasedYear = utils_1.Utils.getInteger(data, "released_year");
|
|
68
|
+
this.listensCount = utils_1.Utils.getInteger(data, "listens_count");
|
|
69
|
+
this.language = utils_1.Utils.getObject(data, "language");
|
|
70
|
+
this.keywords = utils_1.Utils.getObject(data, "keywords");
|
|
71
|
+
this.albumType = utils_1.Utils.getObject(data, "album_type");
|
|
72
|
+
this.categoryMusics = utils_1.Utils.getArray(data, "category_musics");
|
|
73
|
+
this.artists = utils_1.Utils.getArray(data, "artists");
|
|
74
|
+
this.composers = utils_1.Utils.getArray(data, "composers");
|
|
75
|
+
this.bands = utils_1.Utils.getArray(data, "bands");
|
|
76
|
+
this.categoryMusicIds = utils_1.Utils.getArray(data, "category_music_ids");
|
|
77
|
+
this.artistIds = utils_1.Utils.getArray(data, "artist_ids");
|
|
78
|
+
this.composerIds = utils_1.Utils.getArray(data, "composer_ids");
|
|
79
|
+
this.bandIds = utils_1.Utils.getArray(data, "band_ids");
|
|
78
80
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
//Addon filters
|
|
83
|
-
params['title.en'] = titleEN;
|
|
84
|
-
params['title.mm'] = titleMM;
|
|
85
|
-
params['keywords.en'] = keywordsEN;
|
|
86
|
-
params['keywords.mm'] = keywordsMM;
|
|
87
|
-
params['published'] = published === null ? '' : published ? 'true' : 'false';
|
|
88
|
-
params['recommended'] = recommended === null ? '' : recommended ? 'true' : 'false';
|
|
89
|
-
params['downloadable'] = downloadable === null ? '' : downloadable ? 'true' : 'false';
|
|
90
|
-
params['not_validated'] = not_validated === null ? '' : not_validated ? 'true' : 'false';
|
|
91
|
-
params['language_id'] = languageId;
|
|
92
|
-
params['note'] = note;
|
|
93
|
-
params['year'] = year === null ? '' : year;
|
|
94
|
-
// console.log('paginateSongs')
|
|
95
|
-
// console.log(params);
|
|
96
|
-
return yield this.getRelative('/modules/music/albums/paginate', params);
|
|
97
|
-
});
|
|
81
|
+
async getContents(params = {}) {
|
|
82
|
+
const queryParams = this.getSortParameters(params);
|
|
83
|
+
return await this.getRelative('/modules/music/albums', queryParams);
|
|
98
84
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
85
|
+
async paginateContents(params = {}) {
|
|
86
|
+
const queryParams = this.getSortParameters(params);
|
|
87
|
+
if (params.languageId)
|
|
88
|
+
queryParams['language_id'] = params.languageId;
|
|
89
|
+
if (params.recommended)
|
|
90
|
+
queryParams['recommended'] = params.recommended;
|
|
91
|
+
if (params.downloadable)
|
|
92
|
+
queryParams['downloadable'] = params.downloadable;
|
|
93
|
+
if (params.not_validated)
|
|
94
|
+
queryParams['not_validated'] = params.not_validated;
|
|
95
|
+
if (params.released_year)
|
|
96
|
+
queryParams['released_year'] = params.released_year;
|
|
97
|
+
return await this.getRelative('/modules/music/albums/paginate', queryParams);
|
|
105
98
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
params['published'] = published;
|
|
112
|
-
return yield this.getRelative('/modules/music/albums/find', params);
|
|
113
|
-
});
|
|
99
|
+
async findContents(params = {}) {
|
|
100
|
+
const queryParams = this.getSortParameters(params);
|
|
101
|
+
if (params.title)
|
|
102
|
+
queryParams['name'] = params.title;
|
|
103
|
+
return await this.getRelative('/modules/music/albums/find', queryParams);
|
|
114
104
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
});
|
|
105
|
+
async getSongs(albumId, params = {}) {
|
|
106
|
+
const queryParams = this.getSortParameters(params);
|
|
107
|
+
return await this.getRelative(`/modules/music/albums/${albumId}/songs`, queryParams);
|
|
119
108
|
}
|
|
120
|
-
|
|
121
|
-
return
|
|
122
|
-
return yield this.getRelative(`/modules/music/albums/${id}/update`, {});
|
|
123
|
-
});
|
|
109
|
+
async getInfo(id) {
|
|
110
|
+
return await this.getRelative(`/modules/music/albums/${id}`, {});
|
|
124
111
|
}
|
|
125
|
-
|
|
126
|
-
return
|
|
127
|
-
const body = { published, recommended, downloadable, note };
|
|
128
|
-
return yield this.postRelative(`/modules/music/albums/${id}/update/single_fields`, body);
|
|
129
|
-
});
|
|
112
|
+
async updateFields(id, body = {}) {
|
|
113
|
+
return await this.postRelative(`/modules/music/albums/${id}/update/single_fields`, body);
|
|
130
114
|
}
|
|
131
115
|
}
|
|
116
|
+
exports.JDAlbum = JDAlbum;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import JDResource, { ConnectorInfo } from "../../jdResource";
|
|
1
|
+
import JDResource, { ConnectorInfo, defaultSortParams, defaultUpdateFields, PaginateParams } from "../../jdResource";
|
|
2
2
|
export declare class JDArtist extends JDResource {
|
|
3
3
|
languageId: string;
|
|
4
4
|
note: string;
|
|
@@ -7,7 +7,7 @@ export declare class JDArtist extends JDResource {
|
|
|
7
7
|
listenCount: number;
|
|
8
8
|
albumsCount: number;
|
|
9
9
|
songsCount: number;
|
|
10
|
-
|
|
10
|
+
language: Record<string, any>;
|
|
11
11
|
name: Record<string, any>;
|
|
12
12
|
bio: Record<string, any>;
|
|
13
13
|
gender: Record<string, any>;
|
|
@@ -19,58 +19,19 @@ export declare class JDArtist extends JDResource {
|
|
|
19
19
|
get nameMM(): string;
|
|
20
20
|
constructor(data?: Record<string, any>, connectorInfo?: ConnectorInfo);
|
|
21
21
|
setData(data: Record<string, any>): void;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
published?: string | undefined;
|
|
26
|
-
recommended?: string | undefined;
|
|
27
|
-
downloadable?: string | undefined;
|
|
28
|
-
languageId?: string | undefined;
|
|
29
|
-
year?: string | undefined;
|
|
30
|
-
orderBy?: string | undefined;
|
|
31
|
-
order?: string | undefined;
|
|
32
|
-
pageIndex?: number | undefined;
|
|
33
|
-
countPerPage?: number | undefined;
|
|
34
|
-
fields?: string | undefined;
|
|
35
|
-
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
36
|
-
paginateArtists({ nameEN, nameMM, keywordsEN, keywordsMM, published, recommended, languageId, note, orderBy, order, pageIndex, countPerPage, fields }: {
|
|
22
|
+
getContents(params?: Partial<typeof defaultSortParams>): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
23
|
+
paginateContents(params?: PaginateParams & {
|
|
24
|
+
languageId?: string | null;
|
|
37
25
|
nameEN?: string | null;
|
|
38
26
|
nameMM?: string | null;
|
|
39
|
-
keywordsEN?: string | null;
|
|
40
|
-
keywordsMM?: string | null;
|
|
41
|
-
published?: boolean | null;
|
|
42
|
-
recommended?: boolean | null;
|
|
43
|
-
languageId?: string | null;
|
|
44
|
-
note?: string | null;
|
|
45
|
-
orderBy?: string | null;
|
|
46
|
-
order?: string | null;
|
|
47
|
-
pageIndex?: number | null;
|
|
48
|
-
countPerPage?: number | null;
|
|
49
|
-
fields?: string | null;
|
|
50
27
|
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
order?: string | undefined;
|
|
54
|
-
pageIndex?: number | undefined;
|
|
55
|
-
countPerPage?: number | undefined;
|
|
56
|
-
fields?: string | undefined;
|
|
57
|
-
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
58
|
-
findArtists({ title, published, orderBy, order, pageIndex, countPerPage, fields }: {
|
|
59
|
-
title?: string | undefined;
|
|
60
|
-
published?: string | undefined;
|
|
61
|
-
orderBy?: string | undefined;
|
|
62
|
-
order?: string | undefined;
|
|
63
|
-
pageIndex?: number | undefined;
|
|
64
|
-
countPerPage?: number | undefined;
|
|
65
|
-
fields?: string | undefined;
|
|
28
|
+
findContents(params?: PaginateParams & {
|
|
29
|
+
name?: string;
|
|
66
30
|
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
31
|
+
getSongs(artistId: string, params?: Partial<typeof defaultSortParams>): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
32
|
+
getAlbums(artistId: string, params?: Partial<typeof defaultSortParams>): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
67
33
|
getInfo(id: string): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
68
34
|
updateInfo(id: string, title: Record<string, string>, slug: string, expiryDate: Date): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
69
|
-
|
|
70
|
-
published?: boolean | null;
|
|
71
|
-
recommended?: boolean | null;
|
|
72
|
-
downloadable?: boolean | null;
|
|
73
|
-
note?: string | null;
|
|
74
|
-
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
35
|
+
updateFields(id: string, body?: Partial<typeof defaultUpdateFields>): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
75
36
|
}
|
|
76
37
|
//# sourceMappingURL=jdArtist.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jdArtist.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/modules/music/jdArtist.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,EAAE,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"jdArtist.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/modules/music/jdArtist.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,EAAE,EAAC,aAAa,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAEnH,qBAAa,QAAS,SAAQ,UAAU;IACvC,UAAU,EAAC,MAAM,CAAM;IACvB,IAAI,EAAC,MAAM,CAAM;I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