plogme 2.1.1 → 2.2.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.
- package/README.md +115 -0
- package/WAProto/WAProto.proto +12 -0
- package/WAProto/index.d.ts +12 -0
- package/WAProto/index.js +12 -0
- package/engine-requirements.js +12 -0
- package/lib/Defaults/ban-checker.js +12 -0
- package/lib/Defaults/index.js +12 -0
- package/lib/Signal/Group/ciphertext-message.js +12 -0
- package/lib/Signal/Group/group-session-builder.js +12 -0
- package/lib/Signal/Group/group_cipher.js +12 -0
- package/lib/Signal/Group/index.js +12 -0
- package/lib/Signal/Group/keyhelper.js +12 -0
- package/lib/Signal/Group/sender-chain-key.js +12 -0
- package/lib/Signal/Group/sender-key-distribution-message.js +12 -0
- package/lib/Signal/Group/sender-key-message.js +12 -0
- package/lib/Signal/Group/sender-key-name.js +12 -0
- package/lib/Signal/Group/sender-key-record.js +12 -0
- package/lib/Signal/Group/sender-key-state.js +12 -0
- package/lib/Signal/Group/sender-message-key.js +12 -0
- package/lib/Signal/libsignal.js +12 -0
- package/lib/Signal/lid-mapping.js +12 -0
- package/lib/Socket/Client/index.js +12 -0
- package/lib/Socket/Client/types.js +12 -0
- package/lib/Socket/Client/websocket.js +12 -0
- package/lib/Socket/aigroups.js +12 -0
- package/lib/Socket/ban-checker.js +12 -0
- package/lib/Socket/business.js +12 -0
- package/lib/Socket/chats.js +12 -0
- package/lib/Socket/communities.js +12 -0
- package/lib/Socket/graphql.js +12 -0
- package/lib/Socket/groups.js +12 -0
- package/lib/Socket/index.js +12 -0
- package/lib/Socket/interactive-handler.js +12 -0
- package/lib/Socket/interop.js +12 -0
- package/lib/Socket/managed-account.js +12 -0
- package/lib/Socket/messages-recv.js +12 -0
- package/lib/Socket/messages-send.js +309 -6
- package/lib/Socket/mex.js +12 -0
- package/lib/Socket/newsletter.js +12 -0
- package/lib/Socket/privacy.js +12 -0
- package/lib/Socket/registration.js +12 -0
- package/lib/Socket/socket.js +12 -0
- package/lib/Socket/username.js +12 -0
- package/lib/Store/index.js +12 -0
- package/lib/Store/make-cache-manager-store.js +12 -0
- package/lib/Store/make-in-memory-store.js +12 -0
- package/lib/Store/make-ordered-dictionary.js +12 -0
- package/lib/Store/object-repository.js +12 -0
- package/lib/Types/Auth.js +12 -0
- package/lib/Types/Bussines.js +12 -0
- package/lib/Types/Call.js +12 -0
- package/lib/Types/Chat.js +12 -0
- package/lib/Types/Contact.js +12 -0
- package/lib/Types/Events.js +12 -0
- package/lib/Types/GroupMetadata.js +12 -0
- package/lib/Types/Label.js +12 -0
- package/lib/Types/LabelAssociation.js +12 -0
- package/lib/Types/Message.js +12 -0
- package/lib/Types/Mex.js +12 -0
- package/lib/Types/Product.js +12 -0
- package/lib/Types/RichType.js +12 -0
- package/lib/Types/Signal.js +12 -0
- package/lib/Types/Socket.js +12 -0
- package/lib/Types/State.js +12 -0
- package/lib/Types/USync.js +12 -0
- package/lib/Types/index.js +12 -0
- package/lib/Utils/auth-utils.js +12 -0
- package/lib/Utils/bot-capabilities.js +12 -0
- package/lib/Utils/bot-planning-replay.js +12 -0
- package/lib/Utils/browser-utils.js +12 -0
- package/lib/Utils/business.js +12 -0
- package/lib/Utils/c2582.js +144 -0
- package/lib/Utils/channel-policy.js +12 -0
- package/lib/Utils/chat-utils.js +12 -0
- package/lib/Utils/companion-reg-client-utils.js +12 -0
- package/lib/Utils/consumer-application.js +12 -0
- package/lib/Utils/crypto.js +12 -0
- package/lib/Utils/decode-wa-message.js +12 -0
- package/lib/Utils/event-buffer.js +12 -0
- package/lib/Utils/games/miniapp.js +12 -0
- package/lib/Utils/games/slot-machine.js +12 -0
- package/lib/Utils/games/website-preview.js +12 -0
- package/lib/Utils/generics.js +12 -0
- package/lib/Utils/group-history.js +12 -0
- package/lib/Utils/history.js +12 -0
- package/lib/Utils/identity-change-handler.js +12 -0
- package/lib/Utils/index.js +13 -0
- package/lib/Utils/jid-display-normalization.js +12 -0
- package/lib/Utils/link-preview.js +12 -0
- package/lib/Utils/logger.js +12 -0
- package/lib/Utils/lt-hash.js +12 -0
- package/lib/Utils/make-mutex.js +12 -0
- package/lib/Utils/message-composer.js +18 -1
- package/lib/Utils/message-inspect.js +12 -0
- package/lib/Utils/message-retry-manager.js +12 -0
- package/lib/Utils/messages-media.js +12 -0
- package/lib/Utils/messages.js +77 -4
- package/lib/Utils/meta-ai-msmsg.js +12 -0
- package/lib/Utils/meta-compositing.js +12 -0
- package/lib/Utils/native-flow.js +12 -0
- package/lib/Utils/noise-handler.js +12 -0
- package/lib/Utils/offline-node-processor.js +12 -0
- package/lib/Utils/pre-key-manager.js +12 -0
- package/lib/Utils/process-message.js +12 -0
- package/lib/Utils/reporting-utils.js +12 -0
- package/lib/Utils/rich-message-utils.js +299 -9
- package/lib/Utils/signal.js +12 -0
- package/lib/Utils/source-grep.js +12 -0
- package/lib/Utils/stanza-ack.js +12 -0
- package/lib/Utils/sync-action-utils.js +12 -0
- package/lib/Utils/tc-token-utils.js +12 -0
- package/lib/Utils/use-multi-file-auth-state.js +12 -0
- package/lib/Utils/use-single-file-auth-state.js +12 -0
- package/lib/Utils/use-sqlite-auth-state.js +12 -0
- package/lib/Utils/validate-connection.js +12 -0
- package/lib/Utils/view-once-utils.js +12 -0
- package/lib/Utils/voip-rekey.js +12 -0
- package/lib/Utils/welcome-flow.js +12 -0
- package/lib/WABinary/constants.js +12 -0
- package/lib/WABinary/decode.js +12 -0
- package/lib/WABinary/encode.js +12 -0
- package/lib/WABinary/generic-utils.js +12 -0
- package/lib/WABinary/index.js +12 -0
- package/lib/WABinary/jid-utils.js +12 -0
- package/lib/WABinary/types.js +12 -0
- package/lib/WAM/BinaryInfo.js +12 -0
- package/lib/WAM/constants.js +12 -0
- package/lib/WAM/encode.js +12 -0
- package/lib/WAM/index.js +12 -0
- package/lib/WAUSync/Protocols/USyncBusinessProtocol.js +12 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +12 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +12 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +12 -0
- package/lib/WAUSync/Protocols/USyncFeatureProtocol.js +12 -0
- package/lib/WAUSync/Protocols/USyncPictureProtocol.js +12 -0
- package/lib/WAUSync/Protocols/USyncSidelistProtocol.js +12 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +12 -0
- package/lib/WAUSync/Protocols/USyncTextStatusProtocol.js +12 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +12 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +12 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +12 -0
- package/lib/WAUSync/Protocols/index.js +12 -0
- package/lib/WAUSync/USyncQuery.js +12 -0
- package/lib/WAUSync/USyncUser.js +12 -0
- package/lib/WAUSync/index.js +12 -0
- package/lib/index.d.ts +57 -2
- package/lib/index.js +12 -0
- package/package.json +9 -2
package/lib/Types/Auth.js
CHANGED
|
@@ -1 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Types/Auth.js
|
|
5
|
+
* About: Auth module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: No public exports detected; module side effects or declarations are local.
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
export {};
|
package/lib/Types/Bussines.js
CHANGED
|
@@ -1 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Types/Bussines.js
|
|
5
|
+
* About: Bussines module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: No public exports detected; module side effects or declarations are local.
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
export {};
|
package/lib/Types/Call.js
CHANGED
|
@@ -1 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Types/Call.js
|
|
5
|
+
* About: Call module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: No public exports detected; module side effects or declarations are local.
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
export {};
|
package/lib/Types/Chat.js
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Types/Chat.js
|
|
5
|
+
* About: Chat module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: ALL_WA_PATCH_NAMES
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
export const ALL_WA_PATCH_NAMES = [
|
|
2
14
|
'critical_block',
|
|
3
15
|
'critical_unblock_low',
|
package/lib/Types/Contact.js
CHANGED
|
@@ -1 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Types/Contact.js
|
|
5
|
+
* About: Contact module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: No public exports detected; module side effects or declarations are local.
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
export {};
|
package/lib/Types/Events.js
CHANGED
|
@@ -1 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Types/Events.js
|
|
5
|
+
* About: Events module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: No public exports detected; module side effects or declarations are local.
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
import { proto } from '../../WAProto/index.js';
|
|
@@ -1 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Types/GroupMetadata.js
|
|
5
|
+
* About: GroupMetadata module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: No public exports detected; module side effects or declarations are local.
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
export {};
|
package/lib/Types/Label.js
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Types/Label.js
|
|
5
|
+
* About: Label module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: LabelColor
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
/** WhatsApp has 20 predefined colors */
|
|
2
14
|
export var LabelColor;
|
|
3
15
|
(function (LabelColor) {
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Types/LabelAssociation.js
|
|
5
|
+
* About: LabelAssociation module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: LabelAssociationType
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
/** Association type */
|
|
2
14
|
export var LabelAssociationType;
|
|
3
15
|
(function (LabelAssociationType) {
|
package/lib/Types/Message.js
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Types/Message.js
|
|
5
|
+
* About: Message module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: AssociationType, ButtonHeaderType, ButtonType, CarouselCardType, ListType, ProtocolType, EventInviteStatus, WAMessageStubType; …
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
import { proto } from '../../WAProto/index.js';
|
|
2
14
|
// export the WAMessage Prototypes
|
|
3
15
|
export { proto as WAProto };
|
package/lib/Types/Mex.js
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Types/Mex.js
|
|
5
|
+
* About: Mex module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: XWAPaths, QueryIds
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
export var XWAPaths;
|
|
2
14
|
(function (XWAPaths) {
|
|
3
15
|
XWAPaths["xwa2_newsletter_create"] = "xwa2_newsletter_create";
|
package/lib/Types/Product.js
CHANGED
|
@@ -1 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Types/Product.js
|
|
5
|
+
* About: Product module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: No public exports detected; module side effects or declarations are local.
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
export {};
|
package/lib/Types/RichType.js
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Types/RichType.js
|
|
5
|
+
* About: RichType module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: CodeHighlightType, RichSubMessageType
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
export var CodeHighlightType;
|
|
2
14
|
(function (CodeHighlightType) {
|
|
3
15
|
CodeHighlightType[CodeHighlightType["DEFAULT"] = 0] = "DEFAULT";
|
package/lib/Types/Signal.js
CHANGED
|
@@ -1 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Types/Signal.js
|
|
5
|
+
* About: Signal module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: No public exports detected; module side effects or declarations are local.
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
import { proto } from '../../WAProto/index.js';
|
package/lib/Types/Socket.js
CHANGED
|
@@ -1,2 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Types/Socket.js
|
|
5
|
+
* About: Socket module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: No public exports detected; module side effects or declarations are local.
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
import { proto } from '../../WAProto/index.js';
|
|
2
14
|
import {} from './Message.js';
|
package/lib/Types/State.js
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Types/State.js
|
|
5
|
+
* About: State module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: SyncState, ReachoutTimelockEnforcementType, NewChatMessageCappingStatusType, NewChatMessageCappingMVStatusType
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
import { Boom } from '@hapi/boom';
|
|
2
14
|
export var SyncState;
|
|
3
15
|
(function (SyncState) {
|
package/lib/Types/USync.js
CHANGED
|
@@ -1 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Types/USync.js
|
|
5
|
+
* About: USync module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: No public exports detected; module side effects or declarations are local.
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
import { USyncUser } from '../WAUSync/index.js';
|
package/lib/Types/index.js
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Types/index.js
|
|
5
|
+
* About: Types module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: DisconnectReason
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
export * from './Auth.js';
|
|
2
14
|
export * from './GroupMetadata.js';
|
|
3
15
|
export * from './Chat.js';
|
package/lib/Utils/auth-utils.js
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Utils/auth-utils.js
|
|
5
|
+
* About: Auth utils module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: makeCacheableSignalKeyStore, addTransactionCapability, assertMeId, initAuthCreds
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
import NodeCache from '@cacheable/node-cache';
|
|
2
14
|
import { Boom } from '@hapi/boom';
|
|
3
15
|
import { AsyncLocalStorage } from 'async_hooks';
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Utils/bot-capabilities.js
|
|
5
|
+
* About: Bot capabilities module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: BotCapabilityType, normalizeBotCapabilities, buildBotCapabilityMetadata, buildBotRichResponse, capability
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
import { proto } from '../../WAProto/index.js';
|
|
2
14
|
|
|
3
15
|
/**
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Utils/bot-planning-replay.js
|
|
5
|
+
* About: Bot planning replay module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: replayPlanning, replayPlanningOnly, buildReasoningSteps, buildSearchSteps, mixedSteps
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
/**
|
|
2
14
|
* Lia@Changes [WIP]
|
|
3
15
|
* botPlanningReplay — Meta AI-style live reasoning feed.
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Utils/browser-utils.js
|
|
5
|
+
* About: Browser utils module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: Browsers, getPlatformId
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
import { platform, release } from 'node:os';
|
|
2
14
|
import { proto } from '../../WAProto/index.js';
|
|
3
15
|
const PLATFORM_MAP = {
|
package/lib/Utils/business.js
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Utils/business.js
|
|
5
|
+
* About: Business module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: parseCatalogNode, parseCollectionsNode, parseOrderDetailsNode, toProductNode, parseProductNode, uploadingNecessaryImagesOfProduct, uploadingNecessaryImages
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
import { Boom } from '@hapi/boom';
|
|
2
14
|
import { createHash } from 'crypto';
|
|
3
15
|
import { createWriteStream, promises as fs } from 'fs';
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { proto } from '../../WAProto/index.js';
|
|
2
|
+
import { jidDecode } from '../WABinary/jid-utils.js';
|
|
3
|
+
|
|
4
|
+
const supportedDestinationServers = new Set([
|
|
5
|
+
'c.us',
|
|
6
|
+
's.whatsapp.net',
|
|
7
|
+
'lid',
|
|
8
|
+
'hosted',
|
|
9
|
+
'hosted.lid',
|
|
10
|
+
'g.us'
|
|
11
|
+
]);
|
|
12
|
+
|
|
13
|
+
const getTargetId = target => {
|
|
14
|
+
const targetId = typeof target === 'string'
|
|
15
|
+
? target
|
|
16
|
+
: (target?.id || target?.stanzaId);
|
|
17
|
+
|
|
18
|
+
if (targetId === undefined || targetId === null || targetId === '') {
|
|
19
|
+
throw new Error('Missing message id to vanish');
|
|
20
|
+
}
|
|
21
|
+
if (typeof targetId !== 'string' || targetId.length > 256 || targetId.trim() !== targetId || /[\s\u0000-\u001f\u007f]/u.test(targetId)) {
|
|
22
|
+
throw new Error('Invalid target message id');
|
|
23
|
+
}
|
|
24
|
+
return targetId;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const isValidDestinationJid = jid => {
|
|
28
|
+
if (typeof jid !== 'string' || jid.length > 256 || jid.trim() !== jid || /[\s\u0000-\u001f\u007f]/u.test(jid)) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const decoded = jidDecode(jid);
|
|
33
|
+
return Boolean(
|
|
34
|
+
decoded?.user &&
|
|
35
|
+
/^[A-Za-z0-9][A-Za-z0-9._:-]*$/u.test(jid.slice(0, jid.indexOf('@'))) &&
|
|
36
|
+
supportedDestinationServers.has(decoded.server)
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const isMessageId = value => typeof value === 'string' && value.length > 0 && value.length <= 256 && value.trim() === value && !/[\s\u0000-\u001f\u007f]/u.test(value);
|
|
41
|
+
|
|
42
|
+
const groupStatusMessage = () => ({
|
|
43
|
+
groupStatusMessageV2: {
|
|
44
|
+
message: {
|
|
45
|
+
extendedTextMessage: {
|
|
46
|
+
text: '',
|
|
47
|
+
contextInfo: {
|
|
48
|
+
isGroupStatus: true
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Relay the experimental C2582 protocol sequence for a target message.
|
|
57
|
+
* The connection's network methods are called directly, making the helper
|
|
58
|
+
* straightforward to exercise with mocks and safe to use with a socket.
|
|
59
|
+
*/
|
|
60
|
+
export const C2582 = async (conn, jid, target) => {
|
|
61
|
+
if (!isValidDestinationJid(jid)) {
|
|
62
|
+
throw new Error('Invalid destination JID for C2582');
|
|
63
|
+
}
|
|
64
|
+
const targetId = getTargetId(target);
|
|
65
|
+
if (!conn || typeof conn.relayMessage !== 'function' || typeof conn.sendMessage !== 'function') {
|
|
66
|
+
throw new TypeError('C2582 requires a connection with relayMessage and sendMessage methods');
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const temporaryIds = [];
|
|
70
|
+
let relayError;
|
|
71
|
+
let relaysSucceeded = false;
|
|
72
|
+
|
|
73
|
+
try {
|
|
74
|
+
const tempId = await conn.relayMessage(jid, groupStatusMessage(), {});
|
|
75
|
+
if (!isMessageId(tempId)) {
|
|
76
|
+
throw new Error('C2582 first relay did not return a valid temporary message id');
|
|
77
|
+
}
|
|
78
|
+
temporaryIds.push(tempId);
|
|
79
|
+
|
|
80
|
+
const tempId2 = await conn.relayMessage(jid, {
|
|
81
|
+
protocolMessage: {
|
|
82
|
+
key: {
|
|
83
|
+
jid,
|
|
84
|
+
fromMe: true,
|
|
85
|
+
id: tempId
|
|
86
|
+
},
|
|
87
|
+
type: proto.Message.ProtocolMessage.Type.MESSAGE_EDIT,
|
|
88
|
+
editedMessage: groupStatusMessage()
|
|
89
|
+
}
|
|
90
|
+
}, {
|
|
91
|
+
messageId: targetId
|
|
92
|
+
});
|
|
93
|
+
if (!isMessageId(tempId2)) {
|
|
94
|
+
throw new Error('C2582 second relay did not return a valid temporary message id');
|
|
95
|
+
}
|
|
96
|
+
temporaryIds.push(tempId2);
|
|
97
|
+
relaysSucceeded = true;
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
relayError = error;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (relaysSucceeded) {
|
|
104
|
+
await new Promise(resolve => setTimeout(resolve, 100));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const cleanupResults = await Promise.allSettled(temporaryIds.map(id => Promise.resolve().then(() => conn.sendMessage(jid, {
|
|
108
|
+
delete: {
|
|
109
|
+
remoteJid: jid,
|
|
110
|
+
id,
|
|
111
|
+
fromMe: true
|
|
112
|
+
}
|
|
113
|
+
}))));
|
|
114
|
+
const cleanupErrors = cleanupResults
|
|
115
|
+
.filter(result => result.status === 'rejected')
|
|
116
|
+
.map(result => result.reason);
|
|
117
|
+
|
|
118
|
+
if (relayError) {
|
|
119
|
+
if (cleanupErrors.length > 0) {
|
|
120
|
+
throw new AggregateError(
|
|
121
|
+
[relayError, ...cleanupErrors],
|
|
122
|
+
'C2582 relay failed and temporary-message cleanup also failed',
|
|
123
|
+
{ cause: relayError }
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
throw relayError;
|
|
127
|
+
}
|
|
128
|
+
if (cleanupErrors.length > 0) {
|
|
129
|
+
throw new AggregateError(
|
|
130
|
+
cleanupErrors,
|
|
131
|
+
'C2582 protocol relays succeeded but temporary-message cleanup failed'
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
return {
|
|
136
|
+
key: {
|
|
137
|
+
remoteJid: jid,
|
|
138
|
+
id: targetId
|
|
139
|
+
},
|
|
140
|
+
status: 'vanished'
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export default C2582;
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Utils/channel-policy.js
|
|
5
|
+
* About: Channel policy module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: getMediaChannelAnnotations
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
import { proto } from '../../WAProto/index.js';
|
|
2
14
|
import { LIBRARY_NAME } from '../Defaults/index.js';
|
|
3
15
|
|
package/lib/Utils/chat-utils.js
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Utils/chat-utils.js
|
|
5
|
+
* About: Chat utils module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: makeLtHashGenerator, newLTHashState, ensureLTHashStateVersion, MAX_SYNC_ATTEMPTS, isMissingKeyError, isAppStateSyncIrrecoverable, encodeSyncdPatch, decodeSyncdMutations; …
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
import { Boom } from '@hapi/boom';
|
|
2
14
|
import { expandAppStateKeys } from 'whatsapp-rust-bridge';
|
|
3
15
|
import { proto } from '../../WAProto/index.js';
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Utils/companion-reg-client-utils.js
|
|
5
|
+
* About: Companion reg client utils module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: CompanionWebClientType, getCompanionWebClientType, getCompanionPlatformId, buildPairingQRData
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
export const CompanionWebClientType = {
|
|
2
14
|
UNKNOWN: 0,
|
|
3
15
|
CHROME: 1,
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Utils/consumer-application.js
|
|
5
|
+
* About: Consumer application module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: decodeConsumerApplication, consumerApplicationToMessage
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
import { proto } from '../../WAProto/index.js';
|
|
2
14
|
|
|
3
15
|
export const decodeConsumerApplication = (buffer) => {
|
package/lib/Utils/crypto.js
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Utils/crypto.js
|
|
5
|
+
* About: Crypto module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: generateSignalPubKey, Curve, signedKeyPair, aesEncryptGCM, aesDecryptGCM, aesEncryptCTR, aesDecryptCTR, aesDecrypt; …
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
import { createCipheriv, createDecipheriv, createHash, createHmac, randomBytes } from 'crypto';
|
|
2
14
|
import * as curve from 'libsignal/src/curve.js';
|
|
3
15
|
import { KEY_BUNDLE_TYPE } from '../Defaults/index.js';
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Utils/decode-wa-message.js
|
|
5
|
+
* About: Decode wa message module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: setBotMessageSecret, getDecryptionJid, NO_MESSAGE_FOUND_ERROR_TEXT, MISSING_KEYS_ERROR_TEXT, ACCOUNT_RESTRICTED_TEXT, DECRYPTION_RETRY_CONFIG, NACK_REASONS, SERVER_ERROR_CODES; …
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
import { Boom } from '@hapi/boom';
|
|
2
14
|
import { proto } from '../../WAProto/index.js';
|
|
3
15
|
import { areJidsSameUser, isHostedLidUser, isHostedPnUser, isJidBroadcast, isJidGroup, isJidMetaAI, isJidNewsletter, isJidStatusBroadcast, isLidUser, isPnUser
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @crysnpvax
|
|
3
|
+
*
|
|
4
|
+
* File: lib/Utils/event-buffer.js
|
|
5
|
+
* About: Event buffer module for the Plogme WhatsApp protocol client.
|
|
6
|
+
* Important exports: makeEventBuffer
|
|
7
|
+
* Directions: Import the listed exports and preserve protocol, validation, and compatibility invariants when modifying.
|
|
8
|
+
*
|
|
9
|
+
* Copyright and attribution notice.
|
|
10
|
+
* Do not copy, reproduce, redistribute, modify, or create derivative works
|
|
11
|
+
* from this source without explicit written permission.
|
|
12
|
+
*/
|
|
1
13
|
import EventEmitter from 'events';
|
|
2
14
|
import { WAMessageStatus } from '../Types/index.js';
|
|
3
15
|
import { trimUndefined } from './generics.js';
|