@infuro/cms-core 1.0.65 → 1.0.67

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 (36) hide show
  1. package/dist/admin.cjs +97 -24
  2. package/dist/admin.js +97 -24
  3. package/dist/api.cjs +38 -38
  4. package/dist/api.js +5 -5
  5. package/dist/auth.cjs +51 -51
  6. package/dist/auth.js +3 -3
  7. package/dist/{chunk-6DBDJ4VD.js → chunk-2ISSXYBZ.js} +2 -2
  8. package/dist/{chunk-NIRYYJIJ.cjs → chunk-5MZFQRDW.cjs} +73 -55
  9. package/dist/{chunk-MVHDC3XF.js → chunk-5NOZSG6J.js} +22 -11
  10. package/dist/{chunk-YHEITFHR.cjs → chunk-BVLN75LP.cjs} +540 -143
  11. package/dist/{chunk-YEAXE4U2.js → chunk-FLUF2GZH.js} +5 -11
  12. package/dist/{chunk-SANKKGB3.js → chunk-GLLCLRCQ.js} +464 -67
  13. package/dist/{chunk-ACBN6UWZ.js → chunk-NV5IRHI3.js} +26 -8
  14. package/dist/{chunk-J7FMZK66.cjs → chunk-O4AFPDQ4.cjs} +22 -11
  15. package/dist/{chunk-4U6DATGZ.cjs → chunk-OV5TRZET.cjs} +7 -7
  16. package/dist/{chunk-BXAKL2TF.cjs → chunk-PA6YDMFZ.cjs} +5 -11
  17. package/dist/{chunk-RDEVZMO5.js → chunk-RCE5SJBA.js} +2 -2
  18. package/dist/{chunk-KM2I6AFP.cjs → chunk-SS3K7OIM.cjs} +9 -9
  19. package/dist/{chunk-V6EYAC7X.cjs → chunk-WMMZZRDJ.cjs} +15 -15
  20. package/dist/{chunk-NR44CK5E.js → chunk-ZY64VJMS.js} +1 -1
  21. package/dist/{emit-order-notification-trigger-UCKJHDQK.js → emit-order-notification-trigger-EJJZ6XTS.js} +2 -2
  22. package/dist/{emit-order-notification-trigger-DR74TQXN.cjs → emit-order-notification-trigger-ZD5YN3JM.cjs} +4 -4
  23. package/dist/index.cjs +284 -280
  24. package/dist/index.d.cts +14 -1
  25. package/dist/index.d.ts +14 -1
  26. package/dist/index.js +10 -10
  27. package/dist/migrations/1783300000000-CreateOrderAssigneesTable.ts +43 -0
  28. package/dist/{order-assignees-handlers-NPKD64P6.cjs → order-assignees-handlers-KF7RMTV5.cjs} +77 -8
  29. package/dist/{order-assignees-handlers-LKMAGLG6.js → order-assignees-handlers-L3RVKUBS.js} +77 -8
  30. package/dist/{order-completion-otp-handlers-RW5RSXH3.cjs → order-completion-otp-handlers-DZAXK4GQ.cjs} +70 -16
  31. package/dist/{order-completion-otp-handlers-CH22ZRAI.js → order-completion-otp-handlers-HFGCPC4O.js} +69 -15
  32. package/dist/{order-notification-dispatcher-3TXUAJ7L.js → order-notification-dispatcher-ECPFI7CD.js} +2 -2
  33. package/dist/{order-notification-dispatcher-Y7NZAALH.cjs → order-notification-dispatcher-LL7ETKLU.cjs} +7 -7
  34. package/dist/{rbac-debug-db-5R6XFPSV.js → rbac-debug-db-DFZWZ6GV.js} +1 -1
  35. package/dist/{rbac-debug-db-JKK2MCWF.cjs → rbac-debug-db-KWV7D5PQ.cjs} +2 -2
  36. package/package.json +1 -1
package/dist/index.d.cts CHANGED
@@ -4180,6 +4180,19 @@ declare class UserDeviceToken {
4180
4180
  updatedAt: Date;
4181
4181
  }
4182
4182
 
4183
+ declare class OrderAssignee {
4184
+ id: number;
4185
+ orderId: number;
4186
+ userId: number;
4187
+ vendorId: number | null;
4188
+ sortOrder: number;
4189
+ assignedAt: Date;
4190
+ createdAt: Date;
4191
+ order: Order;
4192
+ user: User;
4193
+ vendor: Vendor | null;
4194
+ }
4195
+
4183
4196
  /** Map API resource segment (e.g. "blogs", "form_submissions") to entity. Used by CRUD handler. */
4184
4197
  declare const CMS_ENTITY_MAP: Record<string, EntityTarget<typeorm.ObjectLiteral>>;
4185
4198
 
@@ -4508,4 +4521,4 @@ type CreateCmsAppWithMessagingOptions = CreateCmsAppOptions & EnsureMessagingPlu
4508
4521
  /** `createCmsApp` + messaging plugins + queue processor registration. */
4509
4522
  declare function createCmsAppWithMessaging(options: CreateCmsAppWithMessagingOptions): Promise<CmsApp>;
4510
4523
 
