@avaprotocol/sdk-js 1.7.0 → 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.
Files changed (76) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/index.d.ts +16 -10
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +16618 -740
  5. package/dist/index.mjs +458 -108
  6. package/dist/models/edge.d.ts +1 -1
  7. package/dist/models/edge.d.ts.map +1 -1
  8. package/dist/models/execution.d.ts +1 -10
  9. package/dist/models/execution.d.ts.map +1 -1
  10. package/dist/models/node/branch.d.ts +1 -5
  11. package/dist/models/node/branch.d.ts.map +1 -1
  12. package/dist/models/node/branch.js +1 -0
  13. package/dist/models/node/contractRead.d.ts +1 -5
  14. package/dist/models/node/contractRead.d.ts.map +1 -1
  15. package/dist/models/node/contractRead.js +1 -0
  16. package/dist/models/node/contractWrite.d.ts +1 -5
  17. package/dist/models/node/contractWrite.d.ts.map +1 -1
  18. package/dist/models/node/contractWrite.js +1 -0
  19. package/dist/models/node/customCode.d.ts +1 -5
  20. package/dist/models/node/customCode.d.ts.map +1 -1
  21. package/dist/models/node/customCode.js +1 -0
  22. package/dist/models/node/ethTransfer.d.ts +1 -5
  23. package/dist/models/node/ethTransfer.d.ts.map +1 -1
  24. package/dist/models/node/ethTransfer.js +1 -0
  25. package/dist/models/node/factory.d.ts +11 -11
  26. package/dist/models/node/factory.d.ts.map +1 -1
  27. package/dist/models/node/filter.d.ts +1 -5
  28. package/dist/models/node/filter.d.ts.map +1 -1
  29. package/dist/models/node/filter.js +1 -0
  30. package/dist/models/node/graphqlQuery.d.ts +1 -5
  31. package/dist/models/node/graphqlQuery.d.ts.map +1 -1
  32. package/dist/models/node/graphqlQuery.js +1 -0
  33. package/dist/models/node/interface.d.ts +1 -5
  34. package/dist/models/node/interface.d.ts.map +1 -1
  35. package/dist/models/node/loop.d.ts +2 -5
  36. package/dist/models/node/loop.d.ts.map +1 -1
  37. package/dist/models/node/loop.js +2 -2
  38. package/dist/models/node/restApi.d.ts +1 -5
  39. package/dist/models/node/restApi.d.ts.map +1 -1
  40. package/dist/models/node/restApi.js +1 -0
  41. package/dist/models/step.d.ts +1 -3
  42. package/dist/models/step.d.ts.map +1 -1
  43. package/dist/models/trigger/block.d.ts +2 -5
  44. package/dist/models/trigger/block.d.ts.map +1 -1
  45. package/dist/models/trigger/block.js +2 -0
  46. package/dist/models/trigger/cron.d.ts +2 -5
  47. package/dist/models/trigger/cron.d.ts.map +1 -1
  48. package/dist/models/trigger/cron.js +2 -0
  49. package/dist/models/trigger/event.d.ts +2 -5
  50. package/dist/models/trigger/event.d.ts.map +1 -1
  51. package/dist/models/trigger/event.js +20 -0
  52. package/dist/models/trigger/factory.d.ts +7 -6
  53. package/dist/models/trigger/factory.d.ts.map +1 -1
  54. package/dist/models/trigger/fixedTime.d.ts +2 -5
  55. package/dist/models/trigger/fixedTime.d.ts.map +1 -1
  56. package/dist/models/trigger/fixedTime.js +2 -0
  57. package/dist/models/trigger/interface.d.ts +1 -6
  58. package/dist/models/trigger/interface.d.ts.map +1 -1
  59. package/dist/models/trigger/manual.d.ts +2 -5
  60. package/dist/models/trigger/manual.d.ts.map +1 -1
  61. package/dist/models/trigger/manual.js +1 -0
  62. package/dist/models/workflow.d.ts +1 -13
  63. package/dist/models/workflow.d.ts.map +1 -1
  64. package/package.json +2 -2
  65. package/dist/auth.d.ts +0 -2
  66. package/dist/auth.d.ts.map +0 -1
  67. package/dist/auth.js +0 -10
  68. package/dist/config.d.ts +0 -9
  69. package/dist/grpc_codegen/custom_types.d.ts +0 -45
  70. package/dist/grpc_codegen/custom_types.d.ts.map +0 -1
  71. package/dist/grpc_codegen/custom_types.js +0 -179
  72. package/dist/models/secret.d.ts +0 -16
  73. package/dist/models/trigger/reason.d.ts +0 -33
  74. package/dist/models/trigger/reason.d.ts.map +0 -1
  75. package/dist/models/trigger/reason.js +0 -96
  76. package/dist/utils.d.ts +0 -60
