@happyvertical/smrt-messages 0.62.12 → 0.62.13

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 (47) hide show
  1. package/AGENTS.md +6 -0
  2. package/agents/mail-search.md +40 -0
  3. package/dist/chunks/{AttachmentCollection-gv5YpGPo.js → AttachmentCollection-Dzz2iKjx.js} +4 -4
  4. package/dist/chunks/{AttachmentCollection-gv5YpGPo.js.map → AttachmentCollection-Dzz2iKjx.js.map} +1 -1
  5. package/dist/chunks/{Email---ifczUW.js → Email-DDMgkm_l.js} +11 -6
  6. package/dist/chunks/Email-DDMgkm_l.js.map +1 -0
  7. package/dist/chunks/EmailAccountCollection-CgZE9YAM.js +1992 -0
  8. package/dist/chunks/EmailAccountCollection-CgZE9YAM.js.map +1 -0
  9. package/dist/chunks/{EmailCollection-CHINTmyA.js → EmailCollection-lo8WePl-.js} +18 -3
  10. package/dist/chunks/EmailCollection-lo8WePl-.js.map +1 -0
  11. package/dist/chunks/{EmailFolder-C_H8u6bS.js → EmailFolder-Bu7y8-VX.js} +6 -6
  12. package/dist/chunks/{EmailFolder-C_H8u6bS.js.map → EmailFolder-Bu7y8-VX.js.map} +1 -1
  13. package/dist/chunks/{EmailFolderCollection-B83qLC-c.js → EmailFolderCollection-BpzzKBhM.js} +2 -2
  14. package/dist/chunks/{EmailFolderCollection-B83qLC-c.js.map → EmailFolderCollection-BpzzKBhM.js.map} +1 -1
  15. package/dist/chunks/{Message-Ccqg6BLO.js → Message-BwW51pgG.js} +6 -6
  16. package/dist/chunks/{Message-Ccqg6BLO.js.map → Message-BwW51pgG.js.map} +1 -1
  17. package/dist/chunks/{MessageCollection-BnHCLi1Q.js → MessageCollection-JjZybSMu.js} +2 -2
  18. package/dist/chunks/{MessageCollection-BnHCLi1Q.js.map → MessageCollection-JjZybSMu.js.map} +1 -1
  19. package/dist/chunks/{MessagingEndpointCollection-CHzGhkeL.js → MessagingEndpointCollection-FmbtiFJy.js} +2 -2
  20. package/dist/chunks/{MessagingEndpointCollection-CHzGhkeL.js.map → MessagingEndpointCollection-FmbtiFJy.js.map} +1 -1
  21. package/dist/collections/CorrespondentCollection.d.ts +6 -0
  22. package/dist/collections/CorrespondentCollection.d.ts.map +1 -0
  23. package/dist/collections/EmailCollection.d.ts +14 -0
  24. package/dist/collections/EmailCollection.d.ts.map +1 -1
  25. package/dist/connect.js +1 -1
  26. package/dist/index.d.ts +4 -0
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +843 -12
  29. package/dist/index.js.map +1 -1
  30. package/dist/manifest.json +557 -2
  31. package/dist/models/Correspondent.d.ts +63 -0
  32. package/dist/models/Correspondent.d.ts.map +1 -0
  33. package/dist/models/Email.d.ts.map +1 -1
  34. package/dist/services/CorrespondentService.d.ts +113 -0
  35. package/dist/services/CorrespondentService.d.ts.map +1 -0
  36. package/dist/services/MailSearchService.d.ts +127 -0
  37. package/dist/services/MailSearchService.d.ts.map +1 -0
  38. package/dist/smrt-knowledge.json +184 -9
  39. package/dist/smrt-knowledge.okf.md +9 -3
  40. package/dist/svelte/components/RecipientInput.svelte +54 -0
  41. package/dist/svelte/components/RecipientInput.svelte.d.ts +6 -0
  42. package/dist/svelte/components/RecipientInput.svelte.d.ts.map +1 -1
  43. package/package.json +11 -11
  44. package/dist/chunks/Email---ifczUW.js.map +0 -1
  45. package/dist/chunks/EmailAccountCollection-DkvT4tdP.js +0 -1992
  46. package/dist/chunks/EmailAccountCollection-DkvT4tdP.js.map +0 -1
  47. package/dist/chunks/EmailCollection-CHINTmyA.js.map +0 -1
