@wandelbots/nova-js 2.0.2 → 2.1.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/README.md +7 -1
- package/dist/lib/v1/NovaClient.d.ts.map +1 -1
- package/dist/lib/v1/index.cjs +6 -2
- package/dist/lib/v1/index.cjs.map +1 -1
- package/dist/lib/v1/index.js +6 -2
- package/dist/lib/v1/index.js.map +1 -1
- package/dist/lib/v2/NovaCellAPIClient.d.ts +1 -3
- package/dist/lib/v2/NovaCellAPIClient.d.ts.map +1 -1
- package/dist/lib/v2/NovaClient.d.ts.map +1 -1
- package/dist/lib/v2/ProgramStateConnection.d.ts.map +1 -1
- package/dist/lib/v2/index.cjs +9 -14
- package/dist/lib/v2/index.cjs.map +1 -1
- package/dist/lib/v2/index.js +9 -16
- package/dist/lib/v2/index.js.map +1 -1
- package/package.json +2 -2
- package/src/lib/v1/NovaClient.ts +3 -0
- package/src/lib/v1/mock/MockNovaInstance.ts +1 -0
- package/src/lib/v2/NovaCellAPIClient.ts +0 -4
- package/src/lib/v2/NovaClient.ts +3 -0
- package/src/lib/v2/ProgramStateConnection.ts +5 -11
package/dist/lib/v2/index.js
CHANGED
|
@@ -519,8 +519,6 @@ import {
|
|
|
519
519
|
MotionGroupInfoApi,
|
|
520
520
|
MotionGroupKinematicsApi,
|
|
521
521
|
ProgramApi,
|
|
522
|
-
ProgramLibraryApi,
|
|
523
|
-
ProgramLibraryMetadataApi,
|
|
524
522
|
ProgramOperatorApi,
|
|
525
523
|
StoreCollisionComponentsApi,
|
|
526
524
|
StoreCollisionScenesApi,
|
|
@@ -545,8 +543,6 @@ var NovaCellAPIClient = class {
|
|
|
545
543
|
this.controller = this.withCellId(ControllerApi);
|
|
546
544
|
this.program = this.withCellId(ProgramApi);
|
|
547
545
|
this.programOperator = this.withCellId(ProgramOperatorApi);
|
|
548
|
-
this.programLibraryMetadata = this.withCellId(ProgramLibraryMetadataApi);
|
|
549
|
-
this.programLibrary = this.withCellId(ProgramLibraryApi);
|
|
550
546
|
this.controllerIOs = this.withCellId(ControllerInputsOutputsApi);
|
|
551
547
|
this.motionGroupKinematic = this.withCellId(MotionGroupKinematicsApi);
|
|
552
548
|
this.trajectoryPlanning = this.withCellId(TrajectoryPlanningApi);
|
|
@@ -1613,7 +1609,10 @@ var NovaClient = class {
|
|
|
1613
1609
|
this.mock = new MockNovaInstance();
|
|
1614
1610
|
}
|
|
1615
1611
|
const axiosInstance = axios2.create({
|
|
1616
|
-
baseURL: urlJoin(this.config.instanceUrl, "/api/v2")
|
|
1612
|
+
baseURL: urlJoin(this.config.instanceUrl, "/api/v2"),
|
|
1613
|
+
headers: {
|
|
1614
|
+
"User-Agent": `Wandelbots-Nova-JS-SDK`
|
|
1615
|
+
}
|
|
1617
1616
|
});
|
|
1618
1617
|
axiosInstance.interceptors.request.use((request) => __async(this, null, function* () {
|
|
1619
1618
|
if (!request.headers.Authorization) {
|
|
@@ -1780,9 +1779,7 @@ var ProgramStateConnection = class {
|
|
|
1780
1779
|
if (runner.id !== this.currentlyExecutingProgramRunnerId) return;
|
|
1781
1780
|
if (runner.state === "failed" /* Failed */) {
|
|
1782
1781
|
try {
|
|
1783
|
-
const runnerState = yield this.nova.api.program.
|
|
1784
|
-
runner.id
|
|
1785
|
-
);
|
|
1782
|
+
const runnerState = yield this.nova.api.program.getProgramRun(runner.id);
|
|
1786
1783
|
const stdout = runnerState.stdout;
|
|
1787
1784
|
if (stdout) {
|
|
1788
1785
|
this.log(stdout);
|
|
@@ -1800,9 +1797,7 @@ ${runnerState.traceback}`
|
|
|
1800
1797
|
this.gotoIdleState();
|
|
1801
1798
|
} else if (runner.state === "stopped" /* Stopped */) {
|
|
1802
1799
|
try {
|
|
1803
|
-
const runnerState = yield this.nova.api.program.
|
|
1804
|
-
runner.id
|
|
1805
|
-
);
|
|
1800
|
+
const runnerState = yield this.nova.api.program.getProgramRun(runner.id);
|
|
1806
1801
|
const stdout = runnerState.stdout;
|
|
1807
1802
|
if (stdout) {
|
|
1808
1803
|
this.log(stdout);
|
|
@@ -1817,9 +1812,7 @@ ${runnerState.traceback}`
|
|
|
1817
1812
|
this.gotoIdleState();
|
|
1818
1813
|
} else if (runner.state === "completed" /* Completed */) {
|
|
1819
1814
|
try {
|
|
1820
|
-
const runnerState = yield this.nova.api.program.
|
|
1821
|
-
runner.id
|
|
1822
|
-
);
|
|
1815
|
+
const runnerState = yield this.nova.api.program.getProgramRun(runner.id);
|
|
1823
1816
|
const stdout = runnerState.stdout;
|
|
1824
1817
|
if (stdout) {
|
|
1825
1818
|
this.log(stdout);
|
|
@@ -1867,7 +1860,7 @@ ${runnerState.traceback}`
|
|
|
1867
1860
|
});
|
|
1868
1861
|
const trimmedCode = openProgram.wandelscript.replaceAll(/^\s*$/gm, "");
|
|
1869
1862
|
try {
|
|
1870
|
-
const programRunnerRef = yield this.nova.api.program.
|
|
1863
|
+
const programRunnerRef = yield this.nova.api.program.createProgramRun(
|
|
1871
1864
|
{
|
|
1872
1865
|
code: trimmedCode,
|
|
1873
1866
|
initial_state,
|
|
@@ -1905,7 +1898,7 @@ ${runnerState.traceback}`
|
|
|
1905
1898
|
this.executionState = "stopping";
|
|
1906
1899
|
});
|
|
1907
1900
|
try {
|
|
1908
|
-
yield this.nova.api.program.
|
|
1901
|
+
yield this.nova.api.program.stopProgramRun(
|
|
1909
1902
|
this.currentlyExecutingProgramRunnerId
|
|
1910
1903
|
);
|
|
1911
1904
|
} catch (err) {
|