@happyvertical/smrt-messages 0.49.2 → 0.49.4

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.
@@ -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.49.2",
6
+ "packageVersion": "0.49.4",
7
7
  "sourceManifestPath": "dist/manifest.json",
8
8
  "agentDocPath": "AGENTS.md",
9
9
  "sourceHashes": {
10
- "manifest": "5ebc515b2af509ed59f39b57ff0dfe92151209a4116f715b05597b85b9dcf7b5",
11
- "packageJson": "b3edbcc4b85c66db5e8619e97bca23ad9e83c9166b49352f1be690021040696d",
10
+ "manifest": "af27f3217fe2ebed56aacde9104ab5db564173a0254957ccbb2b29fc1c0ca069",
11
+ "packageJson": "865762d4a84793be9649b1e008b7e2171ed52d7f7f8fb889cb3be4299c9f876a",
12
12
  "agents": "712dcc2f244d01db8b49d764b8c076e94cb9274fa4b458d7c902434a0473f127"
13
13
  },
14
14
  "exports": [
@@ -72,7 +72,7 @@
72
72
  "name": "AccountCollection",
73
73
  "qualifiedName": "@happyvertical/smrt-messages:AccountCollection",
74
74
  "collection": "accounts",
75
- "tableName": "account_collections",
75
+ "tableName": "accounts",
76
76
  "packageName": "@happyvertical/smrt-messages",
77
77
  "extends": "SmrtCollection",
78
78
  "fields": [],
@@ -343,7 +343,7 @@
343
343
  "name": "AttachmentCollection",
344
344
  "qualifiedName": "@happyvertical/smrt-messages:AttachmentCollection",
345
345
  "collection": "attachments",
346
- "tableName": "attachment_collections",
346
+ "tableName": "attachments",
347
347
  "packageName": "@happyvertical/smrt-messages",
348
348
  "extends": "SmrtCollection",
349
349
  "fields": [],
@@ -819,7 +819,7 @@
819
819
  "name": "BlacklistCollection",
820
820
  "qualifiedName": "@happyvertical/smrt-messages:BlacklistCollection",
821
821
  "collection": "blacklists",
822
- "tableName": "blacklist_collections",
822
+ "tableName": "blacklists",
823
823
  "packageName": "@happyvertical/smrt-messages",
824
824
  "extends": "SmrtCollection",
825
825
  "fields": [],
@@ -1367,7 +1367,7 @@
1367
1367
  "name": "EmailAttachmentCollection",
1368
1368
  "qualifiedName": "@happyvertical/smrt-messages:EmailAttachmentCollection",
1369
1369
  "collection": "emailattachments",
1370
- "tableName": "email_attachment_collections",
1370
+ "tableName": "email_attachments",
1371
1371
  "packageName": "@happyvertical/smrt-messages",
1372
1372
  "extends": "AttachmentCollection",
1373
1373
  "fields": [],
@@ -2706,7 +2706,7 @@
2706
2706
  "name": "EmailFolderCollection",
2707
2707
  "qualifiedName": "@happyvertical/smrt-messages:EmailFolderCollection",
2708
2708
  "collection": "emailfolders",
2709
- "tableName": "email_folder_collections",
2709
+ "tableName": "email_folders",
2710
2710
  "packageName": "@happyvertical/smrt-messages",
2711
2711
  "extends": "SmrtCollection",
2712
2712
  "fields": [],
@@ -3248,7 +3248,7 @@
3248
3248
  "name": "MessageCollection",
3249
3249
  "qualifiedName": "@happyvertical/smrt-messages:MessageCollection",
3250
3250
  "collection": "messages",
3251
- "tableName": "message_collections",
3251
+ "tableName": "messages",
3252
3252
  "packageName": "@happyvertical/smrt-messages",
3253
3253
  "extends": "SmrtCollection",
3254
3254
  "fields": [],
@@ -3828,7 +3828,7 @@
3828
3828
  "name": "WhitelistCollection",
3829
3829
  "qualifiedName": "@happyvertical/smrt-messages:WhitelistCollection",
3830
3830
  "collection": "whitelists",
3831
- "tableName": "whitelist_collections",
3831
+ "tableName": "whitelists",
3832
3832
  "packageName": "@happyvertical/smrt-messages",
3833
3833
  "extends": "SmrtCollection",
3834
3834
  "fields": [],
@@ -14989,7 +14989,7 @@
14989
14989
  "junctionCollections": 0,
14990
14990
  "hierarchicalObjects": 0,
14991
14991
  "polymorphicAssociations": 0,
14992
- "uuidColumns": 66
14992
+ "uuidColumns": 90
14993
14993
  },
14994
14994
  "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\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.\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- **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"
14995
14995
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happyvertical/smrt-messages",
3
- "version": "0.49.2",
3
+ "version": "0.49.4",
4
4
  "smrtJsdoc": "strict",
5
5
  "description": "Unified multi-channel messaging with STI-based hierarchies",
6
6
  "type": "module",
@@ -61,12 +61,12 @@
61
61
  "@happyvertical/files": "^0.89.6",
62
62
  "@happyvertical/logger": "^0.89.6",
63
63
  "@happyvertical/messages": "^0.89.6",
64
- "@happyvertical/smrt-core": "0.49.2",
65
- "@happyvertical/smrt-types": "0.49.2",
66
- "@happyvertical/smrt-secrets": "0.49.2",
67
- "@happyvertical/smrt-tenancy": "0.49.2",
68
- "@happyvertical/smrt-ui": "0.49.2",
69
- "@happyvertical/smrt-users": "0.49.2",
64
+ "@happyvertical/smrt-core": "0.49.4",
65
+ "@happyvertical/smrt-types": "0.49.4",
66
+ "@happyvertical/smrt-secrets": "0.49.4",
67
+ "@happyvertical/smrt-tenancy": "0.49.4",
68
+ "@happyvertical/smrt-ui": "0.49.4",
69
+ "@happyvertical/smrt-users": "0.49.4",
70
70
  "@happyvertical/sql": "^0.89.6",
71
71
  "@happyvertical/utils": "^0.89.6"
72
72
  },
@@ -83,7 +83,7 @@
83
83
  }
84
84
  },
85
85
  "devDependencies": {
86
- "@happyvertical/smrt-vitest": "0.49.2",
86
+ "@happyvertical/smrt-vitest": "0.49.4",
87
87
  "@sveltejs/package": "^2.5.8",
88
88
  "@sveltejs/vite-plugin-svelte": "^7.1.2",
89
89
  "@types/node": "24.13.2",