@djangocfg/api 1.2.5 → 1.2.7

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 (113) hide show
  1. package/dist/index.cjs +4630 -1605
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +5103 -1773
  4. package/dist/index.d.ts +5103 -1773
  5. package/dist/index.mjs +4481 -1486
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +2 -2
  8. package/src/cfg/contexts/TasksContext.tsx +242 -0
  9. package/src/cfg/contexts/index.ts +3 -0
  10. package/src/cfg/generated/_utils/fetchers/cfg__accounts.ts +2 -3
  11. package/src/cfg/generated/_utils/fetchers/cfg__accounts__auth.ts +1 -2
  12. package/src/cfg/generated/_utils/fetchers/cfg__accounts__user_profile.ts +6 -7
  13. package/src/cfg/generated/_utils/fetchers/cfg__centrifugo.ts +61 -0
  14. package/src/cfg/generated/_utils/fetchers/cfg__centrifugo__centrifugo_admin_api.ts +12 -13
  15. package/src/cfg/generated/_utils/fetchers/cfg__centrifugo__centrifugo_monitoring.ts +25 -26
  16. package/src/cfg/generated/_utils/fetchers/cfg__centrifugo__centrifugo_testing.ts +8 -9
  17. package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_activity.ts +61 -0
  18. package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_api_zones.ts +62 -0
  19. package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_charts.ts +90 -0
  20. package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_commands.ts +62 -0
  21. package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_overview.ts +48 -0
  22. package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_statistics.ts +76 -0
  23. package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_system.ts +63 -0
  24. package/src/cfg/generated/_utils/fetchers/cfg__endpoints.ts +30 -2
  25. package/src/cfg/generated/_utils/fetchers/cfg__health.ts +2 -3
  26. package/src/cfg/generated/_utils/fetchers/cfg__knowbase.ts +57 -58
  27. package/src/cfg/generated/_utils/fetchers/cfg__leads.ts +6 -7
  28. package/src/cfg/generated/_utils/fetchers/cfg__leads__lead_submission.ts +1 -2
  29. package/src/cfg/generated/_utils/fetchers/cfg__newsletter.ts +3 -4
  30. package/src/cfg/generated/_utils/fetchers/cfg__newsletter__bulk_email.ts +1 -2
  31. package/src/cfg/generated/_utils/fetchers/cfg__newsletter__campaigns.ts +6 -7
  32. package/src/cfg/generated/_utils/fetchers/cfg__newsletter__logs.ts +1 -2
  33. package/src/cfg/generated/_utils/fetchers/cfg__newsletter__newsletters.ts +2 -3
  34. package/src/cfg/generated/_utils/fetchers/cfg__newsletter__subscriptions.ts +3 -4
  35. package/src/cfg/generated/_utils/fetchers/cfg__newsletter__testing.ts +1 -2
  36. package/src/cfg/generated/_utils/fetchers/cfg__payments.ts +8 -9
  37. package/src/cfg/generated/_utils/fetchers/cfg__support.ts +12 -13
  38. package/src/cfg/generated/_utils/fetchers/cfg__tasks.ts +10 -11
  39. package/src/cfg/generated/_utils/fetchers/index.ts +8 -0
  40. package/src/cfg/generated/_utils/hooks/cfg__centrifugo.ts +49 -0
  41. package/src/cfg/generated/_utils/hooks/cfg__centrifugo__centrifugo_monitoring.ts +20 -20
  42. package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_activity.ts +49 -0
  43. package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_api_zones.ts +50 -0
  44. package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_charts.ts +78 -0
  45. package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_commands.ts +50 -0
  46. package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_overview.ts +36 -0
  47. package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_statistics.ts +64 -0
  48. package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_system.ts +51 -0
  49. package/src/cfg/generated/_utils/hooks/cfg__endpoints.ts +29 -0
  50. package/src/cfg/generated/_utils/hooks/index.ts +8 -0
  51. package/src/cfg/generated/_utils/schemas/APIZone.schema.ts +27 -0
  52. package/src/cfg/generated/_utils/schemas/APIZonesSummary.schema.ts +21 -0
  53. package/src/cfg/generated/_utils/schemas/ActivityEntry.schema.ts +25 -0
  54. package/src/cfg/generated/_utils/schemas/ActivityTrackerDay.schema.ts +23 -0
  55. package/src/cfg/generated/_utils/schemas/AppStatistics.schema.ts +20 -0
  56. package/src/cfg/generated/_utils/schemas/CentrifugoChannelsRequestRequest.schema.ts +1 -1
  57. package/src/cfg/generated/_utils/schemas/CentrifugoClientInfo.schema.ts +2 -2
  58. package/src/cfg/generated/_utils/schemas/CentrifugoHistoryRequestRequest.schema.ts +2 -2
  59. package/src/cfg/generated/_utils/schemas/CentrifugoPublication.schema.ts +1 -1
  60. package/src/cfg/generated/_utils/schemas/ChannelStatsSerializer.schema.ts +1 -0
  61. package/src/cfg/generated/_utils/schemas/ChartData.schema.ts +21 -0
  62. package/src/cfg/generated/_utils/schemas/ChartDataset.schema.ts +24 -0
  63. package/src/cfg/generated/_utils/schemas/Command.schema.ts +23 -0
  64. package/src/cfg/generated/_utils/schemas/CommandsSummary.schema.ts +25 -0
  65. package/src/cfg/generated/_utils/schemas/DashboardOverview.schema.ts +27 -0
  66. package/src/cfg/generated/_utils/schemas/ManualAckResponse.schema.ts +1 -1
  67. package/src/cfg/generated/_utils/schemas/PublishTestResponse.schema.ts +1 -1
  68. package/src/cfg/generated/_utils/schemas/QuickAction.schema.ts +29 -0
  69. package/src/cfg/generated/_utils/schemas/RecentPublishes.schema.ts +2 -0
  70. package/src/cfg/generated/_utils/schemas/RecentUser.schema.ts +26 -0
  71. package/src/cfg/generated/_utils/schemas/StatCard.schema.ts +30 -0
  72. package/src/cfg/generated/_utils/schemas/SystemHealth.schema.ts +24 -0
  73. package/src/cfg/generated/_utils/schemas/SystemHealthItem.schema.ts +28 -0
  74. package/src/cfg/generated/_utils/schemas/SystemMetrics.schema.ts +25 -0
  75. package/src/cfg/generated/_utils/schemas/URLPattern.schema.ts +26 -0
  76. package/src/cfg/generated/_utils/schemas/URLsList.schema.ts +25 -0
  77. package/src/cfg/generated/_utils/schemas/UserStatistics.schema.ts +22 -0
  78. package/src/cfg/generated/_utils/schemas/index.ts +19 -0
  79. package/src/cfg/generated/cfg__centrifugo/client.ts +30 -0
  80. package/src/cfg/generated/cfg__centrifugo/index.ts +2 -0
  81. package/src/cfg/generated/cfg__centrifugo/models.ts +0 -0
  82. package/src/cfg/generated/cfg__centrifugo__centrifugo_admin_api/models.ts +6 -6
  83. package/src/cfg/generated/cfg__centrifugo__centrifugo_monitoring/client.ts +32 -32
  84. package/src/cfg/generated/cfg__centrifugo__centrifugo_monitoring/models.ts +18 -12
  85. package/src/cfg/generated/cfg__centrifugo__centrifugo_testing/models.ts +2 -2
  86. package/src/cfg/generated/cfg__dashboard__dashboard_activity/client.ts +45 -0
  87. package/src/cfg/generated/cfg__dashboard__dashboard_activity/index.ts +2 -0
  88. package/src/cfg/generated/cfg__dashboard__dashboard_activity/models.ts +0 -0
  89. package/src/cfg/generated/cfg__dashboard__dashboard_api_zones/client.ts +34 -0
  90. package/src/cfg/generated/cfg__dashboard__dashboard_api_zones/index.ts +2 -0
  91. package/src/cfg/generated/cfg__dashboard__dashboard_api_zones/models.ts +27 -0
  92. package/src/cfg/generated/cfg__dashboard__dashboard_charts/client.ts +98 -0
  93. package/src/cfg/generated/cfg__dashboard__dashboard_charts/index.ts +2 -0
  94. package/src/cfg/generated/cfg__dashboard__dashboard_charts/models.ts +24 -0
  95. package/src/cfg/generated/cfg__dashboard__dashboard_commands/client.ts +34 -0
  96. package/src/cfg/generated/cfg__dashboard__dashboard_commands/index.ts +2 -0
  97. package/src/cfg/generated/cfg__dashboard__dashboard_commands/models.ts +27 -0
  98. package/src/cfg/generated/cfg__dashboard__dashboard_overview/client.ts +25 -0
  99. package/src/cfg/generated/cfg__dashboard__dashboard_overview/index.ts +2 -0
  100. package/src/cfg/generated/cfg__dashboard__dashboard_overview/models.ts +23 -0
  101. package/src/cfg/generated/cfg__dashboard__dashboard_statistics/client.ts +44 -0
  102. package/src/cfg/generated/cfg__dashboard__dashboard_statistics/index.ts +2 -0
  103. package/src/cfg/generated/cfg__dashboard__dashboard_statistics/models.ts +16 -0
  104. package/src/cfg/generated/cfg__dashboard__dashboard_system/client.ts +34 -0
  105. package/src/cfg/generated/cfg__dashboard__dashboard_system/index.ts +2 -0
  106. package/src/cfg/generated/cfg__dashboard__dashboard_system/models.ts +69 -0
  107. package/src/cfg/generated/cfg__endpoints/client.ts +16 -0
  108. package/src/cfg/generated/cfg__endpoints/models.ts +44 -0
  109. package/src/cfg/generated/client.ts +35 -9
  110. package/src/cfg/generated/enums.ts +56 -0
  111. package/src/cfg/generated/http.ts +8 -3
  112. package/src/cfg/generated/index.ts +47 -10
  113. package/src/cfg/generated/schema.ts +2120 -135
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djangocfg/api",
3
- "version": "1.2.5",
3
+ "version": "1.2.7",
4
4
  "author": {
5
5
  "name": "DjangoCFG",
6
6
  "url": "https://djangocfg.com"
@@ -68,7 +68,7 @@
68
68
  "@types/node": "^22.15.3",
69
69
  "@types/react": "19.2.2",
70
70
  "@types/react-dom": "19.2.1",
71
- "@djangocfg/typescript-config": "^1.2.5",
71
+ "@djangocfg/typescript-config": "^1.2.7",
72
72
  "react": "^19.1.0",
73
73
  "react-dom": "^19.1.0",
74
74
  "tsup": "^8.5.0",
@@ -0,0 +1,242 @@
1
+ "use client";
2
+
3
+ import { createContext, useContext, ReactNode } from 'react';
4
+ import { useSWRConfig } from 'swr';
5
+ import { api } from '../BaseClient';
6
+ import {
7
+ useTasksApiTasksStatsRetrieve,
8
+ useTasksApiQueuesStatusRetrieve,
9
+ useTasksApiWorkersListRetrieve,
10
+ useCreateTasksApiClearCreate,
11
+ useCreateTasksApiClearQueuesCreate,
12
+ useCreateTasksApiPurgeFailedCreate,
13
+ useCreateTasksApiQueuesManageCreate,
14
+ useCreateTasksApiWorkersManageCreate,
15
+ } from '../generated/_utils/hooks/cfg__tasks';
16
+ import type { API } from '../generated';
17
+ import type {
18
+ TaskStatistics,
19
+ QueueStatus,
20
+ APIResponseRequest,
21
+ APIResponse,
22
+ QueueActionRequest,
23
+ QueueAction,
24
+ WorkerActionRequest,
25
+ WorkerAction,
26
+ } from '../generated/_utils/schemas';
27
+
28
+ // ─────────────────────────────────────────────────────────────────────────
29
+ // Context Type
30
+ // ─────────────────────────────────────────────────────────────────────────
31
+
32
+ interface TasksContextValue {
33
+ // Statistics
34
+ stats: TaskStatistics | undefined;
35
+ isLoadingStats: boolean;
36
+ statsError: Error | null;
37
+
38
+ // Queues
39
+ queues: QueueStatus | undefined;
40
+ isLoadingQueues: boolean;
41
+ queuesError: Error | null;
42
+
43
+ // Workers
44
+ workers: APIResponse | undefined;
45
+ isLoadingWorkers: boolean;
46
+ workersError: Error | null;
47
+
48
+ // Management operations
49
+ clearTasks: (data: APIResponseRequest) => Promise<APIResponse>;
50
+ clearQueues: (data: APIResponseRequest) => Promise<APIResponse>;
51
+ purgeFailedTasks: (data: APIResponseRequest) => Promise<APIResponse>;
52
+ queueAction: (data: QueueActionRequest) => Promise<QueueAction>;
53
+ workerAction: (data: WorkerActionRequest) => Promise<WorkerAction>;
54
+
55
+ // Refresh functions
56
+ refreshStats: () => void;
57
+ refreshQueues: () => void;
58
+ refreshWorkers: () => void;
59
+ refreshAll: () => void;
60
+ }
61
+
62
+ // ─────────────────────────────────────────────────────────────────────────
63
+ // Context
64
+ // ─────────────────────────────────────────────────────────────────────────
65
+
66
+ const TasksContext = createContext<TasksContextValue | undefined>(undefined);
67
+
68
+ // ─────────────────────────────────────────────────────────────────────────
69
+ // Provider Props
70
+ // ─────────────────────────────────────────────────────────────────────────
71
+
72
+ interface TasksProviderProps {
73
+ children: ReactNode;
74
+ autoRefresh?: boolean;
75
+ refreshInterval?: number; // in milliseconds
76
+ }
77
+
78
+ // ─────────────────────────────────────────────────────────────────────────
79
+ // Provider Component
80
+ // ─────────────────────────────────────────────────────────────────────────
81
+
82
+ export function TasksProvider({
83
+ children,
84
+ autoRefresh = false,
85
+ refreshInterval = 5000,
86
+ }: TasksProviderProps) {
87
+ const { mutate } = useSWRConfig();
88
+
89
+ // ───────────────────────────────────────────────────────────────────────
90
+ // Fetch Statistics
91
+ // ───────────────────────────────────────────────────────────────────────
92
+
93
+ const {
94
+ data: stats,
95
+ error: statsError,
96
+ isLoading: isLoadingStats,
97
+ mutate: mutateStats,
98
+ } = useTasksApiTasksStatsRetrieve(api as unknown as API);
99
+
100
+ // ───────────────────────────────────────────────────────────────────────
101
+ // Fetch Queues
102
+ // ───────────────────────────────────────────────────────────────────────
103
+
104
+ const {
105
+ data: queues,
106
+ error: queuesError,
107
+ isLoading: isLoadingQueues,
108
+ mutate: mutateQueues,
109
+ } = useTasksApiQueuesStatusRetrieve(api as unknown as API);
110
+
111
+ // ───────────────────────────────────────────────────────────────────────
112
+ // Fetch Workers
113
+ // ───────────────────────────────────────────────────────────────────────
114
+
115
+ const {
116
+ data: workers,
117
+ error: workersError,
118
+ isLoading: isLoadingWorkers,
119
+ mutate: mutateWorkers,
120
+ } = useTasksApiWorkersListRetrieve(api as unknown as API);
121
+
122
+ // ───────────────────────────────────────────────────────────────────────
123
+ // Mutation Hooks
124
+ // ───────────────────────────────────────────────────────────────────────
125
+
126
+ const clearTasksMutation = useCreateTasksApiClearCreate();
127
+ const clearQueuesMutation = useCreateTasksApiClearQueuesCreate();
128
+ const purgeFailedMutation = useCreateTasksApiPurgeFailedCreate();
129
+ const queueActionMutation = useCreateTasksApiQueuesManageCreate();
130
+ const workerActionMutation = useCreateTasksApiWorkersManageCreate();
131
+
132
+ // ───────────────────────────────────────────────────────────────────────
133
+ // Operations
134
+ // ───────────────────────────────────────────────────────────────────────
135
+
136
+ const clearTasks = async (data: APIResponseRequest): Promise<APIResponse> => {
137
+ const result = await clearTasksMutation(data, api as unknown as API);
138
+ // Refresh all data after clearing
139
+ await mutateStats();
140
+ await mutateQueues();
141
+ return result as APIResponse;
142
+ };
143
+
144
+ const clearQueues = async (data: APIResponseRequest): Promise<APIResponse> => {
145
+ const result = await clearQueuesMutation(data, api as unknown as API);
146
+ await mutateQueues();
147
+ await mutateStats();
148
+ return result as APIResponse;
149
+ };
150
+
151
+ const purgeFailedTasks = async (data: APIResponseRequest): Promise<APIResponse> => {
152
+ const result = await purgeFailedMutation(data, api as unknown as API);
153
+ await mutateStats();
154
+ await mutateQueues();
155
+ return result as APIResponse;
156
+ };
157
+
158
+ const queueAction = async (data: QueueActionRequest): Promise<QueueAction> => {
159
+ const result = await queueActionMutation(data, api as unknown as API);
160
+ await mutateQueues();
161
+ await mutateStats();
162
+ return result as QueueAction;
163
+ };
164
+
165
+ const workerAction = async (data: WorkerActionRequest): Promise<WorkerAction> => {
166
+ const result = await workerActionMutation(data, api as unknown as API);
167
+ await mutateWorkers();
168
+ await mutateStats();
169
+ return result as WorkerAction;
170
+ };
171
+
172
+ // ───────────────────────────────────────────────────────────────────────
173
+ // Refresh Functions
174
+ // ───────────────────────────────────────────────────────────────────────
175
+
176
+ const refreshStats = () => mutateStats();
177
+ const refreshQueues = () => mutateQueues();
178
+ const refreshWorkers = () => mutateWorkers();
179
+ const refreshAll = () => {
180
+ mutateStats();
181
+ mutateQueues();
182
+ mutateWorkers();
183
+ };
184
+
185
+ // ───────────────────────────────────────────────────────────────────────
186
+ // Context Value
187
+ // ───────────────────────────────────────────────────────────────────────
188
+
189
+ const value: TasksContextValue = {
190
+ // Statistics
191
+ stats,
192
+ isLoadingStats,
193
+ statsError,
194
+
195
+ // Queues
196
+ queues,
197
+ isLoadingQueues,
198
+ queuesError,
199
+
200
+ // Workers
201
+ workers,
202
+ isLoadingWorkers,
203
+ workersError,
204
+
205
+ // Operations
206
+ clearTasks,
207
+ clearQueues,
208
+ purgeFailedTasks,
209
+ queueAction,
210
+ workerAction,
211
+
212
+ // Refresh
213
+ refreshStats,
214
+ refreshQueues,
215
+ refreshWorkers,
216
+ refreshAll,
217
+ };
218
+
219
+ return (
220
+ <TasksContext.Provider value={value}>
221
+ {children}
222
+ </TasksContext.Provider>
223
+ );
224
+ }
225
+
226
+ // ─────────────────────────────────────────────────────────────────────────
227
+ // Hook
228
+ // ─────────────────────────────────────────────────────────────────────────
229
+
230
+ export function useTasks() {
231
+ const context = useContext(TasksContext);
232
+ if (context === undefined) {
233
+ throw new Error('useTasks must be used within a TasksProvider');
234
+ }
235
+ return context;
236
+ }
237
+
238
+ // ─────────────────────────────────────────────────────────────────────────
239
+ // Exports
240
+ // ─────────────────────────────────────────────────────────────────────────
241
+
242
+ export type { TasksContextValue, TasksProviderProps };
@@ -46,3 +46,6 @@ export * from './payments';
46
46
  // Knowbase (Chat, Documents, Sessions)
47
47
  export * from './knowbase';
48
48
 
49
+ // Tasks (Dramatiq Task Management)
50
+ export { TasksProvider, useTasks } from './TasksContext';
51
+ export type { TasksContextValue, TasksProviderProps } from './TasksContext';
@@ -34,7 +34,6 @@ import { OTPRequestResponseSchema, type OTPRequestResponse } from '../schemas/OT
34
34
  import { OTPVerifyRequestSchema, type OTPVerifyRequest } from '../schemas/OTPVerifyRequest.schema'
35
35
  import { OTPVerifyResponseSchema, type OTPVerifyResponse } from '../schemas/OTPVerifyResponse.schema'
36
36
  import { getAPIInstance } from '../../api-instance'
37
- import type { API } from '../../index'
38
37
 
39
38
  /**
40
39
  * API operation
@@ -42,7 +41,7 @@ import type { API } from '../../index'
42
41
  * @method POST
43
42
  * @path /cfg/accounts/otp/request/
44
43
  */
45
- export async function createAccountsOtpRequestCreate( data: OTPRequestRequest, client?
44
+ export async function createAccountsOtpRequestCreate( data: OTPRequestRequest, client?: any
46
45
  ): Promise<OTPRequestResponse> {
47
46
  const api = client || getAPIInstance()
48
47
  const response = await api.cfg_accounts.otpRequestCreate(data)
@@ -56,7 +55,7 @@ export async function createAccountsOtpRequestCreate( data: OTPRequestRequest,
56
55
  * @method POST
57
56
  * @path /cfg/accounts/otp/verify/
58
57
  */
59
- export async function createAccountsOtpVerifyCreate( data: OTPVerifyRequest, client?
58
+ export async function createAccountsOtpVerifyCreate( data: OTPVerifyRequest, client?: any
60
59
  ): Promise<OTPVerifyResponse> {
61
60
  const api = client || getAPIInstance()
62
61
  const response = await api.cfg_accounts.otpVerifyCreate(data)
@@ -32,7 +32,6 @@
32
32
  import { TokenRefreshSchema, type TokenRefresh } from '../schemas/TokenRefresh.schema'
33
33
  import { TokenRefreshRequestSchema, type TokenRefreshRequest } from '../schemas/TokenRefreshRequest.schema'
34
34
  import { getAPIInstance } from '../../api-instance'
35
- import type { API } from '../../index'
36
35
 
37
36
  /**
38
37
  * API operation
@@ -40,7 +39,7 @@ import type { API } from '../../index'
40
39
  * @method POST
41
40
  * @path /cfg/accounts/token/refresh/
42
41
  */
43
- export async function createAccountsTokenRefreshCreate( data: TokenRefreshRequest, client?
42
+ export async function createAccountsTokenRefreshCreate( data: TokenRefreshRequest, client?: any
44
43
  ): Promise<TokenRefresh> {
45
44
  const api = client || getAPIInstance()
46
45
  const response = await api.cfg_auth.accountsTokenRefreshCreate(data)
@@ -33,7 +33,6 @@ import { PatchedUserProfileUpdateRequestSchema, type PatchedUserProfileUpdateReq
33
33
  import { UserSchema, type User } from '../schemas/User.schema'
34
34
  import { UserProfileUpdateRequestSchema, type UserProfileUpdateRequest } from '../schemas/UserProfileUpdateRequest.schema'
35
35
  import { getAPIInstance } from '../../api-instance'
36
- import type { API } from '../../index'
37
36
 
38
37
  /**
39
38
  * Get current user profile
@@ -41,7 +40,7 @@ import type { API } from '../../index'
41
40
  * @method GET
42
41
  * @path /cfg/accounts/profile/
43
42
  */
44
- export async function getAccountsProfileRetrieve( client?
43
+ export async function getAccountsProfileRetrieve( client?: any
45
44
  ): Promise<User> {
46
45
  const api = client || getAPIInstance()
47
46
  const response = await api.cfg_user_profile.accountsProfileRetrieve()
@@ -55,7 +54,7 @@ export async function getAccountsProfileRetrieve( client?
55
54
  * @method POST
56
55
  * @path /cfg/accounts/profile/avatar/
57
56
  */
58
- export async function createAccountsProfileAvatarCreate( data: any, client?
57
+ export async function createAccountsProfileAvatarCreate( data: any, client?: any
59
58
  ): Promise<User> {
60
59
  const api = client || getAPIInstance()
61
60
  const response = await api.cfg_user_profile.accountsProfileAvatarCreate(data)
@@ -69,7 +68,7 @@ export async function createAccountsProfileAvatarCreate( data: any, client?
69
68
  * @method PUT
70
69
  * @path /cfg/accounts/profile/partial/
71
70
  */
72
- export async function partialUpdateAccountsProfilePartialUpdate( data: UserProfileUpdateRequest, client?
71
+ export async function partialUpdateAccountsProfilePartialUpdate( data: UserProfileUpdateRequest, client?: any
73
72
  ): Promise<User> {
74
73
  const api = client || getAPIInstance()
75
74
  const response = await api.cfg_user_profile.accountsProfilePartialUpdate(data)
@@ -83,7 +82,7 @@ export async function partialUpdateAccountsProfilePartialUpdate( data: UserProf
83
82
  * @method PATCH
84
83
  * @path /cfg/accounts/profile/partial/
85
84
  */
86
- export async function partialUpdateAccountsProfilePartialPartialUpdate( data?: PatchedUserProfileUpdateRequest, client?
85
+ export async function partialUpdateAccountsProfilePartialPartialUpdate( data?: PatchedUserProfileUpdateRequest, client?: any
87
86
  ): Promise<User> {
88
87
  const api = client || getAPIInstance()
89
88
  const response = await api.cfg_user_profile.accountsProfilePartialPartialUpdate(data)
@@ -97,7 +96,7 @@ export async function partialUpdateAccountsProfilePartialPartialUpdate( data?:
97
96
  * @method PUT
98
97
  * @path /cfg/accounts/profile/update/
99
98
  */
100
- export async function updateAccountsProfileUpdateUpdate( data: UserProfileUpdateRequest, client?
99
+ export async function updateAccountsProfileUpdateUpdate( data: UserProfileUpdateRequest, client?: any
101
100
  ): Promise<User> {
102
101
  const api = client || getAPIInstance()
103
102
  const response = await api.cfg_user_profile.accountsProfileUpdateUpdate(data)
@@ -111,7 +110,7 @@ export async function updateAccountsProfileUpdateUpdate( data: UserProfileUpdat
111
110
  * @method PATCH
112
111
  * @path /cfg/accounts/profile/update/
113
112
  */
114
- export async function partialUpdateAccountsProfileUpdatePartialUpdate( data?: PatchedUserProfileUpdateRequest, client?
113
+ export async function partialUpdateAccountsProfileUpdatePartialUpdate( data?: PatchedUserProfileUpdateRequest, client?: any
115
114
  ): Promise<User> {
116
115
  const api = client || getAPIInstance()
117
116
  const response = await api.cfg_user_profile.accountsProfileUpdatePartialUpdate(data)
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Typed fetchers for Centrifugo
3
+ *
4
+ * Universal functions that work in any environment:
5
+ * - Next.js (App Router / Pages Router / Server Components)
6
+ * - React Native
7
+ * - Node.js backend
8
+ *
9
+ * These fetchers use Zod schemas for runtime validation.
10
+ *
11
+ * Usage:
12
+ * ```typescript
13
+ * // Configure API once (in your app entry point)
14
+ * import { configureAPI } from '../../api-instance'
15
+ * configureAPI({ baseUrl: 'https://api.example.com' })
16
+ *
17
+ * // Then use fetchers anywhere
18
+ * const users = await getUsers({ page: 1 })
19
+ *
20
+ * // With SWR
21
+ * const { data } = useSWR(['users', params], () => getUsers(params))
22
+ *
23
+ * // With React Query
24
+ * const { data } = useQuery(['users', params], () => getUsers(params))
25
+ *
26
+ * // In Server Component or SSR (pass custom client)
27
+ * import { API } from '../../index'
28
+ * const api = new API('https://api.example.com')
29
+ * const users = await getUsers({ page: 1 }, api)
30
+ * ```
31
+ */
32
+ import { getAPIInstance } from '../../api-instance'
33
+
34
+ /**
35
+ * API operation
36
+ *
37
+ * @method GET
38
+ * @path /cfg/centrifugo/admin/api/monitor/channels/
39
+ */
40
+ export async function getCentrifugoAdminApiMonitorChannelsRetrieve( client?: any
41
+ ): Promise<any> {
42
+ const api = client || getAPIInstance()
43
+ const response = await api.cfg_centrifugo.adminApiMonitorChannelsRetrieve()
44
+ return response
45
+ }
46
+
47
+
48
+ /**
49
+ * API operation
50
+ *
51
+ * @method GET
52
+ * @path /cfg/centrifugo/monitor/channels/
53
+ */
54
+ export async function getCentrifugoMonitorChannelsRetrieve( client?: any
55
+ ): Promise<any> {
56
+ const api = client || getAPIInstance()
57
+ const response = await api.cfg_centrifugo.monitorChannelsRetrieve()
58
+ return response
59
+ }
60
+
61
+
@@ -39,7 +39,6 @@ import { CentrifugoPresenceResponseSchema, type CentrifugoPresenceResponse } fro
39
39
  import { CentrifugoPresenceStatsRequestRequestSchema, type CentrifugoPresenceStatsRequestRequest } from '../schemas/CentrifugoPresenceStatsRequestRequest.schema'
40
40
  import { CentrifugoPresenceStatsResponseSchema, type CentrifugoPresenceStatsResponse } from '../schemas/CentrifugoPresenceStatsResponse.schema'
41
41
  import { getAPIInstance } from '../../api-instance'
42
- import type { API } from '../../index'
43
42
 
44
43
  /**
45
44
  * Get connection token for dashboard
@@ -47,7 +46,7 @@ import type { API } from '../../index'
47
46
  * @method POST
48
47
  * @path /cfg/centrifugo/admin/api/server/auth/token/
49
48
  */
50
- export async function createCentrifugoAdminApiServerAuthTokenCreate( client?
49
+ export async function createCentrifugoAdminApiServerAuthTokenCreate( client?: any
51
50
  ): Promise<any> {
52
51
  const api = client || getAPIInstance()
53
52
  const response = await api.cfg_centrifugo_admin_api.serverAuthTokenCreate()
@@ -61,7 +60,7 @@ export async function createCentrifugoAdminApiServerAuthTokenCreate( client?
61
60
  * @method POST
62
61
  * @path /cfg/centrifugo/admin/api/server/channels/
63
62
  */
64
- export async function createCentrifugoAdminApiServerChannelsCreate( data: CentrifugoChannelsRequestRequest, client?
63
+ export async function createCentrifugoAdminApiServerChannelsCreate( data: CentrifugoChannelsRequestRequest, client?: any
65
64
  ): Promise<CentrifugoChannelsResponse> {
66
65
  const api = client || getAPIInstance()
67
66
  const response = await api.cfg_centrifugo_admin_api.serverChannelsCreate(data)
@@ -75,7 +74,7 @@ export async function createCentrifugoAdminApiServerChannelsCreate( data: Centr
75
74
  * @method POST
76
75
  * @path /cfg/centrifugo/admin/api/server/history/
77
76
  */
78
- export async function createCentrifugoAdminApiServerHistoryCreate( data: CentrifugoHistoryRequestRequest, client?
77
+ export async function createCentrifugoAdminApiServerHistoryCreate( data: CentrifugoHistoryRequestRequest, client?: any
79
78
  ): Promise<CentrifugoHistoryResponse> {
80
79
  const api = client || getAPIInstance()
81
80
  const response = await api.cfg_centrifugo_admin_api.serverHistoryCreate(data)
@@ -89,7 +88,7 @@ export async function createCentrifugoAdminApiServerHistoryCreate( data: Centri
89
88
  * @method POST
90
89
  * @path /cfg/centrifugo/admin/api/server/info/
91
90
  */
92
- export async function createCentrifugoAdminApiServerInfoCreate( client?
91
+ export async function createCentrifugoAdminApiServerInfoCreate( client?: any
93
92
  ): Promise<CentrifugoInfoResponse> {
94
93
  const api = client || getAPIInstance()
95
94
  const response = await api.cfg_centrifugo_admin_api.serverInfoCreate()
@@ -103,7 +102,7 @@ export async function createCentrifugoAdminApiServerInfoCreate( client?
103
102
  * @method POST
104
103
  * @path /cfg/centrifugo/admin/api/server/presence/
105
104
  */
106
- export async function createCentrifugoAdminApiServerPresenceCreate( data: CentrifugoPresenceRequestRequest, client?
105
+ export async function createCentrifugoAdminApiServerPresenceCreate( data: CentrifugoPresenceRequestRequest, client?: any
107
106
  ): Promise<CentrifugoPresenceResponse> {
108
107
  const api = client || getAPIInstance()
109
108
  const response = await api.cfg_centrifugo_admin_api.serverPresenceCreate(data)
@@ -117,7 +116,7 @@ export async function createCentrifugoAdminApiServerPresenceCreate( data: Centr
117
116
  * @method POST
118
117
  * @path /cfg/centrifugo/admin/api/server/presence-stats/
119
118
  */
120
- export async function createCentrifugoAdminApiServerPresenceStatsCreate( data: CentrifugoPresenceStatsRequestRequest, client?
119
+ export async function createCentrifugoAdminApiServerPresenceStatsCreate( data: CentrifugoPresenceStatsRequestRequest, client?: any
121
120
  ): Promise<CentrifugoPresenceStatsResponse> {
122
121
  const api = client || getAPIInstance()
123
122
  const response = await api.cfg_centrifugo_admin_api.serverPresenceStatsCreate(data)
@@ -131,7 +130,7 @@ export async function createCentrifugoAdminApiServerPresenceStatsCreate( data:
131
130
  * @method POST
132
131
  * @path /cfg/centrifugo/server/auth/token/
133
132
  */
134
- export async function createCentrifugoServerAuthTokenCreate( client?
133
+ export async function createCentrifugoServerAuthTokenCreate( client?: any
135
134
  ): Promise<any> {
136
135
  const api = client || getAPIInstance()
137
136
  const response = await api.cfg_centrifugo_admin_api.centrifugoServerAuthTokenCreate()
@@ -145,7 +144,7 @@ export async function createCentrifugoServerAuthTokenCreate( client?
145
144
  * @method POST
146
145
  * @path /cfg/centrifugo/server/channels/
147
146
  */
148
- export async function createCentrifugoServerChannelsCreate( data: CentrifugoChannelsRequestRequest, client?
147
+ export async function createCentrifugoServerChannelsCreate( data: CentrifugoChannelsRequestRequest, client?: any
149
148
  ): Promise<CentrifugoChannelsResponse> {
150
149
  const api = client || getAPIInstance()
151
150
  const response = await api.cfg_centrifugo_admin_api.centrifugoServerChannelsCreate(data)
@@ -159,7 +158,7 @@ export async function createCentrifugoServerChannelsCreate( data: CentrifugoCha
159
158
  * @method POST
160
159
  * @path /cfg/centrifugo/server/history/
161
160
  */
162
- export async function createCentrifugoServerHistoryCreate( data: CentrifugoHistoryRequestRequest, client?
161
+ export async function createCentrifugoServerHistoryCreate( data: CentrifugoHistoryRequestRequest, client?: any
163
162
  ): Promise<CentrifugoHistoryResponse> {
164
163
  const api = client || getAPIInstance()
165
164
  const response = await api.cfg_centrifugo_admin_api.centrifugoServerHistoryCreate(data)
@@ -173,7 +172,7 @@ export async function createCentrifugoServerHistoryCreate( data: CentrifugoHist
173
172
  * @method POST
174
173
  * @path /cfg/centrifugo/server/info/
175
174
  */
176
- export async function createCentrifugoServerInfoCreate( client?
175
+ export async function createCentrifugoServerInfoCreate( client?: any
177
176
  ): Promise<CentrifugoInfoResponse> {
178
177
  const api = client || getAPIInstance()
179
178
  const response = await api.cfg_centrifugo_admin_api.centrifugoServerInfoCreate()
@@ -187,7 +186,7 @@ export async function createCentrifugoServerInfoCreate( client?
187
186
  * @method POST
188
187
  * @path /cfg/centrifugo/server/presence/
189
188
  */
190
- export async function createCentrifugoServerPresenceCreate( data: CentrifugoPresenceRequestRequest, client?
189
+ export async function createCentrifugoServerPresenceCreate( data: CentrifugoPresenceRequestRequest, client?: any
191
190
  ): Promise<CentrifugoPresenceResponse> {
192
191
  const api = client || getAPIInstance()
193
192
  const response = await api.cfg_centrifugo_admin_api.centrifugoServerPresenceCreate(data)
@@ -201,7 +200,7 @@ export async function createCentrifugoServerPresenceCreate( data: CentrifugoPre
201
200
  * @method POST
202
201
  * @path /cfg/centrifugo/server/presence-stats/
203
202
  */
204
- export async function createCentrifugoServerPresenceStatsCreate( data: CentrifugoPresenceStatsRequestRequest, client?
203
+ export async function createCentrifugoServerPresenceStatsCreate( data: CentrifugoPresenceStatsRequestRequest, client?: any
205
204
  ): Promise<CentrifugoPresenceStatsResponse> {
206
205
  const api = client || getAPIInstance()
207
206
  const response = await api.cfg_centrifugo_admin_api.centrifugoServerPresenceStatsCreate(data)
@@ -34,21 +34,6 @@ import { HealthCheckSchema, type HealthCheck } from '../schemas/HealthCheck.sche
34
34
  import { OverviewStatsSchema, type OverviewStats } from '../schemas/OverviewStats.schema'
35
35
  import { RecentPublishesSchema, type RecentPublishes } from '../schemas/RecentPublishes.schema'
36
36
  import { getAPIInstance } from '../../api-instance'
37
- import type { API } from '../../index'
38
-
39
- /**
40
- * Get channel statistics
41
- *
42
- * @method GET
43
- * @path /cfg/centrifugo/admin/api/monitor/channels/
44
- */
45
- export async function getCentrifugoAdminApiMonitorChannelsRetrieve( params?: { hours?: number }, client?
46
- ): Promise<ChannelList> {
47
- const api = client || getAPIInstance()
48
- const response = await api.cfg_centrifugo_monitoring.centrifugoAdminApiMonitorChannelsRetrieve(params?.hours)
49
- return ChannelListSchema.parse(response)
50
- }
51
-
52
37
 
53
38
  /**
54
39
  * Get Centrifugo health status
@@ -56,7 +41,7 @@ export async function getCentrifugoAdminApiMonitorChannelsRetrieve( params?: {
56
41
  * @method GET
57
42
  * @path /cfg/centrifugo/admin/api/monitor/health/
58
43
  */
59
- export async function getCentrifugoAdminApiMonitorHealthRetrieve( client?
44
+ export async function getCentrifugoAdminApiMonitorHealthRetrieve( client?: any
60
45
  ): Promise<HealthCheck> {
61
46
  const api = client || getAPIInstance()
62
47
  const response = await api.cfg_centrifugo_monitoring.centrifugoAdminApiMonitorHealthRetrieve()
@@ -70,7 +55,7 @@ export async function getCentrifugoAdminApiMonitorHealthRetrieve( client?
70
55
  * @method GET
71
56
  * @path /cfg/centrifugo/admin/api/monitor/overview/
72
57
  */
73
- export async function getCentrifugoAdminApiMonitorOverviewRetrieve( params?: { hours?: number }, client?
58
+ export async function getCentrifugoAdminApiMonitorOverviewRetrieve( params?: { hours?: number }, client?: any
74
59
  ): Promise<OverviewStats> {
75
60
  const api = client || getAPIInstance()
76
61
  const response = await api.cfg_centrifugo_monitoring.centrifugoAdminApiMonitorOverviewRetrieve(params?.hours)
@@ -84,10 +69,10 @@ export async function getCentrifugoAdminApiMonitorOverviewRetrieve( params?: {
84
69
  * @method GET
85
70
  * @path /cfg/centrifugo/admin/api/monitor/publishes/
86
71
  */
87
- export async function getCentrifugoAdminApiMonitorPublishesRetrieve( params?: { channel?: string; count?: number }, client?
72
+ export async function getCentrifugoAdminApiMonitorPublishesRetrieve( params?: { channel?: string; count?: number; offset?: number; status?: string }, client?: any
88
73
  ): Promise<RecentPublishes> {
89
74
  const api = client || getAPIInstance()
90
- const response = await api.cfg_centrifugo_monitoring.centrifugoAdminApiMonitorPublishesRetrieve(params?.channel, params?.count)
75
+ const response = await api.cfg_centrifugo_monitoring.centrifugoAdminApiMonitorPublishesRetrieve(params?.channel, params?.count, params?.offset, params?.status)
91
76
  return RecentPublishesSchema.parse(response)
92
77
  }
93
78
 
@@ -96,12 +81,12 @@ export async function getCentrifugoAdminApiMonitorPublishesRetrieve( params?: {
96
81
  * Get channel statistics
97
82
  *
98
83
  * @method GET
99
- * @path /cfg/centrifugo/monitor/channels/
84
+ * @path /cfg/centrifugo/admin/api/monitor/timeline/
100
85
  */
101
- export async function getCentrifugoMonitorChannelsRetrieve( params?: { hours?: number }, client?
86
+ export async function getCentrifugoAdminApiMonitorTimelineRetrieve( params?: { hours?: number; interval?: string }, client?: any
102
87
  ): Promise<ChannelList> {
103
88
  const api = client || getAPIInstance()
104
- const response = await api.cfg_centrifugo_monitoring.centrifugoMonitorChannelsRetrieve(params?.hours)
89
+ const response = await api.cfg_centrifugo_monitoring.centrifugoAdminApiMonitorTimelineRetrieve(params?.hours, params?.interval)
105
90
  return ChannelListSchema.parse(response)
106
91
  }
107
92
 
@@ -112,7 +97,7 @@ export async function getCentrifugoMonitorChannelsRetrieve( params?: { hours?:
112
97
  * @method GET
113
98
  * @path /cfg/centrifugo/monitor/health/
114
99
  */
115
- export async function getCentrifugoMonitorHealthRetrieve( client?
100
+ export async function getCentrifugoMonitorHealthRetrieve( client?: any
116
101
  ): Promise<HealthCheck> {
117
102
  const api = client || getAPIInstance()
118
103
  const response = await api.cfg_centrifugo_monitoring.centrifugoMonitorHealthRetrieve()
@@ -126,7 +111,7 @@ export async function getCentrifugoMonitorHealthRetrieve( client?
126
111
  * @method GET
127
112
  * @path /cfg/centrifugo/monitor/overview/
128
113
  */
129
- export async function getCentrifugoMonitorOverviewRetrieve( params?: { hours?: number }, client?
114
+ export async function getCentrifugoMonitorOverviewRetrieve( params?: { hours?: number }, client?: any
130
115
  ): Promise<OverviewStats> {
131
116
  const api = client || getAPIInstance()
132
117
  const response = await api.cfg_centrifugo_monitoring.centrifugoMonitorOverviewRetrieve(params?.hours)
@@ -140,11 +125,25 @@ export async function getCentrifugoMonitorOverviewRetrieve( params?: { hours?:
140
125
  * @method GET
141
126
  * @path /cfg/centrifugo/monitor/publishes/
142
127
  */
143
- export async function getCentrifugoMonitorPublishesRetrieve( params?: { channel?: string; count?: number }, client?
128
+ export async function getCentrifugoMonitorPublishesRetrieve( params?: { channel?: string; count?: number; offset?: number; status?: string }, client?: any
144
129
  ): Promise<RecentPublishes> {
145
130
  const api = client || getAPIInstance()
146
- const response = await api.cfg_centrifugo_monitoring.centrifugoMonitorPublishesRetrieve(params?.channel, params?.count)
131
+ const response = await api.cfg_centrifugo_monitoring.centrifugoMonitorPublishesRetrieve(params?.channel, params?.count, params?.offset, params?.status)
147
132
  return RecentPublishesSchema.parse(response)
148
133
  }
149
134
 
150
135
 
136
+ /**
137
+ * Get channel statistics
138
+ *
139
+ * @method GET
140
+ * @path /cfg/centrifugo/monitor/timeline/
141
+ */
142
+ export async function getCentrifugoMonitorTimelineRetrieve( params?: { hours?: number; interval?: string }, client?: any
143
+ ): Promise<ChannelList> {
144
+ const api = client || getAPIInstance()
145
+ const response = await api.cfg_centrifugo_monitoring.centrifugoMonitorTimelineRetrieve(params?.hours, params?.interval)
146
+ return ChannelListSchema.parse(response)
147
+ }
148
+
149
+