@hasna/contacts 0.6.29 → 0.6.31

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.
@@ -50,6 +50,807 @@ export declare class ContactsPgStore {
50
50
  companies: number;
51
51
  tags: number;
52
52
  }>;
53
+ private loadDetails;
54
+ searchContacts(q: string): Promise<Record<string, unknown>[]>;
55
+ listColdContacts(days: number): Promise<Record<string, unknown>[]>;
56
+ listContactsNotContactedSince(days: number, limit: number): Promise<Array<{
57
+ id: string;
58
+ display_name: string;
59
+ last_contacted_at: string | null;
60
+ }>>;
61
+ listFollowupDueContacts(onOrBefore: string): Promise<Array<{
62
+ id: string;
63
+ display_name: string;
64
+ follow_up_at: string;
65
+ }>>;
66
+ findContactsForContext(topic: string, limit: number): Promise<Array<{
67
+ id: string;
68
+ display_name: string;
69
+ job_title: string | null;
70
+ reason: string;
71
+ }>>;
72
+ findEmailDuplicates(): Promise<Array<{
73
+ email: string;
74
+ contact_ids: string[];
75
+ }>>;
76
+ findNameDuplicates(): Promise<Array<{
77
+ contact_ids: [string, string];
78
+ similarity: number;
79
+ }>>;
80
+ getRecentContactEvents(since?: string, eventTypes?: string[]): Promise<Record<string, unknown>[]>;
81
+ private mapDeal;
82
+ createDeal(input: Record<string, unknown>): Promise<{
83
+ id: unknown;
84
+ title: unknown;
85
+ contact_id: unknown;
86
+ company_id: unknown;
87
+ stage: unknown;
88
+ value_usd: unknown;
89
+ currency: unknown;
90
+ close_date: unknown;
91
+ notes: unknown;
92
+ created_at: string;
93
+ updated_at: string;
94
+ }>;
95
+ getDeal(id: string): Promise<{
96
+ id: unknown;
97
+ title: unknown;
98
+ contact_id: unknown;
99
+ company_id: unknown;
100
+ stage: unknown;
101
+ value_usd: unknown;
102
+ currency: unknown;
103
+ close_date: unknown;
104
+ notes: unknown;
105
+ created_at: string;
106
+ updated_at: string;
107
+ } | null>;
108
+ listDeals(opts?: {
109
+ stage?: string;
110
+ contact_id?: string;
111
+ company_id?: string;
112
+ }): Promise<{
113
+ id: unknown;
114
+ title: unknown;
115
+ contact_id: unknown;
116
+ company_id: unknown;
117
+ stage: unknown;
118
+ value_usd: unknown;
119
+ currency: unknown;
120
+ close_date: unknown;
121
+ notes: unknown;
122
+ created_at: string;
123
+ updated_at: string;
124
+ }[]>;
125
+ updateDeal(id: string, input: Record<string, unknown>): Promise<{
126
+ id: unknown;
127
+ title: unknown;
128
+ contact_id: unknown;
129
+ company_id: unknown;
130
+ stage: unknown;
131
+ value_usd: unknown;
132
+ currency: unknown;
133
+ close_date: unknown;
134
+ notes: unknown;
135
+ created_at: string;
136
+ updated_at: string;
137
+ } | null>;
138
+ deleteDeal(id: string): Promise<boolean>;
139
+ private mapEvent;
140
+ logEvent(input: Record<string, unknown>): Promise<{
141
+ id: unknown;
142
+ title: unknown;
143
+ type: unknown;
144
+ event_date: unknown;
145
+ duration_min: unknown;
146
+ contact_ids: string[];
147
+ company_id: unknown;
148
+ notes: unknown;
149
+ outcome: unknown;
150
+ deal_id: unknown;
151
+ created_at: string;
152
+ }>;
153
+ listEvents(opts?: {
154
+ contact_id?: string;
155
+ company_id?: string;
156
+ type?: string;
157
+ date_from?: string;
158
+ date_to?: string;
159
+ }): Promise<{
160
+ id: unknown;
161
+ title: unknown;
162
+ type: unknown;
163
+ event_date: unknown;
164
+ duration_min: unknown;
165
+ contact_ids: string[];
166
+ company_id: unknown;
167
+ notes: unknown;
168
+ outcome: unknown;
169
+ deal_id: unknown;
170
+ created_at: string;
171
+ }[]>;
172
+ deleteEvent(id: string): Promise<boolean>;
173
+ private mapTask;
174
+ createContactTask(input: Record<string, unknown>): Promise<{
175
+ id: unknown;
176
+ title: unknown;
177
+ description: unknown;
178
+ contact_id: unknown;
179
+ assigned_by: unknown;
180
+ deadline: unknown;
181
+ status: unknown;
182
+ priority: unknown;
183
+ entity_id: unknown;
184
+ linked_todos_task_id: unknown;
185
+ escalation_rules: unknown[];
186
+ created_at: string;
187
+ updated_at: string;
188
+ }>;
189
+ listContactTasks(opts?: {
190
+ contact_id?: string;
191
+ entity_id?: string;
192
+ status?: string;
193
+ priority?: string;
194
+ }): Promise<{
195
+ id: unknown;
196
+ title: unknown;
197
+ description: unknown;
198
+ contact_id: unknown;
199
+ assigned_by: unknown;
200
+ deadline: unknown;
201
+ status: unknown;
202
+ priority: unknown;
203
+ entity_id: unknown;
204
+ linked_todos_task_id: unknown;
205
+ escalation_rules: unknown[];
206
+ created_at: string;
207
+ updated_at: string;
208
+ }[]>;
209
+ updateContactTask(id: string, input: Record<string, unknown>): Promise<{
210
+ id: unknown;
211
+ title: unknown;
212
+ description: unknown;
213
+ contact_id: unknown;
214
+ assigned_by: unknown;
215
+ deadline: unknown;
216
+ status: unknown;
217
+ priority: unknown;
218
+ entity_id: unknown;
219
+ linked_todos_task_id: unknown;
220
+ escalation_rules: unknown[];
221
+ created_at: string;
222
+ updated_at: string;
223
+ } | null>;
224
+ deleteContactTask(id: string): Promise<boolean>;
225
+ listOverdueTasks(): Promise<{
226
+ id: unknown;
227
+ title: unknown;
228
+ description: unknown;
229
+ contact_id: unknown;
230
+ assigned_by: unknown;
231
+ deadline: unknown;
232
+ status: unknown;
233
+ priority: unknown;
234
+ entity_id: unknown;
235
+ linked_todos_task_id: unknown;
236
+ escalation_rules: unknown[];
237
+ created_at: string;
238
+ updated_at: string;
239
+ }[]>;
240
+ checkEscalations(): Promise<{
241
+ task: Record<string, unknown>;
242
+ rules_triggered: Array<{
243
+ after_days: number;
244
+ }>;
245
+ }[]>;
246
+ private mapApplication;
247
+ createApplication(input: Record<string, unknown>): Promise<{
248
+ id: unknown;
249
+ program_name: unknown;
250
+ provider_company_id: unknown;
251
+ type: unknown;
252
+ value_usd: unknown;
253
+ applicant_contact_id: unknown;
254
+ primary_contact_id: unknown;
255
+ status: unknown;
256
+ submitted_date: unknown;
257
+ decision_date: unknown;
258
+ follow_up_date: unknown;
259
+ notes: unknown;
260
+ method: {} | null;
261
+ form_url: unknown;
262
+ metadata: Record<string, unknown>;
263
+ created_at: string;
264
+ updated_at: string;
265
+ }>;
266
+ listApplications(opts?: {
267
+ type?: string;
268
+ status?: string;
269
+ provider_company_id?: string;
270
+ applicant_contact_id?: string;
271
+ }): Promise<{
272
+ id: unknown;
273
+ program_name: unknown;
274
+ provider_company_id: unknown;
275
+ type: unknown;
276
+ value_usd: unknown;
277
+ applicant_contact_id: unknown;
278
+ primary_contact_id: unknown;
279
+ status: unknown;
280
+ submitted_date: unknown;
281
+ decision_date: unknown;
282
+ follow_up_date: unknown;
283
+ notes: unknown;
284
+ method: {} | null;
285
+ form_url: unknown;
286
+ metadata: Record<string, unknown>;
287
+ created_at: string;
288
+ updated_at: string;
289
+ }[]>;
290
+ updateApplication(id: string, input: Record<string, unknown>): Promise<{
291
+ id: unknown;
292
+ program_name: unknown;
293
+ provider_company_id: unknown;
294
+ type: unknown;
295
+ value_usd: unknown;
296
+ applicant_contact_id: unknown;
297
+ primary_contact_id: unknown;
298
+ status: unknown;
299
+ submitted_date: unknown;
300
+ decision_date: unknown;
301
+ follow_up_date: unknown;
302
+ notes: unknown;
303
+ method: {} | null;
304
+ form_url: unknown;
305
+ metadata: Record<string, unknown>;
306
+ created_at: string;
307
+ updated_at: string;
308
+ } | null>;
309
+ listFollowUpDueApplications(): Promise<{
310
+ id: unknown;
311
+ program_name: unknown;
312
+ provider_company_id: unknown;
313
+ type: unknown;
314
+ value_usd: unknown;
315
+ applicant_contact_id: unknown;
316
+ primary_contact_id: unknown;
317
+ status: unknown;
318
+ submitted_date: unknown;
319
+ decision_date: unknown;
320
+ follow_up_date: unknown;
321
+ notes: unknown;
322
+ method: {} | null;
323
+ form_url: unknown;
324
+ metadata: Record<string, unknown>;
325
+ created_at: string;
326
+ updated_at: string;
327
+ }[]>;
328
+ private mapGroup;
329
+ createGroup(input: Record<string, unknown>): Promise<{
330
+ created_at: string | null;
331
+ updated_at: string | null;
332
+ member_count: number | undefined;
333
+ company_count: number | undefined;
334
+ } | null>;
335
+ getGroup(id: string): Promise<{
336
+ created_at: string | null;
337
+ updated_at: string | null;
338
+ member_count: number | undefined;
339
+ company_count: number | undefined;
340
+ } | null>;
341
+ listGroups(projectId?: string): Promise<{
342
+ created_at: string | null;
343
+ updated_at: string | null;
344
+ member_count: number | undefined;
345
+ company_count: number | undefined;
346
+ }[]>;
347
+ updateGroup(id: string, input: Record<string, unknown>): Promise<{
348
+ created_at: string | null;
349
+ updated_at: string | null;
350
+ member_count: number | undefined;
351
+ company_count: number | undefined;
352
+ } | null>;
353
+ deleteGroup(id: string): Promise<boolean>;
354
+ addContactToGroup(contactId: string, groupId: string): Promise<{
355
+ added: boolean;
356
+ already_member: boolean;
357
+ }>;
358
+ removeContactFromGroup(contactId: string, groupId: string): Promise<void>;
359
+ listContactsInGroup(groupId: string): Promise<string[]>;
360
+ listGroupsForContact(contactId: string): Promise<{
361
+ created_at: string | null;
362
+ updated_at: string | null;
363
+ member_count: number | undefined;
364
+ company_count: number | undefined;
365
+ }[]>;
366
+ addCompanyToGroup(companyId: string, groupId: string): Promise<{
367
+ added: boolean;
368
+ already_member: boolean;
369
+ }>;
370
+ removeCompanyFromGroup(companyId: string, groupId: string): Promise<void>;
371
+ listCompaniesInGroup(groupId: string): Promise<string[]>;
372
+ listGroupsForCompany(companyId: string): Promise<{
373
+ created_at: string | null;
374
+ updated_at: string | null;
375
+ member_count: number | undefined;
376
+ company_count: number | undefined;
377
+ }[]>;
378
+ private mapVendorComm;
379
+ logVendorCommunication(input: Record<string, unknown>): Promise<{
380
+ id: unknown;
381
+ company_id: unknown;
382
+ contact_id: unknown;
383
+ comm_date: unknown;
384
+ type: unknown;
385
+ direction: unknown;
386
+ subject: unknown;
387
+ body: unknown;
388
+ status: unknown;
389
+ invoice_amount: unknown;
390
+ invoice_currency: unknown;
391
+ invoice_ref: unknown;
392
+ follow_up_date: unknown;
393
+ follow_up_done: boolean;
394
+ created_at: string;
395
+ }>;
396
+ listVendorCommunications(companyId: string, opts?: {
397
+ type?: string;
398
+ status?: string;
399
+ direction?: string;
400
+ }): Promise<{
401
+ id: unknown;
402
+ company_id: unknown;
403
+ contact_id: unknown;
404
+ comm_date: unknown;
405
+ type: unknown;
406
+ direction: unknown;
407
+ subject: unknown;
408
+ body: unknown;
409
+ status: unknown;
410
+ invoice_amount: unknown;
411
+ invoice_currency: unknown;
412
+ invoice_ref: unknown;
413
+ follow_up_date: unknown;
414
+ follow_up_done: boolean;
415
+ created_at: string;
416
+ }[]>;
417
+ listMissingInvoices(): Promise<{
418
+ id: unknown;
419
+ company_id: unknown;
420
+ contact_id: unknown;
421
+ comm_date: unknown;
422
+ type: unknown;
423
+ direction: unknown;
424
+ subject: unknown;
425
+ body: unknown;
426
+ status: unknown;
427
+ invoice_amount: unknown;
428
+ invoice_currency: unknown;
429
+ invoice_ref: unknown;
430
+ follow_up_date: unknown;
431
+ follow_up_done: boolean;
432
+ created_at: string;
433
+ }[]>;
434
+ listPendingFollowUps(): Promise<{
435
+ id: unknown;
436
+ company_id: unknown;
437
+ contact_id: unknown;
438
+ comm_date: unknown;
439
+ type: unknown;
440
+ direction: unknown;
441
+ subject: unknown;
442
+ body: unknown;
443
+ status: unknown;
444
+ invoice_amount: unknown;
445
+ invoice_currency: unknown;
446
+ invoice_ref: unknown;
447
+ follow_up_date: unknown;
448
+ follow_up_done: boolean;
449
+ created_at: string;
450
+ }[]>;
451
+ markFollowUpDone(id: string): Promise<{
452
+ id: unknown;
453
+ company_id: unknown;
454
+ contact_id: unknown;
455
+ comm_date: unknown;
456
+ type: unknown;
457
+ direction: unknown;
458
+ subject: unknown;
459
+ body: unknown;
460
+ status: unknown;
461
+ invoice_amount: unknown;
462
+ invoice_currency: unknown;
463
+ invoice_ref: unknown;
464
+ follow_up_date: unknown;
465
+ follow_up_done: boolean;
466
+ created_at: string;
467
+ } | null>;
468
+ private mapOrgMember;
469
+ addOrgMember(input: Record<string, unknown>): Promise<{
470
+ id: unknown;
471
+ company_id: unknown;
472
+ contact_id: unknown;
473
+ title: unknown;
474
+ specialization: unknown;
475
+ office_phone: unknown;
476
+ response_sla_hours: unknown;
477
+ notes: unknown;
478
+ created_at: string;
479
+ updated_at: string;
480
+ }>;
481
+ listOrgMembers(companyId: string): Promise<{
482
+ id: unknown;
483
+ company_id: unknown;
484
+ contact_id: unknown;
485
+ title: unknown;
486
+ specialization: unknown;
487
+ office_phone: unknown;
488
+ response_sla_hours: unknown;
489
+ notes: unknown;
490
+ created_at: string;
491
+ updated_at: string;
492
+ }[]>;
493
+ updateOrgMember(id: string, input: Record<string, unknown>): Promise<{
494
+ id: unknown;
495
+ company_id: unknown;
496
+ contact_id: unknown;
497
+ title: unknown;
498
+ specialization: unknown;
499
+ office_phone: unknown;
500
+ response_sla_hours: unknown;
501
+ notes: unknown;
502
+ created_at: string;
503
+ updated_at: string;
504
+ } | null>;
505
+ removeOrgMember(id: string): Promise<boolean>;
506
+ listOrgMembersForContact(contactId: string): Promise<{
507
+ id: unknown;
508
+ company_id: unknown;
509
+ contact_id: unknown;
510
+ title: unknown;
511
+ specialization: unknown;
512
+ office_phone: unknown;
513
+ response_sla_hours: unknown;
514
+ notes: unknown;
515
+ created_at: string;
516
+ updated_at: string;
517
+ }[]>;
518
+ private mapNote;
519
+ addNote(contactId: string, body: string, createdBy?: string, companyId?: string): Promise<Record<string, unknown>>;
520
+ listNotes(contactId: string): Promise<Record<string, unknown>[]>;
521
+ listNotesForContactAtCompany(contactId: string, companyId: string): Promise<Record<string, unknown>[]>;
522
+ deleteNote(noteId: string): Promise<void>;
523
+ createRelationship(input: Record<string, unknown>): Promise<{
524
+ created_at: string | null;
525
+ }>;
526
+ listRelationships(opts?: {
527
+ contact_id?: string;
528
+ }): Promise<Record<string, unknown>[]>;
529
+ deleteRelationship(id: string): Promise<void>;
530
+ createCompanyRelationship(input: Record<string, unknown>): Promise<{
531
+ created_at: string | null;
532
+ is_primary: boolean;
533
+ }>;
534
+ listCompanyRelationships(opts?: {
535
+ contact_id?: string;
536
+ company_id?: string;
537
+ }): Promise<Record<string, unknown>[]>;
538
+ deleteCompanyRelationship(id: string): Promise<void>;
539
+ getFieldHistory(contactId: string, fieldName?: string): Promise<{
540
+ valid_from: string | null;
541
+ created_at: string | null;
542
+ }[]>;
543
+ getContactAt(contactId: string, timestamp: string): Promise<Record<string, string>>;
544
+ private mapJob;
545
+ addJobEntry(contactId: string, input: Record<string, unknown>): Promise<{
546
+ is_current: boolean;
547
+ inferred: boolean;
548
+ created_at: string | null;
549
+ }>;
550
+ getJobHistory(contactId: string): Promise<{
551
+ is_current: boolean;
552
+ inferred: boolean;
553
+ created_at: string | null;
554
+ }[]>;
555
+ private mapLearning;
556
+ saveLearning(contactId: string, input: Record<string, unknown>): Promise<Record<string, unknown>>;
557
+ getLearnings(contactId: string, opts?: {
558
+ type?: string;
559
+ min_importance?: number;
560
+ visibility?: string;
561
+ }): Promise<Record<string, unknown>[]>;
562
+ searchLearnings(query: string, opts?: {
563
+ type?: string;
564
+ contact_id?: string;
565
+ }): Promise<Record<string, unknown>[]>;
566
+ confirmLearning(learningId: string): Promise<void>;
567
+ getStaleLearnings(daysOld: number, minConfidence: number): Promise<Record<string, unknown>[]>;
568
+ runLearningMaintenance(): Promise<{
569
+ decayed_count: number;
570
+ potential_contradictions: Record<string, unknown>[];
571
+ }>;
572
+ private mapLock;
573
+ acquireContactLock(contactId: string, agentName: string, ttlSeconds?: number, reason?: string, sessionId?: string): Promise<{
574
+ acquired: boolean;
575
+ held_by: unknown;
576
+ lock: {
577
+ acquired_at: string | null;
578
+ expires_at: string | null;
579
+ };
580
+ } | {
581
+ acquired: boolean;
582
+ lock: {
583
+ acquired_at: string | null;
584
+ expires_at: string | null;
585
+ };
586
+ held_by?: undefined;
587
+ }>;
588
+ releaseContactLock(contactId: string, agentName: string): Promise<boolean>;
589
+ checkContactLock(contactId: string): Promise<{
590
+ acquired_at: string | null;
591
+ expires_at: string | null;
592
+ } | null>;
593
+ logAgentActivity(contactId: string, agentName: string, action: string, details?: string, sessionId?: string): Promise<void>;
594
+ getAgentActivity(contactId: string, limit?: number): Promise<{
595
+ created_at: string | null;
596
+ }[]>;
597
+ resolveContactIdentity(partial: {
598
+ name?: string;
599
+ email?: string;
600
+ phone?: string;
601
+ linkedin_url?: string;
602
+ }): Promise<{
603
+ contact: {
604
+ id: string;
605
+ display_name: string;
606
+ job_title?: string;
607
+ };
608
+ confidence_score: number;
609
+ match_reasons: string[];
610
+ }[]>;
611
+ addContactIdentity(contactId: string, system: string, externalId: string, externalUrl?: string, confidence?: "verified" | "inferred"): Promise<{
612
+ created_at: string | null;
613
+ }>;
614
+ getContactIdentities(contactId: string): Promise<{
615
+ created_at: string | null;
616
+ }[]>;
617
+ private signalRow;
618
+ getRelationshipSignals(contactId: string): Promise<{
619
+ signal_type: string;
620
+ reason: string;
621
+ contact_id: unknown;
622
+ display_name: unknown;
623
+ last_contacted_at: string | null;
624
+ interaction_count_30d: number;
625
+ engagement_status: {} | null;
626
+ relationship_health: {} | null;
627
+ days_since_contact: number | null;
628
+ }[]>;
629
+ getGhostContacts(): Promise<{
630
+ signal_type: string;
631
+ reason: string;
632
+ contact_id: unknown;
633
+ display_name: unknown;
634
+ last_contacted_at: string | null;
635
+ interaction_count_30d: number;
636
+ engagement_status: {} | null;
637
+ relationship_health: {} | null;
638
+ days_since_contact: number | null;
639
+ }[]>;
640
+ getWarmingContacts(): Promise<{
641
+ signal_type: string;
642
+ reason: string;
643
+ contact_id: unknown;
644
+ display_name: unknown;
645
+ last_contacted_at: string | null;
646
+ interaction_count_30d: number;
647
+ engagement_status: {} | null;
648
+ relationship_health: {} | null;
649
+ days_since_contact: number | null;
650
+ }[]>;
651
+ recomputeSignals(): Promise<{
652
+ updated: number;
653
+ }>;
654
+ getFreshnessScore(contactId: string): Promise<{
655
+ contact_id: string;
656
+ overall_score: number;
657
+ fields: {
658
+ field_name: string;
659
+ value: string | null;
660
+ last_verified_at: string | null;
661
+ source: string | null;
662
+ confidence: string;
663
+ days_old: number | null;
664
+ }[];
665
+ stale_fields: string[];
666
+ verified_fields: string[];
667
+ }>;
668
+ getStaleContacts(threshold?: number): Promise<{
669
+ contact_id: string;
670
+ display_name: string;
671
+ score: number;
672
+ }[]>;
673
+ markFieldVerified(contactId: string, fieldName: string, source?: string): Promise<void>;
674
+ computeRelationshipStrength(contactId: string): Promise<number>;
675
+ findWarmPath(fromContactId: string, toContactId: string): Promise<{
676
+ contact_id: string;
677
+ display_name: string;
678
+ strength: number;
679
+ }[]>;
680
+ findConnectionsAtCompany(companyId: string): Promise<{
681
+ contact_id: string;
682
+ display_name: string;
683
+ job_title?: string;
684
+ strength: number;
685
+ }[]>;
686
+ detectCoolingRelationships(): Promise<{
687
+ contact_id: string;
688
+ display_name: string;
689
+ days_since: number;
690
+ }[]>;
691
+ addOrgChartEdge(companyId: string, contactAId: string, contactBId: string, edgeType: string, inferred?: boolean): Promise<{
692
+ inferred: boolean;
693
+ created_at: string | null;
694
+ }>;
695
+ listOrgChart(companyId: string): Promise<{
696
+ contact_a_name: string;
697
+ contact_b_name: string;
698
+ edge_type: string;
699
+ }[]>;
700
+ setDealContactRole(dealId: string, contactId: string, accountRole: string): Promise<{
701
+ created_at: string | null;
702
+ }>;
703
+ getDealTeam(dealId: string): Promise<{
704
+ display_name: string;
705
+ account_role: string;
706
+ job_title?: string;
707
+ }[]>;
708
+ getCoverageGaps(companyId: string): Promise<{
709
+ covered: string[];
710
+ missing_key_roles: string[];
711
+ }>;
712
+ private mapAudience;
713
+ createAudience(input: Record<string, unknown>): Promise<{
714
+ id: unknown;
715
+ audience_id: unknown;
716
+ name: unknown;
717
+ match: unknown;
718
+ predicates: unknown[];
719
+ consent_policy: unknown;
720
+ suppression_synced_at: string | null;
721
+ created_at: string | null;
722
+ updated_at: string | null;
723
+ }>;
724
+ getAudience(idOrSlug: string): Promise<{
725
+ id: unknown;
726
+ audience_id: unknown;
727
+ name: unknown;
728
+ match: unknown;
729
+ predicates: unknown[];
730
+ consent_policy: unknown;
731
+ suppression_synced_at: string | null;
732
+ created_at: string | null;
733
+ updated_at: string | null;
734
+ }>;
735
+ listAudiences(): Promise<{
736
+ id: unknown;
737
+ audience_id: unknown;
738
+ name: unknown;
739
+ match: unknown;
740
+ predicates: unknown[];
741
+ consent_policy: unknown;
742
+ suppression_synced_at: string | null;
743
+ created_at: string | null;
744
+ updated_at: string | null;
745
+ }[]>;
746
+ updateAudience(idOrSlug: string, input: Record<string, unknown>): Promise<{
747
+ id: unknown;
748
+ audience_id: unknown;
749
+ name: unknown;
750
+ match: unknown;
751
+ predicates: unknown[];
752
+ consent_policy: unknown;
753
+ suppression_synced_at: string | null;
754
+ created_at: string | null;
755
+ updated_at: string | null;
756
+ }>;
757
+ deleteAudience(idOrSlug: string): Promise<void>;
758
+ setContactConsent(contactId: string, channel: string, status: string, source?: string): Promise<{
759
+ updated_at: string | null;
760
+ }>;
761
+ listContactConsent(contactId: string): Promise<{
762
+ updated_at: string | null;
763
+ }[]>;
764
+ suppressAddress(input: {
765
+ channel: string;
766
+ address: string;
767
+ contact_id?: string;
768
+ reason?: string;
769
+ }): Promise<{
770
+ created_at: string | null;
771
+ synced_at: string | null;
772
+ }>;
773
+ unsuppressAddress(channel: string, address: string): Promise<void>;
774
+ listSuppressions(opts?: {
775
+ channel?: string;
776
+ unsyncedOnly?: boolean;
777
+ }): Promise<{
778
+ created_at: string | null;
779
+ synced_at: string | null;
780
+ }[]>;
781
+ resolveAudience(idOrSlug: string, channel: string): Promise<{
782
+ audience_id: unknown;
783
+ channel: string;
784
+ consent_policy: unknown;
785
+ matched: number;
786
+ recipients: {
787
+ contact_id: string;
788
+ display_name: string;
789
+ address: string;
790
+ consent_status: string;
791
+ }[];
792
+ excluded: {
793
+ contact_id: string;
794
+ reason: string;
795
+ }[];
796
+ }>;
797
+ getUpcomingItems(days?: number): Promise<Record<string, unknown>[]>;
798
+ listContactAudit(): Promise<{
799
+ contact_id: string;
800
+ display_name: string;
801
+ score: number;
802
+ missing: string[];
803
+ suggestions: string[];
804
+ }[]>;
805
+ getContactTimeline(contactId: string, limit?: number): Promise<{
806
+ date: string;
807
+ type: string;
808
+ title: string;
809
+ body?: string;
810
+ metadata?: Record<string, unknown>;
811
+ }[]>;
812
+ getNetworkStats(): Promise<{
813
+ total_contacts: number;
814
+ total_companies: number;
815
+ owned_entities: number;
816
+ total_tags: number;
817
+ total_groups: number;
818
+ total_deals: number;
819
+ total_events: number;
820
+ cold_30d: number;
821
+ cold_60d: number;
822
+ cold_never: number;
823
+ contacts_with_email: number;
824
+ contacts_with_phone: number;
825
+ contacts_no_company: number;
826
+ overdue_tasks: number;
827
+ pending_applications: number;
828
+ missing_invoices: number;
829
+ upcoming_7d: number;
830
+ notes_count: number;
831
+ active_deals_value: number;
832
+ }>;
833
+ getContactCard(contactId: string): Promise<{
834
+ id: string;
835
+ display_name: string;
836
+ job_title: string | null;
837
+ company: string | undefined;
838
+ primary_email: string | undefined;
839
+ primary_phone: string | undefined;
840
+ }>;
841
+ getContactBrief(contactId: string, taskContext?: string): Promise<Record<string, unknown>>;
842
+ assembleContext(contactIds: string[], format: string): Promise<{
843
+ format: string;
844
+ contact_count: number;
845
+ assembled_at: string;
846
+ contacts: Record<string, unknown>[];
847
+ }>;
848
+ generateBrief(contactId: string): Promise<string>;
849
+ vaultStatus(): Promise<{
850
+ initialized: boolean;
851
+ unlocked: boolean;
852
+ document_count: number;
853
+ }>;
53
854
  }
54
855
  export declare function createContactsPgStore(client: PoolQueryClient): ContactsPgStore;
55
856
  export declare function getContactsPgStore(client: PoolQueryClient): ContactsPgStore;