@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,285 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* React Error Boundary Components
|
|
4
|
+
*
|
|
5
|
+
* Catch and handle React component errors gracefully
|
|
6
|
+
*/
|
|
7
|
+
/// <reference types="react" />
|
|
8
|
+
import React, { Component } from 'react';
|
|
9
|
+
import { logger } from '../observability/logger.js';
|
|
10
|
+
/**
|
|
11
|
+
* Error Boundary Component
|
|
12
|
+
*/
|
|
13
|
+
export class ErrorBoundary extends Component {
|
|
14
|
+
constructor(props) {
|
|
15
|
+
super(props);
|
|
16
|
+
this.state = {
|
|
17
|
+
hasError: false,
|
|
18
|
+
error: null,
|
|
19
|
+
errorInfo: null,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
static getDerivedStateFromError(error) {
|
|
23
|
+
return {
|
|
24
|
+
hasError: true,
|
|
25
|
+
error,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
componentDidCatch(error, errorInfo) {
|
|
29
|
+
this.setState({
|
|
30
|
+
errorInfo,
|
|
31
|
+
});
|
|
32
|
+
// Call error handler
|
|
33
|
+
if (this.props.onError) {
|
|
34
|
+
this.props.onError(error, errorInfo);
|
|
35
|
+
}
|
|
36
|
+
// Log error
|
|
37
|
+
logger.error('Error caught by boundary', error, {
|
|
38
|
+
componentStack: errorInfo.componentStack,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
componentDidUpdate(prevProps) {
|
|
42
|
+
const { resetKeys } = this.props;
|
|
43
|
+
// Reset error boundary if resetKeys change
|
|
44
|
+
if (resetKeys && prevProps.resetKeys) {
|
|
45
|
+
const hasResetKeyChanged = resetKeys.some((key, index) => {
|
|
46
|
+
return key !== prevProps.resetKeys?.[index];
|
|
47
|
+
});
|
|
48
|
+
if (hasResetKeyChanged) {
|
|
49
|
+
this.reset();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
reset = () => {
|
|
54
|
+
if (this.props.onReset) {
|
|
55
|
+
this.props.onReset();
|
|
56
|
+
}
|
|
57
|
+
this.setState({
|
|
58
|
+
hasError: false,
|
|
59
|
+
error: null,
|
|
60
|
+
errorInfo: null,
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
render() {
|
|
64
|
+
const { hasError, error, errorInfo } = this.state;
|
|
65
|
+
const { children, fallback, isolate } = this.props;
|
|
66
|
+
if (hasError && error) {
|
|
67
|
+
// Render fallback
|
|
68
|
+
if (typeof fallback === 'function') {
|
|
69
|
+
return fallback(error, errorInfo ?? undefined);
|
|
70
|
+
}
|
|
71
|
+
if (fallback) {
|
|
72
|
+
return fallback;
|
|
73
|
+
}
|
|
74
|
+
// Default error UI
|
|
75
|
+
return (_jsx(DefaultErrorFallback, { error: error, errorInfo: errorInfo ?? undefined, onReset: this.reset, isolate: isolate }));
|
|
76
|
+
}
|
|
77
|
+
return children;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function DefaultErrorFallback({ error, errorInfo, onReset, isolate, }) {
|
|
81
|
+
if (isolate) {
|
|
82
|
+
return (_jsx("div", { style: { padding: '16px', border: '1px solid #f44336', borderRadius: '4px' }, children: _jsx("p", { style: { color: '#f44336', fontWeight: 'bold' }, children: "Something went wrong" }) }));
|
|
83
|
+
}
|
|
84
|
+
return (_jsxs("div", { role: "alert", style: {
|
|
85
|
+
padding: '24px',
|
|
86
|
+
maxWidth: '600px',
|
|
87
|
+
margin: '40px auto',
|
|
88
|
+
backgroundColor: '#fff',
|
|
89
|
+
border: '1px solid #f44336',
|
|
90
|
+
borderRadius: '8px',
|
|
91
|
+
}, children: [_jsx("h2", { style: { color: '#f44336', marginTop: 0 }, children: "Something went wrong" }), _jsx("p", { style: { color: '#666' }, children: "An error occurred while rendering this component." }), process.env.NODE_ENV === 'development' && (_jsxs("details", { style: { marginTop: '16px' }, children: [_jsx("summary", { style: { cursor: 'pointer', fontWeight: 'bold' }, children: "Error details" }), _jsx("pre", { style: {
|
|
92
|
+
marginTop: '8px',
|
|
93
|
+
padding: '12px',
|
|
94
|
+
backgroundColor: '#f5f5f5',
|
|
95
|
+
borderRadius: '4px',
|
|
96
|
+
overflow: 'auto',
|
|
97
|
+
fontSize: '12px',
|
|
98
|
+
}, children: error.toString() }), _jsx("pre", { style: {
|
|
99
|
+
marginTop: '8px',
|
|
100
|
+
padding: '12px',
|
|
101
|
+
backgroundColor: '#f5f5f5',
|
|
102
|
+
borderRadius: '4px',
|
|
103
|
+
overflow: 'auto',
|
|
104
|
+
fontSize: '12px',
|
|
105
|
+
}, children: errorInfo?.componentStack })] })), _jsx("button", { type: "button", onClick: onReset, style: {
|
|
106
|
+
marginTop: '16px',
|
|
107
|
+
padding: '8px 16px',
|
|
108
|
+
backgroundColor: '#2196f3',
|
|
109
|
+
color: '#fff',
|
|
110
|
+
border: 'none',
|
|
111
|
+
borderRadius: '4px',
|
|
112
|
+
cursor: 'pointer',
|
|
113
|
+
}, children: "Try again" })] }));
|
|
114
|
+
}
|
|
115
|
+
export class ErrorBoundaryWithRetry extends Component {
|
|
116
|
+
retryTimeout;
|
|
117
|
+
constructor(props) {
|
|
118
|
+
super(props);
|
|
119
|
+
this.state = {
|
|
120
|
+
hasError: false,
|
|
121
|
+
error: null,
|
|
122
|
+
errorInfo: null,
|
|
123
|
+
retryCount: 0,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
static getDerivedStateFromError(error) {
|
|
127
|
+
return {
|
|
128
|
+
hasError: true,
|
|
129
|
+
error,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
componentDidCatch(error, errorInfo) {
|
|
133
|
+
this.setState({
|
|
134
|
+
errorInfo,
|
|
135
|
+
});
|
|
136
|
+
if (this.props.onError) {
|
|
137
|
+
this.props.onError(error, errorInfo);
|
|
138
|
+
}
|
|
139
|
+
// Auto-retry if under max retries
|
|
140
|
+
const { maxRetries = 3, retryDelay = 1000 } = this.props;
|
|
141
|
+
if (this.state.retryCount < maxRetries) {
|
|
142
|
+
this.retryTimeout = setTimeout(() => {
|
|
143
|
+
this.setState((state) => ({
|
|
144
|
+
hasError: false,
|
|
145
|
+
error: null,
|
|
146
|
+
errorInfo: null,
|
|
147
|
+
retryCount: state.retryCount + 1,
|
|
148
|
+
}));
|
|
149
|
+
}, retryDelay);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
componentWillUnmount() {
|
|
153
|
+
if (this.retryTimeout) {
|
|
154
|
+
clearTimeout(this.retryTimeout);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
reset = () => {
|
|
158
|
+
if (this.retryTimeout) {
|
|
159
|
+
clearTimeout(this.retryTimeout);
|
|
160
|
+
}
|
|
161
|
+
if (this.props.onReset) {
|
|
162
|
+
this.props.onReset();
|
|
163
|
+
}
|
|
164
|
+
this.setState({
|
|
165
|
+
hasError: false,
|
|
166
|
+
error: null,
|
|
167
|
+
errorInfo: null,
|
|
168
|
+
retryCount: 0,
|
|
169
|
+
});
|
|
170
|
+
};
|
|
171
|
+
render() {
|
|
172
|
+
const { hasError, error, errorInfo, retryCount } = this.state;
|
|
173
|
+
const { children, fallback, maxRetries = 3 } = this.props;
|
|
174
|
+
if (hasError && error) {
|
|
175
|
+
if (retryCount < maxRetries) {
|
|
176
|
+
return (_jsx("div", { style: { padding: '24px', textAlign: 'center' }, children: _jsxs("p", { children: ["Retrying... (Attempt ", retryCount + 1, "/", maxRetries, ")"] }) }));
|
|
177
|
+
}
|
|
178
|
+
if (typeof fallback === 'function') {
|
|
179
|
+
return fallback(error, errorInfo ?? undefined);
|
|
180
|
+
}
|
|
181
|
+
if (fallback) {
|
|
182
|
+
return fallback;
|
|
183
|
+
}
|
|
184
|
+
return (_jsx(DefaultErrorFallback, { error: error, errorInfo: errorInfo ?? undefined, onReset: this.reset }));
|
|
185
|
+
}
|
|
186
|
+
return children;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* withErrorBoundary HOC
|
|
191
|
+
*/
|
|
192
|
+
export function withErrorBoundary(Component, errorBoundaryProps) {
|
|
193
|
+
const Wrapped = (props) => (_jsx(ErrorBoundary, { ...errorBoundaryProps, children: _jsx(Component, { ...props }) }));
|
|
194
|
+
Wrapped.displayName = `withErrorBoundary(${Component.displayName || Component.name})`;
|
|
195
|
+
return Wrapped;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* useErrorHandler hook
|
|
199
|
+
*/
|
|
200
|
+
export function useErrorHandler(error) {
|
|
201
|
+
const [, setError] = React.useState(null);
|
|
202
|
+
React.useEffect(() => {
|
|
203
|
+
if (error) {
|
|
204
|
+
setError(() => {
|
|
205
|
+
throw error;
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
}, [error]);
|
|
209
|
+
return React.useCallback((err) => {
|
|
210
|
+
setError(() => {
|
|
211
|
+
throw err;
|
|
212
|
+
});
|
|
213
|
+
}, []);
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Error types
|
|
217
|
+
*/
|
|
218
|
+
export class NetworkError extends Error {
|
|
219
|
+
statusCode;
|
|
220
|
+
constructor(message, statusCode) {
|
|
221
|
+
super(message);
|
|
222
|
+
this.statusCode = statusCode;
|
|
223
|
+
this.name = 'NetworkError';
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
export class ValidationError extends Error {
|
|
227
|
+
fields;
|
|
228
|
+
constructor(message, fields) {
|
|
229
|
+
super(message);
|
|
230
|
+
this.fields = fields;
|
|
231
|
+
this.name = 'ValidationError';
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
export class AuthenticationError extends Error {
|
|
235
|
+
constructor(message) {
|
|
236
|
+
super(message);
|
|
237
|
+
this.name = 'AuthenticationError';
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
export class NotFoundError extends Error {
|
|
241
|
+
resource;
|
|
242
|
+
constructor(message, resource) {
|
|
243
|
+
super(message);
|
|
244
|
+
this.resource = resource;
|
|
245
|
+
this.name = 'NotFoundError';
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Error classification
|
|
250
|
+
*/
|
|
251
|
+
export function isNetworkError(error) {
|
|
252
|
+
return error instanceof NetworkError || (error instanceof Error && error.name === 'NetworkError');
|
|
253
|
+
}
|
|
254
|
+
export function isValidationError(error) {
|
|
255
|
+
return (error instanceof ValidationError || (error instanceof Error && error.name === 'ValidationError'));
|
|
256
|
+
}
|
|
257
|
+
export function isAuthenticationError(error) {
|
|
258
|
+
return (error instanceof AuthenticationError ||
|
|
259
|
+
(error instanceof Error && error.name === 'AuthenticationError'));
|
|
260
|
+
}
|
|
261
|
+
export function isNotFoundError(error) {
|
|
262
|
+
return (error instanceof NotFoundError || (error instanceof Error && error.name === 'NotFoundError'));
|
|
263
|
+
}
|
|
264
|
+
export function getErrorSeverity(error) {
|
|
265
|
+
if (isAuthenticationError(error))
|
|
266
|
+
return 'critical';
|
|
267
|
+
if (isNetworkError(error))
|
|
268
|
+
return 'high';
|
|
269
|
+
if (isValidationError(error))
|
|
270
|
+
return 'low';
|
|
271
|
+
if (isNotFoundError(error))
|
|
272
|
+
return 'medium';
|
|
273
|
+
return 'medium';
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Should retry error
|
|
277
|
+
*/
|
|
278
|
+
export function shouldRetryError(error) {
|
|
279
|
+
if (isNetworkError(error)) {
|
|
280
|
+
const statusCode = error.statusCode;
|
|
281
|
+
// Retry on 5xx errors and network failures
|
|
282
|
+
return !statusCode || statusCode >= 500;
|
|
283
|
+
}
|
|
284
|
+
return false;
|
|
285
|
+
}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error Tracking and Reporting
|
|
3
|
+
*
|
|
4
|
+
* Integrates with error tracking services (Sentry, Bugsnag, etc.)
|
|
5
|
+
*/
|
|
6
|
+
import type { ErrorInfo } from './error-boundary';
|
|
7
|
+
export interface ErrorReport {
|
|
8
|
+
error: Error;
|
|
9
|
+
errorInfo?: ErrorInfo;
|
|
10
|
+
context?: ErrorContext;
|
|
11
|
+
timestamp: string;
|
|
12
|
+
id: string;
|
|
13
|
+
fingerprint?: string;
|
|
14
|
+
level: ErrorLevel;
|
|
15
|
+
tags?: Record<string, string>;
|
|
16
|
+
user?: UserContext;
|
|
17
|
+
extra?: Record<string, unknown>;
|
|
18
|
+
}
|
|
19
|
+
export interface ErrorContext {
|
|
20
|
+
[key: string]: unknown;
|
|
21
|
+
url?: string;
|
|
22
|
+
userAgent?: string;
|
|
23
|
+
viewport?: {
|
|
24
|
+
width: number;
|
|
25
|
+
height: number;
|
|
26
|
+
};
|
|
27
|
+
component?: string;
|
|
28
|
+
action?: string;
|
|
29
|
+
route?: string;
|
|
30
|
+
version?: string;
|
|
31
|
+
environment?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface UserContext {
|
|
34
|
+
id?: string;
|
|
35
|
+
email?: string;
|
|
36
|
+
username?: string;
|
|
37
|
+
ip?: string;
|
|
38
|
+
}
|
|
39
|
+
export type ErrorLevel = 'fatal' | 'error' | 'warning' | 'info' | 'debug';
|
|
40
|
+
export interface ErrorReporter {
|
|
41
|
+
captureError(error: Error, context?: Partial<ErrorReport>): void;
|
|
42
|
+
captureMessage(message: string, level?: ErrorLevel, context?: Partial<ErrorReport>): void;
|
|
43
|
+
setUser(user: UserContext | null): void;
|
|
44
|
+
setContext(context: Partial<ErrorContext>): void;
|
|
45
|
+
setTag(key: string, value: string): void;
|
|
46
|
+
addBreadcrumb(breadcrumb: Breadcrumb): void;
|
|
47
|
+
}
|
|
48
|
+
export interface Breadcrumb {
|
|
49
|
+
timestamp: string;
|
|
50
|
+
level: ErrorLevel;
|
|
51
|
+
category?: string;
|
|
52
|
+
message: string;
|
|
53
|
+
data?: Record<string, unknown>;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Error reporting system
|
|
57
|
+
*/
|
|
58
|
+
export declare class ErrorReportingSystem implements ErrorReporter {
|
|
59
|
+
private reporters;
|
|
60
|
+
private globalContext;
|
|
61
|
+
private globalTags;
|
|
62
|
+
private user;
|
|
63
|
+
private breadcrumbs;
|
|
64
|
+
private maxBreadcrumbs;
|
|
65
|
+
private enabled;
|
|
66
|
+
private errorFilters;
|
|
67
|
+
/**
|
|
68
|
+
* Add error reporter
|
|
69
|
+
*/
|
|
70
|
+
addReporter(reporter: ErrorReporter): void;
|
|
71
|
+
/**
|
|
72
|
+
* Remove error reporter
|
|
73
|
+
*/
|
|
74
|
+
removeReporter(reporter: ErrorReporter): void;
|
|
75
|
+
/**
|
|
76
|
+
* Capture error
|
|
77
|
+
*/
|
|
78
|
+
captureError(error: Error, context?: Partial<ErrorReport>): void;
|
|
79
|
+
/**
|
|
80
|
+
* Capture message
|
|
81
|
+
*/
|
|
82
|
+
captureMessage(message: string, level?: ErrorLevel, context?: Partial<ErrorReport>): void;
|
|
83
|
+
/**
|
|
84
|
+
* Set user context
|
|
85
|
+
*/
|
|
86
|
+
setUser(user: UserContext | null): void;
|
|
87
|
+
/**
|
|
88
|
+
* Set global context
|
|
89
|
+
*/
|
|
90
|
+
setContext(context: Partial<ErrorContext>): void;
|
|
91
|
+
/**
|
|
92
|
+
* Set global tag
|
|
93
|
+
*/
|
|
94
|
+
setTag(key: string, value: string): void;
|
|
95
|
+
/**
|
|
96
|
+
* Add breadcrumb
|
|
97
|
+
*/
|
|
98
|
+
addBreadcrumb(breadcrumb: Breadcrumb): void;
|
|
99
|
+
/**
|
|
100
|
+
* Add error filter
|
|
101
|
+
*/
|
|
102
|
+
addFilter(filter: (error: Error) => boolean): void;
|
|
103
|
+
/**
|
|
104
|
+
* Check if error should be reported
|
|
105
|
+
*/
|
|
106
|
+
private shouldReportError;
|
|
107
|
+
/**
|
|
108
|
+
* Generate error fingerprint for grouping
|
|
109
|
+
*/
|
|
110
|
+
private generateFingerprint;
|
|
111
|
+
/**
|
|
112
|
+
* Determine error level
|
|
113
|
+
*/
|
|
114
|
+
private determineLevel;
|
|
115
|
+
/**
|
|
116
|
+
* Enable/disable error reporting
|
|
117
|
+
*/
|
|
118
|
+
setEnabled(enabled: boolean): void;
|
|
119
|
+
/**
|
|
120
|
+
* Clear breadcrumbs
|
|
121
|
+
*/
|
|
122
|
+
clearBreadcrumbs(): void;
|
|
123
|
+
/**
|
|
124
|
+
* Get breadcrumbs
|
|
125
|
+
*/
|
|
126
|
+
getBreadcrumbs(): Breadcrumb[];
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Global error reporting instance
|
|
130
|
+
*/
|
|
131
|
+
export declare const errorReporter: ErrorReportingSystem;
|
|
132
|
+
/**
|
|
133
|
+
* Console error reporter (for development)
|
|
134
|
+
*/
|
|
135
|
+
export declare class ConsoleErrorReporter implements ErrorReporter {
|
|
136
|
+
captureError(error: Error, context?: Partial<ErrorReport>): void;
|
|
137
|
+
captureMessage(message: string, level?: ErrorLevel, context?: Partial<ErrorReport>): void;
|
|
138
|
+
setUser(user: UserContext | null): void;
|
|
139
|
+
setContext(context: Partial<ErrorContext>): void;
|
|
140
|
+
setTag(key: string, value: string): void;
|
|
141
|
+
addBreadcrumb(breadcrumb: Breadcrumb): void;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Sentry-compatible error reporter
|
|
145
|
+
*/
|
|
146
|
+
export declare class SentryErrorReporter implements ErrorReporter {
|
|
147
|
+
private dsn;
|
|
148
|
+
constructor(dsn: string);
|
|
149
|
+
captureError(error: Error, context?: Partial<ErrorReport>): void;
|
|
150
|
+
captureMessage(message: string, level?: ErrorLevel, context?: Partial<ErrorReport>): void;
|
|
151
|
+
setUser(_user: UserContext | null): void;
|
|
152
|
+
setContext(_context: Partial<ErrorContext>): void;
|
|
153
|
+
setTag(_key: string, _value: string): void;
|
|
154
|
+
addBreadcrumb(_breadcrumb: Breadcrumb): void;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* HTTP error reporter (send to custom endpoint)
|
|
158
|
+
*/
|
|
159
|
+
export declare class HTTPErrorReporter implements ErrorReporter {
|
|
160
|
+
private endpoint;
|
|
161
|
+
constructor(endpoint: string);
|
|
162
|
+
captureError(error: Error, context?: Partial<ErrorReport>): Promise<void>;
|
|
163
|
+
captureMessage(message: string, level?: ErrorLevel, context?: Partial<ErrorReport>): Promise<void>;
|
|
164
|
+
setUser(_user: UserContext | null): void;
|
|
165
|
+
setContext(_context: Partial<ErrorContext>): void;
|
|
166
|
+
setTag(_key: string, _value: string): void;
|
|
167
|
+
addBreadcrumb(_breadcrumb: Breadcrumb): void;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Initialize error reporting
|
|
171
|
+
*/
|
|
172
|
+
export declare function initializeErrorReporting(config: {
|
|
173
|
+
dsn?: string;
|
|
174
|
+
environment?: string;
|
|
175
|
+
release?: string;
|
|
176
|
+
sampleRate?: number;
|
|
177
|
+
ignoreErrors?: string[];
|
|
178
|
+
beforeSend?: (report: ErrorReport) => ErrorReport | null;
|
|
179
|
+
}): void;
|
|
180
|
+
/**
|
|
181
|
+
* Track user action as breadcrumb
|
|
182
|
+
*/
|
|
183
|
+
export declare function trackAction(action: string, data?: Record<string, unknown>): void;
|
|
184
|
+
/**
|
|
185
|
+
* Track navigation as breadcrumb
|
|
186
|
+
*/
|
|
187
|
+
export declare function trackNavigation(from: string, to: string): void;
|
|
188
|
+
/**
|
|
189
|
+
* Track API call as breadcrumb
|
|
190
|
+
*/
|
|
191
|
+
export declare function trackAPICall(method: string, url: string, status?: number, duration?: number): void;
|
|
192
|
+
/**
|
|
193
|
+
* Common error filters
|
|
194
|
+
*/
|
|
195
|
+
export declare const ErrorFilters: {
|
|
196
|
+
/**
|
|
197
|
+
* Ignore browser extension errors
|
|
198
|
+
*/
|
|
199
|
+
ignoreExtensions: (error: Error) => boolean;
|
|
200
|
+
/**
|
|
201
|
+
* Ignore network errors
|
|
202
|
+
*/
|
|
203
|
+
ignoreNetwork: (error: Error) => boolean;
|
|
204
|
+
/**
|
|
205
|
+
* Ignore cancelled requests
|
|
206
|
+
*/
|
|
207
|
+
ignoreCancelled: (error: Error) => boolean;
|
|
208
|
+
/**
|
|
209
|
+
* Ignore specific error messages
|
|
210
|
+
*/
|
|
211
|
+
ignoreMessages: (patterns: string[]) => ((error: Error) => boolean);
|
|
212
|
+
};
|
|
213
|
+
//# sourceMappingURL=error-reporter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-reporter.d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