Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
docs(wwebjs): fix misplaced and stale comments in the adapter
Yudhi Armyndharisbf7b9527d416
diff --git a/src/engine/adapters/whatsapp-web-js.adapter.ts b/src/engine/adapters/whatsapp-web-js.adapter.tsindex ae1e54593..2eae085b9 100644--- a/src/engine/adapters/whatsapp-web-js.adapter.ts+++ b/src/engine/adapters/whatsapp-web-js.adapter.ts@@ -493,15 +493,6 @@ export class WhatsAppWebJsAdapter extends EventEmitter implements IWhatsAppEnginclient.on('call', call => this.calls.handleIncomingCall(call));}- /**- * whatsapp-web.js exposes no way to observe another party's presence: WAWebPresenceChatAction- * offers only sendPresenceAvailable/sendPresenceUnavailable, which publish the ACCOUNT's own- * presence, and the library surfaces no presence event at all.- *- * Declared here inline rather than in a delegate on purpose. The parity gate reads method bodies- * off the prototype, so a throw hidden behind a delegate call is invisible to it and the- * `not-available` matrix row would go unverified; inline, the gate checks it.- */createChannel(name: string, description?: string): Promise<Channel> {return this.channels.createChannel(name, description);}@@ -530,9 +521,6 @@ export class WhatsAppWebJsAdapter extends EventEmitter implements IWhatsAppEngin* whatsapp-web.js 1.34.7 can read labels and assign them, but cannot create, rename, recolour or* delete one — `index.d.ts` exposes getLabels / getLabelById / getChatLabels / getChatsByLabelId /* addOrRemoveLabels and nothing that edits the label itself.- *- * Inline rather than delegated so the parity gate, which reads bodies off the prototype, can- * verify the matrix row (see docs/29).*/// eslint-disable-next-line @typescript-eslint/require-await, @typescript-eslint/no-unused-varsasync upsertLabel(_label: LabelInput): Promise<void> {@@ -544,6 +532,11 @@ export class WhatsAppWebJsAdapter extends EventEmitter implements IWhatsAppEnginthrow new EngineNotSupportedError('deleteLabel');}+ /**+ * whatsapp-web.js exposes no way to observe another party's presence: WAWebPresenceChatAction+ * offers only sendPresenceAvailable/sendPresenceUnavailable, which publish the ACCOUNT's own+ * presence, and the library surfaces no presence event at all.+ */// eslint-disable-next-line @typescript-eslint/require-await, @typescript-eslint/no-unused-varsasync subscribeToPresence(_chatId: string): Promise<void> {throw new EngineNotSupportedError('subscribeToPresence');@@ -735,7 +728,6 @@ export class WhatsAppWebJsAdapter extends EventEmitter implements IWhatsAppEnginreturn this.messaging.getChatHistory(chatId, limit, includeMedia, mediaMaxBytes, signal);}- // Delete MessagestarMessage(chatId: string, messageId: string, star: boolean): Promise<void> {return this.messaging.starMessage(chatId, messageId, star);}@@ -871,7 +863,6 @@ export class WhatsAppWebJsAdapter extends EventEmitter implements IWhatsAppEngin}// ========== Status/Stories (Phase 3) ==========- // Note: These are stub implementations - whatsapp-web.js has limited Status API supportgetContactStatuses(): Promise<Status[]> {return this.statuses.getContactStatuses();