@juhuu/sdk-ts 1.2.265 → 1.2.268

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/index.d.mts CHANGED
@@ -1701,7 +1701,7 @@ declare class FlowsService extends Service {
1701
1701
  private resolveInputs;
1702
1702
  private isInputConnected;
1703
1703
  private blockExecutors;
1704
- executeLocally(flowId: string, context?: Record<string, any>): Promise<{
1704
+ executeLocally(FlowExecuteLocallyParams: JUHUU.Flow.ExecuteLocally.Params, FlowExecuteLocallyOptions?: JUHUU.Flow.Execute.Options): Promise<{
1705
1705
  output: Record<string, any>;
1706
1706
  logArray: FlowLog[];
1707
1707
  }>;
@@ -4750,7 +4750,7 @@ declare namespace JUHUU {
4750
4750
  nodeArray: FlowBlock[];
4751
4751
  edgeArray: FlowEdge[];
4752
4752
  propertyId: string;
4753
- exectionEnvironmentArray: FlowExecutionEnvironment[];
4753
+ executionEnvironmentArray: FlowExecutionEnvironment[];
4754
4754
  status: FlowStatus;
4755
4755
  errorMessage: string | null;
4756
4756
  };
@@ -4824,6 +4824,17 @@ declare namespace JUHUU {
4824
4824
  output: Record<string, any>;
4825
4825
  };
4826
4826
  }
4827
+ namespace ExecuteLocally {
4828
+ type Params = {
4829
+ flowId: string;
4830
+ input?: Record<string, any>;
4831
+ };
4832
+ type Options = JUHUU.RequestOptions;
4833
+ type Response = {
4834
+ output: Record<string, any>;
4835
+ logArray: FlowLog[];
4836
+ };
4837
+ }
4827
4838
  }
