@inweb/client 26.3.3 → 26.4.1
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 +29 -29
- package/dist/client.js.map +1 -1
- package/dist/client.min.js +1 -1
- package/dist/client.module.js +32 -32
- package/dist/client.module.js.map +1 -1
- package/package.json +2 -2
package/dist/client.js
CHANGED
|
@@ -541,9 +541,9 @@
|
|
|
541
541
|
var _a, _b, _c;
|
|
542
542
|
const timeout = params.timeout || 600000;
|
|
543
543
|
const interval = params.interval || 3000;
|
|
544
|
-
const signal = (_a = params.signal) !== null && _a !==
|
|
545
|
-
const abortError = (_b = params.abortError) !== null && _b !==
|
|
546
|
-
const timeoutError = (_c = params.timeoutError) !== null && _c !==
|
|
544
|
+
const signal = (_a = params.signal) !== null && _a !== undefined ? _a : new AbortController().signal;
|
|
545
|
+
const abortError = (_b = params.abortError) !== null && _b !== undefined ? _b : new DOMException("Aborted", "AbortError");
|
|
546
|
+
const timeoutError = (_c = params.timeoutError) !== null && _c !== undefined ? _c : new DOMException("Timeout", "TimeoutError");
|
|
547
547
|
const end = performance.now() + timeout;
|
|
548
548
|
let count = timeout / interval;
|
|
549
549
|
do {
|
|
@@ -574,9 +574,9 @@
|
|
|
574
574
|
function userFullName(firstName, lastName = "", userName = "") {
|
|
575
575
|
var _a;
|
|
576
576
|
if (firstName && typeof firstName !== "string") {
|
|
577
|
-
return userFullName((_a = firstName.firstName) !== null && _a !==
|
|
577
|
+
return userFullName((_a = firstName.firstName) !== null && _a !== undefined ? _a : firstName.name, firstName.lastName, firstName.userName);
|
|
578
578
|
}
|
|
579
|
-
return `${firstName !== null && firstName !==
|
|
579
|
+
return `${firstName !== null && firstName !== undefined ? firstName : ""} ${lastName !== null && lastName !== undefined ? lastName : ""}`.trim() || userName;
|
|
580
580
|
}
|
|
581
581
|
function userInitials(fullName = "") {
|
|
582
582
|
const names = fullName.split(" ").filter((x) => x);
|
|
@@ -808,7 +808,7 @@
|
|
|
808
808
|
const checkDone = () => this.checkout().then((test) => {
|
|
809
809
|
var _a;
|
|
810
810
|
const ready = ["done", "failed"].includes(test.status);
|
|
811
|
-
const cancel = (_a = params === null || params ===
|
|
811
|
+
const cancel = (_a = params === null || params === undefined ? undefined : params.onCheckout) === null || _a === undefined ? undefined : _a.call(params, test, ready);
|
|
812
812
|
return cancel || ready;
|
|
813
813
|
});
|
|
814
814
|
return waitFor(checkDone, params).then(() => this);
|
|
@@ -893,7 +893,7 @@
|
|
|
893
893
|
this._data.owner.fullName = userFullName(this._data.owner);
|
|
894
894
|
this._data.owner.initials = userInitials(this._data.owner.fullName);
|
|
895
895
|
// associatedFiles since 23.12
|
|
896
|
-
(_a = (_b = this._data).associatedFiles) !== null && _a !==
|
|
896
|
+
(_a = (_b = this._data).associatedFiles) !== null && _a !== undefined ? _a : (_b.associatedFiles = []);
|
|
897
897
|
this._data.associatedFiles.forEach((file) => (file.link = `${this.httpClient.serverUrl}/files/${file.fileId}`));
|
|
898
898
|
}
|
|
899
899
|
/**
|
|
@@ -1238,7 +1238,7 @@
|
|
|
1238
1238
|
const checkDone = () => this.checkout().then((assembly) => {
|
|
1239
1239
|
var _a;
|
|
1240
1240
|
const ready = ["done", "failed"].includes(assembly.status);
|
|
1241
|
-
const cancel = (_a = params === null || params ===
|
|
1241
|
+
const cancel = (_a = params === null || params === undefined ? undefined : params.onCheckout) === null || _a === undefined ? undefined : _a.call(params, assembly, ready);
|
|
1242
1242
|
return cancel || ready;
|
|
1243
1243
|
});
|
|
1244
1244
|
return waitFor(checkDone, params).then(() => this);
|
|
@@ -1338,7 +1338,7 @@
|
|
|
1338
1338
|
* can be used to abort waiting as desired.
|
|
1339
1339
|
*/
|
|
1340
1340
|
createClashTest(name, selectionTypeA, selectionTypeB, selectionSetA, selectionSetB, params) {
|
|
1341
|
-
const { tolerance, clearance, waitForDone } = params !== null && params !==
|
|
1341
|
+
const { tolerance, clearance, waitForDone } = params !== null && params !== undefined ? params : {};
|
|
1342
1342
|
if (!Array.isArray(selectionSetA))
|
|
1343
1343
|
selectionSetA = [selectionSetA];
|
|
1344
1344
|
if (!Array.isArray(selectionSetB))
|
|
@@ -2075,7 +2075,7 @@
|
|
|
2075
2075
|
const checkDone = () => this.checkout().then((job) => {
|
|
2076
2076
|
var _a;
|
|
2077
2077
|
const ready = ["done", "failed"].includes(job.status);
|
|
2078
|
-
const cancel = (_a = params === null || params ===
|
|
2078
|
+
const cancel = (_a = params === null || params === undefined ? undefined : params.onCheckout) === null || _a === undefined ? undefined : _a.call(params, job, ready);
|
|
2079
2079
|
return cancel || ready;
|
|
2080
2080
|
});
|
|
2081
2081
|
return waitFor(checkDone, params).then(() => this);
|
|
@@ -2281,28 +2281,28 @@
|
|
|
2281
2281
|
// owner since 24.8
|
|
2282
2282
|
if (typeof this._data.owner === "string")
|
|
2283
2283
|
this._data.owner = { userId: this._data.owner };
|
|
2284
|
-
(_a = (_p = this._data).owner) !== null && _a !==
|
|
2284
|
+
(_a = (_p = this._data).owner) !== null && _a !== undefined ? _a : (_p.owner = {});
|
|
2285
2285
|
this._data.owner.avatarUrl = `${this.httpClient.serverUrl}/users/${this._data.owner.userId}/avatar`;
|
|
2286
2286
|
this._data.owner.fullName = userFullName(this._data.owner);
|
|
2287
2287
|
this._data.owner.initials = userInitials(this._data.owner.fullName);
|
|
2288
2288
|
// status since 24.9
|
|
2289
|
-
(_b = (_q = this._data).status) !== null && _b !==
|
|
2290
|
-
(_c = (_r = this._data.status).geometry) !== null && _c !==
|
|
2291
|
-
(_e = (_s = this._data.status).properties) !== null && _e !==
|
|
2292
|
-
(_g = (_t = this._data.status).validation) !== null && _g !==
|
|
2289
|
+
(_b = (_q = this._data).status) !== null && _b !== undefined ? _b : (_q.status = {});
|
|
2290
|
+
(_c = (_r = this._data.status).geometry) !== null && _c !== undefined ? _c : (_r.geometry = { state: (_d = this._data.geometryStatus) !== null && _d !== undefined ? _d : "none" });
|
|
2291
|
+
(_e = (_s = this._data.status).properties) !== null && _e !== undefined ? _e : (_s.properties = { state: (_f = this._data.propertiesStatus) !== null && _f !== undefined ? _f : "none" });
|
|
2292
|
+
(_g = (_t = this._data.status).validation) !== null && _g !== undefined ? _g : (_t.validation = { state: (_h = this._data.validationStatus) !== null && _h !== undefined ? _h : "none" });
|
|
2293
2293
|
// updatedBy since 24.10
|
|
2294
|
-
(_j = (_u = this._data).updatedBy) !== null && _j !==
|
|
2294
|
+
(_j = (_u = this._data).updatedBy) !== null && _j !== undefined ? _j : (_u.updatedBy = {});
|
|
2295
2295
|
this._data.updatedBy.avatarUrl = `${this.httpClient.serverUrl}/users/${this._data.updatedBy.userId}/avatar`;
|
|
2296
2296
|
this._data.updatedBy.fullName = userFullName(this._data.updatedBy);
|
|
2297
2297
|
this._data.updatedBy.initials = userInitials(this._data.updatedBy.fullName);
|
|
2298
2298
|
// versions since 24.10
|
|
2299
|
-
(_k = (_v = this._data).versions) !== null && _k !==
|
|
2299
|
+
(_k = (_v = this._data).versions) !== null && _k !== undefined ? _k : (_v.versions = [{ ...value }]);
|
|
2300
2300
|
// geometryGltf status since 24.12
|
|
2301
|
-
(_l = (_w = this._data.status).geometryGltf) !== null && _l !==
|
|
2301
|
+
(_l = (_w = this._data.status).geometryGltf) !== null && _l !== undefined ? _l : (_w.geometryGltf = { state: "none" });
|
|
2302
2302
|
// isFileDeleted since 25.7
|
|
2303
|
-
(_m = (_x = this._data).isFileDeleted) !== null && _m !==
|
|
2303
|
+
(_m = (_x = this._data).isFileDeleted) !== null && _m !== undefined ? _m : (_x.isFileDeleted = false);
|
|
2304
2304
|
// sharedLinkToken since 26.0
|
|
2305
|
-
(_o = (_y = this._data).sharedLinkToken) !== null && _o !==
|
|
2305
|
+
(_o = (_y = this._data).sharedLinkToken) !== null && _o !== undefined ? _o : (_y.sharedLinkToken = null);
|
|
2306
2306
|
}
|
|
2307
2307
|
/**
|
|
2308
2308
|
* Returns a list of file formats in which the active version of the file was exported.
|
|
@@ -2862,7 +2862,7 @@
|
|
|
2862
2862
|
return ["none", "done", "failed"].includes(jobStatus.state || "none");
|
|
2863
2863
|
});
|
|
2864
2864
|
const ready = waitAll ? readyJobs.length === waitJobs.length : readyJobs.length > 0;
|
|
2865
|
-
const cancel = (_a = params === null || params ===
|
|
2865
|
+
const cancel = (_a = params === null || params === undefined ? undefined : params.onCheckout) === null || _a === undefined ? undefined : _a.call(params, file, ready);
|
|
2866
2866
|
return cancel || ready;
|
|
2867
2867
|
});
|
|
2868
2868
|
return waitFor(checkDone, params).then(() => this);
|
|
@@ -2959,7 +2959,7 @@
|
|
|
2959
2959
|
waitForDone: false,
|
|
2960
2960
|
}) {
|
|
2961
2961
|
const result = await this.httpClient
|
|
2962
|
-
.uploadFile(this.getEndpointPath("/versions"), file, (progress) => { var _a; return (_a = params.onProgress) === null || _a ===
|
|
2962
|
+
.uploadFile(this.getEndpointPath("/versions"), file, (progress) => { var _a; return (_a = params.onProgress) === null || _a === undefined ? undefined : _a.call(params, progress, file); }, {
|
|
2963
2963
|
headers: this.headers,
|
|
2964
2964
|
})
|
|
2965
2965
|
.then((xhr) => JSON.parse(xhr.responseText))
|
|
@@ -3800,7 +3800,7 @@
|
|
|
3800
3800
|
.then((data) => new File(data, this.httpClient));
|
|
3801
3801
|
const permissions = await file.getPermissions();
|
|
3802
3802
|
await Promise.allSettled(permissions
|
|
3803
|
-
.filter((permission) => permission.grantedTo.some((x) => { var _a; return ((_a = x.project) === null || _a ===
|
|
3803
|
+
.filter((permission) => permission.grantedTo.some((x) => { var _a; return ((_a = x.project) === null || _a === undefined ? undefined : _a.id) === this.id; }))
|
|
3804
3804
|
.map((permission) => permission.delete()));
|
|
3805
3805
|
return file;
|
|
3806
3806
|
}
|
|
@@ -4562,7 +4562,7 @@
|
|
|
4562
4562
|
.then((data) => ({
|
|
4563
4563
|
...data,
|
|
4564
4564
|
server: data.version,
|
|
4565
|
-
client: "26.
|
|
4565
|
+
client: "26.4.1",
|
|
4566
4566
|
}));
|
|
4567
4567
|
}
|
|
4568
4568
|
/**
|
|
@@ -4581,7 +4581,7 @@
|
|
|
4581
4581
|
.post("/register", {
|
|
4582
4582
|
email,
|
|
4583
4583
|
password,
|
|
4584
|
-
userName: userName !== null && userName !==
|
|
4584
|
+
userName: userName !== null && userName !== undefined ? userName : (email + "").split("@").at(0),
|
|
4585
4585
|
})
|
|
4586
4586
|
.then((response) => response.json());
|
|
4587
4587
|
}
|
|
@@ -4845,7 +4845,7 @@
|
|
|
4845
4845
|
userBrief: {
|
|
4846
4846
|
...rest,
|
|
4847
4847
|
email,
|
|
4848
|
-
userName: userName !== null && userName !==
|
|
4848
|
+
userName: userName !== null && userName !== undefined ? userName : (email + "").split("@").at(0),
|
|
4849
4849
|
},
|
|
4850
4850
|
password,
|
|
4851
4851
|
})
|
|
@@ -4997,7 +4997,7 @@
|
|
|
4997
4997
|
.uploadFile("/files", file, (progress) => {
|
|
4998
4998
|
var _a;
|
|
4999
4999
|
this.emitEvent({ type: "uploadprogress", data: progress, file });
|
|
5000
|
-
(_a = params.onProgress) === null || _a ===
|
|
5000
|
+
(_a = params.onProgress) === null || _a === undefined ? undefined : _a.call(params, progress, file);
|
|
5001
5001
|
})
|
|
5002
5002
|
.then((xhr) => JSON.parse(xhr.responseText))
|
|
5003
5003
|
.then((data) => new File(data, this.httpClient));
|
|
@@ -5223,7 +5223,7 @@
|
|
|
5223
5223
|
* @param params.onCheckout - Waiting progress callback. Return `true` to cancel waiting.
|
|
5224
5224
|
*/
|
|
5225
5225
|
createAssembly(files, name, params) {
|
|
5226
|
-
const { waitForDone } = params !== null && params !==
|
|
5226
|
+
const { waitForDone } = params !== null && params !== undefined ? params : {};
|
|
5227
5227
|
return this.httpClient
|
|
5228
5228
|
.post("/assemblies", { name, files })
|
|
5229
5229
|
.then((response) => response.json())
|
|
@@ -5447,7 +5447,7 @@
|
|
|
5447
5447
|
// By use of this software, its documentation or related materials, you
|
|
5448
5448
|
// acknowledge and accept the above terms.
|
|
5449
5449
|
///////////////////////////////////////////////////////////////////////////////
|
|
5450
|
-
const version = "26.
|
|
5450
|
+
const version = "26.4.1";
|
|
5451
5451
|
|
|
5452
5452
|
exports.Assembly = Assembly;
|
|
5453
5453
|
exports.ClashTest = ClashTest;
|