Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

chore(engine): guard the upstream capability surface against unreviewed drift

Yudhi Armyndharisc3f527c42b38
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 66bd32c00..360c24bcf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **Blocklist read: `GET /sessions/:sessionId/contacts/blocked`** — the missing read half of the block/unblock endpoints, as a bare array of neutral contact ids on both engines; on Baileys an unanswered query is a `503`, never an empty list.
+- **Upstream capability-surface drift guard** — `scripts/check-upstream-surface.mjs` (in `test:scripts`) diffs the installed engines' Client/socket methods and event maps against a reviewed snapshot, so an engine bump that ships new capabilities fails CI until the delta is reviewed instead of sitting unnoticed.
+
- **The media download route now serves media sent by the account** — `GET /messages/:chatId/:messageId/media` falls back to the inline copy stored on the message row when no archived file exists, which covers outbound messages (never archived) and inbound messages whose archived file retention has purged.
### Changed
diff --git a/docs/29-engine-capability-matrix.md b/docs/29-engine-capability-matrix.md
index ff63cfc99..8555d5ac8 100644
--- a/docs/29-engine-capability-matrix.md
+++ b/docs/29-engine-capability-matrix.md
@@ -18,6 +18,8 @@ The `rootCause`/`evidence` fields are hand-curated from source traces of the ins
> **Phantom support.** The drift gate's throw-heuristic cannot see adapter methods that silently stub (return `null`/`[]` + a warn log) without throwing. The wwjs catalog reads — `getCatalog`, `getProducts`, `getProduct` — used to be the live example (marked `not-available` here while their adapter bodies did not throw); the stubs have since been replaced with explicit `EngineNotSupportedError` 501s, so the throw-scan now covers them like every other unavailable row. Any future `not-available` row that must stay non-throwing cannot be verified by the gate — keep it hand-tracked in the matrix (or make the adapter throw).
+**Upstream surface drift** is guarded from the other direction by `scripts/check-upstream-surface.mjs` (wired into `npm run test:scripts`): it extracts the installed engines' public capability surface — whatsapp-web.js `Client` methods + `Events` values, Baileys socket methods + `BaileysEventMap` events — and compares it against the committed, reviewed snapshot (`scripts/upstream-surface.snapshot.json`). An engine bump that introduces new symbols fails the check until each one is reviewed (expose / defer / record the exclusion) and the snapshot is refreshed with `node scripts/check-upstream-surface.mjs --update`. This closes the blindspot where a capability both engines already supported sat unreviewed until a user asked for it.
+
---
## Unwired-capability inventory
diff --git a/package.json b/package.json
index 0c2f4874e..662770fe6 100644
--- a/package.json
+++ b/package.json
@@ -35,7 +35,7 @@
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\"",
"lint:fix": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
- "test:scripts": "node --test scripts/postinstall.spec.js scripts/patch-wwebjs-newsletter-preview.spec.js scripts/patch-wwebjs-status.spec.js scripts/patch-wwebjs-ready-sync.spec.js scripts/patch-baileys-appstate.spec.js scripts/dockerfile-patchers.spec.js",
+ "test:scripts": "node --test scripts/postinstall.spec.js scripts/patch-wwebjs-newsletter-preview.spec.js scripts/patch-wwebjs-status.spec.js scripts/patch-wwebjs-ready-sync.spec.js scripts/patch-baileys-appstate.spec.js scripts/dockerfile-patchers.spec.js scripts/check-upstream-surface.spec.mjs",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
diff --git a/scripts/check-upstream-surface.mjs b/scripts/check-upstream-surface.mjs
new file mode 100644
index 000000000..fc2eb35b6
--- /dev/null
+++ b/scripts/check-upstream-surface.mjs
@@ -0,0 +1,151 @@
+#!/usr/bin/env node
+/**
+ * Upstream capability-surface drift guard.
+ *
+ * Extracts the public capability surface of the two installed engines — whatsapp-web.js (Client
+ * methods + Events values) and Baileys (Socket methods + BaileysEventMap events) — and compares it
+ * against the committed snapshot (upstream-surface.snapshot.json). Any ADDED symbol is a capability
+ * the gateway has never reviewed (the #1164 class of blindspot: group membership requests sat in
+ * both engines, unreviewed, until a user asked); any REMOVED symbol is a capability an exposed
+ * feature may silently depend on. Either fails `npm run test:scripts` until a maintainer reviews
+ * the delta (classify it: expose / defer / exclude — the docs/29 + gap-matrix procedure) and
+ * refreshes the snapshot with `node scripts/check-upstream-surface.mjs --update`.
+ *
+ * The extractors need not be perfect parsers: they only have to be DETERMINISTIC, because the check
+ * compares this extractor's output today against the same extractor's committed output. A symbol
+ * the regex cannot see today stays unseen on both sides; the moment an upstream bump makes it
+ * visible, it shows up as an addition and gets its review.
+ *
+ * Same pattern as dockerfile-patchers.spec.js: a derived check over a surface that is otherwise
+ * maintained by hand and forgotten by accident.
+ */
+import { readFileSync, writeFileSync, readdirSync } from 'node:fs';
+import { fileURLToPath } from 'node:url';
+import path from 'node:path';
+
+const ROOT = path.join(path.dirname(fileURLToPath(import.meta.url)), '..');
+const SNAPSHOT_PATH = path.join(ROOT, 'scripts', 'upstream-surface.snapshot.json');
+
+/** Method names of the `Client` class block of whatsapp-web.js's index.d.ts. */
+export function extractWwebjsClientMethods(dts) {
+ const start = dts.indexOf('export class Client');
+ if (start === -1) throw new Error('whatsapp-web.js index.d.ts: Client class not found');
+ // The class body ends at the first closing brace back at 4-space indent.
+ const end = dts.indexOf('\n }', start);
+ const block = dts.slice(start, end === -1 ? undefined : end);
+ const names = new Set();
+ for (const m of block.matchAll(/^ {8}(\w+)\(/gm)) names.add(m[1]);
+ return [...names].sort();
+}
+
+/** Event VALUES of the Events constant in whatsapp-web.js's src/util/Constants.js. */
+export function extractWwebjsEvents(constantsJs) {
+ const start = constantsJs.indexOf('Events = {');
+ if (start === -1) throw new Error('whatsapp-web.js Constants.js: Events block not found');
+ const end = constantsJs.indexOf('};', start);
+ const block = constantsJs.slice(start, end);
+ const names = new Set();
+ for (const m of block.matchAll(/^\s*[A-Z_0-9]+:\s*'([^']+)'/gm)) names.add(m[1]);
+ return [...names].sort();
+}
+
+/** Socket method names across all of Baileys' lib/Socket/*.d.ts layer files. */
+export function extractBaileysSocketMethods(dtsByFile) {
+ const names = new Set();
+ for (const dts of dtsByFile) {
+ // Layer files type the socket as object literals whose members sit at 4-space indent:
+ // `groupMetadata: (jid: string) => Promise<GroupMetadata>;` (also `<T>(...)` generics)
+ for (const m of dts.matchAll(/^ {4}(\w+): (?:async )?[(<]/gm)) names.add(m[1]);
+ }
+ return [...names].sort();
+}
+
+/** Event names of the BaileysEventMap in lib/Types/Events.d.ts. */
+export function extractBaileysEvents(dts) {
+ const start = dts.indexOf('export type BaileysEventMap');
+ if (start === -1) throw new Error('Baileys Events.d.ts: BaileysEventMap not found');
+ const end = dts.indexOf('\n};', start);
+ const block = dts.slice(start, end === -1 ? undefined : end);
+ const names = new Set();
+ for (const m of block.matchAll(/^ {4}'?([\w.-]+)'?:/gm)) names.add(m[1]);
+ return [...names].sort();
+}
+
+export function extractSurface(root = ROOT) {
+ const wwebjsDir = path.join(root, 'node_modules', 'whatsapp-web.js');
+ const baileysDir = path.join(root, 'node_modules', '@whiskeysockets', 'baileys');
+ const socketDir = path.join(baileysDir, 'lib', 'Socket');
+ const socketDts = readdirSync(socketDir)
+ .filter(f => f.endsWith('.d.ts'))
+ .sort()
+ .map(f => readFileSync(path.join(socketDir, f), 'utf8'));
+ return {
+ 'whatsapp-web.js': {
+ version: JSON.parse(readFileSync(path.join(wwebjsDir, 'package.json'), 'utf8')).version,
+ clientMethods: extractWwebjsClientMethods(readFileSync(path.join(wwebjsDir, 'index.d.ts'), 'utf8')),
+ events: extractWwebjsEvents(readFileSync(path.join(wwebjsDir, 'src', 'util', 'Constants.js'), 'utf8')),
+ },
+ baileys: {
+ version: JSON.parse(readFileSync(path.join(baileysDir, 'package.json'), 'utf8')).version,
+ socketMethods: extractBaileysSocketMethods(socketDts),
+ events: extractBaileysEvents(readFileSync(path.join(baileysDir, 'lib', 'Types', 'Events.d.ts'), 'utf8')),
+ },
+ };
+}
+
+/** Diff two string arrays → {added, removed}; both empty means no drift. */
+export function diffLists(current, committed) {
+ const committedSet = new Set(committed);
+ const currentSet = new Set(current);
+ return {
+ added: current.filter(s => !committedSet.has(s)),
+ removed: committed.filter(s => !currentSet.has(s)),
+ };
+}
+
+export function compareSurfaces(current, committed) {
+ const problems = [];
+ for (const [engine, lists] of [
+ ['whatsapp-web.js', ['clientMethods', 'events']],
+ ['baileys', ['socketMethods', 'events']],
+ ]) {
+ for (const list of lists) {
+ const { added, removed } = diffLists(current[engine][list], committed[engine][list]);
+ for (const s of added) problems.push(`${engine} ${list}: NEW upstream symbol '${s}' — unreviewed capability`);
+ for (const s of removed) problems.push(`${engine} ${list}: symbol '${s}' GONE upstream — snapshot is stale`);
+ }
+ }
+ return problems;
+}
+
+function main() {
+ const surface = extractSurface();
+ if (process.argv.includes('--update')) {
+ writeFileSync(SNAPSHOT_PATH, JSON.stringify(surface, null, 2) + '\n');
+ console.log(`✓ Snapshot refreshed at ${SNAPSHOT_PATH} — commit it together with the review that justified it`);
+ return;
+ }
+ const committed = JSON.parse(readFileSync(SNAPSHOT_PATH, 'utf8'));
+ const problems = compareSurfaces(surface, committed);
+ const versionNote = ['whatsapp-web.js', 'baileys']
+ .filter(e => surface[e].version !== committed[e].version)
+ .map(e => `${e} ${committed[e].version} -> ${surface[e].version}`);
+ if (problems.length === 0) {
+ console.log(
+ `✓ Upstream surface matches the reviewed snapshot` +
+ (versionNote.length ? ` (version moved with an identical surface: ${versionNote.join(', ')})` : ''),
+ );
+ return;
+ }
+ console.error(`✗ Upstream capability surface drifted from the reviewed snapshot (${problems.length} symbol(s)):\n`);
+ for (const p of problems) console.error(` - ${p}`);
+ console.error(
+ '\nReview each symbol (expose it, defer it, or record the exclusion — see docs/29 and the gap-matrix ' +
+ 'procedure), then refresh the snapshot:\n node scripts/check-upstream-surface.mjs --update\n',
+ );
+ process.exitCode = 1;
+}
+
+if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
+ main();
+}
diff --git a/scripts/check-upstream-surface.spec.mjs b/scripts/check-upstream-surface.spec.mjs
new file mode 100644
index 000000000..d6ef25afd
--- /dev/null
+++ b/scripts/check-upstream-surface.spec.mjs
@@ -0,0 +1,96 @@
+import test from 'node:test';
+import assert from 'node:assert/strict';
+import {
+ extractWwebjsClientMethods,
+ extractWwebjsEvents,
+ extractBaileysSocketMethods,
+ extractBaileysEvents,
+ extractSurface,
+ compareSurfaces,
+ diffLists,
+} from './check-upstream-surface.mjs';
+
+test('extracts Client method names from a wwebjs-shaped d.ts block', () => {
+ const dts = [
+ 'export class Client extends EventEmitter {',
+ ' getBlockedContacts(): Promise<Contact[]>;',
+ ' approveGroupMembershipRequests(',
+ ' groupId: string,',
+ ' ): Promise<Array<MembershipRequestActionResult>>;',
+ ' }',
+ 'export class OtherClass {',
+ ' notAClientMethod(): void;',
+ ' }',
+ ].join('\n');
+ assert.deepEqual(extractWwebjsClientMethods(dts), ['approveGroupMembershipRequests', 'getBlockedContacts']);
+});
+
+test('extracts Events VALUES from a Constants.js-shaped block', () => {
+ const js = [
+ 'exports.Events = {',
+ " GROUP_MEMBERSHIP_REQUEST: 'group_membership_request',",
+ " MESSAGE_RECEIVED: 'message',",
+ '};',
+ 'const WAState = {',
+ " CONFLICT: 'CONFLICT',",
+ '};',
+ ].join('\n');
+ assert.deepEqual(extractWwebjsEvents(js), ['group_membership_request', 'message']);
+});
+
+test('extracts socket method names across Baileys layer files, deduped', () => {
+ const groups = [
+ 'export declare const makeGroupsSocket: (config: SocketConfig) => {',
+ ' groupMetadata: (jid: string) => Promise<GroupMetadata>;',
+ ' groupRequestParticipantsUpdate: (jid: string, participants: string[], action: "approve" | "reject") => Promise<{',
+ ' status: string;',
+ ' }[]>;',
+ '};',
+ ].join('\n');
+ const chats = [
+ 'export declare const makeChatsSocket: (config: SocketConfig) => {',
+ ' fetchBlocklist: () => Promise<(string | undefined)[]>;',
+ ' groupMetadata: (jid: string) => Promise<GroupMetadata>;',
+ '};',
+ ].join('\n');
+ assert.deepEqual(extractBaileysSocketMethods([groups, chats]), [
+ 'fetchBlocklist',
+ 'groupMetadata',
+ 'groupRequestParticipantsUpdate',
+ ]);
+});
+
+test('extracts BaileysEventMap event names, quoted and bare', () => {
+ const dts = [
+ 'export type BaileysEventMap = {',
+ " 'group.join-request': {",
+ ' id: string;',
+ ' };',
+ " 'messaging-history.set': HistorySet;",
+ ' call: WACallEvent[];',
+ '};',
+ 'export type Other = {',
+ " 'not.an.event': true;",
+ '};',
+ ].join('\n');
+ assert.deepEqual(extractBaileysEvents(dts), ['call', 'group.join-request', 'messaging-history.set']);
+});
+
+test('diffLists reports additions and removals, and nothing on identity', () => {
+ assert.deepEqual(diffLists(['a', 'b'], ['a', 'b']), { added: [], removed: [] });
+ assert.deepEqual(diffLists(['a', 'b', 'c'], ['a', 'b']), { added: ['c'], removed: [] });
+ assert.deepEqual(diffLists(['a'], ['a', 'b']), { added: [], removed: ['b'] });
+});
+
+// The guard itself: the extractor's output over the INSTALLED engines must match the committed,
+// reviewed snapshot. A red run here means an upstream bump brought unreviewed capability surface —
+// review it, then refresh with `node scripts/check-upstream-surface.mjs --update`.
+test('installed upstream surface matches the committed snapshot', async () => {
+ const { readFileSync } = await import('node:fs');
+ const { fileURLToPath } = await import('node:url');
+ const path = await import('node:path');
+ const snapshotPath = path.join(path.dirname(fileURLToPath(import.meta.url)), 'upstream-surface.snapshot.json');
+ const committed = JSON.parse(readFileSync(snapshotPath, 'utf8'));
+ const problems = compareSurfaces(extractSurface(), committed);
+ assert.deepEqual(problems, [], `unreviewed upstream drift:\n${problems.join('\n')}`);
+});
diff --git a/scripts/upstream-surface.snapshot.json b/scripts/upstream-surface.snapshot.json
new file mode 100644
index 000000000..117cd0d31
--- /dev/null
+++ b/scripts/upstream-surface.snapshot.json
@@ -0,0 +1,314 @@
+{
+ "whatsapp-web.js": {
+ "version": "1.34.7",
+ "clientMethods": [
+ "acceptChannelAdminInvite",
+ "acceptInvite",
+ "addOrEditCustomerNote",
+ "addOrRemoveLabels",
+ "approveGroupMembershipRequests",
+ "archiveChat",
+ "cancelPairingCode",
+ "constructor",
+ "createCallLink",
+ "createChannel",
+ "createGroup",
+ "deleteAddressbookContact",
+ "deleteChannel",
+ "deleteProfilePicture",
+ "demoteChannelAdmin",
+ "destroy",
+ "getBlockedContacts",
+ "getBroadcastById",
+ "getBroadcasts",
+ "getChannelByInviteCode",
+ "getChannels",
+ "getChatById",
+ "getChatLabels",
+ "getChats",
+ "getChatsByLabelId",
+ "getCommonGroups",
+ "getContactById",
+ "getContactDeviceCount",
+ "getContactLidAndPhone",
+ "getContacts",
+ "getCountryCode",
+ "getCustomerNote",
+ "getFormattedNumber",
+ "getGroupMembershipRequests",
+ "getInviteInfo",
+ "getLabelById",
+ "getLabels",
+ "getMessageById",
+ "getNumberId",
+ "getPinnedMessages",
+ "getPollVotes",
+ "getProfilePicUrl",
+ "getState",
+ "getWWebVersion",
+ "initialize",
+ "isRegisteredUser",
+ "logout",
+ "markChatUnread",
+ "muteChat",
+ "on",
+ "pinChat",
+ "rejectGroupMembershipRequests",
+ "requestPairingCode",
+ "resetState",
+ "revokeChannelAdminInvite",
+ "revokeStatusMessage",
+ "saveOrEditAddressbookContact",
+ "searchChannels",
+ "searchMessages",
+ "sendChannelAdminInvite",
+ "sendMessage",
+ "sendPresenceAvailable",
+ "sendPresenceUnavailable",
+ "sendReaction",
+ "sendResponseToScheduledEvent",
+ "sendSeen",
+ "setAutoDownloadAudio",
+ "setAutoDownloadDocuments",
+ "setAutoDownloadPhotos",
+ "setAutoDownloadVideos",
+ "setBackgroundSync",
+ "setDisplayName",
+ "setProfilePicture",
+ "setStatus",
+ "subscribeToChannel",
+ "syncHistory",
+ "transferChannelOwnership",
+ "unarchiveChat",
+ "unmuteChat",
+ "unpinChat",
+ "unsubscribeFromChannel"
+ ],
+ "events": [
+ "auth_failure",
+ "authenticated",
+ "call",
+ "change_battery",
+ "change_state",
+ "chat_archived",
+ "chat_removed",
+ "code",
+ "contact_changed",
+ "disconnected",
+ "group_admin_changed",
+ "group_join",
+ "group_leave",
+ "group_membership_request",
+ "group_update",
+ "loading_screen",
+ "media_uploaded",
+ "message",
+ "message_ack",
+ "message_ciphertext",
+ "message_ciphertext_failed",
+ "message_create",
+ "message_edit",
+ "message_reaction",
+ "message_revoke_everyone",
+ "message_revoke_me",
+ "qr",
+ "ready",
+ "remote_session_saved",
+ "unread_count",
+ "vote_update"
+ ]
+ },
+ "baileys": {
+ "version": "7.0.0-rc13",
+ "socketMethods": [
+ "addChatLabel",
+ "addLabel",
+ "addMessageLabel",
+ "addOrEditContact",
+ "addOrEditQuickReply",
+ "appPatch",
+ "assertSessions",
+ "chatModify",
+ "cleanDirtyBits",
+ "communityAcceptInvite",
+ "communityAcceptInviteV4",
+ "communityCreate",
+ "communityCreateGroup",
+ "communityFetchAllParticipating",
+ "communityFetchLinkedGroups",
+ "communityGetInviteInfo",
+ "communityInviteCode",
+ "communityJoinApprovalMode",
+ "communityLeave",
+ "communityLinkGroup",
+ "communityMemberAddMode",
+ "communityMetadata",
+ "communityParticipantsUpdate",
+ "communityRequestParticipantsList",
+ "communityRequestParticipantsUpdate",
+ "communityRevokeInvite",
+ "communityRevokeInviteV4",
+ "communitySettingUpdate",
+ "communityToggleEphemeral",
+ "communityUnlinkGroup",
+ "communityUpdateDescription",
+ "communityUpdateSubject",
+ "createCallLink",
+ "createParticipantNodes",
+ "digestKeyBundle",
+ "end",
+ "executeUSyncQuery",
+ "fetchAccountReachoutTimelock",
+ "fetchBlocklist",
+ "fetchDisappearingDuration",
+ "fetchMessageHistory",
+ "fetchNewChatMessageCap",
+ "fetchPrivacySettings",
+ "fetchStatus",
+ "generateMessageTag",
+ "getBotListV2",
+ "getBusinessProfile",
+ "getCatalog",
+ "getCollections",
+ "getMediaHost",
+ "getOrderDetails",
+ "getUSyncDevices",
+ "groupAcceptInvite",
+ "groupAcceptInviteV4",
+ "groupCreate",
+ "groupFetchAllParticipating",
+ "groupGetInviteInfo",
+ "groupInviteCode",
+ "groupJoinApprovalMode",
+ "groupLeave",
+ "groupMemberAddMode",
+ "groupMetadata",
+ "groupParticipantsUpdate",
+ "groupRequestParticipantsList",
+ "groupRequestParticipantsUpdate",
+ "groupRevokeInvite",
+ "groupRevokeInviteV4",
+ "groupSettingUpdate",
+ "groupToggleEphemeral",
+ "groupUpdateDescription",
+ "groupUpdateSubject",
+ "issuePrivacyTokens",
+ "logout",
+ "newsletterAdminCount",
+ "newsletterChangeOwner",
+ "newsletterCreate",
+ "newsletterDelete",
+ "newsletterDemote",
+ "newsletterFetchMessages",
+ "newsletterFollow",
+ "newsletterMetadata",
+ "newsletterMute",
+ "newsletterReactMessage",
+ "newsletterRemovePicture",
+ "newsletterSubscribers",
+ "newsletterUnfollow",
+ "newsletterUnmute",
+ "newsletterUpdate",
+ "newsletterUpdateDescription",
+ "newsletterUpdateName",
+ "newsletterUpdatePicture",
+ "onUnexpectedError",
+ "onWhatsApp",
+ "presenceSubscribe",
+ "productCreate",
+ "productDelete",
+ "productUpdate",
+ "profilePictureUrl",
+ "query",
+ "readMessages",
+ "refreshMediaConn",
+ "registerSocketEndHandler",
+ "rejectCall",
+ "relayMessage",
+ "removeChatLabel",
+ "removeContact",
+ "removeCoverPhoto",
+ "removeMessageLabel",
+ "removeProfilePicture",
+ "removeQuickReply",
+ "requestPairingCode",
+ "requestPlaceholderResend",
+ "resyncAppState",
+ "rotateSignedPreKey",
+ "sendMessage",
+ "sendMessageAck",
+ "sendNode",
+ "sendPeerDataOperationMessage",
+ "sendPresenceUpdate",
+ "sendRawMessage",
+ "sendReceipt",
+ "sendReceipts",
+ "sendRetryRequest",
+ "sendUnifiedSession",
+ "sendWAMBuffer",
+ "star",
+ "subscribeNewsletterUpdates",
+ "updateBlockStatus",
+ "updateBussinesProfile",
+ "updateCallPrivacy",
+ "updateCoverPhoto",
+ "updateDefaultDisappearingMode",
+ "updateDisableLinkPreviewsPrivacy",
+ "updateGroupsAddPrivacy",
+ "updateLastSeenPrivacy",
+ "updateMediaMessage",
+ "updateMemberLabel",
+ "updateMessagesPrivacy",
+ "updateOnlinePrivacy",
+ "updateProfileName",
+ "updateProfilePicture",
+ "updateProfilePicturePrivacy",
+ "updateProfileStatus",
+ "updateReadReceiptsPrivacy",
+ "updateServerTimeOffset",
+ "updateStatusPrivacy",
+ "uploadPreKeys",
+ "uploadPreKeysToServerIfRequired",
+ "upsertMessage",
+ "waitForConnectionUpdate",
+ "waitForMessage",
+ "waitForSocketOpen"
+ ],
+ "events": [
+ "blocklist.set",
+ "blocklist.update",
+ "call",
+ "chats.delete",
+ "chats.lock",
+ "chats.update",
+ "chats.upsert",
+ "connection.update",
+ "contacts.update",
+ "contacts.upsert",
+ "creds.update",
+ "group-participants.update",
+ "group.join-request",
+ "group.member-tag.update",
+ "groups.update",
+ "groups.upsert",
+ "labels.association",
+ "labels.edit",
+ "lid-mapping.update",
+ "message-capping.update",
+ "message-receipt.update",
+ "messages.delete",
+ "messages.media-update",
+ "messages.reaction",
+ "messages.update",
+ "messages.upsert",
+ "messaging-history.set",
+ "messaging-history.status",
+ "newsletter-participants.update",
+ "newsletter-settings.update",
+ "newsletter.reaction",
+ "newsletter.view",
+ "presence.update",
+ "settings.update"
+ ]
+ }
+}