4511
- export { ADMIN_GROUP_NAME, AUTH_PROVIDERS_SETTINGS_GROUP, Address, type AdminNavItem, type AnalyticsHandlerConfig, type AnalyticsPluginConfig, type AppliedDiscountUsage, Attendee, Attribute, type AuthHandlersConfig, type AuthHelpers, type AuthProvidersDataSource, type AuthProvidersEntityMap, 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, type BuildNextAuthOptionsConfig, 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 CreateGoogleCustomerDataSource, type CreateGoogleCustomerEntityMap, type CreateGoogleCustomerInput, type CrudHandlerOptions, Currency, CurrencyExchange, Customer, Customer_Contacts, DEFAULT_ADMIN_NAV, DEFAULT_ORDER_NOTIFICATION_TRIGGER_SEEDS, type DashboardStatsConfig, type DataSourceManager, Discount, DiscountRules, type DiscountUsageEntityMap, type ERPPluginConfig, type ERPPluginInstance, ERPSubmissionService, EVENT_ORDER_MESSAGE_TEMPLATE_DEFAULTS, EVENT_ORDER_TEMPLATE_KEY, EVENT_ORDER_TEMPLATE_VARIABLES, type EcommerceAnalyticsConfig, type EmailAttachment, type EmailData, type EmailJobPayload, type EmailPluginConfig, type EmailQueueProcessorOptions, EmailService, type EmailServiceInterface, type EmailTemplateName, type EmailTemplateResult, type EmitOrderNotificationTriggerDeps, type EnsureCustomerRecordInput, 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 EventApprovalStatus, 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 GoogleAuthConfig, INVOICE_TEMPLATE_IDS, INVOICE_TEMPLATE_OPTIONS, type InventoryOrderLine, type InviteAcceptConfig, type InvoiceAddress, type InvoiceCompany, type InvoiceLineItem, type InvoicePdfInput, type InvoiceTemplateId, 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, LlmAgentKnowledgeDocument, 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, type OrderInventorySnapshot, 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, type ProductApprovalStatus, 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, type ResolveGoogleAuthConfigInput, type ResolveOrderInvoicePdfError, type ResolvedOrderInvoicePdf, 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, UserDeviceToken, UserGroup, type UserInviteStatus, type UserProfileConfig, type UsersApiConfig, VENDOR_ADMIN_GROUP_ID, VENDOR_GROUP_NAME, VENDOR_OWNER_GROUP_NAME, VENDOR_SCOPED_STORE_ENTITIES, VENDOR_STORE_RBAC_ENTITIES, Vendor, type VendorCatalogCreateFlags, VendorCustomer, type VendorDashboardConfig, type VendorOnboardHandlersConfig, type VendorOwnerActivation, VendorRole, VendorRolePermission, VendorUser, VendorUserProfile, type WhatsAppJobPayload, type WhatsAppPluginConfig, type WhatsAppServiceConfig, type WhatsAppServiceInterface, Wishlist, WishlistItem, ZIP_MIME_TYPES, activeUniqueValueExists, allowRateLimit, analyticsPlugin, applyApprovalStatusSideEffects, applyEventApprovalStatusSideEffects, applyRotatingVendorInvite, applyVendorCustomersContactFilter, applyVendorEventCreateApproval, applyVendorProductCreateApproval, assertCaptchaOk, assertContactAllowedForVendorOrder, assertEventApprovalUpdate, assertProductApprovalUpdate, autoExpireOrderIfPaymentTimeExceeded, blogGeneratorPlugin, buildBlogMetadataUserPrompt, buildCaptchaPublicConfig, buildCronFromSchedule, buildEventOrderTemplateVariables, buildLocalInvoicePdfForOrder, buildNextAuthOptions, buildRssUserPromptFromFeeds, buildStorefrontNextAuthOptions, buildUserInviteLink, buildVendorInviteLink, cachePlugin, calculateOrderRefundPreview, calculateRefundFromPolicy, canManageRoles, canManageVendorRoles, canManageVendorTeam, canOnboardVendors, captchaPlugin, checkAndIncrementDiscountUsage, checkEventsEnabled, checkMultiVendorEnabled, cn, completeUserInviteAccept, consumeAppliedDiscountUsages, contactIsVendorCustomer, countDiscountOrdersForContact, countRecentOtpSends, createAnalyticsHandlers, createAuthHelpers, createBlogBySlugHandler, createChangePasswordHandler, createCmsApiHandler, createCmsApp, createCmsAppWithMessaging, createCmsAuthBundle, createCmsMiddleware, createCrudByIdHandler, createCrudHandler, createCustomerUserFromGoogleOAuth, createDashboardStatsHandler, createDataSourceManager, createEcommerceAnalyticsHandler, createEventOrderMessageTemplateHandlers, createForgotPasswordHandler, createFormBySlugHandler, createInviteAcceptHandler, createJobScheduleHandlers, createLlmAgentKnowledgeHandlers, createMediaZipExtractHandler, createMessageTemplateRowLoader, createOtpChallenge, createSetPasswordHandler, createSettingsApiHandlers, createSocialMediaHandlers, createStorefrontApiHandler, createUploadHandler, createUserAuthApiRouter, createUserAvatarHandler, createUserProfileHandler, createUsersApiHandlers, createVendorDashboardHandler, createVendorOnboardHandlers, customerPhoneForEmail, customerPhoneForUser, daysBeforeEventStart, decrementDiscountUsage, deductInventoryForConfirmedOrder, defaultPublicApiMethods, describeEventTierPolicy, emailPlugin, emailTemplates, emitOrderNotificationTrigger, enrichUserWithVendorContext, ensureCustomerForUser, ensureCustomerRecord, ensureMessagingPluginsOnCms, ensureScheduleQueueWorker, ensureVendorCustomerForOrderContact, ensureVendorCustomersForOrder, erpPlugin, explainSessionEntityAccess, fetchSeoBySlug, findActiveRefundPolicyForVendor, findUserByInviteToken, findVendorByInviteToken, fireOrderNotificationTrigger, formatDate, formatDateOnly, formatDateTime, formatTierRange, generateLocalInvoicePdf, generateNumericOtp, generateSlug, getCompanyDetailsFromSettings, getNextAuthOptions, getPermissionableEntityKeys, getPublicSettingsGroup, getRequireEventApproval, getRequireProductApproval, getRequiredPermission, getRssArticleSummaryFromItem, getStorefrontNextAuthOptions, getVendorCatalogCreateFlags, googleOAuthRedirectUri, hasEntityPermission, hashOtpCode, hydrateVendorSessionUser, initWhatsappTriggerDispatcher, invalidateEventsCache, invalidateMultiVendorCache, invalidateRequireEventApprovalCache, invalidateRequireProductApprovalCache, invalidateVendorCatalogCreateFlagsCache, isAuthDebugClientEnabled, isAuthDebugEnabled, isCustomerTypeContact, isGoogleAuthPubliclyEnabled, isMaxPerUserUsageReached, isMaxTotalUsageReached, isOpenEndpoint, isOrderEligibleForInvoiceEmail, isPlatformAdministrator, isPublicMethod, isRbacDebugEnabled, isSuperAdmin, isSuperAdminGroupName, isSyntheticCustomerPhone, isVendorAdmin, isVendorGroupName, isVendorOwner, isVendorPortalUser, isVendorStaff, isZipMedia, joinRecipientsForSend, linkUnclaimedContactToUser, llmAgentToChatAgentOptions, llmPlugin, loadPublicThemeSettings, loadSettingsGroupFromDb, loadUserVendorContext, localStoragePlugin, logAuth, logAuthClient, logEntityAccessDecision, logRbac, mergeEmailLayoutCompanyDetails, mergeGuardrailsIntoSystemPrompt, mergeInventoryLines, mergeSeoBySlug, messagingPlugins, metaFetchUserManagedPages, metaPostPageFeed, metaPostPagePhoto, metaResolvePageAccessToken, newUserInviteToken, nextAuthCookieDebugInfo, normalizeCustomerPhone, normalizeInvoiceTemplateId, normalizePhoneE164, normalizeRefundTiers, notificationTriggerEmitter, orderInventorySnapshotFromRow, orderStatusHoldsStock, overlayCmsPlugins, parseBlogGeneratorAgentContent, parseBlogGeneratorModelOutput, parseBlogMetadataEnrichmentJson, parseEmailRecipientsFromConfig, parseHfInferenceEmbeddingBody, parseLlmAgentValidationRules, paymentPlugin, permissionRowsToRecord, pgBossPlugin, pgBossScheduleNameForId, queueEmail, queueErp, queueErpCreateContactIfEnabled, queueErpPaidOrderForOrderId, queueJobScheduleNow, queueOrderPlacedEmails, queuePlugin, queueSms, queueVendorOnboardEmails, queueWhatsApp, rateLimitCheckoutPost, rateLimitKeyForApiRequest, rateLimitPublicApiIfNeeded, reconcileOrderInventoryBetweenSnapshots, recordDiscountUsage, registerEmailQueueProcessor, registerErpQueueProcessor, registerJobRunnerWorker, registerMessagingQueueProcessors, registerSmsQueueProcessor, registerWhatsAppQueueProcessor, relativePathFromMediaParentId, renderEmail, renderLayout, resendOrderNotification, resolveBlogCategoryIdByName, resolveEventOrderTemplate, resolveGoogleAuthConfig, resolveInvoiceAssetUrl, resolveOrderInvoicePdfBytes, resolvePublicMetadata, resolveSettingsEncryptionKey, resolveVendorIdForContactCheck, resolveVendorScopeFromSessionUser, restoreInventoryForCancelledOrder, retireSoftDeletedUniqueValue, s3StoragePlugin, sanitizeMediaFolderPath, sanitizeStorageSegment, seedAdministratorPermissions, seedDefaultAdmin, sendOrderPlacedEmailsAfterConfirmation, sendVendorOnboardEmails, serializeEmailRecipients, sessionHasEntityAccess, shouldRateLimitPublicWrite, simpleDecrypt, simpleEncrypt, smsPlugin, socialMediaPlugin, streamOrderInvoicePdf, summarizeEntityPerms, summarizeSessionUserForLog, syncJobScheduleToPgBoss, truncateText, validateInventoryForConfirmedOrderLines, validateInventoryForOrderBecomingConfirmed, validateRefundTiers, validateScheduleInput, validateSlug, validateUserMessageAgainstAgentRules, validateUserMessageAgainstStructuredRules, vendorPortalFlagsFromUser, verifyAndConsumeOtpChallenge, verifyOtpCodeHash, whatsappPlugin, withAdminRlsContext, withVendorRlsContext, wrapGetCmsWithMessaging };
4524
+ export { ADMIN_GROUP_NAME, AUTH_PROVIDERS_SETTINGS_GROUP, Address, type AdminNavItem, type AnalyticsHandlerConfig, type AnalyticsPluginConfig, type AppliedDiscountUsage, Attendee, Attribute, type AuthHandlersConfig, type AuthHelpers, type AuthProvidersDataSource, type AuthProvidersEntityMap, 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, type BuildNextAuthOptionsConfig, 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 CreateGoogleCustomerDataSource, type CreateGoogleCustomerEntityMap, type CreateGoogleCustomerInput, type CrudHandlerOptions, Currency, CurrencyExchange, Customer, Customer_Contacts, DEFAULT_ADMIN_NAV, DEFAULT_ORDER_NOTIFICATION_TRIGGER_SEEDS, type DashboardStatsConfig, type DataSourceManager, Discount, DiscountRules, type DiscountUsageEntityMap, type ERPPluginConfig, type ERPPluginInstance, ERPSubmissionService, EVENT_ORDER_MESSAGE_TEMPLATE_DEFAULTS, EVENT_ORDER_TEMPLATE_KEY, EVENT_ORDER_TEMPLATE_VARIABLES, type EcommerceAnalyticsConfig, type EmailAttachment, type EmailData, type EmailJobPayload, type EmailPluginConfig, type EmailQueueProcessorOptions, EmailService, type EmailServiceInterface, type EmailTemplateName, type EmailTemplateResult, type EmitOrderNotificationTriggerDeps, type EnsureCustomerRecordInput, 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 EventApprovalStatus, 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 GoogleAuthConfig, INVOICE_TEMPLATE_IDS, INVOICE_TEMPLATE_OPTIONS, type InventoryOrderLine, type InviteAcceptConfig, type InvoiceAddress, type InvoiceCompany, type InvoiceLineItem, type InvoicePdfInput, type InvoiceTemplateId, 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, LlmAgentKnowledgeDocument, 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, OrderAssignee, OrderDiscounts, type OrderInventorySnapshot, 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, type ProductApprovalStatus, 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, type ResolveGoogleAuthConfigInput, type ResolveOrderInvoicePdfError, type ResolvedOrderInvoicePdf, 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, UserDeviceToken, UserGroup, type UserInviteStatus, type UserProfileConfig, type UsersApiConfig, VENDOR_ADMIN_GROUP_ID, VENDOR_GROUP_NAME, VENDOR_OWNER_GROUP_NAME, VENDOR_SCOPED_STORE_ENTITIES, VENDOR_STORE_RBAC_ENTITIES, Vendor, type VendorCatalogCreateFlags, VendorCustomer, type VendorDashboardConfig, type VendorOnboardHandlersConfig, type VendorOwnerActivation, VendorRole, VendorRolePermission, VendorUser, VendorUserProfile, type WhatsAppJobPayload, type WhatsAppPluginConfig, type WhatsAppServiceConfig, type WhatsAppServiceInterface, Wishlist, WishlistItem, ZIP_MIME_TYPES, activeUniqueValueExists, allowRateLimit, analyticsPlugin, applyApprovalStatusSideEffects, applyEventApprovalStatusSideEffects, applyRotatingVendorInvite, applyVendorCustomersContactFilter, applyVendorEventCreateApproval, applyVendorProductCreateApproval, assertCaptchaOk, assertContactAllowedForVendorOrder, assertEventApprovalUpdate, assertProductApprovalUpdate, autoExpireOrderIfPaymentTimeExceeded, blogGeneratorPlugin, buildBlogMetadataUserPrompt, buildCaptchaPublicConfig, buildCronFromSchedule, buildEventOrderTemplateVariables, buildLocalInvoicePdfForOrder, buildNextAuthOptions, buildRssUserPromptFromFeeds, buildStorefrontNextAuthOptions, buildUserInviteLink, buildVendorInviteLink, cachePlugin, calculateOrderRefundPreview, calculateRefundFromPolicy, canManageRoles, canManageVendorRoles, canManageVendorTeam, canOnboardVendors, captchaPlugin, checkAndIncrementDiscountUsage, checkEventsEnabled, checkMultiVendorEnabled, cn, completeUserInviteAccept, consumeAppliedDiscountUsages, contactIsVendorCustomer, countDiscountOrdersForContact, countRecentOtpSends, createAnalyticsHandlers, createAuthHelpers, createBlogBySlugHandler, createChangePasswordHandler, createCmsApiHandler, createCmsApp, createCmsAppWithMessaging, createCmsAuthBundle, createCmsMiddleware, createCrudByIdHandler, createCrudHandler, createCustomerUserFromGoogleOAuth, createDashboardStatsHandler, createDataSourceManager, createEcommerceAnalyticsHandler, createEventOrderMessageTemplateHandlers, createForgotPasswordHandler, createFormBySlugHandler, createInviteAcceptHandler, createJobScheduleHandlers, createLlmAgentKnowledgeHandlers, createMediaZipExtractHandler, createMessageTemplateRowLoader, createOtpChallenge, createSetPasswordHandler, createSettingsApiHandlers, createSocialMediaHandlers, createStorefrontApiHandler, createUploadHandler, createUserAuthApiRouter, createUserAvatarHandler, createUserProfileHandler, createUsersApiHandlers, createVendorDashboardHandler, createVendorOnboardHandlers, customerPhoneForEmail, customerPhoneForUser, daysBeforeEventStart, decrementDiscountUsage, deductInventoryForConfirmedOrder, defaultPublicApiMethods, describeEventTierPolicy, emailPlugin, emailTemplates, emitOrderNotificationTrigger, enrichUserWithVendorContext, ensureCustomerForUser, ensureCustomerRecord, ensureMessagingPluginsOnCms, ensureScheduleQueueWorker, ensureVendorCustomerForOrderContact, ensureVendorCustomersForOrder, erpPlugin, explainSessionEntityAccess, fetchSeoBySlug, findActiveRefundPolicyForVendor, findUserByInviteToken, findVendorByInviteToken, fireOrderNotificationTrigger, formatDate, formatDateOnly, formatDateTime, formatTierRange, generateLocalInvoicePdf, generateNumericOtp, generateSlug, getCompanyDetailsFromSettings, getNextAuthOptions, getPermissionableEntityKeys, getPublicSettingsGroup, getRequireEventApproval, getRequireProductApproval, getRequiredPermission, getRssArticleSummaryFromItem, getStorefrontNextAuthOptions, getVendorCatalogCreateFlags, googleOAuthRedirectUri, hasEntityPermission, hashOtpCode, hydrateVendorSessionUser, initWhatsappTriggerDispatcher, invalidateEventsCache, invalidateMultiVendorCache, invalidateRequireEventApprovalCache, invalidateRequireProductApprovalCache, invalidateVendorCatalogCreateFlagsCache, isAuthDebugClientEnabled, isAuthDebugEnabled, isCustomerTypeContact, isGoogleAuthPubliclyEnabled, isMaxPerUserUsageReached, isMaxTotalUsageReached, isOpenEndpoint, isOrderEligibleForInvoiceEmail, isPlatformAdministrator, isPublicMethod, isRbacDebugEnabled, isSuperAdmin, isSuperAdminGroupName, isSyntheticCustomerPhone, isVendorAdmin, isVendorGroupName, isVendorOwner, isVendorPortalUser, isVendorStaff, isZipMedia, joinRecipientsForSend, linkUnclaimedContactToUser, llmAgentToChatAgentOptions, llmPlugin, loadPublicThemeSettings, loadSettingsGroupFromDb, loadUserVendorContext, localStoragePlugin, logAuth, logAuthClient, logEntityAccessDecision, logRbac, mergeEmailLayoutCompanyDetails, mergeGuardrailsIntoSystemPrompt, mergeInventoryLines, mergeSeoBySlug, messagingPlugins, metaFetchUserManagedPages, metaPostPageFeed, metaPostPagePhoto, metaResolvePageAccessToken, newUserInviteToken, nextAuthCookieDebugInfo, normalizeCustomerPhone, normalizeInvoiceTemplateId, normalizePhoneE164, normalizeRefundTiers, notificationTriggerEmitter, orderInventorySnapshotFromRow, orderStatusHoldsStock, overlayCmsPlugins, parseBlogGeneratorAgentContent, parseBlogGeneratorModelOutput, parseBlogMetadataEnrichmentJson, parseEmailRecipientsFromConfig, parseHfInferenceEmbeddingBody, parseLlmAgentValidationRules, paymentPlugin, permissionRowsToRecord, pgBossPlugin, pgBossScheduleNameForId, queueEmail, queueErp, queueErpCreateContactIfEnabled, queueErpPaidOrderForOrderId, queueJobScheduleNow, queueOrderPlacedEmails, queuePlugin, queueSms, queueVendorOnboardEmails, queueWhatsApp, rateLimitCheckoutPost, rateLimitKeyForApiRequest, rateLimitPublicApiIfNeeded, reconcileOrderInventoryBetweenSnapshots, recordDiscountUsage, registerEmailQueueProcessor, registerErpQueueProcessor, registerJobRunnerWorker, registerMessagingQueueProcessors, registerSmsQueueProcessor, registerWhatsAppQueueProcessor, relativePathFromMediaParentId, renderEmail, renderLayout, resendOrderNotification, resolveBlogCategoryIdByName, resolveEventOrderTemplate, resolveGoogleAuthConfig, resolveInvoiceAssetUrl, resolveOrderInvoicePdfBytes, resolvePublicMetadata, resolveSettingsEncryptionKey, resolveVendorIdForContactCheck, resolveVendorScopeFromSessionUser, restoreInventoryForCancelledOrder, retireSoftDeletedUniqueValue, s3StoragePlugin, sanitizeMediaFolderPath, sanitizeStorageSegment, seedAdministratorPermissions, seedDefaultAdmin, sendOrderPlacedEmailsAfterConfirmation, sendVendorOnboardEmails, serializeEmailRecipients, sessionHasEntityAccess, shouldRateLimitPublicWrite, simpleDecrypt, simpleEncrypt, smsPlugin, socialMediaPlugin, streamOrderInvoicePdf, summarizeEntityPerms, summarizeSessionUserForLog, syncJobScheduleToPgBoss, truncateText, validateInventoryForConfirmedOrderLines, validateInventoryForOrderBecomingConfirmed, validateRefundTiers, validateScheduleInput, validateSlug, validateUserMessageAgainstAgentRules, validateUserMessageAgainstStructuredRules, vendorPortalFlagsFromUser, verifyAndConsumeOtpChallenge, verifyOtpCodeHash, whatsappPlugin, withAdminRlsContext, withVendorRlsContext, wrapGetCmsWithMessaging };
package/dist/index.d.ts CHANGED
@@ -4180,6 +4180,19 @@ declare class UserDeviceToken {
4180
4180
  updatedAt: Date;
4181
4181
  }
