@inweb/client 26.10.6 → 26.12.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.
@@ -144,7 +144,7 @@ export declare class Assembly extends Endpoint {
144
144
  * @property {string | any} * - Object property. Can be `any` for nested group properties.
145
145
  */
146
146
  /**
147
- * Returns the properties for an objects in the assembly.
147
+ * Returns the properties for objects in the assembly.
148
148
  *
149
149
  * @param handles - Object original handle or handles array. Specify `undefined` to get properties for
150
150
  * all objects in the assembly.
@@ -165,7 +165,7 @@ export declare class Assembly extends Endpoint {
165
165
  */
166
166
  getProperties(handles?: string | string[], group?: boolean): Promise<any[]>;
167
167
  /**
168
- * Returns the list of original handles for an objects in the file that match the specified patterns.
168
+ * Returns the list of original handles for objects in the file that match the specified patterns.
169
169
  * Search patterns may be combined using query operators.
170
170
  *
171
171
  * @example Simple search pattern.
@@ -252,7 +252,7 @@ export declare class Assembly extends Endpoint {
252
252
  * @param dataId - Resource file name.
253
253
  * @param requestId - Specify a non-empty `requestId` to append the `?requestId=` search parameter to
254
254
  * the server request. If specified, server-side caching may not work.
255
- * @param ranges - A ranges of resource file contents to download. See
255
+ * @param ranges - Ranges of resource file contents to download. See
256
256
  * {@link https://developer.mozilla.org/docs/Web/HTTP/Guides/Range_requests | HTTP range requests} for
257
257
  * more details.
258
258
  * @param onProgress - Download progress callback.
@@ -356,7 +356,7 @@ export declare class Assembly extends Endpoint {
356
356
  * clashes.
357
357
  * @param params.clearance - The type of the clashes that the test detects:
358
358
  *
359
- * - `true` - Сlearance clash. A clash in which the object A may or may not intersect with object B, but
359
+ * - `true` - Clearance clash. A clash in which the object A may or may not intersect with object B, but
360
360
  * comes within a distance of less than the `tolerance`.
361
361
  * - `false` - Hard clash. A clash in which the object A intersects with object B by a distance of more
362
362
  * than the `tolerance`.
@@ -17,7 +17,7 @@ export declare class ClashTest extends Endpoint {
17
17
  /**
18
18
  * The type of the clashes that the test detects:
19
19
  *
20
- * - `true` - Сlearance clash. A clash in which the object A may or may not intersect with object B, but
20
+ * - `true` - Clearance clash. A clash in which the object A may or may not intersect with object B, but
21
21
  * comes within a distance of less than the {@link tolerance}.
22
22
  * - `false` - Hard clash. A clash in which the object A intersects with object B by a distance of more
23
23
  * than the {@link tolerance}.
@@ -116,12 +116,12 @@ export declare class Client extends EventEmitter2<ClientEventMap> {
116
116
  private clearCurrentUser;
117
117
  /**
118
118
  * Returns the current logged in user. Returns `null` if the user is not logged in or the logged in
119
- * user has deleted themself.
119
+ * user has deleted themselves.
120
120
  */
121
121
  getCurrentUser(): User | null;
122
122
  /**
123
- * Returns the list of server enabled indentity providers. No authorization is required to obtain a
124
- * list of providers.
123
+ * Returns the list of server enabled identity providers. No authorization is required to obtain a list
124
+ * of providers.
125
125
  */
126
126
  getIdentityProviders(): Promise<{
127
127
  name: string;
@@ -254,7 +254,7 @@ export declare class Client extends EventEmitter2<ClientEventMap> {
254
254
  * exception will be thrown.
255
255
  *
256
256
  * Administrators can delete themselves or other administrators. An administrator can only delete
257
- * themself if they is not the last administrator.
257
+ * themselves if they are not the last administrator.
258
258
  *
259
259
  * You need to re-login after deleting the current logged in user.
260
260
  *
@@ -313,14 +313,14 @@ export declare class Client extends EventEmitter2<ClientEventMap> {
313
313
  * object returned as a result of a user selecting files using the HTML `<input>` element.
314
314
  * @param params - An object containing upload parameters.
315
315
  * @param params.geometry - Run File Converter job to convert geometry data after uploading the file.
316
- * Can be:
316
+ * Can be one of:
317
317
  *
318
318
  * - `true` - Convert file geometry data to `VSFX` format for opening in `VisualizeJS` 3D viewer.
319
319
  * - `vsfx` - Convert file geometry data to `VSFX` format for opening in `VisualizeJS` 3D viewer.
320
320
  * - `gltf` - Convert file geometry data to `glTF` format for opening in `Three.js` 3D viewer.
321
321
  *
322
322
  * @param params.properties - Run File Converter job to extract properties after uploading the file.
323
- * @param params.jobParameters - Parameters for the File Converter jobs. Use this to specify aditional
323
+ * @param params.jobParameters - Parameters for the File Converter jobs. Use this to specify additional
324
324
  * parameters for retrieving the geometry and properties of uploaded file. Can be given as command
325
325
  * line arguments in form `--arg=value`.
326
326
  * @param params.waitForDone - Wait for geometry and properties jobs to complete.
@@ -401,10 +401,10 @@ export declare class Client extends EventEmitter2<ClientEventMap> {
401
401
  */
402
402
  getJob(jobId: string): Promise<Job>;
403
403
  /**
404
- * Runs a new job on the server for the sepecified file.
404
+ * Runs a new job on the server for the specified file.
405
405
  *
406
406
  * @param fileId - File ID.
407
- * @param outputFormat - The job type. Can be:
407
+ * @param outputFormat - The job type. Can be one of:
408
408
  *
409
409
  * - `geometry` - Convert file geometry data to `VSFX` format for opening in `VisualizeJS` 3D viewer.
410
410
  * - `geometryGltf` - Convert file geometry data to `glTF` format for opening in `Three.js` 3D viewer.
@@ -467,7 +467,7 @@ export declare class Client extends EventEmitter2<ClientEventMap> {
467
467
  * @param files - List of file IDs.
468
468
  * @param name - Assembly name.
469
469
  * @param params - Additional assembly creating parameters.
470
- * @param params.jobParameters - Parameters for the File Converter jobs. Use this to specify aditional
470
+ * @param params.jobParameters - Parameters for the File Converter jobs. Use this to specify additional
471
471
  * parameters for generating the geometry and properties of the new assembly. Can be given as JSON
472
472
  * object or command line arguments in form `--arg=value`.
473
473
  * @param params.waitForDone - Wait for assembly to be created.
package/lib/Api/File.d.ts CHANGED
@@ -49,10 +49,7 @@ export declare class File extends Endpoint {
49
49
  * Returns a list of file formats in which the active version of the file was exported.
50
50
  *
51
51
  * To export file to one of the supported formats run the File Converter job using
52
- * {@link createJob | createJob()}. To download exported file use
53
- * {@link downloadResource | downloadResource()}.
54
- *
55
- * For an example of exporting files to other formats, see the {@link downloadResource} help.
52
+ * {@link createJob | createJob()}. For an example, see the {@link downloadResource} help.
56
53
  *
57
54
  * @readonly
58
55
  */
@@ -64,7 +61,7 @@ export declare class File extends Endpoint {
64
61
  * - `gltf` - `glTF` format, file can be opened in `Three.js` 3D viewer.
65
62
  *
66
63
  * Returns an empty string if geometry data has not yet been converted. A files without geometry data
67
- * can be exported to other formas, but cannot be opened in viewer.
64
+ * can be exported to other formats, but cannot be opened in viewer.
68
65
  */
69
66
  get geometryType(): string;
70
67
  /**
@@ -224,7 +221,7 @@ export declare class File extends Endpoint {
224
221
  * @property {string | any} * - Object property. Can be `any` for nested group properties.
225
222
  */
226
223
  /**
227
- * Returns the properties for an objects in the active version of the file.
224
+ * Returns the properties for objects in the active version of the file.
228
225
  *
229
226
  * @param handles - Object original handle or handles array. Specify `undefined` to get properties for
230
227
  * all objects in the file.
@@ -267,7 +264,7 @@ export declare class File extends Endpoint {
267
264
  * operator.
268
265
  */
269
266
  /**
270
- * Returns the list of original handles for an objects in the active version of the file that match the
267
+ * Returns the list of original handles for objects in the active version of the file that match the
271
268
  * specified patterns. Search patterns may be combined using query operators.
272
269
  *
273
270
  * @example Simple search pattern.
@@ -295,7 +292,7 @@ export declare class File extends Endpoint {
295
292
  * };
296
293
  * ```
297
294
  *
298
- * @param {SeacrhPattern | QueryOperator} searchPattern - Search pattern or combination of the
295
+ * @param {SearchPattern | QueryOperator} searchPattern - Search pattern or combination of the
299
296
  * patterns, see example below.
300
297
  * @returns {Promise<Properties[]>}
301
298
  */
@@ -358,9 +355,8 @@ export declare class File extends Endpoint {
358
355
  * await job.waitForDone();
359
356
  * const pdfResourceName = file.exports.find((x) => x.endsWith(".pdf"));
360
357
  * const arrayBuffer = await file.downloadResource(pdfResourceName);
361
- * const blob = new Blob([arrayBuffer]);
362
358
  * const fileName = file.name + ".pdf";
363
- * FileSaver.saveAs(blob, fileName);
359
+ * FileSaver.saveAs(new Blob([arrayBuffer]), fileName);
364
360
  * ```
365
361
  *
366
362
  * @param dataId - Resource file name.
@@ -377,7 +373,7 @@ export declare class File extends Endpoint {
377
373
  * @param dataId - Resource file name.
378
374
  * @param requestId - Specify a non-empty `requestId` to append the `?requestId=` search parameter to
379
375
  * the server request. If specified, server-side caching may not work.
380
- * @param ranges - A ranges of resource file contents to download. See
376
+ * @param ranges - Ranges of resource file contents to download. See
381
377
  * {@link https://developer.mozilla.org/docs/Web/HTTP/Guides/Range_requests | HTTP range requests} for
382
378
  * more details.
383
379
  * @param onProgress - Download progress callback.
@@ -424,7 +420,7 @@ export declare class File extends Endpoint {
424
420
  /**
425
421
  * Runs a new job on the server for the active version of the file.
426
422
  *
427
- * @param outputFormat - The job type. Can be:
423
+ * @param outputFormat - The job type. Can be one of:
428
424
  *
429
425
  * - `geometry` - Convert file geometry data to `VSFX` format for opening in `VisualizeJS` 3D viewer.
430
426
  * - `geometryGltf` - Convert file geometry data to `glTF` format for opening in `Three.js` 3D viewer.
@@ -89,7 +89,7 @@ export interface IHttpClient {
89
89
  *
90
90
  * @param relativePath - Download endpoint relative path.
91
91
  * @param reserved - Reserved, do not use.
92
- * @param ranges - A ranges of resource file contents to download. See
92
+ * @param ranges - Ranges of resource file contents to download. See
93
93
  * {@link https://developer.mozilla.org/docs/Web/HTTP/Guides/Range_requests | HTTP range requests} for
94
94
  * more details.
95
95
  * @param onProgress - Download progress callback.
package/lib/Api/Job.d.ts CHANGED
@@ -64,7 +64,7 @@ export declare class Job extends Endpoint {
64
64
  */
65
65
  get lastUpdate(): string;
66
66
  /**
67
- * Job type. Can be:
67
+ * Job type. Can be one of:
68
68
  *
69
69
  * - `geometry` - Convert file geometry data to `VSFX` format.
70
70
  * - `geometryGltf` - Convert file geometry data to `glTF` format.
@@ -148,7 +148,7 @@ export declare class Model extends Endpoint {
148
148
  * @param dataId - Resource file name.
149
149
  * @param requestId - Specify a non-empty `requestId` to append the `?requestId=` search parameter to
150
150
  * the server request. If specified, server-side caching may not work.
151
- * @param ranges - A ranges of resource file contents to download. See
151
+ * @param ranges - Ranges of resource file contents to download. See
152
152
  * {@link https://developer.mozilla.org/docs/Web/HTTP/Guides/Range_requests | HTTP range requests} for
153
153
  * more details.
154
154
  * @param onProgress - Download progress callback.
package/lib/Api/User.d.ts CHANGED
@@ -163,7 +163,7 @@ export declare class User extends Endpoint {
163
163
  * Updates user data on the server.
164
164
  *
165
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.
166
+ * they can only update themselves, 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}.
@@ -176,7 +176,7 @@ export declare class User extends Endpoint {
176
176
  * exception will be thrown.
177
177
  *
178
178
  * Administrators can delete themselves or other administrators. An administrator can only delete
179
- * themself if they is not the last administrator.
179
+ * themselves if they are not the last administrator.
180
180
  *
181
181
  * You need to re-login after deleting the current logged in user.
182
182
  *
@@ -1,3 +1,5 @@
1
+ export declare function normalizeParam(param: any, separator?: string): string;
2
+ export declare function delay(ms: number, signal: AbortSignal): Promise<boolean>;
1
3
  export declare function waitFor(func: (params: any) => Promise<boolean>, params?: {
2
4
  timeout?: number;
3
5
  interval?: number;
package/lib/index.d.ts CHANGED
@@ -22,5 +22,5 @@ export * from "./Api/Plugin";
22
22
  export * from "./Api/SharedLink";
23
23
  export * from "./Api/SharedFile";
24
24
  export { User } from "./Api/User";
25
- export { parseArgs, userFullName, userInitials, waitFor } from "./Api/Utils";
25
+ export * from "./Api/Utils";
26
26
  export declare const version = "CLIENT_JS_VERSION";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inweb/client",
3
- "version": "26.10.6",
3
+ "version": "26.12.0",
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,7 +26,7 @@
26
26
  "docs": "typedoc"
27
27
  },
28
28
  "dependencies": {
29
- "@inweb/eventemitter2": "~26.10.6"
29
+ "@inweb/eventemitter2": "~26.12.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "fflate": "^0.8.2"
@@ -31,7 +31,7 @@ import { Model } from "./Model";
31
31
  import { ClashTest } from "./ClashTest";
32
32
  import { ISharedLinkPermissions } from "./ISharedLink";
33
33
  import { SharedLink } from "./SharedLink";
34
- import { waitFor, userFullName, userInitials } from "./Utils";
34
+ import { normalizeParam, waitFor, userFullName, userInitials } from "./Utils";
35
35
 
36
36
  /**
37
37
  * Provides properties and methods for obtaining information about an assembly on the Open Cloud Server
@@ -283,7 +283,7 @@ export class Assembly extends Endpoint {
283
283
  */
284
284
 
285
285
  /**
286
- * Returns the properties for an objects in the assembly.
286
+ * Returns the properties for objects in the assembly.
287
287
  *
288
288
  * @param handles - Object original handle or handles array. Specify `undefined` to get properties for
289
289
  * all objects in the assembly.
@@ -318,7 +318,7 @@ export class Assembly extends Endpoint {
318
318
  }
319
319
 
320
320
  /**
321
- * Returns the list of original handles for an objects in the file that match the specified patterns.
321
+ * Returns the list of original handles for objects in the file that match the specified patterns.
322
322
  * Search patterns may be combined using query operators.
323
323
  *
324
324
  * @example Simple search pattern.
@@ -437,7 +437,7 @@ export class Assembly extends Endpoint {
437
437
  * @param dataId - Resource file name.
438
438
  * @param requestId - Specify a non-empty `requestId` to append the `?requestId=` search parameter to
439
439
  * the server request. If specified, server-side caching may not work.
440
- * @param ranges - A ranges of resource file contents to download. See
440
+ * @param ranges - Ranges of resource file contents to download. See
441
441
  * {@link https://developer.mozilla.org/docs/Web/HTTP/Guides/Range_requests | HTTP range requests} for
442
442
  * more details.
443
443
  * @param onProgress - Download progress callback.
@@ -568,8 +568,7 @@ export class Assembly extends Endpoint {
568
568
  if (limit > 0) searchParams.set("limit", limit.toString());
569
569
  if (name) searchParams.set("name", name);
570
570
  if (ids) {
571
- if (Array.isArray(ids)) ids = ids.join("|");
572
- if (typeof ids === "string") ids = ids.trim();
571
+ ids = normalizeParam(ids);
573
572
  if (ids) searchParams.set("id", ids);
574
573
  }
575
574
  if (sortByDesc !== undefined) searchParams.set("sortBy", sortByDesc ? "desc" : "asc");
@@ -626,7 +625,7 @@ export class Assembly extends Endpoint {
626
625
  * clashes.
627
626
  * @param params.clearance - The type of the clashes that the test detects:
628
627
  *
629
- * - `true` - Сlearance clash. A clash in which the object A may or may not intersect with object B, but
628
+ * - `true` - Clearance clash. A clash in which the object A may or may not intersect with object B, but
630
629
  * comes within a distance of less than the `tolerance`.
631
630
  * - `false` - Hard clash. A clash in which the object A intersects with object B by a distance of more
632
631
  * than the `tolerance`.
@@ -47,7 +47,7 @@ export class ClashTest extends Endpoint {
47
47
  /**
48
48
  * The type of the clashes that the test detects:
49
49
  *
50
- * - `true` - Сlearance clash. A clash in which the object A may or may not intersect with object B, but
50
+ * - `true` - Clearance clash. A clash in which the object A may or may not intersect with object B, but
51
51
  * comes within a distance of less than the {@link tolerance}.
52
52
  * - `false` - Hard clash. A clash in which the object A intersects with object B by a distance of more
53
53
  * than the {@link tolerance}.
package/src/Api/Client.ts CHANGED
@@ -37,7 +37,7 @@ import { ISharedLinkPermissions } from "./ISharedLink";
37
37
  import { SharedLink } from "./SharedLink";
38
38
  import { SharedFile } from "./SharedFile";
39
39
  import { Plugin } from "./Plugin";
40
- import { parseArgs } from "./Utils";
40
+ import { normalizeParam, parseArgs } from "./Utils";
41
41
 
42
42
  /**
43
43
  * Provides methods for managing Open Cloud Server resources such as users, files, assemblies, jobs,
@@ -255,7 +255,7 @@ export class Client extends EventEmitter2<ClientEventMap> {
255
255
 
256
256
  /**
257
257
  * Returns the current logged in user. Returns `null` if the user is not logged in or the logged in
258
- * user has deleted themself.
258
+ * user has deleted themselves.
259
259
  */
260
260
  getCurrentUser(): User | null {
261
261
  if (this._user && !this.httpClient.signInUserId) this._user = null;
@@ -263,8 +263,8 @@ export class Client extends EventEmitter2<ClientEventMap> {
263
263
  }
264
264
 
265
265
  /**
266
- * Returns the list of server enabled indentity providers. No authorization is required to obtain a
267
- * list of providers.
266
+ * Returns the list of server enabled identity providers. No authorization is required to obtain a list
267
+ * of providers.
268
268
  */
269
269
  getIdentityProviders(): Promise<{ name: string; url: string }[]> {
270
270
  return this.httpClient.get("/identity").then((response) => response.json());
@@ -488,7 +488,7 @@ export class Client extends EventEmitter2<ClientEventMap> {
488
488
  * exception will be thrown.
489
489
  *
490
490
  * Administrators can delete themselves or other administrators. An administrator can only delete
491
- * themself if they is not the last administrator.
491
+ * themselves if they are not the last administrator.
492
492
  *
493
493
  * You need to re-login after deleting the current logged in user.
494
494
  *
@@ -559,13 +559,12 @@ export class Client extends EventEmitter2<ClientEventMap> {
559
559
  if (limit > 0) searchParams.set("limit", limit.toString());
560
560
  if (name) searchParams.set("name", name);
561
561
  if (ext) {
562
- if (Array.isArray(ext)) ext = ext.join("|");
563
- if (typeof ext === "string") ext = ext.toLowerCase();
564
- if (ext) searchParams.set("ext", ext);
562
+ ext = normalizeParam(ext);
563
+ if (ext) searchParams.set("ext", ext.toLowerCase());
565
564
  }
566
565
  if (ids) {
567
- if (Array.isArray(ids)) ids = ids.join("|");
568
- searchParams.set("id", ids);
566
+ ids = normalizeParam(ids);
567
+ if (ids) searchParams.set("id", ids);
569
568
  }
570
569
  if (sortByDesc !== undefined) searchParams.set("sortBy", sortByDesc ? "desc" : "asc");
571
570
  if (sortField) searchParams.set("sortField", sortField);
@@ -609,14 +608,14 @@ export class Client extends EventEmitter2<ClientEventMap> {
609
608
  * object returned as a result of a user selecting files using the HTML `<input>` element.
610
609
  * @param params - An object containing upload parameters.
611
610
  * @param params.geometry - Run File Converter job to convert geometry data after uploading the file.
612
- * Can be:
611
+ * Can be one of:
613
612
  *
614
613
  * - `true` - Convert file geometry data to `VSFX` format for opening in `VisualizeJS` 3D viewer.
615
614
  * - `vsfx` - Convert file geometry data to `VSFX` format for opening in `VisualizeJS` 3D viewer.
616
615
  * - `gltf` - Convert file geometry data to `glTF` format for opening in `Three.js` 3D viewer.
617
616
  *
618
617
  * @param params.properties - Run File Converter job to extract properties after uploading the file.
619
- * @param params.jobParameters - Parameters for the File Converter jobs. Use this to specify aditional
618
+ * @param params.jobParameters - Parameters for the File Converter jobs. Use this to specify additional
620
619
  * parameters for retrieving the geometry and properties of uploaded file. Can be given as command
621
620
  * line arguments in form `--arg=value`.
622
621
  * @param params.waitForDone - Wait for geometry and properties jobs to complete.
@@ -737,9 +736,8 @@ export class Client extends EventEmitter2<ClientEventMap> {
737
736
  if (start > 0) searchParams.set("start", start.toString());
738
737
  if (limit > 0) searchParams.set("limit", limit.toString());
739
738
  if (status) {
740
- if (Array.isArray(status)) status = status.join("|");
741
- if (typeof status === "string") status = status.trim().toLowerCase();
742
- if (status) searchParams.set("status", status);
739
+ status = normalizeParam(status);
740
+ if (status) searchParams.set("status", status.toLowerCase());
743
741
  }
744
742
  if (sortByDesc !== undefined) searchParams.set("sortBy", sortByDesc ? "desc" : "asc");
745
743
  if (sortField) searchParams.set("sortField", sortField);
@@ -769,10 +767,10 @@ export class Client extends EventEmitter2<ClientEventMap> {
769
767
  }
770
768
 
771
769
  /**
772
- * Runs a new job on the server for the sepecified file.
770
+ * Runs a new job on the server for the specified file.
773
771
  *
774
772
  * @param fileId - File ID.
775
- * @param outputFormat - The job type. Can be:
773
+ * @param outputFormat - The job type. Can be one of:
776
774
  *
777
775
  * - `geometry` - Convert file geometry data to `VSFX` format for opening in `VisualizeJS` 3D viewer.
778
776
  * - `geometryGltf` - Convert file geometry data to `glTF` format for opening in `Three.js` 3D viewer.
@@ -849,8 +847,7 @@ export class Client extends EventEmitter2<ClientEventMap> {
849
847
  if (limit > 0) searchParams.set("limit", limit.toString());
850
848
  if (name) searchParams.set("name", name);
851
849
  if (ids) {
852
- if (Array.isArray(ids)) ids = ids.join("|");
853
- if (typeof ids === "string") ids = ids.trim();
850
+ ids = normalizeParam(ids);
854
851
  if (ids) searchParams.set("id", ids);
855
852
  }
856
853
  if (sortByDesc !== undefined) searchParams.set("sortBy", sortByDesc ? "desc" : "asc");
@@ -888,7 +885,7 @@ export class Client extends EventEmitter2<ClientEventMap> {
888
885
  * @param files - List of file IDs.
889
886
  * @param name - Assembly name.
890
887
  * @param params - Additional assembly creating parameters.
891
- * @param params.jobParameters - Parameters for the File Converter jobs. Use this to specify aditional
888
+ * @param params.jobParameters - Parameters for the File Converter jobs. Use this to specify additional
892
889
  * parameters for generating the geometry and properties of the new assembly. Can be given as JSON
893
890
  * object or command line arguments in form `--arg=value`.
894
891
  * @param params.waitForDone - Wait for assembly to be created.
@@ -982,8 +979,7 @@ export class Client extends EventEmitter2<ClientEventMap> {
982
979
  if (limit > 0) searchParams.set("limit", limit.toString());
983
980
  if (name) searchParams.set("name", name);
984
981
  if (ids) {
985
- if (Array.isArray(ids)) ids = ids.join("|");
986
- if (typeof ids === "string") ids = ids.trim();
982
+ ids = normalizeParam(ids);
987
983
  if (ids) searchParams.set("id", ids);
988
984
  }
989
985
  if (sortByDesc !== undefined) searchParams.set("sortBy", sortByDesc ? "desc" : "asc");
package/src/Api/File.ts CHANGED
@@ -124,10 +124,7 @@ export class File extends Endpoint {
124
124
  * Returns a list of file formats in which the active version of the file was exported.
125
125
  *
126
126
  * To export file to one of the supported formats run the File Converter job using
127
- * {@link createJob | createJob()}. To download exported file use
128
- * {@link downloadResource | downloadResource()}.
129
- *
130
- * For an example of exporting files to other formats, see the {@link downloadResource} help.
127
+ * {@link createJob | createJob()}. For an example, see the {@link downloadResource} help.
131
128
  *
132
129
  * @readonly
133
130
  */
@@ -142,7 +139,7 @@ export class File extends Endpoint {
142
139
  * - `gltf` - `glTF` format, file can be opened in `Three.js` 3D viewer.
143
140
  *
144
141
  * Returns an empty string if geometry data has not yet been converted. A files without geometry data
145
- * can be exported to other formas, but cannot be opened in viewer.
142
+ * can be exported to other formats, but cannot be opened in viewer.
146
143
  */
147
144
  get geometryType(): string {
148
145
  if (this.status.geometryGltf.state === "done") return "gltf";
@@ -401,7 +398,7 @@ export class File extends Endpoint {
401
398
  */
402
399
 
403
400
  /**
404
- * Returns the properties for an objects in the active version of the file.
401
+ * Returns the properties for objects in the active version of the file.
405
402
  *
406
403
  * @param handles - Object original handle or handles array. Specify `undefined` to get properties for
407
404
  * all objects in the file.
@@ -460,7 +457,7 @@ export class File extends Endpoint {
460
457
  */
461
458
 
462
459
  /**
463
- * Returns the list of original handles for an objects in the active version of the file that match the
460
+ * Returns the list of original handles for objects in the active version of the file that match the
464
461
  * specified patterns. Search patterns may be combined using query operators.
465
462
  *
466
463
  * @example Simple search pattern.
@@ -488,7 +485,7 @@ export class File extends Endpoint {
488
485
  * };
489
486
  * ```
490
487
  *
491
- * @param {SeacrhPattern | QueryOperator} searchPattern - Search pattern or combination of the
488
+ * @param {SearchPattern | QueryOperator} searchPattern - Search pattern or combination of the
492
489
  * patterns, see example below.
493
490
  * @returns {Promise<Properties[]>}
494
491
  */
@@ -580,9 +577,8 @@ export class File extends Endpoint {
580
577
  * await job.waitForDone();
581
578
  * const pdfResourceName = file.exports.find((x) => x.endsWith(".pdf"));
582
579
  * const arrayBuffer = await file.downloadResource(pdfResourceName);
583
- * const blob = new Blob([arrayBuffer]);
584
580
  * const fileName = file.name + ".pdf";
585
- * FileSaver.saveAs(blob, fileName);
581
+ * FileSaver.saveAs(new Blob([arrayBuffer]), fileName);
586
582
  * ```
587
583
  *
588
584
  * @param dataId - Resource file name.
@@ -608,7 +604,7 @@ export class File extends Endpoint {
608
604
  * @param dataId - Resource file name.
609
605
  * @param requestId - Specify a non-empty `requestId` to append the `?requestId=` search parameter to
610
606
  * the server request. If specified, server-side caching may not work.
611
- * @param ranges - A ranges of resource file contents to download. See
607
+ * @param ranges - Ranges of resource file contents to download. See
612
608
  * {@link https://developer.mozilla.org/docs/Web/HTTP/Guides/Range_requests | HTTP range requests} for
613
609
  * more details.
614
610
  * @param onProgress - Download progress callback.
@@ -693,7 +689,7 @@ export class File extends Endpoint {
693
689
  /**
694
690
  * Runs a new job on the server for the active version of the file.
695
691
  *
696
- * @param outputFormat - The job type. Can be:
692
+ * @param outputFormat - The job type. Can be one of:
697
693
  *
698
694
  * - `geometry` - Convert file geometry data to `VSFX` format for opening in `VisualizeJS` 3D viewer.
699
695
  * - `geometryGltf` - Convert file geometry data to `glTF` format for opening in `Three.js` 3D viewer.
@@ -131,7 +131,7 @@ export interface IHttpClient {
131
131
  *
132
132
  * @param relativePath - Download endpoint relative path.
133
133
  * @param reserved - Reserved, do not use.
134
- * @param ranges - A ranges of resource file contents to download. See
134
+ * @param ranges - Ranges of resource file contents to download. See
135
135
  * {@link https://developer.mozilla.org/docs/Web/HTTP/Guides/Range_requests | HTTP range requests} for
136
136
  * more details.
137
137
  * @param onProgress - Download progress callback.
package/src/Api/Job.ts CHANGED
@@ -121,7 +121,7 @@ export class Job extends Endpoint {
121
121
  }
122
122
 
123
123
  /**
124
- * Job type. Can be:
124
+ * Job type. Can be one of:
125
125
  *
126
126
  * - `geometry` - Convert file geometry data to `VSFX` format.
127
127
  * - `geometryGltf` - Convert file geometry data to `glTF` format.
package/src/Api/Model.ts CHANGED
@@ -255,7 +255,7 @@ export class Model extends Endpoint {
255
255
  * @param dataId - Resource file name.
256
256
  * @param requestId - Specify a non-empty `requestId` to append the `?requestId=` search parameter to
257
257
  * the server request. If specified, server-side caching may not work.
258
- * @param ranges - A ranges of resource file contents to download. See
258
+ * @param ranges - Ranges of resource file contents to download. See
259
259
  * {@link https://developer.mozilla.org/docs/Web/HTTP/Guides/Range_requests | HTTP range requests} for
260
260
  * more details.
261
261
  * @param onProgress - Download progress callback.
@@ -28,7 +28,7 @@ import { Role } from "./Role";
28
28
  import { IRoleActions } from "./IRole";
29
29
  import { Member } from "./Member";
30
30
  import { File } from "./File";
31
- import { userFullName, userInitials } from "./Utils";
31
+ import { normalizeParam, userFullName, userInitials } from "./Utils";
32
32
 
33
33
  /**
34
34
  * Provides properties and methods for obtaining information about a project on the Open Cloud Server and
@@ -482,7 +482,7 @@ export class Project extends Endpoint {
482
482
  .then((filesInformation) => filesInformation.map((item) => item.file.reference))
483
483
  .then((ids) => {
484
484
  const files = new Endpoint("/files", this.httpClient, this.headers);
485
- return files.get(`?id=${ids.join("|")}`);
485
+ return files.get(`?id=${normalizeParam(ids)}`);
486
486
  })
487
487
  .then((response) => response.json())
488
488
  .then((files) => files.result.map((data) => new File(data, this.httpClient)));
package/src/Api/User.ts CHANGED
@@ -310,7 +310,7 @@ export class User extends Endpoint {
310
310
  * Updates user data on the server.
311
311
  *
312
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.
313
+ * they can only update themselves, 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}.
@@ -337,7 +337,7 @@ export class User extends Endpoint {
337
337
  * exception will be thrown.
338
338
  *
339
339
  * Administrators can delete themselves or other administrators. An administrator can only delete
340
- * themself if they is not the last administrator.
340
+ * themselves if they are not the last administrator.
341
341
  *
342
342
  * You need to re-login after deleting the current logged in user.
343
343
  *
package/src/Api/Utils.ts CHANGED
@@ -21,7 +21,14 @@
21
21
  // acknowledge and accept the above terms.
22
22
  ///////////////////////////////////////////////////////////////////////////////
23
23
 
24
- function delay(ms: number, signal: AbortSignal): Promise<boolean> {
24
+ export function normalizeParam(param: any, separator: string = "|"): string {
25
+ if (typeof param === "string") param = param.split(",");
26
+ if (Array.isArray(param)) param = param.filter((x) => x).join(separator);
27
+ if (typeof param === "string") param = param.trim();
28
+ return param.toString();
29
+ }
30
+
31
+ export function delay(ms: number, signal: AbortSignal): Promise<boolean> {
25
32
  return new Promise((resolve) => {
26
33
  let timeoutId = 0;
27
34
 
package/src/index.ts CHANGED
@@ -45,6 +45,6 @@ export * from "./Api/Plugin";
45
45
  export * from "./Api/SharedLink";
46
46
  export * from "./Api/SharedFile";
47
47
  export { User } from "./Api/User";
48
- export { parseArgs, userFullName, userInitials, waitFor } from "./Api/Utils";
48
+ export * from "./Api/Utils";
49
49
 
50
50
  export const version = "CLIENT_JS_VERSION";