@infuro/cms-core 1.0.46 → 1.0.50

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 (65) hide show
  1. package/README.md +30 -16
  2. package/dist/admin.cjs +4568 -2716
  3. package/dist/admin.d.cts +18 -4
  4. package/dist/admin.d.ts +18 -4
  5. package/dist/admin.js +3475 -1625
  6. package/dist/api.cjs +38 -39
  7. package/dist/api.d.cts +9 -3
  8. package/dist/api.d.ts +9 -3
  9. package/dist/api.js +6 -7
  10. package/dist/auth.cjs +84 -51
  11. package/dist/auth.d.cts +105 -4
  12. package/dist/auth.d.ts +105 -4
  13. package/dist/auth.js +4 -3
  14. package/dist/chunk-2IAXTKQN.cjs +19 -0
  15. package/dist/chunk-3EOM4V2M.cjs +452 -0
  16. package/dist/{chunk-X6UQFV4X.cjs → chunk-77NUXO6A.cjs} +14 -12
  17. package/dist/{chunk-KFFB6EMZ.js → chunk-AYERBA7I.js} +3 -7
  18. package/dist/chunk-EIZKW2PF.js +13 -0
  19. package/dist/{chunk-CRYKVJTO.js → chunk-IPDHT2UV.js} +1420 -3
  20. package/dist/{chunk-UDVLFVEC.cjs → chunk-JCMOOPNX.cjs} +3820 -2907
  21. package/dist/{chunk-X47PBV4I.js → chunk-JE22VP6S.js} +1 -0
  22. package/dist/{chunk-DN65KDIA.js → chunk-JIWUVQ6B.js} +14 -13
  23. package/dist/{chunk-HT5DI3XW.cjs → chunk-KOTXDSQB.cjs} +1 -0
  24. package/dist/{chunk-UKC3HYXI.js → chunk-LT2WOPKA.js} +3733 -2813
  25. package/dist/chunk-RK5ETF2I.js +434 -0
  26. package/dist/{chunk-SPQFNIYJ.cjs → chunk-TJ2MIQUT.cjs} +3 -7
  27. package/dist/{chunk-TCSGFAWB.cjs → chunk-UUWAUHUW.cjs} +1451 -3
  28. package/dist/{chunk-57O3HZPG.js → chunk-WRKV6MHB.js} +415 -3
  29. package/dist/{chunk-FBKDMRQL.cjs → chunk-YV5PK4JW.cjs} +427 -7
  30. package/dist/cli.cjs +13 -22
  31. package/dist/cli.js +13 -22
  32. package/dist/{emit-order-notification-trigger-IVLWKKJL.js → emit-order-notification-trigger-6XX7LSC4.js} +1 -1
  33. package/dist/{emit-order-notification-trigger-D2N3KFHL.cjs → emit-order-notification-trigger-NASG7ZEO.cjs} +3 -3
  34. package/dist/{event-order-defaults-EMWBIGL3.cjs → event-order-defaults-DU7V3YND.cjs} +9 -9
  35. package/dist/{event-order-defaults-SDRNAZHC.js → event-order-defaults-H4RT7NMR.js} +1 -1
  36. package/dist/hooks.cjs +43 -0
  37. package/dist/hooks.d.cts +10 -1
  38. package/dist/hooks.d.ts +10 -1
  39. package/dist/hooks.js +39 -1
  40. package/dist/index.cjs +479 -339
  41. package/dist/index.d.cts +181 -20
  42. package/dist/index.d.ts +181 -20
  43. package/dist/index.js +115 -13
  44. package/dist/migrations/1782200000000-VendorTeamProfiles.ts +233 -0
  45. package/dist/migrations/1782300000000-AddTypeToOrderNotificationBindings.ts +75 -0
  46. package/dist/migrations/1782400000000-CreateUserDeviceTokens.ts +36 -0
  47. package/dist/migrations/1782500000000-AddPushToOrderNotificationBindingsChannelEnum.ts +15 -0
  48. package/dist/{order-notification-dispatcher-ZJZB2HUN.js → order-notification-dispatcher-3TA4ETYJ.js} +1 -2
  49. package/dist/{order-notification-dispatcher-SBQAMM5V.cjs → order-notification-dispatcher-ZEAZ5SHV.cjs} +7 -4
  50. package/dist/{rbac-debug-db-2SGNLANF.js → rbac-debug-db-6EMIVMGF.js} +1 -1
  51. package/dist/{rbac-debug-db-4Z6A425H.cjs → rbac-debug-db-6PWTLBEL.cjs} +2 -2
  52. package/dist/theme.cjs +6 -1
  53. package/dist/theme.d.cts +4 -1
  54. package/dist/theme.d.ts +4 -1
  55. package/dist/theme.js +3 -1
  56. package/package.json +1 -1
  57. package/src/admin/admin.css +7 -0
  58. package/dist/chunk-7PMHZRF3.cjs +0 -872
  59. package/dist/chunk-CQHXW4TR.js +0 -107
  60. package/dist/chunk-GUSHM5HN.js +0 -862
  61. package/dist/chunk-NBY4NVTY.cjs +0 -182
  62. package/dist/chunk-SF2XKMCI.js +0 -171
  63. package/dist/chunk-XMRMZ6NQ.cjs +0 -109
  64. package/dist/send-order-placed-emails-B5ZVJT7T.cjs +0 -15
  65. package/dist/send-order-placed-emails-WPI37KRZ.js +0 -6