4828
4839
  namespace FlowTrace {
4829
4840
  type Object = {
package/dist/index.d.ts CHANGED
@@ -1701,7 +1701,7 @@ declare class FlowsService extends Service {
1701
1701
  private resolveInputs;
1702
1702
  private isInputConnected;
1703
1703
  private blockExecutors;
1704
- executeLocally(flowId: string, context?: Record<string, any>): Promise<{
1704
+ executeLocally(FlowExecuteLocallyParams: JUHUU.Flow.ExecuteLocally.Params, FlowExecuteLocallyOptions?: JUHUU.Flow.Execute.Options): Promise<{
1705
1705
  output: Record<string, any>;
1706
1706
  logArray: FlowLog[];
1707
1707
  }>;
@@ -4750,7 +4750,7 @@ declare namespace JUHUU {
4750
4750
  nodeArray: FlowBlock[];
4751
4751
  edgeArray: FlowEdge[];
4752
4752
  propertyId: string;
4753
- exectionEnvironmentArray: FlowExecutionEnvironment[];
4753
+ executionEnvironmentArray: FlowExecutionEnvironment[];
4754
4754
  status: FlowStatus;
4755
4755
  errorMessage: string | null;
4756
4756
  };
@@ -4824,6 +4824,17 @@ declare namespace JUHUU {
4824
4824
  output: Record<string, any>;
4825
4825
  };
4826
4826
  }
4827
+ namespace ExecuteLocally {
4828
+ type Params = {
4829
+ flowId: string;
4830
+ input?: Record<string, any>;
4831
+ };
4832
+ type Options = JUHUU.RequestOptions;
4833
+ type Response = {
4834
+ output: Record<string, any>;
4835
+ logArray: FlowLog[];
4836
+ };
4837
+ }
4827
4838
  }
4828
4839
  namespace FlowTrace {
4829
4840
  type Object = {
package/dist/index.js CHANGED
@@ -3718,9 +3718,7 @@ var FlowsService = class extends Service {
3718
3718
  for (const param of defs) {
3719
3719
  const value = context[param.name];
3720
3720
  if (value === void 0 && param.required) {
3721
- throw new Error(
3722
- `Missing required input parameter '${param.name}'`
3723
- );
3721
+ throw new Error(`Missing required input parameter '${param.name}'`);
3724
3722
  }
3725
3723
  outputs[param.name] = value;
3726
3724
  }
@@ -3866,16 +3864,20 @@ var FlowsService = class extends Service {
3866
3864
  throw new Error("Block type not implemented in executeLocally");
3867
3865
  }
3868
3866
  };
3869
- async executeLocally(flowId, context = {}) {
3867
+ async executeLocally(FlowExecuteLocallyParams, FlowExecuteLocallyOptions) {
3870
3868
  const logArray = [];
3871
3869
  logArray.push({
3872
3870
  createdAt: /* @__PURE__ */ new Date(),
3873
- message: `Starting local execution of flow '${flowId}'`,
3871
+ message: `Starting local execution of flow '${FlowExecuteLocallyParams.flowId}'`,
3874
3872
  severity: "info"
3875
3873
  });
3876
- const flowResponse = await this.retrieve({ flowId });
3874
+ const flowResponse = await this.retrieve({
3875
+ flowId: FlowExecuteLocallyParams.flowId
3876
+ });
3877
3877
  if (!flowResponse.ok) {
3878
- throw new Error(`Failed to retrieve flow: ${flowResponse.data?.message || "Unknown error"}`);
3878
+ throw new Error(
3879
+ `Failed to retrieve flow: ${flowResponse.data?.message || "Unknown error"}`
3880
+ );
3879
3881
  }
3880
3882
  const flow = flowResponse.data.flow;
3881
3883
  const blocksById = new Map(
@@ -3895,7 +3897,11 @@ var FlowsService = class extends Service {
3895
3897
  if (executor === void 0 || executor === null) {
3896
3898
  throw new Error(`No executor for ${block.type}`);
3897
3899
  }
3898
- const raw = await executor(inputs, block, context);
3900
+ const raw = await executor(
3901
+ inputs,
3902
+ block,
3903
+ FlowExecuteLocallyParams.input ?? {}
3904
+ );
3899
3905
  const { flowBranch, output } = raw;
3900
3906
  outputStore[block.id] = output;
3901
3907
  if (raw.logArray !== void 0) {
@@ -3924,7 +3930,7 @@ var FlowsService = class extends Service {
3924
3930
  };
3925
3931
  if (flow.startNode.type.startsWith("start.") === false) {
3926
3932
  throw new Error(
3927
- `Flow ${flowId} has an invalid start block that is not of type 'start.'`
3933
+ `Flow ${FlowExecuteLocallyParams.flowId} has an invalid start block that is not of type 'start.'`
3928
3934
  );
3929
3935
  }
3930
3936
  let current = flow.startNode;
package/dist/index.mjs CHANGED
@@ -3674,9 +3674,7 @@ var FlowsService = class extends Service {
3674
3674
  for (const param of defs) {
3675
3675
  const value = context[param.name];
3676
3676
  if (value === void 0 && param.required) {
3677
- throw new Error(
3678
- `Missing required input parameter '${param.name}'`
3679
- );
3677
+ throw new Error(`Missing required input parameter '${param.name}'`);
3680
3678
  }
3681
3679
  outputs[param.name] = value;
3682
3680
  }
@@ -3822,16 +3820,20 @@ var FlowsService = class extends Service {
3822
3820
  throw new Error("Block type not implemented in executeLocally");
3823
3821
  }
3824
3822
  };
3825
- async executeLocally(flowId, context = {}) {
3823
+ async executeLocally(FlowExecuteLocallyParams, FlowExecuteLocallyOptions) {
3826
3824
  const logArray = [];
3827
3825
  logArray.push({
3828
3826
  createdAt: /* @__PURE__ */ new Date(),
3829
- message: `Starting local execution of flow '${flowId}'`,
3827
+ message: `Starting local execution of flow '${FlowExecuteLocallyParams.flowId}'`,
3830
3828
  severity: "info"
3831
3829
  });
3832
- const flowResponse = await this.retrieve({ flowId });
3830
+ const flowResponse = await this.retrieve({
3831
+ flowId: FlowExecuteLocallyParams.flowId
3832
+ });
3833
3833
  if (!flowResponse.ok) {
3834
- throw new Error(`Failed to retrieve flow: ${flowResponse.data?.message || "Unknown error"}`);
3834
+ throw new Error(
3835
+ `Failed to retrieve flow: ${flowResponse.data?.message || "Unknown error"}`
3836
+ );
3835
3837
  }
3836
3838
  const flow = flowResponse.data.flow;
3837
3839
  const blocksById = new Map(
@@ -3851,7 +3853,11 @@ var FlowsService = class extends Service {
3851
3853
  if (executor === void 0 || executor === null) {
3852
3854
  throw new Error(`No executor for ${block.type}`);
3853
3855
  }
3854
- const raw = await executor(inputs, block, context);
3856
+ const raw = await executor(
3857
+ inputs,
3858
+ block,
3859
+ FlowExecuteLocallyParams.input ?? {}
3860
+ );
3855
3861
  const { flowBranch, output } = raw;
3856
3862
  outputStore[block.id] = output;
3857
3863
  if (raw.logArray !== void 0) {
@@ -3880,7 +3886,7 @@ var FlowsService = class extends Service {
3880
3886
  };
3881
3887
  if (flow.startNode.type.startsWith("start.") === false) {
3882
3888
  throw new Error(
3883
- `Flow ${flowId} has an invalid start block that is not of type 'start.'`
3889
+ `Flow ${FlowExecuteLocallyParams.flowId} has an invalid start block that is not of type 'start.'`
3884
3890
  );
3885
3891
  }
3886
3892
  let current = flow.startNode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juhuu/sdk-ts",
3
- "version": "1.2.265",
3
+ "version": "1.2.268",
4
4
  "description": "Typescript wrapper for JUHUU services",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",