@djangocfg/api 1.2.21 → 1.2.22
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 +5029 -2249
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4267 -278
- package/dist/index.d.ts +4267 -278
- package/dist/index.mjs +4672 -1905
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_config.ts +48 -0
- package/src/cfg/generated/_utils/fetchers/cfg__grpc__grpc_configuration.ts +63 -0
- package/src/cfg/generated/_utils/fetchers/cfg__grpc__grpc_services.ts +77 -0
- package/src/cfg/generated/_utils/fetchers/cfg__grpc__grpc_testing.ts +79 -0
- package/src/cfg/generated/_utils/fetchers/index.ts +4 -0
- package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_config.ts +36 -0
- package/src/cfg/generated/_utils/hooks/cfg__grpc__grpc_configuration.ts +51 -0
- package/src/cfg/generated/_utils/hooks/cfg__grpc__grpc_services.ts +65 -0
- package/src/cfg/generated/_utils/hooks/cfg__grpc__grpc_testing.ts +71 -0
- package/src/cfg/generated/_utils/hooks/index.ts +4 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoConfig.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/ConfigData.schema.ts +27 -0
- package/src/cfg/generated/_utils/schemas/ConfigMeta.schema.ts +20 -0
- package/src/cfg/generated/_utils/schemas/ConfigValidation.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/DRFConfig.schema.ts +20 -0
- package/src/cfg/generated/_utils/schemas/DatabaseConfig.schema.ts +31 -0
- package/src/cfg/generated/_utils/schemas/DjangoConfig.schema.ts +86 -0
- package/src/cfg/generated/_utils/schemas/DjangoRQConfig.schema.ts +19 -0
- package/src/cfg/generated/_utils/schemas/EmailConfig.schema.ts +28 -0
- package/src/cfg/generated/_utils/schemas/GRPCCallRequestRequest.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/GRPCCallResponse.schema.ts +29 -0
- package/src/cfg/generated/_utils/schemas/GRPCConfig.schema.ts +26 -0
- package/src/cfg/generated/_utils/schemas/GRPCConfigDashboard.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/GRPCExampleSerializer.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/GRPCExamplesList.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/GRPCFeaturesSerializer.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/GRPCFrameworkConfigSerializer.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/GRPCInterceptorInfoSerializer.schema.ts +20 -0
- package/src/cfg/generated/_utils/schemas/GRPCServerConfigSerializer.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/GRPCServerInfo.schema.ts +28 -0
- package/src/cfg/generated/_utils/schemas/GRPCServiceInfoSerializer.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/GRPCStatsSerializer.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/GRPCTestLogSerializer.schema.ts +27 -0
- package/src/cfg/generated/_utils/schemas/GRPCTestLogs.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/JWTConfig.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/MethodInfoSerializer.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/MethodSummarySerializer.schema.ts +25 -0
- package/src/cfg/generated/_utils/schemas/PaymentsConfig.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/PaymentsNowPayments.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/RecentErrorSerializer.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/RedisQueueConfig.schema.ts +29 -0
- package/src/cfg/generated/_utils/schemas/ServiceDetail.schema.ts +31 -0
- package/src/cfg/generated/_utils/schemas/ServiceMethods.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/SpectacularConfig.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/index.ts +34 -0
- package/src/cfg/generated/cfg__dashboard__dashboard_config/client.ts +25 -0
- package/src/cfg/generated/cfg__dashboard__dashboard_config/index.ts +2 -0
- package/src/cfg/generated/cfg__dashboard__dashboard_config/models.ts +215 -0
- package/src/cfg/generated/cfg__grpc__grpc_configuration/client.ts +35 -0
- package/src/cfg/generated/cfg__grpc__grpc_configuration/index.ts +2 -0
- package/src/cfg/generated/cfg__grpc__grpc_configuration/models.ts +128 -0
- package/src/cfg/generated/cfg__grpc__grpc_services/client.ts +55 -0
- package/src/cfg/generated/cfg__grpc__grpc_services/index.ts +2 -0
- package/src/cfg/generated/cfg__grpc__grpc_services/models.ts +138 -0
- package/src/cfg/generated/cfg__grpc__grpc_testing/client.ts +68 -0
- package/src/cfg/generated/cfg__grpc__grpc_testing/index.ts +2 -0
- package/src/cfg/generated/cfg__grpc__grpc_testing/models.ts +122 -0
- package/src/cfg/generated/client.ts +12 -0
- package/src/cfg/generated/index.ts +20 -0
- package/src/cfg/generated/schema.ts +7133 -5116
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@djangocfg/api",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.22",
|
|
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.22",
|
|
72
72
|
"react": "^19.1.0",
|
|
73
73
|
"react-dom": "^19.1.0",
|
|
74
74
|
"tsup": "^8.5.0",
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed fetchers for Dashboard - Config
|
|
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 { ConfigDataSchema, type ConfigData } from '../schemas/ConfigData.schema'
|
|
33
|
+
import { getAPIInstance } from '../../api-instance'
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Get configuration data
|
|
37
|
+
*
|
|
38
|
+
* @method GET
|
|
39
|
+
* @path /cfg/dashboard/api/config/config/
|
|
40
|
+
*/
|
|
41
|
+
export async function getDashboardApiConfigConfigRetrieve( client?: any
|
|
42
|
+
): Promise<ConfigData> {
|
|
43
|
+
const api = client || getAPIInstance()
|
|
44
|
+
const response = await api.cfg_dashboard_config.dashboardApiConfigConfigRetrieve()
|
|
45
|
+
return ConfigDataSchema.parse(response)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed fetchers for Grpc Configuration
|
|
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 { GRPCConfigSchema, type GRPCConfig } from '../schemas/GRPCConfig.schema'
|
|
33
|
+
import { GRPCServerInfoSchema, type GRPCServerInfo } from '../schemas/GRPCServerInfo.schema'
|
|
34
|
+
import { getAPIInstance } from '../../api-instance'
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Get gRPC configuration
|
|
38
|
+
*
|
|
39
|
+
* @method GET
|
|
40
|
+
* @path /cfg/grpc/config/config/
|
|
41
|
+
*/
|
|
42
|
+
export async function getGrpcConfigConfigRetrieve( client?: any
|
|
43
|
+
): Promise<GRPCConfig> {
|
|
44
|
+
const api = client || getAPIInstance()
|
|
45
|
+
const response = await api.cfg_grpc_configuration.grpcConfigConfigRetrieve()
|
|
46
|
+
return GRPCConfigSchema.parse(response)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Get server information
|
|
52
|
+
*
|
|
53
|
+
* @method GET
|
|
54
|
+
* @path /cfg/grpc/config/server-info/
|
|
55
|
+
*/
|
|
56
|
+
export async function getGrpcConfigServerInfoRetrieve( client?: any
|
|
57
|
+
): Promise<GRPCServerInfo> {
|
|
58
|
+
const api = client || getAPIInstance()
|
|
59
|
+
const response = await api.cfg_grpc_configuration.grpcConfigServerInfoRetrieve()
|
|
60
|
+
return GRPCServerInfoSchema.parse(response)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed fetchers for Grpc Services
|
|
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 { ServiceDetailSchema, type ServiceDetail } from '../schemas/ServiceDetail.schema'
|
|
33
|
+
import { ServiceMethodsSchema, type ServiceMethods } from '../schemas/ServiceMethods.schema'
|
|
34
|
+
import { getAPIInstance } from '../../api-instance'
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* List all services
|
|
38
|
+
*
|
|
39
|
+
* @method GET
|
|
40
|
+
* @path /cfg/grpc/services/
|
|
41
|
+
*/
|
|
42
|
+
export async function getGrpcServicesList( params?: { hours?: number }, client?: any
|
|
43
|
+
): Promise<any> {
|
|
44
|
+
const api = client || getAPIInstance()
|
|
45
|
+
const response = await api.cfg_grpc_services.list(params?.hours)
|
|
46
|
+
return response
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Get service details
|
|
52
|
+
*
|
|
53
|
+
* @method GET
|
|
54
|
+
* @path /cfg/grpc/services/{id}/
|
|
55
|
+
*/
|
|
56
|
+
export async function getGrpcServicesRetrieve( id: string, pk: string, client?: any
|
|
57
|
+
): Promise<ServiceDetail> {
|
|
58
|
+
const api = client || getAPIInstance()
|
|
59
|
+
const response = await api.cfg_grpc_services.retrieve(id, pk)
|
|
60
|
+
return ServiceDetailSchema.parse(response)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Get service methods
|
|
66
|
+
*
|
|
67
|
+
* @method GET
|
|
68
|
+
* @path /cfg/grpc/services/{id}/methods/
|
|
69
|
+
*/
|
|
70
|
+
export async function getGrpcServicesMethodsRetrieve( id: string, pk: string, client?: any
|
|
71
|
+
): Promise<ServiceMethods> {
|
|
72
|
+
const api = client || getAPIInstance()
|
|
73
|
+
const response = await api.cfg_grpc_services.methodsRetrieve(id, pk)
|
|
74
|
+
return ServiceMethodsSchema.parse(response)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed fetchers for Grpc Testing
|
|
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 { GRPCCallRequestRequestSchema, type GRPCCallRequestRequest } from '../schemas/GRPCCallRequestRequest.schema'
|
|
33
|
+
import { GRPCCallResponseSchema, type GRPCCallResponse } from '../schemas/GRPCCallResponse.schema'
|
|
34
|
+
import { GRPCExamplesListSchema, type GRPCExamplesList } from '../schemas/GRPCExamplesList.schema'
|
|
35
|
+
import { GRPCTestLogsSchema, type GRPCTestLogs } from '../schemas/GRPCTestLogs.schema'
|
|
36
|
+
import { getAPIInstance } from '../../api-instance'
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Call gRPC method (placeholder)
|
|
40
|
+
*
|
|
41
|
+
* @method POST
|
|
42
|
+
* @path /cfg/grpc/test/call/
|
|
43
|
+
*/
|
|
44
|
+
export async function createGrpcTestCallCreate( data: GRPCCallRequestRequest, client?: any
|
|
45
|
+
): Promise<GRPCCallResponse> {
|
|
46
|
+
const api = client || getAPIInstance()
|
|
47
|
+
const response = await api.cfg_grpc_testing.grpcTestCallCreate(data)
|
|
48
|
+
return GRPCCallResponseSchema.parse(response)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Get example payloads
|
|
54
|
+
*
|
|
55
|
+
* @method GET
|
|
56
|
+
* @path /cfg/grpc/test/examples/
|
|
57
|
+
*/
|
|
58
|
+
export async function getGrpcTestExamplesRetrieve( params?: { method?: string; service?: string }, client?: any
|
|
59
|
+
): Promise<GRPCExamplesList> {
|
|
60
|
+
const api = client || getAPIInstance()
|
|
61
|
+
const response = await api.cfg_grpc_testing.grpcTestExamplesRetrieve(params?.method, params?.service)
|
|
62
|
+
return GRPCExamplesListSchema.parse(response)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Get test logs
|
|
68
|
+
*
|
|
69
|
+
* @method GET
|
|
70
|
+
* @path /cfg/grpc/test/logs/
|
|
71
|
+
*/
|
|
72
|
+
export async function getGrpcTestLogsRetrieve( params?: { limit?: number; method?: string; offset?: number; service?: string; status?: string }, client?: any
|
|
73
|
+
): Promise<GRPCTestLogs> {
|
|
74
|
+
const api = client || getAPIInstance()
|
|
75
|
+
const response = await api.cfg_grpc_testing.grpcTestLogsRetrieve(params?.limit, params?.method, params?.offset, params?.service, params?.status)
|
|
76
|
+
return GRPCTestLogsSchema.parse(response)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
|
|
@@ -36,11 +36,15 @@ export * from './cfg__dashboard__dashboard_activity'
|
|
|
36
36
|
export * from './cfg__dashboard__dashboard_api_zones'
|
|
37
37
|
export * from './cfg__dashboard__dashboard_charts'
|
|
38
38
|
export * from './cfg__dashboard__dashboard_commands'
|
|
39
|
+
export * from './cfg__dashboard__dashboard_config'
|
|
39
40
|
export * from './cfg__dashboard__dashboard_overview'
|
|
40
41
|
export * from './cfg__dashboard__dashboard_statistics'
|
|
41
42
|
export * from './cfg__dashboard__dashboard_system'
|
|
42
43
|
export * from './cfg__endpoints'
|
|
44
|
+
export * from './cfg__grpc__grpc_configuration'
|
|
43
45
|
export * from './cfg__grpc__grpc_monitoring'
|
|
46
|
+
export * from './cfg__grpc__grpc_services'
|
|
47
|
+
export * from './cfg__grpc__grpc_testing'
|
|
44
48
|
export * from './cfg__health'
|
|
45
49
|
export * from './cfg__knowbase'
|
|
46
50
|
export * from './cfg__leads'
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SWR Hooks for Dashboard - Config
|
|
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_config'
|
|
20
|
+
import type { API } from '../../index'
|
|
21
|
+
import type { ConfigData } from '../schemas/ConfigData.schema'
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Get configuration data
|
|
25
|
+
*
|
|
26
|
+
* @method GET
|
|
27
|
+
* @path /cfg/dashboard/api/config/config/
|
|
28
|
+
*/
|
|
29
|
+
export function useDashboardApiConfigConfigRetrieve(client?: API): ReturnType<typeof useSWR<ConfigData>> {
|
|
30
|
+
return useSWR<ConfigData>(
|
|
31
|
+
'cfg-dashboard-api-config-config',
|
|
32
|
+
() => Fetchers.getDashboardApiConfigConfigRetrieve(client)
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SWR Hooks for Grpc Configuration
|
|
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__grpc__grpc_configuration'
|
|
20
|
+
import type { API } from '../../index'
|
|
21
|
+
import type { GRPCConfig } from '../schemas/GRPCConfig.schema'
|
|
22
|
+
import type { GRPCServerInfo } from '../schemas/GRPCServerInfo.schema'
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Get gRPC configuration
|
|
26
|
+
*
|
|
27
|
+
* @method GET
|
|
28
|
+
* @path /cfg/grpc/config/config/
|
|
29
|
+
*/
|
|
30
|
+
export function useGrpcConfigConfigRetrieve(client?: API): ReturnType<typeof useSWR<GRPCConfig>> {
|
|
31
|
+
return useSWR<GRPCConfig>(
|
|
32
|
+
'cfg-grpc-config-config',
|
|
33
|
+
() => Fetchers.getGrpcConfigConfigRetrieve(client)
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Get server information
|
|
40
|
+
*
|
|
41
|
+
* @method GET
|
|
42
|
+
* @path /cfg/grpc/config/server-info/
|
|
43
|
+
*/
|
|
44
|
+
export function useGrpcConfigServerInfoRetrieve(client?: API): ReturnType<typeof useSWR<GRPCServerInfo>> {
|
|
45
|
+
return useSWR<GRPCServerInfo>(
|
|
46
|
+
'cfg-grpc-config-server-info',
|
|
47
|
+
() => Fetchers.getGrpcConfigServerInfoRetrieve(client)
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SWR Hooks for Grpc Services
|
|
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__grpc__grpc_services'
|
|
20
|
+
import type { API } from '../../index'
|
|
21
|
+
import type { ServiceDetail } from '../schemas/ServiceDetail.schema'
|
|
22
|
+
import type { ServiceMethods } from '../schemas/ServiceMethods.schema'
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* List all services
|
|
26
|
+
*
|
|
27
|
+
* @method GET
|
|
28
|
+
* @path /cfg/grpc/services/
|
|
29
|
+
*/
|
|
30
|
+
export function useGrpcServicesList(params?: { hours?: number }, client?: API): ReturnType<typeof useSWR<any>> {
|
|
31
|
+
return useSWR<any>(
|
|
32
|
+
params ? ['cfg-grpc-services', params] : 'cfg-grpc-services',
|
|
33
|
+
() => Fetchers.getGrpcServicesList(params, client)
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Get service details
|
|
40
|
+
*
|
|
41
|
+
* @method GET
|
|
42
|
+
* @path /cfg/grpc/services/{id}/
|
|
43
|
+
*/
|
|
44
|
+
export function useGrpcServicesRetrieve(id: string, pk: string, client?: API): ReturnType<typeof useSWR<ServiceDetail>> {
|
|
45
|
+
return useSWR<ServiceDetail>(
|
|
46
|
+
['cfg-grpc-service', id],
|
|
47
|
+
() => Fetchers.getGrpcServicesRetrieve(id, pk, client)
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Get service methods
|
|
54
|
+
*
|
|
55
|
+
* @method GET
|
|
56
|
+
* @path /cfg/grpc/services/{id}/methods/
|
|
57
|
+
*/
|
|
58
|
+
export function useGrpcServicesMethodsRetrieve(id: string, pk: string, client?: API): ReturnType<typeof useSWR<ServiceMethods>> {
|
|
59
|
+
return useSWR<ServiceMethods>(
|
|
60
|
+
['cfg-grpc-services-method', id],
|
|
61
|
+
() => Fetchers.getGrpcServicesMethodsRetrieve(id, pk, client)
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SWR Hooks for Grpc Testing
|
|
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__grpc__grpc_testing'
|
|
20
|
+
import type { API } from '../../index'
|
|
21
|
+
import type { GRPCCallRequestRequest } from '../schemas/GRPCCallRequestRequest.schema'
|
|
22
|
+
import type { GRPCCallResponse } from '../schemas/GRPCCallResponse.schema'
|
|
23
|
+
import type { GRPCExamplesList } from '../schemas/GRPCExamplesList.schema'
|
|
24
|
+
import type { GRPCTestLogs } from '../schemas/GRPCTestLogs.schema'
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Call gRPC method (placeholder)
|
|
28
|
+
*
|
|
29
|
+
* @method POST
|
|
30
|
+
* @path /cfg/grpc/test/call/
|
|
31
|
+
*/
|
|
32
|
+
export function useCreateGrpcTestCallCreate() {
|
|
33
|
+
const { mutate } = useSWRConfig()
|
|
34
|
+
|
|
35
|
+
return async (data: GRPCCallRequestRequest, client?: API): Promise<GRPCCallResponse> => {
|
|
36
|
+
const result = await Fetchers.createGrpcTestCallCreate(data, client)
|
|
37
|
+
// Revalidate related queries
|
|
38
|
+
mutate('cfg-grpc-test-call')
|
|
39
|
+
return result
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Get example payloads
|
|
46
|
+
*
|
|
47
|
+
* @method GET
|
|
48
|
+
* @path /cfg/grpc/test/examples/
|
|
49
|
+
*/
|
|
50
|
+
export function useGrpcTestExamplesRetrieve(params?: { method?: string; service?: string }, client?: API): ReturnType<typeof useSWR<GRPCExamplesList>> {
|
|
51
|
+
return useSWR<GRPCExamplesList>(
|
|
52
|
+
params ? ['cfg-grpc-test-example', params] : 'cfg-grpc-test-example',
|
|
53
|
+
() => Fetchers.getGrpcTestExamplesRetrieve(params, client)
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Get test logs
|
|
60
|
+
*
|
|
61
|
+
* @method GET
|
|
62
|
+
* @path /cfg/grpc/test/logs/
|
|
63
|
+
*/
|
|
64
|
+
export function useGrpcTestLogsRetrieve(params?: { limit?: number; method?: string; offset?: number; service?: string; status?: string }, client?: API): ReturnType<typeof useSWR<GRPCTestLogs>> {
|
|
65
|
+
return useSWR<GRPCTestLogs>(
|
|
66
|
+
params ? ['cfg-grpc-test-log', params] : 'cfg-grpc-test-log',
|
|
67
|
+
() => Fetchers.getGrpcTestLogsRetrieve(params, client)
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
|
|
@@ -33,6 +33,7 @@ export * from './cfg__dashboard__dashboard_api_zones'
|
|
|
33
33
|
export * from './cfg__dashboard__dashboard_activity'
|
|
34
34
|
export * from './cfg__dashboard__dashboard_charts'
|
|
35
35
|
export * from './cfg__dashboard__dashboard_commands'
|
|
36
|
+
export * from './cfg__dashboard__dashboard_config'
|
|
36
37
|
export * from './cfg__dashboard__dashboard_overview'
|
|
37
38
|
export * from './cfg__dashboard__dashboard_statistics'
|
|
38
39
|
export * from './cfg__dashboard__dashboard_system'
|
|
@@ -52,7 +53,10 @@ export * from './cfg__accounts__user_profile'
|
|
|
52
53
|
export * from './cfg__accounts'
|
|
53
54
|
export * from './cfg__centrifugo'
|
|
54
55
|
export * from './cfg__endpoints'
|
|
56
|
+
export * from './cfg__grpc__grpc_configuration'
|
|
55
57
|
export * from './cfg__grpc__grpc_monitoring'
|
|
58
|
+
export * from './cfg__grpc__grpc_services'
|
|
59
|
+
export * from './cfg__grpc__grpc_testing'
|
|
56
60
|
export * from './cfg__health'
|
|
57
61
|
export * from './cfg__knowbase'
|
|
58
62
|
export * from './cfg__leads'
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for CentrifugoConfig
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Centrifugo configuration.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Centrifugo configuration.
|
|
11
|
+
*/
|
|
12
|
+
export const CentrifugoConfigSchema = z.object({
|
|
13
|
+
enabled: z.boolean().nullable().optional(),
|
|
14
|
+
api_url: z.string().nullable().optional(),
|
|
15
|
+
api_key: z.string().nullable().optional(),
|
|
16
|
+
token_hmac_secret_key: z.string().nullable().optional(),
|
|
17
|
+
timeout: z.int().nullable().optional(),
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Infer TypeScript type from Zod schema
|
|
22
|
+
*/
|
|
23
|
+
export type CentrifugoConfig = z.infer<typeof CentrifugoConfigSchema>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for ConfigData
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Serializer for complete config data endpoint.
|
|
6
|
+
|
|
7
|
+
Returns both DjangoConfig and Django settings with validation info.
|
|
8
|
+
* */
|
|
9
|
+
import { z } from 'zod'
|
|
10
|
+
import { ConfigValidationSchema } from './ConfigValidation.schema'
|
|
11
|
+
import { DjangoConfigSchema } from './DjangoConfig.schema'
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Serializer for complete config data endpoint.
|
|
15
|
+
|
|
16
|
+
Returns both DjangoConfig and Django settings with validation info.
|
|
17
|
+
*/
|
|
18
|
+
export const ConfigDataSchema = z.object({
|
|
19
|
+
django_config: DjangoConfigSchema,
|
|
20
|
+
django_settings: z.record(z.string(), z.any()),
|
|
21
|
+
_validation: ConfigValidationSchema,
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Infer TypeScript type from Zod schema
|
|
26
|
+
*/
|
|
27
|
+
export type ConfigData = z.infer<typeof ConfigDataSchema>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for ConfigMeta
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Config metadata.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Config metadata.
|
|
11
|
+
*/
|
|
12
|
+
export const ConfigMetaSchema = z.object({
|
|
13
|
+
config_class: z.string(),
|
|
14
|
+
secret_key_configured: z.boolean(),
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Infer TypeScript type from Zod schema
|
|
19
|
+
*/
|
|
20
|
+
export type ConfigMeta = z.infer<typeof ConfigMetaSchema>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for ConfigValidation
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Validation result for config serializer.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Validation result for config serializer.
|
|
11
|
+
*/
|
|
12
|
+
export const ConfigValidationSchema = z.object({
|
|
13
|
+
status: z.string(),
|
|
14
|
+
missing_in_serializer: z.array(z.string()),
|
|
15
|
+
extra_in_serializer: z.array(z.string()),
|
|
16
|
+
type_mismatches: z.array(z.record(z.string(), z.any())),
|
|
17
|
+
total_config_fields: z.int(),
|
|
18
|
+
total_serializer_fields: z.int(),
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Infer TypeScript type from Zod schema
|
|
23
|
+
*/
|
|
24
|
+
export type ConfigValidation = z.infer<typeof ConfigValidationSchema>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for DRFConfig
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Django REST Framework configuration.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Django REST Framework configuration.
|
|
11
|
+
*/
|
|
12
|
+
export const DRFConfigSchema = z.object({
|
|
13
|
+
default_pagination_class: z.string().nullable().optional(),
|
|
14
|
+
page_size: z.int().nullable().optional(),
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Infer TypeScript type from Zod schema
|
|
19
|
+
*/
|
|
20
|
+
export type DRFConfig = z.infer<typeof DRFConfigSchema>
|