@inweb/client 25.4.3 → 25.4.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.
@@ -211,10 +211,42 @@ export declare class Assembly {
211
211
  * @async
212
212
  */
213
213
  getCdaTree(): Promise<any[]>;
214
- getViewpoints(): Promise<[]>;
214
+ /**
215
+ * Returns a list of assembly viewpoints.
216
+ *
217
+ * @async
218
+ */
219
+ getViewpoints(): Promise<any[]>;
220
+ /**
221
+ * Add new assembly viewpoint. To create a new viewpoint use {@link Viewer.createViewpoint()}.
222
+ *
223
+ * @async
224
+ * @param viewpoint - Viewpoint.
225
+ */
215
226
  saveViewpoint(viewpoint: any): Promise<any>;
227
+ /**
228
+ * Delete assembly viewpoint.
229
+ *
230
+ * @async
231
+ * @param guid - Viewpoint GUID.
232
+ * @returns Returns the raw data of a deleted viewpoint.
233
+ */
216
234
  deleteViewpoint(guid: any): Promise<any>;
235
+ /**
236
+ * Returns viewpoint preview image as
237
+ * {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}.
238
+ *
239
+ * @async
240
+ * @param guid - Viewpoint GUID.
241
+ */
217
242
  getSnapshot(guid: any): Promise<any>;
243
+ /**
244
+ * Returns viewpoint preview data.
245
+ *
246
+ * @async
247
+ * @param guid - Viewpoint GUID.
248
+ * @param bitmapGuid - Bitmap GUID.
249
+ */
218
250
  getSnapshotData(guid: any, bitmapGuid: any): Promise<string>;
219
251
  /**
220
252
  * Download assembly resource file. Resource files are files that contain model scene
@@ -107,6 +107,8 @@ export declare class Client extends EventEmitter2<ClientEventMap> {
107
107
  * - Open the `provider.url` link using `window.open()`.
108
108
  * - Add a `/oauth` path (server-defined) handler to the router. In this handler, show an error
109
109
  * message if the `error` search parameter is present, or log in with the `token` search parameter.
110
+ *
111
+ * @async
110
112
  */
111
113
  getIdentityProviders(): Promise<any>;
112
114
  private setCurrentUser;
package/lib/Api/File.d.ts CHANGED
@@ -304,9 +304,8 @@ export declare class File {
304
304
  */
305
305
  deleteViewpoint(guid: string): Promise<any>;
306
306
  /**
307
- * Returns viewpoint preview image as <a
308
- * href="https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs"
309
- * target="_blank">Data URL</a>.
307
+ * Returns viewpoint preview image as
308
+ * {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}.
310
309
  *
311
310
  * @async
312
311
  * @param guid - Viewpoint GUID.
@@ -128,9 +128,8 @@ export declare class Model {
128
128
  */
129
129
  deleteViewpoint(guid: string): Promise<any>;
130
130
  /**
131
- * Returns viewpoint preview image as <a
132
- * href="https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs"
133
- * target="_blank">Data URL</a>.
131
+ * Returns viewpoint preview image as
132
+ * {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}.
134
133
  *
135
134
  * @async
136
135
  * @param guid - Viewpoint GIID.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inweb/client",
3
- "version": "25.4.3",
3
+ "version": "25.4.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
  "ts-docs": "typedoc"
27
27
  },
28
28
  "dependencies": {
29
- "@inweb/eventemitter2": "~25.4.3"
29
+ "@inweb/eventemitter2": "~25.4.4"
30
30
  }
31
31
  }
@@ -378,31 +378,58 @@ export class Assembly {
378
378
  return this.internalGet(`/properties/tree`).then((response) => response.json());
379
379
  }
380
380
 
381
- // Reserved for future use
382
-
383
- getViewpoints(): Promise<[]> {
384
- console.warn("Assembly does not support viewpoints");
385
- return Promise.resolve([]);
381
+ /**
382
+ * Returns a list of assembly viewpoints.
383
+ *
384
+ * @async
385
+ */
386
+ getViewpoints(): Promise<any[]> {
387
+ return this.internalGet("/viewpoints")
388
+ .then((response) => response.json())
389
+ .then((viewpoints) => viewpoints.result);
386
390
  }
387
391
 
392
+ /**
393
+ * Add new assembly viewpoint. To create a new viewpoint use {@link Viewer.createViewpoint()}.
394
+ *
395
+ * @async
396
+ * @param viewpoint - Viewpoint.
397
+ */
388
398
  saveViewpoint(viewpoint: any): Promise<any> {
389
- console.warn("Assembly does not support viewpoints");
390
- return Promise.resolve({});
399
+ return this.internalPost("/viewpoints", viewpoint).then((response) => response.json());
391
400
  }
392
401
 
402
+ /**
403
+ * Delete assembly viewpoint.
404
+ *
405
+ * @async
406
+ * @param guid - Viewpoint GUID.
407
+ * @returns Returns the raw data of a deleted viewpoint.
408
+ */
393
409
  deleteViewpoint(guid: any): Promise<any> {
394
- console.warn("Assembly does not support viewpoints");
395
- return Promise.resolve({});
410
+ return this.internalDelete(`/viewpoints/${guid}`).then((response) => response.json());
396
411
  }
397
412
 
413
+ /**
414
+ * Returns viewpoint preview image as
415
+ * {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}.
416
+ *
417
+ * @async
418
+ * @param guid - Viewpoint GUID.
419
+ */
398
420
  getSnapshot(guid: any): Promise<any> {
399
- console.warn("Assembly does not support viewpoints");
400
- return Promise.resolve({});
421
+ return this.internalGet(`/viewpoints/${guid}/snapshot`).then((response) => response.text());
401
422
  }
402
423
 
424
+ /**
425
+ * Returns viewpoint preview data.
426
+ *
427
+ * @async
428
+ * @param guid - Viewpoint GUID.
429
+ * @param bitmapGuid - Bitmap GUID.
430
+ */
403
431
  getSnapshotData(guid: any, bitmapGuid: any): Promise<string> {
404
- console.warn("Assembly does not support viewpoints");
405
- return Promise.resolve("");
432
+ return this.internalGet(`/viewpoints/${guid}/bitmaps/${bitmapGuid}`).then((response) => response.text());
406
433
  }
407
434
 
408
435
  /**
package/src/Api/Client.ts CHANGED
@@ -225,6 +225,8 @@ export class Client extends EventEmitter2<ClientEventMap> {
225
225
  * - Open the `provider.url` link using `window.open()`.
226
226
  * - Add a `/oauth` path (server-defined) handler to the router. In this handler, show an error
227
227
  * message if the `error` search parameter is present, or log in with the `token` search parameter.
228
+ *
229
+ * @async
228
230
  */
229
231
  getIdentityProviders(): Promise<any> {
230
232
  return this.httpClient.get("/identity").then((response) => response.json());
package/src/Api/File.ts CHANGED
@@ -506,9 +506,8 @@ export class File {
506
506
  }
507
507
 
508
508
  /**
509
- * Returns viewpoint preview image as <a
510
- * href="https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs"
511
- * target="_blank">Data URL</a>.
509
+ * Returns viewpoint preview image as
510
+ * {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}.
512
511
  *
513
512
  * @async
514
513
  * @param guid - Viewpoint GUID.
package/src/Api/Model.ts CHANGED
@@ -223,9 +223,8 @@ export class Model {
223
223
  }
224
224
 
225
225
  /**
226
- * Returns viewpoint preview image as <a
227
- * href="https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs"
228
- * target="_blank">Data URL</a>.
226
+ * Returns viewpoint preview image as
227
+ * {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}.
229
228
  *
230
229
  * @async
231
230
  * @param guid - Viewpoint GIID.