@infuro/cms-core 1.0.66 → 1.0.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin.cjs +214 -32
- package/dist/admin.js +214 -32
- package/dist/api.cjs +45 -42
- package/dist/api.js +12 -9
- package/dist/auth.cjs +51 -51
- package/dist/auth.js +3 -3
- package/dist/{chunk-QYRXLURF.cjs → chunk-22XKONB5.cjs} +640 -145
- package/dist/{chunk-MVHDC3XF.js → chunk-5NOZSG6J.js} +22 -11
- package/dist/{chunk-TU23GJPJ.js → chunk-7JCCPQEF.js} +1 -1
- package/dist/{chunk-WMMZZRDJ.cjs → chunk-GN4LKG4V.cjs} +1 -1
- package/dist/{chunk-KM2I6AFP.cjs → chunk-HBUV73RB.cjs} +9 -9
- package/dist/chunk-IKTBZJHT.js +16 -0
- package/dist/chunk-M5GPOPGX.cjs +49 -0
- package/dist/{chunk-T33KU5G5.js → chunk-MYUGQHU4.js} +548 -53
- package/dist/{chunk-NV5IRHI3.js → chunk-N4LBZXBG.js} +2 -2
- package/dist/{chunk-J7FMZK66.cjs → chunk-O4AFPDQ4.cjs} +22 -11
- package/dist/{chunk-4U6DATGZ.cjs → chunk-OV5TRZET.cjs} +7 -7
- package/dist/chunk-P6S4XFZO.cjs +18 -0
- package/dist/{chunk-RCE5SJBA.js → chunk-SKJH7PX4.js} +1 -1
- package/dist/{chunk-5MZFQRDW.cjs → chunk-SMHQV3WL.cjs} +4 -4
- package/dist/chunk-SUUD7OUG.cjs +455 -0
- package/dist/{chunk-XFDIIVZB.cjs → chunk-UMC7W5G3.cjs} +3 -3
- package/dist/chunk-WKDBMDUX.js +45 -0
- package/dist/{chunk-6DBDJ4VD.js → chunk-Z5G54EGD.js} +2 -2
- package/dist/chunk-Z5OB5QGN.js +465 -0
- package/dist/chunk-ZIT4IP6N.js +445 -0
- package/dist/chunk-ZX5U3VCB.cjs +471 -0
- package/dist/{chunk-NR44CK5E.js → chunk-ZY64VJMS.js} +1 -1
- package/dist/email-queue-3QBQ63F7.js +8 -0
- package/dist/{email-queue-4OY45JIU.cjs → email-queue-K4E4OFI7.cjs} +9 -6
- package/dist/{emit-order-notification-trigger-ZD5YN3JM.cjs → emit-order-notification-trigger-ROASTYQP.cjs} +3 -3
- package/dist/{emit-order-notification-trigger-EJJZ6XTS.js → emit-order-notification-trigger-YUQTPELC.js} +1 -1
- package/dist/{erp-order-invoice-YUSPZ7CE.cjs → erp-order-invoice-AZ5MX2JB.cjs} +8 -5
- package/dist/{erp-order-invoice-H6HCJ7YS.js → erp-order-invoice-XSYHAMBS.js} +4 -1
- package/dist/generate-local-invoice-pdf-BQTCL5MW.cjs +12 -0
- package/dist/generate-local-invoice-pdf-OCFG47SE.js +3 -0
- package/dist/index.cjs +337 -330
- package/dist/index.d.cts +21 -2
- package/dist/index.d.ts +21 -2
- package/dist/index.js +18 -15
- package/dist/invoice-templates-GZ33OENC.js +2 -0
- package/dist/invoice-templates-RB462AQN.cjs +19 -0
- package/dist/migrations/1783300000000-CreateOrderAssigneesTable.ts +43 -0
- package/dist/{order-assignees-handlers-NPKD64P6.cjs → order-assignees-handlers-KF7RMTV5.cjs} +77 -8
- package/dist/{order-assignees-handlers-LKMAGLG6.js → order-assignees-handlers-L3RVKUBS.js} +77 -8
- package/dist/{order-completion-otp-handlers-NK65LOLV.cjs → order-completion-otp-handlers-DDQREULW.cjs} +75 -18
- package/dist/{order-completion-otp-handlers-LFRHXWK4.js → order-completion-otp-handlers-NROWBGXN.js} +73 -16
- package/dist/{order-notification-dispatcher-LL7ETKLU.cjs → order-notification-dispatcher-6HCJ6Q75.cjs} +12 -9
- package/dist/{order-notification-dispatcher-ECPFI7CD.js → order-notification-dispatcher-KM2SY7TX.js} +7 -4
- package/dist/{rbac-debug-db-5R6XFPSV.js → rbac-debug-db-DFZWZ6GV.js} +1 -1
- package/dist/{rbac-debug-db-JKK2MCWF.cjs → rbac-debug-db-KWV7D5PQ.cjs} +2 -2
- package/dist/resolve-invoice-asset-url-JEZRENJW.cjs +11 -0
- package/dist/resolve-invoice-asset-url-QZ2FRDHI.js +2 -0
- package/package.json +1 -1
- package/dist/chunk-GLD263KW.cjs +0 -862
- package/dist/chunk-OPJEV44S.js +0 -847
- package/dist/email-queue-HGXB2FIS.js +0 -5
package/dist/index.d.cts
CHANGED
|
@@ -1980,7 +1980,7 @@ interface SendOrderPlacedEmailDeps {
|
|
|
1980
1980
|
declare function sendOrderPlacedEmailsAfterConfirmation(orderId: number, deps: SendOrderPlacedEmailDeps): Promise<void>;
|
|
1981
1981
|
|
|
1982
1982
|
/** Built-in invoice layout ids selectable in Store settings. */
|
|
1983
|
-
declare const INVOICE_TEMPLATE_IDS: readonly ["classic", "modern", "compact", "bold"];
|
|
1983
|
+
declare const INVOICE_TEMPLATE_IDS: readonly ["classic", "modern", "compact", "bold", "service_detailed"];
|
|
1984
1984
|
type InvoiceTemplateId = (typeof INVOICE_TEMPLATE_IDS)[number];
|
|
1985
1985
|
declare const INVOICE_TEMPLATE_OPTIONS: Array<{
|
|
1986
1986
|
id: InvoiceTemplateId;
|
|
@@ -2016,6 +2016,12 @@ type InvoicePdfInput = {
|
|
|
2016
2016
|
templateId?: string | null;
|
|
2017
2017
|
orderNumber: string;
|
|
2018
2018
|
orderDate: Date | string;
|
|
2019
|
+
serviceDate?: string | null;
|
|
2020
|
+
timeSlot?: string | null;
|
|
2021
|
+
assignedTo?: string | null;
|
|
2022
|
+
qrToken?: string | null;
|
|
2023
|
+
qrData?: string | null;
|
|
2024
|
+
includeQrCode?: boolean;
|
|
2019
2025
|
currency: string;
|
|
2020
2026
|
customerName: string;
|
|
2021
2027
|
customerEmail?: string | null;
|
|
@@ -4180,6 +4186,19 @@ declare class UserDeviceToken {
|
|
|
4180
4186
|
updatedAt: Date;
|
|
4181
4187
|
}
|
|
4182
4188
|
|
|
4189
|
+
declare class OrderAssignee {
|
|
4190
|
+
id: number;
|
|
4191
|
+
orderId: number;
|
|
4192
|
+
userId: number;
|
|
4193
|
+
vendorId: number | null;
|
|
4194
|
+
sortOrder: number;
|
|
4195
|
+
assignedAt: Date;
|
|
4196
|
+
createdAt: Date;
|
|
4197
|
+
order: Order;
|
|
4198
|
+
user: User;
|
|
4199
|
+
vendor: Vendor | null;
|
|
4200
|
+
}
|
|
4201
|
+
|
|
4183
4202
|
/** Map API resource segment (e.g. "blogs", "form_submissions") to entity. Used by CRUD handler. */
|
|
4184
4203
|
declare const CMS_ENTITY_MAP: Record<string, EntityTarget<typeorm.ObjectLiteral>>;
|
|
4185
4204
|
|
|
@@ -4508,4 +4527,4 @@ type CreateCmsAppWithMessagingOptions = CreateCmsAppOptions & EnsureMessagingPlu
|
|
|
4508
4527
|
/** `createCmsApp` + messaging plugins + queue processor registration. */
|
|
4509
4528
|
declare function createCmsAppWithMessaging(options: CreateCmsAppWithMessagingOptions): Promise<CmsApp>;
|
|
4510
4529
|
|
|
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 };
|
|
4530
|
+
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
|
@@ -1980,7 +1980,7 @@ interface SendOrderPlacedEmailDeps {
|
|
|
1980
1980
|
declare function sendOrderPlacedEmailsAfterConfirmation(orderId: number, deps: SendOrderPlacedEmailDeps): Promise<void>;
|
|
1981
1981
|
|
|
1982
1982
|
/** Built-in invoice layout ids selectable in Store settings. */
|
|
1983
|
-
declare const INVOICE_TEMPLATE_IDS: readonly ["classic", "modern", "compact", "bold"];
|
|
1983
|
+
declare const INVOICE_TEMPLATE_IDS: readonly ["classic", "modern", "compact", "bold", "service_detailed"];
|
|
1984
1984
|
type InvoiceTemplateId = (typeof INVOICE_TEMPLATE_IDS)[number];
|
|
1985
1985
|
declare const INVOICE_TEMPLATE_OPTIONS: Array<{
|
|
1986
1986
|
id: InvoiceTemplateId;
|
|
@@ -2016,6 +2016,12 @@ type InvoicePdfInput = {
|
|
|
2016
2016
|
templateId?: string | null;
|
|
2017
2017
|
orderNumber: string;
|
|
2018
2018
|
orderDate: Date | string;
|
|
2019
|
+
serviceDate?: string | null;
|
|
2020
|
+
timeSlot?: string | null;
|
|
2021
|
+
assignedTo?: string | null;
|
|
2022
|
+
qrToken?: string | null;
|
|
2023
|
+
qrData?: string | null;
|
|
2024
|
+
includeQrCode?: boolean;
|
|
2019
2025
|
currency: string;
|
|
2020
2026
|
customerName: string;
|
|
2021
2027
|
customerEmail?: string | null;
|
|
@@ -4180,6 +4186,19 @@ declare class UserDeviceToken {
|
|
|
4180
4186
|
updatedAt: Date;
|
|
4181
4187
|
}
|
|
4182
4188
|
|
|
4189
|
+
declare class OrderAssignee {
|
|
4190
|
+
id: number;
|
|
4191
|
+
orderId: number;
|
|
4192
|
+
userId: number;
|
|
4193
|
+
vendorId: number | null;
|
|
4194
|
+
sortOrder: number;
|
|
4195
|
+
assignedAt: Date;
|
|
4196
|
+
createdAt: Date;
|
|
4197
|
+
order: Order;
|
|
4198
|
+
user: User;
|
|
4199
|
+
vendor: Vendor | null;
|
|
4200
|
+
}
|
|
4201
|
+
|
|
4183
4202
|
/** Map API resource segment (e.g. "blogs", "form_submissions") to entity. Used by CRUD handler. */
|
|
4184
4203
|
declare const CMS_ENTITY_MAP: Record<string, EntityTarget<typeorm.ObjectLiteral>>;
|
|
4185
4204
|
|
|
@@ -4508,4 +4527,4 @@ type CreateCmsAppWithMessagingOptions = CreateCmsAppOptions & EnsureMessagingPlu
|
|
|
4508
4527
|
/** `createCmsApp` + messaging plugins + queue processor registration. */
|
|
4509
4528
|
declare function createCmsAppWithMessaging(options: CreateCmsAppWithMessagingOptions): Promise<CmsApp>;
|
|
4510
4529
|
|
|
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 };
|
|
4530
|
+
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,30 +1,33 @@
|
|
|
1
|
-
export { emitOrderNotificationTrigger, fireOrderNotificationTrigger } from './chunk-
|
|
2
|
-
import { checkMultiVendorEnabled, loadUserVendorContext, getPublicSettingsGroup, BlogGeneratorService } from './chunk-
|
|
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-
|
|
1
|
+
export { emitOrderNotificationTrigger, fireOrderNotificationTrigger } from './chunk-SKJH7PX4.js';
|
|
2
|
+
import { checkMultiVendorEnabled, loadUserVendorContext, getPublicSettingsGroup, BlogGeneratorService } from './chunk-MYUGQHU4.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-MYUGQHU4.js';
|
|
4
|
+
import './chunk-JXF23MPG.js';
|
|
4
5
|
export { countRecentOtpSends, createOtpChallenge, generateNumericOtp, hashOtpCode, normalizePhoneE164, queueSms, registerSmsQueueProcessor, verifyAndConsumeOtpChallenge, verifyOtpCodeHash } from './chunk-OVTOP42W.js';
|
|
6
|
+
export { EVENT_ORDER_MESSAGE_TEMPLATE_DEFAULTS, EVENT_ORDER_TEMPLATE_KEY, EVENT_ORDER_TEMPLATE_VARIABLES, resolveEventOrderTemplate } from './chunk-AYERBA7I.js';
|
|
5
7
|
import { PgBossService } from './chunk-XJNNOSJR.js';
|
|
6
8
|
export { JOB_RUNNER_QUEUE, PgBossService } from './chunk-XJNNOSJR.js';
|
|
7
9
|
export { deductInventoryForConfirmedOrder, mergeInventoryLines, orderInventorySnapshotFromRow, orderStatusHoldsStock, reconcileOrderInventoryBetweenSnapshots, restoreInventoryForCancelledOrder, validateInventoryForConfirmedOrderLines, validateInventoryForOrderBecomingConfirmed } from './chunk-3K5AIEIZ.js';
|
|
8
|
-
import { parseEmailRecipientsFromConfig } from './chunk-
|
|
9
|
-
export { buildEventOrderTemplateVariables, emailPlugin, initWhatsappTriggerDispatcher, joinRecipientsForSend, parseEmailRecipientsFromConfig, resendOrderNotification, serializeEmailRecipients } from './chunk-
|
|
10
|
+
import { parseEmailRecipientsFromConfig } from './chunk-N4LBZXBG.js';
|
|
11
|
+
export { buildEventOrderTemplateVariables, emailPlugin, initWhatsappTriggerDispatcher, joinRecipientsForSend, parseEmailRecipientsFromConfig, resendOrderNotification, serializeEmailRecipients } from './chunk-N4LBZXBG.js';
|
|
10
12
|
export { queueWhatsApp, registerWhatsAppQueueProcessor } from './chunk-GWDI752Q.js';
|
|
11
13
|
export { KNOWN_NOTIFICATION_TRIGGERS, notificationTriggerEmitter } from './chunk-FLUF2GZH.js';
|
|
12
|
-
import './chunk-
|
|
14
|
+
import './chunk-CRFV5WJK.js';
|
|
13
15
|
export { EmailService, emailTemplates, renderEmail, renderLayout } from './chunk-6YOQ7G5O.js';
|
|
14
|
-
import { queueOrderPlacedEmails } from './chunk-
|
|
15
|
-
export { queueEmail, queueOrderPlacedEmails, queueVendorOnboardEmails, registerEmailQueueProcessor } from './chunk-
|
|
16
|
-
export {
|
|
16
|
+
import { queueOrderPlacedEmails } from './chunk-7JCCPQEF.js';
|
|
17
|
+
export { queueEmail, queueOrderPlacedEmails, queueVendorOnboardEmails, registerEmailQueueProcessor } from './chunk-7JCCPQEF.js';
|
|
18
|
+
export { buildLocalInvoicePdfForOrder, isOrderEligibleForInvoiceEmail, resolveOrderInvoicePdfBytes, streamOrderInvoicePdf } from './chunk-ZIT4IP6N.js';
|
|
17
19
|
import './chunk-JC6DLWTE.js';
|
|
20
|
+
export { generateLocalInvoicePdf } from './chunk-Z5OB5QGN.js';
|
|
21
|
+
export { INVOICE_TEMPLATE_IDS, INVOICE_TEMPLATE_OPTIONS, normalizeInvoiceTemplateId } from './chunk-WKDBMDUX.js';
|
|
22
|
+
export { resolveInvoiceAssetUrl } from './chunk-IKTBZJHT.js';
|
|
18
23
|
import { mergeEmailLayoutCompanyDetails } from './chunk-YRCKEGL2.js';
|
|
19
24
|
export { getCompanyDetailsFromSettings, mergeEmailLayoutCompanyDetails } from './chunk-YRCKEGL2.js';
|
|
20
25
|
import './chunk-MQBT33IV.js';
|
|
21
|
-
|
|
22
|
-
export {
|
|
23
|
-
|
|
24
|
-
export {
|
|
26
|
+
export { AUTH_PROVIDERS_SETTINGS_GROUP, buildNextAuthOptions, buildStorefrontNextAuthOptions, createCustomerUserFromGoogleOAuth, getNextAuthOptions, getStorefrontNextAuthOptions, googleOAuthRedirectUri, isGoogleAuthPubliclyEnabled, resolveGoogleAuthConfig, seedAdministratorPermissions } from './chunk-Z5G54EGD.js';
|
|
27
|
+
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';
|
|
28
|
+
import { isSuperAdmin, isVendorGroupName } from './chunk-5NOZSG6J.js';
|
|
29
|
+
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';
|
|
25
30
|
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';
|
|
28
31
|
export { createCmsMiddleware, defaultPublicApiMethods, isAuthDebugClientEnabled, isAuthDebugEnabled, logAuth, logAuthClient, nextAuthCookieDebugInfo, summarizeSessionUserForLog } from './chunk-WUQAOTHA.js';
|
|
29
32
|
export { queueErpPaidOrderForOrderId } from './chunk-TDV6EJHV.js';
|
|
30
33
|
import { erpSafeWebhookUrl, logErp, warnErp, errorErp } from './chunk-SYBOCAWB.js';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkM5GPOPGX_cjs = require('./chunk-M5GPOPGX.cjs');
|
|
4
|
+
require('./chunk-USNT2KNT.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, "INVOICE_TEMPLATE_IDS", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunkM5GPOPGX_cjs.INVOICE_TEMPLATE_IDS; }
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "INVOICE_TEMPLATE_OPTIONS", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return chunkM5GPOPGX_cjs.INVOICE_TEMPLATE_OPTIONS; }
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, "normalizeInvoiceTemplateId", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return chunkM5GPOPGX_cjs.normalizeInvoiceTemplateId; }
|
|
19
|
+
});
|
|
@@ -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
|
+
}
|
package/dist/{order-assignees-handlers-NPKD64P6.cjs → order-assignees-handlers-KF7RMTV5.cjs}
RENAMED
|
@@ -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
|
-
|
|
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 =
|
|
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
|
}
|