@revealui/core 0.0.1-pre.3 → 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 -697
- package/LICENSE_SUMMARY.md +0 -55
- package/NOTICE +0 -34
- package/dist/core/gaurds/logger/log404/index.spec.snapshot-1 +0 -8
- package/dist/core/gaurds/logger/log404/index.spec.snapshot-2 +0 -9
- 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 -17
- package/dist/exports/cli.js +0 -3
- 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/node/cli/index.js +0 -18
- 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,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RevealUI Logger
|
|
3
|
+
*
|
|
4
|
+
* Production-safe logging utility for RevealUI framework operations.
|
|
5
|
+
* Info/warn messages are no-ops in production to avoid console pollution.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Production-safe logger implementation
|
|
9
|
+
* Info/warn messages are completely silenced in production
|
|
10
|
+
*/
|
|
11
|
+
export class Logger {
|
|
12
|
+
info(...args) {
|
|
13
|
+
// Info messages are never logged in production
|
|
14
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
15
|
+
console.log('[RevealUI]', ...args);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
warn(...args) {
|
|
19
|
+
// Warning messages are never logged in production
|
|
20
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
21
|
+
console.warn('[RevealUI]', ...args);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
error(...args) {
|
|
25
|
+
console.error('[RevealUI]', ...args);
|
|
26
|
+
}
|
|
27
|
+
debug(...args) {
|
|
28
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
29
|
+
console.debug('[RevealUI]', ...args);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Creates a new logger instance
|
|
35
|
+
*/
|
|
36
|
+
export function createLogger() {
|
|
37
|
+
return new Logger();
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Default logger instance
|
|
41
|
+
*/
|
|
42
|
+
export const defaultLogger = new Logger();
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create Method
|
|
3
|
+
*
|
|
4
|
+
* Creates a new document in a collection with hook handling.
|
|
5
|
+
*/
|
|
6
|
+
import type { RevealCreateOptions, RevealDocument, RevealUIInstance } from '../../types/index.js';
|
|
7
|
+
export declare function create(instance: RevealUIInstance, ensureDbConnected: () => Promise<void>, options: RevealCreateOptions & {
|
|
8
|
+
collection: string;
|
|
9
|
+
}): Promise<RevealDocument>;
|
|
10
|
+
//# sourceMappingURL=create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/instance/methods/create.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAIjG,wBAAsB,MAAM,CAC1B,QAAQ,EAAE,gBAAgB,EAC1B,iBAAiB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EACtC,OAAO,EAAE,mBAAmB,GAAG;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,GACpD,OAAO,CAAC,cAAc,CAAC,CAyCzB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create Method
|
|
3
|
+
*
|
|
4
|
+
* Creates a new document in a collection with hook handling.
|
|
5
|
+
*/
|
|
6
|
+
import { validateJWTFromRequest } from '../../utils/jwt-validation.js';
|
|
7
|
+
import { callHooks } from './hooks.js';
|
|
8
|
+
export async function create(instance, ensureDbConnected, options) {
|
|
9
|
+
await ensureDbConnected();
|
|
10
|
+
const { collection, req } = options;
|
|
11
|
+
// Validate JWT token if authorization header is provided
|
|
12
|
+
await validateJWTFromRequest(req);
|
|
13
|
+
if (!instance.collections[collection]) {
|
|
14
|
+
throw new Error(`Collection '${collection}' not found`);
|
|
15
|
+
}
|
|
16
|
+
const collectionConfig = instance.config.collections?.find((c) => c.slug === collection);
|
|
17
|
+
// Enforce collection-level access control
|
|
18
|
+
if (collectionConfig?.access?.create && options.req) {
|
|
19
|
+
const canCreate = await collectionConfig.access.create({ req: options.req, data: options.data });
|
|
20
|
+
if (!canCreate) {
|
|
21
|
+
throw new Error('Access denied: you do not have permission to create in this collection');
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
let doc = await instance.collections[collection].create(options);
|
|
25
|
+
// Call afterChange hooks
|
|
26
|
+
if (collectionConfig?.hooks?.afterChange && req) {
|
|
27
|
+
doc = await callHooks(collectionConfig.hooks.afterChange, {
|
|
28
|
+
doc,
|
|
29
|
+
context: {
|
|
30
|
+
revealui: instance,
|
|
31
|
+
collection,
|
|
32
|
+
operation: 'create',
|
|
33
|
+
req,
|
|
34
|
+
},
|
|
35
|
+
}, instance);
|
|
36
|
+
}
|
|
37
|
+
return doc;
|
|
38
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Delete Method
|
|
3
|
+
*
|
|
4
|
+
* Deletes a document from a collection.
|
|
5
|
+
*/
|
|
6
|
+
import type { RevealDeleteOptions, RevealDocument, RevealUIInstance } from '../../types/index.js';
|
|
7
|
+
export declare function deleteMethod(instance: RevealUIInstance, ensureDbConnected: () => Promise<void>, options: RevealDeleteOptions & {
|
|
8
|
+
collection: string;
|
|
9
|
+
}): Promise<RevealDocument>;
|
|
10
|
+
//# sourceMappingURL=delete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../src/instance/methods/delete.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAGjG,wBAAsB,YAAY,CAChC,QAAQ,EAAE,gBAAgB,EAC1B,iBAAiB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EACtC,OAAO,EAAE,mBAAmB,GAAG;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,GACpD,OAAO,CAAC,cAAc,CAAC,CAqBzB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Delete Method
|
|
3
|
+
*
|
|
4
|
+
* Deletes a document from a collection.
|
|
5
|
+
*/
|
|
6
|
+
import { validateJWTFromRequest } from '../../utils/jwt-validation.js';
|
|
7
|
+
export async function deleteMethod(instance, ensureDbConnected, options) {
|
|
8
|
+
await ensureDbConnected();
|
|
9
|
+
const { collection, req } = options;
|
|
10
|
+
// Validate JWT token if authorization header is provided
|
|
11
|
+
await validateJWTFromRequest(req);
|
|
12
|
+
if (!instance.collections[collection]) {
|
|
13
|
+
throw new Error(`Collection '${collection}' not found`);
|
|
14
|
+
}
|
|
15
|
+
// Enforce collection-level access control
|
|
16
|
+
const collectionConfig = instance.config.collections?.find((c) => c.slug === collection);
|
|
17
|
+
if (collectionConfig?.access?.delete && options.req) {
|
|
18
|
+
const canDelete = await collectionConfig.access.delete({ req: options.req, id: options.id });
|
|
19
|
+
if (!canDelete) {
|
|
20
|
+
throw new Error('Access denied: you do not have permission to delete in this collection');
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return instance.collections[collection].delete(options);
|
|
24
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Find Method
|
|
3
|
+
*
|
|
4
|
+
* Finds multiple documents from a collection with validation and DataLoader setup.
|
|
5
|
+
*/
|
|
6
|
+
import type { RevealFindOptions, RevealPaginatedResult, RevealUIInstance } from '../../types/index.js';
|
|
7
|
+
export declare function find(instance: RevealUIInstance, ensureDbConnected: () => Promise<void>, options: RevealFindOptions & {
|
|
8
|
+
collection: string;
|
|
9
|
+
}): Promise<RevealPaginatedResult>;
|
|
10
|
+
//# sourceMappingURL=find.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find.d.ts","sourceRoot":"","sources":["../../../src/instance/methods/find.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,sBAAsB,CAAA;AAG7B,wBAAsB,IAAI,CACxB,QAAQ,EAAE,gBAAgB,EAC1B,iBAAiB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EACtC,OAAO,EAAE,iBAAiB,GAAG;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,GAClD,OAAO,CAAC,qBAAqB,CAAC,CAmBhC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Find Method
|
|
3
|
+
*
|
|
4
|
+
* Finds multiple documents from a collection with validation and DataLoader setup.
|
|
5
|
+
*/
|
|
6
|
+
import { getDataLoader } from '../../dataloader.js';
|
|
7
|
+
import { validateJWTFromRequest } from '../../utils/jwt-validation.js';
|
|
8
|
+
export async function find(instance, ensureDbConnected, options) {
|
|
9
|
+
await ensureDbConnected();
|
|
10
|
+
const { collection, req } = options;
|
|
11
|
+
// Validate JWT token if authorization header is provided
|
|
12
|
+
await validateJWTFromRequest(req);
|
|
13
|
+
if (!instance.collections[collection]) {
|
|
14
|
+
throw new Error(`Collection '${collection}' not found`);
|
|
15
|
+
}
|
|
16
|
+
// Ensure request context has DataLoader if needed
|
|
17
|
+
if (req && !req.dataLoader) {
|
|
18
|
+
req.revealui = instance;
|
|
19
|
+
req.transactionID = req.transactionID || 'default';
|
|
20
|
+
req.dataLoader = getDataLoader(req);
|
|
21
|
+
}
|
|
22
|
+
return instance.collections[collection].find(options);
|
|
23
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Find By ID Method
|
|
3
|
+
*
|
|
4
|
+
* Finds a single document by ID from a collection with validation and DataLoader setup.
|
|
5
|
+
*/
|
|
6
|
+
import type { RevealDocument, RevealRequest, RevealUIInstance } from '../../types/index.js';
|
|
7
|
+
export declare function findByID(instance: RevealUIInstance, ensureDbConnected: () => Promise<void>, options: {
|
|
8
|
+
collection: string;
|
|
9
|
+
id: string | number;
|
|
10
|
+
depth?: number;
|
|
11
|
+
req?: RevealRequest;
|
|
12
|
+
}): Promise<RevealDocument | null>;
|
|
13
|
+
//# sourceMappingURL=findById.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findById.d.ts","sourceRoot":"","sources":["../../../src/instance/methods/findById.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAG3F,wBAAsB,QAAQ,CAC5B,QAAQ,EAAE,gBAAgB,EAC1B,iBAAiB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EACtC,OAAO,EAAE;IACP,UAAU,EAAE,MAAM,CAAA;IAClB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,aAAa,CAAA;CACpB,GACA,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAmBhC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Find By ID Method
|
|
3
|
+
*
|
|
4
|
+
* Finds a single document by ID from a collection with validation and DataLoader setup.
|
|
5
|
+
*/
|
|
6
|
+
import { getDataLoader } from '../../dataloader.js';
|
|
7
|
+
import { validateJWTFromRequest } from '../../utils/jwt-validation.js';
|
|
8
|
+
export async function findByID(instance, ensureDbConnected, options) {
|
|
9
|
+
await ensureDbConnected();
|
|
10
|
+
const { collection, req } = options;
|
|
11
|
+
// Validate JWT token if authorization header is provided
|
|
12
|
+
await validateJWTFromRequest(req);
|
|
13
|
+
if (!instance.collections[collection]) {
|
|
14
|
+
throw new Error(`Collection '${collection}' not found`);
|
|
15
|
+
}
|
|
16
|
+
// Initialize DataLoader for the request if it doesn't exist
|
|
17
|
+
if (req && !req.dataLoader) {
|
|
18
|
+
req.revealui = instance;
|
|
19
|
+
req.transactionID = req.transactionID || 'default';
|
|
20
|
+
req.dataLoader = getDataLoader(req);
|
|
21
|
+
}
|
|
22
|
+
return instance.collections[collection].findByID(options);
|
|
23
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Instance Hooks
|
|
3
|
+
*
|
|
4
|
+
* Utilities for calling instance-level hooks.
|
|
5
|
+
*/
|
|
6
|
+
import type { RevealAfterChangeHook, RevealDocument, RevealHookContext, RevealUIInstance } from '../../types/index.js';
|
|
7
|
+
/**
|
|
8
|
+
* Helper function to call hooks
|
|
9
|
+
*/
|
|
10
|
+
export declare function callHooks(hooks: RevealAfterChangeHook[] | undefined, args: {
|
|
11
|
+
doc: RevealDocument;
|
|
12
|
+
context: RevealHookContext;
|
|
13
|
+
}, revealui: RevealUIInstance): Promise<RevealDocument>;
|
|
14
|
+
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/instance/methods/hooks.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACrB,cAAc,EACd,iBAAiB,EAEjB,gBAAgB,EACjB,MAAM,sBAAsB,CAAA;AAE7B;;GAEG;AACH,wBAAsB,SAAS,CAC7B,KAAK,EAAE,qBAAqB,EAAE,GAAG,SAAS,EAC1C,IAAI,EAAE;IACJ,GAAG,EAAE,cAAc,CAAA;IACnB,OAAO,EAAE,iBAAiB,CAAA;CAC3B,EACD,QAAQ,EAAE,gBAAgB,GACzB,OAAO,CAAC,cAAc,CAAC,CAwBzB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Instance Hooks
|
|
3
|
+
*
|
|
4
|
+
* Utilities for calling instance-level hooks.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Helper function to call hooks
|
|
8
|
+
*/
|
|
9
|
+
export async function callHooks(hooks, args, revealui) {
|
|
10
|
+
let result = args.doc;
|
|
11
|
+
if (!hooks)
|
|
12
|
+
return result;
|
|
13
|
+
for (const hook of hooks) {
|
|
14
|
+
try {
|
|
15
|
+
const hookResult = await hook({
|
|
16
|
+
doc: result,
|
|
17
|
+
context: args.context,
|
|
18
|
+
req: args.context.req || {},
|
|
19
|
+
operation: args.context.operation || 'update',
|
|
20
|
+
previousDoc: args.context.previousDoc,
|
|
21
|
+
collection: args.context.collection || '',
|
|
22
|
+
});
|
|
23
|
+
if (hookResult !== undefined) {
|
|
24
|
+
result = hookResult;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
revealui.logger.error(`Hook execution failed: ${error}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return result;
|
|
32
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Update Method
|
|
3
|
+
*
|
|
4
|
+
* Updates an existing document in a collection with hook handling.
|
|
5
|
+
*/
|
|
6
|
+
import type { RevealDocument, RevealUIInstance, RevealUpdateOptions } from '../../types/index.js';
|
|
7
|
+
export declare function update(instance: RevealUIInstance, ensureDbConnected: () => Promise<void>, options: RevealUpdateOptions & {
|
|
8
|
+
collection: string;
|
|
9
|
+
}): Promise<RevealDocument>;
|
|
10
|
+
//# sourceMappingURL=update.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/instance/methods/update.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAIjG,wBAAsB,MAAM,CAC1B,QAAQ,EAAE,gBAAgB,EAC1B,iBAAiB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EACtC,OAAO,EAAE,mBAAmB,GAAG;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,GACpD,OAAO,CAAC,cAAc,CAAC,CA6CzB"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Update Method
|
|
3
|
+
*
|
|
4
|
+
* Updates an existing document in a collection with hook handling.
|
|
5
|
+
*/
|
|
6
|
+
import { validateJWTFromRequest } from '../../utils/jwt-validation.js';
|
|
7
|
+
import { callHooks } from './hooks.js';
|
|
8
|
+
export async function update(instance, ensureDbConnected, options) {
|
|
9
|
+
await ensureDbConnected();
|
|
10
|
+
const { collection, req } = options;
|
|
11
|
+
// Validate JWT token if authorization header is provided
|
|
12
|
+
await validateJWTFromRequest(req);
|
|
13
|
+
if (!instance.collections[collection]) {
|
|
14
|
+
throw new Error(`Collection '${collection}' not found`);
|
|
15
|
+
}
|
|
16
|
+
const collectionConfig = instance.config.collections?.find((c) => c.slug === collection);
|
|
17
|
+
// Enforce collection-level access control
|
|
18
|
+
if (collectionConfig?.access?.update && options.req) {
|
|
19
|
+
const canUpdate = await collectionConfig.access.update({ req: options.req, id: options.id });
|
|
20
|
+
if (!canUpdate) {
|
|
21
|
+
throw new Error('Access denied: you do not have permission to update in this collection');
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const previousDoc = await instance.collections[collection].findByID({
|
|
25
|
+
id: options.id,
|
|
26
|
+
});
|
|
27
|
+
let doc = await instance.collections[collection].update(options);
|
|
28
|
+
// Call afterChange hooks
|
|
29
|
+
if (collectionConfig?.hooks?.afterChange && req) {
|
|
30
|
+
doc = await callHooks(collectionConfig.hooks.afterChange, {
|
|
31
|
+
doc,
|
|
32
|
+
context: {
|
|
33
|
+
revealui: instance,
|
|
34
|
+
collection,
|
|
35
|
+
operation: 'update',
|
|
36
|
+
previousDoc: previousDoc,
|
|
37
|
+
req,
|
|
38
|
+
},
|
|
39
|
+
}, instance);
|
|
40
|
+
}
|
|
41
|
+
return doc;
|
|
42
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* License validation for RevealUI Pro/Enterprise tiers.
|
|
3
|
+
*
|
|
4
|
+
* @dependencies
|
|
5
|
+
* - jose - JWT token verification (Web Crypto API)
|
|
6
|
+
* - zod - Schema validation for license payloads
|
|
7
|
+
*/
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
/** Available license tiers */
|
|
10
|
+
export type LicenseTier = 'free' | 'pro' | 'enterprise';
|
|
11
|
+
/** Decoded license payload schema */
|
|
12
|
+
declare const licensePayloadSchema: z.ZodObject<{
|
|
13
|
+
tier: z.ZodEnum<{
|
|
14
|
+
pro: "pro";
|
|
15
|
+
enterprise: "enterprise";
|
|
16
|
+
}>;
|
|
17
|
+
customerId: z.ZodString;
|
|
18
|
+
domains: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
19
|
+
maxSites: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
maxUsers: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
iat: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
exp: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
export type LicensePayload = z.infer<typeof licensePayloadSchema>;
|
|
25
|
+
/**
|
|
26
|
+
* Validates a license key JWT and returns the decoded payload.
|
|
27
|
+
* Returns null if the key is invalid, expired, or missing.
|
|
28
|
+
*/
|
|
29
|
+
export declare function validateLicenseKey(licenseKey: string, publicKey: string): Promise<LicensePayload | null>;
|
|
30
|
+
/**
|
|
31
|
+
* Initialize the license system. Call once at application startup.
|
|
32
|
+
* Reads REVEALUI_LICENSE_KEY and REVEALUI_LICENSE_PUBLIC_KEY from environment.
|
|
33
|
+
*
|
|
34
|
+
* @returns The resolved license tier
|
|
35
|
+
*/
|
|
36
|
+
export declare function initializeLicense(): Promise<LicenseTier>;
|
|
37
|
+
/**
|
|
38
|
+
* Returns the current license tier.
|
|
39
|
+
* If the license hasn't been initialized, returns 'free'.
|
|
40
|
+
*/
|
|
41
|
+
export declare function getCurrentTier(): LicenseTier;
|
|
42
|
+
/**
|
|
43
|
+
* Returns the full license payload, or null if no valid license.
|
|
44
|
+
*/
|
|
45
|
+
export declare function getLicensePayload(): LicensePayload | null;
|
|
46
|
+
/**
|
|
47
|
+
* Checks whether the current license is at least the given tier.
|
|
48
|
+
*/
|
|
49
|
+
export declare function isLicensed(requiredTier: LicenseTier): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Returns the maximum number of sites allowed by the current license.
|
|
52
|
+
*/
|
|
53
|
+
export declare function getMaxSites(): number;
|
|
54
|
+
/**
|
|
55
|
+
* Returns the maximum number of users/editors allowed by the current license.
|
|
56
|
+
*/
|
|
57
|
+
export declare function getMaxUsers(): number;
|
|
58
|
+
/**
|
|
59
|
+
* Generates a signed license key JWT.
|
|
60
|
+
* This is a server-only function — requires the private key.
|
|
61
|
+
*
|
|
62
|
+
* @param payload - License payload (tier, customerId, limits)
|
|
63
|
+
* @param privateKey - RS256 or ES256 private key (PEM format)
|
|
64
|
+
* @param expiresInSeconds - JWT expiration in seconds. Defaults to 1 year.
|
|
65
|
+
* @returns Signed JWT string
|
|
66
|
+
*/
|
|
67
|
+
export declare function generateLicenseKey(payload: Omit<LicensePayload, 'iat' | 'exp'>, privateKey: string, expiresInSeconds?: number): Promise<string>;
|
|
68
|
+
/**
|
|
69
|
+
* Reset license state. Primarily for testing.
|
|
70
|
+
*/
|
|
71
|
+
export declare function resetLicenseState(): void;
|
|
72
|
+
export {};
|
|
73
|
+
//# sourceMappingURL=license.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"license.d.ts","sourceRoot":"","sources":["../src/license.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,8BAA8B;AAC9B,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,KAAK,GAAG,YAAY,CAAA;AAEvD,qCAAqC;AACrC,QAAA,MAAM,oBAAoB;;;;;;;;;;;iBAexB,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AA+BjE;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAgBhC;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,WAAW,CAAC,CAuB9D;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAE5C;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,cAAc,GAAG,IAAI,CAEzD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,YAAY,EAAE,WAAW,GAAG,OAAO,CAQ7D;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAIpC;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAIpC;AAED;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,KAAK,GAAG,KAAK,CAAC,EAC5C,UAAU,EAAE,MAAM,EAClB,gBAAgB,SAAqB,GACpC,OAAO,CAAC,MAAM,CAAC,CAOjB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAExC"}
|
package/dist/license.js
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* License validation for RevealUI Pro/Enterprise tiers.
|
|
3
|
+
*
|
|
4
|
+
* @dependencies
|
|
5
|
+
* - jose - JWT token verification (Web Crypto API)
|
|
6
|
+
* - zod - Schema validation for license payloads
|
|
7
|
+
*/
|
|
8
|
+
import { importPKCS8, importSPKI, jwtVerify, SignJWT } from 'jose';
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
/** Decoded license payload schema */
|
|
11
|
+
const licensePayloadSchema = z.object({
|
|
12
|
+
/** License tier */
|
|
13
|
+
tier: z.enum(['pro', 'enterprise']),
|
|
14
|
+
/** Organization or customer ID */
|
|
15
|
+
customerId: z.string(),
|
|
16
|
+
/** Licensed domain(s) */
|
|
17
|
+
domains: z.array(z.string()).optional(),
|
|
18
|
+
/** Maximum number of sites allowed */
|
|
19
|
+
maxSites: z.number().int().positive().optional(),
|
|
20
|
+
/** Maximum number of users/editors allowed */
|
|
21
|
+
maxUsers: z.number().int().positive().optional(),
|
|
22
|
+
/** License issued-at timestamp */
|
|
23
|
+
iat: z.number().optional(),
|
|
24
|
+
/** License expiration timestamp */
|
|
25
|
+
exp: z.number().optional(),
|
|
26
|
+
});
|
|
27
|
+
let cachedState = {
|
|
28
|
+
tier: 'free',
|
|
29
|
+
payload: null,
|
|
30
|
+
validatedAt: null,
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* The public key used to verify license JWTs.
|
|
34
|
+
* In production, this is fetched from the license server.
|
|
35
|
+
* For local development, it reads from REVEALUI_LICENSE_PUBLIC_KEY env var.
|
|
36
|
+
*/
|
|
37
|
+
function getPublicKey() {
|
|
38
|
+
return process.env.REVEALUI_LICENSE_PUBLIC_KEY ?? null;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Reads the license key from environment.
|
|
42
|
+
*/
|
|
43
|
+
function getLicenseKey() {
|
|
44
|
+
return process.env.REVEALUI_LICENSE_KEY ?? null;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Validates a license key JWT and returns the decoded payload.
|
|
48
|
+
* Returns null if the key is invalid, expired, or missing.
|
|
49
|
+
*/
|
|
50
|
+
export async function validateLicenseKey(licenseKey, publicKey) {
|
|
51
|
+
try {
|
|
52
|
+
const key = await importSPKI(publicKey, 'RS256');
|
|
53
|
+
const { payload } = await jwtVerify(licenseKey, key, {
|
|
54
|
+
algorithms: ['RS256', 'ES256'],
|
|
55
|
+
});
|
|
56
|
+
const result = licensePayloadSchema.safeParse(payload);
|
|
57
|
+
if (!result.success) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
return result.data;
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Initialize the license system. Call once at application startup.
|
|
68
|
+
* Reads REVEALUI_LICENSE_KEY and REVEALUI_LICENSE_PUBLIC_KEY from environment.
|
|
69
|
+
*
|
|
70
|
+
* @returns The resolved license tier
|
|
71
|
+
*/
|
|
72
|
+
export async function initializeLicense() {
|
|
73
|
+
const licenseKey = getLicenseKey();
|
|
74
|
+
const publicKey = getPublicKey();
|
|
75
|
+
if (!(licenseKey && publicKey)) {
|
|
76
|
+
cachedState = { tier: 'free', payload: null, validatedAt: Date.now() };
|
|
77
|
+
return 'free';
|
|
78
|
+
}
|
|
79
|
+
const payload = await validateLicenseKey(licenseKey, publicKey);
|
|
80
|
+
if (!payload) {
|
|
81
|
+
cachedState = { tier: 'free', payload: null, validatedAt: Date.now() };
|
|
82
|
+
return 'free';
|
|
83
|
+
}
|
|
84
|
+
cachedState = {
|
|
85
|
+
tier: payload.tier,
|
|
86
|
+
payload,
|
|
87
|
+
validatedAt: Date.now(),
|
|
88
|
+
};
|
|
89
|
+
return payload.tier;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Returns the current license tier.
|
|
93
|
+
* If the license hasn't been initialized, returns 'free'.
|
|
94
|
+
*/
|
|
95
|
+
export function getCurrentTier() {
|
|
96
|
+
return cachedState.tier;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Returns the full license payload, or null if no valid license.
|
|
100
|
+
*/
|
|
101
|
+
export function getLicensePayload() {
|
|
102
|
+
return cachedState.payload;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Checks whether the current license is at least the given tier.
|
|
106
|
+
*/
|
|
107
|
+
export function isLicensed(requiredTier) {
|
|
108
|
+
const tierRank = {
|
|
109
|
+
free: 0,
|
|
110
|
+
pro: 1,
|
|
111
|
+
enterprise: 2,
|
|
112
|
+
};
|
|
113
|
+
return tierRank[cachedState.tier] >= tierRank[requiredTier];
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Returns the maximum number of sites allowed by the current license.
|
|
117
|
+
*/
|
|
118
|
+
export function getMaxSites() {
|
|
119
|
+
if (cachedState.tier === 'enterprise')
|
|
120
|
+
return Infinity;
|
|
121
|
+
if (cachedState.tier === 'pro')
|
|
122
|
+
return cachedState.payload?.maxSites ?? 5;
|
|
123
|
+
return 1;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Returns the maximum number of users/editors allowed by the current license.
|
|
127
|
+
*/
|
|
128
|
+
export function getMaxUsers() {
|
|
129
|
+
if (cachedState.tier === 'enterprise')
|
|
130
|
+
return Infinity;
|
|
131
|
+
if (cachedState.tier === 'pro')
|
|
132
|
+
return cachedState.payload?.maxUsers ?? 25;
|
|
133
|
+
return 3;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Generates a signed license key JWT.
|
|
137
|
+
* This is a server-only function — requires the private key.
|
|
138
|
+
*
|
|
139
|
+
* @param payload - License payload (tier, customerId, limits)
|
|
140
|
+
* @param privateKey - RS256 or ES256 private key (PEM format)
|
|
141
|
+
* @param expiresInSeconds - JWT expiration in seconds. Defaults to 1 year.
|
|
142
|
+
* @returns Signed JWT string
|
|
143
|
+
*/
|
|
144
|
+
export async function generateLicenseKey(payload, privateKey, expiresInSeconds = 365 * 24 * 60 * 60) {
|
|
145
|
+
const key = await importPKCS8(privateKey, 'RS256');
|
|
146
|
+
return new SignJWT({ ...payload })
|
|
147
|
+
.setProtectedHeader({ alg: 'RS256' })
|
|
148
|
+
.setIssuedAt()
|
|
149
|
+
.setExpirationTime(`${expiresInSeconds}s`)
|
|
150
|
+
.sign(key);
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Reset license state. Primarily for testing.
|
|
154
|
+
*/
|
|
155
|
+
export function resetLicenseState() {
|
|
156
|
+
cachedState = { tier: 'free', payload: null, validatedAt: null };
|
|
157
|
+
}
|