@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,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Hexabot — Fair Core License (FCL-1.0-ALv2)
|
|
4
|
+
* Copyright (c) 2026 Hexastack.
|
|
5
|
+
* Full terms: see LICENSE.md.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.permissionFullSchema = exports.permissionSchema = exports.permissionStubSchema = void 0;
|
|
9
|
+
const zod_1 = require("zod");
|
|
10
|
+
const aliases_1 = require("../shared/aliases");
|
|
11
|
+
const base_1 = require("../shared/base");
|
|
12
|
+
const preprocess_1 = require("../shared/preprocess");
|
|
13
|
+
const domain_1 = require("./domain");
|
|
14
|
+
const model_1 = require("./model");
|
|
15
|
+
const role_1 = require("./role");
|
|
16
|
+
const permissionAliasMap = {
|
|
17
|
+
modelId: "model",
|
|
18
|
+
roleId: "role",
|
|
19
|
+
};
|
|
20
|
+
const permissionStubObjectSchema = base_1.baseStubSchema.extend({
|
|
21
|
+
action: zod_1.z.enum(domain_1.Action),
|
|
22
|
+
relation: domain_1.relationSchema,
|
|
23
|
+
});
|
|
24
|
+
exports.permissionStubSchema = permissionStubObjectSchema;
|
|
25
|
+
exports.permissionSchema = (0, preprocess_1.preprocess)((value) => (0, aliases_1.withAliases)(value, permissionAliasMap), permissionStubObjectSchema.extend({
|
|
26
|
+
model: (0, preprocess_1.preprocess)((value) => (value == null ? null : (0, aliases_1.asId)(value)), zod_1.z.string()),
|
|
27
|
+
role: (0, preprocess_1.preprocess)((value) => (value == null ? null : (0, aliases_1.asId)(value)), zod_1.z.string()),
|
|
28
|
+
}));
|
|
29
|
+
exports.permissionFullSchema = permissionStubObjectSchema.extend({
|
|
30
|
+
model: zod_1.z.lazy(() => model_1.modelSchema),
|
|
31
|
+
role: zod_1.z.lazy(() => role_1.roleSchema),
|
|
32
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Hexabot — Fair Core License (FCL-1.0-ALv2)
|
|
4
|
+
* Copyright (c) 2026 Hexastack.
|
|
5
|
+
* Full terms: see LICENSE.md.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.roleFullSchema = exports.roleSchema = exports.roleStubSchema = void 0;
|
|
9
|
+
const zod_1 = require("zod");
|
|
10
|
+
const base_1 = require("../shared/base");
|
|
11
|
+
const preprocess_1 = require("../shared/preprocess");
|
|
12
|
+
const permission_1 = require("./permission");
|
|
13
|
+
const user_1 = require("./user");
|
|
14
|
+
const roleBaseSchema = base_1.baseStubSchema.extend({
|
|
15
|
+
name: zod_1.z.string(),
|
|
16
|
+
active: zod_1.z.coerce.boolean(),
|
|
17
|
+
});
|
|
18
|
+
const roleFullObjectSchema = zod_1.z.object({
|
|
19
|
+
permissions: (0, preprocess_1.preprocess)((value) => (Array.isArray(value) ? value : []), zod_1.z.array(zod_1.z.lazy(() => permission_1.permissionSchema))).optional(),
|
|
20
|
+
users: (0, preprocess_1.preprocess)((value) => (Array.isArray(value) ? value : []), zod_1.z.array(zod_1.z.lazy(() => user_1.userSchema))),
|
|
21
|
+
});
|
|
22
|
+
exports.roleStubSchema = roleBaseSchema;
|
|
23
|
+
exports.roleSchema = roleBaseSchema;
|
|
24
|
+
exports.roleFullSchema = zod_1.z.intersection(roleBaseSchema, roleFullObjectSchema);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Hexabot — Fair Core License (FCL-1.0-ALv2)
|
|
4
|
+
* Copyright (c) 2026 Hexastack.
|
|
5
|
+
* Full terms: see LICENSE.md.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.userProfileAssignedFullSchema = exports.userProfileAssignedSchema = exports.userProfileAssignedStubSchema = exports.userProviderSchema = void 0;
|
|
9
|
+
const zod_1 = require("zod");
|
|
10
|
+
const aliases_1 = require("../shared/aliases");
|
|
11
|
+
const preprocess_1 = require("../shared/preprocess");
|
|
12
|
+
const profile_1 = require("../shared/profile");
|
|
13
|
+
const userProfileAssignedAliasMap = {
|
|
14
|
+
labelIds: "labels",
|
|
15
|
+
assignedToId: "assignedTo",
|
|
16
|
+
roleIds: "roles",
|
|
17
|
+
avatarId: "avatar",
|
|
18
|
+
};
|
|
19
|
+
exports.userProviderSchema = zod_1.z.object({
|
|
20
|
+
strategy: zod_1.z.literal("local"),
|
|
21
|
+
sub: zod_1.z.string().optional(),
|
|
22
|
+
});
|
|
23
|
+
const userProfileAssignedObjectSchema = profile_1.subscriberBaseSchema.extend({
|
|
24
|
+
labels: (0, preprocess_1.preprocess)((value) => (Array.isArray(value) ? (0, aliases_1.asIdArray)(value) : []), zod_1.z.array(zod_1.z.string())),
|
|
25
|
+
assignedTo: (0, preprocess_1.preprocess)((value) => (value == null ? null : (0, aliases_1.asId)(value)), zod_1.z.string().nullable()),
|
|
26
|
+
username: zod_1.z.string(),
|
|
27
|
+
email: zod_1.z.string(),
|
|
28
|
+
sendEmail: zod_1.z.coerce.boolean(),
|
|
29
|
+
state: zod_1.z.coerce.boolean(),
|
|
30
|
+
resetCount: zod_1.z.coerce.number(),
|
|
31
|
+
resetToken: profile_1.nullableStringSchema,
|
|
32
|
+
provider: exports.userProviderSchema.optional(),
|
|
33
|
+
roles: (0, preprocess_1.preprocess)((value) => (Array.isArray(value) ? (0, aliases_1.asIdArray)(value) : []), zod_1.z.array(zod_1.z.string())),
|
|
34
|
+
avatar: (0, preprocess_1.preprocess)((value) => (value == null ? null : (0, aliases_1.asId)(value)), zod_1.z.string().nullable()),
|
|
35
|
+
});
|
|
36
|
+
exports.userProfileAssignedStubSchema = userProfileAssignedObjectSchema;
|
|
37
|
+
exports.userProfileAssignedSchema = (0, preprocess_1.preprocess)((value) => (0, aliases_1.withAliases)(value, userProfileAssignedAliasMap), userProfileAssignedObjectSchema);
|
|
38
|
+
exports.userProfileAssignedFullSchema = exports.userProfileAssignedSchema;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Hexabot — Fair Core License (FCL-1.0-ALv2)
|
|
4
|
+
* Copyright (c) 2026 Hexastack.
|
|
5
|
+
* Full terms: see LICENSE.md.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.userProfileFullSchema = exports.userProfileSchema = exports.userProfileStubSchema = void 0;
|
|
9
|
+
const profile_1 = require("../shared/profile");
|
|
10
|
+
exports.userProfileStubSchema = profile_1.userProfileBaseSchema;
|
|
11
|
+
exports.userProfileSchema = profile_1.userProfileBaseSchema;
|
|
12
|
+
exports.userProfileFullSchema = profile_1.userProfileBaseSchema;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Hexabot — Fair Core License (FCL-1.0-ALv2)
|
|
4
|
+
* Copyright (c) 2026 Hexastack.
|
|
5
|
+
* Full terms: see LICENSE.md.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.userFullSchema = exports.userSchema = exports.userStubSchema = void 0;
|
|
9
|
+
const zod_1 = require("zod");
|
|
10
|
+
const attachment_1 = require("../attachment/attachment");
|
|
11
|
+
const label_1 = require("../chat/label");
|
|
12
|
+
const aliases_1 = require("../shared/aliases");
|
|
13
|
+
const preprocess_1 = require("../shared/preprocess");
|
|
14
|
+
const profile_1 = require("../shared/profile");
|
|
15
|
+
const role_1 = require("./role");
|
|
16
|
+
const user_profile_assigned_1 = require("./user-profile-assigned");
|
|
17
|
+
const userAliasMap = {
|
|
18
|
+
labelIds: "labels",
|
|
19
|
+
assignedToId: "assignedTo",
|
|
20
|
+
roleIds: "roles",
|
|
21
|
+
avatarId: "avatar",
|
|
22
|
+
};
|
|
23
|
+
const userStubObjectSchema = profile_1.subscriberBaseSchema.extend({
|
|
24
|
+
username: zod_1.z.string(),
|
|
25
|
+
email: zod_1.z.string(),
|
|
26
|
+
sendEmail: zod_1.z.coerce.boolean(),
|
|
27
|
+
state: zod_1.z.coerce.boolean(),
|
|
28
|
+
resetCount: zod_1.z.coerce.number(),
|
|
29
|
+
resetToken: (0, preprocess_1.preprocess)((value) => (value == null ? null : value), zod_1.z.string().nullable()),
|
|
30
|
+
provider: user_profile_assigned_1.userProviderSchema.optional(),
|
|
31
|
+
});
|
|
32
|
+
exports.userStubSchema = userStubObjectSchema;
|
|
33
|
+
exports.userSchema = (0, preprocess_1.preprocess)((value) => (0, aliases_1.withAliases)(value, userAliasMap), userStubObjectSchema.extend({
|
|
34
|
+
labels: (0, preprocess_1.preprocess)((value) => (Array.isArray(value) ? (0, aliases_1.asIdArray)(value) : []), zod_1.z.array(zod_1.z.string())),
|
|
35
|
+
assignedTo: (0, preprocess_1.preprocess)((value) => (value == null ? null : (0, aliases_1.asId)(value)), zod_1.z.string().nullable()),
|
|
36
|
+
roles: (0, preprocess_1.preprocess)((value) => (Array.isArray(value) ? (0, aliases_1.asIdArray)(value) : []), zod_1.z.array(zod_1.z.string())),
|
|
37
|
+
avatar: (0, preprocess_1.preprocess)((value) => (value == null ? null : (0, aliases_1.asId)(value)), zod_1.z.string().nullable()),
|
|
38
|
+
}));
|
|
39
|
+
exports.userFullSchema = userStubObjectSchema.extend({
|
|
40
|
+
labels: (0, preprocess_1.preprocess)((value) => (Array.isArray(value) ? value : []), zod_1.z.array(zod_1.z.lazy(() => label_1.labelSchema))),
|
|
41
|
+
assignedTo: (0, preprocess_1.preprocess)((value) => (value == null ? null : value), user_profile_assigned_1.userProfileAssignedSchema.nullable()),
|
|
42
|
+
roles: (0, preprocess_1.preprocess)((value) => (Array.isArray(value) ? value : []), zod_1.z.array(zod_1.z.lazy(() => role_1.roleSchema))),
|
|
43
|
+
avatar: (0, preprocess_1.preprocess)((value) => (value == null ? null : value), attachment_1.attachmentSchema.nullable()),
|
|
44
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Hexabot — Fair Core License (FCL-1.0-ALv2)
|
|
4
|
+
* Copyright (c) 2026 Hexastack.
|
|
5
|
+
* Full terms: see LICENSE.md.
|
|
6
|
+
*/
|
|
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;
|
|
9
|
+
const zod_1 = require("zod");
|
|
10
|
+
var WorkflowType;
|
|
11
|
+
(function (WorkflowType) {
|
|
12
|
+
WorkflowType["conversational"] = "conversational";
|
|
13
|
+
WorkflowType["manual"] = "manual";
|
|
14
|
+
WorkflowType["scheduled"] = "scheduled";
|
|
15
|
+
})(WorkflowType || (exports.WorkflowType = WorkflowType = {}));
|
|
16
|
+
var WorkflowVersionAction;
|
|
17
|
+
(function (WorkflowVersionAction) {
|
|
18
|
+
WorkflowVersionAction["create"] = "create";
|
|
19
|
+
WorkflowVersionAction["update"] = "update";
|
|
20
|
+
WorkflowVersionAction["restore"] = "restore";
|
|
21
|
+
WorkflowVersionAction["import"] = "import";
|
|
22
|
+
})(WorkflowVersionAction || (exports.WorkflowVersionAction = WorkflowVersionAction = {}));
|
|
23
|
+
var MemoryScope;
|
|
24
|
+
(function (MemoryScope) {
|
|
25
|
+
MemoryScope["global"] = "global";
|
|
26
|
+
MemoryScope["workflow"] = "workflow";
|
|
27
|
+
MemoryScope["thread"] = "thread";
|
|
28
|
+
MemoryScope["run"] = "run";
|
|
29
|
+
})(MemoryScope || (exports.MemoryScope = MemoryScope = {}));
|
|
30
|
+
var McpServerTransport;
|
|
31
|
+
(function (McpServerTransport) {
|
|
32
|
+
McpServerTransport["http"] = "http";
|
|
33
|
+
McpServerTransport["stdio"] = "stdio";
|
|
34
|
+
})(McpServerTransport || (exports.McpServerTransport = McpServerTransport = {}));
|
|
35
|
+
var DirectionType;
|
|
36
|
+
(function (DirectionType) {
|
|
37
|
+
DirectionType["HORIZONTAL"] = "horizontal";
|
|
38
|
+
DirectionType["VERTICAL"] = "vertical";
|
|
39
|
+
})(DirectionType || (exports.DirectionType = DirectionType = {}));
|
|
40
|
+
exports.workflowTypeSchema = zod_1.z.enum(WorkflowType);
|
|
41
|
+
exports.workflowVersionActionSchema = zod_1.z.enum(WorkflowVersionAction);
|
|
42
|
+
exports.memoryScopeSchema = zod_1.z.enum(MemoryScope);
|
|
43
|
+
exports.mcpServerTransportSchema = zod_1.z.enum(McpServerTransport);
|
|
44
|
+
exports.directionTypeSchema = zod_1.z.enum(DirectionType);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Hexabot — Fair Core License (FCL-1.0-ALv2)
|
|
4
|
+
* Copyright (c) 2026 Hexastack.
|
|
5
|
+
* Full terms: see LICENSE.md.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.parseUserOrSubscriber = exports.userOrSubscriberSchema = exports.nullishToNull = void 0;
|
|
9
|
+
const zod_1 = require("zod");
|
|
10
|
+
const subscriber_1 = require("../chat/subscriber");
|
|
11
|
+
const object_1 = require("../shared/object");
|
|
12
|
+
const user_1 = require("../user/user");
|
|
13
|
+
const nullishToNull = (value) => {
|
|
14
|
+
return value == null ? null : value;
|
|
15
|
+
};
|
|
16
|
+
exports.nullishToNull = nullishToNull;
|
|
17
|
+
exports.userOrSubscriberSchema = zod_1.z.union([
|
|
18
|
+
zod_1.z.lazy(() => user_1.userSchema),
|
|
19
|
+
subscriber_1.subscriberSchema,
|
|
20
|
+
]);
|
|
21
|
+
const parseUserOrSubscriber = (value) => {
|
|
22
|
+
const record = (0, object_1.toRecord)(value);
|
|
23
|
+
if (record?.type === "UserOrmEntity") {
|
|
24
|
+
return user_1.userSchema.parse(value);
|
|
25
|
+
}
|
|
26
|
+
if (record?.type === "SubscriberOrmEntity") {
|
|
27
|
+
return subscriber_1.subscriberSchema.parse(value);
|
|
28
|
+
}
|
|
29
|
+
const parsedUser = user_1.userSchema.safeParse(value);
|
|
30
|
+
if (parsedUser.success) {
|
|
31
|
+
return parsedUser.data;
|
|
32
|
+
}
|
|
33
|
+
return subscriber_1.subscriberSchema.parse(value);
|
|
34
|
+
};
|
|
35
|
+
exports.parseUserOrSubscriber = parseUserOrSubscriber;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Hexabot — Fair Core License (FCL-1.0-ALv2)
|
|
4
|
+
* Copyright (c) 2026 Hexastack.
|
|
5
|
+
* Full terms: see LICENSE.md.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
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;
|
|
9
|
+
var domain_1 = require("./domain");
|
|
10
|
+
Object.defineProperty(exports, "DirectionType", { enumerable: true, get: function () { return domain_1.DirectionType; } });
|
|
11
|
+
Object.defineProperty(exports, "McpServerTransport", { enumerable: true, get: function () { return domain_1.McpServerTransport; } });
|
|
12
|
+
Object.defineProperty(exports, "MemoryScope", { enumerable: true, get: function () { return domain_1.MemoryScope; } });
|
|
13
|
+
Object.defineProperty(exports, "WorkflowType", { enumerable: true, get: function () { return domain_1.WorkflowType; } });
|
|
14
|
+
Object.defineProperty(exports, "WorkflowVersionAction", { enumerable: true, get: function () { return domain_1.WorkflowVersionAction; } });
|
|
15
|
+
var workflow_1 = require("./workflow");
|
|
16
|
+
Object.defineProperty(exports, "createWorkflowFullSchema", { enumerable: true, get: function () { return workflow_1.createWorkflowFullSchema; } });
|
|
17
|
+
Object.defineProperty(exports, "workflowFullSchema", { enumerable: true, get: function () { return workflow_1.workflowFullSchema; } });
|
|
18
|
+
Object.defineProperty(exports, "workflowSchema", { enumerable: true, get: function () { return workflow_1.workflowSchema; } });
|
|
19
|
+
Object.defineProperty(exports, "workflowStubSchema", { enumerable: true, get: function () { return workflow_1.workflowStubSchema; } });
|
|
20
|
+
var workflow_version_1 = require("./workflow-version");
|
|
21
|
+
Object.defineProperty(exports, "workflowVersionFullSchema", { enumerable: true, get: function () { return workflow_version_1.workflowVersionFullSchema; } });
|
|
22
|
+
Object.defineProperty(exports, "workflowVersionSchema", { enumerable: true, get: function () { return workflow_version_1.workflowVersionSchema; } });
|
|
23
|
+
Object.defineProperty(exports, "workflowVersionStubSchema", { enumerable: true, get: function () { return workflow_version_1.workflowVersionStubSchema; } });
|
|
24
|
+
var workflow_run_1 = require("./workflow-run");
|
|
25
|
+
Object.defineProperty(exports, "resolveRunDurationMs", { enumerable: true, get: function () { return workflow_run_1.resolveRunDurationMs; } });
|
|
26
|
+
Object.defineProperty(exports, "workflowRunFullSchema", { enumerable: true, get: function () { return workflow_run_1.workflowRunFullSchema; } });
|
|
27
|
+
Object.defineProperty(exports, "workflowRunSchema", { enumerable: true, get: function () { return workflow_run_1.workflowRunSchema; } });
|
|
28
|
+
Object.defineProperty(exports, "workflowRunStubSchema", { enumerable: true, get: function () { return workflow_run_1.workflowRunStubSchema; } });
|
|
29
|
+
var memory_definition_1 = require("./memory-definition");
|
|
30
|
+
Object.defineProperty(exports, "memoryDefinitionFullSchema", { enumerable: true, get: function () { return memory_definition_1.memoryDefinitionFullSchema; } });
|
|
31
|
+
Object.defineProperty(exports, "memoryDefinitionSchema", { enumerable: true, get: function () { return memory_definition_1.memoryDefinitionSchema; } });
|
|
32
|
+
Object.defineProperty(exports, "memoryDefinitionStubSchema", { enumerable: true, get: function () { return memory_definition_1.memoryDefinitionStubSchema; } });
|
|
33
|
+
var memory_record_1 = require("./memory-record");
|
|
34
|
+
Object.defineProperty(exports, "memoryRecordFullSchema", { enumerable: true, get: function () { return memory_record_1.memoryRecordFullSchema; } });
|
|
35
|
+
Object.defineProperty(exports, "memoryRecordSchema", { enumerable: true, get: function () { return memory_record_1.memoryRecordSchema; } });
|
|
36
|
+
Object.defineProperty(exports, "memoryRecordStubSchema", { enumerable: true, get: function () { return memory_record_1.memoryRecordStubSchema; } });
|
|
37
|
+
var mcp_server_1 = require("./mcp-server");
|
|
38
|
+
Object.defineProperty(exports, "mcpServerFullSchema", { enumerable: true, get: function () { return mcp_server_1.mcpServerFullSchema; } });
|
|
39
|
+
Object.defineProperty(exports, "mcpServerSchema", { enumerable: true, get: function () { return mcp_server_1.mcpServerSchema; } });
|
|
40
|
+
Object.defineProperty(exports, "mcpServerStubSchema", { enumerable: true, get: function () { return mcp_server_1.mcpServerStubSchema; } });
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Hexabot — Fair Core License (FCL-1.0-ALv2)
|
|
4
|
+
* Copyright (c) 2026 Hexastack.
|
|
5
|
+
* Full terms: see LICENSE.md.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.mcpServerFullSchema = exports.mcpServerSchema = exports.mcpServerStubSchema = void 0;
|
|
9
|
+
const zod_1 = require("zod");
|
|
10
|
+
const aliases_1 = require("../shared/aliases");
|
|
11
|
+
const base_1 = require("../shared/base");
|
|
12
|
+
const preprocess_1 = require("../shared/preprocess");
|
|
13
|
+
const credential_1 = require("../user/credential");
|
|
14
|
+
const domain_1 = require("./domain");
|
|
15
|
+
const mcpServerAliasMap = {
|
|
16
|
+
credentialId: "credential",
|
|
17
|
+
};
|
|
18
|
+
const mcpServerStubObjectSchema = base_1.baseStubSchema.extend({
|
|
19
|
+
name: zod_1.z.string(),
|
|
20
|
+
enabled: zod_1.z.coerce.boolean(),
|
|
21
|
+
transport: domain_1.mcpServerTransportSchema,
|
|
22
|
+
url: (0, preprocess_1.preprocess)((value) => (value == null ? null : value), zod_1.z.string().nullable()),
|
|
23
|
+
command: (0, preprocess_1.preprocess)((value) => (value == null ? null : value), zod_1.z.string().nullable()),
|
|
24
|
+
args: (0, preprocess_1.preprocess)((value) => (value == null ? null : value), zod_1.z.array(zod_1.z.string()).nullable()),
|
|
25
|
+
cwd: (0, preprocess_1.preprocess)((value) => (value == null ? null : value), zod_1.z.string().nullable()),
|
|
26
|
+
});
|
|
27
|
+
exports.mcpServerStubSchema = mcpServerStubObjectSchema;
|
|
28
|
+
exports.mcpServerSchema = (0, preprocess_1.preprocess)((value) => (0, aliases_1.withAliases)(value, mcpServerAliasMap), mcpServerStubObjectSchema.extend({
|
|
29
|
+
credential: (0, preprocess_1.preprocess)((value) => (value == null ? null : (0, aliases_1.asId)(value)), zod_1.z.string().nullable()),
|
|
30
|
+
}));
|
|
31
|
+
exports.mcpServerFullSchema = mcpServerStubObjectSchema.extend({
|
|
32
|
+
credential: (0, preprocess_1.preprocess)((value) => (value == null ? null : credential_1.credentialSchema.parse(value)), credential_1.credentialSchema.nullable()).optional(),
|
|
33
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Hexabot — Fair Core License (FCL-1.0-ALv2)
|
|
4
|
+
* Copyright (c) 2026 Hexastack.
|
|
5
|
+
* Full terms: see LICENSE.md.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.memoryDefinitionFullSchema = exports.memoryDefinitionSchema = exports.memoryDefinitionStubSchema = void 0;
|
|
9
|
+
const zod_1 = require("zod");
|
|
10
|
+
const base_1 = require("../shared/base");
|
|
11
|
+
const domain_1 = require("./domain");
|
|
12
|
+
const memoryDefinitionObjectSchema = base_1.baseStubSchema.extend({
|
|
13
|
+
name: zod_1.z.string(),
|
|
14
|
+
slug: zod_1.z.string(),
|
|
15
|
+
scope: domain_1.memoryScopeSchema,
|
|
16
|
+
schema: zod_1.z.any(),
|
|
17
|
+
ttlSeconds: zod_1.z.coerce.number().nullable().optional(),
|
|
18
|
+
});
|
|
19
|
+
exports.memoryDefinitionStubSchema = memoryDefinitionObjectSchema;
|
|
20
|
+
exports.memoryDefinitionSchema = memoryDefinitionObjectSchema;
|
|
21
|
+
exports.memoryDefinitionFullSchema = memoryDefinitionObjectSchema;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Hexabot — Fair Core License (FCL-1.0-ALv2)
|
|
4
|
+
* Copyright (c) 2026 Hexastack.
|
|
5
|
+
* Full terms: see LICENSE.md.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.memoryRecordFullSchema = exports.memoryRecordSchema = exports.memoryRecordStubSchema = void 0;
|
|
9
|
+
const zod_1 = require("zod");
|
|
10
|
+
const thread_1 = require("../chat/thread");
|
|
11
|
+
const aliases_1 = require("../shared/aliases");
|
|
12
|
+
const base_1 = require("../shared/base");
|
|
13
|
+
const preprocess_1 = require("../shared/preprocess");
|
|
14
|
+
const helpers_1 = require("./helpers");
|
|
15
|
+
const memory_definition_1 = require("./memory-definition");
|
|
16
|
+
const workflow_1 = require("./workflow");
|
|
17
|
+
const workflow_run_1 = require("./workflow-run");
|
|
18
|
+
const memoryRecordAliasMap = {
|
|
19
|
+
definitionId: "definition",
|
|
20
|
+
ownerId: "owner",
|
|
21
|
+
workflowId: "workflow",
|
|
22
|
+
runId: "run",
|
|
23
|
+
threadId: "thread",
|
|
24
|
+
};
|
|
25
|
+
const memoryRecordStubObjectSchema = base_1.baseStubSchema.extend({
|
|
26
|
+
value: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()),
|
|
27
|
+
ttlSeconds: zod_1.z.coerce.number().nullable().optional(),
|
|
28
|
+
expiresAt: zod_1.z.coerce.date().nullable().optional(),
|
|
29
|
+
});
|
|
30
|
+
exports.memoryRecordStubSchema = memoryRecordStubObjectSchema;
|
|
31
|
+
exports.memoryRecordSchema = (0, preprocess_1.preprocess)((value) => (0, aliases_1.withAliases)(value, memoryRecordAliasMap), memoryRecordStubObjectSchema.extend({
|
|
32
|
+
definition: (0, preprocess_1.preprocess)((value) => (value == null ? null : (0, aliases_1.asId)(value)), zod_1.z.string()),
|
|
33
|
+
owner: (0, preprocess_1.preprocess)((value) => (value == null ? null : (0, aliases_1.asId)(value)), zod_1.z.string()),
|
|
34
|
+
workflow: (0, preprocess_1.preprocess)((value) => (value == null ? undefined : (0, aliases_1.asId)(value)), zod_1.z.string().optional()).optional(),
|
|
35
|
+
run: (0, preprocess_1.preprocess)((value) => (value == null ? undefined : (0, aliases_1.asId)(value)), zod_1.z.string().optional()).optional(),
|
|
36
|
+
thread: (0, preprocess_1.preprocess)((value) => (value == null ? undefined : (0, aliases_1.asId)(value)), zod_1.z.string().optional()).optional(),
|
|
37
|
+
}));
|
|
38
|
+
exports.memoryRecordFullSchema = memoryRecordStubObjectSchema.extend({
|
|
39
|
+
definition: memory_definition_1.memoryDefinitionSchema,
|
|
40
|
+
owner: (0, preprocess_1.preprocess)(helpers_1.parseUserOrSubscriber, helpers_1.userOrSubscriberSchema),
|
|
41
|
+
workflow: workflow_1.workflowSchema.nullable().optional(),
|
|
42
|
+
run: workflow_run_1.workflowRunSchema.nullable().optional(),
|
|
43
|
+
thread: thread_1.threadSchema.nullable().optional(),
|
|
44
|
+
});
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Hexabot — Fair Core License (FCL-1.0-ALv2)
|
|
4
|
+
* Copyright (c) 2026 Hexastack.
|
|
5
|
+
* Full terms: see LICENSE.md.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.workflowRunFullSchema = exports.workflowRunSchema = exports.workflowRunStubSchema = exports.resolveRunDurationMs = void 0;
|
|
9
|
+
const zod_1 = require("zod");
|
|
10
|
+
const thread_1 = require("../chat/thread");
|
|
11
|
+
const aliases_1 = require("../shared/aliases");
|
|
12
|
+
const base_1 = require("../shared/base");
|
|
13
|
+
const object_1 = require("../shared/object");
|
|
14
|
+
const preprocess_1 = require("../shared/preprocess");
|
|
15
|
+
const helpers_1 = require("./helpers");
|
|
16
|
+
const workflow_1 = require("./workflow");
|
|
17
|
+
const workflow_version_1 = require("./workflow-version");
|
|
18
|
+
const workflowRunStatusSchema = zod_1.z.enum([
|
|
19
|
+
"idle",
|
|
20
|
+
"running",
|
|
21
|
+
"suspended",
|
|
22
|
+
"finished",
|
|
23
|
+
"failed",
|
|
24
|
+
]);
|
|
25
|
+
const resolveTimestampMs = (value) => {
|
|
26
|
+
if (!value) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
const date = value instanceof Date ? value : new Date(value);
|
|
30
|
+
const timestamp = date.getTime();
|
|
31
|
+
return Number.isNaN(timestamp) ? null : timestamp;
|
|
32
|
+
};
|
|
33
|
+
const resolveRunDurationMs = (run) => {
|
|
34
|
+
const createdAtMs = resolveTimestampMs(run.createdAt);
|
|
35
|
+
if (createdAtMs == null) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
const endAtMs = resolveTimestampMs(run.finishedAt) ??
|
|
39
|
+
resolveTimestampMs(run.failedAt) ??
|
|
40
|
+
resolveTimestampMs(run.suspendedAt) ??
|
|
41
|
+
(run.status === "running" ? Date.now() : null);
|
|
42
|
+
if (endAtMs == null) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
return Math.max(0, endAtMs - createdAtMs);
|
|
46
|
+
};
|
|
47
|
+
exports.resolveRunDurationMs = resolveRunDurationMs;
|
|
48
|
+
const workflowRunAliasMap = {
|
|
49
|
+
workflowId: "workflow",
|
|
50
|
+
workflowVersionId: "workflowVersion",
|
|
51
|
+
triggeredById: "triggeredBy",
|
|
52
|
+
threadId: "thread",
|
|
53
|
+
};
|
|
54
|
+
const workflowRunStubObjectSchema = base_1.baseStubSchema.extend({
|
|
55
|
+
status: workflowRunStatusSchema,
|
|
56
|
+
input: (0, preprocess_1.preprocess)(helpers_1.nullishToNull, zod_1.z.record(zod_1.z.string(), zod_1.z.any()).nullable()),
|
|
57
|
+
output: (0, preprocess_1.preprocess)(helpers_1.nullishToNull, zod_1.z.record(zod_1.z.string(), zod_1.z.any()).nullable()),
|
|
58
|
+
context: (0, preprocess_1.preprocess)((value) => (value == null ? {} : value), zod_1.z.record(zod_1.z.string(), zod_1.z.any())),
|
|
59
|
+
snapshot: (0, preprocess_1.preprocess)(helpers_1.nullishToNull, zod_1.z.any().nullable()),
|
|
60
|
+
stepLog: (0, preprocess_1.preprocess)(helpers_1.nullishToNull, zod_1.z.record(zod_1.z.string(), zod_1.z.any()).nullable()),
|
|
61
|
+
suspendedStep: (0, preprocess_1.preprocess)(helpers_1.nullishToNull, zod_1.z.string().nullable()),
|
|
62
|
+
suspensionReason: (0, preprocess_1.preprocess)(helpers_1.nullishToNull, zod_1.z.string().nullable()),
|
|
63
|
+
suspensionData: (0, preprocess_1.preprocess)(helpers_1.nullishToNull, zod_1.z.unknown().nullable()),
|
|
64
|
+
suspensionStepExecId: (0, preprocess_1.preprocess)(helpers_1.nullishToNull, zod_1.z.string().nullable()),
|
|
65
|
+
suspensionIndex: (0, preprocess_1.preprocess)(helpers_1.nullishToNull, zod_1.z.coerce.number().nullable()),
|
|
66
|
+
suspensionKey: (0, preprocess_1.preprocess)(helpers_1.nullishToNull, zod_1.z.string().nullable()),
|
|
67
|
+
suspensionAwaitResults: (0, preprocess_1.preprocess)(helpers_1.nullishToNull, zod_1.z.record(zod_1.z.string(), zod_1.z.any()).nullable()),
|
|
68
|
+
lastResumeData: (0, preprocess_1.preprocess)(helpers_1.nullishToNull, zod_1.z.unknown().nullable()),
|
|
69
|
+
error: (0, preprocess_1.preprocess)(helpers_1.nullishToNull, zod_1.z.string().nullable()),
|
|
70
|
+
suspendedAt: (0, preprocess_1.preprocess)(helpers_1.nullishToNull, zod_1.z.coerce.date().nullable()),
|
|
71
|
+
finishedAt: (0, preprocess_1.preprocess)(helpers_1.nullishToNull, zod_1.z.coerce.date().nullable()),
|
|
72
|
+
failedAt: (0, preprocess_1.preprocess)(helpers_1.nullishToNull, zod_1.z.coerce.date().nullable()),
|
|
73
|
+
duration: (0, preprocess_1.preprocess)(helpers_1.nullishToNull, zod_1.z.coerce.number().nullable()),
|
|
74
|
+
metadata: (0, preprocess_1.preprocess)(helpers_1.nullishToNull, zod_1.z.record(zod_1.z.string(), zod_1.z.any()).nullable()),
|
|
75
|
+
});
|
|
76
|
+
const withWorkflowRunDuration = (value) => {
|
|
77
|
+
const record = (0, object_1.toRecord)(value);
|
|
78
|
+
if (!record) {
|
|
79
|
+
return value;
|
|
80
|
+
}
|
|
81
|
+
const next = (0, object_1.cloneWithPrototype)(record);
|
|
82
|
+
next.duration = (0, exports.resolveRunDurationMs)(next);
|
|
83
|
+
return next;
|
|
84
|
+
};
|
|
85
|
+
const nullableUserOrSubscriberSchema = (0, preprocess_1.preprocess)((value) => (value == null ? null : (0, helpers_1.parseUserOrSubscriber)(value)), helpers_1.userOrSubscriberSchema.nullable());
|
|
86
|
+
exports.workflowRunStubSchema = (0, preprocess_1.preprocess)(withWorkflowRunDuration, workflowRunStubObjectSchema);
|
|
87
|
+
exports.workflowRunSchema = (0, preprocess_1.preprocess)((value) => (0, aliases_1.withAliases)(withWorkflowRunDuration(value), workflowRunAliasMap), workflowRunStubObjectSchema.extend({
|
|
88
|
+
workflow: (0, preprocess_1.preprocess)((value) => (value == null ? null : (0, aliases_1.asId)(value)), zod_1.z.string()),
|
|
89
|
+
workflowVersion: (0, preprocess_1.preprocess)((value) => (value == null ? null : (0, aliases_1.asId)(value)), zod_1.z.string().nullable()),
|
|
90
|
+
triggeredBy: (0, preprocess_1.preprocess)((value) => (value == null ? null : (0, aliases_1.asId)(value)), zod_1.z.string().nullable()),
|
|
91
|
+
}));
|
|
92
|
+
exports.workflowRunFullSchema = (0, preprocess_1.preprocess)((value) => withWorkflowRunDuration(value), workflowRunStubObjectSchema.extend({
|
|
93
|
+
workflow: workflow_1.workflowSchema,
|
|
94
|
+
workflowVersion: zod_1.z
|
|
95
|
+
.lazy(() => workflow_version_1.workflowVersionSchema)
|
|
96
|
+
.nullable()
|
|
97
|
+
.optional(),
|
|
98
|
+
triggeredBy: nullableUserOrSubscriberSchema,
|
|
99
|
+
thread: thread_1.threadSchema.nullable().optional(),
|
|
100
|
+
}));
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Hexabot — Fair Core License (FCL-1.0-ALv2)
|
|
4
|
+
* Copyright (c) 2026 Hexastack.
|
|
5
|
+
* Full terms: see LICENSE.md.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.workflowVersionFullSchema = exports.workflowVersionSchema = exports.workflowVersionStubSchema = void 0;
|
|
9
|
+
const zod_1 = require("zod");
|
|
10
|
+
const aliases_1 = require("../shared/aliases");
|
|
11
|
+
const base_1 = require("../shared/base");
|
|
12
|
+
const preprocess_1 = require("../shared/preprocess");
|
|
13
|
+
const user_1 = require("../user/user");
|
|
14
|
+
const domain_1 = require("./domain");
|
|
15
|
+
const helpers_1 = require("./helpers");
|
|
16
|
+
const workflow_1 = require("./workflow");
|
|
17
|
+
const workflowVersionAliasMap = {
|
|
18
|
+
parentVersionId: "parentVersion",
|
|
19
|
+
workflowId: "workflow",
|
|
20
|
+
createdById: "createdBy",
|
|
21
|
+
};
|
|
22
|
+
const workflowVersionStubObjectSchema = base_1.baseStubSchema.extend({
|
|
23
|
+
version: zod_1.z.coerce.number(),
|
|
24
|
+
definitionYml: zod_1.z.string(),
|
|
25
|
+
checksum: zod_1.z.string(),
|
|
26
|
+
message: (0, preprocess_1.preprocess)(helpers_1.nullishToNull, zod_1.z.string().nullable()),
|
|
27
|
+
action: (0, preprocess_1.preprocess)(helpers_1.nullishToNull, domain_1.workflowVersionActionSchema.nullable()),
|
|
28
|
+
});
|
|
29
|
+
exports.workflowVersionStubSchema = workflowVersionStubObjectSchema;
|
|
30
|
+
exports.workflowVersionSchema = (0, preprocess_1.preprocess)((value) => (0, aliases_1.withAliases)(value, workflowVersionAliasMap), workflowVersionStubObjectSchema.extend({
|
|
31
|
+
parentVersion: (0, preprocess_1.preprocess)((value) => (value == null ? null : (0, aliases_1.asId)(value)), zod_1.z.string().nullable()),
|
|
32
|
+
workflow: (0, preprocess_1.preprocess)((value) => (value == null ? null : (0, aliases_1.asId)(value)), zod_1.z.string()),
|
|
33
|
+
createdBy: (0, preprocess_1.preprocess)((value) => (value == null ? null : (0, aliases_1.asId)(value)), zod_1.z.string().nullable()),
|
|
34
|
+
}));
|
|
35
|
+
exports.workflowVersionFullSchema = workflowVersionStubObjectSchema.extend({
|
|
36
|
+
parentVersion: (0, preprocess_1.preprocess)(helpers_1.nullishToNull, zod_1.z.lazy(() => exports.workflowVersionSchema).nullable()),
|
|
37
|
+
workflow: zod_1.z.lazy(() => workflow_1.workflowSchema),
|
|
38
|
+
createdBy: (0, preprocess_1.preprocess)((value) => (value == null ? null : value), zod_1.z.lazy(() => user_1.userSchema).nullable()),
|
|
39
|
+
});
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Hexabot — Fair Core License (FCL-1.0-ALv2)
|
|
4
|
+
* Copyright (c) 2026 Hexastack.
|
|
5
|
+
* Full terms: see LICENSE.md.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.workflowFullSchema = exports.createWorkflowFullSchema = exports.workflowSchema = exports.workflowStubSchema = void 0;
|
|
9
|
+
const zod_1 = require("zod");
|
|
10
|
+
const aliases_1 = require("../shared/aliases");
|
|
11
|
+
const base_1 = require("../shared/base");
|
|
12
|
+
const object_1 = require("../shared/object");
|
|
13
|
+
const preprocess_1 = require("../shared/preprocess");
|
|
14
|
+
const user_1 = require("../user/user");
|
|
15
|
+
const domain_1 = require("./domain");
|
|
16
|
+
const helpers_1 = require("./helpers");
|
|
17
|
+
const workflow_version_1 = require("./workflow-version");
|
|
18
|
+
const workflowAliasMap = {
|
|
19
|
+
currentVersionId: "currentVersion",
|
|
20
|
+
publishedVersionId: "publishedVersion",
|
|
21
|
+
createdById: "createdBy",
|
|
22
|
+
};
|
|
23
|
+
const workflowStubObjectSchema = base_1.baseStubSchema.extend({
|
|
24
|
+
name: zod_1.z.string(),
|
|
25
|
+
description: (0, preprocess_1.preprocess)(helpers_1.nullishToNull, zod_1.z.string().nullable()),
|
|
26
|
+
type: domain_1.workflowTypeSchema,
|
|
27
|
+
schedule: (0, preprocess_1.preprocess)(helpers_1.nullishToNull, zod_1.z.string().nullable()),
|
|
28
|
+
inputSchema: zod_1.z.any(),
|
|
29
|
+
builtin: zod_1.z.coerce.boolean(),
|
|
30
|
+
x: zod_1.z.coerce.number(),
|
|
31
|
+
y: zod_1.z.coerce.number(),
|
|
32
|
+
zoom: zod_1.z.coerce.number(),
|
|
33
|
+
direction: domain_1.directionTypeSchema,
|
|
34
|
+
});
|
|
35
|
+
const withWorkflowAliases = (value) => {
|
|
36
|
+
const original = (0, object_1.toRecord)(value);
|
|
37
|
+
const aliased = (0, aliases_1.withAliases)(value, workflowAliasMap);
|
|
38
|
+
const record = (0, object_1.toRecord)(aliased);
|
|
39
|
+
if (!record) {
|
|
40
|
+
return aliased;
|
|
41
|
+
}
|
|
42
|
+
const next = (0, object_1.cloneWithPrototype)(record);
|
|
43
|
+
const hasExplicitCurrentVersion = !!original && "currentVersion" in original;
|
|
44
|
+
const hasExplicitPublishedVersion = !!original && "publishedVersion" in original;
|
|
45
|
+
const hasCurrentVersion = next.currentVersion != null;
|
|
46
|
+
if (!hasExplicitCurrentVersion && next.currentVersion == null) {
|
|
47
|
+
delete next.currentVersion;
|
|
48
|
+
}
|
|
49
|
+
if (!hasExplicitPublishedVersion &&
|
|
50
|
+
next.publishedVersion == null &&
|
|
51
|
+
!hasCurrentVersion) {
|
|
52
|
+
delete next.publishedVersion;
|
|
53
|
+
}
|
|
54
|
+
return next;
|
|
55
|
+
};
|
|
56
|
+
const workflowDefinitionSchema = zod_1.z.any();
|
|
57
|
+
const withWorkflowDerivedFields = (value, parseDefinition) => {
|
|
58
|
+
const record = (0, object_1.toRecord)(value);
|
|
59
|
+
if (!record) {
|
|
60
|
+
return value;
|
|
61
|
+
}
|
|
62
|
+
const next = (0, object_1.cloneWithPrototype)(record);
|
|
63
|
+
const currentVersion = (0, object_1.toRecord)(next.currentVersion);
|
|
64
|
+
const currentDefinitionYml = typeof next.definitionYml === "string"
|
|
65
|
+
? next.definitionYml
|
|
66
|
+
: typeof currentVersion?.definitionYml === "string"
|
|
67
|
+
? currentVersion.definitionYml
|
|
68
|
+
: undefined;
|
|
69
|
+
if (next.definitionYml === undefined && currentDefinitionYml !== undefined) {
|
|
70
|
+
next.definitionYml = currentDefinitionYml;
|
|
71
|
+
}
|
|
72
|
+
if (next.definition === undefined &&
|
|
73
|
+
typeof currentDefinitionYml === "string" &&
|
|
74
|
+
currentDefinitionYml.trim() !== "" &&
|
|
75
|
+
parseDefinition) {
|
|
76
|
+
next.definition = parseDefinition(currentDefinitionYml);
|
|
77
|
+
}
|
|
78
|
+
return next;
|
|
79
|
+
};
|
|
80
|
+
const workflowFullObjectSchema = workflowStubObjectSchema.extend({
|
|
81
|
+
currentVersion: (0, preprocess_1.preprocess)((value) => (value == null ? null : value), zod_1.z.lazy(() => workflow_version_1.workflowVersionSchema).nullable()),
|
|
82
|
+
publishedVersion: (0, preprocess_1.preprocess)((value) => (value == null ? null : value), zod_1.z.lazy(() => workflow_version_1.workflowVersionSchema).nullable()),
|
|
83
|
+
createdBy: (0, preprocess_1.preprocess)((value) => (value == null ? null : value), zod_1.z.lazy(() => user_1.userSchema).nullable()),
|
|
84
|
+
definitionYml: (0, preprocess_1.preprocess)((value) => (value == null ? undefined : value), zod_1.z.string().optional()).optional(),
|
|
85
|
+
definition: (0, preprocess_1.preprocess)((value) => (value == null ? undefined : value), workflowDefinitionSchema.optional()).optional(),
|
|
86
|
+
});
|
|
87
|
+
exports.workflowStubSchema = workflowStubObjectSchema;
|
|
88
|
+
exports.workflowSchema = (0, preprocess_1.preprocess)(withWorkflowAliases, workflowStubObjectSchema.extend({
|
|
89
|
+
currentVersion: (0, preprocess_1.preprocess)((value) => value === undefined ? undefined : value == null ? null : (0, aliases_1.asId)(value), zod_1.z.string().nullable().optional()).optional(),
|
|
90
|
+
publishedVersion: (0, preprocess_1.preprocess)((value) => value === undefined ? undefined : value == null ? null : (0, aliases_1.asId)(value), zod_1.z.string().nullable().optional()).optional(),
|
|
91
|
+
createdBy: (0, preprocess_1.preprocess)((value) => (value == null ? null : (0, aliases_1.asId)(value)), zod_1.z.string().nullable()),
|
|
92
|
+
runAfterMs: (0, preprocess_1.preprocess)((value) => (value == null ? 0 : value), zod_1.z.coerce.number()),
|
|
93
|
+
}));
|
|
94
|
+
const createWorkflowFullSchema = (options) => {
|
|
95
|
+
return (0, preprocess_1.preprocess)((value) => withWorkflowDerivedFields(value, options?.parseDefinition), workflowFullObjectSchema);
|
|
96
|
+
};
|
|
97
|
+
exports.createWorkflowFullSchema = createWorkflowFullSchema;
|
|
98
|
+
exports.workflowFullSchema = (0, exports.createWorkflowFullSchema)();
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Hexabot — Fair Core License (FCL-1.0-ALv2)
|
|
3
|
+
* Copyright (c) 2026 Hexastack.
|
|
4
|
+
* Full terms: see LICENSE.md.
|
|
5
|
+
*/
|
|
6
|
+
export { integrationHealthItemSchema, integrationHealthKindSchema, integrationHealthResponseSchema, integrationHealthStatusSchema, } from "./integration-health";
|
|
7
|
+
export { StatsType, statsFullSchema, statsSchema, statsStubSchema, } from "./stats";
|