@spotable/attio-sdk
Version:
Client for Attio REST API
76 lines (62 loc) • 1.53 kB
text/typescript
import { writeGeneratedFile } from "../../helpers/fs";
import logger from "../../helpers/logger";
import { generateFileHeader } from "./fileHeader";
const FILE_NAME = "systemDataTypes.ts";
export function generateSystemDataTypes(outputDir: string): void {
logger.debug(`Generating system data types file: ${FILE_NAME}`);
const systemTypes = `
${generateFileHeader(FILE_NAME)}
export interface Actor {
type: "api-token" | "workspace-member" | "system" | "app";
id: string;
}
export interface Location {
line_1: string;
line_2: string | null;
line_3: string | null;
line_4: string | null;
locality: string;
region: string;
postal_code: string;
country_code: string;
latitude: string;
longitude: string;
}
export interface Domain {
domain: string;
root_domain: string;
}
export interface DomainInput {
domain: string;
}
export interface RecordReference {
target_object: string;
target_record_id: string;
}
export interface ActorReference {
referenced_actor_type: string;
referenced_actor_id: string;
}
export interface SelectOption {
id: {
workspace_id: string;
object_id: string;
attribute_id: string;
option_id: string;
};
title: string;
is_archived: boolean;
}
export interface Interaction {
interaction_type: string;
interacted_at: string;
owner_actor: Actor;
}
export interface PhoneNumber {
phone_number: string;
original_phone_number: string;
country_code: string;
}
`.trim();
writeGeneratedFile(outputDir, FILE_NAME, systemTypes);
}