@happyvertical/smrt-messages 0.60.16 → 0.60.18
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.
- package/dist/chunks/{AccountCollection-BqxfVklR.js → AccountCollection-4ZT8LimZ.js} +2 -2
- package/dist/chunks/{AccountCollection-BqxfVklR.js.map → AccountCollection-4ZT8LimZ.js.map} +1 -1
- package/dist/chunks/{Email-pFuK_41u.js → Email-NNmas_WR.js} +3 -3
- package/dist/chunks/{Email-pFuK_41u.js.map → Email-NNmas_WR.js.map} +1 -1
- package/dist/chunks/{EmailFolder-BgQXYiFu.js → EmailFolder-DzNpDmjC.js} +2 -2
- package/dist/chunks/{EmailFolder-BgQXYiFu.js.map → EmailFolder-DzNpDmjC.js.map} +1 -1
- package/dist/chunks/{Message-CN0p80pA.js → Message-CHAl820M.js} +4 -4
- package/dist/chunks/{Message-CN0p80pA.js.map → Message-CHAl820M.js.map} +1 -1
- package/dist/chunks/{MessageCollection-BugOEL4f.js → MessageCollection-l7DpPn_N.js} +2 -2
- package/dist/chunks/{MessageCollection-BugOEL4f.js.map → MessageCollection-l7DpPn_N.js.map} +1 -1
- package/dist/chunks/__smrt-register__-zH3JfarO.js +6 -0
- package/dist/chunks/__smrt-register__-zH3JfarO.js.map +1 -0
- package/dist/index.js +9 -9
- package/dist/manifest.json +213 -11
- package/dist/smrt-knowledge.json +85 -7
- package/dist/svelte/components/AccountAvatar.svelte +34 -30
- package/dist/svelte/components/AccountCard.svelte +72 -63
- package/dist/svelte/components/AccountList.svelte +15 -9
- package/dist/svelte/components/AttachmentChip.svelte +54 -39
- package/dist/svelte/components/AttachmentUpload.svelte +55 -48
- package/dist/svelte/components/ComposeForm.svelte +105 -83
- package/dist/svelte/components/EmailAccountManager.svelte +245 -230
- package/dist/svelte/components/EmailFilterManager.svelte +250 -228
- package/dist/svelte/components/FolderNav.svelte +60 -50
- package/dist/svelte/components/ForwardForm.svelte +40 -34
- package/dist/svelte/components/MessageCard.svelte +116 -110
- package/dist/svelte/components/MessageDetail.svelte +107 -92
- package/dist/svelte/components/MessageFilters.svelte +73 -48
- package/dist/svelte/components/MessageList.svelte +20 -13
- package/dist/svelte/components/MessageStatusIndicator.svelte +24 -22
- package/dist/svelte/components/MessageToolbar.svelte +48 -36
- package/dist/svelte/components/MessageTypeBadge.svelte +8 -5
- package/dist/svelte/components/MessagingSettingsPanel.svelte +97 -32
- package/dist/svelte/components/RecipientInput.svelte +63 -43
- package/dist/svelte/components/ReplyForm.svelte +40 -34
- package/dist/svelte/components/SendStatusBadge.svelte +21 -14
- package/dist/svelte/components/ThreadView.svelte +68 -55
- package/package.json +16 -16
- package/dist/chunks/__smrt-register__-D5RmYQK6.js +0 -6
- package/dist/chunks/__smrt-register__-D5RmYQK6.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { t as __exportAll } from "./chunks/rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import "./chunks/__smrt-register__-
|
|
2
|
+
import "./chunks/__smrt-register__-zH3JfarO.js";
|
|
3
3
|
import { a as registerMessagingProvider, n as getMessagingProvider, o as ZulipSender, r as listMessagingProviders, s as TelegramSender, t as ensureBuiltinMessagingProvidersRegistered } from "./chunks/providers-4iLula-V.js";
|
|
4
4
|
import { buildSqliteRebuildStatements, isDeepStrictEqual, normalizeIdentityEmail, queryGlobal, queryWithGlobals, readNotificationProfile, withSystemContext, withTenant } from "./host.js";
|
|
5
|
-
import { r as Account, t as AccountCollection } from "./chunks/AccountCollection-
|
|
5
|
+
import { r as Account, t as AccountCollection } from "./chunks/AccountCollection-4ZT8LimZ.js";
|
|
6
6
|
import { d as withProtectedNotificationHandoff, f as PROFILE_NOTIFICATION_POLICY_PREFIX, l as protectedNotificationMetadata, m as profileNotificationPolicy, n as assertProtectedEmailAdmission, p as assertNotificationRecipientIdentity, r as assertProtectedEmailHandoff, t as ProtectedNotificationHandoffError } from "./chunks/protected-notification-handoff-mvaEZVp7.js";
|
|
7
|
-
import { t as Message } from "./chunks/Message-
|
|
8
|
-
import { t as MessageCollection } from "./chunks/MessageCollection-
|
|
9
|
-
import { t as Email } from "./chunks/Email-
|
|
10
|
-
import { t as EmailFolder } from "./chunks/EmailFolder-
|
|
7
|
+
import { t as Message } from "./chunks/Message-CHAl820M.js";
|
|
8
|
+
import { t as MessageCollection } from "./chunks/MessageCollection-l7DpPn_N.js";
|
|
9
|
+
import { t as Email } from "./chunks/Email-NNmas_WR.js";
|
|
10
|
+
import { t as EmailFolder } from "./chunks/EmailFolder-DzNpDmjC.js";
|
|
11
11
|
import { t as SlackSender } from "./chunks/SlackSender-CjSvwY1K.js";
|
|
12
12
|
import { t as TweetSender } from "./chunks/TweetSender-CcLPNNi1.js";
|
|
13
13
|
import { GlobalInterceptors, SmrtCollection, SmrtObject, SmrtRecipe, crossPackageRef, detectEngine, field, foreignKey, importOptionalDependency, isUniqueViolationError, smrt, usesEmbeddedRevisionFallback, withEmbeddedWriteQueue } from "@happyvertical/smrt-core";
|
|
@@ -109,7 +109,7 @@ var Attachment = class extends SmrtObject {
|
|
|
109
109
|
*/
|
|
110
110
|
async getMessage() {
|
|
111
111
|
if (!this.messageId) return null;
|
|
112
|
-
const { MessageCollection } = await import("./chunks/MessageCollection-
|
|
112
|
+
const { MessageCollection } = await import("./chunks/MessageCollection-l7DpPn_N.js").then((n) => n.n);
|
|
113
113
|
return await (await MessageCollection.create(this.options)).get({ id: this.messageId });
|
|
114
114
|
}
|
|
115
115
|
/**
|
|
@@ -1056,7 +1056,7 @@ var EmailAccount = class extends Account {
|
|
|
1056
1056
|
for (const folderName of foldersToSync) try {
|
|
1057
1057
|
let folder = await folderCollection.getByPath(accountId, folderName);
|
|
1058
1058
|
if (!folder) {
|
|
1059
|
-
const { EmailFolder } = await import("./chunks/EmailFolder-
|
|
1059
|
+
const { EmailFolder } = await import("./chunks/EmailFolder-DzNpDmjC.js").then((n) => n.n);
|
|
1060
1060
|
folder = new EmailFolder({
|
|
1061
1061
|
...this.childOptions(),
|
|
1062
1062
|
accountId,
|
|
@@ -1081,7 +1081,7 @@ var EmailAccount = class extends Account {
|
|
|
1081
1081
|
result.messagesSkipped++;
|
|
1082
1082
|
continue;
|
|
1083
1083
|
}
|
|
1084
|
-
const { Email } = await import("./chunks/Email-
|
|
1084
|
+
const { Email } = await import("./chunks/Email-NNmas_WR.js").then((n) => n.n);
|
|
1085
1085
|
let email = existingEmail;
|
|
1086
1086
|
if (!email) {
|
|
1087
1087
|
email = new Email({
|
package/dist/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"version": "1.0.0",
|
|
3
3
|
"timestamp": 0,
|
|
4
4
|
"packageName": "@happyvertical/smrt-messages",
|
|
5
|
-
"packageVersion": "0.60.
|
|
5
|
+
"packageVersion": "0.60.18",
|
|
6
6
|
"objects": {
|
|
7
7
|
"@happyvertical/smrt-messages:AccountCollection": {
|
|
8
8
|
"name": "accountcollection",
|
|
@@ -1447,7 +1447,7 @@
|
|
|
1447
1447
|
],
|
|
1448
1448
|
"schema": {
|
|
1449
1449
|
"tableName": "email_attachments",
|
|
1450
|
-
"ddl": "CREATE TABLE IF NOT EXISTS \"email_attachments\" (\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);",
|
|
1450
|
+
"ddl": "CREATE TABLE IF NOT EXISTS \"email_attachments\" (\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,\n \"message_id\" UUID,\n \"filename\" TEXT,\n \"content_type\" TEXT,\n \"size\" INTEGER NOT NULL DEFAULT 0,\n \"content_id\" TEXT,\n \"content_disposition\" TEXT DEFAULT 'attachment',\n \"file_path\" TEXT,\n \"source_url\" TEXT\n);",
|
|
1451
1451
|
"columns": {
|
|
1452
1452
|
"_sync_origin_device_id": {
|
|
1453
1453
|
"type": "TEXT"
|
|
@@ -1479,25 +1479,89 @@
|
|
|
1479
1479
|
"type": "TIMESTAMP",
|
|
1480
1480
|
"notNull": true,
|
|
1481
1481
|
"default": "current_timestamp"
|
|
1482
|
+
},
|
|
1483
|
+
"tenant_id": {
|
|
1484
|
+
"type": "UUID",
|
|
1485
|
+
"referenceKind": "tenantId",
|
|
1486
|
+
"notNull": false,
|
|
1487
|
+
"unique": false
|
|
1488
|
+
},
|
|
1489
|
+
"message_id": {
|
|
1490
|
+
"type": "UUID",
|
|
1491
|
+
"referenceKind": "foreignKey",
|
|
1492
|
+
"notNull": false,
|
|
1493
|
+
"unique": false,
|
|
1494
|
+
"foreignKey": {
|
|
1495
|
+
"table": "messages",
|
|
1496
|
+
"column": "id",
|
|
1497
|
+
"onDelete": "NO ACTION",
|
|
1498
|
+
"onUpdate": "CASCADE"
|
|
1499
|
+
}
|
|
1500
|
+
},
|
|
1501
|
+
"filename": {
|
|
1502
|
+
"type": "TEXT",
|
|
1503
|
+
"notNull": false,
|
|
1504
|
+
"unique": false
|
|
1505
|
+
},
|
|
1506
|
+
"content_type": {
|
|
1507
|
+
"type": "TEXT",
|
|
1508
|
+
"notNull": false,
|
|
1509
|
+
"unique": false
|
|
1510
|
+
},
|
|
1511
|
+
"size": {
|
|
1512
|
+
"type": "INTEGER",
|
|
1513
|
+
"notNull": true,
|
|
1514
|
+
"unique": false,
|
|
1515
|
+
"default": 0
|
|
1516
|
+
},
|
|
1517
|
+
"content_id": {
|
|
1518
|
+
"type": "TEXT",
|
|
1519
|
+
"notNull": false,
|
|
1520
|
+
"unique": false
|
|
1521
|
+
},
|
|
1522
|
+
"content_disposition": {
|
|
1523
|
+
"type": "TEXT",
|
|
1524
|
+
"notNull": false,
|
|
1525
|
+
"unique": false,
|
|
1526
|
+
"default": "attachment"
|
|
1527
|
+
},
|
|
1528
|
+
"file_path": {
|
|
1529
|
+
"type": "TEXT",
|
|
1530
|
+
"notNull": false,
|
|
1531
|
+
"unique": false
|
|
1532
|
+
},
|
|
1533
|
+
"source_url": {
|
|
1534
|
+
"type": "TEXT",
|
|
1535
|
+
"notNull": false,
|
|
1536
|
+
"unique": false
|
|
1482
1537
|
}
|
|
1483
1538
|
},
|
|
1484
1539
|
"indexes": [
|
|
1485
1540
|
{
|
|
1486
1541
|
"name": "email_attachments_slug_context_idx",
|
|
1487
1542
|
"columns": [
|
|
1543
|
+
"tenant_id",
|
|
1488
1544
|
"slug",
|
|
1489
1545
|
"context"
|
|
1490
1546
|
],
|
|
1491
|
-
"unique": true
|
|
1547
|
+
"unique": true,
|
|
1548
|
+
"nullsNotDistinct": true
|
|
1492
1549
|
},
|
|
1493
1550
|
{
|
|
1494
|
-
"name": "
|
|
1551
|
+
"name": "email_attachments_tenant_id_created_at_idx",
|
|
1495
1552
|
"columns": [
|
|
1553
|
+
"tenant_id",
|
|
1496
1554
|
"created_at"
|
|
1497
1555
|
]
|
|
1556
|
+
},
|
|
1557
|
+
{
|
|
1558
|
+
"name": "email_attachments_message_id_idx",
|
|
1559
|
+
"columns": [
|
|
1560
|
+
"message_id"
|
|
1561
|
+
]
|
|
1498
1562
|
}
|
|
1499
1563
|
],
|
|
1500
|
-
"version": "
|
|
1564
|
+
"version": "4f256284"
|
|
1501
1565
|
},
|
|
1502
1566
|
"importPath": "@happyvertical/smrt-messages"
|
|
1503
1567
|
},
|
|
@@ -7014,7 +7078,69 @@
|
|
|
7014
7078
|
"collection": "emailattachments",
|
|
7015
7079
|
"filePath": "/home/runner/work/smrt/smrt/packages/messages/src/models/EmailAttachment.ts",
|
|
7016
7080
|
"packageName": "@happyvertical/smrt-messages",
|
|
7017
|
-
"fields": {
|
|
7081
|
+
"fields": {
|
|
7082
|
+
"tenantId": {
|
|
7083
|
+
"type": "text",
|
|
7084
|
+
"required": false,
|
|
7085
|
+
"_meta": {
|
|
7086
|
+
"sqlType": "UUID",
|
|
7087
|
+
"nullable": true,
|
|
7088
|
+
"__tenancy": {
|
|
7089
|
+
"isTenantIdField": true,
|
|
7090
|
+
"autoFilter": true,
|
|
7091
|
+
"required": false,
|
|
7092
|
+
"autoPopulate": true,
|
|
7093
|
+
"nullable": true,
|
|
7094
|
+
"mode": "optional",
|
|
7095
|
+
"field": "tenantId",
|
|
7096
|
+
"allowSuperAdminBypass": false
|
|
7097
|
+
}
|
|
7098
|
+
}
|
|
7099
|
+
},
|
|
7100
|
+
"messageId": {
|
|
7101
|
+
"type": "foreignKey",
|
|
7102
|
+
"required": false,
|
|
7103
|
+
"related": "Message"
|
|
7104
|
+
},
|
|
7105
|
+
"filename": {
|
|
7106
|
+
"type": "text",
|
|
7107
|
+
"required": false
|
|
7108
|
+
},
|
|
7109
|
+
"contentType": {
|
|
7110
|
+
"type": "text",
|
|
7111
|
+
"required": false
|
|
7112
|
+
},
|
|
7113
|
+
"size": {
|
|
7114
|
+
"type": "integer",
|
|
7115
|
+
"required": true,
|
|
7116
|
+
"default": 0
|
|
7117
|
+
},
|
|
7118
|
+
"contentId": {
|
|
7119
|
+
"type": "text",
|
|
7120
|
+
"required": false
|
|
7121
|
+
},
|
|
7122
|
+
"contentDisposition": {
|
|
7123
|
+
"type": "text",
|
|
7124
|
+
"required": false,
|
|
7125
|
+
"default": "attachment",
|
|
7126
|
+
"enum": [
|
|
7127
|
+
"attachment",
|
|
7128
|
+
"inline"
|
|
7129
|
+
]
|
|
7130
|
+
},
|
|
7131
|
+
"filePath": {
|
|
7132
|
+
"type": "text",
|
|
7133
|
+
"required": false
|
|
7134
|
+
},
|
|
7135
|
+
"sourceUrl": {
|
|
7136
|
+
"type": "text",
|
|
7137
|
+
"required": false
|
|
7138
|
+
},
|
|
7139
|
+
"createdAt": {
|
|
7140
|
+
"type": "text",
|
|
7141
|
+
"required": false
|
|
7142
|
+
}
|
|
7143
|
+
},
|
|
7018
7144
|
"methods": {
|
|
7019
7145
|
"getMessage": {
|
|
7020
7146
|
"name": "getMessage",
|
|
@@ -7106,14 +7232,26 @@
|
|
|
7106
7232
|
},
|
|
7107
7233
|
"cli": {
|
|
7108
7234
|
"skipApiCheck": true
|
|
7109
|
-
}
|
|
7235
|
+
},
|
|
7236
|
+
"conflictColumns": [
|
|
7237
|
+
"tenant_id",
|
|
7238
|
+
"slug",
|
|
7239
|
+
"context"
|
|
7240
|
+
]
|
|
7110
7241
|
},
|
|
7111
7242
|
"extends": "Attachment",
|
|
7112
7243
|
"exportName": "EmailAttachment",
|
|
7113
7244
|
"collectionExportName": "EmailAttachmentCollection",
|
|
7245
|
+
"validationRules": [
|
|
7246
|
+
{
|
|
7247
|
+
"field": "size",
|
|
7248
|
+
"rule": "required",
|
|
7249
|
+
"fieldType": "integer"
|
|
7250
|
+
}
|
|
7251
|
+
],
|
|
7114
7252
|
"schema": {
|
|
7115
7253
|
"tableName": "email_attachments",
|
|
7116
|
-
"ddl": "CREATE TABLE IF NOT EXISTS \"email_attachments\" (\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);",
|
|
7254
|
+
"ddl": "CREATE TABLE IF NOT EXISTS \"email_attachments\" (\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,\n \"message_id\" UUID,\n \"filename\" TEXT,\n \"content_type\" TEXT,\n \"size\" INTEGER NOT NULL DEFAULT 0,\n \"content_id\" TEXT,\n \"content_disposition\" TEXT DEFAULT 'attachment',\n \"file_path\" TEXT,\n \"source_url\" TEXT\n);",
|
|
7117
7255
|
"columns": {
|
|
7118
7256
|
"_sync_origin_device_id": {
|
|
7119
7257
|
"type": "TEXT"
|
|
@@ -7145,25 +7283,89 @@
|
|
|
7145
7283
|
"type": "TIMESTAMP",
|
|
7146
7284
|
"notNull": true,
|
|
7147
7285
|
"default": "current_timestamp"
|
|
7286
|
+
},
|
|
7287
|
+
"tenant_id": {
|
|
7288
|
+
"type": "UUID",
|
|
7289
|
+
"referenceKind": "tenantId",
|
|
7290
|
+
"notNull": false,
|
|
7291
|
+
"unique": false
|
|
7292
|
+
},
|
|
7293
|
+
"message_id": {
|
|
7294
|
+
"type": "UUID",
|
|
7295
|
+
"referenceKind": "foreignKey",
|
|
7296
|
+
"notNull": false,
|
|
7297
|
+
"unique": false,
|
|
7298
|
+
"foreignKey": {
|
|
7299
|
+
"table": "messages",
|
|
7300
|
+
"column": "id",
|
|
7301
|
+
"onDelete": "NO ACTION",
|
|
7302
|
+
"onUpdate": "CASCADE"
|
|
7303
|
+
}
|
|
7304
|
+
},
|
|
7305
|
+
"filename": {
|
|
7306
|
+
"type": "TEXT",
|
|
7307
|
+
"notNull": false,
|
|
7308
|
+
"unique": false
|
|
7309
|
+
},
|
|
7310
|
+
"content_type": {
|
|
7311
|
+
"type": "TEXT",
|
|
7312
|
+
"notNull": false,
|
|
7313
|
+
"unique": false
|
|
7314
|
+
},
|
|
7315
|
+
"size": {
|
|
7316
|
+
"type": "INTEGER",
|
|
7317
|
+
"notNull": true,
|
|
7318
|
+
"unique": false,
|
|
7319
|
+
"default": 0
|
|
7320
|
+
},
|
|
7321
|
+
"content_id": {
|
|
7322
|
+
"type": "TEXT",
|
|
7323
|
+
"notNull": false,
|
|
7324
|
+
"unique": false
|
|
7325
|
+
},
|
|
7326
|
+
"content_disposition": {
|
|
7327
|
+
"type": "TEXT",
|
|
7328
|
+
"notNull": false,
|
|
7329
|
+
"unique": false,
|
|
7330
|
+
"default": "attachment"
|
|
7331
|
+
},
|
|
7332
|
+
"file_path": {
|
|
7333
|
+
"type": "TEXT",
|
|
7334
|
+
"notNull": false,
|
|
7335
|
+
"unique": false
|
|
7336
|
+
},
|
|
7337
|
+
"source_url": {
|
|
7338
|
+
"type": "TEXT",
|
|
7339
|
+
"notNull": false,
|
|
7340
|
+
"unique": false
|
|
7148
7341
|
}
|
|
7149
7342
|
},
|
|
7150
7343
|
"indexes": [
|
|
7151
7344
|
{
|
|
7152
7345
|
"name": "email_attachments_slug_context_idx",
|
|
7153
7346
|
"columns": [
|
|
7347
|
+
"tenant_id",
|
|
7154
7348
|
"slug",
|
|
7155
7349
|
"context"
|
|
7156
7350
|
],
|
|
7157
|
-
"unique": true
|
|
7351
|
+
"unique": true,
|
|
7352
|
+
"nullsNotDistinct": true
|
|
7158
7353
|
},
|
|
7159
7354
|
{
|
|
7160
|
-
"name": "
|
|
7355
|
+
"name": "email_attachments_tenant_id_created_at_idx",
|
|
7161
7356
|
"columns": [
|
|
7357
|
+
"tenant_id",
|
|
7162
7358
|
"created_at"
|
|
7163
7359
|
]
|
|
7360
|
+
},
|
|
7361
|
+
{
|
|
7362
|
+
"name": "email_attachments_message_id_idx",
|
|
7363
|
+
"columns": [
|
|
7364
|
+
"message_id"
|
|
7365
|
+
]
|
|
7164
7366
|
}
|
|
7165
7367
|
],
|
|
7166
|
-
"version": "
|
|
7368
|
+
"version": "4f256284"
|
|
7167
7369
|
},
|
|
7168
7370
|
"importPath": "@happyvertical/smrt-messages"
|
|
7169
7371
|
},
|
package/dist/smrt-knowledge.json
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
"sensitiveFieldsExcluded": true,
|
|
4
4
|
"generatedAt": "1970-01-01T00:00:00.000Z",
|
|
5
5
|
"packageName": "@happyvertical/smrt-messages",
|
|
6
|
-
"packageVersion": "0.60.
|
|
6
|
+
"packageVersion": "0.60.18",
|
|
7
7
|
"sourceManifestPath": "dist/manifest.json",
|
|
8
8
|
"agentDocPath": "AGENTS.md",
|
|
9
9
|
"sourceHashes": {
|
|
10
|
-
"manifest": "
|
|
11
|
-
"packageJson": "
|
|
10
|
+
"manifest": "bf94e8348858eef1361bd3d5e6a3b51893ee8f40ce1ab144f2dda1532f914d1a",
|
|
11
|
+
"packageJson": "1e847e140dff23e82ca3778c01cefd0a82cfcdb46e5b202e479b003d6c2aa93b",
|
|
12
12
|
"agents": "982506bdb93396f2cba5ca381c00b3e016199c2852e8f05eec27dc2de40ea106",
|
|
13
13
|
"moduleDoc:agents/notification-outbox.md": "0e9a870c4b2d5f0fec47af0dff6e61d216fb0121d384d99bccfc506beb6e38ad",
|
|
14
14
|
"moduleDoc:agents/profile-recipients.md": "1b6710bf646ddeafd6836df8270fcbb8e29226dceda716a693d945cc2e914606"
|
|
@@ -5270,8 +5270,80 @@
|
|
|
5270
5270
|
"tableName": "email_attachments",
|
|
5271
5271
|
"packageName": "@happyvertical/smrt-messages",
|
|
5272
5272
|
"extends": "Attachment",
|
|
5273
|
-
"fields": [
|
|
5274
|
-
|
|
5273
|
+
"fields": [
|
|
5274
|
+
{
|
|
5275
|
+
"name": "tenantId",
|
|
5276
|
+
"type": "text",
|
|
5277
|
+
"required": false,
|
|
5278
|
+
"columnType": "UUID"
|
|
5279
|
+
},
|
|
5280
|
+
{
|
|
5281
|
+
"name": "messageId",
|
|
5282
|
+
"type": "foreignKey",
|
|
5283
|
+
"required": false,
|
|
5284
|
+
"related": "Message",
|
|
5285
|
+
"columnType": "UUID"
|
|
5286
|
+
},
|
|
5287
|
+
{
|
|
5288
|
+
"name": "filename",
|
|
5289
|
+
"type": "text",
|
|
5290
|
+
"required": false,
|
|
5291
|
+
"columnType": "TEXT"
|
|
5292
|
+
},
|
|
5293
|
+
{
|
|
5294
|
+
"name": "contentType",
|
|
5295
|
+
"type": "text",
|
|
5296
|
+
"required": false,
|
|
5297
|
+
"columnType": "TEXT"
|
|
5298
|
+
},
|
|
5299
|
+
{
|
|
5300
|
+
"name": "size",
|
|
5301
|
+
"type": "integer",
|
|
5302
|
+
"required": true,
|
|
5303
|
+
"columnType": "INTEGER",
|
|
5304
|
+
"default": 0
|
|
5305
|
+
},
|
|
5306
|
+
{
|
|
5307
|
+
"name": "contentId",
|
|
5308
|
+
"type": "text",
|
|
5309
|
+
"required": false,
|
|
5310
|
+
"columnType": "TEXT"
|
|
5311
|
+
},
|
|
5312
|
+
{
|
|
5313
|
+
"name": "contentDisposition",
|
|
5314
|
+
"type": "text",
|
|
5315
|
+
"required": false,
|
|
5316
|
+
"columnType": "TEXT",
|
|
5317
|
+
"default": "attachment"
|
|
5318
|
+
},
|
|
5319
|
+
{
|
|
5320
|
+
"name": "filePath",
|
|
5321
|
+
"type": "text",
|
|
5322
|
+
"required": false,
|
|
5323
|
+
"columnType": "TEXT"
|
|
5324
|
+
},
|
|
5325
|
+
{
|
|
5326
|
+
"name": "sourceUrl",
|
|
5327
|
+
"type": "text",
|
|
5328
|
+
"required": false,
|
|
5329
|
+
"columnType": "TEXT"
|
|
5330
|
+
},
|
|
5331
|
+
{
|
|
5332
|
+
"name": "createdAt",
|
|
5333
|
+
"type": "text",
|
|
5334
|
+
"required": false,
|
|
5335
|
+
"columnType": "TIMESTAMP"
|
|
5336
|
+
}
|
|
5337
|
+
],
|
|
5338
|
+
"relationships": [
|
|
5339
|
+
{
|
|
5340
|
+
"name": "messageId",
|
|
5341
|
+
"type": "foreignKey",
|
|
5342
|
+
"required": false,
|
|
5343
|
+
"related": "Message",
|
|
5344
|
+
"columnType": "UUID"
|
|
5345
|
+
}
|
|
5346
|
+
],
|
|
5275
5347
|
"methods": [
|
|
5276
5348
|
"getEmail",
|
|
5277
5349
|
"getExtension",
|
|
@@ -5324,6 +5396,11 @@
|
|
|
5324
5396
|
"returns": "Promise<Buffer | null>"
|
|
5325
5397
|
}
|
|
5326
5398
|
],
|
|
5399
|
+
"conflictColumns": [
|
|
5400
|
+
"tenant_id",
|
|
5401
|
+
"slug",
|
|
5402
|
+
"context"
|
|
5403
|
+
],
|
|
5327
5404
|
"surfaces": [
|
|
5328
5405
|
{
|
|
5329
5406
|
"kind": "api",
|
|
@@ -5520,6 +5597,7 @@
|
|
|
5520
5597
|
}
|
|
5521
5598
|
],
|
|
5522
5599
|
"relationshipFeatures": [
|
|
5600
|
+
"foreignKey",
|
|
5523
5601
|
"uuidColumns"
|
|
5524
5602
|
],
|
|
5525
5603
|
"tags": [],
|
|
@@ -12903,12 +12981,12 @@
|
|
|
12903
12981
|
],
|
|
12904
12982
|
"prompts": [],
|
|
12905
12983
|
"relationshipsV2": {
|
|
12906
|
-
"foreignKeyFields":
|
|
12984
|
+
"foreignKeyFields": 19,
|
|
12907
12985
|
"crossPackageRefFields": 10,
|
|
12908
12986
|
"junctionCollections": 0,
|
|
12909
12987
|
"hierarchicalObjects": 0,
|
|
12910
12988
|
"polymorphicAssociations": 0,
|
|
12911
|
-
"uuidColumns":
|
|
12989
|
+
"uuidColumns": 118
|
|
12912
12990
|
},
|
|
12913
12991
|
"agentDoc": "# @happyvertical/smrt-messages\n\nMulti-channel messaging with STI hierarchies for both messages and accounts. Credential encryption via smrt-secrets.\n\n## STI Hierarchies\n\n**Messages** (share `messages` table):\n- `Message` (base): accountId, personaId, endpointId, correlationId, threadId, subject, body, fromAddress, toAddresses (JSON), sendStatus (draft/sending/sent/failed), retryCount\n- `Email`: messageId (RFC 822), inReplyTo, ccAddresses, bccAddresses, htmlBody, textBody, folderId, labels, headers\n- `Tweet`: tweetId, retweetCount, likeCount, mediaUrls, hashtags, mentions\n- `SlackMessage`: channelId, slackTs, slackThreadTs, reactions, blocks\n\n**Accounts** (share `accounts` table):\n- `Account` (base): channelType, providerType, public configuration,\n credentialSecretId, isActive, lastSyncAt, deprecated sensitive settings\n- `EmailAccount`, `TwitterAccount`, `SlackAccount`, `ZulipAccount`,\n `TelegramAccount`: provider-specific identity/sender behavior\n\n## Persona messaging\n\n- `MessagingEndpoint`: tenant-owned, write-only destination JSON with masked\n display helper.\n- `PersonaMessageRoute`: persona → account + endpoint, selected by purpose and\n descending priority.\n- `PersonaMessagingService`: persists and sends through an enabled route.\n- Provider registry: public setup descriptors + optional sender factory. Keep\n channel (`sms`) separate from provider (`twilio`).\n- Permissions: `messages.send`, `messages.manage-routes`,\n `messages.manage-credentials`.\n- `MessagingSettingsService` is the permissioned server boundary;\n its host-supplied `resolvePersonaTenantId` proves cross-package ownership.\n `MessagingSettingsPanel` is the callback-driven Svelte surface.\n- Account, endpoint, and route generated surfaces are read-only. Do not add\n generated mutations around the settings service or make secret fields writable.\n- **Recipe `messages.slack`** (`src/recipes.ts`, help in `src/help/slack.md`): lists Slack messages and workspaces beside the Mailbox and Notifications recipes; workspaces stay read-only and sending goes through the senders, not generated routes. Fields it shows carry `@field({ description })` in plain words; keep them when editing the models.\n\n## In-app notifications (`UserNotification`)\n\nThe in-app channel: one stored row per person, with read state.\n`user_notifications`: `tenantId` (required), `recipientUserId`\n(`@crossPackageRef` smrt-users:User, uuid), `kind`, `title`, `body`, `href`,\n`severity` (info/success/warning/error), `sourceRef`, `occurredAt`, `readAt`,\n`dismissedAt`. Conflict identity `(tenant_id, recipient_user_id, source_ref)`.\n\n- `UserNotificationService` is the only access path: `notify()` /\n `notifyMany()` (dedupe on `sourceRef`, existing row returned untouched;\n a unique ref is generated when omitted), `listForUser()` / `countUnread()`\n across explicit `tenantIds` (each read under `withTenant`), `markRead()`,\n `dismiss()` (also marks read), `markAllRead()`. Every write filters on the\n recipient, so another user's id matches nothing.\n- Generated REST/MCP/CLI are off (`api`/`mcp`/`cli: false`): a tenant-scoped\n list would expose every member's rows. Hosts expose their own routes that\n pass the signed-in user's id, never a request-chosen one.\n- Hosts decide who is told (e.g. `SocialPost.createdByUserId` for a failed\n post). New table: consumers run `db:migrate`.\n\n## Notification email outbox (`NotificationDelivery`)\n\n`NotificationOutboxService` is the external-channel counterpart of\n`UserNotificationService`: `enqueueEmail()` stores one delivery per\n`(tenant, recipient, channel, sourceRef)` after the host resolves the\nrecipient address and same-tenant sender account (callers never choose an\naddress); `dispatchDue()` leases due rows by compare-and-set\n(`NotificationDelivery.transition()`), creates the single outbound `Email`\nunder the lease, and settles sent/retry/failed/uncertain. Never resend an\n`uncertain` row automatically. Contract, retry, and reconciliation policy:\n[agents/notification-outbox.md](agents/notification-outbox.md). New table:\nconsumers run `db:migrate`.\n\n`NotificationOptOut` (`notification_opt_outs`, tenant-required, generated\nsurfaces off) is the per-recipient opt-out ledger for the outbox's\n`isSuppressed` hook, keyed `(tenant, recipient, channel, scope)` with scope `*`\nor `project:<uuid>`-style keys. `NotificationOptOutService`: idempotent\n`optOut`/`optIn` (with a `principal` only `userId === recipientUserId` may\nchange a row, and only in the principal's own `tenantId`, else\n`NotificationOptOutDeniedError`; no principal = trusted host code), trusted `isOptedOut` (a `*` row matches every scope), `listForRecipient`\n(principal required). `optOutSuppression(service, scopeOf)` builds the\n`isSuppressed` function. Details in the outbox doc; consumers run `db:migrate`.\n\n## Credential Security\n\nAccount credentials stored via tenant-bound `credentialSecretId` →\nsmrt-secrets. Use `setCredentials()`/`getCredentials()` — never store passwords\ndirectly. Credential descriptor schemas contain field definitions, never values.\n\n## Send Lifecycle\n\n`message.send()`: resolves account → creates provider sender → updates sendStatus. Retry support with `maxRetries` budget.\nA failure the provider may still have accepted carries\n`MessageSendResult.outcomeUnknown` (set by `EmailSender` unless\n`isDefiniteSendRejection()` proves a refusal, and when a sender throws) and is\npersisted as `metadata.sendOutcomeUnknown`; never auto-resend it.\n`EmailSender` attaches the message's stored `Attachment` rows (read through\n`Attachment.readContent()`, under the message's tenant context) plus\n`SendEmailOptions.attachments` bytes; an unreadable or file-less row fails the\nsend with the error on `sendError`, never a silent drop (#3808).\n`PersonaMessagingService.send({ attachments })` accepts them on email routes only.\n\n## Provider entry points (bundle boundary, #1979)\n\nThe package root is provider-neutral: models, collections, services,\npermissions, and the provider registry carry **zero provider-SDK weight**.\nProvider SDK wrappers (`@happyvertical/email`, `@happyvertical/messages`) are\nreachable only through explicit entry points, imported once at server startup:\n\n```ts\nimport '@happyvertical/smrt-messages/providers/email'; // smtp/imap/pop3/gmail\nimport '@happyvertical/smrt-messages/providers/slack';\nimport '@happyvertical/smrt-messages/providers/twitter';\nimport '@happyvertical/smrt-messages/providers/all'; // all of the above\n```\n\n- Without the matching entry, `EmailAccount.createClient()` (send + mailbox\n sync) throws an actionable error and `SlackSender`/`TweetSender` return a\n failure result naming the entry to import. Telegram and Zulip are\n fetch-based and always work from the root.\n- Builtin registry definitions stay metadata-only (setup fields for UIs); the\n entries upgrade them with `createEmailClient`/`createMessageClient`/\n `createSender` hooks. Never import a provider SDK from any module reachable\n from `src/index.ts` — the consumer bundle gate (`packages/bundle-gate`)\n fails CI when one becomes reachable.\n- `Attachment.readContent()` loads `@happyvertical/files` through core's\n `importOptionalDependency` boundary and keeps its null-on-failure contract\n in builds where the SDK is absent.\n\n## Gotchas\n\n- **Manifest before decorators**: every decorated model imports\n `../__smrt-register__.js`, and `package.json#sideEffects` lists\n `./src/__smrt-register__.ts`. Without both, the library build dropped or\n reordered the self-registration, so dist classes registered with only their\n decorated fields and could adopt smrt-ledgers' same-named `Account` (#3098).\n- **`Account` is not unique**: smrt-ledgers also declares `Account` (on\n `ledger_accounts`). Resolve by constructor or qualified name; the\n coexistence tests (`ledger-account-identity-*`, and the PostgreSQL lane\n `pnpm test:postgres`) load both packages in both orders.\n Both declare the `accounts` collection, so registering the ledgers `Account`\n auto-loads this family from its manifest as STI siblings. Core loads this\n base with them and never takes the ledgers `Account` for it (#4735,\n `ledger-account-identity-sti-siblings.test.ts`).\n- **STI `_meta_type`**: qualified format `@happyvertical/smrt-messages:Email`\n- **JSON fields**: all address/metadata fields are JSON strings with `getX()`/`setX()` helpers\n- **RFC 822 threading**: Email uses `inReplyTo`/`messageId`/`references` — manual management required\n- **Attachment.messageId**: use this field (not `emailId`); old getter/setter mapped via deprecation wrapper\n- **Optional tenancy**: `@TenantScoped({ mode: 'optional' })` on Message, Account, Attachment\n- **Required tenancy**: endpoints and persona routes are always tenant scoped\n- **Secrets are write-only**: never serialize credentials or endpoint.address to an app\n\n## Intake byte snapshots\n\n`EmailAccount.readIntakeMessage(providerLookup, maxBytes, imapIdentity?)` is the authorized host seam for\nopt-in ingestion. It copies full-message attachment bytes from the registered\nemail provider and fails when only attachment metadata is available; it never\nreads provider-supplied paths or advances sync checkpoints. Keep this path\nprovider-neutral and exclude arbitrary headers/credentials from its snapshot.\nIMAP lookup must include folder/UIDVALIDITY/UID verification; sender Message-ID\nis a lookup hint, never the durable delivery identity.\n\nProtected notification Emails carry durable delivery provenance. Their canonical\n`send`/`retrySend`, ordinary save/delete, and default EmailSender handoff are\nconstrained by `protected-notification-handoff.ts` (package-private, never a root\nexport). Only the outbox enters its exact one-use scope after current trusted\npolicy/byte validation. Preserve old-row/constructor identity checks, current\npersisted lease checks at the actual provider boundary, copied byte buffers and\nunknown-outcome marker protection. See the outbox contract and shared protected\nhandoff suite (SQLite and migrated PostgreSQL).\n\n## Protected external contacts\n\nProfile email uses exclusive `recipientProfileId` plus `resolveProfileRecipient`, a reserved `profileNotificationPolicy` and exact current tenant-owned public Profile email. No User account is required. Before activating profiles, run normal framework schema migration and public `planNotificationProfileRecipients` / `migrateNotificationProfileRecipients`; runtime verifies physical constraints and never applies DDL. Legacy User notification and opt-out paths remain User-only. See [profile recipient contract and matrix](agents/profile-recipients.md).\n",
|
|
12914
12992
|
"moduleDocs": [
|
|
@@ -40,74 +40,78 @@ const _icon = $derived.by(() => {
|
|
|
40
40
|
</script>
|
|
41
41
|
|
|
42
42
|
<span
|
|
43
|
-
class="
|
|
44
|
-
class:
|
|
45
|
-
class:
|
|
46
|
-
class:
|
|
43
|
+
class="smrt-account-avatar__root smrt-account-avatar__{size}"
|
|
44
|
+
class:smrt-account-avatar__email={['imap', 'smtp', 'pop3', 'gmail'].includes(providerType)}
|
|
45
|
+
class:smrt-account-avatar__slack={providerType === 'slack'}
|
|
46
|
+
class:smrt-account-avatar__twitter={providerType === 'twitter'}
|
|
47
47
|
title={name}
|
|
48
48
|
aria-label={`${name} (${providerType})`} data-smrt-component="AccountAvatar"
|
|
49
49
|
>
|
|
50
50
|
{#if _icon}
|
|
51
|
-
<span class="icon">{_icon}</span>
|
|
51
|
+
<span class="smrt-account-avatar__icon" data-smrt-part="icon">{_icon}</span>
|
|
52
52
|
{:else}
|
|
53
|
-
<span class="
|
|
53
|
+
<span class="smrt-account-avatar__initials" data-smrt-part="label">{_initials}</span>
|
|
54
54
|
{/if}
|
|
55
55
|
</span>
|
|
56
56
|
|
|
57
57
|
<style>
|
|
58
58
|
@layer smrt.reset, smrt.structure, smrt.theme;
|
|
59
|
-
@layer smrt.
|
|
60
|
-
.
|
|
59
|
+
@layer smrt.structure {
|
|
60
|
+
.smrt-account-avatar__root {
|
|
61
61
|
display: inline-flex;
|
|
62
62
|
align-items: center;
|
|
63
63
|
justify-content: center;
|
|
64
|
-
border-radius: var(--smrt-radius-full);
|
|
65
|
-
background: var(--smrt-color-secondary-container);
|
|
66
|
-
color: var(--smrt-color-on-secondary-container);
|
|
67
|
-
font-weight: var(--smrt-typography-weight-medium, 500);
|
|
68
64
|
flex-shrink: 0;
|
|
69
65
|
}
|
|
70
|
-
|
|
71
|
-
.avatar--sm {
|
|
66
|
+
.smrt-account-avatar__sm {
|
|
72
67
|
width: 1.5rem;
|
|
73
68
|
height: 1.5rem;
|
|
74
|
-
font-size: var(--smrt-typography-label-small-size, 0.625rem);
|
|
75
69
|
}
|
|
76
|
-
|
|
77
|
-
.avatar--md {
|
|
70
|
+
.smrt-account-avatar__md {
|
|
78
71
|
width: 2rem;
|
|
79
72
|
height: 2rem;
|
|
80
|
-
font-size: var(--smrt-typography-label-medium-size, 0.75rem);
|
|
81
73
|
}
|
|
82
|
-
|
|
83
|
-
.avatar--lg {
|
|
74
|
+
.smrt-account-avatar__lg {
|
|
84
75
|
width: 2.5rem;
|
|
85
76
|
height: 2.5rem;
|
|
86
|
-
font-size: var(--smrt-typography-label-large-size, 0.875rem);
|
|
87
77
|
}
|
|
78
|
+
}
|
|
88
79
|
|
|
89
|
-
|
|
80
|
+
@layer smrt.theme {
|
|
81
|
+
.smrt-account-avatar__root {
|
|
82
|
+
border-radius: var(--smrt-radius-full);
|
|
83
|
+
background: var(--smrt-color-secondary-container);
|
|
84
|
+
color: var(--smrt-color-on-secondary-container);
|
|
85
|
+
font-weight: var(--smrt-typography-weight-medium, 500);
|
|
86
|
+
}
|
|
87
|
+
.smrt-account-avatar__sm {
|
|
88
|
+
font-size: var(--smrt-typography-label-small-size, 0.625rem);
|
|
89
|
+
}
|
|
90
|
+
.smrt-account-avatar__md {
|
|
91
|
+
font-size: var(--smrt-typography-label-medium-size, 0.75rem);
|
|
92
|
+
}
|
|
93
|
+
.smrt-account-avatar__lg {
|
|
94
|
+
font-size: var(--smrt-typography-label-large-size, 0.875rem);
|
|
95
|
+
}
|
|
96
|
+
.smrt-account-avatar__email {
|
|
90
97
|
background: var(--smrt-color-primary-container);
|
|
91
98
|
color: var(--smrt-color-on-primary-container);
|
|
92
99
|
}
|
|
93
|
-
|
|
94
|
-
.avatar--slack {
|
|
100
|
+
.smrt-account-avatar__slack {
|
|
95
101
|
background: var(--smrt-color-tertiary-container);
|
|
96
102
|
color: var(--smrt-color-on-tertiary-container);
|
|
97
103
|
}
|
|
98
|
-
|
|
99
|
-
.avatar--twitter {
|
|
104
|
+
.smrt-account-avatar__twitter {
|
|
100
105
|
background: var(--smrt-color-secondary-container);
|
|
101
106
|
color: var(--smrt-color-on-secondary-container);
|
|
102
107
|
}
|
|
103
|
-
|
|
104
|
-
.icon {
|
|
108
|
+
.smrt-account-avatar__icon {
|
|
105
109
|
font-size: 1.1em;
|
|
106
110
|
}
|
|
107
|
-
|
|
108
|
-
.initials {
|
|
111
|
+
.smrt-account-avatar__initials {
|
|
109
112
|
text-transform: uppercase;
|
|
110
113
|
letter-spacing: 0.02em;
|
|
111
114
|
}
|
|
112
115
|
}
|
|
116
|
+
|
|
113
117
|
</style>
|