@abyss-project/console 1.0.29 → 1.0.31
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/expressions/functions/array.d.ts +2 -0
- package/dist/expressions/functions/array.js +252 -0
- package/dist/expressions/functions/crypto.d.ts +2 -0
- package/dist/expressions/functions/crypto.js +101 -0
- package/dist/expressions/functions/datetime.d.ts +2 -0
- package/dist/expressions/functions/datetime.js +256 -0
- package/dist/expressions/functions/index.d.ts +7 -0
- package/dist/expressions/functions/index.js +46 -0
- package/dist/expressions/functions/math.d.ts +2 -0
- package/dist/expressions/functions/math.js +174 -0
- package/dist/expressions/functions/string.d.ts +2 -0
- package/dist/expressions/functions/string.js +301 -0
- package/dist/expressions/functions/utility.d.ts +2 -0
- package/dist/expressions/functions/utility.js +230 -0
- package/dist/expressions/helpers.d.ts +26 -0
- package/dist/expressions/helpers.js +132 -0
- package/dist/expressions/index.d.ts +5 -0
- package/dist/expressions/index.js +16 -0
- package/dist/expressions/mapper.d.ts +9 -0
- package/dist/expressions/mapper.js +88 -0
- package/dist/expressions/parser.d.ts +3 -0
- package/dist/expressions/parser.js +97 -0
- package/dist/expressions/pipes/array-pipes.d.ts +2 -0
- package/dist/expressions/pipes/array-pipes.js +248 -0
- package/dist/expressions/pipes/index.d.ts +8 -0
- package/dist/expressions/pipes/index.js +40 -0
- package/dist/expressions/pipes/object-pipes.d.ts +2 -0
- package/dist/expressions/pipes/object-pipes.js +243 -0
- package/dist/expressions/pipes/string-pipes.d.ts +9 -0
- package/dist/expressions/pipes/string-pipes.js +178 -0
- package/dist/expressions/resolver.d.ts +12 -0
- package/dist/expressions/resolver.js +88 -0
- package/dist/expressions/types.d.ts +36 -0
- package/dist/expressions/types.js +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -1
- package/dist/utils/webhook-trigger.utils.js +10 -6
- package/dist/workflow-expressions/functions/array.d.ts +2 -0
- package/dist/workflow-expressions/functions/array.js +252 -0
- package/dist/workflow-expressions/functions/crypto.d.ts +2 -0
- package/dist/workflow-expressions/functions/crypto.js +101 -0
- package/dist/workflow-expressions/functions/datetime.d.ts +2 -0
- package/dist/workflow-expressions/functions/datetime.js +256 -0
- package/dist/workflow-expressions/functions/index.d.ts +7 -0
- package/dist/workflow-expressions/functions/index.js +46 -0
- package/dist/workflow-expressions/functions/math.d.ts +2 -0
- package/dist/workflow-expressions/functions/math.js +174 -0
- package/dist/workflow-expressions/functions/string.d.ts +2 -0
- package/dist/workflow-expressions/functions/string.js +301 -0
- package/dist/workflow-expressions/functions/utility.d.ts +2 -0
- package/dist/workflow-expressions/functions/utility.js +230 -0
- package/dist/workflow-expressions/helpers.d.ts +71 -0
- package/dist/workflow-expressions/helpers.js +262 -0
- package/dist/workflow-expressions/index.d.ts +16 -0
- package/dist/workflow-expressions/index.js +66 -0
- package/dist/workflow-expressions/parser.d.ts +8 -0
- package/dist/workflow-expressions/parser.js +456 -0
- package/dist/workflow-expressions/pipes/array-pipes.d.ts +2 -0
- package/dist/workflow-expressions/pipes/array-pipes.js +248 -0
- package/dist/workflow-expressions/pipes/index.d.ts +8 -0
- package/dist/workflow-expressions/pipes/index.js +40 -0
- package/dist/workflow-expressions/pipes/object-pipes.d.ts +2 -0
- package/dist/workflow-expressions/pipes/object-pipes.js +243 -0
- package/dist/workflow-expressions/pipes/string-pipes.d.ts +9 -0
- package/dist/workflow-expressions/pipes/string-pipes.js +178 -0
- package/dist/workflow-expressions/resolver.d.ts +8 -0
- package/dist/workflow-expressions/resolver.js +260 -0
- package/dist/workflow-expressions/types.d.ts +141 -0
- package/dist/workflow-expressions/types.js +33 -0
- package/package.json +2 -1
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getValueType = exports.convertExpressionToDisplayFormat = exports.convertExpressionToSaveFormat = exports.generatePreview = exports.validateExpression = exports.tokenizeEnriched = exports.getCurrentExpressionContext = exports.parseOperations = exports.extractPaths = exports.isInsideExpression = exports.hasReferences = exports.hasExpressions = exports.buildReferenceString = exports.buildExpressionString = void 0;
|
|
4
|
+
const types_1 = require("./types");
|
|
5
|
+
const parser_1 = require("./parser");
|
|
6
|
+
const parser_2 = require("./parser");
|
|
7
|
+
const resolver_1 = require("./resolver");
|
|
8
|
+
const parser_3 = require("./parser");
|
|
9
|
+
function buildExpressionString(path, operations) {
|
|
10
|
+
let expr = `{{${path}`;
|
|
11
|
+
if (operations && operations.length > 0) {
|
|
12
|
+
const opsStr = operations
|
|
13
|
+
.map((op) => {
|
|
14
|
+
if (op.args.length === 0) {
|
|
15
|
+
return op.name;
|
|
16
|
+
}
|
|
17
|
+
const argsStr = op.args
|
|
18
|
+
.map((arg) => (typeof arg === 'string' ? `"${arg}"` : String(arg)))
|
|
19
|
+
.join(', ');
|
|
20
|
+
return `${op.name}(${argsStr})`;
|
|
21
|
+
})
|
|
22
|
+
.join(' | ');
|
|
23
|
+
expr += ` | ${opsStr}`;
|
|
24
|
+
}
|
|
25
|
+
expr += '}}';
|
|
26
|
+
return expr;
|
|
27
|
+
}
|
|
28
|
+
exports.buildExpressionString = buildExpressionString;
|
|
29
|
+
function buildReferenceString(type, id) {
|
|
30
|
+
return `@${type}:${id}`;
|
|
31
|
+
}
|
|
32
|
+
exports.buildReferenceString = buildReferenceString;
|
|
33
|
+
function hasExpressions(str) {
|
|
34
|
+
return /\{\{.+?\}\}/.test(str);
|
|
35
|
+
}
|
|
36
|
+
exports.hasExpressions = hasExpressions;
|
|
37
|
+
function hasReferences(str) {
|
|
38
|
+
return /@\w+:[a-zA-Z0-9-_]+/.test(str);
|
|
39
|
+
}
|
|
40
|
+
exports.hasReferences = hasReferences;
|
|
41
|
+
function isInsideExpression(text, cursorPos) {
|
|
42
|
+
const beforeCursor = text.substring(0, cursorPos);
|
|
43
|
+
const lastOpenBrace = beforeCursor.lastIndexOf('{{');
|
|
44
|
+
const lastCloseBrace = beforeCursor.lastIndexOf('}}');
|
|
45
|
+
return lastOpenBrace > lastCloseBrace && lastOpenBrace !== -1;
|
|
46
|
+
}
|
|
47
|
+
exports.isInsideExpression = isInsideExpression;
|
|
48
|
+
function extractPaths(str) {
|
|
49
|
+
const matches = str.matchAll(/\{\{(.+?)\}\}/g);
|
|
50
|
+
return Array.from(matches, (m) => {
|
|
51
|
+
const expr = m[1].trim();
|
|
52
|
+
const [path] = expr.split('|');
|
|
53
|
+
return path.trim();
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
exports.extractPaths = extractPaths;
|
|
57
|
+
function parseOperations(opsStr) {
|
|
58
|
+
if (!opsStr || !opsStr.trim()) {
|
|
59
|
+
return [];
|
|
60
|
+
}
|
|
61
|
+
const operations = [];
|
|
62
|
+
const parts = opsStr.split('|').map((p) => p.trim());
|
|
63
|
+
for (const part of parts) {
|
|
64
|
+
if (!part) {
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
const match = part.match(/^(\w+)(?:\(([^)]*)\))?$/);
|
|
68
|
+
if (match) {
|
|
69
|
+
const [, name, argsStr] = match;
|
|
70
|
+
const args = [];
|
|
71
|
+
if (argsStr) {
|
|
72
|
+
const argParts = argsStr.split(',').map((a) => a.trim());
|
|
73
|
+
for (const arg of argParts) {
|
|
74
|
+
if (arg.startsWith('"') || arg.startsWith("'")) {
|
|
75
|
+
args.push(arg.slice(1, -1));
|
|
76
|
+
}
|
|
77
|
+
else if (!isNaN(Number(arg))) {
|
|
78
|
+
args.push(Number(arg));
|
|
79
|
+
}
|
|
80
|
+
else if (arg === 'true' || arg === 'false') {
|
|
81
|
+
args.push(arg === 'true');
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
args.push(arg);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
operations.push({ name, args });
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return operations;
|
|
92
|
+
}
|
|
93
|
+
exports.parseOperations = parseOperations;
|
|
94
|
+
function getCurrentExpressionContext(text, cursorPos) {
|
|
95
|
+
if (!isInsideExpression(text, cursorPos)) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
const beforeCursor = text.substring(0, cursorPos);
|
|
99
|
+
const afterCursor = text.substring(cursorPos);
|
|
100
|
+
const start = beforeCursor.lastIndexOf('{{') + 2;
|
|
101
|
+
const endMatch = afterCursor.match(/\}\}/);
|
|
102
|
+
const end = endMatch && endMatch.index !== undefined ? cursorPos + endMatch.index : text.length;
|
|
103
|
+
const expression = text.substring(start, end);
|
|
104
|
+
const [path] = expression.split('|');
|
|
105
|
+
const expressionContent = expression.trim();
|
|
106
|
+
const cursorOffsetInExpression = cursorPos - start;
|
|
107
|
+
const contentUpToCursor = expression.substring(0, cursorOffsetInExpression);
|
|
108
|
+
const match = contentUpToCursor.match(/([a-zA-Z_][a-zA-Z0-9_]*(?:\["[^"]*"\]|\['[^']*'\]|\[[^\]]*\]|\.(?:[a-zA-Z_][a-zA-Z0-9_]*))*\.?[a-zA-Z0-9_]*)$/);
|
|
109
|
+
const currentPath = match && match[1] ? match[1] : '';
|
|
110
|
+
return {
|
|
111
|
+
isInExpression: true,
|
|
112
|
+
expressionStart: start,
|
|
113
|
+
expressionContent,
|
|
114
|
+
cursorOffsetInExpression,
|
|
115
|
+
currentPath,
|
|
116
|
+
expression: expression.trim(),
|
|
117
|
+
start,
|
|
118
|
+
end,
|
|
119
|
+
path: path.trim(),
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
exports.getCurrentExpressionContext = getCurrentExpressionContext;
|
|
123
|
+
function tokenizeEnriched(template) {
|
|
124
|
+
const backendTokens = (0, parser_1.tokenizeTemplate)(template);
|
|
125
|
+
const result = [];
|
|
126
|
+
let currentPos = 0;
|
|
127
|
+
for (const token of backendTokens) {
|
|
128
|
+
if (token.type === 'text') {
|
|
129
|
+
result.push({
|
|
130
|
+
type: 'text',
|
|
131
|
+
value: token.value,
|
|
132
|
+
rawValue: token.value,
|
|
133
|
+
start: currentPos,
|
|
134
|
+
end: currentPos + token.value.length,
|
|
135
|
+
});
|
|
136
|
+
currentPos += token.value.length;
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
const exprValue = token.value.trim();
|
|
140
|
+
const parsed = (0, parser_2.parseExpression)(exprValue);
|
|
141
|
+
const source = (0, parser_3.detectDataSource)(exprValue);
|
|
142
|
+
const rawValue = `{{${token.value}}}`;
|
|
143
|
+
result.push({
|
|
144
|
+
type: parsed.isValid ? 'expression' : 'error',
|
|
145
|
+
value: exprValue,
|
|
146
|
+
rawValue: rawValue,
|
|
147
|
+
start: currentPos,
|
|
148
|
+
end: currentPos + rawValue.length,
|
|
149
|
+
parsed,
|
|
150
|
+
source,
|
|
151
|
+
isSecret: source === types_1.DataSourceType.SECRETS,
|
|
152
|
+
});
|
|
153
|
+
currentPos += rawValue.length;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return result;
|
|
157
|
+
}
|
|
158
|
+
exports.tokenizeEnriched = tokenizeEnriched;
|
|
159
|
+
function validateExpression(expression, context) {
|
|
160
|
+
const tokens = tokenizeEnriched(expression);
|
|
161
|
+
try {
|
|
162
|
+
const parsed = (0, parser_2.parseExpression)(expression);
|
|
163
|
+
if (!parsed.isValid) {
|
|
164
|
+
return {
|
|
165
|
+
isValid: false,
|
|
166
|
+
errors: [
|
|
167
|
+
{
|
|
168
|
+
type: 'error',
|
|
169
|
+
message: parsed.error || 'Invalid expression',
|
|
170
|
+
start: 0,
|
|
171
|
+
end: expression.length,
|
|
172
|
+
path: expression,
|
|
173
|
+
},
|
|
174
|
+
],
|
|
175
|
+
warnings: [],
|
|
176
|
+
tokens,
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
(0, resolver_1.evaluateExpression)(parsed, context);
|
|
180
|
+
return {
|
|
181
|
+
isValid: true,
|
|
182
|
+
errors: [],
|
|
183
|
+
warnings: [],
|
|
184
|
+
tokens,
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
catch (error) {
|
|
188
|
+
return {
|
|
189
|
+
isValid: false,
|
|
190
|
+
errors: [
|
|
191
|
+
{
|
|
192
|
+
type: 'error',
|
|
193
|
+
message: error instanceof Error ? error.message : 'Validation error',
|
|
194
|
+
start: 0,
|
|
195
|
+
end: expression.length,
|
|
196
|
+
path: expression,
|
|
197
|
+
},
|
|
198
|
+
],
|
|
199
|
+
warnings: [],
|
|
200
|
+
tokens,
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
exports.validateExpression = validateExpression;
|
|
205
|
+
function generatePreview(expression, context) {
|
|
206
|
+
try {
|
|
207
|
+
const parsed = (0, parser_2.parseExpression)(expression);
|
|
208
|
+
if (!parsed.isValid) {
|
|
209
|
+
return { value: null, type: 'error', error: parsed.error };
|
|
210
|
+
}
|
|
211
|
+
const value = (0, resolver_1.evaluateExpression)(parsed, context);
|
|
212
|
+
const type = value === null ? 'null' : typeof value;
|
|
213
|
+
return { value, type };
|
|
214
|
+
}
|
|
215
|
+
catch (error) {
|
|
216
|
+
return {
|
|
217
|
+
value: null,
|
|
218
|
+
type: 'error',
|
|
219
|
+
error: error instanceof Error ? error.message : 'Evaluation error',
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
exports.generatePreview = generatePreview;
|
|
224
|
+
function convertExpressionToSaveFormat(expression, mappings) {
|
|
225
|
+
if (!expression || mappings.length === 0) {
|
|
226
|
+
return expression;
|
|
227
|
+
}
|
|
228
|
+
let result = expression;
|
|
229
|
+
const sortedMappings = [...mappings].sort((a, b) => b.displayPath.length - a.displayPath.length);
|
|
230
|
+
for (const mapping of sortedMappings) {
|
|
231
|
+
const regex = new RegExp(mapping.displayPath.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), 'g');
|
|
232
|
+
result = result.replace(regex, mapping.savePath);
|
|
233
|
+
}
|
|
234
|
+
return result;
|
|
235
|
+
}
|
|
236
|
+
exports.convertExpressionToSaveFormat = convertExpressionToSaveFormat;
|
|
237
|
+
function convertExpressionToDisplayFormat(expression, mappings) {
|
|
238
|
+
if (!expression || mappings.length === 0) {
|
|
239
|
+
return expression;
|
|
240
|
+
}
|
|
241
|
+
let result = expression;
|
|
242
|
+
const sortedMappings = [...mappings].sort((a, b) => b.savePath.length - a.savePath.length);
|
|
243
|
+
for (const mapping of sortedMappings) {
|
|
244
|
+
const regex = new RegExp(mapping.savePath.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), 'g');
|
|
245
|
+
result = result.replace(regex, mapping.displayPath);
|
|
246
|
+
}
|
|
247
|
+
return result;
|
|
248
|
+
}
|
|
249
|
+
exports.convertExpressionToDisplayFormat = convertExpressionToDisplayFormat;
|
|
250
|
+
function getValueType(value) {
|
|
251
|
+
if (value === null) {
|
|
252
|
+
return 'null';
|
|
253
|
+
}
|
|
254
|
+
if (value === undefined) {
|
|
255
|
+
return 'undefined';
|
|
256
|
+
}
|
|
257
|
+
if (Array.isArray(value)) {
|
|
258
|
+
return 'array';
|
|
259
|
+
}
|
|
260
|
+
return typeof value;
|
|
261
|
+
}
|
|
262
|
+
exports.getValueType = getValueType;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { DataSourceType, OPERATOR_PRECEDENCE } from './types';
|
|
2
|
+
export type { ParsedExpression, PathExpression, FunctionExpression, BinaryExpression, UnaryExpression, TernaryExpression, LiteralExpression, GroupExpression, BuiltInFunction, FunctionCategory, FunctionArg, PipeOperation, OperationCategory, WorkflowContext, StepExecution, WorkflowStep, ValidationResult, ValidationError, ValidationWarning, ExpressionToken, WorkflowResourceMapping, } from './types';
|
|
3
|
+
export { parseExpression, detectDataSource, parsePathSegments, tokenizeTemplate } from './parser';
|
|
4
|
+
export { buildResolverContext, resolvePathValue, evaluateExpression, interpolateString, resolveExpression, } from './resolver';
|
|
5
|
+
export { BUILT_IN_FUNCTIONS, executeFunction, getFunctionsByCategory, getFunctionNames, hasFunction, getFunction, } from './functions';
|
|
6
|
+
export { PIPE_OPERATIONS, executePipeOperation, getPipesByCategory, getPipeNames, hasPipe, getPipe, } from './pipes';
|
|
7
|
+
export type { PipeDefinition } from './pipes/string-pipes';
|
|
8
|
+
import type { WorkflowContext } from './types';
|
|
9
|
+
export { buildExpressionString, buildReferenceString, hasExpressions, hasReferences, isInsideExpression, extractPaths, parseOperations, getCurrentExpressionContext, getValueType, tokenizeEnriched, validateExpression, generatePreview, convertExpressionToSaveFormat, convertExpressionToDisplayFormat, } from './helpers';
|
|
10
|
+
export type { ResourceMapping, EnrichedToken } from './helpers';
|
|
11
|
+
export declare function evaluate(expression: string, workflowContext: WorkflowContext, secretsMap?: Map<string, string>): unknown;
|
|
12
|
+
export declare function interpolate(template: string, workflowContext: WorkflowContext, secretsMap?: Map<string, string>, options?: {
|
|
13
|
+
maskSecrets?: boolean;
|
|
14
|
+
}): string;
|
|
15
|
+
export declare function hasDynamicContent(str: string): boolean;
|
|
16
|
+
export declare function extractReferences(str: string): string[];
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.extractReferences = exports.hasDynamicContent = exports.interpolate = exports.evaluate = exports.convertExpressionToDisplayFormat = exports.convertExpressionToSaveFormat = exports.generatePreview = exports.validateExpression = exports.tokenizeEnriched = exports.getValueType = exports.getCurrentExpressionContext = exports.parseOperations = exports.extractPaths = exports.isInsideExpression = exports.hasReferences = exports.hasExpressions = exports.buildReferenceString = exports.buildExpressionString = exports.getPipe = exports.hasPipe = exports.getPipeNames = exports.getPipesByCategory = exports.executePipeOperation = exports.PIPE_OPERATIONS = exports.getFunction = exports.hasFunction = exports.getFunctionNames = exports.getFunctionsByCategory = exports.executeFunction = exports.BUILT_IN_FUNCTIONS = exports.resolveExpression = exports.interpolateString = exports.evaluateExpression = exports.resolvePathValue = exports.buildResolverContext = exports.tokenizeTemplate = exports.parsePathSegments = exports.detectDataSource = exports.parseExpression = exports.OPERATOR_PRECEDENCE = exports.DataSourceType = void 0;
|
|
4
|
+
var types_1 = require("./types");
|
|
5
|
+
Object.defineProperty(exports, "DataSourceType", { enumerable: true, get: function () { return types_1.DataSourceType; } });
|
|
6
|
+
Object.defineProperty(exports, "OPERATOR_PRECEDENCE", { enumerable: true, get: function () { return types_1.OPERATOR_PRECEDENCE; } });
|
|
7
|
+
var parser_1 = require("./parser");
|
|
8
|
+
Object.defineProperty(exports, "parseExpression", { enumerable: true, get: function () { return parser_1.parseExpression; } });
|
|
9
|
+
Object.defineProperty(exports, "detectDataSource", { enumerable: true, get: function () { return parser_1.detectDataSource; } });
|
|
10
|
+
Object.defineProperty(exports, "parsePathSegments", { enumerable: true, get: function () { return parser_1.parsePathSegments; } });
|
|
11
|
+
Object.defineProperty(exports, "tokenizeTemplate", { enumerable: true, get: function () { return parser_1.tokenizeTemplate; } });
|
|
12
|
+
var resolver_1 = require("./resolver");
|
|
13
|
+
Object.defineProperty(exports, "buildResolverContext", { enumerable: true, get: function () { return resolver_1.buildResolverContext; } });
|
|
14
|
+
Object.defineProperty(exports, "resolvePathValue", { enumerable: true, get: function () { return resolver_1.resolvePathValue; } });
|
|
15
|
+
Object.defineProperty(exports, "evaluateExpression", { enumerable: true, get: function () { return resolver_1.evaluateExpression; } });
|
|
16
|
+
Object.defineProperty(exports, "interpolateString", { enumerable: true, get: function () { return resolver_1.interpolateString; } });
|
|
17
|
+
Object.defineProperty(exports, "resolveExpression", { enumerable: true, get: function () { return resolver_1.resolveExpression; } });
|
|
18
|
+
var functions_1 = require("./functions");
|
|
19
|
+
Object.defineProperty(exports, "BUILT_IN_FUNCTIONS", { enumerable: true, get: function () { return functions_1.BUILT_IN_FUNCTIONS; } });
|
|
20
|
+
Object.defineProperty(exports, "executeFunction", { enumerable: true, get: function () { return functions_1.executeFunction; } });
|
|
21
|
+
Object.defineProperty(exports, "getFunctionsByCategory", { enumerable: true, get: function () { return functions_1.getFunctionsByCategory; } });
|
|
22
|
+
Object.defineProperty(exports, "getFunctionNames", { enumerable: true, get: function () { return functions_1.getFunctionNames; } });
|
|
23
|
+
Object.defineProperty(exports, "hasFunction", { enumerable: true, get: function () { return functions_1.hasFunction; } });
|
|
24
|
+
Object.defineProperty(exports, "getFunction", { enumerable: true, get: function () { return functions_1.getFunction; } });
|
|
25
|
+
var pipes_1 = require("./pipes");
|
|
26
|
+
Object.defineProperty(exports, "PIPE_OPERATIONS", { enumerable: true, get: function () { return pipes_1.PIPE_OPERATIONS; } });
|
|
27
|
+
Object.defineProperty(exports, "executePipeOperation", { enumerable: true, get: function () { return pipes_1.executePipeOperation; } });
|
|
28
|
+
Object.defineProperty(exports, "getPipesByCategory", { enumerable: true, get: function () { return pipes_1.getPipesByCategory; } });
|
|
29
|
+
Object.defineProperty(exports, "getPipeNames", { enumerable: true, get: function () { return pipes_1.getPipeNames; } });
|
|
30
|
+
Object.defineProperty(exports, "hasPipe", { enumerable: true, get: function () { return pipes_1.hasPipe; } });
|
|
31
|
+
Object.defineProperty(exports, "getPipe", { enumerable: true, get: function () { return pipes_1.getPipe; } });
|
|
32
|
+
const resolver_2 = require("./resolver");
|
|
33
|
+
var helpers_1 = require("./helpers");
|
|
34
|
+
Object.defineProperty(exports, "buildExpressionString", { enumerable: true, get: function () { return helpers_1.buildExpressionString; } });
|
|
35
|
+
Object.defineProperty(exports, "buildReferenceString", { enumerable: true, get: function () { return helpers_1.buildReferenceString; } });
|
|
36
|
+
Object.defineProperty(exports, "hasExpressions", { enumerable: true, get: function () { return helpers_1.hasExpressions; } });
|
|
37
|
+
Object.defineProperty(exports, "hasReferences", { enumerable: true, get: function () { return helpers_1.hasReferences; } });
|
|
38
|
+
Object.defineProperty(exports, "isInsideExpression", { enumerable: true, get: function () { return helpers_1.isInsideExpression; } });
|
|
39
|
+
Object.defineProperty(exports, "extractPaths", { enumerable: true, get: function () { return helpers_1.extractPaths; } });
|
|
40
|
+
Object.defineProperty(exports, "parseOperations", { enumerable: true, get: function () { return helpers_1.parseOperations; } });
|
|
41
|
+
Object.defineProperty(exports, "getCurrentExpressionContext", { enumerable: true, get: function () { return helpers_1.getCurrentExpressionContext; } });
|
|
42
|
+
Object.defineProperty(exports, "getValueType", { enumerable: true, get: function () { return helpers_1.getValueType; } });
|
|
43
|
+
Object.defineProperty(exports, "tokenizeEnriched", { enumerable: true, get: function () { return helpers_1.tokenizeEnriched; } });
|
|
44
|
+
Object.defineProperty(exports, "validateExpression", { enumerable: true, get: function () { return helpers_1.validateExpression; } });
|
|
45
|
+
Object.defineProperty(exports, "generatePreview", { enumerable: true, get: function () { return helpers_1.generatePreview; } });
|
|
46
|
+
Object.defineProperty(exports, "convertExpressionToSaveFormat", { enumerable: true, get: function () { return helpers_1.convertExpressionToSaveFormat; } });
|
|
47
|
+
Object.defineProperty(exports, "convertExpressionToDisplayFormat", { enumerable: true, get: function () { return helpers_1.convertExpressionToDisplayFormat; } });
|
|
48
|
+
function evaluate(expression, workflowContext, secretsMap) {
|
|
49
|
+
const context = (0, resolver_2.buildResolverContext)(workflowContext);
|
|
50
|
+
return (0, resolver_2.resolveExpression)(expression, context, secretsMap);
|
|
51
|
+
}
|
|
52
|
+
exports.evaluate = evaluate;
|
|
53
|
+
function interpolate(template, workflowContext, secretsMap, options) {
|
|
54
|
+
const context = (0, resolver_2.buildResolverContext)(workflowContext);
|
|
55
|
+
return (0, resolver_2.interpolateString)(template, context, secretsMap, options);
|
|
56
|
+
}
|
|
57
|
+
exports.interpolate = interpolate;
|
|
58
|
+
function hasDynamicContent(str) {
|
|
59
|
+
return /\{\{.+?\}\}/.test(str);
|
|
60
|
+
}
|
|
61
|
+
exports.hasDynamicContent = hasDynamicContent;
|
|
62
|
+
function extractReferences(str) {
|
|
63
|
+
const matches = str.matchAll(/\{\{(.+?)\}\}/g);
|
|
64
|
+
return Array.from(matches, (m) => m[1].trim());
|
|
65
|
+
}
|
|
66
|
+
exports.extractReferences = extractReferences;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ParsedExpression, DataSourceType } from './types';
|
|
2
|
+
export declare function detectDataSource(path: string): DataSourceType | null;
|
|
3
|
+
export declare function parsePathSegments(path: string): string[];
|
|
4
|
+
export declare function parseExpression(expression: string): ParsedExpression;
|
|
5
|
+
export declare function tokenizeTemplate(template: string): Array<{
|
|
6
|
+
type: 'text' | 'expression';
|
|
7
|
+
value: string;
|
|
8
|
+
}>;
|