@api-client/core 0.4.4 → 0.5.2

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.
Files changed (61) hide show
  1. package/build/browser.d.ts +6 -4
  2. package/build/browser.js +5 -3
  3. package/build/browser.js.map +1 -1
  4. package/build/index.d.ts +6 -4
  5. package/build/index.js +5 -3
  6. package/build/index.js.map +1 -1
  7. package/build/src/mocking/ProjectMock.d.ts +1 -1
  8. package/build/src/mocking/lib/User.d.ts +1 -6
  9. package/build/src/mocking/lib/User.js +1 -15
  10. package/build/src/mocking/lib/User.js.map +1 -1
  11. package/build/src/models/Backend.d.ts +11 -2
  12. package/build/src/models/Workspace.d.ts +5 -46
  13. package/build/src/models/Workspace.js +12 -43
  14. package/build/src/models/Workspace.js.map +1 -1
  15. package/build/src/models/store/File.d.ts +98 -0
  16. package/build/src/models/store/File.js +91 -0
  17. package/build/src/models/store/File.js.map +1 -0
  18. package/build/src/models/store/Group.d.ts +21 -0
  19. package/build/src/models/store/Group.js +2 -0
  20. package/build/src/models/store/Group.js.map +1 -0
  21. package/build/src/models/store/Permission.d.ts +196 -0
  22. package/build/src/models/store/Permission.js +221 -0
  23. package/build/src/models/store/Permission.js.map +1 -0
  24. package/build/src/models/{User.d.ts → store/User.d.ts} +12 -59
  25. package/build/src/models/{User.js → store/User.js} +0 -0
  26. package/build/src/models/store/User.js.map +1 -0
  27. package/build/src/runtime/store/RouteBuilder.d.ts +1 -0
  28. package/build/src/runtime/store/RouteBuilder.js +3 -0
  29. package/build/src/runtime/store/RouteBuilder.js.map +1 -1
  30. package/build/src/runtime/store/Sdk.d.ts +5 -0
  31. package/build/src/runtime/store/Sdk.js +8 -0
  32. package/build/src/runtime/store/Sdk.js.map +1 -1
  33. package/build/src/runtime/store/SharedSdk.d.ts +9 -0
  34. package/build/src/runtime/store/SharedSdk.js +35 -0
  35. package/build/src/runtime/store/SharedSdk.js.map +1 -0
  36. package/build/src/runtime/store/SpacesSdk.d.ts +17 -5
  37. package/build/src/runtime/store/SpacesSdk.js +11 -2
  38. package/build/src/runtime/store/SpacesSdk.js.map +1 -1
  39. package/build/src/runtime/store/StoreSdkNode.d.ts +2 -0
  40. package/build/src/runtime/store/StoreSdkNode.js.map +1 -1
  41. package/build/src/runtime/store/StoreSdkWeb.d.ts +2 -0
  42. package/build/src/runtime/store/StoreSdkWeb.js.map +1 -1
  43. package/build/src/runtime/store/UsersSdk.d.ts +1 -1
  44. package/package.json +1 -1
  45. package/src/mocking/ProjectMock.ts +1 -1
  46. package/src/mocking/lib/User.ts +1 -21
  47. package/src/models/Backend.ts +11 -2
  48. package/src/models/Workspace.ts +16 -67
  49. package/src/models/store/File.ts +149 -0
  50. package/src/models/store/Group.ts +21 -0
  51. package/src/models/store/Permission.ts +332 -0
  52. package/src/models/store/User.ts +83 -0
  53. package/src/runtime/store/RouteBuilder.ts +4 -0
  54. package/src/runtime/store/Sdk.ts +8 -0
  55. package/src/runtime/store/SharedSdk.ts +35 -0
  56. package/src/runtime/store/SpacesSdk.ts +26 -7
  57. package/src/runtime/store/StoreSdkNode.ts +3 -0
  58. package/src/runtime/store/StoreSdkWeb.ts +3 -0
  59. package/src/runtime/store/UsersSdk.ts +1 -1
  60. package/build/src/models/User.js.map +0 -1
  61. package/src/models/User.ts +0 -138