@@ -2,7 +2,7 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-messages",
5
- "packageVersion": "0.62.12",
5
+ "packageVersion": "0.62.13",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-messages:AccountCollection": {
8
8
  "name": "accountcollection",
@@ -884,6 +884,182 @@
884
884
  },
885
885
  "importPath": "@happyvertical/smrt-messages"
886
886
  },
887
+ "@happyvertical/smrt-messages:CorrespondentCollection": {
888
+ "name": "correspondentcollection",
889
+ "className": "CorrespondentCollection",
890
+ "qualifiedName": "@happyvertical/smrt-messages:CorrespondentCollection",
891
+ "collection": "correspondents",
892
+ "filePath": "src/collections/CorrespondentCollection.ts",
893
+ "packageName": "@happyvertical/smrt-messages",
894
+ "fields": {},
895
+ "methods": {},
896
+ "decoratorConfig": {
897
+ "tableName": "correspondents",
898
+ "api": false,
899
+ "mcp": false,
900
+ "cli": false
901
+ },
902
+ "extends": "SmrtCollection",
903
+ "extendsTypeArg": "Correspondent",
904
+ "exportName": "CorrespondentCollection",
905
+ "collectionExportName": "CorrespondentCollectionCollection",
906
+ "collectionOf": "@happyvertical/smrt-messages:Correspondent",
907
+ "inheritedExposure": [
908
+ "api",
909
+ "mcp",
910
+ "cli"
911
+ ],
912
+ "schema": {
913
+ "tableName": "correspondents",
914
+ "ddl": "CREATE TABLE IF NOT EXISTS \"correspondents\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"owner_user_id\" UUID NOT NULL,\n \"address\" TEXT NOT NULL,\n \"display_name\" TEXT,\n \"message_count\" INTEGER NOT NULL DEFAULT 0,\n \"sent_count\" INTEGER NOT NULL DEFAULT 0,\n \"received_count\" INTEGER NOT NULL DEFAULT 0,\n \"first_contact_at\" TIMESTAMP,\n \"last_contact_at\" TIMESTAMP,\n \"account_ids\" TEXT,\n \"account_breakdown\" TEXT,\n \"profile_id\" UUID\n);",
915
+ "columns": {
916
+ "_sync_origin_device_id": {
917
+ "type": "TEXT"
918
+ },
919
+ "_sync_revision": {
920
+ "type": "INTEGER"
921
+ },
922
+ "id": {
923
+ "type": "UUID",
924
+ "primaryKey": true,
925
+ "referenceKind": "id",
926
+ "notNull": true
927
+ },
928
+ "slug": {
929
+ "type": "TEXT",
930
+ "notNull": true
931
+ },
932
+ "context": {
933
+ "type": "TEXT",
934
+ "notNull": true,
935
+ "default": ""
936
+ },
937
+ "created_at": {
938
+ "type": "TIMESTAMP",
939
+ "notNull": true,
940
+ "default": "current_timestamp"
941
+ },
942
+ "updated_at": {
943
+ "type": "TIMESTAMP",
944
+ "notNull": true,
945
+ "default": "current_timestamp"
946
+ },
947
+ "tenant_id": {
948
+ "type": "UUID",
949
+ "referenceKind": "tenantId",
950
+ "notNull": true,
951
+ "unique": false
952
+ },
953
+ "owner_user_id": {
954
+ "type": "UUID",
955
+ "referenceKind": "crossPackageRef",
956
+ "notNull": true,
957
+ "unique": false
958
+ },
959
+ "address": {
960
+ "type": "TEXT",
961
+ "notNull": true,
962
+ "unique": false
963
+ },
964
+ "display_name": {
965
+ "type": "TEXT",
966
+ "notNull": false,
967
+ "unique": false
968
+ },
969
+ "message_count": {
970
+ "type": "INTEGER",
971
+ "notNull": true,
972
+ "unique": false,
973
+ "default": 0
974
+ },
975
+ "sent_count": {
976
+ "type": "INTEGER",
977
+ "notNull": true,
978
+ "unique": false,
979
+ "default": 0
980
+ },
981
+ "received_count": {
982
+ "type": "INTEGER",
983
+ "notNull": true,
984
+ "unique": false,
985
+ "default": 0
986
+ },
987
+ "first_contact_at": {
988
+ "type": "TIMESTAMP",
989
+ "notNull": false,
990
+ "unique": false
991
+ },
992
+ "last_contact_at": {
993
+ "type": "TIMESTAMP",
994
+ "notNull": false,
995
+ "unique": false
996
+ },
997
+ "account_ids": {
998
+ "type": "TEXT",
999
+ "notNull": false,
1000
+ "unique": false
1001
+ },
1002
+ "account_breakdown": {
1003
+ "type": "TEXT",
1004
+ "notNull": false,
1005
+ "unique": false
1006
+ },
1007
+ "profile_id": {
1008
+ "type": "UUID",
1009
+ "referenceKind": "crossPackageRef",
1010
+ "notNull": false,
1011
+ "unique": false
1012
+ }
1013
+ },
1014
+ "indexes": [
1015
+ {
1016
+ "name": "correspondents_tenant_id_owner_user_id_idx",
1017
+ "columns": [
1018
+ "tenant_id",
1019
+ "owner_user_id",
1020
+ "address"
1021
+ ],
1022
+ "unique": true
1023
+ },
1024
+ {
1025
+ "name": "correspondents_slug_context_idx",
1026
+ "columns": [
1027
+ "slug",
1028
+ "context"
1029
+ ]
1030
+ },
1031
+ {
1032
+ "name": "correspondents_owner_last_contact_idx",
1033
+ "columns": [
1034
+ "tenant_id",
1035
+ "owner_user_id",
1036
+ "last_contact_at"
1037
+ ]
1038
+ },
1039
+ {
1040
+ "name": "correspondents_tenant_id_created_at_idx",
1041
+ "columns": [
1042
+ "tenant_id",
1043
+ "created_at"
1044
+ ]
1045
+ },
1046
+ {
1047
+ "name": "correspondents_owner_user_id_idx",
1048
+ "columns": [
1049
+ "owner_user_id"
1050
+ ]
1051
+ },
1052
+ {
1053
+ "name": "correspondents_profile_id_idx",
1054
+ "columns": [
1055
+ "profile_id"
1056
+ ]
1057
+ }
1058
+ ],
1059
+ "version": "d0cc8363"
1060
+ },
1061
+ "importPath": "@happyvertical/smrt-messages"
1062
+ },
887
1063
  "@happyvertical/smrt-messages:EmailAccountCollection": {
888
1064
  "name": "emailaccountcollection",
889
1065
  "className": "EmailAccountCollection",
@@ -2110,6 +2286,33 @@
2110
2286
  "isStatic": false,
2111
2287
  "isPublic": true
2112
2288
  },
