@wandelbots/nova-js 1.17.1-pr.feat-added-v2-client.64.9ac2247

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 (95) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +202 -0
  3. package/dist/LoginWithAuth0.d.ts +7 -0
  4. package/dist/LoginWithAuth0.d.ts.map +1 -0
  5. package/dist/chunk-V3NJLR6P.js +336 -0
  6. package/dist/chunk-V3NJLR6P.js.map +1 -0
  7. package/dist/index.cjs +390 -0
  8. package/dist/index.cjs.map +1 -0
  9. package/dist/index.d.ts +6 -0
  10. package/dist/index.d.ts.map +1 -0
  11. package/dist/index.js +54 -0
  12. package/dist/index.js.map +1 -0
  13. package/dist/lib/AutoReconnectingWebsocket.d.ts +43 -0
  14. package/dist/lib/AutoReconnectingWebsocket.d.ts.map +1 -0
  15. package/dist/lib/availableStorage.d.ts +15 -0
  16. package/dist/lib/availableStorage.d.ts.map +1 -0
  17. package/dist/lib/converters.d.ts +26 -0
  18. package/dist/lib/converters.d.ts.map +1 -0
  19. package/dist/lib/errorHandling.d.ts +4 -0
  20. package/dist/lib/errorHandling.d.ts.map +1 -0
  21. package/dist/lib/v1/ConnectedMotionGroup.d.ts +77 -0
  22. package/dist/lib/v1/ConnectedMotionGroup.d.ts.map +1 -0
  23. package/dist/lib/v1/JoggerConnection.d.ts +94 -0
  24. package/dist/lib/v1/JoggerConnection.d.ts.map +1 -0
  25. package/dist/lib/v1/MotionStreamConnection.d.ts +25 -0
  26. package/dist/lib/v1/MotionStreamConnection.d.ts.map +1 -0
  27. package/dist/lib/v1/NovaCellAPIClient.d.ts +66 -0
  28. package/dist/lib/v1/NovaCellAPIClient.d.ts.map +1 -0
  29. package/dist/lib/v1/NovaClient.d.ts +67 -0
  30. package/dist/lib/v1/NovaClient.d.ts.map +1 -0
  31. package/dist/lib/v1/ProgramStateConnection.d.ts +53 -0
  32. package/dist/lib/v1/ProgramStateConnection.d.ts.map +1 -0
  33. package/dist/lib/v1/getLatestTrajectories.d.ts +4 -0
  34. package/dist/lib/v1/getLatestTrajectories.d.ts.map +1 -0
  35. package/dist/lib/v1/index.cjs +3957 -0
  36. package/dist/lib/v1/index.cjs.map +1 -0
  37. package/dist/lib/v1/index.d.ts +9 -0
  38. package/dist/lib/v1/index.d.ts.map +1 -0
  39. package/dist/lib/v1/index.js +3662 -0
  40. package/dist/lib/v1/index.js.map +1 -0
  41. package/dist/lib/v1/mock/MockNovaInstance.d.ts +13 -0
  42. package/dist/lib/v1/mock/MockNovaInstance.d.ts.map +1 -0
  43. package/dist/lib/v1/motionStateUpdate.d.ts +4 -0
  44. package/dist/lib/v1/motionStateUpdate.d.ts.map +1 -0
  45. package/dist/lib/v2/ConnectedMotionGroup.d.ts +41 -0
  46. package/dist/lib/v2/ConnectedMotionGroup.d.ts.map +1 -0
  47. package/dist/lib/v2/JoggerConnection.d.ts +53 -0
  48. package/dist/lib/v2/JoggerConnection.d.ts.map +1 -0
  49. package/dist/lib/v2/MotionStreamConnection.d.ts +25 -0
  50. package/dist/lib/v2/MotionStreamConnection.d.ts.map +1 -0
  51. package/dist/lib/v2/NovaCellAPIClient.d.ts +64 -0
  52. package/dist/lib/v2/NovaCellAPIClient.d.ts.map +1 -0
  53. package/dist/lib/v2/NovaClient.d.ts +67 -0
  54. package/dist/lib/v2/NovaClient.d.ts.map +1 -0
  55. package/dist/lib/v2/ProgramStateConnection.d.ts +53 -0
  56. package/dist/lib/v2/ProgramStateConnection.d.ts.map +1 -0
  57. package/dist/lib/v2/index.cjs +2239 -0
  58. package/dist/lib/v2/index.cjs.map +1 -0
  59. package/dist/lib/v2/index.d.ts +8 -0
  60. package/dist/lib/v2/index.d.ts.map +1 -0
  61. package/dist/lib/v2/index.js +1947 -0
  62. package/dist/lib/v2/index.js.map +1 -0
  63. package/dist/lib/v2/mock/MockNovaInstance.d.ts +13 -0
  64. package/dist/lib/v2/mock/MockNovaInstance.d.ts.map +1 -0
  65. package/dist/lib/v2/motionStateUpdate.d.ts +4 -0
  66. package/dist/lib/v2/motionStateUpdate.d.ts.map +1 -0
  67. package/dist/lib/v2/vectorUtils.d.ts +7 -0
  68. package/dist/lib/v2/vectorUtils.d.ts.map +1 -0
  69. package/package.json +67 -0
  70. package/src/LoginWithAuth0.ts +90 -0
  71. package/src/index.ts +5 -0
  72. package/src/lib/AutoReconnectingWebsocket.ts +163 -0
  73. package/src/lib/availableStorage.ts +46 -0
  74. package/src/lib/converters.ts +74 -0
  75. package/src/lib/errorHandling.ts +26 -0
  76. package/src/lib/v1/ConnectedMotionGroup.ts +419 -0
  77. package/src/lib/v1/JoggerConnection.ts +480 -0
  78. package/src/lib/v1/MotionStreamConnection.ts +202 -0
  79. package/src/lib/v1/NovaCellAPIClient.ts +180 -0
  80. package/src/lib/v1/NovaClient.ts +232 -0
  81. package/src/lib/v1/ProgramStateConnection.ts +267 -0
  82. package/src/lib/v1/getLatestTrajectories.ts +36 -0
  83. package/src/lib/v1/index.ts +8 -0
  84. package/src/lib/v1/mock/MockNovaInstance.ts +1302 -0
  85. package/src/lib/v1/motionStateUpdate.ts +55 -0
  86. package/src/lib/v2/ConnectedMotionGroup.ts +216 -0
  87. package/src/lib/v2/JoggerConnection.ts +207 -0
  88. package/src/lib/v2/MotionStreamConnection.ts +201 -0
  89. package/src/lib/v2/NovaCellAPIClient.ts +174 -0
  90. package/src/lib/v2/NovaClient.ts +230 -0
  91. package/src/lib/v2/ProgramStateConnection.ts +255 -0
  92. package/src/lib/v2/index.ts +7 -0
  93. package/src/lib/v2/mock/MockNovaInstance.ts +982 -0
  94. package/src/lib/v2/motionStateUpdate.ts +55 -0
  95. package/src/lib/v2/vectorUtils.ts +36 -0
