@infuro/cms-core 1.0.36 → 1.0.38

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.
Files changed (29) hide show
  1. package/dist/admin.cjs +459 -496
  2. package/dist/admin.js +459 -496
  3. package/dist/api.cjs +36 -36
  4. package/dist/api.js +4 -4
  5. package/dist/auth.cjs +51 -51
  6. package/dist/auth.js +3 -3
  7. package/dist/{chunk-COBORIJH.cjs → chunk-22FFHLTO.cjs} +39 -56
  8. package/dist/{chunk-X6H5VBQ2.cjs → chunk-E6WVP7BK.cjs} +6 -6
  9. package/dist/{chunk-VMY2S32H.js → chunk-NNQBWDCI.js} +39 -56
  10. package/dist/{chunk-WO2DW4AU.cjs → chunk-OIGCAGH7.cjs} +7 -7
  11. package/dist/{chunk-UF3BYUXY.js → chunk-P7QCLE5W.js} +4 -3
  12. package/dist/{chunk-JS2W7XZ4.js → chunk-PYUXVU75.js} +243 -23
  13. package/dist/{chunk-FG6I64HP.js → chunk-SBRBR3VO.js} +1 -1
  14. package/dist/{chunk-LI2IXVAY.js → chunk-UXMDSNIG.js} +1 -1
  15. package/dist/{chunk-2AEVFOQP.cjs → chunk-VJDUKAJ3.cjs} +310 -90
  16. package/dist/{chunk-KPKFNLQQ.cjs → chunk-WMXPKKXU.cjs} +4 -3
  17. package/dist/index.cjs +260 -260
  18. package/dist/index.d.cts +12 -5
  19. package/dist/index.d.ts +12 -5
  20. package/dist/index.js +8 -8
  21. package/dist/migrations/1775500000000-RssFeedsAndArticles.ts +0 -1
  22. package/dist/migrations/1775700000000-JobSchedules.ts +0 -1
  23. package/dist/migrations/1781260000000-RenameWhatsappTriggerBindingsToOrderNotificationBindings.ts +92 -0
  24. package/dist/migrations/1781270000000-ComboVendorId.ts +58 -0
  25. package/dist/{whatsapp-trigger-dispatcher-ONHXI7UY.cjs → order-notification-dispatcher-RU7BTGGX.cjs} +3 -4
  26. package/dist/{whatsapp-trigger-dispatcher-PWFI4FKP.js → order-notification-dispatcher-XWIJYDGA.js} +1 -2
  27. package/dist/{rbac-debug-db-HWP65A4O.cjs → rbac-debug-db-KHG4FJC3.cjs} +2 -2
  28. package/dist/{rbac-debug-db-QJH3AD34.js → rbac-debug-db-QWHOENBR.js} +1 -1
  29. package/package.json +1 -1
package/dist/index.d.cts CHANGED
@@ -2520,14 +2520,14 @@ declare function fireOrderNotificationTrigger(triggerKey: string, orderId: numbe
2520
2520
  refundAmount?: number | null;
2521
2521
  }): void;
2522
2522
 
