@infuro/cms-core 1.0.59 → 1.0.60

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 (33) hide show
  1. package/dist/admin.cjs +442 -37
  2. package/dist/admin.js +443 -38
  3. package/dist/api.cjs +38 -38
  4. package/dist/api.js +5 -5
  5. package/dist/auth.cjs +51 -51
  6. package/dist/auth.js +3 -3
  7. package/dist/{chunk-3EOM4V2M.cjs → chunk-4U6DATGZ.cjs} +7 -7
  8. package/dist/{chunk-BNKZNLEX.js → chunk-6DBDJ4VD.js} +2 -2
  9. package/dist/{chunk-UQWZUZ5X.cjs → chunk-73WVHINE.cjs} +30 -6
  10. package/dist/{chunk-UCKN4BBY.cjs → chunk-77I3KS7V.cjs} +4 -1
  11. package/dist/{chunk-MCCA7WLQ.cjs → chunk-BSLNXKV2.cjs} +282 -128
  12. package/dist/{chunk-77NUXO6A.cjs → chunk-J7FMZK66.cjs} +10 -2
  13. package/dist/{chunk-BTUEUA5H.js → chunk-JAEUYYGA.js} +202 -48
  14. package/dist/{chunk-BC22I7C7.cjs → chunk-KM2I6AFP.cjs} +9 -9
  15. package/dist/{chunk-JIWUVQ6B.js → chunk-MVHDC3XF.js} +10 -2
  16. package/dist/{chunk-RK5ETF2I.js → chunk-NR44CK5E.js} +1 -1
  17. package/dist/{chunk-MXIWUFBP.js → chunk-O2642WVS.js} +28 -4
  18. package/dist/{chunk-HCIRL37O.js → chunk-T3HPSF7K.js} +4 -1
  19. package/dist/{chunk-HYW3MUXT.js → chunk-URN7GS23.js} +30 -16
  20. package/dist/{chunk-HXLC56ZK.cjs → chunk-YSYX4GUD.cjs} +32 -18
  21. package/dist/{emit-order-notification-trigger-HZQPPSFB.js → emit-order-notification-trigger-CZU3V2WE.js} +2 -2
  22. package/dist/{emit-order-notification-trigger-NR3VN6C6.cjs → emit-order-notification-trigger-TNEZOYEE.cjs} +4 -4
  23. package/dist/index.cjs +339 -301
  24. package/dist/index.d.cts +31 -0
  25. package/dist/index.d.ts +31 -0
  26. package/dist/index.js +54 -16
  27. package/dist/migrations/1782800000000-AddPaymentSuccessFailedRefundTriggers.ts +32 -0
  28. package/dist/migrations/1782900000000-AddEnableTurnstileToForms.ts +29 -0
  29. package/dist/{order-notification-dispatcher-2FCZFZUD.cjs → order-notification-dispatcher-KJVGLK5E.cjs} +5 -5
  30. package/dist/{order-notification-dispatcher-64WDCHHG.js → order-notification-dispatcher-ZSFKEYMP.js} +2 -2
  31. package/dist/{rbac-debug-db-6EMIVMGF.js → rbac-debug-db-5R6XFPSV.js} +1 -1
  32. package/dist/{rbac-debug-db-6PWTLBEL.cjs → rbac-debug-db-JKK2MCWF.cjs} +2 -2
  33. package/package.json +1 -1
