@djangocfg/api 1.2.34 → 1.2.35
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 +3739 -3676
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +564 -295
- package/dist/index.d.ts +564 -295
- package/dist/index.mjs +3675 -3611
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/cfg/contexts/LeadsContext.tsx +11 -0
- package/src/cfg/contexts/NewsletterContext.tsx +19 -0
- package/src/cfg/contexts/SupportContext.tsx +3 -3
- package/src/cfg/contexts/index.ts +22 -2
- package/src/cfg/contexts/knowbase/DocumentsContext.tsx +4 -4
- package/src/cfg/contexts/knowbase/SessionsContext.tsx +2 -2
- package/src/cfg/contexts/payments/PaymentsContext.tsx +2 -2
- package/src/cfg/generated/_utils/fetchers/cfg__centrifugo__centrifugo_monitoring.ts +68 -3
- package/src/cfg/generated/_utils/fetchers/cfg__grpc__grpc_testing.ts +7 -7
- package/src/cfg/generated/_utils/fetchers/index.ts +0 -1
- package/src/cfg/generated/_utils/hooks/cfg__centrifugo__centrifugo_monitoring.ts +18 -3
- package/src/cfg/generated/_utils/hooks/cfg__grpc__grpc_testing.ts +5 -5
- package/src/cfg/generated/_utils/hooks/index.ts +0 -1
- package/src/cfg/generated/_utils/schemas/APIZonesSummary.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/AppStatisticsData.schema.ts +2 -0
- package/src/cfg/generated/_utils/schemas/ArchiveItemChunk.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/ArchiveItemChunkDetail.schema.ts +2 -2
- package/src/cfg/generated/_utils/schemas/ArchiveItemDetail.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/ArchiveSearchResult.schema.ts +3 -3
- package/src/cfg/generated/_utils/schemas/ChannelList.schema.ts +2 -2
- package/src/cfg/generated/_utils/schemas/{ChannelStatsSerializer.schema.ts → ChannelStats.schema.ts} +4 -4
- package/src/cfg/generated/_utils/schemas/ChatMessage.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/CommandCategory.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/CommandExecuteRequestRequest.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/CommandsSummary.schema.ts +2 -1
- package/src/cfg/generated/_utils/schemas/DjangoConfig.schema.ts +2 -1
- package/src/cfg/generated/_utils/schemas/Document.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/DocumentArchiveDetail.schema.ts +2 -2
- package/src/cfg/generated/_utils/schemas/DocumentCreateRequest.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/DocumentProcessingStatus.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/DocumentRequest.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/GRPCCallRequestRequest.schema.ts +2 -2
- package/src/cfg/generated/_utils/schemas/GRPCCallResponse.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/GRPCExample.schema.ts +3 -3
- package/src/cfg/generated/_utils/schemas/JobDetail.schema.ts +2 -2
- package/src/cfg/generated/_utils/schemas/LeadSubmission.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/LeadSubmissionError.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/LeadSubmissionRequest.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/ModelStatistics.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/PaginatedGRPCTestLogList.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/PatchedDocumentRequest.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/PatchedLeadSubmissionRequest.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/Publish.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/RQConfig.schema.ts +2 -1
- package/src/cfg/generated/_utils/schemas/RQSchedule.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/RedisQueueConfig.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/RunDemoRequestRequest.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/ScheduleCreateRequest.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/ScheduleInfo.schema.ts +27 -0
- package/src/cfg/generated/_utils/schemas/ScheduledJob.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/TestScenario.schema.ts +1 -1
- package/src/cfg/generated/_utils/schemas/TimelineItem.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/TimelineResponse.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/index.ts +7 -1
- package/src/cfg/generated/cfg__centrifugo__centrifugo_admin_api/models.ts +1 -1
- package/src/cfg/generated/cfg__centrifugo__centrifugo_monitoring/client.ts +27 -6
- package/src/cfg/generated/cfg__centrifugo__centrifugo_monitoring/models.ts +45 -21
- package/src/cfg/generated/cfg__dashboard__dashboard_api_zones/models.ts +1 -1
- package/src/cfg/generated/cfg__dashboard__dashboard_commands/models.ts +15 -2
- package/src/cfg/generated/cfg__dashboard__dashboard_config/models.ts +17 -16
- package/src/cfg/generated/cfg__dashboard__dashboard_overview/models.ts +20 -0
- package/src/cfg/generated/cfg__grpc__grpc_api_keys/models.ts +1 -1
- package/src/cfg/generated/cfg__grpc__grpc_testing/client.ts +4 -4
- package/src/cfg/generated/cfg__grpc__grpc_testing/models.ts +48 -23
- package/src/cfg/generated/cfg__knowbase/models.ts +15 -15
- package/src/cfg/generated/cfg__leads/models.ts +3 -3
- package/src/cfg/generated/cfg__leads__lead_submission/models.ts +2 -2
- package/src/cfg/generated/cfg__rq__rq_jobs/models.ts +5 -5
- package/src/cfg/generated/cfg__rq__rq_monitoring/models.ts +19 -2
- package/src/cfg/generated/cfg__rq__rq_queues/models.ts +1 -1
- package/src/cfg/generated/cfg__rq__rq_schedules/models.ts +7 -7
- package/src/cfg/generated/cfg__rq__rq_testing/models.ts +4 -4
- package/src/cfg/generated/client.ts +0 -3
- package/src/cfg/generated/index.ts +0 -5
- package/src/cfg/generated/schema.json +403 -181
- package/src/cfg/generated/_utils/fetchers/cfg__centrifugo.ts +0 -99
- package/src/cfg/generated/_utils/hooks/cfg__centrifugo.ts +0 -35
- package/src/cfg/generated/cfg__centrifugo/client.ts +0 -22
- package/src/cfg/generated/cfg__centrifugo/index.ts +0 -2
- package/src/cfg/generated/cfg__centrifugo/models.ts +0 -19
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@djangocfg/api",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.35",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "DjangoCFG",
|
|
6
6
|
"url": "https://djangocfg.com"
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"@types/node": "^22.15.3",
|
|
69
69
|
"@types/react": "19.2.2",
|
|
70
70
|
"@types/react-dom": "19.2.1",
|
|
71
|
-
"@djangocfg/typescript-config": "^1.2.
|
|
71
|
+
"@djangocfg/typescript-config": "^1.2.35",
|
|
72
72
|
"react": "^19.1.0",
|
|
73
73
|
"react-dom": "^19.1.0",
|
|
74
74
|
"tsup": "^8.5.0",
|
|
@@ -143,3 +143,14 @@ export function useLeadsContext(): LeadsContextValue {
|
|
|
143
143
|
return context;
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
147
|
+
// Re-export types for external use
|
|
148
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
149
|
+
|
|
150
|
+
export type {
|
|
151
|
+
LeadSubmission,
|
|
152
|
+
LeadSubmissionRequest,
|
|
153
|
+
PatchedLeadSubmissionRequest,
|
|
154
|
+
PaginatedLeadSubmissionList,
|
|
155
|
+
};
|
|
156
|
+
|
|
@@ -242,3 +242,22 @@ export function useNewsletterContext(): NewsletterContextValue {
|
|
|
242
242
|
return context;
|
|
243
243
|
}
|
|
244
244
|
|
|
245
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
246
|
+
// Re-export types for external use
|
|
247
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
248
|
+
|
|
249
|
+
export type {
|
|
250
|
+
NewsletterCampaign,
|
|
251
|
+
NewsletterCampaignRequest,
|
|
252
|
+
PatchedNewsletterCampaignRequest,
|
|
253
|
+
NewsletterSubscription,
|
|
254
|
+
PaginatedNewsletterCampaignList,
|
|
255
|
+
PaginatedNewsletterSubscriptionList,
|
|
256
|
+
SubscribeRequest,
|
|
257
|
+
SubscribeResponse,
|
|
258
|
+
UnsubscribeRequest,
|
|
259
|
+
SuccessResponse,
|
|
260
|
+
SendCampaignRequest,
|
|
261
|
+
SendCampaignResponse,
|
|
262
|
+
};
|
|
263
|
+
|
|
@@ -70,13 +70,13 @@ const SupportContext = createContext<SupportContextValue | undefined>(undefined)
|
|
|
70
70
|
// ─────────────────────────────────────────────────────────────────────────
|
|
71
71
|
|
|
72
72
|
export function SupportProvider({ children }: { children: ReactNode }) {
|
|
73
|
-
// List tickets
|
|
73
|
+
// List tickets (first page only for count)
|
|
74
74
|
const {
|
|
75
75
|
data: ticketsData,
|
|
76
76
|
error: ticketsError,
|
|
77
77
|
isLoading: isLoadingTickets,
|
|
78
78
|
mutate: mutateTickets,
|
|
79
|
-
} = useSupportTicketsList(
|
|
79
|
+
} = useSupportTicketsList({ page: 1, page_size: 1 }, api as unknown as API);
|
|
80
80
|
|
|
81
81
|
const refreshTickets = async () => {
|
|
82
82
|
await mutateTickets();
|
|
@@ -135,7 +135,7 @@ export function SupportProvider({ children }: { children: ReactNode }) {
|
|
|
135
135
|
|
|
136
136
|
// Get messages for ticket
|
|
137
137
|
const getMessages = async (ticketUuid: string): Promise<Message[] | undefined> => {
|
|
138
|
-
const { data } = useSupportTicketsMessagesList(ticketUuid,
|
|
138
|
+
const { data } = useSupportTicketsMessagesList(ticketUuid, { page: 1, page_size: 100 }, api as unknown as API);
|
|
139
139
|
return data?.results;
|
|
140
140
|
};
|
|
141
141
|
|
|
@@ -7,11 +7,31 @@
|
|
|
7
7
|
|
|
8
8
|
// Newsletter (Campaigns & Subscriptions)
|
|
9
9
|
export { NewsletterProvider, useNewsletterContext } from './NewsletterContext';
|
|
10
|
-
export type {
|
|
10
|
+
export type {
|
|
11
|
+
NewsletterContextValue,
|
|
12
|
+
NewsletterCampaign,
|
|
13
|
+
NewsletterCampaignRequest,
|
|
14
|
+
PatchedNewsletterCampaignRequest,
|
|
15
|
+
NewsletterSubscription,
|
|
16
|
+
PaginatedNewsletterCampaignList,
|
|
17
|
+
PaginatedNewsletterSubscriptionList,
|
|
18
|
+
SubscribeRequest,
|
|
19
|
+
SubscribeResponse,
|
|
20
|
+
UnsubscribeRequest,
|
|
21
|
+
SuccessResponse,
|
|
22
|
+
SendCampaignRequest,
|
|
23
|
+
SendCampaignResponse,
|
|
24
|
+
} from './NewsletterContext';
|
|
11
25
|
|
|
12
26
|
// Leads (Lead Submissions)
|
|
13
27
|
export { LeadsProvider, useLeadsContext } from './LeadsContext';
|
|
14
|
-
export type {
|
|
28
|
+
export type {
|
|
29
|
+
LeadsContextValue,
|
|
30
|
+
LeadSubmission,
|
|
31
|
+
LeadSubmissionRequest,
|
|
32
|
+
PatchedLeadSubmissionRequest,
|
|
33
|
+
PaginatedLeadSubmissionList,
|
|
34
|
+
} from './LeadsContext';
|
|
15
35
|
|
|
16
36
|
// Support (Tickets & Messages)
|
|
17
37
|
export {
|
|
@@ -97,25 +97,25 @@ const KnowbaseDocumentsContext = createContext<KnowbaseDocumentsContextValue | u
|
|
|
97
97
|
// ─────────────────────────────────────────────────────────────────────────
|
|
98
98
|
|
|
99
99
|
export function KnowbaseDocumentsProvider({ children }: { children: ReactNode }) {
|
|
100
|
-
// Documents list
|
|
100
|
+
// Documents list (first page only for count)
|
|
101
101
|
const {
|
|
102
102
|
data: documents,
|
|
103
103
|
error: documentsError,
|
|
104
104
|
isLoading: isLoadingDocuments,
|
|
105
105
|
mutate: mutateDocuments,
|
|
106
|
-
} = useKnowbaseAdminDocumentsList({}, api as unknown as API);
|
|
106
|
+
} = useKnowbaseAdminDocumentsList({ page: 1, page_size: 1 }, api as unknown as API);
|
|
107
107
|
|
|
108
108
|
const refreshDocuments = async () => {
|
|
109
109
|
await mutateDocuments();
|
|
110
110
|
};
|
|
111
111
|
|
|
112
|
-
// Archives list
|
|
112
|
+
// Archives list (first page only for count)
|
|
113
113
|
const {
|
|
114
114
|
data: archives,
|
|
115
115
|
error: archivesError,
|
|
116
116
|
isLoading: isLoadingArchives,
|
|
117
117
|
mutate: mutateArchives,
|
|
118
|
-
} = useKnowbaseSystemArchivesList({}, api as unknown as API);
|
|
118
|
+
} = useKnowbaseSystemArchivesList({ page: 1, page_size: 1 }, api as unknown as API);
|
|
119
119
|
|
|
120
120
|
const refreshArchives = async () => {
|
|
121
121
|
await mutateArchives();
|
|
@@ -60,13 +60,13 @@ const KnowbaseSessionsContext = createContext<KnowbaseSessionsContextValue | und
|
|
|
60
60
|
// ─────────────────────────────────────────────────────────────────────────
|
|
61
61
|
|
|
62
62
|
export function KnowbaseSessionsProvider({ children }: { children: ReactNode }) {
|
|
63
|
-
// List sessions
|
|
63
|
+
// List sessions (first page only for count)
|
|
64
64
|
const {
|
|
65
65
|
data: sessions,
|
|
66
66
|
error: sessionsError,
|
|
67
67
|
isLoading: isLoadingSessions,
|
|
68
68
|
mutate: mutateSessions,
|
|
69
|
-
} = useKnowbaseAdminSessionsList({}, api as unknown as API);
|
|
69
|
+
} = useKnowbaseAdminSessionsList({ page: 1, page_size: 1 }, api as unknown as API);
|
|
70
70
|
|
|
71
71
|
const refreshSessions = async () => {
|
|
72
72
|
await mutateSessions();
|
|
@@ -47,13 +47,13 @@ const PaymentsContext = createContext<PaymentsContextValue | undefined>(undefine
|
|
|
47
47
|
// ─────────────────────────────────────────────────────────────────────────
|
|
48
48
|
|
|
49
49
|
export function PaymentsProvider({ children }: { children: ReactNode }) {
|
|
50
|
-
// List payments
|
|
50
|
+
// List payments (first page only for count)
|
|
51
51
|
const {
|
|
52
52
|
data: payments,
|
|
53
53
|
error: paymentsError,
|
|
54
54
|
isLoading: isLoadingPayments,
|
|
55
55
|
mutate: mutatePayments,
|
|
56
|
-
} = usePaymentsPaymentsList({}, api as unknown as API);
|
|
56
|
+
} = usePaymentsPaymentsList({ page: 1, page_size: 1 }, api as unknown as API);
|
|
57
57
|
|
|
58
58
|
const refreshPayments = async () => {
|
|
59
59
|
await mutatePayments();
|
|
@@ -34,8 +34,73 @@ import { CentrifugoOverviewStatsSchema, type CentrifugoOverviewStats } from '../
|
|
|
34
34
|
import { ChannelListSchema, type ChannelList } from '../schemas/ChannelList.schema'
|
|
35
35
|
import { HealthCheckSchema, type HealthCheck } from '../schemas/HealthCheck.schema'
|
|
36
36
|
import { PaginatedPublishListSchema, type PaginatedPublishList } from '../schemas/PaginatedPublishList.schema'
|
|
37
|
+
import { TimelineResponseSchema, type TimelineResponse } from '../schemas/TimelineResponse.schema'
|
|
37
38
|
import { getAPIInstance } from '../../api-instance'
|
|
38
39
|
|
|
40
|
+
/**
|
|
41
|
+
* Get channel statistics
|
|
42
|
+
*
|
|
43
|
+
* @method GET
|
|
44
|
+
* @path /cfg/centrifugo/monitor/channels/
|
|
45
|
+
*/
|
|
46
|
+
export async function getCentrifugoMonitorChannelsRetrieve( params?: { hours?: number }, client?: any
|
|
47
|
+
): Promise<ChannelList> {
|
|
48
|
+
const api = client || getAPIInstance()
|
|
49
|
+
const response = await api.cfg_centrifugo_monitoring.centrifugoMonitorChannelsRetrieve(params?.hours)
|
|
50
|
+
try {
|
|
51
|
+
return ChannelListSchema.parse(response)
|
|
52
|
+
} catch (error) {
|
|
53
|
+
// Zod validation error - log detailed information
|
|
54
|
+
consola.error('❌ Zod Validation Failed');
|
|
55
|
+
consola.box({
|
|
56
|
+
title: 'getCentrifugoMonitorChannelsRetrieve',
|
|
57
|
+
message: `Path: /cfg/centrifugo/monitor/channels/\nMethod: GET`,
|
|
58
|
+
style: {
|
|
59
|
+
borderColor: 'red',
|
|
60
|
+
borderStyle: 'rounded'
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
|
|
65
|
+
consola.error('Validation Issues:');
|
|
66
|
+
(error as any).issues.forEach((issue: any, index: number) => {
|
|
67
|
+
consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
|
|
68
|
+
consola.error(` ├─ Message: ${issue.message}`);
|
|
69
|
+
if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
|
|
70
|
+
if (issue.received) consola.error(` └─ Received: ${issue.received}`);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
consola.error('Response data:', response);
|
|
75
|
+
|
|
76
|
+
// Dispatch browser CustomEvent (only if window is defined)
|
|
77
|
+
if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {
|
|
78
|
+
try {
|
|
79
|
+
const event = new CustomEvent('zod-validation-error', {
|
|
80
|
+
detail: {
|
|
81
|
+
operation: 'getCentrifugoMonitorChannelsRetrieve',
|
|
82
|
+
path: '/cfg/centrifugo/monitor/channels/',
|
|
83
|
+
method: 'GET',
|
|
84
|
+
error: error,
|
|
85
|
+
response: response,
|
|
86
|
+
timestamp: new Date(),
|
|
87
|
+
},
|
|
88
|
+
bubbles: true,
|
|
89
|
+
cancelable: false,
|
|
90
|
+
});
|
|
91
|
+
window.dispatchEvent(event);
|
|
92
|
+
} catch (eventError) {
|
|
93
|
+
// Silently fail - event dispatch should never crash the app
|
|
94
|
+
consola.warn('Failed to dispatch validation error event:', eventError);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Re-throw the error
|
|
99
|
+
throw error;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
|
|
39
104
|
/**
|
|
40
105
|
* Get Centrifugo health status
|
|
41
106
|
*
|
|
@@ -229,17 +294,17 @@ export async function getCentrifugoMonitorPublishesList( params?: { channel?: s
|
|
|
229
294
|
|
|
230
295
|
|
|
231
296
|
/**
|
|
232
|
-
* Get
|
|
297
|
+
* Get publish timeline
|
|
233
298
|
*
|
|
234
299
|
* @method GET
|
|
235
300
|
* @path /cfg/centrifugo/monitor/timeline/
|
|
236
301
|
*/
|
|
237
302
|
export async function getCentrifugoMonitorTimelineRetrieve( params?: { hours?: number; interval?: string }, client?: any
|
|
238
|
-
): Promise<
|
|
303
|
+
): Promise<TimelineResponse> {
|
|
239
304
|
const api = client || getAPIInstance()
|
|
240
305
|
const response = await api.cfg_centrifugo_monitoring.centrifugoMonitorTimelineRetrieve(params?.hours, params?.interval)
|
|
241
306
|
try {
|
|
242
|
-
return
|
|
307
|
+
return TimelineResponseSchema.parse(response)
|
|
243
308
|
} catch (error) {
|
|
244
309
|
// Zod validation error - log detailed information
|
|
245
310
|
consola.error('❌ Zod Validation Failed');
|
|
@@ -33,7 +33,7 @@ import { consola } from 'consola'
|
|
|
33
33
|
import { GRPCCallRequestRequestSchema, type GRPCCallRequestRequest } from '../schemas/GRPCCallRequestRequest.schema'
|
|
34
34
|
import { GRPCCallResponseSchema, type GRPCCallResponse } from '../schemas/GRPCCallResponse.schema'
|
|
35
35
|
import { GRPCExamplesListSchema, type GRPCExamplesList } from '../schemas/GRPCExamplesList.schema'
|
|
36
|
-
import {
|
|
36
|
+
import { PaginatedGRPCTestLogListSchema, type PaginatedGRPCTestLogList } from '../schemas/PaginatedGRPCTestLogList.schema'
|
|
37
37
|
import { getAPIInstance } from '../../api-instance'
|
|
38
38
|
|
|
39
39
|
/**
|
|
@@ -170,17 +170,17 @@ export async function getGrpcTestExamplesRetrieve( params?: { method?: string;
|
|
|
170
170
|
* @method GET
|
|
171
171
|
* @path /cfg/grpc/test/logs/
|
|
172
172
|
*/
|
|
173
|
-
export async function
|
|
174
|
-
): Promise<
|
|
173
|
+
export async function getGrpcTestLogsList( params?: { method?: string; page?: number; page_size?: number; service?: string; status?: string }, client?: any
|
|
174
|
+
): Promise<PaginatedGRPCTestLogList> {
|
|
175
175
|
const api = client || getAPIInstance()
|
|
176
|
-
const response = await api.cfg_grpc_testing.
|
|
176
|
+
const response = await api.cfg_grpc_testing.grpcTestLogsList(params?.method, params?.page, params?.page_size, params?.service, params?.status)
|
|
177
177
|
try {
|
|
178
|
-
return
|
|
178
|
+
return PaginatedGRPCTestLogListSchema.parse(response)
|
|
179
179
|
} catch (error) {
|
|
180
180
|
// Zod validation error - log detailed information
|
|
181
181
|
consola.error('❌ Zod Validation Failed');
|
|
182
182
|
consola.box({
|
|
183
|
-
title: '
|
|
183
|
+
title: 'getGrpcTestLogsList',
|
|
184
184
|
message: `Path: /cfg/grpc/test/logs/\nMethod: GET`,
|
|
185
185
|
style: {
|
|
186
186
|
borderColor: 'red',
|
|
@@ -205,7 +205,7 @@ export async function getGrpcTestLogsRetrieve( params?: { method?: string; serv
|
|
|
205
205
|
try {
|
|
206
206
|
const event = new CustomEvent('zod-validation-error', {
|
|
207
207
|
detail: {
|
|
208
|
-
operation: '
|
|
208
|
+
operation: 'getGrpcTestLogsList',
|
|
209
209
|
path: '/cfg/grpc/test/logs/',
|
|
210
210
|
method: 'GET',
|
|
211
211
|
error: error,
|
|
@@ -28,7 +28,6 @@
|
|
|
28
28
|
export * from './cfg__accounts'
|
|
29
29
|
export * from './cfg__accounts__auth'
|
|
30
30
|
export * from './cfg__accounts__user_profile'
|
|
31
|
-
export * from './cfg__centrifugo'
|
|
32
31
|
export * from './cfg__centrifugo__centrifugo_admin_api'
|
|
33
32
|
export * from './cfg__centrifugo__centrifugo_auth'
|
|
34
33
|
export * from './cfg__centrifugo__centrifugo_monitoring'
|
|
@@ -21,6 +21,21 @@ import type { CentrifugoOverviewStats } from '../schemas/CentrifugoOverviewStats
|
|
|
21
21
|
import type { ChannelList } from '../schemas/ChannelList.schema'
|
|
22
22
|
import type { HealthCheck } from '../schemas/HealthCheck.schema'
|
|
23
23
|
import type { PaginatedPublishList } from '../schemas/PaginatedPublishList.schema'
|
|
24
|
+
import type { TimelineResponse } from '../schemas/TimelineResponse.schema'
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Get channel statistics
|
|
28
|
+
*
|
|
29
|
+
* @method GET
|
|
30
|
+
* @path /cfg/centrifugo/monitor/channels/
|
|
31
|
+
*/
|
|
32
|
+
export function useCentrifugoMonitorChannelsRetrieve(params?: { hours?: number }, client?: API): ReturnType<typeof useSWR<ChannelList>> {
|
|
33
|
+
return useSWR<ChannelList>(
|
|
34
|
+
params ? ['cfg-centrifugo-monitor-channel', params] : 'cfg-centrifugo-monitor-channel',
|
|
35
|
+
() => Fetchers.getCentrifugoMonitorChannelsRetrieve(params, client)
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
|
|
24
39
|
|
|
25
40
|
/**
|
|
26
41
|
* Get Centrifugo health status
|
|
@@ -65,13 +80,13 @@ export function useCentrifugoMonitorPublishesList(params?: { channel?: string; p
|
|
|
65
80
|
|
|
66
81
|
|
|
67
82
|
/**
|
|
68
|
-
* Get
|
|
83
|
+
* Get publish timeline
|
|
69
84
|
*
|
|
70
85
|
* @method GET
|
|
71
86
|
* @path /cfg/centrifugo/monitor/timeline/
|
|
72
87
|
*/
|
|
73
|
-
export function useCentrifugoMonitorTimelineRetrieve(params?: { hours?: number; interval?: string }, client?: API): ReturnType<typeof useSWR<
|
|
74
|
-
return useSWR<
|
|
88
|
+
export function useCentrifugoMonitorTimelineRetrieve(params?: { hours?: number; interval?: string }, client?: API): ReturnType<typeof useSWR<TimelineResponse>> {
|
|
89
|
+
return useSWR<TimelineResponse>(
|
|
75
90
|
params ? ['cfg-centrifugo-monitor-timeline', params] : 'cfg-centrifugo-monitor-timeline',
|
|
76
91
|
() => Fetchers.getCentrifugoMonitorTimelineRetrieve(params, client)
|
|
77
92
|
)
|
|
@@ -21,7 +21,7 @@ import type { API } from '../../index'
|
|
|
21
21
|
import type { GRPCCallRequestRequest } from '../schemas/GRPCCallRequestRequest.schema'
|
|
22
22
|
import type { GRPCCallResponse } from '../schemas/GRPCCallResponse.schema'
|
|
23
23
|
import type { GRPCExamplesList } from '../schemas/GRPCExamplesList.schema'
|
|
24
|
-
import type {
|
|
24
|
+
import type { PaginatedGRPCTestLogList } from '../schemas/PaginatedGRPCTestLogList.schema'
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* Call gRPC method
|
|
@@ -61,10 +61,10 @@ export function useGrpcTestExamplesRetrieve(params?: { method?: string; service?
|
|
|
61
61
|
* @method GET
|
|
62
62
|
* @path /cfg/grpc/test/logs/
|
|
63
63
|
*/
|
|
64
|
-
export function
|
|
65
|
-
return useSWR<
|
|
66
|
-
params ? ['cfg-grpc-test-
|
|
67
|
-
() => Fetchers.
|
|
64
|
+
export function useGrpcTestLogsList(params?: { method?: string; page?: number; page_size?: number; service?: string; status?: string }, client?: API): ReturnType<typeof useSWR<PaginatedGRPCTestLogList>> {
|
|
65
|
+
return useSWR<PaginatedGRPCTestLogList>(
|
|
66
|
+
params ? ['cfg-grpc-test-logs', params] : 'cfg-grpc-test-logs',
|
|
67
|
+
() => Fetchers.getGrpcTestLogsList(params, client)
|
|
68
68
|
)
|
|
69
69
|
}
|
|
70
70
|
|
|
@@ -52,7 +52,6 @@ export * from './cfg__newsletter__subscriptions'
|
|
|
52
52
|
export * from './cfg__newsletter__testing'
|
|
53
53
|
export * from './cfg__accounts__user_profile'
|
|
54
54
|
export * from './cfg__accounts'
|
|
55
|
-
export * from './cfg__centrifugo'
|
|
56
55
|
export * from './cfg__endpoints'
|
|
57
56
|
export * from './cfg__grpc__grpc_api_keys'
|
|
58
57
|
export * from './cfg__grpc__grpc_charts'
|
|
@@ -12,7 +12,7 @@ import { APIZoneSchema } from './APIZone.schema'
|
|
|
12
12
|
*/
|
|
13
13
|
export const APIZonesSummarySchema = z.object({
|
|
14
14
|
zones: z.array(APIZoneSchema),
|
|
15
|
-
summary: z.record(z.string(), z.any()),
|
|
15
|
+
summary: z.record(z.string(), z.record(z.string(), z.any())),
|
|
16
16
|
})
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -5,12 +5,14 @@
|
|
|
5
5
|
* * Serializer for application statistics data.
|
|
6
6
|
* */
|
|
7
7
|
import { z } from 'zod'
|
|
8
|
+
import { ModelStatisticsSchema } from './ModelStatistics.schema'
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Serializer for application statistics data.
|
|
11
12
|
*/
|
|
12
13
|
export const AppStatisticsDataSchema = z.object({
|
|
13
14
|
name: z.string(),
|
|
15
|
+
models: z.array(ModelStatisticsSchema),
|
|
14
16
|
total_records: z.int(),
|
|
15
17
|
model_count: z.int(),
|
|
16
18
|
})
|
|
@@ -19,7 +19,7 @@ export const ArchiveItemChunkSchema = z.object({
|
|
|
19
19
|
character_count: z.int(),
|
|
20
20
|
embedding_model: z.string(),
|
|
21
21
|
embedding_cost: z.number(),
|
|
22
|
-
context_summary: z.record(z.string(), z.any()),
|
|
22
|
+
context_summary: z.record(z.string(), z.record(z.string(), z.any())),
|
|
23
23
|
created_at: z.iso.datetime(),
|
|
24
24
|
})
|
|
25
25
|
|
|
@@ -19,9 +19,9 @@ export const ArchiveItemChunkDetailSchema = z.object({
|
|
|
19
19
|
character_count: z.int(),
|
|
20
20
|
embedding_model: z.string(),
|
|
21
21
|
embedding_cost: z.number(),
|
|
22
|
-
context_summary: z.record(z.string(), z.any()),
|
|
22
|
+
context_summary: z.record(z.string(), z.record(z.string(), z.any())),
|
|
23
23
|
created_at: z.iso.datetime(),
|
|
24
|
-
context_metadata: z.string(),
|
|
24
|
+
context_metadata: z.record(z.string(), z.any()),
|
|
25
25
|
})
|
|
26
26
|
|
|
27
27
|
/**
|
|
@@ -13,9 +13,9 @@ import { ArchiveItemChunkSchema } from './ArchiveItemChunk.schema'
|
|
|
13
13
|
export const ArchiveSearchResultSchema = z.object({
|
|
14
14
|
chunk: ArchiveItemChunkSchema,
|
|
15
15
|
similarity_score: z.number(),
|
|
16
|
-
context_summary: z.record(z.string(), z.any()),
|
|
17
|
-
archive_info: z.record(z.string(), z.any()),
|
|
18
|
-
item_info: z.record(z.string(), z.any()),
|
|
16
|
+
context_summary: z.record(z.string(), z.record(z.string(), z.any())),
|
|
17
|
+
archive_info: z.record(z.string(), z.record(z.string(), z.any())),
|
|
18
|
+
item_info: z.record(z.string(), z.record(z.string(), z.any())),
|
|
19
19
|
})
|
|
20
20
|
|
|
21
21
|
/**
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
* * List of channel statistics.
|
|
6
6
|
* */
|
|
7
7
|
import { z } from 'zod'
|
|
8
|
-
import {
|
|
8
|
+
import { ChannelStatsSchema } from './ChannelStats.schema'
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* List of channel statistics.
|
|
12
12
|
*/
|
|
13
13
|
export const ChannelListSchema = z.object({
|
|
14
|
-
channels: z.array(
|
|
14
|
+
channels: z.array(ChannelStatsSchema),
|
|
15
15
|
total_channels: z.int(),
|
|
16
16
|
})
|
|
17
17
|
|
package/src/cfg/generated/_utils/schemas/{ChannelStatsSerializer.schema.ts → ChannelStats.schema.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Zod schema for
|
|
2
|
+
* Zod schema for ChannelStats
|
|
3
3
|
*
|
|
4
4
|
* This schema provides runtime validation and type inference.
|
|
5
5
|
* * Statistics per channel.
|
|
@@ -9,17 +9,17 @@ import { z } from 'zod'
|
|
|
9
9
|
/**
|
|
10
10
|
* Statistics per channel.
|
|
11
11
|
*/
|
|
12
|
-
export const
|
|
12
|
+
export const ChannelStatsSchema = z.object({
|
|
13
13
|
channel: z.string(),
|
|
14
14
|
total: z.int(),
|
|
15
15
|
successful: z.int(),
|
|
16
16
|
failed: z.int(),
|
|
17
17
|
avg_duration_ms: z.number(),
|
|
18
18
|
avg_acks: z.number(),
|
|
19
|
-
last_activity_at: z.string().nullable()
|
|
19
|
+
last_activity_at: z.string().nullable(),
|
|
20
20
|
})
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Infer TypeScript type from Zod schema
|
|
24
24
|
*/
|
|
25
|
-
export type
|
|
25
|
+
export type ChannelStats = z.infer<typeof ChannelStatsSchema>
|
|
@@ -18,7 +18,7 @@ export const ChatMessageSchema = z.object({
|
|
|
18
18
|
cost_usd: z.number(),
|
|
19
19
|
processing_time_ms: z.int().min(0.0).max(2147483647.0).optional(),
|
|
20
20
|
created_at: z.iso.datetime(),
|
|
21
|
-
context_chunks: z.string().optional(),
|
|
21
|
+
context_chunks: z.record(z.string(), z.any()).optional(),
|
|
22
22
|
})
|
|
23
23
|
|
|
24
24
|
/**
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for CommandCategory
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Category with commands.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
import { CommandSchema } from './Command.schema'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Category with commands.
|
|
12
|
+
*/
|
|
13
|
+
export const CommandCategorySchema = z.object({
|
|
14
|
+
category: z.string(),
|
|
15
|
+
commands: z.array(CommandSchema),
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Infer TypeScript type from Zod schema
|
|
20
|
+
*/
|
|
21
|
+
export type CommandCategory = z.infer<typeof CommandCategorySchema>
|
|
@@ -12,7 +12,7 @@ import { z } from 'zod'
|
|
|
12
12
|
export const CommandExecuteRequestRequestSchema = z.object({
|
|
13
13
|
command: z.string().min(1),
|
|
14
14
|
args: z.array(z.string().min(1)).optional(),
|
|
15
|
-
options: z.record(z.string(), z.any()).optional(),
|
|
15
|
+
options: z.record(z.string(), z.record(z.string(), z.any())).optional(),
|
|
16
16
|
})
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* */
|
|
7
7
|
import { z } from 'zod'
|
|
8
8
|
import { CommandSchema } from './Command.schema'
|
|
9
|
+
import { CommandCategorySchema } from './CommandCategory.schema'
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Commands summary serializer.
|
|
@@ -16,7 +17,7 @@ export const CommandsSummarySchema = z.object({
|
|
|
16
17
|
custom_commands: z.int(),
|
|
17
18
|
categories: z.array(z.string()),
|
|
18
19
|
commands: z.array(CommandSchema),
|
|
19
|
-
categorized: z.
|
|
20
|
+
categorized: z.array(CommandCategorySchema),
|
|
20
21
|
})
|
|
21
22
|
|
|
22
23
|
/**
|
|
@@ -47,6 +47,7 @@ export const DjangoConfigSchema = z.object({
|
|
|
47
47
|
enable_maintenance: z.boolean().nullable().optional(),
|
|
48
48
|
enable_frontend: z.boolean().nullable().optional(),
|
|
49
49
|
enable_drf_tailwind: z.boolean().nullable().optional(),
|
|
50
|
+
enable_pool_cleanup: z.boolean().nullable().optional(),
|
|
50
51
|
site_url: z.string().nullable().optional(),
|
|
51
52
|
api_url: z.string().nullable().optional(),
|
|
52
53
|
debug: z.boolean().nullable().optional(),
|
|
@@ -74,7 +75,7 @@ export const DjangoConfigSchema = z.object({
|
|
|
74
75
|
ngrok: NgrokConfigSchema.nullable().optional(),
|
|
75
76
|
axes: AxesConfigSchema.nullable().optional(),
|
|
76
77
|
crypto_fields: z.record(z.string(), z.any()).nullable().optional(),
|
|
77
|
-
unfold: z.string().nullable().optional(),
|
|
78
|
+
unfold: z.record(z.string(), z.any()).nullable().optional(),
|
|
78
79
|
tailwind_app_name: z.string().nullable().optional(),
|
|
79
80
|
tailwind_version: z.int().nullable().optional(),
|
|
80
81
|
limits: z.record(z.string(), z.any()).nullable().optional(),
|
|
@@ -23,7 +23,7 @@ export const DocumentSchema = z.object({
|
|
|
23
23
|
processing_started_at: z.iso.datetime(),
|
|
24
24
|
processing_completed_at: z.iso.datetime(),
|
|
25
25
|
processing_error: z.string(),
|
|
26
|
-
metadata: z.string().nullable().optional(),
|
|
26
|
+
metadata: z.record(z.string(), z.any()).nullable().optional(),
|
|
27
27
|
})
|
|
28
28
|
|
|
29
29
|
/**
|
|
@@ -38,8 +38,8 @@ export const DocumentArchiveDetailSchema = z.object({
|
|
|
38
38
|
created_at: z.iso.datetime(),
|
|
39
39
|
updated_at: z.iso.datetime(),
|
|
40
40
|
items: z.array(ArchiveItemSchema),
|
|
41
|
-
file_tree: z.record(z.string(), z.any()),
|
|
42
|
-
metadata: z.string().nullable().optional(),
|
|
41
|
+
file_tree: z.record(z.string(), z.record(z.string(), z.any())),
|
|
42
|
+
metadata: z.record(z.string(), z.any()).nullable().optional(),
|
|
43
43
|
})
|
|
44
44
|
|
|
45
45
|
/**
|
|
@@ -13,7 +13,7 @@ export const DocumentCreateRequestSchema = z.object({
|
|
|
13
13
|
title: z.string().min(1).max(512),
|
|
14
14
|
content: z.string().min(10).max(1000000),
|
|
15
15
|
file_type: z.string().min(1).optional(),
|
|
16
|
-
metadata: z.string().optional(),
|
|
16
|
+
metadata: z.record(z.string(), z.any()).optional(),
|
|
17
17
|
})
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -12,7 +12,7 @@ import { z } from 'zod'
|
|
|
12
12
|
export const DocumentProcessingStatusSchema = z.object({
|
|
13
13
|
id: z.uuid(),
|
|
14
14
|
status: z.string(),
|
|
15
|
-
progress: z.string(),
|
|
15
|
+
progress: z.record(z.string(), z.any()),
|
|
16
16
|
error: z.string().nullable().optional(),
|
|
17
17
|
processing_time_seconds: z.number().nullable().optional(),
|
|
18
18
|
})
|
|
@@ -13,7 +13,7 @@ export const DocumentRequestSchema = z.object({
|
|
|
13
13
|
title: z.string().min(1).max(512),
|
|
14
14
|
file_type: z.string().min(1).max(100).optional(),
|
|
15
15
|
file_size: z.int().min(0.0).max(2147483647.0).optional(),
|
|
16
|
-
metadata: z.string().nullable().optional(),
|
|
16
|
+
metadata: z.record(z.string(), z.any()).nullable().optional(),
|
|
17
17
|
})
|
|
18
18
|
|
|
19
19
|
/**
|