@avaprotocol/sdk-js 2.5.2-dev.1 → 2.6.1

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 (45) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +774 -2617
  4. package/dist/index.mjs +788 -2619
  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 +1 -0
  8. package/dist/models/node/contractRead.d.ts.map +1 -1
  9. package/dist/models/node/contractRead.js +5 -14
  10. package/dist/models/node/contractWrite.d.ts +2 -1
  11. package/dist/models/node/contractWrite.d.ts.map +1 -1
  12. package/dist/models/node/contractWrite.js +4 -14
  13. package/dist/models/node/customCode.d.ts.map +1 -1
  14. package/dist/models/node/customCode.js +1 -14
  15. package/dist/models/node/ethTransfer.d.ts.map +1 -1
  16. package/dist/models/node/ethTransfer.js +6 -11
  17. package/dist/models/node/filter.d.ts.map +1 -1
  18. package/dist/models/node/filter.js +20 -18
  19. package/dist/models/node/graphqlQuery.d.ts.map +1 -1
  20. package/dist/models/node/graphqlQuery.js +5 -11
  21. package/dist/models/node/interface.d.ts +0 -1
  22. package/dist/models/node/interface.d.ts.map +1 -1
  23. package/dist/models/node/interface.js +0 -8
  24. package/dist/models/node/loop.d.ts.map +1 -1
  25. package/dist/models/node/loop.js +58 -85
  26. package/dist/models/node/restApi.d.ts.map +1 -1
  27. package/dist/models/node/restApi.js +1 -15
  28. package/dist/models/step.d.ts +3 -1
  29. package/dist/models/step.d.ts.map +1 -1
  30. package/dist/models/step.js +104 -365
  31. package/dist/models/trigger/block.d.ts.map +1 -1
  32. package/dist/models/trigger/block.js +18 -20
  33. package/dist/models/trigger/cron.d.ts.map +1 -1
  34. package/dist/models/trigger/cron.js +9 -28
  35. package/dist/models/trigger/event.d.ts.map +1 -1
  36. package/dist/models/trigger/event.js +1 -12
  37. package/dist/models/trigger/fixedTime.d.ts.map +1 -1
  38. package/dist/models/trigger/fixedTime.js +9 -20
  39. package/dist/models/trigger/interface.d.ts +1 -1
  40. package/dist/models/trigger/interface.d.ts.map +1 -1
  41. package/dist/models/trigger/interface.js +7 -2
  42. package/dist/models/trigger/manual.d.ts +0 -3
  43. package/dist/models/trigger/manual.d.ts.map +1 -1
  44. package/dist/models/trigger/manual.js +33 -44
  45. 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
  }
@@ -15,6 +15,7 @@ declare class ContractReadNode extends Node {
15
15
  callData: string;
16
16
  methodName?: string;
17
17
  applyToFields?: string[];
18
+ methodParams?: string[];
18
19
  }>;
19
20
  }): avs_pb.ContractReadNode;
20
21
  static fromResponse(raw: avs_pb.TaskNode): ContractReadNode;
@@ -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,uBAA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AAC,EAAE,MAAM,EAAE,CAAC;SACzB,CAAC,CAAC;KACJ,GAAG,MAAM,CAAC,gBAAgB;IA4B3B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,gBAAgB;IAyB3D,SAAS,IAAI,MAAM,CAAC,QAAQ;IAe5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,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) {
@@ -28,6 +28,9 @@ class ContractReadNode extends Node {
28
28
  if (methodCall.applyToFields) {
29
29
  methodCallMsg.setApplyToFieldsList(methodCall.applyToFields);
30
30
  }
31
+ if (methodCall.methodParams) {
32
+ methodCallMsg.setMethodParamsList(methodCall.methodParams);
33
+ }
31
34
  config.addMethodCalls(methodCallMsg);
32
35
  });
33
36
  node.setConfig(config);
@@ -45,19 +48,13 @@ class ContractReadNode extends Node {
45
48
  callData: call.callData,
46
49
  methodName: call.methodName,
47
50
  applyToFields: call.applyToFieldsList || [],
51
+ methodParams: call.methodParamsList || [],
48
52
  })) || [],
49
53
  };
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
54
  return new ContractReadNode({
57
55
  ...obj,
58
56
  type: NodeType.ContractRead,
59
57
  data: data,
60
- input: input,
61
58
  });
62
59
  }
63
60
  toRequest() {
@@ -65,12 +62,6 @@ class ContractReadNode extends Node {
65
62
  request.setId(this.id);
66
63
  request.setName(this.name);
67
64
  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
65
  request.setContractRead(node);
75
66
  return request;
76
67
  }
@@ -15,11 +15,12 @@ declare class ContractWriteNode extends Node {
15
15
  methodCalls?: Array<{
16
16
  callData: string;
17
17
  methodName?: string;
18
+ methodParams?: string[];
18
19
  }>;
19
20
  }): avs_pb.ContractWriteNode;
