@djangocfg/api 2.1.36 → 2.1.37

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 (367) hide show
  1. package/dist/auth.cjs +3007 -4015
  2. package/dist/auth.cjs.map +1 -1
  3. package/dist/auth.mjs +3007 -4015
  4. package/dist/auth.mjs.map +1 -1
  5. package/dist/clients.cjs +4983 -0
  6. package/dist/clients.cjs.map +1 -0
  7. package/dist/clients.d.cts +4135 -0
  8. package/dist/clients.d.ts +4135 -0
  9. package/dist/clients.mjs +4957 -0
  10. package/dist/clients.mjs.map +1 -0
  11. package/dist/hooks.cjs +1083 -0
  12. package/dist/hooks.cjs.map +1 -1
  13. package/dist/hooks.d.cts +1122 -1
  14. package/dist/hooks.d.ts +1122 -1
  15. package/dist/hooks.mjs +1053 -0
  16. package/dist/hooks.mjs.map +1 -1
  17. package/dist/index.cjs +2888 -7848
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.cts +1867 -9643
  20. package/dist/index.d.ts +1867 -9643
  21. package/dist/index.mjs +2891 -7851
  22. package/dist/index.mjs.map +1 -1
  23. package/package.json +8 -3
  24. package/src/auth/hooks/useGithubAuth.ts +3 -3
  25. package/src/clients.ts +57 -0
  26. package/src/generated/cfg_accounts/_utils/fetchers/{cfg_accounts__accounts.ts → accounts.ts} +10 -2
  27. package/src/generated/cfg_accounts/_utils/fetchers/{cfg_accounts__accounts__auth.ts → accounts__auth.ts} +9 -1
  28. package/src/generated/cfg_accounts/_utils/fetchers/{cfg_accounts__accounts__oauth.ts → accounts__oauth.ts} +13 -5
  29. package/src/generated/cfg_accounts/_utils/fetchers/{cfg_accounts__accounts__user_profile.ts → accounts__user_profile.ts} +14 -6
  30. package/src/generated/cfg_accounts/_utils/fetchers/index.ts +12 -29
  31. package/src/generated/cfg_accounts/_utils/hooks/{cfg_accounts__accounts.ts → accounts.ts} +9 -1
  32. package/src/generated/cfg_accounts/_utils/hooks/{cfg_accounts__accounts__auth.ts → accounts__auth.ts} +9 -1
  33. package/src/generated/cfg_accounts/_utils/hooks/{cfg_accounts__accounts__oauth.ts → accounts__oauth.ts} +9 -1
  34. package/src/generated/cfg_accounts/_utils/hooks/{cfg_accounts__accounts__user_profile.ts → accounts__user_profile.ts} +9 -1
  35. package/src/generated/cfg_accounts/_utils/hooks/index.ts +12 -29
  36. package/src/generated/cfg_accounts/_utils/schemas/index.ts +8 -134
  37. package/src/generated/cfg_accounts/{cfg_accounts__accounts → accounts}/client.ts +1 -1
  38. package/src/generated/cfg_accounts/accounts/index.ts +10 -0
  39. package/src/generated/cfg_accounts/{cfg_accounts__accounts → accounts}/models.ts +8 -0
  40. package/src/generated/cfg_accounts/{cfg_accounts__accounts__auth → accounts__auth}/client.ts +1 -1
  41. package/src/generated/cfg_accounts/accounts__auth/index.ts +10 -0
  42. package/src/generated/cfg_accounts/accounts__auth/models.ts +25 -0
  43. package/src/generated/cfg_accounts/{cfg_accounts__accounts__oauth → accounts__oauth}/client.ts +1 -1
  44. package/src/generated/cfg_accounts/accounts__oauth/index.ts +10 -0
  45. package/src/generated/cfg_accounts/{cfg_accounts__accounts__oauth → accounts__oauth}/models.ts +8 -0
  46. package/src/generated/cfg_accounts/{cfg_accounts__accounts__user_profile → accounts__user_profile}/client.ts +1 -1
  47. package/src/generated/cfg_accounts/accounts__user_profile/index.ts +10 -0
  48. package/src/generated/cfg_accounts/{cfg_accounts__accounts__user_profile → accounts__user_profile}/models.ts +8 -0
  49. package/src/generated/cfg_accounts/api-instance.ts +8 -0
  50. package/src/generated/cfg_accounts/client.ts +12 -87
  51. package/src/generated/cfg_accounts/enums.ts +8 -96
  52. package/src/generated/cfg_accounts/errors.ts +8 -0
  53. package/src/generated/cfg_accounts/http.ts +8 -0
  54. package/src/generated/cfg_accounts/index.ts +28 -195
  55. package/src/generated/cfg_accounts/logger.ts +8 -0
  56. package/src/generated/cfg_accounts/retry.ts +8 -0
  57. package/src/generated/cfg_accounts/schema.json +246 -10265
  58. package/src/generated/cfg_accounts/storage.ts +8 -0
  59. package/src/generated/cfg_accounts/validation-events.ts +8 -0
  60. package/src/generated/{cfg_accounts/_utils/fetchers/cfg_accounts__centrifugo__centrifugo_admin_api.ts → cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_admin_api.ts} +14 -6
  61. package/src/generated/{cfg_accounts/_utils/fetchers/cfg_accounts__centrifugo__centrifugo_auth.ts → cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_auth.ts} +9 -1
  62. package/src/generated/{cfg_accounts/_utils/fetchers/cfg_accounts__centrifugo__centrifugo_monitoring.ts → cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_monitoring.ts} +13 -5
  63. package/src/generated/{cfg_accounts/_utils/fetchers/cfg_accounts__centrifugo__centrifugo_testing.ts → cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_testing.ts} +11 -3
  64. package/src/generated/cfg_centrifugo/_utils/fetchers/index.ts +39 -0
  65. package/src/generated/{cfg_accounts/_utils/hooks/cfg_accounts__centrifugo__centrifugo_admin_api.ts → cfg_centrifugo/_utils/hooks/centrifugo__centrifugo_admin_api.ts} +9 -1
  66. package/src/generated/{cfg_accounts/_utils/hooks/cfg_accounts__centrifugo__centrifugo_auth.ts → cfg_centrifugo/_utils/hooks/centrifugo__centrifugo_auth.ts} +9 -1
  67. package/src/generated/{cfg_accounts/_utils/hooks/cfg_accounts__centrifugo__centrifugo_monitoring.ts → cfg_centrifugo/_utils/hooks/centrifugo__centrifugo_monitoring.ts} +9 -1
  68. package/src/generated/{cfg_accounts/_utils/hooks/cfg_accounts__centrifugo__centrifugo_testing.ts → cfg_centrifugo/_utils/hooks/centrifugo__centrifugo_testing.ts} +9 -1
  69. package/src/generated/cfg_centrifugo/_utils/hooks/index.ts +39 -0
  70. package/src/generated/cfg_centrifugo/_utils/schemas/index.ts +61 -0
  71. package/src/generated/cfg_centrifugo/api-instance.ts +139 -0
  72. package/src/generated/{cfg_accounts/cfg_accounts__centrifugo__centrifugo_admin_api → cfg_centrifugo/centrifugo__centrifugo_admin_api}/client.ts +1 -1
  73. package/src/generated/cfg_centrifugo/centrifugo__centrifugo_admin_api/index.ts +10 -0
  74. package/src/generated/{cfg_accounts/cfg_accounts__centrifugo__centrifugo_admin_api → cfg_centrifugo/centrifugo__centrifugo_admin_api}/models.ts +8 -0
  75. package/src/generated/{cfg_accounts/cfg_accounts__centrifugo__centrifugo_auth → cfg_centrifugo/centrifugo__centrifugo_auth}/client.ts +1 -1
  76. package/src/generated/cfg_centrifugo/centrifugo__centrifugo_auth/index.ts +10 -0
  77. package/src/generated/{cfg_accounts/cfg_accounts__centrifugo__centrifugo_auth → cfg_centrifugo/centrifugo__centrifugo_auth}/models.ts +8 -0
  78. package/src/generated/{cfg_accounts/cfg_accounts__centrifugo__centrifugo_monitoring → cfg_centrifugo/centrifugo__centrifugo_monitoring}/client.ts +1 -1
  79. package/src/generated/cfg_centrifugo/centrifugo__centrifugo_monitoring/index.ts +10 -0
  80. package/src/generated/{cfg_accounts/cfg_accounts__centrifugo__centrifugo_monitoring → cfg_centrifugo/centrifugo__centrifugo_monitoring}/models.ts +8 -0
  81. package/src/generated/{cfg_accounts/cfg_accounts__centrifugo__centrifugo_testing → cfg_centrifugo/centrifugo__centrifugo_testing}/client.ts +1 -1
  82. package/src/generated/cfg_centrifugo/centrifugo__centrifugo_testing/index.ts +10 -0
  83. package/src/generated/{cfg_accounts/cfg_accounts__centrifugo__centrifugo_testing → cfg_centrifugo/centrifugo__centrifugo_testing}/models.ts +8 -0
  84. package/src/generated/cfg_centrifugo/client.ts +310 -0
  85. package/src/generated/cfg_centrifugo/errors.ts +124 -0
  86. package/src/generated/cfg_centrifugo/http.ts +111 -0
  87. package/src/generated/cfg_centrifugo/index.ts +301 -0
  88. package/src/generated/cfg_centrifugo/logger.ts +267 -0
  89. package/src/generated/cfg_centrifugo/retry.ts +183 -0
  90. package/src/generated/cfg_centrifugo/schema.json +2123 -0
  91. package/src/generated/cfg_centrifugo/storage.ts +169 -0
  92. package/src/generated/cfg_centrifugo/validation-events.ts +141 -0
  93. package/src/generated/cfg_webpush/_utils/fetchers/index.ts +36 -0
  94. package/src/generated/{cfg_accounts/_utils/fetchers/cfg_accounts__grpc__grpc_api_keys.ts → cfg_webpush/_utils/fetchers/webpush__web_push.ts} +45 -35
  95. package/src/generated/cfg_webpush/_utils/hooks/index.ts +36 -0
  96. package/src/generated/cfg_webpush/_utils/hooks/webpush__web_push.ts +86 -0
  97. package/src/generated/cfg_webpush/_utils/schemas/SendPushRequestRequest.schema.ts +22 -0
  98. package/src/generated/cfg_webpush/_utils/schemas/SendPushResponse.schema.ts +20 -0
  99. package/src/generated/cfg_webpush/_utils/schemas/SubscribeRequestRequest.schema.ts +20 -0
  100. package/src/generated/cfg_webpush/_utils/schemas/SubscribeResponse.schema.ts +21 -0
  101. package/src/generated/cfg_webpush/_utils/schemas/VapidPublicKeyResponse.schema.ts +19 -0
  102. package/src/generated/cfg_webpush/_utils/schemas/index.ts +31 -0
  103. package/src/generated/cfg_webpush/api-instance.ts +139 -0
  104. package/src/generated/cfg_webpush/client.ts +301 -0
  105. package/src/generated/cfg_webpush/errors.ts +124 -0
  106. package/src/generated/cfg_webpush/http.ts +111 -0
  107. package/src/generated/cfg_webpush/index.ts +280 -0
  108. package/src/generated/cfg_webpush/logger.ts +267 -0
  109. package/src/generated/cfg_webpush/retry.ts +183 -0
  110. package/src/generated/cfg_webpush/schema.json +302 -0
  111. package/src/generated/cfg_webpush/storage.ts +169 -0
  112. package/src/generated/cfg_webpush/validation-events.ts +141 -0
  113. package/src/generated/cfg_webpush/webpush__web_push/client.ts +45 -0
  114. package/src/generated/cfg_webpush/webpush__web_push/index.ts +10 -0
  115. package/src/generated/cfg_webpush/webpush__web_push/models.ts +72 -0
  116. package/src/hooks/accounts.ts +8 -0
  117. package/src/hooks/index.ts +10 -0
  118. package/src/hooks/webpush.ts +12 -0
  119. package/src/index.ts +11 -0
  120. package/src/server.ts +5 -8
  121. package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__dashboard__dashboard_activity.ts +0 -62
  122. package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__dashboard__dashboard_api_zones.ts +0 -106
  123. package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__dashboard__dashboard_charts.ts +0 -177
  124. package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__dashboard__dashboard_commands.ts +0 -179
  125. package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__dashboard__dashboard_config.ts +0 -92
  126. package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__dashboard__dashboard_overview.ts +0 -92
  127. package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__dashboard__dashboard_statistics.ts +0 -120
  128. package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__dashboard__dashboard_system.ts +0 -150
  129. package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__endpoints.ts +0 -164
  130. package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__grpc__grpc_configuration.ts +0 -150
  131. package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__grpc__grpc_monitoring.ts +0 -280
  132. package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__grpc__grpc_services.ts +0 -208
  133. package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__health.ts +0 -150
  134. package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__rq__rq_jobs.ts +0 -323
  135. package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__rq__rq_monitoring.ts +0 -164
  136. package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__rq__rq_queues.ts +0 -134
  137. package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__rq__rq_registries.ts +0 -436
  138. package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__rq__rq_schedules.ts +0 -266
  139. package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__rq__rq_testing.ts +0 -293
  140. package/src/generated/cfg_accounts/_utils/fetchers/cfg_accounts__rq__rq_workers.ts +0 -106
  141. package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__dashboard__dashboard_activity.ts +0 -50
  142. package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__dashboard__dashboard_api_zones.ts +0 -51
  143. package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__dashboard__dashboard_charts.ts +0 -79
  144. package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__dashboard__dashboard_commands.ts +0 -86
  145. package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__dashboard__dashboard_config.ts +0 -37
  146. package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__dashboard__dashboard_overview.ts +0 -37
  147. package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__dashboard__dashboard_statistics.ts +0 -65
  148. package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__dashboard__dashboard_system.ts +0 -52
  149. package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__endpoints.ts +0 -66
  150. package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__grpc__grpc_api_keys.ts +0 -67
  151. package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__grpc__grpc_configuration.ts +0 -52
  152. package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__grpc__grpc_monitoring.ts +0 -96
  153. package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__grpc__grpc_services.ts +0 -67
  154. package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__health.ts +0 -52
  155. package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__rq__rq_jobs.ts +0 -110
  156. package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__rq__rq_monitoring.ts +0 -66
  157. package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__rq__rq_queues.ts +0 -84
  158. package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__rq__rq_registries.ts +0 -136
  159. package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__rq__rq_schedules.ts +0 -92
  160. package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__rq__rq_testing.ts +0 -126
  161. package/src/generated/cfg_accounts/_utils/hooks/cfg_accounts__rq__rq_workers.ts +0 -51
  162. package/src/generated/cfg_accounts/_utils/schemas/APIZone.schema.ts +0 -29
  163. package/src/generated/cfg_accounts/_utils/schemas/APIZonesSummary.schema.ts +0 -22
  164. package/src/generated/cfg_accounts/_utils/schemas/ActivityEntry.schema.ts +0 -25
  165. package/src/generated/cfg_accounts/_utils/schemas/ActivityTrackerDay.schema.ts +0 -23
  166. package/src/generated/cfg_accounts/_utils/schemas/ApiKey.schema.ts +0 -30
  167. package/src/generated/cfg_accounts/_utils/schemas/ApiKeyStats.schema.ts +0 -22
  168. package/src/generated/cfg_accounts/_utils/schemas/AppStatistics.schema.ts +0 -21
  169. package/src/generated/cfg_accounts/_utils/schemas/AppStatisticsData.schema.ts +0 -23
  170. package/src/generated/cfg_accounts/_utils/schemas/AxesConfig.schema.ts +0 -35
  171. package/src/generated/cfg_accounts/_utils/schemas/CentrifugoConfig.schema.ts +0 -35
  172. package/src/generated/cfg_accounts/_utils/schemas/ChartData.schema.ts +0 -21
  173. package/src/generated/cfg_accounts/_utils/schemas/ChartDataset.schema.ts +0 -24
  174. package/src/generated/cfg_accounts/_utils/schemas/Command.schema.ts +0 -38
  175. package/src/generated/cfg_accounts/_utils/schemas/CommandCategory.schema.ts +0 -21
  176. package/src/generated/cfg_accounts/_utils/schemas/CommandExecuteRequestRequest.schema.ts +0 -21
  177. package/src/generated/cfg_accounts/_utils/schemas/CommandHelpResponse.schema.ts +0 -25
  178. package/src/generated/cfg_accounts/_utils/schemas/CommandsSummary.schema.ts +0 -26
  179. package/src/generated/cfg_accounts/_utils/schemas/ConfigData.schema.ts +0 -27
  180. package/src/generated/cfg_accounts/_utils/schemas/ConfigMeta.schema.ts +0 -20
  181. package/src/generated/cfg_accounts/_utils/schemas/ConfigValidation.schema.ts +0 -24
  182. package/src/generated/cfg_accounts/_utils/schemas/ConstanceConfig.schema.ts +0 -24
  183. package/src/generated/cfg_accounts/_utils/schemas/DRFConfig.schema.ts +0 -20
  184. package/src/generated/cfg_accounts/_utils/schemas/DRFHealthCheck.schema.ts +0 -25
  185. package/src/generated/cfg_accounts/_utils/schemas/DashboardOverview.schema.ts +0 -35
  186. package/src/generated/cfg_accounts/_utils/schemas/DatabaseConfig.schema.ts +0 -31
  187. package/src/generated/cfg_accounts/_utils/schemas/DjangoConfig.schema.ts +0 -93
  188. package/src/generated/cfg_accounts/_utils/schemas/DjangoRQConfig.schema.ts +0 -27
  189. package/src/generated/cfg_accounts/_utils/schemas/EmailConfig.schema.ts +0 -28
  190. package/src/generated/cfg_accounts/_utils/schemas/Endpoint.schema.ts +0 -35
  191. package/src/generated/cfg_accounts/_utils/schemas/EndpointsStatus.schema.ts +0 -28
  192. package/src/generated/cfg_accounts/_utils/schemas/GRPCConfig.schema.ts +0 -26
  193. package/src/generated/cfg_accounts/_utils/schemas/GRPCConfigDashboard.schema.ts +0 -33
  194. package/src/generated/cfg_accounts/_utils/schemas/GRPCFeatures.schema.ts +0 -22
  195. package/src/generated/cfg_accounts/_utils/schemas/GRPCFrameworkConfig.schema.ts +0 -22
  196. package/src/generated/cfg_accounts/_utils/schemas/GRPCHealthCheck.schema.ts +0 -23
  197. package/src/generated/cfg_accounts/_utils/schemas/GRPCInterceptorInfo.schema.ts +0 -20
  198. package/src/generated/cfg_accounts/_utils/schemas/GRPCOverviewStats.schema.ts +0 -29
  199. package/src/generated/cfg_accounts/_utils/schemas/GRPCRegisteredService.schema.ts +0 -24
  200. package/src/generated/cfg_accounts/_utils/schemas/GRPCServerConfig.schema.ts +0 -23
  201. package/src/generated/cfg_accounts/_utils/schemas/GRPCServerInfo.schema.ts +0 -28
  202. package/src/generated/cfg_accounts/_utils/schemas/GRPCServerStatus.schema.ts +0 -30
  203. package/src/generated/cfg_accounts/_utils/schemas/GRPCServiceInfo.schema.ts +0 -22
  204. package/src/generated/cfg_accounts/_utils/schemas/GRPCServiceRegistryMethodStats.schema.ts +0 -26
  205. package/src/generated/cfg_accounts/_utils/schemas/GRPCStats.schema.ts +0 -21
  206. package/src/generated/cfg_accounts/_utils/schemas/GitHubOAuthConfig.schema.ts +0 -30
  207. package/src/generated/cfg_accounts/_utils/schemas/JWTConfig.schema.ts +0 -21
  208. package/src/generated/cfg_accounts/_utils/schemas/JobActionResponse.schema.ts +0 -26
  209. package/src/generated/cfg_accounts/_utils/schemas/JobDetail.schema.ts +0 -40
  210. package/src/generated/cfg_accounts/_utils/schemas/JobList.schema.ts +0 -28
  211. package/src/generated/cfg_accounts/_utils/schemas/JobListRequest.schema.ts +0 -28
  212. package/src/generated/cfg_accounts/_utils/schemas/MethodInfo.schema.ts +0 -24
  213. package/src/generated/cfg_accounts/_utils/schemas/MethodList.schema.ts +0 -21
  214. package/src/generated/cfg_accounts/_utils/schemas/MethodSummary.schema.ts +0 -25
  215. package/src/generated/cfg_accounts/_utils/schemas/ModelStatistics.schema.ts +0 -23
  216. package/src/generated/cfg_accounts/_utils/schemas/NextJSAdminConfig.schema.ts +0 -21
  217. package/src/generated/cfg_accounts/_utils/schemas/NgrokConfig.schema.ts +0 -22
  218. package/src/generated/cfg_accounts/_utils/schemas/OpenAPIClientConfig.schema.ts +0 -26
  219. package/src/generated/cfg_accounts/_utils/schemas/PaginatedApiKeyList.schema.ts +0 -24
  220. package/src/generated/cfg_accounts/_utils/schemas/PaginatedJobListList.schema.ts +0 -24
  221. package/src/generated/cfg_accounts/_utils/schemas/PaginatedRecentRequestList.schema.ts +0 -24
  222. package/src/generated/cfg_accounts/_utils/schemas/PaginatedScheduledJobList.schema.ts +0 -24
  223. package/src/generated/cfg_accounts/_utils/schemas/PaginatedServiceSummaryList.schema.ts +0 -24
  224. package/src/generated/cfg_accounts/_utils/schemas/PaymentsConfig.schema.ts +0 -21
  225. package/src/generated/cfg_accounts/_utils/schemas/PaymentsNowPayments.schema.ts +0 -22
  226. package/src/generated/cfg_accounts/_utils/schemas/QueueDetail.schema.ts +0 -34
  227. package/src/generated/cfg_accounts/_utils/schemas/QueueStats.schema.ts +0 -31
  228. package/src/generated/cfg_accounts/_utils/schemas/QuickAction.schema.ts +0 -29
  229. package/src/generated/cfg_accounts/_utils/schemas/QuickHealth.schema.ts +0 -21
  230. package/src/generated/cfg_accounts/_utils/schemas/RQConfig.schema.ts +0 -30
  231. package/src/generated/cfg_accounts/_utils/schemas/RQHealthCheck.schema.ts +0 -31
  232. package/src/generated/cfg_accounts/_utils/schemas/RQSchedule.schema.ts +0 -26
  233. package/src/generated/cfg_accounts/_utils/schemas/RecentError.schema.ts +0 -22
  234. package/src/generated/cfg_accounts/_utils/schemas/RecentRequest.schema.ts +0 -33
  235. package/src/generated/cfg_accounts/_utils/schemas/RecentUser.schema.ts +0 -26
  236. package/src/generated/cfg_accounts/_utils/schemas/RedisQueueConfig.schema.ts +0 -29
  237. package/src/generated/cfg_accounts/_utils/schemas/RunDemoRequestRequest.schema.ts +0 -24
  238. package/src/generated/cfg_accounts/_utils/schemas/ScheduleActionResponse.schema.ts +0 -22
  239. package/src/generated/cfg_accounts/_utils/schemas/ScheduleCreateRequest.schema.ts +0 -39
  240. package/src/generated/cfg_accounts/_utils/schemas/ScheduleInfo.schema.ts +0 -27
  241. package/src/generated/cfg_accounts/_utils/schemas/ScheduledJob.schema.ts +0 -32
  242. package/src/generated/cfg_accounts/_utils/schemas/ServiceDetail.schema.ts +0 -31
  243. package/src/generated/cfg_accounts/_utils/schemas/ServiceMethods.schema.ts +0 -22
  244. package/src/generated/cfg_accounts/_utils/schemas/ServiceStats.schema.ts +0 -24
  245. package/src/generated/cfg_accounts/_utils/schemas/ServiceSummary.schema.ts +0 -26
  246. package/src/generated/cfg_accounts/_utils/schemas/SpectacularConfig.schema.ts +0 -21
  247. package/src/generated/cfg_accounts/_utils/schemas/StatCard.schema.ts +0 -30
  248. package/src/generated/cfg_accounts/_utils/schemas/StressTestRequestRequest.schema.ts +0 -23
  249. package/src/generated/cfg_accounts/_utils/schemas/SystemHealth.schema.ts +0 -24
  250. package/src/generated/cfg_accounts/_utils/schemas/SystemHealthItem.schema.ts +0 -28
  251. package/src/generated/cfg_accounts/_utils/schemas/SystemMetrics.schema.ts +0 -25
  252. package/src/generated/cfg_accounts/_utils/schemas/TelegramConfig.schema.ts +0 -28
  253. package/src/generated/cfg_accounts/_utils/schemas/TestScenario.schema.ts +0 -25
  254. package/src/generated/cfg_accounts/_utils/schemas/TestingActionResponse.schema.ts +0 -23
  255. package/src/generated/cfg_accounts/_utils/schemas/URLPattern.schema.ts +0 -26
  256. package/src/generated/cfg_accounts/_utils/schemas/URLsList.schema.ts +0 -25
  257. package/src/generated/cfg_accounts/_utils/schemas/UserStatistics.schema.ts +0 -22
  258. package/src/generated/cfg_accounts/_utils/schemas/Worker.schema.ts +0 -31
  259. package/src/generated/cfg_accounts/_utils/schemas/WorkerStats.schema.ts +0 -31
  260. package/src/generated/cfg_accounts/_utils/schemas/ZonesSummaryStats.schema.ts +0 -21
  261. package/src/generated/cfg_accounts/cfg_accounts__accounts/index.ts +0 -2
  262. package/src/generated/cfg_accounts/cfg_accounts__accounts__auth/index.ts +0 -2
  263. package/src/generated/cfg_accounts/cfg_accounts__accounts__auth/models.ts +0 -17
  264. package/src/generated/cfg_accounts/cfg_accounts__accounts__oauth/index.ts +0 -2
  265. package/src/generated/cfg_accounts/cfg_accounts__accounts__user_profile/index.ts +0 -2
  266. package/src/generated/cfg_accounts/cfg_accounts__centrifugo__centrifugo_admin_api/index.ts +0 -2
  267. package/src/generated/cfg_accounts/cfg_accounts__centrifugo__centrifugo_auth/index.ts +0 -2
  268. package/src/generated/cfg_accounts/cfg_accounts__centrifugo__centrifugo_monitoring/index.ts +0 -2
  269. package/src/generated/cfg_accounts/cfg_accounts__centrifugo__centrifugo_testing/index.ts +0 -2
  270. package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_activity/client.ts +0 -45
  271. package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_activity/index.ts +0 -2
  272. package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_activity/models.ts +0 -0
  273. package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_api_zones/client.ts +0 -34
  274. package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_api_zones/index.ts +0 -2
  275. package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_api_zones/models.ts +0 -40
  276. package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_charts/client.ts +0 -98
  277. package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_charts/index.ts +0 -2
  278. package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_charts/models.ts +0 -24
  279. package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_commands/client.ts +0 -55
  280. package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_commands/index.ts +0 -2
  281. package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_commands/models.ts +0 -80
  282. package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_config/client.ts +0 -25
  283. package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_config/index.ts +0 -2
  284. package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_config/models.ts +0 -412
  285. package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_overview/client.ts +0 -25
  286. package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_overview/index.ts +0 -2
  287. package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_overview/models.ts +0 -228
  288. package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_statistics/client.ts +0 -44
  289. package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_statistics/index.ts +0 -2
  290. package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_statistics/models.ts +0 -16
  291. package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_system/client.ts +0 -34
  292. package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_system/index.ts +0 -2
  293. package/src/generated/cfg_accounts/cfg_accounts__dashboard__dashboard_system/models.ts +0 -69
  294. package/src/generated/cfg_accounts/cfg_accounts__endpoints/client.ts +0 -42
  295. package/src/generated/cfg_accounts/cfg_accounts__endpoints/index.ts +0 -2
  296. package/src/generated/cfg_accounts/cfg_accounts__endpoints/models.ts +0 -112
  297. package/src/generated/cfg_accounts/cfg_accounts__grpc__grpc_api_keys/client.ts +0 -56
  298. package/src/generated/cfg_accounts/cfg_accounts__grpc__grpc_api_keys/index.ts +0 -2
  299. package/src/generated/cfg_accounts/cfg_accounts__grpc__grpc_api_keys/models.ts +0 -73
  300. package/src/generated/cfg_accounts/cfg_accounts__grpc__grpc_configuration/client.ts +0 -35
  301. package/src/generated/cfg_accounts/cfg_accounts__grpc__grpc_configuration/index.ts +0 -2
  302. package/src/generated/cfg_accounts/cfg_accounts__grpc__grpc_configuration/models.ts +0 -128
  303. package/src/generated/cfg_accounts/cfg_accounts__grpc__grpc_monitoring/client.ts +0 -109
  304. package/src/generated/cfg_accounts/cfg_accounts__grpc__grpc_monitoring/index.ts +0 -2
  305. package/src/generated/cfg_accounts/cfg_accounts__grpc__grpc_monitoring/models.ts +0 -213
  306. package/src/generated/cfg_accounts/cfg_accounts__grpc__grpc_services/client.ts +0 -56
  307. package/src/generated/cfg_accounts/cfg_accounts__grpc__grpc_services/index.ts +0 -2
  308. package/src/generated/cfg_accounts/cfg_accounts__grpc__grpc_services/models.ts +0 -189
  309. package/src/generated/cfg_accounts/cfg_accounts__health/client.ts +0 -30
  310. package/src/generated/cfg_accounts/cfg_accounts__health/index.ts +0 -2
  311. package/src/generated/cfg_accounts/cfg_accounts__health/models.ts +0 -36
  312. package/src/generated/cfg_accounts/cfg_accounts__rq__rq_jobs/client.ts +0 -76
  313. package/src/generated/cfg_accounts/cfg_accounts__rq__rq_jobs/index.ts +0 -2
  314. package/src/generated/cfg_accounts/cfg_accounts__rq__rq_jobs/models.ts +0 -127
  315. package/src/generated/cfg_accounts/cfg_accounts__rq__rq_monitoring/client.ts +0 -45
  316. package/src/generated/cfg_accounts/cfg_accounts__rq__rq_monitoring/index.ts +0 -2
  317. package/src/generated/cfg_accounts/cfg_accounts__rq__rq_monitoring/models.ts +0 -66
  318. package/src/generated/cfg_accounts/cfg_accounts__rq__rq_queues/client.ts +0 -78
  319. package/src/generated/cfg_accounts/cfg_accounts__rq__rq_queues/index.ts +0 -2
  320. package/src/generated/cfg_accounts/cfg_accounts__rq__rq_queues/models.ts +0 -33
  321. package/src/generated/cfg_accounts/cfg_accounts__rq__rq_registries/client.ts +0 -164
  322. package/src/generated/cfg_accounts/cfg_accounts__rq__rq_registries/index.ts +0 -2
  323. package/src/generated/cfg_accounts/cfg_accounts__rq__rq_registries/models.ts +0 -82
  324. package/src/generated/cfg_accounts/cfg_accounts__rq__rq_schedules/client.ts +0 -91
  325. package/src/generated/cfg_accounts/cfg_accounts__rq__rq_schedules/index.ts +0 -2
  326. package/src/generated/cfg_accounts/cfg_accounts__rq__rq_schedules/models.ts +0 -109
  327. package/src/generated/cfg_accounts/cfg_accounts__rq__rq_testing/client.ts +0 -96
  328. package/src/generated/cfg_accounts/cfg_accounts__rq__rq_testing/index.ts +0 -2
  329. package/src/generated/cfg_accounts/cfg_accounts__rq__rq_testing/models.ts +0 -68
  330. package/src/generated/cfg_accounts/cfg_accounts__rq__rq_workers/client.ts +0 -46
  331. package/src/generated/cfg_accounts/cfg_accounts__rq__rq_workers/index.ts +0 -2
  332. package/src/generated/cfg_accounts/cfg_accounts__rq__rq_workers/models.ts +0 -52
  333. /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoChannelInfo.schema.ts +0 -0
  334. /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoChannelsRequestRequest.schema.ts +0 -0
  335. /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoChannelsResponse.schema.ts +0 -0
  336. /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoChannelsResult.schema.ts +0 -0
  337. /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoClientInfo.schema.ts +0 -0
  338. /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoError.schema.ts +0 -0
  339. /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoHealthCheck.schema.ts +0 -0
  340. /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoHistoryRequestRequest.schema.ts +0 -0
  341. /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoHistoryResponse.schema.ts +0 -0
  342. /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoHistoryResult.schema.ts +0 -0
  343. /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoInfoResponse.schema.ts +0 -0
  344. /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoInfoResult.schema.ts +0 -0
  345. /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoMetrics.schema.ts +0 -0
  346. /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoNodeInfo.schema.ts +0 -0
  347. /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoOverviewStats.schema.ts +0 -0
  348. /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoPresenceRequestRequest.schema.ts +0 -0
  349. /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoPresenceResponse.schema.ts +0 -0
  350. /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoPresenceResult.schema.ts +0 -0
  351. /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoPresenceStatsRequestRequest.schema.ts +0 -0
  352. /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoPresenceStatsResponse.schema.ts +0 -0
  353. /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoPresenceStatsResult.schema.ts +0 -0
  354. /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoProcess.schema.ts +0 -0
  355. /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoPublication.schema.ts +0 -0
  356. /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/CentrifugoStreamPosition.schema.ts +0 -0
  357. /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/ChannelList.schema.ts +0 -0
  358. /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/ChannelStats.schema.ts +0 -0
  359. /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/ConnectionTokenResponse.schema.ts +0 -0
  360. /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/ManualAckRequestRequest.schema.ts +0 -0
  361. /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/ManualAckResponse.schema.ts +0 -0
  362. /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/PaginatedPublishList.schema.ts +0 -0
  363. /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/Publish.schema.ts +0 -0
  364. /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/PublishTestRequestRequest.schema.ts +0 -0
  365. /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/PublishTestResponse.schema.ts +0 -0
  366. /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/TimelineItem.schema.ts +0 -0
  367. /package/src/generated/{cfg_accounts → cfg_centrifugo}/_utils/schemas/TimelineResponse.schema.ts +0 -0