package/dist/index.d.cts CHANGED
@@ -2636,6 +2636,7 @@ declare class Form {
2636
2636
  campaign: string | null;
2637
2637
  slug: string;
2638
2638
  published: boolean;
2639
+ enableTurnstile: boolean;
2639
2640
  createdAt: Date;
2640
2641
  updatedAt: Date;
2641
2642
  deletedAt: Date | null;
@@ -2833,6 +2834,9 @@ declare function resendOrderNotification(triggerKey: string, orderId: number, de
2833
2834
  declare const KNOWN_NOTIFICATION_TRIGGERS: {
2834
2835
  readonly ORDER_PLACED: "order_placed";
2835
2836
  readonly ORDER_CANCELLED: "order_cancelled";
2837
+ readonly PAYMENT_SUCCESS: "payment_success";
2838
+ readonly PAYMENT_FAILED: "payment_failed";
2839
+ readonly PAYMENT_REFUND_INITIATED: "payment_refund_initiated";
2836
2840
  };
2837
2841
  interface OrderTriggerPayload {
2838
2842
  orderId: number;
@@ -2864,6 +2868,24 @@ declare const DEFAULT_ORDER_NOTIFICATION_TRIGGER_SEEDS: readonly [{
2864
2868
  readonly description: "Fires when an order is cancelled (includes refund amount when applicable).";
2865
2869
  readonly category: "order";
2866
2870
  readonly sortOrder: 2;
2871
+ }, {
2872
+ readonly triggerKey: "payment_success";
2873
+ readonly label: "Payment success";
2874
+ readonly description: "Fires when order is placed and payment status is paid.";
2875
+ readonly category: "order";
2876
+ readonly sortOrder: 3;
2877
+ }, {
2878
+ readonly triggerKey: "payment_failed";
2879
+ readonly label: "Payment failed";
2880
+ readonly description: "Fires when payment status is pending, unpaid, or failed, or when order is cancelled without payment.";
2881
+ readonly category: "order";
2882
+ readonly sortOrder: 4;
2883
+ }, {
2884
+ readonly triggerKey: "payment_refund_initiated";
2885
+ readonly label: "Payment refund initiated";
2886
+ readonly description: "Fires when order is cancelled and its payment status is paid (refund initiated).";
2887
+ readonly category: "order";
2888
+ readonly sortOrder: 5;
2867
2889
  }];
2868
2890
 
2869
2891
  /** @deprecated Use DB catalog `order_notification_triggers`; kept for type hints. */
@@ -2873,6 +2895,15 @@ declare const ORDER_NOTIFICATION_TRIGGERS: readonly [{
2873
2895
  }, {
2874
2896
  readonly key: "order_cancelled";
2875
2897
  readonly label: "Order cancelled";
2898
+ }, {
2899
+ readonly key: "payment_success";
2900
+ readonly label: "Payment success";
2901
+ }, {
2902
+ readonly key: "payment_failed";
2903
+ readonly label: "Payment failed";
2904
+ }, {
2905
+ readonly key: "payment_refund_initiated";
2906
+ readonly label: "Payment refund initiated";
2876
2907
  }];
2877
2908
  type OrderNotificationTriggerKey = (typeof ORDER_NOTIFICATION_TRIGGERS)[number]['key'];
2878
2909
 
package/dist/index.d.ts CHANGED
@@ -2636,6 +2636,7 @@ declare class Form {
2636
2636
  campaign: string | null;
2637
2637
  slug: string;
2638
2638
  published: boolean;
2639
+ enableTurnstile: boolean;
2639
2640
  createdAt: Date;
2640
2641
  updatedAt: Date;
2641
2642
  deletedAt: Date | null;
@@ -2833,6 +2834,9 @@ declare function resendOrderNotification(triggerKey: string, orderId: number, de
2833
2834
  declare const KNOWN_NOTIFICATION_TRIGGERS: {
2834
2835
  readonly ORDER_PLACED: "order_placed";
2835
2836
  readonly ORDER_CANCELLED: "order_cancelled";
2837
+ readonly PAYMENT_SUCCESS: "payment_success";
2838
+ readonly PAYMENT_FAILED: "payment_failed";
2839
+ readonly PAYMENT_REFUND_INITIATED: "payment_refund_initiated";
2836
2840
  };
2837
2841
  interface OrderTriggerPayload {
2838
2842
  orderId: number;
@@ -2864,6 +2868,24 @@ declare const DEFAULT_ORDER_NOTIFICATION_TRIGGER_SEEDS: readonly [{
2864
2868
  readonly description: "Fires when an order is cancelled (includes refund amount when applicable).";
2865
2869
  readonly category: "order";
2866
2870
  readonly sortOrder: 2;
2871
+ }, {
2872
+ readonly triggerKey: "payment_success";
2873
+ readonly label: "Payment success";
2874
+ readonly description: "Fires when order is placed and payment status is paid.";
2875
+ readonly category: "order";
2876
+ readonly sortOrder: 3;
2877
+ }, {
2878
+ readonly triggerKey: "payment_failed";
2879
+ readonly label: "Payment failed";
2880
+ readonly description: "Fires when payment status is pending, unpaid, or failed, or when order is cancelled without payment.";
2881
+ readonly category: "order";
2882
+ readonly sortOrder: 4;
2883
+ }, {
2884
+ readonly triggerKey: "payment_refund_initiated";
2885
+ readonly label: "Payment refund initiated";
2886
+ readonly description: "Fires when order is cancelled and its payment status is paid (refund initiated).";
2887
+ readonly category: "order";
2888
+ readonly sortOrder: 5;
2867
2889
  }];
2868
2890
 
2869
2891
  /** @deprecated Use DB catalog `order_notification_triggers`; kept for type hints. */
@@ -2873,6 +2895,15 @@ declare const ORDER_NOTIFICATION_TRIGGERS: readonly [{
2873
2895
  }, {
2874
2896
  readonly key: "order_cancelled";
2875
2897
  readonly label: "Order cancelled";
2898
+ }, {
2899
+ readonly key: "payment_success";
2900
+ readonly label: "Payment success";
2901
+ }, {
2902
+ readonly key: "payment_failed";
2903
+ readonly label: "Payment failed";
2904
+ }, {
2905
+ readonly key: "payment_refund_initiated";
2906
+ readonly label: "Payment refund initiated";
2876
2907
  }];
2877
2908
  type OrderNotificationTriggerKey = (typeof ORDER_NOTIFICATION_TRIGGERS)[number]['key'];
2878
2909
 
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
- export { emitOrderNotificationTrigger, fireOrderNotificationTrigger } from './chunk-MXIWUFBP.js';
2
- import { checkMultiVendorEnabled, loadUserVendorContext, getPublicSettingsGroup, BlogGeneratorService } from './chunk-BTUEUA5H.js';
3
- export { Address, Attendee, Attribute, BLOG_GENERATOR_AGENT_NAME, BLOG_GENERATOR_DEFAULT_SYSTEM_INSTRUCTION, BLOG_GENERATOR_DEFAULT_VALIDATION_RULES, BLOG_GENERATOR_LLM_AGENT_SLUG, BLOG_GENERATOR_MARKDOWN_ARTICLE_SEPARATOR, BLOG_METADATA_ENRICHER_AGENT_NAME, BLOG_METADATA_ENRICHER_DEFAULT_SYSTEM_INSTRUCTION, BLOG_METADATA_ENRICHER_DEFAULT_VALIDATION_RULES, BLOG_METADATA_ENRICHER_LLM_AGENT_SLUG, Blog, BlogGeneratorService, Brand, CMS_ENTITY_MAP, Cart, CartItem, Category, ChatConversation, ChatMessage, Collection, Combo, ComboItem, Comment, Config, Contact, Currency, CurrencyExchange, Customer, Customer_Contacts, Discount, DiscountRules, Event, EventProduct, Form, FormField, FormSubmission, JobSchedule, JobScheduleRun, KnowledgeBaseChunk, KnowledgeBaseDocument, LlmAgent, LlmAgentKnowledgeDocument, Media, MessageTemplate, Order, OrderAddresses, OrderDiscounts, OrderItem, OrderNotificationBinding, OrderNotificationTrigger, OtpChallenge, Page, PasswordResetToken, Payment, Permission, Product, ProductAttribute, ProductCategory, ProductConfig, ProductVariant, RefundPolicy, RefundRequest, RssArticle, RssFeed, Seo, Tag, Tax, User, UserDeviceToken, UserGroup, Vendor, VendorCustomer, VendorRole, VendorRolePermission, VendorUser, VendorUserProfile, Wishlist, WishlistItem, ZIP_MIME_TYPES, applyApprovalStatusSideEffects, applyEventApprovalStatusSideEffects, applyRotatingVendorInvite, applyVendorCustomersContactFilter, applyVendorEventCreateApproval, applyVendorProductCreateApproval, assertCaptchaOk, assertContactAllowedForVendorOrder, assertEventApprovalUpdate, assertProductApprovalUpdate, autoExpireOrderIfPaymentTimeExceeded, buildBlogMetadataUserPrompt, buildCronFromSchedule, buildRssUserPromptFromFeeds, buildUserInviteLink, buildVendorInviteLink, calculateOrderRefundPreview, calculateRefundFromPolicy, checkAndIncrementDiscountUsage, checkEventsEnabled, checkMultiVendorEnabled, completeUserInviteAccept, consumeAppliedDiscountUsages, contactIsVendorCustomer, countDiscountOrdersForContact, 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-BTUEUA5H.js';
1
+ export { emitOrderNotificationTrigger, fireOrderNotificationTrigger } from './chunk-O2642WVS.js';
2
+ import { checkMultiVendorEnabled, loadUserVendorContext, getPublicSettingsGroup, BlogGeneratorService } from './chunk-JAEUYYGA.js';
3
+ export { Address, Attendee, Attribute, BLOG_GENERATOR_AGENT_NAME, BLOG_GENERATOR_DEFAULT_SYSTEM_INSTRUCTION, BLOG_GENERATOR_DEFAULT_VALIDATION_RULES, BLOG_GENERATOR_LLM_AGENT_SLUG, BLOG_GENERATOR_MARKDOWN_ARTICLE_SEPARATOR, BLOG_METADATA_ENRICHER_AGENT_NAME, BLOG_METADATA_ENRICHER_DEFAULT_SYSTEM_INSTRUCTION, BLOG_METADATA_ENRICHER_DEFAULT_VALIDATION_RULES, BLOG_METADATA_ENRICHER_LLM_AGENT_SLUG, Blog, BlogGeneratorService, Brand, CMS_ENTITY_MAP, Cart, CartItem, Category, ChatConversation, ChatMessage, Collection, Combo, ComboItem, Comment, Config, Contact, Currency, CurrencyExchange, Customer, Customer_Contacts, Discount, DiscountRules, Event, EventProduct, Form, FormField, FormSubmission, JobSchedule, JobScheduleRun, KnowledgeBaseChunk, KnowledgeBaseDocument, LlmAgent, LlmAgentKnowledgeDocument, Media, MessageTemplate, Order, OrderAddresses, OrderDiscounts, OrderItem, OrderNotificationBinding, OrderNotificationTrigger, OtpChallenge, Page, PasswordResetToken, Payment, Permission, Product, ProductAttribute, ProductCategory, ProductConfig, ProductVariant, RefundPolicy, RefundRequest, RssArticle, RssFeed, Seo, Tag, Tax, User, UserDeviceToken, UserGroup, Vendor, VendorCustomer, VendorRole, VendorRolePermission, VendorUser, VendorUserProfile, Wishlist, WishlistItem, ZIP_MIME_TYPES, applyApprovalStatusSideEffects, applyEventApprovalStatusSideEffects, applyRotatingVendorInvite, applyVendorCustomersContactFilter, applyVendorEventCreateApproval, applyVendorProductCreateApproval, assertCaptchaOk, assertContactAllowedForVendorOrder, assertEventApprovalUpdate, assertProductApprovalUpdate, autoExpireOrderIfPaymentTimeExceeded, buildBlogMetadataUserPrompt, buildCronFromSchedule, buildRssUserPromptFromFeeds, buildUserInviteLink, buildVendorInviteLink, calculateOrderRefundPreview, calculateRefundFromPolicy, checkAndIncrementDiscountUsage, checkEventsEnabled, checkMultiVendorEnabled, completeUserInviteAccept, consumeAppliedDiscountUsages, contactIsVendorCustomer, countDiscountOrdersForContact, 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-JAEUYYGA.js';
4
4
  import { PgBossService } from './chunk-GO7PPYNU.js';
5
5
  export { JOB_RUNNER_QUEUE, PgBossService } from './chunk-GO7PPYNU.js';
6
6
  export { deductInventoryForConfirmedOrder, mergeInventoryLines, orderInventorySnapshotFromRow, orderStatusHoldsStock, reconcileOrderInventoryBetweenSnapshots, restoreInventoryForCancelledOrder, validateInventoryForConfirmedOrderLines, validateInventoryForOrderBecomingConfirmed } from './chunk-3K5AIEIZ.js';
7
- import { parseEmailRecipientsFromConfig } from './chunk-HYW3MUXT.js';
8
- export { EmailService, buildEventOrderTemplateVariables, emailPlugin, emailTemplates, initWhatsappTriggerDispatcher, joinRecipientsForSend, parseEmailRecipientsFromConfig, queueWhatsApp, registerWhatsAppQueueProcessor, renderEmail, renderLayout, resendOrderNotification, serializeEmailRecipients } from './chunk-HYW3MUXT.js';
9
- export { KNOWN_NOTIFICATION_TRIGGERS, notificationTriggerEmitter } from './chunk-HCIRL37O.js';
7
+ import { parseEmailRecipientsFromConfig } from './chunk-URN7GS23.js';
8
+ export { EmailService, buildEventOrderTemplateVariables, emailPlugin, emailTemplates, initWhatsappTriggerDispatcher, joinRecipientsForSend, parseEmailRecipientsFromConfig, queueWhatsApp, registerWhatsAppQueueProcessor, renderEmail, renderLayout, resendOrderNotification, serializeEmailRecipients } from './chunk-URN7GS23.js';
9
+ export { KNOWN_NOTIFICATION_TRIGGERS, notificationTriggerEmitter } from './chunk-T3HPSF7K.js';
10
10
  import './chunk-JXF23MPG.js';
11
11
  import { queueOrderPlacedEmails } from './chunk-L3525VXI.js';
12
12
  export { queueEmail, queueOrderPlacedEmails, queueVendorOnboardEmails, registerEmailQueueProcessor } from './chunk-L3525VXI.js';
@@ -16,11 +16,11 @@ import './chunk-JC6DLWTE.js';
16
16
  import './chunk-MQBT33IV.js';
17
17
  import './chunk-CRFV5WJK.js';
18
18
  export { EVENT_ORDER_MESSAGE_TEMPLATE_DEFAULTS, EVENT_ORDER_TEMPLATE_KEY, EVENT_ORDER_TEMPLATE_VARIABLES, resolveEventOrderTemplate } from './chunk-AYERBA7I.js';
19
- export { AUTH_PROVIDERS_SETTINGS_GROUP, buildNextAuthOptions, buildStorefrontNextAuthOptions, createCustomerUserFromGoogleOAuth, getNextAuthOptions, getStorefrontNextAuthOptions, googleOAuthRedirectUri, isGoogleAuthPubliclyEnabled, resolveGoogleAuthConfig, seedAdministratorPermissions } from './chunk-BNKZNLEX.js';
20
- 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';
19
+ export { AUTH_PROVIDERS_SETTINGS_GROUP, buildNextAuthOptions, buildStorefrontNextAuthOptions, createCustomerUserFromGoogleOAuth, getNextAuthOptions, getStorefrontNextAuthOptions, googleOAuthRedirectUri, isGoogleAuthPubliclyEnabled, resolveGoogleAuthConfig, seedAdministratorPermissions } from './chunk-6DBDJ4VD.js';
20
+ export { OPEN_ENDPOINTS, PERMISSION_REQUIRED_ENDPOINTS, RBAC_ADMIN_ONLY_ENTITIES, canManageRoles, createAuthHelpers, createCmsAuthBundle, customerPhoneForEmail, customerPhoneForUser, ensureCustomerForUser, ensureCustomerRecord, getRequiredPermission, isOpenEndpoint, isPublicMethod, isSyntheticCustomerPhone, linkUnclaimedContactToUser, normalizeCustomerPhone, sessionHasEntityAccess } from './chunk-NR44CK5E.js';
21
21
  export { activeUniqueValueExists, retireSoftDeletedUniqueValue } from './chunk-DBPSJYLZ.js';
22
- import { isSuperAdmin, isVendorGroupName } from './chunk-JIWUVQ6B.js';
23
- 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
+ import { isSuperAdmin, isVendorGroupName } from './chunk-MVHDC3XF.js';
23
+ 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';
24
24
  export { createCmsMiddleware, defaultPublicApiMethods, isAuthDebugClientEnabled, isAuthDebugEnabled, logAuth, logAuthClient, nextAuthCookieDebugInfo, summarizeSessionUserForLog } from './chunk-WUQAOTHA.js';
25
25
  export { queueErpPaidOrderForOrderId } from './chunk-TDV6EJHV.js';
26
26
  import { erpSafeWebhookUrl, logErp, warnErp, errorErp } from './chunk-SYBOCAWB.js';
@@ -2491,6 +2491,27 @@ var DEFAULT_ORDER_NOTIFICATION_TRIGGER_SEEDS = [
2491
2491
  description: "Fires when an order is cancelled (includes refund amount when applicable).",
2492
2492
  category: "order",
2493
2493
  sortOrder: 2
2494
+ },
2495
+ {
2496
+ triggerKey: "payment_success",
2497
+ label: "Payment success",
2498
+ description: "Fires when order is placed and payment status is paid.",
2499
+ category: "order",
2500
+ sortOrder: 3
2501
+ },
2502
+ {
2503
+ triggerKey: "payment_failed",
2504
+ label: "Payment failed",
2505
+ description: "Fires when payment status is pending, unpaid, or failed, or when order is cancelled without payment.",
2506
+ category: "order",
2507
+ sortOrder: 4
2508
+ },
2509
+ {
2510
+ triggerKey: "payment_refund_initiated",
2511
+ label: "Payment refund initiated",
2512
+ description: "Fires when order is cancelled and its payment status is paid (refund initiated).",
2513
+ category: "order",
2514
+ sortOrder: 5
2494
2515
  }
2495
2516
  ];
2496
2517
 
@@ -2503,6 +2524,18 @@ var ORDER_NOTIFICATION_TRIGGERS = [
2503
2524
  {
2504
2525
  key: "order_cancelled",
2505
2526
  label: "Order cancelled"
2527
+ },
2528
+ {
2529
+ key: "payment_success",
2530
+ label: "Payment success"
2531
+ },
2532
+ {
2533
+ key: "payment_failed",
2534
+ label: "Payment failed"
2535
+ },
2536
+ {
2537
+ key: "payment_refund_initiated",
2538
+ label: "Payment refund initiated"
2506
2539
  }
2507
2540
  ];
2508
2541
  function disablePgNative() {
@@ -2749,13 +2782,18 @@ __name(withAdminRlsContext, "withAdminRlsContext");
2749
2782
 
2750
2783
  // src/plugins/captcha/captcha-service.ts
2751
2784
  function resolveKeys(config) {
2752
- const turnstile = config.TURNSTILE_SITE_KEY?.trim() && config.TURNSTILE_SECRET_KEY?.trim() ? {
2753
- site: config.TURNSTILE_SITE_KEY.trim(),
2754
- secret: config.TURNSTILE_SECRET_KEY.trim()
2785
+ const isTurnstileDisabled = config.enabled === "false" || config.turnstile_enabled === "false";
2786
+ const turnstileSite = (config.TURNSTILE_SITE_KEY ?? config.siteKey ?? config.site_key ?? "").trim();
2787
+ const turnstileSecret = (config.TURNSTILE_SECRET_KEY ?? config.secretKey ?? config.secret_key ?? "").trim();
2788
+ const turnstile = !isTurnstileDisabled && turnstileSite && turnstileSecret ? {
2789
+ site: turnstileSite,
2790
+ secret: turnstileSecret
2755
2791
  } : null;
2756
- const recaptcha = config.RECAPTCHA_SITE_KEY?.trim() && config.RECAPTCHA_SECRET_KEY?.trim() ? {
2757
- site: config.RECAPTCHA_SITE_KEY.trim(),
2758
- secret: config.RECAPTCHA_SECRET_KEY.trim()
2792
+ const recaptchaSite = (config.RECAPTCHA_SITE_KEY ?? config.recaptchaSiteKey ?? "").trim();
2793
+ const recaptchaSecret = (config.RECAPTCHA_SECRET_KEY ?? config.recaptchaSecretKey ?? "").trim();
2794
+ const recaptcha = recaptchaSite && recaptchaSecret ? {
2795
+ site: recaptchaSite,
2796
+ secret: recaptchaSecret
2759
2797
  } : null;
2760
2798
  const raw = config.CAPTCHA_PROVIDER?.trim().toLowerCase();
2761
2799
  let envDefaultProvider = null;
@@ -0,0 +1,32 @@
1
+ import type { MigrationInterface, QueryRunner } from 'typeorm';
2
+
3
+ /** Add 3 new order notification triggers: payment_success, payment_failed, and payment_refund_initiated. */
4
+ export class AddPaymentSuccessFailedRefundTriggers1782800000000 implements MigrationInterface {
5
+ name = 'AddPaymentSuccessFailedRefundTriggers1782800000000';
6
+
7
+ public async up(queryRunner: QueryRunner): Promise<void> {
8
+ await queryRunner.query(`
9
+ INSERT INTO "order_notification_triggers" ("triggerKey", "label", "description", "category", "sortOrder")
10
+ VALUES
11
+ ('payment_success', 'Payment success', 'Fires when order is placed and payment status is paid.', 'order', 3),
12
+ ('payment_failed', 'Payment failed', 'Fires when payment status is pending, unpaid, or failed, or when order is cancelled without payment.', 'order', 4),
13
+ ('payment_refund_initiated', 'Payment refund initiated', 'Fires when order is cancelled and its payment status is paid (refund initiated).', 'order', 5)
14
+ ON CONFLICT ("triggerKey") DO UPDATE SET
15
+ "label" = EXCLUDED."label",
16
+ "description" = EXCLUDED."description",
17
+ "sortOrder" = EXCLUDED."sortOrder",
18
+ "updatedAt" = now();
19
+ `);
20
+ }
21
+
22
+ public async down(queryRunner: QueryRunner): Promise<void> {
23
+ await queryRunner.query(`
24
+ DELETE FROM "order_notification_bindings"
25
+ WHERE "triggerKey" IN ('payment_success', 'payment_failed', 'payment_refund_initiated');
26
+ `);
27
+ await queryRunner.query(`
28
+ DELETE FROM "order_notification_triggers"
29
+ WHERE "triggerKey" IN ('payment_success', 'payment_failed', 'payment_refund_initiated');
30
+ `);
31
+ }
32
+ }
@@ -0,0 +1,29 @@
1
+ import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm';
2
+
3
+ export class AddEnableTurnstileToForms1782800000000 implements MigrationInterface {
4
+ public async up(queryRunner: QueryRunner): Promise<void> {
5
+ const hasTable = await queryRunner.hasTable('forms');
6
+ if (!hasTable) return;
7
+ const hasCol = await queryRunner.hasColumn('forms', 'enable_turnstile');
8
+ if (!hasCol) {
9
+ await queryRunner.addColumn(
10
+ 'forms',
11
+ new TableColumn({
12
+ name: 'enable_turnstile',
13
+ type: 'boolean',
14
+ default: false,
15
+ isNullable: true,
16
+ })
17
+ );
18
+ }
19
+ }
20
+
21
+ public async down(queryRunner: QueryRunner): Promise<void> {
22
+ const hasTable = await queryRunner.hasTable('forms');
23
+ if (!hasTable) return;
24
+ const hasCol = await queryRunner.hasColumn('forms', 'enable_turnstile');
25
+ if (hasCol) {
26
+ await queryRunner.dropColumn('forms', 'enable_turnstile');
27
+ }
28
+ }
29
+ }
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkHXLC56ZK_cjs = require('./chunk-HXLC56ZK.cjs');
4
- require('./chunk-UCKN4BBY.cjs');
3
+ var chunkYSYX4GUD_cjs = require('./chunk-YSYX4GUD.cjs');
4
+ require('./chunk-77I3KS7V.cjs');
5
5
  require('./chunk-V25RDUOU.cjs');
6
6
  require('./chunk-BXYZDMTZ.cjs');
7
7
  require('./chunk-UPLVMVRX.cjs');
@@ -12,13 +12,13 @@ require('./chunk-USNT2KNT.cjs');
12
12
 
13
13
  Object.defineProperty(exports, "getSettingsGroup", {
14
14
  enumerable: true,
15
- get: function () { return chunkHXLC56ZK_cjs.getSettingsGroup; }
15
+ get: function () { return chunkYSYX4GUD_cjs.getSettingsGroup; }
16
16
  });
17
17
  Object.defineProperty(exports, "initWhatsappTriggerDispatcher", {
18
18
  enumerable: true,
19
- get: function () { return chunkHXLC56ZK_cjs.initWhatsappTriggerDispatcher; }
19
+ get: function () { return chunkYSYX4GUD_cjs.initWhatsappTriggerDispatcher; }
20
20
  });
21
21
  Object.defineProperty(exports, "resendOrderNotification", {
22
22
  enumerable: true,
23
- get: function () { return chunkHXLC56ZK_cjs.resendOrderNotification; }
23
+ get: function () { return chunkYSYX4GUD_cjs.resendOrderNotification; }
24
24
  });
@@ -1,5 +1,5 @@
1
- export { getSettingsGroup, initWhatsappTriggerDispatcher, resendOrderNotification } from './chunk-HYW3MUXT.js';
2
- import './chunk-HCIRL37O.js';
1
+ export { getSettingsGroup, initWhatsappTriggerDispatcher, resendOrderNotification } from './chunk-URN7GS23.js';
2
+ import './chunk-T3HPSF7K.js';
3
3
  import './chunk-L3525VXI.js';
4
4
  import './chunk-2KUCQVAQ.js';
5
5
  import './chunk-JC6DLWTE.js';
@@ -1,4 +1,4 @@
1
- import { summarizeEntityPerms, permissionRowsToRecord } from './chunk-JIWUVQ6B.js';
1
+ import { summarizeEntityPerms, permissionRowsToRecord } from './chunk-MVHDC3XF.js';
2
2
  import { __name } from './chunk-SHUYVCID.js';
3
3
 
4
4
  // src/auth/rbac-debug-db.ts
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunk77NUXO6A_cjs = require('./chunk-77NUXO6A.cjs');
3
+ var chunkJ7FMZK66_cjs = require('./chunk-J7FMZK66.cjs');
4
4
  var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
5
5
 
6
6
  // src/auth/rbac-debug-db.ts
@@ -27,7 +27,7 @@ async function loadDbPermissionsForUser(dataSource, userId) {
27
27
  return {
28
28
  groupId,
29
29
  groupName,
30
- dbEntityPerms: chunk77NUXO6A_cjs.summarizeEntityPerms(chunk77NUXO6A_cjs.permissionRowsToRecord(permRows))
30
+ dbEntityPerms: chunkJ7FMZK66_cjs.summarizeEntityPerms(chunkJ7FMZK66_cjs.permissionRowsToRecord(permRows))
31
31
  };
32
32
  }
33
33
  chunkUSNT2KNT_cjs.__name(loadDbPermissionsForUser, "loadDbPermissionsForUser");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infuro/cms-core",
3
- "version": "1.0.59",
3
+ "version": "1.0.60",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",