attio-js
Version:
Developer-friendly & type-safe JS/TS SDK based on the official OpenAPI spec of Attio.
73 lines • 2.8 kB
TypeScript
import * as z from "zod";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
import { Comment, Comment$Outbound } from "./comment.js";
export type ThreadId = {
/**
* The ID of the workspace the thread belongs to.
*/
workspaceId: string;
/**
* The ID of the thread.
*/
threadId: string;
};
export type Thread = {
id: ThreadId;
/**
* An array of comments in the thread, sorted by `created_at`.
*/
comments: Array<Comment>;
/**
* When the thread was created.
*/
createdAt: string;
};
/** @internal */
export declare const ThreadId$inboundSchema: z.ZodType<ThreadId, z.ZodTypeDef, unknown>;
/** @internal */
export type ThreadId$Outbound = {
workspace_id: string;
thread_id: string;
};
/** @internal */
export declare const ThreadId$outboundSchema: z.ZodType<ThreadId$Outbound, z.ZodTypeDef, ThreadId>;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export declare namespace ThreadId$ {
/** @deprecated use `ThreadId$inboundSchema` instead. */
const inboundSchema: z.ZodType<ThreadId, z.ZodTypeDef, unknown>;
/** @deprecated use `ThreadId$outboundSchema` instead. */
const outboundSchema: z.ZodType<ThreadId$Outbound, z.ZodTypeDef, ThreadId>;
/** @deprecated use `ThreadId$Outbound` instead. */
type Outbound = ThreadId$Outbound;
}
export declare function threadIdToJSON(threadId: ThreadId): string;
export declare function threadIdFromJSON(jsonString: string): SafeParseResult<ThreadId, SDKValidationError>;
/** @internal */
export declare const Thread$inboundSchema: z.ZodType<Thread, z.ZodTypeDef, unknown>;
/** @internal */
export type Thread$Outbound = {
id: ThreadId$Outbound;
comments: Array<Comment$Outbound>;
created_at: string;
};
/** @internal */
export declare const Thread$outboundSchema: z.ZodType<Thread$Outbound, z.ZodTypeDef, Thread>;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export declare namespace Thread$ {
/** @deprecated use `Thread$inboundSchema` instead. */
const inboundSchema: z.ZodType<Thread, z.ZodTypeDef, unknown>;
/** @deprecated use `Thread$outboundSchema` instead. */
const outboundSchema: z.ZodType<Thread$Outbound, z.ZodTypeDef, Thread>;
/** @deprecated use `Thread$Outbound` instead. */
type Outbound = Thread$Outbound;
}
export declare function threadToJSON(thread: Thread): string;
export declare function threadFromJSON(jsonString: string): SafeParseResult<Thread, SDKValidationError>;
//# sourceMappingURL=thread.d.ts.map