@djangocfg/api 1.2.7 → 1.2.9

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 (28) hide show
  1. package/dist/index.cjs +1274 -2252
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +321 -1099
  4. package/dist/index.d.ts +321 -1099
  5. package/dist/index.mjs +1197 -2162
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +2 -2
  8. package/src/cfg/generated/_utils/fetchers/cfg__centrifugo.ts +0 -14
  9. package/src/cfg/generated/_utils/fetchers/cfg__centrifugo__centrifugo_admin_api.ts +0 -84
  10. package/src/cfg/generated/_utils/fetchers/cfg__centrifugo__centrifugo_monitoring.ts +0 -56
  11. package/src/cfg/generated/_utils/fetchers/cfg__centrifugo__centrifugo_testing.ts +0 -56
  12. package/src/cfg/generated/_utils/fetchers/cfg__dashboard__dashboard_commands.ts +30 -0
  13. package/src/cfg/generated/_utils/hooks/cfg__centrifugo.ts +0 -14
  14. package/src/cfg/generated/_utils/hooks/cfg__centrifugo__centrifugo_admin_api.ts +0 -108
  15. package/src/cfg/generated/_utils/hooks/cfg__centrifugo__centrifugo_monitoring.ts +0 -56
  16. package/src/cfg/generated/_utils/hooks/cfg__centrifugo__centrifugo_testing.ts +0 -72
  17. package/src/cfg/generated/_utils/hooks/cfg__dashboard__dashboard_commands.ts +34 -0
  18. package/src/cfg/generated/_utils/schemas/Command.schema.ts +2 -0
  19. package/src/cfg/generated/_utils/schemas/CommandExecuteRequestRequest.schema.ts +21 -0
  20. package/src/cfg/generated/_utils/schemas/CommandHelpResponse.schema.ts +25 -0
  21. package/src/cfg/generated/_utils/schemas/index.ts +2 -0
  22. package/src/cfg/generated/cfg__centrifugo/client.ts +0 -8
  23. package/src/cfg/generated/cfg__centrifugo__centrifugo_admin_api/client.ts +0 -61
  24. package/src/cfg/generated/cfg__centrifugo__centrifugo_monitoring/client.ts +0 -73
  25. package/src/cfg/generated/cfg__centrifugo__centrifugo_testing/client.ts +0 -43
  26. package/src/cfg/generated/cfg__dashboard__dashboard_commands/client.ts +21 -0
  27. package/src/cfg/generated/cfg__dashboard__dashboard_commands/models.ts +31 -0
  28. package/src/cfg/generated/schema.ts +256 -907
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djangocfg/api",
3
- "version": "1.2.7",
3
+ "version": "1.2.9",
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.7",
71
+ "@djangocfg/typescript-config": "^1.2.9",
72
72
  "react": "^19.1.0",
73
73
  "react-dom": "^19.1.0",
74
74
  "tsup": "^8.5.0",
@@ -31,20 +31,6 @@
31
31
  */
32
32
  import { getAPIInstance } from '../../api-instance'
33
33
 
