@opencx/mcp 1.15.38 → 1.15.40

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.
@@ -0,0 +1,612 @@
1
+ import { z } from 'zod';
2
+ export declare const contactSegmentDefinitionSchema: z.ZodNullable<z.ZodObject<{
3
+ or: z.ZodArray<z.ZodObject<{
4
+ and: z.ZodArray<z.ZodUnion<[z.ZodObject<{
5
+ type: z.ZodLiteral<"all_contacts">;
6
+ }, "strip", z.ZodTypeAny, {
7
+ type: "all_contacts";
8
+ }, {
9
+ type: "all_contacts";
10
+ }>, z.ZodObject<{
11
+ type: z.ZodLiteral<"contact_id_in">;
12
+ contact_ids: z.ZodArray<z.ZodString, "many">;
13
+ }, "strip", z.ZodTypeAny, {
14
+ contact_ids: string[];
15
+ type: "contact_id_in";
16
+ }, {
17
+ contact_ids: string[];
18
+ type: "contact_id_in";
19
+ }>, z.ZodObject<{
20
+ after: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
21
+ before: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
22
+ type: z.ZodLiteral<"contacts_created_at_between">;
23
+ }, "strip", z.ZodTypeAny, {
24
+ type: "contacts_created_at_between";
25
+ after?: string | undefined;
26
+ before?: string | undefined;
27
+ }, {
28
+ type: "contacts_created_at_between";
29
+ after?: string | undefined;
30
+ before?: string | undefined;
31
+ }>, z.ZodObject<{
32
+ type: z.ZodLiteral<"contacts_email_domain_name_in">;
33
+ domain_name_in: z.ZodArray<z.ZodString, "many">;
34
+ }, "strip", z.ZodTypeAny, {
35
+ type: "contacts_email_domain_name_in";
36
+ domain_name_in: string[];
37
+ }, {
38
+ type: "contacts_email_domain_name_in";
39
+ domain_name_in: string[];
40
+ }>, z.ZodObject<{
41
+ type: z.ZodLiteral<"contacts_affected_by_sequence">;
42
+ sequence_id: z.ZodString;
43
+ }, "strip", z.ZodTypeAny, {
44
+ type: "contacts_affected_by_sequence";
45
+ sequence_id: string;
46
+ }, {
47
+ type: "contacts_affected_by_sequence";
48
+ sequence_id: string;
49
+ }>, z.ZodObject<{
50
+ type: z.ZodLiteral<"contacts_name_in">;
51
+ name_in: z.ZodArray<z.ZodString, "many">;
52
+ }, "strip", z.ZodTypeAny, {
53
+ type: "contacts_name_in";
54
+ name_in: string[];
55
+ }, {
56
+ type: "contacts_name_in";
57
+ name_in: string[];
58
+ }>, z.ZodObject<{
59
+ type: z.ZodLiteral<"contacts_phone_number_in">;
60
+ phone_number_in: z.ZodArray<z.ZodString, "many">;
61
+ }, "strip", z.ZodTypeAny, {
62
+ type: "contacts_phone_number_in";
63
+ phone_number_in: string[];
64
+ }, {
65
+ type: "contacts_phone_number_in";
66
+ phone_number_in: string[];
67
+ }>, z.ZodObject<{
68
+ type: z.ZodLiteral<"contacts_email_in">;
69
+ email_in: z.ZodArray<z.ZodString, "many">;
70
+ }, "strip", z.ZodTypeAny, {
71
+ type: "contacts_email_in";
72
+ email_in: string[];
73
+ }, {
74
+ type: "contacts_email_in";
75
+ email_in: string[];
76
+ }>, z.ZodObject<{
77
+ type: z.ZodLiteral<"contacts_attributes_in">;
78
+ attributes: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodString>, "many">>;
79
+ }, "strip", z.ZodTypeAny, {
80
+ type: "contacts_attributes_in";
81
+ attributes?: Record<string, string>[] | undefined;
82
+ }, {
83
+ type: "contacts_attributes_in";
84
+ attributes?: Record<string, string>[] | undefined;
85
+ }>, z.ZodObject<{
86
+ type: z.ZodLiteral<"contacts_sessions_attributes_in">;
87
+ attributes: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodString>, "many">>;
88
+ }, "strip", z.ZodTypeAny, {
89
+ type: "contacts_sessions_attributes_in";
90
+ attributes?: Record<string, string>[] | undefined;
91
+ }, {
92
+ type: "contacts_sessions_attributes_in";
93
+ attributes?: Record<string, string>[] | undefined;
94
+ }>, z.ZodObject<{
95
+ type: z.ZodLiteral<"contact_belongs_to_segment">;
96
+ segment_id: z.ZodString;
97
+ belongs: z.ZodOptional<z.ZodBoolean>;
98
+ }, "strip", z.ZodTypeAny, {
99
+ type: "contact_belongs_to_segment";
100
+ segment_id: string;
101
+ belongs?: boolean | undefined;
102
+ }, {
103
+ type: "contact_belongs_to_segment";
104
+ segment_id: string;
105
+ belongs?: boolean | undefined;
106
+ }>, z.ZodObject<{
107
+ after: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
108
+ before: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
109
+ type: z.ZodLiteral<"last_contacted_at_between">;
110
+ }, "strip", z.ZodTypeAny, {
111
+ type: "last_contacted_at_between";
112
+ after?: string | undefined;
113
+ before?: string | undefined;
114
+ }, {
115
+ type: "last_contacted_at_between";
116
+ after?: string | undefined;
117
+ before?: string | undefined;
118
+ }>, z.ZodObject<{
119
+ after: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
120
+ before: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
121
+ type: z.ZodLiteral<"last_contacted_at_with_handoff_between">;
122
+ }, "strip", z.ZodTypeAny, {
123
+ type: "last_contacted_at_with_handoff_between";
124
+ after?: string | undefined;
125
+ before?: string | undefined;
126
+ }, {
127
+ type: "last_contacted_at_with_handoff_between";
128
+ after?: string | undefined;
129
+ before?: string | undefined;
130
+ }>, z.ZodObject<{
131
+ type: z.ZodLiteral<"contact_has_phone">;
132
+ has: z.ZodBoolean;
133
+ }, "strip", z.ZodTypeAny, {
134
+ has: boolean;
135
+ type: "contact_has_phone";
136
+ }, {
137
+ has: boolean;
138
+ type: "contact_has_phone";
139
+ }>, z.ZodObject<{
140
+ type: z.ZodLiteral<"contact_has_email">;
141
+ has: z.ZodBoolean;
142
+ }, "strip", z.ZodTypeAny, {
143
+ has: boolean;
144
+ type: "contact_has_email";
145
+ }, {
146
+ has: boolean;
147
+ type: "contact_has_email";
148
+ }>, z.ZodObject<{
149
+ type: z.ZodLiteral<"contact_is_blocked">;
150
+ blocked: z.ZodBoolean;
151
+ }, "strip", z.ZodTypeAny, {
152
+ type: "contact_is_blocked";
153
+ blocked: boolean;
154
+ }, {
155
+ type: "contact_is_blocked";
156
+ blocked: boolean;
157
+ }>, z.ZodObject<{
158
+ type: z.ZodLiteral<"contact_is_unsubscribed">;
159
+ unsubscribed: z.ZodBoolean;
160
+ }, "strip", z.ZodTypeAny, {
161
+ type: "contact_is_unsubscribed";
162
+ unsubscribed: boolean;
163
+ }, {
164
+ type: "contact_is_unsubscribed";
165
+ unsubscribed: boolean;
166
+ }>, z.ZodObject<{
167
+ type: z.ZodLiteral<"contacts_custom_data">;
168
+ conditions: z.ZodArray<z.ZodObject<{
169
+ key: z.ZodString;
170
+ op: z.ZodEnum<["exists", "not_exists", "eq", "neq", "contains"]>;
171
+ value: z.ZodOptional<z.ZodString>;
172
+ }, "strip", z.ZodTypeAny, {
173
+ key: string;
174
+ op: "exists" | "not_exists" | "eq" | "neq" | "contains";
175
+ value?: string | undefined;
176
+ }, {
177
+ key: string;
178
+ op: "exists" | "not_exists" | "eq" | "neq" | "contains";
179
+ value?: string | undefined;
180
+ }>, "atleastone">;
181
+ }, "strip", z.ZodTypeAny, {
182
+ type: "contacts_custom_data";
183
+ conditions: [{
184
+ key: string;
185
+ op: "exists" | "not_exists" | "eq" | "neq" | "contains";
186
+ value?: string | undefined;
187
+ }, ...{
188
+ key: string;
189
+ op: "exists" | "not_exists" | "eq" | "neq" | "contains";
190
+ value?: string | undefined;
191
+ }[]];
192
+ }, {
193
+ type: "contacts_custom_data";
194
+ conditions: [{
195
+ key: string;
196
+ op: "exists" | "not_exists" | "eq" | "neq" | "contains";
197
+ value?: string | undefined;
198
+ }, ...{
199
+ key: string;
200
+ op: "exists" | "not_exists" | "eq" | "neq" | "contains";
201
+ value?: string | undefined;
202
+ }[]];
203
+ }>]>, "many">;
204
+ }, "strip", z.ZodTypeAny, {
205
+ and: ({
206
+ type: "all_contacts";
207
+ } | {
208
+ contact_ids: string[];
209
+ type: "contact_id_in";
210
+ } | {
211
+ type: "contacts_created_at_between";
212
+ after?: string | undefined;
213
+ before?: string | undefined;
214
+ } | {
215
+ type: "contacts_email_domain_name_in";
216
+ domain_name_in: string[];
217
+ } | {
218
+ type: "contacts_affected_by_sequence";
219
+ sequence_id: string;
220
+ } | {
221
+ type: "contacts_name_in";
222
+ name_in: string[];
223
+ } | {
224
+ type: "contacts_phone_number_in";
225
+ phone_number_in: string[];
226
+ } | {
227
+ type: "contacts_email_in";
228
+ email_in: string[];
229
+ } | {
230
+ type: "contacts_attributes_in";
231
+ attributes?: Record<string, string>[] | undefined;
232
+ } | {
233
+ type: "contacts_sessions_attributes_in";
234
+ attributes?: Record<string, string>[] | undefined;
235
+ } | {
236
+ type: "contact_belongs_to_segment";
237
+ segment_id: string;
238
+ belongs?: boolean | undefined;
239
+ } | {
240
+ type: "last_contacted_at_between";
241
+ after?: string | undefined;
242
+ before?: string | undefined;
243
+ } | {
244
+ type: "last_contacted_at_with_handoff_between";
245
+ after?: string | undefined;
246
+ before?: string | undefined;
247
+ } | {
248
+ has: boolean;
249
+ type: "contact_has_phone";
250
+ } | {
251
+ has: boolean;
252
+ type: "contact_has_email";
253
+ } | {
254
+ type: "contact_is_blocked";
255
+ blocked: boolean;
256
+ } | {
257
+ type: "contact_is_unsubscribed";
258
+ unsubscribed: boolean;
259
+ } | {
260
+ type: "contacts_custom_data";
261
+ conditions: [{
262
+ key: string;
263
+ op: "exists" | "not_exists" | "eq" | "neq" | "contains";
264
+ value?: string | undefined;
265
+ }, ...{
266
+ key: string;
267
+ op: "exists" | "not_exists" | "eq" | "neq" | "contains";
268
+ value?: string | undefined;
269
+ }[]];
270
+ })[];
271
+ }, {
272
+ and: ({
273
+ type: "all_contacts";
274
+ } | {
275
+ contact_ids: string[];
276
+ type: "contact_id_in";
277
+ } | {
278
+ type: "contacts_created_at_between";
279
+ after?: string | undefined;
280
+ before?: string | undefined;
281
+ } | {
282
+ type: "contacts_email_domain_name_in";
283
+ domain_name_in: string[];
284
+ } | {
285
+ type: "contacts_affected_by_sequence";
286
+ sequence_id: string;
287
+ } | {
288
+ type: "contacts_name_in";
289
+ name_in: string[];
290
+ } | {
291
+ type: "contacts_phone_number_in";
292
+ phone_number_in: string[];
293
+ } | {
294
+ type: "contacts_email_in";
295
+ email_in: string[];
296
+ } | {
297
+ type: "contacts_attributes_in";
298
+ attributes?: Record<string, string>[] | undefined;
299
+ } | {
300
+ type: "contacts_sessions_attributes_in";
301
+ attributes?: Record<string, string>[] | undefined;
302
+ } | {
303
+ type: "contact_belongs_to_segment";
304
+ segment_id: string;
305
+ belongs?: boolean | undefined;
306
+ } | {
307
+ type: "last_contacted_at_between";
308
+ after?: string | undefined;
309
+ before?: string | undefined;
310
+ } | {
311
+ type: "last_contacted_at_with_handoff_between";
312
+ after?: string | undefined;
313
+ before?: string | undefined;
314
+ } | {
315
+ has: boolean;
316
+ type: "contact_has_phone";
317
+ } | {
318
+ has: boolean;
319
+ type: "contact_has_email";
320
+ } | {
321
+ type: "contact_is_blocked";
322
+ blocked: boolean;
323
+ } | {
324
+ type: "contact_is_unsubscribed";
325
+ unsubscribed: boolean;
326
+ } | {
327
+ type: "contacts_custom_data";
328
+ conditions: [{
329
+ key: string;
330
+ op: "exists" | "not_exists" | "eq" | "neq" | "contains";
331
+ value?: string | undefined;
332
+ }, ...{
333
+ key: string;
334
+ op: "exists" | "not_exists" | "eq" | "neq" | "contains";
335
+ value?: string | undefined;
336
+ }[]];
337
+ })[];
338
+ }>, "atleastone">;
339
+ }, "strip", z.ZodTypeAny, {
340
+ or: [{
341
+ and: ({
342
+ type: "all_contacts";
343
+ } | {
344
+ contact_ids: string[];
345
+ type: "contact_id_in";
346
+ } | {
347
+ type: "contacts_created_at_between";
348
+ after?: string | undefined;
349
+ before?: string | undefined;
350
+ } | {
351
+ type: "contacts_email_domain_name_in";
352
+ domain_name_in: string[];
353
+ } | {
354
+ type: "contacts_affected_by_sequence";
355
+ sequence_id: string;
356
+ } | {
357
+ type: "contacts_name_in";
358
+ name_in: string[];
359
+ } | {
360
+ type: "contacts_phone_number_in";
361
+ phone_number_in: string[];
362
+ } | {
363
+ type: "contacts_email_in";
364
+ email_in: string[];
365
+ } | {
366
+ type: "contacts_attributes_in";
367
+ attributes?: Record<string, string>[] | undefined;
368
+ } | {
369
+ type: "contacts_sessions_attributes_in";
370
+ attributes?: Record<string, string>[] | undefined;
371
+ } | {
372
+ type: "contact_belongs_to_segment";
373
+ segment_id: string;
374
+ belongs?: boolean | undefined;
375
+ } | {
376
+ type: "last_contacted_at_between";
377
+ after?: string | undefined;
378
+ before?: string | undefined;
379
+ } | {
380
+ type: "last_contacted_at_with_handoff_between";
381
+ after?: string | undefined;
382
+ before?: string | undefined;
383
+ } | {
384
+ has: boolean;
385
+ type: "contact_has_phone";
386
+ } | {
387
+ has: boolean;
388
+ type: "contact_has_email";
389
+ } | {
390
+ type: "contact_is_blocked";
391
+ blocked: boolean;
392
+ } | {
393
+ type: "contact_is_unsubscribed";
394
+ unsubscribed: boolean;
395
+ } | {
396
+ type: "contacts_custom_data";
397
+ conditions: [{
398
+ key: string;
399
+ op: "exists" | "not_exists" | "eq" | "neq" | "contains";
400
+ value?: string | undefined;
401
+ }, ...{
402
+ key: string;
403
+ op: "exists" | "not_exists" | "eq" | "neq" | "contains";
404
+ value?: string | undefined;
405
+ }[]];
406
+ })[];
407
+ }, ...{
408
+ and: ({
409
+ type: "all_contacts";
410
+ } | {
411
+ contact_ids: string[];
412
+ type: "contact_id_in";
413
+ } | {
414
+ type: "contacts_created_at_between";
415
+ after?: string | undefined;
416
+ before?: string | undefined;
417
+ } | {
418
+ type: "contacts_email_domain_name_in";
419
+ domain_name_in: string[];
420
+ } | {
421
+ type: "contacts_affected_by_sequence";
422
+ sequence_id: string;
423
+ } | {
424
+ type: "contacts_name_in";
425
+ name_in: string[];
426
+ } | {
427
+ type: "contacts_phone_number_in";
428
+ phone_number_in: string[];
429
+ } | {
430
+ type: "contacts_email_in";
431
+ email_in: string[];
432
+ } | {
433
+ type: "contacts_attributes_in";
434
+ attributes?: Record<string, string>[] | undefined;
435
+ } | {
436
+ type: "contacts_sessions_attributes_in";
437
+ attributes?: Record<string, string>[] | undefined;
438
+ } | {
439
+ type: "contact_belongs_to_segment";
440
+ segment_id: string;
441
+ belongs?: boolean | undefined;
442
+ } | {
443
+ type: "last_contacted_at_between";
444
+ after?: string | undefined;
445
+ before?: string | undefined;
446
+ } | {
447
+ type: "last_contacted_at_with_handoff_between";
448
+ after?: string | undefined;
449
+ before?: string | undefined;
450
+ } | {
451
+ has: boolean;
452
+ type: "contact_has_phone";
453
+ } | {
454
+ has: boolean;
455
+ type: "contact_has_email";
456
+ } | {
457
+ type: "contact_is_blocked";
458
+ blocked: boolean;
459
+ } | {
460
+ type: "contact_is_unsubscribed";
461
+ unsubscribed: boolean;
462
+ } | {
463
+ type: "contacts_custom_data";
464
+ conditions: [{
465
+ key: string;
466
+ op: "exists" | "not_exists" | "eq" | "neq" | "contains";
467
+ value?: string | undefined;
468
+ }, ...{
469
+ key: string;
470
+ op: "exists" | "not_exists" | "eq" | "neq" | "contains";
471
+ value?: string | undefined;
472
+ }[]];
473
+ })[];
474
+ }[]];
475
+ }, {
476
+ or: [{
477
+ and: ({
478
+ type: "all_contacts";
479
+ } | {
480
+ contact_ids: string[];
481
+ type: "contact_id_in";
482
+ } | {
483
+ type: "contacts_created_at_between";
484
+ after?: string | undefined;
485
+ before?: string | undefined;
486
+ } | {
487
+ type: "contacts_email_domain_name_in";
488
+ domain_name_in: string[];
489
+ } | {
490
+ type: "contacts_affected_by_sequence";
491
+ sequence_id: string;
492
+ } | {
493
+ type: "contacts_name_in";
494
+ name_in: string[];
495
+ } | {
496
+ type: "contacts_phone_number_in";
497
+ phone_number_in: string[];
498
+ } | {
499
+ type: "contacts_email_in";
500
+ email_in: string[];
501
+ } | {
502
+ type: "contacts_attributes_in";
503
+ attributes?: Record<string, string>[] | undefined;
504
+ } | {
505
+ type: "contacts_sessions_attributes_in";
506
+ attributes?: Record<string, string>[] | undefined;
507
+ } | {
508
+ type: "contact_belongs_to_segment";
509
+ segment_id: string;
510
+ belongs?: boolean | undefined;
511
+ } | {
512
+ type: "last_contacted_at_between";
513
+ after?: string | undefined;
514
+ before?: string | undefined;
515
+ } | {
516
+ type: "last_contacted_at_with_handoff_between";
517
+ after?: string | undefined;
518
+ before?: string | undefined;
519
+ } | {
520
+ has: boolean;
521
+ type: "contact_has_phone";
522
+ } | {
523
+ has: boolean;
524
+ type: "contact_has_email";
525
+ } | {
526
+ type: "contact_is_blocked";
527
+ blocked: boolean;
528
+ } | {
529
+ type: "contact_is_unsubscribed";
530
+ unsubscribed: boolean;
531
+ } | {
532
+ type: "contacts_custom_data";
533
+ conditions: [{
534
+ key: string;
535
+ op: "exists" | "not_exists" | "eq" | "neq" | "contains";
536
+ value?: string | undefined;
537
+ }, ...{
538
+ key: string;
539
+ op: "exists" | "not_exists" | "eq" | "neq" | "contains";
540
+ value?: string | undefined;
541
+ }[]];
542
+ })[];
543
+ }, ...{
544
+ and: ({
545
+ type: "all_contacts";
546
+ } | {
547
+ contact_ids: string[];
548
+ type: "contact_id_in";
549
+ } | {
550
+ type: "contacts_created_at_between";
551
+ after?: string | undefined;
552
+ before?: string | undefined;
553
+ } | {
554
+ type: "contacts_email_domain_name_in";
555
+ domain_name_in: string[];
556
+ } | {
557
+ type: "contacts_affected_by_sequence";
558
+ sequence_id: string;
559
+ } | {
560
+ type: "contacts_name_in";
561
+ name_in: string[];
562
+ } | {
563
+ type: "contacts_phone_number_in";
564
+ phone_number_in: string[];
565
+ } | {
566
+ type: "contacts_email_in";
567
+ email_in: string[];
568
+ } | {
569
+ type: "contacts_attributes_in";
570
+ attributes?: Record<string, string>[] | undefined;
571
+ } | {
572
+ type: "contacts_sessions_attributes_in";
573
+ attributes?: Record<string, string>[] | undefined;
574
+ } | {
575
+ type: "contact_belongs_to_segment";
576
+ segment_id: string;
577
+ belongs?: boolean | undefined;
578
+ } | {
579
+ type: "last_contacted_at_between";
580
+ after?: string | undefined;
581
+ before?: string | undefined;
582
+ } | {
583
+ type: "last_contacted_at_with_handoff_between";
584
+ after?: string | undefined;
585
+ before?: string | undefined;
586
+ } | {
587
+ has: boolean;
588
+ type: "contact_has_phone";
589
+ } | {
590
+ has: boolean;
591
+ type: "contact_has_email";
592
+ } | {
593
+ type: "contact_is_blocked";
594
+ blocked: boolean;
595
+ } | {
596
+ type: "contact_is_unsubscribed";
597
+ unsubscribed: boolean;
598
+ } | {
599
+ type: "contacts_custom_data";
600
+ conditions: [{
601
+ key: string;
602
+ op: "exists" | "not_exists" | "eq" | "neq" | "contains";
603
+ value?: string | undefined;
604
+ }, ...{
605
+ key: string;
606
+ op: "exists" | "not_exists" | "eq" | "neq" | "contains";
607
+ value?: string | undefined;
608
+ }[]];
609
+ })[];
610
+ }[]];
611
+ }>>;
612
+ //# sourceMappingURL=contact-segment-schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contact-segment-schemas.d.ts","sourceRoot":"","sources":["../../src/tools/contact-segment-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkDxB,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAOM,CAAC"}
@@ -0,0 +1,49 @@
1
+ import { z } from 'zod';
2
+ const dateBound = z.string().refine((value) => z.coerce.date().safeParse(value).success, {
3
+ message: 'Provide a valid date string',
4
+ });
5
+ const dates = { after: dateBound.optional(), before: dateBound.optional() };
6
+ const attributes = z.array(z.record(z.string(), z.string())).optional();
7
+ const filterSchema = z.union([
8
+ z.object({ type: z.literal('all_contacts') }),
9
+ z.object({ type: z.literal('contact_id_in'), contact_ids: z.array(z.string().uuid()) }),
10
+ z.object({ type: z.literal('contacts_created_at_between'), ...dates }),
11
+ z.object({
12
+ type: z.literal('contacts_email_domain_name_in'),
13
+ domain_name_in: z.array(z.string()),
14
+ }),
15
+ z.object({ type: z.literal('contacts_affected_by_sequence'), sequence_id: z.string() }),
16
+ z.object({ type: z.literal('contacts_name_in'), name_in: z.array(z.string()) }),
17
+ z.object({ type: z.literal('contacts_phone_number_in'), phone_number_in: z.array(z.string()) }),
18
+ z.object({ type: z.literal('contacts_email_in'), email_in: z.array(z.string()) }),
19
+ z.object({ type: z.literal('contacts_attributes_in'), attributes }),
20
+ z.object({ type: z.literal('contacts_sessions_attributes_in'), attributes }),
21
+ z.object({
22
+ type: z.literal('contact_belongs_to_segment'),
23
+ segment_id: z.string(),
24
+ belongs: z.boolean().optional(),
25
+ }),
26
+ z.object({ type: z.literal('last_contacted_at_between'), ...dates }),
27
+ z.object({ type: z.literal('last_contacted_at_with_handoff_between'), ...dates }),
28
+ z.object({ type: z.literal('contact_has_phone'), has: z.boolean() }),
29
+ z.object({ type: z.literal('contact_has_email'), has: z.boolean() }),
30
+ z.object({ type: z.literal('contact_is_blocked'), blocked: z.boolean() }),
31
+ z.object({ type: z.literal('contact_is_unsubscribed'), unsubscribed: z.boolean() }),
32
+ z.object({
33
+ type: z.literal('contacts_custom_data'),
34
+ conditions: z
35
+ .array(z.object({
36
+ key: z.string().min(1),
37
+ op: z.enum(['exists', 'not_exists', 'eq', 'neq', 'contains']),
38
+ value: z.string().optional(),
39
+ }))
40
+ .nonempty(),
41
+ }),
42
+ ]);
43
+ export const contactSegmentDefinitionSchema = z
44
+ .object({
45
+ or: z.array(z.object({ and: z.array(filterSchema) })).nonempty(),
46
+ })
47
+ .nullable()
48
+ .describe('Contact filter rules: OR groups of AND conditions. Null matches all contacts; an empty AND group also matches all contacts.');
49
+ //# sourceMappingURL=contact-segment-schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contact-segment-schemas.js","sourceRoot":"","sources":["../../src/tools/contact-segment-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE;IACvF,OAAO,EAAE,6BAA6B;CACvC,CAAC,CAAC;AACH,MAAM,KAAK,GAAG,EAAE,KAAK,EAAE,SAAS,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,SAAS,CAAC,QAAQ,EAAE,EAAE,CAAC;AAC5E,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;AACxE,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC;IAC3B,CAAC,CAAC,MAAM,CAAC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CAAC,CAAC,OAAO,CAAC,sBAAsB,CAAC;QACvC,UAAU,EAAE,CAAC;aACV,KAAK,CACJ,CAAC,CAAC,MAAM,CAAC;YACP,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;YACtB,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;YAC7D,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;SAC7B,CAAC,CACH;aACA,QAAQ,EAAE;KACd,CAAC;CACH,CAAoC,CAAC;AAEtC,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC;KAC5C,MAAM,CAAC;IACN,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE;CACjE,CAAC;KACD,QAAQ,EAAE;KACV,QAAQ,CACP,6HAA6H,CAChF,CAAC"}
@@ -1,4 +1,4 @@
1
- import { type McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import type { OpenCXClient } from '../api-client.js';
3
3
  export declare function registerContactSegmentTools(server: McpServer, client: OpenCXClient): void;
4
4
  //# sourceMappingURL=contact-segments.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"contact-segments.d.ts","sourceRoot":"","sources":["../../src/tools/contact-segments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,QA2ElF"}
1
+ {"version":3,"file":"contact-segments.d.ts","sourceRoot":"","sources":["../../src/tools/contact-segments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AASrD,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,QAiJlF"}