@inweb/client 25.9.2 → 25.9.4
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/client.js +46 -105
- package/dist/client.js.map +1 -1
- package/dist/client.min.js +1 -1
- package/dist/client.module.js +3 -3
- package/dist/client.module.js.map +1 -1
- package/lib/Api/Assembly.d.ts +5 -13
- package/lib/Api/ClashTest.d.ts +3 -11
- package/lib/Api/Client.d.ts +4 -3
- package/lib/Api/File.d.ts +19 -25
- package/lib/Api/HttpClient.d.ts +1 -1
- package/lib/Api/IFile.d.ts +31 -0
- package/lib/Api/IHttpClient.d.ts +82 -1
- package/lib/Api/IRole.d.ts +59 -0
- package/lib/Api/IUser.d.ts +30 -1
- package/lib/Api/Job.d.ts +2 -2
- package/lib/Api/Member.d.ts +5 -12
- package/lib/Api/Permission.d.ts +5 -16
- package/lib/Api/Project.d.ts +14 -19
- package/lib/Api/Role.d.ts +4 -17
- package/lib/Api/User.d.ts +3 -2
- package/lib/index.d.ts +4 -0
- package/package.json +2 -2
- package/src/Api/Assembly.ts +5 -13
- package/src/Api/ClashTest.ts +3 -11
- package/src/Api/Client.ts +4 -3
- package/src/Api/File.ts +19 -25
- package/src/Api/HttpClient.ts +1 -1
- package/src/Api/IFile.ts +35 -0
- package/src/Api/IHttpClient.ts +85 -1
- package/src/Api/IRole.ts +88 -0
- package/src/Api/IUser.ts +37 -1
- package/src/Api/Job.ts +2 -2
- package/src/Api/Member.ts +5 -12
- package/src/Api/Permission.ts +5 -17
- package/src/Api/Project.ts +14 -19
- package/src/Api/Role.ts +4 -17
- package/src/Api/User.ts +3 -2
- package/src/index.ts +4 -0
package/src/Api/Permission.ts
CHANGED
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
///////////////////////////////////////////////////////////////////////////////
|
|
23
23
|
|
|
24
24
|
import { IHttpClient } from "./IHttpClient";
|
|
25
|
+
import { IGrantedTo } from "./IFile";
|
|
25
26
|
|
|
26
27
|
/**
|
|
27
28
|
* Provides properties and methods for obtaining information about {@link File | file} actions
|
|
@@ -35,7 +36,7 @@ export class Permission {
|
|
|
35
36
|
/**
|
|
36
37
|
* @param data - Raw permission data received from the server.
|
|
37
38
|
* @param fileId - Owner file ID.
|
|
38
|
-
* @param httpClient - HTTP client instance used to send
|
|
39
|
+
* @param httpClient - HTTP client instance used to send requests to the REST API server.
|
|
39
40
|
*/
|
|
40
41
|
constructor(data: any, fileId: string, httpClient: IHttpClient) {
|
|
41
42
|
this.httpClient = httpClient;
|
|
@@ -95,26 +96,13 @@ export class Permission {
|
|
|
95
96
|
}
|
|
96
97
|
|
|
97
98
|
/**
|
|
98
|
-
*
|
|
99
|
-
* project that will get access to the file.
|
|
100
|
-
*
|
|
101
|
-
* @typedef {any} Principial
|
|
102
|
-
* @property {any} user - The user entry that get access to the file.
|
|
103
|
-
* @property {string} user.id - User ID.
|
|
104
|
-
* @property {string} user.name - User name.
|
|
105
|
-
* @property {any} project - The project entry that get access to the file.
|
|
106
|
-
* @property {string} project.id - Project ID.
|
|
107
|
-
* @property {string} project.name - Project name.
|
|
108
|
-
*/
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* A list of principials that will get access to the file.
|
|
99
|
+
* A list of entities that will get access to the file.
|
|
112
100
|
*/
|
|
113
|
-
get grantedTo():
|
|
101
|
+
get grantedTo(): IGrantedTo[] {
|
|
114
102
|
return this.data.grantedTo;
|
|
115
103
|
}
|
|
116
104
|
|
|
117
|
-
set grantedTo(value:
|
|
105
|
+
set grantedTo(value: IGrantedTo[]) {
|
|
118
106
|
this.data.grantedTo = value;
|
|
119
107
|
}
|
|
120
108
|
|
package/src/Api/Project.ts
CHANGED
|
@@ -22,14 +22,15 @@
|
|
|
22
22
|
///////////////////////////////////////////////////////////////////////////////
|
|
23
23
|
|
|
24
24
|
import { IHttpClient } from "./IHttpClient";
|
|
25
|
-
import {
|
|
25
|
+
import { IShortUserDesc } from "./IUser";
|
|
26
26
|
import { Role } from "./Role";
|
|
27
|
+
import { IRoleActions } from "./IRole";
|
|
27
28
|
import { Member } from "./Member";
|
|
28
29
|
import { userFullName, userInitials } from "./Utils";
|
|
29
30
|
|
|
30
31
|
/**
|
|
31
|
-
* Provides properties and methods for obtaining information about a project on the
|
|
32
|
-
* managing its {@link Role | roles}, {@link Member | members} and models.
|
|
32
|
+
* Provides properties and methods for obtaining information about a project on the Open Cloud
|
|
33
|
+
* Server and managing its {@link Role | roles}, {@link Member | members} and models.
|
|
33
34
|
*/
|
|
34
35
|
export class Project {
|
|
35
36
|
private _data: any;
|
|
@@ -37,7 +38,7 @@ export class Project {
|
|
|
37
38
|
|
|
38
39
|
/**
|
|
39
40
|
* @param data - Raw project data received from the server.
|
|
40
|
-
* @param httpClient - HTTP client instance used to send
|
|
41
|
+
* @param httpClient - HTTP client instance used to send requests to the REST API server.
|
|
41
42
|
*/
|
|
42
43
|
constructor(data: any, httpClient: IHttpClient) {
|
|
43
44
|
this.httpClient = httpClient;
|
|
@@ -182,17 +183,9 @@ export class Project {
|
|
|
182
183
|
/**
|
|
183
184
|
* Project owner information.
|
|
184
185
|
*
|
|
185
|
-
* @property {string} userId - User ID.
|
|
186
|
-
* @property {string} userName - User name.
|
|
187
|
-
* @property {string} name - First name.
|
|
188
|
-
* @property {string} lastName - Last name.
|
|
189
|
-
* @property {string} fullName - Full name.
|
|
190
|
-
* @property {string} initials - Initials.
|
|
191
|
-
* @property {string} email - User email.
|
|
192
|
-
* @property {string} avatarUrl - User avatar image URL.
|
|
193
186
|
* @readonly
|
|
194
187
|
*/
|
|
195
|
-
get owner():
|
|
188
|
+
get owner(): IShortUserDesc {
|
|
196
189
|
return this.data.owner;
|
|
197
190
|
}
|
|
198
191
|
|
|
@@ -351,10 +344,9 @@ export class Project {
|
|
|
351
344
|
*
|
|
352
345
|
* @param name - Role name.
|
|
353
346
|
* @param description - Role description.
|
|
354
|
-
* @param permissions - Actions are allowed to be performed
|
|
355
|
-
* more details.
|
|
347
|
+
* @param permissions - Actions are allowed to be performed for the role.
|
|
356
348
|
*/
|
|
357
|
-
createRole(name: string, description: string, permissions:
|
|
349
|
+
createRole(name: string, description: string, permissions: IRoleActions): Promise<Role> {
|
|
358
350
|
return this.internalPost("/roles", {
|
|
359
351
|
name,
|
|
360
352
|
description,
|
|
@@ -398,7 +390,7 @@ export class Project {
|
|
|
398
390
|
* Add a user to the project to become a member and have permission to perform actions.
|
|
399
391
|
*
|
|
400
392
|
* @param userId - User ID.
|
|
401
|
-
* @param role - Role name from the list of project roles.
|
|
393
|
+
* @param role - Role name from the list of project {@link getRoles | roles}.
|
|
402
394
|
*/
|
|
403
395
|
addMember(userId: string, role: string): Promise<Member> {
|
|
404
396
|
return this.internalPost("/members", { userId, role })
|
|
@@ -430,8 +422,11 @@ export class Project {
|
|
|
430
422
|
*/
|
|
431
423
|
|
|
432
424
|
/**
|
|
433
|
-
* Returns a list of project files.
|
|
434
|
-
*
|
|
425
|
+
* Returns a list of project files.
|
|
426
|
+
*
|
|
427
|
+
* This list contains all files that the project has access to. To add a file to this list,
|
|
428
|
+
* create a {@link IGrantedTo.project | project} permission on the file using
|
|
429
|
+
* {@link File.createPermission | File.createPermission()}.
|
|
435
430
|
*/
|
|
436
431
|
getFilesInformation(): Promise<any[]> {
|
|
437
432
|
return this.httpClient
|
package/src/Api/Role.ts
CHANGED
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
///////////////////////////////////////////////////////////////////////////////
|
|
23
23
|
|
|
24
24
|
import { IHttpClient } from "./IHttpClient";
|
|
25
|
+
import { IRoleActions } from "./IRole";
|
|
25
26
|
|
|
26
27
|
/**
|
|
27
28
|
* A role determines what actions allowed to be performed by {@link User | users} on a
|
|
@@ -35,7 +36,7 @@ export class Role {
|
|
|
35
36
|
/**
|
|
36
37
|
* @param data - Raw role data received from the server.
|
|
37
38
|
* @param projectId - Owner project ID.
|
|
38
|
-
* @param httpClient - HTTP client instance used to send
|
|
39
|
+
* @param httpClient - HTTP client instance used to send requests to the REST API server.
|
|
39
40
|
*/
|
|
40
41
|
constructor(data: any, projectId: string, httpClient: IHttpClient) {
|
|
41
42
|
this.httpClient = httpClient;
|
|
@@ -92,26 +93,12 @@ export class Role {
|
|
|
92
93
|
|
|
93
94
|
/**
|
|
94
95
|
* Role actions are allowed to be performed.
|
|
95
|
-
*
|
|
96
|
-
* @property {string[]} projectActions - Actions are allowed to be performed at the project
|
|
97
|
-
* level: `update`, `createTopic`, `createDocument`.
|
|
98
|
-
* @property {string[]} topicActions - Actions are allowed to be performed at the topic
|
|
99
|
-
* level: `update`, `updateBimSnippet`, `updateRelatedTopics`, `updateDocumentReferences`,
|
|
100
|
-
* `updateFiles`, `createComment`, `createViewpoint`, `delete`.
|
|
101
|
-
* @property {string[]} commentActions - Actions are allowed to be performed at the comment
|
|
102
|
-
* level: `update`, `delete`.
|
|
103
|
-
* @property {string[]} viewpointActions - Actions are allowed to be performed at the
|
|
104
|
-
* viewpoint level: `delete`.
|
|
105
|
-
* @property {string[]} odaGroupActions - Actions are allowed to be performed at the members
|
|
106
|
-
* level: `update`, `delete`.
|
|
107
|
-
* @property {string[]} odaRoleActions - Actions are allowed to be performed at the roles
|
|
108
|
-
* level: `update`, `delete`.
|
|
109
96
|
*/
|
|
110
|
-
get permissions():
|
|
97
|
+
get permissions(): IRoleActions {
|
|
111
98
|
return this.data.permissions;
|
|
112
99
|
}
|
|
113
100
|
|
|
114
|
-
set permissions(value:
|
|
101
|
+
set permissions(value: IRoleActions) {
|
|
115
102
|
this.data.permissions = value || {};
|
|
116
103
|
}
|
|
117
104
|
|
package/src/Api/User.ts
CHANGED
|
@@ -26,7 +26,8 @@ import { FetchError } from "./FetchError";
|
|
|
26
26
|
import { userFullName, userInitials } from "./Utils";
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
|
-
* Provides properties and methods for obtaining information about a
|
|
29
|
+
* Provides properties and methods for obtaining information about a Open Cloud Server user and
|
|
30
|
+
* manage its data.
|
|
30
31
|
*/
|
|
31
32
|
export class User {
|
|
32
33
|
private _data: any;
|
|
@@ -34,7 +35,7 @@ export class User {
|
|
|
34
35
|
|
|
35
36
|
/**
|
|
36
37
|
* @param data - Raw user data received from the server.
|
|
37
|
-
* @param httpClient - HTTP client instance used to send
|
|
38
|
+
* @param httpClient - HTTP client instance used to send requests to the REST API server.
|
|
38
39
|
*/
|
|
39
40
|
constructor(data: any, httpClient: IHttpClient) {
|
|
40
41
|
this.httpClient = httpClient;
|
package/src/index.ts
CHANGED
|
@@ -28,7 +28,11 @@ export * from "./Api/ClientEvents";
|
|
|
28
28
|
export { File } from "./Api/File";
|
|
29
29
|
export { FetchError, statusText } from "./Api/FetchError";
|
|
30
30
|
export { Job } from "./Api/Job";
|
|
31
|
+
export { IHttpClient } from "./Api/IHttpClient";
|
|
31
32
|
export { IModelTransformMatrix } from "./Api/IAssembly";
|
|
33
|
+
export { IGrantedTo } from "./Api/IFile";
|
|
34
|
+
export { IRoleActions } from "./Api/IRole";
|
|
35
|
+
export { IShortUserDesc } from "./Api/IUser";
|
|
32
36
|
export { Member } from "./Api/Member";
|
|
33
37
|
export { Model } from "./Api/Model";
|
|
34
38
|
export { Permission } from "./Api/Permission";
|