@avaprotocol/sdk-js 2.5.2-dev.0 → 2.6.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.
Files changed (44) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +598 -1599
  4. package/dist/index.mjs +613 -1602
  5. package/dist/models/node/branch.d.ts.map +1 -1
  6. package/dist/models/node/branch.js +2 -11
  7. package/dist/models/node/contractRead.d.ts.map +1 -1
  8. package/dist/models/node/contractRead.js +1 -14
  9. package/dist/models/node/contractWrite.d.ts +1 -1
  10. package/dist/models/node/contractWrite.d.ts.map +1 -1
  11. package/dist/models/node/contractWrite.js +0 -14
  12. package/dist/models/node/customCode.d.ts.map +1 -1
  13. package/dist/models/node/customCode.js +1 -14
  14. package/dist/models/node/ethTransfer.d.ts.map +1 -1
  15. package/dist/models/node/ethTransfer.js +6 -11
  16. package/dist/models/node/filter.d.ts.map +1 -1
  17. package/dist/models/node/filter.js +20 -18
  18. package/dist/models/node/graphqlQuery.d.ts.map +1 -1
  19. package/dist/models/node/graphqlQuery.js +5 -11
  20. package/dist/models/node/interface.d.ts +0 -1
  21. package/dist/models/node/interface.d.ts.map +1 -1
  22. package/dist/models/node/interface.js +0 -8
  23. package/dist/models/node/loop.d.ts.map +1 -1
  24. package/dist/models/node/loop.js +58 -85
  25. package/dist/models/node/restApi.d.ts.map +1 -1
  26. package/dist/models/node/restApi.js +1 -15
  27. package/dist/models/step.d.ts +3 -1
  28. package/dist/models/step.d.ts.map +1 -1
  29. package/dist/models/step.js +104 -365
  30. package/dist/models/trigger/block.d.ts.map +1 -1
  31. package/dist/models/trigger/block.js +18 -20
  32. package/dist/models/trigger/cron.d.ts.map +1 -1
  33. package/dist/models/trigger/cron.js +9 -28
  34. package/dist/models/trigger/event.d.ts.map +1 -1
  35. package/dist/models/trigger/event.js +1 -12
  36. package/dist/models/trigger/fixedTime.d.ts.map +1 -1
  37. package/dist/models/trigger/fixedTime.js +9 -20
  38. package/dist/models/trigger/interface.d.ts +1 -1
  39. package/dist/models/trigger/interface.d.ts.map +1 -1
  40. package/dist/models/trigger/interface.js +7 -2
  41. package/dist/models/trigger/manual.d.ts +0 -3
  42. package/dist/models/trigger/manual.d.ts.map +1 -1
  43. package/dist/models/trigger/manual.js +35 -44
  44. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"branch.d.ts","sourceRoot":"","sources":["../../../src/models/node/branch.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,eAAe,EAAa,MAAM,oBAAoB,CAAC;AAC1F,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAMhD,cAAM,UAAW,SAAQ,IAAI;gBACf,KAAK,EAAE,eAAe;IAIlC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,UAAU;IAyBrD,SAAS,IAAI,MAAM,CAAC,QAAQ;IAsC5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAMrE;AACD,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"branch.d.ts","sourceRoot":"","sources":["../../../src/models/node/branch.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,eAAe,EAEhB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAKhD,cAAM,UAAW,SAAQ,IAAI;gBACf,KAAK,EAAE,eAAe;IAIlC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,UAAU;IAsBrD,SAAS,IAAI,MAAM,CAAC,QAAQ;IAiC5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAMrE;AACD,eAAe,UAAU,CAAC"}
@@ -1,7 +1,6 @@
1
- import { NodeType } from "@avaprotocol/types";
1
+ import { NodeType, } from "@avaprotocol/types";
2
2
  import Node from "./interface";
3
3
  import * as avs_pb from "@/grpc_codegen/avs_pb";
4
- import { convertInputToProtobuf, extractInputFromProtobuf } from "../../utils";
5
4
  // Required props for constructor: id, name, type and data: { conditions }
6
5
  class BranchNode extends Node {
7
6
  constructor(props) {
@@ -13,19 +12,16 @@ class BranchNode extends Node {
13
12
  const protobufData = raw.getBranch().toObject().config;
14
13
  // Convert protobuf data to our custom interface
15
14
  const data = {
16
- conditions: protobufData?.conditionsList?.map(condition => ({
15
+ conditions: protobufData?.conditionsList?.map((condition) => ({
17
16
  id: condition.id,
18
17
  type: condition.type,
19
18
  expression: condition.expression,
20
19
  })) || [],
21
20
  };
22
- // Extract input data if present
23
- const input = extractInputFromProtobuf(raw.getBranch()?.getInput());
24
21
  return new BranchNode({
25
22
  ...obj,
26
23
  type: NodeType.Branch,
27
24
  data: data,
28
- input: input,
29
25
  });
30
26
  }
31
27
  toRequest() {
@@ -46,11 +42,6 @@ class BranchNode extends Node {
46
42
  config.setConditionsList(conditionsList);
47
43
  }
48
44
  node.setConfig(config);
49
- // Set input data if provided
50
- const inputValue = convertInputToProtobuf(this.input);
51
- if (inputValue) {
52
- node.setInput(inputValue);
53
- }
54
45
  request.setBranch(node);
55
46
  return request;
56
47
  }
@@ -1 +1 @@
1
- {"version":3,"file":"contractRead.d.ts","sourceRoot":"","sources":["../../../src/models/node/contractRead.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAGL,qBAAqB,EAEtB,MAAM,oBAAoB,CAAC;AAS5B,cAAM,gBAAiB,SAAQ,IAAI;gBACrB,KAAK,EAAE,qBAAqB;IAIxC;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE;QACpC,eAAe,EAAE,MAAM,CAAC;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qB,GAAG,GAAG;CAyBrE;AAED,eAAe,gBAAgB,CAAC"}
@@ -1,7 +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, convertInputToProtobuf, extractInputFromProtobuf, } from "../../utils";
4
+ import { convertProtobufValueToJs, } from "../../utils";
5
5
  // Required props for constructor: id, name, type and data
6
6
  class ContractReadNode extends Node {
7
7
  constructor(props) {
@@ -47,17 +47,10 @@ class ContractReadNode extends Node {
47
47
  applyToFields: call.applyToFieldsList || [],
48
48
  })) || [],
49
49
  };
50
- // Extract input data from top-level TaskNode.input field (not nested ContractReadNode.input)
51
- // This matches where we set it in toRequest() and where the Go backend looks for it
52
- let input = undefined;
53
- if (raw.hasInput()) {
54
- input = extractInputFromProtobuf(raw.getInput());
55
- }
56
50
  return new ContractReadNode({
57
51
  ...obj,
58
52
  type: NodeType.ContractRead,
59
53
  data: data,
60
- input: input,
61
54
  });
62
55
  }
63
56
  toRequest() {
@@ -65,12 +58,6 @@ class ContractReadNode extends Node {
65
58
  request.setId(this.id);
66
59
  request.setName(this.name);
67
60
  const node = ContractReadNode.createProtobufNode(this.data);
68
- // Set input data on the top-level TaskNode, not the nested ContractReadNode
69
- // This matches where the Go backend's ExtractNodeInputData() looks for it
70
- const inputValue = convertInputToProtobuf(this.input);
71
- if (inputValue) {
72
- request.setInput(inputValue);
73
- }
74
61
  request.setContractRead(node);
75
62
  return request;
76
63
  }
@@ -19,7 +19,7 @@ declare class ContractWriteNode extends Node {
19
19
  }): avs_pb.ContractWriteNode;
20
20
  static fromResponse(raw: avs_pb.TaskNode): ContractWriteNode;
21
21
  toRequest(): avs_pb.TaskNode;
22
- static fromOutputData(outputData: avs_pb.RunNodeWithInputsResp): any;
22
+ static fromOutputData(outputData: avs_pb.RunNodeWithInputsResp): unknown[] | null;
23
23
  }
24
24
  export default ContractWriteNode;
25
25
  //# 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,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAGL,sBAAsB,EAEvB,MAAM,oBAAoB,CAAC;AAM5B,cAAM,iBAAkB,SAAQ,IAAI;gBACtB,KAAK,EAAE,sBAAsB;IAIzC;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE;QACpC,eAAe,EAAE,MAAM,CAAC;QACxB,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,CAAC,EAAE,KAAK,CAAC;YAClB,QAAQ,EAAE,MAAM,CAAC;YACjB,UAAU,CAAC,EAAE,MAAM,CAAC;SACrB,CAAC,CAAC;KACJ,GAAG,MAAM,CAAC,iBAAiB;IAuB5B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,iBAAiB;IAgC5D,SAAS,IAAI,MAAM,CAAC,QAAQ;IAsB5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAcrE;AAED,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"contractWrite.d.ts","sourceRoot":"","sources":["../../../src/models/node/contractWrite.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAGL,sBAAsB,EAEvB,MAAM,oBAAoB,CAAC;AAK5B,cAAM,iBAAkB,SAAQ,IAAI;gBACtB,KAAK,EAAE,sBAAsB;IAIzC;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE;QACpC,eAAe,EAAE,MAAM,CAAC;QACxB,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,CAAC,EAAE,KAAK,CAAC;YAClB,QAAQ,EAAE,MAAM,CAAC;YACjB,UAAU,CAAC,EAAE,MAAM,CAAC;SACrB,CAAC,CAAC;KACJ,GAAG,MAAM,CAAC,iBAAiB;IAuB5B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,iBAAiB;IAwB5D,SAAS,IAAI,MAAM,CAAC,QAAQ;IAe5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,OAAO,EAAE,GAAG,IAAI;CAclF;AAED,eAAe,iBAAiB,CAAC"}
@@ -1,7 +1,6 @@
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 { convertInputToProtobuf, extractInputFromProtobuf } from "../../utils";
5
4
  import { convertProtobufValueToJs } from "../../utils";
6
5
  // Required props for constructor: id, name, type and data: { config: { contractAddress, callData, contractAbi, methodCallsList? } }
7
6
  class ContractWriteNode extends Node {
@@ -46,17 +45,10 @@ class ContractWriteNode extends Node {
46
45
  methodName: call.methodName,
47
46
  })) || [],
48
47
  };
49
- // Extract input data from top-level TaskNode.input field (not nested ContractWriteNode.input)
50
- // This matches where we set it in toRequest() and where the Go backend looks for it
51
- let input = undefined;
52
- if (raw.hasInput()) {
53
- input = extractInputFromProtobuf(raw.getInput());
54
- }
55
48
  return new ContractWriteNode({
56
49
  ...obj,
57
50
  type: NodeType.ContractWrite,
58
51
  data: data,
59
- input: input,
60
52
  });
61
53
  }
