@xbibzlibrary/whatsbibz 1.3.2 → 1.4.3
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 +31 -1
- package/README.cn.md +604 -0
- package/README.id.md +237 -7
- package/README.md +237 -7
- package/WAProto/WAProto.proto +1 -0
- package/WAProto/index.d.ts +1 -0
- package/WAProto/index.js +1 -0
- package/assets/logo/README.md +11 -13
- package/assets/logo/preview.png +0 -0
- package/lib/BibzWhats/banner.d.ts +32 -0
- package/lib/BibzWhats/banner.js +121 -0
- package/lib/BibzWhats/client.d.ts +8 -1
- package/lib/BibzWhats/client.js +13 -0
- package/lib/BibzWhats/device-identity.d.ts +1 -0
- package/lib/BibzWhats/device-identity.js +1 -0
- package/lib/BibzWhats/extract.d.ts +1 -0
- package/lib/BibzWhats/extract.js +1 -0
- package/lib/BibzWhats/index.d.ts +2 -0
- package/lib/BibzWhats/index.js +2 -0
- package/lib/BibzWhats/jid.d.ts +1 -0
- package/lib/BibzWhats/jid.js +1 -0
- package/lib/BibzWhats/pairing.d.ts +1 -0
- package/lib/BibzWhats/pairing.js +1 -0
- package/lib/BibzWhats/send.d.ts +1 -0
- package/lib/BibzWhats/send.js +1 -0
- package/lib/BibzWhats/version.js +5 -4
- package/lib/Defaults/index.d.ts +3 -0
- package/lib/Defaults/index.js +4 -6
- package/lib/Modded/message_builder.d.ts +1 -0
- package/lib/Modded/message_builder.js +36 -43
- package/lib/Signal/Group/ciphertext-message.d.ts +1 -0
- package/lib/Signal/Group/ciphertext-message.js +1 -0
- package/lib/Signal/Group/group-session-builder.d.ts +1 -0
- package/lib/Signal/Group/group-session-builder.js +1 -0
- package/lib/Signal/Group/group_cipher.d.ts +1 -0
- package/lib/Signal/Group/group_cipher.js +1 -0
- package/lib/Signal/Group/index.d.ts +1 -0
- package/lib/Signal/Group/index.js +1 -0
- package/lib/Signal/Group/keyhelper.d.ts +1 -0
- package/lib/Signal/Group/keyhelper.js +1 -0
- package/lib/Signal/Group/sender-chain-key.d.ts +1 -0
- package/lib/Signal/Group/sender-chain-key.js +1 -0
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +1 -0
- package/lib/Signal/Group/sender-key-distribution-message.js +1 -0
- package/lib/Signal/Group/sender-key-message.d.ts +1 -0
- package/lib/Signal/Group/sender-key-message.js +1 -0
- package/lib/Signal/Group/sender-key-name.d.ts +1 -0
- package/lib/Signal/Group/sender-key-name.js +1 -0
- package/lib/Signal/Group/sender-key-record.d.ts +1 -0
- package/lib/Signal/Group/sender-key-record.js +1 -0
- package/lib/Signal/Group/sender-key-state.d.ts +1 -0
- package/lib/Signal/Group/sender-key-state.js +1 -0
- package/lib/Signal/Group/sender-message-key.d.ts +1 -0
- package/lib/Signal/Group/sender-message-key.js +1 -0
- package/lib/Signal/libsignal.d.ts +1 -0
- package/lib/Signal/libsignal.js +1 -0
- package/lib/Signal/lid-mapping.d.ts +1 -0
- package/lib/Signal/lid-mapping.js +1 -0
- package/lib/Socket/Client/index.d.ts +1 -0
- package/lib/Socket/Client/index.js +1 -0
- package/lib/Socket/Client/types.d.ts +1 -0
- package/lib/Socket/Client/types.js +1 -0
- package/lib/Socket/Client/websocket.d.ts +1 -0
- package/lib/Socket/Client/websocket.js +1 -0
- package/lib/Socket/business.d.ts +1 -2
- package/lib/Socket/business.js +1 -0
- package/lib/Socket/chats.d.ts +1 -0
- package/lib/Socket/chats.js +1 -0
- package/lib/Socket/communities.d.ts +1 -2
- package/lib/Socket/communities.js +12 -2
- package/lib/Socket/engine.d.ts +1 -0
- package/lib/Socket/engine.js +1 -0
- package/lib/Socket/groups.d.ts +1 -0
- package/lib/Socket/groups.js +1 -0
- package/lib/Socket/index.d.ts +1 -2
- package/lib/Socket/index.js +12 -11
- package/lib/Socket/messages-recv.d.ts +1 -2
- package/lib/Socket/messages-recv.js +13 -4
- package/lib/Socket/messages-send.d.ts +7 -2
- package/lib/Socket/messages-send.js +59 -23
- package/lib/Socket/mex.d.ts +1 -0
- package/lib/Socket/mex.js +1 -0
- package/lib/Socket/newsletter.d.ts +1 -1
- package/lib/Socket/newsletter.js +255 -432
- package/lib/Socket/socket.d.ts +1 -0
- package/lib/Socket/socket.js +20 -1
- package/lib/Types/Auth.d.ts +2 -0
- package/lib/Types/Auth.js +1 -0
- package/lib/Types/Bussines.d.ts +1 -0
- package/lib/Types/Bussines.js +1 -0
- package/lib/Types/Call.d.ts +1 -0
- package/lib/Types/Call.js +1 -0
- package/lib/Types/Chat.d.ts +1 -0
- package/lib/Types/Chat.js +1 -0
- package/lib/Types/Contact.d.ts +1 -0
- package/lib/Types/Contact.js +1 -0
- package/lib/Types/Events.d.ts +1 -0
- package/lib/Types/Events.js +1 -0
- package/lib/Types/GroupMetadata.d.ts +1 -0
- package/lib/Types/GroupMetadata.js +1 -0
- package/lib/Types/Label.d.ts +1 -0
- package/lib/Types/Label.js +1 -0
- package/lib/Types/LabelAssociation.d.ts +1 -0
- package/lib/Types/LabelAssociation.js +1 -0
- package/lib/Types/Message.d.ts +1 -0
- package/lib/Types/Message.js +1 -0
- package/lib/Types/Newsletter.d.ts +1 -0
- package/lib/Types/Newsletter.js +1 -0
- package/lib/Types/Product.d.ts +1 -0
- package/lib/Types/Product.js +1 -0
- package/lib/Types/Signal.d.ts +1 -0
- package/lib/Types/Signal.js +1 -0
- package/lib/Types/Socket.d.ts +1 -6
- package/lib/Types/Socket.js +1 -0
- package/lib/Types/State.d.ts +1 -0
- package/lib/Types/State.js +1 -0
- package/lib/Types/USync.d.ts +1 -0
- package/lib/Types/USync.js +1 -0
- package/lib/Types/index.d.ts +1 -0
- package/lib/Types/index.js +1 -0
- package/lib/Utils/auth-utils.d.ts +1 -0
- package/lib/Utils/auth-utils.js +4 -0
- package/lib/Utils/browser-utils.d.ts +1 -0
- package/lib/Utils/browser-utils.js +3 -2
- package/lib/Utils/business.d.ts +1 -0
- package/lib/Utils/business.js +1 -0
- package/lib/Utils/chat-utils.d.ts +1 -0
- package/lib/Utils/chat-utils.js +1 -0
- package/lib/Utils/companion-reg-client-utils.d.ts +1 -0
- package/lib/Utils/companion-reg-client-utils.js +1 -0
- package/lib/Utils/crypto.d.ts +1 -0
- package/lib/Utils/crypto.js +1 -0
- package/lib/Utils/decode-wa-message.d.ts +1 -0
- package/lib/Utils/decode-wa-message.js +1 -0
- package/lib/Utils/event-buffer.d.ts +1 -0
- package/lib/Utils/event-buffer.js +9 -0
- package/lib/Utils/generics.d.ts +1 -0
- package/lib/Utils/generics.js +2 -1
- package/lib/Utils/history.d.ts +1 -0
- package/lib/Utils/history.js +1 -0
- package/lib/Utils/identity-change-handler.d.ts +1 -0
- package/lib/Utils/identity-change-handler.js +1 -0
- package/lib/Utils/index.d.ts +1 -0
- package/lib/Utils/index.js +1 -0
- package/lib/Utils/link-preview.d.ts +1 -0
- package/lib/Utils/link-preview.js +1 -0
- package/lib/Utils/logger.d.ts +1 -0
- package/lib/Utils/logger.js +1 -0
- package/lib/Utils/lt-hash.d.ts +1 -0
- package/lib/Utils/lt-hash.js +1 -0
- package/lib/Utils/make-mutex.d.ts +1 -0
- package/lib/Utils/make-mutex.js +1 -0
- package/lib/Utils/message-retry-manager.d.ts +1 -0
- package/lib/Utils/message-retry-manager.js +1 -0
- package/lib/Utils/messages-media.d.ts +1 -0
- package/lib/Utils/messages-media.js +28 -92
- package/lib/Utils/messages.d.ts +5 -0
- package/lib/Utils/messages.js +50 -5
- package/lib/Utils/noise-handler.d.ts +1 -0
- package/lib/Utils/noise-handler.js +1 -0
- package/lib/Utils/offline-node-processor.d.ts +2 -0
- package/lib/Utils/offline-node-processor.js +6 -0
- package/lib/Utils/platform-identity.d.ts +1 -0
- package/lib/Utils/platform-identity.js +1 -0
- package/lib/Utils/pre-key-manager.d.ts +1 -0
- package/lib/Utils/pre-key-manager.js +1 -0
- package/lib/Utils/process-message.d.ts +1 -0
- package/lib/Utils/process-message.js +1 -0
- package/lib/Utils/reporting-utils.d.ts +1 -0
- package/lib/Utils/reporting-utils.js +1 -0
- package/lib/Utils/rich-messages.d.ts +1 -0
- package/lib/Utils/rich-messages.js +11 -0
- package/lib/Utils/signal.d.ts +1 -0
- package/lib/Utils/signal.js +1 -0
- package/lib/Utils/stanza-ack.d.ts +1 -0
- package/lib/Utils/stanza-ack.js +1 -0
- package/lib/Utils/sticker-pack.d.ts +1 -0
- package/lib/Utils/sticker-pack.js +1 -0
- package/lib/Utils/sync-action-utils.d.ts +1 -0
- package/lib/Utils/sync-action-utils.js +1 -0
- package/lib/Utils/tc-token-utils.d.ts +1 -0
- package/lib/Utils/tc-token-utils.js +1 -0
- package/lib/Utils/use-multi-file-auth-state.d.ts +1 -0
- package/lib/Utils/use-multi-file-auth-state.js +1 -0
- package/lib/Utils/validate-connection.d.ts +1 -0
- package/lib/Utils/validate-connection.js +1 -0
- package/lib/VoIP/audio-feeder.d.ts +1 -0
- package/lib/VoIP/audio-feeder.js +1 -0
- package/lib/VoIP/index.d.ts +1 -0
- package/lib/VoIP/index.js +1 -0
- package/lib/VoIP/relay-transport.d.ts +1 -0
- package/lib/VoIP/relay-transport.js +1 -0
- package/lib/VoIP/signaling.js +1 -0
- package/lib/VoIP/types.d.ts +1 -0
- package/lib/VoIP/types.js +1 -0
- package/lib/VoIP/wasm-engine.d.ts +1 -0
- package/lib/VoIP/wasm-engine.js +1 -0
- package/lib/VoIP/worker-bootstrap.js +2 -1
- package/lib/WABinary/constants.d.ts +1 -0
- package/lib/WABinary/constants.js +1 -0
- package/lib/WABinary/decode.d.ts +1 -0
- package/lib/WABinary/decode.js +1 -0
- package/lib/WABinary/encode.d.ts +1 -0
- package/lib/WABinary/encode.js +1 -0
- package/lib/WABinary/generic-utils.d.ts +1 -0
- package/lib/WABinary/generic-utils.js +1 -0
- package/lib/WABinary/index.d.ts +1 -0
- package/lib/WABinary/index.js +1 -0
- package/lib/WABinary/jid-utils.d.ts +1 -0
- package/lib/WABinary/jid-utils.js +1 -0
- package/lib/WABinary/types.d.ts +1 -0
- package/lib/WABinary/types.js +1 -0
- package/lib/WAM/BinaryInfo.d.ts +1 -0
- package/lib/WAM/BinaryInfo.js +1 -0
- package/lib/WAM/constants.d.ts +1 -0
- package/lib/WAM/constants.js +1 -0
- package/lib/WAM/encode.d.ts +1 -0
- package/lib/WAM/encode.js +1 -0
- package/lib/WAM/index.d.ts +1 -0
- package/lib/WAM/index.js +1 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +1 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +1 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +1 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +1 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +1 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +1 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +1 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +1 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +1 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +1 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +1 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +1 -0
- package/lib/WAUSync/Protocols/index.d.ts +1 -0
- package/lib/WAUSync/Protocols/index.js +1 -0
- package/lib/WAUSync/USyncQuery.d.ts +1 -0
- package/lib/WAUSync/USyncQuery.js +1 -0
- package/lib/WAUSync/USyncUser.d.ts +1 -0
- package/lib/WAUSync/USyncUser.js +1 -0
- package/lib/WAUSync/index.d.ts +1 -0
- package/lib/WAUSync/index.js +1 -0
- package/lib/assets/wasm/loader.js +1 -0
- package/lib/assets/wasm/worker-modules.js +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -1
- package/package.json +27 -9
- package/WAProto/GenerateStatics.sh +0 -3
- package/WAProto/fix-imports.js +0 -81
package/lib/WABinary/types.d.ts
CHANGED
package/lib/WABinary/types.js
CHANGED
package/lib/WAM/BinaryInfo.d.ts
CHANGED
package/lib/WAM/BinaryInfo.js
CHANGED
package/lib/WAM/constants.d.ts
CHANGED
package/lib/WAM/constants.js
CHANGED
package/lib/WAM/encode.d.ts
CHANGED
package/lib/WAM/encode.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @module @xbibzlibrary/whatsbibz/lib/WAM/encode */
|
|
1
2
|
import { BinaryInfo } from './BinaryInfo.js';
|
|
2
3
|
import { FLAG_BYTE, FLAG_EVENT, FLAG_EXTENDED, FLAG_FIELD, FLAG_GLOBAL, WEB_EVENTS, WEB_GLOBALS } from './constants.js';
|
|
3
4
|
const getHeaderBitLength = (key) => (key < 256 ? 2 : 3);
|
package/lib/WAM/index.d.ts
CHANGED
package/lib/WAM/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @module @xbibzlibrary/whatsbibz/lib/WAUSync/Protocols/UsyncBotProfileProtocol */
|
|
1
2
|
import { getBinaryNodeChild, getBinaryNodeChildren, getBinaryNodeChildString } from '../../WABinary/index.js';
|
|
2
3
|
import { USyncUser } from '../USyncUser.js';
|
|
3
4
|
export class USyncBotProfileProtocol {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @module @xbibzlibrary/whatsbibz/lib/WAUSync/USyncQuery */
|
|
1
2
|
import { getBinaryNodeChild } from '../WABinary/index.js';
|
|
2
3
|
import { USyncBotProfileProtocol } from './Protocols/UsyncBotProfileProtocol.js';
|
|
3
4
|
import { USyncLIDProtocol } from './Protocols/UsyncLIDProtocol.js';
|
package/lib/WAUSync/USyncUser.js
CHANGED
package/lib/WAUSync/index.d.ts
CHANGED
package/lib/WAUSync/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @module @xbibzlibrary/whatsbibz/lib/assets/wasm/loader */
|
|
1
2
|
;/*FB_PKG_DELIM*/
|
|
2
3
|
|
|
3
4
|
__d("flipperApi",[],(function(t,n,r,o,a,i){var e=(function(){function e(e,t,n){this.pluginId=e,this.methodId=t,this.$1=n}var t=e.prototype;return t.success=function(t){},t.error=function(t){},e})(),l=(function(){function t(e,t){this.pluginId=e,this.$1=t}var n=t.prototype;return n.send=function(t,n){this.$1.sendData(this.pluginId,t,n)},n.receive=function(n,r){var t=this;this.$1.subscribe(this.pluginId,n,function(o){r(o,new e(t.pluginId,n,t.$1))})},t})(),s=(function(){function e(e){this.id=e}var t=e.prototype;return t.onConnect=function(t){this.$1=t},t.onDisconnect=function(){this.$1=null},t.getConnection=function(){return this.$1},e})(),u=(function(){function e(e){this.$2=!1,this.plugins=new Map,this.$1=e,this.$1.setClient(this)}var t=e.prototype;return t.addPlugin=function(t){this.$2&&t.onConnect(new l(t.id,this.$1)),this.plugins.set(t.id,t)},t.getPlugin=function(t){return this.plugins.get(t)},t.onConnect=function(){var e=this;this.$2||(this.$2=!0,Array.from(this.plugins.values()).map(function(t){return t.onConnect(new l(t.id,e.$1))}))},t.onDisconnect=function(){this.$2=!1,Array.from(this.plugins.values()).map(function(e){return e.onDisconnect()})},t.start=function(t){this.$1.registerPlugins(Array.from(this.plugins.keys())),this.$1.start(t)},t.stop=function(){this.$1.stop()},e})();i.FlipperConnection=l,i.FlipperPlugin=s,i.FlipperClient=u}),66);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @module @xbibzlibrary/whatsbibz/lib/assets/wasm/worker-modules */
|
|
1
2
|
;/*FB_PKG_DELIM*/
|
|
2
3
|
|
|
3
4
|
"use strict";(function(){var e=typeof globalThis!="undefined"&&globalThis||typeof self!="undefined"&&self||typeof global!="undefined"&&global;if(typeof e.AbortController=="undefined"){var t=(function(){function e(){this.__listeners=new Map}return e.prototype=Object.create(Object.prototype),e.prototype.addEventListener=function(e,t,n){if(arguments.length<2)throw new TypeError("TypeError: Failed to execute 'addEventListener' on 'CustomEventTarget': 2 arguments required, but only "+arguments.length+" present.");var r=this.__listeners,o=e.toString();r.has(o)||r.set(o,new Map);var a=r.get(o);a.has(t)||a.set(t,n)},e.prototype.removeEventListener=function(e,t,n){if(arguments.length<2)throw new TypeError("TypeError: Failed to execute 'addEventListener' on 'CustomEventTarget': 2 arguments required, but only "+arguments.length+" present.");var r=this.__listeners,o=e.toString();if(r.has(o)){var a=r.get(o);a.has(t)&&a.delete(t)}},e.prototype.dispatchEvent=function(e){var t=this;if(!(e instanceof Event))throw new TypeError("Failed to execute 'dispatchEvent' on 'CustomEventTarget': parameter 1 is not of type 'Event'.");var n=e.type,r=this.__listeners,o=r.get(n);if(o){var a=function(){var n=i[0],r=i[1];try{typeof n=="function"?n.call(t,e):n&&typeof n.handleEvent=="function"&&n.handleEvent(e)}catch(e){setTimeout(function(){throw e})}r&&r.once&&o.delete(n)};for(var i of o.entries())a()}return!0},e})(),n={};e.AbortSignal=(function(){function e(e){if(e!==n)throw new TypeError("Illegal constructor.");t.call(this),this._aborted=!1}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Object.defineProperty(e.prototype,"onabort",{get:function(){return this._onabort},set:function(t){var e=this._onabort;e&&this.removeEventListener("abort",e),this._onabort=t,this.addEventListener("abort",t)}}),Object.defineProperty(e.prototype,"aborted",{get:function(){return this._aborted}}),e})(),e.AbortController=(function(){function e(){this._signal=new AbortSignal(n)}return e.prototype=Object.create(Object.prototype),Object.defineProperty(e.prototype,"signal",{get:function(){return this._signal}}),e.prototype.abort=function(){var e=this.signal;e.aborted||(e._aborted=!0,e.dispatchEvent(new Event("abort")))},e})()}})();
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// BibzWhats — library WhatsApp Web (fork Baileys v7) untuk ekosistem Xbibz.
|
|
2
|
-
// Entry point: seluruh API Baileys
|
|
2
|
+
// Entry point: seluruh API Baileys tetap diekspor (kompatibilitas 100%),
|
|
3
3
|
// ditambah lapisan tingkat tinggi `createBibzWhats()` dan helper BibzWhats.
|
|
4
4
|
import makeWASocket from './Socket/index.js';
|
|
5
5
|
export * from '../WAProto/index.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xbibzlibrary/whatsbibz",
|
|
3
|
-
"version": "1.3
|
|
3
|
+
"version": "1.4.3",
|
|
4
4
|
"description": "WhatsBibz — WhatsApp Web multi-device library for Node.js (maintained Baileys fork): high-level client, custom pairing codes, self-healing sessions, configurable or automatic linked-device identity, complete TypeScript declarations.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -16,7 +16,9 @@
|
|
|
16
16
|
},
|
|
17
17
|
"files": [
|
|
18
18
|
"lib/**/*",
|
|
19
|
-
"WAProto
|
|
19
|
+
"WAProto/index.js",
|
|
20
|
+
"WAProto/index.d.ts",
|
|
21
|
+
"WAProto/WAProto.proto",
|
|
20
22
|
"LICENSE",
|
|
21
23
|
"LICENSE.upstream",
|
|
22
24
|
"README.md",
|
|
@@ -35,7 +37,10 @@
|
|
|
35
37
|
"test": "node --test test/*.test.js",
|
|
36
38
|
"check": "node scripts/check.js",
|
|
37
39
|
"test:live": "BIBZ_LIVE=1 node --test test/identity-live.test.js",
|
|
38
|
-
"prepublishOnly": "npm test && node scripts/check.js"
|
|
40
|
+
"prepublishOnly": "npm test && node scripts/check.js",
|
|
41
|
+
"docs:dev": "vitepress dev docs --host 0.0.0.0",
|
|
42
|
+
"docs:build": "vitepress build docs",
|
|
43
|
+
"docs:preview": "vitepress preview docs --host 0.0.0.0"
|
|
39
44
|
},
|
|
40
45
|
"keywords": [
|
|
41
46
|
"whatsbibz",
|
|
@@ -75,18 +80,18 @@
|
|
|
75
80
|
"registry": "https://registry.npmjs.org/"
|
|
76
81
|
},
|
|
77
82
|
"dependencies": {
|
|
78
|
-
"@cacheable/node-cache": "^1.4.
|
|
79
|
-
"@hapi/boom": "^9.1.
|
|
83
|
+
"@cacheable/node-cache": "^1.4.2",
|
|
84
|
+
"@hapi/boom": "^9.1.4",
|
|
80
85
|
"@types/ws": "^8.18.1",
|
|
81
86
|
"async-mutex": "^0.5.0",
|
|
82
|
-
"fflate": "^0.8.
|
|
87
|
+
"fflate": "^0.8.3",
|
|
83
88
|
"libsignal": "^6.0.0",
|
|
84
89
|
"long": "^5.3.2",
|
|
85
90
|
"lru-cache": "^11.1.0",
|
|
86
91
|
"music-metadata": "^11.12.3",
|
|
87
|
-
"p-queue": "^9.0.
|
|
92
|
+
"p-queue": "^9.0.1",
|
|
88
93
|
"pino": "^9.6",
|
|
89
|
-
"protobufjs": "^7.5.
|
|
94
|
+
"protobufjs": "^7.5.9",
|
|
90
95
|
"whatsapp-rust-bridge": "0.5.5",
|
|
91
96
|
"ws": "^8.13.0"
|
|
92
97
|
},
|
|
@@ -119,7 +124,20 @@
|
|
|
119
124
|
}
|
|
120
125
|
},
|
|
121
126
|
"devDependencies": {
|
|
127
|
+
"@lucide/vue": "^1.51.0",
|
|
128
|
+
"@tailwindcss/vite": "^4.3.3",
|
|
129
|
+
"@types/node": "^22.20.5",
|
|
130
|
+
"class-variance-authority": "^0.7.1",
|
|
131
|
+
"clsx": "^2.1.1",
|
|
132
|
+
"reka-ui": "^2.10.5",
|
|
133
|
+
"tailwind-merge": "^3.7.0",
|
|
134
|
+
"tailwindcss": "^4.3.3",
|
|
135
|
+
"tw-animate-css": "^1.4.0",
|
|
122
136
|
"typescript": "^7.0.2",
|
|
123
|
-
"
|
|
137
|
+
"vitepress": "^1.6.4"
|
|
138
|
+
},
|
|
139
|
+
"overrides": {
|
|
140
|
+
"vite": "^6.4.3",
|
|
141
|
+
"esbuild": "^0.25.0"
|
|
124
142
|
}
|
|
125
143
|
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
yarn pbjs -t static-module --no-beautify -w es6 --no-bundle --no-delimited --no-verify --no-comments -o ./index.js ./WAProto.proto;
|
|
2
|
-
yarn pbjs -t static-module --no-beautify -w es6 --no-bundle --no-delimited --no-verify ./WAProto.proto | yarn pbts --no-comments -o ./index.d.ts -;
|
|
3
|
-
node ./fix-imports.js
|
package/WAProto/fix-imports.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { readFileSync, writeFileSync } from 'fs';
|
|
2
|
-
import { exit } from 'process';
|
|
3
|
-
|
|
4
|
-
const filePath = './index.js'
|
|
5
|
-
|
|
6
|
-
try {
|
|
7
|
-
let content = readFileSync(filePath, 'utf8')
|
|
8
|
-
|
|
9
|
-
content = content.replace(/import \* as (\$protobuf) from/g, 'import $1 from')
|
|
10
|
-
content = content.replace(/(['"])protobufjs\/minimal(['"])/g, '$1protobufjs/minimal.js$2')
|
|
11
|
-
|
|
12
|
-
const marker = 'const $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});\n\n'
|
|
13
|
-
const longToStringHelper =
|
|
14
|
-
'function longToString(value, unsigned) {\n' +
|
|
15
|
-
'\tif (typeof value === "string") {\n' +
|
|
16
|
-
'\t\treturn value;\n' +
|
|
17
|
-
'\t}\n' +
|
|
18
|
-
'\tif (typeof value === "number") {\n' +
|
|
19
|
-
'\t\treturn String(value);\n' +
|
|
20
|
-
'\t}\n' +
|
|
21
|
-
'\tif (!$util.Long) {\n' +
|
|
22
|
-
'\t\treturn String(value);\n' +
|
|
23
|
-
'\t}\n' +
|
|
24
|
-
'\tconst normalized = $util.Long.fromValue(value);\n' +
|
|
25
|
-
'\tconst prepared = unsigned && normalized && typeof normalized.toUnsigned === "function"\n' +
|
|
26
|
-
'\t\t? normalized.toUnsigned()\n' +
|
|
27
|
-
'\t\t: normalized;\n' +
|
|
28
|
-
'\treturn prepared.toString();\n' +
|
|
29
|
-
'}\n\n'
|
|
30
|
-
const longToNumberHelper =
|
|
31
|
-
'function longToNumber(value, unsigned) {\n' +
|
|
32
|
-
'\tif (typeof value === "number") {\n' +
|
|
33
|
-
'\t\treturn value;\n' +
|
|
34
|
-
'\t}\n' +
|
|
35
|
-
'\tif (typeof value === "string") {\n' +
|
|
36
|
-
'\t\tconst numeric = Number(value);\n' +
|
|
37
|
-
'\t\treturn numeric;\n' +
|
|
38
|
-
'\t}\n' +
|
|
39
|
-
'\tif (!$util.Long) {\n' +
|
|
40
|
-
'\t\treturn Number(value);\n' +
|
|
41
|
-
'\t}\n' +
|
|
42
|
-
'\tconst normalized = $util.Long.fromValue(value);\n' +
|
|
43
|
-
'\tconst prepared = unsigned && normalized && typeof normalized.toUnsigned === "function"\n' +
|
|
44
|
-
'\t\t? normalized.toUnsigned()\n' +
|
|
45
|
-
'\t\t: typeof normalized.toSigned === "function"\n' +
|
|
46
|
-
'\t\t\t? normalized.toSigned()\n' +
|
|
47
|
-
'\t\t\t: normalized;\n' +
|
|
48
|
-
'\treturn prepared.toNumber();\n' +
|
|
49
|
-
'}\n\n'
|
|
50
|
-
|
|
51
|
-
if (!content.includes('function longToString(')) {
|
|
52
|
-
const markerIndex = content.indexOf(marker)
|
|
53
|
-
if (markerIndex === -1) {
|
|
54
|
-
throw new Error('Unable to inject Long helpers: marker not found in WAProto index output')
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
content = content.replace(marker, `${marker}${longToStringHelper}${longToNumberHelper}`)
|
|
58
|
-
} else {
|
|
59
|
-
const longToStringRegex = /function longToString\(value, unsigned\) {\n[\s\S]*?\n}\n\n/
|
|
60
|
-
const longToNumberRegex = /function longToNumber\(value, unsigned\) {\n[\s\S]*?\n}\n\n/
|
|
61
|
-
|
|
62
|
-
if (!longToStringRegex.test(content) || !longToNumberRegex.test(content)) {
|
|
63
|
-
throw new Error('Unable to update Long helpers: existing definitions not found')
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
content = content.replace(longToStringRegex, longToStringHelper)
|
|
67
|
-
content = content.replace(longToNumberRegex, longToNumberHelper)
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const longPattern = /([ \t]+d\.(\w+) = )o\.longs === String \? \$util\.Long\.prototype\.toString\.call\(m\.\2\) : o\.longs === Number \? new \$util\.LongBits\(m\.\2\.low >>> 0, m\.\2\.high >>> 0\)\.toNumber\((true)?\) : m\.\2;/g
|
|
71
|
-
content = content.replace(longPattern, (_match, prefix, field, unsignedFlag) => {
|
|
72
|
-
const unsignedArg = unsignedFlag ? ', true' : ''
|
|
73
|
-
return `${prefix}o.longs === String ? longToString(m.${field}${unsignedArg}) : o.longs === Number ? longToNumber(m.${field}${unsignedArg}) : m.${field};`
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
writeFileSync(filePath, content, 'utf8')
|
|
77
|
-
console.log(`✅ Fixed imports in ${filePath}`)
|
|
78
|
-
} catch (error) {
|
|
79
|
-
console.error(`❌ Error fixing imports: ${error.message}`)
|
|
80
|
-
exit(1)
|
|
81
|
-
}
|