@avaprotocol/sdk-js 2.3.14 → 2.3.16

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) {
@@ -18225,16 +18225,63 @@ var Workflow = class _Workflow {
18225
18225
  }
18226
18226
  toRequest() {
18227
18227
  const request = new avs_pb19.CreateTaskReq();
18228
+ console.log("\u{1F50D} Workflow.toRequest() - Starting serialization...");
18229
+ console.log("\u{1F4CA} Input data:");
18230
+ console.log(" - nodes count:", this.nodes?.length || 0);
18231
+ console.log(" - edges count:", this.edges?.length || 0);
18228
18232
  request.setSmartWalletAddress(this.smartWalletAddress);
18229
18233
  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()));
18234
+ try {
18235
+ let nodeCount = 0;
18236
+ import_lodash3.default.map(this.nodes, (node, index) => {
18237
+ try {
18238
+ console.log(`\u{1F527} Serializing node ${index}: ${node.name} (${node.type})`);
18239
+ const nodeRequest = node.toRequest();
18240
+ request.addNodes(nodeRequest);
18241
+ nodeCount++;
18242
+ console.log(`\u2705 Node ${index} serialized successfully`);
18243
+ } catch (nodeError) {
18244
+ console.error(`\u{1F6A8} Node ${index} (${node.name}) serialization failed:`, nodeError);
18245
+ const errorMessage = nodeError instanceof Error ? nodeError.message : String(nodeError);
18246
+ throw new Error(`Node serialization failed: ${node.name} - ${errorMessage}`);
18247
+ }
18248
+ });
18249
+ console.log(`\u{1F4CA} Successfully serialized ${nodeCount} nodes`);
18250
+ } catch (nodesError) {
18251
+ console.error("\u{1F6A8} Nodes serialization failed:", nodesError);
18252
+ throw nodesError;
18253
+ }
18254
+ try {
18255
+ let edgeCount = 0;
18256
+ import_lodash3.default.map(this.edges, (edge, index) => {
18257
+ try {
18258
+ console.log(`\u{1F517} Serializing edge ${index}: ${edge.source} -> ${edge.target}`);
18259
+ const edgeRequest = edge.toRequest();
18260
+ request.addEdges(edgeRequest);
18261
+ edgeCount++;
18262
+ console.log(`\u2705 Edge ${index} serialized successfully`);
18263
+ } catch (edgeError) {
18264
+ console.error(`\u{1F6A8} Edge ${index} serialization failed:`, edgeError);
18265
+ const errorMessage = edgeError instanceof Error ? edgeError.message : String(edgeError);
18266
+ throw new Error(`Edge serialization failed: ${edge.id} - ${errorMessage}`);
18267
+ }
18268
+ });
18269
+ console.log(`\u{1F4CA} Successfully serialized ${edgeCount} edges`);
18270
+ } catch (edgesError) {
18271
+ console.error("\u{1F6A8} Edges serialization failed:", edgesError);
18272
+ throw edgesError;
18273
+ }
18232
18274
  request.setStartAt(this.startAt);
18233
18275
  request.setExpiredAt(this.expiredAt);
18234
18276
  request.setMaxExecution(this.maxExecution);
18235
18277
  if (this.name) {
18236
18278
  request.setName(this.name);
18237
18279
  }
18280
+ console.log("\u{1F4E4} Final protobuf request summary:");
18281
+ console.log(" - nodes in request:", request.getNodesList().length);
18282
+ console.log(" - edges in request:", request.getEdgesList().length);
18283
+ console.log(" - trigger set:", !!request.getTrigger());
18284
+ console.log("\u{1F50D} Workflow.toRequest() - Serialization complete");
18238
18285
  return request;
18239
18286
  }
