@oxidezap/whatsapp-rust-bridge 0.23.1 → 0.24.1

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/host.js CHANGED
@@ -1 +1 @@
1
- import{A as B,B as F,C as D,D as e,E as I,F as q,G as C,H,I as N,J as R,K as V,L as j,M as E,N as G,O as J,P as K,Q as L,R as O,S as P,T as Q,U,V as X,W as Y,X as Z,Y as $,Z as ee,a as i,b as r,c as a,d as n,e as d,f as p,g as l,h as m,i as h,j as c,k as u,l as w,m as y,n as b,o as f,p as g,q as S,r as x,s as k,t as _,u as v,v as M,w as W,x as z,y as T,z as A}from"./bridge.js";export{D as verifySignature,F as updateLogger,B as setLogger,Z as proto,A as projectLegacySessionRecordV1,T as md5,q as longToBigInt,z as logMessage,$ as initWasmEngine,e as initSync,W as inflateZlib,M as importLegacySessionRecordV1,v as hkdf,_ as hasLogger,k as getWasmMemoryBytes,x as getWasmAllocationSnapshot,S as getPublicFromPrivateKey,g as getEnabledFeatures,f as generateKeyPair,b as encodeSessionRecordComponents,O as encodeServerAckWireBatch,y as encodeSenderKeyRecordComponents,L as encodeReceiptWireBatch,N as encodeProto,G as encodeMessageWireBatch,Y as encodeEventWireEnvelope,w as decryptPollVotePayload,u as decryptPollVote,c as decryptEventResponsePayload,h as decodeSessionRecordComponents,K as decodeServerAckWireBatch,m as decodeSenderKeyRecordComponents,J as decodeReceiptWireBatch,V as decodeProtoBatch,R as decodeProto,E as decodeMessageWireBatch,X as decodeEventWireEnvelope,ee as createWhatsAppClient,l as calculateSignature,p as calculateAgreement,d as beginWasmAllocationProfile,n as WasmWhatsAppClient,I as UnpairedSurrogateError,j as MESSAGE_WIRE_INFO_RECORD_WIDTH,H as InvalidUtf8CountingReader,a as IntoUnderlyingSource,r as IntoUnderlyingSink,i as IntoUnderlyingByteSource,U as EVENT_SEGMENT_KIND_SERVER_ACK,Q as EVENT_SEGMENT_KIND_RECEIPT,P as EVENT_SEGMENT_KIND_MESSAGE,C as BinaryReader};
1
+ import{A as B,B as F,C as D,D as e,E as I,F as q,G as C,H,I as N,J as R,K as V,L as j,M as E,N as G,O as J,P as K,Q as L,R as O,S as P,T as Q,U,V as X,W as Y,X as Z,Y as $,Z as ee,a as i,b as r,c as a,d as n,e as d,f as p,g as l,h as m,i as h,j as c,k as u,l as w,m as y,n as b,o as f,p as g,q as S,r as x,s as k,t as _,u as v,v as M,w as W,x as z,y as T,z as A}from"./bridge.js";export{D as verifySignature,F as updateLogger,B as sha256,A as setLogger,Z as proto,T as projectLegacySessionRecordV1,z as md5,q as longToBigInt,W as logMessage,$ as initWasmEngine,e as initSync,M as inflateZlib,v as importLegacySessionRecordV1,_ as hkdf,k as hasLogger,x as getWasmMemoryBytes,S as getWasmAllocationSnapshot,g as getPublicFromPrivateKey,f as getEnabledFeatures,b as generateKeyPair,y as encodeSessionRecordComponents,O as encodeServerAckWireBatch,w as encodeSenderKeyRecordComponents,L as encodeReceiptWireBatch,N as encodeProto,G as encodeMessageWireBatch,Y as encodeEventWireEnvelope,u as decryptPollVotePayload,c as decryptPollVote,h as decryptEventResponsePayload,m as decodeSessionRecordComponents,K as decodeServerAckWireBatch,l as decodeSenderKeyRecordComponents,J as decodeReceiptWireBatch,V as decodeProtoBatch,R as decodeProto,E as decodeMessageWireBatch,X as decodeEventWireEnvelope,ee as createWhatsAppClient,p as calculateSignature,d as calculateAgreement,n as beginWasmAllocationProfile,a as aesGcm256Encrypt,r as aesGcm256Decrypt,i as WasmWhatsAppClient,I as UnpairedSurrogateError,j as MESSAGE_WIRE_INFO_RECORD_WIDTH,H as InvalidUtf8CountingReader,U as EVENT_SEGMENT_KIND_SERVER_ACK,Q as EVENT_SEGMENT_KIND_RECEIPT,P as EVENT_SEGMENT_KIND_MESSAGE,C as BinaryReader};
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{A as g,B as u,C as S,D as q,E as _,F as c,G as h,H as l,I as m,J as o,K as y,L as d,M as p,N as w,O as i,P as n,Q as r,R as a,S as t,T as e,U as s,V as qq,W as vq,X as zq,Y as Aq,Z as Cq,a as H,b as I,c as J,d as K,e as L,f as M,g as N,h as O,i as P,j as Q,k as R,l as T,m as V,n as W,o as X,p as Y,q as Z,r as $,s as b,t as j,u as k,v as x,w as B,x as F,y as U,z as f}from"./bridge.js";import{readFileSync as v}from"node:fs";var z=new URL("whatsapp_rust_bridge_bg.wasm",import.meta.url),A=v(z);q({module:A});export{S as verifySignature,u as updateLogger,g as setLogger,zq as proto,f as projectLegacySessionRecordV1,U as md5,c as longToBigInt,F as logMessage,Aq as initWasmEngine,q as initSync,B as inflateZlib,x as importLegacySessionRecordV1,k as hkdf,j as hasLogger,b as getWasmMemoryBytes,$ as getWasmAllocationSnapshot,Z as getPublicFromPrivateKey,Y as getEnabledFeatures,X as generateKeyPair,W as encodeSessionRecordComponents,a as encodeServerAckWireBatch,V as encodeSenderKeyRecordComponents,r as encodeReceiptWireBatch,m as encodeProto,w as encodeMessageWireBatch,vq as encodeEventWireEnvelope,T as decryptPollVotePayload,R as decryptPollVote,Q as decryptEventResponsePayload,P as decodeSessionRecordComponents,n as decodeServerAckWireBatch,O as decodeSenderKeyRecordComponents,i as decodeReceiptWireBatch,y as decodeProtoBatch,o as decodeProto,p as decodeMessageWireBatch,qq as decodeEventWireEnvelope,Cq as createWhatsAppClient,N as calculateSignature,M as calculateAgreement,L as beginWasmAllocationProfile,K as WasmWhatsAppClient,_ as UnpairedSurrogateError,d as MESSAGE_WIRE_INFO_RECORD_WIDTH,l as InvalidUtf8CountingReader,J as IntoUnderlyingSource,I as IntoUnderlyingSink,H as IntoUnderlyingByteSource,s as EVENT_SEGMENT_KIND_SERVER_ACK,e as EVENT_SEGMENT_KIND_RECEIPT,t as EVENT_SEGMENT_KIND_MESSAGE,h as BinaryReader};
1
+ import{A as g,B as u,C as S,D as q,E as _,F as c,G as h,H as l,I as m,J as o,K as y,L as d,M as p,N as w,O as i,P as n,Q as r,R as a,S as t,T as e,U as s,V as qq,W as vq,X as zq,Y as Aq,Z as Cq,a as H,b as I,c as J,d as K,e as L,f as M,g as N,h as O,i as P,j as Q,k as R,l as T,m as V,n as W,o as X,p as Y,q as Z,r as $,s as b,t as j,u as k,v as x,w as B,x as F,y as U,z as f}from"./bridge.js";import{readFileSync as v}from"node:fs";var z=new URL("whatsapp_rust_bridge_bg.wasm",import.meta.url),A=v(z);q({module:A});export{S as verifySignature,u as updateLogger,g as sha256,f as setLogger,zq as proto,U as projectLegacySessionRecordV1,F as md5,c as longToBigInt,B as logMessage,Aq as initWasmEngine,q as initSync,x as inflateZlib,k as importLegacySessionRecordV1,j as hkdf,b as hasLogger,$ as getWasmMemoryBytes,Z as getWasmAllocationSnapshot,Y as getPublicFromPrivateKey,X as getEnabledFeatures,W as generateKeyPair,V as encodeSessionRecordComponents,a as encodeServerAckWireBatch,T as encodeSenderKeyRecordComponents,r as encodeReceiptWireBatch,m as encodeProto,w as encodeMessageWireBatch,vq as encodeEventWireEnvelope,R as decryptPollVotePayload,Q as decryptPollVote,P as decryptEventResponsePayload,O as decodeSessionRecordComponents,n as decodeServerAckWireBatch,N as decodeSenderKeyRecordComponents,i as decodeReceiptWireBatch,y as decodeProtoBatch,o as decodeProto,p as decodeMessageWireBatch,qq as decodeEventWireEnvelope,Cq as createWhatsAppClient,M as calculateSignature,L as calculateAgreement,K as beginWasmAllocationProfile,J as aesGcm256Encrypt,I as aesGcm256Decrypt,H as WasmWhatsAppClient,_ as UnpairedSurrogateError,d as MESSAGE_WIRE_INFO_RECORD_WIDTH,l as InvalidUtf8CountingReader,s as EVENT_SEGMENT_KIND_SERVER_ACK,e as EVENT_SEGMENT_KIND_RECEIPT,t as EVENT_SEGMENT_KIND_MESSAGE,h as BinaryReader};
package/dist/surface.d.ts CHANGED
@@ -14,4 +14,9 @@ export { proto } from "./proto-namespace.js";
14
14
  import type { WhatsAppEventHandler, JsTransportCallbacks, JsHttpClientConfig, JsStoreCallbacks, CacheConfig, ClientPolicies } from "./whatsapp_rust_bridge.js";
