@inweb/client 26.1.2 → 26.1.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 +434 -449
- package/dist/client.js.map +1 -1
- package/dist/client.min.js +1 -1
- package/dist/client.module.js +35 -35
- package/dist/client.module.js.map +1 -1
- package/lib/Api/Assembly.d.ts +65 -69
- package/lib/Api/ClashTest.d.ts +16 -16
- package/lib/Api/Client.d.ts +78 -77
- package/lib/Api/Endpoint.d.ts +6 -6
- package/lib/Api/FetchError.d.ts +5 -5
- package/lib/Api/File.d.ts +120 -132
- package/lib/Api/IHttpClient.d.ts +4 -3
- package/lib/Api/IRole.d.ts +6 -6
- package/lib/Api/ISharedLink.d.ts +1 -1
- package/lib/Api/IUser.d.ts +4 -4
- package/lib/Api/Job.d.ts +12 -12
- package/lib/Api/Member.d.ts +6 -6
- package/lib/Api/Model.d.ts +18 -18
- package/lib/Api/OAuthClient.d.ts +10 -10
- package/lib/Api/Permission.d.ts +17 -20
- package/lib/Api/Project.d.ts +14 -13
- package/lib/Api/Role.d.ts +2 -2
- package/lib/Api/SharedLink.d.ts +2 -2
- package/lib/Api/User.d.ts +33 -31
- package/package.json +2 -2
- package/src/Api/Assembly.ts +66 -70
- package/src/Api/ClashTest.ts +16 -16
- package/src/Api/Client.ts +78 -77
- package/src/Api/Endpoint.ts +6 -6
- package/src/Api/FetchError.ts +5 -5
- package/src/Api/File.ts +121 -133
- package/src/Api/IHttpClient.ts +4 -3
- package/src/Api/IRole.ts +6 -6
- package/src/Api/ISharedLink.ts +1 -1
- package/src/Api/IUser.ts +4 -4
- package/src/Api/Job.ts +12 -12
- package/src/Api/Member.ts +6 -6
- package/src/Api/Model.ts +18 -18
- package/src/Api/OAuthClient.ts +10 -10
- package/src/Api/Permission.ts +17 -20
- package/src/Api/Project.ts +14 -13
- package/src/Api/Role.ts +2 -2
- package/src/Api/SharedLink.ts +2 -2
- package/src/Api/User.ts +33 -31
package/lib/Api/FetchError.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export declare function statusText(status: number): string;
|
|
2
2
|
export declare function error400(text: string, _default?: string): string;
|
|
3
3
|
/**
|
|
4
|
-
* The `FetchError` object indicates an error when request to Open Cloud Server could not be
|
|
5
|
-
* `FetchError` is typically (but not exclusively) thrown when a network error
|
|
6
|
-
* object not found.
|
|
4
|
+
* The `FetchError` object indicates an error when request to Open Cloud Server could not be
|
|
5
|
+
* performed. A `FetchError` is typically (but not exclusively) thrown when a network error
|
|
6
|
+
* occurs, access denied, or object not found.
|
|
7
7
|
*/
|
|
8
8
|
export declare class FetchError extends Error {
|
|
9
9
|
/**
|
|
@@ -15,8 +15,8 @@ export declare class FetchError extends Error {
|
|
|
15
15
|
*/
|
|
16
16
|
statusText: string;
|
|
17
17
|
/**
|
|
18
|
-
* @property status - The
|
|
19
|
-
* of the response.
|
|
18
|
+
* @property status - The
|
|
19
|
+
* {@link https://developer.mozilla.org/docs/Web/HTTP/Status | HTTP status code} of the response.
|
|
20
20
|
* @property message - Error message.
|
|
21
21
|
*/
|
|
22
22
|
constructor(status: number, message?: string);
|
package/lib/Api/File.d.ts
CHANGED
|
@@ -8,8 +8,8 @@ import { Job } from "./Job";
|
|
|
8
8
|
import { SharedLink } from "./SharedLink";
|
|
9
9
|
import { ISharedLinkPermissions } from "./ISharedLink";
|
|
10
10
|
/**
|
|
11
|
-
* Provides properties and methods for obtaining information about a file on the Open Cloud
|
|
12
|
-
* managing its data and versions.
|
|
11
|
+
* Provides properties and methods for obtaining information about a file on the Open Cloud
|
|
12
|
+
* Server and managing its data and versions.
|
|
13
13
|
*/
|
|
14
14
|
export declare class File extends Endpoint {
|
|
15
15
|
private _data;
|
|
@@ -63,8 +63,8 @@ export declare class File extends Endpoint {
|
|
|
63
63
|
* - `vsfx` - `VSFX` format, file can be opened in `VisualizeJS` viewer.
|
|
64
64
|
* - `gltf` - `glTF` format, file can be opened in `Three.js` viewer.
|
|
65
65
|
*
|
|
66
|
-
* Returns an empty string if geometry data has not yet been converted. A files without
|
|
67
|
-
* can be exported to other formas, but cannot be opened in viewer.
|
|
66
|
+
* Returns an empty string if geometry data has not yet been converted. A files without
|
|
67
|
+
* geometry data can be exported to other formas, but cannot be opened in viewer.
|
|
68
68
|
*/
|
|
69
69
|
get geometryType(): string;
|
|
70
70
|
/**
|
|
@@ -76,8 +76,8 @@ export declare class File extends Endpoint {
|
|
|
76
76
|
/**
|
|
77
77
|
* Returns `true` if the source file of the active file version has been deleted.
|
|
78
78
|
*
|
|
79
|
-
* A files with deleted source file can be opened in the viewer, but cannot be exported to
|
|
80
|
-
* formats.
|
|
79
|
+
* A files with deleted source file can be opened in the viewer, but cannot be exported to
|
|
80
|
+
* other formats.
|
|
81
81
|
*
|
|
82
82
|
* @readonly
|
|
83
83
|
*/
|
|
@@ -183,27 +183,28 @@ export declare class File extends Endpoint {
|
|
|
183
183
|
/**
|
|
184
184
|
* Deletes a file and all its versions from the server.
|
|
185
185
|
*
|
|
186
|
-
* You cannot delete a version file using `delete()`, only the original file. To delete a
|
|
187
|
-
* use {@link deleteVersion | deleteVersion()}.
|
|
186
|
+
* You cannot delete a version file using `delete()`, only the original file. To delete a
|
|
187
|
+
* version file use {@link deleteVersion | deleteVersion()}.
|
|
188
188
|
*
|
|
189
189
|
* @returns Returns the raw data of a deleted file. For more information, see
|
|
190
190
|
* {@link https://cloud.opendesign.com/docs//pages/server/api.html#Files | Open Cloud Files API}.
|
|
191
191
|
*/
|
|
192
192
|
delete(): Promise<any>;
|
|
193
193
|
/**
|
|
194
|
-
* Saves file properties changes to the server. Call this method to update file data on the
|
|
195
|
-
* after any property changes.
|
|
194
|
+
* Saves file properties changes to the server. Call this method to update file data on the
|
|
195
|
+
* server after any property changes.
|
|
196
196
|
*/
|
|
197
197
|
save(): Promise<this>;
|
|
198
198
|
/**
|
|
199
199
|
* Sets or removes the file preview.
|
|
200
200
|
*
|
|
201
201
|
* @param image - Preview image. Can be a
|
|
202
|
-
* {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}
|
|
202
|
+
* {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}
|
|
203
|
+
* string,
|
|
203
204
|
* {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer | ArrayBuffer},
|
|
204
205
|
* {@link https://developer.mozilla.org/docs/Web/API/Blob/Blob | Blob} or
|
|
205
|
-
* {@link https://developer.mozilla.org/docs/Web/API/File | Web API File} object. Setting
|
|
206
|
-
* to `null` will remove the preview.
|
|
206
|
+
* {@link https://developer.mozilla.org/docs/Web/API/File | Web API File} object. Setting
|
|
207
|
+
* the `image` to `null` will remove the preview.
|
|
207
208
|
*/
|
|
208
209
|
setPreview(image?: BodyInit | null): Promise<this>;
|
|
209
210
|
/**
|
|
@@ -226,8 +227,8 @@ export declare class File extends Endpoint {
|
|
|
226
227
|
/**
|
|
227
228
|
* Returns the properties for an objects in the active version of the file.
|
|
228
229
|
*
|
|
229
|
-
* @param handles - Object original handle or handles array. Specify `undefined` to get
|
|
230
|
-
* all objects in the file.
|
|
230
|
+
* @param handles - Object original handle or handles array. Specify `undefined` to get
|
|
231
|
+
* properties for all objects in the file.
|
|
231
232
|
*/
|
|
232
233
|
getProperties(handles?: string | string[]): Promise<any[]>;
|
|
233
234
|
/**
|
|
@@ -241,40 +242,34 @@ export declare class File extends Endpoint {
|
|
|
241
242
|
* Query operator. Operator name can be `$and`, `$or`, `$not`, `$eq`, `$regex`.
|
|
242
243
|
*
|
|
243
244
|
* @typedef {any} QueryOperator
|
|
244
|
-
* @property {string | SearchPattern[] | QueryOperator[]} * - Array of the query values or
|
|
245
|
-
* operator.
|
|
246
|
-
*/
|
|
247
|
-
/**
|
|
248
|
-
* Returns the list of original handles for an objects in the active version of the file that
|
|
249
|
-
* specified patterns. Search patterns may be combined using query operators.
|
|
250
|
-
*
|
|
251
|
-
* @example Simple search pattern
|
|
252
|
-
*
|
|
253
|
-
*
|
|
254
|
-
*
|
|
255
|
-
*
|
|
256
|
-
*
|
|
257
|
-
*
|
|
258
|
-
*
|
|
259
|
-
*
|
|
260
|
-
*
|
|
261
|
-
*
|
|
262
|
-
*
|
|
263
|
-
*
|
|
264
|
-
*
|
|
265
|
-
*
|
|
266
|
-
*
|
|
267
|
-
*
|
|
268
|
-
*
|
|
269
|
-
*
|
|
270
|
-
*
|
|
271
|
-
*
|
|
272
|
-
* ],
|
|
273
|
-
* };
|
|
274
|
-
* ```
|
|
275
|
-
*
|
|
276
|
-
* @param {SeacrhPattern | QueryOperator} searchPattern - Search pattern or combination of the
|
|
277
|
-
* patterns, see example below.
|
|
245
|
+
* @property {string | SearchPattern[] | QueryOperator[]} * - Array of the query values or
|
|
246
|
+
* patterns for operator.
|
|
247
|
+
*/
|
|
248
|
+
/**
|
|
249
|
+
* Returns the list of original handles for an objects in the active version of the file that
|
|
250
|
+
* match the specified patterns. Search patterns may be combined using query operators.
|
|
251
|
+
*
|
|
252
|
+
* @example <caption>Simple search pattern.</caption>
|
|
253
|
+
* searchPattern = {
|
|
254
|
+
* key: "Category",
|
|
255
|
+
* value: "OST_Stairs",
|
|
256
|
+
* };
|
|
257
|
+
*
|
|
258
|
+
* @example <caption>Search patterns combination.</caption>
|
|
259
|
+
* searchPattern = {
|
|
260
|
+
* $or: [
|
|
261
|
+
* {
|
|
262
|
+
* $and: [
|
|
263
|
+
* { key: "Category", value: "OST_GenericModel" },
|
|
264
|
+
* { key: "Level", value: "03 - Floor" },
|
|
265
|
+
* ],
|
|
266
|
+
* },
|
|
267
|
+
* { key: "Category", value: "OST_Stairs" },
|
|
268
|
+
* ],
|
|
269
|
+
* };
|
|
270
|
+
*
|
|
271
|
+
* @param {SeacrhPattern | QueryOperator} searchPattern - Search pattern or combination of
|
|
272
|
+
* the patterns, see example below.
|
|
278
273
|
* @returns {Promise<Properties[]>}
|
|
279
274
|
*/
|
|
280
275
|
searchProperties(searchPattern: any): Promise<any[]>;
|
|
@@ -321,44 +316,41 @@ export declare class File extends Endpoint {
|
|
|
321
316
|
*
|
|
322
317
|
* @param onProgress - Download progress callback.
|
|
323
318
|
* @param signal - An
|
|
324
|
-
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
|
|
325
|
-
* to communicate with a fetch request and abort it if desired.
|
|
319
|
+
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
|
|
320
|
+
* signal. Allows to communicate with a fetch request and abort it if desired.
|
|
326
321
|
*/
|
|
327
322
|
download(onProgress?: (progress: number) => void, signal?: AbortSignal): Promise<ArrayBuffer>;
|
|
328
323
|
/**
|
|
329
|
-
* Downloads a resource file of the active version of the file. Resource files are files that
|
|
330
|
-
* model scene descriptions, or geometry data, or exported files.
|
|
331
|
-
*
|
|
332
|
-
* @example Export file to DWG.
|
|
324
|
+
* Downloads a resource file of the active version of the file. Resource files are files that
|
|
325
|
+
* contain model scene descriptions, or geometry data, or exported files.
|
|
333
326
|
*
|
|
334
|
-
*
|
|
335
|
-
*
|
|
336
|
-
*
|
|
337
|
-
*
|
|
338
|
-
*
|
|
339
|
-
*
|
|
340
|
-
*
|
|
341
|
-
*
|
|
342
|
-
* ```
|
|
327
|
+
* @example <caption>Export file to DWG.</caption>
|
|
328
|
+
* const job = await file.crateJob("dwg");
|
|
329
|
+
* await job.waitForDone();
|
|
330
|
+
* const dwgFileName = file.exports.find((x) => x.endsWith(".dwg"));
|
|
331
|
+
* const arrayBuffer = await file.downloadResource(dwgFileName);
|
|
332
|
+
* const blob = new Blob([arrayBuffer]);
|
|
333
|
+
* const fileName = file.name + ".dwg";
|
|
334
|
+
* FileSaver.saveAs(blob, fileName);
|
|
343
335
|
*
|
|
344
336
|
* @param dataId - Resource file name.
|
|
345
337
|
* @param onProgress - Download progress callback.
|
|
346
338
|
* @param signal - An
|
|
347
|
-
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
|
|
348
|
-
* to communicate with a fetch request and abort it if desired.
|
|
339
|
+
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
|
|
340
|
+
* signal. Allows to communicate with a fetch request and abort it if desired.
|
|
349
341
|
*/
|
|
350
342
|
downloadResource(dataId: string, onProgress?: (progress: number, chunk: Uint8Array) => void, signal?: AbortSignal): Promise<ArrayBuffer>;
|
|
351
343
|
/**
|
|
352
|
-
* Downloads a part of resource file of the active version of the file. Resource files are
|
|
353
|
-
* contain model scene descriptions, or geometry data, or exported files.
|
|
344
|
+
* Downloads a part of resource file of the active version of the file. Resource files are
|
|
345
|
+
* files that contain model scene descriptions, or geometry data, or exported files.
|
|
354
346
|
*
|
|
355
347
|
* @param dataId - Resource file name.
|
|
356
348
|
* @param ranges - A range of resource file contents to download.
|
|
357
349
|
* @param requestId - Request ID for download progress callback.
|
|
358
350
|
* @param onProgress - Download progress callback.
|
|
359
351
|
* @param signal - An
|
|
360
|
-
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
|
|
361
|
-
* to communicate with a fetch request and abort it if desired.
|
|
352
|
+
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
|
|
353
|
+
* signal. Allows to communicate with a fetch request and abort it if desired.
|
|
362
354
|
*/
|
|
363
355
|
downloadResourceRange(dataId: string, requestId: number, ranges: Array<{
|
|
364
356
|
begin: number;
|
|
@@ -383,15 +375,15 @@ export declare class File extends Endpoint {
|
|
|
383
375
|
* References are images, fonts, or any other files to correct rendering of the file.
|
|
384
376
|
*
|
|
385
377
|
* @param signal - An
|
|
386
|
-
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
|
|
387
|
-
* can be used to abort waiting as desired.
|
|
378
|
+
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
|
|
379
|
+
* signal, which can be used to abort waiting as desired.
|
|
388
380
|
*/
|
|
389
381
|
getReferences(signal?: AbortSignal): Promise<IFileReferences>;
|
|
390
382
|
/**
|
|
391
383
|
* Sets the file references.
|
|
392
384
|
*
|
|
393
|
-
* References are images, fonts, or any other files to correct rendering of the file.
|
|
394
|
-
* must be uploaded to the server before they can be assigned to the current file.
|
|
385
|
+
* References are images, fonts, or any other files to correct rendering of the file.
|
|
386
|
+
* Reference files must be uploaded to the server before they can be assigned to the current file.
|
|
395
387
|
*
|
|
396
388
|
* @param references - File references.
|
|
397
389
|
*/
|
|
@@ -405,14 +397,14 @@ export declare class File extends Endpoint {
|
|
|
405
397
|
* - `geometryGltf` - Convert file geometry data to `glTF` format suitable for `Three.js` viewer.
|
|
406
398
|
* - `properties` - Extract file properties.
|
|
407
399
|
* - `validation` - Validate the file. Only for `IFC` files.
|
|
408
|
-
* - `dwg`, `obj`, `gltf`, `glb`, `vsf`, `pdf`, `3dpdf` - Export file to the one of the
|
|
409
|
-
* Use {@link exports | exports()} to get the list of completed file
|
|
410
|
-
* {@link downloadResource | downloadResource()} to download the exported file.
|
|
411
|
-
* - Other custom job name. Custom job runner must be registered in the job templates before
|
|
412
|
-
* job.
|
|
400
|
+
* - `dwg`, `obj`, `gltf`, `glb`, `vsf`, `pdf`, `3dpdf` - Export file to the one of the
|
|
401
|
+
* supported format. Use {@link exports | exports()} to get the list of completed file
|
|
402
|
+
* exports. Use {@link downloadResource | downloadResource()} to download the exported file.
|
|
403
|
+
* - Other custom job name. Custom job runner must be registered in the job templates before
|
|
404
|
+
* creating a job.
|
|
413
405
|
*
|
|
414
|
-
* @param parameters - Parameters for the job runner. Can be given as command line arguments
|
|
415
|
-
* File Converter tool in form `--arg=value`.
|
|
406
|
+
* @param parameters - Parameters for the job runner. Can be given as command line arguments
|
|
407
|
+
* for the File Converter tool in form `--arg=value`.
|
|
416
408
|
*/
|
|
417
409
|
createJob(outputFormat: string, parameters?: string | object): Promise<Job>;
|
|
418
410
|
/**
|
|
@@ -424,16 +416,16 @@ export declare class File extends Endpoint {
|
|
|
424
416
|
* - `vsfx` - `VSFX` format (default), for opening a file in `VisualizeJS` viewer.
|
|
425
417
|
* - `gltf` - `glTF` format, for opening a file in `Three.js` viewer.
|
|
426
418
|
*
|
|
427
|
-
* @param parameters - Parameters for the job runner. Can be given as command line arguments
|
|
428
|
-
* File Converter tool in form `--arg=value`.
|
|
419
|
+
* @param parameters - Parameters for the job runner. Can be given as command line arguments
|
|
420
|
+
* for the File Converter tool in form `--arg=value`.
|
|
429
421
|
*/
|
|
430
422
|
extractGeometry(type?: string, parameters?: string | object): Promise<Job>;
|
|
431
423
|
/**
|
|
432
424
|
* Runs a job to extract properties of the active version of the file. This is alias to
|
|
433
425
|
* {@link createJob | createJob("properties")}.
|
|
434
426
|
*
|
|
435
|
-
* @param parameters - Parameters for the job runner. Can be given as command line arguments
|
|
436
|
-
* File Converter tool in form `--arg=value`.
|
|
427
|
+
* @param parameters - Parameters for the job runner. Can be given as command line arguments
|
|
428
|
+
* for the File Converter tool in form `--arg=value`.
|
|
437
429
|
*/
|
|
438
430
|
extractProperties(parameters?: string | object): Promise<Job>;
|
|
439
431
|
/**
|
|
@@ -442,26 +434,27 @@ export declare class File extends Endpoint {
|
|
|
442
434
|
*
|
|
443
435
|
* To get validation report use {@link downloadResource | downloadResource("validation_report.json")}.
|
|
444
436
|
*
|
|
445
|
-
* @param parameters - Parameters for the job runner. Can be given as command line arguments
|
|
446
|
-
* File Converter tool in form `--arg=value`.
|
|
437
|
+
* @param parameters - Parameters for the job runner. Can be given as command line arguments
|
|
438
|
+
* for the File Converter tool in form `--arg=value`.
|
|
447
439
|
*/
|
|
448
440
|
validate(parameters?: string | object): Promise<Job>;
|
|
449
441
|
/**
|
|
450
|
-
* Waits for jobs of the active version of the file to be done. Job is done when it changes
|
|
451
|
-
* `done` or `failed` status.
|
|
442
|
+
* Waits for jobs of the active version of the file to be done. Job is done when it changes
|
|
443
|
+
* to `none`, `done` or `failed` status.
|
|
452
444
|
*
|
|
453
|
-
* @param jobs - Job or job array to wait on. Can be `geometry`, `geometryGltf`,
|
|
454
|
-
* `validation`, `dwg`, `obj`, `gltf`, `glb`, `vsf`, `pdf`, `3dpdf` or custom
|
|
455
|
-
*
|
|
456
|
-
*
|
|
445
|
+
* @param jobs - Job or job array to wait on. Can be `geometry`, `geometryGltf`,
|
|
446
|
+
* `properties`, `validation`, `dwg`, `obj`, `gltf`, `glb`, `vsf`, `pdf`, `3dpdf` or custom
|
|
447
|
+
* job name.
|
|
448
|
+
* @param waitAll - If this parameter is `true`, the function returns when all the specified
|
|
449
|
+
* jobs have done. If `false`, the function returns when any one of the jobs are done.
|
|
457
450
|
* @param params - An object containing waiting parameters.
|
|
458
|
-
* @param params.timeout - The time, in milliseconds that the function should wait jobs. If
|
|
459
|
-
* are done during this time, the `TimeoutError` exception will be thrown.
|
|
460
|
-
* @param params.interval - The time, in milliseconds, the function should delay in between
|
|
461
|
-
* jobs status.
|
|
451
|
+
* @param params.timeout - The time, in milliseconds that the function should wait jobs. If
|
|
452
|
+
* no one jobs are done during this time, the `TimeoutError` exception will be thrown.
|
|
453
|
+
* @param params.interval - The time, in milliseconds, the function should delay in between
|
|
454
|
+
* checking jobs status.
|
|
462
455
|
* @param params.signal - An
|
|
463
|
-
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
|
|
464
|
-
* can be used to abort waiting as desired.
|
|
456
|
+
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
|
|
457
|
+
* signal, which can be used to abort waiting as desired.
|
|
465
458
|
* @param params.onCheckout - Waiting progress callback. Return `true` to cancel waiting.
|
|
466
459
|
*/
|
|
467
460
|
waitForDone(jobs: string | string[], waitAll?: boolean, params?: {
|
|
@@ -483,21 +476,15 @@ export declare class File extends Endpoint {
|
|
|
483
476
|
/**
|
|
484
477
|
* Creates a new file permission for a user, project, or group.
|
|
485
478
|
*
|
|
486
|
-
* @example Grant the specified user permission to "update" the file
|
|
487
|
-
*
|
|
488
|
-
*
|
|
489
|
-
*
|
|
490
|
-
* const grantedTo = [{ user: { id: myUser.id, email: myUser.email } }];
|
|
491
|
-
* await file.createPermission(action, grantedTo);
|
|
492
|
-
* ```
|
|
493
|
-
*
|
|
494
|
-
* @example Add a file to the specified project in "read-only" mode.
|
|
479
|
+
* @example <caption>Grant the specified user permission to "update" the file.</caption>
|
|
480
|
+
* const action = "update";
|
|
481
|
+
* const grantedTo = [{ user: { id: myUser.id, email: myUser.email } }];
|
|
482
|
+
* await file.createPermission(action, grantedTo);
|
|
495
483
|
*
|
|
496
|
-
*
|
|
497
|
-
*
|
|
498
|
-
*
|
|
499
|
-
*
|
|
500
|
-
* ```
|
|
484
|
+
* @example <caption>Add a file to the specified project in `read-only` mode.</caption>
|
|
485
|
+
* const actions = ["read", "readSourceFile"];
|
|
486
|
+
* const grantedTo = [{ project: { id: myProject.id, name: myProject.name } }];
|
|
487
|
+
* await file.createPermission(actions, grantedTo);
|
|
501
488
|
*
|
|
502
489
|
* @param actions - Actions are allowed to be performed on a file with this permission:
|
|
503
490
|
*
|
|
@@ -520,24 +507,25 @@ export declare class File extends Endpoint {
|
|
|
520
507
|
*/
|
|
521
508
|
deletePermission(permissionId: string): Promise<any>;
|
|
522
509
|
/**
|
|
523
|
-
* Uploads the new version of the file to the server, convert the geometry data and extract
|
|
524
|
-
* as needed.
|
|
510
|
+
* Uploads the new version of the file to the server, convert the geometry data and extract
|
|
511
|
+
* properties as needed.
|
|
525
512
|
*
|
|
526
|
-
* @param file - {@link https://developer.mozilla.org/docs/Web/API/File | Web API File} object
|
|
527
|
-
* generally retrieved from a
|
|
528
|
-
*
|
|
513
|
+
* @param file - {@link https://developer.mozilla.org/docs/Web/API/File | Web API File} object
|
|
514
|
+
* are generally retrieved from a
|
|
515
|
+
* {@link https://developer.mozilla.org/docs/Web/API/FileList | FileList} object returned as
|
|
516
|
+
* a result of a user selecting files using the HTML `<input>` element.
|
|
529
517
|
* @param params - An object containing upload parameters.
|
|
530
|
-
* @param params.geometry - Create job to convert file geometry data. The geometry data type
|
|
531
|
-
* same as the original file.
|
|
518
|
+
* @param params.geometry - Create job to convert file geometry data. The geometry data type
|
|
519
|
+
* is the same as the original file.
|
|
532
520
|
* @param params.properties - Create job to extract file properties.
|
|
533
521
|
* @param params.waitForDone - Wait for geometry and properties jobs to complete.
|
|
534
|
-
* @param params.timeout - The time, in milliseconds that the function should wait jobs. If
|
|
535
|
-
* are done during this time, the `TimeoutError` exception will be thrown.
|
|
536
|
-
* @param params.interval - The time, in milliseconds, the function should delay in between
|
|
537
|
-
* jobs status.
|
|
522
|
+
* @param params.timeout - The time, in milliseconds that the function should wait jobs. If
|
|
523
|
+
* no one jobs are done during this time, the `TimeoutError` exception will be thrown.
|
|
524
|
+
* @param params.interval - The time, in milliseconds, the function should delay in between
|
|
525
|
+
* checking jobs status.
|
|
538
526
|
* @param params.signal - An
|
|
539
|
-
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
|
|
540
|
-
* can be used to abort waiting as desired.
|
|
527
|
+
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
|
|
528
|
+
* signal, which can be used to abort waiting as desired.
|
|
541
529
|
* @param params.onProgress - Upload progress callback.
|
|
542
530
|
*/
|
|
543
531
|
uploadVersion(file: globalThis.File, params?: {
|
|
@@ -574,8 +562,8 @@ export declare class File extends Endpoint {
|
|
|
574
562
|
*/
|
|
575
563
|
setActiveVersion(version: number): Promise<this>;
|
|
576
564
|
/**
|
|
577
|
-
* Makes the given version active on client side. Does not change the active file version on
|
|
578
|
-
* server.
|
|
565
|
+
* Makes the given version active on client side. Does not change the active file version on
|
|
566
|
+
* the server.
|
|
579
567
|
*
|
|
580
568
|
* This version change will affect the result:
|
|
581
569
|
*
|
|
@@ -592,11 +580,11 @@ export declare class File extends Endpoint {
|
|
|
592
580
|
* - {@link waitForDone | waitForDone()}
|
|
593
581
|
* - Viewer.open()
|
|
594
582
|
*
|
|
595
|
-
* Other clients will still continue to use the current active version of the file. Use
|
|
596
|
-
* revert back to the active version.
|
|
583
|
+
* Other clients will still continue to use the current active version of the file. Use
|
|
584
|
+
* `undefined` to revert back to the active version.
|
|
597
585
|
*
|
|
598
|
-
* You need to reload the file data using {@link checkout | checkout()} to match the size and
|
|
599
|
-
* fields to the version you selected.
|
|
586
|
+
* You need to reload the file data using {@link checkout | checkout()} to match the size and
|
|
587
|
+
* status fields to the version you selected.
|
|
600
588
|
*/
|
|
601
589
|
useVersion(version?: number): this;
|
|
602
590
|
/**
|
package/lib/Api/IHttpClient.d.ts
CHANGED
|
@@ -67,9 +67,10 @@ export interface IHttpClient {
|
|
|
67
67
|
* Upload a file to the server.
|
|
68
68
|
*
|
|
69
69
|
* @param relativePath - Upload endpoint relative path.
|
|
70
|
-
* @param file - {@link https://developer.mozilla.org/docs/Web/API/File | Web API File} object
|
|
71
|
-
* generally retrieved from a
|
|
72
|
-
*
|
|
70
|
+
* @param file - {@link https://developer.mozilla.org/docs/Web/API/File | Web API File} object
|
|
71
|
+
* are generally retrieved from a
|
|
72
|
+
* {@link https://developer.mozilla.org/docs/Web/API/FileList | FileList} object returned as
|
|
73
|
+
* a result of a user selecting files using the HTML `<input>` element.
|
|
73
74
|
* @param onProgress - Upload progress callback.
|
|
74
75
|
* @param init - A set of options that can be used to configure a fetch request. See
|
|
75
76
|
* {@link https://developer.mozilla.org/docs/Web/API/RequestInit | RequestInit} for more details.
|
package/lib/Api/IRole.d.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export interface IRoleActions {
|
|
5
5
|
/**
|
|
6
|
-
* Defines what actions are allowed to be performed at the project level. The available
|
|
7
|
-
* include:
|
|
6
|
+
* Defines what actions are allowed to be performed at the project level. The available
|
|
7
|
+
* actions include:
|
|
8
8
|
*
|
|
9
9
|
* - `update` - The ability to update the project details.
|
|
10
10
|
* - `createTopic` - The ability to create a new topic.
|
|
@@ -24,16 +24,16 @@ export interface IRoleActions {
|
|
|
24
24
|
*/
|
|
25
25
|
topicActions?: string[];
|
|
26
26
|
/**
|
|
27
|
-
* Defines what actions are allowed to be performed at the comment level. The available
|
|
28
|
-
* include:
|
|
27
|
+
* Defines what actions are allowed to be performed at the comment level. The available
|
|
28
|
+
* actions include:
|
|
29
29
|
*
|
|
30
30
|
* - `update` - The ability to update the comment.
|
|
31
31
|
* - `delete` - The ability to delete the comment.
|
|
32
32
|
*/
|
|
33
33
|
commentActions?: string[];
|
|
34
34
|
/**
|
|
35
|
-
* Defines what actions are allowed to be performed at the viewpoint level. The available
|
|
36
|
-
* include:
|
|
35
|
+
* Defines what actions are allowed to be performed at the viewpoint level. The available
|
|
36
|
+
* actions include:
|
|
37
37
|
*
|
|
38
38
|
* - `update` - The ability to update the viewpoint.
|
|
39
39
|
* - `delete` - The ability to delete the viewpoint.
|
package/lib/Api/ISharedLink.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export interface ISharedLinkPermissions {
|
|
|
27
27
|
/**
|
|
28
28
|
* true if the shared link is password protected.
|
|
29
29
|
*/
|
|
30
|
-
readonly passwordProtected?:
|
|
30
|
+
readonly passwordProtected?: string;
|
|
31
31
|
/**
|
|
32
32
|
* Link expiration time (UTC) in the format specified in
|
|
33
33
|
* {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.
|
package/lib/Api/IUser.d.ts
CHANGED
|
@@ -27,13 +27,13 @@ export interface IShortUserDesc {
|
|
|
27
27
|
*/
|
|
28
28
|
avatarUrl?: string;
|
|
29
29
|
/**
|
|
30
|
-
* User full name. Contains the user's first and last name. If first name and last names are
|
|
31
|
-
* contains the user name.
|
|
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
32
|
*/
|
|
33
33
|
fullName?: string;
|
|
34
34
|
/**
|
|
35
|
-
* User initials. Contains a first letters of the user's first and last names. If first name
|
|
36
|
-
* names are empty, contains the first letter of the user name.
|
|
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
37
|
*/
|
|
38
38
|
initials?: string;
|
|
39
39
|
}
|
package/lib/Api/Job.d.ts
CHANGED
|
@@ -64,8 +64,8 @@ export declare class Job extends Endpoint {
|
|
|
64
64
|
*/
|
|
65
65
|
get lastUpdate(): string;
|
|
66
66
|
/**
|
|
67
|
-
* Job type. Can be `properties`, `geomerty`, `geomertyGltf`, `validation`, `clash`, `dwg`,
|
|
68
|
-
* `gltf`, `glb`, `vsf`, `pdf`, `3dpdf` or custom job name.
|
|
67
|
+
* Job type. Can be `properties`, `geomerty`, `geomertyGltf`, `validation`, `clash`, `dwg`,
|
|
68
|
+
* `obj`, `gltf`, `glb`, `vsf`, `pdf`, `3dpdf` or custom job name.
|
|
69
69
|
*
|
|
70
70
|
* @readonly
|
|
71
71
|
*/
|
|
@@ -103,16 +103,16 @@ export declare class Job extends Endpoint {
|
|
|
103
103
|
/**
|
|
104
104
|
* Updates job data on the server.
|
|
105
105
|
*
|
|
106
|
-
* Only administrators can update job data. If the current logged in user is not an
|
|
107
|
-
* exception will be thrown.
|
|
106
|
+
* Only administrators can update job data. If the current logged in user is not an
|
|
107
|
+
* administrator, an exception will be thrown.
|
|
108
108
|
*
|
|
109
109
|
* @param data - Raw job data. For more information, see
|
|
110
110
|
* {@link https://cloud.opendesign.com/docs//pages/server/api.html#Jobs | Open Cloud Jobs API}.
|
|
111
111
|
*/
|
|
112
112
|
update(data: any): Promise<this>;
|
|
113
113
|
/**
|
|
114
|
-
* Deletes a job from the server job list. Jobs that are in progress or have already been
|
|
115
|
-
* cannot be deleted.
|
|
114
|
+
* Deletes a job from the server job list. Jobs that are in progress or have already been
|
|
115
|
+
* completed cannot be deleted.
|
|
116
116
|
*
|
|
117
117
|
* @returns Returns the raw data of a deleted job. For more information, see
|
|
118
118
|
* {@link https://cloud.opendesign.com/docs//pages/server/api.html#Jobs | Open Cloud Jobs API}.
|
|
@@ -122,13 +122,13 @@ export declare class Job extends Endpoint {
|
|
|
122
122
|
* Waits for job to be done. Job is done when it changes to `done` or `failed` status.
|
|
123
123
|
*
|
|
124
124
|
* @param params - An object containing waiting parameters.
|
|
125
|
-
* @param params.timeout - The time, in milliseconds that the function should wait job. If
|
|
126
|
-
* done during this time, the `TimeoutError` exception will be thrown.
|
|
127
|
-
* @param params.interval - The time, in milliseconds, the function should delay in between
|
|
128
|
-
* job status.
|
|
125
|
+
* @param params.timeout - The time, in milliseconds that the function should wait job. If
|
|
126
|
+
* jobs is not done during this time, the `TimeoutError` exception will be thrown.
|
|
127
|
+
* @param params.interval - The time, in milliseconds, the function should delay in between
|
|
128
|
+
* checking job status.
|
|
129
129
|
* @param params.signal - An
|
|
130
|
-
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
|
|
131
|
-
* can be used to abort waiting as desired.
|
|
130
|
+
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
|
|
131
|
+
* signal, which can be used to abort waiting as desired.
|
|
132
132
|
* @param params.onCheckout - Waiting progress callback. Return `true` to cancel waiting.
|
|
133
133
|
*/
|
|
134
134
|
waitForDone(params?: {
|
package/lib/Api/Member.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { IHttpClient } from "./IHttpClient";
|
|
|
2
2
|
import { Endpoint } from "./Endpoint";
|
|
3
3
|
import { IShortUserDesc } from "./IUser";
|
|
4
4
|
/**
|
|
5
|
-
* Provides properties and methods for obtaining information about a {@link User | user} who has
|
|
6
|
-
* the {@link Project | project}.
|
|
5
|
+
* Provides properties and methods for obtaining information about a {@link User | user} who has
|
|
6
|
+
* access to the {@link Project | project}.
|
|
7
7
|
*/
|
|
8
8
|
export declare class Member extends Endpoint {
|
|
9
9
|
private _data;
|
|
@@ -29,8 +29,8 @@ export declare class Member extends Endpoint {
|
|
|
29
29
|
*/
|
|
30
30
|
get id(): string;
|
|
31
31
|
/**
|
|
32
|
-
* Member role name in the project. See {@link Project.getRoles | Project.getRoles()} for list
|
|
33
|
-
* project roles.
|
|
32
|
+
* Member role name in the project. See {@link Project.getRoles | Project.getRoles()} for list
|
|
33
|
+
* of project roles.
|
|
34
34
|
*/
|
|
35
35
|
get role(): string;
|
|
36
36
|
set role(value: string);
|
|
@@ -65,8 +65,8 @@ export declare class Member extends Endpoint {
|
|
|
65
65
|
*/
|
|
66
66
|
delete(): Promise<any>;
|
|
67
67
|
/**
|
|
68
|
-
* Saves member properties changes to the server. Call this method to update member data on
|
|
69
|
-
* after any property changes.
|
|
68
|
+
* Saves member properties changes to the server. Call this method to update member data on
|
|
69
|
+
* the server after any property changes.
|
|
70
70
|
*/
|
|
71
71
|
save(): Promise<this>;
|
|
72
72
|
}
|