4182
4182
 
4183
+ declare class OrderAssignee {
4184
+ id: number;
4185
+ orderId: number;
4186
+ userId: number;
4187
+ vendorId: number | null;
4188
+ sortOrder: number;
4189
+ assignedAt: Date;
4190
+ createdAt: Date;
4191
+ order: Order;
4192
+ user: User;
4193
+ vendor: Vendor | null;
4194
+ }
4195
+
4183
4196
  /** Map API resource segment (e.g. "blogs", "form_submissions") to entity. Used by CRUD handler. */
4184
4197
  declare const CMS_ENTITY_MAP: Record<string, EntityTarget<typeorm.ObjectLiteral>>;
4185
4198
 
@@ -4508,4 +4521,4 @@ type CreateCmsAppWithMessagingOptions = CreateCmsAppOptions & EnsureMessagingPlu
4508
4521
  /** `createCmsApp` + messaging plugins + queue processor registration. */
4509
4522
  declare function createCmsAppWithMessaging(options: CreateCmsAppWithMessagingOptions): Promise<CmsApp>;
4510
4523
 
4511
- export { ADMIN_GROUP_NAME, AUTH_PROVIDERS_SETTINGS_GROUP, Address, type AdminNavItem, type AnalyticsHandlerConfig, type AnalyticsPluginConfig, type AppliedDiscountUsage, Attendee, Attribute, type AuthHandlersConfig, type AuthHelpers, type AuthProvidersDataSource, type AuthProvidersEntityMap, 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, type BuildNextAuthOptionsConfig, 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 CreateGoogleCustomerDataSource, type CreateGoogleCustomerEntityMap, type CreateGoogleCustomerInput, type CrudHandlerOptions, Currency, CurrencyExchange, Customer, Customer_Contacts, DEFAULT_ADMIN_NAV, DEFAULT_ORDER_NOTIFICATION_TRIGGER_SEEDS, type DashboardStatsConfig, type DataSourceManager, Discount, DiscountRules, type DiscountUsageEntityMap, type ERPPluginConfig, type ERPPluginInstance, ERPSubmissionService, EVENT_ORDER_MESSAGE_TEMPLATE_DEFAULTS, EVENT_ORDER_TEMPLATE_KEY, EVENT_ORDER_TEMPLATE_VARIABLES, type EcommerceAnalyticsConfig, type EmailAttachment, type EmailData, type EmailJobPayload, type EmailPluginConfig, type EmailQueueProcessorOptions, EmailService, type EmailServiceInterface, type EmailTemplateName, type EmailTemplateResult, type EmitOrderNotificationTriggerDeps, type EnsureCustomerRecordInput, 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 EventApprovalStatus, 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 GoogleAuthConfig, INVOICE_TEMPLATE_IDS, INVOICE_TEMPLATE_OPTIONS, type InventoryOrderLine, type InviteAcceptConfig, type InvoiceAddress, type InvoiceCompany, type InvoiceLineItem, type InvoicePdfInput, type InvoiceTemplateId, 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, LlmAgentKnowledgeDocument, 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, type OrderInventorySnapshot, 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, type ProductApprovalStatus, 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, type ResolveGoogleAuthConfigInput, type ResolveOrderInvoicePdfError, type ResolvedOrderInvoicePdf, 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, UserDeviceToken, UserGroup, type UserInviteStatus, type UserProfileConfig, type UsersApiConfig, VENDOR_ADMIN_GROUP_ID, VENDOR_GROUP_NAME, VENDOR_OWNER_GROUP_NAME, VENDOR_SCOPED_STORE_ENTITIES, VENDOR_STORE_RBAC_ENTITIES, Vendor, type VendorCatalogCreateFlags, VendorCustomer, type VendorDashboardConfig, type VendorOnboardHandlersConfig, type VendorOwnerActivation, VendorRole, VendorRolePermission, VendorUser, VendorUserProfile, type WhatsAppJobPayload, type WhatsAppPluginConfig, type WhatsAppServiceConfig, type WhatsAppServiceInterface, Wishlist, WishlistItem, ZIP_MIME_TYPES, activeUniqueValueExists, allowRateLimit, analyticsPlugin, applyApprovalStatusSideEffects, applyEventApprovalStatusSideEffects, applyRotatingVendorInvite, applyVendorCustomersContactFilter, applyVendorEventCreateApproval, applyVendorProductCreateApproval, assertCaptchaOk, assertContactAllowedForVendorOrder, assertEventApprovalUpdate, assertProductApprovalUpdate, autoExpireOrderIfPaymentTimeExceeded, blogGeneratorPlugin, buildBlogMetadataUserPrompt, buildCaptchaPublicConfig, buildCronFromSchedule, buildEventOrderTemplateVariables, buildLocalInvoicePdfForOrder, buildNextAuthOptions, buildRssUserPromptFromFeeds, buildStorefrontNextAuthOptions, buildUserInviteLink, buildVendorInviteLink, cachePlugin, calculateOrderRefundPreview, calculateRefundFromPolicy, canManageRoles, canManageVendorRoles, canManageVendorTeam, canOnboardVendors, captchaPlugin, checkAndIncrementDiscountUsage, checkEventsEnabled, checkMultiVendorEnabled, cn, completeUserInviteAccept, consumeAppliedDiscountUsages, contactIsVendorCustomer, countDiscountOrdersForContact, countRecentOtpSends, createAnalyticsHandlers, createAuthHelpers, createBlogBySlugHandler, createChangePasswordHandler, createCmsApiHandler, createCmsApp, createCmsAppWithMessaging, createCmsAuthBundle, createCmsMiddleware, createCrudByIdHandler, createCrudHandler, createCustomerUserFromGoogleOAuth, createDashboardStatsHandler, createDataSourceManager, createEcommerceAnalyticsHandler, createEventOrderMessageTemplateHandlers, createForgotPasswordHandler, createFormBySlugHandler, createInviteAcceptHandler, createJobScheduleHandlers, createLlmAgentKnowledgeHandlers, createMediaZipExtractHandler, createMessageTemplateRowLoader, createOtpChallenge, createSetPasswordHandler, createSettingsApiHandlers, createSocialMediaHandlers, createStorefrontApiHandler, createUploadHandler, createUserAuthApiRouter, createUserAvatarHandler, createUserProfileHandler, createUsersApiHandlers, createVendorDashboardHandler, createVendorOnboardHandlers, customerPhoneForEmail, customerPhoneForUser, daysBeforeEventStart, decrementDiscountUsage, deductInventoryForConfirmedOrder, defaultPublicApiMethods, describeEventTierPolicy, emailPlugin, emailTemplates, emitOrderNotificationTrigger, enrichUserWithVendorContext, ensureCustomerForUser, ensureCustomerRecord, ensureMessagingPluginsOnCms, ensureScheduleQueueWorker, ensureVendorCustomerForOrderContact, ensureVendorCustomersForOrder, erpPlugin, explainSessionEntityAccess, fetchSeoBySlug, findActiveRefundPolicyForVendor, findUserByInviteToken, findVendorByInviteToken, fireOrderNotificationTrigger, formatDate, formatDateOnly, formatDateTime, formatTierRange, generateLocalInvoicePdf, generateNumericOtp, generateSlug, getCompanyDetailsFromSettings, getNextAuthOptions, getPermissionableEntityKeys, getPublicSettingsGroup, getRequireEventApproval, getRequireProductApproval, getRequiredPermission, getRssArticleSummaryFromItem, getStorefrontNextAuthOptions, getVendorCatalogCreateFlags, googleOAuthRedirectUri, hasEntityPermission, hashOtpCode, hydrateVendorSessionUser, initWhatsappTriggerDispatcher, invalidateEventsCache, invalidateMultiVendorCache, invalidateRequireEventApprovalCache, invalidateRequireProductApprovalCache, invalidateVendorCatalogCreateFlagsCache, isAuthDebugClientEnabled, isAuthDebugEnabled, isCustomerTypeContact, isGoogleAuthPubliclyEnabled, isMaxPerUserUsageReached, isMaxTotalUsageReached, isOpenEndpoint, isOrderEligibleForInvoiceEmail, isPlatformAdministrator, isPublicMethod, isRbacDebugEnabled, isSuperAdmin, isSuperAdminGroupName, isSyntheticCustomerPhone, isVendorAdmin, isVendorGroupName, isVendorOwner, isVendorPortalUser, isVendorStaff, isZipMedia, joinRecipientsForSend, linkUnclaimedContactToUser, llmAgentToChatAgentOptions, llmPlugin, loadPublicThemeSettings, loadSettingsGroupFromDb, loadUserVendorContext, localStoragePlugin, logAuth, logAuthClient, logEntityAccessDecision, logRbac, mergeEmailLayoutCompanyDetails, mergeGuardrailsIntoSystemPrompt, mergeInventoryLines, mergeSeoBySlug, messagingPlugins, metaFetchUserManagedPages, metaPostPageFeed, metaPostPagePhoto, metaResolvePageAccessToken, newUserInviteToken, nextAuthCookieDebugInfo, normalizeCustomerPhone, normalizeInvoiceTemplateId, normalizePhoneE164, normalizeRefundTiers, notificationTriggerEmitter, orderInventorySnapshotFromRow, orderStatusHoldsStock, overlayCmsPlugins, parseBlogGeneratorAgentContent, parseBlogGeneratorModelOutput, parseBlogMetadataEnrichmentJson, parseEmailRecipientsFromConfig, parseHfInferenceEmbeddingBody, parseLlmAgentValidationRules, paymentPlugin, permissionRowsToRecord, pgBossPlugin, pgBossScheduleNameForId, queueEmail, queueErp, queueErpCreateContactIfEnabled, queueErpPaidOrderForOrderId, queueJobScheduleNow, queueOrderPlacedEmails, queuePlugin, queueSms, queueVendorOnboardEmails, queueWhatsApp, rateLimitCheckoutPost, rateLimitKeyForApiRequest, rateLimitPublicApiIfNeeded, reconcileOrderInventoryBetweenSnapshots, recordDiscountUsage, registerEmailQueueProcessor, registerErpQueueProcessor, registerJobRunnerWorker, registerMessagingQueueProcessors, registerSmsQueueProcessor, registerWhatsAppQueueProcessor, relativePathFromMediaParentId, renderEmail, renderLayout, resendOrderNotification, resolveBlogCategoryIdByName, resolveEventOrderTemplate, resolveGoogleAuthConfig, resolveInvoiceAssetUrl, resolveOrderInvoicePdfBytes, resolvePublicMetadata, resolveSettingsEncryptionKey, resolveVendorIdForContactCheck, resolveVendorScopeFromSessionUser, restoreInventoryForCancelledOrder, retireSoftDeletedUniqueValue, s3StoragePlugin, sanitizeMediaFolderPath, sanitizeStorageSegment, seedAdministratorPermissions, seedDefaultAdmin, sendOrderPlacedEmailsAfterConfirmation, sendVendorOnboardEmails, serializeEmailRecipients, sessionHasEntityAccess, shouldRateLimitPublicWrite, simpleDecrypt, simpleEncrypt, smsPlugin, socialMediaPlugin, streamOrderInvoicePdf, summarizeEntityPerms, summarizeSessionUserForLog, syncJobScheduleToPgBoss, truncateText, validateInventoryForConfirmedOrderLines, validateInventoryForOrderBecomingConfirmed, validateRefundTiers, validateScheduleInput, validateSlug, validateUserMessageAgainstAgentRules, validateUserMessageAgainstStructuredRules, vendorPortalFlagsFromUser, verifyAndConsumeOtpChallenge, verifyOtpCodeHash, whatsappPlugin, withAdminRlsContext, withVendorRlsContext, wrapGetCmsWithMessaging };
4524
+ export { ADMIN_GROUP_NAME, AUTH_PROVIDERS_SETTINGS_GROUP, Address, type AdminNavItem, type AnalyticsHandlerConfig, type AnalyticsPluginConfig, type AppliedDiscountUsage, Attendee, Attribute, type AuthHandlersConfig, type AuthHelpers, type AuthProvidersDataSource, type AuthProvidersEntityMap, 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, type BuildNextAuthOptionsConfig, 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 CreateGoogleCustomerDataSource, type CreateGoogleCustomerEntityMap, type CreateGoogleCustomerInput, type CrudHandlerOptions, Currency, CurrencyExchange, Customer, Customer_Contacts, DEFAULT_ADMIN_NAV, DEFAULT_ORDER_NOTIFICATION_TRIGGER_SEEDS, type DashboardStatsConfig, type DataSourceManager, Discount, DiscountRules, type DiscountUsageEntityMap, type ERPPluginConfig, type ERPPluginInstance, ERPSubmissionService, EVENT_ORDER_MESSAGE_TEMPLATE_DEFAULTS, EVENT_ORDER_TEMPLATE_KEY, EVENT_ORDER_TEMPLATE_VARIABLES, type EcommerceAnalyticsConfig, type EmailAttachment, type EmailData, type EmailJobPayload, type EmailPluginConfig, type EmailQueueProcessorOptions, EmailService, type EmailServiceInterface, type EmailTemplateName, type EmailTemplateResult, type EmitOrderNotificationTriggerDeps, type EnsureCustomerRecordInput, 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 EventApprovalStatus, 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 GoogleAuthConfig, INVOICE_TEMPLATE_IDS, INVOICE_TEMPLATE_OPTIONS, type InventoryOrderLine, type InviteAcceptConfig, type InvoiceAddress, type InvoiceCompany, type InvoiceLineItem, type InvoicePdfInput, type InvoiceTemplateId, 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, LlmAgentKnowledgeDocument, 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, OrderAssignee, OrderDiscounts, type OrderInventorySnapshot, 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, type ProductApprovalStatus, 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, type ResolveGoogleAuthConfigInput, type ResolveOrderInvoicePdfError, type ResolvedOrderInvoicePdf, 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, UserDeviceToken, UserGroup, type UserInviteStatus, type UserProfileConfig, type UsersApiConfig, VENDOR_ADMIN_GROUP_ID, VENDOR_GROUP_NAME, VENDOR_OWNER_GROUP_NAME, VENDOR_SCOPED_STORE_ENTITIES, VENDOR_STORE_RBAC_ENTITIES, Vendor, type VendorCatalogCreateFlags, VendorCustomer, type VendorDashboardConfig, type VendorOnboardHandlersConfig, type VendorOwnerActivation, VendorRole, VendorRolePermission, VendorUser, VendorUserProfile, type WhatsAppJobPayload, type WhatsAppPluginConfig, type WhatsAppServiceConfig, type WhatsAppServiceInterface, Wishlist, WishlistItem, ZIP_MIME_TYPES, activeUniqueValueExists, allowRateLimit, analyticsPlugin, applyApprovalStatusSideEffects, applyEventApprovalStatusSideEffects, applyRotatingVendorInvite, applyVendorCustomersContactFilter, applyVendorEventCreateApproval, applyVendorProductCreateApproval, assertCaptchaOk, assertContactAllowedForVendorOrder, assertEventApprovalUpdate, assertProductApprovalUpdate, autoExpireOrderIfPaymentTimeExceeded, blogGeneratorPlugin, buildBlogMetadataUserPrompt, buildCaptchaPublicConfig, buildCronFromSchedule, buildEventOrderTemplateVariables, buildLocalInvoicePdfForOrder, buildNextAuthOptions, buildRssUserPromptFromFeeds, buildStorefrontNextAuthOptions, buildUserInviteLink, buildVendorInviteLink, cachePlugin, calculateOrderRefundPreview, calculateRefundFromPolicy, canManageRoles, canManageVendorRoles, canManageVendorTeam, canOnboardVendors, captchaPlugin, checkAndIncrementDiscountUsage, checkEventsEnabled, checkMultiVendorEnabled, cn, completeUserInviteAccept, consumeAppliedDiscountUsages, contactIsVendorCustomer, countDiscountOrdersForContact, countRecentOtpSends, createAnalyticsHandlers, createAuthHelpers, createBlogBySlugHandler, createChangePasswordHandler, createCmsApiHandler, createCmsApp, createCmsAppWithMessaging, createCmsAuthBundle, createCmsMiddleware, createCrudByIdHandler, createCrudHandler, createCustomerUserFromGoogleOAuth, createDashboardStatsHandler, createDataSourceManager, createEcommerceAnalyticsHandler, createEventOrderMessageTemplateHandlers, createForgotPasswordHandler, createFormBySlugHandler, createInviteAcceptHandler, createJobScheduleHandlers, createLlmAgentKnowledgeHandlers, createMediaZipExtractHandler, createMessageTemplateRowLoader, createOtpChallenge, createSetPasswordHandler, createSettingsApiHandlers, createSocialMediaHandlers, createStorefrontApiHandler, createUploadHandler, createUserAuthApiRouter, createUserAvatarHandler, createUserProfileHandler, createUsersApiHandlers, createVendorDashboardHandler, createVendorOnboardHandlers, customerPhoneForEmail, customerPhoneForUser, daysBeforeEventStart, decrementDiscountUsage, deductInventoryForConfirmedOrder, defaultPublicApiMethods, describeEventTierPolicy, emailPlugin, emailTemplates, emitOrderNotificationTrigger, enrichUserWithVendorContext, ensureCustomerForUser, ensureCustomerRecord, ensureMessagingPluginsOnCms, ensureScheduleQueueWorker, ensureVendorCustomerForOrderContact, ensureVendorCustomersForOrder, erpPlugin, explainSessionEntityAccess, fetchSeoBySlug, findActiveRefundPolicyForVendor, findUserByInviteToken, findVendorByInviteToken, fireOrderNotificationTrigger, formatDate, formatDateOnly, formatDateTime, formatTierRange, generateLocalInvoicePdf, generateNumericOtp, generateSlug, getCompanyDetailsFromSettings, getNextAuthOptions, getPermissionableEntityKeys, getPublicSettingsGroup, getRequireEventApproval, getRequireProductApproval, getRequiredPermission, getRssArticleSummaryFromItem, getStorefrontNextAuthOptions, getVendorCatalogCreateFlags, googleOAuthRedirectUri, hasEntityPermission, hashOtpCode, hydrateVendorSessionUser, initWhatsappTriggerDispatcher, invalidateEventsCache, invalidateMultiVendorCache, invalidateRequireEventApprovalCache, invalidateRequireProductApprovalCache, invalidateVendorCatalogCreateFlagsCache, isAuthDebugClientEnabled, isAuthDebugEnabled, isCustomerTypeContact, isGoogleAuthPubliclyEnabled, isMaxPerUserUsageReached, isMaxTotalUsageReached, isOpenEndpoint, isOrderEligibleForInvoiceEmail, isPlatformAdministrator, isPublicMethod, isRbacDebugEnabled, isSuperAdmin, isSuperAdminGroupName, isSyntheticCustomerPhone, isVendorAdmin, isVendorGroupName, isVendorOwner, isVendorPortalUser, isVendorStaff, isZipMedia, joinRecipientsForSend, linkUnclaimedContactToUser, llmAgentToChatAgentOptions, llmPlugin, loadPublicThemeSettings, loadSettingsGroupFromDb, loadUserVendorContext, localStoragePlugin, logAuth, logAuthClient, logEntityAccessDecision, logRbac, mergeEmailLayoutCompanyDetails, mergeGuardrailsIntoSystemPrompt, mergeInventoryLines, mergeSeoBySlug, messagingPlugins, metaFetchUserManagedPages, metaPostPageFeed, metaPostPagePhoto, metaResolvePageAccessToken, newUserInviteToken, nextAuthCookieDebugInfo, normalizeCustomerPhone, normalizeInvoiceTemplateId, normalizePhoneE164, normalizeRefundTiers, notificationTriggerEmitter, orderInventorySnapshotFromRow, orderStatusHoldsStock, overlayCmsPlugins, parseBlogGeneratorAgentContent, parseBlogGeneratorModelOutput, parseBlogMetadataEnrichmentJson, parseEmailRecipientsFromConfig, parseHfInferenceEmbeddingBody, parseLlmAgentValidationRules, paymentPlugin, permissionRowsToRecord, pgBossPlugin, pgBossScheduleNameForId, queueEmail, queueErp, queueErpCreateContactIfEnabled, queueErpPaidOrderForOrderId, queueJobScheduleNow, queueOrderPlacedEmails, queuePlugin, queueSms, queueVendorOnboardEmails, queueWhatsApp, rateLimitCheckoutPost, rateLimitKeyForApiRequest, rateLimitPublicApiIfNeeded, reconcileOrderInventoryBetweenSnapshots, recordDiscountUsage, registerEmailQueueProcessor, registerErpQueueProcessor, registerJobRunnerWorker, registerMessagingQueueProcessors, registerSmsQueueProcessor, registerWhatsAppQueueProcessor, relativePathFromMediaParentId, renderEmail, renderLayout, resendOrderNotification, resolveBlogCategoryIdByName, resolveEventOrderTemplate, resolveGoogleAuthConfig, resolveInvoiceAssetUrl, resolveOrderInvoicePdfBytes, resolvePublicMetadata, resolveSettingsEncryptionKey, resolveVendorIdForContactCheck, resolveVendorScopeFromSessionUser, restoreInventoryForCancelledOrder, retireSoftDeletedUniqueValue, s3StoragePlugin, sanitizeMediaFolderPath, sanitizeStorageSegment, seedAdministratorPermissions, seedDefaultAdmin, sendOrderPlacedEmailsAfterConfirmation, sendVendorOnboardEmails, serializeEmailRecipients, sessionHasEntityAccess, shouldRateLimitPublicWrite, simpleDecrypt, simpleEncrypt, smsPlugin, socialMediaPlugin, streamOrderInvoicePdf, summarizeEntityPerms, summarizeSessionUserForLog, syncJobScheduleToPgBoss, truncateText, validateInventoryForConfirmedOrderLines, validateInventoryForOrderBecomingConfirmed, validateRefundTiers, validateScheduleInput, validateSlug, validateUserMessageAgainstAgentRules, validateUserMessageAgainstStructuredRules, vendorPortalFlagsFromUser, verifyAndConsumeOtpChallenge, verifyOtpCodeHash, whatsappPlugin, withAdminRlsContext, withVendorRlsContext, wrapGetCmsWithMessaging };
package/dist/index.js CHANGED
@@ -1,14 +1,14 @@
1
- export { emitOrderNotificationTrigger, fireOrderNotificationTrigger } from './chunk-RDEVZMO5.js';
2
- import { checkMultiVendorEnabled, loadUserVendorContext, getPublicSettingsGroup, BlogGeneratorService } from './chunk-SANKKGB3.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, LlmAgentKnowledgeDocument, 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, UserDeviceToken, UserGroup, Vendor, VendorCustomer, VendorRole, VendorRolePermission, VendorUser, VendorUserProfile, Wishlist, WishlistItem, ZIP_MIME_TYPES, applyApprovalStatusSideEffects, applyEventApprovalStatusSideEffects, applyRotatingVendorInvite, applyVendorCustomersContactFilter, applyVendorEventCreateApproval, applyVendorProductCreateApproval, assertCaptchaOk, assertContactAllowedForVendorOrder, assertEventApprovalUpdate, assertProductApprovalUpdate, autoExpireOrderIfPaymentTimeExceeded, buildBlogMetadataUserPrompt, buildCronFromSchedule, buildRssUserPromptFromFeeds, buildUserInviteLink, buildVendorInviteLink, calculateOrderRefundPreview, calculateRefundFromPolicy, checkAndIncrementDiscountUsage, checkEventsEnabled, checkMultiVendorEnabled, completeUserInviteAccept, consumeAppliedDiscountUsages, contactIsVendorCustomer, countDiscountOrdersForContact, createAnalyticsHandlers, createBlogBySlugHandler, createChangePasswordHandler, createCmsApiHandler, createCmsApp, createCmsAppWithMessaging, createCrudByIdHandler, createCrudHandler, createDashboardStatsHandler, createEcommerceAnalyticsHandler, createEventOrderMessageTemplateHandlers, createForgotPasswordHandler, createFormBySlugHandler, createInviteAcceptHandler, createJobScheduleHandlers, createLlmAgentKnowledgeHandlers, createMediaZipExtractHandler, createMessageTemplateRowLoader, createSetPasswordHandler, createSettingsApiHandlers, createSocialMediaHandlers, createStorefrontApiHandler, createUploadHandler, createUserAuthApiRouter, createUserAvatarHandler, createUserProfileHandler, createUsersApiHandlers, createVendorDashboardHandler, createVendorOnboardHandlers, daysBeforeEventStart, decrementDiscountUsage, describeEventTierPolicy, ensureMessagingPluginsOnCms, ensureScheduleQueueWorker, ensureVendorCustomerForOrderContact, ensureVendorCustomersForOrder, findActiveRefundPolicyForVendor, findUserByInviteToken, findVendorByInviteToken, formatTierRange, getPublicSettingsGroup, getRequireEventApproval, getRequireProductApproval, getRssArticleSummaryFromItem, getVendorCatalogCreateFlags, hydrateVendorSessionUser, invalidateEventsCache, invalidateMultiVendorCache, invalidateRequireEventApprovalCache, invalidateRequireProductApprovalCache, invalidateVendorCatalogCreateFlagsCache, isCustomerTypeContact, isMaxPerUserUsageReached, isMaxTotalUsageReached, isZipMedia, llmAgentToChatAgentOptions, loadSettingsGroupFromDb, loadUserVendorContext, mergeGuardrailsIntoSystemPrompt, messagingPlugins, metaFetchUserManagedPages, metaPostPageFeed, metaPostPagePhoto, metaResolvePageAccessToken, newUserInviteToken, normalizeRefundTiers, overlayCmsPlugins, parseBlogGeneratorAgentContent, parseBlogGeneratorModelOutput, parseBlogMetadataEnrichmentJson, parseLlmAgentValidationRules, pgBossScheduleNameForId, queueErpCreateContactIfEnabled, queueJobScheduleNow, queuePlugin, recordDiscountUsage, registerJobRunnerWorker, registerMessagingQueueProcessors, relativePathFromMediaParentId, resolveBlogCategoryIdByName, resolveSettingsEncryptionKey, resolveVendorIdForContactCheck, sanitizeMediaFolderPath, sanitizeStorageSegment, sendVendorOnboardEmails, simpleDecrypt, simpleEncrypt, syncJobScheduleToPgBoss, validateRefundTiers, validateScheduleInput, validateUserMessageAgainstAgentRules, validateUserMessageAgainstStructuredRules, whatsappPlugin, wrapGetCmsWithMessaging } from './chunk-SANKKGB3.js';
1
+ export { emitOrderNotificationTrigger, fireOrderNotificationTrigger } from './chunk-RCE5SJBA.js';
2
+ import { checkMultiVendorEnabled, loadUserVendorContext, getPublicSettingsGroup, BlogGeneratorService } from './chunk-GLLCLRCQ.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, LlmAgentKnowledgeDocument, Media, MessageTemplate, Order, OrderAddresses, OrderAssignee, OrderDiscounts, OrderItem, OrderNotificationBinding, OrderNotificationTrigger, OtpChallenge, Page, PasswordResetToken, Payment, Permission, Product, ProductAttribute, ProductCategory, ProductConfig, ProductVariant, RefundPolicy, RefundRequest, RssArticle, RssFeed, Seo, Tag, Tax, User, UserDeviceToken, UserGroup, Vendor, VendorCustomer, VendorRole, VendorRolePermission, VendorUser, VendorUserProfile, Wishlist, WishlistItem, ZIP_MIME_TYPES, applyApprovalStatusSideEffects, applyEventApprovalStatusSideEffects, applyRotatingVendorInvite, applyVendorCustomersContactFilter, applyVendorEventCreateApproval, applyVendorProductCreateApproval, assertCaptchaOk, assertContactAllowedForVendorOrder, assertEventApprovalUpdate, assertProductApprovalUpdate, autoExpireOrderIfPaymentTimeExceeded, buildBlogMetadataUserPrompt, buildCronFromSchedule, buildRssUserPromptFromFeeds, buildUserInviteLink, buildVendorInviteLink, calculateOrderRefundPreview, calculateRefundFromPolicy, checkAndIncrementDiscountUsage, checkEventsEnabled, checkMultiVendorEnabled, completeUserInviteAccept, consumeAppliedDiscountUsages, contactIsVendorCustomer, countDiscountOrdersForContact, createAnalyticsHandlers, createBlogBySlugHandler, createChangePasswordHandler, createCmsApiHandler, createCmsApp, createCmsAppWithMessaging, createCrudByIdHandler, createCrudHandler, createDashboardStatsHandler, createEcommerceAnalyticsHandler, createEventOrderMessageTemplateHandlers, createForgotPasswordHandler, createFormBySlugHandler, createInviteAcceptHandler, createJobScheduleHandlers, createLlmAgentKnowledgeHandlers, createMediaZipExtractHandler, createMessageTemplateRowLoader, createSetPasswordHandler, createSettingsApiHandlers, createSocialMediaHandlers, createStorefrontApiHandler, createUploadHandler, createUserAuthApiRouter, createUserAvatarHandler, createUserProfileHandler, createUsersApiHandlers, createVendorDashboardHandler, createVendorOnboardHandlers, daysBeforeEventStart, decrementDiscountUsage, describeEventTierPolicy, ensureMessagingPluginsOnCms, ensureScheduleQueueWorker, ensureVendorCustomerForOrderContact, ensureVendorCustomersForOrder, findActiveRefundPolicyForVendor, findUserByInviteToken, findVendorByInviteToken, formatTierRange, getPublicSettingsGroup, getRequireEventApproval, getRequireProductApproval, getRssArticleSummaryFromItem, getVendorCatalogCreateFlags, hydrateVendorSessionUser, invalidateEventsCache, invalidateMultiVendorCache, invalidateRequireEventApprovalCache, invalidateRequireProductApprovalCache, invalidateVendorCatalogCreateFlagsCache, isCustomerTypeContact, isMaxPerUserUsageReached, isMaxTotalUsageReached, isZipMedia, llmAgentToChatAgentOptions, loadSettingsGroupFromDb, loadUserVendorContext, mergeGuardrailsIntoSystemPrompt, messagingPlugins, metaFetchUserManagedPages, metaPostPageFeed, metaPostPagePhoto, metaResolvePageAccessToken, newUserInviteToken, normalizeRefundTiers, overlayCmsPlugins, parseBlogGeneratorAgentContent, parseBlogGeneratorModelOutput, parseBlogMetadataEnrichmentJson, parseLlmAgentValidationRules, pgBossScheduleNameForId, queueErpCreateContactIfEnabled, queueJobScheduleNow, queuePlugin, recordDiscountUsage, registerJobRunnerWorker, registerMessagingQueueProcessors, relativePathFromMediaParentId, resolveBlogCategoryIdByName, resolveSettingsEncryptionKey, resolveVendorIdForContactCheck, sanitizeMediaFolderPath, sanitizeStorageSegment, sendVendorOnboardEmails, simpleDecrypt, simpleEncrypt, syncJobScheduleToPgBoss, validateRefundTiers, validateScheduleInput, validateUserMessageAgainstAgentRules, validateUserMessageAgainstStructuredRules, whatsappPlugin, wrapGetCmsWithMessaging } from './chunk-GLLCLRCQ.js';
4
4
  export { countRecentOtpSends, createOtpChallenge, generateNumericOtp, hashOtpCode, normalizePhoneE164, queueSms, registerSmsQueueProcessor, verifyAndConsumeOtpChallenge, verifyOtpCodeHash } from './chunk-OVTOP42W.js';
