@inweb/client 26.9.2 → 26.9.3

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
@@ -444,11 +444,11 @@
444
444
  * or geometry data.
445
445
  *
446
446
  * @param dataId - Resource file name.
447
+ * @param requestId - Specify a non-empty `requestId` to append the `?requestId=` search parameter to
448
+ * the server request. If specified, server-side caching may not work.
447
449
  * @param ranges - A ranges of resource file contents to download. See
448
450
  * {@link https://developer.mozilla.org/docs/Web/HTTP/Guides/Range_requests | HTTP range requests} for
449
451
  * more details.
450
- * @param requestId - Specify a non-empty `requestId` to append the `?requestId=` search parameter to
451
- * the server request. If specified, server-side caching may not work.
452
452
  * @param onProgress - Download progress callback.
453
453
  * @param signal - An
454
454
  * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController} signal. Allows
@@ -545,9 +545,9 @@
545
545
  var _a, _b, _c;
546
546
  const timeout = params.timeout || 600000;
547
547
  const interval = params.interval || 3000;
548
- const signal = (_a = params.signal) !== null && _a !== undefined ? _a : new AbortController().signal;
549
- const abortError = (_b = params.abortError) !== null && _b !== undefined ? _b : new DOMException("Aborted", "AbortError");
550
- const timeoutError = (_c = params.timeoutError) !== null && _c !== undefined ? _c : new DOMException("Timeout", "TimeoutError");
548
+ const signal = (_a = params.signal) !== null && _a !== void 0 ? _a : new AbortController().signal;
549
+ const abortError = (_b = params.abortError) !== null && _b !== void 0 ? _b : new DOMException("Aborted", "AbortError");
550
+ const timeoutError = (_c = params.timeoutError) !== null && _c !== void 0 ? _c : new DOMException("Timeout", "TimeoutError");
551
551
  const end = performance.now() + timeout;
552
552
  let count = timeout / interval;
