@onereach/types-contacts-api 0.0.9 → 1.26.1-beta.597.0
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/dist/index.ts +141 -0
- package/package.json +16 -3
- package/index.ts +0 -99
package/dist/index.ts
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
declare function OmitType<T, K extends keyof T>(classRef: T, keys: readonly K[]): Omit<T, typeof keys[number]>;
|
|
2
|
+
declare function IntersectionType<A, B>(classARef: A, classBRef: B): A & B;
|
|
3
|
+
declare function PartialType<T>(classRef: T): Partial<T>;
|
|
4
|
+
declare function PickType<T, K extends keyof T>(classRef: T, keys: readonly K[]): Pick<T, typeof keys[number]>;
|
|
5
|
+
|
|
6
|
+
export interface ContactListDto extends ListApiResponse {
|
|
7
|
+
items: ContactResponseDto[];
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface ListApiResponse {
|
|
11
|
+
total: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface ContactParamsDto extends ListApiParams {
|
|
15
|
+
contact_book: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface ListApiParams {
|
|
19
|
+
take: number | undefined;
|
|
20
|
+
skip: number | undefined;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface ContactResponseDto {
|
|
24
|
+
id: string;
|
|
25
|
+
created_at: Date;
|
|
26
|
+
updated_at: Date;
|
|
27
|
+
fieldValues?: FieldValueResponseDto[];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface ContactSearchParamsDto extends ListApiParams {
|
|
31
|
+
contact_book: string;
|
|
32
|
+
q?: string;
|
|
33
|
+
filter?: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface CreateContactDto {
|
|
37
|
+
contact_book: string;
|
|
38
|
+
data: FieldValueRequestDto[];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface UpdateContactDto extends CreateContactDto {
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface ContactBookFieldSchemaDto extends CreateFieldSchemaDto {
|
|
45
|
+
id?: string;
|
|
46
|
+
delete?: boolean;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface CreateFieldSchemaDto {
|
|
50
|
+
label: string;
|
|
51
|
+
singular_label?: string;
|
|
52
|
+
properties?: Record<string, string>;
|
|
53
|
+
type: ColumnTypes;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export enum ColumnTypes {
|
|
57
|
+
string = 'string',
|
|
58
|
+
integer = 'integer',
|
|
59
|
+
double = 'double',
|
|
60
|
+
date = 'date',
|
|
61
|
+
md = 'md',
|
|
62
|
+
'identifier object' = 'identifier object',
|
|
63
|
+
'array of identifiers' = 'array of identifiers',
|
|
64
|
+
'array of objects' = 'array of objects',
|
|
65
|
+
'array of strings' = 'array of strings'
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export type ColumnValueName = 'string_values' | 'object_values' | 'number_values' | 'date_values' | 'double_values';
|
|
69
|
+
|
|
70
|
+
export interface ContactBookListDto extends ListApiResponse {
|
|
71
|
+
items: ContactBookResponseDto[];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface ContactBookResponseDto extends CreateContactBookDto {
|
|
75
|
+
id: string;
|
|
76
|
+
created_at: Date;
|
|
77
|
+
updated_at: Date;
|
|
78
|
+
contacts?: ContactResponseDto[];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface CreateContactBookDto {
|
|
82
|
+
label: string;
|
|
83
|
+
fieldSchemas: ContactBookFieldSchemaDto[];
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface UpdateContactBookDto extends ReturnType<typeof PartialType<CreateContactBookDto>> {
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface FieldSchemaListDto extends ListApiResponse {
|
|
90
|
+
items: FieldSchemaResponseDto[];
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface FieldSchemaResponseDto extends CreateFieldSchemaDto {
|
|
94
|
+
id: string;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface UpdateFieldSchemaDto extends ReturnType<typeof PartialType<ReturnType<typeof OmitType<CreateFieldSchemaDto, 'type'>>>> {
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface FieldValueRequestDto {
|
|
101
|
+
value: any;
|
|
102
|
+
schemaId: string;
|
|
103
|
+
id: string;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface FieldValueResponseDto {
|
|
107
|
+
id: string;
|
|
108
|
+
value: unknown;
|
|
109
|
+
schemaId: string;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export interface CreateFilterDto {
|
|
113
|
+
name: string;
|
|
114
|
+
contact_book: string;
|
|
115
|
+
match_all: boolean;
|
|
116
|
+
conditions: FilterConditionDto[];
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface FilterConditionDto {
|
|
120
|
+
schema: string;
|
|
121
|
+
operator: string;
|
|
122
|
+
value: any;
|
|
123
|
+
propertyPath?: string[];
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface FilterListParamsDto extends ListApiParams {
|
|
127
|
+
contact_book: string;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export interface FilterListDto extends ListApiResponse {
|
|
131
|
+
items: FilterResponseDto[];
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export interface FilterResponseDto extends ReturnType<typeof OmitType<CreateFilterDto, 'contact_book'>> {
|
|
135
|
+
id: string;
|
|
136
|
+
created_at: Date;
|
|
137
|
+
updated_at: Date;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface UpdateFilterDto extends ReturnType<typeof PartialType<ReturnType<typeof OmitType<CreateFilterDto, 'contact_book'>>>> {
|
|
141
|
+
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onereach/types-contacts-api",
|
|
3
|
-
"
|
|
3
|
+
"description": "Generated types for Contacts Api",
|
|
4
|
+
"version": "1.26.1-beta.597.0",
|
|
4
5
|
"author": "OneReach.ai",
|
|
5
|
-
"main": "index.ts",
|
|
6
|
+
"main": "./dist/index.ts",
|
|
6
7
|
"publishConfig": {
|
|
7
8
|
"access": "public"
|
|
8
|
-
}
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist/"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build:types": "ts-node ./generate-types.ts"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@types/node": "^16.0.0",
|
|
18
|
+
"ts-morph": "^15.1.0",
|
|
19
|
+
"ts-node": "^10.0.0"
|
|
20
|
+
},
|
|
21
|
+
"gitHead": "72c93f6e77fefee22d94269da53ee1362446dfcd"
|
|
9
22
|
}
|
package/index.ts
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
declare function OmitType<T, K extends keyof T>(classRef: T, keys: readonly K[]): Omit<T, typeof keys[number]>;
|
|
2
|
-
declare function IntersectionType<A, B>(classARef: A, classBRef: B): A & B;
|
|
3
|
-
declare function PartialType<T>(classRef: T): Partial<T>;
|
|
4
|
-
declare function PickType<T, K extends keyof T>(classRef: T, keys: readonly K[]): Pick<T, typeof keys[number]>;
|
|
5
|
-
|
|
6
|
-
export interface ContactListDto extends ListApiResponse {
|
|
7
|
-
items: ContactResponseDto[];
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface ListApiResponse {
|
|
11
|
-
total: number;
|
|
12
|
-
}
|
|
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
|
-
|
|
63
|
-
export interface ContactBookResponseDto extends CreateContactBookDto {
|
|
64
|
-
id: string;
|
|
65
|
-
created_at: Date;
|
|
66
|
-
updated_at: Date;
|
|
67
|
-
contacts?: ContactResponseDto[];
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export interface CreateContactBookDto {
|
|
71
|
-
label: string;
|
|
72
|
-
fieldSchemas: ContactBookFieldSchemaDto[];
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export interface UpdateContactBookDto extends ReturnType<typeof PartialType<CreateContactBookDto>> {
|
|
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
|
-
}
|