jd_platform_sdk 0.0.8 → 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/sdk/models/jdApplication.d.ts +10 -4
- package/dist/sdk/models/jdApplication.d.ts.map +1 -1
- package/dist/sdk/models/jdApplication.js +30 -12
- 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 +60 -19
- 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 +26 -12
- 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 +20 -22
- 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 +22 -8
- 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 +26 -12
- 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 +25 -20
- 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 +30 -51
- 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 +32 -43
- 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 +32 -48
- 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 +31 -57
- 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 +25 -20
- 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 +22 -41
- 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 +30 -30
- 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 +30 -4
- 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 +28 -27
- 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 +26 -32
- package/package.json +1 -1
|
@@ -29,43 +29,31 @@ export class JDPermission extends JDResource {
|
|
|
29
29
|
this.userPermissionGroup = Utils.getObject(data, "user_permission_group");
|
|
30
30
|
this.roleIds = Utils.getArray(data, "role_ids");
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
return __awaiter(this,
|
|
34
|
-
|
|
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);
|
|
35
36
|
});
|
|
36
37
|
}
|
|
37
|
-
|
|
38
|
-
return __awaiter(this,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const params = this.getSortParameters(orderBy, order, pageIndex, countPerPage, fields);
|
|
46
|
-
params['name'] = name;
|
|
47
|
-
params['guard_name'] = guardName;
|
|
48
|
-
params['published'] = published;
|
|
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);
|
|
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);
|
|
60
46
|
});
|
|
61
47
|
}
|
|
62
48
|
// Find the permission with text search index which is a fast way to search the whole word
|
|
63
|
-
|
|
64
|
-
return __awaiter(this, arguments, void 0, function* (
|
|
65
|
-
const
|
|
66
|
-
params
|
|
67
|
-
|
|
68
|
-
|
|
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
|
+
if (params.published)
|
|
55
|
+
queryParams['published'] = params.published;
|
|
56
|
+
return yield this.getRelative('/modules/user/permissions/find', queryParams);
|
|
69
57
|
});
|
|
70
58
|
}
|
|
71
59
|
// Get the user information
|
|
@@ -74,15 +62,8 @@ export class JDPermission extends JDResource {
|
|
|
74
62
|
return yield this.getRelative(`/modules/user/permissions/${id}`, {});
|
|
75
63
|
});
|
|
76
64
|
}
|
|
77
|
-
|
|
78
|
-
return __awaiter(this,
|
|
79
|
-
const body = { published: published ? 'true' : 'false' };
|
|
80
|
-
return yield this.postRelative(`/modules/user/permissions/${id}/publish`, body);
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
updateSingleFields(id_1, _a) {
|
|
84
|
-
return __awaiter(this, arguments, void 0, function* (id, { published = null, note = null }) {
|
|
85
|
-
const body = { published, note };
|
|
65
|
+
updateSingleFields(id_1) {
|
|
66
|
+
return __awaiter(this, arguments, void 0, function* (id, body = {}) {
|
|
86
67
|
return yield this.postRelative(`/modules/user/permissions/${id}/update/single_fields`, body);
|
|
87
68
|
});
|
|
88
69
|
}
|
|
@@ -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"}
|
|
@@ -16,39 +16,40 @@ export class JDPermissionGroup extends JDResource {
|
|
|
16
16
|
setData(data) {
|
|
17
17
|
super.setData(data);
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
params['name'] = name;
|
|
24
|
-
params['guard_name'] = guardName;
|
|
25
|
-
params['published'] = published;
|
|
26
|
-
return yield this.getRelative('/modules/user/permission_groups', params);
|
|
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);
|
|
27
23
|
});
|
|
28
24
|
}
|
|
29
|
-
paginateContents(
|
|
30
|
-
return __awaiter(this, arguments, void 0, function* (
|
|
31
|
-
const
|
|
32
|
-
//
|
|
33
|
-
params
|
|
34
|
-
|
|
35
|
-
params
|
|
36
|
-
|
|
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);
|
|
37
36
|
});
|
|
38
37
|
}
|
|
39
|
-
|
|
40
|
-
return __awaiter(this, arguments, void 0, function* (
|
|
41
|
-
const
|
|
42
|
-
|
|
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);
|
|
43
47
|
});
|
|
44
48
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
params['name'] = name;
|
|
50
|
-
params['published'] = published;
|
|
51
|
-
return yield this.getRelative('/modules/user/permission_groups/find', params);
|
|
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);
|
|
52
53
|
});
|
|
53
54
|
}
|
|
54
55
|
// Get the user information
|
|
@@ -57,9 +58,8 @@ export class JDPermissionGroup extends JDResource {
|
|
|
57
58
|
return yield this.getRelative(`/modules/user/permission_groups/${id}`, {});
|
|
58
59
|
});
|
|
59
60
|
}
|
|
60
|
-
updateSingleFields(id_1
|
|
61
|
-
return __awaiter(this, arguments, void 0, function* (id,
|
|
62
|
-
const body = { published, note };
|
|
61
|
+
updateSingleFields(id_1) {
|
|
62
|
+
return __awaiter(this, arguments, void 0, function* (id, body = {}) {
|
|
63
63
|
return yield this.postRelative(`/modules/user/permission_groups/${id}/update/single_fields`, body);
|
|
64
64
|
});
|
|
65
65
|
}
|
|
@@ -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"}
|
|
@@ -28,10 +28,31 @@ export class JDSessionUser extends JDResource {
|
|
|
28
28
|
this.phone = Utils.getString(data, "phone");
|
|
29
29
|
this.searchTokens = Utils.getArray(data, "search_tokens");
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
return __awaiter(this, arguments, void 0, function* (
|
|
33
|
-
const
|
|
34
|
-
|
|
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
|
+
});
|
|
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);
|
|
35
56
|
});
|
|
36
57
|
}
|
|
37
58
|
// TODO: Sign the API calls to only be able to call from this client only
|
|
@@ -59,4 +80,9 @@ export class JDSessionUser extends JDResource {
|
|
|
59
80
|
return yield this.getRelative(`/modules/user/session_users/${id}`, {});
|
|
60
81
|
});
|
|
61
82
|
}
|
|
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
|
+
});
|
|
87
|
+
}
|
|
62
88
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import JDResource, { ConnectorInfo } from "../../jdResource";
|
|
1
|
+
import JDResource, { ConnectorInfo, defaultSortParams, PaginateParams, UpdateFields } from "../../jdResource";
|
|
2
2
|
export declare class JDUser extends JDResource {
|
|
3
3
|
name: string;
|
|
4
4
|
username: string;
|
|
@@ -8,33 +8,23 @@ export declare class JDUser 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
|
-
|
|
12
|
-
paginateContents(
|
|
11
|
+
getContents(params?: Partial<typeof defaultSortParams>): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
12
|
+
paginateContents(params?: PaginateParams & {
|
|
13
13
|
name?: string | null;
|
|
14
14
|
username?: string | null;
|
|
15
15
|
email?: string | null;
|
|
16
16
|
phone?: string | null;
|
|
17
|
-
published?: boolean | null;
|
|
18
|
-
orderBy?: string | null;
|
|
19
|
-
order?: string | null;
|
|
20
|
-
pageIndex?: number | null;
|
|
21
|
-
countPerPage?: number | null;
|
|
22
|
-
fields?: string | null;
|
|
23
17
|
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
24
|
-
|
|
18
|
+
findContents(name: string, params?: Partial<typeof defaultSortParams>): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
19
|
+
getInfo(id: string): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
25
20
|
authenticate(username: string, password: string): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
26
21
|
register(name: string, username: string, email: string, phone: string, password: string): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
27
22
|
logout(): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
28
|
-
|
|
29
|
-
updateSingleFields(id: string, { name, username, phone, email, published, note }: {
|
|
23
|
+
updateSingleFields(id: string, body?: UpdateFields & {
|
|
30
24
|
name?: string | null;
|
|
31
25
|
username?: string | null;
|
|
32
|
-
phone?: string | null;
|
|
33
26
|
email?: string | null;
|
|
34
|
-
|
|
35
|
-
recommended?: boolean | null;
|
|
36
|
-
downloadable?: boolean | null;
|
|
37
|
-
note?: string | null;
|
|
27
|
+
phone?: string | null;
|
|
38
28
|
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
39
29
|
}
|
|
40
30
|
//# sourceMappingURL=jdUser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jdUser.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/modules/user/jdUser.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,EAAE,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"jdUser.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/modules/user/jdUser.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,EAAE,EAAC,aAAa,EAAyB,iBAAiB,EAAuB,cAAc,EAAE,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAWxJ,qBAAa,MAAO,SAAQ,UAAU;IACrC,IAAI,EAAC,MAAM,CAAM;IACjB,QAAQ,EAAC,MAAM,CAAM;IACrB,KAAK,EAAC,MAAM,CAAM;IAClB,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,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,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,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,OAAO,CAAC,OAAO,iBAAiB,CAAM;IAMzE,OAAO,CAAC,EAAE,EAAC,MAAM;IAKjB,YAAY,CAAC,QAAQ,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAM;IAO7C,QAAQ,CAAC,IAAI,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAM,EAAE,KAAK,EAAC,MAAM,EAAE,KAAK,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAM;IAOlF,MAAM;IAIN,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"}
|
|
@@ -28,28 +28,36 @@ export class JDUser extends JDResource {
|
|
|
28
28
|
this.email = Utils.getString(data, "email");
|
|
29
29
|
this.searchTokens = Utils.getArray(data, "search_tokens");
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
return __awaiter(this, arguments, void 0, function* (
|
|
33
|
-
const
|
|
34
|
-
return yield this.getRelative('/modules/user/users',
|
|
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
35
|
});
|
|
36
36
|
}
|
|
37
|
-
paginateContents(
|
|
38
|
-
return __awaiter(this, arguments, void 0, function* (
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
params
|
|
43
|
-
|
|
44
|
-
params
|
|
45
|
-
|
|
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;
|
|
46
48
|
return yield this.getRelative('/modules/user/users/paginate', params);
|
|
47
49
|
});
|
|
48
50
|
}
|
|
49
|
-
|
|
50
|
-
return __awaiter(this, arguments, void 0, function* (name,
|
|
51
|
-
const
|
|
52
|
-
|
|
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
|
+
});
|
|
57
|
+
}
|
|
58
|
+
getInfo(id) {
|
|
59
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
return yield this.getRelative(`/modules/user/users/${id}`, {});
|
|
53
61
|
});
|
|
54
62
|
}
|
|
55
63
|
// TODO: Sign the API calls to only be able to call from this client only
|
|
@@ -74,16 +82,9 @@ export class JDUser extends JDResource {
|
|
|
74
82
|
return yield this.postRelative('/modules/user/users/logout', {});
|
|
75
83
|
});
|
|
76
84
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
return yield this.getRelative(`/modules/user/users/${id}`, {});
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
updateSingleFields(id_1, _a) {
|
|
84
|
-
return __awaiter(this, arguments, void 0, function* (id, { name = "", username = "", phone = "", email = "", published = null, note = "" }) {
|
|
85
|
-
const body = { name, username, phone, email, published, note };
|
|
86
|
-
return yield this.postRelative(`/modules/user/users/me/update/single_fields`, body);
|
|
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);
|
|
87
88
|
});
|
|
88
89
|
}
|
|
89
90
|
}
|
|
@@ -1,52 +1,16 @@
|
|
|
1
|
-
import JDResource, { ConnectorInfo } from "../../jdResource";
|
|
1
|
+
import JDResource, { ConnectorInfo, defaultSortParams, defaultUpdateFields, PaginateParams } from "../../jdResource";
|
|
2
2
|
export declare class JDUserRole extends JDResource {
|
|
3
3
|
permissionIds: any[];
|
|
4
4
|
constructor(data?: Record<string, any>, connectorInfo?: ConnectorInfo);
|
|
5
5
|
setData(data: Record<string, any>): void;
|
|
6
|
-
getContents(
|
|
7
|
-
|
|
8
|
-
order?: string | undefined;
|
|
9
|
-
pageIndex?: number | undefined;
|
|
10
|
-
countPerPage?: number | undefined;
|
|
11
|
-
fields?: string | undefined;
|
|
12
|
-
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
13
|
-
paginateContents({ name, guard_name, published, orderBy, order, pageIndex, countPerPage, fields }: {
|
|
6
|
+
getContents(params?: Partial<typeof defaultSortParams>): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
7
|
+
paginateContents(params?: PaginateParams & {
|
|
14
8
|
name?: string | null;
|
|
15
|
-
guard_name?: string | null;
|
|
16
|
-
published?: boolean | null;
|
|
17
|
-
orderBy?: string | null;
|
|
18
|
-
order?: string | null;
|
|
19
|
-
pageIndex?: number | null;
|
|
20
|
-
countPerPage?: number | null;
|
|
21
|
-
fields?: string | null;
|
|
22
|
-
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
23
|
-
getUsers(userRoleId: string, { orderBy, order, pageIndex, countPerPage, fields }: {
|
|
24
|
-
orderBy?: string | undefined;
|
|
25
|
-
order?: string | undefined;
|
|
26
|
-
pageIndex?: number | undefined;
|
|
27
|
-
countPerPage?: number | undefined;
|
|
28
|
-
fields?: string | undefined;
|
|
29
|
-
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
30
|
-
getPermissions(userRoleId: string, { orderBy, order, pageIndex, countPerPage, fields }: {
|
|
31
|
-
orderBy?: string | undefined;
|
|
32
|
-
order?: string | undefined;
|
|
33
|
-
pageIndex?: number | undefined;
|
|
34
|
-
countPerPage?: number | undefined;
|
|
35
|
-
fields?: string | undefined;
|
|
36
|
-
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
37
|
-
findPermissions({ name, published, orderBy, order, pageIndex, countPerPage, fields }: {
|
|
38
|
-
name?: string | undefined;
|
|
39
|
-
published?: string | undefined;
|
|
40
|
-
orderBy?: string | undefined;
|
|
41
|
-
order?: string | undefined;
|
|
42
|
-
pageIndex?: number | undefined;
|
|
43
|
-
countPerPage?: number | undefined;
|
|
44
|
-
fields?: string | undefined;
|
|
45
9
|
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
10
|
+
findContents(title: string, params?: Partial<typeof defaultSortParams>): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
11
|
+
getUsers(userRoleId: string, params?: Partial<typeof defaultSortParams>): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
12
|
+
getPermissions(userRoleId: string, params?: Partial<typeof defaultSortParams>): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
46
13
|
getInfo(id: string): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
47
|
-
updateSingleFields(id: string,
|
|
48
|
-
published?: boolean | null;
|
|
49
|
-
note?: string | null;
|
|
50
|
-
}): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
14
|
+
updateSingleFields(id: string, body?: Partial<typeof defaultUpdateFields>): Promise<import("../../../jdConnector").SimpleResponse>;
|
|
51
15
|
}
|
|
52
16
|
//# sourceMappingURL=jdUserRole.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jdUserRole.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/modules/user/jdUserRole.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,EAAE,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"jdUserRole.d.ts","sourceRoot":"","sources":["../../../../../src/sdk/models/modules/user/jdUserRole.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,EAAE,EAAC,aAAa,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAEnH,qBAAa,UAAW,SAAQ,UAAU;IACzC,aAAa,EAAC,GAAG,EAAE,CAAM;gBAEb,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EAAE,aAAa,GAAE,aAAyC;IAKpG,OAAO,CAAC,IAAI,EAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAK1B,WAAW,CAAC,MAAM,GAAE,OAAO,CAAC,OAAO,iBAAiB,CAAM;IAK1D,gBAAgB,CAAC,MAAM,GAAE,cAAc,GAAG;QAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAAQ;IAMzE,YAAY,CAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAE,OAAO,CAAC,OAAO,iBAAiB,CAAM;IAO3E,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,GAAE,OAAO,CAAC,OAAO,iBAAiB,CAAM;IAK3E,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,GAAE,OAAO,CAAC,OAAO,iBAAiB,CAAM;IAKjF,OAAO,CAAC,EAAE,EAAC,MAAM;IAIjB,kBAAkB,CAAC,EAAE,EAAC,MAAM,EAAE,IAAI,GAAE,OAAO,CAAC,OAAO,mBAAmB,CAAM;CAGlF"}
|
|
@@ -19,53 +19,47 @@ export class JDUserRole extends JDResource {
|
|
|
19
19
|
super.setData(data);
|
|
20
20
|
this.permissionIds = Utils.getArray(data, 'permission_ids');
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return yield this.getRelative('/modules/user/user_roles', params);
|
|
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);
|
|
27
26
|
});
|
|
28
27
|
}
|
|
29
|
-
paginateContents(
|
|
30
|
-
return __awaiter(this, arguments, void 0, function* (
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
params['published'] = published === null ? '' : published ? 'true' : 'false';
|
|
36
|
-
return yield this.getRelative('/modules/user/user_roles/paginate', params);
|
|
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);
|
|
37
34
|
});
|
|
38
35
|
}
|
|
39
|
-
|
|
40
|
-
return __awaiter(this, arguments, void 0, function* (
|
|
41
|
-
const
|
|
42
|
-
|
|
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);
|
|
43
41
|
});
|
|
44
42
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
// Return the user list with the provided row
|
|
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);
|
|
49
48
|
});
|
|
50
49
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
params['name'] = name;
|
|
56
|
-
params['published'] = published;
|
|
57
|
-
return yield this.getRelative('/modules/user/user_roles/find', params);
|
|
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);
|
|
58
54
|
});
|
|
59
55
|
}
|
|
60
|
-
// Get the user information
|
|
61
56
|
getInfo(id) {
|
|
62
57
|
return __awaiter(this, void 0, void 0, function* () {
|
|
63
58
|
return yield this.getRelative(`/modules/user/user_roles/${id}`, {});
|
|
64
59
|
});
|
|
65
60
|
}
|
|
66
|
-
updateSingleFields(id_1
|
|
67
|
-
return __awaiter(this, arguments, void 0, function* (id,
|
|
68
|
-
const body = { published, note };
|
|
61
|
+
updateSingleFields(id_1) {
|
|
62
|
+
return __awaiter(this, arguments, void 0, function* (id, body = {}) {
|
|
69
63
|
return yield this.postRelative(`/modules/user/user_roles/${id}/update/single_fields`, body);
|
|
70
64
|
});
|
|
71
65
|
}
|