18240
18287
  /**
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) {
@@ -18212,16 +18212,63 @@ var Workflow = class _Workflow {
18212
18212
  }
18213
18213
  toRequest() {
18214
18214
  const request = new avs_pb19.CreateTaskReq();
18215
+ console.log("\u{1F50D} Workflow.toRequest() - Starting serialization...");
18216
+ console.log("\u{1F4CA} Input data:");
18217
+ console.log(" - nodes count:", this.nodes?.length || 0);
18218
+ console.log(" - edges count:", this.edges?.length || 0);
18215
18219
  request.setSmartWalletAddress(this.smartWalletAddress);
18216
18220
  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()));
18221
+ try {
18222
+ let nodeCount = 0;
18223
+ _3.map(this.nodes, (node, index) => {
18224
+ try {
18225
+ console.log(`\u{1F527} Serializing node ${index}: ${node.name} (${node.type})`);
18226
+ const nodeRequest = node.toRequest();
18227
+ request.addNodes(nodeRequest);
18228
+ nodeCount++;
18229
+ console.log(`\u2705 Node ${index} serialized successfully`);
18230
+ } catch (nodeError) {
18231
+ console.error(`\u{1F6A8} Node ${index} (${node.name}) serialization failed:`, nodeError);
18232
+ const errorMessage = nodeError instanceof Error ? nodeError.message : String(nodeError);
18233
+ throw new Error(`Node serialization failed: ${node.name} - ${errorMessage}`);
18234
+ }
18235
+ });
18236
+ console.log(`\u{1F4CA} Successfully serialized ${nodeCount} nodes`);
18237
+ } catch (nodesError) {
18238
+ console.error("\u{1F6A8} Nodes serialization failed:", nodesError);
18239
+ throw nodesError;
18240
+ }
18241
+ try {
18242
+ let edgeCount = 0;
18243
+ _3.map(this.edges, (edge, index) => {
18244
+ try {
18245
+ console.log(`\u{1F517} Serializing edge ${index}: ${edge.source} -> ${edge.target}`);
18246
+ const edgeRequest = edge.toRequest();
18247
+ request.addEdges(edgeRequest);
18248
+ edgeCount++;
18249
+ console.log(`\u2705 Edge ${index} serialized successfully`);
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
+ console.log(`\u{1F4CA} Successfully serialized ${edgeCount} edges`);
18257
+ } catch (edgesError) {
18258
+ console.error("\u{1F6A8} Edges serialization failed:", edgesError);
18259
+ throw edgesError;
18260
+ }
18219
18261
  request.setStartAt(this.startAt);
18220
18262
  request.setExpiredAt(this.expiredAt);
18221
18263
  request.setMaxExecution(this.maxExecution);
18222
18264
  if (this.name) {
18223
18265
  request.setName(this.name);
18224
18266
  }
18267
+ console.log("\u{1F4E4} Final protobuf request summary:");
18268
+ console.log(" - nodes in request:", request.getNodesList().length);
18269
+ console.log(" - edges in request:", request.getEdgesList().length);
18270
+ console.log(" - trigger set:", !!request.getTrigger());
18271
+ console.log("\u{1F50D} Workflow.toRequest() - Serialization complete");
18225
18272
  return request;
18226
18273
  }
18227
18274
  /**
@@ -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,M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rC,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;IA2EjC;;;OAGG;IACH,MAAM,IAAI,aAAa;CAkBxB;AAED,eAAe,QAAQ,CAAC"}
@@ -99,11 +99,59 @@ class Workflow {
99
99
  }
100
100
  toRequest() {
101
101
  const request = new avs_pb.CreateTaskReq();
102
+ console.log("🔍 Workflow.toRequest() - Starting serialization...");
103
+ console.log("📊 Input data:");
104
+ console.log(" - nodes count:", this.nodes?.length || 0);
105
+ console.log(" - edges count:", this.edges?.length || 0);
102
106
  // TODO: add client side validation for each field
103
107
  request.setSmartWalletAddress(this.smartWalletAddress);
104
108
  request.setTrigger(this.trigger.toRequest());
105
- _.map(this.nodes, (node) => request.addNodes(node.toRequest()));
106
- _.map(this.edges, (edge) => request.addEdges(edge.toRequest()));
109
+ // Add error handling for node serialization
110
+ try {
111
+ let nodeCount = 0;
112
+ _.map(this.nodes, (node, index) => {
113
+ try {
114
+ console.log(`🔧 Serializing node ${index}: ${node.name} (${node.type})`);
115
+ const nodeRequest = node.toRequest();
116
+ request.addNodes(nodeRequest);
117
+ nodeCount++;
118
+ console.log(`✅ Node ${index} serialized successfully`);
119
+ }
120
+ catch (nodeError) {
121
+ console.error(`🚨 Node ${index} (${node.name}) serialization failed:`, nodeError);
122
+ const errorMessage = nodeError instanceof Error ? nodeError.message : String(nodeError);
123
+ throw new Error(`Node serialization failed: ${node.name} - ${errorMessage}`);
124
+ }
125
+ });
126
+ console.log(`📊 Successfully serialized ${nodeCount} nodes`);
127
+ }
128
+ catch (nodesError) {
129
+ console.error('🚨 Nodes serialization failed:', nodesError);
130
+ throw nodesError;
131
+ }
132
+ // Add error handling for edge serialization
133
+ try {
134
+ let edgeCount = 0;
135
+ _.map(this.edges, (edge, index) => {
136
+ try {
137
+ console.log(`🔗 Serializing edge ${index}: ${edge.source} -> ${edge.target}`);
138
+ const edgeRequest = edge.toRequest();
139
+ request.addEdges(edgeRequest);
140
+ edgeCount++;
141
+ console.log(`✅ Edge ${index} serialized successfully`);
142
+ }
143
+ catch (edgeError) {
144
+ console.error(`🚨 Edge ${index} serialization failed:`, edgeError);
145
+ const errorMessage = edgeError instanceof Error ? edgeError.message : String(edgeError);
146
+ throw new Error(`Edge serialization failed: ${edge.id} - ${errorMessage}`);
147
+ }
148
+ });
149
+ console.log(`📊 Successfully serialized ${edgeCount} edges`);
150
+ }
151
+ catch (edgesError) {
152
+ console.error('🚨 Edges serialization failed:', edgesError);
153
+ throw edgesError;
154
+ }
107
155
  request.setStartAt(this.startAt);
108
156
  request.setExpiredAt(this.expiredAt);
109
157
  request.setMaxExecution(this.maxExecution);
@@ -111,6 +159,11 @@ class Workflow {
111
159
  if (this.name) {
112
160
  request.setName(this.name);
113
161
  }
162
+ console.log("📤 Final protobuf request summary:");
163
+ console.log(" - nodes in request:", request.getNodesList().length);
164
+ console.log(" - edges in request:", request.getEdgesList().length);
165
+ console.log(" - trigger set:", !!request.getTrigger());
166
+ console.log("🔍 Workflow.toRequest() - Serialization complete");
114
167
  return request;
115
168
  }
116
169
  /**
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.16",
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",