@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.
@@ -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 REST API requests to the server.
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
- * Principials are any entity that can be authenticated by the server, such as a any user or
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(): any[] {
101
+ get grantedTo(): IGrantedTo[] {
114
102
  return this.data.grantedTo;
115
103
  }
116
104
 
117
- set grantedTo(value: any[]) {
105
+ set grantedTo(value: IGrantedTo[]) {
118
106
  this.data.grantedTo = value;
119
107
  }
120
108
 
@@ -22,14 +22,15 @@
22
22
  ///////////////////////////////////////////////////////////////////////////////
23
23
 
24
24
  import { IHttpClient } from "./IHttpClient";
25
- import { IShortUserDescription } from "./IUser";
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 server and
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 REST API requests to the server.
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(): IShortUserDescription {
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. See {@link Role.permissions} for
355
- * more details.
347
+ * @param permissions - Actions are allowed to be performed for the role.
356
348
  */
357
- createRole(name: string, description: string, permissions: any): Promise<Role> {
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. To add a file to this list, create a `project` permission
434
- * on the file using {@link File.createPermission | File.createPermission()}.
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 REST API requests to the server.
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(): any {
97
+ get permissions(): IRoleActions {
111
98
  return this.data.permissions;
112
99
  }
113
100
 
114
- set permissions(value: any) {
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 server user and manage its data.
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 REST API requests to the server.
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";