@avaprotocol/sdk-js 2.12.3 → 2.14.0
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 +17 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +62 -23
- package/dist/index.mjs +66 -24
- package/dist/models/edge.d.ts.map +1 -1
- package/dist/models/node/filter.js +2 -2
- package/dist/models/node/interface.d.ts.map +1 -1
- package/dist/models/node/interface.js +3 -3
- package/dist/models/node/loop.d.ts.map +1 -1
- package/dist/models/node/loop.js +6 -3
- package/dist/models/trigger/event.d.ts.map +1 -1
- package/dist/models/workflow.d.ts +1 -1
- package/dist/models/workflow.d.ts.map +1 -1
- package/dist/models/workflow.js +18 -12
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @avaprotocol/sdk-js
|
|
2
2
|
|
|
3
|
+
## 2.14.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- e636c25: feat: template variables for Loop/Filter nodes, settings validation, secrets fix
|
|
8
|
+
|
|
9
|
+
## 2.13.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 0d52ded: refactor: migrated workflow.name to inputVariables.settings.name in deployed workflow creation
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [0d52ded]
|
|
18
|
+
- @avaprotocol/types@2.10.0
|
|
19
|
+
|
|
3
20
|
## 2.12.3
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,QAAQ,EAAU,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC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AAmB;IAgB3B;;;OAGG;IACH,OAAO,CAAC,gBAAgB;CAQzB;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,EACN,SAAS,EACT,qBAAqB,GACtB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -6385,7 +6385,7 @@ var require_avs_pb = __commonJS({
|
|
|
6385
6385
|
proto.aggregator.FilterNode.Config.toObject = function(includeInstance, msg) {
|
|
6386
6386
|
var f, obj = {
|
|
6387
6387
|
expression: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
|
6388
|
-
|
|
6388
|
+
inputVariable: jspb.Message.getFieldWithDefault(msg, 2, "")
|
|
6389
6389
|
};
|
|
6390
6390
|
if (includeInstance) {
|
|
6391
6391
|
obj.$jspbMessageInstance = msg;
|
|
@@ -6417,7 +6417,7 @@ var require_avs_pb = __commonJS({
|
|
|
6417
6417
|
/** @type {string} */
|
|
6418
6418
|
reader.readString()
|
|
6419
6419
|
);
|
|
6420
|
-
msg.
|
|
6420
|
+
msg.setInputVariable(value);
|
|
6421
6421
|
break;
|
|
6422
6422
|
default:
|
|
6423
6423
|
reader.skipField();
|
|
@@ -6440,7 +6440,7 @@ var require_avs_pb = __commonJS({
|
|
|
6440
6440
|
f
|
|
6441
6441
|
);
|
|
6442
6442
|
}
|
|
6443
|
-
f = message.
|
|
6443
|
+
f = message.getInputVariable();
|
|
6444
6444
|
if (f.length > 0) {
|
|
6445
6445
|
writer.writeString(
|
|
6446
6446
|
2,
|
|
@@ -6457,13 +6457,13 @@ var require_avs_pb = __commonJS({
|
|
|
6457
6457
|
proto.aggregator.FilterNode.Config.prototype.setExpression = function(value) {
|
|
6458
6458
|
return jspb.Message.setProto3StringField(this, 1, value);
|
|
6459
6459
|
};
|
|
6460
|
-
proto.aggregator.FilterNode.Config.prototype.
|
|
6460
|
+
proto.aggregator.FilterNode.Config.prototype.getInputVariable = function() {
|
|
6461
6461
|
return (
|
|
6462
6462
|
/** @type {string} */
|
|
6463
6463
|
jspb.Message.getFieldWithDefault(this, 2, "")
|
|
6464
6464
|
);
|
|
6465
6465
|
};
|
|
6466
|
-
proto.aggregator.FilterNode.Config.prototype.
|
|
6466
|
+
proto.aggregator.FilterNode.Config.prototype.setInputVariable = function(value) {
|
|
6467
6467
|
return jspb.Message.setProto3StringField(this, 2, value);
|
|
6468
6468
|
};
|
|
6469
6469
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
@@ -6710,10 +6710,11 @@ var require_avs_pb = __commonJS({
|
|
|
6710
6710
|
};
|
|
6711
6711
|
proto.aggregator.LoopNode.Config.toObject = function(includeInstance, msg) {
|
|
6712
6712
|
var f, obj = {
|
|
6713
|
-
|
|
6713
|
+
inputVariable: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
|
6714
6714
|
iterVal: jspb.Message.getFieldWithDefault(msg, 2, ""),
|
|
6715
6715
|
iterKey: jspb.Message.getFieldWithDefault(msg, 3, ""),
|
|
6716
|
-
executionMode: jspb.Message.getFieldWithDefault(msg, 4, 0)
|
|
6716
|
+
executionMode: jspb.Message.getFieldWithDefault(msg, 4, 0),
|
|
6717
|
+
iterationTimeout: jspb.Message.getFieldWithDefault(msg, 5, 0)
|
|
6717
6718
|
};
|
|
6718
6719
|
if (includeInstance) {
|
|
6719
6720
|
obj.$jspbMessageInstance = msg;
|
|
@@ -6738,7 +6739,7 @@ var require_avs_pb = __commonJS({
|
|
|
6738
6739
|
/** @type {string} */
|
|
6739
6740
|
reader.readString()
|
|
6740
6741
|
);
|
|
6741
|
-
msg.
|
|
6742
|
+
msg.setInputVariable(value);
|
|
6742
6743
|
break;
|
|
6743
6744
|
case 2:
|
|
6744
6745
|
var value = (
|
|
@@ -6761,6 +6762,13 @@ var require_avs_pb = __commonJS({
|
|
|
6761
6762
|
);
|
|
6762
6763
|
msg.setExecutionMode(value);
|
|
6763
6764
|
break;
|
|
6765
|
+
case 5:
|
|
6766
|
+
var value = (
|
|
6767
|
+
/** @type {number} */
|
|
6768
|
+
reader.readUint32()
|
|
6769
|
+
);
|
|
6770
|
+
msg.setIterationTimeout(value);
|
|
6771
|
+
break;
|
|
6764
6772
|
default:
|
|
6765
6773
|
reader.skipField();
|
|
6766
6774
|
break;
|
|
@@ -6775,7 +6783,7 @@ var require_avs_pb = __commonJS({
|
|
|
6775
6783
|
};
|
|
6776
6784
|
proto.aggregator.LoopNode.Config.serializeBinaryToWriter = function(message, writer) {
|
|
6777
6785
|
var f = void 0;
|
|
6778
|
-
f = message.
|
|
6786
|
+
f = message.getInputVariable();
|
|
6779
6787
|
if (f.length > 0) {
|
|
6780
6788
|
writer.writeString(
|
|
6781
6789
|
1,
|
|
@@ -6803,14 +6811,21 @@ var require_avs_pb = __commonJS({
|
|
|
6803
6811
|
f
|
|
6804
6812
|
);
|
|
6805
6813
|
}
|
|
6814
|
+
f = message.getIterationTimeout();
|
|
6815
|
+
if (f !== 0) {
|
|
6816
|
+
writer.writeUint32(
|
|
6817
|
+
5,
|
|
6818
|
+
f
|
|
6819
|
+
);
|
|
6820
|
+
}
|
|
6806
6821
|
};
|
|
6807
|
-
proto.aggregator.LoopNode.Config.prototype.
|
|
6822
|
+
proto.aggregator.LoopNode.Config.prototype.getInputVariable = function() {
|
|
6808
6823
|
return (
|
|
6809
6824
|
/** @type {string} */
|
|
6810
6825
|
jspb.Message.getFieldWithDefault(this, 1, "")
|
|
6811
6826
|
);
|
|
6812
6827
|
};
|
|
6813
|
-
proto.aggregator.LoopNode.Config.prototype.
|
|
6828
|
+
proto.aggregator.LoopNode.Config.prototype.setInputVariable = function(value) {
|
|
6814
6829
|
return jspb.Message.setProto3StringField(this, 1, value);
|
|
6815
6830
|
};
|
|
6816
6831
|
proto.aggregator.LoopNode.Config.prototype.getIterVal = function() {
|
|
@@ -6840,6 +6855,15 @@ var require_avs_pb = __commonJS({
|
|
|
6840
6855
|
proto.aggregator.LoopNode.Config.prototype.setExecutionMode = function(value) {
|
|
6841
6856
|
return jspb.Message.setProto3EnumField(this, 4, value);
|
|
6842
6857
|
};
|
|
6858
|
+
proto.aggregator.LoopNode.Config.prototype.getIterationTimeout = function() {
|
|
6859
|
+
return (
|
|
6860
|
+
/** @type {number} */
|
|
6861
|
+
jspb.Message.getFieldWithDefault(this, 5, 0)
|
|
6862
|
+
);
|
|
6863
|
+
};
|
|
6864
|
+
proto.aggregator.LoopNode.Config.prototype.setIterationTimeout = function(value) {
|
|
6865
|
+
return jspb.Message.setProto3IntField(this, 5, value);
|
|
6866
|
+
};
|
|
6843
6867
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
6844
6868
|
proto.aggregator.LoopNode.Output.prototype.toObject = function(opt_includeInstance) {
|
|
6845
6869
|
return proto.aggregator.LoopNode.Output.toObject(opt_includeInstance, this);
|
|
@@ -20259,7 +20283,7 @@ var FilterNode2 = class _FilterNode extends Node {
|
|
|
20259
20283
|
const node = new avs_pb16.FilterNode();
|
|
20260
20284
|
const config = new avs_pb16.FilterNode.Config();
|
|
20261
20285
|
config.setExpression(this.data.expression);
|
|
20262
|
-
config.
|
|
20286
|
+
config.setInputVariable(this.data.inputVariable || "");
|
|
20263
20287
|
node.setConfig(config);
|
|
20264
20288
|
request.setFilter(node);
|
|
20265
20289
|
return request;
|
|
@@ -20373,11 +20397,12 @@ var LoopNode2 = class _LoopNode extends Node {
|
|
|
20373
20397
|
node.setType(avs_pb17.NodeType.NODE_TYPE_LOOP);
|
|
20374
20398
|
const data = this.data;
|
|
20375
20399
|
const config = new avs_pb17.LoopNode.Config();
|
|
20376
|
-
config.
|
|
20400
|
+
config.setInputVariable(data.inputVariable || "");
|
|
20377
20401
|
config.setIterVal(data.iterVal || "");
|
|
20378
20402
|
config.setIterKey(data.iterKey || "");
|
|
20379
20403
|
const executionMode = this.mapExecutionModeToProtobuf(data.executionMode);
|
|
20380
20404
|
config.setExecutionMode(executionMode);
|
|
20405
|
+
config.setIterationTimeout(data.iterationTimeout);
|
|
20381
20406
|
loopNode.setConfig(config);
|
|
20382
20407
|
if (data.runner) {
|
|
20383
20408
|
this.setRunnerOnProtobuf(loopNode, data.runner);
|
|
@@ -20436,6 +20461,7 @@ var LoopNode2 = class _LoopNode extends Node {
|
|
|
20436
20461
|
loopNode.setContractRead(contractRead);
|
|
20437
20462
|
break;
|
|
20438
20463
|
}
|
|
20464
|
+
case "graphqlQuery":
|
|
20439
20465
|
case "graphqlDataQuery": {
|
|
20440
20466
|
const gqlConfig = config;
|
|
20441
20467
|
const graphqlQuery = graphqlQuery_default.createProtobufNode({
|
|
@@ -20686,7 +20712,11 @@ var Workflow = class _Workflow {
|
|
|
20686
20712
|
if (!props.trigger) {
|
|
20687
20713
|
throw new Error("Trigger is undefined in new Workflow()");
|
|
20688
20714
|
}
|
|
20715
|
+
if (!props.name) {
|
|
20716
|
+
throw new Error("name is required in new Workflow()");
|
|
20717
|
+
}
|
|
20689
20718
|
this.smartWalletAddress = props.smartWalletAddress;
|
|
20719
|
+
this.name = props.name;
|
|
20690
20720
|
this.trigger = props.trigger;
|
|
20691
20721
|
this.nodes = props.nodes;
|
|
20692
20722
|
this.edges = props.edges;
|
|
@@ -20696,7 +20726,6 @@ var Workflow = class _Workflow {
|
|
|
20696
20726
|
this.executionCount = props.executionCount;
|
|
20697
20727
|
this.id = props.id;
|
|
20698
20728
|
this.owner = props.owner;
|
|
20699
|
-
this.name = props.name;
|
|
20700
20729
|
this.status = props.status;
|
|
20701
20730
|
this.completedAt = props.completedAt;
|
|
20702
20731
|
this.lastRanAt = props.lastRanAt;
|
|
@@ -20779,7 +20808,6 @@ var Workflow = class _Workflow {
|
|
|
20779
20808
|
}
|
|
20780
20809
|
toRequest() {
|
|
20781
20810
|
const request = new avs_pb20.CreateTaskReq();
|
|
20782
|
-
request.setSmartWalletAddress(this.smartWalletAddress);
|
|
20783
20811
|
request.setTrigger(this.trigger.toRequest());
|
|
20784
20812
|
try {
|
|
20785
20813
|
import_lodash3.default.map(this.nodes, (node, index) => {
|
|
@@ -20814,14 +20842,25 @@ var Workflow = class _Workflow {
|
|
|
20814
20842
|
request.setStartAt(this.startAt);
|
|
20815
20843
|
request.setExpiredAt(this.expiredAt);
|
|
20816
20844
|
request.setMaxExecution(this.maxExecution);
|
|
20817
|
-
if (this.
|
|
20818
|
-
|
|
20845
|
+
if (!this.inputVariables?.settings) {
|
|
20846
|
+
throw new Error(
|
|
20847
|
+
"inputVariables.settings is required. Must include at least { name, runner }."
|
|
20848
|
+
);
|
|
20819
20849
|
}
|
|
20820
|
-
|
|
20821
|
-
|
|
20822
|
-
|
|
20823
|
-
|
|
20824
|
-
|
|
20850
|
+
const settings = this.inputVariables.settings;
|
|
20851
|
+
if (!settings.name || typeof settings.name !== "string" || !settings.name.trim()) {
|
|
20852
|
+
throw new Error(
|
|
20853
|
+
"inputVariables.settings.name is required and must be a non-empty string."
|
|
20854
|
+
);
|
|
20855
|
+
}
|
|
20856
|
+
if (!settings.runner || typeof settings.runner !== "string" || !settings.runner.trim()) {
|
|
20857
|
+
throw new Error(
|
|
20858
|
+
"inputVariables.settings.runner is required and must be a non-empty string (smart wallet address)."
|
|
20859
|
+
);
|
|
20860
|
+
}
|
|
20861
|
+
const inputVarsMap = request.getInputVariablesMap();
|
|
20862
|
+
for (const [key, value] of Object.entries(this.inputVariables)) {
|
|
20863
|
+
inputVarsMap.set(key, convertJSValueToProtobuf(value));
|
|
20825
20864
|
}
|
|
20826
20865
|
return request;
|
|
20827
20866
|
}
|
|
@@ -22126,7 +22165,7 @@ var Client = class extends BaseClient {
|
|
|
22126
22165
|
* @param {RequestOptions} options - Request options
|
|
22127
22166
|
* @returns {Promise<ExecutionProps>} - The response from simulating the task
|
|
22128
22167
|
*/
|
|
22129
|
-
async simulateWorkflow({ trigger, nodes, edges, inputVariables
|
|
22168
|
+
async simulateWorkflow({ trigger, nodes, edges, inputVariables }, options) {
|
|
22130
22169
|
const request = new avs_pb24.SimulateTaskReq();
|
|
22131
22170
|
const triggerSdk = factory_default.create(trigger);
|
|
22132
22171
|
request.setTrigger(triggerSdk.toRequest());
|
package/dist/index.mjs
CHANGED
|
@@ -6385,7 +6385,7 @@ var require_avs_pb = __commonJS({
|
|
|
6385
6385
|
proto.aggregator.FilterNode.Config.toObject = function(includeInstance, msg) {
|
|
6386
6386
|
var f, obj = {
|
|
6387
6387
|
expression: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
|
6388
|
-
|
|
6388
|
+
inputVariable: jspb.Message.getFieldWithDefault(msg, 2, "")
|
|
6389
6389
|
};
|
|
6390
6390
|
if (includeInstance) {
|
|
6391
6391
|
obj.$jspbMessageInstance = msg;
|
|
@@ -6417,7 +6417,7 @@ var require_avs_pb = __commonJS({
|
|
|
6417
6417
|
/** @type {string} */
|
|
6418
6418
|
reader.readString()
|
|
6419
6419
|
);
|
|
6420
|
-
msg.
|
|
6420
|
+
msg.setInputVariable(value);
|
|
6421
6421
|
break;
|
|
6422
6422
|
default:
|
|
6423
6423
|
reader.skipField();
|
|
@@ -6440,7 +6440,7 @@ var require_avs_pb = __commonJS({
|
|
|
6440
6440
|
f
|
|
6441
6441
|
);
|
|
6442
6442
|
}
|
|
6443
|
-
f = message.
|
|
6443
|
+
f = message.getInputVariable();
|
|
6444
6444
|
if (f.length > 0) {
|
|
6445
6445
|
writer.writeString(
|
|
6446
6446
|
2,
|
|
@@ -6457,13 +6457,13 @@ var require_avs_pb = __commonJS({
|
|
|
6457
6457
|
proto.aggregator.FilterNode.Config.prototype.setExpression = function(value) {
|
|
6458
6458
|
return jspb.Message.setProto3StringField(this, 1, value);
|
|
6459
6459
|
};
|
|
6460
|
-
proto.aggregator.FilterNode.Config.prototype.
|
|
6460
|
+
proto.aggregator.FilterNode.Config.prototype.getInputVariable = function() {
|
|
6461
6461
|
return (
|
|
6462
6462
|
/** @type {string} */
|
|
6463
6463
|
jspb.Message.getFieldWithDefault(this, 2, "")
|
|
6464
6464
|
);
|
|
6465
6465
|
};
|
|
6466
|
-
proto.aggregator.FilterNode.Config.prototype.
|
|
6466
|
+
proto.aggregator.FilterNode.Config.prototype.setInputVariable = function(value) {
|
|
6467
6467
|
return jspb.Message.setProto3StringField(this, 2, value);
|
|
6468
6468
|
};
|
|
6469
6469
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
@@ -6710,10 +6710,11 @@ var require_avs_pb = __commonJS({
|
|
|
6710
6710
|
};
|
|
6711
6711
|
proto.aggregator.LoopNode.Config.toObject = function(includeInstance, msg) {
|
|
6712
6712
|
var f, obj = {
|
|
6713
|
-
|
|
6713
|
+
inputVariable: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
|
6714
6714
|
iterVal: jspb.Message.getFieldWithDefault(msg, 2, ""),
|
|
6715
6715
|
iterKey: jspb.Message.getFieldWithDefault(msg, 3, ""),
|
|
6716
|
-
executionMode: jspb.Message.getFieldWithDefault(msg, 4, 0)
|
|
6716
|
+
executionMode: jspb.Message.getFieldWithDefault(msg, 4, 0),
|
|
6717
|
+
iterationTimeout: jspb.Message.getFieldWithDefault(msg, 5, 0)
|
|
6717
6718
|
};
|
|
6718
6719
|
if (includeInstance) {
|
|
6719
6720
|
obj.$jspbMessageInstance = msg;
|
|
@@ -6738,7 +6739,7 @@ var require_avs_pb = __commonJS({
|
|
|
6738
6739
|
/** @type {string} */
|
|
6739
6740
|
reader.readString()
|
|
6740
6741
|
);
|
|
6741
|
-
msg.
|
|
6742
|
+
msg.setInputVariable(value);
|
|
6742
6743
|
break;
|
|
6743
6744
|
case 2:
|
|
6744
6745
|
var value = (
|
|
@@ -6761,6 +6762,13 @@ var require_avs_pb = __commonJS({
|
|
|
6761
6762
|
);
|
|
6762
6763
|
msg.setExecutionMode(value);
|
|
6763
6764
|
break;
|
|
6765
|
+
case 5:
|
|
6766
|
+
var value = (
|
|
6767
|
+
/** @type {number} */
|
|
6768
|
+
reader.readUint32()
|
|
6769
|
+
);
|
|
6770
|
+
msg.setIterationTimeout(value);
|
|
6771
|
+
break;
|
|
6764
6772
|
default:
|
|
6765
6773
|
reader.skipField();
|
|
6766
6774
|
break;
|
|
@@ -6775,7 +6783,7 @@ var require_avs_pb = __commonJS({
|
|
|
6775
6783
|
};
|
|
6776
6784
|
proto.aggregator.LoopNode.Config.serializeBinaryToWriter = function(message, writer) {
|
|
6777
6785
|
var f = void 0;
|
|
6778
|
-
f = message.
|
|
6786
|
+
f = message.getInputVariable();
|
|
6779
6787
|
if (f.length > 0) {
|
|
6780
6788
|
writer.writeString(
|
|
6781
6789
|
1,
|
|
@@ -6803,14 +6811,21 @@ var require_avs_pb = __commonJS({
|
|
|
6803
6811
|
f
|
|
6804
6812
|
);
|
|
6805
6813
|
}
|
|
6814
|
+
f = message.getIterationTimeout();
|
|
6815
|
+
if (f !== 0) {
|
|
6816
|
+
writer.writeUint32(
|
|
6817
|
+
5,
|
|
6818
|
+
f
|
|
6819
|
+
);
|
|
6820
|
+
}
|
|
6806
6821
|
};
|
|
6807
|
-
proto.aggregator.LoopNode.Config.prototype.
|
|
6822
|
+
proto.aggregator.LoopNode.Config.prototype.getInputVariable = function() {
|
|
6808
6823
|
return (
|
|
6809
6824
|
/** @type {string} */
|
|
6810
6825
|
jspb.Message.getFieldWithDefault(this, 1, "")
|
|
6811
6826
|
);
|
|
6812
6827
|
};
|
|
6813
|
-
proto.aggregator.LoopNode.Config.prototype.
|
|
6828
|
+
proto.aggregator.LoopNode.Config.prototype.setInputVariable = function(value) {
|
|
6814
6829
|
return jspb.Message.setProto3StringField(this, 1, value);
|
|
6815
6830
|
};
|
|
6816
6831
|
proto.aggregator.LoopNode.Config.prototype.getIterVal = function() {
|
|
@@ -6840,6 +6855,15 @@ var require_avs_pb = __commonJS({
|
|
|
6840
6855
|
proto.aggregator.LoopNode.Config.prototype.setExecutionMode = function(value) {
|
|
6841
6856
|
return jspb.Message.setProto3EnumField(this, 4, value);
|
|
6842
6857
|
};
|
|
6858
|
+
proto.aggregator.LoopNode.Config.prototype.getIterationTimeout = function() {
|
|
6859
|
+
return (
|
|
6860
|
+
/** @type {number} */
|
|
6861
|
+
jspb.Message.getFieldWithDefault(this, 5, 0)
|
|
6862
|
+
);
|
|
6863
|
+
};
|
|
6864
|
+
proto.aggregator.LoopNode.Config.prototype.setIterationTimeout = function(value) {
|
|
6865
|
+
return jspb.Message.setProto3IntField(this, 5, value);
|
|
6866
|
+
};
|
|
6843
6867
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
6844
6868
|
proto.aggregator.LoopNode.Output.prototype.toObject = function(opt_includeInstance) {
|
|
6845
6869
|
return proto.aggregator.LoopNode.Output.toObject(opt_includeInstance, this);
|
|
@@ -19686,7 +19710,10 @@ import _2 from "lodash";
|
|
|
19686
19710
|
|
|
19687
19711
|
// src/models/node/interface.ts
|
|
19688
19712
|
var avs_pb8 = __toESM(require_avs_pb());
|
|
19689
|
-
import {
|
|
19713
|
+
import {
|
|
19714
|
+
NodeType as NodeType2,
|
|
19715
|
+
NodeTypeGoConverter
|
|
19716
|
+
} from "@avaprotocol/types";
|
|
19690
19717
|
import _ from "lodash";
|
|
19691
19718
|
var Node = class {
|
|
19692
19719
|
constructor(props) {
|
|
@@ -20263,7 +20290,7 @@ var FilterNode2 = class _FilterNode extends Node {
|
|
|
20263
20290
|
const node = new avs_pb16.FilterNode();
|
|
20264
20291
|
const config = new avs_pb16.FilterNode.Config();
|
|
20265
20292
|
config.setExpression(this.data.expression);
|
|
20266
|
-
config.
|
|
20293
|
+
config.setInputVariable(this.data.inputVariable || "");
|
|
20267
20294
|
node.setConfig(config);
|
|
20268
20295
|
request.setFilter(node);
|
|
20269
20296
|
return request;
|
|
@@ -20380,11 +20407,12 @@ var LoopNode2 = class _LoopNode extends Node {
|
|
|
20380
20407
|
node.setType(avs_pb17.NodeType.NODE_TYPE_LOOP);
|
|
20381
20408
|
const data = this.data;
|
|
20382
20409
|
const config = new avs_pb17.LoopNode.Config();
|
|
20383
|
-
config.
|
|
20410
|
+
config.setInputVariable(data.inputVariable || "");
|
|
20384
20411
|
config.setIterVal(data.iterVal || "");
|
|
20385
20412
|
config.setIterKey(data.iterKey || "");
|
|
20386
20413
|
const executionMode = this.mapExecutionModeToProtobuf(data.executionMode);
|
|
20387
20414
|
config.setExecutionMode(executionMode);
|
|
20415
|
+
config.setIterationTimeout(data.iterationTimeout);
|
|
20388
20416
|
loopNode.setConfig(config);
|
|
20389
20417
|
if (data.runner) {
|
|
20390
20418
|
this.setRunnerOnProtobuf(loopNode, data.runner);
|
|
@@ -20443,6 +20471,7 @@ var LoopNode2 = class _LoopNode extends Node {
|
|
|
20443
20471
|
loopNode.setContractRead(contractRead);
|
|
20444
20472
|
break;
|
|
20445
20473
|
}
|
|
20474
|
+
case "graphqlQuery":
|
|
20446
20475
|
case "graphqlDataQuery": {
|
|
20447
20476
|
const gqlConfig = config;
|
|
20448
20477
|
const graphqlQuery = graphqlQuery_default.createProtobufNode({
|
|
@@ -20697,7 +20726,11 @@ var Workflow = class _Workflow {
|
|
|
20697
20726
|
if (!props.trigger) {
|
|
20698
20727
|
throw new Error("Trigger is undefined in new Workflow()");
|
|
20699
20728
|
}
|
|
20729
|
+
if (!props.name) {
|
|
20730
|
+
throw new Error("name is required in new Workflow()");
|
|
20731
|
+
}
|
|
20700
20732
|
this.smartWalletAddress = props.smartWalletAddress;
|
|
20733
|
+
this.name = props.name;
|
|
20701
20734
|
this.trigger = props.trigger;
|
|
20702
20735
|
this.nodes = props.nodes;
|
|
20703
20736
|
this.edges = props.edges;
|
|
@@ -20707,7 +20740,6 @@ var Workflow = class _Workflow {
|
|
|
20707
20740
|
this.executionCount = props.executionCount;
|
|
20708
20741
|
this.id = props.id;
|
|
20709
20742
|
this.owner = props.owner;
|
|
20710
|
-
this.name = props.name;
|
|
20711
20743
|
this.status = props.status;
|
|
20712
20744
|
this.completedAt = props.completedAt;
|
|
20713
20745
|
this.lastRanAt = props.lastRanAt;
|
|
@@ -20790,7 +20822,6 @@ var Workflow = class _Workflow {
|
|
|
20790
20822
|
}
|
|
20791
20823
|
toRequest() {
|
|
20792
20824
|
const request = new avs_pb20.CreateTaskReq();
|
|
20793
|
-
request.setSmartWalletAddress(this.smartWalletAddress);
|
|
20794
20825
|
request.setTrigger(this.trigger.toRequest());
|
|
20795
20826
|
try {
|
|
20796
20827
|
_3.map(this.nodes, (node, index) => {
|
|
@@ -20825,14 +20856,25 @@ var Workflow = class _Workflow {
|
|
|
20825
20856
|
request.setStartAt(this.startAt);
|
|
20826
20857
|
request.setExpiredAt(this.expiredAt);
|
|
20827
20858
|
request.setMaxExecution(this.maxExecution);
|
|
20828
|
-
if (this.
|
|
20829
|
-
|
|
20859
|
+
if (!this.inputVariables?.settings) {
|
|
20860
|
+
throw new Error(
|
|
20861
|
+
"inputVariables.settings is required. Must include at least { name, runner }."
|
|
20862
|
+
);
|
|
20830
20863
|
}
|
|
20831
|
-
|
|
20832
|
-
|
|
20833
|
-
|
|
20834
|
-
|
|
20835
|
-
|
|
20864
|
+
const settings = this.inputVariables.settings;
|
|
20865
|
+
if (!settings.name || typeof settings.name !== "string" || !settings.name.trim()) {
|
|
20866
|
+
throw new Error(
|
|
20867
|
+
"inputVariables.settings.name is required and must be a non-empty string."
|
|
20868
|
+
);
|
|
20869
|
+
}
|
|
20870
|
+
if (!settings.runner || typeof settings.runner !== "string" || !settings.runner.trim()) {
|
|
20871
|
+
throw new Error(
|
|
20872
|
+
"inputVariables.settings.runner is required and must be a non-empty string (smart wallet address)."
|
|
20873
|
+
);
|
|
20874
|
+
}
|
|
20875
|
+
const inputVarsMap = request.getInputVariablesMap();
|
|
20876
|
+
for (const [key, value] of Object.entries(this.inputVariables)) {
|
|
20877
|
+
inputVarsMap.set(key, convertJSValueToProtobuf(value));
|
|
20836
20878
|
}
|
|
20837
20879
|
return request;
|
|
20838
20880
|
}
|
|
@@ -22147,7 +22189,7 @@ var Client = class extends BaseClient {
|
|
|
22147
22189
|
* @param {RequestOptions} options - Request options
|
|
22148
22190
|
* @returns {Promise<ExecutionProps>} - The response from simulating the task
|
|
22149
22191
|
*/
|
|
22150
|
-
async simulateWorkflow({ trigger, nodes, edges, inputVariables
|
|
22192
|
+
async simulateWorkflow({ trigger, nodes, edges, inputVariables }, options) {
|
|
22151
22193
|
const request = new avs_pb24.SimulateTaskReq();
|
|
22152
22194
|
const triggerSdk = factory_default.create(trigger);
|
|
22153
22195
|
request.setTrigger(triggerSdk.toRequest());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edge.d.ts","sourceRoot":"","sources":["../../src/models/edge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"edge.d.ts","sourceRoot":"","sources":["../../src/models/edge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,cAAM,IAAK,YAAW,SAAS;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;gBAEH,IAAI,EAAE,SAAS;IAM3B,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,QAAQ,GAAG,IAAI;IAIhD,SAAS,IAAI,MAAM,CAAC,QAAQ;CAQ7B;AAED,eAAe,IAAI,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Node from "./interface";
|
|
2
2
|
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
3
3
|
import { NodeType, } from "@avaprotocol/types";
|
|
4
|
-
// Required props for constructor: id, name, type and data: { expression,
|
|
4
|
+
// Required props for constructor: id, name, type and data: { expression, inputVariable }
|
|
5
5
|
class FilterNode extends Node {
|
|
6
6
|
constructor(props) {
|
|
7
7
|
super({ ...props, type: NodeType.Filter, data: props.data });
|
|
@@ -23,7 +23,7 @@ class FilterNode extends Node {
|
|
|
23
23
|
const node = new avs_pb.FilterNode();
|
|
24
24
|
const config = new avs_pb.FilterNode.Config();
|
|
25
25
|
config.setExpression(this.data.expression);
|
|
26
|
-
config.
|
|
26
|
+
config.setInputVariable(this.data.inputVariable || "");
|
|
27
27
|
node.setConfig(config);
|
|
28
28
|
request.setFilter(node);
|
|
29
29
|
return request;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../src/models/node/interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../src/models/node/interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EACL,QAAQ,EAER,SAAS,EACT,QAAQ,EACT,MAAM,oBAAoB,CAAC;AAI5B,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,YAAY,GACnC,QAAQ,CAgBV;AAGD,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,MAAM,CAAC,QAAQ,CAAC,QAAQ,EACtB,aAAa,GACb,eAAe,GACf,cAAc,GACd,kBAAkB,GAClB,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,YAAY,CACf,GAAG;IAEF,IAAI,EAAE,GAAG,CAAC;CACX,CAAC;AAGF,eAAO,MAAM,sBAAsB;6BAER,iBAAiB,KAAG,MAAM;qCAMnC,MAAM,aACT,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,KACzC,iBAAiB;CAMrB,CAAC;AAEF,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,IAAK,YAAW,SAAS;IACrD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,QAAQ,CAAC;gBAEH,KAAK,EAAE,SAAS;IAO5B,SAAS,IAAI,MAAM,CAAC,QAAQ;IAW5B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,IAAI;CAQhD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
-
import { NodeType, NodeTypeGoConverter } from "@avaprotocol/types";
|
|
2
|
+
import { NodeType, NodeTypeGoConverter, } from "@avaprotocol/types";
|
|
3
3
|
import _ from "lodash";
|
|
4
4
|
// Function to convert TaskStatus to string
|
|
5
5
|
export function covertNodeTypeToString(status) {
|
|
@@ -28,9 +28,9 @@ export const ProtobufNodePropsUtils = {
|
|
|
28
28
|
fromGoStringType: (goStringType, baseProps) => {
|
|
29
29
|
return {
|
|
30
30
|
...baseProps,
|
|
31
|
-
type: NodeTypeGoConverter.fromGoString(goStringType)
|
|
31
|
+
type: NodeTypeGoConverter.fromGoString(goStringType),
|
|
32
32
|
};
|
|
33
|
-
}
|
|
33
|
+
},
|
|
34
34
|
};
|
|
35
35
|
export default class Node {
|
|
36
36
|
constructor(props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loop.d.ts","sourceRoot":"","sources":["../../../src/models/node/loop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,IAAI,MAAM,aAAa,CAAC;AAO/B,OAAO,EAGL,aAAa,EAKd,MAAM,oBAAoB,CAAC;AAG5B,cAAM,QAAS,SAAQ,IAAI;gBACb,KAAK,EAAE,aAAa;IAIhC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,QAAQ;
|
|
1
|
+
{"version":3,"file":"loop.d.ts","sourceRoot":"","sources":["../../../src/models/node/loop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,IAAI,MAAM,aAAa,CAAC;AAO/B,OAAO,EAGL,aAAa,EAKd,MAAM,oBAAoB,CAAC;AAG5B,cAAM,QAAS,SAAQ,IAAI;gBACb,KAAK,EAAE,aAAa;IAIhC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,QAAQ;IA4BnD,OAAO,CAAC,MAAM,CAAC,yBAAyB;IAsBxC,OAAO,CAAC,MAAM,CAAC,4BAA4B;IAe3C,OAAO,CAAC,0BAA0B;IA4BlC,SAAS,IAAI,MAAM,CAAC,QAAQ;IAoC5B,OAAO,CAAC,mBAAmB;IAuH3B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,OAAO;CAkCzE;AAED,eAAe,QAAQ,CAAC"}
|
package/dist/models/node/loop.js
CHANGED
|
@@ -21,8 +21,6 @@ class LoopNode extends Node {
|
|
|
21
21
|
// Get the config data directly as flat structure
|
|
22
22
|
const configData = loopNode.getConfig()?.toObject();
|
|
23
23
|
const loopNodeData = loopNode.toObject();
|
|
24
|
-
// Since LoopNodeData is now Config.AsObject, we need to merge the config properties
|
|
25
|
-
// with the runner data from the protobuf structure
|
|
26
24
|
const data = {
|
|
27
25
|
...configData,
|
|
28
26
|
// Extract runner data from the oneof runner field
|
|
@@ -100,12 +98,16 @@ class LoopNode extends Node {
|
|
|
100
98
|
const data = this.data;
|
|
101
99
|
// Set the loop config from the flat data structure
|
|
102
100
|
const config = new avs_pb.LoopNode.Config();
|
|
103
|
-
config.
|
|
101
|
+
config.setInputVariable(data.inputVariable || "");
|
|
104
102
|
config.setIterVal(data.iterVal || "");
|
|
105
103
|
config.setIterKey(data.iterKey || "");
|
|
106
104
|
// Set execution mode - map ExecutionMode enum to protobuf enum
|
|
107
105
|
const executionMode = this.mapExecutionModeToProtobuf(data.executionMode);
|
|
108
106
|
config.setExecutionMode(executionMode);
|
|
107
|
+
// Per-iteration timeout in seconds. The server requires this field and will
|
|
108
|
+
// reject the request if it is 0 or missing. No default is applied here —
|
|
109
|
+
// the caller must explicitly provide iterationTimeout in their node config.
|
|
110
|
+
config.setIterationTimeout(data.iterationTimeout);
|
|
109
111
|
loopNode.setConfig(config);
|
|
110
112
|
// Handle runner - check the runner field and set the appropriate oneof field
|
|
111
113
|
if (data.runner) {
|
|
@@ -167,6 +169,7 @@ class LoopNode extends Node {
|
|
|
167
169
|
loopNode.setContractRead(contractRead);
|
|
168
170
|
break;
|
|
169
171
|
}
|
|
172
|
+
case "graphqlQuery":
|
|
170
173
|
case "graphqlDataQuery": {
|
|
171
174
|
const gqlConfig = config;
|
|
172
175
|
const graphqlQuery = GraphQLQueryNode.createProtobufNode({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/event.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAEhD,OAAO,OAAO,MAAM,aAAa,CAAC;AAClC,OAAO,EAGL,kBAAkB,EAClB,iBAAiB,EAIlB,MAAM,oBAAoB,CAAC;AA0C5B,cAAM,YAAa,SAAQ,OAAO;gBACpB,KAAK,EAAE,iBAAiB;IAIpC,SAAS,IAAI,MAAM,CAAC,WAAW;IAqH/B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,GAAG,YAAY;IA0F1D;;;;OAIG;IACH,SAAS,IAAI,kBAAkB,GAAG,SAAS;IAI3C;;;;OAIG;IACH,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,cAAc,GAAG,GAAG;CA0B9D;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -13,9 +13,9 @@ declare class Workflow implements WorkflowProps {
|
|
|
13
13
|
startAt: number;
|
|
14
14
|
expiredAt: number;
|
|
15
15
|
maxExecution: number;
|
|
16
|
+
name: string;
|
|
16
17
|
id?: string;
|
|
17
18
|
owner?: string;
|
|
18
|
-
name?: string;
|
|
19
19
|
completedAt?: number;
|
|
20
20
|
status?: WorkflowStatus;
|
|
21
21
|
lastRanAt?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/models/workflow.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,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,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAInF,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,CAAC,UAAU,GACxB,cAAc,CAgBhB;AAED,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,
|
|
1
|
+
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/models/workflow.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,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,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAInF,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,CAAC,UAAU,GACxB,cAAc,CAgBhB;AAED,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,IAAI,EAAE,MAAM,CAAC;IAGb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,cAAc,CAAC;IAEhC;;;OAGG;gBACS,KAAK,EAAE,aAAa;IA2BhC;;;;OAIG;IACH,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,GAAG,QAAQ;IA4C/C;;;OAGG;IACH,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,GAAG,QAAQ;IAmCnD,SAAS,IAAI,MAAM,CAAC,aAAa;IAsEjC;;;OAGG;IACH,MAAM,IAAI,aAAa;CAmBxB;AAED,eAAe,QAAQ,CAAC"}
|
package/dist/models/workflow.js
CHANGED
|
@@ -33,7 +33,11 @@ class Workflow {
|
|
|
33
33
|
if (!props.trigger) {
|
|
34
34
|
throw new Error("Trigger is undefined in new Workflow()");
|
|
35
35
|
}
|
|
36
|
+
if (!props.name) {
|
|
37
|
+
throw new Error("name is required in new Workflow()");
|
|
38
|
+
}
|
|
36
39
|
this.smartWalletAddress = props.smartWalletAddress;
|
|
40
|
+
this.name = props.name;
|
|
37
41
|
this.trigger = props.trigger;
|
|
38
42
|
this.nodes = props.nodes;
|
|
39
43
|
this.edges = props.edges;
|
|
@@ -44,7 +48,6 @@ class Workflow {
|
|
|
44
48
|
// Optional fields
|
|
45
49
|
this.id = props.id;
|
|
46
50
|
this.owner = props.owner;
|
|
47
|
-
this.name = props.name;
|
|
48
51
|
this.status = props.status;
|
|
49
52
|
this.completedAt = props.completedAt;
|
|
50
53
|
this.lastRanAt = props.lastRanAt;
|
|
@@ -126,8 +129,6 @@ class Workflow {
|
|
|
126
129
|
}
|
|
127
130
|
toRequest() {
|
|
128
131
|
const request = new avs_pb.CreateTaskReq();
|
|
129
|
-
// TODO: add client side validation for each field
|
|
130
|
-
request.setSmartWalletAddress(this.smartWalletAddress);
|
|
131
132
|
request.setTrigger(this.trigger.toRequest());
|
|
132
133
|
// Add error handling for node serialization
|
|
133
134
|
try {
|
|
@@ -168,16 +169,21 @@ class Workflow {
|
|
|
168
169
|
request.setStartAt(this.startAt);
|
|
169
170
|
request.setExpiredAt(this.expiredAt);
|
|
170
171
|
request.setMaxExecution(this.maxExecution);
|
|
171
|
-
//
|
|
172
|
-
|
|
173
|
-
|
|
172
|
+
// Validate inputVariables.settings before sending to aggregator.
|
|
173
|
+
// The aggregator requires settings.name and settings.runner.
|
|
174
|
+
if (!this.inputVariables?.settings) {
|
|
175
|
+
throw new Error("inputVariables.settings is required. Must include at least { name, runner }.");
|
|
176
|
+
}
|
|
177
|
+
const settings = this.inputVariables.settings;
|
|
178
|
+
if (!settings.name || typeof settings.name !== "string" || !settings.name.trim()) {
|
|
179
|
+
throw new Error("inputVariables.settings.name is required and must be a non-empty string.");
|
|
180
|
+
}
|
|
181
|
+
if (!settings.runner || typeof settings.runner !== "string" || !settings.runner.trim()) {
|
|
182
|
+
throw new Error("inputVariables.settings.runner is required and must be a non-empty string (smart wallet address).");
|
|
174
183
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
for (const [key, value] of Object.entries(this.inputVariables)) {
|
|
179
|
-
inputVarsMap.set(key, convertJSValueToProtobuf(value));
|
|
180
|
-
}
|
|
184
|
+
const inputVarsMap = request.getInputVariablesMap();
|
|
185
|
+
for (const [key, value] of Object.entries(this.inputVariables)) {
|
|
186
|
+
inputVarsMap.set(key, convertJSValueToProtobuf(value));
|
|
181
187
|
}
|
|
182
188
|
return request;
|
|
183
189
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avaprotocol/sdk-js",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.14.0",
|
|
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",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"prepare": "node ../../scripts/prepare-package.js"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@avaprotocol/types": "2.
|
|
34
|
+
"@avaprotocol/types": "2.10.0",
|
|
35
35
|
"@grpc/grpc-js": "^1.11.3",
|
|
36
36
|
"@grpc/proto-loader": "^0.7.13",
|
|
37
37
|
"dotenv": "^16.4.5",
|