@hexabot-ai/api 3.2.2-alpha.0 → 3.2.2-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/actions.service.d.ts +3 -3
- package/dist/actions/base-action.d.ts +3 -3
- package/dist/actions/create-action.d.ts +1 -1
- package/dist/actions/types.d.ts +3 -3
- package/dist/analytics/controllers/stats.controller.d.ts +1 -1
- package/dist/analytics/dto/stats.dto.d.ts +1 -1
- package/dist/analytics/entities/stats.entity.d.ts +1 -1
- package/dist/analytics/repositories/stats.repository.d.ts +1 -1
- package/dist/analytics/services/stats.service.d.ts +7 -7
- package/dist/attachment/controllers/attachment.controller.d.ts +1 -1
- package/dist/attachment/dto/attachment.dto.d.ts +2 -2
- package/dist/attachment/entities/attachment.entity.d.ts +3 -3
- package/dist/attachment/guards/attachment-ability.guard.d.ts +2 -2
- package/dist/attachment/repositories/attachment.repository.d.ts +2 -2
- package/dist/attachment/services/attachment.service.d.ts +3 -3
- package/dist/attachment/utilities/index.js +2 -2
- package/dist/attachment/utilities/index.js.map +1 -1
- package/dist/audit/controllers/audit-log.controller.d.ts +2 -2
- package/dist/audit/dto/audit-log.dto.d.ts +1 -1
- package/dist/audit/entities/audit-log.entity.d.ts +1 -1
- package/dist/audit/exporters/audit-backend.factory.d.ts +1 -1
- package/dist/audit/exporters/audit-safe.exporter.d.ts +1 -1
- package/dist/audit/repositories/audit-log.repository.d.ts +1 -1
- package/dist/audit/services/audit-log-record.service.d.ts +1 -1
- package/dist/bindings/base-binding-kind.d.ts +2 -2
- package/dist/bindings/runtime-bindings.service.d.ts +2 -2
- package/dist/bootstrap.js +8 -0
- package/dist/bootstrap.js.map +1 -1
- package/dist/channel/channel.controller.d.ts +1 -1
- package/dist/channel/channel.service.d.ts +5 -5
- package/dist/channel/dto/source.dto.d.ts +1 -1
- package/dist/channel/entities/source.entity.d.ts +2 -2
- package/dist/channel/lib/Handler.d.ts +7 -7
- package/dist/channel/lib/Handler.js +2 -2
- package/dist/channel/lib/Handler.js.map +1 -1
- package/dist/channel/lib/channel-event-bus.d.ts +1 -1
- package/dist/channel/lib/inbound-events/channel-inbound-event-context.d.ts +1 -1
- package/dist/channel/lib/inbound-events/channel-inbound-event-decoder.d.ts +1 -1
- package/dist/channel/lib/inbound-events/channel-inbound-event.d.ts +2 -2
- package/dist/channel/lib/inbound-events/message-inbound-event.d.ts +1 -1
- package/dist/channel/lib/transports/http-channel-handler.d.ts +2 -2
- package/dist/channel/lib/transports/websocket-channel-handler.d.ts +3 -3
- package/dist/channel/repositories/source.repository.d.ts +1 -1
- package/dist/channel/services/channel-attachment.service.d.ts +3 -3
- package/dist/channel/services/source.service.d.ts +3 -3
- package/dist/channel/services/subscriber-resolver.service.d.ts +2 -2
- package/dist/channel/source.controller.d.ts +1 -1
- package/dist/channel/webhook.controller.d.ts +1 -1
- package/dist/chat/chat.module.js +1 -1
- package/dist/chat/chat.module.js.map +1 -1
- package/dist/chat/controllers/label-group.controller.d.ts +1 -1
- package/dist/chat/controllers/label.controller.d.ts +1 -1
- package/dist/chat/controllers/message.controller.d.ts +2 -2
- package/dist/chat/controllers/subscriber.controller.d.ts +3 -3
- package/dist/chat/controllers/thread.controller.d.ts +2 -2
- package/dist/chat/dto/label-group.dto.d.ts +1 -1
- package/dist/chat/dto/label.dto.d.ts +1 -1
- package/dist/chat/dto/message.dto.d.ts +1 -1
- package/dist/chat/dto/subscriber.dto.d.ts +3 -3
- package/dist/chat/dto/thread.dto.d.ts +1 -1
- package/dist/chat/entities/label-group.entity.d.ts +1 -1
- package/dist/chat/entities/label.entity.d.ts +1 -1
- package/dist/chat/entities/message.entity.d.ts +2 -2
- package/dist/chat/entities/subscriber.entity.d.ts +4 -4
- package/dist/chat/entities/subscriber.entity.js +3 -1
- package/dist/chat/entities/subscriber.entity.js.map +1 -1
- package/dist/chat/entities/thread.entity.d.ts +2 -2
- package/dist/chat/repositories/label-group.repository.d.ts +1 -1
- package/dist/chat/repositories/label.repository.d.ts +1 -1
- package/dist/chat/repositories/message.repository.d.ts +1 -1
- package/dist/chat/repositories/subscriber.repository.d.ts +1 -1
- package/dist/chat/repositories/thread.repository.d.ts +1 -1
- package/dist/chat/services/chat.service.d.ts +4 -4
- package/dist/chat/services/label-group.service.d.ts +1 -1
- package/dist/chat/services/label.service.d.ts +1 -1
- package/dist/chat/services/message.service.d.ts +2 -2
- package/dist/chat/services/subscriber.service.d.ts +5 -5
- package/dist/chat/services/subscriber.service.js +2 -2
- package/dist/chat/services/subscriber.service.js.map +1 -1
- package/dist/chat/services/thread.service.d.ts +2 -2
- package/dist/chat/types/channel.d.ts +1 -1
- package/dist/cms/controllers/content-type.controller.d.ts +1 -1
- package/dist/cms/controllers/content.controller.d.ts +1 -1
- package/dist/cms/controllers/menu.controller.d.ts +2 -2
- package/dist/cms/dto/content.dto.d.ts +1 -1
- package/dist/cms/dto/contentType.dto.d.ts +2 -2
- package/dist/cms/dto/menu.dto.d.ts +1 -1
- package/dist/cms/entities/content-type.entity.d.ts +2 -2
- package/dist/cms/entities/content-type.entity.js +3 -2
- package/dist/cms/entities/content-type.entity.js.map +1 -1
- package/dist/cms/entities/content.entity.d.ts +2 -2
- package/dist/cms/entities/content.entity.js +4 -3
- package/dist/cms/entities/content.entity.js.map +1 -1
- package/dist/cms/entities/menu.entity.d.ts +1 -1
- package/dist/cms/repositories/content-type.repository.d.ts +1 -1
- package/dist/cms/repositories/content.repository.d.ts +1 -1
- package/dist/cms/repositories/menu.repository.d.ts +1 -1
- package/dist/cms/services/content-type.service.d.ts +2 -2
- package/dist/cms/services/content.service.d.ts +1 -1
- package/dist/cms/services/menu.service.d.ts +1 -1
- package/dist/cms/services/rag-backend.service.d.ts +2 -2
- package/dist/cms/services/rag-indexer.service.d.ts +2 -2
- package/dist/cms/services/rag-retriever.service.d.ts +1 -1
- package/dist/cms/services/rag.service.d.ts +4 -4
- package/dist/database/entities/base.entity.d.ts +1 -1
- package/dist/extension/cleanup.service.d.ts +3 -3
- package/dist/extension/extension.module.d.ts +1 -1
- package/dist/extension/types.d.ts +1 -1
- package/dist/extensions/actions/ai/agent.action.d.ts +3 -3
- package/dist/extensions/actions/ai/ai-base.action.d.ts +5 -5
- package/dist/extensions/actions/ai/generate-object.action.d.ts +2 -2
- package/dist/extensions/actions/ai/generate-object.base.action.d.ts +3 -3
- package/dist/extensions/actions/ai/generate-reply.action.d.ts +2 -2
- package/dist/extensions/actions/ai/generate-text.action.d.ts +2 -2
- package/dist/extensions/actions/ai/generate-text.base.action.d.ts +3 -3
- package/dist/extensions/actions/ai/infer-object.action.d.ts +2 -2
- package/dist/extensions/actions/ai/retrieve-content-rag.action.d.ts +1 -1
- package/dist/extensions/actions/memory/update-memory.action.d.ts +4 -4
- package/dist/extensions/actions/messaging/attachment.action.d.ts +3 -3
- package/dist/extensions/actions/messaging/await-reply.action.d.ts +4 -4
- package/dist/extensions/actions/messaging/buttons.action.d.ts +3 -3
- package/dist/extensions/actions/messaging/list.action.d.ts +3 -3
- package/dist/extensions/actions/messaging/message-action.base.d.ts +6 -6
- package/dist/extensions/actions/messaging/quick-replies.action.d.ts +3 -3
- package/dist/extensions/actions/messaging/text-message.action.d.ts +3 -3
- package/dist/extensions/actions/subscriber/handover.action.d.ts +1 -1
- package/dist/extensions/actions/subscriber/update-labels.action.d.ts +1 -1
- package/dist/extensions/actions/web/http-request.action.d.ts +1 -1
- package/dist/extensions/actions/web/http-request.action.js +15 -4
- package/dist/extensions/actions/web/http-request.action.js.map +1 -1
- package/dist/extensions/actions/web/i18n/en.translations.json +9 -0
- package/dist/extensions/actions/web/i18n/fr.translations.json +9 -0
- package/dist/extensions/actions/web/send-mail.action.d.ts +30 -0
- package/dist/extensions/actions/web/send-mail.action.js +79 -0
- package/dist/extensions/actions/web/send-mail.action.js.map +1 -0
- package/dist/extensions/channels/web/base-web-channel.d.ts +6 -6
- package/dist/extensions/channels/web/base-web-channel.js +2 -2
- package/dist/extensions/channels/web/base-web-channel.js.map +1 -1
- package/dist/extensions/channels/web/inbound/events/base-web-inbound.event.d.ts +3 -3
- package/dist/extensions/channels/web/inbound/events/delivery.event.d.ts +2 -2
- package/dist/extensions/channels/web/inbound/events/messages/attachment.event.d.ts +2 -2
- package/dist/extensions/channels/web/inbound/events/messages/location.event.d.ts +2 -2
- package/dist/extensions/channels/web/inbound/events/messages/payload.event.d.ts +2 -2
- package/dist/extensions/channels/web/inbound/events/messages/postback.event.d.ts +2 -2
- package/dist/extensions/channels/web/inbound/events/messages/quick-reply.event.d.ts +2 -2
- package/dist/extensions/channels/web/inbound/events/messages/text.event.d.ts +2 -2
- package/dist/extensions/channels/web/inbound/events/messages/web-message.event.d.ts +3 -3
- package/dist/extensions/channels/web/inbound/events/read.event.d.ts +2 -2
- package/dist/extensions/channels/web/inbound/events/typing.event.d.ts +2 -2
- package/dist/extensions/channels/web/inbound/events/unsupported.event.d.ts +2 -2
- package/dist/extensions/channels/web/inbound/web-inbound-event-decoder.d.ts +2 -2
- package/dist/extensions/channels/web/inbound/web-inbound-message-encoder.d.ts +1 -1
- package/dist/extensions/channels/web/outbound/web-outbound-message-encoder.d.ts +4 -4
- package/dist/extensions/channels/web/services/web-history.service.d.ts +2 -2
- package/dist/extensions/channels/web/services/web-session.service.d.ts +6 -6
- package/dist/extensions/helpers/local-storage/index.helper.d.ts +2 -2
- package/dist/extensions/index.d.ts +1 -0
- package/dist/extensions/index.js +1 -0
- package/dist/extensions/index.js.map +1 -1
- package/dist/health/health.service.d.ts +3 -3
- package/dist/helper/helper.service.d.ts +2 -2
- package/dist/helper/lib/base-helper.d.ts +2 -2
- package/dist/helper/lib/base-storage-helper.d.ts +1 -1
- package/dist/helper/types.d.ts +1 -1
- package/dist/i18n/controllers/language.controller.d.ts +1 -1
- package/dist/i18n/controllers/translation.controller.d.ts +1 -1
- package/dist/i18n/dto/language.dto.d.ts +1 -1
- package/dist/i18n/dto/translation.dto.d.ts +1 -1
- package/dist/i18n/entities/language.entity.d.ts +1 -1
- package/dist/i18n/entities/translation.entity.d.ts +1 -1
- package/dist/i18n/repositories/language.repository.d.ts +1 -1
- package/dist/i18n/repositories/translation.repository.d.ts +1 -1
- package/dist/i18n/seeds/language.seed.d.ts +1 -1
- package/dist/i18n/seeds/translation.seed.d.ts +1 -1
- package/dist/i18n/services/i18n.service.d.ts +2 -2
- package/dist/i18n/services/language.service.d.ts +1 -1
- package/dist/i18n/services/translation.service.d.ts +3 -3
- package/dist/license/services/lemon-squeezy.service.js +2 -2
- package/dist/license/services/lemon-squeezy.service.js.map +1 -1
- package/dist/license/services/license.service.d.ts +5 -5
- package/dist/mailer/mailer.module.js +1 -49
- package/dist/mailer/mailer.module.js.map +1 -1
- package/dist/mailer/mailer.service.d.ts +11 -2
- package/dist/mailer/mailer.service.js +69 -3
- package/dist/mailer/mailer.service.js.map +1 -1
- package/dist/migration/migration.command.d.ts +1 -1
- package/dist/migration/migration.service.d.ts +3 -3
- package/dist/migration/types.d.ts +2 -2
- package/dist/setting/base-setting-group.d.ts +2 -2
- package/dist/setting/controllers/setting.controller.d.ts +1 -1
- package/dist/setting/create-setting-group.d.ts +2 -2
- package/dist/setting/dto/metadata.dto.d.ts +1 -1
- package/dist/setting/dto/setting.dto.d.ts +1 -1
- package/dist/setting/entities/metadata.entity.d.ts +1 -1
- package/dist/setting/entities/setting.entity.d.ts +1 -1
- package/dist/setting/repositories/metadata.repository.d.ts +1 -1
- package/dist/setting/repositories/setting.repository.d.ts +1 -1
- package/dist/setting/runtime-settings.seed.d.ts +3 -3
- package/dist/setting/seeds/metadata.seed.d.ts +1 -1
- package/dist/setting/seeds/setting.seed.d.ts +1 -1
- package/dist/setting/services/metadata.service.d.ts +1 -1
- package/dist/setting/services/runtime-settings.service.d.ts +1 -1
- package/dist/setting/services/setting.service.d.ts +4 -4
- package/dist/static/assets/browser-ponyfill-BHrZk0Ba.js +2 -0
- package/dist/static/assets/{cssMode-Cl7JZDYi.js → cssMode-BMhPv6LQ.js} +1 -1
- package/dist/static/assets/{freemarker2-Ddcsv82z.js → freemarker2-BeZMhdTv.js} +1 -1
- package/dist/static/assets/{handlebars-BggcQSEE.js → handlebars-BKG3g2Ua.js} +1 -1
- package/dist/static/assets/{html-FN76dqvq.js → html-DGzTITbD.js} +1 -1
- package/dist/static/assets/{htmlMode-BWRIcbsi.js → htmlMode-BqkaqtYx.js} +1 -1
- package/dist/static/assets/{index-DKozh3Um.css → index-BI1BtkYv.css} +1 -1
- package/dist/static/assets/{index-DOga3_TI.js → index-BZ6XUYgl.js} +2136 -2133
- package/dist/static/assets/{javascript-1EusMo1M.js → javascript-b5wI9R64.js} +1 -1
- package/dist/static/assets/{jsonMode-WNbHOGWa.js → jsonMode-CHkAHll-.js} +1 -1
- package/dist/static/assets/{liquid-D45yUZ7g.js → liquid-DWtcf_ol.js} +1 -1
- package/dist/static/assets/{lspLanguageFeatures-uwS-CJEU.js → lspLanguageFeatures-CogY5n0Q.js} +1 -1
- package/dist/static/assets/{mdx-PpOJ5pZ0.js → mdx-Bahv9Yam.js} +1 -1
- package/dist/static/assets/{python-B3PwxkAn.js → python-BMSmNQlB.js} +1 -1
- package/dist/static/assets/{razor-D0t-tcQz.js → razor-gQN4hgMu.js} +1 -1
- package/dist/static/assets/{tsMode-DEMWhFCv.js → tsMode-lBRxNuK8.js} +1 -1
- package/dist/static/assets/{typescript-DUe9LVDn.js → typescript-BIY26e43.js} +1 -1
- package/dist/static/assets/{xml-Dqap22Hx.js → xml-CU3COlzI.js} +1 -1
- package/dist/static/assets/{yaml-Suu2-EtH.js → yaml-Bu2tB__J.js} +1 -1
- package/dist/static/assets/{yaml.worker.entry-BdO9k22I.js → yaml.worker.entry-BB81z30Q.js} +228 -228
- package/dist/static/index.html +2 -2
- package/dist/static/locales/en/translation.json +6 -1
- package/dist/static/locales/fr/translation.json +6 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/user/controllers/auth.controller.d.ts +2 -2
- package/dist/user/controllers/credential.controller.d.ts +1 -1
- package/dist/user/controllers/model.controller.d.ts +3 -3
- package/dist/user/controllers/permission.controller.d.ts +2 -2
- package/dist/user/controllers/role.controller.d.ts +1 -1
- package/dist/user/controllers/user.controller.d.ts +3 -3
- package/dist/user/dto/credential.dto.d.ts +1 -1
- package/dist/user/dto/model.dto.d.ts +1 -1
- package/dist/user/dto/permission.dto.d.ts +1 -1
- package/dist/user/dto/role.dto.d.ts +1 -1
- package/dist/user/dto/user-profile.dto.d.ts +1 -1
- package/dist/user/dto/user.dto.d.ts +2 -2
- package/dist/user/entities/credential.entity.d.ts +1 -1
- package/dist/user/entities/model.entity.d.ts +2 -2
- package/dist/user/entities/model.entity.js +4 -3
- package/dist/user/entities/model.entity.js.map +1 -1
- package/dist/user/entities/permission.entity.d.ts +3 -3
- package/dist/user/entities/permission.entity.js +7 -7
- package/dist/user/entities/permission.entity.js.map +1 -1
- package/dist/user/entities/role.entity.d.ts +2 -2
- package/dist/user/entities/role.entity.js +3 -2
- package/dist/user/entities/role.entity.js.map +1 -1
- package/dist/user/entities/user-profile.entity.d.ts +3 -3
- package/dist/user/entities/user.entity.d.ts +1 -1
- package/dist/user/repositories/credential.repository.d.ts +1 -1
- package/dist/user/repositories/model.repository.d.ts +1 -1
- package/dist/user/repositories/permission.repository.d.ts +1 -1
- package/dist/user/repositories/role.repository.d.ts +1 -1
- package/dist/user/repositories/user.repository.d.ts +1 -1
- package/dist/user/seeds/model.seed.d.ts +1 -1
- package/dist/user/seeds/permission.seed.d.ts +1 -1
- package/dist/user/seeds/role.seed.d.ts +1 -1
- package/dist/user/seeds/user.seed.d.ts +1 -1
- package/dist/user/services/credential.service.d.ts +1 -1
- package/dist/user/services/model.service.d.ts +1 -1
- package/dist/user/services/passwordReset.service.d.ts +4 -4
- package/dist/user/services/permission.service.d.ts +1 -1
- package/dist/user/services/role.service.d.ts +1 -1
- package/dist/user/services/user.service.d.ts +1 -1
- package/dist/user/services/validate-account.service.d.ts +4 -4
- package/dist/utils/decorators/roles.decorator.d.ts +1 -1
- package/dist/utils/generics/base-orm.controller.d.ts +2 -2
- package/dist/utils/generics/base-orm.repository.d.ts +2 -2
- package/dist/utils/generics/base-orm.seeder.d.ts +1 -1
- package/dist/utils/generics/base-orm.service.d.ts +2 -2
- package/dist/utils/generics/extension.d.ts +3 -4
- package/dist/utils/generics/extension.js.map +1 -1
- package/dist/utils/helpers/safe-property-path.d.ts +1 -0
- package/dist/utils/helpers/safe-property-path.js +12 -0
- package/dist/utils/helpers/safe-property-path.js.map +1 -0
- package/dist/utils/helpers/zod.d.ts +1 -1
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.js +0 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/pipes/typeorm-search-filter.pipe.js +4 -3
- package/dist/utils/pipes/typeorm-search-filter.pipe.js.map +1 -1
- package/dist/utils/pipes/uuid.pipe.js +3 -3
- package/dist/utils/pipes/uuid.pipe.js.map +1 -1
- package/dist/utils/test/dummy/controllers/dummy.controller.d.ts +1 -1
- package/dist/utils/test/dummy/dto/dummy.dto.d.ts +1 -1
- package/dist/utils/test/dummy/dummy.action.d.ts +1 -1
- package/dist/utils/test/dummy/entities/dummy.entity.d.ts +1 -1
- package/dist/utils/test/dummy/repositories/dummy.repository.d.ts +1 -1
- package/dist/utils/test/dummy/services/dummy.service.d.ts +1 -1
- package/dist/utils/test/fixtures/attachment.d.ts +1 -1
- package/dist/utils/test/fixtures/content.d.ts +2 -2
- package/dist/utils/test/fixtures/contenttype.d.ts +2 -2
- package/dist/utils/test/fixtures/contenttype.js +2 -2
- package/dist/utils/test/fixtures/contenttype.js.map +1 -1
- package/dist/utils/test/fixtures/dummy.d.ts +2 -2
- package/dist/utils/test/fixtures/label-group.d.ts +3 -3
- package/dist/utils/test/fixtures/label.d.ts +2 -2
- package/dist/utils/test/fixtures/language.d.ts +2 -2
- package/dist/utils/test/fixtures/mcp-server.d.ts +3 -3
- package/dist/utils/test/fixtures/memory-definition.d.ts +2 -2
- package/dist/utils/test/fixtures/memory-record.d.ts +2 -2
- package/dist/utils/test/fixtures/menu.d.ts +1 -1
- package/dist/utils/test/fixtures/message.d.ts +1 -1
- package/dist/utils/test/fixtures/migration.d.ts +1 -1
- package/dist/utils/test/fixtures/model.d.ts +2 -2
- package/dist/utils/test/fixtures/permission.d.ts +4 -4
- package/dist/utils/test/fixtures/role.d.ts +2 -2
- package/dist/utils/test/fixtures/setting.d.ts +1 -1
- package/dist/utils/test/fixtures/stats.d.ts +1 -1
- package/dist/utils/test/fixtures/subscriber.d.ts +4 -4
- package/dist/utils/test/fixtures/translation.d.ts +1 -1
- package/dist/utils/test/fixtures/user.d.ts +2 -2
- package/dist/utils/test/fixtures/workflow-run.d.ts +2 -2
- package/dist/utils/test/fixtures/workflow.d.ts +2 -2
- package/dist/utils/test/providers/i18n-service.provider.d.ts +1 -1
- package/dist/utils/test/providers/mailer-service.provider.d.ts +3 -3
- package/dist/utils/test/providers/setting-service.provider.d.ts +1 -1
- package/dist/utils/test/test.d.ts +4 -0
- package/dist/utils/test/test.js +34 -1
- package/dist/utils/test/test.js.map +1 -1
- package/dist/utils/test/types.d.ts +1 -1
- package/dist/utils/test/utils.d.ts +2 -1
- package/dist/utils/test/utils.js +181 -41
- package/dist/utils/test/utils.js.map +1 -1
- package/dist/utils/types/dto.types.d.ts +1 -1
- package/dist/utils/types/entity-event.types.d.ts +1 -1
- package/dist/websocket/services/socket-event-dispatcher.service.d.ts +1 -1
- package/dist/websocket/websocket.gateway.d.ts +6 -6
- package/dist/websocket/websocket.gateway.js +2 -2
- package/dist/websocket/websocket.gateway.js.map +1 -1
- package/dist/workflow/contexts/conversational-workflow.context.d.ts +1 -1
- package/dist/workflow/contexts/workflow-runtime.context.d.ts +10 -10
- package/dist/workflow/controllers/mcp-server.controller.d.ts +1 -1
- package/dist/workflow/controllers/memory-definition.controller.d.ts +1 -1
- package/dist/workflow/controllers/workflow-run.controller.d.ts +1 -1
- package/dist/workflow/controllers/workflow-version.controller.d.ts +1 -1
- package/dist/workflow/controllers/workflow.controller.d.ts +4 -4
- package/dist/workflow/dto/mcp-server.dto.d.ts +1 -1
- package/dist/workflow/dto/memory-definition.dto.d.ts +1 -1
- package/dist/workflow/dto/memory-record.dto.d.ts +1 -1
- package/dist/workflow/dto/workflow-run.dto.d.ts +1 -1
- package/dist/workflow/dto/workflow-version.dto.d.ts +1 -1
- package/dist/workflow/dto/workflow.dto.d.ts +1 -1
- package/dist/workflow/entities/mcp-server.entity.d.ts +2 -2
- package/dist/workflow/entities/memory-definition.entity.d.ts +1 -1
- package/dist/workflow/entities/memory-record.entity.d.ts +4 -4
- package/dist/workflow/entities/workflow-run.entity.d.ts +4 -4
- package/dist/workflow/entities/workflow-version.entity.d.ts +3 -3
- package/dist/workflow/entities/workflow-version.entity.js +6 -4
- package/dist/workflow/entities/workflow-version.entity.js.map +1 -1
- package/dist/workflow/entities/workflow.entity.d.ts +2 -2
- package/dist/workflow/lib/trigger-event-wrapper.d.ts +1 -1
- package/dist/workflow/repositories/mcp-server.repository.d.ts +1 -1
- package/dist/workflow/repositories/memory-definition.repository.d.ts +1 -1
- package/dist/workflow/repositories/memory-record.repository.d.ts +1 -1
- package/dist/workflow/repositories/workflow-run.repository.d.ts +1 -1
- package/dist/workflow/repositories/workflow-version.repository.d.ts +1 -1
- package/dist/workflow/repositories/workflow.repository.d.ts +1 -1
- package/dist/workflow/seeds/memory-definition.seed.d.ts +1 -1
- package/dist/workflow/seeds/workflow.seed.d.ts +1 -1
- package/dist/workflow/services/agentic.service.d.ts +4 -4
- package/dist/workflow/services/mcp-client-pool.service.d.ts +2 -2
- package/dist/workflow/services/mcp-server.service.d.ts +1 -1
- package/dist/workflow/services/memory-definition.service.d.ts +1 -1
- package/dist/workflow/services/memory-record.service.d.ts +1 -1
- package/dist/workflow/services/memory.service.js +1 -0
- package/dist/workflow/services/memory.service.js.map +1 -1
- package/dist/workflow/services/workflow-run.service.d.ts +1 -1
- package/dist/workflow/services/workflow-scheduler.service.d.ts +3 -3
- package/dist/workflow/services/workflow-version.service.d.ts +1 -1
- package/dist/workflow/services/workflow.service.d.ts +3 -3
- package/dist/workflow/utils/memory-store.js +12 -1
- package/dist/workflow/utils/memory-store.js.map +1 -1
- package/package.json +63 -32
- package/src/attachment/utilities/index.ts +2 -2
- package/src/bootstrap.ts +10 -1
- package/src/channel/lib/Handler.ts +3 -2
- package/src/chat/chat.module.ts +1 -1
- package/src/chat/entities/subscriber.entity.ts +14 -7
- package/src/chat/services/subscriber.service.ts +3 -2
- package/src/cms/entities/content-type.entity.ts +12 -4
- package/src/cms/entities/content.entity.ts +13 -5
- package/src/extensions/actions/web/http-request.action.ts +23 -4
- package/src/extensions/actions/web/i18n/en.translations.json +9 -0
- package/src/extensions/actions/web/i18n/fr.translations.json +9 -0
- package/src/extensions/actions/web/send-mail.action.ts +89 -0
- package/src/extensions/channels/web/base-web-channel.ts +3 -2
- package/src/extensions/index.ts +2 -0
- package/src/global.d.ts +0 -6
- package/src/license/services/lemon-squeezy.service.ts +3 -2
- package/src/mailer/mailer.module.ts +1 -54
- package/src/mailer/mailer.service.ts +86 -2
- package/src/user/entities/model.entity.ts +13 -5
- package/src/user/entities/permission.entity.ts +21 -9
- package/src/user/entities/role.entity.ts +12 -4
- package/src/utils/generics/extension.ts +1 -3
- package/src/utils/helpers/safe-property-path.ts +13 -0
- package/src/utils/index.ts +0 -2
- package/src/utils/pipes/typeorm-search-filter.pipe.ts +4 -3
- package/src/utils/pipes/uuid.pipe.ts +3 -3
- package/src/utils/test/fixtures/contenttype.ts +1 -1
- package/src/utils/test/test.ts +39 -0
- package/src/utils/test/utils.ts +278 -52
- package/src/websocket/websocket.gateway.ts +2 -2
- package/src/workflow/entities/workflow-version.entity.ts +8 -3
- package/src/workflow/services/memory.service.ts +1 -0
- package/src/workflow/utils/memory-store.ts +13 -1
- package/dist/mailer/mjml-adapter.class.d.ts +0 -4
- package/dist/mailer/mjml-adapter.class.js +0 -67
- package/dist/mailer/mjml-adapter.class.js.map +0 -1
- package/dist/utils/types/extension.d.ts +0 -4
- package/dist/utils/types/extension.js +0 -3
- package/dist/utils/types/extension.js.map +0 -1
- package/src/mailer/mjml-adapter.class.ts +0 -41
- package/src/utils/types/extension.ts +0 -13
package/src/bootstrap.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Full terms: see LICENSE.md.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { Type, ValidationPipe } from '@nestjs/common';
|
|
7
|
+
import { ConsoleLogger, Logger, Type, ValidationPipe } from '@nestjs/common';
|
|
8
8
|
import { NestFactory } from '@nestjs/core';
|
|
9
9
|
import type { NestExpressApplication } from '@nestjs/platform-express';
|
|
10
10
|
import bodyParser from 'body-parser';
|
|
@@ -25,6 +25,12 @@ moduleAlias.addAliases({
|
|
|
25
25
|
'@': __dirname,
|
|
26
26
|
});
|
|
27
27
|
|
|
28
|
+
class HexabotBootstrapLogger extends ConsoleLogger {
|
|
29
|
+
override log(message: unknown, context?: string) {
|
|
30
|
+
super.log(message, context === 'NestApplication' ? 'Hexabot' : context);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
28
34
|
const rawBodyBuffer = (req, res, buf, encoding) => {
|
|
29
35
|
if (buf?.length) {
|
|
30
36
|
req.rawBody = buf.toString(encoding || 'utf8');
|
|
@@ -54,6 +60,7 @@ export async function createHexabotApplication<
|
|
|
54
60
|
await resolveDynamicProviders();
|
|
55
61
|
const app = await NestFactory.create<TApp>(moduleRef, {
|
|
56
62
|
bodyParser: false,
|
|
63
|
+
logger: new HexabotBootstrapLogger(),
|
|
57
64
|
});
|
|
58
65
|
|
|
59
66
|
app.set('query parser', 'extended');
|
|
@@ -134,6 +141,8 @@ export async function bootstrapHexabotApp(
|
|
|
134
141
|
const host = options.listen?.host ?? '0.0.0.0';
|
|
135
142
|
|
|
136
143
|
await app.listen(port, host);
|
|
144
|
+
const appUrl = await app.getUrl();
|
|
145
|
+
Logger.log(`Hexabot is running at ${appUrl}`, 'Hexabot');
|
|
137
146
|
|
|
138
147
|
return app;
|
|
139
148
|
}
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* Full terms: see LICENSE.md.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import { randomUUID } from 'crypto';
|
|
8
|
+
|
|
7
9
|
import type {
|
|
8
10
|
ActionOptions,
|
|
9
11
|
Attachment,
|
|
@@ -16,7 +18,6 @@ import { Inject, Injectable, OnModuleInit, Type } from '@nestjs/common';
|
|
|
16
18
|
import { ModuleRef } from '@nestjs/core';
|
|
17
19
|
import { Request, Response } from 'express';
|
|
18
20
|
import mime from 'mime';
|
|
19
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
20
21
|
import z from 'zod';
|
|
21
22
|
|
|
22
23
|
import { AttachmentService } from '@/attachment/services/attachment.service';
|
|
@@ -232,7 +233,7 @@ export default abstract class ChannelHandler<
|
|
|
232
233
|
const attachments = await Promise.all(
|
|
233
234
|
metadatas.map(({ file, name, type, size }) => {
|
|
234
235
|
return this.attachmentService.store(file, {
|
|
235
|
-
name: `${name ? `${name}-` : ''}${
|
|
236
|
+
name: `${name ? `${name}-` : ''}${randomUUID()}.${mime.extension(type)}`,
|
|
236
237
|
type,
|
|
237
238
|
size,
|
|
238
239
|
resourceRef: AttachmentResourceRef.MessageAttachment,
|
package/src/chat/chat.module.ts
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* Full terms: see LICENSE.md.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import { createRequire } from 'node:module';
|
|
8
|
+
|
|
7
9
|
import { subscriberSchema, subscriberFullSchema } from '@hexabot-ai/types';
|
|
8
10
|
import {
|
|
9
11
|
Check,
|
|
@@ -30,6 +32,8 @@ import { SubscriberDto } from '../dto/subscriber.dto';
|
|
|
30
32
|
|
|
31
33
|
import { LabelOrmEntity } from './label.entity';
|
|
32
34
|
|
|
35
|
+
const requireEntity = createRequire(__filename);
|
|
36
|
+
|
|
33
37
|
export class SubscriberChannel {
|
|
34
38
|
@Column()
|
|
35
39
|
name: string;
|
|
@@ -65,13 +69,16 @@ export class SubscriberOrmEntity<
|
|
|
65
69
|
@Column({ type: 'varchar', length: 64 })
|
|
66
70
|
foreignId: string;
|
|
67
71
|
|
|
68
|
-
@ManyToOne(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
@ManyToOne(
|
|
73
|
+
() => requireEntity('../../channel/entities/source.entity').SourceOrmEntity,
|
|
74
|
+
{
|
|
75
|
+
// STI (`users` table) stores both subscribers and operators.
|
|
76
|
+
// Keep the column nullable at the DB level, and enforce non-null for
|
|
77
|
+
// Subscriber rows via `CHK_SUBSCRIBER_SOURCE_REQUIRED`.
|
|
78
|
+
nullable: true,
|
|
79
|
+
onDelete: 'CASCADE',
|
|
80
|
+
},
|
|
81
|
+
)
|
|
75
82
|
@JoinColumn({ name: 'source_id' })
|
|
76
83
|
@AsRelation()
|
|
77
84
|
source: SourceOrmEntity;
|
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
* Full terms: see LICENSE.md.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import { randomUUID } from 'crypto';
|
|
8
|
+
|
|
7
9
|
import { Subscriber } from '@hexabot-ai/types';
|
|
8
10
|
import { Inject, Injectable, Optional, forwardRef } from '@nestjs/common';
|
|
9
11
|
import { OnEvent } from '@nestjs/event-emitter';
|
|
10
12
|
import mime from 'mime';
|
|
11
13
|
import { In, IsNull, Not } from 'typeorm';
|
|
12
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
13
14
|
|
|
14
15
|
import { AttachmentService } from '@/attachment/services/attachment.service';
|
|
15
16
|
import {
|
|
@@ -159,7 +160,7 @@ export class SubscriberService extends BaseOrmService<SubscriberOrmEntity> {
|
|
|
159
160
|
const { file, type, size } = avatar;
|
|
160
161
|
const extension = mime.extension(type);
|
|
161
162
|
const attachment = await this.attachmentService.store(file, {
|
|
162
|
-
name: `avatar-${
|
|
163
|
+
name: `avatar-${randomUUID()}.${extension}`,
|
|
163
164
|
size,
|
|
164
165
|
type,
|
|
165
166
|
resourceRef: AttachmentResourceRef.SubscriberAvatar,
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* Full terms: see LICENSE.md.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import { createRequire } from 'node:module';
|
|
8
|
+
|
|
7
9
|
import { contentTypeSchema, contentTypeFullSchema } from '@hexabot-ai/types';
|
|
8
10
|
import { JSONSchema7 as JsonSchema } from 'json-schema';
|
|
9
11
|
import { Column, Entity, Index, OneToMany } from 'typeorm';
|
|
@@ -14,7 +16,9 @@ import { BaseOrmEntity } from '@/database/entities/base.entity';
|
|
|
14
16
|
|
|
15
17
|
import { ContentTypeDto } from '../dto/contentType.dto';
|
|
16
18
|
|
|
17
|
-
import { ContentOrmEntity } from './content.entity';
|
|
19
|
+
import type { ContentOrmEntity } from './content.entity';
|
|
20
|
+
|
|
21
|
+
const requireEntity = createRequire(__filename);
|
|
18
22
|
|
|
19
23
|
@Entity({ name: 'content_types' })
|
|
20
24
|
@Index(['name'], { unique: true })
|
|
@@ -31,8 +35,12 @@ export class ContentTypeOrmEntity extends BaseOrmEntity<ContentTypeDto> {
|
|
|
31
35
|
@JsonColumn({ nullable: true })
|
|
32
36
|
schema!: JsonSchema;
|
|
33
37
|
|
|
34
|
-
@OneToMany(
|
|
35
|
-
|
|
36
|
-
|
|
38
|
+
@OneToMany(
|
|
39
|
+
() => requireEntity('./content.entity').ContentOrmEntity,
|
|
40
|
+
(content: ContentOrmEntity) => content.contentType,
|
|
41
|
+
{
|
|
42
|
+
cascade: ['remove'],
|
|
43
|
+
},
|
|
44
|
+
)
|
|
37
45
|
contents?: ContentOrmEntity[];
|
|
38
46
|
}
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* Full terms: see LICENSE.md.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import { createRequire } from 'node:module';
|
|
8
|
+
|
|
7
9
|
import {
|
|
8
10
|
contentSchema,
|
|
9
11
|
contentFullSchema,
|
|
@@ -31,7 +33,9 @@ import { AsRelation } from '@/utils/decorators/relation-ref.decorator';
|
|
|
31
33
|
|
|
32
34
|
import { ContentDto } from '../dto/content.dto';
|
|
33
35
|
|
|
34
|
-
import { ContentTypeOrmEntity } from './content-type.entity';
|
|
36
|
+
import type { ContentTypeOrmEntity } from './content-type.entity';
|
|
37
|
+
|
|
38
|
+
const requireEntity = createRequire(__filename);
|
|
35
39
|
|
|
36
40
|
@Entity({ name: 'contents' })
|
|
37
41
|
@Index(['title'])
|
|
@@ -44,10 +48,14 @@ export class ContentOrmEntity extends BaseOrmEntity<ContentDto> {
|
|
|
44
48
|
/**
|
|
45
49
|
* The content type of this content.
|
|
46
50
|
*/
|
|
47
|
-
@ManyToOne(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
@ManyToOne(
|
|
52
|
+
() => requireEntity('./content-type.entity').ContentTypeOrmEntity,
|
|
53
|
+
(entity: ContentTypeOrmEntity) => entity.contents,
|
|
54
|
+
{
|
|
55
|
+
nullable: false,
|
|
56
|
+
onDelete: 'CASCADE',
|
|
57
|
+
},
|
|
58
|
+
)
|
|
51
59
|
@JoinColumn({ name: 'content_type_id' })
|
|
52
60
|
@AsRelation()
|
|
53
61
|
contentType!: ContentTypeOrmEntity;
|
|
@@ -110,6 +110,26 @@ function isJsonContentType(contentType?: string) {
|
|
|
110
110
|
);
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
+
function normalizeHeaderValue(value: unknown): string | undefined {
|
|
114
|
+
if (value === undefined || value === null) {
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (Array.isArray(value)) {
|
|
119
|
+
return value.map(String).join(', ');
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (
|
|
123
|
+
typeof value === 'string' ||
|
|
124
|
+
typeof value === 'number' ||
|
|
125
|
+
typeof value === 'boolean'
|
|
126
|
+
) {
|
|
127
|
+
return String(value);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return undefined;
|
|
131
|
+
}
|
|
132
|
+
|
|
113
133
|
function resolveFinalUrl(response: {
|
|
114
134
|
request?: { res?: { responseUrl?: string }; responseUrl?: string };
|
|
115
135
|
}) {
|
|
@@ -175,10 +195,9 @@ export const HttpRequestAction = createAction<
|
|
|
175
195
|
validateStatus: () => true,
|
|
176
196
|
...(requestData !== undefined ? { data: requestData } : {}),
|
|
177
197
|
});
|
|
178
|
-
const
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
: contentTypeHeader;
|
|
198
|
+
const contentType = normalizeHeaderValue(
|
|
199
|
+
response.headers?.['content-type'],
|
|
200
|
+
);
|
|
182
201
|
const responseData = response.data;
|
|
183
202
|
let body: HttpRequestOutput['body'] = '';
|
|
184
203
|
|
|
@@ -25,5 +25,14 @@
|
|
|
25
25
|
"URL": "URL",
|
|
26
26
|
"Whether the HTTP response status indicates success.": "Whether the HTTP response status indicates success.",
|
|
27
27
|
"Whether the response body was truncated.": "Whether the response body was truncated."
|
|
28
|
+
},
|
|
29
|
+
"send_mail": {
|
|
30
|
+
"Sends an email using HTML content.": "Sends an email using HTML content.",
|
|
31
|
+
"To": "To",
|
|
32
|
+
"Recipient email address.": "Recipient email address.",
|
|
33
|
+
"Title": "Title",
|
|
34
|
+
"Email subject.": "Email subject.",
|
|
35
|
+
"Content (HTML)": "Content (HTML)",
|
|
36
|
+
"HTML email content.": "HTML email content."
|
|
28
37
|
}
|
|
29
38
|
}
|
|
@@ -25,5 +25,14 @@
|
|
|
25
25
|
"URL": "URL",
|
|
26
26
|
"Whether the HTTP response status indicates success.": "Indique si le statut de la réponse HTTP signale un succès.",
|
|
27
27
|
"Whether the response body was truncated.": "Indique si le corps de la réponse a été tronqué."
|
|
28
|
+
},
|
|
29
|
+
"send_mail": {
|
|
30
|
+
"Sends an email using HTML content.": "Envoie un e-mail en utilisant du contenu HTML.",
|
|
31
|
+
"To": "À",
|
|
32
|
+
"Recipient email address.": "Adresse e-mail du destinataire.",
|
|
33
|
+
"Title": "Titre",
|
|
34
|
+
"Email subject.": "Objet de l'e-mail.",
|
|
35
|
+
"Content (HTML)": "Contenu (HTML)",
|
|
36
|
+
"HTML email content.": "Contenu de l'e-mail en HTML."
|
|
28
37
|
}
|
|
29
38
|
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Hexabot — Fair Core License (FCL-1.0-ALv2)
|
|
3
|
+
* Copyright (c) 2025 Hexastack.
|
|
4
|
+
* Full terms: see LICENSE.md.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { Injectable } from '@nestjs/common';
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
|
|
10
|
+
import { BaseAction, ExecArgs } from '@/actions';
|
|
11
|
+
import { ActionService } from '@/actions/actions.service';
|
|
12
|
+
import { MailerService } from '@/mailer/mailer.service';
|
|
13
|
+
import { WorkflowRuntimeContext } from '@/workflow/contexts/workflow-runtime.context';
|
|
14
|
+
|
|
15
|
+
const sendMailInputSchema = z.object({
|
|
16
|
+
to: z.email().meta({
|
|
17
|
+
title: 'To',
|
|
18
|
+
description: 'Recipient email address.',
|
|
19
|
+
}),
|
|
20
|
+
title: z.string().min(1).meta({
|
|
21
|
+
title: 'Title',
|
|
22
|
+
description: 'Email subject.',
|
|
23
|
+
}),
|
|
24
|
+
content: z.string().min(1).meta({
|
|
25
|
+
title: 'Content (HTML)',
|
|
26
|
+
description: 'HTML email content.',
|
|
27
|
+
}),
|
|
28
|
+
});
|
|
29
|
+
const sendMailOutputSchema = z.union([
|
|
30
|
+
z.object({
|
|
31
|
+
success: z.literal(true),
|
|
32
|
+
}),
|
|
33
|
+
z.object({
|
|
34
|
+
success: z.literal(false),
|
|
35
|
+
error: z.string(),
|
|
36
|
+
}),
|
|
37
|
+
]);
|
|
38
|
+
type SendMailInput = z.infer<typeof sendMailInputSchema>;
|
|
39
|
+
type SendMailOutput = z.infer<typeof sendMailOutputSchema>;
|
|
40
|
+
|
|
41
|
+
@Injectable()
|
|
42
|
+
export class SendMailAction extends BaseAction<
|
|
43
|
+
SendMailInput,
|
|
44
|
+
SendMailOutput,
|
|
45
|
+
WorkflowRuntimeContext
|
|
46
|
+
> {
|
|
47
|
+
constructor(
|
|
48
|
+
actionService: ActionService,
|
|
49
|
+
private readonly mailerService: MailerService,
|
|
50
|
+
) {
|
|
51
|
+
super(
|
|
52
|
+
{
|
|
53
|
+
name: 'send_mail',
|
|
54
|
+
description: 'Sends an email using HTML content.',
|
|
55
|
+
group: 'web',
|
|
56
|
+
icon: 'Mail',
|
|
57
|
+
color: '#68b1ff',
|
|
58
|
+
inputSchema: sendMailInputSchema,
|
|
59
|
+
outputSchema: sendMailOutputSchema,
|
|
60
|
+
},
|
|
61
|
+
actionService,
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
async execute({
|
|
66
|
+
input,
|
|
67
|
+
context,
|
|
68
|
+
}: ExecArgs<SendMailInput, WorkflowRuntimeContext>) {
|
|
69
|
+
try {
|
|
70
|
+
await this.mailerService.sendMail({
|
|
71
|
+
to: input.to,
|
|
72
|
+
subject: input.title,
|
|
73
|
+
html: input.content,
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
return { success: true } satisfies SendMailOutput;
|
|
77
|
+
} catch (error) {
|
|
78
|
+
const message =
|
|
79
|
+
error instanceof Error ? error.message : 'Could not send email';
|
|
80
|
+
context.services.logger.error('send_mail action failed', message, '', {
|
|
81
|
+
to: input.to,
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
return { success: false, error: message } satisfies SendMailOutput;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export default SendMailAction;
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* Full terms: see LICENSE.md.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import { randomUUID } from 'crypto';
|
|
8
|
+
|
|
7
9
|
import type {
|
|
8
10
|
Attachment,
|
|
9
11
|
Source,
|
|
@@ -25,7 +27,6 @@ import {
|
|
|
25
27
|
import { OnEvent } from '@nestjs/event-emitter';
|
|
26
28
|
import { Request, Response } from 'express';
|
|
27
29
|
import { Socket } from 'socket.io';
|
|
28
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
29
30
|
import type { z } from 'zod';
|
|
30
31
|
|
|
31
32
|
import { AttachmentOrmEntity } from '@/attachment/entities/attachment.entity';
|
|
@@ -125,7 +126,7 @@ export default abstract class BaseWebChannelHandler<N extends ChannelName>
|
|
|
125
126
|
}
|
|
126
127
|
|
|
127
128
|
generateId(): string {
|
|
128
|
-
return `${this.name}-${
|
|
129
|
+
return `${this.name}-${randomUUID()}`;
|
|
129
130
|
}
|
|
130
131
|
|
|
131
132
|
getChannelAttributes(
|
package/src/extensions/index.ts
CHANGED
package/src/global.d.ts
CHANGED
|
@@ -8,10 +8,4 @@ import '../types/event-emitter';
|
|
|
8
8
|
import '../types/express-session';
|
|
9
9
|
import './types/ai-sdk-mcp-stdio';
|
|
10
10
|
|
|
11
|
-
declare global {
|
|
12
|
-
type HyphenToUnderscore<S extends string> = S extends `${infer P}-${infer Q}`
|
|
13
|
-
? `${P}_${HyphenToUnderscore<Q>}`
|
|
14
|
-
: S;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
11
|
export {};
|
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
* Full terms: see LICENSE.md.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import { randomUUID } from 'crypto';
|
|
8
|
+
|
|
7
9
|
import { HttpService } from '@nestjs/axios';
|
|
8
10
|
import { Injectable } from '@nestjs/common';
|
|
9
11
|
import { AxiosError } from 'axios';
|
|
10
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
11
12
|
|
|
12
13
|
import {
|
|
13
14
|
LemonSqueezyActivationResponse,
|
|
@@ -52,7 +53,7 @@ export class LemonSqueezyService {
|
|
|
52
53
|
`${LEMON_SQUEEZY_API_BASE_URL}/v1/licenses/activate`,
|
|
53
54
|
{
|
|
54
55
|
license_key: licenseKey,
|
|
55
|
-
instance_name:
|
|
56
|
+
instance_name: randomUUID(),
|
|
56
57
|
},
|
|
57
58
|
{
|
|
58
59
|
headers: {
|
|
@@ -4,66 +4,13 @@
|
|
|
4
4
|
* Full terms: see LICENSE.md.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import path from 'path';
|
|
8
|
-
|
|
9
7
|
import { Global, Module } from '@nestjs/common';
|
|
10
|
-
import {
|
|
11
|
-
ISendMailOptions,
|
|
12
|
-
MAILER_OPTIONS,
|
|
13
|
-
MailerOptions,
|
|
14
|
-
MailerModule as NestjsMailerModule,
|
|
15
|
-
} from '@nestjs-modules/mailer';
|
|
16
|
-
import SMTPTransport from 'nodemailer/lib/smtp-transport';
|
|
17
|
-
|
|
18
|
-
import { config } from '@/config';
|
|
19
8
|
|
|
20
9
|
import { MailerService } from './mailer.service';
|
|
21
|
-
import { MjmlAdapter } from './mjml-adapter.class';
|
|
22
|
-
|
|
23
|
-
const mailerOptions: MailerOptions = {
|
|
24
|
-
transport: new SMTPTransport({
|
|
25
|
-
...config.emails.smtp,
|
|
26
|
-
logger: true,
|
|
27
|
-
debug: false,
|
|
28
|
-
}),
|
|
29
|
-
template: {
|
|
30
|
-
adapter: new MjmlAdapter(),
|
|
31
|
-
dir: path.join(process.cwd(), 'dist', 'templates'),
|
|
32
|
-
options: {
|
|
33
|
-
context: {
|
|
34
|
-
appName: config.parameters.appName,
|
|
35
|
-
appUrl: config.uiBaseUrl,
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
defaults: { from: config.emails.from },
|
|
40
|
-
};
|
|
41
10
|
|
|
42
11
|
@Global()
|
|
43
12
|
@Module({
|
|
44
|
-
|
|
45
|
-
...(config.emails.isEnabled
|
|
46
|
-
? [NestjsMailerModule.forRoot(mailerOptions)]
|
|
47
|
-
: []),
|
|
48
|
-
],
|
|
49
|
-
providers: [
|
|
50
|
-
{
|
|
51
|
-
provide: MAILER_OPTIONS,
|
|
52
|
-
useValue: mailerOptions,
|
|
53
|
-
},
|
|
54
|
-
...(config.emails.isEnabled
|
|
55
|
-
? [MailerService]
|
|
56
|
-
: [
|
|
57
|
-
{
|
|
58
|
-
provide: MailerService,
|
|
59
|
-
useValue: {
|
|
60
|
-
sendMail(_options: ISendMailOptions) {
|
|
61
|
-
throw new Error('Email Service is not enabled');
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
]),
|
|
66
|
-
],
|
|
13
|
+
providers: [MailerService],
|
|
67
14
|
exports: [MailerService],
|
|
68
15
|
})
|
|
69
16
|
export class MailerModule {}
|
|
@@ -4,6 +4,90 @@
|
|
|
4
4
|
* Full terms: see LICENSE.md.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { readFile } from 'fs/promises';
|
|
8
|
+
import path from 'path';
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
import { Injectable } from '@nestjs/common';
|
|
11
|
+
import Handlebars from 'handlebars';
|
|
12
|
+
import mjml2html from 'mjml';
|
|
13
|
+
import nodemailer, {
|
|
14
|
+
SendMailOptions as NodemailerSendMailOptions,
|
|
15
|
+
SentMessageInfo,
|
|
16
|
+
Transporter,
|
|
17
|
+
} from 'nodemailer';
|
|
18
|
+
import SMTPTransport from 'nodemailer/lib/smtp-transport';
|
|
19
|
+
|
|
20
|
+
import { config } from '@/config';
|
|
21
|
+
|
|
22
|
+
export type SendMailOptions = NodemailerSendMailOptions & {
|
|
23
|
+
template?: string;
|
|
24
|
+
context?: Record<string, unknown>;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
@Injectable()
|
|
28
|
+
export class MailerService {
|
|
29
|
+
private readonly transporter?: Transporter<SentMessageInfo>;
|
|
30
|
+
|
|
31
|
+
constructor() {
|
|
32
|
+
if (!config.emails.isEnabled) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
this.transporter = nodemailer.createTransport(
|
|
37
|
+
new SMTPTransport({
|
|
38
|
+
...config.emails.smtp,
|
|
39
|
+
logger: true,
|
|
40
|
+
debug: false,
|
|
41
|
+
}),
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
async sendMail({ template, context, ...options }: SendMailOptions) {
|
|
46
|
+
if (!this.transporter) {
|
|
47
|
+
throw new Error('Email Service is not enabled');
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const html = template
|
|
51
|
+
? await this.renderTemplate(template, context)
|
|
52
|
+
: options.html;
|
|
53
|
+
|
|
54
|
+
return await this.transporter.sendMail({
|
|
55
|
+
from: config.emails.from,
|
|
56
|
+
...options,
|
|
57
|
+
html,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async verifyAllTransporters(): Promise<boolean> {
|
|
62
|
+
if (!this.transporter) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return await this.transporter.verify();
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
private async renderTemplate(
|
|
70
|
+
template: string,
|
|
71
|
+
context: Record<string, unknown> = {},
|
|
72
|
+
): Promise<string> {
|
|
73
|
+
const templatePath = path.join(
|
|
74
|
+
process.cwd(),
|
|
75
|
+
'dist',
|
|
76
|
+
'templates',
|
|
77
|
+
template,
|
|
78
|
+
);
|
|
79
|
+
const content = await readFile(templatePath, 'utf-8');
|
|
80
|
+
const compiledHandlebars = Handlebars.compile(content)({
|
|
81
|
+
appName: config.parameters.appName,
|
|
82
|
+
appUrl: config.uiBaseUrl,
|
|
83
|
+
...context,
|
|
84
|
+
});
|
|
85
|
+
const { errors, html } = mjml2html(compiledHandlebars);
|
|
86
|
+
|
|
87
|
+
if (errors.length) {
|
|
88
|
+
throw new Error('Unable to compile mjml template');
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return html;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* Full terms: see LICENSE.md.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import { createRequire } from 'node:module';
|
|
8
|
+
|
|
7
9
|
import { modelSchema, modelFullSchema } from '@hexabot-ai/types';
|
|
8
10
|
import { Column, Entity, Index, OneToMany } from 'typeorm';
|
|
9
11
|
|
|
@@ -14,7 +16,9 @@ import { BaseOrmEntity } from '@/database/entities/base.entity';
|
|
|
14
16
|
import { ModelDto } from '../dto/model.dto';
|
|
15
17
|
import { TRelation } from '../types/index.type';
|
|
16
18
|
|
|
17
|
-
import { PermissionOrmEntity } from './permission.entity';
|
|
19
|
+
import type { PermissionOrmEntity } from './permission.entity';
|
|
20
|
+
|
|
21
|
+
const requireEntity = createRequire(__filename);
|
|
18
22
|
|
|
19
23
|
@Entity({ name: 'models' })
|
|
20
24
|
@Index(['name'], { unique: true })
|
|
@@ -34,11 +38,15 @@ export class ModelOrmEntity extends BaseOrmEntity<ModelDto> {
|
|
|
34
38
|
@JsonColumn({ default: '{}' })
|
|
35
39
|
attributes: Record<string, unknown>;
|
|
36
40
|
|
|
37
|
-
@Column({ nullable: true })
|
|
41
|
+
@Column({ type: 'varchar', nullable: true })
|
|
38
42
|
relation?: TRelation;
|
|
39
43
|
|
|
40
|
-
@OneToMany(
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
@OneToMany(
|
|
45
|
+
() => requireEntity('./permission.entity').PermissionOrmEntity,
|
|
46
|
+
(permission: PermissionOrmEntity) => permission.model,
|
|
47
|
+
{
|
|
48
|
+
cascade: ['remove'],
|
|
49
|
+
},
|
|
50
|
+
)
|
|
43
51
|
permissions?: PermissionOrmEntity[];
|
|
44
52
|
}
|