@djangocfg/api 1.2.4 → 1.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +7562 -3753
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8096 -3976
- package/dist/index.d.ts +8096 -3976
- package/dist/index.mjs +7581 -3799
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/cfg/contexts/TasksContext.tsx +242 -0
- package/src/cfg/contexts/index.ts +3 -0
- package/src/cfg/generated/_utils/fetchers/cfg__accounts.ts +2 -2
- package/src/cfg/generated/_utils/fetchers/cfg__accounts__auth.ts +1 -1
- package/src/cfg/generated/_utils/fetchers/cfg__accounts__user_profile.ts +6 -6
- package/src/cfg/generated/_utils/fetchers/cfg__centrifugo.ts +62 -0
- package/src/cfg/generated/_utils/fetchers/cfg__centrifugo__centrifugo_admin_api.ts +211 -0
- package/src/cfg/generated/_utils/fetchers/cfg__centrifugo__centrifugo_monitoring.ts +150 -0
- package/src/cfg/generated/_utils/fetchers/cfg__centrifugo__centrifugo_testing.ts +152 -0
- package/src/cfg/generated/_utils/fetchers/cfg__dashboard.ts +150 -0
- package/src/cfg/generated/_utils/fetchers/cfg__endpoints.ts +30 -1
- package/src/cfg/generated/_utils/fetchers/cfg__health.ts +2 -2
- package/src/cfg/generated/_utils/fetchers/cfg__knowbase.ts +57 -57
- package/src/cfg/generated/_utils/fetchers/cfg__leads.ts +6 -6
- package/src/cfg/generated/_utils/fetchers/cfg__leads__lead_submission.ts +1 -1
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter.ts +3 -3
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__bulk_email.ts +1 -1
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__campaigns.ts +6 -6
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__logs.ts +1 -1
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__newsletters.ts +2 -2
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__subscriptions.ts +3 -3
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__testing.ts +1 -1
- package/src/cfg/generated/_utils/fetchers/cfg__payments.ts +8 -8
- package/src/cfg/generated/_utils/fetchers/cfg__support.ts +12 -12
- package/src/cfg/generated/_utils/fetchers/cfg__tasks.ts +10 -10
- package/src/cfg/generated/_utils/fetchers/index.ts +5 -2
- package/src/cfg/generated/_utils/hooks/cfg__centrifugo.ts +49 -0
- package/src/cfg/generated/_utils/hooks/cfg__centrifugo__centrifugo_admin_api.ts +246 -0
- package/src/cfg/generated/_utils/hooks/cfg__centrifugo__centrifugo_monitoring.ts +137 -0
- package/src/cfg/generated/_utils/hooks/cfg__centrifugo__centrifugo_testing.ts +171 -0
- package/src/cfg/generated/_utils/hooks/cfg__dashboard.ts +137 -0
- package/src/cfg/generated/_utils/hooks/cfg__endpoints.ts +29 -0
- package/src/cfg/generated/_utils/hooks/index.ts +5 -2
- package/src/cfg/generated/_utils/schemas/ActivityEntry.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/AppStatistics.schema.ts +20 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoChannelInfo.schema.ts +19 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoChannelsRequestRequest.schema.ts +19 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoChannelsResponse.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoChannelsResult.schema.ts +19 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoClientInfo.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoError.schema.ts +20 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoHistoryRequestRequest.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoHistoryResponse.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoHistoryResult.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoInfoResponse.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoInfoResult.schema.ts +20 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoMetrics.schema.ts +20 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoNodeInfo.schema.ts +30 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoPresenceRequestRequest.schema.ts +19 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoPresenceResponse.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoPresenceResult.schema.ts +19 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoPresenceStatsRequestRequest.schema.ts +19 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoPresenceStatsResponse.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoPresenceStatsResult.schema.ts +20 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoProcess.schema.ts +20 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoPublication.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoStreamPosition.schema.ts +20 -0
- package/src/cfg/generated/_utils/schemas/ChannelList.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/ChannelStatsSerializer.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/ConnectionTokenRequestRequest.schema.ts +20 -0
- package/src/cfg/generated/_utils/schemas/ConnectionTokenResponse.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/DashboardOverview.schema.ts +27 -0
- package/src/cfg/generated/_utils/schemas/HealthCheck.schema.ts +5 -7
- package/src/cfg/generated/_utils/schemas/ManualAckRequestRequest.schema.ts +20 -0
- package/src/cfg/generated/_utils/schemas/ManualAckResponse.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/OverviewStats.schema.ts +9 -12
- package/src/cfg/generated/_utils/schemas/PublishTestRequestRequest.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/PublishTestResponse.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/QuickAction.schema.ts +29 -0
- package/src/cfg/generated/_utils/schemas/RecentPublishes.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/StatCard.schema.ts +30 -0
- package/src/cfg/generated/_utils/schemas/SystemHealth.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/SystemHealthItem.schema.ts +28 -0
- package/src/cfg/generated/_utils/schemas/SystemMetrics.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/URLPattern.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/URLsList.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/UserStatistics.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/index.ts +42 -10
- package/src/cfg/generated/cfg__centrifugo/client.ts +30 -0
- package/src/cfg/generated/cfg__centrifugo/models.ts +0 -0
- package/src/cfg/generated/cfg__centrifugo__centrifugo_admin_api/client.ts +136 -0
- package/src/cfg/generated/cfg__centrifugo__centrifugo_admin_api/models.ts +256 -0
- package/src/cfg/generated/cfg__centrifugo__centrifugo_monitoring/client.ts +160 -0
- package/src/cfg/generated/cfg__centrifugo__centrifugo_monitoring/index.ts +2 -0
- package/src/cfg/generated/cfg__centrifugo__centrifugo_monitoring/models.ts +92 -0
- package/src/cfg/generated/cfg__centrifugo__centrifugo_testing/client.ts +100 -0
- package/src/cfg/generated/cfg__centrifugo__centrifugo_testing/index.ts +2 -0
- package/src/cfg/generated/cfg__centrifugo__centrifugo_testing/models.ts +88 -0
- package/src/cfg/generated/cfg__dashboard/client.ts +106 -0
- package/src/cfg/generated/cfg__dashboard/index.ts +2 -0
- package/src/cfg/generated/cfg__dashboard/models.ts +108 -0
- package/src/cfg/generated/cfg__endpoints/client.ts +16 -0
- package/src/cfg/generated/cfg__endpoints/models.ts +44 -0
- package/src/cfg/generated/cfg__health/models.ts +7 -11
- package/src/cfg/generated/client.ts +15 -6
- package/src/cfg/generated/enums.ts +56 -0
- package/src/cfg/generated/index.ts +32 -20
- package/src/cfg/generated/schema.ts +4840 -2127
- package/src/cfg/generated/_utils/fetchers/cfg__ipc__ipcrpc_monitoring.ts +0 -179
- package/src/cfg/generated/_utils/fetchers/cfg__ipc__ipcrpc_testing.ts +0 -151
- package/src/cfg/generated/_utils/hooks/cfg__ipc__ipcrpc_monitoring.ts +0 -166
- package/src/cfg/generated/_utils/hooks/cfg__ipc__ipcrpc_testing.ts +0 -162
- package/src/cfg/generated/_utils/schemas/LoadTestRequestRequest.schema.ts +0 -22
- package/src/cfg/generated/_utils/schemas/LoadTestResponse.schema.ts +0 -21
- package/src/cfg/generated/_utils/schemas/LoadTestStatus.schema.ts +0 -27
- package/src/cfg/generated/_utils/schemas/MethodStat.schema.ts +0 -25
- package/src/cfg/generated/_utils/schemas/MethodStats.schema.ts +0 -22
- package/src/cfg/generated/_utils/schemas/NotificationStats.schema.ts +0 -25
- package/src/cfg/generated/_utils/schemas/RPCRequest.schema.ts +0 -25
- package/src/cfg/generated/_utils/schemas/RecentRequests.schema.ts +0 -22
- package/src/cfg/generated/_utils/schemas/TestRPCRequestRequest.schema.ts +0 -21
- package/src/cfg/generated/_utils/schemas/TestRPCResponse.schema.ts +0 -23
- package/src/cfg/generated/cfg__ipc__ipcrpc_monitoring/client.ts +0 -136
- package/src/cfg/generated/cfg__ipc__ipcrpc_monitoring/models.ts +0 -144
- package/src/cfg/generated/cfg__ipc__ipcrpc_testing/client.ts +0 -96
- package/src/cfg/generated/cfg__ipc__ipcrpc_testing/models.ts +0 -88
- /package/src/cfg/generated/{cfg__ipc__ipcrpc_monitoring → cfg__centrifugo}/index.ts +0 -0
- /package/src/cfg/generated/{cfg__ipc__ipcrpc_testing → cfg__centrifugo__centrifugo_admin_api}/index.ts +0 -0
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Request to list active channels.
|
|
3
|
+
*
|
|
4
|
+
* Request model (no read-only fields).
|
|
5
|
+
*/
|
|
6
|
+
export interface CentrifugoChannelsRequestRequest {
|
|
7
|
+
/** Pattern to filter channels (e.g., 'user:*') */
|
|
8
|
+
pattern?: string | null;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* List of active channels response.
|
|
13
|
+
*
|
|
14
|
+
* Response model (includes read-only fields).
|
|
15
|
+
*/
|
|
16
|
+
export interface CentrifugoChannelsResponse {
|
|
17
|
+
error?: Record<string, any>;
|
|
18
|
+
result?: Record<string, any>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Request to get channel history.
|
|
23
|
+
*
|
|
24
|
+
* Request model (no read-only fields).
|
|
25
|
+
*/
|
|
26
|
+
export interface CentrifugoHistoryRequestRequest {
|
|
27
|
+
/** Channel name */
|
|
28
|
+
channel: string;
|
|
29
|
+
/** Maximum number of messages to return */
|
|
30
|
+
limit?: string | null;
|
|
31
|
+
since?: Record<string, any>;
|
|
32
|
+
/** Reverse message order (newest first) */
|
|
33
|
+
reverse?: string | null;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Channel history response.
|
|
38
|
+
*
|
|
39
|
+
* Response model (includes read-only fields).
|
|
40
|
+
*/
|
|
41
|
+
export interface CentrifugoHistoryResponse {
|
|
42
|
+
error?: Record<string, any>;
|
|
43
|
+
result?: Record<string, any>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Server info response.
|
|
48
|
+
*
|
|
49
|
+
* Response model (includes read-only fields).
|
|
50
|
+
*/
|
|
51
|
+
export interface CentrifugoInfoResponse {
|
|
52
|
+
error?: Record<string, any>;
|
|
53
|
+
result?: Record<string, any>;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Request to get channel presence.
|
|
58
|
+
*
|
|
59
|
+
* Request model (no read-only fields).
|
|
60
|
+
*/
|
|
61
|
+
export interface CentrifugoPresenceRequestRequest {
|
|
62
|
+
/** Channel name */
|
|
63
|
+
channel: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Channel presence response.
|
|
68
|
+
*
|
|
69
|
+
* Response model (includes read-only fields).
|
|
70
|
+
*/
|
|
71
|
+
export interface CentrifugoPresenceResponse {
|
|
72
|
+
error?: Record<string, any>;
|
|
73
|
+
result?: Record<string, any>;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Request to get channel presence statistics.
|
|
78
|
+
*
|
|
79
|
+
* Request model (no read-only fields).
|
|
80
|
+
*/
|
|
81
|
+
export interface CentrifugoPresenceStatsRequestRequest {
|
|
82
|
+
/** Channel name */
|
|
83
|
+
channel: string;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Channel presence stats response.
|
|
88
|
+
*
|
|
89
|
+
* Response model (includes read-only fields).
|
|
90
|
+
*/
|
|
91
|
+
export interface CentrifugoPresenceStatsResponse {
|
|
92
|
+
error?: Record<string, any>;
|
|
93
|
+
result?: Record<string, any>;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Centrifugo API error structure.
|
|
98
|
+
*
|
|
99
|
+
* Response model (includes read-only fields).
|
|
100
|
+
*/
|
|
101
|
+
export interface CentrifugoError {
|
|
102
|
+
/** Error code (0 = no error) */
|
|
103
|
+
code?: number;
|
|
104
|
+
/** Error message */
|
|
105
|
+
message?: string;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Channels result wrapper.
|
|
110
|
+
*
|
|
111
|
+
* Response model (includes read-only fields).
|
|
112
|
+
*/
|
|
113
|
+
export interface CentrifugoChannelsResult {
|
|
114
|
+
/** Map of channel names to channel info */
|
|
115
|
+
channels: Record<string, any>;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Stream position for pagination.
|
|
120
|
+
*
|
|
121
|
+
* Response model (includes read-only fields).
|
|
122
|
+
*/
|
|
123
|
+
export interface CentrifugoStreamPosition {
|
|
124
|
+
/** Stream offset */
|
|
125
|
+
offset: number;
|
|
126
|
+
/** Stream epoch */
|
|
127
|
+
epoch: string;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* History result wrapper.
|
|
132
|
+
*
|
|
133
|
+
* Response model (includes read-only fields).
|
|
134
|
+
*/
|
|
135
|
+
export interface CentrifugoHistoryResult {
|
|
136
|
+
/** List of publications */
|
|
137
|
+
publications: Array<CentrifugoPublication>;
|
|
138
|
+
/** Current stream epoch */
|
|
139
|
+
epoch: string;
|
|
140
|
+
/** Latest stream offset */
|
|
141
|
+
offset: number;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Info result wrapper.
|
|
146
|
+
*
|
|
147
|
+
* Response model (includes read-only fields).
|
|
148
|
+
*/
|
|
149
|
+
export interface CentrifugoInfoResult {
|
|
150
|
+
/** List of Centrifugo nodes */
|
|
151
|
+
nodes: Array<CentrifugoNodeInfo>;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Presence result wrapper.
|
|
156
|
+
*
|
|
157
|
+
* Response model (includes read-only fields).
|
|
158
|
+
*/
|
|
159
|
+
export interface CentrifugoPresenceResult {
|
|
160
|
+
/** Map of client IDs to client info */
|
|
161
|
+
presence: Record<string, any>;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Presence stats result.
|
|
166
|
+
*
|
|
167
|
+
* Response model (includes read-only fields).
|
|
168
|
+
*/
|
|
169
|
+
export interface CentrifugoPresenceStatsResult {
|
|
170
|
+
/** Number of connected clients */
|
|
171
|
+
num_clients: number;
|
|
172
|
+
/** Number of unique users */
|
|
173
|
+
num_users: number;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Single publication (message) in channel history.
|
|
178
|
+
*
|
|
179
|
+
* Response model (includes read-only fields).
|
|
180
|
+
*/
|
|
181
|
+
export interface CentrifugoPublication {
|
|
182
|
+
/** Message payload */
|
|
183
|
+
data: Record<string, any>;
|
|
184
|
+
info?: Record<string, any>;
|
|
185
|
+
/** Message offset in channel stream */
|
|
186
|
+
offset: number;
|
|
187
|
+
/** Optional message tags */
|
|
188
|
+
tags?: string | null;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Information about a single Centrifugo node.
|
|
193
|
+
*
|
|
194
|
+
* Response model (includes read-only fields).
|
|
195
|
+
*/
|
|
196
|
+
export interface CentrifugoNodeInfo {
|
|
197
|
+
/** Unique node identifier */
|
|
198
|
+
uid: string;
|
|
199
|
+
/** Node name */
|
|
200
|
+
name: string;
|
|
201
|
+
/** Centrifugo version */
|
|
202
|
+
version: string;
|
|
203
|
+
/** Number of connected clients */
|
|
204
|
+
num_clients: number;
|
|
205
|
+
/** Number of unique users */
|
|
206
|
+
num_users: number;
|
|
207
|
+
/** Number of active channels */
|
|
208
|
+
num_channels: number;
|
|
209
|
+
/** Node uptime in seconds */
|
|
210
|
+
uptime: number;
|
|
211
|
+
/** Total number of subscriptions */
|
|
212
|
+
num_subs: number;
|
|
213
|
+
metrics?: Record<string, any>;
|
|
214
|
+
process?: Record<string, any>;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Information about connected client.
|
|
219
|
+
*
|
|
220
|
+
* Response model (includes read-only fields).
|
|
221
|
+
*/
|
|
222
|
+
export interface CentrifugoClientInfo {
|
|
223
|
+
/** User ID */
|
|
224
|
+
user: string;
|
|
225
|
+
/** Client UUID */
|
|
226
|
+
client: string;
|
|
227
|
+
/** Connection metadata */
|
|
228
|
+
conn_info?: string | null;
|
|
229
|
+
/** Channel-specific metadata */
|
|
230
|
+
chan_info?: string | null;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Server metrics.
|
|
235
|
+
*
|
|
236
|
+
* Response model (includes read-only fields).
|
|
237
|
+
*/
|
|
238
|
+
export interface CentrifugoMetrics {
|
|
239
|
+
/** Metrics collection interval */
|
|
240
|
+
interval: number;
|
|
241
|
+
/** Metric name to value mapping */
|
|
242
|
+
items: Record<string, any>;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Process information.
|
|
247
|
+
*
|
|
248
|
+
* Response model (includes read-only fields).
|
|
249
|
+
*/
|
|
250
|
+
export interface CentrifugoProcess {
|
|
251
|
+
/** CPU usage percentage */
|
|
252
|
+
cpu: number;
|
|
253
|
+
/** Resident set size in bytes */
|
|
254
|
+
rss: number;
|
|
255
|
+
}
|
|
256
|
+
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import * as Models from "./models";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* API endpoints for Centrifugo Monitoring.
|
|
6
|
+
*/
|
|
7
|
+
export class CfgCentrifugoMonitoring {
|
|
8
|
+
private client: any;
|
|
9
|
+
|
|
10
|
+
constructor(client: any) {
|
|
11
|
+
this.client = client;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Get Centrifugo health status
|
|
16
|
+
*
|
|
17
|
+
* Returns the current health status of the Centrifugo client.
|
|
18
|
+
*/
|
|
19
|
+
async centrifugoAdminApiMonitorHealthRetrieve(): Promise<Models.HealthCheck> {
|
|
20
|
+
const response = await this.client.request('GET', "/cfg/centrifugo/admin/api/monitor/health/");
|
|
21
|
+
return response;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
async centrifugoAdminApiMonitorOverviewRetrieve(hours?: number): Promise<Models.OverviewStats>;
|
|
25
|
+
async centrifugoAdminApiMonitorOverviewRetrieve(params?: { hours?: number }): Promise<Models.OverviewStats>;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Get overview statistics
|
|
29
|
+
*
|
|
30
|
+
* Returns overview statistics for Centrifugo publishes.
|
|
31
|
+
*/
|
|
32
|
+
async centrifugoAdminApiMonitorOverviewRetrieve(...args: any[]): Promise<Models.OverviewStats> {
|
|
33
|
+
const isParamsObject = args.length === 1 && typeof args[0] === 'object' && args[0] !== null && !Array.isArray(args[0]);
|
|
34
|
+
|
|
35
|
+
let params;
|
|
36
|
+
if (isParamsObject) {
|
|
37
|
+
params = args[0];
|
|
38
|
+
} else {
|
|
39
|
+
params = { hours: args[0] };
|
|
40
|
+
}
|
|
41
|
+
const response = await this.client.request('GET', "/cfg/centrifugo/admin/api/monitor/overview/", { params });
|
|
42
|
+
return response;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
async centrifugoAdminApiMonitorPublishesRetrieve(channel?: string, count?: number, offset?: number, status?: string): Promise<Models.RecentPublishes>;
|
|
46
|
+
async centrifugoAdminApiMonitorPublishesRetrieve(params?: { channel?: string; count?: number; offset?: number; status?: string }): Promise<Models.RecentPublishes>;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Get recent publishes
|
|
50
|
+
*
|
|
51
|
+
* Returns a list of recent Centrifugo publishes with their details.
|
|
52
|
+
*/
|
|
53
|
+
async centrifugoAdminApiMonitorPublishesRetrieve(...args: any[]): Promise<Models.RecentPublishes> {
|
|
54
|
+
const isParamsObject = args.length === 1 && typeof args[0] === 'object' && args[0] !== null && !Array.isArray(args[0]);
|
|
55
|
+
|
|
56
|
+
let params;
|
|
57
|
+
if (isParamsObject) {
|
|
58
|
+
params = args[0];
|
|
59
|
+
} else {
|
|
60
|
+
params = { channel: args[0], count: args[1], offset: args[2], status: args[3] };
|
|
61
|
+
}
|
|
62
|
+
const response = await this.client.request('GET', "/cfg/centrifugo/admin/api/monitor/publishes/", { params });
|
|
63
|
+
return response;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
async centrifugoAdminApiMonitorTimelineRetrieve(hours?: number, interval?: string): Promise<Models.ChannelList[]>;
|
|
67
|
+
async centrifugoAdminApiMonitorTimelineRetrieve(params?: { hours?: number; interval?: string }): Promise<Models.ChannelList[]>;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Get channel statistics
|
|
71
|
+
*
|
|
72
|
+
* Returns statistics grouped by channel.
|
|
73
|
+
*/
|
|
74
|
+
async centrifugoAdminApiMonitorTimelineRetrieve(...args: any[]): Promise<Models.ChannelList[]> {
|
|
75
|
+
const isParamsObject = args.length === 1 && typeof args[0] === 'object' && args[0] !== null && !Array.isArray(args[0]);
|
|
76
|
+
|
|
77
|
+
let params;
|
|
78
|
+
if (isParamsObject) {
|
|
79
|
+
params = args[0];
|
|
80
|
+
} else {
|
|
81
|
+
params = { hours: args[0], interval: args[1] };
|
|
82
|
+
}
|
|
83
|
+
const response = await this.client.request('GET', "/cfg/centrifugo/admin/api/monitor/timeline/", { params });
|
|
84
|
+
return (response as any).results || [];
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Get Centrifugo health status
|
|
89
|
+
*
|
|
90
|
+
* Returns the current health status of the Centrifugo client.
|
|
91
|
+
*/
|
|
92
|
+
async centrifugoMonitorHealthRetrieve(): Promise<Models.HealthCheck> {
|
|
93
|
+
const response = await this.client.request('GET', "/cfg/centrifugo/monitor/health/");
|
|
94
|
+
return response;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
async centrifugoMonitorOverviewRetrieve(hours?: number): Promise<Models.OverviewStats>;
|
|
98
|
+
async centrifugoMonitorOverviewRetrieve(params?: { hours?: number }): Promise<Models.OverviewStats>;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Get overview statistics
|
|
102
|
+
*
|
|
103
|
+
* Returns overview statistics for Centrifugo publishes.
|
|
104
|
+
*/
|
|
105
|
+
async centrifugoMonitorOverviewRetrieve(...args: any[]): Promise<Models.OverviewStats> {
|
|
106
|
+
const isParamsObject = args.length === 1 && typeof args[0] === 'object' && args[0] !== null && !Array.isArray(args[0]);
|
|
107
|
+
|
|
108
|
+
let params;
|
|
109
|
+
if (isParamsObject) {
|
|
110
|
+
params = args[0];
|
|
111
|
+
} else {
|
|
112
|
+
params = { hours: args[0] };
|
|
113
|
+
}
|
|
114
|
+
const response = await this.client.request('GET', "/cfg/centrifugo/monitor/overview/", { params });
|
|
115
|
+
return response;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
async centrifugoMonitorPublishesRetrieve(channel?: string, count?: number, offset?: number, status?: string): Promise<Models.RecentPublishes>;
|
|
119
|
+
async centrifugoMonitorPublishesRetrieve(params?: { channel?: string; count?: number; offset?: number; status?: string }): Promise<Models.RecentPublishes>;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Get recent publishes
|
|
123
|
+
*
|
|
124
|
+
* Returns a list of recent Centrifugo publishes with their details.
|
|
125
|
+
*/
|
|
126
|
+
async centrifugoMonitorPublishesRetrieve(...args: any[]): Promise<Models.RecentPublishes> {
|
|
127
|
+
const isParamsObject = args.length === 1 && typeof args[0] === 'object' && args[0] !== null && !Array.isArray(args[0]);
|
|
128
|
+
|
|
129
|
+
let params;
|
|
130
|
+
if (isParamsObject) {
|
|
131
|
+
params = args[0];
|
|
132
|
+
} else {
|
|
133
|
+
params = { channel: args[0], count: args[1], offset: args[2], status: args[3] };
|
|
134
|
+
}
|
|
135
|
+
const response = await this.client.request('GET', "/cfg/centrifugo/monitor/publishes/", { params });
|
|
136
|
+
return response;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
async centrifugoMonitorTimelineRetrieve(hours?: number, interval?: string): Promise<Models.ChannelList[]>;
|
|
140
|
+
async centrifugoMonitorTimelineRetrieve(params?: { hours?: number; interval?: string }): Promise<Models.ChannelList[]>;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Get channel statistics
|
|
144
|
+
*
|
|
145
|
+
* Returns statistics grouped by channel.
|
|
146
|
+
*/
|
|
147
|
+
async centrifugoMonitorTimelineRetrieve(...args: any[]): Promise<Models.ChannelList[]> {
|
|
148
|
+
const isParamsObject = args.length === 1 && typeof args[0] === 'object' && args[0] !== null && !Array.isArray(args[0]);
|
|
149
|
+
|
|
150
|
+
let params;
|
|
151
|
+
if (isParamsObject) {
|
|
152
|
+
params = args[0];
|
|
153
|
+
} else {
|
|
154
|
+
params = { hours: args[0], interval: args[1] };
|
|
155
|
+
}
|
|
156
|
+
const response = await this.client.request('GET', "/cfg/centrifugo/monitor/timeline/", { params });
|
|
157
|
+
return (response as any).results || [];
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Health check response.
|
|
3
|
+
*
|
|
4
|
+
* Response model (includes read-only fields).
|
|
5
|
+
*/
|
|
6
|
+
export interface HealthCheck {
|
|
7
|
+
/** Health status: healthy or unhealthy */
|
|
8
|
+
status: string;
|
|
9
|
+
/** Configured wrapper URL */
|
|
10
|
+
wrapper_url: string;
|
|
11
|
+
/** Whether API key is configured */
|
|
12
|
+
has_api_key: boolean;
|
|
13
|
+
/** Current timestamp */
|
|
14
|
+
timestamp: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Overview statistics for Centrifugo publishes.
|
|
19
|
+
*
|
|
20
|
+
* Response model (includes read-only fields).
|
|
21
|
+
*/
|
|
22
|
+
export interface OverviewStats {
|
|
23
|
+
/** Total publishes in period */
|
|
24
|
+
total: number;
|
|
25
|
+
/** Successful publishes */
|
|
26
|
+
successful: number;
|
|
27
|
+
/** Failed publishes */
|
|
28
|
+
failed: number;
|
|
29
|
+
/** Timeout publishes */
|
|
30
|
+
timeout: number;
|
|
31
|
+
/** Success rate percentage */
|
|
32
|
+
success_rate: number;
|
|
33
|
+
/** Average duration in milliseconds */
|
|
34
|
+
avg_duration_ms: number;
|
|
35
|
+
/** Average ACKs received */
|
|
36
|
+
avg_acks_received: number;
|
|
37
|
+
/** Statistics period in hours */
|
|
38
|
+
period_hours: number;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Recent publishes list.
|
|
43
|
+
*
|
|
44
|
+
* Response model (includes read-only fields).
|
|
45
|
+
*/
|
|
46
|
+
export interface RecentPublishes {
|
|
47
|
+
/** List of recent publishes */
|
|
48
|
+
publishes: Array<Record<string, any>>;
|
|
49
|
+
/** Number of publishes returned */
|
|
50
|
+
count: number;
|
|
51
|
+
/** Total publishes available */
|
|
52
|
+
total_available: number;
|
|
53
|
+
/** Current offset for pagination */
|
|
54
|
+
offset?: number;
|
|
55
|
+
/** Whether more results are available */
|
|
56
|
+
has_more?: boolean;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* List of channel statistics.
|
|
61
|
+
*
|
|
62
|
+
* Response model (includes read-only fields).
|
|
63
|
+
*/
|
|
64
|
+
export interface ChannelList {
|
|
65
|
+
/** Channel statistics */
|
|
66
|
+
channels: Array<ChannelStatsSerializer>;
|
|
67
|
+
/** Total number of channels */
|
|
68
|
+
total_channels: number;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Statistics per channel.
|
|
73
|
+
*
|
|
74
|
+
* Response model (includes read-only fields).
|
|
75
|
+
*/
|
|
76
|
+
export interface ChannelStatsSerializer {
|
|
77
|
+
/** Channel name */
|
|
78
|
+
channel: string;
|
|
79
|
+
/** Total publishes to this channel */
|
|
80
|
+
total: number;
|
|
81
|
+
/** Successful publishes */
|
|
82
|
+
successful: number;
|
|
83
|
+
/** Failed publishes */
|
|
84
|
+
failed: number;
|
|
85
|
+
/** Average duration */
|
|
86
|
+
avg_duration_ms: number;
|
|
87
|
+
/** Average ACKs received */
|
|
88
|
+
avg_acks: number;
|
|
89
|
+
/** Last activity timestamp (ISO format) */
|
|
90
|
+
last_activity_at?: string | null;
|
|
91
|
+
}
|
|
92
|
+
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import * as Models from "./models";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* API endpoints for Centrifugo Testing.
|
|
6
|
+
*/
|
|
7
|
+
export class CfgCentrifugoTesting {
|
|
8
|
+
private client: any;
|
|
9
|
+
|
|
10
|
+
constructor(client: any) {
|
|
11
|
+
this.client = client;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Generate connection token
|
|
16
|
+
*
|
|
17
|
+
* Generate JWT token for WebSocket connection to Centrifugo.
|
|
18
|
+
*/
|
|
19
|
+
async centrifugoAdminApiTestingConnectionTokenCreate(data: Models.ConnectionTokenRequestRequest): Promise<Models.ConnectionTokenResponse> {
|
|
20
|
+
const response = await this.client.request('POST', "/cfg/centrifugo/admin/api/testing/connection-token/", { body: data });
|
|
21
|
+
return response;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Publish test message
|
|
26
|
+
*
|
|
27
|
+
* Publish test message to Centrifugo via wrapper with optional ACK
|
|
28
|
+
* tracking.
|
|
29
|
+
*/
|
|
30
|
+
async centrifugoAdminApiTestingPublishTestCreate(data: Models.PublishTestRequestRequest): Promise<Models.PublishTestResponse> {
|
|
31
|
+
const response = await this.client.request('POST', "/cfg/centrifugo/admin/api/testing/publish-test/", { body: data });
|
|
32
|
+
return response;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Publish with database logging
|
|
37
|
+
*
|
|
38
|
+
* Publish message using CentrifugoClient with database logging. This will
|
|
39
|
+
* create CentrifugoLog records.
|
|
40
|
+
*/
|
|
41
|
+
async centrifugoAdminApiTestingPublishWithLoggingCreate(data: Models.PublishTestRequestRequest): Promise<Models.PublishTestResponse> {
|
|
42
|
+
const response = await this.client.request('POST', "/cfg/centrifugo/admin/api/testing/publish-with-logging/", { body: data });
|
|
43
|
+
return response;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Send manual ACK
|
|
48
|
+
*
|
|
49
|
+
* Manually send ACK for a message to the wrapper. Pass message_id in
|
|
50
|
+
* request body.
|
|
51
|
+
*/
|
|
52
|
+
async centrifugoAdminApiTestingSendAckCreate(data: Models.ManualAckRequestRequest): Promise<Models.ManualAckResponse> {
|
|
53
|
+
const response = await this.client.request('POST', "/cfg/centrifugo/admin/api/testing/send-ack/", { body: data });
|
|
54
|
+
return response;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Generate connection token
|
|
59
|
+
*
|
|
60
|
+
* Generate JWT token for WebSocket connection to Centrifugo.
|
|
61
|
+
*/
|
|
62
|
+
async connectionTokenCreate(data: Models.ConnectionTokenRequestRequest): Promise<Models.ConnectionTokenResponse> {
|
|
63
|
+
const response = await this.client.request('POST', "/cfg/centrifugo/testing/connection-token/", { body: data });
|
|
64
|
+
return response;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Publish test message
|
|
69
|
+
*
|
|
70
|
+
* Publish test message to Centrifugo via wrapper with optional ACK
|
|
71
|
+
* tracking.
|
|
72
|
+
*/
|
|
73
|
+
async publishTestCreate(data: Models.PublishTestRequestRequest): Promise<Models.PublishTestResponse> {
|
|
74
|
+
const response = await this.client.request('POST', "/cfg/centrifugo/testing/publish-test/", { body: data });
|
|
75
|
+
return response;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Publish with database logging
|
|
80
|
+
*
|
|
81
|
+
* Publish message using CentrifugoClient with database logging. This will
|
|
82
|
+
* create CentrifugoLog records.
|
|
83
|
+
*/
|
|
84
|
+
async publishWithLoggingCreate(data: Models.PublishTestRequestRequest): Promise<Models.PublishTestResponse> {
|
|
85
|
+
const response = await this.client.request('POST', "/cfg/centrifugo/testing/publish-with-logging/", { body: data });
|
|
86
|
+
return response;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Send manual ACK
|
|
91
|
+
*
|
|
92
|
+
* Manually send ACK for a message to the wrapper. Pass message_id in
|
|
93
|
+
* request body.
|
|
94
|
+
*/
|
|
95
|
+
async sendAckCreate(data: Models.ManualAckRequestRequest): Promise<Models.ManualAckResponse> {
|
|
96
|
+
const response = await this.client.request('POST', "/cfg/centrifugo/testing/send-ack/", { body: data });
|
|
97
|
+
return response;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Request model for connection token generation.
|
|
3
|
+
*
|
|
4
|
+
* Request model (no read-only fields).
|
|
5
|
+
*/
|
|
6
|
+
export interface ConnectionTokenRequestRequest {
|
|
7
|
+
/** User ID for the connection */
|
|
8
|
+
user_id: string;
|
|
9
|
+
/** List of channels to authorize */
|
|
10
|
+
channels?: Array<string>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Response model for connection token.
|
|
15
|
+
*
|
|
16
|
+
* Response model (includes read-only fields).
|
|
17
|
+
*/
|
|
18
|
+
export interface ConnectionTokenResponse {
|
|
19
|
+
/** JWT token for WebSocket connection */
|
|
20
|
+
token: string;
|
|
21
|
+
/** Centrifugo WebSocket URL */
|
|
22
|
+
centrifugo_url: string;
|
|
23
|
+
/** Token expiration time (ISO 8601) */
|
|
24
|
+
expires_at: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Request model for test message publishing.
|
|
29
|
+
*
|
|
30
|
+
* Request model (no read-only fields).
|
|
31
|
+
*/
|
|
32
|
+
export interface PublishTestRequestRequest {
|
|
33
|
+
/** Target channel name */
|
|
34
|
+
channel: string;
|
|
35
|
+
/** Message data (any JSON object) */
|
|
36
|
+
data: Record<string, any>;
|
|
37
|
+
/** Wait for client acknowledgment */
|
|
38
|
+
wait_for_ack?: boolean;
|
|
39
|
+
/** ACK timeout in seconds */
|
|
40
|
+
ack_timeout?: number;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Response model for test message publishing.
|
|
45
|
+
*
|
|
46
|
+
* Response model (includes read-only fields).
|
|
47
|
+
*/
|
|
48
|
+
export interface PublishTestResponse {
|
|
49
|
+
/** Whether publish succeeded */
|
|
50
|
+
success: boolean;
|
|
51
|
+
/** Unique message ID */
|
|
52
|
+
message_id: string;
|
|
53
|
+
/** Target channel */
|
|
54
|
+
channel: string;
|
|
55
|
+
/** Number of ACKs received */
|
|
56
|
+
acks_received?: number;
|
|
57
|
+
/** Whether message was delivered */
|
|
58
|
+
delivered?: boolean;
|
|
59
|
+
/** Error message if failed */
|
|
60
|
+
error?: string | null;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Request model for manual ACK sending.
|
|
65
|
+
*
|
|
66
|
+
* Request model (no read-only fields).
|
|
67
|
+
*/
|
|
68
|
+
export interface ManualAckRequestRequest {
|
|
69
|
+
/** Message ID to acknowledge */
|
|
70
|
+
message_id: string;
|
|
71
|
+
/** Client ID sending the ACK */
|
|
72
|
+
client_id: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Response model for manual ACK.
|
|
77
|
+
*
|
|
78
|
+
* Response model (includes read-only fields).
|
|
79
|
+
*/
|
|
80
|
+
export interface ManualAckResponse {
|
|
81
|
+
/** Whether ACK was sent successfully */
|
|
82
|
+
success: boolean;
|
|
83
|
+
/** Message ID that was acknowledged */
|
|
84
|
+
message_id: string;
|
|
85
|
+
/** Error message if failed */
|
|
86
|
+
error?: string | null;
|
|
87
|
+
}
|
|
88
|
+
|