@onereach/types-contacts-api 4.3.1 → 4.3.2-beta.2135.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/.eslintignore +2 -0
- package/dist/{index.ts → cjs/index.d.ts} +164 -232
- package/dist/cjs/index.js +35 -0
- package/dist/esm/index.d.ts +287 -0
- package/dist/esm/index.js +32 -0
- package/package.json +15 -8
- package/{generate-types.ts → src/generate-types.ts} +6 -4
- package/tsconfig.build.cjs.json +8 -0
- package/tsconfig.build.esm.json +8 -0
- package/tsconfig.build.json +15 -0
- package/tsconfig.json +1 -0
- /package/{swagger-type-mock.ts → src/swagger-type-mock.ts} +0 -0
package/.eslintignore
ADDED
|
@@ -1,355 +1,287 @@
|
|
|
1
1
|
declare function OmitType<T, K extends keyof T>(classRef: T, keys: readonly K[]): Omit<T, typeof keys[number]>;
|
|
2
2
|
declare function IntersectionType<A, B>(classARef: A, classBRef: B): A & B;
|
|
3
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
4
|
export interface BatchProcessResponseDto {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
5
|
+
id: string;
|
|
6
|
+
created_at: Date;
|
|
7
|
+
updated_at: Date;
|
|
8
|
+
status: BatchProcessStatus;
|
|
9
|
+
results: string[];
|
|
10
|
+
messages: string[];
|
|
11
|
+
}
|
|
12
|
+
export declare enum BatchProcessStatus {
|
|
13
|
+
pending = "pending",
|
|
14
|
+
success = "success",
|
|
15
|
+
failed = "failed"
|
|
16
|
+
}
|
|
21
17
|
export type ColumnNumberValueName = 'number_values' | 'double_values';
|
|
22
|
-
export type ColumnValueName = ColumnNumberValueName
|
|
23
|
-
| 'string_values'
|
|
24
|
-
| 'object_values'
|
|
25
|
-
| 'date_values'
|
|
26
|
-
| 'array_of_objects';
|
|
27
|
-
|
|
18
|
+
export type ColumnValueName = ColumnNumberValueName | 'string_values' | 'object_values' | 'date_values' | 'array_of_objects';
|
|
28
19
|
export interface ContactListDto extends ListApiResponse {
|
|
29
|
-
|
|
20
|
+
items: ContactResponseDto[];
|
|
30
21
|
}
|
|
31
|
-
|
|
32
22
|
export interface ListApiResponse {
|
|
33
|
-
|
|
23
|
+
total: number;
|
|
34
24
|
}
|
|
35
|
-
|
|
36
25
|
export interface ContactParamsDto {
|
|
37
|
-
|
|
26
|
+
contact_book?: string;
|
|
38
27
|
}
|
|
39
|
-
|
|
40
28
|
export interface ContactRequestDto {
|
|
41
|
-
|
|
42
|
-
|
|
29
|
+
id?: string;
|
|
30
|
+
data: FieldValueRequestDto[];
|
|
43
31
|
}
|
|
44
|
-
|
|
45
32
|
export interface ContactResponseDto {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
33
|
+
id: string;
|
|
34
|
+
created_at: Date;
|
|
35
|
+
updated_at: Date;
|
|
36
|
+
fieldValues: Record<string, FieldValueResponseDto>;
|
|
50
37
|
}
|
|
51
|
-
|
|
52
38
|
export interface ContactSearchParamsDto extends ReturnType<typeof IntersectionType<OrderParams, ListApiParams>> {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
39
|
+
contact_book?: string;
|
|
40
|
+
q?: string;
|
|
41
|
+
filter?: string | DynamicFilterDto;
|
|
42
|
+
contactIds?: string[];
|
|
43
|
+
projection?: string[];
|
|
58
44
|
}
|
|
59
|
-
|
|
60
45
|
export interface OrderParams {
|
|
61
|
-
|
|
46
|
+
order?: string;
|
|
62
47
|
}
|
|
63
|
-
|
|
64
48
|
export interface ListApiParams {
|
|
65
|
-
|
|
66
|
-
|
|
49
|
+
take?: number;
|
|
50
|
+
skip?: number;
|
|
67
51
|
}
|
|
68
|
-
|
|
69
52
|
export interface CreateContactDto {
|
|
70
|
-
|
|
71
|
-
|
|
53
|
+
contact_book?: string;
|
|
54
|
+
data: FieldValueRequestDto[];
|
|
72
55
|
}
|
|
73
|
-
|
|
74
56
|
export interface CreateMultipleContactsDto {
|
|
75
|
-
|
|
76
|
-
|
|
57
|
+
contact_book?: string;
|
|
58
|
+
contacts: ContactRequestDto[];
|
|
77
59
|
}
|
|
78
|
-
|
|
79
60
|
export interface DeleteContactMultiParamsDto extends DeleteContactParamsDto {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
61
|
+
ids?: string[];
|
|
62
|
+
contact_book?: string;
|
|
63
|
+
all?: true;
|
|
83
64
|
}
|
|
84
|
-
|
|
85
65
|
export interface DeleteContactParamsDto {
|
|
86
|
-
|
|
66
|
+
contact_book?: string;
|
|
87
67
|
}
|
|
88
|
-
|
|
89
68
|
export interface FindAllParamsDto extends ReturnType<typeof OmitType<ContactSearchParamsDto, 'order' | 'take' | 'skip'>> {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
69
|
+
size?: number;
|
|
70
|
+
from?: number;
|
|
71
|
+
orderProperty?: string;
|
|
72
|
+
orderDirection?: OrderDirection;
|
|
94
73
|
}
|
|
95
|
-
|
|
96
74
|
export type OrderDirection = 'asc' | 'desc';
|
|
97
|
-
export type OrderType = {
|
|
98
|
-
|
|
75
|
+
export type OrderType = {
|
|
76
|
+
by: string;
|
|
77
|
+
order: 'asc' | 'desc';
|
|
78
|
+
};
|
|
99
79
|
export interface LinkContactMultiParamsDto {
|
|
100
|
-
|
|
101
|
-
|
|
80
|
+
ids: string[];
|
|
81
|
+
contact_books: string[];
|
|
102
82
|
}
|
|
103
|
-
|
|
104
83
|
export interface LinkContactParamsDto {
|
|
105
|
-
|
|
84
|
+
contact_book: string;
|
|
106
85
|
}
|
|
107
|
-
|
|
108
86
|
export interface MergeContactParamsDto {
|
|
109
|
-
|
|
110
|
-
|
|
87
|
+
contact_book: string;
|
|
88
|
+
mergeContactId: string;
|
|
111
89
|
}
|
|
112
|
-
|
|
113
90
|
export interface UnlinkContactMultiParamsDto extends UnlinkContactParamsDto {
|
|
114
|
-
|
|
91
|
+
ids: string[];
|
|
115
92
|
}
|
|
116
|
-
|
|
117
93
|
export interface UnlinkContactParamsDto {
|
|
118
|
-
|
|
94
|
+
contact_book: string;
|
|
119
95
|
}
|
|
120
|
-
|
|
121
96
|
export interface UpdateContactDto extends CreateContactDto {
|
|
122
97
|
}
|
|
123
|
-
|
|
124
98
|
export interface ContactBookDeleteParamsDto {
|
|
125
|
-
|
|
99
|
+
softDelete?: boolean;
|
|
126
100
|
}
|
|
127
|
-
|
|
128
101
|
export interface ContactBookFieldSchemaDto extends CreateFieldSchemaDto {
|
|
129
|
-
|
|
102
|
+
id?: string;
|
|
130
103
|
}
|
|
131
|
-
|
|
132
104
|
export interface CreateFieldSchemaDto extends MachineNameParamDto {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}
|
|
152
|
-
|
|
105
|
+
label: string;
|
|
106
|
+
singular_label?: string;
|
|
107
|
+
properties?: Record<string, string>;
|
|
108
|
+
type: ColumnTypes;
|
|
109
|
+
readonly?: boolean;
|
|
110
|
+
schemaPresets?: SchemaPresetResponseDto[];
|
|
111
|
+
}
|
|
112
|
+
export declare enum ColumnTypes {
|
|
113
|
+
string = "string",
|
|
114
|
+
integer = "integer",
|
|
115
|
+
double = "double",
|
|
116
|
+
date = "date",
|
|
117
|
+
md = "md",
|
|
118
|
+
'identifier object' = "identifier object",
|
|
119
|
+
'array of identifiers' = "array of identifiers",
|
|
120
|
+
'array of objects' = "array of objects",
|
|
121
|
+
'array of strings' = "array of strings"
|
|
122
|
+
}
|
|
153
123
|
export interface MachineNameParamDto {
|
|
154
|
-
|
|
124
|
+
machine_name: string;
|
|
155
125
|
}
|
|
156
|
-
|
|
157
126
|
export interface ContactBookListDto extends ListApiResponse {
|
|
158
|
-
|
|
127
|
+
items: ContactBookResponseDto[];
|
|
159
128
|
}
|
|
160
|
-
|
|
161
129
|
export interface ContactBookParamsDto extends ReturnType<typeof IntersectionType<OrderParams, ListApiParams>> {
|
|
162
|
-
|
|
130
|
+
q?: string;
|
|
163
131
|
}
|
|
164
|
-
|
|
165
132
|
export interface ContactBookResponseDto extends CreateContactBookDto {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}
|
|
174
|
-
|
|
133
|
+
id: string;
|
|
134
|
+
created_at: Date;
|
|
135
|
+
updated_at: Date;
|
|
136
|
+
contactsCount: number;
|
|
137
|
+
status?: SharedBookStatus;
|
|
138
|
+
sharedBy?: string;
|
|
139
|
+
contactPermission: SharedBookContactPermissionResponseDto;
|
|
140
|
+
}
|
|
175
141
|
export interface SharedBookContactPermissionResponseDto extends CreateSharedBookContactPermissionDto {
|
|
176
|
-
|
|
142
|
+
id: string;
|
|
177
143
|
}
|
|
178
|
-
|
|
179
144
|
export interface CreateSharedBookContactPermissionDto {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
145
|
+
edit?: boolean;
|
|
146
|
+
delete?: boolean;
|
|
147
|
+
create?: boolean;
|
|
183
148
|
}
|
|
184
|
-
|
|
185
149
|
export interface CreateContactBookDto {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
150
|
+
id?: string;
|
|
151
|
+
label: string;
|
|
152
|
+
fieldSchemas: ContactBookFieldSchemaDto[];
|
|
153
|
+
schemaPresets?: SchemaPresetResponseDto[];
|
|
190
154
|
}
|
|
191
|
-
|
|
192
155
|
export interface UpdateContactBookDto extends ReturnType<typeof PartialType<CreateContactBookDto>> {
|
|
193
156
|
}
|
|
194
|
-
|
|
195
157
|
export interface CrossAccountMetaDto {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
}
|
|
203
|
-
|
|
158
|
+
id: string;
|
|
159
|
+
created_at: Date;
|
|
160
|
+
updated_at: Date;
|
|
161
|
+
account_name: string;
|
|
162
|
+
account_id: string;
|
|
163
|
+
original_book_id: string;
|
|
164
|
+
}
|
|
204
165
|
export interface MigrationStateResponseDto {
|
|
205
|
-
|
|
166
|
+
state: MigrationState;
|
|
206
167
|
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
Done = 'Done'
|
|
168
|
+
export declare enum MigrationState {
|
|
169
|
+
InProgress = "InProgress",
|
|
170
|
+
ToDo = "ToDo",
|
|
171
|
+
Done = "Done"
|
|
212
172
|
}
|
|
213
|
-
|
|
214
173
|
export interface FieldSchemaDeleteParamsDto {
|
|
215
|
-
|
|
174
|
+
softDelete?: boolean;
|
|
216
175
|
}
|
|
217
|
-
|
|
218
176
|
export interface FieldSchemaListParamsDto extends ReturnType<typeof IntersectionType<OrderParams, ListApiParams>> {
|
|
219
|
-
|
|
177
|
+
q?: string;
|
|
220
178
|
}
|
|
221
|
-
|
|
222
179
|
export interface FieldSchemaListDto extends ListApiResponse {
|
|
223
|
-
|
|
180
|
+
items: FieldSchemaResponseDto[];
|
|
224
181
|
}
|
|
225
|
-
|
|
226
182
|
export interface FieldSchemaReadonlyParamsDto {
|
|
227
|
-
|
|
228
|
-
|
|
183
|
+
readonly: boolean;
|
|
184
|
+
fields: string[];
|
|
229
185
|
}
|
|
230
|
-
|
|
231
186
|
export interface FieldSchemaResponseDto extends CreateFieldSchemaDto {
|
|
232
|
-
|
|
187
|
+
id: string;
|
|
233
188
|
}
|
|
234
|
-
|
|
235
189
|
export interface UpdateFieldSchemaDto extends ReturnType<typeof PartialType<ReturnType<typeof OmitType<CreateFieldSchemaDto, 'type' | 'machine_name' | 'readonly'>>>> {
|
|
236
190
|
}
|
|
237
|
-
|
|
238
191
|
export interface DeleteFieldValueByMachineNameDto extends ReturnType<typeof OmitType<UpsertFieldValueByMachineNameDto, 'value'>> {
|
|
239
192
|
}
|
|
240
|
-
|
|
241
193
|
export interface UpsertFieldValueByMachineNameDto {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
194
|
+
contact: string;
|
|
195
|
+
machine_name: string;
|
|
196
|
+
value: any;
|
|
245
197
|
}
|
|
246
|
-
|
|
247
198
|
export interface FieldValueRequestDto {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
199
|
+
value: any;
|
|
200
|
+
schemaId?: string;
|
|
201
|
+
machine_name?: string;
|
|
202
|
+
id?: string;
|
|
252
203
|
}
|
|
253
|
-
|
|
254
204
|
export interface FieldValueResponseDto {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
205
|
+
id: string;
|
|
206
|
+
value: unknown;
|
|
207
|
+
schemaId: string;
|
|
208
|
+
machine_name: string;
|
|
259
209
|
}
|
|
260
|
-
|
|
261
210
|
export interface ContactFilterConditionDto extends AbstractFilterCondition {
|
|
262
|
-
|
|
211
|
+
contactField: 'created_at' | 'updated_at' | 'id';
|
|
263
212
|
}
|
|
264
|
-
|
|
265
213
|
export interface AbstractFilterCondition {
|
|
266
|
-
|
|
267
|
-
|
|
214
|
+
operator: string;
|
|
215
|
+
value: any;
|
|
268
216
|
}
|
|
269
|
-
|
|
270
217
|
export interface CreateFilterDto {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
218
|
+
name: string;
|
|
219
|
+
contact_book?: string;
|
|
220
|
+
match_all: boolean;
|
|
221
|
+
conditions: FieldValueFilterConditionDto[] | ContactFilterConditionDto[];
|
|
275
222
|
}
|
|
276
|
-
|
|
277
223
|
export interface DynamicFilterDto extends ReturnType<typeof OmitType<CreateFilterDto, 'name'>> {
|
|
278
224
|
}
|
|
279
|
-
|
|
280
225
|
export interface FieldValueFilterConditionDto extends AbstractFilterCondition {
|
|
281
|
-
|
|
282
|
-
|
|
226
|
+
machine_name: string;
|
|
227
|
+
propertyPath?: string[];
|
|
283
228
|
}
|
|
284
|
-
|
|
285
229
|
export interface FilterListParamsDto extends ListApiParams {
|
|
286
|
-
|
|
230
|
+
contact_book?: string;
|
|
287
231
|
}
|
|
288
|
-
|
|
289
232
|
export interface FilterListDto extends ListApiResponse {
|
|
290
|
-
|
|
233
|
+
items: FilterResponseDto[];
|
|
291
234
|
}
|
|
292
|
-
|
|
293
235
|
export interface FilterResponseDto extends ReturnType<typeof OmitType<CreateFilterDto, 'contact_book'>> {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
236
|
+
id: string;
|
|
237
|
+
created_at: Date;
|
|
238
|
+
updated_at: Date;
|
|
297
239
|
}
|
|
298
|
-
|
|
299
240
|
export interface UpdateFilterDto extends ReturnType<typeof PartialType<ReturnType<typeof OmitType<CreateFilterDto, 'contact_book'>>>> {
|
|
300
241
|
}
|
|
301
|
-
|
|
302
242
|
export interface CreateSchemaPresetDto {
|
|
303
|
-
|
|
304
|
-
|
|
243
|
+
label: string;
|
|
244
|
+
fieldSchemas?: FieldSchemaResponseDto[];
|
|
305
245
|
}
|
|
306
|
-
|
|
307
246
|
export interface SchemaPresetListDto extends ListApiResponse {
|
|
308
|
-
|
|
247
|
+
items: SchemaPresetResponseDto[];
|
|
309
248
|
}
|
|
310
|
-
|
|
311
249
|
export interface SchemaPresetResponseDto extends CreateSchemaPresetDto {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
250
|
+
id: string;
|
|
251
|
+
created_at: Date;
|
|
252
|
+
updated_at: Date;
|
|
315
253
|
}
|
|
316
|
-
|
|
317
254
|
export interface UpdateSchemaPresetDto extends ReturnType<typeof PartialType<CreateSchemaPresetDto>> {
|
|
318
255
|
}
|
|
319
|
-
|
|
320
256
|
export interface ShareContactBookParamsDto {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
257
|
+
targetAccountId: string;
|
|
258
|
+
custom_book_name?: string;
|
|
259
|
+
contactPermission?: CreateSharedBookContactPermissionDto;
|
|
324
260
|
}
|
|
325
|
-
|
|
326
261
|
export interface SharedBookResponseDto {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
}
|
|
346
|
-
|
|
262
|
+
id: string;
|
|
263
|
+
approved_by?: string;
|
|
264
|
+
created_at: Date;
|
|
265
|
+
updated_at: Date;
|
|
266
|
+
status: SharedBookStatus;
|
|
267
|
+
target_account: string;
|
|
268
|
+
account_name?: string;
|
|
269
|
+
custom_book_name?: string;
|
|
270
|
+
contact_book: string;
|
|
271
|
+
contactPermission: SharedBookContactPermissionResponseDto;
|
|
272
|
+
}
|
|
273
|
+
export declare enum SharedBookStatus {
|
|
274
|
+
pending = "pending",
|
|
275
|
+
shared = "shared",
|
|
276
|
+
canceled = "canceled",
|
|
277
|
+
deletedFromTarget = "deletedFromTarget",
|
|
278
|
+
deletedFromSource = "deletedFromSource"
|
|
279
|
+
}
|
|
347
280
|
export interface SharedBookContactPermissionListDto extends ListApiResponse {
|
|
348
|
-
|
|
281
|
+
items: SharedBookContactPermissionResponseDto[];
|
|
349
282
|
}
|
|
350
|
-
|
|
351
283
|
export interface SharedBookContactPermissionParamsDto extends ReturnType<typeof IntersectionType<OrderParams, ListApiParams>> {
|
|
352
284
|
}
|
|
353
|
-
|
|
354
285
|
export interface UpdateSharedBookContactPermissionDto extends CreateSharedBookContactPermissionDto {
|
|
355
286
|
}
|
|
287
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SharedBookStatus = exports.MigrationState = exports.ColumnTypes = exports.BatchProcessStatus = void 0;
|
|
4
|
+
var BatchProcessStatus;
|
|
5
|
+
(function (BatchProcessStatus) {
|
|
6
|
+
BatchProcessStatus["pending"] = "pending";
|
|
7
|
+
BatchProcessStatus["success"] = "success";
|
|
8
|
+
BatchProcessStatus["failed"] = "failed";
|
|
9
|
+
})(BatchProcessStatus = exports.BatchProcessStatus || (exports.BatchProcessStatus = {}));
|
|
10
|
+
var ColumnTypes;
|
|
11
|
+
(function (ColumnTypes) {
|
|
12
|
+
ColumnTypes["string"] = "string";
|
|
13
|
+
ColumnTypes["integer"] = "integer";
|
|
14
|
+
ColumnTypes["double"] = "double";
|
|
15
|
+
ColumnTypes["date"] = "date";
|
|
16
|
+
ColumnTypes["md"] = "md";
|
|
17
|
+
ColumnTypes["identifier object"] = "identifier object";
|
|
18
|
+
ColumnTypes["array of identifiers"] = "array of identifiers";
|
|
19
|
+
ColumnTypes["array of objects"] = "array of objects";
|
|
20
|
+
ColumnTypes["array of strings"] = "array of strings";
|
|
21
|
+
})(ColumnTypes = exports.ColumnTypes || (exports.ColumnTypes = {}));
|
|
22
|
+
var MigrationState;
|
|
23
|
+
(function (MigrationState) {
|
|
24
|
+
MigrationState["InProgress"] = "InProgress";
|
|
25
|
+
MigrationState["ToDo"] = "ToDo";
|
|
26
|
+
MigrationState["Done"] = "Done";
|
|
27
|
+
})(MigrationState = exports.MigrationState || (exports.MigrationState = {}));
|
|
28
|
+
var SharedBookStatus;
|
|
29
|
+
(function (SharedBookStatus) {
|
|
30
|
+
SharedBookStatus["pending"] = "pending";
|
|
31
|
+
SharedBookStatus["shared"] = "shared";
|
|
32
|
+
SharedBookStatus["canceled"] = "canceled";
|
|
33
|
+
SharedBookStatus["deletedFromTarget"] = "deletedFromTarget";
|
|
34
|
+
SharedBookStatus["deletedFromSource"] = "deletedFromSource";
|
|
35
|
+
})(SharedBookStatus = exports.SharedBookStatus || (exports.SharedBookStatus = {}));
|
|
@@ -0,0 +1,287 @@
|
|
|
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
|
+
export interface BatchProcessResponseDto {
|
|
5
|
+
id: string;
|
|
6
|
+
created_at: Date;
|
|
7
|
+
updated_at: Date;
|
|
8
|
+
status: BatchProcessStatus;
|
|
9
|
+
results: string[];
|
|
10
|
+
messages: string[];
|
|
11
|
+
}
|
|
12
|
+
export declare enum BatchProcessStatus {
|
|
13
|
+
pending = "pending",
|
|
14
|
+
success = "success",
|
|
15
|
+
failed = "failed"
|
|
16
|
+
}
|
|
17
|
+
export type ColumnNumberValueName = 'number_values' | 'double_values';
|
|
18
|
+
export type ColumnValueName = ColumnNumberValueName | 'string_values' | 'object_values' | 'date_values' | 'array_of_objects';
|
|
19
|
+
export interface ContactListDto extends ListApiResponse {
|
|
20
|
+
items: ContactResponseDto[];
|
|
21
|
+
}
|
|
22
|
+
export interface ListApiResponse {
|
|
23
|
+
total: number;
|
|
24
|
+
}
|
|
25
|
+
export interface ContactParamsDto {
|
|
26
|
+
contact_book?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface ContactRequestDto {
|
|
29
|
+
id?: string;
|
|
30
|
+
data: FieldValueRequestDto[];
|
|
31
|
+
}
|
|
32
|
+
export interface ContactResponseDto {
|
|
33
|
+
id: string;
|
|
34
|
+
created_at: Date;
|
|
35
|
+
updated_at: Date;
|
|
36
|
+
fieldValues: Record<string, FieldValueResponseDto>;
|
|
37
|
+
}
|
|
38
|
+
export interface ContactSearchParamsDto extends ReturnType<typeof IntersectionType<OrderParams, ListApiParams>> {
|
|
39
|
+
contact_book?: string;
|
|
40
|
+
q?: string;
|
|
41
|
+
filter?: string | DynamicFilterDto;
|
|
42
|
+
contactIds?: string[];
|
|
43
|
+
projection?: string[];
|
|
44
|
+
}
|
|
45
|
+
export interface OrderParams {
|
|
46
|
+
order?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface ListApiParams {
|
|
49
|
+
take?: number;
|
|
50
|
+
skip?: number;
|
|
51
|
+
}
|
|
52
|
+
export interface CreateContactDto {
|
|
53
|
+
contact_book?: string;
|
|
54
|
+
data: FieldValueRequestDto[];
|
|
55
|
+
}
|
|
56
|
+
export interface CreateMultipleContactsDto {
|
|
57
|
+
contact_book?: string;
|
|
58
|
+
contacts: ContactRequestDto[];
|
|
59
|
+
}
|
|
60
|
+
export interface DeleteContactMultiParamsDto extends DeleteContactParamsDto {
|
|
61
|
+
ids?: string[];
|
|
62
|
+
contact_book?: string;
|
|
63
|
+
all?: true;
|
|
64
|
+
}
|
|
65
|
+
export interface DeleteContactParamsDto {
|
|
66
|
+
contact_book?: string;
|
|
67
|
+
}
|
|
68
|
+
export interface FindAllParamsDto extends ReturnType<typeof OmitType<ContactSearchParamsDto, 'order' | 'take' | 'skip'>> {
|
|
69
|
+
size?: number;
|
|
70
|
+
from?: number;
|
|
71
|
+
orderProperty?: string;
|
|
72
|
+
orderDirection?: OrderDirection;
|
|
73
|
+
}
|
|
74
|
+
export type OrderDirection = 'asc' | 'desc';
|
|
75
|
+
export type OrderType = {
|
|
76
|
+
by: string;
|
|
77
|
+
order: 'asc' | 'desc';
|
|
78
|
+
};
|
|
79
|
+
export interface LinkContactMultiParamsDto {
|
|
80
|
+
ids: string[];
|
|
81
|
+
contact_books: string[];
|
|
82
|
+
}
|
|
83
|
+
export interface LinkContactParamsDto {
|
|
84
|
+
contact_book: string;
|
|
85
|
+
}
|
|
86
|
+
export interface MergeContactParamsDto {
|
|
87
|
+
contact_book: string;
|
|
88
|
+
mergeContactId: string;
|
|
89
|
+
}
|
|
90
|
+
export interface UnlinkContactMultiParamsDto extends UnlinkContactParamsDto {
|
|
91
|
+
ids: string[];
|
|
92
|
+
}
|
|
93
|
+
export interface UnlinkContactParamsDto {
|
|
94
|
+
contact_book: string;
|
|
95
|
+
}
|
|
96
|
+
export interface UpdateContactDto extends CreateContactDto {
|
|
97
|
+
}
|
|
98
|
+
export interface ContactBookDeleteParamsDto {
|
|
99
|
+
softDelete?: boolean;
|
|
100
|
+
}
|
|
101
|
+
export interface ContactBookFieldSchemaDto extends CreateFieldSchemaDto {
|
|
102
|
+
id?: string;
|
|
103
|
+
}
|
|
104
|
+
export interface CreateFieldSchemaDto extends MachineNameParamDto {
|
|
105
|
+
label: string;
|
|
106
|
+
singular_label?: string;
|
|
107
|
+
properties?: Record<string, string>;
|
|
108
|
+
type: ColumnTypes;
|
|
109
|
+
readonly?: boolean;
|
|
110
|
+
schemaPresets?: SchemaPresetResponseDto[];
|
|
111
|
+
}
|
|
112
|
+
export declare enum ColumnTypes {
|
|
113
|
+
string = "string",
|
|
114
|
+
integer = "integer",
|
|
115
|
+
double = "double",
|
|
116
|
+
date = "date",
|
|
117
|
+
md = "md",
|
|
118
|
+
'identifier object' = "identifier object",
|
|
119
|
+
'array of identifiers' = "array of identifiers",
|
|
120
|
+
'array of objects' = "array of objects",
|
|
121
|
+
'array of strings' = "array of strings"
|
|
122
|
+
}
|
|
123
|
+
export interface MachineNameParamDto {
|
|
124
|
+
machine_name: string;
|
|
125
|
+
}
|
|
126
|
+
export interface ContactBookListDto extends ListApiResponse {
|
|
127
|
+
items: ContactBookResponseDto[];
|
|
128
|
+
}
|
|
129
|
+
export interface ContactBookParamsDto extends ReturnType<typeof IntersectionType<OrderParams, ListApiParams>> {
|
|
130
|
+
q?: string;
|
|
131
|
+
}
|
|
132
|
+
export interface ContactBookResponseDto extends CreateContactBookDto {
|
|
133
|
+
id: string;
|
|
134
|
+
created_at: Date;
|
|
135
|
+
updated_at: Date;
|
|
136
|
+
contactsCount: number;
|
|
137
|
+
status?: SharedBookStatus;
|
|
138
|
+
sharedBy?: string;
|
|
139
|
+
contactPermission: SharedBookContactPermissionResponseDto;
|
|
140
|
+
}
|
|
141
|
+
export interface SharedBookContactPermissionResponseDto extends CreateSharedBookContactPermissionDto {
|
|
142
|
+
id: string;
|
|
143
|
+
}
|
|
144
|
+
export interface CreateSharedBookContactPermissionDto {
|
|
145
|
+
edit?: boolean;
|
|
146
|
+
delete?: boolean;
|
|
147
|
+
create?: boolean;
|
|
148
|
+
}
|
|
149
|
+
export interface CreateContactBookDto {
|
|
150
|
+
id?: string;
|
|
151
|
+
label: string;
|
|
152
|
+
fieldSchemas: ContactBookFieldSchemaDto[];
|
|
153
|
+
schemaPresets?: SchemaPresetResponseDto[];
|
|
154
|
+
}
|
|
155
|
+
export interface UpdateContactBookDto extends ReturnType<typeof PartialType<CreateContactBookDto>> {
|
|
156
|
+
}
|
|
157
|
+
export interface CrossAccountMetaDto {
|
|
158
|
+
id: string;
|
|
159
|
+
created_at: Date;
|
|
160
|
+
updated_at: Date;
|
|
161
|
+
account_name: string;
|
|
162
|
+
account_id: string;
|
|
163
|
+
original_book_id: string;
|
|
164
|
+
}
|
|
165
|
+
export interface MigrationStateResponseDto {
|
|
166
|
+
state: MigrationState;
|
|
167
|
+
}
|
|
168
|
+
export declare enum MigrationState {
|
|
169
|
+
InProgress = "InProgress",
|
|
170
|
+
ToDo = "ToDo",
|
|
171
|
+
Done = "Done"
|
|
172
|
+
}
|
|
173
|
+
export interface FieldSchemaDeleteParamsDto {
|
|
174
|
+
softDelete?: boolean;
|
|
175
|
+
}
|
|
176
|
+
export interface FieldSchemaListParamsDto extends ReturnType<typeof IntersectionType<OrderParams, ListApiParams>> {
|
|
177
|
+
q?: string;
|
|
178
|
+
}
|
|
179
|
+
export interface FieldSchemaListDto extends ListApiResponse {
|
|
180
|
+
items: FieldSchemaResponseDto[];
|
|
181
|
+
}
|
|
182
|
+
export interface FieldSchemaReadonlyParamsDto {
|
|
183
|
+
readonly: boolean;
|
|
184
|
+
fields: string[];
|
|
185
|
+
}
|
|
186
|
+
export interface FieldSchemaResponseDto extends CreateFieldSchemaDto {
|
|
187
|
+
id: string;
|
|
188
|
+
}
|
|
189
|
+
export interface UpdateFieldSchemaDto extends ReturnType<typeof PartialType<ReturnType<typeof OmitType<CreateFieldSchemaDto, 'type' | 'machine_name' | 'readonly'>>>> {
|
|
190
|
+
}
|
|
191
|
+
export interface DeleteFieldValueByMachineNameDto extends ReturnType<typeof OmitType<UpsertFieldValueByMachineNameDto, 'value'>> {
|
|
192
|
+
}
|
|
193
|
+
export interface UpsertFieldValueByMachineNameDto {
|
|
194
|
+
contact: string;
|
|
195
|
+
machine_name: string;
|
|
196
|
+
value: any;
|
|
197
|
+
}
|
|
198
|
+
export interface FieldValueRequestDto {
|
|
199
|
+
value: any;
|
|
200
|
+
schemaId?: string;
|
|
201
|
+
machine_name?: string;
|
|
202
|
+
id?: string;
|
|
203
|
+
}
|
|
204
|
+
export interface FieldValueResponseDto {
|
|
205
|
+
id: string;
|
|
206
|
+
value: unknown;
|
|
207
|
+
schemaId: string;
|
|
208
|
+
machine_name: string;
|
|
209
|
+
}
|
|
210
|
+
export interface ContactFilterConditionDto extends AbstractFilterCondition {
|
|
211
|
+
contactField: 'created_at' | 'updated_at' | 'id';
|
|
212
|
+
}
|
|
213
|
+
export interface AbstractFilterCondition {
|
|
214
|
+
operator: string;
|
|
215
|
+
value: any;
|
|
216
|
+
}
|
|
217
|
+
export interface CreateFilterDto {
|
|
218
|
+
name: string;
|
|
219
|
+
contact_book?: string;
|
|
220
|
+
match_all: boolean;
|
|
221
|
+
conditions: FieldValueFilterConditionDto[] | ContactFilterConditionDto[];
|
|
222
|
+
}
|
|
223
|
+
export interface DynamicFilterDto extends ReturnType<typeof OmitType<CreateFilterDto, 'name'>> {
|
|
224
|
+
}
|
|
225
|
+
export interface FieldValueFilterConditionDto extends AbstractFilterCondition {
|
|
226
|
+
machine_name: string;
|
|
227
|
+
propertyPath?: string[];
|
|
228
|
+
}
|
|
229
|
+
export interface FilterListParamsDto extends ListApiParams {
|
|
230
|
+
contact_book?: string;
|
|
231
|
+
}
|
|
232
|
+
export interface FilterListDto extends ListApiResponse {
|
|
233
|
+
items: FilterResponseDto[];
|
|
234
|
+
}
|
|
235
|
+
export interface FilterResponseDto extends ReturnType<typeof OmitType<CreateFilterDto, 'contact_book'>> {
|
|
236
|
+
id: string;
|
|
237
|
+
created_at: Date;
|
|
238
|
+
updated_at: Date;
|
|
239
|
+
}
|
|
240
|
+
export interface UpdateFilterDto extends ReturnType<typeof PartialType<ReturnType<typeof OmitType<CreateFilterDto, 'contact_book'>>>> {
|
|
241
|
+
}
|
|
242
|
+
export interface CreateSchemaPresetDto {
|
|
243
|
+
label: string;
|
|
244
|
+
fieldSchemas?: FieldSchemaResponseDto[];
|
|
245
|
+
}
|
|
246
|
+
export interface SchemaPresetListDto extends ListApiResponse {
|
|
247
|
+
items: SchemaPresetResponseDto[];
|
|
248
|
+
}
|
|
249
|
+
export interface SchemaPresetResponseDto extends CreateSchemaPresetDto {
|
|
250
|
+
id: string;
|
|
251
|
+
created_at: Date;
|
|
252
|
+
updated_at: Date;
|
|
253
|
+
}
|
|
254
|
+
export interface UpdateSchemaPresetDto extends ReturnType<typeof PartialType<CreateSchemaPresetDto>> {
|
|
255
|
+
}
|
|
256
|
+
export interface ShareContactBookParamsDto {
|
|
257
|
+
targetAccountId: string;
|
|
258
|
+
custom_book_name?: string;
|
|
259
|
+
contactPermission?: CreateSharedBookContactPermissionDto;
|
|
260
|
+
}
|
|
261
|
+
export interface SharedBookResponseDto {
|
|
262
|
+
id: string;
|
|
263
|
+
approved_by?: string;
|
|
264
|
+
created_at: Date;
|
|
265
|
+
updated_at: Date;
|
|
266
|
+
status: SharedBookStatus;
|
|
267
|
+
target_account: string;
|
|
268
|
+
account_name?: string;
|
|
269
|
+
custom_book_name?: string;
|
|
270
|
+
contact_book: string;
|
|
271
|
+
contactPermission: SharedBookContactPermissionResponseDto;
|
|
272
|
+
}
|
|
273
|
+
export declare enum SharedBookStatus {
|
|
274
|
+
pending = "pending",
|
|
275
|
+
shared = "shared",
|
|
276
|
+
canceled = "canceled",
|
|
277
|
+
deletedFromTarget = "deletedFromTarget",
|
|
278
|
+
deletedFromSource = "deletedFromSource"
|
|
279
|
+
}
|
|
280
|
+
export interface SharedBookContactPermissionListDto extends ListApiResponse {
|
|
281
|
+
items: SharedBookContactPermissionResponseDto[];
|
|
282
|
+
}
|
|
283
|
+
export interface SharedBookContactPermissionParamsDto extends ReturnType<typeof IntersectionType<OrderParams, ListApiParams>> {
|
|
284
|
+
}
|
|
285
|
+
export interface UpdateSharedBookContactPermissionDto extends CreateSharedBookContactPermissionDto {
|
|
286
|
+
}
|
|
287
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export var BatchProcessStatus;
|
|
2
|
+
(function (BatchProcessStatus) {
|
|
3
|
+
BatchProcessStatus["pending"] = "pending";
|
|
4
|
+
BatchProcessStatus["success"] = "success";
|
|
5
|
+
BatchProcessStatus["failed"] = "failed";
|
|
6
|
+
})(BatchProcessStatus || (BatchProcessStatus = {}));
|
|
7
|
+
export var ColumnTypes;
|
|
8
|
+
(function (ColumnTypes) {
|
|
9
|
+
ColumnTypes["string"] = "string";
|
|
10
|
+
ColumnTypes["integer"] = "integer";
|
|
11
|
+
ColumnTypes["double"] = "double";
|
|
12
|
+
ColumnTypes["date"] = "date";
|
|
13
|
+
ColumnTypes["md"] = "md";
|
|
14
|
+
ColumnTypes["identifier object"] = "identifier object";
|
|
15
|
+
ColumnTypes["array of identifiers"] = "array of identifiers";
|
|
16
|
+
ColumnTypes["array of objects"] = "array of objects";
|
|
17
|
+
ColumnTypes["array of strings"] = "array of strings";
|
|
18
|
+
})(ColumnTypes || (ColumnTypes = {}));
|
|
19
|
+
export var MigrationState;
|
|
20
|
+
(function (MigrationState) {
|
|
21
|
+
MigrationState["InProgress"] = "InProgress";
|
|
22
|
+
MigrationState["ToDo"] = "ToDo";
|
|
23
|
+
MigrationState["Done"] = "Done";
|
|
24
|
+
})(MigrationState || (MigrationState = {}));
|
|
25
|
+
export var SharedBookStatus;
|
|
26
|
+
(function (SharedBookStatus) {
|
|
27
|
+
SharedBookStatus["pending"] = "pending";
|
|
28
|
+
SharedBookStatus["shared"] = "shared";
|
|
29
|
+
SharedBookStatus["canceled"] = "canceled";
|
|
30
|
+
SharedBookStatus["deletedFromTarget"] = "deletedFromTarget";
|
|
31
|
+
SharedBookStatus["deletedFromSource"] = "deletedFromSource";
|
|
32
|
+
})(SharedBookStatus || (SharedBookStatus = {}));
|
package/package.json
CHANGED
|
@@ -1,19 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onereach/types-contacts-api",
|
|
3
3
|
"description": "Generated types for Contacts Api",
|
|
4
|
-
"version": "4.3.
|
|
4
|
+
"version": "4.3.2-beta.2135.0",
|
|
5
5
|
"author": "OneReach.ai",
|
|
6
|
-
"main": "
|
|
6
|
+
"main": "dist/cjs/index.js",
|
|
7
|
+
"module": "dist/esm/index.js",
|
|
8
|
+
"types": "dist/esm/index.d.ts",
|
|
7
9
|
"publishConfig": {
|
|
8
10
|
"access": "public"
|
|
9
11
|
},
|
|
10
12
|
"scripts": {
|
|
11
|
-
"
|
|
13
|
+
"prebuild": "rimraf ./dist",
|
|
14
|
+
"build": "pnpm build:esm && pnpm build:cjs",
|
|
15
|
+
"build:esm": "tsc --project tsconfig.build.esm.json",
|
|
16
|
+
"build:cjs": "tsc --project tsconfig.build.cjs.json",
|
|
17
|
+
"generate": "ts-node ./src/generate-types.ts",
|
|
18
|
+
"build:types": "pnpm generate && pnpm build"
|
|
12
19
|
},
|
|
13
20
|
"devDependencies": {
|
|
14
|
-
"@types/node": "
|
|
15
|
-
"ts-morph": "
|
|
16
|
-
"ts-node": "
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
"@types/node": "18.11.10",
|
|
22
|
+
"ts-morph": "17.0.1",
|
|
23
|
+
"ts-node": "10.9.1",
|
|
24
|
+
"rimraf": "5.0.1"
|
|
25
|
+
}
|
|
19
26
|
}
|
|
@@ -13,11 +13,13 @@ import {
|
|
|
13
13
|
TypeAliasDeclaration,
|
|
14
14
|
} from 'ts-morph';
|
|
15
15
|
|
|
16
|
-
const ROOT = path.resolve(__dirname, '
|
|
17
|
-
const TYPES_DIST = path.resolve(ROOT, '
|
|
16
|
+
const ROOT = path.resolve(__dirname, '../');
|
|
17
|
+
const TYPES_DIST = path.resolve(ROOT, 'tmp');
|
|
18
18
|
const API_PATH = path.resolve(ROOT, '../api');
|
|
19
19
|
const apiTsconfig = path.resolve(API_PATH, 'tsconfig.json');
|
|
20
20
|
const typesTsconfig = path.resolve(ROOT, 'tsconfig.json');
|
|
21
|
+
const utilsTypes = path.resolve(__dirname, 'swagger-type-mock.ts');
|
|
22
|
+
const rawTypes = path.resolve(ROOT, 'tmp/index.ts');
|
|
21
23
|
|
|
22
24
|
if (fs.existsSync(TYPES_DIST)) {
|
|
23
25
|
fs.rmSync(TYPES_DIST, { recursive: true });
|
|
@@ -32,8 +34,8 @@ const apiProject = new Project({
|
|
|
32
34
|
});
|
|
33
35
|
|
|
34
36
|
|
|
35
|
-
const FILE = typesProject.createSourceFile(
|
|
36
|
-
const SWAGGER_MOCK = typesProject.getSourceFile(
|
|
37
|
+
const FILE = typesProject.createSourceFile(rawTypes);
|
|
38
|
+
const SWAGGER_MOCK = typesProject.getSourceFile(utilsTypes);
|
|
37
39
|
|
|
38
40
|
function generateTypes() {
|
|
39
41
|
FILE.replaceWithText(SWAGGER_MOCK?.getText() || '');
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../tsconfig.options.json",
|
|
3
|
+
"include": ["tmp"],
|
|
4
|
+
"exclude": ["node_modules"],
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"module": "commonjs",
|
|
7
|
+
"strictPropertyInitialization": false,
|
|
8
|
+
"emitDecoratorMetadata": true,
|
|
9
|
+
"experimentalDecorators": true,
|
|
10
|
+
"declaration": true,
|
|
11
|
+
"baseUrl": "./",
|
|
12
|
+
"outDir": "dist",
|
|
13
|
+
"types": ["node"]
|
|
14
|
+
}
|
|
15
|
+
}
|
package/tsconfig.json
CHANGED
|
File without changes
|