@hasna/contacts 0.6.23 → 0.6.28

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 (103) hide show
  1. package/README.md +61 -3
  2. package/dist/cli/commands/advanced.d.ts.map +1 -1
  3. package/dist/cli/commands/audience.d.ts +18 -0
  4. package/dist/cli/commands/audience.d.ts.map +1 -0
  5. package/dist/cli/commands/core.d.ts.map +1 -1
  6. package/dist/cli/commands/crm.d.ts.map +1 -1
  7. package/dist/cli/index.js +8605 -5889
  8. package/dist/cli/storage.d.ts.map +1 -1
  9. package/dist/cloud/http-storage.d.ts +88 -0
  10. package/dist/cloud/http-storage.d.ts.map +1 -0
  11. package/dist/db/audiences.d.ts +51 -0
  12. package/dist/db/audiences.d.ts.map +1 -0
  13. package/dist/db/companies.d.ts.map +1 -1
  14. package/dist/db/contacts.d.ts.map +1 -1
  15. package/dist/db/database.d.ts +1 -2
  16. package/dist/db/database.d.ts.map +1 -1
  17. package/dist/db/paths.d.ts +3 -0
  18. package/dist/db/paths.d.ts.map +1 -0
  19. package/dist/db/pg-migrations.d.ts.map +1 -1
  20. package/dist/db/storage.d.ts +1 -1
  21. package/dist/db/storage.d.ts.map +1 -1
  22. package/dist/db/tags.d.ts.map +1 -1
  23. package/dist/db/tombstones.d.ts +19 -0
  24. package/dist/db/tombstones.d.ts.map +1 -0
  25. package/dist/generated/storage-kit/health.d.ts +20 -0
  26. package/dist/generated/storage-kit/health.d.ts.map +1 -0
  27. package/dist/generated/storage-kit/index.d.ts +8 -0
  28. package/dist/generated/storage-kit/index.d.ts.map +1 -0
  29. package/dist/generated/storage-kit/migrations.d.ts +48 -0
  30. package/dist/generated/storage-kit/migrations.d.ts.map +1 -0
  31. package/dist/generated/storage-kit/mode.d.ts +48 -0
  32. package/dist/generated/storage-kit/mode.d.ts.map +1 -0
  33. package/dist/generated/storage-kit/pool.d.ts +34 -0
  34. package/dist/generated/storage-kit/pool.d.ts.map +1 -0
  35. package/dist/generated/storage-kit/query.d.ts +36 -0
  36. package/dist/generated/storage-kit/query.d.ts.map +1 -0
  37. package/dist/generated/storage-kit/tls.d.ts +26 -0
  38. package/dist/generated/storage-kit/tls.d.ts.map +1 -0
  39. package/dist/index.d.ts +6 -79
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.js +4144 -4050
  42. package/dist/lib/audience-contract.d.ts +215 -0
  43. package/dist/lib/audience-contract.d.ts.map +1 -0
  44. package/dist/lib/mailery-sync.d.ts +46 -0
  45. package/dist/lib/mailery-sync.d.ts.map +1 -0
  46. package/dist/lib/package-version.d.ts +6 -0
  47. package/dist/lib/package-version.d.ts.map +1 -0
  48. package/dist/mcp/handlers/advanced.d.ts +5 -0
  49. package/dist/mcp/handlers/advanced.d.ts.map +1 -1
  50. package/dist/mcp/handlers/audience.d.ts +9 -0
  51. package/dist/mcp/handlers/audience.d.ts.map +1 -0
  52. package/dist/mcp/handlers/core.d.ts +4 -0
  53. package/dist/mcp/handlers/core.d.ts.map +1 -1
  54. package/dist/mcp/handlers/crm.d.ts +5 -0
  55. package/dist/mcp/handlers/crm.d.ts.map +1 -1
  56. package/dist/mcp/handlers/index.d.ts.map +1 -1
  57. package/dist/mcp/index.js +10963 -10178
  58. package/dist/mcp/storage-tools.d.ts.map +1 -1
  59. package/dist/mcp/tools.d.ts +252 -0
  60. package/dist/mcp/tools.d.ts.map +1 -1
  61. package/dist/sdk/index.d.ts +16 -0
  62. package/dist/sdk/index.d.ts.map +1 -0
  63. package/dist/sdk/index.js +173 -0
  64. package/dist/sdk/v1.generated.d.ts +189 -0
  65. package/dist/sdk/v1.generated.d.ts.map +1 -0
  66. package/dist/server/cloud.d.ts +51 -0
  67. package/dist/server/cloud.d.ts.map +1 -0
  68. package/dist/server/index.js +23204 -20342
  69. package/dist/server/openapi.d.ts +708 -0
  70. package/dist/server/openapi.d.ts.map +1 -0
  71. package/dist/server/pg-store.d.ts +57 -0
  72. package/dist/server/pg-store.d.ts.map +1 -0
  73. package/dist/server/security.d.ts +24 -0
  74. package/dist/server/security.d.ts.map +1 -0
  75. package/dist/server/serve.d.ts +8 -1
  76. package/dist/server/serve.d.ts.map +1 -1
  77. package/dist/server/v1.d.ts +6 -0
  78. package/dist/server/v1.d.ts.map +1 -0
  79. package/dist/store/index.d.ts +383 -0
  80. package/dist/store/index.d.ts.map +1 -0
  81. package/dist/types/index.d.ts +96 -0
  82. package/dist/types/index.d.ts.map +1 -1
  83. package/hasna.contract.json +32 -0
  84. package/migrations/0001_core_schema.sql +162 -0
  85. package/migrations/0002_contact_fields_groups.sql +22 -0
  86. package/migrations/0003_status_archiving.sql +17 -0
  87. package/migrations/0004_company_relationships.sql +16 -0
  88. package/migrations/0005_contact_projects.sql +19 -0
  89. package/migrations/0006_contact_notes.sql +14 -0
  90. package/migrations/0007_entities_vendor_tasks.sql +91 -0
  91. package/migrations/0008_deals_events.sql +36 -0
  92. package/migrations/0009_history_learnings_coordination.sql +122 -0
  93. package/migrations/0010_documents_health.sql +38 -0
  94. package/migrations/0011_feedback.sql +14 -0
  95. package/migrations/0012_audiences_consent_suppressions.sql +38 -0
  96. package/migrations/9001_api_keys.sql +18 -0
  97. package/package.json +14 -3
  98. package/dist/db/feedback.d.ts +0 -15
  99. package/dist/db/feedback.d.ts.map +0 -1
  100. package/dist/db/remote-storage.d.ts +0 -14
  101. package/dist/db/remote-storage.d.ts.map +0 -1
  102. package/dist/db/remote-sync.d.ts +0 -49
  103. package/dist/db/remote-sync.d.ts.map +0 -1
