@onereach/types-contacts-api 0.0.8 → 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 +42 -24
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -11,27 +11,35 @@ export interface ListApiResponse {
|
|
|
11
11
|
total: number;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export interface
|
|
14
|
+
export interface ContactParamsDto {
|
|
15
|
+
contactBookId: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface ContactResponseDto {
|
|
15
19
|
id: string;
|
|
16
20
|
created_at: Date;
|
|
17
21
|
updated_at: Date;
|
|
18
|
-
|
|
22
|
+
fieldValues?: FieldValueResponseDto;
|
|
19
23
|
}
|
|
20
24
|
|
|
21
25
|
export interface CreateContactDto {
|
|
22
26
|
contact_book: string;
|
|
23
|
-
data:
|
|
27
|
+
data: FieldValueRequestDto[];
|
|
24
28
|
}
|
|
25
29
|
|
|
26
|
-
export interface
|
|
27
|
-
|
|
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 {
|
|
28
39
|
label: string;
|
|
29
|
-
singular_label
|
|
30
|
-
type: ColumnTypes;
|
|
31
|
-
is_visible: boolean;
|
|
32
|
-
order: number;
|
|
40
|
+
singular_label?: string;
|
|
33
41
|
properties?: Record<string, string>;
|
|
34
|
-
|
|
42
|
+
type: ColumnTypes;
|
|
35
43
|
}
|
|
36
44
|
|
|
37
45
|
export enum ColumnTypes {
|
|
@@ -48,10 +56,6 @@ export enum ColumnTypes {
|
|
|
48
56
|
|
|
49
57
|
export type ColumnValueName = 'string_values' | 'object_values' | 'number_values' | 'date_values' | 'double_values';
|
|
50
58
|
|
|
51
|
-
export interface UpdateContactDto extends CreateContactDto {
|
|
52
|
-
data: Record<string, { id?: string; value: any; }>;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
59
|
export interface ContactBookListDto extends ListApiResponse {
|
|
56
60
|
items: ContactBookResponseDto[];
|
|
57
61
|
}
|
|
@@ -65,17 +69,31 @@ export interface ContactBookResponseDto extends CreateContactBookDto {
|
|
|
65
69
|
|
|
66
70
|
export interface CreateContactBookDto {
|
|
67
71
|
label: string;
|
|
68
|
-
|
|
72
|
+
fieldSchemas: ContactBookFieldSchemaDto[];
|
|
69
73
|
}
|
|
70
74
|
|
|
71
|
-
export type ContactBookSchemaItem = {
|
|
72
|
-
visibility: boolean;
|
|
73
|
-
label: string;
|
|
74
|
-
singularLabel: string;
|
|
75
|
-
typeOf: ColumnTypes;
|
|
76
|
-
order: number;
|
|
77
|
-
};
|
|
78
|
-
export type ContactBookSchema = Record<string, ContactBookSchemaItem>;
|
|
79
|
-
|
|
80
75
|
export interface UpdateContactBookDto extends ReturnType<typeof PartialType<CreateContactBookDto>> {
|
|
81
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
|
+
}
|