@abyss-project/console 1.0.38 → 1.0.40
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/workflow-expressions/functions/string.js +1 -1
- package/dist/workflow-expressions/functions/utility.js +2 -2
- package/dist/workflow-expressions/pipes/string-pipes.js +2 -2
- package/dist/workflow-expressions/resolver.js +15 -0
- package/dist/workflow-expressions/types.d.ts +5 -0
- package/package.json +1 -1
|
@@ -27,7 +27,7 @@ exports.utilityFunctions = {
|
|
|
27
27
|
},
|
|
28
28
|
],
|
|
29
29
|
returnType: 'any',
|
|
30
|
-
examples: ['{{fn.coalesce(trigger.
|
|
30
|
+
examples: ['{{fn.coalesce(trigger.body.username, "Anonymous")}}'],
|
|
31
31
|
execute: (...args) => {
|
|
32
32
|
for (const arg of args) {
|
|
33
33
|
if (arg !== null && arg !== undefined) {
|
|
@@ -124,7 +124,7 @@ exports.utilityFunctions = {
|
|
|
124
124
|
},
|
|
125
125
|
],
|
|
126
126
|
returnType: 'any',
|
|
127
|
-
examples: ['{{fn.default(trigger.
|
|
127
|
+
examples: ['{{fn.default(trigger.body.username, "Unknown")}}'],
|
|
128
128
|
execute: (value, defaultValue) => {
|
|
129
129
|
if (value === null || value === undefined)
|
|
130
130
|
return defaultValue;
|
|
@@ -7,7 +7,7 @@ exports.stringPipes = {
|
|
|
7
7
|
description: 'Converts to uppercase',
|
|
8
8
|
category: 'string',
|
|
9
9
|
signature: 'upper',
|
|
10
|
-
examples: ['{{trigger.
|
|
10
|
+
examples: ['{{trigger.body.username | upper}}'],
|
|
11
11
|
execute: (value) => String(value).toUpperCase(),
|
|
12
12
|
},
|
|
13
13
|
lower: {
|
|
@@ -23,7 +23,7 @@ exports.stringPipes = {
|
|
|
23
23
|
description: 'Capitalizes the first letter',
|
|
24
24
|
category: 'string',
|
|
25
25
|
signature: 'capitalize',
|
|
26
|
-
examples: ['{{trigger.
|
|
26
|
+
examples: ['{{trigger.body.username | capitalize}}'],
|
|
27
27
|
execute: (value) => {
|
|
28
28
|
const str = String(value);
|
|
29
29
|
return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
|
|
@@ -14,6 +14,9 @@ function buildResolverContext(workflowContext) {
|
|
|
14
14
|
context.trigger = workflowContext.triggerData;
|
|
15
15
|
context.triggerData = workflowContext.triggerData;
|
|
16
16
|
}
|
|
17
|
+
if (workflowContext.triggers) {
|
|
18
|
+
context.triggers = workflowContext.triggers;
|
|
19
|
+
}
|
|
17
20
|
if (workflowContext.stepExecutions) {
|
|
18
21
|
const steps = {};
|
|
19
22
|
for (const [stepId, execution] of Object.entries(workflowContext.stepExecutions)) {
|
|
@@ -26,6 +29,18 @@ function buildResolverContext(workflowContext) {
|
|
|
26
29
|
if (workflowContext.variables) {
|
|
27
30
|
context.variables = workflowContext.variables;
|
|
28
31
|
}
|
|
32
|
+
if (workflowContext.ipAddresses) {
|
|
33
|
+
context.ipAddress = workflowContext.ipAddresses;
|
|
34
|
+
}
|
|
35
|
+
if (workflowContext.domains) {
|
|
36
|
+
context.domain = workflowContext.domains;
|
|
37
|
+
}
|
|
38
|
+
if (workflowContext.applications) {
|
|
39
|
+
context.app = workflowContext.applications;
|
|
40
|
+
}
|
|
41
|
+
if (workflowContext.secrets) {
|
|
42
|
+
context.secret = workflowContext.secrets;
|
|
43
|
+
}
|
|
29
44
|
context.project = {
|
|
30
45
|
id: workflowContext.projectId,
|
|
31
46
|
...(workflowContext.projectName ? { name: workflowContext.projectName } : {}),
|
|
@@ -96,9 +96,14 @@ export interface WorkflowContext {
|
|
|
96
96
|
projectName?: string;
|
|
97
97
|
workflowId?: string;
|
|
98
98
|
triggerData?: Record<string, unknown>;
|
|
99
|
+
triggers?: Record<string, Record<string, unknown>>;
|
|
99
100
|
stepExecutions?: Record<string, StepExecution>;
|
|
100
101
|
variables?: Record<string, unknown>;
|
|
101
102
|
steps?: WorkflowStep[];
|
|
103
|
+
ipAddresses?: Record<string, Record<string, unknown>>;
|
|
104
|
+
domains?: Record<string, Record<string, unknown>>;
|
|
105
|
+
applications?: Record<string, Record<string, unknown>>;
|
|
106
|
+
secrets?: Record<string, string>;
|
|
102
107
|
}
|
|
103
108
|
export interface StepExecution {
|
|
104
109
|
stepId: string;
|