@inweb/client 26.1.0 → 26.1.2

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 +449 -434
  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 +69 -65
  7. package/lib/Api/ClashTest.d.ts +16 -16
  8. package/lib/Api/Client.d.ts +77 -78
  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 +132 -120
  12. package/lib/Api/IHttpClient.d.ts +3 -4
  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 +20 -17
  21. package/lib/Api/Project.d.ts +13 -14
  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 +31 -33
  25. package/package.json +2 -2
  26. package/src/Api/Assembly.ts +70 -66
  27. package/src/Api/ClashTest.ts +16 -16
  28. package/src/Api/Client.ts +77 -78
  29. package/src/Api/Endpoint.ts +6 -6
  30. package/src/Api/FetchError.ts +5 -5
  31. package/src/Api/File.ts +133 -121
  32. package/src/Api/IHttpClient.ts +3 -4
  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 +20 -17
  41. package/src/Api/Project.ts +13 -14
  42. package/src/Api/Role.ts +2 -2
  43. package/src/Api/SharedLink.ts +2 -2
  44. package/src/Api/User.ts +31 -33
package/src/Api/Model.ts CHANGED
@@ -29,8 +29,8 @@ import type { IModelTransformMatrix } from "./IAssembly";
29
29
 
30
30
  /**
31
31
  * Provides properties and methods for working with view of the {@link File | file} or
32
- * {@link Assembly| assembly}. For example, for `dwg` it is a `Model` space or layout, and for
33
- * `rvt` files it is a `3D` view.
32
+ * {@link Assembly| assembly}. For example, for `dwg` it is a `Model` space or layout, and for `rvt` files
33
+ * it is a `3D` view.
34
34
  */