2289
+ "semanticMatches": {
2290
+ "name": "semanticMatches",
2291
+ "async": true,
2292
+ "parameters": [
2293
+ {
2294
+ "name": "query",
2295
+ "type": "string",
2296
+ "optional": false
2297
+ },
2298
+ {
2299
+ "name": "where",
2300
+ "type": "Record<string, unknown>",
2301
+ "optional": false
2302
+ },
2303
+ {
2304
+ "name": "options",
2305
+ "type": "object",
2306
+ "optional": true,
2307
+ "memberTypes": [
2308
+ "number"
2309
+ ]
2310
+ }
2311
+ ],
2312
+ "returnType": "Promise<Array<object> | null>",
2313
+ "isStatic": false,
2314
+ "isPublic": true
2315
+ },
2113
2316
  "markFolderRead": {
2114
2317
  "name": "markFolderRead",
2115
2318
  "async": true,
@@ -5981,6 +6184,350 @@
5981
6184
  },
5982
6185
  "importPath": "@happyvertical/smrt-messages"
5983
6186
  },
6187
+ "@happyvertical/smrt-messages:Correspondent": {
6188
+ "name": "correspondent",
6189
+ "className": "Correspondent",
6190
+ "qualifiedName": "@happyvertical/smrt-messages:Correspondent",
6191
+ "collection": "correspondents",
6192
+ "description": "Someone one person writes to or hears from, derived from that person's synced mail (#5132).",
6193
+ "filePath": "src/models/Correspondent.ts",
6194
+ "packageName": "@happyvertical/smrt-messages",
6195
+ "fields": {
6196
+ "tenantId": {
6197
+ "type": "text",
6198
+ "_meta": {
6199
+ "__tenancy": {
6200
+ "isTenantIdField": true,
6201
+ "autoFilter": true,
6202
+ "required": true,
6203
+ "autoPopulate": true,
6204
+ "nullable": false,
6205
+ "mode": "required",
6206
+ "field": "tenantId",
6207
+ "allowSuperAdminBypass": false
6208
+ },
6209
+ "__statedOptions": [
6210
+ "sqlType",
6211
+ "requiredFor",
6212
+ "__tenancy"
6213
+ ],
6214
+ "sqlType": "UUID",
6215
+ "requiredFor": "tenant-scope"
6216
+ },
6217
+ "required": true
6218
+ },
6219
+ "ownerUserId": {
6220
+ "type": "crossPackageRef",
6221
+ "_meta": {
6222
+ "__statedOptions": [
6223
+ "required",
6224
+ "requiredFor",
6225
+ "related"
6226
+ ],
6227
+ "required": true,
6228
+ "requiredFor": "identity"
6229
+ },
6230
+ "required": true,
6231
+ "related": "@happyvertical/smrt-users:User"
6232
+ },
6233
+ "address": {
6234
+ "type": "text",
6235
+ "_meta": {
6236
+ "__statedOptions": [
6237
+ "required",
6238
+ "requiredFor"
6239
+ ],
6240
+ "required": true,
6241
+ "requiredFor": "identity"
6242
+ },
6243
+ "required": true
6244
+ },
6245
+ "displayName": {
6246
+ "type": "text",
6247
+ "_meta": {
6248
+ "__statedOptions": []
6249
+ },
6250
+ "required": false
6251
+ },
6252
+ "messageCount": {
6253
+ "type": "integer",
6254
+ "_meta": {
6255
+ "__statedOptions": [
6256
+ "default"
6257
+ ]
6258
+ },
6259
+ "required": true,
6260
+ "default": 0
6261
+ },
6262
+ "sentCount": {
6263
+ "type": "integer",
6264
+ "_meta": {
6265
+ "__statedOptions": [
6266
+ "default"
6267
+ ]
6268
+ },
6269
+ "required": true,
6270
+ "default": 0
6271
+ },
6272
+ "receivedCount": {
6273
+ "type": "integer",
6274
+ "_meta": {
6275
+ "__statedOptions": [
6276
+ "default"
6277
+ ]
6278
+ },
6279
+ "required": true,
6280
+ "default": 0
6281
+ },
6282
+ "firstContactAt": {
6283
+ "type": "datetime",
6284
+ "_meta": {
6285
+ "__statedOptions": []
6286
+ },
6287
+ "required": false
6288
+ },
6289
+ "lastContactAt": {
6290
+ "type": "datetime",
6291
+ "_meta": {
6292
+ "__statedOptions": []
6293
+ },
6294
+ "required": false
6295
+ },
6296
+ "accountIds": {
6297
+ "type": "text",
6298
+ "_meta": {
6299
+ "__statedOptions": []
6300
+ },
6301
+ "required": false
6302
+ },
6303
+ "accountBreakdown": {
6304
+ "type": "text",
6305
+ "_meta": {
6306
+ "__statedOptions": []
6307
+ },
6308
+ "required": false
6309
+ },
6310
+ "profileId": {
6311
+ "type": "crossPackageRef",
6312
+ "_meta": {
6313
+ "__statedOptions": [
6314
+ "nullable",
6315
+ "related",
6316
+ "required"
6317
+ ],
6318
+ "nullable": true,
6319
+ "required": false
6320
+ },
6321
+ "required": false,
6322
+ "related": "@happyvertical/smrt-profiles:Profile"
6323
+ }
6324
+ },
6325
+ "methods": {},
6326
+ "decoratorConfig": {
6327
+ "tableName": "correspondents",
6328
+ "api": false,
6329
+ "mcp": false,
6330
+ "cli": false,
6331
+ "conflictColumns": [
6332
+ "tenant_id",
6333
+ "owner_user_id",
6334
+ "address"
6335
+ ],
6336
+ "indexes": [
6337
+ {
6338
+ "name": "correspondents_owner_last_contact_idx",
6339
+ "columns": [
6340
+ "tenantId",
6341
+ "ownerUserId",
6342
+ "lastContactAt"
6343
+ ]
6344
+ }
6345
+ ],
6346
+ "tenantScoped": {
6347
+ "mode": "required"
6348
+ }
6349
+ },
6350
+ "extends": "SmrtObject",
6351
+ "exportName": "Correspondent",
6352
+ "collectionExportName": "CorrespondentCollection",
6353
+ "validationRules": [
6354
+ {
6355
+ "field": "ownerUserId",
6356
+ "rule": "required",
6357
+ "fieldType": "crossPackageRef"
6358
+ },
6359
+ {
6360
+ "field": "address",
6361
+ "rule": "required",
6362
+ "fieldType": "text"
6363
+ },
6364
+ {
6365
+ "field": "messageCount",
6366
+ "rule": "required",
6367
+ "fieldType": "integer"
6368
+ },
6369
+ {
6370
+ "field": "sentCount",
6371
+ "rule": "required",
6372
+ "fieldType": "integer"
6373
+ },
6374
+ {
6375
+ "field": "receivedCount",
6376
+ "rule": "required",
6377
+ "fieldType": "integer"
6378
+ }
6379
+ ],
6380
+ "schema": {
6381
+ "tableName": "correspondents",
6382
+ "ddl": "CREATE TABLE IF NOT EXISTS \"correspondents\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"owner_user_id\" UUID NOT NULL,\n \"address\" TEXT NOT NULL,\n \"display_name\" TEXT,\n \"message_count\" INTEGER NOT NULL DEFAULT 0,\n \"sent_count\" INTEGER NOT NULL DEFAULT 0,\n \"received_count\" INTEGER NOT NULL DEFAULT 0,\n \"first_contact_at\" TIMESTAMP,\n \"last_contact_at\" TIMESTAMP,\n \"account_ids\" TEXT,\n \"account_breakdown\" TEXT,\n \"profile_id\" UUID\n);",
6383
+ "columns": {
6384
+ "_sync_origin_device_id": {
6385
+ "type": "TEXT"
6386
+ },
6387
+ "_sync_revision": {
6388
+ "type": "INTEGER"
6389
+ },
6390
+ "id": {
6391
+ "type": "UUID",
6392
+ "primaryKey": true,
6393
+ "referenceKind": "id",
6394
+ "notNull": true
6395
+ },
6396
+ "slug": {
6397
+ "type": "TEXT",
6398
+ "notNull": true
6399
+ },
6400
+ "context": {
6401
+ "type": "TEXT",
6402
+ "notNull": true,
6403
+ "default": ""
6404
+ },
6405
+ "created_at": {
6406
+ "type": "TIMESTAMP",
6407
+ "notNull": true,
6408
+ "default": "current_timestamp"
6409
+ },
6410
+ "updated_at": {
6411
+ "type": "TIMESTAMP",
6412
+ "notNull": true,
6413
+ "default": "current_timestamp"
6414
+ },
6415
+ "tenant_id": {
6416
+ "type": "UUID",
6417
+ "referenceKind": "tenantId",
6418
+ "notNull": true,
6419
+ "unique": false
6420
+ },
6421
+ "owner_user_id": {
6422
+ "type": "UUID",
6423
+ "referenceKind": "crossPackageRef",
6424
+ "notNull": true,
6425
+ "unique": false
6426
+ },
6427
+ "address": {
6428
+ "type": "TEXT",
6429
+ "notNull": true,
6430
+ "unique": false
6431
+ },
6432
+ "display_name": {
6433
+ "type": "TEXT",
6434
+ "notNull": false,
6435
+ "unique": false
6436
+ },
6437
+ "message_count": {
6438
+ "type": "INTEGER",
6439
+ "notNull": true,
6440
+ "unique": false,
6441
+ "default": 0
6442
+ },
6443
+ "sent_count": {
6444
+ "type": "INTEGER",
6445
+ "notNull": true,
6446
+ "unique": false,
6447
+ "default": 0
6448
+ },
6449
+ "received_count": {
6450
+ "type": "INTEGER",
6451
+ "notNull": true,
6452
+ "unique": false,
6453
+ "default": 0
6454
+ },
6455
+ "first_contact_at": {
6456
+ "type": "TIMESTAMP",
6457
+ "notNull": false,
6458
+ "unique": false
6459
+ },
6460
+ "last_contact_at": {
6461
+ "type": "TIMESTAMP",
6462
+ "notNull": false,
6463
+ "unique": false
6464
+ },
6465
+ "account_ids": {
6466
+ "type": "TEXT",
6467
+ "notNull": false,
6468
+ "unique": false
6469
+ },
6470
+ "account_breakdown": {
6471
+ "type": "TEXT",
6472
+ "notNull": false,
6473
+ "unique": false
6474
+ },
6475
+ "profile_id": {
6476
+ "type": "UUID",
6477
+ "referenceKind": "crossPackageRef",
6478
+ "notNull": false,
6479
+ "unique": false
6480
+ }
6481
+ },
6482
+ "indexes": [
6483
+ {
6484
+ "name": "correspondents_tenant_id_owner_user_id_idx",
6485
+ "columns": [
6486
+ "tenant_id",
6487
+ "owner_user_id",
6488
+ "address"
6489
+ ],
6490
+ "unique": true
6491
+ },
6492
+ {
6493
+ "name": "correspondents_slug_context_idx",
6494
+ "columns": [
6495
+ "slug",
6496
+ "context"
6497
+ ]
6498
+ },
6499
+ {
6500
+ "name": "correspondents_owner_last_contact_idx",
6501
+ "columns": [
6502
+ "tenant_id",
6503
+ "owner_user_id",
6504
+ "last_contact_at"
6505
+ ]
6506
+ },
6507
+ {
6508
+ "name": "correspondents_tenant_id_created_at_idx",
6509
+ "columns": [
6510
+ "tenant_id",
6511
+ "created_at"
6512
+ ]
6513
+ },
6514
+ {
6515
+ "name": "correspondents_owner_user_id_idx",
6516
+ "columns": [
6517
+ "owner_user_id"
6518
+ ]
6519
+ },
6520
+ {
6521
+ "name": "correspondents_profile_id_idx",
6522
+ "columns": [
6523
+ "profile_id"
6524
+ ]
6525
+ }
6526
+ ],
6527
+ "version": "d0cc8363"
6528
+ },
6529
+ "importPath": "@happyvertical/smrt-messages"
6530
+ },
5984
6531
  "@happyvertical/smrt-messages:Email": {
5985
6532
  "name": "email",
5986
6533
  "className": "Email",
@@ -6898,6 +7445,14 @@
6898
7445
  },
