@inweb/client 25.8.16 → 25.8.19
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/README.md +33 -12
- package/dist/client.js +378 -337
- package/dist/client.js.map +1 -1
- package/dist/client.min.js +1 -1
- package/dist/client.module.js +13 -5
- package/dist/client.module.js.map +1 -1
- package/lib/Api/Assembly.d.ts +63 -61
- package/lib/Api/ClashTest.d.ts +29 -27
- package/lib/Api/Client.d.ts +85 -76
- package/lib/Api/ClientEvents.d.ts +1 -1
- package/lib/Api/File.d.ts +95 -73
- package/lib/Api/IAssembly.d.ts +26 -0
- package/lib/Api/Job.d.ts +7 -8
- package/lib/Api/Member.d.ts +9 -8
- package/lib/Api/Model.d.ts +19 -15
- package/lib/Api/Permission.d.ts +15 -15
- package/lib/Api/Project.d.ts +31 -23
- package/lib/Api/Role.d.ts +9 -8
- package/lib/Api/User.d.ts +21 -20
- package/lib/index.d.ts +1 -0
- package/package.json +2 -2
- package/src/Api/Assembly.ts +63 -62
- package/src/Api/ClashTest.ts +40 -29
- package/src/Api/Client.ts +89 -77
- package/src/Api/ClientEvents.ts +1 -1
- package/src/Api/File.ts +94 -72
- package/src/Api/IAssembly.ts +27 -0
- package/src/Api/Job.ts +9 -13
- package/src/Api/Member.ts +9 -8
- package/src/Api/Model.ts +19 -15
- package/src/Api/Permission.ts +15 -15
- package/src/Api/Project.ts +31 -23
- package/src/Api/Role.ts +9 -8
- package/src/Api/User.ts +21 -20
- package/src/index.ts +1 -0
package/src/Api/Model.ts
CHANGED
|
@@ -24,9 +24,10 @@
|
|
|
24
24
|
import { IHttpClient } from "./IHttpClient";
|
|
25
25
|
import type { File } from "./File";
|
|
26
26
|
import type { Assembly } from "./Assembly";
|
|
27
|
+
import type { IModelTransformMatrix } from "./IAssembly";
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
|
-
*
|
|
30
|
+
* Provides properties and methods for working with view of the file or assembly. For example,
|
|
30
31
|
* for `dwg` it is a `Model` space or layout, and for `rvt` files it is a `3D` view.
|
|
31
32
|
*/
|
|
32
33
|
export class Model {
|
|
@@ -36,8 +37,8 @@ export class Model {
|
|
|
36
37
|
public path: string;
|
|
37
38
|
|
|
38
39
|
/**
|
|
39
|
-
* @param data -
|
|
40
|
-
* @param file - The
|
|
40
|
+
* @param data - Raw model data received from the server.
|
|
41
|
+
* @param file - The file/assembly instance that owns the model.
|
|
41
42
|
*/
|
|
42
43
|
constructor(data: any, file: File | Assembly) {
|
|
43
44
|
this.path = `${file.path}/downloads`;
|
|
@@ -160,22 +161,22 @@ export class Model {
|
|
|
160
161
|
*
|
|
161
162
|
* @param handle - Model handle.
|
|
162
163
|
*/
|
|
163
|
-
getModelTransformMatrix(handle: string):
|
|
164
|
+
getModelTransformMatrix(handle: string): IModelTransformMatrix {
|
|
164
165
|
return this.file.getModelTransformMatrix(handle);
|
|
165
166
|
}
|
|
166
167
|
|
|
167
168
|
/**
|
|
168
|
-
*
|
|
169
|
+
* Sets or removes a model transformation.
|
|
169
170
|
*
|
|
170
171
|
* @param handle - Model handle.
|
|
171
|
-
* @param transform - Transformation matrix.
|
|
172
|
+
* @param transform - Transformation matrix. Specify `undefined` to remove transformation.
|
|
172
173
|
*/
|
|
173
|
-
setModelTransformMatrix(handle: string, transform:
|
|
174
|
+
setModelTransformMatrix(handle: string, transform: IModelTransformMatrix): Promise<this> {
|
|
174
175
|
return this.file.setModelTransformMatrix(handle, transform).then(() => this);
|
|
175
176
|
}
|
|
176
177
|
|
|
177
178
|
/**
|
|
178
|
-
* Returns
|
|
179
|
+
* Returns a list of viewpoints of the owner file/assembly.
|
|
179
180
|
*/
|
|
180
181
|
getViewpoints(): Promise<any[]> {
|
|
181
182
|
return this._file
|
|
@@ -188,7 +189,8 @@ export class Model {
|
|
|
188
189
|
}
|
|
189
190
|
|
|
190
191
|
/**
|
|
191
|
-
*
|
|
192
|
+
* Adds a new viewpoint to the owner file/assembly. To create a new viewpoint use
|
|
193
|
+
* `Viewer.createViewpoint()`.
|
|
192
194
|
*
|
|
193
195
|
* @param viewpoint - Viewpoint.
|
|
194
196
|
*/
|
|
@@ -200,7 +202,7 @@ export class Model {
|
|
|
200
202
|
}
|
|
201
203
|
|
|
202
204
|
/**
|
|
203
|
-
*
|
|
205
|
+
* Deletes the specified viewpoint from the owner file/assembly.
|
|
204
206
|
*
|
|
205
207
|
* @param guid - Viewpoint GUID.
|
|
206
208
|
* @returns Returns the raw data of a deleted viewpoint.
|
|
@@ -220,7 +222,7 @@ export class Model {
|
|
|
220
222
|
}
|
|
221
223
|
|
|
222
224
|
/**
|
|
223
|
-
* Returns snapshot data.
|
|
225
|
+
* Returns viewpoint snapshot data.
|
|
224
226
|
*
|
|
225
227
|
* @param guid - Viewpoint GUID.
|
|
226
228
|
* @param bitmapGuid - Bitmap GUID.
|
|
@@ -230,8 +232,8 @@ export class Model {
|
|
|
230
232
|
}
|
|
231
233
|
|
|
232
234
|
/**
|
|
233
|
-
*
|
|
234
|
-
*
|
|
235
|
+
* Downloads a resource file. Resource files are files that contain model scene descriptions,
|
|
236
|
+
* or geometry data.
|
|
235
237
|
*
|
|
236
238
|
* @param dataId - Resource file name.
|
|
237
239
|
* @param onProgress - Download progress callback.
|
|
@@ -248,7 +250,7 @@ export class Model {
|
|
|
248
250
|
}
|
|
249
251
|
|
|
250
252
|
/**
|
|
251
|
-
*
|
|
253
|
+
* Downloads a part of resource file. Resource files are files that contain model scene
|
|
252
254
|
* descriptions, or geometry data.
|
|
253
255
|
*
|
|
254
256
|
* @param dataId - Resource file name.
|
|
@@ -318,7 +320,9 @@ export class Model {
|
|
|
318
320
|
}
|
|
319
321
|
|
|
320
322
|
/**
|
|
321
|
-
* Returns a list of references
|
|
323
|
+
* Returns a list of references of the owner file/assembly.
|
|
324
|
+
*
|
|
325
|
+
* References are images, fonts, or any other files to correct rendering of the file.
|
|
322
326
|
*
|
|
323
327
|
* @param signal - An
|
|
324
328
|
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
|
package/src/Api/Permission.ts
CHANGED
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
import { IHttpClient } from "./IHttpClient";
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
28
|
-
* {@link User | users},
|
|
27
|
+
* Provides properties and methods for obtaining information about {@link File | file} actions
|
|
28
|
+
* granted to a specific {@link User | users}, or project {@link Member | member}.
|
|
29
29
|
*/
|
|
30
30
|
export class Permission {
|
|
31
31
|
private _data: any;
|
|
@@ -33,9 +33,9 @@ export class Permission {
|
|
|
33
33
|
public httpClient: IHttpClient;
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
|
-
* @param data -
|
|
36
|
+
* @param data - Raw permission data received from the server.
|
|
37
37
|
* @param fileId - Owner file ID.
|
|
38
|
-
* @param httpClient -
|
|
38
|
+
* @param httpClient - HTTP client instance used to send REST API requests to the server.
|
|
39
39
|
*/
|
|
40
40
|
constructor(data: any, fileId: string, httpClient: IHttpClient) {
|
|
41
41
|
this.httpClient = httpClient;
|
|
@@ -58,11 +58,11 @@ export class Permission {
|
|
|
58
58
|
/**
|
|
59
59
|
* Defines what actions are allowed to be performed on a file with this permission:
|
|
60
60
|
*
|
|
61
|
-
* - `read` - The ability to read file description, geometry data and properties
|
|
62
|
-
* - `readSourceFile` - The ability to read source file
|
|
63
|
-
* - `write` - The ability to modify file name, description and references
|
|
64
|
-
* - `readViewpoint` - The ability to read file viewpoints
|
|
65
|
-
* - `createViewpoint` - The ability to create file viewpoints
|
|
61
|
+
* - `read` - The ability to read file description, geometry data and properties.
|
|
62
|
+
* - `readSourceFile` - The ability to read source file.
|
|
63
|
+
* - `write` - The ability to modify file name, description and references.
|
|
64
|
+
* - `readViewpoint` - The ability to read file viewpoints.
|
|
65
|
+
* - `createViewpoint` - The ability to create file viewpoints.
|
|
66
66
|
*/
|
|
67
67
|
get actions(): string[] {
|
|
68
68
|
return this.data.actions;
|
|
@@ -108,7 +108,7 @@ export class Permission {
|
|
|
108
108
|
*/
|
|
109
109
|
|
|
110
110
|
/**
|
|
111
|
-
* A
|
|
111
|
+
* A list of principials that will get access to the file.
|
|
112
112
|
*/
|
|
113
113
|
get grantedTo(): any[] {
|
|
114
114
|
return this.data.grantedTo;
|
|
@@ -130,7 +130,7 @@ export class Permission {
|
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
/**
|
|
133
|
-
*
|
|
133
|
+
* Reloads permission data from the server.
|
|
134
134
|
*/
|
|
135
135
|
async checkout(): Promise<this> {
|
|
136
136
|
const response = await this.internalGet();
|
|
@@ -139,7 +139,7 @@ export class Permission {
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
/**
|
|
142
|
-
*
|
|
142
|
+
* Updates permission data on the server.
|
|
143
143
|
*
|
|
144
144
|
* @param data - Raw permission data.
|
|
145
145
|
*/
|
|
@@ -150,7 +150,7 @@ export class Permission {
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
/**
|
|
153
|
-
*
|
|
153
|
+
* Removes a permission from the file.
|
|
154
154
|
*
|
|
155
155
|
* @returns Returns the raw data of a deleted permission.
|
|
156
156
|
*/
|
|
@@ -159,8 +159,8 @@ export class Permission {
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
/**
|
|
162
|
-
*
|
|
163
|
-
* the server after any changes.
|
|
162
|
+
* Saves permission properties changes to the server. Call this method to update permission
|
|
163
|
+
* data on the server after any property changes.
|
|
164
164
|
*/
|
|
165
165
|
save(): Promise<this> {
|
|
166
166
|
return this.update(this.data);
|
package/src/Api/Project.ts
CHANGED
|
@@ -28,15 +28,16 @@ import { Member } from "./Member";
|
|
|
28
28
|
import { userFullName, userInitials } from "./Utils";
|
|
29
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
33
|
*/
|
|
33
34
|
export class Project {
|
|
34
35
|
private _data: any;
|
|
35
36
|
public httpClient: IHttpClient;
|
|
36
37
|
|
|
37
38
|
/**
|
|
38
|
-
* @param data -
|
|
39
|
-
* @param httpClient -
|
|
39
|
+
* @param data - Raw project data received from the server.
|
|
40
|
+
* @param httpClient - HTTP client instance used to send REST API requests to the server.
|
|
40
41
|
*/
|
|
41
42
|
constructor(data: any, httpClient: IHttpClient) {
|
|
42
43
|
this.httpClient = httpClient;
|
|
@@ -62,11 +63,18 @@ export class Project {
|
|
|
62
63
|
/**
|
|
63
64
|
* Project features the user has access to.
|
|
64
65
|
*
|
|
65
|
-
* @property {string[]} project_actions - Actions are allowed to be performed: `update`,
|
|
66
|
-
* `createTopic`, `createDocument`.
|
|
67
66
|
* @readonly
|
|
68
67
|
*/
|
|
69
|
-
get authorization():
|
|
68
|
+
get authorization(): {
|
|
69
|
+
/**
|
|
70
|
+
* Actions are allowed to be performed:
|
|
71
|
+
*
|
|
72
|
+
* - `update` - The ability to update the project details.
|
|
73
|
+
* - `createTopic` - The ability to create a new topic.
|
|
74
|
+
* - `createDocument` - The ability to create a new document.
|
|
75
|
+
*/
|
|
76
|
+
project_actions: string[];
|
|
77
|
+
} {
|
|
70
78
|
return this.data.authorization;
|
|
71
79
|
}
|
|
72
80
|
|
|
@@ -199,7 +207,7 @@ export class Project {
|
|
|
199
207
|
}
|
|
200
208
|
|
|
201
209
|
/**
|
|
202
|
-
* `true` if project is
|
|
210
|
+
* `true` if project is shared project.
|
|
203
211
|
*/
|
|
204
212
|
get public(): boolean {
|
|
205
213
|
return this.data.public;
|
|
@@ -241,7 +249,7 @@ export class Project {
|
|
|
241
249
|
}
|
|
242
250
|
|
|
243
251
|
/**
|
|
244
|
-
*
|
|
252
|
+
* Reloads project data from the server.
|
|
245
253
|
*/
|
|
246
254
|
async checkout(): Promise<this> {
|
|
247
255
|
const response = await this.internalGet("");
|
|
@@ -250,7 +258,7 @@ export class Project {
|
|
|
250
258
|
}
|
|
251
259
|
|
|
252
260
|
/**
|
|
253
|
-
*
|
|
261
|
+
* Updates project data on the server.
|
|
254
262
|
*
|
|
255
263
|
* @param data - Raw project data.
|
|
256
264
|
*/
|
|
@@ -261,7 +269,7 @@ export class Project {
|
|
|
261
269
|
}
|
|
262
270
|
|
|
263
271
|
/**
|
|
264
|
-
*
|
|
272
|
+
* Deletes a project from the server.
|
|
265
273
|
*
|
|
266
274
|
* @returns Returns the raw data of a deleted project.
|
|
267
275
|
*/
|
|
@@ -279,23 +287,23 @@ export class Project {
|
|
|
279
287
|
}
|
|
280
288
|
|
|
281
289
|
/**
|
|
282
|
-
*
|
|
283
|
-
* server after any changes.
|
|
290
|
+
* Saves project properties changes to the server. Call this method to update project data on
|
|
291
|
+
* the server after any property changes.
|
|
284
292
|
*/
|
|
285
293
|
save(): Promise<this> {
|
|
286
294
|
return this.update(this.data);
|
|
287
295
|
}
|
|
288
296
|
|
|
289
297
|
/**
|
|
290
|
-
*
|
|
298
|
+
* Sets or removes the project preview.
|
|
291
299
|
*
|
|
292
300
|
* @param image - Preview image. Can be a
|
|
293
301
|
* {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}
|
|
294
302
|
* string,
|
|
295
303
|
* {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer | ArrayBuffer},
|
|
296
|
-
* {@link https://developer.mozilla.org/docs/Web/API/Blob/Blob | Blob} or
|
|
297
|
-
* {@link https://developer.mozilla.org/docs/Web/API/File | File} object. Setting
|
|
298
|
-
* `image` to `null` will remove the preview.
|
|
304
|
+
* {@link https://developer.mozilla.org/docs/Web/API/Blob/Blob | Blob} or
|
|
305
|
+
* {@link https://developer.mozilla.org/docs/Web/API/File | Web API File} object. Setting
|
|
306
|
+
* the `image` to `null` will remove the preview.
|
|
299
307
|
*/
|
|
300
308
|
|
|
301
309
|
async setPreview(image?: BodyInit | null): Promise<any> {
|
|
@@ -309,7 +317,7 @@ export class Project {
|
|
|
309
317
|
}
|
|
310
318
|
|
|
311
319
|
/**
|
|
312
|
-
*
|
|
320
|
+
* Removes the project preview.
|
|
313
321
|
*/
|
|
314
322
|
async deletePreview(): Promise<this> {
|
|
315
323
|
const response = await this.internalDelete("/preview");
|
|
@@ -328,7 +336,7 @@ export class Project {
|
|
|
328
336
|
}
|
|
329
337
|
|
|
330
338
|
/**
|
|
331
|
-
* Returns the role
|
|
339
|
+
* Returns information about the specified project role.
|
|
332
340
|
*
|
|
333
341
|
* @param name - Role name.
|
|
334
342
|
*/
|
|
@@ -339,7 +347,7 @@ export class Project {
|
|
|
339
347
|
}
|
|
340
348
|
|
|
341
349
|
/**
|
|
342
|
-
*
|
|
350
|
+
* Creates a new project role.
|
|
343
351
|
*
|
|
344
352
|
* @param name - Role name.
|
|
345
353
|
* @param description - Role description.
|
|
@@ -357,7 +365,7 @@ export class Project {
|
|
|
357
365
|
}
|
|
358
366
|
|
|
359
367
|
/**
|
|
360
|
-
*
|
|
368
|
+
* Deletes the specified project role.
|
|
361
369
|
*
|
|
362
370
|
* @param name - Role name.
|
|
363
371
|
* @returns Returns the raw data of a deleted role.
|
|
@@ -376,7 +384,7 @@ export class Project {
|
|
|
376
384
|
}
|
|
377
385
|
|
|
378
386
|
/**
|
|
379
|
-
* Returns the member
|
|
387
|
+
* Returns information about the specified project member.
|
|
380
388
|
*
|
|
381
389
|
* @param memberId - Member ID.
|
|
382
390
|
*/
|
|
@@ -390,7 +398,7 @@ export class Project {
|
|
|
390
398
|
* Add a user to the project to become a member and have permission to perform actions.
|
|
391
399
|
*
|
|
392
400
|
* @param userId - User ID.
|
|
393
|
-
* @param role -
|
|
401
|
+
* @param role - Role name from the list of project roles.
|
|
394
402
|
*/
|
|
395
403
|
addMember(userId: string, role: string): Promise<Member> {
|
|
396
404
|
return this.internalPost("/members", { userId, role })
|
|
@@ -399,7 +407,7 @@ export class Project {
|
|
|
399
407
|
}
|
|
400
408
|
|
|
401
409
|
/**
|
|
402
|
-
* Remove
|
|
410
|
+
* Remove the specified member from a project.
|
|
403
411
|
*
|
|
404
412
|
* @param memberId - Member ID.
|
|
405
413
|
* @returns Returns the raw data of a deleted member.
|
package/src/Api/Role.ts
CHANGED
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
import { IHttpClient } from "./IHttpClient";
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
|
-
* A
|
|
27
|
+
* A role determines what actions allowed to be performed by {@link User | users} on a
|
|
28
|
+
* {@link Project | project}.
|
|
28
29
|
*/
|
|
29
30
|
export class Role {
|
|
30
31
|
private _data: any;
|
|
@@ -32,9 +33,9 @@ export class Role {
|
|
|
32
33
|
public httpClient: IHttpClient;
|
|
33
34
|
|
|
34
35
|
/**
|
|
35
|
-
* @param data -
|
|
36
|
+
* @param data - Raw role data received from the server.
|
|
36
37
|
* @param projectId - Owner project ID.
|
|
37
|
-
* @param httpClient -
|
|
38
|
+
* @param httpClient - HTTP client instance used to send REST API requests to the server.
|
|
38
39
|
*/
|
|
39
40
|
constructor(data: any, projectId: string, httpClient: IHttpClient) {
|
|
40
41
|
this.httpClient = httpClient;
|
|
@@ -115,7 +116,7 @@ export class Role {
|
|
|
115
116
|
}
|
|
116
117
|
|
|
117
118
|
/**
|
|
118
|
-
*
|
|
119
|
+
* Reloads role data from the server.
|
|
119
120
|
*/
|
|
120
121
|
async checkout(): Promise<this> {
|
|
121
122
|
const response = await this.internalGet();
|
|
@@ -124,7 +125,7 @@ export class Role {
|
|
|
124
125
|
}
|
|
125
126
|
|
|
126
127
|
/**
|
|
127
|
-
*
|
|
128
|
+
* Updates role data on the server.
|
|
128
129
|
*
|
|
129
130
|
* @param data - Raw role data.
|
|
130
131
|
*/
|
|
@@ -135,7 +136,7 @@ export class Role {
|
|
|
135
136
|
}
|
|
136
137
|
|
|
137
138
|
/**
|
|
138
|
-
*
|
|
139
|
+
* Deletes a role from the project.
|
|
139
140
|
*
|
|
140
141
|
* @returns Returns the raw data of a deleted role.
|
|
141
142
|
*/
|
|
@@ -144,8 +145,8 @@ export class Role {
|
|
|
144
145
|
}
|
|
145
146
|
|
|
146
147
|
/**
|
|
147
|
-
*
|
|
148
|
-
* after any changes.
|
|
148
|
+
* Saves role properties changes to the server. Call this method to update role data on the
|
|
149
|
+
* server after any property changes.
|
|
149
150
|
*/
|
|
150
151
|
save(): Promise<this> {
|
|
151
152
|
return this.update(this.data);
|
package/src/Api/User.ts
CHANGED
|
@@ -26,15 +26,15 @@ import { FetchError } from "./FetchError";
|
|
|
26
26
|
import { userFullName, userInitials } from "./Utils";
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* Provides properties and methods for obtaining information about a server user and manage its data.
|
|
30
30
|
*/
|
|
31
31
|
export class User {
|
|
32
32
|
private _data: any;
|
|
33
33
|
public httpClient: IHttpClient;
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
|
-
* @param data -
|
|
37
|
-
* @param httpClient -
|
|
36
|
+
* @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
38
|
*/
|
|
39
39
|
constructor(data: any, httpClient: IHttpClient) {
|
|
40
40
|
this.httpClient = httpClient;
|
|
@@ -52,7 +52,7 @@ export class User {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
|
-
* `true` if user is allowed to create a
|
|
55
|
+
* `true` if user is allowed to create a projects.
|
|
56
56
|
*
|
|
57
57
|
* Only administrators can change create project permission.
|
|
58
58
|
*/
|
|
@@ -227,7 +227,8 @@ export class User {
|
|
|
227
227
|
}
|
|
228
228
|
|
|
229
229
|
/**
|
|
230
|
-
* The identity provider used to create the account. Can be `ldap`, `oauth`, `saml` or empty
|
|
230
|
+
* The identity provider used to create the account. Can be `ldap`, `oauth`, `saml` or empty
|
|
231
|
+
* for local accounts.
|
|
231
232
|
*
|
|
232
233
|
* @readonly
|
|
233
234
|
*/
|
|
@@ -258,8 +259,8 @@ export class User {
|
|
|
258
259
|
}
|
|
259
260
|
|
|
260
261
|
/**
|
|
261
|
-
* The user's access token (API key). Use
|
|
262
|
-
* to
|
|
262
|
+
* The user's access token (API key). Use
|
|
263
|
+
* {@link Client.signInWithToken | Client.signInWithToken()} to sign in to the server using this token.
|
|
263
264
|
*
|
|
264
265
|
* @readonly
|
|
265
266
|
*/
|
|
@@ -279,7 +280,7 @@ export class User {
|
|
|
279
280
|
}
|
|
280
281
|
|
|
281
282
|
/**
|
|
282
|
-
*
|
|
283
|
+
* Reloads user data from the server.
|
|
283
284
|
*
|
|
284
285
|
* Only administrators can checkout other users. If the current logged in user is not an
|
|
285
286
|
* administrator, they can only checkout themselves, otherwise an exception will be thrown.
|
|
@@ -300,7 +301,7 @@ export class User {
|
|
|
300
301
|
}
|
|
301
302
|
|
|
302
303
|
/**
|
|
303
|
-
*
|
|
304
|
+
* Updates user data on the server.
|
|
304
305
|
*
|
|
305
306
|
* Only administrators can update other users. If the current logged in user is not an
|
|
306
307
|
* administrator, they can only update themself, otherwise an exception will be thrown.
|
|
@@ -323,7 +324,7 @@ export class User {
|
|
|
323
324
|
}
|
|
324
325
|
|
|
325
326
|
/**
|
|
326
|
-
*
|
|
327
|
+
* Deletes a user from the server.
|
|
327
328
|
*
|
|
328
329
|
* Only administrators can delete users. If the current logged in user is not an
|
|
329
330
|
* administrator, an exception will be thrown.
|
|
@@ -331,7 +332,7 @@ export class User {
|
|
|
331
332
|
* Administrators can delete themselves or other administrators. An administrator can only
|
|
332
333
|
* delete themself if they is not the last administrator.
|
|
333
334
|
*
|
|
334
|
-
* You need to re-login
|
|
335
|
+
* You need to re-login after deleting the current logged in user.
|
|
335
336
|
*
|
|
336
337
|
* @returns Returns the raw data of a deleted user.
|
|
337
338
|
*/
|
|
@@ -354,15 +355,15 @@ export class User {
|
|
|
354
355
|
}
|
|
355
356
|
|
|
356
357
|
/**
|
|
357
|
-
*
|
|
358
|
-
* after any changes.
|
|
358
|
+
* Saves user properties changes to the server. Call this method to update user data on the
|
|
359
|
+
* server after any property changes.
|
|
359
360
|
*/
|
|
360
361
|
save(): Promise<this> {
|
|
361
362
|
return this.update(this.data);
|
|
362
363
|
}
|
|
363
364
|
|
|
364
365
|
/**
|
|
365
|
-
*
|
|
366
|
+
* Sets or removes the user avatar.
|
|
366
367
|
*
|
|
367
368
|
* Only administrators can set the avatar of other users. If the current logged in user is
|
|
368
369
|
* not an administrator, they can only set their avatar, otherwise an exception will be thrown.
|
|
@@ -371,9 +372,9 @@ export class User {
|
|
|
371
372
|
* {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}
|
|
372
373
|
* string,
|
|
373
374
|
* {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer | ArrayBuffer},
|
|
374
|
-
* {@link https://developer.mozilla.org/docs/Web/API/Blob/Blob | Blob} or
|
|
375
|
-
* {@link https://developer.mozilla.org/docs/Web/API/File | File} object. Setting
|
|
376
|
-
* `image` to `null` will remove the avatar.
|
|
375
|
+
* {@link https://developer.mozilla.org/docs/Web/API/Blob/Blob | Blob} or
|
|
376
|
+
* {@link https://developer.mozilla.org/docs/Web/API/File | Web API File} object. Setting
|
|
377
|
+
* the `image` to `null` will remove the avatar.
|
|
377
378
|
*/
|
|
378
379
|
async setAvatar(image?: BodyInit | null): Promise<this> {
|
|
379
380
|
if (!image) {
|
|
@@ -393,7 +394,7 @@ export class User {
|
|
|
393
394
|
}
|
|
394
395
|
|
|
395
396
|
/**
|
|
396
|
-
*
|
|
397
|
+
* Removes the user avatar.
|
|
397
398
|
*
|
|
398
399
|
* Only administrators can remove the avatar of other users. If the current logged in user is
|
|
399
400
|
* not an administrator, they can only remove their avatar, otherwise an exception will be thrown.
|
|
@@ -414,13 +415,13 @@ export class User {
|
|
|
414
415
|
}
|
|
415
416
|
|
|
416
417
|
/**
|
|
417
|
-
*
|
|
418
|
+
* Changes the user password.
|
|
418
419
|
*
|
|
419
420
|
* Only administrators can change the passwords of other users. If the current logged in user
|
|
420
421
|
* is not an administrator, they can only change their password, otherwise an exception will
|
|
421
422
|
* be thrown.
|
|
422
423
|
*
|
|
423
|
-
* To change their password, non-administrator users must
|
|
424
|
+
* To change their password, non-administrator users must specify their old password.
|
|
424
425
|
*
|
|
425
426
|
* @param newPassword - New user password.
|
|
426
427
|
* @param oldPassword - Old user password. Only required for non-administrator users to
|
package/src/index.ts
CHANGED
|
@@ -28,6 +28,7 @@ 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 { IModelTransformMatrix } from "./Api/IAssembly";
|
|
31
32
|
export { Member } from "./Api/Member";
|
|
32
33
|
export { Model } from "./Api/Model";
|
|
33
34
|
export { Permission } from "./Api/Permission";
|