@inweb/client 25.4.3 → 25.4.6

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.
package/dist/client.js CHANGED
@@ -196,9 +196,8 @@
196
196
  return this._file.deleteViewpoint(guid);
197
197
  }
198
198
  /**
199
- * Returns viewpoint preview image as <a
200
- * href="https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs"
201
- * target="_blank">Data URL</a>.
199
+ * Returns viewpoint preview image as
200
+ * {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}.
202
201
  *
203
202
  * @async
204
203
  * @param guid - Viewpoint GIID.
@@ -1029,26 +1028,54 @@
1029
1028
  getCdaTree() {
1030
1029
  return this.internalGet(`/properties/tree`).then((response) => response.json());
1031
1030
  }
1032
- // Reserved for future use
1031
+ /**
1032
+ * Returns a list of assembly viewpoints.
1033
+ *
1034
+ * @async
1035
+ */
1033
1036
  getViewpoints() {
1034
- console.warn("Assembly does not support viewpoints");
1035
- return Promise.resolve([]);
1037
+ return this.internalGet("/viewpoints")
1038
+ .then((response) => response.json())
1039
+ .then((viewpoints) => viewpoints.result);
1036
1040
  }
1041
+ /**
1042
+ * Add new assembly viewpoint. To create a new viewpoint use {@link Viewer.createViewpoint()}.
1043
+ *
1044
+ * @async
1045
+ * @param viewpoint - Viewpoint.
1046
+ */
1037
1047
  saveViewpoint(viewpoint) {
1038
- console.warn("Assembly does not support viewpoints");
1039
- return Promise.resolve({});
1048
+ return this.internalPost("/viewpoints", viewpoint).then((response) => response.json());
1040
1049
  }
1050
+ /**
1051
+ * Delete assembly viewpoint.
1052
+ *
1053
+ * @async
1054
+ * @param guid - Viewpoint GUID.
1055
+ * @returns Returns the raw data of a deleted viewpoint.
1056
+ */
1041
1057
  deleteViewpoint(guid) {
1042
- console.warn("Assembly does not support viewpoints");
1043
- return Promise.resolve({});
1058
+ return this.internalDelete(`/viewpoints/${guid}`).then((response) => response.json());
1044
1059
  }
1060
+ /**
1061
+ * Returns viewpoint preview image as
1062
+ * {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}.
1063
+ *
1064
+ * @async
1065
+ * @param guid - Viewpoint GUID.
1066
+ */
1045
1067
  getSnapshot(guid) {
1046
- console.warn("Assembly does not support viewpoints");
1047
- return Promise.resolve({});
1068
+ return this.internalGet(`/viewpoints/${guid}/snapshot`).then((response) => response.text());
1048
1069
  }
1070
+ /**
1071
+ * Returns viewpoint preview data.
1072
+ *
1073
+ * @async
1074
+ * @param guid - Viewpoint GUID.
1075
+ * @param bitmapGuid - Bitmap GUID.
1076
+ */
1049
1077
  getSnapshotData(guid, bitmapGuid) {
1050
- console.warn("Assembly does not support viewpoints");
1051
- return Promise.resolve("");
1078
+ return this.internalGet(`/viewpoints/${guid}/bitmaps/${bitmapGuid}`).then((response) => response.text());
1052
1079
  }
1053
1080
  /**
1054
1081
  * Download assembly resource file. Resource files are files that contain model scene
@@ -2294,9 +2321,8 @@
2294
2321
  return this.internalDelete(`/viewpoints/${guid}`).then((response) => response.json());
2295
2322
  }
2296
2323
  /**
2297
- * Returns viewpoint preview image as <a
2298
- * href="https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs"
2299
- * target="_blank">Data URL</a>.
2324
+ * Returns viewpoint preview image as
2325
+ * {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}.
2300
2326
  *
2301
2327
  * @async
2302
2328
  * @param guid - Viewpoint GUID.
@@ -3456,6 +3482,12 @@
3456
3482
  get initials() {
3457
3483
  return this.data.initials;
3458
3484
  }
3485
+ /**
3486
+ * `true` if user is has an administrator rights.
3487
+ */
3488
+ get isAdmin() {
3489
+ return this.data.isAdmin;
3490
+ }
3459
3491
  /**
3460
3492
  * `false` if the user has not yet confirmed his email address.
3461
3493
  *
@@ -3727,7 +3759,7 @@
3727
3759
  .then((data) => ({
3728
3760
  ...data,
3729
3761
  server: data.version,
3730
- client: "25.4.3",
3762
+ client: "25.4.6",
3731
3763
  }));
3732
3764
  }
3733
3765
  /**
@@ -3807,6 +3839,8 @@
3807
3839
  * - Open the `provider.url` link using `window.open()`.
3808
3840
  * - Add a `/oauth` path (server-defined) handler to the router. In this handler, show an error
3809
3841
  * message if the `error` search parameter is present, or log in with the `token` search parameter.
3842
+ *
3843
+ * @async
3810
3844
  */
3811
3845
  getIdentityProviders() {
3812
3846
  return this.httpClient.get("/identity").then((response) => response.json());
@@ -4418,7 +4452,7 @@
4418
4452
  }
4419
4453
 
4420
4454
  ///////////////////////////////////////////////////////////////////////////////
4421
- const version = "25.4.3";
4455
+ const version = "25.4.6";
4422
4456
 
4423
4457
  exports.Assembly = Assembly;
4424
4458
  exports.ClashTest = ClashTest;