@avaprotocol/sdk-js 1.3.5-dev.2 → 1.3.6
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/dist/index.d.mts +2 -8
- package/dist/index.d.ts +2 -8
- package/dist/index.js +18 -31
- package/dist/index.mjs +28 -42
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1964,13 +1964,7 @@ declare class CronTrigger extends Trigger {
|
|
|
1964
1964
|
static fromResponse(raw: TaskTrigger): CronTrigger;
|
|
1965
1965
|
}
|
|
1966
1966
|
|
|
1967
|
-
|
|
1968
|
-
type: string;
|
|
1969
|
-
value: string[];
|
|
1970
|
-
}
|
|
1971
|
-
type EventTriggerDataType = EventCondition.AsObject & {
|
|
1972
|
-
matcher?: EventMatcher[];
|
|
1973
|
-
};
|
|
1967
|
+
type EventTriggerDataType = EventCondition.AsObject;
|
|
1974
1968
|
type EventTriggerProps = TriggerProps & {
|
|
1975
1969
|
data: EventTriggerDataType;
|
|
1976
1970
|
};
|
|
@@ -2198,4 +2192,4 @@ declare class Client extends BaseClient {
|
|
|
2198
2192
|
deleteSecret(name: string, options?: SecretRequestOptions): Promise<boolean>;
|
|
2199
2193
|
}
|
|
2200
2194
|
|
|
2201
|
-
export { AUTH_KEY_HEADER, BlockTrigger, type BlockTriggerDataType, type BlockTriggerProps, BranchNode, type BranchNodeData, type BranchNodeProps, type ClientOption, ContractReadNode, type ContractReadNodeData, type ContractReadNodeProps, ContractWriteNode, type ContractWriteNodeData, type ContractWriteNodeProps, CronTrigger, type CronTriggerDataType, type CronTriggerProps, CustomCodeLangs, CustomCodeNode, type CustomCodeNodeData, type CustomCodeNodeProps, DEFAULT_LIMIT, ETHTransferNode, type ETHTransferNodeData, type ETHTransferNodeProps, Edge, type EdgeProps, type Environment, EventTrigger, type EventTriggerDataType, type EventTriggerProps, Execution, type ExecutionProps, ExecutionStatus, FilterNode, type FilterNodeData, type FilterNodeProps, FixedTimeTrigger, type FixedTimeTriggerDataType, type FixedTimeTriggerProps, type GetExecutionsRequest, type GetWalletRequest, type GetWorkflowsRequest, GraphQLQueryNode, type GraphQLQueryNodeData, type GraphQLQueryNodeProps, type ListSecretResponse, Node, NodeFactory, type NodeProps, type RequestOptions, RestAPINode, type RestAPINodeData, type RestAPINodeProps, type SecretRequestOptions, type SmartWallet, Step, type StepProps, Trigger, TriggerFactory, type TriggerProps, TriggerType, Workflow, type WorkflowProps, WorkflowStatus, Client as default };
|
|
2195
|
+
export { AUTH_KEY_HEADER, BlockTrigger, type BlockTriggerDataType, type BlockTriggerProps, BranchNode, type BranchNodeData, type BranchNodeProps, type ClientOption, ContractReadNode, type ContractReadNodeData, type ContractReadNodeProps, ContractWriteNode, type ContractWriteNodeData, type ContractWriteNodeProps, CronTrigger, type CronTriggerDataType, type CronTriggerProps, CustomCodeLangs, CustomCodeNode, type CustomCodeNodeData, type CustomCodeNodeProps, DEFAULT_LIMIT, ETHTransferNode, type ETHTransferNodeData, type ETHTransferNodeProps, Edge, type EdgeProps, type Environment, EventTrigger, type EventTriggerDataType, type EventTriggerProps, Execution, type ExecutionProps, ExecutionStatus, FilterNode, type FilterNodeData, type FilterNodeProps, FixedTimeTrigger, type FixedTimeTriggerDataType, type FixedTimeTriggerProps, type GetExecutionsRequest, type GetWalletRequest, type GetWorkflowsRequest, GraphQLQueryNode, type GraphQLQueryNodeData, type GraphQLQueryNodeProps, type ListSecretResponse, Node, NodeFactory, type NodeProps, type RequestOptions, RestAPINode, type RestAPINodeData, type RestAPINodeProps, type SecretRequestOptions, type SmartWallet, Step, type StepProps, Trigger, TriggerFactory, TriggerMetadata, type TriggerProps, TriggerType, Workflow, type WorkflowProps, WorkflowStatus, Client as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -1964,13 +1964,7 @@ declare class CronTrigger extends Trigger {
|
|
|
1964
1964
|
static fromResponse(raw: TaskTrigger): CronTrigger;
|
|
1965
1965
|
}
|
|
1966
1966
|
|
|
1967
|
-
|
|
1968
|
-
type: string;
|
|
1969
|
-
value: string[];
|
|
1970
|
-
}
|
|
1971
|
-
type EventTriggerDataType = EventCondition.AsObject & {
|
|
1972
|
-
matcher?: EventMatcher[];
|
|
1973
|
-
};
|
|
1967
|
+
type EventTriggerDataType = EventCondition.AsObject;
|
|
1974
1968
|
type EventTriggerProps = TriggerProps & {
|
|
1975
1969
|
data: EventTriggerDataType;
|
|
1976
1970
|
};
|
|
@@ -2198,4 +2192,4 @@ declare class Client extends BaseClient {
|
|
|
2198
2192
|
deleteSecret(name: string, options?: SecretRequestOptions): Promise<boolean>;
|
|
2199
2193
|
}
|
|
2200
2194
|
|
|
2201
|
-
export { AUTH_KEY_HEADER, BlockTrigger, type BlockTriggerDataType, type BlockTriggerProps, BranchNode, type BranchNodeData, type BranchNodeProps, type ClientOption, ContractReadNode, type ContractReadNodeData, type ContractReadNodeProps, ContractWriteNode, type ContractWriteNodeData, type ContractWriteNodeProps, CronTrigger, type CronTriggerDataType, type CronTriggerProps, CustomCodeLangs, CustomCodeNode, type CustomCodeNodeData, type CustomCodeNodeProps, DEFAULT_LIMIT, ETHTransferNode, type ETHTransferNodeData, type ETHTransferNodeProps, Edge, type EdgeProps, type Environment, EventTrigger, type EventTriggerDataType, type EventTriggerProps, Execution, type ExecutionProps, ExecutionStatus, FilterNode, type FilterNodeData, type FilterNodeProps, FixedTimeTrigger, type FixedTimeTriggerDataType, type FixedTimeTriggerProps, type GetExecutionsRequest, type GetWalletRequest, type GetWorkflowsRequest, GraphQLQueryNode, type GraphQLQueryNodeData, type GraphQLQueryNodeProps, type ListSecretResponse, Node, NodeFactory, type NodeProps, type RequestOptions, RestAPINode, type RestAPINodeData, type RestAPINodeProps, type SecretRequestOptions, type SmartWallet, Step, type StepProps, Trigger, TriggerFactory, type TriggerProps, TriggerType, Workflow, type WorkflowProps, WorkflowStatus, Client as default };
|
|
2195
|
+
export { AUTH_KEY_HEADER, BlockTrigger, type BlockTriggerDataType, type BlockTriggerProps, BranchNode, type BranchNodeData, type BranchNodeProps, type ClientOption, ContractReadNode, type ContractReadNodeData, type ContractReadNodeProps, ContractWriteNode, type ContractWriteNodeData, type ContractWriteNodeProps, CronTrigger, type CronTriggerDataType, type CronTriggerProps, CustomCodeLangs, CustomCodeNode, type CustomCodeNodeData, type CustomCodeNodeProps, DEFAULT_LIMIT, ETHTransferNode, type ETHTransferNodeData, type ETHTransferNodeProps, Edge, type EdgeProps, type Environment, EventTrigger, type EventTriggerDataType, type EventTriggerProps, Execution, type ExecutionProps, ExecutionStatus, FilterNode, type FilterNodeData, type FilterNodeProps, FixedTimeTrigger, type FixedTimeTriggerDataType, type FixedTimeTriggerProps, type GetExecutionsRequest, type GetWalletRequest, type GetWorkflowsRequest, GraphQLQueryNode, type GraphQLQueryNodeData, type GraphQLQueryNodeProps, type ListSecretResponse, Node, NodeFactory, type NodeProps, type RequestOptions, RestAPINode, type RestAPINodeData, type RestAPINodeProps, type SecretRequestOptions, type SmartWallet, Step, type StepProps, Trigger, TriggerFactory, TriggerMetadata, type TriggerProps, TriggerType, Workflow, type WorkflowProps, WorkflowStatus, Client as default };
|
package/dist/index.js
CHANGED
|
@@ -7363,6 +7363,7 @@ __export(index_exports, {
|
|
|
7363
7363
|
Step: () => step_default,
|
|
7364
7364
|
Trigger: () => interface_default,
|
|
7365
7365
|
TriggerFactory: () => factory_default,
|
|
7366
|
+
TriggerMetadata: () => metadata_default,
|
|
7366
7367
|
TriggerType: () => TriggerType,
|
|
7367
7368
|
Workflow: () => workflow_default,
|
|
7368
7369
|
WorkflowStatus: () => WorkflowStatus,
|
|
@@ -7477,11 +7478,6 @@ var avs_pb4 = __toESM(require_avs_pb());
|
|
|
7477
7478
|
var CronTrigger = class _CronTrigger extends interface_default {
|
|
7478
7479
|
constructor(props) {
|
|
7479
7480
|
super({ ...props, type: "cron" /* Cron */, data: props.data });
|
|
7480
|
-
console.log("CronTrigger.constructor.props:", {
|
|
7481
|
-
...props,
|
|
7482
|
-
type: "cron" /* Cron */,
|
|
7483
|
-
data: props.data
|
|
7484
|
-
});
|
|
7485
7481
|
}
|
|
7486
7482
|
toRequest() {
|
|
7487
7483
|
const request = new avs_pb4.TaskTrigger();
|
|
@@ -7493,12 +7489,10 @@ var CronTrigger = class _CronTrigger extends interface_default {
|
|
|
7493
7489
|
const condition = new avs_pb4.CronCondition();
|
|
7494
7490
|
condition.setScheduleList(this.data.scheduleList);
|
|
7495
7491
|
request.setCron(condition);
|
|
7496
|
-
console.log("CronTrigger.toRequest.request:", request.toObject());
|
|
7497
7492
|
return request;
|
|
7498
7493
|
}
|
|
7499
7494
|
static fromResponse(raw) {
|
|
7500
7495
|
const obj = raw.toObject();
|
|
7501
|
-
console.log("CronTrigger.fromResponse.obj:", obj);
|
|
7502
7496
|
return new _CronTrigger({
|
|
7503
7497
|
...obj,
|
|
7504
7498
|
type: "cron" /* Cron */,
|
|
@@ -7509,15 +7503,11 @@ var CronTrigger = class _CronTrigger extends interface_default {
|
|
|
7509
7503
|
var cron_default = CronTrigger;
|
|
7510
7504
|
|
|
7511
7505
|
// src/models/trigger/event.ts
|
|
7506
|
+
var _ = __toESM(require("lodash"));
|
|
7512
7507
|
var avs_pb5 = __toESM(require_avs_pb());
|
|
7513
7508
|
var EventTrigger = class _EventTrigger extends interface_default {
|
|
7514
7509
|
constructor(props) {
|
|
7515
7510
|
super({ ...props, type: "event" /* Event */, data: props.data });
|
|
7516
|
-
console.log("EventTrigger.constructor.props:", {
|
|
7517
|
-
...props,
|
|
7518
|
-
type: "event" /* Event */,
|
|
7519
|
-
data: props.data
|
|
7520
|
-
});
|
|
7521
7511
|
}
|
|
7522
7512
|
toRequest() {
|
|
7523
7513
|
const request = new avs_pb5.TaskTrigger();
|
|
@@ -7528,34 +7518,36 @@ var EventTrigger = class _EventTrigger extends interface_default {
|
|
|
7528
7518
|
}
|
|
7529
7519
|
const condition = new avs_pb5.EventCondition();
|
|
7530
7520
|
const expression = this.data.expression;
|
|
7531
|
-
const
|
|
7532
|
-
if (expression
|
|
7533
|
-
|
|
7521
|
+
const matcherList = this.data.matcherList;
|
|
7522
|
+
if (_.isUndefined(expression)) {
|
|
7523
|
+
throw new Error(`Expression is undefined for ${this.type}`);
|
|
7534
7524
|
}
|
|
7535
|
-
|
|
7536
|
-
|
|
7525
|
+
condition.setExpression(expression);
|
|
7526
|
+
if (_.isUndefined(matcherList)) {
|
|
7527
|
+
throw new Error(`Matcher list is undefined for ${this.type}`);
|
|
7528
|
+
}
|
|
7529
|
+
condition.setMatcherList(
|
|
7530
|
+
matcherList.map((element) => {
|
|
7537
7531
|
const m = new avs_pb5.EventCondition.Matcher();
|
|
7538
7532
|
m.setType(element["type"]);
|
|
7539
|
-
m.setValueList(element["
|
|
7533
|
+
m.setValueList(element["valueList"]);
|
|
7540
7534
|
return m;
|
|
7541
|
-
})
|
|
7542
|
-
|
|
7535
|
+
})
|
|
7536
|
+
);
|
|
7543
7537
|
request.setEvent(condition);
|
|
7544
|
-
console.log("EventTrigger.toRequest.request:", request.toObject());
|
|
7545
7538
|
return request;
|
|
7546
7539
|
}
|
|
7547
7540
|
static fromResponse(raw) {
|
|
7548
7541
|
const obj = raw.toObject();
|
|
7549
|
-
console.log("EventTrigger.fromResponse.obj:", obj);
|
|
7550
7542
|
let data = {};
|
|
7551
7543
|
if (raw.getEvent().getExpression()) {
|
|
7552
7544
|
data.expression = raw.getEvent().getExpression();
|
|
7553
7545
|
}
|
|
7554
7546
|
if (raw.getEvent().getMatcherList()) {
|
|
7555
|
-
data.
|
|
7547
|
+
data.matcherList = raw.getEvent().getMatcherList().map((item) => {
|
|
7556
7548
|
return {
|
|
7557
7549
|
type: item.getType(),
|
|
7558
|
-
|
|
7550
|
+
valueList: item.getValueList()
|
|
7559
7551
|
};
|
|
7560
7552
|
});
|
|
7561
7553
|
}
|
|
@@ -7573,11 +7565,6 @@ var avs_pb6 = __toESM(require_avs_pb());
|
|
|
7573
7565
|
var FixedTimeTrigger = class _FixedTimeTrigger extends interface_default {
|
|
7574
7566
|
constructor(props) {
|
|
7575
7567
|
super({ ...props, type: "fixed_time" /* FixedTime */, data: props.data });
|
|
7576
|
-
console.log("FixedTimeTrigger.constructor.props:", {
|
|
7577
|
-
...props,
|
|
7578
|
-
type: "fixed_time" /* FixedTime */,
|
|
7579
|
-
data: props.data
|
|
7580
|
-
});
|
|
7581
7568
|
}
|
|
7582
7569
|
toRequest() {
|
|
7583
7570
|
const request = new avs_pb6.TaskTrigger();
|
|
@@ -7589,12 +7576,10 @@ var FixedTimeTrigger = class _FixedTimeTrigger extends interface_default {
|
|
|
7589
7576
|
const condition = new avs_pb6.FixedTimeCondition();
|
|
7590
7577
|
condition.setEpochsList(this.data.epochsList);
|
|
7591
7578
|
request.setFixedTime(condition);
|
|
7592
|
-
console.log("FixedTimeTrigger.toRequest.request:", request.toObject());
|
|
7593
7579
|
return request;
|
|
7594
7580
|
}
|
|
7595
7581
|
static fromResponse(raw) {
|
|
7596
7582
|
const obj = raw.toObject();
|
|
7597
|
-
console.log("FixedTimeTrigger.fromResponse.obj:", obj);
|
|
7598
7583
|
return new _FixedTimeTrigger({
|
|
7599
7584
|
...obj,
|
|
7600
7585
|
type: "fixed_time" /* FixedTime */,
|
|
@@ -7887,6 +7872,7 @@ var BranchNode2 = class _BranchNode extends interface_default2 {
|
|
|
7887
7872
|
const conditionObj = new avs_pb14.Condition();
|
|
7888
7873
|
conditionObj.setId(condition.id);
|
|
7889
7874
|
conditionObj.setType(condition.type);
|
|
7875
|
+
conditionObj.setExpression(condition.expression);
|
|
7890
7876
|
return conditionObj;
|
|
7891
7877
|
})
|
|
7892
7878
|
);
|
|
@@ -8702,6 +8688,7 @@ var Client = class extends BaseClient {
|
|
|
8702
8688
|
Step,
|
|
8703
8689
|
Trigger,
|
|
8704
8690
|
TriggerFactory,
|
|
8691
|
+
TriggerMetadata,
|
|
8705
8692
|
TriggerType,
|
|
8706
8693
|
Workflow,
|
|
8707
8694
|
WorkflowStatus
|
package/dist/index.mjs
CHANGED
|
@@ -7340,13 +7340,13 @@ var require_avs_grpc_pb = __commonJS({
|
|
|
7340
7340
|
// src/index.ts
|
|
7341
7341
|
var import_avs_grpc_pb = __toESM(require_avs_grpc_pb());
|
|
7342
7342
|
var avs_pb20 = __toESM(require_avs_pb());
|
|
7343
|
-
import
|
|
7343
|
+
import _5 from "lodash";
|
|
7344
7344
|
import { credentials, Metadata } from "@grpc/grpc-js";
|
|
7345
7345
|
import { Timestamp } from "google-protobuf/google/protobuf/timestamp_pb";
|
|
7346
7346
|
|
|
7347
7347
|
// src/models/workflow.ts
|
|
7348
7348
|
var avs_pb16 = __toESM(require_avs_pb());
|
|
7349
|
-
import
|
|
7349
|
+
import _4 from "lodash";
|
|
7350
7350
|
|
|
7351
7351
|
// src/models/edge.ts
|
|
7352
7352
|
var avs_pb = __toESM(require_avs_pb());
|
|
@@ -7446,11 +7446,6 @@ var avs_pb4 = __toESM(require_avs_pb());
|
|
|
7446
7446
|
var CronTrigger = class _CronTrigger extends interface_default {
|
|
7447
7447
|
constructor(props) {
|
|
7448
7448
|
super({ ...props, type: "cron" /* Cron */, data: props.data });
|
|
7449
|
-
console.log("CronTrigger.constructor.props:", {
|
|
7450
|
-
...props,
|
|
7451
|
-
type: "cron" /* Cron */,
|
|
7452
|
-
data: props.data
|
|
7453
|
-
});
|
|
7454
7449
|
}
|
|
7455
7450
|
toRequest() {
|
|
7456
7451
|
const request = new avs_pb4.TaskTrigger();
|
|
@@ -7462,12 +7457,10 @@ var CronTrigger = class _CronTrigger extends interface_default {
|
|
|
7462
7457
|
const condition = new avs_pb4.CronCondition();
|
|
7463
7458
|
condition.setScheduleList(this.data.scheduleList);
|
|
7464
7459
|
request.setCron(condition);
|
|
7465
|
-
console.log("CronTrigger.toRequest.request:", request.toObject());
|
|
7466
7460
|
return request;
|
|
7467
7461
|
}
|
|
7468
7462
|
static fromResponse(raw) {
|
|
7469
7463
|
const obj = raw.toObject();
|
|
7470
|
-
console.log("CronTrigger.fromResponse.obj:", obj);
|
|
7471
7464
|
return new _CronTrigger({
|
|
7472
7465
|
...obj,
|
|
7473
7466
|
type: "cron" /* Cron */,
|
|
@@ -7479,14 +7472,10 @@ var cron_default = CronTrigger;
|
|
|
7479
7472
|
|
|
7480
7473
|
// src/models/trigger/event.ts
|
|
7481
7474
|
var avs_pb5 = __toESM(require_avs_pb());
|
|
7475
|
+
import * as _ from "lodash";
|
|
7482
7476
|
var EventTrigger = class _EventTrigger extends interface_default {
|
|
7483
7477
|
constructor(props) {
|
|
7484
7478
|
super({ ...props, type: "event" /* Event */, data: props.data });
|
|
7485
|
-
console.log("EventTrigger.constructor.props:", {
|
|
7486
|
-
...props,
|
|
7487
|
-
type: "event" /* Event */,
|
|
7488
|
-
data: props.data
|
|
7489
|
-
});
|
|
7490
7479
|
}
|
|
7491
7480
|
toRequest() {
|
|
7492
7481
|
const request = new avs_pb5.TaskTrigger();
|
|
@@ -7497,34 +7486,36 @@ var EventTrigger = class _EventTrigger extends interface_default {
|
|
|
7497
7486
|
}
|
|
7498
7487
|
const condition = new avs_pb5.EventCondition();
|
|
7499
7488
|
const expression = this.data.expression;
|
|
7500
|
-
const
|
|
7501
|
-
if (expression
|
|
7502
|
-
|
|
7489
|
+
const matcherList = this.data.matcherList;
|
|
7490
|
+
if (_.isUndefined(expression)) {
|
|
7491
|
+
throw new Error(`Expression is undefined for ${this.type}`);
|
|
7503
7492
|
}
|
|
7504
|
-
|
|
7505
|
-
|
|
7493
|
+
condition.setExpression(expression);
|
|
7494
|
+
if (_.isUndefined(matcherList)) {
|
|
7495
|
+
throw new Error(`Matcher list is undefined for ${this.type}`);
|
|
7496
|
+
}
|
|
7497
|
+
condition.setMatcherList(
|
|
7498
|
+
matcherList.map((element) => {
|
|
7506
7499
|
const m = new avs_pb5.EventCondition.Matcher();
|
|
7507
7500
|
m.setType(element["type"]);
|
|
7508
|
-
m.setValueList(element["
|
|
7501
|
+
m.setValueList(element["valueList"]);
|
|
7509
7502
|
return m;
|
|
7510
|
-
})
|
|
7511
|
-
|
|
7503
|
+
})
|
|
7504
|
+
);
|
|
7512
7505
|
request.setEvent(condition);
|
|
7513
|
-
console.log("EventTrigger.toRequest.request:", request.toObject());
|
|
7514
7506
|
return request;
|
|
7515
7507
|
}
|
|
7516
7508
|
static fromResponse(raw) {
|
|
7517
7509
|
const obj = raw.toObject();
|
|
7518
|
-
console.log("EventTrigger.fromResponse.obj:", obj);
|
|
7519
7510
|
let data = {};
|
|
7520
7511
|
if (raw.getEvent().getExpression()) {
|
|
7521
7512
|
data.expression = raw.getEvent().getExpression();
|
|
7522
7513
|
}
|
|
7523
7514
|
if (raw.getEvent().getMatcherList()) {
|
|
7524
|
-
data.
|
|
7515
|
+
data.matcherList = raw.getEvent().getMatcherList().map((item) => {
|
|
7525
7516
|
return {
|
|
7526
7517
|
type: item.getType(),
|
|
7527
|
-
|
|
7518
|
+
valueList: item.getValueList()
|
|
7528
7519
|
};
|
|
7529
7520
|
});
|
|
7530
7521
|
}
|
|
@@ -7542,11 +7533,6 @@ var avs_pb6 = __toESM(require_avs_pb());
|
|
|
7542
7533
|
var FixedTimeTrigger = class _FixedTimeTrigger extends interface_default {
|
|
7543
7534
|
constructor(props) {
|
|
7544
7535
|
super({ ...props, type: "fixed_time" /* FixedTime */, data: props.data });
|
|
7545
|
-
console.log("FixedTimeTrigger.constructor.props:", {
|
|
7546
|
-
...props,
|
|
7547
|
-
type: "fixed_time" /* FixedTime */,
|
|
7548
|
-
data: props.data
|
|
7549
|
-
});
|
|
7550
7536
|
}
|
|
7551
7537
|
toRequest() {
|
|
7552
7538
|
const request = new avs_pb6.TaskTrigger();
|
|
@@ -7558,12 +7544,10 @@ var FixedTimeTrigger = class _FixedTimeTrigger extends interface_default {
|
|
|
7558
7544
|
const condition = new avs_pb6.FixedTimeCondition();
|
|
7559
7545
|
condition.setEpochsList(this.data.epochsList);
|
|
7560
7546
|
request.setFixedTime(condition);
|
|
7561
|
-
console.log("FixedTimeTrigger.toRequest.request:", request.toObject());
|
|
7562
7547
|
return request;
|
|
7563
7548
|
}
|
|
7564
7549
|
static fromResponse(raw) {
|
|
7565
7550
|
const obj = raw.toObject();
|
|
7566
|
-
console.log("FixedTimeTrigger.fromResponse.obj:", obj);
|
|
7567
7551
|
return new _FixedTimeTrigger({
|
|
7568
7552
|
...obj,
|
|
7569
7553
|
type: "fixed_time" /* FixedTime */,
|
|
@@ -7616,12 +7600,12 @@ var TriggerFactory = class {
|
|
|
7616
7600
|
var factory_default = TriggerFactory;
|
|
7617
7601
|
|
|
7618
7602
|
// src/models/node/factory.ts
|
|
7619
|
-
import
|
|
7603
|
+
import _3 from "lodash";
|
|
7620
7604
|
|
|
7621
7605
|
// src/models/node/interface.ts
|
|
7622
7606
|
var avs_pb7 = __toESM(require_avs_pb());
|
|
7623
7607
|
import { NodeType } from "@avaprotocol/types";
|
|
7624
|
-
import
|
|
7608
|
+
import _2 from "lodash";
|
|
7625
7609
|
var Node = class {
|
|
7626
7610
|
constructor(props) {
|
|
7627
7611
|
this.id = props.id;
|
|
@@ -7633,7 +7617,7 @@ var Node = class {
|
|
|
7633
7617
|
const request = new avs_pb7.TaskNode();
|
|
7634
7618
|
const raw = request.serializeBinary();
|
|
7635
7619
|
const parsed = avs_pb7.TaskNode.deserializeBinary(raw);
|
|
7636
|
-
if (!
|
|
7620
|
+
if (!_2.isEqual(request, parsed)) {
|
|
7637
7621
|
throw new Error("Invalid request object");
|
|
7638
7622
|
}
|
|
7639
7623
|
return request;
|
|
@@ -7856,6 +7840,7 @@ var BranchNode2 = class _BranchNode extends interface_default2 {
|
|
|
7856
7840
|
const conditionObj = new avs_pb14.Condition();
|
|
7857
7841
|
conditionObj.setId(condition.id);
|
|
7858
7842
|
conditionObj.setType(condition.type);
|
|
7843
|
+
conditionObj.setExpression(condition.expression);
|
|
7859
7844
|
return conditionObj;
|
|
7860
7845
|
})
|
|
7861
7846
|
);
|
|
@@ -7920,7 +7905,7 @@ var NodeFactory = class {
|
|
|
7920
7905
|
}
|
|
7921
7906
|
}
|
|
7922
7907
|
static createNodes(props) {
|
|
7923
|
-
return
|
|
7908
|
+
return _3.map(props, (node) => this.create(node));
|
|
7924
7909
|
}
|
|
7925
7910
|
static fromResponse(raw) {
|
|
7926
7911
|
switch (true) {
|
|
@@ -7992,11 +7977,11 @@ var Workflow = class _Workflow {
|
|
|
7992
7977
|
if (!trigger) {
|
|
7993
7978
|
throw new Error("Trigger is undefined in fromResponse()");
|
|
7994
7979
|
}
|
|
7995
|
-
const nodes =
|
|
7980
|
+
const nodes = _4.map(
|
|
7996
7981
|
obj.getNodesList(),
|
|
7997
7982
|
(node) => factory_default2.fromResponse(node)
|
|
7998
7983
|
);
|
|
7999
|
-
const edges =
|
|
7984
|
+
const edges = _4.map(obj.getEdgesList(), (edge) => edge_default.fromResponse(edge));
|
|
8000
7985
|
const workflow = new _Workflow({
|
|
8001
7986
|
id: obj.getId(),
|
|
8002
7987
|
owner: obj.getOwner(),
|
|
@@ -8045,8 +8030,8 @@ var Workflow = class _Workflow {
|
|
|
8045
8030
|
const request = new avs_pb16.CreateTaskReq();
|
|
8046
8031
|
request.setSmartWalletAddress(this.smartWalletAddress);
|
|
8047
8032
|
request.setTrigger(this.trigger.toRequest());
|
|
8048
|
-
|
|
8049
|
-
|
|
8033
|
+
_4.map(this.nodes, (node) => request.addNodes(node.toRequest()));
|
|
8034
|
+
_4.map(this.edges, (edge) => request.addEdges(edge.toRequest()));
|
|
8050
8035
|
request.setStartAt(this.startAt);
|
|
8051
8036
|
request.setExpiredAt(this.expiredAt);
|
|
8052
8037
|
request.setMaxExecution(this.maxExecution);
|
|
@@ -8354,7 +8339,7 @@ var BaseClient = class {
|
|
|
8354
8339
|
* @returns {Promise<TResponse>} - The response from the gRPC call
|
|
8355
8340
|
*/
|
|
8356
8341
|
sendGrpcRequest(method, request, options) {
|
|
8357
|
-
const metadata =
|
|
8342
|
+
const metadata = _5.cloneDeep(this.metadata);
|
|
8358
8343
|
if (options?.authKey) {
|
|
8359
8344
|
metadata.set(AUTH_KEY_HEADER, options.authKey);
|
|
8360
8345
|
} else if (this.authKey) {
|
|
@@ -8670,6 +8655,7 @@ export {
|
|
|
8670
8655
|
step_default as Step,
|
|
8671
8656
|
interface_default as Trigger,
|
|
8672
8657
|
factory_default as TriggerFactory,
|
|
8658
|
+
metadata_default as TriggerMetadata,
|
|
8673
8659
|
TriggerType,
|
|
8674
8660
|
workflow_default as Workflow,
|
|
8675
8661
|
WorkflowStatus,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avaprotocol/sdk-js",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.6",
|
|
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",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
".": {
|
|
14
14
|
"types": "./dist/index.d.ts",
|
|
15
15
|
"import": "./dist/index.js",
|
|
16
|
-
"require": "./dist/index.
|
|
16
|
+
"require": "./dist/index.js"
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"author": "Vinh Nguyen (https://github.com/v9n), Chris Li (https://github.com/chrisli30)",
|