UNPKG

attio-js

Version:

Developer-friendly & type-safe JS/TS SDK based on the official OpenAPI spec of Attio.

171 lines 6.41 kB
import * as z from "zod"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type NoteId = { /** * The ID of the workspace the note belongs to. */ workspaceId: string; /** * The ID of the note. */ noteId: string; }; /** * The type of actor. [Read more information on actor types here](/docs/actors). */ export declare const NoteType: { readonly ApiToken: "api-token"; readonly WorkspaceMember: "workspace-member"; readonly System: "system"; readonly App: "app"; }; /** * The type of actor. [Read more information on actor types here](/docs/actors). */ export type NoteType = ClosedEnum<typeof NoteType>; /** * The actor that created this note. */ export type NoteCreatedByActor = { /** * An ID to identify the actor. */ id?: string | null | undefined; /** * The type of actor. [Read more information on actor types here](/docs/actors). */ type?: NoteType | null | undefined; }; export type Note = { id: NoteId; /** * The slug or ID of the parent object the note belongs to. */ parentObject: string; /** * The ID of the parent record the note belongs to. */ parentRecordId: string; /** * The note title. The title is plaintext only and has no formatting. */ title: string; /** * The plaintext representation of the note content. The line feed character `\n` represents new lines within the note content. */ contentPlaintext: string; /** * The markdown representation of the note content with formatting applied based on block types and styles. */ contentMarkdown: string; /** * The actor that created this note. */ createdByActor: NoteCreatedByActor; /** * When the note was created. */ createdAt: string; }; /** @internal */ export declare const NoteId$inboundSchema: z.ZodType<NoteId, z.ZodTypeDef, unknown>; /** @internal */ export type NoteId$Outbound = { workspace_id: string; note_id: string; }; /** @internal */ export declare const NoteId$outboundSchema: z.ZodType<NoteId$Outbound, z.ZodTypeDef, NoteId>; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace NoteId$ { /** @deprecated use `NoteId$inboundSchema` instead. */ const inboundSchema: z.ZodType<NoteId, z.ZodTypeDef, unknown>; /** @deprecated use `NoteId$outboundSchema` instead. */ const outboundSchema: z.ZodType<NoteId$Outbound, z.ZodTypeDef, NoteId>; /** @deprecated use `NoteId$Outbound` instead. */ type Outbound = NoteId$Outbound; } export declare function noteIdToJSON(noteId: NoteId): string; export declare function noteIdFromJSON(jsonString: string): SafeParseResult<NoteId, SDKValidationError>; /** @internal */ export declare const NoteType$inboundSchema: z.ZodNativeEnum<typeof NoteType>; /** @internal */ export declare const NoteType$outboundSchema: z.ZodNativeEnum<typeof NoteType>; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace NoteType$ { /** @deprecated use `NoteType$inboundSchema` instead. */ const inboundSchema: z.ZodNativeEnum<{ readonly ApiToken: "api-token"; readonly WorkspaceMember: "workspace-member"; readonly System: "system"; readonly App: "app"; }>; /** @deprecated use `NoteType$outboundSchema` instead. */ const outboundSchema: z.ZodNativeEnum<{ readonly ApiToken: "api-token"; readonly WorkspaceMember: "workspace-member"; readonly System: "system"; readonly App: "app"; }>; } /** @internal */ export declare const NoteCreatedByActor$inboundSchema: z.ZodType<NoteCreatedByActor, z.ZodTypeDef, unknown>; /** @internal */ export type NoteCreatedByActor$Outbound = { id?: string | null | undefined; type?: string | null | undefined; }; /** @internal */ export declare const NoteCreatedByActor$outboundSchema: z.ZodType<NoteCreatedByActor$Outbound, z.ZodTypeDef, NoteCreatedByActor>; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace NoteCreatedByActor$ { /** @deprecated use `NoteCreatedByActor$inboundSchema` instead. */ const inboundSchema: z.ZodType<NoteCreatedByActor, z.ZodTypeDef, unknown>; /** @deprecated use `NoteCreatedByActor$outboundSchema` instead. */ const outboundSchema: z.ZodType<NoteCreatedByActor$Outbound, z.ZodTypeDef, NoteCreatedByActor>; /** @deprecated use `NoteCreatedByActor$Outbound` instead. */ type Outbound = NoteCreatedByActor$Outbound; } export declare function noteCreatedByActorToJSON(noteCreatedByActor: NoteCreatedByActor): string; export declare function noteCreatedByActorFromJSON(jsonString: string): SafeParseResult<NoteCreatedByActor, SDKValidationError>; /** @internal */ export declare const Note$inboundSchema: z.ZodType<Note, z.ZodTypeDef, unknown>; /** @internal */ export type Note$Outbound = { id: NoteId$Outbound; parent_object: string; parent_record_id: string; title: string; content_plaintext: string; content_markdown: string; created_by_actor: NoteCreatedByActor$Outbound; created_at: string; }; /** @internal */ export declare const Note$outboundSchema: z.ZodType<Note$Outbound, z.ZodTypeDef, Note>; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace Note$ { /** @deprecated use `Note$inboundSchema` instead. */ const inboundSchema: z.ZodType<Note, z.ZodTypeDef, unknown>; /** @deprecated use `Note$outboundSchema` instead. */ const outboundSchema: z.ZodType<Note$Outbound, z.ZodTypeDef, Note>; /** @deprecated use `Note$Outbound` instead. */ type Outbound = Note$Outbound; } export declare function noteToJSON(note: Note): string; export declare function noteFromJSON(jsonString: string): SafeParseResult<Note, SDKValidationError>; //# sourceMappingURL=note.d.ts.map