@djangocfg/api 1.2.6 → 1.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/dist/index.cjs +2577 -1573
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +2141 -820
  4. package/dist/index.d.ts +2141 -820
  5. package/dist/index.mjs +2487 -1497
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +2 -2
  8. package/src/cfg/generated/_utils/fetchers/cfg__accounts.ts +2 -3
  9. package/src/cfg/generated/_utils/fetchers/cfg__accounts__auth.ts +1 -2
  10. package/src/cfg/generated/_utils/fetchers/cfg__accounts__user_profile.ts +6 -7
  11. package/src/cfg/generated/_utils/fetchers/cfg__centrifugo.ts +2 -3
  12. package/src/cfg/generated/_utils/fetchers/cfg__centrifugo__centrifugo_admin_api.ts +12 -13
  13. package/src/cfg/generated/_utils/fetchers/cfg__centrifugo__centrifugo_monitoring.ts +8 -9
  14. package/src/cfg/generated/_utils/fetchers/cfg__centrifugo__centrifugo_testing.ts +8 -9
  15. package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_activity.ts +61 -0
  16. package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_api_zones.ts +62 -0
  17. package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_charts.ts +90 -0
  18. package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_commands.ts +62 -0
  19. package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_overview.ts +48 -0
  20. package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_statistics.ts +76 -0
  21. package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_system.ts +63 -0
  22. package/src/cfg/generated/_utils/fetchers/cfg__endpoints.ts +3 -4
  23. package/src/cfg/generated/_utils/fetchers/cfg__health.ts +2 -3
  24. package/src/cfg/generated/_utils/fetchers/cfg__knowbase.ts +57 -58
  25. package/src/cfg/generated/_utils/fetchers/cfg__leads.ts +6 -7
  26. package/src/cfg/generated/_utils/fetchers/cfg__leads__lead_submission.ts +1 -2
  27. package/src/cfg/generated/_utils/fetchers/cfg__newsletter.ts +3 -4
  28. package/src/cfg/generated/_utils/fetchers/cfg__newsletter__bulk_email.ts +1 -2
  29. package/src/cfg/generated/_utils/fetchers/cfg__newsletter__campaigns.ts +6 -7
  30. package/src/cfg/generated/_utils/fetchers/cfg__newsletter__logs.ts +1 -2
  31. package/src/cfg/generated/_utils/fetchers/cfg__newsletter__newsletters.ts +2 -3
  32. package/src/cfg/generated/_utils/fetchers/cfg__newsletter__subscriptions.ts +3 -4
  33. package/src/cfg/generated/_utils/fetchers/cfg__newsletter__testing.ts +1 -2
  34. package/src/cfg/generated/_utils/fetchers/cfg__payments.ts +8 -9
  35. package/src/cfg/generated/_utils/fetchers/cfg__support.ts +12 -13
  36. package/src/cfg/generated/_utils/fetchers/cfg__tasks.ts +10 -11
  37. package/src/cfg/generated/_utils/fetchers/index.ts +7 -1
  38. package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_activity.ts +49 -0
  39. package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_api_zones.ts +50 -0
  40. package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_charts.ts +78 -0
  41. package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_commands.ts +50 -0
  42. package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_overview.ts +36 -0
  43. package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_statistics.ts +64 -0
  44. package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_system.ts +51 -0
  45. package/src/cfg/generated/_utils/hooks/index.ts +7 -1
  46. package/src/cfg/generated/_utils/schemas/APIZone.schema.ts +27 -0
  47. package/src/cfg/generated/_utils/schemas/APIZonesSummary.schema.ts +21 -0
  48. package/src/cfg/generated/_utils/schemas/ActivityTrackerDay.schema.ts +23 -0
  49. package/src/cfg/generated/_utils/schemas/ChartData.schema.ts +21 -0
  50. package/src/cfg/generated/_utils/schemas/ChartDataset.schema.ts +24 -0
  51. package/src/cfg/generated/_utils/schemas/Command.schema.ts +23 -0
  52. package/src/cfg/generated/_utils/schemas/CommandsSummary.schema.ts +25 -0
  53. package/src/cfg/generated/_utils/schemas/RecentUser.schema.ts +26 -0
  54. package/src/cfg/generated/_utils/schemas/index.ts +8 -0
  55. package/src/cfg/generated/cfg__dashboard__dashboard_activity/client.ts +45 -0
  56. package/src/cfg/generated/cfg__dashboard__dashboard_activity/models.ts +0 -0
  57. package/src/cfg/generated/cfg__dashboard__dashboard_api_zones/client.ts +34 -0
  58. package/src/cfg/generated/cfg__dashboard__dashboard_api_zones/index.ts +2 -0
  59. package/src/cfg/generated/cfg__dashboard__dashboard_api_zones/models.ts +27 -0
  60. package/src/cfg/generated/cfg__dashboard__dashboard_charts/client.ts +98 -0
  61. package/src/cfg/generated/cfg__dashboard__dashboard_charts/index.ts +2 -0
  62. package/src/cfg/generated/cfg__dashboard__dashboard_charts/models.ts +24 -0
  63. package/src/cfg/generated/cfg__dashboard__dashboard_commands/client.ts +34 -0
  64. package/src/cfg/generated/cfg__dashboard__dashboard_commands/index.ts +2 -0
  65. package/src/cfg/generated/cfg__dashboard__dashboard_commands/models.ts +27 -0
  66. package/src/cfg/generated/cfg__dashboard__dashboard_overview/client.ts +25 -0
  67. package/src/cfg/generated/cfg__dashboard__dashboard_overview/index.ts +2 -0
  68. package/src/cfg/generated/cfg__dashboard__dashboard_overview/models.ts +23 -0
  69. package/src/cfg/generated/cfg__dashboard__dashboard_statistics/client.ts +44 -0
  70. package/src/cfg/generated/cfg__dashboard__dashboard_statistics/index.ts +2 -0
  71. package/src/cfg/generated/cfg__dashboard__dashboard_statistics/models.ts +16 -0
  72. package/src/cfg/generated/cfg__dashboard__dashboard_system/client.ts +34 -0
  73. package/src/cfg/generated/cfg__dashboard__dashboard_system/index.ts +2 -0
  74. package/src/cfg/generated/{cfg__dashboard → cfg__dashboard__dashboard_system}/models.ts +0 -39
  75. package/src/cfg/generated/client.ts +32 -12
  76. package/src/cfg/generated/http.ts +8 -3
  77. package/src/cfg/generated/index.ts +35 -5
  78. package/src/cfg/generated/schema.ts +574 -8
  79. package/src/cfg/generated/_utils/fetchers/cfg__dashboard.ts +0 -150
  80. package/src/cfg/generated/_utils/hooks/cfg__dashboard.ts +0 -137
  81. package/src/cfg/generated/cfg__dashboard/client.ts +0 -106
  82. /package/src/cfg/generated/{cfg__dashboard → cfg__dashboard__dashboard_activity}/index.ts +0 -0