15
15
  import type { WasmWhatsAppClient } from "./whatsapp_rust_bridge.js";
16
16
  export declare const initWasmEngine: (logger?: any, crypto?: any) => void;
17
+ /**
18
+ * The factory promise is the initialization barrier. Once it resolves,
19
+ * persistence, adapters, and the core client are ready; it does not imply a
20
+ * socket, authentication, a started run loop, or completed history sync.
21
+ */
17
22
  export declare const createWhatsAppClient: (transport: JsTransportCallbacks, httpClient: JsHttpClientConfig, onEvent?: WhatsAppEventHandler | null, store?: JsStoreCallbacks | null, cache?: CacheConfig | null, version?: readonly [number, number, number] | null, wantedPreKeyCount?: number | null, dangerSkipCertChainVerify?: boolean | null, policies?: ClientPolicies | null) => Promise<WasmWhatsAppClient>;
@@ -2049,9 +2049,10 @@ export interface CacheConfig {
2049
2049
  messageRetry?: CacheEntryConfig;
2050
2050
  }
2051
2051
 
2052
- // Augment WasmWhatsAppClient with methods that need skip_typescript
2053
- // (Record returns can't be expressed by wasm-bindgen)
2054
- interface WasmWhatsAppClient {
2052
+ // Augment the exported class with methods that need skip_typescript
2053
+ // (Record returns can't be expressed by wasm-bindgen). The declaration
2054
+ // must also be exported for TypeScript to merge it with the generated class.
2055
+ export interface WasmWhatsAppClient {
2055
2056
  /** Fetch all groups the user is participating in. */
2056
2057
  groupFetchAllParticipating(): Promise<Record<string, GroupMetadataResult>>;
2057
2058
  /** Fetch all parent groups the user is participating in. */
@@ -3612,7 +3613,7 @@ export type WhatsAppEvent =
3612
3613
 
3613
3614
 
3614
3615
 
3615
- export class IntoUnderlyingByteSource {
3616
+ declare class IntoUnderlyingByteSource {
3616
3617
  private constructor();
3617
3618
  free(): void;
3618
3619
  [Symbol.dispose](): void;
@@ -3622,8 +3623,9 @@ export class IntoUnderlyingByteSource {
3622
3623
  readonly autoAllocateChunkSize: number;
3623
3624
  readonly type: ReadableStreamType;
3624
3625
  }
3626
+ export type { IntoUnderlyingByteSource };
3625
3627
 
3626
- export class IntoUnderlyingSink {
3628
+ declare class IntoUnderlyingSink {
3627
3629
  private constructor();
3628
3630
  free(): void;
3629
3631
  [Symbol.dispose](): void;
@@ -3631,14 +3633,16 @@ export class IntoUnderlyingSink {
3631
3633
  close(): Promise<any>;
3632
3634
  write(chunk: any): Promise<any>;
3633
3635
  }
3636
+ export type { IntoUnderlyingSink };
3634
3637
 
3635
- export class IntoUnderlyingSource {
3638
+ declare class IntoUnderlyingSource {
3636
3639
  private constructor();
3637
3640
  free(): void;
3638
3641
  [Symbol.dispose](): void;
3639
3642
  cancel(): void;
3640
3643
  pull(controller: ReadableStreamDefaultController): Promise<any>;
3641
3644
  }
3645
+ export type { IntoUnderlyingSource };
3642
3646
 
3643
3647
  /**
3644
3648
  * Opaque handle to the WhatsApp client.
@@ -3707,14 +3711,14 @@ export class WasmWhatsAppClient {
3707
3711
  * would ever fire and every request would time out.
3708
3712
  */
3709
3713
  connect(): Promise<void>;
3710
- /**
3711
- * Create a parent group with explicit protocol options.
3712
- */
3713
- createCommunity(name: string, description: string | null | undefined, closed: boolean, allow_non_admin_sub_group_creation: boolean, create_general_chat: boolean): Promise<GroupMetadataResult>;
3714
3714
  /**
3715
3715
  * Create a subgroup already linked to a parent group.
3716
3716
  */
3717
3717
  createCommunitySubgroup(name: string, participants: string[], parent_jid: string): Promise<GroupMetadataResult>;
3718
+ /**
3719
+ * Create a parent group with explicit protocol options.
3720
+ */
3721
+ createCommunity(name: string, description: string | null | undefined, closed: boolean, allow_non_admin_sub_group_creation: boolean, create_general_chat: boolean): Promise<GroupMetadataResult>;
3718
3722
  /**
3719
3723
  * Create a new group.
3720
3724
  *
@@ -3776,13 +3780,6 @@ export class WasmWhatsAppClient {
3776
3780
  * wait is cancelled so the two teardown operations cannot wait on each other.
3777
3781
  */
3778
3782
  disconnect(): Promise<void>;
3779
- /**
3780
- * Download and decrypt media from raw parameters.
3781
- *
3782
- * Handles CDN failover, auth refresh, HMAC-SHA256 verification, and
3783
- * AES-256-CBC decryption internally. Returns decrypted media bytes.
3784
- */
3785
- downloadMedia(direct_path: string, media_key: Uint8Array, file_sha256: Uint8Array, file_enc_sha256: Uint8Array, file_length: number, media_type: MediaType): Promise<Uint8Array>;
3786
3783
  /**
3787
3784
  * Download, decrypt, and return a Web ReadableStream of decrypted chunks.
3788
3785
  *
@@ -3795,6 +3792,13 @@ export class WasmWhatsAppClient {
3795
3792
  * `Readable.fromWeb(stream)`.
3796
3793
  */
3797
3794
  downloadMediaStream(direct_path: string, media_key: Uint8Array, file_sha256: Uint8Array, file_enc_sha256: Uint8Array, file_length: number, media_type: MediaType): ReadableStream;
3795
+ /**
3796
+ * Download and decrypt media from raw parameters.
3797
+ *
3798
+ * Handles CDN failover, auth refresh, HMAC-SHA256 verification, and
3799
+ * AES-256-CBC decryption internally. Returns decrypted media bytes.
3800
+ */
3801
+ downloadMedia(direct_path: string, media_key: Uint8Array, file_sha256: Uint8Array, file_enc_sha256: Uint8Array, file_length: number, media_type: MediaType): Promise<Uint8Array>;
3798
3802
  /**
3799
3803
  * Edit a previously sent message from protobuf bytes.
3800
3804
  *
@@ -3962,14 +3966,14 @@ export class WasmWhatsAppClient {
3962
3966
  * so the core leaves those two MEX operations unwrapped.
3963
3967
  */
3964
3968
  getUsername(): Promise<OwnUsernameResult | undefined>;
3965
- /**
3966
- * Join a group using an invite code.
3967
- */
3968
- groupAcceptInvite(code: string): Promise<string>;
3969
3969
  /**
3970
3970
  * Join a group via a GroupInviteMessage (V4 invite).
3971
3971
  */
3972
3972
  groupAcceptInviteV4(group_jid: string, code: string, expiration: number, admin_jid: string): Promise<string>;
3973
+ /**
3974
+ * Join a group using an invite code.
3975
+ */
3976
+ groupAcceptInvite(code: string): Promise<string>;
3973
3977
  /**
3974
3978
  * Get group info from an invite code (without joining).
3975
3979
  * Returns the same shape as groupMetadata.
@@ -3999,14 +4003,14 @@ export class WasmWhatsAppClient {
3999
4003
  * Approve or reject pending join requests.
4000
4004
  */
4001
4005
  groupRequestParticipantsUpdate(jid: string, participants: string[], action: GroupRequestAction): Promise<ParticipantChangeResult[]>;
4002
- /**
4003
- * Revoke a group's invite link (generates new one).
4004
- */
4005
- groupRevokeInvite(jid: string): Promise<string>;
4006
4006
  /**
4007
4007
  * Revoke invitation codes previously issued to participants.
4008
4008
  */
4009
4009
  groupRevokeInviteV4(group_jid: string, invited_jid: string): Promise<boolean>;
4010
+ /**
4011
+ * Revoke a group's invite link (generates new one).
4012
+ */
4013
+ groupRevokeInvite(jid: string): Promise<string>;
4010
4014
  /**
4011
4015
  * Update a group setting (locked, announce, membership_approval).
4012
4016
  */
@@ -4147,14 +4151,14 @@ export class WasmWhatsAppClient {
4147
4151
  * a u64. Omit it for the newest page.
4148
4152
  */
4149
4153
  newsletterMessages(jid: string, count: number, before?: string | null): Promise<NewsletterMessageResult[]>;
4150
- /**
4151
- * Fetch metadata for a newsletter by JID.
4152
- */
4153
- newsletterMetadata(jid: string): Promise<NewsletterMetadataResult>;
4154
4154
  /**
4155
4155
  * Fetch a newsletter's metadata by its invite code.
4156
4156
  */
4157
4157
  newsletterMetadataByInvite(invite_code: string): Promise<NewsletterMetadataResult>;
4158
+ /**
4159
+ * Fetch metadata for a newsletter by JID.
4160
+ */
4161
+ newsletterMetadata(jid: string): Promise<NewsletterMetadataResult>;
4158
4162
  /**
4159
4163
  * Mute or unmute a newsletter's follower-activity notifications — the channel
4160
4164
  * mute a subscriber toggles (WA Web `MUTE_FOLLOWER_ACTIVITY`). `muted = true`
@@ -4187,15 +4191,15 @@ export class WasmWhatsAppClient {
4187
4191
  * refreshed metadata.
4188
4192
  */
4189
4193
  newsletterSetPicture(jid: string, jpeg: Uint8Array): Promise<NewsletterMetadataResult>;
4190
- /**
4191
- * Subscribe (join) a newsletter.
4192
- */
4193
- newsletterSubscribe(jid: string): Promise<NewsletterMetadataResult>;
4194
4194
  /**
4195
4195
  * Subscribe to a newsletter's live updates. Returns the subscription
4196
4196
  * duration in seconds, as the server set it.
4197
4197
  */
4198
4198
  newsletterSubscribeLiveUpdates(jid: string): Promise<number>;
4199
+ /**
4200
+ * Subscribe (join) a newsletter.
4201
+ */
4202
+ newsletterSubscribe(jid: string): Promise<NewsletterMetadataResult>;
4199
4203
  /**
4200
4204
  * Unsubscribe (leave) a newsletter.
4201
4205
  */
@@ -4279,10 +4283,6 @@ export class WasmWhatsAppClient {
4279
4283
  * Reject an inbound stanza through the core-owned acknowledgement path.
4280
4284
  */
4281
4285
  rejectStanza(stanza_js: BinaryNode, error_code: number, failure_reason?: number | null): Promise<void>;
4282
- /**
4283
- * Low-level message relay from protobuf binary bytes.
4284
- */
4285
- relayMessageBytes(jid: string, bytes: Uint8Array, message_id?: string | null): Promise<string>;
4286
4286
  /**
4287
4287
  * Send an E2E message with neutral core-owned controls.
4288
4288
  *
@@ -4290,6 +4290,10 @@ export class WasmWhatsAppClient {
4290
4290
  * encryption and reserved-node validation remain owned by the core.
4291
4291
  */
4292
4292
  relayMessageBytesWithOptions(jid: string, bytes: Uint8Array, message_id: string | null | undefined, extra_nodes: BinaryNode[], refresh_group_metadata: boolean, refresh_devices: boolean): Promise<string>;
4293
+ /**
4294
+ * Low-level message relay from protobuf binary bytes.
4295
+ */
4296
+ relayMessageBytes(jid: string, bytes: Uint8Array, message_id?: string | null): Promise<string>;
4293
4297
  /**
4294
4298
  * Remove the business profile's cover photo, by the `fbid` it was set with.
4295
4299
  */
@@ -4410,16 +4414,16 @@ export class WasmWhatsAppClient {
4410
4414
  * JS-built `reactionMessage` proto. Returns the reaction's message id.
4411
4415
  */
4412
4416
  sendReaction(jid: string, key: TargetMessageKey, emoji?: string | null): Promise<string>;
4413
- /**
4414
- * Send a status/story message to specified recipients.
4415
- * Use `encodeProto('Message', obj)` on the JS side to produce the bytes.
4416
- */
4417
- sendStatusMessageBytes(bytes: Uint8Array, recipients: string[]): Promise<string>;
4418
4417
  /**
4419
4418
  * Send a status message with a caller-provided ID, neutral child nodes and
4420
4419
  * an explicit recipient-device freshness policy.
4421
4420
  */
4422
4421
  sendStatusMessageBytesWithOptions(bytes: Uint8Array, recipients: string[], message_id: string | null | undefined, extra_nodes: BinaryNode[], refresh_devices: boolean): Promise<string>;
4422
+ /**
4423
+ * Send a status/story message to specified recipients.
4424
+ * Use `encodeProto('Message', obj)` on the JS side to produce the bytes.
4425
+ */
4426
+ sendStatusMessageBytes(bytes: Uint8Array, recipients: string[]): Promise<string>;
4423
4427
  /**
4424
4428
  * Enable or disable automatic reconnection on disconnect.
4425
4429
  * Enabled by default. When disabled, the client will not attempt
@@ -4710,6 +4714,17 @@ export class WasmWhatsAppClient {
4710
4714
  withdrawParkedCalls(): number;
4711
4715
  }
4712
4716
 
4717
+ /**
4718
+ * Decrypt bytes returned by [`aes_gcm_256_encrypt`].
4719
+ */
4720
+ export function aesGcm256Decrypt(key: Uint8Array, nonce: Uint8Array, aad: Uint8Array, ciphertext_with_tag: Uint8Array): Uint8Array;
4721
+
4722
+ /**
4723
+ * Encrypt with the active signal crypto provider. The returned bytes are
4724
+ * `ciphertext || authentication tag`.
4725
+ */
4726
+ export function aesGcm256Encrypt(key: Uint8Array, nonce: Uint8Array, aad: Uint8Array, plaintext: Uint8Array): Uint8Array;
4727
+
4713
4728
  /**
4714
4729
  * Start a new peak-observation window without disturbing live/cumulative
4715
4730
  * counters. The benchmark harness calls this immediately before constructing
@@ -4783,6 +4798,11 @@ export function projectLegacySessionRecordV1(bytes: Uint8Array): LegacySessionPr
4783
4798
 
4784
4799
  export function setLogger(logger: ILogger): void;
4785
4800
 
4801
+ /**
4802
+ * Hash arbitrary bytes with SHA-256.
4803
+ */
4804
+ export function sha256(input: Uint8Array): Uint8Array;
4805
+
4786
4806
  export function updateLogger(logger: ILogger): void;
4787
4807
 
4788
4808
  export function verifySignature(public_key: Uint8Array, message: Uint8Array, signature: Uint8Array): boolean;
@@ -4791,7 +4811,12 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
4791
4811
 
4792
4812
  export interface InitOutput {
4793
4813
  readonly memory: WebAssembly.Memory;
4814
+ readonly __wbg_intounderlyingbytesource_free: (a: number, b: number) => void;
4815
+ readonly __wbg_intounderlyingsink_free: (a: number, b: number) => void;
4816
+ readonly __wbg_intounderlyingsource_free: (a: number, b: number) => void;
4794
4817
  readonly __wbg_wasmwhatsappclient_free: (a: number, b: number) => void;
4818
+ readonly aesGcm256Decrypt: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
4819
+ readonly aesGcm256Encrypt: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => void;
4795
4820
  readonly beginWasmAllocationProfile: () => void;
4796
4821
  readonly calculateAgreement: (a: number, b: number, c: number, d: number, e: number) => void;
4797
4822
  readonly calculateSignature: (a: number, b: number, c: number, d: number, e: number) => void;
@@ -4807,15 +4832,27 @@ export interface InitOutput {
4807
4832
  readonly getEnabledFeatures: (a: number) => void;
4808
4833
  readonly getPublicFromPrivateKey: (a: number, b: number, c: number) => void;
4809
4834
  readonly getWasmAllocationSnapshot: (a: number) => void;
4835
+ readonly getWasmMemoryBytes: () => number;
4810
4836
  readonly hasLogger: () => number;
4811
4837
  readonly hkdf: (a: number, b: number, c: number, d: number, e: number) => void;
4812
4838
  readonly importLegacySessionRecordV1: (a: number, b: number, c: number) => void;
4813
4839
  readonly inflateZlib: (a: number, b: number, c: number, d: number, e: number) => void;
4814
4840
  readonly initWasmEngine: (a: number, b: number) => void;
4841
+ readonly intounderlyingbytesource_autoAllocateChunkSize: (a: number) => number;
4842
+ readonly intounderlyingbytesource_cancel: (a: number) => void;
4843
+ readonly intounderlyingbytesource_pull: (a: number, b: number) => number;
4844
+ readonly intounderlyingbytesource_start: (a: number, b: number) => void;
4845
+ readonly intounderlyingbytesource_type: (a: number) => number;
4846
+ readonly intounderlyingsink_abort: (a: number, b: number) => number;
4847
+ readonly intounderlyingsink_close: (a: number) => number;
4848
+ readonly intounderlyingsink_write: (a: number, b: number) => number;
4849
+ readonly intounderlyingsource_cancel: (a: number) => void;
4850
+ readonly intounderlyingsource_pull: (a: number, b: number) => number;
4815
4851
  readonly logMessage: (a: number, b: number, c: number, d: number) => void;
4816
4852
  readonly md5: (a: number, b: number) => number;
4817
4853
  readonly projectLegacySessionRecordV1: (a: number, b: number, c: number) => void;
4818
4854
  readonly setLogger: (a: number, b: number) => void;
4855
+ readonly sha256: (a: number, b: number, c: number) => void;
4819
4856
  readonly updateLogger: (a: number) => void;
4820
4857
  readonly verifySignature: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
4821
4858
  readonly wasmwhatsappclient_acknowledgeStanza: (a: number, b: number) => number;
@@ -4997,26 +5034,12 @@ export interface InitOutput {
4997
5034
  readonly wasmwhatsappclient_waitForSocket: (a: number, b: number) => number;
4998
5035
  readonly wasmwhatsappclient_waitUntilReachable: (a: number) => number;
4999
5036
  readonly wasmwhatsappclient_withdrawParkedCalls: (a: number) => number;
5000
- readonly getWasmMemoryBytes: () => number;
5001
- readonly __wbg_intounderlyingbytesource_free: (a: number, b: number) => void;
5002
- readonly __wbg_intounderlyingsink_free: (a: number, b: number) => void;
5003
- readonly __wbg_intounderlyingsource_free: (a: number, b: number) => void;
5004
- readonly intounderlyingbytesource_autoAllocateChunkSize: (a: number) => number;
5005
- readonly intounderlyingbytesource_cancel: (a: number) => void;
5006
- readonly intounderlyingbytesource_pull: (a: number, b: number) => number;
5007
- readonly intounderlyingbytesource_start: (a: number, b: number) => void;
5008
- readonly intounderlyingbytesource_type: (a: number) => number;
5009
- readonly intounderlyingsink_abort: (a: number, b: number) => number;
5010
- readonly intounderlyingsink_close: (a: number) => number;
5011
- readonly intounderlyingsink_write: (a: number, b: number) => number;
5012
- readonly intounderlyingsource_cancel: (a: number) => void;
5013
- readonly intounderlyingsource_pull: (a: number, b: number) => number;
5014
- readonly __wasm_bindgen_func_elem_4655: (a: number, b: number, c: number) => void;
5015
- readonly __wasm_bindgen_func_elem_28615: (a: number, b: number, c: number, d: number) => void;
5016
- readonly __wasm_bindgen_func_elem_28617: (a: number, b: number, c: number, d: number) => void;
5017
- readonly __wasm_bindgen_func_elem_9885: (a: number, b: number, c: number) => void;
5018
- readonly __wasm_bindgen_func_elem_4654: (a: number, b: number, c: number) => void;
5019
- readonly __wasm_bindgen_func_elem_4653: (a: number, b: number) => void;
5037
+ readonly __wasm_bindgen_func_elem_4843: (a: number, b: number, c: number) => void;
5038
+ readonly __wasm_bindgen_func_elem_28828: (a: number, b: number, c: number, d: number) => void;
5039
+ readonly __wasm_bindgen_func_elem_28830: (a: number, b: number, c: number, d: number) => void;
5040
+ readonly __wasm_bindgen_func_elem_10088: (a: number, b: number, c: number) => void;
5041
+ readonly __wasm_bindgen_func_elem_4842: (a: number, b: number, c: number) => void;
5042
+ readonly __wasm_bindgen_func_elem_4841: (a: number, b: number) => void;
5020
5043
  readonly __wbindgen_export: (a: number, b: number) => number;
5021
5044
  readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
5022
5045
  readonly __wbindgen_export3: (a: number) => void;
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxidezap/whatsapp-rust-bridge",
3
- "version": "0.23.1",
3
+ "version": "0.24.1",
4
4
  "description": "A high-performance utilities for WhatsApp, powered by Rust and WebAssembly.",
5
5
  "author": "João Lucas <jlucaso@hotmail.com>",
6
6
  "license": "MIT",
@@ -38,6 +38,7 @@
38
38
  "scripts": {
39
39
  "bench": "bun run build && bun run benches/binary.ts && bun run benches/signal.ts && bun run benches/curve.ts && bun run benches/crypto.ts",
40
40
  "bench:node": "bun run build && node --expose-gc benches/binary.ts && node --expose-gc benches/signal.ts && node --expose-gc benches/curve.ts && node --expose-gc benches/crypto.ts",
41
+ "bench:crypto": "bun run benches/crypto.ts",
41
42
  "bench:proto": "bun run benches/proto-encode.ts",
42
43
  "bench:wire": "bun run benches/wire-batch-decode.ts",
43
44
  "bench:wire:message": "bun run benches/message-wire-batch.ts",
@@ -69,8 +70,10 @@
69
70
  "prepack": "bun run scripts/check-pack.ts",
70
71
  "prepublishOnly": "bun run build"
71
72
  },
73
+ "dependencies": {
74
+ "@bufbuild/protobuf": "^2.14.1"
75
+ },
72
76
  "devDependencies": {
73
- "@bufbuild/protobuf": "^2.14.1",
74
77
  "@types/bun": "^1.3.13",
75
78
  "@types/node": "^25.6.0",
76
79
  "pkg-pr-new": "^0.0.88",