@abyss-project/console 1.0.41 → 1.0.43
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/constants/abyss-services.d.ts +0 -0
- package/dist/constants/abyss-services.js +1 -0
- package/dist/index.d.ts +0 -2
- package/dist/index.js +1 -3
- package/dist/types/constants/workflow.constants.d.ts +4 -0
- package/dist/types/constants/workflow.constants.js +5 -1
- package/dist/types/dto/workflow.dto.d.ts +5 -1
- package/dist/types/enum/workflow.enum.d.ts +2 -1
- package/dist/types/enum/workflow.enum.js +1 -0
- package/dist/types/interface/models/workflow-webhook.model.d.ts +1 -0
- package/dist/utils/index.d.ts +1 -2
- package/dist/utils/index.js +1 -2
- package/dist/utils/webhook-trigger.utils.d.ts +0 -7
- package/dist/utils/webhook-trigger.utils.js +0 -334
- package/dist/workflow-expressions/index.d.ts +5 -17
- package/dist/workflow-expressions/index.js +9 -58
- package/dist/workflow-expressions/resolver.d.ts +2 -6
- package/dist/workflow-expressions/resolver.js +46 -229
- package/dist/workflow-expressions/types.d.ts +25 -142
- package/dist/workflow-expressions/types.js +3 -21
- package/package.json +1 -1
- package/dist/expressions/functions/array.d.ts +0 -2
- package/dist/expressions/functions/array.js +0 -252
- package/dist/expressions/functions/crypto.d.ts +0 -2
- package/dist/expressions/functions/crypto.js +0 -101
- package/dist/expressions/functions/datetime.d.ts +0 -2
- package/dist/expressions/functions/datetime.js +0 -256
- package/dist/expressions/functions/index.d.ts +0 -7
- package/dist/expressions/functions/index.js +0 -46
- package/dist/expressions/functions/math.d.ts +0 -2
- package/dist/expressions/functions/math.js +0 -174
- package/dist/expressions/functions/string.d.ts +0 -2
- package/dist/expressions/functions/string.js +0 -301
- package/dist/expressions/functions/utility.d.ts +0 -2
- package/dist/expressions/functions/utility.js +0 -230
- package/dist/expressions/helpers.d.ts +0 -26
- package/dist/expressions/helpers.js +0 -132
- package/dist/expressions/index.d.ts +0 -5
- package/dist/expressions/index.js +0 -16
- package/dist/expressions/mapper.d.ts +0 -9
- package/dist/expressions/mapper.js +0 -88
- package/dist/expressions/parser.d.ts +0 -3
- package/dist/expressions/parser.js +0 -97
- package/dist/expressions/pipes/array-pipes.d.ts +0 -2
- package/dist/expressions/pipes/array-pipes.js +0 -248
- package/dist/expressions/pipes/index.d.ts +0 -8
- package/dist/expressions/pipes/index.js +0 -40
- package/dist/expressions/pipes/object-pipes.d.ts +0 -2
- package/dist/expressions/pipes/object-pipes.js +0 -243
- package/dist/expressions/pipes/string-pipes.d.ts +0 -9
- package/dist/expressions/pipes/string-pipes.js +0 -178
- package/dist/expressions/resolver.d.ts +0 -12
- package/dist/expressions/resolver.js +0 -88
- package/dist/expressions/types.d.ts +0 -36
- package/dist/expressions/types.js +0 -2
- package/dist/workflow-expressions/functions/array.d.ts +0 -2
- package/dist/workflow-expressions/functions/array.js +0 -252
- package/dist/workflow-expressions/functions/crypto.d.ts +0 -2
- package/dist/workflow-expressions/functions/crypto.js +0 -101
- package/dist/workflow-expressions/functions/datetime.d.ts +0 -2
- package/dist/workflow-expressions/functions/datetime.js +0 -256
- package/dist/workflow-expressions/functions/index.d.ts +0 -7
- package/dist/workflow-expressions/functions/index.js +0 -46
- package/dist/workflow-expressions/functions/math.d.ts +0 -2
- package/dist/workflow-expressions/functions/math.js +0 -174
- package/dist/workflow-expressions/functions/string.d.ts +0 -2
- package/dist/workflow-expressions/functions/string.js +0 -301
- package/dist/workflow-expressions/functions/utility.d.ts +0 -2
- package/dist/workflow-expressions/functions/utility.js +0 -230
- package/dist/workflow-expressions/helpers.d.ts +0 -71
- package/dist/workflow-expressions/helpers.js +0 -262
- package/dist/workflow-expressions/parser.d.ts +0 -8
- package/dist/workflow-expressions/parser.js +0 -456
- package/dist/workflow-expressions/pipes/array-pipes.d.ts +0 -2
- package/dist/workflow-expressions/pipes/array-pipes.js +0 -248
- package/dist/workflow-expressions/pipes/index.d.ts +0 -8
- package/dist/workflow-expressions/pipes/index.js +0 -40
- package/dist/workflow-expressions/pipes/object-pipes.d.ts +0 -2
- package/dist/workflow-expressions/pipes/object-pipes.js +0 -243
- package/dist/workflow-expressions/pipes/string-pipes.d.ts +0 -9
- package/dist/workflow-expressions/pipes/string-pipes.js +0 -178
|
@@ -1,275 +1,92 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const parser_1 = require("./parser");
|
|
5
|
-
const functions_1 = require("./functions");
|
|
6
|
-
const pipes_1 = require("./pipes");
|
|
3
|
+
exports.interpolateTemplate = exports.resolvePathValue = exports.buildResolverContext = void 0;
|
|
7
4
|
function buildResolverContext(workflowContext) {
|
|
8
5
|
var _a;
|
|
9
6
|
if (!workflowContext) {
|
|
10
7
|
return {};
|
|
11
8
|
}
|
|
12
9
|
const context = {};
|
|
13
|
-
if (workflowContext.
|
|
14
|
-
context.trigger = workflowContext.
|
|
15
|
-
context.triggerData = workflowContext.triggerData;
|
|
10
|
+
if (workflowContext.trigger) {
|
|
11
|
+
context.trigger = workflowContext.trigger;
|
|
16
12
|
}
|
|
17
13
|
if (workflowContext.triggers) {
|
|
18
14
|
context.triggers = workflowContext.triggers;
|
|
19
15
|
}
|
|
20
16
|
if (workflowContext.stepExecutions) {
|
|
21
|
-
const
|
|
17
|
+
const stepExecutions = {};
|
|
22
18
|
for (const [stepId, execution] of Object.entries(workflowContext.stepExecutions)) {
|
|
23
19
|
const step = (_a = workflowContext.steps) === null || _a === void 0 ? void 0 : _a.find((s) => s.id === stepId);
|
|
24
20
|
const stepKey = (step === null || step === void 0 ? void 0 : step.name) || stepId;
|
|
25
|
-
|
|
21
|
+
stepExecutions[stepKey] = execution.outputData;
|
|
26
22
|
}
|
|
27
|
-
context.
|
|
23
|
+
context.stepExecutions = stepExecutions;
|
|
28
24
|
}
|
|
29
|
-
if (workflowContext.
|
|
30
|
-
context.
|
|
25
|
+
if (workflowContext.steps) {
|
|
26
|
+
context.steps = workflowContext.steps;
|
|
31
27
|
}
|
|
32
28
|
if (workflowContext.ipAddresses) {
|
|
33
|
-
context.
|
|
29
|
+
context.ipAddresses = workflowContext.ipAddresses;
|
|
34
30
|
}
|
|
35
31
|
if (workflowContext.domains) {
|
|
36
|
-
context.
|
|
32
|
+
context.domains = workflowContext.domains;
|
|
37
33
|
}
|
|
38
34
|
if (workflowContext.applications) {
|
|
39
|
-
context.
|
|
35
|
+
context.applications = workflowContext.applications;
|
|
40
36
|
}
|
|
41
37
|
if (workflowContext.secrets) {
|
|
42
|
-
context.
|
|
38
|
+
context.secrets = workflowContext.secrets;
|
|
43
39
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
40
|
+
if (workflowContext.project) {
|
|
41
|
+
context.project = workflowContext.project;
|
|
42
|
+
}
|
|
43
|
+
if (workflowContext.workflow) {
|
|
44
|
+
context.workflow = workflowContext.workflow;
|
|
45
|
+
}
|
|
46
|
+
if (workflowContext.workflowExecution) {
|
|
47
|
+
context.workflowExecution = workflowContext.workflowExecution;
|
|
48
|
+
}
|
|
49
|
+
if (workflowContext.abyss) {
|
|
50
|
+
context.abyss = workflowContext.abyss;
|
|
52
51
|
}
|
|
53
52
|
return context;
|
|
54
53
|
}
|
|
55
54
|
exports.buildResolverContext = buildResolverContext;
|
|
56
55
|
function resolvePathValue(path, context) {
|
|
57
|
-
|
|
56
|
+
if (!path)
|
|
57
|
+
return undefined;
|
|
58
|
+
const segments = path.split('.');
|
|
58
59
|
let current = context;
|
|
59
60
|
for (const segment of segments) {
|
|
60
61
|
if (current === null || current === undefined) {
|
|
61
62
|
return undefined;
|
|
62
63
|
}
|
|
63
|
-
|
|
64
|
-
current = current[Number(segment)];
|
|
65
|
-
}
|
|
66
|
-
else if (typeof current === 'object') {
|
|
67
|
-
current = current[segment];
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
return undefined;
|
|
71
|
-
}
|
|
64
|
+
current = current[segment];
|
|
72
65
|
}
|
|
73
66
|
return current;
|
|
74
67
|
}
|
|
75
68
|
exports.resolvePathValue = resolvePathValue;
|
|
76
|
-
function
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
return evaluateExpression(parsed.expression, context, secretsMap);
|
|
92
|
-
default:
|
|
93
|
-
return undefined;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
exports.evaluateExpression = evaluateExpression;
|
|
97
|
-
function evaluatePathExpression(parsed, context, secretsMap) {
|
|
98
|
-
var _a;
|
|
99
|
-
if (parsed.source === 'secret' && secretsMap && parsed.path) {
|
|
100
|
-
const secretKey = parsed.path.replace('secret.', '');
|
|
101
|
-
let value = (_a = secretsMap.get(secretKey)) !== null && _a !== void 0 ? _a : `[Secret: ${secretKey}]`;
|
|
102
|
-
if (parsed.operations && parsed.operations.length > 0) {
|
|
103
|
-
for (const op of parsed.operations) {
|
|
104
|
-
try {
|
|
105
|
-
const resolvedArgs = op.args.map((arg) => {
|
|
106
|
-
if (typeof arg === 'string' && arg.includes('.')) {
|
|
107
|
-
const resolved = resolvePathValue(arg, context);
|
|
108
|
-
return resolved !== undefined ? resolved : arg;
|
|
109
|
-
}
|
|
110
|
-
return arg;
|
|
111
|
-
});
|
|
112
|
-
value = (0, pipes_1.executePipeOperation)(op.name, value, resolvedArgs);
|
|
113
|
-
}
|
|
114
|
-
catch (error) {
|
|
115
|
-
return `[Error: ${error.message}]`;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
return value;
|
|
120
|
-
}
|
|
121
|
-
let value = parsed.path ? resolvePathValue(parsed.path, context) : undefined;
|
|
122
|
-
if (parsed.operations && parsed.operations.length > 0) {
|
|
123
|
-
for (const op of parsed.operations) {
|
|
124
|
-
try {
|
|
125
|
-
const resolvedArgs = op.args.map((arg) => {
|
|
126
|
-
if (typeof arg === 'string' && arg.includes('.')) {
|
|
127
|
-
const resolved = resolvePathValue(arg, context);
|
|
128
|
-
return resolved !== undefined ? resolved : arg;
|
|
129
|
-
}
|
|
130
|
-
return arg;
|
|
131
|
-
});
|
|
132
|
-
value = (0, pipes_1.executePipeOperation)(op.name, value, resolvedArgs);
|
|
133
|
-
}
|
|
134
|
-
catch (error) {
|
|
135
|
-
return `[Error: ${error.message}]`;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
return value;
|
|
140
|
-
}
|
|
141
|
-
function evaluateFunctionExpression(parsed, context, secretsMap) {
|
|
142
|
-
if (!parsed.functionName) {
|
|
143
|
-
return undefined;
|
|
144
|
-
}
|
|
145
|
-
const resolvedArgs = (parsed.functionArgs || []).map((arg) => {
|
|
146
|
-
if (typeof arg === 'string' && arg.includes('.')) {
|
|
147
|
-
const resolved = resolvePathValue(arg, context);
|
|
148
|
-
return resolved !== undefined ? resolved : arg;
|
|
69
|
+
function interpolateTemplate(template, context) {
|
|
70
|
+
if (!template || typeof template !== 'string') {
|
|
71
|
+
return String(template || '');
|
|
72
|
+
}
|
|
73
|
+
const pattern = /\{\{(.+?)\}\}/g;
|
|
74
|
+
const matches = [...template.matchAll(pattern)];
|
|
75
|
+
if (matches.length === 0) {
|
|
76
|
+
return template;
|
|
77
|
+
}
|
|
78
|
+
let result = template;
|
|
79
|
+
for (const match of matches) {
|
|
80
|
+
const [fullMatch, expression] = match;
|
|
81
|
+
try {
|
|
82
|
+
const value = resolvePathValue(expression.trim(), context);
|
|
83
|
+
result = result.replace(fullMatch, String(value !== null && value !== void 0 ? value : ''));
|
|
149
84
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
let value = (0, functions_1.executeFunction)(parsed.functionName, resolvedArgs);
|
|
154
|
-
if (parsed.operations && parsed.operations.length > 0) {
|
|
155
|
-
for (const op of parsed.operations) {
|
|
156
|
-
try {
|
|
157
|
-
const resolvedPipeArgs = op.args.map((arg) => {
|
|
158
|
-
if (typeof arg === 'string' && arg.includes('.')) {
|
|
159
|
-
const resolved = resolvePathValue(arg, context);
|
|
160
|
-
return resolved !== undefined ? resolved : arg;
|
|
161
|
-
}
|
|
162
|
-
return arg;
|
|
163
|
-
});
|
|
164
|
-
value = (0, pipes_1.executePipeOperation)(op.name, value, resolvedPipeArgs);
|
|
165
|
-
}
|
|
166
|
-
catch (error) {
|
|
167
|
-
return `[Error: ${error.message}]`;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
return value;
|
|
172
|
-
}
|
|
173
|
-
catch (error) {
|
|
174
|
-
return `[Error: ${error.message}]`;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
function evaluateBinaryExpression(parsed, context, secretsMap) {
|
|
178
|
-
const left = evaluateExpression(parsed.left, context, secretsMap);
|
|
179
|
-
const right = evaluateExpression(parsed.right, context, secretsMap);
|
|
180
|
-
switch (parsed.operator) {
|
|
181
|
-
case '+':
|
|
182
|
-
return left + right;
|
|
183
|
-
case '-':
|
|
184
|
-
return left - right;
|
|
185
|
-
case '*':
|
|
186
|
-
return left * right;
|
|
187
|
-
case '/':
|
|
188
|
-
return left / right;
|
|
189
|
-
case '%':
|
|
190
|
-
return left % right;
|
|
191
|
-
case '**':
|
|
192
|
-
return Math.pow(left, right);
|
|
193
|
-
case '==':
|
|
194
|
-
case '===':
|
|
195
|
-
return left === right;
|
|
196
|
-
case '!=':
|
|
197
|
-
case '!==':
|
|
198
|
-
return left !== right;
|
|
199
|
-
case '<':
|
|
200
|
-
return left < right;
|
|
201
|
-
case '>':
|
|
202
|
-
return left > right;
|
|
203
|
-
case '<=':
|
|
204
|
-
return left <= right;
|
|
205
|
-
case '>=':
|
|
206
|
-
return left >= right;
|
|
207
|
-
case '&&':
|
|
208
|
-
return left && right;
|
|
209
|
-
case '||':
|
|
210
|
-
return left || right;
|
|
211
|
-
default:
|
|
212
|
-
return undefined;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
function evaluateUnaryExpression(parsed, context, secretsMap) {
|
|
216
|
-
const operand = evaluateExpression(parsed.operand, context, secretsMap);
|
|
217
|
-
switch (parsed.operator) {
|
|
218
|
-
case '!':
|
|
219
|
-
return !operand;
|
|
220
|
-
case '-':
|
|
221
|
-
return -operand;
|
|
222
|
-
default:
|
|
223
|
-
return undefined;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
function evaluateTernaryExpression(parsed, context, secretsMap) {
|
|
227
|
-
const condition = evaluateExpression(parsed.condition, context, secretsMap);
|
|
228
|
-
return condition
|
|
229
|
-
? evaluateExpression(parsed.consequent, context, secretsMap)
|
|
230
|
-
: evaluateExpression(parsed.alternate, context, secretsMap);
|
|
231
|
-
}
|
|
232
|
-
function interpolateString(template, context, secretsMap, options = {}) {
|
|
233
|
-
const tokens = (0, parser_1.tokenizeTemplate)(template);
|
|
234
|
-
let result = '';
|
|
235
|
-
for (const token of tokens) {
|
|
236
|
-
if (token.type === 'text') {
|
|
237
|
-
result += token.value;
|
|
238
|
-
}
|
|
239
|
-
else if (token.type === 'expression') {
|
|
240
|
-
try {
|
|
241
|
-
const parsed = (0, parser_1.parseExpression)(token.value);
|
|
242
|
-
const value = evaluateExpression(parsed, context, secretsMap);
|
|
243
|
-
if (parsed.type === 'path' &&
|
|
244
|
-
parsed.source === 'secret' &&
|
|
245
|
-
options.maskSecrets) {
|
|
246
|
-
result += '••••••••';
|
|
247
|
-
}
|
|
248
|
-
else if (value !== undefined && value !== null) {
|
|
249
|
-
result += typeof value === 'object' ? JSON.stringify(value) : String(value);
|
|
250
|
-
}
|
|
251
|
-
else {
|
|
252
|
-
result += `{{${token.value}}}`;
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
catch (error) {
|
|
256
|
-
result += `[Error: ${error.message}]`;
|
|
257
|
-
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
console.error(`Failed to interpolate ${expression}:`, error);
|
|
87
|
+
result = result.replace(fullMatch, `{{${expression}}}`);
|
|
258
88
|
}
|
|
259
89
|
}
|
|
260
90
|
return result;
|
|
261
91
|
}
|
|
262
|
-
exports.
|
|
263
|
-
function resolveExpression(expression, context, secretsMap) {
|
|
264
|
-
if (expression.includes('{{') && expression.includes('}}')) {
|
|
265
|
-
const tokens = (0, parser_1.tokenizeTemplate)(expression);
|
|
266
|
-
if (tokens.length === 1 && tokens[0].type === 'expression') {
|
|
267
|
-
const parsed = (0, parser_1.parseExpression)(tokens[0].value);
|
|
268
|
-
return evaluateExpression(parsed, context, secretsMap);
|
|
269
|
-
}
|
|
270
|
-
return interpolateString(expression, context, secretsMap);
|
|
271
|
-
}
|
|
272
|
-
const parsed = (0, parser_1.parseExpression)(expression);
|
|
273
|
-
return evaluateExpression(parsed, context, secretsMap);
|
|
274
|
-
}
|
|
275
|
-
exports.resolveExpression = resolveExpression;
|
|
92
|
+
exports.interpolateTemplate = interpolateTemplate;
|
|
@@ -1,153 +1,36 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { WorkflowTriggerType } from '../types/enum/workflow.enum';
|
|
1
|
+
import type { IProject, IWorkflow, IWorkflowTrigger, IWorkflowStep, IWorkflowStepExecution, IWorkflowExecution, IIpAddress, IDomainVerification, ISecret } from '../types';
|
|
3
2
|
export declare enum DataSourceType {
|
|
4
3
|
WORKFLOW_TRIGGER = "trigger",
|
|
5
4
|
WORKFLOW_STEPS = "steps",
|
|
6
|
-
WORKFLOW_VARIABLES = "variables",
|
|
7
5
|
IP_ADDRESSES = "ipAddress",
|
|
8
6
|
DOMAINS = "domain",
|
|
9
7
|
APPLICATIONS = "app",
|
|
10
8
|
SECRETS = "secret",
|
|
11
9
|
PROJECT = "project",
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
OPERATORS = "op"
|
|
15
|
-
}
|
|
16
|
-
export interface TriggerInfo {
|
|
17
|
-
id: string;
|
|
18
|
-
name: string;
|
|
19
|
-
type: WorkflowTriggerType;
|
|
20
|
-
isActive: boolean;
|
|
21
|
-
}
|
|
22
|
-
export declare const OPERATOR_PRECEDENCE: Record<string, number>;
|
|
23
|
-
export type ParsedExpression = PathExpression | FunctionExpression | BinaryExpression | UnaryExpression | TernaryExpression | LiteralExpression | GroupExpression;
|
|
24
|
-
export interface BaseExpression {
|
|
25
|
-
type: string;
|
|
26
|
-
isValid: boolean;
|
|
27
|
-
error?: string;
|
|
28
|
-
}
|
|
29
|
-
export interface PathExpression extends BaseExpression {
|
|
30
|
-
type: 'path';
|
|
31
|
-
path: string;
|
|
32
|
-
source: DataSourceType | null;
|
|
33
|
-
operations?: PipeOperation[];
|
|
34
|
-
resolvedValue?: unknown;
|
|
35
|
-
}
|
|
36
|
-
export interface FunctionExpression extends BaseExpression {
|
|
37
|
-
type: 'function';
|
|
38
|
-
isFunction: true;
|
|
39
|
-
functionName: string;
|
|
40
|
-
functionArgs: unknown[];
|
|
41
|
-
operations?: PipeOperation[];
|
|
42
|
-
resolvedValue?: unknown;
|
|
43
|
-
}
|
|
44
|
-
export interface BinaryExpression extends BaseExpression {
|
|
45
|
-
type: 'binary';
|
|
46
|
-
operator: string;
|
|
47
|
-
left: ParsedExpression;
|
|
48
|
-
right: ParsedExpression;
|
|
49
|
-
}
|
|
50
|
-
export interface UnaryExpression extends BaseExpression {
|
|
51
|
-
type: 'unary';
|
|
52
|
-
operator: string;
|
|
53
|
-
operand: ParsedExpression;
|
|
54
|
-
}
|
|
55
|
-
export interface TernaryExpression extends BaseExpression {
|
|
56
|
-
type: 'ternary';
|
|
57
|
-
condition: ParsedExpression;
|
|
58
|
-
consequent: ParsedExpression;
|
|
59
|
-
alternate: ParsedExpression;
|
|
60
|
-
}
|
|
61
|
-
export interface LiteralExpression extends BaseExpression {
|
|
62
|
-
type: 'literal';
|
|
63
|
-
literalType: 'string' | 'number' | 'boolean' | 'null';
|
|
64
|
-
literalValue: unknown;
|
|
65
|
-
}
|
|
66
|
-
export interface GroupExpression extends BaseExpression {
|
|
67
|
-
type: 'group';
|
|
68
|
-
expression: ParsedExpression;
|
|
69
|
-
}
|
|
70
|
-
export interface PipeOperation {
|
|
71
|
-
name: string;
|
|
72
|
-
args: unknown[];
|
|
73
|
-
description?: string;
|
|
74
|
-
category?: OperationCategory;
|
|
75
|
-
}
|
|
76
|
-
export type OperationCategory = 'string' | 'array' | 'object' | 'number' | 'date' | 'encoding' | 'formatting';
|
|
77
|
-
export interface BuiltInFunction {
|
|
78
|
-
name: string;
|
|
79
|
-
description: string;
|
|
80
|
-
category: FunctionCategory;
|
|
81
|
-
signature: string;
|
|
82
|
-
args: FunctionArg[];
|
|
83
|
-
returnType: string;
|
|
84
|
-
examples: string[];
|
|
85
|
-
execute: (...args: unknown[]) => unknown;
|
|
86
|
-
}
|
|
87
|
-
export type FunctionCategory = 'datetime' | 'string' | 'math' | 'crypto' | 'array' | 'utility' | 'encoding';
|
|
88
|
-
export interface FunctionArg {
|
|
89
|
-
name: string;
|
|
90
|
-
type: string;
|
|
91
|
-
required: boolean;
|
|
92
|
-
description: string;
|
|
10
|
+
WORKFLOW = "workflow",
|
|
11
|
+
ABYSS = "abyss"
|
|
93
12
|
}
|
|
94
13
|
export interface WorkflowContext {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
id: string;
|
|
118
|
-
name: string;
|
|
119
|
-
type: string;
|
|
120
|
-
config?: Record<string, unknown>;
|
|
121
|
-
}
|
|
122
|
-
export interface ExpressionToken {
|
|
123
|
-
type: 'text' | 'expression' | 'reference' | 'function' | 'error';
|
|
124
|
-
value: string;
|
|
125
|
-
rawValue: string;
|
|
126
|
-
start: number;
|
|
127
|
-
end: number;
|
|
128
|
-
parsed?: ParsedExpression;
|
|
129
|
-
isSecret?: boolean;
|
|
130
|
-
}
|
|
131
|
-
export interface ValidationResult {
|
|
132
|
-
isValid: boolean;
|
|
133
|
-
errors: ValidationError[];
|
|
134
|
-
warnings: ValidationWarning[];
|
|
135
|
-
}
|
|
136
|
-
export interface ValidationError {
|
|
137
|
-
type: 'error';
|
|
138
|
-
message: string;
|
|
139
|
-
start: number;
|
|
140
|
-
end: number;
|
|
141
|
-
path?: string;
|
|
142
|
-
}
|
|
143
|
-
export interface ValidationWarning {
|
|
144
|
-
type: 'warning';
|
|
145
|
-
message: string;
|
|
146
|
-
start: number;
|
|
147
|
-
end: number;
|
|
148
|
-
path?: string;
|
|
149
|
-
suggestion?: string;
|
|
150
|
-
}
|
|
151
|
-
export interface WorkflowResourceMapping extends Omit<GenericResourceMapping<DataSourceType>, 'source'> {
|
|
152
|
-
source: DataSourceType;
|
|
14
|
+
project: Pick<IProject, 'id'> & {
|
|
15
|
+
name: string;
|
|
16
|
+
};
|
|
17
|
+
workflow: Pick<IWorkflow, 'id' | 'name' | 'description' | 'template' | 'status' | 'settings'>;
|
|
18
|
+
workflowExecution?: Pick<IWorkflowExecution, 'id' | 'status' | 'startedAt' | 'completedAt' | 'context' | 'metadata'>;
|
|
19
|
+
trigger?: IWorkflowTrigger & {
|
|
20
|
+
data: unknown;
|
|
21
|
+
};
|
|
22
|
+
triggers?: Record<string, IWorkflowTrigger>;
|
|
23
|
+
stepExecutions?: Record<string, IWorkflowStepExecution>;
|
|
24
|
+
steps?: IWorkflowStep[];
|
|
25
|
+
ipAddresses?: Record<string, IIpAddress>;
|
|
26
|
+
domains?: Record<string, IDomainVerification>;
|
|
27
|
+
applications?: Record<string, Record<string, {
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
}>>;
|
|
31
|
+
secrets?: Record<string, Pick<ISecret, 'id' | 'key' | 'name'>>;
|
|
32
|
+
abyss?: Record<string, {
|
|
33
|
+
api: string;
|
|
34
|
+
site?: string;
|
|
35
|
+
}>;
|
|
153
36
|
}
|
|
@@ -1,33 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.DataSourceType = void 0;
|
|
4
4
|
var DataSourceType;
|
|
5
5
|
(function (DataSourceType) {
|
|
6
6
|
DataSourceType["WORKFLOW_TRIGGER"] = "trigger";
|
|
7
7
|
DataSourceType["WORKFLOW_STEPS"] = "steps";
|
|
8
|
-
DataSourceType["WORKFLOW_VARIABLES"] = "variables";
|
|
9
8
|
DataSourceType["IP_ADDRESSES"] = "ipAddress";
|
|
10
9
|
DataSourceType["DOMAINS"] = "domain";
|
|
11
10
|
DataSourceType["APPLICATIONS"] = "app";
|
|
12
11
|
DataSourceType["SECRETS"] = "secret";
|
|
13
12
|
DataSourceType["PROJECT"] = "project";
|
|
14
|
-
DataSourceType["
|
|
15
|
-
DataSourceType["
|
|
16
|
-
DataSourceType["OPERATORS"] = "op";
|
|
13
|
+
DataSourceType["WORKFLOW"] = "workflow";
|
|
14
|
+
DataSourceType["ABYSS"] = "abyss";
|
|
17
15
|
})(DataSourceType || (exports.DataSourceType = DataSourceType = {}));
|
|
18
|
-
exports.OPERATOR_PRECEDENCE = {
|
|
19
|
-
'||': 1,
|
|
20
|
-
'&&': 2,
|
|
21
|
-
'==': 3,
|
|
22
|
-
'!=': 3,
|
|
23
|
-
'<': 4,
|
|
24
|
-
'>': 4,
|
|
25
|
-
'<=': 4,
|
|
26
|
-
'>=': 4,
|
|
27
|
-
'+': 5,
|
|
28
|
-
'-': 5,
|
|
29
|
-
'*': 6,
|
|
30
|
-
'/': 6,
|
|
31
|
-
'%': 6,
|
|
32
|
-
'**': 7,
|
|
33
|
-
};
|
package/package.json
CHANGED