@oxidezap/whatsapp-rust-bridge 0.6.4 → 0.7.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.
Binary file
@@ -105,3 +105,21 @@ export declare function decodeServerAckWireBatch(batch: PackedWireBatch): Server
105
105
  export declare function encodeReceiptWireBatch(receipts: readonly ReceiptWireData[]): PackedWireBatch;
106
106
  /** Inverse of `decodeServerAckWireBatch`, for tests and replay tooling. */
107
107
  export declare function encodeServerAckWireBatch(acks: readonly ServerAckWireData[]): PackedWireBatch;
108
+ /** Segment tags, mirroring the Rust writer in `src/wire_batch.rs`. */
109
+ export declare const EVENT_SEGMENT_KIND_MESSAGE = 1;
110
+ export declare const EVENT_SEGMENT_KIND_RECEIPT = 2;
111
+ export declare const EVENT_SEGMENT_KIND_SERVER_ACK = 3;
112
+ /** One packed batch inside an envelope. */
113
+ export interface EventWireSegment {
114
+ /** One of the `EVENT_SEGMENT_KIND_*` tags; names the codec for `batch`. */
115
+ kind: number;
116
+ /** Exactly the bytes the segment's own callback would have received. */
117
+ batch: PackedWireBatch;
118
+ }
119
+ /**
120
+ * Split an envelope into its segments, in the order the events arrived. Decode
121
+ * each with the codec its kind names and deliver them in that order.
122
+ */
123
+ export declare function decodeEventWireEnvelope(envelope: Uint8Array): EventWireSegment[];
124
+ /** Inverse of `decodeEventWireEnvelope`, for tests and replay tooling. */
125
+ export declare function encodeEventWireEnvelope(segments: readonly EventWireSegment[]): Uint8Array;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxidezap/whatsapp-rust-bridge",
3
- "version": "0.6.4",
3
+ "version": "0.7.0",
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",
@@ -45,6 +45,7 @@
45
45
  "bump:wacore": "cargo update -p whatsapp-rust && bun run build",
46
46
  "example": "NODE_TLS_REJECT_UNAUTHORIZED=0 bun run examples/connect.ts",
47
47
  "test:rust": "wasm-pack test --node",
48
+ "check:size": "bun run scripts/check-size.ts",
48
49
  "prepack": "bun run scripts/check-pack.ts",
49
50
  "prepublishOnly": "bun run build"
50
51
  },