@plyaz/api 1.0.2 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (380) 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 +7 -0
  335. package/dist/api/services/index.d.ts.map +1 -0
  336. package/dist/api/strategies/index.d.ts +8 -0
  337. package/dist/api/strategies/index.d.ts.map +1 -0
  338. package/dist/api/strategies/tracked.d.ts +15 -0
  339. package/dist/api/strategies/tracked.d.ts.map +1 -0
  340. package/dist/api/strategies/unified.d.ts +87 -0
  341. package/dist/api/strategies/unified.d.ts.map +1 -0
  342. package/dist/api/utils/async-control.d.ts +96 -0
  343. package/dist/api/utils/async-control.d.ts.map +1 -0
  344. package/dist/api/utils/colors.d.ts +88 -0
  345. package/dist/api/utils/colors.d.ts.map +1 -0
  346. package/dist/api/utils/environment.d.ts +595 -0
  347. package/dist/api/utils/environment.d.ts.map +1 -0
  348. package/dist/api/utils/generation/correlation-id.d.ts +206 -0
  349. package/dist/api/utils/generation/correlation-id.d.ts.map +1 -0
  350. package/dist/api/utils/generation/id-generator.d.ts +133 -0
  351. package/dist/api/utils/generation/id-generator.d.ts.map +1 -0
  352. package/dist/api/utils/generation/request-id.d.ts +106 -0
  353. package/dist/api/utils/generation/request-id.d.ts.map +1 -0
  354. package/dist/api/utils/index.d.ts +19 -0
  355. package/dist/api/utils/index.d.ts.map +1 -0
  356. package/dist/api/utils/interval-manager.d.ts +94 -0
  357. package/dist/api/utils/interval-manager.d.ts.map +1 -0
  358. package/dist/api/utils/json.d.ts +98 -0
  359. package/dist/api/utils/json.d.ts.map +1 -0
  360. package/dist/api/utils/math.d.ts +168 -0
  361. package/dist/api/utils/math.d.ts.map +1 -0
  362. package/dist/api/utils/object-merge.d.ts +34 -0
  363. package/dist/api/utils/object-merge.d.ts.map +1 -0
  364. package/dist/api/utils/object.d.ts +101 -0
  365. package/dist/api/utils/object.d.ts.map +1 -0
  366. package/dist/api/utils/string.d.ts +41 -0
  367. package/dist/api/utils/string.d.ts.map +1 -0
  368. package/dist/api/utils/time.d.ts +233 -0
  369. package/dist/api/utils/time.d.ts.map +1 -0
  370. package/dist/api/utils/type-guards.d.ts +59 -0
  371. package/dist/api/utils/type-guards.d.ts.map +1 -0
  372. package/dist/api/utils/validation.d.ts +21 -0
  373. package/dist/api/utils/validation.d.ts.map +1 -0
  374. package/dist/index.cjs +25594 -3
  375. package/dist/index.cjs.map +1 -1
  376. package/dist/index.d.ts +5 -1
  377. package/dist/index.d.ts.map +1 -1
  378. package/dist/index.mjs +25068 -3
  379. package/dist/index.mjs.map +1 -1
  380. package/package.json +15 -6
