@avaprotocol/sdk-js 2.0.3 → 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,11 @@
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
+
3
9
  ## 2.0.3
4
10
 
5
11
  ### 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,EACtB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,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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
@@ -14478,6 +14478,15 @@ var Trigger = class {
14478
14478
  getOutput() {
14479
14479
  return this.output;
14480
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
+ }
14481
14490
  };
14482
14491
  var interface_default = Trigger;
14483
14492
 
@@ -15717,6 +15726,28 @@ var Workflow = class _Workflow {
15717
15726
  }
15718
15727
  return request;
15719
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
+ }
15720
15751
  };
15721
15752
  var workflow_default = Workflow;
15722
15753
 
@@ -15735,6 +15766,24 @@ var Step = class _Step {
15735
15766
  this.startAt = props.startAt;
15736
15767
  this.endAt = props.endAt;
15737
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
+ }
15738
15787
  static getOutput(step) {
15739
15788
  const outputDataType = step.getOutputDataCase();
15740
15789
  let nodeOutputMessage;
@@ -15833,7 +15882,21 @@ var Execution2 = class _Execution {
15833
15882
  this.endAt = props.endAt;
15834
15883
  this.success = props.success;
15835
15884
  this.error = props.error;
15836
- 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
+ };
15837
15900
  }
