@hasna/contacts 0.6.32 → 0.6.34

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