@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.
Files changed (44) hide show
  1. package/dist/client.js +434 -449
  2. package/dist/client.js.map +1 -1
  3. package/dist/client.min.js +1 -1
  4. package/dist/client.module.js +35 -35
  5. package/dist/client.module.js.map +1 -1
  6. package/lib/Api/Assembly.d.ts +65 -69
  7. package/lib/Api/ClashTest.d.ts +16 -16
  8. package/lib/Api/Client.d.ts +78 -77
  9. package/lib/Api/Endpoint.d.ts +6 -6
  10. package/lib/Api/FetchError.d.ts +5 -5
  11. package/lib/Api/File.d.ts +120 -132
  12. package/lib/Api/IHttpClient.d.ts +4 -3
  13. package/lib/Api/IRole.d.ts +6 -6
  14. package/lib/Api/ISharedLink.d.ts +1 -1
  15. package/lib/Api/IUser.d.ts +4 -4
  16. package/lib/Api/Job.d.ts +12 -12
  17. package/lib/Api/Member.d.ts +6 -6
  18. package/lib/Api/Model.d.ts +18 -18
  19. package/lib/Api/OAuthClient.d.ts +10 -10
  20. package/lib/Api/Permission.d.ts +17 -20
  21. package/lib/Api/Project.d.ts +14 -13
  22. package/lib/Api/Role.d.ts +2 -2
  23. package/lib/Api/SharedLink.d.ts +2 -2
  24. package/lib/Api/User.d.ts +33 -31
  25. package/package.json +2 -2
  26. package/src/Api/Assembly.ts +66 -70
  27. package/src/Api/ClashTest.ts +16 -16
  28. package/src/Api/Client.ts +78 -77
  29. package/src/Api/Endpoint.ts +6 -6
  30. package/src/Api/FetchError.ts +5 -5
  31. package/src/Api/File.ts +121 -133
  32. package/src/Api/IHttpClient.ts +4 -3
  33. package/src/Api/IRole.ts +6 -6
  34. package/src/Api/ISharedLink.ts +1 -1
  35. package/src/Api/IUser.ts +4 -4
  36. package/src/Api/Job.ts +12 -12
  37. package/src/Api/Member.ts +6 -6
  38. package/src/Api/Model.ts +18 -18
  39. package/src/Api/OAuthClient.ts +10 -10
  40. package/src/Api/Permission.ts +17 -20
  41. package/src/Api/Project.ts +14 -13
  42. package/src/Api/Role.ts +2 -2
  43. package/src/Api/SharedLink.ts +2 -2
  44. package/src/Api/User.ts +33 -31
@@ -5,8 +5,8 @@ import type { IFileReferences } from "./IFile";
5
5
  import type { IModelTransformMatrix } from "./IAssembly";
6
6
  /**
7
7
  * Provides properties and methods for working with view of the {@link File | file} or
8
- * {@link Assembly| assembly}. For example, for `dwg` it is a `Model` space or layout, and for `rvt` files
9
- * it is a `3D` view.
8
+ * {@link Assembly| assembly}. For example, for `dwg` it is a `Model` space or layout, and for
9
+ * `rvt` files it is a `3D` view.
10
10
  */
