@djangocfg/api 1.2.33 → 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.
Files changed (87) hide show
  1. package/dist/index.cjs +3739 -3676
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +564 -295
  4. package/dist/index.d.ts +564 -295
  5. package/dist/index.mjs +3675 -3611
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +2 -2
  8. package/src/cfg/contexts/LeadsContext.tsx +11 -0
  9. package/src/cfg/contexts/NewsletterContext.tsx +19 -0
  10. package/src/cfg/contexts/SupportContext.tsx +3 -3
  11. package/src/cfg/contexts/index.ts +22 -2
  12. package/src/cfg/contexts/knowbase/DocumentsContext.tsx +4 -4
  13. package/src/cfg/contexts/knowbase/SessionsContext.tsx +2 -2
  14. package/src/cfg/contexts/payments/PaymentsContext.tsx +2 -2
  15. package/src/cfg/generated/_utils/fetchers/cfg__centrifugo__centrifugo_monitoring.ts +68 -3
  16. package/src/cfg/generated/_utils/fetchers/cfg__grpc__grpc_testing.ts +7 -7
  17. package/src/cfg/generated/_utils/fetchers/index.ts +0 -1
  18. package/src/cfg/generated/_utils/hooks/cfg__centrifugo__centrifugo_monitoring.ts +18 -3
  19. package/src/cfg/generated/_utils/hooks/cfg__grpc__grpc_testing.ts +5 -5
  20. package/src/cfg/generated/_utils/hooks/index.ts +0 -1
  21. package/src/cfg/generated/_utils/schemas/APIZonesSummary.schema.ts +1 -1
  22. package/src/cfg/generated/_utils/schemas/AppStatisticsData.schema.ts +2 -0
  23. package/src/cfg/generated/_utils/schemas/ArchiveItemChunk.schema.ts +1 -1
  24. package/src/cfg/generated/_utils/schemas/ArchiveItemChunkDetail.schema.ts +2 -2
  25. package/src/cfg/generated/_utils/schemas/ArchiveItemDetail.schema.ts +1 -1
  26. package/src/cfg/generated/_utils/schemas/ArchiveSearchResult.schema.ts +3 -3
  27. package/src/cfg/generated/_utils/schemas/ChannelList.schema.ts +2 -2
  28. package/src/cfg/generated/_utils/schemas/{ChannelStatsSerializer.schema.ts → ChannelStats.schema.ts} +4 -4
  29. package/src/cfg/generated/_utils/schemas/ChatMessage.schema.ts +1 -1
  30. package/src/cfg/generated/_utils/schemas/CommandCategory.schema.ts +21 -0
  31. package/src/cfg/generated/_utils/schemas/CommandExecuteRequestRequest.schema.ts +1 -1
  32. package/src/cfg/generated/_utils/schemas/CommandsSummary.schema.ts +2 -1
  33. package/src/cfg/generated/_utils/schemas/DjangoConfig.schema.ts +2 -1
  34. package/src/cfg/generated/_utils/schemas/Document.schema.ts +1 -1
  35. package/src/cfg/generated/_utils/schemas/DocumentArchiveDetail.schema.ts +2 -2
  36. package/src/cfg/generated/_utils/schemas/DocumentCreateRequest.schema.ts +1 -1
  37. package/src/cfg/generated/_utils/schemas/DocumentProcessingStatus.schema.ts +1 -1
  38. package/src/cfg/generated/_utils/schemas/DocumentRequest.schema.ts +1 -1
  39. package/src/cfg/generated/_utils/schemas/GRPCCallRequestRequest.schema.ts +2 -2
  40. package/src/cfg/generated/_utils/schemas/GRPCCallResponse.schema.ts +1 -1
  41. package/src/cfg/generated/_utils/schemas/GRPCExample.schema.ts +3 -3
  42. package/src/cfg/generated/_utils/schemas/JobDetail.schema.ts +2 -2
  43. package/src/cfg/generated/_utils/schemas/LeadSubmission.schema.ts +1 -1
  44. package/src/cfg/generated/_utils/schemas/LeadSubmissionError.schema.ts +1 -1
  45. package/src/cfg/generated/_utils/schemas/LeadSubmissionRequest.schema.ts +1 -1
  46. package/src/cfg/generated/_utils/schemas/ModelStatistics.schema.ts +23 -0
  47. package/src/cfg/generated/_utils/schemas/PaginatedGRPCTestLogList.schema.ts +24 -0
  48. package/src/cfg/generated/_utils/schemas/PatchedDocumentRequest.schema.ts +1 -1
  49. package/src/cfg/generated/_utils/schemas/PatchedLeadSubmissionRequest.schema.ts +1 -1
  50. package/src/cfg/generated/_utils/schemas/Publish.schema.ts +1 -1
  51. package/src/cfg/generated/_utils/schemas/RQConfig.schema.ts +2 -1
  52. package/src/cfg/generated/_utils/schemas/RQSchedule.schema.ts +1 -1
  53. package/src/cfg/generated/_utils/schemas/RedisQueueConfig.schema.ts +1 -1
  54. package/src/cfg/generated/_utils/schemas/RunDemoRequestRequest.schema.ts +1 -1
  55. package/src/cfg/generated/_utils/schemas/ScheduleCreateRequest.schema.ts +1 -1
  56. package/src/cfg/generated/_utils/schemas/ScheduleInfo.schema.ts +27 -0
  57. package/src/cfg/generated/_utils/schemas/ScheduledJob.schema.ts +1 -1
  58. package/src/cfg/generated/_utils/schemas/TestScenario.schema.ts +1 -1
  59. package/src/cfg/generated/_utils/schemas/TimelineItem.schema.ts +23 -0
  60. package/src/cfg/generated/_utils/schemas/TimelineResponse.schema.ts +22 -0
  61. package/src/cfg/generated/_utils/schemas/index.ts +7 -1
  62. package/src/cfg/generated/cfg__centrifugo__centrifugo_admin_api/models.ts +1 -1
  63. package/src/cfg/generated/cfg__centrifugo__centrifugo_monitoring/client.ts +27 -6
  64. package/src/cfg/generated/cfg__centrifugo__centrifugo_monitoring/models.ts +45 -21
  65. package/src/cfg/generated/cfg__dashboard__dashboard_api_zones/models.ts +1 -1
  66. package/src/cfg/generated/cfg__dashboard__dashboard_commands/models.ts +15 -2
  67. package/src/cfg/generated/cfg__dashboard__dashboard_config/models.ts +17 -16
  68. package/src/cfg/generated/cfg__dashboard__dashboard_overview/models.ts +20 -0
  69. package/src/cfg/generated/cfg__grpc__grpc_api_keys/models.ts +1 -1
  70. package/src/cfg/generated/cfg__grpc__grpc_testing/client.ts +4 -4
  71. package/src/cfg/generated/cfg__grpc__grpc_testing/models.ts +48 -23
  72. package/src/cfg/generated/cfg__knowbase/models.ts +15 -15
  73. package/src/cfg/generated/cfg__leads/models.ts +3 -3
  74. package/src/cfg/generated/cfg__leads__lead_submission/models.ts +2 -2
  75. package/src/cfg/generated/cfg__rq__rq_jobs/models.ts +5 -5
  76. package/src/cfg/generated/cfg__rq__rq_monitoring/models.ts +19 -2
  77. package/src/cfg/generated/cfg__rq__rq_queues/models.ts +1 -1
  78. package/src/cfg/generated/cfg__rq__rq_schedules/models.ts +7 -7
  79. package/src/cfg/generated/cfg__rq__rq_testing/models.ts +4 -4
  80. package/src/cfg/generated/client.ts +0 -3
  81. package/src/cfg/generated/index.ts +0 -5
  82. package/src/cfg/generated/schema.json +403 -181
  83. package/src/cfg/generated/_utils/fetchers/cfg__centrifugo.ts +0 -99
  84. package/src/cfg/generated/_utils/hooks/cfg__centrifugo.ts +0 -35
  85. package/src/cfg/generated/cfg__centrifugo/client.ts +0 -22
  86. package/src/cfg/generated/cfg__centrifugo/index.ts +0 -2
  87. package/src/cfg/generated/cfg__centrifugo/models.ts +0 -19
