@avaprotocol/sdk-js 2.0.1 → 2.0.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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @avaprotocol/sdk-js
2
2
 
3
+ ## 2.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 8e09a20: Fix the request type of SimulateWorkflow and RunTriggerReq
8
+ - Updated dependencies [8e09a20]
9
+ - @avaprotocol/types@2.0.2
10
+
3
11
  ## 2.0.1
4
12
 
5
13
  ### Patch Changes
package/dist/index.js CHANGED
@@ -15713,7 +15713,7 @@ var Step = class _Step {
15713
15713
  let nodeOutputMessage;
15714
15714
  switch (outputDataType) {
15715
15715
  case avs_pb20.Execution.Step.OutputDataCase.OUTPUT_DATA_NOT_SET:
15716
- return null;
15716
+ return void 0;
15717
15717
  // Trigger outputs
15718
15718
  case avs_pb20.Execution.Step.OutputDataCase.BLOCK_TRIGGER:
15719
15719
  const blockOutput = step.getBlockTrigger()?.toObject();
@@ -15745,7 +15745,10 @@ var Step = class _Step {
15745
15745
  return manualOutput || void 0;
15746
15746
  // Node outputs
15747
15747
  case avs_pb20.Execution.Step.OutputDataCase.ETH_TRANSFER:
15748
- return step.getEthTransfer()?.toObject();
15748
+ const ethTransferOutput = step.getEthTransfer()?.toObject();
15749
+ return ethTransferOutput ? {
15750
+ transactionHash: ethTransferOutput.transactionHash
15751
+ } : void 0;
15749
15752
  case avs_pb20.Execution.Step.OutputDataCase.GRAPHQL:
15750
15753
  nodeOutputMessage = step.getGraphql();
15751
15754
  return nodeOutputMessage && nodeOutputMessage.hasData() ? nodeOutputMessage.getData() : void 0;
package/dist/index.mjs CHANGED
@@ -15695,7 +15695,7 @@ var Step = class _Step {
15695
15695
  let nodeOutputMessage;
15696
15696
  switch (outputDataType) {
15697
15697
  case avs_pb20.Execution.Step.OutputDataCase.OUTPUT_DATA_NOT_SET:
15698
- return null;
15698
+ return void 0;
15699
15699
  // Trigger outputs
15700
15700
  case avs_pb20.Execution.Step.OutputDataCase.BLOCK_TRIGGER:
15701
15701
  const blockOutput = step.getBlockTrigger()?.toObject();
@@ -15727,7 +15727,10 @@ var Step = class _Step {
15727
15727
  return manualOutput || void 0;
15728
15728
  // Node outputs
15729
15729
  case avs_pb20.Execution.Step.OutputDataCase.ETH_TRANSFER:
15730
- return step.getEthTransfer()?.toObject();
15730
+ const ethTransferOutput = step.getEthTransfer()?.toObject();
15731
+ return ethTransferOutput ? {
15732
+ transactionHash: ethTransferOutput.transactionHash
15733
+ } : void 0;
15731
15734
  case avs_pb20.Execution.Step.OutputDataCase.GRAPHQL:
15732
15735
  nodeOutputMessage = step.getGraphql();
15733
15736
  return nodeOutputMessage && nodeOutputMessage.hasData() ? nodeOutputMessage.getData() : void 0;
@@ -1,5 +1,5 @@
1
1
  import * as avs_pb from "@/grpc_codegen/avs_pb";
2
- import { StepProps } from "@avaprotocol/types";
2
+ import { StepProps, OutputDataProps } from "@avaprotocol/types";
3
3
  declare class Step implements StepProps {
4
4
  id: string;
5
5
  type: string;
@@ -8,11 +8,11 @@ declare class Step implements StepProps {
8
8
  error: string;
9
9
  log: string;
10
10
  inputsList: string[];
11
- output: any;
11
+ output: OutputDataProps;
12
12
  startAt: number;
13
13
  endAt: number;
14
14
  constructor(props: StepProps);
15
- static getOutput(step: avs_pb.Execution.Step): any;
15
+ static getOutput(step: avs_pb.Execution.Step): OutputDataProps;
16
16
  static fromResponse(step: avs_pb.Execution.Step): Step;
17
17
  }
18
18
  export default Step;
@@ -1 +1 @@
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,CA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,5 @@
1
1
  import * as avs_pb from "@/grpc_codegen/avs_pb";
2
- import { convertProtobufValueToJs, convertProtobufStepTypeToSdk } from "../utils";
3
- // OutputDataProps is no longer a union of AsObject, it will be the converted JS type via 'output'
4
- // export type OutputDataProps = ... (removed)
2
+ import { convertProtobufValueToJs, convertProtobufStepTypeToSdk, } from "../utils";
5
3
  class Step {
6
4
  constructor(props) {
7
5
  this.id = props.id;
@@ -20,23 +18,29 @@ class Step {
20
18
  let nodeOutputMessage;
21
19
  switch (outputDataType) {
22
20
  case avs_pb.Execution.Step.OutputDataCase.OUTPUT_DATA_NOT_SET:
23
- return null;
21
+ return undefined;
24
22
  // Trigger outputs
25
23
  case avs_pb.Execution.Step.OutputDataCase.BLOCK_TRIGGER:
26
24
  const blockOutput = step.getBlockTrigger()?.toObject();
27
- return blockOutput ? { blockNumber: blockOutput.blockNumber } : undefined;
25
+ return blockOutput
26
+ ? { blockNumber: blockOutput.blockNumber }
27
+ : undefined;
28
28
  case avs_pb.Execution.Step.OutputDataCase.FIXED_TIME_TRIGGER:
29
29
  const fixedTimeOutput = step.getFixedTimeTrigger()?.toObject();
30
- return fixedTimeOutput ? {
31
- timestamp: fixedTimeOutput.timestamp,
32
- timestampIso: fixedTimeOutput.timestampIso
33
- } : undefined;
30
+ return fixedTimeOutput
31
+ ? {
32
+ timestamp: fixedTimeOutput.timestamp,
33
+ timestampIso: fixedTimeOutput.timestampIso,
34
+ }
35
+ : undefined;
34
36
  case avs_pb.Execution.Step.OutputDataCase.CRON_TRIGGER:
35
37
  const cronOutput = step.getCronTrigger()?.toObject();
36
- return cronOutput ? {
37
- timestamp: cronOutput.timestamp,
38
- timestampIso: cronOutput.timestampIso
39
- } : undefined;
38
+ return cronOutput
39
+ ? {
40
+ timestamp: cronOutput.timestamp,
41
+ timestampIso: cronOutput.timestampIso,
42
+ }
43
+ : undefined;
40
44
  case avs_pb.Execution.Step.OutputDataCase.EVENT_TRIGGER:
41
45
  const eventTrigger = step.getEventTrigger();
42
46
  if (eventTrigger) {
@@ -53,7 +57,12 @@ class Step {
53
57
  return manualOutput || undefined;
54
58
  // Node outputs
55
59
  case avs_pb.Execution.Step.OutputDataCase.ETH_TRANSFER:
56
- return step.getEthTransfer()?.toObject();
60
+ const ethTransferOutput = step.getEthTransfer()?.toObject();
61
+ return ethTransferOutput
62
+ ? {
63
+ transactionHash: ethTransferOutput.transactionHash,
64
+ }
65
+ : undefined;
57
66
  case avs_pb.Execution.Step.OutputDataCase.GRAPHQL:
58
67
  nodeOutputMessage = step.getGraphql();
59
68
  return nodeOutputMessage && nodeOutputMessage.hasData()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@avaprotocol/sdk-js",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
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": "2.0.1",
33
+ "@avaprotocol/types": "2.0.2",
34
34
  "@grpc/grpc-js": "^1.11.3",
35
35
  "@grpc/proto-loader": "^0.7.13",
36
36
  "dotenv": "^16.4.5",