@djangocfg/api 1.2.4 → 1.2.5
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 +6912 -5124
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6992 -4881
- package/dist/index.d.ts +6992 -4881
- package/dist/index.mjs +7024 -5247
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/cfg/generated/_utils/fetchers/cfg__centrifugo__centrifugo_admin_api.ts +211 -0
- package/src/cfg/generated/_utils/fetchers/cfg__centrifugo__centrifugo_monitoring.ts +150 -0
- package/src/cfg/generated/_utils/fetchers/cfg__centrifugo__centrifugo_testing.ts +152 -0
- package/src/cfg/generated/_utils/fetchers/index.ts +3 -2
- package/src/cfg/generated/_utils/hooks/cfg__centrifugo__centrifugo_admin_api.ts +246 -0
- package/src/cfg/generated/_utils/hooks/cfg__centrifugo__centrifugo_monitoring.ts +137 -0
- package/src/cfg/generated/_utils/hooks/cfg__centrifugo__centrifugo_testing.ts +171 -0
- package/src/cfg/generated/_utils/hooks/index.ts +3 -2
- package/src/cfg/generated/_utils/schemas/CentrifugoChannelInfo.schema.ts +19 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoChannelsRequestRequest.schema.ts +19 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoChannelsResponse.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoChannelsResult.schema.ts +19 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoClientInfo.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoError.schema.ts +20 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoHistoryRequestRequest.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoHistoryResponse.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoHistoryResult.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoInfoResponse.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoInfoResult.schema.ts +20 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoMetrics.schema.ts +20 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoNodeInfo.schema.ts +30 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoPresenceRequestRequest.schema.ts +19 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoPresenceResponse.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoPresenceResult.schema.ts +19 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoPresenceStatsRequestRequest.schema.ts +19 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoPresenceStatsResponse.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoPresenceStatsResult.schema.ts +20 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoProcess.schema.ts +20 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoPublication.schema.ts +23 -0
- package/src/cfg/generated/_utils/schemas/CentrifugoStreamPosition.schema.ts +20 -0
- package/src/cfg/generated/_utils/schemas/ChannelList.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/ChannelStatsSerializer.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/ConnectionTokenRequestRequest.schema.ts +20 -0
- package/src/cfg/generated/_utils/schemas/ConnectionTokenResponse.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/HealthCheck.schema.ts +5 -7
- package/src/cfg/generated/_utils/schemas/ManualAckRequestRequest.schema.ts +20 -0
- package/src/cfg/generated/_utils/schemas/ManualAckResponse.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/OverviewStats.schema.ts +9 -12
- package/src/cfg/generated/_utils/schemas/PublishTestRequestRequest.schema.ts +22 -0
- package/src/cfg/generated/_utils/schemas/PublishTestResponse.schema.ts +24 -0
- package/src/cfg/generated/_utils/schemas/RecentPublishes.schema.ts +21 -0
- package/src/cfg/generated/_utils/schemas/index.ts +31 -10
- package/src/cfg/generated/cfg__centrifugo__centrifugo_admin_api/client.ts +136 -0
- package/src/cfg/generated/cfg__centrifugo__centrifugo_admin_api/models.ts +256 -0
- package/src/cfg/generated/cfg__centrifugo__centrifugo_monitoring/client.ts +160 -0
- package/src/cfg/generated/cfg__centrifugo__centrifugo_monitoring/models.ts +86 -0
- package/src/cfg/generated/cfg__centrifugo__centrifugo_testing/client.ts +100 -0
- package/src/cfg/generated/cfg__centrifugo__centrifugo_testing/index.ts +2 -0
- package/src/cfg/generated/cfg__centrifugo__centrifugo_testing/models.ts +88 -0
- package/src/cfg/generated/cfg__health/models.ts +7 -11
- package/src/cfg/generated/client.ts +9 -6
- package/src/cfg/generated/index.ts +15 -10
- package/src/cfg/generated/schema.ts +4463 -3169
- package/src/cfg/generated/_utils/fetchers/cfg__ipc__ipcrpc_monitoring.ts +0 -179
- package/src/cfg/generated/_utils/fetchers/cfg__ipc__ipcrpc_testing.ts +0 -151
- package/src/cfg/generated/_utils/hooks/cfg__ipc__ipcrpc_monitoring.ts +0 -166
- package/src/cfg/generated/_utils/hooks/cfg__ipc__ipcrpc_testing.ts +0 -162
- package/src/cfg/generated/_utils/schemas/LoadTestRequestRequest.schema.ts +0 -22
- package/src/cfg/generated/_utils/schemas/LoadTestResponse.schema.ts +0 -21
- package/src/cfg/generated/_utils/schemas/LoadTestStatus.schema.ts +0 -27
- package/src/cfg/generated/_utils/schemas/MethodStat.schema.ts +0 -25
- package/src/cfg/generated/_utils/schemas/MethodStats.schema.ts +0 -22
- package/src/cfg/generated/_utils/schemas/NotificationStats.schema.ts +0 -25
- package/src/cfg/generated/_utils/schemas/RPCRequest.schema.ts +0 -25
- package/src/cfg/generated/_utils/schemas/RecentRequests.schema.ts +0 -22
- package/src/cfg/generated/_utils/schemas/TestRPCRequestRequest.schema.ts +0 -21
- package/src/cfg/generated/_utils/schemas/TestRPCResponse.schema.ts +0 -23
- package/src/cfg/generated/cfg__ipc__ipcrpc_monitoring/client.ts +0 -136
- package/src/cfg/generated/cfg__ipc__ipcrpc_monitoring/models.ts +0 -144
- package/src/cfg/generated/cfg__ipc__ipcrpc_testing/client.ts +0 -96
- package/src/cfg/generated/cfg__ipc__ipcrpc_testing/models.ts +0 -88
- /package/src/cfg/generated/{cfg__ipc__ipcrpc_monitoring → cfg__centrifugo__centrifugo_admin_api}/index.ts +0 -0
- /package/src/cfg/generated/{cfg__ipc__ipcrpc_testing → cfg__centrifugo__centrifugo_monitoring}/index.ts +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for CentrifugoHistoryRequestRequest
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Request to get channel history.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
import { CentrifugoStreamPositionSchema } from './CentrifugoStreamPosition.schema'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Request to get channel history.
|
|
12
|
+
*/
|
|
13
|
+
export const CentrifugoHistoryRequestRequestSchema = z.object({
|
|
14
|
+
channel: z.string(),
|
|
15
|
+
limit: z.string().optional(),
|
|
16
|
+
since: CentrifugoStreamPositionSchema.optional(),
|
|
17
|
+
reverse: z.string().optional(),
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Infer TypeScript type from Zod schema
|
|
22
|
+
*/
|
|
23
|
+
export type CentrifugoHistoryRequestRequest = z.infer<typeof CentrifugoHistoryRequestRequestSchema>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for CentrifugoHistoryResponse
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Channel history response.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
import { CentrifugoErrorSchema } from './CentrifugoError.schema'
|
|
9
|
+
import { CentrifugoHistoryResultSchema } from './CentrifugoHistoryResult.schema'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Channel history response.
|
|
13
|
+
*/
|
|
14
|
+
export const CentrifugoHistoryResponseSchema = z.object({
|
|
15
|
+
error: CentrifugoErrorSchema.optional(),
|
|
16
|
+
result: CentrifugoHistoryResultSchema.optional(),
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Infer TypeScript type from Zod schema
|
|
21
|
+
*/
|
|
22
|
+
export type CentrifugoHistoryResponse = z.infer<typeof CentrifugoHistoryResponseSchema>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for CentrifugoHistoryResult
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * History result wrapper.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
import { CentrifugoPublicationSchema } from './CentrifugoPublication.schema'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* History result wrapper.
|
|
12
|
+
*/
|
|
13
|
+
export const CentrifugoHistoryResultSchema = z.object({
|
|
14
|
+
publications: z.array(CentrifugoPublicationSchema),
|
|
15
|
+
epoch: z.string(),
|
|
16
|
+
offset: z.int(),
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Infer TypeScript type from Zod schema
|
|
21
|
+
*/
|
|
22
|
+
export type CentrifugoHistoryResult = z.infer<typeof CentrifugoHistoryResultSchema>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for CentrifugoInfoResponse
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Server info response.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
import { CentrifugoErrorSchema } from './CentrifugoError.schema'
|
|
9
|
+
import { CentrifugoInfoResultSchema } from './CentrifugoInfoResult.schema'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Server info response.
|
|
13
|
+
*/
|
|
14
|
+
export const CentrifugoInfoResponseSchema = z.object({
|
|
15
|
+
error: CentrifugoErrorSchema.optional(),
|
|
16
|
+
result: CentrifugoInfoResultSchema.optional(),
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Infer TypeScript type from Zod schema
|
|
21
|
+
*/
|
|
22
|
+
export type CentrifugoInfoResponse = z.infer<typeof CentrifugoInfoResponseSchema>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for CentrifugoInfoResult
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Info result wrapper.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
import { CentrifugoNodeInfoSchema } from './CentrifugoNodeInfo.schema'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Info result wrapper.
|
|
12
|
+
*/
|
|
13
|
+
export const CentrifugoInfoResultSchema = z.object({
|
|
14
|
+
nodes: z.array(CentrifugoNodeInfoSchema),
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Infer TypeScript type from Zod schema
|
|
19
|
+
*/
|
|
20
|
+
export type CentrifugoInfoResult = z.infer<typeof CentrifugoInfoResultSchema>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for CentrifugoMetrics
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Server metrics.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Server metrics.
|
|
11
|
+
*/
|
|
12
|
+
export const CentrifugoMetricsSchema = z.object({
|
|
13
|
+
interval: z.number(),
|
|
14
|
+
items: z.record(z.string(), z.any()),
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Infer TypeScript type from Zod schema
|
|
19
|
+
*/
|
|
20
|
+
export type CentrifugoMetrics = z.infer<typeof CentrifugoMetricsSchema>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for CentrifugoNodeInfo
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Information about a single Centrifugo node.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
import { CentrifugoMetricsSchema } from './CentrifugoMetrics.schema'
|
|
9
|
+
import { CentrifugoProcessSchema } from './CentrifugoProcess.schema'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Information about a single Centrifugo node.
|
|
13
|
+
*/
|
|
14
|
+
export const CentrifugoNodeInfoSchema = z.object({
|
|
15
|
+
uid: z.string(),
|
|
16
|
+
name: z.string(),
|
|
17
|
+
version: z.string(),
|
|
18
|
+
num_clients: z.int(),
|
|
19
|
+
num_users: z.int(),
|
|
20
|
+
num_channels: z.int(),
|
|
21
|
+
uptime: z.int(),
|
|
22
|
+
num_subs: z.int(),
|
|
23
|
+
metrics: CentrifugoMetricsSchema.optional(),
|
|
24
|
+
process: CentrifugoProcessSchema.optional(),
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Infer TypeScript type from Zod schema
|
|
29
|
+
*/
|
|
30
|
+
export type CentrifugoNodeInfo = z.infer<typeof CentrifugoNodeInfoSchema>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for CentrifugoPresenceRequestRequest
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Request to get channel presence.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Request to get channel presence.
|
|
11
|
+
*/
|
|
12
|
+
export const CentrifugoPresenceRequestRequestSchema = z.object({
|
|
13
|
+
channel: z.string(),
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Infer TypeScript type from Zod schema
|
|
18
|
+
*/
|
|
19
|
+
export type CentrifugoPresenceRequestRequest = z.infer<typeof CentrifugoPresenceRequestRequestSchema>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for CentrifugoPresenceResponse
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Channel presence response.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
import { CentrifugoErrorSchema } from './CentrifugoError.schema'
|
|
9
|
+
import { CentrifugoPresenceResultSchema } from './CentrifugoPresenceResult.schema'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Channel presence response.
|
|
13
|
+
*/
|
|
14
|
+
export const CentrifugoPresenceResponseSchema = z.object({
|
|
15
|
+
error: CentrifugoErrorSchema.optional(),
|
|
16
|
+
result: CentrifugoPresenceResultSchema.optional(),
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Infer TypeScript type from Zod schema
|
|
21
|
+
*/
|
|
22
|
+
export type CentrifugoPresenceResponse = z.infer<typeof CentrifugoPresenceResponseSchema>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for CentrifugoPresenceResult
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Presence result wrapper.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Presence result wrapper.
|
|
11
|
+
*/
|
|
12
|
+
export const CentrifugoPresenceResultSchema = z.object({
|
|
13
|
+
presence: z.record(z.string(), z.any()),
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Infer TypeScript type from Zod schema
|
|
18
|
+
*/
|
|
19
|
+
export type CentrifugoPresenceResult = z.infer<typeof CentrifugoPresenceResultSchema>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for CentrifugoPresenceStatsRequestRequest
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Request to get channel presence statistics.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Request to get channel presence statistics.
|
|
11
|
+
*/
|
|
12
|
+
export const CentrifugoPresenceStatsRequestRequestSchema = z.object({
|
|
13
|
+
channel: z.string(),
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Infer TypeScript type from Zod schema
|
|
18
|
+
*/
|
|
19
|
+
export type CentrifugoPresenceStatsRequestRequest = z.infer<typeof CentrifugoPresenceStatsRequestRequestSchema>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for CentrifugoPresenceStatsResponse
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Channel presence stats response.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
import { CentrifugoErrorSchema } from './CentrifugoError.schema'
|
|
9
|
+
import { CentrifugoPresenceStatsResultSchema } from './CentrifugoPresenceStatsResult.schema'
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Channel presence stats response.
|
|
13
|
+
*/
|
|
14
|
+
export const CentrifugoPresenceStatsResponseSchema = z.object({
|
|
15
|
+
error: CentrifugoErrorSchema.optional(),
|
|
16
|
+
result: CentrifugoPresenceStatsResultSchema.optional(),
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Infer TypeScript type from Zod schema
|
|
21
|
+
*/
|
|
22
|
+
export type CentrifugoPresenceStatsResponse = z.infer<typeof CentrifugoPresenceStatsResponseSchema>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for CentrifugoPresenceStatsResult
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Presence stats result.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Presence stats result.
|
|
11
|
+
*/
|
|
12
|
+
export const CentrifugoPresenceStatsResultSchema = z.object({
|
|
13
|
+
num_clients: z.int(),
|
|
14
|
+
num_users: z.int(),
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Infer TypeScript type from Zod schema
|
|
19
|
+
*/
|
|
20
|
+
export type CentrifugoPresenceStatsResult = z.infer<typeof CentrifugoPresenceStatsResultSchema>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for CentrifugoProcess
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Process information.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Process information.
|
|
11
|
+
*/
|
|
12
|
+
export const CentrifugoProcessSchema = z.object({
|
|
13
|
+
cpu: z.number(),
|
|
14
|
+
rss: z.int(),
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Infer TypeScript type from Zod schema
|
|
19
|
+
*/
|
|
20
|
+
export type CentrifugoProcess = z.infer<typeof CentrifugoProcessSchema>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for CentrifugoPublication
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Single publication (message) in channel history.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
import { CentrifugoClientInfoSchema } from './CentrifugoClientInfo.schema'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Single publication (message) in channel history.
|
|
12
|
+
*/
|
|
13
|
+
export const CentrifugoPublicationSchema = z.object({
|
|
14
|
+
data: z.record(z.string(), z.any()),
|
|
15
|
+
info: CentrifugoClientInfoSchema.optional(),
|
|
16
|
+
offset: z.int(),
|
|
17
|
+
tags: z.string().optional(),
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Infer TypeScript type from Zod schema
|
|
22
|
+
*/
|
|
23
|
+
export type CentrifugoPublication = z.infer<typeof CentrifugoPublicationSchema>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for CentrifugoStreamPosition
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Stream position for pagination.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Stream position for pagination.
|
|
11
|
+
*/
|
|
12
|
+
export const CentrifugoStreamPositionSchema = z.object({
|
|
13
|
+
offset: z.int(),
|
|
14
|
+
epoch: z.string(),
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Infer TypeScript type from Zod schema
|
|
19
|
+
*/
|
|
20
|
+
export type CentrifugoStreamPosition = z.infer<typeof CentrifugoStreamPositionSchema>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for ChannelList
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * List of channel statistics.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
import { ChannelStatsSerializerSchema } from './ChannelStatsSerializer.schema'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* List of channel statistics.
|
|
12
|
+
*/
|
|
13
|
+
export const ChannelListSchema = z.object({
|
|
14
|
+
channels: z.array(ChannelStatsSerializerSchema),
|
|
15
|
+
total_channels: z.int(),
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Infer TypeScript type from Zod schema
|
|
20
|
+
*/
|
|
21
|
+
export type ChannelList = z.infer<typeof ChannelListSchema>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for ChannelStatsSerializer
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Statistics per channel.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Statistics per channel.
|
|
11
|
+
*/
|
|
12
|
+
export const ChannelStatsSerializerSchema = z.object({
|
|
13
|
+
channel: z.string(),
|
|
14
|
+
total: z.int(),
|
|
15
|
+
successful: z.int(),
|
|
16
|
+
failed: z.int(),
|
|
17
|
+
avg_duration_ms: z.number(),
|
|
18
|
+
avg_acks: z.number(),
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Infer TypeScript type from Zod schema
|
|
23
|
+
*/
|
|
24
|
+
export type ChannelStatsSerializer = z.infer<typeof ChannelStatsSerializerSchema>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for ConnectionTokenRequestRequest
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Request model for connection token generation.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Request model for connection token generation.
|
|
11
|
+
*/
|
|
12
|
+
export const ConnectionTokenRequestRequestSchema = z.object({
|
|
13
|
+
user_id: z.string(),
|
|
14
|
+
channels: z.array(z.string()).optional(),
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Infer TypeScript type from Zod schema
|
|
19
|
+
*/
|
|
20
|
+
export type ConnectionTokenRequestRequest = z.infer<typeof ConnectionTokenRequestRequestSchema>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for ConnectionTokenResponse
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Response model for connection token.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Response model for connection token.
|
|
11
|
+
*/
|
|
12
|
+
export const ConnectionTokenResponseSchema = z.object({
|
|
13
|
+
token: z.string(),
|
|
14
|
+
centrifugo_url: z.string(),
|
|
15
|
+
expires_at: z.string(),
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Infer TypeScript type from Zod schema
|
|
20
|
+
*/
|
|
21
|
+
export type ConnectionTokenResponse = z.infer<typeof ConnectionTokenResponseSchema>
|
|
@@ -2,20 +2,18 @@
|
|
|
2
2
|
* Zod schema for HealthCheck
|
|
3
3
|
*
|
|
4
4
|
* This schema provides runtime validation and type inference.
|
|
5
|
-
* *
|
|
5
|
+
* * Health check response.
|
|
6
6
|
* */
|
|
7
7
|
import { z } from 'zod'
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Health check response.
|
|
11
11
|
*/
|
|
12
12
|
export const HealthCheckSchema = z.object({
|
|
13
13
|
status: z.string(),
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
checks: z.record(z.string(), z.any()),
|
|
18
|
-
environment: z.record(z.string(), z.any()),
|
|
14
|
+
wrapper_url: z.string(),
|
|
15
|
+
has_api_key: z.boolean(),
|
|
16
|
+
timestamp: z.string(),
|
|
19
17
|
})
|
|
20
18
|
|
|
21
19
|
/**
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for ManualAckRequestRequest
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Request model for manual ACK sending.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Request model for manual ACK sending.
|
|
11
|
+
*/
|
|
12
|
+
export const ManualAckRequestRequestSchema = z.object({
|
|
13
|
+
message_id: z.string(),
|
|
14
|
+
client_id: z.string(),
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Infer TypeScript type from Zod schema
|
|
19
|
+
*/
|
|
20
|
+
export type ManualAckRequestRequest = z.infer<typeof ManualAckRequestRequestSchema>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for ManualAckResponse
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Response model for manual ACK.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Response model for manual ACK.
|
|
11
|
+
*/
|
|
12
|
+
export const ManualAckResponseSchema = z.object({
|
|
13
|
+
success: z.boolean(),
|
|
14
|
+
message_id: z.string(),
|
|
15
|
+
error: z.string().optional(),
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Infer TypeScript type from Zod schema
|
|
20
|
+
*/
|
|
21
|
+
export type ManualAckResponse = z.infer<typeof ManualAckResponseSchema>
|
|
@@ -2,25 +2,22 @@
|
|
|
2
2
|
* Zod schema for OverviewStats
|
|
3
3
|
*
|
|
4
4
|
* This schema provides runtime validation and type inference.
|
|
5
|
-
* *
|
|
5
|
+
* * Overview statistics for Centrifugo publishes.
|
|
6
6
|
* */
|
|
7
7
|
import { z } from 'zod'
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Overview statistics for Centrifugo publishes.
|
|
11
11
|
*/
|
|
12
12
|
export const OverviewStatsSchema = z.object({
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
top_method: z.string().nullable().optional(),
|
|
18
|
-
method_counts: z.record(z.string(), z.any()).optional(),
|
|
19
|
-
avg_response_time_ms: z.number(),
|
|
13
|
+
total: z.int(),
|
|
14
|
+
successful: z.int(),
|
|
15
|
+
failed: z.int(),
|
|
16
|
+
timeout: z.int(),
|
|
20
17
|
success_rate: z.number(),
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
avg_duration_ms: z.number(),
|
|
19
|
+
avg_acks_received: z.number(),
|
|
20
|
+
period_hours: z.int(),
|
|
24
21
|
})
|
|
25
22
|
|
|
26
23
|
/**
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for PublishTestRequestRequest
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Request model for test message publishing.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Request model for test message publishing.
|
|
11
|
+
*/
|
|
12
|
+
export const PublishTestRequestRequestSchema = z.object({
|
|
13
|
+
channel: z.string(),
|
|
14
|
+
data: z.record(z.string(), z.any()),
|
|
15
|
+
wait_for_ack: z.boolean().optional(),
|
|
16
|
+
ack_timeout: z.int().min(1.0).max(60.0).optional(),
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Infer TypeScript type from Zod schema
|
|
21
|
+
*/
|
|
22
|
+
export type PublishTestRequestRequest = z.infer<typeof PublishTestRequestRequestSchema>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for PublishTestResponse
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Response model for test message publishing.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Response model for test message publishing.
|
|
11
|
+
*/
|
|
12
|
+
export const PublishTestResponseSchema = z.object({
|
|
13
|
+
success: z.boolean(),
|
|
14
|
+
message_id: z.string(),
|
|
15
|
+
channel: z.string(),
|
|
16
|
+
acks_received: z.int().optional(),
|
|
17
|
+
delivered: z.boolean().optional(),
|
|
18
|
+
error: z.string().optional(),
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Infer TypeScript type from Zod schema
|
|
23
|
+
*/
|
|
24
|
+
export type PublishTestResponse = z.infer<typeof PublishTestResponseSchema>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema for RecentPublishes
|
|
3
|
+
*
|
|
4
|
+
* This schema provides runtime validation and type inference.
|
|
5
|
+
* * Recent publishes list.
|
|
6
|
+
* */
|
|
7
|
+
import { z } from 'zod'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Recent publishes list.
|
|
11
|
+
*/
|
|
12
|
+
export const RecentPublishesSchema = z.object({
|
|
13
|
+
publishes: z.array(z.record(z.string(), z.any())),
|
|
14
|
+
count: z.int(),
|
|
15
|
+
total_available: z.int(),
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Infer TypeScript type from Zod schema
|
|
20
|
+
*/
|
|
21
|
+
export type RecentPublishes = z.infer<typeof RecentPublishesSchema>
|