@djangocfg/api 1.2.5 → 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 +3407 -1386
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2418 -409
- package/dist/index.d.ts +2418 -409
- package/dist/index.mjs +3309 -1304
- 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 +12 -12
- package/src/cfg/generated/_utils/fetchers/cfg__centrifugo__centrifugo_monitoring.ts +25 -25
- package/src/cfg/generated/_utils/fetchers/cfg__centrifugo__centrifugo_testing.ts +8 -8
- 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 +2 -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.ts +137 -0
- package/src/cfg/generated/_utils/hooks/cfg__endpoints.ts +29 -0
- package/src/cfg/generated/_utils/hooks/index.ts +2 -0
- 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/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/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/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 +11 -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/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/client.ts +6 -0
- package/src/cfg/generated/enums.ts +56 -0
- package/src/cfg/generated/index.ts +17 -10
- package/src/cfg/generated/schema.ts +1546 -127
|
@@ -44,7 +44,7 @@ import type { API } from '../../index'
|
|
|
44
44
|
* @method POST
|
|
45
45
|
* @path /cfg/centrifugo/admin/api/testing/connection-token/
|
|
46
46
|
*/
|
|
47
|
-
export async function createCentrifugoAdminApiTestingConnectionTokenCreate( data: ConnectionTokenRequestRequest, client
|
|
47
|
+
export async function createCentrifugoAdminApiTestingConnectionTokenCreate( data: ConnectionTokenRequestRequest, client?: API
|
|
48
48
|
): Promise<ConnectionTokenResponse> {
|
|
49
49
|
const api = client || getAPIInstance()
|
|
50
50
|
const response = await api.cfg_centrifugo_testing.centrifugoAdminApiTestingConnectionTokenCreate(data)
|
|
@@ -58,7 +58,7 @@ export async function createCentrifugoAdminApiTestingConnectionTokenCreate( dat
|
|
|
58
58
|
* @method POST
|
|
59
59
|
* @path /cfg/centrifugo/admin/api/testing/publish-test/
|
|
60
60
|
*/
|
|
61
|
-
export async function createCentrifugoAdminApiTestingPublishTestCreate( data: PublishTestRequestRequest, client
|
|
61
|
+
export async function createCentrifugoAdminApiTestingPublishTestCreate( data: PublishTestRequestRequest, client?: API
|
|
62
62
|
): Promise<PublishTestResponse> {
|
|
63
63
|
const api = client || getAPIInstance()
|
|
64
64
|
const response = await api.cfg_centrifugo_testing.centrifugoAdminApiTestingPublishTestCreate(data)
|
|
@@ -72,7 +72,7 @@ export async function createCentrifugoAdminApiTestingPublishTestCreate( data: P
|
|
|
72
72
|
* @method POST
|
|
73
73
|
* @path /cfg/centrifugo/admin/api/testing/publish-with-logging/
|
|
74
74
|
*/
|
|
75
|
-
export async function createCentrifugoAdminApiTestingPublishWithLoggingCreate( data: PublishTestRequestRequest, client
|
|
75
|
+
export async function createCentrifugoAdminApiTestingPublishWithLoggingCreate( data: PublishTestRequestRequest, client?: API
|
|
76
76
|
): Promise<PublishTestResponse> {
|
|
77
77
|
const api = client || getAPIInstance()
|
|
78
78
|
const response = await api.cfg_centrifugo_testing.centrifugoAdminApiTestingPublishWithLoggingCreate(data)
|
|
@@ -86,7 +86,7 @@ export async function createCentrifugoAdminApiTestingPublishWithLoggingCreate(
|
|
|
86
86
|
* @method POST
|
|
87
87
|
* @path /cfg/centrifugo/admin/api/testing/send-ack/
|
|
88
88
|
*/
|
|
89
|
-
export async function createCentrifugoAdminApiTestingSendAckCreate( data: ManualAckRequestRequest, client
|
|
89
|
+
export async function createCentrifugoAdminApiTestingSendAckCreate( data: ManualAckRequestRequest, client?: API
|
|
90
90
|
): Promise<ManualAckResponse> {
|
|
91
91
|
const api = client || getAPIInstance()
|
|
92
92
|
const response = await api.cfg_centrifugo_testing.centrifugoAdminApiTestingSendAckCreate(data)
|
|
@@ -100,7 +100,7 @@ export async function createCentrifugoAdminApiTestingSendAckCreate( data: Manua
|
|
|
100
100
|
* @method POST
|
|
101
101
|
* @path /cfg/centrifugo/testing/connection-token/
|
|
102
102
|
*/
|
|
103
|
-
export async function createCentrifugoTestingConnectionTokenCreate( data: ConnectionTokenRequestRequest, client
|
|
103
|
+
export async function createCentrifugoTestingConnectionTokenCreate( data: ConnectionTokenRequestRequest, client?: API
|
|
104
104
|
): Promise<ConnectionTokenResponse> {
|
|
105
105
|
const api = client || getAPIInstance()
|
|
106
106
|
const response = await api.cfg_centrifugo_testing.connectionTokenCreate(data)
|
|
@@ -114,7 +114,7 @@ export async function createCentrifugoTestingConnectionTokenCreate( data: Conne
|
|
|
114
114
|
* @method POST
|
|
115
115
|
* @path /cfg/centrifugo/testing/publish-test/
|
|
116
116
|
*/
|
|
117
|
-
export async function createCentrifugoTestingPublishTestCreate( data: PublishTestRequestRequest, client
|
|
117
|
+
export async function createCentrifugoTestingPublishTestCreate( data: PublishTestRequestRequest, client?: API
|
|
118
118
|
): Promise<PublishTestResponse> {
|
|
119
119
|
const api = client || getAPIInstance()
|
|
120
120
|
const response = await api.cfg_centrifugo_testing.publishTestCreate(data)
|
|
@@ -128,7 +128,7 @@ export async function createCentrifugoTestingPublishTestCreate( data: PublishTe
|
|
|
128
128
|
* @method POST
|
|
129
129
|
* @path /cfg/centrifugo/testing/publish-with-logging/
|
|
130
130
|
*/
|
|
131
|
-
export async function createCentrifugoTestingPublishWithLoggingCreate( data: PublishTestRequestRequest, client
|
|
131
|
+
export async function createCentrifugoTestingPublishWithLoggingCreate( data: PublishTestRequestRequest, client?: API
|
|
132
132
|
): Promise<PublishTestResponse> {
|
|
133
133
|
const api = client || getAPIInstance()
|
|
134
134
|
const response = await api.cfg_centrifugo_testing.publishWithLoggingCreate(data)
|
|
@@ -142,7 +142,7 @@ export async function createCentrifugoTestingPublishWithLoggingCreate( data: Pu
|
|
|
142
142
|
* @method POST
|
|
143
143
|
* @path /cfg/centrifugo/testing/send-ack/
|
|
144
144
|
*/
|
|
145
|
-
export async function createCentrifugoTestingSendAckCreate( data: ManualAckRequestRequest, client
|
|
145
|
+
export async function createCentrifugoTestingSendAckCreate( data: ManualAckRequestRequest, client?: API
|
|
146
146
|
): Promise<ManualAckResponse> {
|
|
147
147
|
const api = client || getAPIInstance()
|
|
148
148
|
const response = await api.cfg_centrifugo_testing.sendAckCreate(data)
|
|
@@ -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()
|