attio-js
Version:
Developer-friendly & type-safe JS/TS SDK based on the official OpenAPI spec of Attio.
321 lines • 11.9 kB
TypeScript
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 CommentId = {
/**
* The ID of the workspace the comment belongs to.
*/
workspaceId: string;
/**
* The ID of the comment.
*/
commentId: string;
};
/**
* The entry the comment belongs to, `null` for comments on records.
*/
export type Entry = {
/**
* The ID of the entry the comment belongs to.
*/
entryId: string;
/**
* The ID of the list the entry belongs to.
*/
listId: string;
};
/**
* The record the comment belongs to.
*/
export type RecordT = {
/**
* The ID of the record the comment belongs to.
*/
recordId: string;
/**
* The ID of the object the record belongs to.
*/
objectId: string;
};
/**
* The type of actor. [Read more information on actor types here](/docs/actors).
*/
export declare const ResolvedByType: {
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 ResolvedByType = ClosedEnum<typeof ResolvedByType>;
/**
* The actor that resolved this comment.
*/
export type ResolvedBy = {
/**
* An ID to identify the actor.
*/
id?: string | null | undefined;
/**
* The type of actor. [Read more information on actor types here](/docs/actors).
*/
type?: ResolvedByType | null | undefined;
};
/**
* The type of actor. [Read more information on actor types here](/docs/actors).
*/
export declare const AuthorType: {
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 AuthorType = ClosedEnum<typeof AuthorType>;
/**
* Who wrote this comment. Note that the API provides the ability for API tokens to write comments on behalf of other actors.
*/
export type Author = {
/**
* An ID to identify the actor.
*/
id?: string | null | undefined;
/**
* The type of actor. [Read more information on actor types here](/docs/actors).
*/
type?: AuthorType | null | undefined;
};
export type Comment = {
id: CommentId;
/**
* The ID of the thread the comment belongs to.
*/
threadId: string;
/**
* A plaintext representation of the content of the comment. References to workspace members are cast into email addresses, all other stylistic elements are removed.
*/
contentPlaintext: string;
/**
* The entry the comment belongs to, `null` for comments on records.
*/
entry: Entry | null;
/**
* The record the comment belongs to.
*/
record: RecordT;
/**
* Whether the comment is resolved.
*/
resolvedAt: string | null;
/**
* The actor that resolved this comment.
*/
resolvedBy: ResolvedBy;
/**
* When the note was created.
*/
createdAt: string;
/**
* Who wrote this comment. Note that the API provides the ability for API tokens to write comments on behalf of other actors.
*/
author: Author;
};
/** @internal */
export declare const CommentId$inboundSchema: z.ZodType<CommentId, z.ZodTypeDef, unknown>;
/** @internal */
export type CommentId$Outbound = {
workspace_id: string;
comment_id: string;
};
/** @internal */
export declare const CommentId$outboundSchema: z.ZodType<CommentId$Outbound, z.ZodTypeDef, CommentId>;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export declare namespace CommentId$ {
/** @deprecated use `CommentId$inboundSchema` instead. */
const inboundSchema: z.ZodType<CommentId, z.ZodTypeDef, unknown>;
/** @deprecated use `CommentId$outboundSchema` instead. */
const outboundSchema: z.ZodType<CommentId$Outbound, z.ZodTypeDef, CommentId>;
/** @deprecated use `CommentId$Outbound` instead. */
type Outbound = CommentId$Outbound;
}
export declare function commentIdToJSON(commentId: CommentId): string;
export declare function commentIdFromJSON(jsonString: string): SafeParseResult<CommentId, SDKValidationError>;
/** @internal */
export declare const Entry$inboundSchema: z.ZodType<Entry, z.ZodTypeDef, unknown>;
/** @internal */
export type Entry$Outbound = {
entry_id: string;
list_id: string;
};
/** @internal */
export declare const Entry$outboundSchema: z.ZodType<Entry$Outbound, z.ZodTypeDef, Entry>;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export declare namespace Entry$ {
/** @deprecated use `Entry$inboundSchema` instead. */
const inboundSchema: z.ZodType<Entry, z.ZodTypeDef, unknown>;
/** @deprecated use `Entry$outboundSchema` instead. */
const outboundSchema: z.ZodType<Entry$Outbound, z.ZodTypeDef, Entry>;
/** @deprecated use `Entry$Outbound` instead. */
type Outbound = Entry$Outbound;
}
export declare function entryToJSON(entry: Entry): string;
export declare function entryFromJSON(jsonString: string): SafeParseResult<Entry, SDKValidationError>;
/** @internal */
export declare const RecordT$inboundSchema: z.ZodType<RecordT, z.ZodTypeDef, unknown>;
/** @internal */
export type RecordT$Outbound = {
record_id: string;
object_id: string;
};
/** @internal */
export declare const RecordT$outboundSchema: z.ZodType<RecordT$Outbound, z.ZodTypeDef, RecordT>;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export declare namespace RecordT$ {
/** @deprecated use `RecordT$inboundSchema` instead. */
const inboundSchema: z.ZodType<RecordT, z.ZodTypeDef, unknown>;
/** @deprecated use `RecordT$outboundSchema` instead. */
const outboundSchema: z.ZodType<RecordT$Outbound, z.ZodTypeDef, RecordT>;
/** @deprecated use `RecordT$Outbound` instead. */
type Outbound = RecordT$Outbound;
}
export declare function recordToJSON(recordT: RecordT): string;
export declare function recordFromJSON(jsonString: string): SafeParseResult<RecordT, SDKValidationError>;
/** @internal */
export declare const ResolvedByType$inboundSchema: z.ZodNativeEnum<typeof ResolvedByType>;
/** @internal */
export declare const ResolvedByType$outboundSchema: z.ZodNativeEnum<typeof ResolvedByType>;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export declare namespace ResolvedByType$ {
/** @deprecated use `ResolvedByType$inboundSchema` instead. */
const inboundSchema: z.ZodNativeEnum<{
readonly ApiToken: "api-token";
readonly WorkspaceMember: "workspace-member";
readonly System: "system";
readonly App: "app";
}>;
/** @deprecated use `ResolvedByType$outboundSchema` instead. */
const outboundSchema: z.ZodNativeEnum<{
readonly ApiToken: "api-token";
readonly WorkspaceMember: "workspace-member";
readonly System: "system";
readonly App: "app";
}>;
}
/** @internal */
export declare const ResolvedBy$inboundSchema: z.ZodType<ResolvedBy, z.ZodTypeDef, unknown>;
/** @internal */
export type ResolvedBy$Outbound = {
id?: string | null | undefined;
type?: string | null | undefined;
};
/** @internal */
export declare const ResolvedBy$outboundSchema: z.ZodType<ResolvedBy$Outbound, z.ZodTypeDef, ResolvedBy>;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export declare namespace ResolvedBy$ {
/** @deprecated use `ResolvedBy$inboundSchema` instead. */
const inboundSchema: z.ZodType<ResolvedBy, z.ZodTypeDef, unknown>;
/** @deprecated use `ResolvedBy$outboundSchema` instead. */
const outboundSchema: z.ZodType<ResolvedBy$Outbound, z.ZodTypeDef, ResolvedBy>;
/** @deprecated use `ResolvedBy$Outbound` instead. */
type Outbound = ResolvedBy$Outbound;
}
export declare function resolvedByToJSON(resolvedBy: ResolvedBy): string;
export declare function resolvedByFromJSON(jsonString: string): SafeParseResult<ResolvedBy, SDKValidationError>;
/** @internal */
export declare const AuthorType$inboundSchema: z.ZodNativeEnum<typeof AuthorType>;
/** @internal */
export declare const AuthorType$outboundSchema: z.ZodNativeEnum<typeof AuthorType>;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export declare namespace AuthorType$ {
/** @deprecated use `AuthorType$inboundSchema` instead. */
const inboundSchema: z.ZodNativeEnum<{
readonly ApiToken: "api-token";
readonly WorkspaceMember: "workspace-member";
readonly System: "system";
readonly App: "app";
}>;
/** @deprecated use `AuthorType$outboundSchema` instead. */
const outboundSchema: z.ZodNativeEnum<{
readonly ApiToken: "api-token";
readonly WorkspaceMember: "workspace-member";
readonly System: "system";
readonly App: "app";
}>;
}
/** @internal */
export declare const Author$inboundSchema: z.ZodType<Author, z.ZodTypeDef, unknown>;
/** @internal */
export type Author$Outbound = {
id?: string | null | undefined;
type?: string | null | undefined;
};
/** @internal */
export declare const Author$outboundSchema: z.ZodType<Author$Outbound, z.ZodTypeDef, Author>;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export declare namespace Author$ {
/** @deprecated use `Author$inboundSchema` instead. */
const inboundSchema: z.ZodType<Author, z.ZodTypeDef, unknown>;
/** @deprecated use `Author$outboundSchema` instead. */
const outboundSchema: z.ZodType<Author$Outbound, z.ZodTypeDef, Author>;
/** @deprecated use `Author$Outbound` instead. */
type Outbound = Author$Outbound;
}
export declare function authorToJSON(author: Author): string;
export declare function authorFromJSON(jsonString: string): SafeParseResult<Author, SDKValidationError>;
/** @internal */
export declare const Comment$inboundSchema: z.ZodType<Comment, z.ZodTypeDef, unknown>;
/** @internal */
export type Comment$Outbound = {
id: CommentId$Outbound;
thread_id: string;
content_plaintext: string;
entry: Entry$Outbound | null;
record: RecordT$Outbound;
resolved_at: string | null;
resolved_by: ResolvedBy$Outbound;
created_at: string;
author: Author$Outbound;
};
/** @internal */
export declare const Comment$outboundSchema: z.ZodType<Comment$Outbound, z.ZodTypeDef, Comment>;
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export declare namespace Comment$ {
/** @deprecated use `Comment$inboundSchema` instead. */
const inboundSchema: z.ZodType<Comment, z.ZodTypeDef, unknown>;
/** @deprecated use `Comment$outboundSchema` instead. */
const outboundSchema: z.ZodType<Comment$Outbound, z.ZodTypeDef, Comment>;
/** @deprecated use `Comment$Outbound` instead. */
type Outbound = Comment$Outbound;
}
export declare function commentToJSON(comment: Comment): string;
export declare function commentFromJSON(jsonString: string): SafeParseResult<Comment, SDKValidationError>;
//# sourceMappingURL=comment.d.ts.map