@@ -0,0 +1,91 @@
1
+ export const DefaultOwner = 'default';
2
+ export class StoredFile {
3
+ /**
4
+ * The list of parents of the object. It is an ordered list of parents
5
+ * from the top (first element) to the lowest parent in the tree (last element).
6
+ *
7
+ * This property cannot be manipulated directly by the client. Should be treated as
8
+ * opaque value.
9
+ */
10
+ parents = [];
11
+ /**
12
+ * The list of permissions to this file object.
13
+ *
14
+ * This property cannot be manipulated directly by the client. Should be treated as
15
+ * opaque value.
16
+ */
17
+ permissionIds = [];
18
+ /**
19
+ * Whether the file object is deleted.
20
+ */
21
+ deleted;
22
+ /**
23
+ * The timestamp of when the file was deleted.
24
+ */
25
+ deletedTime;
26
+ /**
27
+ * The id of the user that has deleted the file.
28
+ */
29
+ deletingUser;
30
+ /**
31
+ * The owner of this space. The id of the User object.
32
+ * Set to `default` when there are no users in the system (no authentication).
33
+ */
34
+ owner = '';
35
+ new(init) {
36
+ const { parents = [], permissionIds = [], deleted, deletedTime, deletingUser, owner = DefaultOwner } = init;
37
+ this.parents = parents;
38
+ this.permissionIds = permissionIds;
39
+ this.owner = owner;
40
+ if (typeof deleted === 'boolean') {
41
+ this.deleted = deleted;
42
+ this.deletedTime = deletedTime;
43
+ this.deletingUser = deletingUser;
44
+ }
45
+ else {
46
+ this.deleted = undefined;
47
+ this.deletedTime = undefined;
48
+ this.deletingUser = undefined;
49
+ }
50
+ }
51
+ toJSON() {
52
+ const { owner = DefaultOwner } = this;
53
+ const result = {
54
+ parents: this.parents,
55
+ permissionIds: this.permissionIds,
56
+ owner,
57
+ };
58
+ if (typeof this.deleted === 'boolean') {
59
+ result.deleted = this.deleted;
60
+ if (this.deletedTime) {
61
+ result.deletedTime = this.deletedTime;
62
+ }
63
+ if (this.deletingUser) {
64
+ result.deletingUser = this.deletingUser;
65
+ }
66
+ }
67
+ return result;
68
+ }
69
+ }
70
+ export class File extends StoredFile {
71
+ /**
72
+ * Populated by the server when reading the file. The list of permissions to the object.
73
+ *
74
+ * This property cannot be manipulated directly by the client. Should be treated as
75
+ * opaque value.
76
+ */
77
+ permissions = [];
78
+ new(init) {
79
+ super.new(init);
80
+ const { permissions = [] } = init;
81
+ this.permissions = permissions;
82
+ }
83
+ toJSON() {
84
+ const result = {
85
+ ...super.toJSON(),
86
+ permissions: this.permissions,
87
+ };
88
+ return result;
89
+ }
90
+ }
91
+ //# sourceMappingURL=File.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"File.js","sourceRoot":"","sources":["../../../../src/models/store/File.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAC;AAqDtC,MAAM,OAAO,UAAU;IACrB;;;;;;OAMG;IACH,OAAO,GA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,CAAC,YAAY,EAAE;gBACrB,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;aACzC;SACF;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAED,MAAM,OAAO,IAAK,SAAQ,UAAU;IAClC;;;;;OAKG;IACH,WAAW,GAAkB,EAAE,CAAC;IAEhC,GAAG,CAAC,IAAW;QACb,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAChB,MAAM,EAAE,WAAW,GAAC,EAAE,EAAE,GAAG,IAAI,CAAC;QAChC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAED,MAAM;QACJ,MAAM,MAAM,GAAU;YACpB,GAAG,KAAK,CAAC,MAAM,EAAE;YACjB,WAAW,EAAE,IAAI,CAAC,WAAW;SAC9B,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * An object representing a user group.
3
+ */
4
+ export interface IGroup {
5
+ /**
6
+ * The key of the group.
7
+ */
8
+ key: string;
9
+ /**
10
+ * The name of the group
11
+ */
12
+ name: string;
13
+ /**
14
+ * The id of the user that created this group.
15
+ */
16
+ owner: string;
17
+ /**
18
+ * The list of users in this group.
19
+ */
20
+ users: string[];
21
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Group.js","sourceRoot":"","sources":["../../../../src/models/store/Group.ts"],"names":[],"mappings":""}
@@ -0,0 +1,196 @@
1
+ export declare const Kind = "Core#Permission";
2
+ export declare type PermissionType = 'user' | 'group' | 'anyone';
3
+ export declare type PermissionRole = 'owner' | 'reader' | 'commenter' | 'writer';
4
+ interface IBasePermission {
5
+ /**
6
+ * The type of the permission.
7
+ *
8
+ * - `user` can access the file by a specific user
9
+ * - `group` can access the file by a group of users
10
+ * - `anyone` the object can be searched by anyone who has access to the store.
11
+ *
12
+ * Note, the `anyone` object does not mean that the end-user sees the file when
13
+ * listing objects in the store. It means the file can be searched for.
14
+ */
15
+ type: PermissionType;
16
+ /**
17
+ * The id of the owner of the permission.
18
+ * The value depends on the `type`. For the `user` type it is the user id.
19
+ * The `group` means the group id. It is not set when the role is `anyone`.
20
+ */
21
+ owner?: string;
22
+ /**
23
+ * The role granted by this permission.
24
+ */
25
+ role: PermissionRole;
26
+ /**
27
+ * The "pretty" name to render with the permission.
28
+ *
29
+ * - `user` type - user's full name
30
+ * - `group` type - the name of the group
31
+ * - `anyone` type - no render name
32
+ */
33
+ displayName?: string;
34
+ /**
35
+ * Optional expiration date of the permission. This is the timestamp when the permission expires.
36
+ * When creating / updating the permission the expiration date must:
37
+ *
38
+ * - be used on a user or a group
39
+ * - the time must be in the future
40
+ */
41
+ expirationTime?: number;
42
+ /**
43
+ * The store id of the user that added this permission.
44
+ */
45
+ addingUser: string;
46
+ /**
47
+ * Whether the permission object is deleted.
48
+ */
49
+ deleted?: boolean;
50
+ /**
51
+ * The timestamp of when the permission was deleted.
52
+ */
53
+ deletedTime?: number;
54
+ /**
55
+ * The id of the user that has deleted the permission.
56
+ */
57
+ deletingUser?: string;
58
+ }
59
+ /**
60
+ * A schema describing a permission to a store object.
61
+ */
62
+ export interface IPermission extends IBasePermission {
63
+ kind: typeof Kind;
64
+ /**
65
+ * The data store key of the permission.
66
+ * This property is generated by the store and is not writable.
67
+ */
68
+ key: string;
69
+ }
70
+ export declare class Permission {
71
+ kind: string;
72
+ /**
73
+ * The data store key of the permission.
74
+ * This property is generated by the store and is not writable.
75
+ */
76
+ key: string;
77
+ /**
78
+ * The type of the permission.
79
+ *
80
+ * - `user` can access the file by a specific user
81
+ * - `group` can access the file by a group of users
82
+ * - `anyone` the object can be searched by anyone who has access to the store.
83
+ *
84
+ * Note, the `anyone` object does not mean that the end-user sees the file when
85
+ * listing objects in the store. It means the file can be searched for.
86
+ */
87
+ type: PermissionType;
88
+ /**
89
+ * The id of the owner of the permission.
90
+ * The value depends on the `type`. For the `user` type it is the user id.
91
+ * The `group` means the group id. It is not set when the role is `anyone`.
92
+ */
93
+ owner?: string;
94
+ /**
95
+ * The role granted by this permission.
96
+ */
97
+ role: PermissionRole;
98
+ /**
99
+ * The "pretty" name to render with the permission.
100
+ *
101
+ * - `user` type - user's full name
102
+ * - `group` type - the name of the group
103
+ * - `anyone` type - no render name
104
+ */
105
+ displayName?: string;
106
+ /**
107
+ * Optional expiration date of the permission. This is the timestamp when the permission expires.
108
+ * When creating / updating the permission the expiration date must:
109
+ *
110
+ * - be used on a user or a group
111
+ * - the time must be in the future
112
+ */
113
+ expirationTime?: number;
114
+ /**
115
+ * The store id of the user that added this permission.
116
+ */
117
+ addingUser: string;
118
+ /**
119
+ * Whether the file object is deleted.
120
+ */
121
+ deleted?: boolean;
122
+ /**
123
+ * The timestamp of when the file was deleted.
124
+ */
125
+ deletedTime?: number;
126
+ /**
127
+ * The id of the user that has deleted the file.
128
+ */
129
+ deletingUser?: string;
130
+ /**
131
+ * Creates a Permission object for a user.
132
+ *
133
+ * @param role The user role to set.
134
+ * @param user The user id that has the role.
135
+ */
136
+ static fromUserRole(role: PermissionRole, user: string, addingUser: string): Permission;
137
+ /**
138
+ * Creates a Permission object for a group.
139
+ *
140
+ * @param role The group role to set.
141
+ * @param group The group id that has the role.
142
+ */
143
+ static fromGroupRole(role: PermissionRole, group: string, addingUser: string): Permission;
144
+ /**
145
+ * Creates a Permission object for a group.
146
+ *
147
+ * @param role The group role to set.
148
+ * @param group The group id that has the role.
149
+ */
150
+ static fromAnyoneRole(role: PermissionRole, addingUser: string): Permission;
151
+ /**
152
+ * Creates a permission object from other than key and kind values.
153
+ */
154
+ static fromValues(init: IBasePermission): Permission;
155
+ constructor(input?: string | IPermission);
156
+ /**
157
+ * Creates a new environment clearing anything that is so far defined.
158
+ *
159
+ * Note, this throws an error when the environment is not a space.
160
+ */
161
+ new(init: IPermission): void;
162
+ /**
163
+ * Checks whether the input is a definition of an user space.
164
+ */
165
+ static isPermission(input: unknown): boolean;
166
+ toJSON(): IPermission;
167
+ }
168
+ /**
169
+ * This is used in the communication with the backend to add/change user's access to the resource.
170
+ */
171
+ export interface IAccessOperation {
172
+ /**
173
+ * The user or group id. Not populated for `anyone` type.
174
+ */
175
+ id?: string;
176
+ /**
177
+ * The permission type
178
+ */
179
+ type: PermissionType;
180
+ }
181
+ export interface IAccessAddOperation extends IAccessOperation {
182
+ op: "add";
183
+ /**
184
+ * The level that the user or the group has access to.
185
+ */
186
+ value: PermissionRole;
187
+ /**
188
+ * The timestamp when the permission expires.
189
+ */
190
+ expirationTime?: number;
191
+ }
192
+ export interface IAccessRemoveOperation extends IAccessOperation {
193
+ op: "remove";
194
+ }
195
+ export declare type AccessOperation = IAccessAddOperation | IAccessRemoveOperation;
196
+ export {};
@@ -0,0 +1,221 @@
1
+ import v4 from '../../lib/uuid.js';
2
+ export const Kind = 'Core#Permission';
3
+ export class Permission {
4
+ kind = Kind;
5
+ /**
6
+ * The data store key of the permission.
7
+ * This property is generated by the store and is not writable.
8
+ */
9
+ key = '';
10
+ /**
11
+ * The type of the permission.
12
+ *
13
+ * - `user` can access the file by a specific user
14
+ * - `group` can access the file by a group of users
15
+ * - `anyone` the object can be searched by anyone who has access to the store.
16
+ *
17
+ * Note, the `anyone` object does not mean that the end-user sees the file when
18
+ * listing objects in the store. It means the file can be searched for.
19
+ */
20
+ type = 'user';
21
+ /**
22
+ * The id of the owner of the permission.
23
+ * The value depends on the `type`. For the `user` type it is the user id.
24
+ * The `group` means the group id. It is not set when the role is `anyone`.
25
+ */
26
+ owner;
27
+ /**
28
+ * The role granted by this permission.
29
+ */
30
+ role = 'reader';
31
+ /**
32
+ * The "pretty" name to render with the permission.
33
+ *
34
+ * - `user` type - user's full name
35
+ * - `group` type - the name of the group
36
+ * - `anyone` type - no render name
37
+ */
38
+ displayName;
39
+ /**
40
+ * Optional expiration date of the permission. This is the timestamp when the permission expires.
41
+ * When creating / updating the permission the expiration date must:
42
+ *
43
+ * - be used on a user or a group
44
+ * - the time must be in the future
45
+ */
46
+ expirationTime;
47
+ /**
48
+ * The store id of the user that added this permission.
49
+ */
50
+ addingUser = '';
51
+ /**
52
+ * Whether the file object is deleted.
53
+ */
54
+ deleted;
55
+ /**
56
+ * The timestamp of when the file was deleted.
57
+ */
58
+ deletedTime;
59
+ /**
60
+ * The id of the user that has deleted the file.
61
+ */
62
+ deletingUser;
63
+ /**
64
+ * Creates a Permission object for a user.
65
+ *
66
+ * @param role The user role to set.
67
+ * @param user The user id that has the role.
68
+ */
69
+ static fromUserRole(role, user, addingUser) {
70
+ const init = {
71
+ key: v4(),
72
+ kind: Kind,
73
+ owner: user,
74
+ role,
75
+ type: 'user',
76
+ addingUser,
77
+ };
78
+ return new Permission(init);
79
+ }
80
+ /**
81
+ * Creates a Permission object for a group.
82
+ *
83
+ * @param role The group role to set.
84
+ * @param group The group id that has the role.
85
+ */
86
+ static fromGroupRole(role, group, addingUser) {
87
+ const init = {
88
+ key: v4(),
89
+ kind: Kind,
90
+ owner: group,
91
+ role,
92
+ type: 'group',
93
+ addingUser,
94
+ };
95
+ return new Permission(init);
96
+ }
97
+ /**
98
+ * Creates a Permission object for a group.
99
+ *
100
+ * @param role The group role to set.
101
+ * @param group The group id that has the role.
102
+ */
103
+ static fromAnyoneRole(role, addingUser) {
104
+ const init = {
105
+ key: v4(),
106
+ kind: Kind,
107
+ role,
108
+ type: 'anyone',
109
+ addingUser,
110
+ };
111
+ return new Permission(init);
112
+ }
113
+ /**
114
+ * Creates a permission object from other than key and kind values.
115
+ */
116
+ static fromValues(init) {
117
+ return new Permission({
118
+ ...init,
119
+ key: v4(),
120
+ kind: Kind,
121
+ });
122
+ }
123
+ constructor(input) {
124
+ let init;
125
+ if (typeof input === 'string') {
126
+ init = JSON.parse(input);
127
+ }
128
+ else if (typeof input === 'object') {
129
+ init = input;
130
+ }
131
+ else {
132
+ init = {
133
+ kind: Kind,
134
+ key: v4(),
135
+ owner: '',
136
+ role: 'reader',
137
+ type: 'user',
138
+ addingUser: '',
139
+ };
140
+ }
141
+ this.new(init);
142
+ }
143
+ /**
144
+ * Creates a new environment clearing anything that is so far defined.
145
+ *
146
+ * Note, this throws an error when the environment is not a space.
147
+ */
148
+ new(init) {
149
+ if (!Permission.isPermission(init)) {
150
+ throw new Error(`Not a permission.`);
151
+ }
152
+ const { key = v4(), owner, role, type, displayName, expirationTime, addingUser, deleted, deletedTime, deletingUser } = init;
153
+ this.kind = Kind;
154
+ this.key = key;
155
+ this.owner = owner;
156
+ this.role = role;
157
+ this.type = type;
158
+ this.addingUser = addingUser;
159
+ if (displayName) {
160
+ this.displayName = displayName;
161
+ }
162
+ else {
163
+ this.displayName = undefined;
164
+ }
165
+ if (typeof expirationTime === 'number') {
166
+ this.expirationTime = expirationTime;
167
+ }
168
+ else {
169
+ this.expirationTime = undefined;
170
+ }
171
+ if (typeof deleted === 'boolean') {
172
+ this.deleted = deleted;
173
+ this.deletedTime = deletedTime;
174
+ this.deletingUser = deletingUser;
175
+ }
176
+ else {
177
+ this.deleted = undefined;
178
+ this.deletedTime = undefined;
179
+ this.deletingUser = undefined;
180
+ }
181
+ }
182
+ /**
183
+ * Checks whether the input is a definition of an user space.
184
+ */
185
+ static isPermission(input) {
186
+ const typed = input;
187
+ if (!input || typed.kind !== Kind) {
188
+ return false;
189
+ }
190
+ return true;
191
+ }
192
+ toJSON() {
193
+ const result = {
194
+ kind: Kind,
195
+ key: this.key,
196
+ role: this.role,
197
+ type: this.type,
198
+ addingUser: this.addingUser,
199
+ };
200
+ if (this.owner) {
201
+ result.owner = this.owner;
202
+ }
203
+ if (this.displayName) {
204
+ result.displayName = this.displayName;
205
+ }
206
+ if (this.expirationTime) {
207
+ result.expirationTime = this.expirationTime;
208
+ }
209
+ if (typeof this.deleted === 'boolean') {
210
+ result.deleted = this.deleted;
211
+ if (this.deletedTime) {
212
+ result.deletedTime = this.deletedTime;
213
+ }
214
+ if (this.deletingUser) {
215
+ result.deletingUser = this.deletingUser;
216
+ }
217
+ }
218
+ return result;
219
+ }
220
+ }
221
+ //# sourceMappingURL=Permission.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Permission.js","sourceRoot":"","sources":["../../../../src/models/store/Permission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEnC,MAAM,CAAC,MAAM,IAAI,GAAG,iBAAiB,CAAC;AA0EtC,MAAM,OAAO,UAAU;IACrB,IAAI,GAAG,IAAI,CAAC;IACZ;;;OAGG;IACH,GAAG,GAAG,EAAE,CAAC;IACT;;;;;;;;;OASG;IACH,IAAI,GAAmB,MAAM,CAAC;IAC9B;;;;OAIG;IACH,KAAK,CAAU;IACf;;OAEG;IACH,IAAI,GAAmB,QAAQ,CAAC;IAChC;;;;;;OAMG;IACH,WAAW,CAAU;IACrB;;;;;;OAMG;IACH,cAAc,CAAU;IAExB;;OAEG;IACH,UAAU,GAAW,EAAE,CAAC;IAExB;;OAEG;IACH,OAAO,CAAW;IAClB;;OAEG;IACH,WAAW,CAAU;IACrB;;OAEG;IACH,YAAY,CAAU;IAEtB;;;;;OAKG;IACH,MAAM,CAAC,YAAY,CAAC,IAAoB,EAAE,IAAY,EAAE,UAAkB;QACxE,MAAM,IAAI,GAAgB;YACxB,GAAG,EAAE,EAAE,EAAE;YACT,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,IAAI;YACX,IAAI;YACJ,IAAI,EAAE,MAAM;YACZ,UAAU;SACX,CAAC;QACF,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,aAAa,CAAC,IAAoB,EAAE,KAAa,EAAE,UAAkB;QAC1E,MAAM,IAAI,GAAgB;YACxB,GAAG,EAAE,EAAE,EAAE;YACT,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,KAAK;YACZ,IAAI;YACJ,IAAI,EAAE,OAAO;YACb,UAAU;SACX,CAAC;QACF,OAAO,IAAI,UAAU,CAAC,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C,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B,CAAC;QACF,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;SAC3B;QACD,IAAI,IAAI,CAAC,WAAW,EAAE;YACpB,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;SACvC;QACD,IAAI,IAAI,CAAC,cAAc,EAAE;YACvB,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;SAC7C;QACD,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE;YACrC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;YAE9B,IAAI,IAAI,CAAC,WAAW,EAAE;gBACpB,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;aACvC;YACD,IAAI,IAAI,CAAC,YAAY,EAAE;gBACrB,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;aACzC;SACF;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
@@ -1,38 +1,3 @@
1
- export declare type AccessControlLevel = 'read' | 'comment' | 'write' | 'admin' | 'owner';
2
- /**
3
- * This is used in the communication with the backend to add/change user's access to the resource.
4
- */
5
- export interface IUserAccessOperation {
6
- /**
7
- * The user id.
8
- */
9
- uid: string;
10
- }
11
- export interface IUserAccessAddOperation extends IUserAccessOperation {
12
- op: "add";
13
- /**
14
- * The level that the user has access to.
15
- */
16
- value: AccessControlLevel;
17
- }
18
- export interface IUserAccessRemoveOperation extends IUserAccessOperation {
19
- op: "remove";
20
- }
21
- export declare type UserAccessOperation = IUserAccessAddOperation | IUserAccessRemoveOperation;
22
- /**
23
- * The definition of an access control.
24
- * The user may have access to a workspace so this is the object describing the level of the workspace.
25
- */
26
- export interface IAccessControl {
27
- /**
28
- * The data store key of the referenced object the user has access to.
29
- */
30
- key: string;
31
- /**
32
- * The level that the user has access to.
33
- */
34
- level: AccessControlLevel;
35
- }
36
1
  export interface IEmail {
37
2
  /**
38
3
  * When available the email of the user.
@@ -85,6 +50,18 @@ interface BaseUser {
85
50
  * Optional metadata related to the auth provider.
86
51
  */
87
52
  provider?: unknown;
53
+ /**
54
+ * Whether the user is deleted from the system.
55
+ */
56
+ deleted?: boolean;
57
+ /**
58
+ * The timestamp of when the user was deleted.
59
+ */
60
+ deletedTime?: number;
61
+ /**
62
+ * The id of the user that deleted the user.
63
+ */
64
+ deletingUser?: string;
88
65
  }
89
66
  /**
90
67
  * Represents a user in the system.
@@ -100,28 +77,4 @@ export interface IUser extends BaseUser {
100
77
  */
101
78
  provider?: unknown;
102
79
  }
