@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
|
@@ -76,9 +76,7 @@ export class ProgramStateConnection {
|
|
|
76
76
|
|
|
77
77
|
if (runner.state === ProgramState.Failed) {
|
|
78
78
|
try {
|
|
79
|
-
const runnerState = await this.nova.api.program.
|
|
80
|
-
runner.id,
|
|
81
|
-
)
|
|
79
|
+
const runnerState = await this.nova.api.program.getProgramRun(runner.id)
|
|
82
80
|
|
|
83
81
|
// TODO - wandelengine should send print statements in real time over
|
|
84
82
|
// websocket as well, rather than at the end
|
|
@@ -100,9 +98,7 @@ export class ProgramStateConnection {
|
|
|
100
98
|
this.gotoIdleState()
|
|
101
99
|
} else if (runner.state === ProgramState.Stopped) {
|
|
102
100
|
try {
|
|
103
|
-
const runnerState = await this.nova.api.program.
|
|
104
|
-
runner.id,
|
|
105
|
-
)
|
|
101
|
+
const runnerState = await this.nova.api.program.getProgramRun(runner.id)
|
|
106
102
|
|
|
107
103
|
const stdout = (runnerState as any).stdout
|
|
108
104
|
if (stdout) {
|
|
@@ -120,9 +116,7 @@ export class ProgramStateConnection {
|
|
|
120
116
|
this.gotoIdleState()
|
|
121
117
|
} else if (runner.state === ProgramState.Completed) {
|
|
122
118
|
try {
|
|
123
|
-
const runnerState = await this.nova.api.program.
|
|
124
|
-
runner.id,
|
|
125
|
-
)
|
|
119
|
+
const runnerState = await this.nova.api.program.getProgramRun(runner.id)
|
|
126
120
|
|
|
127
121
|
const stdout = (runnerState as any).stdout
|
|
128
122
|
if (stdout) {
|
|
@@ -181,7 +175,7 @@ export class ProgramStateConnection {
|
|
|
181
175
|
const trimmedCode = openProgram.wandelscript!.replaceAll(/^\s*$/gm, "")
|
|
182
176
|
|
|
183
177
|
try {
|
|
184
|
-
const programRunnerRef = await this.nova.api.program.
|
|
178
|
+
const programRunnerRef = await this.nova.api.program.createProgramRun(
|
|
185
179
|
{
|
|
186
180
|
code: trimmedCode,
|
|
187
181
|
initial_state: initial_state,
|
|
@@ -220,7 +214,7 @@ export class ProgramStateConnection {
|
|
|
220
214
|
})
|
|
221
215
|
|
|
222
216
|
try {
|
|
223
|
-
await this.nova.api.program.
|
|
217
|
+
await this.nova.api.program.stopProgramRun(
|
|
224
218
|
this.currentlyExecutingProgramRunnerId,
|
|
225
219
|
)
|
|
226
220
|
} catch (err) {
|