@avaprotocol/sdk-js 1.3.1-dev.0 → 1.3.2

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.d.mts CHANGED
@@ -696,8 +696,8 @@ declare class Task extends jspb.Message {
696
696
  setStartAt(value: number): Task;
697
697
  getExpiredAt(): number;
698
698
  setExpiredAt(value: number): Task;
699
- getMemo(): string;
700
- setMemo(value: string): Task;
699
+ getName(): string;
700
+ setName(value: string): Task;
701
701
  getCompletedAt(): number;
702
702
  setCompletedAt(value: number): Task;
703
703
  getMaxExecution(): number;
@@ -739,7 +739,7 @@ declare namespace Task {
739
739
  smartWalletAddress: string,
740
740
  startAt: number,
741
741
  expiredAt: number,
742
- memo: string,
742
+ name: string,
743
743
  completedAt: number,
744
744
  maxExecution: number,
745
745
  totalExecution: number,
@@ -765,8 +765,8 @@ declare class CreateTaskReq extends jspb.Message {
765
765
  setMaxExecution(value: number): CreateTaskReq;
766
766
  getSmartWalletAddress(): string;
767
767
  setSmartWalletAddress(value: string): CreateTaskReq;
768
- getMemo(): string;
769
- setMemo(value: string): CreateTaskReq;
768
+ getName(): string;
769
+ setName(value: string): CreateTaskReq;
770
770
  clearNodesList(): void;
771
771
  getNodesList(): Array<TaskNode>;
772
772
  setNodesList(value: Array<TaskNode>): CreateTaskReq;
@@ -793,7 +793,7 @@ declare namespace CreateTaskReq {
793
793
  expiredAt: number,
794
794
  maxExecution: number,
795
795
  smartWalletAddress: string,
796
- memo: string,
796
+ name: string,
797
797
  nodesList: Array<TaskNode.AsObject>,
798
798
  edgesList: Array<TaskEdge.AsObject>,
799
799
  }
@@ -860,8 +860,8 @@ declare namespace NonceResp {
860
860
  }
861
861
 
862
862
  declare class ListWalletReq extends jspb.Message {
863
- getFactory(): string;
864
- setFactory(value: string): ListWalletReq;
863
+ getFactoryAddress(): string;
864
+ setFactoryAddress(value: string): ListWalletReq;
865
865
  getSalt(): string;
866
866
  setSalt(value: string): ListWalletReq;
867
867
 
@@ -877,7 +877,7 @@ declare class ListWalletReq extends jspb.Message {
877
877
 
878
878
  declare namespace ListWalletReq {
879
879
  export type AsObject = {
880
- factory: string,
880
+ factoryAddress: string,
881
881
  salt: string,
882
882
  }
883
883
  }
@@ -997,8 +997,8 @@ declare namespace ListTasksResp {
997
997
  setStartAt(value: number): Item;
998
998
  getExpiredAt(): number;
999
999
  setExpiredAt(value: number): Item;
1000
- getMemo(): string;
1001
- setMemo(value: string): Item;
1000
+ getName(): string;
1001
+ setName(value: string): Item;
1002
1002
  getCompletedAt(): number;
1003
1003
  setCompletedAt(value: number): Item;
1004
1004
  getMaxExecution(): number;
@@ -1032,7 +1032,7 @@ declare namespace ListTasksResp {
1032
1032
  smartWalletAddress: string,
1033
1033
  startAt: number,
1034
1034
  expiredAt: number,
1035
- memo: string,
1035
+ name: string,
1036
1036
  completedAt: number,
1037
1037
  maxExecution: number,
1038
1038
  totalExecution: number,
@@ -1100,29 +1100,49 @@ declare namespace ListExecutionsResp {
1100
1100
  }
1101
1101
  }
1102
1102
 
1103
- declare class GetExecutionReq extends jspb.Message {
1103
+ declare class ExecutionReq extends jspb.Message {
1104
1104
  getTaskId(): string;
1105
- setTaskId(value: string): GetExecutionReq;
1105
+ setTaskId(value: string): ExecutionReq;
1106
1106
  getExecutionId(): string;
1107
- setExecutionId(value: string): GetExecutionReq;
1107
+ setExecutionId(value: string): ExecutionReq;
1108
1108
 
1109
1109
  serializeBinary(): Uint8Array;
1110
- toObject(includeInstance?: boolean): GetExecutionReq.AsObject;
1111
- static toObject(includeInstance: boolean, msg: GetExecutionReq): GetExecutionReq.AsObject;
1110
+ toObject(includeInstance?: boolean): ExecutionReq.AsObject;
1111
+ static toObject(includeInstance: boolean, msg: ExecutionReq): ExecutionReq.AsObject;
1112
1112
  static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
1113
1113
  static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
1114
- static serializeBinaryToWriter(message: GetExecutionReq, writer: jspb.BinaryWriter): void;
1115
- static deserializeBinary(bytes: Uint8Array): GetExecutionReq;
1116
- static deserializeBinaryFromReader(message: GetExecutionReq, reader: jspb.BinaryReader): GetExecutionReq;
1114
+ static serializeBinaryToWriter(message: ExecutionReq, writer: jspb.BinaryWriter): void;
1115
+ static deserializeBinary(bytes: Uint8Array): ExecutionReq;
1116
+ static deserializeBinaryFromReader(message: ExecutionReq, reader: jspb.BinaryReader): ExecutionReq;
1117
1117
  }
1118
1118
 
1119
- declare namespace GetExecutionReq {
1119
+ declare namespace ExecutionReq {
1120
1120
  export type AsObject = {
1121
1121
  taskId: string,
1122
1122
  executionId: string,
1123
1123
  }
1124
1124
  }
1125
1125
 
1126
+ declare class ExecutionStatusResp extends jspb.Message {
1127
+ getStatus(): ExecutionStatus$1;
1128
+ setStatus(value: ExecutionStatus$1): ExecutionStatusResp;
1129
+
1130
+ serializeBinary(): Uint8Array;
1131
+ toObject(includeInstance?: boolean): ExecutionStatusResp.AsObject;
1132
+ static toObject(includeInstance: boolean, msg: ExecutionStatusResp): ExecutionStatusResp.AsObject;
1133
+ static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
1134
+ static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
1135
+ static serializeBinaryToWriter(message: ExecutionStatusResp, writer: jspb.BinaryWriter): void;
1136
+ static deserializeBinary(bytes: Uint8Array): ExecutionStatusResp;
1137
+ static deserializeBinaryFromReader(message: ExecutionStatusResp, reader: jspb.BinaryReader): ExecutionStatusResp;
1138
+ }
1139
+
1140
+ declare namespace ExecutionStatusResp {
1141
+ export type AsObject = {
1142
+ status: ExecutionStatus$1,
1143
+ }
1144
+ }
1145
+
1126
1146
  declare class GetKeyReq extends jspb.Message {
1127
1147
  getOwner(): string;
1128
1148
  setOwner(value: string): GetKeyReq;
@@ -1290,10 +1310,10 @@ declare namespace UserTriggerTaskReq {
1290
1310
  }
1291
1311
 
1292
1312
  declare class UserTriggerTaskResp extends jspb.Message {
1293
- getResult(): boolean;
1294
- setResult(value: boolean): UserTriggerTaskResp;
1295
1313
  getExecutionId(): string;
1296
1314
  setExecutionId(value: string): UserTriggerTaskResp;
1315
+ getStatus(): ExecutionStatus$1;
1316
+ setStatus(value: ExecutionStatus$1): UserTriggerTaskResp;
1297
1317
 
1298
1318
  serializeBinary(): Uint8Array;
1299
1319
  toObject(includeInstance?: boolean): UserTriggerTaskResp.AsObject;
@@ -1307,8 +1327,8 @@ declare class UserTriggerTaskResp extends jspb.Message {
1307
1327
 
1308
1328
  declare namespace UserTriggerTaskResp {
1309
1329
  export type AsObject = {
1310
- result: boolean,
1311
1330
  executionId: string,
1331
+ status: ExecutionStatus$1,
1312
1332
  }
1313
1333
  }
1314
1334
 
@@ -1320,6 +1340,11 @@ declare enum TaskStatus {
1320
1340
  EXECUTING = 4,
1321
1341
  }
1322
1342
 
1343
+ declare enum ExecutionStatus$1 {
1344
+ QUEUED = 0,
1345
+ FINISHED = 2,
1346
+ }
1347
+
1323
1348
  declare enum CustomCodeLang {
1324
1349
  JAVASCRIPT = 0,
1325
1350
  }
@@ -1354,9 +1379,12 @@ interface IAggregatorClient {
1354
1379
  listExecutions(request: ListExecutionsReq, callback: (error: grpc.ServiceError | null, response: ListExecutionsResp) => void): grpc.ClientUnaryCall;
1355
1380
  listExecutions(request: ListExecutionsReq, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: ListExecutionsResp) => void): grpc.ClientUnaryCall;
1356
1381
  listExecutions(request: ListExecutionsReq, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: ListExecutionsResp) => void): grpc.ClientUnaryCall;
1357
- getExecution(request: GetExecutionReq, callback: (error: grpc.ServiceError | null, response: Execution$1) => void): grpc.ClientUnaryCall;
1358
- getExecution(request: GetExecutionReq, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Execution$1) => void): grpc.ClientUnaryCall;
1359
- getExecution(request: GetExecutionReq, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: Execution$1) => void): grpc.ClientUnaryCall;
1382
+ getExecution(request: ExecutionReq, callback: (error: grpc.ServiceError | null, response: Execution$1) => void): grpc.ClientUnaryCall;
1383
+ getExecution(request: ExecutionReq, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Execution$1) => void): grpc.ClientUnaryCall;
1384
+ getExecution(request: ExecutionReq, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: Execution$1) => void): grpc.ClientUnaryCall;
1385
+ getExecutionStatus(request: ExecutionReq, callback: (error: grpc.ServiceError | null, response: ExecutionStatusResp) => void): grpc.ClientUnaryCall;
1386
+ getExecutionStatus(request: ExecutionReq, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: ExecutionStatusResp) => void): grpc.ClientUnaryCall;
1387
+ getExecutionStatus(request: ExecutionReq, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: ExecutionStatusResp) => void): grpc.ClientUnaryCall;
1360
1388
  cancelTask(request: IdReq, callback: (error: grpc.ServiceError | null, response: google_protobuf_wrappers_pb.BoolValue) => void): grpc.ClientUnaryCall;
1361
1389
  cancelTask(request: IdReq, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: google_protobuf_wrappers_pb.BoolValue) => void): grpc.ClientUnaryCall;
1362
1390
  cancelTask(request: IdReq, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: google_protobuf_wrappers_pb.BoolValue) => void): grpc.ClientUnaryCall;
@@ -1394,9 +1422,12 @@ declare class AggregatorClient extends grpc.Client implements IAggregatorClient
1394
1422
  public listExecutions(request: ListExecutionsReq, callback: (error: grpc.ServiceError | null, response: ListExecutionsResp) => void): grpc.ClientUnaryCall;
1395
1423
  public listExecutions(request: ListExecutionsReq, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: ListExecutionsResp) => void): grpc.ClientUnaryCall;
1396
1424
  public listExecutions(request: ListExecutionsReq, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: ListExecutionsResp) => void): grpc.ClientUnaryCall;
