@qadeer-xtech/stablebail 1.0.7 → 1.0.9

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/CHANGELOG.md CHANGED
@@ -3,6 +3,29 @@
3
3
  Based on **@whiskeysockets/baileys 7.0.0-rc14**. Only the changes made
4
4
  on top of the official release are listed here.
5
5
 
6
+ ## 1.0.9
7
+ - Fix: onWhatsApp LID lookups now return the `lid` field. The
8
+ internal PN-to-LID map key was malformed (`user@@s.whatsapp.net`)
9
+ since 1.0.4, so the lookup never matched and `lid` was silently
10
+ never attached. Found during the src/ source audit; proven with
11
+ a runtime check against the shipped code before fixing.
12
+ - Type declarations healed to match the shipped JS surface
13
+ (newsletter and status-mention methods, `nctSalt`,
14
+ `thumbnail_info`) - these come from the verified TypeScript
15
+ source in the repository (src/), which compiles byte-identically
16
+ to the shipped library.
17
+ - README: recommended bot pin updated to 1.0.9.
18
+
19
+ ## 1.0.8
20
+ - README: the licence section now describes the dual licence
21
+ correctly, and dependency-transparency links were added.
22
+ - The libsignal and whatsapp-rust-bridge republishes now have
23
+ public repositories whose DIFF.md files document that their
24
+ code is byte-identical to upstream.
25
+ - First release published from the GitHub Actions workflow using
26
+ npm trusted publishing (OIDC), with provenance attestation.
27
+ - No library code changes in this release.
28
+
6
29
  ## 1.0.7
7
30
  - Public GitHub repository: https://github.com/Qadeer-Xtech/stablebail
8
31
  (package.json now carries repository / homepage / bugs links).
package/README.md CHANGED
@@ -8,8 +8,42 @@ A powerful WhatsApp Web API library built on the Baileys architecture, enhanced
8
8
 
9
9
  Based on **@whiskeysockets/baileys 7.0.0-rc14** (MIT). Source, issues and changelog: https://github.com/Qadeer-Xtech/stablebail
10
10
 
