@avaprotocol/sdk-js 2.3.14 → 2.3.15

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.3.15
4
+
5
+ ### Patch Changes
6
+
7
+ - 567e1ab: Fixed nodes data not serialized for deploy problem
8
+
3
9
  ## 2.3.14
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -16799,7 +16799,7 @@ function convertInputToProtobuf(input) {
16799
16799
  if (!input) {
16800
16800
  return void 0;
16801
16801
  }
16802
- return import_struct_pb.Value.fromJavaScript(input);
16802
+ return convertJSValueToProtobuf(input);
16803
16803
  }
16804
16804
  function extractInputFromProtobuf(inputValue) {
16805
16805
  if (!inputValue) {
@@ -18227,8 +18227,36 @@ var Workflow = class _Workflow {
18227
18227
  const request = new avs_pb19.CreateTaskReq();
18228
18228
  request.setSmartWalletAddress(this.smartWalletAddress);
18229
18229
  request.setTrigger(this.trigger.toRequest());
18230
- import_lodash3.default.map(this.nodes, (node) => request.addNodes(node.toRequest()));
18231
- import_lodash3.default.map(this.edges, (edge) => request.addEdges(edge.toRequest()));
18230
+ try {
18231
+ import_lodash3.default.map(this.nodes, (node, index) => {
18232
+ try {
18233
+ const nodeRequest = node.toRequest();
18234
+ request.addNodes(nodeRequest);
18235
+ } catch (nodeError) {
18236
+ console.error(`\u{1F6A8} Node ${index} (${node.name}) serialization failed:`, nodeError);
18237
+ const errorMessage = nodeError instanceof Error ? nodeError.message : String(nodeError);
18238
+ throw new Error(`Node serialization failed: ${node.name} - ${errorMessage}`);
18239
+ }
18240
+ });
18241
+ } catch (nodesError) {
18242
+ console.error("\u{1F6A8} Nodes serialization failed:", nodesError);
18243
+ throw nodesError;
18244
+ }
18245
+ try {
18246
+ import_lodash3.default.map(this.edges, (edge, index) => {
18247
+ try {
18248
+ const edgeRequest = edge.toRequest();
18249
+ request.addEdges(edgeRequest);
18250
+ } catch (edgeError) {
18251
+ console.error(`\u{1F6A8} Edge ${index} serialization failed:`, edgeError);
18252
+ const errorMessage = edgeError instanceof Error ? edgeError.message : String(edgeError);
18253
+ throw new Error(`Edge serialization failed: ${edge.id} - ${errorMessage}`);
18254
+ }
18255
+ });
18256
+ } catch (edgesError) {
18257
+ console.error("\u{1F6A8} Edges serialization failed:", edgesError);
18258
+ throw edgesError;
18259
+ }
18232
18260
  request.setStartAt(this.startAt);
18233
18261
  request.setExpiredAt(this.expiredAt);
18234
18262
  request.setMaxExecution(this.maxExecution);
package/dist/index.mjs CHANGED
@@ -16774,7 +16774,7 @@ function convertInputToProtobuf(input) {
16774
16774
  if (!input) {
16775
16775
  return void 0;
16776
16776
  }
16777
- return ProtobufValue.fromJavaScript(input);
16777
+ return convertJSValueToProtobuf(input);
16778
16778
  }
16779
16779
  function extractInputFromProtobuf(inputValue) {
16780
16780
  if (!inputValue) {
@@ -18214,8 +18214,36 @@ var Workflow = class _Workflow {
18214
18214
  const request = new avs_pb19.CreateTaskReq();
18215
18215
  request.setSmartWalletAddress(this.smartWalletAddress);
18216
18216
  request.setTrigger(this.trigger.toRequest());
18217
- _3.map(this.nodes, (node) => request.addNodes(node.toRequest()));
18218
- _3.map(this.edges, (edge) => request.addEdges(edge.toRequest()));
18217
+ try {
18218
+ _3.map(this.nodes, (node, index) => {
18219
+ try {
18220
+ const nodeRequest = node.toRequest();
18221
+ request.addNodes(nodeRequest);
18222
+ } catch (nodeError) {
18223
+ console.error(`\u{1F6A8} Node ${index} (${node.name}) serialization failed:`, nodeError);
18224
+ const errorMessage = nodeError instanceof Error ? nodeError.message : String(nodeError);
18225
+ throw new Error(`Node serialization failed: ${node.name} - ${errorMessage}`);
18226
+ }
18227
+ });
18228
+ } catch (nodesError) {
18229
+ console.error("\u{1F6A8} Nodes serialization failed:", nodesError);
18230
+ throw nodesError;
18231
+ }
18232
+ try {
18233
+ _3.map(this.edges, (edge, index) => {
18234
+ try {
18235
+ const edgeRequest = edge.toRequest();
18236
+ request.addEdges(edgeRequest);
18237
+ } catch (edgeError) {
18238
+ console.error(`\u{1F6A8} Edge ${index} serialization failed:`, edgeError);
18239
+ const errorMessage = edgeError instanceof Error ? edgeError.message : String(edgeError);
18240
+ throw new Error(`Edge serialization failed: ${edge.id} - ${errorMessage}`);
18241
+ }
18242
+ });
18243
+ } catch (edgesError) {
18244
+ console.error("\u{1F6A8} Edges serialization failed:", edgesError);
18245
+ throw edgesError;
18246
+ }
18219
18247
  request.setStartAt(this.startAt);
18220
18248
  request.setExpiredAt(this.expiredAt);
18221
18249
  request.setMaxExecution(this.maxExecution);
@@ -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,MAA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AAW,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;IAsDjC;;;OAGG;IACH,MAAM,IAAI,aAAa;CAkBxB;AAED,eAAe,QAAQ,CAAC"}
@@ -102,8 +102,42 @@ class Workflow {
102
102
  // TODO: add client side validation for each field
103
103
  request.setSmartWalletAddress(this.smartWalletAddress);
104
104
  request.setTrigger(this.trigger.toRequest());
105
- _.map(this.nodes, (node) => request.addNodes(node.toRequest()));
106
- _.map(this.edges, (edge) => request.addEdges(edge.toRequest()));
105
+ // Add error handling for node serialization
106
+ try {
107
+ _.map(this.nodes, (node, index) => {
108
+ try {
109
+ const nodeRequest = node.toRequest();
110
+ request.addNodes(nodeRequest);
111
+ }
112
+ catch (nodeError) {
113
+ console.error(`🚨 Node ${index} (${node.name}) serialization failed:`, nodeError);
114
+ const errorMessage = nodeError instanceof Error ? nodeError.message : String(nodeError);
115
+ throw new Error(`Node serialization failed: ${node.name} - ${errorMessage}`);
116
+ }
117
+ });
118
+ }
119
+ catch (nodesError) {
120
+ console.error('🚨 Nodes serialization failed:', nodesError);
121
+ throw nodesError;
122
+ }
123
+ // Add error handling for edge serialization
124
+ try {
125
+ _.map(this.edges, (edge, index) => {
126
+ try {
127
+ const edgeRequest = edge.toRequest();
128
+ request.addEdges(edgeRequest);
129
+ }
130
+ catch (edgeError) {
131
+ console.error(`🚨 Edge ${index} serialization failed:`, edgeError);
132
+ const errorMessage = edgeError instanceof Error ? edgeError.message : String(edgeError);
133
+ throw new Error(`Edge serialization failed: ${edge.id} - ${errorMessage}`);
134
+ }
135
+ });
136
+ }
137
+ catch (edgesError) {
138
+ console.error('🚨 Edges serialization failed:', edgesError);
139
+ throw edgesError;
140
+ }
107
141
  request.setStartAt(this.startAt);
108
142
  request.setExpiredAt(this.expiredAt);
109
143
  request.setMaxExecution(this.maxExecution);
package/dist/utils.js CHANGED
@@ -241,7 +241,7 @@ export function convertInputToProtobuf(input) {
241
241
  if (!input) {
242
242
  return undefined;
243
243
  }
244
- return ProtobufValue.fromJavaScript(input);
244
+ return convertJSValueToProtobuf(input);
245
245
  }
246
246
  /**
247
247
  * Extract input field from protobuf Value format to JavaScript object
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@avaprotocol/sdk-js",
3
- "version": "2.3.14",
3
+ "version": "2.3.15",
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",