@plyaz/api 1.0.1 → 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 +18 -7
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Header merging utilities
|
|
3
|
+
* Provides utilities for merging API headers with different strategies
|
|
4
|
+
*/
|
|
5
|
+
import type { HeaderMergeOptions, HeaderMergeResult, ApiHeaders } from '@plyaz/types/api';
|
|
6
|
+
export declare function mergeHeaders(...headerSets: Array<Record<string, string> | undefined>): ApiHeaders;
|
|
7
|
+
/**
|
|
8
|
+
* Merge headers with advanced options including immutable headers.
|
|
9
|
+
* Provides more control over the merge process with strategies and conflict resolution.
|
|
10
|
+
*
|
|
11
|
+
* @param existing - Existing headers
|
|
12
|
+
* @param newHeaders - New headers to merge
|
|
13
|
+
* @param options - Merge options
|
|
14
|
+
* @returns Merge result with conflict tracking
|
|
15
|
+
*/
|
|
16
|
+
export declare function mergeHeadersWithImmutable(existing: ApiHeaders | undefined, newHeaders: ApiHeaders | undefined, options?: HeaderMergeOptions): HeaderMergeResult;
|
|
17
|
+
/**
|
|
18
|
+
* Combine multiple header values using comma separation.
|
|
19
|
+
* Useful for headers that support multiple values.
|
|
20
|
+
*
|
|
21
|
+
* @param values - Header values to combine
|
|
22
|
+
* @returns Combined header value
|
|
23
|
+
*/
|
|
24
|
+
export declare function combineHeaderValues(...values: Array<string | undefined>): string;
|
|
25
|
+
/**
|
|
26
|
+
* Parse combined header values back into array.
|
|
27
|
+
*
|
|
28
|
+
* @param value - Combined header value
|
|
29
|
+
* @returns Array of individual values
|
|
30
|
+
*/
|
|
31
|
+
export declare function parseHeaderValues(value: string): string[];
|
|
32
|
+
//# sourceMappingURL=merge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../../src/api/headers/merge.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,kBAAkB,EAClB,iBAAiB,EAGjB,UAAU,EAOX,MAAM,kBAAkB,CAAC;AAiI1B,wBAAgB,YAAY,CAAC,GAAG,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC,GAAG,UAAU,CA6DjG;AAkLD;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,UAAU,GAAG,SAAS,EAChC,UAAU,EAAE,UAAU,GAAG,SAAS,EAClC,OAAO,GAAE,kBAAuB,GAC/B,iBAAiB,CAwBnB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,MAAM,CAEhF;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAKzD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Header Presets for Common API Scenarios
|
|
3
|
+
* Pre-configured header sets for common use cases, following TASK-016 specification
|
|
4
|
+
*/
|
|
5
|
+
import type { HeaderPresetName } from '@plyaz/types/api';
|
|
6
|
+
/**
|
|
7
|
+
* Common header presets for different API scenarios
|
|
8
|
+
* Each preset returns a function to avoid object sharing issues
|
|
9
|
+
*/
|
|
10
|
+
export declare const headerPresets: HeaderPresetName;
|
|
11
|
+
/**
|
|
12
|
+
* Get all available preset names
|
|
13
|
+
*
|
|
14
|
+
* @returns Array of preset names
|
|
15
|
+
*/
|
|
16
|
+
export declare function getPresetNames(): Array<keyof HeaderPresetName>;
|
|
17
|
+
/**
|
|
18
|
+
* Check if a preset exists
|
|
19
|
+
*
|
|
20
|
+
* @param name - Preset name to check
|
|
21
|
+
* @returns True if preset exists
|
|
22
|
+
*/
|
|
23
|
+
export declare function hasPreset(name: string): name is keyof HeaderPresetName;
|
|
24
|
+
//# sourceMappingURL=presets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../../src/api/headers/presets.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAc,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAErE;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,gBA8RlB,CAAC;AAEX;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,KAAK,CAAC,MAAM,gBAAgB,CAAC,CAE9D;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,MAAM,gBAAgB,CAEtE"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Header utility functions
|
|
3
|
+
* Provides utilities for header analysis, validation, and manipulation
|
|
4
|
+
*/
|
|
5
|
+
import type { ApiHeaders } from '@plyaz/types/api';
|
|
6
|
+
/**
|
|
7
|
+
* Get headers that affect caching
|
|
8
|
+
*/
|
|
9
|
+
export declare function getCacheAffectingHeaders(headers: ApiHeaders): ApiHeaders;
|
|
10
|
+
/**
|
|
11
|
+
* Get headers that don't affect caching
|
|
12
|
+
*/
|
|
13
|
+
export declare function getNonCacheAffectingHeaders(headers: ApiHeaders): ApiHeaders;
|
|
14
|
+
/**
|
|
15
|
+
* Sanitize headers by redacting sensitive information
|
|
16
|
+
* The test expects that sensitive headers are kept but with value '[REDACTED]'
|
|
17
|
+
*/
|
|
18
|
+
export declare function sanitizeHeaders(headers: ApiHeaders): ApiHeaders;
|
|
19
|
+
/**
|
|
20
|
+
* Remove sensitive headers
|
|
21
|
+
*/
|
|
22
|
+
export declare function removeSensitiveHeaders(headers: ApiHeaders): ApiHeaders;
|
|
23
|
+
/**
|
|
24
|
+
* Normalize headers to lowercase keys
|
|
25
|
+
* Also filters out null and undefined values
|
|
26
|
+
*/
|
|
27
|
+
export declare function normalizeHeaders(headers: ApiHeaders): ApiHeaders;
|
|
28
|
+
/**
|
|
29
|
+
* Check if headers contain authentication
|
|
30
|
+
*/
|
|
31
|
+
export declare function hasAuthentication(headers: ApiHeaders): boolean;
|
|
32
|
+
export declare function getAuthenticationType(headers: ApiHeaders): string | null;
|
|
33
|
+
export declare function validateHeaders(headers: ApiHeaders): string[];
|
|
34
|
+
/**
|
|
35
|
+
* Generate a fingerprint for headers (useful for caching)
|
|
36
|
+
*/
|
|
37
|
+
export declare function getHeaderFingerprint(headers: ApiHeaders): string;
|
|
38
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/api/headers/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AA2CnD;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,UAAU,GAAG,UAAU,CAUxE;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,UAAU,GAAG,UAAU,CAU3E;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,UAAU,GAAG,UAAU,CAmC/D;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,UAAU,GAAG,UAAU,CAsBtE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,UAAU,GAAG,UAAU,CAYhE;AASD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAW9D;AA0CD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,GAAG,IAAI,CAQxE;AAiDD,wBAAgB,eAAe,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,EAAE,CAkB7D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,CA2BhE"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mutation Hook Factory
|
|
3
|
+
* Factory function for creating typed React Query hooks for POST/PUT/DELETE requests
|
|
4
|
+
*/
|
|
5
|
+
import type { ServiceOptions } from '../../services/types';
|
|
6
|
+
import type { ApiMutationOptions, UseMutationResult } from '../types';
|
|
7
|
+
import type { EndpointsList } from '../../endpoints';
|
|
8
|
+
import type { FetchResponse } from 'fetchff';
|
|
9
|
+
/**
|
|
10
|
+
* Factory for creating typed mutation hooks (POST, PUT, PATCH, DELETE)
|
|
11
|
+
* Wraps service functions with React Query's useMutation hook
|
|
12
|
+
*
|
|
13
|
+
* The hook accepts service options and React Query options with full override capabilities.
|
|
14
|
+
*
|
|
15
|
+
* @template TData - The type of data returned by the mutation
|
|
16
|
+
* @template TError - The type of error (defaults to Error)
|
|
17
|
+
* @template TVariables - The type of variables passed to the mutation
|
|
18
|
+
* @template TContext - The type of context for optimistic updates (defaults to unknown)
|
|
19
|
+
* @template TEndpoints - The type of endpoints configuration
|
|
20
|
+
*
|
|
21
|
+
* @param serviceFn - The service function to wrap (e.g., createCampaign)
|
|
22
|
+
* @param defaultOptions - Default mutation options to apply to every call
|
|
23
|
+
* @returns A hook function that can be used in React components
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* // Create a mutation hook from a service function
|
|
28
|
+
* export function useCreateCampaign(
|
|
29
|
+
* serviceOptions?: ServiceOptions,
|
|
30
|
+
* mutationOptions?: UseMutationOptions
|
|
31
|
+
* ) {
|
|
32
|
+
* return createApiMutation(
|
|
33
|
+
* createCampaign,
|
|
34
|
+
* {} // default options
|
|
35
|
+
* )(serviceOptions, mutationOptions);
|
|
36
|
+
* }
|
|
37
|
+
*
|
|
38
|
+
* // Use in a component - with full override control
|
|
39
|
+
* function CreateCampaignForm() {
|
|
40
|
+
* const queryClient = useQueryClient();
|
|
41
|
+
* const { mutate, isPending } = useCreateCampaign(
|
|
42
|
+
* { apiConfig: { timeout: 10000 } }, // service options override
|
|
43
|
+
* {
|
|
44
|
+
* onSuccess: (campaign) => {
|
|
45
|
+
* queryClient.invalidateQueries({ queryKey: ['campaigns'] });
|
|
46
|
+
* toast.success(`Campaign ${campaign.name} created!`);
|
|
47
|
+
* },
|
|
48
|
+
* }
|
|
49
|
+
* );
|
|
50
|
+
*
|
|
51
|
+
* const handleSubmit = (data) => mutate(data);
|
|
52
|
+
* return <form onSubmit={handleSubmit}>...</form>;
|
|
53
|
+
* }
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export declare function createApiMutation<TData = unknown, TError = Error, TVariables = void, TContext = unknown, TEndpoints = EndpointsList>(serviceFn: (variables: TVariables, options?: ServiceOptions<TEndpoints>) => Promise<FetchResponse>, defaultOptions?: Omit<ApiMutationOptions<TData, TVariables, TError, TEndpoints>, 'mutationFn'>): (serviceOptions?: ServiceOptions<TEndpoints>, mutationOptions?: Omit<ApiMutationOptions<TData, TVariables, TError, TEndpoints>, "apiClient" | "apiConfig">) => UseMutationResult<TData, TError, TVariables, TContext>;
|
|
57
|
+
//# sourceMappingURL=createApiMutation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createApiMutation.d.ts","sourceRoot":"","sources":["../../../../src/api/hooks/factories/createApiMutation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,GAAG,OAAO,EACf,MAAM,GAAG,KAAK,EACd,UAAU,GAAG,IAAI,EACjB,QAAQ,GAAG,OAAO,EAClB,UAAU,GAAG,aAAa,EAE1B,SAAS,EAAE,CACT,SAAS,EAAE,UAAU,EACrB,OAAO,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,KACjC,OAAO,CAAC,aAAa,CAAC,EAC3B,cAAc,CAAC,EAAE,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,YAAY,CAAC,IAW5F,iBAAiB,cAAc,CAAC,UAAU,CAAC,EAC3C,kBAAkB,IAAI,CACpB,kBAAkB,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,EACzD,WAAW,GAAG,WAAW,CAC1B,KACA,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,CAAC,CAwB1D"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Query Hook Factory
|
|
3
|
+
* Factory function for creating typed React Query hooks for GET requests
|
|
4
|
+
*/
|
|
5
|
+
import type { ServiceOptions } from '../../services/types';
|
|
6
|
+
import type { ApiQueryOptions, QueryKey, UseQueryResult } from '../types';
|
|
7
|
+
import type { EndpointsList } from '../../endpoints';
|
|
8
|
+
import type { FetchResponse } from 'fetchff';
|
|
9
|
+
/**
|
|
10
|
+
* Factory for creating typed query hooks (GET requests)
|
|
11
|
+
* Wraps service functions with React Query's useQuery hook
|
|
12
|
+
*
|
|
13
|
+
* The hook accepts the same parameters as the service function, plus React Query options.
|
|
14
|
+
* This ensures hooks can be called just like fetchers with full override capabilities.
|
|
15
|
+
*
|
|
16
|
+
* @template TQueryFnData - The type of data returned by queryFn (defaults to TData)
|
|
17
|
+
* @template TError - The type of error (defaults to Error)
|
|
18
|
+
* @template TData - The type of data after selection/transformation (defaults to TQueryFnData)
|
|
19
|
+
* @template TQueryKey - The type of query key (defaults to QueryKey)
|
|
20
|
+
* @template TParams - The type of parameters passed to the service function
|
|
21
|
+
* @template TEndpoints - The type of endpoints configuration
|
|
22
|
+
*
|
|
23
|
+
* @param serviceFn - The service function to wrap (e.g., fetchCampaigns)
|
|
24
|
+
* @param defaultOptions - Default React Query options (staleTime, gcTime, etc.)
|
|
25
|
+
* @returns A hook function that can be used in React components
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```typescript
|
|
29
|
+
* // Create a hook from a service function
|
|
30
|
+
* export function useCampaigns(
|
|
31
|
+
* queryKey: QueryKey,
|
|
32
|
+
* filters?: CampaignFilters,
|
|
33
|
+
* serviceOptions?: ServiceOptions,
|
|
34
|
+
* queryOptions?: UseQueryOptions
|
|
35
|
+
* ) {
|
|
36
|
+
* return createApiQuery(
|
|
37
|
+
* fetchCampaigns,
|
|
38
|
+
* { staleTime: cacheStrategies.standard.ttl * 1000 }
|
|
39
|
+
* )(queryKey, filters, serviceOptions, queryOptions);
|
|
40
|
+
* }
|
|
41
|
+
*
|
|
42
|
+
* // Use in a component - just like calling the fetcher!
|
|
43
|
+
* function CampaignList() {
|
|
44
|
+
* const { data, isLoading } = useCampaigns(
|
|
45
|
+
* ['campaigns', 'list'],
|
|
46
|
+
* { status: 'active' }, // query params
|
|
47
|
+
* { apiConfig: { timeout: 5000 } }, // service options override
|
|
48
|
+
* { enabled: true } // react query options override
|
|
49
|
+
* );
|
|
50
|
+
* return <div>{data?.map(c => c.name)}</div>;
|
|
51
|
+
* }
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export declare function createApiQuery<TQueryFnData = unknown, TError = Error, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey, TParams = void, TEndpoints = EndpointsList>(serviceFn: (params: TParams, options?: ServiceOptions<TEndpoints>) => Promise<FetchResponse>, defaultOptions?: Omit<ApiQueryOptions<TData, TError, TEndpoints>, 'queryKey' | 'queryFn'>): (queryKey: TQueryKey, params: TParams, serviceOptions?: ServiceOptions<TEndpoints>, queryOptions?: Omit<ApiQueryOptions<TData, TError, TEndpoints>, "apiClient" | "apiConfig">) => UseQueryResult<TData, TError>;
|
|
55
|
+
//# sourceMappingURL=createApiQuery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createApiQuery.d.ts","sourceRoot":"","sources":["../../../../src/api/hooks/factories/createApiQuery.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,cAAc,CAC5B,YAAY,GAAG,OAAO,EACtB,MAAM,GAAG,KAAK,EACd,KAAK,GAAG,YAAY,EACpB,SAAS,SAAS,QAAQ,GAAG,QAAQ,EACrC,OAAO,GAAG,IAAI,EACd,UAAU,GAAG,aAAa,EAE1B,SAAS,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,KAAK,OAAO,CAAC,aAAa,CAAC,EAC5F,cAAc,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC,IAavF,UAAU,SAAS,EACnB,QAAQ,OAAO,EACf,iBAAiB,cAAc,CAAC,UAAU,CAAC,EAC3C,eAAe,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,WAAW,GAAG,WAAW,CAAC,KACzF,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,CA2BjC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Factory Defaults
|
|
3
|
+
* Default configuration values for query and mutation factories
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Factory-level defaults for query hooks
|
|
7
|
+
* These have the LOWEST priority and can be overridden by hook defaults or dev args
|
|
8
|
+
*/
|
|
9
|
+
export declare const DEFAULT_QUERY_OPTIONS: {};
|
|
10
|
+
/**
|
|
11
|
+
* Factory-level defaults for mutation hooks
|
|
12
|
+
* These have the LOWEST priority and can be overridden by hook defaults or dev args
|
|
13
|
+
*/
|
|
14
|
+
export declare const DEFAULT_MUTATION_OPTIONS: {};
|
|
15
|
+
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../../../src/api/hooks/factories/defaults.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,eAAO,MAAM,qBAAqB,IAAK,CAAC;AAExC;;;GAGG;AACH,eAAO,MAAM,wBAAwB,IAAK,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook Factories
|
|
3
|
+
* Factory functions for creating typed React Query hooks from service functions
|
|
4
|
+
*/
|
|
5
|
+
export { createApiQuery } from './createApiQuery';
|
|
6
|
+
export { createApiMutation } from './createApiMutation';
|
|
7
|
+
export { DEFAULT_QUERY_OPTIONS, DEFAULT_MUTATION_OPTIONS } from './defaults';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/hooks/factories/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,OAAO,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API Hooks Module
|
|
3
|
+
* React hooks for data fetching and monitoring
|
|
4
|
+
*/
|
|
5
|
+
export { createApiQuery, createApiMutation } from './factories/index';
|
|
6
|
+
export type { ApiQueryOptions, ApiMutationOptions, UseQueryResult, UseMutationResult, QueryKey, } from './types';
|
|
7
|
+
export { useApiConfigConflicts } from './useApiConfigConflicts';
|
|
8
|
+
export { useApiDebugInfo } from './useApiDebugInfo';
|
|
9
|
+
export { useApiMonitor } from './useApiMonitor';
|
|
10
|
+
export { useApiNetworkQuality } from './useApiNetworkQuality';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/hooks/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAGtE,YAAY,EACV,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,QAAQ,GACT,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook Types and Options
|
|
3
|
+
* TypeScript types for React Query hooks with API configuration support
|
|
4
|
+
*/
|
|
5
|
+
import type { UseQueryOptions, UseMutationOptions, QueryKey, UseQueryResult, UseMutationResult } from '@tanstack/react-query';
|
|
6
|
+
import type { ApiConfig, ApiClientWithEvents } from '@plyaz/types/api';
|
|
7
|
+
import type { ClientEventManager } from '../client/clientEventManager';
|
|
8
|
+
import type { EndpointsList } from '../endpoints';
|
|
9
|
+
/**
|
|
10
|
+
* Options for query hooks (GET requests)
|
|
11
|
+
* Extends React Query's UseQueryOptions with API-specific options
|
|
12
|
+
*
|
|
13
|
+
* @template TData - The type of data returned by the query
|
|
14
|
+
* @template TError - The type of error that can be thrown (defaults to Error)
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* const queryOptions: ApiQueryOptions<Campaign> = {
|
|
19
|
+
* staleTime: 5 * 60 * 1000,
|
|
20
|
+
* apiConfig: { timeout: 10000 },
|
|
21
|
+
* enabled: !!campaignId,
|
|
22
|
+
* };
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export interface ApiQueryOptions<TData, TError = Error, OverrideEndpointsList = EndpointsList> extends Omit<UseQueryOptions<TData, TError>, 'queryKey' | 'queryFn'> {
|
|
26
|
+
/**
|
|
27
|
+
* Optional API client instance to use for this query
|
|
28
|
+
* Overrides the default client instance
|
|
29
|
+
*/
|
|
30
|
+
apiClient?: ApiClientWithEvents<ClientEventManager, OverrideEndpointsList>;
|
|
31
|
+
/**
|
|
32
|
+
* Optional API configuration for this specific query
|
|
33
|
+
* Applied temporarily using updateConfig({ strategy: 'temporary' })
|
|
34
|
+
*/
|
|
35
|
+
apiConfig?: Partial<ApiConfig>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Options for mutation hooks (POST, PUT, PATCH, DELETE)
|
|
39
|
+
* Extends React Query's UseMutationOptions with API-specific options
|
|
40
|
+
*
|
|
41
|
+
* @template TData - The type of data returned by the mutation
|
|
42
|
+
* @template TVariables - The type of variables passed to the mutation
|
|
43
|
+
* @template TError - The type of error that can be thrown (defaults to Error)
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```typescript
|
|
47
|
+
* const mutationOptions: ApiMutationOptions<Campaign, CreateCampaignDto> = {
|
|
48
|
+
* apiConfig: { timeout: 30000 },
|
|
49
|
+
* onSuccess: (data) => {
|
|
50
|
+
* console.log('Campaign created:', data.id);
|
|
51
|
+
* },
|
|
52
|
+
* };
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export interface ApiMutationOptions<TData, TVariables, TError = Error, OverrideEndpointsList = EndpointsList> extends Omit<UseMutationOptions<TData, TError, TVariables>, 'mutationFn'> {
|
|
56
|
+
/**
|
|
57
|
+
* Optional API client instance to use for this mutation
|
|
58
|
+
* Overrides the default client instance
|
|
59
|
+
*/
|
|
60
|
+
apiClient?: ApiClientWithEvents<ClientEventManager, OverrideEndpointsList>;
|
|
61
|
+
/**
|
|
62
|
+
* Optional API configuration for this specific mutation
|
|
63
|
+
* Applied temporarily using updateConfig({ strategy: 'temporary' })
|
|
64
|
+
*/
|
|
65
|
+
apiConfig?: Partial<ApiConfig>;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Return type for query hooks
|
|
69
|
+
* Re-export from React Query for convenience
|
|
70
|
+
*/
|
|
71
|
+
export type { UseQueryResult };
|
|
72
|
+
/**
|
|
73
|
+
* Return type for mutation hooks
|
|
74
|
+
* Re-export from React Query for convenience
|
|
75
|
+
*/
|
|
76
|
+
export type { UseMutationResult };
|
|
77
|
+
/**
|
|
78
|
+
* Query key type
|
|
79
|
+
* Re-export from React Query for convenience
|
|
80
|
+
*/
|
|
81
|
+
export type { QueryKey };
|
|
82
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/api/hooks/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,QAAQ,EACR,cAAc,EACd,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,EAAE,qBAAqB,GAAG,aAAa,CAC3F,SAAQ,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACpE;;;OAGG;IACH,SAAS,CAAC,EAAE,mBAAmB,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,CAAC;IAE3E;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,kBAAkB,CACjC,KAAK,EACL,UAAU,EACV,MAAM,GAAG,KAAK,EACd,qBAAqB,GAAG,aAAa,CACrC,SAAQ,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,YAAY,CAAC;IACzE;;;OAGG;IACH,SAAS,CAAC,EAAE,mBAAmB,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,CAAC;IAE3E;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;CAChC;AAED;;;GAGG;AACH,YAAY,EAAE,cAAc,EAAE,CAAC;AAE/B;;;GAGG;AACH,YAAY,EAAE,iBAAiB,EAAE,CAAC;AAElC;;;GAGG;AACH,YAAY,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React Hook for Monitoring Configuration Conflicts
|
|
3
|
+
* Provides real-time monitoring of API configuration conflicts
|
|
4
|
+
*/
|
|
5
|
+
import type { ApiClientWithEvents, UseApiConfigConflictsOptions, UseApiConfigConflictsReturn } from '@plyaz/types/api';
|
|
6
|
+
import type { EndpointsList } from '../endpoints';
|
|
7
|
+
import type { ClientEventManager } from '../client/clientEventManager';
|
|
8
|
+
/**
|
|
9
|
+
* Hook for monitoring configuration conflicts
|
|
10
|
+
*
|
|
11
|
+
* @param client - API client instance with events (optional)
|
|
12
|
+
* @param options - Hook options
|
|
13
|
+
* @returns Conflicts and control functions
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const { conflicts, checkNow, isChecking } = useApiConfigConflicts(apiClient, {
|
|
18
|
+
* autoCheck: true,
|
|
19
|
+
* interval: TIME_CONSTANTS.SECOND * 30
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare function useApiConfigConflicts(client?: ApiClientWithEvents<ClientEventManager, EndpointsList>, options?: UseApiConfigConflictsOptions): UseApiConfigConflictsReturn;
|
|
24
|
+
//# sourceMappingURL=useApiConfigConflicts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useApiConfigConflicts.d.ts","sourceRoot":"","sources":["../../../src/api/hooks/useApiConfigConflicts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,KAAK,EACV,mBAAmB,EAGnB,4BAA4B,EAC5B,2BAA2B,EAC5B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAEvE;;;;;;;;;;;;;;GAcG;AAEH,wBAAgB,qBAAqB,CACnC,MAAM,CAAC,EAAE,mBAAmB,CAAC,kBAAkB,EAAE,aAAa,CAAC,EAC/D,OAAO,GAAE,4BAAiC,GACzC,2BAA2B,CAqH7B"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React Hook for Debug Information Monitoring
|
|
3
|
+
* Provides real-time monitoring of API debug information
|
|
4
|
+
*/
|
|
5
|
+
import type { ClientEventManager } from '../client/clientEventManager';
|
|
6
|
+
import type { EndpointsList } from '../endpoints';
|
|
7
|
+
import type { ApiClientWithEvents, UseApiDebugInfoOptions, UseApiDebugInfoReturn } from '@plyaz/types/api';
|
|
8
|
+
/**
|
|
9
|
+
* Hook for monitoring debug information
|
|
10
|
+
*
|
|
11
|
+
* @param client - API client instance with events (optional)
|
|
12
|
+
* @param options - Hook options
|
|
13
|
+
* @returns Debug info and control functions
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const { debugInfo, refresh, isLoading } = useApiDebugInfo(apiClient, {
|
|
18
|
+
* autoRefresh: true,
|
|
19
|
+
* interval: 60000
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare function useApiDebugInfo(client?: ApiClientWithEvents<ClientEventManager, EndpointsList>, options?: UseApiDebugInfoOptions): UseApiDebugInfoReturn;
|
|
24
|
+
//# sourceMappingURL=useApiDebugInfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useApiDebugInfo.d.ts","sourceRoot":"","sources":["../../../src/api/hooks/useApiDebugInfo.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAMvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EACV,mBAAmB,EAKnB,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,kBAAkB,CAAC;AA6G1B;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAC7B,MAAM,CAAC,EAAE,mBAAmB,CAAC,kBAAkB,EAAE,aAAa,CAAC,EAC/D,OAAO,GAAE,sBAA2B,GACnC,qBAAqB,CAmFvB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React Hook for Complete API Monitoring
|
|
3
|
+
* Combines conflict detection, debug info, and network quality monitoring
|
|
4
|
+
*/
|
|
5
|
+
import type { ClientEventManager } from '../client/clientEventManager';
|
|
6
|
+
import type { EndpointsList } from '../endpoints';
|
|
7
|
+
import type { ApiClientWithEvents, UseApiMonitorOptions, UseApiMonitorReturn } from '@plyaz/types/api';
|
|
8
|
+
/**
|
|
9
|
+
* Combined hook for complete monitoring
|
|
10
|
+
*
|
|
11
|
+
* @param client - API client instance with events
|
|
12
|
+
* @param options - Hook options
|
|
13
|
+
* @returns Combined monitoring state
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const monitor = useApiMonitor(apiClient, {
|
|
18
|
+
* enableConflictCheck: true,
|
|
19
|
+
* enableDebugInfo: true,
|
|
20
|
+
* onAlert: (alert) => showNotification(alert)
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function useApiMonitor(client?: ApiClientWithEvents<ClientEventManager, EndpointsList>, options?: UseApiMonitorOptions): UseApiMonitorReturn;
|
|
25
|
+
//# sourceMappingURL=useApiMonitor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useApiMonitor.d.ts","sourceRoot":"","sources":["../../../src/api/hooks/useApiMonitor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAMvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EACV,mBAAmB,EAGnB,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,kBAAkB,CAAC;AAyD1B;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAC3B,MAAM,CAAC,EAAE,mBAAmB,CAAC,kBAAkB,EAAE,aAAa,CAAC,EAC/D,OAAO,GAAE,oBAAyB,GACjC,mBAAmB,CAoErB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React Hook for Network Quality Monitoring
|
|
3
|
+
* Provides real-time network quality information
|
|
4
|
+
*/
|
|
5
|
+
import type { UseApiNetworkQualityReturn } from '@plyaz/types/api';
|
|
6
|
+
/**
|
|
7
|
+
* Hook for network quality monitoring
|
|
8
|
+
*
|
|
9
|
+
* @returns Current network quality and related information
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const { quality, isOnline, isSlow } = useApiNetworkQuality();
|
|
14
|
+
*
|
|
15
|
+
* if (isSlow) {
|
|
16
|
+
* showBanner('Slow connection detected');
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function useApiNetworkQuality(): UseApiNetworkQualityReturn;
|
|
21
|
+
//# sourceMappingURL=useApiNetworkQuality.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useApiNetworkQuality.d.ts","sourceRoot":"","sources":["../../../src/api/hooks/useApiNetworkQuality.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAGV,0BAA0B,EAC3B,MAAM,kBAAkB,CAAC;AAe1B;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,IAAI,0BAA0B,CAiDjE"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API Package Main Export
|
|
3
|
+
* Provides unified API communication layer for Plyaz ecosystem
|
|
4
|
+
*/
|
|
5
|
+
export * from './config';
|
|
6
|
+
export * from './client';
|
|
7
|
+
export { HeaderBuilder, headers, headerPresets, getPresetNames, hasPreset, mergeHeaders, getCacheAffectingHeaders, getNonCacheAffectingHeaders, sanitizeHeaders, removeSensitiveHeaders, normalizeHeaders, hasAuthentication, getAuthenticationType, validateHeaders, getHeaderFingerprint, getNetworkInfoFromHeaders, getNetworkQualityFromHeaders, isDataSaverEnabledFromHeaders, getNetworkConfigFromHeaders, getClientHintHeaders, withNetworkDetection, } from './headers';
|
|
8
|
+
export { mutate, getCache, setCache, deleteCache, cacheStrategies, getCacheStrategy, createCacheStrategy, mergeCacheStrategies, cacheKeyPatterns, invalidationScenarios, createCachePattern, buildCacheKey, } from './cache';
|
|
9
|
+
export * from './utils';
|
|
10
|
+
export { ApiPackageError, API_ERROR_CODES, ERROR_DEFINITIONS, getErrorDefinition, getErrorCodeByStatus, getErrorCategory, ErrorCategory, setErrorHandlers, getErrorHandlers, registerErrorHandler, registerErrorHandlers, unregisterErrorHandlers, clearErrorHandlers, onceErrorHandler, } from './errors';
|
|
11
|
+
export * from './debugger';
|
|
12
|
+
export { useApiConfigConflicts, useApiDebugInfo, useApiMonitor, useApiNetworkQuality, } from './hooks';
|
|
13
|
+
export * from './network';
|
|
14
|
+
export { detectPlatform, getAppVersion, getDeviceId, getDeviceInfo, getEnhancedClientHints, } from './network/client-hints';
|
|
15
|
+
export { startNetworkEventMonitoring, getNetworkEventStats, } from './network/events';
|
|
16
|
+
export { NetworkConfigurationManager, networkConfigManager, applyTemporaryNetworkOverride, getOptimizedNetworkConfig, } from './network/networkConfigurationManager';
|
|
17
|
+
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, EventHelpers, eventManager, EventManager, getEventManager, } from './events';
|
|
18
|
+
export * from './request';
|
|
19
|
+
export { subscribe, createEventEmitter, createTypedSubscription, subscribeMultiple, subscribeWithTimeout, subscribeOnce, PUB_SUB_EVENT, } from './pubsub';
|
|
20
|
+
export * from './pubsub/react';
|
|
21
|
+
export { retryStrategies, createRetryStrategy, getRetryStrategy, applyRetryStrategy, mergeRetryStrategies, retryConditions, createRetryConfig, createStatusCodeLimits, } from './retry';
|
|
22
|
+
export { pollingStrategies, createPollingStrategy, applyPollingStrategy, isPollingActive, calculatePollingDuration, getSSRSafePollingConfig, createProgressivePolling, createConditionalPolling, createVisibilityAwarePolling, mergePollingConfigs, isValidPollingConfig, } from './polling';
|
|
23
|
+
export { unifiedStrategies, applyUnifiedStrategy, getUnifiedStrategy, mergeUnifiedStrategy, isUnifiedStrategyName, getUnifiedStrategyNames, createCustomUnifiedStrategy, } from './strategies';
|
|
24
|
+
export * from './services';
|
|
25
|
+
export { revalidate, revalidateAll, removeRevalidators, revalidationStrategies, genericPresets as revalidationPresets, getPresets as getRevalidationPresets, extendPresets as extendRevalidationPresets, resetPresets as resetRevalidationPresets, getPreset as getRevalidationPreset, createRevalidationStrategy, getRevalidationStrategy, applyRevalidationStrategy, isValidStrategyName as isValidRevalidationStrategyName, mergeRevalidationStrategies, getSSRSafeConfig, isRevalidationSupported, calculateCacheDuration, isDataFresh, isCacheValid, createRevalidationKey, isWithinDedupeWindow, getNetworkOptimizedConfig, toFetchffRevalidationConfig, } from './revalidation';
|
|
26
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,cAAc,UAAU,CAAC;AAGzB,cAAc,UAAU,CAAC;AAGzB,OAAO,EAEL,aAAa,EACb,OAAO,EAGP,aAAa,EACb,cAAc,EACd,SAAS,EAGT,YAAY,EACZ,wBAAwB,EACxB,2BAA2B,EAC3B,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EAGpB,yBAAyB,EACzB,4BAA4B,EAC5B,6BAA6B,EAC7B,2BAA2B,EAC3B,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,WAAW,CAAC;AAGnB,OAAO,EAEL,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,WAAW,EAGX,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EAGpB,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,EAClB,aAAa,GACd,MAAM,SAAS,CAAC;AAGjB,cAAc,SAAS,CAAC;AAGxB,OAAO,EAEL,eAAe,EAGf,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAGhB,aAAa,EAGb,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,UAAU,CAAC;AAGlB,cAAc,YAAY,CAAC;AAG3B,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,aAAa,EACb,oBAAoB,GACrB,MAAM,SAAS,CAAC;AAGjB,cAAc,WAAW,CAAC;AAG1B,OAAO,EAEL,cAAc,EACd,aAAa,EACb,WAAW,EACX,aAAa,EACb,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAEL,2BAA2B,EAC3B,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAEL,2BAA2B,EAC3B,oBAAoB,EACpB,6BAA6B,EAC7B,yBAAyB,GAC1B,MAAM,uCAAuC,CAAC;AAG/C,OAAO,EAEL,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,UAAU,EAGV,cAAc,EACd,YAAY,EACZ,2BAA2B,EAG3B,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,eAAe,GAChB,MAAM,UAAU,CAAC;AAGlB,cAAc,WAAW,CAAC;AAG1B,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,uBAAuB,EACvB,iBAAiB,EACjB,oBAAoB,EACpB,aAAa,EACb,aAAa,GACd,MAAM,UAAU,CAAC;AAGlB,cAAc,gBAAgB,CAAC;AAG/B,OAAO,EAEL,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EAGpB,eAAe,EACf,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAEL,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EAGpB,eAAe,EACf,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,EACxB,wBAAwB,EACxB,4BAA4B,EAC5B,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,WAAW,CAAC;AAGnB,OAAO,EAEL,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,cAAc,CAAC;AAGtB,cAAc,YAAY,CAAC;AAG3B,OAAO,EAEL,UAAU,EACV,aAAa,EACb,kBAAkB,EAGlB,sBAAsB,EACtB,cAAc,IAAI,mBAAmB,EACrC,UAAU,IAAI,sBAAsB,EACpC,aAAa,IAAI,yBAAyB,EAC1C,YAAY,IAAI,wBAAwB,EACxC,SAAS,IAAI,qBAAqB,EAClC,0BAA0B,EAC1B,uBAAuB,EACvB,yBAAyB,EACzB,mBAAmB,IAAI,+BAA+B,EACtD,2BAA2B,EAG3B,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,EACtB,WAAW,EACX,YAAY,EACZ,qBAAqB,EACrB,oBAAoB,EACpB,yBAAyB,EACzB,2BAA2B,GAC5B,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adaptive behavior utilities based on network conditions
|
|
3
|
+
*/
|
|
4
|
+
import type { AdaptiveConfig, ApiConfig } from '@plyaz/types/api';
|
|
5
|
+
/**
|
|
6
|
+
* Adaptive configuration based on network
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Get adaptive configuration based on network
|
|
10
|
+
*
|
|
11
|
+
* @returns Adaptive configuration object
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* const config = getAdaptiveConfig();
|
|
15
|
+
* if (!config.enablePreloading) {
|
|
16
|
+
* console.log('Skipping preload on poor network');
|
|
17
|
+
* }
|
|
18
|
+
*/
|
|
19
|
+
export declare function getAdaptiveConfig(): AdaptiveConfig;
|
|
20
|
+
/**
|
|
21
|
+
* Get adaptive API configuration
|
|
22
|
+
*
|
|
23
|
+
* @returns Partial API config with network-appropriate settings
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* const api = createApiClient({
|
|
27
|
+
* baseURL: '/api',
|
|
28
|
+
* ...getAdaptiveApiConfig()
|
|
29
|
+
* });
|
|
30
|
+
*/
|
|
31
|
+
export declare function getAdaptiveApiConfig(): Partial<ApiConfig>;
|
|
32
|
+
/**
|
|
33
|
+
* Get recommended batch size based on network
|
|
34
|
+
*
|
|
35
|
+
* @returns Recommended batch size for requests
|
|
36
|
+
*/
|
|
37
|
+
export declare function getAdaptiveBatchSize(): number;
|
|
38
|
+
/**
|
|
39
|
+
* Get recommended page size for pagination
|
|
40
|
+
*
|
|
41
|
+
* @returns Recommended items per page
|
|
42
|
+
*/
|
|
43
|
+
export declare function getAdaptivePageSize(): number;
|
|
44
|
+
/**
|
|
45
|
+
* Should prefetch data based on network
|
|
46
|
+
*
|
|
47
|
+
* @returns True if prefetching is recommended
|
|
48
|
+
*/
|
|
49
|
+
export declare function shouldPrefetch(): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Should enable auto-refresh based on network
|
|
52
|
+
*
|
|
53
|
+
* @returns True if auto-refresh is recommended
|
|
54
|
+
*/
|
|
55
|
+
export declare function shouldAutoRefresh(): boolean;
|
|
56
|
+
//# sourceMappingURL=adaptive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adaptive.d.ts","sourceRoot":"","sources":["../../../src/api/network/adaptive.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAiBlE;;GAEG;AACH;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,IAAI,cAAc,CAsElD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAAC,SAAS,CAAC,CAmEzD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAiB7C;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAiB5C;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAGxC;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAG3C"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client Hints and Platform Detection Utilities
|
|
3
|
+
* This file now re-exports platform utilities and provides network-specific client hints
|
|
4
|
+
* Platform detection has been moved to centralized utilities for better reusability
|
|
5
|
+
*/
|
|
6
|
+
import type { MonitoringConfig, NetworkClientHints, NetworkInfo } from '@plyaz/types/api';
|
|
7
|
+
import { detectPlatform } from './platform';
|
|
8
|
+
export { detectOS, detectRuntime, detectDeviceType, detectIsMobile, detectIsTouch, detectScreenSize, detectPlatform, generateBrowserFingerprint, getUserAgent, getAppVersion, getDeviceId, getDeviceInfo, } from './platform';
|
|
9
|
+
export declare function getEnhancedClientHints(headers: HeadersInit | Headers | Record<string, string | string[]>, options?: {
|
|
10
|
+
includeDeviceId?: boolean;
|
|
11
|
+
includeAppInfo?: boolean;
|
|
12
|
+
enableMonitoring?: boolean;
|
|
13
|
+
}): {
|
|
14
|
+
/** Network information from headers */
|
|
15
|
+
networkInfo: Partial<NetworkInfo>;
|
|
16
|
+
/** Client hints from headers */
|
|
17
|
+
clientHints: NetworkClientHints;
|
|
18
|
+
/** Platform information */
|
|
19
|
+
platform?: ReturnType<typeof detectPlatform>;
|
|
20
|
+
/** Device identifier */
|
|
21
|
+
deviceId?: string;
|
|
22
|
+
/** Enhanced monitoring configuration (with tracked conflicts) */
|
|
23
|
+
monitoringConfig?: MonitoringConfig;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=client-hints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-hints.d.ts","sourceRoot":"","sources":["../../../src/api/network/client-hints.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EACV,gBAAgB,EAChB,kBAAkB,EAElB,WAAW,EAGZ,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAAe,cAAc,EAAE,MAAM,YAAY,CAAC;AAIzD,OAAO,EACL,QAAQ,EACR,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,0BAA0B,EAC1B,YAAY,EACZ,aAAa,EACb,WAAW,EACX,aAAa,GACd,MAAM,YAAY,CAAC;AAyEpB,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,EAClE,OAAO,CAAC,EAAE;IACR,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,GACA;IACD,uCAAuC;IACvC,WAAW,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAClC,gCAAgC;IAChC,WAAW,EAAE,kBAAkB,CAAC;IAChC,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;IAC7C,wBAAwB;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACrC,CA6BA"}
|