@avaprotocol/sdk-js 2.0.4 → 2.1.1
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 +12 -0
- package/dist/auth.d.ts +2 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +10 -0
- package/dist/config.d.ts +9 -0
- package/dist/index.js +695 -147
- package/dist/index.mjs +706 -158
- package/dist/models/node/contractRead.d.ts.map +1 -1
- package/dist/models/node/contractRead.js +22 -5
- package/dist/models/node/loop.d.ts.map +1 -1
- package/dist/models/node/loop.js +10 -1
- package/dist/models/secret.d.ts +16 -0
- package/dist/models/step.d.ts.map +1 -1
- package/dist/models/step.js +33 -4
- package/dist/models/trigger/event.d.ts.map +1 -1
- package/dist/models/trigger/event.js +74 -27
- package/dist/utils.d.ts +60 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contractRead.d.ts","sourceRoot":"","sources":["../../../src/models/node/contractRead.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAkC,qBAAqB,EAAa,MAAM,oBAAoB,CAAC;AAMtG,cAAM,gBAAiB,SAAQ,IAAI;gBACrB,KAAK,EAAE,qBAAqB;IAIxC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,gBAAgB;IAU3D,SAAS,IAAI,MAAM,CAAC,QAAQ;
|
|
1
|
+
{"version":3,"file":"contractRead.d.ts","sourceRoot":"","sources":["../../../src/models/node/contractRead.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAkC,qBAAqB,EAAa,MAAM,oBAAoB,CAAC;AAMtG,cAAM,gBAAiB,SAAQ,IAAI;gBACrB,KAAK,EAAE,qBAAqB;IAIxC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,gBAAgB;IAU3D,SAAS,IAAI,MAAM,CAAC,QAAQ;IA8B5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAmBrE;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
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
|
-
import { convertProtobufValueToJs } from "../../utils";
|
|
5
4
|
// Required props for constructor: id, name, type and data
|
|
6
5
|
class ContractReadNode extends Node {
|
|
7
6
|
constructor(props) {
|
|
@@ -23,18 +22,36 @@ class ContractReadNode extends Node {
|
|
|
23
22
|
const nodeData = new avs_pb.ContractReadNode();
|
|
24
23
|
const config = new avs_pb.ContractReadNode.Config();
|
|
25
24
|
config.setContractAddress(this.data.contractAddress);
|
|
26
|
-
config.setCallData(this.data.callData);
|
|
27
25
|
config.setContractAbi(this.data.contractAbi);
|
|
26
|
+
// Handle method calls array - use camelCase property name from protobuf AsObject
|
|
27
|
+
const methodCalls = this.data.methodCallsList || [];
|
|
28
|
+
methodCalls.forEach((methodCall) => {
|
|
29
|
+
const methodCallMsg = new avs_pb.ContractReadNode.MethodCall();
|
|
30
|
+
methodCallMsg.setCallData(methodCall.callData);
|
|
31
|
+
if (methodCall.methodName) {
|
|
32
|
+
methodCallMsg.setMethodName(methodCall.methodName);
|
|
33
|
+
}
|
|
34
|
+
config.addMethodCalls(methodCallMsg);
|
|
35
|
+
});
|
|
28
36
|
nodeData.setConfig(config);
|
|
29
37
|
request.setContractRead(nodeData);
|
|
30
38
|
return request;
|
|
31
39
|
}
|
|
32
40
|
static fromOutputData(outputData) {
|
|
33
41
|
const contractReadOutput = outputData.getContractRead();
|
|
34
|
-
if (contractReadOutput && contractReadOutput.
|
|
35
|
-
const
|
|
42
|
+
if (contractReadOutput && contractReadOutput.getResultsList()) {
|
|
43
|
+
const resultsList = contractReadOutput.getResultsList();
|
|
36
44
|
return {
|
|
37
|
-
|
|
45
|
+
results: resultsList.map((result) => ({
|
|
46
|
+
methodName: result.getMethodName(),
|
|
47
|
+
success: result.getSuccess(),
|
|
48
|
+
error: result.getError(),
|
|
49
|
+
data: result.getDataList().map((field) => ({
|
|
50
|
+
name: field.getName(),
|
|
51
|
+
type: field.getType(),
|
|
52
|
+
value: field.getValue()
|
|
53
|
+
}))
|
|
54
|
+
}))
|
|
38
55
|
};
|
|
39
56
|
}
|
|
40
57
|
return null;
|
|
@@ -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;AAC/B,OAAO,EAA0B,aAAa,EAAa,MAAM,oBAAoB,CAAC;AAKtF,cAAM,QAAS,SAAQ,IAAI;gBACb,KAAK,EAAE,aAAa;IAIhC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,QAAQ;IA+BnD,SAAS,IAAI,MAAM,CAAC,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;AAC/B,OAAO,EAA0B,aAAa,EAAa,MAAM,oBAAoB,CAAC;AAKtF,cAAM,QAAS,SAAQ,IAAI;gBACb,KAAK,EAAE,aAAa;IAIhC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,GAAG,QAAQ;IA+BnD,SAAS,IAAI,MAAM,CAAC,QAAQ;IA6G5B,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,qBAAqB,GAAG,GAAG;CAIrE;AAED,eAAe,QAAQ,CAAC"}
|
package/dist/models/node/loop.js
CHANGED
|
@@ -71,8 +71,17 @@ class LoopNode extends Node {
|
|
|
71
71
|
if (data.contractRead.config) {
|
|
72
72
|
const config = new avs_pb.ContractReadNode.Config();
|
|
73
73
|
config.setContractAddress(data.contractRead.config.contractAddress);
|
|
74
|
-
config.setCallData(data.contractRead.config.callData);
|
|
75
74
|
config.setContractAbi(data.contractRead.config.contractAbi);
|
|
75
|
+
// Handle method calls array
|
|
76
|
+
const methodCalls = data.contractRead.config.methodCallsList || [];
|
|
77
|
+
methodCalls.forEach((methodCall) => {
|
|
78
|
+
const methodCallMsg = new avs_pb.ContractReadNode.MethodCall();
|
|
79
|
+
methodCallMsg.setCallData(methodCall.callData);
|
|
80
|
+
if (methodCall.methodName) {
|
|
81
|
+
methodCallMsg.setMethodName(methodCall.methodName);
|
|
82
|
+
}
|
|
83
|
+
config.addMethodCalls(methodCallMsg);
|
|
84
|
+
});
|
|
76
85
|
contractRead.setConfig(config);
|
|
77
86
|
}
|
|
78
87
|
loopNode.setContractRead(contractRead);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
2
|
+
import { SecretProps } from "@avaprotocol/types";
|
|
3
|
+
declare class Secret implements SecretProps {
|
|
4
|
+
name: string;
|
|
5
|
+
secret?: string;
|
|
6
|
+
workflowId?: string;
|
|
7
|
+
orgId?: string;
|
|
8
|
+
createdAt?: number;
|
|
9
|
+
updatedAt?: number;
|
|
10
|
+
createdBy?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
constructor(props: SecretProps);
|
|
13
|
+
toRequest(): avs_pb.CreateOrUpdateSecretReq;
|
|
14
|
+
}
|
|
15
|
+
export default Secret;
|
|
16
|
+
//# sourceMappingURL=secret.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../src/models/step.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAKhD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAEhE,cAAM,IAAK,YAAW,SAAS;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,eAAe,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;gBAEF,KAAK,EAAE,SAAS;IAa5B;;;OAGG;IACH,MAAM,IAAI,SAAS;IAenB,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,eAAe;
|
|
1
|
+
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../src/models/step.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAKhD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAEhE,cAAM,IAAK,YAAW,SAAS;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,eAAe,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;gBAEF,KAAK,EAAE,SAAS;IAa5B;;;OAGG;IACH,MAAM,IAAI,SAAS;IAenB,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,eAAe;IA0H9D,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI;CAgBvD;AAED,eAAe,IAAI,CAAC"}
|
package/dist/models/step.js
CHANGED
|
@@ -89,11 +89,40 @@ class Step {
|
|
|
89
89
|
case avs_pb.Execution.Step.OutputDataCase.CONTRACT_READ:
|
|
90
90
|
nodeOutputMessage = step.getContractRead();
|
|
91
91
|
if (nodeOutputMessage) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
const results = nodeOutputMessage.getResultsList();
|
|
93
|
+
if (results && results.length > 0) {
|
|
94
|
+
// If single result, return it directly for backward compatibility
|
|
95
|
+
if (results.length === 1) {
|
|
96
|
+
const result = results[0];
|
|
97
|
+
const structuredData = {};
|
|
98
|
+
result.getDataList().forEach((field) => {
|
|
99
|
+
structuredData[field.getName()] = field.getValue();
|
|
100
|
+
});
|
|
101
|
+
return {
|
|
102
|
+
methodName: result.getMethodName(),
|
|
103
|
+
success: result.getSuccess(),
|
|
104
|
+
error: result.getError(),
|
|
105
|
+
data: structuredData,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
// Multiple results - return as array
|
|
110
|
+
return results.map((result) => {
|
|
111
|
+
const structuredData = {};
|
|
112
|
+
result.getDataList().forEach((field) => {
|
|
113
|
+
structuredData[field.getName()] = field.getValue();
|
|
114
|
+
});
|
|
115
|
+
return {
|
|
116
|
+
methodName: result.getMethodName(),
|
|
117
|
+
success: result.getSuccess(),
|
|
118
|
+
error: result.getError(),
|
|
119
|
+
data: structuredData,
|
|
120
|
+
};
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}
|
|
95
124
|
}
|
|
96
|
-
return
|
|
125
|
+
return undefined;
|
|
97
126
|
case avs_pb.Execution.Step.OutputDataCase.CONTRACT_WRITE:
|
|
98
127
|
return step.getContractWrite()?.toObject();
|
|
99
128
|
case avs_pb.Execution.Step.OutputDataCase.CUSTOM_CODE:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/event.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,OAA0B,MAAM,aAAa,CAAC;AACrD,OAAO,EAAqC,kBAAkB,EAAE,iBAAiB,EAAgB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../../src/models/trigger/event.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,OAA0B,MAAM,aAAa,CAAC;AACrD,OAAO,EAAqC,kBAAkB,EAAE,iBAAiB,EAAgB,MAAM,oBAAoB,CAAC;AA6C5H,cAAM,YAAa,SAAQ,OAAO;gBACpB,KAAK,EAAE,iBAAiB;IAIpC,SAAS,IAAI,MAAM,CAAC,WAAW;IAuD/B,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,GAAG,YAAY;IAoD1D;;;;OAIG;IACH,SAAS,IAAI,kBAAkB,GAAG,SAAS;IAI3C;;;;OAIG;IACH,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,cAAc,GAAG,GAAG;CAW9D;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as _ from "lodash";
|
|
2
1
|
import * as avs_pb from "@/grpc_codegen/avs_pb";
|
|
3
2
|
import Trigger from "./interface";
|
|
4
3
|
import { TriggerType } from "@avaprotocol/types";
|
|
@@ -20,7 +19,28 @@ import { TriggerType } from "@avaprotocol/types";
|
|
|
20
19
|
// }
|
|
21
20
|
// ]
|
|
22
21
|
// ```
|
|
23
|
-
// Required props for constructor: id, name, type and data: {
|
|
22
|
+
// Required props for constructor: id, name, type and data: { queriesList }
|
|
23
|
+
// EventTrigger now uses queries-based filtering instead of expression/matcher
|
|
24
|
+
// Each query represents an independent filter that creates its own subscription
|
|
25
|
+
// For FROM-OR-TO scenarios, provide two queries: one for FROM, one for TO.
|
|
26
|
+
//
|
|
27
|
+
// Example queries structure:
|
|
28
|
+
// ```
|
|
29
|
+
// [
|
|
30
|
+
// {
|
|
31
|
+
// addressesList: ["0xA0b86a33E6441e6067ec0da4Cc2C8ae77d85e7b1"],
|
|
32
|
+
// topicsList: [
|
|
33
|
+
// {
|
|
34
|
+
// valuesList: [
|
|
35
|
+
// "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
|
|
36
|
+
// null,
|
|
37
|
+
// "0x000000000000000000000000c60e71bd0f2e6d8832fea1a2d56091c48493c788"
|
|
38
|
+
// ]
|
|
39
|
+
// }
|
|
40
|
+
// ]
|
|
41
|
+
// }
|
|
42
|
+
// ]
|
|
43
|
+
// ```
|
|
24
44
|
class EventTrigger extends Trigger {
|
|
25
45
|
constructor(props) {
|
|
26
46
|
super({ ...props, type: TriggerType.Event, data: props.data });
|
|
@@ -34,23 +54,36 @@ class EventTrigger extends Trigger {
|
|
|
34
54
|
throw new Error(`Trigger data is missing for ${this.type}`);
|
|
35
55
|
}
|
|
36
56
|
const trigger = new avs_pb.EventTrigger();
|
|
37
|
-
const dataConfig = this.data;
|
|
38
57
|
const config = new avs_pb.EventTrigger.Config();
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
if (
|
|
42
|
-
throw new Error(`
|
|
43
|
-
}
|
|
44
|
-
config.setExpression(expression);
|
|
45
|
-
if (matcherList && matcherList.length > 0) {
|
|
46
|
-
const matchers = matcherList.map((element) => {
|
|
47
|
-
const m = new avs_pb.EventTrigger.Matcher();
|
|
48
|
-
m.setType(element.type);
|
|
49
|
-
m.setValueList(element.valueList || []);
|
|
50
|
-
return m;
|
|
51
|
-
});
|
|
52
|
-
config.setMatcherList(matchers);
|
|
58
|
+
const dataConfig = this.data;
|
|
59
|
+
const queries = dataConfig.queriesList;
|
|
60
|
+
if (!queries || queries.length === 0) {
|
|
61
|
+
throw new Error(`Queries array is required for ${this.type}`);
|
|
53
62
|
}
|
|
63
|
+
const queryMessages = queries.map((queryData) => {
|
|
64
|
+
const query = new avs_pb.EventTrigger.Query();
|
|
65
|
+
// Set addresses if provided
|
|
66
|
+
if (queryData.addressesList && queryData.addressesList.length > 0) {
|
|
67
|
+
query.setAddressesList(queryData.addressesList);
|
|
68
|
+
}
|
|
69
|
+
// Set topics if provided
|
|
70
|
+
if (queryData.topicsList && queryData.topicsList.length > 0) {
|
|
71
|
+
const topicsMessages = queryData.topicsList.map((topicData) => {
|
|
72
|
+
const topics = new avs_pb.EventTrigger.Topics();
|
|
73
|
+
if (topicData.valuesList) {
|
|
74
|
+
topics.setValuesList(topicData.valuesList);
|
|
75
|
+
}
|
|
76
|
+
return topics;
|
|
77
|
+
});
|
|
78
|
+
query.setTopicsList(topicsMessages);
|
|
79
|
+
}
|
|
80
|
+
// Set maxEventsPerBlock if provided
|
|
81
|
+
if (queryData.maxEventsPerBlock !== undefined) {
|
|
82
|
+
query.setMaxEventsPerBlock(queryData.maxEventsPerBlock);
|
|
83
|
+
}
|
|
84
|
+
return query;
|
|
85
|
+
});
|
|
86
|
+
config.setQueriesList(queryMessages);
|
|
54
87
|
trigger.setConfig(config);
|
|
55
88
|
request.setEvent(trigger);
|
|
56
89
|
return request;
|
|
@@ -58,22 +91,36 @@ class EventTrigger extends Trigger {
|
|
|
58
91
|
static fromResponse(raw) {
|
|
59
92
|
// Convert the raw object to TriggerProps, which should keep name and id
|
|
60
93
|
const obj = raw.toObject();
|
|
61
|
-
let data = {
|
|
94
|
+
let data = { queriesList: [] };
|
|
62
95
|
if (raw.getEvent() && raw.getEvent().hasConfig()) {
|
|
63
96
|
const config = raw.getEvent().getConfig();
|
|
64
97
|
if (config) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
return {
|
|
72
|
-
type: item.getType(),
|
|
73
|
-
valueList: item.getValueList() || [],
|
|
98
|
+
const queries = [];
|
|
99
|
+
if (config.getQueriesList && config.getQueriesList().length > 0) {
|
|
100
|
+
config.getQueriesList().forEach((query) => {
|
|
101
|
+
const queryData = {
|
|
102
|
+
addressesList: [],
|
|
103
|
+
topicsList: [],
|
|
74
104
|
};
|
|
105
|
+
// Extract addresses
|
|
106
|
+
if (query.getAddressesList && query.getAddressesList().length > 0) {
|
|
107
|
+
queryData.addressesList = query.getAddressesList();
|
|
108
|
+
}
|
|
109
|
+
// Extract topics
|
|
110
|
+
if (query.getTopicsList && query.getTopicsList().length > 0) {
|
|
111
|
+
queryData.topicsList = query.getTopicsList().map((topics) => ({
|
|
112
|
+
valuesList: topics.getValuesList() || []
|
|
113
|
+
}));
|
|
114
|
+
}
|
|
115
|
+
// Extract maxEventsPerBlock
|
|
116
|
+
const maxEvents = query.getMaxEventsPerBlock();
|
|
117
|
+
if (maxEvents && maxEvents > 0) {
|
|
118
|
+
queryData.maxEventsPerBlock = maxEvents;
|
|
119
|
+
}
|
|
120
|
+
queries.push(queryData);
|
|
75
121
|
});
|
|
76
122
|
}
|
|
123
|
+
data = { queriesList: queries };
|
|
77
124
|
}
|
|
78
125
|
}
|
|
79
126
|
return new EventTrigger({
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Value as ProtobufValue } from "google-protobuf/google/protobuf/struct_pb";
|
|
2
|
+
/**
|
|
3
|
+
* Convert a protobuf Value to a JavaScript value
|
|
4
|
+
*
|
|
5
|
+
* **🏆 RECOMMENDED for modern protobuf usage**
|
|
6
|
+
*
|
|
7
|
+
* This is the primary implementation using proper TypeScript types and getKindCase()
|
|
8
|
+
* for the latest protobuf libraries. Use this for all new code.
|
|
9
|
+
*
|
|
10
|
+
* @param value - The protobuf Value to convert
|
|
11
|
+
* @returns The converted JavaScript value
|
|
12
|
+
*/
|
|
13
|
+
export declare function convertProtobufValueToJs(value?: ProtobufValue): any;
|
|
14
|
+
/**
|
|
15
|
+
* Convert a protobuf Value to a JavaScript value
|
|
16
|
+
*
|
|
17
|
+
* **⚠️ DEPRECATED - Use convertProtobufValueToJs() for new code**
|
|
18
|
+
*
|
|
19
|
+
* This is a legacy compatibility version for existing code that may use
|
|
20
|
+
* dynamically typed protobuf objects. It uses older has*() methods and
|
|
21
|
+
* fallback logic. Only use this if you need backward compatibility.
|
|
22
|
+
*
|
|
23
|
+
* @deprecated Use convertProtobufValueToJs() instead for better type safety
|
|
24
|
+
* @param value - The protobuf Value object (may be dynamically typed)
|
|
25
|
+
* @returns The converted JavaScript value
|
|
26
|
+
*/
|
|
27
|
+
export declare function convertProtobufValueToJS(value: any): any;
|
|
28
|
+
/**
|
|
29
|
+
* Convert a JavaScript value to a protobuf Value
|
|
30
|
+
*
|
|
31
|
+
* Uses proper TypeScript types for modern protobuf usage.
|
|
32
|
+
*
|
|
33
|
+
* @param value - The JavaScript value to convert
|
|
34
|
+
* @returns The protobuf Value object
|
|
35
|
+
*/
|
|
36
|
+
export declare function convertJSValueToProtobuf(value: any): ProtobufValue;
|
|
37
|
+
/**
|
|
38
|
+
* Convert protobuf trigger type string to SDK trigger type string
|
|
39
|
+
*
|
|
40
|
+
* @param protobufType - The protobuf trigger type string (e.g., "TRIGGER_TYPE_MANUAL")
|
|
41
|
+
* @returns The SDK trigger type string (e.g., "manualTrigger")
|
|
42
|
+
*/
|
|
43
|
+
export declare function convertProtobufTriggerTypeToSdk(protobufType: string): string;
|
|
44
|
+
/**
|
|
45
|
+
* Convert protobuf node type string to SDK node type string
|
|
46
|
+
*
|
|
47
|
+
* @param protobufType - The protobuf node type string (e.g., "NODE_TYPE_CUSTOM_CODE")
|
|
48
|
+
* @returns The SDK node type string (e.g., "customCode")
|
|
49
|
+
*/
|
|
50
|
+
export declare function convertProtobufNodeTypeToSdk(protobufType: string): string;
|
|
51
|
+
/**
|
|
52
|
+
* Convert protobuf step type string to SDK step type string
|
|
53
|
+
*
|
|
54
|
+
* Automatically detects whether the type is a trigger or node type and converts accordingly.
|
|
55
|
+
*
|
|
56
|
+
* @param protobufType - The protobuf type string (e.g., "TRIGGER_TYPE_MANUAL" or "NODE_TYPE_CUSTOM_CODE")
|
|
57
|
+
* @returns The SDK type string (e.g., "manualTrigger" or "customCode")
|
|
58
|
+
*/
|
|
59
|
+
export declare function convertProtobufStepTypeToSdk(protobufType: string): string;
|
|
60
|
+
//# sourceMappingURL=utils.d.ts.map
|
package/package.json
CHANGED