103
- /**
104
- * This object may be created for each user in the system.
105
- * It describes to which spaces user has access to.
106
- */
107
- export interface IUserSpaces {
108
- /**
109
- * The list of access to the spaces for the user.
110
- */
111
- spaces: IAccessControl[];
112
- /**
113
- * The data store key of the user that has access to the space.
114
- * This is also the key of the entry.
115
- */
116
- user: string;
117
- }
118
- /**
119
- * An abstract user object that contains access information to a space.
120
- */
121
- export interface ISpaceUser extends BaseUser {
122
- /**
123
- * The level that the user has access to.
124
- */
125
- level: AccessControlLevel;
126
- }
127
80
  export {};
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"User.js","sourceRoot":"","sources":["../../../../src/models/store/User.ts"],"names":[],"mappings":"AAuBA,MAAM,CAAC,MAAM,IAAI,GAAG,WAAW,CAAC"}
@@ -39,4 +39,5 @@ export declare class RouteBuilder {
39
39
  static historyBatchCreate(): string;
40
40
  static historyBatchDelete(): string;
41
41
  static historyItem(key: string): string;
42
+ static sharedSpaces(): string;
42
43
  }
@@ -71,5 +71,8 @@ export class RouteBuilder {
71
71
  static historyItem(key) {
72
72
  return `/history/${key}`;
73
73
  }
74
+ static sharedSpaces() {
75
+ return '/shared/spaces';
76
+ }
74
77
  }