5
5
  import { PgBossService } from './chunk-XJNNOSJR.js';
6
6
  export { JOB_RUNNER_QUEUE, PgBossService } from './chunk-XJNNOSJR.js';
7
7
  export { deductInventoryForConfirmedOrder, mergeInventoryLines, orderInventorySnapshotFromRow, orderStatusHoldsStock, reconcileOrderInventoryBetweenSnapshots, restoreInventoryForCancelledOrder, validateInventoryForConfirmedOrderLines, validateInventoryForOrderBecomingConfirmed } from './chunk-3K5AIEIZ.js';
8
- import { parseEmailRecipientsFromConfig } from './chunk-ACBN6UWZ.js';
9
- export { buildEventOrderTemplateVariables, emailPlugin, initWhatsappTriggerDispatcher, joinRecipientsForSend, parseEmailRecipientsFromConfig, resendOrderNotification, serializeEmailRecipients } from './chunk-ACBN6UWZ.js';
8
+ import { parseEmailRecipientsFromConfig } from './chunk-NV5IRHI3.js';
9
+ export { buildEventOrderTemplateVariables, emailPlugin, initWhatsappTriggerDispatcher, joinRecipientsForSend, parseEmailRecipientsFromConfig, resendOrderNotification, serializeEmailRecipients } from './chunk-NV5IRHI3.js';
10
10
  export { queueWhatsApp, registerWhatsAppQueueProcessor } from './chunk-GWDI752Q.js';
