@open-mercato/core 0.4.8-develop-28cee031d6 → 0.4.8-develop-15259be22b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agentic/standalone-guide.md +235 -0
- package/dist/generated/entities/customer_role/index.js +27 -0
- package/dist/generated/entities/customer_role/index.js.map +7 -0
- package/dist/generated/entities/customer_role_acl/index.js +19 -0
- package/dist/generated/entities/customer_role_acl/index.js.map +7 -0
- package/dist/generated/entities/customer_user/index.js +37 -0
- package/dist/generated/entities/customer_user/index.js.map +7 -0
- package/dist/generated/entities/customer_user_acl/index.js +19 -0
- package/dist/generated/entities/customer_user_acl/index.js.map +7 -0
- package/dist/generated/entities/customer_user_email_verification/index.js +17 -0
- package/dist/generated/entities/customer_user_email_verification/index.js.map +7 -0
- package/dist/generated/entities/customer_user_invitation/index.js +33 -0
- package/dist/generated/entities/customer_user_invitation/index.js.map +7 -0
- package/dist/generated/entities/customer_user_password_reset/index.js +15 -0
- package/dist/generated/entities/customer_user_password_reset/index.js.map +7 -0
- package/dist/generated/entities/customer_user_role/index.js +13 -0
- package/dist/generated/entities/customer_user_role/index.js.map +7 -0
- package/dist/generated/entities/customer_user_session/index.js +21 -0
- package/dist/generated/entities/customer_user_session/index.js.map +7 -0
- package/dist/generated/entities/organization/index.js +2 -0
- package/dist/generated/entities/organization/index.js.map +2 -2
- package/dist/generated/entities.ids.generated.js +14 -1
- package/dist/generated/entities.ids.generated.js.map +2 -2
- package/dist/generated/entity-fields-registry.js +18 -0
- package/dist/generated/entity-fields-registry.js.map +2 -2
- package/dist/modules/auth/services/rbacService.js +3 -9
- package/dist/modules/auth/services/rbacService.js.map +2 -2
- package/dist/modules/customer_accounts/acl.js +12 -0
- package/dist/modules/customer_accounts/acl.js.map +7 -0
- package/dist/modules/customer_accounts/api/admin/roles/[id]/acl.js +87 -0
- package/dist/modules/customer_accounts/api/admin/roles/[id]/acl.js.map +7 -0
- package/dist/modules/customer_accounts/api/admin/roles/[id].js +216 -0
- package/dist/modules/customer_accounts/api/admin/roles/[id].js.map +7 -0
- package/dist/modules/customer_accounts/api/admin/roles.js +189 -0
- package/dist/modules/customer_accounts/api/admin/roles.js.map +7 -0
- package/dist/modules/customer_accounts/api/admin/users/[id]/reset-password.js +69 -0
- package/dist/modules/customer_accounts/api/admin/users/[id]/reset-password.js.map +7 -0
- package/dist/modules/customer_accounts/api/admin/users/[id]/verify-email.js +64 -0
- package/dist/modules/customer_accounts/api/admin/users/[id]/verify-email.js.map +7 -0
- package/dist/modules/customer_accounts/api/admin/users/[id].js +253 -0
- package/dist/modules/customer_accounts/api/admin/users/[id].js.map +7 -0
- package/dist/modules/customer_accounts/api/admin/users-invite.js +78 -0
- package/dist/modules/customer_accounts/api/admin/users-invite.js.map +7 -0
- package/dist/modules/customer_accounts/api/admin/users.js +251 -0
- package/dist/modules/customer_accounts/api/admin/users.js.map +7 -0
- package/dist/modules/customer_accounts/api/email/verify.js +59 -0
- package/dist/modules/customer_accounts/api/email/verify.js.map +7 -0
- package/dist/modules/customer_accounts/api/interceptors.js +5 -0
- package/dist/modules/customer_accounts/api/interceptors.js.map +7 -0
- package/dist/modules/customer_accounts/api/invitations/accept.js +114 -0
- package/dist/modules/customer_accounts/api/invitations/accept.js.map +7 -0
- package/dist/modules/customer_accounts/api/login.js +143 -0
- package/dist/modules/customer_accounts/api/login.js.map +7 -0
- package/dist/modules/customer_accounts/api/magic-link/request.js +78 -0
- package/dist/modules/customer_accounts/api/magic-link/request.js.map +7 -0
- package/dist/modules/customer_accounts/api/magic-link/verify.js +114 -0
- package/dist/modules/customer_accounts/api/magic-link/verify.js.map +7 -0
- package/dist/modules/customer_accounts/api/password/reset-confirm.js +59 -0
- package/dist/modules/customer_accounts/api/password/reset-confirm.js.map +7 -0
- package/dist/modules/customer_accounts/api/password/reset-request.js +77 -0
- package/dist/modules/customer_accounts/api/password/reset-request.js.map +7 -0
- package/dist/modules/customer_accounts/api/portal/events/stream.js +163 -0
- package/dist/modules/customer_accounts/api/portal/events/stream.js.map +7 -0
- package/dist/modules/customer_accounts/api/portal/feature-check.js +57 -0
- package/dist/modules/customer_accounts/api/portal/feature-check.js.map +7 -0
- package/dist/modules/customer_accounts/api/portal/logout.js +64 -0
- package/dist/modules/customer_accounts/api/portal/logout.js.map +7 -0
- package/dist/modules/customer_accounts/api/portal/notifications/[id]/dismiss.js +49 -0
- package/dist/modules/customer_accounts/api/portal/notifications/[id]/dismiss.js.map +7 -0
- package/dist/modules/customer_accounts/api/portal/notifications/[id]/read.js +49 -0
- package/dist/modules/customer_accounts/api/portal/notifications/[id]/read.js.map +7 -0
- package/dist/modules/customer_accounts/api/portal/notifications/mark-all-read.js +46 -0
- package/dist/modules/customer_accounts/api/portal/notifications/mark-all-read.js.map +7 -0
- package/dist/modules/customer_accounts/api/portal/notifications/unread-count.js +42 -0
- package/dist/modules/customer_accounts/api/portal/notifications/unread-count.js.map +7 -0
- package/dist/modules/customer_accounts/api/portal/notifications.js +105 -0
- package/dist/modules/customer_accounts/api/portal/notifications.js.map +7 -0
- package/dist/modules/customer_accounts/api/portal/password-change.js +57 -0
- package/dist/modules/customer_accounts/api/portal/password-change.js.map +7 -0
- package/dist/modules/customer_accounts/api/portal/profile.js +135 -0
- package/dist/modules/customer_accounts/api/portal/profile.js.map +7 -0
- package/dist/modules/customer_accounts/api/portal/sessions/[id].js +62 -0
- package/dist/modules/customer_accounts/api/portal/sessions/[id].js.map +7 -0
- package/dist/modules/customer_accounts/api/portal/sessions-refresh.js +75 -0
- package/dist/modules/customer_accounts/api/portal/sessions-refresh.js.map +7 -0
- package/dist/modules/customer_accounts/api/portal/sessions.js +77 -0
- package/dist/modules/customer_accounts/api/portal/sessions.js.map +7 -0
- package/dist/modules/customer_accounts/api/portal/users/[id]/roles.js +90 -0
- package/dist/modules/customer_accounts/api/portal/users/[id]/roles.js.map +7 -0
- package/dist/modules/customer_accounts/api/portal/users/[id].js +71 -0
- package/dist/modules/customer_accounts/api/portal/users/[id].js.map +7 -0
- package/dist/modules/customer_accounts/api/portal/users-invite.js +92 -0
- package/dist/modules/customer_accounts/api/portal/users-invite.js.map +7 -0
- package/dist/modules/customer_accounts/api/portal/users.js +79 -0
- package/dist/modules/customer_accounts/api/portal/users.js.map +7 -0
- package/dist/modules/customer_accounts/api/signup.js +121 -0
- package/dist/modules/customer_accounts/api/signup.js.map +7 -0
- package/dist/modules/customer_accounts/backend/customer_accounts/[id]/page.js +491 -0
- package/dist/modules/customer_accounts/backend/customer_accounts/[id]/page.js.map +7 -0
- package/dist/modules/customer_accounts/backend/customer_accounts/[id]/page.meta.js +15 -0
- package/dist/modules/customer_accounts/backend/customer_accounts/[id]/page.meta.js.map +7 -0
- package/dist/modules/customer_accounts/backend/customer_accounts/roles/[id]/page.js +343 -0
- package/dist/modules/customer_accounts/backend/customer_accounts/roles/[id]/page.js.map +7 -0
- package/dist/modules/customer_accounts/backend/customer_accounts/roles/[id]/page.meta.js +16 -0
- package/dist/modules/customer_accounts/backend/customer_accounts/roles/[id]/page.meta.js.map +7 -0
- package/dist/modules/customer_accounts/backend/customer_accounts/roles/create/page.js +180 -0
- package/dist/modules/customer_accounts/backend/customer_accounts/roles/create/page.js.map +7 -0
- package/dist/modules/customer_accounts/backend/customer_accounts/roles/create/page.meta.js +16 -0
- package/dist/modules/customer_accounts/backend/customer_accounts/roles/create/page.meta.js.map +7 -0
- package/dist/modules/customer_accounts/backend/customer_accounts/roles/page.js +176 -0
- package/dist/modules/customer_accounts/backend/customer_accounts/roles/page.js.map +7 -0
- package/dist/modules/customer_accounts/backend/customer_accounts/roles/page.meta.js +33 -0
- package/dist/modules/customer_accounts/backend/customer_accounts/roles/page.meta.js.map +7 -0
- package/dist/modules/customer_accounts/backend/page.js +466 -0
- package/dist/modules/customer_accounts/backend/page.js.map +7 -0
- package/dist/modules/customer_accounts/backend/page.meta.js +35 -0
- package/dist/modules/customer_accounts/backend/page.meta.js.map +7 -0
- package/dist/modules/customer_accounts/ce.js +26 -0
- package/dist/modules/customer_accounts/ce.js.map +7 -0
- package/dist/modules/customer_accounts/data/enrichers.js +85 -0
- package/dist/modules/customer_accounts/data/enrichers.js.map +7 -0
- package/dist/modules/customer_accounts/data/entities.js +377 -0
- package/dist/modules/customer_accounts/data/entities.js.map +7 -0
- package/dist/modules/customer_accounts/data/extensions.js +8 -0
- package/dist/modules/customer_accounts/data/extensions.js.map +7 -0
- package/dist/modules/customer_accounts/data/validators.js +111 -0
- package/dist/modules/customer_accounts/data/validators.js.map +7 -0
- package/dist/modules/customer_accounts/di.js +17 -0
- package/dist/modules/customer_accounts/di.js.map +7 -0
- package/dist/modules/customer_accounts/events.js +28 -0
- package/dist/modules/customer_accounts/events.js.map +7 -0
- package/dist/modules/customer_accounts/index.js +15 -0
- package/dist/modules/customer_accounts/index.js.map +7 -0
- package/dist/modules/customer_accounts/lib/customerAuth.js +71 -0
- package/dist/modules/customer_accounts/lib/customerAuth.js.map +7 -0
- package/dist/modules/customer_accounts/lib/customerAuthServer.js +29 -0
- package/dist/modules/customer_accounts/lib/customerAuthServer.js.map +7 -0
- package/dist/modules/customer_accounts/lib/rateLimiter.js +63 -0
- package/dist/modules/customer_accounts/lib/rateLimiter.js.map +7 -0
- package/dist/modules/customer_accounts/lib/tokenGenerator.js +12 -0
- package/dist/modules/customer_accounts/lib/tokenGenerator.js.map +7 -0
- package/dist/modules/customer_accounts/migrations/Migration20260313222043.js +49 -0
- package/dist/modules/customer_accounts/migrations/Migration20260313222043.js.map +7 -0
- package/dist/modules/customer_accounts/notifications.client.js +47 -0
- package/dist/modules/customer_accounts/notifications.client.js.map +7 -0
- package/dist/modules/customer_accounts/notifications.js +46 -0
- package/dist/modules/customer_accounts/notifications.js.map +7 -0
- package/dist/modules/customer_accounts/search.js +120 -0
- package/dist/modules/customer_accounts/search.js.map +7 -0
- package/dist/modules/customer_accounts/services/customerInvitationService.js +87 -0
- package/dist/modules/customer_accounts/services/customerInvitationService.js.map +7 -0
- package/dist/modules/customer_accounts/services/customerRbacService.js +109 -0
- package/dist/modules/customer_accounts/services/customerRbacService.js.map +7 -0
- package/dist/modules/customer_accounts/services/customerSessionService.js +75 -0
- package/dist/modules/customer_accounts/services/customerSessionService.js.map +7 -0
- package/dist/modules/customer_accounts/services/customerTokenService.js +91 -0
- package/dist/modules/customer_accounts/services/customerTokenService.js.map +7 -0
- package/dist/modules/customer_accounts/services/customerUserService.js +92 -0
- package/dist/modules/customer_accounts/services/customerUserService.js.map +7 -0
- package/dist/modules/customer_accounts/setup.js +179 -0
- package/dist/modules/customer_accounts/setup.js.map +7 -0
- package/dist/modules/customer_accounts/subscribers/autoLinkCrm.js +54 -0
- package/dist/modules/customer_accounts/subscribers/autoLinkCrm.js.map +7 -0
- package/dist/modules/customer_accounts/subscribers/autoLinkCrmReverse.js +68 -0
- package/dist/modules/customer_accounts/subscribers/autoLinkCrmReverse.js.map +7 -0
- package/dist/modules/customer_accounts/subscribers/notifyStaffOnSignup.js +29 -0
- package/dist/modules/customer_accounts/subscribers/notifyStaffOnSignup.js.map +7 -0
- package/dist/modules/customer_accounts/translations.js +9 -0
- package/dist/modules/customer_accounts/translations.js.map +7 -0
- package/dist/modules/customer_accounts/widgets/injection/account-status/widget.client.js +63 -0
- package/dist/modules/customer_accounts/widgets/injection/account-status/widget.client.js.map +7 -0
- package/dist/modules/customer_accounts/widgets/injection/account-status/widget.js +17 -0
- package/dist/modules/customer_accounts/widgets/injection/account-status/widget.js.map +7 -0
- package/dist/modules/customer_accounts/widgets/injection/company-users/widget.client.js +55 -0
- package/dist/modules/customer_accounts/widgets/injection/company-users/widget.client.js.map +7 -0
- package/dist/modules/customer_accounts/widgets/injection/company-users/widget.js +17 -0
- package/dist/modules/customer_accounts/widgets/injection/company-users/widget.js.map +7 -0
- package/dist/modules/customer_accounts/widgets/injection-table.js +26 -0
- package/dist/modules/customer_accounts/widgets/injection-table.js.map +7 -0
- package/dist/modules/customer_accounts/workers/cleanupExpiredSessions.js +23 -0
- package/dist/modules/customer_accounts/workers/cleanupExpiredSessions.js.map +7 -0
- package/dist/modules/customer_accounts/workers/cleanupExpiredTokens.js +38 -0
- package/dist/modules/customer_accounts/workers/cleanupExpiredTokens.js.map +7 -0
- package/dist/modules/customers/components/AddressTiles.js +1 -1
- package/dist/modules/customers/components/AddressTiles.js.map +2 -2
- package/dist/modules/directory/api/get/organizations/lookup.js +83 -0
- package/dist/modules/directory/api/get/organizations/lookup.js.map +7 -0
- package/dist/modules/directory/commands/organizations.js +32 -1
- package/dist/modules/directory/commands/organizations.js.map +2 -2
- package/dist/modules/directory/data/entities.js +6 -2
- package/dist/modules/directory/data/entities.js.map +2 -2
- package/dist/modules/directory/data/validators.js +3 -0
- package/dist/modules/directory/data/validators.js.map +2 -2
- package/dist/modules/directory/migrations/Migration20260314143323.js +15 -0
- package/dist/modules/directory/migrations/Migration20260314143323.js.map +7 -0
- package/dist/modules/directory/setup.js +36 -0
- package/dist/modules/directory/setup.js.map +2 -2
- package/dist/modules/payment_gateways/migrations/Migration20260313222043.js +15 -0
- package/dist/modules/payment_gateways/migrations/Migration20260313222043.js.map +7 -0
- package/dist/modules/portal/frontend/[orgSlug]/portal/dashboard/page.js +131 -0
- package/dist/modules/portal/frontend/[orgSlug]/portal/dashboard/page.js.map +7 -0
- package/dist/modules/portal/frontend/[orgSlug]/portal/login/page.js +96 -0
- package/dist/modules/portal/frontend/[orgSlug]/portal/login/page.js.map +7 -0
- package/dist/modules/portal/frontend/[orgSlug]/portal/page.js +94 -0
- package/dist/modules/portal/frontend/[orgSlug]/portal/page.js.map +7 -0
- package/dist/modules/portal/frontend/[orgSlug]/portal/profile/page.js +89 -0
- package/dist/modules/portal/frontend/[orgSlug]/portal/profile/page.js.map +7 -0
- package/dist/modules/portal/frontend/[orgSlug]/portal/signup/page.js +104 -0
- package/dist/modules/portal/frontend/[orgSlug]/portal/signup/page.js.map +7 -0
- package/dist/modules/portal/index.js +11 -0
- package/dist/modules/portal/index.js.map +7 -0
- package/dist/modules/portal/setup.js +23 -0
- package/dist/modules/portal/setup.js.map +7 -0
- package/generated/entities/customer_role/index.ts +12 -0
- package/generated/entities/customer_role_acl/index.ts +8 -0
- package/generated/entities/customer_user/index.ts +17 -0
- package/generated/entities/customer_user_acl/index.ts +8 -0
- package/generated/entities/customer_user_email_verification/index.ts +7 -0
- package/generated/entities/customer_user_invitation/index.ts +15 -0
- package/generated/entities/customer_user_password_reset/index.ts +6 -0
- package/generated/entities/customer_user_role/index.ts +5 -0
- package/generated/entities/customer_user_session/index.ts +9 -0
- package/generated/entities/organization/index.ts +1 -0
- package/generated/entities.ids.generated.ts +14 -1
- package/generated/entity-fields-registry.ts +18 -0
- package/package.json +3 -3
- package/src/modules/auth/services/rbacService.ts +3 -9
- package/src/modules/customer_accounts/AGENTS.md +377 -0
- package/src/modules/customer_accounts/acl.ts +8 -0
- package/src/modules/customer_accounts/api/admin/roles/[id]/acl.ts +98 -0
- package/src/modules/customer_accounts/api/admin/roles/[id].ts +246 -0
- package/src/modules/customer_accounts/api/admin/roles.ts +212 -0
- package/src/modules/customer_accounts/api/admin/users/[id]/reset-password.ts +78 -0
- package/src/modules/customer_accounts/api/admin/users/[id]/verify-email.ts +72 -0
- package/src/modules/customer_accounts/api/admin/users/[id].ts +289 -0
- package/src/modules/customer_accounts/api/admin/users-invite.ts +86 -0
- package/src/modules/customer_accounts/api/admin/users.ts +280 -0
- package/src/modules/customer_accounts/api/email/verify.ts +66 -0
- package/src/modules/customer_accounts/api/interceptors.ts +3 -0
- package/src/modules/customer_accounts/api/invitations/accept.ts +128 -0
- package/src/modules/customer_accounts/api/login.ts +163 -0
- package/src/modules/customer_accounts/api/magic-link/request.ts +87 -0
- package/src/modules/customer_accounts/api/magic-link/verify.ts +132 -0
- package/src/modules/customer_accounts/api/password/reset-confirm.ts +69 -0
- package/src/modules/customer_accounts/api/password/reset-request.ts +87 -0
- package/src/modules/customer_accounts/api/portal/events/stream.ts +209 -0
- package/src/modules/customer_accounts/api/portal/feature-check.ts +60 -0
- package/src/modules/customer_accounts/api/portal/logout.ts +71 -0
- package/src/modules/customer_accounts/api/portal/notifications/[id]/dismiss.ts +54 -0
- package/src/modules/customer_accounts/api/portal/notifications/[id]/read.ts +54 -0
- package/src/modules/customer_accounts/api/portal/notifications/mark-all-read.ts +49 -0
- package/src/modules/customer_accounts/api/portal/notifications/unread-count.ts +45 -0
- package/src/modules/customer_accounts/api/portal/notifications.ts +115 -0
- package/src/modules/customer_accounts/api/portal/password-change.ts +65 -0
- package/src/modules/customer_accounts/api/portal/profile.ts +151 -0
- package/src/modules/customer_accounts/api/portal/sessions/[id].ts +70 -0
- package/src/modules/customer_accounts/api/portal/sessions-refresh.ts +87 -0
- package/src/modules/customer_accounts/api/portal/sessions.ts +84 -0
- package/src/modules/customer_accounts/api/portal/users/[id]/roles.ts +106 -0
- package/src/modules/customer_accounts/api/portal/users/[id].ts +81 -0
- package/src/modules/customer_accounts/api/portal/users-invite.ts +103 -0
- package/src/modules/customer_accounts/api/portal/users.ts +86 -0
- package/src/modules/customer_accounts/api/signup.ts +136 -0
- package/src/modules/customer_accounts/backend/customer_accounts/[id]/page.meta.ts +11 -0
- package/src/modules/customer_accounts/backend/customer_accounts/[id]/page.tsx +607 -0
- package/src/modules/customer_accounts/backend/customer_accounts/roles/[id]/page.meta.ts +12 -0
- package/src/modules/customer_accounts/backend/customer_accounts/roles/[id]/page.tsx +385 -0
- package/src/modules/customer_accounts/backend/customer_accounts/roles/create/page.meta.ts +12 -0
- package/src/modules/customer_accounts/backend/customer_accounts/roles/create/page.tsx +203 -0
- package/src/modules/customer_accounts/backend/customer_accounts/roles/page.meta.ts +31 -0
- package/src/modules/customer_accounts/backend/customer_accounts/roles/page.tsx +217 -0
- package/src/modules/customer_accounts/backend/page.meta.ts +33 -0
- package/src/modules/customer_accounts/backend/page.tsx +535 -0
- package/src/modules/customer_accounts/ce.ts +22 -0
- package/src/modules/customer_accounts/data/enrichers.ts +117 -0
- package/src/modules/customer_accounts/data/entities.ts +302 -0
- package/src/modules/customer_accounts/data/extensions.ts +4 -0
- package/src/modules/customer_accounts/data/validators.ts +128 -0
- package/src/modules/customer_accounts/di.ts +15 -0
- package/src/modules/customer_accounts/events.ts +28 -0
- package/src/modules/customer_accounts/i18n/de.json +176 -0
- package/src/modules/customer_accounts/i18n/en.json +176 -0
- package/src/modules/customer_accounts/i18n/es.json +176 -0
- package/src/modules/customer_accounts/i18n/pl.json +176 -0
- package/src/modules/customer_accounts/index.ts +13 -0
- package/src/modules/customer_accounts/lib/customerAuth.ts +85 -0
- package/src/modules/customer_accounts/lib/customerAuthServer.ts +54 -0
- package/src/modules/customer_accounts/lib/rateLimiter.ts +36 -0
- package/src/modules/customer_accounts/lib/tokenGenerator.ts +9 -0
- package/src/modules/customer_accounts/migrations/.snapshot-open-mercato.json +1255 -0
- package/src/modules/customer_accounts/migrations/Migration20260313222043.ts +62 -0
- package/src/modules/customer_accounts/notifications.client.ts +46 -0
- package/src/modules/customer_accounts/notifications.ts +44 -0
- package/src/modules/customer_accounts/search.ts +134 -0
- package/src/modules/customer_accounts/services/customerInvitationService.ts +109 -0
- package/src/modules/customer_accounts/services/customerRbacService.ts +144 -0
- package/src/modules/customer_accounts/services/customerSessionService.ts +90 -0
- package/src/modules/customer_accounts/services/customerTokenService.ts +98 -0
- package/src/modules/customer_accounts/services/customerUserService.ts +105 -0
- package/src/modules/customer_accounts/setup.ts +212 -0
- package/src/modules/customer_accounts/subscribers/autoLinkCrm.ts +65 -0
- package/src/modules/customer_accounts/subscribers/autoLinkCrmReverse.ts +78 -0
- package/src/modules/customer_accounts/subscribers/notifyStaffOnSignup.ts +32 -0
- package/src/modules/customer_accounts/translations.ts +5 -0
- package/src/modules/customer_accounts/widgets/injection/account-status/widget.client.tsx +89 -0
- package/src/modules/customer_accounts/widgets/injection/account-status/widget.ts +16 -0
- package/src/modules/customer_accounts/widgets/injection/company-users/widget.client.tsx +78 -0
- package/src/modules/customer_accounts/widgets/injection/company-users/widget.ts +16 -0
- package/src/modules/customer_accounts/widgets/injection-table.ts +24 -0
- package/src/modules/customer_accounts/workers/cleanupExpiredSessions.ts +33 -0
- package/src/modules/customer_accounts/workers/cleanupExpiredTokens.ts +51 -0
- package/src/modules/customers/components/AddressTiles.tsx +1 -1
- package/src/modules/directory/api/get/organizations/lookup.ts +92 -0
- package/src/modules/directory/commands/organizations.ts +34 -1
- package/src/modules/directory/data/entities.ts +5 -1
- package/src/modules/directory/data/validators.ts +4 -0
- package/src/modules/directory/migrations/.snapshot-open-mercato.json +20 -1
- package/src/modules/directory/migrations/Migration20260314143323.ts +15 -0
- package/src/modules/directory/setup.ts +41 -0
- package/src/modules/payment_gateways/migrations/.snapshot-open-mercato.json +4 -1
- package/src/modules/payment_gateways/migrations/Migration20260313222043.ts +17 -0
- package/src/modules/portal/frontend/[orgSlug]/portal/dashboard/page.tsx +158 -0
- package/src/modules/portal/frontend/[orgSlug]/portal/login/page.tsx +120 -0
- package/src/modules/portal/frontend/[orgSlug]/portal/page.tsx +118 -0
- package/src/modules/portal/frontend/[orgSlug]/portal/profile/page.tsx +112 -0
- package/src/modules/portal/frontend/[orgSlug]/portal/signup/page.tsx +138 -0
- package/src/modules/portal/i18n/de.json +93 -0
- package/src/modules/portal/i18n/en.json +93 -0
- package/src/modules/portal/i18n/es.json +93 -0
- package/src/modules/portal/i18n/pl.json +93 -0
- package/src/modules/portal/index.ts +9 -0
- package/src/modules/portal/setup.ts +23 -0
- package/src/modules/shipping_carriers/migrations/.snapshot-open-mercato.json +226 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/customer_accounts/data/validators.ts"],
|
|
4
|
+
"sourcesContent": ["import { z } from 'zod'\n\nconst emailField = z.string().email().max(255)\nconst passwordField = z.string().min(8).max(128)\nconst displayNameField = z.string().min(1).max(255)\n\nexport const signupSchema = z.object({\n email: emailField,\n password: passwordField,\n displayName: displayNameField,\n tenantId: z.string().uuid().optional(),\n organizationId: z.string().uuid().optional(),\n})\n\nexport const loginSchema = z.object({\n email: emailField,\n password: z.string().min(1).max(128),\n tenantId: z.string().uuid().optional(),\n})\n\nexport const emailVerifySchema = z.object({\n token: z.string().min(1).max(512),\n})\n\nexport const passwordResetRequestSchema = z.object({\n email: emailField,\n tenantId: z.string().uuid().optional(),\n})\n\nexport const passwordResetConfirmSchema = z.object({\n token: z.string().min(1).max(512),\n password: passwordField,\n})\n\nexport const magicLinkRequestSchema = z.object({\n email: emailField,\n tenantId: z.string().uuid().optional(),\n})\n\nexport const magicLinkVerifySchema = z.object({\n token: z.string().min(1).max(512),\n})\n\nexport const invitationAcceptSchema = z.object({\n token: z.string().min(1).max(512),\n password: passwordField,\n displayName: displayNameField,\n})\n\nexport const profileUpdateSchema = z.object({\n displayName: displayNameField.optional(),\n})\n\nexport const passwordChangeSchema = z.object({\n currentPassword: z.string().min(1).max(128),\n newPassword: passwordField,\n})\n\nexport const createRoleSchema = z.object({\n name: z.string().min(1).max(255),\n slug: z.string().min(1).max(255).regex(/^[a-z0-9_-]+$/),\n description: z.string().max(1000).optional(),\n isDefault: z.boolean().optional(),\n customerAssignable: z.boolean().optional(),\n})\n\nexport const updateRoleSchema = z.object({\n name: z.string().min(1).max(255).optional(),\n description: z.string().max(1000).optional(),\n isDefault: z.boolean().optional(),\n customerAssignable: z.boolean().optional(),\n})\n\nexport const updateRoleAclSchema = z.object({\n features: z.array(z.string().min(1).max(255)),\n isPortalAdmin: z.boolean().optional(),\n})\n\nexport const inviteUserSchema = z.object({\n email: emailField,\n customerEntityId: z.string().uuid().optional(),\n roleIds: z.array(z.string().uuid()).min(1),\n displayName: displayNameField.optional(),\n})\n\nexport const assignRolesSchema = z.object({\n roleIds: z.array(z.string().uuid()).min(1),\n})\n\nexport const adminCreateUserSchema = z.object({\n email: emailField,\n password: passwordField,\n displayName: displayNameField,\n roleIds: z.array(z.string().uuid()).optional(),\n customerEntityId: z.string().uuid().optional(),\n})\n\nexport const adminUpdateUserSchema = z.object({\n displayName: displayNameField.optional(),\n isActive: z.boolean().optional(),\n lockedUntil: z.string().datetime().nullable().optional(),\n personEntityId: z.string().uuid().nullable().optional(),\n customerEntityId: z.string().uuid().nullable().optional(),\n roleIds: z.array(z.string().uuid()).optional(),\n})\n\nexport const adminResetPasswordSchema = z.object({\n newPassword: passwordField,\n})\n\nexport type AdminCreateUserInput = z.infer<typeof adminCreateUserSchema>\nexport type AdminResetPasswordInput = z.infer<typeof adminResetPasswordSchema>\nexport type SignupInput = z.infer<typeof signupSchema>\nexport type LoginInput = z.infer<typeof loginSchema>\nexport type EmailVerifyInput = z.infer<typeof emailVerifySchema>\nexport type PasswordResetRequestInput = z.infer<typeof passwordResetRequestSchema>\nexport type PasswordResetConfirmInput = z.infer<typeof passwordResetConfirmSchema>\nexport type MagicLinkRequestInput = z.infer<typeof magicLinkRequestSchema>\nexport type MagicLinkVerifyInput = z.infer<typeof magicLinkVerifySchema>\nexport type InvitationAcceptInput = z.infer<typeof invitationAcceptSchema>\nexport type ProfileUpdateInput = z.infer<typeof profileUpdateSchema>\nexport type PasswordChangeInput = z.infer<typeof passwordChangeSchema>\nexport type CreateRoleInput = z.infer<typeof createRoleSchema>\nexport type UpdateRoleInput = z.infer<typeof updateRoleSchema>\nexport type UpdateRoleAclInput = z.infer<typeof updateRoleAclSchema>\nexport type InviteUserInput = z.infer<typeof inviteUserSchema>\nexport type AssignRolesInput = z.infer<typeof assignRolesSchema>\nexport type AdminUpdateUserInput = z.infer<typeof adminUpdateUserSchema>\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,SAAS;AAElB,MAAM,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,GAAG;AAC7C,MAAM,gBAAgB,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAC/C,MAAM,mBAAmB,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAE3C,MAAM,eAAe,EAAE,OAAO;AAAA,EACnC,OAAO;AAAA,EACP,UAAU;AAAA,EACV,aAAa;AAAA,EACb,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS;AAAA,EACrC,gBAAgB,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS;AAC7C,CAAC;AAEM,MAAM,cAAc,EAAE,OAAO;AAAA,EAClC,OAAO;AAAA,EACP,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EACnC,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS;AACvC,CAAC;AAEM,MAAM,oBAAoB,EAAE,OAAO;AAAA,EACxC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAClC,CAAC;AAEM,MAAM,6BAA6B,EAAE,OAAO;AAAA,EACjD,OAAO;AAAA,EACP,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS;AACvC,CAAC;AAEM,MAAM,6BAA6B,EAAE,OAAO;AAAA,EACjD,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EAChC,UAAU;AACZ,CAAC;AAEM,MAAM,yBAAyB,EAAE,OAAO;AAAA,EAC7C,OAAO;AAAA,EACP,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS;AACvC,CAAC;AAEM,MAAM,wBAAwB,EAAE,OAAO;AAAA,EAC5C,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAClC,CAAC;AAEM,MAAM,yBAAyB,EAAE,OAAO;AAAA,EAC7C,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EAChC,UAAU;AAAA,EACV,aAAa;AACf,CAAC;AAEM,MAAM,sBAAsB,EAAE,OAAO;AAAA,EAC1C,aAAa,iBAAiB,SAAS;AACzC,CAAC;AAEM,MAAM,uBAAuB,EAAE,OAAO;AAAA,EAC3C,iBAAiB,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EAC1C,aAAa;AACf,CAAC;AAEM,MAAM,mBAAmB,EAAE,OAAO;AAAA,EACvC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EAC/B,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,EAAE,MAAM,eAAe;AAAA,EACtD,aAAa,EAAE,OAAO,EAAE,IAAI,GAAI,EAAE,SAAS;AAAA,EAC3C,WAAW,EAAE,QAAQ,EAAE,SAAS;AAAA,EAChC,oBAAoB,EAAE,QAAQ,EAAE,SAAS;AAC3C,CAAC;AAEM,MAAM,mBAAmB,EAAE,OAAO;AAAA,EACvC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,EAAE,SAAS;AAAA,EAC1C,aAAa,EAAE,OAAO,EAAE,IAAI,GAAI,EAAE,SAAS;AAAA,EAC3C,WAAW,EAAE,QAAQ,EAAE,SAAS;AAAA,EAChC,oBAAoB,EAAE,QAAQ,EAAE,SAAS;AAC3C,CAAC;AAEM,MAAM,sBAAsB,EAAE,OAAO;AAAA,EAC1C,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,CAAC;AAAA,EAC5C,eAAe,EAAE,QAAQ,EAAE,SAAS;AACtC,CAAC;AAEM,MAAM,mBAAmB,EAAE,OAAO;AAAA,EACvC,OAAO;AAAA,EACP,kBAAkB,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS;AAAA,EAC7C,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,IAAI,CAAC;AAAA,EACzC,aAAa,iBAAiB,SAAS;AACzC,CAAC;AAEM,MAAM,oBAAoB,EAAE,OAAO;AAAA,EACxC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,IAAI,CAAC;AAC3C,CAAC;AAEM,MAAM,wBAAwB,EAAE,OAAO;AAAA,EAC5C,OAAO;AAAA,EACP,UAAU;AAAA,EACV,aAAa;AAAA,EACb,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,SAAS;AAAA,EAC7C,kBAAkB,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS;AAC/C,CAAC;AAEM,MAAM,wBAAwB,EAAE,OAAO;AAAA,EAC5C,aAAa,iBAAiB,SAAS;AAAA,EACvC,UAAU,EAAE,QAAQ,EAAE,SAAS;AAAA,EAC/B,aAAa,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS;AAAA,EACvD,gBAAgB,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS;AAAA,EACtD,kBAAkB,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS;AAAA,EACxD,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,SAAS;AAC/C,CAAC;AAEM,MAAM,2BAA2B,EAAE,OAAO;AAAA,EAC/C,aAAa;AACf,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { asClass } from "awilix";
|
|
2
|
+
import { CustomerUserService } from "@open-mercato/core/modules/customer_accounts/services/customerUserService";
|
|
3
|
+
import { CustomerSessionService } from "@open-mercato/core/modules/customer_accounts/services/customerSessionService";
|
|
4
|
+
import { CustomerTokenService } from "@open-mercato/core/modules/customer_accounts/services/customerTokenService";
|
|
5
|
+
import { CustomerRbacService } from "@open-mercato/core/modules/customer_accounts/services/customerRbacService";
|
|
6
|
+
import { CustomerInvitationService } from "@open-mercato/core/modules/customer_accounts/services/customerInvitationService";
|
|
7
|
+
function register(container) {
|
|
8
|
+
container.register({ customerUserService: asClass(CustomerUserService).scoped() });
|
|
9
|
+
container.register({ customerSessionService: asClass(CustomerSessionService).scoped() });
|
|
10
|
+
container.register({ customerTokenService: asClass(CustomerTokenService).scoped() });
|
|
11
|
+
container.register({ customerRbacService: asClass(CustomerRbacService).scoped() });
|
|
12
|
+
container.register({ customerInvitationService: asClass(CustomerInvitationService).scoped() });
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
register
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=di.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/modules/customer_accounts/di.ts"],
|
|
4
|
+
"sourcesContent": ["import { asClass } from 'awilix'\nimport type { AppContainer } from '@open-mercato/shared/lib/di/container'\nimport { CustomerUserService } from '@open-mercato/core/modules/customer_accounts/services/customerUserService'\nimport { CustomerSessionService } from '@open-mercato/core/modules/customer_accounts/services/customerSessionService'\nimport { CustomerTokenService } from '@open-mercato/core/modules/customer_accounts/services/customerTokenService'\nimport { CustomerRbacService } from '@open-mercato/core/modules/customer_accounts/services/customerRbacService'\nimport { CustomerInvitationService } from '@open-mercato/core/modules/customer_accounts/services/customerInvitationService'\n\nexport function register(container: AppContainer) {\n container.register({ customerUserService: asClass(CustomerUserService).scoped() })\n container.register({ customerSessionService: asClass(CustomerSessionService).scoped() })\n container.register({ customerTokenService: asClass(CustomerTokenService).scoped() })\n container.register({ customerRbacService: asClass(CustomerRbacService).scoped() })\n container.register({ customerInvitationService: asClass(CustomerInvitationService).scoped() })\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,eAAe;AAExB,SAAS,2BAA2B;AACpC,SAAS,8BAA8B;AACvC,SAAS,4BAA4B;AACrC,SAAS,2BAA2B;AACpC,SAAS,iCAAiC;AAEnC,SAAS,SAAS,WAAyB;AAChD,YAAU,SAAS,EAAE,qBAAqB,QAAQ,mBAAmB,EAAE,OAAO,EAAE,CAAC;AACjF,YAAU,SAAS,EAAE,wBAAwB,QAAQ,sBAAsB,EAAE,OAAO,EAAE,CAAC;AACvF,YAAU,SAAS,EAAE,sBAAsB,QAAQ,oBAAoB,EAAE,OAAO,EAAE,CAAC;AACnF,YAAU,SAAS,EAAE,qBAAqB,QAAQ,mBAAmB,EAAE,OAAO,EAAE,CAAC;AACjF,YAAU,SAAS,EAAE,2BAA2B,QAAQ,yBAAyB,EAAE,OAAO,EAAE,CAAC;AAC/F;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { createModuleEvents } from "@open-mercato/shared/modules/events";
|
|
2
|
+
const events = [
|
|
3
|
+
{ id: "customer_accounts.user.created", label: "Customer User Created", entity: "user", category: "crud", clientBroadcast: true },
|
|
4
|
+
{ id: "customer_accounts.user.updated", label: "Customer User Updated", entity: "user", category: "crud", portalBroadcast: true },
|
|
5
|
+
{ id: "customer_accounts.user.deleted", label: "Customer User Deleted", entity: "user", category: "crud" },
|
|
6
|
+
{ id: "customer_accounts.user.locked", label: "Customer User Locked", entity: "user", category: "lifecycle", portalBroadcast: true },
|
|
7
|
+
{ id: "customer_accounts.user.unlocked", label: "Customer User Unlocked", entity: "user", category: "lifecycle", portalBroadcast: true },
|
|
8
|
+
{ id: "customer_accounts.login.success", label: "Customer Login Successful", category: "lifecycle" },
|
|
9
|
+
{ id: "customer_accounts.login.failed", label: "Customer Login Failed", category: "lifecycle" },
|
|
10
|
+
{ id: "customer_accounts.email.verified", label: "Customer Email Verified", category: "lifecycle", portalBroadcast: true },
|
|
11
|
+
{ id: "customer_accounts.password.reset", label: "Customer Password Reset", category: "lifecycle", portalBroadcast: true },
|
|
12
|
+
{ id: "customer_accounts.role.created", label: "Customer Role Created", entity: "role", category: "crud" },
|
|
13
|
+
{ id: "customer_accounts.role.updated", label: "Customer Role Updated", entity: "role", category: "crud", portalBroadcast: true },
|
|
14
|
+
{ id: "customer_accounts.role.deleted", label: "Customer Role Deleted", entity: "role", category: "crud" },
|
|
15
|
+
{ id: "customer_accounts.invitation.accepted", label: "Customer Invitation Accepted", category: "lifecycle", clientBroadcast: true }
|
|
16
|
+
];
|
|
17
|
+
const eventsConfig = createModuleEvents({
|
|
18
|
+
moduleId: "customer_accounts",
|
|
19
|
+
events
|
|
20
|
+
});
|
|
21
|
+
const emitCustomerAccountsEvent = eventsConfig.emit;
|
|
22
|
+
var events_default = eventsConfig;
|
|
23
|
+
export {
|
|
24
|
+
events_default as default,
|
|
25
|
+
emitCustomerAccountsEvent,
|
|
26
|
+
eventsConfig
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/modules/customer_accounts/events.ts"],
|
|
4
|
+
"sourcesContent": ["import { createModuleEvents } from '@open-mercato/shared/modules/events'\n\nconst events = [\n { id: 'customer_accounts.user.created', label: 'Customer User Created', entity: 'user', category: 'crud', clientBroadcast: true },\n { id: 'customer_accounts.user.updated', label: 'Customer User Updated', entity: 'user', category: 'crud', portalBroadcast: true },\n { id: 'customer_accounts.user.deleted', label: 'Customer User Deleted', entity: 'user', category: 'crud' },\n { id: 'customer_accounts.user.locked', label: 'Customer User Locked', entity: 'user', category: 'lifecycle', portalBroadcast: true },\n { id: 'customer_accounts.user.unlocked', label: 'Customer User Unlocked', entity: 'user', category: 'lifecycle', portalBroadcast: true },\n { id: 'customer_accounts.login.success', label: 'Customer Login Successful', category: 'lifecycle' },\n { id: 'customer_accounts.login.failed', label: 'Customer Login Failed', category: 'lifecycle' },\n { id: 'customer_accounts.email.verified', label: 'Customer Email Verified', category: 'lifecycle', portalBroadcast: true },\n { id: 'customer_accounts.password.reset', label: 'Customer Password Reset', category: 'lifecycle', portalBroadcast: true },\n { id: 'customer_accounts.role.created', label: 'Customer Role Created', entity: 'role', category: 'crud' },\n { id: 'customer_accounts.role.updated', label: 'Customer Role Updated', entity: 'role', category: 'crud', portalBroadcast: true },\n { id: 'customer_accounts.role.deleted', label: 'Customer Role Deleted', entity: 'role', category: 'crud' },\n { id: 'customer_accounts.invitation.accepted', label: 'Customer Invitation Accepted', category: 'lifecycle', clientBroadcast: true },\n] as const\n\nexport const eventsConfig = createModuleEvents({\n moduleId: 'customer_accounts',\n events,\n})\n\nexport const emitCustomerAccountsEvent = eventsConfig.emit\n\nexport type CustomerAccountsEventId = typeof events[number]['id']\n\nexport default eventsConfig\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,0BAA0B;AAEnC,MAAM,SAAS;AAAA,EACb,EAAE,IAAI,kCAAkC,OAAO,yBAAyB,QAAQ,QAAQ,UAAU,QAAQ,iBAAiB,KAAK;AAAA,EAChI,EAAE,IAAI,kCAAkC,OAAO,yBAAyB,QAAQ,QAAQ,UAAU,QAAQ,iBAAiB,KAAK;AAAA,EAChI,EAAE,IAAI,kCAAkC,OAAO,yBAAyB,QAAQ,QAAQ,UAAU,OAAO;AAAA,EACzG,EAAE,IAAI,iCAAiC,OAAO,wBAAwB,QAAQ,QAAQ,UAAU,aAAa,iBAAiB,KAAK;AAAA,EACnI,EAAE,IAAI,mCAAmC,OAAO,0BAA0B,QAAQ,QAAQ,UAAU,aAAa,iBAAiB,KAAK;AAAA,EACvI,EAAE,IAAI,mCAAmC,OAAO,6BAA6B,UAAU,YAAY;AAAA,EACnG,EAAE,IAAI,kCAAkC,OAAO,yBAAyB,UAAU,YAAY;AAAA,EAC9F,EAAE,IAAI,oCAAoC,OAAO,2BAA2B,UAAU,aAAa,iBAAiB,KAAK;AAAA,EACzH,EAAE,IAAI,oCAAoC,OAAO,2BAA2B,UAAU,aAAa,iBAAiB,KAAK;AAAA,EACzH,EAAE,IAAI,kCAAkC,OAAO,yBAAyB,QAAQ,QAAQ,UAAU,OAAO;AAAA,EACzG,EAAE,IAAI,kCAAkC,OAAO,yBAAyB,QAAQ,QAAQ,UAAU,QAAQ,iBAAiB,KAAK;AAAA,EAChI,EAAE,IAAI,kCAAkC,OAAO,yBAAyB,QAAQ,QAAQ,UAAU,OAAO;AAAA,EACzG,EAAE,IAAI,yCAAyC,OAAO,gCAAgC,UAAU,aAAa,iBAAiB,KAAK;AACrI;AAEO,MAAM,eAAe,mBAAmB;AAAA,EAC7C,UAAU;AAAA,EACV;AACF,CAAC;AAEM,MAAM,4BAA4B,aAAa;AAItD,IAAO,iBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const metadata = {
|
|
2
|
+
name: "customer_accounts",
|
|
3
|
+
title: "Customer Identity & Portal Authentication",
|
|
4
|
+
version: "0.1.0",
|
|
5
|
+
description: "Customer-facing authentication with two-tier identity model and full RBAC.",
|
|
6
|
+
author: "Open Mercato Team",
|
|
7
|
+
license: "Proprietary",
|
|
8
|
+
ejectable: true
|
|
9
|
+
};
|
|
10
|
+
import { features } from "./acl.js";
|
|
11
|
+
export {
|
|
12
|
+
features,
|
|
13
|
+
metadata
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/modules/customer_accounts/index.ts"],
|
|
4
|
+
"sourcesContent": ["import type { ModuleInfo } from '@open-mercato/shared/modules/registry'\n\nexport const metadata: ModuleInfo = {\n name: 'customer_accounts',\n title: 'Customer Identity & Portal Authentication',\n version: '0.1.0',\n description: 'Customer-facing authentication with two-tier identity model and full RBAC.',\n author: 'Open Mercato Team',\n license: 'Proprietary',\n ejectable: true,\n}\n\nexport { features } from './acl'\n"],
|
|
5
|
+
"mappings": "AAEO,MAAM,WAAuB;AAAA,EAClC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AAAA,EACT,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,WAAW;AACb;AAEA,SAAS,gBAAgB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { NextResponse } from "next/server";
|
|
2
|
+
import { verifyJwt } from "@open-mercato/shared/lib/auth/jwt";
|
|
3
|
+
import { hasAllFeatures } from "@open-mercato/shared/lib/auth/featureMatch";
|
|
4
|
+
function readCookieFromHeader(header, name) {
|
|
5
|
+
if (!header) return void 0;
|
|
6
|
+
const parts = header.split(";");
|
|
7
|
+
for (const part of parts) {
|
|
8
|
+
const trimmed = part.trim();
|
|
9
|
+
if (trimmed.startsWith(`${name}=`)) {
|
|
10
|
+
return trimmed.slice(name.length + 1);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return void 0;
|
|
14
|
+
}
|
|
15
|
+
async function getCustomerAuthFromRequest(req) {
|
|
16
|
+
const cookieHeader = req.headers.get("cookie") || "";
|
|
17
|
+
const authHeader = (req.headers.get("authorization") || "").trim();
|
|
18
|
+
let token;
|
|
19
|
+
if (authHeader.toLowerCase().startsWith("bearer ")) {
|
|
20
|
+
token = authHeader.slice(7).trim();
|
|
21
|
+
}
|
|
22
|
+
if (!token) {
|
|
23
|
+
const cookieValue = readCookieFromHeader(cookieHeader, "customer_auth_token");
|
|
24
|
+
if (cookieValue) {
|
|
25
|
+
try {
|
|
26
|
+
token = decodeURIComponent(cookieValue);
|
|
27
|
+
} catch {
|
|
28
|
+
token = cookieValue;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (!token) return null;
|
|
33
|
+
try {
|
|
34
|
+
const payload = verifyJwt(token);
|
|
35
|
+
if (!payload) return null;
|
|
36
|
+
if (payload.type !== "customer") return null;
|
|
37
|
+
return {
|
|
38
|
+
sub: String(payload.sub),
|
|
39
|
+
type: "customer",
|
|
40
|
+
tenantId: String(payload.tenantId),
|
|
41
|
+
orgId: String(payload.orgId),
|
|
42
|
+
email: String(payload.email || ""),
|
|
43
|
+
displayName: String(payload.displayName || ""),
|
|
44
|
+
customerEntityId: payload.customerEntityId ? String(payload.customerEntityId) : null,
|
|
45
|
+
personEntityId: payload.personEntityId ? String(payload.personEntityId) : null,
|
|
46
|
+
resolvedFeatures: Array.isArray(payload.resolvedFeatures) ? payload.resolvedFeatures : []
|
|
47
|
+
};
|
|
48
|
+
} catch {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
async function requireCustomerAuth(req) {
|
|
53
|
+
const auth = await getCustomerAuthFromRequest(req);
|
|
54
|
+
if (!auth) {
|
|
55
|
+
throw NextResponse.json({ ok: false, error: "Authentication required" }, { status: 401 });
|
|
56
|
+
}
|
|
57
|
+
return auth;
|
|
58
|
+
}
|
|
59
|
+
function requireCustomerFeature(auth, features) {
|
|
60
|
+
if (!features.length) return;
|
|
61
|
+
if (!hasAllFeatures(features, auth.resolvedFeatures)) {
|
|
62
|
+
throw NextResponse.json({ ok: false, error: "Insufficient permissions" }, { status: 403 });
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
export {
|
|
66
|
+
getCustomerAuthFromRequest,
|
|
67
|
+
readCookieFromHeader,
|
|
68
|
+
requireCustomerAuth,
|
|
69
|
+
requireCustomerFeature
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=customerAuth.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/customer_accounts/lib/customerAuth.ts"],
|
|
4
|
+
"sourcesContent": ["import { NextResponse } from 'next/server'\nimport { verifyJwt } from '@open-mercato/shared/lib/auth/jwt'\nimport { hasAllFeatures } from '@open-mercato/shared/lib/auth/featureMatch'\n\nexport interface CustomerAuthContext {\n sub: string\n type: 'customer'\n tenantId: string\n orgId: string\n email: string\n displayName: string\n customerEntityId?: string | null\n personEntityId?: string | null\n resolvedFeatures: string[]\n}\n\nexport function readCookieFromHeader(header: string | null | undefined, name: string): string | undefined {\n if (!header) return undefined\n const parts = header.split(';')\n for (const part of parts) {\n const trimmed = part.trim()\n if (trimmed.startsWith(`${name}=`)) {\n return trimmed.slice(name.length + 1)\n }\n }\n return undefined\n}\n\nexport async function getCustomerAuthFromRequest(req: Request): Promise<CustomerAuthContext | null> {\n const cookieHeader = req.headers.get('cookie') || ''\n const authHeader = (req.headers.get('authorization') || '').trim()\n\n let token: string | undefined\n if (authHeader.toLowerCase().startsWith('bearer ')) {\n token = authHeader.slice(7).trim()\n }\n if (!token) {\n const cookieValue = readCookieFromHeader(cookieHeader, 'customer_auth_token')\n if (cookieValue) {\n try {\n token = decodeURIComponent(cookieValue)\n } catch {\n // Malformed percent-encoding; use raw value\n token = cookieValue\n }\n }\n }\n if (!token) return null\n\n try {\n const payload = verifyJwt(token) as Record<string, unknown> | null\n if (!payload) return null\n if (payload.type !== 'customer') return null\n\n return {\n sub: String(payload.sub),\n type: 'customer',\n tenantId: String(payload.tenantId),\n orgId: String(payload.orgId),\n email: String(payload.email || ''),\n displayName: String(payload.displayName || ''),\n customerEntityId: payload.customerEntityId ? String(payload.customerEntityId) : null,\n personEntityId: payload.personEntityId ? String(payload.personEntityId) : null,\n resolvedFeatures: Array.isArray(payload.resolvedFeatures) ? payload.resolvedFeatures as string[] : [],\n }\n } catch {\n // Invalid or expired JWT \u2014 treat as unauthenticated\n return null\n }\n}\n\nexport async function requireCustomerAuth(req: Request): Promise<CustomerAuthContext> {\n const auth = await getCustomerAuthFromRequest(req)\n if (!auth) {\n throw NextResponse.json({ ok: false, error: 'Authentication required' }, { status: 401 })\n }\n return auth\n}\n\nexport function requireCustomerFeature(auth: CustomerAuthContext, features: string[]): void {\n if (!features.length) return\n if (!hasAllFeatures(features, auth.resolvedFeatures)) {\n throw NextResponse.json({ ok: false, error: 'Insufficient permissions' }, { status: 403 })\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,iBAAiB;AAC1B,SAAS,sBAAsB;AAcxB,SAAS,qBAAqB,QAAmC,MAAkC;AACxG,MAAI,CAAC,OAAQ,QAAO;AACpB,QAAM,QAAQ,OAAO,MAAM,GAAG;AAC9B,aAAW,QAAQ,OAAO;AACxB,UAAM,UAAU,KAAK,KAAK;AAC1B,QAAI,QAAQ,WAAW,GAAG,IAAI,GAAG,GAAG;AAClC,aAAO,QAAQ,MAAM,KAAK,SAAS,CAAC;AAAA,IACtC;AAAA,EACF;AACA,SAAO;AACT;AAEA,eAAsB,2BAA2B,KAAmD;AAClG,QAAM,eAAe,IAAI,QAAQ,IAAI,QAAQ,KAAK;AAClD,QAAM,cAAc,IAAI,QAAQ,IAAI,eAAe,KAAK,IAAI,KAAK;AAEjE,MAAI;AACJ,MAAI,WAAW,YAAY,EAAE,WAAW,SAAS,GAAG;AAClD,YAAQ,WAAW,MAAM,CAAC,EAAE,KAAK;AAAA,EACnC;AACA,MAAI,CAAC,OAAO;AACV,UAAM,cAAc,qBAAqB,cAAc,qBAAqB;AAC5E,QAAI,aAAa;AACf,UAAI;AACF,gBAAQ,mBAAmB,WAAW;AAAA,MACxC,QAAQ;AAEN,gBAAQ;AAAA,MACV;AAAA,IACF;AAAA,EACF;AACA,MAAI,CAAC,MAAO,QAAO;AAEnB,MAAI;AACF,UAAM,UAAU,UAAU,KAAK;AAC/B,QAAI,CAAC,QAAS,QAAO;AACrB,QAAI,QAAQ,SAAS,WAAY,QAAO;AAExC,WAAO;AAAA,MACL,KAAK,OAAO,QAAQ,GAAG;AAAA,MACvB,MAAM;AAAA,MACN,UAAU,OAAO,QAAQ,QAAQ;AAAA,MACjC,OAAO,OAAO,QAAQ,KAAK;AAAA,MAC3B,OAAO,OAAO,QAAQ,SAAS,EAAE;AAAA,MACjC,aAAa,OAAO,QAAQ,eAAe,EAAE;AAAA,MAC7C,kBAAkB,QAAQ,mBAAmB,OAAO,QAAQ,gBAAgB,IAAI;AAAA,MAChF,gBAAgB,QAAQ,iBAAiB,OAAO,QAAQ,cAAc,IAAI;AAAA,MAC1E,kBAAkB,MAAM,QAAQ,QAAQ,gBAAgB,IAAI,QAAQ,mBAA+B,CAAC;AAAA,IACtG;AAAA,EACF,QAAQ;AAEN,WAAO;AAAA,EACT;AACF;AAEA,eAAsB,oBAAoB,KAA4C;AACpF,QAAM,OAAO,MAAM,2BAA2B,GAAG;AACjD,MAAI,CAAC,MAAM;AACT,UAAM,aAAa,KAAK,EAAE,IAAI,OAAO,OAAO,0BAA0B,GAAG,EAAE,QAAQ,IAAI,CAAC;AAAA,EAC1F;AACA,SAAO;AACT;AAEO,SAAS,uBAAuB,MAA2B,UAA0B;AAC1F,MAAI,CAAC,SAAS,OAAQ;AACtB,MAAI,CAAC,eAAe,UAAU,KAAK,gBAAgB,GAAG;AACpD,UAAM,aAAa,KAAK,EAAE,IAAI,OAAO,OAAO,2BAA2B,GAAG,EAAE,QAAQ,IAAI,CAAC;AAAA,EAC3F;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { cookies } from "next/headers";
|
|
2
|
+
import { verifyJwt } from "@open-mercato/shared/lib/auth/jwt";
|
|
3
|
+
async function getCustomerAuthFromCookies() {
|
|
4
|
+
const cookieStore = await cookies();
|
|
5
|
+
const token = cookieStore.get("customer_auth_token")?.value;
|
|
6
|
+
if (!token) return null;
|
|
7
|
+
try {
|
|
8
|
+
const payload = verifyJwt(token);
|
|
9
|
+
if (!payload) return null;
|
|
10
|
+
if (payload.type !== "customer") return null;
|
|
11
|
+
return {
|
|
12
|
+
sub: String(payload.sub),
|
|
13
|
+
type: "customer",
|
|
14
|
+
tenantId: String(payload.tenantId),
|
|
15
|
+
orgId: String(payload.orgId),
|
|
16
|
+
email: String(payload.email || ""),
|
|
17
|
+
displayName: String(payload.displayName || ""),
|
|
18
|
+
customerEntityId: payload.customerEntityId ? String(payload.customerEntityId) : null,
|
|
19
|
+
personEntityId: payload.personEntityId ? String(payload.personEntityId) : null,
|
|
20
|
+
resolvedFeatures: Array.isArray(payload.resolvedFeatures) ? payload.resolvedFeatures : []
|
|
21
|
+
};
|
|
22
|
+
} catch {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
getCustomerAuthFromCookies
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=customerAuthServer.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/customer_accounts/lib/customerAuthServer.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Server-side customer auth helpers for Next.js server components.\n *\n * Uses the `cookies()` API from `next/headers` to read the customer auth token\n * from cookies \u2014 analogous to `getAuthFromCookies()` for staff auth.\n */\n\nimport { cookies } from 'next/headers'\nimport { verifyJwt } from '@open-mercato/shared/lib/auth/jwt'\nimport type { CustomerAuthContext } from './customerAuth'\n\nexport type { CustomerAuthContext }\n\n/**\n * Read and verify customer auth from cookies in server components.\n *\n * Returns the customer auth context if a valid customer JWT is found,\n * or null if not authenticated.\n *\n * @example\n * ```tsx\n * // In a server component or catch-all route\n * import { getCustomerAuthFromCookies } from '@open-mercato/core/modules/customer_accounts/lib/customerAuthServer'\n *\n * const customerAuth = await getCustomerAuthFromCookies()\n * if (!customerAuth) redirect('/login')\n * ```\n */\nexport async function getCustomerAuthFromCookies(): Promise<CustomerAuthContext | null> {\n const cookieStore = await cookies()\n const token = cookieStore.get('customer_auth_token')?.value\n if (!token) return null\n\n try {\n const payload = verifyJwt(token) as Record<string, unknown> | null\n if (!payload) return null\n if (payload.type !== 'customer') return null\n\n return {\n sub: String(payload.sub),\n type: 'customer',\n tenantId: String(payload.tenantId),\n orgId: String(payload.orgId),\n email: String(payload.email || ''),\n displayName: String(payload.displayName || ''),\n customerEntityId: payload.customerEntityId ? String(payload.customerEntityId) : null,\n personEntityId: payload.personEntityId ? String(payload.personEntityId) : null,\n resolvedFeatures: Array.isArray(payload.resolvedFeatures) ? payload.resolvedFeatures as string[] : [],\n }\n } catch {\n // Invalid or expired JWT \u2014 treat as unauthenticated\n return null\n }\n}\n"],
|
|
5
|
+
"mappings": "AAOA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAoB1B,eAAsB,6BAAkE;AACtF,QAAM,cAAc,MAAM,QAAQ;AAClC,QAAM,QAAQ,YAAY,IAAI,qBAAqB,GAAG;AACtD,MAAI,CAAC,MAAO,QAAO;AAEnB,MAAI;AACF,UAAM,UAAU,UAAU,KAAK;AAC/B,QAAI,CAAC,QAAS,QAAO;AACrB,QAAI,QAAQ,SAAS,WAAY,QAAO;AAExC,WAAO;AAAA,MACL,KAAK,OAAO,QAAQ,GAAG;AAAA,MACvB,MAAM;AAAA,MACN,UAAU,OAAO,QAAQ,QAAQ;AAAA,MACjC,OAAO,OAAO,QAAQ,KAAK;AAAA,MAC3B,OAAO,OAAO,QAAQ,SAAS,EAAE;AAAA,MACjC,aAAa,OAAO,QAAQ,eAAe,EAAE;AAAA,MAC7C,kBAAkB,QAAQ,mBAAmB,OAAO,QAAQ,gBAAgB,IAAI;AAAA,MAChF,gBAAgB,QAAQ,iBAAiB,OAAO,QAAQ,cAAc,IAAI;AAAA,MAC1E,kBAAkB,MAAM,QAAQ,QAAQ,gBAAgB,IAAI,QAAQ,mBAA+B,CAAC;AAAA,IACtG;AAAA,EACF,QAAQ;AAEN,WAAO;AAAA,EACT;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { checkAuthRateLimit, resetAuthRateLimit } from "@open-mercato/core/modules/auth/lib/rateLimitCheck";
|
|
2
|
+
import { readEndpointRateLimitConfig } from "@open-mercato/shared/lib/ratelimit/config";
|
|
3
|
+
const customerLoginRateLimitConfig = readEndpointRateLimitConfig("CUSTOMER_LOGIN", {
|
|
4
|
+
points: 5,
|
|
5
|
+
duration: 60,
|
|
6
|
+
blockDuration: 60,
|
|
7
|
+
keyPrefix: "customer-login"
|
|
8
|
+
});
|
|
9
|
+
const customerLoginIpRateLimitConfig = readEndpointRateLimitConfig("CUSTOMER_LOGIN_IP", {
|
|
10
|
+
points: 20,
|
|
11
|
+
duration: 60,
|
|
12
|
+
blockDuration: 60,
|
|
13
|
+
keyPrefix: "customer-login-ip"
|
|
14
|
+
});
|
|
15
|
+
const customerSignupRateLimitConfig = readEndpointRateLimitConfig("CUSTOMER_SIGNUP", {
|
|
16
|
+
points: 3,
|
|
17
|
+
duration: 60,
|
|
18
|
+
blockDuration: 120,
|
|
19
|
+
keyPrefix: "customer-signup"
|
|
20
|
+
});
|
|
21
|
+
const customerSignupIpRateLimitConfig = readEndpointRateLimitConfig("CUSTOMER_SIGNUP_IP", {
|
|
22
|
+
points: 10,
|
|
23
|
+
duration: 60,
|
|
24
|
+
blockDuration: 120,
|
|
25
|
+
keyPrefix: "customer-signup-ip"
|
|
26
|
+
});
|
|
27
|
+
const customerPasswordResetRateLimitConfig = readEndpointRateLimitConfig("CUSTOMER_PASSWORD_RESET", {
|
|
28
|
+
points: 3,
|
|
29
|
+
duration: 60,
|
|
30
|
+
blockDuration: 120,
|
|
31
|
+
keyPrefix: "customer-password-reset"
|
|
32
|
+
});
|
|
33
|
+
const customerPasswordResetIpRateLimitConfig = readEndpointRateLimitConfig("CUSTOMER_PASSWORD_RESET_IP", {
|
|
34
|
+
points: 10,
|
|
35
|
+
duration: 60,
|
|
36
|
+
blockDuration: 120,
|
|
37
|
+
keyPrefix: "customer-password-reset-ip"
|
|
38
|
+
});
|
|
39
|
+
const customerMagicLinkRateLimitConfig = readEndpointRateLimitConfig("CUSTOMER_MAGIC_LINK", {
|
|
40
|
+
points: 3,
|
|
41
|
+
duration: 60,
|
|
42
|
+
blockDuration: 120,
|
|
43
|
+
keyPrefix: "customer-magic-link"
|
|
44
|
+
});
|
|
45
|
+
const customerMagicLinkIpRateLimitConfig = readEndpointRateLimitConfig("CUSTOMER_MAGIC_LINK_IP", {
|
|
46
|
+
points: 10,
|
|
47
|
+
duration: 60,
|
|
48
|
+
blockDuration: 120,
|
|
49
|
+
keyPrefix: "customer-magic-link-ip"
|
|
50
|
+
});
|
|
51
|
+
export {
|
|
52
|
+
checkAuthRateLimit,
|
|
53
|
+
customerLoginIpRateLimitConfig,
|
|
54
|
+
customerLoginRateLimitConfig,
|
|
55
|
+
customerMagicLinkIpRateLimitConfig,
|
|
56
|
+
customerMagicLinkRateLimitConfig,
|
|
57
|
+
customerPasswordResetIpRateLimitConfig,
|
|
58
|
+
customerPasswordResetRateLimitConfig,
|
|
59
|
+
customerSignupIpRateLimitConfig,
|
|
60
|
+
customerSignupRateLimitConfig,
|
|
61
|
+
resetAuthRateLimit
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=rateLimiter.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/customer_accounts/lib/rateLimiter.ts"],
|
|
4
|
+
"sourcesContent": ["import { checkAuthRateLimit, resetAuthRateLimit } from '@open-mercato/core/modules/auth/lib/rateLimitCheck'\nimport { readEndpointRateLimitConfig } from '@open-mercato/shared/lib/ratelimit/config'\n\nexport const customerLoginRateLimitConfig = readEndpointRateLimitConfig('CUSTOMER_LOGIN', {\n points: 5, duration: 60, blockDuration: 60, keyPrefix: 'customer-login',\n})\n\nexport const customerLoginIpRateLimitConfig = readEndpointRateLimitConfig('CUSTOMER_LOGIN_IP', {\n points: 20, duration: 60, blockDuration: 60, keyPrefix: 'customer-login-ip',\n})\n\nexport const customerSignupRateLimitConfig = readEndpointRateLimitConfig('CUSTOMER_SIGNUP', {\n points: 3, duration: 60, blockDuration: 120, keyPrefix: 'customer-signup',\n})\n\nexport const customerSignupIpRateLimitConfig = readEndpointRateLimitConfig('CUSTOMER_SIGNUP_IP', {\n points: 10, duration: 60, blockDuration: 120, keyPrefix: 'customer-signup-ip',\n})\n\nexport const customerPasswordResetRateLimitConfig = readEndpointRateLimitConfig('CUSTOMER_PASSWORD_RESET', {\n points: 3, duration: 60, blockDuration: 120, keyPrefix: 'customer-password-reset',\n})\n\nexport const customerPasswordResetIpRateLimitConfig = readEndpointRateLimitConfig('CUSTOMER_PASSWORD_RESET_IP', {\n points: 10, duration: 60, blockDuration: 120, keyPrefix: 'customer-password-reset-ip',\n})\n\nexport const customerMagicLinkRateLimitConfig = readEndpointRateLimitConfig('CUSTOMER_MAGIC_LINK', {\n points: 3, duration: 60, blockDuration: 120, keyPrefix: 'customer-magic-link',\n})\n\nexport const customerMagicLinkIpRateLimitConfig = readEndpointRateLimitConfig('CUSTOMER_MAGIC_LINK_IP', {\n points: 10, duration: 60, blockDuration: 120, keyPrefix: 'customer-magic-link-ip',\n})\n\nexport { checkAuthRateLimit, resetAuthRateLimit }\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,oBAAoB,0BAA0B;AACvD,SAAS,mCAAmC;AAErC,MAAM,+BAA+B,4BAA4B,kBAAkB;AAAA,EACxF,QAAQ;AAAA,EAAG,UAAU;AAAA,EAAI,eAAe;AAAA,EAAI,WAAW;AACzD,CAAC;AAEM,MAAM,iCAAiC,4BAA4B,qBAAqB;AAAA,EAC7F,QAAQ;AAAA,EAAI,UAAU;AAAA,EAAI,eAAe;AAAA,EAAI,WAAW;AAC1D,CAAC;AAEM,MAAM,gCAAgC,4BAA4B,mBAAmB;AAAA,EAC1F,QAAQ;AAAA,EAAG,UAAU;AAAA,EAAI,eAAe;AAAA,EAAK,WAAW;AAC1D,CAAC;AAEM,MAAM,kCAAkC,4BAA4B,sBAAsB;AAAA,EAC/F,QAAQ;AAAA,EAAI,UAAU;AAAA,EAAI,eAAe;AAAA,EAAK,WAAW;AAC3D,CAAC;AAEM,MAAM,uCAAuC,4BAA4B,2BAA2B;AAAA,EACzG,QAAQ;AAAA,EAAG,UAAU;AAAA,EAAI,eAAe;AAAA,EAAK,WAAW;AAC1D,CAAC;AAEM,MAAM,yCAAyC,4BAA4B,8BAA8B;AAAA,EAC9G,QAAQ;AAAA,EAAI,UAAU;AAAA,EAAI,eAAe;AAAA,EAAK,WAAW;AAC3D,CAAC;AAEM,MAAM,mCAAmC,4BAA4B,uBAAuB;AAAA,EACjG,QAAQ;AAAA,EAAG,UAAU;AAAA,EAAI,eAAe;AAAA,EAAK,WAAW;AAC1D,CAAC;AAEM,MAAM,qCAAqC,4BAA4B,0BAA0B;AAAA,EACtG,QAAQ;AAAA,EAAI,UAAU;AAAA,EAAI,eAAe;AAAA,EAAK,WAAW;AAC3D,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import crypto from "node:crypto";
|
|
2
|
+
function generateSecureToken() {
|
|
3
|
+
return crypto.randomBytes(32).toString("base64url");
|
|
4
|
+
}
|
|
5
|
+
function hashToken(token) {
|
|
6
|
+
return crypto.createHash("sha256").update(token).digest("hex");
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
generateSecureToken,
|
|
10
|
+
hashToken
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=tokenGenerator.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/customer_accounts/lib/tokenGenerator.ts"],
|
|
4
|
+
"sourcesContent": ["import crypto from 'node:crypto'\n\nexport function generateSecureToken(): string {\n return crypto.randomBytes(32).toString('base64url')\n}\n\nexport function hashToken(token: string): string {\n return crypto.createHash('sha256').update(token).digest('hex')\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,YAAY;AAEZ,SAAS,sBAA8B;AAC5C,SAAO,OAAO,YAAY,EAAE,EAAE,SAAS,WAAW;AACpD;AAEO,SAAS,UAAU,OAAuB;AAC/C,SAAO,OAAO,WAAW,QAAQ,EAAE,OAAO,KAAK,EAAE,OAAO,KAAK;AAC/D;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Migration } from "@mikro-orm/migrations";
|
|
2
|
+
class Migration20260313222043 extends Migration {
|
|
3
|
+
async up() {
|
|
4
|
+
this.addSql(`create table "customer_roles" ("id" uuid not null default gen_random_uuid(), "tenant_id" uuid not null, "organization_id" uuid not null, "name" text not null, "slug" text not null, "description" text null, "is_default" boolean not null default false, "is_system" boolean not null default false, "customer_assignable" boolean not null default false, "created_at" timestamptz not null, "updated_at" timestamptz null, "deleted_at" timestamptz null, constraint "customer_roles_pkey" primary key ("id"));`);
|
|
5
|
+
this.addSql(`alter table "customer_roles" add constraint "customer_roles_tenant_slug_uniq" unique ("tenant_id", "slug");`);
|
|
6
|
+
this.addSql(`create table "customer_role_acls" ("id" uuid not null default gen_random_uuid(), "role_id" uuid not null, "tenant_id" uuid not null, "features_json" jsonb null, "is_portal_admin" boolean not null default false, "created_at" timestamptz not null, "updated_at" timestamptz null, "deleted_at" timestamptz null, constraint "customer_role_acls_pkey" primary key ("id"));`);
|
|
7
|
+
this.addSql(`alter table "customer_role_acls" add constraint "customer_role_acls_role_tenant_uniq" unique ("role_id", "tenant_id");`);
|
|
8
|
+
this.addSql(`create table "customer_users" ("id" uuid not null default gen_random_uuid(), "tenant_id" uuid not null, "organization_id" uuid not null, "email" text not null, "email_hash" text not null, "password_hash" text null, "display_name" text not null, "email_verified_at" timestamptz null, "failed_login_attempts" int not null default 0, "locked_until" timestamptz null, "last_login_at" timestamptz null, "person_entity_id" uuid null, "customer_entity_id" uuid null, "is_active" boolean not null default true, "created_at" timestamptz not null, "updated_at" timestamptz null, "deleted_at" timestamptz null, constraint "customer_users_pkey" primary key ("id"));`);
|
|
9
|
+
this.addSql(`create index "customer_users_email_hash_idx" on "customer_users" ("email_hash");`);
|
|
10
|
+
this.addSql(`create index "customer_users_person_entity_idx" on "customer_users" ("person_entity_id");`);
|
|
11
|
+
this.addSql(`create index "customer_users_customer_entity_idx" on "customer_users" ("customer_entity_id");`);
|
|
12
|
+
this.addSql(`alter table "customer_users" add constraint "customer_users_tenant_email_hash_uniq" unique ("tenant_id", "email_hash");`);
|
|
13
|
+
this.addSql(`create table "customer_user_acls" ("id" uuid not null default gen_random_uuid(), "user_id" uuid not null, "tenant_id" uuid not null, "features_json" jsonb null, "is_portal_admin" boolean not null default false, "created_at" timestamptz not null, "updated_at" timestamptz null, "deleted_at" timestamptz null, constraint "customer_user_acls_pkey" primary key ("id"));`);
|
|
14
|
+
this.addSql(`alter table "customer_user_acls" add constraint "customer_user_acls_user_tenant_uniq" unique ("user_id", "tenant_id");`);
|
|
15
|
+
this.addSql(`create table "customer_user_email_verifications" ("id" uuid not null default gen_random_uuid(), "user_id" uuid not null, "token" text not null, "purpose" text not null default 'email_verification', "expires_at" timestamptz not null, "used_at" timestamptz null, "created_at" timestamptz not null, constraint "customer_user_email_verifications_pkey" primary key ("id"));`);
|
|
16
|
+
this.addSql(`create index "customer_user_email_verifications_token_idx" on "customer_user_email_verifications" ("token");`);
|
|
17
|
+
this.addSql(`create table "customer_user_invitations" ("id" uuid not null default gen_random_uuid(), "tenant_id" uuid not null, "organization_id" uuid not null, "email" text not null, "email_hash" text not null, "token" text not null, "customer_entity_id" uuid null, "role_ids_json" jsonb null, "invited_by_user_id" uuid null, "invited_by_customer_user_id" uuid null, "display_name" text null, "expires_at" timestamptz not null, "accepted_at" timestamptz null, "cancelled_at" timestamptz null, "created_at" timestamptz not null, constraint "customer_user_invitations_pkey" primary key ("id"));`);
|
|
18
|
+
this.addSql(`create index "customer_user_invitations_tenant_email_hash_idx" on "customer_user_invitations" ("tenant_id", "email_hash");`);
|
|
19
|
+
this.addSql(`create index "customer_user_invitations_token_idx" on "customer_user_invitations" ("token");`);
|
|
20
|
+
this.addSql(`create table "customer_user_password_resets" ("id" uuid not null default gen_random_uuid(), "user_id" uuid not null, "token" text not null, "expires_at" timestamptz not null, "used_at" timestamptz null, "created_at" timestamptz not null, constraint "customer_user_password_resets_pkey" primary key ("id"));`);
|
|
21
|
+
this.addSql(`create index "customer_user_password_resets_token_idx" on "customer_user_password_resets" ("token");`);
|
|
22
|
+
this.addSql(`create table "customer_user_roles" ("id" uuid not null default gen_random_uuid(), "user_id" uuid not null, "role_id" uuid not null, "created_at" timestamptz not null, "deleted_at" timestamptz null, constraint "customer_user_roles_pkey" primary key ("id"));`);
|
|
23
|
+
this.addSql(`alter table "customer_user_roles" add constraint "customer_user_roles_user_role_uniq" unique ("user_id", "role_id");`);
|
|
24
|
+
this.addSql(`create table "customer_user_sessions" ("id" uuid not null default gen_random_uuid(), "user_id" uuid not null, "token_hash" text not null, "ip_address" text null, "user_agent" text null, "expires_at" timestamptz not null, "last_used_at" timestamptz null, "created_at" timestamptz not null, "deleted_at" timestamptz null, constraint "customer_user_sessions_pkey" primary key ("id"));`);
|
|
25
|
+
this.addSql(`create index "customer_user_sessions_token_hash_idx" on "customer_user_sessions" ("token_hash");`);
|
|
26
|
+
this.addSql(`alter table "customer_role_acls" add constraint "customer_role_acls_role_id_foreign" foreign key ("role_id") references "customer_roles" ("id") on update cascade;`);
|
|
27
|
+
this.addSql(`alter table "customer_user_acls" add constraint "customer_user_acls_user_id_foreign" foreign key ("user_id") references "customer_users" ("id") on update cascade;`);
|
|
28
|
+
this.addSql(`alter table "customer_user_email_verifications" add constraint "customer_user_email_verifications_user_id_foreign" foreign key ("user_id") references "customer_users" ("id") on update cascade;`);
|
|
29
|
+
this.addSql(`alter table "customer_user_password_resets" add constraint "customer_user_password_resets_user_id_foreign" foreign key ("user_id") references "customer_users" ("id") on update cascade;`);
|
|
30
|
+
this.addSql(`alter table "customer_user_roles" add constraint "customer_user_roles_user_id_foreign" foreign key ("user_id") references "customer_users" ("id") on update cascade;`);
|
|
31
|
+
this.addSql(`alter table "customer_user_roles" add constraint "customer_user_roles_role_id_foreign" foreign key ("role_id") references "customer_roles" ("id") on update cascade;`);
|
|
32
|
+
this.addSql(`alter table "customer_user_sessions" add constraint "customer_user_sessions_user_id_foreign" foreign key ("user_id") references "customer_users" ("id") on update cascade;`);
|
|
33
|
+
}
|
|
34
|
+
async down() {
|
|
35
|
+
this.addSql(`drop table if exists "customer_user_sessions" cascade;`);
|
|
36
|
+
this.addSql(`drop table if exists "customer_user_roles" cascade;`);
|
|
37
|
+
this.addSql(`drop table if exists "customer_user_password_resets" cascade;`);
|
|
38
|
+
this.addSql(`drop table if exists "customer_user_invitations" cascade;`);
|
|
39
|
+
this.addSql(`drop table if exists "customer_user_email_verifications" cascade;`);
|
|
40
|
+
this.addSql(`drop table if exists "customer_user_acls" cascade;`);
|
|
41
|
+
this.addSql(`drop table if exists "customer_role_acls" cascade;`);
|
|
42
|
+
this.addSql(`drop table if exists "customer_users" cascade;`);
|
|
43
|
+
this.addSql(`drop table if exists "customer_roles" cascade;`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
Migration20260313222043
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=Migration20260313222043.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/customer_accounts/migrations/Migration20260313222043.ts"],
|
|
4
|
+
"sourcesContent": ["import { Migration } from '@mikro-orm/migrations';\n\nexport class Migration20260313222043 extends Migration {\n\n override async up(): Promise<void> {\n this.addSql(`create table \"customer_roles\" (\"id\" uuid not null default gen_random_uuid(), \"tenant_id\" uuid not null, \"organization_id\" uuid not null, \"name\" text not null, \"slug\" text not null, \"description\" text null, \"is_default\" boolean not null default false, \"is_system\" boolean not null default false, \"customer_assignable\" boolean not null default false, \"created_at\" timestamptz not null, \"updated_at\" timestamptz null, \"deleted_at\" timestamptz null, constraint \"customer_roles_pkey\" primary key (\"id\"));`);\n this.addSql(`alter table \"customer_roles\" add constraint \"customer_roles_tenant_slug_uniq\" unique (\"tenant_id\", \"slug\");`);\n\n this.addSql(`create table \"customer_role_acls\" (\"id\" uuid not null default gen_random_uuid(), \"role_id\" uuid not null, \"tenant_id\" uuid not null, \"features_json\" jsonb null, \"is_portal_admin\" boolean not null default false, \"created_at\" timestamptz not null, \"updated_at\" timestamptz null, \"deleted_at\" timestamptz null, constraint \"customer_role_acls_pkey\" primary key (\"id\"));`);\n this.addSql(`alter table \"customer_role_acls\" add constraint \"customer_role_acls_role_tenant_uniq\" unique (\"role_id\", \"tenant_id\");`);\n\n this.addSql(`create table \"customer_users\" (\"id\" uuid not null default gen_random_uuid(), \"tenant_id\" uuid not null, \"organization_id\" uuid not null, \"email\" text not null, \"email_hash\" text not null, \"password_hash\" text null, \"display_name\" text not null, \"email_verified_at\" timestamptz null, \"failed_login_attempts\" int not null default 0, \"locked_until\" timestamptz null, \"last_login_at\" timestamptz null, \"person_entity_id\" uuid null, \"customer_entity_id\" uuid null, \"is_active\" boolean not null default true, \"created_at\" timestamptz not null, \"updated_at\" timestamptz null, \"deleted_at\" timestamptz null, constraint \"customer_users_pkey\" primary key (\"id\"));`);\n this.addSql(`create index \"customer_users_email_hash_idx\" on \"customer_users\" (\"email_hash\");`);\n this.addSql(`create index \"customer_users_person_entity_idx\" on \"customer_users\" (\"person_entity_id\");`);\n this.addSql(`create index \"customer_users_customer_entity_idx\" on \"customer_users\" (\"customer_entity_id\");`);\n this.addSql(`alter table \"customer_users\" add constraint \"customer_users_tenant_email_hash_uniq\" unique (\"tenant_id\", \"email_hash\");`);\n\n this.addSql(`create table \"customer_user_acls\" (\"id\" uuid not null default gen_random_uuid(), \"user_id\" uuid not null, \"tenant_id\" uuid not null, \"features_json\" jsonb null, \"is_portal_admin\" boolean not null default false, \"created_at\" timestamptz not null, \"updated_at\" timestamptz null, \"deleted_at\" timestamptz null, constraint \"customer_user_acls_pkey\" primary key (\"id\"));`);\n this.addSql(`alter table \"customer_user_acls\" add constraint \"customer_user_acls_user_tenant_uniq\" unique (\"user_id\", \"tenant_id\");`);\n\n this.addSql(`create table \"customer_user_email_verifications\" (\"id\" uuid not null default gen_random_uuid(), \"user_id\" uuid not null, \"token\" text not null, \"purpose\" text not null default 'email_verification', \"expires_at\" timestamptz not null, \"used_at\" timestamptz null, \"created_at\" timestamptz not null, constraint \"customer_user_email_verifications_pkey\" primary key (\"id\"));`);\n this.addSql(`create index \"customer_user_email_verifications_token_idx\" on \"customer_user_email_verifications\" (\"token\");`);\n\n this.addSql(`create table \"customer_user_invitations\" (\"id\" uuid not null default gen_random_uuid(), \"tenant_id\" uuid not null, \"organization_id\" uuid not null, \"email\" text not null, \"email_hash\" text not null, \"token\" text not null, \"customer_entity_id\" uuid null, \"role_ids_json\" jsonb null, \"invited_by_user_id\" uuid null, \"invited_by_customer_user_id\" uuid null, \"display_name\" text null, \"expires_at\" timestamptz not null, \"accepted_at\" timestamptz null, \"cancelled_at\" timestamptz null, \"created_at\" timestamptz not null, constraint \"customer_user_invitations_pkey\" primary key (\"id\"));`);\n this.addSql(`create index \"customer_user_invitations_tenant_email_hash_idx\" on \"customer_user_invitations\" (\"tenant_id\", \"email_hash\");`);\n this.addSql(`create index \"customer_user_invitations_token_idx\" on \"customer_user_invitations\" (\"token\");`);\n\n this.addSql(`create table \"customer_user_password_resets\" (\"id\" uuid not null default gen_random_uuid(), \"user_id\" uuid not null, \"token\" text not null, \"expires_at\" timestamptz not null, \"used_at\" timestamptz null, \"created_at\" timestamptz not null, constraint \"customer_user_password_resets_pkey\" primary key (\"id\"));`);\n this.addSql(`create index \"customer_user_password_resets_token_idx\" on \"customer_user_password_resets\" (\"token\");`);\n\n this.addSql(`create table \"customer_user_roles\" (\"id\" uuid not null default gen_random_uuid(), \"user_id\" uuid not null, \"role_id\" uuid not null, \"created_at\" timestamptz not null, \"deleted_at\" timestamptz null, constraint \"customer_user_roles_pkey\" primary key (\"id\"));`);\n this.addSql(`alter table \"customer_user_roles\" add constraint \"customer_user_roles_user_role_uniq\" unique (\"user_id\", \"role_id\");`);\n\n this.addSql(`create table \"customer_user_sessions\" (\"id\" uuid not null default gen_random_uuid(), \"user_id\" uuid not null, \"token_hash\" text not null, \"ip_address\" text null, \"user_agent\" text null, \"expires_at\" timestamptz not null, \"last_used_at\" timestamptz null, \"created_at\" timestamptz not null, \"deleted_at\" timestamptz null, constraint \"customer_user_sessions_pkey\" primary key (\"id\"));`);\n this.addSql(`create index \"customer_user_sessions_token_hash_idx\" on \"customer_user_sessions\" (\"token_hash\");`);\n\n this.addSql(`alter table \"customer_role_acls\" add constraint \"customer_role_acls_role_id_foreign\" foreign key (\"role_id\") references \"customer_roles\" (\"id\") on update cascade;`);\n\n this.addSql(`alter table \"customer_user_acls\" add constraint \"customer_user_acls_user_id_foreign\" foreign key (\"user_id\") references \"customer_users\" (\"id\") on update cascade;`);\n\n this.addSql(`alter table \"customer_user_email_verifications\" add constraint \"customer_user_email_verifications_user_id_foreign\" foreign key (\"user_id\") references \"customer_users\" (\"id\") on update cascade;`);\n\n this.addSql(`alter table \"customer_user_password_resets\" add constraint \"customer_user_password_resets_user_id_foreign\" foreign key (\"user_id\") references \"customer_users\" (\"id\") on update cascade;`);\n\n this.addSql(`alter table \"customer_user_roles\" add constraint \"customer_user_roles_user_id_foreign\" foreign key (\"user_id\") references \"customer_users\" (\"id\") on update cascade;`);\n this.addSql(`alter table \"customer_user_roles\" add constraint \"customer_user_roles_role_id_foreign\" foreign key (\"role_id\") references \"customer_roles\" (\"id\") on update cascade;`);\n\n this.addSql(`alter table \"customer_user_sessions\" add constraint \"customer_user_sessions_user_id_foreign\" foreign key (\"user_id\") references \"customer_users\" (\"id\") on update cascade;`);\n }\n\n override async down(): Promise<void> {\n this.addSql(`drop table if exists \"customer_user_sessions\" cascade;`);\n this.addSql(`drop table if exists \"customer_user_roles\" cascade;`);\n this.addSql(`drop table if exists \"customer_user_password_resets\" cascade;`);\n this.addSql(`drop table if exists \"customer_user_invitations\" cascade;`);\n this.addSql(`drop table if exists \"customer_user_email_verifications\" cascade;`);\n this.addSql(`drop table if exists \"customer_user_acls\" cascade;`);\n this.addSql(`drop table if exists \"customer_role_acls\" cascade;`);\n this.addSql(`drop table if exists \"customer_users\" cascade;`);\n this.addSql(`drop table if exists \"customer_roles\" cascade;`);\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,iBAAiB;AAEnB,MAAM,gCAAgC,UAAU;AAAA,EAErD,MAAe,KAAoB;AACjC,SAAK,OAAO,qfAAqf;AACjgB,SAAK,OAAO,6GAA6G;AAEzH,SAAK,OAAO,+WAA+W;AAC3X,SAAK,OAAO,wHAAwH;AAEpI,SAAK,OAAO,+oBAA+oB;AAC3pB,SAAK,OAAO,kFAAkF;AAC9F,SAAK,OAAO,2FAA2F;AACvG,SAAK,OAAO,+FAA+F;AAC3G,SAAK,OAAO,yHAAyH;AAErI,SAAK,OAAO,+WAA+W;AAC3X,SAAK,OAAO,wHAAwH;AAEpI,SAAK,OAAO,kXAAkX;AAC9X,SAAK,OAAO,8GAA8G;AAE1H,SAAK,OAAO,skBAAskB;AACllB,SAAK,OAAO,4HAA4H;AACxI,SAAK,OAAO,8FAA8F;AAE1G,SAAK,OAAO,oTAAoT;AAChU,SAAK,OAAO,sGAAsG;AAElH,SAAK,OAAO,kQAAkQ;AAC9Q,SAAK,OAAO,sHAAsH;AAElI,SAAK,OAAO,+XAA+X;AAC3Y,SAAK,OAAO,kGAAkG;AAE9G,SAAK,OAAO,oKAAoK;AAEhL,SAAK,OAAO,oKAAoK;AAEhL,SAAK,OAAO,kMAAkM;AAE9M,SAAK,OAAO,0LAA0L;AAEtM,SAAK,OAAO,sKAAsK;AAClL,SAAK,OAAO,sKAAsK;AAElL,SAAK,OAAO,4KAA4K;AAAA,EAC1L;AAAA,EAEA,MAAe,OAAsB;AACnC,SAAK,OAAO,wDAAwD;AACpE,SAAK,OAAO,qDAAqD;AACjE,SAAK,OAAO,+DAA+D;AAC3E,SAAK,OAAO,2DAA2D;AACvE,SAAK,OAAO,mEAAmE;AAC/E,SAAK,OAAO,oDAAoD;AAChE,SAAK,OAAO,oDAAoD;AAChE,SAAK,OAAO,gDAAgD;AAC5D,SAAK,OAAO,gDAAgD;AAAA,EAC9D;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const customerAccountsNotificationTypes = [
|
|
3
|
+
{
|
|
4
|
+
type: "customer_accounts.user.signup",
|
|
5
|
+
module: "customer_accounts",
|
|
6
|
+
titleKey: "customer_accounts.notifications.user.signup.title",
|
|
7
|
+
bodyKey: "customer_accounts.notifications.user.signup.body",
|
|
8
|
+
icon: "user-plus",
|
|
9
|
+
severity: "info",
|
|
10
|
+
actions: [
|
|
11
|
+
{
|
|
12
|
+
id: "view",
|
|
13
|
+
labelKey: "common.view",
|
|
14
|
+
variant: "outline",
|
|
15
|
+
href: "/backend/customer_accounts/{sourceEntityId}",
|
|
16
|
+
icon: "external-link"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
linkHref: "/backend/customer_accounts/{sourceEntityId}",
|
|
20
|
+
expiresAfterHours: 168
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
type: "customer_accounts.user.locked",
|
|
24
|
+
module: "customer_accounts",
|
|
25
|
+
titleKey: "customer_accounts.notifications.user.locked.title",
|
|
26
|
+
bodyKey: "customer_accounts.notifications.user.locked.body",
|
|
27
|
+
icon: "lock",
|
|
28
|
+
severity: "warning",
|
|
29
|
+
actions: [
|
|
30
|
+
{
|
|
31
|
+
id: "view",
|
|
32
|
+
labelKey: "common.view",
|
|
33
|
+
variant: "outline",
|
|
34
|
+
href: "/backend/customer_accounts/{sourceEntityId}",
|
|
35
|
+
icon: "external-link"
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
linkHref: "/backend/customer_accounts/{sourceEntityId}",
|
|
39
|
+
expiresAfterHours: 168
|
|
40
|
+
}
|
|
41
|
+
];
|
|
42
|
+
var notifications_client_default = customerAccountsNotificationTypes;
|
|
43
|
+
export {
|
|
44
|
+
customerAccountsNotificationTypes,
|
|
45
|
+
notifications_client_default as default
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=notifications.client.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/modules/customer_accounts/notifications.client.ts"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport type { NotificationTypeDefinition } from '@open-mercato/shared/modules/notifications/types'\n\nexport const customerAccountsNotificationTypes: NotificationTypeDefinition[] = [\n {\n type: 'customer_accounts.user.signup',\n module: 'customer_accounts',\n titleKey: 'customer_accounts.notifications.user.signup.title',\n bodyKey: 'customer_accounts.notifications.user.signup.body',\n icon: 'user-plus',\n severity: 'info',\n actions: [\n {\n id: 'view',\n labelKey: 'common.view',\n variant: 'outline',\n href: '/backend/customer_accounts/{sourceEntityId}',\n icon: 'external-link',\n },\n ],\n linkHref: '/backend/customer_accounts/{sourceEntityId}',\n expiresAfterHours: 168,\n },\n {\n type: 'customer_accounts.user.locked',\n module: 'customer_accounts',\n titleKey: 'customer_accounts.notifications.user.locked.title',\n bodyKey: 'customer_accounts.notifications.user.locked.body',\n icon: 'lock',\n severity: 'warning',\n actions: [\n {\n id: 'view',\n labelKey: 'common.view',\n variant: 'outline',\n href: '/backend/customer_accounts/{sourceEntityId}',\n icon: 'external-link',\n },\n ],\n linkHref: '/backend/customer_accounts/{sourceEntityId}',\n expiresAfterHours: 168,\n },\n]\n\nexport default customerAccountsNotificationTypes\n"],
|
|
5
|
+
"mappings": ";AAIO,MAAM,oCAAkE;AAAA,EAC7E;AAAA,IACE,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,SAAS;AAAA,IACT,MAAM;AAAA,IACN,UAAU;AAAA,IACV,SAAS;AAAA,MACP;AAAA,QACE,IAAI;AAAA,QACJ,UAAU;AAAA,QACV,SAAS;AAAA,QACT,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,UAAU;AAAA,IACV,mBAAmB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,SAAS;AAAA,IACT,MAAM;AAAA,IACN,UAAU;AAAA,IACV,SAAS;AAAA,MACP;AAAA,QACE,IAAI;AAAA,QACJ,UAAU;AAAA,QACV,SAAS;AAAA,QACT,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,UAAU;AAAA,IACV,mBAAmB;AAAA,EACrB;AACF;AAEA,IAAO,+BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
const notificationTypes = [
|
|
2
|
+
{
|
|
3
|
+
type: "customer_accounts.user.signup",
|
|
4
|
+
module: "customer_accounts",
|
|
5
|
+
titleKey: "customer_accounts.notifications.user.signup.title",
|
|
6
|
+
bodyKey: "customer_accounts.notifications.user.signup.body",
|
|
7
|
+
icon: "user-plus",
|
|
8
|
+
severity: "info",
|
|
9
|
+
actions: [
|
|
10
|
+
{
|
|
11
|
+
id: "view",
|
|
12
|
+
labelKey: "common.view",
|
|
13
|
+
variant: "outline",
|
|
14
|
+
href: "/backend/customer_accounts/{sourceEntityId}",
|
|
15
|
+
icon: "external-link"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
linkHref: "/backend/customer_accounts/{sourceEntityId}",
|
|
19
|
+
expiresAfterHours: 168
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
type: "customer_accounts.user.locked",
|
|
23
|
+
module: "customer_accounts",
|
|
24
|
+
titleKey: "customer_accounts.notifications.user.locked.title",
|
|
25
|
+
bodyKey: "customer_accounts.notifications.user.locked.body",
|
|
26
|
+
icon: "lock",
|
|
27
|
+
severity: "warning",
|
|
28
|
+
actions: [
|
|
29
|
+
{
|
|
30
|
+
id: "view",
|
|
31
|
+
labelKey: "common.view",
|
|
32
|
+
variant: "outline",
|
|
33
|
+
href: "/backend/customer_accounts/{sourceEntityId}",
|
|
34
|
+
icon: "external-link"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
linkHref: "/backend/customer_accounts/{sourceEntityId}",
|
|
38
|
+
expiresAfterHours: 168
|
|
39
|
+
}
|
|
40
|
+
];
|
|
41
|
+
var notifications_default = notificationTypes;
|
|
42
|
+
export {
|
|
43
|
+
notifications_default as default,
|
|
44
|
+
notificationTypes
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=notifications.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/modules/customer_accounts/notifications.ts"],
|
|
4
|
+
"sourcesContent": ["import type { NotificationTypeDefinition } from '@open-mercato/shared/modules/notifications/types'\n\nexport const notificationTypes: NotificationTypeDefinition[] = [\n {\n type: 'customer_accounts.user.signup',\n module: 'customer_accounts',\n titleKey: 'customer_accounts.notifications.user.signup.title',\n bodyKey: 'customer_accounts.notifications.user.signup.body',\n icon: 'user-plus',\n severity: 'info',\n actions: [\n {\n id: 'view',\n labelKey: 'common.view',\n variant: 'outline',\n href: '/backend/customer_accounts/{sourceEntityId}',\n icon: 'external-link',\n },\n ],\n linkHref: '/backend/customer_accounts/{sourceEntityId}',\n expiresAfterHours: 168,\n },\n {\n type: 'customer_accounts.user.locked',\n module: 'customer_accounts',\n titleKey: 'customer_accounts.notifications.user.locked.title',\n bodyKey: 'customer_accounts.notifications.user.locked.body',\n icon: 'lock',\n severity: 'warning',\n actions: [\n {\n id: 'view',\n labelKey: 'common.view',\n variant: 'outline',\n href: '/backend/customer_accounts/{sourceEntityId}',\n icon: 'external-link',\n },\n ],\n linkHref: '/backend/customer_accounts/{sourceEntityId}',\n expiresAfterHours: 168,\n },\n]\n\nexport default notificationTypes\n"],
|
|
5
|
+
"mappings": "AAEO,MAAM,oBAAkD;AAAA,EAC7D;AAAA,IACE,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,SAAS;AAAA,IACT,MAAM;AAAA,IACN,UAAU;AAAA,IACV,SAAS;AAAA,MACP;AAAA,QACE,IAAI;AAAA,QACJ,UAAU;AAAA,QACV,SAAS;AAAA,QACT,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,UAAU;AAAA,IACV,mBAAmB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,SAAS;AAAA,IACT,MAAM;AAAA,IACN,UAAU;AAAA,IACV,SAAS;AAAA,MACP;AAAA,QACE,IAAI;AAAA,QACJ,UAAU;AAAA,QACV,SAAS;AAAA,QACT,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,UAAU;AAAA,IACV,mBAAmB;AAAA,EACrB;AACF;AAEA,IAAO,wBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|