jd_platform_sdk 0.0.4 → 0.0.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.
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/sdk/configs/jdConfig.d.ts.map +1 -1
- package/dist/sdk/configs/jdConfig.js +0 -2
- package/dist/sdk/jdConnector.js +1 -1
- package/dist/sdk/models/jdApplication.d.ts +4 -4
- package/dist/sdk/models/jdApplication.d.ts.map +1 -1
- package/dist/sdk/models/jdApplication.js +8 -8
- package/dist/sdk/models/jdResource.d.ts +16 -10
- package/dist/sdk/models/jdResource.d.ts.map +1 -1
- package/dist/sdk/models/jdResource.js +43 -33
- package/dist/sdk/models/modules/geolocation/jdCity.d.ts +6 -6
- package/dist/sdk/models/modules/geolocation/jdCity.d.ts.map +1 -1
- package/dist/sdk/models/modules/geolocation/jdCity.js +14 -14
- package/dist/sdk/models/modules/geolocation/jdCountry.d.ts +6 -6
- package/dist/sdk/models/modules/geolocation/jdCountry.d.ts.map +1 -1
- package/dist/sdk/models/modules/geolocation/jdCountry.js +14 -14
- package/dist/sdk/models/modules/geolocation/jdDistrict.d.ts +5 -5
- package/dist/sdk/models/modules/geolocation/jdDistrict.d.ts.map +1 -1
- package/dist/sdk/models/modules/geolocation/jdDistrict.js +11 -11
- package/dist/sdk/models/modules/geolocation/jdState.d.ts +6 -6
- package/dist/sdk/models/modules/geolocation/jdState.d.ts.map +1 -1
- package/dist/sdk/models/modules/geolocation/jdState.js +14 -14
- package/dist/sdk/models/modules/karaoke/jdKtvShop.d.ts +5 -4
- package/dist/sdk/models/modules/karaoke/jdKtvShop.d.ts.map +1 -1
- package/dist/sdk/models/modules/karaoke/jdKtvShop.js +13 -8
- package/dist/sdk/models/modules/music/jdAlbum.d.ts +84 -0
- package/dist/sdk/models/modules/music/jdAlbum.d.ts.map +1 -0
- package/dist/sdk/models/modules/music/jdAlbum.js +131 -0
- package/dist/sdk/models/modules/music/jdArtist.d.ts +76 -0
- package/dist/sdk/models/modules/music/jdArtist.d.ts.map +1 -0
- package/dist/sdk/models/modules/music/jdArtist.js +115 -0
- package/dist/sdk/models/modules/music/jdComposer.d.ts +76 -0
- package/dist/sdk/models/modules/music/jdComposer.d.ts.map +1 -0
- package/dist/sdk/models/modules/music/jdComposer.js +115 -0
- package/dist/sdk/models/modules/music/jdMusicCombinations.d.ts +6 -0
- package/dist/sdk/models/modules/music/jdMusicCombinations.d.ts.map +1 -0
- package/dist/sdk/models/modules/music/jdMusicCombinations.js +21 -0
- package/dist/sdk/models/modules/music/jdSong.d.ts +88 -0
- package/dist/sdk/models/modules/music/jdSong.d.ts.map +1 -0
- package/dist/sdk/models/modules/music/jdSong.js +144 -0
- package/dist/sdk/models/modules/user/jdPermission.d.ts +35 -0
- package/dist/sdk/models/modules/user/jdPermission.d.ts.map +1 -0
- package/dist/sdk/models/modules/user/jdPermission.js +73 -0
- package/dist/sdk/models/modules/user/jdSessionUser.d.ts +7 -7
- package/dist/sdk/models/modules/user/jdSessionUser.d.ts.map +1 -1
- package/dist/sdk/models/modules/user/jdSessionUser.js +14 -14
- package/dist/sdk/models/modules/user/jdUser.d.ts +8 -7
- package/dist/sdk/models/modules/user/jdUser.d.ts.map +1 -1
- package/dist/sdk/models/modules/user/jdUser.js +22 -23
- package/dist/sdk/utilities/browserUtils.d.ts +10 -1
- package/dist/sdk/utilities/browserUtils.d.ts.map +1 -1
- package/dist/sdk/utilities/browserUtils.js +80 -1
- package/dist/sdk/utilities/utils.d.ts +20 -10
- package/dist/sdk/utilities/utils.d.ts.map +1 -1
- package/dist/sdk/utilities/utils.js +71 -3
- package/package.json +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import JDResource from "../../jdResource";
|
|
1
|
+
import JDResource, { ConnectorInfo } from "../../jdResource";
|
|
2
2
|
export declare class JDState extends JDResource {
|
|
3
3
|
countryId: string;
|
|
4
4
|
country: Record<string, any>;
|
|
5
5
|
get localisedCountryTitle(): string;
|
|
6
6
|
get countryTitleEN(): string;
|
|
7
7
|
get countryTitleMM(): string;
|
|
8
|
-
constructor(data
|
|
8
|
+
constructor(data?: Record<string, any>, connectorInfo?: ConnectorInfo);
|
|
9
9
|
setData(data: Record<string, any>): void;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
getStates(orderBy?: string, order?: string, pageIndex?: number, countPerPage?: number, fields?: string): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
11
|
+
findStates(title: string, orderBy?: string, order?: string, pageIndex?: number, countPerPage?: number, fields?: string): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
12
|
+
getCities(stateId: string, orderBy?: string, order?: string, pageIndex?: number, countPerPage?: number, fields?: string): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
13
|
+
getInfo(id: string): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
14
14
|
}
|
|
15
15
|
//# sourceMappingURL=jdState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jdState.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/modules/geolocation/jdState.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"jdState.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/modules/geolocation/jdState.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,EAAE,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAE3D,qBAAa,OAAQ,SAAQ,UAAU;IACtC,SAAS,EAAC,MAAM,CAAM;IACtB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;IAElC,IAAI,qBAAqB,IAAG,MAAM,CAAoF;IACtH,IAAI,cAAc,IAAG,MAAM,CAAyE;IACpG,IAAI,cAAc,IAAG,MAAM,CAAyE;gBAExF,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EAAE,aAAa,GAAE,aAAyC;IAKpG,OAAO,CAAC,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAM1B,SAAS,CAAC,OAAO,SAAe,EAAE,KAAK,SAAS,EAAE,SAAS,SAAI,EAAE,YAAY,SAAK,EAAE,MAAM,SAAK;IAK/F,UAAU,CAAC,KAAK,EAAC,MAAM,EAAE,OAAO,SAAe,EAAE,KAAK,SAAS,EAAE,SAAS,SAAI,EAAE,YAAY,SAAK,EAAE,MAAM,SAAK;IAK9G,SAAS,CAAC,OAAO,EAAC,MAAM,EAAE,OAAO,SAAe,EAAE,KAAK,SAAS,EAAE,SAAS,SAAI,EAAE,YAAY,SAAK,EAAE,MAAM,SAAK;IAK/G,OAAO,CAAC,EAAE,EAAC,MAAM;CAGvB"}
|
|
@@ -7,14 +7,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import JDResource from "../../jdResource";
|
|
10
|
+
import JDResource, { ConnectorInfo } from "../../jdResource";
|
|
11
11
|
import { Utils } from "../../../utilities/utils";
|
|
12
12
|
export class JDState extends JDResource {
|
|
13
13
|
get localisedCountryTitle() { return globalThis.language == 'en' ? this.countryTitleEN : this.countryTitleMM; }
|
|
14
14
|
get countryTitleEN() { return Utils.getString(Utils.getObject(this.country, 'title'), 'en'); }
|
|
15
15
|
get countryTitleMM() { return Utils.getString(Utils.getObject(this.country, 'title'), 'mm'); }
|
|
16
|
-
constructor(data) {
|
|
17
|
-
super(
|
|
16
|
+
constructor(data = {}, connectorInfo = new ConnectorInfo("", "")) {
|
|
17
|
+
super(connectorInfo);
|
|
18
18
|
this.countryId = "";
|
|
19
19
|
this.country = {};
|
|
20
20
|
this.setData(data);
|
|
@@ -24,27 +24,27 @@ export class JDState extends JDResource {
|
|
|
24
24
|
this.countryId = Utils.getString(data, "country_id");
|
|
25
25
|
this.country = Utils.getObject(data, "country");
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
getStates() {
|
|
28
28
|
return __awaiter(this, arguments, void 0, function* (orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '') {
|
|
29
|
-
const params =
|
|
30
|
-
return yield
|
|
29
|
+
const params = this.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
|
|
30
|
+
return yield this.getRelative('/modules/geolocation/states', params);
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
findStates(title_1) {
|
|
34
34
|
return __awaiter(this, arguments, void 0, function* (title, orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '') {
|
|
35
|
-
const params =
|
|
36
|
-
return yield
|
|
35
|
+
const params = this.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
|
|
36
|
+
return yield this.getRelative('/modules/geolocation/states/find', params);
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
getCities(stateId_1) {
|
|
40
40
|
return __awaiter(this, arguments, void 0, function* (stateId, orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '') {
|
|
41
|
-
const params =
|
|
42
|
-
return yield
|
|
41
|
+
const params = this.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
|
|
42
|
+
return yield this.getRelative(`/modules/geolocation/states/${stateId}/cities`, params);
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
-
|
|
45
|
+
getInfo(id) {
|
|
46
46
|
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
-
return yield
|
|
47
|
+
return yield this.getRelative(`/modules/geolocation/states/${id}`, {});
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import JDResource from "../../jdResource";
|
|
1
|
+
import JDResource, { ConnectorInfo } from "../../jdResource";
|
|
2
2
|
export declare class JDKtvShop extends JDResource {
|
|
3
3
|
licenseKey: string;
|
|
4
4
|
activationsCount: number;
|
|
@@ -22,9 +22,10 @@ export declare class JDKtvShop extends JDResource {
|
|
|
22
22
|
get districtTitleEN(): string;
|
|
23
23
|
get districtTitleMM(): string;
|
|
24
24
|
expiryDate: Date;
|
|
25
|
-
constructor(data
|
|
25
|
+
constructor(data?: Record<string, any>, connectorInfo?: ConnectorInfo);
|
|
26
26
|
setData(data: Record<string, any>): void;
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
getKtvShops(isRecommended?: boolean, orderBy?: string, order?: string, pageIndex?: number, countPerPage?: number, fields?: string): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
28
|
+
getInfo(id: string): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
29
|
+
updateInfo(id: string, title: Record<string, string>, slug: string, expiryDate: Date): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
29
30
|
}
|
|
30
31
|
//# sourceMappingURL=jdKtvShop.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jdKtvShop.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/modules/karaoke/jdKtvShop.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"jdKtvShop.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/modules/karaoke/jdKtvShop.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,EAAE,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAE3D,qBAAa,SAAU,SAAQ,UAAU;IACxC,UAAU,EAAC,MAAM,CAAM;IACvB,gBAAgB,EAAC,MAAM,CAAK;IAC5B,mBAAmB,EAAC,MAAM,CAAK;IAE/B,SAAS,EAAC,MAAM,CAAM;IACtB,OAAO,EAAC,MAAM,CAAM;IACpB,MAAM,EAAC,MAAM,CAAM;IACnB,UAAU,EAAC,MAAM,CAAM;IAEvB,OAAO,EAAE,MAAM,C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8
|
});
|
|
9
9
|
};
|
|
10
|
-
import JDResource from "../../jdResource";
|
|
10
|
+
import JDResource, { ConnectorInfo } from "../../jdResource";
|
|
11
11
|
import { Utils } from "../../../utilities/utils";
|
|
12
12
|
export class JDKtvShop extends JDResource {
|
|
13
13
|
get localisedAddress() {
|
|
@@ -22,8 +22,8 @@ export class JDKtvShop extends JDResource {
|
|
|
22
22
|
get cityTitleMM() { return Utils.getString(Utils.getObject(this.city, 'title'), 'mm'); }
|
|
23
23
|
get districtTitleEN() { return Utils.getString(Utils.getObject(this.district, 'title'), 'en'); }
|
|
24
24
|
get districtTitleMM() { return Utils.getString(Utils.getObject(this.district, 'title'), 'mm'); }
|
|
25
|
-
constructor(data) {
|
|
26
|
-
super(
|
|
25
|
+
constructor(data = {}, connectorInfo = new ConnectorInfo("", "")) {
|
|
26
|
+
super(connectorInfo);
|
|
27
27
|
this.licenseKey = "";
|
|
28
28
|
this.activationsCount = 0;
|
|
29
29
|
this.maxActivationsCount = 0;
|
|
@@ -55,18 +55,23 @@ export class JDKtvShop extends JDResource {
|
|
|
55
55
|
this.district = Utils.getObject(data, "district");
|
|
56
56
|
this.expiryDate = Utils.getDate(data, "expiry_date");
|
|
57
57
|
}
|
|
58
|
-
|
|
58
|
+
getKtvShops() {
|
|
59
59
|
return __awaiter(this, arguments, void 0, function* (isRecommended = false, orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '') {
|
|
60
|
-
const params =
|
|
60
|
+
const params = this.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
|
|
61
61
|
if (Utils.isset(isRecommended)) {
|
|
62
62
|
params['recommended'] = isRecommended ? 'true' : 'false';
|
|
63
63
|
}
|
|
64
|
-
return yield
|
|
64
|
+
return yield this.getRelative('/modules/karaoke/ktv_shops', params);
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
-
|
|
67
|
+
getInfo(id) {
|
|
68
68
|
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
-
return yield
|
|
69
|
+
return yield this.getRelative(`/modules/karaoke/ktv_shops/${id}`, {});
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
updateInfo(id, title, slug, expiryDate) {
|
|
73
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
return yield this.getRelative(`/modules/karaoke/ktv_shops/${id}`, {});
|
|
70
75
|
});
|
|
71
76
|
}
|
|
72
77
|
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import JDResource, { ConnectorInfo } from "../../jdResource";
|
|
2
|
+
export declare class JDAlbum extends JDResource {
|
|
3
|
+
albumTypeId: string;
|
|
4
|
+
languageId: string;
|
|
5
|
+
note: string;
|
|
6
|
+
recommended: boolean;
|
|
7
|
+
promoted: boolean;
|
|
8
|
+
downloadable: boolean;
|
|
9
|
+
tracksCount: number;
|
|
10
|
+
validatedTracksCount: number;
|
|
11
|
+
durationSeconds: number;
|
|
12
|
+
releasedYear: number;
|
|
13
|
+
listensCount: number;
|
|
14
|
+
language: Record<string, any>;
|
|
15
|
+
keywords: Record<string, any>;
|
|
16
|
+
albumType: Record<string, any>;
|
|
17
|
+
categoryMusics: any[];
|
|
18
|
+
artists: any[];
|
|
19
|
+
composers: any[];
|
|
20
|
+
bands: any[];
|
|
21
|
+
categoryMusicIds: any[];
|
|
22
|
+
artistIds: any[];
|
|
23
|
+
composerIds: any[];
|
|
24
|
+
bandIds: any[];
|
|
25
|
+
constructor(data?: Record<string, any>, connectorInfo?: ConnectorInfo);
|
|
26
|
+
setData(data: Record<string, any>): void;
|
|
27
|
+
getAlbums({ titleEn, keywordEn, published, recommended, downloadable, languageId, year, orderBy, order, pageIndex, countPerPage, fields }: {
|
|
28
|
+
titleEn?: string | undefined;
|
|
29
|
+
keywordEn?: string | undefined;
|
|
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;
|
|
47
|
+
recommended?: boolean | null;
|
|
48
|
+
downloadable?: boolean | null;
|
|
49
|
+
not_validated?: boolean | null;
|
|
50
|
+
languageId?: string | null;
|
|
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;
|
|
65
|
+
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
66
|
+
findAlbums({ title, published, orderBy, order, pageIndex, countPerPage, fields }: {
|
|
67
|
+
title?: string | undefined;
|
|
68
|
+
published?: string | undefined;
|
|
69
|
+
orderBy?: string | undefined;
|
|
70
|
+
order?: string | undefined;
|
|
71
|
+
pageIndex?: number | undefined;
|
|
72
|
+
countPerPage?: number | undefined;
|
|
73
|
+
fields?: string | undefined;
|
|
74
|
+
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
75
|
+
getInfo(id: string): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
76
|
+
updateInfo(id: string, title: Record<string, string>, slug: string, expiryDate: Date): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
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>;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=jdAlbum.d.ts.map
|
|
@@ -0,0 +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;AAE3D,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,CAAM;IACpB,SAA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3B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACrB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACxB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACtB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAC1B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAC7B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KACvB;IAuBK,QAAQ,CAAC,OAAO,EAAC,MAAM,EAAG,EAAE,OAAsB,EAAE,KAAc,EAAE,SAAa,EAAE,YAAiB,EAAE,MAAW,EAAC;;;;;;KAAA;IAMlH,UAAU,CAAC,EAAE,KAAU,EAAE,SAAc,EAAE,OAAsB,EAAE,KAAc,EAAE,SAAa,EAAE,YAAiB,EAAE,MAAW,EAAC;;;;;;;;KAAA;IAS/H,OAAO,CAAC,EAAE,EAAC,MAAM;IAIjB,UAAU,CAAC,EAAE,EAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAC,IAAI;IAIlF,kBAAkB,CAAC,EAAE,EAAC,MAAM,EAAE,EAAC,SAAgB,EAAE,WAAiB,EAAE,YAAmB,EAAE,IAAU,EAAC,EAAE;QAC3G,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;QAC3B,WAAW,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;QAC7B,YAAY,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;QAC9B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KACrB;CAID"}
|
|
@@ -0,0 +1,131 @@
|
|
|
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
|
+
import JDResource, { ConnectorInfo } from "../../jdResource";
|
|
11
|
+
import { Utils } from "../../../utilities/utils";
|
|
12
|
+
export class JDAlbum extends JDResource {
|
|
13
|
+
constructor(data = {}, connectorInfo = new ConnectorInfo("", "")) {
|
|
14
|
+
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
|
+
this.setData(data);
|
|
38
|
+
}
|
|
39
|
+
setData(data) {
|
|
40
|
+
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
|
+
});
|
|
78
|
+
}
|
|
79
|
+
paginateAlbums(_a) {
|
|
80
|
+
return __awaiter(this, arguments, void 0, function* ({ titleEN = "", titleMM = "", keywordsEN = "", keywordsMM = "", published = null, recommended = null, downloadable = null, not_validated = null, languageId = "", year = null, note = "", orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '' }) {
|
|
81
|
+
const params = this.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
|
|
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
|
+
});
|
|
98
|
+
}
|
|
99
|
+
// Get all the songs for album
|
|
100
|
+
getSongs(albumId_1, _a) {
|
|
101
|
+
return __awaiter(this, arguments, void 0, function* (albumId, { orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '' }) {
|
|
102
|
+
const params = this.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
|
|
103
|
+
return yield this.getRelative(`/modules/music/albums/${albumId}/songs`, params);
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
findAlbums(_a) {
|
|
107
|
+
return __awaiter(this, arguments, void 0, function* ({ title = "", published = "", orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '' }) {
|
|
108
|
+
const params = this.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
|
|
109
|
+
//Addon filters
|
|
110
|
+
params['title'] = title;
|
|
111
|
+
params['published'] = published;
|
|
112
|
+
return yield this.getRelative('/modules/music/albums/find', params);
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
getInfo(id) {
|
|
116
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
117
|
+
return yield this.getRelative(`/modules/music/albums/${id}`, {});
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
updateInfo(id, title, slug, expiryDate) {
|
|
121
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
122
|
+
return yield this.getRelative(`/modules/music/albums/${id}/update`, {});
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
updateSingleFields(id_1, _a) {
|
|
126
|
+
return __awaiter(this, arguments, void 0, function* (id, { published = null, recommended = null, downloadable = null, note = null }) {
|
|
127
|
+
const body = { published, recommended, downloadable, note };
|
|
128
|
+
return yield this.postRelative(`/modules/music/albums/${id}/update/single_fields`, body);
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import JDResource, { ConnectorInfo } from "../../jdResource";
|
|
2
|
+
export declare class JDArtist extends JDResource {
|
|
3
|
+
languageId: string;
|
|
4
|
+
note: string;
|
|
5
|
+
recommended: boolean;
|
|
6
|
+
promoted: boolean;
|
|
7
|
+
listenCount: number;
|
|
8
|
+
albumsCount: number;
|
|
9
|
+
songsCount: number;
|
|
10
|
+
languageInfo: Record<string, any>;
|
|
11
|
+
name: Record<string, any>;
|
|
12
|
+
bio: Record<string, any>;
|
|
13
|
+
gender: Record<string, any>;
|
|
14
|
+
keywords: Record<string, any>;
|
|
15
|
+
categoryMusics: any[];
|
|
16
|
+
categoryMusicIds: any[];
|
|
17
|
+
get localisedName(): string;
|
|
18
|
+
get nameEN(): string;
|
|
19
|
+
get nameMM(): string;
|
|
20
|
+
constructor(data?: Record<string, any>, connectorInfo?: ConnectorInfo);
|
|
21
|
+
setData(data: Record<string, any>): void;
|
|
22
|
+
getArtists({ nameEn, keywordEn, published, recommended, downloadable, languageId, year, orderBy, order, pageIndex, countPerPage, fields }: {
|
|
23
|
+
nameEn?: string | undefined;
|
|
24
|
+
keywordEn?: string | undefined;
|
|
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 }: {
|
|
37
|
+
nameEN?: string | null;
|
|
38
|
+
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
|
+
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
51
|
+
getSongs(artistId: string, { orderBy, order, pageIndex, countPerPage, fields }: {
|
|
52
|
+
orderBy?: string | undefined;
|
|
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;
|
|
66
|
+
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
67
|
+
getInfo(id: string): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
68
|
+
updateInfo(id: string, title: Record<string, string>, slug: string, expiryDate: Date): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
69
|
+
updateSingleFields(id: string, { published, recommended, downloadable, note }: {
|
|
70
|
+
published?: boolean | null;
|
|
71
|
+
recommended?: boolean | null;
|
|
72
|
+
downloadable?: boolean | null;
|
|
73
|
+
note?: string | null;
|
|
74
|
+
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=jdArtist.d.ts.map
|
|
@@ -0,0 +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;AAE3D,qBAAa,QAAS,SAAQ,UAAU;IACvC,UAAU,EAAC,MAAM,CAAM;IACvB,IAAI,EAAC,MAAM,CAAM;IAEjB,WAAW,EAAC,OAAO,CAAS;IAC5B,QAAQ,EAAC,OAAO,CAAS;IAEzB,WAAW,EAAC,MAAM,CAAK;IACvB,WAAW,EAAC,MAAM,CAAK;IACvB,UAAU,EAAC,MAAM,CAAK;IAEtB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;IACvC,IAAI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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
|
+
import JDResource, { ConnectorInfo } from "../../jdResource";
|
|
11
|
+
import { Utils } from "../../../utilities/utils";
|
|
12
|
+
export class JDArtist extends JDResource {
|
|
13
|
+
get localisedName() { return globalThis.language == 'mm' ? this.nameEN : this.nameMM; }
|
|
14
|
+
get nameEN() { return Utils.getString(this.title, 'en'); }
|
|
15
|
+
get nameMM() { return Utils.getString(this.title, 'mm'); }
|
|
16
|
+
constructor(data = {}, connectorInfo = new ConnectorInfo("", "")) {
|
|
17
|
+
super(connectorInfo);
|
|
18
|
+
this.languageId = "";
|
|
19
|
+
this.note = "";
|
|
20
|
+
this.recommended = false;
|
|
21
|
+
this.promoted = false;
|
|
22
|
+
this.listenCount = 0;
|
|
23
|
+
this.albumsCount = 0;
|
|
24
|
+
this.songsCount = 0;
|
|
25
|
+
this.languageInfo = {};
|
|
26
|
+
this.name = {};
|
|
27
|
+
this.bio = {};
|
|
28
|
+
this.gender = {};
|
|
29
|
+
this.keywords = {};
|
|
30
|
+
this.categoryMusics = [];
|
|
31
|
+
this.categoryMusicIds = [];
|
|
32
|
+
this.setData(data);
|
|
33
|
+
}
|
|
34
|
+
setData(data) {
|
|
35
|
+
super.setData(data);
|
|
36
|
+
this.languageId = Utils.getString(data, "language_id");
|
|
37
|
+
this.note = Utils.getString(data, "note");
|
|
38
|
+
this.recommended = Utils.getBoolean(data, "recommended");
|
|
39
|
+
this.promoted = Utils.getBoolean(data, "promoted");
|
|
40
|
+
this.listenCount = Utils.getInteger(data, "listen_Count");
|
|
41
|
+
this.albumsCount = Utils.getInteger(data, "albums_count");
|
|
42
|
+
this.songsCount = Utils.getInteger(data, "songs_count");
|
|
43
|
+
this.languageInfo = Utils.getObject(data, "language_info");
|
|
44
|
+
this.name = Utils.getObject(data, "name");
|
|
45
|
+
this.bio = Utils.getObject(data, "bio");
|
|
46
|
+
this.gender = Utils.getObject(data, "gender");
|
|
47
|
+
this.keywords = Utils.getObject(data, "keywords");
|
|
48
|
+
this.categoryMusics = Utils.getArray(data, "category_musics");
|
|
49
|
+
this.categoryMusicIds = Utils.getArray(data, "category_music_ids");
|
|
50
|
+
}
|
|
51
|
+
// Filter artists
|
|
52
|
+
getArtists(_a) {
|
|
53
|
+
return __awaiter(this, arguments, void 0, function* ({ nameEn = "", keywordEn = "", published = "", recommended = "", downloadable = "", languageId = "", year = "", orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '' }) {
|
|
54
|
+
const params = this.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
|
|
55
|
+
//Addon filters
|
|
56
|
+
params['name.en'] = nameEn;
|
|
57
|
+
params['keyword.en'] = keywordEn;
|
|
58
|
+
params['published'] = published;
|
|
59
|
+
params['recommended'] = recommended;
|
|
60
|
+
params['downloadable'] = downloadable;
|
|
61
|
+
params['language_id'] = languageId;
|
|
62
|
+
params['year'] = year;
|
|
63
|
+
return yield this.getRelative('/modules/music/artists', params);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
paginateArtists(_a) {
|
|
67
|
+
return __awaiter(this, arguments, void 0, function* ({ nameEN = "", nameMM = "", keywordsEN = "", keywordsMM = "", published = null, recommended = null, languageId = "", note = "", orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '' }) {
|
|
68
|
+
const params = this.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
|
|
69
|
+
//Addon filters
|
|
70
|
+
params['name.en'] = nameEN;
|
|
71
|
+
params['name.mm'] = nameMM;
|
|
72
|
+
params['keywords.en'] = keywordsEN;
|
|
73
|
+
params['keywords.mm'] = keywordsMM;
|
|
74
|
+
params['published'] = published === null ? '' : published ? 'true' : 'false';
|
|
75
|
+
params['recommended'] = recommended === null ? '' : recommended ? 'true' : 'false';
|
|
76
|
+
params['language_id'] = languageId;
|
|
77
|
+
params['note'] = note;
|
|
78
|
+
// console.log('paginateSongs')
|
|
79
|
+
// console.log(params);
|
|
80
|
+
return yield this.getRelative('/modules/music/artists/paginate', params);
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
// Get all the songs for artist
|
|
84
|
+
getSongs(artistId_1, _a) {
|
|
85
|
+
return __awaiter(this, arguments, void 0, function* (artistId, { orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '' }) {
|
|
86
|
+
const params = this.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
|
|
87
|
+
return yield this.getRelative(`/modules/music/artists/${artistId}/songs`, params);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
findArtists(_a) {
|
|
91
|
+
return __awaiter(this, arguments, void 0, function* ({ title = "", published = "", orderBy = 'updated_at', order = 'desc', pageIndex = 0, countPerPage = 20, fields = '' }) {
|
|
92
|
+
const params = this.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
|
|
93
|
+
//Addon filters
|
|
94
|
+
params['title'] = title;
|
|
95
|
+
params['published'] = published;
|
|
96
|
+
return yield this.getRelative('/modules/music/artists/find', params);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
getInfo(id) {
|
|
100
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
101
|
+
return yield this.getRelative(`/modules/music/artists/${id}`, {});
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
updateInfo(id, title, slug, expiryDate) {
|
|
105
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
106
|
+
return yield this.getRelative(`/modules/music/artists/${id}/update`, {});
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
updateSingleFields(id_1, _a) {
|
|
110
|
+
return __awaiter(this, arguments, void 0, function* (id, { published = null, recommended = null, downloadable = null, note = null }) {
|
|
111
|
+
const body = { published, recommended, downloadable, note };
|
|
112
|
+
return yield this.postRelative(`/modules/music/artists/${id}/update/single_fields`, body);
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
}
|