@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.
- package/dist/index.cjs +4630 -1605
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5103 -1773
- package/dist/index.d.ts +5103 -1773
- package/dist/index.mjs +4481 -1486
- 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 -3
- package/src/cfg/generated/_utils/fetchers/cfg__accounts__auth.ts +1 -2
- package/src/cfg/generated/_utils/fetchers/cfg__accounts__user_profile.ts +6 -7
- package/src/cfg/generated/_utils/fetchers/cfg__centrifugo.ts +61 -0
- package/src/cfg/generated/_utils/fetchers/cfg__centrifugo__centrifugo_admin_api.ts +12 -13
- package/src/cfg/generated/_utils/fetchers/cfg__centrifugo__centrifugo_monitoring.ts +25 -26
- package/src/cfg/generated/_utils/fetchers/cfg__centrifugo__centrifugo_testing.ts +8 -9
- package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_activity.ts +61 -0
- package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_api_zones.ts +62 -0
- package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_charts.ts +90 -0
- package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_commands.ts +62 -0
- package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_overview.ts +48 -0
- package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_statistics.ts +76 -0
- package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_system.ts +63 -0
- package/src/cfg/generated/_utils/fetchers/cfg__endpoints.ts +30 -2
- package/src/cfg/generated/_utils/fetchers/cfg__health.ts +2 -3
- package/src/cfg/generated/_utils/fetchers/cfg__knowbase.ts +57 -58
- package/src/cfg/generated/_utils/fetchers/cfg__leads.ts +6 -7
- package/src/cfg/generated/_utils/fetchers/cfg__leads__lead_submission.ts +1 -2
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter.ts +3 -4
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__bulk_email.ts +1 -2
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__campaigns.ts +6 -7
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__logs.ts +1 -2
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__newsletters.ts +2 -3
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__subscriptions.ts +3 -4
- package/src/cfg/generated/_utils/fetchers/cfg__newsletter__testing.ts +1 -2
- package/src/cfg/generated/_utils/fetchers/cfg__payments.ts +8 -9
- package/src/cfg/generated/_utils/fetchers/cfg__support.ts +12 -13
- package/src/cfg/generated/_utils/fetchers/cfg__tasks.ts +10 -11
- package/src/cfg/generated/_utils/fetchers/index.ts +8 -0
- package/src/cfg/generated/_utils/hooks/cfg__centrifugo.ts +49 -0
- package/src/cfg/generated/_utils/hooks/cfg__centrifugo__centrifugo_monitoring.ts +20 -20
- package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_activity.ts +49 -0
- package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_api_zones.ts +50 -0
- package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_charts.ts +78 -0
- package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_commands.ts +50 -0
- package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_overview.ts +36 -0
- package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_statistics.ts +64 -0
- package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_system.ts +51 -0
- package/src/cfg/generated/_utils/hooks/cfg__endpoints.ts +29 -0
- package/src/cfg/generated/_utils/hooks/index.ts +8 -0
- package/src/cfg/generated/_utils/schemas/APIZone.schema.ts +27 -0
- package/src/cfg/generated/_utils/schemas/APIZonesSummary.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/ActivityEntry.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/ActivityTrackerDay.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/AppStatistics.schema.ts +20 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoChannelsRequestRequest.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/CentrifugoClientInfo.schema.ts +2 -2
- package/src/cfg/generated/_utils/schemas/CentrifugoHistoryRequestRequest.schema.ts +2 -2
- package/src/cfg/generated/_utils/schemas/CentrifugoPublication.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/ChannelStatsSerializer.schema.ts +1 -0
- package/src/cfg/generated/_utils/schemas/ChartData.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/ChartDataset.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/Command.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/CommandsSummary.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/DashboardOverview.schema.ts +27 -0
- package/src/cfg/generated/_utils/schemas/ManualAckResponse.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/PublishTestResponse.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/QuickAction.schema.ts +29 -0
- package/src/cfg/generated/_utils/schemas/RecentPublishes.schema.ts +2 -0
- package/src/cfg/generated/_utils/schemas/RecentUser.schema.ts +26 -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 +19 -0
- package/src/cfg/generated/cfg__centrifugo/client.ts +30 -0
- package/src/cfg/generated/cfg__centrifugo/index.ts +2 -0
- package/src/cfg/generated/cfg__centrifugo/models.ts +0 -0
- package/src/cfg/generated/cfg__centrifugo__centrifugo_admin_api/models.ts +6 -6
- package/src/cfg/generated/cfg__centrifugo__centrifugo_monitoring/client.ts +32 -32
- package/src/cfg/generated/cfg__centrifugo__centrifugo_monitoring/models.ts +18 -12
- package/src/cfg/generated/cfg__centrifugo__centrifugo_testing/models.ts +2 -2
- package/src/cfg/generated/cfg__dashboard__dashboard_activity/client.ts +45 -0
- package/src/cfg/generated/cfg__dashboard__dashboard_activity/index.ts +2 -0
- package/src/cfg/generated/cfg__dashboard__dashboard_activity/models.ts +0 -0
- package/src/cfg/generated/cfg__dashboard__dashboard_api_zones/client.ts +34 -0
- package/src/cfg/generated/cfg__dashboard__dashboard_api_zones/index.ts +2 -0
- package/src/cfg/generated/cfg__dashboard__dashboard_api_zones/models.ts +27 -0
- package/src/cfg/generated/cfg__dashboard__dashboard_charts/client.ts +98 -0
- package/src/cfg/generated/cfg__dashboard__dashboard_charts/index.ts +2 -0
- package/src/cfg/generated/cfg__dashboard__dashboard_charts/models.ts +24 -0
- package/src/cfg/generated/cfg__dashboard__dashboard_commands/client.ts +34 -0
- package/src/cfg/generated/cfg__dashboard__dashboard_commands/index.ts +2 -0
- package/src/cfg/generated/cfg__dashboard__dashboard_commands/models.ts +27 -0
- package/src/cfg/generated/cfg__dashboard__dashboard_overview/client.ts +25 -0
- package/src/cfg/generated/cfg__dashboard__dashboard_overview/index.ts +2 -0
- package/src/cfg/generated/cfg__dashboard__dashboard_overview/models.ts +23 -0
- package/src/cfg/generated/cfg__dashboard__dashboard_statistics/client.ts +44 -0
- package/src/cfg/generated/cfg__dashboard__dashboard_statistics/index.ts +2 -0
- package/src/cfg/generated/cfg__dashboard__dashboard_statistics/models.ts +16 -0
- package/src/cfg/generated/cfg__dashboard__dashboard_system/client.ts +34 -0
- package/src/cfg/generated/cfg__dashboard__dashboard_system/index.ts +2 -0
- package/src/cfg/generated/cfg__dashboard__dashboard_system/models.ts +69 -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/client.ts +35 -9
- package/src/cfg/generated/enums.ts +56 -0
- package/src/cfg/generated/http.ts +8 -3
- package/src/cfg/generated/index.ts +47 -10
- package/src/cfg/generated/schema.ts +2120 -135
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SWR Hooks for Dashboard - API Zones
|
|
3
|
+
*
|
|
4
|
+
* React hooks powered by SWR for data fetching with automatic caching,
|
|
5
|
+
* revalidation, and optimistic updates.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* ```typescript
|
|
9
|
+
* // Query hooks (GET)
|
|
10
|
+
* const { data, error, isLoading } = useUsers({ page: 1 })
|
|
11
|
+
*
|
|
12
|
+
* // Mutation hooks (POST/PUT/PATCH/DELETE)
|
|
13
|
+
* const createUser = useCreateUser()
|
|
14
|
+
* await createUser({ name: 'John', email: 'john@example.com' })
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
import useSWR from 'swr'
|
|
18
|
+
import { useSWRConfig } from 'swr'
|
|
19
|
+
import * as Fetchers from '../fetchers/cfg__dashboard__dashboard_api_zones'
|
|
20
|
+
import type { API } from '../../index'
|
|
21
|
+
import type { APIZonesSummary } from '../schemas/APIZonesSummary.schema'
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Get all API zones
|
|
25
|
+
*
|
|
26
|
+
* @method GET
|
|
27
|
+
* @path /cfg/dashboard/api/zones/
|
|
28
|
+
*/
|
|
29
|
+
export function useDashboardApiZonesList(client?: API): ReturnType<typeof useSWR<any>> {
|
|
30
|
+
return useSWR<any>(
|
|
31
|
+
'cfg-dashboard-api-zones',
|
|
32
|
+
() => Fetchers.getDashboardApiZonesList(client)
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Get zones summary
|
|
39
|
+
*
|
|
40
|
+
* @method GET
|
|
41
|
+
* @path /cfg/dashboard/api/zones/summary/
|
|
42
|
+
*/
|
|
43
|
+
export function useDashboardApiZonesSummaryRetrieve(client?: API): ReturnType<typeof useSWR<APIZonesSummary>> {
|
|
44
|
+
return useSWR<APIZonesSummary>(
|
|
45
|
+
'cfg-dashboard-api-zones-summary',
|
|
46
|
+
() => Fetchers.getDashboardApiZonesSummaryRetrieve(client)
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SWR Hooks for Dashboard - Charts
|
|
3
|
+
*
|
|
4
|
+
* React hooks powered by SWR for data fetching with automatic caching,
|
|
5
|
+
* revalidation, and optimistic updates.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* ```typescript
|
|
9
|
+
* // Query hooks (GET)
|
|
10
|
+
* const { data, error, isLoading } = useUsers({ page: 1 })
|
|
11
|
+
*
|
|
12
|
+
* // Mutation hooks (POST/PUT/PATCH/DELETE)
|
|
13
|
+
* const createUser = useCreateUser()
|
|
14
|
+
* await createUser({ name: 'John', email: 'john@example.com' })
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
import useSWR from 'swr'
|
|
18
|
+
import { useSWRConfig } from 'swr'
|
|
19
|
+
import * as Fetchers from '../fetchers/cfg__dashboard__dashboard_charts'
|
|
20
|
+
import type { API } from '../../index'
|
|
21
|
+
import type { ChartData } from '../schemas/ChartData.schema'
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Get user activity chart
|
|
25
|
+
*
|
|
26
|
+
* @method GET
|
|
27
|
+
* @path /cfg/dashboard/api/charts/activity/
|
|
28
|
+
*/
|
|
29
|
+
export function useDashboardApiChartsActivityRetrieve(params?: { days?: number }, client?: API): ReturnType<typeof useSWR<ChartData>> {
|
|
30
|
+
return useSWR<ChartData>(
|
|
31
|
+
params ? ['cfg-dashboard-api-charts-activity', params] : 'cfg-dashboard-api-charts-activity',
|
|
32
|
+
() => Fetchers.getDashboardApiChartsActivityRetrieve(params, client)
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Get recent users
|
|
39
|
+
*
|
|
40
|
+
* @method GET
|
|
41
|
+
* @path /cfg/dashboard/api/charts/recent-users/
|
|
42
|
+
*/
|
|
43
|
+
export function useDashboardApiChartsRecentUsersList(params?: { limit?: number }, client?: API): ReturnType<typeof useSWR<any>> {
|
|
44
|
+
return useSWR<any>(
|
|
45
|
+
params ? ['cfg-dashboard-api-charts-recent-users', params] : 'cfg-dashboard-api-charts-recent-users',
|
|
46
|
+
() => Fetchers.getDashboardApiChartsRecentUsersList(params, client)
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Get user registration chart
|
|
53
|
+
*
|
|
54
|
+
* @method GET
|
|
55
|
+
* @path /cfg/dashboard/api/charts/registrations/
|
|
56
|
+
*/
|
|
57
|
+
export function useDashboardApiChartsRegistrationsRetrieve(params?: { days?: number }, client?: API): ReturnType<typeof useSWR<ChartData>> {
|
|
58
|
+
return useSWR<ChartData>(
|
|
59
|
+
params ? ['cfg-dashboard-api-charts-registration', params] : 'cfg-dashboard-api-charts-registration',
|
|
60
|
+
() => Fetchers.getDashboardApiChartsRegistrationsRetrieve(params, client)
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Get activity tracker
|
|
67
|
+
*
|
|
68
|
+
* @method GET
|
|
69
|
+
* @path /cfg/dashboard/api/charts/tracker/
|
|
70
|
+
*/
|
|
71
|
+
export function useDashboardApiChartsTrackerList(params?: { weeks?: number }, client?: API): ReturnType<typeof useSWR<any>> {
|
|
72
|
+
return useSWR<any>(
|
|
73
|
+
params ? ['cfg-dashboard-api-charts-tracker', params] : 'cfg-dashboard-api-charts-tracker',
|
|
74
|
+
() => Fetchers.getDashboardApiChartsTrackerList(params, client)
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SWR Hooks for Dashboard - Commands
|
|
3
|
+
*
|
|
4
|
+
* React hooks powered by SWR for data fetching with automatic caching,
|
|
5
|
+
* revalidation, and optimistic updates.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* ```typescript
|
|
9
|
+
* // Query hooks (GET)
|
|
10
|
+
* const { data, error, isLoading } = useUsers({ page: 1 })
|
|
11
|
+
*
|
|
12
|
+
* // Mutation hooks (POST/PUT/PATCH/DELETE)
|
|
13
|
+
* const createUser = useCreateUser()
|
|
14
|
+
* await createUser({ name: 'John', email: 'john@example.com' })
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
import useSWR from 'swr'
|
|
18
|
+
import { useSWRConfig } from 'swr'
|
|
19
|
+
import * as Fetchers from '../fetchers/cfg__dashboard__dashboard_commands'
|
|
20
|
+
import type { API } from '../../index'
|
|
21
|
+
import type { CommandsSummary } from '../schemas/CommandsSummary.schema'
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Get all commands
|
|
25
|
+
*
|
|
26
|
+
* @method GET
|
|
27
|
+
* @path /cfg/dashboard/api/commands/
|
|
28
|
+
*/
|
|
29
|
+
export function useDashboardApiCommandsList(client?: API): ReturnType<typeof useSWR<any>> {
|
|
30
|
+
return useSWR<any>(
|
|
31
|
+
'cfg-dashboard-api-commands',
|
|
32
|
+
() => Fetchers.getDashboardApiCommandsList(client)
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Get commands summary
|
|
39
|
+
*
|
|
40
|
+
* @method GET
|
|
41
|
+
* @path /cfg/dashboard/api/commands/summary/
|
|
42
|
+
*/
|
|
43
|
+
export function useDashboardApiCommandsSummaryRetrieve(client?: API): ReturnType<typeof useSWR<CommandsSummary>> {
|
|
44
|
+
return useSWR<CommandsSummary>(
|
|
45
|
+
'cfg-dashboard-api-commands-summary',
|
|
46
|
+
() => Fetchers.getDashboardApiCommandsSummaryRetrieve(client)
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SWR Hooks for Dashboard - Overview
|
|
3
|
+
*
|
|
4
|
+
* React hooks powered by SWR for data fetching with automatic caching,
|
|
5
|
+
* revalidation, and optimistic updates.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* ```typescript
|
|
9
|
+
* // Query hooks (GET)
|
|
10
|
+
* const { data, error, isLoading } = useUsers({ page: 1 })
|
|
11
|
+
*
|
|
12
|
+
* // Mutation hooks (POST/PUT/PATCH/DELETE)
|
|
13
|
+
* const createUser = useCreateUser()
|
|
14
|
+
* await createUser({ name: 'John', email: 'john@example.com' })
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
import useSWR from 'swr'
|
|
18
|
+
import { useSWRConfig } from 'swr'
|
|
19
|
+
import * as Fetchers from '../fetchers/cfg__dashboard__dashboard_overview'
|
|
20
|
+
import type { API } from '../../index'
|
|
21
|
+
import type { DashboardOverview } from '../schemas/DashboardOverview.schema'
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Get dashboard overview
|
|
25
|
+
*
|
|
26
|
+
* @method GET
|
|
27
|
+
* @path /cfg/dashboard/api/overview/overview/
|
|
28
|
+
*/
|
|
29
|
+
export function useDashboardApiOverviewOverviewRetrieve(client?: API): ReturnType<typeof useSWR<DashboardOverview>> {
|
|
30
|
+
return useSWR<DashboardOverview>(
|
|
31
|
+
'cfg-dashboard-api-overview-overview',
|
|
32
|
+
() => Fetchers.getDashboardApiOverviewOverviewRetrieve(client)
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SWR Hooks for Dashboard - Statistics
|
|
3
|
+
*
|
|
4
|
+
* React hooks powered by SWR for data fetching with automatic caching,
|
|
5
|
+
* revalidation, and optimistic updates.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* ```typescript
|
|
9
|
+
* // Query hooks (GET)
|
|
10
|
+
* const { data, error, isLoading } = useUsers({ page: 1 })
|
|
11
|
+
*
|
|
12
|
+
* // Mutation hooks (POST/PUT/PATCH/DELETE)
|
|
13
|
+
* const createUser = useCreateUser()
|
|
14
|
+
* await createUser({ name: 'John', email: 'john@example.com' })
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
import useSWR from 'swr'
|
|
18
|
+
import { useSWRConfig } from 'swr'
|
|
19
|
+
import * as Fetchers from '../fetchers/cfg__dashboard__dashboard_statistics'
|
|
20
|
+
import type { API } from '../../index'
|
|
21
|
+
import type { UserStatistics } from '../schemas/UserStatistics.schema'
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Get application statistics
|
|
25
|
+
*
|
|
26
|
+
* @method GET
|
|
27
|
+
* @path /cfg/dashboard/api/statistics/apps/
|
|
28
|
+
*/
|
|
29
|
+
export function useDashboardApiStatisticsAppsList(client?: API): ReturnType<typeof useSWR<any>> {
|
|
30
|
+
return useSWR<any>(
|
|
31
|
+
'cfg-dashboard-api-statistics-apps',
|
|
32
|
+
() => Fetchers.getDashboardApiStatisticsAppsList(client)
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Get statistics cards
|
|
39
|
+
*
|
|
40
|
+
* @method GET
|
|
41
|
+
* @path /cfg/dashboard/api/statistics/cards/
|
|
42
|
+
*/
|
|
43
|
+
export function useDashboardApiStatisticsCardsList(client?: API): ReturnType<typeof useSWR<any>> {
|
|
44
|
+
return useSWR<any>(
|
|
45
|
+
'cfg-dashboard-api-statistics-cards',
|
|
46
|
+
() => Fetchers.getDashboardApiStatisticsCardsList(client)
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Get user statistics
|
|
53
|
+
*
|
|
54
|
+
* @method GET
|
|
55
|
+
* @path /cfg/dashboard/api/statistics/users/
|
|
56
|
+
*/
|
|
57
|
+
export function useDashboardApiStatisticsUsersRetrieve(client?: API): ReturnType<typeof useSWR<UserStatistics>> {
|
|
58
|
+
return useSWR<UserStatistics>(
|
|
59
|
+
'cfg-dashboard-api-statistics-user',
|
|
60
|
+
() => Fetchers.getDashboardApiStatisticsUsersRetrieve(client)
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SWR Hooks for Dashboard - System
|
|
3
|
+
*
|
|
4
|
+
* React hooks powered by SWR for data fetching with automatic caching,
|
|
5
|
+
* revalidation, and optimistic updates.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* ```typescript
|
|
9
|
+
* // Query hooks (GET)
|
|
10
|
+
* const { data, error, isLoading } = useUsers({ page: 1 })
|
|
11
|
+
*
|
|
12
|
+
* // Mutation hooks (POST/PUT/PATCH/DELETE)
|
|
13
|
+
* const createUser = useCreateUser()
|
|
14
|
+
* await createUser({ name: 'John', email: 'john@example.com' })
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
import useSWR from 'swr'
|
|
18
|
+
import { useSWRConfig } from 'swr'
|
|
19
|
+
import * as Fetchers from '../fetchers/cfg__dashboard__dashboard_system'
|
|
20
|
+
import type { API } from '../../index'
|
|
21
|
+
import type { SystemHealth } from '../schemas/SystemHealth.schema'
|
|
22
|
+
import type { SystemMetrics } from '../schemas/SystemMetrics.schema'
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Get system health status
|
|
26
|
+
*
|
|
27
|
+
* @method GET
|
|
28
|
+
* @path /cfg/dashboard/api/system/health/
|
|
29
|
+
*/
|
|
30
|
+
export function useDashboardApiSystemHealthRetrieve(client?: API): ReturnType<typeof useSWR<SystemHealth>> {
|
|
31
|
+
return useSWR<SystemHealth>(
|
|
32
|
+
'cfg-dashboard-api-system-health',
|
|
33
|
+
() => Fetchers.getDashboardApiSystemHealthRetrieve(client)
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Get system metrics
|
|
40
|
+
*
|
|
41
|
+
* @method GET
|
|
42
|
+
* @path /cfg/dashboard/api/system/metrics/
|
|
43
|
+
*/
|
|
44
|
+
export function useDashboardApiSystemMetricsRetrieve(client?: API): ReturnType<typeof useSWR<SystemMetrics>> {
|
|
45
|
+
return useSWR<SystemMetrics>(
|
|
46
|
+
'cfg-dashboard-api-system-metric',
|
|
47
|
+
() => Fetchers.getDashboardApiSystemMetricsRetrieve(client)
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
@@ -19,6 +19,7 @@ import { useSWRConfig } from 'swr'
|
|
|
19
19
|
import * as Fetchers from '../fetchers/cfg__endpoints'
|
|
20
20
|
import type { API } from '../../index'
|
|
21
21
|
import type { EndpointsStatus } from '../schemas/EndpointsStatus.schema'
|
|
22
|
+
import type { URLsList } from '../schemas/URLsList.schema'
|
|
22
23
|
|
|
23
24
|
/**
|
|
24
25
|
* API operation
|
|
@@ -34,3 +35,31 @@ export function useEndpointsDrfRetrieve(client?: API): ReturnType<typeof useSWR<
|
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
|
|
38
|
+
/**
|
|
39
|
+
* API operation
|
|
40
|
+
*
|
|
41
|
+
* @method GET
|
|
42
|
+
* @path /cfg/endpoints/urls/
|
|
43
|
+
*/
|
|
44
|
+
export function useEndpointsUrlsRetrieve(client?: API): ReturnType<typeof useSWR<URLsList>> {
|
|
45
|
+
return useSWR<URLsList>(
|
|
46
|
+
'cfg-endpoints-url',
|
|
47
|
+
() => Fetchers.getEndpointsUrlsRetrieve(client)
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* API operation
|
|
54
|
+
*
|
|
55
|
+
* @method GET
|
|
56
|
+
* @path /cfg/endpoints/urls/compact/
|
|
57
|
+
*/
|
|
58
|
+
export function useEndpointsUrlsCompactRetrieve(client?: API): ReturnType<typeof useSWR<any>> {
|
|
59
|
+
return useSWR<any>(
|
|
60
|
+
'cfg-endpoints-urls-compact',
|
|
61
|
+
() => Fetchers.getEndpointsUrlsCompactRetrieve(client)
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
@@ -29,6 +29,13 @@ export * from './cfg__newsletter__campaigns'
|
|
|
29
29
|
export * from './cfg__centrifugo__centrifugo_admin_api'
|
|
30
30
|
export * from './cfg__centrifugo__centrifugo_monitoring'
|
|
31
31
|
export * from './cfg__centrifugo__centrifugo_testing'
|
|
32
|
+
export * from './cfg__dashboard__dashboard_api_zones'
|
|
33
|
+
export * from './cfg__dashboard__dashboard_activity'
|
|
34
|
+
export * from './cfg__dashboard__dashboard_charts'
|
|
35
|
+
export * from './cfg__dashboard__dashboard_commands'
|
|
36
|
+
export * from './cfg__dashboard__dashboard_overview'
|
|
37
|
+
export * from './cfg__dashboard__dashboard_statistics'
|
|
38
|
+
export * from './cfg__dashboard__dashboard_system'
|
|
32
39
|
export * from './cfg__leads__lead_submission'
|
|
33
40
|
export * from './cfg__newsletter__logs'
|
|
34
41
|
export * from './cfg__newsletter__newsletters'
|
|
@@ -36,6 +43,7 @@ export * from './cfg__newsletter__subscriptions'
|
|
|
36
43
|
export * from './cfg__newsletter__testing'
|
|
37
44
|
export * from './cfg__accounts__user_profile'
|
|
38
45
|
export * from './cfg__accounts'
|
|
46
|
+
export * from './cfg__centrifugo'
|
|
39
47
|
export * from './cfg__endpoints'
|
|
40
48
|
export * from './cfg__health'
|
|
41
49
|
export * from './cfg__knowbase'
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for APIZone
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * OpenAPI zone/group serializer.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* OpenAPI zone/group serializer.
|
|
11
|
+
*/
|
|
12
|
+
export const APIZoneSchema = z.object({
|
|
13
|
+
name: z.string(),
|
|
14
|
+
title: z.string(),
|
|
15
|
+
description: z.string(),
|
|
16
|
+
app_count: z.int(),
|
|
17
|
+
endpoint_count: z.int(),
|
|
18
|
+
status: z.string(),
|
|
19
|
+
schema_url: z.string(),
|
|
20
|
+
api_url: z.string(),
|
|
21
|
+
apps: z.array(z.string()),
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Infer TypeScript type from Zod schema
|
|
26
|
+
*/
|
|
27
|
+
export type APIZone = z.infer<typeof APIZoneSchema>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for APIZonesSummary
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * API zones summary serializer.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
import { APIZoneSchema } from './APIZone.schema'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* API zones summary serializer.
|
|
12
|
+
*/
|
|
13
|
+
export const APIZonesSummarySchema = z.object({
|
|
14
|
+
zones: z.array(APIZoneSchema),
|
|
15
|
+
summary: z.record(z.string(), z.any()),
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Infer TypeScript type from Zod schema
|
|
20
|
+
*/
|
|
21
|
+
export type APIZonesSummary = z.infer<typeof APIZonesSummarySchema>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for ActivityEntry
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Serializer for recent activity entries.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Serializer for recent activity entries.
|
|
11
|
+
*/
|
|
12
|
+
export const ActivityEntrySchema = z.object({
|
|
13
|
+
id: z.int(),
|
|
14
|
+
user: z.string(),
|
|
15
|
+
action: z.string(),
|
|
16
|
+
resource: z.string(),
|
|
17
|
+
timestamp: z.string(),
|
|
18
|
+
icon: z.string(),
|
|
19
|
+
color: z.string(),
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Infer TypeScript type from Zod schema
|
|
24
|
+
*/
|
|
25
|
+
export type ActivityEntry = z.infer<typeof ActivityEntrySchema>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for ActivityTrackerDay
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Activity tracker single day serializer.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Activity tracker single day serializer.
|
|
11
|
+
*/
|
|
12
|
+
export const ActivityTrackerDaySchema = z.object({
|
|
13
|
+
date: z.iso.date(),
|
|
14
|
+
count: z.int(),
|
|
15
|
+
level: z.int(),
|
|
16
|
+
color: z.string(),
|
|
17
|
+
tooltip: z.string(),
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Infer TypeScript type from Zod schema
|
|
22
|
+
*/
|
|
23
|
+
export type ActivityTrackerDay = z.infer<typeof ActivityTrackerDaySchema>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for AppStatistics
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Serializer for application-specific statistics.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Serializer for application-specific statistics.
|
|
11
|
+
*/
|
|
12
|
+
export const AppStatisticsSchema = z.object({
|
|
13
|
+
app_name: z.string(),
|
|
14
|
+
statistics: z.record(z.string(), z.any()),
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Infer TypeScript type from Zod schema
|
|
19
|
+
*/
|
|
20
|
+
export type AppStatistics = z.infer<typeof AppStatisticsSchema>
|
|
@@ -12,8 +12,8 @@ import { z } from 'zod'
|
|
|
12
12
|
export const CentrifugoClientInfoSchema = z.object({
|
|
13
13
|
user: z.string(),
|
|
14
14
|
client: z.string(),
|
|
15
|
-
conn_info: z.string().optional(),
|
|
16
|
-
chan_info: z.string().optional(),
|
|
15
|
+
conn_info: z.string().nullable().optional(),
|
|
16
|
+
chan_info: z.string().nullable().optional(),
|
|
17
17
|
})
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -12,9 +12,9 @@ import { CentrifugoStreamPositionSchema } from './CentrifugoStreamPosition.schem
|
|
|
12
12
|
*/
|
|
13
13
|
export const CentrifugoHistoryRequestRequestSchema = z.object({
|
|
14
14
|
channel: z.string(),
|
|
15
|
-
limit: z.string().optional(),
|
|
15
|
+
limit: z.string().nullable().optional(),
|
|
16
16
|
since: CentrifugoStreamPositionSchema.optional(),
|
|
17
|
-
reverse: z.string().optional(),
|
|
17
|
+
reverse: z.string().nullable().optional(),
|
|
18
18
|
})
|
|
19
19
|
|
|
20
20
|
/**
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for ChartData
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Chart.js data structure serializer.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
import { ChartDatasetSchema } from './ChartDataset.schema'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Chart.js data structure serializer.
|
|
12
|
+
*/
|
|
13
|
+
export const ChartDataSchema = z.object({
|
|
14
|
+
labels: z.array(z.string()),
|
|
15
|
+
datasets: z.array(ChartDatasetSchema),
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Infer TypeScript type from Zod schema
|
|
20
|
+
*/
|
|
21
|
+
export type ChartData = z.infer<typeof ChartDataSchema>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for ChartDataset
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Chart.js dataset serializer.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Chart.js dataset serializer.
|
|
11
|
+
*/
|
|
12
|
+
export const ChartDatasetSchema = z.object({
|
|
13
|
+
label: z.string(),
|
|
14
|
+
data: z.array(z.int()),
|
|
15
|
+
backgroundColor: z.string(),
|
|
16
|
+
borderColor: z.string(),
|
|
17
|
+
tension: z.number(),
|
|
18
|
+
fill: z.boolean().optional(),
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Infer TypeScript type from Zod schema
|
|
23
|
+
*/
|
|
24
|
+
export type ChartDataset = z.infer<typeof ChartDatasetSchema>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for Command
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Django management command serializer.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Django management command serializer.
|
|
11
|
+
*/
|
|
12
|
+
export const CommandSchema = z.object({
|
|
13
|
+
name: z.string(),
|
|
14
|
+
app: z.string(),
|
|
15
|
+
help: z.string(),
|
|
16
|
+
is_core: z.boolean(),
|
|
17
|
+
is_custom: z.boolean(),
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Infer TypeScript type from Zod schema
|
|
22
|
+
*/
|
|
23
|
+
export type Command = z.infer<typeof CommandSchema>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for CommandsSummary
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Commands summary serializer.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
import { CommandSchema } from './Command.schema'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Commands summary serializer.
|
|
12
|
+
*/
|
|
13
|
+
export const CommandsSummarySchema = z.object({
|
|
14
|
+
total_commands: z.int(),
|
|
15
|
+
core_commands: z.int(),
|
|
16
|
+
custom_commands: z.int(),
|
|
17
|
+
categories: z.array(z.string()),
|
|
18
|
+
commands: z.array(CommandSchema),
|
|
19
|
+
categorized: z.record(z.string(), z.any()),
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Infer TypeScript type from Zod schema
|
|
24
|
+
*/
|
|
25
|
+
export type CommandsSummary = z.infer<typeof CommandsSummarySchema>
|