@hexabot-ai/types 3.0.0-alpha.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/LICENSE.md +120 -0
- package/README.md +172 -0
- package/dist/cjs/analytics/index.js +18 -0
- package/dist/cjs/analytics/integration-health.js +30 -0
- package/dist/cjs/analytics/stats.js +32 -0
- package/dist/cjs/attachment/attachment.js +53 -0
- package/dist/cjs/attachment/index.js +16 -0
- package/dist/cjs/audit/audit-log.js +33 -0
- package/dist/cjs/audit/index.js +11 -0
- package/dist/cjs/channel/channel-metadata.js +15 -0
- package/dist/cjs/channel/index.js +15 -0
- package/dist/cjs/channel/source-full.js +16 -0
- package/dist/cjs/channel/source.js +25 -0
- package/dist/cjs/chat/attachment.js +32 -0
- package/dist/cjs/chat/button.js +70 -0
- package/dist/cjs/chat/index.js +87 -0
- package/dist/cjs/chat/label-group.js +22 -0
- package/dist/cjs/chat/label.js +37 -0
- package/dist/cjs/chat/message-contract.js +183 -0
- package/dist/cjs/chat/message.js +107 -0
- package/dist/cjs/chat/options.js +122 -0
- package/dist/cjs/chat/quick-reply.js +35 -0
- package/dist/cjs/chat/subscriber.js +36 -0
- package/dist/cjs/chat/thread.js +36 -0
- package/dist/cjs/cms/content-type.js +17 -0
- package/dist/cjs/cms/content.js +29 -0
- package/dist/cjs/cms/index.js +21 -0
- package/dist/cjs/cms/menu.js +36 -0
- package/dist/cjs/dummy/dummy.js +18 -0
- package/dist/cjs/dummy/index.js +12 -0
- package/dist/cjs/i18n/index.js +16 -0
- package/dist/cjs/i18n/language.js +19 -0
- package/dist/cjs/i18n/translation.js +17 -0
- package/dist/cjs/index.js +32 -0
- package/dist/cjs/setting/index.js +18 -0
- package/dist/cjs/setting/metadata.js +17 -0
- package/dist/cjs/setting/setting.js +36 -0
- package/dist/cjs/shared/aliases.js +41 -0
- package/dist/cjs/shared/base.js +14 -0
- package/dist/cjs/shared/object.js +19 -0
- package/dist/cjs/shared/preprocess.js +13 -0
- package/dist/cjs/shared/profile.js +33 -0
- package/dist/cjs/user/credential.js +26 -0
- package/dist/cjs/user/domain.js +56 -0
- package/dist/cjs/user/index.js +39 -0
- package/dist/cjs/user/model.js +24 -0
- package/dist/cjs/user/permission.js +32 -0
- package/dist/cjs/user/role.js +24 -0
- package/dist/cjs/user/user-profile-assigned.js +38 -0
- package/dist/cjs/user/user-profile.js +12 -0
- package/dist/cjs/user/user.js +44 -0
- package/dist/cjs/workflow/domain.js +44 -0
- package/dist/cjs/workflow/helpers.js +35 -0
- package/dist/cjs/workflow/index.js +40 -0
- package/dist/cjs/workflow/mcp-server.js +33 -0
- package/dist/cjs/workflow/memory-definition.js +21 -0
- package/dist/cjs/workflow/memory-record.js +44 -0
- package/dist/cjs/workflow/workflow-run.js +100 -0
- package/dist/cjs/workflow/workflow-version.js +39 -0
- package/dist/cjs/workflow/workflow.js +98 -0
- package/dist/esm/analytics/index.js +7 -0
- package/dist/esm/analytics/integration-health.js +27 -0
- package/dist/esm/analytics/stats.js +29 -0
- package/dist/esm/attachment/attachment.js +50 -0
- package/dist/esm/attachment/index.js +6 -0
- package/dist/esm/audit/audit-log.js +30 -0
- package/dist/esm/audit/index.js +6 -0
- package/dist/esm/channel/channel-metadata.js +12 -0
- package/dist/esm/channel/index.js +8 -0
- package/dist/esm/channel/source-full.js +13 -0
- package/dist/esm/channel/source.js +22 -0
- package/dist/esm/chat/attachment.js +29 -0
- package/dist/esm/chat/button.js +67 -0
- package/dist/esm/chat/index.js +15 -0
- package/dist/esm/chat/label-group.js +19 -0
- package/dist/esm/chat/label.js +34 -0
- package/dist/esm/chat/message-contract.js +180 -0
- package/dist/esm/chat/message.js +104 -0
- package/dist/esm/chat/options.js +119 -0
- package/dist/esm/chat/quick-reply.js +32 -0
- package/dist/esm/chat/subscriber.js +33 -0
- package/dist/esm/chat/thread.js +33 -0
- package/dist/esm/cms/content-type.js +14 -0
- package/dist/esm/cms/content.js +26 -0
- package/dist/esm/cms/index.js +8 -0
- package/dist/esm/cms/menu.js +33 -0
- package/dist/esm/dummy/dummy.js +15 -0
- package/dist/esm/dummy/index.js +6 -0
- package/dist/esm/i18n/index.js +7 -0
- package/dist/esm/i18n/language.js +16 -0
- package/dist/esm/i18n/translation.js +14 -0
- package/dist/esm/index.js +16 -0
- package/dist/esm/setting/index.js +7 -0
- package/dist/esm/setting/metadata.js +14 -0
- package/dist/esm/setting/setting.js +33 -0
- package/dist/esm/shared/aliases.js +35 -0
- package/dist/esm/shared/base.js +11 -0
- package/dist/esm/shared/object.js +14 -0
- package/dist/esm/shared/preprocess.js +9 -0
- package/dist/esm/shared/profile.js +30 -0
- package/dist/esm/user/credential.js +23 -0
- package/dist/esm/user/domain.js +53 -0
- package/dist/esm/user/index.js +13 -0
- package/dist/esm/user/model.js +21 -0
- package/dist/esm/user/permission.js +29 -0
- package/dist/esm/user/role.js +21 -0
- package/dist/esm/user/user-profile-assigned.js +35 -0
- package/dist/esm/user/user-profile.js +9 -0
- package/dist/esm/user/user.js +41 -0
- package/dist/esm/workflow/domain.js +41 -0
- package/dist/esm/workflow/helpers.js +30 -0
- package/dist/esm/workflow/index.js +12 -0
- package/dist/esm/workflow/mcp-server.js +30 -0
- package/dist/esm/workflow/memory-definition.js +18 -0
- package/dist/esm/workflow/memory-record.js +41 -0
- package/dist/esm/workflow/workflow-run.js +96 -0
- package/dist/esm/workflow/workflow-version.js +36 -0
- package/dist/esm/workflow/workflow.js +94 -0
- package/dist/types/analytics/index.d.ts +3 -0
- package/dist/types/analytics/index.d.ts.map +1 -0
- package/dist/types/analytics/integration-health.d.ts +55 -0
- package/dist/types/analytics/integration-health.d.ts.map +1 -0
- package/dist/types/analytics/stats.d.ts +43 -0
- package/dist/types/analytics/stats.d.ts.map +1 -0
- package/dist/types/attachment/attachment.d.ts +212 -0
- package/dist/types/attachment/attachment.d.ts.map +1 -0
- package/dist/types/attachment/index.d.ts +2 -0
- package/dist/types/attachment/index.d.ts.map +1 -0
- package/dist/types/audit/audit-log.d.ts +58 -0
- package/dist/types/audit/audit-log.d.ts.map +1 -0
- package/dist/types/audit/index.d.ts +2 -0
- package/dist/types/audit/index.d.ts.map +1 -0
- package/dist/types/channel/channel-metadata.d.ts +7 -0
- package/dist/types/channel/channel-metadata.d.ts.map +1 -0
- package/dist/types/channel/index.d.ts +4 -0
- package/dist/types/channel/index.d.ts.map +1 -0
- package/dist/types/channel/source-full.d.ts +58 -0
- package/dist/types/channel/source-full.d.ts.map +1 -0
- package/dist/types/channel/source.d.ts +44 -0
- package/dist/types/channel/source.d.ts.map +1 -0
- package/dist/types/chat/attachment.d.ts +34 -0
- package/dist/types/chat/attachment.d.ts.map +1 -0
- package/dist/types/chat/button.d.ts +31 -0
- package/dist/types/chat/button.d.ts.map +1 -0
- package/dist/types/chat/index.d.ts +11 -0
- package/dist/types/chat/index.d.ts.map +1 -0
- package/dist/types/chat/label-group.d.ts +47 -0
- package/dist/types/chat/label-group.d.ts.map +1 -0
- package/dist/types/chat/label.d.ts +102 -0
- package/dist/types/chat/label.d.ts.map +1 -0
- package/dist/types/chat/message-contract.d.ts +883 -0
- package/dist/types/chat/message-contract.d.ts.map +1 -0
- package/dist/types/chat/message.d.ts +1132 -0
- package/dist/types/chat/message.d.ts.map +1 -0
- package/dist/types/chat/options.d.ts +64 -0
- package/dist/types/chat/options.d.ts.map +1 -0
- package/dist/types/chat/quick-reply.d.ts +32 -0
- package/dist/types/chat/quick-reply.d.ts.map +1 -0
- package/dist/types/chat/subscriber.d.ts +236 -0
- package/dist/types/chat/subscriber.d.ts.map +1 -0
- package/dist/types/chat/thread.d.ts +126 -0
- package/dist/types/chat/thread.d.ts.map +1 -0
- package/dist/types/cms/content-type.d.ts +26 -0
- package/dist/types/cms/content-type.d.ts.map +1 -0
- package/dist/types/cms/content.d.ts +49 -0
- package/dist/types/cms/content.d.ts.map +1 -0
- package/dist/types/cms/index.d.ts +4 -0
- package/dist/types/cms/index.d.ts.map +1 -0
- package/dist/types/cms/menu.d.ts +85 -0
- package/dist/types/cms/menu.d.ts.map +1 -0
- package/dist/types/dummy/dummy.d.ts +26 -0
- package/dist/types/dummy/dummy.d.ts.map +1 -0
- package/dist/types/dummy/index.d.ts +2 -0
- package/dist/types/dummy/index.d.ts.map +1 -0
- package/dist/types/i18n/index.d.ts +3 -0
- package/dist/types/i18n/index.d.ts.map +1 -0
- package/dist/types/i18n/language.d.ts +32 -0
- package/dist/types/i18n/language.d.ts.map +1 -0
- package/dist/types/i18n/translation.d.ts +26 -0
- package/dist/types/i18n/translation.d.ts.map +1 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/setting/index.d.ts +3 -0
- package/dist/types/setting/index.d.ts.map +1 -0
- package/dist/types/setting/metadata.d.ts +26 -0
- package/dist/types/setting/metadata.d.ts.map +1 -0
- package/dist/types/setting/setting.d.ts +41 -0
- package/dist/types/setting/setting.d.ts.map +1 -0
- package/dist/types/shared/aliases.d.ts +4 -0
- package/dist/types/shared/aliases.d.ts.map +1 -0
- package/dist/types/shared/base.d.ts +7 -0
- package/dist/types/shared/base.d.ts.map +1 -0
- package/dist/types/shared/object.d.ts +3 -0
- package/dist/types/shared/object.d.ts.map +1 -0
- package/dist/types/shared/preprocess.d.ts +3 -0
- package/dist/types/shared/preprocess.d.ts.map +1 -0
- package/dist/types/shared/profile.d.ts +40 -0
- package/dist/types/shared/profile.d.ts.map +1 -0
- package/dist/types/user/credential.d.ts +97 -0
- package/dist/types/user/credential.d.ts.map +1 -0
- package/dist/types/user/domain.d.ts +54 -0
- package/dist/types/user/domain.d.ts.map +1 -0
- package/dist/types/user/index.d.ts +9 -0
- package/dist/types/user/index.d.ts.map +1 -0
- package/dist/types/user/model.d.ts +142 -0
- package/dist/types/user/model.d.ts.map +1 -0
- package/dist/types/user/permission.d.ts +90 -0
- package/dist/types/user/permission.d.ts.map +1 -0
- package/dist/types/user/role.d.ts +111 -0
- package/dist/types/user/role.d.ts.map +1 -0
- package/dist/types/user/user-profile-assigned.d.ts +181 -0
- package/dist/types/user/user-profile-assigned.d.ts.map +1 -0
- package/dist/types/user/user-profile.d.ts +32 -0
- package/dist/types/user/user-profile.d.ts.map +1 -0
- package/dist/types/user/user.d.ts +270 -0
- package/dist/types/user/user.d.ts.map +1 -0
- package/dist/types/workflow/domain.d.ts +32 -0
- package/dist/types/workflow/domain.d.ts.map +1 -0
- package/dist/types/workflow/helpers.d.ts +117 -0
- package/dist/types/workflow/helpers.d.ts.map +1 -0
- package/dist/types/workflow/index.d.ts +8 -0
- package/dist/types/workflow/index.d.ts.map +1 -0
- package/dist/types/workflow/mcp-server.d.ts +67 -0
- package/dist/types/workflow/mcp-server.d.ts.map +1 -0
- package/dist/types/workflow/memory-definition.d.ts +35 -0
- package/dist/types/workflow/memory-definition.d.ts.map +1 -0
- package/dist/types/workflow/memory-record.d.ts +284 -0
- package/dist/types/workflow/memory-record.d.ts.map +1 -0
- package/dist/types/workflow/workflow-run.d.ts +375 -0
- package/dist/types/workflow/workflow-run.d.ts.map +1 -0
- package/dist/types/workflow/workflow-version.d.ts +179 -0
- package/dist/types/workflow/workflow-version.d.ts.map +1 -0
- package/dist/types/workflow/workflow.d.ts +366 -0
- package/dist/types/workflow/workflow.d.ts.map +1 -0
- package/package.json +59 -0
- package/src/analytics/index.ts +26 -0
- package/src/analytics/integration-health.ts +44 -0
- package/src/analytics/stats.ts +41 -0
- package/src/attachment/attachment.ts +75 -0
- package/src/attachment/index.ts +19 -0
- package/src/audit/audit-log.ts +42 -0
- package/src/audit/index.ts +12 -0
- package/src/channel/channel-metadata.ts +20 -0
- package/src/channel/index.ts +19 -0
- package/src/channel/source-full.ts +25 -0
- package/src/channel/source.ts +42 -0
- package/src/chat/attachment.ts +44 -0
- package/src/chat/button.ts +90 -0
- package/src/chat/index.ts +173 -0
- package/src/chat/label-group.ts +35 -0
- package/src/chat/label.ts +56 -0
- package/src/chat/message-contract.ts +370 -0
- package/src/chat/message.ts +164 -0
- package/src/chat/options.ts +130 -0
- package/src/chat/quick-reply.ts +41 -0
- package/src/chat/subscriber.ts +73 -0
- package/src/chat/thread.ts +55 -0
- package/src/cms/content-type.ts +26 -0
- package/src/cms/content.ts +48 -0
- package/src/cms/index.ts +33 -0
- package/src/cms/menu.ts +54 -0
- package/src/dummy/dummy.ts +30 -0
- package/src/dummy/index.ts +14 -0
- package/src/i18n/index.ts +23 -0
- package/src/i18n/language.ts +28 -0
- package/src/i18n/translation.ts +26 -0
- package/src/index.test.ts +1271 -0
- package/src/index.ts +27 -0
- package/src/setting/index.ts +25 -0
- package/src/setting/metadata.ts +26 -0
- package/src/setting/setting.ts +46 -0
- package/src/shared/aliases.ts +48 -0
- package/src/shared/base.ts +13 -0
- package/src/shared/object.ts +19 -0
- package/src/shared/preprocess.ts +14 -0
- package/src/shared/profile.ts +49 -0
- package/src/user/credential.ts +45 -0
- package/src/user/domain.ts +94 -0
- package/src/user/index.ts +78 -0
- package/src/user/model.ts +40 -0
- package/src/user/permission.ts +51 -0
- package/src/user/role.ts +43 -0
- package/src/user/user-profile-assigned.ts +70 -0
- package/src/user/user-profile.ts +21 -0
- package/src/user/user.ts +87 -0
- package/src/workflow/domain.ts +47 -0
- package/src/workflow/helpers.ts +40 -0
- package/src/workflow/index.ts +70 -0
- package/src/workflow/mcp-server.ts +64 -0
- package/src/workflow/memory-definition.ts +31 -0
- package/src/workflow/memory-record.ts +71 -0
- package/src/workflow/workflow-run.ts +156 -0
- package/src/workflow/workflow-version.ts +68 -0
- package/src/workflow/workflow.ts +163 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Hexabot — Fair Core License (FCL-1.0-ALv2)
|
|
3
|
+
* Copyright (c) 2026 Hexastack.
|
|
4
|
+
* Full terms: see LICENSE.md.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
|
|
9
|
+
import { userProfileBaseSchema } from "../shared/profile";
|
|
10
|
+
|
|
11
|
+
export const userProfileStubSchema = userProfileBaseSchema;
|
|
12
|
+
|
|
13
|
+
export const userProfileSchema = userProfileBaseSchema;
|
|
14
|
+
|
|
15
|
+
export const userProfileFullSchema = userProfileBaseSchema;
|
|
16
|
+
|
|
17
|
+
export type UserProfileStub = z.infer<typeof userProfileStubSchema>;
|
|
18
|
+
|
|
19
|
+
export type UserProfile = z.infer<typeof userProfileSchema>;
|
|
20
|
+
|
|
21
|
+
export type UserProfileFull = z.infer<typeof userProfileFullSchema>;
|
package/src/user/user.ts
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Hexabot — Fair Core License (FCL-1.0-ALv2)
|
|
3
|
+
* Copyright (c) 2026 Hexastack.
|
|
4
|
+
* Full terms: see LICENSE.md.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
|
|
9
|
+
import { attachmentSchema } from "../attachment/attachment";
|
|
10
|
+
import { labelSchema } from "../chat/label";
|
|
11
|
+
import { asId, asIdArray, withAliases } from "../shared/aliases";
|
|
12
|
+
import { preprocess } from "../shared/preprocess";
|
|
13
|
+
import { subscriberBaseSchema } from "../shared/profile";
|
|
14
|
+
|
|
15
|
+
import { roleSchema } from "./role";
|
|
16
|
+
import {
|
|
17
|
+
userProfileAssignedSchema,
|
|
18
|
+
userProviderSchema,
|
|
19
|
+
} from "./user-profile-assigned";
|
|
20
|
+
|
|
21
|
+
const userAliasMap = {
|
|
22
|
+
labelIds: "labels",
|
|
23
|
+
assignedToId: "assignedTo",
|
|
24
|
+
roleIds: "roles",
|
|
25
|
+
avatarId: "avatar",
|
|
26
|
+
} as const;
|
|
27
|
+
const userStubObjectSchema = subscriberBaseSchema.extend({
|
|
28
|
+
username: z.string(),
|
|
29
|
+
email: z.string(),
|
|
30
|
+
sendEmail: z.coerce.boolean(),
|
|
31
|
+
state: z.coerce.boolean(),
|
|
32
|
+
resetCount: z.coerce.number(),
|
|
33
|
+
resetToken: preprocess(
|
|
34
|
+
(value) => (value == null ? null : value),
|
|
35
|
+
z.string().nullable(),
|
|
36
|
+
),
|
|
37
|
+
provider: userProviderSchema.optional(),
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export const userStubSchema = userStubObjectSchema;
|
|
41
|
+
|
|
42
|
+
export const userSchema = preprocess(
|
|
43
|
+
(value) => withAliases(value, userAliasMap),
|
|
44
|
+
userStubObjectSchema.extend({
|
|
45
|
+
labels: preprocess(
|
|
46
|
+
(value) => (Array.isArray(value) ? asIdArray(value) : []),
|
|
47
|
+
z.array(z.string()),
|
|
48
|
+
),
|
|
49
|
+
assignedTo: preprocess(
|
|
50
|
+
(value) => (value == null ? null : asId(value)),
|
|
51
|
+
z.string().nullable(),
|
|
52
|
+
),
|
|
53
|
+
roles: preprocess(
|
|
54
|
+
(value) => (Array.isArray(value) ? asIdArray(value) : []),
|
|
55
|
+
z.array(z.string()),
|
|
56
|
+
),
|
|
57
|
+
avatar: preprocess(
|
|
58
|
+
(value) => (value == null ? null : asId(value)),
|
|
59
|
+
z.string().nullable(),
|
|
60
|
+
),
|
|
61
|
+
}),
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
export const userFullSchema = userStubObjectSchema.extend({
|
|
65
|
+
labels: preprocess(
|
|
66
|
+
(value) => (Array.isArray(value) ? value : []),
|
|
67
|
+
z.array(z.lazy(() => labelSchema)),
|
|
68
|
+
),
|
|
69
|
+
assignedTo: preprocess(
|
|
70
|
+
(value) => (value == null ? null : value),
|
|
71
|
+
userProfileAssignedSchema.nullable(),
|
|
72
|
+
),
|
|
73
|
+
roles: preprocess(
|
|
74
|
+
(value) => (Array.isArray(value) ? value : []),
|
|
75
|
+
z.array(z.lazy(() => roleSchema)),
|
|
76
|
+
),
|
|
77
|
+
avatar: preprocess(
|
|
78
|
+
(value) => (value == null ? null : value),
|
|
79
|
+
attachmentSchema.nullable(),
|
|
80
|
+
),
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
export type UserStub = z.infer<typeof userStubSchema>;
|
|
84
|
+
|
|
85
|
+
export type User = z.infer<typeof userSchema>;
|
|
86
|
+
|
|
87
|
+
export type UserFull = z.infer<typeof userFullSchema>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Hexabot — Fair Core License (FCL-1.0-ALv2)
|
|
3
|
+
* Copyright (c) 2026 Hexastack.
|
|
4
|
+
* Full terms: see LICENSE.md.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
|
|
9
|
+
export enum WorkflowType {
|
|
10
|
+
conversational = "conversational",
|
|
11
|
+
manual = "manual",
|
|
12
|
+
scheduled = "scheduled",
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export enum WorkflowVersionAction {
|
|
16
|
+
create = "create",
|
|
17
|
+
update = "update",
|
|
18
|
+
restore = "restore",
|
|
19
|
+
import = "import",
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export enum MemoryScope {
|
|
23
|
+
global = "global",
|
|
24
|
+
workflow = "workflow",
|
|
25
|
+
thread = "thread",
|
|
26
|
+
run = "run",
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export enum McpServerTransport {
|
|
30
|
+
http = "http",
|
|
31
|
+
stdio = "stdio",
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export enum DirectionType {
|
|
35
|
+
HORIZONTAL = "horizontal",
|
|
36
|
+
VERTICAL = "vertical",
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const workflowTypeSchema = z.enum(WorkflowType);
|
|
40
|
+
|
|
41
|
+
export const workflowVersionActionSchema = z.enum(WorkflowVersionAction);
|
|
42
|
+
|
|
43
|
+
export const memoryScopeSchema = z.enum(MemoryScope);
|
|
44
|
+
|
|
45
|
+
export const mcpServerTransportSchema = z.enum(McpServerTransport);
|
|
46
|
+
|
|
47
|
+
export const directionTypeSchema = z.enum(DirectionType);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Hexabot — Fair Core License (FCL-1.0-ALv2)
|
|
3
|
+
* Copyright (c) 2026 Hexastack.
|
|
4
|
+
* Full terms: see LICENSE.md.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
|
|
9
|
+
import { subscriberSchema } from "../chat/subscriber";
|
|
10
|
+
import { toRecord } from "../shared/object";
|
|
11
|
+
import { userSchema } from "../user/user";
|
|
12
|
+
|
|
13
|
+
export const nullishToNull = (value: unknown): unknown => {
|
|
14
|
+
return value == null ? null : value;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const userOrSubscriberSchema = z.union([
|
|
18
|
+
z.lazy(() => userSchema),
|
|
19
|
+
subscriberSchema,
|
|
20
|
+
]);
|
|
21
|
+
|
|
22
|
+
export const parseUserOrSubscriber = (
|
|
23
|
+
value: unknown,
|
|
24
|
+
): z.infer<typeof userOrSubscriberSchema> => {
|
|
25
|
+
const record = toRecord(value);
|
|
26
|
+
|
|
27
|
+
if (record?.type === "UserOrmEntity") {
|
|
28
|
+
return userSchema.parse(value);
|
|
29
|
+
}
|
|
30
|
+
if (record?.type === "SubscriberOrmEntity") {
|
|
31
|
+
return subscriberSchema.parse(value);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const parsedUser = userSchema.safeParse(value);
|
|
35
|
+
if (parsedUser.success) {
|
|
36
|
+
return parsedUser.data;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return subscriberSchema.parse(value);
|
|
40
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Hexabot — Fair Core License (FCL-1.0-ALv2)
|
|
3
|
+
* Copyright (c) 2026 Hexastack.
|
|
4
|
+
* Full terms: see LICENSE.md.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export {
|
|
8
|
+
DirectionType,
|
|
9
|
+
McpServerTransport,
|
|
10
|
+
MemoryScope,
|
|
11
|
+
WorkflowType,
|
|
12
|
+
WorkflowVersionAction,
|
|
13
|
+
} from "./domain";
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
createWorkflowFullSchema,
|
|
17
|
+
workflowFullSchema,
|
|
18
|
+
workflowSchema,
|
|
19
|
+
workflowStubSchema,
|
|
20
|
+
type Workflow,
|
|
21
|
+
type WorkflowDefinitionParser,
|
|
22
|
+
type WorkflowFull,
|
|
23
|
+
type WorkflowStub,
|
|
24
|
+
} from "./workflow";
|
|
25
|
+
|
|
26
|
+
export {
|
|
27
|
+
workflowVersionFullSchema,
|
|
28
|
+
workflowVersionSchema,
|
|
29
|
+
workflowVersionStubSchema,
|
|
30
|
+
type WorkflowVersion,
|
|
31
|
+
type WorkflowVersionFull,
|
|
32
|
+
type WorkflowVersionStub,
|
|
33
|
+
} from "./workflow-version";
|
|
34
|
+
|
|
35
|
+
export {
|
|
36
|
+
resolveRunDurationMs,
|
|
37
|
+
workflowRunFullSchema,
|
|
38
|
+
workflowRunSchema,
|
|
39
|
+
workflowRunStubSchema,
|
|
40
|
+
type WorkflowRun,
|
|
41
|
+
type WorkflowRunFull,
|
|
42
|
+
type WorkflowRunStub,
|
|
43
|
+
} from "./workflow-run";
|
|
44
|
+
|
|
45
|
+
export {
|
|
46
|
+
memoryDefinitionFullSchema,
|
|
47
|
+
memoryDefinitionSchema,
|
|
48
|
+
memoryDefinitionStubSchema,
|
|
49
|
+
type MemoryDefinition,
|
|
50
|
+
type MemoryDefinitionFull,
|
|
51
|
+
type MemoryDefinitionStub,
|
|
52
|
+
} from "./memory-definition";
|
|
53
|
+
|
|
54
|
+
export {
|
|
55
|
+
memoryRecordFullSchema,
|
|
56
|
+
memoryRecordSchema,
|
|
57
|
+
memoryRecordStubSchema,
|
|
58
|
+
type MemoryRecord,
|
|
59
|
+
type MemoryRecordFull,
|
|
60
|
+
type MemoryRecordStub,
|
|
61
|
+
} from "./memory-record";
|
|
62
|
+
|
|
63
|
+
export {
|
|
64
|
+
mcpServerFullSchema,
|
|
65
|
+
mcpServerSchema,
|
|
66
|
+
mcpServerStubSchema,
|
|
67
|
+
type McpServer,
|
|
68
|
+
type McpServerFull,
|
|
69
|
+
type McpServerStub,
|
|
70
|
+
} from "./mcp-server";
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Hexabot — Fair Core License (FCL-1.0-ALv2)
|
|
3
|
+
* Copyright (c) 2026 Hexastack.
|
|
4
|
+
* Full terms: see LICENSE.md.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
|
|
9
|
+
import { asId, withAliases } from "../shared/aliases";
|
|
10
|
+
import { baseStubSchema } from "../shared/base";
|
|
11
|
+
import { preprocess } from "../shared/preprocess";
|
|
12
|
+
import { credentialSchema } from "../user/credential";
|
|
13
|
+
|
|
14
|
+
import { mcpServerTransportSchema } from "./domain";
|
|
15
|
+
|
|
16
|
+
const mcpServerAliasMap = {
|
|
17
|
+
credentialId: "credential",
|
|
18
|
+
} as const;
|
|
19
|
+
const mcpServerStubObjectSchema = baseStubSchema.extend({
|
|
20
|
+
name: z.string(),
|
|
21
|
+
enabled: z.coerce.boolean(),
|
|
22
|
+
transport: mcpServerTransportSchema,
|
|
23
|
+
url: preprocess(
|
|
24
|
+
(value) => (value == null ? null : value),
|
|
25
|
+
z.string().nullable(),
|
|
26
|
+
),
|
|
27
|
+
command: preprocess(
|
|
28
|
+
(value) => (value == null ? null : value),
|
|
29
|
+
z.string().nullable(),
|
|
30
|
+
),
|
|
31
|
+
args: preprocess(
|
|
32
|
+
(value) => (value == null ? null : value),
|
|
33
|
+
z.array(z.string()).nullable(),
|
|
34
|
+
),
|
|
35
|
+
cwd: preprocess(
|
|
36
|
+
(value) => (value == null ? null : value),
|
|
37
|
+
z.string().nullable(),
|
|
38
|
+
),
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export const mcpServerStubSchema = mcpServerStubObjectSchema;
|
|
42
|
+
|
|
43
|
+
export const mcpServerSchema = preprocess(
|
|
44
|
+
(value) => withAliases(value, mcpServerAliasMap),
|
|
45
|
+
mcpServerStubObjectSchema.extend({
|
|
46
|
+
credential: preprocess(
|
|
47
|
+
(value) => (value == null ? null : asId(value)),
|
|
48
|
+
z.string().nullable(),
|
|
49
|
+
),
|
|
50
|
+
}),
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
export const mcpServerFullSchema = mcpServerStubObjectSchema.extend({
|
|
54
|
+
credential: preprocess(
|
|
55
|
+
(value) => (value == null ? null : credentialSchema.parse(value)),
|
|
56
|
+
credentialSchema.nullable(),
|
|
57
|
+
).optional(),
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
export type McpServerStub = z.infer<typeof mcpServerStubSchema>;
|
|
61
|
+
|
|
62
|
+
export type McpServer = z.infer<typeof mcpServerSchema>;
|
|
63
|
+
|
|
64
|
+
export type McpServerFull = z.infer<typeof mcpServerFullSchema>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Hexabot — Fair Core License (FCL-1.0-ALv2)
|
|
3
|
+
* Copyright (c) 2026 Hexastack.
|
|
4
|
+
* Full terms: see LICENSE.md.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
|
|
9
|
+
import { baseStubSchema } from "../shared/base";
|
|
10
|
+
|
|
11
|
+
import { memoryScopeSchema } from "./domain";
|
|
12
|
+
|
|
13
|
+
const memoryDefinitionObjectSchema = baseStubSchema.extend({
|
|
14
|
+
name: z.string(),
|
|
15
|
+
slug: z.string(),
|
|
16
|
+
scope: memoryScopeSchema,
|
|
17
|
+
schema: z.any(),
|
|
18
|
+
ttlSeconds: z.coerce.number().nullable().optional(),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export const memoryDefinitionStubSchema = memoryDefinitionObjectSchema;
|
|
22
|
+
|
|
23
|
+
export const memoryDefinitionSchema = memoryDefinitionObjectSchema;
|
|
24
|
+
|
|
25
|
+
export const memoryDefinitionFullSchema = memoryDefinitionObjectSchema;
|
|
26
|
+
|
|
27
|
+
export type MemoryDefinitionStub = z.infer<typeof memoryDefinitionStubSchema>;
|
|
28
|
+
|
|
29
|
+
export type MemoryDefinition = z.infer<typeof memoryDefinitionSchema>;
|
|
30
|
+
|
|
31
|
+
export type MemoryDefinitionFull = z.infer<typeof memoryDefinitionFullSchema>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Hexabot — Fair Core License (FCL-1.0-ALv2)
|
|
3
|
+
* Copyright (c) 2026 Hexastack.
|
|
4
|
+
* Full terms: see LICENSE.md.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
|
|
9
|
+
import { threadSchema } from "../chat/thread";
|
|
10
|
+
import { asId, withAliases } from "../shared/aliases";
|
|
11
|
+
import { baseStubSchema } from "../shared/base";
|
|
12
|
+
import { preprocess } from "../shared/preprocess";
|
|
13
|
+
|
|
14
|
+
import { parseUserOrSubscriber, userOrSubscriberSchema } from "./helpers";
|
|
15
|
+
import { memoryDefinitionSchema } from "./memory-definition";
|
|
16
|
+
import { workflowSchema } from "./workflow";
|
|
17
|
+
import { workflowRunSchema } from "./workflow-run";
|
|
18
|
+
const memoryRecordAliasMap = {
|
|
19
|
+
definitionId: "definition",
|
|
20
|
+
ownerId: "owner",
|
|
21
|
+
workflowId: "workflow",
|
|
22
|
+
runId: "run",
|
|
23
|
+
threadId: "thread",
|
|
24
|
+
} as const;
|
|
25
|
+
const memoryRecordStubObjectSchema = baseStubSchema.extend({
|
|
26
|
+
value: z.record(z.string(), z.unknown()),
|
|
27
|
+
ttlSeconds: z.coerce.number().nullable().optional(),
|
|
28
|
+
expiresAt: z.coerce.date().nullable().optional(),
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export const memoryRecordStubSchema = memoryRecordStubObjectSchema;
|
|
32
|
+
|
|
33
|
+
export const memoryRecordSchema = preprocess(
|
|
34
|
+
(value) => withAliases(value, memoryRecordAliasMap),
|
|
35
|
+
memoryRecordStubObjectSchema.extend({
|
|
36
|
+
definition: preprocess(
|
|
37
|
+
(value) => (value == null ? null : asId(value)),
|
|
38
|
+
z.string(),
|
|
39
|
+
),
|
|
40
|
+
owner: preprocess(
|
|
41
|
+
(value) => (value == null ? null : asId(value)),
|
|
42
|
+
z.string(),
|
|
43
|
+
),
|
|
44
|
+
workflow: preprocess(
|
|
45
|
+
(value) => (value == null ? undefined : asId(value)),
|
|
46
|
+
z.string().optional(),
|
|
47
|
+
).optional(),
|
|
48
|
+
run: preprocess(
|
|
49
|
+
(value) => (value == null ? undefined : asId(value)),
|
|
50
|
+
z.string().optional(),
|
|
51
|
+
).optional(),
|
|
52
|
+
thread: preprocess(
|
|
53
|
+
(value) => (value == null ? undefined : asId(value)),
|
|
54
|
+
z.string().optional(),
|
|
55
|
+
).optional(),
|
|
56
|
+
}),
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
export const memoryRecordFullSchema = memoryRecordStubObjectSchema.extend({
|
|
60
|
+
definition: memoryDefinitionSchema,
|
|
61
|
+
owner: preprocess(parseUserOrSubscriber, userOrSubscriberSchema),
|
|
62
|
+
workflow: workflowSchema.nullable().optional(),
|
|
63
|
+
run: workflowRunSchema.nullable().optional(),
|
|
64
|
+
thread: threadSchema.nullable().optional(),
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
export type MemoryRecordStub = z.infer<typeof memoryRecordStubSchema>;
|
|
68
|
+
|
|
69
|
+
export type MemoryRecord = z.infer<typeof memoryRecordSchema>;
|
|
70
|
+
|
|
71
|
+
export type MemoryRecordFull = z.infer<typeof memoryRecordFullSchema>;
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Hexabot — Fair Core License (FCL-1.0-ALv2)
|
|
3
|
+
* Copyright (c) 2026 Hexastack.
|
|
4
|
+
* Full terms: see LICENSE.md.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
|
|
9
|
+
import { threadSchema } from "../chat/thread";
|
|
10
|
+
import { asId, withAliases } from "../shared/aliases";
|
|
11
|
+
import { baseStubSchema } from "../shared/base";
|
|
12
|
+
import { cloneWithPrototype, toRecord } from "../shared/object";
|
|
13
|
+
import { preprocess } from "../shared/preprocess";
|
|
14
|
+
|
|
15
|
+
import {
|
|
16
|
+
nullishToNull,
|
|
17
|
+
parseUserOrSubscriber,
|
|
18
|
+
userOrSubscriberSchema,
|
|
19
|
+
} from "./helpers";
|
|
20
|
+
import { workflowSchema } from "./workflow";
|
|
21
|
+
import { workflowVersionSchema } from "./workflow-version";
|
|
22
|
+
|
|
23
|
+
const workflowRunStatusSchema = z.enum([
|
|
24
|
+
"idle",
|
|
25
|
+
"running",
|
|
26
|
+
"suspended",
|
|
27
|
+
"finished",
|
|
28
|
+
"failed",
|
|
29
|
+
]);
|
|
30
|
+
const resolveTimestampMs = (value?: Date | string | null): number | null => {
|
|
31
|
+
if (!value) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const date = value instanceof Date ? value : new Date(value);
|
|
36
|
+
const timestamp = date.getTime();
|
|
37
|
+
|
|
38
|
+
return Number.isNaN(timestamp) ? null : timestamp;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const resolveRunDurationMs = (run: {
|
|
42
|
+
createdAt?: Date | string | null;
|
|
43
|
+
finishedAt?: Date | string | null;
|
|
44
|
+
failedAt?: Date | string | null;
|
|
45
|
+
suspendedAt?: Date | string | null;
|
|
46
|
+
status?: z.infer<typeof workflowRunStatusSchema> | null;
|
|
47
|
+
}): number | null => {
|
|
48
|
+
const createdAtMs = resolveTimestampMs(run.createdAt);
|
|
49
|
+
if (createdAtMs == null) {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const endAtMs =
|
|
54
|
+
resolveTimestampMs(run.finishedAt) ??
|
|
55
|
+
resolveTimestampMs(run.failedAt) ??
|
|
56
|
+
resolveTimestampMs(run.suspendedAt) ??
|
|
57
|
+
(run.status === "running" ? Date.now() : null);
|
|
58
|
+
|
|
59
|
+
if (endAtMs == null) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return Math.max(0, endAtMs - createdAtMs);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const workflowRunAliasMap = {
|
|
67
|
+
workflowId: "workflow",
|
|
68
|
+
workflowVersionId: "workflowVersion",
|
|
69
|
+
triggeredById: "triggeredBy",
|
|
70
|
+
threadId: "thread",
|
|
71
|
+
} as const;
|
|
72
|
+
const workflowRunStubObjectSchema = baseStubSchema.extend({
|
|
73
|
+
status: workflowRunStatusSchema,
|
|
74
|
+
input: preprocess(nullishToNull, z.record(z.string(), z.any()).nullable()),
|
|
75
|
+
output: preprocess(nullishToNull, z.record(z.string(), z.any()).nullable()),
|
|
76
|
+
context: preprocess(
|
|
77
|
+
(value) => (value == null ? {} : value),
|
|
78
|
+
z.record(z.string(), z.any()),
|
|
79
|
+
),
|
|
80
|
+
snapshot: preprocess(nullishToNull, z.any().nullable()),
|
|
81
|
+
stepLog: preprocess(nullishToNull, z.record(z.string(), z.any()).nullable()),
|
|
82
|
+
suspendedStep: preprocess(nullishToNull, z.string().nullable()),
|
|
83
|
+
suspensionReason: preprocess(nullishToNull, z.string().nullable()),
|
|
84
|
+
suspensionData: preprocess(nullishToNull, z.unknown().nullable()),
|
|
85
|
+
suspensionStepExecId: preprocess(nullishToNull, z.string().nullable()),
|
|
86
|
+
suspensionIndex: preprocess(nullishToNull, z.coerce.number().nullable()),
|
|
87
|
+
suspensionKey: preprocess(nullishToNull, z.string().nullable()),
|
|
88
|
+
suspensionAwaitResults: preprocess(
|
|
89
|
+
nullishToNull,
|
|
90
|
+
z.record(z.string(), z.any()).nullable(),
|
|
91
|
+
),
|
|
92
|
+
lastResumeData: preprocess(nullishToNull, z.unknown().nullable()),
|
|
93
|
+
error: preprocess(nullishToNull, z.string().nullable()),
|
|
94
|
+
suspendedAt: preprocess(nullishToNull, z.coerce.date().nullable()),
|
|
95
|
+
finishedAt: preprocess(nullishToNull, z.coerce.date().nullable()),
|
|
96
|
+
failedAt: preprocess(nullishToNull, z.coerce.date().nullable()),
|
|
97
|
+
duration: preprocess(nullishToNull, z.coerce.number().nullable()),
|
|
98
|
+
metadata: preprocess(nullishToNull, z.record(z.string(), z.any()).nullable()),
|
|
99
|
+
});
|
|
100
|
+
const withWorkflowRunDuration = (value: unknown): unknown => {
|
|
101
|
+
const record = toRecord(value);
|
|
102
|
+
if (!record) {
|
|
103
|
+
return value;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const next = cloneWithPrototype(record);
|
|
107
|
+
next.duration = resolveRunDurationMs(next as never);
|
|
108
|
+
|
|
109
|
+
return next;
|
|
110
|
+
};
|
|
111
|
+
const nullableUserOrSubscriberSchema = preprocess(
|
|
112
|
+
(value) => (value == null ? null : parseUserOrSubscriber(value)),
|
|
113
|
+
userOrSubscriberSchema.nullable(),
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
export const workflowRunStubSchema = preprocess(
|
|
117
|
+
withWorkflowRunDuration,
|
|
118
|
+
workflowRunStubObjectSchema,
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
export const workflowRunSchema = preprocess(
|
|
122
|
+
(value) => withAliases(withWorkflowRunDuration(value), workflowRunAliasMap),
|
|
123
|
+
workflowRunStubObjectSchema.extend({
|
|
124
|
+
workflow: preprocess(
|
|
125
|
+
(value) => (value == null ? null : asId(value)),
|
|
126
|
+
z.string(),
|
|
127
|
+
),
|
|
128
|
+
workflowVersion: preprocess(
|
|
129
|
+
(value) => (value == null ? null : asId(value)),
|
|
130
|
+
z.string().nullable(),
|
|
131
|
+
),
|
|
132
|
+
triggeredBy: preprocess(
|
|
133
|
+
(value) => (value == null ? null : asId(value)),
|
|
134
|
+
z.string().nullable(),
|
|
135
|
+
),
|
|
136
|
+
}),
|
|
137
|
+
);
|
|
138
|
+
|
|
139
|
+
export const workflowRunFullSchema = preprocess(
|
|
140
|
+
(value) => withWorkflowRunDuration(value),
|
|
141
|
+
workflowRunStubObjectSchema.extend({
|
|
142
|
+
workflow: workflowSchema,
|
|
143
|
+
workflowVersion: z
|
|
144
|
+
.lazy(() => workflowVersionSchema)
|
|
145
|
+
.nullable()
|
|
146
|
+
.optional(),
|
|
147
|
+
triggeredBy: nullableUserOrSubscriberSchema,
|
|
148
|
+
thread: threadSchema.nullable().optional(),
|
|
149
|
+
}),
|
|
150
|
+
);
|
|
151
|
+
|
|
152
|
+
export type WorkflowRunStub = z.infer<typeof workflowRunStubSchema>;
|
|
153
|
+
|
|
154
|
+
export type WorkflowRun = z.infer<typeof workflowRunSchema>;
|
|
155
|
+
|
|
156
|
+
export type WorkflowRunFull = z.infer<typeof workflowRunFullSchema>;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Hexabot — Fair Core License (FCL-1.0-ALv2)
|
|
3
|
+
* Copyright (c) 2026 Hexastack.
|
|
4
|
+
* Full terms: see LICENSE.md.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
|
|
9
|
+
import { asId, withAliases } from "../shared/aliases";
|
|
10
|
+
import { baseStubSchema } from "../shared/base";
|
|
11
|
+
import { preprocess } from "../shared/preprocess";
|
|
12
|
+
import { userSchema } from "../user/user";
|
|
13
|
+
|
|
14
|
+
import { workflowVersionActionSchema } from "./domain";
|
|
15
|
+
import { nullishToNull } from "./helpers";
|
|
16
|
+
import { workflowSchema } from "./workflow";
|
|
17
|
+
const workflowVersionAliasMap = {
|
|
18
|
+
parentVersionId: "parentVersion",
|
|
19
|
+
workflowId: "workflow",
|
|
20
|
+
createdById: "createdBy",
|
|
21
|
+
} as const;
|
|
22
|
+
const workflowVersionStubObjectSchema = baseStubSchema.extend({
|
|
23
|
+
version: z.coerce.number(),
|
|
24
|
+
definitionYml: z.string(),
|
|
25
|
+
checksum: z.string(),
|
|
26
|
+
message: preprocess(nullishToNull, z.string().nullable()),
|
|
27
|
+
action: preprocess(nullishToNull, workflowVersionActionSchema.nullable()),
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export const workflowVersionStubSchema = workflowVersionStubObjectSchema;
|
|
31
|
+
|
|
32
|
+
export const workflowVersionSchema = preprocess(
|
|
33
|
+
(value) => withAliases(value, workflowVersionAliasMap),
|
|
34
|
+
workflowVersionStubObjectSchema.extend({
|
|
35
|
+
parentVersion: preprocess(
|
|
36
|
+
(value) => (value == null ? null : asId(value)),
|
|
37
|
+
z.string().nullable(),
|
|
38
|
+
),
|
|
39
|
+
workflow: preprocess(
|
|
40
|
+
(value) => (value == null ? null : asId(value)),
|
|
41
|
+
z.string(),
|
|
42
|
+
),
|
|
43
|
+
createdBy: preprocess(
|
|
44
|
+
(value) => (value == null ? null : asId(value)),
|
|
45
|
+
z.string().nullable(),
|
|
46
|
+
),
|
|
47
|
+
}),
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
export const workflowVersionFullSchema = workflowVersionStubObjectSchema.extend(
|
|
51
|
+
{
|
|
52
|
+
parentVersion: preprocess(
|
|
53
|
+
nullishToNull,
|
|
54
|
+
z.lazy(() => workflowVersionSchema).nullable(),
|
|
55
|
+
),
|
|
56
|
+
workflow: z.lazy(() => workflowSchema),
|
|
57
|
+
createdBy: preprocess(
|
|
58
|
+
(value) => (value == null ? null : value),
|
|
59
|
+
z.lazy(() => userSchema).nullable(),
|
|
60
|
+
),
|
|
61
|
+
},
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
export type WorkflowVersionStub = z.infer<typeof workflowVersionStubSchema>;
|
|
65
|
+
|
|
66
|
+
export type WorkflowVersion = z.infer<typeof workflowVersionSchema>;
|
|
67
|
+
|
|
68
|
+
export type WorkflowVersionFull = z.infer<typeof workflowVersionFullSchema>;
|