@abyss-project/console 1.0.44 → 1.0.46
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/index.d.ts +2 -3
- package/dist/workflow-expressions/index.js +16 -6
- package/dist/workflow-expressions/resolver.d.ts +2 -3
- package/dist/workflow-expressions/resolver.js +1 -52
- package/dist/workflow-expressions/types.d.ts +22 -19
- package/dist/workflow-expressions/types.js +9 -6
- package/package.json +1 -1
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export { buildResolverContext, resolvePathValue } from './resolver';
|
|
1
|
+
export * from './resolver';
|
|
2
|
+
export * from './types';
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "DataSourceType", { enumerable: true, get: function () { return types_1.DataSourceType; } });
|
|
6
|
-
var resolver_1 = require("./resolver");
|
|
7
|
-
Object.defineProperty(exports, "buildResolverContext", { enumerable: true, get: function () { return resolver_1.buildResolverContext; } });
|
|
8
|
-
Object.defineProperty(exports, "resolvePathValue", { enumerable: true, get: function () { return resolver_1.resolvePathValue; } });
|
|
17
|
+
__exportStar(require("./resolver"), exports);
|
|
18
|
+
__exportStar(require("./types"), exports);
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare function
|
|
3
|
-
export declare function resolvePathValue(path: string, context: Record<string, unknown>): unknown;
|
|
1
|
+
import { WorkflowContext } from ".";
|
|
2
|
+
export declare function resolvePathValue(path: string, context: WorkflowContext): unknown;
|
|
@@ -1,57 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolvePathValue =
|
|
4
|
-
function buildResolverContext(workflowContext) {
|
|
5
|
-
var _a;
|
|
6
|
-
if (!workflowContext) {
|
|
7
|
-
return {};
|
|
8
|
-
}
|
|
9
|
-
const context = {};
|
|
10
|
-
if (workflowContext.trigger) {
|
|
11
|
-
context.trigger = workflowContext.trigger;
|
|
12
|
-
}
|
|
13
|
-
if (workflowContext.triggers) {
|
|
14
|
-
context.triggers = workflowContext.triggers;
|
|
15
|
-
}
|
|
16
|
-
if (workflowContext.stepExecutions) {
|
|
17
|
-
const stepExecutions = {};
|
|
18
|
-
for (const [stepId, execution] of Object.entries(workflowContext.stepExecutions)) {
|
|
19
|
-
const step = (_a = workflowContext.steps) === null || _a === void 0 ? void 0 : _a.find((s) => s.id === stepId);
|
|
20
|
-
const stepKey = (step === null || step === void 0 ? void 0 : step.name) || stepId;
|
|
21
|
-
stepExecutions[stepKey] = execution.outputData;
|
|
22
|
-
}
|
|
23
|
-
context.stepExecutions = stepExecutions;
|
|
24
|
-
}
|
|
25
|
-
if (workflowContext.steps) {
|
|
26
|
-
context.steps = workflowContext.steps;
|
|
27
|
-
}
|
|
28
|
-
if (workflowContext.ipAddresses) {
|
|
29
|
-
context.ipAddresses = workflowContext.ipAddresses;
|
|
30
|
-
}
|
|
31
|
-
if (workflowContext.domains) {
|
|
32
|
-
context.domains = workflowContext.domains;
|
|
33
|
-
}
|
|
34
|
-
if (workflowContext.applications) {
|
|
35
|
-
context.applications = workflowContext.applications;
|
|
36
|
-
}
|
|
37
|
-
if (workflowContext.secrets) {
|
|
38
|
-
context.secrets = workflowContext.secrets;
|
|
39
|
-
}
|
|
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;
|
|
51
|
-
}
|
|
52
|
-
return context;
|
|
53
|
-
}
|
|
54
|
-
exports.buildResolverContext = buildResolverContext;
|
|
3
|
+
exports.resolvePathValue = void 0;
|
|
55
4
|
function resolvePathValue(path, context) {
|
|
56
5
|
if (!path)
|
|
57
6
|
return undefined;
|
|
@@ -1,37 +1,40 @@
|
|
|
1
1
|
import type { IProject, IWorkflow, IWorkflowTrigger, IWorkflowStep, IWorkflowStepExecution, IWorkflowExecution, IIpAddress, IDomainVerification, ISecret, IVariable } from '../types';
|
|
2
2
|
export declare enum DataSourceType {
|
|
3
3
|
WORKFLOW_TRIGGER = "trigger",
|
|
4
|
-
|
|
5
|
-
IP_ADDRESSES = "
|
|
6
|
-
DOMAINS = "
|
|
7
|
-
APPLICATIONS = "
|
|
8
|
-
SECRETS = "
|
|
9
|
-
VARIABLES = "
|
|
4
|
+
WORKFLOW_TRIGGERS = "triggers",
|
|
5
|
+
IP_ADDRESSES = "ipAddresses",
|
|
6
|
+
DOMAINS = "domains",
|
|
7
|
+
APPLICATIONS = "applications",
|
|
8
|
+
SECRETS = "secrets",
|
|
9
|
+
VARIABLES = "variables",
|
|
10
10
|
PROJECT = "project",
|
|
11
11
|
WORKFLOW = "workflow",
|
|
12
|
+
WORKFLOW_EXECUTION = "workflowExecutions",
|
|
13
|
+
STEP_EXECUTIONS = "stepExecutions",
|
|
14
|
+
STEPS = "steps",
|
|
12
15
|
ABYSS = "abyss"
|
|
13
16
|
}
|
|
14
17
|
export interface WorkflowContext {
|
|
15
|
-
|
|
18
|
+
[DataSourceType.PROJECT]: Pick<IProject, 'id'> & {
|
|
16
19
|
name: string;
|
|
17
20
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
[DataSourceType.WORKFLOW]: Pick<IWorkflow, 'id' | 'name' | 'description' | 'template' | 'status' | 'settings'>;
|
|
22
|
+
[DataSourceType.WORKFLOW_EXECUTION]?: Pick<IWorkflowExecution, 'id' | 'status' | 'startedAt' | 'completedAt' | 'context' | 'metadata'>;
|
|
23
|
+
[DataSourceType.WORKFLOW_TRIGGER]?: IWorkflowTrigger & {
|
|
21
24
|
data: unknown;
|
|
22
25
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
[DataSourceType.WORKFLOW_TRIGGERS]?: Record<string, IWorkflowTrigger>;
|
|
27
|
+
[DataSourceType.STEP_EXECUTIONS]?: Record<string, IWorkflowStepExecution>;
|
|
28
|
+
[DataSourceType.STEPS]?: IWorkflowStep[];
|
|
29
|
+
[DataSourceType.IP_ADDRESSES]?: Record<string, IIpAddress>;
|
|
30
|
+
[DataSourceType.DOMAINS]?: Record<string, IDomainVerification>;
|
|
31
|
+
[DataSourceType.APPLICATIONS]?: Record<string, Record<string, {
|
|
29
32
|
id: string;
|
|
30
33
|
name: string;
|
|
31
34
|
}>>;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
[DataSourceType.SECRETS]?: Record<string, Pick<ISecret, 'id' | 'key' | 'name'>>;
|
|
36
|
+
[DataSourceType.VARIABLES]?: Record<string, Pick<IVariable, 'id' | 'key' | 'name' | 'value'>>;
|
|
37
|
+
[DataSourceType.ABYSS]?: Record<string, {
|
|
35
38
|
api: string;
|
|
36
39
|
site?: string;
|
|
37
40
|
}>;
|
|
@@ -4,13 +4,16 @@ exports.DataSourceType = void 0;
|
|
|
4
4
|
var DataSourceType;
|
|
5
5
|
(function (DataSourceType) {
|
|
6
6
|
DataSourceType["WORKFLOW_TRIGGER"] = "trigger";
|
|
7
|
-
DataSourceType["
|
|
8
|
-
DataSourceType["IP_ADDRESSES"] = "
|
|
9
|
-
DataSourceType["DOMAINS"] = "
|
|
10
|
-
DataSourceType["APPLICATIONS"] = "
|
|
11
|
-
DataSourceType["SECRETS"] = "
|
|
12
|
-
DataSourceType["VARIABLES"] = "
|
|
7
|
+
DataSourceType["WORKFLOW_TRIGGERS"] = "triggers";
|
|
8
|
+
DataSourceType["IP_ADDRESSES"] = "ipAddresses";
|
|
9
|
+
DataSourceType["DOMAINS"] = "domains";
|
|
10
|
+
DataSourceType["APPLICATIONS"] = "applications";
|
|
11
|
+
DataSourceType["SECRETS"] = "secrets";
|
|
12
|
+
DataSourceType["VARIABLES"] = "variables";
|
|
13
13
|
DataSourceType["PROJECT"] = "project";
|
|
14
14
|
DataSourceType["WORKFLOW"] = "workflow";
|
|
15
|
+
DataSourceType["WORKFLOW_EXECUTION"] = "workflowExecutions";
|
|
16
|
+
DataSourceType["STEP_EXECUTIONS"] = "stepExecutions";
|
|
17
|
+
DataSourceType["STEPS"] = "steps";
|
|
15
18
|
DataSourceType["ABYSS"] = "abyss";
|
|
16
19
|
})(DataSourceType || (exports.DataSourceType = DataSourceType = {}));
|