@inweb/client 26.10.6 → 26.11.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
@@ -64,7 +64,7 @@ export declare class File extends Endpoint {
64
64
  * - `gltf` - `glTF` format, file can be opened in `Three.js` 3D viewer.
65
65
  *
66
66
  * 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.
67
+ * can be exported to other formats, but cannot be opened in viewer.
68
68
  */
69
69
  get geometryType(): string;
70
70
  /**
@@ -224,7 +224,7 @@ export declare class File extends Endpoint {
224
224
  * @property {string | any} * - Object property. Can be `any` for nested group properties.
225
225
  */
226
226
  /**
227
- * Returns the properties for an objects in the active version of the file.
227
+ * Returns the properties for objects in the active version of the file.
228
228
  *
229
229
  * @param handles - Object original handle or handles array. Specify `undefined` to get properties for
230
230
  * all objects in the file.
@@ -267,7 +267,7 @@ export declare class File extends Endpoint {
267
267
  * operator.
268
268
  */
269
269
  /**
270
- * Returns the list of original handles for an objects in the active version of the file that match the
270
+ * Returns the list of original handles for objects in the active version of the file that match the
271
271
  * specified patterns. Search patterns may be combined using query operators.
272
272
  *
273
273
  * @example Simple search pattern.
@@ -295,7 +295,7 @@ export declare class File extends Endpoint {
295
295
  * };
296
296
  * ```
297
297
  *
298
- * @param {SeacrhPattern | QueryOperator} searchPattern - Search pattern or combination of the
298
+ * @param {SearchPattern | QueryOperator} searchPattern - Search pattern or combination of the
299
299
  * patterns, see example below.
300
300
  * @returns {Promise<Properties[]>}
301
301
  */
@@ -377,7 +377,7 @@ export declare class File extends Endpoint {
377
377
  * @param dataId - Resource file name.
378
378
  * @param requestId - Specify a non-empty `requestId` to append the `?requestId=` search parameter to
379
379
  * the server request. If specified, server-side caching may not work.
380
- * @param ranges - A ranges of resource file contents to download. See
380
+ * @param ranges - Ranges of resource file contents to download. See
381
381
  * {@link https://developer.mozilla.org/docs/Web/HTTP/Guides/Range_requests | HTTP range requests} for
382
382
  * more details.
383
383
  * @param onProgress - Download progress callback.
@@ -424,7 +424,7 @@ export declare class File extends Endpoint {
424
424
  /**
425
425
  * Runs a new job on the server for the active version of the file.
426
426
  *
427
- * @param outputFormat - The job type. Can be:
427
+ * @param outputFormat - The job type. Can be one of:
428
428
  *
429
429
  * - `geometry` - Convert file geometry data to `VSFX` format for opening in `VisualizeJS` 3D viewer.
430
430
  * - `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.11.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.11.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
@@ -142,7 +142,7 @@ export class File extends Endpoint {
142
142
  * - `gltf` - `glTF` format, file can be opened in `Three.js` 3D viewer.
143
143
  *
144
144
  * 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.
145
+ * can be exported to other formats, but cannot be opened in viewer.
146
146
  */
147
147
  get geometryType(): string {
148
148
  if (this.status.geometryGltf.state === "done") return "gltf";
@@ -401,7 +401,7 @@ export class File extends Endpoint {
401
401
  */
402
402
 
403
403
  /**
404
- * Returns the properties for an objects in the active version of the file.
404
+ * Returns the properties for objects in the active version of the file.
405
405
  *
406
406
  * @param handles - Object original handle or handles array. Specify `undefined` to get properties for
407
407
  * all objects in the file.
@@ -460,7 +460,7 @@ export class File extends Endpoint {
460
460
  */
461
461
 
462
462
  /**
463
- * Returns the list of original handles for an objects in the active version of the file that match the
463
+ * Returns the list of original handles for objects in the active version of the file that match the
464
464
  * specified patterns. Search patterns may be combined using query operators.
465
465
  *
466
466
  * @example Simple search pattern.
@@ -488,7 +488,7 @@ export class File extends Endpoint {
488
488
  * };
489
489
  * ```
490
490
  *
491
- * @param {SeacrhPattern | QueryOperator} searchPattern - Search pattern or combination of the
491
+ * @param {SearchPattern | QueryOperator} searchPattern - Search pattern or combination of the
492
492
  * patterns, see example below.
493
493
  * @returns {Promise<Properties[]>}
494
494
  */
@@ -608,7 +608,7 @@ export class File extends Endpoint {
608
608
  * @param dataId - Resource file name.
609
609
  * @param requestId - Specify a non-empty `requestId` to append the `?requestId=` search parameter to
610
610
  * the server request. If specified, server-side caching may not work.
611
- * @param ranges - A ranges of resource file contents to download. See
611
+ * @param ranges - Ranges of resource file contents to download. See
612
612
  * {@link https://developer.mozilla.org/docs/Web/HTTP/Guides/Range_requests | HTTP range requests} for
613
613
  * more details.
614
614
  * @param onProgress - Download progress callback.
@@ -693,7 +693,7 @@ export class File extends Endpoint {
693
693
  /**
694
694
  * Runs a new job on the server for the active version of the file.
695
695
  *
696
- * @param outputFormat - The job type. Can be:
696
+ * @param outputFormat - The job type. Can be one of:
697
697
  *
698
698
  * - `geometry` - Convert file geometry data to `VSFX` format for opening in `VisualizeJS` 3D viewer.
699
699
  * - `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";