@@ -1,99 +0,0 @@
1
- /**
2
- * Typed fetchers for Centrifugo
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 { consola } from 'consola'
33
- import { PublishSchema, type Publish } from '../schemas/Publish.schema'
34
- import { getAPIInstance } from '../../api-instance'
35
-
36
- /**
37
- * API operation
38
- *
39
- * @method GET
40
- * @path /cfg/centrifugo/monitor/channels/
41
- */
42
- export async function getCentrifugoMonitorChannelsRetrieve( client?: any
43
- ): Promise<Publish> {
44
- const api = client || getAPIInstance()
45
- const response = await api.cfg_centrifugo.monitorChannelsRetrieve()
46
- try {
47
- return PublishSchema.parse(response)
48
- } catch (error) {
49
- // Zod validation error - log detailed information
50
- consola.error('❌ Zod Validation Failed');
51
- consola.box({
52
- title: 'getCentrifugoMonitorChannelsRetrieve',
53
- message: `Path: /cfg/centrifugo/monitor/channels/\nMethod: GET`,
54
- style: {
55
- borderColor: 'red',
56
- borderStyle: 'rounded'
57
- }
58
- });
59
-
60
- if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
61
- consola.error('Validation Issues:');
62
- (error as any).issues.forEach((issue: any, index: number) => {
63
- consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
64
- consola.error(` ├─ Message: ${issue.message}`);
65
- if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
66
- if (issue.received) consola.error(` └─ Received: ${issue.received}`);
67
- });
68
- }
69
-
70
- consola.error('Response data:', response);
71
-
72
- // Dispatch browser CustomEvent (only if window is defined)
73
- if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {
74
- try {
75
- const event = new CustomEvent('zod-validation-error', {
76
- detail: {
77
- operation: 'getCentrifugoMonitorChannelsRetrieve',
78
- path: '/cfg/centrifugo/monitor/channels/',
79
- method: 'GET',
80
- error: error,
81
- response: response,
82
- timestamp: new Date(),
83
- },
84
- bubbles: true,
85
- cancelable: false,
86
- });
87
- window.dispatchEvent(event);
88
- } catch (eventError) {
89
- // Silently fail - event dispatch should never crash the app
90
- consola.warn('Failed to dispatch validation error event:', eventError);
91
- }
92
- }
93
-
94
- // Re-throw the error
95
- throw error;
96
- }
97
- }
98
-
99
-
@@ -1,35 +0,0 @@
1
- /**
2
- * SWR Hooks for Centrifugo
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 * as Fetchers from '../fetchers/cfg__centrifugo'
19
- import type { API } from '../../index'
20
- import type { Publish } from '../schemas/Publish.schema'
21
-
22
- /**
23
- * API operation
24
- *
25
- * @method GET
26
- * @path /cfg/centrifugo/monitor/channels/
27
- */
28
- export function useCentrifugoMonitorChannelsRetrieve(client?: API): ReturnType<typeof useSWR<Publish>> {
29
- return useSWR<Publish>(
30
- 'cfg-centrifugo-monitor-channel',
31
- () => Fetchers.getCentrifugoMonitorChannelsRetrieve(client)
32
- )
33
- }
34
-
35
-
@@ -1,22 +0,0 @@
1
- import * as Models from "./models";
2
-
3
-
4
- /**
5
- * API endpoints for Centrifugo.
6
- */
7
- export class CfgCentrifugo {
8
- private client: any;
9
-
10
- constructor(client: any) {
11
- this.client = client;
12
- }
13
-
14
- /**
15
- * Get statistics per channel.
16
- */
17
- async monitorChannelsRetrieve(): Promise<Models.Publish> {
18
- const response = await this.client.request('GET', "/cfg/centrifugo/monitor/channels/");
19
- return response;
20
- }
21
-
22
- }
@@ -1,2 +0,0 @@
1
- export * from "./client";
2
- export * as Models from "./models";
@@ -1,19 +0,0 @@
1
- /**
2
- * Single publish item for DRF pagination.
3
- *
4
- * Response model (includes read-only fields).
5
- */
6
- export interface Publish {
7
- message_id: string;
8
- channel: string;
9
- status: string;
10
- wait_for_ack: boolean;
11
- acks_received: number;
12
- acks_expected: number;
13
- duration_ms: number | null;
14
- created_at: string;
15
- completed_at: string | null;
16
- error_code: string | null;
17
- error_message: string | null;
18
- }
19
-