@theotherwillembotha/node-red-whatsapp 0.3.0 → 0.4.0

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.
@@ -0,0 +1,7 @@
1
+ export * from "./whatsapp/service/WhatsappService";
2
+ export * from "./whatsapp/node/WhatsappAccountConfigNode";
3
+ export * from "./whatsapp/node/WhatsappGroupConfigNode";
4
+ export * from "./whatsapp/node/WhatsappSendMessageNode";
5
+ export * from "./whatsapp/node/WhatsappDynamicSendMessageNode";
6
+ export * from "./whatsapp/node/WhatsappReceiveMessageNode";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC;AACnD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4CAA4C,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { Node } from "node-red";
2
+ import { ConfigNode, ConfigNodeConfig } from "@theotherwillembotha/node-red-plugincore";
3
+ import { GroupClient, WhatsappSendMessageRequest } from "../service/WhatsappClient";
4
+ export interface WhatsappAccountConfigNodeConfig extends ConfigNodeConfig {
5
+ accountLinked: boolean;
6
+ localConnectionId: string;
7
+ }
8
+ export declare class WhatsappAccountConfigNode extends ConfigNode<WhatsappAccountConfigNodeConfig> {
9
+ private client;
10
+ constructor(node: Node, config: WhatsappAccountConfigNodeConfig);
11
+ getGroup(groupId: string): GroupClient | undefined;
12
+ sendMessage(chatId: string, message: WhatsappSendMessageRequest): Promise<void>;
13
+ }
14
+ //# sourceMappingURL=WhatsappAccountConfigNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WhatsappAccountConfigNode.d.ts","sourceRoot":"","sources":["../../../src/whatsapp/node/WhatsappAccountConfigNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAkC,MAAM,0CAA0C,CAAC;AAExH,OAAO,EAAE,WAAW,EAAkB,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAGpG,MAAM,WAAW,+BAAgC,SAAQ,gBAAgB;IACrE,aAAa,EAAC,OAAO,CAAC;IACtB,iBAAiB,EAAC,MAAM,CAAC;CAC5B;AAED,qBAQa,yBAA0B,SAAQ,UAAU,CAAC,+BAA+B,CAAC;IACtF,OAAO,CAAC,MAAM,CAAiB;IAE/B,YAAY,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,+BAA+B,EAK9D;IAEM,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAGxD;IAEY,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,IAAI,CAAC,CAG3F;CACJ"}
@@ -0,0 +1,19 @@
1
+ import { Node } from "node-red";
2
+ import { BaseNode, BaseNodeConfig, Message } from "@theotherwillembotha/node-red-plugincore";
3
+ import { MetricsTemplateConfig } from "@theotherwillembotha/node-red-plugincore";
4
+ import { LoggerTemplateConfig } from "@theotherwillembotha/node-red-plugincore";
5
+ export interface WhatsappDynamicSendMessageNodeConfig extends BaseNodeConfig, MetricsTemplateConfig, LoggerTemplateConfig {
6
+ accountConfig: string;
7
+ recipient: string;
8
+ recipientType: string;
9
+ payloads: string;
10
+ }
11
+ export declare class WhatsappDynamicSendMessageNode extends BaseNode<WhatsappDynamicSendMessageNodeConfig> {
12
+ private log;
13
+ private counter;
14
+ private accountNode;
15
+ constructor(node: Node, config: WhatsappDynamicSendMessageNodeConfig);
16
+ private resolveField;
17
+ protected onMessageReceived(message: Message): Promise<void>;
18
+ }
19
+ //# sourceMappingURL=WhatsappDynamicSendMessageNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WhatsappDynamicSendMessageNode.d.ts","sourceRoot":"","sources":["../../../src/whatsapp/node/WhatsappDynamicSendMessageNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,OAAO,EAAwD,MAAM,0CAA0C,CAAC;AACnJ,OAAO,EAAuD,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACtI,OAAO,EAA+B,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAe7G,MAAM,WAAW,oCAAqC,SAAQ,cAAc,EAAE,qBAAqB,EAAE,oBAAoB;IACrH,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,qBAYa,8BAA+B,SAAQ,QAAQ,CAAC,oCAAoC,CAAC;IAG9F,OAAO,CAAC,GAAG,CAAO;IAGlB,OAAO,CAAC,OAAO,CAAiB;IAEhC,OAAO,CAAC,WAAW,CAA4B;IAE/C,YAAY,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,oCAAoC,EAGnE;IAED,OAAO,CAAC,YAAY;IAUpB,UACgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CA8CjE;CACJ"}
@@ -0,0 +1,16 @@
1
+ import { Node } from "node-red";
2
+ import { ConfigNode, ConfigNodeConfig } from "@theotherwillembotha/node-red-plugincore";
3
+ import { Subscription, WhatsappSendMessageRequest } from "../service/WhatsappClient";
4
+ export interface WhatsappGroupConfigNodeConfig extends ConfigNodeConfig {
5
+ accountConfig: string;
6
+ groupId: string;
7
+ }
8
+ export declare class WhatsappGroupConfigNode extends ConfigNode<WhatsappGroupConfigNodeConfig> {
9
+ private accountconfigNode;
10
+ constructor(node: Node, config: WhatsappGroupConfigNodeConfig);
11
+ private getGroup;
12
+ send(message: WhatsappSendMessageRequest): void;
13
+ subscribe(subscription: Subscription): Subscription;
14
+ unsubscribe(subscription: Subscription): void;
15
+ }
16
+ //# sourceMappingURL=WhatsappGroupConfigNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WhatsappGroupConfigNode.d.ts","sourceRoot":"","sources":["../../../src/whatsapp/node/WhatsappGroupConfigNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAA+C,MAAM,0CAA0C,CAAC;AAErI,OAAO,EAAe,YAAY,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAGlG,MAAM,WAAW,6BAA8B,SAAQ,gBAAgB;IACnE,aAAa,EAAC,MAAM,CAAA;IACpB,OAAO,EAAC,MAAM,CAAA;CACjB;AAED,qBAQa,uBAAwB,SAAQ,UAAU,CAAC,6BAA6B,CAAC;IAClF,OAAO,CAAC,iBAAiB,CAA4B;IAErD,YAAmB,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,6BAA6B,EAGnE;IAED,OAAO,CAAC,QAAQ;IAIT,IAAI,CAAC,OAAO,EAAE,0BAA0B,QAM9C;IAEM,SAAS,CAAC,YAAY,EAAC,YAAY,GAAE,YAAY,CAOvD;IAEM,WAAW,CAAC,YAAY,EAAC,YAAY,GAAG,IAAI,CAKlD;CACJ"}
@@ -0,0 +1,20 @@
1
+ import { Node } from "node-red";
2
+ import { BaseNode, BaseNodeConfig } from "@theotherwillembotha/node-red-plugincore";
3
+ import { MetricsTemplateConfig } from "@theotherwillembotha/node-red-plugincore";
4
+ import { LoggerTemplateConfig } from "@theotherwillembotha/node-red-plugincore";
5
+ export interface WhatsappReceiveMessageNodeConfig extends BaseNodeConfig, MetricsTemplateConfig, LoggerTemplateConfig {
6
+ groupConfig: string;
7
+ eventOutputKey: string;
8
+ eventOutputType: string;
9
+ acceptOwnMessages: boolean;
10
+ accepts: string;
11
+ }
12
+ export declare class WhatsappReceiveMessageNode extends BaseNode<WhatsappReceiveMessageNodeConfig> {
13
+ private log;
14
+ private counter;
15
+ private groupNode;
16
+ private subscription;
17
+ constructor(node: Node, config: WhatsappReceiveMessageNodeConfig);
18
+ private setPath;
19
+ }
20
+ //# sourceMappingURL=WhatsappReceiveMessageNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WhatsappReceiveMessageNode.d.ts","sourceRoot":"","sources":["../../../src/whatsapp/node/WhatsappReceiveMessageNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,cAAc,EAA+C,MAAM,0CAA0C,CAAC;AACjI,OAAO,EAAuD,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACtI,OAAO,EAA+B,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAS7G,MAAM,WAAW,gCAAiC,SAAQ,cAAc,EAAE,qBAAqB,EAAE,oBAAoB;IACjH,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,qBAYa,0BAA2B,SAAQ,QAAQ,CAAC,gCAAgC,CAAC;IAGtF,OAAO,CAAC,GAAG,CAAM;IAGjB,OAAO,CAAC,OAAO,CAAgB;IAE/B,OAAO,CAAC,SAAS,CAA0B;IAC3C,OAAO,CAAC,YAAY,CAAe;IAEnC,YAAY,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,gCAAgC,EA4B/D;IAED,OAAO,CAAC,OAAO;CAWlB"}
@@ -0,0 +1,17 @@
1
+ import { Node } from "node-red";
2
+ import { BaseNode, BaseNodeConfig, Message } from "@theotherwillembotha/node-red-plugincore";
3
+ import { MetricsTemplateConfig } from "@theotherwillembotha/node-red-plugincore";
4
+ import { LoggerTemplateConfig } from "@theotherwillembotha/node-red-plugincore";
5
+ export interface WhatsappSendMessageNodeConfig extends BaseNodeConfig, MetricsTemplateConfig, LoggerTemplateConfig {
6
+ groupConfig: string;
7
+ payloads: string;
8
+ }
9
+ export declare class WhatsappSendMessageNode extends BaseNode<WhatsappSendMessageNodeConfig> {
10
+ private log;
11
+ private counter;
12
+ private groupNode;
13
+ constructor(node: Node, config: WhatsappSendMessageNodeConfig);
14
+ private resolveField;
15
+ protected onMessageReceived(message: Message): void;
16
+ }
17
+ //# sourceMappingURL=WhatsappSendMessageNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WhatsappSendMessageNode.d.ts","sourceRoot":"","sources":["../../../src/whatsapp/node/WhatsappSendMessageNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,OAAO,EAAwD,MAAM,0CAA0C,CAAC;AACnJ,OAAO,EAAuD,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACtI,OAAO,EAA+B,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAe7G,MAAM,WAAW,6BAA8B,SAAQ,cAAc,EAAE,qBAAqB,EAAE,oBAAoB;IAC9G,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,qBAYa,uBAAwB,SAAQ,QAAQ,CAAC,6BAA6B,CAAC;IAGhF,OAAO,CAAC,GAAG,CAAO;IAGlB,OAAO,CAAC,OAAO,CAAiB;IAEhC,OAAO,CAAC,SAAS,CAA0B;IAE3C,YAAY,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,6BAA6B,EAG5D;IAED,OAAO,CAAC,YAAY;IAWpB,SAAS,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAkDlD;CACJ"}
@@ -0,0 +1,189 @@
1
+ import { AuthenticationState, WASocket } from 'baileys';
2
+ import { MessageType, Role, WhatsappStore } from './WhatsappStore';
3
+ export interface WAClientConfig {
4
+ localConnectionId: string;
5
+ fileStorageRoot: string;
6
+ }
7
+ export interface WAClientDetails {
8
+ userID: string;
9
+ msisdn: string;
10
+ name?: string;
11
+ }
12
+ export interface GroupMessage {
13
+ groupId: string;
14
+ replyTo?: string;
15
+ }
16
+ export interface PendingAlbum {
17
+ chatId: string;
18
+ albumMessageId: string;
19
+ expectedImages: number;
20
+ expectedVideos: number;
21
+ receivedImages: number;
22
+ receivedVideos: number;
23
+ createdAt: number;
24
+ mediaIds: string[];
25
+ }
26
+ export declare const ALBUM_TIMEOUT_MS: number;
27
+ export interface GroupTextMessage extends GroupMessage {
28
+ text: string;
29
+ }
30
+ export interface GroupImageMessage extends GroupMessage {
31
+ image: Buffer;
32
+ }
33
+ export interface GoupMessageResult {
34
+ messageId: string;
35
+ }
36
+ export interface WhatsappTextMessage extends WhatsappMessage {
37
+ text: string;
38
+ }
39
+ export interface WhatsappImageMessage extends WhatsappMessage {
40
+ image: Buffer;
41
+ }
42
+ export interface WhatsappMessage {
43
+ timestamp: number;
44
+ messageId: string;
45
+ chat: {
46
+ id: string;
47
+ name: string;
48
+ };
49
+ sender: {
50
+ id: string;
51
+ name: string;
52
+ me: boolean;
53
+ };
54
+ type: MessageType;
55
+ payload: object;
56
+ }
57
+ export interface WhatsappSendMessageRequest {
58
+ text?: any;
59
+ image?: any;
60
+ video?: any;
61
+ document?: any;
62
+ documentName?: string;
63
+ documentMimetype?: string;
64
+ replyTo?: any;
65
+ }
66
+ export interface WhatsappSendMessageResponse {
67
+ messageId: string;
68
+ }
69
+ export interface WhatsappSubscribeFilter {
70
+ types?: MessageType[];
71
+ groupId?: string;
72
+ }
73
+ export declare class WhatsappClient {
74
+ private currentQRCode;
75
+ private onQRCodeListeners;
76
+ private onConnectionSuccessListeners;
77
+ private config;
78
+ private socket;
79
+ private store;
80
+ private state;
81
+ private messageSubscribers;
82
+ private subscriberKeys;
83
+ private logger;
84
+ private saveCreds;
85
+ private groupClients;
86
+ private pendingAlbums;
87
+ private albumCleanupTimer?;
88
+ private reconnectTimer?;
89
+ private _groupService;
90
+ constructor(config: WAClientConfig);
91
+ clientConfig(): WAClientConfig;
92
+ details(): WAClientDetails | null;
93
+ onQRCode(listener: (qrcode: string) => void): void;
94
+ groups(): GroupService;
95
+ getGroupClient(groupId: string): GroupClient;
96
+ subscribe(listener: (message: WhatsappMessage) => void, filter?: WhatsappSubscribeFilter): string;
97
+ unsubscribe(subscriber: Subscription): void;
98
+ private subscribers;
99
+ sendMessage(chatId: string, message: WhatsappSendMessageRequest): Promise<WhatsappSendMessageResponse>;
100
+ onConnectionSuccess(listener: () => void): void;
101
+ start(): Promise<void>;
102
+ private messages_upsert;
103
+ private messages_update;
104
+ private groups_upsert;
105
+ private group_participants_update;
106
+ private group_member_tag_update;
107
+ private connection_update;
108
+ private scheduleReconnect;
109
+ /**
110
+ * Normalises a JID for outbound sending:
111
+ * - @lid → resolves to phone-number JID via the contact store
112
+ * - contains "@" → assumed to be a fully-qualified JID; passed through unchanged
113
+ * - otherwise → treated as a bare phone number; non-digits are stripped and
114
+ * "@s.whatsapp.net" is appended (works for arbitrary contacts too)
115
+ */
116
+ resolveJid(jid: string): Promise<string>;
117
+ stop(): Promise<void>;
118
+ private cleanupTimedOutAlbums;
119
+ private contacts_received;
120
+ private contacts_updated;
121
+ private messaging_history;
122
+ private chats_receieved;
123
+ private message_received;
124
+ /**
125
+ * Lookup or create the sender contact from a message.
126
+ * For received messages, uses lid-based lookup first (if addressingMode is "lid"),
127
+ * then falls back to id-based lookup.
128
+ * Creates a new contact if not found, and back-populates the name from pushName if missing.
129
+ */
130
+ private lookupOrCreateSender;
131
+ private doNothing;
132
+ }
133
+ declare class GroupService {
134
+ private store;
135
+ private socket;
136
+ private state;
137
+ constructor(socket: WASocket, store: WhatsappStore, state: AuthenticationState);
138
+ getAll(): Promise<Group[]>;
139
+ createGroup(subject: string): Promise<Group>;
140
+ /**
141
+ * Add a user as a participant to a group.
142
+ * @param userId the Id of the user. should be in the phonenumber format: <phone>@s.whatsapp.net
143
+ * @param groupId the groupId. it is expectedd that the group is known and can be added to at this point.
144
+ * @param role the role that the user should be assigned.
145
+ * @returns nothing.
146
+ */
147
+ addUserToGroup(userId: string, groupId: string, role: Role): Promise<void>;
148
+ /**
149
+ * Update a user's role in a group.
150
+ * @param userId the Id of the user. should be in the phonenumber format: <phone>@s.whatsapp.net
151
+ * @param groupId the groupId.
152
+ * @param role the new role for the user.
153
+ */
154
+ updateUserRole(userId: string, groupId: string, role: Role): Promise<void>;
155
+ /**
156
+ * Remove a user from a group.
157
+ * @param userId the Id of the user. should be in the phonenumber format: <phone>@s.whatsapp.net
158
+ * @param groupId the groupId. it is expectedd that the group is known and can be added to at this point.
159
+ * @returns nothing
160
+ */
161
+ removeUserFromGroup(userId: string, groupId: string): Promise<void>;
162
+ }
163
+ export declare class GroupClient {
164
+ private _client;
165
+ private _id;
166
+ constructor(client: WhatsappClient, id: string);
167
+ id(): string;
168
+ subscribe(subscription: Subscription): void;
169
+ unsubscribe(subscription: Subscription): void;
170
+ sendMessage(message: WhatsappSendMessageRequest): void;
171
+ }
172
+ export type Group = {
173
+ id: string;
174
+ subject: string;
175
+ participants: {
176
+ id: string;
177
+ name?: string;
178
+ role: Role;
179
+ label?: string;
180
+ isMe?: boolean;
181
+ }[];
182
+ };
183
+ export declare enum ChatType {
184
+ Group = "Group",
185
+ Conversation = "Conversation"
186
+ }
187
+ export type Subscription = (message: WhatsappMessage) => void;
188
+ export {};
189
+ //# sourceMappingURL=WhatsappClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WhatsappClient.d.ts","sourceRoot":"","sources":["../../../src/whatsapp/service/WhatsappClient.ts"],"names":[],"mappings":"AACA,OAAqB,EACjB,mBAAmB,EAInB,QAAQ,EAIX,MAAM,SAAS,CAAA;AAShB,OAAO,EAA2C,WAAW,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,iBAAiB,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tD;IAED;;;;;;OAMG;IACU,cAAc,CAAC,MAAM,EAAC,MAAM,EAAE,OAAO,EAAC,MAAM,EAAE,IAAI,EAAC,IAAI,GAAE,OAAO,CAAC,IAAI,CAAC,CAalF;IAED;;;;;OAKG;IACU,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAOtF;IAED;;;;;OAKG;IACU,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,iBAQ/D;CACJ;AAiBD,qBAAa,WAAW;IAEpB,OAAO,CAAC,OAAO,CAAiB;IAChC,OAAO,CAAC,GAAG,CAAS;IAEpB,YAAmB,MAAM,EAAC,cAAc,EAAE,EAAE,EAAC,MAAM,EAGlD;IAEM,EAAE,WAER;IAEM,SAAS,CAAC,YAAY,EAAE,YAAY,QAE1C;IAEM,WAAW,CAAC,YAAY,EAAE,YAAY,QAE5C;IAEM,WAAW,CAAC,OAAO,EAAE,0BAA0B,QAErD;CACJ;AAED,MAAM,MAAM,KAAK,GAAG;IAChB,EAAE,EAAC,MAAM,CAAC;IACV,OAAO,EAAC,MAAM,CAAC;IACf,YAAY,EAAC;QACT,EAAE,EAAC,MAAM,CAAA;QACT,IAAI,CAAC,EAAC,MAAM,CAAA;QACZ,IAAI,EAAE,IAAI,CAAA;QACV,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,IAAI,CAAC,EAAE,OAAO,CAAA;KACjB,EAAE,CAAC;CACP,CAAA;AAED,oBAAY,QAAQ;IAChB,KAAK,UAAU;IACf,YAAY,iBAAiB;CAChC;AAED,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { BaseService } from "@theotherwillembotha/node-red-plugincore";
2
+ import { NodeAPI, NodeAPISettingsWithData } from "node-red";
3
+ import { WhatsappClient } from "./WhatsappClient";
4
+ export declare class WhatsappService extends BaseService {
5
+ private red;
6
+ private configDir;
7
+ private configFile;
8
+ private connections;
9
+ private tempClients;
10
+ private static readonly _CLIENTS_KEY;
11
+ private static clients;
12
+ constructor();
13
+ init(red: NodeAPI<NodeAPISettingsWithData>): Promise<void>;
14
+ private saveConnectionDetails;
15
+ private getAccounts;
16
+ deinit(red: NodeAPI<NodeAPISettingsWithData>): Promise<void> | void;
17
+ static getClient(localConnectionId: string): WhatsappClient;
18
+ private linkAccount;
19
+ private unlinkaccount;
20
+ private getGroups;
21
+ private createGroup;
22
+ private groupAddUser;
23
+ private groupUpdateUser;
24
+ private groupRemoveUser;
25
+ }
26
+ //# sourceMappingURL=WhatsappService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WhatsappService.d.ts","sourceRoot":"","sources":["../../../src/whatsapp/service/WhatsappService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAsB,MAAM,0CAA0C,CAAA;AAC1F,OAAO,EAAE,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAMlD,qBAMa,eAAgB,SAAQ,WAAW;IAE5C,OAAO,CAAC,GAAG,CAAoC;IAC/C,OAAO,CAAC,SAAS,CAAU;IAC3B,OAAO,CAAC,UAAU,CAAU;IAC5B,OAAO,CAAC,WAAW,CAAmB;IACtC,OAAO,CAAC,WAAW,CAAoC;IAIvD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAA4B;IAChE,OAAO,CAAC,MAAM,CAAC,OAAO;IAQtB,cAEC;IAEY,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,uBAAuB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAqDtE;IAED,OAAO,CAAC,qBAAqB;IAiB7B,OAAO,CAAC,WAAW;IAoBZ,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,uBAAuB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAEzE;IAED,OAAc,SAAS,CAAC,iBAAiB,EAAE,MAAM,GAAG,cAAc,CAEjE;IAED,OAAO,CAAC,WAAW;IA6EnB,OAAO,CAAC,aAAa;YAwBP,SAAS;YAUT,WAAW;YAUX,YAAY;YAWZ,eAAe;YAWf,eAAe;CAWhC"}
@@ -0,0 +1,127 @@
1
+ import { EntityManager } from "typeorm";
2
+ import { ChatType } from "./WhatsappClient";
3
+ export declare class WhatsappStore implements DAOService {
4
+ static createStore(id: string, location: string): Promise<WhatsappStore>;
5
+ private _id;
6
+ private _location;
7
+ private _datasource;
8
+ private _contacts;
9
+ private _chats;
10
+ private _messages;
11
+ private constructor();
12
+ chats(): ChatDAO;
13
+ contacts(): ContactDAO;
14
+ messages(): MessageDAO;
15
+ }
16
+ interface DAOService {
17
+ chats(): ChatDAO;
18
+ contacts(): ContactDAO;
19
+ messages(): MessageDAO;
20
+ }
21
+ declare abstract class DAO<EntityType> {
22
+ private _daos;
23
+ private _em;
24
+ constructor(daos: DAOService, em: EntityManager);
25
+ protected daos(): DAOService;
26
+ protected em(): EntityManager;
27
+ abstract get(id: string): Promise<EntityType | null>;
28
+ abstract all(): Promise<EntityType[]>;
29
+ abstract create(...params: any): Promise<EntityType>;
30
+ }
31
+ declare enum ContactType {
32
+ USER = "USER",
33
+ GROUP = "GROUP"
34
+ }
35
+ declare class Contact {
36
+ /**
37
+ * Account ID of the whatsapp user eg: "<phone>@s.whatsapp.net"
38
+ */
39
+ id: string;
40
+ type?: ContactType;
41
+ phoneNumber?: string;
42
+ name?: string;
43
+ lid?: string;
44
+ participants: Participant[];
45
+ constructor(id: string);
46
+ getName(): string | undefined;
47
+ }
48
+ declare class ContactDAO extends DAO<Contact> {
49
+ constructor(daos: DAOService, em: EntityManager);
50
+ get(id: string): Promise<Contact>;
51
+ all(): Promise<Contact[]>;
52
+ create(id: string): Promise<Contact>;
53
+ save(contact: Contact): Promise<Contact>;
54
+ getByLid(lid: string): Promise<Contact | null>;
55
+ }
56
+ export declare enum Role {
57
+ Admin = "Admin",
58
+ SuperAdmin = "SuperAdmin",
59
+ Member = "Member"
60
+ }
61
+ declare class Chat {
62
+ id: string;
63
+ type: string;
64
+ lid: string;
65
+ owner: string;
66
+ name: string;
67
+ description: string;
68
+ participants: Participant[];
69
+ messages: Message[];
70
+ constructor(id: string, lid: string, type: ChatType, owner: string, name: string, description: string);
71
+ addParticipant(contact: Contact, role: Role): Chat;
72
+ }
73
+ declare class ChatDAO extends DAO<Chat> {
74
+ constructor(daos: DAOService, em: EntityManager);
75
+ get(id: string): Promise<Chat | null>;
76
+ all(): Promise<Chat[]>;
77
+ create(id: string, lid: string, type: ChatType, owner: string, name: string, description: string): Promise<Chat>;
78
+ getWithParticipants(id: string): Promise<Chat | null>;
79
+ getGroups(): Promise<Chat[]>;
80
+ save(chat: Chat): Promise<Chat>;
81
+ delete(chatId: string): Promise<void>;
82
+ removeParticipants(chatId: string, contactIds: string[]): Promise<void>;
83
+ updateParticipantRole(chatId: string, contactId: string, role: Role): Promise<void>;
84
+ updateParticipantLabel(chatId: string, contactId: string, label: string): Promise<void>;
85
+ }
86
+ declare class Participant {
87
+ id: string;
88
+ chat: Chat;
89
+ contact: Contact;
90
+ role: Role;
91
+ label: string | undefined;
92
+ constructor(chat: Chat, contact: Contact, role: Role);
93
+ }
94
+ declare class Message {
95
+ id: string;
96
+ chat: Chat;
97
+ timestamp: number;
98
+ type: MessageType;
99
+ payload: string;
100
+ constructor(id: string, chat: Chat, timestamp: number, type: MessageType, payload: string);
101
+ }
102
+ declare class MessageDAO extends DAO<Message> {
103
+ constructor(daos: DAOService, em: EntityManager);
104
+ get(id: string): Promise<Message | null>;
105
+ all(): Promise<Message[]>;
106
+ create(chat: Chat, id: string, timestamp: number, type: MessageType, payload: string): Promise<Message>;
107
+ }
108
+ export declare enum MessageType {
109
+ Text = "Text",
110
+ Unknown = "Unknown",
111
+ Image = "Image",
112
+ Video = "Video",
113
+ Document = "Document",
114
+ Template = "Template",
115
+ ExtendedText = "ExtendedText",
116
+ Album = "Album",
117
+ Stub = "Stub",
118
+ Contact = "Contact",
119
+ Interactive = "Interactive",
120
+ Location = "Location",
121
+ LiveLocation = "LiveLocation",
122
+ Event = "Event",
123
+ EventResponse = "EventResponse",
124
+ Sticker = "Sticker"
125
+ }
126
+ export { Contact, Chat, Message };
127
+ //# sourceMappingURL=WhatsappStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WhatsappStore.d.ts","sourceRoot":"","sources":["../../../src/whatsapp/service/WhatsappStore.ts"],"names":[],"mappings":"AACA,OAAO,EAA8B,aAAa,EAAsF,MAAM,SAAS,CAAC;AACxJ,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,qBAAa,aAAc,YAAW,UAAU;IAE5C,OAAoB,WAAW,CAAC,EAAE,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAM,GAAE,OAAO,CAAC,aAAa,CAAC,CAajF;IAED,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,WAAW,CAAa;IAEhC,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,MAAM,CAAU;IACxB,OAAO,CAAC,SAAS,CAAa;IAE9B,OAAO,eAaN;IAEM,KAAK,IAAG,OAAO,CAErB;IAEM,QAAQ,IAAG,UAAU,CAE3B;IAEM,QAAQ,IAAG,UAAU,CAE3B;CACJ;AAED,UAAU,UAAU;IAChB,KAAK,IAAG,OAAO,CAAC;IAChB,QAAQ,IAAG,UAAU,CAAC;IACtB,QAAQ,IAAG,UAAU,CAAC;CACzB;AAED,uBAAe,GAAG,CAAC,UAAU;IAEzB,OAAO,CAAC,KAAK,CAAa;IAC1B,OAAO,CAAC,GAAG,CAAgB;IAE3B,YAAY,IAAI,EAAC,UAAU,EAAE,EAAE,EAAC,aAAa,EAG5C;IAED,SAAS,CAAC,IAAI,eAEb;IAED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AAC,IAAI,EAAC,IAAI,EAAE,EAAE,EAAC,MAAM,EAAE,SAAS,EAAC,MAAM,EAAE,IAAI,EAAC,WAAW,EAAE,OAAO,EAAC,MAAM,GAAE,OAAO,CAAC,OAAO,CAAC,CAyBtG;CACJ;AAED,oBAAY,WAAW;IACnB,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,YAAY,iBAAiB;IAC7B,KAAK,UAAU;IACf,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,WAAW,gBAAgB;IAC3B,QAAQ,aAAa;IACrB,YAAY,iBAAiB;IAC7B,KAAK,UAAU;IACf,aAAa,kBAAkB;IAC/B,OAAO,YAAY;CACtB;AAGD,OAAO,EACH,OAAO,EAAE,IAAI,EAAE,OAAO,EACzB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theotherwillembotha/node-red-whatsapp",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Node-RED nodes for WhatsApp messaging via the Baileys library.",
5
5
  "author": "Willem Botha (@theotherwillembotha)",
6
6
  "license": "ISC",
@@ -13,6 +13,7 @@
13
13
  ],
14
14
  "main": "./build/index.js",
15
15
  "exports": "./build/index.js",
16
+ "types": "./build/index.d.ts",
16
17
  "scripts": {
17
18
  "test": "echo \"Error: no test specified\" && exit 1",
18
19
  "build": "npm run clean && tsc && npm run generate-nodes && npm run bundle && npm run copy-files",
@@ -44,7 +45,7 @@
44
45
  "nodered": ">=4.0.0"
45
46
  },
46
47
  "dependencies": {
47
- "@theotherwillembotha/node-red-plugincore": "^0.3.0",
48
+ "@theotherwillembotha/node-red-plugincore": "^0.4.2",
48
49
  "baileys": "7.0.0-rc14",
49
50
  "handlebars": "^4.7.9",
50
51
  "node-cache": "^5.1.2",