75
78
  //# sourceMappingURL=RouteBuilder.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RouteBuilder.js","sourceRoot":"","sources":["../../../../src/runtime/store/RouteBuilder.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,OAAO,YAAY;IACvB;;OAEG;IACH,MAAM,CAAC,MAAM;QACX,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,GAAW;QACtB,OAAO,WAAW,GAAG,EAAE,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,GAAW;QAC3B,OAAO,WAAW,GAAG,QAAQ,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,GAAW;QAC9B,OAAO,WAAW,GAAG,WAAW,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,KAAa,EAAE,OAAe;QAChD,OAAO,WAAW,KAAK,aAAa,OAAO,EAAE,CAAC;IAChD,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,KAAa,EAAE,OAAe;QACpD,OAAO,WAAW,KAAK,aAAa,OAAO,YAAY,CAAC;IAC1D,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,OAAO;QACZ,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,MAAM,CAAC,QAAQ;QACb,OAAO,WAAW,CAAA;IACpB,CAAC;IAED,MAAM,CAAC,YAAY;QACjB,OAAO,iBAAiB,CAAA;IAC1B,CAAC;IAED,MAAM,CAAC,OAAO;QACZ,OAAO,WAAW,CAAA;IACpB,CAAC;IAED,MAAM,CAAC,KAAK;QACV,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,GAAW;QACrB,OAAO,UAAU,GAAG,EAAE,CAAA;IACxB,CAAC;IAED,MAAM,CAAC,OAAO;QACZ,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,MAAM,CAAC,kBAAkB;QACvB,OAAO,uBAAuB,CAAC;IACjC,CAAC;IAED,MAAM,CAAC,kBAAkB;QACvB,OAAO,uBAAuB,CAAC;IACjC,CAAC;IAED,MAAM,CAAC,WAAW,CAAC,GAAW;QAC5B,OAAO,YAAY,GAAG,EAAE,CAAC;IAC3B,CAAC;CACF"}
