gateway: add agent.subscribe/unsubscribe protocol schema and types
This commit is contained in:
parent
76f06e0eaf
commit
d8afea2cbb
@ -42,6 +42,10 @@ import {
|
||||
AgentsListResultSchema,
|
||||
type AgentWaitParams,
|
||||
AgentWaitParamsSchema,
|
||||
type AgentSubscribeParams,
|
||||
AgentSubscribeParamsSchema,
|
||||
type AgentUnsubscribeParams,
|
||||
AgentUnsubscribeParamsSchema,
|
||||
type ChannelsLogoutParams,
|
||||
ChannelsLogoutParamsSchema,
|
||||
type TalkConfigParams,
|
||||
@ -240,6 +244,12 @@ export const validateAgentParams = ajv.compile(AgentParamsSchema);
|
||||
export const validateAgentIdentityParams =
|
||||
ajv.compile<AgentIdentityParams>(AgentIdentityParamsSchema);
|
||||
export const validateAgentWaitParams = ajv.compile<AgentWaitParams>(AgentWaitParamsSchema);
|
||||
export const validateAgentSubscribeParams = ajv.compile<AgentSubscribeParams>(
|
||||
AgentSubscribeParamsSchema,
|
||||
);
|
||||
export const validateAgentUnsubscribeParams = ajv.compile<AgentUnsubscribeParams>(
|
||||
AgentUnsubscribeParamsSchema,
|
||||
);
|
||||
export const validateWakeParams = ajv.compile<WakeParams>(WakeParamsSchema);
|
||||
export const validateAgentsListParams = ajv.compile<AgentsListParams>(AgentsListParamsSchema);
|
||||
export const validateAgentsCreateParams = ajv.compile<AgentsCreateParams>(AgentsCreateParamsSchema);
|
||||
@ -515,6 +525,8 @@ export type {
|
||||
AgentIdentityParams,
|
||||
AgentIdentityResult,
|
||||
AgentWaitParams,
|
||||
AgentSubscribeParams,
|
||||
AgentUnsubscribeParams,
|
||||
ChatEvent,
|
||||
TickEvent,
|
||||
ShutdownEvent,
|
||||
|
||||
@ -125,3 +125,18 @@ export const WakeParamsSchema = Type.Object(
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const AgentSubscribeParamsSchema = Type.Object(
|
||||
{
|
||||
sessionKey: NonEmptyString,
|
||||
afterSeq: Type.Optional(Type.Integer({ minimum: 0 })),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
export const AgentUnsubscribeParamsSchema = Type.Object(
|
||||
{
|
||||
sessionKey: NonEmptyString,
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
);
|
||||
|
||||
@ -4,6 +4,8 @@ import type {
|
||||
AgentIdentityParamsSchema,
|
||||
AgentIdentityResultSchema,
|
||||
AgentWaitParamsSchema,
|
||||
AgentSubscribeParamsSchema,
|
||||
AgentUnsubscribeParamsSchema,
|
||||
PollParamsSchema,
|
||||
WakeParamsSchema,
|
||||
} from "./agent.js";
|
||||
@ -147,6 +149,8 @@ export type AgentIdentityParams = Static<typeof AgentIdentityParamsSchema>;
|
||||
export type AgentIdentityResult = Static<typeof AgentIdentityResultSchema>;
|
||||
export type PollParams = Static<typeof PollParamsSchema>;
|
||||
export type AgentWaitParams = Static<typeof AgentWaitParamsSchema>;
|
||||
export type AgentSubscribeParams = Static<typeof AgentSubscribeParamsSchema>;
|
||||
export type AgentUnsubscribeParams = Static<typeof AgentUnsubscribeParamsSchema>;
|
||||
export type WakeParams = Static<typeof WakeParamsSchema>;
|
||||
export type NodePairRequestParams = Static<typeof NodePairRequestParamsSchema>;
|
||||
export type NodePairListParams = Static<typeof NodePairListParamsSchema>;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user