UNPKG

attio-js

Version:

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

272 lines 11.1 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 ListId = { /** * A UUID to identify the workspace this list belongs to. */ workspaceId: string; /** * A UUID to identify this list. */ listId: string; }; /** * The level of access granted to all members of the workspace for this list. `null` values represent a private list that only grants access to specific workspace members via the `workspace_member_access` property. */ export declare const WorkspaceAccess: { readonly FullAccess: "full-access"; readonly ReadAndWrite: "read-and-write"; readonly ReadOnly: "read-only"; }; /** * The level of access granted to all members of the workspace for this list. `null` values represent a private list that only grants access to specific workspace members via the `workspace_member_access` property. */ export type WorkspaceAccess = ClosedEnum<typeof WorkspaceAccess>; /** * The level of access to the list. */ export declare const Level: { readonly FullAccess: "full-access"; readonly ReadAndWrite: "read-and-write"; readonly ReadOnly: "read-only"; }; /** * The level of access to the list. */ export type Level = ClosedEnum<typeof Level>; export type WorkspaceMemberAccess = { /** * A UUID to identify the workspace member to grant access to. */ workspaceMemberId: string; /** * The level of access to the list. */ level: Level; }; /** * The type of actor. [Read more information on actor types here](/docs/actors). */ export declare const ListType: { 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 ListType = ClosedEnum<typeof ListType>; /** * The actor which created this list. */ export type ListCreatedByActor = { /** * An ID to identify the actor. */ id?: string | null | undefined; /** * The type of actor. [Read more information on actor types here](/docs/actors). */ type?: ListType | null | undefined; }; export type List = { id: ListId; /** * A human-readable slug for use in URLs and responses. */ apiSlug: string; /** * The name of the list, as viewed in the UI. */ name: string; /** * A UUID or slug to identify the allowed object type for records added to this list. All new Lists are expected to have exactly one parent object. However, some legacy lists may have multiple allowed parents so the return type of this field is an array. */ parentObject: Array<string>; /** * The level of access granted to all members of the workspace for this list. `null` values represent a private list that only grants access to specific workspace members via the `workspace_member_access` property. */ workspaceAccess: WorkspaceAccess | null; /** * The level of access granted to specific workspace members for this list. An empty array represents a list that has granted access to no workspace members. */ workspaceMemberAccess: Array<WorkspaceMemberAccess>; /** * The actor which created this list. */ createdByActor: ListCreatedByActor; /** * When the list was created. */ createdAt: string; }; /** @internal */ export declare const ListId$inboundSchema: z.ZodType<ListId, z.ZodTypeDef, unknown>; /** @internal */ export type ListId$Outbound = { workspace_id: string; list_id: string; }; /** @internal */ export declare const ListId$outboundSchema: z.ZodType<ListId$Outbound, z.ZodTypeDef, ListId>; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace ListId$ { /** @deprecated use `ListId$inboundSchema` instead. */ const inboundSchema: z.ZodType<ListId, z.ZodTypeDef, unknown>; /** @deprecated use `ListId$outboundSchema` instead. */ const outboundSchema: z.ZodType<ListId$Outbound, z.ZodTypeDef, ListId>; /** @deprecated use `ListId$Outbound` instead. */ type Outbound = ListId$Outbound; } export declare function listIdToJSON(listId: ListId): string; export declare function listIdFromJSON(jsonString: string): SafeParseResult<ListId, SDKValidationError>; /** @internal */ export declare const WorkspaceAccess$inboundSchema: z.ZodNativeEnum<typeof WorkspaceAccess>; /** @internal */ export declare const WorkspaceAccess$outboundSchema: z.ZodNativeEnum<typeof WorkspaceAccess>; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace WorkspaceAccess$ { /** @deprecated use `WorkspaceAccess$inboundSchema` instead. */ const inboundSchema: z.ZodNativeEnum<{ readonly FullAccess: "full-access"; readonly ReadAndWrite: "read-and-write"; readonly ReadOnly: "read-only"; }>; /** @deprecated use `WorkspaceAccess$outboundSchema` instead. */ const outboundSchema: z.ZodNativeEnum<{ readonly FullAccess: "full-access"; readonly ReadAndWrite: "read-and-write"; readonly ReadOnly: "read-only"; }>; } /** @internal */ export declare const Level$inboundSchema: z.ZodNativeEnum<typeof Level>; /** @internal */ export declare const Level$outboundSchema: z.ZodNativeEnum<typeof Level>; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace Level$ { /** @deprecated use `Level$inboundSchema` instead. */ const inboundSchema: z.ZodNativeEnum<{ readonly FullAccess: "full-access"; readonly ReadAndWrite: "read-and-write"; readonly ReadOnly: "read-only"; }>; /** @deprecated use `Level$outboundSchema` instead. */ const outboundSchema: z.ZodNativeEnum<{ readonly FullAccess: "full-access"; readonly ReadAndWrite: "read-and-write"; readonly ReadOnly: "read-only"; }>; } /** @internal */ export declare const WorkspaceMemberAccess$inboundSchema: z.ZodType<WorkspaceMemberAccess, z.ZodTypeDef, unknown>; /** @internal */ export type WorkspaceMemberAccess$Outbound = { workspace_member_id: string; level: string; }; /** @internal */ export declare const WorkspaceMemberAccess$outboundSchema: z.ZodType<WorkspaceMemberAccess$Outbound, z.ZodTypeDef, WorkspaceMemberAccess>; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace WorkspaceMemberAccess$ { /** @deprecated use `WorkspaceMemberAccess$inboundSchema` instead. */ const inboundSchema: z.ZodType<WorkspaceMemberAccess, z.ZodTypeDef, unknown>; /** @deprecated use `WorkspaceMemberAccess$outboundSchema` instead. */ const outboundSchema: z.ZodType<WorkspaceMemberAccess$Outbound, z.ZodTypeDef, WorkspaceMemberAccess>; /** @deprecated use `WorkspaceMemberAccess$Outbound` instead. */ type Outbound = WorkspaceMemberAccess$Outbound; } export declare function workspaceMemberAccessToJSON(workspaceMemberAccess: WorkspaceMemberAccess): string; export declare function workspaceMemberAccessFromJSON(jsonString: string): SafeParseResult<WorkspaceMemberAccess, SDKValidationError>; /** @internal */ export declare const ListType$inboundSchema: z.ZodNativeEnum<typeof ListType>; /** @internal */ export declare const ListType$outboundSchema: z.ZodNativeEnum<typeof ListType>; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace ListType$ { /** @deprecated use `ListType$inboundSchema` instead. */ const inboundSchema: z.ZodNativeEnum<{ readonly ApiToken: "api-token"; readonly WorkspaceMember: "workspace-member"; readonly System: "system"; readonly App: "app"; }>; /** @deprecated use `ListType$outboundSchema` instead. */ const outboundSchema: z.ZodNativeEnum<{ readonly ApiToken: "api-token"; readonly WorkspaceMember: "workspace-member"; readonly System: "system"; readonly App: "app"; }>; } /** @internal */ export declare const ListCreatedByActor$inboundSchema: z.ZodType<ListCreatedByActor, z.ZodTypeDef, unknown>; /** @internal */ export type ListCreatedByActor$Outbound = { id?: string | null | undefined; type?: string | null | undefined; }; /** @internal */ export declare const ListCreatedByActor$outboundSchema: z.ZodType<ListCreatedByActor$Outbound, z.ZodTypeDef, ListCreatedByActor>; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace ListCreatedByActor$ { /** @deprecated use `ListCreatedByActor$inboundSchema` instead. */ const inboundSchema: z.ZodType<ListCreatedByActor, z.ZodTypeDef, unknown>; /** @deprecated use `ListCreatedByActor$outboundSchema` instead. */ const outboundSchema: z.ZodType<ListCreatedByActor$Outbound, z.ZodTypeDef, ListCreatedByActor>; /** @deprecated use `ListCreatedByActor$Outbound` instead. */ type Outbound = ListCreatedByActor$Outbound; } export declare function listCreatedByActorToJSON(listCreatedByActor: ListCreatedByActor): string; export declare function listCreatedByActorFromJSON(jsonString: string): SafeParseResult<ListCreatedByActor, SDKValidationError>; /** @internal */ export declare const List$inboundSchema: z.ZodType<List, z.ZodTypeDef, unknown>; /** @internal */ export type List$Outbound = { id: ListId$Outbound; api_slug: string; name: string; parent_object: Array<string>; workspace_access: string | null; workspace_member_access: Array<WorkspaceMemberAccess$Outbound>; created_by_actor: ListCreatedByActor$Outbound; created_at: string; }; /** @internal */ export declare const List$outboundSchema: z.ZodType<List$Outbound, z.ZodTypeDef, List>; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export declare namespace List$ { /** @deprecated use `List$inboundSchema` instead. */ const inboundSchema: z.ZodType<List, z.ZodTypeDef, unknown>; /** @deprecated use `List$outboundSchema` instead. */ const outboundSchema: z.ZodType<List$Outbound, z.ZodTypeDef, List>; /** @deprecated use `List$Outbound` instead. */ type Outbound = List$Outbound; } export declare function listToJSON(list: List): string; export declare function listFromJSON(jsonString: string): SafeParseResult<List, SDKValidationError>; //# sourceMappingURL=list.d.ts.map