jd_platform_sdk 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +28 -44
- package/dist/sdk/configs/jdConfig.js +1 -5
- package/dist/sdk/jdConnector.js +72 -63
- package/dist/sdk/jdSdk.js +1 -5
- package/dist/sdk/models/jdApplication.js +63 -71
- package/dist/sdk/models/jdResource.js +104 -91
- package/dist/sdk/models/modules/dashboard/jdDashboardCombinations.js +15 -31
- package/dist/sdk/models/modules/geolocation/jdCity.js +49 -55
- package/dist/sdk/models/modules/geolocation/jdCountry.js +47 -53
- package/dist/sdk/models/modules/geolocation/jdDistrict.js +49 -57
- package/dist/sdk/models/modules/geolocation/jdState.js +49 -55
- package/dist/sdk/models/modules/karaoke/jdKtvShop.js +82 -88
- package/dist/sdk/models/modules/music/jdAlbum.js +96 -102
- package/dist/sdk/models/modules/music/jdArtist.js +87 -89
- package/dist/sdk/models/modules/music/jdComposer.js +83 -87
- package/dist/sdk/models/modules/music/jdMusicCombinations.js +15 -31
- package/dist/sdk/models/modules/music/jdSong.js +105 -113
- package/dist/sdk/models/modules/radio_station/jdRadioStation.js +82 -88
- package/dist/sdk/models/modules/user/jdPermission.js +55 -63
- package/dist/sdk/models/modules/user/jdPermissionGroup.js +51 -57
- package/dist/sdk/models/modules/user/jdSessionUser.js +70 -72
- package/dist/sdk/models/modules/user/jdUser.js +73 -75
- package/dist/sdk/models/modules/user/jdUserRole.js +50 -54
- package/dist/sdk/utilities/browserUtils.js +31 -24
- package/dist/sdk/utilities/cryptoUtils.js +6 -13
- package/dist/sdk/utilities/dateUtils.js +1 -5
- package/dist/sdk/utilities/globalEventHandler.js +4 -5
- package/dist/sdk/utilities/stringUtils.js +2 -6
- package/dist/sdk/utilities/utils.js +19 -22
- package/package.json +1 -1
|
@@ -1,72 +1,66 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
24
9
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
class JDPermissionGroup extends jdResource_1.default {
|
|
29
|
-
constructor(data = {}, connectorInfo = new jdResource_1.ConnectorInfo("", "")) {
|
|
10
|
+
import JDResource, { ConnectorInfo } from "../../jdResource";
|
|
11
|
+
export class JDPermissionGroup extends JDResource {
|
|
12
|
+
constructor(data = {}, connectorInfo = new ConnectorInfo("", "")) {
|
|
30
13
|
super(connectorInfo);
|
|
31
14
|
this.setData(data);
|
|
32
15
|
}
|
|
33
16
|
setData(data) {
|
|
34
17
|
super.setData(data);
|
|
35
18
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
+
});
|
|
39
24
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
25
|
+
paginateContents() {
|
|
26
|
+
return __awaiter(this, arguments, void 0, function* (params = {}) {
|
|
27
|
+
const queryParams = this.getSortParameters(params);
|
|
28
|
+
// Add custom filters
|
|
29
|
+
if (params.name)
|
|
30
|
+
queryParams['name'] = params.name;
|
|
31
|
+
if (params.guardName)
|
|
32
|
+
queryParams['guard_name'] = params.guardName;
|
|
33
|
+
if (params.published)
|
|
34
|
+
queryParams['published'] = params.published;
|
|
35
|
+
return yield this.getRelative('/modules/user/permission_groups/paginate', queryParams);
|
|
36
|
+
});
|
|
50
37
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
38
|
+
findContents() {
|
|
39
|
+
return __awaiter(this, arguments, void 0, function* (params = {}) {
|
|
40
|
+
const queryParams = this.getSortParameters(params);
|
|
41
|
+
// Add custom filters
|
|
42
|
+
if (params.name)
|
|
43
|
+
queryParams['name'] = params.name;
|
|
44
|
+
if (params.published)
|
|
45
|
+
queryParams['published'] = params.published;
|
|
46
|
+
return yield this.getRelative('/modules/user/permission_groups/find', queryParams);
|
|
47
|
+
});
|
|
59
48
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
49
|
+
getPermissions(permissionGroupId_1) {
|
|
50
|
+
return __awaiter(this, arguments, void 0, function* (permissionGroupId, params = {}) {
|
|
51
|
+
const queryParams = this.getSortParameters(params);
|
|
52
|
+
return yield this.getRelative(`/modules/user/permission_groups/${permissionGroupId}/permissions`, queryParams);
|
|
53
|
+
});
|
|
63
54
|
}
|
|
64
55
|
// Get the user information
|
|
65
|
-
|
|
66
|
-
return
|
|
56
|
+
getInfo(id) {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
return yield this.getRelative(`/modules/user/permission_groups/${id}`, {});
|
|
59
|
+
});
|
|
67
60
|
}
|
|
68
|
-
|
|
69
|
-
return
|
|
61
|
+
updateSingleFields(id_1) {
|
|
62
|
+
return __awaiter(this, arguments, void 0, function* (id, body = {}) {
|
|
63
|
+
return yield this.postRelative(`/modules/user/permission_groups/${id}/update/single_fields`, body);
|
|
64
|
+
});
|
|
70
65
|
}
|
|
71
66
|
}
|
|
72
|
-
exports.JDPermissionGroup = JDPermissionGroup;
|
|
@@ -1,90 +1,88 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
24
9
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
cloudSessionId = "";
|
|
31
|
-
name = "";
|
|
32
|
-
username = "";
|
|
33
|
-
phone = "";
|
|
34
|
-
searchTokens = [];
|
|
35
|
-
get isLoggedIn() { return utils_1.Utils.isset(globalThis.xAuthToken); }
|
|
36
|
-
constructor(data = {}, connectorInfo = new jdResource_1.ConnectorInfo("", "")) {
|
|
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("", "")) {
|
|
37
15
|
super(connectorInfo);
|
|
16
|
+
this.cloudSessionId = "";
|
|
17
|
+
this.name = "";
|
|
18
|
+
this.username = "";
|
|
19
|
+
this.phone = "";
|
|
20
|
+
this.searchTokens = [];
|
|
38
21
|
this.setData(data);
|
|
39
22
|
}
|
|
40
23
|
setData(data) {
|
|
41
24
|
super.setData(data);
|
|
42
|
-
this.cloudSessionId =
|
|
43
|
-
this.name =
|
|
44
|
-
this.username =
|
|
45
|
-
this.phone =
|
|
46
|
-
this.searchTokens =
|
|
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");
|
|
47
30
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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['username'] = params.email;
|
|
40
|
+
if (params.phone)
|
|
41
|
+
queryParams['username'] = params.phone;
|
|
42
|
+
return yield this.getRelative('/modules/user/session_users/paginate', params);
|
|
43
|
+
});
|
|
59
44
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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
|
+
});
|
|
63
50
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|
+
});
|
|
68
57
|
}
|
|
69
58
|
// TODO: Sign the API calls to only be able to call from this client only
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
+
});
|
|
73
64
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
+
});
|
|
77
70
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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
|
+
});
|
|
81
76
|
}
|
|
82
77
|
// Get the user information
|
|
83
|
-
|
|
84
|
-
return
|
|
78
|
+
getInfo(id) {
|
|
79
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
+
return yield this.getRelative(`/modules/user/session_users/${id}`, {});
|
|
81
|
+
});
|
|
85
82
|
}
|
|
86
|
-
|
|
87
|
-
return
|
|
83
|
+
updateSingleFields(id_1) {
|
|
84
|
+
return __awaiter(this, arguments, void 0, function* (id, body = {}) {
|
|
85
|
+
return yield this.postRelative(`/modules/user/session_users/${id}/update/single_fields`, body);
|
|
86
|
+
});
|
|
88
87
|
}
|
|
89
88
|
}
|
|
90
|
-
exports.JDSessionUser = JDSessionUser;
|
|
@@ -1,92 +1,90 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
24
9
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
name = "";
|
|
31
|
-
username = "";
|
|
32
|
-
phone = "";
|
|
33
|
-
email = "";
|
|
34
|
-
searchTokens = [];
|
|
35
|
-
get isLoggedIn() { return utils_1.Utils.isset(globalThis.xAuthToken); }
|
|
36
|
-
constructor(data = {}, connectorInfo = new jdResource_1.ConnectorInfo("", "")) {
|
|
10
|
+
import JDResource, { ConnectorInfo } from "../../jdResource";
|
|
11
|
+
import { Utils } from "../../../utilities/utils";
|
|
12
|
+
export class JDUser extends JDResource {
|
|
13
|
+
get isLoggedIn() { return Utils.isset(globalThis.xAuthToken); }
|
|
14
|
+
constructor(data = {}, connectorInfo = new ConnectorInfo("", "")) {
|
|
37
15
|
super(connectorInfo);
|
|
16
|
+
this.name = "";
|
|
17
|
+
this.username = "";
|
|
18
|
+
this.phone = "";
|
|
19
|
+
this.email = "";
|
|
20
|
+
this.searchTokens = [];
|
|
38
21
|
this.setData(data);
|
|
39
22
|
}
|
|
40
23
|
setData(data) {
|
|
41
24
|
super.setData(data);
|
|
42
|
-
this.name =
|
|
43
|
-
this.username =
|
|
44
|
-
this.phone =
|
|
45
|
-
this.email =
|
|
46
|
-
this.searchTokens =
|
|
25
|
+
this.name = Utils.getString(data, "name");
|
|
26
|
+
this.username = Utils.getString(data, "username");
|
|
27
|
+
this.phone = Utils.getString(data, "phone");
|
|
28
|
+
this.email = Utils.getString(data, "email");
|
|
29
|
+
this.searchTokens = Utils.getArray(data, "search_tokens");
|
|
47
30
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
31
|
+
getContents() {
|
|
32
|
+
return __awaiter(this, arguments, void 0, function* (params = {}) {
|
|
33
|
+
const queryParams = this.getSortParameters(params);
|
|
34
|
+
return yield this.getRelative('/modules/user/users', queryParams);
|
|
35
|
+
});
|
|
51
36
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
37
|
+
paginateContents() {
|
|
38
|
+
return __awaiter(this, arguments, void 0, function* (params = {}) {
|
|
39
|
+
const queryParams = this.getSortParameters(params);
|
|
40
|
+
if (params.name)
|
|
41
|
+
queryParams['name'] = params.name;
|
|
42
|
+
if (params.username)
|
|
43
|
+
queryParams['username'] = params.username;
|
|
44
|
+
if (params.email)
|
|
45
|
+
queryParams['username'] = params.email;
|
|
46
|
+
if (params.phone)
|
|
47
|
+
queryParams['username'] = params.phone;
|
|
48
|
+
return yield this.getRelative('/modules/user/users/paginate', params);
|
|
49
|
+
});
|
|
63
50
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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/users/find', queryParams);
|
|
56
|
+
});
|
|
68
57
|
}
|
|
69
|
-
|
|
70
|
-
return
|
|
58
|
+
getInfo(id) {
|
|
59
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
return yield this.getRelative(`/modules/user/users/${id}`, {});
|
|
61
|
+
});
|
|
71
62
|
}
|
|
72
63
|
// TODO: Sign the API calls to only be able to call from this client only
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
64
|
+
authenticate(username, password) {
|
|
65
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
const body = { username, password };
|
|
67
|
+
const response = yield this.postRelative('/modules/user/users/authenticate', body);
|
|
68
|
+
yield this.checkUser(response);
|
|
69
|
+
return response;
|
|
70
|
+
});
|
|
78
71
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
72
|
+
register(name, username, email, phone, password) {
|
|
73
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
const body = { name, username, email, phone, password };
|
|
75
|
+
const response = yield this.postRelative('/modules/user/users/register', body);
|
|
76
|
+
yield this.checkUser(response);
|
|
77
|
+
return response;
|
|
78
|
+
});
|
|
84
79
|
}
|
|
85
|
-
|
|
86
|
-
return
|
|
80
|
+
logout() {
|
|
81
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
82
|
+
return yield this.postRelative('/modules/user/users/logout', {});
|
|
83
|
+
});
|
|
87
84
|
}
|
|
88
|
-
|
|
89
|
-
return
|
|
85
|
+
updateSingleFields(id_1) {
|
|
86
|
+
return __awaiter(this, arguments, void 0, function* (id, body = {}) {
|
|
87
|
+
return yield this.postRelative(`/modules/user/users/${id}/update/single_fields`, body);
|
|
88
|
+
});
|
|
90
89
|
}
|
|
91
90
|
}
|
|
92
|
-
exports.JDUser = JDUser;
|
|
@@ -1,70 +1,66 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
24
9
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
class JDUserRole extends jdResource_1.default {
|
|
30
|
-
permissionIds = [];
|
|
31
|
-
constructor(data = {}, connectorInfo = new jdResource_1.ConnectorInfo("", "")) {
|
|
10
|
+
import JDResource, { ConnectorInfo } from "../../jdResource";
|
|
11
|
+
import { Utils } from "../../../utilities/utils";
|
|
12
|
+
export class JDUserRole extends JDResource {
|
|
13
|
+
constructor(data = {}, connectorInfo = new ConnectorInfo("", "")) {
|
|
32
14
|
super(connectorInfo);
|
|
15
|
+
this.permissionIds = [];
|
|
33
16
|
this.setData(data);
|
|
34
17
|
}
|
|
35
18
|
setData(data) {
|
|
36
19
|
super.setData(data);
|
|
37
|
-
this.permissionIds =
|
|
20
|
+
this.permissionIds = Utils.getArray(data, 'permission_ids');
|
|
38
21
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
22
|
+
getContents() {
|
|
23
|
+
return __awaiter(this, arguments, void 0, function* (params = {}) {
|
|
24
|
+
const queryParams = this.getSortParameters(params);
|
|
25
|
+
return yield this.getRelative('/modules/user/user_roles', queryParams);
|
|
26
|
+
});
|
|
42
27
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
28
|
+
paginateContents() {
|
|
29
|
+
return __awaiter(this, arguments, void 0, function* (params = {}) {
|
|
30
|
+
const queryParams = this.getSortParameters(params);
|
|
31
|
+
if (params.name)
|
|
32
|
+
queryParams['name'] = params.name;
|
|
33
|
+
return yield this.getRelative('/modules/user/user_roles/paginate', queryParams);
|
|
34
|
+
});
|
|
48
35
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
36
|
+
findContents(title_1) {
|
|
37
|
+
return __awaiter(this, arguments, void 0, function* (title, params = {}) {
|
|
38
|
+
const queryParams = this.getSortParameters(params);
|
|
39
|
+
queryParams['title'] = title;
|
|
40
|
+
return yield this.getRelative('/modules/user/user_roles/find', queryParams);
|
|
41
|
+
});
|
|
53
42
|
}
|
|
54
43
|
// Return the user list with the provided row
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
44
|
+
getUsers(userRoleId_1) {
|
|
45
|
+
return __awaiter(this, arguments, void 0, function* (userRoleId, params = {}) {
|
|
46
|
+
const queryParams = this.getSortParameters(params);
|
|
47
|
+
return yield this.getRelative(`/modules/user/user_roles/${userRoleId}/users`, queryParams);
|
|
48
|
+
});
|
|
58
49
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
50
|
+
getPermissions(userRoleId_1) {
|
|
51
|
+
return __awaiter(this, arguments, void 0, function* (userRoleId, params = {}) {
|
|
52
|
+
const queryParams = this.getSortParameters(params);
|
|
53
|
+
return yield this.getRelative(`/modules/user/user_roles/${userRoleId}/permissions`, queryParams);
|
|
54
|
+
});
|
|
62
55
|
}
|
|
63
|
-
|
|
64
|
-
return
|
|
56
|
+
getInfo(id) {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
return yield this.getRelative(`/modules/user/user_roles/${id}`, {});
|
|
59
|
+
});
|
|
65
60
|
}
|
|
66
|
-
|
|
67
|
-
return
|
|
61
|
+
updateSingleFields(id_1) {
|
|
62
|
+
return __awaiter(this, arguments, void 0, function* (id, body = {}) {
|
|
63
|
+
return yield this.postRelative(`/modules/user/user_roles/${id}/update/single_fields`, body);
|
|
64
|
+
});
|
|
68
65
|
}
|
|
69
66
|
}
|
|
70
|
-
exports.JDUserRole = JDUserRole;
|