@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/dist/client.js
CHANGED
|
@@ -511,7 +511,7 @@
|
|
|
511
511
|
/**
|
|
512
512
|
* @param data - Raw test data received from the server.
|
|
513
513
|
* @param basePath - The clash test API base path of the file/assembly that owns the test.
|
|
514
|
-
* @param httpClient - HTTP client instance used to send
|
|
514
|
+
* @param httpClient - HTTP client instance used to send requests to the REST API server.
|
|
515
515
|
*/
|
|
516
516
|
constructor(data, basePath, httpClient) {
|
|
517
517
|
this.httpClient = httpClient;
|
|
@@ -592,14 +592,6 @@
|
|
|
592
592
|
/**
|
|
593
593
|
* Test owner information.
|
|
594
594
|
*
|
|
595
|
-
* @property {string} userId - User ID.
|
|
596
|
-
* @property {string} userName - User name.
|
|
597
|
-
* @property {string} name - First name.
|
|
598
|
-
* @property {string} lastName - Last name.
|
|
599
|
-
* @property {string} fullName - Full name.
|
|
600
|
-
* @property {string} initials - Initials.
|
|
601
|
-
* @property {string} email - User email.
|
|
602
|
-
* @property {string} avatarUrl - User avatar image URL.
|
|
603
595
|
* @readonly
|
|
604
596
|
*/
|
|
605
597
|
get owner() {
|
|
@@ -751,13 +743,13 @@
|
|
|
751
743
|
// acknowledge and accept the above terms.
|
|
752
744
|
///////////////////////////////////////////////////////////////////////////////
|
|
753
745
|
/**
|
|
754
|
-
* Provides properties and methods for obtaining information about an assembly on the
|
|
755
|
-
* and managing its data.
|
|
746
|
+
* Provides properties and methods for obtaining information about an assembly on the Open
|
|
747
|
+
* Cloud Server and managing its data.
|
|
756
748
|
*/
|
|
757
749
|
class Assembly {
|
|
758
750
|
/**
|
|
759
751
|
* @param data - Raw assembly data received from the server.
|
|
760
|
-
* @param httpClient - HTTP client instance used to send
|
|
752
|
+
* @param httpClient - HTTP client instance used to send requests to the REST API server..
|
|
761
753
|
*/
|
|
762
754
|
constructor(data, httpClient) {
|
|
763
755
|
this.path = `/assemblies/${data.id}`;
|
|
@@ -868,14 +860,6 @@
|
|
|
868
860
|
/**
|
|
869
861
|
* Assembly owner information.
|
|
870
862
|
*
|
|
871
|
-
* @property {string} userId - User ID.
|
|
872
|
-
* @property {string} userName - User name.
|
|
873
|
-
* @property {string} name - First name.
|
|
874
|
-
* @property {string} lastName - Last name.
|
|
875
|
-
* @property {string} fullName - Full name.
|
|
876
|
-
* @property {string} initials - Initials.
|
|
877
|
-
* @property {string} email - User email.
|
|
878
|
-
* @property {string} avatarUrl - User avatar image URL.
|
|
879
863
|
* @readonly
|
|
880
864
|
*/
|
|
881
865
|
get owner() {
|
|
@@ -1566,7 +1550,7 @@
|
|
|
1566
1550
|
},
|
|
1567
1551
|
}));
|
|
1568
1552
|
}
|
|
1569
|
-
async downloadFileRange(relativePath,
|
|
1553
|
+
async downloadFileRange(relativePath, reserved, ranges, onProgress, signal) {
|
|
1570
1554
|
const headers = { ...this.headers };
|
|
1571
1555
|
headers["Range"] = "bytes=" + ranges.map((x) => `${x.begin}-${x.end}`).join(",");
|
|
1572
1556
|
const response = await $fetch(`${this.serverUrl}${relativePath}`, { method: "GET", headers, signal });
|
|
@@ -1643,7 +1627,7 @@
|
|
|
1643
1627
|
/**
|
|
1644
1628
|
* @param data - Raw permission data received from the server.
|
|
1645
1629
|
* @param fileId - Owner file ID.
|
|
1646
|
-
* @param httpClient - HTTP client instance used to send
|
|
1630
|
+
* @param httpClient - HTTP client instance used to send requests to the REST API server.
|
|
1647
1631
|
*/
|
|
1648
1632
|
constructor(data, fileId, httpClient) {
|
|
1649
1633
|
this.httpClient = httpClient;
|
|
@@ -1694,19 +1678,7 @@
|
|
|
1694
1678
|
return this.data.id;
|
|
1695
1679
|
}
|
|
1696
1680
|
/**
|
|
1697
|
-
*
|
|
1698
|
-
* project that will get access to the file.
|
|
1699
|
-
*
|
|
1700
|
-
* @typedef {any} Principial
|
|
1701
|
-
* @property {any} user - The user entry that get access to the file.
|
|
1702
|
-
* @property {string} user.id - User ID.
|
|
1703
|
-
* @property {string} user.name - User name.
|
|
1704
|
-
* @property {any} project - The project entry that get access to the file.
|
|
1705
|
-
* @property {string} project.id - Project ID.
|
|
1706
|
-
* @property {string} project.name - Project name.
|
|
1707
|
-
*/
|
|
1708
|
-
/**
|
|
1709
|
-
* A list of principials that will get access to the file.
|
|
1681
|
+
* A list of entities that will get access to the file.
|
|
1710
1682
|
*/
|
|
1711
1683
|
get grantedTo() {
|
|
1712
1684
|
return this.data.grantedTo;
|
|
@@ -1781,12 +1753,12 @@
|
|
|
1781
1753
|
// acknowledge and accept the above terms.
|
|
1782
1754
|
///////////////////////////////////////////////////////////////////////////////
|
|
1783
1755
|
/**
|
|
1784
|
-
* Provides properties and methods for obtaining information about a job on the
|
|
1756
|
+
* Provides properties and methods for obtaining information about a job on the Open Cloud Server.
|
|
1785
1757
|
*/
|
|
1786
1758
|
class Job {
|
|
1787
1759
|
/**
|
|
1788
1760
|
* @param data - Raw job data received from the server.
|
|
1789
|
-
* @param httpClient - HTTP client instance used to send
|
|
1761
|
+
* @param httpClient - HTTP client instance used to send requests to the REST API server.
|
|
1790
1762
|
*/
|
|
1791
1763
|
constructor(data, httpClient) {
|
|
1792
1764
|
this.httpClient = httpClient;
|
|
@@ -1996,13 +1968,13 @@
|
|
|
1996
1968
|
// acknowledge and accept the above terms.
|
|
1997
1969
|
///////////////////////////////////////////////////////////////////////////////
|
|
1998
1970
|
/**
|
|
1999
|
-
* Provides properties and methods for obtaining information about a file on the
|
|
2000
|
-
* managing its data and versions.
|
|
1971
|
+
* Provides properties and methods for obtaining information about a file on the Open Cloud
|
|
1972
|
+
* Server and managing its data and versions.
|
|
2001
1973
|
*/
|
|
2002
1974
|
class File {
|
|
2003
1975
|
/**
|
|
2004
1976
|
* @param data - Raw file data received from the server.
|
|
2005
|
-
* @param httpClient - HTTP client instance used to send
|
|
1977
|
+
* @param httpClient - HTTP client instance used to send requests to the REST API server.
|
|
2006
1978
|
*/
|
|
2007
1979
|
constructor(data, httpClient) {
|
|
2008
1980
|
this.path = `/files/${data.id}`;
|
|
@@ -2166,14 +2138,6 @@
|
|
|
2166
2138
|
/**
|
|
2167
2139
|
* File owner information.
|
|
2168
2140
|
*
|
|
2169
|
-
* @property {string} userId - User ID.
|
|
2170
|
-
* @property {string} userName - User name.
|
|
2171
|
-
* @property {string} name - First name.
|
|
2172
|
-
* @property {string} lastName - Last name.
|
|
2173
|
-
* @property {string} fullName - Full name.
|
|
2174
|
-
* @property {string} initials - Initials.
|
|
2175
|
-
* @property {string} email - User email.
|
|
2176
|
-
* @property {string} avatarUrl - User avatar image URL.
|
|
2177
2141
|
* @readonly
|
|
2178
2142
|
*/
|
|
2179
2143
|
get owner() {
|
|
@@ -2242,14 +2206,6 @@
|
|
|
2242
2206
|
/**
|
|
2243
2207
|
* Information about the user who made the last update.
|
|
2244
2208
|
*
|
|
2245
|
-
* @property {string} userId - User ID.
|
|
2246
|
-
* @property {string} userName - User name.
|
|
2247
|
-
* @property {string} name - First name.
|
|
2248
|
-
* @property {string} lastName - Last name.
|
|
2249
|
-
* @property {string} fullName - Full name.
|
|
2250
|
-
* @property {string} initials - Initials.
|
|
2251
|
-
* @property {string} email - User email.
|
|
2252
|
-
* @property {string} avatarUrl - User avatar image URL.
|
|
2253
2209
|
* @readonly
|
|
2254
2210
|
*/
|
|
2255
2211
|
get updatedBy() {
|
|
@@ -2679,6 +2635,16 @@
|
|
|
2679
2635
|
/**
|
|
2680
2636
|
* Creates a new file permission.
|
|
2681
2637
|
*
|
|
2638
|
+
* @example <caption>Grant the specified user permission to "update" the file.</caption>
|
|
2639
|
+
* const action = "update";
|
|
2640
|
+
* const grantedTo = [{ user: { id: myUser.id, email: myUser.email } }];
|
|
2641
|
+
* await file.createPermission(action, grantedTo);
|
|
2642
|
+
*
|
|
2643
|
+
* @example <caption>Add a file to the specified project in `read-only` mode.</caption>
|
|
2644
|
+
* const actions = ["read", "readSourceFile"];
|
|
2645
|
+
* const grantedTo = [{ project: { id: myProject.id, name: myProject.name } }];
|
|
2646
|
+
* await file.createPermission(actions, grantedTo);
|
|
2647
|
+
*
|
|
2682
2648
|
* @param actions - Actions are allowed to be performed on a file with this permission:
|
|
2683
2649
|
*
|
|
2684
2650
|
* - `read` - The ability to read file description, geometry data and properties.
|
|
@@ -2687,7 +2653,7 @@
|
|
|
2687
2653
|
* - `readViewpoint` - The ability to read file viewpoints.
|
|
2688
2654
|
* - `createViewpoint` - The ability to create file viewpoints.
|
|
2689
2655
|
*
|
|
2690
|
-
* @param grantedTo - A list of
|
|
2656
|
+
* @param grantedTo - A list of entities that will get access to the file.
|
|
2691
2657
|
* @param _public - Specifies whether all users have access to the file or not.
|
|
2692
2658
|
*/
|
|
2693
2659
|
createPermission(actions, grantedTo, _public) {
|
|
@@ -2868,7 +2834,7 @@
|
|
|
2868
2834
|
/**
|
|
2869
2835
|
* @param data - Raw role data received from the server.
|
|
2870
2836
|
* @param projectId - Owner project ID.
|
|
2871
|
-
* @param httpClient - HTTP client instance used to send
|
|
2837
|
+
* @param httpClient - HTTP client instance used to send requests to the REST API server.
|
|
2872
2838
|
*/
|
|
2873
2839
|
constructor(data, projectId, httpClient) {
|
|
2874
2840
|
this.httpClient = httpClient;
|
|
@@ -2915,20 +2881,6 @@
|
|
|
2915
2881
|
}
|
|
2916
2882
|
/**
|
|
2917
2883
|
* Role actions are allowed to be performed.
|
|
2918
|
-
*
|
|
2919
|
-
* @property {string[]} projectActions - Actions are allowed to be performed at the project
|
|
2920
|
-
* level: `update`, `createTopic`, `createDocument`.
|
|
2921
|
-
* @property {string[]} topicActions - Actions are allowed to be performed at the topic
|
|
2922
|
-
* level: `update`, `updateBimSnippet`, `updateRelatedTopics`, `updateDocumentReferences`,
|
|
2923
|
-
* `updateFiles`, `createComment`, `createViewpoint`, `delete`.
|
|
2924
|
-
* @property {string[]} commentActions - Actions are allowed to be performed at the comment
|
|
2925
|
-
* level: `update`, `delete`.
|
|
2926
|
-
* @property {string[]} viewpointActions - Actions are allowed to be performed at the
|
|
2927
|
-
* viewpoint level: `delete`.
|
|
2928
|
-
* @property {string[]} odaGroupActions - Actions are allowed to be performed at the members
|
|
2929
|
-
* level: `update`, `delete`.
|
|
2930
|
-
* @property {string[]} odaRoleActions - Actions are allowed to be performed at the roles
|
|
2931
|
-
* level: `update`, `delete`.
|
|
2932
2884
|
*/
|
|
2933
2885
|
get permissions() {
|
|
2934
2886
|
return this.data.permissions;
|
|
@@ -3001,7 +2953,7 @@
|
|
|
3001
2953
|
/**
|
|
3002
2954
|
* @param data - Raw member data received from the server.
|
|
3003
2955
|
* @param projectId - Owner project ID.
|
|
3004
|
-
* @param httpClient - HTTP client instance used to send
|
|
2956
|
+
* @param httpClient - HTTP client instance used to send requests to the REST API server.
|
|
3005
2957
|
*/
|
|
3006
2958
|
constructor(data, projectId, httpClient) {
|
|
3007
2959
|
this.httpClient = httpClient;
|
|
@@ -3040,7 +2992,8 @@
|
|
|
3040
2992
|
return this.data.id;
|
|
3041
2993
|
}
|
|
3042
2994
|
/**
|
|
3043
|
-
* Member role. See {@link Project.getRoles | Project.getRoles()} for
|
|
2995
|
+
* Member role name in the project. See {@link Project.getRoles | Project.getRoles()} for list
|
|
2996
|
+
* of project roles.
|
|
3044
2997
|
*/
|
|
3045
2998
|
get role() {
|
|
3046
2999
|
return this.data.role;
|
|
@@ -3059,14 +3012,6 @@
|
|
|
3059
3012
|
/**
|
|
3060
3013
|
* User information.
|
|
3061
3014
|
*
|
|
3062
|
-
* @property {string} userId - User ID.
|
|
3063
|
-
* @property {string} userName - User name.
|
|
3064
|
-
* @property {string} name - First name.
|
|
3065
|
-
* @property {string} lastName - Last name.
|
|
3066
|
-
* @property {string} fullName - Full name.
|
|
3067
|
-
* @property {string} initials - Initials.
|
|
3068
|
-
* @property {string} email - User email.
|
|
3069
|
-
* @property {string} avatarUrl - User avatar image URL.
|
|
3070
3015
|
* @readonly
|
|
3071
3016
|
*/
|
|
3072
3017
|
get user() {
|
|
@@ -3130,13 +3075,13 @@
|
|
|
3130
3075
|
// acknowledge and accept the above terms.
|
|
3131
3076
|
///////////////////////////////////////////////////////////////////////////////
|
|
3132
3077
|
/**
|
|
3133
|
-
* Provides properties and methods for obtaining information about a project on the
|
|
3134
|
-
* managing its {@link Role | roles}, {@link Member | members} and models.
|
|
3078
|
+
* Provides properties and methods for obtaining information about a project on the Open Cloud
|
|
3079
|
+
* Server and managing its {@link Role | roles}, {@link Member | members} and models.
|
|
3135
3080
|
*/
|
|
3136
3081
|
class Project {
|
|
3137
3082
|
/**
|
|
3138
3083
|
* @param data - Raw project data received from the server.
|
|
3139
|
-
* @param httpClient - HTTP client instance used to send
|
|
3084
|
+
* @param httpClient - HTTP client instance used to send requests to the REST API server.
|
|
3140
3085
|
*/
|
|
3141
3086
|
constructor(data, httpClient) {
|
|
3142
3087
|
this.httpClient = httpClient;
|
|
@@ -3252,14 +3197,6 @@
|
|
|
3252
3197
|
/**
|
|
3253
3198
|
* Project owner information.
|
|
3254
3199
|
*
|
|
3255
|
-
* @property {string} userId - User ID.
|
|
3256
|
-
* @property {string} userName - User name.
|
|
3257
|
-
* @property {string} name - First name.
|
|
3258
|
-
* @property {string} lastName - Last name.
|
|
3259
|
-
* @property {string} fullName - Full name.
|
|
3260
|
-
* @property {string} initials - Initials.
|
|
3261
|
-
* @property {string} email - User email.
|
|
3262
|
-
* @property {string} avatarUrl - User avatar image URL.
|
|
3263
3200
|
* @readonly
|
|
3264
3201
|
*/
|
|
3265
3202
|
get owner() {
|
|
@@ -3406,8 +3343,7 @@
|
|
|
3406
3343
|
*
|
|
3407
3344
|
* @param name - Role name.
|
|
3408
3345
|
* @param description - Role description.
|
|
3409
|
-
* @param permissions - Actions are allowed to be performed
|
|
3410
|
-
* more details.
|
|
3346
|
+
* @param permissions - Actions are allowed to be performed for the role.
|
|
3411
3347
|
*/
|
|
3412
3348
|
createRole(name, description, permissions) {
|
|
3413
3349
|
return this.internalPost("/roles", {
|
|
@@ -3449,7 +3385,7 @@
|
|
|
3449
3385
|
* Add a user to the project to become a member and have permission to perform actions.
|
|
3450
3386
|
*
|
|
3451
3387
|
* @param userId - User ID.
|
|
3452
|
-
* @param role - Role name from the list of project roles.
|
|
3388
|
+
* @param role - Role name from the list of project {@link getRoles | roles}.
|
|
3453
3389
|
*/
|
|
3454
3390
|
addMember(userId, role) {
|
|
3455
3391
|
return this.internalPost("/members", { userId, role })
|
|
@@ -3478,8 +3414,11 @@
|
|
|
3478
3414
|
* @property {string} file.reference - File ID.
|
|
3479
3415
|
*/
|
|
3480
3416
|
/**
|
|
3481
|
-
* Returns a list of project files.
|
|
3482
|
-
*
|
|
3417
|
+
* Returns a list of project files.
|
|
3418
|
+
*
|
|
3419
|
+
* This list contains all files that the project has access to. To add a file to this list,
|
|
3420
|
+
* create a {@link IGrantedTo.project | project} permission on the file using
|
|
3421
|
+
* {@link File.createPermission | File.createPermission()}.
|
|
3483
3422
|
*/
|
|
3484
3423
|
getFilesInformation() {
|
|
3485
3424
|
return this.httpClient
|
|
@@ -3548,12 +3487,13 @@
|
|
|
3548
3487
|
// acknowledge and accept the above terms.
|
|
3549
3488
|
///////////////////////////////////////////////////////////////////////////////
|
|
3550
3489
|
/**
|
|
3551
|
-
* Provides properties and methods for obtaining information about a
|
|
3490
|
+
* Provides properties and methods for obtaining information about a Open Cloud Server user and
|
|
3491
|
+
* manage its data.
|
|
3552
3492
|
*/
|
|
3553
3493
|
class User {
|
|
3554
3494
|
/**
|
|
3555
3495
|
* @param data - Raw user data received from the server.
|
|
3556
|
-
* @param httpClient - HTTP client instance used to send
|
|
3496
|
+
* @param httpClient - HTTP client instance used to send requests to the REST API server.
|
|
3557
3497
|
*/
|
|
3558
3498
|
constructor(data, httpClient) {
|
|
3559
3499
|
this.httpClient = httpClient;
|
|
@@ -3957,7 +3897,8 @@
|
|
|
3957
3897
|
// acknowledge and accept the above terms.
|
|
3958
3898
|
///////////////////////////////////////////////////////////////////////////////
|
|
3959
3899
|
/**
|
|
3960
|
-
* Provides methods for managing
|
|
3900
|
+
* Provides methods for managing Open Cloud Server resources such as users, files, assemblies,
|
|
3901
|
+
* jobs, projects, etc.
|
|
3961
3902
|
*/
|
|
3962
3903
|
class Client extends EventEmitter2 {
|
|
3963
3904
|
/**
|
|
@@ -3974,7 +3915,7 @@
|
|
|
3974
3915
|
this.configure(params);
|
|
3975
3916
|
}
|
|
3976
3917
|
/**
|
|
3977
|
-
* Open Cloud
|
|
3918
|
+
* Open Cloud REST API server base URL. Use {@link configure | configure()} to change server URL.
|
|
3978
3919
|
*
|
|
3979
3920
|
* @readonly
|
|
3980
3921
|
*/
|
|
@@ -3982,7 +3923,7 @@
|
|
|
3982
3923
|
return this._serverUrl;
|
|
3983
3924
|
}
|
|
3984
3925
|
/**
|
|
3985
|
-
* HTTP client instance used to send
|
|
3926
|
+
* HTTP client instance used to send requests to the REST API server.
|
|
3986
3927
|
*
|
|
3987
3928
|
* @readonly
|
|
3988
3929
|
*/
|
|
@@ -4062,7 +4003,7 @@
|
|
|
4062
4003
|
.then((data) => ({
|
|
4063
4004
|
...data,
|
|
4064
4005
|
server: data.version,
|
|
4065
|
-
client: "25.9.
|
|
4006
|
+
client: "25.9.4",
|
|
4066
4007
|
}));
|
|
4067
4008
|
}
|
|
4068
4009
|
/**
|
|
@@ -4777,7 +4718,7 @@
|
|
|
4777
4718
|
// By use of this software, its documentation or related materials, you
|
|
4778
4719
|
// acknowledge and accept the above terms.
|
|
4779
4720
|
///////////////////////////////////////////////////////////////////////////////
|
|
4780
|
-
const version = "25.9.
|
|
4721
|
+
const version = "25.9.4";
|
|
4781
4722
|
|
|
4782
4723
|
exports.Assembly = Assembly;
|
|
4783
4724
|
exports.ClashTest = ClashTest;
|