@hexabot-ai/api 3.2.2-alpha.1 → 3.2.2-alpha.3
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/README.md +1 -1
- 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-type.service.js.map +1 -1
- 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/decorators/json-column.decorator.js +1 -0
- package/dist/database/decorators/json-column.decorator.js.map +1 -1
- package/dist/database/entities/base.entity.d.ts +1 -1
- package/dist/database/typeorm-config.service.js +1 -1
- package/dist/database/typeorm-config.service.js.map +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/send-mail.action.d.ts +4 -4
- package/dist/extensions/channels/web/base-web-channel.d.ts +7 -6
- package/dist/extensions/channels/web/base-web-channel.js +12 -10
- 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/outbound/web-outbound-message-encoder.js +4 -4
- package/dist/extensions/channels/web/outbound/web-outbound-message-encoder.js.map +1 -1
- 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/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-BydLWDRe.js +2 -0
- package/dist/static/assets/{cssMode-ClQbC1-G.js → cssMode-DtNyPUki.js} +1 -1
- package/dist/static/assets/{freemarker2-DRxgvoL0.js → freemarker2-C2XfZce5.js} +1 -1
- package/dist/static/assets/{handlebars-CTQECjcj.js → handlebars-C8bj58KH.js} +1 -1
- package/dist/static/assets/{html-DvVbNWXL.js → html-A6xaHkJC.js} +1 -1
- package/dist/static/assets/{htmlMode-DHCoon1T.js → htmlMode-BaS0W7vp.js} +1 -1
- package/dist/static/assets/{index-BgFwJPy7.js → index-BoAD0ucA.js} +2138 -2135
- package/dist/static/assets/{javascript-CiEs6Ej5.js → javascript-B0ziESIH.js} +1 -1
- package/dist/static/assets/{jsonMode-DTfAuumC.js → jsonMode-Ce5isNkh.js} +1 -1
- package/dist/static/assets/{liquid-B714yIaN.js → liquid-DgK1yfp4.js} +1 -1
- package/dist/static/assets/{lspLanguageFeatures-r73pyfl4.js → lspLanguageFeatures-Dm_9PmPd.js} +1 -1
- package/dist/static/assets/{mdx-D5IAs7yq.js → mdx-DoyiAUI-.js} +1 -1
- package/dist/static/assets/{python-ehBpsG6S.js → python-D3i33SIz.js} +1 -1
- package/dist/static/assets/{razor-V-Gitx5J.js → razor-CmE-9YdK.js} +1 -1
- package/dist/static/assets/{tsMode-D_iFxZ-O.js → tsMode-Ct_NvUwl.js} +1 -1
- package/dist/static/assets/{typescript-CEGzsf5j.js → typescript-ynHJup65.js} +1 -1
- package/dist/static/assets/{xml-N5EKZaXL.js → xml-BymLyoKX.js} +1 -1
- package/dist/static/assets/{yaml-IWZvbW4T.js → yaml-Cn2RaxHO.js} +1 -1
- package/dist/static/assets/{yaml.worker.entry-BdO9k22I.js → yaml.worker.entry-BB81z30Q.js} +228 -228
- package/dist/static/index.html +1 -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/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/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/i18n-service.provider.js +2 -2
- package/dist/utils/test/providers/i18n-service.provider.js.map +1 -1
- package/dist/utils/test/providers/mailer-service.provider.d.ts +3 -3
- package/dist/utils/test/providers/mailer-service.provider.js +2 -2
- package/dist/utils/test/providers/mailer-service.provider.js.map +1 -1
- package/dist/utils/test/providers/setting-service.provider.d.ts +1 -1
- package/dist/utils/test/providers/setting-service.provider.js +2 -2
- package/dist/utils/test/providers/setting-service.provider.js.map +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 +203 -46
- 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/contexts/workflow-runtime.context.js +6 -6
- package/dist/workflow/contexts/workflow-runtime.context.js.map +1 -1
- 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/controllers/workflow.controller.js +9 -9
- package/dist/workflow/controllers/workflow.controller.js.map +1 -1
- 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/mcp-server.entity.js +4 -4
- package/dist/workflow/entities/mcp-server.entity.js.map +1 -1
- 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/entities/workflow.entity.js +2 -1
- package/dist/workflow/entities/workflow.entity.js.map +1 -1
- 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-scheduler.service.js +2 -2
- package/dist/workflow/services/workflow-scheduler.service.js.map +1 -1
- 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/dist/workflow/workflow.module.js +4 -4
- package/dist/workflow/workflow.module.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/cms/services/content-type.service.ts +1 -1
- package/src/cms/services/rag.service.ts +1 -1
- package/src/database/decorators/json-column.decorator.ts +1 -0
- package/src/database/typeorm-config.service.ts +1 -1
- package/src/extensions/actions/web/http-request.action.ts +23 -4
- package/src/extensions/channels/web/base-web-channel.ts +7 -6
- package/src/extensions/channels/web/outbound/web-outbound-message-encoder.ts +2 -2
- 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/index.ts +0 -2
- package/src/utils/pipes/uuid.pipe.ts +3 -3
- package/src/utils/test/fixtures/contenttype.ts +1 -1
- package/src/utils/test/fixtures/workflow.ts +1 -1
- package/src/utils/test/providers/i18n-service.provider.ts +1 -1
- package/src/utils/test/providers/mailer-service.provider.ts +1 -1
- package/src/utils/test/providers/setting-service.provider.ts +1 -1
- package/src/utils/test/test.ts +39 -0
- package/src/utils/test/utils.ts +332 -57
- package/src/websocket/websocket.gateway.ts +2 -2
- package/src/workflow/contexts/workflow-runtime.context.ts +2 -2
- package/src/workflow/controllers/workflow.controller.ts +2 -2
- package/src/workflow/entities/mcp-server.entity.ts +2 -2
- package/src/workflow/entities/workflow-version.entity.ts +8 -3
- package/src/workflow/entities/workflow.entity.ts +2 -1
- package/src/workflow/services/memory.service.ts +1 -0
- package/src/workflow/services/workflow-scheduler.service.ts +1 -1
- package/src/workflow/utils/memory-store.ts +13 -1
- package/src/workflow/workflow.module.ts +2 -2
- 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
|
@@ -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
|
|
|
@@ -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';
|
|
@@ -37,16 +38,16 @@ import {
|
|
|
37
38
|
import {
|
|
38
39
|
ChannelCapabilities,
|
|
39
40
|
DEFAULT_CHANNEL_CAPABILITIES,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
} from '@/channel';
|
|
41
|
+
} from '@/channel/lib/channel-capabilities';
|
|
42
|
+
import { ExtensionInject } from '@/channel/lib/extension-inject.decorator';
|
|
43
43
|
import { MessageInboundEvent } from '@/channel/lib/inbound-events';
|
|
44
|
+
import { WebSocketChannelHandler } from '@/channel/lib/transports/websocket-channel-handler';
|
|
44
45
|
import { SourceService } from '@/channel/services/source.service';
|
|
45
46
|
import { ChannelName } from '@/channel/types';
|
|
46
|
-
import { SubscriberChannelData } from '@/chat';
|
|
47
47
|
import { MessageCreateDto } from '@/chat/dto/message.dto';
|
|
48
48
|
import { SubscriberCreateDto } from '@/chat/dto/subscriber.dto';
|
|
49
49
|
import { MessageService } from '@/chat/services/message.service';
|
|
50
|
+
import type { SubscriberChannelData } from '@/chat/types/channel';
|
|
50
51
|
import { MenuService } from '@/cms/services/menu.service';
|
|
51
52
|
import { config } from '@/config';
|
|
52
53
|
import { SocketRequest } from '@/websocket/utils/socket-request';
|
|
@@ -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(
|
|
@@ -24,8 +24,8 @@ import { ChannelOutboundMessageEncoder } from '@/channel/lib/outbound';
|
|
|
24
24
|
import { ChannelAttachmentService } from '@/channel/services/channel-attachment.service';
|
|
25
25
|
import { VIEW_MORE_PAYLOAD } from '@/chat/helpers/constants';
|
|
26
26
|
import { ContentOrmEntity } from '@/cms/entities/content.entity';
|
|
27
|
-
import { I18nService } from '@/i18n';
|
|
28
|
-
import { LoggerService } from '@/logger';
|
|
27
|
+
import { I18nService } from '@/i18n/services/i18n.service';
|
|
28
|
+
import { LoggerService } from '@/logger/logger.service';
|
|
29
29
|
|
|
30
30
|
import { Web } from '../types';
|
|
31
31
|
|
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
|
}
|
|
@@ -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 { permissionSchema, permissionFullSchema } from '@hexabot-ai/types';
|
|
8
10
|
import {
|
|
9
11
|
Column,
|
|
@@ -22,8 +24,10 @@ import { PermissionDto } from '../dto/permission.dto';
|
|
|
22
24
|
import { Action } from '../types/action.type';
|
|
23
25
|
import { TRelation } from '../types/index.type';
|
|
24
26
|
|
|
25
|
-
import { ModelOrmEntity } from './model.entity';
|
|
26
|
-
import { RoleOrmEntity } from './role.entity';
|
|
27
|
+
import type { ModelOrmEntity } from './model.entity';
|
|
28
|
+
import type { RoleOrmEntity } from './role.entity';
|
|
29
|
+
|
|
30
|
+
const requireEntity = createRequire(__filename);
|
|
27
31
|
|
|
28
32
|
@Entity({ name: 'permissions' })
|
|
29
33
|
@Index(['model', 'action', 'role', 'relation'], { unique: true })
|
|
@@ -32,9 +36,13 @@ export class PermissionOrmEntity extends BaseOrmEntity<PermissionDto> {
|
|
|
32
36
|
|
|
33
37
|
fullCls = permissionFullSchema;
|
|
34
38
|
|
|
35
|
-
@ManyToOne(
|
|
36
|
-
|
|
37
|
-
|
|
39
|
+
@ManyToOne(
|
|
40
|
+
() => requireEntity('./model.entity').ModelOrmEntity,
|
|
41
|
+
(model: ModelOrmEntity) => model.permissions,
|
|
42
|
+
{
|
|
43
|
+
onDelete: 'CASCADE',
|
|
44
|
+
},
|
|
45
|
+
)
|
|
38
46
|
@JoinColumn({ name: 'model_id' })
|
|
39
47
|
@AsRelation()
|
|
40
48
|
model!: ModelOrmEntity;
|
|
@@ -45,9 +53,13 @@ export class PermissionOrmEntity extends BaseOrmEntity<PermissionDto> {
|
|
|
45
53
|
@EnumColumn({ enum: Action })
|
|
46
54
|
action!: Action;
|
|
47
55
|
|
|
48
|
-
@ManyToOne(
|
|
49
|
-
|
|
50
|
-
|
|
56
|
+
@ManyToOne(
|
|
57
|
+
() => requireEntity('./role.entity').RoleOrmEntity,
|
|
58
|
+
(role: RoleOrmEntity) => role.permissions,
|
|
59
|
+
{
|
|
60
|
+
onDelete: 'CASCADE',
|
|
61
|
+
},
|
|
62
|
+
)
|
|
51
63
|
@JoinColumn({ name: 'role_id' })
|
|
52
64
|
@AsRelation()
|
|
53
65
|
role!: RoleOrmEntity;
|
|
@@ -55,6 +67,6 @@ export class PermissionOrmEntity extends BaseOrmEntity<PermissionDto> {
|
|
|
55
67
|
@RelationId((permission: PermissionOrmEntity) => permission.role)
|
|
56
68
|
private readonly roleId!: string;
|
|
57
69
|
|
|
58
|
-
@Column({ default: 'role' })
|
|
70
|
+
@Column({ type: 'varchar', default: 'role' })
|
|
59
71
|
relation!: TRelation;
|
|
60
72
|
}
|
|
@@ -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 { roleSchema, roleFullSchema } from '@hexabot-ai/types';
|
|
8
10
|
import { Column, Entity, Index, ManyToMany, OneToMany } from 'typeorm';
|
|
9
11
|
|
|
@@ -12,9 +14,11 @@ import { BaseOrmEntity } from '@/database/entities/base.entity';
|
|
|
12
14
|
|
|
13
15
|
import { RoleDto } from '../dto/role.dto';
|
|
14
16
|
|
|
15
|
-
import { PermissionOrmEntity } from './permission.entity';
|
|
17
|
+
import type { PermissionOrmEntity } from './permission.entity';
|
|
16
18
|
import { UserOrmEntity } from './user.entity';
|
|
17
19
|
|
|
20
|
+
const requireEntity = createRequire(__filename);
|
|
21
|
+
|
|
18
22
|
export type TRole = 'admin' | 'public';
|
|
19
23
|
|
|
20
24
|
@Entity({ name: 'roles' })
|
|
@@ -31,9 +35,13 @@ export class RoleOrmEntity extends BaseOrmEntity<RoleDto> {
|
|
|
31
35
|
@Column({ default: true })
|
|
32
36
|
active!: boolean;
|
|
33
37
|
|
|
34
|
-
@OneToMany(
|
|
35
|
-
|
|
36
|
-
|
|
38
|
+
@OneToMany(
|
|
39
|
+
() => requireEntity('./permission.entity').PermissionOrmEntity,
|
|
40
|
+
(permission: PermissionOrmEntity) => permission.role,
|
|
41
|
+
{
|
|
42
|
+
cascade: ['remove'],
|
|
43
|
+
},
|
|
44
|
+
)
|
|
37
45
|
permissions?: PermissionOrmEntity[];
|
|
38
46
|
|
|
39
47
|
@ManyToMany(() => UserOrmEntity, (user) => user.roles)
|
|
@@ -8,13 +8,11 @@ import { Inject, OnModuleInit } from '@nestjs/common';
|
|
|
8
8
|
|
|
9
9
|
import { LoggerService } from '@/logger/logger.service';
|
|
10
10
|
|
|
11
|
-
import { ExtensionName } from '../types/extension';
|
|
12
|
-
|
|
13
11
|
export abstract class Extension implements OnModuleInit {
|
|
14
12
|
@Inject(LoggerService)
|
|
15
13
|
protected readonly logger: LoggerService;
|
|
16
14
|
|
|
17
|
-
constructor(public readonly name:
|
|
15
|
+
constructor(public readonly name: string) {}
|
|
18
16
|
|
|
19
17
|
getName() {
|
|
20
18
|
return this.name;
|
package/src/utils/index.ts
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
Injectable,
|
|
11
11
|
PipeTransform,
|
|
12
12
|
} from '@nestjs/common';
|
|
13
|
-
import {
|
|
13
|
+
import { isUUID } from 'class-validator';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Validates UUID route parameters by automatically checking parameters named `id`
|
|
@@ -56,13 +56,13 @@ export class UuidPipe implements PipeTransform {
|
|
|
56
56
|
|
|
57
57
|
private ensureUuid(rawValue: string, paramName: string): void {
|
|
58
58
|
const candidate = rawValue.trim();
|
|
59
|
-
if (!
|
|
59
|
+
if (!isUUID(candidate)) {
|
|
60
60
|
throw new BadRequestException(
|
|
61
61
|
`Invalid UUID supplied for "${paramName}".`,
|
|
62
62
|
);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
const version =
|
|
65
|
+
const version = Number(candidate[14]);
|
|
66
66
|
if (!this.allowedVersions.has(version)) {
|
|
67
67
|
throw new BadRequestException(
|
|
68
68
|
`Unsupported UUID version (${version}) supplied for "${paramName}".`,
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
import { ContentType } from '@hexabot-ai/types';
|
|
8
8
|
import { DataSource, DeepPartial } from 'typeorm';
|
|
9
9
|
|
|
10
|
-
import { DEFAULT_CONTENT_TYPE_SCHEMA } from '@/cms';
|
|
11
10
|
import { ContentTypeCreateDto } from '@/cms/dto/contentType.dto';
|
|
12
11
|
import { ContentTypeOrmEntity } from '@/cms/entities/content-type.entity';
|
|
12
|
+
import { DEFAULT_CONTENT_TYPE_SCHEMA } from '@/cms/services/content-type.service';
|
|
13
13
|
|
|
14
14
|
import { getFixturesWithDefaultValues } from '../defaultValues';
|
|
15
15
|
import { FixturesTypeBuilder } from '../types';
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
installUserFixturesTypeOrm,
|
|
12
12
|
userFixtureIds,
|
|
13
13
|
} from '@/utils/test/fixtures/user';
|
|
14
|
-
import { WorkflowCreateDto } from '@/workflow';
|
|
14
|
+
import { WorkflowCreateDto } from '@/workflow/dto/workflow.dto';
|
|
15
15
|
import { WorkflowVersionOrmEntity } from '@/workflow/entities/workflow-version.entity';
|
|
16
16
|
import { WorkflowOrmEntity } from '@/workflow/entities/workflow.entity';
|
|
17
17
|
import {
|
package/src/utils/test/test.ts
CHANGED
|
@@ -4,14 +4,45 @@
|
|
|
4
4
|
* Full terms: see LICENSE.md.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import type { TestingModule } from '@nestjs/testing';
|
|
7
8
|
import { DataSource } from 'typeorm';
|
|
8
9
|
|
|
9
10
|
const typeOrmDataSources: DataSource[] = [];
|
|
11
|
+
const testingModules: TestingModule[] = [];
|
|
10
12
|
|
|
11
13
|
export const registerTypeOrmDataSource = (dataSource: DataSource) => {
|
|
12
14
|
typeOrmDataSources.push(dataSource);
|
|
13
15
|
};
|
|
14
16
|
|
|
17
|
+
export const registerTestingModule = (module: TestingModule) => {
|
|
18
|
+
const close = module.close.bind(module);
|
|
19
|
+
let closed = false;
|
|
20
|
+
|
|
21
|
+
module.close = async () => {
|
|
22
|
+
if (closed) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
closed = true;
|
|
27
|
+
const moduleIndex = testingModules.indexOf(module);
|
|
28
|
+
|
|
29
|
+
if (moduleIndex >= 0) {
|
|
30
|
+
testingModules.splice(moduleIndex, 1);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
await close();
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
testingModules.push(module);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const closeTestingModules = async () => {
|
|
40
|
+
const modules = [...testingModules];
|
|
41
|
+
|
|
42
|
+
testingModules.length = 0;
|
|
43
|
+
await Promise.all(modules.map((module) => module.close()));
|
|
44
|
+
};
|
|
45
|
+
|
|
15
46
|
export const closeTypeOrmConnections = async () => {
|
|
16
47
|
await Promise.all(
|
|
17
48
|
typeOrmDataSources.map(async (dataSource) => {
|
|
@@ -25,3 +56,11 @@ export const closeTypeOrmConnections = async () => {
|
|
|
25
56
|
|
|
26
57
|
export const getLastTypeOrmDataSource = () =>
|
|
27
58
|
typeOrmDataSources[typeOrmDataSources.length - 1];
|
|
59
|
+
|
|
60
|
+
export const closeTestingResources = async () => {
|
|
61
|
+
try {
|
|
62
|
+
await closeTestingModules();
|
|
63
|
+
} finally {
|
|
64
|
+
await closeTypeOrmConnections();
|
|
65
|
+
}
|
|
66
|
+
};
|