@avaprotocol/sdk-js 1.6.6 → 1.6.8

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.
Files changed (62) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/index.d.ts +17 -30
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +1262 -853
  5. package/dist/index.mjs +1273 -856
  6. package/dist/models/execution.d.ts +7 -9
  7. package/dist/models/execution.d.ts.map +1 -1
  8. package/dist/models/execution.js +17 -7
  9. package/dist/models/node/branch.d.ts +1 -0
  10. package/dist/models/node/branch.d.ts.map +1 -1
  11. package/dist/models/node/branch.js +4 -0
  12. package/dist/models/node/contractRead.d.ts +1 -0
  13. package/dist/models/node/contractRead.d.ts.map +1 -1
  14. package/dist/models/node/contractRead.js +11 -0
  15. package/dist/models/node/contractWrite.d.ts +1 -0
  16. package/dist/models/node/contractWrite.d.ts.map +1 -1
  17. package/dist/models/node/contractWrite.js +4 -0
  18. package/dist/models/node/customCode.d.ts +1 -0
  19. package/dist/models/node/customCode.d.ts.map +1 -1
  20. package/dist/models/node/customCode.js +9 -0
  21. package/dist/models/node/ethTransfer.d.ts +1 -0
  22. package/dist/models/node/ethTransfer.d.ts.map +1 -1
  23. package/dist/models/node/ethTransfer.js +4 -0
  24. package/dist/models/node/factory.d.ts +1 -0
  25. package/dist/models/node/factory.d.ts.map +1 -1
  26. package/dist/models/node/factory.js +54 -0
  27. package/dist/models/node/filter.d.ts +1 -0
  28. package/dist/models/node/filter.d.ts.map +1 -1
  29. package/dist/models/node/filter.js +4 -0
  30. package/dist/models/node/graphqlQuery.d.ts +1 -0
  31. package/dist/models/node/graphqlQuery.d.ts.map +1 -1
  32. package/dist/models/node/graphqlQuery.js +4 -0
  33. package/dist/models/node/loop.d.ts +1 -0
  34. package/dist/models/node/loop.d.ts.map +1 -1
  35. package/dist/models/node/loop.js +4 -0
  36. package/dist/models/node/restApi.d.ts +1 -0
  37. package/dist/models/node/restApi.d.ts.map +1 -1
  38. package/dist/models/node/restApi.js +15 -1
  39. package/dist/models/trigger/block.d.ts +6 -0
  40. package/dist/models/trigger/block.d.ts.map +1 -1
  41. package/dist/models/trigger/block.js +9 -0
  42. package/dist/models/trigger/cron.d.ts +8 -1
  43. package/dist/models/trigger/cron.d.ts.map +1 -1
  44. package/dist/models/trigger/cron.js +18 -1
  45. package/dist/models/trigger/event.d.ts +7 -1
  46. package/dist/models/trigger/event.d.ts.map +1 -1
  47. package/dist/models/trigger/event.js +10 -1
  48. package/dist/models/trigger/factory.d.ts +1 -0
  49. package/dist/models/trigger/factory.d.ts.map +1 -1
  50. package/dist/models/trigger/factory.js +42 -0
  51. package/dist/models/trigger/fixedTime.d.ts +8 -1
  52. package/dist/models/trigger/fixedTime.d.ts.map +1 -1
  53. package/dist/models/trigger/fixedTime.js +18 -1
  54. package/dist/models/trigger/interface.d.ts +1 -1
  55. package/dist/models/trigger/interface.d.ts.map +1 -1
  56. package/dist/models/trigger/manual.d.ts +13 -0
  57. package/dist/models/trigger/manual.d.ts.map +1 -1
  58. package/dist/models/trigger/manual.js +17 -0
  59. package/dist/utils.d.ts +34 -0
  60. package/dist/utils.d.ts.map +1 -1
  61. package/dist/utils.js +116 -2
  62. package/package.json +2 -2
@@ -1,19 +1,17 @@
1
1
  import * as avs_pb from "@/grpc_codegen/avs_pb";
2
- import TriggerReason from "./trigger/reason";
2
+ import { TriggerType } from "@avaprotocol/types";
3
3
  import Step from "./step";
4
4
  export type StepProps = avs_pb.Execution.Step.AsObject;
