@hexabot-ai/types 3.0.7 → 3.1.0
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/cjs/workflow/domain.js +16 -1
- package/dist/cjs/workflow/index.js +6 -1
- package/dist/cjs/workflow/workflow.js +73 -1
- package/dist/esm/workflow/domain.js +15 -0
- package/dist/esm/workflow/index.js +2 -2
- package/dist/esm/workflow/workflow.js +73 -1
- package/dist/types/channel/source-full.d.ts +38 -0
- package/dist/types/channel/source-full.d.ts.map +1 -1
- package/dist/types/workflow/domain.d.ts +13 -0
- package/dist/types/workflow/domain.d.ts.map +1 -1
- package/dist/types/workflow/index.d.ts +2 -2
- package/dist/types/workflow/index.d.ts.map +1 -1
- package/dist/types/workflow/memory-record.d.ts +38 -0
- package/dist/types/workflow/memory-record.d.ts.map +1 -1
- package/dist/types/workflow/workflow-run.d.ts +38 -0
- package/dist/types/workflow/workflow-run.d.ts.map +1 -1
- package/dist/types/workflow/workflow-transfer.d.ts +38 -0
- package/dist/types/workflow/workflow-transfer.d.ts.map +1 -1
- package/dist/types/workflow/workflow-version.d.ts +38 -0
- package/dist/types/workflow/workflow-version.d.ts.map +1 -1
- package/dist/types/workflow/workflow.d.ts +190 -0
- package/dist/types/workflow/workflow.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/index.test.ts +46 -0
- package/src/workflow/domain.ts +17 -0
- package/src/workflow/index.ts +6 -0
- package/src/workflow/workflow.ts +109 -1
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Full terms: see LICENSE.md.
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.directionTypeSchema = exports.mcpServerTransportSchema = exports.memoryScopeSchema = exports.workflowVersionActionSchema = exports.workflowTypeSchema = exports.DirectionType = exports.McpServerTransport = exports.MemoryScope = exports.WorkflowVersionAction = exports.WorkflowType = void 0;
|
|
8
|
+
exports.webhookJwtAlgorithmSchema = exports.webhookAuthTypeSchema = exports.directionTypeSchema = exports.mcpServerTransportSchema = exports.memoryScopeSchema = exports.workflowVersionActionSchema = exports.workflowTypeSchema = exports.WebhookJwtAlgorithm = exports.WebhookAuthType = exports.DirectionType = exports.McpServerTransport = exports.MemoryScope = exports.WorkflowVersionAction = exports.WorkflowType = void 0;
|
|
9
9
|
const zod_1 = require("zod");
|
|
10
10
|
var WorkflowType;
|
|
11
11
|
(function (WorkflowType) {
|
|
@@ -37,8 +37,23 @@ var DirectionType;
|
|
|
37
37
|
DirectionType["HORIZONTAL"] = "horizontal";
|
|
38
38
|
DirectionType["VERTICAL"] = "vertical";
|
|
39
39
|
})(DirectionType || (exports.DirectionType = DirectionType = {}));
|
|
40
|
+
var WebhookAuthType;
|
|
41
|
+
(function (WebhookAuthType) {
|
|
42
|
+
WebhookAuthType["none"] = "none";
|
|
43
|
+
WebhookAuthType["basic"] = "basic";
|
|
44
|
+
WebhookAuthType["header"] = "header";
|
|
45
|
+
WebhookAuthType["jwt"] = "jwt";
|
|
46
|
+
})(WebhookAuthType || (exports.WebhookAuthType = WebhookAuthType = {}));
|
|
47
|
+
var WebhookJwtAlgorithm;
|
|
48
|
+
(function (WebhookJwtAlgorithm) {
|
|
49
|
+
WebhookJwtAlgorithm["HS256"] = "HS256";
|
|
50
|
+
WebhookJwtAlgorithm["HS384"] = "HS384";
|
|
51
|
+
WebhookJwtAlgorithm["HS512"] = "HS512";
|
|
52
|
+
})(WebhookJwtAlgorithm || (exports.WebhookJwtAlgorithm = WebhookJwtAlgorithm = {}));
|
|
40
53
|
exports.workflowTypeSchema = zod_1.z.enum(WorkflowType);
|
|
41
54
|
exports.workflowVersionActionSchema = zod_1.z.enum(WorkflowVersionAction);
|
|
42
55
|
exports.memoryScopeSchema = zod_1.z.enum(MemoryScope);
|
|
43
56
|
exports.mcpServerTransportSchema = zod_1.z.enum(McpServerTransport);
|
|
44
57
|
exports.directionTypeSchema = zod_1.z.enum(DirectionType);
|
|
58
|
+
exports.webhookAuthTypeSchema = zod_1.z.enum(WebhookAuthType);
|
|
59
|
+
exports.webhookJwtAlgorithmSchema = zod_1.z.enum(WebhookJwtAlgorithm);
|
|
@@ -5,15 +5,20 @@
|
|
|
5
5
|
* Full terms: see LICENSE.md.
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.workflowTransferResourceKindSchema = exports.workflowImportResultSchema = exports.workflowImportResourceResultSchema = exports.workflowImportResourceActionSchema = exports.workflowExportBundleWorkflowDependencySchema = exports.workflowExportBundleV1Schema = exports.workflowExportBundleSchema = exports.workflowExportBundleMemoryDefinitionSchema = exports.workflowExportBundleMcpServerSchema = exports.workflowExportBundleLabelSchema = exports.workflowExportBundleLabelGroupSchema = exports.workflowExportBundleCredentialSchema = exports.workflowExportBundleContentTypeSchema = exports.WORKFLOW_TRANSFER_RESOURCE_KIND_PATTERN = exports.WORKFLOW_EXPORT_BUNDLE_KIND = exports.mcpServerStubSchema = exports.mcpServerSchema = exports.mcpServerFullSchema = exports.memoryRecordStubSchema = exports.memoryRecordSchema = exports.memoryRecordFullSchema = exports.memoryDefinitionStubSchema = exports.memoryDefinitionSchema = exports.memoryDefinitionFullSchema = exports.workflowRunStubSchema = exports.workflowRunSchema = exports.workflowRunFullSchema = exports.resolveRunDurationMs = exports.workflowVersionStubSchema = exports.workflowVersionSchema = exports.workflowVersionFullSchema = exports.workflowStubSchema = exports.workflowSchema = exports.workflowFullSchema = exports.createWorkflowFullSchema = exports.WorkflowVersionAction = exports.WorkflowType = exports.MemoryScope = exports.McpServerTransport = exports.DirectionType = void 0;
|
|
8
|
+
exports.workflowTransferResourceKindSchema = exports.workflowImportResultSchema = exports.workflowImportResourceResultSchema = exports.workflowImportResourceActionSchema = exports.workflowExportBundleWorkflowDependencySchema = exports.workflowExportBundleV1Schema = exports.workflowExportBundleSchema = exports.workflowExportBundleMemoryDefinitionSchema = exports.workflowExportBundleMcpServerSchema = exports.workflowExportBundleLabelSchema = exports.workflowExportBundleLabelGroupSchema = exports.workflowExportBundleCredentialSchema = exports.workflowExportBundleContentTypeSchema = exports.WORKFLOW_TRANSFER_RESOURCE_KIND_PATTERN = exports.WORKFLOW_EXPORT_BUNDLE_KIND = exports.mcpServerStubSchema = exports.mcpServerSchema = exports.mcpServerFullSchema = exports.memoryRecordStubSchema = exports.memoryRecordSchema = exports.memoryRecordFullSchema = exports.memoryDefinitionStubSchema = exports.memoryDefinitionSchema = exports.memoryDefinitionFullSchema = exports.workflowRunStubSchema = exports.workflowRunSchema = exports.workflowRunFullSchema = exports.resolveRunDurationMs = exports.workflowVersionStubSchema = exports.workflowVersionSchema = exports.workflowVersionFullSchema = exports.workflowStubSchema = exports.workflowSchema = exports.workflowFullSchema = exports.webhookTriggerSchema = exports.createWorkflowFullSchema = exports.WorkflowVersionAction = exports.WorkflowType = exports.webhookJwtAlgorithmSchema = exports.webhookAuthTypeSchema = exports.WebhookJwtAlgorithm = exports.WebhookAuthType = exports.MemoryScope = exports.McpServerTransport = exports.DirectionType = void 0;
|
|
9
9
|
var domain_1 = require("./domain");
|
|
10
10
|
Object.defineProperty(exports, "DirectionType", { enumerable: true, get: function () { return domain_1.DirectionType; } });
|
|
11
11
|
Object.defineProperty(exports, "McpServerTransport", { enumerable: true, get: function () { return domain_1.McpServerTransport; } });
|
|
12
12
|
Object.defineProperty(exports, "MemoryScope", { enumerable: true, get: function () { return domain_1.MemoryScope; } });
|
|
13
|
+
Object.defineProperty(exports, "WebhookAuthType", { enumerable: true, get: function () { return domain_1.WebhookAuthType; } });
|
|
14
|
+
Object.defineProperty(exports, "WebhookJwtAlgorithm", { enumerable: true, get: function () { return domain_1.WebhookJwtAlgorithm; } });
|
|
15
|
+
Object.defineProperty(exports, "webhookAuthTypeSchema", { enumerable: true, get: function () { return domain_1.webhookAuthTypeSchema; } });
|
|
16
|
+
Object.defineProperty(exports, "webhookJwtAlgorithmSchema", { enumerable: true, get: function () { return domain_1.webhookJwtAlgorithmSchema; } });
|
|
13
17
|
Object.defineProperty(exports, "WorkflowType", { enumerable: true, get: function () { return domain_1.WorkflowType; } });
|
|
14
18
|
Object.defineProperty(exports, "WorkflowVersionAction", { enumerable: true, get: function () { return domain_1.WorkflowVersionAction; } });
|
|
15
19
|
var workflow_1 = require("./workflow");
|
|
16
20
|
Object.defineProperty(exports, "createWorkflowFullSchema", { enumerable: true, get: function () { return workflow_1.createWorkflowFullSchema; } });
|
|
21
|
+
Object.defineProperty(exports, "webhookTriggerSchema", { enumerable: true, get: function () { return workflow_1.webhookTriggerSchema; } });
|
|
17
22
|
Object.defineProperty(exports, "workflowFullSchema", { enumerable: true, get: function () { return workflow_1.workflowFullSchema; } });
|
|
18
23
|
Object.defineProperty(exports, "workflowSchema", { enumerable: true, get: function () { return workflow_1.workflowSchema; } });
|
|
19
24
|
Object.defineProperty(exports, "workflowStubSchema", { enumerable: true, get: function () { return workflow_1.workflowStubSchema; } });
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Full terms: see LICENSE.md.
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.workflowFullSchema = exports.createWorkflowFullSchema = exports.workflowSchema = exports.workflowStubSchema = void 0;
|
|
8
|
+
exports.workflowFullSchema = exports.createWorkflowFullSchema = exports.workflowSchema = exports.workflowStubSchema = exports.webhookTriggerSchema = void 0;
|
|
9
9
|
const zod_1 = require("zod");
|
|
10
10
|
const aliases_1 = require("../shared/aliases");
|
|
11
11
|
const base_1 = require("../shared/base");
|
|
@@ -15,6 +15,77 @@ const user_1 = require("../user/user");
|
|
|
15
15
|
const domain_1 = require("./domain");
|
|
16
16
|
const helpers_1 = require("./helpers");
|
|
17
17
|
const workflow_version_1 = require("./workflow-version");
|
|
18
|
+
const nullableString = (0, preprocess_1.preprocess)(helpers_1.nullishToNull, zod_1.z.string().nullable().optional());
|
|
19
|
+
const webhookTriggerBaseShape = {
|
|
20
|
+
enabled: zod_1.z.coerce.boolean().default(false),
|
|
21
|
+
};
|
|
22
|
+
// Secrets are never stored inline on the workflow: each secret lives in the
|
|
23
|
+
// credentials store and the trigger config only carries its credential id.
|
|
24
|
+
exports.webhookTriggerSchema = (0, preprocess_1.preprocess)((value) => {
|
|
25
|
+
// Default the discriminator so a config without an explicit authType still
|
|
26
|
+
// validates as an unauthenticated webhook (matches the previous behaviour).
|
|
27
|
+
const record = (0, object_1.toRecord)(value);
|
|
28
|
+
if (record && record.authType == null) {
|
|
29
|
+
return { ...record, authType: domain_1.WebhookAuthType.none };
|
|
30
|
+
}
|
|
31
|
+
return value;
|
|
32
|
+
}, zod_1.z
|
|
33
|
+
.discriminatedUnion("authType", [
|
|
34
|
+
zod_1.z.object({
|
|
35
|
+
...webhookTriggerBaseShape,
|
|
36
|
+
authType: zod_1.z.literal(domain_1.WebhookAuthType.none),
|
|
37
|
+
}),
|
|
38
|
+
zod_1.z.object({
|
|
39
|
+
...webhookTriggerBaseShape,
|
|
40
|
+
authType: zod_1.z.literal(domain_1.WebhookAuthType.basic),
|
|
41
|
+
username: nullableString,
|
|
42
|
+
passwordCredentialId: nullableString,
|
|
43
|
+
}),
|
|
44
|
+
zod_1.z.object({
|
|
45
|
+
...webhookTriggerBaseShape,
|
|
46
|
+
authType: zod_1.z.literal(domain_1.WebhookAuthType.header),
|
|
47
|
+
headerName: nullableString,
|
|
48
|
+
headerValueCredentialId: nullableString,
|
|
49
|
+
}),
|
|
50
|
+
zod_1.z.object({
|
|
51
|
+
...webhookTriggerBaseShape,
|
|
52
|
+
authType: zod_1.z.literal(domain_1.WebhookAuthType.jwt),
|
|
53
|
+
jwtSecretCredentialId: nullableString,
|
|
54
|
+
jwtAlgorithm: (0, preprocess_1.preprocess)(helpers_1.nullishToNull, domain_1.webhookJwtAlgorithmSchema.nullable().optional()),
|
|
55
|
+
}),
|
|
56
|
+
])
|
|
57
|
+
// An enabled webhook with an unset credential reference would otherwise
|
|
58
|
+
// authenticate empty credentials, so references are mandatory once
|
|
59
|
+
// enabled.
|
|
60
|
+
.superRefine((config, ctx) => {
|
|
61
|
+
if (!config.enabled) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const requireCredential = (field, value) => {
|
|
65
|
+
if (!value) {
|
|
66
|
+
ctx.addIssue({
|
|
67
|
+
code: "custom",
|
|
68
|
+
path: [field],
|
|
69
|
+
message: `${field} is required when the webhook trigger is enabled`,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
switch (config.authType) {
|
|
74
|
+
case domain_1.WebhookAuthType.basic:
|
|
75
|
+
requireCredential("username", config.username);
|
|
76
|
+
requireCredential("passwordCredentialId", config.passwordCredentialId);
|
|
77
|
+
break;
|
|
78
|
+
case domain_1.WebhookAuthType.header:
|
|
79
|
+
requireCredential("headerName", config.headerName);
|
|
80
|
+
requireCredential("headerValueCredentialId", config.headerValueCredentialId);
|
|
81
|
+
break;
|
|
82
|
+
case domain_1.WebhookAuthType.jwt:
|
|
83
|
+
requireCredential("jwtSecretCredentialId", config.jwtSecretCredentialId);
|
|
84
|
+
break;
|
|
85
|
+
default:
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
}));
|
|
18
89
|
const workflowAliasMap = {
|
|
19
90
|
currentVersionId: "currentVersion",
|
|
20
91
|
publishedVersionId: "publishedVersion",
|
|
@@ -31,6 +102,7 @@ const workflowStubObjectSchema = base_1.baseStubSchema.extend({
|
|
|
31
102
|
y: zod_1.z.coerce.number(),
|
|
32
103
|
zoom: zod_1.z.coerce.number(),
|
|
33
104
|
direction: domain_1.directionTypeSchema,
|
|
105
|
+
webhookTrigger: (0, preprocess_1.preprocess)(helpers_1.nullishToNull, exports.webhookTriggerSchema.nullable()).optional(),
|
|
34
106
|
});
|
|
35
107
|
const withWorkflowAliases = (value) => {
|
|
36
108
|
const original = (0, object_1.toRecord)(value);
|
|
@@ -34,8 +34,23 @@ export var DirectionType;
|
|
|
34
34
|
DirectionType["HORIZONTAL"] = "horizontal";
|
|
35
35
|
DirectionType["VERTICAL"] = "vertical";
|
|
36
36
|
})(DirectionType || (DirectionType = {}));
|
|
37
|
+
export var WebhookAuthType;
|
|
38
|
+
(function (WebhookAuthType) {
|
|
39
|
+
WebhookAuthType["none"] = "none";
|
|
40
|
+
WebhookAuthType["basic"] = "basic";
|
|
41
|
+
WebhookAuthType["header"] = "header";
|
|
42
|
+
WebhookAuthType["jwt"] = "jwt";
|
|
43
|
+
})(WebhookAuthType || (WebhookAuthType = {}));
|
|
44
|
+
export var WebhookJwtAlgorithm;
|
|
45
|
+
(function (WebhookJwtAlgorithm) {
|
|
46
|
+
WebhookJwtAlgorithm["HS256"] = "HS256";
|
|
47
|
+
WebhookJwtAlgorithm["HS384"] = "HS384";
|
|
48
|
+
WebhookJwtAlgorithm["HS512"] = "HS512";
|
|
49
|
+
})(WebhookJwtAlgorithm || (WebhookJwtAlgorithm = {}));
|
|
37
50
|
export const workflowTypeSchema = z.enum(WorkflowType);
|
|
38
51
|
export const workflowVersionActionSchema = z.enum(WorkflowVersionAction);
|
|
39
52
|
export const memoryScopeSchema = z.enum(MemoryScope);
|
|
40
53
|
export const mcpServerTransportSchema = z.enum(McpServerTransport);
|
|
41
54
|
export const directionTypeSchema = z.enum(DirectionType);
|
|
55
|
+
export const webhookAuthTypeSchema = z.enum(WebhookAuthType);
|
|
56
|
+
export const webhookJwtAlgorithmSchema = z.enum(WebhookJwtAlgorithm);
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Copyright (c) 2026 Hexastack.
|
|
4
4
|
* Full terms: see LICENSE.md.
|
|
5
5
|
*/
|
|
6
|
-
export { DirectionType, McpServerTransport, MemoryScope, WorkflowType, WorkflowVersionAction, } from "./domain";
|
|
7
|
-
export { createWorkflowFullSchema, workflowFullSchema, workflowSchema, workflowStubSchema, } from "./workflow";
|
|
6
|
+
export { DirectionType, McpServerTransport, MemoryScope, WebhookAuthType, WebhookJwtAlgorithm, webhookAuthTypeSchema, webhookJwtAlgorithmSchema, WorkflowType, WorkflowVersionAction, } from "./domain";
|
|
7
|
+
export { createWorkflowFullSchema, webhookTriggerSchema, workflowFullSchema, workflowSchema, workflowStubSchema, } from "./workflow";
|
|
8
8
|
export { workflowVersionFullSchema, workflowVersionSchema, workflowVersionStubSchema, } from "./workflow-version";
|
|
9
9
|
export { resolveRunDurationMs, workflowRunFullSchema, workflowRunSchema, workflowRunStubSchema, } from "./workflow-run";
|
|
10
10
|
export { memoryDefinitionFullSchema, memoryDefinitionSchema, memoryDefinitionStubSchema, } from "./memory-definition";
|
|
@@ -9,9 +9,80 @@ import { baseStubSchema } from "../shared/base";
|
|
|
9
9
|
import { cloneWithPrototype, toRecord } from "../shared/object";
|
|
10
10
|
import { preprocess } from "../shared/preprocess";
|
|
11
11
|
import { userSchema } from "../user/user";
|
|
12
|
-
import { directionTypeSchema, workflowTypeSchema } from "./domain";
|
|
12
|
+
import { directionTypeSchema, WebhookAuthType, webhookJwtAlgorithmSchema, workflowTypeSchema, } from "./domain";
|
|
13
13
|
import { nullishToNull } from "./helpers";
|
|
14
14
|
import { workflowVersionSchema } from "./workflow-version";
|
|
15
|
+
const nullableString = preprocess(nullishToNull, z.string().nullable().optional());
|
|
16
|
+
const webhookTriggerBaseShape = {
|
|
17
|
+
enabled: z.coerce.boolean().default(false),
|
|
18
|
+
};
|
|
19
|
+
// Secrets are never stored inline on the workflow: each secret lives in the
|
|
20
|
+
// credentials store and the trigger config only carries its credential id.
|
|
21
|
+
export const webhookTriggerSchema = preprocess((value) => {
|
|
22
|
+
// Default the discriminator so a config without an explicit authType still
|
|
23
|
+
// validates as an unauthenticated webhook (matches the previous behaviour).
|
|
24
|
+
const record = toRecord(value);
|
|
25
|
+
if (record && record.authType == null) {
|
|
26
|
+
return { ...record, authType: WebhookAuthType.none };
|
|
27
|
+
}
|
|
28
|
+
return value;
|
|
29
|
+
}, z
|
|
30
|
+
.discriminatedUnion("authType", [
|
|
31
|
+
z.object({
|
|
32
|
+
...webhookTriggerBaseShape,
|
|
33
|
+
authType: z.literal(WebhookAuthType.none),
|
|
34
|
+
}),
|
|
35
|
+
z.object({
|
|
36
|
+
...webhookTriggerBaseShape,
|
|
37
|
+
authType: z.literal(WebhookAuthType.basic),
|
|
38
|
+
username: nullableString,
|
|
39
|
+
passwordCredentialId: nullableString,
|
|
40
|
+
}),
|
|
41
|
+
z.object({
|
|
42
|
+
...webhookTriggerBaseShape,
|
|
43
|
+
authType: z.literal(WebhookAuthType.header),
|
|
44
|
+
headerName: nullableString,
|
|
45
|
+
headerValueCredentialId: nullableString,
|
|
46
|
+
}),
|
|
47
|
+
z.object({
|
|
48
|
+
...webhookTriggerBaseShape,
|
|
49
|
+
authType: z.literal(WebhookAuthType.jwt),
|
|
50
|
+
jwtSecretCredentialId: nullableString,
|
|
51
|
+
jwtAlgorithm: preprocess(nullishToNull, webhookJwtAlgorithmSchema.nullable().optional()),
|
|
52
|
+
}),
|
|
53
|
+
])
|
|
54
|
+
// An enabled webhook with an unset credential reference would otherwise
|
|
55
|
+
// authenticate empty credentials, so references are mandatory once
|
|
56
|
+
// enabled.
|
|
57
|
+
.superRefine((config, ctx) => {
|
|
58
|
+
if (!config.enabled) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const requireCredential = (field, value) => {
|
|
62
|
+
if (!value) {
|
|
63
|
+
ctx.addIssue({
|
|
64
|
+
code: "custom",
|
|
65
|
+
path: [field],
|
|
66
|
+
message: `${field} is required when the webhook trigger is enabled`,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
switch (config.authType) {
|
|
71
|
+
case WebhookAuthType.basic:
|
|
72
|
+
requireCredential("username", config.username);
|
|
73
|
+
requireCredential("passwordCredentialId", config.passwordCredentialId);
|
|
74
|
+
break;
|
|
75
|
+
case WebhookAuthType.header:
|
|
76
|
+
requireCredential("headerName", config.headerName);
|
|
77
|
+
requireCredential("headerValueCredentialId", config.headerValueCredentialId);
|
|
78
|
+
break;
|
|
79
|
+
case WebhookAuthType.jwt:
|
|
80
|
+
requireCredential("jwtSecretCredentialId", config.jwtSecretCredentialId);
|
|
81
|
+
break;
|
|
82
|
+
default:
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
}));
|
|
15
86
|
const workflowAliasMap = {
|
|
16
87
|
currentVersionId: "currentVersion",
|
|
17
88
|
publishedVersionId: "publishedVersion",
|
|
@@ -28,6 +99,7 @@ const workflowStubObjectSchema = baseStubSchema.extend({
|
|
|
28
99
|
y: z.coerce.number(),
|
|
29
100
|
zoom: z.coerce.number(),
|
|
30
101
|
direction: directionTypeSchema,
|
|
102
|
+
webhookTrigger: preprocess(nullishToNull, webhookTriggerSchema.nullable()).optional(),
|
|
31
103
|
});
|
|
32
104
|
const withWorkflowAliases = (value) => {
|
|
33
105
|
const original = toRecord(value);
|
|
@@ -23,6 +23,25 @@ export declare const sourceFullSchema: z.ZodType<{
|
|
|
23
23
|
direction: import("..").DirectionType;
|
|
24
24
|
createdBy: string | null;
|
|
25
25
|
runAfterMs: number;
|
|
26
|
+
webhookTrigger?: {
|
|
27
|
+
authType: import("..").WebhookAuthType.none;
|
|
28
|
+
enabled: boolean;
|
|
29
|
+
} | {
|
|
30
|
+
authType: import("..").WebhookAuthType.basic;
|
|
31
|
+
username: string | null | undefined;
|
|
32
|
+
passwordCredentialId: string | null | undefined;
|
|
33
|
+
enabled: boolean;
|
|
34
|
+
} | {
|
|
35
|
+
authType: import("..").WebhookAuthType.header;
|
|
36
|
+
headerName: string | null | undefined;
|
|
37
|
+
headerValueCredentialId: string | null | undefined;
|
|
38
|
+
enabled: boolean;
|
|
39
|
+
} | {
|
|
40
|
+
authType: import("..").WebhookAuthType.jwt;
|
|
41
|
+
jwtSecretCredentialId: string | null | undefined;
|
|
42
|
+
jwtAlgorithm: import("..").WebhookJwtAlgorithm | null | undefined;
|
|
43
|
+
enabled: boolean;
|
|
44
|
+
} | null | undefined;
|
|
26
45
|
currentVersion?: string | null | undefined;
|
|
27
46
|
publishedVersion?: string | null | undefined;
|
|
28
47
|
} | null;
|
|
@@ -50,6 +69,25 @@ export declare const sourceFullSchema: z.ZodType<{
|
|
|
50
69
|
direction: import("..").DirectionType;
|
|
51
70
|
createdBy: string | null;
|
|
52
71
|
runAfterMs: number;
|
|
72
|
+
webhookTrigger?: {
|
|
73
|
+
authType: import("..").WebhookAuthType.none;
|
|
74
|
+
enabled: boolean;
|
|
75
|
+
} | {
|
|
76
|
+
authType: import("..").WebhookAuthType.basic;
|
|
77
|
+
username: string | null | undefined;
|
|
78
|
+
passwordCredentialId: string | null | undefined;
|
|
79
|
+
enabled: boolean;
|
|
80
|
+
} | {
|
|
81
|
+
authType: import("..").WebhookAuthType.header;
|
|
82
|
+
headerName: string | null | undefined;
|
|
83
|
+
headerValueCredentialId: string | null | undefined;
|
|
84
|
+
enabled: boolean;
|
|
85
|
+
} | {
|
|
86
|
+
authType: import("..").WebhookAuthType.jwt;
|
|
87
|
+
jwtSecretCredentialId: string | null | undefined;
|
|
88
|
+
jwtAlgorithm: import("..").WebhookJwtAlgorithm | null | undefined;
|
|
89
|
+
enabled: boolean;
|
|
90
|
+
} | null | undefined;
|
|
53
91
|
currentVersion?: string | null | undefined;
|
|
54
92
|
publishedVersion?: string | null | undefined;
|
|
55
93
|
} | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-full.d.ts","sourceRoot":"","sources":["../../../src/channel/source-full.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"source-full.d.ts","sourceRoot":"","sources":["../../../src/channel/source-full.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAQ5B,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -24,9 +24,22 @@ export declare enum DirectionType {
|
|
|
24
24
|
HORIZONTAL = "horizontal",
|
|
25
25
|
VERTICAL = "vertical"
|
|
26
26
|
}
|
|
27
|
+
export declare enum WebhookAuthType {
|
|
28
|
+
none = "none",
|
|
29
|
+
basic = "basic",
|
|
30
|
+
header = "header",
|
|
31
|
+
jwt = "jwt"
|
|
32
|
+
}
|
|
33
|
+
export declare enum WebhookJwtAlgorithm {
|
|
34
|
+
HS256 = "HS256",
|
|
35
|
+
HS384 = "HS384",
|
|
36
|
+
HS512 = "HS512"
|
|
37
|
+
}
|
|
27
38
|
export declare const workflowTypeSchema: z.ZodEnum<typeof WorkflowType>;
|
|
28
39
|
export declare const workflowVersionActionSchema: z.ZodEnum<typeof WorkflowVersionAction>;
|
|
29
40
|
export declare const memoryScopeSchema: z.ZodEnum<typeof MemoryScope>;
|
|
30
41
|
export declare const mcpServerTransportSchema: z.ZodEnum<typeof McpServerTransport>;
|
|
31
42
|
export declare const directionTypeSchema: z.ZodEnum<typeof DirectionType>;
|
|
43
|
+
export declare const webhookAuthTypeSchema: z.ZodEnum<typeof WebhookAuthType>;
|
|
44
|
+
export declare const webhookJwtAlgorithmSchema: z.ZodEnum<typeof WebhookJwtAlgorithm>;
|
|
32
45
|
//# sourceMappingURL=domain.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain.d.ts","sourceRoot":"","sources":["../../../src/workflow/domain.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,oBAAY,YAAY;IACtB,cAAc,mBAAmB;IACjC,MAAM,WAAW;IACjB,SAAS,cAAc;CACxB;AAED,oBAAY,qBAAqB;IAC/B,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,MAAM,WAAW;CAClB;AAED,oBAAY,WAAW;IACrB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,GAAG,QAAQ;CACZ;AAED,oBAAY,kBAAkB;IAC5B,IAAI,SAAS;IACb,KAAK,UAAU;CAChB;AAED,oBAAY,aAAa;IACvB,UAAU,eAAe;IACzB,QAAQ,aAAa;CACtB;AAED,eAAO,MAAM,kBAAkB,gCAAuB,CAAC;AAEvD,eAAO,MAAM,2BAA2B,yCAAgC,CAAC;AAEzE,eAAO,MAAM,iBAAiB,+BAAsB,CAAC;AAErD,eAAO,MAAM,wBAAwB,sCAA6B,CAAC;AAEnE,eAAO,MAAM,mBAAmB,iCAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"domain.d.ts","sourceRoot":"","sources":["../../../src/workflow/domain.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,oBAAY,YAAY;IACtB,cAAc,mBAAmB;IACjC,MAAM,WAAW;IACjB,SAAS,cAAc;CACxB;AAED,oBAAY,qBAAqB;IAC/B,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,MAAM,WAAW;CAClB;AAED,oBAAY,WAAW;IACrB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,GAAG,QAAQ;CACZ;AAED,oBAAY,kBAAkB;IAC5B,IAAI,SAAS;IACb,KAAK,UAAU;CAChB;AAED,oBAAY,aAAa;IACvB,UAAU,eAAe;IACzB,QAAQ,aAAa;CACtB;AAED,oBAAY,eAAe;IACzB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,GAAG,QAAQ;CACZ;AAED,oBAAY,mBAAmB;IAC7B,KAAK,UAAU;IACf,KAAK,UAAU;IACf,KAAK,UAAU;CAChB;AAED,eAAO,MAAM,kBAAkB,gCAAuB,CAAC;AAEvD,eAAO,MAAM,2BAA2B,yCAAgC,CAAC;AAEzE,eAAO,MAAM,iBAAiB,+BAAsB,CAAC;AAErD,eAAO,MAAM,wBAAwB,sCAA6B,CAAC;AAEnE,eAAO,MAAM,mBAAmB,iCAAwB,CAAC;AAEzD,eAAO,MAAM,qBAAqB,mCAA0B,CAAC;AAE7D,eAAO,MAAM,yBAAyB,uCAA8B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { DirectionType, McpServerTransport, MemoryScope, WorkflowType, WorkflowVersionAction, } from "./domain";
|
|
2
|
-
export { createWorkflowFullSchema, workflowFullSchema, workflowSchema, workflowStubSchema, type Workflow, type WorkflowDefinitionParser, type WorkflowFull, type WorkflowStub, } from "./workflow";
|
|
1
|
+
export { DirectionType, McpServerTransport, MemoryScope, WebhookAuthType, WebhookJwtAlgorithm, webhookAuthTypeSchema, webhookJwtAlgorithmSchema, WorkflowType, WorkflowVersionAction, } from "./domain";
|
|
2
|
+
export { createWorkflowFullSchema, webhookTriggerSchema, workflowFullSchema, workflowSchema, workflowStubSchema, type WebhookTriggerConfig, type Workflow, type WorkflowDefinitionParser, type WorkflowFull, type WorkflowStub, } from "./workflow";
|
|
3
3
|
export { workflowVersionFullSchema, workflowVersionSchema, workflowVersionStubSchema, type WorkflowVersion, type WorkflowVersionFull, type WorkflowVersionStub, } from "./workflow-version";
|
|
4
4
|
export { resolveRunDurationMs, workflowRunFullSchema, workflowRunSchema, workflowRunStubSchema, type WorkflowRun, type WorkflowRunFull, type WorkflowRunStub, } from "./workflow-run";
|
|
5
5
|
export { memoryDefinitionFullSchema, memoryDefinitionSchema, memoryDefinitionStubSchema, type MemoryDefinition, type MemoryDefinitionFull, type MemoryDefinitionStub, } from "./memory-definition";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/workflow/index.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,qBAAqB,GACtB,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,KAAK,QAAQ,EACb,KAAK,wBAAwB,EAC7B,KAAK,YAAY,EACjB,KAAK,YAAY,GAClB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACrB,yBAAyB,EACzB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,GACzB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,eAAe,GACrB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,0BAA0B,EAC1B,sBAAsB,EACtB,0BAA0B,EAC1B,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,GAC1B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,sBAAsB,EACtB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,GACtB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,aAAa,GACnB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,2BAA2B,EAC3B,uCAAuC,EACvC,qCAAqC,EACrC,oCAAoC,EACpC,oCAAoC,EACpC,+BAA+B,EAC/B,mCAAmC,EACnC,0CAA0C,EAC1C,0BAA0B,EAC1B,4BAA4B,EAC5B,4CAA4C,EAC5C,kCAAkC,EAClC,kCAAkC,EAClC,0BAA0B,EAC1B,kCAAkC,EAClC,KAAK,oBAAoB,EACzB,KAAK,+BAA+B,EACpC,KAAK,8BAA8B,EACnC,KAAK,yBAAyB,EAC9B,KAAK,8BAA8B,EACnC,KAAK,6BAA6B,EAClC,KAAK,oCAAoC,EACzC,KAAK,sBAAsB,EAC3B,KAAK,sCAAsC,EAC3C,KAAK,4BAA4B,EACjC,KAAK,4BAA4B,EACjC,KAAK,oBAAoB,GAC1B,MAAM,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/workflow/index.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,yBAAyB,EACzB,YAAY,EACZ,qBAAqB,GACtB,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,KAAK,oBAAoB,EACzB,KAAK,QAAQ,EACb,KAAK,wBAAwB,EAC7B,KAAK,YAAY,EACjB,KAAK,YAAY,GAClB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACrB,yBAAyB,EACzB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,GACzB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,eAAe,GACrB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,0BAA0B,EAC1B,sBAAsB,EACtB,0BAA0B,EAC1B,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,GAC1B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,sBAAsB,EACtB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,GACtB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,aAAa,GACnB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,2BAA2B,EAC3B,uCAAuC,EACvC,qCAAqC,EACrC,oCAAoC,EACpC,oCAAoC,EACpC,+BAA+B,EAC/B,mCAAmC,EACnC,0CAA0C,EAC1C,0BAA0B,EAC1B,4BAA4B,EAC5B,4CAA4C,EAC5C,kCAAkC,EAClC,kCAAkC,EAClC,0BAA0B,EAC1B,kCAAkC,EAClC,KAAK,oBAAoB,EACzB,KAAK,+BAA+B,EACpC,KAAK,8BAA8B,EACnC,KAAK,yBAAyB,EAC9B,KAAK,8BAA8B,EACnC,KAAK,6BAA6B,EAClC,KAAK,oCAAoC,EACzC,KAAK,sBAAsB,EAC3B,KAAK,sCAAsC,EAC3C,KAAK,4BAA4B,EACjC,KAAK,4BAA4B,EACjC,KAAK,oBAAoB,GAC1B,MAAM,qBAAqB,CAAC"}
|
|
@@ -178,6 +178,25 @@ export declare const memoryRecordFullSchema: z.ZodObject<{
|
|
|
178
178
|
direction: import("./domain").DirectionType;
|
|
179
179
|
createdBy: string | null;
|
|
180
180
|
runAfterMs: number;
|
|
181
|
+
webhookTrigger?: {
|
|
182
|
+
authType: import("./domain").WebhookAuthType.none;
|
|
183
|
+
enabled: boolean;
|
|
184
|
+
} | {
|
|
185
|
+
authType: import("./domain").WebhookAuthType.basic;
|
|
186
|
+
username: string | null | undefined;
|
|
187
|
+
passwordCredentialId: string | null | undefined;
|
|
188
|
+
enabled: boolean;
|
|
189
|
+
} | {
|
|
190
|
+
authType: import("./domain").WebhookAuthType.header;
|
|
191
|
+
headerName: string | null | undefined;
|
|
192
|
+
headerValueCredentialId: string | null | undefined;
|
|
193
|
+
enabled: boolean;
|
|
194
|
+
} | {
|
|
195
|
+
authType: import("./domain").WebhookAuthType.jwt;
|
|
196
|
+
jwtSecretCredentialId: string | null | undefined;
|
|
197
|
+
jwtAlgorithm: import("./domain").WebhookJwtAlgorithm | null | undefined;
|
|
198
|
+
enabled: boolean;
|
|
199
|
+
} | null | undefined;
|
|
181
200
|
currentVersion?: string | null | undefined;
|
|
182
201
|
publishedVersion?: string | null | undefined;
|
|
183
202
|
}, unknown, z.core.$ZodTypeInternals<{
|
|
@@ -196,6 +215,25 @@ export declare const memoryRecordFullSchema: z.ZodObject<{
|
|
|
196
215
|
direction: import("./domain").DirectionType;
|
|
197
216
|
createdBy: string | null;
|
|
198
217
|
runAfterMs: number;
|
|
218
|
+
webhookTrigger?: {
|
|
219
|
+
authType: import("./domain").WebhookAuthType.none;
|
|
220
|
+
enabled: boolean;
|
|
221
|
+
} | {
|
|
222
|
+
authType: import("./domain").WebhookAuthType.basic;
|
|
223
|
+
username: string | null | undefined;
|
|
224
|
+
passwordCredentialId: string | null | undefined;
|
|
225
|
+
enabled: boolean;
|
|
226
|
+
} | {
|
|
227
|
+
authType: import("./domain").WebhookAuthType.header;
|
|
228
|
+
headerName: string | null | undefined;
|
|
229
|
+
headerValueCredentialId: string | null | undefined;
|
|
230
|
+
enabled: boolean;
|
|
231
|
+
} | {
|
|
232
|
+
authType: import("./domain").WebhookAuthType.jwt;
|
|
233
|
+
jwtSecretCredentialId: string | null | undefined;
|
|
234
|
+
jwtAlgorithm: import("./domain").WebhookJwtAlgorithm | null | undefined;
|
|
235
|
+
enabled: boolean;
|
|
236
|
+
} | null | undefined;
|
|
199
237
|
currentVersion?: string | null | undefined;
|
|
200
238
|
publishedVersion?: string | null | undefined;
|
|
201
239
|
}, unknown>>>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory-record.d.ts","sourceRoot":"","sources":["../../../src/workflow/memory-record.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAwBxB,eAAO,MAAM,sBAAsB;;;;;;;iBAA+B,CAAC;AAEnE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;YAwB9B,CAAC;AAEF,eAAO,MAAM,sBAAsB
|
|
1
|
+
{"version":3,"file":"memory-record.d.ts","sourceRoot":"","sources":["../../../src/workflow/memory-record.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAwBxB,eAAO,MAAM,sBAAsB;;;;;;;iBAA+B,CAAC;AAEnE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;YAwB9B,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAMjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
|
@@ -159,6 +159,25 @@ export declare const workflowRunFullSchema: z.ZodType<{
|
|
|
159
159
|
direction: import("./domain").DirectionType;
|
|
160
160
|
createdBy: string | null;
|
|
161
161
|
runAfterMs: number;
|
|
162
|
+
webhookTrigger?: {
|
|
163
|
+
authType: import("./domain").WebhookAuthType.none;
|
|
164
|
+
enabled: boolean;
|
|
165
|
+
} | {
|
|
166
|
+
authType: import("./domain").WebhookAuthType.basic;
|
|
167
|
+
username: string | null | undefined;
|
|
168
|
+
passwordCredentialId: string | null | undefined;
|
|
169
|
+
enabled: boolean;
|
|
170
|
+
} | {
|
|
171
|
+
authType: import("./domain").WebhookAuthType.header;
|
|
172
|
+
headerName: string | null | undefined;
|
|
173
|
+
headerValueCredentialId: string | null | undefined;
|
|
174
|
+
enabled: boolean;
|
|
175
|
+
} | {
|
|
176
|
+
authType: import("./domain").WebhookAuthType.jwt;
|
|
177
|
+
jwtSecretCredentialId: string | null | undefined;
|
|
178
|
+
jwtAlgorithm: import("./domain").WebhookJwtAlgorithm | null | undefined;
|
|
179
|
+
enabled: boolean;
|
|
180
|
+
} | null | undefined;
|
|
162
181
|
currentVersion?: string | null | undefined;
|
|
163
182
|
publishedVersion?: string | null | undefined;
|
|
164
183
|
};
|
|
@@ -313,6 +332,25 @@ export declare const workflowRunFullSchema: z.ZodType<{
|
|
|
313
332
|
direction: import("./domain").DirectionType;
|
|
314
333
|
createdBy: string | null;
|
|
315
334
|
runAfterMs: number;
|
|
335
|
+
webhookTrigger?: {
|
|
336
|
+
authType: import("./domain").WebhookAuthType.none;
|
|
337
|
+
enabled: boolean;
|
|
338
|
+
} | {
|
|
339
|
+
authType: import("./domain").WebhookAuthType.basic;
|
|
340
|
+
username: string | null | undefined;
|
|
341
|
+
passwordCredentialId: string | null | undefined;
|
|
342
|
+
enabled: boolean;
|
|
343
|
+
} | {
|
|
344
|
+
authType: import("./domain").WebhookAuthType.header;
|
|
345
|
+
headerName: string | null | undefined;
|
|
346
|
+
headerValueCredentialId: string | null | undefined;
|
|
347
|
+
enabled: boolean;
|
|
348
|
+
} | {
|
|
349
|
+
authType: import("./domain").WebhookAuthType.jwt;
|
|
350
|
+
jwtSecretCredentialId: string | null | undefined;
|
|
351
|
+
jwtAlgorithm: import("./domain").WebhookJwtAlgorithm | null | undefined;
|
|
352
|
+
enabled: boolean;
|
|
353
|
+
} | null | undefined;
|
|
316
354
|
currentVersion?: string | null | undefined;
|
|
317
355
|
publishedVersion?: string | null | undefined;
|
|
318
356
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-run.d.ts","sourceRoot":"","sources":["../../../src/workflow/workflow-run.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgBxB,QAAA,MAAM,uBAAuB;;;;;;EAM3B,CAAC;AAYH,eAAO,MAAM,oBAAoB,GAAI,KAAK;IACxC,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAC;IACjC,UAAU,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAC;IAChC,WAAW,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAC;IACnC,MAAM,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,GAAG,IAAI,CAAC;CACzD,KAAG,MAAM,GAAG,IAiBZ,CAAC;AAqDF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAGjC,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAoB7B,CAAC;AAEF,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"workflow-run.d.ts","sourceRoot":"","sources":["../../../src/workflow/workflow-run.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgBxB,QAAA,MAAM,uBAAuB;;;;;;EAM3B,CAAC;AAYH,eAAO,MAAM,oBAAoB,GAAI,KAAK;IACxC,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAC;IACjC,UAAU,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAC;IAChC,WAAW,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAC;IACnC,MAAM,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,GAAG,IAAI,CAAC;CACzD,KAAG,MAAM,GAAG,IAiBZ,CAAC;AAqDF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAGjC,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAoB7B,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAejC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -280,6 +280,25 @@ export declare const workflowImportResultSchema: z.ZodObject<{
|
|
|
280
280
|
direction: import("./domain").DirectionType;
|
|
281
281
|
createdBy: string | null;
|
|
282
282
|
runAfterMs: number;
|
|
283
|
+
webhookTrigger?: {
|
|
284
|
+
authType: import("./domain").WebhookAuthType.none;
|
|
285
|
+
enabled: boolean;
|
|
286
|
+
} | {
|
|
287
|
+
authType: import("./domain").WebhookAuthType.basic;
|
|
288
|
+
username: string | null | undefined;
|
|
289
|
+
passwordCredentialId: string | null | undefined;
|
|
290
|
+
enabled: boolean;
|
|
291
|
+
} | {
|
|
292
|
+
authType: import("./domain").WebhookAuthType.header;
|
|
293
|
+
headerName: string | null | undefined;
|
|
294
|
+
headerValueCredentialId: string | null | undefined;
|
|
295
|
+
enabled: boolean;
|
|
296
|
+
} | {
|
|
297
|
+
authType: import("./domain").WebhookAuthType.jwt;
|
|
298
|
+
jwtSecretCredentialId: string | null | undefined;
|
|
299
|
+
jwtAlgorithm: import("./domain").WebhookJwtAlgorithm | null | undefined;
|
|
300
|
+
enabled: boolean;
|
|
301
|
+
} | null | undefined;
|
|
283
302
|
currentVersion?: string | null | undefined;
|
|
284
303
|
publishedVersion?: string | null | undefined;
|
|
285
304
|
}, unknown, z.core.$ZodTypeInternals<{
|
|
@@ -298,6 +317,25 @@ export declare const workflowImportResultSchema: z.ZodObject<{
|
|
|
298
317
|
direction: import("./domain").DirectionType;
|
|
299
318
|
createdBy: string | null;
|
|
300
319
|
runAfterMs: number;
|
|
320
|
+
webhookTrigger?: {
|
|
321
|
+
authType: import("./domain").WebhookAuthType.none;
|
|
322
|
+
enabled: boolean;
|
|
323
|
+
} | {
|
|
324
|
+
authType: import("./domain").WebhookAuthType.basic;
|
|
325
|
+
username: string | null | undefined;
|
|
326
|
+
passwordCredentialId: string | null | undefined;
|
|
327
|
+
enabled: boolean;
|
|
328
|
+
} | {
|
|
329
|
+
authType: import("./domain").WebhookAuthType.header;
|
|
330
|
+
headerName: string | null | undefined;
|
|
331
|
+
headerValueCredentialId: string | null | undefined;
|
|
332
|
+
enabled: boolean;
|
|
333
|
+
} | {
|
|
334
|
+
authType: import("./domain").WebhookAuthType.jwt;
|
|
335
|
+
jwtSecretCredentialId: string | null | undefined;
|
|
336
|
+
jwtAlgorithm: import("./domain").WebhookJwtAlgorithm | null | undefined;
|
|
337
|
+
enabled: boolean;
|
|
338
|
+
} | null | undefined;
|
|
301
339
|
currentVersion?: string | null | undefined;
|
|
302
340
|
publishedVersion?: string | null | undefined;
|
|
303
341
|
}, unknown>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-transfer.d.ts","sourceRoot":"","sources":["../../../src/workflow/workflow-transfer.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,eAAO,MAAM,2BAA2B,4BAA4B,CAAC;AAErE,eAAO,MAAM,uCAAuC,QACP,CAAC;AAE9C,eAAO,MAAM,kCAAkC,aAGE,CAAC;AAwBlD,eAAO,MAAM,0CAA0C;;;;;;;kBAOrD,CAAC;AAEH,eAAO,MAAM,oCAAoC;;;;kBAI/C,CAAC;AAEH,eAAO,MAAM,mCAAmC;;;;;;;;;;kBAU9C,CAAC;AAEH,eAAO,MAAM,qCAAqC;;;;kBAIhD,CAAC;AAEH,eAAO,MAAM,oCAAoC;;;kBAG/C,CAAC;AAEH,eAAO,MAAM,+BAA+B;;;;;;kBAM1C,CAAC;AAEH,eAAO,MAAM,4CAA4C;;;;;;;;;;;;;;;;;;;;;;kBAKvD,CAAC;AAgBH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAQvC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAA+B,CAAC;AAEvE,eAAO,MAAM,kCAAkC;;;;EAI7C,CAAC;AAEH,eAAO,MAAM,kCAAkC;;;;;;;;;;kBAM7C,CAAC;AAEH,eAAO,MAAM,0BAA0B
|
|
1
|
+
{"version":3,"file":"workflow-transfer.d.ts","sourceRoot":"","sources":["../../../src/workflow/workflow-transfer.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,eAAO,MAAM,2BAA2B,4BAA4B,CAAC;AAErE,eAAO,MAAM,uCAAuC,QACP,CAAC;AAE9C,eAAO,MAAM,kCAAkC,aAGE,CAAC;AAwBlD,eAAO,MAAM,0CAA0C;;;;;;;kBAOrD,CAAC;AAEH,eAAO,MAAM,oCAAoC;;;;kBAI/C,CAAC;AAEH,eAAO,MAAM,mCAAmC;;;;;;;;;;kBAU9C,CAAC;AAEH,eAAO,MAAM,qCAAqC;;;;kBAIhD,CAAC;AAEH,eAAO,MAAM,oCAAoC;;;kBAG/C,CAAC;AAEH,eAAO,MAAM,+BAA+B;;;;;;kBAM1C,CAAC;AAEH,eAAO,MAAM,4CAA4C;;;;;;;;;;;;;;;;;;;;;;kBAKvD,CAAC;AAgBH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAQvC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAA+B,CAAC;AAEvE,eAAO,MAAM,kCAAkC;;;;EAI7C,CAAC;AAEH,eAAO,MAAM,kCAAkC;;;;;;;;;;kBAM7C,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAIrC,CAAC;AAEH,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,KAAK,CACxD,OAAO,0CAA0C,CAClD,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,oCAAoC,CAC5C,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CACjD,OAAO,mCAAmC,CAC3C,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CACnD,OAAO,qCAAqC,CAC7C,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,oCAAoC,CAC5C,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,+BAA+B,CACvC,CAAC;AAEF,MAAM,MAAM,sCAAsC,GAAG,CAAC,CAAC,KAAK,CAC1D,OAAO,4CAA4C,CACpD,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAC1C,OAAO,4BAA4B,CACpC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAChD,OAAO,kCAAkC,CAC1C,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAChD,OAAO,kCAAkC,CAC1C,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
|
|
@@ -84,6 +84,25 @@ export declare const workflowVersionFullSchema: z.ZodObject<{
|
|
|
84
84
|
direction: import("./domain").DirectionType;
|
|
85
85
|
createdBy: string | null;
|
|
86
86
|
runAfterMs: number;
|
|
87
|
+
webhookTrigger?: {
|
|
88
|
+
authType: import("./domain").WebhookAuthType.none;
|
|
89
|
+
enabled: boolean;
|
|
90
|
+
} | {
|
|
91
|
+
authType: import("./domain").WebhookAuthType.basic;
|
|
92
|
+
username: string | null | undefined;
|
|
93
|
+
passwordCredentialId: string | null | undefined;
|
|
94
|
+
enabled: boolean;
|
|
95
|
+
} | {
|
|
96
|
+
authType: import("./domain").WebhookAuthType.header;
|
|
97
|
+
headerName: string | null | undefined;
|
|
98
|
+
headerValueCredentialId: string | null | undefined;
|
|
99
|
+
enabled: boolean;
|
|
100
|
+
} | {
|
|
101
|
+
authType: import("./domain").WebhookAuthType.jwt;
|
|
102
|
+
jwtSecretCredentialId: string | null | undefined;
|
|
103
|
+
jwtAlgorithm: import("./domain").WebhookJwtAlgorithm | null | undefined;
|
|
104
|
+
enabled: boolean;
|
|
105
|
+
} | null | undefined;
|
|
87
106
|
currentVersion?: string | null | undefined;
|
|
88
107
|
publishedVersion?: string | null | undefined;
|
|
89
108
|
}, unknown, z.core.$ZodTypeInternals<{
|
|
@@ -102,6 +121,25 @@ export declare const workflowVersionFullSchema: z.ZodObject<{
|
|
|
102
121
|
direction: import("./domain").DirectionType;
|
|
103
122
|
createdBy: string | null;
|
|
104
123
|
runAfterMs: number;
|
|
124
|
+
webhookTrigger?: {
|
|
125
|
+
authType: import("./domain").WebhookAuthType.none;
|
|
126
|
+
enabled: boolean;
|
|
127
|
+
} | {
|
|
128
|
+
authType: import("./domain").WebhookAuthType.basic;
|
|
129
|
+
username: string | null | undefined;
|
|
130
|
+
passwordCredentialId: string | null | undefined;
|
|
131
|
+
enabled: boolean;
|
|
132
|
+
} | {
|
|
133
|
+
authType: import("./domain").WebhookAuthType.header;
|
|
134
|
+
headerName: string | null | undefined;
|
|
135
|
+
headerValueCredentialId: string | null | undefined;
|
|
136
|
+
enabled: boolean;
|
|
137
|
+
} | {
|
|
138
|
+
authType: import("./domain").WebhookAuthType.jwt;
|
|
139
|
+
jwtSecretCredentialId: string | null | undefined;
|
|
140
|
+
jwtAlgorithm: import("./domain").WebhookJwtAlgorithm | null | undefined;
|
|
141
|
+
enabled: boolean;
|
|
142
|
+
} | null | undefined;
|
|
105
143
|
currentVersion?: string | null | undefined;
|
|
106
144
|
publishedVersion?: string | null | undefined;
|
|
107
145
|
}, unknown>>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-version.d.ts","sourceRoot":"","sources":["../../../src/workflow/workflow-version.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAuBxB,eAAO,MAAM,yBAAyB;;;;;;;;;iBAAkC,CAAC;AAEzE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;YAgBjC,CAAC;AAEF,eAAO,MAAM,yBAAyB
|
|
1
|
+
{"version":3,"file":"workflow-version.d.ts","sourceRoot":"","sources":["../../../src/workflow/workflow-version.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAuBxB,eAAO,MAAM,yBAAyB;;;;;;;;;iBAAkC,CAAC;AAEzE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;YAgBjC,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAYrC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|
|
@@ -1,4 +1,43 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { WebhookAuthType } from "./domain";
|
|
3
|
+
export declare const webhookTriggerSchema: z.ZodType<{
|
|
4
|
+
authType: WebhookAuthType.none;
|
|
5
|
+
enabled: boolean;
|
|
6
|
+
} | {
|
|
7
|
+
authType: WebhookAuthType.basic;
|
|
8
|
+
username: string | null | undefined;
|
|
9
|
+
passwordCredentialId: string | null | undefined;
|
|
10
|
+
enabled: boolean;
|
|
11
|
+
} | {
|
|
12
|
+
authType: WebhookAuthType.header;
|
|
13
|
+
headerName: string | null | undefined;
|
|
14
|
+
headerValueCredentialId: string | null | undefined;
|
|
15
|
+
enabled: boolean;
|
|
16
|
+
} | {
|
|
17
|
+
authType: WebhookAuthType.jwt;
|
|
18
|
+
jwtSecretCredentialId: string | null | undefined;
|
|
19
|
+
jwtAlgorithm: import("./domain").WebhookJwtAlgorithm | null | undefined;
|
|
20
|
+
enabled: boolean;
|
|
21
|
+
}, unknown, z.core.$ZodTypeInternals<{
|
|
22
|
+
authType: WebhookAuthType.none;
|
|
23
|
+
enabled: boolean;
|
|
24
|
+
} | {
|
|
25
|
+
authType: WebhookAuthType.basic;
|
|
26
|
+
username: string | null | undefined;
|
|
27
|
+
passwordCredentialId: string | null | undefined;
|
|
28
|
+
enabled: boolean;
|
|
29
|
+
} | {
|
|
30
|
+
authType: WebhookAuthType.header;
|
|
31
|
+
headerName: string | null | undefined;
|
|
32
|
+
headerValueCredentialId: string | null | undefined;
|
|
33
|
+
enabled: boolean;
|
|
34
|
+
} | {
|
|
35
|
+
authType: WebhookAuthType.jwt;
|
|
36
|
+
jwtSecretCredentialId: string | null | undefined;
|
|
37
|
+
jwtAlgorithm: import("./domain").WebhookJwtAlgorithm | null | undefined;
|
|
38
|
+
enabled: boolean;
|
|
39
|
+
}, unknown>>;
|
|
40
|
+
export type WebhookTriggerConfig = z.infer<typeof webhookTriggerSchema>;
|
|
2
41
|
export type WorkflowDefinitionParser = (definitionYml: string) => unknown;
|
|
3
42
|
export declare const workflowStubSchema: z.ZodObject<{
|
|
4
43
|
id: z.ZodString;
|
|
@@ -14,6 +53,43 @@ export declare const workflowStubSchema: z.ZodObject<{
|
|
|
14
53
|
y: z.ZodCoercedNumber<unknown>;
|
|
15
54
|
zoom: z.ZodCoercedNumber<unknown>;
|
|
16
55
|
direction: z.ZodEnum<typeof import("./domain").DirectionType>;
|
|
56
|
+
webhookTrigger: z.ZodOptional<z.ZodType<{
|
|
57
|
+
authType: WebhookAuthType.none;
|
|
58
|
+
enabled: boolean;
|
|
59
|
+
} | {
|
|
60
|
+
authType: WebhookAuthType.basic;
|
|
61
|
+
username: string | null | undefined;
|
|
62
|
+
passwordCredentialId: string | null | undefined;
|
|
63
|
+
enabled: boolean;
|
|
64
|
+
} | {
|
|
65
|
+
authType: WebhookAuthType.header;
|
|
66
|
+
headerName: string | null | undefined;
|
|
67
|
+
headerValueCredentialId: string | null | undefined;
|
|
68
|
+
enabled: boolean;
|
|
69
|
+
} | {
|
|
70
|
+
authType: WebhookAuthType.jwt;
|
|
71
|
+
jwtSecretCredentialId: string | null | undefined;
|
|
72
|
+
jwtAlgorithm: import("./domain").WebhookJwtAlgorithm | null | undefined;
|
|
73
|
+
enabled: boolean;
|
|
74
|
+
} | null, unknown, z.core.$ZodTypeInternals<{
|
|
75
|
+
authType: WebhookAuthType.none;
|
|
76
|
+
enabled: boolean;
|
|
77
|
+
} | {
|
|
78
|
+
authType: WebhookAuthType.basic;
|
|
79
|
+
username: string | null | undefined;
|
|
80
|
+
passwordCredentialId: string | null | undefined;
|
|
81
|
+
enabled: boolean;
|
|
82
|
+
} | {
|
|
83
|
+
authType: WebhookAuthType.header;
|
|
84
|
+
headerName: string | null | undefined;
|
|
85
|
+
headerValueCredentialId: string | null | undefined;
|
|
86
|
+
enabled: boolean;
|
|
87
|
+
} | {
|
|
88
|
+
authType: WebhookAuthType.jwt;
|
|
89
|
+
jwtSecretCredentialId: string | null | undefined;
|
|
90
|
+
jwtAlgorithm: import("./domain").WebhookJwtAlgorithm | null | undefined;
|
|
91
|
+
enabled: boolean;
|
|
92
|
+
} | null, unknown>>>;
|
|
17
93
|
}, z.core.$strip>;
|
|
18
94
|
export declare const workflowSchema: z.ZodType<{
|
|
19
95
|
id: string;
|
|
@@ -31,6 +107,25 @@ export declare const workflowSchema: z.ZodType<{
|
|
|
31
107
|
direction: import("./domain").DirectionType;
|
|
32
108
|
createdBy: string | null;
|
|
33
109
|
runAfterMs: number;
|
|
110
|
+
webhookTrigger?: {
|
|
111
|
+
authType: WebhookAuthType.none;
|
|
112
|
+
enabled: boolean;
|
|
113
|
+
} | {
|
|
114
|
+
authType: WebhookAuthType.basic;
|
|
115
|
+
username: string | null | undefined;
|
|
116
|
+
passwordCredentialId: string | null | undefined;
|
|
117
|
+
enabled: boolean;
|
|
118
|
+
} | {
|
|
119
|
+
authType: WebhookAuthType.header;
|
|
120
|
+
headerName: string | null | undefined;
|
|
121
|
+
headerValueCredentialId: string | null | undefined;
|
|
122
|
+
enabled: boolean;
|
|
123
|
+
} | {
|
|
124
|
+
authType: WebhookAuthType.jwt;
|
|
125
|
+
jwtSecretCredentialId: string | null | undefined;
|
|
126
|
+
jwtAlgorithm: import("./domain").WebhookJwtAlgorithm | null | undefined;
|
|
127
|
+
enabled: boolean;
|
|
128
|
+
} | null | undefined;
|
|
34
129
|
currentVersion?: string | null | undefined;
|
|
35
130
|
publishedVersion?: string | null | undefined;
|
|
36
131
|
}, unknown, z.core.$ZodTypeInternals<{
|
|
@@ -49,6 +144,25 @@ export declare const workflowSchema: z.ZodType<{
|
|
|
49
144
|
direction: import("./domain").DirectionType;
|
|
50
145
|
createdBy: string | null;
|
|
51
146
|
runAfterMs: number;
|
|
147
|
+
webhookTrigger?: {
|
|
148
|
+
authType: WebhookAuthType.none;
|
|
149
|
+
enabled: boolean;
|
|
150
|
+
} | {
|
|
151
|
+
authType: WebhookAuthType.basic;
|
|
152
|
+
username: string | null | undefined;
|
|
153
|
+
passwordCredentialId: string | null | undefined;
|
|
154
|
+
enabled: boolean;
|
|
155
|
+
} | {
|
|
156
|
+
authType: WebhookAuthType.header;
|
|
157
|
+
headerName: string | null | undefined;
|
|
158
|
+
headerValueCredentialId: string | null | undefined;
|
|
159
|
+
enabled: boolean;
|
|
160
|
+
} | {
|
|
161
|
+
authType: WebhookAuthType.jwt;
|
|
162
|
+
jwtSecretCredentialId: string | null | undefined;
|
|
163
|
+
jwtAlgorithm: import("./domain").WebhookJwtAlgorithm | null | undefined;
|
|
164
|
+
enabled: boolean;
|
|
165
|
+
} | null | undefined;
|
|
52
166
|
currentVersion?: string | null | undefined;
|
|
53
167
|
publishedVersion?: string | null | undefined;
|
|
54
168
|
}, unknown>>;
|
|
@@ -128,6 +242,25 @@ export declare const createWorkflowFullSchema: (options?: {
|
|
|
128
242
|
sub?: string | undefined;
|
|
129
243
|
} | undefined;
|
|
130
244
|
} | null;
|
|
245
|
+
webhookTrigger?: {
|
|
246
|
+
authType: WebhookAuthType.none;
|
|
247
|
+
enabled: boolean;
|
|
248
|
+
} | {
|
|
249
|
+
authType: WebhookAuthType.basic;
|
|
250
|
+
username: string | null | undefined;
|
|
251
|
+
passwordCredentialId: string | null | undefined;
|
|
252
|
+
enabled: boolean;
|
|
253
|
+
} | {
|
|
254
|
+
authType: WebhookAuthType.header;
|
|
255
|
+
headerName: string | null | undefined;
|
|
256
|
+
headerValueCredentialId: string | null | undefined;
|
|
257
|
+
enabled: boolean;
|
|
258
|
+
} | {
|
|
259
|
+
authType: WebhookAuthType.jwt;
|
|
260
|
+
jwtSecretCredentialId: string | null | undefined;
|
|
261
|
+
jwtAlgorithm: import("./domain").WebhookJwtAlgorithm | null | undefined;
|
|
262
|
+
enabled: boolean;
|
|
263
|
+
} | null | undefined;
|
|
131
264
|
definitionYml?: string | undefined;
|
|
132
265
|
definition?: any;
|
|
133
266
|
}, unknown, z.core.$ZodTypeInternals<{
|
|
@@ -204,6 +337,25 @@ export declare const createWorkflowFullSchema: (options?: {
|
|
|
204
337
|
sub?: string | undefined;
|
|
205
338
|
} | undefined;
|
|
206
339
|
} | null;
|
|
340
|
+
webhookTrigger?: {
|
|
341
|
+
authType: WebhookAuthType.none;
|
|
342
|
+
enabled: boolean;
|
|
343
|
+
} | {
|
|
344
|
+
authType: WebhookAuthType.basic;
|
|
345
|
+
username: string | null | undefined;
|
|
346
|
+
passwordCredentialId: string | null | undefined;
|
|
347
|
+
enabled: boolean;
|
|
348
|
+
} | {
|
|
349
|
+
authType: WebhookAuthType.header;
|
|
350
|
+
headerName: string | null | undefined;
|
|
351
|
+
headerValueCredentialId: string | null | undefined;
|
|
352
|
+
enabled: boolean;
|
|
353
|
+
} | {
|
|
354
|
+
authType: WebhookAuthType.jwt;
|
|
355
|
+
jwtSecretCredentialId: string | null | undefined;
|
|
356
|
+
jwtAlgorithm: import("./domain").WebhookJwtAlgorithm | null | undefined;
|
|
357
|
+
enabled: boolean;
|
|
358
|
+
} | null | undefined;
|
|
207
359
|
definitionYml?: string | undefined;
|
|
208
360
|
definition?: any;
|
|
209
361
|
}, unknown>>;
|
|
@@ -281,6 +433,25 @@ export declare const workflowFullSchema: z.ZodType<{
|
|
|
281
433
|
sub?: string | undefined;
|
|
282
434
|
} | undefined;
|
|
283
435
|
} | null;
|
|
436
|
+
webhookTrigger?: {
|
|
437
|
+
authType: WebhookAuthType.none;
|
|
438
|
+
enabled: boolean;
|
|
439
|
+
} | {
|
|
440
|
+
authType: WebhookAuthType.basic;
|
|
441
|
+
username: string | null | undefined;
|
|
442
|
+
passwordCredentialId: string | null | undefined;
|
|
443
|
+
enabled: boolean;
|
|
444
|
+
} | {
|
|
445
|
+
authType: WebhookAuthType.header;
|
|
446
|
+
headerName: string | null | undefined;
|
|
447
|
+
headerValueCredentialId: string | null | undefined;
|
|
448
|
+
enabled: boolean;
|
|
449
|
+
} | {
|
|
450
|
+
authType: WebhookAuthType.jwt;
|
|
451
|
+
jwtSecretCredentialId: string | null | undefined;
|
|
452
|
+
jwtAlgorithm: import("./domain").WebhookJwtAlgorithm | null | undefined;
|
|
453
|
+
enabled: boolean;
|
|
454
|
+
} | null | undefined;
|
|
284
455
|
definitionYml?: string | undefined;
|
|
285
456
|
definition?: any;
|
|
286
457
|
}, unknown, z.core.$ZodTypeInternals<{
|
|
@@ -357,6 +528,25 @@ export declare const workflowFullSchema: z.ZodType<{
|
|
|
357
528
|
sub?: string | undefined;
|
|
358
529
|
} | undefined;
|
|
359
530
|
} | null;
|
|
531
|
+
webhookTrigger?: {
|
|
532
|
+
authType: WebhookAuthType.none;
|
|
533
|
+
enabled: boolean;
|
|
534
|
+
} | {
|
|
535
|
+
authType: WebhookAuthType.basic;
|
|
536
|
+
username: string | null | undefined;
|
|
537
|
+
passwordCredentialId: string | null | undefined;
|
|
538
|
+
enabled: boolean;
|
|
539
|
+
} | {
|
|
540
|
+
authType: WebhookAuthType.header;
|
|
541
|
+
headerName: string | null | undefined;
|
|
542
|
+
headerValueCredentialId: string | null | undefined;
|
|
543
|
+
enabled: boolean;
|
|
544
|
+
} | {
|
|
545
|
+
authType: WebhookAuthType.jwt;
|
|
546
|
+
jwtSecretCredentialId: string | null | undefined;
|
|
547
|
+
jwtAlgorithm: import("./domain").WebhookJwtAlgorithm | null | undefined;
|
|
548
|
+
enabled: boolean;
|
|
549
|
+
} | null | undefined;
|
|
360
550
|
definitionYml?: string | undefined;
|
|
361
551
|
definition?: any;
|
|
362
552
|
}, unknown>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../../src/workflow/workflow.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../../src/workflow/workflow.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,OAAO,EAEL,eAAe,EAGhB,MAAM,UAAU,CAAC;AAclB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAqFhC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE,MAAM,MAAM,wBAAwB,GAAG,CAAC,aAAa,EAAE,MAAM,KAAK,OAAO,CAAC;AA2G1E,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAA2B,CAAC;AAE3D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAsB1B,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,UAAU;IACjD,eAAe,CAAC,EAAE,wBAAwB,CAAC;CAC5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAKA,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAA6B,CAAC;AAE7D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hexabot-ai/types",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "Shared zod schemas and inferred entity types for Hexabot.",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -47,7 +47,8 @@
|
|
|
47
47
|
"build": "pnpm run build:cjs && pnpm run build:esm",
|
|
48
48
|
"build:cjs": "tsc -p tsconfig.build.cjs.json",
|
|
49
49
|
"build:esm": "tsc -p tsconfig.build.esm.json",
|
|
50
|
-
"dev": "pnpm
|
|
50
|
+
"dev": "pnpm run build:cjs:watch",
|
|
51
|
+
"dev:full": "pnpm exec concurrently -k -n cjs,esm \"pnpm run build:cjs:watch\" \"pnpm run build:esm:watch\"",
|
|
51
52
|
"build:watch": "tsc -p tsconfig.json --watch",
|
|
52
53
|
"lint": "eslint \"src/**/*.ts\" \"jest.config.ts\"",
|
|
53
54
|
"lint:fix": "eslint \"src/**/*.ts\" \"jest.config.ts\" --fix",
|
package/src/index.test.ts
CHANGED
|
@@ -56,6 +56,8 @@ import {
|
|
|
56
56
|
threadFullSchema,
|
|
57
57
|
userFullSchema,
|
|
58
58
|
userSchema,
|
|
59
|
+
webhookTriggerSchema,
|
|
60
|
+
WebhookAuthType,
|
|
59
61
|
workflowFullSchema,
|
|
60
62
|
workflowExportBundleSchema,
|
|
61
63
|
workflowExportBundleV1Schema,
|
|
@@ -68,6 +70,50 @@ import {
|
|
|
68
70
|
describe("@hexabot-ai/types schemas", () => {
|
|
69
71
|
const now = "2026-01-01T00:00:00.000Z";
|
|
70
72
|
|
|
73
|
+
it("never carries inline webhook secrets", () => {
|
|
74
|
+
// Unknown keys (e.g. an inline secret sent by a stale client) are
|
|
75
|
+
// stripped: only credential references are part of the config shape.
|
|
76
|
+
const parsed = webhookTriggerSchema.parse({
|
|
77
|
+
enabled: true,
|
|
78
|
+
authType: WebhookAuthType.jwt,
|
|
79
|
+
jwtSecret: "plaintext-secret",
|
|
80
|
+
jwtSecretCredentialId: "cred-1",
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
expect("jwtSecret" in parsed).toBe(false);
|
|
84
|
+
expect(
|
|
85
|
+
(parsed as { jwtSecretCredentialId?: string | null })
|
|
86
|
+
.jwtSecretCredentialId,
|
|
87
|
+
).toBe("cred-1");
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
it("requires credential refs once the webhook is enabled", () => {
|
|
91
|
+
expect(() =>
|
|
92
|
+
webhookTriggerSchema.parse({
|
|
93
|
+
enabled: true,
|
|
94
|
+
authType: WebhookAuthType.basic,
|
|
95
|
+
username: "ada",
|
|
96
|
+
passwordCredentialId: null,
|
|
97
|
+
}),
|
|
98
|
+
).toThrow();
|
|
99
|
+
expect(() =>
|
|
100
|
+
webhookTriggerSchema.parse({
|
|
101
|
+
enabled: true,
|
|
102
|
+
authType: WebhookAuthType.basic,
|
|
103
|
+
username: "ada",
|
|
104
|
+
passwordCredentialId: "cred-1",
|
|
105
|
+
}),
|
|
106
|
+
).not.toThrow();
|
|
107
|
+
// Disabled webhooks can be saved without credentials.
|
|
108
|
+
expect(() =>
|
|
109
|
+
webhookTriggerSchema.parse({
|
|
110
|
+
enabled: false,
|
|
111
|
+
authType: WebhookAuthType.jwt,
|
|
112
|
+
jwtSecretCredentialId: null,
|
|
113
|
+
}),
|
|
114
|
+
).not.toThrow();
|
|
115
|
+
});
|
|
116
|
+
|
|
71
117
|
it("maps user aliases and strips unknown keys", () => {
|
|
72
118
|
const parsed = userSchema.parse({
|
|
73
119
|
id: "u_1",
|
package/src/workflow/domain.ts
CHANGED
|
@@ -36,6 +36,19 @@ export enum DirectionType {
|
|
|
36
36
|
VERTICAL = "vertical",
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
export enum WebhookAuthType {
|
|
40
|
+
none = "none",
|
|
41
|
+
basic = "basic",
|
|
42
|
+
header = "header",
|
|
43
|
+
jwt = "jwt",
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export enum WebhookJwtAlgorithm {
|
|
47
|
+
HS256 = "HS256",
|
|
48
|
+
HS384 = "HS384",
|
|
49
|
+
HS512 = "HS512",
|
|
50
|
+
}
|
|
51
|
+
|
|
39
52
|
export const workflowTypeSchema = z.enum(WorkflowType);
|
|
40
53
|
|
|
41
54
|
export const workflowVersionActionSchema = z.enum(WorkflowVersionAction);
|
|
@@ -45,3 +58,7 @@ export const memoryScopeSchema = z.enum(MemoryScope);
|
|
|
45
58
|
export const mcpServerTransportSchema = z.enum(McpServerTransport);
|
|
46
59
|
|
|
47
60
|
export const directionTypeSchema = z.enum(DirectionType);
|
|
61
|
+
|
|
62
|
+
export const webhookAuthTypeSchema = z.enum(WebhookAuthType);
|
|
63
|
+
|
|
64
|
+
export const webhookJwtAlgorithmSchema = z.enum(WebhookJwtAlgorithm);
|
package/src/workflow/index.ts
CHANGED
|
@@ -8,15 +8,21 @@ export {
|
|
|
8
8
|
DirectionType,
|
|
9
9
|
McpServerTransport,
|
|
10
10
|
MemoryScope,
|
|
11
|
+
WebhookAuthType,
|
|
12
|
+
WebhookJwtAlgorithm,
|
|
13
|
+
webhookAuthTypeSchema,
|
|
14
|
+
webhookJwtAlgorithmSchema,
|
|
11
15
|
WorkflowType,
|
|
12
16
|
WorkflowVersionAction,
|
|
13
17
|
} from "./domain";
|
|
14
18
|
|
|
15
19
|
export {
|
|
16
20
|
createWorkflowFullSchema,
|
|
21
|
+
webhookTriggerSchema,
|
|
17
22
|
workflowFullSchema,
|
|
18
23
|
workflowSchema,
|
|
19
24
|
workflowStubSchema,
|
|
25
|
+
type WebhookTriggerConfig,
|
|
20
26
|
type Workflow,
|
|
21
27
|
type WorkflowDefinitionParser,
|
|
22
28
|
type WorkflowFull,
|
package/src/workflow/workflow.ts
CHANGED
|
@@ -12,10 +12,114 @@ import { cloneWithPrototype, toRecord } from "../shared/object";
|
|
|
12
12
|
import { preprocess } from "../shared/preprocess";
|
|
13
13
|
import { userSchema } from "../user/user";
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
directionTypeSchema,
|
|
17
|
+
WebhookAuthType,
|
|
18
|
+
webhookJwtAlgorithmSchema,
|
|
19
|
+
workflowTypeSchema,
|
|
20
|
+
} from "./domain";
|
|
16
21
|
import { nullishToNull } from "./helpers";
|
|
17
22
|
import { workflowVersionSchema } from "./workflow-version";
|
|
18
23
|
|
|
24
|
+
const nullableString = preprocess(
|
|
25
|
+
nullishToNull,
|
|
26
|
+
z.string().nullable().optional(),
|
|
27
|
+
);
|
|
28
|
+
const webhookTriggerBaseShape = {
|
|
29
|
+
enabled: z.coerce.boolean().default(false),
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
// Secrets are never stored inline on the workflow: each secret lives in the
|
|
33
|
+
// credentials store and the trigger config only carries its credential id.
|
|
34
|
+
export const webhookTriggerSchema = preprocess(
|
|
35
|
+
(value) => {
|
|
36
|
+
// Default the discriminator so a config without an explicit authType still
|
|
37
|
+
// validates as an unauthenticated webhook (matches the previous behaviour).
|
|
38
|
+
const record = toRecord(value);
|
|
39
|
+
if (record && record.authType == null) {
|
|
40
|
+
return { ...record, authType: WebhookAuthType.none };
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return value;
|
|
44
|
+
},
|
|
45
|
+
z
|
|
46
|
+
.discriminatedUnion("authType", [
|
|
47
|
+
z.object({
|
|
48
|
+
...webhookTriggerBaseShape,
|
|
49
|
+
authType: z.literal(WebhookAuthType.none),
|
|
50
|
+
}),
|
|
51
|
+
z.object({
|
|
52
|
+
...webhookTriggerBaseShape,
|
|
53
|
+
authType: z.literal(WebhookAuthType.basic),
|
|
54
|
+
username: nullableString,
|
|
55
|
+
passwordCredentialId: nullableString,
|
|
56
|
+
}),
|
|
57
|
+
z.object({
|
|
58
|
+
...webhookTriggerBaseShape,
|
|
59
|
+
authType: z.literal(WebhookAuthType.header),
|
|
60
|
+
headerName: nullableString,
|
|
61
|
+
headerValueCredentialId: nullableString,
|
|
62
|
+
}),
|
|
63
|
+
z.object({
|
|
64
|
+
...webhookTriggerBaseShape,
|
|
65
|
+
authType: z.literal(WebhookAuthType.jwt),
|
|
66
|
+
jwtSecretCredentialId: nullableString,
|
|
67
|
+
jwtAlgorithm: preprocess(
|
|
68
|
+
nullishToNull,
|
|
69
|
+
webhookJwtAlgorithmSchema.nullable().optional(),
|
|
70
|
+
),
|
|
71
|
+
}),
|
|
72
|
+
])
|
|
73
|
+
// An enabled webhook with an unset credential reference would otherwise
|
|
74
|
+
// authenticate empty credentials, so references are mandatory once
|
|
75
|
+
// enabled.
|
|
76
|
+
.superRefine((config, ctx) => {
|
|
77
|
+
if (!config.enabled) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const requireCredential = (
|
|
82
|
+
field: string,
|
|
83
|
+
value: string | null | undefined,
|
|
84
|
+
) => {
|
|
85
|
+
if (!value) {
|
|
86
|
+
ctx.addIssue({
|
|
87
|
+
code: "custom",
|
|
88
|
+
path: [field],
|
|
89
|
+
message: `${field} is required when the webhook trigger is enabled`,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
switch (config.authType) {
|
|
95
|
+
case WebhookAuthType.basic:
|
|
96
|
+
requireCredential("username", config.username);
|
|
97
|
+
requireCredential(
|
|
98
|
+
"passwordCredentialId",
|
|
99
|
+
config.passwordCredentialId,
|
|
100
|
+
);
|
|
101
|
+
break;
|
|
102
|
+
case WebhookAuthType.header:
|
|
103
|
+
requireCredential("headerName", config.headerName);
|
|
104
|
+
requireCredential(
|
|
105
|
+
"headerValueCredentialId",
|
|
106
|
+
config.headerValueCredentialId,
|
|
107
|
+
);
|
|
108
|
+
break;
|
|
109
|
+
case WebhookAuthType.jwt:
|
|
110
|
+
requireCredential(
|
|
111
|
+
"jwtSecretCredentialId",
|
|
112
|
+
config.jwtSecretCredentialId,
|
|
113
|
+
);
|
|
114
|
+
break;
|
|
115
|
+
default:
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
}),
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
export type WebhookTriggerConfig = z.infer<typeof webhookTriggerSchema>;
|
|
122
|
+
|
|
19
123
|
export type WorkflowDefinitionParser = (definitionYml: string) => unknown;
|
|
20
124
|
const workflowAliasMap = {
|
|
21
125
|
currentVersionId: "currentVersion",
|
|
@@ -33,6 +137,10 @@ const workflowStubObjectSchema = baseStubSchema.extend({
|
|
|
33
137
|
y: z.coerce.number(),
|
|
34
138
|
zoom: z.coerce.number(),
|
|
35
139
|
direction: directionTypeSchema,
|
|
140
|
+
webhookTrigger: preprocess(
|
|
141
|
+
nullishToNull,
|
|
142
|
+
webhookTriggerSchema.nullable(),
|
|
143
|
+
).optional(),
|
|
36
144
|
});
|
|
37
145
|
const withWorkflowAliases = (value: unknown): unknown => {
|
|
38
146
|
const original = toRecord(value);
|