/
githubmirror
/
novu
Обзор
Документация
Войти
/
githubmirror
/
novu
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
next
libs/internal-sdk/src/models/operations/agentreplycontrollerhandleagentreplyhandler.ts
139 строк
4 KB
Dima Grossman
feat(api-service): expose agent reply OpenAPI shapes and SDK examples fixes NV-8285 (#11927)
15 июл 2026, 11:37
Не верифицирован
15 июл 2026, 11:37
59f9cbd
Код
Авторство
О чём код?
/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type AgentReplyControllerHandleAgentReplyHandlerRequest = { /** * Agent identifier (slug) for the agent that owns the conversation. */ agentId: string; /** * A header for idempotency purposes */ idempotencyKey?: string | undefined; /** * Reply payload. Provide at least one action: `reply`, `edit`, `resolve`, `signals`, `toolResults`, `toolApprovalRequest`, `addReactions`, `deleteMessages`, `typing`, or `error`. See named examples for common shapes used by server-side SDKs. */ agentReplyPayloadDto: components.AgentReplyPayloadDto; }; /** * OK. When a reply or edit is delivered, `data` contains the platform message identifiers. Side-effect-only requests (typing, reactions, deletes, signals without an outbound message) return `data: null`. */ export type AgentReplyControllerHandleAgentReplyHandlerResponseBody = { /** * Platform-native message id of the delivered or edited message (e.g. Slack `ts`, Teams activity id). */ messageId: string; /** * Platform-native thread / conversation id where the message was delivered. */ platformThreadId: string; }; export type AgentReplyControllerHandleAgentReplyHandlerResponse = { headers: { [k: string]: Array<string> }; result: AgentReplyControllerHandleAgentReplyHandlerResponseBody; }; /** @internal */ export type AgentReplyControllerHandleAgentReplyHandlerRequest$Outbound = { agentId: string; "idempotency-key"?: string | undefined; AgentReplyPayloadDto: components.AgentReplyPayloadDto$Outbound; }; /** @internal */ export const AgentReplyControllerHandleAgentReplyHandlerRequest$outboundSchema: z.ZodType< AgentReplyControllerHandleAgentReplyHandlerRequest$Outbound, z.ZodTypeDef, AgentReplyControllerHandleAgentReplyHandlerRequest > = z.object({ agentId: z.string(), idempotencyKey: z.string().optional(), agentReplyPayloadDto: components.AgentReplyPayloadDto$outboundSchema, }).transform((v) => { return remap$(v, { idempotencyKey: "idempotency-key", agentReplyPayloadDto: "AgentReplyPayloadDto", }); }); export function agentReplyControllerHandleAgentReplyHandlerRequestToJSON( agentReplyControllerHandleAgentReplyHandlerRequest: AgentReplyControllerHandleAgentReplyHandlerRequest, ): string { return JSON.stringify( AgentReplyControllerHandleAgentReplyHandlerRequest$outboundSchema.parse( agentReplyControllerHandleAgentReplyHandlerRequest, ), ); } /** @internal */ export const AgentReplyControllerHandleAgentReplyHandlerResponseBody$inboundSchema: z.ZodType< AgentReplyControllerHandleAgentReplyHandlerResponseBody, z.ZodTypeDef, unknown > = z.object({ messageId: z.string(), platformThreadId: z.string(), }); export function agentReplyControllerHandleAgentReplyHandlerResponseBodyFromJSON( jsonString: string, ): SafeParseResult< AgentReplyControllerHandleAgentReplyHandlerResponseBody, SDKValidationError > { return safeParse( jsonString, (x) => AgentReplyControllerHandleAgentReplyHandlerResponseBody$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'AgentReplyControllerHandleAgentReplyHandlerResponseBody' from JSON`, ); } /** @internal */ export const AgentReplyControllerHandleAgentReplyHandlerResponse$inboundSchema: z.ZodType< AgentReplyControllerHandleAgentReplyHandlerResponse, z.ZodTypeDef, unknown > = z.object({ Headers: z.record(z.array(z.string())).default({}), Result: z.lazy(() => AgentReplyControllerHandleAgentReplyHandlerResponseBody$inboundSchema ), }).transform((v) => { return remap$(v, { "Headers": "headers", "Result": "result", }); }); export function agentReplyControllerHandleAgentReplyHandlerResponseFromJSON( jsonString: string, ): SafeParseResult< AgentReplyControllerHandleAgentReplyHandlerResponse, SDKValidationError > { return safeParse( jsonString, (x) => AgentReplyControllerHandleAgentReplyHandlerResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AgentReplyControllerHandleAgentReplyHandlerResponse' from JSON`, ); }