@avaprotocol/sdk-js 2.0.2 → 2.0.4

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,17 @@
1
1
  # @avaprotocol/sdk-js
2
2
 
3
+ ## 2.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - cd87ed8: Change API response from Execution to ExecutionProps
8
+
9
+ ## 2.0.3
10
+
11
+ ### Patch Changes
12
+
13
+ - 3bbdc95: Updated runTrigger with EventTrigger output
14
+
3
15
  ## 2.0.2
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -8,7 +8,7 @@ import Step from "./models/step";
8
8
  import NodeFactory from "./models/node/factory";
9
9
  import TriggerFactory from "./models/trigger/factory";
10
10
  import Secret from "./models/secret";
11
- import { type WorkflowProps, type GetKeyResponse, type RequestOptions, type ClientOption, type SmartWallet, type GetWalletRequest, type GetExecutionsOptions, type GetWorkflowsOptions, type GetSignatureFormatResponse, type RunNodeWithInputsRequest, type RunNodeWithInputsResponse, type RunTriggerRequest, type RunTriggerResponse, type SecretProps, type PageInfo, type GetSecretsOptions, type SecretOptions, type TriggerDataProps, type SimulateWorkflowRequest, type GetTokenMetadataRequest, type GetTokenMetadataResponse } from "@avaprotocol/types";
11
+ import { type WorkflowProps, type GetKeyResponse, type RequestOptions, type ClientOption, type SmartWallet, type GetWalletRequest, type GetExecutionsOptions, type GetWorkflowsOptions, type GetSignatureFormatResponse, type RunNodeWithInputsRequest, type RunNodeWithInputsResponse, type RunTriggerRequest, type RunTriggerResponse, type SecretProps, type PageInfo, type GetSecretsOptions, type SecretOptions, type TriggerDataProps, type SimulateWorkflowRequest, type ExecutionProps, type GetTokenMetadataRequest, type GetTokenMetadataResponse } from "@avaprotocol/types";
12
12
  import { ExecutionStatus } from "@/grpc_codegen/avs_pb";