11
+ [![CI](https://github.com/Qadeer-Xtech/stablebail/actions/workflows/ci.yml/badge.svg)](https://github.com/Qadeer-Xtech/stablebail/actions/workflows/ci.yml)
12
+
13
+ ## Why StableBail instead of stock Baileys?
14
+
15
+ Same API — StableBail is Baileys 7.0.0-rc14 plus reviewed fixes that
16
+ upstream has not released yet:
17
+
18
+ | Area | Stock rc14 | StableBail |
19
+ |---|---|---|
20
+ | Media reupload on 403/404/410 | broken | fixed (1.0.3) |
21
+ | Stream drops ~50 min (status ack) | broken | fixed (1.0.7) |
22
+ | Pairing code 515 failures | broken | fixed (1.0.7) |
23
+ | creds.json corruption on crash | possible | atomic writes (1.0.7) |
24
+ | Channel (newsletter) media | often invisible | fixed paths (1.0.2 + 1.0.7) |
25
+ | Status mentions | not available | `sendStatusMention` (1.0.5) |
26
+ | Retry double-encryption | present | fixed (1.0.7) |
27
+
28
+ Full per-version list: [CHANGELOG.md](CHANGELOG.md) · Plans: [ROADMAP.md](ROADMAP.md) · Runnable samples: [examples/](examples/)
29
+
30
+ ## Switching from official Baileys (1 minute)
31
+
32
+ Change only the dependency line — your code stays the same:
33
+
34
+ ```json
35
+ "@whiskeysockets/baileys": "npm:@qadeer-xtech/stablebail@1.0.7"
36
+ ```
37
+
11
38
  Designed for developers who need a familiar Baileys-compatible API with extra functionality and a smoother development experience.
12
39
 
40
+ ## TypeScript source
41
+
42
+ The full TypeScript source of this package is in
43
+ [`src/`](src/). It is **build-verified**: compiling it with the
44
+ included tsconfig reproduces the shipped `lib/` byte-for-byte,
45
+ so what you read here is exactly what runs.
46
+
13
47
  ## 📦 Installation
14
48
 
15
49
  ```bash
@@ -37,7 +71,7 @@ For a smooth, error-free install, use these exact settings in your bot's "packag
37
71
  ```json
38
72
  {
39
73
  "dependencies": {
40
- "@whiskeysockets/baileys": "npm:@qadeer-xtech/stablebail@1.0.6",
74
+ "@whiskeysockets/baileys": "npm:@qadeer-xtech/stablebail@1.0.9",
41
75
  "sharp": "0.35.5",
42
76
  "wa-sticker-formatter": "4.4.4"
43
77
  },
@@ -332,7 +366,20 @@ StableBail is designed to minimize migration work for existing Baileys users. Ho
332
366
 
333
367
  ## 📄 License
334
368
 
335
- MIT License
369
+ Dual licence — see the [LICENSE](LICENSE) file: **Part 1** is the
370
+ upstream MIT License (Baileys / WhiskeySockets); **Part 2** adds the
371
+ Team Qadeer terms for the fixes, extensions and branding in
372
+ StableBail. The [NOTICE](NOTICE) file ships with the package and
373
+ must be retained.
374
+
375
+ ## Dependencies
376
+
377
+ The two core dependencies are faithful republishes under the same
378
+ scope, with code **byte-identical** to upstream (proof in each
379
+ repo's DIFF.md):
380
+
381
+ - [@qadeer-xtech/libsignal](https://github.com/Qadeer-Xtech/libsignal) — of official libsignal 6.0.0
382
+ - [@qadeer-xtech/whatsapp-rust-bridge](https://github.com/Qadeer-Xtech/whatsapp-rust-bridge) — of official whatsapp-rust-bridge 0.5.4
336
383
 
337
384
  ## 🖤 Credits
338
385
 
@@ -51,13 +51,19 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
51
51
  })[]>;
52
52
  updateMemberLabel: (jid: string, memberLabel: string) => Promise<string>;
53
53
  updateMediaMessage: (message: import("../index.js").WAMessage) => Promise<import("../index.js").WAMessage>;
54
+ sendStatusMention: (jidList: string[], content: import("../index.js").AnyMessageContent, options?: import("../index.js").MiscMessageGenerationOptions & {
55
+ delayMs?: number;
56
+ }) => Promise<import("../index.js").WAMessage>;
54
57
  sendMessage: (jid: string, content: import("../index.js").AnyMessageContent, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
55
58
  newsletterCreate: (name: string, description?: string) => Promise<import("../index.js").NewsletterMetadata>;
56
59
  newsletterUpdate: (jid: string, updates: import("../index.js").NewsletterUpdate) => Promise<unknown>;
57
60
  newsletterSubscribers: (jid: string) => Promise<{
58
61
  subscribers: number;
59
62
  }>;
63
+ newsletterSubscribed: () => Promise<unknown>;
64
+ newsletterFetchAllSubscribe: () => Promise<unknown>;
60
65
  newsletterMetadata: (type: "invite" | "jid", key: string) => Promise<import("../index.js").NewsletterMetadata | null>;
66
+ newsletterFromUrl: (url: string) => Promise<import("../index.js").NewsletterMetadata | null>;
61
67
  newsletterFollow: (jid: string) => Promise<unknown>;
62
68
  newsletterUnfollow: (jid: string) => Promise<unknown>;
63
69
  newsletterMute: (jid: string) => Promise<unknown>;
@@ -66,8 +72,17 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
66
72
  newsletterUpdateDescription: (jid: string, description: string) => Promise<unknown>;
67
73
  newsletterUpdatePicture: (jid: string, content: WAMediaUpload) => Promise<unknown>;
68
74
  newsletterRemovePicture: (jid: string) => Promise<unknown>;
75
+ newsletterReactionMode: (jid: string, mode: string) => Promise<unknown>;
69
76
  newsletterReactMessage: (jid: string, serverId: string, reaction?: string) => Promise<void>;
70
- newsletterFetchMessages: (jid: string, count: number, since: number, after: number) => Promise<any>;
77
+ newsletterFetchMessages: (typeOrJid: string, keyOrCount: string | number, count?: number | undefined, after?: number | undefined, before?: number | undefined) => Promise<any>;
78
+ newsletterFetchUpdates: (jid: string, count?: number, after?: number, since?: number) => Promise<{
79
+ server_id: string;
80
+ views: number;
81
+ reactions: {
82
+ count: number;
83
+ code: string;
84
+ }[];
85
+ }[]>;
71
86
  subscribeNewsletterUpdates: (jid: string) => Promise<{
72
87
  duration: string;
73
88
  } | null>;
@@ -214,4 +229,3 @@ export declare const makeBusinessSocket: (config: SocketConfig) => {
214
229
  fetchAccountReachoutTimelock: () => Promise<import("../index.js").ReachoutTimelockState>;
215
230
  fetchNewChatMessageCap: () => Promise<import("../index.js").NewChatMessageCapInfo>;
216
231
  };
217
- //# sourceMappingURL=business.d.ts.map
@@ -106,13 +106,19 @@ export declare const makeCommunitiesSocket: (config: SocketConfig) => {
106
106
  })[]>;
107
107
  updateMemberLabel: (jid: string, memberLabel: string) => Promise<string>;
108
108
  updateMediaMessage: (message: import("../Types/index.js").WAMessage) => Promise<import("../Types/index.js").WAMessage>;
109
+ sendStatusMention: (jidList: string[], content: import("../Types/index.js").AnyMessageContent, options?: import("../Types/index.js").MiscMessageGenerationOptions & {
110
+ delayMs?: number;
111
+ }) => Promise<import("../Types/index.js").WAMessage>;
109
112
  sendMessage: (jid: string, content: import("../Types/index.js").AnyMessageContent, options?: import("../Types/index.js").MiscMessageGenerationOptions) => Promise<import("../Types/index.js").WAMessage | undefined>;
110
113
  newsletterCreate: (name: string, description?: string) => Promise<import("../Types/index.js").NewsletterMetadata>;
111
114
  newsletterUpdate: (jid: string, updates: import("../Types/index.js").NewsletterUpdate) => Promise<unknown>;
112
115
  newsletterSubscribers: (jid: string) => Promise<{
113
116
  subscribers: number;
114
117
  }>;
118
+ newsletterSubscribed: () => Promise<unknown>;
119
+ newsletterFetchAllSubscribe: () => Promise<unknown>;
115
120
  newsletterMetadata: (type: "invite" | "jid", key: string) => Promise<import("../Types/index.js").NewsletterMetadata | null>;
121
+ newsletterFromUrl: (url: string) => Promise<import("../Types/index.js").NewsletterMetadata | null>;
116
122
  newsletterFollow: (jid: string) => Promise<unknown>;
117
123
  newsletterUnfollow: (jid: string) => Promise<unknown>;
118
124
  newsletterMute: (jid: string) => Promise<unknown>;
@@ -121,8 +127,17 @@ export declare const makeCommunitiesSocket: (config: SocketConfig) => {
121
127
  newsletterUpdateDescription: (jid: string, description: string) => Promise<unknown>;
122
128
  newsletterUpdatePicture: (jid: string, content: import("../Types/index.js").WAMediaUpload) => Promise<unknown>;
123
129
  newsletterRemovePicture: (jid: string) => Promise<unknown>;
130
+ newsletterReactionMode: (jid: string, mode: string) => Promise<unknown>;
124
131
  newsletterReactMessage: (jid: string, serverId: string, reaction?: string) => Promise<void>;
125
- newsletterFetchMessages: (jid: string, count: number, since: number, after: number) => Promise<any>;
132
+ newsletterFetchMessages: (typeOrJid: string, keyOrCount: string | number, count?: number | undefined, after?: number | undefined, before?: number | undefined) => Promise<any>;
133
+ newsletterFetchUpdates: (jid: string, count?: number, after?: number, since?: number) => Promise<{
134
+ server_id: string;
135
+ views: number;
136
+ reactions: {
137
+ count: number;
138
+ code: string;
139
+ }[];
140
+ }[]>;
126
141
  subscribeNewsletterUpdates: (jid: string) => Promise<{
127
142
  duration: string;
128
143
  } | null>;
@@ -270,4 +285,3 @@ export declare const makeCommunitiesSocket: (config: SocketConfig) => {
270
285
  fetchNewChatMessageCap: () => Promise<import("../Types/index.js").NewChatMessageCapInfo>;
271
286
  };
272
287
  export declare const extractCommunityMetadata: (result: BinaryNode) => GroupMetadata;
273
- //# sourceMappingURL=communities.d.ts.map
@@ -93,13 +93,19 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
93
93
  })[]>;
94
94
  updateMemberLabel: (jid: string, memberLabel: string) => Promise<string>;
95
95
  updateMediaMessage: (message: import("../index.js").WAMessage) => Promise<import("../index.js").WAMessage>;
96
+ sendStatusMention: (jidList: string[], content: import("../index.js").AnyMessageContent, options?: import("../index.js").MiscMessageGenerationOptions & {
97
+ delayMs?: number;
98
+ }) => Promise<import("../index.js").WAMessage>;
96
99
  sendMessage: (jid: string, content: import("../index.js").AnyMessageContent, options?: import("../index.js").MiscMessageGenerationOptions) => Promise<import("../index.js").WAMessage | undefined>;
97
100
  newsletterCreate: (name: string, description?: string) => Promise<import("../index.js").NewsletterMetadata>;
98
101
  newsletterUpdate: (jid: string, updates: import("../index.js").NewsletterUpdate) => Promise<unknown>;
99
102
  newsletterSubscribers: (jid: string) => Promise<{
100
103
  subscribers: number;
101
104
  }>;
105
+ newsletterSubscribed: () => Promise<unknown>;
106
+ newsletterFetchAllSubscribe: () => Promise<unknown>;
102
107
  newsletterMetadata: (type: "invite" | "jid", key: string) => Promise<import("../index.js").NewsletterMetadata | null>;
108
+ newsletterFromUrl: (url: string) => Promise<import("../index.js").NewsletterMetadata | null>;
103
109
  newsletterFollow: (jid: string) => Promise<unknown>;
104
110
  newsletterUnfollow: (jid: string) => Promise<unknown>;
105
111
  newsletterMute: (jid: string) => Promise<unknown>;
@@ -108,8 +114,17 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
108
114
  newsletterUpdateDescription: (jid: string, description: string) => Promise<unknown>;
109
115
  newsletterUpdatePicture: (jid: string, content: import("../index.js").WAMediaUpload) => Promise<unknown>;
110
116
  newsletterRemovePicture: (jid: string) => Promise<unknown>;
117
+ newsletterReactionMode: (jid: string, mode: string) => Promise<unknown>;
111
118
  newsletterReactMessage: (jid: string, serverId: string, reaction?: string) => Promise<void>;
112
- newsletterFetchMessages: (jid: string, count: number, since: number, after: number) => Promise<any>;
119
+ newsletterFetchMessages: (typeOrJid: string, keyOrCount: string | number, count?: number | undefined, after?: number | undefined, before?: number | undefined) => Promise<any>;
120
+ newsletterFetchUpdates: (jid: string, count?: number, after?: number, since?: number) => Promise<{
121
+ server_id: string;
122
+ views: number;
123
+ reactions: {
124
+ count: number;
125
+ code: string;
126
+ }[];
127
+ }[]>;
113
128
  subscribeNewsletterUpdates: (jid: string) => Promise<{
114
129
  duration: string;
115
130
  } | null>;
@@ -257,4 +272,3 @@ declare const makeWASocket: (config: UserFacingSocketConfig) => {
257
272
  fetchNewChatMessageCap: () => Promise<import("../index.js").NewChatMessageCapInfo>;
258
273
  };
259
274
  export default makeWASocket;
260
- //# sourceMappingURL=index.d.ts.map
@@ -37,13 +37,19 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
37
37
  })[]>;
38
38
  updateMemberLabel: (jid: string, memberLabel: string) => Promise<string>;
39
39
  updateMediaMessage: (message: WAMessage) => Promise<WAMessage>;
40
+ sendStatusMention: (jidList: string[], content: import("../Types/index.js").AnyMessageContent, options?: import("../Types/index.js").MiscMessageGenerationOptions & {
41
+ delayMs?: number;
42
+ }) => Promise<WAMessage>;
40
43
  sendMessage: (jid: string, content: import("../Types/index.js").AnyMessageContent, options?: import("../Types/index.js").MiscMessageGenerationOptions) => Promise<WAMessage | undefined>;
41
44
  newsletterCreate: (name: string, description?: string) => Promise<import("../Types/index.js").NewsletterMetadata>;
42
45
  newsletterUpdate: (jid: string, updates: import("../Types/index.js").NewsletterUpdate) => Promise<unknown>;
43
46
  newsletterSubscribers: (jid: string) => Promise<{
44
47
  subscribers: number;
45
48
  }>;
49
+ newsletterSubscribed: () => Promise<unknown>;
50
+ newsletterFetchAllSubscribe: () => Promise<unknown>;
46
51
  newsletterMetadata: (type: "invite" | "jid", key: string) => Promise<import("../Types/index.js").NewsletterMetadata | null>;
52
+ newsletterFromUrl: (url: string) => Promise<import("../Types/index.js").NewsletterMetadata | null>;
47
53
  newsletterFollow: (jid: string) => Promise<unknown>;
48
54
  newsletterUnfollow: (jid: string) => Promise<unknown>;
49
55
  newsletterMute: (jid: string) => Promise<unknown>;
@@ -52,8 +58,17 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
52
58
  newsletterUpdateDescription: (jid: string, description: string) => Promise<unknown>;
53
59
  newsletterUpdatePicture: (jid: string, content: import("../Types/index.js").WAMediaUpload) => Promise<unknown>;
54
60
  newsletterRemovePicture: (jid: string) => Promise<unknown>;
61
+ newsletterReactionMode: (jid: string, mode: string) => Promise<unknown>;
55
62
  newsletterReactMessage: (jid: string, serverId: string, reaction?: string) => Promise<void>;
56
- newsletterFetchMessages: (jid: string, count: number, since: number, after: number) => Promise<any>;
63
+ newsletterFetchMessages: (typeOrJid: string, keyOrCount: string | number, count?: number | undefined, after?: number | undefined, before?: number | undefined) => Promise<any>;
64
+ newsletterFetchUpdates: (jid: string, count?: number, after?: number, since?: number) => Promise<{
65
+ server_id: string;
66
+ views: number;
67
+ reactions: {
68
+ count: number;
69
+ code: string;
70
+ }[];
71
+ }[]>;
57
72
  subscribeNewsletterUpdates: (jid: string) => Promise<{
58
73
  duration: string;
59
74
  } | null>;
@@ -200,4 +215,3 @@ export declare const makeMessagesRecvSocket: (config: SocketConfig) => {
200
215
  fetchAccountReachoutTimelock: () => Promise<import("../Types/index.js").ReachoutTimelockState>;
201
216
  fetchNewChatMessageCap: () => Promise<NewChatMessageCapInfo>;
202
217
  };
203
- //# sourceMappingURL=messages-recv.d.ts.map
@@ -5,6 +5,31 @@ import type { AnyMessageContent, MediaConnInfo, MessageReceiptType, MessageRelay
5
5
  import { MessageRetryManager } from '../Utils/index.js';
6
6
  import { type BinaryNode, type JidWithDevice } from '../WABinary/index.js';
7
7
  import { USyncQuery } from '../WAUSync/index.js';
8
+ export type StatusMentionDeps = {
9
+ logger: SocketConfig['logger'];
10
+ config: SocketConfig;
11
+ userJid: string;
12
+ waUploadToServer: import('../Types/index.js').WAMediaUploadFunction;
13
+ relayMessage: (jid: string, message: proto.IMessage, options: MessageRelayOptions) => Promise<string>;
14
+ groupMetadata: (jid: string) => Promise<import('../Types/index.js').GroupMetadata>;
15
+ cachedGroupMetadata?: SocketConfig['cachedGroupMetadata'];
16
+ upsertMessage: (...args: any[]) => Promise<any>;
17
+ messageMutex: {
18
+ mutex: <T>(code: () => Promise<T> | T) => Promise<T>;
19
+ };
20
+ };
21
+ /**
22
+ * Status (story) mein contacts/groups ko mention karne ka wire flow.
23
+ * Pehle status content `status@broadcast` par relay hota hai — `statusJidList` mein
24
+ * tamam expanded participants aur `<meta><mentioned_users>` node mein asal mention
25
+ * JIDs. Phir har mentioned JID/group ko alag `statusMentionMessage` /
26
+ * `groupStatusMentionMessage` (protocolMessage type 25 = STATUS_MENTION_MESSAGE)
27
+ * relay hota hai, ~1500ms pacing ke sath. Deps inject kiye jate hain taake socket
28
+ * factory aur unit tests dono isi implementation ko istemal kar saken.
29
+ */
30
+ export declare const sendStatusMentionImpl: (deps: StatusMentionDeps, jidList: string[], content: AnyMessageContent, options?: MiscMessageGenerationOptions & {
31
+ delayMs?: number;
32
+ }) => Promise<WAMessage>;
8
33
  export declare const makeMessagesSocket: (config: SocketConfig) => {
9
34
  userDevicesCache: import("../Types/index.js").PossiblyExtendedCacheStore | NodeCache<JidWithDevice[]>;
10
35
  devicesMutex: {
@@ -33,16 +58,19 @@ export declare const makeMessagesSocket: (config: SocketConfig) => {
33
58
  messageRetryManager: MessageRetryManager | null;
34
59
  updateMemberLabel: (jid: string, memberLabel: string) => Promise<string>;
35
60
  updateMediaMessage: (message: WAMessage) => Promise<WAMessage>;
36
- sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<WAMessage | undefined>;
37
61
  sendStatusMention: (jidList: string[], content: AnyMessageContent, options?: MiscMessageGenerationOptions & {
38
62
  delayMs?: number;
39
63
  }) => Promise<WAMessage>;
64
+ sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise<WAMessage | undefined>;
40
65
  newsletterCreate: (name: string, description?: string) => Promise<import("../Types/index.js").NewsletterMetadata>;
41
66
  newsletterUpdate: (jid: string, updates: import("../Types/index.js").NewsletterUpdate) => Promise<unknown>;
42
67
  newsletterSubscribers: (jid: string) => Promise<{
43
68
  subscribers: number;
44
69
  }>;
70
+ newsletterSubscribed: () => Promise<unknown>;
71
+ newsletterFetchAllSubscribe: () => Promise<unknown>;
45
72
  newsletterMetadata: (type: "invite" | "jid", key: string) => Promise<import("../Types/index.js").NewsletterMetadata | null>;
73
+ newsletterFromUrl: (url: string) => Promise<import("../Types/index.js").NewsletterMetadata | null>;
46
74
  newsletterFollow: (jid: string) => Promise<unknown>;
47
75
  newsletterUnfollow: (jid: string) => Promise<unknown>;
48
76
  newsletterMute: (jid: string) => Promise<unknown>;
@@ -51,8 +79,17 @@ export declare const makeMessagesSocket: (config: SocketConfig) => {
51
79
  newsletterUpdateDescription: (jid: string, description: string) => Promise<unknown>;
52
80
  newsletterUpdatePicture: (jid: string, content: import("../Types/index.js").WAMediaUpload) => Promise<unknown>;
53
81
  newsletterRemovePicture: (jid: string) => Promise<unknown>;
82
+ newsletterReactionMode: (jid: string, mode: string) => Promise<unknown>;
54
83
  newsletterReactMessage: (jid: string, serverId: string, reaction?: string) => Promise<void>;
55
- newsletterFetchMessages: (jid: string, count: number, since: number, after: number) => Promise<any>;
84
+ newsletterFetchMessages: (typeOrJid: string, keyOrCount: string | number, count?: number | undefined, after?: number | undefined, before?: number | undefined) => Promise<any>;
85
+ newsletterFetchUpdates: (jid: string, count?: number, after?: number, since?: number) => Promise<{
86
+ server_id: string;
87
+ views: number;
88
+ reactions: {
89
+ count: number;
90
+ code: string;
91
+ }[];
92
+ }[]>;
56
93
  subscribeNewsletterUpdates: (jid: string) => Promise<{
57
94
  duration: string;
58
95
  } | null>;
@@ -199,19 +236,3 @@ export declare const makeMessagesSocket: (config: SocketConfig) => {
199
236
  fetchAccountReachoutTimelock: () => Promise<import("../Types/index.js").ReachoutTimelockState>;
200
237
  fetchNewChatMessageCap: () => Promise<import("../Types/index.js").NewChatMessageCapInfo>;
201
238
  };
202
- export type StatusMentionDeps = {
203
- logger: SocketConfig['logger'];
204
- config: SocketConfig;
205
- userJid: string;
206
- waUploadToServer: import("../Types/index.js").WAMediaUploadFunction;
207
- relayMessage: (jid: string, message: proto.IMessage, options: MessageRelayOptions) => Promise<string>;
208
- groupMetadata: (jid: string) => Promise<import("../Types/index.js").GroupMetadata>;
209
- cachedGroupMetadata?: SocketConfig['cachedGroupMetadata'];
210
- upsertMessage: (...args: any[]) => Promise<any>;
211
- messageMutex: {
212
- mutex: <T>(code: () => Promise<T> | T) => Promise<T>;
213
- };
214
- };
215
- export declare const sendStatusMentionImpl: (deps: StatusMentionDeps, jidList: string[], content: AnyMessageContent, options?: MiscMessageGenerationOptions & {
216
- delayMs?: number;
217
- }) => Promise<WAMessage>;
@@ -7,7 +7,7 @@ import { DEF_CALLBACK_PREFIX, DEF_TAG_PREFIX, INITIAL_PREKEY_COUNT, MIN_PREKEY_C
7
7
  import { QueryIds, ReachoutTimelockEnforcementType } from '../Types/index.js';
8
8
  import { DisconnectReason, XWAPaths } from '../Types/index.js';
9
9
  import { addTransactionCapability, aesEncryptCTR, bindWaitForConnectionUpdate, buildPairingQRData, bytesToCrockford, configureSuccessfulPairing, Curve, derivePairingCodeKey, generateLoginNode, generateMdTagPrefix, generateRegistrationNode, getCodeFromWSError, getCompanionPlatformId, getErrorCodeFromStreamError, getNextPreKeysNode, makeEventBuffer, makeNoiseHandler, promiseTimeout, signedKeyPair, xmppSignedPreKey } from '../Utils/index.js';
10
- import { assertNodeErrorFree, binaryNodeToString, encodeBinaryNode, getAllBinaryNodeChildren, getBinaryNodeChild, getBinaryNodeChildren, isLidUser, jidDecode, jidEncode, S_WHATSAPP_NET } from '../WABinary/index.js';
10
+ import { assertNodeErrorFree, binaryNodeToString, encodeBinaryNode, getAllBinaryNodeChildren, getBinaryNodeChild, getBinaryNodeChildren, isLidUser, jidDecode, jidEncode, jidNormalizedUser, S_WHATSAPP_NET } from '../WABinary/index.js';
11
11
  import { BinaryInfo } from '../WAM/BinaryInfo.js';
12
12
  import { USyncQuery, USyncUser } from '../WAUSync/index.js';
13
13
  import { WebSocketClient } from './Client/index.js';
@@ -229,6 +229,11 @@ export const makeSocket = (config) => {
229
229
  // local LID<->PN mapping se number nikalo, phir aam contact query
230
230
  // chalao aur jawab mein lid bhi wapas lagao. Mapping na mile to
231
231
  // purana behavior (skip) — ghalat exists:false nahi bhejna.
232
+ // 1.0.9 fix: 1.0.4 mein map ki key jidEncode(user, S_WHATSAPP_NET)
233
+ // se banti thi — S_WHATSAPP_NET '@s.whatsapp.net' hai aur jidEncode
234
+ // khud '@' lagata hai, to key 'user@@s.whatsapp.net' ban jati thi
235
+ // aur result id se kabhi match nahi hoti thi (lid kabhi attach
236
+ // nahi hota tha). Ab canonical key jidNormalizedUser se banti hai.
232
237
  const resolvedLids = new Map();
233
238
  const addPhone = (phoneJid) => {
234
239
  if (!contactEnabled) {
@@ -246,8 +251,7 @@ export const makeSocket = (config) => {
246
251
  }
247
252
  catch { /* mapping store band/fail — neeche skip */ }
248
253
  if (pn) {
249
- const pnDecoded = jidDecode(pn);
250
- resolvedLids.set(pnDecoded ? jidEncode(pnDecoded.user, S_WHATSAPP_NET) : pn, jid); // result ki id device-bagair ati hai, key match ke liye normalize
254
+ resolvedLids.set(jidNormalizedUser(pn) || pn, jid); // result ki id device-bagair ati hai, key match ke liye normalize
251
255
  addPhone(pn);
252
256
  }
253
257
  else {
@@ -7,6 +7,7 @@ export declare const processHistoryMessage: (item: proto.IHistorySync, logger?:
7
7
  contacts: Contact[];
8
8
  messages: WAMessage[];
9
9
  lidPnMappings: LIDMapping[];
10
+ nctSalt: Uint8Array<ArrayBuffer> | undefined;
10
11
  pastParticipants: proto.IPastParticipants[] | null | undefined;
11
12
  syncType: proto.HistorySync.HistorySyncType | null | undefined;
12
13
  progress: number | null | undefined;
@@ -16,9 +17,9 @@ export declare const downloadAndProcessHistorySyncNotification: (msg: proto.Mess
16
17
  contacts: Contact[];
17
18
  messages: WAMessage[];
18
19
  lidPnMappings: LIDMapping[];
20
+ nctSalt: Uint8Array<ArrayBuffer> | undefined;
19
21
  pastParticipants: proto.IPastParticipants[] | null | undefined;
20
22
  syncType: proto.HistorySync.HistorySyncType | null | undefined;
21
23
  progress: number | null | undefined;
22
24
  }>;
23
25
  export declare const getHistoryMsg: (message: proto.IMessage) => proto.Message.IHistorySyncNotification;
24
- //# sourceMappingURL=history.d.ts.map
@@ -10,6 +10,7 @@ export * from './history.js';
10
10
  export * from './chat-utils.js';
11
11
  export * from './lt-hash.js';
12
12
  export * from './auth-utils.js';
13
+ export * from './banner.js';
13
14
  export * from './use-multi-file-auth-state.js';
14
15
  export * from './link-preview.js';
15
16
  export * from './event-buffer.js';
@@ -19,4 +20,3 @@ export * from './browser-utils.js';
19
20
  export * from './companion-reg-client-utils.js';
20
21
  export * from './identity-change-handler.js';
21
22
  export * from './stanza-ack.js';
22
- //# sourceMappingURL=index.d.ts.map
@@ -102,6 +102,10 @@ type MediaUploadResult = {
102
102
  meta_hmac?: string;
103
103
  ts?: number;
104
104
  fbid?: number;
105
+ thumbnail_info?: {
106
+ thumbnail_direct_path?: string;
107
+ thumbnail_sha256?: string;
108
+ };
105
109
  };
106
110
  export type UploadParams = {
107
111
  url: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@qadeer-xtech/stablebail",
3
3
  "type": "module",
4
- "version": "1.0.7",
4
+ "version": "1.0.9",
5
5
  "description": "A WebSockets library for interacting with WhatsApp Web",
6
6
  "keywords": [
7
7
  "whatsapp",
@@ -144,4 +144,4 @@
144
144
  "bugs": {
145
145
  "url": "https://github.com/Qadeer-Xtech/stablebail/issues"
146
146
  }
147
- }
147
+ }
@@ -1 +0,0 @@
1
- {"version":3,"file":"business.d.ts","sourceRoot":"","sources":["../../src/Socket/business.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAC5G,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAA;AAUnE,OAAO,EAAE,KAAK,UAAU,EAAqC,MAAM,aAAa,CAAA;AAIhF,eAAO,MAAM,kBAAkB,GAAI,QAAQ,YAAY;;+BA8Od,MAAM,eAAe,MAAM;yCAjGjB,iBAAiB;;;;2BAmD/B,MAAM;;;4BAkIL,aAAa;gCAwCT,MAAM,EAAE;;;+BA9ET,MAAM,UAAU,aAAa;kCAxR1B,0BAA0B;8BA2E9B,aAAa;2BAoChB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAsS6+nB,CAAC;;;;;;;;;0DAhXtgoB,GAAG,0BAChB,GAAH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8WF,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"communities.d.ts","sourceRoot":"","sources":["../../src/Socket/communities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAC9C,OAAO,EACN,KAAK,aAAa,EAElB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,YAAY,EAEjB,MAAM,UAAU,CAAA;AAGjB,OAAO,EACN,KAAK,UAAU,EAMf,MAAM,aAAa,CAAA;AAGpB,eAAO,MAAM,qBAAqB,GAAI,QAAQ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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA4vBJ,CAAC;;;;;;;;;0DAl3B1B,GAAG,0BACD,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqjEN,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../src/Utils/history.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAC9C,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAIpE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAwB1C,eAAO,MAAM,eAAe,GAAU,KAAK,KAAK,CAAC,OAAO,CAAC,wBAAwB,EAAE,SAAS,WAAW,+BAYtG,CAAA;AAED,eAAO,MAAM,qBAAqB,GAAI,MAAM,KAAK,CAAC,YAAY,EAAE,SAAS,OAAO;;;;;;;;CA6F/E,CAAA;AAED,eAAO,MAAM,yCAAyC,GACrD,KAAK,KAAK,CAAC,OAAO,CAAC,wBAAwB,EAC3C,SAAS,WAAW,EACpB,SAAS,OAAO;;;;;;;;EAUhB,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,SAAS,KAAK,CAAC,QAAQ,2CAKpD,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,qBAAqB,CAAA;AACnC,cAAc,YAAY,CAAA;AAC1B,cAAc,kBAAkB,CAAA;AAChC,cAAc,uBAAuB,CAAA;AACrC,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,C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