5
- export type OutputDataProps = avs_pb.BlockTrigger.Output.AsObject | avs_pb.FixedTimeTrigger.Output.AsObject | avs_pb.CronTrigger.Output.AsObject | avs_pb.EventTrigger.Output.AsObject | avs_pb.EventTrigger.TransferLogOutput.AsObject | avs_pb.Evm.Log.AsObject | {
5
+ export type OutputDataProps = avs_pb.BlockTrigger.Output.AsObject | avs_pb.FixedTimeTrigger.Output.AsObject | avs_pb.CronTrigger.Output.AsObject | avs_pb.EventTrigger.Output.AsObject | avs_pb.EventTrigger.TransferLogOutput.AsObject | avs_pb.ManualTrigger.Output.AsObject | avs_pb.Evm.Log.AsObject | {
6
6
  blockNumber: number;
7
7
  } | {
8
- epoch: number;
9
- } | {
10
- epoch: number;
11
- scheduleMatched: string;
8
+ timestamp: number;
9
+ timestampIso: string;
12
10
  } | undefined;
13
- export type ExecutionProps = Omit<avs_pb.Execution.AsObject, "stepsList" | "reason" | "blockTrigger" | "fixedTimeTrigger" | "cronTrigger" | "eventTrigger"> & {
11
+ export type ExecutionProps = Omit<avs_pb.Execution.AsObject, "stepsList" | "blockTrigger" | "fixedTimeTrigger" | "cronTrigger" | "eventTrigger" | "manualTrigger" | "triggerType"> & {
14
12
  stepsList: Step[];
15
- triggerReason: TriggerReason | undefined;
16
13
  triggerOutput: OutputDataProps;
14
+ triggerType: TriggerType;
17
15
  };
18
16
  declare class Execution implements ExecutionProps {
19
17
  id: string;
@@ -22,8 +20,8 @@ declare class Execution implements ExecutionProps {
22
20
  success: boolean;
23
21
  error: string;
24
22
  stepsList: Step[];
25
- triggerReason: TriggerReason | undefined;
26
23
  triggerName: string;
24
+ triggerType: TriggerType;
27
25
  triggerOutput: OutputDataProps;
28
26
  constructor(props: ExecutionProps);
29
27
  static fromResponse(execution: avs_pb.Execution): Execution;
@@ -1 +1 @@
1
- {"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../../src/models/execution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,IAAI,MAAM,QAAQ,CAAC;AAE1B,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;AAEvD,MAAM,MAAM,eAAe,GACvB,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,QAAQ,GACnC,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,QAAQ,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,eAAe,CAAC;gBAEnB,KAAK,EAAE,cAAc;IAYjC,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,SAAS,GAAG,SAAS;CA8D5D;AAED,eAAe,SAAS,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import * as avs_pb from "@/grpc_codegen/avs_pb";
2
- import TriggerReason from "./trigger/reason";
2
+ import { TriggerTypeConverter } from "@avaprotocol/types";
3
3
  import Step from "./step";
4
4
  class Execution {
5
5
  constructor(props) {
@@ -10,7 +10,7 @@ class Execution {
10
10
  this.error = props.error;
11
11
  this.stepsList = props.stepsList;
12
12
  this.triggerName = props.triggerName;
13
- this.triggerReason = props.triggerReason;
13
+ this.triggerType = props.triggerType;
14
14
  this.triggerOutput = props.triggerOutput;
15
15
  }
16
16
  static fromResponse(execution) {
@@ -24,13 +24,19 @@ class Execution {
24
24
  break;
25
25
  case avs_pb.Execution.OutputDataCase.FIXED_TIME_TRIGGER:
26
26
  const fixedTimeOutput = execution.getFixedTimeTrigger()?.toObject();
27
- // Filter to only return epoch for fixed time triggers
28
- triggerOutputData = fixedTimeOutput ? { epoch: fixedTimeOutput.epoch } : undefined;
27
+ // Updated to use timestamp and timestampIso instead of epoch
28
+ triggerOutputData = fixedTimeOutput ? {
29
+ timestamp: fixedTimeOutput.timestamp,
30
+ timestampIso: fixedTimeOutput.timestampIso
31
+ } : undefined;
29
32
  break;
30
33
  case avs_pb.Execution.OutputDataCase.CRON_TRIGGER:
31
34
  const cronOutput = execution.getCronTrigger()?.toObject();
32
- // Filter to only return epoch and scheduleMatched for cron triggers
33
- triggerOutputData = cronOutput ? { epoch: cronOutput.epoch, scheduleMatched: cronOutput.scheduleMatched } : undefined;
35
+ // Updated to use timestamp and timestampIso instead of epoch (removed scheduleMatched as it doesn't exist)
36
+ triggerOutputData = cronOutput ? {
37
+ timestamp: cronOutput.timestamp,
38
+ timestampIso: cronOutput.timestampIso
39
+ } : undefined;
34
40
  break;
35
41
  case avs_pb.Execution.OutputDataCase.EVENT_TRIGGER:
36
42
  const eventTrigger = execution.getEventTrigger();
@@ -43,6 +49,10 @@ class Execution {
43
49
  }
44
50
  }
45
51
  break;
52
+ case avs_pb.Execution.OutputDataCase.MANUAL_TRIGGER:
53
+ const manualOutput = execution.getManualTrigger()?.toObject();
54
+ triggerOutputData = manualOutput || undefined;
55
+ break;
46
56
  case avs_pb.Execution.OutputDataCase.OUTPUT_DATA_NOT_SET:
47
57
  triggerOutputData = undefined;
48
58
  break;
@@ -54,7 +64,7 @@ class Execution {
54
64
  success: execution.getSuccess(),
55
65
  error: execution.getError(),
56
66
  triggerName: execution.getTriggerName(),
57
- triggerReason: TriggerReason.fromResponse(execution.getReason()),
67
+ triggerType: TriggerTypeConverter.fromProtobuf(execution.getTriggerType()), // Convert protobuf enum to SDK enum
58
68
  triggerOutput: triggerOutputData,
59
69
  stepsList: execution
60
70
  .getStepsList()
@@ -9,6 +9,7 @@ declare class BranchNode extends Node {
9
9
  constructor(props: BranchNodeProps);
10
10
  static fromResponse(raw: avs_pb.TaskNode): BranchNode;
11
11
  toRequest(): avs_pb.TaskNode;
12
+ static fromOutputData(outputData: avs_pb.RunNodeWithInputsResp): any;
12
13
  }
13
14
  export default BranchNode;
14
15
  //# sourceMappingURL=branch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"branch.d.ts","sourceRoot":"","sources":["../../../src/models/node/branch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAY,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAGhD,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG;IACxC,IAAI,EAAE,cAAc,CAAC;CACtB,CAAC;AAEF,cAAM,UAAW,SAAQ,IAAI;gBACf,KAAK,EAAE,eAAe;IAIlC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,UAAU;IAUrD,SAAS,IAAI,MAAM,CAAC,QAAQ;CAgC7B;AACD,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"branch.d.ts","sourceRoot":"","sources":["../../../src/models/node/branch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAY,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAGhD,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG;IACxC,IAAI,EAAE,cAAc,CAAC;CACtB,CAAC;AAEF,cAAM,UAAW,SAAQ,IAAI;gBACf,KAAK,EAAE,eAAe;IAIlC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,UAAU;IAUrD,SAAS,IAAI,MAAM,CAAC,QAAQ;IA+B5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAMrE;AACD,eAAe,UAAU,CAAC"}
@@ -35,5 +35,9 @@ class BranchNode extends Node {
35
35
  request.setBranch(nodeData);
36
36
  return request;
37
37
  }
38
+ static fromOutputData(outputData) {
39
+ const branchOutput = outputData.getBranch();
40
+ return branchOutput?.toObject() || null;
41
+ }
38
42
  }
39
43
  export default BranchNode;
@@ -9,6 +9,7 @@ declare class ContractReadNode extends Node {
9
9
  constructor(props: ContractReadNodeProps);
10
10
  static fromResponse(raw: avs_pb.TaskNode): ContractReadNode;
11
11
  toRequest(): avs_pb.TaskNode;
12
+ static fromOutputData(outputData: avs_pb.RunNodeWithInputsResp): any;
12
13
  }
13
14
  export default ContractReadNode;
14
15
  //# sourceMappingURL=contractRead.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"contractRead.d.ts","sourceRoot":"","sources":["../../../src/models/node/contractRead.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAY,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAGpE,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG;IAC9C,IAAI,EAAE,oBAAoB,CAAC;CAC5B,CAAC;AAEF,cAAM,gBAAiB,SAAQ,IAAI;gBACrB,KAAK,EAAE,qBAAqB;IAIxC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,gBAAgB;IAU3D,SAAS,IAAI,MAAM,CAAC,QAAQ;CAkB7B;AAED,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"contractRead.d.ts","sourceRoot":"","sources":["../../../src/models/node/contractRead.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAY,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAIpE,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG;IAC9C,IAAI,EAAE,oBAAoB,CAAC;CAC5B,CAAC;AAEF,cAAM,gBAAiB,SAAQ,IAAI;gBACrB,KAAK,EAAE,qBAAqB;IAIxC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,gBAAgB;IAU3D,SAAS,IAAI,MAAM,CAAC,QAAQ;IAoB5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAUrE;AAED,eAAe,gBAAgB,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import Node from "./interface";
2
2
  import * as avs_pb from "@/grpc_codegen/avs_pb";
3
3
  import { NodeType } from "@avaprotocol/types";
4
+ import { convertProtobufValueToJs } from "../../utils";
4
5
  class ContractReadNode extends Node {
5
6
  constructor(props) {
6
7
  super({ ...props, type: NodeType.ContractRead, data: props.data });
@@ -27,5 +28,15 @@ class ContractReadNode extends Node {
27
28
  request.setContractRead(nodeData);
28
29
  return request;
29
30
  }
31
+ static fromOutputData(outputData) {
32
+ const contractReadOutput = outputData.getContractRead();
33
+ if (contractReadOutput && contractReadOutput.getDataList()) {
34
+ const dataList = contractReadOutput.getDataList();
35
+ return {
36
+ dataList: dataList.map((value) => convertProtobufValueToJs(value))
37
+ };
38
+ }
39
+ return null;
40
+ }
30
41
  }
31
42
  export default ContractReadNode;
@@ -9,6 +9,7 @@ declare class ContractWriteNode extends Node {
9
9
  constructor(props: ContractWriteNodeProps);
10
10
  static fromResponse(raw: avs_pb.TaskNode): ContractWriteNode;
11
11
  toRequest(): avs_pb.TaskNode;
12
+ static fromOutputData(outputData: avs_pb.RunNodeWithInputsResp): any;
12
13
  }
13
14
  export default ContractWriteNode;
14
15
  //# sourceMappingURL=contractWrite.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"contractWrite.d.ts","sourceRoot":"","sources":["../../../src/models/node/contractWrite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAY,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAGrE,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG;IAC/C,IAAI,EAAE,qBAAqB,CAAC;CAC7B,CAAC;AAEF,cAAM,iBAAkB,SAAQ,IAAI;gBACtB,KAAK,EAAE,sBAAsB;IAIzC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,iBAAiB;IAU5D,SAAS,IAAI,MAAM,CAAC,QAAQ;CAkB7B;AAED,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"contractWrite.d.ts","sourceRoot":"","sources":["../../../src/models/node/contractWrite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAY,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAGrE,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG;IAC/C,IAAI,EAAE,qBAAqB,CAAC;CAC7B,CAAC;AAEF,cAAM,iBAAkB,SAAQ,IAAI;gBACtB,KAAK,EAAE,sBAAsB;IAIzC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,iBAAiB;IAU5D,SAAS,IAAI,MAAM,CAAC,QAAQ;IAmB5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAIrE;AAED,eAAe,iBAAiB,CAAC"}
@@ -27,5 +27,9 @@ class ContractWriteNode extends Node {
27
27
  request.setContractWrite(nodeData);
28
28
  return request;
29
29
  }
30
+ static fromOutputData(outputData) {
31
+ const contractWriteOutput = outputData.getContractWrite();
32
+ return contractWriteOutput?.toObject() || null;
33
+ }
30
34
  }
31
35
  export default ContractWriteNode;
@@ -9,6 +9,7 @@ declare class CustomCodeNode extends Node {
9
9
  constructor(props: CustomCodeNodeProps);
10
10
  static fromResponse(raw: avs_pb.TaskNode): CustomCodeNode;
11
11
  toRequest(): avs_pb.TaskNode;
12
+ static fromOutputData(outputData: avs_pb.RunNodeWithInputsResp): any;
12
13
  }
13
14
  export default CustomCodeNode;
14
15
  //# sourceMappingURL=customCode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"customCode.d.ts","sourceRoot":"","sources":["../../../src/models/node/customCode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAY,kBAAkB,EAAmB,MAAM,oBAAoB,CAAC;AAGnF,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG;IAC5C,IAAI,EAAE,kBAAkB,CAAC;CAC1B,CAAC;AAEF,cAAM,cAAe,SAAQ,IAAI;gBACnB,KAAK,EAAE,mBAAmB;IAItC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,cAAc;IAUzD,SAAS,IAAI,MAAM,CAAC,QAAQ;CAiB7B;AAED,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"customCode.d.ts","sourceRoot":"","sources":["../../../src/models/node/customCode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAY,kBAAkB,EAAmB,MAAM,oBAAoB,CAAC;AAInF,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG;IAC5C,IAAI,EAAE,kBAAkB,CAAC;CAC1B,CAAC;AAEF,cAAM,cAAe,SAAQ,IAAI;gBACnB,KAAK,EAAE,mBAAmB;IAItC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,cAAc;IAUzD,SAAS,IAAI,MAAM,CAAC,QAAQ;IAkB5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAQrE;AAED,eAAe,cAAc,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import Node from "./interface";
2
2
  import * as avs_pb from "@/grpc_codegen/avs_pb";
3
3
  import { NodeType } from "@avaprotocol/types";
4
+ import { convertProtobufValueToJs } from "../../utils";
4
5
  class CustomCodeNode extends Node {
5
6
  constructor(props) {
6
7
  super({ ...props, type: NodeType.CustomCode, data: props.data });
@@ -26,5 +27,13 @@ class CustomCodeNode extends Node {
26
27
  request.setCustomCode(nodeData);
27
28
  return request;
28
29
  }
30
+ static fromOutputData(outputData) {
31
+ const customCodeOutput = outputData.getCustomCode();
32
+ if (customCodeOutput?.getData()) {
33
+ // Use the modern protobuf conversion function
34
+ return convertProtobufValueToJs(customCodeOutput.getData());
35
+ }
36
+ return null;
37
+ }
29
38
  }
30
39
  export default CustomCodeNode;
@@ -9,6 +9,7 @@ declare class ETHTransferNode extends Node {
9
9
  constructor(props: ETHTransferNodeProps);
10
10
  static fromResponse(raw: avs_pb.TaskNode): ETHTransferNode;
11
11
  toRequest(): avs_pb.TaskNode;
12
+ static fromOutputData(outputData: avs_pb.RunNodeWithInputsResp): any;
12
13
  }
13
14
  export default ETHTransferNode;
14
15
  //# sourceMappingURL=ethTransfer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ethTransfer.d.ts","sourceRoot":"","sources":["../../../src/models/node/ethTransfer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAY,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAGnE,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG;IAC7C,IAAI,EAAE,mBAAmB,CAAC;CAC3B,CAAC;AAEF,cAAM,eAAgB,SAAQ,IAAI;gBACpB,KAAK,EAAE,oBAAoB;IAIvC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,eAAe;IAU1D,SAAS,IAAI,MAAM,CAAC,QAAQ;CAiB7B;AAED,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"ethTransfer.d.ts","sourceRoot":"","sources":["../../../src/models/node/ethTransfer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAY,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAGnE,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG;IAC7C,IAAI,EAAE,mBAAmB,CAAC;CAC3B,CAAC;AAEF,cAAM,eAAgB,SAAQ,IAAI;gBACpB,KAAK,EAAE,oBAAoB;IAIvC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,eAAe;IAU1D,SAAS,IAAI,MAAM,CAAC,QAAQ;IAkB5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAIrE;AAED,eAAe,eAAe,CAAC"}
@@ -26,5 +26,9 @@ class ETHTransferNode extends Node {
26
26
  request.setEthTransfer(nodeData);
27
27
  return request;
28
28
  }
29
+ static fromOutputData(outputData) {
30
+ const ethTransferOutput = outputData.getEthTransfer();
31
+ return ethTransferOutput?.toObject() || null;
32
+ }
29
33
  }
30
34
  export default ETHTransferNode;
@@ -14,6 +14,7 @@ declare class NodeFactory {
14
14
  static create(props: NodeProps): Node;
15
15
  static createNodes(props: NodeProps[]): Node[];
16
16
  static fromResponse(raw: avs_pb.TaskNode): Node;
17
+ static fromOutputData(outputData: avs_pb.RunNodeWithInputsResp): any;
17
18
  }
18
19
  export default NodeFactory;
19
20
  export { Node, ContractWriteNode, ContractReadNode, BranchNode, ETHTransferNode, GraphQLQueryNode, RestAPINode, CustomCodeNode, CustomCodeLangs, FilterNode, LoopNode, };
@@ -1 +1 @@
1
- {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/models/node/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,C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,EACV,qBAAqB,EACrB,oBAAoB,EACpB,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,YAAY,GACb,CAAC;AAGF,YAAY,EACV,SAAS,EACT,sBAAsB,EACtB,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,aAAa,GACd,CAAC"}
1
+ {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/models/node/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAEhD,OAAO,iBAAiB,EAAE,EACxB,sBAAsB,EACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,cAAc,EAAE,EACrB,mBAAmB,EACpB,MAAM,cAAc,CAAC;AACtB,OAAO,gBAAgB,EAAE,EACvB,qBAAqB,EACtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,IAAI,EAAE,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,WAAW,EAAE,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,gBAAgB,EAAE,EACvB,qBAAqB,EACtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,eAAe,EAAE,EACtB,oBAAoB,EACrB,MAAM,eAAe,CAAC;AACvB,OAAO,UAAU,EAAE,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,UAAU,EAAE,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,QAAQ,EAAE,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACjD,OAAO,EAEL,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,YAAY,EACb,MAAM,oBAAoB,CAAC;AAG5B,cAAM,WAAW;IACf,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI;IA2BrC,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE;IAI9C,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,IAAI;IAyB/C,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAyDrE;AAED,eAAe,WAAW,CAAC;AAG3B,OAAO,EACL,IAAI,EACJ,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,cAAc,EACd,eAAe,EACf,UAAU,EACV,QAAQ,GACT,CAAC;AAGF,YAAY,EACV,qBAAqB,EACrB,oBAAoB,EACpB,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,YAAY,GACb,CAAC;AAGF,YAAY,EACV,SAAS,EACT,sBAAsB,EACtB,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,aAAa,GACd,CAAC"}
@@ -1,3 +1,4 @@
1
+ import * as avs_pb from "@/grpc_codegen/avs_pb";
1
2
  import _ from "lodash";
2
3
  import ContractWriteNode from "./contractWrite";
3
4
  import CustomCodeNode from "./customCode";
@@ -10,6 +11,7 @@ import BranchNode from "./branch";
10
11
  import FilterNode from "./filter";
11
12
  import LoopNode from "./loop";
12
13
  import { NodeType, CustomCodeLangs } from "@avaprotocol/types";
14
+ import { convertProtobufValueToJs } from "../../utils";
13
15
  class NodeFactory {
14
16
  static create(props) {
15
17
  switch (props.type) {
@@ -64,6 +66,58 @@ class NodeFactory {
64
66
  throw new Error(`Unsupported node type: ${raw.getName()}`);
65
67
  }
66
68
  }
69
+ static fromOutputData(outputData) {
70
+ // Generic approach: try to extract data from any output type using getData() method
71
+ // This works for all node types that follow the pattern of having a getData() method
72
+ let nodeOutput = null;
73
+ let rawData = null;
74
+ // Get the specific node output based on the case
75
+ switch (outputData.getOutputDataCase()) {
76
+ case avs_pb.RunNodeWithInputsResp.OutputDataCase.REST_API:
77
+ nodeOutput = outputData.getRestApi();
78
+ break;
79
+ case avs_pb.RunNodeWithInputsResp.OutputDataCase.CUSTOM_CODE:
80
+ nodeOutput = outputData.getCustomCode();
81
+ break;
82
+ case avs_pb.RunNodeWithInputsResp.OutputDataCase.CONTRACT_READ:
83
+ nodeOutput = outputData.getContractRead();
84
+ break;
85
+ case avs_pb.RunNodeWithInputsResp.OutputDataCase.CONTRACT_WRITE:
86
+ nodeOutput = outputData.getContractWrite();
87
+ break;
88
+ case avs_pb.RunNodeWithInputsResp.OutputDataCase.ETH_TRANSFER:
89
+ nodeOutput = outputData.getEthTransfer();
90
+ break;
91
+ case avs_pb.RunNodeWithInputsResp.OutputDataCase.GRAPHQL:
92
+ nodeOutput = outputData.getGraphql();
93
+ break;
94
+ case avs_pb.RunNodeWithInputsResp.OutputDataCase.BRANCH:
95
+ nodeOutput = outputData.getBranch();
96
+ break;
97
+ case avs_pb.RunNodeWithInputsResp.OutputDataCase.FILTER:
98
+ nodeOutput = outputData.getFilter();
99
+ break;
100
+ case avs_pb.RunNodeWithInputsResp.OutputDataCase.LOOP:
101
+ nodeOutput = outputData.getLoop();
102
+ break;
103
+ case avs_pb.RunNodeWithInputsResp.OutputDataCase.OUTPUT_DATA_NOT_SET:
104
+ default:
105
+ throw new Error(`Unsupported output data case: ${outputData.getOutputDataCase()}`);
106
+ }
107
+ if (!nodeOutput) {
108
+ return null;
109
+ }
110
+ // Try to get data using getData() method (works for most node types)
111
+ if (typeof nodeOutput.getData === 'function') {
112
+ rawData = nodeOutput.getData();
113
+ if (rawData) {
114
+ return convertProtobufValueToJs(rawData);
115
+ }
116
+ }
117
+ // For node types that don't have getData() or have special structures,
118
+ // fall back to toObject() for now (can be specialized later if needed)
119
+ return nodeOutput.toObject();
120
+ }
67
121
  }
68
122
  export default NodeFactory;
69
123
  // Node object definitions
@@ -9,6 +9,7 @@ declare class FilterNode extends Node {
9
9
  constructor(props: FilterNodeProps);
10
10
  static fromResponse(raw: avs_pb.TaskNode): FilterNode;
11
11
  toRequest(): avs_pb.TaskNode;
12
+ static fromOutputData(outputData: avs_pb.RunNodeWithInputsResp): any;
12
13
  }
13
14
  export default FilterNode;
14
15
  //# sourceMappingURL=filter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../../src/models/node/filter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAY,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAG9D,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG;IACxC,IAAI,EAAE,cAAc,CAAC;CACtB,CAAC;AAEF,cAAM,UAAW,SAAQ,IAAI;gBACf,KAAK,EAAE,eAAe;IAIlC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,UAAU;IAUrD,SAAS,IAAI,MAAM,CAAC,QAAQ;CAgB7B;AAED,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../../src/models/node/filter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAY,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAG9D,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG;IACxC,IAAI,EAAE,cAAc,CAAC;CACtB,CAAC;AAEF,cAAM,UAAW,SAAQ,IAAI;gBACf,KAAK,EAAE,eAAe;IAIlC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,UAAU;IAUrD,SAAS,IAAI,MAAM,CAAC,QAAQ;IAiB5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAIrE;AAED,eAAe,UAAU,CAAC"}
@@ -26,5 +26,9 @@ class FilterNode extends Node {
26
26
  request.setFilter(nodeData);
27
27
  return request;
28
28
  }
29
+ static fromOutputData(outputData) {
30
+ const filterOutput = outputData.getFilter();
31
+ return filterOutput?.toObject() || null;
32
+ }
29
33
  }
30
34
  export default FilterNode;
@@ -9,6 +9,7 @@ declare class GraphQLQueryNode extends Node {
9
9
  constructor(props: GraphQLQueryNodeProps);
10
10
  static fromResponse(raw: avs_pb.TaskNode): GraphQLQueryNode;
11
11
  toRequest(): avs_pb.TaskNode;
12
+ static fromOutputData(outputData: avs_pb.RunNodeWithInputsResp): any;
12
13
  }
13
14
  export default GraphQLQueryNode;
14
15
  //# sourceMappingURL=graphqlQuery.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"graphqlQuery.d.ts","sourceRoot":"","sources":["../../../src/models/node/graphqlQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAY,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAGpE,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG;IAC9C,IAAI,EAAE,oBAAoB,CAAC;CAC5B,CAAC;AAEF,cAAM,gBAAiB,SAAQ,IAAI;gBACrB,KAAK,EAAE,qBAAqB;IAQxC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,gBAAgB;IAU3D,SAAS,IAAI,MAAM,CAAC,QAAQ;CA0B7B;AAED,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"graphqlQuery.d.ts","sourceRoot":"","sources":["../../../src/models/node/graphqlQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAY,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAGpE,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG;IAC9C,IAAI,EAAE,oBAAoB,CAAC;CAC5B,CAAC;AAEF,cAAM,gBAAiB,SAAQ,IAAI;gBACrB,KAAK,EAAE,qBAAqB;IAQxC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,gBAAgB;IAU3D,SAAS,IAAI,MAAM,CAAC,QAAQ;IA2B5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAIrE;AAED,eAAe,gBAAgB,CAAC"}
@@ -37,5 +37,9 @@ class GraphQLQueryNode extends Node {
37
37
  request.setGraphqlQuery(nodeData);
38
38
  return request;
39
39
  }
40
+ static fromOutputData(outputData) {
41
+ const graphqlOutput = outputData.getGraphql();
42
+ return graphqlOutput?.toObject() || null;
43
+ }
40
44
  }
41
45
  export default GraphQLQueryNode;
@@ -8,6 +8,7 @@ declare class LoopNode extends Node {
8
8
  constructor(props: LoopNodeProps);
9
9
  static fromResponse(raw: avs_pb.TaskNode): LoopNode;
10
10
  toRequest(): avs_pb.TaskNode;
11
+ static fromOutputData(outputData: avs_pb.RunNodeWithInputsResp): any;
11
12
  }
12
13
  export default LoopNode;
13
14
  //# sourceMappingURL=loop.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"loop.d.ts","sourceRoot":"","sources":["../../../src/models/node/loop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,IAAI,EAAE,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAY,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAG5D,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG;IACtC,IAAI,EAAE,YAAY,CAAC;CACpB,CAAC;AAEF,cAAM,QAAS,SAAQ,IAAI;gBACb,KAAK,EAAE,aAAa;IAIhC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,QAAQ;IA+BnD,SAAS,IAAI,MAAM,CAAC,QAAQ;CAiG7B;AAED,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"loop.d.ts","sourceRoot":"","sources":["../../../src/models/node/loop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,IAAI,EAAE,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAY,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAG5D,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG;IACtC,IAAI,EAAE,YAAY,CAAC;CACpB,CAAC;AAEF,cAAM,QAAS,SAAQ,IAAI;gBACb,KAAK,EAAE,aAAa;IAIhC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,QAAQ;IA+BnD,SAAS,IAAI,MAAM,CAAC,QAAQ;IAkG5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAIrE;AAED,eAAe,QAAQ,CAAC"}
@@ -123,5 +123,9 @@ class LoopNode extends Node {
123
123
  node.setLoop(loopNode);
124
124
  return node;
125
125
  }
126
+ static fromOutputData(outputData) {
127
+ const loopOutput = outputData.getLoop();
128
+ return loopOutput?.toObject() || null;
129
+ }
126
130
  }
127
131
  export default LoopNode;
@@ -9,6 +9,7 @@ declare class RestAPINode extends Node {
9
9
  constructor(props: RestAPINodeProps);
10
10
  static fromResponse(raw: avs_pb.TaskNode): RestAPINode;
11
11
  toRequest(): avs_pb.TaskNode;
12
+ static fromOutputData(outputData: avs_pb.RunNodeWithInputsResp): any;
12
13
  }
13
14
  export default RestAPINode;
14
15
  //# sourceMappingURL=restApi.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"restApi.d.ts","sourceRoot":"","sources":["../../../src/models/node/restApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAY,eAAe,EAAqB,MAAM,oBAAoB,CAAC;AAGlF,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG;IACzC,IAAI,EAAE,eAAe,CAAC;CACvB,CAAC;AAEF,cAAM,WAAY,SAAQ,IAAI;gBAChB,KAAK,EAAE,gBAAgB;IAInC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,WAAW;IAUtD,SAAS,IAAI,MAAM,CAAC,QAAQ;CA2B7B;AAED,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"restApi.d.ts","sourceRoot":"","sources":["../../../src/models/node/restApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAEL,eAAe,EAEhB,MAAM,oBAAoB,CAAC;AAI5B,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG;IACzC,IAAI,EAAE,eAAe,CAAC;CACvB,CAAC;AAEF,cAAM,WAAY,SAAQ,IAAI;gBAChB,KAAK,EAAE,gBAAgB;IAInC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,WAAW;IAUtD,SAAS,IAAI,MAAM,CAAC,QAAQ;IAgC5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAerE;AAED,eAAe,WAAW,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import Node from "./interface";
2
2
  import * as avs_pb from "@/grpc_codegen/avs_pb";
3
- import { NodeType } from "@avaprotocol/types";
3
+ import { NodeType, } from "@avaprotocol/types";
4
+ import { convertProtobufValueToJs } from "../../utils";
4
5
  class RestAPINode extends Node {
5
6
  constructor(props) {
6
7
  super({ ...props, type: NodeType.RestAPI, data: props.data });
@@ -34,5 +35,18 @@ class RestAPINode extends Node {
34
35
  request.setRestApi(nodeData);
35
36
  return request;
36
37
  }
38
+ static fromOutputData(outputData) {
39
+ const restApiOutput = outputData.getRestApi();
40
+ if (!restApiOutput) {
41
+ console.log("Debug RestAPI: No restApiOutput found");
42
+ return null;
43
+ }
44
+ // Use convertProtobufValueToJs to get clean JavaScript objects
45
+ const rawData = restApiOutput.getData();
46
+ if (rawData) {
47
+ return convertProtobufValueToJs(rawData);
48
+ }
49
+ return restApiOutput.toObject();
50
+ }
37
51
  }
38
52
  export default RestAPINode;
@@ -14,6 +14,12 @@ declare class BlockTrigger extends Trigger {
14
14
  * @returns {BlockTriggerOutput | undefined} - The converted data
15
15
  */
16
16
  getOutput(): BlockTriggerOutput | undefined;
17
+ /**
18
+ * Extract output data from RunTriggerResp for block triggers
19
+ * @param outputData - The RunTriggerResp containing block trigger output
20
+ * @returns Plain JavaScript object with block trigger data
21
+ */
22
+ static fromOutputData(outputData: avs_pb.RunTriggerResp): any;
17
23
  }
18
24
  export default BlockTrigger;
19
25
  //# sourceMappingURL=block.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/block.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,OAAO,EAAE,EAAiB,YAAY,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAe,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAG3F,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG;IAAE,IAAI,EAAE,oBAAoB,CAAA;CAAE,CAAC;AAE9E,cAAM,YAAa,SAAQ,OAAO;gBACpB,KAAK,EAAE,iBAAiB;IAIpC,SAAS,IAAI,MAAM,CAAC,WAAW;IAmB/B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,GAAG,YAAY;IAuB1D;;;;OAIG;IACH,SAAS,IAAI,kBAAkB,GAAG,SAAS;CAG5C;AAED,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/block.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,OAAO,EAAE,EAAiB,YAAY,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAe,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAG3F,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG;IAAE,IAAI,EAAE,oBAAoB,CAAA;CAAE,CAAC;AAE9E,cAAM,YAAa,SAAQ,OAAO;gBACpB,KAAK,EAAE,iBAAiB;IAIpC,SAAS,IAAI,MAAM,CAAC,WAAW;IAmB/B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,GAAG,YAAY;IAuB1D;;;;OAIG;IACH,SAAS,IAAI,kBAAkB,GAAG,SAAS;IAI3C;;;;OAIG;IACH,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,cAAc,GAAG,GAAG;CAI9D;AAED,eAAe,YAAY,CAAC"}
@@ -45,5 +45,14 @@ class BlockTrigger extends Trigger {
45
45
  getOutput() {
46
46
  return this.output;
47
47
  }
48
+ /**
49
+ * Extract output data from RunTriggerResp for block triggers
50
+ * @param outputData - The RunTriggerResp containing block trigger output
51
+ * @returns Plain JavaScript object with block trigger data
52
+ */
53
+ static fromOutputData(outputData) {
54
+ const blockOutput = outputData.getBlockTrigger();
55
+ return blockOutput?.toObject() || null;
56
+ }
48
57
  }
49
58
  export default BlockTrigger;
@@ -9,11 +9,18 @@ declare class CronTrigger extends Trigger {
9
9
  toRequest(): avs_pb.TaskTrigger;
10
10
  static fromResponse(raw: avs_pb.TaskTrigger): CronTrigger;
11
11
  /**
12
- * Convert raw data from runNodeWithInputs response to CronOutput format
12
+ * Convert raw data from runTrigger response to CronOutput format
13
13
  * @param rawData - The raw data from the gRPC response
14
14
  * @returns {CronTriggerOutput | undefined} - The converted data
15
15
  */
16
16
  getOutput(): CronTriggerOutput | undefined;
17
+ /**
18
+ * Extract output data from RunTriggerResp for cron triggers
19
+ * Updated to handle timestamp and timestamp_iso instead of epoch
20
+ * @param outputData - The RunTriggerResp containing cron trigger output
21
+ * @returns Plain JavaScript object with cron trigger data
22
+ */
23
+ static fromOutputData(outputData: avs_pb.RunTriggerResp): any;
17
24
  }
18
25
  export default CronTrigger;
19
26
  //# sourceMappingURL=cron.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cron.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/cron.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,OAAO,EAAE,EAAiB,YAAY,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAe,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAGzF,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG;IAAE,IAAI,EAAE,mBAAmB,CAAA;CAAE,CAAC;AAE5E,cAAM,WAAY,SAAQ,OAAO;gBACnB,KAAK,EAAE,gBAAgB;IAInC,SAAS,IAAI,MAAM,CAAC,WAAW;IAmB/B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,GAAG,WAAW;IAuBzD;;;;OAIG;IACH,SAAS,IAAI,iBAAiB,GAAG,SAAS;CAG3C;AAED,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"cron.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/cron.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,OAAO,EAAE,EAAiB,YAAY,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAe,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAGzF,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG;IAAE,IAAI,EAAE,mBAAmB,CAAA;CAAE,CAAC;AAE5E,cAAM,WAAY,SAAQ,OAAO;gBACnB,KAAK,EAAE,gBAAgB;IAInC,SAAS,IAAI,MAAM,CAAC,WAAW;IAmB/B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,GAAG,WAAW;IAuBzD;;;;OAIG;IACH,SAAS,IAAI,iBAAiB,GAAG,SAAS;IAI1C;;;;;OAKG;IACH,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,cAAc,GAAG,GAAG;CAW9D;AAED,eAAe,WAAW,CAAC"}
@@ -38,12 +38,29 @@ class CronTrigger extends Trigger {
38
38
  });
39
39
  }
40
40
  /**
41
- * Convert raw data from runNodeWithInputs response to CronOutput format
41
+ * Convert raw data from runTrigger response to CronOutput format
42
42
  * @param rawData - The raw data from the gRPC response
43
43
  * @returns {CronTriggerOutput | undefined} - The converted data
44
44
  */
45
45
  getOutput() {
46
46
  return this.output;
47
47
  }
48
+ /**
49
+ * Extract output data from RunTriggerResp for cron triggers
50
+ * Updated to handle timestamp and timestamp_iso instead of epoch
51
+ * @param outputData - The RunTriggerResp containing cron trigger output
52
+ * @returns Plain JavaScript object with cron trigger data
53
+ */
54
+ static fromOutputData(outputData) {
55
+ const cronOutput = outputData.getCronTrigger();
56
+ if (!cronOutput)
57
+ return null;
58
+ const outputObj = cronOutput.toObject();
59
+ // The output now contains timestamp and timestampIso instead of epoch
60
+ return {
61
+ timestamp: outputObj.timestamp,
62
+ timestampIso: outputObj.timestampIso
63
+ };
64
+ }
48
65
  }
49
66
  export default CronTrigger;
@@ -9,11 +9,17 @@ declare class EventTrigger extends Trigger {
9
9
  toRequest(): avs_pb.TaskTrigger;
10
10
  static fromResponse(raw: avs_pb.TaskTrigger): EventTrigger;
11
11
  /**
12
- * Convert raw data from runNodeWithInputs response to EventOutput format
12
+ * Convert raw data from runTrigger response to EventOutput format
13
13
  * @param rawData - The raw data from the gRPC response
14
14
  * @returns {EventTriggerOutput | undefined} - The converted data
15
15
  */
16
16
  getOutput(): EventTriggerOutput | undefined;
17
+ /**
18
+ * Extract output data from RunTriggerResp for event triggers
19
+ * @param outputData - The RunTriggerResp containing event trigger output
20
+ * @returns Plain JavaScript object with event trigger data
21
+ */
22
+ static fromOutputData(outputData: avs_pb.RunTriggerResp): any;
17
23
  }
18
24
  export default EventTrigger;
19
25
  //# sourceMappingURL=event.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/event.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,OAAO,EAAE,EAAiB,YAAY,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAe,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAsB3F,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG;IAAE,IAAI,EAAE,oBAAoB,CAAA;CAAE,CAAC;AAE9E,cAAM,YAAa,SAAQ,OAAO;gBACpB,KAAK,EAAE,iBAAiB;IAIpC,SAAS,IAAI,MAAM,CAAC,WAAW;IAwC/B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,GAAG,YAAY;IAiC1D;;;;OAIG;IACH,SAAS,IAAI,kBAAkB,GAAG,SAAS;CAG5C;AAED,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/event.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,OAAO,EAAE,EAAiB,YAAY,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAe,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAsB3F,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG;IAAE,IAAI,EAAE,oBAAoB,CAAA;CAAE,CAAC;AAE9E,cAAM,YAAa,SAAQ,OAAO;gBACpB,KAAK,EAAE,iBAAiB;IAIpC,SAAS,IAAI,MAAM,CAAC,WAAW;IAwC/B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,GAAG,YAAY;IAiC1D;;;;OAIG;IACH,SAAS,IAAI,kBAAkB,GAAG,SAAS;IAI3C;;;;OAIG;IACH,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,cAAc,GAAG,GAAG;CAI9D;AAED,eAAe,YAAY,CAAC"}
@@ -63,12 +63,21 @@ class EventTrigger extends Trigger {
63
63
  });
64
64
  }
65
65
  /**
66
- * Convert raw data from runNodeWithInputs response to EventOutput format
66
+ * Convert raw data from runTrigger response to EventOutput format
67
67
  * @param rawData - The raw data from the gRPC response
68
68
  * @returns {EventTriggerOutput | undefined} - The converted data
69
69
  */
70
70
  getOutput() {
71
71
  return this.output;
72
72
  }
73
+ /**
74
+ * Extract output data from RunTriggerResp for event triggers
75
+ * @param outputData - The RunTriggerResp containing event trigger output
76
+ * @returns Plain JavaScript object with event trigger data
77
+ */
78
+ static fromOutputData(outputData) {
79
+ const eventOutput = outputData.getEventTrigger();
80
+ return eventOutput?.toObject() || null;
81
+ }
73
82
  }
74
83
  export default EventTrigger;