@revealui/core 0.0.1-pre.4 → 0.2.1
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 +108 -152
- 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 +316 -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 +411 -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 +385 -0
- package/dist/caching/service-worker.d.ts +154 -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 +23 -0
- package/dist/client/admin/utils/auth.d.ts.map +1 -0
- package/dist/client/admin/utils/auth.js +52 -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 +11 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +13 -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 +34 -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/safe-parse.d.ts +26 -0
- package/dist/database/safe-parse.d.ts.map +1 -0
- package/dist/database/safe-parse.js +42 -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 +176 -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 +214 -0
- package/dist/error-handling/error-reporter.d.ts.map +1 -0
- package/dist/error-handling/error-reporter.js +477 -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 +86 -0
- package/dist/features.d.ts.map +1 -0
- package/dist/features.js +92 -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 +16 -0
- package/dist/generated/types/index.d.ts.map +1 -0
- package/dist/generated/types/index.js +21 -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 +126 -33
- package/dist/instance/RevealUIInstance.d.ts +6 -0
- package/dist/instance/RevealUIInstance.d.ts.map +1 -0
- package/dist/instance/RevealUIInstance.js +306 -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 +41 -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 +27 -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 +34 -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 +45 -0
- package/dist/license.d.ts +82 -0
- package/dist/license.d.ts.map +1 -0
- package/dist/license.js +193 -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 +375 -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 +131 -0
- package/dist/optimization/code-splitting.d.ts.map +1 -0
- package/dist/optimization/code-splitting.js +277 -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 +255 -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 +476 -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 +517 -0
- package/dist/security/gdpr.d.ts +300 -0
- package/dist/security/gdpr.d.ts.map +1 -0
- package/dist/security/gdpr.js +465 -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 +12 -0
- package/dist/types/generated.d.ts.map +1 -0
- package/dist/types/generated.js +10 -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 +241 -724
- package/LICENSE_SUMMARY.md +0 -55
- package/NOTICE +0 -34
- package/dist/exports/RenderErrorPage.js +0 -3
- package/dist/exports/__internal.js +0 -3
- package/dist/exports/abort.js +0 -3
- package/dist/exports/bin-entry.js +0 -5
- package/dist/exports/client.js +0 -3
- package/dist/exports/config.js +0 -1
- package/dist/exports/helpers.js +0 -1
- package/dist/exports/index.js +0 -33
- package/dist/exports/plugin.js +0 -3
- package/dist/exports/prerender.js +0 -3
- package/dist/exports/router.js +0 -3
- package/dist/exports/routing.js +0 -3
- package/dist/exports/server.js +0 -3
- package/dist/exports/setup.js +0 -3
- package/dist/exports/types.js +0 -1
- package/dist/integration/styles.css +0 -141
- package/dist/shared/RenderErrorPage.d.ts +0 -3
- package/dist/shared/RenderErrorPage.js +0 -3
- package/dist/shared/abort.js +0 -3
- package/dist/shared/route/routing.js +0 -3
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Fallback UI Components
|
|
4
|
+
*
|
|
5
|
+
* Reusable fallback components for error states, loading states, and degraded functionality
|
|
6
|
+
*/
|
|
7
|
+
/// <reference types="react" />
|
|
8
|
+
import React from 'react';
|
|
9
|
+
/**
|
|
10
|
+
* Generic error fallback component
|
|
11
|
+
*/
|
|
12
|
+
export function ErrorFallback({ error, onRetry, onDismiss, title = 'Something went wrong', message, showDetails = process.env.NODE_ENV === 'development', compact = false, }) {
|
|
13
|
+
if (compact) {
|
|
14
|
+
return (_jsxs("div", { style: {
|
|
15
|
+
padding: '12px',
|
|
16
|
+
backgroundColor: '#fee',
|
|
17
|
+
border: '1px solid #fcc',
|
|
18
|
+
borderRadius: '4px',
|
|
19
|
+
color: '#c00',
|
|
20
|
+
}, children: [_jsx("strong", { children: title }), message && _jsx("p", { style: { margin: '4px 0 0 0', fontSize: '14px' }, children: message }), onRetry && (_jsx("button", { type: "button", onClick: onRetry, style: {
|
|
21
|
+
marginTop: '8px',
|
|
22
|
+
padding: '4px 12px',
|
|
23
|
+
fontSize: '12px',
|
|
24
|
+
backgroundColor: '#c00',
|
|
25
|
+
color: '#fff',
|
|
26
|
+
border: 'none',
|
|
27
|
+
borderRadius: '4px',
|
|
28
|
+
cursor: 'pointer',
|
|
29
|
+
}, children: "Retry" }))] }));
|
|
30
|
+
}
|
|
31
|
+
return (_jsxs("div", { role: "alert", style: {
|
|
32
|
+
padding: '24px',
|
|
33
|
+
maxWidth: '600px',
|
|
34
|
+
margin: '40px auto',
|
|
35
|
+
backgroundColor: '#fff',
|
|
36
|
+
border: '2px solid #f44336',
|
|
37
|
+
borderRadius: '8px',
|
|
38
|
+
boxShadow: '0 2px 8px rgba(0,0,0,0.1)',
|
|
39
|
+
}, children: [_jsx("h2", { style: { color: '#f44336', marginTop: 0 }, children: title }), _jsx("p", { style: { color: '#666', lineHeight: 1.6 }, children: message || 'An unexpected error occurred. Please try again.' }), showDetails && error && (_jsxs("details", { style: { marginTop: '16px' }, children: [_jsx("summary", { style: {
|
|
40
|
+
cursor: 'pointer',
|
|
41
|
+
fontWeight: 'bold',
|
|
42
|
+
color: '#333',
|
|
43
|
+
padding: '8px',
|
|
44
|
+
backgroundColor: '#f5f5f5',
|
|
45
|
+
borderRadius: '4px',
|
|
46
|
+
}, children: "Error details" }), _jsxs("pre", { style: {
|
|
47
|
+
marginTop: '8px',
|
|
48
|
+
padding: '12px',
|
|
49
|
+
backgroundColor: '#f5f5f5',
|
|
50
|
+
borderRadius: '4px',
|
|
51
|
+
overflow: 'auto',
|
|
52
|
+
fontSize: '12px',
|
|
53
|
+
color: '#c00',
|
|
54
|
+
}, children: [error.name, ": ", error.message, error.stack && `\n\n${error.stack}`] })] })), _jsxs("div", { style: { marginTop: '24px', display: 'flex', gap: '12px' }, children: [onRetry && (_jsx("button", { type: "button", onClick: onRetry, style: {
|
|
55
|
+
padding: '10px 20px',
|
|
56
|
+
backgroundColor: '#2196f3',
|
|
57
|
+
color: '#fff',
|
|
58
|
+
border: 'none',
|
|
59
|
+
borderRadius: '4px',
|
|
60
|
+
cursor: 'pointer',
|
|
61
|
+
fontWeight: 'bold',
|
|
62
|
+
}, children: "Try Again" })), onDismiss && (_jsx("button", { type: "button", onClick: onDismiss, style: {
|
|
63
|
+
padding: '10px 20px',
|
|
64
|
+
backgroundColor: '#fff',
|
|
65
|
+
color: '#666',
|
|
66
|
+
border: '1px solid #ddd',
|
|
67
|
+
borderRadius: '4px',
|
|
68
|
+
cursor: 'pointer',
|
|
69
|
+
}, children: "Dismiss" }))] })] }));
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Network error fallback
|
|
73
|
+
*/
|
|
74
|
+
export function NetworkErrorFallback({ onRetry, message = 'Unable to connect to the server. Please check your internet connection.', }) {
|
|
75
|
+
return (_jsxs("div", { style: {
|
|
76
|
+
padding: '24px',
|
|
77
|
+
textAlign: 'center',
|
|
78
|
+
maxWidth: '400px',
|
|
79
|
+
margin: '40px auto',
|
|
80
|
+
}, children: [_jsx("div", { style: { fontSize: '48px', marginBottom: '16px' }, children: "\uD83D\uDCE1" }), _jsx("h3", { style: { color: '#333', marginTop: 0 }, children: "Connection Error" }), _jsx("p", { style: { color: '#666', lineHeight: 1.6 }, children: message }), onRetry && (_jsx("button", { type: "button", onClick: onRetry, style: {
|
|
81
|
+
marginTop: '16px',
|
|
82
|
+
padding: '10px 20px',
|
|
83
|
+
backgroundColor: '#2196f3',
|
|
84
|
+
color: '#fff',
|
|
85
|
+
border: 'none',
|
|
86
|
+
borderRadius: '4px',
|
|
87
|
+
cursor: 'pointer',
|
|
88
|
+
fontWeight: 'bold',
|
|
89
|
+
}, children: "Retry Connection" }))] }));
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Not found fallback
|
|
93
|
+
*/
|
|
94
|
+
export function NotFoundFallback({ title = 'Page Not Found', message = 'The page you are looking for does not exist.', onGoHome, }) {
|
|
95
|
+
return (_jsxs("div", { style: {
|
|
96
|
+
padding: '24px',
|
|
97
|
+
textAlign: 'center',
|
|
98
|
+
maxWidth: '400px',
|
|
99
|
+
margin: '40px auto',
|
|
100
|
+
}, children: [_jsx("div", { style: { fontSize: '72px', marginBottom: '16px' }, children: "404" }), _jsx("h2", { style: { color: '#333', marginTop: 0 }, children: title }), _jsx("p", { style: { color: '#666', lineHeight: 1.6 }, children: message }), onGoHome && (_jsx("button", { type: "button", onClick: onGoHome, style: {
|
|
101
|
+
marginTop: '16px',
|
|
102
|
+
padding: '10px 20px',
|
|
103
|
+
backgroundColor: '#2196f3',
|
|
104
|
+
color: '#fff',
|
|
105
|
+
border: 'none',
|
|
106
|
+
borderRadius: '4px',
|
|
107
|
+
cursor: 'pointer',
|
|
108
|
+
fontWeight: 'bold',
|
|
109
|
+
}, children: "Go Home" }))] }));
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Loading fallback with retry
|
|
113
|
+
*/
|
|
114
|
+
export function LoadingFallback({ message = 'Loading...', timeout, onTimeout, }) {
|
|
115
|
+
const [timedOut, setTimedOut] = React.useState(false);
|
|
116
|
+
React.useEffect(() => {
|
|
117
|
+
if (timeout && onTimeout) {
|
|
118
|
+
const timer = setTimeout(() => {
|
|
119
|
+
setTimedOut(true);
|
|
120
|
+
onTimeout();
|
|
121
|
+
}, timeout);
|
|
122
|
+
return () => clearTimeout(timer);
|
|
123
|
+
}
|
|
124
|
+
return undefined;
|
|
125
|
+
}, [timeout, onTimeout]);
|
|
126
|
+
if (timedOut) {
|
|
127
|
+
return (_jsx(ErrorFallback, { title: "Loading Timeout", message: "This is taking longer than expected.", onRetry: onTimeout }));
|
|
128
|
+
}
|
|
129
|
+
return (_jsxs("div", { style: {
|
|
130
|
+
padding: '24px',
|
|
131
|
+
textAlign: 'center',
|
|
132
|
+
maxWidth: '400px',
|
|
133
|
+
margin: '40px auto',
|
|
134
|
+
}, children: [_jsx("div", { style: {
|
|
135
|
+
width: '40px',
|
|
136
|
+
height: '40px',
|
|
137
|
+
margin: '0 auto 16px',
|
|
138
|
+
border: '4px solid #f3f3f3',
|
|
139
|
+
borderTop: '4px solid #2196f3',
|
|
140
|
+
borderRadius: '50%',
|
|
141
|
+
animation: 'spin 1s linear infinite',
|
|
142
|
+
} }), _jsx("p", { style: { color: '#666' }, children: message }), _jsx("style", { children: `
|
|
143
|
+
@keyframes spin {
|
|
144
|
+
0% { transform: rotate(0deg); }
|
|
145
|
+
100% { transform: rotate(360deg); }
|
|
146
|
+
}
|
|
147
|
+
` })] }));
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Offline fallback
|
|
151
|
+
*/
|
|
152
|
+
export function OfflineFallback({ message = 'You are currently offline. Some features may be unavailable.', children, }) {
|
|
153
|
+
return (_jsxs("div", { children: [_jsxs("div", { style: {
|
|
154
|
+
padding: '12px 16px',
|
|
155
|
+
backgroundColor: '#fff3cd',
|
|
156
|
+
borderBottom: '1px solid #ffc107',
|
|
157
|
+
textAlign: 'center',
|
|
158
|
+
color: '#856404',
|
|
159
|
+
}, children: [_jsx("strong", { children: "\u26A0\uFE0F Offline Mode" }), _jsx("span", { style: { marginLeft: '8px', fontSize: '14px' }, children: message })] }), children] }));
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Degraded service fallback
|
|
163
|
+
*/
|
|
164
|
+
export function DegradedServiceFallback({ serviceName, message, children, }) {
|
|
165
|
+
const displayMessage = message ||
|
|
166
|
+
(serviceName
|
|
167
|
+
? `${serviceName} is currently experiencing issues. Some features may be limited.`
|
|
168
|
+
: 'Some services are experiencing issues. Functionality may be limited.');
|
|
169
|
+
return (_jsxs("div", { children: [_jsxs("div", { style: {
|
|
170
|
+
padding: '12px 16px',
|
|
171
|
+
backgroundColor: '#fff3cd',
|
|
172
|
+
borderBottom: '1px solid #ffc107',
|
|
173
|
+
textAlign: 'center',
|
|
174
|
+
color: '#856404',
|
|
175
|
+
}, children: [_jsx("strong", { children: "\u26A0\uFE0F Service Degraded" }), _jsx("span", { style: { marginLeft: '8px', fontSize: '14px' }, children: displayMessage })] }), children] }));
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Maintenance fallback
|
|
179
|
+
*/
|
|
180
|
+
export function MaintenanceFallback({ title = 'Under Maintenance', message = 'We are currently performing maintenance. Please check back soon.', estimatedTime, }) {
|
|
181
|
+
return (_jsxs("div", { style: {
|
|
182
|
+
padding: '48px 24px',
|
|
183
|
+
textAlign: 'center',
|
|
184
|
+
maxWidth: '500px',
|
|
185
|
+
margin: '40px auto',
|
|
186
|
+
}, children: [_jsx("div", { style: { fontSize: '64px', marginBottom: '24px' }, children: "\uD83D\uDD27" }), _jsx("h1", { style: { color: '#333', marginTop: 0 }, children: title }), _jsx("p", { style: { color: '#666', lineHeight: 1.6, fontSize: '16px' }, children: message }), estimatedTime && (_jsxs("p", { style: { color: '#999', marginTop: '16px' }, children: ["Estimated completion: ", estimatedTime] }))] }));
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Permission denied fallback
|
|
190
|
+
*/
|
|
191
|
+
export function PermissionDeniedFallback({ message = 'You do not have permission to access this resource.', onRequestAccess, onGoBack, }) {
|
|
192
|
+
return (_jsxs("div", { style: {
|
|
193
|
+
padding: '24px',
|
|
194
|
+
textAlign: 'center',
|
|
195
|
+
maxWidth: '400px',
|
|
196
|
+
margin: '40px auto',
|
|
197
|
+
}, children: [_jsx("div", { style: { fontSize: '64px', marginBottom: '16px' }, children: "\uD83D\uDD12" }), _jsx("h2", { style: { color: '#333', marginTop: 0 }, children: "Access Denied" }), _jsx("p", { style: { color: '#666', lineHeight: 1.6 }, children: message }), _jsxs("div", { style: { marginTop: '24px', display: 'flex', gap: '12px', justifyContent: 'center' }, children: [onRequestAccess && (_jsx("button", { type: "button", onClick: onRequestAccess, style: {
|
|
198
|
+
padding: '10px 20px',
|
|
199
|
+
backgroundColor: '#2196f3',
|
|
200
|
+
color: '#fff',
|
|
201
|
+
border: 'none',
|
|
202
|
+
borderRadius: '4px',
|
|
203
|
+
cursor: 'pointer',
|
|
204
|
+
fontWeight: 'bold',
|
|
205
|
+
}, children: "Request Access" })), onGoBack && (_jsx("button", { type: "button", onClick: onGoBack, style: {
|
|
206
|
+
padding: '10px 20px',
|
|
207
|
+
backgroundColor: '#fff',
|
|
208
|
+
color: '#666',
|
|
209
|
+
border: '1px solid #ddd',
|
|
210
|
+
borderRadius: '4px',
|
|
211
|
+
cursor: 'pointer',
|
|
212
|
+
}, children: "Go Back" }))] })] }));
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Retry boundary - wrapper that provides retry functionality
|
|
216
|
+
*/
|
|
217
|
+
export function RetryBoundary({ children, fallback, maxRetries = 3, retryDelay = 1000, }) {
|
|
218
|
+
const [error, setError] = React.useState(null);
|
|
219
|
+
const [retryCount, setRetryCount] = React.useState(0);
|
|
220
|
+
const [isRetrying, setIsRetrying] = React.useState(false);
|
|
221
|
+
const retry = React.useCallback(() => {
|
|
222
|
+
if (retryCount < maxRetries) {
|
|
223
|
+
setIsRetrying(true);
|
|
224
|
+
setTimeout(() => {
|
|
225
|
+
setError(null);
|
|
226
|
+
setRetryCount((c) => c + 1);
|
|
227
|
+
setIsRetrying(false);
|
|
228
|
+
}, retryDelay);
|
|
229
|
+
}
|
|
230
|
+
}, [retryCount, maxRetries, retryDelay]);
|
|
231
|
+
if (error && !isRetrying) {
|
|
232
|
+
if (fallback) {
|
|
233
|
+
return _jsx(_Fragment, { children: fallback(error, retry, retryCount) });
|
|
234
|
+
}
|
|
235
|
+
return (_jsx(ErrorFallback, { error: error, onRetry: retryCount < maxRetries ? retry : undefined, title: retryCount >= maxRetries ? 'Maximum Retries Exceeded' : 'Error', message: retryCount >= maxRetries ? 'Unable to recover after multiple attempts.' : undefined }));
|
|
236
|
+
}
|
|
237
|
+
if (isRetrying) {
|
|
238
|
+
return _jsx(LoadingFallback, { message: `Retrying... (Attempt ${retryCount + 1}/${maxRetries})` });
|
|
239
|
+
}
|
|
240
|
+
return _jsx(_Fragment, { children: children });
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Suspense fallback with timeout
|
|
244
|
+
*/
|
|
245
|
+
export function SuspenseFallback({ message = 'Loading...', timeout = 10000, }) {
|
|
246
|
+
const [timedOut, setTimedOut] = React.useState(false);
|
|
247
|
+
React.useEffect(() => {
|
|
248
|
+
const timer = setTimeout(() => {
|
|
249
|
+
setTimedOut(true);
|
|
250
|
+
}, timeout);
|
|
251
|
+
return () => clearTimeout(timer);
|
|
252
|
+
}, [timeout]);
|
|
253
|
+
if (timedOut) {
|
|
254
|
+
return (_jsx(ErrorFallback, { title: "Loading Timeout", message: "This is taking longer than expected. Please refresh the page." }));
|
|
255
|
+
}
|
|
256
|
+
return _jsx(LoadingFallback, { message: message });
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Feature flag fallback
|
|
260
|
+
*/
|
|
261
|
+
export function FeatureUnavailableFallback({ featureName, message, }) {
|
|
262
|
+
return (_jsxs("div", { style: {
|
|
263
|
+
padding: '24px',
|
|
264
|
+
textAlign: 'center',
|
|
265
|
+
maxWidth: '400px',
|
|
266
|
+
margin: '40px auto',
|
|
267
|
+
}, children: [_jsx("div", { style: { fontSize: '48px', marginBottom: '16px' }, children: "\uD83D\uDEA7" }), _jsx("h3", { style: { color: '#333', marginTop: 0 }, children: "Feature Unavailable" }), _jsx("p", { style: { color: '#666', lineHeight: 1.6 }, children: message || `The "${featureName}" feature is currently unavailable.` })] }));
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Inline error message
|
|
271
|
+
*/
|
|
272
|
+
export function InlineError({ message, onDismiss, }) {
|
|
273
|
+
return (_jsxs("div", { role: "alert", style: {
|
|
274
|
+
padding: '12px 16px',
|
|
275
|
+
backgroundColor: '#fee',
|
|
276
|
+
border: '1px solid #fcc',
|
|
277
|
+
borderRadius: '4px',
|
|
278
|
+
color: '#c00',
|
|
279
|
+
display: 'flex',
|
|
280
|
+
alignItems: 'center',
|
|
281
|
+
justifyContent: 'space-between',
|
|
282
|
+
}, children: [_jsxs("span", { style: { display: 'flex', alignItems: 'center' }, children: [_jsx("span", { style: { marginRight: '8px' }, children: "\u26A0\uFE0F" }), message] }), onDismiss && (_jsx("button", { type: "button", onClick: onDismiss, style: {
|
|
283
|
+
background: 'none',
|
|
284
|
+
border: 'none',
|
|
285
|
+
color: '#c00',
|
|
286
|
+
cursor: 'pointer',
|
|
287
|
+
fontSize: '18px',
|
|
288
|
+
padding: '0 4px',
|
|
289
|
+
}, "aria-label": "Dismiss", children: "\u00D7" }))] }));
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Success message
|
|
293
|
+
*/
|
|
294
|
+
export function SuccessMessage({ message, onDismiss, }) {
|
|
295
|
+
return (_jsxs("output", { style: {
|
|
296
|
+
padding: '12px 16px',
|
|
297
|
+
backgroundColor: '#efe',
|
|
298
|
+
border: '1px solid #cec',
|
|
299
|
+
borderRadius: '4px',
|
|
300
|
+
color: '#060',
|
|
301
|
+
display: 'flex',
|
|
302
|
+
alignItems: 'center',
|
|
303
|
+
justifyContent: 'space-between',
|
|
304
|
+
}, children: [_jsxs("span", { style: { display: 'flex', alignItems: 'center' }, children: [_jsx("span", { style: { marginRight: '8px' }, children: "\u2713" }), message] }), onDismiss && (_jsx("button", { type: "button", onClick: onDismiss, style: {
|
|
305
|
+
background: 'none',
|
|
306
|
+
border: 'none',
|
|
307
|
+
color: '#060',
|
|
308
|
+
cursor: 'pointer',
|
|
309
|
+
fontSize: '18px',
|
|
310
|
+
padding: '0 4px',
|
|
311
|
+
}, "aria-label": "Dismiss", children: "\u00D7" }))] }));
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Toast notification
|
|
315
|
+
*/
|
|
316
|
+
export function Toast({ type = 'info', message, duration = 5000, onDismiss, }) {
|
|
317
|
+
React.useEffect(() => {
|
|
318
|
+
if (duration > 0 && onDismiss) {
|
|
319
|
+
const timer = setTimeout(onDismiss, duration);
|
|
320
|
+
return () => clearTimeout(timer);
|
|
321
|
+
}
|
|
322
|
+
return undefined;
|
|
323
|
+
}, [duration, onDismiss]);
|
|
324
|
+
const colors = {
|
|
325
|
+
success: { bg: '#efe', border: '#cec', text: '#060', icon: '✓' },
|
|
326
|
+
error: { bg: '#fee', border: '#fcc', text: '#c00', icon: '✗' },
|
|
327
|
+
warning: { bg: '#fff3cd', border: '#ffc107', text: '#856404', icon: '!' },
|
|
328
|
+
info: { bg: '#e7f3ff', border: '#2196f3', text: '#0c5393', icon: 'i' },
|
|
329
|
+
};
|
|
330
|
+
const color = colors[type];
|
|
331
|
+
return (_jsxs("div", { style: {
|
|
332
|
+
position: 'fixed',
|
|
333
|
+
bottom: '20px',
|
|
334
|
+
right: '20px',
|
|
335
|
+
padding: '16px 20px',
|
|
336
|
+
backgroundColor: color.bg,
|
|
337
|
+
border: `1px solid ${color.border}`,
|
|
338
|
+
borderRadius: '4px',
|
|
339
|
+
color: color.text,
|
|
340
|
+
boxShadow: '0 4px 12px rgba(0,0,0,0.15)',
|
|
341
|
+
display: 'flex',
|
|
342
|
+
alignItems: 'center',
|
|
343
|
+
gap: '12px',
|
|
344
|
+
maxWidth: '400px',
|
|
345
|
+
zIndex: 9999,
|
|
346
|
+
}, children: [_jsx("span", { style: { fontSize: '20px' }, children: color.icon }), _jsx("span", { style: { flex: 1 }, children: message }), onDismiss && (_jsx("button", { type: "button", onClick: onDismiss, style: {
|
|
347
|
+
background: 'none',
|
|
348
|
+
border: 'none',
|
|
349
|
+
color: color.text,
|
|
350
|
+
cursor: 'pointer',
|
|
351
|
+
fontSize: '20px',
|
|
352
|
+
padding: '0 4px',
|
|
353
|
+
}, "aria-label": "Dismiss", children: "\u00D7" }))] }));
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* Skeleton loader
|
|
357
|
+
*/
|
|
358
|
+
export function Skeleton({ width = '100%', height = '20px', borderRadius = '4px', }) {
|
|
359
|
+
return (_jsx("div", { style: {
|
|
360
|
+
width,
|
|
361
|
+
height,
|
|
362
|
+
borderRadius,
|
|
363
|
+
backgroundColor: '#e0e0e0',
|
|
364
|
+
animation: 'pulse 1.5s ease-in-out infinite',
|
|
365
|
+
}, children: _jsx("style", { children: `
|
|
366
|
+
@keyframes pulse {
|
|
367
|
+
0%, 100% { opacity: 1; }
|
|
368
|
+
50% { opacity: 0.5; }
|
|
369
|
+
}
|
|
370
|
+
` }) }));
|
|
371
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error Handling & Recovery
|
|
3
|
+
*
|
|
4
|
+
* Comprehensive error handling infrastructure for production applications
|
|
5
|
+
*/
|
|
6
|
+
export type { CircuitBreakerConfig, CircuitBreakerStats, CircuitState, } from './circuit-breaker';
|
|
7
|
+
export { AdaptiveCircuitBreaker, Bulkhead, CircuitBreak, CircuitBreaker, CircuitBreakerOpenError, CircuitBreakerRegistry, circuitBreakerRegistry, createCircuitBreakerMiddleware, createResilientFunction, fetchWithCircuitBreaker, ResilientOperation, withCircuitBreaker, } from './circuit-breaker';
|
|
8
|
+
export type { ErrorBoundaryProps, ErrorBoundaryState, ErrorBoundaryWithRetryProps, ErrorInfo, ErrorSeverity, } from './error-boundary';
|
|
9
|
+
export { AuthenticationError, ErrorBoundary, ErrorBoundaryWithRetry, getErrorSeverity, isAuthenticationError, isNetworkError, isNotFoundError, isValidationError, NetworkError, NotFoundError, shouldRetryError, useErrorHandler, ValidationError, withErrorBoundary, } from './error-boundary';
|
|
10
|
+
export type { Breadcrumb, ErrorContext, ErrorLevel, ErrorReport, ErrorReporter, UserContext, } from './error-reporter';
|
|
11
|
+
export { ConsoleErrorReporter, ErrorFilters, ErrorReportingSystem, errorReporter, HTTPErrorReporter, initializeErrorReporting, LoggingErrorReporter, trackAction, trackAPICall, trackNavigation, } from './error-reporter';
|
|
12
|
+
export type { ErrorFallbackProps } from './fallback-components';
|
|
13
|
+
export { DegradedServiceFallback, ErrorFallback, FeatureUnavailableFallback, InlineError, LoadingFallback, MaintenanceFallback, NetworkErrorFallback, NotFoundFallback, OfflineFallback, PermissionDeniedFallback, RetryBoundary, Skeleton, SuccessMessage, SuspenseFallback, Toast, } from './fallback-components';
|
|
14
|
+
export type { RetryConfig, RetryOptions } from './retry';
|
|
15
|
+
export { calculateDelay, createRetryMiddleware, ExponentialBackoff, fetchWithRetry, globalRetryConfig, Retryable, RetryableOperation, RetryPolicies, RetryPolicyBuilder, retry, retryBatch, retryIf, retryUntil, retryWithFallback, sleep, } from './retry';
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/error-handling/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EACV,oBAAoB,EACpB,mBAAmB,EACnB,YAAY,GACb,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EACL,sBAAsB,EACtB,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACtB,8BAA8B,EAC9B,uBAAuB,EACvB,uBAAuB,EACvB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EACV,kBAAkB,EAClB,kBAAkB,EAClB,2BAA2B,EAC3B,SAAS,EACT,aAAa,GACd,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,sBAAsB,EACtB,gBAAgB,EAChB,qBAAqB,EACrB,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,iBAAiB,GAClB,MAAM,kBAAkB,CAAA;AACzB,YAAY,EACV,UAAU,EACV,YAAY,EACZ,UAAU,EACV,WAAW,EACX,aAAa,EACb,WAAW,GACZ,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EACL,oBAAoB,EACpB,YAAY,EACZ,oBAAoB,EACpB,aAAa,EACb,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACpB,WAAW,EACX,YAAY,EACZ,eAAe,GAChB,MAAM,kBAAkB,CAAA;AACzB,YAAY,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAE/D,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,0BAA0B,EAC1B,WAAW,EACX,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,wBAAwB,EACxB,aAAa,EACb,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,KAAK,GACN,MAAM,uBAAuB,CAAA;AAC9B,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAExD,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,KAAK,EACL,UAAU,EACV,OAAO,EACP,UAAU,EACV,iBAAiB,EACjB,KAAK,GACN,MAAM,SAAS,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error Handling & Recovery
|
|
3
|
+
*
|
|
4
|
+
* Comprehensive error handling infrastructure for production applications
|
|
5
|
+
*/
|
|
6
|
+
// Circuit breakers
|
|
7
|
+
export { AdaptiveCircuitBreaker, Bulkhead, CircuitBreak, CircuitBreaker, CircuitBreakerOpenError, CircuitBreakerRegistry, circuitBreakerRegistry, createCircuitBreakerMiddleware, createResilientFunction, fetchWithCircuitBreaker, ResilientOperation, withCircuitBreaker, } from './circuit-breaker';
|
|
8
|
+
// Error boundaries
|
|
9
|
+
export { AuthenticationError, ErrorBoundary, ErrorBoundaryWithRetry, getErrorSeverity, isAuthenticationError, isNetworkError, isNotFoundError, isValidationError, NetworkError, NotFoundError, shouldRetryError, useErrorHandler, ValidationError, withErrorBoundary, } from './error-boundary';
|
|
10
|
+
// Error reporting
|
|
11
|
+
export { ConsoleErrorReporter, ErrorFilters, ErrorReportingSystem, errorReporter, HTTPErrorReporter, initializeErrorReporting, LoggingErrorReporter, trackAction, trackAPICall, trackNavigation, } from './error-reporter';
|
|
12
|
+
// Fallback components
|
|
13
|
+
export { DegradedServiceFallback, ErrorFallback, FeatureUnavailableFallback, InlineError, LoadingFallback, MaintenanceFallback, NetworkErrorFallback, NotFoundFallback, OfflineFallback, PermissionDeniedFallback, RetryBoundary, Skeleton, SuccessMessage, SuspenseFallback, Toast, } from './fallback-components';
|
|
14
|
+
// Retry logic
|
|
15
|
+
export { calculateDelay, createRetryMiddleware, ExponentialBackoff, fetchWithRetry, globalRetryConfig, Retryable, RetryableOperation, RetryPolicies, RetryPolicyBuilder, retry, retryBatch, retryIf, retryUntil, retryWithFallback, sleep, } from './retry';
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Retry Logic for API Calls
|
|
3
|
+
*
|
|
4
|
+
* Implements exponential backoff and retry strategies
|
|
5
|
+
*/
|
|
6
|
+
export interface HttpError extends Error {
|
|
7
|
+
statusCode?: number;
|
|
8
|
+
response?: Response;
|
|
9
|
+
}
|
|
10
|
+
export interface RetryConfig {
|
|
11
|
+
maxRetries?: number;
|
|
12
|
+
baseDelay?: number;
|
|
13
|
+
maxDelay?: number;
|
|
14
|
+
exponentialBackoff?: boolean;
|
|
15
|
+
jitter?: boolean;
|
|
16
|
+
retryableErrors?: (error: Error) => boolean;
|
|
17
|
+
onRetry?: (error: Error, attempt: number) => void;
|
|
18
|
+
}
|
|
19
|
+
export interface RetryOptions {
|
|
20
|
+
signal?: AbortSignal;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Retry a function with exponential backoff
|
|
24
|
+
*/
|
|
25
|
+
export declare function retry<T>(fn: () => Promise<T>, config?: RetryConfig, options?: RetryOptions): Promise<T>;
|
|
26
|
+
/**
|
|
27
|
+
* Calculate retry delay with exponential backoff
|
|
28
|
+
*/
|
|
29
|
+
export declare function calculateDelay(attempt: number, baseDelay: number, maxDelay: number, exponentialBackoff: boolean, jitter: boolean): number;
|
|
30
|
+
/**
|
|
31
|
+
* Sleep with abort support
|
|
32
|
+
*/
|
|
33
|
+
export declare function sleep(ms: number, signal?: AbortSignal): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Retry wrapper for fetch
|
|
36
|
+
*/
|
|
37
|
+
export declare function fetchWithRetry(url: string, init?: RequestInit, config?: RetryConfig): Promise<Response>;
|
|
38
|
+
/**
|
|
39
|
+
* Retry wrapper class
|
|
40
|
+
*/
|
|
41
|
+
export declare class RetryableOperation<T> {
|
|
42
|
+
private fn;
|
|
43
|
+
private config;
|
|
44
|
+
private abortController;
|
|
45
|
+
private attempts;
|
|
46
|
+
private lastError?;
|
|
47
|
+
constructor(fn: () => Promise<T>, config?: RetryConfig);
|
|
48
|
+
/**
|
|
49
|
+
* Execute with retry
|
|
50
|
+
*/
|
|
51
|
+
execute(): Promise<T>;
|
|
52
|
+
/**
|
|
53
|
+
* Abort operation
|
|
54
|
+
*/
|
|
55
|
+
abort(): void;
|
|
56
|
+
/**
|
|
57
|
+
* Get retry statistics
|
|
58
|
+
*/
|
|
59
|
+
getStats(): {
|
|
60
|
+
attempts: number;
|
|
61
|
+
lastError?: Error;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Retry decorator
|
|
66
|
+
*/
|
|
67
|
+
export declare function Retryable(config?: RetryConfig): (_target: object, _propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
68
|
+
/**
|
|
69
|
+
* Create retry middleware for API client
|
|
70
|
+
*/
|
|
71
|
+
export declare function createRetryMiddleware<TRequest = unknown, TResponse = unknown>(config?: RetryConfig): (_request: TRequest, next: () => Promise<TResponse>) => Promise<TResponse>;
|
|
72
|
+
/**
|
|
73
|
+
* Batch retry - retry multiple operations
|
|
74
|
+
*/
|
|
75
|
+
export declare function retryBatch<T>(operations: Array<() => Promise<T>>, config?: RetryConfig): Promise<Array<T | Error>>;
|
|
76
|
+
/**
|
|
77
|
+
* Retry with fallback
|
|
78
|
+
*/
|
|
79
|
+
export declare function retryWithFallback<T>(primary: () => Promise<T>, fallback: () => Promise<T>, config?: RetryConfig): Promise<T>;
|
|
80
|
+
/**
|
|
81
|
+
* Conditional retry - only retry if condition is met
|
|
82
|
+
*/
|
|
83
|
+
export declare function retryIf<T>(fn: () => Promise<T>, condition: (error: Error, attempt: number) => boolean, config?: RetryConfig): Promise<T>;
|
|
84
|
+
/**
|
|
85
|
+
* Retry until condition is met
|
|
86
|
+
*/
|
|
87
|
+
export declare function retryUntil<T>(fn: () => Promise<T>, predicate: (result: T) => boolean, config?: RetryConfig, maxAttempts?: number): Promise<T>;
|
|
88
|
+
/**
|
|
89
|
+
* Exponential backoff iterator
|
|
90
|
+
*/
|
|
91
|
+
export declare class ExponentialBackoff implements AsyncIterable<number> {
|
|
92
|
+
private baseDelay;
|
|
93
|
+
private maxDelay;
|
|
94
|
+
private maxAttempts;
|
|
95
|
+
private jitter;
|
|
96
|
+
constructor(baseDelay?: number, maxDelay?: number, maxAttempts?: number, jitter?: boolean);
|
|
97
|
+
[Symbol.asyncIterator](): AsyncIterator<number>;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Retry policy builder
|
|
101
|
+
*/
|
|
102
|
+
export declare class RetryPolicyBuilder {
|
|
103
|
+
private config;
|
|
104
|
+
/**
|
|
105
|
+
* Set max retries
|
|
106
|
+
*/
|
|
107
|
+
maxRetries(count: number): this;
|
|
108
|
+
/**
|
|
109
|
+
* Set base delay
|
|
110
|
+
*/
|
|
111
|
+
baseDelay(ms: number): this;
|
|
112
|
+
/**
|
|
113
|
+
* Set max delay
|
|
114
|
+
*/
|
|
115
|
+
maxDelay(ms: number): this;
|
|
116
|
+
/**
|
|
117
|
+
* Enable/disable exponential backoff
|
|
118
|
+
*/
|
|
119
|
+
exponentialBackoff(enabled?: boolean): this;
|
|
120
|
+
/**
|
|
121
|
+
* Enable/disable jitter
|
|
122
|
+
*/
|
|
123
|
+
jitter(enabled?: boolean): this;
|
|
124
|
+
/**
|
|
125
|
+
* Set custom retryable errors function
|
|
126
|
+
*/
|
|
127
|
+
retryOn(fn: (error: Error) => boolean): this;
|
|
128
|
+
/**
|
|
129
|
+
* Set retry callback
|
|
130
|
+
*/
|
|
131
|
+
onRetry(fn: (error: Error, attempt: number) => void): this;
|
|
132
|
+
/**
|
|
133
|
+
* Build retry config
|
|
134
|
+
*/
|
|
135
|
+
build(): RetryConfig;
|
|
136
|
+
/**
|
|
137
|
+
* Execute function with built policy
|
|
138
|
+
*/
|
|
139
|
+
execute<T>(fn: () => Promise<T>): Promise<T>;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Common retry policies
|
|
143
|
+
*/
|
|
144
|
+
export declare const RetryPolicies: {
|
|
145
|
+
/**
|
|
146
|
+
* Default policy - 3 retries with exponential backoff
|
|
147
|
+
*/
|
|
148
|
+
default: () => RetryConfig;
|
|
149
|
+
/**
|
|
150
|
+
* Aggressive policy - more retries, faster backoff
|
|
151
|
+
*/
|
|
152
|
+
aggressive: () => RetryConfig;
|
|
153
|
+
/**
|
|
154
|
+
* Conservative policy - fewer retries, longer backoff
|
|
155
|
+
*/
|
|
156
|
+
conservative: () => RetryConfig;
|
|
157
|
+
/**
|
|
158
|
+
* Linear backoff policy
|
|
159
|
+
*/
|
|
160
|
+
linear: () => RetryConfig;
|
|
161
|
+
/**
|
|
162
|
+
* Immediate retry policy - no delay
|
|
163
|
+
*/
|
|
164
|
+
immediate: () => RetryConfig;
|
|
165
|
+
/**
|
|
166
|
+
* Network error only policy
|
|
167
|
+
*/
|
|
168
|
+
networkOnly: () => RetryConfig;
|
|
169
|
+
/**
|
|
170
|
+
* Idempotent operations policy (safe to retry)
|
|
171
|
+
*/
|
|
172
|
+
idempotent: () => RetryConfig;
|
|
173
|
+
};
|
|
174
|
+
/**
|
|
175
|
+
* Global retry configuration
|
|
176
|
+
*/
|
|
177
|
+
declare class GlobalRetryConfig {
|
|
178
|
+
private config;
|
|
179
|
+
/**
|
|
180
|
+
* Set global retry config
|
|
181
|
+
*/
|
|
182
|
+
setConfig(config: RetryConfig): void;
|
|
183
|
+
/**
|
|
184
|
+
* Get global retry config
|
|
185
|
+
*/
|
|
186
|
+
getConfig(): RetryConfig;
|
|
187
|
+
/**
|
|
188
|
+
* Reset to default config
|
|
189
|
+
*/
|
|
190
|
+
reset(): void;
|
|
191
|
+
}
|
|
192
|
+
export declare const globalRetryConfig: GlobalRetryConfig;
|
|
193
|
+
export {};
|
|
194
|
+
//# sourceMappingURL=retry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../src/error-handling/retry.ts"],"names":[],"mappings":"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"}
|