package/dist/index.d.ts CHANGED
@@ -426,7 +426,7 @@ interface VendorOnboardEmailPayload {
426
426
  vendorSlug?: string;
427
427
  ownerName: string;
428
428
  ownerEmail: string;
429
- activation: 'invite' | 'password';
429
+ activation: 'invite' | 'password' | 'membership';
430
430
  inviteLink?: string;
431
431
  signInLink: string;
432
432
  kind?: 'vendor_onboard' | 'team_invite';
@@ -828,7 +828,7 @@ interface SessionUser {
828
828
  vendorIds?: number[];
829
829
  /** Active vendor for scoped CRUD (vendor staff). */
830
830
  activeVendorId?: number | null;
831
- /** Role for the active vendor link (`vendor_users.role`). */
831
+ /** @deprecated Prefer isVendorRoleOwner / vendorRoleId. Legacy owner|staff hint. */
832
832
  vendorRole?: 'owner' | 'staff' | null;
833
833
  /** Active vendor-scoped role id (`vendor_users.vendorRoleId`). */
834
834
  vendorRoleId?: number | null;
@@ -893,7 +893,9 @@ type VendorScope = {
893
893
  } | {
894
894
  type: 'deny';
895
895
  };
896
- declare const VENDOR_OWNER_GROUP_NAME = "Vendor Owner";
896
+ declare const VENDOR_GROUP_NAME = "Vendor";
897
+ /** @deprecated Use VENDOR_GROUP_NAME */
898
+ declare const VENDOR_OWNER_GROUP_NAME = "Vendor";
897
899
  /** User groups treated as vendor store staff (sidebar + scoped admin). */
898
900
  declare function isVendorGroupName(name: string | null | undefined): boolean;
899
901
  declare function isPlatformAdministrator(user: SessionUser | null | undefined): boolean;
@@ -1795,20 +1797,38 @@ declare class VendorRole {
1795
1797
  permissions: VendorRolePermission[];
1796
1798
  }
1797
1799
 
1798
- /** Links a staff user to a vendor store. */
1800
+ /** Person KYC / contact for a vendor owner or team member (1:1 with vendor_users). */
1801
+ declare class VendorUserProfile {
1802
+ id: number;
1803
+ name: string;
1804
+ email: string;
1805
+ phone: string | null;
1806
+ aadhaarNo: string | null;
1807
+ panNo: string | null;
1808
+ addressLine1: string | null;
1809
+ addressLine2: string | null;
1810
+ city: string | null;
1811
+ state: string | null;
1812
+ postalCode: string | null;
1813
+ createdAt: Date;
1814
+ updatedAt: Date;
1815
+ }
1816
+
1817
+ /** @deprecated Prefer vendorRoleId / isOwnerRole from vendor_roles */
1799
1818
  type VendorUserRole = 'owner' | 'staff';
1819
+ /** Links a staff user to a vendor store. Store role is vendorRoleId only. */
1800
1820
  declare class VendorUser {
1801
1821
  id: number;
1802
1822
  vendorId: number;
1803
1823
  userId: number;
1804
- /** @deprecated use vendorRoleId — kept for migration compatibility */
1805
- role: VendorUserRole;
1806
- vendorRoleId: number | null;
1824
+ vendorRoleId: number;
1825
+ vendorUserProfileId: number;
1807
1826
  createdAt: Date;
1808
1827
  updatedAt: Date;
1809
1828
  vendor: Vendor;
1810
1829
  user: User;
1811
- vendorRole: VendorRole | null;
1830
+ vendorRole: VendorRole;
1831
+ vendorUserProfile: VendorUserProfile;
1812
1832
  }
1813
1833
 
1814
1834
  type VendorInviteStatus = 'none' | 'pending' | 'expired' | 'accepted';
@@ -1829,7 +1849,6 @@ declare class Vendor {
1829
1849
  country: string | null;
1830
1850
  postalCode: string | null;
1831
1851
  gstin: string | null;
1832
- pan: string | null;
1833
1852
  logo: string | null;
1834
1853
  description: string | null;
1835
1854
  metadata: Record<string, unknown> | null;
@@ -2742,6 +2761,7 @@ declare function buildEventOrderTemplateVariables(input: {
2742
2761
  phone?: string | null;
2743
2762
  };
2744
2763
  productNames: string;
2764
+ vendorName?: string;
2745
2765
  orderLines?: OrderLineForTemplate[];
2746
2766
  siteUrl?: string;
2747
2767
  }): Record<string, string>;
@@ -2763,7 +2783,7 @@ type EventOrderMessageTemplateDefault = {
2763
2783
  externalTemplateRef?: string;
2764
2784
  };
2765
2785
  /** Variables available in email HTML and WhatsApp text templates. */
2766
- declare const EVENT_ORDER_TEMPLATE_VARIABLES: readonly ["eventName", "eventSlug", "venue", "startDate", "orderNumber", "orderTotal", "currency", "customerName", "customerEmail", "customerPhone", "productNames", "trackUrl", "qrImageUrl", "orderDetails", "orderDetailsHtml"];
2786
+ declare const EVENT_ORDER_TEMPLATE_VARIABLES: readonly ["eventName", "vendorName", "eventSlug", "venue", "startDate", "orderNumber", "orderTotal", "currency", "customerName", "customerEmail", "customerPhone", "productNames", "trackUrl", "orderDetails", "orderDetailsHtml"];
2767
2787
  declare const EVENT_ORDER_MESSAGE_TEMPLATE_DEFAULTS: EventOrderMessageTemplateDefault[];
2768
2788
  type ResolvedEventOrderTemplate = {
2769
2789
  subject?: string;
@@ -2785,19 +2805,21 @@ declare function resolveEventOrderTemplate(channel: EventOrderNotificationChanne
2785
2805
  } | null>, eventOverride?: EventOrderTemplateOverride | null): Promise<ResolvedEventOrderTemplate | null>;
2786
2806
 
2787
2807
  interface EmitOrderNotificationTriggerDeps {
2788
- dataSource: DataSource;
2808
+ dataSource: any;
2789
2809
  entityMap: Record<string, unknown>;
2790
2810
  }
2791
2811
  declare function emitOrderNotificationTrigger(triggerKey: string, orderId: number, deps: EmitOrderNotificationTriggerDeps, extra?: {
2792
2812
  refundAmount?: number | null;
2813
+ extraVariables?: Record<string, string>;
2793
2814
  }): Promise<void>;
2794
2815
  /** Fire-and-forget wrapper for API handlers (storefront, CRUD, CMS). */
2795
2816
  declare function fireOrderNotificationTrigger(triggerKey: string, orderId: number, deps: EmitOrderNotificationTriggerDeps, extra?: {
2796
2817
  refundAmount?: number | null;
2818
+ extraVariables?: Record<string, string>;
2797
2819
  }): void;
2798
2820
 
2799
2821
  interface OrderNotificationDispatcherDeps {
2800
- dataSource: DataSource;
2822
+ dataSource: any;
2801
2823
  entityMap: EntityMap$2;
2802
2824
  getCms: () => Promise<CmsAppLike$1>;
2803
2825
  }
@@ -2853,7 +2875,7 @@ declare const ORDER_NOTIFICATION_TRIGGERS: readonly [{
2853
2875
  }];
2854
2876
  type OrderNotificationTriggerKey = (typeof ORDER_NOTIFICATION_TRIGGERS)[number]['key'];
2855
2877
 
2856
- type VendorOnboardedActivation = 'invite' | 'password';
2878
+ type VendorOnboardedActivation = 'invite' | 'password' | 'membership';
2857
2879
  type VendorOnboardedKind = 'vendor_onboard' | 'team_invite';
2858
2880
 
2859
2881
  interface EntityMapLike {
@@ -2905,7 +2927,7 @@ declare function seedDefaultAdmin(ds: DataSource, entityMap: SeedEntityMap, opts
2905
2927
  type UserVendorContext = {
2906
2928
  vendorIds: number[];
2907
2929
  activeVendorId: number | null;
2908
- /** @deprecated legacy vendor_users.role */
2930
+ /** @deprecated Prefer isVendorRoleOwner / vendorRoleId */
2909
2931
  vendorRole: VendorUserRole | null;
2910
2932
  vendorRoleId: number | null;
2911
2933
  vendorRoleName: string | null;
@@ -2915,8 +2937,43 @@ type UserVendorContext = {
2915
2937
  /** Load vendor membership + active vendor role permissions for session. */
2916
2938
  declare function loadUserVendorContext(dataSource: DataSource, userId: number, preferredVendorId?: number | null): Promise<UserVendorContext>;
2917
2939
 
2940
+ declare const AUTH_PROVIDERS_SETTINGS_GROUP = "auth_providers";
2941
+ interface GoogleAuthConfig {
2942
+ enabled: boolean;
2943
+ clientId: string;
2944
+ clientSecret: string;
2945
+ }
2946
+ /** Minimal TypeORM DataSource surface needed to read `configs` settings. */
2947
+ type AuthProvidersDataSource = {
2948
+ getRepository(entity: unknown): {
2949
+ find(options: object): Promise<unknown[]>;
2950
+ };
2951
+ };
2952
+ type AuthProvidersEntityMap = {
2953
+ configs?: unknown;
2954
+ };
2955
+ type ResolveGoogleAuthConfigInput = {
2956
+ /** Prefer loading secrets from DB (authenticated server path). */
2957
+ dataSource?: AuthProvidersDataSource;
2958
+ entityMap?: AuthProvidersEntityMap;
2959
+ encryptionKey?: string;
2960
+ /** Optional preloaded settings map (e.g. from host). */
2961
+ settings?: Record<string, string>;
2962
+ /** When true, skip env fallback. Default false. */
2963
+ skipEnvFallback?: boolean;
2964
+ };
2965
+ /**
2966
+ * Resolve Google web OAuth config for registering NextAuth GoogleProvider.
2967
+ * Order: explicit `settings` → DB `auth_providers` group → env (`GOOGLE_*`).
2968
+ */
2969
+ declare function resolveGoogleAuthConfig(input?: ResolveGoogleAuthConfigInput): Promise<GoogleAuthConfig | null>;
2970
+ /** Public redirect URI for Google Web OAuth (NextAuth callback). */
2971
+ declare function googleOAuthRedirectUri(baseUrl?: string): string;
2972
+ /** Whether the public `googleEnabled` flag is on (for SignInPage; secrets not required). */
2973
+ declare function isGoogleAuthPubliclyEnabled(settings: Record<string, unknown> | null | undefined): boolean;
2974
+
2918
2975
  /**
2919
- * Build NextAuth options for credentials auth. App can extend/override via extend().
2976
+ * Build NextAuth options for credentials auth (+ optional Google OAuth). App can extend/override via extend().
2920
2977
  */
2921
2978
 
2922
2979
  interface NextAuthUser {
@@ -2975,12 +3032,44 @@ interface NextAuthOptionsConfig {
2975
3032
  * - `true` — always allow (dedicated storefront auth)
2976
3033
  * - `false` — always block
2977
3034
  * - omitted — auto: allow unless `callbackUrl` targets `/admin` (storefront `/signin` works unchanged)
3035
+ *
3036
+ * For Google OAuth: customers are allowed only when this is `true`.
3037
+ * When `true` and the Google email is new, {@link createCustomerUserFromGoogle} may create a Customer.
2978
3038
  */
2979
3039
  allowCustomerLogin?: boolean;
2980
- }
3040
+ /**
3041
+ * Static Google web OAuth config. When set and enabled, registers GoogleProvider.
3042
+ * Prefer {@link buildNextAuthOptions} to load from Plugins settings + env.
3043
+ */
3044
+ google?: GoogleAuthConfig | null;
3045
+ /**
3046
+ * Storefront only: when Google email has no user and {@link allowCustomerLogin} is true,
3047
+ * create a Customer-group user. Wired automatically by {@link buildNextAuthOptions} when
3048
+ * `dataSource` + `entityMap` are provided.
3049
+ */
3050
+ createCustomerUserFromGoogle?: (input: {
3051
+ email: string;
3052
+ name: string | null;
3053
+ }) => Promise<NextAuthUser | null>;
3054
+ }
3055
+ type BuildNextAuthOptionsConfig = NextAuthOptionsConfig & {
3056
+ /** Load Google settings from DB / env when `google` is not passed explicitly. */
3057
+ dataSource?: AuthProvidersDataSource;
3058
+ entityMap?: AuthProvidersEntityMap;
3059
+ settingsEncryptionKey?: string;
3060
+ /** Extra input for {@link resolveGoogleAuthConfig}. */
3061
+ googleResolve?: Omit<ResolveGoogleAuthConfigInput, 'dataSource' | 'entityMap' | 'encryptionKey'>;
3062
+ };
2981
3063
  declare function getNextAuthOptions(config: NextAuthOptionsConfig): NextAuthOptions;
3064
+ /**
3065
+ * Async builder: loads Google OAuth from Plugins `auth_providers` settings (and env fallback),
3066
+ * then returns the same options as {@link getNextAuthOptions}.
3067
+ */
3068
+ declare function buildNextAuthOptions(config: BuildNextAuthOptionsConfig): Promise<NextAuthOptions>;
2982
3069
  /** Storefront sign-in: allows Customer group; use with signInPage `/signin`. */
2983
3070
  declare function getStorefrontNextAuthOptions(config: Omit<NextAuthOptionsConfig, 'allowCustomerLogin'>): NextAuthOptions;
3071
+ /** Storefront + optional Google from settings/env. */
3072
+ declare function buildStorefrontNextAuthOptions(config: Omit<BuildNextAuthOptionsConfig, 'allowCustomerLogin'>): Promise<NextAuthOptions>;
2984
3073
 
2985
3074
  declare function enrichUserWithVendorContext(dataSource: DataSource, user: NextAuthUser | null): Promise<NextAuthUser | null>;
2986
3075
 
@@ -3679,6 +3768,15 @@ declare class Wishlist {
3679
3768
  items: WishlistItem[];
3680
3769
  }
3681
3770
 
3771
+ declare class LlmAgentKnowledgeDocument {
3772
+ id: number;
3773
+ agentId: number;
3774
+ documentId: number;
3775
+ createdAt: Date;
3776
+ agent: LlmAgent;
3777
+ document: KnowledgeBaseDocument;
3778
+ }
3779
+
3682
3780
  declare class Currency {
3683
3781
  id: number;
3684
3782
  code: string;
@@ -3932,12 +4030,19 @@ declare class Attendee {
3932
4030
 
3933
4031
  declare enum NotificationChannel {
3934
4032
  WHATSAPP = "whatsapp",
3935
- EMAIL = "email"
4033
+ EMAIL = "email",
4034
+ MOBILE = "mobile"
4035
+ }
4036
+ declare enum NotificationAudienceType {
4037
+ CUSTOMERS = "customers",
4038
+ VENDORS = "vendors",
4039
+ ADMIN = "admin"
3936
4040
  }
3937
4041
  declare class OrderNotificationBinding {
3938
4042
  id: number;
3939
4043
  triggerKey: string;
3940
4044
  channel: NotificationChannel;
4045
+ type: NotificationAudienceType;
3941
4046
  messageTemplateId: number | null;
3942
4047
  enabled: boolean;
3943
4048
  createdAt: Date;
@@ -3956,6 +4061,24 @@ declare class OrderNotificationTrigger {
3956
4061
  updatedAt: Date;
3957
4062
  }
3958
4063
 
4064
+ declare enum UserDevicePlatform {
4065
+ ANDROID = "android",
4066
+ IOS = "ios"
4067
+ }
4068
+ declare class UserDeviceToken {
4069
+ id: string;
4070
+ vendorId: string;
4071
+ userId: string;
4072
+ token: string;
4073
+ platform: UserDevicePlatform;
4074
+ deviceId: string | null;
4075
+ appVersion: string | null;
4076
+ isActive: boolean;
4077
+ lastUsedAt: Date | null;
4078
+ createdAt: Date;
4079
+ updatedAt: Date;
4080
+ }
4081
+
3959
4082
  /** Map API resource segment (e.g. "blogs", "form_submissions") to entity. Used by CRUD handler. */
3960
4083
  declare const CMS_ENTITY_MAP: Record<string, EntityTarget<typeorm.ObjectLiteral>>;
3961
4084
 
@@ -4052,7 +4175,39 @@ declare function logAuthClient(message: string, data?: Record<string, unknown>):
4052
4175
  declare function summarizeSessionUserForLog(user: unknown): Record<string, unknown>;
4053
4176
  declare function nextAuthCookieDebugInfo(): Record<string, unknown>;
4054
4177
 
4055
- type VendorOwnerActivation = 'invite' | 'password';
4178
+ type CreateGoogleCustomerDataSource = {
4179
+ getRepository(entity: unknown): {
4180
+ findOne(options: object): Promise<unknown | null>;
4181
+ create(entityLike: object): unknown;
4182
+ save(entity: unknown): Promise<unknown>;
4183
+ metadata?: {
4184
+ columns: Array<{
4185
+ propertyName: string;
4186
+ }>;
4187
+ };
4188
+ find?(options: object): Promise<unknown[]>;
4189
+ update?(id: number, partial: object): Promise<unknown>;
4190
+ };
4191
+ };
4192
+ type CreateGoogleCustomerEntityMap = {
4193
+ users?: unknown;
4194
+ user_groups?: unknown;
4195
+ customer?: unknown;
4196
+ contacts?: unknown;
4197
+ };
4198
+ type CreateGoogleCustomerInput = {
4199
+ dataSource: CreateGoogleCustomerDataSource;
4200
+ entityMap: CreateGoogleCustomerEntityMap;
4201
+ email: string;
4202
+ name?: string | null;
4203
+ };
4204
+ /**
4205
+ * Creates an active Customer user for a verified Google email.
4206
+ * Returns the user with `group.permissions` loaded (same shape as password login).
4207
+ */
4208
+ declare function createCustomerUserFromGoogleOAuth(input: CreateGoogleCustomerInput): Promise<NextAuthUser | null>;
4209
+
4210
+ type VendorOwnerActivation = 'invite' | 'password' | 'membership';
4056
4211
  interface VendorOnboardHandlersConfig {
4057
4212
  dataSource: DataSource;
4058
4213
  entityMap: EntityMap$2;
@@ -4078,8 +4233,14 @@ declare function createVendorOnboardHandlers(config: VendorOnboardHandlersConfig
4078
4233
  switchVendor(req: Request): Promise<Response>;
4079
4234
  /** GET /api/admin/vendor/team */
4080
4235
  listTeam(): Promise<Response>;
4081
- /** POST /api/admin/vendor/team — add staff to vendor */
4236
+ /** POST /api/admin/vendor/team — invite staff (set-password for new; accept-only for existing vendor people) */
4082
4237
  addTeamMember(req: Request): Promise<Response>;
4238
+ /** POST /api/admin/vendor/team/send-invite — send invite email for a pending team member */
4239
+ sendTeamInviteEmail(req: Request): Promise<Response>;
4240
+ /** GET /api/admin/vendor/team-invite?token=&vendorId= — preflight for membership accept (no password) */
4241
+ validateTeamInvite(req: Request): Promise<Response>;
4242
+ /** POST /api/admin/vendor/team-invite — accept membership (token; no password) */
4243
+ acceptTeamInvite(req: Request): Promise<Response>;
4083
4244
  /** PATCH /api/admin/vendor/team/:userId — change member store role */
4084
4245
  updateTeamMemberRole(req: Request, userIdStr: string): Promise<Response>;
4085
4246
  /** DELETE /api/admin/vendor/team/:userId */
@@ -4246,4 +4407,4 @@ type CreateCmsAppWithMessagingOptions = CreateCmsAppOptions & EnsureMessagingPlu
4246
4407
  /** `createCmsApp` + messaging plugins + queue processor registration. */
4247
4408
  declare function createCmsAppWithMessaging(options: CreateCmsAppWithMessagingOptions): Promise<CmsApp>;
4248
4409
 
4249
- export { ADMIN_GROUP_NAME, Address, type AdminNavItem, type AnalyticsHandlerConfig, type AnalyticsPluginConfig, type AppliedDiscountUsage, Attendee, Attribute, type AuthHandlersConfig, type AuthHelpers, type AuthorizeOtpInput, BLOG_GENERATOR_AGENT_NAME, BLOG_GENERATOR_DEFAULT_SYSTEM_INSTRUCTION, BLOG_GENERATOR_DEFAULT_VALIDATION_RULES, BLOG_GENERATOR_LLM_AGENT_SLUG, BLOG_GENERATOR_MARKDOWN_ARTICLE_SEPARATOR, BLOG_METADATA_ENRICHER_AGENT_NAME, BLOG_METADATA_ENRICHER_DEFAULT_SYSTEM_INSTRUCTION, BLOG_METADATA_ENRICHER_DEFAULT_VALIDATION_RULES, BLOG_METADATA_ENRICHER_LLM_AGENT_SLUG, Blog, type BlogBySlugConfig, type BlogGeneratorBlogDraft, type BlogGeneratorDraftParseMode, type BlogGeneratorPluginConfig, type BlogGeneratorSeoDraft, BlogGeneratorService, Brand, CMS_ENTITY_MAP, type CachePluginConfig, type CacheService, type CaptchaProviderId, type CaptchaPublicConfig, CaptchaService, type CaptchaVerifyResult, Cart, CartItem, Category, type ChangePasswordConfig, ChatConversation, ChatMessage, type ChatPublicConfig, type CmsApiHandlerConfig, type CmsApp, type CmsGetter, type CmsMiddlewareConfig, type CmsMiddlewareRequest, type CmsPlugin, Collection, Combo, ComboItem, Comment, type CompanyDetails, Config, Contact, type CreateCmsAppOptions, type CreateCmsAppWithMessagingOptions, type CrudHandlerOptions, Currency, CurrencyExchange, Customer, Customer_Contacts, DEFAULT_ADMIN_NAV, DEFAULT_ORDER_NOTIFICATION_TRIGGER_SEEDS, type DashboardStatsConfig, type DataSourceManager, Discount, DiscountRules, type 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, 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, 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 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, UserGroup, type UserInviteStatus, type UserProfileConfig, type UsersApiConfig, VENDOR_ADMIN_GROUP_ID, 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, 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, blogGeneratorPlugin, buildBlogMetadataUserPrompt, buildCaptchaPublicConfig, buildCronFromSchedule, buildEventOrderTemplateVariables, buildLocalInvoicePdfForOrder, buildRssUserPromptFromFeeds, 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, 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, hasEntityPermission, hashOtpCode, hydrateVendorSessionUser, initWhatsappTriggerDispatcher, invalidateEventsCache, invalidateMultiVendorCache, invalidateRequireEventApprovalCache, invalidateRequireProductApprovalCache, invalidateVendorCatalogCreateFlagsCache, isAuthDebugClientEnabled, isAuthDebugEnabled, isCustomerTypeContact, 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, 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 };
4410
+ 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, 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,24 +1,25 @@
1
- export { sendOrderPlacedEmailsAfterConfirmation } from './chunk-CQHXW4TR.js';
2
- export { emitOrderNotificationTrigger, fireOrderNotificationTrigger } from './chunk-X47PBV4I.js';
3
- import { checkMultiVendorEnabled, loadUserVendorContext, getPublicSettingsGroup, BlogGeneratorService } from './chunk-UKC3HYXI.js';
4
- export { Address, Attendee, Attribute, BLOG_GENERATOR_AGENT_NAME, BLOG_GENERATOR_DEFAULT_SYSTEM_INSTRUCTION, BLOG_GENERATOR_DEFAULT_VALIDATION_RULES, BLOG_GENERATOR_LLM_AGENT_SLUG, BLOG_GENERATOR_MARKDOWN_ARTICLE_SEPARATOR, BLOG_METADATA_ENRICHER_AGENT_NAME, BLOG_METADATA_ENRICHER_DEFAULT_SYSTEM_INSTRUCTION, BLOG_METADATA_ENRICHER_DEFAULT_VALIDATION_RULES, BLOG_METADATA_ENRICHER_LLM_AGENT_SLUG, Blog, BlogGeneratorService, Brand, CMS_ENTITY_MAP, Cart, CartItem, Category, ChatConversation, ChatMessage, Collection, Combo, ComboItem, Comment, Config, Contact, Currency, CurrencyExchange, Customer, Customer_Contacts, Discount, DiscountRules, Event, EventProduct, Form, FormField, FormSubmission, JobSchedule, JobScheduleRun, KnowledgeBaseChunk, KnowledgeBaseDocument, LlmAgent, Media, MessageTemplate, Order, OrderAddresses, OrderDiscounts, OrderItem, OrderNotificationBinding, OrderNotificationTrigger, OtpChallenge, Page, PasswordResetToken, Payment, Permission, Product, ProductAttribute, ProductCategory, ProductConfig, ProductVariant, RefundPolicy, RefundRequest, RssArticle, RssFeed, Seo, Tag, Tax, User, UserGroup, Vendor, VendorCustomer, VendorRole, VendorRolePermission, VendorUser, Wishlist, WishlistItem, ZIP_MIME_TYPES, applyApprovalStatusSideEffects, applyEventApprovalStatusSideEffects, applyRotatingVendorInvite, applyVendorCustomersContactFilter, applyVendorEventCreateApproval, applyVendorProductCreateApproval, assertCaptchaOk, assertContactAllowedForVendorOrder, assertEventApprovalUpdate, assertProductApprovalUpdate, buildBlogMetadataUserPrompt, buildCronFromSchedule, buildRssUserPromptFromFeeds, buildUserInviteLink, buildVendorInviteLink, calculateOrderRefundPreview, calculateRefundFromPolicy, checkAndIncrementDiscountUsage, checkEventsEnabled, checkMultiVendorEnabled, completeUserInviteAccept, consumeAppliedDiscountUsages, contactIsVendorCustomer, countDiscountOrdersForContact, countRecentOtpSends, createAnalyticsHandlers, createBlogBySlugHandler, createChangePasswordHandler, createCmsApiHandler, createCmsApp, createCmsAppWithMessaging, createCrudByIdHandler, createCrudHandler, createDashboardStatsHandler, createEcommerceAnalyticsHandler, createEventOrderMessageTemplateHandlers, createForgotPasswordHandler, createFormBySlugHandler, createInviteAcceptHandler, createJobScheduleHandlers, createLlmAgentKnowledgeHandlers, createMediaZipExtractHandler, createMessageTemplateRowLoader, createOtpChallenge, createSetPasswordHandler, createSettingsApiHandlers, createSocialMediaHandlers, createStorefrontApiHandler, createUploadHandler, createUserAuthApiRouter, createUserAvatarHandler, createUserProfileHandler, createUsersApiHandlers, createVendorDashboardHandler, createVendorOnboardHandlers, customerPhoneForEmail, customerPhoneForUser, daysBeforeEventStart, decrementDiscountUsage, describeEventTierPolicy, ensureCustomerForUser, ensureCustomerRecord, ensureMessagingPluginsOnCms, ensureScheduleQueueWorker, ensureVendorCustomerForOrderContact, ensureVendorCustomersForOrder, findActiveRefundPolicyForVendor, findUserByInviteToken, findVendorByInviteToken, formatTierRange, generateNumericOtp, getPublicSettingsGroup, getRequireEventApproval, getRequireProductApproval, getRssArticleSummaryFromItem, getVendorCatalogCreateFlags, hashOtpCode, hydrateVendorSessionUser, invalidateEventsCache, invalidateMultiVendorCache, invalidateRequireEventApprovalCache, invalidateRequireProductApprovalCache, invalidateVendorCatalogCreateFlagsCache, isCustomerTypeContact, isMaxPerUserUsageReached, isMaxTotalUsageReached, isSyntheticCustomerPhone, isZipMedia, linkUnclaimedContactToUser, llmAgentToChatAgentOptions, loadSettingsGroupFromDb, loadUserVendorContext, mergeGuardrailsIntoSystemPrompt, messagingPlugins, metaFetchUserManagedPages, metaPostPageFeed, metaPostPagePhoto, metaResolvePageAccessToken, newUserInviteToken, normalizeCustomerPhone, normalizePhoneE164, normalizeRefundTiers, overlayCmsPlugins, parseBlogGeneratorAgentContent, parseBlogGeneratorModelOutput, parseBlogMetadataEnrichmentJson, parseLlmAgentValidationRules, pgBossScheduleNameForId, queueErpCreateContactIfEnabled, queueJobScheduleNow, queuePlugin, queueSms, recordDiscountUsage, registerJobRunnerWorker, registerMessagingQueueProcessors, registerSmsQueueProcessor, relativePathFromMediaParentId, resolveBlogCategoryIdByName, resolveSettingsEncryptionKey, resolveVendorIdForContactCheck, sanitizeMediaFolderPath, sanitizeStorageSegment, sendVendorOnboardEmails, simpleDecrypt, simpleEncrypt, syncJobScheduleToPgBoss, validateRefundTiers, validateScheduleInput, validateUserMessageAgainstAgentRules, validateUserMessageAgainstStructuredRules, verifyAndConsumeOtpChallenge, verifyOtpCodeHash, whatsappPlugin, wrapGetCmsWithMessaging } from './chunk-UKC3HYXI.js';
1
+ export { emitOrderNotificationTrigger, fireOrderNotificationTrigger } from './chunk-JE22VP6S.js';
2
+ import { checkMultiVendorEnabled, loadUserVendorContext, getPublicSettingsGroup, BlogGeneratorService } from './chunk-LT2WOPKA.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, buildBlogMetadataUserPrompt, buildCronFromSchedule, buildRssUserPromptFromFeeds, buildUserInviteLink, buildVendorInviteLink, calculateOrderRefundPreview, calculateRefundFromPolicy, checkAndIncrementDiscountUsage, checkEventsEnabled, checkMultiVendorEnabled, completeUserInviteAccept, consumeAppliedDiscountUsages, contactIsVendorCustomer, countDiscountOrdersForContact, countRecentOtpSends, createAnalyticsHandlers, createBlogBySlugHandler, createChangePasswordHandler, createCmsApiHandler, createCmsApp, createCmsAppWithMessaging, createCrudByIdHandler, createCrudHandler, createDashboardStatsHandler, createEcommerceAnalyticsHandler, createEventOrderMessageTemplateHandlers, createForgotPasswordHandler, createFormBySlugHandler, createInviteAcceptHandler, createJobScheduleHandlers, createLlmAgentKnowledgeHandlers, createMediaZipExtractHandler, createMessageTemplateRowLoader, createOtpChallenge, createSetPasswordHandler, createSettingsApiHandlers, createSocialMediaHandlers, createStorefrontApiHandler, createUploadHandler, createUserAuthApiRouter, createUserAvatarHandler, createUserProfileHandler, createUsersApiHandlers, createVendorDashboardHandler, createVendorOnboardHandlers, daysBeforeEventStart, decrementDiscountUsage, describeEventTierPolicy, ensureMessagingPluginsOnCms, ensureScheduleQueueWorker, ensureVendorCustomerForOrderContact, ensureVendorCustomersForOrder, findActiveRefundPolicyForVendor, findUserByInviteToken, findVendorByInviteToken, formatTierRange, generateNumericOtp, getPublicSettingsGroup, getRequireEventApproval, getRequireProductApproval, getRssArticleSummaryFromItem, getVendorCatalogCreateFlags, hashOtpCode, hydrateVendorSessionUser, invalidateEventsCache, invalidateMultiVendorCache, invalidateRequireEventApprovalCache, invalidateRequireProductApprovalCache, invalidateVendorCatalogCreateFlagsCache, isCustomerTypeContact, isMaxPerUserUsageReached, isMaxTotalUsageReached, isZipMedia, llmAgentToChatAgentOptions, loadSettingsGroupFromDb, loadUserVendorContext, mergeGuardrailsIntoSystemPrompt, messagingPlugins, metaFetchUserManagedPages, metaPostPageFeed, metaPostPagePhoto, metaResolvePageAccessToken, newUserInviteToken, normalizePhoneE164, normalizeRefundTiers, overlayCmsPlugins, parseBlogGeneratorAgentContent, parseBlogGeneratorModelOutput, parseBlogMetadataEnrichmentJson, parseLlmAgentValidationRules, pgBossScheduleNameForId, queueErpCreateContactIfEnabled, queueJobScheduleNow, queuePlugin, queueSms, recordDiscountUsage, registerJobRunnerWorker, registerMessagingQueueProcessors, registerSmsQueueProcessor, relativePathFromMediaParentId, resolveBlogCategoryIdByName, resolveSettingsEncryptionKey, resolveVendorIdForContactCheck, sanitizeMediaFolderPath, sanitizeStorageSegment, sendVendorOnboardEmails, simpleDecrypt, simpleEncrypt, syncJobScheduleToPgBoss, validateRefundTiers, validateScheduleInput, validateUserMessageAgainstAgentRules, validateUserMessageAgainstStructuredRules, verifyAndConsumeOtpChallenge, verifyOtpCodeHash, whatsappPlugin, wrapGetCmsWithMessaging } from './chunk-LT2WOPKA.js';
5
4
  export { deductInventoryForConfirmedOrder, mergeInventoryLines, orderInventorySnapshotFromRow, orderStatusHoldsStock, reconcileOrderInventoryBetweenSnapshots, restoreInventoryForCancelledOrder, validateInventoryForConfirmedOrderLines, validateInventoryForOrderBecomingConfirmed } from './chunk-3K5AIEIZ.js';
6
- export { activeUniqueValueExists, retireSoftDeletedUniqueValue } from './chunk-DBPSJYLZ.js';
7
- export { buildEventOrderTemplateVariables, initWhatsappTriggerDispatcher, queueWhatsApp, registerWhatsAppQueueProcessor, resendOrderNotification } from './chunk-GUSHM5HN.js';
8
- export { EmailService, emailPlugin, emailTemplates, joinRecipientsForSend, parseEmailRecipientsFromConfig, renderEmail, renderLayout, serializeEmailRecipients } from './chunk-CRYKVJTO.js';
5
+ import { parseEmailRecipientsFromConfig } from './chunk-IPDHT2UV.js';
6
+ export { EmailService, buildEventOrderTemplateVariables, emailPlugin, emailTemplates, initWhatsappTriggerDispatcher, joinRecipientsForSend, parseEmailRecipientsFromConfig, queueWhatsApp, registerWhatsAppQueueProcessor, renderEmail, renderLayout, resendOrderNotification, serializeEmailRecipients } from './chunk-IPDHT2UV.js';
9
7
  export { KNOWN_NOTIFICATION_TRIGGERS, notificationTriggerEmitter } from './chunk-HCIRL37O.js';
10
8
  import './chunk-JXF23MPG.js';
9
+ import { queueOrderPlacedEmails } from './chunk-L3525VXI.js';
11
10
  export { queueEmail, queueOrderPlacedEmails, queueVendorOnboardEmails, registerEmailQueueProcessor } from './chunk-L3525VXI.js';
11
+ import { mergeEmailLayoutCompanyDetails } from './chunk-2KUCQVAQ.js';
12
12
  export { INVOICE_TEMPLATE_IDS, INVOICE_TEMPLATE_OPTIONS, buildLocalInvoicePdfForOrder, generateLocalInvoicePdf, getCompanyDetailsFromSettings, isOrderEligibleForInvoiceEmail, mergeEmailLayoutCompanyDetails, normalizeInvoiceTemplateId, resolveInvoiceAssetUrl, resolveOrderInvoicePdfBytes, streamOrderInvoicePdf } from './chunk-2KUCQVAQ.js';
13
13
  import './chunk-MQBT33IV.js';
14
14
  import './chunk-CRFV5WJK.js';
15
- export { EVENT_ORDER_MESSAGE_TEMPLATE_DEFAULTS, EVENT_ORDER_TEMPLATE_KEY, EVENT_ORDER_TEMPLATE_VARIABLES, resolveEventOrderTemplate } from './chunk-KFFB6EMZ.js';
15
+ export { EVENT_ORDER_MESSAGE_TEMPLATE_DEFAULTS, EVENT_ORDER_TEMPLATE_KEY, EVENT_ORDER_TEMPLATE_VARIABLES, resolveEventOrderTemplate } from './chunk-AYERBA7I.js';
16
16
  import { PgBossService } from './chunk-GO7PPYNU.js';
17
17
  export { JOB_RUNNER_QUEUE, PgBossService } from './chunk-GO7PPYNU.js';
18
- export { createCmsMiddleware, defaultPublicApiMethods, getNextAuthOptions, getStorefrontNextAuthOptions, isAuthDebugClientEnabled, isAuthDebugEnabled, logAuth, logAuthClient, nextAuthCookieDebugInfo, seedAdministratorPermissions, summarizeSessionUserForLog } from './chunk-57O3HZPG.js';
19
- export { OPEN_ENDPOINTS, PERMISSION_REQUIRED_ENDPOINTS, RBAC_ADMIN_ONLY_ENTITIES, canManageRoles, createAuthHelpers, createCmsAuthBundle, getRequiredPermission, isOpenEndpoint, isPublicMethod, sessionHasEntityAccess } from './chunk-SF2XKMCI.js';
20
- import { isSuperAdmin, isVendorGroupName } from './chunk-DN65KDIA.js';
21
- export { ADMIN_GROUP_NAME, SUPER_ADMIN_GROUP_ID, VENDOR_ADMIN_GROUP_ID, VENDOR_OWNER_GROUP_NAME, VENDOR_SCOPED_STORE_ENTITIES, VENDOR_STORE_RBAC_ENTITIES, canManageVendorRoles, canManageVendorTeam, canOnboardVendors, explainSessionEntityAccess, getPermissionableEntityKeys, hasEntityPermission, isPlatformAdministrator, isRbacDebugEnabled, isSuperAdmin, isSuperAdminGroupName, isVendorAdmin, isVendorGroupName, isVendorOwner, isVendorPortalUser, isVendorStaff, logEntityAccessDecision, logRbac, permissionRowsToRecord, resolveVendorScopeFromSessionUser, summarizeEntityPerms, vendorPortalFlagsFromUser } from './chunk-DN65KDIA.js';
18
+ export { AUTH_PROVIDERS_SETTINGS_GROUP, buildNextAuthOptions, buildStorefrontNextAuthOptions, createCmsMiddleware, createCustomerUserFromGoogleOAuth, defaultPublicApiMethods, getNextAuthOptions, getStorefrontNextAuthOptions, googleOAuthRedirectUri, isAuthDebugClientEnabled, isAuthDebugEnabled, isGoogleAuthPubliclyEnabled, logAuth, logAuthClient, nextAuthCookieDebugInfo, resolveGoogleAuthConfig, seedAdministratorPermissions, summarizeSessionUserForLog } from './chunk-WRKV6MHB.js';
19
+ 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-RK5ETF2I.js';
20
+ export { activeUniqueValueExists, retireSoftDeletedUniqueValue } from './chunk-DBPSJYLZ.js';
21
+ import { isSuperAdmin, isVendorGroupName } from './chunk-JIWUVQ6B.js';
22
+ 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-JIWUVQ6B.js';
22
23
  export { queueErpPaidOrderForOrderId } from './chunk-TDV6EJHV.js';
23
24
  import { erpSafeWebhookUrl, logErp, warnErp, errorErp } from './chunk-SYBOCAWB.js';
24
25
  export { queueErp, registerErpQueueProcessor } from './chunk-SYBOCAWB.js';
@@ -2178,6 +2179,107 @@ async function rateLimitCheckoutPost(req) {
2178
2179
  }
2179
2180
  __name(rateLimitCheckoutPost, "rateLimitCheckoutPost");
2180
2181
 
2182
+ // src/lib/send-order-placed-emails.ts
2183
+ async function getSettingsGroup(deps, group) {
2184
+ const ds = await deps.getDataSource();
2185
+ const rows = await ds.getRepository(deps.entityMap.configs).find({
2186
+ where: {
2187
+ settings: group,
2188
+ deleted: false
2189
+ }
2190
+ });
2191
+ return Object.fromEntries(rows.map((r) => [
2192
+ r.key,
2193
+ r.value
2194
+ ]));
2195
+ }
2196
+ __name(getSettingsGroup, "getSettingsGroup");
2197
+ async function sendOrderPlacedEmailsAfterConfirmation(orderId, deps) {
2198
+ try {
2199
+ let addrToRecord2 = function(a) {
2200
+ if (!a) return void 0;
2201
+ const out = {};
2202
+ const set = /* @__PURE__ */ __name((k, v) => {
2203
+ const t = v != null ? String(v).trim() : "";
2204
+ if (t) out[k] = t;
2205
+ }, "set");
2206
+ set("line1", a.line1);
2207
+ set("line2", a.line2);
2208
+ set("city", a.city);
2209
+ set("state", a.state);
2210
+ set("postalCode", a.postalCode);
2211
+ set("country", a.country);
2212
+ return Object.keys(out).length ? out : void 0;
2213
+ };
2214
+ var addrToRecord = addrToRecord2;
2215
+ __name(addrToRecord2, "addrToRecord");
2216
+ const ds = await deps.getDataSource();
2217
+ const order = await ds.getRepository(deps.entityMap.orders).findOne({
2218
+ where: {
2219
+ id: orderId
2220
+ },
2221
+ relations: [
2222
+ "contact",
2223
+ "billingAddress",
2224
+ "shippingAddress"
2225
+ ]
2226
+ });
2227
+ if (!order) return;
2228
+ const o = order;
2229
+ const contact = o.contact;
2230
+ const customerEmail = contact?.email?.trim() || null;
2231
+ const customerName = contact?.name?.trim() || void 0;
2232
+ const itemRows = await ds.getRepository(deps.entityMap.order_items).find({
2233
+ where: {
2234
+ orderId
2235
+ },
2236
+ relations: [
2237
+ "product"
2238
+ ],
2239
+ order: {
2240
+ id: "ASC"
2241
+ }
2242
+ });
2243
+ const lineItems = itemRows.map((row) => {
2244
+ const r = row;
2245
+ const name = r.product?.name && String(r.product.name).trim() || `Product #${r.productId}`;
2246
+ return {
2247
+ productName: name,
2248
+ quantity: Math.max(0, Math.floor(Number(r.quantity) || 0)),
2249
+ unitPrice: r.unitPrice,
2250
+ lineTotal: r.total,
2251
+ sku: r.product?.sku && String(r.product.sku).trim() ? r.product.sku : void 0,
2252
+ tax: r.tax != null && Number(r.tax) !== 0 ? r.tax : void 0,
2253
+ hsn: r.hsn && String(r.hsn).trim() ? r.hsn : void 0
2254
+ };
2255
+ });
2256
+ const [branding, emailSettings] = await Promise.all([
2257
+ getSettingsGroup(deps, "branding"),
2258
+ getSettingsGroup(deps, "email")
2259
+ ]);
2260
+ const companyDetails = mergeEmailLayoutCompanyDetails(branding, emailSettings);
2261
+ const salesTeamEmails = parseEmailRecipientsFromConfig(emailSettings.salesTeamEmails ?? emailSettings.salesTeamEmail);
2262
+ const cms = await deps.getCms();
2263
+ await queueOrderPlacedEmails(cms, {
2264
+ orderId,
2265
+ orderNumber: o.orderNumber,
2266
+ total: o.total,
2267
+ subtotal: o.subtotal,
2268
+ tax: o.tax,
2269
+ currency: o.currency,
2270
+ customerName,
2271
+ customerEmail,
2272
+ salesTeamEmails,
2273
+ companyDetails,
2274
+ lineItems,
2275
+ billingAddress: addrToRecord2(o.billingAddress),
2276
+ shippingAddress: addrToRecord2(o.shippingAddress)
2277
+ });
2278
+ } catch {
2279
+ }
2280
+ }
2281
+ __name(sendOrderPlacedEmailsAfterConfirmation, "sendOrderPlacedEmailsAfterConfirmation");
2282
+
2181
2283
  // src/lib/order-notification-trigger-seeds.ts
2182
2284
  var DEFAULT_ORDER_NOTIFICATION_TRIGGER_SEEDS = [
2183
2285
  {
@@ -2756,4 +2858,4 @@ var DEFAULT_ADMIN_NAV = [
2756
2858
  // src/index.ts
2757
2859
  console.log("\u{1F525}USING LOCAL CMS CORE \u{1F525}");
2758
2860
 
2759
- export { CaptchaService, DEFAULT_ADMIN_NAV, DEFAULT_ORDER_NOTIFICATION_TRIGGER_SEEDS, ERPSubmissionService, LlmService, ORDER_NOTIFICATION_TRIGGERS, allowRateLimit, analyticsPlugin, blogGeneratorPlugin, buildCaptchaPublicConfig, cachePlugin, captchaPlugin, cn, createDataSourceManager, enrichUserWithVendorContext, erpPlugin, fetchSeoBySlug, formatDate, formatDateOnly, formatDateTime, generateSlug, llmPlugin, loadPublicThemeSettings, localStoragePlugin, mergeSeoBySlug, parseHfInferenceEmbeddingBody, paymentPlugin, pgBossPlugin, rateLimitCheckoutPost, rateLimitKeyForApiRequest, rateLimitPublicApiIfNeeded, resolvePublicMetadata, s3StoragePlugin, seedDefaultAdmin, shouldRateLimitPublicWrite, smsPlugin, socialMediaPlugin, truncateText, validateSlug, withAdminRlsContext, withVendorRlsContext };
2861
+ export { CaptchaService, DEFAULT_ADMIN_NAV, DEFAULT_ORDER_NOTIFICATION_TRIGGER_SEEDS, ERPSubmissionService, LlmService, ORDER_NOTIFICATION_TRIGGERS, allowRateLimit, analyticsPlugin, blogGeneratorPlugin, buildCaptchaPublicConfig, cachePlugin, captchaPlugin, cn, createDataSourceManager, enrichUserWithVendorContext, erpPlugin, fetchSeoBySlug, formatDate, formatDateOnly, formatDateTime, generateSlug, llmPlugin, loadPublicThemeSettings, localStoragePlugin, mergeSeoBySlug, parseHfInferenceEmbeddingBody, paymentPlugin, pgBossPlugin, rateLimitCheckoutPost, rateLimitKeyForApiRequest, rateLimitPublicApiIfNeeded, resolvePublicMetadata, s3StoragePlugin, seedDefaultAdmin, sendOrderPlacedEmailsAfterConfirmation, shouldRateLimitPublicWrite, smsPlugin, socialMediaPlugin, truncateText, validateSlug, withAdminRlsContext, withVendorRlsContext };