1
+ {"version":3,"file":"RouteBuilder.js","sourceRoot":"","sources":["../../../../src/runtime/store/RouteBuilder.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,OAAO,YAAY;IACvB;;OAEG;IACH,MAAM,CAAC,MAAM;QACX,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,GAAW;QACtB,OAAO,WAAW,GAAG,EAAE,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,GAAW;QAC3B,OAAO,WAAW,GAAG,QAAQ,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,GAAW;QAC9B,OAAO,WAAW,GAAG,WAAW,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,KAAa,EAAE,OAAe;QAChD,OAAO,WAAW,KAAK,aAAa,OAAO,EAAE,CAAC;IAChD,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,KAAa,EAAE,OAAe;QACpD,OAAO,WAAW,KAAK,aAAa,OAAO,YAAY,CAAC;IAC1D,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,OAAO;QACZ,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,MAAM,CAAC,QAAQ;QACb,OAAO,WAAW,CAAA;IACpB,CAAC;IAED,MAAM,CAAC,YAAY;QACjB,OAAO,iBAAiB,CAAA;IAC1B,CAAC;IAED,MAAM,CAAC,OAAO;QACZ,OAAO,WAAW,CAAA;IACpB,CAAC;IAED,MAAM,CAAC,KAAK;QACV,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,GAAW;QACrB,OAAO,UAAU,GAAG,EAAE,CAAA;IACxB,CAAC;IAED,MAAM,CAAC,OAAO;QACZ,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,MAAM,CAAC,kBAAkB;QACvB,OAAO,uBAAuB,CAAC;IACjC,CAAC;IAED,MAAM,CAAC,kBAAkB;QACvB,OAAO,uBAAuB,CAAC;IACjC,CAAC;IAED,MAAM,CAAC,WAAW,CAAC,GAAW;QAC5B,OAAO,YAAY,GAAG,EAAE,CAAC;IAC3B,CAAC;IAED,MAAM,CAAC,YAAY;QACjB,OAAO,gBAAgB,CAAC;IAC1B,CAAC;CACF"}
@@ -7,6 +7,7 @@ import { SpacesSdk } from './SpacesSdk.js';
7
7
  import { ProjectsSdk } from './ProjectsSdk.js';
8
8
  import { UsersSdk } from './UsersSdk.js';
9
9
  import { HistorySdk } from './HistorySdk.js';
10
+ import { SharedSdk } from './SharedSdk.js';
10
11
  declare const baseUriSymbol: unique symbol;
11
12
  /**
12
13
  * NodeJS API for API Client's net-store module.
@@ -49,6 +50,10 @@ export declare abstract class Sdk {
49
50
  * The history data.
50
51
  */
51
52
  history: HistorySdk;
53
+ /**
54
+ * The shared data.
55
+ */
56
+ shared: SharedSdk;
52
57
  [baseUriSymbol]: string;
53
58
  /**
54
59
  * @returns The base URI to the store.