@avaprotocol/sdk-js 1.4.0 → 1.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.
- package/CHANGELOG.md +28 -0
- package/dist/auth.d.ts +2 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +10 -0
- package/dist/config.d.ts +9 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +19 -0
- package/dist/grpc_codegen/custom_types.d.ts +45 -0
- package/dist/grpc_codegen/custom_types.d.ts.map +1 -0
- package/dist/grpc_codegen/custom_types.js +179 -0
- package/dist/index.d.ts +148 -2798
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8901 -5466
- package/dist/index.mjs +8897 -5459
- package/dist/models/edge.d.ts +12 -0
- package/dist/models/edge.d.ts.map +1 -0
- package/dist/models/edge.js +19 -0
- package/dist/models/execution.d.ts +32 -0
- package/dist/models/execution.d.ts.map +1 -0
- package/dist/models/execution.js +65 -0
- package/dist/models/node/branch.d.ts +14 -0
- package/dist/models/node/branch.d.ts.map +1 -0
- package/dist/models/node/branch.js +39 -0
- package/dist/models/node/contractRead.d.ts +14 -0
- package/dist/models/node/contractRead.d.ts.map +1 -0
- package/dist/models/node/contractRead.js +33 -0
- package/dist/models/node/contractWrite.d.ts +14 -0
- package/dist/models/node/contractWrite.d.ts.map +1 -0
- package/dist/models/node/contractWrite.js +31 -0
- package/dist/models/node/customCode.d.ts +18 -0
- package/dist/models/node/customCode.d.ts.map +1 -0
- package/dist/models/node/customCode.js +36 -0
- package/dist/models/node/ethTransfer.d.ts +14 -0
- package/dist/models/node/ethTransfer.d.ts.map +1 -0
- package/dist/models/node/ethTransfer.js +30 -0
- package/dist/models/node/factory.d.ts +21 -0
- package/dist/models/node/factory.d.ts.map +1 -0
- package/dist/models/node/factory.js +70 -0
- package/dist/models/node/filter.d.ts +14 -0
- package/dist/models/node/filter.d.ts.map +1 -0
- package/dist/models/node/filter.js +32 -0
- package/dist/models/node/graphqlQuery.d.ts +14 -0
- package/dist/models/node/graphqlQuery.d.ts.map +1 -0
- package/dist/models/node/graphqlQuery.js +43 -0
- package/dist/models/node/interface.d.ts +18 -0
- package/dist/models/node/interface.d.ts.map +1 -0
- package/dist/models/node/interface.js +37 -0
- package/dist/models/node/loop.d.ts +13 -0
- package/dist/models/node/loop.d.ts.map +1 -0
- package/dist/models/node/loop.js +145 -0
- package/dist/models/node/restApi.d.ts +15 -0
- package/dist/models/node/restApi.d.ts.map +1 -0
- package/dist/models/node/restApi.js +40 -0
- package/dist/models/secret.d.ts +16 -0
- package/dist/models/secret.d.ts.map +1 -0
- package/dist/models/secret.js +28 -0
- package/dist/models/step.d.ts +19 -0
- package/dist/models/step.d.ts.map +1 -0
- package/dist/models/step.js +78 -0
- package/dist/models/trigger/block.d.ts +20 -0
- package/dist/models/trigger/block.d.ts.map +1 -0
- package/dist/models/trigger/block.js +49 -0
- package/dist/models/trigger/cron.d.ts +20 -0
- package/dist/models/trigger/cron.d.ts.map +1 -0
- package/dist/models/trigger/cron.js +49 -0
- package/dist/models/trigger/event.d.ts +20 -0
- package/dist/models/trigger/event.d.ts.map +1 -0
- package/dist/models/trigger/event.js +74 -0
- package/dist/models/trigger/factory.d.ts +25 -0
- package/dist/models/trigger/factory.d.ts.map +1 -0
- package/dist/models/trigger/factory.js +54 -0
- package/dist/models/trigger/fixedTime.d.ts +20 -0
- package/dist/models/trigger/fixedTime.d.ts.map +1 -0
- package/dist/models/trigger/fixedTime.js +49 -0
- package/dist/models/trigger/interface.d.ts +25 -0
- package/dist/models/trigger/interface.d.ts.map +1 -0
- package/dist/models/trigger/interface.js +20 -0
- package/dist/models/trigger/manual.d.ts +13 -0
- package/dist/models/trigger/manual.d.ts.map +1 -0
- package/dist/models/trigger/manual.js +27 -0
- package/dist/models/trigger/reason.d.ts +33 -0
- package/dist/models/trigger/reason.d.ts.map +1 -0
- package/dist/models/trigger/reason.js +96 -0
- package/dist/models/workflow.d.ts +54 -0
- package/dist/models/workflow.d.ts.map +1 -0
- package/dist/models/workflow.js +117 -0
- package/dist/utils.d.ts +3 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +37 -0
- package/package.json +6 -4
- package/dist/index.d.mts +0 -2937
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
+
import { NodeType } from "@avaprotocol/types";
|
|
3
|
+
export declare function covertNodeTypeToString(status: avs_pb.TaskNode.TaskTypeCase): NodeType;
|
|
4
|
+
export type NodeData = avs_pb.ETHTransferNode.AsObject | avs_pb.ContractWriteNode.AsObject | avs_pb.ContractReadNode.AsObject | avs_pb.GraphQLQueryNode.AsObject | avs_pb.RestAPINode.AsObject | avs_pb.BranchNode.AsObject | avs_pb.FilterNode.AsObject | avs_pb.LoopNode.AsObject | avs_pb.CustomCodeNode.AsObject;
|
|
5
|
+
export type NodeProps = Omit<avs_pb.TaskNode.AsObject, "ethTransfer" | "contractWrite" | "contractRead" | "graphqlDataQuery" | "restApi" | "branch" | "filter" | "loop" | "customCode"> & {
|
|
6
|
+
type: NodeType;
|
|
7
|
+
data: NodeData;
|
|
8
|
+
};
|
|
9
|
+
declare class Node implements NodeProps {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
type: NodeType;
|
|
13
|
+
data: NodeData;
|
|
14
|
+
constructor(props: NodeProps);
|
|
15
|
+
toRequest(): avs_pb.TaskNode;
|
|
16
|
+
}
|
|
17
|
+
export default Node;
|
|
18
|
+
//# sourceMappingURL=interface.d.ts.map
|
|
@@ -0,0 +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,EAAE,MAAM,oBAAoB,CAAC;AAI9C,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,YAAY,GACnC,QAAQ,CAeV;AAED,MAAM,MAAM,QAAQ,GAChB,MAAM,CAAC,eAAe,CAAC,QAAQ,GAC/B,MAAM,CAAC,iBAAiB,CAAC,QAAQ,GACjC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,GAChC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,GAChC,MAAM,CAAC,WAAW,CAAC,QAAQ,GAC3B,MAAM,CAAC,UAAU,CAAC,QAAQ,GAC1B,MAAM,CAAC,UAAU,CAAC,QAAQ,GAC1B,MAAM,CAAC,QAAQ,CAAC,QAAQ,GACxB,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC;AAEnC,MAAM,MAAM,SAAS,GAAG,IAAI,CAC1B,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;IACF,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,QAAQ,CAAC;CAChB,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;gBAEH,KAAK,EAAE,SAAS;IAO5B,SAAS,IAAI,MAAM,CAAC,QAAQ;CAU7B;AAED,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
+
import { NodeType } from "@avaprotocol/types";
|
|
3
|
+
import _ from "lodash";
|
|
4
|
+
// Function to convert TaskStatus to string
|
|
5
|
+
export function covertNodeTypeToString(status) {
|
|
6
|
+
const conversionMap = {
|
|
7
|
+
[avs_pb.TaskNode.TaskTypeCase.ETH_TRANSFER]: NodeType.ETHTransfer,
|
|
8
|
+
[avs_pb.TaskNode.TaskTypeCase.CONTRACT_WRITE]: NodeType.ContractWrite,
|
|
9
|
+
[avs_pb.TaskNode.TaskTypeCase.CONTRACT_READ]: NodeType.ContractRead,
|
|
10
|
+
[avs_pb.TaskNode.TaskTypeCase.GRAPHQL_QUERY]: NodeType.GraphQLQuery,
|
|
11
|
+
[avs_pb.TaskNode.TaskTypeCase.REST_API]: NodeType.RestAPI,
|
|
12
|
+
[avs_pb.TaskNode.TaskTypeCase.BRANCH]: NodeType.Branch,
|
|
13
|
+
[avs_pb.TaskNode.TaskTypeCase.FILTER]: NodeType.Filter,
|
|
14
|
+
[avs_pb.TaskNode.TaskTypeCase.LOOP]: NodeType.Loop,
|
|
15
|
+
[avs_pb.TaskNode.TaskTypeCase.CUSTOM_CODE]: NodeType.CustomCode,
|
|
16
|
+
[avs_pb.TaskNode.TaskTypeCase.TASK_TYPE_NOT_SET]: NodeType.Unset,
|
|
17
|
+
};
|
|
18
|
+
return conversionMap[status];
|
|
19
|
+
}
|
|
20
|
+
class Node {
|
|
21
|
+
constructor(props) {
|
|
22
|
+
this.id = props.id;
|
|
23
|
+
this.name = props.name;
|
|
24
|
+
this.type = props.type;
|
|
25
|
+
this.data = props.data;
|
|
26
|
+
}
|
|
27
|
+
toRequest() {
|
|
28
|
+
const request = new avs_pb.TaskNode();
|
|
29
|
+
const raw = request.serializeBinary();
|
|
30
|
+
const parsed = avs_pb.TaskNode.deserializeBinary(raw);
|
|
31
|
+
if (!_.isEqual(request, parsed)) {
|
|
32
|
+
throw new Error("Invalid request object");
|
|
33
|
+
}
|
|
34
|
+
return request;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export default Node;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
+
import Node, { NodeProps } from "./interface";
|
|
3
|
+
export type LoopNodeData = avs_pb.LoopNode.AsObject;
|
|
4
|
+
export type LoopNodeProps = NodeProps & {
|
|
5
|
+
data: LoopNodeData;
|
|
6
|
+
};
|
|
7
|
+
declare class LoopNode extends Node {
|
|
8
|
+
constructor(props: LoopNodeProps);
|
|
9
|
+
static fromResponse(raw: avs_pb.TaskNode): LoopNode;
|
|
10
|
+
toRequest(): avs_pb.TaskNode;
|
|
11
|
+
}
|
|
12
|
+
export default LoopNode;
|
|
13
|
+
//# sourceMappingURL=loop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loop.d.ts","sourceRoot":"","sources":["../../../src/models/node/loop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,IAAI,EAAE,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAI9C,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC;AACpD,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG;IACtC,IAAI,EAAE,YAAY,CAAC;CACpB,CAAC;AAEF,cAAM,QAAS,SAAQ,IAAI;gBACb,KAAK,EAAE,aAAa;IAIhC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,QAAQ;IAsCnD,SAAS,IAAI,MAAM,CAAC,QAAQ;CAuG7B;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
+
import Node from "./interface";
|
|
3
|
+
import { NodeType } from "@avaprotocol/types";
|
|
4
|
+
class LoopNode extends Node {
|
|
5
|
+
constructor(props) {
|
|
6
|
+
super({ ...props, type: NodeType.Loop, data: props.data });
|
|
7
|
+
}
|
|
8
|
+
static fromResponse(raw) {
|
|
9
|
+
const loopNode = raw.getLoop();
|
|
10
|
+
if (!loopNode) {
|
|
11
|
+
throw new Error("Response does not contain a Loop node");
|
|
12
|
+
}
|
|
13
|
+
const loopNodeData = loopNode.toObject();
|
|
14
|
+
// Extract config properties to data level for easier access
|
|
15
|
+
if (loopNodeData.config) {
|
|
16
|
+
loopNodeData.input = loopNodeData.config.sourceId;
|
|
17
|
+
loopNodeData.iterVal = loopNodeData.config.iterVal;
|
|
18
|
+
loopNodeData.iterKey = loopNodeData.config.iterKey;
|
|
19
|
+
// Also determine runnerType based on which runner is present
|
|
20
|
+
if (loopNodeData.restApi) {
|
|
21
|
+
loopNodeData.runnerType = NodeType.RestAPI;
|
|
22
|
+
}
|
|
23
|
+
else if (loopNodeData.customCode) {
|
|
24
|
+
loopNodeData.runnerType = NodeType.CustomCode;
|
|
25
|
+
}
|
|
26
|
+
else if (loopNodeData.ethTransfer) {
|
|
27
|
+
loopNodeData.runnerType = NodeType.ETHTransfer;
|
|
28
|
+
}
|
|
29
|
+
else if (loopNodeData.contractRead) {
|
|
30
|
+
loopNodeData.runnerType = NodeType.ContractRead;
|
|
31
|
+
}
|
|
32
|
+
else if (loopNodeData.contractWrite) {
|
|
33
|
+
loopNodeData.runnerType = NodeType.ContractWrite;
|
|
34
|
+
}
|
|
35
|
+
else if (loopNodeData.graphqlDataQuery) {
|
|
36
|
+
loopNodeData.runnerType = NodeType.GraphQLQuery;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return new LoopNode({
|
|
40
|
+
id: raw.getId(),
|
|
41
|
+
name: raw.getName(),
|
|
42
|
+
type: NodeType.Loop,
|
|
43
|
+
data: loopNodeData,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
toRequest() {
|
|
47
|
+
const node = new avs_pb.TaskNode();
|
|
48
|
+
const loopNode = new avs_pb.LoopNode();
|
|
49
|
+
node.setId(this.id);
|
|
50
|
+
node.setName(this.name);
|
|
51
|
+
const data = this.data;
|
|
52
|
+
// Set the loop config from data.config or direct properties
|
|
53
|
+
const config = new avs_pb.LoopNode.Config();
|
|
54
|
+
if (data.config) {
|
|
55
|
+
config.setSourceId(data.config.sourceId || "");
|
|
56
|
+
config.setIterVal(data.config.iterVal || "");
|
|
57
|
+
config.setIterKey(data.config.iterKey || "");
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
// Handle direct properties for backward compatibility
|
|
61
|
+
config.setSourceId(data.input || data.sourceId || "");
|
|
62
|
+
config.setIterVal(data.iterVal || "");
|
|
63
|
+
config.setIterKey(data.iterKey || "");
|
|
64
|
+
}
|
|
65
|
+
loopNode.setConfig(config);
|
|
66
|
+
if (data.ethTransfer) {
|
|
67
|
+
const ethTransfer = new avs_pb.ETHTransferNode();
|
|
68
|
+
if (data.ethTransfer.config) {
|
|
69
|
+
const config = new avs_pb.ETHTransferNode.Config();
|
|
70
|
+
config.setDestination(data.ethTransfer.config.destination);
|
|
71
|
+
config.setAmount(data.ethTransfer.config.amount);
|
|
72
|
+
ethTransfer.setConfig(config);
|
|
73
|
+
}
|
|
74
|
+
loopNode.setEthTransfer(ethTransfer);
|
|
75
|
+
}
|
|
76
|
+
else if (data.contractWrite) {
|
|
77
|
+
const contractWrite = new avs_pb.ContractWriteNode();
|
|
78
|
+
if (data.contractWrite.config) {
|
|
79
|
+
const config = new avs_pb.ContractWriteNode.Config();
|
|
80
|
+
config.setContractAddress(data.contractWrite.config.contractAddress);
|
|
81
|
+
config.setCallData(data.contractWrite.config.callData);
|
|
82
|
+
config.setContractAbi(data.contractWrite.config.contractAbi);
|
|
83
|
+
contractWrite.setConfig(config);
|
|
84
|
+
}
|
|
85
|
+
loopNode.setContractWrite(contractWrite);
|
|
86
|
+
}
|
|
87
|
+
else if (data.contractRead) {
|
|
88
|
+
const contractRead = new avs_pb.ContractReadNode();
|
|
89
|
+
if (data.contractRead.config) {
|
|
90
|
+
const config = new avs_pb.ContractReadNode.Config();
|
|
91
|
+
config.setContractAddress(data.contractRead.config.contractAddress);
|
|
92
|
+
config.setCallData(data.contractRead.config.callData);
|
|
93
|
+
config.setContractAbi(data.contractRead.config.contractAbi);
|
|
94
|
+
contractRead.setConfig(config);
|
|
95
|
+
}
|
|
96
|
+
loopNode.setContractRead(contractRead);
|
|
97
|
+
}
|
|
98
|
+
else if (data.graphqlDataQuery) {
|
|
99
|
+
const graphqlQuery = new avs_pb.GraphQLQueryNode();
|
|
100
|
+
if (data.graphqlDataQuery.config) {
|
|
101
|
+
const config = new avs_pb.GraphQLQueryNode.Config();
|
|
102
|
+
config.setUrl(data.graphqlDataQuery.config.url);
|
|
103
|
+
config.setQuery(data.graphqlDataQuery.config.query);
|
|
104
|
+
if (data.graphqlDataQuery.config.variablesMap &&
|
|
105
|
+
data.graphqlDataQuery.config.variablesMap.length > 0) {
|
|
106
|
+
data.graphqlDataQuery.config.variablesMap.forEach(([key, value]) => {
|
|
107
|
+
config.getVariablesMap().set(key, value);
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
graphqlQuery.setConfig(config);
|
|
111
|
+
}
|
|
112
|
+
loopNode.setGraphqlDataQuery(graphqlQuery);
|
|
113
|
+
}
|
|
114
|
+
else if (data.restApi) {
|
|
115
|
+
const restApi = new avs_pb.RestAPINode();
|
|
116
|
+
if (data.restApi.config) {
|
|
117
|
+
const config = new avs_pb.RestAPINode.Config();
|
|
118
|
+
config.setUrl(data.restApi.config.url);
|
|
119
|
+
config.setMethod(data.restApi.config.method);
|
|
120
|
+
config.setBody(data.restApi.config.body || "");
|
|
121
|
+
if (data.restApi.config.headersMap &&
|
|
122
|
+
data.restApi.config.headersMap.length > 0) {
|
|
123
|
+
data.restApi.config.headersMap.forEach(([key, value]) => {
|
|
124
|
+
config.getHeadersMap().set(key, value);
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
restApi.setConfig(config);
|
|
128
|
+
}
|
|
129
|
+
loopNode.setRestApi(restApi);
|
|
130
|
+
}
|
|
131
|
+
else if (data.customCode) {
|
|
132
|
+
const customCode = new avs_pb.CustomCodeNode();
|
|
133
|
+
if (data.customCode.config) {
|
|
134
|
+
const config = new avs_pb.CustomCodeNode.Config();
|
|
135
|
+
config.setLang(data.customCode.config.lang);
|
|
136
|
+
config.setSource(data.customCode.config.source);
|
|
137
|
+
customCode.setConfig(config);
|
|
138
|
+
}
|
|
139
|
+
loopNode.setCustomCode(customCode);
|
|
140
|
+
}
|
|
141
|
+
node.setLoop(loopNode);
|
|
142
|
+
return node;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
export default LoopNode;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { NodeProps } from "./interface";
|
|
2
|
+
import Node from "./interface";
|
|
3
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
4
|
+
export type RestAPINodeData = avs_pb.RestAPINode.AsObject;
|
|
5
|
+
export type RestAPINodeOutput = avs_pb.RestAPINode.Output.AsObject;
|
|
6
|
+
export type RestAPINodeProps = NodeProps & {
|
|
7
|
+
data: RestAPINodeData;
|
|
8
|
+
};
|
|
9
|
+
declare class RestAPINode extends Node {
|
|
10
|
+
constructor(props: RestAPINodeProps);
|
|
11
|
+
static fromResponse(raw: avs_pb.TaskNode): RestAPINode;
|
|
12
|
+
toRequest(): avs_pb.TaskNode;
|
|
13
|
+
}
|
|
14
|
+
export default RestAPINode;
|
|
15
|
+
//# sourceMappingURL=restApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"restApi.d.ts","sourceRoot":"","sources":["../../../src/models/node/restApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAIhD,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC;AAC1D,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,QAAQ,CAAC;AAEnE,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG;IACzC,IAAI,EAAE,eAAe,CAAC;CACvB,CAAC;AAEF,cAAM,WAAY,SAAQ,IAAI;gBAChB,KAAK,EAAE,gBAAgB;IAInC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,WAAW;IAUtD,SAAS,IAAI,MAAM,CAAC,QAAQ;CA6B7B;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import Node from "./interface";
|
|
2
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
3
|
+
import { NodeType } from "@avaprotocol/types";
|
|
4
|
+
class RestAPINode extends Node {
|
|
5
|
+
constructor(props) {
|
|
6
|
+
super({ ...props, type: NodeType.RestAPI, data: props.data });
|
|
7
|
+
}
|
|
8
|
+
static fromResponse(raw) {
|
|
9
|
+
// Convert the raw object to RestAPINodeProps, which should keep name and id
|
|
10
|
+
const obj = raw.toObject();
|
|
11
|
+
return new RestAPINode({
|
|
12
|
+
...obj,
|
|
13
|
+
type: NodeType.RestAPI,
|
|
14
|
+
data: raw.getRestApi().toObject(),
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
toRequest() {
|
|
18
|
+
const request = new avs_pb.TaskNode();
|
|
19
|
+
request.setId(this.id);
|
|
20
|
+
request.setName(this.name);
|
|
21
|
+
const nodeData = new avs_pb.RestAPINode();
|
|
22
|
+
if (this.data.config) {
|
|
23
|
+
const config = new avs_pb.RestAPINode.Config();
|
|
24
|
+
config.setUrl(this.data.config.url);
|
|
25
|
+
config.setMethod(this.data.config.method);
|
|
26
|
+
config.setBody(this.data.config.body || "");
|
|
27
|
+
if (this.data.config.headersMap &&
|
|
28
|
+
this.data.config.headersMap.length > 0) {
|
|
29
|
+
const headersMap = config.getHeadersMap();
|
|
30
|
+
this.data.config.headersMap.forEach(([key, value]) => {
|
|
31
|
+
headersMap.set(key, value);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
nodeData.setConfig(config);
|
|
35
|
+
}
|
|
36
|
+
request.setRestApi(nodeData);
|
|
37
|
+
return request;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export default RestAPINode;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
+
import { SecretProps } from "@avaprotocol/types";
|
|
3
|
+
declare class Secret implements SecretProps {
|
|
4
|
+
name: string;
|
|
5
|
+
secret?: string;
|
|
6
|
+
workflowId?: string;
|
|
7
|
+
orgId?: string;
|
|
8
|
+
createdAt?: number;
|
|
9
|
+
updatedAt?: number;
|
|
10
|
+
createdBy?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
constructor(props: SecretProps);
|
|
13
|
+
toRequest(): avs_pb.CreateOrUpdateSecretReq;
|
|
14
|
+
}
|
|
15
|
+
export default Secret;
|
|
16
|
+
//# sourceMappingURL=secret.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secret.d.ts","sourceRoot":"","sources":["../../src/models/secret.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,cAAM,MAAO,YAAW,WAAW;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;gBAET,KAAK,EAAE,WAAW;IAW9B,SAAS,IAAI,MAAM,CAAC,uBAAuB;CAgB5C;AAED,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
+
class Secret {
|
|
3
|
+
constructor(props) {
|
|
4
|
+
this.name = props.name;
|
|
5
|
+
this.secret = props.secret;
|
|
6
|
+
this.workflowId = props.workflowId;
|
|
7
|
+
this.orgId = props.orgId;
|
|
8
|
+
this.createdAt = props.createdAt;
|
|
9
|
+
this.updatedAt = props.updatedAt;
|
|
10
|
+
this.createdBy = props.createdBy;
|
|
11
|
+
this.description = props.description;
|
|
12
|
+
}
|
|
13
|
+
toRequest() {
|
|
14
|
+
const request = new avs_pb.CreateOrUpdateSecretReq();
|
|
15
|
+
request.setName(this.name);
|
|
16
|
+
if (this.secret) {
|
|
17
|
+
request.setSecret(this.secret);
|
|
18
|
+
}
|
|
19
|
+
if (this.orgId) {
|
|
20
|
+
request.setOrgId(this.orgId);
|
|
21
|
+
}
|
|
22
|
+
if (this.workflowId) {
|
|
23
|
+
request.setWorkflowId(this.workflowId);
|
|
24
|
+
}
|
|
25
|
+
return request;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export default Secret;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
+
export type StepProps = Omit<avs_pb.Execution.Step.AsObject, "outputDataCase" | "ethTransfer" | "graphql" | "contractRead" | "contractWrite" | "customCode" | "restApi" | "branch" | "filter" | "loop"> & {
|
|
3
|
+
output: any;
|
|
4
|
+
};
|
|
5
|
+
declare class Step implements StepProps {
|
|
6
|
+
nodeId: string;
|
|
7
|
+
success: boolean;
|
|
8
|
+
log: string;
|
|
9
|
+
error: string;
|
|
10
|
+
startAt: number;
|
|
11
|
+
endAt: number;
|
|
12
|
+
inputsList: string[];
|
|
13
|
+
output: any;
|
|
14
|
+
constructor(props: StepProps);
|
|
15
|
+
static getOutput(step: avs_pb.Execution.Step): any;
|
|
16
|
+
static fromResponse(step: avs_pb.Execution.Step): Step;
|
|
17
|
+
}
|
|
18
|
+
export default Step;
|
|
19
|
+
//# sourceMappingURL=step.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../src/models/step.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAGhD,MAAM,MAAM,SAAS,GAAG,IAAI,CAC1B,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,EAC5B,gBAAgB,GAChB,aAAa,GACb,SAAS,GACT,cAAc,GACd,eAAe,GACf,YAAY,GACZ,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,MAAM,CACT,GAAG;IACF,MAAM,EAAE,GAAG,CAAC;CACb,CAAC;AAKF,cAAM,IAAK,YAAW,SAAS;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,GAAG,CAAC;gBAEA,KAAK,EAAE,SAAS;IAW5B,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,GAAG;IAqDlD,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI;CAcvD;AAED,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
+
import { convertProtobufValueToJs } from "../utils";
|
|
3
|
+
// OutputDataProps is no longer a union of AsObject, it will be the converted JS type via 'output'
|
|
4
|
+
// export type OutputDataProps = ... (removed)
|
|
5
|
+
class Step {
|
|
6
|
+
constructor(props) {
|
|
7
|
+
this.nodeId = props.nodeId;
|
|
8
|
+
this.success = props.success;
|
|
9
|
+
this.log = props.log;
|
|
10
|
+
this.error = props.error;
|
|
11
|
+
this.startAt = props.startAt;
|
|
12
|
+
this.endAt = props.endAt;
|
|
13
|
+
this.inputsList = props.inputsList;
|
|
14
|
+
this.output = props.output;
|
|
15
|
+
}
|
|
16
|
+
static getOutput(step) {
|
|
17
|
+
const outputDataType = step.getOutputDataCase();
|
|
18
|
+
let nodeOutputMessage;
|
|
19
|
+
switch (outputDataType) {
|
|
20
|
+
case avs_pb.Execution.Step.OutputDataCase.OUTPUT_DATA_NOT_SET:
|
|
21
|
+
return null;
|
|
22
|
+
case avs_pb.Execution.Step.OutputDataCase.ETH_TRANSFER:
|
|
23
|
+
return step.getEthTransfer()?.toObject(); // Specific structure, not google.protobuf.Value
|
|
24
|
+
case avs_pb.Execution.Step.OutputDataCase.GRAPHQL:
|
|
25
|
+
nodeOutputMessage = step.getGraphql();
|
|
26
|
+
return nodeOutputMessage && nodeOutputMessage.hasData()
|
|
27
|
+
? nodeOutputMessage.getData()
|
|
28
|
+
: undefined;
|
|
29
|
+
case avs_pb.Execution.Step.OutputDataCase.CONTRACT_READ:
|
|
30
|
+
// ContractReadNode.Output has 'repeated google.protobuf.Value data'
|
|
31
|
+
nodeOutputMessage = step.getContractRead();
|
|
32
|
+
if (nodeOutputMessage) {
|
|
33
|
+
return nodeOutputMessage
|
|
34
|
+
.getDataList()
|
|
35
|
+
.map((val) => convertProtobufValueToJs(val));
|
|
36
|
+
}
|
|
37
|
+
return []; // Default to empty array if no data
|
|
38
|
+
case avs_pb.Execution.Step.OutputDataCase.CONTRACT_WRITE:
|
|
39
|
+
return step.getContractWrite()?.toObject(); // Specific structure
|
|
40
|
+
case avs_pb.Execution.Step.OutputDataCase.CUSTOM_CODE:
|
|
41
|
+
nodeOutputMessage = step.getCustomCode();
|
|
42
|
+
return nodeOutputMessage && nodeOutputMessage.hasData()
|
|
43
|
+
? convertProtobufValueToJs(nodeOutputMessage.getData())
|
|
44
|
+
: undefined;
|
|
45
|
+
case avs_pb.Execution.Step.OutputDataCase.REST_API:
|
|
46
|
+
nodeOutputMessage = step.getRestApi();
|
|
47
|
+
return nodeOutputMessage && nodeOutputMessage.hasData()
|
|
48
|
+
? nodeOutputMessage.getData()
|
|
49
|
+
: undefined;
|
|
50
|
+
case avs_pb.Execution.Step.OutputDataCase.BRANCH:
|
|
51
|
+
return step.getBranch()?.toObject(); // Specific structure
|
|
52
|
+
case avs_pb.Execution.Step.OutputDataCase.FILTER:
|
|
53
|
+
nodeOutputMessage = step.getFilter();
|
|
54
|
+
return nodeOutputMessage && nodeOutputMessage.hasData()
|
|
55
|
+
? nodeOutputMessage.getData()
|
|
56
|
+
: undefined;
|
|
57
|
+
case avs_pb.Execution.Step.OutputDataCase.LOOP:
|
|
58
|
+
// LoopNode.Output has 'string data' - handle as plain string for now
|
|
59
|
+
return step.getLoop()?.getData();
|
|
60
|
+
default:
|
|
61
|
+
console.warn(`Unhandled output data type in Step.getOutput: ${outputDataType}`);
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
static fromResponse(step) {
|
|
66
|
+
return new Step({
|
|
67
|
+
nodeId: step.getNodeId(),
|
|
68
|
+
success: step.getSuccess(),
|
|
69
|
+
log: step.getLog(),
|
|
70
|
+
error: step.getError(),
|
|
71
|
+
startAt: step.getStartAt(),
|
|
72
|
+
endAt: step.getEndAt(),
|
|
73
|
+
inputsList: step.getInputsList(),
|
|
74
|
+
output: Step.getOutput(step),
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
export default Step;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
+
import Trigger, { TriggerProps } from "./interface";
|
|
3
|
+
export type BlockTriggerDataType = avs_pb.BlockTrigger.Config.AsObject;
|
|
4
|
+
export type BlockTriggerProps = TriggerProps & {
|
|
5
|
+
data: BlockTriggerDataType;
|
|
6
|
+
};
|
|
7
|
+
export type BlockTriggerOutput = avs_pb.BlockTrigger.Output.AsObject;
|
|
8
|
+
declare class BlockTrigger extends Trigger {
|
|
9
|
+
constructor(props: BlockTriggerProps);
|
|
10
|
+
toRequest(): avs_pb.TaskTrigger;
|
|
11
|
+
static fromResponse(raw: avs_pb.TaskTrigger): BlockTrigger;
|
|
12
|
+
/**
|
|
13
|
+
* Convert raw data from runNodeWithInputs response to BlockOutput format
|
|
14
|
+
* @param rawData - The raw data from the gRPC response
|
|
15
|
+
* @returns {BlockTriggerOutput | undefined} - The converted data
|
|
16
|
+
*/
|
|
17
|
+
getOutput(): BlockTriggerOutput | undefined;
|
|
18
|
+
}
|
|
19
|
+
export default BlockTrigger;
|
|
20
|
+
//# sourceMappingURL=block.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/block.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,OAAO,EAAE,EAAiB,YAAY,EAAE,MAAM,aAAa,CAAC;AAInE,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,QAAQ,CAAC;AACvE,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG;IAAE,IAAI,EAAE,oBAAoB,CAAA;CAAE,CAAC;AAC9E,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,QAAQ,CAAC;AAErE,cAAM,YAAa,SAAQ,OAAO;gBACpB,KAAK,EAAE,iBAAiB;IAIpC,SAAS,IAAI,MAAM,CAAC,WAAW;IAmB/B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,GAAG,YAAY;IAuB1D;;;;OAIG;IACH,SAAS,IAAI,kBAAkB,GAAG,SAAS;CAG5C;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
+
import Trigger from "./interface";
|
|
3
|
+
import { TriggerType } from "@avaprotocol/types";
|
|
4
|
+
class BlockTrigger extends Trigger {
|
|
5
|
+
constructor(props) {
|
|
6
|
+
super({ ...props, type: TriggerType.Block, data: props.data });
|
|
7
|
+
}
|
|
8
|
+
toRequest() {
|
|
9
|
+
const request = new avs_pb.TaskTrigger();
|
|
10
|
+
request.setName(this.name);
|
|
11
|
+
request.setId(this.id);
|
|
12
|
+
if (!this.data) {
|
|
13
|
+
throw new Error(`Trigger data is missing for ${this.type}`);
|
|
14
|
+
}
|
|
15
|
+
const trigger = new avs_pb.BlockTrigger();
|
|
16
|
+
const config = new avs_pb.BlockTrigger.Config();
|
|
17
|
+
config.setInterval(this.data.interval || 0);
|
|
18
|
+
trigger.setConfig(config);
|
|
19
|
+
request.setBlock(trigger);
|
|
20
|
+
return request;
|
|
21
|
+
}
|
|
22
|
+
static fromResponse(raw) {
|
|
23
|
+
// Convert the raw object to TriggerProps, which should keep name and id
|
|
24
|
+
const obj = raw.toObject();
|
|
25
|
+
let data = { interval: 0 };
|
|
26
|
+
if (raw.getBlock() && raw.getBlock().hasConfig()) {
|
|
27
|
+
const config = raw.getBlock().getConfig();
|
|
28
|
+
if (config) {
|
|
29
|
+
data = {
|
|
30
|
+
interval: config.getInterval() || 0
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return new BlockTrigger({
|
|
35
|
+
...obj,
|
|
36
|
+
type: TriggerType.Block,
|
|
37
|
+
data: data,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Convert raw data from runNodeWithInputs response to BlockOutput format
|
|
42
|
+
* @param rawData - The raw data from the gRPC response
|
|
43
|
+
* @returns {BlockTriggerOutput | undefined} - The converted data
|
|
44
|
+
*/
|
|
45
|
+
getOutput() {
|
|
46
|
+
return this.output;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export default BlockTrigger;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
+
import Trigger, { TriggerProps } from "./interface";
|
|
3
|
+
export type CronTriggerDataType = avs_pb.CronTrigger.Config.AsObject;
|
|
4
|
+
export type CronTriggerProps = TriggerProps & {
|
|
5
|
+
data: CronTriggerDataType;
|
|
6
|
+
};
|
|
7
|
+
export type CronTriggerOutput = avs_pb.CronTrigger.Output.AsObject;
|
|
8
|
+
declare class CronTrigger extends Trigger {
|
|
9
|
+
constructor(props: CronTriggerProps);
|
|
10
|
+
toRequest(): avs_pb.TaskTrigger;
|
|
11
|
+
static fromResponse(raw: avs_pb.TaskTrigger): CronTrigger;
|
|
12
|
+
/**
|
|
13
|
+
* Convert raw data from runNodeWithInputs response to CronOutput format
|
|
14
|
+
* @param rawData - The raw data from the gRPC response
|
|
15
|
+
* @returns {CronTriggerOutput | undefined} - The converted data
|
|
16
|
+
*/
|
|
17
|
+
getOutput(): CronTriggerOutput | undefined;
|
|
18
|
+
}
|
|
19
|
+
export default CronTrigger;
|
|
20
|
+
//# sourceMappingURL=cron.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cron.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/cron.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,OAAO,EAAE,EAAiB,YAAY,EAAE,MAAM,aAAa,CAAC;AAInE,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,QAAQ,CAAC;AACrE,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG;IAAE,IAAI,EAAE,mBAAmB,CAAA;CAAE,CAAC;AAC5E,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,QAAQ,CAAC;AAEnE,cAAM,WAAY,SAAQ,OAAO;gBACnB,KAAK,EAAE,gBAAgB;IAInC,SAAS,IAAI,MAAM,CAAC,WAAW;IAmB/B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,GAAG,WAAW;IAuBzD;;;;OAIG;IACH,SAAS,IAAI,iBAAiB,GAAG,SAAS;CAG3C;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
+
import Trigger from "./interface";
|
|
3
|
+
import { TriggerType } from "@avaprotocol/types";
|
|
4
|
+
class CronTrigger extends Trigger {
|
|
5
|
+
constructor(props) {
|
|
6
|
+
super({ ...props, type: TriggerType.Cron, data: props.data });
|
|
7
|
+
}
|
|
8
|
+
toRequest() {
|
|
9
|
+
const request = new avs_pb.TaskTrigger();
|
|
10
|
+
request.setName(this.name);
|
|
11
|
+
request.setId(this.id);
|
|
12
|
+
if (!this.data) {
|
|
13
|
+
throw new Error(`Trigger data is missing for ${this.type}`);
|
|
14
|
+
}
|
|
15
|
+
const trigger = new avs_pb.CronTrigger();
|
|
16
|
+
const config = new avs_pb.CronTrigger.Config();
|
|
17
|
+
config.setScheduleList(this.data.scheduleList || []);
|
|
18
|
+
trigger.setConfig(config);
|
|
19
|
+
request.setCron(trigger);
|
|
20
|
+
return request;
|
|
21
|
+
}
|
|
22
|
+
static fromResponse(raw) {
|
|
23
|
+
// Convert the raw object to TriggerProps, which should keep name and id
|
|
24
|
+
const obj = raw.toObject();
|
|
25
|
+
let data = { scheduleList: [] };
|
|
26
|
+
if (raw.getCron() && raw.getCron().hasConfig()) {
|
|
27
|
+
const config = raw.getCron().getConfig();
|
|
28
|
+
if (config) {
|
|
29
|
+
data = {
|
|
30
|
+
scheduleList: config.getScheduleList() || []
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return new CronTrigger({
|
|
35
|
+
...obj,
|
|
36
|
+
type: TriggerType.Cron,
|
|
37
|
+
data: data,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Convert raw data from runNodeWithInputs response to CronOutput format
|
|
42
|
+
* @param rawData - The raw data from the gRPC response
|
|
43
|
+
* @returns {CronTriggerOutput | undefined} - The converted data
|
|
44
|
+
*/
|
|
45
|
+
getOutput() {
|
|
46
|
+
return this.output;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export default CronTrigger;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
+
import Trigger, { TriggerProps } from "./interface";
|
|
3
|
+
export type EventTriggerDataType = avs_pb.EventTrigger.Config.AsObject;
|
|
4
|
+
export type EventTriggerProps = TriggerProps & {
|
|
5
|
+
data: EventTriggerDataType;
|
|
6
|
+
};
|
|
7
|
+
export type EventTriggerOutput = avs_pb.EventTrigger.Output.AsObject;
|
|
8
|
+
declare class EventTrigger extends Trigger {
|
|
9
|
+
constructor(props: EventTriggerProps);
|
|
10
|
+
toRequest(): avs_pb.TaskTrigger;
|
|
11
|
+
static fromResponse(raw: avs_pb.TaskTrigger): EventTrigger;
|
|
12
|
+
/**
|
|
13
|
+
* Convert raw data from runNodeWithInputs response to EventOutput format
|
|
14
|
+
* @param rawData - The raw data from the gRPC response
|
|
15
|
+
* @returns {EventTriggerOutput | undefined} - The converted data
|
|
16
|
+
*/
|
|
17
|
+
getOutput(): EventTriggerOutput | undefined;
|
|
18
|
+
}
|
|
19
|
+
export default EventTrigger;
|
|
20
|
+
//# sourceMappingURL=event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/event.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,OAAO,EAAE,EAAiB,YAAY,EAAE,MAAM,aAAa,CAAC;AAuBnE,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,QAAQ,CAAC;AACvE,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG;IAAE,IAAI,EAAE,oBAAoB,CAAA;CAAE,CAAC;AAC9E,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,QAAQ,CAAC;AAErE,cAAM,YAAa,SAAQ,OAAO;gBACpB,KAAK,EAAE,iBAAiB;IAIpC,SAAS,IAAI,MAAM,CAAC,WAAW;IAwC/B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,GAAG,YAAY;IAiC1D;;;;OAIG;IACH,SAAS,IAAI,kBAAkB,GAAG,SAAS;CAG5C;AAED,eAAe,YAAY,CAAC"}
|