@inweb/client 27.1.8 → 27.2.0
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 +9 -7
- package/dist/client.js.map +1 -1
- package/dist/client.min.js +1 -1
- package/dist/client.module.js +9 -7
- package/dist/client.module.js.map +1 -1
- package/lib/Api/Assembly.d.ts +2 -2
- package/lib/Api/ClashTest.d.ts +2 -2
- package/lib/Api/Client.d.ts +59 -30
- package/lib/Api/File.d.ts +37 -22
- package/lib/Api/IFile.d.ts +1 -1
- package/lib/Api/Job.d.ts +12 -6
- package/lib/Api/Permission.d.ts +3 -2
- package/lib/Api/Project.d.ts +3 -3
- package/lib/Api/User.d.ts +1 -1
- package/package.json +2 -2
- package/src/Api/Assembly.ts +4 -4
- package/src/Api/ClashTest.ts +2 -2
- package/src/Api/Client.ts +61 -30
- package/src/Api/File.ts +37 -22
- package/src/Api/IFile.ts +1 -1
- package/src/Api/Job.ts +12 -6
- package/src/Api/Permission.ts +3 -2
- package/src/Api/Project.ts +4 -4
- package/src/Api/User.ts +1 -1
package/src/Api/Client.ts
CHANGED
|
@@ -113,7 +113,7 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
113
113
|
* @param email - User email. Cannot be empty. Must be unique within the server.
|
|
114
114
|
* @param password - User password. Cannot be empty. Password can only contain letters (a-z, A-Z),
|
|
115
115
|
* numbers (0-9), and special characters (~!@#$%^&*()_-+={}[]<>|/'":;.,?).
|
|
116
|
-
* @param userName - User name. Cannot be empty or blank if defined.
|
|
116
|
+
* @param userName - User name. Cannot be empty or blank if defined. Specify `undefined` to use
|
|
117
117
|
* `username` from email.
|
|
118
118
|
*/
|
|
119
119
|
registerUser(email: string, password: string, userName?: string): Promise<any> {
|
|
@@ -475,8 +475,12 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
475
475
|
*/
|
|
476
476
|
|
|
477
477
|
/**
|
|
478
|
-
* Returns a list of files
|
|
479
|
-
*
|
|
478
|
+
* Returns a list of files from the server.
|
|
479
|
+
*
|
|
480
|
+
* You cannot list other users' files unless they have explicitly granted you `read` access or you are
|
|
481
|
+
* an administrator. To list these files, you must use the file ID filter.
|
|
482
|
+
*
|
|
483
|
+
* You cannot list files shared with you via shared links.
|
|
480
484
|
*
|
|
481
485
|
* @param start - The starting index in the file list. Used for paging.
|
|
482
486
|
* @param limit - The maximum number of files that should be returned per request. Used for paging.
|
|
@@ -484,11 +488,10 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
484
488
|
* @param ext - Filter the files by extension. Extension can be `dgn`, `dwf`, `dwg`, `dxf`, `ifc`,
|
|
485
489
|
* `ifczip`, `nwc`, `nwd`, `obj`, `rcs`, `rfa`, `rvt`, `step`, `stl`, `stp`, `vsf`, or any other file
|
|
486
490
|
* type extension.
|
|
487
|
-
* @param ids - List of file IDs to return.
|
|
488
|
-
* through a project. If not specified, only files uploaded by the current user are returned.
|
|
491
|
+
* @param ids - List of file IDs to return.
|
|
489
492
|
* @param sortByDesc - Allows to specify the descending order of the result. By default, files are
|
|
490
493
|
* sorted by name in ascending order.
|
|
491
|
-
* @param sortField - Allows to specify sort field.
|
|
494
|
+
* @param sortField - Allows to specify sort field. Can be `name`, `size`, `created`, or `updatedAt`.
|
|
492
495
|
* @param shared - Returns shared files only.
|
|
493
496
|
*/
|
|
494
497
|
getFiles(
|
|
@@ -538,8 +541,10 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
538
541
|
}
|
|
539
542
|
|
|
540
543
|
/**
|
|
541
|
-
* Returns information about the specified file
|
|
542
|
-
*
|
|
544
|
+
* Returns information about the specified file.
|
|
545
|
+
*
|
|
546
|
+
* You cannot retrieve other users' files unless they have explicitly granted you `read` access or you
|
|
547
|
+
* are an administrator.
|
|
543
548
|
*
|
|
544
549
|
* @param fileId - File ID.
|
|
545
550
|
*/
|
|
@@ -561,14 +566,15 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
561
566
|
* generally retrieved from a {@link https://developer.mozilla.org/docs/Web/API/FileList | FileList}
|
|
562
567
|
* object returned as a result of a user selecting files using the HTML `<input>` element.
|
|
563
568
|
* @param params - An object containing upload parameters.
|
|
564
|
-
* @param params.geometry -
|
|
565
|
-
* Can be one of:
|
|
569
|
+
* @param params.geometry - Create the File Converter job to convert geometry data after uploading the
|
|
570
|
+
* file. Can be one of:
|
|
566
571
|
*
|
|
567
572
|
* - `true` - Convert file geometry data to `VSFX` format for opening in `VisualizeJS` 3D viewer.
|
|
568
573
|
* - `vsfx` - Convert file geometry data to `VSFX` format for opening in `VisualizeJS` 3D viewer.
|
|
569
574
|
* - `gltf` - Convert file geometry data to `glTF` format for opening in `Three.js` 3D viewer.
|
|
570
575
|
*
|
|
571
|
-
* @param params.properties -
|
|
576
|
+
* @param params.properties - Create the File Converter job to extract properties after uploading the
|
|
577
|
+
* file.
|
|
572
578
|
* @param params.jobParameters - Parameters for the File Converter jobs. Use this to specify additional
|
|
573
579
|
* parameters for retrieving the geometry and properties of uploaded file. Can be given as command
|
|
574
580
|
* line arguments in form `--arg=value`.
|
|
@@ -628,8 +634,10 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
628
634
|
/**
|
|
629
635
|
* Deletes the specified file and all its versions from the server.
|
|
630
636
|
*
|
|
631
|
-
* You cannot delete
|
|
632
|
-
*
|
|
637
|
+
* You cannot delete other users' files unless you are an administrator.
|
|
638
|
+
*
|
|
639
|
+
* You cannot delete a version file, only the original file. To delete a version file use
|
|
640
|
+
* {@link File.deleteVersion | File.deleteVersion()}.
|
|
633
641
|
*
|
|
634
642
|
* @param fileId - File ID.
|
|
635
643
|
* @returns Returns the raw data of a deleted file. For more information, see
|
|
@@ -642,6 +650,9 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
642
650
|
/**
|
|
643
651
|
* Downloads the specified file from the server.
|
|
644
652
|
*
|
|
653
|
+
* You cannot download other users' files unless they have explicitly granted you `readSourceFile`
|
|
654
|
+
* access or you are an administrator.
|
|
655
|
+
*
|
|
645
656
|
* @param fileId - File ID.
|
|
646
657
|
* @param onProgress - Download progress callback.
|
|
647
658
|
* @param signal - An
|
|
@@ -666,14 +677,17 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
666
677
|
*/
|
|
667
678
|
|
|
668
679
|
/**
|
|
669
|
-
* Returns a list of jobs
|
|
680
|
+
* Returns a list of jobs from the server.
|
|
670
681
|
*
|
|
671
|
-
*
|
|
682
|
+
* You cannot list other users' jobs unless you are an administrator.
|
|
683
|
+
*
|
|
684
|
+
* @param status - Filter the jobs by status. Status can be `waiting`, `inprogress`, `done`, or
|
|
685
|
+
* `failed`.
|
|
672
686
|
* @param limit - The maximum number of jobs that should be returned per request. Used for paging.
|
|
673
687
|
* @param start - The starting index in the job list. Used for paging.
|
|
674
688
|
* @param sortByDesc - Allows to specify the descending order of the result. By default, jobs are
|
|
675
689
|
* sorted by creation time in ascending order.
|
|
676
|
-
* @param
|
|
690
|
+
* @param sortField - Allows to specify sort field. Can be `createdAt`, `startedAt`, or `lastUpdate`.
|
|
677
691
|
*/
|
|
678
692
|
getJobs(
|
|
679
693
|
status?: string | string[],
|
|
@@ -713,6 +727,8 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
713
727
|
/**
|
|
714
728
|
* Returns information about the specified job.
|
|
715
729
|
*
|
|
730
|
+
* You cannot retrieve other users' jobs unless you are an administrator.
|
|
731
|
+
*
|
|
716
732
|
* @param jobId - Job ID.
|
|
717
733
|
*/
|
|
718
734
|
getJob(jobId: string): Promise<Job> {
|
|
@@ -723,7 +739,10 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
723
739
|
}
|
|
724
740
|
|
|
725
741
|
/**
|
|
726
|
-
*
|
|
742
|
+
* Creates a new job on the server for the specified file.
|
|
743
|
+
*
|
|
744
|
+
* You cannot create jobs for other users' files unless they have explicitly granted you `createJob`
|
|
745
|
+
* access or you are an administrator.
|
|
727
746
|
*
|
|
728
747
|
* @param fileId - File ID.
|
|
729
748
|
* @param outputFormat - The job type. Can be one of:
|
|
@@ -733,7 +752,7 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
733
752
|
* - `properties` - Extract file properties.
|
|
734
753
|
* - `validation` - Validate the IFC file.
|
|
735
754
|
* - `dwg`, `obj`, `gltf`, `glb`, `vsf`, `pdf`, `3dpdf` - Export file to the specified format.
|
|
736
|
-
* - Other custom job name. Custom job must be registered in the job templates
|
|
755
|
+
* - Other custom job name. Custom job must be registered in the job templates.
|
|
737
756
|
*
|
|
738
757
|
* @param parameters - Parameters for the File Converter jobs or custom job. Can be given as JSON
|
|
739
758
|
* object or command line arguments in form `--arg=value`.
|
|
@@ -750,8 +769,13 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
750
769
|
}
|
|
751
770
|
|
|
752
771
|
/**
|
|
753
|
-
* Deletes the specified job from the server
|
|
754
|
-
*
|
|
772
|
+
* Deletes the specified job from the server.
|
|
773
|
+
*
|
|
774
|
+
* You cannot delete other users' jobs unless you are an administrator.
|
|
775
|
+
*
|
|
776
|
+
* You can only delete jobs that are in the `waiting` status (jobs that have been created but not yet
|
|
777
|
+
* started). Jobs that are currently running (`inprogress`) or have already completed (`done` or
|
|
778
|
+
* `failed`) cannot be deleted.
|
|
755
779
|
*
|
|
756
780
|
* @param jobId - Job ID.
|
|
757
781
|
* @returns Returns the raw data of a deleted job. For more information, see
|
|
@@ -782,7 +806,7 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
782
806
|
* @param ids - List of assembly IDs to return.
|
|
783
807
|
* @param sortByDesc - Allows to specify the descending order of the result. By default assemblies are
|
|
784
808
|
* sorted by name in ascending order.
|
|
785
|
-
* @param sortField - Allows to specify sort field.
|
|
809
|
+
* @param sortField - Allows to specify sort field. Can be `name` or `created`.
|
|
786
810
|
*/
|
|
787
811
|
getAssemblies(
|
|
788
812
|
start?: number,
|
|
@@ -916,13 +940,16 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
916
940
|
* @param ids - List of project IDs to return.
|
|
917
941
|
* @param sortByDesc - Allows to specify the descending order of the result. By default projects are
|
|
918
942
|
* sorted by name in ascending order.
|
|
943
|
+
* @param sortField - Allows to specify sort field. Can be `name`, `createdAt`, `updatedAt`,
|
|
944
|
+
* `startDate`, or `endDate`.
|
|
919
945
|
*/
|
|
920
946
|
getProjects(
|
|
921
947
|
start?: number,
|
|
922
948
|
limit?: number,
|
|
923
949
|
name?: string,
|
|
924
950
|
ids?: string | string[],
|
|
925
|
-
sortByDesc?: boolean
|
|
951
|
+
sortByDesc?: boolean,
|
|
952
|
+
sortField?: string
|
|
926
953
|
): Promise<{
|
|
927
954
|
result: Project[];
|
|
928
955
|
start: number;
|
|
@@ -939,6 +966,7 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
939
966
|
if (ids) searchParams.set("id", ids);
|
|
940
967
|
}
|
|
941
968
|
if (sortByDesc !== undefined) searchParams.set("sortBy", sortByDesc ? "desc" : "asc");
|
|
969
|
+
if (sortField) searchParams.set("sortField", sortField);
|
|
942
970
|
|
|
943
971
|
let queryString = searchParams.toString();
|
|
944
972
|
if (queryString) queryString = "?" + queryString;
|
|
@@ -1044,7 +1072,10 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
1044
1072
|
}
|
|
1045
1073
|
|
|
1046
1074
|
/**
|
|
1047
|
-
* Creates a shared link
|
|
1075
|
+
* Creates a file shared link.
|
|
1076
|
+
*
|
|
1077
|
+
* Only file owner can create shared link. If the current logged in user is not a file owner, an
|
|
1078
|
+
* exception will be thrown.
|
|
1048
1079
|
*
|
|
1049
1080
|
* @param fileId - File ID.
|
|
1050
1081
|
* @param permissions - Share permissions.
|
|
@@ -1060,7 +1091,7 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
1060
1091
|
}
|
|
1061
1092
|
|
|
1062
1093
|
/**
|
|
1063
|
-
* Deletes the specified shared link.
|
|
1094
|
+
* Deletes the specified file shared link.
|
|
1064
1095
|
*
|
|
1065
1096
|
* Only file owner can delete shared link. If the current logged in user is not a file owner, an
|
|
1066
1097
|
* exception will be thrown.
|
|
@@ -1074,12 +1105,12 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
1074
1105
|
}
|
|
1075
1106
|
|
|
1076
1107
|
/**
|
|
1077
|
-
* Returns information about a file
|
|
1108
|
+
* Returns information about a file for specified shared link token.
|
|
1078
1109
|
*
|
|
1079
1110
|
* Some file features are not available via shared link:
|
|
1080
1111
|
*
|
|
1081
1112
|
* - Updating file properties, preview, and viewpoints
|
|
1082
|
-
* -
|
|
1113
|
+
* - Creating file jobs
|
|
1083
1114
|
* - Managing file permissions
|
|
1084
1115
|
* - Managing file versions
|
|
1085
1116
|
* - Deleting file
|
|
@@ -1110,8 +1141,8 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
1110
1141
|
/**
|
|
1111
1142
|
* Returns information about the specified plugin.
|
|
1112
1143
|
*
|
|
1113
|
-
* Only administrators can
|
|
1114
|
-
*
|
|
1144
|
+
* Only administrators can list plugins. If the current logged in user is not an administrator, an
|
|
1145
|
+
* exception will be thrown.
|
|
1115
1146
|
*
|
|
1116
1147
|
* @param name - Plugin name.
|
|
1117
1148
|
* @param version - Plugin version.
|
|
@@ -1164,8 +1195,8 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
1164
1195
|
/**
|
|
1165
1196
|
* Downloads the specified plugin package from the server.
|
|
1166
1197
|
*
|
|
1167
|
-
* Only administrators can download
|
|
1168
|
-
* exception will be thrown.
|
|
1198
|
+
* Only administrators can download plugin packages. If the current logged in user is not an
|
|
1199
|
+
* administrator, an exception will be thrown.
|
|
1169
1200
|
*
|
|
1170
1201
|
* @param name - Plugin name.
|
|
1171
1202
|
* @param version - Plugin version.
|
package/src/Api/File.ts
CHANGED
|
@@ -123,7 +123,7 @@ export class File extends Endpoint {
|
|
|
123
123
|
/**
|
|
124
124
|
* Returns a list of file formats in which the active version of the file was exported.
|
|
125
125
|
*
|
|
126
|
-
* To export file to one of the supported formats
|
|
126
|
+
* To export file to one of the supported formats create the File Converter job using
|
|
127
127
|
* {@link createJob | createJob()}. For an example, see the {@link downloadResource} help.
|
|
128
128
|
*
|
|
129
129
|
* @readonly
|
|
@@ -189,7 +189,7 @@ export class File extends Endpoint {
|
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
/**
|
|
192
|
-
* File owner
|
|
192
|
+
* File owner (the user who uploaded the file to the server).
|
|
193
193
|
*
|
|
194
194
|
* @readonly
|
|
195
195
|
*/
|
|
@@ -248,7 +248,7 @@ export class File extends Endpoint {
|
|
|
248
248
|
*
|
|
249
249
|
* Each status entity is a record with properties:
|
|
250
250
|
*
|
|
251
|
-
* - `state` - Job state. Can be `none`, `waiting`, `inprogress`, `done
|
|
251
|
+
* - `state` - Job state. Can be `none`, `waiting`, `inprogress`, `done`, or `failed`.
|
|
252
252
|
* - `jobId` - Unique ID of the job.
|
|
253
253
|
*
|
|
254
254
|
* @readonly
|
|
@@ -314,6 +314,9 @@ export class File extends Endpoint {
|
|
|
314
314
|
/**
|
|
315
315
|
* Updates file data on the server.
|
|
316
316
|
*
|
|
317
|
+
* You cannot update other users' files unless they have explicitly granted you `write` access or you
|
|
318
|
+
* are an administrator.
|
|
319
|
+
*
|
|
317
320
|
* @param data - Raw file data. For more information, see
|
|
318
321
|
* {@link https://cloud.opendesign.com/docs//pages/server/api.html#Files | Open Cloud Files API}.
|
|
319
322
|
*/
|
|
@@ -326,8 +329,10 @@ export class File extends Endpoint {
|
|
|
326
329
|
/**
|
|
327
330
|
* Deletes a file and all its versions from the server.
|
|
328
331
|
*
|
|
329
|
-
* You cannot delete
|
|
330
|
-
*
|
|
332
|
+
* You cannot delete other users' files unless you are an administrator.
|
|
333
|
+
*
|
|
334
|
+
* You cannot delete a version file, only the original file. To delete a version file use
|
|
335
|
+
* {@link deleteVersion | deleteVersion()}.
|
|
331
336
|
*
|
|
332
337
|
* @returns Returns the raw data of a deleted file. For more information, see
|
|
333
338
|
* {@link https://cloud.opendesign.com/docs//pages/server/api.html#Files | Open Cloud Files API}.
|
|
@@ -421,7 +426,7 @@ export class File extends Endpoint {
|
|
|
421
426
|
* });
|
|
422
427
|
* ```
|
|
423
428
|
*
|
|
424
|
-
* or when
|
|
429
|
+
* or when creating the {@link extractProperties | extract file properties} job:
|
|
425
430
|
*
|
|
426
431
|
* ```javascript
|
|
427
432
|
* await file.extractProperties("--properties_group");
|
|
@@ -557,7 +562,10 @@ export class File extends Endpoint {
|
|
|
557
562
|
}
|
|
558
563
|
|
|
559
564
|
/**
|
|
560
|
-
* Downloads the
|
|
565
|
+
* Downloads the active version of the file from the server.
|
|
566
|
+
*
|
|
567
|
+
* You cannot download other users' files unless they have explicitly granted you `readSourceFile`
|
|
568
|
+
* access or you are an administrator.
|
|
561
569
|
*
|
|
562
570
|
* @param onProgress - Download progress callback.
|
|
563
571
|
* @param signal - An
|
|
@@ -574,6 +582,9 @@ export class File extends Endpoint {
|
|
|
574
582
|
* Downloads a resource file of the active version of the file. Resource files are files that contain
|
|
575
583
|
* model scene descriptions, or geometry data, or exported files.
|
|
576
584
|
*
|
|
585
|
+
* You cannot download resources of other users' files unless they have explicitly granted you `read`
|
|
586
|
+
* access or you are an administrator.
|
|
587
|
+
*
|
|
577
588
|
* @example Export file to PDF.
|
|
578
589
|
*
|
|
579
590
|
* ```javascript
|
|
@@ -662,7 +673,10 @@ export class File extends Endpoint {
|
|
|
662
673
|
}
|
|
663
674
|
|
|
664
675
|
/**
|
|
665
|
-
*
|
|
676
|
+
* Creates a new job on the server for the active version of the file.
|
|
677
|
+
*
|
|
678
|
+
* You cannot create jobs for other users' files unless they have explicitly granted you `createJob`
|
|
679
|
+
* access or you are an administrator.
|
|
666
680
|
*
|
|
667
681
|
* @param outputFormat - The job type. Can be one of:
|
|
668
682
|
*
|
|
@@ -673,7 +687,7 @@ export class File extends Endpoint {
|
|
|
673
687
|
* - `dwg`, `obj`, `gltf`, `glb`, `vsf`, `pdf`, `3dpdf` - Export file to the specified format. Use
|
|
674
688
|
* {@link exports} to get the list of completed file exports. Use
|
|
675
689
|
* {@link downloadResource | downloadResource()} to download the exported file.
|
|
676
|
-
* - Other custom job name. Custom job must be registered in the job templates
|
|
690
|
+
* - Other custom job name. Custom job must be registered in the job templates.
|
|
677
691
|
*
|
|
678
692
|
* @param parameters - Parameters for the File Converter jobs or custom job. Can be given as JSON
|
|
679
693
|
* object or command line arguments in form `--arg=value`.
|
|
@@ -691,7 +705,7 @@ export class File extends Endpoint {
|
|
|
691
705
|
}
|
|
692
706
|
|
|
693
707
|
/**
|
|
694
|
-
*
|
|
708
|
+
* Creates a File Converter job to convert geometry data of active version of the file to the specified
|
|
695
709
|
* format. This is alias to {@link createJob | createJob("geometry")}.
|
|
696
710
|
*
|
|
697
711
|
* @param type - Geometry data type. Can be one of:
|
|
@@ -707,8 +721,8 @@ export class File extends Endpoint {
|
|
|
707
721
|
}
|
|
708
722
|
|
|
709
723
|
/**
|
|
710
|
-
*
|
|
711
|
-
* {@link createJob | createJob("properties")}.
|
|
724
|
+
* Creates a File Converter job to extract properties of the active version of the file. This is alias
|
|
725
|
+
* to {@link createJob | createJob("properties")}.
|
|
712
726
|
*
|
|
713
727
|
* @param parameters - Parameters for the File Converter job. Can be given as command line arguments in
|
|
714
728
|
* form `--arg=value`.
|
|
@@ -718,7 +732,7 @@ export class File extends Endpoint {
|
|
|
718
732
|
}
|
|
719
733
|
|
|
720
734
|
/**
|
|
721
|
-
*
|
|
735
|
+
* Creates an IFC validator job to validate the active version of the file. This is alias to
|
|
722
736
|
* {@link createJob | createJob("validation")}.
|
|
723
737
|
*
|
|
724
738
|
* To get validation report use {@link downloadResource | downloadResource("validation_report.json")}.
|
|
@@ -798,12 +812,12 @@ export class File extends Endpoint {
|
|
|
798
812
|
}
|
|
799
813
|
|
|
800
814
|
/**
|
|
801
|
-
*
|
|
815
|
+
* Grants specified file permissions to user, project, group, or all users.
|
|
802
816
|
*
|
|
803
|
-
* @example Grant the specified user permission to "
|
|
817
|
+
* @example Grant the specified user permission to "read" the file.
|
|
804
818
|
*
|
|
805
819
|
* ```javascript
|
|
806
|
-
* const action = "
|
|
820
|
+
* const action = "read";
|
|
807
821
|
* const grantedTo = { user: { id: myUser.id, email: myUser.email } };
|
|
808
822
|
* await file.createPermission(action, grantedTo);
|
|
809
823
|
* ```
|
|
@@ -816,15 +830,16 @@ export class File extends Endpoint {
|
|
|
816
830
|
* await file.createPermission(actions, grantedTo);
|
|
817
831
|
* ```
|
|
818
832
|
*
|
|
819
|
-
* @param actions -
|
|
833
|
+
* @param actions - A single action or list of actions allowed for this permission:
|
|
820
834
|
*
|
|
821
835
|
* - `read` - The ability to read file description, geometry data and properties.
|
|
822
836
|
* - `readSourceFile` - The ability to download source file.
|
|
823
837
|
* - `write` - The ability to modify file name, description and references.
|
|
824
838
|
* - `readViewpoint` - The ability to read file viewpoints.
|
|
825
|
-
* - `createViewpoint` - The ability to create file viewpoints.
|
|
839
|
+
* - `createViewpoint` - The ability to create new file viewpoints.
|
|
840
|
+
* - `deleteViewpoint` - The ability to delete existing file viewpoints.
|
|
826
841
|
*
|
|
827
|
-
* @param grantedTo -
|
|
842
|
+
* @param grantedTo - A user, project, or group that will get access to the file.
|
|
828
843
|
* @param _public - Specifies whether all users have access to the file or not.
|
|
829
844
|
*/
|
|
830
845
|
createPermission(
|
|
@@ -842,7 +857,7 @@ export class File extends Endpoint {
|
|
|
842
857
|
}
|
|
843
858
|
|
|
844
859
|
/**
|
|
845
|
-
*
|
|
860
|
+
* Revokes specified file permission.
|
|
846
861
|
*
|
|
847
862
|
* @param permissionId - Permission ID.
|
|
848
863
|
* @returns Returns the raw data of a deleted permission. For more information, see
|
|
@@ -938,7 +953,7 @@ export class File extends Endpoint {
|
|
|
938
953
|
}
|
|
939
954
|
|
|
940
955
|
/**
|
|
941
|
-
* Deletes the specified version
|
|
956
|
+
* Deletes the specified file version.
|
|
942
957
|
*
|
|
943
958
|
* @param version - Version to delete.
|
|
944
959
|
* @returns Returns the raw data of a deleted version file. For more information, see
|
|
@@ -1013,7 +1028,7 @@ export class File extends Endpoint {
|
|
|
1013
1028
|
}
|
|
1014
1029
|
|
|
1015
1030
|
/**
|
|
1016
|
-
* Returns information about the file shared link or `undefined` if file is not shared.
|
|
1031
|
+
* Returns information about the file shared link or `undefined` if file is not shared yet.
|
|
1017
1032
|
*/
|
|
1018
1033
|
async getSharedLink(): Promise<SharedLink> {
|
|
1019
1034
|
if (!this.sharedLinkToken) return Promise.resolve(undefined);
|
package/src/Api/IFile.ts
CHANGED
package/src/Api/Job.ts
CHANGED
|
@@ -51,7 +51,8 @@ export class Job extends Endpoint {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
|
-
* Job
|
|
54
|
+
* Job owner ID (the user who created the job). Use {@link Client.getUser | Client.getUser()} to obtain
|
|
55
|
+
* detailed user information.
|
|
55
56
|
*
|
|
56
57
|
* @readonly
|
|
57
58
|
*/
|
|
@@ -148,7 +149,7 @@ export class Job extends Endpoint {
|
|
|
148
149
|
}
|
|
149
150
|
|
|
150
151
|
/**
|
|
151
|
-
* Job status. Can be `waiting`, `inprogress`, `done
|
|
152
|
+
* Job status. Can be `waiting`, `inprogress`, `done`, or `failed`.
|
|
152
153
|
*
|
|
153
154
|
* @readonly
|
|
154
155
|
*/
|
|
@@ -200,8 +201,13 @@ export class Job extends Endpoint {
|
|
|
200
201
|
}
|
|
201
202
|
|
|
202
203
|
/**
|
|
203
|
-
* Deletes a job from the server
|
|
204
|
-
*
|
|
204
|
+
* Deletes a job from the server.
|
|
205
|
+
*
|
|
206
|
+
* You cannot delete other users' jobs unless you are an administrator.
|
|
207
|
+
*
|
|
208
|
+
* You can only delete jobs that are in the `waiting` status (jobs that have been created but not yet
|
|
209
|
+
* started). Jobs that are currently running (`inprogress`) or have already completed (`done` or
|
|
210
|
+
* `failed`) cannot be deleted.
|
|
205
211
|
*
|
|
206
212
|
* @returns Returns the raw data of a deleted job. For more information, see
|
|
207
213
|
* {@link https://cloud.opendesign.com/docs//pages/server/api.html#Jobs | Open Cloud Jobs API}.
|
|
@@ -222,8 +228,8 @@ export class Job extends Endpoint {
|
|
|
222
228
|
* Waits for job to be done. Job is done when it changes to `done` or `failed` status.
|
|
223
229
|
*
|
|
224
230
|
* @param params - An object containing waiting parameters.
|
|
225
|
-
* @param params.timeout - The time, in milliseconds that the function should wait job. If
|
|
226
|
-
* done during this time, the `TimeoutError` exception will be thrown.
|
|
231
|
+
* @param params.timeout - The time, in milliseconds that the function should wait for the job. If the
|
|
232
|
+
* job is not done during this time, the `TimeoutError` exception will be thrown.
|
|
227
233
|
* @param params.interval - The time, in milliseconds, the function should delay in between checking
|
|
228
234
|
* job status.
|
|
229
235
|
* @param params.signal - An
|
package/src/Api/Permission.ts
CHANGED
|
@@ -51,8 +51,9 @@ export class Permission extends Endpoint {
|
|
|
51
51
|
* - `write` - The ability to modify file name, description and references.
|
|
52
52
|
* - `readViewpoint` - The ability to read file viewpoints.
|
|
53
53
|
* - `createViewpoint` - The ability to create file viewpoints.
|
|
54
|
+
* - `deleteViewpoint` - The ability to delete file viewpoints.
|
|
54
55
|
*
|
|
55
|
-
* @example Change file permissions for the
|
|
56
|
+
* @example Change file permissions for the specified project.
|
|
56
57
|
*
|
|
57
58
|
* ```javascript
|
|
58
59
|
* const myFile = client.getFile(myFileId);
|
|
@@ -60,7 +61,7 @@ export class Permission extends Endpoint {
|
|
|
60
61
|
* const projectPermissions = permissions.filter((permission) =>
|
|
61
62
|
* permission.grantedTo.some((x) => x.project?.id === myProjectId)
|
|
62
63
|
* );
|
|
63
|
-
* const newActions = ["read", "readSourceFile"
|
|
64
|
+
* const newActions = ["read", "readSourceFile"];
|
|
64
65
|
* await Promise.all(
|
|
65
66
|
* projectPermissions.map((permission) => {
|
|
66
67
|
* permission.actions = newActions;
|
package/src/Api/Project.ts
CHANGED
|
@@ -168,7 +168,7 @@ export class Project extends Endpoint {
|
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
/**
|
|
171
|
-
* Project owner
|
|
171
|
+
* Project owner (the user who created the project).
|
|
172
172
|
*
|
|
173
173
|
* @readonly
|
|
174
174
|
*/
|
|
@@ -501,11 +501,11 @@ export class Project extends Endpoint {
|
|
|
501
501
|
* - `write` - The ability to modify file name, description and references.
|
|
502
502
|
* - `readViewpoint` - The ability to read file viewpoints.
|
|
503
503
|
* - `createViewpoint` - The ability to create file viewpoints.
|
|
504
|
+
* - `deleteViewpoint` - The ability to delete file viewpoints.
|
|
504
505
|
*
|
|
505
|
-
* @param _public - Specifies whether all users have access to the file or not.
|
|
506
506
|
* @returns Returns a file instance added to the project.
|
|
507
507
|
*/
|
|
508
|
-
async addModel(fileId: string, actions: string | string[]
|
|
508
|
+
async addModel(fileId: string, actions: string | string[]): Promise<File> {
|
|
509
509
|
const files = new Endpoint("/files", this.httpClient, this.headers);
|
|
510
510
|
const file = await files
|
|
511
511
|
.get(`/${fileId}`)
|
|
@@ -513,7 +513,7 @@ export class Project extends Endpoint {
|
|
|
513
513
|
.then((data) => new File(data, this.httpClient));
|
|
514
514
|
|
|
515
515
|
const grantedTo = [{ project: { id: this.id, name: this.name } }];
|
|
516
|
-
await file.createPermission(actions, grantedTo
|
|
516
|
+
await file.createPermission(actions, grantedTo);
|
|
517
517
|
|
|
518
518
|
return file;
|
|
519
519
|
}
|
package/src/Api/User.ts
CHANGED
|
@@ -233,7 +233,7 @@ export class User extends Endpoint {
|
|
|
233
233
|
}
|
|
234
234
|
|
|
235
235
|
/**
|
|
236
|
-
* The identity provider used to create the account. Can be `ldap`, `oauth`, `saml
|
|
236
|
+
* The identity provider used to create the account. Can be `ldap`, `oauth`, `saml`, or empty for local
|
|
237
237
|
* accounts.
|
|
238
238
|
*
|
|
239
239
|
* @readonly
|