6899
7446
  "decoratorConfig": {
6900
7447
  "tableStrategy": "sti",
7448
+ "embeddings": {
7449
+ "fields": [
7450
+ "subject",
7451
+ "textBody"
7452
+ ],
7453
+ "provider": "auto",
7454
+ "autoGenerate": false
7455
+ },
6901
7456
  "api": {
6902
7457
  "include": [
6903
7458
  "list",
@@ -17480,6 +18035,6 @@
17480
18035
  "@happyvertical/smrt-users"
17481
18036
  ]
17482
18037
  },
17483
- "schemaFingerprint": "d64b9eaef506b9ae1c64ad7f6e10f1cba78507606dc1dad60a5eb5eb594849b6",
18038
+ "schemaFingerprint": "81a3bacdca7cfb0b0c5f75ea8edea68fd046b51d83e21b60a1f64ed7f3d829ef",
17484
18039
  "stampsConstructors": true
17485
18040
  }
@@ -0,0 +1,63 @@
1
+ import type { SmrtObjectOptions } from '@happyvertical/smrt-core';
2
+ import '../__smrt-register__.js';
3
+ import { SmrtObject } from '@happyvertical/smrt-core';
4
+ export interface CorrespondentOptions extends SmrtObjectOptions {
5
+ tenantId?: string;
6
+ ownerUserId?: string;
7
+ address?: string;
8
+ displayName?: string;
9
+ messageCount?: number;
10
+ sentCount?: number;
11
+ receivedCount?: number;
12
+ firstContactAt?: Date | null;
13
+ lastContactAt?: Date | null;
14
+ accountIds?: string;
15
+ accountBreakdown?: string;
16
+ profileId?: string | null;
17
+ }
18
+ /**
19
+ * Someone one person writes to or hears from, derived from that person's
20
+ * synced mail (#5132). Private to its owner: every row belongs to one
21
+ * `ownerUserId`, is never shared across the tenant, and is read and changed
22
+ * only through `CorrespondentService`, which filters on the acting user. The
23
+ * generated REST/MCP/CLI surfaces are off for that reason.
24
+ *
25
+ * Everything but the address is optional: a correspondent has no name until
26
+ * mail carries one, and no `profileId` until the owner links a smrt-profiles
27
+ * `Profile` on purpose. Deriving never creates or links a `Profile`.
28
+ * `accountIds` (JSON array) records which of the owner's readable mail
29
+ * accounts the address was seen in, so the service can hide a correspondent
30
+ * once the owner loses read access to every one of them.
31
+ */
32
+ export declare class Correspondent extends SmrtObject {
33
+ tenantId: string;
34
+ /** The one person this row is private to (`smrt-users:User`, uuid). */
35
+ ownerUserId: string;
36
+ /** Lower-cased email address. */
37
+ address: string;
38
+ /** The most recent name mail used for this address; may be empty. */
39
+ displayName: string;
40
+ /** Messages the owner can read that mention this address. */
41
+ messageCount: number;
42
+ /** Of those, messages sent by this address. */
43
+ sentCount: number;
44
+ /** Of those, messages sent to or copied to this address. */
45
+ receivedCount: number;
46
+ firstContactAt: Date | null;
47
+ lastContactAt: Date | null;
48
+ /** JSON array of mail account ids the address was seen in. */
49
+ accountIds: string;
50
+ /**
51
+ * JSON object keyed by mail account id with that account's own sent and
52
+ * received counts, first/last contact, and latest name. The service builds
53
+ * every view from the accounts the viewer can read only; the top-level
54
+ * counts above are totals kept for storage and are never shown on their own.
55
+ */
56
+ accountBreakdown: string;
57
+ /** Optional link to a smrt-profiles `Profile`, set only by the owner. */
58
+ profileId: string | null;
59
+ constructor(options?: CorrespondentOptions);
60
+ /** Account ids this address was seen in (empty on unreadable JSON). */
61
+ get seenInAccountIds(): string[];
62
+ }
63
+ //# sourceMappingURL=Correspondent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Correspondent.d.ts","sourceRoot":"","sources":["../../src/models/Correspondent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAGlE,OAAO,yBAAyB,CAAC;AACjC,OAAO,EAGL,UAAU,EAEX,MAAM,0BAA0B,CAAC;AAGlC,MAAM,WAAW,oBAAqB,SAAQ,iBAAiB;IAC7D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAC7B,aAAa,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,GAAG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