@formant/data-sdk 1.33.0 → 1.34.0
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/data-sdk.cjs.js +2 -2
- package/dist/data-sdk.cjs.js.map +1 -1
- package/dist/data-sdk.es.js +37 -48
- package/dist/data-sdk.es.js.map +1 -1
- package/dist/data-sdk.es6.js +37 -48
- package/dist/data-sdk.umd.js +2 -2
- package/dist/types/data-sdk/src/stores/AuthenticationStore.d.ts +1 -1
- package/dist/types/data-sdk/src/stores/IAuthenticationStore.d.ts +1 -1
- package/package.json +1 -1
package/dist/data-sdk.es6.js
CHANGED
|
@@ -217,10 +217,10 @@ class AuthenticationStore {
|
|
|
217
217
|
isAuthenticated() {
|
|
218
218
|
return this._token !== void 0;
|
|
219
219
|
}
|
|
220
|
-
async loginToPeer(t, n) {
|
|
220
|
+
async loginToPeer(t, n, r) {
|
|
221
221
|
if ((await fetch(`${t}/login`, {
|
|
222
222
|
method: "POST",
|
|
223
|
-
body: JSON.stringify({
|
|
223
|
+
body: JSON.stringify({ username: n, password: r }),
|
|
224
224
|
headers: {
|
|
225
225
|
"Content-Type": "application/json"
|
|
226
226
|
}
|
|
@@ -27853,88 +27853,77 @@ class TelemetryUniverseData extends BasicUniverseDataConnector {
|
|
|
27853
27853
|
const s = this.getAvailablePCDWorker();
|
|
27854
27854
|
if (!s)
|
|
27855
27855
|
throw new Error("No available pointcloud worker");
|
|
27856
|
-
const c = async () => new Promise((
|
|
27857
|
-
const
|
|
27858
|
-
|
|
27859
|
-
},
|
|
27856
|
+
const c = async () => new Promise((u) => {
|
|
27857
|
+
const U = (g) => {
|
|
27858
|
+
R(), p(), u(g);
|
|
27859
|
+
}, B = {
|
|
27860
27860
|
...r,
|
|
27861
27861
|
latestDataPoint: !0
|
|
27862
|
-
},
|
|
27862
|
+
}, R = this.subscribeTelemetry(
|
|
27863
27863
|
n,
|
|
27864
|
-
|
|
27865
|
-
(m) => {
|
|
27866
|
-
m !== void 0 && typeof m != "symbol" && B("json");
|
|
27867
|
-
}
|
|
27868
|
-
), g = this.subscribeTelemetry(
|
|
27869
|
-
n,
|
|
27870
|
-
R,
|
|
27864
|
+
B,
|
|
27871
27865
|
"point cloud",
|
|
27872
|
-
async (
|
|
27873
|
-
|
|
27866
|
+
async (g) => {
|
|
27867
|
+
g !== void 0 && typeof g != "symbol" && U("pointcloud");
|
|
27874
27868
|
}
|
|
27875
|
-
),
|
|
27869
|
+
), p = this.subscribeTelemetry(
|
|
27876
27870
|
n,
|
|
27877
|
-
|
|
27871
|
+
B,
|
|
27878
27872
|
"localization",
|
|
27879
|
-
async (
|
|
27880
|
-
|
|
27873
|
+
async (g) => {
|
|
27874
|
+
g !== void 0 && typeof g != "symbol" && U("localization");
|
|
27881
27875
|
}
|
|
27882
27876
|
);
|
|
27883
27877
|
});
|
|
27884
27878
|
let o = () => {
|
|
27885
27879
|
}, d = () => {
|
|
27886
|
-
}, u = () => {
|
|
27887
27880
|
};
|
|
27888
|
-
return c().then((
|
|
27889
|
-
|
|
27890
|
-
n,
|
|
27891
|
-
r,
|
|
27892
|
-
l
|
|
27893
|
-
) : U === "pointcloud" ? d = this.subscribeTelemetry(
|
|
27881
|
+
return c().then((u) => {
|
|
27882
|
+
u === "pointcloud" ? o = this.subscribeTelemetry(
|
|
27894
27883
|
n,
|
|
27895
27884
|
r,
|
|
27896
27885
|
"point cloud",
|
|
27897
|
-
async (
|
|
27898
|
-
if (
|
|
27886
|
+
async (U) => {
|
|
27887
|
+
if (U === "too much data" || U === void 0) {
|
|
27899
27888
|
l(NoData);
|
|
27900
27889
|
return;
|
|
27901
27890
|
}
|
|
27902
|
-
const
|
|
27903
|
-
if (typeof
|
|
27904
|
-
l(JSON.parse(
|
|
27891
|
+
const B = U[U.length - 1][1];
|
|
27892
|
+
if (typeof B == "string")
|
|
27893
|
+
l(JSON.parse(B));
|
|
27905
27894
|
else {
|
|
27906
|
-
const { url:
|
|
27907
|
-
s.postMessage({ url:
|
|
27908
|
-
|
|
27909
|
-
worldToLocal:
|
|
27910
|
-
pcd:
|
|
27895
|
+
const { url: R } = B;
|
|
27896
|
+
s.postMessage({ url: R }), s.onmessage = (p) => {
|
|
27897
|
+
p.data.url === R && l({
|
|
27898
|
+
worldToLocal: B.worldToLocal,
|
|
27899
|
+
pcd: p.data.pcd
|
|
27911
27900
|
});
|
|
27912
27901
|
};
|
|
27913
27902
|
}
|
|
27914
27903
|
}
|
|
27915
|
-
) :
|
|
27904
|
+
) : u === "localization" && (d = this.subscribeTelemetry(
|
|
27916
27905
|
n,
|
|
27917
27906
|
r,
|
|
27918
27907
|
"localization",
|
|
27919
|
-
async (
|
|
27920
|
-
if (
|
|
27908
|
+
async (U) => {
|
|
27909
|
+
if (U === "too much data" || U === void 0) {
|
|
27921
27910
|
l(NoData);
|
|
27922
27911
|
return;
|
|
27923
27912
|
}
|
|
27924
|
-
let
|
|
27925
|
-
if (
|
|
27926
|
-
const { url:
|
|
27927
|
-
s.postMessage({ url:
|
|
27928
|
-
|
|
27929
|
-
worldToLocal:
|
|
27930
|
-
pcd:
|
|
27913
|
+
let B = U[U.length - 1][1];
|
|
27914
|
+
if (B.url && (B = await (await fetch(B.url)).json()), B.pointClouds) {
|
|
27915
|
+
const { url: R, worldToLocal: p } = B.pointClouds[0];
|
|
27916
|
+
s.postMessage({ url: R }), s.onmessage = (g) => {
|
|
27917
|
+
g.data.url === R && l({
|
|
27918
|
+
worldToLocal: p,
|
|
27919
|
+
pcd: g.data.pcd
|
|
27931
27920
|
});
|
|
27932
27921
|
};
|
|
27933
27922
|
}
|
|
27934
27923
|
}
|
|
27935
27924
|
));
|
|
27936
27925
|
}), () => {
|
|
27937
|
-
this.releasePCDWorker(s), o(), d()
|
|
27926
|
+
this.releasePCDWorker(s), o(), d();
|
|
27938
27927
|
};
|
|
27939
27928
|
}
|
|
27940
27929
|
subscribeToOdometry(n, r, l) {
|