@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.
Files changed (382) hide show
  1. package/README.md +632 -542
  2. package/dist/api/cache/index.d.ts +183 -0
  3. package/dist/api/cache/index.d.ts.map +1 -0
  4. package/dist/api/cache/patterns.d.ts +174 -0
  5. package/dist/api/cache/patterns.d.ts.map +1 -0
  6. package/dist/api/cache/strategies.d.ts +47 -0
  7. package/dist/api/cache/strategies.d.ts.map +1 -0
  8. package/dist/api/client/clientEventManager.d.ts +238 -0
  9. package/dist/api/client/clientEventManager.d.ts.map +1 -0
  10. package/dist/api/client/createApiClient.d.ts +5 -0
  11. package/dist/api/client/createApiClient.d.ts.map +1 -0
  12. package/dist/api/client/helpers/headers.d.ts +11 -0
  13. package/dist/api/client/helpers/headers.d.ts.map +1 -0
  14. package/dist/api/client/helpers/index.d.ts +9 -0
  15. package/dist/api/client/helpers/index.d.ts.map +1 -0
  16. package/dist/api/client/helpers/interceptors.d.ts +29 -0
  17. package/dist/api/client/helpers/interceptors.d.ts.map +1 -0
  18. package/dist/api/client/helpers/network.d.ts +21 -0
  19. package/dist/api/client/helpers/network.d.ts.map +1 -0
  20. package/dist/api/client/helpers/strategies.d.ts +30 -0
  21. package/dist/api/client/helpers/strategies.d.ts.map +1 -0
  22. package/dist/api/client/helpers/tracking.d.ts +15 -0
  23. package/dist/api/client/helpers/tracking.d.ts.map +1 -0
  24. package/dist/api/client/index.d.ts +7 -0
  25. package/dist/api/client/index.d.ts.map +1 -0
  26. package/dist/api/config/adapter.d.ts +25 -0
  27. package/dist/api/config/adapter.d.ts.map +1 -0
  28. package/dist/api/config/configBuilder.d.ts +62 -0
  29. package/dist/api/config/configBuilder.d.ts.map +1 -0
  30. package/dist/api/config/configManager.d.ts +67 -0
  31. package/dist/api/config/configManager.d.ts.map +1 -0
  32. package/dist/api/config/global.d.ts +106 -0
  33. package/dist/api/config/global.d.ts.map +1 -0
  34. package/dist/api/config/index.d.ts +11 -0
  35. package/dist/api/config/index.d.ts.map +1 -0
  36. package/dist/api/debugger/DebugReport.d.ts +71 -0
  37. package/dist/api/debugger/DebugReport.d.ts.map +1 -0
  38. package/dist/api/debugger/UnifiedDebugger.d.ts +444 -0
  39. package/dist/api/debugger/UnifiedDebugger.d.ts.map +1 -0
  40. package/dist/api/debugger/factories/conflict.d.ts +58 -0
  41. package/dist/api/debugger/factories/conflict.d.ts.map +1 -0
  42. package/dist/api/debugger/factories/eventTracking.d.ts +126 -0
  43. package/dist/api/debugger/factories/eventTracking.d.ts.map +1 -0
  44. package/dist/api/debugger/factories/history.d.ts +97 -0
  45. package/dist/api/debugger/factories/history.d.ts.map +1 -0
  46. package/dist/api/debugger/factories/index.d.ts +15 -0
  47. package/dist/api/debugger/factories/index.d.ts.map +1 -0
  48. package/dist/api/debugger/factories/issueAnalysis.d.ts +52 -0
  49. package/dist/api/debugger/factories/issueAnalysis.d.ts.map +1 -0
  50. package/dist/api/debugger/factories/performance.d.ts +53 -0
  51. package/dist/api/debugger/factories/performance.d.ts.map +1 -0
  52. package/dist/api/debugger/factories/report.d.ts +43 -0
  53. package/dist/api/debugger/factories/report.d.ts.map +1 -0
  54. package/dist/api/debugger/index.d.ts +99 -0
  55. package/dist/api/debugger/index.d.ts.map +1 -0
  56. package/dist/api/debugger/queue/DebuggerQueueManager.d.ts +61 -0
  57. package/dist/api/debugger/queue/DebuggerQueueManager.d.ts.map +1 -0
  58. package/dist/api/debugger/queue/OperationTracker.d.ts +86 -0
  59. package/dist/api/debugger/queue/OperationTracker.d.ts.map +1 -0
  60. package/dist/api/debugger/queue/index.d.ts +9 -0
  61. package/dist/api/debugger/queue/index.d.ts.map +1 -0
  62. package/dist/api/endpoints/builders.d.ts +109 -0
  63. package/dist/api/endpoints/builders.d.ts.map +1 -0
  64. package/dist/api/endpoints/campaigns.d.ts +43 -0
  65. package/dist/api/endpoints/campaigns.d.ts.map +1 -0
  66. package/dist/api/endpoints/index.d.ts +100 -0
  67. package/dist/api/endpoints/index.d.ts.map +1 -0
  68. package/dist/api/endpoints/polling.d.ts +83 -0
  69. package/dist/api/endpoints/polling.d.ts.map +1 -0
  70. package/dist/api/endpoints/utils.d.ts +128 -0
  71. package/dist/api/endpoints/utils.d.ts.map +1 -0
  72. package/dist/api/errors/ApiPackageError.d.ts +101 -0
  73. package/dist/api/errors/ApiPackageError.d.ts.map +1 -0
  74. package/dist/api/errors/definitions.d.ts +24 -0
  75. package/dist/api/errors/definitions.d.ts.map +1 -0
  76. package/dist/api/errors/error-codes.d.ts +116 -0
  77. package/dist/api/errors/error-codes.d.ts.map +1 -0
  78. package/dist/api/errors/error-events.d.ts +63 -0
  79. package/dist/api/errors/error-events.d.ts.map +1 -0
  80. package/dist/api/errors/index.d.ts +18 -0
  81. package/dist/api/errors/index.d.ts.map +1 -0
  82. package/dist/api/errors/types-constants.d.ts +64 -0
  83. package/dist/api/errors/types-constants.d.ts.map +1 -0
  84. package/dist/api/events/EventManager.d.ts +230 -0
  85. package/dist/api/events/EventManager.d.ts.map +1 -0
  86. package/dist/api/events/factories/base.d.ts +269 -0
  87. package/dist/api/events/factories/base.d.ts.map +1 -0
  88. package/dist/api/events/factories/cache.d.ts +31 -0
  89. package/dist/api/events/factories/cache.d.ts.map +1 -0
  90. package/dist/api/events/factories/client.d.ts +43 -0
  91. package/dist/api/events/factories/client.d.ts.map +1 -0
  92. package/dist/api/events/factories/config.d.ts +34 -0
  93. package/dist/api/events/factories/config.d.ts.map +1 -0
  94. package/dist/api/events/factories/debug.d.ts +74 -0
  95. package/dist/api/events/factories/debug.d.ts.map +1 -0
  96. package/dist/api/events/factories/errors.d.ts +91 -0
  97. package/dist/api/events/factories/errors.d.ts.map +1 -0
  98. package/dist/api/events/factories/headers.d.ts +54 -0
  99. package/dist/api/events/factories/headers.d.ts.map +1 -0
  100. package/dist/api/events/factories/index.d.ts +46 -0
  101. package/dist/api/events/factories/index.d.ts.map +1 -0
  102. package/dist/api/events/factories/network.d.ts +54 -0
  103. package/dist/api/events/factories/network.d.ts.map +1 -0
  104. package/dist/api/events/factories/performance.d.ts +43 -0
  105. package/dist/api/events/factories/performance.d.ts.map +1 -0
  106. package/dist/api/events/index.d.ts +34 -0
  107. package/dist/api/events/index.d.ts.map +1 -0
  108. package/dist/api/events/namespaces.d.ts +464 -0
  109. package/dist/api/events/namespaces.d.ts.map +1 -0
  110. package/dist/api/events/queue/ConfigUpdateQueueManager.d.ts +53 -0
  111. package/dist/api/events/queue/ConfigUpdateQueueManager.d.ts.map +1 -0
  112. package/dist/api/events/queue/EventQueueManager.d.ts +69 -0
  113. package/dist/api/events/queue/EventQueueManager.d.ts.map +1 -0
  114. package/dist/api/events/queue/index.d.ts +12 -0
  115. package/dist/api/events/queue/index.d.ts.map +1 -0
  116. package/dist/api/events/shared-emitter.d.ts +14 -0
  117. package/dist/api/events/shared-emitter.d.ts.map +1 -0
  118. package/dist/api/headers/cache.d.ts +17 -0
  119. package/dist/api/headers/cache.d.ts.map +1 -0
  120. package/dist/api/headers/enriched.d.ts +18 -0
  121. package/dist/api/headers/enriched.d.ts.map +1 -0
  122. package/dist/api/headers/events.d.ts +17 -0
  123. package/dist/api/headers/events.d.ts.map +1 -0
  124. package/dist/api/headers/extract.d.ts +73 -0
  125. package/dist/api/headers/extract.d.ts.map +1 -0
  126. package/dist/api/headers/headerBuilder.d.ts +308 -0
  127. package/dist/api/headers/headerBuilder.d.ts.map +1 -0
  128. package/dist/api/headers/index.d.ts +37 -0
  129. package/dist/api/headers/index.d.ts.map +1 -0
  130. package/dist/api/headers/merge.d.ts +32 -0
  131. package/dist/api/headers/merge.d.ts.map +1 -0
  132. package/dist/api/headers/presets.d.ts +24 -0
  133. package/dist/api/headers/presets.d.ts.map +1 -0
  134. package/dist/api/headers/utils.d.ts +38 -0
  135. package/dist/api/headers/utils.d.ts.map +1 -0
  136. package/dist/api/hooks/factories/createApiMutation.d.ts +57 -0
  137. package/dist/api/hooks/factories/createApiMutation.d.ts.map +1 -0
  138. package/dist/api/hooks/factories/createApiQuery.d.ts +55 -0
  139. package/dist/api/hooks/factories/createApiQuery.d.ts.map +1 -0
  140. package/dist/api/hooks/factories/defaults.d.ts +15 -0
  141. package/dist/api/hooks/factories/defaults.d.ts.map +1 -0
  142. package/dist/api/hooks/factories/index.d.ts +8 -0
  143. package/dist/api/hooks/factories/index.d.ts.map +1 -0
  144. package/dist/api/hooks/index.d.ts +11 -0
  145. package/dist/api/hooks/index.d.ts.map +1 -0
  146. package/dist/api/hooks/types.d.ts +82 -0
  147. package/dist/api/hooks/types.d.ts.map +1 -0
  148. package/dist/api/hooks/useApiConfigConflicts.d.ts +24 -0
  149. package/dist/api/hooks/useApiConfigConflicts.d.ts.map +1 -0
  150. package/dist/api/hooks/useApiDebugInfo.d.ts +24 -0
  151. package/dist/api/hooks/useApiDebugInfo.d.ts.map +1 -0
  152. package/dist/api/hooks/useApiMonitor.d.ts +25 -0
  153. package/dist/api/hooks/useApiMonitor.d.ts.map +1 -0
  154. package/dist/api/hooks/useApiNetworkQuality.d.ts +21 -0
  155. package/dist/api/hooks/useApiNetworkQuality.d.ts.map +1 -0
  156. package/dist/api/index.d.ts +26 -0
  157. package/dist/api/index.d.ts.map +1 -0
  158. package/dist/api/network/adaptive.d.ts +56 -0
  159. package/dist/api/network/adaptive.d.ts.map +1 -0
  160. package/dist/api/network/client-hints.d.ts +25 -0
  161. package/dist/api/network/client-hints.d.ts.map +1 -0
  162. package/dist/api/network/connection.d.ts +60 -0
  163. package/dist/api/network/connection.d.ts.map +1 -0
  164. package/dist/api/network/core.d.ts +26 -0
  165. package/dist/api/network/core.d.ts.map +1 -0
  166. package/dist/api/network/events.d.ts +18 -0
  167. package/dist/api/network/events.d.ts.map +1 -0
  168. package/dist/api/network/frameworks/express.d.ts +110 -0
  169. package/dist/api/network/frameworks/express.d.ts.map +1 -0
  170. package/dist/api/network/frameworks/index.d.ts +13 -0
  171. package/dist/api/network/frameworks/index.d.ts.map +1 -0
  172. package/dist/api/network/frameworks/nestjs/clientHintsInterceptor.d.ts +29 -0
  173. package/dist/api/network/frameworks/nestjs/clientHintsInterceptor.d.ts.map +1 -0
  174. package/dist/api/network/frameworks/nestjs/decorators.d.ts +48 -0
  175. package/dist/api/network/frameworks/nestjs/decorators.d.ts.map +1 -0
  176. package/dist/api/network/frameworks/nestjs/enrichedHeadersGuard.d.ts +80 -0
  177. package/dist/api/network/frameworks/nestjs/enrichedHeadersGuard.d.ts.map +1 -0
  178. package/dist/api/network/frameworks/nestjs/enrichedHeadersInterceptor.d.ts +83 -0
  179. package/dist/api/network/frameworks/nestjs/enrichedHeadersInterceptor.d.ts.map +1 -0
  180. package/dist/api/network/frameworks/nestjs/index.d.ts +13 -0
  181. package/dist/api/network/frameworks/nestjs/index.d.ts.map +1 -0
  182. package/dist/api/network/frameworks/nestjs/minimumConnectionGuard.d.ts +27 -0
  183. package/dist/api/network/frameworks/nestjs/minimumConnectionGuard.d.ts.map +1 -0
  184. package/dist/api/network/frameworks/nestjs/networkDetectionMiddleware.d.ts +31 -0
  185. package/dist/api/network/frameworks/nestjs/networkDetectionMiddleware.d.ts.map +1 -0
  186. package/dist/api/network/frameworks/nestjs/networkGuard.d.ts +33 -0
  187. package/dist/api/network/frameworks/nestjs/networkGuard.d.ts.map +1 -0
  188. package/dist/api/network/frameworks/nestjs/noDataSaverGuard.d.ts +25 -0
  189. package/dist/api/network/frameworks/nestjs/noDataSaverGuard.d.ts.map +1 -0
  190. package/dist/api/network/frameworks/nextjs.d.ts +86 -0
  191. package/dist/api/network/frameworks/nextjs.d.ts.map +1 -0
  192. package/dist/api/network/frameworks/shared.d.ts +45 -0
  193. package/dist/api/network/frameworks/shared.d.ts.map +1 -0
  194. package/dist/api/network/headers.d.ts +112 -0
  195. package/dist/api/network/headers.d.ts.map +1 -0
  196. package/dist/api/network/index.d.ts +17 -0
  197. package/dist/api/network/index.d.ts.map +1 -0
  198. package/dist/api/network/networkConfigurationManager.d.ts +225 -0
  199. package/dist/api/network/networkConfigurationManager.d.ts.map +1 -0
  200. package/dist/api/network/platform.d.ts +171 -0
  201. package/dist/api/network/platform.d.ts.map +1 -0
  202. package/dist/api/network/presets.d.ts +55 -0
  203. package/dist/api/network/presets.d.ts.map +1 -0
  204. package/dist/api/network/quality.d.ts +28 -0
  205. package/dist/api/network/quality.d.ts.map +1 -0
  206. package/dist/api/network/status.d.ts +74 -0
  207. package/dist/api/network/status.d.ts.map +1 -0
  208. package/dist/api/performance/adaptive.d.ts +35 -0
  209. package/dist/api/performance/adaptive.d.ts.map +1 -0
  210. package/dist/api/performance/index.d.ts +133 -0
  211. package/dist/api/performance/index.d.ts.map +1 -0
  212. package/dist/api/performance/patterns.d.ts +20 -0
  213. package/dist/api/performance/patterns.d.ts.map +1 -0
  214. package/dist/api/performance/performanceMonitor.d.ts +85 -0
  215. package/dist/api/performance/performanceMonitor.d.ts.map +1 -0
  216. package/dist/api/performance/presets.d.ts +18 -0
  217. package/dist/api/performance/presets.d.ts.map +1 -0
  218. package/dist/api/performance/utils.d.ts +98 -0
  219. package/dist/api/performance/utils.d.ts.map +1 -0
  220. package/dist/api/polling/index.d.ts +10 -0
  221. package/dist/api/polling/index.d.ts.map +1 -0
  222. package/dist/api/polling/strategies.d.ts +128 -0
  223. package/dist/api/polling/strategies.d.ts.map +1 -0
  224. package/dist/api/polling/utils.d.ts +133 -0
  225. package/dist/api/polling/utils.d.ts.map +1 -0
  226. package/dist/api/pubsub/index.d.ts +147 -0
  227. package/dist/api/pubsub/index.d.ts.map +1 -0
  228. package/dist/api/pubsub/react.d.ts +214 -0
  229. package/dist/api/pubsub/react.d.ts.map +1 -0
  230. package/dist/api/queue/BaseOperationTracker.d.ts +86 -0
  231. package/dist/api/queue/BaseOperationTracker.d.ts.map +1 -0
  232. package/dist/api/queue/BaseQueueManager.d.ts +54 -0
  233. package/dist/api/queue/BaseQueueManager.d.ts.map +1 -0
  234. package/dist/api/queue/BatchProcessor.d.ts +42 -0
  235. package/dist/api/queue/BatchProcessor.d.ts.map +1 -0
  236. package/dist/api/queue/EventQueueManager.d.ts +128 -0
  237. package/dist/api/queue/EventQueueManager.d.ts.map +1 -0
  238. package/dist/api/queue/PriorityQueue.d.ts +58 -0
  239. package/dist/api/queue/PriorityQueue.d.ts.map +1 -0
  240. package/dist/api/queue/QueueFactory.d.ts +57 -0
  241. package/dist/api/queue/QueueFactory.d.ts.map +1 -0
  242. package/dist/api/queue/QueueOrchestrator.d.ts +90 -0
  243. package/dist/api/queue/QueueOrchestrator.d.ts.map +1 -0
  244. package/dist/api/queue/QueueSystem.d.ts +102 -0
  245. package/dist/api/queue/QueueSystem.d.ts.map +1 -0
  246. package/dist/api/queue/index.d.ts +22 -0
  247. package/dist/api/queue/index.d.ts.map +1 -0
  248. package/dist/api/regional/constants.d.ts +76 -0
  249. package/dist/api/regional/constants.d.ts.map +1 -0
  250. package/dist/api/regional/core.d.ts +56 -0
  251. package/dist/api/regional/core.d.ts.map +1 -0
  252. package/dist/api/regional/helpers.d.ts +49 -0
  253. package/dist/api/regional/helpers.d.ts.map +1 -0
  254. package/dist/api/regional/index.d.ts +10 -0
  255. package/dist/api/regional/index.d.ts.map +1 -0
  256. package/dist/api/regional/presets.d.ts +16 -0
  257. package/dist/api/regional/presets.d.ts.map +1 -0
  258. package/dist/api/request/index.d.ts +18 -0
  259. package/dist/api/request/index.d.ts.map +1 -0
  260. package/dist/api/request/management.d.ts +46 -0
  261. package/dist/api/request/management.d.ts.map +1 -0
  262. package/dist/api/request/prepare.d.ts +34 -0
  263. package/dist/api/request/prepare.d.ts.map +1 -0
  264. package/dist/api/request/react.d.ts +98 -0
  265. package/dist/api/request/react.d.ts.map +1 -0
  266. package/dist/api/request/routing.d.ts +74 -0
  267. package/dist/api/request/routing.d.ts.map +1 -0
  268. package/dist/api/request/tracker.d.ts +76 -0
  269. package/dist/api/request/tracker.d.ts.map +1 -0
  270. package/dist/api/request/utils.d.ts +129 -0
  271. package/dist/api/request/utils.d.ts.map +1 -0
  272. package/dist/api/retry/conditions.d.ts +140 -0
  273. package/dist/api/retry/conditions.d.ts.map +1 -0
  274. package/dist/api/retry/index.d.ts +10 -0
  275. package/dist/api/retry/index.d.ts.map +1 -0
  276. package/dist/api/retry/strategies.d.ts +56 -0
  277. package/dist/api/retry/strategies.d.ts.map +1 -0
  278. package/dist/api/revalidation/index.d.ts +29 -0
  279. package/dist/api/revalidation/index.d.ts.map +1 -0
  280. package/dist/api/revalidation/presets.d.ts +71 -0
  281. package/dist/api/revalidation/presets.d.ts.map +1 -0
  282. package/dist/api/revalidation/strategies.d.ts +116 -0
  283. package/dist/api/revalidation/strategies.d.ts.map +1 -0
  284. package/dist/api/revalidation/utils.d.ts +78 -0
  285. package/dist/api/revalidation/utils.d.ts.map +1 -0
  286. package/dist/api/services/campaigns/DELETE/deleteCampaign.d.ts +30 -0
  287. package/dist/api/services/campaigns/DELETE/deleteCampaign.d.ts.map +1 -0
  288. package/dist/api/services/campaigns/DELETE/index.d.ts +7 -0
  289. package/dist/api/services/campaigns/DELETE/index.d.ts.map +1 -0
  290. package/dist/api/services/campaigns/DELETE/useDeleteCampaign.d.ts +24 -0
  291. package/dist/api/services/campaigns/DELETE/useDeleteCampaign.d.ts.map +1 -0
  292. package/dist/api/services/campaigns/GET/fetchCampaign.d.ts +36 -0
  293. package/dist/api/services/campaigns/GET/fetchCampaign.d.ts.map +1 -0
  294. package/dist/api/services/campaigns/GET/fetchCampaignParticipants.d.ts +40 -0
  295. package/dist/api/services/campaigns/GET/fetchCampaignParticipants.d.ts.map +1 -0
  296. package/dist/api/services/campaigns/GET/fetchCampaignStats.d.ts +31 -0
  297. package/dist/api/services/campaigns/GET/fetchCampaignStats.d.ts.map +1 -0
  298. package/dist/api/services/campaigns/GET/fetchCampaigns.d.ts +39 -0
  299. package/dist/api/services/campaigns/GET/fetchCampaigns.d.ts.map +1 -0
  300. package/dist/api/services/campaigns/GET/index.d.ts +13 -0
  301. package/dist/api/services/campaigns/GET/index.d.ts.map +1 -0
  302. package/dist/api/services/campaigns/GET/useCampaign.d.ts +47 -0
  303. package/dist/api/services/campaigns/GET/useCampaign.d.ts.map +1 -0
  304. package/dist/api/services/campaigns/GET/useCampaignParticipants.d.ts +43 -0
  305. package/dist/api/services/campaigns/GET/useCampaignParticipants.d.ts.map +1 -0
  306. package/dist/api/services/campaigns/GET/useCampaignStats.d.ts +33 -0
  307. package/dist/api/services/campaigns/GET/useCampaignStats.d.ts.map +1 -0
  308. package/dist/api/services/campaigns/GET/useCampaigns.d.ts +43 -0
  309. package/dist/api/services/campaigns/GET/useCampaigns.d.ts.map +1 -0
  310. package/dist/api/services/campaigns/POST/createCampaign.d.ts +37 -0
  311. package/dist/api/services/campaigns/POST/createCampaign.d.ts.map +1 -0
  312. package/dist/api/services/campaigns/POST/index.d.ts +11 -0
  313. package/dist/api/services/campaigns/POST/index.d.ts.map +1 -0
  314. package/dist/api/services/campaigns/POST/joinCampaign.d.ts +31 -0
  315. package/dist/api/services/campaigns/POST/joinCampaign.d.ts.map +1 -0
  316. package/dist/api/services/campaigns/POST/leaveCampaign.d.ts +31 -0
  317. package/dist/api/services/campaigns/POST/leaveCampaign.d.ts.map +1 -0
  318. package/dist/api/services/campaigns/POST/useCreateCampaign.d.ts +36 -0
  319. package/dist/api/services/campaigns/POST/useCreateCampaign.d.ts.map +1 -0
  320. package/dist/api/services/campaigns/POST/useJoinCampaign.d.ts +23 -0
  321. package/dist/api/services/campaigns/POST/useJoinCampaign.d.ts.map +1 -0
  322. package/dist/api/services/campaigns/POST/useLeaveCampaign.d.ts +23 -0
  323. package/dist/api/services/campaigns/POST/useLeaveCampaign.d.ts.map +1 -0
  324. package/dist/api/services/campaigns/PUT/index.d.ts +7 -0
  325. package/dist/api/services/campaigns/PUT/index.d.ts.map +1 -0
  326. package/dist/api/services/campaigns/PUT/updateCampaign.d.ts +37 -0
  327. package/dist/api/services/campaigns/PUT/updateCampaign.d.ts.map +1 -0
  328. package/dist/api/services/campaigns/PUT/useUpdateCampaign.d.ts +38 -0
  329. package/dist/api/services/campaigns/PUT/useUpdateCampaign.d.ts.map +1 -0
  330. package/dist/api/services/campaigns/index.d.ts +9 -0
  331. package/dist/api/services/campaigns/index.d.ts.map +1 -0
  332. package/dist/api/services/clients.d.ts +58 -0
  333. package/dist/api/services/clients.d.ts.map +1 -0
  334. package/dist/api/services/index.d.ts +8 -0
  335. package/dist/api/services/index.d.ts.map +1 -0
  336. package/dist/api/services/types.d.ts +65 -0
  337. package/dist/api/services/types.d.ts.map +1 -0
  338. package/dist/api/strategies/index.d.ts +8 -0
  339. package/dist/api/strategies/index.d.ts.map +1 -0
  340. package/dist/api/strategies/tracked.d.ts +15 -0
  341. package/dist/api/strategies/tracked.d.ts.map +1 -0
  342. package/dist/api/strategies/unified.d.ts +87 -0
  343. package/dist/api/strategies/unified.d.ts.map +1 -0
  344. package/dist/api/utils/async-control.d.ts +96 -0
  345. package/dist/api/utils/async-control.d.ts.map +1 -0
  346. package/dist/api/utils/colors.d.ts +88 -0
  347. package/dist/api/utils/colors.d.ts.map +1 -0
  348. package/dist/api/utils/environment.d.ts +595 -0
  349. package/dist/api/utils/environment.d.ts.map +1 -0
  350. package/dist/api/utils/generation/correlation-id.d.ts +206 -0
  351. package/dist/api/utils/generation/correlation-id.d.ts.map +1 -0
  352. package/dist/api/utils/generation/id-generator.d.ts +133 -0
  353. package/dist/api/utils/generation/id-generator.d.ts.map +1 -0
  354. package/dist/api/utils/generation/request-id.d.ts +106 -0
  355. package/dist/api/utils/generation/request-id.d.ts.map +1 -0
  356. package/dist/api/utils/index.d.ts +19 -0
  357. package/dist/api/utils/index.d.ts.map +1 -0
  358. package/dist/api/utils/interval-manager.d.ts +94 -0
  359. package/dist/api/utils/interval-manager.d.ts.map +1 -0
  360. package/dist/api/utils/json.d.ts +98 -0
  361. package/dist/api/utils/json.d.ts.map +1 -0
  362. package/dist/api/utils/math.d.ts +168 -0
  363. package/dist/api/utils/math.d.ts.map +1 -0
  364. package/dist/api/utils/object-merge.d.ts +34 -0
  365. package/dist/api/utils/object-merge.d.ts.map +1 -0
  366. package/dist/api/utils/object.d.ts +101 -0
  367. package/dist/api/utils/object.d.ts.map +1 -0
  368. package/dist/api/utils/string.d.ts +41 -0
  369. package/dist/api/utils/string.d.ts.map +1 -0
  370. package/dist/api/utils/time.d.ts +233 -0
  371. package/dist/api/utils/time.d.ts.map +1 -0
  372. package/dist/api/utils/type-guards.d.ts +59 -0
  373. package/dist/api/utils/type-guards.d.ts.map +1 -0
  374. package/dist/api/utils/validation.d.ts +21 -0
  375. package/dist/api/utils/validation.d.ts.map +1 -0
  376. package/dist/index.cjs +25594 -3
  377. package/dist/index.cjs.map +1 -1
  378. package/dist/index.d.ts +5 -1
  379. package/dist/index.d.ts.map +1 -1
  380. package/dist/index.mjs +25068 -3
  381. package/dist/index.mjs.map +1 -1
  382. package/package.json +18 -7
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Config Update Queue Manager
3
+ *
4
+ * Manages queued configuration updates with priority handling
5
+ * to ensure config changes are applied in the correct order.
6
+ */
7
+ import type { QueuedConfigUpdate, ConfigState, QueueStats } from '@plyaz/types/api';
8
+ /**
9
+ * Config update queue manager
10
+ */
11
+ export declare class ConfigUpdateQueueManager {
12
+ private static instance;
13
+ private queue;
14
+ private configState;
15
+ private constructor();
16
+ /**
17
+ * Get or create the queue
18
+ */
19
+ private getQueue;
20
+ /**
21
+ * Get singleton instance
22
+ */
23
+ static getInstance(): ConfigUpdateQueueManager;
24
+ /**
25
+ * Initialize with config state
26
+ */
27
+ initialize(configState: ConfigState): void;
28
+ /**
29
+ * Queue a config update
30
+ */
31
+ queueUpdate(config: Partial<Record<string, unknown>>, strategy?: QueuedConfigUpdate['strategy'], scope?: QueuedConfigUpdate['scope'], metadata?: QueuedConfigUpdate['metadata']): void;
32
+ /**
33
+ * Process a config update
34
+ */
35
+ private processConfigUpdate;
36
+ /**
37
+ * Determine priority for config update
38
+ */
39
+ private getPriority;
40
+ /**
41
+ * Apply config immediately (bypass queue)
42
+ */
43
+ applyImmediate(config: Partial<Record<string, unknown>>, strategy?: QueuedConfigUpdate['strategy']): void;
44
+ /**
45
+ * Get queue statistics
46
+ */
47
+ getStats(): QueueStats;
48
+ /**
49
+ * Reset the queue
50
+ */
51
+ reset(): void;
52
+ }
53
+ //# sourceMappingURL=ConfigUpdateQueueManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfigUpdateQueueManager.d.ts","sourceRoot":"","sources":["../../../../src/api/events/queue/ConfigUpdateQueueManager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EACV,kBAAkB,EAClB,WAAW,EAEX,UAAU,EACX,MAAM,kBAAkB,CAAC;AAsB1B;;GAEG;AACH,qBAAa,wBAAwB;IACnC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAA2B;IAClD,OAAO,CAAC,KAAK,CAAgD;IAC7D,OAAO,CAAC,WAAW,CAA4B;IAE/C,OAAO;IAIP;;OAEG;IACH,OAAO,CAAC,QAAQ;IAQhB;;OAEG;IACH,MAAM,CAAC,WAAW,IAAI,wBAAwB;IAO9C;;OAEG;IACI,UAAU,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI;IAIjD;;OAEG;IACI,WAAW,CAChB,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACxC,QAAQ,GAAE,kBAAkB,CAAC,UAAU,CAAW,EAClD,KAAK,GAAE,kBAAkB,CAAC,OAAO,CAAY,EAC7C,QAAQ,CAAC,EAAE,kBAAkB,CAAC,UAAU,CAAC,GACxC,IAAI;IAeP;;OAEG;YACW,mBAAmB;IA0CjC;;OAEG;IACH,OAAO,CAAC,WAAW;IAoCnB;;OAEG;IACI,cAAc,CACnB,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACxC,QAAQ,GAAE,kBAAkB,CAAC,UAAU,CAAW,GACjD,IAAI;IAaP;;OAEG;IACI,QAAQ,IAAI,UAAU;IAiB7B;;OAEG;IACI,KAAK,IAAI,IAAI;CAKrB"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Event Queue Manager
3
+ *
4
+ * Manages queued event processing with priority support
5
+ * for high-volume event handling.
6
+ */
7
+ import type { EventScopeWithTemporary, QueueStats, QueuedEvent } from '@plyaz/types/api';
8
+ import { EventManager } from '../EventManager';
9
+ /**
10
+ * Event queue manager for handling events with priority
11
+ */
12
+ export declare class EventQueueManager {
13
+ private static instance;
14
+ private queue;
15
+ private eventManager;
16
+ private enabled;
17
+ private constructor();
18
+ /**
19
+ * Get or create the queue
20
+ */
21
+ private getQueue;
22
+ /**
23
+ * Get singleton instance
24
+ */
25
+ static getInstance(): EventQueueManager;
26
+ /**
27
+ * Initialize with event manager
28
+ */
29
+ initialize(eventManager?: EventManager): void;
30
+ /**
31
+ * Enable or disable event queueing
32
+ */
33
+ setEnabled(enabled?: boolean): void;
34
+ /**
35
+ * Check if queueing is enabled
36
+ */
37
+ isEnabled(): boolean;
38
+ /**
39
+ * Queue an event for processing
40
+ */
41
+ queueEvent(options: {
42
+ eventType: string;
43
+ eventName: string;
44
+ data: unknown;
45
+ scopes?: EventScopeWithTemporary[];
46
+ metadata?: QueuedEvent['metadata'];
47
+ }): void;
48
+ /**
49
+ * Process a queued event
50
+ */
51
+ private processEvent;
52
+ /**
53
+ * Determine priority for event
54
+ */
55
+ private getPriority;
56
+ /**
57
+ * Get queue statistics
58
+ */
59
+ getStats(): QueueStats;
60
+ /**
61
+ * Reset the queue
62
+ */
63
+ reset(): void;
64
+ /**
65
+ * Process events immediately (bypass queue)
66
+ */
67
+ processImmediate(eventType: string, eventName: string, data: unknown, scopes?: EventScopeWithTemporary[]): void;
68
+ }
69
+ //# sourceMappingURL=EventQueueManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventQueueManager.d.ts","sourceRoot":"","sources":["../../../../src/api/events/queue/EventQueueManager.ts"],"names":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 * for high-volume event handling.
6
+ *
7
+ * NOTE: All types are available from @plyaz/types/api, not re-exported here
8
+ * Import types like: import type { QueuedEvent, QueuedConfigUpdate } from '@plyaz/types/api';
9
+ */
10
+ export { EventQueueManager } from './EventQueueManager';
11
+ export { ConfigUpdateQueueManager } from './ConfigUpdateQueueManager';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/events/queue/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { EventEmitter } from '../pubsub';
2
+ /**
3
+ * Get the shared event emitter instance
4
+ * Creates one if it doesn't exist
5
+ * Returns enhanced EventEmitter with all handler management utilities
6
+ */
7
+ export declare function getSharedEventEmitter(): EventEmitter;
8
+ /**
9
+ * Reset the shared event emitter
10
+ * Removes all listeners and creates a fresh instance
11
+ * Uses enhanced removeAllListeners method
12
+ */
13
+ export declare function resetSharedEventEmitter(): void;
14
+ //# sourceMappingURL=shared-emitter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared-emitter.d.ts","sourceRoot":"","sources":["../../../src/api/events/shared-emitter.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAK9C;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,YAAY,CAGpD;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,IAAI,IAAI,CAM9C"}
@@ -0,0 +1,17 @@
1
+ import type { EnrichedHeadersOptions } from '@plyaz/types/api';
2
+ /**
3
+ * Get cached value from configured storage
4
+ */
5
+ export declare function getCachedValue<T>(key: string, options?: EnrichedHeadersOptions['cache']): T | null;
6
+ /**
7
+ * Set cached value in configured storage
8
+ */
9
+ export declare function setCachedValue<T>(key: string, value: T, options?: EnrichedHeadersOptions['cache']): void;
10
+ /**
11
+ * Clear cached values
12
+ */
13
+ export declare function clearCache(options?: EnrichedHeadersOptions['cache']): void;
14
+ export declare const invalidateHeaderCache: typeof clearCache;
15
+ export declare const clearHeaderCache: typeof clearCache;
16
+ export declare function getOrCompute<T>(key: string, compute: () => T | Promise<T>, options?: EnrichedHeadersOptions['cache']): Promise<T>;
17
+ //# sourceMappingURL=cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../src/api/headers/cache.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,sBAAsB,EAAiC,MAAM,kBAAkB,CAAC;AAuP9F;;GAEG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAC9B,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,sBAAsB,CAAC,OAAO,CAAC,GACxC,CAAC,GAAG,IAAI,CA0CV;AA0CD;;GAEG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAC9B,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,CAAC,EACR,OAAO,CAAC,EAAE,sBAAsB,CAAC,OAAO,CAAC,GACxC,IAAI,CAmBN;AA4CD;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,CAAC,EAAE,sBAAsB,CAAC,OAAO,CAAC,GAAG,IAAI,CAmB1E;AAGD,eAAO,MAAM,qBAAqB,mBAAa,CAAC;AAChD,eAAO,MAAM,gBAAgB,mBAAa,CAAC;AAE3C,wBAAsB,YAAY,CAAC,CAAC,EAClC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EAC7B,OAAO,CAAC,EAAE,sBAAsB,CAAC,OAAO,CAAC,GACxC,OAAO,CAAC,CAAC,CAAC,CAoCZ"}
@@ -0,0 +1,18 @@
1
+ import type { EndpointsList } from '../endpoints';
2
+ import type { EnrichedHeadersOptions, HeaderValidationResult, ApiHeaders, RequestContext } from '@plyaz/types/api';
3
+ /**
4
+ * Preset options for enriched header collection
5
+ */
6
+ export declare const enrichedHeaderPresets: Record<string, Partial<EnrichedHeadersOptions>>;
7
+ export declare function buildEnrichedHeaders(context?: RequestContext<EndpointsList>, options?: EnrichedHeadersOptions): Promise<ApiHeaders>;
8
+ /**
9
+ * Validate enriched headers format and values for security
10
+ * Internal function used during header building
11
+ */
12
+ export declare function validateHeaders(headers: ApiHeaders): HeaderValidationResult;
13
+ /**
14
+ * Sanitize header values for safe transmission
15
+ * Removes dangerous characters while preserving valid header content
16
+ */
17
+ export declare function sanitizeHeaderValue(value: string): string;
18
+ //# sourceMappingURL=enriched.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enriched.d.ts","sourceRoot":"","sources":["../../../src/api/headers/enriched.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,KAAK,EACV,sBAAsB,EACtB,sBAAsB,EAItB,UAAU,EAEV,cAAc,EACf,MAAM,kBAAkB,CAAC;AAO1B;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,sBAAsB,CAAC,CA2DxE,CAAC;AAwgBX,wBAAsB,oBAAoB,CACxC,OAAO,GAAE,cAAc,CAAC,aAAa,CAAM,EAC3C,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,UAAU,CAAC,CAOrB;AAsBD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,UAAU,GAAG,sBAAsB,CAkC3E;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAyBzD"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Header Events System
3
+ * Event system for tracking header changes, overrides, and transformations
4
+ */
5
+ import type { ApiHeaders } from '@plyaz/types/api';
6
+ /**
7
+ * Detect changes between two header sets
8
+ */
9
+ export declare function detectHeaderChanges(previous: ApiHeaders, current: ApiHeaders): {
10
+ added: Record<string, string>;
11
+ modified: Record<string, {
12
+ old: string;
13
+ new: string;
14
+ }>;
15
+ removed: string[];
16
+ };
17
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/api/headers/events.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,UAAU,GAClB;IACD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvD,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAsBA"}
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Extract Enriched Headers from Response
3
+ *
4
+ * Utilities for extracting enriched headers from HTTP responses
5
+ * to transfer context between different API clients
6
+ */
7
+ import type { ApiHeaders, RequestHeaderExtraction } from '@plyaz/types/api';
8
+ /**
9
+ * Extract enriched headers from a response object
10
+ * These headers are prefixed with 'X-Enriched-' by the middleware
11
+ *
12
+ * @param headers - Response headers (can be Headers object or plain object)
13
+ * @returns Extracted enriched headers without the prefix
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * // Extract from fetch response
18
+ * const response = await fetch(url);
19
+ * const enrichedHeaders = extractEnrichedHeaders(response.headers);
20
+ *
21
+ * // Use in another API call
22
+ * const anotherClient = createApiClient({
23
+ * headers: enrichedHeaders
24
+ * });
25
+ * ```
26
+ */
27
+ export declare function extractEnrichedHeaders(headers: Headers | Record<string, string | string[] | undefined>): ApiHeaders;
28
+ /**
29
+ * Transfer enriched headers from one response to another request
30
+ * Useful for microservice-to-microservice communication
31
+ *
32
+ * @param sourceHeaders - Headers from the source response
33
+ * @param targetConfig - Target API configuration to enhance
34
+ * @returns Enhanced configuration with transferred headers
35
+ *
36
+ * @example
37
+ * ```typescript
38
+ * // Service A calls Service B
39
+ * const responseB = await apiServiceB.getData();
40
+ *
41
+ * // Extract and transfer headers to Service C
42
+ * const configC = transferEnrichedHeaders(
43
+ * responseB.headers,
44
+ * { timeout: 10000 }
45
+ * );
46
+ *
47
+ * const responseC = await apiServiceC.process(data, configC);
48
+ * ```
49
+ */
50
+ export declare function transferEnrichedHeaders<T extends {
51
+ headers?: ApiHeaders;
52
+ }>(sourceHeaders: Headers | Record<string, string | string[] | undefined>, targetConfig?: T): T;
53
+ /**
54
+ * Check if headers contain enriched context headers
55
+ *
56
+ * @param headers - Headers to check
57
+ * @returns True if enriched headers are present
58
+ */
59
+ export declare function hasEnrichedHeaders(headers: Headers | Record<string, string | string[] | undefined>): boolean;
60
+ export declare function extractHeadersFromRequest<T extends {
61
+ headers?: Record<string, string>;
62
+ }>(request: T): RequestHeaderExtraction;
63
+ export declare function extractClientHints<T extends {
64
+ headers?: Record<string, string>;
65
+ }>(request: T): ApiHeaders;
66
+ export declare function extractDeviceInfo<T extends {
67
+ headers?: Record<string, string>;
68
+ }>(request: T): ApiHeaders;
69
+ export declare function extractNetworkInfo<T extends {
70
+ headers?: Record<string, string>;
71
+ }>(request: T): ApiHeaders;
72
+ export declare function prepareEnrichedHeadersForTransfer(headers: ApiHeaders): ApiHeaders;
73
+ //# sourceMappingURL=extract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../../src/api/headers/extract.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAE5E;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,sBAA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+1,308 @@
1
+ /**
2
+ * Header Builder Utilities
3
+ * Fluent API for building HTTP headers, following TASK-016 specification
4
+ */
5
+ import type { ApiHeaders, ContentType, AcceptType, AuthType, PlatformType, HeaderBuilderLike } from '@plyaz/types/api';
6
+ /**
7
+ * Header builder with fluent API for constructing HTTP headers
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * const headers = new HeaderBuilder()
12
+ * .auth('Bearer token123')
13
+ * .contentType('json')
14
+ * .locale('en-US')
15
+ * .tenant('acme-corp')
16
+ * .build();
17
+ * ```
18
+ */
19
+ export declare class HeaderBuilder implements HeaderBuilderLike {
20
+ private _headers;
21
+ /**
22
+ * Get read-only access to headers (for HeaderBuilderLike compatibility)
23
+ */
24
+ get headers(): ApiHeaders;
25
+ /**
26
+ * Set authentication header
27
+ *
28
+ * @param token - Authentication token or credentials
29
+ * @param type - Authentication type (Bearer, Basic, ApiKey)
30
+ * @returns Builder instance for chaining
31
+ *
32
+ * @example
33
+ * ```typescript
34
+ * builder.auth('token123') // Bearer token123
35
+ * builder.auth('token123', 'Basic') // Basic token123
36
+ * builder.auth('key123', 'ApiKey') // x-api-key: key123
37
+ * ```
38
+ */
39
+ auth(token: string, type?: AuthType): this;
40
+ /**
41
+ * Set content type header
42
+ *
43
+ * @param type - Content type (json, form, multipart, or custom)
44
+ * @returns Builder instance for chaining
45
+ *
46
+ * @example
47
+ * ```typescript
48
+ * builder.contentType('json') // application/json
49
+ * builder.contentType('form') // application/x-www-form-urlencoded
50
+ * builder.contentType('multipart') // multipart/form-data
51
+ * builder.contentType('application/vnd.api+json') // custom type
52
+ * ```
53
+ */
54
+ contentType(type: ContentType): this;
55
+ /**
56
+ * Set accept header
57
+ *
58
+ * @param type - Accept type (json, xml, html, or custom)
59
+ * @returns Builder instance for chaining
60
+ *
61
+ * @example
62
+ * ```typescript
63
+ * builder.accept('json') // application/json
64
+ * builder.accept('xml') // application/xml
65
+ * builder.accept('stream') // text/event-stream
66
+ * ```
67
+ */
68
+ accept(type: AcceptType): this;
69
+ /**
70
+ * Set locale/language headers
71
+ *
72
+ * @param locale - Locale string (e.g., 'en-US', 'fr-FR')
73
+ * @returns Builder instance for chaining
74
+ *
75
+ * @example
76
+ * ```typescript
77
+ * builder.locale('en-US') // Sets both accept-language and x-locale
78
+ * ```
79
+ */
80
+ locale(locale: string): this;
81
+ /**
82
+ * Set platform header
83
+ *
84
+ * @param platform - Platform identifier
85
+ * @returns Builder instance for chaining
86
+ *
87
+ * @example
88
+ * ```typescript
89
+ * builder.platform('ios') // x-platform: ios
90
+ * builder.platform('web') // x-platform: web
91
+ * ```
92
+ */
93
+ platform(platform: PlatformType): this;
94
+ /**
95
+ * Set tenant for multi-tenant applications
96
+ *
97
+ * @param tenantId - Tenant identifier
98
+ * @returns Builder instance for chaining
99
+ *
100
+ * @example
101
+ * ```typescript
102
+ * builder.tenant('acme-corp') // x-tenant-id: acme-corp
103
+ * ```
104
+ */
105
+ tenant(tenantId: string): this;
106
+ /**
107
+ * Set user context
108
+ *
109
+ * @param userId - User identifier
110
+ * @returns Builder instance for chaining
111
+ *
112
+ * @example
113
+ * ```typescript
114
+ * builder.user('user123') // x-user-id: user123
115
+ * ```
116
+ */
117
+ user(userId: string): this;
118
+ /**
119
+ * Set application version
120
+ *
121
+ * @param version - Application version
122
+ * @returns Builder instance for chaining
123
+ *
124
+ * @example
125
+ * ```typescript
126
+ * builder.version('1.2.3') // x-app-version: 1.2.3
127
+ * ```
128
+ */
129
+ version(version: string): this;
130
+ /**
131
+ * Set feature flags
132
+ *
133
+ * @param flags - Feature flags as array or comma-separated string
134
+ * @returns Builder instance for chaining
135
+ *
136
+ * @example
137
+ * ```typescript
138
+ * builder.features(['featureA', 'featureB']) // x-feature-flag: featureA,featureB
139
+ * builder.features('featureA,featureB') // x-feature-flag: featureA,featureB
140
+ * ```
141
+ */
142
+ features(flags: string[] | string): this;
143
+ /**
144
+ * Set device identifier
145
+ *
146
+ * @param deviceId - Device identifier
147
+ * @returns Builder instance for chaining
148
+ *
149
+ * @example
150
+ * ```typescript
151
+ * builder.device('device123') // x-device-id: device123
152
+ * ```
153
+ */
154
+ device(deviceId: string): this;
155
+ /**
156
+ * Set session identifier
157
+ *
158
+ * @param sessionId - Session identifier
159
+ * @returns Builder instance for chaining
160
+ *
161
+ * @example
162
+ * ```typescript
163
+ * builder.session('sess_abc123') // x-session-id: sess_abc123
164
+ * ```
165
+ */
166
+ session(sessionId: string): this;
167
+ /**
168
+ * Set client identifier
169
+ *
170
+ * @param clientId - Client identifier
171
+ * @returns Builder instance for chaining
172
+ *
173
+ * @example
174
+ * ```typescript
175
+ * builder.client('mobile-app') // x-client-id: mobile-app
176
+ * ```
177
+ */
178
+ client(clientId: string): this;
179
+ /**
180
+ * Add correlation ID for distributed tracing
181
+ *
182
+ * @param id - Correlation ID (auto-generated if not provided)
183
+ * @returns Builder instance for chaining
184
+ *
185
+ * @example
186
+ * ```typescript
187
+ * builder.correlationId() // x-correlation-id: auto-generated
188
+ * builder.correlationId('corr_123') // x-correlation-id: corr_123
189
+ * ```
190
+ */
191
+ correlationId(id?: string): this;
192
+ /**
193
+ * Add request ID for tracking
194
+ *
195
+ * @param id - Request ID (auto-generated if not provided)
196
+ * @returns Builder instance for chaining
197
+ *
198
+ * @example
199
+ * ```typescript
200
+ * builder.requestId() // x-request-id: auto-generated
201
+ * builder.requestId('req_123') // x-request-id: req_123
202
+ * ```
203
+ */
204
+ requestId(id?: string): this;
205
+ /**
206
+ * Add trace ID for distributed tracing
207
+ *
208
+ * @param traceId - Trace ID (auto-generated if not provided)
209
+ * @returns Builder instance for chaining
210
+ *
211
+ * @example
212
+ * ```typescript
213
+ * builder.traceId() // x-trace-id: auto-generated
214
+ * builder.traceId('trace_123') // x-trace-id: trace_123
215
+ * ```
216
+ */
217
+ traceId(traceId?: string): this;
218
+ /**
219
+ * Add span ID for distributed tracing
220
+ *
221
+ * @param spanId - Span ID
222
+ * @returns Builder instance for chaining
223
+ *
224
+ * @example
225
+ * ```typescript
226
+ * builder.spanId('span_123') // x-span-id: span_123
227
+ * ```
228
+ */
229
+ spanId(spanId: string): this;
230
+ /**
231
+ * Add AJAX request marker
232
+ *
233
+ * @returns Builder instance for chaining
234
+ *
235
+ * @example
236
+ * ```typescript
237
+ * builder.ajax() // x-requested-with: XMLHttpRequest
238
+ * ```
239
+ */
240
+ ajax(): this;
241
+ /**
242
+ * Add custom header
243
+ *
244
+ * @param key - Header name
245
+ * @param value - Header value
246
+ * @returns Builder instance for chaining
247
+ *
248
+ * @example
249
+ * ```typescript
250
+ * builder.custom('x-custom-header', 'custom-value')
251
+ * ```
252
+ */
253
+ custom(key: string, value: string): this;
254
+ /**
255
+ * Add multiple headers at once
256
+ *
257
+ * @param headers - Headers object to merge
258
+ * @returns Builder instance for chaining
259
+ *
260
+ * @example
261
+ * ```typescript
262
+ * builder.merge({ 'x-custom-1': 'value1', 'x-custom-2': 'value2' })
263
+ * ```
264
+ */
265
+ merge(headers: Record<string, string>): this;
266
+ /**
267
+ * Get built headers object
268
+ *
269
+ * @returns Headers object ready for use with API requests
270
+ *
271
+ * @example
272
+ * ```typescript
273
+ * const headers = builder.build();
274
+ * await fetch('/api/data', { headers });
275
+ * ```
276
+ */
277
+ build(): ApiHeaders;
278
+ /**
279
+ * Clear all headers and reset builder
280
+ *
281
+ * @returns Builder instance for chaining
282
+ */
283
+ clear(): this;
284
+ /**
285
+ * Remove specific header
286
+ *
287
+ * @param key - Header name to remove
288
+ * @returns Builder instance for chaining
289
+ */
290
+ remove(key: string): this;
291
+ }
292
+ /**
293
+ * Create a new header builder instance
294
+ *
295
+ * @returns New HeaderBuilder instance
296
+ *
297
+ * @example
298
+ * ```typescript
299
+ * import { headers } from '@plyaz/api/headers';
300
+ *
301
+ * const myHeaders = headers()
302
+ * .auth('Bearer token')
303
+ * .contentType('json')
304
+ * .build();
305
+ * ```
306
+ */
307
+ export declare function headers(): HeaderBuilder;
308
+ //# sourceMappingURL=headerBuilder.d.ts.map
@@ -0,0 +1 @@
1
+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Q,EAAE,MAAM,GAAG,IAAI;IAK9B;;;;;;;;;;;OAWG;IACH,aAAa,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI;IAKhC;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI;IAK5B;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAK/B;;;;;;;;;;OAUG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAK5B;;;;;;;;;OASG;IACH,IAAI,IAAI,IAAI;IAKZ;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAKxC;;;;;;;;;;OAUG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;IAS5C;;;;;;;;;;OAUG;IACH,KAAK,IAAI,UAAU;IAInB;;;;OAIG;IACH,KAAK,IAAI,IAAI;IAKb;;;;;OAKG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;CAI1B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,OAAO,IAAI,aAAa,CAEvC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Header Management Utilities
3
+ * Comprehensive header management for API requests
4
+ *
5
+ * This module provides:
6
+ * - Fluent API for building headers
7
+ * - Common header presets for different scenarios
8
+ * - Header merging and management utilities
9
+ * - Integration with network detection
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * import { headers, headerPresets, mergeHeaders } from '@plyaz/api/headers';
14
+ *
15
+ * // Using header builder
16
+ * const authHeaders = headers()
17
+ * .auth('Bearer token123')
18
+ * .contentType('json')
19
+ * .tenant('acme-corp')
20
+ * .build();
21
+ *
22
+ * // Using presets
23
+ * const jsonHeaders = headerPresets.json();
24
+ *
25
+ * // Merging headers
26
+ * const finalHeaders = mergeHeaders(jsonHeaders, authHeaders);
27
+ * ```
28
+ */
29
+ export { HeaderBuilder, headers } from './headerBuilder';
30
+ export { headerPresets, getPresetNames, hasPreset } from './presets';
31
+ export { mergeHeaders, mergeHeadersWithImmutable, combineHeaderValues, parseHeaderValues, } from './merge';
32
+ export { getCacheAffectingHeaders, getNonCacheAffectingHeaders, sanitizeHeaders, removeSensitiveHeaders, normalizeHeaders, hasAuthentication, getAuthenticationType, validateHeaders, getHeaderFingerprint, } from './utils';
33
+ export { getNetworkInfoFromHeaders, getNetworkQualityFromHeaders, isDataSaverEnabledFromHeaders, getNetworkConfigFromHeaders, getClientHintHeaders, withNetworkDetection, } from '../network/headers';
34
+ export { buildEnrichedHeaders, sanitizeHeaderValue, enrichedHeaderPresets } from './enriched';
35
+ export { getOrCompute, invalidateHeaderCache, clearHeaderCache } from './cache';
36
+ export { extractHeadersFromRequest, extractClientHints, extractDeviceInfo, extractNetworkInfo, } from './extract';
37
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/headers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAGzD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAGrE,OAAO,EACL,YAAY,EACZ,yBAAyB,EACzB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,wBAAwB,EACxB,2BAA2B,EAC3B,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,oBAAoB,GACrB,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,yBAAyB,EACzB,4BAA4B,EAC5B,6BAA6B,EAC7B,2BAA2B,EAC3B,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAG9F,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAGhF,OAAO,EACL,yBAAyB,EACzB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,WAAW,CAAC"}