20
21
  static fromResponse(raw: avs_pb.TaskNode): ContractWriteNode;
21
22
  toRequest(): avs_pb.TaskNode;
22
- static fromOutputData(outputData: avs_pb.RunNodeWithInputsResp): any;
23
+ static fromOutputData(outputData: avs_pb.RunNodeWithInputsResp): unknown[] | null;
23
24
  }
24
25
  export default ContractWriteNode;
25
26
  //# 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;YACpB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;SACzB,CAAC,CAAC;KACJ,GAAG,MAAM,CAAC,iBAAiB;IA0B5B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,iBAAiB;IAyB5D,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 {
@@ -27,6 +26,9 @@ class ContractWriteNode extends Node {
27
26
  if (methodCall.methodName) {
28
27
  methodCallMsg.setMethodName(methodCall.methodName);
29
28
  }
29
+ if (methodCall.methodParams) {
30
+ methodCallMsg.setMethodParamsList(methodCall.methodParams);
31
+ }
30
32
  config.addMethodCalls(methodCallMsg);
31
33
  });
32
34
  node.setConfig(config);
@@ -44,19 +46,13 @@ class ContractWriteNode extends Node {
44
46
  methodCalls: protobufData.methodCallsList?.map((call) => ({
45
47
  callData: call.callData,
46
48
  methodName: call.methodName,
49
+ methodParams: call.methodParamsList || [],
47
50
  })) || [],
48
51
  };
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
52
  return new ContractWriteNode({
56
53
  ...obj,
57
54
  type: NodeType.ContractWrite,
58
55
  data: data,
59
- input: input,
60
56
  });
61
57
  }
62
58
  toRequest() {
@@ -64,12 +60,6 @@ class ContractWriteNode extends Node {
64
60
  request.setId(this.id);
65
61
  request.setName(this.name);
66
62
  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
63
  request.setContractWrite(node);
74
64
  return request;
75
65
  }
@@ -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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@@ -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,EAAa,MAAM,oBAAoB,CAAC;AAMtG,cAAM,gBAAiB,SAAQ,IAAI;gBACrB,KAAK,EAAE,qBAAqB;IAQxC;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE;QACpC,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,YAAY,CAAC,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;KACxC,GAAG,MAAM,CAAC,gBAAgB;IAkB3B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,gBAAgB;IAe3D,SAAS,IAAI,MAAM,CAAC,QAAQ;IAqB5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAIrE;AAED,eAAe,gBAAgB,CAAC"}
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,EAGL,qBAAqB,EAEtB,MAAM,oBAAoB,CAAC;AAK5B,cAAM,gBAAiB,SAAQ,IAAI;gBACrB,KAAK,EAAE,qBAAqB;IAQxC;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE;QACpC,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,YAAY,CAAC,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;KACxC,GAAG,MAAM,CAAC,gBAAgB;IAkB3B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,gBAAgB;IAc3D,SAAS,IAAI,MAAM,CAAC,QAAQ;IAe5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,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,MAAM,MAAM,uBAAuB,CAAC;AAEhD,OAAO,EAAE,QAAQ,EAA0C,SAAS,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAK3G,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,YAAY,GACnC,QAAQ,CAeV;AAGD,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,MAAM,CAAC,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C;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,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,IAAI,MAAM,aAAa,CAAC;AAO/B,OAAO,EAGL,aAAa,EAGd,MAAM,oBAAoB,CAAC;AAG5B,cAAM,QAAS,SAAQ,IAAI;gBACb,KAAK,EAAE,aAAa;IAIhC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,QAAQ;IAsCnD,OAAO,CAAC,MAAM,CAAC,yBAAyB;IAsBxC,OAAO,CAAC,MAAM,CAAC,4BAA4B;IAe3C,OAAO,CAAC,0BAA0B;IA4BlC,SAAS,IAAI,MAAM,CAAC,QAAQ;IAqC5B,OAAO,CAAC,mBAAmB;IA2G3B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,OAAO;CAuCzE;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,MAAM,aAAa,CAAC;AAO/B,OAAO,EAGL,aAAa,EAGd,MAAM,oBAAoB,CAAC;AAG5B,cAAM,QAAS,SAAQ,IAAI;gBACb,KAAK,EAAE,aAAa;IAIhC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,QAAQ;IA8BnD,OAAO,CAAC,MAAM,CAAC,yBAAyB;IAsBxC,OAAO,CAAC,MAAM,CAAC,4BAA4B;IAe3C,OAAO,CAAC,0BAA0B;IA4BlC,SAAS,IAAI,MAAM,CAAC,QAAQ;IA8B5B,OAAO,CAAC,mBAAmB;IA4F3B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,OAAO;CAqCzE;AAED,eAAe,QAAQ,CAAC"}