@onereach/types-contacts-api
Advanced tools
Comparing version 0.0.5 to 0.0.7
63
index.ts
@@ -6,4 +6,4 @@ declare function OmitType<T, K extends keyof T>(classRef: T, keys: readonly K[]): Omit<T, typeof keys[number]>; | ||
export interface ContactBookListDto extends ListApiResponse { | ||
items: ContactBookResponseDto[]; | ||
export interface ContactListDto extends ListApiResponse { | ||
items: ContactResponseDto[]; | ||
} | ||
@@ -15,6 +15,52 @@ | ||
export interface ContactResponseDto extends CreateContactDto { | ||
id: string; | ||
created_at: Date; | ||
updated_at: Date; | ||
fields?: FieldDto[]; | ||
} | ||
export interface CreateContactDto { | ||
contact_book: string; | ||
data: Record<string, any>; | ||
} | ||
export interface FieldDto { | ||
id: string; | ||
label: string; | ||
singular_label: string; | ||
type: ColumnTypes; | ||
is_visible: boolean; | ||
order: number; | ||
properties?: Record<string, string>; | ||
value: unknown; | ||
} | ||
export enum ColumnTypes { | ||
string = 'string', | ||
integer = 'integer', | ||
double = 'double', | ||
date = 'date', | ||
md = 'md', | ||
'identifier object' = 'identifier object', | ||
'array of identifiers' = 'array of identifiers', | ||
'array of objects' = 'array of objects', | ||
'array of strings' = 'array of strings' | ||
} | ||
export type ColumnValueName = 'string_values' | 'object_values' | 'number_values' | 'date_values' | 'double_values'; | ||
export interface UpdateContactDto extends CreateContactDto { | ||
data: Record<string, { id?: string; value: any; }>; | ||
} | ||
export interface ContactBookListDto extends ListApiResponse { | ||
items: ContactBookResponseDto[]; | ||
} | ||
export interface ContactBookResponseDto extends CreateContactBookDto { | ||
id: number; | ||
id: string; | ||
created_at: Date; | ||
updated_at: Date; | ||
contacts?: ContactResponseDto[]; | ||
} | ||
@@ -24,6 +70,15 @@ | ||
label: string; | ||
schema: object; | ||
schema: ContactBookSchema; | ||
} | ||
export type ContactBookSchemaItem = { | ||
visibility: boolean; | ||
label: string; | ||
singularLabel: string; | ||
typeOf: ColumnTypes; | ||
order: number; | ||
}; | ||
export type ContactBookSchema = Record<string, ContactBookSchemaItem>; | ||
export interface UpdateContactBookDto extends ReturnType<typeof PartialType<CreateContactBookDto>> { | ||
} |
{ | ||
"name": "@onereach/types-contacts-api", | ||
"version": "0.0.5", | ||
"version": "0.0.7", | ||
"author": "OneReach.ai", | ||
@@ -5,0 +5,0 @@ "main": "index.ts", |
2406
68