35
35
  export class Model extends Endpoint {
36
36
  private _data: any;
@@ -69,8 +69,8 @@ export class Model extends Endpoint {
69
69
  }
70
70
 
71
71
  /**
72
- * Scene description resource file name. Use {@link downloadResource | downloadResource()} to
73
- * download scene description file.
72
+ * Scene description resource file name. Use {@link downloadResource | downloadResource()} to download
73
+ * scene description file.
74
74
  *
75
75
  * @readonly
76
76
  */
@@ -106,8 +106,8 @@ export class Model extends Endpoint {
106
106
  }
107
107
 
108
108
  /**
109
- * The list of geometry data resource files. Use {@link downloadResource | downloadResource()}
110
- * to download geometry data files.
109
+ * The list of geometry data resource files. Use {@link downloadResource | downloadResource()} to
110
+ * download geometry data files.
111
111
  *
112
112
  * @readonly
113
113
  */
@@ -188,8 +188,8 @@ export class Model extends Endpoint {
188
188
  }
189
189
 
190
190
  /**
191
- * Saves a new model owner file/assembly viewpoint to the server. To create a new viewpoint
192
- * use `Viewer.createViewpoint()`.
191
+ * Saves a new model owner file/assembly viewpoint to the server. To create a new viewpoint use
192
+ * `Viewer.createViewpoint()`.
193
193
  *
194
194
  * @param viewpoint - Viewpoint object.
195
195
  */
@@ -231,14 +231,14 @@ export class Model extends Endpoint {
231
231
  }
232
232
 
233
233
  /**
234
- * Downloads a resource file. Resource files are files that contain model scene descriptions,
235
- * or geometry data.
234
+ * Downloads a resource file. Resource files are files that contain model scene descriptions, or
235
+ * geometry data.
236
236
  *
237
237
  * @param dataId - Resource file name.
238
238
  * @param onProgress - Download progress callback.
239
239
  * @param signal - An
240
- * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
241
- * signal. Allows to communicate with a fetch request and abort it if desired.
240
+ * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController} signal. Allows
241
+ * to communicate with a fetch request and abort it if desired.
242
242
  */
243
243
  downloadResource(
244
244
  dataId: string,
@@ -249,16 +249,16 @@ export class Model extends Endpoint {
249
249
  }
250
250
 
251
251
  /**
252
- * Downloads a part of resource file. Resource files are files that contain model scene
253
- * descriptions, or geometry data.
252
+ * Downloads a part of resource file. Resource files are files that contain model scene descriptions,
253
+ * or geometry data.
254
254
  *
255
255
  * @param dataId - Resource file name.
256
256
  * @param ranges - A range of resource file contents to download.
257
257
  * @param requestId - Request ID for download progress callback.
258
258
  * @param onProgress - Download progress callback.
259
259
  * @param signal - An
260
- * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
261
- * signal. Allows to communicate with a fetch request and abort it if desired.
260
+ * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController} signal. Allows
261
+ * to communicate with a fetch request and abort it if desired.
262
262
  */
263
263
  downloadResourceRange(
264
264
  dataId: string,
@@ -324,8 +324,8 @@ export class Model extends Endpoint {
324
324
  * References are images, fonts, or any other files to correct rendering of the file.
325
325
  *
326
326
  * @param signal - An
327
- * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
328
- * signal, which can be used to abort waiting as desired.
327
+ * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController} signal, which
328
+ * can be used to abort waiting as desired.
329
329
  */
330
330
  getReferences(signal?: AbortSignal): Promise<IFileReferences> {
331
331
  return this._file.getReferences(signal);
@@ -25,8 +25,8 @@ import { IHttpClient } from "./IHttpClient";
25
25
  import { Endpoint } from "./Endpoint";
26
26
 
27
27
  /**
28
- * Provides properties and methods for obtaining information about a OAuth 2.0 client that have
29
- * access the Open Cloud Server API.
28
+ * Provides properties and methods for obtaining information about a OAuth 2.0 client that have access
29
+ * the Open Cloud Server API.
30
30
  */
31
31
  export class OAuthClient extends Endpoint {
32
32
  private _data: any;
@@ -148,8 +148,8 @@ export class OAuthClient extends Endpoint {
148
148
  /**
149
149
  * Updates client data on the server.
150
150
  *
151
- * Only administrators can update OAuth clients. If the current logged in user is not an
152
- * administrator, an exception will be thrown.
151
+ * Only administrators can update OAuth clients. If the current logged in user is not an administrator,
152
+ * an exception will be thrown.
153
153
  *
154
154
  * @param data - Raw client data. For more information, see
155
155
  * {@link https://cloud.opendesign.com/docs//pages/server/api.html#OAuthClient | Open Cloud OAuth Clients API}.
@@ -163,8 +163,8 @@ export class OAuthClient extends Endpoint {
163
163
  /**
164
164
  * Deletes a client from the server.
165
165
  *
166
- * Only administrators can delete OAuth clients. If the current logged in user is not an
167
- * administrator, an exception will be thrown.
166
+ * Only administrators can delete OAuth clients. If the current logged in user is not an administrator,
167
+ * an exception will be thrown.
168
168
  *
169
169
  * @returns Returns the raw data of a deleted client. For more information, see
170
170
  * {@link https://cloud.opendesign.com/docs//pages/server/api.html#OAuthClient | Open Cloud OAuth Clients API}.
@@ -174,11 +174,11 @@ export class OAuthClient extends Endpoint {
174
174
  }
175
175
 
176
176
  /**
177
- * Saves client properties changes to the server. Call this method to update client data on
178
- * the server after any property changes.
177
+ * Saves client properties changes to the server. Call this method to update client data on the server
178
+ * after any property changes.
179
179
  *
180
- * Only administrators can update OAuth clients. If the current logged in user is not an
181
- * administrator, an exception will be thrown.
180
+ * Only administrators can update OAuth clients. If the current logged in user is not an administrator,
181
+ * an exception will be thrown.
182
182
  */
183
183
  save(): Promise<this> {
184
184
  return this.update(this.data);
@@ -26,8 +26,8 @@ import { Endpoint } from "./Endpoint";
26
26
  import { IGrantedTo } from "./IFile";
27
27
 
28
28
  /**
29
- * Provides properties and methods for obtaining information about {@link File | file} actions
30
- * granted to a specific user, project, or group.
29
+ * Provides properties and methods for obtaining information about {@link File | file} actions granted to
30
+ * a specific user, project, or group.
31
31
  */
32
32
  export class Permission extends Endpoint {
33
33
  private _data: any;
@@ -52,19 +52,22 @@ export class Permission extends Endpoint {
52
52
  * - `readViewpoint` - The ability to read file viewpoints.
53
53
  * - `createViewpoint` - The ability to create file viewpoints.
54
54
  *
55
- * @example <caption>Change file permissions for the the specified project.</caption>
56
- * const myFile = client.getFile(myFileId);
57
- * const permissions = await myFile.getPermissions();
58
- * const projectPermissions = permissions.filter((permission) =>
59
- * permission.grantedTo.some((x) => x.project?.id === myProjectId)
60
- * );
61
- * const newActions = ["read", "readSourceFile", "update"];
62
- * await Promise.all(
63
- * projectPermissions.map((permission) => {
64
- * permission.actions = newActions;
65
- * return permission.save();
66
- * })
67
- * );
55
+ * @example Change file permissions for the the specified project.
56
+ *
57
+ * ```javascript
58
+ * const myFile = client.getFile(myFileId);
59
+ * const permissions = await myFile.getPermissions();
60
+ * const projectPermissions = permissions.filter((permission) =>
61
+ * permission.grantedTo.some((x) => x.project?.id === myProjectId)
62
+ * );
63
+ * const newActions = ["read", "readSourceFile", "update"];
64
+ * await Promise.all(
65
+ * projectPermissions.map((permission) => {
66
+ * permission.actions = newActions;
67
+ * return permission.save();
68
+ * })
69
+ * );
70
+ * ```
68
71
  */
69
72
  get actions(): string[] {
70
73
  return this.data.actions;
@@ -151,8 +154,8 @@ export class Permission extends Endpoint {
151
154
  }
152
155
 
153
156
  /**
154
- * Saves permission properties changes to the server. Call this method to update permission
155
- * data on the server after any property changes.
157
+ * Saves permission properties changes to the server. Call this method to update permission data on the
158
+ * server after any property changes.
156
159
  */
157
160
  save(): Promise<this> {
158
161
  return this.update(this.data);
@@ -31,8 +31,8 @@ import { File } from "./File";
31
31
  import { userFullName, userInitials } from "./Utils";
32
32
 
33
33
  /**
34
- * Provides properties and methods for obtaining information about a project on the Open Cloud
35
- * Server and managing its {@link Role | roles}, {@link Member | members} and models.
34
+ * Provides properties and methods for obtaining information about a project on the Open Cloud Server and
35
+ * managing its {@link Role | roles}, {@link Member | members} and models.
36
36
  */
37
37
  export class Project extends Endpoint {
38
38
  private _data: any;
@@ -270,8 +270,8 @@ export class Project extends Endpoint {
270
270
  }
271
271
 
272
272
  /**
273
- * Saves project properties changes to the server. Call this method to update project data on
274
- * the server after any property changes.
273
+ * Saves project properties changes to the server. Call this method to update project data on the
274
+ * server after any property changes.
275
275
  */
276
276
  save(): Promise<this> {
277
277
  return this.update(this.data);
@@ -281,12 +281,11 @@ export class Project extends Endpoint {
281
281
  * Sets or removes the project preview.
282
282
  *
283
283
  * @param image - Preview image. Can be a
284
- * {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}
285
- * string,
284
+ * {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL} string,
286
285
  * {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer | ArrayBuffer},
287
286
  * {@link https://developer.mozilla.org/docs/Web/API/Blob/Blob | Blob} or
288
- * {@link https://developer.mozilla.org/docs/Web/API/File | Web API File} object. Setting
289
- * the `image` to `null` will remove the preview.
287
+ * {@link https://developer.mozilla.org/docs/Web/API/File | Web API File} object. Setting the `image`
288
+ * to `null` will remove the preview.
290
289
  */
291
290
 
292
291
  async setPreview(image?: BodyInit | null): Promise<this> {
@@ -309,8 +308,8 @@ export class Project extends Endpoint {
309
308
  }
310
309
 
311
310
  /**
312
- * Returns a list of project roles. Project members have different abilities depending on the
313
- * role they have in a project.
311
+ * Returns a list of project roles. Project members have different abilities depending on the role they
312
+ * have in a project.
314
313
  */
315
314
  getRoles(): Promise<Role[]> {
316
315
  return this.get("/roles")
@@ -404,8 +403,8 @@ export class Project extends Endpoint {
404
403
  * Information about the file (model) that can be reference in the project topics.
405
404
  *
406
405
  * @typedef {any} FileInformation
407
- * @property {any[]} display_information - The list of fields to allow users to associate the
408
- * file with a server model.
406
+ * @property {any[]} display_information - The list of fields to allow users to associate the file with
407
+ * a server model.
409
408
  * @property {string} display_information.field_display_name - Field display name.
410
409
  * @property {string} display_information.field_value - Field value.
411
410
  * @property {any} file - The file reference object.
@@ -417,8 +416,8 @@ export class Project extends Endpoint {
417
416
  * Returns a list of project files. For more information, see
418
417
  * {@link https://cloud.opendesign.com/docs//pages/server/bcf3.html#ProjectFilesInformation | Open Cloud BCF3 API}.
419
418
  *
420
- * This list contains all files that the project has access to. To add a file to this list,
421
- * create a {@link IGrantedTo.project | project} permission on the file using
419
+ * This list contains all files that the project has access to. To add a file to this list, create a
420
+ * {@link IGrantedTo.project | project} permission on the file using
422
421
  * {@link File.createPermission | File.createPermission()}.
423
422
  */
424
423
  getFilesInformation(): Promise<any[]> {
package/src/Api/Role.ts CHANGED
@@ -125,8 +125,8 @@ export class Role extends Endpoint {
125
125
  }
126
126
 
127
127
  /**
128
- * Saves role properties changes to the server. Call this method to update role data on the
129
- * server after any property changes.
128
+ * Saves role properties changes to the server. Call this method to update role data on the server
129
+ * after any property changes.
130
130
  */
131
131
  save(): Promise<this> {
132
132
  return this.update(this.data);
@@ -126,8 +126,8 @@ export class SharedLink extends Endpoint {
126
126
  }
127
127
 
128
128
  /**
129
- * Saves shared link properties changes to the server. Call this method to update shared link
130
- * data on the server after any property changes.
129
+ * Saves shared link properties changes to the server. Call this method to update shared link data on
130
+ * the server after any property changes.
131
131
  */
132
132
  save(): Promise<this> {
133
133
  return this.update(this.data);
package/src/Api/User.ts CHANGED
@@ -27,8 +27,8 @@ import { FetchError } from "./FetchError";
27
27
  import { userFullName, userInitials } from "./Utils";
28
28
 
29
29
  /**
30
- * Provides properties and methods for obtaining information about a Open Cloud Server user and
31
- * manage its data.
30
+ * Provides properties and methods for obtaining information about a Open Cloud Server user and manage
31
+ * its data.
32
32
  */
33
33
  export class User extends Endpoint {
34
34
  private _data: any;
@@ -142,8 +142,8 @@ export class User extends Endpoint {
142
142
  }
143
143
 
144
144
  /**
145
- * Full name. Returns the user's first and last name. If first name and last names are empty,
146
- * returns the user name.
145
+ * Full name. Returns the user's first and last name. If first name and last names are empty, returns
146
+ * the user name.
147
147
  *
148
148
  * @readonly
149
149
  */
@@ -161,8 +161,8 @@ export class User extends Endpoint {
161
161
  }
162
162
 
163
163
  /**
164
- * User initials. Returns a first letters of the user's first and last names. If first name
165
- * and last names are empty, returns the first letter of the user name.
164
+ * User initials. Returns a first letters of the user's first and last names. If first name and last
165
+ * names are empty, returns the first letter of the user name.
166
166
  *
167
167
  * @readonly
168
168
  */
@@ -233,8 +233,8 @@ 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` or empty
237
- * for local accounts.
236
+ * The identity provider used to create the account. Can be `ldap`, `oauth`, `saml` or empty for local
237
+ * accounts.
238
238
  *
239
239
  * @readonly
240
240
  */
@@ -265,8 +265,8 @@ export class User extends Endpoint {
265
265
  }
266
266
 
267
267
  /**
268
- * The user's access token (API key). Use
269
- * {@link Client.signInWithToken | Client.signInWithToken()} to sign in to the server using this token.
268
+ * The user's access token (API key). Use {@link Client.signInWithToken | Client.signInWithToken()} to
269
+ * sign in to the server using this token.
270
270
  *
271
271
  * @readonly
272
272
  */
@@ -288,8 +288,8 @@ export class User extends Endpoint {
288
288
  /**
289
289
  * Reloads user data from the server.
290
290
  *
291
- * Only administrators can checkout other users. If the current logged in user is not an
292
- * administrator, they can only checkout themselves, otherwise an exception will be thrown.
291
+ * Only administrators can checkout other users. If the current logged in user is not an administrator,
292
+ * they can only checkout themselves, otherwise an exception will be thrown.
293
293
  */
294
294
  async checkout(): Promise<this> {
295
295
  if (this.httpClient.signInUserIsAdmin) {
@@ -309,8 +309,8 @@ export class User extends Endpoint {
309
309
  /**
310
310
  * Updates user data on the server.
311
311
  *
312
- * Only administrators can update other users. If the current logged in user is not an
313
- * administrator, they can only update themself, otherwise an exception will be thrown.
312
+ * Only administrators can update other users. If the current logged in user is not an administrator,
313
+ * they can only update themself, otherwise an exception will be thrown.
314
314
  *
315
315
  * @param data - Raw user data. For more information, see
316
316
  * {@link https://cloud.opendesign.com/docs//pages/server/api.html#Users | Open Cloud Users API}.
@@ -333,11 +333,11 @@ export class User extends Endpoint {
333
333
  /**
334
334
  * Deletes a user from the server.
335
335
  *
336
- * Only administrators can delete users. If the current logged in user is not an
337
- * administrator, an exception will be thrown.
336
+ * Only administrators can delete users. If the current logged in user is not an administrator, an
337
+ * exception will be thrown.
338
338
  *
339
- * Administrators can delete themselves or other administrators. An administrator can only
340
- * delete themself if they is not the last administrator.
339
+ * Administrators can delete themselves or other administrators. An administrator can only delete
340
+ * themself if they is not the last administrator.
341
341
  *
342
342
  * You need to re-login after deleting the current logged in user.
343
343
  *
@@ -363,8 +363,8 @@ export class User extends Endpoint {
363
363
  }
364
364
 
365
365
  /**
366
- * Saves user properties changes to the server. Call this method to update user data on the
367
- * server after any property changes.
366
+ * Saves user properties changes to the server. Call this method to update user data on the server
367
+ * after any property changes.
368
368
  */
369
369
  save(): Promise<this> {
370
370
  return this.update(this.data);
@@ -373,16 +373,15 @@ export class User extends Endpoint {
373
373
  /**
374
374
  * Sets or removes the user avatar.
375
375
  *
376
- * Only administrators can set the avatar of other users. If the current logged in user is
377
- * not an administrator, they can only set their avatar, otherwise an exception will be thrown.
376
+ * Only administrators can set the avatar of other users. If the current logged in user is not an
377
+ * administrator, they can only set their avatar, otherwise an exception will be thrown.
378
378
  *
379
379
  * @param image - Avatar image. Can be a
380
- * {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}
381
- * string,
380
+ * {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL} string,
382
381
  * {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer | ArrayBuffer},
383
382
  * {@link https://developer.mozilla.org/docs/Web/API/Blob/Blob | Blob} or
384
- * {@link https://developer.mozilla.org/docs/Web/API/File | Web API File} object. Setting
385
- * the `image` to `null` will remove the avatar.
383
+ * {@link https://developer.mozilla.org/docs/Web/API/File | Web API File} object. Setting the `image`
384
+ * to `null` will remove the avatar.
386
385
  */
387
386
  async setAvatar(image?: BodyInit | null): Promise<this> {
388
387
  if (!image) {
@@ -404,8 +403,8 @@ export class User extends Endpoint {
404
403
  /**
405
404
  * Removes the user avatar.
406
405
  *
407
- * Only administrators can remove the avatar of other users. If the current logged in user is
408
- * not an administrator, they can only remove their avatar, otherwise an exception will be thrown.
406
+ * Only administrators can remove the avatar of other users. If the current logged in user is not an
407
+ * administrator, they can only remove their avatar, otherwise an exception will be thrown.
409
408
  */
410
409
  async deleteAvatar(): Promise<this> {
411
410
  if (this.httpClient.signInUserIsAdmin) {
@@ -425,15 +424,14 @@ export class User extends Endpoint {
425
424
  /**
426
425
  * Changes the user password.
427
426
  *
428
- * Only administrators can change the passwords of other users. If the current logged in user
429
- * is not an administrator, they can only change their password, otherwise an exception will
430
- * be thrown.
427
+ * Only administrators can change the passwords of other users. If the current logged in user is not an
428
+ * administrator, they can only change their password, otherwise an exception will be thrown.
431
429
  *
432
430
  * To change their password, non-administrator users must specify their old password.
433
431
  *
434
432
  * @param newPassword - New user password.
435
- * @param oldPassword - Old user password. Only required for non-administrator users to
436
- * change their password.
433
+ * @param oldPassword - Old user password. Only required for non-administrator users to change their
434
+ * password.
437
435
  */
438
436
  async changePassword(newPassword: string, oldPassword?: string): Promise<this> {
439
437
  if (this.httpClient.signInUserIsAdmin) {