@abyss-project/console 1.0.42 → 1.0.44
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/api/variable-access.api.d.ts +9 -0
- package/dist/api/variable-access.api.js +44 -0
- package/dist/api/variable-public.api.d.ts +2 -0
- package/dist/api/variable-public.api.js +9 -0
- package/dist/api/variable.api.d.ts +7 -0
- package/dist/api/variable.api.js +34 -0
- package/dist/constants/abyss-services.d.ts +0 -0
- package/dist/constants/abyss-services.js +1 -0
- package/dist/index.d.ts +26 -1
- package/dist/index.js +26 -1
- package/dist/types/constants/workflow.constants.d.ts +3 -0
- package/dist/types/constants/workflow.constants.js +4 -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/api/index.d.ts +6 -0
- package/dist/types/interface/api/index.js +6 -0
- package/dist/types/interface/api/requests/variable-access.request.d.ts +51 -0
- package/dist/types/interface/api/requests/variable-access.request.js +2 -0
- package/dist/types/interface/api/requests/variable-public.request.d.ts +3 -0
- package/dist/types/interface/api/requests/variable-public.request.js +2 -0
- package/dist/types/interface/api/requests/variable.request.d.ts +38 -0
- package/dist/types/interface/api/requests/variable.request.js +2 -0
- package/dist/types/interface/api/responses/variable-access.response.d.ts +25 -0
- package/dist/types/interface/api/responses/variable-access.response.js +2 -0
- package/dist/types/interface/api/responses/variable-public.response.d.ts +5 -0
- package/dist/types/interface/api/responses/variable-public.response.js +2 -0
- package/dist/types/interface/api/responses/variable.response.d.ts +23 -0
- package/dist/types/interface/api/responses/variable.response.js +2 -0
- package/dist/types/interface/index.d.ts +5 -0
- package/dist/types/interface/index.js +5 -0
- package/dist/types/interface/models/secret-access-ip-address.model.d.ts +0 -1
- package/dist/types/interface/models/variable-access-ip-address.model.d.ts +11 -0
- package/dist/types/interface/models/variable-access-ip-address.model.js +2 -0
- package/dist/types/interface/models/variable-access-log.model.d.ts +17 -0
- package/dist/types/interface/models/variable-access-log.model.js +2 -0
- package/dist/types/interface/models/variable-access-variable.model.d.ts +11 -0
- package/dist/types/interface/models/variable-access-variable.model.js +2 -0
- package/dist/types/interface/models/variable-access.model.d.ts +19 -0
- package/dist/types/interface/models/variable-access.model.js +2 -0
- package/dist/types/interface/models/variable.model.d.ts +13 -0
- package/dist/types/interface/models/variable.model.js +2 -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 -2
- package/dist/utils/webhook-trigger.utils.js +0 -53
- package/dist/workflow-expressions/index.d.ts +2 -4
- package/dist/workflow-expressions/index.js +1 -12
- package/dist/workflow-expressions/resolver.d.ts +0 -1
- package/dist/workflow-expressions/resolver.js +16 -34
- package/dist/workflow-expressions/types.d.ts +23 -41
- package/dist/workflow-expressions/types.js +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ICreateVariableAccessParams, ICreateVariableAccessBody, IPaginateVariableAccessParams, IPaginateVariableAccessQuery, IGetVariableAccessParams, IUpdateVariableAccessParams, IUpdateVariableAccessBody, IDeleteVariableAccessParams, IRegenerateTokenVariableAccessParams, IGetVariablePublicParams, IPaginateLogVariableAccessParams, IPaginateLogVariableAccessQuery, ICreateVariableAccessResponse, IPaginateVariableAccessResponse, IGetVariableAccessResponse, IUpdateVariableAccessResponse, IDeleteVariableAccessResponse, IRegenerateTokenVariableAccessResponse, IGetVariablePublicResponse, IPaginateLogVariableAccessResponse } from '../types';
|
|
2
|
+
export declare const createVariableAccess: (params: ICreateVariableAccessParams, body: ICreateVariableAccessBody) => Promise<ICreateVariableAccessResponse>;
|
|
3
|
+
export declare const paginateVariableAccess: (params: IPaginateVariableAccessParams, query: IPaginateVariableAccessQuery) => Promise<IPaginateVariableAccessResponse>;
|
|
4
|
+
export declare const getVariableAccess: (params: IGetVariableAccessParams) => Promise<IGetVariableAccessResponse>;
|
|
5
|
+
export declare const updateVariableAccess: (params: IUpdateVariableAccessParams, body: IUpdateVariableAccessBody) => Promise<IUpdateVariableAccessResponse>;
|
|
6
|
+
export declare const deleteVariableAccess: (params: IDeleteVariableAccessParams) => Promise<IDeleteVariableAccessResponse>;
|
|
7
|
+
export declare const regenerateVariableAccessToken: (params: IRegenerateTokenVariableAccessParams) => Promise<IRegenerateTokenVariableAccessResponse>;
|
|
8
|
+
export declare const getPublicVariables: (params: IGetVariablePublicParams) => Promise<IGetVariablePublicResponse>;
|
|
9
|
+
export declare const paginateVariableAccessLogs: (params: IPaginateLogVariableAccessParams, query: IPaginateLogVariableAccessQuery) => Promise<IPaginateLogVariableAccessResponse>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.paginateVariableAccessLogs = exports.getPublicVariables = exports.regenerateVariableAccessToken = exports.deleteVariableAccess = exports.updateVariableAccess = exports.getVariableAccess = exports.paginateVariableAccess = exports.createVariableAccess = void 0;
|
|
4
|
+
const __1 = require("..");
|
|
5
|
+
const createVariableAccess = async (params, body) => {
|
|
6
|
+
const response = await __1.AbyssConsoleCore.axios.post(`/variable-access/${params.projectId}`, body);
|
|
7
|
+
return response.data;
|
|
8
|
+
};
|
|
9
|
+
exports.createVariableAccess = createVariableAccess;
|
|
10
|
+
const paginateVariableAccess = async (params, query) => {
|
|
11
|
+
const response = await __1.AbyssConsoleCore.axios.get(`/variable-access/${params.projectId}/paginate`, { params: query });
|
|
12
|
+
return response.data;
|
|
13
|
+
};
|
|
14
|
+
exports.paginateVariableAccess = paginateVariableAccess;
|
|
15
|
+
const getVariableAccess = async (params) => {
|
|
16
|
+
const response = await __1.AbyssConsoleCore.axios.get(`/variable-access/${params.projectId}/${params.variableAccessId}`);
|
|
17
|
+
return response.data;
|
|
18
|
+
};
|
|
19
|
+
exports.getVariableAccess = getVariableAccess;
|
|
20
|
+
const updateVariableAccess = async (params, body) => {
|
|
21
|
+
const response = await __1.AbyssConsoleCore.axios.put(`/variable-access/${params.projectId}/${params.variableAccessId}`, body);
|
|
22
|
+
return response.data;
|
|
23
|
+
};
|
|
24
|
+
exports.updateVariableAccess = updateVariableAccess;
|
|
25
|
+
const deleteVariableAccess = async (params) => {
|
|
26
|
+
const response = await __1.AbyssConsoleCore.axios.delete(`/variable-access/${params.projectId}/${params.variableAccessId}`);
|
|
27
|
+
return response.data;
|
|
28
|
+
};
|
|
29
|
+
exports.deleteVariableAccess = deleteVariableAccess;
|
|
30
|
+
const regenerateVariableAccessToken = async (params) => {
|
|
31
|
+
const response = await __1.AbyssConsoleCore.axios.post(`/variable-access/${params.projectId}/${params.variableAccessId}/regenerate-token`);
|
|
32
|
+
return response.data;
|
|
33
|
+
};
|
|
34
|
+
exports.regenerateVariableAccessToken = regenerateVariableAccessToken;
|
|
35
|
+
const getPublicVariables = async (params) => {
|
|
36
|
+
const response = await __1.AbyssConsoleCore.axios.get(`/public/variables/${params.token}`);
|
|
37
|
+
return response.data;
|
|
38
|
+
};
|
|
39
|
+
exports.getPublicVariables = getPublicVariables;
|
|
40
|
+
const paginateVariableAccessLogs = async (params, query) => {
|
|
41
|
+
const response = await __1.AbyssConsoleCore.axios.get(`/variable-access/${params.projectId}/logs/paginate`, { params: query });
|
|
42
|
+
return response.data;
|
|
43
|
+
};
|
|
44
|
+
exports.paginateVariableAccessLogs = paginateVariableAccessLogs;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPublicVariables = void 0;
|
|
4
|
+
const __1 = require("..");
|
|
5
|
+
const getPublicVariables = async (params) => {
|
|
6
|
+
const response = await __1.AbyssConsoleCore.axios.get(`/public/variables/${params.token}`);
|
|
7
|
+
return response.data;
|
|
8
|
+
};
|
|
9
|
+
exports.getPublicVariables = getPublicVariables;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ICreateVariableParams, ICreateVariableBody, IListVariableParams, IPaginateVariableParams, IPaginateVariableQuery, IGetVariableParams, IUpdateVariableParams, IUpdateVariableBody, IDeleteVariableParams, ICreateVariableResponse, IListVariableResponse, IPaginateVariableResponse, IGetVariableResponse, IUpdateVariableResponse, IDeleteVariableResponse } from '../types';
|
|
2
|
+
export declare const createVariable: (params: ICreateVariableParams, body: ICreateVariableBody) => Promise<ICreateVariableResponse>;
|
|
3
|
+
export declare const listVariables: (params: IListVariableParams) => Promise<IListVariableResponse>;
|
|
4
|
+
export declare const paginateVariables: (params: IPaginateVariableParams, query: IPaginateVariableQuery) => Promise<IPaginateVariableResponse>;
|
|
5
|
+
export declare const getVariable: (params: IGetVariableParams) => Promise<IGetVariableResponse>;
|
|
6
|
+
export declare const updateVariable: (params: IUpdateVariableParams, body: IUpdateVariableBody) => Promise<IUpdateVariableResponse>;
|
|
7
|
+
export declare const deleteVariable: (params: IDeleteVariableParams) => Promise<IDeleteVariableResponse>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteVariable = exports.updateVariable = exports.getVariable = exports.paginateVariables = exports.listVariables = exports.createVariable = void 0;
|
|
4
|
+
const __1 = require("..");
|
|
5
|
+
const createVariable = async (params, body) => {
|
|
6
|
+
const response = await __1.AbyssConsoleCore.axios.post(`/variable/${params.projectId}`, body);
|
|
7
|
+
return response.data;
|
|
8
|
+
};
|
|
9
|
+
exports.createVariable = createVariable;
|
|
10
|
+
const listVariables = async (params) => {
|
|
11
|
+
const response = await __1.AbyssConsoleCore.axios.get(`/variable/${params.projectId}`);
|
|
12
|
+
return response.data;
|
|
13
|
+
};
|
|
14
|
+
exports.listVariables = listVariables;
|
|
15
|
+
const paginateVariables = async (params, query) => {
|
|
16
|
+
const response = await __1.AbyssConsoleCore.axios.get(`/variable/${params.projectId}/paginate`, { params: query });
|
|
17
|
+
return response.data;
|
|
18
|
+
};
|
|
19
|
+
exports.paginateVariables = paginateVariables;
|
|
20
|
+
const getVariable = async (params) => {
|
|
21
|
+
const response = await __1.AbyssConsoleCore.axios.get(`/variable/${params.projectId}/${params.variableId}`);
|
|
22
|
+
return response.data;
|
|
23
|
+
};
|
|
24
|
+
exports.getVariable = getVariable;
|
|
25
|
+
const updateVariable = async (params, body) => {
|
|
26
|
+
const response = await __1.AbyssConsoleCore.axios.put(`/variable/${params.projectId}/${params.variableId}`, body);
|
|
27
|
+
return response.data;
|
|
28
|
+
};
|
|
29
|
+
exports.updateVariable = updateVariable;
|
|
30
|
+
const deleteVariable = async (params) => {
|
|
31
|
+
const response = await __1.AbyssConsoleCore.axios.delete(`/variable/${params.projectId}/${params.variableId}`);
|
|
32
|
+
return response.data;
|
|
33
|
+
};
|
|
34
|
+
exports.deleteVariable = deleteVariable;
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
package/dist/index.d.ts
CHANGED
|
@@ -10,7 +10,9 @@ import * as projectAdminApi from './api/project.admin.api';
|
|
|
10
10
|
import * as secretApi from './api/secret.api';
|
|
11
11
|
import * as secretAccessApi from './api/secret-access.api';
|
|
12
12
|
import * as secretPublicApi from './api/secret-public.api';
|
|
13
|
-
|
|
13
|
+
import * as variableApi from './api/variable.api';
|
|
14
|
+
import * as variableAccessApi from './api/variable-access.api';
|
|
15
|
+
import * as variablePublicApi from './api/variable-public.api';
|
|
14
16
|
export * from './types';
|
|
15
17
|
export * from './utils';
|
|
16
18
|
export * as WorkflowExpression from './workflow-expressions';
|
|
@@ -83,6 +85,29 @@ type AbyssConsoleCoreSDK = {
|
|
|
83
85
|
secretPublic: {
|
|
84
86
|
getPublicSecrets: typeof secretPublicApi.getPublicSecrets;
|
|
85
87
|
};
|
|
88
|
+
variable: {
|
|
89
|
+
create: typeof variableApi.createVariable;
|
|
90
|
+
list: typeof variableApi.listVariables;
|
|
91
|
+
paginate: typeof variableApi.paginateVariables;
|
|
92
|
+
get: typeof variableApi.getVariable;
|
|
93
|
+
update: typeof variableApi.updateVariable;
|
|
94
|
+
delete: typeof variableApi.deleteVariable;
|
|
95
|
+
};
|
|
96
|
+
variableAccess: {
|
|
97
|
+
create: typeof variableAccessApi.createVariableAccess;
|
|
98
|
+
paginate: typeof variableAccessApi.paginateVariableAccess;
|
|
99
|
+
get: typeof variableAccessApi.getVariableAccess;
|
|
100
|
+
update: typeof variableAccessApi.updateVariableAccess;
|
|
101
|
+
delete: typeof variableAccessApi.deleteVariableAccess;
|
|
102
|
+
regenerateToken: typeof variableAccessApi.regenerateVariableAccessToken;
|
|
103
|
+
getPublic: typeof variableAccessApi.getPublicVariables;
|
|
104
|
+
logs: {
|
|
105
|
+
paginate: typeof variableAccessApi.paginateVariableAccessLogs;
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
variablePublic: {
|
|
109
|
+
getPublicVariables: typeof variablePublicApi.getPublicVariables;
|
|
110
|
+
};
|
|
86
111
|
workflow: {
|
|
87
112
|
create: typeof workflowApi.createWorkflow;
|
|
88
113
|
paginate: typeof workflowApi.paginateWorkflow;
|
package/dist/index.js
CHANGED
|
@@ -43,7 +43,9 @@ const projectAdminApi = __importStar(require("./api/project.admin.api"));
|
|
|
43
43
|
const secretApi = __importStar(require("./api/secret.api"));
|
|
44
44
|
const secretAccessApi = __importStar(require("./api/secret-access.api"));
|
|
45
45
|
const secretPublicApi = __importStar(require("./api/secret-public.api"));
|
|
46
|
-
|
|
46
|
+
const variableApi = __importStar(require("./api/variable.api"));
|
|
47
|
+
const variableAccessApi = __importStar(require("./api/variable-access.api"));
|
|
48
|
+
const variablePublicApi = __importStar(require("./api/variable-public.api"));
|
|
47
49
|
__exportStar(require("./types"), exports);
|
|
48
50
|
__exportStar(require("./utils"), exports);
|
|
49
51
|
exports.WorkflowExpression = __importStar(require("./workflow-expressions"));
|
|
@@ -169,6 +171,29 @@ class AbyssConsoleCore {
|
|
|
169
171
|
secretPublic: {
|
|
170
172
|
getPublicSecrets: secretPublicApi.getPublicSecrets,
|
|
171
173
|
},
|
|
174
|
+
variable: {
|
|
175
|
+
create: variableApi.createVariable,
|
|
176
|
+
list: variableApi.listVariables,
|
|
177
|
+
paginate: variableApi.paginateVariables,
|
|
178
|
+
get: variableApi.getVariable,
|
|
179
|
+
update: variableApi.updateVariable,
|
|
180
|
+
delete: variableApi.deleteVariable,
|
|
181
|
+
},
|
|
182
|
+
variableAccess: {
|
|
183
|
+
create: variableAccessApi.createVariableAccess,
|
|
184
|
+
paginate: variableAccessApi.paginateVariableAccess,
|
|
185
|
+
get: variableAccessApi.getVariableAccess,
|
|
186
|
+
update: variableAccessApi.updateVariableAccess,
|
|
187
|
+
delete: variableAccessApi.deleteVariableAccess,
|
|
188
|
+
regenerateToken: variableAccessApi.regenerateVariableAccessToken,
|
|
189
|
+
getPublic: variableAccessApi.getPublicVariables,
|
|
190
|
+
logs: {
|
|
191
|
+
paginate: variableAccessApi.paginateVariableAccessLogs,
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
variablePublic: {
|
|
195
|
+
getPublicVariables: variablePublicApi.getPublicVariables,
|
|
196
|
+
},
|
|
172
197
|
workflow: workflowSDK,
|
|
173
198
|
};
|
|
174
199
|
return baseSDK;
|
|
@@ -3,6 +3,9 @@ export declare const WORKFLOW_STEP_TIMEOUT: number;
|
|
|
3
3
|
export declare const SLEEP_DURATION_MIN = 0;
|
|
4
4
|
export declare const SLEEP_DURATION_MAX = 900;
|
|
5
5
|
export declare const SLEEP_DURATION_DEFAULT = 1;
|
|
6
|
+
export declare const CODE_STEP_TIMEOUT_MIN = 100;
|
|
7
|
+
export declare const CODE_STEP_TIMEOUT_MAX = 60000;
|
|
8
|
+
export declare const CODE_STEP_TIMEOUT_DEFAULT = 5000;
|
|
6
9
|
export declare const EXPRESSION_TIMEOUT_DEFAULT = 5000;
|
|
7
10
|
export declare const EXPRESSION_TIMEOUT_MAX = 30000;
|
|
8
11
|
export declare const EXPRESSION_CPU_TIMEOUT = 10000;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EXPRESSION_MEMORY_LIMIT = exports.EXPRESSION_CPU_TIMEOUT = exports.EXPRESSION_TIMEOUT_MAX = exports.EXPRESSION_TIMEOUT_DEFAULT = exports.SLEEP_DURATION_DEFAULT = exports.SLEEP_DURATION_MAX = exports.SLEEP_DURATION_MIN = exports.WORKFLOW_STEP_TIMEOUT = exports.WORKFLOW_EXECUTION_TIMEOUT = void 0;
|
|
3
|
+
exports.EXPRESSION_MEMORY_LIMIT = exports.EXPRESSION_CPU_TIMEOUT = exports.EXPRESSION_TIMEOUT_MAX = exports.EXPRESSION_TIMEOUT_DEFAULT = exports.CODE_STEP_TIMEOUT_DEFAULT = exports.CODE_STEP_TIMEOUT_MAX = exports.CODE_STEP_TIMEOUT_MIN = exports.SLEEP_DURATION_DEFAULT = exports.SLEEP_DURATION_MAX = exports.SLEEP_DURATION_MIN = exports.WORKFLOW_STEP_TIMEOUT = exports.WORKFLOW_EXECUTION_TIMEOUT = void 0;
|
|
4
4
|
exports.WORKFLOW_EXECUTION_TIMEOUT = 60 * 60 * 1000;
|
|
5
5
|
exports.WORKFLOW_STEP_TIMEOUT = 15 * 60 * 1000;
|
|
6
6
|
exports.SLEEP_DURATION_MIN = 0;
|
|
7
7
|
exports.SLEEP_DURATION_MAX = 900;
|
|
8
8
|
exports.SLEEP_DURATION_DEFAULT = 1;
|
|
9
|
+
exports.CODE_STEP_TIMEOUT_MIN = 100;
|
|
10
|
+
exports.CODE_STEP_TIMEOUT_MAX = 60000;
|
|
11
|
+
exports.CODE_STEP_TIMEOUT_DEFAULT = 5000;
|
|
9
12
|
exports.EXPRESSION_TIMEOUT_DEFAULT = 5000;
|
|
10
13
|
exports.EXPRESSION_TIMEOUT_MAX = 30000;
|
|
11
14
|
exports.EXPRESSION_CPU_TIMEOUT = 10000;
|
|
@@ -25,6 +25,10 @@ export interface ISwitchCondition {
|
|
|
25
25
|
export interface ISwitchStepConfig {
|
|
26
26
|
expression: string;
|
|
27
27
|
}
|
|
28
|
+
export interface ICodeStepConfig {
|
|
29
|
+
code: string;
|
|
30
|
+
timeout?: number;
|
|
31
|
+
}
|
|
28
32
|
export interface ICallWebhookActionConfig {
|
|
29
33
|
actionType: WorkflowActionType.CALL_WEBHOOK;
|
|
30
34
|
url: string;
|
|
@@ -40,7 +44,7 @@ export interface IInviteToProjectActionConfig {
|
|
|
40
44
|
permissions: string[];
|
|
41
45
|
}
|
|
42
46
|
export type IActionStepConfig = ICallWebhookActionConfig | IInviteToProjectActionConfig;
|
|
43
|
-
export type StepConfig = IFilterStepConfig | ISleepStepConfig | ISwitchStepConfig | IActionStepConfig;
|
|
47
|
+
export type StepConfig = IFilterStepConfig | ISleepStepConfig | ISwitchStepConfig | ICodeStepConfig | IActionStepConfig;
|
|
44
48
|
export interface IWorkflowSettings {
|
|
45
49
|
maxExecutionsPerHour?: number;
|
|
46
50
|
maxExecutionsPerDay?: number;
|
|
@@ -24,6 +24,7 @@ var WorkflowStepType;
|
|
|
24
24
|
WorkflowStepType["SLEEP"] = "SLEEP";
|
|
25
25
|
WorkflowStepType["SWITCH"] = "SWITCH";
|
|
26
26
|
WorkflowStepType["ACTION"] = "ACTION";
|
|
27
|
+
WorkflowStepType["CODE"] = "CODE";
|
|
27
28
|
})(WorkflowStepType || (exports.WorkflowStepType = WorkflowStepType = {}));
|
|
28
29
|
var WorkflowActionType;
|
|
29
30
|
(function (WorkflowActionType) {
|
|
@@ -13,6 +13,9 @@ export * from './requests/workflow-webhook.public.request';
|
|
|
13
13
|
export * from './requests/secret.request';
|
|
14
14
|
export * from './requests/secret-public.request';
|
|
15
15
|
export * from './requests/secret-access.request';
|
|
16
|
+
export * from './requests/variable.request';
|
|
17
|
+
export * from './requests/variable-public.request';
|
|
18
|
+
export * from './requests/variable-access.request';
|
|
16
19
|
export * from './responses/monitor.response';
|
|
17
20
|
export * from './responses/domain-verification.response';
|
|
18
21
|
export * from './responses/domain-verification.admin.response';
|
|
@@ -25,3 +28,6 @@ export * from './responses/workflow-webhook.public.response';
|
|
|
25
28
|
export * from './responses/secret.response';
|
|
26
29
|
export * from './responses/secret-public.response';
|
|
27
30
|
export * from './responses/secret-access.response';
|
|
31
|
+
export * from './responses/variable.response';
|
|
32
|
+
export * from './responses/variable-public.response';
|
|
33
|
+
export * from './responses/variable-access.response';
|
|
@@ -29,6 +29,9 @@ __exportStar(require("./requests/workflow-webhook.public.request"), exports);
|
|
|
29
29
|
__exportStar(require("./requests/secret.request"), exports);
|
|
30
30
|
__exportStar(require("./requests/secret-public.request"), exports);
|
|
31
31
|
__exportStar(require("./requests/secret-access.request"), exports);
|
|
32
|
+
__exportStar(require("./requests/variable.request"), exports);
|
|
33
|
+
__exportStar(require("./requests/variable-public.request"), exports);
|
|
34
|
+
__exportStar(require("./requests/variable-access.request"), exports);
|
|
32
35
|
__exportStar(require("./responses/monitor.response"), exports);
|
|
33
36
|
__exportStar(require("./responses/domain-verification.response"), exports);
|
|
34
37
|
__exportStar(require("./responses/domain-verification.admin.response"), exports);
|
|
@@ -41,3 +44,6 @@ __exportStar(require("./responses/workflow-webhook.public.response"), exports);
|
|
|
41
44
|
__exportStar(require("./responses/secret.response"), exports);
|
|
42
45
|
__exportStar(require("./responses/secret-public.response"), exports);
|
|
43
46
|
__exportStar(require("./responses/secret-access.response"), exports);
|
|
47
|
+
__exportStar(require("./responses/variable.response"), exports);
|
|
48
|
+
__exportStar(require("./responses/variable-public.response"), exports);
|
|
49
|
+
__exportStar(require("./responses/variable-access.response"), exports);
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { QueryPaginate } from '../type-message/base-paginate';
|
|
2
|
+
export interface ICreateVariableAccessParams {
|
|
3
|
+
projectId: string;
|
|
4
|
+
}
|
|
5
|
+
export interface ICreateVariableAccessBody {
|
|
6
|
+
name: string;
|
|
7
|
+
description?: string | null;
|
|
8
|
+
variableIds: string[];
|
|
9
|
+
isActive?: boolean;
|
|
10
|
+
expiresAt?: string | null;
|
|
11
|
+
ipAddressIds?: string[];
|
|
12
|
+
}
|
|
13
|
+
export interface IPaginateVariableAccessParams {
|
|
14
|
+
projectId: string;
|
|
15
|
+
}
|
|
16
|
+
export type IPaginateVariableAccessQuery = QueryPaginate & {
|
|
17
|
+
search?: string;
|
|
18
|
+
variableId?: string;
|
|
19
|
+
};
|
|
20
|
+
export interface IGetVariableAccessParams {
|
|
21
|
+
projectId: string;
|
|
22
|
+
variableAccessId: string;
|
|
23
|
+
}
|
|
24
|
+
export interface IUpdateVariableAccessParams {
|
|
25
|
+
projectId: string;
|
|
26
|
+
variableAccessId: string;
|
|
27
|
+
}
|
|
28
|
+
export interface IUpdateVariableAccessBody {
|
|
29
|
+
name?: string;
|
|
30
|
+
description?: string | null;
|
|
31
|
+
variableIds?: string[];
|
|
32
|
+
isActive?: boolean;
|
|
33
|
+
expiresAt?: string | null;
|
|
34
|
+
ipAddressIds?: string[];
|
|
35
|
+
}
|
|
36
|
+
export interface IDeleteVariableAccessParams {
|
|
37
|
+
projectId: string;
|
|
38
|
+
variableAccessId: string;
|
|
39
|
+
}
|
|
40
|
+
export interface IRegenerateTokenVariableAccessParams {
|
|
41
|
+
projectId: string;
|
|
42
|
+
variableAccessId: string;
|
|
43
|
+
}
|
|
44
|
+
export interface IPaginateLogVariableAccessParams {
|
|
45
|
+
projectId: string;
|
|
46
|
+
}
|
|
47
|
+
export type IPaginateLogVariableAccessQuery = QueryPaginate & {
|
|
48
|
+
variableAccessId?: string;
|
|
49
|
+
variableId?: string;
|
|
50
|
+
success?: boolean;
|
|
51
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { QueryPaginate } from '../type-message/base-paginate';
|
|
2
|
+
export interface ICreateVariableParams {
|
|
3
|
+
projectId: string;
|
|
4
|
+
}
|
|
5
|
+
export interface ICreateVariableBody {
|
|
6
|
+
name: string;
|
|
7
|
+
description?: string | null;
|
|
8
|
+
key: string;
|
|
9
|
+
value: string;
|
|
10
|
+
isActive?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface IListVariableParams {
|
|
13
|
+
projectId: string;
|
|
14
|
+
}
|
|
15
|
+
export interface IPaginateVariableParams {
|
|
16
|
+
projectId: string;
|
|
17
|
+
}
|
|
18
|
+
export type IPaginateVariableQuery = QueryPaginate & {
|
|
19
|
+
search?: string;
|
|
20
|
+
};
|
|
21
|
+
export interface IGetVariableParams {
|
|
22
|
+
projectId: string;
|
|
23
|
+
variableId: string;
|
|
24
|
+
}
|
|
25
|
+
export interface IUpdateVariableParams {
|
|
26
|
+
projectId: string;
|
|
27
|
+
variableId: string;
|
|
28
|
+
}
|
|
29
|
+
export interface IUpdateVariableBody {
|
|
30
|
+
name?: string;
|
|
31
|
+
description?: string | null;
|
|
32
|
+
value?: string;
|
|
33
|
+
isActive?: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface IDeleteVariableParams {
|
|
36
|
+
projectId: string;
|
|
37
|
+
variableId: string;
|
|
38
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { IVariableAccess } from '../../models/variable-access.model';
|
|
2
|
+
import { IVariableAccessLog } from '../../models/variable-access-log.model';
|
|
3
|
+
import { IResponse } from '../type-message/response';
|
|
4
|
+
import { BasePaginate } from '../type-message/base-paginate';
|
|
5
|
+
export interface ICreateVariableAccessData {
|
|
6
|
+
variableAccess: IVariableAccess;
|
|
7
|
+
}
|
|
8
|
+
export type ICreateVariableAccessResponse = IResponse<ICreateVariableAccessData>;
|
|
9
|
+
export type IPaginateVariableAccessResponse = IResponse<BasePaginate<IVariableAccess>>;
|
|
10
|
+
export interface IGetVariableAccessData {
|
|
11
|
+
variableAccess: IVariableAccess;
|
|
12
|
+
}
|
|
13
|
+
export type IGetVariableAccessResponse = IResponse<IGetVariableAccessData>;
|
|
14
|
+
export interface IUpdateVariableAccessData {
|
|
15
|
+
variableAccess: IVariableAccess;
|
|
16
|
+
}
|
|
17
|
+
export type IUpdateVariableAccessResponse = IResponse<IUpdateVariableAccessData>;
|
|
18
|
+
export interface IDeleteVariableAccessData {
|
|
19
|
+
}
|
|
20
|
+
export type IDeleteVariableAccessResponse = IResponse<IDeleteVariableAccessData>;
|
|
21
|
+
export interface IRegenerateTokenVariableAccessData {
|
|
22
|
+
variableAccess: IVariableAccess;
|
|
23
|
+
}
|
|
24
|
+
export type IRegenerateTokenVariableAccessResponse = IResponse<IRegenerateTokenVariableAccessData>;
|
|
25
|
+
export type IPaginateLogVariableAccessResponse = IResponse<BasePaginate<IVariableAccessLog>>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { IVariable } from '../../models/variable.model';
|
|
2
|
+
import { IResponse } from '../type-message/response';
|
|
3
|
+
import { BasePaginate } from '../type-message/base-paginate';
|
|
4
|
+
export interface ICreateVariableData {
|
|
5
|
+
variable: IVariable;
|
|
6
|
+
}
|
|
7
|
+
export type ICreateVariableResponse = IResponse<ICreateVariableData>;
|
|
8
|
+
export interface IListVariableData {
|
|
9
|
+
variables: IVariable[];
|
|
10
|
+
}
|
|
11
|
+
export type IListVariableResponse = IResponse<IListVariableData>;
|
|
12
|
+
export type IPaginateVariableResponse = IResponse<BasePaginate<IVariable>>;
|
|
13
|
+
export interface IGetVariableData {
|
|
14
|
+
variable: IVariable;
|
|
15
|
+
}
|
|
16
|
+
export type IGetVariableResponse = IResponse<IGetVariableData>;
|
|
17
|
+
export interface IUpdateVariableData {
|
|
18
|
+
variable: IVariable;
|
|
19
|
+
}
|
|
20
|
+
export type IUpdateVariableResponse = IResponse<IUpdateVariableData>;
|
|
21
|
+
export interface IDeleteVariableData {
|
|
22
|
+
}
|
|
23
|
+
export type IDeleteVariableResponse = IResponse<IDeleteVariableData>;
|
|
@@ -15,3 +15,8 @@ export * from './models/secret-access-secret.model';
|
|
|
15
15
|
export * from './models/secret-access.model';
|
|
16
16
|
export * from './models/secret-access-log.model';
|
|
17
17
|
export * from './models/secret-access-ip-address.model';
|
|
18
|
+
export * from './models/variable.model';
|
|
19
|
+
export * from './models/variable-access.model';
|
|
20
|
+
export * from './models/variable-access-variable.model';
|
|
21
|
+
export * from './models/variable-access-ip-address.model';
|
|
22
|
+
export * from './models/variable-access-log.model';
|
|
@@ -31,3 +31,8 @@ __exportStar(require("./models/secret-access-secret.model"), exports);
|
|
|
31
31
|
__exportStar(require("./models/secret-access.model"), exports);
|
|
32
32
|
__exportStar(require("./models/secret-access-log.model"), exports);
|
|
33
33
|
__exportStar(require("./models/secret-access-ip-address.model"), exports);
|
|
34
|
+
__exportStar(require("./models/variable.model"), exports);
|
|
35
|
+
__exportStar(require("./models/variable-access.model"), exports);
|
|
36
|
+
__exportStar(require("./models/variable-access-variable.model"), exports);
|
|
37
|
+
__exportStar(require("./models/variable-access-ip-address.model"), exports);
|
|
38
|
+
__exportStar(require("./models/variable-access-log.model"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IVariableAccess } from './variable-access.model';
|
|
2
|
+
import { IIpAddress } from './ip-address.model';
|
|
3
|
+
export interface IVariableAccessIpAddress {
|
|
4
|
+
id: string;
|
|
5
|
+
variableAccessId: string;
|
|
6
|
+
ipAddressId: string;
|
|
7
|
+
createdAt?: Date;
|
|
8
|
+
updatedAt?: Date;
|
|
9
|
+
variableAccess?: IVariableAccess;
|
|
10
|
+
ipAddress?: IIpAddress;
|
|
11
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IVariableAccess, IVariable } from '..';
|
|
2
|
+
export interface IVariableAccessLog {
|
|
3
|
+
id: string;
|
|
4
|
+
variableAccessId: string | null;
|
|
5
|
+
variableId: string;
|
|
6
|
+
projectAccessId: string | null;
|
|
7
|
+
userId: string | null;
|
|
8
|
+
ipAddress: string;
|
|
9
|
+
userAgent: string | null;
|
|
10
|
+
success: boolean;
|
|
11
|
+
errorMessage: string | null;
|
|
12
|
+
accessedAt: Date;
|
|
13
|
+
createdAt?: Date;
|
|
14
|
+
updatedAt?: Date;
|
|
15
|
+
variableAccess?: IVariableAccess;
|
|
16
|
+
variable?: IVariable;
|
|
17
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IVariableAccess } from './variable-access.model';
|
|
2
|
+
import { IVariable } from './variable.model';
|
|
3
|
+
export interface IVariableAccessVariable {
|
|
4
|
+
id: string;
|
|
5
|
+
variableAccessId: string;
|
|
6
|
+
variableId: string;
|
|
7
|
+
createdAt?: Date;
|
|
8
|
+
updatedAt?: Date;
|
|
9
|
+
variableAccess?: IVariableAccess;
|
|
10
|
+
variable?: IVariable;
|
|
11
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IProject } from './project.model';
|
|
2
|
+
import { IVariableAccessVariable } from './variable-access-variable.model';
|
|
3
|
+
import { IVariableAccessIpAddress } from './variable-access-ip-address.model';
|
|
4
|
+
import { IVariableAccessLog } from './variable-access-log.model';
|
|
5
|
+
export interface IVariableAccess {
|
|
6
|
+
id: string;
|
|
7
|
+
projectId: string;
|
|
8
|
+
name: string;
|
|
9
|
+
description: string | null;
|
|
10
|
+
token: string;
|
|
11
|
+
isActive: boolean;
|
|
12
|
+
expiresAt: Date | null;
|
|
13
|
+
createdAt?: Date;
|
|
14
|
+
updatedAt?: Date;
|
|
15
|
+
project?: IProject;
|
|
16
|
+
variableAccessVariable?: IVariableAccessVariable[];
|
|
17
|
+
variableAccessIpAddress?: IVariableAccessIpAddress[];
|
|
18
|
+
variableAccessLog?: IVariableAccessLog[];
|
|
19
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IProject } from './project.model';
|
|
2
|
+
export interface IVariable {
|
|
3
|
+
id: string;
|
|
4
|
+
projectId: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description: string | null;
|
|
7
|
+
key: string;
|
|
8
|
+
value: string;
|
|
9
|
+
isActive: boolean;
|
|
10
|
+
createdAt?: Date;
|
|
11
|
+
updatedAt?: Date;
|
|
12
|
+
project?: IProject;
|
|
13
|
+
}
|
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/index.js
CHANGED
|
@@ -15,6 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./error.utils"), exports);
|
|
18
|
-
__exportStar(require("./reference-resolver.utils"), exports);
|
|
19
18
|
__exportStar(require("./ip-address-validator.utils"), exports);
|
|
20
|
-
__exportStar(require("./
|
|
19
|
+
__exportStar(require("./cidr.util"), exports);
|
|
@@ -1,54 +1 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.matchesTriggerFilters = void 0;
|
|
4
|
-
const matchesTriggerFilters = (trigger, triggerData) => {
|
|
5
|
-
if (!trigger.filters || trigger.filters.length === 0) {
|
|
6
|
-
return true;
|
|
7
|
-
}
|
|
8
|
-
return trigger.filters.every((filter) => {
|
|
9
|
-
if (filter.expression) {
|
|
10
|
-
try {
|
|
11
|
-
const context = { trigger: triggerData };
|
|
12
|
-
const result = evaluateSimpleExpression(filter.expression, context);
|
|
13
|
-
return Boolean(result);
|
|
14
|
-
}
|
|
15
|
-
catch (error) {
|
|
16
|
-
console.error('Expression evaluation error:', error);
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return true;
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
exports.matchesTriggerFilters = matchesTriggerFilters;
|
|
24
|
-
function evaluateSimpleExpression(expression, context) {
|
|
25
|
-
let evaluated = expression;
|
|
26
|
-
const pattern = /\{\{([^}]+)\}\}/g;
|
|
27
|
-
const matches = [...expression.matchAll(pattern)];
|
|
28
|
-
for (const match of matches) {
|
|
29
|
-
const [fullMatch, path] = match;
|
|
30
|
-
const value = getNestedValue(context, path.trim());
|
|
31
|
-
const valueStr = typeof value === 'string'
|
|
32
|
-
? `"${value.replace(/"/g, '\\"')}"`
|
|
33
|
-
: JSON.stringify(value);
|
|
34
|
-
evaluated = evaluated.replace(fullMatch, valueStr);
|
|
35
|
-
}
|
|
36
|
-
try {
|
|
37
|
-
return new Function(`return ${evaluated}`)();
|
|
38
|
-
}
|
|
39
|
-
catch (error) {
|
|
40
|
-
console.error('Failed to evaluate expression:', evaluated, error);
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
function getNestedValue(obj, path) {
|
|
45
|
-
const segments = path.split('.');
|
|
46
|
-
let current = obj;
|
|
47
|
-
for (const segment of segments) {
|
|
48
|
-
if (current === null || current === undefined) {
|
|
49
|
-
return undefined;
|
|
50
|
-
}
|
|
51
|
-
current = current[segment];
|
|
52
|
-
}
|
|
53
|
-
return current;
|
|
54
|
-
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
export { DataSourceType } from './types';
|
|
2
|
-
export type { WorkflowContext
|
|
3
|
-
export { buildResolverContext, resolvePathValue
|
|
4
|
-
export declare function hasTemplates(str: string): boolean;
|
|
5
|
-
export declare function extractTemplates(str: string): string[];
|
|
2
|
+
export type { WorkflowContext } from './types';
|
|
3
|
+
export { buildResolverContext, resolvePathValue } from './resolver';
|
|
@@ -1,19 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.resolvePathValue = exports.buildResolverContext = 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
7
|
Object.defineProperty(exports, "buildResolverContext", { enumerable: true, get: function () { return resolver_1.buildResolverContext; } });
|
|
8
8
|
Object.defineProperty(exports, "resolvePathValue", { enumerable: true, get: function () { return resolver_1.resolvePathValue; } });
|
|
9
|
-
Object.defineProperty(exports, "interpolateTemplate", { enumerable: true, get: function () { return resolver_1.interpolateTemplate; } });
|
|
10
|
-
function hasTemplates(str) {
|
|
11
|
-
return /\{\{.+?\}\}/.test(str);
|
|
12
|
-
}
|
|
13
|
-
exports.hasTemplates = hasTemplates;
|
|
14
|
-
function extractTemplates(str) {
|
|
15
|
-
const pattern = /\{\{(.+?)\}\}/g;
|
|
16
|
-
const matches = [...str.matchAll(pattern)];
|
|
17
|
-
return matches.map(m => m[1].trim());
|
|
18
|
-
}
|
|
19
|
-
exports.extractTemplates = extractTemplates;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { WorkflowContext } from './types';
|
|
2
2
|
export declare function buildResolverContext(workflowContext?: WorkflowContext): Record<string, unknown>;
|
|
3
3
|
export declare function resolvePathValue(path: string, context: Record<string, unknown>): unknown;
|
|
4
|
-
export declare function interpolateTemplate(template: string, context: Record<string, unknown>): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.resolvePathValue = exports.buildResolverContext = void 0;
|
|
4
4
|
function buildResolverContext(workflowContext) {
|
|
5
5
|
var _a;
|
|
6
6
|
if (!workflowContext) {
|
|
@@ -14,28 +14,28 @@ function buildResolverContext(workflowContext) {
|
|
|
14
14
|
context.triggers = workflowContext.triggers;
|
|
15
15
|
}
|
|
16
16
|
if (workflowContext.stepExecutions) {
|
|
17
|
-
const
|
|
17
|
+
const stepExecutions = {};
|
|
18
18
|
for (const [stepId, execution] of Object.entries(workflowContext.stepExecutions)) {
|
|
19
19
|
const step = (_a = workflowContext.steps) === null || _a === void 0 ? void 0 : _a.find((s) => s.id === stepId);
|
|
20
20
|
const stepKey = (step === null || step === void 0 ? void 0 : step.name) || stepId;
|
|
21
|
-
|
|
21
|
+
stepExecutions[stepKey] = execution.outputData;
|
|
22
22
|
}
|
|
23
|
-
context.
|
|
23
|
+
context.stepExecutions = stepExecutions;
|
|
24
24
|
}
|
|
25
|
-
if (workflowContext.
|
|
26
|
-
context.
|
|
25
|
+
if (workflowContext.steps) {
|
|
26
|
+
context.steps = workflowContext.steps;
|
|
27
27
|
}
|
|
28
28
|
if (workflowContext.ipAddresses) {
|
|
29
|
-
context.
|
|
29
|
+
context.ipAddresses = workflowContext.ipAddresses;
|
|
30
30
|
}
|
|
31
31
|
if (workflowContext.domains) {
|
|
32
|
-
context.
|
|
32
|
+
context.domains = workflowContext.domains;
|
|
33
33
|
}
|
|
34
34
|
if (workflowContext.applications) {
|
|
35
|
-
context.
|
|
35
|
+
context.applications = workflowContext.applications;
|
|
36
36
|
}
|
|
37
37
|
if (workflowContext.secrets) {
|
|
38
|
-
context.
|
|
38
|
+
context.secrets = workflowContext.secrets;
|
|
39
39
|
}
|
|
40
40
|
if (workflowContext.project) {
|
|
41
41
|
context.project = workflowContext.project;
|
|
@@ -43,6 +43,12 @@ function buildResolverContext(workflowContext) {
|
|
|
43
43
|
if (workflowContext.workflow) {
|
|
44
44
|
context.workflow = workflowContext.workflow;
|
|
45
45
|
}
|
|
46
|
+
if (workflowContext.workflowExecution) {
|
|
47
|
+
context.workflowExecution = workflowContext.workflowExecution;
|
|
48
|
+
}
|
|
49
|
+
if (workflowContext.abyss) {
|
|
50
|
+
context.abyss = workflowContext.abyss;
|
|
51
|
+
}
|
|
46
52
|
return context;
|
|
47
53
|
}
|
|
48
54
|
exports.buildResolverContext = buildResolverContext;
|
|
@@ -60,27 +66,3 @@ function resolvePathValue(path, context) {
|
|
|
60
66
|
return current;
|
|
61
67
|
}
|
|
62
68
|
exports.resolvePathValue = resolvePathValue;
|
|
63
|
-
function interpolateTemplate(template, context) {
|
|
64
|
-
if (!template || typeof template !== 'string') {
|
|
65
|
-
return String(template || '');
|
|
66
|
-
}
|
|
67
|
-
const pattern = /\{\{(.+?)\}\}/g;
|
|
68
|
-
const matches = [...template.matchAll(pattern)];
|
|
69
|
-
if (matches.length === 0) {
|
|
70
|
-
return template;
|
|
71
|
-
}
|
|
72
|
-
let result = template;
|
|
73
|
-
for (const match of matches) {
|
|
74
|
-
const [fullMatch, expression] = match;
|
|
75
|
-
try {
|
|
76
|
-
const value = resolvePathValue(expression.trim(), context);
|
|
77
|
-
result = result.replace(fullMatch, String(value !== null && value !== void 0 ? value : ''));
|
|
78
|
-
}
|
|
79
|
-
catch (error) {
|
|
80
|
-
console.error(`Failed to interpolate ${expression}:`, error);
|
|
81
|
-
result = result.replace(fullMatch, `{{${expression}}}`);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return result;
|
|
85
|
-
}
|
|
86
|
-
exports.interpolateTemplate = interpolateTemplate;
|
|
@@ -1,56 +1,38 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { IWorkflowSettings } from '../types';
|
|
1
|
+
import type { IProject, IWorkflow, IWorkflowTrigger, IWorkflowStep, IWorkflowStepExecution, IWorkflowExecution, IIpAddress, IDomainVerification, ISecret, IVariable } 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",
|
|
9
|
+
VARIABLES = "variable",
|
|
11
10
|
PROJECT = "project",
|
|
12
|
-
WORKFLOW = "workflow"
|
|
11
|
+
WORKFLOW = "workflow",
|
|
12
|
+
ABYSS = "abyss"
|
|
13
13
|
}
|
|
14
14
|
export interface WorkflowContext {
|
|
15
|
-
project: {
|
|
16
|
-
id: string;
|
|
15
|
+
project: Pick<IProject, 'id'> & {
|
|
17
16
|
name: string;
|
|
18
17
|
};
|
|
19
|
-
workflow:
|
|
18
|
+
workflow: Pick<IWorkflow, 'id' | 'name' | 'description' | 'template' | 'status' | 'settings'>;
|
|
19
|
+
workflowExecution?: Pick<IWorkflowExecution, 'id' | 'status' | 'startedAt' | 'completedAt' | 'context' | 'metadata'>;
|
|
20
|
+
trigger?: IWorkflowTrigger & {
|
|
21
|
+
data: unknown;
|
|
22
|
+
};
|
|
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, {
|
|
20
29
|
id: string;
|
|
21
30
|
name: string;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
stepExecutions?: Record<string, StepExecution>;
|
|
30
|
-
variables?: Record<string, unknown>;
|
|
31
|
-
steps?: WorkflowStep[];
|
|
32
|
-
ipAddresses?: Record<string, Record<string, unknown>>;
|
|
33
|
-
domains?: Record<string, Record<string, unknown>>;
|
|
34
|
-
applications?: Record<string, Record<string, unknown>>;
|
|
35
|
-
secrets?: Record<string, string>;
|
|
36
|
-
}
|
|
37
|
-
export interface StepExecution {
|
|
38
|
-
stepId: string;
|
|
39
|
-
outputData: unknown;
|
|
40
|
-
status: 'success' | 'failed' | 'running' | 'pending';
|
|
41
|
-
startedAt?: Date;
|
|
42
|
-
completedAt?: Date;
|
|
43
|
-
error?: string;
|
|
44
|
-
}
|
|
45
|
-
export interface WorkflowStep {
|
|
46
|
-
id: string;
|
|
47
|
-
name: string;
|
|
48
|
-
type: string;
|
|
49
|
-
config?: Record<string, unknown>;
|
|
50
|
-
}
|
|
51
|
-
export interface TriggerInfo {
|
|
52
|
-
id: string;
|
|
53
|
-
name: string;
|
|
54
|
-
type: WorkflowTriggerType;
|
|
55
|
-
isActive: boolean;
|
|
31
|
+
}>>;
|
|
32
|
+
secrets?: Record<string, Pick<ISecret, 'id' | 'key' | 'name'>>;
|
|
33
|
+
variables?: Record<string, Pick<IVariable, 'id' | 'key' | 'name' | 'value'>>;
|
|
34
|
+
abyss?: Record<string, {
|
|
35
|
+
api: string;
|
|
36
|
+
site?: string;
|
|
37
|
+
}>;
|
|
56
38
|
}
|
|
@@ -5,11 +5,12 @@ 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";
|
|
12
|
+
DataSourceType["VARIABLES"] = "variable";
|
|
13
13
|
DataSourceType["PROJECT"] = "project";
|
|
14
14
|
DataSourceType["WORKFLOW"] = "workflow";
|
|
15
|
+
DataSourceType["ABYSS"] = "abyss";
|
|
15
16
|
})(DataSourceType || (exports.DataSourceType = DataSourceType = {}));
|