@nextsparkjs/core 0.1.0-beta.185 → 0.1.0-beta.187
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/app/guards/DeveloperGuard.d.ts.map +1 -1
- package/dist/components/app/guards/DeveloperGuard.js +8 -4
- package/dist/components/app/guards/SuperAdminGuard.d.ts.map +1 -1
- package/dist/components/app/guards/SuperAdminGuard.js +8 -4
- package/dist/components/app/layouts/PublicFooter.d.ts.map +1 -1
- package/dist/components/app/layouts/PublicFooter.js +2 -2
- package/dist/components/app/layouts/PublicNavbar.d.ts.map +1 -1
- package/dist/components/app/layouts/PublicNavbar.js +2 -2
- package/dist/components/app/misc/ThemeToggle.d.ts.map +1 -1
- package/dist/components/app/misc/ThemeToggle.js +4 -1
- package/dist/components/auth/DevKeyring.d.ts.map +1 -1
- package/dist/components/auth/DevKeyring.js +10 -2
- package/dist/components/auth/SessionCookieRefresher.d.ts +21 -0
- package/dist/components/auth/SessionCookieRefresher.d.ts.map +1 -0
- package/dist/components/auth/SessionCookieRefresher.js +11 -0
- package/dist/components/auth/forms/LoginForm.d.ts.map +1 -1
- package/dist/components/auth/forms/LoginForm.js +300 -6
- package/dist/components/auth/index.d.ts +1 -0
- package/dist/components/auth/index.d.ts.map +1 -1
- package/dist/components/auth/index.js +2 -0
- package/dist/components/billing/InvoicesTable.d.ts.map +1 -1
- package/dist/components/billing/InvoicesTable.js +4 -3
- package/dist/components/dashboard/block-editor/dynamic-form.d.ts.map +1 -1
- package/dist/components/dashboard/layouts/AuthGuard.d.ts.map +1 -1
- package/dist/components/dashboard/layouts/AuthGuard.js +2 -2
- package/dist/components/dashboard/layouts/DashboardAuthLayout.d.ts.map +1 -1
- package/dist/components/dashboard/layouts/DashboardAuthLayout.js +2 -2
- package/dist/components/dashboard/layouts/DashboardAuthSkeleton.d.ts +17 -0
- package/dist/components/dashboard/layouts/DashboardAuthSkeleton.d.ts.map +1 -0
- package/dist/components/dashboard/layouts/DashboardAuthSkeleton.js +52 -0
- package/dist/components/dashboard/layouts/Sidebar.d.ts.map +1 -1
- package/dist/components/dashboard/layouts/Sidebar.js +2 -3
- package/dist/components/dashboard/layouts/TopNavbar.js +2 -2
- package/dist/components/dashboard/layouts/index.d.ts +1 -0
- package/dist/components/dashboard/layouts/index.d.ts.map +1 -1
- package/dist/components/dashboard/layouts/index.js +2 -0
- package/dist/components/devtools/api-explorer/ApiExplorer.js +4 -4
- package/dist/components/entities/EntityFieldRenderer.d.ts.map +1 -1
- package/dist/components/entities/EntityFieldRenderer.js +3 -0
- package/dist/components/entities/EntityTable.d.ts.map +1 -1
- package/dist/components/entities/EntityTable.js +2 -1
- package/dist/components/entities/wrappers/EntityFormWrapper.d.ts.map +1 -1
- package/dist/components/entities/wrappers/EntityFormWrapper.js +7 -2
- package/dist/components/patterns/pages/PatternEditPage.d.ts +5 -1
- package/dist/components/patterns/pages/PatternEditPage.d.ts.map +1 -1
- package/dist/components/patterns/pages/PatternEditPage.js +16 -5
- package/dist/components/patterns/pages/PatternsCreatePage.d.ts +2 -1
- package/dist/components/patterns/pages/PatternsCreatePage.d.ts.map +1 -1
- package/dist/components/patterns/pages/PatternsCreatePage.js +17 -5
- package/dist/components/ui/combobox.d.ts +8 -1
- package/dist/components/ui/combobox.d.ts.map +1 -1
- package/dist/components/ui/combobox.js +37 -44
- package/dist/components/ui/country-select.d.ts +3 -1
- package/dist/components/ui/country-select.d.ts.map +1 -1
- package/dist/components/ui/country-select.js +3 -1
- package/dist/components/ui/currency-select.d.ts +3 -1
- package/dist/components/ui/currency-select.d.ts.map +1 -1
- package/dist/components/ui/currency-select.js +3 -1
- package/dist/components/ui/sheet.d.ts +5 -0
- package/dist/components/ui/sheet.d.ts.map +1 -1
- package/dist/components/ui/sheet.js +46 -26
- package/dist/components/ui/timezone-select.d.ts +3 -1
- package/dist/components/ui/timezone-select.d.ts.map +1 -1
- package/dist/components/ui/timezone-select.js +3 -1
- package/dist/contexts/TeamContext.d.ts +6 -0
- package/dist/contexts/TeamContext.d.ts.map +1 -1
- package/dist/contexts/TeamContext.js +8 -1
- package/dist/emails/otp-verification.d.ts.map +1 -1
- package/dist/emails/reset-password.d.ts.map +1 -1
- package/dist/emails/team-invitation.d.ts.map +1 -1
- package/dist/emails/team-invitation.js +3 -2
- package/dist/emails/verify-email.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useAuth.d.ts +29 -0
- package/dist/hooks/useAuth.d.ts.map +1 -1
- package/dist/hooks/useAuth.js +24 -0
- package/dist/hooks/useEnsureUserMetadata.d.ts +22 -0
- package/dist/hooks/useEnsureUserMetadata.d.ts.map +1 -1
- package/dist/hooks/useEnsureUserMetadata.js +18 -5
- package/dist/hooks/useSessionCookieRefresh.d.ts +35 -0
- package/dist/hooks/useSessionCookieRefresh.d.ts.map +1 -0
- package/dist/hooks/useSessionCookieRefresh.js +49 -0
- package/dist/lib/api/api-error.d.ts +3 -1
- package/dist/lib/api/api-error.d.ts.map +1 -1
- package/dist/lib/api/api-error.js +4 -2
- package/dist/lib/api/auth/dual-auth.d.ts +38 -3
- package/dist/lib/api/auth/dual-auth.d.ts.map +1 -1
- package/dist/lib/api/auth/dual-auth.js +42 -7
- package/dist/lib/api/auth/permissions.d.ts +7 -2
- package/dist/lib/api/auth/permissions.d.ts.map +1 -1
- package/dist/lib/api/auth/permissions.js +2 -2
- package/dist/lib/api/auth/scope-policy.d.ts +71 -0
- package/dist/lib/api/auth/scope-policy.d.ts.map +1 -0
- package/dist/lib/api/auth/scope-policy.js +53 -0
- package/dist/lib/api/auth.d.ts +15 -0
- package/dist/lib/api/auth.d.ts.map +1 -1
- package/dist/lib/api/auth.js +17 -4
- package/dist/lib/api/entities.js +2 -1
- package/dist/lib/api/entity/audit-log.d.ts +35 -0
- package/dist/lib/api/entity/audit-log.d.ts.map +1 -0
- package/dist/lib/api/entity/audit-log.js +35 -0
- package/dist/lib/api/entity/generic-handler.d.ts.map +1 -1
- package/dist/lib/api/entity/generic-handler.js +333 -138
- package/dist/lib/api/entity-handler.js +2 -2
- package/dist/lib/api/helpers.d.ts +29 -4
- package/dist/lib/api/helpers.d.ts.map +1 -1
- package/dist/lib/api/helpers.js +30 -6
- package/dist/lib/api/keys.d.ts +16 -0
- package/dist/lib/api/keys.d.ts.map +1 -1
- package/dist/lib/api/keys.js +19 -1
- package/dist/lib/api/routes/patterns-usages.d.ts.map +1 -1
- package/dist/lib/api/routes/patterns-usages.js +3 -11
- package/dist/lib/auth/auth-methods.d.ts +52 -0
- package/dist/lib/auth/auth-methods.d.ts.map +1 -0
- package/dist/lib/auth/auth-methods.js +63 -0
- package/dist/lib/auth/registration-guard-plugin.d.ts.map +1 -1
- package/dist/lib/auth/registration-helpers.d.ts +9 -0
- package/dist/lib/auth/registration-helpers.d.ts.map +1 -1
- package/dist/lib/auth/registration-helpers.js +8 -2
- package/dist/lib/auth/security-notifications/device-fingerprint.d.ts +52 -0
- package/dist/lib/auth/security-notifications/device-fingerprint.d.ts.map +1 -0
- package/dist/lib/auth/security-notifications/device-fingerprint.js +42 -0
- package/dist/lib/auth/security-notifications/dispatcher.d.ts +37 -0
- package/dist/lib/auth/security-notifications/dispatcher.d.ts.map +1 -0
- package/dist/lib/auth/security-notifications/dispatcher.js +157 -0
- package/dist/lib/auth/security-notifications/index.d.ts +20 -0
- package/dist/lib/auth/security-notifications/index.d.ts.map +1 -0
- package/dist/lib/auth/security-notifications/index.js +22 -0
- package/dist/lib/auth/security-notifications/registry.d.ts +36 -0
- package/dist/lib/auth/security-notifications/registry.d.ts.map +1 -0
- package/dist/lib/auth/security-notifications/registry.js +26 -0
- package/dist/lib/auth/security-notifications/templates/email-changed.d.ts +12 -0
- package/dist/lib/auth/security-notifications/templates/email-changed.d.ts.map +1 -0
- package/dist/lib/auth/security-notifications/templates/email-changed.js +43 -0
- package/dist/lib/auth/security-notifications/templates/new-device-login.d.ts +7 -0
- package/dist/lib/auth/security-notifications/templates/new-device-login.d.ts.map +1 -0
- package/dist/lib/auth/security-notifications/templates/new-device-login.js +46 -0
- package/dist/lib/auth/security-notifications/templates/password-changed.d.ts +7 -0
- package/dist/lib/auth/security-notifications/templates/password-changed.d.ts.map +1 -0
- package/dist/lib/auth/security-notifications/templates/password-changed.js +35 -0
- package/dist/lib/auth/security-notifications/templates/shared.d.ts +36 -0
- package/dist/lib/auth/security-notifications/templates/shared.d.ts.map +1 -0
- package/dist/lib/auth/security-notifications/templates/shared.js +68 -0
- package/dist/lib/auth/security-notifications/types.d.ts +74 -0
- package/dist/lib/auth/security-notifications/types.d.ts.map +1 -0
- package/dist/lib/auth/session-config.d.ts +37 -0
- package/dist/lib/auth/session-config.d.ts.map +1 -0
- package/dist/lib/auth/session-config.js +59 -0
- package/dist/lib/auth/session-refresh.d.ts +46 -0
- package/dist/lib/auth/session-refresh.d.ts.map +1 -0
- package/dist/lib/auth/session-refresh.js +11 -0
- package/dist/lib/auth-client.d.ts +1639 -0
- package/dist/lib/auth-client.d.ts.map +1 -0
- package/dist/lib/auth-client.js +13 -1
- package/dist/lib/auth.d.ts.map +1 -1
- package/dist/lib/auth.js +45 -11
- package/dist/lib/billing/gateways/factory.d.ts +8 -3
- package/dist/lib/billing/gateways/factory.d.ts.map +1 -1
- package/dist/lib/billing/gateways/factory.js +37 -23
- package/dist/lib/billing/stripe-webhook.d.ts.map +1 -1
- package/dist/lib/billing/stripe-webhook.js +2 -1
- package/dist/lib/config/app.config.d.ts.map +1 -1
- package/dist/lib/config/app.config.js +71 -0
- package/dist/lib/config/config-sync.d.ts +1 -4
- package/dist/lib/config/config-sync.d.ts.map +1 -1
- package/dist/lib/config/config-sync.js +6 -2
- package/dist/lib/config/types.d.ts +130 -0
- package/dist/lib/config/types.d.ts.map +1 -1
- package/dist/lib/email/templates.d.ts +3 -3
- package/dist/lib/email/templates.d.ts.map +1 -1
- package/dist/lib/entities/api-generator.js +5 -5
- package/dist/lib/entities/entity-hooks.d.ts +9 -1
- package/dist/lib/entities/entity-hooks.d.ts.map +1 -1
- package/dist/lib/entities/entity-hooks.js +77 -4
- package/dist/lib/entities/schema-generator.d.ts.map +1 -1
- package/dist/lib/entities/schema-generator.js +20 -4
- package/dist/lib/entities/serialization.d.ts +2 -2
- package/dist/lib/entities/serialization.d.ts.map +1 -1
- package/dist/lib/entities/serialization.js +3 -2
- package/dist/lib/entities/types.d.ts +20 -0
- package/dist/lib/entities/types.d.ts.map +1 -1
- package/dist/lib/locale.d.ts.map +1 -1
- package/dist/lib/locale.js +4 -1
- package/dist/lib/mcp/audit.d.ts +8 -4
- package/dist/lib/mcp/audit.d.ts.map +1 -1
- package/dist/lib/plugins/hook-system.d.ts +13 -0
- package/dist/lib/plugins/hook-system.d.ts.map +1 -1
- package/dist/lib/plugins/hook-system.js +32 -2
- package/dist/lib/scheduled-actions/handlers/index.d.ts +1 -0
- package/dist/lib/scheduled-actions/handlers/index.d.ts.map +1 -1
- package/dist/lib/scheduled-actions/handlers/index.js +3 -1
- package/dist/lib/scheduled-actions/handlers/security-notification.d.ts +26 -0
- package/dist/lib/scheduled-actions/handlers/security-notification.d.ts.map +1 -0
- package/dist/lib/scheduled-actions/handlers/security-notification.js +54 -0
- package/dist/lib/selectors/core-selectors.d.ts +12 -0
- package/dist/lib/selectors/core-selectors.d.ts.map +1 -1
- package/dist/lib/selectors/domains/auth.selectors.d.ts +12 -0
- package/dist/lib/selectors/domains/auth.selectors.d.ts.map +1 -1
- package/dist/lib/selectors/domains/auth.selectors.js +14 -1
- package/dist/lib/selectors/selectors.d.ts +24 -0
- package/dist/lib/selectors/selectors.d.ts.map +1 -1
- package/dist/lib/services/api-docs.service.d.ts +5 -1
- package/dist/lib/services/api-docs.service.d.ts.map +1 -1
- package/dist/lib/services/api-presets.service.d.ts +6 -1
- package/dist/lib/services/api-presets.service.d.ts.map +1 -1
- package/dist/lib/services/feature.service.d.ts +58 -4
- package/dist/lib/services/feature.service.d.ts.map +1 -1
- package/dist/lib/services/generic-entity.service.d.ts.map +1 -1
- package/dist/lib/services/generic-entity.service.js +16 -32
- package/dist/lib/services/membership.service.d.ts +10 -2
- package/dist/lib/services/membership.service.d.ts.map +1 -1
- package/dist/lib/services/membership.service.js +37 -16
- package/dist/lib/services/permission.service.d.ts +10 -4
- package/dist/lib/services/permission.service.d.ts.map +1 -1
- package/dist/lib/services/plugin.service.d.ts +1 -1
- package/dist/lib/services/plugin.service.d.ts.map +1 -1
- package/dist/lib/services/subscription.service.d.ts.map +1 -1
- package/dist/lib/services/subscription.service.js +2 -1
- package/dist/lib/services/team-member.service.d.ts +15 -3
- package/dist/lib/services/team-member.service.d.ts.map +1 -1
- package/dist/lib/services/team-member.service.js +27 -6
- package/dist/lib/services/team.service.d.ts.map +1 -1
- package/dist/lib/teams/permissions.d.ts +3 -1
- package/dist/lib/teams/permissions.d.ts.map +1 -1
- package/dist/lib/teams/permissions.js +6 -0
- package/dist/lib/teams/schema.d.ts.map +1 -1
- package/dist/lib/teams/schema.js +3 -0
- package/dist/lib/template-resolver.d.ts +3 -3
- package/dist/lib/theme/forced-theme.d.ts +34 -0
- package/dist/lib/theme/forced-theme.d.ts.map +1 -0
- package/dist/lib/theme/forced-theme.js +27 -0
- package/dist/lib/theme/get-default-theme-mode.d.ts +3 -0
- package/dist/lib/theme/get-default-theme-mode.d.ts.map +1 -1
- package/dist/lib/theme/get-default-theme-mode.js +5 -3
- package/dist/lib/utils/cors.d.ts +13 -0
- package/dist/lib/utils/cors.d.ts.map +1 -1
- package/dist/lib/utils/cors.js +20 -0
- package/dist/messages/de/auth.json +25 -2
- package/dist/messages/de/index.d.ts +83 -0
- package/dist/messages/de/index.d.ts.map +1 -1
- package/dist/messages/de/index.js +2 -0
- package/dist/messages/de/index.ts +2 -0
- package/dist/messages/de/navigation.json +3 -1
- package/dist/messages/en/auth.json +25 -2
- package/dist/messages/en/index.d.ts +83 -0
- package/dist/messages/en/index.d.ts.map +1 -1
- package/dist/messages/en/index.js +2 -0
- package/dist/messages/en/index.ts +2 -0
- package/dist/messages/en/navigation.json +3 -1
- package/dist/messages/es/auth.json +25 -2
- package/dist/messages/es/index.d.ts +83 -0
- package/dist/messages/es/index.d.ts.map +1 -1
- package/dist/messages/es/index.js +2 -0
- package/dist/messages/es/index.ts +2 -0
- package/dist/messages/es/navigation.json +3 -1
- package/dist/messages/fr/auth.json +25 -2
- package/dist/messages/fr/index.d.ts +83 -0
- package/dist/messages/fr/index.d.ts.map +1 -1
- package/dist/messages/fr/index.js +2 -0
- package/dist/messages/fr/index.ts +2 -0
- package/dist/messages/fr/navigation.json +3 -1
- package/dist/messages/it/auth.json +25 -2
- package/dist/messages/it/index.d.ts +83 -0
- package/dist/messages/it/index.d.ts.map +1 -1
- package/dist/messages/it/index.js +2 -0
- package/dist/messages/it/index.ts +2 -0
- package/dist/messages/it/navigation.json +3 -1
- package/dist/messages/pt/auth.json +25 -2
- package/dist/messages/pt/index.d.ts +83 -0
- package/dist/messages/pt/index.d.ts.map +1 -1
- package/dist/messages/pt/index.js +2 -0
- package/dist/messages/pt/index.ts +2 -0
- package/dist/messages/pt/navigation.json +3 -1
- package/dist/migrations/005_api_audit_log.sql +2 -1
- package/dist/migrations/025_api_audit_log_nullable_api_key.sql +12 -0
- package/dist/migrations/026_login_events.sql +91 -0
- package/dist/migrations/027_rls_bypass_developer_and_system_admin_team.sql +197 -0
- package/dist/nextspark-registries.d.ts +580 -236
- package/dist/providers/DashboardProviders.d.ts +12 -3
- package/dist/providers/DashboardProviders.d.ts.map +1 -1
- package/dist/providers/DashboardProviders.js +6 -2
- package/dist/providers/theme-provider.d.ts +19 -2
- package/dist/providers/theme-provider.d.ts.map +1 -1
- package/dist/providers/theme-provider.js +6 -2
- package/dist/templates/app/(auth)/signup/page.tsx +8 -0
- package/dist/templates/app/(public)/[...slug]/page.tsx +9 -14
- package/dist/templates/app/api/auth/[...all]/route.ts +23 -1
- package/dist/templates/app/api/health/route.ts +4 -2
- package/dist/templates/app/api/internal/user-metadata/route.ts +5 -3
- package/dist/templates/app/api/mcp/route.ts +4 -1
- package/dist/templates/app/api/superadmin/subscriptions/route.ts +2 -1
- package/dist/templates/app/api/superadmin/teams/[teamId]/route.ts +4 -3
- package/dist/templates/app/api/superadmin/users/[userId]/route.ts +10 -3
- package/dist/templates/app/api/v1/api-keys/[id]/route.ts +50 -71
- package/dist/templates/app/api/v1/api-keys/route.ts +21 -43
- package/dist/templates/app/api/v1/auth/signup-with-invite/route.ts +14 -14
- package/dist/templates/app/api/v1/billing/cancel/route.ts +7 -6
- package/dist/templates/app/api/v1/billing/change-plan/route.ts +5 -4
- package/dist/templates/app/api/v1/billing/check-action/route.ts +6 -4
- package/dist/templates/app/api/v1/billing/checkout/route.ts +7 -5
- package/dist/templates/app/api/v1/billing/plans/route.ts +8 -12
- package/dist/templates/app/api/v1/billing/portal/route.ts +7 -5
- package/dist/templates/app/api/v1/billing/webhooks/polar/route.ts +1 -1
- package/dist/templates/app/api/v1/devtools/blocks/route.ts +5 -4
- package/dist/templates/app/api/v1/devtools/features/route.ts +5 -4
- package/dist/templates/app/api/v1/devtools/flows/route.ts +5 -4
- package/dist/templates/app/api/v1/devtools/scheduled-actions/route.ts +9 -7
- package/dist/templates/app/api/v1/devtools/scheduled-actions/run/route.ts +5 -4
- package/dist/templates/app/api/v1/devtools/testing/route.ts +5 -4
- package/dist/templates/app/api/v1/media/[id]/route.ts +13 -25
- package/dist/templates/app/api/v1/media/[id]/tags/route.ts +17 -25
- package/dist/templates/app/api/v1/media/check-duplicates/route.ts +5 -7
- package/dist/templates/app/api/v1/media/route.ts +5 -9
- package/dist/templates/app/api/v1/media/upload/route.ts +9 -21
- package/dist/templates/app/api/v1/media-tags/route.ts +9 -13
- package/dist/templates/app/api/v1/patterns/[id]/usages/route.ts +11 -19
- package/dist/templates/app/api/v1/post-categories/[id]/route.ts +9 -7
- package/dist/templates/app/api/v1/post-categories/route.ts +5 -4
- package/dist/templates/app/api/v1/team-invitations/[token]/accept/route.ts +16 -18
- package/dist/templates/app/api/v1/team-invitations/[token]/decline/route.ts +15 -17
- package/dist/templates/app/api/v1/team-invitations/[token]/route.ts +8 -8
- package/dist/templates/app/api/v1/team-invitations/route.ts +9 -11
- package/dist/templates/app/api/v1/teams/[teamId]/invitations/route.ts +41 -32
- package/dist/templates/app/api/v1/teams/[teamId]/invoices/[invoiceNumber]/route.ts +15 -16
- package/dist/templates/app/api/v1/teams/[teamId]/invoices/route.ts +14 -15
- package/dist/templates/app/api/v1/teams/[teamId]/members/[memberId]/route.ts +32 -36
- package/dist/templates/app/api/v1/teams/[teamId]/members/route.ts +33 -33
- package/dist/templates/app/api/v1/teams/[teamId]/route.ts +35 -41
- package/dist/templates/app/api/v1/teams/[teamId]/subscription/route.ts +5 -3
- package/dist/templates/app/api/v1/teams/[teamId]/usage/[limitSlug]/route.ts +10 -6
- package/dist/templates/app/api/v1/teams/route.ts +33 -27
- package/dist/templates/app/api/v1/teams/switch/route.ts +11 -13
- package/dist/templates/app/api/v1/theme/[...path]/route.ts +23 -2
- package/dist/templates/app/api/v1/users/[id]/meta/[key]/route.ts +32 -77
- package/dist/templates/app/api/v1/users/[id]/route.ts +35 -68
- package/dist/templates/app/api/v1/users/route.ts +21 -25
- package/dist/templates/app/dashboard/layout.tsx +2 -6
- package/dist/templates/app/layout.ppr.tsx +15 -15
- package/dist/templates/app/layout.tsx +46 -20
- package/dist/templates/contents/themes/starter/config/app.config.ts +19 -0
- package/dist/templates/contents/themes/starter/config/theme.config.ts +6 -0
- package/dist/templates/contents/themes/starter/styles/globals.css +6 -2
- package/dist/templates/proxy.ts +46 -10
- package/dist/templates/tsconfig.json +4 -0
- package/dist/types/theme.d.ts +9 -0
- package/dist/types/theme.d.ts.map +1 -1
- package/migrations/005_api_audit_log.sql +2 -1
- package/migrations/025_api_audit_log_nullable_api_key.sql +12 -0
- package/migrations/026_login_events.sql +91 -0
- package/migrations/027_rls_bypass_developer_and_system_admin_team.sql +197 -0
- package/package.json +14 -11
- package/scripts/build/registry/__tests__/scope-registry.test.mjs +18 -0
- package/scripts/build/registry/generators/scope-registry.mjs +9 -2
- package/templates/app/(auth)/signup/page.tsx +8 -0
- package/templates/app/(public)/[...slug]/page.tsx +9 -14
- package/templates/app/api/auth/[...all]/route.ts +23 -1
- package/templates/app/api/health/route.ts +4 -2
- package/templates/app/api/internal/user-metadata/route.ts +5 -3
- package/templates/app/api/mcp/route.ts +4 -1
- package/templates/app/api/superadmin/subscriptions/route.ts +2 -1
- package/templates/app/api/superadmin/teams/[teamId]/route.ts +4 -3
- package/templates/app/api/superadmin/users/[userId]/route.ts +10 -3
- package/templates/app/api/v1/api-keys/[id]/route.ts +50 -71
- package/templates/app/api/v1/api-keys/route.ts +21 -43
- package/templates/app/api/v1/auth/signup-with-invite/route.ts +14 -14
- package/templates/app/api/v1/billing/cancel/route.ts +7 -6
- package/templates/app/api/v1/billing/change-plan/route.ts +5 -4
- package/templates/app/api/v1/billing/check-action/route.ts +6 -4
- package/templates/app/api/v1/billing/checkout/route.ts +7 -5
- package/templates/app/api/v1/billing/plans/route.ts +8 -12
- package/templates/app/api/v1/billing/portal/route.ts +7 -5
- package/templates/app/api/v1/billing/webhooks/polar/route.ts +1 -1
- package/templates/app/api/v1/devtools/blocks/route.ts +5 -4
- package/templates/app/api/v1/devtools/features/route.ts +5 -4
- package/templates/app/api/v1/devtools/flows/route.ts +5 -4
- package/templates/app/api/v1/devtools/scheduled-actions/route.ts +9 -7
- package/templates/app/api/v1/devtools/scheduled-actions/run/route.ts +5 -4
- package/templates/app/api/v1/devtools/testing/route.ts +5 -4
- package/templates/app/api/v1/media/[id]/route.ts +13 -25
- package/templates/app/api/v1/media/[id]/tags/route.ts +17 -25
- package/templates/app/api/v1/media/check-duplicates/route.ts +5 -7
- package/templates/app/api/v1/media/route.ts +5 -9
- package/templates/app/api/v1/media/upload/route.ts +9 -21
- package/templates/app/api/v1/media-tags/route.ts +9 -13
- package/templates/app/api/v1/patterns/[id]/usages/route.ts +11 -19
- package/templates/app/api/v1/post-categories/[id]/route.ts +9 -7
- package/templates/app/api/v1/post-categories/route.ts +5 -4
- package/templates/app/api/v1/team-invitations/[token]/accept/route.ts +16 -18
- package/templates/app/api/v1/team-invitations/[token]/decline/route.ts +15 -17
- package/templates/app/api/v1/team-invitations/[token]/route.ts +8 -8
- package/templates/app/api/v1/team-invitations/route.ts +9 -11
- package/templates/app/api/v1/teams/[teamId]/invitations/route.ts +41 -32
- package/templates/app/api/v1/teams/[teamId]/invoices/[invoiceNumber]/route.ts +15 -16
- package/templates/app/api/v1/teams/[teamId]/invoices/route.ts +14 -15
- package/templates/app/api/v1/teams/[teamId]/members/[memberId]/route.ts +32 -36
- package/templates/app/api/v1/teams/[teamId]/members/route.ts +33 -33
- package/templates/app/api/v1/teams/[teamId]/route.ts +35 -41
- package/templates/app/api/v1/teams/[teamId]/subscription/route.ts +5 -3
- package/templates/app/api/v1/teams/[teamId]/usage/[limitSlug]/route.ts +10 -6
- package/templates/app/api/v1/teams/route.ts +33 -27
- package/templates/app/api/v1/teams/switch/route.ts +11 -13
- package/templates/app/api/v1/theme/[...path]/route.ts +23 -2
- package/templates/app/api/v1/users/[id]/meta/[key]/route.ts +32 -77
- package/templates/app/api/v1/users/[id]/route.ts +35 -68
- package/templates/app/api/v1/users/route.ts +21 -25
- package/templates/app/dashboard/layout.tsx +2 -6
- package/templates/app/layout.ppr.tsx +15 -15
- package/templates/app/layout.tsx +46 -20
- package/templates/contents/themes/starter/config/app.config.ts +19 -0
- package/templates/contents/themes/starter/config/theme.config.ts +6 -0
- package/templates/contents/themes/starter/styles/globals.css +6 -2
- package/templates/proxy.ts +46 -10
- package/templates/tsconfig.json +4 -0
- package/tests/jest/__mocks__/@nextsparkjs/registries/permissions-registry.ts +23 -0
- package/tests/jest/__mocks__/next-server.js +24 -0
- package/dist/components/teams/TeamSwitchModal.d.js +0 -0
- package/dist/components/ui/accordion.d.js +0 -0
- package/dist/components/ui/avatar.d.js +0 -0
- package/dist/components/ui/badge.d.js +0 -0
- package/dist/components/ui/button.d.js +0 -0
- package/dist/components/ui/card.d.js +0 -0
- package/dist/components/ui/dialog.d.js +0 -0
- package/dist/components/ui/dropdown-menu.d.js +0 -0
- package/dist/components/ui/input.d.js +0 -0
- package/dist/components/ui/progress.d.js +0 -0
- package/dist/components/ui/scroll-area.d.js +0 -0
- package/dist/components/ui/select.d.js +0 -0
- package/dist/components/ui/separator.d.js +0 -0
- package/dist/components/ui/table.d.js +0 -0
- package/dist/components/ui/textarea.d.js +0 -0
- package/dist/contexts/TeamContext.d.js +0 -0
- package/dist/hooks/useAuth.d.js +0 -0
- package/dist/hooks/useLastAuthMethod.d.js +0 -0
- package/dist/hooks/useOrigin.d.js +0 -0
- package/dist/lib/api/auth/dual-auth.d.js +0 -0
- package/dist/lib/api/auth.d.js +0 -0
- package/dist/lib/api/cache.d.js +0 -0
- package/dist/lib/api/keys.d.js +0 -0
- package/dist/lib/auth-client.d.js +0 -0
- package/dist/lib/auth-context.d.js +0 -0
- package/dist/lib/auth.d.js +0 -0
- package/dist/lib/billing/config-types.d.js +0 -0
- package/dist/lib/billing/enforcement.d.js +0 -0
- package/dist/lib/billing/helpers.d.js +0 -0
- package/dist/lib/billing/jobs.d.js +0 -0
- package/dist/lib/billing/types.d.js +0 -0
- package/dist/lib/blocks/loader.d.js +0 -0
- package/dist/lib/config/app.config.d.js +0 -0
- package/dist/lib/config/config-loader.d.js +0 -0
- package/dist/lib/config/config-sync.d.js +0 -0
- package/dist/lib/config/config-types.d.js +0 -0
- package/dist/lib/config/config-utils.d.js +0 -0
- package/dist/lib/config/dashboard-types.d.js +0 -0
- package/dist/lib/config/dashboard.config.d.js +0 -0
- package/dist/lib/config/icon-map.d.js +0 -0
- package/dist/lib/config/index.d.js +0 -7
- package/dist/lib/config/nextspark-types.d.js +0 -0
- package/dist/lib/config/roles-merge.d.js +0 -0
- package/dist/lib/config/types.d.js +0 -0
- package/dist/lib/db.d.js +0 -0
- package/dist/lib/email/factory.d.js +0 -0
- package/dist/lib/email/index.d.js +0 -3
- package/dist/lib/email/providers/console.d.js +0 -0
- package/dist/lib/email/providers/resend.d.js +0 -0
- package/dist/lib/email/templates.d.js +0 -0
- package/dist/lib/email/types.d.js +0 -0
- package/dist/lib/entities/types.d.js +0 -0
- package/dist/lib/permissions/system.d.js +0 -0
- package/dist/lib/permissions/types.d.js +0 -0
- package/dist/lib/plugins/hook-system.d.js +0 -0
- package/dist/lib/scheduled-actions/cleanup.d.js +0 -0
- package/dist/lib/scheduled-actions/index.d.js +0 -19
- package/dist/lib/scheduled-actions/initializer.d.js +0 -1
- package/dist/lib/scheduled-actions/processor.d.js +0 -0
- package/dist/lib/scheduled-actions/registry.d.js +0 -0
- package/dist/lib/scheduled-actions/scheduler.d.js +0 -0
- package/dist/lib/scheduled-actions/types.d.js +0 -0
- package/dist/lib/services/api-routes.service.d.js +0 -0
- package/dist/lib/services/entity-type.service.d.js +0 -0
- package/dist/lib/services/index.d.js +0 -40
- package/dist/lib/services/invoice.service.d.js +0 -0
- package/dist/lib/services/membership.service.d.js +0 -0
- package/dist/lib/services/meta.service.d.js +0 -0
- package/dist/lib/services/middleware.service.d.js +0 -0
- package/dist/lib/services/namespace.service.d.js +0 -0
- package/dist/lib/services/permission.service.d.js +0 -0
- package/dist/lib/services/plan.service.d.js +0 -0
- package/dist/lib/services/plugin.service.d.js +0 -0
- package/dist/lib/services/route-handler.service.d.js +0 -0
- package/dist/lib/services/scope.service.d.js +0 -0
- package/dist/lib/services/subscription.service.d.js +0 -0
- package/dist/lib/services/team-member.service.d.js +0 -0
- package/dist/lib/services/team.service.d.js +0 -0
- package/dist/lib/services/theme.service.d.js +0 -0
- package/dist/lib/services/usage.service.d.js +0 -0
- package/dist/lib/services/user-flags.service.d.js +0 -0
- package/dist/lib/services/user.service.d.js +0 -0
- package/dist/lib/teams/helpers.d.js +0 -0
- package/dist/lib/teams/permissions.d.js +0 -0
- package/dist/lib/teams/types.d.js +0 -0
- package/dist/lib/utils/config-merge.d.js +0 -0
- package/dist/lib/utils/file-logger.d.js +0 -0
- package/dist/lib/utils.d.js +0 -0
- package/dist/styles/classes.json +0 -1093
- package/dist/styles/ui.css +0 -2
- package/dist/types/auth.d.js +0 -0
- package/dist/types/blocks.d.js +0 -0
- package/dist/types/meta.types.d.js +0 -0
- package/dist/types/plugin.d.js +0 -0
- package/dist/types/testing.types.d.js +0 -0
- package/dist/types/theme.d.js +0 -0
- package/dist/types/user.types.d.js +0 -0
- package/scripts/build/build-ui-css.mjs +0 -351
- /package/dist/{components/app/layouts/PublicFooter.d.js → lib/auth/security-notifications/types.js} +0 -0
- /package/dist/{components/app/layouts/PublicNavbar.d.js → nextspark-registries.d.js} +0 -0
- /package/dist/{components/app/misc/ThemeToggle.d.js → types/use-intl-react-shim.d.js} +0 -0
|
@@ -1,52 +1,77 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Ambient type declarations for @
|
|
2
|
+
* Ambient type declarations for @nextsparkjs/registries/*
|
|
3
3
|
*
|
|
4
|
-
* These modules are
|
|
5
|
-
*
|
|
4
|
+
* These modules are virtual: a consumer project generates their real content
|
|
5
|
+
* (via `nextspark registry:build`) into `.nextspark/registries/` at build
|
|
6
|
+
* time. `packages/core` imports from them in its own source but never
|
|
7
|
+
* generates them itself, so it needs these ambient declarations to
|
|
8
|
+
* typecheck in isolation.
|
|
9
|
+
*
|
|
10
|
+
* Reconciled against the actual import surface in `packages/core/src`
|
|
11
|
+
* (see #131) — every module/export here is backed by a real `import` in the
|
|
12
|
+
* source tree, not aspirational. If you add a new import from
|
|
13
|
+
* `@nextsparkjs/registries/*`, add its shape here too.
|
|
6
14
|
*
|
|
7
|
-
* This file provides TypeScript with the type information it needs for compilation.
|
|
8
15
|
* NOTE: This file must NOT have any imports to work as global declarations.
|
|
9
16
|
*/
|
|
10
17
|
|
|
11
18
|
// ============================================================================
|
|
12
19
|
// Billing Registry
|
|
13
20
|
// ============================================================================
|
|
14
|
-
declare module '@
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
interval: 'month' | 'year'
|
|
22
|
-
features: string[]
|
|
23
|
-
limits?: Record<string, number>
|
|
24
|
-
visibility?: 'public' | 'private'
|
|
25
|
-
}
|
|
21
|
+
declare module '@nextsparkjs/registries/billing-registry' {
|
|
22
|
+
// Mirrors packages/core/src/lib/billing/config-types.ts exactly (not
|
|
23
|
+
// imported — see permissions-registry above for why): billing/queries.ts
|
|
24
|
+
// type-annotates its return values against that hand-written type.
|
|
25
|
+
export type PlanType = 'free' | 'paid' | 'enterprise'
|
|
26
|
+
export type PlanVisibility = 'public' | 'hidden' | 'invite_only'
|
|
27
|
+
export type PaymentProvider = 'stripe' | 'polar'
|
|
26
28
|
|
|
27
29
|
export interface FeatureDefinition {
|
|
28
|
-
key: string
|
|
29
30
|
name: string
|
|
30
31
|
description?: string
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
export interface LimitDefinition {
|
|
34
|
-
key: string
|
|
35
35
|
name: string
|
|
36
|
-
|
|
37
|
-
resetPeriod
|
|
36
|
+
unit: 'count' | 'bytes' | 'calls'
|
|
37
|
+
resetPeriod: 'never' | 'daily' | 'monthly' | 'yearly'
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface PlanDefinition {
|
|
41
|
+
slug: string
|
|
42
|
+
name: string
|
|
43
|
+
description?: string
|
|
44
|
+
type: PlanType
|
|
45
|
+
visibility?: PlanVisibility
|
|
46
|
+
price?: { monthly: number; yearly: number }
|
|
47
|
+
trialDays?: number
|
|
48
|
+
features: string[]
|
|
49
|
+
limits: Record<string, number>
|
|
50
|
+
providerPriceIds?: { monthly?: string | null; yearly?: string | null }
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface ActionMappings {
|
|
54
|
+
permissions?: Record<string, string>
|
|
55
|
+
features: Record<string, string>
|
|
56
|
+
limits: Record<string, string>
|
|
38
57
|
}
|
|
39
58
|
|
|
40
59
|
export interface BillingConfig {
|
|
41
|
-
|
|
42
|
-
|
|
60
|
+
provider: PaymentProvider
|
|
61
|
+
currency: string
|
|
62
|
+
defaultPlan: string
|
|
43
63
|
plans: PlanDefinition[]
|
|
44
|
-
features: FeatureDefinition
|
|
45
|
-
limits: LimitDefinition
|
|
64
|
+
features: Record<string, FeatureDefinition>
|
|
65
|
+
limits: Record<string, LimitDefinition>
|
|
66
|
+
actionMappings: ActionMappings
|
|
46
67
|
}
|
|
47
68
|
|
|
48
69
|
export const BILLING_REGISTRY: BillingConfig
|
|
49
|
-
|
|
70
|
+
// features[featureSlug][planSlug] -> has feature; limits[limitSlug][planSlug] -> value.
|
|
71
|
+
export const BILLING_MATRIX: {
|
|
72
|
+
features: Record<string, Record<string, boolean>>
|
|
73
|
+
limits: Record<string, Record<string, number>>
|
|
74
|
+
}
|
|
50
75
|
export const PUBLIC_PLANS: readonly PlanDefinition[]
|
|
51
76
|
export const BILLING_METADATA: {
|
|
52
77
|
generatedAt: string
|
|
@@ -58,26 +83,89 @@ declare module '@nextspark/registries/billing-registry' {
|
|
|
58
83
|
// ============================================================================
|
|
59
84
|
// Block Registry
|
|
60
85
|
// ============================================================================
|
|
61
|
-
declare module '@
|
|
62
|
-
|
|
86
|
+
declare module '@nextsparkjs/registries/block-registry' {
|
|
87
|
+
// Mirrors packages/core/src/types/blocks.ts's BlockConfig/FieldDefinition
|
|
88
|
+
// exactly (not imported — see permissions-registry above for why): core's
|
|
89
|
+
// own block.service.ts type-annotates its return values against that
|
|
90
|
+
// hand-written type, so registry values must be structurally identical
|
|
91
|
+
// to it, not just "close enough".
|
|
92
|
+
export type FieldType =
|
|
93
|
+
| 'text' | 'textarea' | 'url' | 'email' | 'number' | 'color' | 'image'
|
|
94
|
+
| 'media-library' | 'select' | 'checkbox' | 'radio' | 'rich-text'
|
|
95
|
+
| 'array' | 'date' | 'time'
|
|
96
|
+
export type FieldTab = 'content' | 'design' | 'advanced'
|
|
97
|
+
|
|
98
|
+
export type BlockCategory =
|
|
99
|
+
| 'hero' | 'content' | 'features' | 'cta' | 'testimonials' | 'media'
|
|
100
|
+
| 'forms' | 'navigation' | 'footer' | 'pricing' | 'team' | 'stats'
|
|
101
|
+
| 'faq' | 'newsletter' | 'other'
|
|
63
102
|
|
|
64
103
|
export interface FieldDefinition {
|
|
65
104
|
name: string
|
|
66
105
|
label: string
|
|
67
|
-
type:
|
|
68
|
-
tab
|
|
106
|
+
type: FieldType
|
|
107
|
+
tab: FieldTab
|
|
69
108
|
required?: boolean
|
|
70
|
-
|
|
109
|
+
default?: unknown
|
|
110
|
+
placeholder?: string
|
|
111
|
+
description?: string
|
|
112
|
+
helpText?: string
|
|
113
|
+
minLength?: number
|
|
114
|
+
maxLength?: number
|
|
115
|
+
rows?: number
|
|
116
|
+
min?: number
|
|
117
|
+
max?: number
|
|
118
|
+
step?: number
|
|
119
|
+
options?: Array<{ label: string; value: string | number }>
|
|
120
|
+
checkboxLabel?: string
|
|
121
|
+
accept?: string
|
|
122
|
+
maxSize?: number
|
|
123
|
+
aspectRatio?: string
|
|
124
|
+
itemType?: FieldType
|
|
125
|
+
itemFields?: FieldDefinition[]
|
|
126
|
+
minItems?: number
|
|
127
|
+
maxItems?: number
|
|
128
|
+
targetEntity?: string
|
|
129
|
+
displayField?: string
|
|
130
|
+
valueField?: string
|
|
131
|
+
relationshipType?: 'manyToOne' | 'manyToMany'
|
|
132
|
+
condition?: {
|
|
133
|
+
field: string
|
|
134
|
+
operator: 'equals' | 'notEquals' | 'contains' | 'greaterThan' | 'lessThan'
|
|
135
|
+
value: unknown
|
|
136
|
+
}
|
|
137
|
+
group?: string
|
|
138
|
+
groupLabel?: string
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export interface BlockExample {
|
|
142
|
+
name: string
|
|
143
|
+
description?: string
|
|
144
|
+
props: Record<string, unknown>
|
|
71
145
|
}
|
|
72
146
|
|
|
73
147
|
export interface BlockConfig {
|
|
74
148
|
slug: string
|
|
75
149
|
name: string
|
|
76
|
-
description
|
|
150
|
+
description: string
|
|
77
151
|
category: BlockCategory
|
|
78
152
|
icon?: string
|
|
79
|
-
|
|
80
|
-
|
|
153
|
+
componentPath?: string
|
|
154
|
+
schemaPath?: string
|
|
155
|
+
fieldsPath?: string
|
|
156
|
+
thumbnail?: string
|
|
157
|
+
fieldDefinitions: FieldDefinition[]
|
|
158
|
+
examples: BlockExample[]
|
|
159
|
+
scope?: Array<'pages' | 'posts' | string>
|
|
160
|
+
allowInPatterns?: boolean
|
|
161
|
+
schemaType?: string
|
|
162
|
+
tags?: string[]
|
|
163
|
+
isCore?: boolean
|
|
164
|
+
source?: 'core' | 'theme' | 'plugin'
|
|
165
|
+
sourceId?: string
|
|
166
|
+
version?: string
|
|
167
|
+
deprecated?: boolean
|
|
168
|
+
replacedBy?: string
|
|
81
169
|
}
|
|
82
170
|
|
|
83
171
|
export const BLOCK_REGISTRY: Record<string, BlockConfig>
|
|
@@ -87,6 +175,12 @@ declare module '@nextspark/registries/block-registry' {
|
|
|
87
175
|
blockCount: number
|
|
88
176
|
categories: string[]
|
|
89
177
|
}
|
|
178
|
+
// Lazy-loaded (client) and eagerly-loaded (SSR) component maps, keyed by
|
|
179
|
+
// block slug — populated by the registry generator, not by core. `any`
|
|
180
|
+
// props are correct here: each block's component has its own distinct
|
|
181
|
+
// props type, unifiable only as `ComponentType<any>` in a shared map.
|
|
182
|
+
export const BLOCK_COMPONENTS: Record<string, React.LazyExoticComponent<React.ComponentType<any>> | React.ComponentType<any>>
|
|
183
|
+
export const BLOCK_COMPONENTS_SSR: Record<string, React.ComponentType<any>>
|
|
90
184
|
|
|
91
185
|
export function getBlock(name: string): BlockConfig | undefined
|
|
92
186
|
export function getBlocksByCategory(category: BlockCategory): BlockConfig[]
|
|
@@ -94,9 +188,11 @@ declare module '@nextspark/registries/block-registry' {
|
|
|
94
188
|
}
|
|
95
189
|
|
|
96
190
|
// ============================================================================
|
|
97
|
-
// Entity Registry (Server)
|
|
191
|
+
// Entity Registry (Server) — declared for completeness; no direct import
|
|
192
|
+
// found in packages/core/src today, but kept in case a consumer-facing
|
|
193
|
+
// contract still expects it.
|
|
98
194
|
// ============================================================================
|
|
99
|
-
declare module '@
|
|
195
|
+
declare module '@nextsparkjs/registries/entity-registry' {
|
|
100
196
|
export interface EntityConfig {
|
|
101
197
|
slug: string
|
|
102
198
|
label: string
|
|
@@ -135,7 +231,7 @@ declare module '@nextspark/registries/entity-registry' {
|
|
|
135
231
|
// ============================================================================
|
|
136
232
|
// Entity Registry (Client)
|
|
137
233
|
// ============================================================================
|
|
138
|
-
declare module '@
|
|
234
|
+
declare module '@nextsparkjs/registries/entity-registry.client' {
|
|
139
235
|
export interface ClientSidebarFieldConfig {
|
|
140
236
|
name: string
|
|
141
237
|
type: string
|
|
@@ -149,20 +245,25 @@ declare module '@nextspark/registries/entity-registry.client' {
|
|
|
149
245
|
}
|
|
150
246
|
|
|
151
247
|
export interface ClientEntityConfig {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
enabled
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
248
|
+
// Matches the REAL shape apps/dev's registry:build actually generates
|
|
249
|
+
// (packages/cli's entity-registry.client.ts template) — verified against
|
|
250
|
+
// a live-regenerated apps/dev/.nextspark/registries/entity-registry.client.ts,
|
|
251
|
+
// not guessed. A prior version of this ambient declaration invented a
|
|
252
|
+
// flat slug/label/labelPlural/enabled/showInMenu shape that never existed
|
|
253
|
+
// anywhere; it went uncaught because none of this package's own
|
|
254
|
+
// ClientEntityConfig consumers happened to read those particular fields
|
|
255
|
+
// (#131 follow-up).
|
|
256
|
+
name: string
|
|
257
|
+
apiPath: string
|
|
258
|
+
displayName: string
|
|
259
|
+
features: {
|
|
260
|
+
enabled: boolean
|
|
261
|
+
showInMenu?: boolean
|
|
262
|
+
canCreate?: boolean
|
|
263
|
+
canEdit?: boolean
|
|
264
|
+
canDelete?: boolean
|
|
265
|
+
searchable?: boolean
|
|
266
|
+
}
|
|
166
267
|
builder?: {
|
|
167
268
|
enabled?: boolean
|
|
168
269
|
sidebarFields?: string[]
|
|
@@ -171,6 +272,12 @@ declare module '@nextspark/registries/entity-registry.client' {
|
|
|
171
272
|
seo?: boolean
|
|
172
273
|
public?: { basePath: string }
|
|
173
274
|
}
|
|
275
|
+
taxonomies?: {
|
|
276
|
+
enabled?: boolean
|
|
277
|
+
types?: Array<{ type: string; label?: string; [key: string]: unknown }>
|
|
278
|
+
[key: string]: unknown
|
|
279
|
+
}
|
|
280
|
+
access?: { basePath?: string; [key: string]: unknown }
|
|
174
281
|
}
|
|
175
282
|
|
|
176
283
|
export interface ClientEntityRegistry {
|
|
@@ -187,289 +294,515 @@ declare module '@nextspark/registries/entity-registry.client' {
|
|
|
187
294
|
export function hasEntity(name: string): boolean
|
|
188
295
|
export function getEntityDisplayName(slug: string): string
|
|
189
296
|
export function getAllEntityConfigs(): ClientEntityConfig[]
|
|
297
|
+
|
|
298
|
+
// Child-entity relation helpers (relation-display, simple-relation-select).
|
|
299
|
+
// Always returns an object (never null) — callers check `.isChild`.
|
|
300
|
+
export interface ParsedChildEntity {
|
|
301
|
+
isChild: boolean
|
|
302
|
+
parentEntity?: string
|
|
303
|
+
childType?: string
|
|
304
|
+
[key: string]: unknown
|
|
305
|
+
}
|
|
306
|
+
export function parseChildEntity(entityType: string): ParsedChildEntity
|
|
307
|
+
|
|
308
|
+
// Metadata-system adapter object (not a factory) consumed directly by
|
|
309
|
+
// lib/api/entities.ts as `clientMetaSystemAdapter.getApiPath(...)`.
|
|
310
|
+
export const clientMetaSystemAdapter: {
|
|
311
|
+
getApiPath(entityType: string): string | null
|
|
312
|
+
getAllEntityConfigs(): Array<{
|
|
313
|
+
name: string
|
|
314
|
+
apiPath?: string
|
|
315
|
+
features?: { enabled?: boolean; canDelete?: boolean; canEdit?: boolean; [key: string]: unknown }
|
|
316
|
+
[key: string]: unknown
|
|
317
|
+
}>
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
// ============================================================================
|
|
322
|
+
// Entity Types (search/type metadata — distinct from entity-registry)
|
|
323
|
+
// ============================================================================
|
|
324
|
+
declare module '@nextsparkjs/registries/entity-types' {
|
|
325
|
+
export type EntityName = string
|
|
326
|
+
export type SystemSearchType = 'task' | 'page' | 'setting' | 'entity' | string
|
|
327
|
+
export type SearchResultType = EntityName | SystemSearchType
|
|
328
|
+
|
|
329
|
+
export const SEARCH_TYPE_PRIORITIES: Record<string, number>
|
|
330
|
+
export const ENTITY_METADATA: {
|
|
331
|
+
generatedAt: string
|
|
332
|
+
entityNames: EntityName[]
|
|
333
|
+
totalEntities: number
|
|
334
|
+
}
|
|
190
335
|
}
|
|
191
336
|
|
|
192
337
|
// ============================================================================
|
|
193
338
|
// Theme Registry
|
|
194
339
|
// ============================================================================
|
|
195
|
-
declare module '@
|
|
340
|
+
declare module '@nextsparkjs/registries/theme-registry' {
|
|
341
|
+
// Mirrors packages/core/src/types/theme.ts's ThemeConfig — its own index
|
|
342
|
+
// signature (`[key: string]: any`) makes it permissive enough that only
|
|
343
|
+
// the required fields need to match exactly.
|
|
196
344
|
export interface ThemeConfig {
|
|
197
345
|
name: string
|
|
198
346
|
displayName: string
|
|
347
|
+
version: string
|
|
199
348
|
description?: string
|
|
200
|
-
version?: string
|
|
201
349
|
author?: string
|
|
350
|
+
[key: string]: any
|
|
202
351
|
}
|
|
203
352
|
|
|
204
|
-
export interface
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
defaultRoute?: string
|
|
353
|
+
export interface ThemeEntity {
|
|
354
|
+
slug: string
|
|
355
|
+
[key: string]: unknown
|
|
208
356
|
}
|
|
209
357
|
|
|
210
|
-
export interface
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
url?: string
|
|
358
|
+
export interface ThemeRouteFile {
|
|
359
|
+
path: string
|
|
360
|
+
[key: string]: unknown
|
|
214
361
|
}
|
|
215
362
|
|
|
216
|
-
export
|
|
217
|
-
debug?: boolean
|
|
218
|
-
showDevTools?: boolean
|
|
219
|
-
}
|
|
363
|
+
export type ThemeName = string
|
|
220
364
|
|
|
221
|
-
export
|
|
222
|
-
|
|
365
|
+
export interface ThemeRegistryEntry {
|
|
366
|
+
name: string
|
|
223
367
|
config: ThemeConfig
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
368
|
+
// `any` (not `unknown`): themes extend these with arbitrary, theme-specific
|
|
369
|
+
// shapes (customSidebarSections, docs.public, etc.) that core only passes
|
|
370
|
+
// through — an index signature here would still force `unknown` on
|
|
371
|
+
// property access and break every consumer's own narrower usage.
|
|
372
|
+
dashboardConfig?: Record<string, any>
|
|
373
|
+
appConfig?: Record<string, any>
|
|
374
|
+
devConfig?: Record<string, any> | null
|
|
375
|
+
entities?: ThemeEntity[]
|
|
376
|
+
routeFiles?: ThemeRouteFile[]
|
|
377
|
+
plugins?: string[]
|
|
227
378
|
}
|
|
228
379
|
|
|
380
|
+
export const THEME_REGISTRY: Record<string, ThemeRegistryEntry>
|
|
381
|
+
|
|
229
382
|
export const THEME_METADATA: {
|
|
230
383
|
generatedAt: string
|
|
231
384
|
activeTheme: string
|
|
385
|
+
themes: string[]
|
|
386
|
+
totalThemes: number
|
|
232
387
|
}
|
|
233
388
|
}
|
|
234
389
|
|
|
235
390
|
// ============================================================================
|
|
236
391
|
// Permissions Registry
|
|
237
|
-
//
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
392
|
+
//
|
|
393
|
+
// Real shape is entirely different from the old ambient declaration (which
|
|
394
|
+
// declared a single PERMISSIONS_REGISTRY object) — permission.service.ts
|
|
395
|
+
// imports a dozen independent pre-computed data structures directly.
|
|
396
|
+
// ============================================================================
|
|
397
|
+
declare module '@nextsparkjs/registries/permissions-registry' {
|
|
398
|
+
// Inlined instead of imported: nested `import type` inside a
|
|
399
|
+
// `declare module` block silently degrades every consumer's inferred
|
|
400
|
+
// types to `any` in this TS setup (isolatedModules + bundler resolution),
|
|
401
|
+
// which is exactly why the original file said "must not have any
|
|
402
|
+
// imports". Kept structurally compatible with lib/permissions/types.ts.
|
|
403
|
+
export type Permission = `${string}.${string}`
|
|
404
|
+
// Consuming code re-exports/returns these as plain mutable arrays — not
|
|
405
|
+
// `readonly` here, to stay assignable to those signatures.
|
|
406
|
+
export interface ResolvedPermission {
|
|
407
|
+
id: Permission
|
|
408
|
+
label: string
|
|
409
|
+
description?: string
|
|
410
|
+
category: string
|
|
411
|
+
roles: string[]
|
|
412
|
+
dangerous?: boolean
|
|
413
|
+
requires?: Permission[]
|
|
414
|
+
source: 'core' | 'theme' | 'entity'
|
|
415
|
+
disabled: boolean
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
export const ALL_PERMISSIONS: Permission[]
|
|
419
|
+
export const ALL_PERMISSIONS_SET: ReadonlySet<Permission>
|
|
420
|
+
export const ALL_RESOLVED_PERMISSIONS: ResolvedPermission[]
|
|
421
|
+
export const PERMISSIONS_BY_ROLE: Record<string, ReadonlySet<Permission>>
|
|
422
|
+
export const ROLE_PERMISSIONS_ARRAY: Record<string, Permission[]>
|
|
423
|
+
export const PERMISSIONS_BY_CATEGORY: Record<string, ResolvedPermission[]>
|
|
424
|
+
export const FULL_MATRIX: Record<string, Record<string, boolean>>
|
|
425
|
+
export const UI_SECTIONS: {
|
|
426
|
+
key: string
|
|
427
|
+
label: string
|
|
428
|
+
permissions: Permission[]
|
|
429
|
+
}[]
|
|
430
|
+
export const AVAILABLE_ROLES: string[]
|
|
431
|
+
export const TEAM_PERMISSIONS_BY_ROLE: Record<string, string[]>
|
|
245
432
|
export const PERMISSIONS_METADATA: {
|
|
246
433
|
generatedAt: string
|
|
247
|
-
roleCount: number
|
|
248
434
|
permissionCount: number
|
|
249
435
|
}
|
|
250
|
-
|
|
251
|
-
export
|
|
252
|
-
export
|
|
253
|
-
export
|
|
254
|
-
export function getAllPermissions(): string[]
|
|
436
|
+
export const ROLE_HIERARCHY: Record<string, number>
|
|
437
|
+
export const ROLE_DISPLAY_NAMES: Record<string, string>
|
|
438
|
+
export const ROLE_DESCRIPTIONS: Record<string, string>
|
|
439
|
+
export const DEFAULT_TEAM_ROLE: string
|
|
255
440
|
}
|
|
256
441
|
|
|
257
442
|
// ============================================================================
|
|
258
443
|
// Plugin Registry (Server)
|
|
259
444
|
// ============================================================================
|
|
260
|
-
declare module '@
|
|
261
|
-
export interface
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
445
|
+
declare module '@nextsparkjs/registries/plugin-registry' {
|
|
446
|
+
export interface RouteFileEndpoint {
|
|
447
|
+
path: string
|
|
448
|
+
methods: string[]
|
|
449
|
+
[key: string]: unknown
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
export interface PluginEntity {
|
|
453
|
+
slug: string
|
|
454
|
+
[key: string]: unknown
|
|
268
455
|
}
|
|
269
456
|
|
|
457
|
+
export type PluginName = string
|
|
458
|
+
|
|
270
459
|
export interface PluginRegistryEntry {
|
|
271
|
-
|
|
272
|
-
|
|
460
|
+
name: string
|
|
461
|
+
config: Record<string, unknown>
|
|
462
|
+
enabled: boolean
|
|
463
|
+
entities?: PluginEntity[]
|
|
464
|
+
routes?: RouteFileEndpoint[]
|
|
465
|
+
hooks?: Record<string, (...args: unknown[]) => unknown>
|
|
273
466
|
}
|
|
274
467
|
|
|
275
468
|
export const PLUGIN_REGISTRY: Record<string, PluginRegistryEntry>
|
|
469
|
+
export const ROUTE_METADATA: {
|
|
470
|
+
generatedAt: string
|
|
471
|
+
handlerCount: number
|
|
472
|
+
}
|
|
276
473
|
export const PLUGIN_METADATA: {
|
|
277
474
|
generatedAt: string
|
|
278
475
|
pluginCount: number
|
|
279
476
|
enabledCount: number
|
|
280
477
|
}
|
|
281
|
-
|
|
282
|
-
export function getPlugin(name: string): PluginRegistryEntry | undefined
|
|
283
|
-
export function getAllPlugins(): PluginRegistryEntry[]
|
|
284
|
-
export function getEnabledPlugins(): PluginRegistryEntry[]
|
|
285
|
-
export function isPluginEnabled(name: string): boolean
|
|
286
478
|
}
|
|
287
479
|
|
|
288
480
|
// ============================================================================
|
|
289
481
|
// Plugin Registry (Client)
|
|
290
482
|
// ============================================================================
|
|
291
|
-
declare module '@
|
|
292
|
-
export interface
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
483
|
+
declare module '@nextsparkjs/registries/plugin-registry.client' {
|
|
484
|
+
export interface PluginNavItem {
|
|
485
|
+
label: string
|
|
486
|
+
href: string
|
|
487
|
+
icon?: string
|
|
488
|
+
description?: string
|
|
489
|
+
[key: string]: unknown
|
|
297
490
|
}
|
|
298
491
|
|
|
299
|
-
export
|
|
300
|
-
|
|
301
|
-
export function getPlugin(name: string): ClientPluginConfig | undefined
|
|
302
|
-
export function getAllPlugins(): ClientPluginConfig[]
|
|
303
|
-
export function isPluginEnabled(name: string): boolean
|
|
492
|
+
export function getPluginNavItems(context: string): PluginNavItem[]
|
|
304
493
|
}
|
|
305
494
|
|
|
306
495
|
// ============================================================================
|
|
307
496
|
// Template Registry (Server)
|
|
308
497
|
// ============================================================================
|
|
309
|
-
declare module '@
|
|
498
|
+
declare module '@nextsparkjs/registries/template-registry' {
|
|
499
|
+
export type TemplatePath = string
|
|
500
|
+
|
|
501
|
+
export interface TemplateOverride {
|
|
502
|
+
themeName: string
|
|
503
|
+
templateType: string
|
|
504
|
+
[key: string]: unknown
|
|
505
|
+
}
|
|
506
|
+
|
|
310
507
|
export interface TemplateRegistryEntry {
|
|
311
|
-
|
|
312
|
-
component:
|
|
313
|
-
|
|
314
|
-
|
|
508
|
+
appPath: TemplatePath
|
|
509
|
+
component: unknown
|
|
510
|
+
template: TemplateOverride
|
|
511
|
+
alternatives: TemplateOverride[]
|
|
315
512
|
}
|
|
316
513
|
|
|
317
514
|
export const TEMPLATE_REGISTRY: Record<string, TemplateRegistryEntry>
|
|
318
|
-
export const LAYOUT_REGISTRY: Record<string, TemplateRegistryEntry>
|
|
319
515
|
export const TEMPLATE_METADATA: {
|
|
320
516
|
generatedAt: string
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
export function getTemplate(path: string): TemplateRegistryEntry | undefined
|
|
326
|
-
export function getLayout(path: string): TemplateRegistryEntry | undefined
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
// ============================================================================
|
|
330
|
-
// Template Registry (Client)
|
|
331
|
-
// ============================================================================
|
|
332
|
-
declare module '@nextspark/registries/template-registry.client' {
|
|
333
|
-
export interface ClientTemplateEntry {
|
|
334
|
-
path: string
|
|
335
|
-
component: React.ComponentType<any>
|
|
517
|
+
totalTemplates: number
|
|
518
|
+
templateTypes: string[]
|
|
336
519
|
}
|
|
337
|
-
|
|
338
|
-
export const TEMPLATE_REGISTRY: Record<string, ClientTemplateEntry>
|
|
339
|
-
|
|
340
|
-
export function getTemplate(path: string): ClientTemplateEntry | undefined
|
|
341
520
|
}
|
|
342
521
|
|
|
343
522
|
// ============================================================================
|
|
344
523
|
// Testing Registry
|
|
524
|
+
//
|
|
525
|
+
// Real shape is four independent top-level exports, not a single nested
|
|
526
|
+
// TESTING_REGISTRY object like the old ambient declaration had.
|
|
345
527
|
// ============================================================================
|
|
346
|
-
declare module '@
|
|
347
|
-
export
|
|
528
|
+
declare module '@nextsparkjs/registries/testing-registry' {
|
|
529
|
+
export type FeatureCategory = string
|
|
530
|
+
export type FlowCategory = string
|
|
531
|
+
|
|
532
|
+
export interface FeatureEntry {
|
|
348
533
|
key: string
|
|
349
534
|
name: string
|
|
350
|
-
description
|
|
351
|
-
category
|
|
535
|
+
description: string
|
|
536
|
+
category: FeatureCategory
|
|
537
|
+
tag: string
|
|
352
538
|
tags?: string[]
|
|
353
|
-
|
|
354
|
-
|
|
539
|
+
testing: {
|
|
540
|
+
testCount: number
|
|
541
|
+
hasTests: boolean
|
|
355
542
|
selectors?: Record<string, string>
|
|
356
543
|
flows?: string[]
|
|
357
544
|
}
|
|
358
545
|
}
|
|
359
546
|
|
|
360
|
-
export interface
|
|
547
|
+
export interface FlowEntry {
|
|
361
548
|
key: string
|
|
362
549
|
name: string
|
|
363
|
-
description
|
|
364
|
-
|
|
550
|
+
description: string
|
|
551
|
+
category: FlowCategory
|
|
552
|
+
tag: string
|
|
365
553
|
tags?: string[]
|
|
554
|
+
steps?: string[]
|
|
555
|
+
criticalPath?: boolean
|
|
556
|
+
testing: {
|
|
557
|
+
testCount: number
|
|
558
|
+
hasTests: boolean
|
|
559
|
+
}
|
|
366
560
|
}
|
|
367
561
|
|
|
368
|
-
export
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
}>
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
562
|
+
export const FEATURE_REGISTRY: Record<string, FeatureEntry>
|
|
563
|
+
export const FLOW_REGISTRY: Record<string, FlowEntry>
|
|
564
|
+
// Keyed by fixed category names (consumers do `keyof typeof TAGS_REGISTRY`
|
|
565
|
+
// and cast each category's value to their own local shape), not an index
|
|
566
|
+
// signature.
|
|
567
|
+
export const TAGS_REGISTRY: {
|
|
568
|
+
layers: Record<string, { tag: string; testCount: number; files: string[] }>
|
|
569
|
+
priorities: Record<string, { tag: string; testCount: number; files: string[] }>
|
|
570
|
+
features: Record<string, { tag: string; testCount: number; files: string[] }>
|
|
571
|
+
flows: Record<string, { tag: string; testCount: number; files: string[] }>
|
|
572
|
+
blocks: Record<string, { tag: string; testCount: number; files: string[] }>
|
|
573
|
+
roles: Record<string, { tag: string; testCount: number; files: string[] }>
|
|
574
|
+
operations: Record<string, { tag: string; testCount: number; files: string[] }>
|
|
575
|
+
other: Record<string, { tag: string; testCount: number; files: string[] }>
|
|
576
|
+
}
|
|
577
|
+
export const COVERAGE_SUMMARY: {
|
|
578
|
+
features: { total: number; withTests: number; withoutTests: number }
|
|
579
|
+
flows: { total: number; withTests: number; withoutTests: number }
|
|
580
|
+
tags: { testFiles: number }
|
|
385
581
|
}
|
|
386
|
-
|
|
387
|
-
export function getFeature(name: string): TestFeature | undefined
|
|
388
|
-
export function getFlow(name: string): TestFlow | undefined
|
|
389
|
-
export function getBlock(name: string): TestBlock | undefined
|
|
390
|
-
export function getSelector(name: string): string | undefined
|
|
391
582
|
}
|
|
392
583
|
|
|
393
584
|
// ============================================================================
|
|
394
585
|
// Translation Registry
|
|
395
|
-
//
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
export const
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
defaultLocale: string
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
export function getMessages(locale: SupportedLocale): Record<string, unknown>
|
|
412
|
-
export function getSupportedLocales(): SupportedLocale[]
|
|
586
|
+
//
|
|
587
|
+
// Real shape is three independent lazy-loader maps, not a single
|
|
588
|
+
// TRANSLATION_REGISTRY object like the old ambient declaration had.
|
|
589
|
+
// ============================================================================
|
|
590
|
+
declare module '@nextsparkjs/registries/translation-registry' {
|
|
591
|
+
export type TranslationLoader = () => Promise<Record<string, unknown>>
|
|
592
|
+
|
|
593
|
+
// theme -> locale -> loader
|
|
594
|
+
export const THEME_TRANSLATION_LOADERS: Record<string, Record<string, TranslationLoader>>
|
|
595
|
+
// theme -> entity -> locale -> loader
|
|
596
|
+
export const ENTITY_TRANSLATION_LOADERS: Record<string, Record<string, Record<string, TranslationLoader>>>
|
|
597
|
+
// pluginName -> entity -> locale -> loader
|
|
598
|
+
export const PLUGIN_ENTITY_TRANSLATION_LOADERS: Record<string, Record<string, Record<string, TranslationLoader>>>
|
|
413
599
|
}
|
|
414
600
|
|
|
415
601
|
// ============================================================================
|
|
416
602
|
// Route Handlers Registry
|
|
603
|
+
//
|
|
604
|
+
// Real shape is API-route metadata + theme/plugin handler maps, not the
|
|
605
|
+
// single ROUTE_HANDLERS export the old ambient declaration had.
|
|
417
606
|
// ============================================================================
|
|
418
|
-
declare module '@
|
|
419
|
-
export interface
|
|
607
|
+
declare module '@nextsparkjs/registries/route-handlers' {
|
|
608
|
+
export interface ApiRouteEntry {
|
|
420
609
|
path: string
|
|
421
|
-
methods:
|
|
422
|
-
|
|
423
|
-
|
|
610
|
+
methods: string[]
|
|
611
|
+
source?: string
|
|
612
|
+
subcategory?: string
|
|
613
|
+
[key: string]: unknown
|
|
424
614
|
}
|
|
425
615
|
|
|
426
|
-
export const
|
|
427
|
-
|
|
616
|
+
export const API_ROUTES_METADATA: {
|
|
617
|
+
core: ApiRouteEntry[]
|
|
618
|
+
entities: ApiRouteEntry[]
|
|
619
|
+
theme: ApiRouteEntry[]
|
|
620
|
+
plugins: ApiRouteEntry[]
|
|
621
|
+
}
|
|
622
|
+
export const API_ROUTES_SUMMARY: {
|
|
623
|
+
totalRoutes: number
|
|
624
|
+
byCategory: Record<'core' | 'entity' | 'theme' | 'plugin', number>
|
|
428
625
|
generatedAt: string
|
|
429
|
-
handlerCount: number
|
|
430
626
|
}
|
|
627
|
+
|
|
628
|
+
// A single Next.js Route Handler function for one HTTP method.
|
|
629
|
+
export type RouteHandler = (
|
|
630
|
+
request: import('next/server').NextRequest,
|
|
631
|
+
context: { params: Promise<Record<string, string>> }
|
|
632
|
+
) => Promise<Response> | Response
|
|
633
|
+
|
|
634
|
+
// Keyed by route key, then by HTTP method.
|
|
635
|
+
export const THEME_ROUTE_HANDLERS: Record<string, Record<string, RouteHandler>>
|
|
636
|
+
export const PLUGIN_ROUTE_HANDLERS: Record<string, Record<string, RouteHandler>>
|
|
431
637
|
}
|
|
432
638
|
|
|
433
639
|
// ============================================================================
|
|
434
640
|
// Docs Registry
|
|
435
|
-
//
|
|
436
|
-
|
|
641
|
+
//
|
|
642
|
+
// DocPageMeta / DocSectionMeta / DocsRegistryStructure are real, hand-written
|
|
643
|
+
// types in packages/core/src/types/docs.ts — this module only supplies the
|
|
644
|
+
// runtime values and query functions the generator produces.
|
|
645
|
+
// ============================================================================
|
|
646
|
+
declare module '@nextsparkjs/registries/docs-registry' {
|
|
647
|
+
// Inlined instead of imported (see permissions-registry above for why) —
|
|
648
|
+
// kept structurally compatible with src/types/docs.ts.
|
|
437
649
|
export interface DocPageMeta {
|
|
438
650
|
slug: string
|
|
439
651
|
title: string
|
|
440
|
-
|
|
441
|
-
|
|
652
|
+
order: number
|
|
653
|
+
path: string
|
|
654
|
+
source: 'public' | 'superadmin'
|
|
442
655
|
}
|
|
443
656
|
|
|
444
657
|
export interface DocSectionMeta {
|
|
445
|
-
slug: string
|
|
446
658
|
title: string
|
|
447
|
-
|
|
659
|
+
slug: string
|
|
660
|
+
order: number
|
|
448
661
|
pages: DocPageMeta[]
|
|
449
|
-
source: '
|
|
662
|
+
source: 'public' | 'superadmin'
|
|
450
663
|
}
|
|
451
664
|
|
|
452
|
-
export
|
|
453
|
-
|
|
665
|
+
export interface DocsRegistryStructure {
|
|
666
|
+
public: DocSectionMeta[]
|
|
667
|
+
superadmin: DocSectionMeta[]
|
|
668
|
+
all: DocSectionMeta[]
|
|
454
669
|
}
|
|
455
670
|
|
|
671
|
+
export const DOCS_REGISTRY: DocsRegistryStructure
|
|
672
|
+
|
|
456
673
|
export function getAllDocSections(): DocSectionMeta[]
|
|
674
|
+
export function getPublicDocSections(): DocSectionMeta[]
|
|
675
|
+
export function getSuperadminDocSections(): DocSectionMeta[]
|
|
457
676
|
export function findDocSection(slug: string): DocSectionMeta | undefined
|
|
677
|
+
export function findDocSectionInCategory(
|
|
678
|
+
slug: string,
|
|
679
|
+
category: 'public' | 'superadmin'
|
|
680
|
+
): DocSectionMeta | undefined
|
|
458
681
|
export function findDocPage(sectionSlug: string, pageSlug: string): DocPageMeta | undefined
|
|
459
682
|
}
|
|
460
683
|
|
|
461
684
|
// ============================================================================
|
|
462
|
-
//
|
|
685
|
+
// API Docs Registry
|
|
463
686
|
// ============================================================================
|
|
464
|
-
declare module '@
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
687
|
+
declare module '@nextsparkjs/registries/api-docs-registry' {
|
|
688
|
+
// Mirrors packages/core/src/types/api-presets.ts's ApiDocEntry /
|
|
689
|
+
// ApiDocsRegistryStructure exactly (not imported — see permissions-registry
|
|
690
|
+
// above for why): devtools components type-annotate against that
|
|
691
|
+
// hand-written file directly, not against this registry module.
|
|
692
|
+
export type ApiPresetSource = 'entity' | 'route' | 'core'
|
|
693
|
+
|
|
694
|
+
export interface ApiDocEntry {
|
|
695
|
+
path: string
|
|
696
|
+
title: string
|
|
697
|
+
endpoint: string
|
|
698
|
+
source?: ApiPresetSource
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
export const API_DOCS_REGISTRY: {
|
|
702
|
+
docs: Record<string, ApiDocEntry>
|
|
703
|
+
meta: { totalDocs: number; generatedAt: string; themeName: string }
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
export function getDocForEndpoint(endpoint: string): ApiDocEntry | undefined
|
|
707
|
+
export function hasDoc(endpoint: string): boolean
|
|
708
|
+
export function getAllDocEndpoints(): string[]
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
// ============================================================================
|
|
712
|
+
// API Presets Registry
|
|
713
|
+
// ============================================================================
|
|
714
|
+
declare module '@nextsparkjs/registries/api-presets-registry' {
|
|
715
|
+
// Mirrors packages/core/src/types/api-presets.ts's ApiPreset /
|
|
716
|
+
// ApiEndpointPresets / ApiPresetsRegistryStructure exactly (not imported —
|
|
717
|
+
// see permissions-registry above for why).
|
|
718
|
+
export type ApiPresetSource = 'entity' | 'route' | 'core'
|
|
719
|
+
|
|
720
|
+
export interface PresetSessionConfig {
|
|
721
|
+
crossTeam?: boolean
|
|
722
|
+
teamId?: string
|
|
723
|
+
authType?: 'session' | 'apiKey'
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
export interface ApiPreset {
|
|
727
|
+
id: string
|
|
728
|
+
title: string
|
|
729
|
+
description?: string
|
|
730
|
+
method: 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE' | 'OPTIONS'
|
|
731
|
+
path?: string
|
|
732
|
+
pathParams?: Record<string, string>
|
|
733
|
+
params?: Record<string, string | number | boolean>
|
|
734
|
+
queryParams?: Record<string, string | number | boolean>
|
|
735
|
+
headers?: Record<string, string>
|
|
736
|
+
payload?: Record<string, unknown>
|
|
737
|
+
sessionConfig?: PresetSessionConfig
|
|
738
|
+
tags?: string[]
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
export interface ApiEndpointPresets {
|
|
742
|
+
endpoint?: string
|
|
743
|
+
summary?: string
|
|
744
|
+
presets: ApiPreset[]
|
|
745
|
+
sourcePath?: string
|
|
746
|
+
source?: ApiPresetSource
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
export const API_PRESETS_REGISTRY: {
|
|
750
|
+
endpoints: Record<string, ApiEndpointPresets>
|
|
751
|
+
meta: { totalEndpoints: number; totalPresets: number; generatedAt: string; themeName: string }
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
export function getPresetsForEndpoint(endpoint: string): ApiEndpointPresets | undefined
|
|
755
|
+
export function getPresetsByMethod(endpoint: string, method: string): ApiPreset[]
|
|
756
|
+
export function getAllPresets(): ApiEndpointPresets[]
|
|
757
|
+
export function hasPresets(endpoint: string): boolean
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
// ============================================================================
|
|
761
|
+
// Email Registry
|
|
762
|
+
//
|
|
763
|
+
// Keyed by slug ('verify-email', 'reset-password', 'otp-verification',
|
|
764
|
+
// 'team-invitation', plus any consumer-defined slugs). Callers index with a
|
|
765
|
+
// known literal and pass their own typed `data`, so `any` here is the
|
|
766
|
+
// correct (and only sound) parameter type for the shared function shape.
|
|
767
|
+
// ============================================================================
|
|
768
|
+
declare module '@nextsparkjs/registries/email-registry' {
|
|
769
|
+
// Mirrors packages/core/src/lib/email/types.ts's EmailContent — callers
|
|
770
|
+
// in lib/email/send.ts type-check the result against that hand-written
|
|
771
|
+
// type, so `unknown` here would make every call site fail.
|
|
772
|
+
export interface EmailContent {
|
|
773
|
+
subject: string
|
|
774
|
+
html: string
|
|
775
|
+
text?: string
|
|
470
776
|
}
|
|
471
777
|
|
|
472
|
-
export const
|
|
778
|
+
export const EMAIL_REGISTRY: Record<
|
|
779
|
+
string,
|
|
780
|
+
(data: any, locale?: string) => EmailContent | Promise<EmailContent>
|
|
781
|
+
>
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
// ============================================================================
|
|
785
|
+
// Middleware Registry
|
|
786
|
+
// ============================================================================
|
|
787
|
+
declare module '@nextsparkjs/registries/middleware-registry' {
|
|
788
|
+
// Inline `import(...)` type queries instead of file-level `import type`
|
|
789
|
+
// (see permissions-registry above for why) — next/server is a real,
|
|
790
|
+
// stable package so referencing its types this way is exact, not a
|
|
791
|
+
// structural approximation like the other inlined modules.
|
|
792
|
+
export type ThemeName = string
|
|
793
|
+
|
|
794
|
+
export interface MiddlewareRegistryEntry {
|
|
795
|
+
exists: boolean
|
|
796
|
+
middleware: (
|
|
797
|
+
request: import('next/server').NextRequest,
|
|
798
|
+
// `any`, not a shallow shape: SessionUser is a complex better-auth
|
|
799
|
+
// inferred type ($Infer.Session.user & extra fields) core can't
|
|
800
|
+
// reproduce structurally here without importing it.
|
|
801
|
+
user?: any
|
|
802
|
+
) => Promise<import('next/server').NextResponse | null>
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
export const MIDDLEWARE_REGISTRY: Record<string, MiddlewareRegistryEntry>
|
|
473
806
|
export const MIDDLEWARE_METADATA: {
|
|
474
807
|
generatedAt: string
|
|
475
808
|
middlewareCount: number
|
|
@@ -478,52 +811,63 @@ declare module '@nextspark/registries/middleware-registry' {
|
|
|
478
811
|
|
|
479
812
|
// ============================================================================
|
|
480
813
|
// Namespace Registry
|
|
814
|
+
//
|
|
815
|
+
// Real export is NAMESPACE_CONFIG (singular config object), not
|
|
816
|
+
// NAMESPACE_REGISTRY like the old ambient declaration had.
|
|
481
817
|
// ============================================================================
|
|
482
|
-
declare module '@
|
|
483
|
-
export interface
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
818
|
+
declare module '@nextsparkjs/registries/namespace-registry' {
|
|
819
|
+
export interface RouteNamespaceConfig {
|
|
820
|
+
core: string[]
|
|
821
|
+
entities: string[]
|
|
822
|
+
strategy: string
|
|
487
823
|
}
|
|
488
824
|
|
|
489
|
-
export
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
825
|
+
export interface NamespaceConfig {
|
|
826
|
+
core: string[]
|
|
827
|
+
entities: string[]
|
|
828
|
+
routes: Record<string, RouteNamespaceConfig>
|
|
829
|
+
entityPaths: string[]
|
|
493
830
|
}
|
|
831
|
+
|
|
832
|
+
export const NAMESPACE_CONFIG: NamespaceConfig
|
|
494
833
|
}
|
|
495
834
|
|
|
496
835
|
// ============================================================================
|
|
497
836
|
// Scope Registry
|
|
837
|
+
//
|
|
838
|
+
// Real exports are SCOPE_CONFIG / API_CONFIG, not SCOPE_REGISTRY like the
|
|
839
|
+
// old ambient declaration had.
|
|
498
840
|
// ============================================================================
|
|
499
|
-
declare module '@
|
|
841
|
+
declare module '@nextsparkjs/registries/scope-registry' {
|
|
842
|
+
// SCOPE_CONFIG/API_CONFIG are each a single fixed-shape object, not maps
|
|
843
|
+
// keyed by scope name.
|
|
500
844
|
export interface ScopeConfig {
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
845
|
+
base: string[]
|
|
846
|
+
roles: Record<string, string[]>
|
|
847
|
+
flags: Record<string, string[]>
|
|
848
|
+
restrictions: Record<string, { remove?: string[]; allow_only?: string[] }>
|
|
504
849
|
}
|
|
505
850
|
|
|
506
|
-
export
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
scopeCount: number
|
|
851
|
+
export interface ApiConfig {
|
|
852
|
+
filters: { allowed: string[] }
|
|
853
|
+
entityPaths: string[]
|
|
510
854
|
}
|
|
855
|
+
|
|
856
|
+
export const SCOPE_CONFIG: ScopeConfig
|
|
857
|
+
export const API_CONFIG: ApiConfig
|
|
511
858
|
}
|
|
512
859
|
|
|
513
860
|
// ============================================================================
|
|
514
861
|
// Scheduled Actions Registry
|
|
862
|
+
//
|
|
863
|
+
// Keyed by theme name, not a flat array like the old ambient declaration
|
|
864
|
+
// had — each entry exposes registerAllHandlers() (initializer.ts).
|
|
515
865
|
// ============================================================================
|
|
516
|
-
declare module '@
|
|
517
|
-
export interface
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
handler: Function
|
|
521
|
-
enabled?: boolean
|
|
866
|
+
declare module '@nextsparkjs/registries/scheduled-actions-registry' {
|
|
867
|
+
export interface ScheduledActionsModule {
|
|
868
|
+
registerAllHandlers: () => void
|
|
869
|
+
registerRecurringActions: () => Promise<void>
|
|
522
870
|
}
|
|
523
871
|
|
|
524
|
-
export const SCHEDULED_ACTIONS_REGISTRY:
|
|
525
|
-
export const SCHEDULED_ACTIONS_METADATA: {
|
|
526
|
-
generatedAt: string
|
|
527
|
-
actionCount: number
|
|
528
|
-
}
|
|
872
|
+
export const SCHEDULED_ACTIONS_REGISTRY: Record<string, ScheduledActionsModule | undefined>
|
|
529
873
|
}
|