@revealui/core 0.0.1-pre.4 → 0.2.0
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/LICENSE +22 -202
- package/README.md +29 -180
- package/dist/api/compression.d.ts +83 -0
- package/dist/api/compression.d.ts.map +1 -0
- package/dist/api/compression.js +233 -0
- package/dist/api/payload-optimization.d.ts +138 -0
- package/dist/api/payload-optimization.d.ts.map +1 -0
- package/dist/api/payload-optimization.js +320 -0
- package/dist/api/rate-limit.d.ts +113 -0
- package/dist/api/rate-limit.d.ts.map +1 -0
- package/dist/api/rate-limit.js +301 -0
- package/dist/api/response-cache.d.ts +125 -0
- package/dist/api/response-cache.d.ts.map +1 -0
- package/dist/api/response-cache.js +335 -0
- package/dist/api/rest.d.ts +54 -0
- package/dist/api/rest.d.ts.map +1 -0
- package/dist/api/rest.js +464 -0
- package/dist/auth/access.d.ts +25 -0
- package/dist/auth/access.d.ts.map +1 -0
- package/dist/auth/access.js +20 -0
- package/dist/auth/index.d.ts +2 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +2 -0
- package/dist/cache/query-cache.d.ts +98 -0
- package/dist/cache/query-cache.d.ts.map +1 -0
- package/dist/cache/query-cache.js +260 -0
- package/dist/caching/app-cache.d.ts +237 -0
- package/dist/caching/app-cache.d.ts.map +1 -0
- package/dist/caching/app-cache.js +430 -0
- package/dist/caching/cdn-config.d.ts +155 -0
- package/dist/caching/cdn-config.d.ts.map +1 -0
- package/dist/caching/cdn-config.js +425 -0
- package/dist/caching/edge-cache.d.ts +177 -0
- package/dist/caching/edge-cache.d.ts.map +1 -0
- package/dist/caching/edge-cache.js +381 -0
- package/dist/caching/service-worker.d.ts +165 -0
- package/dist/caching/service-worker.d.ts.map +1 -0
- package/dist/caching/service-worker.js +437 -0
- package/dist/client/admin/RichText.d.ts +12 -0
- package/dist/client/admin/RichText.d.ts.map +1 -0
- package/dist/client/admin/RichText.js +5 -0
- package/dist/client/admin/components/AdminDashboard.d.ts +7 -0
- package/dist/client/admin/components/AdminDashboard.d.ts.map +1 -0
- package/dist/client/admin/components/AdminDashboard.js +318 -0
- package/dist/client/admin/components/CollectionList.d.ts +16 -0
- package/dist/client/admin/components/CollectionList.d.ts.map +1 -0
- package/dist/client/admin/components/CollectionList.js +67 -0
- package/dist/client/admin/components/DocumentForm.d.ts +11 -0
- package/dist/client/admin/components/DocumentForm.d.ts.map +1 -0
- package/dist/client/admin/components/DocumentForm.js +99 -0
- package/dist/client/admin/components/GlobalForm.d.ts +11 -0
- package/dist/client/admin/components/GlobalForm.d.ts.map +1 -0
- package/dist/client/admin/components/GlobalForm.js +74 -0
- package/dist/client/admin/i18n/en.d.ts +25 -0
- package/dist/client/admin/i18n/en.d.ts.map +1 -0
- package/dist/client/admin/i18n/en.js +25 -0
- package/dist/client/admin/index.d.ts +10 -0
- package/dist/client/admin/index.d.ts.map +1 -0
- package/dist/client/admin/index.js +10 -0
- package/dist/client/admin/layout.d.ts +10 -0
- package/dist/client/admin/layout.d.ts.map +1 -0
- package/dist/client/admin/layout.js +6 -0
- package/dist/client/admin/page.d.ts +38 -0
- package/dist/client/admin/page.d.ts.map +1 -0
- package/dist/client/admin/page.js +15 -0
- package/dist/client/admin/utils/apiClient.d.ts +110 -0
- package/dist/client/admin/utils/apiClient.d.ts.map +1 -0
- package/dist/client/admin/utils/apiClient.js +220 -0
- package/dist/client/admin/utils/auth.d.ts +27 -0
- package/dist/client/admin/utils/auth.d.ts.map +1 -0
- package/dist/client/admin/utils/auth.js +58 -0
- package/dist/client/admin/utils/index.d.ts +6 -0
- package/dist/client/admin/utils/index.d.ts.map +1 -0
- package/dist/client/admin/utils/index.js +5 -0
- package/dist/client/admin/utils/serializeConfig.d.ts +7 -0
- package/dist/client/admin/utils/serializeConfig.d.ts.map +1 -0
- package/dist/client/admin/utils/serializeConfig.js +35 -0
- package/dist/client/hooks.d.ts +18 -0
- package/dist/client/hooks.d.ts.map +1 -0
- package/dist/client/hooks.js +29 -0
- package/dist/client/http/client.d.ts +15 -0
- package/dist/client/http/client.d.ts.map +1 -0
- package/dist/client/http/client.js +49 -0
- package/dist/client/http/fetchBanner.d.ts +18 -0
- package/dist/client/http/fetchBanner.d.ts.map +1 -0
- package/dist/client/http/fetchBanner.js +44 -0
- package/dist/client/http/fetchCard.d.ts +18 -0
- package/dist/client/http/fetchCard.d.ts.map +1 -0
- package/dist/client/http/fetchCard.js +46 -0
- package/dist/client/http/fetchEvents.d.ts +18 -0
- package/dist/client/http/fetchEvents.d.ts.map +1 -0
- package/dist/client/http/fetchEvents.js +44 -0
- package/dist/client/http/fetchHero.d.ts +17 -0
- package/dist/client/http/fetchHero.d.ts.map +1 -0
- package/dist/client/http/fetchHero.js +55 -0
- package/dist/client/http/fetchMainInfos.d.ts +17 -0
- package/dist/client/http/fetchMainInfos.d.ts.map +1 -0
- package/dist/client/http/fetchMainInfos.js +44 -0
- package/dist/client/http/fetchVideos.d.ts +13 -0
- package/dist/client/http/fetchVideos.d.ts.map +1 -0
- package/dist/client/http/fetchVideos.js +36 -0
- package/dist/client/http/index.d.ts +19 -0
- package/dist/client/http/index.d.ts.map +1 -0
- package/dist/client/http/index.js +11 -0
- package/dist/client/index.d.ts +12 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +15 -0
- package/dist/client/richtext/RichTextEditor.d.ts +48 -0
- package/dist/client/richtext/RichTextEditor.d.ts.map +1 -0
- package/dist/client/richtext/RichTextEditor.js +360 -0
- package/dist/client/richtext/components/ImageNodeComponent.d.ts +9 -0
- package/dist/client/richtext/components/ImageNodeComponent.d.ts.map +1 -0
- package/dist/client/richtext/components/ImageNodeComponent.js +99 -0
- package/dist/client/richtext/components/ImageUploadButton.d.ts +11 -0
- package/dist/client/richtext/components/ImageUploadButton.d.ts.map +1 -0
- package/dist/client/richtext/components/ImageUploadButton.js +103 -0
- package/dist/client/richtext/index.d.ts +92 -0
- package/dist/client/richtext/index.d.ts.map +1 -0
- package/dist/client/richtext/index.js +74 -0
- package/dist/client/richtext/nodes/DecoratorBlockNode.d.ts +20 -0
- package/dist/client/richtext/nodes/DecoratorBlockNode.d.ts.map +1 -0
- package/dist/client/richtext/nodes/DecoratorBlockNode.js +29 -0
- package/dist/client/richtext/nodes/ImageNode.d.ts +51 -0
- package/dist/client/richtext/nodes/ImageNode.d.ts.map +1 -0
- package/dist/client/richtext/nodes/ImageNode.js +95 -0
- package/dist/client/richtext/plugins/CollaborationPlugin.d.ts +13 -0
- package/dist/client/richtext/plugins/CollaborationPlugin.d.ts.map +1 -0
- package/dist/client/richtext/plugins/CollaborationPlugin.js +8 -0
- package/dist/client/richtext/plugins/CursorsOverlayPlugin.d.ts +4 -0
- package/dist/client/richtext/plugins/CursorsOverlayPlugin.d.ts.map +1 -0
- package/dist/client/richtext/plugins/CursorsOverlayPlugin.js +50 -0
- package/dist/client/richtext/plugins/FloatingToolbarPlugin.d.ts +7 -0
- package/dist/client/richtext/plugins/FloatingToolbarPlugin.d.ts.map +1 -0
- package/dist/client/richtext/plugins/FloatingToolbarPlugin.js +248 -0
- package/dist/client/richtext/plugins/ImagePlugin.d.ts +3 -0
- package/dist/client/richtext/plugins/ImagePlugin.d.ts.map +1 -0
- package/dist/client/richtext/plugins/ImagePlugin.js +73 -0
- package/dist/client/richtext/plugins/PastePlugin.d.ts +2 -0
- package/dist/client/richtext/plugins/PastePlugin.d.ts.map +1 -0
- package/dist/client/richtext/plugins/PastePlugin.js +36 -0
- package/dist/client/richtext/plugins/ToolbarPlugin.d.ts +8 -0
- package/dist/client/richtext/plugins/ToolbarPlugin.d.ts.map +1 -0
- package/dist/client/richtext/plugins/ToolbarPlugin.js +204 -0
- package/dist/client/ui/index.d.ts +111 -0
- package/dist/client/ui/index.d.ts.map +1 -0
- package/dist/client/ui/index.js +130 -0
- package/dist/collections/CollectionOperations.d.ts +27 -0
- package/dist/collections/CollectionOperations.d.ts.map +1 -0
- package/dist/collections/CollectionOperations.js +34 -0
- package/dist/collections/hooks.d.ts +11 -0
- package/dist/collections/hooks.d.ts.map +1 -0
- package/dist/collections/hooks.js +35 -0
- package/dist/collections/index.d.ts +2 -0
- package/dist/collections/index.d.ts.map +1 -0
- package/dist/collections/index.js +1 -0
- package/dist/collections/operations/create.d.ts +10 -0
- package/dist/collections/operations/create.d.ts.map +1 -0
- package/dist/collections/operations/create.js +101 -0
- package/dist/collections/operations/delete.d.ts +10 -0
- package/dist/collections/operations/delete.d.ts.map +1 -0
- package/dist/collections/operations/delete.js +16 -0
- package/dist/collections/operations/fieldHooks.d.ts +21 -0
- package/dist/collections/operations/fieldHooks.d.ts.map +1 -0
- package/dist/collections/operations/fieldHooks.js +51 -0
- package/dist/collections/operations/find.d.ts +10 -0
- package/dist/collections/operations/find.d.ts.map +1 -0
- package/dist/collections/operations/find.js +124 -0
- package/dist/collections/operations/findById.d.ts +15 -0
- package/dist/collections/operations/findById.d.ts.map +1 -0
- package/dist/collections/operations/findById.js +59 -0
- package/dist/collections/operations/update.d.ts +10 -0
- package/dist/collections/operations/update.d.ts.map +1 -0
- package/dist/collections/operations/update.js +134 -0
- package/dist/config/index.d.ts +9 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +61 -0
- package/dist/config/runtime.d.ts +22 -0
- package/dist/config/runtime.d.ts.map +1 -0
- package/dist/config/runtime.js +32 -0
- package/dist/config/utils.d.ts +12 -0
- package/dist/config/utils.d.ts.map +1 -0
- package/dist/config/utils.js +20 -0
- package/dist/database/index.d.ts +1 -0
- package/dist/database/index.d.ts.map +1 -0
- package/dist/database/index.js +6 -0
- package/dist/database/ssl-config.d.ts +9 -0
- package/dist/database/ssl-config.d.ts.map +1 -0
- package/dist/database/ssl-config.js +7 -0
- package/dist/database/type-adapter.d.ts +113 -0
- package/dist/database/type-adapter.d.ts.map +1 -0
- package/dist/database/type-adapter.js +97 -0
- package/dist/database/universal-postgres.d.ts +45 -0
- package/dist/database/universal-postgres.d.ts.map +1 -0
- package/dist/database/universal-postgres.js +526 -0
- package/dist/dataloader.d.ts +26 -0
- package/dist/dataloader.d.ts.map +1 -0
- package/dist/dataloader.js +162 -0
- package/dist/error-handling/circuit-breaker.d.ts +262 -0
- package/dist/error-handling/circuit-breaker.d.ts.map +1 -0
- package/dist/error-handling/circuit-breaker.js +542 -0
- package/dist/error-handling/error-boundary.d.ts +94 -0
- package/dist/error-handling/error-boundary.d.ts.map +1 -0
- package/dist/error-handling/error-boundary.js +285 -0
- package/dist/error-handling/error-reporter.d.ts +213 -0
- package/dist/error-handling/error-reporter.d.ts.map +1 -0
- package/dist/error-handling/error-reporter.js +506 -0
- package/dist/error-handling/fallback-components.d.ts +131 -0
- package/dist/error-handling/fallback-components.d.ts.map +1 -0
- package/dist/error-handling/fallback-components.js +371 -0
- package/dist/error-handling/index.d.ts +16 -0
- package/dist/error-handling/index.d.ts.map +1 -0
- package/dist/error-handling/index.js +15 -0
- package/dist/error-handling/retry.d.ts +194 -0
- package/dist/error-handling/retry.d.ts.map +1 -0
- package/dist/error-handling/retry.js +450 -0
- package/dist/errors/index.d.ts +23 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +40 -0
- package/dist/factories/builders.d.ts +50 -0
- package/dist/factories/builders.d.ts.map +1 -0
- package/dist/factories/builders.js +77 -0
- package/dist/factories/index.d.ts +2 -0
- package/dist/factories/index.d.ts.map +1 -0
- package/dist/factories/index.js +1 -0
- package/dist/features.d.ts +82 -0
- package/dist/features.d.ts.map +1 -0
- package/dist/features.js +89 -0
- package/dist/fieldTraversal.d.ts +26 -0
- package/dist/fieldTraversal.d.ts.map +1 -0
- package/dist/fieldTraversal.js +132 -0
- package/dist/fields/config/types.d.ts +48 -0
- package/dist/fields/config/types.d.ts.map +1 -0
- package/dist/fields/config/types.js +20 -0
- package/dist/fields/getDefaultValue.d.ts +16 -0
- package/dist/fields/getDefaultValue.d.ts.map +1 -0
- package/dist/fields/getDefaultValue.js +20 -0
- package/dist/fields/getFieldPaths.d.ts +25 -0
- package/dist/fields/getFieldPaths.d.ts.map +1 -0
- package/dist/fields/getFieldPaths.js +23 -0
- package/dist/fields/hooks/afterRead/index.d.ts +36 -0
- package/dist/fields/hooks/afterRead/index.d.ts.map +1 -0
- package/dist/fields/hooks/afterRead/index.js +70 -0
- package/dist/fields/hooks/afterRead/promise.d.ts +46 -0
- package/dist/fields/hooks/afterRead/promise.d.ts.map +1 -0
- package/dist/fields/hooks/afterRead/promise.js +178 -0
- package/dist/fields/hooks/afterRead/traverseFields.d.ts +44 -0
- package/dist/fields/hooks/afterRead/traverseFields.d.ts.map +1 -0
- package/dist/fields/hooks/afterRead/traverseFields.js +37 -0
- package/dist/generated/agents/index.d.ts +8 -0
- package/dist/generated/agents/index.d.ts.map +1 -0
- package/dist/generated/agents/index.js +7 -0
- package/dist/generated/components/index.d.ts +8 -0
- package/dist/generated/components/index.d.ts.map +1 -0
- package/dist/generated/components/index.js +7 -0
- package/dist/generated/functions/index.d.ts +8 -0
- package/dist/generated/functions/index.d.ts.map +1 -0
- package/dist/generated/functions/index.js +7 -0
- package/dist/generated/hooks/index.d.ts +8 -0
- package/dist/generated/hooks/index.d.ts.map +1 -0
- package/dist/generated/hooks/index.js +7 -0
- package/dist/generated/index.d.ts +10 -0
- package/dist/generated/index.d.ts.map +1 -0
- package/dist/generated/index.js +9 -0
- package/dist/generated/plans/index.d.ts +8 -0
- package/dist/generated/plans/index.d.ts.map +1 -0
- package/dist/generated/plans/index.js +7 -0
- package/dist/generated/prompts/index.d.ts +8 -0
- package/dist/generated/prompts/index.d.ts.map +1 -0
- package/dist/generated/prompts/index.js +7 -0
- package/dist/generated/tools/index.d.ts +8 -0
- package/dist/generated/tools/index.d.ts.map +1 -0
- package/dist/generated/tools/index.js +7 -0
- package/dist/generated/types/cms.d.ts +1766 -0
- package/dist/generated/types/cms.d.ts.map +1 -0
- package/dist/generated/types/cms.js +12 -0
- package/dist/generated/types/index.d.ts +19 -0
- package/dist/generated/types/index.d.ts.map +1 -0
- package/dist/generated/types/index.js +28 -0
- package/dist/generated/types/neon.d.ts +11 -0
- package/dist/generated/types/neon.d.ts.map +1 -0
- package/dist/generated/types/neon.js +11 -0
- package/dist/generated/types/supabase.d.ts +193 -0
- package/dist/generated/types/supabase.d.ts.map +1 -0
- package/dist/generated/types/supabase.js +5 -0
- package/dist/globals/GlobalOperations.d.ts +24 -0
- package/dist/globals/GlobalOperations.d.ts.map +1 -0
- package/dist/globals/GlobalOperations.js +149 -0
- package/dist/globals/index.d.ts +2 -0
- package/dist/globals/index.d.ts.map +1 -0
- package/dist/globals/index.js +1 -0
- package/dist/index.d.ts +64 -1
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +128 -33
- package/dist/instance/RevealUIInstance.d.ts +6 -0
- package/dist/instance/RevealUIInstance.d.ts.map +1 -0
- package/dist/instance/RevealUIInstance.js +312 -0
- package/dist/instance/index.d.ts +3 -0
- package/dist/instance/index.d.ts.map +1 -0
- package/dist/instance/index.js +2 -0
- package/dist/instance/logger.d.ts +31 -0
- package/dist/instance/logger.d.ts.map +1 -0
- package/dist/instance/logger.js +42 -0
- package/dist/instance/methods/create.d.ts +10 -0
- package/dist/instance/methods/create.d.ts.map +1 -0
- package/dist/instance/methods/create.js +38 -0
- package/dist/instance/methods/delete.d.ts +10 -0
- package/dist/instance/methods/delete.d.ts.map +1 -0
- package/dist/instance/methods/delete.js +24 -0
- package/dist/instance/methods/find.d.ts +10 -0
- package/dist/instance/methods/find.d.ts.map +1 -0
- package/dist/instance/methods/find.js +23 -0
- package/dist/instance/methods/findById.d.ts +13 -0
- package/dist/instance/methods/findById.d.ts.map +1 -0
- package/dist/instance/methods/findById.js +23 -0
- package/dist/instance/methods/hooks.d.ts +14 -0
- package/dist/instance/methods/hooks.d.ts.map +1 -0
- package/dist/instance/methods/hooks.js +32 -0
- package/dist/instance/methods/update.d.ts +10 -0
- package/dist/instance/methods/update.d.ts.map +1 -0
- package/dist/instance/methods/update.js +42 -0
- package/dist/license.d.ts +73 -0
- package/dist/license.d.ts.map +1 -0
- package/dist/license.js +157 -0
- package/dist/monitoring/alerts.d.ts +118 -0
- package/dist/monitoring/alerts.d.ts.map +1 -0
- package/dist/monitoring/alerts.js +324 -0
- package/dist/monitoring/cleanup-manager.d.ts +71 -0
- package/dist/monitoring/cleanup-manager.d.ts.map +1 -0
- package/dist/monitoring/cleanup-manager.js +226 -0
- package/dist/monitoring/health-monitor.d.ts +22 -0
- package/dist/monitoring/health-monitor.d.ts.map +1 -0
- package/dist/monitoring/health-monitor.js +142 -0
- package/dist/monitoring/index.d.ts +14 -0
- package/dist/monitoring/index.d.ts.map +1 -0
- package/dist/monitoring/index.js +17 -0
- package/dist/monitoring/process-registry.d.ts +97 -0
- package/dist/monitoring/process-registry.d.ts.map +1 -0
- package/dist/monitoring/process-registry.js +222 -0
- package/dist/monitoring/query-monitor.d.ts +153 -0
- package/dist/monitoring/query-monitor.d.ts.map +1 -0
- package/dist/monitoring/query-monitor.js +209 -0
- package/dist/monitoring/types.d.ts +231 -0
- package/dist/monitoring/types.d.ts.map +1 -0
- package/dist/monitoring/types.js +42 -0
- package/dist/monitoring/zombie-detector.d.ts +81 -0
- package/dist/monitoring/zombie-detector.d.ts.map +1 -0
- package/dist/monitoring/zombie-detector.js +231 -0
- package/dist/nextjs/index.d.ts +4 -0
- package/dist/nextjs/index.d.ts.map +1 -0
- package/dist/nextjs/index.js +3 -0
- package/dist/nextjs/utilities.d.ts +5 -0
- package/dist/nextjs/utilities.d.ts.map +1 -0
- package/dist/nextjs/utilities.js +16 -0
- package/dist/nextjs/withRevealUI.d.ts +20 -0
- package/dist/nextjs/withRevealUI.d.ts.map +1 -0
- package/dist/nextjs/withRevealUI.js +181 -0
- package/dist/observability/alerts.d.ts +138 -0
- package/dist/observability/alerts.d.ts.map +1 -0
- package/dist/observability/alerts.js +390 -0
- package/dist/observability/health-check.d.ts +95 -0
- package/dist/observability/health-check.d.ts.map +1 -0
- package/dist/observability/health-check.js +345 -0
- package/dist/observability/index.d.ts +12 -0
- package/dist/observability/index.d.ts.map +1 -0
- package/dist/observability/index.js +11 -0
- package/dist/observability/logger.d.ts +47 -0
- package/dist/observability/logger.d.ts.map +1 -0
- package/dist/observability/logger.js +140 -0
- package/dist/observability/metrics.d.ts +205 -0
- package/dist/observability/metrics.d.ts.map +1 -0
- package/dist/observability/metrics.js +429 -0
- package/dist/observability/tracing.d.ts +149 -0
- package/dist/observability/tracing.d.ts.map +1 -0
- package/dist/observability/tracing.js +381 -0
- package/dist/optimization/asset-optimizer.d.ts +202 -0
- package/dist/optimization/asset-optimizer.d.ts.map +1 -0
- package/dist/optimization/asset-optimizer.js +312 -0
- package/dist/optimization/build-optimizer.d.ts +202 -0
- package/dist/optimization/build-optimizer.d.ts.map +1 -0
- package/dist/optimization/build-optimizer.js +271 -0
- package/dist/optimization/bundle-analyzer.d.ts +98 -0
- package/dist/optimization/bundle-analyzer.d.ts.map +1 -0
- package/dist/optimization/bundle-analyzer.js +322 -0
- package/dist/optimization/code-splitting.d.ts +144 -0
- package/dist/optimization/code-splitting.d.ts.map +1 -0
- package/dist/optimization/code-splitting.js +290 -0
- package/dist/plugin/index.d.ts +12 -0
- package/dist/plugin/index.d.ts.map +1 -0
- package/dist/plugin/index.js +4 -0
- package/dist/plugins/form-builder.d.ts +115 -0
- package/dist/plugins/form-builder.d.ts.map +1 -0
- package/dist/plugins/form-builder.js +239 -0
- package/dist/plugins/index.d.ts +5 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +4 -0
- package/dist/plugins/nested-docs.d.ts +8 -0
- package/dist/plugins/nested-docs.d.ts.map +1 -0
- package/dist/plugins/nested-docs.js +67 -0
- package/dist/plugins/redirects.d.ts +17 -0
- package/dist/plugins/redirects.d.ts.map +1 -0
- package/dist/plugins/redirects.js +62 -0
- package/dist/queries/index.d.ts +2 -0
- package/dist/queries/index.d.ts.map +1 -0
- package/dist/queries/index.js +1 -0
- package/dist/queries/queryBuilder.d.ts +47 -0
- package/dist/queries/queryBuilder.d.ts.map +1 -0
- package/dist/queries/queryBuilder.js +252 -0
- package/dist/relationships/analyzer.d.ts +39 -0
- package/dist/relationships/analyzer.d.ts.map +1 -0
- package/dist/relationships/analyzer.js +127 -0
- package/dist/relationships/index.d.ts +3 -0
- package/dist/relationships/index.d.ts.map +1 -0
- package/dist/relationships/index.js +2 -0
- package/dist/relationships/populate-helpers.d.ts +104 -0
- package/dist/relationships/populate-helpers.d.ts.map +1 -0
- package/dist/relationships/populate-helpers.js +187 -0
- package/dist/relationships/population.d.ts +42 -0
- package/dist/relationships/population.d.ts.map +1 -0
- package/dist/relationships/population.js +188 -0
- package/dist/revealui.d.ts +46 -0
- package/dist/revealui.d.ts.map +1 -0
- package/dist/revealui.js +92 -0
- package/dist/richtext/exports/client/rcc.d.ts +37 -0
- package/dist/richtext/exports/client/rcc.d.ts.map +1 -0
- package/dist/richtext/exports/client/rcc.js +182 -0
- package/dist/richtext/exports/server/rsc.d.ts +117 -0
- package/dist/richtext/exports/server/rsc.d.ts.map +1 -0
- package/dist/richtext/exports/server/rsc.js +288 -0
- package/dist/richtext/index.d.ts +161 -0
- package/dist/richtext/index.d.ts.map +1 -0
- package/dist/richtext/index.js +243 -0
- package/dist/richtext/lexical.d.ts +23 -0
- package/dist/richtext/lexical.d.ts.map +1 -0
- package/dist/richtext/lexical.js +35 -0
- package/dist/security/audit.d.ts +188 -0
- package/dist/security/audit.d.ts.map +1 -0
- package/dist/security/audit.js +431 -0
- package/dist/security/auth.d.ts +241 -0
- package/dist/security/auth.d.ts.map +1 -0
- package/dist/security/auth.js +474 -0
- package/dist/security/authorization.d.ts +235 -0
- package/dist/security/authorization.d.ts.map +1 -0
- package/dist/security/authorization.js +434 -0
- package/dist/security/encryption.d.ts +214 -0
- package/dist/security/encryption.d.ts.map +1 -0
- package/dist/security/encryption.js +506 -0
- package/dist/security/gdpr.d.ts +300 -0
- package/dist/security/gdpr.d.ts.map +1 -0
- package/dist/security/gdpr.js +470 -0
- package/dist/security/headers.d.ts +182 -0
- package/dist/security/headers.d.ts.map +1 -0
- package/dist/security/headers.js +402 -0
- package/dist/security/index.d.ts +19 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js +18 -0
- package/dist/server/index.d.ts +21 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +28 -0
- package/dist/server/renderPage.d.ts +69 -0
- package/dist/server/renderPage.d.ts.map +1 -0
- package/dist/server/renderPage.js +109 -0
- package/dist/storage/index.d.ts +1 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +4 -0
- package/dist/storage/vercel-blob.d.ts +17 -0
- package/dist/storage/vercel-blob.d.ts.map +1 -0
- package/dist/storage/vercel-blob.js +83 -0
- package/dist/translations/index.d.ts +17 -0
- package/dist/translations/index.d.ts.map +1 -0
- package/dist/translations/index.js +1 -0
- package/dist/types/access.d.ts +67 -0
- package/dist/types/access.d.ts.map +1 -0
- package/dist/types/access.js +8 -0
- package/dist/types/api.d.ts +57 -0
- package/dist/types/api.d.ts.map +1 -0
- package/dist/types/api.js +8 -0
- package/dist/types/cms.d.ts +8 -0
- package/dist/types/cms.d.ts.map +1 -0
- package/dist/types/cms.js +6 -0
- package/dist/types/config.d.ts +152 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +9 -0
- package/dist/types/core.d.ts +11 -0
- package/dist/types/core.d.ts.map +1 -0
- package/dist/types/core.js +9 -0
- package/dist/types/extensions.d.ts +116 -0
- package/dist/types/extensions.d.ts.map +1 -0
- package/dist/types/extensions.js +8 -0
- package/dist/types/frontend.d.ts +53 -0
- package/dist/types/frontend.d.ts.map +1 -0
- package/dist/types/frontend.js +7 -0
- package/dist/types/generated.d.ts +14 -0
- package/dist/types/generated.d.ts.map +1 -0
- package/dist/types/generated.js +11 -0
- package/dist/types/hooks.d.ts +53 -0
- package/dist/types/hooks.d.ts.map +1 -0
- package/dist/types/hooks.js +8 -0
- package/dist/types/index.d.ts +49 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +61 -0
- package/dist/types/interfaces/app.d.ts +50 -0
- package/dist/types/interfaces/app.d.ts.map +1 -0
- package/dist/types/interfaces/app.js +5 -0
- package/dist/types/jobs.d.ts +112 -0
- package/dist/types/jobs.d.ts.map +1 -0
- package/dist/types/jobs.js +7 -0
- package/dist/types/legacy.d.ts +147 -0
- package/dist/types/legacy.d.ts.map +1 -0
- package/dist/types/legacy.js +8 -0
- package/dist/types/plugins.d.ts +17 -0
- package/dist/types/plugins.d.ts.map +1 -0
- package/dist/types/plugins.js +8 -0
- package/dist/types/query.d.ts +99 -0
- package/dist/types/query.d.ts.map +1 -0
- package/dist/types/query.js +24 -0
- package/dist/types/request.d.ts +40 -0
- package/dist/types/request.d.ts.map +1 -0
- package/dist/types/request.js +8 -0
- package/dist/types/richtext.d.ts +23 -0
- package/dist/types/richtext.d.ts.map +1 -0
- package/dist/types/richtext.js +8 -0
- package/dist/types/runtime.d.ts +216 -0
- package/dist/types/runtime.d.ts.map +1 -0
- package/dist/types/runtime.js +9 -0
- package/dist/types/schema.d.ts +9 -0
- package/dist/types/schema.d.ts.map +1 -0
- package/dist/types/schema.js +7 -0
- package/dist/types/user.d.ts +48 -0
- package/dist/types/user.d.ts.map +1 -0
- package/dist/types/user.js +8 -0
- package/dist/utils/access-conversion.d.ts +17 -0
- package/dist/utils/access-conversion.d.ts.map +1 -0
- package/dist/utils/access-conversion.js +96 -0
- package/dist/utils/api-wrapper.d.ts +63 -0
- package/dist/utils/api-wrapper.d.ts.map +1 -0
- package/dist/utils/api-wrapper.js +151 -0
- package/dist/utils/block-conversion.d.ts +21 -0
- package/dist/utils/block-conversion.d.ts.map +1 -0
- package/dist/utils/block-conversion.js +109 -0
- package/dist/utils/cache.d.ts +86 -0
- package/dist/utils/cache.d.ts.map +1 -0
- package/dist/utils/cache.js +154 -0
- package/dist/utils/deep-clone.d.ts +25 -0
- package/dist/utils/deep-clone.d.ts.map +1 -0
- package/dist/utils/deep-clone.js +115 -0
- package/dist/utils/error-responses.d.ts +57 -0
- package/dist/utils/error-responses.d.ts.map +1 -0
- package/dist/utils/error-responses.js +96 -0
- package/dist/utils/errors.d.ts +97 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +397 -0
- package/dist/utils/field-conversion.d.ts +40 -0
- package/dist/utils/field-conversion.d.ts.map +1 -0
- package/dist/utils/field-conversion.js +275 -0
- package/dist/utils/flattenResult.d.ts +7 -0
- package/dist/utils/flattenResult.d.ts.map +1 -0
- package/dist/utils/flattenResult.js +23 -0
- package/dist/utils/getBlockSelect.d.ts +12 -0
- package/dist/utils/getBlockSelect.d.ts.map +1 -0
- package/dist/utils/getBlockSelect.js +12 -0
- package/dist/utils/getSelectMode.d.ts +8 -0
- package/dist/utils/getSelectMode.d.ts.map +1 -0
- package/dist/utils/getSelectMode.js +21 -0
- package/dist/utils/isValidID.d.ts +5 -0
- package/dist/utils/isValidID.d.ts.map +1 -0
- package/dist/utils/isValidID.js +13 -0
- package/dist/utils/json-parsing.d.ts +48 -0
- package/dist/utils/json-parsing.d.ts.map +1 -0
- package/dist/utils/json-parsing.js +130 -0
- package/dist/utils/jwt-validation.d.ts +14 -0
- package/dist/utils/jwt-validation.d.ts.map +1 -0
- package/dist/utils/jwt-validation.js +36 -0
- package/dist/utils/logger-client.d.ts +32 -0
- package/dist/utils/logger-client.d.ts.map +1 -0
- package/dist/utils/logger-client.js +55 -0
- package/dist/utils/logger-server.d.ts +32 -0
- package/dist/utils/logger-server.d.ts.map +1 -0
- package/dist/utils/logger-server.js +68 -0
- package/dist/utils/logger.d.ts +14 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +12 -0
- package/dist/utils/request-context.d.ts +143 -0
- package/dist/utils/request-context.d.ts.map +1 -0
- package/dist/utils/request-context.js +168 -0
- package/dist/utils/request-headers.d.ts +15 -0
- package/dist/utils/request-headers.d.ts.map +1 -0
- package/dist/utils/request-headers.js +31 -0
- package/dist/utils/stripUnselectedFields.d.ts +10 -0
- package/dist/utils/stripUnselectedFields.d.ts.map +1 -0
- package/dist/utils/stripUnselectedFields.js +20 -0
- package/dist/utils/type-guards.d.ts +33 -0
- package/dist/utils/type-guards.d.ts.map +1 -0
- package/dist/utils/type-guards.js +63 -0
- package/dist/utils/user.d.ts +14 -0
- package/dist/utils/user.d.ts.map +1 -0
- package/dist/utils/user.js +15 -0
- package/package.json +250 -724
- package/LICENSE_SUMMARY.md +0 -55
- package/NOTICE +0 -34
- package/dist/exports/RenderErrorPage.js +0 -3
- package/dist/exports/__internal.js +0 -3
- package/dist/exports/abort.js +0 -3
- package/dist/exports/bin-entry.js +0 -5
- package/dist/exports/client.js +0 -3
- package/dist/exports/config.js +0 -1
- package/dist/exports/helpers.js +0 -1
- package/dist/exports/index.js +0 -33
- package/dist/exports/plugin.js +0 -3
- package/dist/exports/prerender.js +0 -3
- package/dist/exports/router.js +0 -3
- package/dist/exports/routing.js +0 -3
- package/dist/exports/server.js +0 -3
- package/dist/exports/setup.js +0 -3
- package/dist/exports/types.js +0 -1
- package/dist/integration/styles.css +0 -141
- package/dist/shared/RenderErrorPage.d.ts +0 -3
- package/dist/shared/RenderErrorPage.js +0 -3
- package/dist/shared/abort.js +0 -3
- package/dist/shared/route/routing.js +0 -3
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const en: {
|
|
2
|
+
general: {
|
|
3
|
+
loading: string;
|
|
4
|
+
save: string;
|
|
5
|
+
cancel: string;
|
|
6
|
+
delete: string;
|
|
7
|
+
edit: string;
|
|
8
|
+
create: string;
|
|
9
|
+
back: string;
|
|
10
|
+
};
|
|
11
|
+
fields: {
|
|
12
|
+
enterURL: string;
|
|
13
|
+
};
|
|
14
|
+
authentication: {
|
|
15
|
+
logIn: string;
|
|
16
|
+
logOut: string;
|
|
17
|
+
email: string;
|
|
18
|
+
password: string;
|
|
19
|
+
};
|
|
20
|
+
validation: {
|
|
21
|
+
required: string;
|
|
22
|
+
email: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=en.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../../src/client/admin/i18n/en.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;CAuBd,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Basic English translations for RevealUI admin
|
|
2
|
+
export const en = {
|
|
3
|
+
general: {
|
|
4
|
+
loading: 'Loading...',
|
|
5
|
+
save: 'Save',
|
|
6
|
+
cancel: 'Cancel',
|
|
7
|
+
delete: 'Delete',
|
|
8
|
+
edit: 'Edit',
|
|
9
|
+
create: 'Create',
|
|
10
|
+
back: 'Back',
|
|
11
|
+
},
|
|
12
|
+
fields: {
|
|
13
|
+
enterURL: 'Enter URL',
|
|
14
|
+
},
|
|
15
|
+
authentication: {
|
|
16
|
+
logIn: 'Log In',
|
|
17
|
+
logOut: 'Log Out',
|
|
18
|
+
email: 'Email',
|
|
19
|
+
password: 'Password',
|
|
20
|
+
},
|
|
21
|
+
validation: {
|
|
22
|
+
required: 'This field is required',
|
|
23
|
+
email: 'Please enter a valid email address',
|
|
24
|
+
},
|
|
25
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { AdminDashboard } from './components/AdminDashboard.js';
|
|
2
|
+
export { CollectionList } from './components/CollectionList.js';
|
|
3
|
+
export { DocumentForm } from './components/DocumentForm.js';
|
|
4
|
+
export { GlobalForm } from './components/GlobalForm.js';
|
|
5
|
+
export { en } from './i18n/en.js';
|
|
6
|
+
export { RootLayout } from './layout.js';
|
|
7
|
+
export { generatePageMetadata, NotFoundPage, RootPage } from './page.js';
|
|
8
|
+
export * from './utils/index.js';
|
|
9
|
+
export { serializeConfig } from './utils/serializeConfig.js';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/admin/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAA;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACxE,cAAc,kBAAkB,CAAA;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Re-export admin utilities
|
|
2
|
+
export { AdminDashboard } from './components/AdminDashboard.js';
|
|
3
|
+
export { CollectionList } from './components/CollectionList.js';
|
|
4
|
+
export { DocumentForm } from './components/DocumentForm.js';
|
|
5
|
+
export { GlobalForm } from './components/GlobalForm.js';
|
|
6
|
+
export { en } from './i18n/en.js';
|
|
7
|
+
export { RootLayout } from './layout.js';
|
|
8
|
+
export { generatePageMetadata, NotFoundPage, RootPage } from './page.js';
|
|
9
|
+
export * from './utils/index.js';
|
|
10
|
+
export { serializeConfig } from './utils/serializeConfig.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { Config } from '../../types/index.js';
|
|
3
|
+
export interface RootLayoutProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
config: Config;
|
|
6
|
+
importMap?: Record<string, unknown>;
|
|
7
|
+
serverFunction?: (name: string, args: unknown) => Promise<unknown>;
|
|
8
|
+
}
|
|
9
|
+
export declare function RootLayout({ children }: RootLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../src/client/admin/layout.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAElD,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACnC,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;CACnE;AAED,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,EAAE,eAAe,2CAevD"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// RevealUI Admin Layout - Local implementation
|
|
3
|
+
import Head from 'next/head';
|
|
4
|
+
export function RootLayout({ children }) {
|
|
5
|
+
return (_jsxs("html", { lang: "en", children: [_jsxs(Head, { children: [_jsx("meta", { charSet: "utf-8" }), _jsx("meta", { name: "viewport", content: "width=device-width, initial-scale=1" }), _jsx("title", { children: "RevealUI Admin" })] }), _jsx("body", { className: "antialiased", children: _jsx("div", { id: "revealui-admin", className: "min-h-screen", children: children }) })] }));
|
|
6
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
interface Metadata {
|
|
2
|
+
title?: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
}
|
|
6
|
+
export interface RootPageProps {
|
|
7
|
+
config: {
|
|
8
|
+
collections?: unknown[];
|
|
9
|
+
globals?: unknown[];
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
};
|
|
12
|
+
params: Promise<{
|
|
13
|
+
segments?: string[];
|
|
14
|
+
}>;
|
|
15
|
+
searchParams: Promise<{
|
|
16
|
+
[key: string]: string | string[];
|
|
17
|
+
}>;
|
|
18
|
+
importMap?: Record<string, unknown>;
|
|
19
|
+
}
|
|
20
|
+
export interface NotFoundPageProps {
|
|
21
|
+
config: {
|
|
22
|
+
collections?: unknown[];
|
|
23
|
+
globals?: unknown[];
|
|
24
|
+
[key: string]: unknown;
|
|
25
|
+
};
|
|
26
|
+
params: Promise<{
|
|
27
|
+
segments?: string[];
|
|
28
|
+
}>;
|
|
29
|
+
searchParams: Promise<{
|
|
30
|
+
[key: string]: string | string[];
|
|
31
|
+
}>;
|
|
32
|
+
importMap?: Record<string, unknown>;
|
|
33
|
+
}
|
|
34
|
+
export declare function RootPage({ config }: RootPageProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export declare function NotFoundPage(): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export declare function generatePageMetadata(): Metadata;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=page.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../src/client/admin/page.tsx"],"names":[],"mappings":"AACA,UAAU,QAAQ;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE;QACN,WAAW,CAAC,EAAE,OAAO,EAAE,CAAA;QACvB,OAAO,CAAC,EAAE,OAAO,EAAE,CAAA;QACnB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KACvB,CAAA;IACD,MAAM,EAAE,OAAO,CAAC;QAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAA;IACxC,YAAY,EAAE,OAAO,CAAC;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAA;KAAE,CAAC,CAAA;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACpC;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE;QACN,WAAW,CAAC,EAAE,OAAO,EAAE,CAAA;QACvB,OAAO,CAAC,EAAE,OAAO,EAAE,CAAA;QACnB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KACvB,CAAA;IACD,MAAM,EAAE,OAAO,CAAC;QAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAA;IACxC,YAAY,EAAE,OAAO,CAAC;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAA;KAAE,CAAC,CAAA;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACpC;AAED,wBAAgB,QAAQ,CAAC,EAAE,MAAM,EAAE,EAAE,aAAa,2CAoKjD;AAED,wBAAgB,YAAY,4CAO3B;AAED,wBAAgB,oBAAoB,IAAI,QAAQ,CAK/C"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export function RootPage({ config }) {
|
|
3
|
+
const collections = (config.collections || []);
|
|
4
|
+
const globals = (config.globals || []);
|
|
5
|
+
return (_jsxs("div", { className: "min-h-screen bg-gray-50", children: [_jsx("header", { className: "bg-white shadow-sm border-b", children: _jsx("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: _jsxs("div", { className: "flex justify-between items-center py-4", children: [_jsx("div", { className: "flex items-center", children: _jsx("h1", { className: "text-2xl font-bold text-gray-900", children: "RevealUI Admin" }) }), _jsx("div", { className: "flex items-center space-x-4", children: _jsx("span", { className: "text-sm text-gray-500", children: "v0.1.0" }) })] }) }) }), _jsx("main", { className: "max-w-7xl mx-auto py-6 sm:px-6 lg:px-8", children: _jsx("div", { className: "px-4 py-6 sm:px-0", children: _jsxs("div", { className: "grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3", children: [_jsxs("div", { className: "bg-white overflow-hidden shadow rounded-lg", children: [_jsx("div", { className: "p-5", children: _jsxs("div", { className: "flex items-center", children: [_jsx("div", { className: "flex-shrink-0", children: _jsxs("svg", { className: "h-8 w-8 text-gray-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: [_jsx("title", { children: "Collections icon" }), _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10" })] }) }), _jsx("div", { className: "ml-5 w-0 flex-1", children: _jsxs("dl", { children: [_jsx("dt", { className: "text-sm font-medium text-gray-500 truncate", children: "Collections" }), _jsx("dd", { className: "text-lg font-medium text-gray-900", children: collections.length })] }) })] }) }), _jsx("div", { className: "bg-gray-50 px-5 py-3", children: _jsx("div", { className: "text-sm", children: collections.length > 0 ? (_jsx("ul", { className: "space-y-1", children: collections.map((collection) => (_jsxs("li", { className: "text-gray-600", children: [_jsx("span", { className: "font-medium", children: collection.slug }), _jsxs("span", { className: "ml-2 text-xs text-gray-400", children: ["(", collection.fields?.length || 0, " fields)"] })] }, collection.slug))) })) : (_jsx("p", { className: "text-gray-500", children: "No collections configured" })) }) })] }), _jsxs("div", { className: "bg-white overflow-hidden shadow rounded-lg", children: [_jsx("div", { className: "p-5", children: _jsxs("div", { className: "flex items-center", children: [_jsx("div", { className: "flex-shrink-0", children: _jsxs("svg", { className: "h-8 w-8 text-gray-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: [_jsx("title", { children: "Globals icon" }), _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 100 4m0-4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 100 4m0-4v2m0-6V4" })] }) }), _jsx("div", { className: "ml-5 w-0 flex-1", children: _jsxs("dl", { children: [_jsx("dt", { className: "text-sm font-medium text-gray-500 truncate", children: "Globals" }), _jsx("dd", { className: "text-lg font-medium text-gray-900", children: globals.length })] }) })] }) }), _jsx("div", { className: "bg-gray-50 px-5 py-3", children: _jsx("div", { className: "text-sm", children: globals.length > 0 ? (_jsx("ul", { className: "space-y-1", children: globals.map((global) => (_jsxs("li", { className: "text-gray-600", children: [_jsx("span", { className: "font-medium", children: global.slug }), _jsxs("span", { className: "ml-2 text-xs text-gray-400", children: ["(", global.fields?.length || 0, " fields)"] })] }, global.slug))) })) : (_jsx("p", { className: "text-gray-500", children: "No globals configured" })) }) })] }), _jsxs("div", { className: "bg-white overflow-hidden shadow rounded-lg", children: [_jsx("div", { className: "p-5", children: _jsxs("div", { className: "flex items-center", children: [_jsx("div", { className: "flex-shrink-0", children: _jsx("div", { className: "h-8 w-8 bg-green-100 rounded-full flex items-center justify-center", children: _jsxs("svg", { className: "h-5 w-5 text-green-600", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: [_jsx("title", { children: "System operational" }), _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 13l4 4L19 7" })] }) }) }), _jsx("div", { className: "ml-5 w-0 flex-1", children: _jsxs("dl", { children: [_jsx("dt", { className: "text-sm font-medium text-gray-500 truncate", children: "System Status" }), _jsx("dd", { className: "text-lg font-medium text-gray-900", children: "Operational" })] }) })] }) }), _jsx("div", { className: "bg-gray-50 px-5 py-3", children: _jsxs("div", { className: "text-sm text-gray-600", children: ["RevealUI CMS is running successfully with ", collections.length, " collections and", ' ', globals.length, " globals configured."] }) })] })] }) }) })] }));
|
|
6
|
+
}
|
|
7
|
+
export function NotFoundPage() {
|
|
8
|
+
return (_jsxs("div", { children: [_jsx("h1", { children: "404 - Page Not Found" }), _jsx("p", { children: "The requested admin page could not be found." })] }));
|
|
9
|
+
}
|
|
10
|
+
export function generatePageMetadata() {
|
|
11
|
+
return {
|
|
12
|
+
title: 'RevealUI Admin',
|
|
13
|
+
description: 'RevealUI Content Management System',
|
|
14
|
+
};
|
|
15
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API Client for RevealUI Admin Dashboard
|
|
3
|
+
* Handles all API communication with authentication and error handling
|
|
4
|
+
*/
|
|
5
|
+
import type { RevealDocument } from '../../../types/index.js';
|
|
6
|
+
export interface APIResponse<T = RevealDocument> {
|
|
7
|
+
docs?: T[];
|
|
8
|
+
doc?: T;
|
|
9
|
+
totalDocs?: number;
|
|
10
|
+
limit?: number;
|
|
11
|
+
totalPages?: number;
|
|
12
|
+
page?: number;
|
|
13
|
+
pagingCounter?: number;
|
|
14
|
+
hasPrevPage?: boolean;
|
|
15
|
+
hasNextPage?: boolean;
|
|
16
|
+
prevPage?: number | null;
|
|
17
|
+
nextPage?: number | null;
|
|
18
|
+
message?: string;
|
|
19
|
+
errors?: Array<{
|
|
20
|
+
message: string;
|
|
21
|
+
field?: string;
|
|
22
|
+
}>;
|
|
23
|
+
}
|
|
24
|
+
export declare enum APIErrorType {
|
|
25
|
+
Network = "network",
|
|
26
|
+
Authentication = "authentication",
|
|
27
|
+
Authorization = "authorization",
|
|
28
|
+
Validation = "validation",
|
|
29
|
+
NotFound = "not_found",
|
|
30
|
+
Server = "server"
|
|
31
|
+
}
|
|
32
|
+
export declare class APIError extends Error {
|
|
33
|
+
type: APIErrorType;
|
|
34
|
+
status?: number | undefined;
|
|
35
|
+
field?: string | undefined;
|
|
36
|
+
constructor(type: APIErrorType, message: string, status?: number | undefined, field?: string | undefined);
|
|
37
|
+
}
|
|
38
|
+
export interface FindOptions {
|
|
39
|
+
collection: string;
|
|
40
|
+
page?: number;
|
|
41
|
+
limit?: number;
|
|
42
|
+
where?: Record<string, unknown>;
|
|
43
|
+
sort?: string;
|
|
44
|
+
depth?: number;
|
|
45
|
+
}
|
|
46
|
+
export interface CreateOptions {
|
|
47
|
+
collection: string;
|
|
48
|
+
data: Record<string, unknown>;
|
|
49
|
+
}
|
|
50
|
+
export interface UpdateOptions {
|
|
51
|
+
collection: string;
|
|
52
|
+
id: string;
|
|
53
|
+
data: Record<string, unknown>;
|
|
54
|
+
}
|
|
55
|
+
export interface DeleteOptions {
|
|
56
|
+
collection: string;
|
|
57
|
+
id: string;
|
|
58
|
+
}
|
|
59
|
+
export interface FindGlobalOptions {
|
|
60
|
+
slug: string;
|
|
61
|
+
depth?: number;
|
|
62
|
+
}
|
|
63
|
+
export interface UpdateGlobalOptions {
|
|
64
|
+
slug: string;
|
|
65
|
+
data: Record<string, unknown>;
|
|
66
|
+
}
|
|
67
|
+
export interface APIClientOptions {
|
|
68
|
+
baseURL?: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* API Client class for making authenticated requests to RevealUI CMS API
|
|
72
|
+
*/
|
|
73
|
+
export declare class APIClient {
|
|
74
|
+
private baseURL;
|
|
75
|
+
constructor(options?: APIClientOptions);
|
|
76
|
+
/**
|
|
77
|
+
* Make an authenticated API request
|
|
78
|
+
*/
|
|
79
|
+
private request;
|
|
80
|
+
/**
|
|
81
|
+
* Find documents in a collection
|
|
82
|
+
*/
|
|
83
|
+
find(options: FindOptions): Promise<APIResponse>;
|
|
84
|
+
/**
|
|
85
|
+
* Find a single document by ID
|
|
86
|
+
*/
|
|
87
|
+
findById(collection: string, id: string): Promise<RevealDocument>;
|
|
88
|
+
/**
|
|
89
|
+
* Create a new document
|
|
90
|
+
*/
|
|
91
|
+
create(options: CreateOptions): Promise<RevealDocument>;
|
|
92
|
+
/**
|
|
93
|
+
* Update an existing document
|
|
94
|
+
*/
|
|
95
|
+
update(options: UpdateOptions): Promise<RevealDocument>;
|
|
96
|
+
/**
|
|
97
|
+
* Delete a document
|
|
98
|
+
*/
|
|
99
|
+
delete(options: DeleteOptions): Promise<void>;
|
|
100
|
+
/**
|
|
101
|
+
* Find a global by slug
|
|
102
|
+
*/
|
|
103
|
+
findGlobal(options: FindGlobalOptions): Promise<RevealDocument>;
|
|
104
|
+
/**
|
|
105
|
+
* Update a global
|
|
106
|
+
*/
|
|
107
|
+
updateGlobal(options: UpdateGlobalOptions): Promise<RevealDocument>;
|
|
108
|
+
}
|
|
109
|
+
export declare const apiClient: APIClient;
|
|
110
|
+
//# sourceMappingURL=apiClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiClient.d.ts","sourceRoot":"","sources":["../../../../src/client/admin/utils/apiClient.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAG7D,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,cAAc;IAC7C,IAAI,CAAC,EAAE,CAAC,EAAE,CAAA;IACV,GAAG,CAAC,EAAE,CAAC,CAAA;IACP,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACpD;AAED,oBAAY,YAAY;IACtB,OAAO,YAAY;IACnB,cAAc,mBAAmB;IACjC,aAAa,kBAAkB;IAC/B,UAAU,eAAe;IACzB,QAAQ,cAAc;IACtB,MAAM,WAAW;CAClB;AAED,qBAAa,QAAS,SAAQ,KAAK;IAExB,IAAI,EAAE,YAAY;IAElB,MAAM,CAAC,EAAE,MAAM;IACf,KAAK,CAAC,EAAE,MAAM;gBAHd,IAAI,EAAE,YAAY,EACzB,OAAO,EAAE,MAAM,EACR,MAAM,CAAC,EAAE,MAAM,YAAA,EACf,KAAK,CAAC,EAAE,MAAM,YAAA;CAKxB;AAED,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC9B;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAA;IAClB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC9B;AAED,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAA;IAClB,EAAE,EAAE,MAAM,CAAA;CACX;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC9B;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AA+BD;;GAEG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,OAAO,CAAQ;gBAEX,OAAO,GAAE,gBAAqB;IAW1C;;OAEG;YACW,OAAO;IAyFrB;;OAEG;IACG,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IAuBtD;;OAEG;IACG,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAUvE;;OAEG;IACG,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC;IAY7D;;OAEG;IACG,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC;IAY7D;;OAEG;IACG,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IASnD;;OAEG;IACG,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,CAAC;IAerE;;OAEG;IACG,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,cAAc,CAAC;CAe1E;AAGD,eAAO,MAAM,SAAS,WAAkB,CAAA"}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API Client for RevealUI Admin Dashboard
|
|
3
|
+
* Handles all API communication with authentication and error handling
|
|
4
|
+
*/
|
|
5
|
+
import { getAuthHeader } from './auth.js';
|
|
6
|
+
export var APIErrorType;
|
|
7
|
+
(function (APIErrorType) {
|
|
8
|
+
APIErrorType["Network"] = "network";
|
|
9
|
+
APIErrorType["Authentication"] = "authentication";
|
|
10
|
+
APIErrorType["Authorization"] = "authorization";
|
|
11
|
+
APIErrorType["Validation"] = "validation";
|
|
12
|
+
APIErrorType["NotFound"] = "not_found";
|
|
13
|
+
APIErrorType["Server"] = "server";
|
|
14
|
+
})(APIErrorType || (APIErrorType = {}));
|
|
15
|
+
export class APIError extends Error {
|
|
16
|
+
type;
|
|
17
|
+
status;
|
|
18
|
+
field;
|
|
19
|
+
constructor(type, message, status, field) {
|
|
20
|
+
super(message);
|
|
21
|
+
this.type = type;
|
|
22
|
+
this.status = status;
|
|
23
|
+
this.field = field;
|
|
24
|
+
this.name = 'APIError';
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const parseErrorPayload = async (response) => {
|
|
28
|
+
const data = (await response.json().catch(() => null));
|
|
29
|
+
if (!data || typeof data !== 'object') {
|
|
30
|
+
return {};
|
|
31
|
+
}
|
|
32
|
+
return data;
|
|
33
|
+
};
|
|
34
|
+
const getErrorMessage = (payload, fallback) => {
|
|
35
|
+
if (typeof payload.message === 'string' && payload.message.length > 0) {
|
|
36
|
+
return payload.message;
|
|
37
|
+
}
|
|
38
|
+
const firstError = Array.isArray(payload.errors) ? payload.errors[0] : undefined;
|
|
39
|
+
if (firstError && typeof firstError.message === 'string' && firstError.message.length > 0) {
|
|
40
|
+
return firstError.message;
|
|
41
|
+
}
|
|
42
|
+
return fallback;
|
|
43
|
+
};
|
|
44
|
+
const getErrorField = (payload) => {
|
|
45
|
+
const firstError = Array.isArray(payload.errors) ? payload.errors[0] : undefined;
|
|
46
|
+
return typeof firstError?.field === 'string' ? firstError.field : undefined;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* API Client class for making authenticated requests to RevealUI CMS API
|
|
50
|
+
*/
|
|
51
|
+
export class APIClient {
|
|
52
|
+
baseURL;
|
|
53
|
+
constructor(options = {}) {
|
|
54
|
+
// Get base URL from environment or use default
|
|
55
|
+
this.baseURL =
|
|
56
|
+
options.baseURL ||
|
|
57
|
+
(typeof window !== 'undefined'
|
|
58
|
+
? window.location.origin
|
|
59
|
+
: process.env.NEXT_PUBLIC_SERVER_URL ||
|
|
60
|
+
process.env.REVEALUI_PUBLIC_SERVER_URL ||
|
|
61
|
+
'http://localhost:4000');
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Make an authenticated API request
|
|
65
|
+
*/
|
|
66
|
+
async request(endpoint, options = {}) {
|
|
67
|
+
const authHeader = getAuthHeader();
|
|
68
|
+
const headers = {
|
|
69
|
+
'Content-Type': 'application/json',
|
|
70
|
+
// biome-ignore lint/style/useNamingConvention: HTTP header key.
|
|
71
|
+
...(authHeader && { Authorization: authHeader }),
|
|
72
|
+
...options.headers,
|
|
73
|
+
};
|
|
74
|
+
const url = `${this.baseURL}${endpoint}`;
|
|
75
|
+
try {
|
|
76
|
+
const response = await fetch(url, {
|
|
77
|
+
...options,
|
|
78
|
+
headers,
|
|
79
|
+
credentials: 'include', // Include cookies for authentication
|
|
80
|
+
});
|
|
81
|
+
// Handle authentication errors
|
|
82
|
+
if (response.status === 401) {
|
|
83
|
+
throw new APIError(APIErrorType.Authentication, 'Authentication required. Please log in.', 401);
|
|
84
|
+
}
|
|
85
|
+
// Handle authorization errors
|
|
86
|
+
if (response.status === 403) {
|
|
87
|
+
throw new APIError(APIErrorType.Authorization, 'You do not have permission to perform this action.', 403);
|
|
88
|
+
}
|
|
89
|
+
// Handle not found errors
|
|
90
|
+
if (response.status === 404) {
|
|
91
|
+
throw new APIError(APIErrorType.NotFound, 'Resource not found.', 404);
|
|
92
|
+
}
|
|
93
|
+
// Handle validation errors
|
|
94
|
+
if (response.status === 400) {
|
|
95
|
+
const errorData = await parseErrorPayload(response);
|
|
96
|
+
const errorMessage = getErrorMessage(errorData, 'Validation error');
|
|
97
|
+
throw new APIError(APIErrorType.Validation, errorMessage, 400, getErrorField(errorData));
|
|
98
|
+
}
|
|
99
|
+
// Handle server errors
|
|
100
|
+
if (response.status >= 500) {
|
|
101
|
+
throw new APIError(APIErrorType.Server, 'Server error. Please try again later.', response.status);
|
|
102
|
+
}
|
|
103
|
+
// Parse response
|
|
104
|
+
if (!response.ok) {
|
|
105
|
+
const errorData = await parseErrorPayload(response);
|
|
106
|
+
throw new APIError(APIErrorType.Server, getErrorMessage(errorData, `Request failed with status ${response.status}`), response.status);
|
|
107
|
+
}
|
|
108
|
+
return (await response.json());
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
// Handle network errors
|
|
112
|
+
if (error instanceof TypeError && error.message.includes('fetch')) {
|
|
113
|
+
throw new APIError(APIErrorType.Network, 'Network error. Please check your connection.', 0);
|
|
114
|
+
}
|
|
115
|
+
// Re-throw API errors
|
|
116
|
+
if (error instanceof APIError) {
|
|
117
|
+
throw error;
|
|
118
|
+
}
|
|
119
|
+
// Handle unknown errors
|
|
120
|
+
throw new APIError(APIErrorType.Server, error instanceof Error ? error.message : 'Unknown error occurred', 0);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Find documents in a collection
|
|
125
|
+
*/
|
|
126
|
+
async find(options) {
|
|
127
|
+
const { collection, page = 1, limit = 10, where, sort, depth } = options;
|
|
128
|
+
const params = new URLSearchParams();
|
|
129
|
+
params.set('page', String(page));
|
|
130
|
+
params.set('limit', String(limit));
|
|
131
|
+
if (where) {
|
|
132
|
+
params.set('where', JSON.stringify(where));
|
|
133
|
+
}
|
|
134
|
+
if (sort) {
|
|
135
|
+
params.set('sort', sort);
|
|
136
|
+
}
|
|
137
|
+
if (depth !== undefined) {
|
|
138
|
+
params.set('depth', String(depth));
|
|
139
|
+
}
|
|
140
|
+
const endpoint = `/api/collections/${collection}?${params.toString()}`;
|
|
141
|
+
return this.request(endpoint, {
|
|
142
|
+
method: 'GET',
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Find a single document by ID
|
|
147
|
+
*/
|
|
148
|
+
async findById(collection, id) {
|
|
149
|
+
const endpoint = `/api/collections/${collection}/${id}`;
|
|
150
|
+
const response = await this.request(endpoint, {
|
|
151
|
+
method: 'GET',
|
|
152
|
+
});
|
|
153
|
+
return response.doc;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Create a new document
|
|
157
|
+
*/
|
|
158
|
+
async create(options) {
|
|
159
|
+
const { collection, data } = options;
|
|
160
|
+
const endpoint = `/api/collections/${collection}`;
|
|
161
|
+
const response = await this.request(endpoint, {
|
|
162
|
+
method: 'POST',
|
|
163
|
+
body: JSON.stringify(data),
|
|
164
|
+
});
|
|
165
|
+
return response.doc;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Update an existing document
|
|
169
|
+
*/
|
|
170
|
+
async update(options) {
|
|
171
|
+
const { collection, id, data } = options;
|
|
172
|
+
const endpoint = `/api/collections/${collection}/${id}`;
|
|
173
|
+
const response = await this.request(endpoint, {
|
|
174
|
+
method: 'PATCH',
|
|
175
|
+
body: JSON.stringify(data),
|
|
176
|
+
});
|
|
177
|
+
return response.doc;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Delete a document
|
|
181
|
+
*/
|
|
182
|
+
async delete(options) {
|
|
183
|
+
const { collection, id } = options;
|
|
184
|
+
const endpoint = `/api/collections/${collection}/${id}`;
|
|
185
|
+
await this.request(endpoint, {
|
|
186
|
+
method: 'DELETE',
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Find a global by slug
|
|
191
|
+
*/
|
|
192
|
+
async findGlobal(options) {
|
|
193
|
+
const { slug, depth = 0 } = options;
|
|
194
|
+
const endpoint = `/api/globals/${slug}?depth=${depth}`;
|
|
195
|
+
const response = await this.request(endpoint, {
|
|
196
|
+
method: 'GET',
|
|
197
|
+
});
|
|
198
|
+
if (!response.doc) {
|
|
199
|
+
throw new APIError(APIErrorType.NotFound, `Global '${slug}' not found`, 404);
|
|
200
|
+
}
|
|
201
|
+
return response.doc;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Update a global
|
|
205
|
+
*/
|
|
206
|
+
async updateGlobal(options) {
|
|
207
|
+
const { slug, data } = options;
|
|
208
|
+
const endpoint = `/api/globals/${slug}`;
|
|
209
|
+
const response = await this.request(endpoint, {
|
|
210
|
+
method: 'POST',
|
|
211
|
+
body: JSON.stringify(data),
|
|
212
|
+
});
|
|
213
|
+
if (!response.doc) {
|
|
214
|
+
throw new APIError(APIErrorType.Server, 'Failed to update global');
|
|
215
|
+
}
|
|
216
|
+
return response.doc;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
// Export singleton instance
|
|
220
|
+
export const apiClient = new APIClient();
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Authentication utilities for admin dashboard
|
|
3
|
+
* Handles JWT token retrieval and management
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Get JWT token from cookies or localStorage
|
|
7
|
+
* Priority: cookies > localStorage
|
|
8
|
+
*/
|
|
9
|
+
export declare function getAuthToken(): string | null;
|
|
10
|
+
/**
|
|
11
|
+
* Set JWT token in localStorage
|
|
12
|
+
* Note: Cookies are set server-side, this is for client-side fallback
|
|
13
|
+
*/
|
|
14
|
+
export declare function setAuthToken(token: string): void;
|
|
15
|
+
/**
|
|
16
|
+
* Remove JWT token from storage
|
|
17
|
+
*/
|
|
18
|
+
export declare function clearAuthToken(): void;
|
|
19
|
+
/**
|
|
20
|
+
* Get Authorization header value
|
|
21
|
+
*/
|
|
22
|
+
export declare function getAuthHeader(): string | null;
|
|
23
|
+
/**
|
|
24
|
+
* Check if user is authenticated
|
|
25
|
+
*/
|
|
26
|
+
export declare function isAuthenticated(): boolean;
|
|
27
|
+
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../../src/client/admin/utils/auth.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,wBAAgB,YAAY,IAAI,MAAM,GAAG,IAAI,CAoB5C;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAIhD;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAKrC;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,MAAM,GAAG,IAAI,CAG7C;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAEzC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Authentication utilities for admin dashboard
|
|
3
|
+
* Handles JWT token retrieval and management
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Get JWT token from cookies or localStorage
|
|
7
|
+
* Priority: cookies > localStorage
|
|
8
|
+
*/
|
|
9
|
+
export function getAuthToken() {
|
|
10
|
+
// Try to get from cookies first (server-side compatible)
|
|
11
|
+
if (typeof document !== 'undefined') {
|
|
12
|
+
const cookies = document.cookie.split(';');
|
|
13
|
+
const tokenCookie = cookies.find((cookie) => {
|
|
14
|
+
// Defensive check: cookie might be undefined or empty
|
|
15
|
+
if (!cookie || typeof cookie !== 'string') {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
return cookie.trim().startsWith('revealui-token=');
|
|
19
|
+
});
|
|
20
|
+
if (tokenCookie) {
|
|
21
|
+
return tokenCookie.split('=')[1]?.trim() || null;
|
|
22
|
+
}
|
|
23
|
+
// Fallback to localStorage
|
|
24
|
+
return localStorage.getItem('revealui-token');
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Set JWT token in localStorage
|
|
30
|
+
* Note: Cookies are set server-side, this is for client-side fallback
|
|
31
|
+
*/
|
|
32
|
+
export function setAuthToken(token) {
|
|
33
|
+
if (typeof localStorage !== 'undefined') {
|
|
34
|
+
localStorage.setItem('revealui-token', token);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Remove JWT token from storage
|
|
39
|
+
*/
|
|
40
|
+
export function clearAuthToken() {
|
|
41
|
+
if (typeof localStorage !== 'undefined') {
|
|
42
|
+
localStorage.removeItem('revealui-token');
|
|
43
|
+
}
|
|
44
|
+
// Note: Cookie clearing should be done server-side
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Get Authorization header value
|
|
48
|
+
*/
|
|
49
|
+
export function getAuthHeader() {
|
|
50
|
+
const token = getAuthToken();
|
|
51
|
+
return token ? `JWT ${token}` : null;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Check if user is authenticated
|
|
55
|
+
*/
|
|
56
|
+
export function isAuthenticated() {
|
|
57
|
+
return getAuthToken() !== null;
|
|
58
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/client/admin/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RevealConfig } from '../../../types/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a serializable version of RevealConfig by removing all functions
|
|
4
|
+
* This is necessary for passing config to client components in Next.js
|
|
5
|
+
*/
|
|
6
|
+
export declare function serializeConfig(config: RevealConfig): RevealConfig;
|
|
7
|
+
//# sourceMappingURL=serializeConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializeConfig.d.ts","sourceRoot":"","sources":["../../../../src/client/admin/utils/serializeConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAmC3D;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,CAElE"}
|