34
- /**
35
- * API operation
36
- *
37
- * @method GET
38
- * @path /cfg/centrifugo/admin/api/monitor/channels/
39
- */
40
- export async function getCentrifugoAdminApiMonitorChannelsRetrieve( client?: any
41
- ): Promise<any> {
42
- const api = client || getAPIInstance()
43
- const response = await api.cfg_centrifugo.adminApiMonitorChannelsRetrieve()
44
- return response
45
- }
46
-
47
-
48
34
  /**
49
35
  * API operation
50
36
  *
@@ -40,90 +40,6 @@ import { CentrifugoPresenceStatsRequestRequestSchema, type CentrifugoPresenceSta
40
40
  import { CentrifugoPresenceStatsResponseSchema, type CentrifugoPresenceStatsResponse } from '../schemas/CentrifugoPresenceStatsResponse.schema'
41
41
  import { getAPIInstance } from '../../api-instance'
42
42
 
43
- /**
44
- * Get connection token for dashboard
45
- *
46
- * @method POST
47
- * @path /cfg/centrifugo/admin/api/server/auth/token/
48
- */
49
- export async function createCentrifugoAdminApiServerAuthTokenCreate( client?: any
50
- ): Promise<any> {
51
- const api = client || getAPIInstance()
52
- const response = await api.cfg_centrifugo_admin_api.serverAuthTokenCreate()
53
- return response
54
- }
55
-
56
-
57
- /**
58
- * List active channels
59
- *
60
- * @method POST
61
- * @path /cfg/centrifugo/admin/api/server/channels/
62
- */
63
- export async function createCentrifugoAdminApiServerChannelsCreate( data: CentrifugoChannelsRequestRequest, client?: any
64
- ): Promise<CentrifugoChannelsResponse> {
65
- const api = client || getAPIInstance()
66
- const response = await api.cfg_centrifugo_admin_api.serverChannelsCreate(data)
67
- return CentrifugoChannelsResponseSchema.parse(response)
68
- }
69
-
70
-
71
- /**
72
- * Get channel history
73
- *
74
- * @method POST
75
- * @path /cfg/centrifugo/admin/api/server/history/
76
- */
77
- export async function createCentrifugoAdminApiServerHistoryCreate( data: CentrifugoHistoryRequestRequest, client?: any
78
- ): Promise<CentrifugoHistoryResponse> {
79
- const api = client || getAPIInstance()
80
- const response = await api.cfg_centrifugo_admin_api.serverHistoryCreate(data)
81
- return CentrifugoHistoryResponseSchema.parse(response)
82
- }
83
-
84
-
85
- /**
86
- * Get Centrifugo server info
87
- *
88
- * @method POST
89
- * @path /cfg/centrifugo/admin/api/server/info/
90
- */
91
- export async function createCentrifugoAdminApiServerInfoCreate( client?: any
92
- ): Promise<CentrifugoInfoResponse> {
93
- const api = client || getAPIInstance()
94
- const response = await api.cfg_centrifugo_admin_api.serverInfoCreate()
95
- return CentrifugoInfoResponseSchema.parse(response)
96
- }
97
-
98
-
99
- /**
100
- * Get channel presence
101
- *
102
- * @method POST
103
- * @path /cfg/centrifugo/admin/api/server/presence/
104
- */
105
- export async function createCentrifugoAdminApiServerPresenceCreate( data: CentrifugoPresenceRequestRequest, client?: any
106
- ): Promise<CentrifugoPresenceResponse> {
107
- const api = client || getAPIInstance()
108
- const response = await api.cfg_centrifugo_admin_api.serverPresenceCreate(data)
109
- return CentrifugoPresenceResponseSchema.parse(response)
110
- }
111
-
112
-
113
- /**
114
- * Get channel presence statistics
115
- *
116
- * @method POST
117
- * @path /cfg/centrifugo/admin/api/server/presence-stats/
118
- */
119
- export async function createCentrifugoAdminApiServerPresenceStatsCreate( data: CentrifugoPresenceStatsRequestRequest, client?: any
120
- ): Promise<CentrifugoPresenceStatsResponse> {
121
- const api = client || getAPIInstance()
122
- const response = await api.cfg_centrifugo_admin_api.serverPresenceStatsCreate(data)
123
- return CentrifugoPresenceStatsResponseSchema.parse(response)
124
- }
125
-
126
-
127
43
  /**
128
44
  * Get connection token for dashboard
129
45
  *
@@ -35,62 +35,6 @@ import { OverviewStatsSchema, type OverviewStats } from '../schemas/OverviewStat
35
35
  import { RecentPublishesSchema, type RecentPublishes } from '../schemas/RecentPublishes.schema'
36
36
  import { getAPIInstance } from '../../api-instance'
37
37
 
38
- /**
39
- * Get Centrifugo health status
40
- *
41
- * @method GET
42
- * @path /cfg/centrifugo/admin/api/monitor/health/
43
- */
44
- export async function getCentrifugoAdminApiMonitorHealthRetrieve( client?: any
45
- ): Promise<HealthCheck> {
46
- const api = client || getAPIInstance()
47
- const response = await api.cfg_centrifugo_monitoring.centrifugoAdminApiMonitorHealthRetrieve()
48
- return HealthCheckSchema.parse(response)
49
- }
50
-
51
-
52
- /**
53
- * Get overview statistics
54
- *
55
- * @method GET
56
- * @path /cfg/centrifugo/admin/api/monitor/overview/
57
- */
58
- export async function getCentrifugoAdminApiMonitorOverviewRetrieve( params?: { hours?: number }, client?: any
59
- ): Promise<OverviewStats> {
60
- const api = client || getAPIInstance()
61
- const response = await api.cfg_centrifugo_monitoring.centrifugoAdminApiMonitorOverviewRetrieve(params?.hours)
62
- return OverviewStatsSchema.parse(response)
63
- }
64
-
65
-
66
- /**
67
- * Get recent publishes
68
- *
69
- * @method GET
70
- * @path /cfg/centrifugo/admin/api/monitor/publishes/
71
- */
72
- export async function getCentrifugoAdminApiMonitorPublishesRetrieve( params?: { channel?: string; count?: number; offset?: number; status?: string }, client?: any
73
- ): Promise<RecentPublishes> {
74
- const api = client || getAPIInstance()
75
- const response = await api.cfg_centrifugo_monitoring.centrifugoAdminApiMonitorPublishesRetrieve(params?.channel, params?.count, params?.offset, params?.status)
76
- return RecentPublishesSchema.parse(response)
77
- }
78
-
79
-
80
- /**
81
- * Get channel statistics
82
- *
83
- * @method GET
84
- * @path /cfg/centrifugo/admin/api/monitor/timeline/
85
- */
86
- export async function getCentrifugoAdminApiMonitorTimelineRetrieve( params?: { hours?: number; interval?: string }, client?: any
87
- ): Promise<ChannelList> {
88
- const api = client || getAPIInstance()
89
- const response = await api.cfg_centrifugo_monitoring.centrifugoAdminApiMonitorTimelineRetrieve(params?.hours, params?.interval)
90
- return ChannelListSchema.parse(response)
91
- }
92
-
93
-
94
38
  /**
95
39
  * Get Centrifugo health status
96
40
  *
@@ -37,62 +37,6 @@ import { PublishTestRequestRequestSchema, type PublishTestRequestRequest } from
37
37
  import { PublishTestResponseSchema, type PublishTestResponse } from '../schemas/PublishTestResponse.schema'
38
38
  import { getAPIInstance } from '../../api-instance'
39
39
 
40
- /**
41
- * Generate connection token
42
- *
43
- * @method POST
44
- * @path /cfg/centrifugo/admin/api/testing/connection-token/
45
- */
46
- export async function createCentrifugoAdminApiTestingConnectionTokenCreate( data: ConnectionTokenRequestRequest, client?: any
47
- ): Promise<ConnectionTokenResponse> {
48
- const api = client || getAPIInstance()
49
- const response = await api.cfg_centrifugo_testing.centrifugoAdminApiTestingConnectionTokenCreate(data)
50
- return ConnectionTokenResponseSchema.parse(response)
51
- }
52
-
53
-
54
- /**
55
- * Publish test message
56
- *
57
- * @method POST
58
- * @path /cfg/centrifugo/admin/api/testing/publish-test/
59
- */
60
- export async function createCentrifugoAdminApiTestingPublishTestCreate( data: PublishTestRequestRequest, client?: any
61
- ): Promise<PublishTestResponse> {
62
- const api = client || getAPIInstance()
63
- const response = await api.cfg_centrifugo_testing.centrifugoAdminApiTestingPublishTestCreate(data)
64
- return PublishTestResponseSchema.parse(response)
65
- }
66
-
67
-
68
- /**
69
- * Publish with database logging
70
- *
71
- * @method POST
72
- * @path /cfg/centrifugo/admin/api/testing/publish-with-logging/
73
- */
74
- export async function createCentrifugoAdminApiTestingPublishWithLoggingCreate( data: PublishTestRequestRequest, client?: any
75
- ): Promise<PublishTestResponse> {
76
- const api = client || getAPIInstance()
77
- const response = await api.cfg_centrifugo_testing.centrifugoAdminApiTestingPublishWithLoggingCreate(data)
78
- return PublishTestResponseSchema.parse(response)
79
- }
80
-
81
-
82
- /**
83
- * Send manual ACK
84
- *
85
- * @method POST
86
- * @path /cfg/centrifugo/admin/api/testing/send-ack/
87
- */
88
- export async function createCentrifugoAdminApiTestingSendAckCreate( data: ManualAckRequestRequest, client?: any
89
- ): Promise<ManualAckResponse> {
90
- const api = client || getAPIInstance()
91
- const response = await api.cfg_centrifugo_testing.centrifugoAdminApiTestingSendAckCreate(data)
92
- return ManualAckResponseSchema.parse(response)
93
- }
94
-
95
-
96
40
  /**
97
41
  * Generate connection token
98
42
  *
@@ -29,6 +29,8 @@
29
29
  * const users = await getUsers({ page: 1 }, api)
30
30
  * ```
31
31
  */