13
13
  declare class BaseClient {
14
14
  readonly endpoint: string;
@@ -124,10 +124,10 @@ declare class Client extends BaseClient {
124
124
  * @param {boolean} [options.includeNodes] - Include task nodes (expensive field)
125
125
  * @param {boolean} [options.includeEdges] - Include task edges (expensive field)
126
126
  * @param {string} [options.authKey] - The auth key for the request
127
- * @returns {Promise<{ items: Workflow[]; pageInfo: PageInfo }>} - The list of Workflow objects with nested pagination metadata
127
+ * @returns {Promise<{ items: WorkflowProps[]; pageInfo: PageInfo }>} - The list of WorkflowProps objects with nested pagination metadata
128
128
  */
129
129
  getWorkflows(addresses: string[], options?: GetWorkflowsOptions): Promise<{
130
- items: Workflow[];
130
+ items: WorkflowProps[];
131
131
  pageInfo: PageInfo;
132
132
  }>;
133
133
  /**
@@ -145,10 +145,10 @@ declare class Client extends BaseClient {
145
145
  * @param {string} [options.after] - Get items after this cursor value (for forward pagination)
146
146
  * @param {number} [options.limit] - The page limit of the response; default is 10
147
147
  * @param {string} [options.authKey] - The auth key for the request
148
- * @returns {Promise<{ items: Execution[]; pageInfo: PageInfo }>} - The list of Execution objects with nested pagination metadata
148
+ * @returns {Promise<{ items: ExecutionProps[]; pageInfo: PageInfo }>} - The list of ExecutionProps objects with nested pagination metadata
149
149
  */
150
150
  getExecutions(workflows: string[], options?: GetExecutionsOptions): Promise<{
151
- items: Execution[];
151
+ items: ExecutionProps[];
152
152
  pageInfo: PageInfo;
153
153
  }>;
154
154
  /**
@@ -156,9 +156,9 @@ declare class Client extends BaseClient {
156
156
  * @param {string} workflowId - The workflow id (taskId)
157
157
  * @param {string} executionId - The execution id
158
158
  * @param {RequestOptions} options - Request options
159
- * @returns {Promise<Execution>} - The Execution object
159
+ * @returns {Promise<ExecutionProps>} - The ExecutionProps object
160
160
  */
161
- getExecution(workflowId: string, executionId: string, options?: RequestOptions): Promise<Execution>;
161
+ getExecution(workflowId: string, executionId: string, options?: RequestOptions): Promise<ExecutionProps>;
162
162
  /**
163
163
  * Get the count of executions for multiple workflows
164
164
  * @param workflows - The list of workflow ids
@@ -286,9 +286,9 @@ declare class Client extends BaseClient {
286
286
  * @param {Array<Record<string, any>>} params.edges - The workflow edges
287
287
  * @param {Record<string, any>} params.inputVariables - Input variables for the simulation
288
288
  * @param {RequestOptions} options - Request options
289
- * @returns {Promise<Execution>} - The response from simulating the task
289
+ * @returns {Promise<ExecutionProps>} - The response from simulating the task
290
290
  */
291
- simulateWorkflow({ trigger, nodes, edges, inputVariables }: SimulateWorkflowRequest, options?: RequestOptions): Promise<Execution>;
291
+ simulateWorkflow({ trigger, nodes, edges, inputVariables }: SimulateWorkflowRequest, options?: RequestOptions): Promise<ExecutionProps>;
292
292
  /**
293
293
  * Get token metadata by contract address
294
294
  * @param {GetTokenMetadataRequest} params - The parameters for getting token metadata
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,QAAQ,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAEhD,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AACzC,OAAO,IAAI,MAAM,eAAe,CAAC;AACjC,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAC3C,OAAO,IAAI,MAAM,eAAe,CAAC;AACjC,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,cAAc,MAAM,0BAA0B,CAAC;AACtD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAOL,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,iBAAiB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AAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC;IAoB3E;;;;;;;;OAQG;IACG,iBAAiB,CACrB,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAmB,EAAE,EAAE,wBAAwB,EACvE,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,yBAAyB,CAAC;IAkDrC;;;;;;;OAOG;IACG,UAAU,CACd,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,iBAAiB,EACjD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,kBAAkB,CAAC;IA6B9B;;;;;;;;;OASG;IACG,gBAAgB,CACpB,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,cAAmB,EAAE,EAAE,uBAAuB,EACvE,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,cAAc,CAAC;IAuC1B;;;;;;OAMG;IACG,gBAAgB,CACpB,EAAE,OAAO,EAAE,EAAE,uBAAuB,EACpC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,wBAAwB,CAAC;CAsBrC;AAED,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AAEzC,OAAO,EACL,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,IAAI,EACJ,WAAW,EACX,cAAc,EACd,MAAM,GACP,CAAC;AAGF,YAAY,EACV,aAAa,EACb,uBAAuB,EACvB,wBAAwB,EACxB,WAAW,EACZ,MAAM,oBAAoB,CAAC"}
package/dist/index.js CHANGED
@@ -88,6 +88,7 @@ var require_avs_pb = __commonJS({
88
88
  goog.exportSymbol("proto.aggregator.EventTrigger.Config", null, global);
89
89
  goog.exportSymbol("proto.aggregator.EventTrigger.Matcher", null, global);
90
90
  goog.exportSymbol("proto.aggregator.EventTrigger.Output", null, global);
91
+ goog.exportSymbol("proto.aggregator.EventTrigger.Output.OutputTypeCase", null, global);
91
92
  goog.exportSymbol("proto.aggregator.EventTrigger.TransferLogOutput", null, global);
92
93
  goog.exportSymbol("proto.aggregator.Evm", null, global);
93
94
  goog.exportSymbol("proto.aggregator.Evm.Log", null, global);
@@ -281,7 +282,7 @@ var require_avs_pb = __commonJS({
281
282
  proto.aggregator.EventTrigger.Config.displayName = "proto.aggregator.EventTrigger.Config";
282
283
  }
283
284
  proto.aggregator.EventTrigger.Output = function(opt_data) {
284
- jspb.Message.initialize(this, opt_data, 0, -1, null, null);
285
+ jspb.Message.initialize(this, opt_data, 0, -1, null, proto.aggregator.EventTrigger.Output.oneofGroups_);
285
286
  };
286
287
  goog.inherits(proto.aggregator.EventTrigger.Output, jspb.Message);
287
288
  if (goog.DEBUG && !COMPILED) {
@@ -2281,6 +2282,18 @@ var require_avs_pb = __commonJS({
2281
2282
  proto.aggregator.EventTrigger.Config.prototype.setExpression = function(value) {
2282
2283
  return jspb.Message.setProto3StringField(this, 2, value);
2283
2284
  };
2285
+ proto.aggregator.EventTrigger.Output.oneofGroups_ = [[1, 2]];
2286
+ proto.aggregator.EventTrigger.Output.OutputTypeCase = {
2287
+ OUTPUT_TYPE_NOT_SET: 0,
2288
+ EVM_LOG: 1,
2289
+ TRANSFER_LOG: 2
2290
+ };
2291
+ proto.aggregator.EventTrigger.Output.prototype.getOutputTypeCase = function() {
2292
+ return (
2293
+ /** @type {proto.aggregator.EventTrigger.Output.OutputTypeCase} */
2294
+ jspb.Message.computeOneofCase(this, proto.aggregator.EventTrigger.Output.oneofGroups_[0])
2295
+ );
2296
+ };
2284
2297
  if (jspb.Message.GENERATE_TO_OBJECT) {
2285
2298
  proto.aggregator.EventTrigger.Output.prototype.toObject = function(opt_includeInstance) {
2286
2299
  return proto.aggregator.EventTrigger.Output.toObject(opt_includeInstance, this);
@@ -2356,7 +2369,7 @@ var require_avs_pb = __commonJS({
2356
2369
  );
2357
2370
  };
2358
2371
  proto.aggregator.EventTrigger.Output.prototype.setEvmLog = function(value) {
2359
- return jspb.Message.setWrapperField(this, 1, value);
2372
+ return jspb.Message.setOneofWrapperField(this, 1, proto.aggregator.EventTrigger.Output.oneofGroups_[0], value);
2360
2373
  };
2361
2374
  proto.aggregator.EventTrigger.Output.prototype.clearEvmLog = function() {
2362
2375
  return this.setEvmLog(void 0);
@@ -2371,7 +2384,7 @@ var require_avs_pb = __commonJS({
2371
2384
  );
2372
2385
  };
2373
2386
  proto.aggregator.EventTrigger.Output.prototype.setTransferLog = function(value) {
2374
- return jspb.Message.setWrapperField(this, 2, value);
2387
+ return jspb.Message.setOneofWrapperField(this, 2, proto.aggregator.EventTrigger.Output.oneofGroups_[0], value);
2375
2388
  };
2376
2389
  proto.aggregator.EventTrigger.Output.prototype.clearTransferLog = function() {
2377
2390
  return this.setTransferLog(void 0);
@@ -14465,6 +14478,15 @@ var Trigger = class {
14465
14478
  getOutput() {
14466
14479
  return this.output;
14467
14480
  }
14481
+ toJson() {
14482
+ return {
14483
+ id: this.id,
14484
+ name: this.name,
14485
+ type: this.type,
14486
+ data: this.data,
14487
+ output: this.output
14488
+ };
14489
+ }
14468
14490
  };
14469
14491
  var interface_default = Trigger;
14470
14492
 
@@ -14670,7 +14692,14 @@ var EventTrigger2 = class _EventTrigger extends interface_default {
14670
14692
  */
14671
14693
  static fromOutputData(outputData) {
14672
14694
  const eventOutput = outputData.getEventTrigger();
14673
- return eventOutput?.toObject() || null;
14695
+ if (eventOutput) {
14696
+ if (eventOutput.hasEvmLog()) {
14697
+ return eventOutput.getEvmLog()?.toObject();
14698
+ } else if (eventOutput.hasTransferLog()) {
14699
+ return eventOutput.getTransferLog()?.toObject();
14700
+ }
14701
+ }
14702
+ return null;
14674
14703
  }
14675
14704
  };
14676
14705
  var event_default = EventTrigger2;
@@ -14984,7 +15013,14 @@ var TriggerFactory = class {
14984
15013
  break;
14985
15014
  case avs_pb7.RunTriggerResp.OutputDataCase.EVENT_TRIGGER:
14986
15015
  triggerOutput = outputData.getEventTrigger();
14987
- break;
15016
+ if (triggerOutput) {
15017
+ if (triggerOutput.hasEvmLog()) {
15018
+ return triggerOutput.getEvmLog()?.toObject();
15019
+ } else if (triggerOutput.hasTransferLog()) {
15020
+ return triggerOutput.getTransferLog()?.toObject();
15021
+ }
15022
+ }
15023
+ return null;
14988
15024
  case avs_pb7.RunTriggerResp.OutputDataCase.MANUAL_TRIGGER:
14989
15025
  triggerOutput = outputData.getManualTrigger();
14990
15026
  break;
@@ -15690,6 +15726,28 @@ var Workflow = class _Workflow {
15690
15726
  }
15691
15727
  return request;
15692
15728
  }
15729
+ /**
15730
+ * Convert Workflow instance to plain object (WorkflowProps)
15731
+ * This is useful for serialization, especially with Next.js Server Components
15732
+ */
15733
+ toJson() {
15734
+ return {
15735
+ id: this.id,
15736
+ owner: this.owner,
15737
+ smartWalletAddress: this.smartWalletAddress,
15738
+ trigger: this.trigger.toJson(),
15739
+ nodes: this.nodes,
15740
+ edges: this.edges,
15741
+ startAt: this.startAt,
15742
+ expiredAt: this.expiredAt,
15743
+ maxExecution: this.maxExecution,
15744
+ executionCount: this.executionCount,
15745
+ name: this.name,
15746
+ status: this.status,
15747
+ completedAt: this.completedAt,
15748
+ lastRanAt: this.lastRanAt
15749
+ };
15750
+ }
15693
15751
  };
15694
15752
  var workflow_default = Workflow;
15695
15753
 
@@ -15708,6 +15766,24 @@ var Step = class _Step {
15708
15766
  this.startAt = props.startAt;
15709
15767
  this.endAt = props.endAt;
15710
15768
  }
15769
+ /**
15770
+ * Convert Step instance to plain object (StepProps)
15771
+ * This is useful for serialization, especially with Next.js Server Components
15772
+ */
15773
+ toJson() {
15774
+ return {
15775
+ id: this.id,
15776
+ type: this.type,
15777
+ name: this.name,
15778
+ success: this.success,
15779
+ error: this.error,
15780
+ log: this.log,
15781
+ inputsList: this.inputsList,
15782
+ output: this.output,
15783
+ startAt: this.startAt,
15784
+ endAt: this.endAt
15785
+ };
15786
+ }
15711
15787
  static getOutput(step) {
15712
15788
  const outputDataType = step.getOutputDataCase();
15713
15789
  let nodeOutputMessage;
@@ -15806,7 +15882,21 @@ var Execution2 = class _Execution {
15806
15882
  this.endAt = props.endAt;
15807
15883
  this.success = props.success;
15808
15884
  this.error = props.error;
15809
- this.steps = props.steps;
15885
+ this.steps = props.steps.map((s) => new step_default(s));
15886
+ }
15887
+ /**
15888
+ * Convert Execution instance to plain object (ExecutionProps)
15889
+ * This is useful for serialization, especially with Next.js Server Components
15890
+ */
15891
+ toJson() {
15892
+ return {
15893
+ id: this.id,
15894
+ startAt: this.startAt,
15895
+ endAt: this.endAt,
15896
+ success: this.success,
15897
+ error: this.error,
15898
+ steps: this.steps.map((step) => step.toJson())
15899
+ };
15810
15900
  }
15811
15901
  static fromResponse(execution) {
15812
15902
  return new _Execution({
@@ -16079,7 +16169,7 @@ var Client = class extends BaseClient {
16079
16169
  * @param {boolean} [options.includeNodes] - Include task nodes (expensive field)
16080
16170
  * @param {boolean} [options.includeEdges] - Include task edges (expensive field)
16081
16171
  * @param {string} [options.authKey] - The auth key for the request
16082
- * @returns {Promise<{ items: Workflow[]; pageInfo: PageInfo }>} - The list of Workflow objects with nested pagination metadata
16172
+ * @returns {Promise<{ items: WorkflowProps[]; pageInfo: PageInfo }>} - The list of WorkflowProps objects with nested pagination metadata
16083
16173
  */
16084
16174
  async getWorkflows(addresses, options) {
16085
16175
  const request = new avs_pb22.ListTasksReq();
@@ -16105,7 +16195,7 @@ var Client = class extends BaseClient {
16105
16195
  throw new Error("Server response missing pagination info.");
16106
16196
  }
16107
16197
  return {
16108
- items: result.getItemsList().map((item) => workflow_default.fromListResponse(item)),
16198
+ items: result.getItemsList().map((item) => workflow_default.fromListResponse(item).toJson()),
16109
16199
  pageInfo: {
16110
16200
  startCursor: pageInfo.getStartCursor(),
16111
16201
  endCursor: pageInfo.getEndCursor(),
@@ -16134,7 +16224,7 @@ var Client = class extends BaseClient {
16134
16224
  * @param {string} [options.after] - Get items after this cursor value (for forward pagination)
16135
16225
  * @param {number} [options.limit] - The page limit of the response; default is 10
16136
16226
  * @param {string} [options.authKey] - The auth key for the request
16137
- * @returns {Promise<{ items: Execution[]; pageInfo: PageInfo }>} - The list of Execution objects with nested pagination metadata
16227
+ * @returns {Promise<{ items: ExecutionProps[]; pageInfo: PageInfo }>} - The list of ExecutionProps objects with nested pagination metadata
16138
16228
  */
16139
16229
  async getExecutions(workflows, options) {
16140
16230
  const request = new avs_pb22.ListExecutionsReq();
@@ -16154,7 +16244,7 @@ var Client = class extends BaseClient {
16154
16244
  throw new Error("Server response missing pagination info.");
16155
16245
  }
16156
16246
  return {
16157
- items: result.getItemsList().map((item) => execution_default.fromResponse(item)),
16247
+ items: result.getItemsList().map((item) => execution_default.fromResponse(item).toJson()),
16158
16248
  pageInfo: {
16159
16249
  startCursor: pageInfo.getStartCursor(),
16160
16250
  endCursor: pageInfo.getEndCursor(),
@@ -16168,14 +16258,14 @@ var Client = class extends BaseClient {
16168
16258
  * @param {string} workflowId - The workflow id (taskId)
16169
16259
  * @param {string} executionId - The execution id
16170
16260
  * @param {RequestOptions} options - Request options
16171
- * @returns {Promise<Execution>} - The Execution object
16261
+ * @returns {Promise<ExecutionProps>} - The ExecutionProps object
16172
16262
  */
16173
16263
  async getExecution(workflowId, executionId, options) {
16174
16264
  const request = new avs_pb22.ExecutionReq();
16175
16265
  request.setTaskId(workflowId);
16176
16266
  request.setExecutionId(executionId);
16177
16267
  const result = await this.sendGrpcRequest("getExecution", request, options);
16178
- return execution_default.fromResponse(result);
16268
+ return execution_default.fromResponse(result).toJson();
16179
16269
  }
16180
16270
  /**
16181
16271
  * Get the count of executions for multiple workflows
@@ -16553,7 +16643,7 @@ var Client = class extends BaseClient {
16553
16643
  * @param {Array<Record<string, any>>} params.edges - The workflow edges
16554
16644
  * @param {Record<string, any>} params.inputVariables - Input variables for the simulation
16555
16645
  * @param {RequestOptions} options - Request options
16556
- * @returns {Promise<Execution>} - The response from simulating the task
16646
+ * @returns {Promise<ExecutionProps>} - The response from simulating the task
16557
16647
  */
16558
16648
  async simulateWorkflow({ trigger, nodes, edges, inputVariables = {} }, options) {
16559
16649
  const request = new avs_pb22.SimulateTaskReq();
@@ -16574,7 +16664,8 @@ var Client = class extends BaseClient {
16574
16664
  inputVarsMap.set(key, convertJSValueToProtobuf(value));
16575
16665
  }
16576
16666
  const result = await this.sendGrpcRequest("simulateTask", request, options);
16577
- return execution_default.fromResponse(result);
16667
+ const execution = execution_default.fromResponse(result);
16668
+ return execution.toJson();
16578
16669
  }
16579
16670
  /**
16580
16671
  * Get token metadata by contract address
package/dist/index.mjs CHANGED
@@ -88,6 +88,7 @@ var require_avs_pb = __commonJS({
88
88
  goog.exportSymbol("proto.aggregator.EventTrigger.Config", null, global);
89
89
  goog.exportSymbol("proto.aggregator.EventTrigger.Matcher", null, global);
90
90
  goog.exportSymbol("proto.aggregator.EventTrigger.Output", null, global);
91
+ goog.exportSymbol("proto.aggregator.EventTrigger.Output.OutputTypeCase", null, global);
91
92
  goog.exportSymbol("proto.aggregator.EventTrigger.TransferLogOutput", null, global);
92
93
  goog.exportSymbol("proto.aggregator.Evm", null, global);
93
94
  goog.exportSymbol("proto.aggregator.Evm.Log", null, global);
@@ -281,7 +282,7 @@ var require_avs_pb = __commonJS({
281
282
  proto.aggregator.EventTrigger.Config.displayName = "proto.aggregator.EventTrigger.Config";
282
283
  }
283
284
  proto.aggregator.EventTrigger.Output = function(opt_data) {
284
- jspb.Message.initialize(this, opt_data, 0, -1, null, null);
285
+ jspb.Message.initialize(this, opt_data, 0, -1, null, proto.aggregator.EventTrigger.Output.oneofGroups_);
285
286
  };
286
287
  goog.inherits(proto.aggregator.EventTrigger.Output, jspb.Message);
287
288
  if (goog.DEBUG && !COMPILED) {
@@ -2281,6 +2282,18 @@ var require_avs_pb = __commonJS({
2281
2282
  proto.aggregator.EventTrigger.Config.prototype.setExpression = function(value) {
2282
2283
  return jspb.Message.setProto3StringField(this, 2, value);
2283
2284
  };
2285
+ proto.aggregator.EventTrigger.Output.oneofGroups_ = [[1, 2]];
2286
+ proto.aggregator.EventTrigger.Output.OutputTypeCase = {
2287
+ OUTPUT_TYPE_NOT_SET: 0,
2288
+ EVM_LOG: 1,
2289
+ TRANSFER_LOG: 2
2290
+ };
2291
+ proto.aggregator.EventTrigger.Output.prototype.getOutputTypeCase = function() {
2292
+ return (
2293
+ /** @type {proto.aggregator.EventTrigger.Output.OutputTypeCase} */
2294
+ jspb.Message.computeOneofCase(this, proto.aggregator.EventTrigger.Output.oneofGroups_[0])
2295
+ );
2296
+ };
2284
2297
  if (jspb.Message.GENERATE_TO_OBJECT) {
2285
2298
  proto.aggregator.EventTrigger.Output.prototype.toObject = function(opt_includeInstance) {
2286
2299
  return proto.aggregator.EventTrigger.Output.toObject(opt_includeInstance, this);
@@ -2356,7 +2369,7 @@ var require_avs_pb = __commonJS({
2356
2369
  );
2357
2370
  };
2358
2371
  proto.aggregator.EventTrigger.Output.prototype.setEvmLog = function(value) {
2359
- return jspb.Message.setWrapperField(this, 1, value);
2372
+ return jspb.Message.setOneofWrapperField(this, 1, proto.aggregator.EventTrigger.Output.oneofGroups_[0], value);
2360
2373
  };
2361
2374
  proto.aggregator.EventTrigger.Output.prototype.clearEvmLog = function() {
2362
2375
  return this.setEvmLog(void 0);
@@ -2371,7 +2384,7 @@ var require_avs_pb = __commonJS({
2371
2384
  );
2372
2385
  };
2373
2386
  proto.aggregator.EventTrigger.Output.prototype.setTransferLog = function(value) {
2374
- return jspb.Message.setWrapperField(this, 2, value);
2387
+ return jspb.Message.setOneofWrapperField(this, 2, proto.aggregator.EventTrigger.Output.oneofGroups_[0], value);
2375
2388
  };
2376
2389
  proto.aggregator.EventTrigger.Output.prototype.clearTransferLog = function() {
2377
2390
  return this.setTransferLog(void 0);
@@ -14436,6 +14449,15 @@ var Trigger = class {
14436
14449
  getOutput() {
14437
14450
  return this.output;
14438
14451
  }
14452
+ toJson() {
14453
+ return {
14454
+ id: this.id,
14455
+ name: this.name,
14456
+ type: this.type,
14457
+ data: this.data,
14458
+ output: this.output
14459
+ };
14460
+ }
14439
14461
  };
14440
14462
  var interface_default = Trigger;
14441
14463
 
@@ -14641,7 +14663,14 @@ var EventTrigger2 = class _EventTrigger extends interface_default {
14641
14663
  */
14642
14664
  static fromOutputData(outputData) {
14643
14665
  const eventOutput = outputData.getEventTrigger();
14644
- return eventOutput?.toObject() || null;
14666
+ if (eventOutput) {
14667
+ if (eventOutput.hasEvmLog()) {
14668
+ return eventOutput.getEvmLog()?.toObject();
14669
+ } else if (eventOutput.hasTransferLog()) {
14670
+ return eventOutput.getTransferLog()?.toObject();
14671
+ }
14672
+ }
14673
+ return null;
14645
14674
  }
14646
14675
  };
14647
14676
  var event_default = EventTrigger2;
@@ -14961,7 +14990,14 @@ var TriggerFactory = class {
14961
14990
  break;
14962
14991
  case avs_pb7.RunTriggerResp.OutputDataCase.EVENT_TRIGGER:
14963
14992
  triggerOutput = outputData.getEventTrigger();
14964
- break;
14993
+ if (triggerOutput) {
14994
+ if (triggerOutput.hasEvmLog()) {
14995
+ return triggerOutput.getEvmLog()?.toObject();
14996
+ } else if (triggerOutput.hasTransferLog()) {
14997
+ return triggerOutput.getTransferLog()?.toObject();
14998
+ }
14999
+ }
15000
+ return null;
14965
15001
  case avs_pb7.RunTriggerResp.OutputDataCase.MANUAL_TRIGGER:
14966
15002
  triggerOutput = outputData.getManualTrigger();
14967
15003
  break;
@@ -15672,6 +15708,28 @@ var Workflow = class _Workflow {
15672
15708
  }
15673
15709
  return request;
15674
15710
  }
15711
+ /**
15712
+ * Convert Workflow instance to plain object (WorkflowProps)
15713
+ * This is useful for serialization, especially with Next.js Server Components
15714
+ */
15715
+ toJson() {
15716
+ return {
15717
+ id: this.id,
15718
+ owner: this.owner,
15719
+ smartWalletAddress: this.smartWalletAddress,
15720
+ trigger: this.trigger.toJson(),
15721
+ nodes: this.nodes,
15722
+ edges: this.edges,
15723
+ startAt: this.startAt,
15724
+ expiredAt: this.expiredAt,
15725
+ maxExecution: this.maxExecution,
15726
+ executionCount: this.executionCount,
15727
+ name: this.name,
15728
+ status: this.status,
15729
+ completedAt: this.completedAt,
15730
+ lastRanAt: this.lastRanAt
15731
+ };
15732
+ }
15675
15733
  };
15676
15734
  var workflow_default = Workflow;
15677
15735
 
@@ -15690,6 +15748,24 @@ var Step = class _Step {
15690
15748
  this.startAt = props.startAt;
15691
15749
  this.endAt = props.endAt;
15692
15750
  }
15751
+ /**
15752
+ * Convert Step instance to plain object (StepProps)
15753
+ * This is useful for serialization, especially with Next.js Server Components
15754
+ */
15755
+ toJson() {
15756
+ return {
15757
+ id: this.id,
15758
+ type: this.type,
15759
+ name: this.name,
15760
+ success: this.success,
15761
+ error: this.error,
15762
+ log: this.log,
15763
+ inputsList: this.inputsList,
15764
+ output: this.output,
15765
+ startAt: this.startAt,
15766
+ endAt: this.endAt
15767
+ };
15768
+ }
15693
15769
  static getOutput(step) {
15694
15770
  const outputDataType = step.getOutputDataCase();
15695
15771
  let nodeOutputMessage;
@@ -15788,7 +15864,21 @@ var Execution2 = class _Execution {
15788
15864
  this.endAt = props.endAt;
15789
15865
  this.success = props.success;
15790
15866
  this.error = props.error;
15791
- this.steps = props.steps;
15867
+ this.steps = props.steps.map((s) => new step_default(s));
15868
+ }
15869
+ /**
15870
+ * Convert Execution instance to plain object (ExecutionProps)
15871
+ * This is useful for serialization, especially with Next.js Server Components
15872
+ */
15873
+ toJson() {
15874
+ return {
15875
+ id: this.id,
15876
+ startAt: this.startAt,
15877
+ endAt: this.endAt,
15878
+ success: this.success,
15879
+ error: this.error,
15880
+ steps: this.steps.map((step) => step.toJson())
15881
+ };
15792
15882
  }
15793
15883
  static fromResponse(execution) {
15794
15884
  return new _Execution({
@@ -16068,7 +16158,7 @@ var Client = class extends BaseClient {
16068
16158
  * @param {boolean} [options.includeNodes] - Include task nodes (expensive field)
16069
16159
  * @param {boolean} [options.includeEdges] - Include task edges (expensive field)
16070
16160
  * @param {string} [options.authKey] - The auth key for the request
16071
- * @returns {Promise<{ items: Workflow[]; pageInfo: PageInfo }>} - The list of Workflow objects with nested pagination metadata
16161
+ * @returns {Promise<{ items: WorkflowProps[]; pageInfo: PageInfo }>} - The list of WorkflowProps objects with nested pagination metadata
16072
16162
  */
16073
16163
  async getWorkflows(addresses, options) {
16074
16164
  const request = new avs_pb22.ListTasksReq();
@@ -16094,7 +16184,7 @@ var Client = class extends BaseClient {
16094
16184
  throw new Error("Server response missing pagination info.");
16095
16185
  }
16096
16186
  return {
16097
- items: result.getItemsList().map((item) => workflow_default.fromListResponse(item)),
16187
+ items: result.getItemsList().map((item) => workflow_default.fromListResponse(item).toJson()),
16098
16188
  pageInfo: {
16099
16189
  startCursor: pageInfo.getStartCursor(),
16100
16190
  endCursor: pageInfo.getEndCursor(),
@@ -16123,7 +16213,7 @@ var Client = class extends BaseClient {
16123
16213
  * @param {string} [options.after] - Get items after this cursor value (for forward pagination)
16124
16214
  * @param {number} [options.limit] - The page limit of the response; default is 10
16125
16215
  * @param {string} [options.authKey] - The auth key for the request
16126
- * @returns {Promise<{ items: Execution[]; pageInfo: PageInfo }>} - The list of Execution objects with nested pagination metadata
16216
+ * @returns {Promise<{ items: ExecutionProps[]; pageInfo: PageInfo }>} - The list of ExecutionProps objects with nested pagination metadata
16127
16217
  */
16128
16218
  async getExecutions(workflows, options) {
16129
16219
  const request = new avs_pb22.ListExecutionsReq();
@@ -16143,7 +16233,7 @@ var Client = class extends BaseClient {
16143
16233
  throw new Error("Server response missing pagination info.");
16144
16234
  }
16145
16235
  return {
16146
- items: result.getItemsList().map((item) => execution_default.fromResponse(item)),
16236
+ items: result.getItemsList().map((item) => execution_default.fromResponse(item).toJson()),
16147
16237
  pageInfo: {
16148
16238
  startCursor: pageInfo.getStartCursor(),
16149
16239
  endCursor: pageInfo.getEndCursor(),
@@ -16157,14 +16247,14 @@ var Client = class extends BaseClient {
16157
16247
  * @param {string} workflowId - The workflow id (taskId)
16158
16248
  * @param {string} executionId - The execution id
16159
16249
  * @param {RequestOptions} options - Request options
16160
- * @returns {Promise<Execution>} - The Execution object
16250
+ * @returns {Promise<ExecutionProps>} - The ExecutionProps object
16161
16251
  */
16162
16252
  async getExecution(workflowId, executionId, options) {
16163
16253
  const request = new avs_pb22.ExecutionReq();
16164
16254
  request.setTaskId(workflowId);
16165
16255
  request.setExecutionId(executionId);
16166
16256
  const result = await this.sendGrpcRequest("getExecution", request, options);
16167
- return execution_default.fromResponse(result);
16257
+ return execution_default.fromResponse(result).toJson();
16168
16258
  }
16169
16259
  /**
16170
16260
  * Get the count of executions for multiple workflows
@@ -16542,7 +16632,7 @@ var Client = class extends BaseClient {
16542
16632
  * @param {Array<Record<string, any>>} params.edges - The workflow edges
16543
16633
  * @param {Record<string, any>} params.inputVariables - Input variables for the simulation
16544
16634
  * @param {RequestOptions} options - Request options
16545
- * @returns {Promise<Execution>} - The response from simulating the task
16635
+ * @returns {Promise<ExecutionProps>} - The response from simulating the task
16546
16636
  */
16547
16637
  async simulateWorkflow({ trigger, nodes, edges, inputVariables = {} }, options) {
16548
16638
  const request = new avs_pb22.SimulateTaskReq();
@@ -16563,7 +16653,8 @@ var Client = class extends BaseClient {
16563
16653
  inputVarsMap.set(key, convertJSValueToProtobuf(value));
16564
16654
  }
16565
16655
  const result = await this.sendGrpcRequest("simulateTask", request, options);
16566
- return execution_default.fromResponse(result);
16656
+ const execution = execution_default.fromResponse(result);
16657
+ return execution.toJson();
16567
16658
  }
16568
16659
  /**
16569
16660
  * Get token metadata by contract address
@@ -9,6 +9,11 @@ declare class Execution implements ExecutionProps {
9
9
  error: string;
10
10
  steps: Step[];
11
11
  constructor(props: ExecutionProps);
12
+ /**
13
+ * Convert Execution instance to plain object (ExecutionProps)
14
+ * This is useful for serialization, especially with Next.js Server Components
15
+ */
16
+ toJson(): ExecutionProps;
12
17
  static fromResponse(execution: avs_pb.Execution): Execution;
13
18
  }
14
19
  export default Execution;
@@ -1 +1 @@
1
- {"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../../src/models/execution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAqC,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,IAAI,MAAM,QAAQ,CAAC;AAI1B,cAAM,SAAU,YAAW,cAAc;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,IAAI,EAAE,CAAC;gBAEF,KAAK,EAAE,cAAc;IASjC,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,SAAS,GAAG,SAAS;CAc5D;AAED,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../../src/models/execution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAqC,cAAc,EAAa,MAAM,oBAAoB,CAAC;AAClG,OAAO,IAAI,MAAM,QAAQ,CAAC;AAI1B,cAAM,SAAU,YAAW,cAAc;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,IAAI,EAAE,CAAC;gBAEF,KAAK,EAAE,cAAc;IASjC;;;OAGG;IACH,MAAM,IAAI,cAAc;IAWxB,MAAM,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,SAAS,GAAG,SAAS;CAc5D;AAED,eAAe,SAAS,CAAC"}
@@ -6,7 +6,21 @@ class Execution {
6
6
  this.endAt = props.endAt;
7
7
  this.success = props.success;
8
8
  this.error = props.error;
9
- this.steps = props.steps;
9
+ this.steps = props.steps.map(s => new Step(s));
10
+ }
11
+ /**
12
+ * Convert Execution instance to plain object (ExecutionProps)
13
+ * This is useful for serialization, especially with Next.js Server Components
14
+ */
15
+ toJson() {
16
+ return {
17
+ id: this.id,
18
+ startAt: this.startAt,
19
+ endAt: this.endAt,
20
+ success: this.success,
21
+ error: this.error,
22
+ steps: this.steps.map(step => step.toJson()),
23
+ };
10
24
  }
11
25
  static fromResponse(execution) {
12
26
  return new Execution({
@@ -12,6 +12,11 @@ declare class Step implements StepProps {
12
12
  startAt: number;
13
13
  endAt: number;
14
14
  constructor(props: StepProps);
15
+ /**
16
+ * Convert Step instance to plain object (StepProps)
17
+ * This is useful for serialization, especially with Next.js Server Components
18
+ */
19
+ toJson(): StepProps;
15
20
  static getOutput(step: avs_pb.Execution.Step): OutputDataProps;
16
21
  static fromResponse(step: avs_pb.Execution.Step): Step;
17
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../src/models/step.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAKhD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAEhE,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,eAAe,CAAC;IACxB,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,eAAe;IA8F9D,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI;CAgBvD;AAED,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../src/models/step.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAKhD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAEhE,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,eAAe,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;gBAEF,KAAK,EAAE,SAAS;IAa5B;;;OAGG;IACH,MAAM,IAAI,SAAS;IAenB,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,eAAe;IA8F9D,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI;CAgBvD;AAED,eAAe,IAAI,CAAC"}
@@ -13,6 +13,24 @@ class Step {
13
13
  this.startAt = props.startAt;
14
14
  this.endAt = props.endAt;
15
15
  }
16
+ /**
17
+ * Convert Step instance to plain object (StepProps)
18
+ * This is useful for serialization, especially with Next.js Server Components
19
+ */
20
+ toJson() {
21
+ return {
22
+ id: this.id,
23
+ type: this.type,
24
+ name: this.name,
25
+ success: this.success,
26
+ error: this.error,
27
+ log: this.log,
28
+ inputsList: this.inputsList,
29
+ output: this.output,
30
+ startAt: this.startAt,
31
+ endAt: this.endAt,
32
+ };
33
+ }
16
34
  static getOutput(step) {
17
35
  const outputDataType = step.getOutputDataCase();
18
36
  let nodeOutputMessage;
@@ -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,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"}
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;CAW9D;AAED,eAAe,YAAY,CAAC"}
@@ -97,7 +97,15 @@ class EventTrigger extends Trigger {
97
97
  */
98
98
  static fromOutputData(outputData) {
99
99
  const eventOutput = outputData.getEventTrigger();
100
- return eventOutput?.toObject() || null;
100
+ if (eventOutput) {
101
+ if (eventOutput.hasEvmLog()) {
102
+ return eventOutput.getEvmLog()?.toObject();
103
+ }
104
+ else if (eventOutput.hasTransferLog()) {
105
+ return eventOutput.getTransferLog()?.toObject();
106
+ }
107
+ }
108
+ return null;
101
109
  }
102
110
  }
103
111
  export default EventTrigger;
@@ -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,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"}
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;CAsD9D;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"}
@@ -68,7 +68,15 @@ class TriggerFactory {
68
68
  break;
69
69
  case avs_pb.RunTriggerResp.OutputDataCase.EVENT_TRIGGER:
70
70
  triggerOutput = outputData.getEventTrigger();
71
- break;
71
+ if (triggerOutput) {
72
+ if (triggerOutput.hasEvmLog()) {
73
+ return triggerOutput.getEvmLog()?.toObject();
74
+ }
75
+ else if (triggerOutput.hasTransferLog()) {
76
+ return triggerOutput.getTransferLog()?.toObject();
77
+ }
78
+ }
79
+ return null;
72
80
  case avs_pb.RunTriggerResp.OutputDataCase.MANUAL_TRIGGER:
73
81
  triggerOutput = outputData.getManualTrigger();
74
82
  break;
@@ -15,6 +15,7 @@ declare class Trigger implements TriggerProps {
15
15
  constructor(props: TriggerProps);
16
16
  toRequest(): avs_pb.TaskTrigger;
17
17
  getOutput(): TriggerOutput | undefined;
18
+ toJson(): TriggerProps;
18
19
  }
19
20
  export default Trigger;
20
21
  //# 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,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
+ {"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;IAItC,MAAM,IAAI,YAAY;CASvB;AAED,eAAe,OAAO,CAAC"}
@@ -16,5 +16,14 @@ class Trigger {
16
16
  getOutput() {
17
17
  return this.output;
18
18
  }
19
+ toJson() {
20
+ return {
21
+ id: this.id,
22
+ name: this.name,
23
+ type: this.type,
24
+ data: this.data,
25
+ output: this.output,
26
+ };
27
+ }
19
28
  }
20
29
  export default Trigger;
@@ -37,6 +37,11 @@ declare class Workflow implements WorkflowProps {
37
37
  */
38
38
  static fromListResponse(obj: avs_pb.Task): Workflow;
39
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;
40
45
  }
41
46
  export default Workflow;
42
47
  //# 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,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,CAA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,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;IAuBjC;;;OAGG;IACH,MAAM,IAAI,aAAa;CAkBxB;AAED,eAAe,QAAQ,CAAC"}
@@ -113,5 +113,27 @@ class Workflow {
113
113
  }
114
114
  return request;
115
115
  }
116
+ /**
117
+ * Convert Workflow instance to plain object (WorkflowProps)
118
+ * This is useful for serialization, especially with Next.js Server Components
119
+ */
120
+ toJson() {
121
+ return {
122
+ id: this.id,
123
+ owner: this.owner,
124
+ smartWalletAddress: this.smartWalletAddress,
125
+ trigger: this.trigger.toJson(),
126
+ nodes: this.nodes,
127
+ edges: this.edges,
128
+ startAt: this.startAt,
129
+ expiredAt: this.expiredAt,
130
+ maxExecution: this.maxExecution,
131
+ executionCount: this.executionCount,
132
+ name: this.name,
133
+ status: this.status,
134
+ completedAt: this.completedAt,
135
+ lastRanAt: this.lastRanAt,
136
+ };
137
+ }
116
138
  }
117
139
  export default Workflow;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@avaprotocol/sdk-js",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
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",