jd_platform_sdk 0.0.8 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +44 -28
- package/dist/sdk/configs/jdConfig.js +5 -1
- package/dist/sdk/jdConnector.js +63 -72
- package/dist/sdk/jdSdk.js +5 -1
- package/dist/sdk/models/jdApplication.d.ts +10 -4
- package/dist/sdk/models/jdApplication.d.ts.map +1 -1
- package/dist/sdk/models/jdApplication.js +76 -50
- package/dist/sdk/models/jdResource.d.ts +44 -1
- package/dist/sdk/models/jdResource.d.ts.map +1 -1
- package/dist/sdk/models/jdResource.js +131 -103
- package/dist/sdk/models/modules/dashboard/jdDashboardCombinations.js +31 -15
- package/dist/sdk/models/modules/geolocation/jdCity.d.ts +8 -4
- package/dist/sdk/models/modules/geolocation/jdCity.d.ts.map +1 -1
- package/dist/sdk/models/modules/geolocation/jdCity.js +61 -41
- package/dist/sdk/models/modules/geolocation/jdCountry.d.ts +7 -18
- package/dist/sdk/models/modules/geolocation/jdCountry.d.ts.map +1 -1
- package/dist/sdk/models/modules/geolocation/jdCountry.js +53 -49
- package/dist/sdk/models/modules/geolocation/jdDistrict.d.ts +7 -3
- package/dist/sdk/models/modules/geolocation/jdDistrict.d.ts.map +1 -1
- package/dist/sdk/models/modules/geolocation/jdDistrict.js +57 -35
- package/dist/sdk/models/modules/geolocation/jdState.d.ts +8 -4
- package/dist/sdk/models/modules/geolocation/jdState.d.ts.map +1 -1
- package/dist/sdk/models/modules/geolocation/jdState.js +61 -41
- package/dist/sdk/models/modules/karaoke/jdKtvShop.d.ts +10 -16
- package/dist/sdk/models/modules/karaoke/jdKtvShop.d.ts.map +1 -1
- package/dist/sdk/models/modules/karaoke/jdKtvShop.js +89 -78
- package/dist/sdk/models/modules/music/jdAlbum.d.ts +8 -50
- package/dist/sdk/models/modules/music/jdAlbum.d.ts.map +1 -1
- package/dist/sdk/models/modules/music/jdAlbum.js +102 -117
- package/dist/sdk/models/modules/music/jdArtist.d.ts +9 -47
- package/dist/sdk/models/modules/music/jdArtist.d.ts.map +1 -1
- package/dist/sdk/models/modules/music/jdArtist.js +90 -99
- package/dist/sdk/models/modules/music/jdComposer.d.ts +9 -49
- package/dist/sdk/models/modules/music/jdComposer.d.ts.map +1 -1
- package/dist/sdk/models/modules/music/jdComposer.js +87 -99
- package/dist/sdk/models/modules/music/jdMusicCombinations.js +31 -15
- package/dist/sdk/models/modules/music/jdSong.d.ts +11 -51
- package/dist/sdk/models/modules/music/jdSong.d.ts.map +1 -1
- package/dist/sdk/models/modules/music/jdSong.js +113 -131
- package/dist/sdk/models/modules/radio_station/jdRadioStation.d.ts +10 -16
- package/dist/sdk/models/modules/radio_station/jdRadioStation.d.ts.map +1 -1
- package/dist/sdk/models/modules/radio_station/jdRadioStation.js +89 -78
- package/dist/sdk/models/modules/user/jdPermission.d.ts +7 -33
- package/dist/sdk/models/modules/user/jdPermission.d.ts.map +1 -1
- package/dist/sdk/models/modules/user/jdPermission.js +63 -74
- package/dist/sdk/models/modules/user/jdPermissionGroup.d.ts +11 -39
- package/dist/sdk/models/modules/user/jdPermissionGroup.d.ts.map +1 -1
- package/dist/sdk/models/modules/user/jdPermissionGroup.js +57 -51
- package/dist/sdk/models/modules/user/jdSessionUser.d.ts +15 -2
- package/dist/sdk/models/modules/user/jdSessionUser.d.ts.map +1 -1
- package/dist/sdk/models/modules/user/jdSessionUser.js +78 -50
- package/dist/sdk/models/modules/user/jdUser.d.ts +7 -17
- package/dist/sdk/models/modules/user/jdUser.d.ts.map +1 -1
- package/dist/sdk/models/modules/user/jdUser.js +76 -73
- package/dist/sdk/models/modules/user/jdUserRole.d.ts +7 -43
- package/dist/sdk/models/modules/user/jdUserRole.d.ts.map +1 -1
- package/dist/sdk/models/modules/user/jdUserRole.js +55 -57
- package/dist/sdk/utilities/browserUtils.js +24 -31
- package/dist/sdk/utilities/cryptoUtils.js +13 -6
- package/dist/sdk/utilities/dateUtils.js +5 -1
- package/dist/sdk/utilities/globalEventHandler.js +5 -4
- package/dist/sdk/utilities/stringUtils.js +6 -2
- package/dist/sdk/utilities/utils.js +22 -19
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import JDResource, { ConnectorInfo } from "../../jdResource";
|
|
1
|
+
import JDResource, { ConnectorInfo, defaultSortParams, defaultUpdateFields, PaginateParams } from "../../jdResource";
|
|
2
2
|
export declare class JDPermission extends JDResource {
|
|
3
3
|
name: string;
|
|
4
4
|
guardName: string;
|
|
@@ -8,42 +8,16 @@ export declare class JDPermission extends JDResource {
|
|
|
8
8
|
roleIds: any[];
|
|
9
9
|
constructor(data?: Record<string, any>, connectorInfo?: ConnectorInfo);
|
|
10
10
|
setData(data: Record<string, any>): void;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
getPermissions({ name, guardName, published, orderBy, order, pageIndex, countPerPage, fields }: {
|
|
14
|
-
name?: string | undefined;
|
|
15
|
-
guardName?: string | undefined;
|
|
16
|
-
published?: string | undefined;
|
|
17
|
-
orderBy?: string | undefined;
|
|
18
|
-
order?: string | undefined;
|
|
19
|
-
pageIndex?: number | undefined;
|
|
20
|
-
countPerPage?: number | undefined;
|
|
21
|
-
fields?: string | undefined;
|
|
22
|
-
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
23
|
-
paginatePermissions({ name, guard_name, published, orderBy, order, pageIndex, countPerPage, fields }: {
|
|
11
|
+
getContents(params?: Partial<typeof defaultSortParams>): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
12
|
+
paginateContents(params?: PaginateParams & {
|
|
24
13
|
name?: string | null;
|
|
25
14
|
guard_name?: string | null;
|
|
26
|
-
published?: boolean | null;
|
|
27
|
-
orderBy?: string | null;
|
|
28
|
-
order?: string | null;
|
|
29
|
-
pageIndex?: number | null;
|
|
30
|
-
countPerPage?: number | null;
|
|
31
|
-
fields?: string | null;
|
|
32
15
|
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
33
|
-
|
|
34
|
-
name?: string
|
|
35
|
-
published?: string
|
|
36
|
-
orderBy?: string | undefined;
|
|
37
|
-
order?: string | undefined;
|
|
38
|
-
pageIndex?: number | undefined;
|
|
39
|
-
countPerPage?: number | undefined;
|
|
40
|
-
fields?: string | undefined;
|
|
16
|
+
findContents(params?: PaginateParams & {
|
|
17
|
+
name?: string;
|
|
18
|
+
published?: string;
|
|
41
19
|
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
42
20
|
getInfo(id: string): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
43
|
-
|
|
44
|
-
updateSingleFields(id: string, { published, note }: {
|
|
45
|
-
published?: boolean | null;
|
|
46
|
-
note?: string | null;
|
|
47
|
-
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
21
|
+
updateSingleFields(id: string, body?: Partial<typeof defaultUpdateFields>): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
48
22
|
}
|
|
49
23
|
//# sourceMappingURL=jdPermission.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jdPermission.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/modules/user/jdPermission.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,EAAE,EAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"jdPermission.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/modules/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;IAW1B,WAAW,CAAC,MAAM,GAAE,OAAO,CAAC,OAAO,iBAAiB,CAAM;IAK1D,gBAAgB,CAAC,MAAM,GAAE,cAAc,GAAG;QAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAAO;IAQpG,YAAY,CAAC,MAAM,GAAE,cAAc,GAAG;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;KAAO;IAQjF,OAAO,CAAC,EAAE,EAAC,MAAM;IAIjB,kBAAkB,CAAC,EAAE,EAAC,MAAM,EAAE,IAAI,GAAE,OAAO,CAAC,OAAO,mBAAmB,CAAM;CAGlF"}
|
|
@@ -1,89 +1,78 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
9
24
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.JDPermission = void 0;
|
|
27
|
+
const jdResource_1 = __importStar(require("../../jdResource"));
|
|
28
|
+
const utils_1 = require("../../../utilities/utils");
|
|
29
|
+
class JDPermission extends jdResource_1.default {
|
|
30
|
+
name = "";
|
|
31
|
+
guardName = "";
|
|
32
|
+
descriptionPlain = "";
|
|
33
|
+
userPermissionGroupId = "";
|
|
34
|
+
userPermissionGroup = {};
|
|
35
|
+
roleIds = [];
|
|
36
|
+
constructor(data = {}, connectorInfo = new jdResource_1.ConnectorInfo("", "")) {
|
|
14
37
|
super(connectorInfo);
|
|
15
|
-
this.name = "";
|
|
16
|
-
this.guardName = "";
|
|
17
|
-
this.descriptionPlain = "";
|
|
18
|
-
this.userPermissionGroupId = "";
|
|
19
|
-
this.userPermissionGroup = {};
|
|
20
|
-
this.roleIds = [];
|
|
21
38
|
this.setData(data);
|
|
22
39
|
}
|
|
23
40
|
setData(data) {
|
|
24
41
|
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
|
-
getPermissionsCount() {
|
|
33
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
-
return yield this.getRelative('/modules/user/permissions/count', {});
|
|
35
|
-
});
|
|
42
|
+
this.name = utils_1.Utils.getString(data, "name");
|
|
43
|
+
this.guardName = utils_1.Utils.getString(data, "guard_name");
|
|
44
|
+
this.descriptionPlain = utils_1.Utils.getString(data, "description");
|
|
45
|
+
this.userPermissionGroupId = utils_1.Utils.getString(data, "user_permission_group_id");
|
|
46
|
+
this.userPermissionGroup = utils_1.Utils.getObject(data, "user_permission_group");
|
|
47
|
+
this.roleIds = utils_1.Utils.getArray(data, "role_ids");
|
|
36
48
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
});
|
|
49
|
+
async getContents(params = {}) {
|
|
50
|
+
const queryParams = this.getSortParameters(params);
|
|
51
|
+
return await this.getRelative(`/modules/user/permissions`, queryParams);
|
|
41
52
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
return yield this.getRelative('/modules/user/permissions', params);
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
paginatePermissions(_a) {
|
|
53
|
-
return __awaiter(this, arguments, void 0, function* ({ name = "", guard_name = "", published = null, 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'] = name;
|
|
57
|
-
params['guard_name'] = guard_name;
|
|
58
|
-
params['published'] = published === null ? '' : published ? 'true' : 'false';
|
|
59
|
-
return yield this.getRelative('/modules/user/permissions/paginate', params);
|
|
60
|
-
});
|
|
53
|
+
async paginateContents(params = {}) {
|
|
54
|
+
const queryParams = this.getSortParameters(params);
|
|
55
|
+
if (params.name)
|
|
56
|
+
queryParams['name'] = params.name;
|
|
57
|
+
if (params.guard_name)
|
|
58
|
+
queryParams['guard_name'] = params.guard_name;
|
|
59
|
+
return await this.getRelative('/modules/user/permissions/paginate', queryParams);
|
|
61
60
|
}
|
|
62
61
|
// Find the permission with text search index which is a fast way to search the whole word
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
async findContents(params = {}) {
|
|
63
|
+
const queryParams = this.getSortParameters(params);
|
|
64
|
+
if (params.name)
|
|
65
|
+
queryParams['name'] = params.name;
|
|
66
|
+
if (params.published)
|
|
67
|
+
queryParams['published'] = params.published;
|
|
68
|
+
return await this.getRelative('/modules/user/permissions/find', queryParams);
|
|
70
69
|
}
|
|
71
70
|
// Get the user information
|
|
72
|
-
getInfo(id) {
|
|
73
|
-
return
|
|
74
|
-
return yield this.getRelative(`/modules/user/permissions/${id}`, {});
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
publish(id, published) {
|
|
78
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
-
const body = { published: published ? 'true' : 'false' };
|
|
80
|
-
return yield this.postRelative(`/modules/user/permissions/${id}/publish`, body);
|
|
81
|
-
});
|
|
71
|
+
async getInfo(id) {
|
|
72
|
+
return await this.getRelative(`/modules/user/permissions/${id}`, {});
|
|
82
73
|
}
|
|
83
|
-
updateSingleFields(
|
|
84
|
-
return
|
|
85
|
-
const body = { published, note };
|
|
86
|
-
return yield this.postRelative(`/modules/user/permissions/${id}/update/single_fields`, body);
|
|
87
|
-
});
|
|
74
|
+
async updateSingleFields(id, body = {}) {
|
|
75
|
+
return await this.postRelative(`/modules/user/permissions/${id}/update/single_fields`, body);
|
|
88
76
|
}
|
|
89
77
|
}
|
|
78
|
+
exports.JDPermission = JDPermission;
|
|
@@ -1,47 +1,19 @@
|
|
|
1
|
-
import JDResource, { ConnectorInfo } from "../../jdResource";
|
|
1
|
+
import JDResource, { ConnectorInfo, defaultSortParams, defaultUpdateFields, PaginateParams } from "../../jdResource";
|
|
2
2
|
export declare class JDPermissionGroup extends JDResource {
|
|
3
3
|
constructor(data?: Record<string, any>, connectorInfo?: ConnectorInfo);
|
|
4
4
|
setData(data: Record<string, any>): void;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
order?: string | undefined;
|
|
11
|
-
pageIndex?: number | undefined;
|
|
12
|
-
countPerPage?: number | undefined;
|
|
13
|
-
fields?: string | undefined;
|
|
5
|
+
getContents(params?: Partial<typeof defaultSortParams>): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
6
|
+
paginateContents(params?: PaginateParams & {
|
|
7
|
+
name?: string;
|
|
8
|
+
guardName?: string;
|
|
9
|
+
published?: string;
|
|
14
10
|
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
15
|
-
|
|
16
|
-
name?: string
|
|
17
|
-
|
|
18
|
-
published?: boolean | null;
|
|
19
|
-
orderBy?: string | null;
|
|
20
|
-
order?: string | null;
|
|
21
|
-
pageIndex?: number | null;
|
|
22
|
-
countPerPage?: number | null;
|
|
23
|
-
fields?: string | null;
|
|
24
|
-
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
25
|
-
getPermissions(permissionGroupId: string, { orderBy, order, pageIndex, countPerPage, fields }: {
|
|
26
|
-
orderBy?: string | undefined;
|
|
27
|
-
order?: string | undefined;
|
|
28
|
-
pageIndex?: number | undefined;
|
|
29
|
-
countPerPage?: number | undefined;
|
|
30
|
-
fields?: string | undefined;
|
|
31
|
-
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
32
|
-
findPermissions({ name, published, orderBy, order, pageIndex, countPerPage, fields }: {
|
|
33
|
-
name?: string | undefined;
|
|
34
|
-
published?: string | undefined;
|
|
35
|
-
orderBy?: string | undefined;
|
|
36
|
-
order?: string | undefined;
|
|
37
|
-
pageIndex?: number | undefined;
|
|
38
|
-
countPerPage?: number | undefined;
|
|
39
|
-
fields?: string | undefined;
|
|
11
|
+
findContents(params?: PaginateParams & {
|
|
12
|
+
name?: string;
|
|
13
|
+
published?: string;
|
|
40
14
|
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
15
|
+
getPermissions(permissionGroupId: string, params?: Partial<typeof defaultSortParams>): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
41
16
|
getInfo(id: string): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
42
|
-
updateSingleFields(id: string,
|
|
43
|
-
published?: boolean | null;
|
|
44
|
-
note?: string | null;
|
|
45
|
-
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
17
|
+
updateSingleFields(id: string, body?: Partial<typeof defaultUpdateFields>): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
46
18
|
}
|
|
47
19
|
//# sourceMappingURL=jdPermissionGroup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jdPermissionGroup.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/modules/user/jdPermissionGroup.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,EAAE,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"jdPermissionGroup.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/modules/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,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;KAAO;IAWzG,YAAY,CAAC,MAAM,GAAE,cAAc,GAAG;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;KAAO;IAUjF,cAAc,CAAC,iBAAiB,EAAE,MAAM,EAAE,MAAM,GAAE,OAAO,CAAC,OAAO,iBAAiB,CAAM;IAMxF,OAAO,CAAC,EAAE,EAAC,MAAM;IAIjB,kBAAkB,CAAC,EAAE,EAAC,MAAM,EAAE,IAAI,GAAE,OAAO,CAAC,OAAO,mBAAmB,CAAM;CAGlF"}
|
|
@@ -1,66 +1,72 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
9
24
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.JDPermissionGroup = void 0;
|
|
27
|
+
const jdResource_1 = __importStar(require("../../jdResource"));
|
|
28
|
+
class JDPermissionGroup extends jdResource_1.default {
|
|
29
|
+
constructor(data = {}, connectorInfo = new jdResource_1.ConnectorInfo("", "")) {
|
|
13
30
|
super(connectorInfo);
|
|
14
31
|
this.setData(data);
|
|
15
32
|
}
|
|
16
33
|
setData(data) {
|
|
17
34
|
super.setData(data);
|
|
18
35
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return
|
|
22
|
-
const params = this.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
|
|
23
|
-
params['name'] = name;
|
|
24
|
-
params['guard_name'] = guardName;
|
|
25
|
-
params['published'] = published;
|
|
26
|
-
return yield this.getRelative('/modules/user/permission_groups', params);
|
|
27
|
-
});
|
|
36
|
+
async getContents(params = {}) {
|
|
37
|
+
const queryParams = this.getSortParameters(params);
|
|
38
|
+
return await this.getRelative(`/modules/user/permission_groups`, queryParams);
|
|
28
39
|
}
|
|
29
|
-
paginateContents(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
async paginateContents(params = {}) {
|
|
41
|
+
const queryParams = this.getSortParameters(params);
|
|
42
|
+
// Add custom filters
|
|
43
|
+
if (params.name)
|
|
44
|
+
queryParams['name'] = params.name;
|
|
45
|
+
if (params.guardName)
|
|
46
|
+
queryParams['guard_name'] = params.guardName;
|
|
47
|
+
if (params.published)
|
|
48
|
+
queryParams['published'] = params.published;
|
|
49
|
+
return await this.getRelative('/modules/user/permission_groups/paginate', queryParams);
|
|
38
50
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
51
|
+
async findContents(params = {}) {
|
|
52
|
+
const queryParams = this.getSortParameters(params);
|
|
53
|
+
// Add custom filters
|
|
54
|
+
if (params.name)
|
|
55
|
+
queryParams['name'] = params.name;
|
|
56
|
+
if (params.published)
|
|
57
|
+
queryParams['published'] = params.published;
|
|
58
|
+
return await this.getRelative('/modules/user/permission_groups/find', queryParams);
|
|
44
59
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return
|
|
48
|
-
const params = this.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
|
|
49
|
-
params['name'] = name;
|
|
50
|
-
params['published'] = published;
|
|
51
|
-
return yield this.getRelative('/modules/user/permission_groups/find', params);
|
|
52
|
-
});
|
|
60
|
+
async getPermissions(permissionGroupId, params = {}) {
|
|
61
|
+
const queryParams = this.getSortParameters(params);
|
|
62
|
+
return await this.getRelative(`/modules/user/permission_groups/${permissionGroupId}/permissions`, queryParams);
|
|
53
63
|
}
|
|
54
64
|
// Get the user information
|
|
55
|
-
getInfo(id) {
|
|
56
|
-
return
|
|
57
|
-
return yield this.getRelative(`/modules/user/permission_groups/${id}`, {});
|
|
58
|
-
});
|
|
65
|
+
async getInfo(id) {
|
|
66
|
+
return await this.getRelative(`/modules/user/permission_groups/${id}`, {});
|
|
59
67
|
}
|
|
60
|
-
updateSingleFields(
|
|
61
|
-
return
|
|
62
|
-
const body = { published, note };
|
|
63
|
-
return yield this.postRelative(`/modules/user/permission_groups/${id}/update/single_fields`, body);
|
|
64
|
-
});
|
|
68
|
+
async updateSingleFields(id, body = {}) {
|
|
69
|
+
return await this.postRelative(`/modules/user/permission_groups/${id}/update/single_fields`, body);
|
|
65
70
|
}
|
|
66
71
|
}
|
|
72
|
+
exports.JDPermissionGroup = JDPermissionGroup;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import JDResource, { ConnectorInfo } from "../../jdResource";
|
|
1
|
+
import JDResource, { ConnectorInfo, defaultSortParams, PaginateParams, UpdateFields } from "../../jdResource";
|
|
2
2
|
export declare class JDSessionUser extends JDResource {
|
|
3
3
|
cloudSessionId: string;
|
|
4
4
|
name: string;
|
|
@@ -8,10 +8,23 @@ export declare class JDSessionUser extends JDResource {
|
|
|
8
8
|
get isLoggedIn(): boolean;
|
|
9
9
|
constructor(data?: Record<string, any>, connectorInfo?: ConnectorInfo);
|
|
10
10
|
setData(data: Record<string, any>): void;
|
|
11
|
-
|
|
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>;
|
|
12
19
|
authenticate(username: string, password: string): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
13
20
|
register(name: string, username: string, email: string, phone: string, password: string): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
14
21
|
logout(name: string, username: string, email: string, phone: string, password: string): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
15
22
|
getInfo(id: string): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
23
|
+
updateSingleFields(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>;
|
|
16
29
|
}
|
|
17
30
|
//# sourceMappingURL=jdSessionUser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jdSessionUser.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/modules/user/jdSessionUser.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,EAAE,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"jdSessionUser.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/modules/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,GAAG,IAAI,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAAQ;IASjJ,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,kBAAkB,CAAC,EAAE,EAAC,MAAM,EAAE,IAAI,GAAE,YAAY,GAAI;QAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAAO;CAGhK"}
|
|
@@ -1,62 +1,90 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
9
24
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.JDSessionUser = void 0;
|
|
27
|
+
const jdResource_1 = __importStar(require("../../jdResource"));
|
|
28
|
+
const utils_1 = require("../../../utilities/utils");
|
|
29
|
+
class JDSessionUser extends jdResource_1.default {
|
|
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("", "")) {
|
|
15
37
|
super(connectorInfo);
|
|
16
|
-
this.cloudSessionId = "";
|
|
17
|
-
this.name = "";
|
|
18
|
-
this.username = "";
|
|
19
|
-
this.phone = "";
|
|
20
|
-
this.searchTokens = [];
|
|
21
38
|
this.setData(data);
|
|
22
39
|
}
|
|
23
40
|
setData(data) {
|
|
24
41
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
42
|
+
this.cloudSessionId = utils_1.Utils.getString(data, "cloud_session_id");
|
|
43
|
+
this.name = utils_1.Utils.getString(data, "name");
|
|
44
|
+
this.username = utils_1.Utils.getString(data, "username");
|
|
45
|
+
this.phone = utils_1.Utils.getString(data, "phone");
|
|
46
|
+
this.searchTokens = utils_1.Utils.getArray(data, "search_tokens");
|
|
47
|
+
}
|
|
48
|
+
async paginateContents(params = {}) {
|
|
49
|
+
const queryParams = this.getSortParameters(params);
|
|
50
|
+
if (params.name)
|
|
51
|
+
queryParams['name'] = params.name;
|
|
52
|
+
if (params.username)
|
|
53
|
+
queryParams['username'] = params.username;
|
|
54
|
+
if (params.email)
|
|
55
|
+
queryParams['username'] = params.email;
|
|
56
|
+
if (params.phone)
|
|
57
|
+
queryParams['username'] = params.phone;
|
|
58
|
+
return await this.getRelative('/modules/user/session_users/paginate', params);
|
|
59
|
+
}
|
|
60
|
+
async getContents(params = {}) {
|
|
61
|
+
const queryParams = this.getSortParameters(params);
|
|
62
|
+
return await this.getRelative('/modules/user/session_users', queryParams);
|
|
63
|
+
}
|
|
64
|
+
async findContents(name, params = {}) {
|
|
65
|
+
const queryParams = this.getSortParameters(params);
|
|
66
|
+
queryParams['name'] = name;
|
|
67
|
+
return await this.getRelative('/modules/user/session_users/find', queryParams);
|
|
36
68
|
}
|
|
37
69
|
// TODO: Sign the API calls to only be able to call from this client only
|
|
38
|
-
authenticate(username, password) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
logout(name, username, email, phone, password) {
|
|
51
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
-
const body = { name, username, email, phone, password };
|
|
53
|
-
return yield this.postRelative('/modules/user/session_users/register', body);
|
|
54
|
-
});
|
|
70
|
+
async authenticate(username, password) {
|
|
71
|
+
const body = { username, password };
|
|
72
|
+
return await this.postRelative('/modules/user/session_users/authenticate', body);
|
|
73
|
+
}
|
|
74
|
+
async register(name, username, email, phone, password) {
|
|
75
|
+
const body = { name, username, email, phone, password };
|
|
76
|
+
return await this.postRelative('/modules/user/session_users/register', body);
|
|
77
|
+
}
|
|
78
|
+
async logout(name, username, email, phone, password) {
|
|
79
|
+
const body = { name, username, email, phone, password };
|
|
80
|
+
return await this.postRelative('/modules/user/session_users/register', body);
|
|
55
81
|
}
|
|
56
82
|
// Get the user information
|
|
57
|
-
getInfo(id) {
|
|
58
|
-
return
|
|
59
|
-
|
|
60
|
-
|
|
83
|
+
async getInfo(id) {
|
|
84
|
+
return await this.getRelative(`/modules/user/session_users/${id}`, {});
|
|
85
|
+
}
|
|
86
|
+
async updateSingleFields(id, body = {}) {
|
|
87
|
+
return await this.postRelative(`/modules/user/session_users/${id}/update/single_fields`, body);
|
|
61
88
|
}
|
|
62
89
|
}
|
|
90
|
+
exports.JDSessionUser = JDSessionUser;
|