32
+ import { CommandExecuteRequestRequestSchema, type CommandExecuteRequestRequest } from '../schemas/CommandExecuteRequestRequest.schema'
33
+ import { CommandHelpResponseSchema, type CommandHelpResponse } from '../schemas/CommandHelpResponse.schema'
32
34
  import { CommandsSummarySchema, type CommandsSummary } from '../schemas/CommandsSummary.schema'
33
35
  import { getAPIInstance } from '../../api-instance'
34
36
 
@@ -46,6 +48,34 @@ export async function getDashboardApiCommandsList( client?: any
46
48
  }
47
49
 
48
50
 
51
+ /**
52
+ * Get command help
53
+ *
54
+ * @method GET
55
+ * @path /cfg/dashboard/api/commands/{id}/help/
56
+ */
57
+ export async function getDashboardApiCommandsHelpRetrieve( id: string, client?: any
58
+ ): Promise<CommandHelpResponse> {
59
+ const api = client || getAPIInstance()
60
+ const response = await api.cfg_dashboard_commands.dashboardApiCommandsHelpRetrieve(id)
61
+ return CommandHelpResponseSchema.parse(response)
62
+ }
63
+
64
+
65
+ /**
66
+ * Execute command
67
+ *
68
+ * @method POST
69
+ * @path /cfg/dashboard/api/commands/execute/
70
+ */
71
+ export async function createDashboardApiCommandsExecuteCreate( data: CommandExecuteRequestRequest, client?: any
72
+ ): Promise<any> {
73
+ const api = client || getAPIInstance()
74
+ const response = await api.cfg_dashboard_commands.dashboardApiCommandsExecuteCreate(data)
75
+ return response
76
+ }
77
+
78
+
49
79
  /**
50
80
  * Get commands summary
51
81
  *
@@ -19,20 +19,6 @@ import { useSWRConfig } from 'swr'
19
19
  import * as Fetchers from '../fetchers/cfg__centrifugo'
20
20
  import type { API } from '../../index'
21
21
 
22
- /**
23
- * API operation
24
- *
25
- * @method GET
26
- * @path /cfg/centrifugo/admin/api/monitor/channels/
27
- */
28
- export function useCentrifugoAdminApiMonitorChannelsRetrieve(client?: API): ReturnType<typeof useSWR<any>> {
29
- return useSWR<any>(
30
- 'cfg-centrifugo-admin-api-monitor-channel',
31
- () => Fetchers.getCentrifugoAdminApiMonitorChannelsRetrieve(client)
32
- )
33
- }
34
-
35
-
36
22
  /**
37
23
  * API operation
38
24
  *
@@ -28,114 +28,6 @@ import type { CentrifugoPresenceResponse } from '../schemas/CentrifugoPresenceRe
28
28
  import type { CentrifugoPresenceStatsRequestRequest } from '../schemas/CentrifugoPresenceStatsRequestRequest.schema'
29
29
  import type { CentrifugoPresenceStatsResponse } from '../schemas/CentrifugoPresenceStatsResponse.schema'
30
30
 
31
- /**
32
- * Get connection token for dashboard
33
- *
34
- * @method POST
35
- * @path /cfg/centrifugo/admin/api/server/auth/token/
36
- */
37
- export function useCreateCentrifugoAdminApiServerAuthTokenCreate() {
38
- const { mutate } = useSWRConfig()
39
-
40
- return async (client?: API): Promise<any> => {
41
- const result = await Fetchers.createCentrifugoAdminApiServerAuthTokenCreate(client)
42
- // Revalidate related queries
43
- mutate('cfg-centrifugo-admin-api-server-auth-token')
44
- return result
45
- }
46
- }
47
-
48
-
49
- /**
50
- * List active channels
51
- *
52
- * @method POST
53
- * @path /cfg/centrifugo/admin/api/server/channels/
54
- */
55
- export function useCreateCentrifugoAdminApiServerChannelsCreate() {
56
- const { mutate } = useSWRConfig()
57
-
58
- return async (data: CentrifugoChannelsRequestRequest, client?: API): Promise<CentrifugoChannelsResponse> => {
59
- const result = await Fetchers.createCentrifugoAdminApiServerChannelsCreate(data, client)
60
- // Revalidate related queries
61
- mutate('cfg-centrifugo-admin-api-server-channels')
62
- return result
63
- }
64
- }
65
-
66
-
67
- /**
68
- * Get channel history
69
- *
70
- * @method POST
71
- * @path /cfg/centrifugo/admin/api/server/history/
72
- */
73
- export function useCreateCentrifugoAdminApiServerHistoryCreate() {
74
- const { mutate } = useSWRConfig()
75
-
76
- return async (data: CentrifugoHistoryRequestRequest, client?: API): Promise<CentrifugoHistoryResponse> => {
77
- const result = await Fetchers.createCentrifugoAdminApiServerHistoryCreate(data, client)
78
- // Revalidate related queries
79
- mutate('cfg-centrifugo-admin-api-server-history')
80
- return result
81
- }
82
- }
83
-
84
-
85
- /**
86
- * Get Centrifugo server info
87
- *
88
- * @method POST
89
- * @path /cfg/centrifugo/admin/api/server/info/
90
- */
91
- export function useCreateCentrifugoAdminApiServerInfoCreate() {
92
- const { mutate } = useSWRConfig()
93
-
94
- return async (client?: API): Promise<CentrifugoInfoResponse> => {
95
- const result = await Fetchers.createCentrifugoAdminApiServerInfoCreate(client)
96
- // Revalidate related queries
97
- mutate('cfg-centrifugo-admin-api-server-info')
98
- return result
99
- }
100
- }
101
-
102
-
103
- /**
104
- * Get channel presence
105
- *
106
- * @method POST
107
- * @path /cfg/centrifugo/admin/api/server/presence/
108
- */
109
- export function useCreateCentrifugoAdminApiServerPresenceCreate() {
110
- const { mutate } = useSWRConfig()
111
-
112
- return async (data: CentrifugoPresenceRequestRequest, client?: API): Promise<CentrifugoPresenceResponse> => {
113
- const result = await Fetchers.createCentrifugoAdminApiServerPresenceCreate(data, client)
114
- // Revalidate related queries
115
- mutate('cfg-centrifugo-admin-api-server-presence')
116
- return result
117
- }
118
- }
119
-
120
-
121
- /**
122
- * Get channel presence statistics
123
- *
124
- * @method POST
125
- * @path /cfg/centrifugo/admin/api/server/presence-stats/
126
- */
127
- export function useCreateCentrifugoAdminApiServerPresenceStatsCreate() {
128
- const { mutate } = useSWRConfig()
129
-
130
- return async (data: CentrifugoPresenceStatsRequestRequest, client?: API): Promise<CentrifugoPresenceStatsResponse> => {
131
- const result = await Fetchers.createCentrifugoAdminApiServerPresenceStatsCreate(data, client)
132
- // Revalidate related queries
133
- mutate('cfg-centrifugo-admin-api-server-presence-stats')
134
- return result
135
- }
136
- }
137
-
138
-
139
31
  /**
140
32
  * Get connection token for dashboard
141
33
  *
@@ -23,62 +23,6 @@ import type { HealthCheck } from '../schemas/HealthCheck.schema'
23
23
  import type { OverviewStats } from '../schemas/OverviewStats.schema'
24
24
  import type { RecentPublishes } from '../schemas/RecentPublishes.schema'
25
25
 
26
- /**
27
- * Get Centrifugo health status
28
- *
29
- * @method GET
30
- * @path /cfg/centrifugo/admin/api/monitor/health/
31
- */
32
- export function useCentrifugoAdminApiMonitorHealthRetrieve(client?: API): ReturnType<typeof useSWR<HealthCheck>> {
33
- return useSWR<HealthCheck>(
34
- 'cfg-centrifugo-admin-api-monitor-health',
35
- () => Fetchers.getCentrifugoAdminApiMonitorHealthRetrieve(client)
36
- )
37
- }
38
-
39
-
40
- /**
41
- * Get overview statistics
42
- *
43
- * @method GET
44
- * @path /cfg/centrifugo/admin/api/monitor/overview/
45
- */
46
- export function useCentrifugoAdminApiMonitorOverviewRetrieve(params?: { hours?: number }, client?: API): ReturnType<typeof useSWR<OverviewStats>> {
47
- return useSWR<OverviewStats>(
48
- params ? ['cfg-centrifugo-admin-api-monitor-overview', params] : 'cfg-centrifugo-admin-api-monitor-overview',
49
- () => Fetchers.getCentrifugoAdminApiMonitorOverviewRetrieve(params, client)
50
- )
51
- }
52
-
53
-
54
- /**
55
- * Get recent publishes
56
- *
57
- * @method GET
58
- * @path /cfg/centrifugo/admin/api/monitor/publishes/
59
- */
60
- export function useCentrifugoAdminApiMonitorPublishesRetrieve(params?: { channel?: string; count?: number; offset?: number; status?: string }, client?: API): ReturnType<typeof useSWR<RecentPublishes>> {
61
- return useSWR<RecentPublishes>(
62
- params ? ['cfg-centrifugo-admin-api-monitor-publishe', params] : 'cfg-centrifugo-admin-api-monitor-publishe',
63
- () => Fetchers.getCentrifugoAdminApiMonitorPublishesRetrieve(params, client)
64
- )
65
- }
66
-
67
-
68
- /**
69
- * Get channel statistics
70
- *
71
- * @method GET
72
- * @path /cfg/centrifugo/admin/api/monitor/timeline/
73
- */
74
- export function useCentrifugoAdminApiMonitorTimelineRetrieve(params?: { hours?: number; interval?: string }, client?: API): ReturnType<typeof useSWR<ChannelList>> {
75
- return useSWR<ChannelList>(
76
- params ? ['cfg-centrifugo-admin-api-monitor-timeline', params] : 'cfg-centrifugo-admin-api-monitor-timeline',
77
- () => Fetchers.getCentrifugoAdminApiMonitorTimelineRetrieve(params, client)
78
- )
79
- }
80
-
81
-
82
26
  /**
83
27
  * Get Centrifugo health status
84
28
  *
@@ -25,78 +25,6 @@ import type { ManualAckResponse } from '../schemas/ManualAckResponse.schema'
25
25
  import type { PublishTestRequestRequest } from '../schemas/PublishTestRequestRequest.schema'
26
26
  import type { PublishTestResponse } from '../schemas/PublishTestResponse.schema'
27
27
 
28
- /**
29
- * Generate connection token
30
- *
31
- * @method POST
32
- * @path /cfg/centrifugo/admin/api/testing/connection-token/
33
- */
34
- export function useCreateCentrifugoAdminApiTestingConnectionTokenCreate() {
35
- const { mutate } = useSWRConfig()
36
-
37
- return async (data: ConnectionTokenRequestRequest, client?: API): Promise<ConnectionTokenResponse> => {
38
- const result = await Fetchers.createCentrifugoAdminApiTestingConnectionTokenCreate(data, client)
39
- // Revalidate related queries
40
- mutate('cfg-centrifugo-admin-api-testing-connection-token')
41
- return result
42
- }
43
- }
44
-
45
-
46
- /**
47
- * Publish test message
48
- *
49
- * @method POST
50
- * @path /cfg/centrifugo/admin/api/testing/publish-test/
51
- */
52
- export function useCreateCentrifugoAdminApiTestingPublishTestCreate() {
53
- const { mutate } = useSWRConfig()
54
-
55
- return async (data: PublishTestRequestRequest, client?: API): Promise<PublishTestResponse> => {
56
- const result = await Fetchers.createCentrifugoAdminApiTestingPublishTestCreate(data, client)
57
- // Revalidate related queries
58
- mutate('cfg-centrifugo-admin-api-testing-publish-test')
59
- return result
60
- }
61
- }
62
-
63
-
64
- /**
65
- * Publish with database logging
66
- *
67
- * @method POST
68
- * @path /cfg/centrifugo/admin/api/testing/publish-with-logging/
69
- */
70
- export function useCreateCentrifugoAdminApiTestingPublishWithLoggingCreate() {
71
- const { mutate } = useSWRConfig()
72
-
73
- return async (data: PublishTestRequestRequest, client?: API): Promise<PublishTestResponse> => {
74
- const result = await Fetchers.createCentrifugoAdminApiTestingPublishWithLoggingCreate(data, client)
75
- // Revalidate related queries
76
- mutate('cfg-centrifugo-admin-api-testing-publish-with-logging')
77
- return result
78
- }
79
- }
80
-
81
-
82
- /**
83
- * Send manual ACK
84
- *
85
- * @method POST
86
- * @path /cfg/centrifugo/admin/api/testing/send-ack/
87
- */
88
- export function useCreateCentrifugoAdminApiTestingSendAckCreate() {
89
- const { mutate } = useSWRConfig()
90
-
91
- return async (data: ManualAckRequestRequest, client?: API): Promise<ManualAckResponse> => {
92
- const result = await Fetchers.createCentrifugoAdminApiTestingSendAckCreate(data, client)
93
- // Revalidate related queries
94
- mutate('cfg-centrifugo-admin-api-testing-send-ack')
95
- return result
96
- }
97
- }
98
-
99
-
100
28
  /**
101
29
  * Generate connection token
102
30
  *
@@ -18,6 +18,8 @@ import useSWR from 'swr'
18
18
  import { useSWRConfig } from 'swr'
19
19
  import * as Fetchers from '../fetchers/cfg__dashboard__dashboard_commands'
20
20
  import type { API } from '../../index'
21
+ import type { CommandExecuteRequestRequest } from '../schemas/CommandExecuteRequestRequest.schema'
22
+ import type { CommandHelpResponse } from '../schemas/CommandHelpResponse.schema'
21
23
  import type { CommandsSummary } from '../schemas/CommandsSummary.schema'
22
24
 
23
25
  /**
@@ -34,6 +36,38 @@ export function useDashboardApiCommandsList(client?: API): ReturnType<typeof use
34
36
  }
35
37
 
36
38
 
39
+ /**
40
+ * Get command help
41
+ *
42
+ * @method GET
43
+ * @path /cfg/dashboard/api/commands/{id}/help/
44
+ */
45
+ export function useDashboardApiCommandsHelpRetrieve(id: string, client?: API): ReturnType<typeof useSWR<CommandHelpResponse>> {
46
+ return useSWR<CommandHelpResponse>(
47
+ ['cfg-dashboard-api-commands-help', id],
48
+ () => Fetchers.getDashboardApiCommandsHelpRetrieve(id, client)
49
+ )
50
+ }
51
+
52
+
53
+ /**
54
+ * Execute command
55
+ *
56
+ * @method POST
57
+ * @path /cfg/dashboard/api/commands/execute/
58
+ */
59
+ export function useCreateDashboardApiCommandsExecuteCreate() {
60
+ const { mutate } = useSWRConfig()
61
+
62
+ return async (data: CommandExecuteRequestRequest, client?: API): Promise<any> => {
63
+ const result = await Fetchers.createDashboardApiCommandsExecuteCreate(data, client)
64
+ // Revalidate related queries
65
+ mutate('cfg-dashboard-api-commands-execute')
66
+ return result
67
+ }
68
+ }
69
+
70
+
37
71
  /**
38
72
  * Get commands summary
39
73
  *
@@ -15,6 +15,8 @@ export const CommandSchema = z.object({
15
15
  help: z.string(),
16
16
  is_core: z.boolean(),
17
17
  is_custom: z.boolean(),
18
+ is_allowed: z.boolean().optional(),
19
+ risk_level: z.string().optional(),
18
20
  })
19
21
 
20
22
  /**
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Zod schema for CommandExecuteRequestRequest
3
+ *
4
+ * This schema provides runtime validation and type inference.
5
+ * * Request serializer for command execution.
6
+ * */
7
+ import { z } from 'zod'
8
+
9
+ /**
10
+ * Request serializer for command execution.
11
+ */
12
+ export const CommandExecuteRequestRequestSchema = z.object({
13
+ command: z.string().min(1),
14
+ args: z.array(z.string().min(1)).optional(),
15
+ options: z.record(z.string(), z.any()).optional(),
16
+ })
17
+
18
+ /**
19
+ * Infer TypeScript type from Zod schema
20
+ */
21
+ export type CommandExecuteRequestRequest = z.infer<typeof CommandExecuteRequestRequestSchema>
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Zod schema for CommandHelpResponse
3
+ *
4
+ * This schema provides runtime validation and type inference.
5
+ * * Response serializer for command help.
6
+ * */
7
+ import { z } from 'zod'
8
+
9
+ /**
10
+ * Response serializer for command help.
11
+ */
12
+ export const CommandHelpResponseSchema = z.object({
13
+ status: z.string(),
14
+ command: z.string(),
15
+ app: z.string().optional(),
16
+ help_text: z.string().optional(),
17
+ is_allowed: z.boolean().optional(),
18
+ risk_level: z.string().optional(),
19
+ error: z.string().optional(),
20
+ })
21
+
22
+ /**
23
+ * Infer TypeScript type from Zod schema
24
+ */
25
+ export type CommandHelpResponse = z.infer<typeof CommandHelpResponseSchema>