@@ -0,0 +1,708 @@
1
+ export declare function buildV1OpenApiDocument(version?: string): {
2
+ openapi: string;
3
+ info: {
4
+ title: string;
5
+ version: string;
6
+ description: string;
7
+ };
8
+ servers: {
9
+ url: string;
10
+ }[];
11
+ components: {
12
+ securitySchemes: {
13
+ apiKey: {
14
+ type: string;
15
+ in: string;
16
+ name: string;
17
+ };
18
+ };
19
+ schemas: {
20
+ Contact: {
21
+ readonly type: "object";
22
+ readonly properties: {
23
+ readonly id: {
24
+ readonly type: "string";
25
+ };
26
+ readonly first_name: {
27
+ readonly type: "string";
28
+ };
29
+ readonly last_name: {
30
+ readonly type: "string";
31
+ };
32
+ readonly display_name: {
33
+ readonly type: "string";
34
+ };
35
+ readonly nickname: {
36
+ readonly type: "string";
37
+ readonly nullable: true;
38
+ };
39
+ readonly company_id: {
40
+ readonly type: "string";
41
+ readonly nullable: true;
42
+ };
43
+ readonly job_title: {
44
+ readonly type: "string";
45
+ readonly nullable: true;
46
+ };
47
+ readonly notes: {
48
+ readonly type: "string";
49
+ readonly nullable: true;
50
+ };
51
+ readonly source: {
52
+ readonly type: "string";
53
+ };
54
+ readonly status: {
55
+ readonly type: "string";
56
+ };
57
+ readonly sensitivity: {
58
+ readonly type: "string";
59
+ };
60
+ readonly archived: {
61
+ readonly type: "boolean";
62
+ };
63
+ readonly priority: {
64
+ readonly type: "number";
65
+ };
66
+ readonly created_at: {
67
+ readonly type: "string";
68
+ };
69
+ readonly updated_at: {
70
+ readonly type: "string";
71
+ };
72
+ };
73
+ };
74
+ Company: {
75
+ readonly type: "object";
76
+ readonly properties: {
77
+ readonly id: {
78
+ readonly type: "string";
79
+ };
80
+ readonly name: {
81
+ readonly type: "string";
82
+ };
83
+ readonly domain: {
84
+ readonly type: "string";
85
+ readonly nullable: true;
86
+ };
87
+ readonly industry: {
88
+ readonly type: "string";
89
+ readonly nullable: true;
90
+ };
91
+ readonly size: {
92
+ readonly type: "string";
93
+ readonly nullable: true;
94
+ };
95
+ readonly founded_year: {
96
+ readonly type: "number";
97
+ readonly nullable: true;
98
+ };
99
+ readonly notes: {
100
+ readonly type: "string";
101
+ readonly nullable: true;
102
+ };
103
+ readonly is_owned_entity: {
104
+ readonly type: "boolean";
105
+ };
106
+ readonly created_at: {
107
+ readonly type: "string";
108
+ };
109
+ readonly updated_at: {
110
+ readonly type: "string";
111
+ };
112
+ };
113
+ };
114
+ Tag: {
115
+ readonly type: "object";
116
+ readonly properties: {
117
+ readonly id: {
118
+ readonly type: "string";
119
+ };
120
+ readonly name: {
121
+ readonly type: "string";
122
+ };
123
+ readonly color: {
124
+ readonly type: "string";
125
+ };
126
+ readonly description: {
127
+ readonly type: "string";
128
+ readonly nullable: true;
129
+ };
130
+ readonly created_at: {
131
+ readonly type: "string";
132
+ };
133
+ };
134
+ };
135
+ CreateContactInput: {
136
+ type: string;
137
+ properties: {
138
+ first_name: {
139
+ type: string;
140
+ };
141
+ last_name: {
142
+ type: string;
143
+ };
144
+ display_name: {
145
+ type: string;
146
+ };
147
+ nickname: {
148
+ type: string;
149
+ };
150
+ company_id: {
151
+ type: string;
152
+ };
153
+ job_title: {
154
+ type: string;
155
+ };
156
+ notes: {
157
+ type: string;
158
+ };
159
+ source: {
160
+ type: string;
161
+ };
162
+ status: {
163
+ type: string;
164
+ };
165
+ sensitivity: {
166
+ type: string;
167
+ };
168
+ };
169
+ };
170
+ UpdateContactInput: {
171
+ type: string;
172
+ properties: {
173
+ first_name: {
174
+ type: string;
175
+ };
176
+ last_name: {
177
+ type: string;
178
+ };
179
+ display_name: {
180
+ type: string;
181
+ };
182
+ nickname: {
183
+ type: string;
184
+ };
185
+ company_id: {
186
+ type: string;
187
+ };
188
+ job_title: {
189
+ type: string;
190
+ };
191
+ notes: {
192
+ type: string;
193
+ };
194
+ status: {
195
+ type: string;
196
+ };
197
+ };
198
+ };
199
+ CreateCompanyInput: {
200
+ type: string;
201
+ required: string[];
202
+ properties: {
203
+ name: {
204
+ type: string;
205
+ };
206
+ domain: {
207
+ type: string;
208
+ };
209
+ industry: {
210
+ type: string;
211
+ };
212
+ size: {
213
+ type: string;
214
+ };
215
+ founded_year: {
216
+ type: string;
217
+ };
218
+ notes: {
219
+ type: string;
220
+ };
221
+ is_owned_entity: {
222
+ type: string;
223
+ };
224
+ };
225
+ };
226
+ UpdateCompanyInput: {
227
+ type: string;
228
+ properties: {
229
+ name: {
230
+ type: string;
231
+ };
232
+ domain: {
233
+ type: string;
234
+ };
235
+ industry: {
236
+ type: string;
237
+ };
238
+ notes: {
239
+ type: string;
240
+ };
241
+ };
242
+ };
243
+ CreateTagInput: {
244
+ type: string;
245
+ required: string[];
246
+ properties: {
247
+ name: {
248
+ type: string;
249
+ };
250
+ color: {
251
+ type: string;
252
+ };
253
+ description: {
254
+ type: string;
255
+ };
256
+ };
257
+ };
258
+ UpdateTagInput: {
259
+ type: string;
260
+ properties: {
261
+ name: {
262
+ type: string;
263
+ };
264
+ color: {
265
+ type: string;
266
+ };
267
+ description: {
268
+ type: string;
269
+ };
270
+ };
271
+ };
272
+ };
273
+ };
274
+ security: {
275
+ apiKey: never[];
276
+ }[];
277
+ paths: {
278
+ "/v1/contacts": {
279
+ get: {
280
+ operationId: string;
281
+ summary: string;
282
+ parameters: {
283
+ name: string;
284
+ in: string;
285
+ schema: {
286
+ type: string;
287
+ };
288
+ }[];
289
+ responses: {
290
+ "200": {
291
+ content: {
292
+ "application/json": {
293
+ schema: {
294
+ type: string;
295
+ properties: Record<string, unknown>;
296
+ };
297
+ };
298
+ };
299
+ };
300
+ };
301
+ };
302
+ post: {
303
+ operationId: string;
304
+ summary: string;
305
+ requestBody: {
306
+ required: boolean;
307
+ content: {
308
+ "application/json": {
309
+ schema: {
310
+ $ref: string;
311
+ };
312
+ };
313
+ };
314
+ };
315
+ responses: {
316
+ "201": {
317
+ content: {
318
+ "application/json": {
319
+ schema: {
320
+ type: string;
321
+ properties: {
322
+ contact: {
323
+ $ref: string;
324
+ };
325
+ };
326
+ };
327
+ };
328
+ };
329
+ };
330
+ };
331
+ };
332
+ };
333
+ "/v1/contacts/{id}": {
334
+ get: {
335
+ operationId: string;
336
+ summary: string;
337
+ parameters: {
338
+ name: string;
339
+ in: string;
340
+ required: boolean;
341
+ schema: {
342
+ type: string;
343
+ };
344
+ }[];
345
+ responses: {
346
+ "200": {
347
+ content: {
348
+ "application/json": {
349
+ schema: {
350
+ type: string;
351
+ properties: Record<string, unknown>;
352
+ };
353
+ };
354
+ };
355
+ };
356
+ };
357
+ };
358
+ patch: {
359
+ operationId: string;
360
+ summary: string;
361
+ parameters: {
362
+ name: string;
363
+ in: string;
364
+ required: boolean;
365
+ schema: {
366
+ type: string;
367
+ };
368
+ }[];
369
+ requestBody: {
370
+ required: boolean;
371
+ content: {
372
+ "application/json": {
373
+ schema: {
374
+ $ref: string;
375
+ };
376
+ };
377
+ };
378
+ };
379
+ responses: {
380
+ "200": {
381
+ content: {
382
+ "application/json": {
383
+ schema: {
384
+ type: string;
385
+ properties: Record<string, unknown>;
386
+ };
387
+ };
388
+ };
389
+ };
390
+ };
391
+ };
392
+ delete: {
393
+ operationId: string;
394
+ summary: string;
395
+ parameters: {
396
+ name: string;
397
+ in: string;
398
+ required: boolean;
399
+ schema: {
400
+ type: string;
401
+ };
402
+ }[];
403
+ responses: {
404
+ "200": {
405
+ content: {
406
+ "application/json": {
407
+ schema: {
408
+ type: string;
409
+ properties: Record<string, unknown>;
410
+ };
411
+ };
412
+ };
413
+ };
414
+ };
415
+ };
416
+ };
417
+ "/v1/companies": {
418
+ get: {
419
+ operationId: string;
420
+ summary: string;
421
+ parameters: {
422
+ name: string;
423
+ in: string;
424
+ schema: {
425
+ type: string;
426
+ };
427
+ }[];
428
+ responses: {
429
+ "200": {
430
+ content: {
431
+ "application/json": {
432
+ schema: {
433
+ type: string;
434
+ properties: Record<string, unknown>;
435
+ };
436
+ };
437
+ };
438
+ };
439
+ };
440
+ };
441
+ post: {
442
+ operationId: string;
443
+ summary: string;
444
+ requestBody: {
445
+ required: boolean;
446
+ content: {
447
+ "application/json": {
448
+ schema: {
449
+ $ref: string;
450
+ };
451
+ };
452
+ };
453
+ };
454
+ responses: {
455
+ "201": {
456
+ content: {
457
+ "application/json": {
458
+ schema: {
459
+ type: string;
460
+ properties: {
461
+ company: {
462
+ $ref: string;
463
+ };
464
+ };
465
+ };
466
+ };
467
+ };
468
+ };
469
+ };
470
+ };
471
+ };
472
+ "/v1/companies/{id}": {
473
+ get: {
474
+ operationId: string;
475
+ summary: string;
476
+ parameters: {
477
+ name: string;
478
+ in: string;
479
+ required: boolean;
480
+ schema: {
481
+ type: string;
482
+ };
483
+ }[];
484
+ responses: {
485
+ "200": {
486
+ content: {
487
+ "application/json": {
488
+ schema: {
489
+ type: string;
490
+ properties: Record<string, unknown>;
491
+ };
492
+ };
493
+ };
494
+ };
495
+ };
496
+ };
497
+ patch: {
498
+ operationId: string;
499
+ summary: string;
500
+ parameters: {
501
+ name: string;
502
+ in: string;
503
+ required: boolean;
504
+ schema: {
505
+ type: string;
506
+ };
507
+ }[];
508
+ requestBody: {
509
+ required: boolean;
510
+ content: {
511
+ "application/json": {
512
+ schema: {
513
+ $ref: string;
514
+ };
515
+ };
516
+ };
517
+ };
518
+ responses: {
519
+ "200": {
520
+ content: {
521
+ "application/json": {
522
+ schema: {
523
+ type: string;
524
+ properties: Record<string, unknown>;
525
+ };
526
+ };
527
+ };
528
+ };
529
+ };
530
+ };
531
+ delete: {
532
+ operationId: string;
533
+ summary: string;
534
+ parameters: {
535
+ name: string;
536
+ in: string;
537
+ required: boolean;
538
+ schema: {
539
+ type: string;
540
+ };
541
+ }[];
542
+ responses: {
543
+ "200": {
544
+ content: {
545
+ "application/json": {
546
+ schema: {
547
+ type: string;
548
+ properties: Record<string, unknown>;
549
+ };
550
+ };
551
+ };
552
+ };
553
+ };
554
+ };
555
+ };
556
+ "/v1/tags": {
557
+ get: {
558
+ operationId: string;
559
+ summary: string;
560
+ responses: {
561
+ "200": {
562
+ content: {
563
+ "application/json": {
564
+ schema: {
565
+ type: string;
566
+ properties: Record<string, unknown>;
567
+ };
568
+ };
569
+ };
570
+ };
571
+ };
572
+ };
573
+ post: {
574
+ operationId: string;
575
+ summary: string;
576
+ requestBody: {
577
+ required: boolean;
578
+ content: {
579
+ "application/json": {
580
+ schema: {
581
+ $ref: string;
582
+ };
583
+ };
584
+ };
585
+ };
586
+ responses: {
587
+ "201": {
588
+ content: {
589
+ "application/json": {
590
+ schema: {
591
+ type: string;
592
+ properties: {
593
+ tag: {
594
+ $ref: string;
595
+ };
596
+ };
597
+ };
598
+ };
599
+ };
600
+ };
601
+ };
602
+ };
603
+ };
604
+ "/v1/tags/{id}": {
605
+ get: {
606
+ operationId: string;
607
+ summary: string;
608
+ parameters: {
609
+ name: string;
610
+ in: string;
611
+ required: boolean;
612
+ schema: {
613
+ type: string;
614
+ };
615
+ }[];
616
+ responses: {
617
+ "200": {
618
+ content: {
619
+ "application/json": {
620
+ schema: {
621
+ type: string;
622
+ properties: Record<string, unknown>;
623
+ };
624
+ };
625
+ };
626
+ };
627
+ };
628
+ };
629
+ patch: {
630
+ operationId: string;
631
+ summary: string;
632
+ parameters: {
633
+ name: string;
634
+ in: string;
635
+ required: boolean;
636
+ schema: {
637
+ type: string;
638
+ };
639
+ }[];
640
+ requestBody: {
641
+ required: boolean;
642
+ content: {
643
+ "application/json": {
644
+ schema: {
645
+ $ref: string;
646
+ };
647
+ };
648
+ };
649
+ };
650
+ responses: {
651
+ "200": {
652
+ content: {
653
+ "application/json": {
654
+ schema: {
655
+ type: string;
656
+ properties: Record<string, unknown>;
657
+ };
658
+ };
659
+ };
660
+ };
661
+ };
662
+ };
663
+ delete: {
664
+ operationId: string;
665
+ summary: string;
666
+ parameters: {
667
+ name: string;
668
+ in: string;
669
+ required: boolean;
670
+ schema: {
671
+ type: string;
672
+ };
673
+ }[];
674
+ responses: {
675
+ "200": {
676
+ content: {
677
+ "application/json": {
678
+ schema: {
679
+ type: string;
680
+ properties: Record<string, unknown>;
681
+ };
682
+ };
683
+ };
684
+ };
685
+ };
686
+ };
687
+ };
688
+ "/v1/stats": {
689
+ get: {
690
+ operationId: string;
691
+ summary: string;
692
+ responses: {
693
+ "200": {
694
+ content: {
695
+ "application/json": {
696
+ schema: {
697
+ type: string;
698
+ properties: Record<string, unknown>;
699
+ };
700
+ };
701
+ };
702
+ };
703
+ };
704
+ };
705
+ };
706
+ };
707
+ };
708
+ //# sourceMappingURL=openapi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../src/server/openapi.ts"],"names":[],"mappings":"AA+DA,wBAAgB,sBAAsB,CAAC,OAAO,SAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2QnE"}