@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/lib/Api/Assembly.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { IHttpClient } from "./IHttpClient";
|
|
2
2
|
import { IAssociatedFileData, IAssemblyVersionInfo, IModelTransformMatrix } from "./IAssembly";
|
|
3
|
-
import {
|
|
3
|
+
import { IShortUserDesc } from "./IUser";
|
|
4
4
|
import { Model } from "./Model";
|
|
5
5
|
import { ClashTest } from "./ClashTest";
|
|
6
6
|
/**
|
|
7
|
-
* Provides properties and methods for obtaining information about an assembly on the
|
|
8
|
-
* and managing its data.
|
|
7
|
+
* Provides properties and methods for obtaining information about an assembly on the Open
|
|
8
|
+
* Cloud Server and managing its data.
|
|
9
9
|
*/
|
|
10
10
|
export declare class Assembly {
|
|
11
11
|
private _data;
|
|
@@ -14,7 +14,7 @@ export declare class Assembly {
|
|
|
14
14
|
path: string;
|
|
15
15
|
/**
|
|
16
16
|
* @param data - Raw assembly data received from the server.
|
|
17
|
-
* @param httpClient - HTTP client instance used to send
|
|
17
|
+
* @param httpClient - HTTP client instance used to send requests to the REST API server..
|
|
18
18
|
*/
|
|
19
19
|
constructor(data: any, httpClient: IHttpClient);
|
|
20
20
|
appendVersionParam(relativePath: string): string;
|
|
@@ -72,17 +72,9 @@ export declare class Assembly {
|
|
|
72
72
|
/**
|
|
73
73
|
* Assembly owner information.
|
|
74
74
|
*
|
|
75
|
-
* @property {string} userId - User ID.
|
|
76
|
-
* @property {string} userName - User name.
|
|
77
|
-
* @property {string} name - First name.
|
|
78
|
-
* @property {string} lastName - Last name.
|
|
79
|
-
* @property {string} fullName - Full name.
|
|
80
|
-
* @property {string} initials - Initials.
|
|
81
|
-
* @property {string} email - User email.
|
|
82
|
-
* @property {string} avatarUrl - User avatar image URL.
|
|
83
75
|
* @readonly
|
|
84
76
|
*/
|
|
85
|
-
get owner():
|
|
77
|
+
get owner(): IShortUserDesc;
|
|
86
78
|
get previewUrl(): string;
|
|
87
79
|
/**
|
|
88
80
|
* List of assembly related job IDs.
|
package/lib/Api/ClashTest.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IHttpClient } from "./IHttpClient";
|
|
2
|
-
import {
|
|
2
|
+
import { IShortUserDesc } from "./IUser";
|
|
3
3
|
/**
|
|
4
4
|
* Provides properties and methods for obtaining information about a file/assembly clash detection test.
|
|
5
5
|
*/
|
|
@@ -10,7 +10,7 @@ export declare class ClashTest {
|
|
|
10
10
|
/**
|
|
11
11
|
* @param data - Raw test data received from the server.
|
|
12
12
|
* @param basePath - The clash test API base path of the file/assembly that owns the test.
|
|
13
|
-
* @param httpClient - HTTP client instance used to send
|
|
13
|
+
* @param httpClient - HTTP client instance used to send requests to the REST API server.
|
|
14
14
|
*/
|
|
15
15
|
constructor(data: any, basePath: string, httpClient: IHttpClient);
|
|
16
16
|
protected internalGet(relativePath: string): Promise<Response>;
|
|
@@ -62,17 +62,9 @@ export declare class ClashTest {
|
|
|
62
62
|
/**
|
|
63
63
|
* Test owner information.
|
|
64
64
|
*
|
|
65
|
-
* @property {string} userId - User ID.
|
|
66
|
-
* @property {string} userName - User name.
|
|
67
|
-
* @property {string} name - First name.
|
|
68
|
-
* @property {string} lastName - Last name.
|
|
69
|
-
* @property {string} fullName - Full name.
|
|
70
|
-
* @property {string} initials - Initials.
|
|
71
|
-
* @property {string} email - User email.
|
|
72
|
-
* @property {string} avatarUrl - User avatar image URL.
|
|
73
65
|
* @readonly
|
|
74
66
|
*/
|
|
75
|
-
get owner():
|
|
67
|
+
get owner(): IShortUserDesc;
|
|
76
68
|
/**
|
|
77
69
|
* First selection set for clash detection. Objects from `selectionSetA` will be tested
|
|
78
70
|
* against each others by objects from the `selectionSetB` during the test.
|
package/lib/Api/Client.d.ts
CHANGED
|
@@ -7,7 +7,8 @@ import { Job } from "./Job";
|
|
|
7
7
|
import { Project } from "./Project";
|
|
8
8
|
import { User } from "./User";
|
|
9
9
|
/**
|
|
10
|
-
* Provides methods for managing
|
|
10
|
+
* Provides methods for managing Open Cloud Server resources such as users, files, assemblies,
|
|
11
|
+
* jobs, projects, etc.
|
|
11
12
|
*/
|
|
12
13
|
export declare class Client extends EventEmitter2<ClientEventMap> {
|
|
13
14
|
private _serverUrl;
|
|
@@ -24,13 +25,13 @@ export declare class Client extends EventEmitter2<ClientEventMap> {
|
|
|
24
25
|
url?: string;
|
|
25
26
|
});
|
|
26
27
|
/**
|
|
27
|
-
* Open Cloud
|
|
28
|
+
* Open Cloud REST API server base URL. Use {@link configure | configure()} to change server URL.
|
|
28
29
|
*
|
|
29
30
|
* @readonly
|
|
30
31
|
*/
|
|
31
32
|
get serverUrl(): string;
|
|
32
33
|
/**
|
|
33
|
-
* HTTP client instance used to send
|
|
34
|
+
* HTTP client instance used to send requests to the REST API server.
|
|
34
35
|
*
|
|
35
36
|
* @readonly
|
|
36
37
|
*/
|
package/lib/Api/File.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { IHttpClient } from "./IHttpClient";
|
|
2
|
-
import { IFileStatus, IFileReferences, IFileVersionInfo } from "./IFile";
|
|
3
|
-
import {
|
|
2
|
+
import { IFileStatus, IFileReferences, IFileVersionInfo, IGrantedTo } from "./IFile";
|
|
3
|
+
import { IShortUserDesc } from "./IUser";
|
|
4
4
|
import { Model } from "./Model";
|
|
5
5
|
import { Permission } from "./Permission";
|
|
6
6
|
import { Job } from "./Job";
|
|
7
7
|
/**
|
|
8
|
-
* Provides properties and methods for obtaining information about a file on the
|
|
9
|
-
* managing its data and versions.
|
|
8
|
+
* Provides properties and methods for obtaining information about a file on the Open Cloud
|
|
9
|
+
* Server and managing its data and versions.
|
|
10
10
|
*/
|
|
11
11
|
export declare class File {
|
|
12
12
|
private _data;
|
|
@@ -15,7 +15,7 @@ export declare class File {
|
|
|
15
15
|
path: string;
|
|
16
16
|
/**
|
|
17
17
|
* @param data - Raw file data received from the server.
|
|
18
|
-
* @param httpClient - HTTP client instance used to send
|
|
18
|
+
* @param httpClient - HTTP client instance used to send requests to the REST API server.
|
|
19
19
|
*/
|
|
20
20
|
constructor(data: any, httpClient: IHttpClient);
|
|
21
21
|
private appendVersionParam;
|
|
@@ -99,17 +99,9 @@ export declare class File {
|
|
|
99
99
|
/**
|
|
100
100
|
* File owner information.
|
|
101
101
|
*
|
|
102
|
-
* @property {string} userId - User ID.
|
|
103
|
-
* @property {string} userName - User name.
|
|
104
|
-
* @property {string} name - First name.
|
|
105
|
-
* @property {string} lastName - Last name.
|
|
106
|
-
* @property {string} fullName - Full name.
|
|
107
|
-
* @property {string} initials - Initials.
|
|
108
|
-
* @property {string} email - User email.
|
|
109
|
-
* @property {string} avatarUrl - User avatar image URL.
|
|
110
102
|
* @readonly
|
|
111
103
|
*/
|
|
112
|
-
get owner():
|
|
104
|
+
get owner(): IShortUserDesc;
|
|
113
105
|
/**
|
|
114
106
|
* File preview image URL or empty string if the file does not have a preview. Use
|
|
115
107
|
* {@link setPreview | setPreview()} to change preview image.
|
|
@@ -161,17 +153,9 @@ export declare class File {
|
|
|
161
153
|
/**
|
|
162
154
|
* Information about the user who made the last update.
|
|
163
155
|
*
|
|
164
|
-
* @property {string} userId - User ID.
|
|
165
|
-
* @property {string} userName - User name.
|
|
166
|
-
* @property {string} name - First name.
|
|
167
|
-
* @property {string} lastName - Last name.
|
|
168
|
-
* @property {string} fullName - Full name.
|
|
169
|
-
* @property {string} initials - Initials.
|
|
170
|
-
* @property {string} email - User email.
|
|
171
|
-
* @property {string} avatarUrl - User avatar image URL.
|
|
172
156
|
* @readonly
|
|
173
157
|
*/
|
|
174
|
-
get updatedBy():
|
|
158
|
+
get updatedBy(): IShortUserDesc;
|
|
175
159
|
/**
|
|
176
160
|
* Zero-based file version number for version files. The original file has version `0`.
|
|
177
161
|
*/
|
|
@@ -484,6 +468,16 @@ export declare class File {
|
|
|
484
468
|
/**
|
|
485
469
|
* Creates a new file permission.
|
|
486
470
|
*
|
|
471
|
+
* @example <caption>Grant the specified user permission to "update" the file.</caption>
|
|
472
|
+
* const action = "update";
|
|
473
|
+
* const grantedTo = [{ user: { id: myUser.id, email: myUser.email } }];
|
|
474
|
+
* await file.createPermission(action, grantedTo);
|
|
475
|
+
*
|
|
476
|
+
* @example <caption>Add a file to the specified project in `read-only` mode.</caption>
|
|
477
|
+
* const actions = ["read", "readSourceFile"];
|
|
478
|
+
* const grantedTo = [{ project: { id: myProject.id, name: myProject.name } }];
|
|
479
|
+
* await file.createPermission(actions, grantedTo);
|
|
480
|
+
*
|
|
487
481
|
* @param actions - Actions are allowed to be performed on a file with this permission:
|
|
488
482
|
*
|
|
489
483
|
* - `read` - The ability to read file description, geometry data and properties.
|
|
@@ -492,10 +486,10 @@ export declare class File {
|
|
|
492
486
|
* - `readViewpoint` - The ability to read file viewpoints.
|
|
493
487
|
* - `createViewpoint` - The ability to create file viewpoints.
|
|
494
488
|
*
|
|
495
|
-
* @param grantedTo - A list of
|
|
489
|
+
* @param grantedTo - A list of entities that will get access to the file.
|
|
496
490
|
* @param _public - Specifies whether all users have access to the file or not.
|
|
497
491
|
*/
|
|
498
|
-
createPermission(actions: string | string[], grantedTo:
|
|
492
|
+
createPermission(actions: string | string[], grantedTo: IGrantedTo[], _public: boolean): Promise<Permission>;
|
|
499
493
|
/**
|
|
500
494
|
* Removes the specified permission from the file.
|
|
501
495
|
*
|
package/lib/Api/HttpClient.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare class HttpClient implements IHttpClient {
|
|
|
11
11
|
delete(relativePath: string): Promise<Response>;
|
|
12
12
|
uploadFile(relativePath: string, file: File, onProgress?: (progress: number) => void): Promise<XMLHttpRequest>;
|
|
13
13
|
downloadFile(relativePath: string, onProgress?: (progress: number, chunk: Uint8Array) => void, signal?: AbortSignal): Promise<Response>;
|
|
14
|
-
downloadFileRange(relativePath: string,
|
|
14
|
+
downloadFileRange(relativePath: string, reserved: number, ranges: Array<{
|
|
15
15
|
begin: number;
|
|
16
16
|
end: number;
|
|
17
17
|
requestId: number;
|
package/lib/Api/IFile.d.ts
CHANGED
|
@@ -43,3 +43,34 @@ export interface IFileVersionInfo {
|
|
|
43
43
|
size: number;
|
|
44
44
|
ownerId: string;
|
|
45
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Defines the entity, that will have access to the file.
|
|
48
|
+
*/
|
|
49
|
+
export interface IGrantedTo {
|
|
50
|
+
/**
|
|
51
|
+
* The user entry that has access to the file.
|
|
52
|
+
*/
|
|
53
|
+
user?: {
|
|
54
|
+
/**
|
|
55
|
+
* User ID.
|
|
56
|
+
*/
|
|
57
|
+
id: string;
|
|
58
|
+
/**
|
|
59
|
+
* User email.
|
|
60
|
+
*/
|
|
61
|
+
email: string;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* The project entry that has access to the file.
|
|
65
|
+
*/
|
|
66
|
+
project?: {
|
|
67
|
+
/**
|
|
68
|
+
* Project ID.
|
|
69
|
+
*/
|
|
70
|
+
id: string;
|
|
71
|
+
/**
|
|
72
|
+
* Project name.
|
|
73
|
+
*/
|
|
74
|
+
name: string;
|
|
75
|
+
};
|
|
76
|
+
}
|
package/lib/Api/IHttpClient.d.ts
CHANGED
|
@@ -1,15 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Defines the HTTP client used to send requests to the REST API server.
|
|
3
|
+
*/
|
|
1
4
|
export interface IHttpClient {
|
|
5
|
+
/**
|
|
6
|
+
* REST API server base URL.
|
|
7
|
+
*/
|
|
2
8
|
serverUrl: string;
|
|
9
|
+
/**
|
|
10
|
+
* Request HTTP headers. You can add specific headers after user log in.
|
|
11
|
+
*
|
|
12
|
+
* The following headers are added automatically:
|
|
13
|
+
*
|
|
14
|
+
* - `Authorization`- Added after user log in.
|
|
15
|
+
* - `Content-Type` - Added before sending `POST` and `PUT` request according the request body.
|
|
16
|
+
*/
|
|
3
17
|
headers: HeadersInit;
|
|
18
|
+
/**
|
|
19
|
+
* Current logged in user ID.
|
|
20
|
+
*/
|
|
4
21
|
signInUserId: string;
|
|
22
|
+
/**
|
|
23
|
+
* `True` if the current logged in user is and administrator.
|
|
24
|
+
*/
|
|
5
25
|
signInUserIsAdmin: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Sends the GET request to the specified endpoint.
|
|
28
|
+
*
|
|
29
|
+
* @param relativePath - Endpoint relative path.
|
|
30
|
+
* @param signal - An
|
|
31
|
+
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
|
|
32
|
+
* signal, which can be used to abort waiting as desired.
|
|
33
|
+
*/
|
|
6
34
|
get(relativePath: string, signal?: AbortSignal): Promise<Response>;
|
|
35
|
+
/**
|
|
36
|
+
* Sends the POST request to the specified endpoint.
|
|
37
|
+
*
|
|
38
|
+
* @param relativePath - Endpoint relative path.
|
|
39
|
+
* @param body - Request body. Can be
|
|
40
|
+
* {@link https://developer.mozilla.org/docs/Web/API/FormData | FormData},
|
|
41
|
+
* {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer | ArrayBuffer},
|
|
42
|
+
* {@link https://developer.mozilla.org/docs/Web/API/Blob/Blob | Blob}, JSON object or plain text.
|
|
43
|
+
*/
|
|
7
44
|
post(relativePath: string, body?: BodyInit | object): Promise<Response>;
|
|
45
|
+
/**
|
|
46
|
+
* Sends the PUT request to the specified endpoint.
|
|
47
|
+
*
|
|
48
|
+
* @param relativePath - Endpoint relative path.
|
|
49
|
+
* @param body - Request body. Can be
|
|
50
|
+
* {@link https://developer.mozilla.org/docs/Web/API/FormData | FormData},
|
|
51
|
+
* {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer | ArrayBuffer},
|
|
52
|
+
* {@link https://developer.mozilla.org/docs/Web/API/Blob/Blob | Blob}, JSON object or plain text.
|
|
53
|
+
*/
|
|
8
54
|
put(relativePath: string, body?: BodyInit | object): Promise<Response>;
|
|
55
|
+
/**
|
|
56
|
+
* Sends the DELETE request to the specified endpoint.
|
|
57
|
+
*
|
|
58
|
+
* @param relativePath - Endpoint relative path.
|
|
59
|
+
*/
|
|
9
60
|
delete(relativePath: string): Promise<Response>;
|
|
61
|
+
/**
|
|
62
|
+
* Upload a file to the server.
|
|
63
|
+
*
|
|
64
|
+
* @param relativePath - File relative path.
|
|
65
|
+
* @param file - {@link https://developer.mozilla.org/docs/Web/API/File | Web API File} object
|
|
66
|
+
* are generally retrieved from a
|
|
67
|
+
* {@link https://developer.mozilla.org/docs/Web/API/FileList | FileList} object returned as
|
|
68
|
+
* a result of a user selecting files using the HTML `<input>` element.
|
|
69
|
+
* @param onProgress - Upload progress callback.
|
|
70
|
+
*/
|
|
10
71
|
uploadFile(relativePath: string, file: globalThis.File, onProgress?: (progress: number) => void): Promise<XMLHttpRequest>;
|
|
72
|
+
/**
|
|
73
|
+
* Downloads the specified file from the server.
|
|
74
|
+
*
|
|
75
|
+
* @param relativePath - File relative path.
|
|
76
|
+
* @param onProgress - Download progress callback.
|
|
77
|
+
* @param signal - An
|
|
78
|
+
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
|
|
79
|
+
* signal. Allows to communicate with a fetch request and abort it if desired.
|
|
80
|
+
*/
|
|
11
81
|
downloadFile(relativePath: string, onProgress?: (progress: number, chunk: Uint8Array) => void, signal?: AbortSignal): Promise<Response>;
|
|
12
|
-
|
|
82
|
+
/**
|
|
83
|
+
* Downloads a part of file from the server.
|
|
84
|
+
*
|
|
85
|
+
* @param relativePath - File relative path.
|
|
86
|
+
* @param reserved - Reserved, do not use.
|
|
87
|
+
* @param ranges - A range of resource file contents to download.
|
|
88
|
+
* @param onProgress - Download progress callback.
|
|
89
|
+
* @param signal - An
|
|
90
|
+
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
|
|
91
|
+
* signal. Allows to communicate with a fetch request and abort it if desired.
|
|
92
|
+
*/
|
|
93
|
+
downloadFileRange(relativePath: string, reserved: number, ranges: Array<{
|
|
13
94
|
begin: number;
|
|
14
95
|
end: number;
|
|
15
96
|
requestId: number;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Defines the {@link Role | role} actions are allowed to be performed.
|
|
3
|
+
*/
|
|
4
|
+
export interface IRoleActions {
|
|
5
|
+
/**
|
|
6
|
+
* Defines what actions are allowed to be performed at the project level. The available
|
|
7
|
+
* actions include:
|
|
8
|
+
*
|
|
9
|
+
* - `update` - The ability to update the project details.
|
|
10
|
+
* - `createTopic` - The ability to create a new topic.
|
|
11
|
+
* - `createDocument` - The ability to create a new document.
|
|
12
|
+
*/
|
|
13
|
+
projectActions?: string[];
|
|
14
|
+
/**
|
|
15
|
+
* Defines what actions are allowed to be performed at the topic level. The available actions include:
|
|
16
|
+
*
|
|
17
|
+
* - `update` - The ability to update the topic.
|
|
18
|
+
* - `updateBimSnippet` - The ability to update the BIM snippet for topics.
|
|
19
|
+
* - `updateRelatedTopics` - The ability to update the collection of related topics.
|
|
20
|
+
* - `updateDocumentReferences` - The ability to update the collection of document references.
|
|
21
|
+
* - `updateFiles` - The ability to update the file header.
|
|
22
|
+
* - `createComment` - The ability to create a comment.
|
|
23
|
+
* - `createViewpoint` - The ability to create a new viewpoint.
|
|
24
|
+
*/
|
|
25
|
+
topicActions?: string[];
|
|
26
|
+
/**
|
|
27
|
+
* Defines what actions are allowed to be performed at the comment level. The available
|
|
28
|
+
* actions include:
|
|
29
|
+
*
|
|
30
|
+
* - `update` - The ability to update the comment.
|
|
31
|
+
* - `delete` - The ability to delete the comment.
|
|
32
|
+
*/
|
|
33
|
+
commentActions?: string[];
|
|
34
|
+
/**
|
|
35
|
+
* Defines what actions are allowed to be performed at the viewpoint level. The available
|
|
36
|
+
* actions include:
|
|
37
|
+
*
|
|
38
|
+
* - `update` - The ability to update the viewpoint.
|
|
39
|
+
* - `delete` - The ability to delete the viewpoint.
|
|
40
|
+
*/
|
|
41
|
+
viewpointActions?: string[];
|
|
42
|
+
/**
|
|
43
|
+
* Defines what actions are allowed to be performed at the groups level. The available actions include:
|
|
44
|
+
*
|
|
45
|
+
* - `create` - The ability to create the group.
|
|
46
|
+
* - `update` - The ability to update the group.
|
|
47
|
+
* - `updateUser` - The ability to add users to the group.
|
|
48
|
+
* - `delete` - The ability to delete the group.
|
|
49
|
+
*/
|
|
50
|
+
odaGroupActions?: string[];
|
|
51
|
+
/**
|
|
52
|
+
* Defines what actions are allowed to be performed at the roles level. The available actions include:
|
|
53
|
+
*
|
|
54
|
+
* - `create` - The ability to create the role.
|
|
55
|
+
* - `update` - The ability to update the role.
|
|
56
|
+
* - `delete` - The ability to delete the role.
|
|
57
|
+
*/
|
|
58
|
+
odaRoleActions?: string[];
|
|
59
|
+
}
|
package/lib/Api/IUser.d.ts
CHANGED
|
@@ -1,10 +1,39 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Defines brief user information.
|
|
3
|
+
*/
|
|
4
|
+
export interface IShortUserDesc {
|
|
5
|
+
/**
|
|
6
|
+
* Unique user ID.
|
|
7
|
+
*/
|
|
2
8
|
userId: string;
|
|
9
|
+
/**
|
|
10
|
+
* User name.
|
|
11
|
+
*/
|
|
3
12
|
userName: string;
|
|
13
|
+
/**
|
|
14
|
+
* First name.
|
|
15
|
+
*/
|
|
4
16
|
name: string;
|
|
17
|
+
/**
|
|
18
|
+
* Last name.
|
|
19
|
+
*/
|
|
5
20
|
lastName: string;
|
|
21
|
+
/**
|
|
22
|
+
* User email.
|
|
23
|
+
*/
|
|
6
24
|
email: string;
|
|
25
|
+
/**
|
|
26
|
+
* User avatar image URL or empty string if the user does not have an avatar.
|
|
27
|
+
*/
|
|
7
28
|
avatarUrl?: string;
|
|
29
|
+
/**
|
|
30
|
+
* User full name. Contains the user's first and last name. If first name and last names are
|
|
31
|
+
* empty, contains the user name.
|
|
32
|
+
*/
|
|
8
33
|
fullName?: string;
|
|
34
|
+
/**
|
|
35
|
+
* User initials. Contains a first letters of the user's first and last names. If first name
|
|
36
|
+
* and last names are empty, contains the first letter of the user name.
|
|
37
|
+
*/
|
|
9
38
|
initials?: string;
|
|
10
39
|
}
|
package/lib/Api/Job.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { IHttpClient } from "./IHttpClient";
|
|
2
2
|
/**
|
|
3
|
-
* Provides properties and methods for obtaining information about a job on the
|
|
3
|
+
* Provides properties and methods for obtaining information about a job on the Open Cloud Server.
|
|
4
4
|
*/
|
|
5
5
|
export declare class Job {
|
|
6
6
|
private _data;
|
|
7
7
|
httpClient: IHttpClient;
|
|
8
8
|
/**
|
|
9
9
|
* @param data - Raw job data received from the server.
|
|
10
|
-
* @param httpClient - HTTP client instance used to send
|
|
10
|
+
* @param httpClient - HTTP client instance used to send requests to the REST API server.
|
|
11
11
|
*/
|
|
12
12
|
constructor(data: any, httpClient: IHttpClient);
|
|
13
13
|
protected internalGet(): Promise<Response>;
|
package/lib/Api/Member.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IHttpClient } from "./IHttpClient";
|
|
2
|
-
import {
|
|
2
|
+
import { IShortUserDesc } from "./IUser";
|
|
3
3
|
/**
|
|
4
4
|
* Provides properties and methods for obtaining information about a {@link User | user} who has
|
|
5
5
|
* access to the {@link Project | project}.
|
|
@@ -11,7 +11,7 @@ export declare class Member {
|
|
|
11
11
|
/**
|
|
12
12
|
* @param data - Raw member data received from the server.
|
|
13
13
|
* @param projectId - Owner project ID.
|
|
14
|
-
* @param httpClient - HTTP client instance used to send
|
|
14
|
+
* @param httpClient - HTTP client instance used to send requests to the REST API server.
|
|
15
15
|
*/
|
|
16
16
|
constructor(data: any, projectId: string, httpClient: IHttpClient);
|
|
17
17
|
private internalGet;
|
|
@@ -31,7 +31,8 @@ export declare class Member {
|
|
|
31
31
|
*/
|
|
32
32
|
get id(): string;
|
|
33
33
|
/**
|
|
34
|
-
* Member role. See {@link Project.getRoles | Project.getRoles()} for
|
|
34
|
+
* Member role name in the project. See {@link Project.getRoles | Project.getRoles()} for list
|
|
35
|
+
* of project roles.
|
|
35
36
|
*/
|
|
36
37
|
get role(): string;
|
|
37
38
|
set role(value: string);
|
|
@@ -44,17 +45,9 @@ export declare class Member {
|
|
|
44
45
|
/**
|
|
45
46
|
* User information.
|
|
46
47
|
*
|
|
47
|
-
* @property {string} userId - User ID.
|
|
48
|
-
* @property {string} userName - User name.
|
|
49
|
-
* @property {string} name - First name.
|
|
50
|
-
* @property {string} lastName - Last name.
|
|
51
|
-
* @property {string} fullName - Full name.
|
|
52
|
-
* @property {string} initials - Initials.
|
|
53
|
-
* @property {string} email - User email.
|
|
54
|
-
* @property {string} avatarUrl - User avatar image URL.
|
|
55
48
|
* @readonly
|
|
56
49
|
*/
|
|
57
|
-
get user():
|
|
50
|
+
get user(): IShortUserDesc;
|
|
58
51
|
/**
|
|
59
52
|
* Reloads member data from the server.
|
|
60
53
|
*/
|
package/lib/Api/Permission.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IHttpClient } from "./IHttpClient";
|
|
2
|
+
import { IGrantedTo } from "./IFile";
|
|
2
3
|
/**
|
|
3
4
|
* Provides properties and methods for obtaining information about {@link File | file} actions
|
|
4
5
|
* granted to a specific {@link User | users}, or project {@link Member | member}.
|
|
@@ -10,7 +11,7 @@ export declare class Permission {
|
|
|
10
11
|
/**
|
|
11
12
|
* @param data - Raw permission data received from the server.
|
|
12
13
|
* @param fileId - Owner file ID.
|
|
13
|
-
* @param httpClient - HTTP client instance used to send
|
|
14
|
+
* @param httpClient - HTTP client instance used to send requests to the REST API server.
|
|
14
15
|
*/
|
|
15
16
|
constructor(data: any, fileId: string, httpClient: IHttpClient);
|
|
16
17
|
private internalGet;
|
|
@@ -41,22 +42,10 @@ export declare class Permission {
|
|
|
41
42
|
*/
|
|
42
43
|
get id(): string;
|
|
43
44
|
/**
|
|
44
|
-
*
|
|
45
|
-
* project that will get access to the file.
|
|
46
|
-
*
|
|
47
|
-
* @typedef {any} Principial
|
|
48
|
-
* @property {any} user - The user entry that get access to the file.
|
|
49
|
-
* @property {string} user.id - User ID.
|
|
50
|
-
* @property {string} user.name - User name.
|
|
51
|
-
* @property {any} project - The project entry that get access to the file.
|
|
52
|
-
* @property {string} project.id - Project ID.
|
|
53
|
-
* @property {string} project.name - Project name.
|
|
54
|
-
*/
|
|
55
|
-
/**
|
|
56
|
-
* A list of principials that will get access to the file.
|
|
45
|
+
* A list of entities that will get access to the file.
|
|
57
46
|
*/
|
|
58
|
-
get grantedTo():
|
|
59
|
-
set grantedTo(value:
|
|
47
|
+
get grantedTo(): IGrantedTo[];
|
|
48
|
+
set grantedTo(value: IGrantedTo[]);
|
|
60
49
|
/**
|
|
61
50
|
* Specifies whether all users have access to the file or not.
|
|
62
51
|
*/
|
package/lib/Api/Project.d.ts
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { IHttpClient } from "./IHttpClient";
|
|
2
|
-
import {
|
|
2
|
+
import { IShortUserDesc } from "./IUser";
|
|
3
3
|
import { Role } from "./Role";
|
|
4
|
+
import { IRoleActions } from "./IRole";
|
|
4
5
|
import { Member } from "./Member";
|
|
5
6
|
/**
|
|
6
|
-
* Provides properties and methods for obtaining information about a project on the
|
|
7
|
-
* managing its {@link Role | roles}, {@link Member | members} and models.
|
|
7
|
+
* Provides properties and methods for obtaining information about a project on the Open Cloud
|
|
8
|
+
* Server and managing its {@link Role | roles}, {@link Member | members} and models.
|
|
8
9
|
*/
|
|
9
10
|
export declare class Project {
|
|
10
11
|
private _data;
|
|
11
12
|
httpClient: IHttpClient;
|
|
12
13
|
/**
|
|
13
14
|
* @param data - Raw project data received from the server.
|
|
14
|
-
* @param httpClient - HTTP client instance used to send
|
|
15
|
+
* @param httpClient - HTTP client instance used to send requests to the REST API server.
|
|
15
16
|
*/
|
|
16
17
|
constructor(data: any, httpClient: IHttpClient);
|
|
17
18
|
protected internalGet(relativePath: string): Promise<Response>;
|
|
@@ -89,17 +90,9 @@ export declare class Project {
|
|
|
89
90
|
/**
|
|
90
91
|
* Project owner information.
|
|
91
92
|
*
|
|
92
|
-
* @property {string} userId - User ID.
|
|
93
|
-
* @property {string} userName - User name.
|
|
94
|
-
* @property {string} name - First name.
|
|
95
|
-
* @property {string} lastName - Last name.
|
|
96
|
-
* @property {string} fullName - Full name.
|
|
97
|
-
* @property {string} initials - Initials.
|
|
98
|
-
* @property {string} email - User email.
|
|
99
|
-
* @property {string} avatarUrl - User avatar image URL.
|
|
100
93
|
* @readonly
|
|
101
94
|
*/
|
|
102
|
-
get owner():
|
|
95
|
+
get owner(): IShortUserDesc;
|
|
103
96
|
/**
|
|
104
97
|
* Project preview image URL or empty string if the project does not have a preview. Use
|
|
105
98
|
* {@link Project.setPreview | setPreview()} to change preview image.
|
|
@@ -184,10 +177,9 @@ export declare class Project {
|
|
|
184
177
|
*
|
|
185
178
|
* @param name - Role name.
|
|
186
179
|
* @param description - Role description.
|
|
187
|
-
* @param permissions - Actions are allowed to be performed
|
|
188
|
-
* more details.
|
|
180
|
+
* @param permissions - Actions are allowed to be performed for the role.
|
|
189
181
|
*/
|
|
190
|
-
createRole(name: string, description: string, permissions:
|
|
182
|
+
createRole(name: string, description: string, permissions: IRoleActions): Promise<Role>;
|
|
191
183
|
/**
|
|
192
184
|
* Deletes the specified project role.
|
|
193
185
|
*
|
|
@@ -209,7 +201,7 @@ export declare class Project {
|
|
|
209
201
|
* Add a user to the project to become a member and have permission to perform actions.
|
|
210
202
|
*
|
|
211
203
|
* @param userId - User ID.
|
|
212
|
-
* @param role - Role name from the list of project roles.
|
|
204
|
+
* @param role - Role name from the list of project {@link getRoles | roles}.
|
|
213
205
|
*/
|
|
214
206
|
addMember(userId: string, role: string): Promise<Member>;
|
|
215
207
|
/**
|
|
@@ -232,8 +224,11 @@ export declare class Project {
|
|
|
232
224
|
* @property {string} file.reference - File ID.
|
|
233
225
|
*/
|
|
234
226
|
/**
|
|
235
|
-
* Returns a list of project files.
|
|
236
|
-
*
|
|
227
|
+
* Returns a list of project files.
|
|
228
|
+
*
|
|
229
|
+
* This list contains all files that the project has access to. To add a file to this list,
|
|
230
|
+
* create a {@link IGrantedTo.project | project} permission on the file using
|
|
231
|
+
* {@link File.createPermission | File.createPermission()}.
|
|
237
232
|
*/
|
|
238
233
|
getFilesInformation(): Promise<any[]>;
|
|
239
234
|
}
|
package/lib/Api/Role.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IHttpClient } from "./IHttpClient";
|
|
2
|
+
import { IRoleActions } from "./IRole";
|
|
2
3
|
/**
|
|
3
4
|
* A role determines what actions allowed to be performed by {@link User | users} on a
|
|
4
5
|
* {@link Project | project}.
|
|
@@ -10,7 +11,7 @@ export declare class Role {
|
|
|
10
11
|
/**
|
|
11
12
|
* @param data - Raw role data received from the server.
|
|
12
13
|
* @param projectId - Owner project ID.
|
|
13
|
-
* @param httpClient - HTTP client instance used to send
|
|
14
|
+
* @param httpClient - HTTP client instance used to send requests to the REST API server.
|
|
14
15
|
*/
|
|
15
16
|
constructor(data: any, projectId: string, httpClient: IHttpClient);
|
|
16
17
|
private internalGet;
|
|
@@ -35,23 +36,9 @@ export declare class Role {
|
|
|
35
36
|
set name(value: string);
|
|
36
37
|
/**
|
|
37
38
|
* Role actions are allowed to be performed.
|
|
38
|
-
*
|
|
39
|
-
* @property {string[]} projectActions - Actions are allowed to be performed at the project
|
|
40
|
-
* level: `update`, `createTopic`, `createDocument`.
|
|
41
|
-
* @property {string[]} topicActions - Actions are allowed to be performed at the topic
|
|
42
|
-
* level: `update`, `updateBimSnippet`, `updateRelatedTopics`, `updateDocumentReferences`,
|
|
43
|
-
* `updateFiles`, `createComment`, `createViewpoint`, `delete`.
|
|
44
|
-
* @property {string[]} commentActions - Actions are allowed to be performed at the comment
|
|
45
|
-
* level: `update`, `delete`.
|
|
46
|
-
* @property {string[]} viewpointActions - Actions are allowed to be performed at the
|
|
47
|
-
* viewpoint level: `delete`.
|
|
48
|
-
* @property {string[]} odaGroupActions - Actions are allowed to be performed at the members
|
|
49
|
-
* level: `update`, `delete`.
|
|
50
|
-
* @property {string[]} odaRoleActions - Actions are allowed to be performed at the roles
|
|
51
|
-
* level: `update`, `delete`.
|
|
52
39
|
*/
|
|
53
|
-
get permissions():
|
|
54
|
-
set permissions(value:
|
|
40
|
+
get permissions(): IRoleActions;
|
|
41
|
+
set permissions(value: IRoleActions);
|
|
55
42
|
/**
|
|
56
43
|
* Reloads role data from the server.
|
|
57
44
|
*/
|