@happyvertical/smrt-messages 0.51.32 → 0.51.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.
- package/dist/__tests__/fk-fixtures.d.ts +9 -0
- package/dist/__tests__/fk-fixtures.d.ts.map +1 -0
- package/dist/__tests__/helpers/ledger-coexistence.d.ts +9 -0
- package/dist/__tests__/helpers/ledger-coexistence.d.ts.map +1 -0
- package/dist/__tests__/helpers/postgres-scratch.d.ts +13 -0
- package/dist/__tests__/helpers/postgres-scratch.d.ts.map +1 -0
- package/dist/chunks/{AccountCollection-Cgs6xo1W.js → AccountCollection-DXjxGDsJ.js} +2 -2
- package/dist/chunks/{AccountCollection-Cgs6xo1W.js.map → AccountCollection-DXjxGDsJ.js.map} +1 -1
- package/dist/chunks/{Email-Dtdw2LdF.js → Email-7wHjyzZy.js} +3 -3
- package/dist/chunks/{Email-Dtdw2LdF.js.map → Email-7wHjyzZy.js.map} +1 -1
- package/dist/chunks/{EmailFolder-Cy0dyRi5.js → EmailFolder-D9LhGz0y.js} +2 -2
- package/dist/chunks/{EmailFolder-Cy0dyRi5.js.map → EmailFolder-D9LhGz0y.js.map} +1 -1
- package/dist/chunks/{Message-DLuqSdYl.js → Message-hTX_KB8L.js} +4 -4
- package/dist/chunks/{Message-DLuqSdYl.js.map → Message-hTX_KB8L.js.map} +1 -1
- package/dist/chunks/{MessageCollection-DqniNepe.js → MessageCollection-DuCcZ-JQ.js} +2 -2
- package/dist/chunks/{MessageCollection-DqniNepe.js.map → MessageCollection-DuCcZ-JQ.js.map} +1 -1
- package/dist/chunks/{__smrt-register__-C7dAPy3D.js → __smrt-register__-Ch9C1aBu.js} +2 -2
- package/dist/chunks/{__smrt-register__-C7dAPy3D.js.map → __smrt-register__-Ch9C1aBu.js.map} +1 -1
- package/dist/collections/AccountCollection.d.ts +4 -1
- package/dist/collections/AttachmentCollection.d.ts +3 -0
- package/dist/collections/EmailAccountCollection.d.ts +6 -1
- package/dist/collections/EmailAttachmentCollection.d.ts +5 -0
- package/dist/collections/EmailCollection.d.ts +7 -1
- package/dist/collections/EmailFolderCollection.d.ts +4 -1
- package/dist/collections/MessageCollection.d.ts +6 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.js +9 -9
- package/dist/manifest.json +1 -1
- package/dist/models/Account.d.ts +7 -1
- package/dist/models/Attachment.d.ts +8 -2
- package/dist/models/Blacklist.d.ts +2 -1
- package/dist/models/Email.d.ts +10 -3
- package/dist/models/EmailAccount.d.ts +10 -4
- package/dist/models/EmailAttachment.d.ts +7 -2
- package/dist/models/EmailFolder.d.ts +8 -4
- package/dist/models/Message.d.ts +10 -4
- package/dist/models/MessagingEndpoint.d.ts +2 -1
- package/dist/models/PersonaMessageRoute.d.ts +2 -1
- package/dist/models/SlackAccount.d.ts +5 -1
- package/dist/models/SlackMessage.d.ts +5 -1
- package/dist/models/TelegramAccount.d.ts +2 -1
- package/dist/models/Tweet.d.ts +5 -1
- package/dist/models/TwitterAccount.d.ts +5 -1
- package/dist/models/Whitelist.d.ts +2 -1
- package/dist/models/ZulipAccount.d.ts +2 -1
- package/dist/permissions.d.ts +1 -1
- package/dist/providers.d.ts +3 -3
- package/dist/senders/EmailSender.d.ts +7 -4
- package/dist/senders/SlackSender.d.ts +12 -3
- package/dist/senders/TelegramSender.d.ts +2 -2
- package/dist/senders/TweetSender.d.ts +12 -3
- package/dist/senders/ZulipSender.d.ts +2 -2
- package/dist/senders/index.d.ts +6 -0
- package/dist/senders/index.d.ts.map +1 -0
- package/dist/services/MessagingSettingsService.d.ts +4 -4
- package/dist/services/PersonaMessagingService.d.ts +3 -3
- package/dist/smrt-knowledge.json +4 -4
- package/dist/types.d.ts +4 -1
- package/dist/ui.d.ts +7 -1
- package/package.json +10 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"__smrt-register__-
|
|
1
|
+
{"version":3,"file":"__smrt-register__-Ch9C1aBu.js","names":[],"sources":["../../src/__smrt-register__.ts"],"sourcesContent":["/**\n * Self-registers this package's build-time manifest before any @smrt() decorator\n * in the package fires. Fixes issue #1132: in consumer runtimes (tsx, SvelteKit\n * SSR, plain `vite dev`) the decorator's synchronous manifest lookup previously\n * missed because no step populated the global manifest cache — classes got\n * registered with zero fields and `save()` / `toJSON()` silently dropped every\n * declared property.\n *\n * Import this module as the first statement in `src/index.ts` so its top-level\n * side effect runs ahead of any class module's @smrt() decorator.\n *\n * Silent no-op in dev/test, where the vitest plugin already populates manifests\n * via a different path. Only needs to succeed in the published dist output.\n *\n * @see https://github.com/happyvertical/smrt/issues/1132\n */\nimport { ObjectRegistry } from '@happyvertical/smrt-core';\n\n// During library builds, smrtPlugin replaces this entire module with generated\n// code that embeds the scanned manifest inline (#1506/#1507) — published dists\n// never resolve this URL, so downstream bundlers cannot break registration by\n// relocating the compiled module away from dist/manifest.json. The runtime\n// lookup below is the fallback for source-mode runs without that transform.\nObjectRegistry.registerPackageManifest(\n new URL('./manifest.json', import.meta.url),\n);\n"],"mappings":""}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AccountCollection - Unified collection for polymorphic account queries
|
|
3
|
+
*/
|
|
1
4
|
import { SmrtCollection } from '@happyvertical/smrt-core';
|
|
2
5
|
import { Account } from '../models/Account';
|
|
3
|
-
import { AccountSearchFilters } from '../types';
|
|
6
|
+
import type { AccountSearchFilters } from '../types';
|
|
4
7
|
export declare class AccountCollection extends SmrtCollection<Account> {
|
|
5
8
|
static readonly _itemClass: typeof Account;
|
|
6
9
|
/**
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AttachmentCollection - Generalized attachment collection using messageId
|
|
3
|
+
*/
|
|
1
4
|
import { SmrtCollection } from '@happyvertical/smrt-core';
|
|
2
5
|
import { Attachment } from '../models/Attachment';
|
|
3
6
|
export declare class AttachmentCollection extends SmrtCollection<Attachment> {
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EmailAccountCollection - Collection manager for EmailAccount objects
|
|
3
|
+
*
|
|
4
|
+
* Extends AccountCollection with email-specific query methods.
|
|
5
|
+
*/
|
|
1
6
|
import { EmailAccount } from '../models/EmailAccount';
|
|
2
|
-
import { EmailAccountSearchFilters, ProviderType, SyncOptions } from '../types';
|
|
7
|
+
import type { EmailAccountSearchFilters, ProviderType, SyncOptions } from '../types';
|
|
3
8
|
import { AccountCollection } from './AccountCollection';
|
|
4
9
|
export declare class EmailAccountCollection extends AccountCollection {
|
|
5
10
|
static readonly _itemClass: typeof EmailAccount;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EmailAttachmentCollection - Backward-compatible collection for EmailAttachment
|
|
3
|
+
*
|
|
4
|
+
* @deprecated Use AttachmentCollection instead
|
|
5
|
+
*/
|
|
1
6
|
import { EmailAttachment } from '../models/EmailAttachment';
|
|
2
7
|
import { AttachmentCollection } from './AttachmentCollection';
|
|
3
8
|
/**
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EmailCollection - Collection manager for Email objects
|
|
3
|
+
*
|
|
4
|
+
* Extends MessageCollection with email-specific query methods.
|
|
5
|
+
* STI framework auto-filters to Email instances.
|
|
6
|
+
*/
|
|
1
7
|
import { Email } from '../models/Email';
|
|
2
|
-
import { EmailSearchFilters } from '../types';
|
|
8
|
+
import type { EmailSearchFilters } from '../types';
|
|
3
9
|
import { MessageCollection } from './MessageCollection';
|
|
4
10
|
export declare class EmailCollection extends MessageCollection {
|
|
5
11
|
static readonly _itemClass: typeof Email;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EmailFolderCollection - Collection manager for EmailFolder objects
|
|
3
|
+
*/
|
|
1
4
|
import { SmrtCollection } from '@happyvertical/smrt-core';
|
|
2
5
|
import { EmailFolder } from '../models/EmailFolder';
|
|
3
|
-
import { EmailFolderSearchFilters } from '../types';
|
|
6
|
+
import type { EmailFolderSearchFilters } from '../types';
|
|
4
7
|
export declare class EmailFolderCollection extends SmrtCollection<EmailFolder> {
|
|
5
8
|
static readonly _itemClass: typeof EmailFolder;
|
|
6
9
|
/**
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MessageCollection - Unified collection for polymorphic message queries
|
|
3
|
+
*
|
|
4
|
+
* Queries the messages table with STI, returning correct subclass instances.
|
|
5
|
+
*/
|
|
1
6
|
import { SmrtCollection } from '@happyvertical/smrt-core';
|
|
2
7
|
import { Message } from '../models/Message';
|
|
3
|
-
import { MessageSearchFilters } from '../types';
|
|
8
|
+
import type { MessageSearchFilters } from '../types';
|
|
4
9
|
export declare class MessageCollection extends SmrtCollection<Message> {
|
|
5
10
|
static readonly _itemClass: typeof Message;
|
|
6
11
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @happyvertical/smrt-messages
|
|
3
|
+
*
|
|
4
|
+
* Unified multi-channel messaging with STI-based hierarchies
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*/
|
|
8
|
+
import './__smrt-register__.js';
|
|
1
9
|
export { AccountCollection } from './collections/AccountCollection';
|
|
2
10
|
export { AttachmentCollection } from './collections/AttachmentCollection';
|
|
3
11
|
export { MessageCollection } from './collections/MessageCollection';
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as __exportAll } from "./chunks/rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import "./chunks/__smrt-register__-
|
|
2
|
+
import "./chunks/__smrt-register__-Ch9C1aBu.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
|
-
import { r as Account, t as AccountCollection } from "./chunks/AccountCollection-
|
|
5
|
-
import { t as Message } from "./chunks/Message-
|
|
6
|
-
import { t as MessageCollection } from "./chunks/MessageCollection-
|
|
7
|
-
import { t as Email } from "./chunks/Email-
|
|
8
|
-
import { t as EmailFolder } from "./chunks/EmailFolder-
|
|
4
|
+
import { r as Account, t as AccountCollection } from "./chunks/AccountCollection-DXjxGDsJ.js";
|
|
5
|
+
import { t as Message } from "./chunks/Message-hTX_KB8L.js";
|
|
6
|
+
import { t as MessageCollection } from "./chunks/MessageCollection-DuCcZ-JQ.js";
|
|
7
|
+
import { t as Email } from "./chunks/Email-7wHjyzZy.js";
|
|
8
|
+
import { t as EmailFolder } from "./chunks/EmailFolder-D9LhGz0y.js";
|
|
9
9
|
import { t as SlackSender } from "./chunks/SlackSender-CjSvwY1K.js";
|
|
10
10
|
import { t as TweetSender } from "./chunks/TweetSender-CcLPNNi1.js";
|
|
11
11
|
import { SmrtCollection, SmrtObject, crossPackageRef, field, foreignKey, importOptionalDependency, smrt } from "@happyvertical/smrt-core";
|
|
@@ -91,7 +91,7 @@ var Attachment = class extends SmrtObject {
|
|
|
91
91
|
*/
|
|
92
92
|
async getMessage() {
|
|
93
93
|
if (!this.messageId) return null;
|
|
94
|
-
const { MessageCollection } = await import("./chunks/MessageCollection-
|
|
94
|
+
const { MessageCollection } = await import("./chunks/MessageCollection-DuCcZ-JQ.js").then((n) => n.n);
|
|
95
95
|
return await (await MessageCollection.create(this.options)).get({ id: this.messageId });
|
|
96
96
|
}
|
|
97
97
|
/**
|
|
@@ -526,7 +526,7 @@ var EmailAccount = class extends Account {
|
|
|
526
526
|
for (const folderName of foldersToSync) try {
|
|
527
527
|
let folder = await folderCollection.getByPath(accountId, folderName);
|
|
528
528
|
if (!folder) {
|
|
529
|
-
const { EmailFolder } = await import("./chunks/EmailFolder-
|
|
529
|
+
const { EmailFolder } = await import("./chunks/EmailFolder-D9LhGz0y.js").then((n) => n.n);
|
|
530
530
|
folder = new EmailFolder({
|
|
531
531
|
...this.childOptions(),
|
|
532
532
|
accountId,
|
|
@@ -551,7 +551,7 @@ var EmailAccount = class extends Account {
|
|
|
551
551
|
result.messagesSkipped++;
|
|
552
552
|
continue;
|
|
553
553
|
}
|
|
554
|
-
const { Email } = await import("./chunks/Email-
|
|
554
|
+
const { Email } = await import("./chunks/Email-7wHjyzZy.js").then((n) => n.n);
|
|
555
555
|
let email = existingEmail;
|
|
556
556
|
if (!email) {
|
|
557
557
|
email = new Email({
|
package/dist/manifest.json
CHANGED
package/dist/models/Account.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Account model - Base class for all messaging account types (STI)
|
|
3
|
+
*
|
|
4
|
+
* Common fields shared across email, Slack, Twitter accounts, etc.
|
|
5
|
+
*/
|
|
6
|
+
import '../__smrt-register__.js';
|
|
1
7
|
import { SmrtObject } from '@happyvertical/smrt-core';
|
|
2
|
-
import { AccountOptions, MessageSenderInterface } from '../types';
|
|
8
|
+
import type { AccountOptions, MessageSenderInterface } from '../types';
|
|
3
9
|
export declare class Account extends SmrtObject {
|
|
4
10
|
tenantId: string | null;
|
|
5
11
|
name: string;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attachment model - Generalized attachment for any message type
|
|
3
|
+
*
|
|
4
|
+
* Uses messageId instead of emailId for cross-type support.
|
|
5
|
+
*/
|
|
6
|
+
import '../__smrt-register__.js';
|
|
1
7
|
import { SmrtObject } from '@happyvertical/smrt-core';
|
|
2
|
-
import { AttachmentOptions } from '../types';
|
|
8
|
+
import type { AttachmentOptions } from '../types';
|
|
3
9
|
export declare class Attachment extends SmrtObject {
|
|
4
10
|
tenantId: string | null;
|
|
5
11
|
messageId: string;
|
|
@@ -15,7 +21,7 @@ export declare class Attachment extends SmrtObject {
|
|
|
15
21
|
/**
|
|
16
22
|
* Get the message this attachment belongs to
|
|
17
23
|
*/
|
|
18
|
-
getMessage(): Promise<import(
|
|
24
|
+
getMessage(): Promise<import("./Message.js").Message | null>;
|
|
19
25
|
/**
|
|
20
26
|
* Check if attachment is an image
|
|
21
27
|
*/
|
package/dist/models/Email.d.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Email model - Email message extending the Message STI base
|
|
3
|
+
*
|
|
4
|
+
* Retains all email-specific fields (RFC 822 compliance, folders, etc.)
|
|
5
|
+
* while inheriting common message fields from Message.
|
|
6
|
+
*/
|
|
7
|
+
import '../__smrt-register__.js';
|
|
8
|
+
import type { EmailOptions } from '../types';
|
|
2
9
|
import { Message } from './Message';
|
|
3
10
|
export declare class Email extends Message {
|
|
4
11
|
messageId: string;
|
|
@@ -59,11 +66,11 @@ export declare class Email extends Message {
|
|
|
59
66
|
/**
|
|
60
67
|
* Get the email account (typed as EmailAccount)
|
|
61
68
|
*/
|
|
62
|
-
getAccount(): Promise<import(
|
|
69
|
+
getAccount(): Promise<import("./Account.js").Account | null>;
|
|
63
70
|
/**
|
|
64
71
|
* Get the folder
|
|
65
72
|
*/
|
|
66
|
-
getFolder(): Promise<import(
|
|
73
|
+
getFolder(): Promise<import("./EmailFolder.js").EmailFolder | null>;
|
|
67
74
|
/**
|
|
68
75
|
* Get emails in the same thread
|
|
69
76
|
*/
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* EmailAccount model - Email account extending the Account STI base
|
|
3
|
+
*
|
|
4
|
+
* Retains email-specific fields and sync capability.
|
|
5
|
+
*/
|
|
6
|
+
import '../__smrt-register__.js';
|
|
7
|
+
import type { EmailAccountOptions, MessageSenderInterface, SyncOptions, SyncResult } from '../types';
|
|
2
8
|
import { Account } from './Account';
|
|
3
9
|
export declare class EmailAccount extends Account {
|
|
4
10
|
email: string;
|
|
@@ -28,7 +34,7 @@ export declare class EmailAccount extends Account {
|
|
|
28
34
|
* import '@happyvertical/smrt-messages/providers/email' (or
|
|
29
35
|
* '/providers/all') once during startup.
|
|
30
36
|
*/
|
|
31
|
-
createClient(): Promise<import(
|
|
37
|
+
createClient(): Promise<import("@happyvertical/email").EmailClient>;
|
|
32
38
|
/**
|
|
33
39
|
* Sync emails from the email server to the database
|
|
34
40
|
*/
|
|
@@ -36,11 +42,11 @@ export declare class EmailAccount extends Account {
|
|
|
36
42
|
/**
|
|
37
43
|
* Get all folders for this account
|
|
38
44
|
*/
|
|
39
|
-
getFolders(): Promise<import(
|
|
45
|
+
getFolders(): Promise<import("./EmailFolder").EmailFolder[]>;
|
|
40
46
|
/**
|
|
41
47
|
* Get all emails for this account
|
|
42
48
|
*/
|
|
43
|
-
getEmails(limit?: number): Promise<import(
|
|
49
|
+
getEmails(limit?: number): Promise<import("./Message.js").Message[]>;
|
|
44
50
|
/**
|
|
45
51
|
* Get unread email count
|
|
46
52
|
*/
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* EmailAttachment - Backward-compatible alias for Attachment
|
|
3
|
+
*
|
|
4
|
+
* @deprecated Use Attachment instead. EmailAttachment is preserved for backward compatibility.
|
|
5
|
+
*/
|
|
6
|
+
import type { EmailAttachmentOptions } from '../types';
|
|
2
7
|
import { Attachment } from './Attachment';
|
|
3
8
|
/**
|
|
4
9
|
* @deprecated Use Attachment instead
|
|
@@ -14,6 +19,6 @@ export declare class EmailAttachment extends Attachment {
|
|
|
14
19
|
* Get the email this attachment belongs to
|
|
15
20
|
* @deprecated Use getMessage() instead
|
|
16
21
|
*/
|
|
17
|
-
getEmail(): Promise<import(
|
|
22
|
+
getEmail(): Promise<import("./Message").Message | null>;
|
|
18
23
|
}
|
|
19
24
|
//# sourceMappingURL=EmailAttachment.d.ts.map
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EmailFolder model - Folder/label tracking
|
|
3
|
+
*/
|
|
4
|
+
import '../__smrt-register__.js';
|
|
1
5
|
import { SmrtObject } from '@happyvertical/smrt-core';
|
|
2
|
-
import { EmailFolderOptions } from '../types';
|
|
6
|
+
import type { EmailFolderOptions } from '../types';
|
|
3
7
|
export declare class EmailFolder extends SmrtObject {
|
|
4
8
|
tenantId: string | null;
|
|
5
9
|
accountId: string;
|
|
@@ -16,15 +20,15 @@ export declare class EmailFolder extends SmrtObject {
|
|
|
16
20
|
/**
|
|
17
21
|
* Get the email account
|
|
18
22
|
*/
|
|
19
|
-
getAccount(): Promise<import(
|
|
23
|
+
getAccount(): Promise<import("./Account.js").Account | null>;
|
|
20
24
|
/**
|
|
21
25
|
* Get all emails in this folder
|
|
22
26
|
*/
|
|
23
|
-
getEmails(limit?: number): Promise<import(
|
|
27
|
+
getEmails(limit?: number): Promise<import("./Message.js").Message[]>;
|
|
24
28
|
/**
|
|
25
29
|
* Get unread emails in this folder
|
|
26
30
|
*/
|
|
27
|
-
getUnreadEmails(limit?: number): Promise<import(
|
|
31
|
+
getUnreadEmails(limit?: number): Promise<import("./Message.js").Message[]>;
|
|
28
32
|
/**
|
|
29
33
|
* Update message counts from database
|
|
30
34
|
*/
|
package/dist/models/Message.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Message model - Base class for all message types (STI)
|
|
3
|
+
*
|
|
4
|
+
* Common fields shared across email, tweets, slack messages, etc.
|
|
5
|
+
*/
|
|
6
|
+
import '../__smrt-register__.js';
|
|
1
7
|
import { SmrtObject } from '@happyvertical/smrt-core';
|
|
2
|
-
import { MessageOptions, MessageSendResult, SendMessageOptions, SendStatus } from '../types';
|
|
8
|
+
import type { MessageOptions, MessageSendResult, SendMessageOptions, SendStatus } from '../types';
|
|
3
9
|
export declare class Message extends SmrtObject {
|
|
4
10
|
tenantId: string | null;
|
|
5
11
|
accountId: string;
|
|
@@ -74,8 +80,8 @@ export declare class Message extends SmrtObject {
|
|
|
74
80
|
/**
|
|
75
81
|
* Get the account for this message
|
|
76
82
|
*/
|
|
77
|
-
getAccount(): Promise<import(
|
|
78
|
-
getEndpoint(): Promise<import(
|
|
83
|
+
getAccount(): Promise<import("./Account.js").Account | null>;
|
|
84
|
+
getEndpoint(): Promise<import("./MessagingEndpoint.js").MessagingEndpoint | null>;
|
|
79
85
|
/**
|
|
80
86
|
* Get messages in the same thread
|
|
81
87
|
*/
|
|
@@ -83,7 +89,7 @@ export declare class Message extends SmrtObject {
|
|
|
83
89
|
/**
|
|
84
90
|
* Get attachments for this message
|
|
85
91
|
*/
|
|
86
|
-
getAttachments(): Promise<import(
|
|
92
|
+
getAttachments(): Promise<import("./Attachment.js").Attachment[]>;
|
|
87
93
|
/**
|
|
88
94
|
* Send this message via its account's sender
|
|
89
95
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import '../__smrt-register__.js';
|
|
1
2
|
import { SmrtObject } from '@happyvertical/smrt-core';
|
|
2
|
-
import { MessagingChannel, MessagingEndpointOptions } from '../types.js';
|
|
3
|
+
import type { MessagingChannel, MessagingEndpointOptions } from '../types.js';
|
|
3
4
|
export declare class MessagingEndpoint extends SmrtObject {
|
|
4
5
|
tenantId: string;
|
|
5
6
|
profileId: string | null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SmrtObject } from '@happyvertical/smrt-core';
|
|
2
|
-
import
|
|
2
|
+
import '../__smrt-register__.js';
|
|
3
|
+
import type { PersonaMessageRouteOptions } from '../types.js';
|
|
3
4
|
export declare class PersonaMessageRoute extends SmrtObject {
|
|
4
5
|
tenantId: string;
|
|
5
6
|
personaId: string;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* SlackAccount model - Slack workspace account extending the Account STI base
|
|
3
|
+
*/
|
|
4
|
+
import '../__smrt-register__.js';
|
|
5
|
+
import type { MessageSenderInterface, SlackAccountOptions } from '../types';
|
|
2
6
|
import { Account } from './Account';
|
|
3
7
|
export declare class SlackAccount extends Account {
|
|
4
8
|
workspaceId: string;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* SlackMessage model - Slack message extending the Message STI base
|
|
3
|
+
*/
|
|
4
|
+
import '../__smrt-register__.js';
|
|
5
|
+
import type { SlackMessageOptions } from '../types';
|
|
2
6
|
import { Message } from './Message';
|
|
3
7
|
export declare class SlackMessage extends Message {
|
|
4
8
|
channelId: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../__smrt-register__.js';
|
|
2
|
+
import type { AccountOptions } from '../types.js';
|
|
2
3
|
import { Account } from './Account.js';
|
|
3
4
|
export declare class TelegramAccount extends Account {
|
|
4
5
|
constructor(options?: AccountOptions);
|
package/dist/models/Tweet.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Tweet model - Twitter/X message extending the Message STI base
|
|
3
|
+
*/
|
|
4
|
+
import '../__smrt-register__.js';
|
|
5
|
+
import type { TweetOptions } from '../types';
|
|
2
6
|
import { Message } from './Message';
|
|
3
7
|
export declare class Tweet extends Message {
|
|
4
8
|
tweetId: string;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* TwitterAccount model - Twitter/X account extending the Account STI base
|
|
3
|
+
*/
|
|
4
|
+
import '../__smrt-register__.js';
|
|
5
|
+
import type { MessageSenderInterface, TwitterAccountOptions } from '../types';
|
|
2
6
|
import { Account } from './Account';
|
|
3
7
|
export declare class TwitterAccount extends Account {
|
|
4
8
|
handle: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../__smrt-register__.js';
|
|
2
|
+
import type { AccountOptions } from '../types.js';
|
|
2
3
|
import { Account } from './Account.js';
|
|
3
4
|
export declare class ZulipAccount extends Account {
|
|
4
5
|
constructor(options?: AccountOptions);
|
package/dist/permissions.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PermissionDefinition } from '@happyvertical/smrt-users';
|
|
1
|
+
import { type PermissionDefinition } from '@happyvertical/smrt-users';
|
|
2
2
|
export declare const SEND_MESSAGES_PERMISSION = "messages.send";
|
|
3
3
|
export declare const MANAGE_MESSAGE_ROUTES_PERMISSION = "messages.manage-routes";
|
|
4
4
|
export declare const MANAGE_MESSAGE_CREDENTIALS_PERMISSION = "messages.manage-credentials";
|
package/dist/providers.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { EmailClient, GetEmailClientOptions } from '@happyvertical/email';
|
|
2
|
-
import { Account } from './models/Account.js';
|
|
3
|
-
import { MessageClientFactory, MessageSenderInterface, MessagingChannel } from './types.js';
|
|
1
|
+
import type { EmailClient, GetEmailClientOptions } from '@happyvertical/email';
|
|
2
|
+
import type { Account } from './models/Account.js';
|
|
3
|
+
import type { MessageClientFactory, MessageSenderInterface, MessagingChannel } from './types.js';
|
|
4
4
|
export type MessagingProviderFieldType = 'string' | 'number' | 'boolean' | 'select' | 'url' | 'email' | 'password';
|
|
5
5
|
export interface MessagingProviderField {
|
|
6
6
|
id: string;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
1
|
+
/**
|
|
2
|
+
* EmailSender — sends email messages via the SDK EmailClient
|
|
3
|
+
*/
|
|
4
|
+
import type { EmailClient } from '@happyvertical/email';
|
|
5
|
+
import type { Email } from '../models/Email';
|
|
6
|
+
import type { EmailAccount } from '../models/EmailAccount';
|
|
7
|
+
import type { MessageSenderInterface, MessageSendResult, SendMessageOptions } from '../types';
|
|
5
8
|
export declare class EmailSender implements MessageSenderInterface {
|
|
6
9
|
readonly providerType = "email";
|
|
7
10
|
private client;
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* SlackSender — sends Slack messages via the SDK MessageClient
|
|
3
|
+
*
|
|
4
|
+
* The SDK transport comes from the messaging provider registry (populated by
|
|
5
|
+
* `@happyvertical/smrt-messages/providers/slack`) or constructor injection —
|
|
6
|
+
* never a direct `@happyvertical/messages` import, which would drag the SDK
|
|
7
|
+
* (and transitively googleapis/nodemailer via its email wrapper) into
|
|
8
|
+
* provider-neutral consumer bundles (#1979).
|
|
9
|
+
*/
|
|
10
|
+
import type { SlackAccount } from '../models/SlackAccount';
|
|
11
|
+
import type { SlackMessage } from '../models/SlackMessage';
|
|
12
|
+
import type { MessageClientFactory, MessageSenderInterface, MessageSendResult, SendMessageOptions } from '../types';
|
|
4
13
|
export declare class SlackSender implements MessageSenderInterface {
|
|
5
14
|
readonly providerType = "slack";
|
|
6
15
|
private account;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Account } from '../models/Account.js';
|
|
2
|
-
import { MessageSenderInterface, MessageSendResult, SendMessageOptions } from '../types.js';
|
|
1
|
+
import type { Account } from '../models/Account.js';
|
|
2
|
+
import type { MessageSenderInterface, MessageSendResult, SendMessageOptions } from '../types.js';
|
|
3
3
|
export declare class TelegramSender implements MessageSenderInterface {
|
|
4
4
|
private readonly account;
|
|
5
5
|
private readonly fetcher;
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* TweetSender — sends tweets via the SDK MessageClient
|
|
3
|
+
*
|
|
4
|
+
* The SDK transport comes from the messaging provider registry (populated by
|
|
5
|
+
* `@happyvertical/smrt-messages/providers/twitter`) or constructor injection —
|
|
6
|
+
* never a direct `@happyvertical/messages` import, which would drag the SDK
|
|
7
|
+
* (and transitively googleapis/nodemailer via its email wrapper) into
|
|
8
|
+
* provider-neutral consumer bundles (#1979).
|
|
9
|
+
*/
|
|
10
|
+
import type { Tweet } from '../models/Tweet';
|
|
11
|
+
import type { TwitterAccount } from '../models/TwitterAccount';
|
|
12
|
+
import type { MessageClientFactory, MessageSenderInterface, MessageSendResult, SendMessageOptions } from '../types';
|
|
4
13
|
export declare class TweetSender implements MessageSenderInterface {
|
|
5
14
|
readonly providerType = "twitter";
|
|
6
15
|
private account;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Account } from '../models/Account.js';
|
|
2
|
-
import { MessageSenderInterface, MessageSendResult, SendMessageOptions } from '../types.js';
|
|
1
|
+
import type { Account } from '../models/Account.js';
|
|
2
|
+
import type { MessageSenderInterface, MessageSendResult, SendMessageOptions } from '../types.js';
|
|
3
3
|
export declare class ZulipSender implements MessageSenderInterface {
|
|
4
4
|
private readonly account;
|
|
5
5
|
private readonly fetcher;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { EmailSender } from './EmailSender.js';
|
|
2
|
+
export { SlackSender } from './SlackSender.js';
|
|
3
|
+
export { TelegramSender } from './TelegramSender.js';
|
|
4
|
+
export { TweetSender } from './TweetSender.js';
|
|
5
|
+
export { ZulipSender } from './ZulipSender.js';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/senders/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { SmrtClassOptions } from '@happyvertical/smrt-core';
|
|
1
|
+
import type { SmrtClassOptions } from '@happyvertical/smrt-core';
|
|
2
2
|
import { PersonaMessageRoute } from '../models/PersonaMessageRoute.js';
|
|
3
|
-
import { MessagingPrincipal } from '../permissions.js';
|
|
4
|
-
import { MessagingProviderDefinition, MessagingProviderField, MessagingProviderFunctionKey } from '../providers.js';
|
|
5
|
-
import { MessagingChannel } from '../types.js';
|
|
3
|
+
import { type MessagingPrincipal } from '../permissions.js';
|
|
4
|
+
import { type MessagingProviderDefinition, type MessagingProviderField, type MessagingProviderFunctionKey } from '../providers.js';
|
|
5
|
+
import type { MessagingChannel } from '../types.js';
|
|
6
6
|
export interface MessagingAccountInput {
|
|
7
7
|
id?: string;
|
|
8
8
|
name: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { SmrtClassOptions } from '@happyvertical/smrt-core';
|
|
2
|
-
import { MessagingPrincipal } from '../permissions.js';
|
|
3
|
-
import { MessageSendResult, SendPersonaMessageOptions } from '../types.js';
|
|
1
|
+
import type { SmrtClassOptions } from '@happyvertical/smrt-core';
|
|
2
|
+
import { type MessagingPrincipal } from '../permissions.js';
|
|
3
|
+
import type { MessageSendResult, SendPersonaMessageOptions } from '../types.js';
|
|
4
4
|
export interface PersonaMessageSendResult {
|
|
5
5
|
routeId: string;
|
|
6
6
|
messageId: string;
|
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.51.
|
|
6
|
+
"packageVersion": "0.51.34",
|
|
7
7
|
"sourceManifestPath": "dist/manifest.json",
|
|
8
8
|
"agentDocPath": "AGENTS.md",
|
|
9
9
|
"sourceHashes": {
|
|
10
|
-
"manifest": "
|
|
11
|
-
"packageJson": "
|
|
10
|
+
"manifest": "1b1cbac6ff1dd5c236ec0a1fddbb6fcb743d557d0e57c6a8f55ead8d62b08db9",
|
|
11
|
+
"packageJson": "2148c2fa3f32994fc842b2074e74cd2c777df8dcb1d9fe7905167d3ca6bd1258",
|
|
12
12
|
"agents": "ceb0ee5313abe0316f7b4dbfc0ec8c94e3ec0e10826851145d4da91b6b764f38"
|
|
13
13
|
},
|
|
14
14
|
"exports": [
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@types/node": "24.13.6",
|
|
44
44
|
"svelte": "^5.57.1",
|
|
45
45
|
"svelte-check": "^4.7.6",
|
|
46
|
-
"typescript": "
|
|
46
|
+
"typescript": "6.0.3",
|
|
47
47
|
"vite": "8.1.4",
|
|
48
48
|
"vitest": "4.1.10",
|
|
49
49
|
"@happyvertical/encryption": "*"
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for @happyvertical/smrt-messages
|
|
3
|
+
*/
|
|
4
|
+
import type { SmrtObjectOptions } from '@happyvertical/smrt-core';
|
|
2
5
|
export type KnownMessagingChannel = 'email' | 'zulip' | 'telegram' | 'slack' | 'twitter' | 'sms';
|
|
3
6
|
/** Open-ended so downstream packages can add channels without changing SMRT. */
|
|
4
7
|
export type MessagingChannel = KnownMessagingChannel | (string & {});
|
package/dist/ui.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Messages Module UI Slot Declarations
|
|
3
|
+
*
|
|
4
|
+
* Defines UI extension points for the messages module.
|
|
5
|
+
* UI components are implemented in the ./svelte subpath.
|
|
6
|
+
*/
|
|
7
|
+
import type { ModuleUISlot, SmrtModuleMeta } from '@happyvertical/smrt-types';
|
|
2
8
|
export declare const MESSAGES_UI_SLOTS: Record<string, ModuleUISlot>;
|
|
3
9
|
export declare const MESSAGES_MODULE_META: SmrtModuleMeta;
|
|
4
10
|
//# sourceMappingURL=ui.d.ts.map
|