@neuralinnovations/dataisland-sdk 0.0.1-dev22 → 0.0.1-dev23
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/package.json +1 -1
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +5 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/storages/groups/group.d.ts +63 -0
- package/dist/src/storages/groups/group.d.ts.map +1 -0
- package/dist/src/storages/groups/group.impl.d.ts +37 -0
- package/dist/src/storages/groups/group.impl.d.ts.map +1 -0
- package/dist/src/storages/groups/group.impl.js +205 -0
- package/dist/src/storages/groups/group.impl.js.map +1 -0
- package/dist/src/storages/groups/group.js +15 -0
- package/dist/src/storages/groups/group.js.map +1 -0
- package/dist/src/storages/groups/groups.d.ts +3 -60
- package/dist/src/storages/groups/groups.d.ts.map +1 -1
- package/dist/src/storages/groups/groups.impl.d.ts +2 -35
- package/dist/src/storages/groups/groups.impl.d.ts.map +1 -1
- package/dist/src/storages/groups/groups.impl.js +14 -193
- package/dist/src/storages/groups/groups.impl.js.map +1 -1
- package/dist/src/storages/groups/groups.js +7 -13
- package/dist/src/storages/groups/groups.js.map +1 -1
- package/dist/src/storages/organizations/organization.d.ts +2 -1
- package/dist/src/storages/organizations/organization.d.ts.map +1 -1
- package/dist/src/storages/organizations/organization.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +3 -0
- package/src/storages/groups/group.impl.ts +267 -0
- package/src/storages/groups/group.ts +73 -0
- package/src/storages/groups/groups.impl.ts +17 -252
- package/src/storages/groups/groups.ts +3 -70
- package/src/storages/organizations/organization.ts +2 -1
package/dist/package.json
CHANGED
package/dist/src/index.d.ts
CHANGED
@@ -55,4 +55,7 @@ export declare function dataIslandInstances(): DataIslandApp[];
|
|
55
55
|
* ```
|
56
56
|
*/
|
57
57
|
export declare function dataIslandApp(name?: string, setup?: (builder: AppBuilder) => Promise<void>): Promise<DataIslandApp>;
|
58
|
+
export { Group } from "./storages/groups/group";
|
59
|
+
export { GroupEvent } from "./storages/groups/group";
|
60
|
+
export { GroupId } from "./storages/groups/group";
|
58
61
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAEpD,cAAc,UAAU,CAAA;AACxB,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA;AAC5B,cAAc,oBAAoB,CAAA;AAClC,cAAc,2BAA2B,CAAA;AACzC,cAAc,wBAAwB,CAAA;AACtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wCAAwC,CAAA;AACtD,cAAc,uCAAuC,CAAA;AACrD,cAAc,kCAAkC,CAAA;AAChD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,0BAA0B,CAAA;AACxC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AAOrC;;GAEG;AACH,eAAO,MAAM,WAAW,QAAU,CAAA;AAElC;;GAEG;AACH,eAAO,MAAM,YAAY,cAAc,CAAA;AAEvC;;GAEG;AACH,eAAO,MAAM,YAAY,kCAAkC,CAAA;AAE3D;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,aAAa,EAAE,CAErD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,aAAa,CACjC,IAAI,CAAC,EAAE,MAAM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,IAAI,CAAC,GAC7C,OAAO,CAAC,aAAa,CAAC,CAuBxB;AACD,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA"}
|
package/dist/src/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.dataIslandApp = exports.dataIslandInstances = exports.DEFAULT_HOST = exports.DEFAULT_NAME = exports.SDK_VERSION = void 0;
|
3
|
+
exports.GroupEvent = exports.Group = exports.dataIslandApp = exports.dataIslandInstances = exports.DEFAULT_HOST = exports.DEFAULT_NAME = exports.SDK_VERSION = void 0;
|
4
4
|
const tslib_1 = require("tslib");
|
5
5
|
const package_json_1 = require("../package.json");
|
6
6
|
const createApp_impl_1 = require("./internal/createApp.impl");
|
@@ -88,4 +88,8 @@ async function dataIslandApp(name, setup) {
|
|
88
88
|
return await appPromise;
|
89
89
|
}
|
90
90
|
exports.dataIslandApp = dataIslandApp;
|
91
|
+
var group_1 = require("./storages/groups/group");
|
92
|
+
Object.defineProperty(exports, "Group", { enumerable: true, get: function () { return group_1.Group; } });
|
93
|
+
var group_2 = require("./storages/groups/group");
|
94
|
+
Object.defineProperty(exports, "GroupEvent", { enumerable: true, get: function () { return group_2.GroupEvent; } });
|
91
95
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,kDAAyC;AACzC,8DAAsD;AAItD,mDAAwB;AACxB,uDAA4B;AAC5B,wDAA6B;AAC7B,0DAA+B;AAC/B,uDAA4B;AAC5B,oDAAyB;AACzB,uDAA4B;AAC5B,6DAAkC;AAClC,oEAAyC;AACzC,iEAAsC;AACtC,m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C,IAAI,GAAG,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,oBAAY,CAAA;IAE3B,IAAI,UAAU,GAAG,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;IACxC,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,UAAU,GAAG,IAAA,2BAAU,EAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QACpC,UAAU;aACP,IAAI,CAAC,GAAG,CAAC,EAAE;YACV,UAAU,CAAC,GAAG,CAAC,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,oBAAY,EAAE,GAAG,CAAC,CAAA;QAC3C,CAAC,CAAC;aACD,KAAK,CAAC,MAAM,CAAC,EAAE;YACd,OAAO,CAAC,KAAK,CAAC,UAAU,MAAM,EAAE,CAAC,CAAA;YACjC,aAAa,CAAC,MAAM,CAAC,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,oBAAY,CAAC,CAAA;QAC5C,CAAC,CAAC,CAAA;QACJ,aAAa,CAAC,GAAG,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;IACrC,CAAC;SAAM,CAAC;QACN,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CACb,cAAc,IAAI,mDAAmD,CACtE,CAAA;QACH,CAAC;IACH,CAAC;IACD,OAAO,MAAM,UAAU,CAAA;AACzB,CAAC;AA1BD,sCA0BC;AACD,iDAA+C;AAAtC,8FAAA,KAAK,OAAA;AACd,iDAAoD;AAA3C,mGAAA,UAAU,OAAA"}
|
@@ -0,0 +1,63 @@
|
|
1
|
+
import { EventDispatcher } from "../../events";
|
2
|
+
import { AccessGroupDto } from "../../dto/accessGroupResponse";
|
3
|
+
import { UserDto } from "../../dto/userInfoResponse";
|
4
|
+
import { Workspace } from "../workspaces/workspace";
|
5
|
+
import { WorkspaceId } from "../workspaces/workspaces";
|
6
|
+
import { UserId } from "../user/userProfile";
|
7
|
+
/**
|
8
|
+
* Group id.
|
9
|
+
*/
|
10
|
+
export type GroupId = string;
|
11
|
+
export declare enum GroupEvent {
|
12
|
+
UPDATED = "updated"
|
13
|
+
}
|
14
|
+
/**
|
15
|
+
* Group.
|
16
|
+
*/
|
17
|
+
export declare abstract class Group extends EventDispatcher<GroupEvent, Group> {
|
18
|
+
/**
|
19
|
+
* Group id.
|
20
|
+
*/
|
21
|
+
abstract get id(): GroupId;
|
22
|
+
/**
|
23
|
+
* Group information.
|
24
|
+
*/
|
25
|
+
abstract get group(): AccessGroupDto;
|
26
|
+
/**
|
27
|
+
* Group members.
|
28
|
+
*/
|
29
|
+
abstract get members(): UserDto[];
|
30
|
+
/**
|
31
|
+
* Group workspaces.
|
32
|
+
*/
|
33
|
+
abstract get workspaces(): readonly Workspace[];
|
34
|
+
/**
|
35
|
+
* Set workspaces.
|
36
|
+
*/
|
37
|
+
abstract setWorkspaces(workspaces: WorkspaceId[]): Promise<void>;
|
38
|
+
/**
|
39
|
+
* Set name.
|
40
|
+
*/
|
41
|
+
abstract setName(name: string): Promise<void>;
|
42
|
+
/**
|
43
|
+
* Set permits.
|
44
|
+
*/
|
45
|
+
abstract setPermits(permits: {
|
46
|
+
isAdmin: boolean;
|
47
|
+
}): Promise<void>;
|
48
|
+
/**
|
49
|
+
* Set members.
|
50
|
+
*/
|
51
|
+
abstract setMembersIds(members: UserId[]): Promise<void>;
|
52
|
+
/**
|
53
|
+
* Remove members.
|
54
|
+
* @param members
|
55
|
+
*/
|
56
|
+
abstract removeMembers(members: UserId[]): Promise<void>;
|
57
|
+
/**
|
58
|
+
* Remove workspaces.
|
59
|
+
* @param workspaces
|
60
|
+
*/
|
61
|
+
abstract removeWorkspaces(workspaces: WorkspaceId[]): Promise<void>;
|
62
|
+
}
|
63
|
+
//# sourceMappingURL=group.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../../../../src/storages/groups/group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eA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QAAQ,CAAC,gBAAgB,CAAC,UAAU,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CACpE"}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import { Group, GroupId } from "./group";
|
2
|
+
import { Disposable } from "../../disposable";
|
3
|
+
import { AccessGroupDto } from "../../dto/accessGroupResponse";
|
4
|
+
import { UserDto } from "../../dto/userInfoResponse";
|
5
|
+
import { Workspace } from "../workspaces/workspace";
|
6
|
+
import { Context } from "../../context";
|
7
|
+
import { Organization } from "../organizations/organization";
|
8
|
+
import { WorkspaceId } from "../workspaces/workspaces";
|
9
|
+
import { UserId } from "../user/userProfile";
|
10
|
+
export declare class GroupImpl extends Group implements Disposable {
|
11
|
+
private readonly context;
|
12
|
+
readonly organization: Organization;
|
13
|
+
private _isDisposed;
|
14
|
+
private _content?;
|
15
|
+
private _members?;
|
16
|
+
private _workspaces;
|
17
|
+
constructor(context: Context, organization: Organization);
|
18
|
+
initFrom(id: GroupId): Promise<Group>;
|
19
|
+
reloadGroup(id: GroupId): Promise<void>;
|
20
|
+
reloadWorkspaces(): Promise<void>;
|
21
|
+
loadWorkspaces(groupId: GroupId): Promise<Workspace[]>;
|
22
|
+
get id(): GroupId;
|
23
|
+
get group(): AccessGroupDto;
|
24
|
+
get workspaces(): readonly Workspace[];
|
25
|
+
get members(): UserDto[];
|
26
|
+
setName(name: string): Promise<void>;
|
27
|
+
setPermits(permits: {
|
28
|
+
isAdmin: boolean;
|
29
|
+
}): Promise<void>;
|
30
|
+
setWorkspaces(workspaces: string[]): Promise<void>;
|
31
|
+
removeWorkspaces(workspaces: WorkspaceId[]): Promise<void>;
|
32
|
+
setMembersIds(members: UserId[]): Promise<void>;
|
33
|
+
removeMembers(members: UserId[]): Promise<void>;
|
34
|
+
get isDisposed(): boolean;
|
35
|
+
dispose(): void;
|
36
|
+
}
|
37
|
+
//# sourceMappingURL=group.impl.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":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AAO,EAAE,CAKvB;IAEK,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAiCpC,UAAU,CAAC,OAAO,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAexD,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IA4BlD,gBAAgB,CAAC,UAAU,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAuB1D,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE;IA4B/B,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAwBrD,IAAI,UAAU,IAAI,OAAO,CAExB;IAED,OAAO,IAAI,IAAI;CAGhB"}
|
@@ -0,0 +1,205 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.GroupImpl = void 0;
|
4
|
+
const group_1 = require("./group");
|
5
|
+
const rpcService_1 = require("../../services/rpcService");
|
6
|
+
const responseUtils_1 = require("../../services/responseUtils");
|
7
|
+
class GroupImpl extends group_1.Group {
|
8
|
+
constructor(context, organization) {
|
9
|
+
super();
|
10
|
+
this.context = context;
|
11
|
+
this.organization = organization;
|
12
|
+
this._isDisposed = false;
|
13
|
+
this._workspaces = [];
|
14
|
+
}
|
15
|
+
async initFrom(id) {
|
16
|
+
await this.reloadGroup(id);
|
17
|
+
await this.reloadWorkspaces();
|
18
|
+
return this;
|
19
|
+
}
|
20
|
+
async reloadGroup(id) {
|
21
|
+
var _a;
|
22
|
+
// fetch group
|
23
|
+
const response = await ((_a = this.context.resolve(rpcService_1.RpcService)) === null || _a === void 0 ? void 0 : _a.requestBuilder("api/v1/AccessGroups").searchParam("groupId", id).sendGet());
|
24
|
+
// check response status
|
25
|
+
if (responseUtils_1.ResponseUtils.isFail(response)) {
|
26
|
+
await responseUtils_1.ResponseUtils.throwError(`Failed to get group: ${id}, organization: ${this.organization.id}`, response);
|
27
|
+
}
|
28
|
+
// parse group from the server's response
|
29
|
+
const group = (await response.json());
|
30
|
+
// init group
|
31
|
+
this._content = group.group;
|
32
|
+
this._members = group.members;
|
33
|
+
}
|
34
|
+
async reloadWorkspaces() {
|
35
|
+
const groupWorkspaces = await this.loadWorkspaces(this.id);
|
36
|
+
this._workspaces.length = 0;
|
37
|
+
this._workspaces.push(...groupWorkspaces);
|
38
|
+
}
|
39
|
+
async loadWorkspaces(groupId) {
|
40
|
+
var _a;
|
41
|
+
// fetch workspaces
|
42
|
+
const response = await ((_a = this.context.resolve(rpcService_1.RpcService)) === null || _a === void 0 ? void 0 : _a.requestBuilder("api/v1/AccessGroups/workspaces").searchParam("groupId", groupId).sendGet());
|
43
|
+
if (responseUtils_1.ResponseUtils.isFail(response)) {
|
44
|
+
await responseUtils_1.ResponseUtils.throwError(`Failed to get workspaces for group: ${this.id}, organization: ${this.organization.id}`, response);
|
45
|
+
}
|
46
|
+
// parse workspaces from the server's response
|
47
|
+
const workspaces = (await response.json());
|
48
|
+
// get workspaces
|
49
|
+
const result = [];
|
50
|
+
for (const workspaceDto of workspaces.workspaces) {
|
51
|
+
result.push(this.organization.workspaces.get(workspaceDto.id));
|
52
|
+
}
|
53
|
+
return result;
|
54
|
+
}
|
55
|
+
get id() {
|
56
|
+
if (this._content) {
|
57
|
+
return this._content.id;
|
58
|
+
}
|
59
|
+
throw new Error("Access group is not loaded.");
|
60
|
+
}
|
61
|
+
get group() {
|
62
|
+
if (this._content) {
|
63
|
+
return this._content;
|
64
|
+
}
|
65
|
+
throw new Error("Access group is not loaded.");
|
66
|
+
}
|
67
|
+
get workspaces() {
|
68
|
+
return this._workspaces;
|
69
|
+
}
|
70
|
+
get members() {
|
71
|
+
if (this._members) {
|
72
|
+
return this._members;
|
73
|
+
}
|
74
|
+
throw new Error("Access group is not loaded.");
|
75
|
+
}
|
76
|
+
async setName(name) {
|
77
|
+
var _a;
|
78
|
+
if (name === undefined || name === null) {
|
79
|
+
throw new Error("Groups change, name is undefined or null");
|
80
|
+
}
|
81
|
+
if (name.length === 0 || name.trim().length === 0) {
|
82
|
+
throw new Error("Groups change, name is empty");
|
83
|
+
}
|
84
|
+
// send request to the server
|
85
|
+
const response = await ((_a = this.context
|
86
|
+
.resolve(rpcService_1.RpcService)) === null || _a === void 0 ? void 0 : _a.requestBuilder("api/v1/AccessGroups/name").sendPutJson({
|
87
|
+
groupId: this.id,
|
88
|
+
name: name
|
89
|
+
}));
|
90
|
+
// check response status
|
91
|
+
if (responseUtils_1.ResponseUtils.isFail(response)) {
|
92
|
+
await responseUtils_1.ResponseUtils.throwError(`Failed to change group name, group: ${this.id}, organization: ${this.organization.id}`, response);
|
93
|
+
}
|
94
|
+
// change name
|
95
|
+
if (this._content) {
|
96
|
+
this._content.name = name;
|
97
|
+
}
|
98
|
+
// dispatch event
|
99
|
+
this.dispatch({
|
100
|
+
type: group_1.GroupEvent.UPDATED,
|
101
|
+
data: this
|
102
|
+
});
|
103
|
+
}
|
104
|
+
async setPermits(permits) {
|
105
|
+
var _a;
|
106
|
+
// send request to the server
|
107
|
+
const response = await ((_a = this.context
|
108
|
+
.resolve(rpcService_1.RpcService)) === null || _a === void 0 ? void 0 : _a.requestBuilder("api/v1/AccessGroups/permits").sendPutJson({
|
109
|
+
groupId: this.id,
|
110
|
+
permits: permits
|
111
|
+
}));
|
112
|
+
if (responseUtils_1.ResponseUtils.isFail(response)) {
|
113
|
+
await responseUtils_1.ResponseUtils.throwError(`Failed to change group permits, group: ${this.id}, organization: ${this.organization.id}`, response);
|
114
|
+
}
|
115
|
+
}
|
116
|
+
async setWorkspaces(workspaces) {
|
117
|
+
var _a;
|
118
|
+
if (workspaces === null || workspaces === undefined) {
|
119
|
+
throw new Error("Group add workspaces, workspaces is undefined or null");
|
120
|
+
}
|
121
|
+
// send request to the server
|
122
|
+
const response = await ((_a = this.context
|
123
|
+
.resolve(rpcService_1.RpcService)) === null || _a === void 0 ? void 0 : _a.requestBuilder("api/v1/AccessGroups/workspaces").sendPutJson({
|
124
|
+
groupId: this.id,
|
125
|
+
actualWorkspaceIds: workspaces
|
126
|
+
}));
|
127
|
+
if (responseUtils_1.ResponseUtils.isFail(response)) {
|
128
|
+
await responseUtils_1.ResponseUtils.throwError(`Failed to set workspaces for group: ${this.id}, organization: ${this.organization.id}`, response);
|
129
|
+
}
|
130
|
+
// reload workspaces
|
131
|
+
await this.reloadWorkspaces();
|
132
|
+
// dispatch event
|
133
|
+
this.dispatch({
|
134
|
+
type: group_1.GroupEvent.UPDATED,
|
135
|
+
data: this
|
136
|
+
});
|
137
|
+
}
|
138
|
+
async removeWorkspaces(workspaces) {
|
139
|
+
if (workspaces === null || workspaces === undefined) {
|
140
|
+
throw new Error("Group removeWorkspaces, workspaces is undefined or null");
|
141
|
+
}
|
142
|
+
// make set of workspaces
|
143
|
+
const groupWorkspaces = new Set(this.workspaces.map(w => w.id));
|
144
|
+
// check argument
|
145
|
+
if (!workspaces.every(w => groupWorkspaces.has(w))) {
|
146
|
+
const notExistingWorkspaces = workspaces.filter(workspaceId => !groupWorkspaces.has(workspaceId));
|
147
|
+
throw new Error(`Group removeWorkspaces, workspaces contains not existing workspaces: ${notExistingWorkspaces}`);
|
148
|
+
}
|
149
|
+
// remove workspaces
|
150
|
+
for (const id of workspaces) {
|
151
|
+
groupWorkspaces.delete(id);
|
152
|
+
}
|
153
|
+
// send request to the server
|
154
|
+
await this.setWorkspaces(Array.from(groupWorkspaces));
|
155
|
+
}
|
156
|
+
async setMembersIds(members) {
|
157
|
+
var _a;
|
158
|
+
if (members === null || members === undefined) {
|
159
|
+
throw new Error("Group setMembersIds, members is undefined or null");
|
160
|
+
}
|
161
|
+
// send request to the server
|
162
|
+
const response = await ((_a = this.context
|
163
|
+
.resolve(rpcService_1.RpcService)) === null || _a === void 0 ? void 0 : _a.requestBuilder("api/v1/AccessGroups/members").sendPutJson({
|
164
|
+
groupId: this.id,
|
165
|
+
memberIds: members
|
166
|
+
}));
|
167
|
+
if (responseUtils_1.ResponseUtils.isFail(response)) {
|
168
|
+
await responseUtils_1.ResponseUtils.throwError(`Failed to set members for group: ${this.id}, organization: ${this.organization.id}`, response);
|
169
|
+
}
|
170
|
+
// reload group
|
171
|
+
await this.reloadGroup(this.id);
|
172
|
+
// dispatch event
|
173
|
+
this.dispatch({
|
174
|
+
type: group_1.GroupEvent.UPDATED,
|
175
|
+
data: this
|
176
|
+
});
|
177
|
+
}
|
178
|
+
async removeMembers(members) {
|
179
|
+
// check members
|
180
|
+
if (members === null || members === undefined) {
|
181
|
+
throw new Error("Group removeMembers, members is undefined or null");
|
182
|
+
}
|
183
|
+
// make set of members
|
184
|
+
const groupMembers = new Set(this.members.map(m => m.id));
|
185
|
+
// check argument
|
186
|
+
if (!members.every(m => groupMembers.has(m))) {
|
187
|
+
const notExistingMembers = members.filter(memberId => !groupMembers.has(memberId));
|
188
|
+
throw new Error(`Group removeMembers, members contains not existing members: ${notExistingMembers}`);
|
189
|
+
}
|
190
|
+
// remove members
|
191
|
+
for (const id of members) {
|
192
|
+
groupMembers.delete(id);
|
193
|
+
}
|
194
|
+
// send request to the server
|
195
|
+
await this.setMembersIds(Array.from(groupMembers));
|
196
|
+
}
|
197
|
+
get isDisposed() {
|
198
|
+
return this._isDisposed;
|
199
|
+
}
|
200
|
+
dispose() {
|
201
|
+
this._isDisposed = true;
|
202
|
+
}
|
203
|
+
}
|
204
|
+
exports.GroupImpl = GroupImpl;
|
205
|
+
//# sourceMappingURL=group.impl.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"group.impl.js","sourceRoot":"","sources":["../../../../src/storages/groups/group.impl.ts"],"names":[],"mappings":";;;AAAA,mCAAoD;AAUpD,0DAAsD;AACtD,gEAA4D;AAK5D,MAAa,SAAU,SAAQ,aAAK;IAMlC,YACmB,OAAgB,EACjB,YAA0B;QAE1C,KAAK,EAAE,CAAA;QAHU,YAAO,GAAP,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AAK,MAAM,EAAE,IAAI,OAAO,EAAE,CAAC;YACzB,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;QACzB,CAAC;QAED,6BAA6B;QAC7B,MAAM,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAA;IACpD,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,WAAW,CAAA;IACzB,CAAC;IAED,OAAO;QACL,IAAI,CAAC,WAAW,GAAG,IAAI,CAAA;IACzB,CAAC;CACF;AA1PD,8BA0PC"}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Group = exports.GroupEvent = void 0;
|
4
|
+
const events_1 = require("../../events");
|
5
|
+
var GroupEvent;
|
6
|
+
(function (GroupEvent) {
|
7
|
+
GroupEvent["UPDATED"] = "updated";
|
8
|
+
})(GroupEvent || (exports.GroupEvent = GroupEvent = {}));
|
9
|
+
/**
|
10
|
+
* Group.
|
11
|
+
*/
|
12
|
+
class Group extends events_1.EventDispatcher {
|
13
|
+
}
|
14
|
+
exports.Group = Group;
|
15
|
+
//# sourceMappingURL=group.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"group.js","sourceRoot":"","sources":["../../../../src/storages/groups/group.ts"],"names":[],"mappings":";;;AAAA,yCAA8C;AAY9C,IAAY,UAEX;AAFD,WAAY,UAAU;IACpB,iCAAmB,CAAA;AACrB,CAAC,EAFW,UAAU,0BAAV,UAAU,QAErB;AAED;;GAEG;AACH,MAAsB,KAAM,SAAQ,wBAAkC;CAqDrE;AArDD,sBAqDC"}
|
@@ -1,74 +1,17 @@
|
|
1
|
-
import { AccessGroupDto } from "../../dto/accessGroupResponse";
|
2
|
-
import { UserDto } from "../../dto/userInfoResponse";
|
3
1
|
import { EventDispatcher } from "../../events";
|
4
|
-
import {
|
5
|
-
import { WorkspaceId } from "../workspaces/workspaces";
|
6
|
-
import { Workspace } from "../workspaces/workspace";
|
7
|
-
/**
|
8
|
-
* Group id.
|
9
|
-
*/
|
10
|
-
export type GroupId = string;
|
2
|
+
import { Group, GroupId } from "./group";
|
11
3
|
/**
|
12
4
|
* Group event.
|
13
5
|
*/
|
14
|
-
export declare enum
|
6
|
+
export declare enum GroupsEvent {
|
15
7
|
ADDED = "added",
|
16
8
|
REMOVED = "removed",
|
17
9
|
UPDATED = "updated"
|
18
10
|
}
|
19
|
-
/**
|
20
|
-
* Group.
|
21
|
-
*/
|
22
|
-
export declare abstract class Group extends EventDispatcher<GroupEvent, Group> {
|
23
|
-
/**
|
24
|
-
* Group id.
|
25
|
-
*/
|
26
|
-
abstract get id(): GroupId;
|
27
|
-
/**
|
28
|
-
* Group information.
|
29
|
-
*/
|
30
|
-
abstract get group(): AccessGroupDto;
|
31
|
-
/**
|
32
|
-
* Group members.
|
33
|
-
*/
|
34
|
-
abstract get members(): UserDto[];
|
35
|
-
/**
|
36
|
-
* Group workspaces.
|
37
|
-
*/
|
38
|
-
abstract get workspaces(): readonly Workspace[];
|
39
|
-
/**
|
40
|
-
* Set workspaces.
|
41
|
-
*/
|
42
|
-
abstract setWorkspaces(workspaces: WorkspaceId[]): Promise<void>;
|
43
|
-
/**
|
44
|
-
* Set name.
|
45
|
-
*/
|
46
|
-
abstract setName(name: string): Promise<void>;
|
47
|
-
/**
|
48
|
-
* Set permits.
|
49
|
-
*/
|
50
|
-
abstract setPermits(permits: {
|
51
|
-
isAdmin: boolean;
|
52
|
-
}): Promise<void>;
|
53
|
-
/**
|
54
|
-
* Set members.
|
55
|
-
*/
|
56
|
-
abstract setMembersIds(members: UserId[]): Promise<void>;
|
57
|
-
/**
|
58
|
-
* Remove members.
|
59
|
-
* @param members
|
60
|
-
*/
|
61
|
-
abstract removeMembers(members: UserId[]): Promise<void>;
|
62
|
-
/**
|
63
|
-
* Remove workspaces.
|
64
|
-
* @param workspaces
|
65
|
-
*/
|
66
|
-
abstract removeWorkspaces(workspaces: WorkspaceId[]): Promise<void>;
|
67
|
-
}
|
68
11
|
/**
|
69
12
|
* Groups storage.
|
70
13
|
*/
|
71
|
-
export declare abstract class Groups extends EventDispatcher<
|
14
|
+
export declare abstract class Groups extends EventDispatcher<GroupsEvent, Group> {
|
72
15
|
/**
|
73
16
|
* Collection.
|
74
17
|
*/
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"groups.d.ts","sourceRoot":"","sources":["../../../../src/storages/groups/groups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"groups.d.ts","sourceRoot":"","sources":["../../../../src/storages/groups/groups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAExC;;GAEG;AACH,oBAAY,WAAW;IACrB,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,8BAAsB,MAAO,SAAQ,eAAe,CAAC,WAAW,EAAE,KAAK,CAAC;IAEtE;;OAEG;IACH,QAAQ,KAAK,UAAU,IAAI,aAAa,CAAC,KAAK,CAAC,CAAA;IAE/C;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE;QACrC,OAAO,EAAE,OAAO,CAAA;KACjB,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC;IAEvC;;;OAGG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,EAAE,OAAO,GAAG,KAAK,GAAG,SAAS;IAE5C;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CAE5C"}
|
@@ -1,40 +1,7 @@
|
|
1
1
|
import { Context } from "../../context";
|
2
|
-
import {
|
3
|
-
import { AccessGroupDto } from "../../dto/accessGroupResponse";
|
4
|
-
import { UserDto } from "../../dto/userInfoResponse";
|
5
|
-
import { Group, GroupId, Groups } from "./groups";
|
2
|
+
import { Groups } from "./groups";
|
6
3
|
import { OrganizationImpl } from "../organizations/organization.impl";
|
7
|
-
import {
|
8
|
-
import { UserId } from "../user/userProfile";
|
9
|
-
import { Workspace } from "../workspaces/workspace";
|
10
|
-
import { WorkspaceId } from "../workspaces/workspaces";
|
11
|
-
export declare class GroupImpl extends Group implements Disposable {
|
12
|
-
private readonly context;
|
13
|
-
readonly organization: Organization;
|
14
|
-
private _isDisposed;
|
15
|
-
private _content?;
|
16
|
-
private _members?;
|
17
|
-
private _workspaces;
|
18
|
-
constructor(context: Context, organization: Organization);
|
19
|
-
initFrom(id: GroupId): Promise<Group>;
|
20
|
-
reloadGroup(id: GroupId): Promise<void>;
|
21
|
-
reloadWorkspaces(): Promise<void>;
|
22
|
-
loadWorkspaces(groupId: GroupId): Promise<Workspace[]>;
|
23
|
-
get id(): GroupId;
|
24
|
-
get group(): AccessGroupDto;
|
25
|
-
get workspaces(): readonly Workspace[];
|
26
|
-
get members(): UserDto[];
|
27
|
-
setName(name: string): Promise<void>;
|
28
|
-
setPermits(permits: {
|
29
|
-
isAdmin: boolean;
|
30
|
-
}): Promise<void>;
|
31
|
-
setWorkspaces(workspaces: string[]): Promise<void>;
|
32
|
-
removeWorkspaces(workspaces: WorkspaceId[]): Promise<void>;
|
33
|
-
setMembersIds(members: UserId[]): Promise<void>;
|
34
|
-
removeMembers(members: UserId[]): Promise<void>;
|
35
|
-
get isDisposed(): boolean;
|
36
|
-
dispose(): void;
|
37
|
-
}
|
4
|
+
import { Group, GroupId } from "./group";
|
38
5
|
export declare class GroupsImpl extends Groups {
|
39
6
|
readonly organization: OrganizationImpl;
|
40
7
|
private readonly context;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"groups.impl.d.ts","sourceRoot":"","sources":["../../../../src/storages/groups/groups.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;
|
1
|
+
{"version":3,"file":"groups.impl.d.ts","sourceRoot":"","sources":["../../../../src/storages/groups/groups.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAMvC,OAAO,EAAE,MAAM,EAAe,MAAM,UAAU,CAAA;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAA;AAErE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAGxC,qBAAa,UAAW,SAAQ,MAAM;aAKlB,YAAY,EAAE,gBAAgB;IAC9C,OAAO,CAAC,QAAQ,CAAC,OAAO;IAJ1B,OAAO,CAAC,OAAO,CAAc;gBAGX,YAAY,EAAE,gBAAgB,EAC7B,OAAO,EAAE,OAAO;IAKnC,IAAI,UAAU,IAAI,SAAS,KAAK,EAAE,CAEjC;IAEK,UAAU;IAIV,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE;QAClC,OAAO,EAAE,OAAO,CAAA;KACjB,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC;IAIvC,GAAG,CAAC,EAAE,EAAE,OAAO,GAAG,KAAK,GAAG,SAAS;IAI7B,MAAM,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAQxC;;OAEG;IACG,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAoC7B,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE;QAC1C,OAAO,EAAE,OAAO,CAAA;KACjB,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC;IAyCvC;;;OAGG;IACG,mBAAmB,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CAuCtD"}
|