@ikyyjee/ikyysinggle 1.7.7
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/WAProto/GenerateStatics.sh +3 -0
- package/WAProto/WAProto.proto +8083 -0
- package/WAProto/fix-imports.js +85 -0
- package/WAProto/index.d.ts +29095 -0
- package/WAProto/index.js +172336 -0
- package/engine-requirements.js +10 -0
- package/lib/Defaults/index.js +194 -0
- package/lib/Signal/Group/ciphertext-message.js +12 -0
- package/lib/Signal/Group/group-session-builder.js +30 -0
- package/lib/Signal/Group/group_cipher.js +82 -0
- package/lib/Signal/Group/index.js +12 -0
- package/lib/Signal/Group/keyhelper.js +18 -0
- package/lib/Signal/Group/sender-chain-key.js +26 -0
- package/lib/Signal/Group/sender-key-distribution-message.js +63 -0
- package/lib/Signal/Group/sender-key-message.js +66 -0
- package/lib/Signal/Group/sender-key-name.js +48 -0
- package/lib/Signal/Group/sender-key-record.js +41 -0
- package/lib/Signal/Group/sender-key-state.js +84 -0
- package/lib/Signal/Group/sender-message-key.js +26 -0
- package/lib/Signal/libsignal.js +431 -0
- package/lib/Signal/lid-mapping.js +277 -0
- package/lib/Socket/Client/index.js +3 -0
- package/lib/Socket/Client/types.js +11 -0
- package/lib/Socket/Client/websocket.js +102 -0
- package/lib/Socket/aigroups.js +221 -0
- package/lib/Socket/business.js +379 -0
- package/lib/Socket/chats.js +1193 -0
- package/lib/Socket/communities.js +431 -0
- package/lib/Socket/graphql.js +524 -0
- package/lib/Socket/groups.js +408 -0
- package/lib/Socket/index.js +49 -0
- package/lib/Socket/interop.js +341 -0
- package/lib/Socket/luxu.js +510 -0
- package/lib/Socket/managed-account.js +99 -0
- package/lib/Socket/messages-recv.js +2009 -0
- package/lib/Socket/messages-send.js +1608 -0
- package/lib/Socket/mex.js +41 -0
- package/lib/Socket/newsletter.js +399 -0
- package/lib/Socket/privacy.js +128 -0
- package/lib/Socket/registration.js +238 -0
- package/lib/Socket/socket.js +1000 -0
- package/lib/Socket/text-router.js +67 -0
- package/lib/Socket/username.js +234 -0
- package/lib/Store/index.js +10 -0
- package/lib/Store/keyed-db.js +108 -0
- package/lib/Store/make-cache-manager-store.js +85 -0
- package/lib/Store/make-in-memory-store.js +198 -0
- package/lib/Store/make-ordered-dictionary.js +75 -0
- package/lib/Store/object-repository.js +32 -0
- package/lib/Types/Auth.js +2 -0
- package/lib/Types/Bussines.js +2 -0
- package/lib/Types/Call.js +2 -0
- package/lib/Types/Chat.js +8 -0
- package/lib/Types/Contact.js +2 -0
- package/lib/Types/Events.js +2 -0
- package/lib/Types/GroupMetadata.js +2 -0
- package/lib/Types/Label.js +25 -0
- package/lib/Types/LabelAssociation.js +7 -0
- package/lib/Types/Message.js +11 -0
- package/lib/Types/Mex.js +114 -0
- package/lib/Types/Product.js +2 -0
- package/lib/Types/Signal.js +2 -0
- package/lib/Types/Socket.js +3 -0
- package/lib/Types/State.js +56 -0
- package/lib/Types/USync.js +2 -0
- package/lib/Types/index.js +26 -0
- package/lib/Utils/adaptive-healing.js +53 -0
- package/lib/Utils/auth-utils.js +302 -0
- package/lib/Utils/browser-utils.js +50 -0
- package/lib/Utils/business.js +231 -0
- package/lib/Utils/chat-utils.js +872 -0
- package/lib/Utils/command-loader.js +108 -0
- package/lib/Utils/companion-reg-client-utils.js +35 -0
- package/lib/Utils/consumer-application.js +106 -0
- package/lib/Utils/crypto.js +137 -0
- package/lib/Utils/curve25519-js.js +262 -0
- package/lib/Utils/decode-wa-message.js +498 -0
- package/lib/Utils/event-buffer.js +622 -0
- package/lib/Utils/generics.js +403 -0
- package/lib/Utils/group-history.js +47 -0
- package/lib/Utils/history.js +134 -0
- package/lib/Utils/identity-change-handler.js +50 -0
- package/lib/Utils/index.js +38 -0
- package/lib/Utils/jid-display-normalization.js +198 -0
- package/lib/Utils/link-preview.js +85 -0
- package/lib/Utils/logger.js +3 -0
- package/lib/Utils/lt-hash.js +8 -0
- package/lib/Utils/make-mutex.js +33 -0
- package/lib/Utils/message-composer.js +273 -0
- package/lib/Utils/message-retry-manager.js +267 -0
- package/lib/Utils/messages-media.js +791 -0
- package/lib/Utils/messages.js +1260 -0
- package/lib/Utils/meta-ai-msmsg.js +271 -0
- package/lib/Utils/native-bridge.js +77 -0
- package/lib/Utils/noise-handler.js +201 -0
- package/lib/Utils/offline-node-processor.js +40 -0
- package/lib/Utils/optimizer.js +90 -0
- package/lib/Utils/pre-key-manager.js +106 -0
- package/lib/Utils/process-message.js +630 -0
- package/lib/Utils/reporting-utils.js +258 -0
- package/lib/Utils/session-pool.js +73 -0
- package/lib/Utils/signal.js +207 -0
- package/lib/Utils/stanza-ack.js +38 -0
- package/lib/Utils/sticker.js +139 -0
- package/lib/Utils/sync-action-utils.js +49 -0
- package/lib/Utils/tc-token-utils.js +163 -0
- package/lib/Utils/use-multi-file-auth-state.js +121 -0
- package/lib/Utils/use-sqlite-auth-state.js +168 -0
- package/lib/Utils/validate-connection.js +203 -0
- package/lib/Utils/view-once-cache.js +79 -0
- package/lib/Utils/voip-rekey.js +25 -0
- package/lib/Utils/warmup.js +117 -0
- package/lib/WABinary/constants.js +1301 -0
- package/lib/WABinary/decode.js +262 -0
- package/lib/WABinary/encode.js +220 -0
- package/lib/WABinary/generic-utils.js +204 -0
- package/lib/WABinary/index.js +6 -0
- package/lib/WABinary/jid-utils.js +98 -0
- package/lib/WABinary/types.js +2 -0
- package/lib/WAM/BinaryInfo.js +10 -0
- package/lib/WAM/constants.js +22853 -0
- package/lib/WAM/encode.js +150 -0
- package/lib/WAM/index.js +4 -0
- package/lib/WAUSync/Protocols/USyncBusinessProtocol.js +41 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +52 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +54 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +27 -0
- package/lib/WAUSync/Protocols/USyncFeatureProtocol.js +52 -0
- package/lib/WAUSync/Protocols/USyncPictureProtocol.js +31 -0
- package/lib/WAUSync/Protocols/USyncSidelistProtocol.js +26 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +38 -0
- package/lib/WAUSync/Protocols/USyncTextStatusProtocol.js +35 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +25 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +51 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +29 -0
- package/lib/WAUSync/Protocols/index.js +13 -0
- package/lib/WAUSync/USyncQuery.js +127 -0
- package/lib/WAUSync/USyncUser.js +31 -0
- package/lib/WAUSync/index.js +4 -0
- package/lib/antiban.js +4083 -0
- package/lib/index.js +24 -0
- package/package.json +147 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { getBinaryNodeChild } from '../WABinary/index.js';
|
|
2
|
+
import { USyncBotProfileProtocol } from './Protocols/UsyncBotProfileProtocol.js';
|
|
3
|
+
import { USyncLIDProtocol } from './Protocols/UsyncLIDProtocol.js';
|
|
4
|
+
import { USyncBusinessProtocol } from './Protocols/USyncBusinessProtocol.js';
|
|
5
|
+
import { USyncFeatureProtocol } from './Protocols/USyncFeatureProtocol.js';
|
|
6
|
+
import { USyncPictureProtocol } from './Protocols/USyncPictureProtocol.js';
|
|
7
|
+
import { USyncSidelistProtocol } from './Protocols/USyncSidelistProtocol.js';
|
|
8
|
+
import { USyncTextStatusProtocol } from './Protocols/USyncTextStatusProtocol.js';
|
|
9
|
+
import { USyncContactProtocol, USyncDeviceProtocol, USyncDisappearingModeProtocol, USyncStatusProtocol, USyncUsernameProtocol } from './Protocols/index.js';
|
|
10
|
+
import { USyncUser } from './USyncUser.js';
|
|
11
|
+
export class USyncQuery {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.protocols = [];
|
|
14
|
+
this.users = [];
|
|
15
|
+
this.context = 'interactive';
|
|
16
|
+
this.mode = 'query';
|
|
17
|
+
}
|
|
18
|
+
withMode(mode) {
|
|
19
|
+
this.mode = mode;
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
withContext(context) {
|
|
23
|
+
this.context = context;
|
|
24
|
+
return this;
|
|
25
|
+
}
|
|
26
|
+
withUser(user) {
|
|
27
|
+
this.users.push(user);
|
|
28
|
+
return this;
|
|
29
|
+
}
|
|
30
|
+
parseUSyncQueryResult(result) {
|
|
31
|
+
if (result?.attrs.type !== 'result') {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const protocolMap = Object.fromEntries(this.protocols.map(protocol => {
|
|
35
|
+
return [protocol.name, protocol.parser];
|
|
36
|
+
}));
|
|
37
|
+
const queryResult = {
|
|
38
|
+
// TODO: implement errors etc.
|
|
39
|
+
list: [],
|
|
40
|
+
sideList: []
|
|
41
|
+
};
|
|
42
|
+
const usyncNode = getBinaryNodeChild(result, 'usync');
|
|
43
|
+
//TODO: implement error backoff, refresh etc.
|
|
44
|
+
//TODO: see if there are any errors in the result node
|
|
45
|
+
//const resultNode = getBinaryNodeChild(usyncNode, 'result')
|
|
46
|
+
const listNode = usyncNode ? getBinaryNodeChild(usyncNode, 'list') : undefined;
|
|
47
|
+
if (listNode?.content && Array.isArray(listNode.content)) {
|
|
48
|
+
queryResult.list = listNode.content.reduce((acc, node) => {
|
|
49
|
+
const id = node?.attrs.jid;
|
|
50
|
+
if (id) {
|
|
51
|
+
const data = Array.isArray(node?.content)
|
|
52
|
+
? Object.fromEntries(node.content
|
|
53
|
+
.map(content => {
|
|
54
|
+
const protocol = content.tag;
|
|
55
|
+
const parser = protocolMap[protocol];
|
|
56
|
+
if (parser) {
|
|
57
|
+
return [protocol, parser(content)];
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
return [protocol, null];
|
|
61
|
+
}
|
|
62
|
+
})
|
|
63
|
+
.filter(([, b]) => b !== null))
|
|
64
|
+
: {};
|
|
65
|
+
acc.push({ ...data, id });
|
|
66
|
+
}
|
|
67
|
+
return acc;
|
|
68
|
+
}, []);
|
|
69
|
+
}
|
|
70
|
+
//TODO: implement side list
|
|
71
|
+
//const sideListNode = getBinaryNodeChild(usyncNode, 'side_list')
|
|
72
|
+
return queryResult;
|
|
73
|
+
}
|
|
74
|
+
withDeviceProtocol() {
|
|
75
|
+
this.protocols.push(new USyncDeviceProtocol());
|
|
76
|
+
return this;
|
|
77
|
+
}
|
|
78
|
+
withContactProtocol() {
|
|
79
|
+
this.protocols.push(new USyncContactProtocol());
|
|
80
|
+
return this;
|
|
81
|
+
}
|
|
82
|
+
withStatusProtocol() {
|
|
83
|
+
this.protocols.push(new USyncStatusProtocol());
|
|
84
|
+
return this;
|
|
85
|
+
}
|
|
86
|
+
withDisappearingModeProtocol() {
|
|
87
|
+
this.protocols.push(new USyncDisappearingModeProtocol());
|
|
88
|
+
return this;
|
|
89
|
+
}
|
|
90
|
+
withBotProfileProtocol() {
|
|
91
|
+
this.protocols.push(new USyncBotProfileProtocol());
|
|
92
|
+
return this;
|
|
93
|
+
}
|
|
94
|
+
withLIDProtocol() {
|
|
95
|
+
this.protocols.push(new USyncLIDProtocol());
|
|
96
|
+
return this;
|
|
97
|
+
}
|
|
98
|
+
withUsernameProtocol() {
|
|
99
|
+
this.protocols.push(new USyncUsernameProtocol());
|
|
100
|
+
return this;
|
|
101
|
+
}
|
|
102
|
+
/** Verified business name/profile info (WhatsApp Business accounts). */
|
|
103
|
+
withBusinessProtocol(profileVersion) {
|
|
104
|
+
this.protocols.push(new USyncBusinessProtocol(profileVersion));
|
|
105
|
+
return this;
|
|
106
|
+
}
|
|
107
|
+
/** Which encryption/feature flags a JID supports. */
|
|
108
|
+
withFeatureProtocol(features) {
|
|
109
|
+
this.protocols.push(new USyncFeatureProtocol(features));
|
|
110
|
+
return this;
|
|
111
|
+
}
|
|
112
|
+
/** Profile picture id/directPath/hash, without a separate media fetch. */
|
|
113
|
+
withPictureProtocol(type) {
|
|
114
|
+
this.protocols.push(new USyncPictureProtocol(type));
|
|
115
|
+
return this;
|
|
116
|
+
}
|
|
117
|
+
withSidelistProtocol(useLidAddressing) {
|
|
118
|
+
this.protocols.push(new USyncSidelistProtocol(useLidAddressing));
|
|
119
|
+
return this;
|
|
120
|
+
}
|
|
121
|
+
/** A contact's text status ("About" text) — setAt/expiresAt/emoji included. */
|
|
122
|
+
withTextStatusProtocol() {
|
|
123
|
+
this.protocols.push(new USyncTextStatusProtocol());
|
|
124
|
+
return this;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=USyncQuery.js.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export class USyncUser {
|
|
2
|
+
withId(id) {
|
|
3
|
+
this.id = id;
|
|
4
|
+
return this;
|
|
5
|
+
}
|
|
6
|
+
withLid(lid) {
|
|
7
|
+
this.lid = lid;
|
|
8
|
+
return this;
|
|
9
|
+
}
|
|
10
|
+
withPhone(phone) {
|
|
11
|
+
this.phone = phone;
|
|
12
|
+
return this;
|
|
13
|
+
}
|
|
14
|
+
withUsername(username) {
|
|
15
|
+
this.username = username;
|
|
16
|
+
return this;
|
|
17
|
+
}
|
|
18
|
+
withUsernameKey(usernameKey) {
|
|
19
|
+
this.usernameKey = usernameKey;
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
withType(type) {
|
|
23
|
+
this.type = type;
|
|
24
|
+
return this;
|
|
25
|
+
}
|
|
26
|
+
withPersonaId(personaId) {
|
|
27
|
+
this.personaId = personaId;
|
|
28
|
+
return this;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=USyncUser.js.map
|