553
553
  do {
@@ -578,9 +578,9 @@
578
578
  function userFullName(firstName, lastName = "", userName = "") {
579
579
  var _a;
580
580
  if (firstName && typeof firstName !== "string") {
581
- return userFullName((_a = firstName.firstName) !== null && _a !== undefined ? _a : firstName.name, firstName.lastName, firstName.userName);
581
+ return userFullName((_a = firstName.firstName) !== null && _a !== void 0 ? _a : firstName.name, firstName.lastName, firstName.userName);
582
582
  }
583
- return `${firstName !== null && firstName !== undefined ? firstName : ""} ${lastName !== null && lastName !== undefined ? lastName : ""}`.trim() || userName;
583
+ return `${firstName !== null && firstName !== void 0 ? firstName : ""} ${lastName !== null && lastName !== void 0 ? lastName : ""}`.trim() || userName;
584
584
  }
585
585
  function userInitials(fullName = "") {
586
586
  const names = fullName.split(" ").filter((x) => x);
@@ -812,7 +812,7 @@
812
812
  const checkDone = () => this.checkout().then((test) => {
813
813
  var _a;
814
814
  const ready = ["done", "failed"].includes(test.status);
815
- const cancel = (_a = params === null || params === undefined ? undefined : params.onCheckout) === null || _a === undefined ? undefined : _a.call(params, test, ready);
815
+ const cancel = (_a = params === null || params === void 0 ? void 0 : params.onCheckout) === null || _a === void 0 ? void 0 : _a.call(params, test, ready);
816
816
  return cancel || ready;
817
817
  });
818
818
  return waitFor(checkDone, params).then(() => this);
@@ -897,7 +897,7 @@
897
897
  this._data.owner.fullName = userFullName(this._data.owner);
898
898
  this._data.owner.initials = userInitials(this._data.owner.fullName);
899
899
  // associatedFiles since 23.12
900
- (_a = (_b = this._data).associatedFiles) !== null && _a !== undefined ? _a : (_b.associatedFiles = []);
900
+ (_a = (_b = this._data).associatedFiles) !== null && _a !== void 0 ? _a : (_b.associatedFiles = []);
901
901
  this._data.associatedFiles.forEach((file) => (file.link = `${this.httpClient.serverUrl}/files/${file.fileId}`));
902
902
  }
903
903
  /**
@@ -1205,11 +1205,11 @@
1205
1205
  * descriptions, or geometry data.
1206
1206
  *
1207
1207
  * @param dataId - Resource file name.
1208
+ * @param requestId - Specify a non-empty `requestId` to append the `?requestId=` search parameter to
1209
+ * the server request. If specified, server-side caching may not work.
1208
1210
  * @param ranges - A ranges of resource file contents to download. See
1209
1211
  * {@link https://developer.mozilla.org/docs/Web/HTTP/Guides/Range_requests | HTTP range requests} for
1210
1212
  * more details.
1211
- * @param requestId - Specify a non-empty `requestId` to append the `?requestId=` search parameter to
1212
- * the server request. If specified, server-side caching may not work.
1213
1213
  * @param onProgress - Download progress callback.
1214
1214
  * @param signal - An
1215
1215
  * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController} signal. Allows
@@ -1272,7 +1272,7 @@
1272
1272
  const checkDone = () => this.checkout().then((assembly) => {
1273
1273
  var _a;
1274
1274
  const ready = ["done", "failed"].includes(assembly.status);
1275
- const cancel = (_a = params === null || params === undefined ? undefined : params.onCheckout) === null || _a === undefined ? undefined : _a.call(params, assembly, ready);
1275
+ const cancel = (_a = params === null || params === void 0 ? void 0 : params.onCheckout) === null || _a === void 0 ? void 0 : _a.call(params, assembly, ready);
1276
1276
  return cancel || ready;
1277
1277
  });
1278
1278
  return waitFor(checkDone, params).then(() => this);
@@ -1372,7 +1372,7 @@
1372
1372
  * can be used to abort waiting as desired.
1373
1373
  */
1374
1374
  createClashTest(name, selectionTypeA, selectionTypeB, selectionSetA, selectionSetB, params) {
1375
- const { tolerance, clearance, waitForDone } = params !== null && params !== undefined ? params : {};
1375
+ const { tolerance, clearance, waitForDone } = params !== null && params !== void 0 ? params : {};
1376
1376
  if (!Array.isArray(selectionSetA))
1377
1377
  selectionSetA = [selectionSetA];
1378
1378
  if (!Array.isArray(selectionSetB))
@@ -1441,7 +1441,7 @@
1441
1441
  }
1442
1442
  removeEventListener(type, listener) {
1443
1443
  if (this._listeners[type] === undefined) return this;
1444
- const listeners = this._listeners[type].filter((x => x !== listener));
1444
+ const listeners = this._listeners[type].filter(x => x !== listener);
1445
1445
  if (listeners.length !== 0) this._listeners[type] = listeners; else delete this._listeners[type];
1446
1446
  return this;
1447
1447
  }
@@ -1452,7 +1452,7 @@
1452
1452
  emitEvent(event) {
1453
1453
  if (this._listeners[event.type] === undefined) return false;
1454
1454
  const invoke = this._listeners[event.type].slice();
1455
- invoke.forEach((listener => listener.call(this, event)));
1455
+ invoke.forEach(listener => listener.call(this, event));
1456
1456
  return true;
1457
1457
  }
1458
1458
  on(type, listener) {
@@ -2100,7 +2100,7 @@
2100
2100
  const checkDone = () => this.checkout().then((job) => {
2101
2101
  var _a;
2102
2102
  const ready = ["done", "failed"].includes(job.status);
2103
- const cancel = (_a = params === null || params === undefined ? undefined : params.onCheckout) === null || _a === undefined ? undefined : _a.call(params, job, ready);
2103
+ const cancel = (_a = params === null || params === void 0 ? void 0 : params.onCheckout) === null || _a === void 0 ? void 0 : _a.call(params, job, ready);
2104
2104
  return cancel || ready;
2105
2105
  });
2106
2106
  return waitFor(checkDone, params).then(() => this);
@@ -2306,28 +2306,28 @@
2306
2306
  // owner since 24.8
2307
2307
  if (typeof this._data.owner === "string")
2308
2308
  this._data.owner = { userId: this._data.owner };
2309
- (_a = (_p = this._data).owner) !== null && _a !== undefined ? _a : (_p.owner = {});
2309
+ (_a = (_p = this._data).owner) !== null && _a !== void 0 ? _a : (_p.owner = {});
2310
2310
  this._data.owner.avatarUrl = `${this.httpClient.serverUrl}/users/${this._data.owner.userId}/avatar`;
2311
2311
  this._data.owner.fullName = userFullName(this._data.owner);
2312
2312
  this._data.owner.initials = userInitials(this._data.owner.fullName);
2313
2313
  // status since 24.9
2314
- (_b = (_q = this._data).status) !== null && _b !== undefined ? _b : (_q.status = {});
2315
- (_c = (_r = this._data.status).geometry) !== null && _c !== undefined ? _c : (_r.geometry = { state: (_d = this._data.geometryStatus) !== null && _d !== undefined ? _d : "none" });
2316
- (_e = (_s = this._data.status).properties) !== null && _e !== undefined ? _e : (_s.properties = { state: (_f = this._data.propertiesStatus) !== null && _f !== undefined ? _f : "none" });
2317
- (_g = (_t = this._data.status).validation) !== null && _g !== undefined ? _g : (_t.validation = { state: (_h = this._data.validationStatus) !== null && _h !== undefined ? _h : "none" });
2314
+ (_b = (_q = this._data).status) !== null && _b !== void 0 ? _b : (_q.status = {});
2315
+ (_c = (_r = this._data.status).geometry) !== null && _c !== void 0 ? _c : (_r.geometry = { state: (_d = this._data.geometryStatus) !== null && _d !== void 0 ? _d : "none" });
2316
+ (_e = (_s = this._data.status).properties) !== null && _e !== void 0 ? _e : (_s.properties = { state: (_f = this._data.propertiesStatus) !== null && _f !== void 0 ? _f : "none" });
2317
+ (_g = (_t = this._data.status).validation) !== null && _g !== void 0 ? _g : (_t.validation = { state: (_h = this._data.validationStatus) !== null && _h !== void 0 ? _h : "none" });
2318
2318
  // updatedBy since 24.10
2319
- (_j = (_u = this._data).updatedBy) !== null && _j !== undefined ? _j : (_u.updatedBy = {});
2319
+ (_j = (_u = this._data).updatedBy) !== null && _j !== void 0 ? _j : (_u.updatedBy = {});
2320
2320
  this._data.updatedBy.avatarUrl = `${this.httpClient.serverUrl}/users/${this._data.updatedBy.userId}/avatar`;
2321
2321
  this._data.updatedBy.fullName = userFullName(this._data.updatedBy);
2322
2322
  this._data.updatedBy.initials = userInitials(this._data.updatedBy.fullName);
2323
2323
  // versions since 24.10
2324
- (_k = (_v = this._data).versions) !== null && _k !== undefined ? _k : (_v.versions = [{ ...value }]);
2324
+ (_k = (_v = this._data).versions) !== null && _k !== void 0 ? _k : (_v.versions = [{ ...value }]);
2325
2325
  // geometryGltf status since 24.12
2326
- (_l = (_w = this._data.status).geometryGltf) !== null && _l !== undefined ? _l : (_w.geometryGltf = { state: "none" });
2326
+ (_l = (_w = this._data.status).geometryGltf) !== null && _l !== void 0 ? _l : (_w.geometryGltf = { state: "none" });
2327
2327
  // isFileDeleted since 25.7
2328
- (_m = (_x = this._data).isFileDeleted) !== null && _m !== undefined ? _m : (_x.isFileDeleted = false);
2328
+ (_m = (_x = this._data).isFileDeleted) !== null && _m !== void 0 ? _m : (_x.isFileDeleted = false);
2329
2329
  // sharedLinkToken since 26.0
2330
- (_o = (_y = this._data).sharedLinkToken) !== null && _o !== undefined ? _o : (_y.sharedLinkToken = null);
2330
+ (_o = (_y = this._data).sharedLinkToken) !== null && _o !== void 0 ? _o : (_y.sharedLinkToken = null);
2331
2331
  }
2332
2332
  /**
2333
2333
  * Returns a list of file formats in which the active version of the file was exported.
@@ -2775,11 +2775,11 @@
2775
2775
  * contain model scene descriptions, or geometry data, or exported files.
2776
2776
  *
2777
2777
  * @param dataId - Resource file name.
2778
+ * @param requestId - Specify a non-empty `requestId` to append the `?requestId=` search parameter to
2779
+ * the server request. If specified, server-side caching may not work.
2778
2780
  * @param ranges - A ranges of resource file contents to download. See
2779
2781
  * {@link https://developer.mozilla.org/docs/Web/HTTP/Guides/Range_requests | HTTP range requests} for
2780
2782
  * more details.
2781
- * @param requestId - Specify a non-empty `requestId` to append the `?requestId=` search parameter to
2782
- * the server request. If specified, server-side caching may not work.
2783
2783
  * @param onProgress - Download progress callback.
2784
2784
  * @param signal - An
2785
2785
  * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController} signal. Allows
@@ -2925,7 +2925,7 @@
2925
2925
  return ["none", "done", "failed"].includes(jobStatus.state || "none");
2926
2926
  });
2927
2927
  const ready = waitAll ? readyJobs.length === waitJobs.length : readyJobs.length > 0;
2928
- const cancel = (_a = params === null || params === undefined ? undefined : params.onCheckout) === null || _a === undefined ? undefined : _a.call(params, file, ready);
2928
+ const cancel = (_a = params === null || params === void 0 ? void 0 : params.onCheckout) === null || _a === void 0 ? void 0 : _a.call(params, file, ready);
2929
2929
  return cancel || ready;
2930
2930
  });
2931
2931
  return waitFor(checkDone, params).then(() => this);
@@ -3022,7 +3022,7 @@
3022
3022
  waitForDone: false,
3023
3023
  }) {
3024
3024
  const result = await this.httpClient
3025
- .uploadFile(this.getEndpointPath("/versions"), file, (progress) => { var _a; return (_a = params.onProgress) === null || _a === undefined ? undefined : _a.call(params, progress, file); }, {
3025
+ .uploadFile(this.getEndpointPath("/versions"), file, (progress) => { var _a; return (_a = params.onProgress) === null || _a === void 0 ? void 0 : _a.call(params, progress, file); }, {
3026
3026
  headers: this.headers,
3027
3027
  })
3028
3028
  .then((xhr) => JSON.parse(xhr.responseText))
@@ -3863,7 +3863,7 @@
3863
3863
  .then((data) => new File(data, this.httpClient));
3864
3864
  const permissions = await file.getPermissions();
3865
3865
  await Promise.allSettled(permissions
3866
- .filter((permission) => permission.grantedTo.some((x) => { var _a; return ((_a = x.project) === null || _a === undefined ? undefined : _a.id) === this.id; }))
3866
+ .filter((permission) => permission.grantedTo.some((x) => { var _a; return ((_a = x.project) === null || _a === void 0 ? void 0 : _a.id) === this.id; }))
3867
3867
  .map((permission) => permission.delete()));
3868
3868
  return file;
3869
3869
  }
@@ -4840,7 +4840,7 @@
4840
4840
  .then((data) => ({
4841
4841
  ...data,
4842
4842
  server: data.version,
4843
- client: "26.9.2",
4843
+ client: "26.9.3",
4844
4844
  }));
4845
4845
  }
4846
4846
  /**
@@ -4859,7 +4859,7 @@
4859
4859
  .post("/register", {
4860
4860
  email,
4861
4861
  password,
4862
- userName: userName !== null && userName !== undefined ? userName : (email + "").split("@").at(0),
4862
+ userName: userName !== null && userName !== void 0 ? userName : (email + "").split("@").shift(),
4863
4863
  })
4864
4864
  .then((response) => response.json());
4865
4865
  }
@@ -5123,7 +5123,7 @@
5123
5123
  userBrief: {
5124
5124
  ...rest,
5125
5125
  email,
5126
- userName: userName !== null && userName !== undefined ? userName : (email + "").split("@").at(0),
5126
+ userName: userName !== null && userName !== void 0 ? userName : (email + "").split("@").shift(),
5127
5127
  },
5128
5128
  password,
5129
5129
  })
@@ -5279,7 +5279,7 @@
5279
5279
  .uploadFile("/files", file, (progress) => {
5280
5280
  var _a;
5281
5281
  this.emitEvent({ type: "uploadprogress", data: progress, file });
5282
- (_a = params.onProgress) === null || _a === undefined ? undefined : _a.call(params, progress, file);
5282
+ (_a = params.onProgress) === null || _a === void 0 ? void 0 : _a.call(params, progress, file);
5283
5283
  })
5284
5284
  .then((xhr) => JSON.parse(xhr.responseText))
5285
5285
  .then((data) => new File(data, this.httpClient));
@@ -5841,7 +5841,7 @@
5841
5841
  // By use of this software, its documentation or related materials, you
5842
5842
  // acknowledge and accept the above terms.
5843
5843
  ///////////////////////////////////////////////////////////////////////////////
5844
- const version = "26.9.2";
5844
+ const version = "26.9.3";
5845
5845
 
5846
5846
  exports.Assembly = Assembly;
5847
5847
  exports.ClashTest = ClashTest;