@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.
Files changed (62) hide show
  1. package/README.md +3 -19
  2. package/dist/LoginWithAuth0.d.ts.map +1 -1
  3. package/dist/chunk-B2C22PTK.js +53 -0
  4. package/dist/chunk-B2C22PTK.js.map +1 -0
  5. package/dist/{chunk-DOFCSS2H.js → chunk-I3PUV6ZD.js} +2 -2
  6. package/dist/chunk-I3PUV6ZD.js.map +1 -0
  7. package/dist/index.cjs +3 -99
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.js +4 -30
  10. package/dist/index.js.map +1 -1
  11. package/dist/lib/AutoReconnectingWebsocket.d.ts +2 -2
  12. package/dist/lib/AutoReconnectingWebsocket.d.ts.map +1 -1
  13. package/dist/lib/availableStorage.d.ts +1 -1
  14. package/dist/lib/availableStorage.d.ts.map +1 -1
  15. package/dist/lib/converters.d.ts.map +1 -1
  16. package/dist/lib/errorHandling.d.ts.map +1 -1
  17. package/dist/lib/v1/ConnectedMotionGroup.d.ts.map +1 -1
  18. package/dist/lib/v1/JoggerConnection.d.ts.map +1 -1
  19. package/dist/lib/v1/MotionStreamConnection.d.ts +1 -0
  20. package/dist/lib/v1/MotionStreamConnection.d.ts.map +1 -1
  21. package/dist/lib/v1/NovaCellAPIClient.d.ts +2 -0
  22. package/dist/lib/v1/NovaCellAPIClient.d.ts.map +1 -1
  23. package/dist/lib/v1/NovaClient.d.ts.map +1 -1
  24. package/dist/lib/v1/ProgramStateConnection.d.ts +6 -2
  25. package/dist/lib/v1/ProgramStateConnection.d.ts.map +1 -1
  26. package/dist/lib/v1/index.cjs +19 -1036
  27. package/dist/lib/v1/index.cjs.map +1 -1
  28. package/dist/lib/v1/index.js +20 -16
  29. package/dist/lib/v1/index.js.map +1 -1
  30. package/dist/lib/v1/motionStateUpdate.d.ts.map +1 -1
  31. package/dist/lib/v2/NovaCellAPIClient.d.ts +2 -0
  32. package/dist/lib/v2/NovaCellAPIClient.d.ts.map +1 -1
  33. package/dist/lib/v2/NovaClient.d.ts +1 -0
  34. package/dist/lib/v2/NovaClient.d.ts.map +1 -1
  35. package/dist/lib/v2/index.cjs +5 -15
  36. package/dist/lib/v2/index.cjs.map +1 -1
  37. package/dist/lib/v2/index.js +5 -15
  38. package/dist/lib/v2/index.js.map +1 -1
  39. package/dist/lib/v2/mock/MockNovaInstance.d.ts.map +1 -1
  40. package/package.json +11 -8
  41. package/src/LoginWithAuth0.ts +5 -0
  42. package/src/lib/AutoReconnectingWebsocket.ts +2 -2
  43. package/src/lib/availableStorage.ts +1 -1
  44. package/src/lib/converters.ts +1 -0
  45. package/src/lib/errorHandling.ts +2 -3
  46. package/src/lib/v1/ConnectedMotionGroup.ts +2 -0
  47. package/src/lib/v1/JoggerConnection.ts +8 -5
  48. package/src/lib/v1/MotionStreamConnection.ts +2 -1
  49. package/src/lib/v1/NovaCellAPIClient.ts +2 -0
  50. package/src/lib/v1/NovaClient.ts +3 -1
  51. package/src/lib/v1/ProgramStateConnection.ts +9 -6
  52. package/src/lib/v1/mock/MockNovaInstance.ts +5 -5
  53. package/src/lib/v1/motionStateUpdate.ts +1 -0
  54. package/src/lib/v2/NovaCellAPIClient.ts +2 -0
  55. package/src/lib/v2/NovaClient.ts +2 -1
  56. package/src/lib/v2/mock/MockNovaInstance.ts +3 -7
  57. package/dist/chunk-4FP7NTKS.js +0 -1080
  58. package/dist/chunk-4FP7NTKS.js.map +0 -1
  59. package/dist/chunk-DOFCSS2H.js.map +0 -1
  60. package/dist/lib/v2/vectorUtils.d.ts +0 -7
  61. package/dist/lib/v2/vectorUtils.d.ts.map +0 -1
  62. package/src/lib/v2/vectorUtils.ts +0 -36
@@ -1,8 +1,7 @@
1
1
  import {
2
- isEqual_default,
3
2
  isSameCoordinateSystem,
4
3
  tryParseJson
5
- } from "../../chunk-4FP7NTKS.js";
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-DOFCSS2H.js";
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 (Math.abs(newJointValues[jointIndex] - oldJointValues[jointIndex]) > changeDeltaThreshold) {
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(this, null, function* () {
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 (!isEqual_default(this.cartesianJoggingOpts, cartesianJoggingOpts)) {
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["x"],
625
- currentTcpPose.orientation["y"],
626
- currentTcpPose.orientation["z"]
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 == void 0) {
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: -0.7071067811865475,
1786
+ y: -Math.SQRT1_2,
1784
1787
  z: 0,
1785
- w: 0.7071067811865476
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: -0.7071067811865475,
1830
+ x: -Math.SQRT1_2,
1828
1831
  y: 0,
1829
1832
  z: 0,
1830
- w: 0.7071067811865476
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 = "/cells" + ((_c = (_b = config.url) == null ? void 0 : _b.split("/cells")[1]) == null ? void 0 : _c.split("?")[0]);
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 + ":" + config.password)}`;
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
  {