15838
15901
  static fromResponse(execution) {
15839
15902
  return new _Execution({
@@ -16106,7 +16169,7 @@ var Client = class extends BaseClient {
16106
16169
  * @param {boolean} [options.includeNodes] - Include task nodes (expensive field)
16107
16170
  * @param {boolean} [options.includeEdges] - Include task edges (expensive field)
16108
16171
  * @param {string} [options.authKey] - The auth key for the request
16109
- * @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
16110
16173
  */
16111
16174
  async getWorkflows(addresses, options) {
16112
16175
  const request = new avs_pb22.ListTasksReq();
@@ -16132,7 +16195,7 @@ var Client = class extends BaseClient {
16132
16195
  throw new Error("Server response missing pagination info.");
16133
16196
  }
16134
16197
  return {
16135
- items: result.getItemsList().map((item) => workflow_default.fromListResponse(item)),
16198
+ items: result.getItemsList().map((item) => workflow_default.fromListResponse(item).toJson()),
16136
16199
  pageInfo: {
16137
16200
  startCursor: pageInfo.getStartCursor(),
16138
16201
  endCursor: pageInfo.getEndCursor(),
@@ -16161,7 +16224,7 @@ var Client = class extends BaseClient {
16161
16224
  * @param {string} [options.after] - Get items after this cursor value (for forward pagination)
16162
16225
  * @param {number} [options.limit] - The page limit of the response; default is 10
16163
16226
  * @param {string} [options.authKey] - The auth key for the request
16164
- * @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
16165
16228
  */
16166
16229
  async getExecutions(workflows, options) {
16167
16230
  const request = new avs_pb22.ListExecutionsReq();
@@ -16181,7 +16244,7 @@ var Client = class extends BaseClient {
16181
16244
  throw new Error("Server response missing pagination info.");
16182
16245
  }
16183
16246
  return {
16184
- items: result.getItemsList().map((item) => execution_default.fromResponse(item)),
16247
+ items: result.getItemsList().map((item) => execution_default.fromResponse(item).toJson()),
16185
16248
  pageInfo: {
16186
16249
  startCursor: pageInfo.getStartCursor(),
16187
16250
  endCursor: pageInfo.getEndCursor(),
@@ -16195,14 +16258,14 @@ var Client = class extends BaseClient {
16195
16258
  * @param {string} workflowId - The workflow id (taskId)
16196
16259
  * @param {string} executionId - The execution id
16197
16260
  * @param {RequestOptions} options - Request options
16198
- * @returns {Promise<Execution>} - The Execution object
16261
+ * @returns {Promise<ExecutionProps>} - The ExecutionProps object
16199
16262
  */
16200
16263
  async getExecution(workflowId, executionId, options) {
16201
16264
  const request = new avs_pb22.ExecutionReq();
16202
16265
  request.setTaskId(workflowId);
16203
16266
  request.setExecutionId(executionId);
16204
16267
  const result = await this.sendGrpcRequest("getExecution", request, options);
16205
- return execution_default.fromResponse(result);
16268
+ return execution_default.fromResponse(result).toJson();
16206
16269
  }
16207
16270
  /**
16208
16271
  * Get the count of executions for multiple workflows
@@ -16580,7 +16643,7 @@ var Client = class extends BaseClient {
16580
16643
  * @param {Array<Record<string, any>>} params.edges - The workflow edges
16581
16644
  * @param {Record<string, any>} params.inputVariables - Input variables for the simulation
16582
16645
  * @param {RequestOptions} options - Request options
16583
- * @returns {Promise<Execution>} - The response from simulating the task
16646
+ * @returns {Promise<ExecutionProps>} - The response from simulating the task
16584
16647
  */
16585
16648
  async simulateWorkflow({ trigger, nodes, edges, inputVariables = {} }, options) {
16586
16649
  const request = new avs_pb22.SimulateTaskReq();
@@ -16601,7 +16664,8 @@ var Client = class extends BaseClient {
16601
16664
  inputVarsMap.set(key, convertJSValueToProtobuf(value));
16602
16665
  }
16603
16666
  const result = await this.sendGrpcRequest("simulateTask", request, options);
16604
- return execution_default.fromResponse(result);
16667
+ const execution = execution_default.fromResponse(result);
16668
+ return execution.toJson();
16605
16669
  }
16606
16670
  /**
16607
16671
  * Get token metadata by contract address
package/dist/index.mjs CHANGED
@@ -14449,6 +14449,15 @@ var Trigger = class {
14449
14449
  getOutput() {
14450
14450
  return this.output;
14451
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
+ }
14452
14461
  };
14453
14462
  var interface_default = Trigger;
14454
14463
 
@@ -15699,6 +15708,28 @@ var Workflow = class _Workflow {
15699
15708
  }
15700
15709
  return request;
15701
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
+ }
15702
15733
  };
15703
15734
  var workflow_default = Workflow;
15704
15735
 
@@ -15717,6 +15748,24 @@ var Step = class _Step {
15717
15748
  this.startAt = props.startAt;
15718
15749
  this.endAt = props.endAt;
15719
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
+ }
15720
15769
  static getOutput(step) {
15721
15770
  const outputDataType = step.getOutputDataCase();
15722
15771
  let nodeOutputMessage;
@@ -15815,7 +15864,21 @@ var Execution2 = class _Execution {
15815
15864
  this.endAt = props.endAt;
15816
15865
  this.success = props.success;
15817
15866
  this.error = props.error;
15818
- 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
+ };
15819
15882
  }
15820
15883
  static fromResponse(execution) {
15821
15884
  return new _Execution({
@@ -16095,7 +16158,7 @@ var Client = class extends BaseClient {
16095
16158
  * @param {boolean} [options.includeNodes] - Include task nodes (expensive field)
16096
16159
  * @param {boolean} [options.includeEdges] - Include task edges (expensive field)
16097
16160
  * @param {string} [options.authKey] - The auth key for the request
16098
- * @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
16099
16162
  */
16100
16163
  async getWorkflows(addresses, options) {
16101
16164
  const request = new avs_pb22.ListTasksReq();
@@ -16121,7 +16184,7 @@ var Client = class extends BaseClient {
16121
16184
  throw new Error("Server response missing pagination info.");
16122
16185
  }
16123
16186
  return {
16124
- items: result.getItemsList().map((item) => workflow_default.fromListResponse(item)),
16187
+ items: result.getItemsList().map((item) => workflow_default.fromListResponse(item).toJson()),
16125
16188
  pageInfo: {
16126
16189
  startCursor: pageInfo.getStartCursor(),
16127
16190
  endCursor: pageInfo.getEndCursor(),
@@ -16150,7 +16213,7 @@ var Client = class extends BaseClient {
16150
16213
  * @param {string} [options.after] - Get items after this cursor value (for forward pagination)
16151
16214
  * @param {number} [options.limit] - The page limit of the response; default is 10
16152
16215
  * @param {string} [options.authKey] - The auth key for the request
16153
- * @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
16154
16217
  */
16155
16218
  async getExecutions(workflows, options) {
16156
16219
  const request = new avs_pb22.ListExecutionsReq();
@@ -16170,7 +16233,7 @@ var Client = class extends BaseClient {
16170
16233
  throw new Error("Server response missing pagination info.");
16171
16234
  }
16172
16235
  return {
16173
- items: result.getItemsList().map((item) => execution_default.fromResponse(item)),
16236
+ items: result.getItemsList().map((item) => execution_default.fromResponse(item).toJson()),
16174
16237
  pageInfo: {
16175
16238
  startCursor: pageInfo.getStartCursor(),
16176
16239
  endCursor: pageInfo.getEndCursor(),
@@ -16184,14 +16247,14 @@ var Client = class extends BaseClient {
16184
16247
  * @param {string} workflowId - The workflow id (taskId)
16185
16248
  * @param {string} executionId - The execution id
16186
16249
  * @param {RequestOptions} options - Request options
16187
- * @returns {Promise<Execution>} - The Execution object
16250
+ * @returns {Promise<ExecutionProps>} - The ExecutionProps object
16188
16251
  */
16189
16252
  async getExecution(workflowId, executionId, options) {
16190
16253
  const request = new avs_pb22.ExecutionReq();
16191
16254
  request.setTaskId(workflowId);
16192
16255
  request.setExecutionId(executionId);
16193
16256
  const result = await this.sendGrpcRequest("getExecution", request, options);
16194
- return execution_default.fromResponse(result);
16257
+ return execution_default.fromResponse(result).toJson();
16195
16258
  }
16196
16259
  /**
16197
16260
  * Get the count of executions for multiple workflows
@@ -16569,7 +16632,7 @@ var Client = class extends BaseClient {
16569
16632
  * @param {Array<Record<string, any>>} params.edges - The workflow edges
16570
16633
  * @param {Record<string, any>} params.inputVariables - Input variables for the simulation
16571
16634
  * @param {RequestOptions} options - Request options
16572
- * @returns {Promise<Execution>} - The response from simulating the task
16635
+ * @returns {Promise<ExecutionProps>} - The response from simulating the task
16573
16636
  */
16574
16637
  async simulateWorkflow({ trigger, nodes, edges, inputVariables = {} }, options) {
16575
16638
  const request = new avs_pb22.SimulateTaskReq();
@@ -16590,7 +16653,8 @@ var Client = class extends BaseClient {
16590
16653
  inputVarsMap.set(key, convertJSValueToProtobuf(value));
16591
16654
  }
16592
16655
  const result = await this.sendGrpcRequest("simulateTask", request, options);
16593
- return execution_default.fromResponse(result);
16656
+ const execution = execution_default.fromResponse(result);
16657
+ return execution.toJson();
16594
16658
  }
16595
16659
  /**
16596
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,CA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F9D,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;
@@ -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,G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AAC,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,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AAC,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,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;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.3",
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",