2523
- interface WhatsappTriggerDispatcherDeps {
2523
+ interface OrderNotificationDispatcherDeps {
2524
2524
  dataSource: DataSource;
2525
2525
  entityMap: EntityMap$2;
2526
2526
  getCms: () => Promise<CmsAppLike$1>;
2527
2527
  }
2528
- declare function initWhatsappTriggerDispatcher(deps: WhatsappTriggerDispatcherDeps): void;
2528
+ declare function initWhatsappTriggerDispatcher(deps: OrderNotificationDispatcherDeps): void;
2529
2529
  /** Manually re-fire a trigger for an existing order (admin testing / resend). */
2530
- declare function resendOrderNotification(triggerKey: string, orderId: number, deps: WhatsappTriggerDispatcherDeps): Promise<{
2530
+ declare function resendOrderNotification(triggerKey: string, orderId: number, deps: OrderNotificationDispatcherDeps): Promise<{
2531
2531
  ok: boolean;
2532
2532
  error?: string;
2533
2533
  }>;
@@ -3553,6 +3553,8 @@ declare enum ComboStatus {
3553
3553
  }
3554
3554
  declare class Combo {
3555
3555
  id: number;
3556
+ vendorId: number;
3557
+ vendor: Vendor;
3556
3558
  name: string;
3557
3559
  desc?: string;
3558
3560
  eventId: number;
@@ -3609,9 +3611,14 @@ declare class Attendee {
3609
3611
  contact: Contact | null;
3610
3612
  }
3611
3613
 
3612
- declare class WhatsappTriggerBinding {
3614
+ declare enum NotificationChannel {
3615
+ WHATSAPP = "whatsapp",
3616
+ EMAIL = "email"
3617
+ }
3618
+ declare class OrderNotificationBinding {
3613
3619
  id: number;
3614
3620
  triggerKey: string;
3621
+ channel: NotificationChannel;
3615
3622
  messageTemplateId: number | null;
3616
3623
  enabled: boolean;
3617
3624
  createdAt: Date;
@@ -3830,4 +3837,4 @@ type CreateCmsAppWithMessagingOptions = CreateCmsAppOptions & EnsureMessagingPlu
3830
3837
  /** `createCmsApp` + messaging plugins + queue processor registration. */
3831
3838
  declare function createCmsAppWithMessaging(options: CreateCmsAppWithMessagingOptions): Promise<CmsApp>;
3832
3839
 
3833
- export { ADMIN_GROUP_NAME, Address, type AdminNavItem, type AnalyticsHandlerConfig, type AnalyticsPluginConfig, Attendee, Attribute, type AuthHandlersConfig, type AuthHelpers, type AuthorizeOtpInput, BLOG_GENERATOR_AGENT_NAME, BLOG_GENERATOR_DEFAULT_SYSTEM_INSTRUCTION, BLOG_GENERATOR_DEFAULT_VALIDATION_RULES, BLOG_GENERATOR_LLM_AGENT_SLUG, BLOG_GENERATOR_MARKDOWN_ARTICLE_SEPARATOR, BLOG_METADATA_ENRICHER_AGENT_NAME, BLOG_METADATA_ENRICHER_DEFAULT_SYSTEM_INSTRUCTION, BLOG_METADATA_ENRICHER_DEFAULT_VALIDATION_RULES, BLOG_METADATA_ENRICHER_LLM_AGENT_SLUG, Blog, type BlogBySlugConfig, type BlogGeneratorBlogDraft, type BlogGeneratorDraftParseMode, type BlogGeneratorPluginConfig, type BlogGeneratorSeoDraft, BlogGeneratorService, Brand, CMS_ENTITY_MAP, type CachePluginConfig, type CacheService, type CaptchaProviderId, type CaptchaPublicConfig, CaptchaService, type CaptchaVerifyResult, Cart, CartItem, Category, type ChangePasswordConfig, ChatConversation, ChatMessage, type ChatPublicConfig, type CmsApiHandlerConfig, type CmsApp, type CmsGetter, type CmsMiddlewareConfig, type CmsMiddlewareRequest, type CmsPlugin, Collection, Combo, ComboItem, Comment, type CompanyDetails, Config, Contact, type CreateCmsAppOptions, type CreateCmsAppWithMessagingOptions, type CrudHandlerOptions, Currency, CurrencyExchange, Customer, Customer_Contacts, DEFAULT_ADMIN_NAV, DEFAULT_ORDER_NOTIFICATION_TRIGGER_SEEDS, type DashboardStatsConfig, type DataSourceManager, Discount, DiscountRules, type ERPPluginConfig, type ERPPluginInstance, ERPSubmissionService, EVENT_ORDER_MESSAGE_TEMPLATE_DEFAULTS, EVENT_ORDER_TEMPLATE_KEY, EVENT_ORDER_TEMPLATE_VARIABLES, type EcommerceAnalyticsConfig, type EmailData, type EmailJobPayload, type EmailPluginConfig, EmailService, type EmailServiceInterface, type EmailTemplateName, type EmailTemplateResult, type EmitOrderNotificationTriggerDeps, type EnsureCustomerUserInput, type EnsureMessagingPluginsOptions, type EnsureVendorCustomerDetails, type EntityCrudAction, type EntityMap$2 as EntityMap, type EntityPermissionFlags, type ErpContactSyncInput, type ErpCreateContactPayload, type ErpJobPayload, type ErpPaidOrderDataSource, type ErpPaidOrderEntityMap, Event, type EventOrderMessageTemplateHandlersConfig, type EventOrderNotificationChannel, type EventOrderNotificationTemplates, type EventOrderTemplateOverride, EventProduct, type ExtraPublicWriteRule, type FacebookMeAccountsResponse, type FacebookPageAccount, type ForgotPasswordConfig, Form, type FormBySlugConfig, FormField, FormSubmission, type GetPublicSettingsGroupConfig, type GetPublicSettingsGroupDataSource, type GetSession, type InviteAcceptConfig, JOB_RUNNER_QUEUE, type CmsAppLike as JobRunnerCmsAppLike, type JobRunnerDeps, type JobRunnerPayload, JobSchedule, type JobScheduleApiConfig, JobScheduleRun, KNOWN_NOTIFICATION_TRIGGERS, KnowledgeBaseChunk, KnowledgeBaseDocument, type LatestArticleFromFeed, LlmAgent, type LlmAgentKnowledgeApiConfig, type LlmAgentOptions, type LlmAgentValidationRulesJson, type LlmChatOptions, type LlmEmbeddingProvider, type LlmMessage, type LlmPluginConfig, LlmService, type LlmServiceEmbedOptions, type LlmServiceInterface, type LocalStoragePluginConfig, type Logger, Media, MessageTemplate, type MetaGraphMutationResponse, type NextAuthOptionsConfig, type NextAuthUser, OPEN_ENDPOINTS, ORDER_NOTIFICATION_TRIGGERS, Order, OrderAddresses, OrderDiscounts, OrderItem, OrderNotificationTrigger, type OrderNotificationTriggerKey, type OrderPlacedEmailPayload, type OrderPlacedLineItem, type OrderTriggerPayload, OtpChallenge, type OtpChannel, type OtpPurpose, PERMISSION_REQUIRED_ENDPOINTS, Page, type ParsedLlmAgentValidation, PasswordResetToken, Payment, type PaymentIntent, type PaymentPluginConfig, type PaymentServiceInterface, Permission, type PgBossPluginConfig, PgBossService, type PipelineNames, type PluginContext, Product, ProductAttribute, ProductCategory, ProductConfig, ProductVariant, type PublicThemeSettingsPayload, type QueuePluginConfig, type QueueService, RBAC_ADMIN_ONLY_ENTITIES, type RefundCalculationResult, RefundPolicy, type RefundPolicyLike, type RefundPolicyTier, RefundRequest, type RenderEmailOptions, type RenderedEmail, RssArticle, RssFeed, type S3StoragePluginConfig, SUPER_ADMIN_GROUP_ID, type SendVendorOnboardEmailInput, Seo, type SeoLike, type SeoMetadataOverrides, type SessionUser, type SetPasswordConfig, type SettingsApiConfig, type SmsJobPayload, type SmsPluginConfig, type SmsProviderChoice, type SmsProviderId, type SmsServiceConfig, type SmsServiceInterface, type SocialLinkItem, type SocialMediaPluginConfig, type StorageService, type StorefrontApiConfig, type StorefrontOtpFlags, Tag, Tax, type TemplateContext, type UploadHandlerConfig, User, type UserAuthApiConfig, type UserAvatarConfig, UserGroup, type UserProfileConfig, type UsersApiConfig, VENDOR_ADMIN_GROUP_ID, VENDOR_OWNER_GROUP_NAME, VENDOR_SCOPED_STORE_ENTITIES, VENDOR_STORE_RBAC_ENTITIES, Vendor, VendorCustomer, type VendorDashboardConfig, type VendorOnboardHandlersConfig, type VendorOwnerActivation, VendorRole, VendorRolePermission, VendorUser, type WhatsAppJobPayload, type WhatsAppPluginConfig, type WhatsAppServiceConfig, type WhatsAppServiceInterface, WhatsappTriggerBinding, Wishlist, WishlistItem, ZIP_MIME_TYPES, allowRateLimit, analyticsPlugin, applyVendorCustomersContactFilter, assertCaptchaOk, assertContactAllowedForVendorOrder, blogGeneratorPlugin, buildBlogMetadataUserPrompt, buildCaptchaPublicConfig, buildCronFromSchedule, buildEventOrderTemplateVariables, buildRssUserPromptFromFeeds, cachePlugin, calculateOrderRefundPreview, calculateRefundFromPolicy, canManageRoles, canManageVendorRoles, canManageVendorTeam, canOnboardVendors, captchaPlugin, checkEventsEnabled, checkMultiVendorEnabled, cn, contactIsVendorCustomer, countRecentOtpSends, createAnalyticsHandlers, createAuthHelpers, createBlogBySlugHandler, createChangePasswordHandler, createCmsApiHandler, createCmsApp, createCmsAppWithMessaging, createCmsAuthBundle, createCmsMiddleware, createCrudByIdHandler, createCrudHandler, createDashboardStatsHandler, createDataSourceManager, createEcommerceAnalyticsHandler, createEventOrderMessageTemplateHandlers, createForgotPasswordHandler, createFormBySlugHandler, createInviteAcceptHandler, createJobScheduleHandlers, createLlmAgentKnowledgeHandlers, createMediaZipExtractHandler, createMessageTemplateRowLoader, createOtpChallenge, createSetPasswordHandler, createSettingsApiHandlers, createSocialMediaHandlers, createStorefrontApiHandler, createUploadHandler, createUserAuthApiRouter, createUserAvatarHandler, createUserProfileHandler, createUsersApiHandlers, createVendorDashboardHandler, createVendorOnboardHandlers, customerPhoneForUser, daysBeforeEventStart, defaultPublicApiMethods, describeEventTierPolicy, emailPlugin, emailTemplates, emitOrderNotificationTrigger, enrichUserWithVendorContext, ensureCustomerForUser, ensureMessagingPluginsOnCms, ensureScheduleQueueWorker, ensureVendorCustomerForOrderContact, erpPlugin, explainSessionEntityAccess, fetchSeoBySlug, findActiveRefundPolicyForVendor, fireOrderNotificationTrigger, formatDate, formatDateOnly, formatDateTime, formatTierRange, generateNumericOtp, generateSlug, getCompanyDetailsFromSettings, getNextAuthOptions, getPermissionableEntityKeys, getPublicSettingsGroup, getRequiredPermission, getRssArticleSummaryFromItem, getStorefrontNextAuthOptions, hasEntityPermission, hashOtpCode, hydrateVendorSessionUser, initWhatsappTriggerDispatcher, invalidateEventsCache, invalidateMultiVendorCache, isAuthDebugClientEnabled, isAuthDebugEnabled, isCustomerTypeContact, isOpenEndpoint, isPlatformAdministrator, isPublicMethod, isRbacDebugEnabled, isSuperAdmin, isSuperAdminGroupName, isVendorAdmin, isVendorGroupName, isVendorOwner, isVendorPortalUser, isVendorStaff, isZipMedia, joinRecipientsForSend, linkUnclaimedContactToUser, llmAgentToChatAgentOptions, llmPlugin, loadPublicThemeSettings, loadSettingsGroupFromDb, loadUserVendorContext, localStoragePlugin, logAuth, logAuthClient, logEntityAccessDecision, logRbac, mergeEmailLayoutCompanyDetails, mergeGuardrailsIntoSystemPrompt, mergeSeoBySlug, messagingPlugins, metaFetchUserManagedPages, metaPostPageFeed, metaPostPagePhoto, metaResolvePageAccessToken, nextAuthCookieDebugInfo, normalizePhoneE164, normalizeRefundTiers, notificationTriggerEmitter, overlayCmsPlugins, parseBlogGeneratorAgentContent, parseBlogGeneratorModelOutput, parseBlogMetadataEnrichmentJson, parseEmailRecipientsFromConfig, parseHfInferenceEmbeddingBody, parseLlmAgentValidationRules, paymentPlugin, permissionRowsToRecord, pgBossPlugin, pgBossScheduleNameForId, queueEmail, queueErp, queueErpCreateContactIfEnabled, queueErpPaidOrderForOrderId, queueJobScheduleNow, queueOrderPlacedEmails, queuePlugin, queueSms, queueVendorOnboardEmails, queueWhatsApp, rateLimitCheckoutPost, rateLimitKeyForApiRequest, rateLimitPublicApiIfNeeded, registerEmailQueueProcessor, registerErpQueueProcessor, registerJobRunnerWorker, registerMessagingQueueProcessors, registerSmsQueueProcessor, registerWhatsAppQueueProcessor, relativePathFromMediaParentId, renderEmail, renderLayout, resendOrderNotification, resolveBlogCategoryIdByName, resolveEventOrderTemplate, resolvePublicMetadata, resolveSettingsEncryptionKey, resolveVendorIdForContactCheck, resolveVendorScopeFromSessionUser, s3StoragePlugin, sanitizeMediaFolderPath, sanitizeStorageSegment, seedAdministratorPermissions, seedDefaultAdmin, sendOrderPlacedEmailsAfterConfirmation, sendVendorOnboardEmails, serializeEmailRecipients, sessionHasEntityAccess, shouldRateLimitPublicWrite, simpleDecrypt, simpleEncrypt, smsPlugin, socialMediaPlugin, summarizeEntityPerms, summarizeSessionUserForLog, syncJobScheduleToPgBoss, truncateText, validateRefundTiers, validateScheduleInput, validateSlug, validateUserMessageAgainstAgentRules, validateUserMessageAgainstStructuredRules, vendorPortalFlagsFromUser, verifyAndConsumeOtpChallenge, verifyOtpCodeHash, whatsappPlugin, withAdminRlsContext, withVendorRlsContext, wrapGetCmsWithMessaging };
3840
+ export { ADMIN_GROUP_NAME, Address, type AdminNavItem, type AnalyticsHandlerConfig, type AnalyticsPluginConfig, Attendee, Attribute, type AuthHandlersConfig, type AuthHelpers, type AuthorizeOtpInput, BLOG_GENERATOR_AGENT_NAME, BLOG_GENERATOR_DEFAULT_SYSTEM_INSTRUCTION, BLOG_GENERATOR_DEFAULT_VALIDATION_RULES, BLOG_GENERATOR_LLM_AGENT_SLUG, BLOG_GENERATOR_MARKDOWN_ARTICLE_SEPARATOR, BLOG_METADATA_ENRICHER_AGENT_NAME, BLOG_METADATA_ENRICHER_DEFAULT_SYSTEM_INSTRUCTION, BLOG_METADATA_ENRICHER_DEFAULT_VALIDATION_RULES, BLOG_METADATA_ENRICHER_LLM_AGENT_SLUG, Blog, type BlogBySlugConfig, type BlogGeneratorBlogDraft, type BlogGeneratorDraftParseMode, type BlogGeneratorPluginConfig, type BlogGeneratorSeoDraft, BlogGeneratorService, Brand, CMS_ENTITY_MAP, type CachePluginConfig, type CacheService, type CaptchaProviderId, type CaptchaPublicConfig, CaptchaService, type CaptchaVerifyResult, Cart, CartItem, Category, type ChangePasswordConfig, ChatConversation, ChatMessage, type ChatPublicConfig, type CmsApiHandlerConfig, type CmsApp, type CmsGetter, type CmsMiddlewareConfig, type CmsMiddlewareRequest, type CmsPlugin, Collection, Combo, ComboItem, Comment, type CompanyDetails, Config, Contact, type CreateCmsAppOptions, type CreateCmsAppWithMessagingOptions, type CrudHandlerOptions, Currency, CurrencyExchange, Customer, Customer_Contacts, DEFAULT_ADMIN_NAV, DEFAULT_ORDER_NOTIFICATION_TRIGGER_SEEDS, type DashboardStatsConfig, type DataSourceManager, Discount, DiscountRules, type ERPPluginConfig, type ERPPluginInstance, ERPSubmissionService, EVENT_ORDER_MESSAGE_TEMPLATE_DEFAULTS, EVENT_ORDER_TEMPLATE_KEY, EVENT_ORDER_TEMPLATE_VARIABLES, type EcommerceAnalyticsConfig, type EmailData, type EmailJobPayload, type EmailPluginConfig, EmailService, type EmailServiceInterface, type EmailTemplateName, type EmailTemplateResult, type EmitOrderNotificationTriggerDeps, type EnsureCustomerUserInput, type EnsureMessagingPluginsOptions, type EnsureVendorCustomerDetails, type EntityCrudAction, type EntityMap$2 as EntityMap, type EntityPermissionFlags, type ErpContactSyncInput, type ErpCreateContactPayload, type ErpJobPayload, type ErpPaidOrderDataSource, type ErpPaidOrderEntityMap, Event, type EventOrderMessageTemplateHandlersConfig, type EventOrderNotificationChannel, type EventOrderNotificationTemplates, type EventOrderTemplateOverride, EventProduct, type ExtraPublicWriteRule, type FacebookMeAccountsResponse, type FacebookPageAccount, type ForgotPasswordConfig, Form, type FormBySlugConfig, FormField, FormSubmission, type GetPublicSettingsGroupConfig, type GetPublicSettingsGroupDataSource, type GetSession, type InviteAcceptConfig, JOB_RUNNER_QUEUE, type CmsAppLike as JobRunnerCmsAppLike, type JobRunnerDeps, type JobRunnerPayload, JobSchedule, type JobScheduleApiConfig, JobScheduleRun, KNOWN_NOTIFICATION_TRIGGERS, KnowledgeBaseChunk, KnowledgeBaseDocument, type LatestArticleFromFeed, LlmAgent, type LlmAgentKnowledgeApiConfig, type LlmAgentOptions, type LlmAgentValidationRulesJson, type LlmChatOptions, type LlmEmbeddingProvider, type LlmMessage, type LlmPluginConfig, LlmService, type LlmServiceEmbedOptions, type LlmServiceInterface, type LocalStoragePluginConfig, type Logger, Media, MessageTemplate, type MetaGraphMutationResponse, type NextAuthOptionsConfig, type NextAuthUser, OPEN_ENDPOINTS, ORDER_NOTIFICATION_TRIGGERS, Order, OrderAddresses, OrderDiscounts, OrderItem, OrderNotificationBinding, OrderNotificationTrigger, type OrderNotificationTriggerKey, type OrderPlacedEmailPayload, type OrderPlacedLineItem, type OrderTriggerPayload, OtpChallenge, type OtpChannel, type OtpPurpose, PERMISSION_REQUIRED_ENDPOINTS, Page, type ParsedLlmAgentValidation, PasswordResetToken, Payment, type PaymentIntent, type PaymentPluginConfig, type PaymentServiceInterface, Permission, type PgBossPluginConfig, PgBossService, type PipelineNames, type PluginContext, Product, ProductAttribute, ProductCategory, ProductConfig, ProductVariant, type PublicThemeSettingsPayload, type QueuePluginConfig, type QueueService, RBAC_ADMIN_ONLY_ENTITIES, type RefundCalculationResult, RefundPolicy, type RefundPolicyLike, type RefundPolicyTier, RefundRequest, type RenderEmailOptions, type RenderedEmail, RssArticle, RssFeed, type S3StoragePluginConfig, SUPER_ADMIN_GROUP_ID, type SendVendorOnboardEmailInput, Seo, type SeoLike, type SeoMetadataOverrides, type SessionUser, type SetPasswordConfig, type SettingsApiConfig, type SmsJobPayload, type SmsPluginConfig, type SmsProviderChoice, type SmsProviderId, type SmsServiceConfig, type SmsServiceInterface, type SocialLinkItem, type SocialMediaPluginConfig, type StorageService, type StorefrontApiConfig, type StorefrontOtpFlags, Tag, Tax, type TemplateContext, type UploadHandlerConfig, User, type UserAuthApiConfig, type UserAvatarConfig, UserGroup, type UserProfileConfig, type UsersApiConfig, VENDOR_ADMIN_GROUP_ID, VENDOR_OWNER_GROUP_NAME, VENDOR_SCOPED_STORE_ENTITIES, VENDOR_STORE_RBAC_ENTITIES, Vendor, VendorCustomer, type VendorDashboardConfig, type VendorOnboardHandlersConfig, type VendorOwnerActivation, VendorRole, VendorRolePermission, VendorUser, type WhatsAppJobPayload, type WhatsAppPluginConfig, type WhatsAppServiceConfig, type WhatsAppServiceInterface, Wishlist, WishlistItem, ZIP_MIME_TYPES, allowRateLimit, analyticsPlugin, applyVendorCustomersContactFilter, assertCaptchaOk, assertContactAllowedForVendorOrder, blogGeneratorPlugin, buildBlogMetadataUserPrompt, buildCaptchaPublicConfig, buildCronFromSchedule, buildEventOrderTemplateVariables, buildRssUserPromptFromFeeds, cachePlugin, calculateOrderRefundPreview, calculateRefundFromPolicy, canManageRoles, canManageVendorRoles, canManageVendorTeam, canOnboardVendors, captchaPlugin, checkEventsEnabled, checkMultiVendorEnabled, cn, contactIsVendorCustomer, countRecentOtpSends, createAnalyticsHandlers, createAuthHelpers, createBlogBySlugHandler, createChangePasswordHandler, createCmsApiHandler, createCmsApp, createCmsAppWithMessaging, createCmsAuthBundle, createCmsMiddleware, createCrudByIdHandler, createCrudHandler, createDashboardStatsHandler, createDataSourceManager, createEcommerceAnalyticsHandler, createEventOrderMessageTemplateHandlers, createForgotPasswordHandler, createFormBySlugHandler, createInviteAcceptHandler, createJobScheduleHandlers, createLlmAgentKnowledgeHandlers, createMediaZipExtractHandler, createMessageTemplateRowLoader, createOtpChallenge, createSetPasswordHandler, createSettingsApiHandlers, createSocialMediaHandlers, createStorefrontApiHandler, createUploadHandler, createUserAuthApiRouter, createUserAvatarHandler, createUserProfileHandler, createUsersApiHandlers, createVendorDashboardHandler, createVendorOnboardHandlers, customerPhoneForUser, daysBeforeEventStart, defaultPublicApiMethods, describeEventTierPolicy, emailPlugin, emailTemplates, emitOrderNotificationTrigger, enrichUserWithVendorContext, ensureCustomerForUser, ensureMessagingPluginsOnCms, ensureScheduleQueueWorker, ensureVendorCustomerForOrderContact, erpPlugin, explainSessionEntityAccess, fetchSeoBySlug, findActiveRefundPolicyForVendor, fireOrderNotificationTrigger, formatDate, formatDateOnly, formatDateTime, formatTierRange, generateNumericOtp, generateSlug, getCompanyDetailsFromSettings, getNextAuthOptions, getPermissionableEntityKeys, getPublicSettingsGroup, getRequiredPermission, getRssArticleSummaryFromItem, getStorefrontNextAuthOptions, hasEntityPermission, hashOtpCode, hydrateVendorSessionUser, initWhatsappTriggerDispatcher, invalidateEventsCache, invalidateMultiVendorCache, isAuthDebugClientEnabled, isAuthDebugEnabled, isCustomerTypeContact, isOpenEndpoint, isPlatformAdministrator, isPublicMethod, isRbacDebugEnabled, isSuperAdmin, isSuperAdminGroupName, isVendorAdmin, isVendorGroupName, isVendorOwner, isVendorPortalUser, isVendorStaff, isZipMedia, joinRecipientsForSend, linkUnclaimedContactToUser, llmAgentToChatAgentOptions, llmPlugin, loadPublicThemeSettings, loadSettingsGroupFromDb, loadUserVendorContext, localStoragePlugin, logAuth, logAuthClient, logEntityAccessDecision, logRbac, mergeEmailLayoutCompanyDetails, mergeGuardrailsIntoSystemPrompt, mergeSeoBySlug, messagingPlugins, metaFetchUserManagedPages, metaPostPageFeed, metaPostPagePhoto, metaResolvePageAccessToken, nextAuthCookieDebugInfo, normalizePhoneE164, normalizeRefundTiers, notificationTriggerEmitter, overlayCmsPlugins, parseBlogGeneratorAgentContent, parseBlogGeneratorModelOutput, parseBlogMetadataEnrichmentJson, parseEmailRecipientsFromConfig, parseHfInferenceEmbeddingBody, parseLlmAgentValidationRules, paymentPlugin, permissionRowsToRecord, pgBossPlugin, pgBossScheduleNameForId, queueEmail, queueErp, queueErpCreateContactIfEnabled, queueErpPaidOrderForOrderId, queueJobScheduleNow, queueOrderPlacedEmails, queuePlugin, queueSms, queueVendorOnboardEmails, queueWhatsApp, rateLimitCheckoutPost, rateLimitKeyForApiRequest, rateLimitPublicApiIfNeeded, registerEmailQueueProcessor, registerErpQueueProcessor, registerJobRunnerWorker, registerMessagingQueueProcessors, registerSmsQueueProcessor, registerWhatsAppQueueProcessor, relativePathFromMediaParentId, renderEmail, renderLayout, resendOrderNotification, resolveBlogCategoryIdByName, resolveEventOrderTemplate, resolvePublicMetadata, resolveSettingsEncryptionKey, resolveVendorIdForContactCheck, resolveVendorScopeFromSessionUser, s3StoragePlugin, sanitizeMediaFolderPath, sanitizeStorageSegment, seedAdministratorPermissions, seedDefaultAdmin, sendOrderPlacedEmailsAfterConfirmation, sendVendorOnboardEmails, serializeEmailRecipients, sessionHasEntityAccess, shouldRateLimitPublicWrite, simpleDecrypt, simpleEncrypt, smsPlugin, socialMediaPlugin, summarizeEntityPerms, summarizeSessionUserForLog, syncJobScheduleToPgBoss, truncateText, validateRefundTiers, validateScheduleInput, validateSlug, validateUserMessageAgainstAgentRules, validateUserMessageAgainstStructuredRules, vendorPortalFlagsFromUser, verifyAndConsumeOtpChallenge, verifyOtpCodeHash, whatsappPlugin, withAdminRlsContext, withVendorRlsContext, wrapGetCmsWithMessaging };
package/dist/index.d.ts CHANGED
@@ -2520,14 +2520,14 @@ declare function fireOrderNotificationTrigger(triggerKey: string, orderId: numbe
2520
2520
  refundAmount?: number | null;
2521
2521
  }): void;
2522
2522
 
2523
- interface WhatsappTriggerDispatcherDeps {
2523
+ interface OrderNotificationDispatcherDeps {
2524
2524
  dataSource: DataSource;
2525
2525
  entityMap: EntityMap$2;
2526
2526
  getCms: () => Promise<CmsAppLike$1>;
2527
2527
  }
2528
- declare function initWhatsappTriggerDispatcher(deps: WhatsappTriggerDispatcherDeps): void;
2528
+ declare function initWhatsappTriggerDispatcher(deps: OrderNotificationDispatcherDeps): void;
2529
2529
  /** Manually re-fire a trigger for an existing order (admin testing / resend). */
2530
- declare function resendOrderNotification(triggerKey: string, orderId: number, deps: WhatsappTriggerDispatcherDeps): Promise<{
2530
+ declare function resendOrderNotification(triggerKey: string, orderId: number, deps: OrderNotificationDispatcherDeps): Promise<{
2531
2531
  ok: boolean;
2532
2532
  error?: string;
2533
2533
  }>;
@@ -3553,6 +3553,8 @@ declare enum ComboStatus {
3553
3553
  }
3554
3554
  declare class Combo {
3555
3555
  id: number;
3556
+ vendorId: number;
3557
+ vendor: Vendor;
3556
3558
  name: string;
3557
3559
  desc?: string;
3558
3560
  eventId: number;
@@ -3609,9 +3611,14 @@ declare class Attendee {
3609
3611
  contact: Contact | null;
3610
3612
  }
3611
3613
 
3612
- declare class WhatsappTriggerBinding {
3614
+ declare enum NotificationChannel {
3615
+ WHATSAPP = "whatsapp",
3616
+ EMAIL = "email"
3617
+ }
3618
+ declare class OrderNotificationBinding {
3613
3619
  id: number;
3614
3620
  triggerKey: string;
3621
+ channel: NotificationChannel;
3615
3622
  messageTemplateId: number | null;
3616
3623
  enabled: boolean;
3617
3624
  createdAt: Date;
@@ -3830,4 +3837,4 @@ type CreateCmsAppWithMessagingOptions = CreateCmsAppOptions & EnsureMessagingPlu
3830
3837
  /** `createCmsApp` + messaging plugins + queue processor registration. */
3831
3838
  declare function createCmsAppWithMessaging(options: CreateCmsAppWithMessagingOptions): Promise<CmsApp>;
3832
3839
 
3833
- export { ADMIN_GROUP_NAME, Address, type AdminNavItem, type AnalyticsHandlerConfig, type AnalyticsPluginConfig, Attendee, Attribute, type AuthHandlersConfig, type AuthHelpers, type AuthorizeOtpInput, BLOG_GENERATOR_AGENT_NAME, BLOG_GENERATOR_DEFAULT_SYSTEM_INSTRUCTION, BLOG_GENERATOR_DEFAULT_VALIDATION_RULES, BLOG_GENERATOR_LLM_AGENT_SLUG, BLOG_GENERATOR_MARKDOWN_ARTICLE_SEPARATOR, BLOG_METADATA_ENRICHER_AGENT_NAME, BLOG_METADATA_ENRICHER_DEFAULT_SYSTEM_INSTRUCTION, BLOG_METADATA_ENRICHER_DEFAULT_VALIDATION_RULES, BLOG_METADATA_ENRICHER_LLM_AGENT_SLUG, Blog, type BlogBySlugConfig, type BlogGeneratorBlogDraft, type BlogGeneratorDraftParseMode, type BlogGeneratorPluginConfig, type BlogGeneratorSeoDraft, BlogGeneratorService, Brand, CMS_ENTITY_MAP, type CachePluginConfig, type CacheService, type CaptchaProviderId, type CaptchaPublicConfig, CaptchaService, type CaptchaVerifyResult, Cart, CartItem, Category, type ChangePasswordConfig, ChatConversation, ChatMessage, type ChatPublicConfig, type CmsApiHandlerConfig, type CmsApp, type CmsGetter, type CmsMiddlewareConfig, type CmsMiddlewareRequest, type CmsPlugin, Collection, Combo, ComboItem, Comment, type CompanyDetails, Config, Contact, type CreateCmsAppOptions, type CreateCmsAppWithMessagingOptions, type CrudHandlerOptions, Currency, CurrencyExchange, Customer, Customer_Contacts, DEFAULT_ADMIN_NAV, DEFAULT_ORDER_NOTIFICATION_TRIGGER_SEEDS, type DashboardStatsConfig, type DataSourceManager, Discount, DiscountRules, type ERPPluginConfig, type ERPPluginInstance, ERPSubmissionService, EVENT_ORDER_MESSAGE_TEMPLATE_DEFAULTS, EVENT_ORDER_TEMPLATE_KEY, EVENT_ORDER_TEMPLATE_VARIABLES, type EcommerceAnalyticsConfig, type EmailData, type EmailJobPayload, type EmailPluginConfig, EmailService, type EmailServiceInterface, type EmailTemplateName, type EmailTemplateResult, type EmitOrderNotificationTriggerDeps, type EnsureCustomerUserInput, type EnsureMessagingPluginsOptions, type EnsureVendorCustomerDetails, type EntityCrudAction, type EntityMap$2 as EntityMap, type EntityPermissionFlags, type ErpContactSyncInput, type ErpCreateContactPayload, type ErpJobPayload, type ErpPaidOrderDataSource, type ErpPaidOrderEntityMap, Event, type EventOrderMessageTemplateHandlersConfig, type EventOrderNotificationChannel, type EventOrderNotificationTemplates, type EventOrderTemplateOverride, EventProduct, type ExtraPublicWriteRule, type FacebookMeAccountsResponse, type FacebookPageAccount, type ForgotPasswordConfig, Form, type FormBySlugConfig, FormField, FormSubmission, type GetPublicSettingsGroupConfig, type GetPublicSettingsGroupDataSource, type GetSession, type InviteAcceptConfig, JOB_RUNNER_QUEUE, type CmsAppLike as JobRunnerCmsAppLike, type JobRunnerDeps, type JobRunnerPayload, JobSchedule, type JobScheduleApiConfig, JobScheduleRun, KNOWN_NOTIFICATION_TRIGGERS, KnowledgeBaseChunk, KnowledgeBaseDocument, type LatestArticleFromFeed, LlmAgent, type LlmAgentKnowledgeApiConfig, type LlmAgentOptions, type LlmAgentValidationRulesJson, type LlmChatOptions, type LlmEmbeddingProvider, type LlmMessage, type LlmPluginConfig, LlmService, type LlmServiceEmbedOptions, type LlmServiceInterface, type LocalStoragePluginConfig, type Logger, Media, MessageTemplate, type MetaGraphMutationResponse, type NextAuthOptionsConfig, type NextAuthUser, OPEN_ENDPOINTS, ORDER_NOTIFICATION_TRIGGERS, Order, OrderAddresses, OrderDiscounts, OrderItem, OrderNotificationTrigger, type OrderNotificationTriggerKey, type OrderPlacedEmailPayload, type OrderPlacedLineItem, type OrderTriggerPayload, OtpChallenge, type OtpChannel, type OtpPurpose, PERMISSION_REQUIRED_ENDPOINTS, Page, type ParsedLlmAgentValidation, PasswordResetToken, Payment, type PaymentIntent, type PaymentPluginConfig, type PaymentServiceInterface, Permission, type PgBossPluginConfig, PgBossService, type PipelineNames, type PluginContext, Product, ProductAttribute, ProductCategory, ProductConfig, ProductVariant, type PublicThemeSettingsPayload, type QueuePluginConfig, type QueueService, RBAC_ADMIN_ONLY_ENTITIES, type RefundCalculationResult, RefundPolicy, type RefundPolicyLike, type RefundPolicyTier, RefundRequest, type RenderEmailOptions, type RenderedEmail, RssArticle, RssFeed, type S3StoragePluginConfig, SUPER_ADMIN_GROUP_ID, type SendVendorOnboardEmailInput, Seo, type SeoLike, type SeoMetadataOverrides, type SessionUser, type SetPasswordConfig, type SettingsApiConfig, type SmsJobPayload, type SmsPluginConfig, type SmsProviderChoice, type SmsProviderId, type SmsServiceConfig, type SmsServiceInterface, type SocialLinkItem, type SocialMediaPluginConfig, type StorageService, type StorefrontApiConfig, type StorefrontOtpFlags, Tag, Tax, type TemplateContext, type UploadHandlerConfig, User, type UserAuthApiConfig, type UserAvatarConfig, UserGroup, type UserProfileConfig, type UsersApiConfig, VENDOR_ADMIN_GROUP_ID, VENDOR_OWNER_GROUP_NAME, VENDOR_SCOPED_STORE_ENTITIES, VENDOR_STORE_RBAC_ENTITIES, Vendor, VendorCustomer, type VendorDashboardConfig, type VendorOnboardHandlersConfig, type VendorOwnerActivation, VendorRole, VendorRolePermission, VendorUser, type WhatsAppJobPayload, type WhatsAppPluginConfig, type WhatsAppServiceConfig, type WhatsAppServiceInterface, WhatsappTriggerBinding, Wishlist, WishlistItem, ZIP_MIME_TYPES, allowRateLimit, analyticsPlugin, applyVendorCustomersContactFilter, assertCaptchaOk, assertContactAllowedForVendorOrder, blogGeneratorPlugin, buildBlogMetadataUserPrompt, buildCaptchaPublicConfig, buildCronFromSchedule, buildEventOrderTemplateVariables, buildRssUserPromptFromFeeds, cachePlugin, calculateOrderRefundPreview, calculateRefundFromPolicy, canManageRoles, canManageVendorRoles, canManageVendorTeam, canOnboardVendors, captchaPlugin, checkEventsEnabled, checkMultiVendorEnabled, cn, contactIsVendorCustomer, countRecentOtpSends, createAnalyticsHandlers, createAuthHelpers, createBlogBySlugHandler, createChangePasswordHandler, createCmsApiHandler, createCmsApp, createCmsAppWithMessaging, createCmsAuthBundle, createCmsMiddleware, createCrudByIdHandler, createCrudHandler, createDashboardStatsHandler, createDataSourceManager, createEcommerceAnalyticsHandler, createEventOrderMessageTemplateHandlers, createForgotPasswordHandler, createFormBySlugHandler, createInviteAcceptHandler, createJobScheduleHandlers, createLlmAgentKnowledgeHandlers, createMediaZipExtractHandler, createMessageTemplateRowLoader, createOtpChallenge, createSetPasswordHandler, createSettingsApiHandlers, createSocialMediaHandlers, createStorefrontApiHandler, createUploadHandler, createUserAuthApiRouter, createUserAvatarHandler, createUserProfileHandler, createUsersApiHandlers, createVendorDashboardHandler, createVendorOnboardHandlers, customerPhoneForUser, daysBeforeEventStart, defaultPublicApiMethods, describeEventTierPolicy, emailPlugin, emailTemplates, emitOrderNotificationTrigger, enrichUserWithVendorContext, ensureCustomerForUser, ensureMessagingPluginsOnCms, ensureScheduleQueueWorker, ensureVendorCustomerForOrderContact, erpPlugin, explainSessionEntityAccess, fetchSeoBySlug, findActiveRefundPolicyForVendor, fireOrderNotificationTrigger, formatDate, formatDateOnly, formatDateTime, formatTierRange, generateNumericOtp, generateSlug, getCompanyDetailsFromSettings, getNextAuthOptions, getPermissionableEntityKeys, getPublicSettingsGroup, getRequiredPermission, getRssArticleSummaryFromItem, getStorefrontNextAuthOptions, hasEntityPermission, hashOtpCode, hydrateVendorSessionUser, initWhatsappTriggerDispatcher, invalidateEventsCache, invalidateMultiVendorCache, isAuthDebugClientEnabled, isAuthDebugEnabled, isCustomerTypeContact, isOpenEndpoint, isPlatformAdministrator, isPublicMethod, isRbacDebugEnabled, isSuperAdmin, isSuperAdminGroupName, isVendorAdmin, isVendorGroupName, isVendorOwner, isVendorPortalUser, isVendorStaff, isZipMedia, joinRecipientsForSend, linkUnclaimedContactToUser, llmAgentToChatAgentOptions, llmPlugin, loadPublicThemeSettings, loadSettingsGroupFromDb, loadUserVendorContext, localStoragePlugin, logAuth, logAuthClient, logEntityAccessDecision, logRbac, mergeEmailLayoutCompanyDetails, mergeGuardrailsIntoSystemPrompt, mergeSeoBySlug, messagingPlugins, metaFetchUserManagedPages, metaPostPageFeed, metaPostPagePhoto, metaResolvePageAccessToken, nextAuthCookieDebugInfo, normalizePhoneE164, normalizeRefundTiers, notificationTriggerEmitter, overlayCmsPlugins, parseBlogGeneratorAgentContent, parseBlogGeneratorModelOutput, parseBlogMetadataEnrichmentJson, parseEmailRecipientsFromConfig, parseHfInferenceEmbeddingBody, parseLlmAgentValidationRules, paymentPlugin, permissionRowsToRecord, pgBossPlugin, pgBossScheduleNameForId, queueEmail, queueErp, queueErpCreateContactIfEnabled, queueErpPaidOrderForOrderId, queueJobScheduleNow, queueOrderPlacedEmails, queuePlugin, queueSms, queueVendorOnboardEmails, queueWhatsApp, rateLimitCheckoutPost, rateLimitKeyForApiRequest, rateLimitPublicApiIfNeeded, registerEmailQueueProcessor, registerErpQueueProcessor, registerJobRunnerWorker, registerMessagingQueueProcessors, registerSmsQueueProcessor, registerWhatsAppQueueProcessor, relativePathFromMediaParentId, renderEmail, renderLayout, resendOrderNotification, resolveBlogCategoryIdByName, resolveEventOrderTemplate, resolvePublicMetadata, resolveSettingsEncryptionKey, resolveVendorIdForContactCheck, resolveVendorScopeFromSessionUser, s3StoragePlugin, sanitizeMediaFolderPath, sanitizeStorageSegment, seedAdministratorPermissions, seedDefaultAdmin, sendOrderPlacedEmailsAfterConfirmation, sendVendorOnboardEmails, serializeEmailRecipients, sessionHasEntityAccess, shouldRateLimitPublicWrite, simpleDecrypt, simpleEncrypt, smsPlugin, socialMediaPlugin, summarizeEntityPerms, summarizeSessionUserForLog, syncJobScheduleToPgBoss, truncateText, validateRefundTiers, validateScheduleInput, validateSlug, validateUserMessageAgainstAgentRules, validateUserMessageAgainstStructuredRules, vendorPortalFlagsFromUser, verifyAndConsumeOtpChallenge, verifyOtpCodeHash, whatsappPlugin, withAdminRlsContext, withVendorRlsContext, wrapGetCmsWithMessaging };
3840
+ export { ADMIN_GROUP_NAME, Address, type AdminNavItem, type AnalyticsHandlerConfig, type AnalyticsPluginConfig, Attendee, Attribute, type AuthHandlersConfig, type AuthHelpers, type AuthorizeOtpInput, BLOG_GENERATOR_AGENT_NAME, BLOG_GENERATOR_DEFAULT_SYSTEM_INSTRUCTION, BLOG_GENERATOR_DEFAULT_VALIDATION_RULES, BLOG_GENERATOR_LLM_AGENT_SLUG, BLOG_GENERATOR_MARKDOWN_ARTICLE_SEPARATOR, BLOG_METADATA_ENRICHER_AGENT_NAME, BLOG_METADATA_ENRICHER_DEFAULT_SYSTEM_INSTRUCTION, BLOG_METADATA_ENRICHER_DEFAULT_VALIDATION_RULES, BLOG_METADATA_ENRICHER_LLM_AGENT_SLUG, Blog, type BlogBySlugConfig, type BlogGeneratorBlogDraft, type BlogGeneratorDraftParseMode, type BlogGeneratorPluginConfig, type BlogGeneratorSeoDraft, BlogGeneratorService, Brand, CMS_ENTITY_MAP, type CachePluginConfig, type CacheService, type CaptchaProviderId, type CaptchaPublicConfig, CaptchaService, type CaptchaVerifyResult, Cart, CartItem, Category, type ChangePasswordConfig, ChatConversation, ChatMessage, type ChatPublicConfig, type CmsApiHandlerConfig, type CmsApp, type CmsGetter, type CmsMiddlewareConfig, type CmsMiddlewareRequest, type CmsPlugin, Collection, Combo, ComboItem, Comment, type CompanyDetails, Config, Contact, type CreateCmsAppOptions, type CreateCmsAppWithMessagingOptions, type CrudHandlerOptions, Currency, CurrencyExchange, Customer, Customer_Contacts, DEFAULT_ADMIN_NAV, DEFAULT_ORDER_NOTIFICATION_TRIGGER_SEEDS, type DashboardStatsConfig, type DataSourceManager, Discount, DiscountRules, type ERPPluginConfig, type ERPPluginInstance, ERPSubmissionService, EVENT_ORDER_MESSAGE_TEMPLATE_DEFAULTS, EVENT_ORDER_TEMPLATE_KEY, EVENT_ORDER_TEMPLATE_VARIABLES, type EcommerceAnalyticsConfig, type EmailData, type EmailJobPayload, type EmailPluginConfig, EmailService, type EmailServiceInterface, type EmailTemplateName, type EmailTemplateResult, type EmitOrderNotificationTriggerDeps, type EnsureCustomerUserInput, type EnsureMessagingPluginsOptions, type EnsureVendorCustomerDetails, type EntityCrudAction, type EntityMap$2 as EntityMap, type EntityPermissionFlags, type ErpContactSyncInput, type ErpCreateContactPayload, type ErpJobPayload, type ErpPaidOrderDataSource, type ErpPaidOrderEntityMap, Event, type EventOrderMessageTemplateHandlersConfig, type EventOrderNotificationChannel, type EventOrderNotificationTemplates, type EventOrderTemplateOverride, EventProduct, type ExtraPublicWriteRule, type FacebookMeAccountsResponse, type FacebookPageAccount, type ForgotPasswordConfig, Form, type FormBySlugConfig, FormField, FormSubmission, type GetPublicSettingsGroupConfig, type GetPublicSettingsGroupDataSource, type GetSession, type InviteAcceptConfig, JOB_RUNNER_QUEUE, type CmsAppLike as JobRunnerCmsAppLike, type JobRunnerDeps, type JobRunnerPayload, JobSchedule, type JobScheduleApiConfig, JobScheduleRun, KNOWN_NOTIFICATION_TRIGGERS, KnowledgeBaseChunk, KnowledgeBaseDocument, type LatestArticleFromFeed, LlmAgent, type LlmAgentKnowledgeApiConfig, type LlmAgentOptions, type LlmAgentValidationRulesJson, type LlmChatOptions, type LlmEmbeddingProvider, type LlmMessage, type LlmPluginConfig, LlmService, type LlmServiceEmbedOptions, type LlmServiceInterface, type LocalStoragePluginConfig, type Logger, Media, MessageTemplate, type MetaGraphMutationResponse, type NextAuthOptionsConfig, type NextAuthUser, OPEN_ENDPOINTS, ORDER_NOTIFICATION_TRIGGERS, Order, OrderAddresses, OrderDiscounts, OrderItem, OrderNotificationBinding, OrderNotificationTrigger, type OrderNotificationTriggerKey, type OrderPlacedEmailPayload, type OrderPlacedLineItem, type OrderTriggerPayload, OtpChallenge, type OtpChannel, type OtpPurpose, PERMISSION_REQUIRED_ENDPOINTS, Page, type ParsedLlmAgentValidation, PasswordResetToken, Payment, type PaymentIntent, type PaymentPluginConfig, type PaymentServiceInterface, Permission, type PgBossPluginConfig, PgBossService, type PipelineNames, type PluginContext, Product, ProductAttribute, ProductCategory, ProductConfig, ProductVariant, type PublicThemeSettingsPayload, type QueuePluginConfig, type QueueService, RBAC_ADMIN_ONLY_ENTITIES, type RefundCalculationResult, RefundPolicy, type RefundPolicyLike, type RefundPolicyTier, RefundRequest, type RenderEmailOptions, type RenderedEmail, RssArticle, RssFeed, type S3StoragePluginConfig, SUPER_ADMIN_GROUP_ID, type SendVendorOnboardEmailInput, Seo, type SeoLike, type SeoMetadataOverrides, type SessionUser, type SetPasswordConfig, type SettingsApiConfig, type SmsJobPayload, type SmsPluginConfig, type SmsProviderChoice, type SmsProviderId, type SmsServiceConfig, type SmsServiceInterface, type SocialLinkItem, type SocialMediaPluginConfig, type StorageService, type StorefrontApiConfig, type StorefrontOtpFlags, Tag, Tax, type TemplateContext, type UploadHandlerConfig, User, type UserAuthApiConfig, type UserAvatarConfig, UserGroup, type UserProfileConfig, type UsersApiConfig, VENDOR_ADMIN_GROUP_ID, VENDOR_OWNER_GROUP_NAME, VENDOR_SCOPED_STORE_ENTITIES, VENDOR_STORE_RBAC_ENTITIES, Vendor, VendorCustomer, type VendorDashboardConfig, type VendorOnboardHandlersConfig, type VendorOwnerActivation, VendorRole, VendorRolePermission, VendorUser, type WhatsAppJobPayload, type WhatsAppPluginConfig, type WhatsAppServiceConfig, type WhatsAppServiceInterface, Wishlist, WishlistItem, ZIP_MIME_TYPES, allowRateLimit, analyticsPlugin, applyVendorCustomersContactFilter, assertCaptchaOk, assertContactAllowedForVendorOrder, blogGeneratorPlugin, buildBlogMetadataUserPrompt, buildCaptchaPublicConfig, buildCronFromSchedule, buildEventOrderTemplateVariables, buildRssUserPromptFromFeeds, cachePlugin, calculateOrderRefundPreview, calculateRefundFromPolicy, canManageRoles, canManageVendorRoles, canManageVendorTeam, canOnboardVendors, captchaPlugin, checkEventsEnabled, checkMultiVendorEnabled, cn, contactIsVendorCustomer, countRecentOtpSends, createAnalyticsHandlers, createAuthHelpers, createBlogBySlugHandler, createChangePasswordHandler, createCmsApiHandler, createCmsApp, createCmsAppWithMessaging, createCmsAuthBundle, createCmsMiddleware, createCrudByIdHandler, createCrudHandler, createDashboardStatsHandler, createDataSourceManager, createEcommerceAnalyticsHandler, createEventOrderMessageTemplateHandlers, createForgotPasswordHandler, createFormBySlugHandler, createInviteAcceptHandler, createJobScheduleHandlers, createLlmAgentKnowledgeHandlers, createMediaZipExtractHandler, createMessageTemplateRowLoader, createOtpChallenge, createSetPasswordHandler, createSettingsApiHandlers, createSocialMediaHandlers, createStorefrontApiHandler, createUploadHandler, createUserAuthApiRouter, createUserAvatarHandler, createUserProfileHandler, createUsersApiHandlers, createVendorDashboardHandler, createVendorOnboardHandlers, customerPhoneForUser, daysBeforeEventStart, defaultPublicApiMethods, describeEventTierPolicy, emailPlugin, emailTemplates, emitOrderNotificationTrigger, enrichUserWithVendorContext, ensureCustomerForUser, ensureMessagingPluginsOnCms, ensureScheduleQueueWorker, ensureVendorCustomerForOrderContact, erpPlugin, explainSessionEntityAccess, fetchSeoBySlug, findActiveRefundPolicyForVendor, fireOrderNotificationTrigger, formatDate, formatDateOnly, formatDateTime, formatTierRange, generateNumericOtp, generateSlug, getCompanyDetailsFromSettings, getNextAuthOptions, getPermissionableEntityKeys, getPublicSettingsGroup, getRequiredPermission, getRssArticleSummaryFromItem, getStorefrontNextAuthOptions, hasEntityPermission, hashOtpCode, hydrateVendorSessionUser, initWhatsappTriggerDispatcher, invalidateEventsCache, invalidateMultiVendorCache, isAuthDebugClientEnabled, isAuthDebugEnabled, isCustomerTypeContact, isOpenEndpoint, isPlatformAdministrator, isPublicMethod, isRbacDebugEnabled, isSuperAdmin, isSuperAdminGroupName, isVendorAdmin, isVendorGroupName, isVendorOwner, isVendorPortalUser, isVendorStaff, isZipMedia, joinRecipientsForSend, linkUnclaimedContactToUser, llmAgentToChatAgentOptions, llmPlugin, loadPublicThemeSettings, loadSettingsGroupFromDb, loadUserVendorContext, localStoragePlugin, logAuth, logAuthClient, logEntityAccessDecision, logRbac, mergeEmailLayoutCompanyDetails, mergeGuardrailsIntoSystemPrompt, mergeSeoBySlug, messagingPlugins, metaFetchUserManagedPages, metaPostPageFeed, metaPostPagePhoto, metaResolvePageAccessToken, nextAuthCookieDebugInfo, normalizePhoneE164, normalizeRefundTiers, notificationTriggerEmitter, overlayCmsPlugins, parseBlogGeneratorAgentContent, parseBlogGeneratorModelOutput, parseBlogMetadataEnrichmentJson, parseEmailRecipientsFromConfig, parseHfInferenceEmbeddingBody, parseLlmAgentValidationRules, paymentPlugin, permissionRowsToRecord, pgBossPlugin, pgBossScheduleNameForId, queueEmail, queueErp, queueErpCreateContactIfEnabled, queueErpPaidOrderForOrderId, queueJobScheduleNow, queueOrderPlacedEmails, queuePlugin, queueSms, queueVendorOnboardEmails, queueWhatsApp, rateLimitCheckoutPost, rateLimitKeyForApiRequest, rateLimitPublicApiIfNeeded, registerEmailQueueProcessor, registerErpQueueProcessor, registerJobRunnerWorker, registerMessagingQueueProcessors, registerSmsQueueProcessor, registerWhatsAppQueueProcessor, relativePathFromMediaParentId, renderEmail, renderLayout, resendOrderNotification, resolveBlogCategoryIdByName, resolveEventOrderTemplate, resolvePublicMetadata, resolveSettingsEncryptionKey, resolveVendorIdForContactCheck, resolveVendorScopeFromSessionUser, s3StoragePlugin, sanitizeMediaFolderPath, sanitizeStorageSegment, seedAdministratorPermissions, seedDefaultAdmin, sendOrderPlacedEmailsAfterConfirmation, sendVendorOnboardEmails, serializeEmailRecipients, sessionHasEntityAccess, shouldRateLimitPublicWrite, simpleDecrypt, simpleEncrypt, smsPlugin, socialMediaPlugin, summarizeEntityPerms, summarizeSessionUserForLog, syncJobScheduleToPgBoss, truncateText, validateRefundTiers, validateScheduleInput, validateSlug, validateUserMessageAgainstAgentRules, validateUserMessageAgainstStructuredRules, vendorPortalFlagsFromUser, verifyAndConsumeOtpChallenge, verifyOtpCodeHash, whatsappPlugin, withAdminRlsContext, withVendorRlsContext, wrapGetCmsWithMessaging };
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  export { emitOrderNotificationTrigger, fireOrderNotificationTrigger } from './chunk-X47PBV4I.js';
2
- import { checkMultiVendorEnabled, loadUserVendorContext, getPublicSettingsGroup, BlogGeneratorService } from './chunk-JS2W7XZ4.js';
3
- export { Address, Attendee, Attribute, BLOG_GENERATOR_AGENT_NAME, BLOG_GENERATOR_DEFAULT_SYSTEM_INSTRUCTION, BLOG_GENERATOR_DEFAULT_VALIDATION_RULES, BLOG_GENERATOR_LLM_AGENT_SLUG, BLOG_GENERATOR_MARKDOWN_ARTICLE_SEPARATOR, BLOG_METADATA_ENRICHER_AGENT_NAME, BLOG_METADATA_ENRICHER_DEFAULT_SYSTEM_INSTRUCTION, BLOG_METADATA_ENRICHER_DEFAULT_VALIDATION_RULES, BLOG_METADATA_ENRICHER_LLM_AGENT_SLUG, Blog, BlogGeneratorService, Brand, CMS_ENTITY_MAP, Cart, CartItem, Category, ChatConversation, ChatMessage, Collection, Combo, ComboItem, Comment, Config, Contact, Currency, CurrencyExchange, Customer, Customer_Contacts, Discount, DiscountRules, Event, EventProduct, Form, FormField, FormSubmission, JobSchedule, JobScheduleRun, KnowledgeBaseChunk, KnowledgeBaseDocument, LlmAgent, Media, MessageTemplate, Order, OrderAddresses, OrderDiscounts, OrderItem, OrderNotificationTrigger, OtpChallenge, Page, PasswordResetToken, Payment, Permission, Product, ProductAttribute, ProductCategory, ProductConfig, ProductVariant, RefundPolicy, RefundRequest, RssArticle, RssFeed, Seo, Tag, Tax, User, UserGroup, Vendor, VendorCustomer, VendorRole, VendorRolePermission, VendorUser, WhatsappTriggerBinding, Wishlist, WishlistItem, ZIP_MIME_TYPES, applyVendorCustomersContactFilter, assertCaptchaOk, assertContactAllowedForVendorOrder, buildBlogMetadataUserPrompt, buildCronFromSchedule, buildRssUserPromptFromFeeds, calculateOrderRefundPreview, calculateRefundFromPolicy, checkEventsEnabled, checkMultiVendorEnabled, contactIsVendorCustomer, countRecentOtpSends, createAnalyticsHandlers, createBlogBySlugHandler, createChangePasswordHandler, createCmsApiHandler, createCmsApp, createCmsAppWithMessaging, createCrudByIdHandler, createCrudHandler, createDashboardStatsHandler, createEcommerceAnalyticsHandler, createEventOrderMessageTemplateHandlers, createForgotPasswordHandler, createFormBySlugHandler, createInviteAcceptHandler, createJobScheduleHandlers, createLlmAgentKnowledgeHandlers, createMediaZipExtractHandler, createMessageTemplateRowLoader, createOtpChallenge, createSetPasswordHandler, createSettingsApiHandlers, createSocialMediaHandlers, createStorefrontApiHandler, createUploadHandler, createUserAuthApiRouter, createUserAvatarHandler, createUserProfileHandler, createUsersApiHandlers, createVendorDashboardHandler, createVendorOnboardHandlers, customerPhoneForUser, daysBeforeEventStart, describeEventTierPolicy, ensureCustomerForUser, ensureMessagingPluginsOnCms, ensureScheduleQueueWorker, ensureVendorCustomerForOrderContact, findActiveRefundPolicyForVendor, formatTierRange, generateNumericOtp, getPublicSettingsGroup, getRssArticleSummaryFromItem, hashOtpCode, hydrateVendorSessionUser, invalidateEventsCache, invalidateMultiVendorCache, isCustomerTypeContact, isZipMedia, linkUnclaimedContactToUser, llmAgentToChatAgentOptions, loadSettingsGroupFromDb, loadUserVendorContext, mergeGuardrailsIntoSystemPrompt, messagingPlugins, metaFetchUserManagedPages, metaPostPageFeed, metaPostPagePhoto, metaResolvePageAccessToken, normalizePhoneE164, normalizeRefundTiers, overlayCmsPlugins, parseBlogGeneratorAgentContent, parseBlogGeneratorModelOutput, parseBlogMetadataEnrichmentJson, parseLlmAgentValidationRules, pgBossScheduleNameForId, queueErpCreateContactIfEnabled, queueJobScheduleNow, queuePlugin, queueSms, registerJobRunnerWorker, registerMessagingQueueProcessors, registerSmsQueueProcessor, relativePathFromMediaParentId, resolveBlogCategoryIdByName, resolveSettingsEncryptionKey, resolveVendorIdForContactCheck, sanitizeMediaFolderPath, sanitizeStorageSegment, sendVendorOnboardEmails, simpleDecrypt, simpleEncrypt, syncJobScheduleToPgBoss, validateRefundTiers, validateScheduleInput, validateUserMessageAgainstAgentRules, validateUserMessageAgainstStructuredRules, verifyAndConsumeOtpChallenge, verifyOtpCodeHash, whatsappPlugin, wrapGetCmsWithMessaging } from './chunk-JS2W7XZ4.js';
4
- import { mergeEmailLayoutCompanyDetails, parseEmailRecipientsFromConfig } from './chunk-VMY2S32H.js';
5
- export { EmailService, buildEventOrderTemplateVariables, emailPlugin, emailTemplates, getCompanyDetailsFromSettings, initWhatsappTriggerDispatcher, joinRecipientsForSend, mergeEmailLayoutCompanyDetails, parseEmailRecipientsFromConfig, queueWhatsApp, registerWhatsAppQueueProcessor, renderEmail, renderLayout, resendOrderNotification, serializeEmailRecipients } from './chunk-VMY2S32H.js';
2
+ import { checkMultiVendorEnabled, loadUserVendorContext, getPublicSettingsGroup, BlogGeneratorService } from './chunk-PYUXVU75.js';
3
+ export { Address, Attendee, Attribute, BLOG_GENERATOR_AGENT_NAME, BLOG_GENERATOR_DEFAULT_SYSTEM_INSTRUCTION, BLOG_GENERATOR_DEFAULT_VALIDATION_RULES, BLOG_GENERATOR_LLM_AGENT_SLUG, BLOG_GENERATOR_MARKDOWN_ARTICLE_SEPARATOR, BLOG_METADATA_ENRICHER_AGENT_NAME, BLOG_METADATA_ENRICHER_DEFAULT_SYSTEM_INSTRUCTION, BLOG_METADATA_ENRICHER_DEFAULT_VALIDATION_RULES, BLOG_METADATA_ENRICHER_LLM_AGENT_SLUG, Blog, BlogGeneratorService, Brand, CMS_ENTITY_MAP, Cart, CartItem, Category, ChatConversation, ChatMessage, Collection, Combo, ComboItem, Comment, Config, Contact, Currency, CurrencyExchange, Customer, Customer_Contacts, Discount, DiscountRules, Event, EventProduct, Form, FormField, FormSubmission, JobSchedule, JobScheduleRun, KnowledgeBaseChunk, KnowledgeBaseDocument, LlmAgent, Media, MessageTemplate, Order, OrderAddresses, OrderDiscounts, OrderItem, OrderNotificationBinding, OrderNotificationTrigger, OtpChallenge, Page, PasswordResetToken, Payment, Permission, Product, ProductAttribute, ProductCategory, ProductConfig, ProductVariant, RefundPolicy, RefundRequest, RssArticle, RssFeed, Seo, Tag, Tax, User, UserGroup, Vendor, VendorCustomer, VendorRole, VendorRolePermission, VendorUser, Wishlist, WishlistItem, ZIP_MIME_TYPES, applyVendorCustomersContactFilter, assertCaptchaOk, assertContactAllowedForVendorOrder, buildBlogMetadataUserPrompt, buildCronFromSchedule, buildRssUserPromptFromFeeds, calculateOrderRefundPreview, calculateRefundFromPolicy, checkEventsEnabled, checkMultiVendorEnabled, contactIsVendorCustomer, countRecentOtpSends, createAnalyticsHandlers, createBlogBySlugHandler, createChangePasswordHandler, createCmsApiHandler, createCmsApp, createCmsAppWithMessaging, createCrudByIdHandler, createCrudHandler, createDashboardStatsHandler, createEcommerceAnalyticsHandler, createEventOrderMessageTemplateHandlers, createForgotPasswordHandler, createFormBySlugHandler, createInviteAcceptHandler, createJobScheduleHandlers, createLlmAgentKnowledgeHandlers, createMediaZipExtractHandler, createMessageTemplateRowLoader, createOtpChallenge, createSetPasswordHandler, createSettingsApiHandlers, createSocialMediaHandlers, createStorefrontApiHandler, createUploadHandler, createUserAuthApiRouter, createUserAvatarHandler, createUserProfileHandler, createUsersApiHandlers, createVendorDashboardHandler, createVendorOnboardHandlers, customerPhoneForUser, daysBeforeEventStart, describeEventTierPolicy, ensureCustomerForUser, ensureMessagingPluginsOnCms, ensureScheduleQueueWorker, ensureVendorCustomerForOrderContact, findActiveRefundPolicyForVendor, formatTierRange, generateNumericOtp, getPublicSettingsGroup, getRssArticleSummaryFromItem, hashOtpCode, hydrateVendorSessionUser, invalidateEventsCache, invalidateMultiVendorCache, isCustomerTypeContact, isZipMedia, linkUnclaimedContactToUser, llmAgentToChatAgentOptions, loadSettingsGroupFromDb, loadUserVendorContext, mergeGuardrailsIntoSystemPrompt, messagingPlugins, metaFetchUserManagedPages, metaPostPageFeed, metaPostPagePhoto, metaResolvePageAccessToken, normalizePhoneE164, normalizeRefundTiers, overlayCmsPlugins, parseBlogGeneratorAgentContent, parseBlogGeneratorModelOutput, parseBlogMetadataEnrichmentJson, parseLlmAgentValidationRules, pgBossScheduleNameForId, queueErpCreateContactIfEnabled, queueJobScheduleNow, queuePlugin, queueSms, registerJobRunnerWorker, registerMessagingQueueProcessors, registerSmsQueueProcessor, relativePathFromMediaParentId, resolveBlogCategoryIdByName, resolveSettingsEncryptionKey, resolveVendorIdForContactCheck, sanitizeMediaFolderPath, sanitizeStorageSegment, sendVendorOnboardEmails, simpleDecrypt, simpleEncrypt, syncJobScheduleToPgBoss, validateRefundTiers, validateScheduleInput, validateUserMessageAgainstAgentRules, validateUserMessageAgainstStructuredRules, verifyAndConsumeOtpChallenge, verifyOtpCodeHash, whatsappPlugin, wrapGetCmsWithMessaging } from './chunk-PYUXVU75.js';
4
+ import { mergeEmailLayoutCompanyDetails, parseEmailRecipientsFromConfig } from './chunk-NNQBWDCI.js';
5
+ export { EmailService, buildEventOrderTemplateVariables, emailPlugin, emailTemplates, getCompanyDetailsFromSettings, initWhatsappTriggerDispatcher, joinRecipientsForSend, mergeEmailLayoutCompanyDetails, parseEmailRecipientsFromConfig, queueWhatsApp, registerWhatsAppQueueProcessor, renderEmail, renderLayout, resendOrderNotification, serializeEmailRecipients } from './chunk-NNQBWDCI.js';
6
6
  export { KNOWN_NOTIFICATION_TRIGGERS, notificationTriggerEmitter } from './chunk-HCIRL37O.js';
7
7
  import './chunk-JXF23MPG.js';
8
8
  import './chunk-WEMDMVHQ.js';
@@ -13,10 +13,10 @@ import './chunk-CRFV5WJK.js';
13
13
  export { EVENT_ORDER_MESSAGE_TEMPLATE_DEFAULTS, EVENT_ORDER_TEMPLATE_KEY, EVENT_ORDER_TEMPLATE_VARIABLES, resolveEventOrderTemplate } from './chunk-KFFB6EMZ.js';
14
14
  import { PgBossService } from './chunk-GO7PPYNU.js';
15
15
  export { JOB_RUNNER_QUEUE, PgBossService } from './chunk-GO7PPYNU.js';
16
- export { createCmsMiddleware, defaultPublicApiMethods, getNextAuthOptions, getStorefrontNextAuthOptions, isAuthDebugClientEnabled, isAuthDebugEnabled, logAuth, logAuthClient, nextAuthCookieDebugInfo, seedAdministratorPermissions, summarizeSessionUserForLog } from './chunk-FG6I64HP.js';
17
- export { OPEN_ENDPOINTS, PERMISSION_REQUIRED_ENDPOINTS, RBAC_ADMIN_ONLY_ENTITIES, canManageRoles, createAuthHelpers, createCmsAuthBundle, getRequiredPermission, isOpenEndpoint, isPublicMethod, sessionHasEntityAccess } from './chunk-LI2IXVAY.js';
18
- import { isSuperAdmin, isVendorGroupName } from './chunk-UF3BYUXY.js';
19
- export { ADMIN_GROUP_NAME, SUPER_ADMIN_GROUP_ID, VENDOR_ADMIN_GROUP_ID, VENDOR_OWNER_GROUP_NAME, VENDOR_SCOPED_STORE_ENTITIES, VENDOR_STORE_RBAC_ENTITIES, canManageVendorRoles, canManageVendorTeam, canOnboardVendors, explainSessionEntityAccess, getPermissionableEntityKeys, hasEntityPermission, isPlatformAdministrator, isRbacDebugEnabled, isSuperAdmin, isSuperAdminGroupName, isVendorAdmin, isVendorGroupName, isVendorOwner, isVendorPortalUser, isVendorStaff, logEntityAccessDecision, logRbac, permissionRowsToRecord, resolveVendorScopeFromSessionUser, summarizeEntityPerms, vendorPortalFlagsFromUser } from './chunk-UF3BYUXY.js';
16
+ export { createCmsMiddleware, defaultPublicApiMethods, getNextAuthOptions, getStorefrontNextAuthOptions, isAuthDebugClientEnabled, isAuthDebugEnabled, logAuth, logAuthClient, nextAuthCookieDebugInfo, seedAdministratorPermissions, summarizeSessionUserForLog } from './chunk-SBRBR3VO.js';
17
+ export { OPEN_ENDPOINTS, PERMISSION_REQUIRED_ENDPOINTS, RBAC_ADMIN_ONLY_ENTITIES, canManageRoles, createAuthHelpers, createCmsAuthBundle, getRequiredPermission, isOpenEndpoint, isPublicMethod, sessionHasEntityAccess } from './chunk-UXMDSNIG.js';
18
+ import { isSuperAdmin, isVendorGroupName } from './chunk-P7QCLE5W.js';
19
+ export { ADMIN_GROUP_NAME, SUPER_ADMIN_GROUP_ID, VENDOR_ADMIN_GROUP_ID, VENDOR_OWNER_GROUP_NAME, VENDOR_SCOPED_STORE_ENTITIES, VENDOR_STORE_RBAC_ENTITIES, canManageVendorRoles, canManageVendorTeam, canOnboardVendors, explainSessionEntityAccess, getPermissionableEntityKeys, hasEntityPermission, isPlatformAdministrator, isRbacDebugEnabled, isSuperAdmin, isSuperAdminGroupName, isVendorAdmin, isVendorGroupName, isVendorOwner, isVendorPortalUser, isVendorStaff, logEntityAccessDecision, logRbac, permissionRowsToRecord, resolveVendorScopeFromSessionUser, summarizeEntityPerms, vendorPortalFlagsFromUser } from './chunk-P7QCLE5W.js';
20
20
  export { queueErpPaidOrderForOrderId } from './chunk-TDV6EJHV.js';
21
21
  import { erpSafeWebhookUrl, logErp, warnErp, errorErp } from './chunk-SYBOCAWB.js';
22
22
  export { queueErp, registerErpQueueProcessor } from './chunk-SYBOCAWB.js';
@@ -4,7 +4,6 @@ export class RssFeedsAndArticles1775500000000 implements MigrationInterface {
4
4
  name = 'RssFeedsAndArticles1775500000000';
5
5
 
6
6
  public async up(queryRunner: QueryRunner): Promise<void> {
7
- await queryRunner.query(`CREATE EXTENSION IF NOT EXISTS "pgcrypto"`);
8
7
  await queryRunner.query(`
9
8
  CREATE TABLE IF NOT EXISTS "rss_feeds" (
10
9
  "id" uuid NOT NULL DEFAULT gen_random_uuid(),
@@ -4,7 +4,6 @@ export class JobSchedules1775700000000 implements MigrationInterface {
4
4
  name = 'JobSchedules1775700000000';
5
5
 
6
6
  public async up(queryRunner: QueryRunner): Promise<void> {
7
- await queryRunner.query(`CREATE EXTENSION IF NOT EXISTS "pgcrypto"`);
8
7
  await queryRunner.query(`
9
8
  CREATE TABLE IF NOT EXISTS "job_schedules" (
10
9
  "id" uuid NOT NULL DEFAULT gen_random_uuid(),
@@ -0,0 +1,92 @@
1
+ import { MigrationInterface, QueryRunner } from 'typeorm';
2
+
3
+ export class RenameWhatsappTriggerBindingsToOrderNotificationBindings1781260000000
4
+ implements MigrationInterface
5
+ {
6
+ name = 'RenameWhatsappTriggerBindingsToOrderNotificationBindings1781260000000';
7
+
8
+ public async up(queryRunner: QueryRunner): Promise<void> {
9
+ // 1. Create the channel enum type.
10
+ await queryRunner.query(`
11
+ CREATE TYPE "order_notification_bindings_channel_enum" AS ENUM ('whatsapp', 'email')
12
+ `);
13
+
14
+ // 2. Rename the table.
15
+ await queryRunner.query(`
16
+ ALTER TABLE "whatsapp_trigger_bindings" RENAME TO "order_notification_bindings"
17
+ `);
18
+
19
+ // 3. Add the channel column, defaulting existing (whatsapp-only) rows to 'whatsapp'.
20
+ await queryRunner.query(`
21
+ ALTER TABLE "order_notification_bindings"
22
+ ADD COLUMN "channel" "order_notification_bindings_channel_enum" NOT NULL DEFAULT 'whatsapp'
23
+ `);
24
+
25
+ // 4. Drop the old UNIQUE(triggerKey) constraint, whatever it's actually named.
26
+ // Looked up dynamically so this migration doesn't depend on guessing
27
+ // TypeORM's auto-generated constraint name correctly.
28
+ await queryRunner.query(`
29
+ DO $$
30
+ DECLARE
31
+ old_constraint_name text;
32
+ BEGIN
33
+ SELECT con.conname INTO old_constraint_name
34
+ FROM pg_constraint con
35
+ JOIN pg_class rel ON rel.oid = con.conrelid
36
+ JOIN pg_attribute attr ON attr.attrelid = con.conrelid AND attr.attnum = ANY(con.conkey)
37
+ WHERE rel.relname = 'order_notification_bindings'
38
+ AND con.contype = 'u'
39
+ AND attr.attname = 'triggerKey'
40
+ AND array_length(con.conkey, 1) = 1
41
+ LIMIT 1;
42
+
43
+ IF old_constraint_name IS NOT NULL THEN
44
+ EXECUTE format('ALTER TABLE "order_notification_bindings" DROP CONSTRAINT %I', old_constraint_name);
45
+ END IF;
46
+ END $$;
47
+ `);
48
+
49
+ // 5. Add the new composite unique constraint.
50
+ await queryRunner.query(`
51
+ ALTER TABLE "order_notification_bindings"
52
+ ADD CONSTRAINT "UQ_order_notification_bindings_triggerKey_channel" UNIQUE ("triggerKey", "channel")
53
+ `);
54
+ }
55
+
56
+ public async down(queryRunner: QueryRunner): Promise<void> {
57
+ // 1. Drop the composite unique constraint.
58
+ await queryRunner.query(`
59
+ ALTER TABLE "order_notification_bindings"
60
+ DROP CONSTRAINT "UQ_order_notification_bindings_triggerKey_channel"
61
+ `);
62
+
63
+ // 2. Drop rows that aren't 'whatsapp' before reverting — the old schema
64
+ // has no channel column and can't represent email bindings. This is a
65
+ // lossy rollback by necessity; back up order_notification_bindings
66
+ // first if you need to preserve email bindings across a rollback.
67
+ await queryRunner.query(`
68
+ DELETE FROM "order_notification_bindings" WHERE "channel" != 'whatsapp'
69
+ `);
70
+
71
+ // 3. Drop the channel column.
72
+ await queryRunner.query(`
73
+ ALTER TABLE "order_notification_bindings" DROP COLUMN "channel"
74
+ `);
75
+
76
+ // 4. Restore the original single-column unique constraint.
77
+ await queryRunner.query(`
78
+ ALTER TABLE "order_notification_bindings"
79
+ ADD CONSTRAINT "UQ_whatsapp_trigger_bindings_triggerKey" UNIQUE ("triggerKey")
80
+ `);
81
+
82
+ // 5. Rename the table back.
83
+ await queryRunner.query(`
84
+ ALTER TABLE "order_notification_bindings" RENAME TO "whatsapp_trigger_bindings"
85
+ `);
86
+
87
+ // 6. Drop the enum type.
88
+ await queryRunner.query(`
89
+ DROP TYPE "order_notification_bindings_channel_enum"
90
+ `);
91
+ }
92
+ }
@@ -0,0 +1,58 @@
1
+ import type { MigrationInterface, QueryRunner } from 'typeorm';
2
+
3
+ /**
4
+ * Scope combos to a vendor store (`vendorId` column, FK, index, RLS),
5
+ * matching products / discounts.
6
+ */
7
+ export class ComboVendorId1781270000000 implements MigrationInterface {
8
+ name = 'ComboVendorId1781270000000';
9
+
10
+ public async up(queryRunner: QueryRunner): Promise<void> {
11
+ await queryRunner.query(`ALTER TABLE "combos" ADD COLUMN IF NOT EXISTS "vendorId" integer`);
12
+
13
+ await queryRunner.query(`
14
+ UPDATE "combos"
15
+ SET "vendorId" = (SELECT id FROM "vendors" WHERE "slug" = 'default' LIMIT 1)
16
+ WHERE "vendorId" IS NULL
17
+ `);
18
+
19
+ await queryRunner.query(`ALTER TABLE "combos" ALTER COLUMN "vendorId" SET NOT NULL`);
20
+
21
+ await queryRunner.query(`
22
+ DO $$ BEGIN
23
+ ALTER TABLE "combos" ADD CONSTRAINT "FK_combos_vendorId"
24
+ FOREIGN KEY ("vendorId") REFERENCES "vendors"("id") ON DELETE RESTRICT ON UPDATE NO ACTION;
25
+ EXCEPTION WHEN duplicate_object THEN NULL;
26
+ END $$
27
+ `);
28
+
29
+ await queryRunner.query(
30
+ `CREATE INDEX IF NOT EXISTS "IDX_combos_vendorId" ON "combos" ("vendorId")`
31
+ );
32
+
33
+ await queryRunner.query(`ALTER TABLE "combos" ENABLE ROW LEVEL SECURITY`);
34
+ await queryRunner.query(`ALTER TABLE "combos" FORCE ROW LEVEL SECURITY`);
35
+ await queryRunner.query(`DROP POLICY IF EXISTS "vendor_isolation" ON "combos"`);
36
+ await queryRunner.query(`
37
+ CREATE POLICY "vendor_isolation" ON "combos"
38
+ USING (
39
+ COALESCE(NULLIF(current_setting('app.vendor_id', true), ''), '0') = '0'
40
+ OR "vendorId" = NULLIF(current_setting('app.vendor_id', true), '')::integer
41
+ )
42
+ WITH CHECK (
43
+ COALESCE(NULLIF(current_setting('app.vendor_id', true), ''), '0') = '0'
44
+ OR "vendorId" = NULLIF(current_setting('app.vendor_id', true), '')::integer
45
+ )
46
+ `);
47
+ }
48
+
49
+ public async down(queryRunner: QueryRunner): Promise<void> {
50
+ await queryRunner.query(`DROP POLICY IF EXISTS "vendor_isolation" ON "combos"`);
51
+ await queryRunner.query(`ALTER TABLE "combos" NO FORCE ROW LEVEL SECURITY`);
52
+ await queryRunner.query(`ALTER TABLE "combos" DISABLE ROW LEVEL SECURITY`);
53
+
54
+ await queryRunner.query(`ALTER TABLE "combos" DROP CONSTRAINT IF EXISTS "FK_combos_vendorId"`);
55
+ await queryRunner.query(`DROP INDEX IF EXISTS "IDX_combos_vendorId"`);
56
+ await queryRunner.query(`ALTER TABLE "combos" DROP COLUMN IF EXISTS "vendorId"`);
57
+ }
58
+ }
@@ -1,19 +1,18 @@
1
1
  'use strict';
2
2
 
3
- var chunkCOBORIJH_cjs = require('./chunk-COBORIJH.cjs');
3
+ var chunk22FFHLTO_cjs = require('./chunk-22FFHLTO.cjs');
4
4
  require('./chunk-UCKN4BBY.cjs');
5
5
  require('./chunk-XW5ATPRW.cjs');
6
6
  require('./chunk-OOTLNH63.cjs');
7
- require('./chunk-SPQFNIYJ.cjs');
8
7
  require('./chunk-USNT2KNT.cjs');
9
8
 
10
9
 
11
10
 
12
11
  Object.defineProperty(exports, "initWhatsappTriggerDispatcher", {
13
12
  enumerable: true,
14
- get: function () { return chunkCOBORIJH_cjs.initWhatsappTriggerDispatcher; }
13
+ get: function () { return chunk22FFHLTO_cjs.initWhatsappTriggerDispatcher; }
15
14
  });
16
15
  Object.defineProperty(exports, "resendOrderNotification", {
17
16
  enumerable: true,
18
- get: function () { return chunkCOBORIJH_cjs.resendOrderNotification; }
17
+ get: function () { return chunk22FFHLTO_cjs.resendOrderNotification; }
19
18
  });
@@ -1,6 +1,5 @@
1
- export { initWhatsappTriggerDispatcher, resendOrderNotification } from './chunk-VMY2S32H.js';
1
+ export { initWhatsappTriggerDispatcher, resendOrderNotification } from './chunk-NNQBWDCI.js';
2
2
  import './chunk-HCIRL37O.js';
3
3
  import './chunk-5ELSW2UP.js';
4
4
  import './chunk-CRFV5WJK.js';
5
- import './chunk-KFFB6EMZ.js';
6
5
  import './chunk-SHUYVCID.js';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkKPKFNLQQ_cjs = require('./chunk-KPKFNLQQ.cjs');
3
+ var chunkWMXPKKXU_cjs = require('./chunk-WMXPKKXU.cjs');
4
4
  var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
5
5
 
6
6
  // src/auth/rbac-debug-db.ts
@@ -27,7 +27,7 @@ async function loadDbPermissionsForUser(dataSource, userId) {
27
27
  return {
28
28
  groupId,
29
29
  groupName,
30
- dbEntityPerms: chunkKPKFNLQQ_cjs.summarizeEntityPerms(chunkKPKFNLQQ_cjs.permissionRowsToRecord(permRows))
30
+ dbEntityPerms: chunkWMXPKKXU_cjs.summarizeEntityPerms(chunkWMXPKKXU_cjs.permissionRowsToRecord(permRows))
31
31
  };
32
32
  }
33
33
  chunkUSNT2KNT_cjs.__name(loadDbPermissionsForUser, "loadDbPermissionsForUser");
@@ -1,4 +1,4 @@
1
- import { summarizeEntityPerms, permissionRowsToRecord } from './chunk-UF3BYUXY.js';
1
+ import { summarizeEntityPerms, permissionRowsToRecord } from './chunk-P7QCLE5W.js';
2
2
  import { __name } from './chunk-SHUYVCID.js';
3
3
 
4
4
  // src/auth/rbac-debug-db.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infuro/cms-core",
3
- "version": "1.0.36",
3
+ "version": "1.0.38",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",