@@ -0,0 +1,4957 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+ var __export = (target, all) => {
4
+ for (var name in all)
5
+ __defProp(target, name, { get: all[name], enumerable: true });
6
+ };
7
+
8
+ // src/generated/cfg_accounts/accounts__auth/client.ts
9
+ var Auth = class {
10
+ static {
11
+ __name(this, "Auth");
12
+ }
13
+ constructor(client) {
14
+ this.client = client;
15
+ }
16
+ /**
17
+ * Refresh JWT token.
18
+ */
19
+ async accountsTokenRefreshCreate(data) {
20
+ const response = await this.client.request("POST", "/cfg/accounts/token/refresh/", { body: data });
21
+ return response;
22
+ }
23
+ };
24
+
25
+ // src/generated/cfg_accounts/accounts__oauth/client.ts
26
+ var Oauth = class {
27
+ static {
28
+ __name(this, "Oauth");
29
+ }
30
+ constructor(client) {
31
+ this.client = client;
32
+ }
33
+ /**
34
+ * List OAuth connections
35
+ *
36
+ * Get all OAuth connections for the current user.
37
+ */
38
+ async accountsOauthConnectionsList() {
39
+ const response = await this.client.request("GET", "/cfg/accounts/oauth/connections/");
40
+ return response;
41
+ }
42
+ /**
43
+ * Disconnect OAuth provider
44
+ *
45
+ * Remove OAuth connection for the specified provider.
46
+ */
47
+ async accountsOauthDisconnectCreate(data) {
48
+ const response = await this.client.request("POST", "/cfg/accounts/oauth/disconnect/", { body: data });
49
+ return response;
50
+ }
51
+ /**
52
+ * Start GitHub OAuth
53
+ *
54
+ * Generate GitHub OAuth authorization URL. Redirect user to this URL to
55
+ * start authentication.
56
+ */
57
+ async accountsOauthGithubAuthorizeCreate(data) {
58
+ const response = await this.client.request("POST", "/cfg/accounts/oauth/github/authorize/", { body: data });
59
+ return response;
60
+ }
61
+ /**
62
+ * Complete GitHub OAuth
63
+ *
64
+ * Exchange authorization code for JWT tokens. Call this after GitHub
65
+ * redirects back with code.
66
+ */
67
+ async accountsOauthGithubCallbackCreate(data) {
68
+ const response = await this.client.request("POST", "/cfg/accounts/oauth/github/callback/", { body: data });
69
+ return response;
70
+ }
71
+ /**
72
+ * List OAuth providers
73
+ *
74
+ * Get list of available OAuth providers for authentication.
75
+ */
76
+ async accountsOauthProvidersRetrieve() {
77
+ const response = await this.client.request("GET", "/cfg/accounts/oauth/providers/");
78
+ return response;
79
+ }
80
+ };
81
+
82
+ // src/generated/cfg_accounts/accounts__user_profile/client.ts
83
+ var UserProfile = class {
84
+ static {
85
+ __name(this, "UserProfile");
86
+ }
87
+ constructor(client) {
88
+ this.client = client;
89
+ }
90
+ /**
91
+ * Get current user profile
92
+ *
93
+ * Retrieve the current authenticated user's profile information.
94
+ */
95
+ async accountsProfileRetrieve() {
96
+ const response = await this.client.request("GET", "/cfg/accounts/profile/");
97
+ return response;
98
+ }
99
+ /**
100
+ * Upload user avatar
101
+ *
102
+ * Upload avatar image for the current authenticated user. Accepts
103
+ * multipart/form-data with 'avatar' field.
104
+ */
105
+ async accountsProfileAvatarCreate(data) {
106
+ const response = await this.client.request("POST", "/cfg/accounts/profile/avatar/", { formData: data });
107
+ return response;
108
+ }
109
+ /**
110
+ * Partial update user profile
111
+ *
112
+ * Partially update the current authenticated user's profile information.
113
+ * Supports avatar upload.
114
+ */
115
+ async accountsProfilePartialUpdate(data) {
116
+ const response = await this.client.request("PUT", "/cfg/accounts/profile/partial/", { body: data });
117
+ return response;
118
+ }
119
+ /**
120
+ * Partial update user profile
121
+ *
122
+ * Partially update the current authenticated user's profile information.
123
+ * Supports avatar upload.
124
+ */
125
+ async accountsProfilePartialPartialUpdate(data) {
126
+ const response = await this.client.request("PATCH", "/cfg/accounts/profile/partial/", { body: data });
127
+ return response;
128
+ }
129
+ /**
130
+ * Update user profile
131
+ *
132
+ * Update the current authenticated user's profile information.
133
+ */
134
+ async accountsProfileUpdateUpdate(data) {
135
+ const response = await this.client.request("PUT", "/cfg/accounts/profile/update/", { body: data });
136
+ return response;
137
+ }
138
+ /**
139
+ * Update user profile
140
+ *
141
+ * Update the current authenticated user's profile information.
142
+ */
143
+ async accountsProfileUpdatePartialUpdate(data) {
144
+ const response = await this.client.request("PATCH", "/cfg/accounts/profile/update/", { body: data });
145
+ return response;
146
+ }
147
+ };
148
+
149
+ // src/generated/cfg_accounts/accounts/client.ts
150
+ var Accounts = class {
151
+ static {
152
+ __name(this, "Accounts");
153
+ }
154
+ constructor(client) {
155
+ this.client = client;
156
+ }
157
+ /**
158
+ * Request OTP code to email or phone.
159
+ */
160
+ async otpRequestCreate(data) {
161
+ const response = await this.client.request("POST", "/cfg/accounts/otp/request/", { body: data });
162
+ return response;
163
+ }
164
+ /**
165
+ * Verify OTP code and return JWT tokens.
166
+ */
167
+ async otpVerifyCreate(data) {
168
+ const response = await this.client.request("POST", "/cfg/accounts/otp/verify/", { body: data });
169
+ return response;
170
+ }
171
+ };
172
+
173
+ // src/generated/cfg_accounts/http.ts
174
+ var FetchAdapter = class {
175
+ static {
176
+ __name(this, "FetchAdapter");
177
+ }
178
+ async request(request) {
179
+ const { method, url, headers, body, params, formData } = request;
180
+ let finalUrl = url;
181
+ if (params) {
182
+ const searchParams = new URLSearchParams();
183
+ Object.entries(params).forEach(([key, value]) => {
184
+ if (value !== null && value !== void 0) {
185
+ searchParams.append(key, String(value));
186
+ }
187
+ });
188
+ const queryString = searchParams.toString();
189
+ if (queryString) {
190
+ finalUrl = url.includes("?") ? `${url}&${queryString}` : `${url}?${queryString}`;
191
+ }
192
+ }
193
+ const finalHeaders = { ...headers };
194
+ let requestBody;
195
+ if (formData) {
196
+ requestBody = formData;
197
+ } else if (body) {
198
+ finalHeaders["Content-Type"] = "application/json";
199
+ requestBody = JSON.stringify(body);
200
+ }
201
+ const response = await fetch(finalUrl, {
202
+ method,
203
+ headers: finalHeaders,
204
+ body: requestBody,
205
+ credentials: "include"
206
+ // Include Django session cookies
207
+ });
208
+ let data = null;
209
+ const contentType = response.headers.get("content-type");
210
+ if (response.status !== 204 && contentType?.includes("application/json")) {
211
+ data = await response.json();
212
+ } else if (response.status !== 204) {
213
+ data = await response.text();
214
+ }
215
+ const responseHeaders = {};
216
+ response.headers.forEach((value, key) => {
217
+ responseHeaders[key] = value;
218
+ });
219
+ return {
220
+ data,
221
+ status: response.status,
222
+ statusText: response.statusText,
223
+ headers: responseHeaders
224
+ };
225
+ }
226
+ };
227
+
228
+ // src/generated/cfg_accounts/errors.ts
229
+ var APIError = class extends Error {
230
+ constructor(statusCode, statusText, response, url, message) {
231
+ super(message || `HTTP ${statusCode}: ${statusText}`);
232
+ this.statusCode = statusCode;
233
+ this.statusText = statusText;
234
+ this.response = response;
235
+ this.url = url;
236
+ this.name = "APIError";
237
+ }
238
+ static {
239
+ __name(this, "APIError");
240
+ }
241
+ /**
242
+ * Get error details from response.
243
+ * DRF typically returns: { "detail": "Error message" } or { "field": ["error1", "error2"] }
244
+ */
245
+ get details() {
246
+ if (typeof this.response === "object" && this.response !== null) {
247
+ return this.response;
248
+ }
249
+ return null;
250
+ }
251
+ /**
252
+ * Get field-specific validation errors from DRF.
253
+ * Returns: { "field_name": ["error1", "error2"], ... }
254
+ */
255
+ get fieldErrors() {
256
+ const details = this.details;
257
+ if (!details) return null;
258
+ const fieldErrors = {};
259
+ for (const [key, value] of Object.entries(details)) {
260
+ if (Array.isArray(value)) {
261
+ fieldErrors[key] = value;
262
+ }
263
+ }
264
+ return Object.keys(fieldErrors).length > 0 ? fieldErrors : null;
265
+ }
266
+ /**
267
+ * Get single error message from DRF.
268
+ * Checks for "detail", "message", or first field error.
269
+ */
270
+ get errorMessage() {
271
+ const details = this.details;
272
+ if (!details) return this.message;
273
+ if (details.detail) {
274
+ return Array.isArray(details.detail) ? details.detail.join(", ") : String(details.detail);
275
+ }
276
+ if (details.message) {
277
+ return String(details.message);
278
+ }
279
+ const fieldErrors = this.fieldErrors;
280
+ if (fieldErrors) {
281
+ const firstField = Object.keys(fieldErrors)[0];
282
+ if (firstField) {
283
+ return `${firstField}: ${fieldErrors[firstField]?.join(", ")}`;
284
+ }
285
+ }
286
+ return this.message;
287
+ }
288
+ // Helper methods for common HTTP status codes
289
+ get isValidationError() {
290
+ return this.statusCode === 400;
291
+ }
292
+ get isAuthError() {
293
+ return this.statusCode === 401;
294
+ }
295
+ get isPermissionError() {
296
+ return this.statusCode === 403;
297
+ }
298
+ get isNotFoundError() {
299
+ return this.statusCode === 404;
300
+ }
301
+ get isServerError() {
302
+ return this.statusCode >= 500 && this.statusCode < 600;
303
+ }
304
+ };
305
+ var NetworkError = class extends Error {
306
+ constructor(message, url, originalError) {
307
+ super(message);
308
+ this.url = url;
309
+ this.originalError = originalError;
310
+ this.name = "NetworkError";
311
+ }
312
+ static {
313
+ __name(this, "NetworkError");
314
+ }
315
+ };
316
+
317
+ // src/generated/cfg_accounts/logger.ts
318
+ import { createConsola } from "consola";
319
+ var DEFAULT_CONFIG = {
320
+ enabled: process.env.NODE_ENV !== "production",
321
+ logRequests: true,
322
+ logResponses: true,
323
+ logErrors: true,
324
+ logBodies: true,
325
+ logHeaders: false
326
+ };
327
+ var SENSITIVE_HEADERS = [
328
+ "authorization",
329
+ "cookie",
330
+ "set-cookie",
331
+ "x-api-key",
332
+ "x-csrf-token"
333
+ ];
334
+ var APILogger = class {
335
+ static {
336
+ __name(this, "APILogger");
337
+ }
338
+ constructor(config = {}) {
339
+ this.config = { ...DEFAULT_CONFIG, ...config };
340
+ this.consola = config.consola || createConsola({
341
+ level: this.config.enabled ? 4 : 0
342
+ });
343
+ }
344
+ /**
345
+ * Enable logging
346
+ */
347
+ enable() {
348
+ this.config.enabled = true;
349
+ }
350
+ /**
351
+ * Disable logging
352
+ */
353
+ disable() {
354
+ this.config.enabled = false;
355
+ }
356
+ /**
357
+ * Update configuration
358
+ */
359
+ setConfig(config) {
360
+ this.config = { ...this.config, ...config };
361
+ }
362
+ /**
363
+ * Filter sensitive headers
364
+ */
365
+ filterHeaders(headers) {
366
+ if (!headers) return {};
367
+ const filtered = {};
368
+ Object.keys(headers).forEach((key) => {
369
+ const lowerKey = key.toLowerCase();
370
+ if (SENSITIVE_HEADERS.includes(lowerKey)) {
371
+ filtered[key] = "***";
372
+ } else {
373
+ filtered[key] = headers[key] || "";
374
+ }
375
+ });
376
+ return filtered;
377
+ }
378
+ /**
379
+ * Log request
380
+ */
381
+ logRequest(request) {
382
+ if (!this.config.enabled || !this.config.logRequests) return;
383
+ const { method, url, headers, body } = request;
384
+ this.consola.start(`${method} ${url}`);
385
+ if (this.config.logHeaders && headers) {
386
+ this.consola.debug("Headers:", this.filterHeaders(headers));
387
+ }
388
+ if (this.config.logBodies && body) {
389
+ this.consola.debug("Body:", body);
390
+ }
391
+ }
392
+ /**
393
+ * Log response
394
+ */
395
+ logResponse(request, response) {
396
+ if (!this.config.enabled || !this.config.logResponses) return;
397
+ const { method, url } = request;
398
+ const { status, statusText, data, duration } = response;
399
+ const statusColor = status >= 500 ? "red" : status >= 400 ? "yellow" : status >= 300 ? "cyan" : "green";
400
+ this.consola.success(
401
+ `${method} ${url} ${status} ${statusText} (${duration}ms)`
402
+ );
403
+ if (this.config.logBodies && data) {
404
+ this.consola.debug("Response:", data);
405
+ }
406
+ }
407
+ /**
408
+ * Log error
409
+ */
410
+ logError(request, error) {
411
+ if (!this.config.enabled || !this.config.logErrors) return;
412
+ const { method, url } = request;
413
+ const { message, statusCode, fieldErrors, duration } = error;
414
+ this.consola.error(
415
+ `${method} ${url} ${statusCode || "Network"} Error (${duration}ms)`
416
+ );
417
+ this.consola.error("Message:", message);
418
+ if (fieldErrors && Object.keys(fieldErrors).length > 0) {
419
+ this.consola.error("Field Errors:");
420
+ Object.entries(fieldErrors).forEach(([field, errors]) => {
421
+ errors.forEach((err) => {
422
+ this.consola.error(` \u2022 ${field}: ${err}`);
423
+ });
424
+ });
425
+ }
426
+ }
427
+ /**
428
+ * Log general info
429
+ */
430
+ info(message, ...args) {
431
+ if (!this.config.enabled) return;
432
+ this.consola.info(message, ...args);
433
+ }
434
+ /**
435
+ * Log warning
436
+ */
437
+ warn(message, ...args) {
438
+ if (!this.config.enabled) return;
439
+ this.consola.warn(message, ...args);
440
+ }
441
+ /**
442
+ * Log error
443
+ */
444
+ error(message, ...args) {
445
+ if (!this.config.enabled) return;
446
+ this.consola.error(message, ...args);
447
+ }
448
+ /**
449
+ * Log debug
450
+ */
451
+ debug(message, ...args) {
452
+ if (!this.config.enabled) return;
453
+ this.consola.debug(message, ...args);
454
+ }
455
+ /**
456
+ * Log success
457
+ */
458
+ success(message, ...args) {
459
+ if (!this.config.enabled) return;
460
+ this.consola.success(message, ...args);
461
+ }
462
+ /**
463
+ * Create a sub-logger with prefix
464
+ */
465
+ withTag(tag) {
466
+ return this.consola.withTag(tag);
467
+ }
468
+ };
469
+ var defaultLogger = new APILogger();
470
+
471
+ // src/generated/cfg_accounts/retry.ts
472
+ import pRetry, { AbortError } from "p-retry";
473
+ var DEFAULT_RETRY_CONFIG = {
474
+ retries: 3,
475
+ factor: 2,
476
+ minTimeout: 1e3,
477
+ maxTimeout: 6e4,
478
+ randomize: true,
479
+ onFailedAttempt: /* @__PURE__ */ __name(() => {
480
+ }, "onFailedAttempt")
481
+ };
482
+ function shouldRetry(error) {
483
+ if (error instanceof NetworkError) {
484
+ return true;
485
+ }
486
+ if (error instanceof APIError) {
487
+ const status = error.statusCode;
488
+ if (status >= 500 && status < 600) {
489
+ return true;
490
+ }
491
+ if (status === 429) {
492
+ return true;
493
+ }
494
+ return false;
495
+ }
496
+ return true;
497
+ }
498
+ __name(shouldRetry, "shouldRetry");
499
+ async function withRetry(fn, config) {
500
+ const finalConfig = { ...DEFAULT_RETRY_CONFIG, ...config };
501
+ return pRetry(
502
+ async () => {
503
+ try {
504
+ return await fn();
505
+ } catch (error) {
506
+ if (!shouldRetry(error)) {
507
+ throw new AbortError(error);
508
+ }
509
+ throw error;
510
+ }
511
+ },
512
+ {
513
+ retries: finalConfig.retries,
514
+ factor: finalConfig.factor,
515
+ minTimeout: finalConfig.minTimeout,
516
+ maxTimeout: finalConfig.maxTimeout,
517
+ randomize: finalConfig.randomize,
518
+ onFailedAttempt: finalConfig.onFailedAttempt ? (error) => {
519
+ const pRetryError = error;
520
+ finalConfig.onFailedAttempt({
521
+ error: pRetryError,
522
+ attemptNumber: pRetryError.attemptNumber,
523
+ retriesLeft: pRetryError.retriesLeft
524
+ });
525
+ } : void 0
526
+ }
527
+ );
528
+ }
529
+ __name(withRetry, "withRetry");
530
+
531
+ // src/generated/cfg_accounts/client.ts
532
+ var APIClient = class {
533
+ constructor(baseUrl, options) {
534
+ this.logger = null;
535
+ this.retryConfig = null;
536
+ this.baseUrl = baseUrl.replace(/\/$/, "");
537
+ this.httpClient = options?.httpClient || new FetchAdapter();
538
+ if (options?.loggerConfig !== void 0) {
539
+ this.logger = new APILogger(options.loggerConfig);
540
+ }
541
+ if (options?.retryConfig !== void 0) {
542
+ this.retryConfig = options.retryConfig;
543
+ }
544
+ this.auth = new Auth(this);
545
+ this.oauth = new Oauth(this);
546
+ this.user_profile = new UserProfile(this);
547
+ this.accounts = new Accounts(this);
548
+ }
549
+ static {
550
+ __name(this, "APIClient");
551
+ }
552
+ /**
553
+ * Get CSRF token from cookies (for SessionAuthentication).
554
+ *
555
+ * Returns null if cookie doesn't exist (JWT-only auth).
556
+ */
557
+ getCsrfToken() {
558
+ const name = "csrftoken";
559
+ const value = `; ${document.cookie}`;
560
+ const parts = value.split(`; ${name}=`);
561
+ if (parts.length === 2) {
562
+ return parts.pop()?.split(";").shift() || null;
563
+ }
564
+ return null;
565
+ }
566
+ /**
567
+ * Make HTTP request with Django CSRF and session handling.
568
+ * Automatically retries on network errors and 5xx server errors.
569
+ */
570
+ async request(method, path, options) {
571
+ if (this.retryConfig) {
572
+ return withRetry(() => this._makeRequest(method, path, options), {
573
+ ...this.retryConfig,
574
+ onFailedAttempt: /* @__PURE__ */ __name((info) => {
575
+ if (this.logger) {
576
+ this.logger.warn(
577
+ `Retry attempt ${info.attemptNumber}/${info.retriesLeft + info.attemptNumber} for ${method} ${path}: ${info.error.message}`
578
+ );
579
+ }
580
+ this.retryConfig?.onFailedAttempt?.(info);
581
+ }, "onFailedAttempt")
582
+ });
583
+ }
584
+ return this._makeRequest(method, path, options);
585
+ }
586
+ /**
587
+ * Internal request method (without retry wrapper).
588
+ * Used by request() method with optional retry logic.
589
+ */
590
+ async _makeRequest(method, path, options) {
591
+ const url = this.baseUrl ? `${this.baseUrl}${path}` : path;
592
+ const startTime = Date.now();
593
+ const headers = {
594
+ ...options?.headers || {}
595
+ };
596
+ if (!options?.formData && !headers["Content-Type"]) {
597
+ headers["Content-Type"] = "application/json";
598
+ }
599
+ if (this.logger) {
600
+ this.logger.logRequest({
601
+ method,
602
+ url,
603
+ headers,
604
+ body: options?.formData || options?.body,
605
+ timestamp: startTime
606
+ });
607
+ }
608
+ try {
609
+ const response = await this.httpClient.request({
610
+ method,
611
+ url,
612
+ headers,
613
+ params: options?.params,
614
+ body: options?.body,
615
+ formData: options?.formData
616
+ });
617
+ const duration = Date.now() - startTime;
618
+ if (response.status >= 400) {
619
+ const error = new APIError(
620
+ response.status,
621
+ response.statusText,
622
+ response.data,
623
+ url
624
+ );
625
+ if (this.logger) {
626
+ this.logger.logError(
627
+ {
628
+ method,
629
+ url,
630
+ headers,
631
+ body: options?.formData || options?.body,
632
+ timestamp: startTime
633
+ },
634
+ {
635
+ message: error.message,
636
+ statusCode: response.status,
637
+ duration,
638
+ timestamp: Date.now()
639
+ }
640
+ );
641
+ }
642
+ throw error;
643
+ }
644
+ if (this.logger) {
645
+ this.logger.logResponse(
646
+ {
647
+ method,
648
+ url,
649
+ headers,
650
+ body: options?.formData || options?.body,
651
+ timestamp: startTime
652
+ },
653
+ {
654
+ status: response.status,
655
+ statusText: response.statusText,
656
+ data: response.data,
657
+ duration,
658
+ timestamp: Date.now()
659
+ }
660
+ );
661
+ }
662
+ return response.data;
663
+ } catch (error) {
664
+ const duration = Date.now() - startTime;
665
+ if (error instanceof APIError) {
666
+ throw error;
667
+ }
668
+ const isCORSError = error instanceof TypeError && (error.message.toLowerCase().includes("cors") || error.message.toLowerCase().includes("failed to fetch") || error.message.toLowerCase().includes("network request failed"));
669
+ if (this.logger) {
670
+ if (isCORSError) {
671
+ this.logger.error(`\u{1F6AB} CORS Error: ${method} ${url}`);
672
+ this.logger.error(` \u2192 ${error instanceof Error ? error.message : String(error)}`);
673
+ this.logger.error(` \u2192 Configure security_domains parameter on the server`);
674
+ } else {
675
+ this.logger.error(`\u26A0\uFE0F Network Error: ${method} ${url}`);
676
+ this.logger.error(` \u2192 ${error instanceof Error ? error.message : String(error)}`);
677
+ }
678
+ }
679
+ if (typeof window !== "undefined") {
680
+ try {
681
+ if (isCORSError) {
682
+ window.dispatchEvent(new CustomEvent("cors-error", {
683
+ detail: {
684
+ url,
685
+ method,
686
+ error: error instanceof Error ? error.message : String(error),
687
+ timestamp: /* @__PURE__ */ new Date()
688
+ },
689
+ bubbles: true,
690
+ cancelable: false
691
+ }));
692
+ } else {
693
+ window.dispatchEvent(new CustomEvent("network-error", {
694
+ detail: {
695
+ url,
696
+ method,
697
+ error: error instanceof Error ? error.message : String(error),
698
+ timestamp: /* @__PURE__ */ new Date()
699
+ },
700
+ bubbles: true,
701
+ cancelable: false
702
+ }));
703
+ }
704
+ } catch (eventError) {
705
+ }
706
+ }
707
+ const networkError = error instanceof Error ? new NetworkError(error.message, url, error) : new NetworkError("Unknown error", url);
708
+ if (this.logger) {
709
+ this.logger.logError(
710
+ {
711
+ method,
712
+ url,
713
+ headers,
714
+ body: options?.formData || options?.body,
715
+ timestamp: startTime
716
+ },
717
+ {
718
+ message: networkError.message,
719
+ duration,
720
+ timestamp: Date.now()
721
+ }
722
+ );
723
+ }
724
+ throw networkError;
725
+ }
726
+ }
727
+ };
728
+
729
+ // src/generated/cfg_accounts/storage.ts
730
+ var LocalStorageAdapter = class {
731
+ static {
732
+ __name(this, "LocalStorageAdapter");
733
+ }
734
+ constructor(logger) {
735
+ this.logger = logger;
736
+ }
737
+ getItem(key) {
738
+ try {
739
+ if (typeof window !== "undefined" && window.localStorage) {
740
+ const value = localStorage.getItem(key);
741
+ this.logger?.debug(`LocalStorage.getItem("${key}"): ${value ? "found" : "not found"}`);
742
+ return value;
743
+ }
744
+ this.logger?.warn("LocalStorage not available: window.localStorage is undefined");
745
+ } catch (error) {
746
+ this.logger?.error("LocalStorage.getItem failed:", error);
747
+ }
748
+ return null;
749
+ }
750
+ setItem(key, value) {
751
+ try {
752
+ if (typeof window !== "undefined" && window.localStorage) {
753
+ localStorage.setItem(key, value);
754
+ this.logger?.debug(`LocalStorage.setItem("${key}"): success`);
755
+ } else {
756
+ this.logger?.warn("LocalStorage not available: window.localStorage is undefined");
757
+ }
758
+ } catch (error) {
759
+ this.logger?.error("LocalStorage.setItem failed:", error);
760
+ }
761
+ }
762
+ removeItem(key) {
763
+ try {
764
+ if (typeof window !== "undefined" && window.localStorage) {
765
+ localStorage.removeItem(key);
766
+ this.logger?.debug(`LocalStorage.removeItem("${key}"): success`);
767
+ } else {
768
+ this.logger?.warn("LocalStorage not available: window.localStorage is undefined");
769
+ }
770
+ } catch (error) {
771
+ this.logger?.error("LocalStorage.removeItem failed:", error);
772
+ }
773
+ }
774
+ };
775
+
776
+ // src/generated/cfg_accounts/enums.ts
777
+ var enums_exports = {};
778
+ __export(enums_exports, {
779
+ OAuthConnectionProvider: () => OAuthConnectionProvider,
780
+ OAuthDisconnectRequestRequestProvider: () => OAuthDisconnectRequestRequestProvider,
781
+ OTPRequestRequestChannel: () => OTPRequestRequestChannel,
782
+ OTPVerifyRequestChannel: () => OTPVerifyRequestChannel
783
+ });
784
+ var OAuthConnectionProvider = /* @__PURE__ */ ((OAuthConnectionProvider2) => {
785
+ OAuthConnectionProvider2["GITHUB"] = "github";
786
+ return OAuthConnectionProvider2;
787
+ })(OAuthConnectionProvider || {});
788
+ var OAuthDisconnectRequestRequestProvider = /* @__PURE__ */ ((OAuthDisconnectRequestRequestProvider2) => {
789
+ OAuthDisconnectRequestRequestProvider2["GITHUB"] = "github";
790
+ return OAuthDisconnectRequestRequestProvider2;
791
+ })(OAuthDisconnectRequestRequestProvider || {});
792
+ var OTPRequestRequestChannel = /* @__PURE__ */ ((OTPRequestRequestChannel2) => {
793
+ OTPRequestRequestChannel2["EMAIL"] = "email";
794
+ OTPRequestRequestChannel2["PHONE"] = "phone";
795
+ return OTPRequestRequestChannel2;
796
+ })(OTPRequestRequestChannel || {});
797
+ var OTPVerifyRequestChannel = /* @__PURE__ */ ((OTPVerifyRequestChannel2) => {
798
+ OTPVerifyRequestChannel2["EMAIL"] = "email";
799
+ OTPVerifyRequestChannel2["PHONE"] = "phone";
800
+ return OTPVerifyRequestChannel2;
801
+ })(OTPVerifyRequestChannel || {});
802
+
803
+ // src/generated/cfg_accounts/_utils/schemas/CentrifugoToken.schema.ts
804
+ import { z } from "zod";
805
+ var CentrifugoTokenSchema = z.object({
806
+ token: z.string(),
807
+ centrifugo_url: z.url(),
808
+ expires_at: z.iso.datetime(),
809
+ channels: z.array(z.string())
810
+ });
811
+
812
+ // src/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeRequestRequest.schema.ts
813
+ import { z as z2 } from "zod";
814
+ var OAuthAuthorizeRequestRequestSchema = z2.object({
815
+ redirect_uri: z2.url().optional(),
816
+ source_url: z2.url().optional()
817
+ });
818
+
819
+ // src/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeResponse.schema.ts
820
+ import { z as z3 } from "zod";
821
+ var OAuthAuthorizeResponseSchema = z3.object({
822
+ authorization_url: z3.url(),
823
+ state: z3.string()
824
+ });
825
+
826
+ // src/generated/cfg_accounts/_utils/schemas/OAuthCallbackRequestRequest.schema.ts
827
+ import { z as z4 } from "zod";
828
+ var OAuthCallbackRequestRequestSchema = z4.object({
829
+ code: z4.string().min(10).max(500),
830
+ state: z4.string().min(20).max(100),
831
+ redirect_uri: z4.url().optional()
832
+ });
833
+
834
+ // src/generated/cfg_accounts/_utils/schemas/OAuthConnection.schema.ts
835
+ import { z as z5 } from "zod";
836
+ var OAuthConnectionSchema = z5.object({
837
+ id: z5.int(),
838
+ provider: z5.nativeEnum(OAuthConnectionProvider),
839
+ provider_display: z5.string(),
840
+ provider_username: z5.string(),
841
+ provider_email: z5.email(),
842
+ provider_avatar_url: z5.url(),
843
+ connected_at: z5.iso.datetime(),
844
+ last_login_at: z5.iso.datetime()
845
+ });
846
+
847
+ // src/generated/cfg_accounts/_utils/schemas/OAuthDisconnectRequestRequest.schema.ts
848
+ import { z as z6 } from "zod";
849
+ var OAuthDisconnectRequestRequestSchema = z6.object({
850
+ provider: z6.nativeEnum(OAuthDisconnectRequestRequestProvider)
851
+ });
852
+
853
+ // src/generated/cfg_accounts/_utils/schemas/OAuthError.schema.ts
854
+ import { z as z7 } from "zod";
855
+ var OAuthErrorSchema = z7.object({
856
+ error: z7.string(),
857
+ error_description: z7.string().optional()
858
+ });
859
+
860
+ // src/generated/cfg_accounts/_utils/schemas/OAuthProvidersResponse.schema.ts
861
+ import { z as z8 } from "zod";
862
+ var OAuthProvidersResponseSchema = z8.object({
863
+ providers: z8.array(z8.record(z8.string(), z8.record(z8.string(), z8.any())))
864
+ });
865
+
866
+ // src/generated/cfg_accounts/_utils/schemas/OAuthTokenResponse.schema.ts
867
+ import { z as z9 } from "zod";
868
+ var OAuthTokenResponseSchema = z9.object({
869
+ access: z9.string(),
870
+ refresh: z9.string(),
871
+ user: z9.record(z9.string(), z9.record(z9.string(), z9.any())),
872
+ is_new_user: z9.boolean(),
873
+ is_new_connection: z9.boolean()
874
+ });
875
+
876
+ // src/generated/cfg_accounts/_utils/schemas/OTPErrorResponse.schema.ts
877
+ import { z as z10 } from "zod";
878
+ var OTPErrorResponseSchema = z10.object({
879
+ error: z10.string()
880
+ });
881
+
882
+ // src/generated/cfg_accounts/_utils/schemas/OTPRequestRequest.schema.ts
883
+ import { z as z11 } from "zod";
884
+ var OTPRequestRequestSchema = z11.object({
885
+ identifier: z11.string().min(1),
886
+ channel: z11.nativeEnum(OTPRequestRequestChannel).optional(),
887
+ source_url: z11.url().optional()
888
+ });
889
+
890
+ // src/generated/cfg_accounts/_utils/schemas/OTPRequestResponse.schema.ts
891
+ import { z as z12 } from "zod";
892
+ var OTPRequestResponseSchema = z12.object({
893
+ message: z12.string()
894
+ });
895
+
896
+ // src/generated/cfg_accounts/_utils/schemas/OTPVerifyRequest.schema.ts
897
+ import { z as z13 } from "zod";
898
+ var OTPVerifyRequestSchema = z13.object({
899
+ identifier: z13.string().min(1),
900
+ otp: z13.string().min(6).max(6),
901
+ channel: z13.nativeEnum(OTPVerifyRequestChannel).optional(),
902
+ source_url: z13.url().optional()
903
+ });
904
+
905
+ // src/generated/cfg_accounts/_utils/schemas/OTPVerifyResponse.schema.ts
906
+ import { z as z15 } from "zod";
907
+
908
+ // src/generated/cfg_accounts/_utils/schemas/User.schema.ts
909
+ import { z as z14 } from "zod";
910
+ var UserSchema = z14.object({
911
+ id: z14.int(),
912
+ email: z14.email(),
913
+ first_name: z14.string().max(50).optional(),
914
+ last_name: z14.string().max(50).optional(),
915
+ full_name: z14.string(),
916
+ initials: z14.string(),
917
+ display_username: z14.string(),
918
+ company: z14.string().max(100).optional(),
919
+ phone: z14.string().max(20).optional(),
920
+ position: z14.string().max(100).optional(),
921
+ avatar: z14.url().nullable(),
922
+ is_staff: z14.boolean(),
923
+ is_superuser: z14.boolean(),
924
+ date_joined: z14.iso.datetime(),
925
+ last_login: z14.iso.datetime().nullable(),
926
+ unanswered_messages_count: z14.int(),
927
+ centrifugo: CentrifugoTokenSchema.nullable()
928
+ });
929
+
930
+ // src/generated/cfg_accounts/_utils/schemas/OTPVerifyResponse.schema.ts
931
+ var OTPVerifyResponseSchema = z15.object({
932
+ refresh: z15.string(),
933
+ access: z15.string(),
934
+ user: UserSchema
935
+ });
936
+
937
+ // src/generated/cfg_accounts/_utils/schemas/PatchedUserProfileUpdateRequest.schema.ts
938
+ import { z as z16 } from "zod";
939
+ var PatchedUserProfileUpdateRequestSchema = z16.object({
940
+ first_name: z16.string().max(50).optional(),
941
+ last_name: z16.string().max(50).optional(),
942
+ company: z16.string().max(100).optional(),
943
+ phone: z16.string().max(20).optional(),
944
+ position: z16.string().max(100).optional()
945
+ });
946
+
947
+ // src/generated/cfg_accounts/_utils/schemas/TokenRefresh.schema.ts
948
+ import { z as z17 } from "zod";
949
+ var TokenRefreshSchema = z17.object({
950
+ access: z17.string(),
951
+ refresh: z17.string()
952
+ });
953
+
954
+ // src/generated/cfg_accounts/_utils/schemas/TokenRefreshRequest.schema.ts
955
+ import { z as z18 } from "zod";
956
+ var TokenRefreshRequestSchema = z18.object({
957
+ refresh: z18.string().min(1)
958
+ });
959
+
960
+ // src/generated/cfg_accounts/_utils/schemas/UserProfileUpdateRequest.schema.ts
961
+ import { z as z19 } from "zod";
962
+ var UserProfileUpdateRequestSchema = z19.object({
963
+ first_name: z19.string().max(50).optional(),
964
+ last_name: z19.string().max(50).optional(),
965
+ company: z19.string().max(100).optional(),
966
+ phone: z19.string().max(20).optional(),
967
+ position: z19.string().max(100).optional()
968
+ });
969
+
970
+ // src/generated/cfg_accounts/_utils/fetchers/accounts.ts
971
+ import { consola } from "consola";
972
+
973
+ // src/generated/cfg_accounts/api-instance.ts
974
+ var globalAPI = null;
975
+ function getAPIInstance() {
976
+ if (!globalAPI) {
977
+ throw new Error(
978
+ 'API not configured. Call configureAPI() with your base URL before using fetchers or hooks.\n\nExample:\n import { configureAPI } from "./api-instance"\n configureAPI({ baseUrl: "https://api.example.com" })'
979
+ );
980
+ }
981
+ return globalAPI;
982
+ }
983
+ __name(getAPIInstance, "getAPIInstance");
984
+
985
+ // src/generated/cfg_accounts/_utils/fetchers/accounts.ts
986
+ async function createAccountsOtpRequestCreate(data, client) {
987
+ const api = client || getAPIInstance();
988
+ const response = await api.accounts.otpRequestCreate(data);
989
+ try {
990
+ return OTPRequestResponseSchema.parse(response);
991
+ } catch (error) {
992
+ consola.error("\u274C Zod Validation Failed");
993
+ consola.box(`createAccountsOtpRequestCreate
994
+ Path: /cfg/accounts/otp/request/
995
+ Method: POST`);
996
+ if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
997
+ consola.error("Validation Issues:");
998
+ error.issues.forEach((issue, index) => {
999
+ consola.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
1000
+ consola.error(` \u251C\u2500 Message: ${issue.message}`);
1001
+ if (issue.expected) consola.error(` \u251C\u2500 Expected: ${issue.expected}`);
1002
+ if (issue.received) consola.error(` \u2514\u2500 Received: ${issue.received}`);
1003
+ });
1004
+ }
1005
+ consola.error("Response data:", response);
1006
+ if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
1007
+ try {
1008
+ const event = new CustomEvent("zod-validation-error", {
1009
+ detail: {
1010
+ operation: "createAccountsOtpRequestCreate",
1011
+ path: "/cfg/accounts/otp/request/",
1012
+ method: "POST",
1013
+ error,
1014
+ response,
1015
+ timestamp: /* @__PURE__ */ new Date()
1016
+ },
1017
+ bubbles: true,
1018
+ cancelable: false
1019
+ });
1020
+ window.dispatchEvent(event);
1021
+ } catch (eventError) {
1022
+ consola.warn("Failed to dispatch validation error event:", eventError);
1023
+ }
1024
+ }
1025
+ throw error;
1026
+ }
1027
+ }
1028
+ __name(createAccountsOtpRequestCreate, "createAccountsOtpRequestCreate");
1029
+ async function createAccountsOtpVerifyCreate(data, client) {
1030
+ const api = client || getAPIInstance();
1031
+ const response = await api.accounts.otpVerifyCreate(data);
1032
+ try {
1033
+ return OTPVerifyResponseSchema.parse(response);
1034
+ } catch (error) {
1035
+ consola.error("\u274C Zod Validation Failed");
1036
+ consola.box(`createAccountsOtpVerifyCreate
1037
+ Path: /cfg/accounts/otp/verify/
1038
+ Method: POST`);
1039
+ if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
1040
+ consola.error("Validation Issues:");
1041
+ error.issues.forEach((issue, index) => {
1042
+ consola.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
1043
+ consola.error(` \u251C\u2500 Message: ${issue.message}`);
1044
+ if (issue.expected) consola.error(` \u251C\u2500 Expected: ${issue.expected}`);
1045
+ if (issue.received) consola.error(` \u2514\u2500 Received: ${issue.received}`);
1046
+ });
1047
+ }
1048
+ consola.error("Response data:", response);
1049
+ if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
1050
+ try {
1051
+ const event = new CustomEvent("zod-validation-error", {
1052
+ detail: {
1053
+ operation: "createAccountsOtpVerifyCreate",
1054
+ path: "/cfg/accounts/otp/verify/",
1055
+ method: "POST",
1056
+ error,
1057
+ response,
1058
+ timestamp: /* @__PURE__ */ new Date()
1059
+ },
1060
+ bubbles: true,
1061
+ cancelable: false
1062
+ });
1063
+ window.dispatchEvent(event);
1064
+ } catch (eventError) {
1065
+ consola.warn("Failed to dispatch validation error event:", eventError);
1066
+ }
1067
+ }
1068
+ throw error;
1069
+ }
1070
+ }
1071
+ __name(createAccountsOtpVerifyCreate, "createAccountsOtpVerifyCreate");
1072
+
1073
+ // src/generated/cfg_accounts/_utils/fetchers/accounts__auth.ts
1074
+ import { consola as consola2 } from "consola";
1075
+ async function createAccountsTokenRefreshCreate(data, client) {
1076
+ const api = client || getAPIInstance();
1077
+ const response = await api.auth.accountsTokenRefreshCreate(data);
1078
+ try {
1079
+ return TokenRefreshSchema.parse(response);
1080
+ } catch (error) {
1081
+ consola2.error("\u274C Zod Validation Failed");
1082
+ consola2.box(`createAccountsTokenRefreshCreate
1083
+ Path: /cfg/accounts/token/refresh/
1084
+ Method: POST`);
1085
+ if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
1086
+ consola2.error("Validation Issues:");
1087
+ error.issues.forEach((issue, index) => {
1088
+ consola2.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
1089
+ consola2.error(` \u251C\u2500 Message: ${issue.message}`);
1090
+ if (issue.expected) consola2.error(` \u251C\u2500 Expected: ${issue.expected}`);
1091
+ if (issue.received) consola2.error(` \u2514\u2500 Received: ${issue.received}`);
1092
+ });
1093
+ }
1094
+ consola2.error("Response data:", response);
1095
+ if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
1096
+ try {
1097
+ const event = new CustomEvent("zod-validation-error", {
1098
+ detail: {
1099
+ operation: "createAccountsTokenRefreshCreate",
1100
+ path: "/cfg/accounts/token/refresh/",
1101
+ method: "POST",
1102
+ error,
1103
+ response,
1104
+ timestamp: /* @__PURE__ */ new Date()
1105
+ },
1106
+ bubbles: true,
1107
+ cancelable: false
1108
+ });
1109
+ window.dispatchEvent(event);
1110
+ } catch (eventError) {
1111
+ consola2.warn("Failed to dispatch validation error event:", eventError);
1112
+ }
1113
+ }
1114
+ throw error;
1115
+ }
1116
+ }
1117
+ __name(createAccountsTokenRefreshCreate, "createAccountsTokenRefreshCreate");
1118
+
1119
+ // src/generated/cfg_accounts/_utils/fetchers/accounts__oauth.ts
1120
+ import { consola as consola3 } from "consola";
1121
+ async function getAccountsOauthConnectionsList(client) {
1122
+ const api = client || getAPIInstance();
1123
+ const response = await api.oauth.accountsOauthConnectionsList();
1124
+ return response;
1125
+ }
1126
+ __name(getAccountsOauthConnectionsList, "getAccountsOauthConnectionsList");
1127
+ async function createAccountsOauthDisconnectCreate(data, client) {
1128
+ const api = client || getAPIInstance();
1129
+ const response = await api.oauth.accountsOauthDisconnectCreate(data);
1130
+ return response;
1131
+ }
1132
+ __name(createAccountsOauthDisconnectCreate, "createAccountsOauthDisconnectCreate");
1133
+ async function createAccountsOauthGithubAuthorizeCreate(data, client) {
1134
+ const api = client || getAPIInstance();
1135
+ const response = await api.oauth.accountsOauthGithubAuthorizeCreate(data);
1136
+ try {
1137
+ return OAuthAuthorizeResponseSchema.parse(response);
1138
+ } catch (error) {
1139
+ consola3.error("\u274C Zod Validation Failed");
1140
+ consola3.box(`createAccountsOauthGithubAuthorizeCreate
1141
+ Path: /cfg/accounts/oauth/github/authorize/
1142
+ Method: POST`);
1143
+ if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
1144
+ consola3.error("Validation Issues:");
1145
+ error.issues.forEach((issue, index) => {
1146
+ consola3.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
1147
+ consola3.error(` \u251C\u2500 Message: ${issue.message}`);
1148
+ if (issue.expected) consola3.error(` \u251C\u2500 Expected: ${issue.expected}`);
1149
+ if (issue.received) consola3.error(` \u2514\u2500 Received: ${issue.received}`);
1150
+ });
1151
+ }
1152
+ consola3.error("Response data:", response);
1153
+ if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
1154
+ try {
1155
+ const event = new CustomEvent("zod-validation-error", {
1156
+ detail: {
1157
+ operation: "createAccountsOauthGithubAuthorizeCreate",
1158
+ path: "/cfg/accounts/oauth/github/authorize/",
1159
+ method: "POST",
1160
+ error,
1161
+ response,
1162
+ timestamp: /* @__PURE__ */ new Date()
1163
+ },
1164
+ bubbles: true,
1165
+ cancelable: false
1166
+ });
1167
+ window.dispatchEvent(event);
1168
+ } catch (eventError) {
1169
+ consola3.warn("Failed to dispatch validation error event:", eventError);
1170
+ }
1171
+ }
1172
+ throw error;
1173
+ }
1174
+ }
1175
+ __name(createAccountsOauthGithubAuthorizeCreate, "createAccountsOauthGithubAuthorizeCreate");
1176
+ async function createAccountsOauthGithubCallbackCreate(data, client) {
1177
+ const api = client || getAPIInstance();
1178
+ const response = await api.oauth.accountsOauthGithubCallbackCreate(data);
1179
+ try {
1180
+ return OAuthTokenResponseSchema.parse(response);
1181
+ } catch (error) {
1182
+ consola3.error("\u274C Zod Validation Failed");
1183
+ consola3.box(`createAccountsOauthGithubCallbackCreate
1184
+ Path: /cfg/accounts/oauth/github/callback/
1185
+ Method: POST`);
1186
+ if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
1187
+ consola3.error("Validation Issues:");
1188
+ error.issues.forEach((issue, index) => {
1189
+ consola3.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
1190
+ consola3.error(` \u251C\u2500 Message: ${issue.message}`);
1191
+ if (issue.expected) consola3.error(` \u251C\u2500 Expected: ${issue.expected}`);
1192
+ if (issue.received) consola3.error(` \u2514\u2500 Received: ${issue.received}`);
1193
+ });
1194
+ }
1195
+ consola3.error("Response data:", response);
1196
+ if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
1197
+ try {
1198
+ const event = new CustomEvent("zod-validation-error", {
1199
+ detail: {
1200
+ operation: "createAccountsOauthGithubCallbackCreate",
1201
+ path: "/cfg/accounts/oauth/github/callback/",
1202
+ method: "POST",
1203
+ error,
1204
+ response,
1205
+ timestamp: /* @__PURE__ */ new Date()
1206
+ },
1207
+ bubbles: true,
1208
+ cancelable: false
1209
+ });
1210
+ window.dispatchEvent(event);
1211
+ } catch (eventError) {
1212
+ consola3.warn("Failed to dispatch validation error event:", eventError);
1213
+ }
1214
+ }
1215
+ throw error;
1216
+ }
1217
+ }
1218
+ __name(createAccountsOauthGithubCallbackCreate, "createAccountsOauthGithubCallbackCreate");
1219
+ async function getAccountsOauthProvidersRetrieve(client) {
1220
+ const api = client || getAPIInstance();
1221
+ const response = await api.oauth.accountsOauthProvidersRetrieve();
1222
+ try {
1223
+ return OAuthProvidersResponseSchema.parse(response);
1224
+ } catch (error) {
1225
+ consola3.error("\u274C Zod Validation Failed");
1226
+ consola3.box(`getAccountsOauthProvidersRetrieve
1227
+ Path: /cfg/accounts/oauth/providers/
1228
+ Method: GET`);
1229
+ if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
1230
+ consola3.error("Validation Issues:");
1231
+ error.issues.forEach((issue, index) => {
1232
+ consola3.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
1233
+ consola3.error(` \u251C\u2500 Message: ${issue.message}`);
1234
+ if (issue.expected) consola3.error(` \u251C\u2500 Expected: ${issue.expected}`);
1235
+ if (issue.received) consola3.error(` \u2514\u2500 Received: ${issue.received}`);
1236
+ });
1237
+ }
1238
+ consola3.error("Response data:", response);
1239
+ if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
1240
+ try {
1241
+ const event = new CustomEvent("zod-validation-error", {
1242
+ detail: {
1243
+ operation: "getAccountsOauthProvidersRetrieve",
1244
+ path: "/cfg/accounts/oauth/providers/",
1245
+ method: "GET",
1246
+ error,
1247
+ response,
1248
+ timestamp: /* @__PURE__ */ new Date()
1249
+ },
1250
+ bubbles: true,
1251
+ cancelable: false
1252
+ });
1253
+ window.dispatchEvent(event);
1254
+ } catch (eventError) {
1255
+ consola3.warn("Failed to dispatch validation error event:", eventError);
1256
+ }
1257
+ }
1258
+ throw error;
1259
+ }
1260
+ }
1261
+ __name(getAccountsOauthProvidersRetrieve, "getAccountsOauthProvidersRetrieve");
1262
+
1263
+ // src/generated/cfg_accounts/_utils/fetchers/accounts__user_profile.ts
1264
+ import { consola as consola4 } from "consola";
1265
+ async function getAccountsProfileRetrieve(client) {
1266
+ const api = client || getAPIInstance();
1267
+ const response = await api.user_profile.accountsProfileRetrieve();
1268
+ try {
1269
+ return UserSchema.parse(response);
1270
+ } catch (error) {
1271
+ consola4.error("\u274C Zod Validation Failed");
1272
+ consola4.box(`getAccountsProfileRetrieve
1273
+ Path: /cfg/accounts/profile/
1274
+ Method: GET`);
1275
+ if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
1276
+ consola4.error("Validation Issues:");
1277
+ error.issues.forEach((issue, index) => {
1278
+ consola4.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
1279
+ consola4.error(` \u251C\u2500 Message: ${issue.message}`);
1280
+ if (issue.expected) consola4.error(` \u251C\u2500 Expected: ${issue.expected}`);
1281
+ if (issue.received) consola4.error(` \u2514\u2500 Received: ${issue.received}`);
1282
+ });
1283
+ }
1284
+ consola4.error("Response data:", response);
1285
+ if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
1286
+ try {
1287
+ const event = new CustomEvent("zod-validation-error", {
1288
+ detail: {
1289
+ operation: "getAccountsProfileRetrieve",
1290
+ path: "/cfg/accounts/profile/",
1291
+ method: "GET",
1292
+ error,
1293
+ response,
1294
+ timestamp: /* @__PURE__ */ new Date()
1295
+ },
1296
+ bubbles: true,
1297
+ cancelable: false
1298
+ });
1299
+ window.dispatchEvent(event);
1300
+ } catch (eventError) {
1301
+ consola4.warn("Failed to dispatch validation error event:", eventError);
1302
+ }
1303
+ }
1304
+ throw error;
1305
+ }
1306
+ }
1307
+ __name(getAccountsProfileRetrieve, "getAccountsProfileRetrieve");
1308
+ async function createAccountsProfileAvatarCreate(data, client) {
1309
+ const api = client || getAPIInstance();
1310
+ const response = await api.user_profile.accountsProfileAvatarCreate(data);
1311
+ try {
1312
+ return UserSchema.parse(response);
1313
+ } catch (error) {
1314
+ consola4.error("\u274C Zod Validation Failed");
1315
+ consola4.box(`createAccountsProfileAvatarCreate
1316
+ Path: /cfg/accounts/profile/avatar/
1317
+ Method: POST`);
1318
+ if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
1319
+ consola4.error("Validation Issues:");
1320
+ error.issues.forEach((issue, index) => {
1321
+ consola4.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
1322
+ consola4.error(` \u251C\u2500 Message: ${issue.message}`);
1323
+ if (issue.expected) consola4.error(` \u251C\u2500 Expected: ${issue.expected}`);
1324
+ if (issue.received) consola4.error(` \u2514\u2500 Received: ${issue.received}`);
1325
+ });
1326
+ }
1327
+ consola4.error("Response data:", response);
1328
+ if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
1329
+ try {
1330
+ const event = new CustomEvent("zod-validation-error", {
1331
+ detail: {
1332
+ operation: "createAccountsProfileAvatarCreate",
1333
+ path: "/cfg/accounts/profile/avatar/",
1334
+ method: "POST",
1335
+ error,
1336
+ response,
1337
+ timestamp: /* @__PURE__ */ new Date()
1338
+ },
1339
+ bubbles: true,
1340
+ cancelable: false
1341
+ });
1342
+ window.dispatchEvent(event);
1343
+ } catch (eventError) {
1344
+ consola4.warn("Failed to dispatch validation error event:", eventError);
1345
+ }
1346
+ }
1347
+ throw error;
1348
+ }
1349
+ }
1350
+ __name(createAccountsProfileAvatarCreate, "createAccountsProfileAvatarCreate");
1351
+ async function partialUpdateAccountsProfilePartialUpdate(data, client) {
1352
+ const api = client || getAPIInstance();
1353
+ const response = await api.user_profile.accountsProfilePartialUpdate(data);
1354
+ try {
1355
+ return UserSchema.parse(response);
1356
+ } catch (error) {
1357
+ consola4.error("\u274C Zod Validation Failed");
1358
+ consola4.box(`partialUpdateAccountsProfilePartialUpdate
1359
+ Path: /cfg/accounts/profile/partial/
1360
+ Method: PUT`);
1361
+ if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
1362
+ consola4.error("Validation Issues:");
1363
+ error.issues.forEach((issue, index) => {
1364
+ consola4.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
1365
+ consola4.error(` \u251C\u2500 Message: ${issue.message}`);
1366
+ if (issue.expected) consola4.error(` \u251C\u2500 Expected: ${issue.expected}`);
1367
+ if (issue.received) consola4.error(` \u2514\u2500 Received: ${issue.received}`);
1368
+ });
1369
+ }
1370
+ consola4.error("Response data:", response);
1371
+ if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
1372
+ try {
1373
+ const event = new CustomEvent("zod-validation-error", {
1374
+ detail: {
1375
+ operation: "partialUpdateAccountsProfilePartialUpdate",
1376
+ path: "/cfg/accounts/profile/partial/",
1377
+ method: "PUT",
1378
+ error,
1379
+ response,
1380
+ timestamp: /* @__PURE__ */ new Date()
1381
+ },
1382
+ bubbles: true,
1383
+ cancelable: false
1384
+ });
1385
+ window.dispatchEvent(event);
1386
+ } catch (eventError) {
1387
+ consola4.warn("Failed to dispatch validation error event:", eventError);
1388
+ }
1389
+ }
1390
+ throw error;
1391
+ }
1392
+ }
1393
+ __name(partialUpdateAccountsProfilePartialUpdate, "partialUpdateAccountsProfilePartialUpdate");
1394
+ async function partialUpdateAccountsProfilePartialPartialUpdate(data, client) {
1395
+ const api = client || getAPIInstance();
1396
+ const response = await api.user_profile.accountsProfilePartialPartialUpdate(data);
1397
+ try {
1398
+ return UserSchema.parse(response);
1399
+ } catch (error) {
1400
+ consola4.error("\u274C Zod Validation Failed");
1401
+ consola4.box(`partialUpdateAccountsProfilePartialPartialUpdate
1402
+ Path: /cfg/accounts/profile/partial/
1403
+ Method: PATCH`);
1404
+ if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
1405
+ consola4.error("Validation Issues:");
1406
+ error.issues.forEach((issue, index) => {
1407
+ consola4.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
1408
+ consola4.error(` \u251C\u2500 Message: ${issue.message}`);
1409
+ if (issue.expected) consola4.error(` \u251C\u2500 Expected: ${issue.expected}`);
1410
+ if (issue.received) consola4.error(` \u2514\u2500 Received: ${issue.received}`);
1411
+ });
1412
+ }
1413
+ consola4.error("Response data:", response);
1414
+ if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
1415
+ try {
1416
+ const event = new CustomEvent("zod-validation-error", {
1417
+ detail: {
1418
+ operation: "partialUpdateAccountsProfilePartialPartialUpdate",
1419
+ path: "/cfg/accounts/profile/partial/",
1420
+ method: "PATCH",
1421
+ error,
1422
+ response,
1423
+ timestamp: /* @__PURE__ */ new Date()
1424
+ },
1425
+ bubbles: true,
1426
+ cancelable: false
1427
+ });
1428
+ window.dispatchEvent(event);
1429
+ } catch (eventError) {
1430
+ consola4.warn("Failed to dispatch validation error event:", eventError);
1431
+ }
1432
+ }
1433
+ throw error;
1434
+ }
1435
+ }
1436
+ __name(partialUpdateAccountsProfilePartialPartialUpdate, "partialUpdateAccountsProfilePartialPartialUpdate");
1437
+ async function updateAccountsProfileUpdateUpdate(data, client) {
1438
+ const api = client || getAPIInstance();
1439
+ const response = await api.user_profile.accountsProfileUpdateUpdate(data);
1440
+ try {
1441
+ return UserSchema.parse(response);
1442
+ } catch (error) {
1443
+ consola4.error("\u274C Zod Validation Failed");
1444
+ consola4.box(`updateAccountsProfileUpdateUpdate
1445
+ Path: /cfg/accounts/profile/update/
1446
+ Method: PUT`);
1447
+ if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
1448
+ consola4.error("Validation Issues:");
1449
+ error.issues.forEach((issue, index) => {
1450
+ consola4.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
1451
+ consola4.error(` \u251C\u2500 Message: ${issue.message}`);
1452
+ if (issue.expected) consola4.error(` \u251C\u2500 Expected: ${issue.expected}`);
1453
+ if (issue.received) consola4.error(` \u2514\u2500 Received: ${issue.received}`);
1454
+ });
1455
+ }
1456
+ consola4.error("Response data:", response);
1457
+ if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
1458
+ try {
1459
+ const event = new CustomEvent("zod-validation-error", {
1460
+ detail: {
1461
+ operation: "updateAccountsProfileUpdateUpdate",
1462
+ path: "/cfg/accounts/profile/update/",
1463
+ method: "PUT",
1464
+ error,
1465
+ response,
1466
+ timestamp: /* @__PURE__ */ new Date()
1467
+ },
1468
+ bubbles: true,
1469
+ cancelable: false
1470
+ });
1471
+ window.dispatchEvent(event);
1472
+ } catch (eventError) {
1473
+ consola4.warn("Failed to dispatch validation error event:", eventError);
1474
+ }
1475
+ }
1476
+ throw error;
1477
+ }
1478
+ }
1479
+ __name(updateAccountsProfileUpdateUpdate, "updateAccountsProfileUpdateUpdate");
1480
+ async function partialUpdateAccountsProfileUpdatePartialUpdate(data, client) {
1481
+ const api = client || getAPIInstance();
1482
+ const response = await api.user_profile.accountsProfileUpdatePartialUpdate(data);
1483
+ try {
1484
+ return UserSchema.parse(response);
1485
+ } catch (error) {
1486
+ consola4.error("\u274C Zod Validation Failed");
1487
+ consola4.box(`partialUpdateAccountsProfileUpdatePartialUpdate
1488
+ Path: /cfg/accounts/profile/update/
1489
+ Method: PATCH`);
1490
+ if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
1491
+ consola4.error("Validation Issues:");
1492
+ error.issues.forEach((issue, index) => {
1493
+ consola4.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
1494
+ consola4.error(` \u251C\u2500 Message: ${issue.message}`);
1495
+ if (issue.expected) consola4.error(` \u251C\u2500 Expected: ${issue.expected}`);
1496
+ if (issue.received) consola4.error(` \u2514\u2500 Received: ${issue.received}`);
1497
+ });
1498
+ }
1499
+ consola4.error("Response data:", response);
1500
+ if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
1501
+ try {
1502
+ const event = new CustomEvent("zod-validation-error", {
1503
+ detail: {
1504
+ operation: "partialUpdateAccountsProfileUpdatePartialUpdate",
1505
+ path: "/cfg/accounts/profile/update/",
1506
+ method: "PATCH",
1507
+ error,
1508
+ response,
1509
+ timestamp: /* @__PURE__ */ new Date()
1510
+ },
1511
+ bubbles: true,
1512
+ cancelable: false
1513
+ });
1514
+ window.dispatchEvent(event);
1515
+ } catch (eventError) {
1516
+ consola4.warn("Failed to dispatch validation error event:", eventError);
1517
+ }
1518
+ }
1519
+ throw error;
1520
+ }
1521
+ }
1522
+ __name(partialUpdateAccountsProfileUpdatePartialUpdate, "partialUpdateAccountsProfileUpdatePartialUpdate");
1523
+
1524
+ // src/generated/cfg_accounts/index.ts
1525
+ var TOKEN_KEY = "auth_token";
1526
+ var REFRESH_TOKEN_KEY = "refresh_token";
1527
+ var API = class {
1528
+ constructor(baseUrl, options) {
1529
+ this._token = null;
1530
+ this._refreshToken = null;
1531
+ this.baseUrl = baseUrl;
1532
+ this.options = options;
1533
+ const logger = options?.loggerConfig ? new APILogger(options.loggerConfig) : void 0;
1534
+ this.storage = options?.storage || new LocalStorageAdapter(logger);
1535
+ this._loadTokensFromStorage();
1536
+ this._client = new APIClient(this.baseUrl, {
1537
+ retryConfig: this.options?.retryConfig,
1538
+ loggerConfig: this.options?.loggerConfig
1539
+ });
1540
+ this._injectAuthHeader();
1541
+ this.auth = this._client.auth;
1542
+ this.oauth = this._client.oauth;
1543
+ this.user_profile = this._client.user_profile;
1544
+ this.accounts = this._client.accounts;
1545
+ }
1546
+ static {
1547
+ __name(this, "API");
1548
+ }
1549
+ _loadTokensFromStorage() {
1550
+ this._token = this.storage.getItem(TOKEN_KEY);
1551
+ this._refreshToken = this.storage.getItem(REFRESH_TOKEN_KEY);
1552
+ }
1553
+ _reinitClients() {
1554
+ this._client = new APIClient(this.baseUrl, {
1555
+ retryConfig: this.options?.retryConfig,
1556
+ loggerConfig: this.options?.loggerConfig
1557
+ });
1558
+ this._injectAuthHeader();
1559
+ this.auth = this._client.auth;
1560
+ this.oauth = this._client.oauth;
1561
+ this.user_profile = this._client.user_profile;
1562
+ this.accounts = this._client.accounts;
1563
+ }
1564
+ _injectAuthHeader() {
1565
+ const originalRequest = this._client.request.bind(this._client);
1566
+ this._client.request = async (method, path, options) => {
1567
+ const token = this.getToken();
1568
+ const mergedOptions = {
1569
+ ...options,
1570
+ headers: {
1571
+ ...options?.headers || {},
1572
+ ...token ? { "Authorization": `Bearer ${token}` } : {}
1573
+ }
1574
+ };
1575
+ return originalRequest(method, path, mergedOptions);
1576
+ };
1577
+ }
1578
+ /**
1579
+ * Get current JWT token
1580
+ */
1581
+ getToken() {
1582
+ return this.storage.getItem(TOKEN_KEY);
1583
+ }
1584
+ /**
1585
+ * Get current refresh token
1586
+ */
1587
+ getRefreshToken() {
1588
+ return this.storage.getItem(REFRESH_TOKEN_KEY);
1589
+ }
1590
+ /**
1591
+ * Set JWT token and refresh token
1592
+ * @param token - JWT access token
1593
+ * @param refreshToken - JWT refresh token (optional)
1594
+ */
1595
+ setToken(token, refreshToken) {
1596
+ this._token = token;
1597
+ this.storage.setItem(TOKEN_KEY, token);
1598
+ if (refreshToken) {
1599
+ this._refreshToken = refreshToken;
1600
+ this.storage.setItem(REFRESH_TOKEN_KEY, refreshToken);
1601
+ }
1602
+ this._reinitClients();
1603
+ }
1604
+ /**
1605
+ * Clear all tokens
1606
+ */
1607
+ clearTokens() {
1608
+ this._token = null;
1609
+ this._refreshToken = null;
1610
+ this.storage.removeItem(TOKEN_KEY);
1611
+ this.storage.removeItem(REFRESH_TOKEN_KEY);
1612
+ this._reinitClients();
1613
+ }
1614
+ /**
1615
+ * Check if user is authenticated
1616
+ */
1617
+ isAuthenticated() {
1618
+ return !!this.getToken();
1619
+ }
1620
+ /**
1621
+ * Update base URL and reinitialize clients
1622
+ * @param url - New base URL
1623
+ */
1624
+ setBaseUrl(url) {
1625
+ this.baseUrl = url;
1626
+ this._reinitClients();
1627
+ }
1628
+ /**
1629
+ * Get current base URL
1630
+ */
1631
+ getBaseUrl() {
1632
+ return this.baseUrl;
1633
+ }
1634
+ /**
1635
+ * Get OpenAPI schema path
1636
+ * @returns Path to the OpenAPI schema JSON file
1637
+ *
1638
+ * Note: The OpenAPI schema is available in the schema.json file.
1639
+ * You can load it dynamically using:
1640
+ * ```typescript
1641
+ * const schema = await fetch('./schema.json').then(r => r.json());
1642
+ * // or using fs in Node.js:
1643
+ * // const schema = JSON.parse(fs.readFileSync('./schema.json', 'utf-8'));
1644
+ * ```
1645
+ */
1646
+ getSchemaPath() {
1647
+ return "./schema.json";
1648
+ }
1649
+ };
1650
+
1651
+ // src/generated/cfg_webpush/webpush__web_push/client.ts
1652
+ var WebPush = class {
1653
+ static {
1654
+ __name(this, "WebPush");
1655
+ }
1656
+ constructor(client) {
1657
+ this.client = client;
1658
+ }
1659
+ /**
1660
+ * Send push notification
1661
+ *
1662
+ * Send push notification to all active subscriptions for the authenticated
1663
+ * user.
1664
+ */
1665
+ async webpushSendCreate(data) {
1666
+ const response = await this.client.request("POST", "/cfg/webpush/send/", { body: data });
1667
+ return response;
1668
+ }
1669
+ /**
1670
+ * Subscribe to push notifications
1671
+ *
1672
+ * Save push subscription from browser for the authenticated user.
1673
+ */
1674
+ async webpushSubscribeCreate(data) {
1675
+ const response = await this.client.request("POST", "/cfg/webpush/subscribe/", { body: data });
1676
+ return response;
1677
+ }
1678
+ /**
1679
+ * Get VAPID public key
1680
+ *
1681
+ * Get VAPID public key for client subscription.
1682
+ */
1683
+ async webpushVapidRetrieve() {
1684
+ const response = await this.client.request("GET", "/cfg/webpush/vapid/");
1685
+ return response;
1686
+ }
1687
+ };
1688
+
1689
+ // src/generated/cfg_webpush/http.ts
1690
+ var FetchAdapter2 = class {
1691
+ static {
1692
+ __name(this, "FetchAdapter");
1693
+ }
1694
+ async request(request) {
1695
+ const { method, url, headers, body, params, formData } = request;
1696
+ let finalUrl = url;
1697
+ if (params) {
1698
+ const searchParams = new URLSearchParams();
1699
+ Object.entries(params).forEach(([key, value]) => {
1700
+ if (value !== null && value !== void 0) {
1701
+ searchParams.append(key, String(value));
1702
+ }
1703
+ });
1704
+ const queryString = searchParams.toString();
1705
+ if (queryString) {
1706
+ finalUrl = url.includes("?") ? `${url}&${queryString}` : `${url}?${queryString}`;
1707
+ }
1708
+ }
1709
+ const finalHeaders = { ...headers };
1710
+ let requestBody;
1711
+ if (formData) {
1712
+ requestBody = formData;
1713
+ } else if (body) {
1714
+ finalHeaders["Content-Type"] = "application/json";
1715
+ requestBody = JSON.stringify(body);
1716
+ }
1717
+ const response = await fetch(finalUrl, {
1718
+ method,
1719
+ headers: finalHeaders,
1720
+ body: requestBody,
1721
+ credentials: "include"
1722
+ // Include Django session cookies
1723
+ });
1724
+ let data = null;
1725
+ const contentType = response.headers.get("content-type");
1726
+ if (response.status !== 204 && contentType?.includes("application/json")) {
1727
+ data = await response.json();
1728
+ } else if (response.status !== 204) {
1729
+ data = await response.text();
1730
+ }
1731
+ const responseHeaders = {};
1732
+ response.headers.forEach((value, key) => {
1733
+ responseHeaders[key] = value;
1734
+ });
1735
+ return {
1736
+ data,
1737
+ status: response.status,
1738
+ statusText: response.statusText,
1739
+ headers: responseHeaders
1740
+ };
1741
+ }
1742
+ };
1743
+
1744
+ // src/generated/cfg_webpush/errors.ts
1745
+ var APIError2 = class extends Error {
1746
+ constructor(statusCode, statusText, response, url, message) {
1747
+ super(message || `HTTP ${statusCode}: ${statusText}`);
1748
+ this.statusCode = statusCode;
1749
+ this.statusText = statusText;
1750
+ this.response = response;
1751
+ this.url = url;
1752
+ this.name = "APIError";
1753
+ }
1754
+ static {
1755
+ __name(this, "APIError");
1756
+ }
1757
+ /**
1758
+ * Get error details from response.
1759
+ * DRF typically returns: { "detail": "Error message" } or { "field": ["error1", "error2"] }
1760
+ */
1761
+ get details() {
1762
+ if (typeof this.response === "object" && this.response !== null) {
1763
+ return this.response;
1764
+ }
1765
+ return null;
1766
+ }
1767
+ /**
1768
+ * Get field-specific validation errors from DRF.
1769
+ * Returns: { "field_name": ["error1", "error2"], ... }
1770
+ */
1771
+ get fieldErrors() {
1772
+ const details = this.details;
1773
+ if (!details) return null;
1774
+ const fieldErrors = {};
1775
+ for (const [key, value] of Object.entries(details)) {
1776
+ if (Array.isArray(value)) {
1777
+ fieldErrors[key] = value;
1778
+ }
1779
+ }
1780
+ return Object.keys(fieldErrors).length > 0 ? fieldErrors : null;
1781
+ }
1782
+ /**
1783
+ * Get single error message from DRF.
1784
+ * Checks for "detail", "message", or first field error.
1785
+ */
1786
+ get errorMessage() {
1787
+ const details = this.details;
1788
+ if (!details) return this.message;
1789
+ if (details.detail) {
1790
+ return Array.isArray(details.detail) ? details.detail.join(", ") : String(details.detail);
1791
+ }
1792
+ if (details.message) {
1793
+ return String(details.message);
1794
+ }
1795
+ const fieldErrors = this.fieldErrors;
1796
+ if (fieldErrors) {
1797
+ const firstField = Object.keys(fieldErrors)[0];
1798
+ if (firstField) {
1799
+ return `${firstField}: ${fieldErrors[firstField]?.join(", ")}`;
1800
+ }
1801
+ }
1802
+ return this.message;
1803
+ }
1804
+ // Helper methods for common HTTP status codes
1805
+ get isValidationError() {
1806
+ return this.statusCode === 400;
1807
+ }
1808
+ get isAuthError() {
1809
+ return this.statusCode === 401;
1810
+ }
1811
+ get isPermissionError() {
1812
+ return this.statusCode === 403;
1813
+ }
1814
+ get isNotFoundError() {
1815
+ return this.statusCode === 404;
1816
+ }
1817
+ get isServerError() {
1818
+ return this.statusCode >= 500 && this.statusCode < 600;
1819
+ }
1820
+ };
1821
+ var NetworkError2 = class extends Error {
1822
+ constructor(message, url, originalError) {
1823
+ super(message);
1824
+ this.url = url;
1825
+ this.originalError = originalError;
1826
+ this.name = "NetworkError";
1827
+ }
1828
+ static {
1829
+ __name(this, "NetworkError");
1830
+ }
1831
+ };
1832
+
1833
+ // src/generated/cfg_webpush/logger.ts
1834
+ import { createConsola as createConsola2 } from "consola";
1835
+ var DEFAULT_CONFIG2 = {
1836
+ enabled: process.env.NODE_ENV !== "production",
1837
+ logRequests: true,
1838
+ logResponses: true,
1839
+ logErrors: true,
1840
+ logBodies: true,
1841
+ logHeaders: false
1842
+ };
1843
+ var SENSITIVE_HEADERS2 = [
1844
+ "authorization",
1845
+ "cookie",
1846
+ "set-cookie",
1847
+ "x-api-key",
1848
+ "x-csrf-token"
1849
+ ];
1850
+ var APILogger2 = class {
1851
+ static {
1852
+ __name(this, "APILogger");
1853
+ }
1854
+ constructor(config = {}) {
1855
+ this.config = { ...DEFAULT_CONFIG2, ...config };
1856
+ this.consola = config.consola || createConsola2({
1857
+ level: this.config.enabled ? 4 : 0
1858
+ });
1859
+ }
1860
+ /**
1861
+ * Enable logging
1862
+ */
1863
+ enable() {
1864
+ this.config.enabled = true;
1865
+ }
1866
+ /**
1867
+ * Disable logging
1868
+ */
1869
+ disable() {
1870
+ this.config.enabled = false;
1871
+ }
1872
+ /**
1873
+ * Update configuration
1874
+ */
1875
+ setConfig(config) {
1876
+ this.config = { ...this.config, ...config };
1877
+ }
1878
+ /**
1879
+ * Filter sensitive headers
1880
+ */
1881
+ filterHeaders(headers) {
1882
+ if (!headers) return {};
1883
+ const filtered = {};
1884
+ Object.keys(headers).forEach((key) => {
1885
+ const lowerKey = key.toLowerCase();
1886
+ if (SENSITIVE_HEADERS2.includes(lowerKey)) {
1887
+ filtered[key] = "***";
1888
+ } else {
1889
+ filtered[key] = headers[key] || "";
1890
+ }
1891
+ });
1892
+ return filtered;
1893
+ }
1894
+ /**
1895
+ * Log request
1896
+ */
1897
+ logRequest(request) {
1898
+ if (!this.config.enabled || !this.config.logRequests) return;
1899
+ const { method, url, headers, body } = request;
1900
+ this.consola.start(`${method} ${url}`);
1901
+ if (this.config.logHeaders && headers) {
1902
+ this.consola.debug("Headers:", this.filterHeaders(headers));
1903
+ }
1904
+ if (this.config.logBodies && body) {
1905
+ this.consola.debug("Body:", body);
1906
+ }
1907
+ }
1908
+ /**
1909
+ * Log response
1910
+ */
1911
+ logResponse(request, response) {
1912
+ if (!this.config.enabled || !this.config.logResponses) return;
1913
+ const { method, url } = request;
1914
+ const { status, statusText, data, duration } = response;
1915
+ const statusColor = status >= 500 ? "red" : status >= 400 ? "yellow" : status >= 300 ? "cyan" : "green";
1916
+ this.consola.success(
1917
+ `${method} ${url} ${status} ${statusText} (${duration}ms)`
1918
+ );
1919
+ if (this.config.logBodies && data) {
1920
+ this.consola.debug("Response:", data);
1921
+ }
1922
+ }
1923
+ /**
1924
+ * Log error
1925
+ */
1926
+ logError(request, error) {
1927
+ if (!this.config.enabled || !this.config.logErrors) return;
1928
+ const { method, url } = request;
1929
+ const { message, statusCode, fieldErrors, duration } = error;
1930
+ this.consola.error(
1931
+ `${method} ${url} ${statusCode || "Network"} Error (${duration}ms)`
1932
+ );
1933
+ this.consola.error("Message:", message);
1934
+ if (fieldErrors && Object.keys(fieldErrors).length > 0) {
1935
+ this.consola.error("Field Errors:");
1936
+ Object.entries(fieldErrors).forEach(([field, errors]) => {
1937
+ errors.forEach((err) => {
1938
+ this.consola.error(` \u2022 ${field}: ${err}`);
1939
+ });
1940
+ });
1941
+ }
1942
+ }
1943
+ /**
1944
+ * Log general info
1945
+ */
1946
+ info(message, ...args) {
1947
+ if (!this.config.enabled) return;
1948
+ this.consola.info(message, ...args);
1949
+ }
1950
+ /**
1951
+ * Log warning
1952
+ */
1953
+ warn(message, ...args) {
1954
+ if (!this.config.enabled) return;
1955
+ this.consola.warn(message, ...args);
1956
+ }
1957
+ /**
1958
+ * Log error
1959
+ */
1960
+ error(message, ...args) {
1961
+ if (!this.config.enabled) return;
1962
+ this.consola.error(message, ...args);
1963
+ }
1964
+ /**
1965
+ * Log debug
1966
+ */
1967
+ debug(message, ...args) {
1968
+ if (!this.config.enabled) return;
1969
+ this.consola.debug(message, ...args);
1970
+ }
1971
+ /**
1972
+ * Log success
1973
+ */
1974
+ success(message, ...args) {
1975
+ if (!this.config.enabled) return;
1976
+ this.consola.success(message, ...args);
1977
+ }
1978
+ /**
1979
+ * Create a sub-logger with prefix
1980
+ */
1981
+ withTag(tag) {
1982
+ return this.consola.withTag(tag);
1983
+ }
1984
+ };
1985
+ var defaultLogger2 = new APILogger2();
1986
+
1987
+ // src/generated/cfg_webpush/retry.ts
1988
+ import pRetry2, { AbortError as AbortError2 } from "p-retry";
1989
+ var DEFAULT_RETRY_CONFIG2 = {
1990
+ retries: 3,
1991
+ factor: 2,
1992
+ minTimeout: 1e3,
1993
+ maxTimeout: 6e4,
1994
+ randomize: true,
1995
+ onFailedAttempt: /* @__PURE__ */ __name(() => {
1996
+ }, "onFailedAttempt")
1997
+ };
1998
+ function shouldRetry2(error) {
1999
+ if (error instanceof NetworkError2) {
2000
+ return true;
2001
+ }
2002
+ if (error instanceof APIError2) {
2003
+ const status = error.statusCode;
2004
+ if (status >= 500 && status < 600) {
2005
+ return true;
2006
+ }
2007
+ if (status === 429) {
2008
+ return true;
2009
+ }
2010
+ return false;
2011
+ }
2012
+ return true;
2013
+ }
2014
+ __name(shouldRetry2, "shouldRetry");
2015
+ async function withRetry2(fn, config) {
2016
+ const finalConfig = { ...DEFAULT_RETRY_CONFIG2, ...config };
2017
+ return pRetry2(
2018
+ async () => {
2019
+ try {
2020
+ return await fn();
2021
+ } catch (error) {
2022
+ if (!shouldRetry2(error)) {
2023
+ throw new AbortError2(error);
2024
+ }
2025
+ throw error;
2026
+ }
2027
+ },
2028
+ {
2029
+ retries: finalConfig.retries,
2030
+ factor: finalConfig.factor,
2031
+ minTimeout: finalConfig.minTimeout,
2032
+ maxTimeout: finalConfig.maxTimeout,
2033
+ randomize: finalConfig.randomize,
2034
+ onFailedAttempt: finalConfig.onFailedAttempt ? (error) => {
2035
+ const pRetryError = error;
2036
+ finalConfig.onFailedAttempt({
2037
+ error: pRetryError,
2038
+ attemptNumber: pRetryError.attemptNumber,
2039
+ retriesLeft: pRetryError.retriesLeft
2040
+ });
2041
+ } : void 0
2042
+ }
2043
+ );
2044
+ }
2045
+ __name(withRetry2, "withRetry");
2046
+
2047
+ // src/generated/cfg_webpush/client.ts
2048
+ var APIClient2 = class {
2049
+ constructor(baseUrl, options) {
2050
+ this.logger = null;
2051
+ this.retryConfig = null;
2052
+ this.baseUrl = baseUrl.replace(/\/$/, "");
2053
+ this.httpClient = options?.httpClient || new FetchAdapter2();
2054
+ if (options?.loggerConfig !== void 0) {
2055
+ this.logger = new APILogger2(options.loggerConfig);
2056
+ }
2057
+ if (options?.retryConfig !== void 0) {
2058
+ this.retryConfig = options.retryConfig;
2059
+ }
2060
+ this.web_push = new WebPush(this);
2061
+ }
2062
+ static {
2063
+ __name(this, "APIClient");
2064
+ }
2065
+ /**
2066
+ * Get CSRF token from cookies (for SessionAuthentication).
2067
+ *
2068
+ * Returns null if cookie doesn't exist (JWT-only auth).
2069
+ */
2070
+ getCsrfToken() {
2071
+ const name = "csrftoken";
2072
+ const value = `; ${document.cookie}`;
2073
+ const parts = value.split(`; ${name}=`);
2074
+ if (parts.length === 2) {
2075
+ return parts.pop()?.split(";").shift() || null;
2076
+ }
2077
+ return null;
2078
+ }
2079
+ /**
2080
+ * Make HTTP request with Django CSRF and session handling.
2081
+ * Automatically retries on network errors and 5xx server errors.
2082
+ */
2083
+ async request(method, path, options) {
2084
+ if (this.retryConfig) {
2085
+ return withRetry2(() => this._makeRequest(method, path, options), {
2086
+ ...this.retryConfig,
2087
+ onFailedAttempt: /* @__PURE__ */ __name((info) => {
2088
+ if (this.logger) {
2089
+ this.logger.warn(
2090
+ `Retry attempt ${info.attemptNumber}/${info.retriesLeft + info.attemptNumber} for ${method} ${path}: ${info.error.message}`
2091
+ );
2092
+ }
2093
+ this.retryConfig?.onFailedAttempt?.(info);
2094
+ }, "onFailedAttempt")
2095
+ });
2096
+ }
2097
+ return this._makeRequest(method, path, options);
2098
+ }
2099
+ /**
2100
+ * Internal request method (without retry wrapper).
2101
+ * Used by request() method with optional retry logic.
2102
+ */
2103
+ async _makeRequest(method, path, options) {
2104
+ const url = this.baseUrl ? `${this.baseUrl}${path}` : path;
2105
+ const startTime = Date.now();
2106
+ const headers = {
2107
+ ...options?.headers || {}
2108
+ };
2109
+ if (!options?.formData && !headers["Content-Type"]) {
2110
+ headers["Content-Type"] = "application/json";
2111
+ }
2112
+ if (this.logger) {
2113
+ this.logger.logRequest({
2114
+ method,
2115
+ url,
2116
+ headers,
2117
+ body: options?.formData || options?.body,
2118
+ timestamp: startTime
2119
+ });
2120
+ }
2121
+ try {
2122
+ const response = await this.httpClient.request({
2123
+ method,
2124
+ url,
2125
+ headers,
2126
+ params: options?.params,
2127
+ body: options?.body,
2128
+ formData: options?.formData
2129
+ });
2130
+ const duration = Date.now() - startTime;
2131
+ if (response.status >= 400) {
2132
+ const error = new APIError2(
2133
+ response.status,
2134
+ response.statusText,
2135
+ response.data,
2136
+ url
2137
+ );
2138
+ if (this.logger) {
2139
+ this.logger.logError(
2140
+ {
2141
+ method,
2142
+ url,
2143
+ headers,
2144
+ body: options?.formData || options?.body,
2145
+ timestamp: startTime
2146
+ },
2147
+ {
2148
+ message: error.message,
2149
+ statusCode: response.status,
2150
+ duration,
2151
+ timestamp: Date.now()
2152
+ }
2153
+ );
2154
+ }
2155
+ throw error;
2156
+ }
2157
+ if (this.logger) {
2158
+ this.logger.logResponse(
2159
+ {
2160
+ method,
2161
+ url,
2162
+ headers,
2163
+ body: options?.formData || options?.body,
2164
+ timestamp: startTime
2165
+ },
2166
+ {
2167
+ status: response.status,
2168
+ statusText: response.statusText,
2169
+ data: response.data,
2170
+ duration,
2171
+ timestamp: Date.now()
2172
+ }
2173
+ );
2174
+ }
2175
+ return response.data;
2176
+ } catch (error) {
2177
+ const duration = Date.now() - startTime;
2178
+ if (error instanceof APIError2) {
2179
+ throw error;
2180
+ }
2181
+ const isCORSError = error instanceof TypeError && (error.message.toLowerCase().includes("cors") || error.message.toLowerCase().includes("failed to fetch") || error.message.toLowerCase().includes("network request failed"));
2182
+ if (this.logger) {
2183
+ if (isCORSError) {
2184
+ this.logger.error(`\u{1F6AB} CORS Error: ${method} ${url}`);
2185
+ this.logger.error(` \u2192 ${error instanceof Error ? error.message : String(error)}`);
2186
+ this.logger.error(` \u2192 Configure security_domains parameter on the server`);
2187
+ } else {
2188
+ this.logger.error(`\u26A0\uFE0F Network Error: ${method} ${url}`);
2189
+ this.logger.error(` \u2192 ${error instanceof Error ? error.message : String(error)}`);
2190
+ }
2191
+ }
2192
+ if (typeof window !== "undefined") {
2193
+ try {
2194
+ if (isCORSError) {
2195
+ window.dispatchEvent(new CustomEvent("cors-error", {
2196
+ detail: {
2197
+ url,
2198
+ method,
2199
+ error: error instanceof Error ? error.message : String(error),
2200
+ timestamp: /* @__PURE__ */ new Date()
2201
+ },
2202
+ bubbles: true,
2203
+ cancelable: false
2204
+ }));
2205
+ } else {
2206
+ window.dispatchEvent(new CustomEvent("network-error", {
2207
+ detail: {
2208
+ url,
2209
+ method,
2210
+ error: error instanceof Error ? error.message : String(error),
2211
+ timestamp: /* @__PURE__ */ new Date()
2212
+ },
2213
+ bubbles: true,
2214
+ cancelable: false
2215
+ }));
2216
+ }
2217
+ } catch (eventError) {
2218
+ }
2219
+ }
2220
+ const networkError = error instanceof Error ? new NetworkError2(error.message, url, error) : new NetworkError2("Unknown error", url);
2221
+ if (this.logger) {
2222
+ this.logger.logError(
2223
+ {
2224
+ method,
2225
+ url,
2226
+ headers,
2227
+ body: options?.formData || options?.body,
2228
+ timestamp: startTime
2229
+ },
2230
+ {
2231
+ message: networkError.message,
2232
+ duration,
2233
+ timestamp: Date.now()
2234
+ }
2235
+ );
2236
+ }
2237
+ throw networkError;
2238
+ }
2239
+ }
2240
+ };
2241
+
2242
+ // src/generated/cfg_webpush/storage.ts
2243
+ var LocalStorageAdapter2 = class {
2244
+ static {
2245
+ __name(this, "LocalStorageAdapter");
2246
+ }
2247
+ constructor(logger) {
2248
+ this.logger = logger;
2249
+ }
2250
+ getItem(key) {
2251
+ try {
2252
+ if (typeof window !== "undefined" && window.localStorage) {
2253
+ const value = localStorage.getItem(key);
2254
+ this.logger?.debug(`LocalStorage.getItem("${key}"): ${value ? "found" : "not found"}`);
2255
+ return value;
2256
+ }
2257
+ this.logger?.warn("LocalStorage not available: window.localStorage is undefined");
2258
+ } catch (error) {
2259
+ this.logger?.error("LocalStorage.getItem failed:", error);
2260
+ }
2261
+ return null;
2262
+ }
2263
+ setItem(key, value) {
2264
+ try {
2265
+ if (typeof window !== "undefined" && window.localStorage) {
2266
+ localStorage.setItem(key, value);
2267
+ this.logger?.debug(`LocalStorage.setItem("${key}"): success`);
2268
+ } else {
2269
+ this.logger?.warn("LocalStorage not available: window.localStorage is undefined");
2270
+ }
2271
+ } catch (error) {
2272
+ this.logger?.error("LocalStorage.setItem failed:", error);
2273
+ }
2274
+ }
2275
+ removeItem(key) {
2276
+ try {
2277
+ if (typeof window !== "undefined" && window.localStorage) {
2278
+ localStorage.removeItem(key);
2279
+ this.logger?.debug(`LocalStorage.removeItem("${key}"): success`);
2280
+ } else {
2281
+ this.logger?.warn("LocalStorage not available: window.localStorage is undefined");
2282
+ }
2283
+ } catch (error) {
2284
+ this.logger?.error("LocalStorage.removeItem failed:", error);
2285
+ }
2286
+ }
2287
+ };
2288
+
2289
+ // src/generated/cfg_webpush/_utils/schemas/index.ts
2290
+ var schemas_exports2 = {};
2291
+ __export(schemas_exports2, {
2292
+ SendPushRequestRequestSchema: () => SendPushRequestRequestSchema,
2293
+ SendPushResponseSchema: () => SendPushResponseSchema,
2294
+ SubscribeRequestRequestSchema: () => SubscribeRequestRequestSchema,
2295
+ SubscribeResponseSchema: () => SubscribeResponseSchema,
2296
+ VapidPublicKeyResponseSchema: () => VapidPublicKeyResponseSchema
2297
+ });
2298
+
2299
+ // src/generated/cfg_webpush/_utils/schemas/SendPushRequestRequest.schema.ts
2300
+ import { z as z20 } from "zod";
2301
+ var SendPushRequestRequestSchema = z20.object({
2302
+ title: z20.string().min(1).max(255),
2303
+ body: z20.string().min(1),
2304
+ icon: z20.url().nullable().optional(),
2305
+ url: z20.url().nullable().optional()
2306
+ });
2307
+
2308
+ // src/generated/cfg_webpush/_utils/schemas/SendPushResponse.schema.ts
2309
+ import { z as z21 } from "zod";
2310
+ var SendPushResponseSchema = z21.object({
2311
+ success: z21.boolean(),
2312
+ sent_to: z21.int()
2313
+ });
2314
+
2315
+ // src/generated/cfg_webpush/_utils/schemas/SubscribeRequestRequest.schema.ts
2316
+ import { z as z22 } from "zod";
2317
+ var SubscribeRequestRequestSchema = z22.object({
2318
+ endpoint: z22.url(),
2319
+ keys: z22.record(z22.string(), z22.string().min(1))
2320
+ });
2321
+
2322
+ // src/generated/cfg_webpush/_utils/schemas/SubscribeResponse.schema.ts
2323
+ import { z as z23 } from "zod";
2324
+ var SubscribeResponseSchema = z23.object({
2325
+ success: z23.boolean(),
2326
+ subscription_id: z23.int(),
2327
+ created: z23.boolean()
2328
+ });
2329
+
2330
+ // src/generated/cfg_webpush/_utils/schemas/VapidPublicKeyResponse.schema.ts
2331
+ import { z as z24 } from "zod";
2332
+ var VapidPublicKeyResponseSchema = z24.object({
2333
+ publicKey: z24.string()
2334
+ });
2335
+
2336
+ // src/generated/cfg_webpush/_utils/fetchers/index.ts
2337
+ var fetchers_exports2 = {};
2338
+ __export(fetchers_exports2, {
2339
+ createWebpushSendCreate: () => createWebpushSendCreate,
2340
+ createWebpushSubscribeCreate: () => createWebpushSubscribeCreate,
2341
+ getWebpushVapidRetrieve: () => getWebpushVapidRetrieve
2342
+ });
2343
+
2344
+ // src/generated/cfg_webpush/_utils/fetchers/webpush__web_push.ts
2345
+ import { consola as consola5 } from "consola";
2346
+
2347
+ // src/generated/cfg_webpush/api-instance.ts
2348
+ var globalAPI2 = null;
2349
+ function getAPIInstance2() {
2350
+ if (!globalAPI2) {
2351
+ throw new Error(
2352
+ 'API not configured. Call configureAPI() with your base URL before using fetchers or hooks.\n\nExample:\n import { configureAPI } from "./api-instance"\n configureAPI({ baseUrl: "https://api.example.com" })'
2353
+ );
2354
+ }
2355
+ return globalAPI2;
2356
+ }
2357
+ __name(getAPIInstance2, "getAPIInstance");
2358
+
2359
+ // src/generated/cfg_webpush/_utils/fetchers/webpush__web_push.ts
2360
+ async function createWebpushSendCreate(data, client) {
2361
+ const api = client || getAPIInstance2();
2362
+ const response = await api.web_push.webpushSendCreate(data);
2363
+ try {
2364
+ return SendPushResponseSchema.parse(response);
2365
+ } catch (error) {
2366
+ consola5.error("\u274C Zod Validation Failed");
2367
+ consola5.box(`createWebpushSendCreate
2368
+ Path: /cfg/webpush/send/
2369
+ Method: POST`);
2370
+ if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
2371
+ consola5.error("Validation Issues:");
2372
+ error.issues.forEach((issue, index) => {
2373
+ consola5.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
2374
+ consola5.error(` \u251C\u2500 Message: ${issue.message}`);
2375
+ if (issue.expected) consola5.error(` \u251C\u2500 Expected: ${issue.expected}`);
2376
+ if (issue.received) consola5.error(` \u2514\u2500 Received: ${issue.received}`);
2377
+ });
2378
+ }
2379
+ consola5.error("Response data:", response);
2380
+ if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
2381
+ try {
2382
+ const event = new CustomEvent("zod-validation-error", {
2383
+ detail: {
2384
+ operation: "createWebpushSendCreate",
2385
+ path: "/cfg/webpush/send/",
2386
+ method: "POST",
2387
+ error,
2388
+ response,
2389
+ timestamp: /* @__PURE__ */ new Date()
2390
+ },
2391
+ bubbles: true,
2392
+ cancelable: false
2393
+ });
2394
+ window.dispatchEvent(event);
2395
+ } catch (eventError) {
2396
+ consola5.warn("Failed to dispatch validation error event:", eventError);
2397
+ }
2398
+ }
2399
+ throw error;
2400
+ }
2401
+ }
2402
+ __name(createWebpushSendCreate, "createWebpushSendCreate");
2403
+ async function createWebpushSubscribeCreate(data, client) {
2404
+ const api = client || getAPIInstance2();
2405
+ const response = await api.web_push.webpushSubscribeCreate(data);
2406
+ try {
2407
+ return SubscribeResponseSchema.parse(response);
2408
+ } catch (error) {
2409
+ consola5.error("\u274C Zod Validation Failed");
2410
+ consola5.box(`createWebpushSubscribeCreate
2411
+ Path: /cfg/webpush/subscribe/
2412
+ Method: POST`);
2413
+ if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
2414
+ consola5.error("Validation Issues:");
2415
+ error.issues.forEach((issue, index) => {
2416
+ consola5.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
2417
+ consola5.error(` \u251C\u2500 Message: ${issue.message}`);
2418
+ if (issue.expected) consola5.error(` \u251C\u2500 Expected: ${issue.expected}`);
2419
+ if (issue.received) consola5.error(` \u2514\u2500 Received: ${issue.received}`);
2420
+ });
2421
+ }
2422
+ consola5.error("Response data:", response);
2423
+ if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
2424
+ try {
2425
+ const event = new CustomEvent("zod-validation-error", {
2426
+ detail: {
2427
+ operation: "createWebpushSubscribeCreate",
2428
+ path: "/cfg/webpush/subscribe/",
2429
+ method: "POST",
2430
+ error,
2431
+ response,
2432
+ timestamp: /* @__PURE__ */ new Date()
2433
+ },
2434
+ bubbles: true,
2435
+ cancelable: false
2436
+ });
2437
+ window.dispatchEvent(event);
2438
+ } catch (eventError) {
2439
+ consola5.warn("Failed to dispatch validation error event:", eventError);
2440
+ }
2441
+ }
2442
+ throw error;
2443
+ }
2444
+ }
2445
+ __name(createWebpushSubscribeCreate, "createWebpushSubscribeCreate");
2446
+ async function getWebpushVapidRetrieve(client) {
2447
+ const api = client || getAPIInstance2();
2448
+ const response = await api.web_push.webpushVapidRetrieve();
2449
+ try {
2450
+ return VapidPublicKeyResponseSchema.parse(response);
2451
+ } catch (error) {
2452
+ consola5.error("\u274C Zod Validation Failed");
2453
+ consola5.box(`getWebpushVapidRetrieve
2454
+ Path: /cfg/webpush/vapid/
2455
+ Method: GET`);
2456
+ if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
2457
+ consola5.error("Validation Issues:");
2458
+ error.issues.forEach((issue, index) => {
2459
+ consola5.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
2460
+ consola5.error(` \u251C\u2500 Message: ${issue.message}`);
2461
+ if (issue.expected) consola5.error(` \u251C\u2500 Expected: ${issue.expected}`);
2462
+ if (issue.received) consola5.error(` \u2514\u2500 Received: ${issue.received}`);
2463
+ });
2464
+ }
2465
+ consola5.error("Response data:", response);
2466
+ if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
2467
+ try {
2468
+ const event = new CustomEvent("zod-validation-error", {
2469
+ detail: {
2470
+ operation: "getWebpushVapidRetrieve",
2471
+ path: "/cfg/webpush/vapid/",
2472
+ method: "GET",
2473
+ error,
2474
+ response,
2475
+ timestamp: /* @__PURE__ */ new Date()
2476
+ },
2477
+ bubbles: true,
2478
+ cancelable: false
2479
+ });
2480
+ window.dispatchEvent(event);
2481
+ } catch (eventError) {
2482
+ consola5.warn("Failed to dispatch validation error event:", eventError);
2483
+ }
2484
+ }
2485
+ throw error;
2486
+ }
2487
+ }
2488
+ __name(getWebpushVapidRetrieve, "getWebpushVapidRetrieve");
2489
+
2490
+ // src/generated/cfg_webpush/index.ts
2491
+ var TOKEN_KEY2 = "auth_token";
2492
+ var REFRESH_TOKEN_KEY2 = "refresh_token";
2493
+ var API2 = class {
2494
+ constructor(baseUrl, options) {
2495
+ this._token = null;
2496
+ this._refreshToken = null;
2497
+ this.baseUrl = baseUrl;
2498
+ this.options = options;
2499
+ const logger = options?.loggerConfig ? new APILogger2(options.loggerConfig) : void 0;
2500
+ this.storage = options?.storage || new LocalStorageAdapter2(logger);
2501
+ this._loadTokensFromStorage();
2502
+ this._client = new APIClient2(this.baseUrl, {
2503
+ retryConfig: this.options?.retryConfig,
2504
+ loggerConfig: this.options?.loggerConfig
2505
+ });
2506
+ this._injectAuthHeader();
2507
+ this.web_push = this._client.web_push;
2508
+ }
2509
+ static {
2510
+ __name(this, "API");
2511
+ }
2512
+ _loadTokensFromStorage() {
2513
+ this._token = this.storage.getItem(TOKEN_KEY2);
2514
+ this._refreshToken = this.storage.getItem(REFRESH_TOKEN_KEY2);
2515
+ }
2516
+ _reinitClients() {
2517
+ this._client = new APIClient2(this.baseUrl, {
2518
+ retryConfig: this.options?.retryConfig,
2519
+ loggerConfig: this.options?.loggerConfig
2520
+ });
2521
+ this._injectAuthHeader();
2522
+ this.web_push = this._client.web_push;
2523
+ }
2524
+ _injectAuthHeader() {
2525
+ const originalRequest = this._client.request.bind(this._client);
2526
+ this._client.request = async (method, path, options) => {
2527
+ const token = this.getToken();
2528
+ const mergedOptions = {
2529
+ ...options,
2530
+ headers: {
2531
+ ...options?.headers || {},
2532
+ ...token ? { "Authorization": `Bearer ${token}` } : {}
2533
+ }
2534
+ };
2535
+ return originalRequest(method, path, mergedOptions);
2536
+ };
2537
+ }
2538
+ /**
2539
+ * Get current JWT token
2540
+ */
2541
+ getToken() {
2542
+ return this.storage.getItem(TOKEN_KEY2);
2543
+ }
2544
+ /**
2545
+ * Get current refresh token
2546
+ */
2547
+ getRefreshToken() {
2548
+ return this.storage.getItem(REFRESH_TOKEN_KEY2);
2549
+ }
2550
+ /**
2551
+ * Set JWT token and refresh token
2552
+ * @param token - JWT access token
2553
+ * @param refreshToken - JWT refresh token (optional)
2554
+ */
2555
+ setToken(token, refreshToken) {
2556
+ this._token = token;
2557
+ this.storage.setItem(TOKEN_KEY2, token);
2558
+ if (refreshToken) {
2559
+ this._refreshToken = refreshToken;
2560
+ this.storage.setItem(REFRESH_TOKEN_KEY2, refreshToken);
2561
+ }
2562
+ this._reinitClients();
2563
+ }
2564
+ /**
2565
+ * Clear all tokens
2566
+ */
2567
+ clearTokens() {
2568
+ this._token = null;
2569
+ this._refreshToken = null;
2570
+ this.storage.removeItem(TOKEN_KEY2);
2571
+ this.storage.removeItem(REFRESH_TOKEN_KEY2);
2572
+ this._reinitClients();
2573
+ }
2574
+ /**
2575
+ * Check if user is authenticated
2576
+ */
2577
+ isAuthenticated() {
2578
+ return !!this.getToken();
2579
+ }
2580
+ /**
2581
+ * Update base URL and reinitialize clients
2582
+ * @param url - New base URL
2583
+ */
2584
+ setBaseUrl(url) {
2585
+ this.baseUrl = url;
2586
+ this._reinitClients();
2587
+ }
2588
+ /**
2589
+ * Get current base URL
2590
+ */
2591
+ getBaseUrl() {
2592
+ return this.baseUrl;
2593
+ }
2594
+ /**
2595
+ * Get OpenAPI schema path
2596
+ * @returns Path to the OpenAPI schema JSON file
2597
+ *
2598
+ * Note: The OpenAPI schema is available in the schema.json file.
2599
+ * You can load it dynamically using:
2600
+ * ```typescript
2601
+ * const schema = await fetch('./schema.json').then(r => r.json());
2602
+ * // or using fs in Node.js:
2603
+ * // const schema = JSON.parse(fs.readFileSync('./schema.json', 'utf-8'));
2604
+ * ```
2605
+ */
2606
+ getSchemaPath() {
2607
+ return "./schema.json";
2608
+ }
2609
+ };
2610
+
2611
+ // src/generated/cfg_centrifugo/centrifugo__centrifugo_admin_api/client.ts
2612
+ var CentrifugoAdminApi = class {
2613
+ static {
2614
+ __name(this, "CentrifugoAdminApi");
2615
+ }
2616
+ constructor(client) {
2617
+ this.client = client;
2618
+ }
2619
+ /**
2620
+ * Get connection token for dashboard
2621
+ *
2622
+ * Returns JWT token and config for WebSocket connection to Centrifugo.
2623
+ */
2624
+ async centrifugoServerAuthTokenCreate() {
2625
+ const response = await this.client.request("POST", "/cfg/centrifugo/server/auth/token/");
2626
+ return response;
2627
+ }
2628
+ /**
2629
+ * List active channels
2630
+ *
2631
+ * Returns list of active channels with optional pattern filter.
2632
+ */
2633
+ async centrifugoServerChannelsCreate(data) {
2634
+ const response = await this.client.request("POST", "/cfg/centrifugo/server/channels/", { body: data });
2635
+ return response;
2636
+ }
2637
+ /**
2638
+ * Get channel history
2639
+ *
2640
+ * Returns message history for a channel.
2641
+ */
2642
+ async centrifugoServerHistoryCreate(data) {
2643
+ const response = await this.client.request("POST", "/cfg/centrifugo/server/history/", { body: data });
2644
+ return response;
2645
+ }
2646
+ /**
2647
+ * Get Centrifugo server info
2648
+ *
2649
+ * Returns server information including node count, version, and uptime.
2650
+ */
2651
+ async centrifugoServerInfoCreate() {
2652
+ const response = await this.client.request("POST", "/cfg/centrifugo/server/info/");
2653
+ return response;
2654
+ }
2655
+ /**
2656
+ * Get channel presence
2657
+ *
2658
+ * Returns list of clients currently subscribed to a channel.
2659
+ */
2660
+ async centrifugoServerPresenceCreate(data) {
2661
+ const response = await this.client.request("POST", "/cfg/centrifugo/server/presence/", { body: data });
2662
+ return response;
2663
+ }
2664
+ /**
2665
+ * Get channel presence statistics
2666
+ *
2667
+ * Returns quick statistics about channel presence (num_clients,
2668
+ * num_users).
2669
+ */
2670
+ async centrifugoServerPresenceStatsCreate(data) {
2671
+ const response = await this.client.request("POST", "/cfg/centrifugo/server/presence-stats/", { body: data });
2672
+ return response;
2673
+ }
2674
+ };
2675
+
2676
+ // src/generated/cfg_centrifugo/centrifugo__centrifugo_auth/client.ts
2677
+ var CentrifugoAuth = class {
2678
+ static {
2679
+ __name(this, "CentrifugoAuth");
2680
+ }
2681
+ constructor(client) {
2682
+ this.client = client;
2683
+ }
2684
+ /**
2685
+ * Get Centrifugo connection token
2686
+ *
2687
+ * Generate JWT token for WebSocket connection to Centrifugo. Token
2688
+ * includes user's allowed channels based on their permissions. Requires
2689
+ * authentication.
2690
+ */
2691
+ async tokenRetrieve() {
2692
+ const response = await this.client.request("GET", "/cfg/centrifugo/auth/token/");
2693
+ return response;
2694
+ }
2695
+ };
2696
+
2697
+ // src/generated/cfg_centrifugo/centrifugo__centrifugo_monitoring/client.ts
2698
+ var CentrifugoMonitoring = class {
2699
+ static {
2700
+ __name(this, "CentrifugoMonitoring");
2701
+ }
2702
+ constructor(client) {
2703
+ this.client = client;
2704
+ }
2705
+ /**
2706
+ * Get channel statistics
2707
+ *
2708
+ * Returns statistics grouped by channel.
2709
+ */
2710
+ async centrifugoMonitorChannelsRetrieve(...args) {
2711
+ const isParamsObject = args.length === 1 && typeof args[0] === "object" && args[0] !== null && !Array.isArray(args[0]);
2712
+ let params;
2713
+ if (isParamsObject) {
2714
+ params = args[0];
2715
+ } else {
2716
+ params = { hours: args[0] };
2717
+ }
2718
+ const response = await this.client.request("GET", "/cfg/centrifugo/monitor/channels/", { params });
2719
+ return response.results || response;
2720
+ }
2721
+ /**
2722
+ * Get Centrifugo health status
2723
+ *
2724
+ * Returns the current health status of the Centrifugo client.
2725
+ */
2726
+ async centrifugoMonitorHealthRetrieve() {
2727
+ const response = await this.client.request("GET", "/cfg/centrifugo/monitor/health/");
2728
+ return response;
2729
+ }
2730
+ /**
2731
+ * Get overview statistics
2732
+ *
2733
+ * Returns overview statistics for Centrifugo publishes.
2734
+ */
2735
+ async centrifugoMonitorOverviewRetrieve(...args) {
2736
+ const isParamsObject = args.length === 1 && typeof args[0] === "object" && args[0] !== null && !Array.isArray(args[0]);
2737
+ let params;
2738
+ if (isParamsObject) {
2739
+ params = args[0];
2740
+ } else {
2741
+ params = { hours: args[0] };
2742
+ }
2743
+ const response = await this.client.request("GET", "/cfg/centrifugo/monitor/overview/", { params });
2744
+ return response;
2745
+ }
2746
+ /**
2747
+ * Get recent publishes
2748
+ *
2749
+ * Returns a paginated list of recent Centrifugo publishes with their
2750
+ * details. Uses standard DRF pagination.
2751
+ */
2752
+ async centrifugoMonitorPublishesList(...args) {
2753
+ const isParamsObject = args.length === 1 && typeof args[0] === "object" && args[0] !== null && !Array.isArray(args[0]);
2754
+ let params;
2755
+ if (isParamsObject) {
2756
+ params = args[0];
2757
+ } else {
2758
+ params = { channel: args[0], page: args[1], page_size: args[2], status: args[3] };
2759
+ }
2760
+ const response = await this.client.request("GET", "/cfg/centrifugo/monitor/publishes/", { params });
2761
+ return response;
2762
+ }
2763
+ /**
2764
+ * Get publish timeline
2765
+ *
2766
+ * Returns hourly or daily breakdown of publish counts for charts.
2767
+ */
2768
+ async centrifugoMonitorTimelineRetrieve(...args) {
2769
+ const isParamsObject = args.length === 1 && typeof args[0] === "object" && args[0] !== null && !Array.isArray(args[0]);
2770
+ let params;
2771
+ if (isParamsObject) {
2772
+ params = args[0];
2773
+ } else {
2774
+ params = { hours: args[0], interval: args[1] };
2775
+ }
2776
+ const response = await this.client.request("GET", "/cfg/centrifugo/monitor/timeline/", { params });
2777
+ return response;
2778
+ }
2779
+ };
2780
+
2781
+ // src/generated/cfg_centrifugo/centrifugo__centrifugo_testing/client.ts
2782
+ var CentrifugoTesting = class {
2783
+ static {
2784
+ __name(this, "CentrifugoTesting");
2785
+ }
2786
+ constructor(client) {
2787
+ this.client = client;
2788
+ }
2789
+ /**
2790
+ * Publish test message
2791
+ *
2792
+ * Publish test message to Centrifugo via wrapper with optional ACK
2793
+ * tracking.
2794
+ */
2795
+ async publishTestCreate(data) {
2796
+ const response = await this.client.request("POST", "/cfg/centrifugo/testing/publish-test/", { body: data });
2797
+ return response;
2798
+ }
2799
+ /**
2800
+ * Publish with database logging
2801
+ *
2802
+ * Publish message using CentrifugoClient with database logging. This will
2803
+ * create CentrifugoLog records.
2804
+ */
2805
+ async publishWithLoggingCreate(data) {
2806
+ const response = await this.client.request("POST", "/cfg/centrifugo/testing/publish-with-logging/", { body: data });
2807
+ return response;
2808
+ }
2809
+ /**
2810
+ * Send manual ACK
2811
+ *
2812
+ * Manually send ACK for a message to the wrapper. Pass message_id in
2813
+ * request body.
2814
+ */
2815
+ async sendAckCreate(data) {
2816
+ const response = await this.client.request("POST", "/cfg/centrifugo/testing/send-ack/", { body: data });
2817
+ return response;
2818
+ }
2819
+ };
2820
+
2821
+ // src/generated/cfg_centrifugo/http.ts
2822
+ var FetchAdapter3 = class {
2823
+ static {
2824
+ __name(this, "FetchAdapter");
2825
+ }
2826
+ async request(request) {
2827
+ const { method, url, headers, body, params, formData } = request;
2828
+ let finalUrl = url;
2829
+ if (params) {
2830
+ const searchParams = new URLSearchParams();
2831
+ Object.entries(params).forEach(([key, value]) => {
2832
+ if (value !== null && value !== void 0) {
2833
+ searchParams.append(key, String(value));
2834
+ }
2835
+ });
2836
+ const queryString = searchParams.toString();
2837
+ if (queryString) {
2838
+ finalUrl = url.includes("?") ? `${url}&${queryString}` : `${url}?${queryString}`;
2839
+ }
2840
+ }
2841
+ const finalHeaders = { ...headers };
2842
+ let requestBody;
2843
+ if (formData) {
2844
+ requestBody = formData;
2845
+ } else if (body) {
2846
+ finalHeaders["Content-Type"] = "application/json";
2847
+ requestBody = JSON.stringify(body);
2848
+ }
2849
+ const response = await fetch(finalUrl, {
2850
+ method,
2851
+ headers: finalHeaders,
2852
+ body: requestBody,
2853
+ credentials: "include"
2854
+ // Include Django session cookies
2855
+ });
2856
+ let data = null;
2857
+ const contentType = response.headers.get("content-type");
2858
+ if (response.status !== 204 && contentType?.includes("application/json")) {
2859
+ data = await response.json();
2860
+ } else if (response.status !== 204) {
2861
+ data = await response.text();
2862
+ }
2863
+ const responseHeaders = {};
2864
+ response.headers.forEach((value, key) => {
2865
+ responseHeaders[key] = value;
2866
+ });
2867
+ return {
2868
+ data,
2869
+ status: response.status,
2870
+ statusText: response.statusText,
2871
+ headers: responseHeaders
2872
+ };
2873
+ }
2874
+ };
2875
+
2876
+ // src/generated/cfg_centrifugo/errors.ts
2877
+ var APIError3 = class extends Error {
2878
+ constructor(statusCode, statusText, response, url, message) {
2879
+ super(message || `HTTP ${statusCode}: ${statusText}`);
2880
+ this.statusCode = statusCode;
2881
+ this.statusText = statusText;
2882
+ this.response = response;
2883
+ this.url = url;
2884
+ this.name = "APIError";
2885
+ }
2886
+ static {
2887
+ __name(this, "APIError");
2888
+ }
2889
+ /**
2890
+ * Get error details from response.
2891
+ * DRF typically returns: { "detail": "Error message" } or { "field": ["error1", "error2"] }
2892
+ */
2893
+ get details() {
2894
+ if (typeof this.response === "object" && this.response !== null) {
2895
+ return this.response;
2896
+ }
2897
+ return null;
2898
+ }
2899
+ /**
2900
+ * Get field-specific validation errors from DRF.
2901
+ * Returns: { "field_name": ["error1", "error2"], ... }
2902
+ */
2903
+ get fieldErrors() {
2904
+ const details = this.details;
2905
+ if (!details) return null;
2906
+ const fieldErrors = {};
2907
+ for (const [key, value] of Object.entries(details)) {
2908
+ if (Array.isArray(value)) {
2909
+ fieldErrors[key] = value;
2910
+ }
2911
+ }
2912
+ return Object.keys(fieldErrors).length > 0 ? fieldErrors : null;
2913
+ }
2914
+ /**
2915
+ * Get single error message from DRF.
2916
+ * Checks for "detail", "message", or first field error.
2917
+ */
2918
+ get errorMessage() {
2919
+ const details = this.details;
2920
+ if (!details) return this.message;
2921
+ if (details.detail) {
2922
+ return Array.isArray(details.detail) ? details.detail.join(", ") : String(details.detail);
2923
+ }
2924
+ if (details.message) {
2925
+ return String(details.message);
2926
+ }
2927
+ const fieldErrors = this.fieldErrors;
2928
+ if (fieldErrors) {
2929
+ const firstField = Object.keys(fieldErrors)[0];
2930
+ if (firstField) {
2931
+ return `${firstField}: ${fieldErrors[firstField]?.join(", ")}`;
2932
+ }
2933
+ }
2934
+ return this.message;
2935
+ }
2936
+ // Helper methods for common HTTP status codes
2937
+ get isValidationError() {
2938
+ return this.statusCode === 400;
2939
+ }
2940
+ get isAuthError() {
2941
+ return this.statusCode === 401;
2942
+ }
2943
+ get isPermissionError() {
2944
+ return this.statusCode === 403;
2945
+ }
2946
+ get isNotFoundError() {
2947
+ return this.statusCode === 404;
2948
+ }
2949
+ get isServerError() {
2950
+ return this.statusCode >= 500 && this.statusCode < 600;
2951
+ }
2952
+ };
2953
+ var NetworkError3 = class extends Error {
2954
+ constructor(message, url, originalError) {
2955
+ super(message);
2956
+ this.url = url;
2957
+ this.originalError = originalError;
2958
+ this.name = "NetworkError";
2959
+ }
2960
+ static {
2961
+ __name(this, "NetworkError");
2962
+ }
2963
+ };
2964
+
2965
+ // src/generated/cfg_centrifugo/logger.ts
2966
+ import { createConsola as createConsola3 } from "consola";
2967
+ var DEFAULT_CONFIG3 = {
2968
+ enabled: process.env.NODE_ENV !== "production",
2969
+ logRequests: true,
2970
+ logResponses: true,
2971
+ logErrors: true,
2972
+ logBodies: true,
2973
+ logHeaders: false
2974
+ };
2975
+ var SENSITIVE_HEADERS3 = [
2976
+ "authorization",
2977
+ "cookie",
2978
+ "set-cookie",
2979
+ "x-api-key",
2980
+ "x-csrf-token"
2981
+ ];
2982
+ var APILogger3 = class {
2983
+ static {
2984
+ __name(this, "APILogger");
2985
+ }
2986
+ constructor(config = {}) {
2987
+ this.config = { ...DEFAULT_CONFIG3, ...config };
2988
+ this.consola = config.consola || createConsola3({
2989
+ level: this.config.enabled ? 4 : 0
2990
+ });
2991
+ }
2992
+ /**
2993
+ * Enable logging
2994
+ */
2995
+ enable() {
2996
+ this.config.enabled = true;
2997
+ }
2998
+ /**
2999
+ * Disable logging
3000
+ */
3001
+ disable() {
3002
+ this.config.enabled = false;
3003
+ }
3004
+ /**
3005
+ * Update configuration
3006
+ */
3007
+ setConfig(config) {
3008
+ this.config = { ...this.config, ...config };
3009
+ }
3010
+ /**
3011
+ * Filter sensitive headers
3012
+ */
3013
+ filterHeaders(headers) {
3014
+ if (!headers) return {};
3015
+ const filtered = {};
3016
+ Object.keys(headers).forEach((key) => {
3017
+ const lowerKey = key.toLowerCase();
3018
+ if (SENSITIVE_HEADERS3.includes(lowerKey)) {
3019
+ filtered[key] = "***";
3020
+ } else {
3021
+ filtered[key] = headers[key] || "";
3022
+ }
3023
+ });
3024
+ return filtered;
3025
+ }
3026
+ /**
3027
+ * Log request
3028
+ */
3029
+ logRequest(request) {
3030
+ if (!this.config.enabled || !this.config.logRequests) return;
3031
+ const { method, url, headers, body } = request;
3032
+ this.consola.start(`${method} ${url}`);
3033
+ if (this.config.logHeaders && headers) {
3034
+ this.consola.debug("Headers:", this.filterHeaders(headers));
3035
+ }
3036
+ if (this.config.logBodies && body) {
3037
+ this.consola.debug("Body:", body);
3038
+ }
3039
+ }
3040
+ /**
3041
+ * Log response
3042
+ */
3043
+ logResponse(request, response) {
3044
+ if (!this.config.enabled || !this.config.logResponses) return;
3045
+ const { method, url } = request;
3046
+ const { status, statusText, data, duration } = response;
3047
+ const statusColor = status >= 500 ? "red" : status >= 400 ? "yellow" : status >= 300 ? "cyan" : "green";
3048
+ this.consola.success(
3049
+ `${method} ${url} ${status} ${statusText} (${duration}ms)`
3050
+ );
3051
+ if (this.config.logBodies && data) {
3052
+ this.consola.debug("Response:", data);
3053
+ }
3054
+ }
3055
+ /**
3056
+ * Log error
3057
+ */
3058
+ logError(request, error) {
3059
+ if (!this.config.enabled || !this.config.logErrors) return;
3060
+ const { method, url } = request;
3061
+ const { message, statusCode, fieldErrors, duration } = error;
3062
+ this.consola.error(
3063
+ `${method} ${url} ${statusCode || "Network"} Error (${duration}ms)`
3064
+ );
3065
+ this.consola.error("Message:", message);
3066
+ if (fieldErrors && Object.keys(fieldErrors).length > 0) {
3067
+ this.consola.error("Field Errors:");
3068
+ Object.entries(fieldErrors).forEach(([field, errors]) => {
3069
+ errors.forEach((err) => {
3070
+ this.consola.error(` \u2022 ${field}: ${err}`);
3071
+ });
3072
+ });
3073
+ }
3074
+ }
3075
+ /**
3076
+ * Log general info
3077
+ */
3078
+ info(message, ...args) {
3079
+ if (!this.config.enabled) return;
3080
+ this.consola.info(message, ...args);
3081
+ }
3082
+ /**
3083
+ * Log warning
3084
+ */
3085
+ warn(message, ...args) {
3086
+ if (!this.config.enabled) return;
3087
+ this.consola.warn(message, ...args);
3088
+ }
3089
+ /**
3090
+ * Log error
3091
+ */
3092
+ error(message, ...args) {
3093
+ if (!this.config.enabled) return;
3094
+ this.consola.error(message, ...args);
3095
+ }
3096
+ /**
3097
+ * Log debug
3098
+ */
3099
+ debug(message, ...args) {
3100
+ if (!this.config.enabled) return;
3101
+ this.consola.debug(message, ...args);
3102
+ }
3103
+ /**
3104
+ * Log success
3105
+ */
3106
+ success(message, ...args) {
3107
+ if (!this.config.enabled) return;
3108
+ this.consola.success(message, ...args);
3109
+ }
3110
+ /**
3111
+ * Create a sub-logger with prefix
3112
+ */
3113
+ withTag(tag) {
3114
+ return this.consola.withTag(tag);
3115
+ }
3116
+ };
3117
+ var defaultLogger3 = new APILogger3();
3118
+
3119
+ // src/generated/cfg_centrifugo/retry.ts
3120
+ import pRetry3, { AbortError as AbortError3 } from "p-retry";
3121
+ var DEFAULT_RETRY_CONFIG3 = {
3122
+ retries: 3,
3123
+ factor: 2,
3124
+ minTimeout: 1e3,
3125
+ maxTimeout: 6e4,
3126
+ randomize: true,
3127
+ onFailedAttempt: /* @__PURE__ */ __name(() => {
3128
+ }, "onFailedAttempt")
3129
+ };
3130
+ function shouldRetry3(error) {
3131
+ if (error instanceof NetworkError3) {
3132
+ return true;
3133
+ }
3134
+ if (error instanceof APIError3) {
3135
+ const status = error.statusCode;
3136
+ if (status >= 500 && status < 600) {
3137
+ return true;
3138
+ }
3139
+ if (status === 429) {
3140
+ return true;
3141
+ }
3142
+ return false;
3143
+ }
3144
+ return true;
3145
+ }
3146
+ __name(shouldRetry3, "shouldRetry");
3147
+ async function withRetry3(fn, config) {
3148
+ const finalConfig = { ...DEFAULT_RETRY_CONFIG3, ...config };
3149
+ return pRetry3(
3150
+ async () => {
3151
+ try {
3152
+ return await fn();
3153
+ } catch (error) {
3154
+ if (!shouldRetry3(error)) {
3155
+ throw new AbortError3(error);
3156
+ }
3157
+ throw error;
3158
+ }
3159
+ },
3160
+ {
3161
+ retries: finalConfig.retries,
3162
+ factor: finalConfig.factor,
3163
+ minTimeout: finalConfig.minTimeout,
3164
+ maxTimeout: finalConfig.maxTimeout,
3165
+ randomize: finalConfig.randomize,
3166
+ onFailedAttempt: finalConfig.onFailedAttempt ? (error) => {
3167
+ const pRetryError = error;
3168
+ finalConfig.onFailedAttempt({
3169
+ error: pRetryError,
3170
+ attemptNumber: pRetryError.attemptNumber,
3171
+ retriesLeft: pRetryError.retriesLeft
3172
+ });
3173
+ } : void 0
3174
+ }
3175
+ );
3176
+ }
3177
+ __name(withRetry3, "withRetry");
3178
+
3179
+ // src/generated/cfg_centrifugo/client.ts
3180
+ var APIClient3 = class {
3181
+ constructor(baseUrl, options) {
3182
+ this.logger = null;
3183
+ this.retryConfig = null;
3184
+ this.baseUrl = baseUrl.replace(/\/$/, "");
3185
+ this.httpClient = options?.httpClient || new FetchAdapter3();
3186
+ if (options?.loggerConfig !== void 0) {
3187
+ this.logger = new APILogger3(options.loggerConfig);
3188
+ }
3189
+ if (options?.retryConfig !== void 0) {
3190
+ this.retryConfig = options.retryConfig;
3191
+ }
3192
+ this.centrifugo_admin_api = new CentrifugoAdminApi(this);
3193
+ this.centrifugo_auth = new CentrifugoAuth(this);
3194
+ this.centrifugo_monitoring = new CentrifugoMonitoring(this);
3195
+ this.centrifugo_testing = new CentrifugoTesting(this);
3196
+ }
3197
+ static {
3198
+ __name(this, "APIClient");
3199
+ }
3200
+ /**
3201
+ * Get CSRF token from cookies (for SessionAuthentication).
3202
+ *
3203
+ * Returns null if cookie doesn't exist (JWT-only auth).
3204
+ */
3205
+ getCsrfToken() {
3206
+ const name = "csrftoken";
3207
+ const value = `; ${document.cookie}`;
3208
+ const parts = value.split(`; ${name}=`);
3209
+ if (parts.length === 2) {
3210
+ return parts.pop()?.split(";").shift() || null;
3211
+ }
3212
+ return null;
3213
+ }
3214
+ /**
3215
+ * Make HTTP request with Django CSRF and session handling.
3216
+ * Automatically retries on network errors and 5xx server errors.
3217
+ */
3218
+ async request(method, path, options) {
3219
+ if (this.retryConfig) {
3220
+ return withRetry3(() => this._makeRequest(method, path, options), {
3221
+ ...this.retryConfig,
3222
+ onFailedAttempt: /* @__PURE__ */ __name((info) => {
3223
+ if (this.logger) {
3224
+ this.logger.warn(
3225
+ `Retry attempt ${info.attemptNumber}/${info.retriesLeft + info.attemptNumber} for ${method} ${path}: ${info.error.message}`
3226
+ );
3227
+ }
3228
+ this.retryConfig?.onFailedAttempt?.(info);
3229
+ }, "onFailedAttempt")
3230
+ });
3231
+ }
3232
+ return this._makeRequest(method, path, options);
3233
+ }
3234
+ /**
3235
+ * Internal request method (without retry wrapper).
3236
+ * Used by request() method with optional retry logic.
3237
+ */
3238
+ async _makeRequest(method, path, options) {
3239
+ const url = this.baseUrl ? `${this.baseUrl}${path}` : path;
3240
+ const startTime = Date.now();
3241
+ const headers = {
3242
+ ...options?.headers || {}
3243
+ };
3244
+ if (!options?.formData && !headers["Content-Type"]) {
3245
+ headers["Content-Type"] = "application/json";
3246
+ }
3247
+ if (this.logger) {
3248
+ this.logger.logRequest({
3249
+ method,
3250
+ url,
3251
+ headers,
3252
+ body: options?.formData || options?.body,
3253
+ timestamp: startTime
3254
+ });
3255
+ }
3256
+ try {
3257
+ const response = await this.httpClient.request({
3258
+ method,
3259
+ url,
3260
+ headers,
3261
+ params: options?.params,
3262
+ body: options?.body,
3263
+ formData: options?.formData
3264
+ });
3265
+ const duration = Date.now() - startTime;
3266
+ if (response.status >= 400) {
3267
+ const error = new APIError3(
3268
+ response.status,
3269
+ response.statusText,
3270
+ response.data,
3271
+ url
3272
+ );
3273
+ if (this.logger) {
3274
+ this.logger.logError(
3275
+ {
3276
+ method,
3277
+ url,
3278
+ headers,
3279
+ body: options?.formData || options?.body,
3280
+ timestamp: startTime
3281
+ },
3282
+ {
3283
+ message: error.message,
3284
+ statusCode: response.status,
3285
+ duration,
3286
+ timestamp: Date.now()
3287
+ }
3288
+ );
3289
+ }
3290
+ throw error;
3291
+ }
3292
+ if (this.logger) {
3293
+ this.logger.logResponse(
3294
+ {
3295
+ method,
3296
+ url,
3297
+ headers,
3298
+ body: options?.formData || options?.body,
3299
+ timestamp: startTime
3300
+ },
3301
+ {
3302
+ status: response.status,
3303
+ statusText: response.statusText,
3304
+ data: response.data,
3305
+ duration,
3306
+ timestamp: Date.now()
3307
+ }
3308
+ );
3309
+ }
3310
+ return response.data;
3311
+ } catch (error) {
3312
+ const duration = Date.now() - startTime;
3313
+ if (error instanceof APIError3) {
3314
+ throw error;
3315
+ }
3316
+ const isCORSError = error instanceof TypeError && (error.message.toLowerCase().includes("cors") || error.message.toLowerCase().includes("failed to fetch") || error.message.toLowerCase().includes("network request failed"));
3317
+ if (this.logger) {
3318
+ if (isCORSError) {
3319
+ this.logger.error(`\u{1F6AB} CORS Error: ${method} ${url}`);
3320
+ this.logger.error(` \u2192 ${error instanceof Error ? error.message : String(error)}`);
3321
+ this.logger.error(` \u2192 Configure security_domains parameter on the server`);
3322
+ } else {
3323
+ this.logger.error(`\u26A0\uFE0F Network Error: ${method} ${url}`);
3324
+ this.logger.error(` \u2192 ${error instanceof Error ? error.message : String(error)}`);
3325
+ }
3326
+ }
3327
+ if (typeof window !== "undefined") {
3328
+ try {
3329
+ if (isCORSError) {
3330
+ window.dispatchEvent(new CustomEvent("cors-error", {
3331
+ detail: {
3332
+ url,
3333
+ method,
3334
+ error: error instanceof Error ? error.message : String(error),
3335
+ timestamp: /* @__PURE__ */ new Date()
3336
+ },
3337
+ bubbles: true,
3338
+ cancelable: false
3339
+ }));
3340
+ } else {
3341
+ window.dispatchEvent(new CustomEvent("network-error", {
3342
+ detail: {
3343
+ url,
3344
+ method,
3345
+ error: error instanceof Error ? error.message : String(error),
3346
+ timestamp: /* @__PURE__ */ new Date()
3347
+ },
3348
+ bubbles: true,
3349
+ cancelable: false
3350
+ }));
3351
+ }
3352
+ } catch (eventError) {
3353
+ }
3354
+ }
3355
+ const networkError = error instanceof Error ? new NetworkError3(error.message, url, error) : new NetworkError3("Unknown error", url);
3356
+ if (this.logger) {
3357
+ this.logger.logError(
3358
+ {
3359
+ method,
3360
+ url,
3361
+ headers,
3362
+ body: options?.formData || options?.body,
3363
+ timestamp: startTime
3364
+ },
3365
+ {
3366
+ message: networkError.message,
3367
+ duration,
3368
+ timestamp: Date.now()
3369
+ }
3370
+ );
3371
+ }
3372
+ throw networkError;
3373
+ }
3374
+ }
3375
+ };
3376
+
3377
+ // src/generated/cfg_centrifugo/storage.ts
3378
+ var LocalStorageAdapter3 = class {
3379
+ static {
3380
+ __name(this, "LocalStorageAdapter");
3381
+ }
3382
+ constructor(logger) {
3383
+ this.logger = logger;
3384
+ }
3385
+ getItem(key) {
3386
+ try {
3387
+ if (typeof window !== "undefined" && window.localStorage) {
3388
+ const value = localStorage.getItem(key);
3389
+ this.logger?.debug(`LocalStorage.getItem("${key}"): ${value ? "found" : "not found"}`);
3390
+ return value;
3391
+ }
3392
+ this.logger?.warn("LocalStorage not available: window.localStorage is undefined");
3393
+ } catch (error) {
3394
+ this.logger?.error("LocalStorage.getItem failed:", error);
3395
+ }
3396
+ return null;
3397
+ }
3398
+ setItem(key, value) {
3399
+ try {
3400
+ if (typeof window !== "undefined" && window.localStorage) {
3401
+ localStorage.setItem(key, value);
3402
+ this.logger?.debug(`LocalStorage.setItem("${key}"): success`);
3403
+ } else {
3404
+ this.logger?.warn("LocalStorage not available: window.localStorage is undefined");
3405
+ }
3406
+ } catch (error) {
3407
+ this.logger?.error("LocalStorage.setItem failed:", error);
3408
+ }
3409
+ }
3410
+ removeItem(key) {
3411
+ try {
3412
+ if (typeof window !== "undefined" && window.localStorage) {
3413
+ localStorage.removeItem(key);
3414
+ this.logger?.debug(`LocalStorage.removeItem("${key}"): success`);
3415
+ } else {
3416
+ this.logger?.warn("LocalStorage not available: window.localStorage is undefined");
3417
+ }
3418
+ } catch (error) {
3419
+ this.logger?.error("LocalStorage.removeItem failed:", error);
3420
+ }
3421
+ }
3422
+ };
3423
+
3424
+ // src/generated/cfg_centrifugo/_utils/schemas/index.ts
3425
+ var schemas_exports3 = {};
3426
+ __export(schemas_exports3, {
3427
+ CentrifugoChannelInfoSchema: () => CentrifugoChannelInfoSchema,
3428
+ CentrifugoChannelsRequestRequestSchema: () => CentrifugoChannelsRequestRequestSchema,
3429
+ CentrifugoChannelsResponseSchema: () => CentrifugoChannelsResponseSchema,
3430
+ CentrifugoChannelsResultSchema: () => CentrifugoChannelsResultSchema,
3431
+ CentrifugoClientInfoSchema: () => CentrifugoClientInfoSchema,
3432
+ CentrifugoErrorSchema: () => CentrifugoErrorSchema,
3433
+ CentrifugoHealthCheckSchema: () => CentrifugoHealthCheckSchema,
3434
+ CentrifugoHistoryRequestRequestSchema: () => CentrifugoHistoryRequestRequestSchema,
3435
+ CentrifugoHistoryResponseSchema: () => CentrifugoHistoryResponseSchema,
3436
+ CentrifugoHistoryResultSchema: () => CentrifugoHistoryResultSchema,
3437
+ CentrifugoInfoResponseSchema: () => CentrifugoInfoResponseSchema,
3438
+ CentrifugoInfoResultSchema: () => CentrifugoInfoResultSchema,
3439
+ CentrifugoMetricsSchema: () => CentrifugoMetricsSchema,
3440
+ CentrifugoNodeInfoSchema: () => CentrifugoNodeInfoSchema,
3441
+ CentrifugoOverviewStatsSchema: () => CentrifugoOverviewStatsSchema,
3442
+ CentrifugoPresenceRequestRequestSchema: () => CentrifugoPresenceRequestRequestSchema,
3443
+ CentrifugoPresenceResponseSchema: () => CentrifugoPresenceResponseSchema,
3444
+ CentrifugoPresenceResultSchema: () => CentrifugoPresenceResultSchema,
3445
+ CentrifugoPresenceStatsRequestRequestSchema: () => CentrifugoPresenceStatsRequestRequestSchema,
3446
+ CentrifugoPresenceStatsResponseSchema: () => CentrifugoPresenceStatsResponseSchema,
3447
+ CentrifugoPresenceStatsResultSchema: () => CentrifugoPresenceStatsResultSchema,
3448
+ CentrifugoProcessSchema: () => CentrifugoProcessSchema,
3449
+ CentrifugoPublicationSchema: () => CentrifugoPublicationSchema,
3450
+ CentrifugoStreamPositionSchema: () => CentrifugoStreamPositionSchema,
3451
+ ChannelListSchema: () => ChannelListSchema,
3452
+ ChannelStatsSchema: () => ChannelStatsSchema,
3453
+ ConnectionTokenResponseSchema: () => ConnectionTokenResponseSchema,
3454
+ ManualAckRequestRequestSchema: () => ManualAckRequestRequestSchema,
3455
+ ManualAckResponseSchema: () => ManualAckResponseSchema,
3456
+ PaginatedPublishListSchema: () => PaginatedPublishListSchema,
3457
+ PublishSchema: () => PublishSchema,
3458
+ PublishTestRequestRequestSchema: () => PublishTestRequestRequestSchema,
3459
+ PublishTestResponseSchema: () => PublishTestResponseSchema,
3460
+ TimelineItemSchema: () => TimelineItemSchema,
3461
+ TimelineResponseSchema: () => TimelineResponseSchema
3462
+ });
3463
+
3464
+ // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelInfo.schema.ts
3465
+ import { z as z25 } from "zod";
3466
+ var CentrifugoChannelInfoSchema = z25.object({
3467
+ num_clients: z25.int()
3468
+ });
3469
+
3470
+ // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsRequestRequest.schema.ts
3471
+ import { z as z26 } from "zod";
3472
+ var CentrifugoChannelsRequestRequestSchema = z26.object({
3473
+ pattern: z26.string().nullable().optional()
3474
+ });
3475
+
3476
+ // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsResponse.schema.ts
3477
+ import { z as z29 } from "zod";
3478
+
3479
+ // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsResult.schema.ts
3480
+ import { z as z27 } from "zod";
3481
+ var CentrifugoChannelsResultSchema = z27.object({
3482
+ channels: z27.record(z27.string(), CentrifugoChannelInfoSchema)
3483
+ });
3484
+
3485
+ // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoError.schema.ts
3486
+ import { z as z28 } from "zod";
3487
+ var CentrifugoErrorSchema = z28.object({
3488
+ code: z28.int().optional(),
3489
+ message: z28.string().optional()
3490
+ });
3491
+
3492
+ // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsResponse.schema.ts
3493
+ var CentrifugoChannelsResponseSchema = z29.object({
3494
+ error: CentrifugoErrorSchema.optional(),
3495
+ result: CentrifugoChannelsResultSchema.optional()
3496
+ });
3497
+
3498
+ // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoClientInfo.schema.ts
3499
+ import { z as z30 } from "zod";
3500
+ var CentrifugoClientInfoSchema = z30.object({
3501
+ user: z30.string(),
3502
+ client: z30.string(),
3503
+ conn_info: z30.record(z30.string(), z30.any()).nullable().optional(),
3504
+ chan_info: z30.record(z30.string(), z30.any()).nullable().optional()
3505
+ });
3506
+
3507
+ // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHealthCheck.schema.ts
3508
+ import { z as z31 } from "zod";
3509
+ var CentrifugoHealthCheckSchema = z31.object({
3510
+ status: z31.string(),
3511
+ wrapper_url: z31.string(),
3512
+ has_api_key: z31.boolean(),
3513
+ timestamp: z31.string()
3514
+ });
3515
+
3516
+ // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryRequestRequest.schema.ts
3517
+ import { z as z33 } from "zod";
3518
+
3519
+ // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoStreamPosition.schema.ts
3520
+ import { z as z32 } from "zod";
3521
+ var CentrifugoStreamPositionSchema = z32.object({
3522
+ offset: z32.int(),
3523
+ epoch: z32.string()
3524
+ });
3525
+
3526
+ // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryRequestRequest.schema.ts
3527
+ var CentrifugoHistoryRequestRequestSchema = z33.object({
3528
+ channel: z33.string(),
3529
+ limit: z33.int().nullable().optional(),
3530
+ since: CentrifugoStreamPositionSchema.optional(),
3531
+ reverse: z33.boolean().nullable().optional()
3532
+ });
3533
+
3534
+ // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResponse.schema.ts
3535
+ import { z as z36 } from "zod";
3536
+
3537
+ // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResult.schema.ts
3538
+ import { z as z35 } from "zod";
3539
+
3540
+ // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPublication.schema.ts
3541
+ import { z as z34 } from "zod";
3542
+ var CentrifugoPublicationSchema = z34.object({
3543
+ data: z34.record(z34.string(), z34.any()),
3544
+ info: CentrifugoClientInfoSchema.optional(),
3545
+ offset: z34.int(),
3546
+ tags: z34.record(z34.string(), z34.any()).nullable().optional()
3547
+ });
3548
+
3549
+ // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResult.schema.ts
3550
+ var CentrifugoHistoryResultSchema = z35.object({
3551
+ publications: z35.array(CentrifugoPublicationSchema),
3552
+ epoch: z35.string(),
3553
+ offset: z35.int()
3554
+ });
3555
+
3556
+ // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResponse.schema.ts
3557
+ var CentrifugoHistoryResponseSchema = z36.object({
3558
+ error: CentrifugoErrorSchema.optional(),
3559
+ result: CentrifugoHistoryResultSchema.optional()
3560
+ });
3561
+
3562
+ // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResponse.schema.ts
3563
+ import { z as z41 } from "zod";
3564
+
3565
+ // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResult.schema.ts
3566
+ import { z as z40 } from "zod";
3567
+
3568
+ // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoNodeInfo.schema.ts
3569
+ import { z as z39 } from "zod";
3570
+
3571
+ // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoMetrics.schema.ts
3572
+ import { z as z37 } from "zod";
3573
+ var CentrifugoMetricsSchema = z37.object({
3574
+ interval: z37.number(),
3575
+ items: z37.record(z37.string(), z37.number())
3576
+ });
3577
+
3578
+ // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoProcess.schema.ts
3579
+ import { z as z38 } from "zod";
3580
+ var CentrifugoProcessSchema = z38.object({
3581
+ cpu: z38.number(),
3582
+ rss: z38.int()
3583
+ });
3584
+
3585
+ // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoNodeInfo.schema.ts
3586
+ var CentrifugoNodeInfoSchema = z39.object({
3587
+ uid: z39.string(),
3588
+ name: z39.string(),
3589
+ version: z39.string(),
3590
+ num_clients: z39.int(),
3591
+ num_users: z39.int(),
3592
+ num_channels: z39.int(),
3593
+ uptime: z39.int(),
3594
+ num_subs: z39.int(),
3595
+ metrics: CentrifugoMetricsSchema.optional(),
3596
+ process: CentrifugoProcessSchema.optional()
3597
+ });
3598
+
3599
+ // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResult.schema.ts
3600
+ var CentrifugoInfoResultSchema = z40.object({
3601
+ nodes: z40.array(CentrifugoNodeInfoSchema)
3602
+ });
3603
+
3604
+ // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResponse.schema.ts
3605
+ var CentrifugoInfoResponseSchema = z41.object({
3606
+ error: CentrifugoErrorSchema.optional(),
3607
+ result: CentrifugoInfoResultSchema.optional()
3608
+ });
3609
+
3610
+ // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoOverviewStats.schema.ts
3611
+ import { z as z42 } from "zod";
3612
+ var CentrifugoOverviewStatsSchema = z42.object({
3613
+ total: z42.int(),
3614
+ successful: z42.int(),
3615
+ failed: z42.int(),
3616
+ timeout: z42.int(),
3617
+ success_rate: z42.number(),
3618
+ avg_duration_ms: z42.number(),
3619
+ avg_acks_received: z42.number(),
3620
+ period_hours: z42.int()
3621
+ });
3622
+
3623
+ // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceRequestRequest.schema.ts
3624
+ import { z as z43 } from "zod";
3625
+ var CentrifugoPresenceRequestRequestSchema = z43.object({
3626
+ channel: z43.string()
3627
+ });
3628
+
3629
+ // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceResponse.schema.ts
3630
+ import { z as z45 } from "zod";
3631
+
3632
+ // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceResult.schema.ts
3633
+ import { z as z44 } from "zod";
3634
+ var CentrifugoPresenceResultSchema = z44.object({
3635
+ presence: z44.record(z44.string(), CentrifugoClientInfoSchema)
3636
+ });
3637
+
3638
+ // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceResponse.schema.ts
3639
+ var CentrifugoPresenceResponseSchema = z45.object({
3640
+ error: CentrifugoErrorSchema.optional(),
3641
+ result: CentrifugoPresenceResultSchema.optional()
3642
+ });
3643
+
3644
+ // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsRequestRequest.schema.ts
3645
+ import { z as z46 } from "zod";
3646
+ var CentrifugoPresenceStatsRequestRequestSchema = z46.object({
3647
+ channel: z46.string()
3648
+ });
3649
+
3650
+ // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsResponse.schema.ts
3651
+ import { z as z48 } from "zod";
3652
+
3653
+ // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsResult.schema.ts
3654
+ import { z as z47 } from "zod";
3655
+ var CentrifugoPresenceStatsResultSchema = z47.object({
3656
+ num_clients: z47.int(),
3657
+ num_users: z47.int()
3658
+ });
3659
+
3660
+ // src/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsResponse.schema.ts
3661
+ var CentrifugoPresenceStatsResponseSchema = z48.object({
3662
+ error: CentrifugoErrorSchema.optional(),
3663
+ result: CentrifugoPresenceStatsResultSchema.optional()
3664
+ });
3665
+
3666
+ // src/generated/cfg_centrifugo/_utils/schemas/ChannelList.schema.ts
3667
+ import { z as z50 } from "zod";
3668
+
3669
+ // src/generated/cfg_centrifugo/_utils/schemas/ChannelStats.schema.ts
3670
+ import { z as z49 } from "zod";
3671
+ var ChannelStatsSchema = z49.object({
3672
+ channel: z49.string(),
3673
+ total: z49.int(),
3674
+ successful: z49.int(),
3675
+ failed: z49.int(),
3676
+ avg_duration_ms: z49.number(),
3677
+ avg_acks: z49.number(),
3678
+ last_activity_at: z49.string().nullable()
3679
+ });
3680
+
3681
+ // src/generated/cfg_centrifugo/_utils/schemas/ChannelList.schema.ts
3682
+ var ChannelListSchema = z50.object({
3683
+ channels: z50.array(ChannelStatsSchema),
3684
+ total_channels: z50.int()
3685
+ });
3686
+
3687
+ // src/generated/cfg_centrifugo/_utils/schemas/ConnectionTokenResponse.schema.ts
3688
+ import { z as z51 } from "zod";
3689
+ var ConnectionTokenResponseSchema = z51.object({
3690
+ token: z51.string(),
3691
+ centrifugo_url: z51.string(),
3692
+ expires_at: z51.string(),
3693
+ channels: z51.array(z51.string())
3694
+ });
3695
+
3696
+ // src/generated/cfg_centrifugo/_utils/schemas/ManualAckRequestRequest.schema.ts
3697
+ import { z as z52 } from "zod";
3698
+ var ManualAckRequestRequestSchema = z52.object({
3699
+ message_id: z52.string(),
3700
+ client_id: z52.string()
3701
+ });
3702
+
3703
+ // src/generated/cfg_centrifugo/_utils/schemas/ManualAckResponse.schema.ts
3704
+ import { z as z53 } from "zod";
3705
+ var ManualAckResponseSchema = z53.object({
3706
+ success: z53.boolean(),
3707
+ message_id: z53.string(),
3708
+ error: z53.string().nullable().optional()
3709
+ });
3710
+
3711
+ // src/generated/cfg_centrifugo/_utils/schemas/PaginatedPublishList.schema.ts
3712
+ import { z as z55 } from "zod";
3713
+
3714
+ // src/generated/cfg_centrifugo/_utils/schemas/Publish.schema.ts
3715
+ import { z as z54 } from "zod";
3716
+ var PublishSchema = z54.object({
3717
+ message_id: z54.string(),
3718
+ channel: z54.string(),
3719
+ status: z54.string(),
3720
+ wait_for_ack: z54.boolean(),
3721
+ acks_received: z54.int(),
3722
+ acks_expected: z54.int().nullable(),
3723
+ duration_ms: z54.number().nullable(),
3724
+ created_at: z54.iso.datetime(),
3725
+ completed_at: z54.iso.datetime().nullable(),
3726
+ error_code: z54.string().nullable(),
3727
+ error_message: z54.string().nullable()
3728
+ });
3729
+
3730
+ // src/generated/cfg_centrifugo/_utils/schemas/PaginatedPublishList.schema.ts
3731
+ var PaginatedPublishListSchema = z55.object({
3732
+ count: z55.int(),
3733
+ page: z55.int(),
3734
+ pages: z55.int(),
3735
+ page_size: z55.int(),
3736
+ has_next: z55.boolean(),
3737
+ has_previous: z55.boolean(),
3738
+ next_page: z55.int().nullable().optional(),
3739
+ previous_page: z55.int().nullable().optional(),
3740
+ results: z55.array(PublishSchema)
3741
+ });
3742
+
3743
+ // src/generated/cfg_centrifugo/_utils/schemas/PublishTestRequestRequest.schema.ts
3744
+ import { z as z56 } from "zod";
3745
+ var PublishTestRequestRequestSchema = z56.object({
3746
+ channel: z56.string(),
3747
+ data: z56.record(z56.string(), z56.any()),
3748
+ wait_for_ack: z56.boolean().optional(),
3749
+ ack_timeout: z56.int().min(1).max(60).optional()
3750
+ });
3751
+
3752
+ // src/generated/cfg_centrifugo/_utils/schemas/PublishTestResponse.schema.ts
3753
+ import { z as z57 } from "zod";
3754
+ var PublishTestResponseSchema = z57.object({
3755
+ success: z57.boolean(),
3756
+ message_id: z57.string(),
3757
+ channel: z57.string(),
3758
+ acks_received: z57.int().optional(),
3759
+ delivered: z57.boolean().optional(),
3760
+ error: z57.string().nullable().optional()
3761
+ });
3762
+
3763
+ // src/generated/cfg_centrifugo/_utils/schemas/TimelineItem.schema.ts
3764
+ import { z as z58 } from "zod";
3765
+ var TimelineItemSchema = z58.object({
3766
+ timestamp: z58.string(),
3767
+ count: z58.int(),
3768
+ successful: z58.int(),
3769
+ failed: z58.int(),
3770
+ timeout: z58.int()
3771
+ });
3772
+
3773
+ // src/generated/cfg_centrifugo/_utils/schemas/TimelineResponse.schema.ts
3774
+ import { z as z59 } from "zod";
3775
+ var TimelineResponseSchema = z59.object({
3776
+ timeline: z59.array(TimelineItemSchema),
3777
+ period_hours: z59.int(),
3778
+ interval: z59.string()
3779
+ });
3780
+
3781
+ // src/generated/cfg_centrifugo/_utils/fetchers/index.ts
3782
+ var fetchers_exports3 = {};
3783
+ __export(fetchers_exports3, {
3784
+ createCentrifugoServerAuthTokenCreate: () => createCentrifugoServerAuthTokenCreate,
3785
+ createCentrifugoServerChannelsCreate: () => createCentrifugoServerChannelsCreate,
3786
+ createCentrifugoServerHistoryCreate: () => createCentrifugoServerHistoryCreate,
3787
+ createCentrifugoServerInfoCreate: () => createCentrifugoServerInfoCreate,
3788
+ createCentrifugoServerPresenceCreate: () => createCentrifugoServerPresenceCreate,
3789
+ createCentrifugoServerPresenceStatsCreate: () => createCentrifugoServerPresenceStatsCreate,
3790
+ createCentrifugoTestingPublishTestCreate: () => createCentrifugoTestingPublishTestCreate,
3791
+ createCentrifugoTestingPublishWithLoggingCreate: () => createCentrifugoTestingPublishWithLoggingCreate,
3792
+ createCentrifugoTestingSendAckCreate: () => createCentrifugoTestingSendAckCreate,
3793
+ getCentrifugoAuthTokenRetrieve: () => getCentrifugoAuthTokenRetrieve,
3794
+ getCentrifugoMonitorChannelsRetrieve: () => getCentrifugoMonitorChannelsRetrieve,
3795
+ getCentrifugoMonitorHealthRetrieve: () => getCentrifugoMonitorHealthRetrieve,
3796
+ getCentrifugoMonitorOverviewRetrieve: () => getCentrifugoMonitorOverviewRetrieve,
3797
+ getCentrifugoMonitorPublishesList: () => getCentrifugoMonitorPublishesList,
3798
+ getCentrifugoMonitorTimelineRetrieve: () => getCentrifugoMonitorTimelineRetrieve
3799
+ });
3800
+
3801
+ // src/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_admin_api.ts
3802
+ import { consola as consola6 } from "consola";
3803
+
3804
+ // src/generated/cfg_centrifugo/api-instance.ts
3805
+ var globalAPI3 = null;
3806
+ function getAPIInstance3() {
3807
+ if (!globalAPI3) {
3808
+ throw new Error(
3809
+ 'API not configured. Call configureAPI() with your base URL before using fetchers or hooks.\n\nExample:\n import { configureAPI } from "./api-instance"\n configureAPI({ baseUrl: "https://api.example.com" })'
3810
+ );
3811
+ }
3812
+ return globalAPI3;
3813
+ }
3814
+ __name(getAPIInstance3, "getAPIInstance");
3815
+
3816
+ // src/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_admin_api.ts
3817
+ async function createCentrifugoServerAuthTokenCreate(client) {
3818
+ const api = client || getAPIInstance3();
3819
+ const response = await api.centrifugo_admin_api.centrifugoServerAuthTokenCreate();
3820
+ return response;
3821
+ }
3822
+ __name(createCentrifugoServerAuthTokenCreate, "createCentrifugoServerAuthTokenCreate");
3823
+ async function createCentrifugoServerChannelsCreate(data, client) {
3824
+ const api = client || getAPIInstance3();
3825
+ const response = await api.centrifugo_admin_api.centrifugoServerChannelsCreate(data);
3826
+ try {
3827
+ return CentrifugoChannelsResponseSchema.parse(response);
3828
+ } catch (error) {
3829
+ consola6.error("\u274C Zod Validation Failed");
3830
+ consola6.box(`createCentrifugoServerChannelsCreate
3831
+ Path: /cfg/centrifugo/server/channels/
3832
+ Method: POST`);
3833
+ if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
3834
+ consola6.error("Validation Issues:");
3835
+ error.issues.forEach((issue, index) => {
3836
+ consola6.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
3837
+ consola6.error(` \u251C\u2500 Message: ${issue.message}`);
3838
+ if (issue.expected) consola6.error(` \u251C\u2500 Expected: ${issue.expected}`);
3839
+ if (issue.received) consola6.error(` \u2514\u2500 Received: ${issue.received}`);
3840
+ });
3841
+ }
3842
+ consola6.error("Response data:", response);
3843
+ if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
3844
+ try {
3845
+ const event = new CustomEvent("zod-validation-error", {
3846
+ detail: {
3847
+ operation: "createCentrifugoServerChannelsCreate",
3848
+ path: "/cfg/centrifugo/server/channels/",
3849
+ method: "POST",
3850
+ error,
3851
+ response,
3852
+ timestamp: /* @__PURE__ */ new Date()
3853
+ },
3854
+ bubbles: true,
3855
+ cancelable: false
3856
+ });
3857
+ window.dispatchEvent(event);
3858
+ } catch (eventError) {
3859
+ consola6.warn("Failed to dispatch validation error event:", eventError);
3860
+ }
3861
+ }
3862
+ throw error;
3863
+ }
3864
+ }
3865
+ __name(createCentrifugoServerChannelsCreate, "createCentrifugoServerChannelsCreate");
3866
+ async function createCentrifugoServerHistoryCreate(data, client) {
3867
+ const api = client || getAPIInstance3();
3868
+ const response = await api.centrifugo_admin_api.centrifugoServerHistoryCreate(data);
3869
+ try {
3870
+ return CentrifugoHistoryResponseSchema.parse(response);
3871
+ } catch (error) {
3872
+ consola6.error("\u274C Zod Validation Failed");
3873
+ consola6.box(`createCentrifugoServerHistoryCreate
3874
+ Path: /cfg/centrifugo/server/history/
3875
+ Method: POST`);
3876
+ if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
3877
+ consola6.error("Validation Issues:");
3878
+ error.issues.forEach((issue, index) => {
3879
+ consola6.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
3880
+ consola6.error(` \u251C\u2500 Message: ${issue.message}`);
3881
+ if (issue.expected) consola6.error(` \u251C\u2500 Expected: ${issue.expected}`);
3882
+ if (issue.received) consola6.error(` \u2514\u2500 Received: ${issue.received}`);
3883
+ });
3884
+ }
3885
+ consola6.error("Response data:", response);
3886
+ if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
3887
+ try {
3888
+ const event = new CustomEvent("zod-validation-error", {
3889
+ detail: {
3890
+ operation: "createCentrifugoServerHistoryCreate",
3891
+ path: "/cfg/centrifugo/server/history/",
3892
+ method: "POST",
3893
+ error,
3894
+ response,
3895
+ timestamp: /* @__PURE__ */ new Date()
3896
+ },
3897
+ bubbles: true,
3898
+ cancelable: false
3899
+ });
3900
+ window.dispatchEvent(event);
3901
+ } catch (eventError) {
3902
+ consola6.warn("Failed to dispatch validation error event:", eventError);
3903
+ }
3904
+ }
3905
+ throw error;
3906
+ }
3907
+ }
3908
+ __name(createCentrifugoServerHistoryCreate, "createCentrifugoServerHistoryCreate");
3909
+ async function createCentrifugoServerInfoCreate(client) {
3910
+ const api = client || getAPIInstance3();
3911
+ const response = await api.centrifugo_admin_api.centrifugoServerInfoCreate();
3912
+ try {
3913
+ return CentrifugoInfoResponseSchema.parse(response);
3914
+ } catch (error) {
3915
+ consola6.error("\u274C Zod Validation Failed");
3916
+ consola6.box(`createCentrifugoServerInfoCreate
3917
+ Path: /cfg/centrifugo/server/info/
3918
+ Method: POST`);
3919
+ if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
3920
+ consola6.error("Validation Issues:");
3921
+ error.issues.forEach((issue, index) => {
3922
+ consola6.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
3923
+ consola6.error(` \u251C\u2500 Message: ${issue.message}`);
3924
+ if (issue.expected) consola6.error(` \u251C\u2500 Expected: ${issue.expected}`);
3925
+ if (issue.received) consola6.error(` \u2514\u2500 Received: ${issue.received}`);
3926
+ });
3927
+ }
3928
+ consola6.error("Response data:", response);
3929
+ if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
3930
+ try {
3931
+ const event = new CustomEvent("zod-validation-error", {
3932
+ detail: {
3933
+ operation: "createCentrifugoServerInfoCreate",
3934
+ path: "/cfg/centrifugo/server/info/",
3935
+ method: "POST",
3936
+ error,
3937
+ response,
3938
+ timestamp: /* @__PURE__ */ new Date()
3939
+ },
3940
+ bubbles: true,
3941
+ cancelable: false
3942
+ });
3943
+ window.dispatchEvent(event);
3944
+ } catch (eventError) {
3945
+ consola6.warn("Failed to dispatch validation error event:", eventError);
3946
+ }
3947
+ }
3948
+ throw error;
3949
+ }
3950
+ }
3951
+ __name(createCentrifugoServerInfoCreate, "createCentrifugoServerInfoCreate");
3952
+ async function createCentrifugoServerPresenceCreate(data, client) {
3953
+ const api = client || getAPIInstance3();
3954
+ const response = await api.centrifugo_admin_api.centrifugoServerPresenceCreate(data);
3955
+ try {
3956
+ return CentrifugoPresenceResponseSchema.parse(response);
3957
+ } catch (error) {
3958
+ consola6.error("\u274C Zod Validation Failed");
3959
+ consola6.box(`createCentrifugoServerPresenceCreate
3960
+ Path: /cfg/centrifugo/server/presence/
3961
+ Method: POST`);
3962
+ if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
3963
+ consola6.error("Validation Issues:");
3964
+ error.issues.forEach((issue, index) => {
3965
+ consola6.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
3966
+ consola6.error(` \u251C\u2500 Message: ${issue.message}`);
3967
+ if (issue.expected) consola6.error(` \u251C\u2500 Expected: ${issue.expected}`);
3968
+ if (issue.received) consola6.error(` \u2514\u2500 Received: ${issue.received}`);
3969
+ });
3970
+ }
3971
+ consola6.error("Response data:", response);
3972
+ if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
3973
+ try {
3974
+ const event = new CustomEvent("zod-validation-error", {
3975
+ detail: {
3976
+ operation: "createCentrifugoServerPresenceCreate",
3977
+ path: "/cfg/centrifugo/server/presence/",
3978
+ method: "POST",
3979
+ error,
3980
+ response,
3981
+ timestamp: /* @__PURE__ */ new Date()
3982
+ },
3983
+ bubbles: true,
3984
+ cancelable: false
3985
+ });
3986
+ window.dispatchEvent(event);
3987
+ } catch (eventError) {
3988
+ consola6.warn("Failed to dispatch validation error event:", eventError);
3989
+ }
3990
+ }
3991
+ throw error;
3992
+ }
3993
+ }
3994
+ __name(createCentrifugoServerPresenceCreate, "createCentrifugoServerPresenceCreate");
3995
+ async function createCentrifugoServerPresenceStatsCreate(data, client) {
3996
+ const api = client || getAPIInstance3();
3997
+ const response = await api.centrifugo_admin_api.centrifugoServerPresenceStatsCreate(data);
3998
+ try {
3999
+ return CentrifugoPresenceStatsResponseSchema.parse(response);
4000
+ } catch (error) {
4001
+ consola6.error("\u274C Zod Validation Failed");
4002
+ consola6.box(`createCentrifugoServerPresenceStatsCreate
4003
+ Path: /cfg/centrifugo/server/presence-stats/
4004
+ Method: POST`);
4005
+ if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
4006
+ consola6.error("Validation Issues:");
4007
+ error.issues.forEach((issue, index) => {
4008
+ consola6.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
4009
+ consola6.error(` \u251C\u2500 Message: ${issue.message}`);
4010
+ if (issue.expected) consola6.error(` \u251C\u2500 Expected: ${issue.expected}`);
4011
+ if (issue.received) consola6.error(` \u2514\u2500 Received: ${issue.received}`);
4012
+ });
4013
+ }
4014
+ consola6.error("Response data:", response);
4015
+ if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
4016
+ try {
4017
+ const event = new CustomEvent("zod-validation-error", {
4018
+ detail: {
4019
+ operation: "createCentrifugoServerPresenceStatsCreate",
4020
+ path: "/cfg/centrifugo/server/presence-stats/",
4021
+ method: "POST",
4022
+ error,
4023
+ response,
4024
+ timestamp: /* @__PURE__ */ new Date()
4025
+ },
4026
+ bubbles: true,
4027
+ cancelable: false
4028
+ });
4029
+ window.dispatchEvent(event);
4030
+ } catch (eventError) {
4031
+ consola6.warn("Failed to dispatch validation error event:", eventError);
4032
+ }
4033
+ }
4034
+ throw error;
4035
+ }
4036
+ }
4037
+ __name(createCentrifugoServerPresenceStatsCreate, "createCentrifugoServerPresenceStatsCreate");
4038
+
4039
+ // src/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_auth.ts
4040
+ import { consola as consola7 } from "consola";
4041
+ async function getCentrifugoAuthTokenRetrieve(client) {
4042
+ const api = client || getAPIInstance3();
4043
+ const response = await api.centrifugo_auth.tokenRetrieve();
4044
+ try {
4045
+ return ConnectionTokenResponseSchema.parse(response);
4046
+ } catch (error) {
4047
+ consola7.error("\u274C Zod Validation Failed");
4048
+ consola7.box(`getCentrifugoAuthTokenRetrieve
4049
+ Path: /cfg/centrifugo/auth/token/
4050
+ Method: GET`);
4051
+ if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
4052
+ consola7.error("Validation Issues:");
4053
+ error.issues.forEach((issue, index) => {
4054
+ consola7.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
4055
+ consola7.error(` \u251C\u2500 Message: ${issue.message}`);
4056
+ if (issue.expected) consola7.error(` \u251C\u2500 Expected: ${issue.expected}`);
4057
+ if (issue.received) consola7.error(` \u2514\u2500 Received: ${issue.received}`);
4058
+ });
4059
+ }
4060
+ consola7.error("Response data:", response);
4061
+ if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
4062
+ try {
4063
+ const event = new CustomEvent("zod-validation-error", {
4064
+ detail: {
4065
+ operation: "getCentrifugoAuthTokenRetrieve",
4066
+ path: "/cfg/centrifugo/auth/token/",
4067
+ method: "GET",
4068
+ error,
4069
+ response,
4070
+ timestamp: /* @__PURE__ */ new Date()
4071
+ },
4072
+ bubbles: true,
4073
+ cancelable: false
4074
+ });
4075
+ window.dispatchEvent(event);
4076
+ } catch (eventError) {
4077
+ consola7.warn("Failed to dispatch validation error event:", eventError);
4078
+ }
4079
+ }
4080
+ throw error;
4081
+ }
4082
+ }
4083
+ __name(getCentrifugoAuthTokenRetrieve, "getCentrifugoAuthTokenRetrieve");
4084
+
4085
+ // src/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_monitoring.ts
4086
+ import { consola as consola8 } from "consola";
4087
+ async function getCentrifugoMonitorChannelsRetrieve(params, client) {
4088
+ const api = client || getAPIInstance3();
4089
+ const response = await api.centrifugo_monitoring.centrifugoMonitorChannelsRetrieve(params?.hours);
4090
+ try {
4091
+ return ChannelListSchema.parse(response);
4092
+ } catch (error) {
4093
+ consola8.error("\u274C Zod Validation Failed");
4094
+ consola8.box(`getCentrifugoMonitorChannelsRetrieve
4095
+ Path: /cfg/centrifugo/monitor/channels/
4096
+ Method: GET`);
4097
+ if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
4098
+ consola8.error("Validation Issues:");
4099
+ error.issues.forEach((issue, index) => {
4100
+ consola8.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
4101
+ consola8.error(` \u251C\u2500 Message: ${issue.message}`);
4102
+ if (issue.expected) consola8.error(` \u251C\u2500 Expected: ${issue.expected}`);
4103
+ if (issue.received) consola8.error(` \u2514\u2500 Received: ${issue.received}`);
4104
+ });
4105
+ }
4106
+ consola8.error("Response data:", response);
4107
+ if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
4108
+ try {
4109
+ const event = new CustomEvent("zod-validation-error", {
4110
+ detail: {
4111
+ operation: "getCentrifugoMonitorChannelsRetrieve",
4112
+ path: "/cfg/centrifugo/monitor/channels/",
4113
+ method: "GET",
4114
+ error,
4115
+ response,
4116
+ timestamp: /* @__PURE__ */ new Date()
4117
+ },
4118
+ bubbles: true,
4119
+ cancelable: false
4120
+ });
4121
+ window.dispatchEvent(event);
4122
+ } catch (eventError) {
4123
+ consola8.warn("Failed to dispatch validation error event:", eventError);
4124
+ }
4125
+ }
4126
+ throw error;
4127
+ }
4128
+ }
4129
+ __name(getCentrifugoMonitorChannelsRetrieve, "getCentrifugoMonitorChannelsRetrieve");
4130
+ async function getCentrifugoMonitorHealthRetrieve(client) {
4131
+ const api = client || getAPIInstance3();
4132
+ const response = await api.centrifugo_monitoring.centrifugoMonitorHealthRetrieve();
4133
+ try {
4134
+ return CentrifugoHealthCheckSchema.parse(response);
4135
+ } catch (error) {
4136
+ consola8.error("\u274C Zod Validation Failed");
4137
+ consola8.box(`getCentrifugoMonitorHealthRetrieve
4138
+ Path: /cfg/centrifugo/monitor/health/
4139
+ Method: GET`);
4140
+ if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
4141
+ consola8.error("Validation Issues:");
4142
+ error.issues.forEach((issue, index) => {
4143
+ consola8.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
4144
+ consola8.error(` \u251C\u2500 Message: ${issue.message}`);
4145
+ if (issue.expected) consola8.error(` \u251C\u2500 Expected: ${issue.expected}`);
4146
+ if (issue.received) consola8.error(` \u2514\u2500 Received: ${issue.received}`);
4147
+ });
4148
+ }
4149
+ consola8.error("Response data:", response);
4150
+ if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
4151
+ try {
4152
+ const event = new CustomEvent("zod-validation-error", {
4153
+ detail: {
4154
+ operation: "getCentrifugoMonitorHealthRetrieve",
4155
+ path: "/cfg/centrifugo/monitor/health/",
4156
+ method: "GET",
4157
+ error,
4158
+ response,
4159
+ timestamp: /* @__PURE__ */ new Date()
4160
+ },
4161
+ bubbles: true,
4162
+ cancelable: false
4163
+ });
4164
+ window.dispatchEvent(event);
4165
+ } catch (eventError) {
4166
+ consola8.warn("Failed to dispatch validation error event:", eventError);
4167
+ }
4168
+ }
4169
+ throw error;
4170
+ }
4171
+ }
4172
+ __name(getCentrifugoMonitorHealthRetrieve, "getCentrifugoMonitorHealthRetrieve");
4173
+ async function getCentrifugoMonitorOverviewRetrieve(params, client) {
4174
+ const api = client || getAPIInstance3();
4175
+ const response = await api.centrifugo_monitoring.centrifugoMonitorOverviewRetrieve(params?.hours);
4176
+ try {
4177
+ return CentrifugoOverviewStatsSchema.parse(response);
4178
+ } catch (error) {
4179
+ consola8.error("\u274C Zod Validation Failed");
4180
+ consola8.box(`getCentrifugoMonitorOverviewRetrieve
4181
+ Path: /cfg/centrifugo/monitor/overview/
4182
+ Method: GET`);
4183
+ if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
4184
+ consola8.error("Validation Issues:");
4185
+ error.issues.forEach((issue, index) => {
4186
+ consola8.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
4187
+ consola8.error(` \u251C\u2500 Message: ${issue.message}`);
4188
+ if (issue.expected) consola8.error(` \u251C\u2500 Expected: ${issue.expected}`);
4189
+ if (issue.received) consola8.error(` \u2514\u2500 Received: ${issue.received}`);
4190
+ });
4191
+ }
4192
+ consola8.error("Response data:", response);
4193
+ if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
4194
+ try {
4195
+ const event = new CustomEvent("zod-validation-error", {
4196
+ detail: {
4197
+ operation: "getCentrifugoMonitorOverviewRetrieve",
4198
+ path: "/cfg/centrifugo/monitor/overview/",
4199
+ method: "GET",
4200
+ error,
4201
+ response,
4202
+ timestamp: /* @__PURE__ */ new Date()
4203
+ },
4204
+ bubbles: true,
4205
+ cancelable: false
4206
+ });
4207
+ window.dispatchEvent(event);
4208
+ } catch (eventError) {
4209
+ consola8.warn("Failed to dispatch validation error event:", eventError);
4210
+ }
4211
+ }
4212
+ throw error;
4213
+ }
4214
+ }
4215
+ __name(getCentrifugoMonitorOverviewRetrieve, "getCentrifugoMonitorOverviewRetrieve");
4216
+ async function getCentrifugoMonitorPublishesList(params, client) {
4217
+ const api = client || getAPIInstance3();
4218
+ const response = await api.centrifugo_monitoring.centrifugoMonitorPublishesList(params?.channel, params?.page, params?.page_size, params?.status);
4219
+ try {
4220
+ return PaginatedPublishListSchema.parse(response);
4221
+ } catch (error) {
4222
+ consola8.error("\u274C Zod Validation Failed");
4223
+ consola8.box(`getCentrifugoMonitorPublishesList
4224
+ Path: /cfg/centrifugo/monitor/publishes/
4225
+ Method: GET`);
4226
+ if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
4227
+ consola8.error("Validation Issues:");
4228
+ error.issues.forEach((issue, index) => {
4229
+ consola8.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
4230
+ consola8.error(` \u251C\u2500 Message: ${issue.message}`);
4231
+ if (issue.expected) consola8.error(` \u251C\u2500 Expected: ${issue.expected}`);
4232
+ if (issue.received) consola8.error(` \u2514\u2500 Received: ${issue.received}`);
4233
+ });
4234
+ }
4235
+ consola8.error("Response data:", response);
4236
+ if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
4237
+ try {
4238
+ const event = new CustomEvent("zod-validation-error", {
4239
+ detail: {
4240
+ operation: "getCentrifugoMonitorPublishesList",
4241
+ path: "/cfg/centrifugo/monitor/publishes/",
4242
+ method: "GET",
4243
+ error,
4244
+ response,
4245
+ timestamp: /* @__PURE__ */ new Date()
4246
+ },
4247
+ bubbles: true,
4248
+ cancelable: false
4249
+ });
4250
+ window.dispatchEvent(event);
4251
+ } catch (eventError) {
4252
+ consola8.warn("Failed to dispatch validation error event:", eventError);
4253
+ }
4254
+ }
4255
+ throw error;
4256
+ }
4257
+ }
4258
+ __name(getCentrifugoMonitorPublishesList, "getCentrifugoMonitorPublishesList");
4259
+ async function getCentrifugoMonitorTimelineRetrieve(params, client) {
4260
+ const api = client || getAPIInstance3();
4261
+ const response = await api.centrifugo_monitoring.centrifugoMonitorTimelineRetrieve(params?.hours, params?.interval);
4262
+ try {
4263
+ return TimelineResponseSchema.parse(response);
4264
+ } catch (error) {
4265
+ consola8.error("\u274C Zod Validation Failed");
4266
+ consola8.box(`getCentrifugoMonitorTimelineRetrieve
4267
+ Path: /cfg/centrifugo/monitor/timeline/
4268
+ Method: GET`);
4269
+ if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
4270
+ consola8.error("Validation Issues:");
4271
+ error.issues.forEach((issue, index) => {
4272
+ consola8.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
4273
+ consola8.error(` \u251C\u2500 Message: ${issue.message}`);
4274
+ if (issue.expected) consola8.error(` \u251C\u2500 Expected: ${issue.expected}`);
4275
+ if (issue.received) consola8.error(` \u2514\u2500 Received: ${issue.received}`);
4276
+ });
4277
+ }
4278
+ consola8.error("Response data:", response);
4279
+ if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
4280
+ try {
4281
+ const event = new CustomEvent("zod-validation-error", {
4282
+ detail: {
4283
+ operation: "getCentrifugoMonitorTimelineRetrieve",
4284
+ path: "/cfg/centrifugo/monitor/timeline/",
4285
+ method: "GET",
4286
+ error,
4287
+ response,
4288
+ timestamp: /* @__PURE__ */ new Date()
4289
+ },
4290
+ bubbles: true,
4291
+ cancelable: false
4292
+ });
4293
+ window.dispatchEvent(event);
4294
+ } catch (eventError) {
4295
+ consola8.warn("Failed to dispatch validation error event:", eventError);
4296
+ }
4297
+ }
4298
+ throw error;
4299
+ }
4300
+ }
4301
+ __name(getCentrifugoMonitorTimelineRetrieve, "getCentrifugoMonitorTimelineRetrieve");
4302
+
4303
+ // src/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_testing.ts
4304
+ import { consola as consola9 } from "consola";
4305
+ async function createCentrifugoTestingPublishTestCreate(data, client) {
4306
+ const api = client || getAPIInstance3();
4307
+ const response = await api.centrifugo_testing.publishTestCreate(data);
4308
+ try {
4309
+ return PublishTestResponseSchema.parse(response);
4310
+ } catch (error) {
4311
+ consola9.error("\u274C Zod Validation Failed");
4312
+ consola9.box(`createCentrifugoTestingPublishTestCreate
4313
+ Path: /cfg/centrifugo/testing/publish-test/
4314
+ Method: POST`);
4315
+ if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
4316
+ consola9.error("Validation Issues:");
4317
+ error.issues.forEach((issue, index) => {
4318
+ consola9.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
4319
+ consola9.error(` \u251C\u2500 Message: ${issue.message}`);
4320
+ if (issue.expected) consola9.error(` \u251C\u2500 Expected: ${issue.expected}`);
4321
+ if (issue.received) consola9.error(` \u2514\u2500 Received: ${issue.received}`);
4322
+ });
4323
+ }
4324
+ consola9.error("Response data:", response);
4325
+ if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
4326
+ try {
4327
+ const event = new CustomEvent("zod-validation-error", {
4328
+ detail: {
4329
+ operation: "createCentrifugoTestingPublishTestCreate",
4330
+ path: "/cfg/centrifugo/testing/publish-test/",
4331
+ method: "POST",
4332
+ error,
4333
+ response,
4334
+ timestamp: /* @__PURE__ */ new Date()
4335
+ },
4336
+ bubbles: true,
4337
+ cancelable: false
4338
+ });
4339
+ window.dispatchEvent(event);
4340
+ } catch (eventError) {
4341
+ consola9.warn("Failed to dispatch validation error event:", eventError);
4342
+ }
4343
+ }
4344
+ throw error;
4345
+ }
4346
+ }
4347
+ __name(createCentrifugoTestingPublishTestCreate, "createCentrifugoTestingPublishTestCreate");
4348
+ async function createCentrifugoTestingPublishWithLoggingCreate(data, client) {
4349
+ const api = client || getAPIInstance3();
4350
+ const response = await api.centrifugo_testing.publishWithLoggingCreate(data);
4351
+ try {
4352
+ return PublishTestResponseSchema.parse(response);
4353
+ } catch (error) {
4354
+ consola9.error("\u274C Zod Validation Failed");
4355
+ consola9.box(`createCentrifugoTestingPublishWithLoggingCreate
4356
+ Path: /cfg/centrifugo/testing/publish-with-logging/
4357
+ Method: POST`);
4358
+ if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
4359
+ consola9.error("Validation Issues:");
4360
+ error.issues.forEach((issue, index) => {
4361
+ consola9.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
4362
+ consola9.error(` \u251C\u2500 Message: ${issue.message}`);
4363
+ if (issue.expected) consola9.error(` \u251C\u2500 Expected: ${issue.expected}`);
4364
+ if (issue.received) consola9.error(` \u2514\u2500 Received: ${issue.received}`);
4365
+ });
4366
+ }
4367
+ consola9.error("Response data:", response);
4368
+ if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
4369
+ try {
4370
+ const event = new CustomEvent("zod-validation-error", {
4371
+ detail: {
4372
+ operation: "createCentrifugoTestingPublishWithLoggingCreate",
4373
+ path: "/cfg/centrifugo/testing/publish-with-logging/",
4374
+ method: "POST",
4375
+ error,
4376
+ response,
4377
+ timestamp: /* @__PURE__ */ new Date()
4378
+ },
4379
+ bubbles: true,
4380
+ cancelable: false
4381
+ });
4382
+ window.dispatchEvent(event);
4383
+ } catch (eventError) {
4384
+ consola9.warn("Failed to dispatch validation error event:", eventError);
4385
+ }
4386
+ }
4387
+ throw error;
4388
+ }
4389
+ }
4390
+ __name(createCentrifugoTestingPublishWithLoggingCreate, "createCentrifugoTestingPublishWithLoggingCreate");
4391
+ async function createCentrifugoTestingSendAckCreate(data, client) {
4392
+ const api = client || getAPIInstance3();
4393
+ const response = await api.centrifugo_testing.sendAckCreate(data);
4394
+ try {
4395
+ return ManualAckResponseSchema.parse(response);
4396
+ } catch (error) {
4397
+ consola9.error("\u274C Zod Validation Failed");
4398
+ consola9.box(`createCentrifugoTestingSendAckCreate
4399
+ Path: /cfg/centrifugo/testing/send-ack/
4400
+ Method: POST`);
4401
+ if (error instanceof Error && "issues" in error && Array.isArray(error.issues)) {
4402
+ consola9.error("Validation Issues:");
4403
+ error.issues.forEach((issue, index) => {
4404
+ consola9.error(` ${index + 1}. ${issue.path.join(".") || "root"}`);
4405
+ consola9.error(` \u251C\u2500 Message: ${issue.message}`);
4406
+ if (issue.expected) consola9.error(` \u251C\u2500 Expected: ${issue.expected}`);
4407
+ if (issue.received) consola9.error(` \u2514\u2500 Received: ${issue.received}`);
4408
+ });
4409
+ }
4410
+ consola9.error("Response data:", response);
4411
+ if (typeof window !== "undefined" && error instanceof Error && "issues" in error) {
4412
+ try {
4413
+ const event = new CustomEvent("zod-validation-error", {
4414
+ detail: {
4415
+ operation: "createCentrifugoTestingSendAckCreate",
4416
+ path: "/cfg/centrifugo/testing/send-ack/",
4417
+ method: "POST",
4418
+ error,
4419
+ response,
4420
+ timestamp: /* @__PURE__ */ new Date()
4421
+ },
4422
+ bubbles: true,
4423
+ cancelable: false
4424
+ });
4425
+ window.dispatchEvent(event);
4426
+ } catch (eventError) {
4427
+ consola9.warn("Failed to dispatch validation error event:", eventError);
4428
+ }
4429
+ }
4430
+ throw error;
4431
+ }
4432
+ }
4433
+ __name(createCentrifugoTestingSendAckCreate, "createCentrifugoTestingSendAckCreate");
4434
+
4435
+ // src/generated/cfg_centrifugo/index.ts
4436
+ var TOKEN_KEY3 = "auth_token";
4437
+ var REFRESH_TOKEN_KEY3 = "refresh_token";
4438
+ var API3 = class {
4439
+ constructor(baseUrl, options) {
4440
+ this._token = null;
4441
+ this._refreshToken = null;
4442
+ this.baseUrl = baseUrl;
4443
+ this.options = options;
4444
+ const logger = options?.loggerConfig ? new APILogger3(options.loggerConfig) : void 0;
4445
+ this.storage = options?.storage || new LocalStorageAdapter3(logger);
4446
+ this._loadTokensFromStorage();
4447
+ this._client = new APIClient3(this.baseUrl, {
4448
+ retryConfig: this.options?.retryConfig,
4449
+ loggerConfig: this.options?.loggerConfig
4450
+ });
4451
+ this._injectAuthHeader();
4452
+ this.centrifugo_admin_api = this._client.centrifugo_admin_api;
4453
+ this.centrifugo_auth = this._client.centrifugo_auth;
4454
+ this.centrifugo_monitoring = this._client.centrifugo_monitoring;
4455
+ this.centrifugo_testing = this._client.centrifugo_testing;
4456
+ }
4457
+ static {
4458
+ __name(this, "API");
4459
+ }
4460
+ _loadTokensFromStorage() {
4461
+ this._token = this.storage.getItem(TOKEN_KEY3);
4462
+ this._refreshToken = this.storage.getItem(REFRESH_TOKEN_KEY3);
4463
+ }
4464
+ _reinitClients() {
4465
+ this._client = new APIClient3(this.baseUrl, {
4466
+ retryConfig: this.options?.retryConfig,
4467
+ loggerConfig: this.options?.loggerConfig
4468
+ });
4469
+ this._injectAuthHeader();
4470
+ this.centrifugo_admin_api = this._client.centrifugo_admin_api;
4471
+ this.centrifugo_auth = this._client.centrifugo_auth;
4472
+ this.centrifugo_monitoring = this._client.centrifugo_monitoring;
4473
+ this.centrifugo_testing = this._client.centrifugo_testing;
4474
+ }
4475
+ _injectAuthHeader() {
4476
+ const originalRequest = this._client.request.bind(this._client);
4477
+ this._client.request = async (method, path, options) => {
4478
+ const token = this.getToken();
4479
+ const mergedOptions = {
4480
+ ...options,
4481
+ headers: {
4482
+ ...options?.headers || {},
4483
+ ...token ? { "Authorization": `Bearer ${token}` } : {}
4484
+ }
4485
+ };
4486
+ return originalRequest(method, path, mergedOptions);
4487
+ };
4488
+ }
4489
+ /**
4490
+ * Get current JWT token
4491
+ */
4492
+ getToken() {
4493
+ return this.storage.getItem(TOKEN_KEY3);
4494
+ }
4495
+ /**
4496
+ * Get current refresh token
4497
+ */
4498
+ getRefreshToken() {
4499
+ return this.storage.getItem(REFRESH_TOKEN_KEY3);
4500
+ }
4501
+ /**
4502
+ * Set JWT token and refresh token
4503
+ * @param token - JWT access token
4504
+ * @param refreshToken - JWT refresh token (optional)
4505
+ */
4506
+ setToken(token, refreshToken) {
4507
+ this._token = token;
4508
+ this.storage.setItem(TOKEN_KEY3, token);
4509
+ if (refreshToken) {
4510
+ this._refreshToken = refreshToken;
4511
+ this.storage.setItem(REFRESH_TOKEN_KEY3, refreshToken);
4512
+ }
4513
+ this._reinitClients();
4514
+ }
4515
+ /**
4516
+ * Clear all tokens
4517
+ */
4518
+ clearTokens() {
4519
+ this._token = null;
4520
+ this._refreshToken = null;
4521
+ this.storage.removeItem(TOKEN_KEY3);
4522
+ this.storage.removeItem(REFRESH_TOKEN_KEY3);
4523
+ this._reinitClients();
4524
+ }
4525
+ /**
4526
+ * Check if user is authenticated
4527
+ */
4528
+ isAuthenticated() {
4529
+ return !!this.getToken();
4530
+ }
4531
+ /**
4532
+ * Update base URL and reinitialize clients
4533
+ * @param url - New base URL
4534
+ */
4535
+ setBaseUrl(url) {
4536
+ this.baseUrl = url;
4537
+ this._reinitClients();
4538
+ }
4539
+ /**
4540
+ * Get current base URL
4541
+ */
4542
+ getBaseUrl() {
4543
+ return this.baseUrl;
4544
+ }
4545
+ /**
4546
+ * Get OpenAPI schema path
4547
+ * @returns Path to the OpenAPI schema JSON file
4548
+ *
4549
+ * Note: The OpenAPI schema is available in the schema.json file.
4550
+ * You can load it dynamically using:
4551
+ * ```typescript
4552
+ * const schema = await fetch('./schema.json').then(r => r.json());
4553
+ * // or using fs in Node.js:
4554
+ * // const schema = JSON.parse(fs.readFileSync('./schema.json', 'utf-8'));
4555
+ * ```
4556
+ */
4557
+ getSchemaPath() {
4558
+ return "./schema.json";
4559
+ }
4560
+ };
4561
+
4562
+ // src/generated/cfg_accounts/_utils/hooks/accounts__auth.ts
4563
+ import { useSWRConfig } from "swr";
4564
+ function useCreateAccountsTokenRefreshCreate() {
4565
+ const { mutate } = useSWRConfig();
4566
+ return async (data, client) => {
4567
+ const result = await createAccountsTokenRefreshCreate(data, client);
4568
+ mutate("cfg-accounts-token-refresh");
4569
+ return result;
4570
+ };
4571
+ }
4572
+ __name(useCreateAccountsTokenRefreshCreate, "useCreateAccountsTokenRefreshCreate");
4573
+
4574
+ // src/generated/cfg_accounts/_utils/hooks/accounts__oauth.ts
4575
+ import useSWR from "swr";
4576
+ import { useSWRConfig as useSWRConfig2 } from "swr";
4577
+ function useAccountsOauthConnectionsList(client) {
4578
+ return useSWR(
4579
+ "cfg-accounts-oauth-connections",
4580
+ () => getAccountsOauthConnectionsList(client)
4581
+ );
4582
+ }
4583
+ __name(useAccountsOauthConnectionsList, "useAccountsOauthConnectionsList");
4584
+ function useCreateAccountsOauthDisconnectCreate() {
4585
+ const { mutate } = useSWRConfig2();
4586
+ return async (data, client) => {
4587
+ const result = await createAccountsOauthDisconnectCreate(data, client);
4588
+ mutate("cfg-accounts-oauth-disconnect");
4589
+ return result;
4590
+ };
4591
+ }
4592
+ __name(useCreateAccountsOauthDisconnectCreate, "useCreateAccountsOauthDisconnectCreate");
4593
+ function useCreateAccountsOauthGithubAuthorizeCreate() {
4594
+ const { mutate } = useSWRConfig2();
4595
+ return async (data, client) => {
4596
+ const result = await createAccountsOauthGithubAuthorizeCreate(data, client);
4597
+ mutate("cfg-accounts-oauth-github-authorize");
4598
+ return result;
4599
+ };
4600
+ }
4601
+ __name(useCreateAccountsOauthGithubAuthorizeCreate, "useCreateAccountsOauthGithubAuthorizeCreate");
4602
+ function useCreateAccountsOauthGithubCallbackCreate() {
4603
+ const { mutate } = useSWRConfig2();
4604
+ return async (data, client) => {
4605
+ const result = await createAccountsOauthGithubCallbackCreate(data, client);
4606
+ mutate("cfg-accounts-oauth-github-callback");
4607
+ return result;
4608
+ };
4609
+ }
4610
+ __name(useCreateAccountsOauthGithubCallbackCreate, "useCreateAccountsOauthGithubCallbackCreate");
4611
+ function useAccountsOauthProvidersRetrieve(client) {
4612
+ return useSWR(
4613
+ "cfg-accounts-oauth-provider",
4614
+ () => getAccountsOauthProvidersRetrieve(client)
4615
+ );
4616
+ }
4617
+ __name(useAccountsOauthProvidersRetrieve, "useAccountsOauthProvidersRetrieve");
4618
+
4619
+ // src/generated/cfg_accounts/_utils/hooks/accounts__user_profile.ts
4620
+ import useSWR2 from "swr";
4621
+ import { useSWRConfig as useSWRConfig3 } from "swr";
4622
+ function useAccountsProfileRetrieve(client) {
4623
+ return useSWR2(
4624
+ "cfg-accounts-profile",
4625
+ () => getAccountsProfileRetrieve(client)
4626
+ );
4627
+ }
4628
+ __name(useAccountsProfileRetrieve, "useAccountsProfileRetrieve");
4629
+ function useCreateAccountsProfileAvatarCreate() {
4630
+ const { mutate } = useSWRConfig3();
4631
+ return async (data, client) => {
4632
+ const result = await createAccountsProfileAvatarCreate(data, client);
4633
+ mutate("cfg-accounts-profile-avatar");
4634
+ return result;
4635
+ };
4636
+ }
4637
+ __name(useCreateAccountsProfileAvatarCreate, "useCreateAccountsProfileAvatarCreate");
4638
+ function usePartialUpdateAccountsProfilePartialUpdate() {
4639
+ const { mutate } = useSWRConfig3();
4640
+ return async (data, client) => {
4641
+ const result = await partialUpdateAccountsProfilePartialUpdate(data, client);
4642
+ mutate("cfg-accounts-profile-partial");
4643
+ return result;
4644
+ };
4645
+ }
4646
+ __name(usePartialUpdateAccountsProfilePartialUpdate, "usePartialUpdateAccountsProfilePartialUpdate");
4647
+ function usePartialUpdateAccountsProfilePartialPartialUpdate() {
4648
+ const { mutate } = useSWRConfig3();
4649
+ return async (data, client) => {
4650
+ const result = await partialUpdateAccountsProfilePartialPartialUpdate(data, client);
4651
+ mutate("cfg-accounts-profile-partial-partial");
4652
+ return result;
4653
+ };
4654
+ }
4655
+ __name(usePartialUpdateAccountsProfilePartialPartialUpdate, "usePartialUpdateAccountsProfilePartialPartialUpdate");
4656
+ function useUpdateAccountsProfileUpdateUpdate() {
4657
+ const { mutate } = useSWRConfig3();
4658
+ return async (data, client) => {
4659
+ const result = await updateAccountsProfileUpdateUpdate(data, client);
4660
+ mutate("cfg-accounts-profile");
4661
+ return result;
4662
+ };
4663
+ }
4664
+ __name(useUpdateAccountsProfileUpdateUpdate, "useUpdateAccountsProfileUpdateUpdate");
4665
+ function usePartialUpdateAccountsProfileUpdatePartialUpdate() {
4666
+ const { mutate } = useSWRConfig3();
4667
+ return async (data, client) => {
4668
+ const result = await partialUpdateAccountsProfileUpdatePartialUpdate(data, client);
4669
+ mutate("cfg-accounts-profile-partial");
4670
+ return result;
4671
+ };
4672
+ }
4673
+ __name(usePartialUpdateAccountsProfileUpdatePartialUpdate, "usePartialUpdateAccountsProfileUpdatePartialUpdate");
4674
+
4675
+ // src/generated/cfg_accounts/_utils/hooks/accounts.ts
4676
+ import { useSWRConfig as useSWRConfig4 } from "swr";
4677
+ function useCreateAccountsOtpRequestCreate() {
4678
+ const { mutate } = useSWRConfig4();
4679
+ return async (data, client) => {
4680
+ const result = await createAccountsOtpRequestCreate(data, client);
4681
+ mutate("cfg-accounts-otp-request");
4682
+ return result;
4683
+ };
4684
+ }
4685
+ __name(useCreateAccountsOtpRequestCreate, "useCreateAccountsOtpRequestCreate");
4686
+ function useCreateAccountsOtpVerifyCreate() {
4687
+ const { mutate } = useSWRConfig4();
4688
+ return async (data, client) => {
4689
+ const result = await createAccountsOtpVerifyCreate(data, client);
4690
+ mutate("cfg-accounts-otp-verify");
4691
+ return result;
4692
+ };
4693
+ }
4694
+ __name(useCreateAccountsOtpVerifyCreate, "useCreateAccountsOtpVerifyCreate");
4695
+
4696
+ // src/generated/cfg_webpush/_utils/hooks/index.ts
4697
+ var hooks_exports = {};
4698
+ __export(hooks_exports, {
4699
+ useCreateWebpushSendCreate: () => useCreateWebpushSendCreate,
4700
+ useCreateWebpushSubscribeCreate: () => useCreateWebpushSubscribeCreate,
4701
+ useWebpushVapidRetrieve: () => useWebpushVapidRetrieve
4702
+ });
4703
+
4704
+ // src/generated/cfg_webpush/_utils/hooks/webpush__web_push.ts
4705
+ import useSWR3 from "swr";
4706
+ import { useSWRConfig as useSWRConfig5 } from "swr";
4707
+ function useCreateWebpushSendCreate() {
4708
+ const { mutate } = useSWRConfig5();
4709
+ return async (data, client) => {
4710
+ const result = await createWebpushSendCreate(data, client);
4711
+ mutate("cfg-webpush-send");
4712
+ return result;
4713
+ };
4714
+ }
4715
+ __name(useCreateWebpushSendCreate, "useCreateWebpushSendCreate");
4716
+ function useCreateWebpushSubscribeCreate() {
4717
+ const { mutate } = useSWRConfig5();
4718
+ return async (data, client) => {
4719
+ const result = await createWebpushSubscribeCreate(data, client);
4720
+ mutate("cfg-webpush-subscribe");
4721
+ return result;
4722
+ };
4723
+ }
4724
+ __name(useCreateWebpushSubscribeCreate, "useCreateWebpushSubscribeCreate");
4725
+ function useWebpushVapidRetrieve(client) {
4726
+ return useSWR3(
4727
+ "cfg-webpush-vapid",
4728
+ () => getWebpushVapidRetrieve(client)
4729
+ );
4730
+ }
4731
+ __name(useWebpushVapidRetrieve, "useWebpushVapidRetrieve");
4732
+
4733
+ // src/generated/cfg_centrifugo/_utils/hooks/index.ts
4734
+ var hooks_exports2 = {};
4735
+ __export(hooks_exports2, {
4736
+ useCentrifugoAuthTokenRetrieve: () => useCentrifugoAuthTokenRetrieve,
4737
+ useCentrifugoMonitorChannelsRetrieve: () => useCentrifugoMonitorChannelsRetrieve,
4738
+ useCentrifugoMonitorHealthRetrieve: () => useCentrifugoMonitorHealthRetrieve,
4739
+ useCentrifugoMonitorOverviewRetrieve: () => useCentrifugoMonitorOverviewRetrieve,
4740
+ useCentrifugoMonitorPublishesList: () => useCentrifugoMonitorPublishesList,
4741
+ useCentrifugoMonitorTimelineRetrieve: () => useCentrifugoMonitorTimelineRetrieve,
4742
+ useCreateCentrifugoServerAuthTokenCreate: () => useCreateCentrifugoServerAuthTokenCreate,
4743
+ useCreateCentrifugoServerChannelsCreate: () => useCreateCentrifugoServerChannelsCreate,
4744
+ useCreateCentrifugoServerHistoryCreate: () => useCreateCentrifugoServerHistoryCreate,
4745
+ useCreateCentrifugoServerInfoCreate: () => useCreateCentrifugoServerInfoCreate,
4746
+ useCreateCentrifugoServerPresenceCreate: () => useCreateCentrifugoServerPresenceCreate,
4747
+ useCreateCentrifugoServerPresenceStatsCreate: () => useCreateCentrifugoServerPresenceStatsCreate,
4748
+ useCreateCentrifugoTestingPublishTestCreate: () => useCreateCentrifugoTestingPublishTestCreate,
4749
+ useCreateCentrifugoTestingPublishWithLoggingCreate: () => useCreateCentrifugoTestingPublishWithLoggingCreate,
4750
+ useCreateCentrifugoTestingSendAckCreate: () => useCreateCentrifugoTestingSendAckCreate
4751
+ });
4752
+
4753
+ // src/generated/cfg_centrifugo/_utils/hooks/centrifugo__centrifugo_admin_api.ts
4754
+ import { useSWRConfig as useSWRConfig6 } from "swr";
4755
+ function useCreateCentrifugoServerAuthTokenCreate() {
4756
+ const { mutate } = useSWRConfig6();
4757
+ return async (client) => {
4758
+ const result = await createCentrifugoServerAuthTokenCreate(client);
4759
+ mutate("cfg-centrifugo-server-auth-token");
4760
+ return result;
4761
+ };
4762
+ }
4763
+ __name(useCreateCentrifugoServerAuthTokenCreate, "useCreateCentrifugoServerAuthTokenCreate");
4764
+ function useCreateCentrifugoServerChannelsCreate() {
4765
+ const { mutate } = useSWRConfig6();
4766
+ return async (data, client) => {
4767
+ const result = await createCentrifugoServerChannelsCreate(data, client);
4768
+ mutate("cfg-centrifugo-server-channels");
4769
+ return result;
4770
+ };
4771
+ }
4772
+ __name(useCreateCentrifugoServerChannelsCreate, "useCreateCentrifugoServerChannelsCreate");
4773
+ function useCreateCentrifugoServerHistoryCreate() {
4774
+ const { mutate } = useSWRConfig6();
4775
+ return async (data, client) => {
4776
+ const result = await createCentrifugoServerHistoryCreate(data, client);
4777
+ mutate("cfg-centrifugo-server-history");
4778
+ return result;
4779
+ };
4780
+ }
4781
+ __name(useCreateCentrifugoServerHistoryCreate, "useCreateCentrifugoServerHistoryCreate");
4782
+ function useCreateCentrifugoServerInfoCreate() {
4783
+ const { mutate } = useSWRConfig6();
4784
+ return async (client) => {
4785
+ const result = await createCentrifugoServerInfoCreate(client);
4786
+ mutate("cfg-centrifugo-server-info");
4787
+ return result;
4788
+ };
4789
+ }
4790
+ __name(useCreateCentrifugoServerInfoCreate, "useCreateCentrifugoServerInfoCreate");
4791
+ function useCreateCentrifugoServerPresenceCreate() {
4792
+ const { mutate } = useSWRConfig6();
4793
+ return async (data, client) => {
4794
+ const result = await createCentrifugoServerPresenceCreate(data, client);
4795
+ mutate("cfg-centrifugo-server-presence");
4796
+ return result;
4797
+ };
4798
+ }
4799
+ __name(useCreateCentrifugoServerPresenceCreate, "useCreateCentrifugoServerPresenceCreate");
4800
+ function useCreateCentrifugoServerPresenceStatsCreate() {
4801
+ const { mutate } = useSWRConfig6();
4802
+ return async (data, client) => {
4803
+ const result = await createCentrifugoServerPresenceStatsCreate(data, client);
4804
+ mutate("cfg-centrifugo-server-presence-stats");
4805
+ return result;
4806
+ };
4807
+ }
4808
+ __name(useCreateCentrifugoServerPresenceStatsCreate, "useCreateCentrifugoServerPresenceStatsCreate");
4809
+
4810
+ // src/generated/cfg_centrifugo/_utils/hooks/centrifugo__centrifugo_auth.ts
4811
+ import useSWR4 from "swr";
4812
+ function useCentrifugoAuthTokenRetrieve(client) {
4813
+ return useSWR4(
4814
+ "cfg-centrifugo-auth-token",
4815
+ () => getCentrifugoAuthTokenRetrieve(client)
4816
+ );
4817
+ }
4818
+ __name(useCentrifugoAuthTokenRetrieve, "useCentrifugoAuthTokenRetrieve");
4819
+
4820
+ // src/generated/cfg_centrifugo/_utils/hooks/centrifugo__centrifugo_monitoring.ts
4821
+ import useSWR5 from "swr";
4822
+ function useCentrifugoMonitorChannelsRetrieve(params, client) {
4823
+ return useSWR5(
4824
+ params ? ["cfg-centrifugo-monitor-channel", params] : "cfg-centrifugo-monitor-channel",
4825
+ () => getCentrifugoMonitorChannelsRetrieve(params, client)
4826
+ );
4827
+ }
4828
+ __name(useCentrifugoMonitorChannelsRetrieve, "useCentrifugoMonitorChannelsRetrieve");
4829
+ function useCentrifugoMonitorHealthRetrieve(client) {
4830
+ return useSWR5(
4831
+ "cfg-centrifugo-monitor-health",
4832
+ () => getCentrifugoMonitorHealthRetrieve(client)
4833
+ );
4834
+ }
4835
+ __name(useCentrifugoMonitorHealthRetrieve, "useCentrifugoMonitorHealthRetrieve");
4836
+ function useCentrifugoMonitorOverviewRetrieve(params, client) {
4837
+ return useSWR5(
4838
+ params ? ["cfg-centrifugo-monitor-overview", params] : "cfg-centrifugo-monitor-overview",
4839
+ () => getCentrifugoMonitorOverviewRetrieve(params, client)
4840
+ );
4841
+ }
4842
+ __name(useCentrifugoMonitorOverviewRetrieve, "useCentrifugoMonitorOverviewRetrieve");
4843
+ function useCentrifugoMonitorPublishesList(params, client) {
4844
+ return useSWR5(
4845
+ params ? ["cfg-centrifugo-monitor-publishes", params] : "cfg-centrifugo-monitor-publishes",
4846
+ () => getCentrifugoMonitorPublishesList(params, client)
4847
+ );
4848
+ }
4849
+ __name(useCentrifugoMonitorPublishesList, "useCentrifugoMonitorPublishesList");
4850
+ function useCentrifugoMonitorTimelineRetrieve(params, client) {
4851
+ return useSWR5(
4852
+ params ? ["cfg-centrifugo-monitor-timeline", params] : "cfg-centrifugo-monitor-timeline",
4853
+ () => getCentrifugoMonitorTimelineRetrieve(params, client)
4854
+ );
4855
+ }
4856
+ __name(useCentrifugoMonitorTimelineRetrieve, "useCentrifugoMonitorTimelineRetrieve");
4857
+
4858
+ // src/generated/cfg_centrifugo/_utils/hooks/centrifugo__centrifugo_testing.ts
4859
+ import { useSWRConfig as useSWRConfig7 } from "swr";
4860
+ function useCreateCentrifugoTestingPublishTestCreate() {
4861
+ const { mutate } = useSWRConfig7();
4862
+ return async (data, client) => {
4863
+ const result = await createCentrifugoTestingPublishTestCreate(data, client);
4864
+ mutate("cfg-centrifugo-testing-publish-test");
4865
+ return result;
4866
+ };
4867
+ }
4868
+ __name(useCreateCentrifugoTestingPublishTestCreate, "useCreateCentrifugoTestingPublishTestCreate");
4869
+ function useCreateCentrifugoTestingPublishWithLoggingCreate() {
4870
+ const { mutate } = useSWRConfig7();
4871
+ return async (data, client) => {
4872
+ const result = await createCentrifugoTestingPublishWithLoggingCreate(data, client);
4873
+ mutate("cfg-centrifugo-testing-publish-with-logging");
4874
+ return result;
4875
+ };
4876
+ }
4877
+ __name(useCreateCentrifugoTestingPublishWithLoggingCreate, "useCreateCentrifugoTestingPublishWithLoggingCreate");
4878
+ function useCreateCentrifugoTestingSendAckCreate() {
4879
+ const { mutate } = useSWRConfig7();
4880
+ return async (data, client) => {
4881
+ const result = await createCentrifugoTestingSendAckCreate(data, client);
4882
+ mutate("cfg-centrifugo-testing-send-ack");
4883
+ return result;
4884
+ };
4885
+ }
4886
+ __name(useCreateCentrifugoTestingSendAckCreate, "useCreateCentrifugoTestingSendAckCreate");
4887
+
4888
+ // src/clients.ts
4889
+ var isStaticBuild = process.env.NEXT_PUBLIC_STATIC_BUILD === "true";
4890
+ var apiUrl = isStaticBuild ? "" : process.env.NEXT_PUBLIC_API_URL || "";
4891
+ var storage = new LocalStorageAdapter();
4892
+ var apiAccounts = new API(apiUrl, { storage });
4893
+ var apiWebPush = new API2(apiUrl, { storage });
4894
+ var apiCentrifugo = new API3(apiUrl, { storage });
4895
+ export {
4896
+ API as AccountsAPI,
4897
+ API3 as CentrifugoAPI,
4898
+ fetchers_exports3 as CentrifugoFetchers,
4899
+ hooks_exports2 as CentrifugoHooks,
4900
+ CentrifugoTokenSchema,
4901
+ schemas_exports3 as CentrifugoTypes,
4902
+ enums_exports as Enums,
4903
+ OAuthAuthorizeRequestRequestSchema,
4904
+ OAuthAuthorizeResponseSchema,
4905
+ OAuthCallbackRequestRequestSchema,
4906
+ OAuthConnectionSchema,
4907
+ OAuthDisconnectRequestRequestSchema,
4908
+ OAuthErrorSchema,
4909
+ OAuthProvidersResponseSchema,
4910
+ OAuthTokenResponseSchema,
4911
+ OTPErrorResponseSchema,
4912
+ OTPRequestRequestSchema,
4913
+ OTPRequestResponseSchema,
4914
+ OTPVerifyRequestSchema,
4915
+ OTPVerifyResponseSchema,
4916
+ PatchedUserProfileUpdateRequestSchema,
4917
+ TokenRefreshRequestSchema,
4918
+ TokenRefreshSchema,
4919
+ UserProfileUpdateRequestSchema,
4920
+ UserSchema,
4921
+ API2 as WebPushAPI,
4922
+ fetchers_exports2 as WebPushFetchers,
4923
+ hooks_exports as WebPushHooks,
4924
+ schemas_exports2 as WebPushTypes,
4925
+ apiAccounts,
4926
+ apiCentrifugo,
4927
+ apiWebPush,
4928
+ createAccountsOauthDisconnectCreate,
4929
+ createAccountsOauthGithubAuthorizeCreate,
4930
+ createAccountsOauthGithubCallbackCreate,
4931
+ createAccountsOtpRequestCreate,
4932
+ createAccountsOtpVerifyCreate,
4933
+ createAccountsProfileAvatarCreate,
4934
+ createAccountsTokenRefreshCreate,
4935
+ getAccountsOauthConnectionsList,
4936
+ getAccountsOauthProvidersRetrieve,
4937
+ getAccountsProfileRetrieve,
4938
+ partialUpdateAccountsProfilePartialPartialUpdate,
4939
+ partialUpdateAccountsProfilePartialUpdate,
4940
+ partialUpdateAccountsProfileUpdatePartialUpdate,
4941
+ updateAccountsProfileUpdateUpdate,
4942
+ useAccountsOauthConnectionsList,
4943
+ useAccountsOauthProvidersRetrieve,
4944
+ useAccountsProfileRetrieve,
4945
+ useCreateAccountsOauthDisconnectCreate,
4946
+ useCreateAccountsOauthGithubAuthorizeCreate,
4947
+ useCreateAccountsOauthGithubCallbackCreate,
4948
+ useCreateAccountsOtpRequestCreate,
4949
+ useCreateAccountsOtpVerifyCreate,
4950
+ useCreateAccountsProfileAvatarCreate,
4951
+ useCreateAccountsTokenRefreshCreate,
4952
+ usePartialUpdateAccountsProfilePartialPartialUpdate,
4953
+ usePartialUpdateAccountsProfilePartialUpdate,
4954
+ usePartialUpdateAccountsProfileUpdatePartialUpdate,
4955
+ useUpdateAccountsProfileUpdateUpdate
4956
+ };
4957
+ //# sourceMappingURL=clients.mjs.map