@wandelbots/nova-js 3.0.0 → 3.0.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/README.md +3 -19
- package/dist/LoginWithAuth0.d.ts.map +1 -1
- package/dist/chunk-B2C22PTK.js +53 -0
- package/dist/chunk-B2C22PTK.js.map +1 -0
- package/dist/{chunk-DOFCSS2H.js → chunk-I3PUV6ZD.js} +2 -2
- package/dist/chunk-I3PUV6ZD.js.map +1 -0
- package/dist/index.cjs +3 -99
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -30
- package/dist/index.js.map +1 -1
- package/dist/lib/AutoReconnectingWebsocket.d.ts +2 -2
- package/dist/lib/AutoReconnectingWebsocket.d.ts.map +1 -1
- package/dist/lib/availableStorage.d.ts +1 -1
- package/dist/lib/availableStorage.d.ts.map +1 -1
- package/dist/lib/converters.d.ts.map +1 -1
- package/dist/lib/errorHandling.d.ts.map +1 -1
- package/dist/lib/v1/ConnectedMotionGroup.d.ts.map +1 -1
- package/dist/lib/v1/JoggerConnection.d.ts.map +1 -1
- package/dist/lib/v1/MotionStreamConnection.d.ts +1 -0
- package/dist/lib/v1/MotionStreamConnection.d.ts.map +1 -1
- package/dist/lib/v1/NovaCellAPIClient.d.ts +2 -0
- package/dist/lib/v1/NovaCellAPIClient.d.ts.map +1 -1
- package/dist/lib/v1/NovaClient.d.ts.map +1 -1
- package/dist/lib/v1/ProgramStateConnection.d.ts +6 -2
- package/dist/lib/v1/ProgramStateConnection.d.ts.map +1 -1
- package/dist/lib/v1/index.cjs +19 -1036
- package/dist/lib/v1/index.cjs.map +1 -1
- package/dist/lib/v1/index.js +20 -16
- package/dist/lib/v1/index.js.map +1 -1
- package/dist/lib/v1/motionStateUpdate.d.ts.map +1 -1
- package/dist/lib/v2/NovaCellAPIClient.d.ts +2 -0
- package/dist/lib/v2/NovaCellAPIClient.d.ts.map +1 -1
- package/dist/lib/v2/NovaClient.d.ts +1 -0
- package/dist/lib/v2/NovaClient.d.ts.map +1 -1
- package/dist/lib/v2/index.cjs +5 -15
- package/dist/lib/v2/index.cjs.map +1 -1
- package/dist/lib/v2/index.js +5 -15
- package/dist/lib/v2/index.js.map +1 -1
- package/dist/lib/v2/mock/MockNovaInstance.d.ts.map +1 -1
- package/package.json +11 -8
- package/src/LoginWithAuth0.ts +5 -0
- package/src/lib/AutoReconnectingWebsocket.ts +2 -2
- package/src/lib/availableStorage.ts +1 -1
- package/src/lib/converters.ts +1 -0
- package/src/lib/errorHandling.ts +2 -3
- package/src/lib/v1/ConnectedMotionGroup.ts +2 -0
- package/src/lib/v1/JoggerConnection.ts +8 -5
- package/src/lib/v1/MotionStreamConnection.ts +2 -1
- package/src/lib/v1/NovaCellAPIClient.ts +2 -0
- package/src/lib/v1/NovaClient.ts +3 -1
- package/src/lib/v1/ProgramStateConnection.ts +9 -6
- package/src/lib/v1/mock/MockNovaInstance.ts +5 -5
- package/src/lib/v1/motionStateUpdate.ts +1 -0
- package/src/lib/v2/NovaCellAPIClient.ts +2 -0
- package/src/lib/v2/NovaClient.ts +2 -1
- package/src/lib/v2/mock/MockNovaInstance.ts +3 -7
- package/dist/chunk-4FP7NTKS.js +0 -1080
- package/dist/chunk-4FP7NTKS.js.map +0 -1
- package/dist/chunk-DOFCSS2H.js.map +0 -1
- package/dist/lib/v2/vectorUtils.d.ts +0 -7
- package/dist/lib/v2/vectorUtils.d.ts.map +0 -1
- package/src/lib/v2/vectorUtils.ts +0 -36
package/dist/lib/v1/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
isEqual_default,
|
|
3
2
|
isSameCoordinateSystem,
|
|
4
3
|
tryParseJson
|
|
5
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-B2C22PTK.js";
|
|
6
5
|
import {
|
|
7
6
|
AutoReconnectingWebsocket,
|
|
8
7
|
__async,
|
|
@@ -10,7 +9,7 @@ import {
|
|
|
10
9
|
__spreadValues,
|
|
11
10
|
availableStorage,
|
|
12
11
|
loginWithAuth0
|
|
13
|
-
} from "../../chunk-
|
|
12
|
+
} from "../../chunk-I3PUV6ZD.js";
|
|
14
13
|
|
|
15
14
|
// src/lib/v1/index.ts
|
|
16
15
|
export * from "@wandelbots/nova-api/v1";
|
|
@@ -25,7 +24,10 @@ function jointValuesEqual(oldJointValues, newJointValues, changeDeltaThreshold)
|
|
|
25
24
|
return true;
|
|
26
25
|
}
|
|
27
26
|
for (let jointIndex = 0; jointIndex < newJointValues.length; jointIndex++) {
|
|
28
|
-
if (
|
|
27
|
+
if (
|
|
28
|
+
// biome-ignore lint/style/noNonNullAssertion: legacy code
|
|
29
|
+
Math.abs(newJointValues[jointIndex] - oldJointValues[jointIndex]) > changeDeltaThreshold
|
|
30
|
+
) {
|
|
29
31
|
return false;
|
|
30
32
|
}
|
|
31
33
|
}
|
|
@@ -149,7 +151,7 @@ var ConnectedMotionGroup = class _ConnectedMotionGroup {
|
|
|
149
151
|
controller.controller
|
|
150
152
|
);
|
|
151
153
|
const isVirtual = config.configuration.kind === "VirtualController";
|
|
152
|
-
const mounting = yield (() => __async(
|
|
154
|
+
const mounting = yield (() => __async(null, null, function* () {
|
|
153
155
|
try {
|
|
154
156
|
const mounting2 = yield nova.api.motionGroupInfos.getMounting(
|
|
155
157
|
motionGroup.motion_group
|
|
@@ -188,6 +190,7 @@ var ConnectedMotionGroup = class _ConnectedMotionGroup {
|
|
|
188
190
|
initialMotionState,
|
|
189
191
|
motionStateSocket,
|
|
190
192
|
isVirtual,
|
|
193
|
+
// biome-ignore lint/style/noNonNullAssertion: legacy code
|
|
191
194
|
tcps,
|
|
192
195
|
motionGroupSpecification,
|
|
193
196
|
safetySetup,
|
|
@@ -454,7 +457,7 @@ var JoggerConnection = class _JoggerConnection {
|
|
|
454
457
|
setJoggingMode(mode, cartesianJoggingOpts) {
|
|
455
458
|
console.log("Setting jogging mode to", mode);
|
|
456
459
|
if (cartesianJoggingOpts) {
|
|
457
|
-
if (
|
|
460
|
+
if (JSON.stringify(this.cartesianJoggingOpts) !== JSON.stringify(cartesianJoggingOpts)) {
|
|
458
461
|
if (this.cartesianWebsocket) {
|
|
459
462
|
this.cartesianWebsocket.dispose();
|
|
460
463
|
this.cartesianWebsocket = null;
|
|
@@ -621,9 +624,9 @@ var JoggerConnection = class _JoggerConnection {
|
|
|
621
624
|
});
|
|
622
625
|
} else if (motion.type === "rotate") {
|
|
623
626
|
const currentRotationVector = new Vector32(
|
|
624
|
-
currentTcpPose.orientation
|
|
625
|
-
currentTcpPose.orientation
|
|
626
|
-
currentTcpPose.orientation
|
|
627
|
+
currentTcpPose.orientation.x,
|
|
628
|
+
currentTcpPose.orientation.y,
|
|
629
|
+
currentTcpPose.orientation.z
|
|
627
630
|
);
|
|
628
631
|
const currentRotationRad = currentRotationVector.length();
|
|
629
632
|
const currentRotationDirection = currentRotationVector.clone().normalize();
|
|
@@ -794,7 +797,7 @@ var MotionStreamConnection = class _MotionStreamConnection {
|
|
|
794
797
|
MOTION_DELTA_THRESHOLD2
|
|
795
798
|
)) {
|
|
796
799
|
runInAction2(() => {
|
|
797
|
-
if (this.rapidlyChangingMotionState.tcp_pose ==
|
|
800
|
+
if (this.rapidlyChangingMotionState.tcp_pose == null) {
|
|
798
801
|
this.rapidlyChangingMotionState.tcp_pose = motionStateResponse.tcp_pose;
|
|
799
802
|
} else {
|
|
800
803
|
this.rapidlyChangingMotionState.tcp_pose = {
|
|
@@ -1780,9 +1783,9 @@ var MockNovaInstance = class {
|
|
|
1780
1783
|
},
|
|
1781
1784
|
orientation: {
|
|
1782
1785
|
x: 0,
|
|
1783
|
-
y: -
|
|
1786
|
+
y: -Math.SQRT1_2,
|
|
1784
1787
|
z: 0,
|
|
1785
|
-
w:
|
|
1788
|
+
w: Math.SQRT1_2
|
|
1786
1789
|
}
|
|
1787
1790
|
},
|
|
1788
1791
|
id: "link2_capsule"
|
|
@@ -1824,10 +1827,10 @@ var MockNovaInstance = class {
|
|
|
1824
1827
|
z: 40
|
|
1825
1828
|
},
|
|
1826
1829
|
orientation: {
|
|
1827
|
-
x: -
|
|
1830
|
+
x: -Math.SQRT1_2,
|
|
1828
1831
|
y: 0,
|
|
1829
1832
|
z: 0,
|
|
1830
|
-
w:
|
|
1833
|
+
w: Math.SQRT1_2
|
|
1831
1834
|
}
|
|
1832
1835
|
},
|
|
1833
1836
|
id: "link4_capsule"
|
|
@@ -1927,7 +1930,7 @@ var MockNovaInstance = class {
|
|
|
1927
1930
|
}
|
|
1928
1931
|
];
|
|
1929
1932
|
const method = ((_a = config.method) == null ? void 0 : _a.toUpperCase()) || "GET";
|
|
1930
|
-
const path =
|
|
1933
|
+
const path = `/cells${(_c = (_b = config.url) == null ? void 0 : _b.split("/cells")[1]) == null ? void 0 : _c.split("?")[0]}`;
|
|
1931
1934
|
for (const handler of apiHandlers) {
|
|
1932
1935
|
const match2 = pathToRegexp.match(handler.path)(path || "");
|
|
1933
1936
|
if (method === handler.method && match2) {
|
|
@@ -2304,7 +2307,7 @@ var NovaClient = class {
|
|
|
2304
2307
|
if (this.accessToken) {
|
|
2305
2308
|
request.headers.Authorization = `Bearer ${this.accessToken}`;
|
|
2306
2309
|
} else if (this.config.username && this.config.password) {
|
|
2307
|
-
request.headers.Authorization = `Basic ${btoa(config.username
|
|
2310
|
+
request.headers.Authorization = `Basic ${btoa(`${config.username}:${config.password}`)}`;
|
|
2308
2311
|
}
|
|
2309
2312
|
}
|
|
2310
2313
|
return request;
|
|
@@ -2572,6 +2575,7 @@ ${runnerState.traceback}`
|
|
|
2572
2575
|
{
|
|
2573
2576
|
code: trimmedCode,
|
|
2574
2577
|
initial_state,
|
|
2578
|
+
// @ts-expect-error legacy code - check if param still used
|
|
2575
2579
|
default_robot: activeRobot == null ? void 0 : activeRobot.wandelscriptIdentifier
|
|
2576
2580
|
},
|
|
2577
2581
|
{
|