@onereach/types-contacts-api 0.0.5 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.ts +77 -4
- package/package.json +2 -2
package/index.ts
CHANGED
|
@@ -3,24 +3,97 @@ declare function IntersectionType<A, B>(classARef: A, classBRef: B): A & B;
|
|
|
3
3
|
declare function PartialType<T>(classRef: T): Partial<T>;
|
|
4
4
|
declare function PickType<T, K extends keyof T>(classRef: T, keys: readonly K[]): Pick<T, typeof keys[number]>;
|
|
5
5
|
|
|
6
|
-
export interface
|
|
7
|
-
items:
|
|
6
|
+
export interface ContactListDto extends ListApiResponse {
|
|
7
|
+
items: ContactResponseDto[];
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export interface ListApiResponse {
|
|
11
11
|
total: number;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
export interface ContactParamsDto {
|
|
15
|
+
contactBookId: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface ContactResponseDto {
|
|
19
|
+
id: string;
|
|
20
|
+
created_at: Date;
|
|
21
|
+
updated_at: Date;
|
|
22
|
+
fieldValues?: FieldValueResponseDto;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface CreateContactDto {
|
|
26
|
+
contact_book: string;
|
|
27
|
+
data: FieldValueRequestDto[];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface UpdateContactDto extends CreateContactDto {
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface ContactBookFieldSchemaDto extends CreateFieldSchemaDto {
|
|
34
|
+
id?: string;
|
|
35
|
+
delete?: boolean;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface CreateFieldSchemaDto {
|
|
39
|
+
label: string;
|
|
40
|
+
singular_label?: string;
|
|
41
|
+
properties?: Record<string, string>;
|
|
42
|
+
type: ColumnTypes;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export enum ColumnTypes {
|
|
46
|
+
string = 'string',
|
|
47
|
+
integer = 'integer',
|
|
48
|
+
double = 'double',
|
|
49
|
+
date = 'date',
|
|
50
|
+
md = 'md',
|
|
51
|
+
'identifier object' = 'identifier object',
|
|
52
|
+
'array of identifiers' = 'array of identifiers',
|
|
53
|
+
'array of objects' = 'array of objects',
|
|
54
|
+
'array of strings' = 'array of strings'
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export type ColumnValueName = 'string_values' | 'object_values' | 'number_values' | 'date_values' | 'double_values';
|
|
58
|
+
|
|
59
|
+
export interface ContactBookListDto extends ListApiResponse {
|
|
60
|
+
items: ContactBookResponseDto[];
|
|
61
|
+
}
|
|
62
|
+
|
|
14
63
|
export interface ContactBookResponseDto extends CreateContactBookDto {
|
|
15
|
-
id:
|
|
64
|
+
id: string;
|
|
16
65
|
created_at: Date;
|
|
17
66
|
updated_at: Date;
|
|
67
|
+
contacts?: ContactResponseDto[];
|
|
18
68
|
}
|
|
19
69
|
|
|
20
70
|
export interface CreateContactBookDto {
|
|
21
71
|
label: string;
|
|
22
|
-
|
|
72
|
+
fieldSchemas: ContactBookFieldSchemaDto[];
|
|
23
73
|
}
|
|
24
74
|
|
|
25
75
|
export interface UpdateContactBookDto extends ReturnType<typeof PartialType<CreateContactBookDto>> {
|
|
26
76
|
}
|
|
77
|
+
|
|
78
|
+
export interface FieldSchemaListDto extends ListApiResponse {
|
|
79
|
+
items: FieldSchemaResponseDto[];
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface FieldSchemaResponseDto extends CreateFieldSchemaDto {
|
|
83
|
+
id: string;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface UpdateFieldSchemaDto extends ReturnType<typeof PartialType<ReturnType<typeof OmitType<CreateFieldSchemaDto, 'type'>>>> {
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface FieldValueRequestDto {
|
|
90
|
+
value: any;
|
|
91
|
+
schemaId: string;
|
|
92
|
+
id: string;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface FieldValueResponseDto {
|
|
96
|
+
id: string;
|
|
97
|
+
value: unknown;
|
|
98
|
+
schemaId: string;
|
|
99
|
+
}
|