UNPKG

@spotable/attio-sdk

Version:
68 lines (59 loc) 1.56 kB
import { writeGeneratedFile } from "../../helpers/fs"; import logger from "../../helpers/logger"; import { generateFileHeader } from "./fileHeader"; const FILE_NAME = "entry.ts"; export function generateEntryTypes(outputDir: string): void { logger.debug(`Generating entry types file: ${FILE_NAME}`); const content = `${generateFileHeader(FILE_NAME)} import { Actor } from './systemDataTypes'; export interface AttioEntry { id: { workspace_id: string; list_id: string; entry_id: string; }; parent_record_id: string; parent_object: string; created_at: string; entry_values: Record<string, Array<{ active_from: string; active_until: string | null; created_by_actor: Actor; value?: any; status?: { id: { workspace_id: string; object_id: string; attribute_id: string; status_id: string; }; title: string; is_archived: boolean; target_time_in_status: number | null; celebration_enabled: boolean; }; referenced_actor_id?: string; referenced_actor_type?: string; attribute_type: string; }>>; } export interface EntryQueryParams { filter?: Record<string, any>; sorts?: Array<{ direction: 'asc' | 'desc'; attribute: string; field?: string; }>; limit?: number; offset?: number; } export interface CreateEntryInput { parent_record_id: string; values?: Record<string, any>; } export interface UpdateEntryInput { values?: Record<string, any>; } `; writeGeneratedFile(outputDir, FILE_NAME, content); }