jd_platform_sdk 0.1.2 → 0.1.4
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 +21 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -18
- package/dist/sdk/models/dashboard/geolocation/jdCity.d.ts +19 -0
- package/dist/sdk/models/dashboard/geolocation/jdCity.d.ts.map +1 -0
- package/dist/sdk/models/dashboard/geolocation/jdCity.js +64 -0
- package/dist/sdk/models/dashboard/geolocation/jdCountry.d.ts +14 -0
- package/dist/sdk/models/dashboard/geolocation/jdCountry.d.ts.map +1 -0
- package/dist/sdk/models/dashboard/geolocation/jdCountry.js +56 -0
- package/dist/sdk/models/dashboard/geolocation/jdDistrict.d.ts +18 -0
- package/dist/sdk/models/dashboard/geolocation/jdDistrict.d.ts.map +1 -0
- package/dist/sdk/models/dashboard/geolocation/jdDistrict.js +58 -0
- package/dist/sdk/models/dashboard/geolocation/jdGeolocationCombinations.d.ts +6 -0
- package/dist/sdk/models/dashboard/geolocation/jdGeolocationCombinations.d.ts.map +1 -0
- package/dist/sdk/models/dashboard/geolocation/jdGeolocationCombinations.js +21 -0
- package/dist/sdk/models/dashboard/geolocation/jdState.d.ts +19 -0
- package/dist/sdk/models/dashboard/geolocation/jdState.d.ts.map +1 -0
- package/dist/sdk/models/dashboard/geolocation/jdState.js +64 -0
- package/dist/sdk/models/dashboard/jdApplication.d.ts +27 -0
- package/dist/sdk/models/dashboard/jdApplication.d.ts.map +1 -0
- package/dist/sdk/models/dashboard/jdApplication.js +76 -0
- package/dist/sdk/models/dashboard/jdCallbackNotification.d.ts +29 -0
- package/dist/sdk/models/dashboard/jdCallbackNotification.d.ts.map +1 -0
- package/dist/sdk/models/dashboard/jdCallbackNotification.js +83 -0
- package/dist/sdk/models/dashboard/jdDashboardCombinations.d.ts +6 -0
- package/dist/sdk/models/dashboard/jdDashboardCombinations.d.ts.map +1 -0
- package/dist/sdk/models/dashboard/jdDashboardCombinations.js +21 -0
- package/dist/sdk/models/dashboard/jdKtvShop.d.ts +41 -0
- package/dist/sdk/models/dashboard/jdKtvShop.d.ts.map +1 -0
- package/dist/sdk/models/dashboard/jdKtvShop.js +92 -0
- package/dist/sdk/models/dashboard/jdModule.d.ts +16 -0
- package/dist/sdk/models/dashboard/jdModule.d.ts.map +1 -0
- package/dist/sdk/models/dashboard/jdModule.js +57 -0
- package/dist/sdk/models/dashboard/jdPlatform.d.ts +16 -0
- package/dist/sdk/models/dashboard/jdPlatform.d.ts.map +1 -0
- package/dist/sdk/models/dashboard/jdPlatform.js +57 -0
- package/dist/sdk/models/dashboard/jdRadioStation.d.ts +41 -0
- package/dist/sdk/models/dashboard/jdRadioStation.d.ts.map +1 -0
- package/dist/sdk/models/dashboard/jdRadioStation.js +92 -0
- package/dist/sdk/models/dashboard/jdSmsVerification.d.ts +18 -0
- package/dist/sdk/models/dashboard/jdSmsVerification.d.ts.map +1 -0
- package/dist/sdk/models/dashboard/jdSmsVerification.js +61 -0
- package/dist/sdk/models/dashboard/user/jdAccessToken.d.ts +17 -0
- package/dist/sdk/models/dashboard/user/jdAccessToken.d.ts.map +1 -0
- package/dist/sdk/models/dashboard/user/jdAccessToken.js +59 -0
- package/dist/sdk/models/dashboard/user/jdModerator.d.ts +28 -0
- package/dist/sdk/models/dashboard/user/jdModerator.d.ts.map +1 -0
- package/dist/sdk/models/dashboard/user/jdModerator.js +71 -0
- package/dist/sdk/models/dashboard/user/jdPermission.d.ts +22 -0
- package/dist/sdk/models/dashboard/user/jdPermission.d.ts.map +1 -0
- package/dist/sdk/models/dashboard/user/jdPermission.js +68 -0
- package/dist/sdk/models/dashboard/user/jdPermissionGroup.d.ts +17 -0
- package/dist/sdk/models/dashboard/user/jdPermissionGroup.d.ts.map +1 -0
- package/dist/sdk/models/dashboard/user/jdPermissionGroup.js +60 -0
- package/dist/sdk/models/dashboard/user/jdSessionAccessToken.d.ts +19 -0
- package/dist/sdk/models/dashboard/user/jdSessionAccessToken.d.ts.map +1 -0
- package/dist/sdk/models/dashboard/user/jdSessionAccessToken.js +63 -0
- package/dist/sdk/models/dashboard/user/jdSessionUser.d.ts +30 -0
- package/dist/sdk/models/dashboard/user/jdSessionUser.d.ts.map +1 -0
- package/dist/sdk/models/dashboard/user/jdSessionUser.js +88 -0
- package/dist/sdk/models/dashboard/user/jdUser.d.ts +30 -0
- package/dist/sdk/models/dashboard/user/jdUser.d.ts.map +1 -0
- package/dist/sdk/models/dashboard/user/jdUser.js +90 -0
- package/dist/sdk/models/dashboard/user/jdUserRole.d.ts +16 -0
- package/dist/sdk/models/dashboard/user/jdUserRole.d.ts.map +1 -0
- package/dist/sdk/models/dashboard/user/jdUserRole.js +66 -0
- package/dist/sdk/models/jdApplication.js +1 -1
- package/dist/sdk/models/jdResource.d.ts.map +1 -1
- package/dist/sdk/models/modules/dashboard/jdCallbackNotification.d.ts +25 -0
- package/dist/sdk/models/modules/dashboard/jdCallbackNotification.d.ts.map +1 -0
- package/dist/sdk/models/modules/dashboard/jdCallbackNotification.js +75 -0
- package/dist/sdk/models/modules/dashboard/jdPlatform.d.ts +16 -0
- package/dist/sdk/models/modules/dashboard/jdPlatform.d.ts.map +1 -0
- package/dist/sdk/models/modules/dashboard/jdPlatform.js +57 -0
- package/dist/sdk/models/modules/dashboard/jdSmsVerification.d.ts +18 -0
- package/dist/sdk/models/modules/dashboard/jdSmsVerification.d.ts.map +1 -0
- package/dist/sdk/models/modules/dashboard/jdSmsVerification.js +61 -0
- package/dist/sdk/models/modules/geolocation/jdCity.js +1 -1
- package/dist/sdk/models/modules/geolocation/jdCountry.js +1 -1
- package/dist/sdk/models/modules/geolocation/jdDistrict.js +1 -1
- package/dist/sdk/models/modules/geolocation/jdGeolocationCombinations.d.ts +6 -0
- package/dist/sdk/models/modules/geolocation/jdGeolocationCombinations.d.ts.map +1 -0
- package/dist/sdk/models/modules/geolocation/jdGeolocationCombinations.js +21 -0
- package/dist/sdk/models/modules/geolocation/jdState.js +1 -1
- package/dist/sdk/models/modules/karaoke/jdKtvShop.js +1 -1
- package/dist/sdk/models/modules/music/jdAlbum.js +1 -1
- package/dist/sdk/models/modules/music/jdArtist.js +1 -1
- package/dist/sdk/models/modules/music/jdComposer.js +1 -1
- package/dist/sdk/models/modules/music/jdSong.js +1 -1
- package/dist/sdk/models/modules/radio_station/jdRadioStation.js +1 -1
- package/dist/sdk/models/modules/user/jdAccessToken.d.ts +17 -0
- package/dist/sdk/models/modules/user/jdAccessToken.d.ts.map +1 -0
- package/dist/sdk/models/modules/user/jdAccessToken.js +59 -0
- package/dist/sdk/models/modules/user/jdModerator.d.ts +28 -0
- package/dist/sdk/models/modules/user/jdModerator.d.ts.map +1 -0
- package/dist/sdk/models/modules/user/jdModerator.js +71 -0
- package/dist/sdk/models/modules/user/jdPermission.js +1 -1
- package/dist/sdk/models/modules/user/jdPermissionGroup.js +1 -1
- package/dist/sdk/models/modules/user/jdSessionAccessToken.d.ts +19 -0
- package/dist/sdk/models/modules/user/jdSessionAccessToken.d.ts.map +1 -0
- package/dist/sdk/models/modules/user/jdSessionAccessToken.js +63 -0
- package/dist/sdk/models/modules/user/jdSessionUser.js +1 -1
- package/dist/sdk/models/modules/user/jdUser.d.ts.map +1 -1
- package/dist/sdk/models/modules/user/jdUser.js +1 -1
- package/dist/sdk/models/modules/user/jdUserRole.js +1 -1
- package/dist/sdk/utilities/browserUtils.d.ts +1 -1
- package/dist/sdk/utilities/browserUtils.d.ts.map +1 -1
- package/dist/sdk/utilities/browserUtils.js +1 -1
- package/dist/sdk/utilities/utils.d.ts +1 -0
- package/dist/sdk/utilities/utils.d.ts.map +1 -1
- package/dist/sdk/utilities/utils.js +16 -0
- package/package.json +1 -1
|
@@ -0,0 +1,61 @@
|
|
|
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 JdSmsVerification extends JDResource {
|
|
13
|
+
constructor(data = {}, connectorInfo = new ConnectorInfo("", "")) {
|
|
14
|
+
super(connectorInfo);
|
|
15
|
+
this.serviceName = '';
|
|
16
|
+
this.phone = '';
|
|
17
|
+
this.code = '';
|
|
18
|
+
this.verified = false;
|
|
19
|
+
this.expiryDate = new Date();
|
|
20
|
+
this.setData(data);
|
|
21
|
+
}
|
|
22
|
+
setData(data) {
|
|
23
|
+
super.setData(data);
|
|
24
|
+
this.serviceName = Utils.getString(data, 'serviceName');
|
|
25
|
+
this.phone = Utils.getString(data, 'phone');
|
|
26
|
+
this.code = Utils.getString(data, 'code');
|
|
27
|
+
this.verified = Utils.getBoolean(data, 'verified');
|
|
28
|
+
this.expiryDate = Utils.getDate(data, 'expiry_date');
|
|
29
|
+
}
|
|
30
|
+
getContents() {
|
|
31
|
+
return __awaiter(this, arguments, void 0, function* (params = {}) {
|
|
32
|
+
const queryParams = this.getSortParameters(params);
|
|
33
|
+
return yield this.getRelative('/dashboard/sms_verifications', queryParams);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
paginateContents() {
|
|
37
|
+
return __awaiter(this, arguments, void 0, function* (params = {}) {
|
|
38
|
+
const queryParams = this.getSortParameters(params);
|
|
39
|
+
if (params.name)
|
|
40
|
+
queryParams['name'] = params.name;
|
|
41
|
+
return yield this.getRelative('/dashboard/sms_verifications/paginate', queryParams);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
findContents(title_1) {
|
|
45
|
+
return __awaiter(this, arguments, void 0, function* (title, params = {}) {
|
|
46
|
+
const queryParams = this.getSortParameters(params);
|
|
47
|
+
queryParams['title'] = title;
|
|
48
|
+
return yield this.getRelative('/dashboard/sms_verifications/find', queryParams);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
getInfo(id) {
|
|
52
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
return yield this.getRelative(`/dashboard/sms_verifications/${id}`, {});
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
updateFields(id_1) {
|
|
57
|
+
return __awaiter(this, arguments, void 0, function* (id, body = {}) {
|
|
58
|
+
return yield this.postRelative(`/dashboard/sms_verifications/${id}/update`, body);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import JDResource, { ConnectorInfo, defaultSortParams, defaultUpdateFields, PaginateParams } from "../../jdResource";
|
|
2
|
+
export declare class JDAccessToken extends JDResource {
|
|
3
|
+
userId: string;
|
|
4
|
+
token: string;
|
|
5
|
+
user: Record<string, any>;
|
|
6
|
+
expiryDate: Date;
|
|
7
|
+
constructor(data?: Record<string, any>, connectorInfo?: ConnectorInfo);
|
|
8
|
+
setData(data: Record<string, any>): void;
|
|
9
|
+
getContents(params?: Partial<typeof defaultSortParams>): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
10
|
+
paginateContents(params?: PaginateParams & {
|
|
11
|
+
name?: string | null;
|
|
12
|
+
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
13
|
+
findContents(title: string, params?: Partial<typeof defaultSortParams>): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
14
|
+
getInfo(id: string): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
15
|
+
updateFields(id: string, body?: Partial<typeof defaultUpdateFields>): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=jdAccessToken.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jdAccessToken.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/dashboard/user/jdAccessToken.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,EAAE,EAAC,aAAa,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAEnH,qBAAa,aAAc,SAAQ,UAAU;IAC5C,MAAM,SAAM;IACZ,KAAK,SAAM;IACX,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;IAC/B,UAAU,EAAC,IAAI,CAAc;gBAEjB,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EAAE,aAAa,GAAE,aAAyC;IAKpG,OAAO,CAAC,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAQ1B,WAAW,CAAC,MAAM,GAAE,OAAO,CAAC,OAAO,iBAAiB,CAAM;IAK1D,gBAAgB,CAAC,MAAM,GAAE,cAAc,GAAG;QAAE,IAAI,CAAC,EAAE,MAAM,GAAC,IAAI,CAAC;KAAQ;IAMvE,YAAY,CAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAE,OAAO,CAAC,OAAO,iBAAiB,CAAM;IAM3E,OAAO,CAAC,EAAE,EAAC,MAAM;IAIjB,YAAY,CAAC,EAAE,EAAC,MAAM,EAAE,IAAI,GAAE,OAAO,CAAC,OAAO,mBAAmB,CAAM;CAG5E"}
|
|
@@ -0,0 +1,59 @@
|
|
|
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 JDAccessToken extends JDResource {
|
|
13
|
+
constructor(data = {}, connectorInfo = new ConnectorInfo("", "")) {
|
|
14
|
+
super(connectorInfo);
|
|
15
|
+
this.userId = '';
|
|
16
|
+
this.token = '';
|
|
17
|
+
this.user = {};
|
|
18
|
+
this.expiryDate = new Date();
|
|
19
|
+
this.setData(data);
|
|
20
|
+
}
|
|
21
|
+
setData(data) {
|
|
22
|
+
super.setData(data);
|
|
23
|
+
this.userId = Utils.getString(data, 'user_id');
|
|
24
|
+
this.token = Utils.getString(data, 'token');
|
|
25
|
+
this.user = Utils.getObject(data, 'user');
|
|
26
|
+
this.expiryDate = Utils.getDate(data, 'expiry_date');
|
|
27
|
+
}
|
|
28
|
+
getContents() {
|
|
29
|
+
return __awaiter(this, arguments, void 0, function* (params = {}) {
|
|
30
|
+
const queryParams = this.getSortParameters(params);
|
|
31
|
+
return yield this.getRelative('/modules/user/access_tokens', queryParams);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
paginateContents() {
|
|
35
|
+
return __awaiter(this, arguments, void 0, function* (params = {}) {
|
|
36
|
+
const queryParams = this.getSortParameters(params);
|
|
37
|
+
if (params.name)
|
|
38
|
+
queryParams['name'] = params.name;
|
|
39
|
+
return yield this.getRelative('/modules/user/access_tokens/paginate', queryParams);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
findContents(title_1) {
|
|
43
|
+
return __awaiter(this, arguments, void 0, function* (title, params = {}) {
|
|
44
|
+
const queryParams = this.getSortParameters(params);
|
|
45
|
+
queryParams['title'] = title;
|
|
46
|
+
return yield this.getRelative('/modules/user/access_tokens/find', queryParams);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
getInfo(id) {
|
|
50
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
51
|
+
return yield this.getRelative(`/modules/user/access_tokens/${id}`, {});
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
updateFields(id_1) {
|
|
55
|
+
return __awaiter(this, arguments, void 0, function* (id, body = {}) {
|
|
56
|
+
return yield this.postRelative(`/modules/user/access_tokens/${id}/update`, body);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import JDResource, { ConnectorInfo, defaultSortParams, PaginateParams, UpdateFields } from "../../jdResource";
|
|
2
|
+
export declare class JdModerator extends JDResource {
|
|
3
|
+
name: string;
|
|
4
|
+
email: string;
|
|
5
|
+
userId: string;
|
|
6
|
+
applicationId: string;
|
|
7
|
+
ktvShopId: string;
|
|
8
|
+
radioStationId: string;
|
|
9
|
+
user: Record<string, any>;
|
|
10
|
+
ktvShop: Record<string, any>;
|
|
11
|
+
radioStation: Record<string, any>;
|
|
12
|
+
constructor(data?: Record<string, any>, connectorInfo?: ConnectorInfo);
|
|
13
|
+
setData(data: Record<string, any>): void;
|
|
14
|
+
getContents(params?: Partial<typeof defaultSortParams>): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
15
|
+
paginateContents(params?: PaginateParams & {
|
|
16
|
+
name?: string | null;
|
|
17
|
+
email?: string | null;
|
|
18
|
+
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
19
|
+
findContents(name: string, params?: Partial<typeof defaultSortParams>): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
20
|
+
getInfo(id: string): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
21
|
+
updateFields(id: string, body?: UpdateFields & {
|
|
22
|
+
name?: string | null;
|
|
23
|
+
username?: string | null;
|
|
24
|
+
email?: string | null;
|
|
25
|
+
phone?: string | null;
|
|
26
|
+
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=jdModerator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jdModerator.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/dashboard/user/jdModerator.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,EAAE,EAAC,aAAa,EAAyB,iBAAiB,EAAuB,cAAc,EAAE,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAGxJ,qBAAa,WAAY,SAAQ,UAAU;IAC1C,IAAI,EAAC,MAAM,CAAM;IACjB,KAAK,EAAC,MAAM,CAAM;IAElB,MAAM,EAAC,MAAM,CAAM;IACnB,aAAa,EAAC,MAAM,CAAM;IAC1B,SAAS,EAAC,MAAM,CAAM;IACtB,cAAc,EAAC,MAAM,CAAM;IAE3B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;IAC/B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;IAClC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;gBAE3B,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,KAAK,CAAC,EAAE,MAAM,GAAC,IAAI,CAAC;KAAO;IAO3F,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,OAAO,CAAC,OAAO,iBAAiB,CAAM;IAMzE,OAAO,CAAC,EAAE,EAAC,MAAM;IAIjB,YAAY,CAAC,EAAE,EAAC,MAAM,EAAE,IAAI,GAAE,YAAY,GAAI;QAAE,IAAI,CAAC,EAAE,MAAM,GAAC,IAAI,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,GAAC,IAAI,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,GAAC,IAAI,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,GAAC,IAAI,CAAC;KAAM;CAGjJ"}
|
|
@@ -0,0 +1,71 @@
|
|
|
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 JdModerator extends JDResource {
|
|
13
|
+
constructor(data = {}, connectorInfo = new ConnectorInfo("", "")) {
|
|
14
|
+
super(connectorInfo);
|
|
15
|
+
this.name = "";
|
|
16
|
+
this.email = "";
|
|
17
|
+
this.userId = "";
|
|
18
|
+
this.applicationId = "";
|
|
19
|
+
this.ktvShopId = "";
|
|
20
|
+
this.radioStationId = "";
|
|
21
|
+
this.user = {};
|
|
22
|
+
this.ktvShop = {};
|
|
23
|
+
this.radioStation = {};
|
|
24
|
+
this.setData(data);
|
|
25
|
+
}
|
|
26
|
+
setData(data) {
|
|
27
|
+
super.setData(data);
|
|
28
|
+
this.name = Utils.getString(data, "name");
|
|
29
|
+
this.email = Utils.getString(data, "email");
|
|
30
|
+
this.userId = Utils.getString(data, "user_id");
|
|
31
|
+
this.applicationId = Utils.getString(data, "application_id");
|
|
32
|
+
this.ktvShopId = Utils.getString(data, "ktv_shop_id");
|
|
33
|
+
this.radioStationId = Utils.getString(data, "radio_station_id");
|
|
34
|
+
this.user = Utils.getObject(data, "user");
|
|
35
|
+
this.ktvShop = Utils.getObject(data, "ktv_shop");
|
|
36
|
+
this.radioStation = Utils.getObject(data, "radio_station");
|
|
37
|
+
}
|
|
38
|
+
getContents() {
|
|
39
|
+
return __awaiter(this, arguments, void 0, function* (params = {}) {
|
|
40
|
+
const queryParams = this.getSortParameters(params);
|
|
41
|
+
return yield this.getRelative('/modules/user/moderators', queryParams);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
paginateContents() {
|
|
45
|
+
return __awaiter(this, arguments, void 0, function* (params = {}) {
|
|
46
|
+
const queryParams = this.getSortParameters(params);
|
|
47
|
+
if (params.name)
|
|
48
|
+
queryParams['name'] = params.name;
|
|
49
|
+
if (params.email)
|
|
50
|
+
queryParams['email'] = params.email;
|
|
51
|
+
return yield this.getRelative('/modules/user/moderators/paginate', params);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
findContents(name_1) {
|
|
55
|
+
return __awaiter(this, arguments, void 0, function* (name, params = {}) {
|
|
56
|
+
const queryParams = this.getSortParameters(params);
|
|
57
|
+
queryParams['name'] = name;
|
|
58
|
+
return yield this.getRelative('/modules/user/moderators/find', queryParams);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
getInfo(id) {
|
|
62
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
return yield this.getRelative(`/modules/user/moderators/${id}`, {});
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
updateFields(id_1) {
|
|
67
|
+
return __awaiter(this, arguments, void 0, function* (id, body = {}) {
|
|
68
|
+
return yield this.postRelative(`/modules/user/moderators/${id}/update`, body);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import JDResource, { ConnectorInfo, defaultSortParams, defaultUpdateFields, PaginateParams } from "../../jdResource";
|
|
2
|
+
export declare class JDPermission extends JDResource {
|
|
3
|
+
name: string;
|
|
4
|
+
guardName: string;
|
|
5
|
+
descriptionPlain: string;
|
|
6
|
+
userPermissionGroupId: string;
|
|
7
|
+
userPermissionGroup: Record<string, any>;
|
|
8
|
+
roleIds: any[];
|
|
9
|
+
constructor(data?: Record<string, any>, connectorInfo?: ConnectorInfo);
|
|
10
|
+
setData(data: Record<string, any>): void;
|
|
11
|
+
getContents(params?: Partial<typeof defaultSortParams>): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
12
|
+
paginateContents(params?: PaginateParams & {
|
|
13
|
+
name?: string | null;
|
|
14
|
+
guard_name?: string | null;
|
|
15
|
+
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
16
|
+
findContents(params?: PaginateParams & {
|
|
17
|
+
name?: string;
|
|
18
|
+
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
19
|
+
getInfo(id: string): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
20
|
+
updateFields(id: string, body?: Partial<typeof defaultUpdateFields>): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=jdPermission.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jdPermission.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/dashboard/user/jdPermission.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,EAAE,EAAC,aAAa,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,cAAc,EAAe,MAAM,kBAAkB,CAAC;AAEjI,qBAAa,YAAa,SAAQ,UAAU;IAC3C,IAAI,EAAC,MAAM,CAAM;IACjB,SAAS,EAAC,MAAM,CAAM;IACtB,gBAAgB,EAAC,MAAM,CAAM;IAC7B,qBAAqB,EAAC,MAAM,CAAM;IAClC,mBAAmB,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;IAC7C,OAAO,EAAE,GAAG,EAAE,CAAM;gBAER,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EAAE,aAAa,GAAE,aAAyC;IAKpG,OAAO,CAAC,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAU1B,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,UAAU,CAAC,EAAE,MAAM,GAAC,IAAI,CAAC;KAAO;IAQhG,YAAY,CAAC,MAAM,GAAE,cAAc,GAAG;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;KAAM;IAO5D,OAAO,CAAC,EAAE,EAAC,MAAM;IAIjB,YAAY,CAAC,EAAE,EAAC,MAAM,EAAE,IAAI,GAAE,OAAO,CAAC,OAAO,mBAAmB,CAAM;CAG5E"}
|
|
@@ -0,0 +1,68 @@
|
|
|
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 JDPermission extends JDResource {
|
|
13
|
+
constructor(data = {}, connectorInfo = new ConnectorInfo("", "")) {
|
|
14
|
+
super(connectorInfo);
|
|
15
|
+
this.name = "";
|
|
16
|
+
this.guardName = "";
|
|
17
|
+
this.descriptionPlain = "";
|
|
18
|
+
this.userPermissionGroupId = "";
|
|
19
|
+
this.userPermissionGroup = {};
|
|
20
|
+
this.roleIds = [];
|
|
21
|
+
this.setData(data);
|
|
22
|
+
}
|
|
23
|
+
setData(data) {
|
|
24
|
+
super.setData(data);
|
|
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");
|
|
31
|
+
}
|
|
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
|
+
});
|
|
37
|
+
}
|
|
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
|
+
});
|
|
47
|
+
}
|
|
48
|
+
// Find the permission with text search index which is a fast way to search the whole word
|
|
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
|
+
return yield this.getRelative('/modules/user/permissions/find', queryParams);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
// Get the user information
|
|
58
|
+
getInfo(id) {
|
|
59
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
return yield this.getRelative(`/modules/user/permissions/${id}`, {});
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
updateFields(id_1) {
|
|
64
|
+
return __awaiter(this, arguments, void 0, function* (id, body = {}) {
|
|
65
|
+
return yield this.postRelative(`/modules/user/permissions/${id}/update`, body);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import JDResource, { ConnectorInfo, defaultSortParams, defaultUpdateFields, PaginateParams } from "../../jdResource";
|
|
2
|
+
export declare class JDPermissionGroup extends JDResource {
|
|
3
|
+
constructor(data?: Record<string, any>, connectorInfo?: ConnectorInfo);
|
|
4
|
+
setData(data: Record<string, any>): void;
|
|
5
|
+
getContents(params?: Partial<typeof defaultSortParams>): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
6
|
+
paginateContents(params?: PaginateParams & {
|
|
7
|
+
name?: string | null;
|
|
8
|
+
guard_name?: string | null;
|
|
9
|
+
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
10
|
+
findContents(params?: PaginateParams & {
|
|
11
|
+
name?: string | null;
|
|
12
|
+
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
13
|
+
getPermissions(permissionGroupId: string, params?: Partial<typeof defaultSortParams>): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
14
|
+
getInfo(id: string): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
15
|
+
updateFields(id: string, body?: Partial<typeof defaultUpdateFields>): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=jdPermissionGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jdPermissionGroup.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/dashboard/user/jdPermissionGroup.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,EAAE,EAAC,aAAa,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAEnH,qBAAa,iBAAkB,SAAQ,UAAU;gBACpC,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EAAE,aAAa,GAAE,aAAyC;IAKpG,OAAO,CAAC,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAI1B,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,UAAU,CAAC,EAAE,MAAM,GAAC,IAAI,CAAC;KAAM;IAO/F,YAAY,CAAC,MAAM,GAAE,cAAc,GAAG;QAAE,IAAI,CAAC,EAAE,MAAM,GAAC,IAAI,CAAC;KAAO;IAMlE,cAAc,CAAC,iBAAiB,EAAE,MAAM,EAAE,MAAM,GAAE,OAAO,CAAC,OAAO,iBAAiB,CAAM;IAMxF,OAAO,CAAC,EAAE,EAAC,MAAM;IAIjB,YAAY,CAAC,EAAE,EAAC,MAAM,EAAE,IAAI,GAAE,OAAO,CAAC,OAAO,mBAAmB,CAAM;CAG5E"}
|
|
@@ -0,0 +1,60 @@
|
|
|
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
|
+
export class JDPermissionGroup extends JDResource {
|
|
12
|
+
constructor(data = {}, connectorInfo = new ConnectorInfo("", "")) {
|
|
13
|
+
super(connectorInfo);
|
|
14
|
+
this.setData(data);
|
|
15
|
+
}
|
|
16
|
+
setData(data) {
|
|
17
|
+
super.setData(data);
|
|
18
|
+
}
|
|
19
|
+
getContents() {
|
|
20
|
+
return __awaiter(this, arguments, void 0, function* (params = {}) {
|
|
21
|
+
const queryParams = this.getSortParameters(params);
|
|
22
|
+
return yield this.getRelative(`/modules/user/permission_groups`, queryParams);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
paginateContents() {
|
|
26
|
+
return __awaiter(this, arguments, void 0, function* (params = {}) {
|
|
27
|
+
const queryParams = this.getSortParameters(params);
|
|
28
|
+
if (params.name)
|
|
29
|
+
queryParams['name'] = params.name;
|
|
30
|
+
if (params.guard_name)
|
|
31
|
+
queryParams['guard_name'] = params.guard_name;
|
|
32
|
+
return yield this.getRelative('/modules/user/permission_groups/paginate', queryParams);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
findContents() {
|
|
36
|
+
return __awaiter(this, arguments, void 0, function* (params = {}) {
|
|
37
|
+
const queryParams = this.getSortParameters(params);
|
|
38
|
+
if (params.name)
|
|
39
|
+
queryParams['name'] = params.name;
|
|
40
|
+
return yield this.getRelative('/modules/user/permission_groups/find', queryParams);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
getPermissions(permissionGroupId_1) {
|
|
44
|
+
return __awaiter(this, arguments, void 0, function* (permissionGroupId, params = {}) {
|
|
45
|
+
const queryParams = this.getSortParameters(params);
|
|
46
|
+
return yield this.getRelative(`/modules/user/permission_groups/${permissionGroupId}/permissions`, queryParams);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
// Get the user information
|
|
50
|
+
getInfo(id) {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
return yield this.getRelative(`/modules/user/permission_groups/${id}`, {});
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
updateFields(id_1) {
|
|
56
|
+
return __awaiter(this, arguments, void 0, function* (id, body = {}) {
|
|
57
|
+
return yield this.postRelative(`/modules/user/permission_groups/${id}/update`, body);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import JDResource, { ConnectorInfo, defaultSortParams, defaultUpdateFields, PaginateParams } from "../../jdResource";
|
|
2
|
+
export declare class JDSessionAccessToken extends JDResource {
|
|
3
|
+
cloudUserId: string;
|
|
4
|
+
sessionUserId: string;
|
|
5
|
+
token: string;
|
|
6
|
+
cloudUser: Record<string, any>;
|
|
7
|
+
sessionUser: Record<string, any>;
|
|
8
|
+
expiryDate: Date;
|
|
9
|
+
constructor(data?: Record<string, any>, connectorInfo?: ConnectorInfo);
|
|
10
|
+
setData(data: Record<string, any>): void;
|
|
11
|
+
getContents(params?: Partial<typeof defaultSortParams>): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
12
|
+
paginateContents(params?: PaginateParams & {
|
|
13
|
+
name?: string | null;
|
|
14
|
+
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
15
|
+
findContents(title: string, params?: Partial<typeof defaultSortParams>): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
16
|
+
getInfo(id: string): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
17
|
+
updateFields(id: string, body?: Partial<typeof defaultUpdateFields>): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=jdSessionAccessToken.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jdSessionAccessToken.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/dashboard/user/jdSessionAccessToken.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,EAAE,EAAC,aAAa,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAEnH,qBAAa,oBAAqB,SAAQ,UAAU;IACnD,WAAW,SAAM;IACjB,aAAa,SAAM;IACnB,KAAK,SAAM;IACX,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;IACpC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;IACtC,UAAU,EAAC,IAAI,CAAc;gBAEjB,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EAAE,aAAa,GAAE,aAAyC;IAKpG,OAAO,CAAC,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAU1B,WAAW,CAAC,MAAM,GAAE,OAAO,CAAC,OAAO,iBAAiB,CAAM;IAK1D,gBAAgB,CAAC,MAAM,GAAE,cAAc,GAAG;QAAE,IAAI,CAAC,EAAE,MAAM,GAAC,IAAI,CAAC;KAAQ;IAMvE,YAAY,CAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAE,OAAO,CAAC,OAAO,iBAAiB,CAAM;IAM3E,OAAO,CAAC,EAAE,EAAC,MAAM;IAIjB,YAAY,CAAC,EAAE,EAAC,MAAM,EAAE,IAAI,GAAE,OAAO,CAAC,OAAO,mBAAmB,CAAM;CAG5E"}
|
|
@@ -0,0 +1,63 @@
|
|
|
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 JDSessionAccessToken extends JDResource {
|
|
13
|
+
constructor(data = {}, connectorInfo = new ConnectorInfo("", "")) {
|
|
14
|
+
super(connectorInfo);
|
|
15
|
+
this.cloudUserId = '';
|
|
16
|
+
this.sessionUserId = '';
|
|
17
|
+
this.token = '';
|
|
18
|
+
this.cloudUser = {};
|
|
19
|
+
this.sessionUser = {};
|
|
20
|
+
this.expiryDate = new Date();
|
|
21
|
+
this.setData(data);
|
|
22
|
+
}
|
|
23
|
+
setData(data) {
|
|
24
|
+
super.setData(data);
|
|
25
|
+
this.cloudUserId = Utils.getString(data, 'cloud_user_id');
|
|
26
|
+
this.sessionUserId = Utils.getString(data, 'session_user_id');
|
|
27
|
+
this.token = Utils.getString(data, 'token');
|
|
28
|
+
this.cloudUser = Utils.getObject(data, 'cloud_user');
|
|
29
|
+
this.sessionUser = Utils.getObject(data, 'session_user');
|
|
30
|
+
this.expiryDate = Utils.getDate(data, 'expiry_date');
|
|
31
|
+
}
|
|
32
|
+
getContents() {
|
|
33
|
+
return __awaiter(this, arguments, void 0, function* (params = {}) {
|
|
34
|
+
const queryParams = this.getSortParameters(params);
|
|
35
|
+
return yield this.getRelative('/modules/user/session_access_tokens', queryParams);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
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
|
+
return yield this.getRelative('/modules/user/session_access_tokens/paginate', queryParams);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
findContents(title_1) {
|
|
47
|
+
return __awaiter(this, arguments, void 0, function* (title, params = {}) {
|
|
48
|
+
const queryParams = this.getSortParameters(params);
|
|
49
|
+
queryParams['title'] = title;
|
|
50
|
+
return yield this.getRelative('/modules/user/session_access_tokens/find', queryParams);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
getInfo(id) {
|
|
54
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
return yield this.getRelative(`/modules/user/session_access_tokens/${id}`, {});
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
updateFields(id_1) {
|
|
59
|
+
return __awaiter(this, arguments, void 0, function* (id, body = {}) {
|
|
60
|
+
return yield this.postRelative(`/modules/user/session_access_tokens/${id}/update`, body);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import JDResource, { ConnectorInfo, defaultSortParams, PaginateParams, UpdateFields } from "../../jdResource";
|
|
2
|
+
export declare class JDSessionUser extends JDResource {
|
|
3
|
+
cloudSessionId: string;
|
|
4
|
+
name: string;
|
|
5
|
+
username: string;
|
|
6
|
+
phone: string;
|
|
7
|
+
searchTokens: any[];
|
|
8
|
+
get isLoggedIn(): boolean;
|
|
9
|
+
constructor(data?: Record<string, any>, connectorInfo?: ConnectorInfo);
|
|
10
|
+
setData(data: Record<string, any>): void;
|
|
11
|
+
paginateContents(params?: PaginateParams & {
|
|
12
|
+
name?: string | null;
|
|
13
|
+
username?: string | null;
|
|
14
|
+
email?: string | null;
|
|
15
|
+
phone?: string | null;
|
|
16
|
+
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
17
|
+
getContents(params?: Partial<typeof defaultSortParams>): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
18
|
+
findContents(name: string, params?: Partial<typeof defaultSortParams>): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
19
|
+
authenticate(username: string, password: string): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
20
|
+
register(name: string, username: string, email: string, phone: string, password: string): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
21
|
+
logout(name: string, username: string, email: string, phone: string, password: string): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
22
|
+
getInfo(id: string): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
23
|
+
updateFields(id: string, body?: UpdateFields & {
|
|
24
|
+
name?: string | null;
|
|
25
|
+
username?: string | null;
|
|
26
|
+
email?: string | null;
|
|
27
|
+
phone?: string | null;
|
|
28
|
+
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=jdSessionUser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jdSessionUser.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/dashboard/user/jdSessionUser.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,EAAE,EAAC,aAAa,EAAyB,iBAAiB,EAAuB,cAAc,EAAE,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAExJ,qBAAa,aAAc,SAAQ,UAAU;IAC5C,cAAc,EAAC,MAAM,CAAM;IAC3B,IAAI,EAAC,MAAM,CAAM;IACjB,QAAQ,EAAC,MAAM,CAAM;IACrB,KAAK,EAAC,MAAM,CAAM;IAClB,YAAY,EAAE,GAAG,EAAE,CAAM;IAEzB,IAAI,UAAU,IAAG,OAAO,CAA+C;gBAE3D,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EAAE,aAAa,GAAE,aAAyC;IAKpG,OAAO,CAAC,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAS1B,gBAAgB,CAAC,MAAM,GAAE,cAAc,GAAG;QAAE,IAAI,CAAC,EAAE,MAAM,GAAC,IAAI,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,GAAC,IAAI,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,GAAC,IAAI,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,GAAC,IAAI,CAAC;KAAO;IASxI,WAAW,CAAC,MAAM,GAAE,OAAO,CAAC,OAAO,iBAAiB,CAAM;IAK1D,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,OAAO,CAAC,OAAO,iBAAiB,CAAM;IAOzE,YAAY,CAAC,QAAQ,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAM;IAK7C,QAAQ,CAAC,IAAI,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAM,EAAE,KAAK,EAAC,MAAM,EAAE,KAAK,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAM;IAKlF,MAAM,CAAC,IAAI,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAM,EAAE,KAAK,EAAC,MAAM,EAAE,KAAK,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAM;IAMhF,OAAO,CAAC,EAAE,EAAC,MAAM;IAIjB,YAAY,CAAC,EAAE,EAAC,MAAM,EAAE,IAAI,GAAE,YAAY,GAAI;QAAE,IAAI,CAAC,EAAE,MAAM,GAAC,IAAI,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,GAAC,IAAI,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,GAAC,IAAI,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,GAAC,IAAI,CAAC;KAAM;CAGjJ"}
|
|
@@ -0,0 +1,88 @@
|
|
|
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 JDSessionUser extends JDResource {
|
|
13
|
+
get isLoggedIn() { return Utils.isset(globalThis.xAuthToken); }
|
|
14
|
+
constructor(data = {}, connectorInfo = new ConnectorInfo("", "")) {
|
|
15
|
+
super(connectorInfo);
|
|
16
|
+
this.cloudSessionId = "";
|
|
17
|
+
this.name = "";
|
|
18
|
+
this.username = "";
|
|
19
|
+
this.phone = "";
|
|
20
|
+
this.searchTokens = [];
|
|
21
|
+
this.setData(data);
|
|
22
|
+
}
|
|
23
|
+
setData(data) {
|
|
24
|
+
super.setData(data);
|
|
25
|
+
this.cloudSessionId = Utils.getString(data, "cloud_session_id");
|
|
26
|
+
this.name = Utils.getString(data, "name");
|
|
27
|
+
this.username = Utils.getString(data, "username");
|
|
28
|
+
this.phone = Utils.getString(data, "phone");
|
|
29
|
+
this.searchTokens = Utils.getArray(data, "search_tokens");
|
|
30
|
+
}
|
|
31
|
+
paginateContents() {
|
|
32
|
+
return __awaiter(this, arguments, void 0, function* (params = {}) {
|
|
33
|
+
const queryParams = this.getSortParameters(params);
|
|
34
|
+
if (params.name)
|
|
35
|
+
queryParams['name'] = params.name;
|
|
36
|
+
if (params.username)
|
|
37
|
+
queryParams['username'] = params.username;
|
|
38
|
+
if (params.email)
|
|
39
|
+
queryParams['email'] = params.email;
|
|
40
|
+
if (params.phone)
|
|
41
|
+
queryParams['phone'] = params.phone;
|
|
42
|
+
return yield this.getRelative('/modules/user/session_users/paginate', params);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
getContents() {
|
|
46
|
+
return __awaiter(this, arguments, void 0, function* (params = {}) {
|
|
47
|
+
const queryParams = this.getSortParameters(params);
|
|
48
|
+
return yield this.getRelative('/modules/user/session_users', queryParams);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
findContents(name_1) {
|
|
52
|
+
return __awaiter(this, arguments, void 0, function* (name, params = {}) {
|
|
53
|
+
const queryParams = this.getSortParameters(params);
|
|
54
|
+
queryParams['name'] = name;
|
|
55
|
+
return yield this.getRelative('/modules/user/session_users/find', queryParams);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
// TODO: Sign the API calls to only be able to call from this client only
|
|
59
|
+
authenticate(username, password) {
|
|
60
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
const body = { username, password };
|
|
62
|
+
return yield this.postRelative('/modules/user/session_users/authenticate', body);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
register(name, username, email, phone, password) {
|
|
66
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
const body = { name, username, email, phone, password };
|
|
68
|
+
return yield this.postRelative('/modules/user/session_users/register', body);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
logout(name, username, email, phone, password) {
|
|
72
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
73
|
+
const body = { name, username, email, phone, password };
|
|
74
|
+
return yield this.postRelative('/modules/user/session_users/register', body);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
// Get the user information
|
|
78
|
+
getInfo(id) {
|
|
79
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
+
return yield this.getRelative(`/modules/user/session_users/${id}`, {});
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
updateFields(id_1) {
|
|
84
|
+
return __awaiter(this, arguments, void 0, function* (id, body = {}) {
|
|
85
|
+
return yield this.postRelative(`/modules/user/session_users/${id}/update`, body);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|