@@ -0,0 +1,4 @@
1
+ import type { TcpPose } from "@wandelbots/nova-api/v1";
2
+ export declare function jointValuesEqual(oldJointValues: number[], newJointValues: number[], changeDeltaThreshold: number): boolean;
3
+ export declare function tcpPoseEqual(oldTcp: TcpPose | undefined, newTcp: TcpPose | undefined, changeDeltaThreshold: number): boolean;
4
+ //# sourceMappingURL=motionStateUpdate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"motionStateUpdate.d.ts","sourceRoot":"","sources":["../../../src/lib/v1/motionStateUpdate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEtD,wBAAgB,gBAAgB,CAC9B,cAAc,EAAE,MAAM,EAAE,EACxB,cAAc,EAAE,MAAM,EAAE,EACxB,oBAAoB,EAAE,MAAM,GAC3B,OAAO,CAeT;AAED,wBAAgB,YAAY,CAC1B,MAAM,EAAE,OAAO,GAAG,SAAS,EAC3B,MAAM,EAAE,OAAO,GAAG,SAAS,EAC3B,oBAAoB,EAAE,MAAM,GAC3B,OAAO,CA2BT"}
@@ -0,0 +1,41 @@
1
+ import type { Controller, MotionGroupPhysical, MotionGroupSpecification, MotionGroupState, RobotTcp, SafetySetup } from "@wandelbots/nova-api/v2";
2
+ import type { AutoReconnectingWebsocket } from "../AutoReconnectingWebsocket";
3
+ import type { NovaClient } from "./NovaClient";
4
+ export type MotionGroupOption = {
5
+ selectionId: string;
6
+ } & MotionGroupPhysical;
7
+ /**
8
+ * Store representing the current state of a connected motion group.
9
+ */
10
+ export declare class ConnectedMotionGroup {
11
+ readonly nova: NovaClient;
12
+ readonly controller: Controller;
13
+ readonly motionGroup: MotionGroupPhysical;
14
+ readonly initialMotionState: MotionGroupState;
15
+ readonly motionStateSocket: AutoReconnectingWebsocket;
16
+ readonly isVirtual: boolean;
17
+ readonly tcps: RobotTcp[];
18
+ readonly motionGroupSpecification: MotionGroupSpecification;
19
+ readonly safetySetup: SafetySetup;
20
+ static connect(nova: NovaClient, motionGroupId: string, controllers: Controller[]): Promise<ConnectedMotionGroup>;
21
+ connectedJoggingCartesianSocket: WebSocket | null;
22
+ connectedJoggingJointsSocket: WebSocket | null;
23
+ planData: any | null;
24
+ joggingVelocity: number;
25
+ rapidlyChangingMotionState: MotionGroupState;
26
+ constructor(nova: NovaClient, controller: Controller, motionGroup: MotionGroupPhysical, initialMotionState: MotionGroupState, motionStateSocket: AutoReconnectingWebsocket, isVirtual: boolean, tcps: RobotTcp[], motionGroupSpecification: MotionGroupSpecification, safetySetup: SafetySetup);
27
+ get motionGroupId(): string;
28
+ get controllerId(): string;
29
+ get modelFromController(): string | undefined;
30
+ get wandelscriptIdentifier(): string;
31
+ /** Jogging velocity in radians for rotation and joint movement */
32
+ get joggingVelocityRads(): number;
33
+ get joints(): {
34
+ index: number;
35
+ }[];
36
+ get dhParameters(): import("@wandelbots/nova-api/v2").DHParameter[] | undefined;
37
+ get safetyZones(): import("@wandelbots/nova-api/v2").SafetySetupSafetyZone[] | undefined;
38
+ dispose(): void;
39
+ setJoggingVelocity(velocity: number): void;
40
+ }
41
+ //# sourceMappingURL=ConnectedMotionGroup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConnectedMotionGroup.d.ts","sourceRoot":"","sources":["../../../src/lib/v2/ConnectedMotionGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,mBAAmB,EACnB,wBAAwB,EACxB,gBAAgB,EAChB,QAAQ,EACR,WAAW,EACZ,MAAM,yBAAyB,CAAA;AAGhC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAA;AAG7E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAI9C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,WAAW,EAAE,MAAM,CAAA;CACpB,GAAG,mBAAmB,CAAA;AAEvB;;GAEG;AACH,qBAAa,oBAAoB;IAyF7B,QAAQ,CAAC,IAAI,EAAE,UAAU;IACzB,QAAQ,CAAC,UAAU,EAAE,UAAU;IAC/B,QAAQ,CAAC,WAAW,EAAE,mBAAmB;IACzC,QAAQ,CAAC,kBAAkB,EAAE,gBAAgB;IAC7C,QAAQ,CAAC,iBAAiB,EAAE,yBAAyB;IACrD,QAAQ,CAAC,SAAS,EAAE,OAAO;IAC3B,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE;IACzB,QAAQ,CAAC,wBAAwB,EAAE,wBAAwB;IAC3D,QAAQ,CAAC,WAAW,EAAE,WAAW;WAhGtB,OAAO,CAClB,IAAI,EAAE,UAAU,EAChB,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,UAAU,EAAE;IA2E3B,+BAA+B,EAAE,SAAS,GAAG,IAAI,CAAO;IACxD,4BAA4B,EAAE,SAAS,GAAG,IAAI,CAAO;IACrD,QAAQ,EAAE,GAAG,GAAG,IAAI,CAAA;IACpB,eAAe,EAAE,MAAM,CAAK;IAI5B,0BAA0B,EAAE,gBAAgB,CAAA;gBAGjC,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,mBAAmB,EAChC,kBAAkB,EAAE,gBAAgB,EACpC,iBAAiB,EAAE,yBAAyB,EAC5C,SAAS,EAAE,OAAO,EAClB,IAAI,EAAE,QAAQ,EAAE,EAChB,wBAAwB,EAAE,wBAAwB,EAClD,WAAW,EAAE,WAAW;IA6CnC,IAAI,aAAa,WAEhB;IAED,IAAI,YAAY,WAEf;IAED,IAAI,mBAAmB,uBAEtB;IAED,IAAI,sBAAsB,WAGzB;IAED,kEAAkE;IAClE,IAAI,mBAAmB,WAEtB;IAED,IAAI,MAAM;;QAMT;IAED,IAAI,YAAY,gEAEf;IAED,IAAI,WAAW,0EAEd;IAED,OAAO;IAQP,kBAAkB,CAAC,QAAQ,EAAE,MAAM;CAGpC"}
@@ -0,0 +1,53 @@
1
+ import type { InitializeJoggingRequest, JoggingResponse, JointVelocityRequest, MotionGroupState, TcpVelocityRequest } from "@wandelbots/nova-api/v2";
2
+ import type { AutoReconnectingWebsocket } from "../AutoReconnectingWebsocket";
3
+ import type { NovaClient } from "./NovaClient";
4
+ export type JoggerConnectionOpts = {
5
+ /**
6
+ * When an error message is received from the jogging websocket, it
7
+ * will be passed here. If this handler is not provided, the error will
8
+ * instead be thrown as an unhandled error.
9
+ */
10
+ onError?: (err: unknown) => void;
11
+ } & Omit<InitializeJoggingRequest, "message_type">;
12
+ export declare class JoggerConnection {
13
+ readonly nova: NovaClient;
14
+ readonly cell: string;
15
+ readonly motionGroupId: string;
16
+ readonly motionGroupState: MotionGroupState;
17
+ readonly opts: JoggerConnectionOpts;
18
+ joggingWebsocket: AutoReconnectingWebsocket | null;
19
+ lastVelocityRequest: JointVelocityRequest | TcpVelocityRequest | null;
20
+ lastResponse: JoggingResponse | null;
21
+ static open(nova: NovaClient, cell: string, motionGroupId: string, opts: JoggerConnectionOpts): Promise<JoggerConnection>;
22
+ constructor(nova: NovaClient, cell: string, motionGroupId: string, motionGroupState: MotionGroupState, opts: JoggerConnectionOpts);
23
+ get jointCount(): number | undefined;
24
+ get activeWebsocket(): AutoReconnectingWebsocket | null;
25
+ stop(): Promise<void>;
26
+ dispose(): void;
27
+ /**
28
+ * Start rotation of a single robot joint at the specified velocity
29
+ */
30
+ startJointRotation({ joint, velocityRadsPerSec, }: {
31
+ /** Index of the joint to rotate */
32
+ joint: number;
33
+ /** Speed of the rotation in radians per second */
34
+ velocityRadsPerSec: number;
35
+ }): Promise<void>;
36
+ /**
37
+ * Start the TCP moving along a specified axis at a given velocity
38
+ */
39
+ startTCPTranslation({ axis, velocityMmPerSec, useToolCoordinateSystem, }: {
40
+ axis: "x" | "y" | "z";
41
+ velocityMmPerSec: number;
42
+ useToolCoordinateSystem: boolean;
43
+ }): Promise<void>;
44
+ /**
45
+ * Start the TCP rotating around a specified axis at a given velocity
46
+ */
47
+ startTCPRotation({ axis, velocityRadsPerSec, useToolCoordinateSystem, }: {
48
+ axis: "x" | "y" | "z";
49
+ velocityRadsPerSec: number;
50
+ useToolCoordinateSystem: boolean;
51
+ }): Promise<void>;
52
+ }
53
+ //# sourceMappingURL=JoggerConnection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JoggerConnection.d.ts","sourceR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K,EAAE,MAAM,CAAA;QACb,kDAAkD;QAClD,kBAAkB,EAAE,MAAM,CAAA;KAC3B;IAkBD;;OAEG;IACG,mBAAmB,CAAC,EACxB,IAAI,EACJ,gBAAgB,EAChB,uBAAuB,GACxB,EAAE;QACD,IAAI,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,CAAA;QACrB,gBAAgB,EAAE,MAAM,CAAA;QACxB,uBAAuB,EAAE,OAAO,CAAA;KACjC;IAmBD;;OAEG;IACG,gBAAgB,CAAC,EACrB,IAAI,EACJ,kBAAkB,EAClB,uBAAuB,GACxB,EAAE;QACD,IAAI,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,CAAA;QACrB,kBAAkB,EAAE,MAAM,CAAA;QAC1B,uBAAuB,EAAE,OAAO,CAAA;KACjC;CAiBF"}
@@ -0,0 +1,25 @@
1
+ import type { Controller, MotionGroupPhysical, MotionGroupState } from "@wandelbots/nova-api/v2";
2
+ import type { AutoReconnectingWebsocket } from "../AutoReconnectingWebsocket";
3
+ import type { NovaClient } from "./NovaClient";
4
+ /**
5
+ * Store representing the current state of a connected motion group.
6
+ */
7
+ export declare class MotionStreamConnection {
8
+ readonly nova: NovaClient;
9
+ readonly controller: Controller;
10
+ readonly motionGroup: MotionGroupPhysical;
11
+ readonly initialMotionState: MotionGroupState;
12
+ readonly motionStateSocket: AutoReconnectingWebsocket;
13
+ static open(nova: NovaClient, motionGroupId: string): Promise<MotionStreamConnection>;
14
+ rapidlyChangingMotionState: MotionGroupState;
15
+ constructor(nova: NovaClient, controller: Controller, motionGroup: MotionGroupPhysical, initialMotionState: MotionGroupState, motionStateSocket: AutoReconnectingWebsocket);
16
+ get motionGroupId(): string;
17
+ get controllerId(): string;
18
+ get modelFromController(): string | undefined;
19
+ get wandelscriptIdentifier(): string;
20
+ get joints(): {
21
+ index: number;
22
+ }[];
23
+ dispose(): void;
24
+ }
25
+ //# sourceMappingURL=MotionStreamConnection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MotionStreamConnection.d.ts","sourceRoot":"","sources":["../../../src/lib/v2/MotionStreamConnection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,yBAAyB,CAAA;AAGhC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAA;AAG7E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AA4C9C;;GAEG;AACH,qBAAa,sBAAsB;IAsD/B,QAAQ,CAAC,IAAI,EAAE,UAAU;IACzB,QAAQ,CAAC,UAAU,EAAE,UAAU;IAC/B,QAAQ,CAAC,WAAW,EAAE,mBAAmB;IACzC,QAAQ,CAAC,kBAAkB,EAAE,gBAAgB;IAC7C,QAAQ,CAAC,iBAAiB,EAAE,yBAAyB;WAzD1C,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM;IAkDzD,0BAA0B,EAAE,gBAAgB,CAAA;gBAGjC,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,mBAAmB,EAChC,kBAAkB,EAAE,gBAAgB,EACpC,iBAAiB,EAAE,yBAAyB;IAyDvD,IAAI,aAAa,WAEhB;IAED,IAAI,YAAY,WAEf;IAED,IAAI,mBAAmB,uBAEtB;IAED,IAAI,sBAAsB,WAGzB;IAED,IAAI,MAAM;;QAMT;IAED,OAAO;CAGR"}
@@ -0,0 +1,64 @@
1
+ import type { Configuration as BaseConfiguration } from "@wandelbots/nova-api/v2";
2
+ import { ApplicationApi, CellApi, ControllerApi, ControllerInputsOutputsApi, CoordinateSystemsApi, JoggingApi, MotionGroupApi, MotionGroupInfoApi, MotionGroupKinematicsApi, ProgramApi, ProgramLibraryApi, ProgramLibraryMetadataApi, ProgramOperatorApi, StoreCollisionComponentsApi, StoreCollisionScenesApi, StoreObjectApi, SystemApi, TrajectoryExecutionApi, TrajectoryPlanningApi, VirtualRobotApi, VirtualRobotBehaviorApi, VirtualRobotModeApi, VirtualRobotSetupApi } from "@wandelbots/nova-api/v2";
3
+ import type { AxiosInstance } from "axios";
4
+ type OmitFirstArg<F> = F extends (x: any, ...args: infer P) => infer R ? (...args: P) => R : never;
5
+ type UnwrapAxiosResponseReturn<T> = T extends (...a: any) => any ? (...a: Parameters<T>) => Promise<Awaited<ReturnType<T>> extends {
6
+ data: infer D;
7
+ } ? D : never> : never;
8
+ export type WithCellId<T> = {
9
+ [P in keyof T]: UnwrapAxiosResponseReturn<OmitFirstArg<T[P]>>;
10
+ };
11
+ export type WithUnwrappedAxiosResponse<T> = {
12
+ [P in keyof T]: UnwrapAxiosResponseReturn<T[P]>;
13
+ };
14
+ /**
15
+ * API client providing type-safe access to all the Nova API REST endpoints
16
+ * associated with a specific cell id.
17
+ */
18
+ export declare class NovaCellAPIClient {
19
+ readonly cellId: string;
20
+ readonly opts: BaseConfiguration & {
21
+ axiosInstance?: AxiosInstance;
22
+ mock?: boolean;
23
+ };
24
+ constructor(cellId: string, opts: BaseConfiguration & {
25
+ axiosInstance?: AxiosInstance;
26
+ mock?: boolean;
27
+ });
28
+ /**
29
+ * Some TypeScript sorcery which alters the API class methods so you don't
30
+ * have to pass the cell id to every single one, and de-encapsulates the
31
+ * response data
32
+ */
33
+ private withCellId;
34
+ /**
35
+ * As withCellId, but only does the response unwrapping
36
+ */
37
+ private withUnwrappedResponsesOnly;
38
+ readonly system: WithUnwrappedAxiosResponse<SystemApi>;
39
+ readonly cell: WithUnwrappedAxiosResponse<CellApi>;
40
+ readonly motionGroup: WithCellId<MotionGroupApi>;
41
+ readonly motionGroupInfos: WithCellId<MotionGroupInfoApi>;
42
+ readonly controller: WithCellId<ControllerApi>;
43
+ readonly program: WithCellId<ProgramApi>;
44
+ readonly programOperator: WithCellId<ProgramOperatorApi>;
45
+ readonly programLibraryMetadata: WithCellId<ProgramLibraryMetadataApi>;
46
+ readonly programLibrary: WithCellId<ProgramLibraryApi>;
47
+ readonly controllerIOs: WithCellId<ControllerInputsOutputsApi>;
48
+ readonly motionGroupKinematic: WithCellId<MotionGroupKinematicsApi>;
49
+ readonly trajectoryPlanning: WithCellId<TrajectoryPlanningApi>;
50
+ readonly trajectoryExecution: WithCellId<TrajectoryExecutionApi>;
51
+ readonly coordinateSystems: WithCellId<CoordinateSystemsApi>;
52
+ readonly application: WithCellId<ApplicationApi>;
53
+ readonly applicationGlobal: WithUnwrappedAxiosResponse<ApplicationApi>;
54
+ readonly jogging: WithCellId<JoggingApi>;
55
+ readonly virtualRobot: WithCellId<VirtualRobotApi>;
56
+ readonly virtualRobotSetup: WithCellId<VirtualRobotSetupApi>;
57
+ readonly virtualRobotMode: WithCellId<VirtualRobotModeApi>;
58
+ readonly virtualRobotBehavior: WithCellId<VirtualRobotBehaviorApi>;
59
+ readonly storeObject: WithCellId<StoreObjectApi>;
60
+ readonly storeCollisionComponents: WithCellId<StoreCollisionComponentsApi>;
61
+ readonly storeCollisionScenes: WithCellId<StoreCollisionScenesApi>;
62
+ }
63
+ export {};
64
+ //# sourceMappingURL=NovaCellAPIClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NovaCellAPIClient.d.ts","sourceRoot":"","sources":["../../../src/lib/v2/NovaCellAPIClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AACjF,OAAO,EACL,cAAc,EACd,OAAO,EACP,aAAa,EACb,0BAA0B,EAC1B,oBAAoB,EACpB,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,wBAAwB,EACxB,UAAU,EACV,iBAAiB,EACjB,yBAAyB,EACzB,kBAAkB,EAClB,2BAA2B,EAC3B,uBAAuB,EACvB,cAAc,EACd,SAAS,EACT,sBAAsB,EACtB,qBAAqB,EACrB,eAAe,EACf,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,yBAAyB,CAAA;AAEhC,OAAO,KAAK,EAAE,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,QAAQ,CAAC,MAAM,wCAA6C;IAC5D,QAAQ,CAAC,IAAI,sCAA2C;IAExD,QAAQ,CAAC,WAAW,6BAAkC;IACtD,QAAQ,CAAC,gBAAgB,iCAAsC;IAE/D,QAAQ,CAAC,UAAU,4BAAiC;IAEpD,QAAQ,CAAC,OAAO,yBAA8B;IAC9C,QAAQ,CAAC,eAAe,iCAAsC;IAC9D,QAAQ,CAAC,sBAAsB,wCAA6C;IAC5E,QAAQ,CAAC,cAAc,gCAAqC;IAE5D,QAAQ,CAAC,aAAa,yCAA8C;IAEpE,QAAQ,CAAC,oBAAoB,uCAA4C;IACzE,QAAQ,CAAC,kBAAkB,oCAAyC;IACpE,QAAQ,CAAC,mBAAmB,qCAA0C;IAEtE,QAAQ,CAAC,iBAAiB,mCAAwC;IAElE,QAAQ,CAAC,WAAW,6BAAkC;IACtD,QAAQ,CAAC,iBAAiB,6CAAkD;IAE5E,QAAQ,CAAC,OAAO,yBAA8B;IAE9C,QAAQ,CAAC,YAAY,8BAAmC;IACxD,QAAQ,CAAC,iBAAiB,mCAAwC;IAClE,QAAQ,CAAC,gBAAgB,kCAAuC;IAChE,QAAQ,CAAC,oBAAoB,sCAA2C;IAExE,QAAQ,CAAC,WAAW,6BAAkC;IACtD,QAAQ,CAAC,wBAAwB,0CAEhC;IACD,QAAQ,CAAC,oBAAoB,sCAA2C;CACzE"}
@@ -0,0 +1,67 @@
1
+ import type { Configuration as BaseConfiguration } from "@wandelbots/nova-api/v2";
2
+ import { AutoReconnectingWebsocket } from "../AutoReconnectingWebsocket";
3
+ import { ConnectedMotionGroup } from "./ConnectedMotionGroup";
4
+ import { MockNovaInstance } from "./mock/MockNovaInstance";
5
+ import { MotionStreamConnection } from "./MotionStreamConnection";
6
+ import { NovaCellAPIClient } from "./NovaCellAPIClient";
7
+ export type NovaClientConfig = {
8
+ /**
9
+ * Url of the deployed Nova instance to connect to
10
+ * e.g. https://saeattii.instance.wandelbots.io
11
+ */
12
+ instanceUrl: string | "https://mock.example.com";
13
+ /**
14
+ * Identifier of the cell on the Nova instance to connect this client to.
15
+ * If omitted, the default identifier "cell" is used.
16
+ **/
17
+ cellId?: string;
18
+ /**
19
+ * Username for basic auth to the Nova instance.
20
+ * @deprecated use accessToken instead
21
+ */
22
+ username?: string;
23
+ /**
24
+ * Password for basic auth to the Nova instance.
25
+ * @deprecated use accessToken instead
26
+ */
27
+ password?: string;
28
+ /**
29
+ * Access token for Bearer authentication.
30
+ */
31
+ accessToken?: string;
32
+ } & Omit<BaseConfiguration, "isJsonMime" | "basePath">;
33
+ type NovaClientConfigWithDefaults = NovaClientConfig & {
34
+ cellId: string;
35
+ };
36
+ /**
37
+ * EXPERIMENTAL
38
+ *
39
+ * This client provides a starting point to migrate NOVA api v2.
40
+ * As v2 is still in development, this client has to be considered unstable
41
+ *
42
+ * Client for connecting to a Nova instance and controlling robots.
43
+ */
44
+ export declare class NovaClient {
45
+ readonly api: NovaCellAPIClient;
46
+ readonly config: NovaClientConfigWithDefaults;
47
+ readonly mock?: MockNovaInstance;
48
+ authPromise: Promise<string | null> | null;
49
+ accessToken: string | null;
50
+ constructor(config: NovaClientConfig);
51
+ renewAuthentication(): Promise<void>;
52
+ makeWebsocketURL(path: string): string;
53
+ /**
54
+ * Retrieve an AutoReconnectingWebsocket to the given path on the Nova instance.
55
+ * If you explicitly want to reconnect an existing websocket, call `reconnect`
56
+ * on the returned object.
57
+ */
58
+ openReconnectingWebsocket(path: string): AutoReconnectingWebsocket;
59
+ /**
60
+ * Connect to the motion state websocket(s) for a given motion group
61
+ */
62
+ connectMotionStream(motionGroupId: string): Promise<MotionStreamConnection>;
63
+ connectMotionGroups(motionGroupIds: string[]): Promise<ConnectedMotionGroup[]>;
64
+ connectMotionGroup(motionGroupId: string): Promise<ConnectedMotionGroup>;
65
+ }
66
+ export {};
67
+ //# sourceMappingURL=NovaClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NovaClient.d.ts","sourceRoot":"","sources":["../../../src/lib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GAAG,MAAM;IAwBtC;;;;OAIG;IACH,yBAAyB,CAAC,IAAI,EAAE,MAAM;IAMtC;;OAEG;IACG,mBAAmB,CAAC,aAAa,EAAE,MAAM;IAIzC,mBAAmB,CACvB,cAAc,EAAE,MAAM,EAAE,GACvB,OAAO,CAAC,oBAAoB,EAAE,CAAC;IAU5B,kBAAkB,CACtB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,oBAAoB,CAAC;CAIjC"}
@@ -0,0 +1,53 @@
1
+ import { AutoReconnectingWebsocket } from "../AutoReconnectingWebsocket";
2
+ import type { MotionStreamConnection } from "./MotionStreamConnection";
3
+ import type { NovaClient } from "./NovaClient";
4
+ export type ProgramRunnerLogEntry = {
5
+ timestamp: number;
6
+ message: string;
7
+ level?: "warn" | "error";
8
+ };
9
+ export declare enum ProgramState {
10
+ NotStarted = "not started",
11
+ Running = "running",
12
+ Stopped = "stopped",
13
+ Failed = "failed",
14
+ Completed = "completed"
15
+ }
16
+ export type CurrentProgram = {
17
+ id?: string;
18
+ wandelscript?: string;
19
+ state?: ProgramState;
20
+ };
21
+ type ProgramStateMessage = {
22
+ type: string;
23
+ runner: {
24
+ id: string;
25
+ state: ProgramState;
26
+ start_time?: number | null;
27
+ execution_time?: number | null;
28
+ };
29
+ };
30
+ /**
31
+ * Interface for running Wandelscript programs on the Nova instance and
32
+ * tracking their progress and output
33
+ */
34
+ export declare class ProgramStateConnection {
35
+ readonly nova: NovaClient;
36
+ currentProgram: CurrentProgram;
37
+ logs: ProgramRunnerLogEntry[];
38
+ executionState: "idle" | "starting" | "executing" | "stopping";
39
+ currentlyExecutingProgramRunnerId: string | null;
40
+ programStateSocket: AutoReconnectingWebsocket;
41
+ constructor(nova: NovaClient);
42
+ /** Handle a program state update from the backend */
43
+ handleProgramStateMessage(msg: ProgramStateMessage): Promise<void>;
44
+ /** Call when a program is no longer executing */
45
+ gotoIdleState(): void;
46
+ executeProgram(wandelscript: string, initial_state?: Object, activeRobot?: MotionStreamConnection): Promise<void>;
47
+ stopProgram(): Promise<void>;
48
+ reset(): void;
49
+ log(message: string): void;
50
+ logError(message: string): void;
51
+ }
52
+ export {};
53
+ //# sourceMappingURL=ProgramStateConnection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProgramStateConnection.d.ts","sourceRoot":"","sources":["../../../src/lib/v2/ProgramStateConnection.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAA;AAExE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAE9C,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACzB,CAAA;AAED,oBAAY,YAAY;IACtB,UAAU,gBAAgB;IAC1B,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,SAAS,cAAc;CACxB;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,KAAK,CAAC,EAAE,YAAY,CAAA;CACrB,CAAA;AAED,KAAK,mBAAmB,GAAG;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE;QACN,EAAE,EAAE,MAAM,CAAA;QACV,KAAK,EAAE,YAAY,CAAA;QACnB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;QAC1B,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAC/B,CAAA;CACF,CAAA;AAED;;;GAGG;AACH,qBAAa,sBAAsB;IASrB,QAAQ,CAAC,IAAI,EAAE,UAAU;IARrC,cAAc,EAAE,cAAc,CAAK;IACnC,IAAI,EAAE,qBAAqB,EAAE,CAAK;IAElC,cAAc,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