@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,87 @@
|
|
|
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.stdOutgoingEnvelopeSchema = exports.stdOutgoingMessageEnvelopeSchema = exports.stdOutgoingSystemEnvelopeSchema = exports.stdOutgoingAttachmentEnvelopeSchema = exports.stdOutgoingListEnvelopeSchema = exports.stdOutgoingButtonsEnvelopeSchema = exports.stdOutgoingQuickRepliesEnvelopeSchema = exports.stdOutgoingTextEnvelopeSchema = exports.stdIncomingMessageSchema = exports.stdIncomingAttachmentMessageSchema = exports.stdIncomingLocationMessageSchema = exports.stdIncomingQuickReplyMessageSchema = exports.stdIncomingPostBackMessageSchema = exports.stdIncomingTextMessageSchema = exports.stdIncomingAttachmentMessageDataSchema = exports.stdIncomingLocationMessageDataSchema = exports.stdIncomingPayloadMessageDataSchema = exports.stdIncomingTextMessageDataSchema = exports.stdOutgoingMessageSchema = exports.stdOutgoingSystemMessageSchema = exports.stdOutgoingAttachmentMessageSchema = exports.stdOutgoingCarouselMessageSchema = exports.stdOutgoingListMessageSchema = exports.contentPaginationSchema = exports.contentElementSchema = exports.stdOutgoingButtonsMessageSchema = exports.stdOutgoingQuickRepliesMessageSchema = exports.stdOutgoingTextMessageSchema = exports.stdOutgoingSystemMessageDataSchema = exports.stdOutgoingAttachmentMessageDataSchema = exports.stdOutgoingListMessageDataSchema = exports.stdOutgoingButtonsMessageDataSchema = exports.stdOutgoingQuickRepliesMessageDataSchema = exports.stdOutgoingTextMessageDataSchema = exports.payloadTypeSchema = exports.outgoingMessageTypeSchema = exports.incomingMessageType = exports.stdQuickReplySchema = exports.payloadSchema = exports.coordinatesSchema = exports.ActionOptionsSchema = exports.fallbackOptionsSchema = exports.contentOptionsSchema = exports.PayloadType = exports.ButtonType = exports.buttonSchema = exports.FileType = exports.attachmentPayloadSchema = exports.attachmentRefSchema = exports.fileTypeSchema = void 0;
|
|
9
|
+
exports.messageStubSchema = exports.messageSchema = exports.messageFullSchema = exports.threadStubSchema = exports.threadSchema = exports.threadFullSchema = exports.subscriberStubSchema = exports.subscriberSchema = exports.subscriberFullSchema = exports.labelStubSchema = exports.labelSchema = exports.labelFullSchema = exports.labelGroupStubSchema = exports.labelGroupSchema = exports.labelGroupFullSchema = exports.StdEventType = exports.OutgoingMessageType = exports.IncomingMessageType = void 0;
|
|
10
|
+
var attachment_1 = require("./attachment");
|
|
11
|
+
Object.defineProperty(exports, "fileTypeSchema", { enumerable: true, get: function () { return attachment_1.fileTypeSchema; } });
|
|
12
|
+
Object.defineProperty(exports, "attachmentRefSchema", { enumerable: true, get: function () { return attachment_1.attachmentRefSchema; } });
|
|
13
|
+
Object.defineProperty(exports, "attachmentPayloadSchema", { enumerable: true, get: function () { return attachment_1.attachmentPayloadSchema; } });
|
|
14
|
+
Object.defineProperty(exports, "FileType", { enumerable: true, get: function () { return attachment_1.FileType; } });
|
|
15
|
+
var button_1 = require("./button");
|
|
16
|
+
Object.defineProperty(exports, "buttonSchema", { enumerable: true, get: function () { return button_1.buttonSchema; } });
|
|
17
|
+
Object.defineProperty(exports, "ButtonType", { enumerable: true, get: function () { return button_1.ButtonType; } });
|
|
18
|
+
Object.defineProperty(exports, "PayloadType", { enumerable: true, get: function () { return button_1.PayloadType; } });
|
|
19
|
+
var options_1 = require("./options");
|
|
20
|
+
Object.defineProperty(exports, "contentOptionsSchema", { enumerable: true, get: function () { return options_1.contentOptionsSchema; } });
|
|
21
|
+
Object.defineProperty(exports, "fallbackOptionsSchema", { enumerable: true, get: function () { return options_1.fallbackOptionsSchema; } });
|
|
22
|
+
Object.defineProperty(exports, "ActionOptionsSchema", { enumerable: true, get: function () { return options_1.ActionOptionsSchema; } });
|
|
23
|
+
var quick_reply_1 = require("./quick-reply");
|
|
24
|
+
Object.defineProperty(exports, "coordinatesSchema", { enumerable: true, get: function () { return quick_reply_1.coordinatesSchema; } });
|
|
25
|
+
Object.defineProperty(exports, "payloadSchema", { enumerable: true, get: function () { return quick_reply_1.payloadSchema; } });
|
|
26
|
+
Object.defineProperty(exports, "stdQuickReplySchema", { enumerable: true, get: function () { return quick_reply_1.stdQuickReplySchema; } });
|
|
27
|
+
var message_contract_1 = require("./message-contract");
|
|
28
|
+
Object.defineProperty(exports, "incomingMessageType", { enumerable: true, get: function () { return message_contract_1.incomingMessageType; } });
|
|
29
|
+
Object.defineProperty(exports, "outgoingMessageTypeSchema", { enumerable: true, get: function () { return message_contract_1.outgoingMessageTypeSchema; } });
|
|
30
|
+
Object.defineProperty(exports, "payloadTypeSchema", { enumerable: true, get: function () { return message_contract_1.payloadTypeSchema; } });
|
|
31
|
+
Object.defineProperty(exports, "stdOutgoingTextMessageDataSchema", { enumerable: true, get: function () { return message_contract_1.stdOutgoingTextMessageDataSchema; } });
|
|
32
|
+
Object.defineProperty(exports, "stdOutgoingQuickRepliesMessageDataSchema", { enumerable: true, get: function () { return message_contract_1.stdOutgoingQuickRepliesMessageDataSchema; } });
|
|
33
|
+
Object.defineProperty(exports, "stdOutgoingButtonsMessageDataSchema", { enumerable: true, get: function () { return message_contract_1.stdOutgoingButtonsMessageDataSchema; } });
|
|
34
|
+
Object.defineProperty(exports, "stdOutgoingListMessageDataSchema", { enumerable: true, get: function () { return message_contract_1.stdOutgoingListMessageDataSchema; } });
|
|
35
|
+
Object.defineProperty(exports, "stdOutgoingAttachmentMessageDataSchema", { enumerable: true, get: function () { return message_contract_1.stdOutgoingAttachmentMessageDataSchema; } });
|
|
36
|
+
Object.defineProperty(exports, "stdOutgoingSystemMessageDataSchema", { enumerable: true, get: function () { return message_contract_1.stdOutgoingSystemMessageDataSchema; } });
|
|
37
|
+
Object.defineProperty(exports, "stdOutgoingTextMessageSchema", { enumerable: true, get: function () { return message_contract_1.stdOutgoingTextMessageSchema; } });
|
|
38
|
+
Object.defineProperty(exports, "stdOutgoingQuickRepliesMessageSchema", { enumerable: true, get: function () { return message_contract_1.stdOutgoingQuickRepliesMessageSchema; } });
|
|
39
|
+
Object.defineProperty(exports, "stdOutgoingButtonsMessageSchema", { enumerable: true, get: function () { return message_contract_1.stdOutgoingButtonsMessageSchema; } });
|
|
40
|
+
Object.defineProperty(exports, "contentElementSchema", { enumerable: true, get: function () { return message_contract_1.contentElementSchema; } });
|
|
41
|
+
Object.defineProperty(exports, "contentPaginationSchema", { enumerable: true, get: function () { return message_contract_1.contentPaginationSchema; } });
|
|
42
|
+
Object.defineProperty(exports, "stdOutgoingListMessageSchema", { enumerable: true, get: function () { return message_contract_1.stdOutgoingListMessageSchema; } });
|
|
43
|
+
Object.defineProperty(exports, "stdOutgoingCarouselMessageSchema", { enumerable: true, get: function () { return message_contract_1.stdOutgoingCarouselMessageSchema; } });
|
|
44
|
+
Object.defineProperty(exports, "stdOutgoingAttachmentMessageSchema", { enumerable: true, get: function () { return message_contract_1.stdOutgoingAttachmentMessageSchema; } });
|
|
45
|
+
Object.defineProperty(exports, "stdOutgoingSystemMessageSchema", { enumerable: true, get: function () { return message_contract_1.stdOutgoingSystemMessageSchema; } });
|
|
46
|
+
Object.defineProperty(exports, "stdOutgoingMessageSchema", { enumerable: true, get: function () { return message_contract_1.stdOutgoingMessageSchema; } });
|
|
47
|
+
Object.defineProperty(exports, "stdIncomingTextMessageDataSchema", { enumerable: true, get: function () { return message_contract_1.stdIncomingTextMessageDataSchema; } });
|
|
48
|
+
Object.defineProperty(exports, "stdIncomingPayloadMessageDataSchema", { enumerable: true, get: function () { return message_contract_1.stdIncomingPayloadMessageDataSchema; } });
|
|
49
|
+
Object.defineProperty(exports, "stdIncomingLocationMessageDataSchema", { enumerable: true, get: function () { return message_contract_1.stdIncomingLocationMessageDataSchema; } });
|
|
50
|
+
Object.defineProperty(exports, "stdIncomingAttachmentMessageDataSchema", { enumerable: true, get: function () { return message_contract_1.stdIncomingAttachmentMessageDataSchema; } });
|
|
51
|
+
Object.defineProperty(exports, "stdIncomingTextMessageSchema", { enumerable: true, get: function () { return message_contract_1.stdIncomingTextMessageSchema; } });
|
|
52
|
+
Object.defineProperty(exports, "stdIncomingPostBackMessageSchema", { enumerable: true, get: function () { return message_contract_1.stdIncomingPostBackMessageSchema; } });
|
|
53
|
+
Object.defineProperty(exports, "stdIncomingQuickReplyMessageSchema", { enumerable: true, get: function () { return message_contract_1.stdIncomingQuickReplyMessageSchema; } });
|
|
54
|
+
Object.defineProperty(exports, "stdIncomingLocationMessageSchema", { enumerable: true, get: function () { return message_contract_1.stdIncomingLocationMessageSchema; } });
|
|
55
|
+
Object.defineProperty(exports, "stdIncomingAttachmentMessageSchema", { enumerable: true, get: function () { return message_contract_1.stdIncomingAttachmentMessageSchema; } });
|
|
56
|
+
Object.defineProperty(exports, "stdIncomingMessageSchema", { enumerable: true, get: function () { return message_contract_1.stdIncomingMessageSchema; } });
|
|
57
|
+
Object.defineProperty(exports, "stdOutgoingTextEnvelopeSchema", { enumerable: true, get: function () { return message_contract_1.stdOutgoingTextEnvelopeSchema; } });
|
|
58
|
+
Object.defineProperty(exports, "stdOutgoingQuickRepliesEnvelopeSchema", { enumerable: true, get: function () { return message_contract_1.stdOutgoingQuickRepliesEnvelopeSchema; } });
|
|
59
|
+
Object.defineProperty(exports, "stdOutgoingButtonsEnvelopeSchema", { enumerable: true, get: function () { return message_contract_1.stdOutgoingButtonsEnvelopeSchema; } });
|
|
60
|
+
Object.defineProperty(exports, "stdOutgoingListEnvelopeSchema", { enumerable: true, get: function () { return message_contract_1.stdOutgoingListEnvelopeSchema; } });
|
|
61
|
+
Object.defineProperty(exports, "stdOutgoingAttachmentEnvelopeSchema", { enumerable: true, get: function () { return message_contract_1.stdOutgoingAttachmentEnvelopeSchema; } });
|
|
62
|
+
Object.defineProperty(exports, "stdOutgoingSystemEnvelopeSchema", { enumerable: true, get: function () { return message_contract_1.stdOutgoingSystemEnvelopeSchema; } });
|
|
63
|
+
Object.defineProperty(exports, "stdOutgoingMessageEnvelopeSchema", { enumerable: true, get: function () { return message_contract_1.stdOutgoingMessageEnvelopeSchema; } });
|
|
64
|
+
Object.defineProperty(exports, "stdOutgoingEnvelopeSchema", { enumerable: true, get: function () { return message_contract_1.stdOutgoingEnvelopeSchema; } });
|
|
65
|
+
Object.defineProperty(exports, "IncomingMessageType", { enumerable: true, get: function () { return message_contract_1.IncomingMessageType; } });
|
|
66
|
+
Object.defineProperty(exports, "OutgoingMessageType", { enumerable: true, get: function () { return message_contract_1.OutgoingMessageType; } });
|
|
67
|
+
Object.defineProperty(exports, "StdEventType", { enumerable: true, get: function () { return message_contract_1.StdEventType; } });
|
|
68
|
+
var label_group_1 = require("./label-group");
|
|
69
|
+
Object.defineProperty(exports, "labelGroupFullSchema", { enumerable: true, get: function () { return label_group_1.labelGroupFullSchema; } });
|
|
70
|
+
Object.defineProperty(exports, "labelGroupSchema", { enumerable: true, get: function () { return label_group_1.labelGroupSchema; } });
|
|
71
|
+
Object.defineProperty(exports, "labelGroupStubSchema", { enumerable: true, get: function () { return label_group_1.labelGroupStubSchema; } });
|
|
72
|
+
var label_1 = require("./label");
|
|
73
|
+
Object.defineProperty(exports, "labelFullSchema", { enumerable: true, get: function () { return label_1.labelFullSchema; } });
|
|
74
|
+
Object.defineProperty(exports, "labelSchema", { enumerable: true, get: function () { return label_1.labelSchema; } });
|
|
75
|
+
Object.defineProperty(exports, "labelStubSchema", { enumerable: true, get: function () { return label_1.labelStubSchema; } });
|
|
76
|
+
var subscriber_1 = require("./subscriber");
|
|
77
|
+
Object.defineProperty(exports, "subscriberFullSchema", { enumerable: true, get: function () { return subscriber_1.subscriberFullSchema; } });
|
|
78
|
+
Object.defineProperty(exports, "subscriberSchema", { enumerable: true, get: function () { return subscriber_1.subscriberSchema; } });
|
|
79
|
+
Object.defineProperty(exports, "subscriberStubSchema", { enumerable: true, get: function () { return subscriber_1.subscriberStubSchema; } });
|
|
80
|
+
var thread_1 = require("./thread");
|
|
81
|
+
Object.defineProperty(exports, "threadFullSchema", { enumerable: true, get: function () { return thread_1.threadFullSchema; } });
|
|
82
|
+
Object.defineProperty(exports, "threadSchema", { enumerable: true, get: function () { return thread_1.threadSchema; } });
|
|
83
|
+
Object.defineProperty(exports, "threadStubSchema", { enumerable: true, get: function () { return thread_1.threadStubSchema; } });
|
|
84
|
+
var message_1 = require("./message");
|
|
85
|
+
Object.defineProperty(exports, "messageFullSchema", { enumerable: true, get: function () { return message_1.messageFullSchema; } });
|
|
86
|
+
Object.defineProperty(exports, "messageSchema", { enumerable: true, get: function () { return message_1.messageSchema; } });
|
|
87
|
+
Object.defineProperty(exports, "messageStubSchema", { enumerable: true, get: function () { return message_1.messageStubSchema; } });
|
|
@@ -0,0 +1,22 @@
|
|
|
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.labelGroupFullSchema = exports.labelGroupSchema = exports.labelGroupStubSchema = void 0;
|
|
9
|
+
const zod_1 = require("zod");
|
|
10
|
+
const base_1 = require("../shared/base");
|
|
11
|
+
const preprocess_1 = require("../shared/preprocess");
|
|
12
|
+
const label_1 = require("./label");
|
|
13
|
+
const labelGroupObjectSchema = base_1.baseStubSchema.extend({
|
|
14
|
+
name: zod_1.z.string(),
|
|
15
|
+
});
|
|
16
|
+
exports.labelGroupStubSchema = labelGroupObjectSchema;
|
|
17
|
+
exports.labelGroupSchema = labelGroupObjectSchema.extend({
|
|
18
|
+
labels: (0, preprocess_1.preprocess)(() => undefined, zod_1.z.undefined().optional()).optional(),
|
|
19
|
+
});
|
|
20
|
+
exports.labelGroupFullSchema = labelGroupObjectSchema.extend({
|
|
21
|
+
labels: (0, preprocess_1.preprocess)((value) => (Array.isArray(value) ? value : []), zod_1.z.array(zod_1.z.lazy(() => label_1.labelSchema))).optional(),
|
|
22
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
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.labelFullSchema = exports.labelSchema = exports.labelStubSchema = 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 label_group_1 = require("./label-group");
|
|
14
|
+
const subscriber_1 = require("./subscriber");
|
|
15
|
+
const nullableOptionalStringSchema = zod_1.z.string().nullable().optional();
|
|
16
|
+
const labelAliasMap = {
|
|
17
|
+
groupId: "group",
|
|
18
|
+
};
|
|
19
|
+
const labelStubObjectSchema = base_1.baseStubSchema.extend({
|
|
20
|
+
title: zod_1.z.string(),
|
|
21
|
+
name: zod_1.z.string(),
|
|
22
|
+
label_id: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).nullable().optional(),
|
|
23
|
+
description: nullableOptionalStringSchema,
|
|
24
|
+
builtin: zod_1.z.coerce.boolean(),
|
|
25
|
+
});
|
|
26
|
+
exports.labelStubSchema = labelStubObjectSchema;
|
|
27
|
+
exports.labelSchema = (0, preprocess_1.preprocess)((value) => (0, aliases_1.withAliases)(value, labelAliasMap), labelStubObjectSchema.extend({
|
|
28
|
+
group: (0, preprocess_1.preprocess)((value) => (value == null ? null : (0, aliases_1.asId)(value)), zod_1.z.string().nullable()).optional(),
|
|
29
|
+
users: (0, preprocess_1.preprocess)(() => undefined, zod_1.z.undefined().optional()).optional(),
|
|
30
|
+
}));
|
|
31
|
+
exports.labelFullSchema = labelStubObjectSchema.extend({
|
|
32
|
+
users: (0, preprocess_1.preprocess)((value) => (Array.isArray(value) ? value : []), zod_1.z.array(zod_1.z.lazy(() => subscriber_1.subscriberSchema))).optional(),
|
|
33
|
+
group: zod_1.z
|
|
34
|
+
.lazy(() => label_group_1.labelGroupSchema)
|
|
35
|
+
.nullable()
|
|
36
|
+
.optional(),
|
|
37
|
+
});
|
|
@@ -0,0 +1,183 @@
|
|
|
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.stdOutgoingEnvelopeSchema = exports.stdOutgoingMessageEnvelopeSchema = exports.stdOutgoingSystemEnvelopeSchema = exports.stdOutgoingSystemMessageSchema = exports.stdOutgoingAttachmentEnvelopeSchema = exports.stdOutgoingListEnvelopeSchema = exports.stdOutgoingButtonsEnvelopeSchema = exports.stdOutgoingQuickRepliesEnvelopeSchema = exports.stdOutgoingTextEnvelopeSchema = exports.stdIncomingMessageSchema = exports.stdIncomingAttachmentMessageSchema = exports.stdIncomingLocationMessageSchema = exports.stdIncomingQuickReplyMessageSchema = exports.stdIncomingPostBackMessageSchema = exports.stdIncomingTextMessageSchema = exports.stdIncomingAttachmentMessageDataSchema = exports.stdIncomingLocationMessageDataSchema = exports.stdIncomingPayloadMessageDataSchema = exports.stdIncomingTextMessageDataSchema = exports.stdOutgoingMessageSchema = exports.stdOutgoingAttachmentMessageSchema = exports.stdOutgoingCarouselMessageSchema = exports.stdOutgoingListMessageSchema = exports.stdOutgoingButtonsMessageSchema = exports.stdOutgoingQuickRepliesMessageSchema = exports.stdOutgoingTextMessageSchema = exports.stdOutgoingSystemMessageDataSchema = exports.stdOutgoingAttachmentMessageDataSchema = exports.stdOutgoingListMessageDataSchema = exports.contentPaginationSchema = exports.contentElementSchema = exports.stdOutgoingButtonsMessageDataSchema = exports.stdOutgoingQuickRepliesMessageDataSchema = exports.stdOutgoingTextMessageDataSchema = exports.payloadTypeSchema = exports.outgoingMessageTypeSchema = exports.OutgoingMessageType = exports.incomingMessageType = exports.IncomingMessageType = exports.StdEventType = void 0;
|
|
9
|
+
const zod_1 = require("zod");
|
|
10
|
+
const attachment_1 = require("./attachment");
|
|
11
|
+
const button_1 = require("./button");
|
|
12
|
+
const options_1 = require("./options");
|
|
13
|
+
const quick_reply_1 = require("./quick-reply");
|
|
14
|
+
var StdEventType;
|
|
15
|
+
(function (StdEventType) {
|
|
16
|
+
StdEventType["message"] = "message";
|
|
17
|
+
StdEventType["delivery"] = "delivery";
|
|
18
|
+
StdEventType["read"] = "read";
|
|
19
|
+
StdEventType["typing"] = "typing";
|
|
20
|
+
StdEventType["follow"] = "follow";
|
|
21
|
+
StdEventType["echo"] = "echo";
|
|
22
|
+
StdEventType["error"] = "error";
|
|
23
|
+
StdEventType["unknown"] = "";
|
|
24
|
+
})(StdEventType || (exports.StdEventType = StdEventType = {}));
|
|
25
|
+
var IncomingMessageType;
|
|
26
|
+
(function (IncomingMessageType) {
|
|
27
|
+
IncomingMessageType["text"] = "text";
|
|
28
|
+
IncomingMessageType["postback"] = "postback";
|
|
29
|
+
IncomingMessageType["quickReply"] = "quickReply";
|
|
30
|
+
IncomingMessageType["location"] = "location";
|
|
31
|
+
IncomingMessageType["attachment"] = "attachment";
|
|
32
|
+
IncomingMessageType["unknown"] = "";
|
|
33
|
+
})(IncomingMessageType || (exports.IncomingMessageType = IncomingMessageType = {}));
|
|
34
|
+
exports.incomingMessageType = zod_1.z.enum(IncomingMessageType);
|
|
35
|
+
var OutgoingMessageType;
|
|
36
|
+
(function (OutgoingMessageType) {
|
|
37
|
+
OutgoingMessageType["text"] = "text";
|
|
38
|
+
OutgoingMessageType["quickReply"] = "quickReply";
|
|
39
|
+
OutgoingMessageType["buttons"] = "buttons";
|
|
40
|
+
OutgoingMessageType["attachment"] = "attachment";
|
|
41
|
+
OutgoingMessageType["list"] = "list";
|
|
42
|
+
OutgoingMessageType["carousel"] = "carousel";
|
|
43
|
+
OutgoingMessageType["system"] = "system";
|
|
44
|
+
})(OutgoingMessageType || (exports.OutgoingMessageType = OutgoingMessageType = {}));
|
|
45
|
+
exports.outgoingMessageTypeSchema = zod_1.z.enum(OutgoingMessageType);
|
|
46
|
+
exports.payloadTypeSchema = zod_1.z.enum(button_1.PayloadType);
|
|
47
|
+
exports.stdOutgoingTextMessageDataSchema = zod_1.z.object({
|
|
48
|
+
text: zod_1.z.string(),
|
|
49
|
+
});
|
|
50
|
+
exports.stdOutgoingQuickRepliesMessageDataSchema = zod_1.z.object({
|
|
51
|
+
text: zod_1.z.string(),
|
|
52
|
+
quickReplies: zod_1.z.array(quick_reply_1.stdQuickReplySchema),
|
|
53
|
+
});
|
|
54
|
+
exports.stdOutgoingButtonsMessageDataSchema = zod_1.z.object({
|
|
55
|
+
text: zod_1.z.string(),
|
|
56
|
+
buttons: zod_1.z.array(button_1.buttonSchema),
|
|
57
|
+
});
|
|
58
|
+
exports.contentElementSchema = zod_1.z
|
|
59
|
+
.object({
|
|
60
|
+
id: zod_1.z.string(),
|
|
61
|
+
title: zod_1.z.string(),
|
|
62
|
+
})
|
|
63
|
+
.catchall(zod_1.z.any());
|
|
64
|
+
exports.contentPaginationSchema = zod_1.z.object({
|
|
65
|
+
total: zod_1.z.number(),
|
|
66
|
+
skip: zod_1.z.number(),
|
|
67
|
+
limit: zod_1.z.number(),
|
|
68
|
+
});
|
|
69
|
+
exports.stdOutgoingListMessageDataSchema = zod_1.z.object({
|
|
70
|
+
options: options_1.contentOptionsSchema,
|
|
71
|
+
elements: zod_1.z.array(exports.contentElementSchema),
|
|
72
|
+
pagination: exports.contentPaginationSchema,
|
|
73
|
+
});
|
|
74
|
+
exports.stdOutgoingAttachmentMessageDataSchema = zod_1.z.object({
|
|
75
|
+
attachment: attachment_1.attachmentPayloadSchema,
|
|
76
|
+
quickReplies: zod_1.z.array(quick_reply_1.stdQuickReplySchema).optional(),
|
|
77
|
+
});
|
|
78
|
+
exports.stdOutgoingSystemMessageDataSchema = zod_1.z.object({
|
|
79
|
+
outcome: zod_1.z.string().optional(),
|
|
80
|
+
data: zod_1.z.any().optional(),
|
|
81
|
+
});
|
|
82
|
+
exports.stdOutgoingTextMessageSchema = zod_1.z.object({
|
|
83
|
+
type: zod_1.z.literal(OutgoingMessageType.text),
|
|
84
|
+
data: exports.stdOutgoingTextMessageDataSchema,
|
|
85
|
+
});
|
|
86
|
+
exports.stdOutgoingQuickRepliesMessageSchema = zod_1.z.object({
|
|
87
|
+
type: zod_1.z.literal(OutgoingMessageType.quickReply),
|
|
88
|
+
data: exports.stdOutgoingQuickRepliesMessageDataSchema,
|
|
89
|
+
});
|
|
90
|
+
exports.stdOutgoingButtonsMessageSchema = zod_1.z.object({
|
|
91
|
+
type: zod_1.z.literal(OutgoingMessageType.buttons),
|
|
92
|
+
data: exports.stdOutgoingButtonsMessageDataSchema,
|
|
93
|
+
});
|
|
94
|
+
exports.stdOutgoingListMessageSchema = zod_1.z.object({
|
|
95
|
+
type: zod_1.z.literal(OutgoingMessageType.list),
|
|
96
|
+
data: exports.stdOutgoingListMessageDataSchema,
|
|
97
|
+
});
|
|
98
|
+
exports.stdOutgoingCarouselMessageSchema = zod_1.z.object({
|
|
99
|
+
type: zod_1.z.literal(OutgoingMessageType.carousel),
|
|
100
|
+
data: exports.stdOutgoingListMessageDataSchema,
|
|
101
|
+
});
|
|
102
|
+
exports.stdOutgoingAttachmentMessageSchema = zod_1.z.object({
|
|
103
|
+
type: zod_1.z.literal(OutgoingMessageType.attachment),
|
|
104
|
+
data: exports.stdOutgoingAttachmentMessageDataSchema,
|
|
105
|
+
});
|
|
106
|
+
exports.stdOutgoingMessageSchema = zod_1.z.discriminatedUnion("type", [
|
|
107
|
+
exports.stdOutgoingTextMessageSchema,
|
|
108
|
+
exports.stdOutgoingQuickRepliesMessageSchema,
|
|
109
|
+
exports.stdOutgoingButtonsMessageSchema,
|
|
110
|
+
exports.stdOutgoingListMessageSchema,
|
|
111
|
+
exports.stdOutgoingCarouselMessageSchema,
|
|
112
|
+
exports.stdOutgoingAttachmentMessageSchema,
|
|
113
|
+
]);
|
|
114
|
+
exports.stdIncomingTextMessageDataSchema = zod_1.z.object({
|
|
115
|
+
text: zod_1.z.string(),
|
|
116
|
+
});
|
|
117
|
+
exports.stdIncomingPayloadMessageDataSchema = zod_1.z.object({
|
|
118
|
+
text: zod_1.z.string(),
|
|
119
|
+
payload: zod_1.z.string(),
|
|
120
|
+
});
|
|
121
|
+
exports.stdIncomingLocationMessageDataSchema = zod_1.z.object({
|
|
122
|
+
coordinates: zod_1.z.object({
|
|
123
|
+
lat: zod_1.z.number(),
|
|
124
|
+
lon: zod_1.z.number(),
|
|
125
|
+
}),
|
|
126
|
+
});
|
|
127
|
+
exports.stdIncomingAttachmentMessageDataSchema = zod_1.z.object({
|
|
128
|
+
serializedText: zod_1.z.string(),
|
|
129
|
+
attachment: zod_1.z.union([
|
|
130
|
+
attachment_1.attachmentPayloadSchema,
|
|
131
|
+
zod_1.z.array(attachment_1.attachmentPayloadSchema),
|
|
132
|
+
]),
|
|
133
|
+
});
|
|
134
|
+
exports.stdIncomingTextMessageSchema = zod_1.z.object({
|
|
135
|
+
type: zod_1.z.literal(IncomingMessageType.text),
|
|
136
|
+
data: exports.stdIncomingTextMessageDataSchema,
|
|
137
|
+
});
|
|
138
|
+
exports.stdIncomingPostBackMessageSchema = zod_1.z.object({
|
|
139
|
+
type: zod_1.z.literal(IncomingMessageType.postback),
|
|
140
|
+
data: exports.stdIncomingPayloadMessageDataSchema,
|
|
141
|
+
});
|
|
142
|
+
exports.stdIncomingQuickReplyMessageSchema = zod_1.z.object({
|
|
143
|
+
type: zod_1.z.literal(IncomingMessageType.quickReply),
|
|
144
|
+
data: exports.stdIncomingPayloadMessageDataSchema,
|
|
145
|
+
});
|
|
146
|
+
exports.stdIncomingLocationMessageSchema = zod_1.z.object({
|
|
147
|
+
type: zod_1.z.literal(IncomingMessageType.location),
|
|
148
|
+
data: exports.stdIncomingLocationMessageDataSchema,
|
|
149
|
+
});
|
|
150
|
+
exports.stdIncomingAttachmentMessageSchema = zod_1.z.object({
|
|
151
|
+
type: zod_1.z.literal(IncomingMessageType.attachment),
|
|
152
|
+
data: exports.stdIncomingAttachmentMessageDataSchema,
|
|
153
|
+
});
|
|
154
|
+
exports.stdIncomingMessageSchema = zod_1.z.discriminatedUnion("type", [
|
|
155
|
+
exports.stdIncomingTextMessageSchema,
|
|
156
|
+
exports.stdIncomingPostBackMessageSchema,
|
|
157
|
+
exports.stdIncomingQuickReplyMessageSchema,
|
|
158
|
+
exports.stdIncomingLocationMessageSchema,
|
|
159
|
+
exports.stdIncomingAttachmentMessageSchema,
|
|
160
|
+
]);
|
|
161
|
+
exports.stdOutgoingTextEnvelopeSchema = exports.stdOutgoingTextMessageSchema;
|
|
162
|
+
exports.stdOutgoingQuickRepliesEnvelopeSchema = exports.stdOutgoingQuickRepliesMessageSchema;
|
|
163
|
+
exports.stdOutgoingButtonsEnvelopeSchema = exports.stdOutgoingButtonsMessageSchema;
|
|
164
|
+
exports.stdOutgoingListEnvelopeSchema = zod_1.z.discriminatedUnion("type", [
|
|
165
|
+
exports.stdOutgoingListMessageSchema,
|
|
166
|
+
exports.stdOutgoingCarouselMessageSchema,
|
|
167
|
+
]);
|
|
168
|
+
exports.stdOutgoingAttachmentEnvelopeSchema = exports.stdOutgoingAttachmentMessageSchema;
|
|
169
|
+
exports.stdOutgoingSystemMessageSchema = zod_1.z.object({
|
|
170
|
+
type: zod_1.z.literal(OutgoingMessageType.system),
|
|
171
|
+
data: exports.stdOutgoingSystemMessageDataSchema,
|
|
172
|
+
});
|
|
173
|
+
exports.stdOutgoingSystemEnvelopeSchema = exports.stdOutgoingSystemMessageSchema;
|
|
174
|
+
exports.stdOutgoingMessageEnvelopeSchema = exports.stdOutgoingMessageSchema;
|
|
175
|
+
exports.stdOutgoingEnvelopeSchema = zod_1.z.discriminatedUnion("type", [
|
|
176
|
+
exports.stdOutgoingTextMessageSchema,
|
|
177
|
+
exports.stdOutgoingQuickRepliesMessageSchema,
|
|
178
|
+
exports.stdOutgoingButtonsMessageSchema,
|
|
179
|
+
exports.stdOutgoingListMessageSchema,
|
|
180
|
+
exports.stdOutgoingCarouselMessageSchema,
|
|
181
|
+
exports.stdOutgoingAttachmentMessageSchema,
|
|
182
|
+
exports.stdOutgoingSystemMessageSchema,
|
|
183
|
+
]);
|
|
@@ -0,0 +1,107 @@
|
|
|
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.messageFullSchema = exports.messageSchema = exports.messageStubSchema = 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 message_contract_1 = require("./message-contract");
|
|
15
|
+
const subscriber_1 = require("./subscriber");
|
|
16
|
+
const thread_1 = require("./thread");
|
|
17
|
+
const messageAliasMap = {
|
|
18
|
+
senderId: "sender",
|
|
19
|
+
recipientId: "recipient",
|
|
20
|
+
sentById: "sentBy",
|
|
21
|
+
threadId: "thread",
|
|
22
|
+
};
|
|
23
|
+
const incomingOnlyTypes = new Set([
|
|
24
|
+
message_contract_1.IncomingMessageType.postback,
|
|
25
|
+
message_contract_1.IncomingMessageType.location,
|
|
26
|
+
]);
|
|
27
|
+
const outgoingOnlyTypes = new Set([
|
|
28
|
+
message_contract_1.OutgoingMessageType.buttons,
|
|
29
|
+
message_contract_1.OutgoingMessageType.list,
|
|
30
|
+
message_contract_1.OutgoingMessageType.carousel,
|
|
31
|
+
message_contract_1.OutgoingMessageType.system,
|
|
32
|
+
]);
|
|
33
|
+
const invalidDirectionMessage = {
|
|
34
|
+
type: "__invalidDirection__",
|
|
35
|
+
data: null,
|
|
36
|
+
};
|
|
37
|
+
const parseByDirection = (message, record) => {
|
|
38
|
+
const hasSender = record.sender != null;
|
|
39
|
+
const hasRecipient = record.recipient != null;
|
|
40
|
+
const hasSentBy = record.sentBy != null;
|
|
41
|
+
const shouldUseOutgoingSchema = hasRecipient || hasSentBy;
|
|
42
|
+
const shouldUseIncomingSchema = hasSender && !shouldUseOutgoingSchema;
|
|
43
|
+
if (shouldUseOutgoingSchema) {
|
|
44
|
+
const parsed = message_contract_1.stdOutgoingMessageSchema.safeParse(message);
|
|
45
|
+
return parsed.success ? parsed.data : invalidDirectionMessage;
|
|
46
|
+
}
|
|
47
|
+
if (shouldUseIncomingSchema) {
|
|
48
|
+
const parsed = message_contract_1.stdIncomingMessageSchema.safeParse(message);
|
|
49
|
+
return parsed.success ? parsed.data : invalidDirectionMessage;
|
|
50
|
+
}
|
|
51
|
+
const type = typeof message === "object" && message !== null
|
|
52
|
+
? message.type
|
|
53
|
+
: undefined;
|
|
54
|
+
if (typeof type !== "string") {
|
|
55
|
+
const parsed = messagePayloadSchema.safeParse(message);
|
|
56
|
+
return parsed.success ? parsed.data : message;
|
|
57
|
+
}
|
|
58
|
+
if (incomingOnlyTypes.has(type)) {
|
|
59
|
+
const parsed = message_contract_1.stdIncomingMessageSchema.safeParse(message);
|
|
60
|
+
return parsed.success ? parsed.data : message;
|
|
61
|
+
}
|
|
62
|
+
if (outgoingOnlyTypes.has(type)) {
|
|
63
|
+
const parsed = message_contract_1.stdOutgoingMessageSchema.safeParse(message);
|
|
64
|
+
return parsed.success ? parsed.data : message;
|
|
65
|
+
}
|
|
66
|
+
const parsed = messagePayloadSchema.safeParse(message);
|
|
67
|
+
return parsed.success ? parsed.data : message;
|
|
68
|
+
};
|
|
69
|
+
const normalizeMessageRecord = (value) => {
|
|
70
|
+
const normalized = (0, aliases_1.withAliases)(value, messageAliasMap);
|
|
71
|
+
if (typeof normalized !== "object" ||
|
|
72
|
+
normalized === null ||
|
|
73
|
+
!("message" in normalized)) {
|
|
74
|
+
return normalized;
|
|
75
|
+
}
|
|
76
|
+
const record = normalized;
|
|
77
|
+
record.message = parseByDirection(record.message, record);
|
|
78
|
+
return record;
|
|
79
|
+
};
|
|
80
|
+
const messagePayloadSchema = zod_1.z.union([
|
|
81
|
+
message_contract_1.stdIncomingMessageSchema,
|
|
82
|
+
message_contract_1.stdOutgoingMessageSchema,
|
|
83
|
+
]);
|
|
84
|
+
const messageStubObjectSchema = base_1.baseStubSchema.extend({
|
|
85
|
+
mid: zod_1.z.string().optional(),
|
|
86
|
+
message: messagePayloadSchema,
|
|
87
|
+
read: zod_1.z.coerce.boolean(),
|
|
88
|
+
delivery: zod_1.z.coerce.boolean(),
|
|
89
|
+
handover: zod_1.z.coerce.boolean(),
|
|
90
|
+
});
|
|
91
|
+
exports.messageStubSchema = messageStubObjectSchema;
|
|
92
|
+
exports.messageSchema = (0, preprocess_1.preprocess)(normalizeMessageRecord, messageStubObjectSchema.extend({
|
|
93
|
+
sender: (0, preprocess_1.preprocess)((value) => (value == null ? null : (0, aliases_1.asId)(value)), zod_1.z.string().nullable()).optional(),
|
|
94
|
+
recipient: (0, preprocess_1.preprocess)((value) => (value == null ? null : (0, aliases_1.asId)(value)), zod_1.z.string().nullable()).optional(),
|
|
95
|
+
sentBy: (0, preprocess_1.preprocess)((value) => (value == null ? null : (0, aliases_1.asId)(value)), zod_1.z.string().nullable()).optional(),
|
|
96
|
+
thread: (0, preprocess_1.preprocess)((value) => (value == null ? null : (0, aliases_1.asId)(value)), zod_1.z.string()),
|
|
97
|
+
}));
|
|
98
|
+
const messageFullObjectSchema = messageStubObjectSchema.extend({
|
|
99
|
+
sender: subscriber_1.subscriberSchema.nullable().optional(),
|
|
100
|
+
recipient: subscriber_1.subscriberSchema.nullable().optional(),
|
|
101
|
+
sentBy: zod_1.z
|
|
102
|
+
.lazy(() => user_1.userSchema)
|
|
103
|
+
.nullable()
|
|
104
|
+
.optional(),
|
|
105
|
+
thread: thread_1.threadSchema,
|
|
106
|
+
});
|
|
107
|
+
exports.messageFullSchema = (0, preprocess_1.preprocess)(normalizeMessageRecord, messageFullObjectSchema);
|
|
@@ -0,0 +1,122 @@
|
|
|
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.ActionOptionsSchema = exports.fallbackOptionsSchema = exports.contentOptionsSchema = void 0;
|
|
9
|
+
const zod_1 = require("zod");
|
|
10
|
+
const button_1 = require("./button");
|
|
11
|
+
exports.contentOptionsSchema = zod_1.z.object({
|
|
12
|
+
display: zod_1.z.enum(["list", "carousel"]).meta({
|
|
13
|
+
title: "Display",
|
|
14
|
+
}),
|
|
15
|
+
contentType: zod_1.z
|
|
16
|
+
.string()
|
|
17
|
+
.optional()
|
|
18
|
+
.meta({
|
|
19
|
+
title: "Content Type",
|
|
20
|
+
"ui:widget": "AutoCompleteWidget",
|
|
21
|
+
"ui:options": {
|
|
22
|
+
entity: "ContentType",
|
|
23
|
+
valueKey: "id",
|
|
24
|
+
labelKey: "name",
|
|
25
|
+
},
|
|
26
|
+
}),
|
|
27
|
+
fields: zod_1.z
|
|
28
|
+
.object({
|
|
29
|
+
title: zod_1.z.string().meta({
|
|
30
|
+
title: "Title",
|
|
31
|
+
"ui:field": "AutoCompleteField",
|
|
32
|
+
"ui:options": {
|
|
33
|
+
entity: "ContentType",
|
|
34
|
+
idFormPath: "content.contentType",
|
|
35
|
+
nestedArrayField: "schema.properties",
|
|
36
|
+
nestedArrayItemField: "type",
|
|
37
|
+
nestedArrayItemValue: "string",
|
|
38
|
+
},
|
|
39
|
+
}),
|
|
40
|
+
subtitle: zod_1.z
|
|
41
|
+
.string()
|
|
42
|
+
.optional()
|
|
43
|
+
.meta({
|
|
44
|
+
title: "Subtitle",
|
|
45
|
+
"ui:field": "AutoCompleteField",
|
|
46
|
+
"ui:options": {
|
|
47
|
+
entity: "ContentType",
|
|
48
|
+
idFormPath: "content.contentType",
|
|
49
|
+
nestedArrayField: "schema.properties",
|
|
50
|
+
nestedArrayItemField: "type",
|
|
51
|
+
nestedArrayItemValue: "string",
|
|
52
|
+
},
|
|
53
|
+
}),
|
|
54
|
+
image_url: zod_1.z
|
|
55
|
+
.string()
|
|
56
|
+
.optional()
|
|
57
|
+
.meta({
|
|
58
|
+
title: "Image URL Field",
|
|
59
|
+
"ui:field": "AutoCompleteField",
|
|
60
|
+
"ui:options": {
|
|
61
|
+
entity: "ContentType",
|
|
62
|
+
idFormPath: "content.contentType",
|
|
63
|
+
nestedArrayField: "schema.properties",
|
|
64
|
+
nestedArrayItemField: "type",
|
|
65
|
+
nestedArrayItemValue: "file",
|
|
66
|
+
},
|
|
67
|
+
}),
|
|
68
|
+
url: zod_1.z
|
|
69
|
+
.string()
|
|
70
|
+
.optional()
|
|
71
|
+
.meta({
|
|
72
|
+
title: "URL",
|
|
73
|
+
"ui:field": "AutoCompleteField",
|
|
74
|
+
"ui:options": {
|
|
75
|
+
showOnlyWhenWebUrlButton: true,
|
|
76
|
+
entity: "ContentType",
|
|
77
|
+
valueKey: "name",
|
|
78
|
+
idFormPath: "content.contentType",
|
|
79
|
+
nestedArrayField: "schema.properties",
|
|
80
|
+
nestedArrayItemField: "type",
|
|
81
|
+
nestedArrayItemValue: "uri",
|
|
82
|
+
},
|
|
83
|
+
}),
|
|
84
|
+
action_title: zod_1.z
|
|
85
|
+
.string()
|
|
86
|
+
.optional()
|
|
87
|
+
.meta({
|
|
88
|
+
title: "Action Title",
|
|
89
|
+
"ui:options": {
|
|
90
|
+
showOnlyWhenPostbackButton: true,
|
|
91
|
+
},
|
|
92
|
+
}),
|
|
93
|
+
action_payload: zod_1.z
|
|
94
|
+
.string()
|
|
95
|
+
.optional()
|
|
96
|
+
.meta({
|
|
97
|
+
title: "Action Payload",
|
|
98
|
+
"ui:options": {
|
|
99
|
+
showOnlyWhenPostbackButton: true,
|
|
100
|
+
},
|
|
101
|
+
}),
|
|
102
|
+
})
|
|
103
|
+
.meta({ title: "Fields" }),
|
|
104
|
+
buttons: zod_1.z.array(button_1.buttonSchema).meta({ title: "Buttons" }),
|
|
105
|
+
limit: zod_1.z.number().finite(),
|
|
106
|
+
query: zod_1.z.any().optional(),
|
|
107
|
+
top_element_style: zod_1.z.enum(["large", "compact"]).optional().meta({
|
|
108
|
+
title: "Top Element Style",
|
|
109
|
+
}),
|
|
110
|
+
});
|
|
111
|
+
exports.fallbackOptionsSchema = zod_1.z.object({
|
|
112
|
+
active: zod_1.z.boolean(),
|
|
113
|
+
message: zod_1.z.array(zod_1.z.string()),
|
|
114
|
+
max_attempts: zod_1.z.number().finite(),
|
|
115
|
+
});
|
|
116
|
+
exports.ActionOptionsSchema = zod_1.z.object({
|
|
117
|
+
typing: zod_1.z.union([zod_1.z.boolean(), zod_1.z.int().nonnegative()]).optional(),
|
|
118
|
+
content: exports.contentOptionsSchema.optional(),
|
|
119
|
+
fallback: exports.fallbackOptionsSchema.optional(),
|
|
120
|
+
assignTo: zod_1.z.string().optional(),
|
|
121
|
+
effects: zod_1.z.array(zod_1.z.string()).optional(),
|
|
122
|
+
});
|
|
@@ -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.stdQuickReplySchema = exports.payloadSchema = exports.coordinatesSchema = void 0;
|
|
9
|
+
const zod_1 = require("zod");
|
|
10
|
+
const attachment_1 = require("./attachment");
|
|
11
|
+
const button_1 = require("./button");
|
|
12
|
+
exports.coordinatesSchema = zod_1.z.object({
|
|
13
|
+
lat: zod_1.z.number(),
|
|
14
|
+
lon: zod_1.z.number(),
|
|
15
|
+
});
|
|
16
|
+
exports.payloadSchema = zod_1.z.discriminatedUnion("type", [
|
|
17
|
+
zod_1.z.object({
|
|
18
|
+
type: zod_1.z.literal(button_1.PayloadType.location),
|
|
19
|
+
coordinates: exports.coordinatesSchema,
|
|
20
|
+
}),
|
|
21
|
+
zod_1.z.object({
|
|
22
|
+
type: zod_1.z.literal(button_1.PayloadType.attachment),
|
|
23
|
+
attachment: attachment_1.attachmentPayloadSchema,
|
|
24
|
+
}),
|
|
25
|
+
]);
|
|
26
|
+
exports.stdQuickReplySchema = zod_1.z.object({
|
|
27
|
+
title: zod_1.z.string().meta({
|
|
28
|
+
title: "Title",
|
|
29
|
+
description: "The label shown to the user.",
|
|
30
|
+
}),
|
|
31
|
+
payload: zod_1.z.string().meta({
|
|
32
|
+
title: "Payload",
|
|
33
|
+
description: "The value sent back when the quick reply is selected.",
|
|
34
|
+
}),
|
|
35
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
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.subscriberFullSchema = exports.subscriberSchema = exports.subscriberStubSchema = void 0;
|
|
9
|
+
const zod_1 = require("zod");
|
|
10
|
+
const attachment_1 = require("../attachment/attachment");
|
|
11
|
+
const source_1 = require("../channel/source");
|
|
12
|
+
const aliases_1 = require("../shared/aliases");
|
|
13
|
+
const preprocess_1 = require("../shared/preprocess");
|
|
14
|
+
const profile_1 = require("../shared/profile");
|
|
15
|
+
const user_profile_assigned_1 = require("../user/user-profile-assigned");
|
|
16
|
+
const label_1 = require("./label");
|
|
17
|
+
const subscriberAliasMap = {
|
|
18
|
+
labelIds: "labels",
|
|
19
|
+
assignedToId: "assignedTo",
|
|
20
|
+
avatarId: "avatar",
|
|
21
|
+
sourceId: "source",
|
|
22
|
+
};
|
|
23
|
+
const subscriberObjectSchema = 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
|
+
avatar: (0, preprocess_1.preprocess)((value) => (value == null ? null : (0, aliases_1.asId)(value)), zod_1.z.string().nullable()),
|
|
27
|
+
source: (0, preprocess_1.preprocess)((value) => (value == null ? null : (0, aliases_1.asId)(value)), zod_1.z.string().nullable()),
|
|
28
|
+
});
|
|
29
|
+
exports.subscriberStubSchema = profile_1.subscriberBaseSchema;
|
|
30
|
+
exports.subscriberSchema = (0, preprocess_1.preprocess)((value) => (0, aliases_1.withAliases)(value, subscriberAliasMap), subscriberObjectSchema);
|
|
31
|
+
exports.subscriberFullSchema = profile_1.subscriberBaseSchema.extend({
|
|
32
|
+
labels: (0, preprocess_1.preprocess)((value) => (Array.isArray(value) ? value : []), zod_1.z.array(zod_1.z.lazy(() => label_1.labelSchema))),
|
|
33
|
+
assignedTo: (0, preprocess_1.preprocess)((value) => (value == null ? null : value), user_profile_assigned_1.userProfileAssignedSchema.nullable()),
|
|
34
|
+
avatar: (0, preprocess_1.preprocess)((value) => (value == null ? null : value), attachment_1.attachmentSchema.nullable()),
|
|
35
|
+
source: (0, preprocess_1.preprocess)((value) => (value == null ? null : value), source_1.sourceSchema.nullable()),
|
|
36
|
+
});
|