@avaprotocol/sdk-js 2.3.12 → 2.3.13-dev.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.
- package/dist/index.js +846 -199
- package/dist/index.mjs +852 -203
- package/dist/models/node/branch.d.ts.map +1 -1
- package/dist/models/node/branch.js +9 -0
- package/dist/models/node/contractRead.d.ts.map +1 -1
- package/dist/models/node/contractRead.js +9 -0
- package/dist/models/node/contractWrite.d.ts.map +1 -1
- package/dist/models/node/contractWrite.js +9 -0
- package/dist/models/node/customCode.d.ts.map +1 -1
- package/dist/models/node/customCode.js +9 -1
- package/dist/models/node/ethTransfer.d.ts.map +1 -1
- package/dist/models/node/ethTransfer.js +9 -0
- package/dist/models/node/filter.d.ts.map +1 -1
- package/dist/models/node/filter.js +9 -0
- package/dist/models/node/graphqlQuery.d.ts.map +1 -1
- package/dist/models/node/graphqlQuery.js +9 -0
- package/dist/models/node/interface.d.ts +1 -0
- package/dist/models/node/interface.d.ts.map +1 -1
- package/dist/models/node/interface.js +1 -0
- package/dist/models/node/loop.d.ts.map +1 -1
- package/dist/models/node/loop.js +9 -0
- package/dist/models/node/restApi.d.ts.map +1 -1
- package/dist/models/node/restApi.js +15 -1
- package/dist/models/step.d.ts +1 -0
- package/dist/models/step.d.ts.map +1 -1
- package/dist/models/step.js +11 -0
- package/dist/models/trigger/block.d.ts.map +1 -1
- package/dist/models/trigger/block.js +13 -0
- package/dist/models/trigger/cron.d.ts.map +1 -1
- package/dist/models/trigger/cron.js +20 -0
- package/dist/models/trigger/event.d.ts.map +1 -1
- package/dist/models/trigger/event.js +8 -2
- package/dist/models/trigger/interface.d.ts +1 -0
- package/dist/models/trigger/interface.d.ts.map +1 -1
- package/dist/models/trigger/interface.js +2 -0
- package/dist/models/trigger/manual.d.ts.map +1 -1
- package/dist/models/trigger/manual.js +13 -0
- package/dist/utils.d.ts +20 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +34 -0
- package/package.json +3 -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;
|
|
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,6 +1,7 @@
|
|
|
1
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";
|
|
4
5
|
// Required props for constructor: id, name, type and data: { conditions }
|
|
5
6
|
class BranchNode extends Node {
|
|
6
7
|
constructor(props) {
|
|
@@ -18,10 +19,13 @@ class BranchNode extends Node {
|
|
|
18
19
|
expression: condition.expression,
|
|
19
20
|
})) || [],
|
|
20
21
|
};
|
|
22
|
+
// Extract input data if present
|
|
23
|
+
const input = extractInputFromProtobuf(raw.getBranch()?.getInput());
|
|
21
24
|
return new BranchNode({
|
|
22
25
|
...obj,
|
|
23
26
|
type: NodeType.Branch,
|
|
24
27
|
data: data,
|
|
28
|
+
input: input,
|
|
25
29
|
});
|
|
26
30
|
}
|
|
27
31
|
toRequest() {
|
|
@@ -42,6 +46,11 @@ class BranchNode extends Node {
|
|
|
42
46
|
config.setConditionsList(conditionsList);
|
|
43
47
|
}
|
|
44
48
|
nodeData.setConfig(config);
|
|
49
|
+
// Set input data if provided
|
|
50
|
+
const inputValue = convertInputToProtobuf(this.input);
|
|
51
|
+
if (inputValue) {
|
|
52
|
+
nodeData.setInput(inputValue);
|
|
53
|
+
}
|
|
45
54
|
request.setBranch(nodeData);
|
|
46
55
|
return request;
|
|
47
56
|
}
|
|
@@ -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,EAAkC,qBAAqB,EAAa,MAAM,oBAAoB,CAAC;AAMtG,cAAM,gBAAiB,SAAQ,IAAI;gBACrB,KAAK,EAAE,qBAAqB;IAIxC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,gBAAgB;
|
|
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,EAAkC,qBAAqB,EAAa,MAAM,oBAAoB,CAAC;AAMtG,cAAM,gBAAiB,SAAQ,IAAI;gBACrB,KAAK,EAAE,qBAAqB;IAIxC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,gBAAgB;IA0B3D,SAAS,IAAI,MAAM,CAAC,QAAQ;IAoC5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAmBrE;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 { convertInputToProtobuf, extractInputFromProtobuf } from "../../utils";
|
|
4
5
|
// Required props for constructor: id, name, type and data
|
|
5
6
|
class ContractReadNode extends Node {
|
|
6
7
|
constructor(props) {
|
|
@@ -19,10 +20,13 @@ class ContractReadNode extends Node {
|
|
|
19
20
|
methodName: call.methodName,
|
|
20
21
|
})) || [],
|
|
21
22
|
};
|
|
23
|
+
// Extract input data if present
|
|
24
|
+
const input = extractInputFromProtobuf(raw.getContractRead()?.getInput());
|
|
22
25
|
return new ContractReadNode({
|
|
23
26
|
...obj,
|
|
24
27
|
type: NodeType.ContractRead,
|
|
25
28
|
data: data,
|
|
29
|
+
input: input,
|
|
26
30
|
});
|
|
27
31
|
}
|
|
28
32
|
toRequest() {
|
|
@@ -44,6 +48,11 @@ class ContractReadNode extends Node {
|
|
|
44
48
|
config.addMethodCalls(methodCallMsg);
|
|
45
49
|
});
|
|
46
50
|
nodeData.setConfig(config);
|
|
51
|
+
// Set input data if provided
|
|
52
|
+
const inputValue = convertInputToProtobuf(this.input);
|
|
53
|
+
if (inputValue) {
|
|
54
|
+
nodeData.setInput(inputValue);
|
|
55
|
+
}
|
|
47
56
|
request.setContractRead(nodeData);
|
|
48
57
|
return request;
|
|
49
58
|
}
|
|
@@ -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,EAAmC,sBAAsB,EAAa,MAAM,oBAAoB,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,EAAmC,sBAAsB,EAAa,MAAM,oBAAoB,CAAC;AAMxG,cAAM,iBAAkB,SAAQ,IAAI;gBACtB,KAAK,EAAE,sBAAsB;IAIzC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,iBAAiB;IA2B5D,SAAS,IAAI,MAAM,CAAC,QAAQ;IAqC5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAyDrE;AAED,eAAe,iBAAiB,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 { convertInputToProtobuf, extractInputFromProtobuf } from "../../utils";
|
|
4
5
|
// Required props for constructor: id, name, type and data: { config: { contractAddress, callData, contractAbi, methodCallsList? } }
|
|
5
6
|
class ContractWriteNode extends Node {
|
|
6
7
|
constructor(props) {
|
|
@@ -20,10 +21,13 @@ class ContractWriteNode extends Node {
|
|
|
20
21
|
methodName: call.methodName,
|
|
21
22
|
})) || [],
|
|
22
23
|
};
|
|
24
|
+
// Extract input data if present
|
|
25
|
+
const input = extractInputFromProtobuf(raw.getContractWrite()?.getInput());
|
|
23
26
|
return new ContractWriteNode({
|
|
24
27
|
...obj,
|
|
25
28
|
type: NodeType.ContractWrite,
|
|
26
29
|
data: data,
|
|
30
|
+
input: input,
|
|
27
31
|
});
|
|
28
32
|
}
|
|
29
33
|
toRequest() {
|
|
@@ -46,6 +50,11 @@ class ContractWriteNode extends Node {
|
|
|
46
50
|
config.addMethodCalls(methodCallMsg);
|
|
47
51
|
});
|
|
48
52
|
nodeData.setConfig(config);
|
|
53
|
+
// Set input data if provided
|
|
54
|
+
const inputValue = convertInputToProtobuf(this.input);
|
|
55
|
+
if (inputValue) {
|
|
56
|
+
nodeData.setInput(inputValue);
|
|
57
|
+
}
|
|
49
58
|
request.setContractWrite(nodeData);
|
|
50
59
|
return request;
|
|
51
60
|
}
|
|
@@ -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,EAIL,mBAAmB,EAEpB,MAAM,oBAAoB,CAAC;AAK5B,cAAM,cAAe,SAAQ,IAAI;gBACnB,KAAK,EAAE,mBAAmB;IAItC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,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,EAIL,mBAAmB,EAEpB,MAAM,oBAAoB,CAAC;AAK5B,cAAM,cAAe,SAAQ,IAAI;gBACnB,KAAK,EAAE,mBAAmB;IAItC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,cAAc;IAuBzD,SAAS,IAAI,MAAM,CAAC,QAAQ;IA2B5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAkBrE;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 } from "../../utils";
|
|
4
|
+
import { convertProtobufValueToJs, convertInputToProtobuf, extractInputFromProtobuf } 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) {
|
|
@@ -16,10 +16,13 @@ class CustomCodeNode extends Node {
|
|
|
16
16
|
lang: rawConfig.lang,
|
|
17
17
|
source: rawConfig.source,
|
|
18
18
|
};
|
|
19
|
+
// Extract input data if present
|
|
20
|
+
const input = extractInputFromProtobuf(raw.getCustomCode()?.getInput());
|
|
19
21
|
return new CustomCodeNode({
|
|
20
22
|
...obj,
|
|
21
23
|
type: NodeType.CustomCode,
|
|
22
24
|
data: convertedConfig,
|
|
25
|
+
input: input,
|
|
23
26
|
});
|
|
24
27
|
}
|
|
25
28
|
toRequest() {
|
|
@@ -32,6 +35,11 @@ class CustomCodeNode extends Node {
|
|
|
32
35
|
config.setLang(this.data.lang);
|
|
33
36
|
config.setSource(this.data.source);
|
|
34
37
|
nodeData.setConfig(config);
|
|
38
|
+
// Set input data if provided
|
|
39
|
+
const inputValue = convertInputToProtobuf(this.input);
|
|
40
|
+
if (inputValue) {
|
|
41
|
+
nodeData.setInput(inputValue);
|
|
42
|
+
}
|
|
35
43
|
request.setCustomCode(nodeData);
|
|
36
44
|
return request;
|
|
37
45
|
}
|
|
@@ -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;
|
|
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,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,eAAe;IAe1D,SAAS,IAAI,MAAM,CAAC,QAAQ;IAwB5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAIrE;AAED,eAAe,eAAe,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 { convertInputToProtobuf, extractInputFromProtobuf } from "../../utils";
|
|
4
5
|
// Required props for constructor: id, name, type and data: { destination, amount }
|
|
5
6
|
class ETHTransferNode extends Node {
|
|
6
7
|
constructor(props) {
|
|
@@ -9,10 +10,13 @@ class ETHTransferNode extends Node {
|
|
|
9
10
|
static fromResponse(raw) {
|
|
10
11
|
// Convert the raw object to ETHTransferNodeProps, which should keep name and id
|
|
11
12
|
const obj = raw.toObject();
|
|
13
|
+
// Extract input data if present
|
|
14
|
+
const input = extractInputFromProtobuf(raw.getEthTransfer()?.getInput());
|
|
12
15
|
return new ETHTransferNode({
|
|
13
16
|
...obj,
|
|
14
17
|
type: NodeType.ETHTransfer,
|
|
15
18
|
data: raw.getEthTransfer().getConfig().toObject(),
|
|
19
|
+
input: input,
|
|
16
20
|
});
|
|
17
21
|
}
|
|
18
22
|
toRequest() {
|
|
@@ -24,6 +28,11 @@ class ETHTransferNode extends Node {
|
|
|
24
28
|
config.setDestination(this.data.destination);
|
|
25
29
|
config.setAmount(this.data.amount);
|
|
26
30
|
nodeData.setConfig(config);
|
|
31
|
+
// Set input data if provided
|
|
32
|
+
const inputValue = convertInputToProtobuf(this.input);
|
|
33
|
+
if (inputValue) {
|
|
34
|
+
nodeData.setInput(inputValue);
|
|
35
|
+
}
|
|
27
36
|
request.setEthTransfer(nodeData);
|
|
28
37
|
return request;
|
|
29
38
|
}
|
|
@@ -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,EAA4B,eAAe,EAAa,MAAM,oBAAoB,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,EAA4B,eAAe,EAAa,MAAM,oBAAoB,CAAC;AAM1F,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;CAIrE;AAED,eAAe,UAAU,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 { convertInputToProtobuf, extractInputFromProtobuf } from "../../utils";
|
|
4
5
|
// Required props for constructor: id, name, type and data: { expression, sourceId }
|
|
5
6
|
class FilterNode extends Node {
|
|
6
7
|
constructor(props) {
|
|
@@ -9,10 +10,13 @@ class FilterNode extends Node {
|
|
|
9
10
|
static fromResponse(raw) {
|
|
10
11
|
// Convert the raw object to FilterNodeProps, which should keep name and id
|
|
11
12
|
const obj = raw.toObject();
|
|
13
|
+
// Extract input data if present
|
|
14
|
+
const input = extractInputFromProtobuf(raw.getFilter()?.getInput());
|
|
12
15
|
return new FilterNode({
|
|
13
16
|
...obj,
|
|
14
17
|
type: NodeType.Filter,
|
|
15
18
|
data: raw.getFilter().getConfig().toObject(),
|
|
19
|
+
input: input,
|
|
16
20
|
});
|
|
17
21
|
}
|
|
18
22
|
toRequest() {
|
|
@@ -24,6 +28,11 @@ class FilterNode extends Node {
|
|
|
24
28
|
config.setExpression(this.data.expression);
|
|
25
29
|
config.setSourceId(this.data.sourceId || '');
|
|
26
30
|
nodeData.setConfig(config);
|
|
31
|
+
// Set input data if provided
|
|
32
|
+
const inputValue = convertInputToProtobuf(this.input);
|
|
33
|
+
if (inputValue) {
|
|
34
|
+
nodeData.setInput(inputValue);
|
|
35
|
+
}
|
|
27
36
|
request.setFilter(nodeData);
|
|
28
37
|
return request;
|
|
29
38
|
}
|
|
@@ -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;
|
|
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,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,gBAAgB;IAe3D,SAAS,IAAI,MAAM,CAAC,QAAQ;IAiC5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAIrE;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 { convertInputToProtobuf, extractInputFromProtobuf } from "../../utils";
|
|
4
5
|
// Required props for constructor: id, name, type and data: { url, query, variablesMap }
|
|
5
6
|
class GraphQLQueryNode extends Node {
|
|
6
7
|
constructor(props) {
|
|
@@ -13,10 +14,13 @@ class GraphQLQueryNode extends Node {
|
|
|
13
14
|
static fromResponse(raw) {
|
|
14
15
|
// Convert the raw object to GraphQLQueryNodeProps, which should keep name and id
|
|
15
16
|
const obj = raw.toObject();
|
|
17
|
+
// Extract input data if present
|
|
18
|
+
const input = extractInputFromProtobuf(raw.getGraphqlQuery()?.getInput());
|
|
16
19
|
return new GraphQLQueryNode({
|
|
17
20
|
...obj,
|
|
18
21
|
type: NodeType.GraphQLQuery,
|
|
19
22
|
data: raw.getGraphqlQuery().getConfig().toObject(),
|
|
23
|
+
input: input,
|
|
20
24
|
});
|
|
21
25
|
}
|
|
22
26
|
toRequest() {
|
|
@@ -35,6 +39,11 @@ class GraphQLQueryNode extends Node {
|
|
|
35
39
|
});
|
|
36
40
|
}
|
|
37
41
|
nodeData.setConfig(config);
|
|
42
|
+
// Set input data if provided
|
|
43
|
+
const inputValue = convertInputToProtobuf(this.input);
|
|
44
|
+
if (inputValue) {
|
|
45
|
+
nodeData.setInput(inputValue);
|
|
46
|
+
}
|
|
38
47
|
request.setGraphqlQuery(nodeData);
|
|
39
48
|
return request;
|
|
40
49
|
}
|
|
@@ -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;AAChD,OAAO,EAAE,QAAQ,EAA0C,SAAS,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAI3G,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,YAAY,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,cAAM,IAAK,YAAW,SAAS;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../src/models/node/interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAA0C,SAAS,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAI3G,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,YAAY,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,cAAM,IAAK,YAAW,SAAS;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;gBAEhB,KAAK,EAAE,SAAS;IAQ5B,SAAS,IAAI,MAAM,CAAC,QAAQ;CAU7B;AAED,eAAe,IAAI,CAAC"}
|
|
@@ -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;AAC/B,OAAO,EAGL,aAAa,EAEd,MAAM,oBAAoB,CAAC;AAI5B,cAAM,QAAS,SAAQ,IAAI;gBACb,KAAK,EAAE,aAAa;IAIhC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,QAAQ;
|
|
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;AAC/B,OAAO,EAGL,aAAa,EAEd,MAAM,oBAAoB,CAAC;AAI5B,cAAM,QAAS,SAAQ,IAAI;gBACb,KAAK,EAAE,aAAa;IAIhC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,QAAQ;IAmCnD,SAAS,IAAI,MAAM,CAAC,QAAQ;IA6I5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAuCrE;AAED,eAAe,QAAQ,CAAC"}
|
package/dist/models/node/loop.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
2
|
import Node from "./interface";
|
|
3
3
|
import { NodeType, } from "@avaprotocol/types";
|
|
4
|
+
import { convertInputToProtobuf, extractInputFromProtobuf } from "../../utils";
|
|
4
5
|
class LoopNode extends Node {
|
|
5
6
|
constructor(props) {
|
|
6
7
|
super({ ...props, type: NodeType.Loop, data: props.data });
|
|
@@ -26,10 +27,13 @@ class LoopNode extends Node {
|
|
|
26
27
|
contractWrite: loopNodeData.contractWrite,
|
|
27
28
|
graphqlDataQuery: loopNodeData.graphqlDataQuery,
|
|
28
29
|
};
|
|
30
|
+
// Extract input data if present
|
|
31
|
+
const input = extractInputFromProtobuf(raw.getLoop()?.getInput());
|
|
29
32
|
return new LoopNode({
|
|
30
33
|
...obj,
|
|
31
34
|
type: NodeType.Loop,
|
|
32
35
|
data: data,
|
|
36
|
+
input: input,
|
|
33
37
|
});
|
|
34
38
|
}
|
|
35
39
|
toRequest() {
|
|
@@ -44,6 +48,11 @@ class LoopNode extends Node {
|
|
|
44
48
|
config.setIterVal(data.iterVal || "");
|
|
45
49
|
config.setIterKey(data.iterKey || "");
|
|
46
50
|
loopNode.setConfig(config);
|
|
51
|
+
// Set input data if provided
|
|
52
|
+
const inputValue = convertInputToProtobuf(this.input);
|
|
53
|
+
if (inputValue) {
|
|
54
|
+
loopNode.setInput(inputValue);
|
|
55
|
+
}
|
|
47
56
|
// Handle nested nodes - these still use the nested structure within LoopNodeData
|
|
48
57
|
if (data.ethTransfer) {
|
|
49
58
|
const ethTransfer = new avs_pb.ETHTransferNode();
|
|
@@ -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,
|
|
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,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,WAAW;IAmBtD,SAAS,IAAI,MAAM,CAAC,QAAQ;IAyC5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAerE;AAED,eAAe,WAAW,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 } from "../../utils";
|
|
4
|
+
import { convertProtobufValueToJs, convertInputToProtobuf, extractInputFromProtobuf, } from "../../utils";
|
|
5
5
|
// Required props for constructor: id, name, type and data: { url, method, headersMap, body }
|
|
6
6
|
class RestAPINode extends Node {
|
|
7
7
|
constructor(props) {
|
|
@@ -10,10 +10,17 @@ class RestAPINode extends Node {
|
|
|
10
10
|
static fromResponse(raw) {
|
|
11
11
|
// Convert the raw object to RestAPINodeProps, which should keep name and id
|
|
12
12
|
const obj = raw.toObject();
|
|
13
|
+
// Extract input data from top-level TaskNode.input field (not nested RestAPINode.input)
|
|
14
|
+
// This matches where we set it in toRequest() and where the Go backend looks for it
|
|
15
|
+
let input = undefined;
|
|
16
|
+
if (raw.hasInput()) {
|
|
17
|
+
input = extractInputFromProtobuf(raw.getInput());
|
|
18
|
+
}
|
|
13
19
|
return new RestAPINode({
|
|
14
20
|
...obj,
|
|
15
21
|
type: NodeType.RestAPI,
|
|
16
22
|
data: raw.getRestApi().getConfig().toObject(),
|
|
23
|
+
input: input, // Include input data from top-level TaskNode
|
|
17
24
|
});
|
|
18
25
|
}
|
|
19
26
|
toRequest() {
|
|
@@ -33,6 +40,13 @@ class RestAPINode extends Node {
|
|
|
33
40
|
});
|
|
34
41
|
}
|
|
35
42
|
nodeData.setConfig(config);
|
|
43
|
+
// Use the standard utility function to convert input field to protobuf format
|
|
44
|
+
const inputValue = convertInputToProtobuf(this.input);
|
|
45
|
+
if (inputValue) {
|
|
46
|
+
// Set input on the top-level TaskNode, not the nested RestAPINode
|
|
47
|
+
// This matches where the Go backend's ExtractNodeInputData() looks for it
|
|
48
|
+
request.setInput(inputValue);
|
|
49
|
+
}
|
|
36
50
|
request.setRestApi(nodeData);
|
|
37
51
|
return request;
|
|
38
52
|
}
|
package/dist/models/step.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../src/models/step.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAMhD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAEhE,cAAM,IAAK,YAAW,SAAS;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,eAAe,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;gBAEF,KAAK,EAAE,SAAS;
|
|
1
|
+
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../src/models/step.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAMhD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAEhE,cAAM,IAAK,YAAW,SAAS;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,MAAM,EAAE,eAAe,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;gBAEF,KAAK,EAAE,SAAS;IAc5B;;;OAGG;IACH,MAAM,IAAI,SAAS;IAgBnB,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,eAAe;IAgQ9D,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI;CA0BvD;AAED,eAAe,IAAI,CAAC"}
|
package/dist/models/step.js
CHANGED
|
@@ -10,6 +10,7 @@ class Step {
|
|
|
10
10
|
this.error = props.error;
|
|
11
11
|
this.log = props.log;
|
|
12
12
|
this.inputsList = props.inputsList;
|
|
13
|
+
this.input = props.input;
|
|
13
14
|
this.output = props.output;
|
|
14
15
|
this.startAt = props.startAt;
|
|
15
16
|
this.endAt = props.endAt;
|
|
@@ -27,6 +28,7 @@ class Step {
|
|
|
27
28
|
error: this.error,
|
|
28
29
|
log: this.log,
|
|
29
30
|
inputsList: this.inputsList,
|
|
31
|
+
input: this.input,
|
|
30
32
|
output: this.output,
|
|
31
33
|
startAt: this.startAt,
|
|
32
34
|
endAt: this.endAt,
|
|
@@ -272,6 +274,14 @@ class Step {
|
|
|
272
274
|
}
|
|
273
275
|
}
|
|
274
276
|
static fromResponse(step) {
|
|
277
|
+
// Extract input data if present
|
|
278
|
+
let inputData = undefined;
|
|
279
|
+
if (step.hasInput()) {
|
|
280
|
+
const inputValue = step.getInput();
|
|
281
|
+
if (inputValue) {
|
|
282
|
+
inputData = convertProtobufValueToJs(inputValue);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
275
285
|
return new Step({
|
|
276
286
|
id: step.getId(),
|
|
277
287
|
type: convertProtobufStepTypeToSdk(step.getType()),
|
|
@@ -280,6 +290,7 @@ class Step {
|
|
|
280
290
|
error: step.getError(),
|
|
281
291
|
log: step.getLog(),
|
|
282
292
|
inputsList: step.getInputsList(),
|
|
293
|
+
input: inputData,
|
|
283
294
|
output: Step.getOutput(step),
|
|
284
295
|
startAt: step.getStartAt(),
|
|
285
296
|
endAt: step.getEndAt(),
|
|
@@ -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,OAA0B,MAAM,aAAa,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,OAA0B,MAAM,aAAa,CAAC;AAErD,OAAO,EAAqC,kBAAkB,EAAE,iBAAiB,EAAgB,MAAM,oBAAoB,CAAC;AAK5H,cAAM,YAAa,SAAQ,OAAO;gBACpB,KAAK,EAAE,iBAAiB;IAIpC,SAAS,IAAI,MAAM,CAAC,WAAW;IAsC/B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,GAAG,YAAY;IA+B1D;;;;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"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
2
|
import Trigger from "./interface";
|
|
3
|
+
import { convertInputToProtobuf, extractInputFromProtobuf } from "../../utils";
|
|
3
4
|
import { TriggerType } from "@avaprotocol/types";
|
|
4
5
|
// Required props for constructor: id, name, type and data: { interval }
|
|
5
6
|
class BlockTrigger extends Trigger {
|
|
@@ -27,6 +28,11 @@ class BlockTrigger extends Trigger {
|
|
|
27
28
|
const config = new avs_pb.BlockTrigger.Config();
|
|
28
29
|
config.setInterval(blockData.interval);
|
|
29
30
|
trigger.setConfig(config);
|
|
31
|
+
// Use utility function to convert input field to protobuf format
|
|
32
|
+
const inputValue = convertInputToProtobuf(this.input);
|
|
33
|
+
if (inputValue) {
|
|
34
|
+
trigger.setInput(inputValue);
|
|
35
|
+
}
|
|
30
36
|
request.setBlock(trigger);
|
|
31
37
|
return request;
|
|
32
38
|
}
|
|
@@ -34,6 +40,7 @@ class BlockTrigger extends Trigger {
|
|
|
34
40
|
// Convert the raw object to TriggerProps, which should keep name and id
|
|
35
41
|
const obj = raw.toObject();
|
|
36
42
|
let data = { interval: 0 };
|
|
43
|
+
let input = undefined;
|
|
37
44
|
if (raw.getBlock() && raw.getBlock().hasConfig()) {
|
|
38
45
|
const config = raw.getBlock().getConfig();
|
|
39
46
|
if (config) {
|
|
@@ -41,11 +48,17 @@ class BlockTrigger extends Trigger {
|
|
|
41
48
|
interval: config.getInterval() || 0
|
|
42
49
|
};
|
|
43
50
|
}
|
|
51
|
+
// Use utility function to extract input field from protobuf format
|
|
52
|
+
const blockTrigger = raw.getBlock();
|
|
53
|
+
if (blockTrigger.hasInput()) {
|
|
54
|
+
input = extractInputFromProtobuf(blockTrigger.getInput());
|
|
55
|
+
}
|
|
44
56
|
}
|
|
45
57
|
return new BlockTrigger({
|
|
46
58
|
...obj,
|
|
47
59
|
type: TriggerType.Block,
|
|
48
60
|
data: data,
|
|
61
|
+
input: input,
|
|
49
62
|
});
|
|
50
63
|
}
|
|
51
64
|
/**
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"cron.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/cron.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAEhD,OAAO,OAAO,MAAM,aAAa,CAAC;AAClC,OAAO,EAAoC,iBAAiB,EAAE,gBAAgB,EAAgB,MAAM,oBAAoB,CAAC;AAEzH,cAAM,WAAY,SAAQ,OAAO;gBACnB,KAAK,EAAE,gBAAgB;IAInC,SAAS,IAAI,MAAM,CAAC,WAAW;IA0C/B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,GAAG,WAAW;IAiCzD;;;;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"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
+
import * as google_protobuf_struct_pb from "google-protobuf/google/protobuf/struct_pb";
|
|
2
3
|
import Trigger from "./interface";
|
|
3
4
|
import { TriggerType } from "@avaprotocol/types";
|
|
4
5
|
class CronTrigger extends Trigger {
|
|
@@ -26,6 +27,16 @@ class CronTrigger extends Trigger {
|
|
|
26
27
|
const config = new avs_pb.CronTrigger.Config();
|
|
27
28
|
config.setSchedulesList(cronData.schedules);
|
|
28
29
|
trigger.setConfig(config);
|
|
30
|
+
// ✨ NEW: Set input data if provided
|
|
31
|
+
if (this.input) {
|
|
32
|
+
try {
|
|
33
|
+
const inputValue = google_protobuf_struct_pb.Value.fromJavaScript(this.input);
|
|
34
|
+
trigger.setInput(inputValue);
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
throw new Error(`Failed to convert input data to protobuf.Value: ${error}`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
29
40
|
request.setCron(trigger);
|
|
30
41
|
return request;
|
|
31
42
|
}
|
|
@@ -41,10 +52,19 @@ class CronTrigger extends Trigger {
|
|
|
41
52
|
};
|
|
42
53
|
}
|
|
43
54
|
}
|
|
55
|
+
// ✨ NEW: Extract input data if present
|
|
56
|
+
let input;
|
|
57
|
+
if (raw.getCron() && raw.getCron().hasInput()) {
|
|
58
|
+
const inputValue = raw.getCron().getInput();
|
|
59
|
+
if (inputValue) {
|
|
60
|
+
input = inputValue.toObject();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
44
63
|
return new CronTrigger({
|
|
45
64
|
...obj,
|
|
46
65
|
type: TriggerType.Cron,
|
|
47
66
|
data: data,
|
|
67
|
+
input: input, // ✨ NEW: Include input data
|
|
48
68
|
});
|
|
49
69
|
}
|
|
50
70
|
/**
|
|
@@ -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,OAA0B,MAAM,aAAa,CAAC;AACrD,OAAO,
|
|
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,OAA0B,MAAM,aAAa,CAAC;AACrD,OAAO,EAGL,kBAAkB,EAClB,iBAAiB,EAElB,MAAM,oBAAoB,CAAC;AA6C5B,cAAM,YAAa,SAAQ,OAAO;gBACpB,KAAK,EAAE,iBAAiB;IAIpC,SAAS,IAAI,MAAM,CAAC,WAAW;IA4D/B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,GAAG,YAAY;IAuD1D;;;;OAIG;IACH,SAAS,IAAI,kBAAkB,GAAG,SAAS;IAI3C;;;;OAIG;IACH,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,cAAc,GAAG,GAAG;CAW9D;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
2
|
import Trigger from "./interface";
|
|
3
|
-
import { TriggerType } from "@avaprotocol/types";
|
|
3
|
+
import { TriggerType, } from "@avaprotocol/types";
|
|
4
4
|
// Ref: https://github.com/AvaProtocol/EigenLayer-AVS/issues/94
|
|
5
5
|
// The trigger is an array of Condition, which can be topics, dateRage, etc.
|
|
6
6
|
// We imply or operator among all conditions.
|
|
@@ -71,7 +71,10 @@ class EventTrigger extends Trigger {
|
|
|
71
71
|
const topicsMessages = queryData.topics.map((topicData) => {
|
|
72
72
|
const topics = new avs_pb.EventTrigger.Topics();
|
|
73
73
|
if (topicData.values) {
|
|
74
|
-
|
|
74
|
+
// Convert null values to empty strings for protobuf compatibility
|
|
75
|
+
// null represents "any value" wildcards in EVM log filtering
|
|
76
|
+
const processedValues = topicData.values.map((value) => value === null ? "" : value);
|
|
77
|
+
topics.setValuesList(processedValues);
|
|
75
78
|
}
|
|
76
79
|
return topics;
|
|
77
80
|
});
|
|
@@ -109,6 +112,9 @@ class EventTrigger extends Trigger {
|
|
|
109
112
|
// Extract topics
|
|
110
113
|
if (query.getTopicsList && query.getTopicsList().length > 0) {
|
|
111
114
|
queryData.topics = query.getTopicsList().map((topics) => ({
|
|
115
|
+
// Don't convert empty strings back to null - preserve the original values
|
|
116
|
+
// The backend may legitimately use empty strings, and we shouldn't assume
|
|
117
|
+
// they were originally null values from the client
|
|
112
118
|
values: topics.getValuesList() || []
|
|
113
119
|
}));
|
|
114
120
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE/D,MAAM,MAAM,WAAW,GACnB,MAAM,CAAC,gBAAgB,CAAC,QAAQ,GAChC,MAAM,CAAC,WAAW,CAAC,QAAQ,GAC3B,MAAM,CAAC,YAAY,CAAC,QAAQ,GAC5B,MAAM,CAAC,YAAY,CAAC,QAAQ,GAC5B,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACnB,IAAI,CAAC;AAET,MAAM,MAAM,aAAa,GACrB,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,QAAQ,GACvC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,QAAQ,GAClC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,QAAQ,GACnC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,QAAQ,GACnC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,QAAQ,GACpC,IAAI,CAAC;AAIT,cAAM,OAAQ,YAAW,YAAY;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,WAAW,CAAC;IAClB,MAAM,CAAC,EAAE,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE/D,MAAM,MAAM,WAAW,GACnB,MAAM,CAAC,gBAAgB,CAAC,QAAQ,GAChC,MAAM,CAAC,WAAW,CAAC,QAAQ,GAC3B,MAAM,CAAC,YAAY,CAAC,QAAQ,GAC5B,MAAM,CAAC,YAAY,CAAC,QAAQ,GAC5B,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACnB,IAAI,CAAC;AAET,MAAM,MAAM,aAAa,GACrB,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,QAAQ,GACvC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,QAAQ,GAClC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,QAAQ,GACnC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,QAAQ,GACnC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,QAAQ,GACpC,IAAI,CAAC;AAIT,cAAM,OAAQ,YAAW,YAAY;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,WAAW,CAAC;IAClB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE5B;;;OAGG;gBACS,KAAK,EAAE,YAAY;IAS/B,SAAS,IAAI,MAAM,CAAC,WAAW;IAI/B,SAAS,IAAI,aAAa,GAAG,SAAS;IAItC,MAAM,IAAI,YAAY;CAUvB;AAED,eAAe,OAAO,CAAC"}
|
|
@@ -9,6 +9,7 @@ class Trigger {
|
|
|
9
9
|
this.type = props.type;
|
|
10
10
|
this.data = props.data;
|
|
11
11
|
this.output = props.output;
|
|
12
|
+
this.input = props.input;
|
|
12
13
|
}
|
|
13
14
|
toRequest() {
|
|
14
15
|
throw new Error("Method not implemented.");
|
|
@@ -23,6 +24,7 @@ class Trigger {
|
|
|
23
24
|
type: this.type,
|
|
24
25
|
data: this.data,
|
|
25
26
|
output: this.output,
|
|
27
|
+
input: this.input,
|
|
26
28
|
};
|
|
27
29
|
}
|
|
28
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manual.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/manual.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,OAAO,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"manual.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/manual.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,OAAO,MAAM,aAAa,CAAC;AAElC,OAAO,EAAe,mBAAmB,EAAE,kBAAkB,EAAgB,MAAM,oBAAoB,CAAC;AAIxG,cAAM,aAAc,SAAQ,OAAO;gBACrB,KAAK,EAAE,kBAAkB;IAIrC,SAAS,IAAI,MAAM,CAAC,WAAW;IAkB/B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,GAAG,aAAa;IAiB3D,iBAAiB,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;IAI/C;;;;OAIG;IACH,SAAS,IAAI,mBAAmB,GAAG,SAAS;IAI5C;;;;OAIG;IACH,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,cAAc,GAAG,GAAG;CAI9D;AAED,eAAe,aAAa,CAAC"}
|