11
- export { KNOWN_NOTIFICATION_TRIGGERS, notificationTriggerEmitter } from './chunk-YEAXE4U2.js';
11
+ export { KNOWN_NOTIFICATION_TRIGGERS, notificationTriggerEmitter } from './chunk-FLUF2GZH.js';
12
12
  import './chunk-JXF23MPG.js';
13
13
  export { EmailService, emailTemplates, renderEmail, renderLayout } from './chunk-6YOQ7G5O.js';
14
14
  import { queueOrderPlacedEmails } from './chunk-TU23GJPJ.js';
@@ -20,11 +20,11 @@ export { getCompanyDetailsFromSettings, mergeEmailLayoutCompanyDetails } from '.
20
20
  import './chunk-MQBT33IV.js';
21
21
  import './chunk-CRFV5WJK.js';
22
22
  export { EVENT_ORDER_MESSAGE_TEMPLATE_DEFAULTS, EVENT_ORDER_TEMPLATE_KEY, EVENT_ORDER_TEMPLATE_VARIABLES, resolveEventOrderTemplate } from './chunk-AYERBA7I.js';
23
- export { AUTH_PROVIDERS_SETTINGS_GROUP, buildNextAuthOptions, buildStorefrontNextAuthOptions, createCustomerUserFromGoogleOAuth, getNextAuthOptions, getStorefrontNextAuthOptions, googleOAuthRedirectUri, isGoogleAuthPubliclyEnabled, resolveGoogleAuthConfig, seedAdministratorPermissions } from './chunk-6DBDJ4VD.js';
24
- export { OPEN_ENDPOINTS, PERMISSION_REQUIRED_ENDPOINTS, RBAC_ADMIN_ONLY_ENTITIES, canManageRoles, createAuthHelpers, createCmsAuthBundle, customerPhoneForEmail, customerPhoneForUser, ensureCustomerForUser, ensureCustomerRecord, getRequiredPermission, isOpenEndpoint, isPublicMethod, isSyntheticCustomerPhone, linkUnclaimedContactToUser, normalizeCustomerPhone, sessionHasEntityAccess } from './chunk-NR44CK5E.js';
23
+ export { AUTH_PROVIDERS_SETTINGS_GROUP, buildNextAuthOptions, buildStorefrontNextAuthOptions, createCustomerUserFromGoogleOAuth, getNextAuthOptions, getStorefrontNextAuthOptions, googleOAuthRedirectUri, isGoogleAuthPubliclyEnabled, resolveGoogleAuthConfig, seedAdministratorPermissions } from './chunk-2ISSXYBZ.js';
24
+ export { OPEN_ENDPOINTS, PERMISSION_REQUIRED_ENDPOINTS, RBAC_ADMIN_ONLY_ENTITIES, canManageRoles, createAuthHelpers, createCmsAuthBundle, customerPhoneForEmail, customerPhoneForUser, ensureCustomerForUser, ensureCustomerRecord, getRequiredPermission, isOpenEndpoint, isPublicMethod, isSyntheticCustomerPhone, linkUnclaimedContactToUser, normalizeCustomerPhone, sessionHasEntityAccess } from './chunk-ZY64VJMS.js';
25
25
  export { activeUniqueValueExists, retireSoftDeletedUniqueValue } from './chunk-DBPSJYLZ.js';
