@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,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed fetchers for Centrifugo Monitoring
|
|
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 { ChannelListSchema, type ChannelList } from '../schemas/ChannelList.schema'
|
|
33
|
+
import { HealthCheckSchema, type HealthCheck } from '../schemas/HealthCheck.schema'
|
|
34
|
+
import { OverviewStatsSchema, type OverviewStats } from '../schemas/OverviewStats.schema'
|
|
35
|
+
import { RecentPublishesSchema, type RecentPublishes } from '../schemas/RecentPublishes.schema'
|
|
36
|
+
import { getAPIInstance } from '../../api-instance'
|
|
37
|
+
import type { API } from '../../index'
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Get Centrifugo health status
|
|
41
|
+
*
|
|
42
|
+
* @method GET
|
|
43
|
+
* @path /cfg/centrifugo/admin/api/monitor/health/
|
|
44
|
+
*/
|
|
45
|
+
export async function getCentrifugoAdminApiMonitorHealthRetrieve( client?: API
|
|
46
|
+
): Promise<HealthCheck> {
|
|
47
|
+
const api = client || getAPIInstance()
|
|
48
|
+
const response = await api.cfg_centrifugo_monitoring.centrifugoAdminApiMonitorHealthRetrieve()
|
|
49
|
+
return HealthCheckSchema.parse(response)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Get overview statistics
|
|
55
|
+
*
|
|
56
|
+
* @method GET
|
|
57
|
+
* @path /cfg/centrifugo/admin/api/monitor/overview/
|
|
58
|
+
*/
|
|
59
|
+
export async function getCentrifugoAdminApiMonitorOverviewRetrieve( params?: { hours?: number }, client?: API
|
|
60
|
+
): Promise<OverviewStats> {
|
|
61
|
+
const api = client || getAPIInstance()
|
|
62
|
+
const response = await api.cfg_centrifugo_monitoring.centrifugoAdminApiMonitorOverviewRetrieve(params?.hours)
|
|
63
|
+
return OverviewStatsSchema.parse(response)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Get recent publishes
|
|
69
|
+
*
|
|
70
|
+
* @method GET
|
|
71
|
+
* @path /cfg/centrifugo/admin/api/monitor/publishes/
|
|
72
|
+
*/
|
|
73
|
+
export async function getCentrifugoAdminApiMonitorPublishesRetrieve( params?: { channel?: string; count?: number; offset?: number; status?: string }, client?: API
|
|
74
|
+
): Promise<RecentPublishes> {
|
|
75
|
+
const api = client || getAPIInstance()
|
|
76
|
+
const response = await api.cfg_centrifugo_monitoring.centrifugoAdminApiMonitorPublishesRetrieve(params?.channel, params?.count, params?.offset, params?.status)
|
|
77
|
+
return RecentPublishesSchema.parse(response)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Get channel statistics
|
|
83
|
+
*
|
|
84
|
+
* @method GET
|
|
85
|
+
* @path /cfg/centrifugo/admin/api/monitor/timeline/
|
|
86
|
+
*/
|
|
87
|
+
export async function getCentrifugoAdminApiMonitorTimelineRetrieve( params?: { hours?: number; interval?: string }, client?: API
|
|
88
|
+
): Promise<ChannelList> {
|
|
89
|
+
const api = client || getAPIInstance()
|
|
90
|
+
const response = await api.cfg_centrifugo_monitoring.centrifugoAdminApiMonitorTimelineRetrieve(params?.hours, params?.interval)
|
|
91
|
+
return ChannelListSchema.parse(response)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Get Centrifugo health status
|
|
97
|
+
*
|
|
98
|
+
* @method GET
|
|
99
|
+
* @path /cfg/centrifugo/monitor/health/
|
|
100
|
+
*/
|
|
101
|
+
export async function getCentrifugoMonitorHealthRetrieve( client?: API
|
|
102
|
+
): Promise<HealthCheck> {
|
|
103
|
+
const api = client || getAPIInstance()
|
|
104
|
+
const response = await api.cfg_centrifugo_monitoring.centrifugoMonitorHealthRetrieve()
|
|
105
|
+
return HealthCheckSchema.parse(response)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Get overview statistics
|
|
111
|
+
*
|
|
112
|
+
* @method GET
|
|
113
|
+
* @path /cfg/centrifugo/monitor/overview/
|
|
114
|
+
*/
|
|
115
|
+
export async function getCentrifugoMonitorOverviewRetrieve( params?: { hours?: number }, client?: API
|
|
116
|
+
): Promise<OverviewStats> {
|
|
117
|
+
const api = client || getAPIInstance()
|
|
118
|
+
const response = await api.cfg_centrifugo_monitoring.centrifugoMonitorOverviewRetrieve(params?.hours)
|
|
119
|
+
return OverviewStatsSchema.parse(response)
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Get recent publishes
|
|
125
|
+
*
|
|
126
|
+
* @method GET
|
|
127
|
+
* @path /cfg/centrifugo/monitor/publishes/
|
|
128
|
+
*/
|
|
129
|
+
export async function getCentrifugoMonitorPublishesRetrieve( params?: { channel?: string; count?: number; offset?: number; status?: string }, client?: API
|
|
130
|
+
): Promise<RecentPublishes> {
|
|
131
|
+
const api = client || getAPIInstance()
|
|
132
|
+
const response = await api.cfg_centrifugo_monitoring.centrifugoMonitorPublishesRetrieve(params?.channel, params?.count, params?.offset, params?.status)
|
|
133
|
+
return RecentPublishesSchema.parse(response)
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Get channel statistics
|
|
139
|
+
*
|
|
140
|
+
* @method GET
|
|
141
|
+
* @path /cfg/centrifugo/monitor/timeline/
|
|
142
|
+
*/
|
|
143
|
+
export async function getCentrifugoMonitorTimelineRetrieve( params?: { hours?: number; interval?: string }, client?: API
|
|
144
|
+
): Promise<ChannelList> {
|
|
145
|
+
const api = client || getAPIInstance()
|
|
146
|
+
const response = await api.cfg_centrifugo_monitoring.centrifugoMonitorTimelineRetrieve(params?.hours, params?.interval)
|
|
147
|
+
return ChannelListSchema.parse(response)
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed fetchers for Centrifugo Testing
|
|
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 { ConnectionTokenRequestRequestSchema, type ConnectionTokenRequestRequest } from '../schemas/ConnectionTokenRequestRequest.schema'
|
|
33
|
+
import { ConnectionTokenResponseSchema, type ConnectionTokenResponse } from '../schemas/ConnectionTokenResponse.schema'
|
|
34
|
+
import { ManualAckRequestRequestSchema, type ManualAckRequestRequest } from '../schemas/ManualAckRequestRequest.schema'
|
|
35
|
+
import { ManualAckResponseSchema, type ManualAckResponse } from '../schemas/ManualAckResponse.schema'
|
|
36
|
+
import { PublishTestRequestRequestSchema, type PublishTestRequestRequest } from '../schemas/PublishTestRequestRequest.schema'
|
|
37
|
+
import { PublishTestResponseSchema, type PublishTestResponse } from '../schemas/PublishTestResponse.schema'
|
|
38
|
+
import { getAPIInstance } from '../../api-instance'
|
|
39
|
+
import type { API } from '../../index'
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Generate connection token
|
|
43
|
+
*
|
|
44
|
+
* @method POST
|
|
45
|
+
* @path /cfg/centrifugo/admin/api/testing/connection-token/
|
|
46
|
+
*/
|
|
47
|
+
export async function createCentrifugoAdminApiTestingConnectionTokenCreate( data: ConnectionTokenRequestRequest, client?: API
|
|
48
|
+
): Promise<ConnectionTokenResponse> {
|
|
49
|
+
const api = client || getAPIInstance()
|
|
50
|
+
const response = await api.cfg_centrifugo_testing.centrifugoAdminApiTestingConnectionTokenCreate(data)
|
|
51
|
+
return ConnectionTokenResponseSchema.parse(response)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Publish test message
|
|
57
|
+
*
|
|
58
|
+
* @method POST
|
|
59
|
+
* @path /cfg/centrifugo/admin/api/testing/publish-test/
|
|
60
|
+
*/
|
|
61
|
+
export async function createCentrifugoAdminApiTestingPublishTestCreate( data: PublishTestRequestRequest, client?: API
|
|
62
|
+
): Promise<PublishTestResponse> {
|
|
63
|
+
const api = client || getAPIInstance()
|
|
64
|
+
const response = await api.cfg_centrifugo_testing.centrifugoAdminApiTestingPublishTestCreate(data)
|
|
65
|
+
return PublishTestResponseSchema.parse(response)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Publish with database logging
|
|
71
|
+
*
|
|
72
|
+
* @method POST
|
|
73
|
+
* @path /cfg/centrifugo/admin/api/testing/publish-with-logging/
|
|
74
|
+
*/
|
|
75
|
+
export async function createCentrifugoAdminApiTestingPublishWithLoggingCreate( data: PublishTestRequestRequest, client?: API
|
|
76
|
+
): Promise<PublishTestResponse> {
|
|
77
|
+
const api = client || getAPIInstance()
|
|
78
|
+
const response = await api.cfg_centrifugo_testing.centrifugoAdminApiTestingPublishWithLoggingCreate(data)
|
|
79
|
+
return PublishTestResponseSchema.parse(response)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Send manual ACK
|
|
85
|
+
*
|
|
86
|
+
* @method POST
|
|
87
|
+
* @path /cfg/centrifugo/admin/api/testing/send-ack/
|
|
88
|
+
*/
|
|
89
|
+
export async function createCentrifugoAdminApiTestingSendAckCreate( data: ManualAckRequestRequest, client?: API
|
|
90
|
+
): Promise<ManualAckResponse> {
|
|
91
|
+
const api = client || getAPIInstance()
|
|
92
|
+
const response = await api.cfg_centrifugo_testing.centrifugoAdminApiTestingSendAckCreate(data)
|
|
93
|
+
return ManualAckResponseSchema.parse(response)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Generate connection token
|
|
99
|
+
*
|
|
100
|
+
* @method POST
|
|
101
|
+
* @path /cfg/centrifugo/testing/connection-token/
|
|
102
|
+
*/
|
|
103
|
+
export async function createCentrifugoTestingConnectionTokenCreate( data: ConnectionTokenRequestRequest, client?: API
|
|
104
|
+
): Promise<ConnectionTokenResponse> {
|
|
105
|
+
const api = client || getAPIInstance()
|
|
106
|
+
const response = await api.cfg_centrifugo_testing.connectionTokenCreate(data)
|
|
107
|
+
return ConnectionTokenResponseSchema.parse(response)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Publish test message
|
|
113
|
+
*
|
|
114
|
+
* @method POST
|
|
115
|
+
* @path /cfg/centrifugo/testing/publish-test/
|
|
116
|
+
*/
|
|
117
|
+
export async function createCentrifugoTestingPublishTestCreate( data: PublishTestRequestRequest, client?: API
|
|
118
|
+
): Promise<PublishTestResponse> {
|
|
119
|
+
const api = client || getAPIInstance()
|
|
120
|
+
const response = await api.cfg_centrifugo_testing.publishTestCreate(data)
|
|
121
|
+
return PublishTestResponseSchema.parse(response)
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Publish with database logging
|
|
127
|
+
*
|
|
128
|
+
* @method POST
|
|
129
|
+
* @path /cfg/centrifugo/testing/publish-with-logging/
|
|
130
|
+
*/
|
|
131
|
+
export async function createCentrifugoTestingPublishWithLoggingCreate( data: PublishTestRequestRequest, client?: API
|
|
132
|
+
): Promise<PublishTestResponse> {
|
|
133
|
+
const api = client || getAPIInstance()
|
|
134
|
+
const response = await api.cfg_centrifugo_testing.publishWithLoggingCreate(data)
|
|
135
|
+
return PublishTestResponseSchema.parse(response)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Send manual ACK
|
|
141
|
+
*
|
|
142
|
+
* @method POST
|
|
143
|
+
* @path /cfg/centrifugo/testing/send-ack/
|
|
144
|
+
*/
|
|
145
|
+
export async function createCentrifugoTestingSendAckCreate( data: ManualAckRequestRequest, client?: API
|
|
146
|
+
): Promise<ManualAckResponse> {
|
|
147
|
+
const api = client || getAPIInstance()
|
|
148
|
+
const response = await api.cfg_centrifugo_testing.sendAckCreate(data)
|
|
149
|
+
return ManualAckResponseSchema.parse(response)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed fetchers for Dashboard
|
|
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 { DashboardOverviewSchema, type DashboardOverview } from '../schemas/DashboardOverview.schema'
|
|
33
|
+
import { SystemHealthSchema, type SystemHealth } from '../schemas/SystemHealth.schema'
|
|
34
|
+
import { SystemMetricsSchema, type SystemMetrics } from '../schemas/SystemMetrics.schema'
|
|
35
|
+
import { UserStatisticsSchema, type UserStatistics } from '../schemas/UserStatistics.schema'
|
|
36
|
+
import { getAPIInstance } from '../../api-instance'
|
|
37
|
+
import type { API } from '../../index'
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Get quick actions
|
|
41
|
+
*
|
|
42
|
+
* @method GET
|
|
43
|
+
* @path /cfg/dashboard/api/activity/actions/
|
|
44
|
+
*/
|
|
45
|
+
export async function getDashboardApiActivityActionsList( client?: API
|
|
46
|
+
): Promise<any> {
|
|
47
|
+
const api = client || getAPIInstance()
|
|
48
|
+
const response = await api.cfg_dashboard.apiActivityActionsList()
|
|
49
|
+
return response
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Get recent activity
|
|
55
|
+
*
|
|
56
|
+
* @method GET
|
|
57
|
+
* @path /cfg/dashboard/api/activity/recent/
|
|
58
|
+
*/
|
|
59
|
+
export async function getDashboardApiActivityRecentList( params?: { limit?: number }, client?: API
|
|
60
|
+
): Promise<any> {
|
|
61
|
+
const api = client || getAPIInstance()
|
|
62
|
+
const response = await api.cfg_dashboard.apiActivityRecentList(params?.limit)
|
|
63
|
+
return response
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Get dashboard overview
|
|
69
|
+
*
|
|
70
|
+
* @method GET
|
|
71
|
+
* @path /cfg/dashboard/api/overview/overview/
|
|
72
|
+
*/
|
|
73
|
+
export async function getDashboardApiOverviewOverviewRetrieve( client?: API
|
|
74
|
+
): Promise<DashboardOverview> {
|
|
75
|
+
const api = client || getAPIInstance()
|
|
76
|
+
const response = await api.cfg_dashboard.apiOverviewOverviewRetrieve()
|
|
77
|
+
return DashboardOverviewSchema.parse(response)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Get application statistics
|
|
83
|
+
*
|
|
84
|
+
* @method GET
|
|
85
|
+
* @path /cfg/dashboard/api/statistics/apps/
|
|
86
|
+
*/
|
|
87
|
+
export async function getDashboardApiStatisticsAppsList( client?: API
|
|
88
|
+
): Promise<any> {
|
|
89
|
+
const api = client || getAPIInstance()
|
|
90
|
+
const response = await api.cfg_dashboard.apiStatisticsAppsList()
|
|
91
|
+
return response
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Get statistics cards
|
|
97
|
+
*
|
|
98
|
+
* @method GET
|
|
99
|
+
* @path /cfg/dashboard/api/statistics/cards/
|
|
100
|
+
*/
|
|
101
|
+
export async function getDashboardApiStatisticsCardsList( client?: API
|
|
102
|
+
): Promise<any> {
|
|
103
|
+
const api = client || getAPIInstance()
|
|
104
|
+
const response = await api.cfg_dashboard.apiStatisticsCardsList()
|
|
105
|
+
return response
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Get user statistics
|
|
111
|
+
*
|
|
112
|
+
* @method GET
|
|
113
|
+
* @path /cfg/dashboard/api/statistics/users/
|
|
114
|
+
*/
|
|
115
|
+
export async function getDashboardApiStatisticsUsersRetrieve( client?: API
|
|
116
|
+
): Promise<UserStatistics> {
|
|
117
|
+
const api = client || getAPIInstance()
|
|
118
|
+
const response = await api.cfg_dashboard.apiStatisticsUsersRetrieve()
|
|
119
|
+
return UserStatisticsSchema.parse(response)
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Get system health status
|
|
125
|
+
*
|
|
126
|
+
* @method GET
|
|
127
|
+
* @path /cfg/dashboard/api/system/health/
|
|
128
|
+
*/
|
|
129
|
+
export async function getDashboardApiSystemHealthRetrieve( client?: API
|
|
130
|
+
): Promise<SystemHealth> {
|
|
131
|
+
const api = client || getAPIInstance()
|
|
132
|
+
const response = await api.cfg_dashboard.apiSystemHealthRetrieve()
|
|
133
|
+
return SystemHealthSchema.parse(response)
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Get system metrics
|
|
139
|
+
*
|
|
140
|
+
* @method GET
|
|
141
|
+
* @path /cfg/dashboard/api/system/metrics/
|
|
142
|
+
*/
|
|
143
|
+
export async function getDashboardApiSystemMetricsRetrieve( client?: API
|
|
144
|
+
): Promise<SystemMetrics> {
|
|
145
|
+
const api = client || getAPIInstance()
|
|
146
|
+
const response = await api.cfg_dashboard.apiSystemMetricsRetrieve()
|
|
147
|
+
return SystemMetricsSchema.parse(response)
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
32
|
import { EndpointsStatusSchema, type EndpointsStatus } from '../schemas/EndpointsStatus.schema'
|
|
33
|
+
import { URLsListSchema, type URLsList } from '../schemas/URLsList.schema'
|
|
33
34
|
import { getAPIInstance } from '../../api-instance'
|
|
34
35
|
import type { API } from '../../index'
|
|
35
36
|
|
|
@@ -39,7 +40,7 @@ import type { API } from '../../index'
|
|
|
39
40
|
* @method GET
|
|
40
41
|
* @path /cfg/endpoints/drf/
|
|
41
42
|
*/
|
|
42
|
-
export async function getEndpointsDrfRetrieve( client
|
|
43
|
+
export async function getEndpointsDrfRetrieve( client?: API
|
|
43
44
|
): Promise<EndpointsStatus> {
|
|
44
45
|
const api = client || getAPIInstance()
|
|
45
46
|
const response = await api.cfg_endpoints.drfRetrieve()
|
|
@@ -47,3 +48,31 @@ export async function getEndpointsDrfRetrieve( client?
|
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
|
|
51
|
+
/**
|
|
52
|
+
* API operation
|
|
53
|
+
*
|
|
54
|
+
* @method GET
|
|
55
|
+
* @path /cfg/endpoints/urls/
|
|
56
|
+
*/
|
|
57
|
+
export async function getEndpointsUrlsRetrieve( client?: API
|
|
58
|
+
): Promise<URLsList> {
|
|
59
|
+
const api = client || getAPIInstance()
|
|
60
|
+
const response = await api.cfg_endpoints.urlsRetrieve()
|
|
61
|
+
return URLsListSchema.parse(response)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* API operation
|
|
67
|
+
*
|
|
68
|
+
* @method GET
|
|
69
|
+
* @path /cfg/endpoints/urls/compact/
|
|
70
|
+
*/
|
|
71
|
+
export async function getEndpointsUrlsCompactRetrieve( client?: API
|
|
72
|
+
): Promise<any> {
|
|
73
|
+
const api = client || getAPIInstance()
|
|
74
|
+
const response = await api.cfg_endpoints.urlsCompactRetrieve()
|
|
75
|
+
return response
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
|
|
@@ -40,7 +40,7 @@ import type { API } from '../../index'
|
|
|
40
40
|
* @method GET
|
|
41
41
|
* @path /cfg/health/drf/
|
|
42
42
|
*/
|
|
43
|
-
export async function getHealthDrfRetrieve( client
|
|
43
|
+
export async function getHealthDrfRetrieve( client?: API
|
|
44
44
|
): Promise<HealthCheck> {
|
|
45
45
|
const api = client || getAPIInstance()
|
|
46
46
|
const response = await api.cfg_health.drfRetrieve()
|
|
@@ -54,7 +54,7 @@ export async function getHealthDrfRetrieve( client?
|
|
|
54
54
|
* @method GET
|
|
55
55
|
* @path /cfg/health/drf/quick/
|
|
56
56
|
*/
|
|
57
|
-
export async function getHealthDrfQuickRetrieve( client
|
|
57
|
+
export async function getHealthDrfQuickRetrieve( client?: API
|
|
58
58
|
): Promise<QuickHealth> {
|
|
59
59
|
const api = client || getAPIInstance()
|
|
60
60
|
const response = await api.cfg_health.drfQuickRetrieve()
|