62
54
  toRequest() {
@@ -64,12 +56,6 @@ class ContractWriteNode extends Node {
64
56
  request.setId(this.id);
65
57
  request.setName(this.name);
66
58
  const node = ContractWriteNode.createProtobufNode(this.data);
67
- // Set input data on the top-level TaskNode, not the nested ContractWriteNode
68
- // This matches where the Go backend's ExtractNodeInputData() looks for it
69
- const inputValue = convertInputToProtobuf(this.input);
70
- if (inputValue) {
71
- request.setInput(inputValue);
72
- }
73
59
  request.setContractWrite(node);
74
60
  return request;
75
61
  }
@@ -1 +1 @@
1
- {"version":3,"file":"customCode.d.ts","sourceRoot":"","sources":["../../../src/models/node/customCode.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAGL,cAAc,EACd,mBAAmB,EAEpB,MAAM,oBAAoB,CAAC;AAS5B,cAAM,cAAe,SAAQ,IAAI;gBACnB,KAAK,EAAE,mBAAmB;IAItC;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE;QACpC,IAAI,EAAE,cAAc,GAAG,MAAM,GAAG,MAAM,CAAC;QACvC,MAAM,EAAE,MAAM,CAAC;KAChB,GAAG,MAAM,CAAC,cAAc;IAYzB,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,cAAc;IA2BzD,SAAS,IAAI,MAAM,CAAC,QAAQ;IAsB5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAqBrE;AAED,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"customCode.d.ts","sourceRoot":"","sources":["../../../src/models/node/customCode.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAGL,cAAc,EACd,mBAAmB,EAEpB,MAAM,oBAAoB,CAAC;AAS5B,cAAM,cAAe,SAAQ,IAAI;gBACnB,KAAK,EAAE,mBAAmB;IAItC;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE;QACpC,IAAI,EAAE,cAAc,GAAG,MAAM,GAAG,MAAM,CAAC;QACvC,MAAM,EAAE,MAAM,CAAC;KAChB,GAAG,MAAM,CAAC,cAAc;IAYzB,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,cAAc;IAmBzD,SAAS,IAAI,MAAM,CAAC,QAAQ;IAe5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAqBrE;AAED,eAAe,cAAc,CAAC"}
@@ -1,7 +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, convertInputToProtobuf, extractInputFromProtobuf, } from "../../utils";
4
+ import { convertProtobufValueToJs, } from "../../utils";
5
5
  // Required props for constructor: id, name, type and data: { lang: number, source: string }
6
6
  class CustomCodeNode extends Node {
7
7
  constructor(props) {
@@ -30,17 +30,10 @@ class CustomCodeNode extends Node {
30
30
  lang: rawConfig.lang,
31
31
  source: rawConfig.source,
32
32
  };
33
- // Extract input data from top-level TaskNode.input field (not nested CustomCodeNode.input)
34
- // This matches where we set it in toRequest() and where the Go backend looks for it
35
- let input = undefined;
36
- if (raw.hasInput()) {
37
- input = extractInputFromProtobuf(raw.getInput());
38
- }
39
33
  return new CustomCodeNode({
40
34
  ...obj,
41
35
  type: NodeType.CustomCode,
42
36
  data: convertedConfig,
43
- input: input,
44
37
  });
45
38
  }
46
39
  toRequest() {
@@ -48,12 +41,6 @@ class CustomCodeNode extends Node {
48
41
  request.setId(this.id);
49
42
  request.setName(this.name);
50
43
  const node = CustomCodeNode.createProtobufNode(this.data);
51
- // Set input data on the top-level TaskNode, not the nested CustomCodeNode
52
- // This matches where the Go backend's ExtractNodeInputData() looks for it
53
- const inputValue = convertInputToProtobuf(this.input);
54
- if (inputValue) {
55
- request.setInput(inputValue);
56
- }
57
44
  request.setCustomCode(node);
58
45
  return request;
59
46
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ethTransfer.d.ts","sourceRoot":"","sources":["../../../src/models/node/ethTransfer.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAiC,oBAAoB,EAAa,MAAM,oBAAoB,CAAC;AAMpG,cAAM,eAAgB,SAAQ,IAAI;gBACpB,KAAK,EAAE,oBAAoB;IAIvC;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE;QACpC,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;KAChB,GAAG,MAAM,CAAC,eAAe;IAW1B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,eAAe;IAe1D,SAAS,IAAI,MAAM,CAAC,QAAQ;IAqB5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAIrE;AAED,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"ethTransfer.d.ts","sourceRoot":"","sources":["../../../src/models/node/ethTransfer.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAGL,oBAAoB,EAErB,MAAM,oBAAoB,CAAC;AAK5B,cAAM,eAAgB,SAAQ,IAAI;gBACpB,KAAK,EAAE,oBAAoB;IAIvC;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE;QACpC,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;KAChB,GAAG,MAAM,CAAC,eAAe;IAW1B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,eAAe;IAgB1D,SAAS,IAAI,MAAM,CAAC,QAAQ;IAe5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAIrE;AAED,eAAe,eAAe,CAAC"}
@@ -1,7 +1,6 @@
1
1
  import Node from "./interface";
2
2
  import * as avs_pb from "@/grpc_codegen/avs_pb";
3
- import { NodeType } from "@avaprotocol/types";
4
- import { convertInputToProtobuf, extractInputFromProtobuf } from "../../utils";
3
+ import { NodeType, } from "@avaprotocol/types";
5
4
  // Required props for constructor: id, name, type and data: { destination, amount }
6
5
  class ETHTransferNode extends Node {
7
6
  constructor(props) {
@@ -23,13 +22,14 @@ class ETHTransferNode extends Node {
23
22
  static fromResponse(raw) {
24
23
  // Convert the raw object to ETHTransferNodeProps, which should keep name and id
25
24
  const obj = raw.toObject();
26
- // Extract input data if present
27
- const input = extractInputFromProtobuf(raw.getEthTransfer()?.getInput());
25
+ const data = raw
26
+ .getEthTransfer()
27
+ .getConfig()
28
+ .toObject();
28
29
  return new ETHTransferNode({
29
30
  ...obj,
30
31
  type: NodeType.ETHTransfer,
31
- data: raw.getEthTransfer().getConfig().toObject(),
32
- input: input,
32
+ data: data,
33
33
  });
34
34
  }
35
35
  toRequest() {
@@ -37,11 +37,6 @@ class ETHTransferNode extends Node {
37
37
  request.setId(this.id);
38
38
  request.setName(this.name);
39
39
  const node = ETHTransferNode.createProtobufNode(this.data);
40
- // Set input data if provided
41
- const inputValue = convertInputToProtobuf(this.input);
42
- if (inputValue) {
43
- node.setInput(inputValue);
44
- }
45
40
  request.setEthTransfer(node);
46
41
  return request;
47
42
  }
@@ -1 +1 @@
1
- {"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../../src/models/node/filter.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAGL,eAAe,EAEhB,MAAM,oBAAoB,CAAC;AAM5B,cAAM,UAAW,SAAQ,IAAI;gBACf,KAAK,EAAE,eAAe;IAIlC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,UAAU;IAerD,SAAS,IAAI,MAAM,CAAC,QAAQ;IAuB5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAgCrE;AAED,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../../src/models/node/filter.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAGL,eAAe,EAEhB,MAAM,oBAAoB,CAAC;AAM5B,cAAM,UAAW,SAAQ,IAAI;gBACf,KAAK,EAAE,eAAe;IAIlC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,UAAU;IAWrD,SAAS,IAAI,MAAM,CAAC,QAAQ;IAiB5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CA+CrE;AAED,eAAe,UAAU,CAAC"}
@@ -1,9 +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 { convertInputToProtobuf, extractInputFromProtobuf } from "../../utils";
5
- import { Value } from "google-protobuf/google/protobuf/struct_pb";
6
- // Required props for constructor: id, name, type and data: { expression, sourceId }
4
+ // Required props for constructor: id, name, type and data: { expression, inputNodeName }
7
5
  class FilterNode extends Node {
8
6
  constructor(props) {
9
7
  super({ ...props, type: NodeType.Filter, data: props.data });
@@ -11,13 +9,10 @@ class FilterNode extends Node {
11
9
  static fromResponse(raw) {
12
10
  // Convert the raw object to FilterNodeProps, which should keep name and id
13
11
  const obj = raw.toObject();
14
- // Extract input data if present
15
- const input = extractInputFromProtobuf(raw.getFilter()?.getInput());
16
12
  return new FilterNode({
17
13
  ...obj,
18
14
  type: NodeType.Filter,
19
15
  data: raw.getFilter().getConfig().toObject(),
20
- input: input,
21
16
  });
22
17
  }
23
18
  toRequest() {
@@ -27,13 +22,8 @@ class FilterNode extends Node {
27
22
  const node = new avs_pb.FilterNode();
28
23
  const config = new avs_pb.FilterNode.Config();
29
24
  config.setExpression(this.data.expression);
30
- config.setSourceId(this.data.sourceId || "");
25
+ config.setInputNodeName(this.data.inputNodeName || "");
31
26
  node.setConfig(config);
32
- // Set input data if provided
33
- const inputValue = convertInputToProtobuf(this.input);
34
- if (inputValue) {
35
- node.setInput(inputValue);
36
- }
37
27
  request.setFilter(node);
38
28
  return request;
39
29
  }
@@ -46,17 +36,29 @@ class FilterNode extends Node {
46
36
  if (!anyData) {
47
37
  throw new Error("FilterNode output data.getData() is missing");
48
38
  }
49
- // Unpack the Any to get the Value
50
- const value = Value.deserializeBinary(anyData.getValue_asU8());
51
- // Convert the Value to JavaScript
52
- const result = value.toJavaScript();
53
- // The result contains the entire response object, extract the data array
39
+ // The data is now directly a Value, not wrapped in Any
40
+ const result = anyData.toJavaScript();
41
+ // The result contains nested data structure, extract the actual array
42
+ if (result &&
43
+ typeof result === "object" &&
44
+ !Array.isArray(result) &&
45
+ result.data &&
46
+ result.data.data &&
47
+ Array.isArray(result.data.data)) {
48
+ return result.data.data;
49
+ }
50
+ // If result.data is already an array, return it directly
54
51
  if (result &&
55
52
  typeof result === "object" &&
56
53
  !Array.isArray(result) &&
57
- result.data) {
54
+ result.data &&
55
+ Array.isArray(result.data)) {
58
56
  return result.data;
59
57
  }
58
+ // If result is already an array, return it directly
59
+ if (Array.isArray(result)) {
60
+ return result;
61
+ }
60
62
  throw new Error("FilterNode output data does not contain expected data structure");
61
63
  }
62
64
  }
@@ -1 +1 @@
1
- {"version":3,"file":"graphqlQuery.d.ts","sourceRoot":"","sources":["../../../src/models/node/graphqlQuery.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAkC,qBAAqB,E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,qBAAqB,GAAG,GAAG;CAIrE;AAED,eAAe,gBAAgB,CAAC"}
@@ -1,7 +1,6 @@
1
1
  import Node from "./interface";
2
2
  import * as avs_pb from "@/grpc_codegen/avs_pb";
3
- import { NodeType } from "@avaprotocol/types";
4
- import { convertInputToProtobuf, extractInputFromProtobuf } from "../../utils";
3
+ import { NodeType, } from "@avaprotocol/types";
5
4
  // Required props for constructor: id, name, type and data: { url, query, variablesMap }
6
5
  class GraphQLQueryNode extends Node {
7
6
  constructor(props) {
@@ -33,13 +32,13 @@ class GraphQLQueryNode extends Node {
33
32
  static fromResponse(raw) {
34
33
  // Convert the raw object to GraphQLQueryNodeProps, which should keep name and id
35
34
  const obj = raw.toObject();
36
- // Extract input data if present
37
- const input = extractInputFromProtobuf(raw.getGraphqlQuery()?.getInput());
38
35
  return new GraphQLQueryNode({
39
36
  ...obj,
40
37
  type: NodeType.GraphQLQuery,
41
- data: raw.getGraphqlQuery().getConfig().toObject(),
42
- input: input,
38
+ data: raw
39
+ .getGraphqlQuery()
40
+ .getConfig()
41
+ .toObject(),
43
42
  });
44
43
  }
45
44
  toRequest() {
@@ -47,11 +46,6 @@ class GraphQLQueryNode extends Node {
47
46
  request.setId(this.id);
48
47
  request.setName(this.name);
49
48
  const node = GraphQLQueryNode.createProtobufNode(this.data);
50
- // Set input data if provided
51
- const inputValue = convertInputToProtobuf(this.input);
52
- if (inputValue) {
53
- node.setInput(inputValue);
54
- }
55
49
  request.setGraphqlQuery(node);
56
50
  return request;
57
51
  }
@@ -13,7 +13,6 @@ export default abstract class Node implements NodeProps {
13
13
  name: string;
14
14
  type: NodeType;
15
15
  data: NodeData;
16
- input?: Record<string, any>;
17
16
  constructor(props: NodeProps);
18
17
  toRequest(): avs_pb.TaskNode;
19
18
  static fromResponse(raw: avs_pb.TaskNode): Node;
@@ -1 +1 @@
1
- {"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../src/models/node/interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,M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AY,GACnC,QAAQ,CAeV;AAGD,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,MAAM,CAAC,QAAQ,CAAC,QAAQ,EACtB,aAAa,GACb,eAAe,GACf,cAAc,GACd,kBAAkB,GAClB,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,YAAY,CACf,GAAG;IAEF,IAAI,EAAE,GAAG,CAAC;CACX,CAAC;AAGF,eAAO,MAAM,sBAAsB;6BAER,iBAAiB,KAAG,MAAM;qCAKlB,MAAM,aAAa,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,KAAG,iBAAiB;CAMxG,CAAC;AAEF,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,IAAK,YAAW,SAAS;IACrD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,QAAQ,CAAC;gBAGH,KAAK,EAAE,SAAS;IAO5B,SAAS,IAAI,MAAM,CAAC,QAAQ;IAW5B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,IAAI;CAQhD"}
@@ -37,8 +37,6 @@ export default class Node {
37
37
  this.name = props.name;
38
38
  this.type = props.type;
39
39
  this.data = props.data;
40
- // Direct assignment - no protobuf conversion needed for user input
41
- this.input = props.input;
42
40
  }
43
41
  toRequest() {
44
42
  const request = new avs_pb.TaskNode();
@@ -52,14 +50,8 @@ export default class Node {
52
50
  static fromResponse(raw) {
53
51
  // Convert the raw object to NodeProps, which should keep name and id
54
52
  const obj = raw.toObject();
55
- // Extract input data using the utility function
56
- let input = undefined;
57
- if (raw.hasInput()) {
58
- input = raw.getInput().toObject();
59
- }
60
53
  return new this({
61
54
  ...obj,
62
- input: input,
63
55
  });
64
56
  }
65
57
  }
@@ -1 +1 @@
1
- {"version":3,"file":"loop.d.ts","sourceRoot":"","sources":["../../../src/models/node/loop.ts"],"names":[],"mappings":"AAAA,OA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ractReadNode from "./contractRead";
8
8
  import ContractWriteNode from "./contractWrite";
9
9
  import { NodeType, ExecutionMode, } from "@avaprotocol/types";
10
- import { convertInputToProtobuf, extractInputFromProtobuf } from "../../utils";
11
10
  class LoopNode extends Node {
12
11
  constructor(props) {
13
12
  super({ ...props, type: NodeType.Loop, data: props.data });
@@ -30,17 +29,10 @@ class LoopNode extends Node {
30
29
  // Map execution mode from protobuf enum to ExecutionMode enum
31
30
  executionMode: this.mapExecutionModeFromProtobuf(configData?.executionMode),
32
31
  };
33
- // Extract input data from top-level TaskNode.input field (not nested LoopNode.input)
34
- // This matches where we set it in toRequest() and where the Go backend looks for it
35
- let input = undefined;
36
- if (raw.hasInput()) {
37
- input = extractInputFromProtobuf(raw.getInput());
38
- }
39
32
  return new LoopNode({
40
33
  ...obj,
41
34
  type: NodeType.Loop,
42
35
  data: data,
43
- input: input,
44
36
  });
45
37
  }
46
38
  static extractRunnerFromProtobuf(loopNodeData) {
@@ -106,19 +98,13 @@ class LoopNode extends Node {
106
98
  const data = this.data;
107
99
  // Set the loop config from the flat data structure
108
100
  const config = new avs_pb.LoopNode.Config();
109
- config.setSourceId(data.sourceId || "");
101
+ config.setInputNodeName(data.inputNodeName || "");
110
102
  config.setIterVal(data.iterVal || "");
111
103
  config.setIterKey(data.iterKey || "");
112
104
  // Set execution mode - map ExecutionMode enum to protobuf enum
113
105
  const executionMode = this.mapExecutionModeToProtobuf(data.executionMode);
114
106
  config.setExecutionMode(executionMode);
115
107
  loopNode.setConfig(config);
116
- // Set input data on the top-level TaskNode, not the nested LoopNode
117
- // This matches where the Go backend's ExtractNodeInputData() looks for it
118
- const inputValue = convertInputToProtobuf(this.input);
119
- if (inputValue) {
120
- node.setInput(inputValue);
121
- }
122
108
  // Handle runner - check the runner field and set the appropriate oneof field
123
109
  if (data.runner) {
124
110
  this.setRunnerOnProtobuf(loopNode, data.runner);
@@ -127,86 +113,73 @@ class LoopNode extends Node {
127
113
  return node;
128
114
  }
129
115
  setRunnerOnProtobuf(loopNode, runner) {
130
- if (!runner || !runner.type || !runner.data) {
116
+ if (!runner || !runner.type) {
117
+ return;
118
+ }
119
+ // Support both old structure (runner.data.config) and new structure (runner.config)
120
+ const config = runner.config || (runner.data && runner.data.config);
121
+ if (!config) {
131
122
  return;
132
123
  }
133
124
  switch (runner.type) {
134
125
  case "ethTransfer": {
135
- const ethTransferData = runner.data;
136
- if (ethTransferData.config) {
137
- const ethConfig = ethTransferData.config;
138
- const ethTransfer = ETHTransferNode.createProtobufNode({
139
- destination: ethConfig.destination,
140
- amount: ethConfig.amount,
141
- });
142
- loopNode.setEthTransfer(ethTransfer);
143
- }
126
+ const ethConfig = config;
127
+ const ethTransfer = ETHTransferNode.createProtobufNode({
128
+ destination: ethConfig.destination,
129
+ amount: ethConfig.amount,
130
+ });
131
+ loopNode.setEthTransfer(ethTransfer);
144
132
  break;
145
133
  }
146
134
  case "contractWrite": {
147
- const contractWriteData = runner.data;
148
- if (contractWriteData.config) {
149
- const writeConfig = contractWriteData.config;
150
- const contractWrite = ContractWriteNode.createProtobufNode({
151
- contractAddress: writeConfig.contractAddress,
152
- callData: writeConfig.callData,
153
- contractAbi: writeConfig.contractAbi,
154
- methodCalls: writeConfig.methodCallsList || [],
155
- });
156
- loopNode.setContractWrite(contractWrite);
157
- }
135
+ const writeConfig = config;
136
+ const contractWrite = ContractWriteNode.createProtobufNode({
137
+ contractAddress: writeConfig.contractAddress,
138
+ callData: writeConfig.callData,
139
+ contractAbi: writeConfig.contractAbi,
140
+ methodCalls: writeConfig.methodCallsList || [],
141
+ });
142
+ loopNode.setContractWrite(contractWrite);
158
143
  break;
159
144
  }
160
145
  case "contractRead": {
161
- const contractReadData = runner.data;
162
- if (contractReadData.config) {
163
- const readConfig = contractReadData.config;
164
- const contractRead = ContractReadNode.createProtobufNode({
165
- contractAddress: readConfig.contractAddress,
166
- contractAbi: readConfig.contractAbi,
167
- methodCalls: readConfig.methodCallsList || [],
168
- });
169
- loopNode.setContractRead(contractRead);
170
- }
146
+ const readConfig = config;
147
+ const contractRead = ContractReadNode.createProtobufNode({
148
+ contractAddress: readConfig.contractAddress,
149
+ contractAbi: readConfig.contractAbi,
150
+ methodCalls: readConfig.methodCallsList || [],
151
+ });
152
+ loopNode.setContractRead(contractRead);
171
153
  break;
172
154
  }
173
155
  case "graphqlDataQuery": {
174
- const graphqlData = runner.data;
175
- if (graphqlData.config) {
176
- const gqlConfig = graphqlData.config;
177
- const graphqlQuery = GraphQLQueryNode.createProtobufNode({
178
- url: gqlConfig.url,
179
- query: gqlConfig.query,
180
- variablesMap: gqlConfig.variablesMap,
181
- });
182
- loopNode.setGraphqlDataQuery(graphqlQuery);
183
- }
156
+ const gqlConfig = config;
157
+ const graphqlQuery = GraphQLQueryNode.createProtobufNode({
158
+ url: gqlConfig.url,
159
+ query: gqlConfig.query,
160
+ variablesMap: gqlConfig.variablesMap,
161
+ });
162
+ loopNode.setGraphqlDataQuery(graphqlQuery);
184
163
  break;
185
164
  }
186
165
  case "restApi": {
187
- const restApiData = runner.data;
188
- if (restApiData.config) {
189
- const apiConfig = restApiData.config;
190
- const restApi = RestAPINode.createProtobufNode({
191
- url: apiConfig.url,
192
- method: apiConfig.method,
193
- body: apiConfig.body || "",
194
- headers: apiConfig.headers,
195
- });
196
- loopNode.setRestApi(restApi);
197
- }
166
+ const apiConfig = config;
167
+ const restApi = RestAPINode.createProtobufNode({
168
+ url: apiConfig.url,
169
+ method: apiConfig.method,
170
+ body: apiConfig.body || "",
171
+ headers: apiConfig.headers,
172
+ });
173
+ loopNode.setRestApi(restApi);
198
174
  break;
199
175
  }
200
176
  case "customCode": {
201
- const customCodeData = runner.data;
202
- if (customCodeData.config) {
203
- const codeConfig = customCodeData.config;
204
- const customCode = CustomCodeNode.createProtobufNode({
205
- lang: codeConfig.lang,
206
- source: codeConfig.source,
207
- });
208
- loopNode.setCustomCode(customCode);
209
- }
177
+ const codeConfig = config;
178
+ const customCode = CustomCodeNode.createProtobufNode({
179
+ lang: codeConfig.lang,
180
+ source: codeConfig.source,
181
+ });
182
+ loopNode.setCustomCode(customCode);
210
183
  break;
211
184
  }
212
185
  }
@@ -225,21 +198,21 @@ class LoopNode extends Node {
225
198
  }
226
199
  return result;
227
200
  }
228
- // For workflow execution, data comes as Loop format with JSON string
201
+ // For workflow execution, data comes as Loop format with new protobuf Value
229
202
  const loopOutput = outputData.getLoop();
230
203
  if (loopOutput) {
231
- const loopObj = loopOutput.toObject();
232
- // If there's a data field that's a JSON string, parse it
233
- if (loopObj.data && typeof loopObj.data === "string") {
204
+ // Extract data from the new data field
205
+ const dataValue = loopOutput.getData();
206
+ if (dataValue) {
234
207
  try {
235
- return JSON.parse(loopObj.data);
208
+ // Convert protobuf Value to JavaScript
209
+ return dataValue.toJavaScript();
236
210
  }
237
- catch {
238
- // If JSON parsing fails, return the raw data
239
- return loopObj.data;
211
+ catch (error) {
212
+ console.warn("Failed to convert loop data from protobuf Value:", error);
213
+ return null;
240
214
  }
241
215
  }
242
- return loopObj;
243
216
  }
244
217
  return null;
245
218
  }
@@ -1 +1 @@
1
- {"version":3,"file":"restApi.d.ts","sourceRoot":"","sources":["../../../src/models/node/restApi.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAGL,gBAAgB,EAEjB,MAAM,oBAAoB,CAAC;AAS5B,cAAM,WAAY,SAAQ,IAAI;gBAChB,KAAK,EAAE,gBAAgB;IAInC;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE;QACpC,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAClC,GAAG,MAAM,CAAC,WAAW;IAmBtB,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,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