1397
- public getExecution(request: GetExecutionReq, callback: (error: grpc.ServiceError | null, response: Execution$1) => void): grpc.ClientUnaryCall;
1398
- public getExecution(request: GetExecutionReq, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Execution$1) => void): grpc.ClientUnaryCall;
1399
- public getExecution(request: GetExecutionReq, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: Execution$1) => void): grpc.ClientUnaryCall;
1425
+ public getExecution(request: ExecutionReq, callback: (error: grpc.ServiceError | null, response: Execution$1) => void): grpc.ClientUnaryCall;
1426
+ public getExecution(request: ExecutionReq, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Execution$1) => void): grpc.ClientUnaryCall;
1427
+ public getExecution(request: ExecutionReq, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: Execution$1) => void): grpc.ClientUnaryCall;
1428
+ public getExecutionStatus(request: ExecutionReq, callback: (error: grpc.ServiceError | null, response: ExecutionStatusResp) => void): grpc.ClientUnaryCall;
1429
+ public getExecutionStatus(request: ExecutionReq, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: ExecutionStatusResp) => void): grpc.ClientUnaryCall;
1430
+ public getExecutionStatus(request: ExecutionReq, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: ExecutionStatusResp) => void): grpc.ClientUnaryCall;
1400
1431
  public cancelTask(request: IdReq, callback: (error: grpc.ServiceError | null, response: google_protobuf_wrappers_pb.BoolValue) => void): grpc.ClientUnaryCall;
