@avaprotocol/sdk-js 2.6.1 → 2.6.3
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 +16 -0
- package/dist/index.js +322 -214
- package/dist/index.mjs +322 -214
- package/dist/models/node/contractRead.d.ts.map +1 -1
- package/dist/models/node/contractRead.js +22 -26
- package/dist/models/node/contractWrite.d.ts.map +1 -1
- package/dist/models/node/contractWrite.js +46 -9
- package/dist/models/node/filter.d.ts +1 -1
- package/dist/models/node/filter.d.ts.map +1 -1
- package/dist/models/node/filter.js +5 -14
- package/dist/models/node/loop.d.ts.map +1 -1
- package/dist/models/node/loop.js +28 -19
- package/dist/models/trigger/event.d.ts.map +1 -1
- package/dist/models/trigger/event.js +17 -5
- package/package.json +2 -2
- package/dist/auth.d.ts +0 -2
- package/dist/auth.d.ts.map +0 -1
- package/dist/auth.js +0 -10
- package/dist/config.d.ts +0 -9
- package/dist/index.d.ts +0 -351
- package/dist/models/edge.d.ts +0 -12
- package/dist/models/execution.d.ts +0 -20
- package/dist/models/node/branch.d.ts +0 -11
- package/dist/models/node/contractRead.d.ts +0 -26
- package/dist/models/node/contractWrite.d.ts +0 -26
- package/dist/models/node/customCode.d.ts +0 -20
- package/dist/models/node/ethTransfer.d.ts +0 -20
- package/dist/models/node/factory.d.ts +0 -23
- package/dist/models/node/graphqlQuery.d.ts +0 -21
- package/dist/models/node/interface.d.ts +0 -20
- package/dist/models/node/loop.d.ts +0 -15
- package/dist/models/node/restApi.d.ts +0 -22
- package/dist/models/secret.d.ts +0 -16
- package/dist/models/step.d.ts +0 -27
- package/dist/models/trigger/block.d.ts +0 -22
- package/dist/models/trigger/cron.d.ts +0 -23
- package/dist/models/trigger/event.d.ts +0 -22
- package/dist/models/trigger/factory.d.ts +0 -27
- package/dist/models/trigger/fixedTime.d.ts +0 -23
- package/dist/models/trigger/interface.d.ts +0 -19
- package/dist/models/trigger/manual.d.ts +0 -16
- package/dist/models/workflow.d.ts +0 -47
- package/dist/utils.d.ts +0 -72
|
@@ -1,22 +0,0 @@
|
|
|
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,23 +0,0 @@
|
|
|
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,22 +0,0 @@
|
|
|
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,27 +0,0 @@
|
|
|
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,23 +0,0 @@
|
|
|
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,19 +0,0 @@
|
|
|
1
|
-
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
-
import { TriggerType, TriggerProps, TriggerData, TriggerOutput } from "@avaprotocol/types";
|
|
3
|
-
export default abstract class Trigger implements TriggerProps {
|
|
4
|
-
id: string;
|
|
5
|
-
name: string;
|
|
6
|
-
type: TriggerType;
|
|
7
|
-
data: TriggerData;
|
|
8
|
-
output?: TriggerOutput;
|
|
9
|
-
/**
|
|
10
|
-
* Create an instance of Trigger from user inputs
|
|
11
|
-
* @param props
|
|
12
|
-
*/
|
|
13
|
-
constructor(props: TriggerProps);
|
|
14
|
-
toRequest(): avs_pb.TaskTrigger;
|
|
15
|
-
static fromResponse(raw: avs_pb.TaskTrigger): Trigger;
|
|
16
|
-
getOutput(): TriggerOutput | undefined;
|
|
17
|
-
toJson(): TriggerProps;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=interface.d.ts.map
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
-
import Trigger from "./interface";
|
|
3
|
-
import { 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
|
-
/**
|
|
9
|
-
* Extract output data from RunTriggerResp for manual triggers
|
|
10
|
-
* @param outputData - The RunTriggerResp containing manual trigger output
|
|
11
|
-
* @returns The parsed JSON data directly (similar to CustomCode output)
|
|
12
|
-
*/
|
|
13
|
-
static fromOutputData(outputData: avs_pb.RunTriggerResp): unknown;
|
|
14
|
-
}
|
|
15
|
-
export default ManualTrigger;
|
|
16
|
-
//# sourceMappingURL=manual.d.ts.map
|
|
@@ -1,47 +0,0 @@
|
|
|
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
|
-
* Convert Workflow instance to plain object (WorkflowProps)
|
|
42
|
-
* This is useful for serialization, especially with Next.js Server Components
|
|
43
|
-
*/
|
|
44
|
-
toJson(): WorkflowProps;
|
|
45
|
-
}
|
|
46
|
-
export default Workflow;
|
|
47
|
-
//# sourceMappingURL=workflow.d.ts.map
|
package/dist/utils.d.ts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { Value as ProtobufValue } from "google-protobuf/google/protobuf/struct_pb";
|
|
2
|
-
/**
|
|
3
|
-
* Convert a protobuf Value to a JavaScript value
|
|
4
|
-
*
|
|
5
|
-
* **🏆 RECOMMENDED for modern protobuf usage**
|
|
6
|
-
*
|
|
7
|
-
* This is the primary implementation using proper TypeScript types and getKindCase()
|
|
8
|
-
* for the latest protobuf libraries. Use this for all new code.
|
|
9
|
-
*
|
|
10
|
-
* @param value - The protobuf Value to convert
|
|
11
|
-
* @returns The converted JavaScript value
|
|
12
|
-
*/
|
|
13
|
-
export declare function convertProtobufValueToJs(value?: ProtobufValue): any;
|
|
14
|
-
/**
|
|
15
|
-
* Convert a JavaScript value to a protobuf Value
|
|
16
|
-
*
|
|
17
|
-
* Uses proper TypeScript types for modern protobuf usage.
|
|
18
|
-
*
|
|
19
|
-
* @param value - The JavaScript value to convert
|
|
20
|
-
* @returns The protobuf Value object
|
|
21
|
-
*/
|
|
22
|
-
export declare function convertJSValueToProtobuf(value: any): ProtobufValue;
|
|
23
|
-
/**
|
|
24
|
-
* Convert protobuf trigger type string to SDK trigger type string
|
|
25
|
-
*
|
|
26
|
-
* @param protobufType - The protobuf trigger type string (e.g., "TRIGGER_TYPE_MANUAL")
|
|
27
|
-
* @returns The SDK trigger type string (e.g., "manualTrigger")
|
|
28
|
-
*/
|
|
29
|
-
export declare function convertProtobufTriggerTypeToSdk(protobufType: string): string;
|
|
30
|
-
/**
|
|
31
|
-
* Convert protobuf node type string to SDK node type string
|
|
32
|
-
*
|
|
33
|
-
* @param protobufType - The protobuf node type string (e.g., "NODE_TYPE_CUSTOM_CODE")
|
|
34
|
-
* @returns The SDK node type string (e.g., "customCode")
|
|
35
|
-
*/
|
|
36
|
-
export declare function convertProtobufNodeTypeToSdk(protobufType: string): string;
|
|
37
|
-
/**
|
|
38
|
-
* Convert protobuf step type string to SDK step type string
|
|
39
|
-
*
|
|
40
|
-
* Automatically detects whether the type is a trigger or node type and converts accordingly.
|
|
41
|
-
*
|
|
42
|
-
* @param protobufType - The protobuf type string (e.g., "TRIGGER_TYPE_MANUAL" or "NODE_TYPE_CUSTOM_CODE")
|
|
43
|
-
* @returns The SDK type string (e.g., "manualTrigger" or "customCode")
|
|
44
|
-
*/
|
|
45
|
-
export declare function convertProtobufStepTypeToSdk(protobufType: string): string;
|
|
46
|
-
/**
|
|
47
|
-
* Convert input field from JavaScript object to protobuf Value format
|
|
48
|
-
*
|
|
49
|
-
* Pure utility function for converting trigger/node input data to protobuf format.
|
|
50
|
-
* Can be used by both triggers and nodes.
|
|
51
|
-
*
|
|
52
|
-
* @param input - JavaScript object with input data, or undefined
|
|
53
|
-
* @returns protobuf Value or undefined if no input
|
|
54
|
-
*/
|
|
55
|
-
export declare function convertInputToProtobuf(input?: Record<string, any>): ProtobufValue | undefined;
|
|
56
|
-
/**
|
|
57
|
-
* Extract input field from protobuf Value format to JavaScript object
|
|
58
|
-
*
|
|
59
|
-
* Pure utility function for extracting trigger/node input data from protobuf format.
|
|
60
|
-
* Can be used by both triggers and nodes.
|
|
61
|
-
*
|
|
62
|
-
* @param inputValue - protobuf Value from response, plain JavaScript object, or undefined
|
|
63
|
-
* @returns JavaScript object or undefined
|
|
64
|
-
*/
|
|
65
|
-
export declare function extractInputFromProtobuf(inputValue?: ProtobufValue | Record<string, any>): Record<string, any> | undefined;
|
|
66
|
-
/**
|
|
67
|
-
* Clean up gRPC error messages by extracting the actual message
|
|
68
|
-
* @param message - The raw gRPC error message
|
|
69
|
-
* @returns {string} - The cleaned error message
|
|
70
|
-
*/
|
|
71
|
-
export declare function cleanGrpcErrorMessage(message: string): string;
|
|
72
|
-
//# sourceMappingURL=utils.d.ts.map
|