11
11
  export declare class Model extends Endpoint {
12
12
  private _data;
@@ -30,8 +30,8 @@ export declare class Model extends Endpoint {
30
30
  get data(): any;
31
31
  private set data(value);
32
32
  /**
33
- * Scene description resource file name. Use {@link downloadResource | downloadResource()} to download
34
- * scene description file.
33
+ * Scene description resource file name. Use {@link downloadResource | downloadResource()} to
34
+ * download scene description file.
35
35
  *
36
36
  * @readonly
37
37
  */
@@ -55,8 +55,8 @@ export declare class Model extends Endpoint {
55
55
  */
56
56
  get fileId(): string;
57
57
  /**
58
- * The list of geometry data resource files. Use {@link downloadResource | downloadResource()} to
59
- * download geometry data files.
58
+ * The list of geometry data resource files. Use {@link downloadResource | downloadResource()}
59
+ * to download geometry data files.
60
60
  *
61
61
  * @readonly
62
62
  */
@@ -103,8 +103,8 @@ export declare class Model extends Endpoint {
103
103
  */
104
104
  getViewpoints(): Promise<any[]>;
105
105
  /**
106
- * Saves a new model owner file/assembly viewpoint to the server. To create a new viewpoint use
107
- * `Viewer.createViewpoint()`.
106
+ * Saves a new model owner file/assembly viewpoint to the server. To create a new viewpoint
107
+ * use `Viewer.createViewpoint()`.
108
108
  *
109
109
  * @param viewpoint - Viewpoint object.
110
110
  */
@@ -131,27 +131,27 @@ export declare class Model extends Endpoint {
131
131
  */
132
132
  getSnapshotData(guid: string, bitmapGuid: string): Promise<string>;
133
133
  /**
134
- * Downloads a resource file. Resource files are files that contain model scene descriptions, or
135
- * geometry data.
134
+ * Downloads a resource file. Resource files are files that contain model scene descriptions,
135
+ * or geometry data.
136
136
  *
137
137
  * @param dataId - Resource file name.
138
138
  * @param onProgress - Download progress callback.
139
139
  * @param signal - An
140
- * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController} signal. Allows
141
- * to communicate with a fetch request and abort it if desired.
140
+ * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
141
+ * signal. Allows to communicate with a fetch request and abort it if desired.
142
142
  */
143
143
  downloadResource(dataId: string, onProgress?: (progress: number, chunk: Uint8Array) => void, signal?: AbortSignal): Promise<ArrayBuffer>;
144
144
  /**
145
- * Downloads a part of resource file. Resource files are files that contain model scene descriptions,
146
- * or geometry data.
145
+ * Downloads a part of resource file. Resource files are files that contain model scene
146
+ * descriptions, or geometry data.
147
147
  *
148
148
  * @param dataId - Resource file name.
149
149
  * @param ranges - A range of resource file contents to download.
150
150
  * @param requestId - Request ID for download progress callback.
151
151
  * @param onProgress - Download progress callback.
152
152
  * @param signal - An
153
- * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController} signal. Allows
154
- * to communicate with a fetch request and abort it if desired.
153
+ * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
154
+ * signal. Allows to communicate with a fetch request and abort it if desired.
155
155
  */
156
156
  downloadResourceRange(dataId: string, requestId: number, ranges: Array<{
157
157
  begin: number;
@@ -176,8 +176,8 @@ export declare class Model extends Endpoint {
176
176
  * References are images, fonts, or any other files to correct rendering of the file.
177
177
  *
178
178
  * @param signal - An
179
- * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController} signal, which
180
- * can be used to abort waiting as desired.
179
+ * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
180
+ * signal, which can be used to abort waiting as desired.
181
181
  */
182
182
  getReferences(signal?: AbortSignal): Promise<IFileReferences>;
183
183
  }
@@ -1,8 +1,8 @@
1
1
  import { IHttpClient } from "./IHttpClient";
2
2
  import { Endpoint } from "./Endpoint";
3
3
  /**
4
- * Provides properties and methods for obtaining information about a OAuth 2.0 client that have access
5
- * the Open Cloud Server API.
4
+ * Provides properties and methods for obtaining information about a OAuth 2.0 client that have
5
+ * access the Open Cloud Server API.
6
6
  */
7
7
  export declare class OAuthClient extends Endpoint {
8
8
  private _data;
@@ -72,8 +72,8 @@ export declare class OAuthClient extends Endpoint {
72
72
  /**
73
73
  * Updates client data on the server.
74
74
  *
75
- * Only administrators can update OAuth clients. If the current logged in user is not an administrator,
76
- * an exception will be thrown.
75
+ * Only administrators can update OAuth clients. If the current logged in user is not an
76
+ * administrator, an exception will be thrown.
77
77
  *
78
78
  * @param data - Raw client data. For more information, see
79
79
  * {@link https://cloud.opendesign.com/docs//pages/server/api.html#OAuthClient | Open Cloud OAuth Clients API}.
@@ -82,19 +82,19 @@ export declare class OAuthClient extends Endpoint {
82
82
  /**
83
83
  * Deletes a client from the server.
84
84
  *
85
- * Only administrators can delete OAuth clients. If the current logged in user is not an administrator,
86
- * an exception will be thrown.
85
+ * Only administrators can delete OAuth clients. If the current logged in user is not an
86
+ * administrator, an exception will be thrown.
87
87
  *
88
88
  * @returns Returns the raw data of a deleted client. For more information, see
89
89
  * {@link https://cloud.opendesign.com/docs//pages/server/api.html#OAuthClient | Open Cloud OAuth Clients API}.
90
90
  */
91
91
  delete(): Promise<any>;
92
92
  /**
93
- * Saves client properties changes to the server. Call this method to update client data on the server
94
- * after any property changes.
93
+ * Saves client properties changes to the server. Call this method to update client data on
94
+ * the server after any property changes.
95
95
  *
96
- * Only administrators can update OAuth clients. If the current logged in user is not an administrator,
97
- * an exception will be thrown.
96
+ * Only administrators can update OAuth clients. If the current logged in user is not an
97
+ * administrator, an exception will be thrown.
98
98
  */
99
99
  save(): Promise<this>;
100
100
  /**
@@ -2,8 +2,8 @@ import { IHttpClient } from "./IHttpClient";
2
2
  import { Endpoint } from "./Endpoint";
3
3
  import { IGrantedTo } from "./IFile";
4
4
  /**
5
- * Provides properties and methods for obtaining information about {@link File | file} actions granted to
6
- * a specific user, project, or group.
5
+ * Provides properties and methods for obtaining information about {@link File | file} actions
6
+ * granted to a specific user, project, or group.
7
7
  */
8
8
  export declare class Permission extends Endpoint {
9
9
  private _data;
@@ -23,22 +23,19 @@ export declare class Permission extends Endpoint {
23
23
  * - `readViewpoint` - The ability to read file viewpoints.
24
24
  * - `createViewpoint` - The ability to create file viewpoints.
25
25
  *
26
- * @example Change file permissions for the the specified project.
27
- *
28
- * ```javascript
29
- * const myFile = client.getFile(myFileId);
30
- * const permissions = await myFile.getPermissions();
31
- * const projectPermissions = permissions.filter((permission) =>
32
- * permission.grantedTo.some((x) => x.project?.id === myProjectId)
33
- * );
34
- * const newActions = ["read", "readSourceFile", "update"];
35
- * await Promise.all(
36
- * projectPermissions.map((permission) => {
37
- * permission.actions = newActions;
38
- * return permission.save();
39
- * })
40
- * );
41
- * ```
26
+ * @example <caption>Change file permissions for the the specified project.</caption>
27
+ * const myFile = client.getFile(myFileId);
28
+ * const permissions = await myFile.getPermissions();
29
+ * const projectPermissions = permissions.filter((permission) =>
30
+ * permission.grantedTo.some((x) => x.project?.id === myProjectId)
31
+ * );
32
+ * const newActions = ["read", "readSourceFile", "update"];
33
+ * await Promise.all(
34
+ * projectPermissions.map((permission) => {
35
+ * permission.actions = newActions;
36
+ * return permission.save();
37
+ * })
38
+ * );
42
39
  */
43
40
  get actions(): string[];
44
41
  set actions(value: string[]);
@@ -85,8 +82,8 @@ export declare class Permission extends Endpoint {
85
82
  */
86
83
  delete(): Promise<any>;
87
84
  /**
88
- * Saves permission properties changes to the server. Call this method to update permission data on the
89
- * server after any property changes.
85
+ * Saves permission properties changes to the server. Call this method to update permission
86
+ * data on the server after any property changes.
90
87
  */
91
88
  save(): Promise<this>;
92
89
  }
@@ -6,8 +6,8 @@ import { IRoleActions } from "./IRole";
6
6
  import { Member } from "./Member";
7
7
  import { File } from "./File";
8
8
  /**
9
- * Provides properties and methods for obtaining information about a project on the Open Cloud Server and
10
- * managing its {@link Role | roles}, {@link Member | members} and models.
9
+ * Provides properties and methods for obtaining information about a project on the Open Cloud
10
+ * Server and managing its {@link Role | roles}, {@link Member | members} and models.
11
11
  */
12
12
  export declare class Project extends Endpoint {
13
13
  private _data;
@@ -142,19 +142,20 @@ export declare class Project extends Endpoint {
142
142
  */
143
143
  delete(): Promise<any>;
144
144
  /**
145
- * Saves project properties changes to the server. Call this method to update project data on the
146
- * server after any property changes.
145
+ * Saves project properties changes to the server. Call this method to update project data on
146
+ * the server after any property changes.
147
147
  */
148
148
  save(): Promise<this>;
149
149
  /**
150
150
  * Sets or removes the project preview.
151
151
  *
152
152
  * @param image - Preview image. Can be a
153
- * {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL} string,
153
+ * {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}
154
+ * string,
154
155
  * {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer | ArrayBuffer},
155
156
  * {@link https://developer.mozilla.org/docs/Web/API/Blob/Blob | Blob} or
156
- * {@link https://developer.mozilla.org/docs/Web/API/File | Web API File} object. Setting the `image`
157
- * to `null` will remove the preview.
157
+ * {@link https://developer.mozilla.org/docs/Web/API/File | Web API File} object. Setting
158
+ * the `image` to `null` will remove the preview.
158
159
  */
159
160
  setPreview(image?: BodyInit | null): Promise<this>;
160
161
  /**
@@ -162,8 +163,8 @@ export declare class Project extends Endpoint {
162
163
  */
163
164
  deletePreview(): Promise<this>;
164
165
  /**
165
- * Returns a list of project roles. Project members have different abilities depending on the role they
166
- * have in a project.
166
+ * Returns a list of project roles. Project members have different abilities depending on the
167
+ * role they have in a project.
167
168
  */
168
169
  getRoles(): Promise<Role[]>;
169
170
  /**
@@ -217,8 +218,8 @@ export declare class Project extends Endpoint {
217
218
  * Information about the file (model) that can be reference in the project topics.
218
219
  *
219
220
  * @typedef {any} FileInformation
220
- * @property {any[]} display_information - The list of fields to allow users to associate the file with
221
- * a server model.
221
+ * @property {any[]} display_information - The list of fields to allow users to associate the
222
+ * file with a server model.
222
223
  * @property {string} display_information.field_display_name - Field display name.
223
224
  * @property {string} display_information.field_value - Field value.
224
225
  * @property {any} file - The file reference object.
@@ -229,8 +230,8 @@ export declare class Project extends Endpoint {
229
230
  * Returns a list of project files. For more information, see
230
231
  * {@link https://cloud.opendesign.com/docs//pages/server/bcf3.html#ProjectFilesInformation | Open Cloud BCF3 API}.
231
232
  *
232
- * This list contains all files that the project has access to. To add a file to this list, create a
233
- * {@link IGrantedTo.project | project} permission on the file using
233
+ * This list contains all files that the project has access to. To add a file to this list,
234
+ * create a {@link IGrantedTo.project | project} permission on the file using
234
235
  * {@link File.createPermission | File.createPermission()}.
235
236
  */
236
237
  getFilesInformation(): Promise<any[]>;
package/lib/Api/Role.d.ts CHANGED
@@ -57,8 +57,8 @@ export declare class Role extends Endpoint {
57
57
  */
58
58
  delete(): Promise<any>;
59
59
  /**
60
- * Saves role properties changes to the server. Call this method to update role data on the server
61
- * after any property changes.
60
+ * Saves role properties changes to the server. Call this method to update role data on the
61
+ * server after any property changes.
62
62
  */
63
63
  save(): Promise<this>;
64
64
  }
@@ -63,8 +63,8 @@ export declare class SharedLink extends Endpoint {
63
63
  */
64
64
  delete(): Promise<any>;
65
65
  /**
66
- * Saves shared link properties changes to the server. Call this method to update shared link data on
67
- * the server after any property changes.
66
+ * Saves shared link properties changes to the server. Call this method to update shared link
67
+ * data on the server after any property changes.
68
68
  */
69
69
  save(): Promise<this>;
70
70
  }
package/lib/Api/User.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { IHttpClient } from "./IHttpClient";
2
2
  import { Endpoint } from "./Endpoint";
3
3
  /**
4
- * Provides properties and methods for obtaining information about a Open Cloud Server user and manage
5
- * its data.
4
+ * Provides properties and methods for obtaining information about a Open Cloud Server user and
5
+ * manage its data.
6
6
  */
7
7
  export declare class User extends Endpoint {
8
8
  private _data;
@@ -66,8 +66,8 @@ export declare class User extends Endpoint {
66
66
  get firstName(): string;
67
67
  set firstName(value: string);
68
68
  /**
69
- * Full name. Returns the user's first and last name. If first name and last names are empty, returns
70
- * the user name.
69
+ * Full name. Returns the user's first and last name. If first name and last names are empty,
70
+ * returns the user name.
71
71
  *
72
72
  * @readonly
73
73
  */
@@ -79,8 +79,8 @@ export declare class User extends Endpoint {
79
79
  */
80
80
  get id(): string;
81
81
  /**
82
- * User initials. Returns a first letters of the user's first and last names. If first name and last
83
- * names are empty, returns the first letter of the user name.
82
+ * User initials. Returns a first letters of the user's first and last names. If first name
83
+ * and last names are empty, returns the first letter of the user name.
84
84
  *
85
85
  * @readonly
86
86
  */
@@ -121,8 +121,8 @@ export declare class User extends Endpoint {
121
121
  get projectsLimit(): number;
122
122
  set projectsLimit(value: number);
123
123
  /**
124
- * The identity provider used to create the account. Can be `ldap`, `oauth`, `saml` or empty for local
125
- * accounts.
124
+ * The identity provider used to create the account. Can be `ldap`, `oauth`, `saml` or empty
125
+ * for local accounts.
126
126
  *
127
127
  * @readonly
128
128
  */
@@ -141,8 +141,8 @@ export declare class User extends Endpoint {
141
141
  */
142
142
  get storageUsed(): number;
143
143
  /**
144
- * The user's access token (API key). Use {@link Client.signInWithToken | Client.signInWithToken()} to
145
- * sign in to the server using this token.
144
+ * The user's access token (API key). Use
145
+ * {@link Client.signInWithToken | Client.signInWithToken()} to sign in to the server using this token.
146
146
  *
147
147
  * @readonly
148
148
  */
@@ -155,15 +155,15 @@ export declare class User extends Endpoint {
155
155
  /**
156
156
  * Reloads user data from the server.
157
157
  *
158
- * Only administrators can checkout other users. If the current logged in user is not an administrator,
159
- * they can only checkout themselves, otherwise an exception will be thrown.
158
+ * Only administrators can checkout other users. If the current logged in user is not an
159
+ * administrator, they can only checkout themselves, otherwise an exception will be thrown.
160
160
  */
161
161
  checkout(): Promise<this>;
162
162
  /**
163
163
  * Updates user data on the server.
164
164
  *
165
- * Only administrators can update other users. If the current logged in user is not an administrator,
166
- * they can only update themself, otherwise an exception will be thrown.
165
+ * Only administrators can update other users. If the current logged in user is not an
166
+ * administrator, they can only update themself, otherwise an exception will be thrown.
167
167
  *
168
168
  * @param data - Raw user data. For more information, see
169
169
  * {@link https://cloud.opendesign.com/docs//pages/server/api.html#Users | Open Cloud Users API}.
@@ -172,11 +172,11 @@ export declare class User extends Endpoint {
172
172
  /**
173
173
  * Deletes a user from the server.
174
174
  *
175
- * Only administrators can delete users. If the current logged in user is not an administrator, an
176
- * exception will be thrown.
175
+ * Only administrators can delete users. If the current logged in user is not an
176
+ * administrator, an exception will be thrown.
177
177
  *
178
- * Administrators can delete themselves or other administrators. An administrator can only delete
179
- * themself if they is not the last administrator.
178
+ * Administrators can delete themselves or other administrators. An administrator can only
179
+ * delete themself if they is not the last administrator.
180
180
  *
181
181
  * You need to re-login after deleting the current logged in user.
182
182
  *
@@ -185,42 +185,44 @@ export declare class User extends Endpoint {
185
185
  */
186
186
  delete(): Promise<any>;
187
187
  /**
188
- * Saves user properties changes to the server. Call this method to update user data on the server
189
- * after any property changes.
188
+ * Saves user properties changes to the server. Call this method to update user data on the
189
+ * server after any property changes.
190
190
  */
191
191
  save(): Promise<this>;
192
192
  /**
193
193
  * Sets or removes the user avatar.
194
194
  *
195
- * Only administrators can set the avatar of other users. If the current logged in user is not an
196
- * administrator, they can only set their avatar, otherwise an exception will be thrown.
195
+ * Only administrators can set the avatar of other users. If the current logged in user is
196
+ * not an administrator, they can only set their avatar, otherwise an exception will be thrown.
197
197
  *
198
198
  * @param image - Avatar image. Can be a
199
- * {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL} string,
199
+ * {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}
200
+ * string,
200
201
  * {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer | ArrayBuffer},
201
202
  * {@link https://developer.mozilla.org/docs/Web/API/Blob/Blob | Blob} or
202
- * {@link https://developer.mozilla.org/docs/Web/API/File | Web API File} object. Setting the `image`
203
- * to `null` will remove the avatar.
203
+ * {@link https://developer.mozilla.org/docs/Web/API/File | Web API File} object. Setting
204
+ * the `image` to `null` will remove the avatar.
204
205
  */
205
206
  setAvatar(image?: BodyInit | null): Promise<this>;
206
207
  /**
207
208
  * Removes the user avatar.
208
209
  *
209
- * Only administrators can remove the avatar of other users. If the current logged in user is not an
210
- * administrator, they can only remove their avatar, otherwise an exception will be thrown.
210
+ * Only administrators can remove the avatar of other users. If the current logged in user is
211
+ * not an administrator, they can only remove their avatar, otherwise an exception will be thrown.
211
212
  */
212
213
  deleteAvatar(): Promise<this>;
213
214
  /**
214
215
  * Changes the user password.
215
216
  *
216
- * Only administrators can change the passwords of other users. If the current logged in user is not an
217
- * administrator, they can only change their password, otherwise an exception will be thrown.
217
+ * Only administrators can change the passwords of other users. If the current logged in user
218
+ * is not an administrator, they can only change their password, otherwise an exception will
219
+ * be thrown.
218
220
  *
219
221
  * To change their password, non-administrator users must specify their old password.
220
222
  *
221
223
  * @param newPassword - New user password.
222
- * @param oldPassword - Old user password. Only required for non-administrator users to change their
223
- * password.
224
+ * @param oldPassword - Old user password. Only required for non-administrator users to
225
+ * change their password.
224
226
  */
225
227
  changePassword(newPassword: string, oldPassword?: string): Promise<this>;
226
228
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inweb/client",
3
- "version": "26.1.2",
3
+ "version": "26.1.4",
4
4
  "description": "JavaScript REST API client for the Open Cloud Server",
5
5
  "homepage": "https://cloud.opendesign.com/docs/index.html",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -26,6 +26,6 @@
26
26
  "docs": "typedoc"
27
27
  },
28
28
  "dependencies": {
29
- "@inweb/eventemitter2": "~26.1.2"
29
+ "@inweb/eventemitter2": "~26.1.4"
30
30
  }
31
31
  }