@plyaz/api 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +8 -0
- package/dist/api/services/index.d.ts.map +1 -0
- package/dist/api/services/types.d.ts +65 -0
- package/dist/api/services/types.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 @@
|
|
|
1
|
+
{"version":3,"file":"noDataSaverGuard.d.ts","sourceRoot":"","sources":["../../../../../src/api/network/frameworks/nestjs/noDataSaverGuard.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAc,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;;;;;;;;;;;;;GAeG;AACH,qBACa,gBAAiB,SAAQ,YAAY;IAChD,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO;CAIhD"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Next.js middleware for network detection
|
|
3
|
+
*/
|
|
4
|
+
import type { NextApiRequest, NextApiResponse, NextApiHandler } from 'next';
|
|
5
|
+
import type { NetworkInfo, NextApiRequestWithNetwork } from '@plyaz/types/api';
|
|
6
|
+
/**
|
|
7
|
+
* Next.js middleware for network detection
|
|
8
|
+
* Adds network information to the request object and requests Client Hints from browser
|
|
9
|
+
*
|
|
10
|
+
* @param handler - Next.js API route handler
|
|
11
|
+
* @returns Wrapped handler with network detection
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* // pages/api/data.ts
|
|
16
|
+
* import { withNetworkDetection } from '@plyaz/api/utils/network/frameworks/nextjs';
|
|
17
|
+
*
|
|
18
|
+
* export default withNetworkDetection(async (req, res) => {
|
|
19
|
+
* const { networkInfo } = req;
|
|
20
|
+
*
|
|
21
|
+
* if (networkInfo?.saveData) {
|
|
22
|
+
* // Return minimal data for users with data saver enabled
|
|
23
|
+
* return res.json({ data: getMinimalData() });
|
|
24
|
+
* }
|
|
25
|
+
*
|
|
26
|
+
* if (networkInfo?.effectiveType === '2g' || networkInfo?.effectiveType === 'slow-2g') {
|
|
27
|
+
* // Return cached or simplified data for slow connections
|
|
28
|
+
* return res.json({ data: getCachedData() });
|
|
29
|
+
* }
|
|
30
|
+
*
|
|
31
|
+
* // Return full data for good connections
|
|
32
|
+
* return res.json({ data: getFullData() });
|
|
33
|
+
* });
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare function withNetworkDetection<T extends NextApiRequestWithNetwork>(handler: (req: T, res: NextApiResponse) => Promise<void> | void): NextApiHandler;
|
|
37
|
+
/**
|
|
38
|
+
* Next.js Edge Runtime middleware for network detection
|
|
39
|
+
* Works with Next.js 13+ Edge API Routes
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```typescript
|
|
43
|
+
* // app/api/data/route.ts
|
|
44
|
+
* import { NextRequest, NextResponse } from 'next/server';
|
|
45
|
+
* import { getNetworkInfoFromRequest } from '@plyaz/api/utils/network/frameworks/nextjs';
|
|
46
|
+
*
|
|
47
|
+
* export async function GET(request: NextRequest) {
|
|
48
|
+
* const networkInfo = getNetworkInfoFromRequest(request);
|
|
49
|
+
*
|
|
50
|
+
* if (networkInfo?.saveData) {
|
|
51
|
+
* return NextResponse.json({ data: getMinimalData() });
|
|
52
|
+
* }
|
|
53
|
+
*
|
|
54
|
+
* return NextResponse.json({ data: getFullData() });
|
|
55
|
+
* }
|
|
56
|
+
*
|
|
57
|
+
* export const runtime = 'edge';
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export declare function getNetworkInfoFromRequest(request: Request): NetworkInfo;
|
|
61
|
+
/**
|
|
62
|
+
* Next.js middleware helper to add Client Hints headers to response
|
|
63
|
+
*
|
|
64
|
+
* @param response - Next.js response or NextResponse
|
|
65
|
+
* @returns Response with Client Hints headers added
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```typescript
|
|
69
|
+
* import { NextResponse } from 'next/server';
|
|
70
|
+
* import { addClientHintsToResponse } from '@plyaz/api/utils/network/frameworks/nextjs';
|
|
71
|
+
*
|
|
72
|
+
* export function middleware() {
|
|
73
|
+
* const response = NextResponse.next();
|
|
74
|
+
* return addClientHintsToResponse(response);
|
|
75
|
+
* }
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export declare function addClientHintsToResponse<T extends Response | NextApiResponse>(response: T): T;
|
|
79
|
+
/**
|
|
80
|
+
* Type guard to check if request has network info
|
|
81
|
+
*
|
|
82
|
+
* @param req - Request to check
|
|
83
|
+
* @returns True if request has network info
|
|
84
|
+
*/
|
|
85
|
+
export declare function hasNetworkInfo(req: NextApiRequest | NextApiRequestWithNetwork): req is NextApiRequestWithNetwork;
|
|
86
|
+
//# sourceMappingURL=nextjs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nextjs.d.ts","sourceRoot":"","sources":["../../../../src/api/network/frameworks/nextjs.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAE5E,OAAO,KAAK,EAAE,WAAW,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,yBAAyB,EACtE,OAAO,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,eAAe,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,GAC9D,cAAc,CA4BhB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW,CAoBvE;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,SAAS,QAAQ,GAAG,eAAe,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,CAgB7F;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,cAAc,GAAG,yBAAyB,GAC9C,GAAG,IAAI,yBAAyB,CAElC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared utilities for framework middleware
|
|
3
|
+
*/
|
|
4
|
+
import type { NetworkInfo } from '@plyaz/types/api';
|
|
5
|
+
export declare function createAdaptiveResponse<T>(networkInfo: NetworkInfo | undefined, options: {
|
|
6
|
+
excellent?: T;
|
|
7
|
+
good?: T;
|
|
8
|
+
fair?: T;
|
|
9
|
+
poor?: T;
|
|
10
|
+
offline?: T;
|
|
11
|
+
default: T;
|
|
12
|
+
}): T;
|
|
13
|
+
export declare function shouldServeHighQuality(networkInfo?: NetworkInfo): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Helper to determine cache duration based on network conditions
|
|
16
|
+
*
|
|
17
|
+
* @param networkInfo - Network information
|
|
18
|
+
* @param baseTime - Base cache time in seconds
|
|
19
|
+
* @returns Adjusted cache time in seconds
|
|
20
|
+
*/
|
|
21
|
+
export declare function getAdaptiveCacheDuration(networkInfo?: NetworkInfo, baseTime?: number): number;
|
|
22
|
+
/**
|
|
23
|
+
* Helper to determine if request should be cached based on network
|
|
24
|
+
*
|
|
25
|
+
* @param networkInfo - Network information
|
|
26
|
+
* @returns True if aggressive caching should be used
|
|
27
|
+
*/
|
|
28
|
+
export declare function shouldUseAggressiveCaching(networkInfo?: NetworkInfo): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Get recommended timeout based on network conditions
|
|
31
|
+
*
|
|
32
|
+
* @param networkInfo - Network information
|
|
33
|
+
* @param baseTimeout - Base timeout in milliseconds
|
|
34
|
+
* @returns Adjusted timeout in milliseconds
|
|
35
|
+
*/
|
|
36
|
+
export declare function getFrameworkAdaptiveTimeout(networkInfo?: NetworkInfo, baseTimeout?: number): number;
|
|
37
|
+
/**
|
|
38
|
+
* Get recommended batch size based on network conditions
|
|
39
|
+
*
|
|
40
|
+
* @param networkInfo - Network information
|
|
41
|
+
* @param baseBatchSize - Base batch size
|
|
42
|
+
* @returns Adjusted batch size
|
|
43
|
+
*/
|
|
44
|
+
export declare function getFrameworkAdaptiveBatchSize(networkInfo?: NetworkInfo, baseBatchSize?: number): number;
|
|
45
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../src/api/network/frameworks/shared.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AA8EpD,wBAAgB,sBAAsB,CAAC,CAAC,EACtC,WAAW,EAAE,WAAW,GAAG,SAAS,EACpC,OAAO,EAAE;IACP,SAAS,CAAC,EAAE,CAAC,CAAC;IACd,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,OAAO,CAAC,EAAE,CAAC,CAAC;IACZ,OAAO,EAAE,CAAC,CAAC;CACZ,GACA,CAAC,CAMH;AA+BD,wBAAgB,sBAAsB,CAAC,WAAW,CAAC,EAAE,WAAW,GAAG,OAAO,CAazE;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,WAAW,CAAC,EAAE,WAAW,EACzB,QAAQ,GAAE,MAA4D,GACrE,MAAM,CAwBR;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,WAAW,CAAC,EAAE,WAAW,GAAG,OAAO,CAU7E;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,WAAW,CAAC,EAAE,WAAW,EACzB,WAAW,GAAE,MAAsC,GAClD,MAAM,CAiBR;AAED;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAC3C,WAAW,CAAC,EAAE,WAAW,EACzB,aAAa,GAAE,MAAW,GACzB,MAAM,CAuBR"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Network Header Detection Utilities
|
|
3
|
+
* Parse and utilize HTTP Client Hints headers for network-aware capabilities
|
|
4
|
+
*/
|
|
5
|
+
import type { PartialNetworkInfoFromHeaders, ApiClientOptions, NetworkRequest, NetworkResponse } from '@plyaz/types/api';
|
|
6
|
+
import { NETWORK_QUALITY } from '@plyaz/types/api';
|
|
7
|
+
/**
|
|
8
|
+
* Network Client Hints headers interface
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Partial network info from headers (with null for missing values)
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Valid Client Hint header names
|
|
15
|
+
*/
|
|
16
|
+
export declare const CLIENT_HINT_HEADERS: {
|
|
17
|
+
readonly SAVE_DATA: "save-data";
|
|
18
|
+
readonly ECT: "ect";
|
|
19
|
+
readonly RTT: "rtt";
|
|
20
|
+
readonly DOWNLINK: "downlink";
|
|
21
|
+
readonly DEVICE_MEMORY: "device-memory";
|
|
22
|
+
readonly ACCEPT_CH: "Accept-CH";
|
|
23
|
+
readonly ACCEPT_CH_LIFETIME: "Accept-CH-Lifetime";
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Get network information from HTTP headers
|
|
27
|
+
*
|
|
28
|
+
* @param headers - Request headers containing Client Hints
|
|
29
|
+
* @returns Partial network information
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* // In a Next.js API route
|
|
34
|
+
* const networkInfo = getNetworkInfoFromHeaders(req.headers);
|
|
35
|
+
* if (networkInfo.saveData) {
|
|
36
|
+
* // Serve lighter content
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare function getNetworkInfoFromHeaders(headers: Headers | Record<string, string | string[] | undefined>): PartialNetworkInfoFromHeaders;
|
|
41
|
+
/**
|
|
42
|
+
* Get Client Hint request headers
|
|
43
|
+
* These headers request the browser to send network information
|
|
44
|
+
*
|
|
45
|
+
* @returns Headers to request Client Hints
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* // In Next.js middleware
|
|
50
|
+
* const response = NextResponse.next();
|
|
51
|
+
* const hintHeaders = getClientHintHeaders();
|
|
52
|
+
* Object.entries(hintHeaders).forEach(([key, value]) => {
|
|
53
|
+
* response.headers.set(key, value);
|
|
54
|
+
* });
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export declare function getClientHintHeaders(): Record<string, string>;
|
|
58
|
+
/**
|
|
59
|
+
* Infer network quality from Client Hints
|
|
60
|
+
*
|
|
61
|
+
* @param headers - Request headers
|
|
62
|
+
* @returns Network quality level
|
|
63
|
+
*/
|
|
64
|
+
export declare function getNetworkQualityFromHeaders(headers: Headers | Record<string, string | string[] | undefined>): NETWORK_QUALITY;
|
|
65
|
+
/**
|
|
66
|
+
* Check if Save-Data header is enabled
|
|
67
|
+
*
|
|
68
|
+
* @param headers - Request headers
|
|
69
|
+
* @returns True if data saver is enabled
|
|
70
|
+
*/
|
|
71
|
+
export declare function isDataSaverEnabledFromHeaders(headers: Headers | Record<string, string | string[] | undefined>): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Create network-aware configuration from headers
|
|
74
|
+
* Combines existing presets based on detected network quality
|
|
75
|
+
*
|
|
76
|
+
* @param headers - Request headers
|
|
77
|
+
* @returns Configuration adjustments based on network
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```typescript
|
|
81
|
+
* import { getEnv } from '@utils/environment';
|
|
82
|
+
* const config = getNetworkConfigFromHeaders(req.headers);
|
|
83
|
+
* const apiClient = createApiClient({
|
|
84
|
+
* ...config,
|
|
85
|
+
* baseURL: getEnv('API_URL')
|
|
86
|
+
* });
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
export declare function getNetworkConfigFromHeaders(headers: Headers | Record<string, string | string[] | undefined>): Partial<ApiClientOptions>;
|
|
90
|
+
/**
|
|
91
|
+
* Middleware for Next.js API routes with network detection
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```typescript
|
|
95
|
+
* // pages/api/data.ts
|
|
96
|
+
* import { withNetworkDetection } from '@plyaz/api';
|
|
97
|
+
*
|
|
98
|
+
* export default withNetworkDetection(async (req, res) => {
|
|
99
|
+
* const { networkQuality, saveData } = req;
|
|
100
|
+
*
|
|
101
|
+
* if (saveData) {
|
|
102
|
+
* // Return minimal data
|
|
103
|
+
* return res.json({ data: 'minimal' });
|
|
104
|
+
* }
|
|
105
|
+
*
|
|
106
|
+
* // Return full data
|
|
107
|
+
* return res.json({ data: 'full' });
|
|
108
|
+
* });
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
export declare function withNetworkDetection<TReq extends NetworkRequest = NetworkRequest, TRes extends NetworkResponse = NetworkResponse>(handler: (req: TReq, res: TRes) => Promise<void> | void): (req: TReq, res: TRes) => Promise<void>;
|
|
112
|
+
//# sourceMappingURL=headers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"headers.d.ts","sourceRoot":"","sources":["../../../src/api/network/headers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACV,6BAA6B,EAM7B,gBAAgB,EAEhB,cAAc,EACd,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,eAAe,EAAoC,MAAM,kBAAkB,CAAC;AAQrF;;GAEG;AACH;;GAEG;AACH;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;CAQtB,CAAC;AA+DX;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,GAC/D,6BAA6B,CAa/B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAO7D;AA6CD;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,GAC/D,eAAe,CAoBjB;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,GAC/D,OAAO,CAGT;AA2ID;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,GAC/D,OAAO,CAAC,gBAAgB,CAAC,CAgB3B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,wBAAgB,oBAAoB,CAClC,IAAI,SAAS,cAAc,GAAG,cAAc,EAC5C,IAAI,SAAS,eAAe,GAAG,eAAe,EAE9C,OAAO,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,GACtD,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAyBzC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Network utilities for connection detection and adaptive behavior
|
|
3
|
+
* Provides comprehensive network quality assessment and monitoring
|
|
4
|
+
*/
|
|
5
|
+
export type { NetworkInfo, ConnectionType, EffectiveConnectionType, NetworkClientHints, NetworkPresetName, NetworkQualityPreset, UserNetworkPreferences, NetworkRequest, NetworkResponse, NavigatorWithConnection, NetworkInformation, ExpressRequestWithNetwork, ExpressRequestWithEnrichedHeaders, NextApiRequestWithNetwork, } from '@plyaz/types/api';
|
|
6
|
+
export { NETWORK_QUALITY } from '@plyaz/types/api';
|
|
7
|
+
export { isSlowConnection, isNetworkAPISupported, getConnection } from './core';
|
|
8
|
+
export { getNavigator, hasNavigator, isBrowser } from '../utils/environment';
|
|
9
|
+
export { getNetworkInfo, getConnectionType, getEffectiveConnectionType, isCellularConnection, isWifiConnection, isDataSaverEnabled, getNetworkRTT, getNetworkSpeed, isOnline, isOffline, } from './connection';
|
|
10
|
+
export { getNetworkQuality, getNetworkQualityScore, canPerformHeavyOperation, getAdaptiveTimeout, } from './quality';
|
|
11
|
+
export { networkStatus, waitForOnline, onOnline, onOffline } from './status';
|
|
12
|
+
export { getAdaptiveConfig, getAdaptiveApiConfig, getAdaptiveBatchSize, getAdaptivePageSize, shouldPrefetch, shouldAutoRefresh, } from './adaptive';
|
|
13
|
+
export { getNetworkInfoFromHeaders, getNetworkQualityFromHeaders, getClientHintHeaders, getNetworkConfigFromHeaders, } from './headers';
|
|
14
|
+
export * from './frameworks';
|
|
15
|
+
export { startNetworkEventMonitoring } from './events';
|
|
16
|
+
export { networkPresets, getNetworkPreset, getPresetForQuality, getPresetForNetworkInfo, getMatchingPresets, createCustomPreset, mergePresets, validatePreset, NetworkPresetNames, } from './presets';
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/network/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,YAAY,EACV,WAAW,EACX,cAAc,EACd,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,EACtB,cAAc,EACd,eAAe,EACf,uBAAuB,EACvB,kBAAkB,EAClB,yBAAyB,EACzB,iCAAiC,EACjC,yBAAyB,GAC1B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGnD,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAGhF,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAG7E,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,0BAA0B,EAC1B,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,QAAQ,EACR,SAAS,GACV,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,WAAW,CAAC;AAGnB,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAG7E,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,yBAAyB,EACzB,4BAA4B,EAC5B,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,WAAW,CAAC;AAGnB,cAAc,cAAc,CAAC;AAG7B,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAGvD,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,EACZ,cAAc,EACd,kBAAkB,GACnB,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Network Configuration Manager
|
|
3
|
+
* Dynamic preset system that respects user configuration while providing temporary overrides
|
|
4
|
+
* Handles conflicts with existing network utilities and provides comprehensive debugging
|
|
5
|
+
*/
|
|
6
|
+
import type { NetworkQualityPreset, UserNetworkPreferences, TemporaryOverride, DebuggerConfigSource, NetworkPresetName } from '@plyaz/types/api';
|
|
7
|
+
/**
|
|
8
|
+
* Network quality preset configurations
|
|
9
|
+
* These work alongside existing network utilities without conflicts
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* User configuration preferences that should be preserved
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Temporary override information for debugging and restoration
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Network Configuration Manager Class
|
|
19
|
+
*/
|
|
20
|
+
export declare class NetworkConfigurationManager {
|
|
21
|
+
private userPreferences;
|
|
22
|
+
private availablePresets;
|
|
23
|
+
private activeOverrides;
|
|
24
|
+
private currentPreset?;
|
|
25
|
+
private monitoringEnabled;
|
|
26
|
+
private cleanupFunctions;
|
|
27
|
+
constructor();
|
|
28
|
+
/**
|
|
29
|
+
* Set user preferences that should be preserved across preset changes
|
|
30
|
+
*/
|
|
31
|
+
setUserPreferences(preferences: UserNetworkPreferences): void;
|
|
32
|
+
/**
|
|
33
|
+
* Get current user preferences
|
|
34
|
+
*/
|
|
35
|
+
getUserPreferences(): UserNetworkPreferences;
|
|
36
|
+
/**
|
|
37
|
+
* Register a custom network quality preset
|
|
38
|
+
*/
|
|
39
|
+
registerPreset(preset: NetworkQualityPreset): void;
|
|
40
|
+
/**
|
|
41
|
+
* Get all available presets
|
|
42
|
+
*/
|
|
43
|
+
getAvailablePresets(): NetworkQualityPreset[];
|
|
44
|
+
/**
|
|
45
|
+
* Helper to validate and get preset
|
|
46
|
+
*/
|
|
47
|
+
private validateAndGetPreset;
|
|
48
|
+
/**
|
|
49
|
+
* Helper to apply tracking to config
|
|
50
|
+
*/
|
|
51
|
+
private applyTrackingToConfig;
|
|
52
|
+
/**
|
|
53
|
+
* Apply a specific preset with user preference consideration
|
|
54
|
+
*/
|
|
55
|
+
applyPreset(presetId: string, options?: {
|
|
56
|
+
temporary?: boolean;
|
|
57
|
+
duration?: number;
|
|
58
|
+
context?: {
|
|
59
|
+
endpoint?: string;
|
|
60
|
+
clientName?: string;
|
|
61
|
+
configPath?: string;
|
|
62
|
+
};
|
|
63
|
+
}): NetworkQualityPreset['config'];
|
|
64
|
+
/**
|
|
65
|
+
* Apply temporary configuration override with automatic restoration
|
|
66
|
+
*/
|
|
67
|
+
applyTemporaryOverride(property: string, value: unknown, options: {
|
|
68
|
+
duration?: number;
|
|
69
|
+
reason: string;
|
|
70
|
+
source?: DebuggerConfigSource;
|
|
71
|
+
context?: {
|
|
72
|
+
endpoint?: string;
|
|
73
|
+
clientName?: string;
|
|
74
|
+
configPath?: string;
|
|
75
|
+
};
|
|
76
|
+
}): () => void;
|
|
77
|
+
/**
|
|
78
|
+
* Get optimal preset for current network conditions
|
|
79
|
+
*/
|
|
80
|
+
getOptimalPreset(): NetworkQualityPreset | null;
|
|
81
|
+
/**
|
|
82
|
+
* Enable automatic preset monitoring and switching
|
|
83
|
+
*/
|
|
84
|
+
enableAutoPresetSwitching(): void;
|
|
85
|
+
/**
|
|
86
|
+
* Disable automatic preset monitoring
|
|
87
|
+
*/
|
|
88
|
+
disableAutoPresetSwitching(): void;
|
|
89
|
+
/**
|
|
90
|
+
* Get current active overrides for debugging
|
|
91
|
+
*/
|
|
92
|
+
getActiveOverrides(): TemporaryOverride[];
|
|
93
|
+
/**
|
|
94
|
+
* Restore all temporary overrides
|
|
95
|
+
*/
|
|
96
|
+
restoreAllOverrides(): void;
|
|
97
|
+
/**
|
|
98
|
+
* Get configuration manager stats for debugging
|
|
99
|
+
*/
|
|
100
|
+
getStats(): {
|
|
101
|
+
currentPreset?: string;
|
|
102
|
+
activeOverrides: number;
|
|
103
|
+
userPreferences: UserNetworkPreferences;
|
|
104
|
+
availablePresets: string[];
|
|
105
|
+
monitoringEnabled: boolean;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Get the currently active preset ID
|
|
109
|
+
*/
|
|
110
|
+
getActivePreset(): string | undefined;
|
|
111
|
+
/**
|
|
112
|
+
* Get all temporary overrides currently active
|
|
113
|
+
*/
|
|
114
|
+
getTemporaryOverrides(): Record<string, unknown>;
|
|
115
|
+
/**
|
|
116
|
+
* Cleanup resources
|
|
117
|
+
*/
|
|
118
|
+
dispose(): void;
|
|
119
|
+
/**
|
|
120
|
+
* Apply a preset by name (convenience method)
|
|
121
|
+
*/
|
|
122
|
+
applyPresetByName(name: NetworkPresetName, options?: {
|
|
123
|
+
temporary?: boolean;
|
|
124
|
+
duration?: number;
|
|
125
|
+
context?: {
|
|
126
|
+
endpoint?: string;
|
|
127
|
+
clientName?: string;
|
|
128
|
+
configPath?: string;
|
|
129
|
+
};
|
|
130
|
+
}): NetworkQualityPreset['config'];
|
|
131
|
+
/**
|
|
132
|
+
* Initialize default network quality presets
|
|
133
|
+
*/
|
|
134
|
+
private initializeDefaultPresets;
|
|
135
|
+
/**
|
|
136
|
+
* Setup event handlers for configuration tracking
|
|
137
|
+
*/
|
|
138
|
+
private setupEventHandlers;
|
|
139
|
+
/**
|
|
140
|
+
* Apply timeout preferences to config
|
|
141
|
+
*/
|
|
142
|
+
private applyTimeoutPreferences;
|
|
143
|
+
/**
|
|
144
|
+
* Apply caching preferences to config
|
|
145
|
+
*/
|
|
146
|
+
private applyCachingPreferences;
|
|
147
|
+
/**
|
|
148
|
+
* Apply retry preferences to config
|
|
149
|
+
*/
|
|
150
|
+
private applyRetryPreferences;
|
|
151
|
+
/**
|
|
152
|
+
* Apply endpoint-specific overrides to config
|
|
153
|
+
*/
|
|
154
|
+
private applyEndpointOverrides;
|
|
155
|
+
/**
|
|
156
|
+
* Merge preset config with user preferences
|
|
157
|
+
*/
|
|
158
|
+
private mergeWithUserPreferences;
|
|
159
|
+
/**
|
|
160
|
+
* Find preset for specific quality level
|
|
161
|
+
*/
|
|
162
|
+
private findPresetForQuality;
|
|
163
|
+
/**
|
|
164
|
+
* Find best preset for current network conditions
|
|
165
|
+
*/
|
|
166
|
+
private findBestPresetForConditions;
|
|
167
|
+
/**
|
|
168
|
+
* Check if quality matches preset requirements
|
|
169
|
+
*/
|
|
170
|
+
private qualityMatchesPreset;
|
|
171
|
+
/**
|
|
172
|
+
* Check if save-data setting matches preset requirements
|
|
173
|
+
*/
|
|
174
|
+
private saveDataMatchesPreset;
|
|
175
|
+
/**
|
|
176
|
+
* Check if RTT is within preset threshold
|
|
177
|
+
*/
|
|
178
|
+
private rttWithinThreshold;
|
|
179
|
+
/**
|
|
180
|
+
* Check if downlink meets preset minimum
|
|
181
|
+
*/
|
|
182
|
+
private downlinkMeetsMinimum;
|
|
183
|
+
/**
|
|
184
|
+
* Check if preset matches current network conditions
|
|
185
|
+
*/
|
|
186
|
+
private presetMatchesConditions;
|
|
187
|
+
/**
|
|
188
|
+
* Track user preference overrides for debugging
|
|
189
|
+
*/
|
|
190
|
+
private trackUserPreferenceOverride;
|
|
191
|
+
/**
|
|
192
|
+
* Track preference changes
|
|
193
|
+
*/
|
|
194
|
+
private trackPreferenceChanges;
|
|
195
|
+
/**
|
|
196
|
+
* Schedule automatic restoration of a preset
|
|
197
|
+
*/
|
|
198
|
+
private schedulePresetRestore;
|
|
199
|
+
/**
|
|
200
|
+
* Get current configuration value (placeholder for actual implementation)
|
|
201
|
+
*/
|
|
202
|
+
private getCurrentConfigValue;
|
|
203
|
+
/**
|
|
204
|
+
* Set configuration value (placeholder for actual implementation)
|
|
205
|
+
*/
|
|
206
|
+
private setConfigValue;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Global network configuration manager instance
|
|
210
|
+
*/
|
|
211
|
+
export declare const networkConfigManager: NetworkConfigurationManager;
|
|
212
|
+
/**
|
|
213
|
+
* Convenience function to apply temporary network override
|
|
214
|
+
*/
|
|
215
|
+
export declare function applyTemporaryNetworkOverride(property: string, value: unknown, options: {
|
|
216
|
+
duration?: number;
|
|
217
|
+
reason: string;
|
|
218
|
+
endpoint?: string;
|
|
219
|
+
clientName?: string;
|
|
220
|
+
}): () => void;
|
|
221
|
+
/**
|
|
222
|
+
* Get network configuration optimized for current conditions with user preferences
|
|
223
|
+
*/
|
|
224
|
+
export declare function getOptimizedNetworkConfig(): NetworkQualityPreset['config'] | null;
|
|
225
|
+
//# sourceMappingURL=networkConfigurationManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"networkConfigurationManager.d.ts","sourceRoot":"","sources":["../../../src/api/network/networkConfigurationManager.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform Detection Utilities
|
|
3
|
+
* Comprehensive utilities for detecting platform, device, and browser information
|
|
4
|
+
* These utilities provide detailed information about the user's environment
|
|
5
|
+
*/
|
|
6
|
+
import type { PlatformInfo, AppInfo, DeviceInfo } from '@plyaz/types/api';
|
|
7
|
+
export declare function detectOS(userAgent?: string): PlatformInfo['os'];
|
|
8
|
+
export declare function detectRuntime(userAgent?: string): PlatformInfo['runtime'];
|
|
9
|
+
/**
|
|
10
|
+
* Detect device type from user agent
|
|
11
|
+
*
|
|
12
|
+
* @param userAgent - User agent string or empty string
|
|
13
|
+
* @returns Device type identifier
|
|
14
|
+
*/
|
|
15
|
+
export declare function detectDeviceType(userAgent?: string): PlatformInfo['deviceType'];
|
|
16
|
+
/**
|
|
17
|
+
* Check if device is mobile
|
|
18
|
+
*
|
|
19
|
+
* @param userAgent - User agent string or empty string
|
|
20
|
+
* @returns True if mobile device
|
|
21
|
+
*/
|
|
22
|
+
export declare function detectIsMobile(userAgent?: string): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Check if device has touch support
|
|
25
|
+
*
|
|
26
|
+
* @returns True if touch is supported
|
|
27
|
+
*/
|
|
28
|
+
export declare function detectIsTouch(): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Detect screen size category
|
|
31
|
+
*
|
|
32
|
+
* @returns Screen size category
|
|
33
|
+
*/
|
|
34
|
+
export declare function detectScreenSize(): PlatformInfo['screenSize'];
|
|
35
|
+
/**
|
|
36
|
+
* Generate a browser fingerprint for device identification
|
|
37
|
+
* Creates a semi-unique identifier based on browser characteristics
|
|
38
|
+
*
|
|
39
|
+
* @returns Fingerprint string
|
|
40
|
+
*/
|
|
41
|
+
export declare function generateBrowserFingerprint(): string;
|
|
42
|
+
/**
|
|
43
|
+
* Get user agent string safely
|
|
44
|
+
*
|
|
45
|
+
* @returns User agent string or empty string
|
|
46
|
+
*/
|
|
47
|
+
export declare function getUserAgent(): string;
|
|
48
|
+
/**
|
|
49
|
+
* Detect current platform information
|
|
50
|
+
* Works in both browser and Node.js environments
|
|
51
|
+
*
|
|
52
|
+
* @returns Platform detection results
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```typescript
|
|
56
|
+
* const platform = detectPlatform();
|
|
57
|
+
* console.log(`Running on ${platform.os} with ${platform.runtime}`);
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export declare function detectPlatform(): PlatformInfo;
|
|
61
|
+
/**
|
|
62
|
+
* Get application version information
|
|
63
|
+
* Detects version from environment variables and package.json
|
|
64
|
+
*
|
|
65
|
+
* @returns Application version information
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```typescript
|
|
69
|
+
* const app = getAppVersion();
|
|
70
|
+
* console.log(`Version: ${app.version} (${app.environment})`);
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
export declare function getAppVersion(): AppInfo;
|
|
74
|
+
export declare function getDeviceId(): string;
|
|
75
|
+
/**
|
|
76
|
+
* Get comprehensive device information
|
|
77
|
+
* Combines platform, screen, and system information
|
|
78
|
+
*
|
|
79
|
+
* @returns Device information object
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```typescript
|
|
83
|
+
* const device = getDeviceInfo();
|
|
84
|
+
* console.log(`Device ${device.id} on ${device.platform.os}`);
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
export declare function getDeviceInfo(): DeviceInfo;
|
|
88
|
+
/**
|
|
89
|
+
* Get screen resolution
|
|
90
|
+
*
|
|
91
|
+
* @returns Screen resolution object or null
|
|
92
|
+
*/
|
|
93
|
+
export declare function getScreenResolution(): {
|
|
94
|
+
width: number;
|
|
95
|
+
height: number;
|
|
96
|
+
} | null;
|
|
97
|
+
/**
|
|
98
|
+
* Get color depth
|
|
99
|
+
*
|
|
100
|
+
* @returns Color depth in bits or null
|
|
101
|
+
*/
|
|
102
|
+
export declare function getColorDepth(): number | null;
|
|
103
|
+
/**
|
|
104
|
+
* Get pixel ratio
|
|
105
|
+
*
|
|
106
|
+
* @returns Device pixel ratio or 1
|
|
107
|
+
*/
|
|
108
|
+
export declare function getPixelRatio(): number;
|
|
109
|
+
/**
|
|
110
|
+
* Get browser language
|
|
111
|
+
*
|
|
112
|
+
* @returns Browser language code or empty string
|
|
113
|
+
*/
|
|
114
|
+
export declare function getBrowserLanguage(): string;
|
|
115
|
+
/**
|
|
116
|
+
* Get browser languages
|
|
117
|
+
*
|
|
118
|
+
* @returns Array of language codes
|
|
119
|
+
*/
|
|
120
|
+
export declare function getBrowserLanguages(): readonly string[];
|
|
121
|
+
/**
|
|
122
|
+
* Check if cookies are enabled
|
|
123
|
+
*
|
|
124
|
+
* @returns True if cookies are enabled
|
|
125
|
+
*/
|
|
126
|
+
export declare function areCookiesEnabled(): boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Check if Do Not Track is enabled
|
|
129
|
+
*
|
|
130
|
+
* @returns True if DNT is enabled
|
|
131
|
+
*/
|
|
132
|
+
export declare function isDoNotTrackEnabled(): boolean;
|
|
133
|
+
/**
|
|
134
|
+
* Get timezone offset in minutes
|
|
135
|
+
*
|
|
136
|
+
* @returns Timezone offset in minutes
|
|
137
|
+
*/
|
|
138
|
+
export declare function getTimezoneOffset(): number;
|
|
139
|
+
/**
|
|
140
|
+
* Get timezone name
|
|
141
|
+
*
|
|
142
|
+
* @returns Timezone name
|
|
143
|
+
*/
|
|
144
|
+
export declare function getTimezoneName(): string;
|
|
145
|
+
/**
|
|
146
|
+
* Export all utilities as a namespace for convenience
|
|
147
|
+
*/
|
|
148
|
+
export declare const Platform: {
|
|
149
|
+
readonly detectOS: typeof detectOS;
|
|
150
|
+
readonly detectRuntime: typeof detectRuntime;
|
|
151
|
+
readonly detectDeviceType: typeof detectDeviceType;
|
|
152
|
+
readonly detectIsMobile: typeof detectIsMobile;
|
|
153
|
+
readonly detectIsTouch: typeof detectIsTouch;
|
|
154
|
+
readonly detectScreenSize: typeof detectScreenSize;
|
|
155
|
+
readonly detectPlatform: typeof detectPlatform;
|
|
156
|
+
readonly generateBrowserFingerprint: typeof generateBrowserFingerprint;
|
|
157
|
+
readonly getUserAgent: typeof getUserAgent;
|
|
158
|
+
readonly getAppVersion: typeof getAppVersion;
|
|
159
|
+
readonly getDeviceId: typeof getDeviceId;
|
|
160
|
+
readonly getDeviceInfo: typeof getDeviceInfo;
|
|
161
|
+
readonly getScreenResolution: typeof getScreenResolution;
|
|
162
|
+
readonly getColorDepth: typeof getColorDepth;
|
|
163
|
+
readonly getPixelRatio: typeof getPixelRatio;
|
|
164
|
+
readonly getBrowserLanguage: typeof getBrowserLanguage;
|
|
165
|
+
readonly getBrowserLanguages: typeof getBrowserLanguages;
|
|
166
|
+
readonly areCookiesEnabled: typeof areCookiesEnabled;
|
|
167
|
+
readonly isDoNotTrackEnabled: typeof isDoNotTrackEnabled;
|
|
168
|
+
readonly getTimezoneOffset: typeof getTimezoneOffset;
|
|
169
|
+
readonly getTimezoneName: typeof getTimezoneName;
|
|
170
|
+
};
|
|
171
|
+
//# sourceMappingURL=platform.d.ts.map
|