@@ -1,150 +0,0 @@
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
-
@@ -1,137 +0,0 @@
1
- /**
2
- * SWR Hooks for Dashboard
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'
20
- import type { API } from '../../index'
21
- import type { DashboardOverview } from '../schemas/DashboardOverview.schema'
22
- import type { SystemHealth } from '../schemas/SystemHealth.schema'
23
- import type { SystemMetrics } from '../schemas/SystemMetrics.schema'
24
- import type { UserStatistics } from '../schemas/UserStatistics.schema'
25
-
26
- /**
27
- * Get quick actions
28
- *
29
- * @method GET
30
- * @path /cfg/dashboard/api/activity/actions/
31
- */
32
- export function useDashboardApiActivityActionsList(client?: API): ReturnType<typeof useSWR<any>> {
33
- return useSWR<any>(
34
- 'cfg-dashboard-api-activity-actions',
35
- () => Fetchers.getDashboardApiActivityActionsList(client)
36
- )
37
- }
38
-
39
-
40
- /**
41
- * Get recent activity
42
- *
43
- * @method GET
44
- * @path /cfg/dashboard/api/activity/recent/
45
- */
46
- export function useDashboardApiActivityRecentList(params?: { limit?: number }, client?: API): ReturnType<typeof useSWR<any>> {
47
- return useSWR<any>(
48
- params ? ['cfg-dashboard-api-activity-recent', params] : 'cfg-dashboard-api-activity-recent',
49
- () => Fetchers.getDashboardApiActivityRecentList(params, client)
50
- )
51
- }
52
-
53
-
54
- /**
55
- * Get dashboard overview
56
- *
57
- * @method GET
58
- * @path /cfg/dashboard/api/overview/overview/
59
- */
60
- export function useDashboardApiOverviewOverviewRetrieve(client?: API): ReturnType<typeof useSWR<DashboardOverview>> {
61
- return useSWR<DashboardOverview>(
62
- 'cfg-dashboard-api-overview-overview',
63
- () => Fetchers.getDashboardApiOverviewOverviewRetrieve(client)
64
- )
65
- }
66
-
67
-
68
- /**
69
- * Get application statistics
70
- *
71
- * @method GET
72
- * @path /cfg/dashboard/api/statistics/apps/
73
- */
74
- export function useDashboardApiStatisticsAppsList(client?: API): ReturnType<typeof useSWR<any>> {
75
- return useSWR<any>(
76
- 'cfg-dashboard-api-statistics-apps',
77
- () => Fetchers.getDashboardApiStatisticsAppsList(client)
78
- )
79
- }
80
-
81
-
82
- /**
83
- * Get statistics cards
84
- *
85
- * @method GET
86
- * @path /cfg/dashboard/api/statistics/cards/
87
- */
88
- export function useDashboardApiStatisticsCardsList(client?: API): ReturnType<typeof useSWR<any>> {
89
- return useSWR<any>(
90
- 'cfg-dashboard-api-statistics-cards',
91
- () => Fetchers.getDashboardApiStatisticsCardsList(client)
92
- )
93
- }
94
-
95
-
96
- /**
97
- * Get user statistics
98
- *
99
- * @method GET
100
- * @path /cfg/dashboard/api/statistics/users/
101
- */
102
- export function useDashboardApiStatisticsUsersRetrieve(client?: API): ReturnType<typeof useSWR<UserStatistics>> {
103
- return useSWR<UserStatistics>(
104
- 'cfg-dashboard-api-statistics-user',
105
- () => Fetchers.getDashboardApiStatisticsUsersRetrieve(client)
106
- )
107
- }
108
-
109
-
110
- /**
111
- * Get system health status
112
- *
113
- * @method GET
114
- * @path /cfg/dashboard/api/system/health/
115
- */
116
- export function useDashboardApiSystemHealthRetrieve(client?: API): ReturnType<typeof useSWR<SystemHealth>> {
117
- return useSWR<SystemHealth>(
118
- 'cfg-dashboard-api-system-health',
119
- () => Fetchers.getDashboardApiSystemHealthRetrieve(client)
120
- )
121
- }
122
-
123
-
124
- /**
125
- * Get system metrics
126
- *
127
- * @method GET
128
- * @path /cfg/dashboard/api/system/metrics/
129
- */
130
- export function useDashboardApiSystemMetricsRetrieve(client?: API): ReturnType<typeof useSWR<SystemMetrics>> {
131
- return useSWR<SystemMetrics>(
132
- 'cfg-dashboard-api-system-metric',
133
- () => Fetchers.getDashboardApiSystemMetricsRetrieve(client)
134
- )
135
- }
136
-
137
-
@@ -1,106 +0,0 @@
1
- import * as Models from "./models";
2
-
3
-
4
- /**
5
- * API endpoints for Dashboard.
6
- */
7
- export class CfgDashboard {
8
- private client: any;
9
-
10
- constructor(client: any) {
11
- this.client = client;
12
- }
13
-
14
- /**
15
- * Get quick actions
16
- *
17
- * Retrieve quick action buttons for dashboard
18
- */
19
- async apiActivityActionsList(): Promise<any> {
20
- const response = await this.client.request('GET', "/cfg/dashboard/api/activity/actions/");
21
- return response;
22
- }
23
-
24
- async apiActivityRecentList(limit?: number): Promise<any>;
25
- async apiActivityRecentList(params?: { limit?: number }): Promise<any>;
26
-
27
- /**
28
- * Get recent activity
29
- *
30
- * Retrieve recent system activity entries
31
- */
32
- async apiActivityRecentList(...args: any[]): Promise<any> {
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 = { limit: args[0] };
40
- }
41
- const response = await this.client.request('GET', "/cfg/dashboard/api/activity/recent/", { params });
42
- return response;
43
- }
44
-
45
- /**
46
- * Get dashboard overview
47
- *
48
- * Retrieve complete dashboard data including stats, health, actions, and
49
- * metrics
50
- */
51
- async apiOverviewOverviewRetrieve(): Promise<Models.DashboardOverview> {
52
- const response = await this.client.request('GET', "/cfg/dashboard/api/overview/overview/");
53
- return response;
54
- }
55
-
56
- /**
57
- * Get application statistics
58
- *
59
- * Retrieve statistics for all enabled django-cfg applications
60
- */
61
- async apiStatisticsAppsList(): Promise<any> {
62
- const response = await this.client.request('GET', "/cfg/dashboard/api/statistics/apps/");
63
- return response;
64
- }
65
-
66
- /**
67
- * Get statistics cards
68
- *
69
- * Retrieve dashboard statistics cards with key metrics
70
- */
71
- async apiStatisticsCardsList(): Promise<any> {
72
- const response = await this.client.request('GET', "/cfg/dashboard/api/statistics/cards/");
73
- return response;
74
- }
75
-
76
- /**
77
- * Get user statistics
78
- *
79
- * Retrieve user-related statistics
80
- */
81
- async apiStatisticsUsersRetrieve(): Promise<Models.UserStatistics> {
82
- const response = await this.client.request('GET', "/cfg/dashboard/api/statistics/users/");
83
- return response;
84
- }
85
-
86
- /**
87
- * Get system health status
88
- *
89
- * Retrieve overall system health including all component checks
90
- */
91
- async apiSystemHealthRetrieve(): Promise<Models.SystemHealth> {
92
- const response = await this.client.request('GET', "/cfg/dashboard/api/system/health/");
93
- return response;
94
- }
95
-
96
- /**
97
- * Get system metrics
98
- *
99
- * Retrieve system performance metrics (CPU, memory, disk, etc.)
100
- */
101
- async apiSystemMetricsRetrieve(): Promise<Models.SystemMetrics> {
102
- const response = await this.client.request('GET', "/cfg/dashboard/api/system/metrics/");
103
- return response;
104
- }
105
-
106
- }