26
- import { isSuperAdmin, isVendorGroupName } from './chunk-MVHDC3XF.js';
27
- export { ADMIN_GROUP_NAME, SUPER_ADMIN_GROUP_ID, VENDOR_ADMIN_GROUP_ID, VENDOR_GROUP_NAME, 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-MVHDC3XF.js';
26
+ import { isSuperAdmin, isVendorGroupName } from './chunk-5NOZSG6J.js';
27
+ export { ADMIN_GROUP_NAME, SUPER_ADMIN_GROUP_ID, VENDOR_ADMIN_GROUP_ID, VENDOR_GROUP_NAME, 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-5NOZSG6J.js';
28
28
  export { createCmsMiddleware, defaultPublicApiMethods, isAuthDebugClientEnabled, isAuthDebugEnabled, logAuth, logAuthClient, nextAuthCookieDebugInfo, summarizeSessionUserForLog } from './chunk-WUQAOTHA.js';
29
29
  export { queueErpPaidOrderForOrderId } from './chunk-TDV6EJHV.js';
30
30
  import { erpSafeWebhookUrl, logErp, warnErp, errorErp } from './chunk-SYBOCAWB.js';
@@ -0,0 +1,43 @@
1
+ import type { MigrationInterface, QueryRunner } from 'typeorm';
2
+
3
+ /** Create order_assignees table to track order assignment history with sortOrder and vendorId. */
4
+ export class CreateOrderAssigneesTable1783300000000 implements MigrationInterface {
5
+ name = 'CreateOrderAssigneesTable1783300000000';
6
+
7
+ public async up(queryRunner: QueryRunner): Promise<void> {
8
+ await queryRunner.query(`
9
+ CREATE TABLE IF NOT EXISTS "order_assignees" (
10
+ "id" SERIAL PRIMARY KEY,
11
+ "orderId" integer NOT NULL REFERENCES "orders"("id") ON DELETE CASCADE,
12
+ "userId" integer NOT NULL REFERENCES "users"("id") ON DELETE CASCADE,
13
+ "vendorId" integer NULL REFERENCES "vendors"("id") ON DELETE SET NULL,
14
+ "sortOrder" integer NOT NULL DEFAULT 1,
15
+ "assignedAt" TIMESTAMP WITH TIME ZONE DEFAULT now(),
16
+ "createdAt" TIMESTAMP WITH TIME ZONE DEFAULT now()
17
+ );
18
+ `);
19
+
20
+ await queryRunner.query(`
21
+ CREATE INDEX IF NOT EXISTS "idx_order_assignees_order" ON "order_assignees" ("orderId");
22
+ CREATE INDEX IF NOT EXISTS "idx_order_assignees_user" ON "order_assignees" ("userId");
23
+ CREATE INDEX IF NOT EXISTS "idx_order_assignees_vendor" ON "order_assignees" ("vendorId");
24
+ `);
25
+
26
+ // Backfill any existing assigned orders with sortOrder = 1
27
+ await queryRunner.query(`
28
+ INSERT INTO "order_assignees" ("orderId", "userId", "vendorId", "sortOrder", "assignedAt", "createdAt")
29
+ SELECT o."id", o."assignedUserId", o."vendorId", 1, COALESCE(o."assignedAt", now()), now()
30
+ FROM "orders" o
31
+ WHERE o."assignedUserId" IS NOT NULL
32
+ AND NOT EXISTS (
33
+ SELECT 1 FROM "order_assignees" oa WHERE oa."orderId" = o."id" AND oa."userId" = o."assignedUserId"
34
+ );
35
+ `);
36
+ }
37
+
38
+ public async down(queryRunner: QueryRunner): Promise<void> {
39
+ await queryRunner.query(`
40
+ DROP TABLE IF EXISTS "order_assignees";
41
+ `);
42
+ }
43
+ }
@@ -47,8 +47,39 @@ function createOrderAssigneesHandlers(dataSource, entityMap, getHydratedSessionU
47
47
  const session = await getHydratedSessionUser?.() ?? null;
48
48
  const userVendorIds = session?.vendorIds ?? [];
49
49
  const isVendorSession = Boolean(session?.isVendorPortal || !session?.isRBACAdmin && userVendorIds.length > 0);
50
- Boolean(session?.isRBACAdmin && !session?.isVendorPortal);
51
- if (isVendorSession && orderVendorId && !userVendorIds.includes(orderVendorId)) {
50
+ const isPlatformAdmin = Boolean(session?.isRBACAdmin && !session?.isVendorPortal);
51
+ console.log("[ORDERS-DEBUG][ELIGIBLE_ASSIGNEES] Fetching for order:", orderId, "orderVendorId:", orderVendorId, "session:", {
52
+ id: session?.id,
53
+ email: session?.email,
54
+ isVendorSession,
55
+ isPlatformAdmin,
56
+ userVendorIds
57
+ });
58
+ let hasVendorAccess = false;
59
+ if (!isVendorSession) {
60
+ hasVendorAccess = true;
61
+ } else if (orderVendorId && userVendorIds.includes(orderVendorId)) {
62
+ hasVendorAccess = true;
63
+ } else {
64
+ const aId = Number(order?.assignedUserId);
65
+ if (Number.isFinite(aId) && aId > 0 && entityMap.vendor_users) {
66
+ const vuRepo = dataSource.getRepository(entityMap.vendor_users);
67
+ for (const vId of userVendorIds) {
68
+ const count = await vuRepo.count({
69
+ where: {
70
+ vendorId: vId,
71
+ userId: aId
72
+ }
73
+ });
74
+ if (count > 0) {
75
+ hasVendorAccess = true;
76
+ break;
77
+ }
78
+ }
79
+ }
80
+ }
81
+ if (!hasVendorAccess) {
82
+ console.log("[ORDERS-DEBUG][ELIGIBLE_ASSIGNEES] Forbidden: user not in orderVendorId or assignee not in team");
52
83
  return json({
53
84
  error: "Forbidden: Access denied to vendor order"
54
85
  }, {
@@ -56,8 +87,9 @@ function createOrderAssigneesHandlers(dataSource, entityMap, getHydratedSessionU
56
87
  });
57
88
  }
58
89
  const assigneesMap = /* @__PURE__ */ new Map();
90
+ let vendorsList = [];
59
91
  if (isVendorSession) {
60
- const targetVendorId = orderVendorId ?? session?.activeVendorId ?? userVendorIds[0];
92
+ const targetVendorId = session?.activeVendorId ?? (orderVendorId && userVendorIds.includes(orderVendorId) ? orderVendorId : userVendorIds[0]);
61
93
  if (entityMap.vendor_users && targetVendorId) {
62
94
  const vuRepo = dataSource.getRepository(entityMap.vendor_users);
63
95
  const vendorUsers = await vuRepo.find({
@@ -66,42 +98,72 @@ function createOrderAssigneesHandlers(dataSource, entityMap, getHydratedSessionU
66
98
  },
67
99
  relations: [
68
100
  "user",
69
- "vendorRole"
101
+ "vendorRole",
102
+ "vendor"
70
103
  ]
71
104
  });
72
105
  for (const vu of vendorUsers) {
73
106
  const u = vu.user;
74
107
  const r = vu.vendorRole;
108
+ const v = vu.vendor;
75
109
  if (u && u.id && !u.deleted && !u.blocked && u.inviteStatus === "active") {
76
110
  const roleName = r?.name || (r?.isOwnerRole ? "Owner" : "Vendor Staff");
77
111
  assigneesMap.set(u.id, {
78
112
  id: u.id,
79
113
  name: u.name || u.email?.split("@")[0] || `User #${u.id}`,
80
114
  email: u.email || "",
81
- role: roleName
115
+ role: roleName,
116
+ vendorId: targetVendorId,
117
+ vendorName: v?.name || `Vendor #${targetVendorId}`
82
118
  });
83
119
  }
84
120
  }
85
121
  }
86
122
  } else {
123
+ if (entityMap.vendors) {
124
+ const vRepo = dataSource.getRepository(entityMap.vendors);
125
+ const allVendors = await vRepo.find({
126
+ where: {
127
+ deleted: false
128
+ },
129
+ order: {
130
+ name: "ASC"
131
+ },
132
+ select: [
133
+ "id",
134
+ "name",
135
+ "slug"
136
+ ]
137
+ });
138
+ vendorsList = allVendors.map((v) => ({
139
+ id: v.id,
140
+ name: v.name || v.slug || `Vendor #${v.id}`,
141
+ slug: v.slug || ""
142
+ }));
143
+ }
87
144
  if (entityMap.vendor_users) {
88
145
  const vuRepo = dataSource.getRepository(entityMap.vendor_users);
89
146
  const vendorUsers = await vuRepo.find({
90
147
  relations: [
91
148
  "user",
92
- "vendorRole"
149
+ "vendorRole",
150
+ "vendor"
93
151
  ]
94
152
  });
95
153
  for (const vu of vendorUsers) {
96
154
  const u = vu.user;
97
155
  const r = vu.vendorRole;
156
+ const v = vu.vendor;
98
157
  if (u && u.id && !u.deleted && !u.blocked && u.inviteStatus === "active") {
158
+ if (v && v.deleted) continue;
99
159
  const roleName = r?.name || (r?.isOwnerRole ? "Owner" : "Vendor Staff");
100
160
  assigneesMap.set(u.id, {
101
161
  id: u.id,
102
162
  name: u.name || u.email?.split("@")[0] || `User #${u.id}`,
103
163
  email: u.email || "",
104
- role: roleName
164
+ role: roleName,
165
+ vendorId: vu.vendorId,
166
+ vendorName: v?.name || `Vendor #${vu.vendorId}`
105
167
  });
106
168
  }
107
169
  }
@@ -135,13 +197,20 @@ function createOrderAssigneesHandlers(dataSource, entityMap, getHydratedSessionU
135
197
  id: u.id,
136
198
  name: u.name || u.email?.split("@")[0] || `User #${u.id}`,
137
199
  email: u.email || "",
138
- role: roleLabel
200
+ role: roleLabel,
201
+ vendorId: null,
202
+ vendorName: "Platform Staff"
139
203
  });
140
204
  }
141
205
  }
142
206
  }
207
+ console.log("[ORDERS-DEBUG][ELIGIBLE_ASSIGNEES] Returning vendors count:", vendorsList.length, "assignees count:", assigneesMap.size, "currentVendorId:", order.vendorId, "currentAssignedUserId:", order.assignedUserId);
143
208
  return json({
209
+ isPlatformAdmin,
210
+ isVendorSession,
211
+ vendors: vendorsList,
144
212
  assignees: Array.from(assigneesMap.values()),
213
+ currentVendorId: order.vendorId ?? null,
145
214
  currentAssignedUserId: order.assignedUserId ?? null
146
215
  });
147
216
  }
@@ -45,8 +45,39 @@ function createOrderAssigneesHandlers(dataSource, entityMap, getHydratedSessionU
45
45
  const session = await getHydratedSessionUser?.() ?? null;
46
46
  const userVendorIds = session?.vendorIds ?? [];
47
47
  const isVendorSession = Boolean(session?.isVendorPortal || !session?.isRBACAdmin && userVendorIds.length > 0);
48
- Boolean(session?.isRBACAdmin && !session?.isVendorPortal);
49
- if (isVendorSession && orderVendorId && !userVendorIds.includes(orderVendorId)) {
48
+ const isPlatformAdmin = Boolean(session?.isRBACAdmin && !session?.isVendorPortal);
49
+ console.log("[ORDERS-DEBUG][ELIGIBLE_ASSIGNEES] Fetching for order:", orderId, "orderVendorId:", orderVendorId, "session:", {
50
+ id: session?.id,
51
+ email: session?.email,
52
+ isVendorSession,
53
+ isPlatformAdmin,
54
+ userVendorIds
55
+ });
56
+ let hasVendorAccess = false;
57
+ if (!isVendorSession) {
58
+ hasVendorAccess = true;
59
+ } else if (orderVendorId && userVendorIds.includes(orderVendorId)) {
60
+ hasVendorAccess = true;
61
+ } else {
62
+ const aId = Number(order?.assignedUserId);
63
+ if (Number.isFinite(aId) && aId > 0 && entityMap.vendor_users) {
64
+ const vuRepo = dataSource.getRepository(entityMap.vendor_users);
65
+ for (const vId of userVendorIds) {
66
+ const count = await vuRepo.count({
67
+ where: {
68
+ vendorId: vId,
69
+ userId: aId
70
+ }
71
+ });
72
+ if (count > 0) {
73
+ hasVendorAccess = true;
74
+ break;
75
+ }
76
+ }
77
+ }
78
+ }
79
+ if (!hasVendorAccess) {
80
+ console.log("[ORDERS-DEBUG][ELIGIBLE_ASSIGNEES] Forbidden: user not in orderVendorId or assignee not in team");
50
81
  return json({
51
82
  error: "Forbidden: Access denied to vendor order"
52
83
  }, {
@@ -54,8 +85,9 @@ function createOrderAssigneesHandlers(dataSource, entityMap, getHydratedSessionU
54
85
  });
55
86
  }
56
87
  const assigneesMap = /* @__PURE__ */ new Map();
88
+ let vendorsList = [];
57
89
  if (isVendorSession) {
58
- const targetVendorId = orderVendorId ?? session?.activeVendorId ?? userVendorIds[0];
90
+ const targetVendorId = session?.activeVendorId ?? (orderVendorId && userVendorIds.includes(orderVendorId) ? orderVendorId : userVendorIds[0]);
59
91
  if (entityMap.vendor_users && targetVendorId) {
60
92
  const vuRepo = dataSource.getRepository(entityMap.vendor_users);
61
93
  const vendorUsers = await vuRepo.find({
@@ -64,42 +96,72 @@ function createOrderAssigneesHandlers(dataSource, entityMap, getHydratedSessionU
64
96
  },
65
97
  relations: [
66
98
  "user",
67
- "vendorRole"
99
+ "vendorRole",
100
+ "vendor"
68
101
  ]
69
102
  });
70
103
  for (const vu of vendorUsers) {
71
104
  const u = vu.user;
72
105
  const r = vu.vendorRole;
106
+ const v = vu.vendor;
73
107
  if (u && u.id && !u.deleted && !u.blocked && u.inviteStatus === "active") {
74
108
  const roleName = r?.name || (r?.isOwnerRole ? "Owner" : "Vendor Staff");
75
109
  assigneesMap.set(u.id, {
76
110
  id: u.id,
77
111
  name: u.name || u.email?.split("@")[0] || `User #${u.id}`,
78
112
  email: u.email || "",
79
- role: roleName
113
+ role: roleName,
114
+ vendorId: targetVendorId,
115
+ vendorName: v?.name || `Vendor #${targetVendorId}`
80
116
  });
81
117
  }
82
118
  }
83
119
  }
84
120
  } else {
121
+ if (entityMap.vendors) {
122
+ const vRepo = dataSource.getRepository(entityMap.vendors);
123
+ const allVendors = await vRepo.find({
124
+ where: {
125
+ deleted: false
126
+ },
127
+ order: {
128
+ name: "ASC"
129
+ },
130
+ select: [
131
+ "id",
132
+ "name",
133
+ "slug"
134
+ ]
135
+ });
136
+ vendorsList = allVendors.map((v) => ({
137
+ id: v.id,
138
+ name: v.name || v.slug || `Vendor #${v.id}`,
139
+ slug: v.slug || ""
140
+ }));
141
+ }
85
142
  if (entityMap.vendor_users) {
86
143
  const vuRepo = dataSource.getRepository(entityMap.vendor_users);
87
144
  const vendorUsers = await vuRepo.find({
88
145
  relations: [
89
146
  "user",
90
- "vendorRole"
147
+ "vendorRole",
148
+ "vendor"
91
149
  ]
92
150
  });
93
151
  for (const vu of vendorUsers) {
94
152
  const u = vu.user;
95
153
  const r = vu.vendorRole;
154
+ const v = vu.vendor;
96
155
  if (u && u.id && !u.deleted && !u.blocked && u.inviteStatus === "active") {
156
+ if (v && v.deleted) continue;
97
157
  const roleName = r?.name || (r?.isOwnerRole ? "Owner" : "Vendor Staff");
98
158
  assigneesMap.set(u.id, {
99
159
  id: u.id,
100
160
  name: u.name || u.email?.split("@")[0] || `User #${u.id}`,
101
161
  email: u.email || "",
102
- role: roleName
162
+ role: roleName,
163
+ vendorId: vu.vendorId,
164
+ vendorName: v?.name || `Vendor #${vu.vendorId}`
103
165
  });
104
166
  }
105
167
  }
@@ -133,13 +195,20 @@ function createOrderAssigneesHandlers(dataSource, entityMap, getHydratedSessionU
133
195
  id: u.id,
134
196
  name: u.name || u.email?.split("@")[0] || `User #${u.id}`,
135
197
  email: u.email || "",
136
- role: roleLabel
198
+ role: roleLabel,
199
+ vendorId: null,
200
+ vendorName: "Platform Staff"
137
201
  });
138
202
  }
139
203
  }
140
204
  }
205
+ console.log("[ORDERS-DEBUG][ELIGIBLE_ASSIGNEES] Returning vendors count:", vendorsList.length, "assignees count:", assigneesMap.size, "currentVendorId:", order.vendorId, "currentAssignedUserId:", order.assignedUserId);
141
206
  return json({
207
+ isPlatformAdmin,
208
+ isVendorSession,
209
+ vendors: vendorsList,
142
210
  assignees: Array.from(assigneesMap.values()),
211
+ currentVendorId: order.vendorId ?? null,
143
212
  currentAssignedUserId: order.assignedUserId ?? null
144
213
  });
145
214
  }