@abyss-project/console 1.0.44 → 1.0.45

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.
@@ -1,3 +1,3 @@
1
1
  export { DataSourceType } from './types';
2
2
  export type { WorkflowContext } from './types';
3
- export { buildResolverContext, resolvePathValue } from './resolver';
3
+ export { resolvePathValue } from './resolver';
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolvePathValue = exports.buildResolverContext = exports.DataSourceType = void 0;
3
+ exports.resolvePathValue = exports.DataSourceType = void 0;
4
4
  var types_1 = require("./types");
5
5
  Object.defineProperty(exports, "DataSourceType", { enumerable: true, get: function () { return types_1.DataSourceType; } });
6
6
  var resolver_1 = require("./resolver");
7
- Object.defineProperty(exports, "buildResolverContext", { enumerable: true, get: function () { return resolver_1.buildResolverContext; } });
8
7
  Object.defineProperty(exports, "resolvePathValue", { enumerable: true, get: function () { return resolver_1.resolvePathValue; } });
@@ -1,3 +1,2 @@
1
- import type { WorkflowContext } from './types';
2
- export declare function buildResolverContext(workflowContext?: WorkflowContext): Record<string, unknown>;
3
- export declare function resolvePathValue(path: string, context: Record<string, unknown>): unknown;
1
+ import { WorkflowContext } from "./types";
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 = exports.buildResolverContext = void 0;
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
- WORKFLOW_STEPS = "steps",
5
- IP_ADDRESSES = "ipAddress",
6
- DOMAINS = "domain",
7
- APPLICATIONS = "app",
8
- SECRETS = "secret",
9
- VARIABLES = "variable",
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
- project: Pick<IProject, 'id'> & {
18
+ [DataSourceType.PROJECT]: Pick<IProject, 'id'> & {
16
19
  name: string;
17
20
  };
18
- workflow: Pick<IWorkflow, 'id' | 'name' | 'description' | 'template' | 'status' | 'settings'>;
19
- workflowExecution?: Pick<IWorkflowExecution, 'id' | 'status' | 'startedAt' | 'completedAt' | 'context' | 'metadata'>;
20
- trigger?: IWorkflowTrigger & {
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
- triggers?: Record<string, IWorkflowTrigger>;
24
- stepExecutions?: Record<string, IWorkflowStepExecution>;
25
- steps?: IWorkflowStep[];
26
- ipAddresses?: Record<string, IIpAddress>;
27
- domains?: Record<string, IDomainVerification>;
28
- applications?: Record<string, Record<string, {
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
- secrets?: Record<string, Pick<ISecret, 'id' | 'key' | 'name'>>;
33
- variables?: Record<string, Pick<IVariable, 'id' | 'key' | 'name' | 'value'>>;
34
- abyss?: Record<string, {
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["WORKFLOW_STEPS"] = "steps";
8
- DataSourceType["IP_ADDRESSES"] = "ipAddress";
9
- DataSourceType["DOMAINS"] = "domain";
10
- DataSourceType["APPLICATIONS"] = "app";
11
- DataSourceType["SECRETS"] = "secret";
12
- DataSourceType["VARIABLES"] = "variable";
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 = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abyss-project/console",
3
- "version": "1.0.44",
3
+ "version": "1.0.45",
4
4
  "description": "Core package to interact with AbyssConsole",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",