@plyaz/api 1.0.2 → 1.1.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/README.md +632 -542
- package/dist/api/cache/index.d.ts +183 -0
- package/dist/api/cache/index.d.ts.map +1 -0
- package/dist/api/cache/patterns.d.ts +174 -0
- package/dist/api/cache/patterns.d.ts.map +1 -0
- package/dist/api/cache/strategies.d.ts +47 -0
- package/dist/api/cache/strategies.d.ts.map +1 -0
- package/dist/api/client/clientEventManager.d.ts +238 -0
- package/dist/api/client/clientEventManager.d.ts.map +1 -0
- package/dist/api/client/createApiClient.d.ts +5 -0
- package/dist/api/client/createApiClient.d.ts.map +1 -0
- package/dist/api/client/helpers/headers.d.ts +11 -0
- package/dist/api/client/helpers/headers.d.ts.map +1 -0
- package/dist/api/client/helpers/index.d.ts +9 -0
- package/dist/api/client/helpers/index.d.ts.map +1 -0
- package/dist/api/client/helpers/interceptors.d.ts +29 -0
- package/dist/api/client/helpers/interceptors.d.ts.map +1 -0
- package/dist/api/client/helpers/network.d.ts +21 -0
- package/dist/api/client/helpers/network.d.ts.map +1 -0
- package/dist/api/client/helpers/strategies.d.ts +30 -0
- package/dist/api/client/helpers/strategies.d.ts.map +1 -0
- package/dist/api/client/helpers/tracking.d.ts +15 -0
- package/dist/api/client/helpers/tracking.d.ts.map +1 -0
- package/dist/api/client/index.d.ts +7 -0
- package/dist/api/client/index.d.ts.map +1 -0
- package/dist/api/config/adapter.d.ts +25 -0
- package/dist/api/config/adapter.d.ts.map +1 -0
- package/dist/api/config/configBuilder.d.ts +62 -0
- package/dist/api/config/configBuilder.d.ts.map +1 -0
- package/dist/api/config/configManager.d.ts +67 -0
- package/dist/api/config/configManager.d.ts.map +1 -0
- package/dist/api/config/global.d.ts +106 -0
- package/dist/api/config/global.d.ts.map +1 -0
- package/dist/api/config/index.d.ts +11 -0
- package/dist/api/config/index.d.ts.map +1 -0
- package/dist/api/debugger/DebugReport.d.ts +71 -0
- package/dist/api/debugger/DebugReport.d.ts.map +1 -0
- package/dist/api/debugger/UnifiedDebugger.d.ts +444 -0
- package/dist/api/debugger/UnifiedDebugger.d.ts.map +1 -0
- package/dist/api/debugger/factories/conflict.d.ts +58 -0
- package/dist/api/debugger/factories/conflict.d.ts.map +1 -0
- package/dist/api/debugger/factories/eventTracking.d.ts +126 -0
- package/dist/api/debugger/factories/eventTracking.d.ts.map +1 -0
- package/dist/api/debugger/factories/history.d.ts +97 -0
- package/dist/api/debugger/factories/history.d.ts.map +1 -0
- package/dist/api/debugger/factories/index.d.ts +15 -0
- package/dist/api/debugger/factories/index.d.ts.map +1 -0
- package/dist/api/debugger/factories/issueAnalysis.d.ts +52 -0
- package/dist/api/debugger/factories/issueAnalysis.d.ts.map +1 -0
- package/dist/api/debugger/factories/performance.d.ts +53 -0
- package/dist/api/debugger/factories/performance.d.ts.map +1 -0
- package/dist/api/debugger/factories/report.d.ts +43 -0
- package/dist/api/debugger/factories/report.d.ts.map +1 -0
- package/dist/api/debugger/index.d.ts +99 -0
- package/dist/api/debugger/index.d.ts.map +1 -0
- package/dist/api/debugger/queue/DebuggerQueueManager.d.ts +61 -0
- package/dist/api/debugger/queue/DebuggerQueueManager.d.ts.map +1 -0
- package/dist/api/debugger/queue/OperationTracker.d.ts +86 -0
- package/dist/api/debugger/queue/OperationTracker.d.ts.map +1 -0
- package/dist/api/debugger/queue/index.d.ts +9 -0
- package/dist/api/debugger/queue/index.d.ts.map +1 -0
- package/dist/api/endpoints/builders.d.ts +109 -0
- package/dist/api/endpoints/builders.d.ts.map +1 -0
- package/dist/api/endpoints/campaigns.d.ts +43 -0
- package/dist/api/endpoints/campaigns.d.ts.map +1 -0
- package/dist/api/endpoints/index.d.ts +100 -0
- package/dist/api/endpoints/index.d.ts.map +1 -0
- package/dist/api/endpoints/polling.d.ts +83 -0
- package/dist/api/endpoints/polling.d.ts.map +1 -0
- package/dist/api/endpoints/utils.d.ts +128 -0
- package/dist/api/endpoints/utils.d.ts.map +1 -0
- package/dist/api/errors/ApiPackageError.d.ts +101 -0
- package/dist/api/errors/ApiPackageError.d.ts.map +1 -0
- package/dist/api/errors/definitions.d.ts +24 -0
- package/dist/api/errors/definitions.d.ts.map +1 -0
- package/dist/api/errors/error-codes.d.ts +116 -0
- package/dist/api/errors/error-codes.d.ts.map +1 -0
- package/dist/api/errors/error-events.d.ts +63 -0
- package/dist/api/errors/error-events.d.ts.map +1 -0
- package/dist/api/errors/index.d.ts +18 -0
- package/dist/api/errors/index.d.ts.map +1 -0
- package/dist/api/errors/types-constants.d.ts +64 -0
- package/dist/api/errors/types-constants.d.ts.map +1 -0
- package/dist/api/events/EventManager.d.ts +230 -0
- package/dist/api/events/EventManager.d.ts.map +1 -0
- package/dist/api/events/factories/base.d.ts +269 -0
- package/dist/api/events/factories/base.d.ts.map +1 -0
- package/dist/api/events/factories/cache.d.ts +31 -0
- package/dist/api/events/factories/cache.d.ts.map +1 -0
- package/dist/api/events/factories/client.d.ts +43 -0
- package/dist/api/events/factories/client.d.ts.map +1 -0
- package/dist/api/events/factories/config.d.ts +34 -0
- package/dist/api/events/factories/config.d.ts.map +1 -0
- package/dist/api/events/factories/debug.d.ts +74 -0
- package/dist/api/events/factories/debug.d.ts.map +1 -0
- package/dist/api/events/factories/errors.d.ts +91 -0
- package/dist/api/events/factories/errors.d.ts.map +1 -0
- package/dist/api/events/factories/headers.d.ts +54 -0
- package/dist/api/events/factories/headers.d.ts.map +1 -0
- package/dist/api/events/factories/index.d.ts +46 -0
- package/dist/api/events/factories/index.d.ts.map +1 -0
- package/dist/api/events/factories/network.d.ts +54 -0
- package/dist/api/events/factories/network.d.ts.map +1 -0
- package/dist/api/events/factories/performance.d.ts +43 -0
- package/dist/api/events/factories/performance.d.ts.map +1 -0
- package/dist/api/events/index.d.ts +34 -0
- package/dist/api/events/index.d.ts.map +1 -0
- package/dist/api/events/namespaces.d.ts +464 -0
- package/dist/api/events/namespaces.d.ts.map +1 -0
- package/dist/api/events/queue/ConfigUpdateQueueManager.d.ts +53 -0
- package/dist/api/events/queue/ConfigUpdateQueueManager.d.ts.map +1 -0
- package/dist/api/events/queue/EventQueueManager.d.ts +69 -0
- package/dist/api/events/queue/EventQueueManager.d.ts.map +1 -0
- package/dist/api/events/queue/index.d.ts +12 -0
- package/dist/api/events/queue/index.d.ts.map +1 -0
- package/dist/api/events/shared-emitter.d.ts +14 -0
- package/dist/api/events/shared-emitter.d.ts.map +1 -0
- package/dist/api/headers/cache.d.ts +17 -0
- package/dist/api/headers/cache.d.ts.map +1 -0
- package/dist/api/headers/enriched.d.ts +18 -0
- package/dist/api/headers/enriched.d.ts.map +1 -0
- package/dist/api/headers/events.d.ts +17 -0
- package/dist/api/headers/events.d.ts.map +1 -0
- package/dist/api/headers/extract.d.ts +73 -0
- package/dist/api/headers/extract.d.ts.map +1 -0
- package/dist/api/headers/headerBuilder.d.ts +308 -0
- package/dist/api/headers/headerBuilder.d.ts.map +1 -0
- package/dist/api/headers/index.d.ts +37 -0
- package/dist/api/headers/index.d.ts.map +1 -0
- package/dist/api/headers/merge.d.ts +32 -0
- package/dist/api/headers/merge.d.ts.map +1 -0
- package/dist/api/headers/presets.d.ts +24 -0
- package/dist/api/headers/presets.d.ts.map +1 -0
- package/dist/api/headers/utils.d.ts +38 -0
- package/dist/api/headers/utils.d.ts.map +1 -0
- package/dist/api/hooks/factories/createApiMutation.d.ts +57 -0
- package/dist/api/hooks/factories/createApiMutation.d.ts.map +1 -0
- package/dist/api/hooks/factories/createApiQuery.d.ts +55 -0
- package/dist/api/hooks/factories/createApiQuery.d.ts.map +1 -0
- package/dist/api/hooks/factories/defaults.d.ts +15 -0
- package/dist/api/hooks/factories/defaults.d.ts.map +1 -0
- package/dist/api/hooks/factories/index.d.ts +8 -0
- package/dist/api/hooks/factories/index.d.ts.map +1 -0
- package/dist/api/hooks/index.d.ts +11 -0
- package/dist/api/hooks/index.d.ts.map +1 -0
- package/dist/api/hooks/types.d.ts +82 -0
- package/dist/api/hooks/types.d.ts.map +1 -0
- package/dist/api/hooks/useApiConfigConflicts.d.ts +24 -0
- package/dist/api/hooks/useApiConfigConflicts.d.ts.map +1 -0
- package/dist/api/hooks/useApiDebugInfo.d.ts +24 -0
- package/dist/api/hooks/useApiDebugInfo.d.ts.map +1 -0
- package/dist/api/hooks/useApiMonitor.d.ts +25 -0
- package/dist/api/hooks/useApiMonitor.d.ts.map +1 -0
- package/dist/api/hooks/useApiNetworkQuality.d.ts +21 -0
- package/dist/api/hooks/useApiNetworkQuality.d.ts.map +1 -0
- package/dist/api/index.d.ts +26 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/network/adaptive.d.ts +56 -0
- package/dist/api/network/adaptive.d.ts.map +1 -0
- package/dist/api/network/client-hints.d.ts +25 -0
- package/dist/api/network/client-hints.d.ts.map +1 -0
- package/dist/api/network/connection.d.ts +60 -0
- package/dist/api/network/connection.d.ts.map +1 -0
- package/dist/api/network/core.d.ts +26 -0
- package/dist/api/network/core.d.ts.map +1 -0
- package/dist/api/network/events.d.ts +18 -0
- package/dist/api/network/events.d.ts.map +1 -0
- package/dist/api/network/frameworks/express.d.ts +110 -0
- package/dist/api/network/frameworks/express.d.ts.map +1 -0
- package/dist/api/network/frameworks/index.d.ts +13 -0
- package/dist/api/network/frameworks/index.d.ts.map +1 -0
- package/dist/api/network/frameworks/nestjs/clientHintsInterceptor.d.ts +29 -0
- package/dist/api/network/frameworks/nestjs/clientHintsInterceptor.d.ts.map +1 -0
- package/dist/api/network/frameworks/nestjs/decorators.d.ts +48 -0
- package/dist/api/network/frameworks/nestjs/decorators.d.ts.map +1 -0
- package/dist/api/network/frameworks/nestjs/enrichedHeadersGuard.d.ts +80 -0
- package/dist/api/network/frameworks/nestjs/enrichedHeadersGuard.d.ts.map +1 -0
- package/dist/api/network/frameworks/nestjs/enrichedHeadersInterceptor.d.ts +83 -0
- package/dist/api/network/frameworks/nestjs/enrichedHeadersInterceptor.d.ts.map +1 -0
- package/dist/api/network/frameworks/nestjs/index.d.ts +13 -0
- package/dist/api/network/frameworks/nestjs/index.d.ts.map +1 -0
- package/dist/api/network/frameworks/nestjs/minimumConnectionGuard.d.ts +27 -0
- package/dist/api/network/frameworks/nestjs/minimumConnectionGuard.d.ts.map +1 -0
- package/dist/api/network/frameworks/nestjs/networkDetectionMiddleware.d.ts +31 -0
- package/dist/api/network/frameworks/nestjs/networkDetectionMiddleware.d.ts.map +1 -0
- package/dist/api/network/frameworks/nestjs/networkGuard.d.ts +33 -0
- package/dist/api/network/frameworks/nestjs/networkGuard.d.ts.map +1 -0
- package/dist/api/network/frameworks/nestjs/noDataSaverGuard.d.ts +25 -0
- package/dist/api/network/frameworks/nestjs/noDataSaverGuard.d.ts.map +1 -0
- package/dist/api/network/frameworks/nextjs.d.ts +86 -0
- package/dist/api/network/frameworks/nextjs.d.ts.map +1 -0
- package/dist/api/network/frameworks/shared.d.ts +45 -0
- package/dist/api/network/frameworks/shared.d.ts.map +1 -0
- package/dist/api/network/headers.d.ts +112 -0
- package/dist/api/network/headers.d.ts.map +1 -0
- package/dist/api/network/index.d.ts +17 -0
- package/dist/api/network/index.d.ts.map +1 -0
- package/dist/api/network/networkConfigurationManager.d.ts +225 -0
- package/dist/api/network/networkConfigurationManager.d.ts.map +1 -0
- package/dist/api/network/platform.d.ts +171 -0
- package/dist/api/network/platform.d.ts.map +1 -0
- package/dist/api/network/presets.d.ts +55 -0
- package/dist/api/network/presets.d.ts.map +1 -0
- package/dist/api/network/quality.d.ts +28 -0
- package/dist/api/network/quality.d.ts.map +1 -0
- package/dist/api/network/status.d.ts +74 -0
- package/dist/api/network/status.d.ts.map +1 -0
- package/dist/api/performance/adaptive.d.ts +35 -0
- package/dist/api/performance/adaptive.d.ts.map +1 -0
- package/dist/api/performance/index.d.ts +133 -0
- package/dist/api/performance/index.d.ts.map +1 -0
- package/dist/api/performance/patterns.d.ts +20 -0
- package/dist/api/performance/patterns.d.ts.map +1 -0
- package/dist/api/performance/performanceMonitor.d.ts +85 -0
- package/dist/api/performance/performanceMonitor.d.ts.map +1 -0
- package/dist/api/performance/presets.d.ts +18 -0
- package/dist/api/performance/presets.d.ts.map +1 -0
- package/dist/api/performance/utils.d.ts +98 -0
- package/dist/api/performance/utils.d.ts.map +1 -0
- package/dist/api/polling/index.d.ts +10 -0
- package/dist/api/polling/index.d.ts.map +1 -0
- package/dist/api/polling/strategies.d.ts +128 -0
- package/dist/api/polling/strategies.d.ts.map +1 -0
- package/dist/api/polling/utils.d.ts +133 -0
- package/dist/api/polling/utils.d.ts.map +1 -0
- package/dist/api/pubsub/index.d.ts +147 -0
- package/dist/api/pubsub/index.d.ts.map +1 -0
- package/dist/api/pubsub/react.d.ts +214 -0
- package/dist/api/pubsub/react.d.ts.map +1 -0
- package/dist/api/queue/BaseOperationTracker.d.ts +86 -0
- package/dist/api/queue/BaseOperationTracker.d.ts.map +1 -0
- package/dist/api/queue/BaseQueueManager.d.ts +54 -0
- package/dist/api/queue/BaseQueueManager.d.ts.map +1 -0
- package/dist/api/queue/BatchProcessor.d.ts +42 -0
- package/dist/api/queue/BatchProcessor.d.ts.map +1 -0
- package/dist/api/queue/EventQueueManager.d.ts +128 -0
- package/dist/api/queue/EventQueueManager.d.ts.map +1 -0
- package/dist/api/queue/PriorityQueue.d.ts +58 -0
- package/dist/api/queue/PriorityQueue.d.ts.map +1 -0
- package/dist/api/queue/QueueFactory.d.ts +57 -0
- package/dist/api/queue/QueueFactory.d.ts.map +1 -0
- package/dist/api/queue/QueueOrchestrator.d.ts +90 -0
- package/dist/api/queue/QueueOrchestrator.d.ts.map +1 -0
- package/dist/api/queue/QueueSystem.d.ts +102 -0
- package/dist/api/queue/QueueSystem.d.ts.map +1 -0
- package/dist/api/queue/index.d.ts +22 -0
- package/dist/api/queue/index.d.ts.map +1 -0
- package/dist/api/regional/constants.d.ts +76 -0
- package/dist/api/regional/constants.d.ts.map +1 -0
- package/dist/api/regional/core.d.ts +56 -0
- package/dist/api/regional/core.d.ts.map +1 -0
- package/dist/api/regional/helpers.d.ts +49 -0
- package/dist/api/regional/helpers.d.ts.map +1 -0
- package/dist/api/regional/index.d.ts +10 -0
- package/dist/api/regional/index.d.ts.map +1 -0
- package/dist/api/regional/presets.d.ts +16 -0
- package/dist/api/regional/presets.d.ts.map +1 -0
- package/dist/api/request/index.d.ts +18 -0
- package/dist/api/request/index.d.ts.map +1 -0
- package/dist/api/request/management.d.ts +46 -0
- package/dist/api/request/management.d.ts.map +1 -0
- package/dist/api/request/prepare.d.ts +34 -0
- package/dist/api/request/prepare.d.ts.map +1 -0
- package/dist/api/request/react.d.ts +98 -0
- package/dist/api/request/react.d.ts.map +1 -0
- package/dist/api/request/routing.d.ts +74 -0
- package/dist/api/request/routing.d.ts.map +1 -0
- package/dist/api/request/tracker.d.ts +76 -0
- package/dist/api/request/tracker.d.ts.map +1 -0
- package/dist/api/request/utils.d.ts +129 -0
- package/dist/api/request/utils.d.ts.map +1 -0
- package/dist/api/retry/conditions.d.ts +140 -0
- package/dist/api/retry/conditions.d.ts.map +1 -0
- package/dist/api/retry/index.d.ts +10 -0
- package/dist/api/retry/index.d.ts.map +1 -0
- package/dist/api/retry/strategies.d.ts +56 -0
- package/dist/api/retry/strategies.d.ts.map +1 -0
- package/dist/api/revalidation/index.d.ts +29 -0
- package/dist/api/revalidation/index.d.ts.map +1 -0
- package/dist/api/revalidation/presets.d.ts +71 -0
- package/dist/api/revalidation/presets.d.ts.map +1 -0
- package/dist/api/revalidation/strategies.d.ts +116 -0
- package/dist/api/revalidation/strategies.d.ts.map +1 -0
- package/dist/api/revalidation/utils.d.ts +78 -0
- package/dist/api/revalidation/utils.d.ts.map +1 -0
- package/dist/api/services/campaigns/DELETE/deleteCampaign.d.ts +30 -0
- package/dist/api/services/campaigns/DELETE/deleteCampaign.d.ts.map +1 -0
- package/dist/api/services/campaigns/DELETE/index.d.ts +7 -0
- package/dist/api/services/campaigns/DELETE/index.d.ts.map +1 -0
- package/dist/api/services/campaigns/DELETE/useDeleteCampaign.d.ts +24 -0
- package/dist/api/services/campaigns/DELETE/useDeleteCampaign.d.ts.map +1 -0
- package/dist/api/services/campaigns/GET/fetchCampaign.d.ts +36 -0
- package/dist/api/services/campaigns/GET/fetchCampaign.d.ts.map +1 -0
- package/dist/api/services/campaigns/GET/fetchCampaignParticipants.d.ts +40 -0
- package/dist/api/services/campaigns/GET/fetchCampaignParticipants.d.ts.map +1 -0
- package/dist/api/services/campaigns/GET/fetchCampaignStats.d.ts +31 -0
- package/dist/api/services/campaigns/GET/fetchCampaignStats.d.ts.map +1 -0
- package/dist/api/services/campaigns/GET/fetchCampaigns.d.ts +39 -0
- package/dist/api/services/campaigns/GET/fetchCampaigns.d.ts.map +1 -0
- package/dist/api/services/campaigns/GET/index.d.ts +13 -0
- package/dist/api/services/campaigns/GET/index.d.ts.map +1 -0
- package/dist/api/services/campaigns/GET/useCampaign.d.ts +47 -0
- package/dist/api/services/campaigns/GET/useCampaign.d.ts.map +1 -0
- package/dist/api/services/campaigns/GET/useCampaignParticipants.d.ts +43 -0
- package/dist/api/services/campaigns/GET/useCampaignParticipants.d.ts.map +1 -0
- package/dist/api/services/campaigns/GET/useCampaignStats.d.ts +33 -0
- package/dist/api/services/campaigns/GET/useCampaignStats.d.ts.map +1 -0
- package/dist/api/services/campaigns/GET/useCampaigns.d.ts +43 -0
- package/dist/api/services/campaigns/GET/useCampaigns.d.ts.map +1 -0
- package/dist/api/services/campaigns/POST/createCampaign.d.ts +37 -0
- package/dist/api/services/campaigns/POST/createCampaign.d.ts.map +1 -0
- package/dist/api/services/campaigns/POST/index.d.ts +11 -0
- package/dist/api/services/campaigns/POST/index.d.ts.map +1 -0
- package/dist/api/services/campaigns/POST/joinCampaign.d.ts +31 -0
- package/dist/api/services/campaigns/POST/joinCampaign.d.ts.map +1 -0
- package/dist/api/services/campaigns/POST/leaveCampaign.d.ts +31 -0
- package/dist/api/services/campaigns/POST/leaveCampaign.d.ts.map +1 -0
- package/dist/api/services/campaigns/POST/useCreateCampaign.d.ts +36 -0
- package/dist/api/services/campaigns/POST/useCreateCampaign.d.ts.map +1 -0
- package/dist/api/services/campaigns/POST/useJoinCampaign.d.ts +23 -0
- package/dist/api/services/campaigns/POST/useJoinCampaign.d.ts.map +1 -0
- package/dist/api/services/campaigns/POST/useLeaveCampaign.d.ts +23 -0
- package/dist/api/services/campaigns/POST/useLeaveCampaign.d.ts.map +1 -0
- package/dist/api/services/campaigns/PUT/index.d.ts +7 -0
- package/dist/api/services/campaigns/PUT/index.d.ts.map +1 -0
- package/dist/api/services/campaigns/PUT/updateCampaign.d.ts +37 -0
- package/dist/api/services/campaigns/PUT/updateCampaign.d.ts.map +1 -0
- package/dist/api/services/campaigns/PUT/useUpdateCampaign.d.ts +38 -0
- package/dist/api/services/campaigns/PUT/useUpdateCampaign.d.ts.map +1 -0
- package/dist/api/services/campaigns/index.d.ts +9 -0
- package/dist/api/services/campaigns/index.d.ts.map +1 -0
- package/dist/api/services/clients.d.ts +58 -0
- package/dist/api/services/clients.d.ts.map +1 -0
- package/dist/api/services/index.d.ts +7 -0
- package/dist/api/services/index.d.ts.map +1 -0
- package/dist/api/strategies/index.d.ts +8 -0
- package/dist/api/strategies/index.d.ts.map +1 -0
- package/dist/api/strategies/tracked.d.ts +15 -0
- package/dist/api/strategies/tracked.d.ts.map +1 -0
- package/dist/api/strategies/unified.d.ts +87 -0
- package/dist/api/strategies/unified.d.ts.map +1 -0
- package/dist/api/utils/async-control.d.ts +96 -0
- package/dist/api/utils/async-control.d.ts.map +1 -0
- package/dist/api/utils/colors.d.ts +88 -0
- package/dist/api/utils/colors.d.ts.map +1 -0
- package/dist/api/utils/environment.d.ts +595 -0
- package/dist/api/utils/environment.d.ts.map +1 -0
- package/dist/api/utils/generation/correlation-id.d.ts +206 -0
- package/dist/api/utils/generation/correlation-id.d.ts.map +1 -0
- package/dist/api/utils/generation/id-generator.d.ts +133 -0
- package/dist/api/utils/generation/id-generator.d.ts.map +1 -0
- package/dist/api/utils/generation/request-id.d.ts +106 -0
- package/dist/api/utils/generation/request-id.d.ts.map +1 -0
- package/dist/api/utils/index.d.ts +19 -0
- package/dist/api/utils/index.d.ts.map +1 -0
- package/dist/api/utils/interval-manager.d.ts +94 -0
- package/dist/api/utils/interval-manager.d.ts.map +1 -0
- package/dist/api/utils/json.d.ts +98 -0
- package/dist/api/utils/json.d.ts.map +1 -0
- package/dist/api/utils/math.d.ts +168 -0
- package/dist/api/utils/math.d.ts.map +1 -0
- package/dist/api/utils/object-merge.d.ts +34 -0
- package/dist/api/utils/object-merge.d.ts.map +1 -0
- package/dist/api/utils/object.d.ts +101 -0
- package/dist/api/utils/object.d.ts.map +1 -0
- package/dist/api/utils/string.d.ts +41 -0
- package/dist/api/utils/string.d.ts.map +1 -0
- package/dist/api/utils/time.d.ts +233 -0
- package/dist/api/utils/time.d.ts.map +1 -0
- package/dist/api/utils/type-guards.d.ts +59 -0
- package/dist/api/utils/type-guards.d.ts.map +1 -0
- package/dist/api/utils/validation.d.ts +21 -0
- package/dist/api/utils/validation.d.ts.map +1 -0
- package/dist/index.cjs +25594 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +25068 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -6
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event Factory Exports
|
|
3
|
+
* Centralized export of all event factories (implementations only)
|
|
4
|
+
*
|
|
5
|
+
* NOTE: All types are available from @plyaz/types/api, not re-exported here
|
|
6
|
+
* Import types like: import type { HeaderEvent, NetworkEvent, etc. } from '@plyaz/types/api';
|
|
7
|
+
*/
|
|
8
|
+
export { BaseEventFactory } from './base';
|
|
9
|
+
export { HeaderEventFactory } from './headers';
|
|
10
|
+
export { NetworkEventFactory } from './network';
|
|
11
|
+
export { ErrorEventFactory } from './errors';
|
|
12
|
+
export { DebugEventFactory } from './debug';
|
|
13
|
+
export { ConfigEventFactory, getConfigEventFactory } from './config';
|
|
14
|
+
export { PerformanceEventFactory, getPerformanceEventFactory } from './performance';
|
|
15
|
+
export { CacheEventFactory, getCacheEventFactory } from './cache';
|
|
16
|
+
export { ClientEventFactory, getClientEventFactory } from './client';
|
|
17
|
+
import { HeaderEventFactory } from './headers';
|
|
18
|
+
import { NetworkEventFactory } from './network';
|
|
19
|
+
import { ErrorEventFactory } from './errors';
|
|
20
|
+
import { DebugEventFactory } from './debug';
|
|
21
|
+
import type { EventEmitter } from '../../pubsub';
|
|
22
|
+
/**
|
|
23
|
+
* Get singleton header event factory
|
|
24
|
+
* @param emitter - The event emitter to use (optional, defaults to shared emitter)
|
|
25
|
+
*/
|
|
26
|
+
export declare function getHeaderEventFactory(emitter?: EventEmitter): HeaderEventFactory;
|
|
27
|
+
/**
|
|
28
|
+
* Get singleton network event factory
|
|
29
|
+
* @param emitter - The event emitter to use (optional, defaults to shared emitter)
|
|
30
|
+
*/
|
|
31
|
+
export declare function getNetworkEventFactory(emitter?: EventEmitter): NetworkEventFactory;
|
|
32
|
+
/**
|
|
33
|
+
* Get singleton error event factory
|
|
34
|
+
* @param emitter - The event emitter to use (optional, defaults to shared emitter)
|
|
35
|
+
*/
|
|
36
|
+
export declare function getErrorEventFactory(emitter?: EventEmitter): ErrorEventFactory;
|
|
37
|
+
/**
|
|
38
|
+
* Get singleton debug event factory
|
|
39
|
+
* @param emitter - The event emitter to use (optional, defaults to shared emitter)
|
|
40
|
+
*/
|
|
41
|
+
export declare function getDebugEventFactory(emitter?: EventEmitter): DebugEventFactory;
|
|
42
|
+
/**
|
|
43
|
+
* Reset all factory instances (mainly for testing)
|
|
44
|
+
*/
|
|
45
|
+
export declare function resetFactories(): void;
|
|
46
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/events/factories/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAG1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AACpF,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAGrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AASjD;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,kBAAkB,CAIhF;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,mBAAmB,CAIlF;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,iBAAiB,CAI9E;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,iBAAiB,CAI9E;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAKrC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Network Event Factory
|
|
3
|
+
* Creates and emits network-related events with type safety
|
|
4
|
+
*/
|
|
5
|
+
import type { NetworkQualityEvent, NetworkInfoEvent, NetworkConfigOverrideEvent, NetworkPresetEvent, NetworkClientHintsEvent, NetworkAutoDetectionEvent, NetworkManualUpdateEvent, EmitConfigOverrideOptions, EmitPresetAppliedOptions, EmitQualityChangeOptions, EmitAutoDetectionOptions, EmitConfigRestoredOptions, EventOptions, NetworkInfo, EmitPresetChangedOptions, NetworkClientHints as NetworkHints } from '@plyaz/types/api';
|
|
6
|
+
import { BaseEventFactory } from './base';
|
|
7
|
+
import type { EventEmitter } from '../../pubsub';
|
|
8
|
+
/**
|
|
9
|
+
* Factory for creating network events
|
|
10
|
+
*/
|
|
11
|
+
export declare class NetworkEventFactory extends BaseEventFactory<'network'> {
|
|
12
|
+
constructor(emitter: EventEmitter);
|
|
13
|
+
/**
|
|
14
|
+
* Create and emit a network quality change event
|
|
15
|
+
*/
|
|
16
|
+
emitQualityChange(options: EmitQualityChangeOptions): NetworkQualityEvent;
|
|
17
|
+
/**
|
|
18
|
+
* Create and emit a network info update event
|
|
19
|
+
*/
|
|
20
|
+
emitInfoUpdate(current: NetworkInfo, previous?: NetworkInfo, options?: EventOptions): NetworkInfoEvent;
|
|
21
|
+
/**
|
|
22
|
+
* Create and emit a network config override event
|
|
23
|
+
*/
|
|
24
|
+
emitConfigOverride(options: EmitConfigOverrideOptions): NetworkConfigOverrideEvent;
|
|
25
|
+
/**
|
|
26
|
+
* Create and emit a network config restored event
|
|
27
|
+
*/
|
|
28
|
+
emitConfigRestored(options: EmitConfigRestoredOptions): NetworkConfigOverrideEvent;
|
|
29
|
+
/**
|
|
30
|
+
* Create and emit a network preset applied event
|
|
31
|
+
*/
|
|
32
|
+
emitPresetApplied(options: EmitPresetAppliedOptions): NetworkPresetEvent;
|
|
33
|
+
/**
|
|
34
|
+
* Create and emit a network preset changed event
|
|
35
|
+
*/
|
|
36
|
+
emitPresetChanged(options: EmitPresetChangedOptions): NetworkPresetEvent;
|
|
37
|
+
/**
|
|
38
|
+
* Create and emit a network client hints updated event
|
|
39
|
+
*/
|
|
40
|
+
emitHintsUpdated(current: NetworkHints, source: 'auto' | 'headers' | 'manual', previous?: NetworkHints, options?: EventOptions): NetworkClientHintsEvent;
|
|
41
|
+
/**
|
|
42
|
+
* Create and emit a network auto detection event
|
|
43
|
+
*/
|
|
44
|
+
emitAutoDetection(options: EmitAutoDetectionOptions): NetworkAutoDetectionEvent;
|
|
45
|
+
/**
|
|
46
|
+
* Create and emit a network manual update event
|
|
47
|
+
*/
|
|
48
|
+
emitManualUpdate(updates: Partial<NetworkInfo>, source: 'user' | 'api' | 'config', reason?: string, options?: EventOptions): NetworkManualUpdateEvent;
|
|
49
|
+
/**
|
|
50
|
+
* Detect changes between network info objects
|
|
51
|
+
*/
|
|
52
|
+
private detectInfoChanges;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=network.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../../../src/api/events/factories/network.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACV,mBAAmB,EACnB,gBAAgB,EAChB,0BAA0B,EAC1B,kBAAkB,EAClB,uBAAuB,EACvB,yBAAyB,EACzB,wBAAwB,EACxB,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,EACxB,yBAAyB,EACzB,YAAY,EACZ,WAAW,EACX,wBAAwB,EACxB,kBAAkB,IAAI,YAAY,EACnC,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,gBAAgB,CAAC,SAAS,CAAC;gBACtD,OAAO,EAAE,YAAY;IAIjC;;OAEG;IACI,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,mBAAmB;IAyBhF;;OAEG;IACI,cAAc,CACnB,OAAO,EAAE,WAAW,EACpB,QAAQ,CAAC,EAAE,WAAW,EACtB,OAAO,GAAE,YAAiB,GACzB,gBAAgB;IAgBnB;;OAEG;IACI,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,0BAA0B;IA4BzF;;OAEG;IACI,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,0BAA0B;IAkBzF;;OAEG;IACI,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,kBAAkB;IAiB/E;;OAEG;IACI,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,kBAAkB;IAiB/E;;OAEG;IACI,gBAAgB,CACrB,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,EACrC,QAAQ,CAAC,EAAE,YAAY,EACvB,OAAO,GAAE,YAAiB,GACzB,uBAAuB;IAc1B;;OAEG;IACI,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,yBAAyB;IAgBtF;;OAEG;IACI,gBAAgB,CACrB,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,EAC7B,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,EACjC,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,GAAE,YAAiB,GACzB,wBAAwB;IAc3B;;OAEG;IACH,OAAO,CAAC,iBAAiB;CAsB1B"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Performance Event Factory
|
|
3
|
+
* Creates and emits performance-related events with type safety
|
|
4
|
+
*/
|
|
5
|
+
import type { PerformanceRequestStartEvent, PerformanceRequestCompleteEvent, PerformanceRetryEvent, PerformanceThresholdExceededEvent, PerformanceOptimizationAppliedEvent, PerformanceMetricRecordedEvent, EventOptions, EmitThresholdExceededOptions, EmitOptimizationAppliedOptions, EmitMetricRecordedOptions, EmitRetryOptions, EmitRequestCompleteOptions } from '@plyaz/types/api';
|
|
6
|
+
import { BaseEventFactory } from './base';
|
|
7
|
+
import type { EventEmitter } from '../../pubsub';
|
|
8
|
+
/**
|
|
9
|
+
* Performance Event Factory
|
|
10
|
+
*/
|
|
11
|
+
export declare class PerformanceEventFactory extends BaseEventFactory<'performance'> {
|
|
12
|
+
constructor(emitter: EventEmitter);
|
|
13
|
+
/**
|
|
14
|
+
* Emit request start event
|
|
15
|
+
*/
|
|
16
|
+
emitRequestStart(requestId: string, url: string, method: string, options?: EventOptions): PerformanceRequestStartEvent;
|
|
17
|
+
/**
|
|
18
|
+
* Emit request complete event
|
|
19
|
+
*/
|
|
20
|
+
emitRequestComplete(options: EmitRequestCompleteOptions): PerformanceRequestCompleteEvent;
|
|
21
|
+
/**
|
|
22
|
+
* Emit retry event
|
|
23
|
+
*/
|
|
24
|
+
emitRetry(options: EmitRetryOptions): PerformanceRetryEvent;
|
|
25
|
+
/**
|
|
26
|
+
* Emit threshold exceeded event
|
|
27
|
+
*/
|
|
28
|
+
emitThresholdExceeded(options: EmitThresholdExceededOptions): PerformanceThresholdExceededEvent;
|
|
29
|
+
/**
|
|
30
|
+
* Emit optimization applied event
|
|
31
|
+
*/
|
|
32
|
+
emitOptimizationApplied(options: EmitOptimizationAppliedOptions): PerformanceOptimizationAppliedEvent;
|
|
33
|
+
/**
|
|
34
|
+
* Emit metric recorded event
|
|
35
|
+
*/
|
|
36
|
+
emitMetricRecorded(options: EmitMetricRecordedOptions): PerformanceMetricRecordedEvent;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Get singleton performance event factory
|
|
40
|
+
* @param emitter - The event emitter to use (optional, defaults to shared emitter)
|
|
41
|
+
*/
|
|
42
|
+
export declare function getPerformanceEventFactory(emitter?: EventEmitter): PerformanceEventFactory;
|
|
43
|
+
//# sourceMappingURL=performance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"performance.d.ts","sourceRoot":"","sources":["../../../../src/api/events/factories/performance.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACV,4BAA4B,EAC5B,+BAA+B,EAC/B,qBAAqB,EACrB,iCAAiC,EACjC,mCAAmC,EACnC,8BAA8B,EAC9B,YAAY,EACZ,4BAA4B,EAC5B,8BAA8B,EAC9B,yBAAyB,EACzB,gBAAgB,EAChB,0BAA0B,EAC3B,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGjD;;GAEG;AACH,qBAAa,uBAAwB,SAAQ,gBAAgB,CAAC,aAAa,CAAC;gBAC9D,OAAO,EAAE,YAAY;IAIjC;;OAEG;IACI,gBAAgB,CACrB,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,YAAiB,GACzB,4BAA4B;IAc/B;;OAEG;IACI,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,+BAA+B;IAkBhG;;OAEG;IACI,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,qBAAqB;IAiBlE;;OAEG;IACI,qBAAqB,CAC1B,OAAO,EAAE,4BAA4B,GACpC,iCAAiC;IAgBpC;;OAEG;IACI,uBAAuB,CAC5B,OAAO,EAAE,8BAA8B,GACtC,mCAAmC;IAgBtC;;OAEG;IACI,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,8BAA8B;CAe9F;AAID;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,uBAAuB,CAI1F"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event System Barrel Exports
|
|
3
|
+
*
|
|
4
|
+
* Centralized exports for the unified event system.
|
|
5
|
+
* This provides a single entry point for all event-related functionality.
|
|
6
|
+
*/
|
|
7
|
+
export { getSharedEventEmitter, resetSharedEventEmitter } from './shared-emitter';
|
|
8
|
+
export { EVENT_NAMESPACES, HEADER_EVENTS, NETWORK_EVENTS, ERROR_EVENTS, DEBUG_EVENTS, CONFIG_EVENTS, PERFORMANCE_EVENTS, CLIENT_EVENTS, CACHE_EVENTS, ALL_EVENTS, HANDLER_SCOPES, EVENT_SCOPES, EVENT_SCOPES_WITH_TEMPORARY, HANDLER_NAMESPACES, createEventKey, createHandlerNamespace, createErrorHandlerNamespace, createDebugHandlerNamespace, createRequestHandlerNamespace, createResponseHandlerNamespace, createRetryHandlerNamespace, createHeadersHandlerNamespace, createNetworkHandlerNamespace, createCacheHandlerNamespace, createConfigHandlerNamespace, createPerformanceHandlerNamespace, createClientHandlerNamespace, createPollingHandlerNamespace, createRevalidationHandlerNamespace, } from './namespaces';
|
|
9
|
+
export { getHeaderEventFactory, getNetworkEventFactory, getErrorEventFactory, getDebugEventFactory, getConfigEventFactory, getPerformanceEventFactory, getCacheEventFactory, getClientEventFactory, } from './factories';
|
|
10
|
+
export { EventManager, getEventManager, eventManager } from './EventManager';
|
|
11
|
+
export { createEventEmitter } from '../pubsub';
|
|
12
|
+
export declare const EventHelpers: {
|
|
13
|
+
/**
|
|
14
|
+
* Check if an event key matches a wildcard pattern
|
|
15
|
+
*/
|
|
16
|
+
readonly matchesWildcard: (eventKey: string, pattern: string) => boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Extract namespace from event key
|
|
19
|
+
*/
|
|
20
|
+
readonly getNamespace: (eventKey: string) => string;
|
|
21
|
+
/**
|
|
22
|
+
* Extract event name from event key
|
|
23
|
+
*/
|
|
24
|
+
readonly getEventName: (eventKey: string) => string;
|
|
25
|
+
/**
|
|
26
|
+
* Check if event key is a wildcard pattern
|
|
27
|
+
*/
|
|
28
|
+
readonly isWildcard: (eventKey: string) => boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Get all wildcard patterns that would match an event
|
|
31
|
+
*/
|
|
32
|
+
readonly getMatchingWildcards: (eventKey: string) => string[];
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/events/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAGlF,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,UAAU,EACV,cAAc,EACd,YAAY,EACZ,2BAA2B,EAC3B,kBAAkB,EAClB,cAAc,EACd,sBAAsB,EAEtB,2BAA2B,EAC3B,2BAA2B,EAC3B,6BAA6B,EAC7B,8BAA8B,EAC9B,2BAA2B,EAC3B,6BAA6B,EAC7B,6BAA6B,EAC7B,2BAA2B,EAC3B,4BAA4B,EAC5B,iCAAiC,EACjC,4BAA4B,EAC5B,6BAA6B,EAC7B,kCAAkC,GACnC,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,0BAA0B,EAC1B,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAM/C,eAAO,MAAM,YAAY;IACvB;;OAEG;yCACyB,MAAM,WAAW,MAAM,KAAG,OAAO;IAQ7D;;OAEG;sCACsB,MAAM,KAAG,MAAM;IAKxC;;OAEG;sCACsB,MAAM,KAAG,MAAM;IAKxC;;OAEG;oCACoB,MAAM,KAAG,OAAO;IAIvC;;OAEG;8CAC8B,MAAM,KAAG,MAAM,EAAE;CAI1C,CAAC"}
|
|
@@ -0,0 +1,464 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event Namespace Constants
|
|
3
|
+
* Centralized constants for all event namespaces
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Main event namespaces for the API package
|
|
7
|
+
*/
|
|
8
|
+
export declare const EVENT_NAMESPACES: {
|
|
9
|
+
readonly HEADERS: "headers";
|
|
10
|
+
readonly NETWORK: "network";
|
|
11
|
+
readonly ERRORS: "errors";
|
|
12
|
+
readonly DEBUG: "debug";
|
|
13
|
+
readonly CONFIG: "config";
|
|
14
|
+
readonly PERFORMANCE: "performance";
|
|
15
|
+
readonly CLIENT: "client";
|
|
16
|
+
readonly CACHE: "cache";
|
|
17
|
+
readonly POLLING: "polling";
|
|
18
|
+
readonly REQUEST: "request";
|
|
19
|
+
readonly REVALIDATION: "revalidation";
|
|
20
|
+
readonly EVENT_MANAGER: "eventManager";
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Header-specific event keys
|
|
24
|
+
*/
|
|
25
|
+
export declare const HEADER_EVENTS: {
|
|
26
|
+
readonly CHANGED: "headers:changed";
|
|
27
|
+
readonly ENRICHED: "headers:enriched";
|
|
28
|
+
readonly CONFLICT: "headers:conflict";
|
|
29
|
+
readonly OVERRIDE: "headers:override";
|
|
30
|
+
readonly TRACKED: "headers:tracked";
|
|
31
|
+
readonly MERGED: "headers:merged";
|
|
32
|
+
readonly FILTERED: "headers:filtered";
|
|
33
|
+
readonly VALIDATED: "headers:validated";
|
|
34
|
+
readonly CACHED: "headers:cached";
|
|
35
|
+
readonly CACHE_HIT: "headers:cache:hit";
|
|
36
|
+
readonly CACHE_MISS: "headers:cache:miss";
|
|
37
|
+
readonly ANY: "headers:*";
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Network-specific event keys
|
|
41
|
+
*/
|
|
42
|
+
export declare const NETWORK_EVENTS: {
|
|
43
|
+
readonly QUALITY_CHANGE: "network:quality:changed";
|
|
44
|
+
readonly INFO_UPDATE: "network:info-update";
|
|
45
|
+
readonly CONFIG_OVERRIDE: "network:config:override";
|
|
46
|
+
readonly CONFIG_RESTORED: "network:config:restored";
|
|
47
|
+
readonly OVERRIDE_CHANGE: "network:override-change";
|
|
48
|
+
readonly PRESET_APPLIED: "network:preset-applied";
|
|
49
|
+
readonly PRESET_CHANGED: "network:preset:changed";
|
|
50
|
+
readonly HINTS_UPDATED: "network:hints:updated";
|
|
51
|
+
readonly AUTO_DETECTION: "network:auto:detection";
|
|
52
|
+
readonly MANUAL_UPDATE: "network:manual:update";
|
|
53
|
+
readonly ANY: "network:*";
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Error-specific event keys
|
|
57
|
+
*/
|
|
58
|
+
export declare const ERROR_EVENTS: {
|
|
59
|
+
readonly NETWORK_ERROR: "errors:network";
|
|
60
|
+
readonly VALIDATION_ERROR: "errors:validation";
|
|
61
|
+
readonly AUTHENTICATION_ERROR: "errors:authentication";
|
|
62
|
+
readonly AUTHORIZATION_ERROR: "errors:authorization";
|
|
63
|
+
readonly RATE_LIMIT_ERROR: "errors:rate-limit";
|
|
64
|
+
readonly SERVER_ERROR: "errors:server";
|
|
65
|
+
readonly CLIENT_ERROR: "errors:client";
|
|
66
|
+
readonly TIMEOUT_ERROR: "errors:timeout";
|
|
67
|
+
readonly CONFLICT_ERROR: "errors:conflict";
|
|
68
|
+
readonly CACHE_ERROR: "errors:cache";
|
|
69
|
+
readonly HEADERS_ERROR: "errors:headers";
|
|
70
|
+
readonly RETRY_ERROR: "errors:retry";
|
|
71
|
+
readonly STRATEGY_ERROR: "errors:strategy";
|
|
72
|
+
readonly REGIONAL_ERROR: "errors:regional";
|
|
73
|
+
readonly NOT_FOUND_ERROR: "errors:not-found";
|
|
74
|
+
readonly EXTERNAL_SERVICE_ERROR: "errors:external-service";
|
|
75
|
+
readonly UNKNOWN_ERROR: "errors:unknown";
|
|
76
|
+
readonly GENERIC_ERROR: "errors:generic";
|
|
77
|
+
readonly ANY: "errors:*";
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Handler scopes for different levels of event handlers
|
|
81
|
+
* These prefixes are used for registering handlers at different priority levels
|
|
82
|
+
* Can be used for any type of handler (error, request, response, debug, etc.)
|
|
83
|
+
*
|
|
84
|
+
* Priority order (lowest to highest):
|
|
85
|
+
* 1. GLOBAL - Set via setGlobalErrorHandlers(), persists across all instances
|
|
86
|
+
* 2. CONFIG - Set via setGlobalConfig({ errorHandlers }), global configuration
|
|
87
|
+
* 3. CLIENT - Set via createApiClient({ errorHandlers }), instance-specific
|
|
88
|
+
* 4. REQUEST/TEMPORARY - Set per-request or via updateConfig(), highest priority
|
|
89
|
+
*
|
|
90
|
+
* Usage:
|
|
91
|
+
* - GLOBAL: For app-wide handlers that should always run (e.g., logging)
|
|
92
|
+
* - CONFIG: For environment-specific handlers (e.g., dev vs prod)
|
|
93
|
+
* - CLIENT: For instance-specific handlers (e.g., per-service client)
|
|
94
|
+
* - REQUEST/TEMPORARY: For request-specific or runtime updates
|
|
95
|
+
*
|
|
96
|
+
* Note: REQUEST and TEMPORARY are aliases - both use 'request' scope
|
|
97
|
+
*
|
|
98
|
+
* Examples of namespaced handlers:
|
|
99
|
+
* - Error handlers: 'global:error', 'config:error', 'client:error'
|
|
100
|
+
* - Debug handlers: 'global:debug', 'config:debug', 'client:debug'
|
|
101
|
+
* - Request handlers: 'global:request', 'config:request', 'client:request'
|
|
102
|
+
*/
|
|
103
|
+
export declare const HANDLER_SCOPES: {
|
|
104
|
+
readonly GLOBAL: "global";
|
|
105
|
+
readonly CONFIG: "config";
|
|
106
|
+
readonly CLIENT: "client";
|
|
107
|
+
readonly TEMPORARY: "request";
|
|
108
|
+
readonly REQUEST: "request";
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Core event scopes (excluding aliases)
|
|
112
|
+
* These are the actual scope values used by the event system
|
|
113
|
+
*/
|
|
114
|
+
export declare const EVENT_SCOPES: readonly ["global", "config", "client", "request"];
|
|
115
|
+
/**
|
|
116
|
+
* All event scopes including 'temporary' alias
|
|
117
|
+
* Used in APIs where 'temporary' provides semantic clarity
|
|
118
|
+
*/
|
|
119
|
+
export declare const EVENT_SCOPES_WITH_TEMPORARY: readonly ["global", "config", "client", "request", "temporary"];
|
|
120
|
+
/**
|
|
121
|
+
* Type for core event scopes
|
|
122
|
+
*/
|
|
123
|
+
export type EventScope = (typeof EVENT_SCOPES)[number];
|
|
124
|
+
/**
|
|
125
|
+
* Type for event scopes including 'temporary'
|
|
126
|
+
*/
|
|
127
|
+
export type EventScopeWithTemporary = (typeof EVENT_SCOPES)[number] | 'temporary';
|
|
128
|
+
/**
|
|
129
|
+
* Create handler namespace for a specific event type and scope
|
|
130
|
+
* Example: createHandlerNamespace('error', 'GLOBAL') => 'global:error'
|
|
131
|
+
* Example: createHandlerNamespace('debug', 'CLIENT') => 'client:debug'
|
|
132
|
+
*
|
|
133
|
+
* @param eventType - The type of event (error, debug, request, response, etc.)
|
|
134
|
+
* @param scope - The scope level (GLOBAL, CONFIG, CLIENT, REQUEST, TEMPORARY)
|
|
135
|
+
* @returns The namespaced string for handler registration
|
|
136
|
+
*/
|
|
137
|
+
export declare function createHandlerNamespace(eventType: string, scope: keyof typeof HANDLER_SCOPES): string;
|
|
138
|
+
/**
|
|
139
|
+
* Debug-specific event keys
|
|
140
|
+
*/
|
|
141
|
+
export declare const DEBUG_EVENTS: {
|
|
142
|
+
readonly CONFIG_CONFLICT: "debug:config-conflict";
|
|
143
|
+
readonly CONFIG_CHANGE: "debug:config-change";
|
|
144
|
+
readonly HEADERS_TRACKED: "debug:headers-tracked";
|
|
145
|
+
readonly NETWORK_OVERRIDE: "debug:network-override";
|
|
146
|
+
readonly NETWORK_STATE_CHANGED: "debug:network-state-changed";
|
|
147
|
+
readonly NETWORK_DATA_CLEARED: "debug:network-data-cleared";
|
|
148
|
+
readonly DEBUG_INFO: "debug:info";
|
|
149
|
+
readonly PERFORMANCE_IMPACT: "debug:performance-impact";
|
|
150
|
+
readonly MONITORING_ALERT: "debug:monitoring-alert";
|
|
151
|
+
readonly CONFIG_TRACKED: "debug:config-tracked";
|
|
152
|
+
readonly CONFLICTS_BATCH: "debug:conflicts-batch";
|
|
153
|
+
readonly EVENT_OPERATION: "debug:event-operation";
|
|
154
|
+
readonly ANY: "debug:*";
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* Configuration sources - where config updates originate from
|
|
158
|
+
*/
|
|
159
|
+
export declare const EVENTS_CONFIG_SOURCES: {
|
|
160
|
+
readonly GLOBAL: "global";
|
|
161
|
+
readonly CREATE_API_CLIENT: "createApiClient";
|
|
162
|
+
readonly UPDATE_CONFIG: "updateConfig";
|
|
163
|
+
readonly MANUAL: "manual";
|
|
164
|
+
readonly ENVIRONMENT: "environment";
|
|
165
|
+
readonly PRESET: "preset";
|
|
166
|
+
readonly NETWORK_AWARE: "networkAware";
|
|
167
|
+
readonly ADAPTIVE: "adaptive";
|
|
168
|
+
};
|
|
169
|
+
export type EventsConfigSource = (typeof EVENTS_CONFIG_SOURCES)[keyof typeof EVENTS_CONFIG_SOURCES];
|
|
170
|
+
/**
|
|
171
|
+
* Configuration-specific event keys
|
|
172
|
+
*/
|
|
173
|
+
export declare const CONFIG_EVENTS: {
|
|
174
|
+
readonly GLOBAL_UPDATED: "config:global-updated";
|
|
175
|
+
readonly GLOBAL_RESET: "config:global-reset";
|
|
176
|
+
readonly ENVIRONMENT_CONFIGURED: "config:environment-configured";
|
|
177
|
+
readonly PRESET_APPLIED: "config:preset-applied";
|
|
178
|
+
readonly ANY: "config:*";
|
|
179
|
+
};
|
|
180
|
+
/**
|
|
181
|
+
* Performance-specific event keys
|
|
182
|
+
*/
|
|
183
|
+
export declare const PERFORMANCE_EVENTS: {
|
|
184
|
+
readonly REQUEST_START: "performance:request-start";
|
|
185
|
+
readonly REQUEST_COMPLETE: "performance:request-complete";
|
|
186
|
+
readonly RETRY: "performance:retry";
|
|
187
|
+
readonly THRESHOLD_EXCEEDED: "performance:threshold-exceeded";
|
|
188
|
+
readonly OPTIMIZATION_APPLIED: "performance:optimization-applied";
|
|
189
|
+
readonly METRIC_RECORDED: "performance:metric-recorded";
|
|
190
|
+
readonly ANY: "performance:*";
|
|
191
|
+
};
|
|
192
|
+
/**
|
|
193
|
+
* Client-specific event keys
|
|
194
|
+
*/
|
|
195
|
+
export declare const CLIENT_EVENTS: {
|
|
196
|
+
readonly CONFLICT: "client:conflict";
|
|
197
|
+
readonly DEBUG: "client:debug";
|
|
198
|
+
readonly CREATED: "client:created";
|
|
199
|
+
readonly ANY: "client:*";
|
|
200
|
+
};
|
|
201
|
+
/**
|
|
202
|
+
* Cache-specific event keys
|
|
203
|
+
*/
|
|
204
|
+
export declare const CACHE_EVENTS: {
|
|
205
|
+
readonly HIT: "cache:hit";
|
|
206
|
+
readonly MISS: "cache:miss";
|
|
207
|
+
readonly INVALIDATE: "cache:invalidate";
|
|
208
|
+
readonly ANY: "cache:*";
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* All event keys combined for easy access
|
|
212
|
+
*/
|
|
213
|
+
export declare const ALL_EVENTS: {
|
|
214
|
+
readonly HIT: "cache:hit";
|
|
215
|
+
readonly MISS: "cache:miss";
|
|
216
|
+
readonly INVALIDATE: "cache:invalidate";
|
|
217
|
+
readonly ANY: "cache:*";
|
|
218
|
+
readonly CONFLICT: "client:conflict";
|
|
219
|
+
readonly DEBUG: "client:debug";
|
|
220
|
+
readonly CREATED: "client:created";
|
|
221
|
+
readonly REQUEST_START: "performance:request-start";
|
|
222
|
+
readonly REQUEST_COMPLETE: "performance:request-complete";
|
|
223
|
+
readonly RETRY: "performance:retry";
|
|
224
|
+
readonly THRESHOLD_EXCEEDED: "performance:threshold-exceeded";
|
|
225
|
+
readonly OPTIMIZATION_APPLIED: "performance:optimization-applied";
|
|
226
|
+
readonly METRIC_RECORDED: "performance:metric-recorded";
|
|
227
|
+
readonly GLOBAL_UPDATED: "config:global-updated";
|
|
228
|
+
readonly GLOBAL_RESET: "config:global-reset";
|
|
229
|
+
readonly ENVIRONMENT_CONFIGURED: "config:environment-configured";
|
|
230
|
+
readonly PRESET_APPLIED: "config:preset-applied";
|
|
231
|
+
readonly CONFIG_CONFLICT: "debug:config-conflict";
|
|
232
|
+
readonly CONFIG_CHANGE: "debug:config-change";
|
|
233
|
+
readonly HEADERS_TRACKED: "debug:headers-tracked";
|
|
234
|
+
readonly NETWORK_OVERRIDE: "debug:network-override";
|
|
235
|
+
readonly NETWORK_STATE_CHANGED: "debug:network-state-changed";
|
|
236
|
+
readonly NETWORK_DATA_CLEARED: "debug:network-data-cleared";
|
|
237
|
+
readonly DEBUG_INFO: "debug:info";
|
|
238
|
+
readonly PERFORMANCE_IMPACT: "debug:performance-impact";
|
|
239
|
+
readonly MONITORING_ALERT: "debug:monitoring-alert";
|
|
240
|
+
readonly CONFIG_TRACKED: "debug:config-tracked";
|
|
241
|
+
readonly CONFLICTS_BATCH: "debug:conflicts-batch";
|
|
242
|
+
readonly EVENT_OPERATION: "debug:event-operation";
|
|
243
|
+
readonly NETWORK_ERROR: "errors:network";
|
|
244
|
+
readonly VALIDATION_ERROR: "errors:validation";
|
|
245
|
+
readonly AUTHENTICATION_ERROR: "errors:authentication";
|
|
246
|
+
readonly AUTHORIZATION_ERROR: "errors:authorization";
|
|
247
|
+
readonly RATE_LIMIT_ERROR: "errors:rate-limit";
|
|
248
|
+
readonly SERVER_ERROR: "errors:server";
|
|
249
|
+
readonly CLIENT_ERROR: "errors:client";
|
|
250
|
+
readonly TIMEOUT_ERROR: "errors:timeout";
|
|
251
|
+
readonly CONFLICT_ERROR: "errors:conflict";
|
|
252
|
+
readonly CACHE_ERROR: "errors:cache";
|
|
253
|
+
readonly HEADERS_ERROR: "errors:headers";
|
|
254
|
+
readonly RETRY_ERROR: "errors:retry";
|
|
255
|
+
readonly STRATEGY_ERROR: "errors:strategy";
|
|
256
|
+
readonly REGIONAL_ERROR: "errors:regional";
|
|
257
|
+
readonly NOT_FOUND_ERROR: "errors:not-found";
|
|
258
|
+
readonly EXTERNAL_SERVICE_ERROR: "errors:external-service";
|
|
259
|
+
readonly UNKNOWN_ERROR: "errors:unknown";
|
|
260
|
+
readonly GENERIC_ERROR: "errors:generic";
|
|
261
|
+
readonly QUALITY_CHANGE: "network:quality:changed";
|
|
262
|
+
readonly INFO_UPDATE: "network:info-update";
|
|
263
|
+
readonly CONFIG_OVERRIDE: "network:config:override";
|
|
264
|
+
readonly CONFIG_RESTORED: "network:config:restored";
|
|
265
|
+
readonly OVERRIDE_CHANGE: "network:override-change";
|
|
266
|
+
readonly PRESET_CHANGED: "network:preset:changed";
|
|
267
|
+
readonly HINTS_UPDATED: "network:hints:updated";
|
|
268
|
+
readonly AUTO_DETECTION: "network:auto:detection";
|
|
269
|
+
readonly MANUAL_UPDATE: "network:manual:update";
|
|
270
|
+
readonly CHANGED: "headers:changed";
|
|
271
|
+
readonly ENRICHED: "headers:enriched";
|
|
272
|
+
readonly OVERRIDE: "headers:override";
|
|
273
|
+
readonly TRACKED: "headers:tracked";
|
|
274
|
+
readonly MERGED: "headers:merged";
|
|
275
|
+
readonly FILTERED: "headers:filtered";
|
|
276
|
+
readonly VALIDATED: "headers:validated";
|
|
277
|
+
readonly CACHED: "headers:cached";
|
|
278
|
+
readonly CACHE_HIT: "headers:cache:hit";
|
|
279
|
+
readonly CACHE_MISS: "headers:cache:miss";
|
|
280
|
+
};
|
|
281
|
+
/**
|
|
282
|
+
* Helper function to create namespaced event key
|
|
283
|
+
*/
|
|
284
|
+
export declare function createEventKey(namespace: keyof typeof EVENT_NAMESPACES, event: string): string;
|
|
285
|
+
/**
|
|
286
|
+
* Alias for ERROR_EVENTS for backwards compatibility
|
|
287
|
+
*/
|
|
288
|
+
export declare const ERROR_EVENT_TYPES: {
|
|
289
|
+
readonly NETWORK_ERROR: "errors:network";
|
|
290
|
+
readonly VALIDATION_ERROR: "errors:validation";
|
|
291
|
+
readonly AUTHENTICATION_ERROR: "errors:authentication";
|
|
292
|
+
readonly AUTHORIZATION_ERROR: "errors:authorization";
|
|
293
|
+
readonly RATE_LIMIT_ERROR: "errors:rate-limit";
|
|
294
|
+
readonly SERVER_ERROR: "errors:server";
|
|
295
|
+
readonly CLIENT_ERROR: "errors:client";
|
|
296
|
+
readonly TIMEOUT_ERROR: "errors:timeout";
|
|
297
|
+
readonly CONFLICT_ERROR: "errors:conflict";
|
|
298
|
+
readonly CACHE_ERROR: "errors:cache";
|
|
299
|
+
readonly HEADERS_ERROR: "errors:headers";
|
|
300
|
+
readonly RETRY_ERROR: "errors:retry";
|
|
301
|
+
readonly STRATEGY_ERROR: "errors:strategy";
|
|
302
|
+
readonly REGIONAL_ERROR: "errors:regional";
|
|
303
|
+
readonly NOT_FOUND_ERROR: "errors:not-found";
|
|
304
|
+
readonly EXTERNAL_SERVICE_ERROR: "errors:external-service";
|
|
305
|
+
readonly UNKNOWN_ERROR: "errors:unknown";
|
|
306
|
+
readonly GENERIC_ERROR: "errors:generic";
|
|
307
|
+
readonly ANY: "errors:*";
|
|
308
|
+
};
|
|
309
|
+
/**
|
|
310
|
+
* Handler namespace creators for common event types
|
|
311
|
+
* These provide convenient functions to create properly namespaced handlers
|
|
312
|
+
*
|
|
313
|
+
* @example
|
|
314
|
+
* ```typescript
|
|
315
|
+
* // For error handlers at different scopes:
|
|
316
|
+
* const globalErrorNS = createErrorHandlerNamespace('GLOBAL'); // 'global:error'
|
|
317
|
+
* const clientErrorNS = createErrorHandlerNamespace('CLIENT'); // 'client:error'
|
|
318
|
+
*
|
|
319
|
+
* // For debug handlers at different scopes:
|
|
320
|
+
* const globalDebugNS = createDebugHandlerNamespace('GLOBAL'); // 'global:debug'
|
|
321
|
+
* const clientDebugNS = createDebugHandlerNamespace('CLIENT'); // 'client:debug'
|
|
322
|
+
* ```
|
|
323
|
+
*/
|
|
324
|
+
export declare const createErrorHandlerNamespace: (scope: keyof typeof HANDLER_SCOPES) => string;
|
|
325
|
+
export declare const createDebugHandlerNamespace: (scope: keyof typeof HANDLER_SCOPES) => string;
|
|
326
|
+
export declare const createRequestHandlerNamespace: (scope: keyof typeof HANDLER_SCOPES) => string;
|
|
327
|
+
export declare const createResponseHandlerNamespace: (scope: keyof typeof HANDLER_SCOPES) => string;
|
|
328
|
+
export declare const createRetryHandlerNamespace: (scope: keyof typeof HANDLER_SCOPES) => string;
|
|
329
|
+
export declare const createHeadersHandlerNamespace: (scope: keyof typeof HANDLER_SCOPES) => string;
|
|
330
|
+
export declare const createNetworkHandlerNamespace: (scope: keyof typeof HANDLER_SCOPES) => string;
|
|
331
|
+
export declare const createCacheHandlerNamespace: (scope: keyof typeof HANDLER_SCOPES) => string;
|
|
332
|
+
export declare const createConfigHandlerNamespace: (scope: keyof typeof HANDLER_SCOPES) => string;
|
|
333
|
+
export declare const createPerformanceHandlerNamespace: (scope: keyof typeof HANDLER_SCOPES) => string;
|
|
334
|
+
export declare const createClientHandlerNamespace: (scope: keyof typeof HANDLER_SCOPES) => string;
|
|
335
|
+
export declare const createPollingHandlerNamespace: (scope: keyof typeof HANDLER_SCOPES) => string;
|
|
336
|
+
export declare const createRevalidationHandlerNamespace: (scope: keyof typeof HANDLER_SCOPES) => string;
|
|
337
|
+
/**
|
|
338
|
+
* Pre-created handler namespaces for all event types and scopes
|
|
339
|
+
* These provide ready-to-use namespaces for handler registration
|
|
340
|
+
*/
|
|
341
|
+
/**
|
|
342
|
+
* Configuration update strategy - controls WHERE configuration is applied
|
|
343
|
+
* - 'merge': Merges with existing config at CLIENT scope
|
|
344
|
+
* - 'replace': Replaces existing config at CLIENT scope
|
|
345
|
+
* - 'temporary': Applies at REQUEST/TEMPORARY scope (highest priority)
|
|
346
|
+
*/
|
|
347
|
+
export type ConfigUpdateStrategy = 'merge' | 'replace' | 'temporary';
|
|
348
|
+
/**
|
|
349
|
+
* Handler strategy - controls how handlers are registered and merged
|
|
350
|
+
* - 'merge': Merge handlers with existing ones (chain them)
|
|
351
|
+
* - 'replace': Replace existing handlers entirely
|
|
352
|
+
* - 'prepend': Add new handlers before existing ones
|
|
353
|
+
* - 'append': Add new handlers after existing ones
|
|
354
|
+
* - 'temporary': Apply as temporary handlers (highest priority, can be reverted)
|
|
355
|
+
*/
|
|
356
|
+
export type HandlerStrategy = 'merge' | 'replace' | 'append' | 'prepend' | 'temporary';
|
|
357
|
+
export declare const HANDLER_NAMESPACES: {
|
|
358
|
+
readonly ERROR: {
|
|
359
|
+
readonly GLOBAL: string;
|
|
360
|
+
readonly CONFIG: string;
|
|
361
|
+
readonly CLIENT: string;
|
|
362
|
+
readonly REQUEST: string;
|
|
363
|
+
readonly TEMPORARY: string;
|
|
364
|
+
};
|
|
365
|
+
readonly DEBUG: {
|
|
366
|
+
readonly GLOBAL: string;
|
|
367
|
+
readonly CONFIG: string;
|
|
368
|
+
readonly CLIENT: string;
|
|
369
|
+
readonly REQUEST: string;
|
|
370
|
+
readonly TEMPORARY: string;
|
|
371
|
+
};
|
|
372
|
+
readonly HEADERS: {
|
|
373
|
+
readonly GLOBAL: string;
|
|
374
|
+
readonly CONFIG: string;
|
|
375
|
+
readonly CLIENT: string;
|
|
376
|
+
readonly REQUEST: string;
|
|
377
|
+
readonly TEMPORARY: string;
|
|
378
|
+
};
|
|
379
|
+
readonly NETWORK: {
|
|
380
|
+
readonly GLOBAL: string;
|
|
381
|
+
readonly CONFIG: string;
|
|
382
|
+
readonly CLIENT: string;
|
|
383
|
+
readonly REQUEST: string;
|
|
384
|
+
readonly TEMPORARY: string;
|
|
385
|
+
};
|
|
386
|
+
readonly CACHE: {
|
|
387
|
+
readonly GLOBAL: string;
|
|
388
|
+
readonly CONFIG: string;
|
|
389
|
+
readonly CLIENT: string;
|
|
390
|
+
readonly REQUEST: string;
|
|
391
|
+
readonly TEMPORARY: string;
|
|
392
|
+
};
|
|
393
|
+
readonly CONFIG: {
|
|
394
|
+
readonly GLOBAL: string;
|
|
395
|
+
readonly CONFIG: string;
|
|
396
|
+
readonly CLIENT: string;
|
|
397
|
+
readonly REQUEST: string;
|
|
398
|
+
readonly TEMPORARY: string;
|
|
399
|
+
};
|
|
400
|
+
readonly PERFORMANCE: {
|
|
401
|
+
readonly GLOBAL: string;
|
|
402
|
+
readonly CONFIG: string;
|
|
403
|
+
readonly CLIENT: string;
|
|
404
|
+
readonly REQUEST: string;
|
|
405
|
+
readonly TEMPORARY: string;
|
|
406
|
+
};
|
|
407
|
+
readonly CLIENT: {
|
|
408
|
+
readonly GLOBAL: string;
|
|
409
|
+
readonly CONFIG: string;
|
|
410
|
+
readonly CLIENT: string;
|
|
411
|
+
readonly REQUEST: string;
|
|
412
|
+
readonly TEMPORARY: string;
|
|
413
|
+
};
|
|
414
|
+
readonly REQUEST: {
|
|
415
|
+
readonly GLOBAL: string;
|
|
416
|
+
readonly CONFIG: string;
|
|
417
|
+
readonly CLIENT: string;
|
|
418
|
+
readonly REQUEST: string;
|
|
419
|
+
readonly TEMPORARY: string;
|
|
420
|
+
};
|
|
421
|
+
readonly RESPONSE: {
|
|
422
|
+
readonly GLOBAL: string;
|
|
423
|
+
readonly CONFIG: string;
|
|
424
|
+
readonly CLIENT: string;
|
|
425
|
+
readonly REQUEST: string;
|
|
426
|
+
readonly TEMPORARY: string;
|
|
427
|
+
};
|
|
428
|
+
readonly RETRY: {
|
|
429
|
+
readonly GLOBAL: string;
|
|
430
|
+
readonly CONFIG: string;
|
|
431
|
+
readonly CLIENT: string;
|
|
432
|
+
readonly REQUEST: string;
|
|
433
|
+
readonly TEMPORARY: string;
|
|
434
|
+
};
|
|
435
|
+
readonly POLLING: {
|
|
436
|
+
readonly GLOBAL: string;
|
|
437
|
+
readonly CONFIG: string;
|
|
438
|
+
readonly CLIENT: string;
|
|
439
|
+
readonly REQUEST: string;
|
|
440
|
+
readonly TEMPORARY: string;
|
|
441
|
+
};
|
|
442
|
+
readonly REVALIDATION: {
|
|
443
|
+
readonly GLOBAL: string;
|
|
444
|
+
readonly CONFIG: string;
|
|
445
|
+
readonly CLIENT: string;
|
|
446
|
+
readonly REQUEST: string;
|
|
447
|
+
readonly TEMPORARY: string;
|
|
448
|
+
};
|
|
449
|
+
};
|
|
450
|
+
/**
|
|
451
|
+
* Type-safe mapping of event type strings to HANDLER_NAMESPACES keys
|
|
452
|
+
* This ensures TypeScript will error if a new namespace is added without updating the map
|
|
453
|
+
*
|
|
454
|
+
* Used for mapping event types (like 'errors', 'headers') to their corresponding
|
|
455
|
+
* namespace keys in HANDLER_NAMESPACES (like 'ERROR', 'HEADERS')
|
|
456
|
+
*/
|
|
457
|
+
export declare const EVENT_TYPE_TO_NAMESPACE_MAP: Record<string, keyof typeof HANDLER_NAMESPACES>;
|
|
458
|
+
export type ValidateAllNamespacesAreMapped = typeof EVENT_TYPE_TO_NAMESPACE_MAP extends Record<string, infer T> ? T extends keyof typeof HANDLER_NAMESPACES ? keyof typeof HANDLER_NAMESPACES extends T ? true : 'Error: Not all HANDLER_NAMESPACES keys are mapped in EVENT_TYPE_TO_NAMESPACE_MAP' : never : never;
|
|
459
|
+
/**
|
|
460
|
+
* Get handler namespace for an event type and scope
|
|
461
|
+
* Helper function for consistent namespace resolution
|
|
462
|
+
*/
|
|
463
|
+
export declare function getHandlerNamespaceForEvent(eventType: string, scope: keyof typeof HANDLER_SCOPES): string;
|
|
464
|
+
//# sourceMappingURL=namespaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"namespaces.d.ts","sourceRoot":"","sources":["../../../src/api/events/namespaces.ts"],"names":[],"mappings":"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"}
|