@onereach/types-contacts-api 0.0.4 → 0.0.8
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 +61 -6
- package/package.json +2 -2
package/index.ts
CHANGED
|
@@ -3,24 +3,79 @@ 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 ContactResponseDto extends CreateContactDto {
|
|
15
|
+
id: string;
|
|
16
|
+
created_at: Date;
|
|
17
|
+
updated_at: Date;
|
|
18
|
+
fields?: FieldDto[];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface CreateContactDto {
|
|
22
|
+
contact_book: string;
|
|
23
|
+
data: Record<string, any>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface FieldDto {
|
|
27
|
+
id: string;
|
|
28
|
+
label: string;
|
|
29
|
+
singular_label: string;
|
|
30
|
+
type: ColumnTypes;
|
|
31
|
+
is_visible: boolean;
|
|
32
|
+
order: number;
|
|
33
|
+
properties?: Record<string, string>;
|
|
34
|
+
value: unknown;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export enum ColumnTypes {
|
|
38
|
+
string = 'string',
|
|
39
|
+
integer = 'integer',
|
|
40
|
+
double = 'double',
|
|
41
|
+
date = 'date',
|
|
42
|
+
md = 'md',
|
|
43
|
+
'identifier object' = 'identifier object',
|
|
44
|
+
'array of identifiers' = 'array of identifiers',
|
|
45
|
+
'array of objects' = 'array of objects',
|
|
46
|
+
'array of strings' = 'array of strings'
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export type ColumnValueName = 'string_values' | 'object_values' | 'number_values' | 'date_values' | 'double_values';
|
|
50
|
+
|
|
51
|
+
export interface UpdateContactDto extends CreateContactDto {
|
|
52
|
+
data: Record<string, { id?: string; value: any; }>;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface ContactBookListDto extends ListApiResponse {
|
|
56
|
+
items: ContactBookResponseDto[];
|
|
57
|
+
}
|
|
58
|
+
|
|
14
59
|
export interface ContactBookResponseDto extends CreateContactBookDto {
|
|
15
|
-
id:
|
|
16
|
-
|
|
17
|
-
|
|
60
|
+
id: string;
|
|
61
|
+
created_at: Date;
|
|
62
|
+
updated_at: Date;
|
|
63
|
+
contacts?: ContactResponseDto[];
|
|
18
64
|
}
|
|
19
65
|
|
|
20
66
|
export interface CreateContactBookDto {
|
|
21
67
|
label: string;
|
|
22
|
-
schema:
|
|
68
|
+
schema: ContactBookSchema;
|
|
23
69
|
}
|
|
24
70
|
|
|
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
|
+
|
|
25
80
|
export interface UpdateContactBookDto extends ReturnType<typeof PartialType<CreateContactBookDto>> {
|
|
26
81
|
}
|