@avaprotocol/sdk-js 2.6.4 → 2.6.5
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 +8 -0
- package/dist/index.d.ts +4 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +248 -14
- package/dist/index.mjs +248 -14
- package/dist/models/node/contractWrite.d.ts.map +1 -1
- package/dist/models/node/contractWrite.js +2 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Metadata } from "@grpc/grpc-js";
|
|
2
2
|
import { AggregatorClient } from "@/grpc_codegen/avs_grpc_pb";
|
|
3
|
-
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
4
3
|
import Workflow from "./models/workflow";
|
|
5
4
|
import Edge from "./models/edge";
|
|
6
5
|
import Execution from "./models/execution";
|
|
@@ -8,7 +7,7 @@ import Step from "./models/step";
|
|
|
8
7
|
import NodeFactory from "./models/node/factory";
|
|
9
8
|
import TriggerFactory from "./models/trigger/factory";
|
|
10
9
|
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 ExecutionProps, type GetTokenMetadataRequest, type GetTokenMetadataResponse, type TimeoutConfig, type CreateSecretResponse, type UpdateSecretResponse, type DeleteSecretResponse, type CancelTaskResponse, type DeleteTaskResponse, type GetExecutionStatsResponse, type GetExecutionStatsOptions, ExecutionStatus } from "@avaprotocol/types";
|
|
10
|
+
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, type TimeoutConfig, type CreateSecretResponse, type UpdateSecretResponse, type DeleteSecretResponse, type CancelTaskResponse, type DeleteTaskResponse, type GetExecutionStatsResponse, type GetExecutionStatsOptions, ExecutionStatus, type TriggerWorkflowResponse } from "@avaprotocol/types";
|
|
12
11
|
import { cleanGrpcErrorMessage } from "./utils";
|
|
13
12
|
declare class BaseClient {
|
|
14
13
|
readonly endpoint: string;
|
|
@@ -226,19 +225,19 @@ declare class Client extends BaseClient {
|
|
|
226
225
|
*/
|
|
227
226
|
getWorkflow(id: string, options?: RequestOptions): Promise<Workflow>;
|
|
228
227
|
/**
|
|
229
|
-
* Trigger a workflow with
|
|
228
|
+
* Trigger a workflow with enhanced response including workflowId and optional execution details
|
|
230
229
|
* @param {Object} params - The trigger parameters
|
|
231
230
|
* @param {string} params.id - The workflow id
|
|
232
231
|
* @param {TriggerDataProps} params.triggerData - The trigger data
|
|
233
232
|
* @param {boolean} params.isBlocking - Whether to block until execution completes
|
|
234
233
|
* @param {RequestOptions} options - Request options
|
|
235
|
-
* @returns {Promise<
|
|
234
|
+
* @returns {Promise<TriggerWorkflowResponse>} - Enhanced response with workflowId and execution details
|
|
236
235
|
*/
|
|
237
236
|
triggerWorkflow({ id, triggerData, isBlocking, }: {
|
|
238
237
|
id: string;
|
|
239
238
|
triggerData: TriggerDataProps;
|
|
240
239
|
isBlocking?: boolean;
|
|
241
|
-
}, options?: RequestOptions): Promise<
|
|
240
|
+
}, options?: RequestOptions): Promise<TriggerWorkflowResponse>;
|
|
242
241
|
/**
|
|
243
242
|
* Cancel a workflow
|
|
244
243
|
* @param {string} id - The workflow id
|
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;
|
|
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;AAE9D,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,cAAc,EACnB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAE7B,KAAK,aAAa,EAIlB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,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ACrB,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAmB,EAAE,EAAE,wBAAwB,EACvE,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,yBAAyB,CAAC;IAuDrC;;;;;;;OAOG;IACG,UAAU,CACd,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,iBAAiB,EACjD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,kBAAkB,CAAC;IA0C9B;;;;;;;;;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;CAwBrC;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,qBAAqB,GACtB,CAAC;AAGF,YAAY,EACV,aAAa,EACb,uBAAuB,EACvB,wBAAwB,EACxB,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,cAAc,EACd,KAAK,aAAa,EAClB,KAAK,YAAY,GAClB,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -738,7 +738,7 @@ var require_avs_pb = __commonJS({
|
|
|
738
738
|
proto.aggregator.TriggerTaskReq.displayName = "proto.aggregator.TriggerTaskReq";
|
|
739
739
|
}
|
|
740
740
|
proto.aggregator.TriggerTaskResp = function(opt_data) {
|
|
741
|
-
jspb.Message.initialize(this, opt_data, 0, -1,
|
|
741
|
+
jspb.Message.initialize(this, opt_data, 0, -1, proto.aggregator.TriggerTaskResp.repeatedFields_, null);
|
|
742
742
|
};
|
|
743
743
|
goog.inherits(proto.aggregator.TriggerTaskResp, jspb.Message);
|
|
744
744
|
if (goog.DEBUG && !COMPILED) {
|
|
@@ -10640,6 +10640,7 @@ var require_avs_pb = __commonJS({
|
|
|
10640
10640
|
proto.aggregator.TriggerTaskReq.prototype.setIsBlocking = function(value) {
|
|
10641
10641
|
return jspb.Message.setProto3BooleanField(this, 8, value);
|
|
10642
10642
|
};
|
|
10643
|
+
proto.aggregator.TriggerTaskResp.repeatedFields_ = [8];
|
|
10643
10644
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
10644
10645
|
proto.aggregator.TriggerTaskResp.prototype.toObject = function(opt_includeInstance) {
|
|
10645
10646
|
return proto.aggregator.TriggerTaskResp.toObject(opt_includeInstance, this);
|
|
@@ -10647,7 +10648,17 @@ var require_avs_pb = __commonJS({
|
|
|
10647
10648
|
proto.aggregator.TriggerTaskResp.toObject = function(includeInstance, msg) {
|
|
10648
10649
|
var f, obj = {
|
|
10649
10650
|
executionId: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
|
10650
|
-
status: jspb.Message.getFieldWithDefault(msg, 2, 0)
|
|
10651
|
+
status: jspb.Message.getFieldWithDefault(msg, 2, 0),
|
|
10652
|
+
workflowId: jspb.Message.getFieldWithDefault(msg, 3, ""),
|
|
10653
|
+
startAt: jspb.Message.getFieldWithDefault(msg, 4, 0),
|
|
10654
|
+
endAt: jspb.Message.getFieldWithDefault(msg, 5, 0),
|
|
10655
|
+
success: jspb.Message.getBooleanFieldWithDefault(msg, 6, false),
|
|
10656
|
+
error: jspb.Message.getFieldWithDefault(msg, 7, ""),
|
|
10657
|
+
stepsList: jspb.Message.toObjectList(
|
|
10658
|
+
msg.getStepsList(),
|
|
10659
|
+
proto.aggregator.Execution.Step.toObject,
|
|
10660
|
+
includeInstance
|
|
10661
|
+
)
|
|
10651
10662
|
};
|
|
10652
10663
|
if (includeInstance) {
|
|
10653
10664
|
obj.$jspbMessageInstance = msg;
|
|
@@ -10681,6 +10692,46 @@ var require_avs_pb = __commonJS({
|
|
|
10681
10692
|
);
|
|
10682
10693
|
msg.setStatus(value);
|
|
10683
10694
|
break;
|
|
10695
|
+
case 3:
|
|
10696
|
+
var value = (
|
|
10697
|
+
/** @type {string} */
|
|
10698
|
+
reader.readString()
|
|
10699
|
+
);
|
|
10700
|
+
msg.setWorkflowId(value);
|
|
10701
|
+
break;
|
|
10702
|
+
case 4:
|
|
10703
|
+
var value = (
|
|
10704
|
+
/** @type {number} */
|
|
10705
|
+
reader.readInt64()
|
|
10706
|
+
);
|
|
10707
|
+
msg.setStartAt(value);
|
|
10708
|
+
break;
|
|
10709
|
+
case 5:
|
|
10710
|
+
var value = (
|
|
10711
|
+
/** @type {number} */
|
|
10712
|
+
reader.readInt64()
|
|
10713
|
+
);
|
|
10714
|
+
msg.setEndAt(value);
|
|
10715
|
+
break;
|
|
10716
|
+
case 6:
|
|
10717
|
+
var value = (
|
|
10718
|
+
/** @type {boolean} */
|
|
10719
|
+
reader.readBool()
|
|
10720
|
+
);
|
|
10721
|
+
msg.setSuccess(value);
|
|
10722
|
+
break;
|
|
10723
|
+
case 7:
|
|
10724
|
+
var value = (
|
|
10725
|
+
/** @type {string} */
|
|
10726
|
+
reader.readString()
|
|
10727
|
+
);
|
|
10728
|
+
msg.setError(value);
|
|
10729
|
+
break;
|
|
10730
|
+
case 8:
|
|
10731
|
+
var value = new proto.aggregator.Execution.Step();
|
|
10732
|
+
reader.readMessage(value, proto.aggregator.Execution.Step.deserializeBinaryFromReader);
|
|
10733
|
+
msg.addSteps(value);
|
|
10734
|
+
break;
|
|
10684
10735
|
default:
|
|
10685
10736
|
reader.skipField();
|
|
10686
10737
|
break;
|
|
@@ -10709,6 +10760,53 @@ var require_avs_pb = __commonJS({
|
|
|
10709
10760
|
f
|
|
10710
10761
|
);
|
|
10711
10762
|
}
|
|
10763
|
+
f = message.getWorkflowId();
|
|
10764
|
+
if (f.length > 0) {
|
|
10765
|
+
writer.writeString(
|
|
10766
|
+
3,
|
|
10767
|
+
f
|
|
10768
|
+
);
|
|
10769
|
+
}
|
|
10770
|
+
f = /** @type {number} */
|
|
10771
|
+
jspb.Message.getField(message, 4);
|
|
10772
|
+
if (f != null) {
|
|
10773
|
+
writer.writeInt64(
|
|
10774
|
+
4,
|
|
10775
|
+
f
|
|
10776
|
+
);
|
|
10777
|
+
}
|
|
10778
|
+
f = /** @type {number} */
|
|
10779
|
+
jspb.Message.getField(message, 5);
|
|
10780
|
+
if (f != null) {
|
|
10781
|
+
writer.writeInt64(
|
|
10782
|
+
5,
|
|
10783
|
+
f
|
|
10784
|
+
);
|
|
10785
|
+
}
|
|
10786
|
+
f = /** @type {boolean} */
|
|
10787
|
+
jspb.Message.getField(message, 6);
|
|
10788
|
+
if (f != null) {
|
|
10789
|
+
writer.writeBool(
|
|
10790
|
+
6,
|
|
10791
|
+
f
|
|
10792
|
+
);
|
|
10793
|
+
}
|
|
10794
|
+
f = /** @type {string} */
|
|
10795
|
+
jspb.Message.getField(message, 7);
|
|
10796
|
+
if (f != null) {
|
|
10797
|
+
writer.writeString(
|
|
10798
|
+
7,
|
|
10799
|
+
f
|
|
10800
|
+
);
|
|
10801
|
+
}
|
|
10802
|
+
f = message.getStepsList();
|
|
10803
|
+
if (f.length > 0) {
|
|
10804
|
+
writer.writeRepeatedMessage(
|
|
10805
|
+
8,
|
|
10806
|
+
f,
|
|
10807
|
+
proto.aggregator.Execution.Step.serializeBinaryToWriter
|
|
10808
|
+
);
|
|
10809
|
+
}
|
|
10712
10810
|
};
|
|
10713
10811
|
proto.aggregator.TriggerTaskResp.prototype.getExecutionId = function() {
|
|
10714
10812
|
return (
|
|
@@ -10728,6 +10826,90 @@ var require_avs_pb = __commonJS({
|
|
|
10728
10826
|
proto.aggregator.TriggerTaskResp.prototype.setStatus = function(value) {
|
|
10729
10827
|
return jspb.Message.setProto3EnumField(this, 2, value);
|
|
10730
10828
|
};
|
|
10829
|
+
proto.aggregator.TriggerTaskResp.prototype.getWorkflowId = function() {
|
|
10830
|
+
return (
|
|
10831
|
+
/** @type {string} */
|
|
10832
|
+
jspb.Message.getFieldWithDefault(this, 3, "")
|
|
10833
|
+
);
|
|
10834
|
+
};
|
|
10835
|
+
proto.aggregator.TriggerTaskResp.prototype.setWorkflowId = function(value) {
|
|
10836
|
+
return jspb.Message.setProto3StringField(this, 3, value);
|
|
10837
|
+
};
|
|
10838
|
+
proto.aggregator.TriggerTaskResp.prototype.getStartAt = function() {
|
|
10839
|
+
return (
|
|
10840
|
+
/** @type {number} */
|
|
10841
|
+
jspb.Message.getFieldWithDefault(this, 4, 0)
|
|
10842
|
+
);
|
|
10843
|
+
};
|
|
10844
|
+
proto.aggregator.TriggerTaskResp.prototype.setStartAt = function(value) {
|
|
10845
|
+
return jspb.Message.setField(this, 4, value);
|
|
10846
|
+
};
|
|
10847
|
+
proto.aggregator.TriggerTaskResp.prototype.clearStartAt = function() {
|
|
10848
|
+
return jspb.Message.setField(this, 4, void 0);
|
|
10849
|
+
};
|
|
10850
|
+
proto.aggregator.TriggerTaskResp.prototype.hasStartAt = function() {
|
|
10851
|
+
return jspb.Message.getField(this, 4) != null;
|
|
10852
|
+
};
|
|
10853
|
+
proto.aggregator.TriggerTaskResp.prototype.getEndAt = function() {
|
|
10854
|
+
return (
|
|
10855
|
+
/** @type {number} */
|
|
10856
|
+
jspb.Message.getFieldWithDefault(this, 5, 0)
|
|
10857
|
+
);
|
|
10858
|
+
};
|
|
10859
|
+
proto.aggregator.TriggerTaskResp.prototype.setEndAt = function(value) {
|
|
10860
|
+
return jspb.Message.setField(this, 5, value);
|
|
10861
|
+
};
|
|
10862
|
+
proto.aggregator.TriggerTaskResp.prototype.clearEndAt = function() {
|
|
10863
|
+
return jspb.Message.setField(this, 5, void 0);
|
|
10864
|
+
};
|
|
10865
|
+
proto.aggregator.TriggerTaskResp.prototype.hasEndAt = function() {
|
|
10866
|
+
return jspb.Message.getField(this, 5) != null;
|
|
10867
|
+
};
|
|
10868
|
+
proto.aggregator.TriggerTaskResp.prototype.getSuccess = function() {
|
|
10869
|
+
return (
|
|
10870
|
+
/** @type {boolean} */
|
|
10871
|
+
jspb.Message.getBooleanFieldWithDefault(this, 6, false)
|
|
10872
|
+
);
|
|
10873
|
+
};
|
|
10874
|
+
proto.aggregator.TriggerTaskResp.prototype.setSuccess = function(value) {
|
|
10875
|
+
return jspb.Message.setField(this, 6, value);
|
|
10876
|
+
};
|
|
10877
|
+
proto.aggregator.TriggerTaskResp.prototype.clearSuccess = function() {
|
|
10878
|
+
return jspb.Message.setField(this, 6, void 0);
|
|
10879
|
+
};
|
|
10880
|
+
proto.aggregator.TriggerTaskResp.prototype.hasSuccess = function() {
|
|
10881
|
+
return jspb.Message.getField(this, 6) != null;
|
|
10882
|
+
};
|
|
10883
|
+
proto.aggregator.TriggerTaskResp.prototype.getError = function() {
|
|
10884
|
+
return (
|
|
10885
|
+
/** @type {string} */
|
|
10886
|
+
jspb.Message.getFieldWithDefault(this, 7, "")
|
|
10887
|
+
);
|
|
10888
|
+
};
|
|
10889
|
+
proto.aggregator.TriggerTaskResp.prototype.setError = function(value) {
|
|
10890
|
+
return jspb.Message.setField(this, 7, value);
|
|
10891
|
+
};
|
|
10892
|
+
proto.aggregator.TriggerTaskResp.prototype.clearError = function() {
|
|
10893
|
+
return jspb.Message.setField(this, 7, void 0);
|
|
10894
|
+
};
|
|
10895
|
+
proto.aggregator.TriggerTaskResp.prototype.hasError = function() {
|
|
10896
|
+
return jspb.Message.getField(this, 7) != null;
|
|
10897
|
+
};
|
|
10898
|
+
proto.aggregator.TriggerTaskResp.prototype.getStepsList = function() {
|
|
10899
|
+
return (
|
|
10900
|
+
/** @type{!Array<!proto.aggregator.Execution.Step>} */
|
|
10901
|
+
jspb.Message.getRepeatedWrapperField(this, proto.aggregator.Execution.Step, 8)
|
|
10902
|
+
);
|
|
10903
|
+
};
|
|
10904
|
+
proto.aggregator.TriggerTaskResp.prototype.setStepsList = function(value) {
|
|
10905
|
+
return jspb.Message.setRepeatedWrapperField(this, 8, value);
|
|
10906
|
+
};
|
|
10907
|
+
proto.aggregator.TriggerTaskResp.prototype.addSteps = function(opt_value, opt_index) {
|
|
10908
|
+
return jspb.Message.addToRepeatedWrapperField(this, 8, opt_value, proto.aggregator.Execution.Step, opt_index);
|
|
10909
|
+
};
|
|
10910
|
+
proto.aggregator.TriggerTaskResp.prototype.clearStepsList = function() {
|
|
10911
|
+
return this.setStepsList([]);
|
|
10912
|
+
};
|
|
10731
10913
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
10732
10914
|
proto.aggregator.CreateOrUpdateSecretReq.prototype.toObject = function(opt_includeInstance) {
|
|
10733
10915
|
return proto.aggregator.CreateOrUpdateSecretReq.toObject(opt_includeInstance, this);
|
|
@@ -16256,7 +16438,9 @@ var ContractWriteNode2 = class _ContractWriteNode extends Node {
|
|
|
16256
16438
|
methodABI: result.method_abi || null,
|
|
16257
16439
|
success: result.success,
|
|
16258
16440
|
error: result.error || "",
|
|
16259
|
-
value: result.value
|
|
16441
|
+
value: result.value,
|
|
16442
|
+
receipt: result.receipt || null
|
|
16443
|
+
// Add receipt field
|
|
16260
16444
|
};
|
|
16261
16445
|
});
|
|
16262
16446
|
} else {
|
|
@@ -16266,7 +16450,9 @@ var ContractWriteNode2 = class _ContractWriteNode extends Node {
|
|
|
16266
16450
|
methodABI: jsData.method_abi || null,
|
|
16267
16451
|
success: jsData.success,
|
|
16268
16452
|
error: jsData.error || "",
|
|
16269
|
-
value: jsData.value
|
|
16453
|
+
value: jsData.value,
|
|
16454
|
+
receipt: jsData.receipt || null
|
|
16455
|
+
// Add receipt field
|
|
16270
16456
|
}];
|
|
16271
16457
|
}
|
|
16272
16458
|
}
|
|
@@ -17893,13 +18079,13 @@ var Client = class extends BaseClient {
|
|
|
17893
18079
|
return workflow_default.fromResponse(result);
|
|
17894
18080
|
}
|
|
17895
18081
|
/**
|
|
17896
|
-
* Trigger a workflow with
|
|
18082
|
+
* Trigger a workflow with enhanced response including workflowId and optional execution details
|
|
17897
18083
|
* @param {Object} params - The trigger parameters
|
|
17898
18084
|
* @param {string} params.id - The workflow id
|
|
17899
18085
|
* @param {TriggerDataProps} params.triggerData - The trigger data
|
|
17900
18086
|
* @param {boolean} params.isBlocking - Whether to block until execution completes
|
|
17901
18087
|
* @param {RequestOptions} options - Request options
|
|
17902
|
-
* @returns {Promise<
|
|
18088
|
+
* @returns {Promise<TriggerWorkflowResponse>} - Enhanced response with workflowId and execution details
|
|
17903
18089
|
*/
|
|
17904
18090
|
async triggerWorkflow({
|
|
17905
18091
|
id,
|
|
@@ -17912,10 +18098,11 @@ var Client = class extends BaseClient {
|
|
|
17912
18098
|
request.setIsBlocking(isBlocking);
|
|
17913
18099
|
switch (triggerData.type) {
|
|
17914
18100
|
case import_types20.TriggerType.FixedTime: {
|
|
18101
|
+
const fixedTimeData = triggerData;
|
|
17915
18102
|
const fixedTimeOutput = new avs_pb22.FixedTimeTrigger.Output();
|
|
17916
18103
|
const triggerOutputData = {
|
|
17917
|
-
timestamp:
|
|
17918
|
-
timestampIso:
|
|
18104
|
+
timestamp: fixedTimeData.timestamp,
|
|
18105
|
+
timestampIso: fixedTimeData.timestampIso
|
|
17919
18106
|
};
|
|
17920
18107
|
const dataValue = new google_protobuf_struct_pb4.Value();
|
|
17921
18108
|
dataValue.setStructValue(
|
|
@@ -17926,10 +18113,11 @@ var Client = class extends BaseClient {
|
|
|
17926
18113
|
break;
|
|
17927
18114
|
}
|
|
17928
18115
|
case import_types20.TriggerType.Cron: {
|
|
18116
|
+
const cronData = triggerData;
|
|
17929
18117
|
const cronOutput = new avs_pb22.CronTrigger.Output();
|
|
17930
18118
|
const triggerOutputData = {
|
|
17931
|
-
timestamp:
|
|
17932
|
-
timestampIso:
|
|
18119
|
+
timestamp: cronData.timestamp,
|
|
18120
|
+
timestampIso: cronData.timestampIso
|
|
17933
18121
|
};
|
|
17934
18122
|
const dataValue = new google_protobuf_struct_pb4.Value();
|
|
17935
18123
|
dataValue.setStructValue(
|
|
@@ -17988,10 +18176,56 @@ var Client = class extends BaseClient {
|
|
|
17988
18176
|
}
|
|
17989
18177
|
const result = await this.sendGrpcRequest("triggerTask", request, options);
|
|
17990
18178
|
const responseObject = result.toObject();
|
|
17991
|
-
|
|
17992
|
-
|
|
17993
|
-
status: convertProtobufExecutionStatus(result.getStatus())
|
|
17994
|
-
|
|
18179
|
+
const response = {
|
|
18180
|
+
executionId: responseObject.executionId,
|
|
18181
|
+
status: convertProtobufExecutionStatus(result.getStatus()),
|
|
18182
|
+
workflowId: responseObject.workflowId
|
|
18183
|
+
};
|
|
18184
|
+
if (responseObject.startAt !== void 0) {
|
|
18185
|
+
response.startAt = responseObject.startAt;
|
|
18186
|
+
}
|
|
18187
|
+
if (responseObject.endAt !== void 0) {
|
|
18188
|
+
response.endAt = responseObject.endAt;
|
|
18189
|
+
}
|
|
18190
|
+
if (responseObject.success !== void 0) {
|
|
18191
|
+
response.success = responseObject.success;
|
|
18192
|
+
}
|
|
18193
|
+
if (responseObject.error) {
|
|
18194
|
+
response.error = responseObject.error;
|
|
18195
|
+
}
|
|
18196
|
+
if (responseObject.stepsList && responseObject.stepsList.length > 0) {
|
|
18197
|
+
response.steps = responseObject.stepsList.map((step) => {
|
|
18198
|
+
let output = void 0;
|
|
18199
|
+
if (step.blockTrigger) output = step.blockTrigger;
|
|
18200
|
+
else if (step.fixedTimeTrigger) output = step.fixedTimeTrigger;
|
|
18201
|
+
else if (step.cronTrigger) output = step.cronTrigger;
|
|
18202
|
+
else if (step.eventTrigger) output = step.eventTrigger;
|
|
18203
|
+
else if (step.manualTrigger) output = step.manualTrigger;
|
|
18204
|
+
else if (step.ethTransfer) output = step.ethTransfer;
|
|
18205
|
+
else if (step.graphql) output = step.graphql;
|
|
18206
|
+
else if (step.contractRead) output = step.contractRead;
|
|
18207
|
+
else if (step.contractWrite) output = step.contractWrite;
|
|
18208
|
+
else if (step.customCode) output = step.customCode;
|
|
18209
|
+
else if (step.restApi) output = step.restApi;
|
|
18210
|
+
else if (step.branch) output = step.branch;
|
|
18211
|
+
else if (step.filter) output = step.filter;
|
|
18212
|
+
else if (step.loop) output = step.loop;
|
|
18213
|
+
return {
|
|
18214
|
+
id: step.id,
|
|
18215
|
+
type: step.type,
|
|
18216
|
+
name: step.name,
|
|
18217
|
+
success: step.success,
|
|
18218
|
+
error: step.error,
|
|
18219
|
+
log: step.log,
|
|
18220
|
+
inputsList: step.inputsList,
|
|
18221
|
+
config: step.config,
|
|
18222
|
+
output,
|
|
18223
|
+
startAt: step.startAt,
|
|
18224
|
+
endAt: step.endAt
|
|
18225
|
+
};
|
|
18226
|
+
});
|
|
18227
|
+
}
|
|
18228
|
+
return response;
|
|
17995
18229
|
}
|
|
17996
18230
|
/**
|
|
17997
18231
|
* Cancel a workflow
|
package/dist/index.mjs
CHANGED
|
@@ -738,7 +738,7 @@ var require_avs_pb = __commonJS({
|
|
|
738
738
|
proto.aggregator.TriggerTaskReq.displayName = "proto.aggregator.TriggerTaskReq";
|
|
739
739
|
}
|
|
740
740
|
proto.aggregator.TriggerTaskResp = function(opt_data) {
|
|
741
|
-
jspb.Message.initialize(this, opt_data, 0, -1,
|
|
741
|
+
jspb.Message.initialize(this, opt_data, 0, -1, proto.aggregator.TriggerTaskResp.repeatedFields_, null);
|
|
742
742
|
};
|
|
743
743
|
goog.inherits(proto.aggregator.TriggerTaskResp, jspb.Message);
|
|
744
744
|
if (goog.DEBUG && !COMPILED) {
|
|
@@ -10640,6 +10640,7 @@ var require_avs_pb = __commonJS({
|
|
|
10640
10640
|
proto.aggregator.TriggerTaskReq.prototype.setIsBlocking = function(value) {
|
|
10641
10641
|
return jspb.Message.setProto3BooleanField(this, 8, value);
|
|
10642
10642
|
};
|
|
10643
|
+
proto.aggregator.TriggerTaskResp.repeatedFields_ = [8];
|
|
10643
10644
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
10644
10645
|
proto.aggregator.TriggerTaskResp.prototype.toObject = function(opt_includeInstance) {
|
|
10645
10646
|
return proto.aggregator.TriggerTaskResp.toObject(opt_includeInstance, this);
|
|
@@ -10647,7 +10648,17 @@ var require_avs_pb = __commonJS({
|
|
|
10647
10648
|
proto.aggregator.TriggerTaskResp.toObject = function(includeInstance, msg) {
|
|
10648
10649
|
var f, obj = {
|
|
10649
10650
|
executionId: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
|
10650
|
-
status: jspb.Message.getFieldWithDefault(msg, 2, 0)
|
|
10651
|
+
status: jspb.Message.getFieldWithDefault(msg, 2, 0),
|
|
10652
|
+
workflowId: jspb.Message.getFieldWithDefault(msg, 3, ""),
|
|
10653
|
+
startAt: jspb.Message.getFieldWithDefault(msg, 4, 0),
|
|
10654
|
+
endAt: jspb.Message.getFieldWithDefault(msg, 5, 0),
|
|
10655
|
+
success: jspb.Message.getBooleanFieldWithDefault(msg, 6, false),
|
|
10656
|
+
error: jspb.Message.getFieldWithDefault(msg, 7, ""),
|
|
10657
|
+
stepsList: jspb.Message.toObjectList(
|
|
10658
|
+
msg.getStepsList(),
|
|
10659
|
+
proto.aggregator.Execution.Step.toObject,
|
|
10660
|
+
includeInstance
|
|
10661
|
+
)
|
|
10651
10662
|
};
|
|
10652
10663
|
if (includeInstance) {
|
|
10653
10664
|
obj.$jspbMessageInstance = msg;
|
|
@@ -10681,6 +10692,46 @@ var require_avs_pb = __commonJS({
|
|
|
10681
10692
|
);
|
|
10682
10693
|
msg.setStatus(value);
|
|
10683
10694
|
break;
|
|
10695
|
+
case 3:
|
|
10696
|
+
var value = (
|
|
10697
|
+
/** @type {string} */
|
|
10698
|
+
reader.readString()
|
|
10699
|
+
);
|
|
10700
|
+
msg.setWorkflowId(value);
|
|
10701
|
+
break;
|
|
10702
|
+
case 4:
|
|
10703
|
+
var value = (
|
|
10704
|
+
/** @type {number} */
|
|
10705
|
+
reader.readInt64()
|
|
10706
|
+
);
|
|
10707
|
+
msg.setStartAt(value);
|
|
10708
|
+
break;
|
|
10709
|
+
case 5:
|
|
10710
|
+
var value = (
|
|
10711
|
+
/** @type {number} */
|
|
10712
|
+
reader.readInt64()
|
|
10713
|
+
);
|
|
10714
|
+
msg.setEndAt(value);
|
|
10715
|
+
break;
|
|
10716
|
+
case 6:
|
|
10717
|
+
var value = (
|
|
10718
|
+
/** @type {boolean} */
|
|
10719
|
+
reader.readBool()
|
|
10720
|
+
);
|
|
10721
|
+
msg.setSuccess(value);
|
|
10722
|
+
break;
|
|
10723
|
+
case 7:
|
|
10724
|
+
var value = (
|
|
10725
|
+
/** @type {string} */
|
|
10726
|
+
reader.readString()
|
|
10727
|
+
);
|
|
10728
|
+
msg.setError(value);
|
|
10729
|
+
break;
|
|
10730
|
+
case 8:
|
|
10731
|
+
var value = new proto.aggregator.Execution.Step();
|
|
10732
|
+
reader.readMessage(value, proto.aggregator.Execution.Step.deserializeBinaryFromReader);
|
|
10733
|
+
msg.addSteps(value);
|
|
10734
|
+
break;
|
|
10684
10735
|
default:
|
|
10685
10736
|
reader.skipField();
|
|
10686
10737
|
break;
|
|
@@ -10709,6 +10760,53 @@ var require_avs_pb = __commonJS({
|
|
|
10709
10760
|
f
|
|
10710
10761
|
);
|
|
10711
10762
|
}
|
|
10763
|
+
f = message.getWorkflowId();
|
|
10764
|
+
if (f.length > 0) {
|
|
10765
|
+
writer.writeString(
|
|
10766
|
+
3,
|
|
10767
|
+
f
|
|
10768
|
+
);
|
|
10769
|
+
}
|
|
10770
|
+
f = /** @type {number} */
|
|
10771
|
+
jspb.Message.getField(message, 4);
|
|
10772
|
+
if (f != null) {
|
|
10773
|
+
writer.writeInt64(
|
|
10774
|
+
4,
|
|
10775
|
+
f
|
|
10776
|
+
);
|
|
10777
|
+
}
|
|
10778
|
+
f = /** @type {number} */
|
|
10779
|
+
jspb.Message.getField(message, 5);
|
|
10780
|
+
if (f != null) {
|
|
10781
|
+
writer.writeInt64(
|
|
10782
|
+
5,
|
|
10783
|
+
f
|
|
10784
|
+
);
|
|
10785
|
+
}
|
|
10786
|
+
f = /** @type {boolean} */
|
|
10787
|
+
jspb.Message.getField(message, 6);
|
|
10788
|
+
if (f != null) {
|
|
10789
|
+
writer.writeBool(
|
|
10790
|
+
6,
|
|
10791
|
+
f
|
|
10792
|
+
);
|
|
10793
|
+
}
|
|
10794
|
+
f = /** @type {string} */
|
|
10795
|
+
jspb.Message.getField(message, 7);
|
|
10796
|
+
if (f != null) {
|
|
10797
|
+
writer.writeString(
|
|
10798
|
+
7,
|
|
10799
|
+
f
|
|
10800
|
+
);
|
|
10801
|
+
}
|
|
10802
|
+
f = message.getStepsList();
|
|
10803
|
+
if (f.length > 0) {
|
|
10804
|
+
writer.writeRepeatedMessage(
|
|
10805
|
+
8,
|
|
10806
|
+
f,
|
|
10807
|
+
proto.aggregator.Execution.Step.serializeBinaryToWriter
|
|
10808
|
+
);
|
|
10809
|
+
}
|
|
10712
10810
|
};
|
|
10713
10811
|
proto.aggregator.TriggerTaskResp.prototype.getExecutionId = function() {
|
|
10714
10812
|
return (
|
|
@@ -10728,6 +10826,90 @@ var require_avs_pb = __commonJS({
|
|
|
10728
10826
|
proto.aggregator.TriggerTaskResp.prototype.setStatus = function(value) {
|
|
10729
10827
|
return jspb.Message.setProto3EnumField(this, 2, value);
|
|
10730
10828
|
};
|
|
10829
|
+
proto.aggregator.TriggerTaskResp.prototype.getWorkflowId = function() {
|
|
10830
|
+
return (
|
|
10831
|
+
/** @type {string} */
|
|
10832
|
+
jspb.Message.getFieldWithDefault(this, 3, "")
|
|
10833
|
+
);
|
|
10834
|
+
};
|
|
10835
|
+
proto.aggregator.TriggerTaskResp.prototype.setWorkflowId = function(value) {
|
|
10836
|
+
return jspb.Message.setProto3StringField(this, 3, value);
|
|
10837
|
+
};
|
|
10838
|
+
proto.aggregator.TriggerTaskResp.prototype.getStartAt = function() {
|
|
10839
|
+
return (
|
|
10840
|
+
/** @type {number} */
|
|
10841
|
+
jspb.Message.getFieldWithDefault(this, 4, 0)
|
|
10842
|
+
);
|
|
10843
|
+
};
|
|
10844
|
+
proto.aggregator.TriggerTaskResp.prototype.setStartAt = function(value) {
|
|
10845
|
+
return jspb.Message.setField(this, 4, value);
|
|
10846
|
+
};
|
|
10847
|
+
proto.aggregator.TriggerTaskResp.prototype.clearStartAt = function() {
|
|
10848
|
+
return jspb.Message.setField(this, 4, void 0);
|
|
10849
|
+
};
|
|
10850
|
+
proto.aggregator.TriggerTaskResp.prototype.hasStartAt = function() {
|
|
10851
|
+
return jspb.Message.getField(this, 4) != null;
|
|
10852
|
+
};
|
|
10853
|
+
proto.aggregator.TriggerTaskResp.prototype.getEndAt = function() {
|
|
10854
|
+
return (
|
|
10855
|
+
/** @type {number} */
|
|
10856
|
+
jspb.Message.getFieldWithDefault(this, 5, 0)
|
|
10857
|
+
);
|
|
10858
|
+
};
|
|
10859
|
+
proto.aggregator.TriggerTaskResp.prototype.setEndAt = function(value) {
|
|
10860
|
+
return jspb.Message.setField(this, 5, value);
|
|
10861
|
+
};
|
|
10862
|
+
proto.aggregator.TriggerTaskResp.prototype.clearEndAt = function() {
|
|
10863
|
+
return jspb.Message.setField(this, 5, void 0);
|
|
10864
|
+
};
|
|
10865
|
+
proto.aggregator.TriggerTaskResp.prototype.hasEndAt = function() {
|
|
10866
|
+
return jspb.Message.getField(this, 5) != null;
|
|
10867
|
+
};
|
|
10868
|
+
proto.aggregator.TriggerTaskResp.prototype.getSuccess = function() {
|
|
10869
|
+
return (
|
|
10870
|
+
/** @type {boolean} */
|
|
10871
|
+
jspb.Message.getBooleanFieldWithDefault(this, 6, false)
|
|
10872
|
+
);
|
|
10873
|
+
};
|
|
10874
|
+
proto.aggregator.TriggerTaskResp.prototype.setSuccess = function(value) {
|
|
10875
|
+
return jspb.Message.setField(this, 6, value);
|
|
10876
|
+
};
|
|
10877
|
+
proto.aggregator.TriggerTaskResp.prototype.clearSuccess = function() {
|
|
10878
|
+
return jspb.Message.setField(this, 6, void 0);
|
|
10879
|
+
};
|
|
10880
|
+
proto.aggregator.TriggerTaskResp.prototype.hasSuccess = function() {
|
|
10881
|
+
return jspb.Message.getField(this, 6) != null;
|
|
10882
|
+
};
|
|
10883
|
+
proto.aggregator.TriggerTaskResp.prototype.getError = function() {
|
|
10884
|
+
return (
|
|
10885
|
+
/** @type {string} */
|
|
10886
|
+
jspb.Message.getFieldWithDefault(this, 7, "")
|
|
10887
|
+
);
|
|
10888
|
+
};
|
|
10889
|
+
proto.aggregator.TriggerTaskResp.prototype.setError = function(value) {
|
|
10890
|
+
return jspb.Message.setField(this, 7, value);
|
|
10891
|
+
};
|
|
10892
|
+
proto.aggregator.TriggerTaskResp.prototype.clearError = function() {
|
|
10893
|
+
return jspb.Message.setField(this, 7, void 0);
|
|
10894
|
+
};
|
|
10895
|
+
proto.aggregator.TriggerTaskResp.prototype.hasError = function() {
|
|
10896
|
+
return jspb.Message.getField(this, 7) != null;
|
|
10897
|
+
};
|
|
10898
|
+
proto.aggregator.TriggerTaskResp.prototype.getStepsList = function() {
|
|
10899
|
+
return (
|
|
10900
|
+
/** @type{!Array<!proto.aggregator.Execution.Step>} */
|
|
10901
|
+
jspb.Message.getRepeatedWrapperField(this, proto.aggregator.Execution.Step, 8)
|
|
10902
|
+
);
|
|
10903
|
+
};
|
|
10904
|
+
proto.aggregator.TriggerTaskResp.prototype.setStepsList = function(value) {
|
|
10905
|
+
return jspb.Message.setRepeatedWrapperField(this, 8, value);
|
|
10906
|
+
};
|
|
10907
|
+
proto.aggregator.TriggerTaskResp.prototype.addSteps = function(opt_value, opt_index) {
|
|
10908
|
+
return jspb.Message.addToRepeatedWrapperField(this, 8, opt_value, proto.aggregator.Execution.Step, opt_index);
|
|
10909
|
+
};
|
|
10910
|
+
proto.aggregator.TriggerTaskResp.prototype.clearStepsList = function() {
|
|
10911
|
+
return this.setStepsList([]);
|
|
10912
|
+
};
|
|
10731
10913
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
10732
10914
|
proto.aggregator.CreateOrUpdateSecretReq.prototype.toObject = function(opt_includeInstance) {
|
|
10733
10915
|
return proto.aggregator.CreateOrUpdateSecretReq.toObject(opt_includeInstance, this);
|
|
@@ -16244,7 +16426,9 @@ var ContractWriteNode2 = class _ContractWriteNode extends Node {
|
|
|
16244
16426
|
methodABI: result.method_abi || null,
|
|
16245
16427
|
success: result.success,
|
|
16246
16428
|
error: result.error || "",
|
|
16247
|
-
value: result.value
|
|
16429
|
+
value: result.value,
|
|
16430
|
+
receipt: result.receipt || null
|
|
16431
|
+
// Add receipt field
|
|
16248
16432
|
};
|
|
16249
16433
|
});
|
|
16250
16434
|
} else {
|
|
@@ -16254,7 +16438,9 @@ var ContractWriteNode2 = class _ContractWriteNode extends Node {
|
|
|
16254
16438
|
methodABI: jsData.method_abi || null,
|
|
16255
16439
|
success: jsData.success,
|
|
16256
16440
|
error: jsData.error || "",
|
|
16257
|
-
value: jsData.value
|
|
16441
|
+
value: jsData.value,
|
|
16442
|
+
receipt: jsData.receipt || null
|
|
16443
|
+
// Add receipt field
|
|
16258
16444
|
}];
|
|
16259
16445
|
}
|
|
16260
16446
|
}
|
|
@@ -17911,13 +18097,13 @@ var Client = class extends BaseClient {
|
|
|
17911
18097
|
return workflow_default.fromResponse(result);
|
|
17912
18098
|
}
|
|
17913
18099
|
/**
|
|
17914
|
-
* Trigger a workflow with
|
|
18100
|
+
* Trigger a workflow with enhanced response including workflowId and optional execution details
|
|
17915
18101
|
* @param {Object} params - The trigger parameters
|
|
17916
18102
|
* @param {string} params.id - The workflow id
|
|
17917
18103
|
* @param {TriggerDataProps} params.triggerData - The trigger data
|
|
17918
18104
|
* @param {boolean} params.isBlocking - Whether to block until execution completes
|
|
17919
18105
|
* @param {RequestOptions} options - Request options
|
|
17920
|
-
* @returns {Promise<
|
|
18106
|
+
* @returns {Promise<TriggerWorkflowResponse>} - Enhanced response with workflowId and execution details
|
|
17921
18107
|
*/
|
|
17922
18108
|
async triggerWorkflow({
|
|
17923
18109
|
id,
|
|
@@ -17930,10 +18116,11 @@ var Client = class extends BaseClient {
|
|
|
17930
18116
|
request.setIsBlocking(isBlocking);
|
|
17931
18117
|
switch (triggerData.type) {
|
|
17932
18118
|
case TriggerType13.FixedTime: {
|
|
18119
|
+
const fixedTimeData = triggerData;
|
|
17933
18120
|
const fixedTimeOutput = new avs_pb22.FixedTimeTrigger.Output();
|
|
17934
18121
|
const triggerOutputData = {
|
|
17935
|
-
timestamp:
|
|
17936
|
-
timestampIso:
|
|
18122
|
+
timestamp: fixedTimeData.timestamp,
|
|
18123
|
+
timestampIso: fixedTimeData.timestampIso
|
|
17937
18124
|
};
|
|
17938
18125
|
const dataValue = new google_protobuf_struct_pb4.Value();
|
|
17939
18126
|
dataValue.setStructValue(
|
|
@@ -17944,10 +18131,11 @@ var Client = class extends BaseClient {
|
|
|
17944
18131
|
break;
|
|
17945
18132
|
}
|
|
17946
18133
|
case TriggerType13.Cron: {
|
|
18134
|
+
const cronData = triggerData;
|
|
17947
18135
|
const cronOutput = new avs_pb22.CronTrigger.Output();
|
|
17948
18136
|
const triggerOutputData = {
|
|
17949
|
-
timestamp:
|
|
17950
|
-
timestampIso:
|
|
18137
|
+
timestamp: cronData.timestamp,
|
|
18138
|
+
timestampIso: cronData.timestampIso
|
|
17951
18139
|
};
|
|
17952
18140
|
const dataValue = new google_protobuf_struct_pb4.Value();
|
|
17953
18141
|
dataValue.setStructValue(
|
|
@@ -18006,10 +18194,56 @@ var Client = class extends BaseClient {
|
|
|
18006
18194
|
}
|
|
18007
18195
|
const result = await this.sendGrpcRequest("triggerTask", request, options);
|
|
18008
18196
|
const responseObject = result.toObject();
|
|
18009
|
-
|
|
18010
|
-
|
|
18011
|
-
status: convertProtobufExecutionStatus(result.getStatus())
|
|
18012
|
-
|
|
18197
|
+
const response = {
|
|
18198
|
+
executionId: responseObject.executionId,
|
|
18199
|
+
status: convertProtobufExecutionStatus(result.getStatus()),
|
|
18200
|
+
workflowId: responseObject.workflowId
|
|
18201
|
+
};
|
|
18202
|
+
if (responseObject.startAt !== void 0) {
|
|
18203
|
+
response.startAt = responseObject.startAt;
|
|
18204
|
+
}
|
|
18205
|
+
if (responseObject.endAt !== void 0) {
|
|
18206
|
+
response.endAt = responseObject.endAt;
|
|
18207
|
+
}
|
|
18208
|
+
if (responseObject.success !== void 0) {
|
|
18209
|
+
response.success = responseObject.success;
|
|
18210
|
+
}
|
|
18211
|
+
if (responseObject.error) {
|
|
18212
|
+
response.error = responseObject.error;
|
|
18213
|
+
}
|
|
18214
|
+
if (responseObject.stepsList && responseObject.stepsList.length > 0) {
|
|
18215
|
+
response.steps = responseObject.stepsList.map((step) => {
|
|
18216
|
+
let output = void 0;
|
|
18217
|
+
if (step.blockTrigger) output = step.blockTrigger;
|
|
18218
|
+
else if (step.fixedTimeTrigger) output = step.fixedTimeTrigger;
|
|
18219
|
+
else if (step.cronTrigger) output = step.cronTrigger;
|
|
18220
|
+
else if (step.eventTrigger) output = step.eventTrigger;
|
|
18221
|
+
else if (step.manualTrigger) output = step.manualTrigger;
|
|
18222
|
+
else if (step.ethTransfer) output = step.ethTransfer;
|
|
18223
|
+
else if (step.graphql) output = step.graphql;
|
|
18224
|
+
else if (step.contractRead) output = step.contractRead;
|
|
18225
|
+
else if (step.contractWrite) output = step.contractWrite;
|
|
18226
|
+
else if (step.customCode) output = step.customCode;
|
|
18227
|
+
else if (step.restApi) output = step.restApi;
|
|
18228
|
+
else if (step.branch) output = step.branch;
|
|
18229
|
+
else if (step.filter) output = step.filter;
|
|
18230
|
+
else if (step.loop) output = step.loop;
|
|
18231
|
+
return {
|
|
18232
|
+
id: step.id,
|
|
18233
|
+
type: step.type,
|
|
18234
|
+
name: step.name,
|
|
18235
|
+
success: step.success,
|
|
18236
|
+
error: step.error,
|
|
18237
|
+
log: step.log,
|
|
18238
|
+
inputsList: step.inputsList,
|
|
18239
|
+
config: step.config,
|
|
18240
|
+
output,
|
|
18241
|
+
startAt: step.startAt,
|
|
18242
|
+
endAt: step.endAt
|
|
18243
|
+
};
|
|
18244
|
+
});
|
|
18245
|
+
}
|
|
18246
|
+
return response;
|
|
18013
18247
|
}
|
|
18014
18248
|
/**
|
|
18015
18249
|
* Cancel a workflow
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contractWrite.d.ts","sourceRoot":"","sources":["../../../src/models/node/contractWrite.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAEhD,OAAO,EAEL,qBAAqB,EACrB,sBAAsB,EAEvB,MAAM,oBAAoB,CAAC;AAK5B,cAAM,iBAAkB,SAAQ,IAAI;gBACtB,KAAK,EAAE,sBAAsB;IAIzC;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,qBAAqB,GAAG,MAAM,CAAC,iBAAiB;IAuCtF,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,iBAAiB;IA8B5D,SAAS,IAAI,MAAM,CAAC,QAAQ;IAe5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,OAAO,EAAE,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"contractWrite.d.ts","sourceRoot":"","sources":["../../../src/models/node/contractWrite.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAEhD,OAAO,EAEL,qBAAqB,EACrB,sBAAsB,EAEvB,MAAM,oBAAoB,CAAC;AAK5B,cAAM,iBAAkB,SAAQ,IAAI;gBACtB,KAAK,EAAE,sBAAsB;IAIzC;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,qBAAqB,GAAG,MAAM,CAAC,iBAAiB;IAuCtF,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,iBAAiB;IA8B5D,SAAS,IAAI,MAAM,CAAC,QAAQ;IAe5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,OAAO,EAAE,GAAG,IAAI;CAuClF;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -98,6 +98,7 @@ class ContractWriteNode extends Node {
|
|
|
98
98
|
success: result.success,
|
|
99
99
|
error: result.error || "",
|
|
100
100
|
value: result.value,
|
|
101
|
+
receipt: result.receipt || null, // Add receipt field
|
|
101
102
|
};
|
|
102
103
|
});
|
|
103
104
|
}
|
|
@@ -110,6 +111,7 @@ class ContractWriteNode extends Node {
|
|
|
110
111
|
success: jsData.success,
|
|
111
112
|
error: jsData.error || "",
|
|
112
113
|
value: jsData.value,
|
|
114
|
+
receipt: jsData.receipt || null, // Add receipt field
|
|
113
115
|
}];
|
|
114
116
|
}
|
|
115
117
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avaprotocol/sdk-js",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.5",
|
|
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.4.
|
|
34
|
+
"@avaprotocol/types": "^2.4.5",
|
|
35
35
|
"@grpc/grpc-js": "^1.11.3",
|
|
36
36
|
"@grpc/proto-loader": "^0.7.13",
|
|
37
37
|
"dotenv": "^16.4.5",
|