@@ -0,0 +1,23 @@
1
+ /**
2
+ * React Query Mutation Hook for Joining Campaigns
3
+ * Provides cache invalidation for participant lists
4
+ */
5
+ import { createApiMutation } from '../../../hooks/factories';
6
+ import type { CampaignJoinResponse } from '@plyaz/types/api';
7
+ import type { ServiceOptions } from '@plyaz/types/api';
8
+ import type { EndpointsList } from '@/api/endpoints';
9
+ /**
10
+ * Hook for joining a campaign
11
+ *
12
+ * @param serviceOptions - Service options (apiClient, apiConfig, updateConfigOptions)
13
+ * @param mutationOptions - React Query mutation options
14
+ * @returns React Query mutation result
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * const { mutate: join, isPending } = useJoinCampaign();
19
+ * join(campaignId);
20
+ * ```
21
+ */
22
+ export declare function useJoinCampaign<TEndpoints = EndpointsList>(serviceOptions?: ServiceOptions<TEndpoints>, mutationOptions?: Parameters<ReturnType<typeof createApiMutation<CampaignJoinResponse, Error, string, unknown, TEndpoints>>>[1]): ReturnType<ReturnType<typeof createApiMutation<CampaignJoinResponse, Error, string, unknown, TEndpoints>>>;
23
+ //# sourceMappingURL=useJoinCampaign.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useJoinCampaign.d.ts","sourceRoot":"","sources":["../../../../../src/api/services/campaigns/POST/useJoinCampaign.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,UAAU,GAAG,aAAa,EACxD,cAAc,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,EAC3C,eAAe,CAAC,EAAE,UAAU,CAC1B,UAAU,CAAC,OAAO,iBAAiB,CAAC,oBAAoB,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,CAC/F,CAAC,CAAC,CAAC,GACH,UAAU,CACX,UAAU,CAAC,OAAO,iBAAiB,CAAC,oBAAoB,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,CAC/F,CAuBA"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * React Query Mutation Hook for Leaving Campaigns
3
+ * Provides cache invalidation for participant lists
4
+ */
5
+ import { createApiMutation } from '../../../hooks/factories';
6
+ import type { CampaignLeaveResponse } from '@plyaz/types/api';
7
+ import type { ServiceOptions } from '@plyaz/types/api';
8
+ import type { EndpointsList } from '@/api/endpoints';
9
+ /**
10
+ * Hook for leaving a campaign
11
+ *
12
+ * @param serviceOptions - Service options (apiClient, apiConfig, updateConfigOptions)
13
+ * @param mutationOptions - React Query mutation options
14
+ * @returns React Query mutation result
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * const { mutate: leave } = useLeaveCampaign();
19
+ * leave(campaignId);
20
+ * ```
21
+ */
22
+ export declare function useLeaveCampaign<TEndpoints = EndpointsList>(serviceOptions?: ServiceOptions<TEndpoints>, mutationOptions?: Parameters<ReturnType<typeof createApiMutation<CampaignLeaveResponse, Error, string, unknown, TEndpoints>>>[1]): ReturnType<ReturnType<typeof createApiMutation<CampaignLeaveResponse, Error, string, unknown, TEndpoints>>>;
23
+ //# sourceMappingURL=useLeaveCampaign.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLeaveCampaign.d.ts","sourceRoot":"","sources":["../../../../../src/api/services/campaigns/POST/useLeaveCampaign.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,GAAG,aAAa,EACzD,cAAc,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,EAC3C,eAAe,CAAC,EAAE,UAAU,CAC1B,UAAU,CAAC,OAAO,iBAAiB,CAAC,qBAAqB,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,CAChG,CAAC,CAAC,CAAC,GACH,UAAU,CACX,UAAU,CAAC,OAAO,iBAAiB,CAAC,qBAAqB,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,CAChG,CA0BA"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Campaign PUT Operations
3
+ * Exports all PUT services and hooks for campaigns
4
+ */
5
+ export { updateCampaign } from './updateCampaign';
6
+ export { useUpdateCampaign } from './useUpdateCampaign';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/services/campaigns/PUT/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Update Campaign Service
3
+ * Updates an existing campaign with new data
4
+ */
5
+ import type { UpdateCampaignDto } from '@plyaz/types/api';
6
+ import type { ServiceOptions } from '@plyaz/types/api';
7
+ import type { EndpointsList } from '@/api/endpoints';
8
+ import type { FetchResponse } from 'fetchff';
9
+ /**
10
+ * Update a campaign
11
+ * Uses endpoint: PUT /campaigns/:id
12
+ *
13
+ * @param campaignId - The campaign ID to update
14
+ * @param data - The update data
15
+ * @param options - Optional service options (client override, config overrides)
16
+ * @returns Promise<Campaign>
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * // Basic usage
21
+ * const updated = await updateCampaign('camp-123', {
22
+ * name: 'Updated Campaign Name',
23
+ * description: 'New description'
24
+ * });
25
+ *
26
+ * // With timeout override
27
+ * const updated = await updateCampaign(
28
+ * 'camp-123',
29
+ * { status: 'active' },
30
+ * { apiConfig: { timeout: 10000 } }
31
+ * );
32
+ * ```
33
+ *
34
+ * @throws {ApiPackageError} When the request fails or campaign is not found
35
+ */
36
+ export declare function updateCampaign<TEndpoints = EndpointsList>(campaignId: string, data: UpdateCampaignDto, options?: ServiceOptions<TEndpoints>): Promise<FetchResponse>;
37
+ //# sourceMappingURL=updateCampaign.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateCampaign.d.ts","sourceRoot":"","sources":["../../../../../src/api/services/campaigns/PUT/updateCampaign.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,cAAc,CAAC,UAAU,GAAG,aAAa,EAC7D,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,iBAAiB,EACvB,OAAO,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,GACnC,OAAO,CAAC,aAAa,CAAC,CA4BxB"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * React Query Mutation Hook for Updating Campaigns
3
+ * Provides optimistic updates and cache invalidation
4
+ */
5
+ import { createApiMutation } from '../../../hooks/factories';
6
+ import type { Campaign, UpdateCampaignDto } from '@plyaz/types/api';
7
+ import type { ServiceOptions } from '@plyaz/types/api';
8
+ import type { EndpointsList } from '@/api/endpoints';
9
+ /**
10
+ * Parameters for update campaign mutation
11
+ */
12
+ interface UpdateCampaignParams {
13
+ campaignId: string;
14
+ data: UpdateCampaignDto;
15
+ }
16
+ /**
17
+ * Hook for updating campaigns
18
+ *
19
+ * @param serviceOptions - Service options (apiClient, apiConfig, updateConfigOptions)
20
+ * @param mutationOptions - React Query mutation options
21
+ * @returns React Query mutation result
22
+ *
23
+ * @example
24
+ * ```typescript
25
+ * // Basic usage
26
+ * const { mutate } = useUpdateCampaign();
27
+ * mutate({ campaignId: id, data: updates });
28
+ *
29
+ * // With service options
30
+ * const { mutate } = useUpdateCampaign({
31
+ * apiConfig: { timeout: 8000 },
32
+ * updateConfigOptions: { strategy: 'merge' }
33
+ * });
34
+ * ```
35
+ */
36
+ export declare function useUpdateCampaign<TEndpoints = EndpointsList>(serviceOptions?: ServiceOptions<TEndpoints>, mutationOptions?: Parameters<ReturnType<typeof createApiMutation<Campaign, Error, UpdateCampaignParams, unknown, TEndpoints>>>[1]): ReturnType<ReturnType<typeof createApiMutation<Campaign, Error, UpdateCampaignParams, unknown, TEndpoints>>>;
37
+ export {};
38
+ //# sourceMappingURL=useUpdateCampaign.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUpdateCampaign.d.ts","sourceRoot":"","sources":["../../../../../src/api/services/campaigns/PUT/useUpdateCampaign.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,KAAK,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD;;GAEG;AACH,UAAU,oBAAoB;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,iBAAiB,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,GAAG,aAAa,EAC1D,cAAc,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,EAC3C,eAAe,CAAC,EAAE,UAAU,CAC1B,UAAU,CAAC,OAAO,iBAAiB,CAAC,QAAQ,EAAE,KAAK,EAAE,oBAAoB,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,CACjG,CAAC,CAAC,CAAC,GACH,UAAU,CACX,UAAU,CAAC,OAAO,iBAAiB,CAAC,QAAQ,EAAE,KAAK,EAAE,oBAAoB,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,CACjG,CAwBA"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Campaign Services and Hooks
3
+ * Complete CRUD operations for campaigns with React Query integration
4
+ */
5
+ export * from './GET';
6
+ export * from './POST';
7
+ export * from './PUT';
8
+ export * from './DELETE';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/services/campaigns/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,cAAc,OAAO,CAAC;AAGtB,cAAc,QAAQ,CAAC;AAGvB,cAAc,OAAO,CAAC;AAGtB,cAAc,UAAU,CAAC"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * API Client Instances
3
+ * Default client references that can be set by the consuming application
4
+ *
5
+ * This module exports a default API client reference that service functions use.
6
+ * The consuming application (Next.js app, backend service, etc.) must set this
7
+ * client by calling `setDefaultApiClient()` after creating their client instance.
8
+ *
9
+ * The client should include all endpoints combined in EndpointsList.
10
+ */
11
+ import type { ApiClientWithEvents } from '@plyaz/types/api';
12
+ import type { ClientEventManager } from '../client/clientEventManager';
13
+ import type { EndpointsList } from '../endpoints';
14
+ /**
15
+ * Default API client used by all service functions
16
+ * This is set by the consuming application via `setDefaultApiClient()`
17
+ *
18
+ * The client has access to all endpoints defined in EndpointsList.
19
+ *
20
+ * @internal
21
+ */
22
+ export declare let apiClient: ApiClientWithEvents<ClientEventManager, EndpointsList> | null;
23
+ /**
24
+ * Set the default API client for all service functions
25
+ * Must be called by the consuming application before using any service functions
26
+ *
27
+ * The client should be created with all endpoints from the package.
28
+ *
29
+ * @param client - The API client instance with all endpoints from EndpointsList
30
+ *
31
+ * @example
32
+ * ```typescript
33
+ * // In your app initialization (e.g., Next.js _app.tsx or main.ts)
34
+ * import { createApiClient, setDefaultApiClient } from '@plyaz/api';
35
+ *
36
+ * const client = await createApiClient({
37
+ * baseURL: process.env.NEXT_PUBLIC_API_URL,
38
+ * // Endpoints are managed internally by the package
39
+ * });
40
+ *
41
+ * setDefaultApiClient(client);
42
+ *
43
+ * // Now all service functions have access to all endpoints
44
+ * const campaign = await fetchCampaign('123');
45
+ * ```
46
+ */
47
+ export declare function setDefaultApiClient(client: ApiClientWithEvents<ClientEventManager, EndpointsList>): void;
48
+ /**
49
+ * Get the default API client
50
+ * Returns the client with all endpoints from EndpointsList
51
+ *
52
+ * Throws an error if the client hasn't been set
53
+ *
54
+ * @internal
55
+ * @throws {Error} When the client hasn't been initialized
56
+ */
57
+ export declare function getDefaultApiClient(): ApiClientWithEvents<ClientEventManager, EndpointsList>;
58
+ //# sourceMappingURL=clients.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clients.d.ts","sourceRoot":"","sources":["../../../src/api/services/clients.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD;;;;;;;GAOG;AACH,eAAO,IAAI,SAAS,EAAE,mBAAmB,CAAC,kBAAkB,EAAE,aAAa,CAAC,GAAG,IAAW,CAAC;AAE3F;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,mBAAmB,CAAC,kBAAkB,EAAE,aAAa,CAAC,GAC7D,IAAI,CAEN;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,IAAI,mBAAmB,CAAC,kBAAkB,EAAE,aAAa,CAAC,CAW5F"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Services Layer
3
+ * Exports all service functions, hooks, and utilities
4
+ */
5
+ export { setDefaultApiClient, getDefaultApiClient } from './clients';
6
+ export * from './campaigns';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/services/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAGrE,cAAc,aAAa,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Unified Strategies Module
3
+ * Convenience layer combining individual domain strategies
4
+ *
5
+ * @module strategies
6
+ */
7
+ export { unifiedStrategies, applyUnifiedStrategy, getUnifiedStrategy, mergeUnifiedStrategy, isUnifiedStrategyName, getUnifiedStrategyNames, createCustomUnifiedStrategy, } from './unified';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/strategies/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,WAAW,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Tracked Strategy Application
3
+ * Wrapper functions that apply strategies with conflict tracking
4
+ */
5
+ import type { UnifiedStrategyName, UnifiedStrategyConfig } from '@plyaz/types/api';
6
+ /**
7
+ * Apply unified strategy with conflict tracking
8
+ * This is the version that should be used in createApiClient
9
+ */
10
+ export declare function applyTrackedUnifiedStrategy(strategyName: UnifiedStrategyName): UnifiedStrategyConfig;
11
+ /**
12
+ * Get unified strategy with tracking (alternative API)
13
+ */
14
+ export declare function getTrackedUnifiedStrategy(name: UnifiedStrategyName): UnifiedStrategyConfig;
15
+ //# sourceMappingURL=tracked.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tracked.d.ts","sourceRoot":"","sources":["../../../src/api/strategies/tracked.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAEV,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,kBAAkB,CAAC;AAE1B;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,mBAAmB,GAChC,qBAAqB,CASvB;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,mBAAmB,GAAG,qBAAqB,CAkC1F"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Unified API Strategies
3
+ * Combines individual strategies from different domains into convenient presets
4
+ *
5
+ * @module strategies/unified
6
+ */
7
+ import type { UnifiedStrategyName, UnifiedStrategy, UnifiedStrategyConfig } from '@plyaz/types/api';
8
+ export type { UnifiedStrategyName, UnifiedStrategy, UnifiedStrategyConfig } from '@plyaz/types/api';
9
+ /**
10
+ * Unified strategies composed from individual domain strategies
11
+ * These are convenience presets - individual strategies remain the source of truth
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * import { createApiClient, unifiedStrategies } from '@plyaz/api';
16
+ *
17
+ * // Use unified strategy
18
+ * const api = createApiClient({ strategy: 'interactive' });
19
+ *
20
+ * // Or apply strategy configuration directly
21
+ * const config = applyUnifiedStrategy('background');
22
+ * ```
23
+ */
24
+ export declare const unifiedStrategies: Readonly<Record<UnifiedStrategyName, UnifiedStrategy>>;
25
+ /**
26
+ * Apply unified strategy configuration
27
+ * Resolves strategy names to actual configuration objects
28
+ *
29
+ * @param strategyName - Unified strategy name
30
+ * @returns Combined configuration from all domain strategies
31
+ *
32
+ * @example
33
+ * ```typescript
34
+ * const config = applyUnifiedStrategy('interactive');
35
+ * // Returns combined cache, retry, and polling configurations
36
+ * ```
37
+ */
38
+ export declare function applyUnifiedStrategy(strategyName: UnifiedStrategyName): UnifiedStrategyConfig;
39
+ /**
40
+ * Get unified strategy by name with fallback
41
+ *
42
+ * @param name - Strategy name
43
+ * @returns Strategy configuration or 'interactive' as fallback
44
+ */
45
+ export declare function getUnifiedStrategy(name: UnifiedStrategyName): UnifiedStrategy;
46
+ /**
47
+ * Merge unified strategy with overrides
48
+ * Allows overriding specific domains while keeping others from unified strategy
49
+ *
50
+ * @param strategyName - Base unified strategy name
51
+ * @param overrides - Domain-specific overrides
52
+ * @returns Merged strategy configuration
53
+ *
54
+ * @example
55
+ * ```typescript
56
+ * // Start with interactive strategy, but use aggressive retry
57
+ * const config = mergeUnifiedStrategy('interactive', {
58
+ * retry: 'aggressive'
59
+ * });
60
+ * ```
61
+ */
62
+ export declare function mergeUnifiedStrategy(strategyName: UnifiedStrategyName, overrides?: Partial<UnifiedStrategy>): UnifiedStrategy;
63
+ /**
64
+ * Type guard to check if a value is a unified strategy name
65
+ */
66
+ export declare function isUnifiedStrategyName(value: unknown): value is UnifiedStrategyName;
67
+ /**
68
+ * Get all available unified strategy names
69
+ */
70
+ export declare function getUnifiedStrategyNames(): UnifiedStrategyName[];
71
+ /**
72
+ * Create a custom unified strategy
73
+ *
74
+ * @param name - Custom strategy name
75
+ * @param config - Strategy configuration
76
+ * @returns Custom strategy configuration
77
+ *
78
+ * @example
79
+ * ```typescript
80
+ * const customStrategy = createCustomUnifiedStrategy('fastApi', {
81
+ * cache: 'shortLived',
82
+ * retry: 'conservative'
83
+ * });
84
+ * ```
85
+ */
86
+ export declare function createCustomUnifiedStrategy(name: string, config: UnifiedStrategy): Record<string, UnifiedStrategy>;
87
+ //# sourceMappingURL=unified.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unified.d.ts","sourceRoot":"","sources":["../../../src/api/strategies/unified.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAEV,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACtB,MAAM,kBAAkB,CAAC;AAK1B,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEpG;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,mBAAmB,EAAE,eAAe,CAAC,CAsE3E,CAAC;AAEX;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,mBAAmB,GAAG,qBAAqB,CAS7F;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,mBAAmB,GAAG,eAAe,CAyB7E;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAClC,YAAY,EAAE,mBAAmB,EACjC,SAAS,GAAE,OAAO,CAAC,eAAe,CAAM,GACvC,eAAe,CAOjB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,mBAAmB,CAElF;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,mBAAmB,EAAE,CAE/D;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,eAAe,GACtB,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAEjC"}
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Async Control Utilities
3
+ * Generic utilities for controlling async operations like debouncing, throttling, and timeouts
4
+ */
5
+ /**
6
+ * Generic debounce function
7
+ * Delays execution until after wait milliseconds have elapsed since the last invocation
8
+ *
9
+ * @param func - Function to debounce
10
+ * @param delay - Delay in milliseconds
11
+ * @returns Debounced function with cancel method
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * const debouncedSearch = debounce((query: string) => {
16
+ * search(query);
17
+ * }, 300);
18
+ *
19
+ * debouncedSearch('hello'); // Will execute after 300ms
20
+ * debouncedSearch('hello world'); // Previous call cancelled, this executes after 300ms
21
+ *
22
+ * // Cancel pending execution
23
+ * debouncedSearch.cancel();
24
+ * ```
25
+ */
26
+ export declare function debounce<TArgs extends unknown[]>(func: (...args: TArgs) => void, delay: number): {
27
+ (...args: TArgs): void;
28
+ cancel: () => void;
29
+ };
30
+ /**
31
+ * Generic throttle function
32
+ * Limits function execution to at most once per limit milliseconds
33
+ *
34
+ * @param func - Function to throttle
35
+ * @param limit - Minimum time between executions (ms)
36
+ * @returns Throttled function
37
+ *
38
+ * @example
39
+ * ```typescript
40
+ * const throttledScroll = throttle((event: Event) => {
41
+ * handleScroll(event);
42
+ * }, 100);
43
+ *
44
+ * window.addEventListener('scroll', throttledScroll);
45
+ * ```
46
+ */
47
+ export declare function throttle<TArgs extends unknown[]>(func: (...args: TArgs) => void, limit: number): (...args: TArgs) => void;
48
+ /**
49
+ * Execute function with timeout
50
+ * Automatically rejects after timeout period
51
+ *
52
+ * @param func - Async function to execute
53
+ * @param timeoutMs - Timeout in milliseconds
54
+ * @param timeoutError - Error to throw on timeout
55
+ * @returns Promise that resolves with function result or rejects on timeout
56
+ *
57
+ * @example
58
+ * ```typescript
59
+ * const result = await withTimeout(
60
+ * () => fetch('/api/slow-endpoint').then(r => r.json()),
61
+ * 5000,
62
+ * new Error('Request timed out')
63
+ * );
64
+ * ```
65
+ */
66
+ export declare function withTimeout<T>(func: () => Promise<T>, timeoutMs: number, timeoutError?: Error): Promise<T>;
67
+ /**
68
+ * Create a delayed execution function
69
+ * Simple utility to delay function execution
70
+ *
71
+ * @param delay - Delay in milliseconds
72
+ * @returns Function that delays execution
73
+ *
74
+ * @example
75
+ * ```typescript
76
+ * const wait = createDelay(1000);
77
+ * await wait();
78
+ * console.log('Executed after 1 second');
79
+ * ```
80
+ */
81
+ export declare function createDelay(delay: number): () => Promise<void>;
82
+ /**
83
+ * Sleep/delay utility function
84
+ * Simple promise-based delay
85
+ *
86
+ * @param ms - Milliseconds to sleep
87
+ * @returns Promise that resolves after delay
88
+ *
89
+ * @example
90
+ * ```typescript
91
+ * await sleep(1000); // Wait 1 second
92
+ * console.log('Done waiting');
93
+ * ```
94
+ */
95
+ export declare function sleep(ms: number): Promise<void>;
96
+ //# sourceMappingURL=async-control.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"async-control.d.ts","sourceRoot":"","sources":["../../../src/api/utils/async-control.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,QAAQ,CAAC,KAAK,SAAS,OAAO,EAAE,EAC9C,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,IAAI,EAC9B,KAAK,EAAE,MAAM,GACZ;IACD,CAAC,GAAG,IAAI,EAAE,KAAK,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAsBA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,QAAQ,CAAC,KAAK,SAAS,OAAO,EAAE,EAC9C,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,IAAI,EAC9B,KAAK,EAAE,MAAM,GACZ,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,IAAI,CA4B1B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,WAAW,CAAC,CAAC,EACjC,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACtB,SAAS,EAAE,MAAM,EACjB,YAAY,CAAC,EAAE,KAAK,GACnB,OAAO,CAAC,CAAC,CAAC,CAWZ;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAE9D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE/C"}
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Color utilities for debug reporting
3
+ *
4
+ * Provides ANSI color codes for terminal output
5
+ */
6
+ /**
7
+ * ANSI color codes
8
+ */
9
+ export declare const COLORS: {
10
+ readonly reset: "\u001B[0m";
11
+ readonly black: "\u001B[30m";
12
+ readonly red: "\u001B[31m";
13
+ readonly green: "\u001B[32m";
14
+ readonly yellow: "\u001B[33m";
15
+ readonly blue: "\u001B[34m";
16
+ readonly magenta: "\u001B[35m";
17
+ readonly cyan: "\u001B[36m";
18
+ readonly white: "\u001B[37m";
19
+ readonly gray: "\u001B[90m";
20
+ readonly brightRed: "\u001B[91m";
21
+ readonly brightGreen: "\u001B[92m";
22
+ readonly brightYellow: "\u001B[93m";
23
+ readonly brightBlue: "\u001B[94m";
24
+ readonly brightMagenta: "\u001B[95m";
25
+ readonly brightCyan: "\u001B[96m";
26
+ readonly brightWhite: "\u001B[97m";
27
+ readonly bgRed: "\u001B[41m";
28
+ readonly bgGreen: "\u001B[42m";
29
+ readonly bgYellow: "\u001B[43m";
30
+ readonly bgBlue: "\u001B[44m";
31
+ readonly bgMagenta: "\u001B[45m";
32
+ readonly bgCyan: "\u001B[46m";
33
+ readonly bgWhite: "\u001B[47m";
34
+ readonly bold: "\u001B[1m";
35
+ readonly dim: "\u001B[2m";
36
+ readonly italic: "\u001B[3m";
37
+ readonly underline: "\u001B[4m";
38
+ readonly blink: "\u001B[5m";
39
+ readonly reverse: "\u001B[7m";
40
+ readonly hidden: "\u001B[8m";
41
+ readonly strikethrough: "\u001B[9m";
42
+ };
43
+ /**
44
+ * Color helper functions
45
+ */
46
+ export declare const color: {
47
+ success: (text: string) => string;
48
+ error: (text: string) => string;
49
+ warning: (text: string) => string;
50
+ info: (text: string) => string;
51
+ debug: (text: string) => string;
52
+ critical: (text: string) => string;
53
+ high: (text: string) => string;
54
+ medium: (text: string) => string;
55
+ low: (text: string) => string;
56
+ none: (text: string) => string;
57
+ bold: (text: string) => string;
58
+ underline: (text: string) => string;
59
+ dim: (text: string) => string;
60
+ code: (text: string) => string;
61
+ header: (text: string) => string;
62
+ subheader: (text: string) => string;
63
+ label: (text: string) => string;
64
+ value: (text: string) => string;
65
+ box: (text: string, colorCode?: "\u001B[36m") => string;
66
+ highlight: (text: string) => string;
67
+ score: (value: number, max?: number) => string;
68
+ percentage: (value: number) => string;
69
+ badge: (text: string, status: "success" | "error" | "warning" | "info") => string;
70
+ bullet: (text: string, level?: "primary" | "secondary" | "tertiary") => string;
71
+ };
72
+ /**
73
+ * Format table with colors
74
+ */
75
+ export declare function colorTable(headers: string[], rows: string[][], options?: {
76
+ headerColor?: string;
77
+ borderColor?: string;
78
+ alternateRowColors?: boolean;
79
+ }): string;
80
+ /**
81
+ * Create a colored progress bar
82
+ */
83
+ export declare function colorProgressBar(value: number, max: number, width?: number): string;
84
+ /**
85
+ * Strip colors from text (useful for logging to files)
86
+ */
87
+ export declare function stripColors(text: string): string;
88
+ //# sourceMappingURL=colors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../../src/api/utils/colors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAcH;;GAEG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0CT,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,KAAK;oBAEA,MAAM,KAAG,MAAM;kBACjB,MAAM,KAAG,MAAM;oBACb,MAAM,KAAG,MAAM;iBAClB,MAAM,KAAG,MAAM;kBACd,MAAM,KAAG,MAAM;qBAGZ,MAAM,KAAG,MAAM;iBACnB,MAAM,KAAG,MAAM;mBACb,MAAM,KAAG,MAAM;gBAClB,MAAM,KAAG,MAAM;iBACd,MAAM,KAAG,MAAM;iBAGf,MAAM,KAAG,MAAM;sBACV,MAAM,KAAG,MAAM;gBACrB,MAAM,KAAG,MAAM;iBACd,MAAM,KAAG,MAAM;mBAGb,MAAM,KAAG,MAAM;sBACZ,MAAM,KAAG,MAAM;kBACnB,MAAM,KAAG,MAAM;kBACf,MAAM,KAAG,MAAM;gBAGjB,MAAM,+BAA4B,MAAM;sBAClC,MAAM,KAAG,MAAM;mBAGlB,MAAM,QAAO,MAAM,KAAoB,MAAM;wBAYxC,MAAM,KAAG,MAAM;kBAWrB,MAAM,UAAU,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,KAAG,MAAM;mBAWhE,MAAM,UAAS,SAAS,GAAG,WAAW,GAAG,UAAU,KAAe,MAAM;CAaxF,CAAC;AAEF;;GAEG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,MAAM,EAAE,EACjB,IAAI,EAAE,MAAM,EAAE,EAAE,EAChB,OAAO,CAAC,EAAE;IACR,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,GACA,MAAM,CAiDR;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,KAAK,GAAE,MAAmC,GACzC,MAAM,CAeR;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGhD"}