@inweb/client 25.12.0 → 25.12.2
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 +28 -28
- package/dist/client.js.map +1 -1
- package/dist/client.min.js +1 -1
- package/dist/client.module.js +31 -31
- package/dist/client.module.js.map +1 -1
- package/package.json +2 -2
package/dist/client.js
CHANGED
|
@@ -435,9 +435,9 @@
|
|
|
435
435
|
var _a, _b, _c;
|
|
436
436
|
const timeout = params.timeout || 600000;
|
|
437
437
|
const interval = params.interval || 3000;
|
|
438
|
-
const signal = (_a = params.signal) !== null && _a !==
|
|
439
|
-
const abortError = (_b = params.abortError) !== null && _b !==
|
|
440
|
-
const timeoutError = (_c = params.timeoutError) !== null && _c !==
|
|
438
|
+
const signal = (_a = params.signal) !== null && _a !== undefined ? _a : new AbortController().signal;
|
|
439
|
+
const abortError = (_b = params.abortError) !== null && _b !== undefined ? _b : new DOMException("Aborted", "AbortError");
|
|
440
|
+
const timeoutError = (_c = params.timeoutError) !== null && _c !== undefined ? _c : new DOMException("Timeout", "TimeoutError");
|
|
441
441
|
const end = performance.now() + timeout;
|
|
442
442
|
let count = timeout / interval;
|
|
443
443
|
do {
|
|
@@ -468,9 +468,9 @@
|
|
|
468
468
|
function userFullName(firstName, lastName = "", userName = "") {
|
|
469
469
|
var _a;
|
|
470
470
|
if (firstName && typeof firstName !== "string") {
|
|
471
|
-
return userFullName((_a = firstName.firstName) !== null && _a !==
|
|
471
|
+
return userFullName((_a = firstName.firstName) !== null && _a !== undefined ? _a : firstName.name, firstName.lastName, firstName.userName);
|
|
472
472
|
}
|
|
473
|
-
return `${firstName !== null && firstName !==
|
|
473
|
+
return `${firstName !== null && firstName !== undefined ? firstName : ""} ${lastName !== null && lastName !== undefined ? lastName : ""}`.trim() || userName;
|
|
474
474
|
}
|
|
475
475
|
function userInitials(fullName = "") {
|
|
476
476
|
const names = fullName.split(" ").filter((x) => x);
|
|
@@ -712,7 +712,7 @@
|
|
|
712
712
|
const checkDone = () => this.checkout().then((test) => {
|
|
713
713
|
var _a;
|
|
714
714
|
const ready = ["done", "failed"].includes(test.status);
|
|
715
|
-
const cancel = (_a = params === null || params ===
|
|
715
|
+
const cancel = (_a = params === null || params === undefined ? undefined : params.onCheckout) === null || _a === undefined ? undefined : _a.call(params, test, ready);
|
|
716
716
|
return cancel || ready;
|
|
717
717
|
});
|
|
718
718
|
return waitFor(checkDone, params).then(() => this);
|
|
@@ -820,7 +820,7 @@
|
|
|
820
820
|
this._data.owner.fullName = userFullName(this._data.owner);
|
|
821
821
|
this._data.owner.initials = userInitials(this._data.owner.fullName);
|
|
822
822
|
// associatedFiles since 23.12
|
|
823
|
-
(_a = (_b = this._data).associatedFiles) !== null && _a !==
|
|
823
|
+
(_a = (_b = this._data).associatedFiles) !== null && _a !== undefined ? _a : (_b.associatedFiles = []);
|
|
824
824
|
this._data.associatedFiles.forEach((file) => (file.link = `${this.httpClient.serverUrl}/files/${file.fileId}`));
|
|
825
825
|
}
|
|
826
826
|
/**
|
|
@@ -1160,7 +1160,7 @@
|
|
|
1160
1160
|
const checkDone = () => this.checkout().then((assembly) => {
|
|
1161
1161
|
var _a;
|
|
1162
1162
|
const ready = ["done", "failed"].includes(assembly.status);
|
|
1163
|
-
const cancel = (_a = params === null || params ===
|
|
1163
|
+
const cancel = (_a = params === null || params === undefined ? undefined : params.onCheckout) === null || _a === undefined ? undefined : _a.call(params, assembly, ready);
|
|
1164
1164
|
return cancel || ready;
|
|
1165
1165
|
});
|
|
1166
1166
|
return waitFor(checkDone, params).then(() => this);
|
|
@@ -1262,7 +1262,7 @@
|
|
|
1262
1262
|
* signal, which can be used to abort waiting as desired.
|
|
1263
1263
|
*/
|
|
1264
1264
|
createClashTest(name, selectionTypeA, selectionTypeB, selectionSetA, selectionSetB, params) {
|
|
1265
|
-
const { tolerance, clearance, waitForDone } = params !== null && params !==
|
|
1265
|
+
const { tolerance, clearance, waitForDone } = params !== null && params !== undefined ? params : {};
|
|
1266
1266
|
if (!Array.isArray(selectionSetA))
|
|
1267
1267
|
selectionSetA = [selectionSetA];
|
|
1268
1268
|
if (!Array.isArray(selectionSetB))
|
|
@@ -1993,7 +1993,7 @@
|
|
|
1993
1993
|
const checkDone = () => this.checkout().then((job) => {
|
|
1994
1994
|
var _a;
|
|
1995
1995
|
const ready = ["done", "failed"].includes(job.status);
|
|
1996
|
-
const cancel = (_a = params === null || params ===
|
|
1996
|
+
const cancel = (_a = params === null || params === undefined ? undefined : params.onCheckout) === null || _a === undefined ? undefined : _a.call(params, job, ready);
|
|
1997
1997
|
return cancel || ready;
|
|
1998
1998
|
});
|
|
1999
1999
|
return waitFor(checkDone, params).then(() => this);
|
|
@@ -2106,26 +2106,26 @@
|
|
|
2106
2106
|
// owner since 24.8
|
|
2107
2107
|
if (typeof this._data.owner === "string")
|
|
2108
2108
|
this._data.owner = { userId: this._data.owner };
|
|
2109
|
-
(_a = (_o = this._data).owner) !== null && _a !==
|
|
2109
|
+
(_a = (_o = this._data).owner) !== null && _a !== undefined ? _a : (_o.owner = {});
|
|
2110
2110
|
this._data.owner.avatarUrl = `${this.httpClient.serverUrl}/users/${this._data.owner.userId}/avatar`;
|
|
2111
2111
|
this._data.owner.fullName = userFullName(this._data.owner);
|
|
2112
2112
|
this._data.owner.initials = userInitials(this._data.owner.fullName);
|
|
2113
2113
|
// status since 24.9
|
|
2114
|
-
(_b = (_p = this._data).status) !== null && _b !==
|
|
2115
|
-
(_c = (_q = this._data.status).geometry) !== null && _c !==
|
|
2116
|
-
(_e = (_r = this._data.status).properties) !== null && _e !==
|
|
2117
|
-
(_g = (_s = this._data.status).validation) !== null && _g !==
|
|
2114
|
+
(_b = (_p = this._data).status) !== null && _b !== undefined ? _b : (_p.status = {});
|
|
2115
|
+
(_c = (_q = this._data.status).geometry) !== null && _c !== undefined ? _c : (_q.geometry = { state: (_d = this._data.geometryStatus) !== null && _d !== undefined ? _d : "none" });
|
|
2116
|
+
(_e = (_r = this._data.status).properties) !== null && _e !== undefined ? _e : (_r.properties = { state: (_f = this._data.propertiesStatus) !== null && _f !== undefined ? _f : "none" });
|
|
2117
|
+
(_g = (_s = this._data.status).validation) !== null && _g !== undefined ? _g : (_s.validation = { state: (_h = this._data.validationStatus) !== null && _h !== undefined ? _h : "none" });
|
|
2118
2118
|
// updatedBy since 24.10
|
|
2119
|
-
(_j = (_t = this._data).updatedBy) !== null && _j !==
|
|
2119
|
+
(_j = (_t = this._data).updatedBy) !== null && _j !== undefined ? _j : (_t.updatedBy = {});
|
|
2120
2120
|
this._data.updatedBy.avatarUrl = `${this.httpClient.serverUrl}/users/${this._data.updatedBy.userId}/avatar`;
|
|
2121
2121
|
this._data.updatedBy.fullName = userFullName(this._data.updatedBy);
|
|
2122
2122
|
this._data.updatedBy.initials = userInitials(this._data.updatedBy.fullName);
|
|
2123
2123
|
// versions since 24.10
|
|
2124
|
-
(_k = (_u = this._data).versions) !== null && _k !==
|
|
2124
|
+
(_k = (_u = this._data).versions) !== null && _k !== undefined ? _k : (_u.versions = [{ ...value }]);
|
|
2125
2125
|
// geometryGltf status since 24.12
|
|
2126
|
-
(_l = (_v = this._data.status).geometryGltf) !== null && _l !==
|
|
2126
|
+
(_l = (_v = this._data.status).geometryGltf) !== null && _l !== undefined ? _l : (_v.geometryGltf = { state: "none" });
|
|
2127
2127
|
// isFileDeleted since 25.7
|
|
2128
|
-
(_m = (_w = this._data).isFileDeleted) !== null && _m !==
|
|
2128
|
+
(_m = (_w = this._data).isFileDeleted) !== null && _m !== undefined ? _m : (_w.isFileDeleted = false);
|
|
2129
2129
|
}
|
|
2130
2130
|
/**
|
|
2131
2131
|
* Returns a list of file formats in which the active version of the file was exported.
|
|
@@ -2671,7 +2671,7 @@
|
|
|
2671
2671
|
return ["none", "done", "failed"].includes(jobStatus.state || "none");
|
|
2672
2672
|
});
|
|
2673
2673
|
const ready = waitAll ? readyJobs.length === waitJobs.length : readyJobs.length > 0;
|
|
2674
|
-
const cancel = (_a = params === null || params ===
|
|
2674
|
+
const cancel = (_a = params === null || params === undefined ? undefined : params.onCheckout) === null || _a === undefined ? undefined : _a.call(params, file, ready);
|
|
2675
2675
|
return cancel || ready;
|
|
2676
2676
|
});
|
|
2677
2677
|
return waitFor(checkDone, params).then(() => this);
|
|
@@ -2763,7 +2763,7 @@
|
|
|
2763
2763
|
waitForDone: false,
|
|
2764
2764
|
}) {
|
|
2765
2765
|
const result = await this.httpClient
|
|
2766
|
-
.uploadFile(`${this.path}/versions`, file, (progress) => { var _a; return (_a = params.onProgress) === null || _a ===
|
|
2766
|
+
.uploadFile(`${this.path}/versions`, file, (progress) => { var _a; return (_a = params.onProgress) === null || _a === undefined ? undefined : _a.call(params, progress, file); })
|
|
2767
2767
|
.then((xhr) => JSON.parse(xhr.responseText))
|
|
2768
2768
|
.then((data) => new File(data, this.httpClient));
|
|
2769
2769
|
let geometryType = "";
|
|
@@ -3595,7 +3595,7 @@
|
|
|
3595
3595
|
.then((data) => new File(data, this.httpClient));
|
|
3596
3596
|
const permissions = await file.getPermissions();
|
|
3597
3597
|
await Promise.allSettled(permissions
|
|
3598
|
-
.filter((permission) => permission.grantedTo.some((x) => { var _a; return ((_a = x.project) === null || _a ===
|
|
3598
|
+
.filter((permission) => permission.grantedTo.some((x) => { var _a; return ((_a = x.project) === null || _a === undefined ? undefined : _a.id) === this.id; }))
|
|
3599
3599
|
.map((permission) => permission.delete()));
|
|
3600
3600
|
return file;
|
|
3601
3601
|
}
|
|
@@ -4324,7 +4324,7 @@
|
|
|
4324
4324
|
.then((data) => ({
|
|
4325
4325
|
...data,
|
|
4326
4326
|
server: data.version,
|
|
4327
|
-
client: "25.12.
|
|
4327
|
+
client: "25.12.2",
|
|
4328
4328
|
}));
|
|
4329
4329
|
}
|
|
4330
4330
|
/**
|
|
@@ -4343,7 +4343,7 @@
|
|
|
4343
4343
|
.post("/register", {
|
|
4344
4344
|
email,
|
|
4345
4345
|
password,
|
|
4346
|
-
userName: userName !== null && userName !==
|
|
4346
|
+
userName: userName !== null && userName !== undefined ? userName : (email + "").split("@").at(0),
|
|
4347
4347
|
})
|
|
4348
4348
|
.then((response) => response.json());
|
|
4349
4349
|
}
|
|
@@ -4598,7 +4598,7 @@
|
|
|
4598
4598
|
userBrief: {
|
|
4599
4599
|
...rest,
|
|
4600
4600
|
email,
|
|
4601
|
-
userName: userName !== null && userName !==
|
|
4601
|
+
userName: userName !== null && userName !== undefined ? userName : (email + "").split("@").at(0),
|
|
4602
4602
|
},
|
|
4603
4603
|
password,
|
|
4604
4604
|
})
|
|
@@ -4748,7 +4748,7 @@
|
|
|
4748
4748
|
.uploadFile("/files", file, (progress) => {
|
|
4749
4749
|
var _a;
|
|
4750
4750
|
this.emitEvent({ type: "uploadprogress", data: progress, file });
|
|
4751
|
-
(_a = params.onProgress) === null || _a ===
|
|
4751
|
+
(_a = params.onProgress) === null || _a === undefined ? undefined : _a.call(params, progress, file);
|
|
4752
4752
|
})
|
|
4753
4753
|
.then((xhr) => JSON.parse(xhr.responseText))
|
|
4754
4754
|
.then((data) => new File(data, this.httpClient));
|
|
@@ -4974,7 +4974,7 @@
|
|
|
4974
4974
|
* @param params.onCheckout - Waiting progress callback. Return `true` to cancel waiting.
|
|
4975
4975
|
*/
|
|
4976
4976
|
createAssembly(files, name, params) {
|
|
4977
|
-
const { waitForDone } = params !== null && params !==
|
|
4977
|
+
const { waitForDone } = params !== null && params !== undefined ? params : {};
|
|
4978
4978
|
return this.httpClient
|
|
4979
4979
|
.post("/assemblies", { name, files })
|
|
4980
4980
|
.then((response) => response.json())
|
|
@@ -5139,7 +5139,7 @@
|
|
|
5139
5139
|
// By use of this software, its documentation or related materials, you
|
|
5140
5140
|
// acknowledge and accept the above terms.
|
|
5141
5141
|
///////////////////////////////////////////////////////////////////////////////
|
|
5142
|
-
const version = "25.12.
|
|
5142
|
+
const version = "25.12.2";
|
|
5143
5143
|
|
|
5144
5144
|
exports.Assembly = Assembly;
|
|
5145
5145
|
exports.ClashTest = ClashTest;
|