1401
1432
  public cancelTask(request: IdReq, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: google_protobuf_wrappers_pb.BoolValue) => void): grpc.ClientUnaryCall;
1402
1433
  public cancelTask(request: IdReq, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: google_protobuf_wrappers_pb.BoolValue) => void): grpc.ClientUnaryCall;
@@ -1473,6 +1504,7 @@ declare enum TriggerType {
1473
1504
  Unset = "unset"
1474
1505
  }
1475
1506
  type SmartWallet = SmartWallet$1.AsObject;
1507
+ declare const ExecutionStatus: typeof ExecutionStatus$1;
1476
1508
 
1477
1509
  type TriggerData = FixedTimeCondition.AsObject | CronCondition.AsObject | BlockCondition.AsObject | EventCondition.AsObject | null;
1478
1510
  type TriggerProps = Omit<TaskTrigger.AsObject, "manual" | "fixedTime" | "cron" | "block" | "event"> & {
@@ -1491,12 +1523,12 @@ declare class Trigger implements TriggerProps {
1491
1523
  toRequest(): TaskTrigger;
1492
1524
  }
1493
1525
 
1494
- type WorkflowProps = Omit<Task.AsObject, "id" | "owner" | "completedAt" | "status" | "executionsList" | "memo" | "trigger" | "nodesList" | "edgesList" | "totalExecution" | "lastRanAt"> & {
1526
+ type WorkflowProps = Omit<Task.AsObject, "id" | "owner" | "completedAt" | "status" | "executionsList" | "name" | "trigger" | "nodesList" | "edgesList" | "totalExecution" | "lastRanAt"> & {
1495
1527
  id?: string;
1496
1528
  owner?: string;
1497
1529
  completedAt?: number;
1498
1530
  status?: WorkflowStatus;
1499
- memo?: string;
1531
+ name?: string;
1500
1532
  trigger: Trigger;
1501
1533
  nodes: Node[];
1502
1534
  edges: Edge[];
@@ -1513,7 +1545,7 @@ declare class Workflow implements WorkflowProps {
1513
1545
  maxExecution: number;
1514
1546
  id?: string;
1515
1547
  owner?: string;
1516
- memo?: string;
1548
+ name?: string;
1517
1549
  completedAt?: number;
1518
1550
  status?: WorkflowStatus;
1519
1551
  totalExecution?: number;
@@ -1849,6 +1881,17 @@ declare class Client extends BaseClient {
1849
1881
  * @returns {Promise<Execution>} - The result execution if it is existed
1850
1882
  */
1851
1883
  getExecution(taskId: string, executionId: string, options?: RequestOptions): Promise<Execution>;
1884
+ /**
1885
+ * Get status of an execution.
1886
+ *
1887
+ * When a task is trigger in async manner, it has not run yet, so the data isn't available to return in GetExecution. Calling GetExecution will return in execution not found. We can instad call getExecutionStatus to check whether the execution is finished or not.
1888
+ *
1889
+ * @param {string} workflowId - The workflow id
1890
+ * @param {string} executionId - The exectuion id
1891
+ * @param {GetExecutionsRequest} options - Request options
1892
+ * @returns {Promise<ExecutionStatus>} - The result execution if it is existed
1893
+ */
1894
+ getExecutionStatus(taskId: string, executionId: string, options?: RequestOptions): Promise<ExecutionStatus$1>;
1852
1895
  /**
1853
1896
  * Get a workflow by its Id
1854
1897
  * @param {string} id - The Id of the workflow
@@ -1885,4 +1928,4 @@ declare class Client extends BaseClient {
1885
1928
  deleteWorkflow(id: string, options?: RequestOptions): Promise<boolean>;
1886
1929
  }
1887
1930
 
1888
- export { AUTH_KEY_HEADER, BlockTrigger, type BlockTriggerProps, BranchNode, type BranchNodeData, type BranchNodeProps, type ClientOption, ContractReadNode, type ContractReadNodeProps, ContractWriteNode, type ContractWriteNodeProps, CronTrigger, type CronTriggerProps, CustomCodeLangs, CustomCodeNode, type CustomCodeNodeProps, DEFAULT_LIMIT, ETHTransferNode, type ETHTransferNodeProps, Edge, type EdgeProps, type Environment, EventTrigger, type EventTriggerProps, Execution, FixedTimeTrigger, type FixedTimeTriggerProps, type GetExecutionsRequest, type GetKeyResponse, type GetWalletRequest, type GetWorkflowsRequest, GraphQLQueryNode, type GraphQLQueryNodeProps, Node, NodeFactory, type NodeProps, type RequestOptions, RestAPINode, type RestAPINodeProps, type SmartWallet, Trigger, TriggerFactory, type TriggerProps, TriggerType, Workflow, type WorkflowProps, WorkflowStatus, Client as default, getKeyRequestMessage };
1931
+ export { AUTH_KEY_HEADER, BlockTrigger, type BlockTriggerProps, BranchNode, type BranchNodeData, type BranchNodeProps, type ClientOption, ContractReadNode, type ContractReadNodeProps, ContractWriteNode, type ContractWriteNodeProps, CronTrigger, type CronTriggerProps, CustomCodeLangs, CustomCodeNode, type CustomCodeNodeProps, DEFAULT_LIMIT, ETHTransferNode, type ETHTransferNodeProps, Edge, type EdgeProps, type Environment, EventTrigger, type EventTriggerProps, Execution, ExecutionStatus, FixedTimeTrigger, type FixedTimeTriggerProps, type GetExecutionsRequest, type GetKeyResponse, type GetWalletRequest, type GetWorkflowsRequest, GraphQLQueryNode, type GraphQLQueryNodeProps, Node, NodeFactory, type NodeProps, type RequestOptions, RestAPINode, type RestAPINodeProps, type SmartWallet, Trigger, TriggerFactory, type TriggerProps, TriggerType, Workflow, type WorkflowProps, WorkflowStatus, Client as default, getKeyRequestMessage };
package/dist/index.d.ts CHANGED
@@ -696,8 +696,8 @@ declare class Task extends jspb.Message {
696
696
  setStartAt(value: number): Task;
697
697
  getExpiredAt(): number;
698
698
  setExpiredAt(value: number): Task;
699
- getMemo(): string;
700
- setMemo(value: string): Task;
699
+ getName(): string;
700
+ setName(value: string): Task;
701
701
  getCompletedAt(): number;
702
702
  setCompletedAt(value: number): Task;
703
703
  getMaxExecution(): number;
@@ -739,7 +739,7 @@ declare namespace Task {
739
739
  smartWalletAddress: string,
740
740
  startAt: number,
741
741
  expiredAt: number,
742
- memo: string,
742
+ name: string,
743
743
  completedAt: number,
744
744
  maxExecution: number,
745
745
  totalExecution: number,
@@ -765,8 +765,8 @@ declare class CreateTaskReq extends jspb.Message {
765
765
  setMaxExecution(value: number): CreateTaskReq;
766
766
  getSmartWalletAddress(): string;
767
767
  setSmartWalletAddress(value: string): CreateTaskReq;
768
- getMemo(): string;
769
- setMemo(value: string): CreateTaskReq;
768
+ getName(): string;
769
+ setName(value: string): CreateTaskReq;
770
770
  clearNodesList(): void;
771
771
  getNodesList(): Array<TaskNode>;
772
772
  setNodesList(value: Array<TaskNode>): CreateTaskReq;
@@ -793,7 +793,7 @@ declare namespace CreateTaskReq {
793
793
  expiredAt: number,
794
794
  maxExecution: number,
795
795
  smartWalletAddress: string,
796
- memo: string,
796
+ name: string,
797
797
  nodesList: Array<TaskNode.AsObject>,
798
798
  edgesList: Array<TaskEdge.AsObject>,
799
799
  }
@@ -860,8 +860,8 @@ declare namespace NonceResp {
860
860
  }
861
861
 
862
862
  declare class ListWalletReq extends jspb.Message {
863
- getFactory(): string;
864
- setFactory(value: string): ListWalletReq;
863
+ getFactoryAddress(): string;
864
+ setFactoryAddress(value: string): ListWalletReq;
865
865
  getSalt(): string;
866
866
  setSalt(value: string): ListWalletReq;
867
867
 
@@ -877,7 +877,7 @@ declare class ListWalletReq extends jspb.Message {
877
877
 
878
878
  declare namespace ListWalletReq {
879
879
  export type AsObject = {
880
- factory: string,
880
+ factoryAddress: string,
881
881
  salt: string,
882
882
  }
883
883
  }
@@ -997,8 +997,8 @@ declare namespace ListTasksResp {
997
997
  setStartAt(value: number): Item;
998
998
  getExpiredAt(): number;
999
999
  setExpiredAt(value: number): Item;
1000
- getMemo(): string;
1001
- setMemo(value: string): Item;
1000
+ getName(): string;
1001
+ setName(value: string): Item;
1002
1002
  getCompletedAt(): number;
1003
1003
  setCompletedAt(value: number): Item;
1004
1004
  getMaxExecution(): number;
@@ -1032,7 +1032,7 @@ declare namespace ListTasksResp {
1032
1032
  smartWalletAddress: string,
1033
1033
  startAt: number,
1034
1034
  expiredAt: number,
1035
- memo: string,
1035
+ name: string,
1036
1036
  completedAt: number,
1037
1037
  maxExecution: number,
1038
1038
  totalExecution: number,
@@ -1100,29 +1100,49 @@ declare namespace ListExecutionsResp {
1100
1100
  }
1101
1101
  }
1102
1102
 
1103
- declare class GetExecutionReq extends jspb.Message {
1103
+ declare class ExecutionReq extends jspb.Message {
1104
1104
  getTaskId(): string;
1105
- setTaskId(value: string): GetExecutionReq;
1105
+ setTaskId(value: string): ExecutionReq;
1106
1106
  getExecutionId(): string;
1107
- setExecutionId(value: string): GetExecutionReq;
1107
+ setExecutionId(value: string): ExecutionReq;
1108
1108
 
1109
1109
  serializeBinary(): Uint8Array;
1110
- toObject(includeInstance?: boolean): GetExecutionReq.AsObject;
1111
- static toObject(includeInstance: boolean, msg: GetExecutionReq): GetExecutionReq.AsObject;
1110
+ toObject(includeInstance?: boolean): ExecutionReq.AsObject;
1111
+ static toObject(includeInstance: boolean, msg: ExecutionReq): ExecutionReq.AsObject;
1112
1112
  static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
1113
1113
  static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
1114
- static serializeBinaryToWriter(message: GetExecutionReq, writer: jspb.BinaryWriter): void;
1115
- static deserializeBinary(bytes: Uint8Array): GetExecutionReq;
1116
- static deserializeBinaryFromReader(message: GetExecutionReq, reader: jspb.BinaryReader): GetExecutionReq;
1114
+ static serializeBinaryToWriter(message: ExecutionReq, writer: jspb.BinaryWriter): void;
1115
+ static deserializeBinary(bytes: Uint8Array): ExecutionReq;
1116
+ static deserializeBinaryFromReader(message: ExecutionReq, reader: jspb.BinaryReader): ExecutionReq;
1117
1117
  }
1118
1118
 
1119
- declare namespace GetExecutionReq {
1119
+ declare namespace ExecutionReq {
1120
1120
  export type AsObject = {
1121
1121
  taskId: string,
1122
1122
  executionId: string,
1123
1123
  }
1124
1124
  }
1125
1125
 
1126
+ declare class ExecutionStatusResp extends jspb.Message {
1127
+ getStatus(): ExecutionStatus$1;
1128
+ setStatus(value: ExecutionStatus$1): ExecutionStatusResp;
1129
+
1130
+ serializeBinary(): Uint8Array;
1131
+ toObject(includeInstance?: boolean): ExecutionStatusResp.AsObject;
1132
+ static toObject(includeInstance: boolean, msg: ExecutionStatusResp): ExecutionStatusResp.AsObject;
1133
+ static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
1134
+ static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
1135
+ static serializeBinaryToWriter(message: ExecutionStatusResp, writer: jspb.BinaryWriter): void;
1136
+ static deserializeBinary(bytes: Uint8Array): ExecutionStatusResp;
1137
+ static deserializeBinaryFromReader(message: ExecutionStatusResp, reader: jspb.BinaryReader): ExecutionStatusResp;
1138
+ }
1139
+
1140
+ declare namespace ExecutionStatusResp {
1141
+ export type AsObject = {
1142
+ status: ExecutionStatus$1,
1143
+ }
1144
+ }
1145
+
1126
1146
  declare class GetKeyReq extends jspb.Message {
1127
1147
  getOwner(): string;
1128
1148
  setOwner(value: string): GetKeyReq;
@@ -1290,10 +1310,10 @@ declare namespace UserTriggerTaskReq {
1290
1310
  }
1291
1311
 
1292
1312
  declare class UserTriggerTaskResp extends jspb.Message {
1293
- getResult(): boolean;
1294
- setResult(value: boolean): UserTriggerTaskResp;
1295
1313
  getExecutionId(): string;
1296
1314
  setExecutionId(value: string): UserTriggerTaskResp;
1315
+ getStatus(): ExecutionStatus$1;
1316
+ setStatus(value: ExecutionStatus$1): UserTriggerTaskResp;
1297
1317
 
1298
1318
  serializeBinary(): Uint8Array;
1299
1319
  toObject(includeInstance?: boolean): UserTriggerTaskResp.AsObject;
@@ -1307,8 +1327,8 @@ declare class UserTriggerTaskResp extends jspb.Message {
1307
1327
 
1308
1328
  declare namespace UserTriggerTaskResp {
1309
1329
  export type AsObject = {
1310
- result: boolean,
1311
1330
  executionId: string,
1331
+ status: ExecutionStatus$1,
1312
1332
  }
1313
1333
  }
1314
1334
 
@@ -1320,6 +1340,11 @@ declare enum TaskStatus {
1320
1340
  EXECUTING = 4,
1321
1341
  }
1322
1342
 
1343
+ declare enum ExecutionStatus$1 {
1344
+ QUEUED = 0,
1345
+ FINISHED = 2,
1346
+ }
1347
+
1323
1348
  declare enum CustomCodeLang {
1324
1349
  JAVASCRIPT = 0,
1325
1350
  }
@@ -1354,9 +1379,12 @@ interface IAggregatorClient {
1354
1379
  listExecutions(request: ListExecutionsReq, callback: (error: grpc.ServiceError | null, response: ListExecutionsResp) => void): grpc.ClientUnaryCall;
1355
1380
  listExecutions(request: ListExecutionsReq, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: ListExecutionsResp) => void): grpc.ClientUnaryCall;
1356
1381
  listExecutions(request: ListExecutionsReq, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: ListExecutionsResp) => void): grpc.ClientUnaryCall;
1357
- getExecution(request: GetExecutionReq, callback: (error: grpc.ServiceError | null, response: Execution$1) => void): grpc.ClientUnaryCall;
1358
- getExecution(request: GetExecutionReq, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Execution$1) => void): grpc.ClientUnaryCall;
1359
- getExecution(request: GetExecutionReq, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: Execution$1) => void): grpc.ClientUnaryCall;
1382
+ getExecution(request: ExecutionReq, callback: (error: grpc.ServiceError | null, response: Execution$1) => void): grpc.ClientUnaryCall;
1383
+ getExecution(request: ExecutionReq, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Execution$1) => void): grpc.ClientUnaryCall;
1384
+ getExecution(request: ExecutionReq, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: Execution$1) => void): grpc.ClientUnaryCall;
1385
+ getExecutionStatus(request: ExecutionReq, callback: (error: grpc.ServiceError | null, response: ExecutionStatusResp) => void): grpc.ClientUnaryCall;
1386
+ getExecutionStatus(request: ExecutionReq, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: ExecutionStatusResp) => void): grpc.ClientUnaryCall;
1387
+ getExecutionStatus(request: ExecutionReq, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: ExecutionStatusResp) => void): grpc.ClientUnaryCall;
1360
1388
  cancelTask(request: IdReq, callback: (error: grpc.ServiceError | null, response: google_protobuf_wrappers_pb.BoolValue) => void): grpc.ClientUnaryCall;
1361
1389
  cancelTask(request: IdReq, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: google_protobuf_wrappers_pb.BoolValue) => void): grpc.ClientUnaryCall;
1362
1390
  cancelTask(request: IdReq, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: google_protobuf_wrappers_pb.BoolValue) => void): grpc.ClientUnaryCall;
@@ -1394,9 +1422,12 @@ declare class AggregatorClient extends grpc.Client implements IAggregatorClient
1394
1422
  public listExecutions(request: ListExecutionsReq, callback: (error: grpc.ServiceError | null, response: ListExecutionsResp) => void): grpc.ClientUnaryCall;
1395
1423
  public listExecutions(request: ListExecutionsReq, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: ListExecutionsResp) => void): grpc.ClientUnaryCall;
1396
1424
  public listExecutions(request: ListExecutionsReq, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: ListExecutionsResp) => void): grpc.ClientUnaryCall;
1397
- public getExecution(request: GetExecutionReq, callback: (error: grpc.ServiceError | null, response: Execution$1) => void): grpc.ClientUnaryCall;
1398
- public getExecution(request: GetExecutionReq, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Execution$1) => void): grpc.ClientUnaryCall;
1399
- public getExecution(request: GetExecutionReq, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: Execution$1) => void): grpc.ClientUnaryCall;
1425
+ public getExecution(request: ExecutionReq, callback: (error: grpc.ServiceError | null, response: Execution$1) => void): grpc.ClientUnaryCall;
1426
+ public getExecution(request: ExecutionReq, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Execution$1) => void): grpc.ClientUnaryCall;
1427
+ public getExecution(request: ExecutionReq, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: Execution$1) => void): grpc.ClientUnaryCall;
1428
+ public getExecutionStatus(request: ExecutionReq, callback: (error: grpc.ServiceError | null, response: ExecutionStatusResp) => void): grpc.ClientUnaryCall;
1429
+ public getExecutionStatus(request: ExecutionReq, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: ExecutionStatusResp) => void): grpc.ClientUnaryCall;
1430
+ public getExecutionStatus(request: ExecutionReq, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: ExecutionStatusResp) => void): grpc.ClientUnaryCall;
1400
1431
  public cancelTask(request: IdReq, callback: (error: grpc.ServiceError | null, response: google_protobuf_wrappers_pb.BoolValue) => void): grpc.ClientUnaryCall;
1401
1432
  public cancelTask(request: IdReq, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: google_protobuf_wrappers_pb.BoolValue) => void): grpc.ClientUnaryCall;
1402
1433
  public cancelTask(request: IdReq, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: google_protobuf_wrappers_pb.BoolValue) => void): grpc.ClientUnaryCall;
@@ -1473,6 +1504,7 @@ declare enum TriggerType {
1473
1504
  Unset = "unset"
1474
1505
  }
1475
1506
  type SmartWallet = SmartWallet$1.AsObject;
1507
+ declare const ExecutionStatus: typeof ExecutionStatus$1;
1476
1508
 
1477
1509
  type TriggerData = FixedTimeCondition.AsObject | CronCondition.AsObject | BlockCondition.AsObject | EventCondition.AsObject | null;
1478
1510
  type TriggerProps = Omit<TaskTrigger.AsObject, "manual" | "fixedTime" | "cron" | "block" | "event"> & {
@@ -1491,12 +1523,12 @@ declare class Trigger implements TriggerProps {
1491
1523
  toRequest(): TaskTrigger;
1492
1524
  }
1493
1525
 
1494
- type WorkflowProps = Omit<Task.AsObject, "id" | "owner" | "completedAt" | "status" | "executionsList" | "memo" | "trigger" | "nodesList" | "edgesList" | "totalExecution" | "lastRanAt"> & {
1526
+ type WorkflowProps = Omit<Task.AsObject, "id" | "owner" | "completedAt" | "status" | "executionsList" | "name" | "trigger" | "nodesList" | "edgesList" | "totalExecution" | "lastRanAt"> & {
1495
1527
  id?: string;
1496
1528
  owner?: string;
1497
1529
  completedAt?: number;
1498
1530
  status?: WorkflowStatus;
1499
- memo?: string;
1531
+ name?: string;
1500
1532
  trigger: Trigger;
1501
1533
  nodes: Node[];
1502
1534
  edges: Edge[];
@@ -1513,7 +1545,7 @@ declare class Workflow implements WorkflowProps {
1513
1545
  maxExecution: number;
1514
1546
  id?: string;
1515
1547
  owner?: string;
1516
- memo?: string;
1548
+ name?: string;
1517
1549
  completedAt?: number;
1518
1550
  status?: WorkflowStatus;
1519
1551
  totalExecution?: number;
@@ -1849,6 +1881,17 @@ declare class Client extends BaseClient {
1849
1881
  * @returns {Promise<Execution>} - The result execution if it is existed
1850
1882
  */
1851
1883
  getExecution(taskId: string, executionId: string, options?: RequestOptions): Promise<Execution>;
1884
+ /**
1885
+ * Get status of an execution.
1886
+ *
1887
+ * When a task is trigger in async manner, it has not run yet, so the data isn't available to return in GetExecution. Calling GetExecution will return in execution not found. We can instad call getExecutionStatus to check whether the execution is finished or not.
1888
+ *
1889
+ * @param {string} workflowId - The workflow id
1890
+ * @param {string} executionId - The exectuion id
1891
+ * @param {GetExecutionsRequest} options - Request options
1892
+ * @returns {Promise<ExecutionStatus>} - The result execution if it is existed
1893
+ */
1894
+ getExecutionStatus(taskId: string, executionId: string, options?: RequestOptions): Promise<ExecutionStatus$1>;
1852
1895
  /**
1853
1896
  * Get a workflow by its Id
1854
1897
  * @param {string} id - The Id of the workflow
@@ -1885,4 +1928,4 @@ declare class Client extends BaseClient {
1885
1928
  deleteWorkflow(id: string, options?: RequestOptions): Promise<boolean>;
1886
1929
  }
1887
1930
 
1888
- export { AUTH_KEY_HEADER, BlockTrigger, type BlockTriggerProps, BranchNode, type BranchNodeData, type BranchNodeProps, type ClientOption, ContractReadNode, type ContractReadNodeProps, ContractWriteNode, type ContractWriteNodeProps, CronTrigger, type CronTriggerProps, CustomCodeLangs, CustomCodeNode, type CustomCodeNodeProps, DEFAULT_LIMIT, ETHTransferNode, type ETHTransferNodeProps, Edge, type EdgeProps, type Environment, EventTrigger, type EventTriggerProps, Execution, FixedTimeTrigger, type FixedTimeTriggerProps, type GetExecutionsRequest, type GetKeyResponse, type GetWalletRequest, type GetWorkflowsRequest, GraphQLQueryNode, type GraphQLQueryNodeProps, Node, NodeFactory, type NodeProps, type RequestOptions, RestAPINode, type RestAPINodeProps, type SmartWallet, Trigger, TriggerFactory, type TriggerProps, TriggerType, Workflow, type WorkflowProps, WorkflowStatus, Client as default, getKeyRequestMessage };
1931
+ export { AUTH_KEY_HEADER, BlockTrigger, type BlockTriggerProps, BranchNode, type BranchNodeData, type BranchNodeProps, type ClientOption, ContractReadNode, type ContractReadNodeProps, ContractWriteNode, type ContractWriteNodeProps, CronTrigger, type CronTriggerProps, CustomCodeLangs, CustomCodeNode, type CustomCodeNodeProps, DEFAULT_LIMIT, ETHTransferNode, type ETHTransferNodeProps, Edge, type EdgeProps, type Environment, EventTrigger, type EventTriggerProps, Execution, ExecutionStatus, FixedTimeTrigger, type FixedTimeTriggerProps, type GetExecutionsRequest, type GetKeyResponse, type GetWalletRequest, type GetWorkflowsRequest, GraphQLQueryNode, type GraphQLQueryNodeProps, Node, NodeFactory, type NodeProps, type RequestOptions, RestAPINode, type RestAPINodeProps, type SmartWallet, Trigger, TriggerFactory, type TriggerProps, TriggerType, Workflow, type WorkflowProps, WorkflowStatus, Client as default, getKeyRequestMessage };