@wandelbots/nova-js 2.0.2 → 2.1.0-pr.bugfix-NDX-73-send-custom-header.101.b0adaae
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 +7 -2
- package/dist/lib/v1/index.cjs.map +1 -1
- package/dist/lib/v1/index.js +7 -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 +10 -14
- package/dist/lib/v2/index.cjs.map +1 -1
- package/dist/lib/v2/index.js +10 -16
- package/dist/lib/v2/index.js.map +1 -1
- package/package.json +2 -2
- package/src/lib/v1/NovaClient.ts +4 -0
- package/src/lib/v1/mock/MockNovaInstance.ts +1 -0
- package/src/lib/v2/NovaCellAPIClient.ts +0 -4
- package/src/lib/v2/NovaClient.ts +4 -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,11 @@ 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
|
+
"X-Client-SDK": "Wandelbots-Nova-JS-SDK",
|
|
1615
|
+
"X-SDK-Version": "v2"
|
|
1616
|
+
}
|
|
1617
1617
|
});
|
|
1618
1618
|
axiosInstance.interceptors.request.use((request) => __async(this, null, function* () {
|
|
1619
1619
|
if (!request.headers.Authorization) {
|
|
@@ -1780,9 +1780,7 @@ var ProgramStateConnection = class {
|
|
|
1780
1780
|
if (runner.id !== this.currentlyExecutingProgramRunnerId) return;
|
|
1781
1781
|
if (runner.state === "failed" /* Failed */) {
|
|
1782
1782
|
try {
|
|
1783
|
-
const runnerState = yield this.nova.api.program.
|
|
1784
|
-
runner.id
|
|
1785
|
-
);
|
|
1783
|
+
const runnerState = yield this.nova.api.program.getProgramRun(runner.id);
|
|
1786
1784
|
const stdout = runnerState.stdout;
|
|
1787
1785
|
if (stdout) {
|
|
1788
1786
|
this.log(stdout);
|
|
@@ -1800,9 +1798,7 @@ ${runnerState.traceback}`
|
|
|
1800
1798
|
this.gotoIdleState();
|
|
1801
1799
|
} else if (runner.state === "stopped" /* Stopped */) {
|
|
1802
1800
|
try {
|
|
1803
|
-
const runnerState = yield this.nova.api.program.
|
|
1804
|
-
runner.id
|
|
1805
|
-
);
|
|
1801
|
+
const runnerState = yield this.nova.api.program.getProgramRun(runner.id);
|
|
1806
1802
|
const stdout = runnerState.stdout;
|
|
1807
1803
|
if (stdout) {
|
|
1808
1804
|
this.log(stdout);
|
|
@@ -1817,9 +1813,7 @@ ${runnerState.traceback}`
|
|
|
1817
1813
|
this.gotoIdleState();
|
|
1818
1814
|
} else if (runner.state === "completed" /* Completed */) {
|
|
1819
1815
|
try {
|
|
1820
|
-
const runnerState = yield this.nova.api.program.
|
|
1821
|
-
runner.id
|
|
1822
|
-
);
|
|
1816
|
+
const runnerState = yield this.nova.api.program.getProgramRun(runner.id);
|
|
1823
1817
|
const stdout = runnerState.stdout;
|
|
1824
1818
|
if (stdout) {
|
|
1825
1819
|
this.log(stdout);
|
|
@@ -1867,7 +1861,7 @@ ${runnerState.traceback}`
|
|
|
1867
1861
|
});
|
|
1868
1862
|
const trimmedCode = openProgram.wandelscript.replaceAll(/^\s*$/gm, "");
|
|
1869
1863
|
try {
|
|
1870
|
-
const programRunnerRef = yield this.nova.api.program.
|
|
1864
|
+
const programRunnerRef = yield this.nova.api.program.createProgramRun(
|
|
1871
1865
|
{
|
|
1872
1866
|
code: trimmedCode,
|
|
1873
1867
|
initial_state,
|
|
@@ -1905,7 +1899,7 @@ ${runnerState.traceback}`
|
|
|
1905
1899
|
this.executionState = "stopping";
|
|
1906
1900
|
});
|
|
1907
1901
|
try {
|
|
1908
|
-
yield this.nova.api.program.
|
|
1902
|
+
yield this.nova.api.program.stopProgramRun(
|
|
1909
1903
|
this.currentlyExecutingProgramRunnerId
|
|
1910
1904
|
);
|
|
1911
1905
|
} catch (err) {
|