@stacksjs/chat 0.75.520 → 0.75.522
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/drivers/discord.d.ts +8 -0
- package/dist/drivers/slack.d.ts +7 -0
- package/dist/drivers/teams.d.ts +6 -0
- package/dist/inbox/discord-gateway.d.ts +19 -0
- package/dist/inbox/discord.d.ts +31 -0
- package/dist/inbox/imessage/chat-db.d.ts +7 -2
- package/dist/inbox/imessage/contacts.d.ts +2 -0
- package/dist/inbox/imessage/driver.d.ts +18 -0
- package/dist/inbox/slack.d.ts +21 -0
- package/dist/inbox/whatsapp/chat-storage.d.ts +17 -13
- package/dist/inbox/whatsapp/driver.d.ts +17 -0
- package/package.json +7 -7
|
@@ -89,8 +89,16 @@ export declare interface DiscordMessage {
|
|
|
89
89
|
}
|
|
90
90
|
export declare class DiscordDriver extends BaseChatDriver {
|
|
91
91
|
name: string;
|
|
92
|
+
private settings;
|
|
93
|
+
private explicitRetries;
|
|
92
94
|
constructor(options?: DiscordConfig);
|
|
93
95
|
send(message: ChatMessage, options?: RenderOptions): Promise<ChatResult>;
|
|
96
|
+
private sendWithRetry;
|
|
97
|
+
private sendMessage;
|
|
98
|
+
private messageFor;
|
|
99
|
+
private sendViaWebhook;
|
|
100
|
+
private sendViaBotToken;
|
|
101
|
+
private buildEmbed;
|
|
94
102
|
}
|
|
95
103
|
export { DiscordDriver as Driver };
|
|
96
104
|
export default __dtsx_default_export__;
|
package/dist/drivers/slack.d.ts
CHANGED
|
@@ -82,8 +82,15 @@ export declare interface SlackAttachment {
|
|
|
82
82
|
}
|
|
83
83
|
export declare class SlackDriver extends BaseChatDriver {
|
|
84
84
|
name: string;
|
|
85
|
+
private settings;
|
|
86
|
+
private explicitRetries;
|
|
85
87
|
constructor(options?: SlackConfig);
|
|
86
88
|
send(message: ChatMessage, options?: RenderOptions): Promise<ChatResult>;
|
|
89
|
+
private sendWithRetry;
|
|
90
|
+
private sendMessage;
|
|
91
|
+
private sendViaWebhook;
|
|
92
|
+
private sendViaBotToken;
|
|
93
|
+
private buildBlocks;
|
|
87
94
|
}
|
|
88
95
|
export { SlackDriver as Driver };
|
|
89
96
|
export default __dtsx_default_export__;
|
package/dist/drivers/teams.d.ts
CHANGED
|
@@ -86,8 +86,14 @@ export declare interface TeamsMessage {
|
|
|
86
86
|
}
|
|
87
87
|
export declare class TeamsDriver extends BaseChatDriver {
|
|
88
88
|
name: string;
|
|
89
|
+
private settings;
|
|
90
|
+
private explicitRetries;
|
|
89
91
|
constructor(options?: TeamsConfig);
|
|
90
92
|
send(message: ChatMessage, options?: RenderOptions): Promise<ChatResult>;
|
|
93
|
+
private sendWithRetry;
|
|
94
|
+
private sendMessage;
|
|
95
|
+
private buildPayload;
|
|
96
|
+
private buildAdaptiveCard;
|
|
91
97
|
}
|
|
92
98
|
export { TeamsDriver as Driver };
|
|
93
99
|
export default __dtsx_default_export__;
|
|
@@ -21,9 +21,28 @@ export declare interface GatewayOptions {
|
|
|
21
21
|
onAuthFailed?: (reason: string) => void
|
|
22
22
|
}
|
|
23
23
|
export declare class DiscordGateway {
|
|
24
|
+
private socket;
|
|
25
|
+
private heartbeat;
|
|
26
|
+
private sequence;
|
|
27
|
+
private sessionId;
|
|
28
|
+
private resumeUrl;
|
|
29
|
+
private acknowledged;
|
|
30
|
+
private stopped;
|
|
31
|
+
private failures;
|
|
32
|
+
private Socket;
|
|
33
|
+
private url;
|
|
34
|
+
private readyResolvers;
|
|
24
35
|
ready: any;
|
|
36
|
+
private identity;
|
|
37
|
+
private options;
|
|
25
38
|
constructor(identity: GatewayIdentity, options: GatewayOptions);
|
|
26
39
|
whenReady(timeoutMs?: unknown): Promise<any>;
|
|
27
40
|
connect(): void;
|
|
28
41
|
stop(): void;
|
|
42
|
+
private send;
|
|
43
|
+
private onMessage;
|
|
44
|
+
private identify;
|
|
45
|
+
private startHeartbeat;
|
|
46
|
+
private clearHeartbeat;
|
|
47
|
+
private onClose;
|
|
29
48
|
}
|
package/dist/inbox/discord.d.ts
CHANGED
|
@@ -28,16 +28,47 @@ export declare interface DiscordInboxConfig {
|
|
|
28
28
|
export declare class DiscordInboxDriver implements InboxDriver {
|
|
29
29
|
readonly provider: 'discord';
|
|
30
30
|
readonly label: string;
|
|
31
|
+
private token;
|
|
32
|
+
private account;
|
|
33
|
+
private userId;
|
|
34
|
+
private fetch;
|
|
35
|
+
private apiBase;
|
|
36
|
+
private concurrency;
|
|
37
|
+
private Socket;
|
|
38
|
+
private gatewayUrl;
|
|
39
|
+
private session;
|
|
40
|
+
private listeners;
|
|
41
|
+
private guilds;
|
|
42
|
+
private icons;
|
|
43
|
+
private channels;
|
|
44
|
+
private users;
|
|
45
|
+
private readStates;
|
|
46
|
+
private muted;
|
|
47
|
+
private listed;
|
|
48
|
+
private previews;
|
|
31
49
|
constructor(config: DiscordInboxConfig);
|
|
50
|
+
private isUser;
|
|
51
|
+
private headers;
|
|
52
|
+
private api;
|
|
32
53
|
capabilities(): InboxCapabilities;
|
|
33
54
|
status(): Promise<InboxStatus>;
|
|
55
|
+
private gateway;
|
|
56
|
+
private emit;
|
|
57
|
+
private absorbReady;
|
|
58
|
+
private onDispatch;
|
|
34
59
|
watch(onEvent: (event: InboxEvent) => void): () => void;
|
|
35
60
|
close(): void;
|
|
61
|
+
private archiveSupport;
|
|
36
62
|
conversations(): Promise<InboxConversation[]>;
|
|
63
|
+
private userConversations;
|
|
64
|
+
private recipients;
|
|
65
|
+
private describe;
|
|
37
66
|
messages(conversationId: string, query?: MessageQuery): Promise<InboxMessage[]>;
|
|
67
|
+
private toMessage;
|
|
38
68
|
send(conversationId: string, message: OutgoingMessage): Promise<SendOutcome>;
|
|
39
69
|
react(conversationId: string, messageId: string, reaction: string, remove?: boolean): Promise<void>;
|
|
40
70
|
markRead(conversationId: string): Promise<void>;
|
|
71
|
+
private channel;
|
|
41
72
|
archive(conversationId: string): Promise<ArchiveOutcome>;
|
|
42
73
|
unarchive(conversationId: string): Promise<void>;
|
|
43
74
|
avatar(ref: string): Promise<Response>;
|
|
@@ -9,8 +9,6 @@ export declare function unixMsToAppleDate(ms: number): number;
|
|
|
9
9
|
* "\uFFFC": not empty, and invisible. Shown as text it is an empty bubble.
|
|
10
10
|
*/
|
|
11
11
|
export declare function messageText(plain: string | null, attributedBody: Uint8Array | null): string | null;
|
|
12
|
-
/** A group's photo, which Messages records as an attachment guid in the chat's property list. */
|
|
13
|
-
declare function groupPhotoGuid(properties: Uint8Array | null): string | null;
|
|
14
12
|
/**
|
|
15
13
|
* `associated_message_guid` points at a part of a message, not the message:
|
|
16
14
|
* `p:0/<guid>` for the first part, `bp:<guid>` for a balloon. Reactions are
|
|
@@ -93,12 +91,19 @@ export declare class MessagesAccessError extends Error {
|
|
|
93
91
|
constructor(path: string, cause: unknown);
|
|
94
92
|
}
|
|
95
93
|
export declare class MessagesDb {
|
|
94
|
+
private db;
|
|
95
|
+
private messageColumns;
|
|
96
|
+
private hasRecoverable;
|
|
96
97
|
public readonly path: string;
|
|
97
98
|
constructor(path?: string);
|
|
99
|
+
private hasChatProperties;
|
|
98
100
|
attachmentFile(guid: string): string | null;
|
|
99
101
|
close(): void;
|
|
100
102
|
latestRowId(): number;
|
|
103
|
+
private column;
|
|
101
104
|
chats(): ChatRow[];
|
|
105
|
+
private participantsByChat;
|
|
102
106
|
messages(chatGuids: string[], options?: MessageQuery): MessageRow[];
|
|
103
107
|
attachmentPath(guid: string): { path: string | null, mimeType: string | null, name: string } | null;
|
|
108
|
+
private attachmentsFor;
|
|
104
109
|
}
|
|
@@ -24,8 +24,10 @@ export declare interface ContactCard {
|
|
|
24
24
|
photo?: { file: string, record: number } | null
|
|
25
25
|
}
|
|
26
26
|
export declare class Contacts {
|
|
27
|
+
private byHandle;
|
|
27
28
|
static load(root?: string): Contacts;
|
|
28
29
|
get size(): number;
|
|
30
|
+
private read;
|
|
29
31
|
set(handle: string, name: string): void;
|
|
30
32
|
lookup(handle: string): ContactCard | null;
|
|
31
33
|
nameFor(handle: string): string | null;
|
|
@@ -35,13 +35,31 @@ export declare interface IMessageConfig {
|
|
|
35
35
|
export declare class IMessageDriver implements InboxDriver {
|
|
36
36
|
readonly provider: 'imessage';
|
|
37
37
|
readonly label: string;
|
|
38
|
+
private databasePath;
|
|
39
|
+
private addressBookDir;
|
|
40
|
+
private openUrl;
|
|
41
|
+
private controller;
|
|
42
|
+
private confirmDeletes;
|
|
43
|
+
private platform;
|
|
44
|
+
private runScript;
|
|
45
|
+
private contacts;
|
|
46
|
+
private contactsLoadedAt;
|
|
38
47
|
constructor(config?: IMessageConfig);
|
|
39
48
|
capabilities(): InboxCapabilities;
|
|
40
49
|
send(conversationId: string, message: OutgoingMessage): Promise<SendOutcome>;
|
|
50
|
+
private rowNames;
|
|
51
|
+
private open;
|
|
52
|
+
private names;
|
|
53
|
+
private person;
|
|
41
54
|
avatar(ref: string): Promise<Response>;
|
|
55
|
+
private grouped;
|
|
56
|
+
private chats;
|
|
57
|
+
private find;
|
|
42
58
|
status(): Promise<InboxStatus>;
|
|
43
59
|
conversations(): Promise<InboxConversation[]>;
|
|
60
|
+
private toConversation;
|
|
44
61
|
messages(conversationId: string, query?: MessageQuery): Promise<InboxMessage[]>;
|
|
62
|
+
private toMessage;
|
|
45
63
|
archive(conversationId: string): Promise<ArchiveOutcome>;
|
|
46
64
|
unarchive(conversationId: string): Promise<void>;
|
|
47
65
|
attachment(attachment: InboxAttachment): Promise<Response>;
|
package/dist/inbox/slack.d.ts
CHANGED
|
@@ -24,16 +24,37 @@ export declare class SlackApiError extends Error {
|
|
|
24
24
|
export declare class SlackInboxDriver implements InboxDriver {
|
|
25
25
|
readonly provider: 'slack';
|
|
26
26
|
readonly label: string;
|
|
27
|
+
private token;
|
|
28
|
+
private fetch;
|
|
29
|
+
private apiBase;
|
|
30
|
+
private concurrency;
|
|
31
|
+
private appToken;
|
|
32
|
+
private Socket;
|
|
33
|
+
private self;
|
|
34
|
+
private users;
|
|
35
|
+
private avatars;
|
|
36
|
+
private channels;
|
|
27
37
|
constructor(config: SlackInboxConfig);
|
|
28
38
|
capabilities(): InboxCapabilities;
|
|
29
39
|
send(conversationId: string, message: OutgoingMessage): Promise<SendOutcome>;
|
|
40
|
+
private threadOf;
|
|
30
41
|
react(conversationId: string, messageId: string, reaction: string, remove?: boolean): Promise<void>;
|
|
31
42
|
markRead(conversationId: string): Promise<void>;
|
|
32
43
|
watch(onEvent: (event: InboxEvent) => void): () => void;
|
|
44
|
+
private onEnvelope;
|
|
45
|
+
private api;
|
|
46
|
+
private whoami;
|
|
47
|
+
private userName;
|
|
48
|
+
private person;
|
|
33
49
|
avatar(ref: string): Promise<Response>;
|
|
34
50
|
status(): Promise<InboxStatus>;
|
|
51
|
+
private archiveSupport;
|
|
52
|
+
private list;
|
|
35
53
|
conversations(): Promise<InboxConversation[]>;
|
|
54
|
+
private describe;
|
|
36
55
|
messages(conversationId: string, query?: MessageQuery): Promise<InboxMessage[]>;
|
|
56
|
+
private toMessage;
|
|
57
|
+
private channel;
|
|
37
58
|
archive(conversationId: string): Promise<ArchiveOutcome>;
|
|
38
59
|
unarchive(conversationId: string): Promise<void>;
|
|
39
60
|
attachment(attachment: InboxAttachment): Promise<Response>;
|
|
@@ -22,19 +22,19 @@ export declare const SESSION_GROUP: 1;
|
|
|
22
22
|
export declare const SESSION_COMMUNITY: 4;
|
|
23
23
|
/** `ZWAMESSAGE.ZMESSAGETYPE` values with a known meaning. */
|
|
24
24
|
export declare const MessageType: {
|
|
25
|
-
Text: 0;
|
|
26
|
-
Image: 1;
|
|
27
|
-
Video: 2;
|
|
28
|
-
Audio: 3;
|
|
29
|
-
Contact: 4;
|
|
30
|
-
Location: 5;
|
|
31
|
-
GroupEvent: 6;
|
|
32
|
-
Link: 7;
|
|
33
|
-
Document: 8;
|
|
34
|
-
Call: 10;
|
|
35
|
-
Gif: 11;
|
|
36
|
-
Deleted: 14;
|
|
37
|
-
Sticker: 15
|
|
25
|
+
readonly Text: 0;
|
|
26
|
+
readonly Image: 1;
|
|
27
|
+
readonly Video: 2;
|
|
28
|
+
readonly Audio: 3;
|
|
29
|
+
readonly Contact: 4;
|
|
30
|
+
readonly Location: 5;
|
|
31
|
+
readonly GroupEvent: 6;
|
|
32
|
+
readonly Link: 7;
|
|
33
|
+
readonly Document: 8;
|
|
34
|
+
readonly Call: 10;
|
|
35
|
+
readonly Gif: 11;
|
|
36
|
+
readonly Deleted: 14;
|
|
37
|
+
readonly Sticker: 15
|
|
38
38
|
};
|
|
39
39
|
export declare interface SessionRow {
|
|
40
40
|
pk: number
|
|
@@ -79,9 +79,13 @@ export declare class WhatsAppAccessError extends Error {
|
|
|
79
79
|
constructor(path: string, cause: unknown);
|
|
80
80
|
}
|
|
81
81
|
export declare class WhatsAppDb {
|
|
82
|
+
private db;
|
|
82
83
|
public readonly path: string;
|
|
83
84
|
constructor(path?: string);
|
|
84
85
|
close(): void;
|
|
86
|
+
private columns;
|
|
87
|
+
private hasMetadata;
|
|
88
|
+
private hasReceipts;
|
|
85
89
|
sessions(jid?: string): SessionRow[];
|
|
86
90
|
session(jid: string): SessionRow | undefined;
|
|
87
91
|
profilePicturePaths(): Map<string, string>;
|
|
@@ -33,11 +33,28 @@ export declare interface WhatsAppConfig {
|
|
|
33
33
|
export declare class WhatsAppDriver implements InboxDriver {
|
|
34
34
|
readonly provider: 'whatsapp';
|
|
35
35
|
readonly label: string;
|
|
36
|
+
private databasePath;
|
|
37
|
+
private mediaRoot;
|
|
38
|
+
private controller;
|
|
39
|
+
private openUrl;
|
|
40
|
+
private platform;
|
|
41
|
+
private settleMs;
|
|
36
42
|
constructor(config?: WhatsAppConfig);
|
|
43
|
+
private pictureFile;
|
|
44
|
+
private pictures;
|
|
37
45
|
avatar(ref: string): Promise<Response>;
|
|
46
|
+
private open;
|
|
38
47
|
status(): Promise<InboxStatus>;
|
|
48
|
+
private archiveSupport;
|
|
49
|
+
private url;
|
|
39
50
|
conversations(): Promise<InboxConversation[]>;
|
|
40
51
|
messages(conversationId: string, query?: MessageQuery): Promise<InboxMessage[]>;
|
|
52
|
+
private toMessage;
|
|
53
|
+
private reactions;
|
|
54
|
+
private describe;
|
|
55
|
+
private attachments;
|
|
56
|
+
private rowNames;
|
|
57
|
+
private settled;
|
|
41
58
|
archive(conversationId: string): Promise<ArchiveOutcome>;
|
|
42
59
|
unarchive(conversationId: string): Promise<void>;
|
|
43
60
|
attachment(attachment: InboxAttachment): Promise<Response>;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/chat",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.75.
|
|
5
|
+
"version": "0.75.522",
|
|
6
6
|
"description": "Easily interact with chat APIs.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"contributors": [
|
|
@@ -58,14 +58,14 @@
|
|
|
58
58
|
"prepublishOnly": "bun run build"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@stacksjs/orm": "0.75.
|
|
62
|
-
"@stacksjs/config": "0.75.
|
|
63
|
-
"@stacksjs/logging": "0.75.
|
|
61
|
+
"@stacksjs/orm": "0.75.522",
|
|
62
|
+
"@stacksjs/config": "0.75.522",
|
|
63
|
+
"@stacksjs/logging": "0.75.522"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@stacksjs/cli": "0.75.
|
|
67
|
-
"@stacksjs/error-handling": "0.75.
|
|
68
|
-
"@stacksjs/types": "0.75.
|
|
66
|
+
"@stacksjs/cli": "0.75.522",
|
|
67
|
+
"@stacksjs/error-handling": "0.75.522",
|
|
68
|
+
"@stacksjs/types": "0.75.522",
|
|
69
69
|
"better-dx": "^0.2.24"
|
|
70
70
|
}
|
|
71
71
|
}
|