@avaprotocol/sdk-js 1.7.1 → 2.0.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 +19 -0
- package/dist/index.d.ts +14 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +410 -11
- package/dist/index.mjs +412 -9
- package/dist/models/edge.d.ts +12 -0
- package/dist/models/edge.d.ts.map +1 -1
- package/dist/models/execution.d.ts +15 -0
- package/dist/models/execution.d.ts.map +1 -1
- package/dist/models/node/branch.d.ts +11 -0
- package/dist/models/node/branch.d.ts.map +1 -1
- package/dist/models/node/branch.js +1 -0
- package/dist/models/node/contractRead.d.ts +11 -0
- package/dist/models/node/contractRead.d.ts.map +1 -1
- package/dist/models/node/contractRead.js +1 -0
- package/dist/models/node/contractWrite.d.ts +11 -0
- package/dist/models/node/contractWrite.d.ts.map +1 -1
- package/dist/models/node/contractWrite.js +1 -0
- package/dist/models/node/customCode.d.ts +11 -0
- package/dist/models/node/customCode.d.ts.map +1 -1
- package/dist/models/node/customCode.js +1 -0
- package/dist/models/node/ethTransfer.d.ts +11 -0
- package/dist/models/node/ethTransfer.d.ts.map +1 -1
- package/dist/models/node/ethTransfer.js +1 -0
- package/dist/models/node/factory.d.ts +23 -0
- package/dist/models/node/factory.d.ts.map +1 -1
- package/dist/models/node/filter.d.ts +11 -0
- package/dist/models/node/filter.d.ts.map +1 -1
- package/dist/models/node/filter.js +1 -0
- package/dist/models/node/graphqlQuery.d.ts +11 -0
- package/dist/models/node/graphqlQuery.d.ts.map +1 -1
- package/dist/models/node/graphqlQuery.js +1 -0
- package/dist/models/node/interface.d.ts +21 -0
- package/dist/models/node/interface.d.ts.map +1 -1
- package/dist/models/node/loop.d.ts +11 -0
- package/dist/models/node/loop.d.ts.map +1 -1
- package/dist/models/node/loop.js +2 -2
- package/dist/models/node/restApi.d.ts +11 -0
- package/dist/models/node/restApi.d.ts.map +1 -1
- package/dist/models/node/restApi.js +1 -0
- package/dist/models/step.d.ts +19 -0
- package/dist/models/step.d.ts.map +1 -1
- package/dist/models/trigger/block.d.ts +22 -0
- package/dist/models/trigger/block.d.ts.map +1 -1
- package/dist/models/trigger/block.js +1 -0
- package/dist/models/trigger/cron.d.ts +23 -0
- package/dist/models/trigger/cron.d.ts.map +1 -1
- package/dist/models/trigger/cron.js +1 -0
- package/dist/models/trigger/event.d.ts +22 -0
- package/dist/models/trigger/event.d.ts.map +1 -1
- package/dist/models/trigger/event.js +19 -0
- package/dist/models/trigger/factory.d.ts +27 -0
- package/dist/models/trigger/factory.d.ts.map +1 -1
- package/dist/models/trigger/fixedTime.d.ts +23 -0
- package/dist/models/trigger/fixedTime.d.ts.map +1 -1
- package/dist/models/trigger/fixedTime.js +1 -0
- package/dist/models/trigger/interface.d.ts +20 -0
- package/dist/models/trigger/interface.d.ts.map +1 -1
- package/dist/models/trigger/manual.d.ts +23 -0
- package/dist/models/trigger/manual.d.ts.map +1 -1
- package/dist/models/workflow.d.ts +42 -0
- package/dist/models/workflow.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Node from "./interface";
|
|
2
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
3
|
+
import { ETHTransferNodeProps } from "@avaprotocol/types";
|
|
4
|
+
declare class ETHTransferNode extends Node {
|
|
5
|
+
constructor(props: ETHTransferNodeProps);
|
|
6
|
+
static fromResponse(raw: avs_pb.TaskNode): ETHTransferNode;
|
|
7
|
+
toRequest(): avs_pb.TaskNode;
|
|
8
|
+
static fromOutputData(outputData: avs_pb.RunNodeWithInputsResp): any;
|
|
9
|
+
}
|
|
10
|
+
export default ETHTransferNode;
|
|
11
|
+
//# sourceMappingURL=ethTransfer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ethTransfer.d.ts","sourceRoot":"","sources":["../../../src/models/node/ethTransfer.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
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;AAKpG,cAAM,eAAgB,SAAQ,IAAI;gBACpB,KAAK,EAAE,oBAAoB;IAIvC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,eAAe;IAU1D,SAAS,IAAI,MAAM,CAAC,QAAQ;IAkB5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAIrE;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -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
|
+
// Required props for constructor: id, name, type and data: { destination, amount }
|
|
4
5
|
class ETHTransferNode extends Node {
|
|
5
6
|
constructor(props) {
|
|
6
7
|
super({ ...props, type: NodeType.ETHTransfer, data: props.data });
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
+
import ContractWriteNode from "./contractWrite";
|
|
3
|
+
import CustomCodeNode from "./customCode";
|
|
4
|
+
import GraphQLQueryNode from "./graphqlQuery";
|
|
5
|
+
import Node from "./interface";
|
|
6
|
+
import RestAPINode from "./restApi";
|
|
7
|
+
import ContractReadNode from "./contractRead";
|
|
8
|
+
import ETHTransferNode from "./ethTransfer";
|
|
9
|
+
import BranchNode from "./branch";
|
|
10
|
+
import FilterNode from "./filter";
|
|
11
|
+
import LoopNode from "./loop";
|
|
12
|
+
import { CustomCodeLangs, ContractWriteNodeData, ContractReadNodeData, BranchNodeData, ETHTransferNodeData, GraphQLQueryNodeData, RestAPINodeData, CustomCodeNodeData, FilterNodeData, LoopNodeData, NodeProps, ContractWriteNodeProps, ContractReadNodeProps, BranchNodeProps, ETHTransferNodeProps, GraphQLQueryNodeProps, RestAPINodeProps, CustomCodeNodeProps, FilterNodeProps, LoopNodeProps } from "@avaprotocol/types";
|
|
13
|
+
declare class NodeFactory {
|
|
14
|
+
static create(props: NodeProps): Node;
|
|
15
|
+
static createNodes(props: NodeProps[]): Node[];
|
|
16
|
+
static fromResponse(raw: avs_pb.TaskNode): Node;
|
|
17
|
+
static fromOutputData(outputData: avs_pb.RunNodeWithInputsResp): any;
|
|
18
|
+
}
|
|
19
|
+
export default NodeFactory;
|
|
20
|
+
export { Node, ContractWriteNode, ContractReadNode, BranchNode, ETHTransferNode, GraphQLQueryNode, RestAPINode, CustomCodeNode, CustomCodeLangs, FilterNode, LoopNode, };
|
|
21
|
+
export type { ContractWriteNodeData, ContractReadNodeData, BranchNodeData, ETHTransferNodeData, GraphQLQueryNodeData, RestAPINodeData, CustomCodeNodeData, FilterNodeData, LoopNodeData, };
|
|
22
|
+
export type { NodeProps, ContractWriteNodeProps, ContractReadNodeProps, BranchNodeProps, ETHTransferNodeProps, GraphQLQueryNodeProps, RestAPINodeProps, CustomCodeNodeProps, FilterNodeProps, LoopNodeProps, };
|
|
23
|
+
//# sourceMappingURL=factory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/models/node/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAEhD,OAAO,iBAAiB,
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/models/node/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAEhD,OAAO,iBAAiB,MAAM,iBAAiB,CAAC;AAChD,OAAO,cAAc,MAAM,cAAc,CAAC;AAC1C,OAAO,gBAAgB,MAAM,gBAAgB,CAAC;AAC9C,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,WAAW,MAAM,WAAW,CAAC;AACpC,OAAO,gBAAgB,MAAM,gBAAgB,CAAC;AAC9C,OAAO,eAAe,MAAM,eAAe,CAAC;AAC5C,OAAO,UAAU,MAAM,UAAU,CAAC;AAClC,OAAO,UAAU,MAAM,UAAU,CAAC;AAClC,OAAO,QAAQ,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAEL,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,SAAS,EACT,sBAAsB,EACtB,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,aAAa,EACd,MAAM,oBAAoB,CAAC;AAG5B,cAAM,WAAW;IACf,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI;IA2BrC,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE;IAI9C,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,IAAI;IAyB/C,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAyDrE;AAED,eAAe,WAAW,CAAC;AAG3B,OAAO,EACL,IAAI,EACJ,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,cAAc,EACd,eAAe,EACf,UAAU,EACV,QAAQ,GACT,CAAC;AAGF,YAAY,EACV,qBAAqB,EACrB,oBAAoB,EACpB,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,YAAY,GACb,CAAC;AAGF,YAAY,EACV,SAAS,EACT,sBAAsB,EACtB,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,aAAa,GACd,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Node from "./interface";
|
|
2
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
3
|
+
import { FilterNodeProps } from "@avaprotocol/types";
|
|
4
|
+
declare class FilterNode extends Node {
|
|
5
|
+
constructor(props: FilterNodeProps);
|
|
6
|
+
static fromResponse(raw: avs_pb.TaskNode): FilterNode;
|
|
7
|
+
toRequest(): avs_pb.TaskNode;
|
|
8
|
+
static fromOutputData(outputData: avs_pb.RunNodeWithInputsResp): any;
|
|
9
|
+
}
|
|
10
|
+
export default FilterNode;
|
|
11
|
+
//# sourceMappingURL=filter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../../src/models/node/filter.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
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;AAK1F,cAAM,UAAW,SAAQ,IAAI;gBACf,KAAK,EAAE,eAAe;IAIlC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,UAAU;IAUrD,SAAS,IAAI,MAAM,CAAC,QAAQ;IAiB5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAIrE;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -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
|
+
// Required props for constructor: id, name, type and data: { expression, sourceId }
|
|
4
5
|
class FilterNode extends Node {
|
|
5
6
|
constructor(props) {
|
|
6
7
|
super({ ...props, type: NodeType.Filter, data: props.data });
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Node from "./interface";
|
|
2
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
3
|
+
import { GraphQLQueryNodeProps } from "@avaprotocol/types";
|
|
4
|
+
declare class GraphQLQueryNode extends Node {
|
|
5
|
+
constructor(props: GraphQLQueryNodeProps);
|
|
6
|
+
static fromResponse(raw: avs_pb.TaskNode): GraphQLQueryNode;
|
|
7
|
+
toRequest(): avs_pb.TaskNode;
|
|
8
|
+
static fromOutputData(outputData: avs_pb.RunNodeWithInputsResp): any;
|
|
9
|
+
}
|
|
10
|
+
export default GraphQLQueryNode;
|
|
11
|
+
//# sourceMappingURL=graphqlQuery.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphqlQuery.d.ts","sourceRoot":"","sources":["../../../src/models/node/graphqlQuery.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
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;AAKtG,cAAM,gBAAiB,SAAQ,IAAI;gBACrB,KAAK,EAAE,qBAAqB;IAQxC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,gBAAgB;IAU3D,SAAS,IAAI,MAAM,CAAC,QAAQ;IA2B5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAIrE;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -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
|
+
// Required props for constructor: id, name, type and data: { url, query, variablesMap }
|
|
4
5
|
class GraphQLQueryNode extends Node {
|
|
5
6
|
constructor(props) {
|
|
6
7
|
super({
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
+
import { NodeType, NodeProps } 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 ProtobufNodeProps = Omit<avs_pb.TaskNode.AsObject, "ethTransfer" | "contractWrite" | "contractRead" | "graphqlDataQuery" | "restApi" | "branch" | "filter" | "loop" | "customCode"> & {
|
|
6
|
+
data: NodeData;
|
|
7
|
+
};
|
|
8
|
+
export declare const ProtobufNodePropsUtils: {
|
|
9
|
+
getGoStringType: (props: ProtobufNodeProps) => string;
|
|
10
|
+
fromGoStringType: (goStringType: string, baseProps: Omit<ProtobufNodeProps, "type">) => ProtobufNodeProps;
|
|
11
|
+
};
|
|
12
|
+
declare class Node implements NodeProps {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
type: NodeType;
|
|
16
|
+
data: NodeData;
|
|
17
|
+
constructor(props: NodeProps);
|
|
18
|
+
toRequest(): avs_pb.TaskNode;
|
|
19
|
+
}
|
|
20
|
+
export default Node;
|
|
21
|
+
//# sourceMappingURL=interface.d.ts.map
|
|
@@ -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,MAAM,oBAAoB,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,MAAM,oBAAoB,CAAC;AAIjG,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;AAMnC,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,QAAQ,CAAC;CAChB,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;gBAEH,KAAK,EAAE,SAAS;IAO5B,SAAS,IAAI,MAAM,CAAC,QAAQ;CAU7B;AAED,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
+
import Node from "./interface";
|
|
3
|
+
import { LoopNodeProps } from "@avaprotocol/types";
|
|
4
|
+
declare class LoopNode extends Node {
|
|
5
|
+
constructor(props: LoopNodeProps);
|
|
6
|
+
static fromResponse(raw: avs_pb.TaskNode): LoopNode;
|
|
7
|
+
toRequest(): avs_pb.TaskNode;
|
|
8
|
+
static fromOutputData(outputData: avs_pb.RunNodeWithInputsResp): any;
|
|
9
|
+
}
|
|
10
|
+
export default LoopNode;
|
|
11
|
+
//# sourceMappingURL=loop.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loop.d.ts","sourceRoot":"","sources":["../../../src/models/node/loop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,IAAI,
|
|
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,EAA0B,aAAa,EAAa,MAAM,oBAAoB,CAAC;AAKtF,cAAM,QAAS,SAAQ,IAAI;gBACb,KAAK,EAAE,aAAa;IAIhC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,QAAQ;IA+BnD,SAAS,IAAI,MAAM,CAAC,QAAQ;IAkG5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAIrE;AAED,eAAe,QAAQ,CAAC"}
|
package/dist/models/node/loop.js
CHANGED
|
@@ -6,6 +6,7 @@ class LoopNode extends Node {
|
|
|
6
6
|
super({ ...props, type: NodeType.Loop, data: props.data });
|
|
7
7
|
}
|
|
8
8
|
static fromResponse(raw) {
|
|
9
|
+
const obj = raw.toObject();
|
|
9
10
|
const loopNode = raw.getLoop();
|
|
10
11
|
if (!loopNode) {
|
|
11
12
|
throw new Error("Response does not contain a Loop node");
|
|
@@ -26,8 +27,7 @@ class LoopNode extends Node {
|
|
|
26
27
|
graphqlDataQuery: loopNodeData.graphqlDataQuery,
|
|
27
28
|
};
|
|
28
29
|
return new LoopNode({
|
|
29
|
-
|
|
30
|
-
name: raw.getName(),
|
|
30
|
+
...obj,
|
|
31
31
|
type: NodeType.Loop,
|
|
32
32
|
data: data,
|
|
33
33
|
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Node from "./interface";
|
|
2
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
3
|
+
import { RestAPINodeProps } from "@avaprotocol/types";
|
|
4
|
+
declare class RestAPINode extends Node {
|
|
5
|
+
constructor(props: RestAPINodeProps);
|
|
6
|
+
static fromResponse(raw: avs_pb.TaskNode): RestAPINode;
|
|
7
|
+
toRequest(): avs_pb.TaskNode;
|
|
8
|
+
static fromOutputData(outputData: avs_pb.RunNodeWithInputsResp): any;
|
|
9
|
+
}
|
|
10
|
+
export default RestAPINode;
|
|
11
|
+
//# sourceMappingURL=restApi.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restApi.d.ts","sourceRoot":"","sources":["../../../src/models/node/restApi.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
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,EAIL,gBAAgB,EAEjB,MAAM,oBAAoB,CAAC;AAM5B,cAAM,WAAY,SAAQ,IAAI;gBAChB,KAAK,EAAE,gBAAgB;IAInC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,WAAW;IAUtD,SAAS,IAAI,MAAM,CAAC,QAAQ;IAgC5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAerE;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -2,6 +2,7 @@ import Node from "./interface";
|
|
|
2
2
|
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
3
3
|
import { NodeType, } from "@avaprotocol/types";
|
|
4
4
|
import { convertProtobufValueToJs } from "../../utils";
|
|
5
|
+
// Required props for constructor: id, name, type and data: { url, method, headersMap, body }
|
|
5
6
|
class RestAPINode extends Node {
|
|
6
7
|
constructor(props) {
|
|
7
8
|
super({ ...props, type: NodeType.RestAPI, data: props.data });
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
+
import { StepProps } from "@avaprotocol/types";
|
|
3
|
+
declare class Step implements StepProps {
|
|
4
|
+
id: string;
|
|
5
|
+
type: string;
|
|
6
|
+
name: string;
|
|
7
|
+
success: boolean;
|
|
8
|
+
error: string;
|
|
9
|
+
log: string;
|
|
10
|
+
inputsList: string[];
|
|
11
|
+
output: any;
|
|
12
|
+
startAt: number;
|
|
13
|
+
endAt: number;
|
|
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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../src/models/step.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../src/models/step.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAEhD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAO/C,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,GAAG,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;gBAEF,KAAK,EAAE,SAAS;IAa5B,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,GAAG;IAmFlD,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI;CAgBvD;AAED,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
+
import Trigger from "./interface";
|
|
3
|
+
import { BlockTriggerOutput, BlockTriggerProps } from "@avaprotocol/types";
|
|
4
|
+
declare class BlockTrigger extends Trigger {
|
|
5
|
+
constructor(props: BlockTriggerProps);
|
|
6
|
+
toRequest(): avs_pb.TaskTrigger;
|
|
7
|
+
static fromResponse(raw: avs_pb.TaskTrigger): BlockTrigger;
|
|
8
|
+
/**
|
|
9
|
+
* Convert raw data from runNodeWithInputs response to BlockOutput format
|
|
10
|
+
* @param rawData - The raw data from the gRPC response
|
|
11
|
+
* @returns {BlockTriggerOutput | undefined} - The converted data
|
|
12
|
+
*/
|
|
13
|
+
getOutput(): BlockTriggerOutput | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Extract output data from RunTriggerResp for block triggers
|
|
16
|
+
* @param outputData - The RunTriggerResp containing block trigger output
|
|
17
|
+
* @returns Plain JavaScript object with block trigger data
|
|
18
|
+
*/
|
|
19
|
+
static fromOutputData(outputData: avs_pb.RunTriggerResp): any;
|
|
20
|
+
}
|
|
21
|
+
export default BlockTrigger;
|
|
22
|
+
//# sourceMappingURL=block.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/block.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,
|
|
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;AACrD,OAAO,EAAqC,kBAAkB,EAAE,iBAAiB,EAAgB,MAAM,oBAAoB,CAAC;AAK5H,cAAM,YAAa,SAAQ,OAAO;gBACpB,KAAK,EAAE,iBAAiB;IAIpC,SAAS,IAAI,MAAM,CAAC,WAAW;IAoB/B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,GAAG,YAAY;IAuB1D;;;;OAIG;IACH,SAAS,IAAI,kBAAkB,GAAG,SAAS;IAI3C;;;;OAIG;IACH,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,cAAc,GAAG,GAAG;CAI9D;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
2
|
import Trigger from "./interface";
|
|
3
3
|
import { TriggerType } from "@avaprotocol/types";
|
|
4
|
+
// Required props for constructor: id, name, type and data: { interval }
|
|
4
5
|
class BlockTrigger extends Trigger {
|
|
5
6
|
constructor(props) {
|
|
6
7
|
super({ ...props, type: TriggerType.Block, data: props.data });
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
+
import Trigger from "./interface";
|
|
3
|
+
import { CronTriggerOutput, CronTriggerProps } from "@avaprotocol/types";
|
|
4
|
+
declare class CronTrigger extends Trigger {
|
|
5
|
+
constructor(props: CronTriggerProps);
|
|
6
|
+
toRequest(): avs_pb.TaskTrigger;
|
|
7
|
+
static fromResponse(raw: avs_pb.TaskTrigger): CronTrigger;
|
|
8
|
+
/**
|
|
9
|
+
* Convert raw data from runTrigger response to CronOutput format
|
|
10
|
+
* @param rawData - The raw data from the gRPC response
|
|
11
|
+
* @returns {CronTriggerOutput | undefined} - The converted data
|
|
12
|
+
*/
|
|
13
|
+
getOutput(): CronTriggerOutput | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Extract output data from RunTriggerResp for cron triggers
|
|
16
|
+
* Updated to handle timestamp and timestamp_iso instead of epoch
|
|
17
|
+
* @param outputData - The RunTriggerResp containing cron trigger output
|
|
18
|
+
* @returns Plain JavaScript object with cron trigger data
|
|
19
|
+
*/
|
|
20
|
+
static fromOutputData(outputData: avs_pb.RunTriggerResp): any;
|
|
21
|
+
}
|
|
22
|
+
export default CronTrigger;
|
|
23
|
+
//# sourceMappingURL=cron.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cron.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/cron.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,
|
|
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,OAA0B,MAAM,aAAa,CAAC;AACrD,OAAO,EAAoC,iBAAiB,EAAE,gBAAgB,EAAgB,MAAM,oBAAoB,CAAC;AAKzH,cAAM,WAAY,SAAQ,OAAO;gBACnB,KAAK,EAAE,gBAAgB;IAInC,SAAS,IAAI,MAAM,CAAC,WAAW;IAoB/B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,GAAG,WAAW;IAuBzD;;;;OAIG;IACH,SAAS,IAAI,iBAAiB,GAAG,SAAS;IAI1C;;;;;OAKG;IACH,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,cAAc,GAAG,GAAG;CAW9D;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
2
|
import Trigger from "./interface";
|
|
3
3
|
import { TriggerType } from "@avaprotocol/types";
|
|
4
|
+
// Required props for constructor: id, name, type and data: { scheduleList }
|
|
4
5
|
class CronTrigger extends Trigger {
|
|
5
6
|
constructor(props) {
|
|
6
7
|
super({ ...props, type: TriggerType.Cron, data: props.data });
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
+
import Trigger from "./interface";
|
|
3
|
+
import { EventTriggerOutput, EventTriggerProps } from "@avaprotocol/types";
|
|
4
|
+
declare class EventTrigger extends Trigger {
|
|
5
|
+
constructor(props: EventTriggerProps);
|
|
6
|
+
toRequest(): avs_pb.TaskTrigger;
|
|
7
|
+
static fromResponse(raw: avs_pb.TaskTrigger): EventTrigger;
|
|
8
|
+
/**
|
|
9
|
+
* Convert raw data from runTrigger response to EventOutput format
|
|
10
|
+
* @param rawData - The raw data from the gRPC response
|
|
11
|
+
* @returns {EventTriggerOutput | undefined} - The converted data
|
|
12
|
+
*/
|
|
13
|
+
getOutput(): EventTriggerOutput | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Extract output data from RunTriggerResp for event triggers
|
|
16
|
+
* @param outputData - The RunTriggerResp containing event trigger output
|
|
17
|
+
* @returns Plain JavaScript object with event trigger data
|
|
18
|
+
*/
|
|
19
|
+
static fromOutputData(outputData: avs_pb.RunTriggerResp): any;
|
|
20
|
+
}
|
|
21
|
+
export default EventTrigger;
|
|
22
|
+
//# sourceMappingURL=event.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/event.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,
|
|
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,EAAqC,kBAAkB,EAAE,iBAAiB,EAAgB,MAAM,oBAAoB,CAAC;AAwB5H,cAAM,YAAa,SAAQ,OAAO;gBACpB,KAAK,EAAE,iBAAiB;IAIpC,SAAS,IAAI,MAAM,CAAC,WAAW;IAyC/B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,GAAG,YAAY;IAiC1D;;;;OAIG;IACH,SAAS,IAAI,kBAAkB,GAAG,SAAS;IAI3C;;;;OAIG;IACH,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,cAAc,GAAG,GAAG;CAI9D;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -2,6 +2,25 @@ import * as _ from "lodash";
|
|
|
2
2
|
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
3
3
|
import Trigger from "./interface";
|
|
4
4
|
import { TriggerType } from "@avaprotocol/types";
|
|
5
|
+
// Ref: https://github.com/AvaProtocol/EigenLayer-AVS/issues/94
|
|
6
|
+
// The trigger is an array of Condition, which can be topics, dateRage, etc.
|
|
7
|
+
// We imply or operator among all conditions.
|
|
8
|
+
// ```
|
|
9
|
+
// [
|
|
10
|
+
// { type: "topics"
|
|
11
|
+
// value: ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
|
|
12
|
+
// null,
|
|
13
|
+
// "0x000000000000000000000000c60e71bd0f2e6d8832fea1a2d56091c48493c788"],
|
|
14
|
+
// },
|
|
15
|
+
// {
|
|
16
|
+
// type: "topics",
|
|
17
|
+
// value: ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
|
|
18
|
+
// "0x000000000000000000000000c60e71bd0f2e6d8832fea1a2d56091c48493c788",
|
|
19
|
+
// ]
|
|
20
|
+
// }
|
|
21
|
+
// ]
|
|
22
|
+
// ```
|
|
23
|
+
// Required props for constructor: id, name, type and data: { expression, matcherList }
|
|
5
24
|
class EventTrigger extends Trigger {
|
|
6
25
|
constructor(props) {
|
|
7
26
|
super({ ...props, type: TriggerType.Event, data: props.data });
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
+
import BlockTrigger from "./block";
|
|
3
|
+
import CronTrigger from "./cron";
|
|
4
|
+
import EventTrigger from "./event";
|
|
5
|
+
import FixedTimeTrigger from "./fixedTime";
|
|
6
|
+
import ManualTrigger from "./manual";
|
|
7
|
+
import Trigger from "./interface";
|
|
8
|
+
import { TriggerProps, BlockTriggerProps, CronTriggerProps, EventTriggerProps, FixedTimeTriggerProps, ManualTriggerProps } from "@avaprotocol/types";
|
|
9
|
+
declare class TriggerFactory {
|
|
10
|
+
/**
|
|
11
|
+
* Static factory method to create Trigger instances
|
|
12
|
+
* @param props
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
static create(props: TriggerProps): Trigger;
|
|
16
|
+
/**
|
|
17
|
+
* Create an instance of Trigger from AVS getWorkflow or getWorkflows response
|
|
18
|
+
* @param trigger
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
static fromResponse(raw: avs_pb.TaskTrigger): Trigger;
|
|
22
|
+
static fromOutputData(outputData: avs_pb.RunTriggerResp): any;
|
|
23
|
+
}
|
|
24
|
+
export default TriggerFactory;
|
|
25
|
+
export { Trigger, BlockTrigger, CronTrigger, EventTrigger, FixedTimeTrigger, ManualTrigger, };
|
|
26
|
+
export type { TriggerProps, BlockTriggerProps, CronTriggerProps, EventTriggerProps, FixedTimeTriggerProps, ManualTriggerProps, };
|
|
27
|
+
//# sourceMappingURL=factory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,YAAY,
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,YAAY,MAAM,SAAS,CAAC;AACnC,OAAO,WAAW,MAAM,QAAQ,CAAC;AACjC,OAAO,YAAY,MAAM,SAAS,CAAC;AACnC,OAAO,gBAAgB,MAAM,aAAa,CAAC;AAC3C,OAAO,aAAa,MAAM,UAAU,CAAC;AACrC,OAAO,OAAO,MAAM,aAAa,CAAC;AAClC,OAAO,EAEL,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAG5B,cAAM,cAAc;IAClB;;;;OAIG;IACH,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO;IAkB3C;;;;OAIG;IACH,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,GAAG,OAAO;IAiBrD,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,cAAc,GAAG,GAAG;CA+C9D;AAED,eAAe,cAAc,CAAC;AAG9B,OAAO,EACL,OAAO,EACP,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,aAAa,GACd,CAAC;AAGF,YAAY,EACV,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,GACnB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
+
import Trigger from "./interface";
|
|
3
|
+
import { FixedTimeTriggerOutput, FixedTimeTriggerProps } from "@avaprotocol/types";
|
|
4
|
+
declare class FixedTimeTrigger extends Trigger {
|
|
5
|
+
constructor(props: FixedTimeTriggerProps);
|
|
6
|
+
toRequest(): avs_pb.TaskTrigger;
|
|
7
|
+
static fromResponse(raw: avs_pb.TaskTrigger): FixedTimeTrigger;
|
|
8
|
+
/**
|
|
9
|
+
* Convert raw data from runTrigger response to FixedTimeOutput format
|
|
10
|
+
* @param rawData - The raw data from the gRPC response
|
|
11
|
+
* @returns {FixedTimeTriggerOutput | undefined} - The converted data
|
|
12
|
+
*/
|
|
13
|
+
getOutput(): FixedTimeTriggerOutput | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Extract output data from RunTriggerResp for fixed time triggers
|
|
16
|
+
* Updated to handle timestamp and timestamp_iso instead of epoch
|
|
17
|
+
* @param outputData - The RunTriggerResp containing fixed time trigger output
|
|
18
|
+
* @returns Plain JavaScript object with fixed time trigger data
|
|
19
|
+
*/
|
|
20
|
+
static fromOutputData(outputData: avs_pb.RunTriggerResp): any;
|
|
21
|
+
}
|
|
22
|
+
export default FixedTimeTrigger;
|
|
23
|
+
//# sourceMappingURL=fixedTime.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixedTime.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/fixedTime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,
|
|
1
|
+
{"version":3,"file":"fixedTime.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/fixedTime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,OAA0B,MAAM,aAAa,CAAC;AACrD,OAAO,EAAyC,sBAAsB,EAAE,qBAAqB,EAAgB,MAAM,oBAAoB,CAAC;AAKxI,cAAM,gBAAiB,SAAQ,OAAO;gBACxB,KAAK,EAAE,qBAAqB;IAIxC,SAAS,IAAI,MAAM,CAAC,WAAW;IAoB/B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,GAAG,gBAAgB;IAuB9D;;;;OAIG;IACH,SAAS,IAAI,sBAAsB,GAAG,SAAS;IAI/C;;;;;OAKG;IACH,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,cAAc,GAAG,GAAG;CAW9D;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
2
|
import Trigger from "./interface";
|
|
3
3
|
import { TriggerType } from "@avaprotocol/types";
|
|
4
|
+
// Required props for constructor: id, name, type and data: { epochsList }
|
|
4
5
|
class FixedTimeTrigger extends Trigger {
|
|
5
6
|
constructor(props) {
|
|
6
7
|
super({ ...props, type: TriggerType.FixedTime, data: props.data });
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
+
import { TriggerType, TriggerProps } from "@avaprotocol/types";
|
|
3
|
+
export type TriggerData = avs_pb.FixedTimeTrigger.AsObject | avs_pb.CronTrigger.AsObject | avs_pb.BlockTrigger.AsObject | avs_pb.EventTrigger.AsObject | Record<string, any> | null;
|
|
4
|
+
export type TriggerOutput = avs_pb.FixedTimeTrigger.Output.AsObject | avs_pb.CronTrigger.Output.AsObject | avs_pb.BlockTrigger.Output.AsObject | avs_pb.EventTrigger.Output.AsObject | avs_pb.ManualTrigger.Output.AsObject | null;
|
|
5
|
+
declare class Trigger implements TriggerProps {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
type: TriggerType;
|
|
9
|
+
data: TriggerData;
|
|
10
|
+
output?: TriggerOutput;
|
|
11
|
+
/**
|
|
12
|
+
* Create an instance of Trigger from user inputs
|
|
13
|
+
* @param props
|
|
14
|
+
*/
|
|
15
|
+
constructor(props: TriggerProps);
|
|
16
|
+
toRequest(): avs_pb.TaskTrigger;
|
|
17
|
+
getOutput(): TriggerOutput | undefined;
|
|
18
|
+
}
|
|
19
|
+
export default Trigger;
|
|
20
|
+
//# sourceMappingURL=interface.d.ts.map
|
|
@@ -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,MAAM,oBAAoB,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;IAEvB;;;OAGG;gBACS,KAAK,EAAE,YAAY;IAQ/B,SAAS,IAAI,MAAM,CAAC,WAAW;IAI/B,SAAS,IAAI,aAAa,GAAG,SAAS;CAGvC;AAED,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
+
import Trigger from "./interface";
|
|
3
|
+
import { ManualTriggerOutput, ManualTriggerProps } from "@avaprotocol/types";
|
|
4
|
+
declare class ManualTrigger extends Trigger {
|
|
5
|
+
constructor(props: ManualTriggerProps);
|
|
6
|
+
toRequest(): avs_pb.TaskTrigger;
|
|
7
|
+
static fromResponse(raw: avs_pb.TaskTrigger): ManualTrigger;
|
|
8
|
+
getInputVariables(): Record<string, any> | null;
|
|
9
|
+
/**
|
|
10
|
+
* Convert raw data from runTrigger response to ManualOutput format
|
|
11
|
+
* @param rawData - The raw data from the gRPC response
|
|
12
|
+
* @returns {ManualTriggerOutput | undefined} - The converted data
|
|
13
|
+
*/
|
|
14
|
+
getOutput(): ManualTriggerOutput | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Extract output data from RunTriggerResp for manual triggers
|
|
17
|
+
* @param outputData - The RunTriggerResp containing manual trigger output
|
|
18
|
+
* @returns Plain JavaScript object with manual trigger data
|
|
19
|
+
*/
|
|
20
|
+
static fromOutputData(outputData: avs_pb.RunTriggerResp): any;
|
|
21
|
+
}
|
|
22
|
+
export default ManualTrigger;
|
|
23
|
+
//# sourceMappingURL=manual.d.ts.map
|
|
@@ -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,
|
|
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;AAClC,OAAO,EAAe,mBAAmB,EAAE,kBAAkB,EAAgB,MAAM,oBAAoB,CAAC;AAIxG,cAAM,aAAc,SAAQ,OAAO;gBACrB,KAAK,EAAE,kBAAkB;IAIrC,SAAS,IAAI,MAAM,CAAC,WAAW;IAW/B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,GAAG,aAAa;IAU3D,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"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
+
import Node from "./node/interface";
|
|
3
|
+
import Edge from "./edge";
|
|
4
|
+
import Trigger from "./trigger/interface";
|
|
5
|
+
export declare const DefaultExpiredAt = -1;
|
|
6
|
+
import { WorkflowStatus, WorkflowProps } from "@avaprotocol/types";
|
|
7
|
+
export declare function convertStatusToString(status: avs_pb.TaskStatus): WorkflowStatus;
|
|
8
|
+
declare class Workflow implements WorkflowProps {
|
|
9
|
+
smartWalletAddress: string;
|
|
10
|
+
trigger: Trigger;
|
|
11
|
+
nodes: Node[];
|
|
12
|
+
edges: Edge[];
|
|
13
|
+
startAt: number;
|
|
14
|
+
expiredAt: number;
|
|
15
|
+
maxExecution: number;
|
|
16
|
+
id?: string;
|
|
17
|
+
owner?: string;
|
|
18
|
+
name?: string;
|
|
19
|
+
completedAt?: number;
|
|
20
|
+
status?: WorkflowStatus;
|
|
21
|
+
lastRanAt?: number;
|
|
22
|
+
executionCount?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Create an instance of Workflow from user inputs
|
|
25
|
+
* @param props
|
|
26
|
+
*/
|
|
27
|
+
constructor(props: WorkflowProps);
|
|
28
|
+
/**
|
|
29
|
+
* Create an instance of Workflow from AVS getWorkflow response
|
|
30
|
+
* @param res
|
|
31
|
+
* @returns
|
|
32
|
+
*/
|
|
33
|
+
static fromResponse(obj: avs_pb.Task): Workflow;
|
|
34
|
+
/**
|
|
35
|
+
* Create an instance of Workflow with only selected fields
|
|
36
|
+
* @param obj
|
|
37
|
+
*/
|
|
38
|
+
static fromListResponse(obj: avs_pb.Task): Workflow;
|
|
39
|
+
toRequest(): avs_pb.CreateTaskReq;
|
|
40
|
+
}
|
|
41
|
+
export default Workflow;
|
|
42
|
+
//# sourceMappingURL=workflow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/models/workflow.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAEhD,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,OAAO,MAAM,qBAAqB,CAAC;AAG1C,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/models/workflow.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAEhD,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,OAAO,MAAM,qBAAqB,CAAC;AAG1C,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnE,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,CAAC,UAAU,GACxB,cAAc,CAUhB;AAID,cAAM,QAAS,YAAW,aAAa;IACrC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IAGrB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;OAGG;gBACS,KAAK,EAAE,aAAa;IAuBhC;;;;OAIG;IACH,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,GAAG,QAAQ;IAkC/C;;;OAGG;IACH,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,GAAG,QAAQ;IAyBnD,SAAS,IAAI,MAAM,CAAC,aAAa;CAsBlC;AAED,eAAe,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avaprotocol/sdk-js",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "A JavaScript/TypeScript SDK designed to simplify integration with Ava Protocol's AVS",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"clean": "rm -rf node_modules dist tsconfig.tsbuildinfo"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@avaprotocol/types": "
|
|
33
|
+
"@avaprotocol/types": "2.0.1",
|
|
34
34
|
"@grpc/grpc-js": "^1.11.3",
|
|
35
35
|
"@grpc/proto-loader": "^0.7.13",
|
|
36
36
|
"dotenv": "^16.4.5",
|