@@ -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AAC,WAAW;IAI/B,SAAS,IAAI,aAAa,GAAG,SAAS;CAGvC;AAED,eAAe,OAAO,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"}
@@ -1,9 +1,6 @@
1
1
  import * as avs_pb from "@/grpc_codegen/avs_pb";
2
- import Trigger, { TriggerProps } from "./interface";
3
- import { ManualTriggerOutput } from "@avaprotocol/types";
4
- export type ManualTriggerProps = TriggerProps & {
5
- data?: Record<string, any> | null;
6
- };
2
+ import Trigger from "./interface";
3
+ import { ManualTriggerOutput, ManualTriggerProps } from "@avaprotocol/types";
7
4
  declare class ManualTrigger extends Trigger {
8
5
  constructor(props: ManualTriggerProps);
9
6
  toRequest(): avs_pb.TaskTrigger;
@@ -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,EAAE,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAe,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEtE,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAA;CAClC,CAAC;AAEF,cAAM,aAAc,SAAQ,OAAO;gBACrB,KAAK,EAAE,kBAAkB;IAIrC,SAAS,IAAI,MAAM,CAAC,WAAW;IAU/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"}
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"}
@@ -9,6 +9,7 @@ class ManualTrigger extends Trigger {
9
9
  const trigger = new avs_pb.TaskTrigger();
10
10
  trigger.setId(this.id);
11
11
  trigger.setName(this.name);
12
+ trigger.setType(avs_pb.TriggerType.TRIGGER_TYPE_MANUAL);
12
13
  trigger.setManual(true);
13
14
  return trigger;
14
15
  }
@@ -3,20 +3,8 @@ import Node from "./node/interface";
3
3
  import Edge from "./edge";
4
4
  import Trigger from "./trigger/interface";
5
5
  export declare const DefaultExpiredAt = -1;
6
- import { WorkflowStatus } from "@avaprotocol/types";
6
+ import { WorkflowStatus, WorkflowProps } from "@avaprotocol/types";
7
7
  export declare function convertStatusToString(status: avs_pb.TaskStatus): WorkflowStatus;
8
- export type WorkflowProps = Omit<avs_pb.Task.AsObject, "id" | "owner" | "completedAt" | "status" | "name" | "trigger" | "nodesList" | "edgesList" | "lastRanAt" | "executionCount"> & {
9
- id?: string;
10
- owner?: string;
11
- completedAt?: number;
12
- status?: WorkflowStatus;
13
- name?: string;
14
- trigger: Trigger;
15
- nodes: Node[];
16
- edges: Edge[];
17
- lastRanAt?: number;
18
- executionCount?: number;
19
- };
20
8
  declare class Workflow implements WorkflowProps {
21
9
  smartWalletAddress: string;
22
10
  trigger: Trigger;
@@ -1 +1 @@
1
- {"version":3,"file":"workflow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,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": "1.7.0",
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": "1.1.0",
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",
package/dist/auth.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare const getKeyRequestMessage: (chainId: number, address: string, issuedAt: Date, expiredAt: Date) => string;
2
- //# sourceMappingURL=auth.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,GAAI,SAAS,MAAM,EAAE,SAAS,MAAM,EAAE,UAAU,IAAI,EAAE,WAAW,IAAI,KAAG,MAUxG,CAAA"}
package/dist/auth.js DELETED
@@ -1,10 +0,0 @@
1
- export const getKeyRequestMessage = (chainId, address, issuedAt, expiredAt) => {
2
- return `Please sign the below text for ownership verification.
3
-
4
- URI: https://app.avaprotocol.org
5
- Chain ID: ${chainId}
6
- Version: 1
7
- Issued At: ${issuedAt.toISOString()}
8
- Expire At: ${expiredAt.toISOString()}
9
- Wallet: ${address}`;
10
- };
package/dist/config.d.ts DELETED
@@ -1,9 +0,0 @@
1
- import { Environment } from "@avaprotocol/types";
2
- export declare const DEFAULT_JWT_EXPIRATION: number;
3
- interface Config {
4
- AVS_RPC_URL: string;
5
- }
6
- declare const configs: Record<Environment, Config>;
7
- export declare function getRpcEndpoint(env: Environment): string;
8
- export { configs };
9
- //# sourceMappingURL=config.d.ts.map
@@ -1,45 +0,0 @@
1
- import * as jspb from "google-protobuf";
2
- import * as google_protobuf_struct_pb from "google-protobuf/google/protobuf/struct_pb";
3
- /**
4
- * Custom implementation of RunNodeWithInputsReq class
5
- * This is needed because the class is not generated from the proto file
6
- */
7
- export declare class RunNodeWithInputsReq extends jspb.Message {
8
- private nodeType_;
9
- private nodeConfig_;
10
- private inputVariables_;
11
- constructor();
12
- getNodeType(): string;
13
- setNodeType(value: string): RunNodeWithInputsReq;
14
- getNodeConfig(): google_protobuf_struct_pb.Struct | undefined;
15
- setNodeConfig(value: google_protobuf_struct_pb.Struct | undefined): RunNodeWithInputsReq;
16
- getInputVariables(): google_protobuf_struct_pb.Struct | undefined;
17
- setInputVariables(value: google_protobuf_struct_pb.Struct | undefined): RunNodeWithInputsReq;
18
- serializeBinary(): Uint8Array;
19
- serializeBinaryToWriter(writer: jspb.BinaryWriter): void;
20
- toObject(includeInstance?: boolean): object;
21
- static deserializeBinary(bytes: Uint8Array): RunNodeWithInputsReq;
22
- static deserializeBinaryFromReader(message: RunNodeWithInputsReq, reader: jspb.BinaryReader): RunNodeWithInputsReq;
23
- }
24
- /**
25
- * Custom implementation of RunNodeWithInputsResp class
26
- * This is needed because the class is not generated from the proto file
27
- */
28
- export declare class RunNodeWithInputsResp extends jspb.Message {
29
- private success_;
30
- private error_;
31
- private result_;
32
- constructor();
33
- getSuccess(): boolean;
34
- setSuccess(value: boolean): RunNodeWithInputsResp;
35
- getError(): string;
36
- setError(value: string): RunNodeWithInputsResp;
37
- getResult(): google_protobuf_struct_pb.Struct | undefined;
38
- setResult(value: google_protobuf_struct_pb.Struct | undefined): RunNodeWithInputsResp;
39
- serializeBinary(): Uint8Array;
40
- serializeBinaryToWriter(writer: jspb.BinaryWriter): void;
41
- toObject(includeInstance?: boolean): object;
42
- static deserializeBinary(bytes: Uint8Array): RunNodeWithInputsResp;
43
- static deserializeBinaryFromReader(message: RunNodeWithInputsResp, reader: jspb.BinaryReader): RunNodeWithInputsResp;
44
- }
45
- //# sourceMappingURL=custom_types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"custom_types.d.ts","sourceRoot":"","sources":["../../src/grpc_codegen/custom_types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,yBAAyB,MAAM,2CAA2C,CAAC;AAEvF;;;GAGG;AACH,qBAAa,oBAAqB,SAAQ,IAAI,CAAC,OAAO;IACpD,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,WAAW,CAA+C;IAClE,OAAO,CAAC,eAAe,CAA+C;;IAStE,WAAW,IAAI,MAAM;IAIrB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,oBAAoB;IAKhD,aAAa,IAAI,yBAAyB,CAAC,MAAM,GAAG,SAAS;IAI7D,aAAa,CAAC,KAAK,EAAE,yBAAyB,CAAC,MAAM,GAAG,SAAS,GAAG,oBAAoB;IAKxF,iBAAiB,IAAI,yBAAyB,CAAC,MAAM,GAAG,SAAS;IAIjE,iBAAiB,CAAC,KAAK,EAAE,yBAAyB,CAAC,MAAM,GAAG,SAAS,GAAG,oBAAoB;IAK5F,eAAe,IAAI,UAAU;IAM7B,uBAAuB,CAAC,MAAM,EAAE,IAAI,CAAC,YAAY,GAAG,IAAI;IAoBxD,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,MAAM;IAU3C,MAAM,CAAC,iBAAiB,CAAC,KAAK,EAAE,UAAU,GAAG,oBAAoB;IAMjE,MAAM,CAAC,2BAA2B,CAChC,OAAO,EAAE,oBAAoB,EAC7B,MAAM,EAAE,IAAI,CAAC,YAAY,GACxB,oBAAoB;CAiCxB;AAED;;;GAGG;AACH,qBAAa,qBAAsB,SAAQ,IAAI,CAAC,OAAO;IACrD,OAAO,CAAC,QAAQ,CAAU;IAC1B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAA+C;;IAS9D,UAAU,IAAI,OAAO;IAIrB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,qBAAqB;IAKjD,QAAQ,IAAI,MAAM;IAIlB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,qBAAqB;IAK9C,SAAS,IAAI,yBAAyB,CAAC,MAAM,GAAG,SAAS;IAIzD,SAAS,CAAC,KAAK,EAAE,yBAAyB,CAAC,MAAM,GAAG,SAAS,GAAG,qBAAqB;IAKrF,eAAe,IAAI,UAAU;IAM7B,uBAAuB,CAAC,MAAM,EAAE,IAAI,CAAC,YAAY,GAAG,IAAI;IAgBxD,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,MAAM;IAS3C,MAAM,CAAC,iBAAiB,CAAC,KAAK,EAAE,UAAU,GAAG,qBAAqB;IAMlE,MAAM,CAAC,2BAA2B,CAChC,OAAO,EAAE,qBAAqB,EAC9B,MAAM,EAAE,IAAI,CAAC,YAAY,GACxB,qBAAqB;CA4BzB"}
@@ -1,179 +0,0 @@
1
- import * as jspb from "google-protobuf";
2
- import * as google_protobuf_struct_pb from "google-protobuf/google/protobuf/struct_pb";
3
- /**
4
- * Custom implementation of RunNodeWithInputsReq class
5
- * This is needed because the class is not generated from the proto file
6
- */
7
- export class RunNodeWithInputsReq extends jspb.Message {
8
- constructor() {
9
- super();
10
- this.nodeType_ = "";
11
- this.nodeConfig_ = undefined;
12
- this.inputVariables_ = undefined;
13
- }
14
- getNodeType() {
15
- return this.nodeType_;
16
- }
17
- setNodeType(value) {
18
- this.nodeType_ = value;
19
- return this;
20
- }
21
- getNodeConfig() {
22
- return this.nodeConfig_;
23
- }
24
- setNodeConfig(value) {
25
- this.nodeConfig_ = value;
26
- return this;
27
- }
28
- getInputVariables() {
29
- return this.inputVariables_;
30
- }
31
- setInputVariables(value) {
32
- this.inputVariables_ = value;
33
- return this;
34
- }
35
- serializeBinary() {
36
- const writer = new jspb.BinaryWriter();
37
- this.serializeBinaryToWriter(writer);
38
- return writer.getResultBuffer();
39
- }
40
- serializeBinaryToWriter(writer) {
41
- if (this.nodeType_ !== "") {
42
- writer.writeString(1, this.nodeType_);
43
- }
44
- if (this.nodeConfig_ !== undefined) {
45
- writer.writeMessage(2, this.nodeConfig_, google_protobuf_struct_pb.Struct.serializeBinaryToWriter);
46
- }
47
- if (this.inputVariables_ !== undefined) {
48
- writer.writeMessage(3, this.inputVariables_, google_protobuf_struct_pb.Struct.serializeBinaryToWriter);
49
- }
50
- }
51
- toObject(includeInstance) {
52
- return {
53
- nodeType: this.nodeType_,
54
- nodeConfig: this.nodeConfig_ ?
55
- this.nodeConfig_.toObject(includeInstance) : undefined,
56
- inputVariables: this.inputVariables_ ?
57
- this.inputVariables_.toObject(includeInstance) : undefined
58
- };
59
- }
60
- static deserializeBinary(bytes) {
61
- const reader = new jspb.BinaryReader(bytes);
62
- const message = new RunNodeWithInputsReq();
63
- return RunNodeWithInputsReq.deserializeBinaryFromReader(message, reader);
64
- }
65
- static deserializeBinaryFromReader(message, reader) {
66
- while (reader.nextField()) {
67
- if (reader.isEndGroup()) {
68
- break;
69
- }
70
- const field = reader.getFieldNumber();
71
- switch (field) {
72
- case 1:
73
- message.setNodeType(reader.readString());
74
- break;
75
- case 2:
76
- const nodeConfig = new google_protobuf_struct_pb.Struct();
77
- reader.readMessage(nodeConfig, google_protobuf_struct_pb.Struct.deserializeBinaryFromReader);
78
- message.setNodeConfig(nodeConfig);
79
- break;
80
- case 3:
81
- const inputVariables = new google_protobuf_struct_pb.Struct();
82
- reader.readMessage(inputVariables, google_protobuf_struct_pb.Struct.deserializeBinaryFromReader);
83
- message.setInputVariables(inputVariables);
84
- break;
85
- default:
86
- reader.skipField();
87
- break;
88
- }
89
- }
90
- return message;
91
- }
92
- }
93
- /**
94
- * Custom implementation of RunNodeWithInputsResp class
95
- * This is needed because the class is not generated from the proto file
96
- */
97
- export class RunNodeWithInputsResp extends jspb.Message {
98
- constructor() {
99
- super();
100
- this.success_ = false;
101
- this.error_ = "";
102
- this.result_ = undefined;
103
- }
104
- getSuccess() {
105
- return this.success_;
106
- }
107
- setSuccess(value) {
108
- this.success_ = value;
109
- return this;
110
- }
111
- getError() {
112
- return this.error_;
113
- }
114
- setError(value) {
115
- this.error_ = value;
116
- return this;
117
- }
118
- getResult() {
119
- return this.result_;
120
- }
121
- setResult(value) {
122
- this.result_ = value;
123
- return this;
124
- }
125
- serializeBinary() {
126
- const writer = new jspb.BinaryWriter();
127
- this.serializeBinaryToWriter(writer);
128
- return writer.getResultBuffer();
129
- }
130
- serializeBinaryToWriter(writer) {
131
- if (this.success_ !== false) {
132
- writer.writeBool(1, this.success_);
133
- }
134
- if (this.error_ !== "") {
135
- writer.writeString(2, this.error_);
136
- }
137
- if (this.result_ !== undefined) {
138
- writer.writeMessage(3, this.result_, google_protobuf_struct_pb.Struct.serializeBinaryToWriter);
139
- }
140
- }
141
- toObject(includeInstance) {
142
- return {
143
- success: this.success_,
144
- error: this.error_,
145
- result: this.result_ ?
146
- this.result_.toObject(includeInstance) : undefined
147
- };
148
- }
149
- static deserializeBinary(bytes) {
150
- const reader = new jspb.BinaryReader(bytes);
151
- const message = new RunNodeWithInputsResp();
152
- return RunNodeWithInputsResp.deserializeBinaryFromReader(message, reader);
153
- }
154
- static deserializeBinaryFromReader(message, reader) {
155
- while (reader.nextField()) {
156
- if (reader.isEndGroup()) {
157
- break;
158
- }
159
- const field = reader.getFieldNumber();
160
- switch (field) {
161
- case 1:
162
- message.setSuccess(reader.readBool());
163
- break;
164
- case 2:
165
- message.setError(reader.readString());
166
- break;
167
- case 3:
168
- const result = new google_protobuf_struct_pb.Struct();
169
- reader.readMessage(result, google_protobuf_struct_pb.Struct.deserializeBinaryFromReader);
170
- message.setResult(result);
171
- break;
172
- default:
173
- reader.skipField();
174
- break;
175
- }
176
- }
177
- return message;
178
- }
179
- }
@@ -1,16 +0,0 @@
1
- import * as avs_pb from "@/grpc_codegen/avs_pb";
2
- import { SecretProps } from "@avaprotocol/types";
3
- declare class Secret implements SecretProps {
4
- name: string;
5
- secret?: string;
6
- workflowId?: string;
7
- orgId?: string;
8
- createdAt?: number;
9
- updatedAt?: number;
10
- createdBy?: string;
11
- description?: string;
12
- constructor(props: SecretProps);
13
- toRequest(): avs_pb.CreateOrUpdateSecretReq;
14
- }
15
- export default Secret;
16
- //# sourceMappingURL=secret.d.ts.map
@@ -1,33 +0,0 @@
1
- import * as avs_pb from "@/grpc_codegen/avs_pb";
2
- import { TriggerType } from "@avaprotocol/types";
3
- export type TriggerReasonProps = {
4
- type: TriggerType.FixedTime;
5
- epoch: number;
6
- } | {
7
- type: TriggerType.Cron;
8
- epoch: number;
9
- } | {
10
- type: TriggerType.Block;
11
- blockNumber: number;
12
- } | {
13
- type: TriggerType.Event;
14
- blockNumber: number;
15
- logIndex: number;
16
- txHash: string;
17
- } | {
18
- type: TriggerType.Manual;
19
- } | {
20
- type: TriggerType.Unspecified;
21
- };
22
- declare class TriggerReason {
23
- type: TriggerType;
24
- blockNumber?: number;
25
- epoch?: number;
26
- logIndex?: number;
27
- txHash?: string;
28
- constructor(props: TriggerReasonProps);
29
- static fromResponse(data: avs_pb.TriggerReason | undefined): TriggerReason | undefined;
30
- toRequest(): avs_pb.TriggerReason;
31
- }
32
- export default TriggerReason;
33
- //# sourceMappingURL=reason.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reason.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/reason.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,MAAM,kBAAkB,GAC1B;IAAE,IAAI,EAAE,WAAW,CAAC,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC9C;IAAE,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACzC;IAAE,IAAI,EAAE,WAAW,CAAC,KAAK,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAChD;IACE,IAAI,EAAE,WAAW,CAAC,KAAK,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,GACD;IAAE,IAAI,EAAE,WAAW,CAAC,MAAM,CAAA;CAAE,GAC5B;IAAE,IAAI,EAAE,WAAW,CAAC,WAAW,CAAA;CAAE,CAAC;AAoBtC,cAAM,aAAa;IACjB,IAAI,EAAE,WAAW,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;gBAEJ,KAAK,EAAE,kBAAkB;IAyBrC,MAAM,CAAC,YAAY,CACjB,IAAI,EAAE,MAAM,CAAC,aAAa,GAAG,SAAS,GACrC,aAAa,GAAG,SAAS;IAc5B,SAAS,IAAI,MAAM,CAAC,aAAa;CA8ClC;AAED,eAAe,aAAa,CAAC"}
@@ -1,96 +0,0 @@
1
- import * as avs_pb from "@/grpc_codegen/avs_pb";
2
- import { TriggerType } from "@avaprotocol/types";
3
- // Convert the number values of gRPC TriggerType to string values of TriggerType
4
- const convertTriggerType = (grpcType) => {
5
- const conversionMap = {
6
- [avs_pb.TriggerType.TRIGGER_TYPE_FIXED_TIME]: TriggerType.FixedTime,
7
- [avs_pb.TriggerType.TRIGGER_TYPE_CRON]: TriggerType.Cron,
8
- [avs_pb.TriggerType.TRIGGER_TYPE_BLOCK]: TriggerType.Block,
9
- [avs_pb.TriggerType.TRIGGER_TYPE_EVENT]: TriggerType.Event,
10
- [avs_pb.TriggerType.TRIGGER_TYPE_MANUAL]: TriggerType.Manual,
11
- [avs_pb.TriggerType.TRIGGER_TYPE_UNSPECIFIED]: TriggerType.Unspecified,
12
- };
13
- return conversionMap[grpcType];
14
- };
15
- class TriggerReason {
16
- constructor(props) {
17
- this.type = props.type;
18
- // Configure reason based on trigger type
19
- switch (props.type) {
20
- case TriggerType.FixedTime:
21
- case TriggerType.Cron:
22
- this.epoch = props.epoch;
23
- break;
24
- case TriggerType.Block:
25
- this.blockNumber = props.blockNumber;
26
- break;
27
- case TriggerType.Event:
28
- this.blockNumber = props.blockNumber;
29
- this.logIndex = props.logIndex;
30
- this.txHash = props.txHash;
31
- break;
32
- case TriggerType.Manual:
33
- case TriggerType.Unspecified:
34
- break;
35
- default:
36
- throw new Error("Unsupported trigger type");
37
- }
38
- }
39
- static fromResponse(data) {
40
- if (!data) {
41
- return undefined;
42
- }
43
- return new TriggerReason({
44
- type: convertTriggerType(data.getType()),
45
- blockNumber: data.getBlockNumber(),
46
- epoch: data.getEpoch(),
47
- logIndex: data.getLogIndex(),
48
- txHash: data.getTxHash(),
49
- });
50
- }
51
- toRequest() {
52
- const request = new avs_pb.TriggerReason();
53
- switch (this.type) {
54
- case TriggerType.FixedTime:
55
- request.setType(avs_pb.TriggerType.TRIGGER_TYPE_FIXED_TIME);
56
- if (this.epoch) {
57
- request.setEpoch(this.epoch);
58
- }
59
- break;
60
- case TriggerType.Cron:
61
- request.setType(avs_pb.TriggerType.TRIGGER_TYPE_CRON);
62
- if (this.epoch) {
63
- request.setEpoch(this.epoch);
64
- }
65
- break;
66
- case TriggerType.Block:
67
- request.setType(avs_pb.TriggerType.TRIGGER_TYPE_BLOCK);
68
- if (this.blockNumber) {
69
- request.setBlockNumber(this.blockNumber);
70
- }
71
- break;
72
- case TriggerType.Event:
73
- request.setType(avs_pb.TriggerType.TRIGGER_TYPE_EVENT);
74
- if (this.blockNumber) {
75
- request.setBlockNumber(this.blockNumber);
76
- }
77
- if (this.logIndex) {
78
- request.setLogIndex(this.logIndex);
79
- }
80
- if (this.txHash) {
81
- request.setTxHash(this.txHash);
82
- }
83
- break;
84
- case TriggerType.Manual:
85
- request.setType(avs_pb.TriggerType.TRIGGER_TYPE_MANUAL);
86
- break;
87
- case TriggerType.Unspecified:
88
- request.setType(avs_pb.TriggerType.TRIGGER_TYPE_UNSPECIFIED);
89
- break;
90
- default:
91
- throw new Error("Unsupported trigger type");
92
- }
93
- return request;
94
- }
95
- }
96
- export default TriggerReason;
package/dist/utils.d.ts DELETED
@@ -1,60 +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 protobuf Value to a JavaScript value
16
- *
17
- * **⚠️ DEPRECATED - Use convertProtobufValueToJs() for new code**
18
- *
19
- * This is a legacy compatibility version for existing code that may use
20
- * dynamically typed protobuf objects. It uses older has*() methods and
21
- * fallback logic. Only use this if you need backward compatibility.
22
- *
23
- * @deprecated Use convertProtobufValueToJs() instead for better type safety
24
- * @param value - The protobuf Value object (may be dynamically typed)
25
- * @returns The converted JavaScript value
26
- */
27
- export declare function convertProtobufValueToJS(value: any): any;
28
- /**
29
- * Convert a JavaScript value to a protobuf Value
30
- *
31
- * Uses proper TypeScript types for modern protobuf usage.
32
- *
33
- * @param value - The JavaScript value to convert
34
- * @returns The protobuf Value object
35
- */
36
- export declare function convertJSValueToProtobuf(value: any): ProtobufValue;
37
- /**
38
- * Convert protobuf trigger type string to SDK trigger type string
39
- *
40
- * @param protobufType - The protobuf trigger type string (e.g., "TRIGGER_TYPE_MANUAL")
41
- * @returns The SDK trigger type string (e.g., "manualTrigger")
42
- */
43
- export declare function convertProtobufTriggerTypeToSdk(protobufType: string): string;
44
- /**
45
- * Convert protobuf node type string to SDK node type string
46
- *
47
- * @param protobufType - The protobuf node type string (e.g., "NODE_TYPE_CUSTOM_CODE")
48
- * @returns The SDK node type string (e.g., "customCode")
49
- */
50
- export declare function convertProtobufNodeTypeToSdk(protobufType: string): string;
51
- /**
52
- * Convert protobuf step type string to SDK step type string
53
- *
54
- * Automatically detects whether the type is a trigger or node type and converts accordingly.
55
- *
56
- * @param protobufType - The protobuf type string (e.g., "TRIGGER_TYPE_MANUAL" or "NODE_TYPE_CUSTOM_CODE")
57
- * @returns The SDK type string (e.g., "manualTrigger" or "customCode")
58
- */
59
- export declare function convertProtobufStepTypeToSdk(protobufType: string): string;
60
- //# sourceMappingURL=utils.d.ts.map