@workglow/task-graph 0.0.123 → 0.0.124

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/dist/bun.js CHANGED
@@ -949,7 +949,8 @@ class TaskRunner {
949
949
  this.task.setInput(overrides);
950
950
  const schema = this.task.constructor.inputSchema();
951
951
  this.task.runInputData = await resolveSchemaInputs(this.task.runInputData, schema, { registry: this.registry });
952
- const isValid = await this.task.validateInput(this.task.runInputData);
952
+ const inputs = this.task.runInputData;
953
+ const isValid = await this.task.validateInput(inputs);
953
954
  if (!isValid) {
954
955
  throw new TaskInvalidInputError("Invalid input data");
955
956
  }
@@ -957,7 +958,6 @@ class TaskRunner {
957
958
  await this.handleAbort();
958
959
  throw new TaskAbortedError("Promise for task created and aborted before run");
959
960
  }
960
- const inputs = this.task.runInputData;
961
961
  let outputs;
962
962
  const isStreamable = isTaskStreamable(this.task);
963
963
  if (this.task.cacheable) {
@@ -1002,11 +1002,12 @@ class TaskRunner {
1002
1002
  this.task.runInputData = await resolveSchemaInputs(this.task.runInputData, schema, { registry: this.registry });
1003
1003
  await this.handleStartReactive();
1004
1004
  try {
1005
- const isValid = await this.task.validateInput(this.task.runInputData);
1005
+ const inputs = this.task.runInputData;
1006
+ const isValid = await this.task.validateInput(inputs);
1006
1007
  if (!isValid) {
1007
1008
  throw new TaskInvalidInputError("Invalid input data");
1008
1009
  }
1009
- const resultReactive = await this.executeTaskReactive(this.task.runInputData, this.task.runOutputData);
1010
+ const resultReactive = await this.executeTaskReactive(inputs, this.task.runOutputData);
1010
1011
  this.task.runOutputData = resultReactive;
1011
1012
  await this.handleCompleteReactive();
1012
1013
  } catch (err) {
@@ -1199,7 +1200,7 @@ class TaskRunner {
1199
1200
  this.task.emit("start");
1200
1201
  this.task.emit("status", this.task.status);
1201
1202
  }
1202
- updateProgress = async (task, progress, message, ...args) => {};
1203
+ updateProgress = async (_task, _progress, _message, ..._args) => {};
1203
1204
  async handleStartReactive() {
1204
1205
  this.reactiveRunning = true;
1205
1206
  }
@@ -1307,11 +1308,7 @@ var init_TaskRunner = __esm(() => {
1307
1308
 
1308
1309
  // src/task/Task.ts
1309
1310
  import { compileSchema } from "@workglow/util/schema";
1310
- import {
1311
- deepEqual,
1312
- EventEmitter as EventEmitter3,
1313
- uuid4 as uuid42
1314
- } from "@workglow/util";
1311
+ import { deepEqual, EventEmitter as EventEmitter3, uuid4 as uuid42 } from "@workglow/util";
1315
1312
 
1316
1313
  class Task {
1317
1314
  static type = "Task";
@@ -1678,6 +1675,9 @@ class Task {
1678
1675
  return this.constructor.getInputSchemaNode();
1679
1676
  }
1680
1677
  async validateInput(input) {
1678
+ if (typeof input !== "object" || input === null) {
1679
+ throw new TaskInvalidInputError("Input must be an object");
1680
+ }
1681
1681
  const ctor = this.constructor;
1682
1682
  let schemaNode;
1683
1683
  if (ctor.hasDynamicSchemas) {
@@ -6917,4 +6917,4 @@ export {
6917
6917
  ConditionalTask
6918
6918
  };
6919
6919
 
6920
- //# debugId=9A71E9C04775D82864756E2164756E21
6920
+ //# debugId=F7E8A2EB122F7E0864756E2164756E21