ruby-baileys 0.0.0-stage → 1.5.17
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/EXPERIMENTAL.md +350 -0
- package/LICENSE +23 -0
- package/NOTICE.md +14 -0
- package/README.md +6265 -2
- package/WAProto/GenerateStatics.sh +3 -0
- package/WAProto/WAProto.proto +5479 -0
- package/WAProto/fix-imports.js +81 -0
- package/WAProto/index.d.ts +16877 -0
- package/WAProto/index.js +122159 -0
- package/assets/ruby_aspirant.jpg +0 -0
- package/assets/ruby_aspirant_4k.jpg +88 -0
- package/assets/ruby_aspirant_full.jpg +0 -0
- package/assets/ruby_aspirant_render.png +1 -0
- package/assets/ruby_aspirants_hd.jpg +0 -0
- package/assets/thumb.jpg +0 -0
- package/engine-requirements.js +14 -0
- package/index.cjs +29 -0
- package/index.d.ts +2 -0
- package/package.json +178 -4
- package/src/Defaults/index.d.ts +153 -0
- package/src/Defaults/index.js +165 -0
- package/src/MessageBuilder/bot-signature.d.ts +22 -0
- package/src/MessageBuilder/bot-signature.js +123 -0
- package/src/MessageBuilder/extras.d.ts +396 -0
- package/src/MessageBuilder/extras.js +1229 -0
- package/src/MessageBuilder/index.d.ts +210 -0
- package/src/MessageBuilder/index.js +3521 -0
- package/src/MessageBuilder/metaai.d.ts +438 -0
- package/src/MessageBuilder/metaai.js +891 -0
- package/src/Signal/Group/ciphertext-message.d.ts +10 -0
- package/src/Signal/Group/ciphertext-message.js +12 -0
- package/src/Signal/Group/group-session-builder.d.ts +8 -0
- package/src/Signal/Group/group-session-builder.js +28 -0
- package/src/Signal/Group/group_cipher.d.ts +11 -0
- package/src/Signal/Group/group_cipher.js +79 -0
- package/src/Signal/Group/index.d.ts +12 -0
- package/src/Signal/Group/index.js +12 -0
- package/src/Signal/Group/keyhelper.d.ts +7 -0
- package/src/Signal/Group/keyhelper.js +18 -0
- package/src/Signal/Group/sender-chain-key.d.ts +14 -0
- package/src/Signal/Group/sender-chain-key.js +26 -0
- package/src/Signal/Group/sender-key-distribution-message.d.ts +17 -0
- package/src/Signal/Group/sender-key-distribution-message.js +63 -0
- package/src/Signal/Group/sender-key-message.d.ts +19 -0
- package/src/Signal/Group/sender-key-message.js +66 -0
- package/src/Signal/Group/sender-key-name.d.ts +12 -0
- package/src/Signal/Group/sender-key-name.js +48 -0
- package/src/Signal/Group/sender-key-record.d.ts +13 -0
- package/src/Signal/Group/sender-key-record.js +41 -0
- package/src/Signal/Group/sender-key-state.d.ts +17 -0
- package/src/Signal/Group/sender-key-state.js +84 -0
- package/src/Signal/Group/sender-message-key.d.ts +12 -0
- package/src/Signal/Group/sender-message-key.js +26 -0
- package/src/Signal/libsignal.d.ts +55 -0
- package/src/Signal/libsignal.js +429 -0
- package/src/Signal/lid-mapping.d.ts +21 -0
- package/src/Signal/lid-mapping.js +275 -0
- package/src/Socket/Client/index.d.ts +3 -0
- package/src/Socket/Client/index.js +3 -0
- package/src/Socket/Client/types.d.ts +6 -0
- package/src/Socket/Client/types.js +10 -0
- package/src/Socket/Client/websocket.d.ts +13 -0
- package/src/Socket/Client/websocket.js +54 -0
- package/src/Socket/business.d.ts +432 -0
- package/src/Socket/business.js +380 -0
- package/src/Socket/chats.d.ts +248 -0
- package/src/Socket/chats.js +1485 -0
- package/src/Socket/communities.d.ts +599 -0
- package/src/Socket/communities.js +422 -0
- package/src/Socket/groups.d.ts +299 -0
- package/src/Socket/groups.js +340 -0
- package/src/Socket/index.d.ts +582 -0
- package/src/Socket/index.js +48 -0
- package/src/Socket/messages-recv.d.ts +371 -0
- package/src/Socket/messages-recv.js +1803 -0
- package/src/Socket/messages-send.d.ts +391 -0
- package/src/Socket/messages-send.js +1575 -0
- package/src/Socket/mex.d.ts +2 -0
- package/src/Socket/mex.js +45 -0
- package/src/Socket/newsletter.d.ts +469 -0
- package/src/Socket/newsletter.js +643 -0
- package/src/Socket/socket.d.ts +78 -0
- package/src/Socket/socket.js +1088 -0
- package/src/Store/index.d.ts +4 -0
- package/src/Store/index.js +4 -0
- package/src/Store/make-in-memory-store.d.ts +63 -0
- package/src/Store/make-in-memory-store.js +398 -0
- package/src/Store/make-ordered-dictionary.d.ts +13 -0
- package/src/Store/make-ordered-dictionary.js +79 -0
- package/src/Store/object-repository.d.ts +11 -0
- package/src/Store/object-repository.js +24 -0
- package/src/Types/Auth.d.ts +2 -0
- package/src/Types/Auth.js +2 -0
- package/src/Types/Bussines.d.ts +2 -0
- package/src/Types/Bussines.js +2 -0
- package/src/Types/Call.d.ts +2 -0
- package/src/Types/Call.js +2 -0
- package/src/Types/Chat.d.ts +3 -0
- package/src/Types/Chat.js +25 -0
- package/src/Types/Contact.d.ts +2 -0
- package/src/Types/Contact.js +2 -0
- package/src/Types/Events.d.ts +2 -0
- package/src/Types/Events.js +1 -0
- package/src/Types/GroupMetadata.d.ts +6 -0
- package/src/Types/GroupMetadata.js +7 -0
- package/src/Types/Label.d.ts +3 -0
- package/src/Types/Label.js +25 -0
- package/src/Types/LabelAssociation.d.ts +3 -0
- package/src/Types/LabelAssociation.js +7 -0
- package/src/Types/Message.d.ts +14 -0
- package/src/Types/Message.js +24 -0
- package/src/Types/Mex.d.ts +3 -0
- package/src/Types/Mex.js +96 -0
- package/src/Types/Product.d.ts +2 -0
- package/src/Types/Product.js +2 -0
- package/src/Types/Signal.d.ts +2 -0
- package/src/Types/Signal.js +1 -0
- package/src/Types/Socket.d.ts +2 -0
- package/src/Types/Socket.js +1 -0
- package/src/Types/State.d.ts +6 -0
- package/src/Types/State.js +55 -0
- package/src/Types/USync.d.ts +2 -0
- package/src/Types/USync.js +1 -0
- package/src/Types/index.d.ts +14 -0
- package/src/Types/index.js +26 -0
- package/src/Utils/auth-store.d.ts +30 -0
- package/src/Utils/auth-store.js +77 -0
- package/src/Utils/auth-utils.d.ts +59 -0
- package/src/Utils/auth-utils.js +274 -0
- package/src/Utils/browser-utils.d.ts +10 -0
- package/src/Utils/browser-utils.js +29 -0
- package/src/Utils/business.d.ts +50 -0
- package/src/Utils/business.js +227 -0
- package/src/Utils/chat-utils.d.ts +409 -0
- package/src/Utils/chat-utils.js +847 -0
- package/src/Utils/companion-reg-client-utils.d.ts +5 -0
- package/src/Utils/companion-reg-client-utils.js +40 -0
- package/src/Utils/crypto.d.ts +40 -0
- package/src/Utils/crypto.js +111 -0
- package/src/Utils/decode-wa-message.d.ts +100 -0
- package/src/Utils/decode-wa-message.js +374 -0
- package/src/Utils/event-buffer.d.ts +23 -0
- package/src/Utils/event-buffer.js +625 -0
- package/src/Utils/generics.d.ts +64 -0
- package/src/Utils/generics.js +376 -0
- package/src/Utils/group-metadata-cache.d.ts +5 -0
- package/src/Utils/group-metadata-cache.js +26 -0
- package/src/Utils/history.d.ts +76 -0
- package/src/Utils/history.js +132 -0
- package/src/Utils/html-app.d.ts +19 -0
- package/src/Utils/html-app.js +97 -0
- package/src/Utils/html-multiplayer.d.ts +10 -0
- package/src/Utils/html-multiplayer.js +95 -0
- package/src/Utils/identity-change-handler.d.ts +14 -0
- package/src/Utils/identity-change-handler.js +49 -0
- package/src/Utils/index.d.ts +45 -0
- package/src/Utils/index.js +45 -0
- package/src/Utils/link-preview-metadata.d.ts +47 -0
- package/src/Utils/link-preview-metadata.js +89 -0
- package/src/Utils/link-preview.d.ts +13 -0
- package/src/Utils/link-preview.js +80 -0
- package/src/Utils/logger.d.ts +3 -0
- package/src/Utils/logger.js +3 -0
- package/src/Utils/lt-hash.d.ts +7 -0
- package/src/Utils/lt-hash.js +4 -0
- package/src/Utils/make-mutex.d.ts +7 -0
- package/src/Utils/make-mutex.js +33 -0
- package/src/Utils/message-retry-manager.d.ts +80 -0
- package/src/Utils/message-retry-manager.js +256 -0
- package/src/Utils/messages-media.d.ts +137 -0
- package/src/Utils/messages-media.js +815 -0
- package/src/Utils/messages.d.ts +63 -0
- package/src/Utils/messages.js +2149 -0
- package/src/Utils/modern-messages.d.ts +150 -0
- package/src/Utils/modern-messages.js +496 -0
- package/src/Utils/native-flow.d.ts +11 -0
- package/src/Utils/native-flow.js +116 -0
- package/src/Utils/newsletter-status.d.ts +158 -0
- package/src/Utils/newsletter-status.js +651 -0
- package/src/Utils/noise-handler.d.ts +21 -0
- package/src/Utils/noise-handler.js +201 -0
- package/src/Utils/offline-node-processor.d.ts +10 -0
- package/src/Utils/offline-node-processor.js +34 -0
- package/src/Utils/optional-media.d.ts +3 -0
- package/src/Utils/optional-media.js +46 -0
- package/src/Utils/payment-messages.d.ts +66 -0
- package/src/Utils/payment-messages.js +161 -0
- package/src/Utils/pre-key-manager.d.ts +26 -0
- package/src/Utils/pre-key-manager.js +96 -0
- package/src/Utils/process-message.d.ts +61 -0
- package/src/Utils/process-message.js +689 -0
- package/src/Utils/reporting-utils.d.ts +13 -0
- package/src/Utils/reporting-utils.js +257 -0
- package/src/Utils/scheduled-message.d.ts +51 -0
- package/src/Utils/scheduled-message.js +113 -0
- package/src/Utils/sender-key-memory.d.ts +20 -0
- package/src/Utils/sender-key-memory.js +52 -0
- package/src/Utils/signal.d.ts +83 -0
- package/src/Utils/signal.js +194 -0
- package/src/Utils/stanza-ack.d.ts +17 -0
- package/src/Utils/stanza-ack.js +31 -0
- package/src/Utils/status-stickers.d.ts +127 -0
- package/src/Utils/status-stickers.js +261 -0
- package/src/Utils/sync-action-utils.d.ts +3 -0
- package/src/Utils/sync-action-utils.js +45 -0
- package/src/Utils/tc-token-utils.d.ts +30 -0
- package/src/Utils/tc-token-utils.js +156 -0
- package/src/Utils/ttl-cache.d.ts +29 -0
- package/src/Utils/ttl-cache.js +121 -0
- package/src/Utils/use-mongo-auth-state.d.ts +22 -0
- package/src/Utils/use-mongo-auth-state.js +68 -0
- package/src/Utils/use-multi-file-auth-state.d.ts +12 -0
- package/src/Utils/use-multi-file-auth-state.js +107 -0
- package/src/Utils/use-mysql-auth-state.d.ts +20 -0
- package/src/Utils/use-mysql-auth-state.js +80 -0
- package/src/Utils/use-postgres-auth-state.d.ts +20 -0
- package/src/Utils/use-postgres-auth-state.js +80 -0
- package/src/Utils/use-redis-auth-state.d.ts +20 -0
- package/src/Utils/use-redis-auth-state.js +90 -0
- package/src/Utils/use-single-file-auth-state.d.ts +11 -0
- package/src/Utils/use-single-file-auth-state.js +109 -0
- package/src/Utils/use-sqlite-auth-state.d.ts +13 -0
- package/src/Utils/use-sqlite-auth-state.js +121 -0
- package/src/Utils/useNekoDBAuth.d.ts +19 -0
- package/src/Utils/useNekoDBAuth.js +111 -0
- package/src/Utils/username.d.ts +12 -0
- package/src/Utils/username.js +59 -0
- package/src/Utils/validate-connection.d.ts +44 -0
- package/src/Utils/validate-connection.js +208 -0
- package/src/Utils/voice-recognition.d.ts +53 -0
- package/src/Utils/voice-recognition.js +219 -0
- package/src/Voip/audio-feeder.d.ts +25 -0
- package/src/Voip/audio-feeder.js +269 -0
- package/src/Voip/index.d.ts +89 -0
- package/src/Voip/index.js +937 -0
- package/src/Voip/relay-transport.d.ts +6 -0
- package/src/Voip/relay-transport.js +825 -0
- package/src/Voip/signaling.d.ts +12 -0
- package/src/Voip/signaling.js +1100 -0
- package/src/Voip/types.d.ts +3 -0
- package/src/Voip/types.js +13 -0
- package/src/Voip/video-feeder.d.ts +25 -0
- package/src/Voip/video-feeder.js +269 -0
- package/src/Voip/wasm-engine.d.ts +27 -0
- package/src/Voip/wasm-engine.js +1308 -0
- package/src/Voip/worker-bootstrap.js +1024 -0
- package/src/WABinary/constants.d.ts +23 -0
- package/src/WABinary/constants.js +1301 -0
- package/src/WABinary/decode.d.ts +10 -0
- package/src/WABinary/decode.js +262 -0
- package/src/WABinary/encode.d.ts +3 -0
- package/src/WABinary/encode.js +220 -0
- package/src/WABinary/generic-utils.d.ts +77 -0
- package/src/WABinary/generic-utils.js +214 -0
- package/src/WABinary/index.d.ts +6 -0
- package/src/WABinary/index.js +6 -0
- package/src/WABinary/jid-utils.d.ts +31 -0
- package/src/WABinary/jid-utils.js +98 -0
- package/src/WABinary/types.d.ts +2 -0
- package/src/WABinary/types.js +1 -0
- package/src/WAM/BinaryInfo.d.ts +8 -0
- package/src/WAM/BinaryInfo.js +10 -0
- package/src/WAM/constants.d.ts +34927 -0
- package/src/WAM/constants.js +22853 -0
- package/src/WAM/encode.d.ts +2 -0
- package/src/WAM/encode.js +149 -0
- package/src/WAM/index.d.ts +4 -0
- package/src/WAM/index.js +4 -0
- package/src/WAUSync/Protocols/USyncContactProtocol.d.ts +37 -0
- package/src/WAUSync/Protocols/USyncContactProtocol.js +51 -0
- package/src/WAUSync/Protocols/USyncDeviceProtocol.d.ts +23 -0
- package/src/WAUSync/Protocols/USyncDeviceProtocol.js +52 -0
- package/src/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +13 -0
- package/src/WAUSync/Protocols/USyncDisappearingModeProtocol.js +27 -0
- package/src/WAUSync/Protocols/USyncStatusProtocol.d.ts +13 -0
- package/src/WAUSync/Protocols/USyncStatusProtocol.js +38 -0
- package/src/WAUSync/Protocols/USyncUsernameProtocol.d.ts +10 -0
- package/src/WAUSync/Protocols/USyncUsernameProtocol.js +24 -0
- package/src/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +39 -0
- package/src/WAUSync/Protocols/UsyncBotProfileProtocol.js +50 -0
- package/src/WAUSync/Protocols/UsyncLIDProtocol.d.ts +15 -0
- package/src/WAUSync/Protocols/UsyncLIDProtocol.js +29 -0
- package/src/WAUSync/Protocols/index.d.ts +6 -0
- package/src/WAUSync/Protocols/index.js +6 -0
- package/src/WAUSync/USyncQuery.d.ts +21 -0
- package/src/WAUSync/USyncQuery.js +94 -0
- package/src/WAUSync/USyncUser.d.ts +17 -0
- package/src/WAUSync/USyncUser.js +31 -0
- package/src/WAUSync/index.d.ts +4 -0
- package/src/WAUSync/index.js +4 -0
- package/src/assets/wasm/README.md +76 -0
- package/src/assets/wasm/loader.js +5 -0
- package/src/assets/wasm/whatsapp.wasm +0 -0
- package/src/assets/wasm/worker-modules.js +273 -0
- package/src/index.d.ts +49 -0
- package/src/index.js +54 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/* Elaina Baileys maintained distribution. Upstream notices and license are preserved in LICENSE and NOTICE.md. */
|
|
2
|
+
export var GroupHistoryToggleMode;
|
|
3
|
+
(function (GroupHistoryToggleMode) {
|
|
4
|
+
GroupHistoryToggleMode[GroupHistoryToggleMode["DEFAULT"] = 0] = "DEFAULT";
|
|
5
|
+
GroupHistoryToggleMode[GroupHistoryToggleMode["ON"] = 1] = "ON";
|
|
6
|
+
GroupHistoryToggleMode[GroupHistoryToggleMode["OFF"] = 2] = "OFF";
|
|
7
|
+
})(GroupHistoryToggleMode || (GroupHistoryToggleMode = {}));
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/* Elaina Baileys maintained distribution. Upstream notices and license are preserved in LICENSE and NOTICE.md. */
|
|
2
|
+
|
|
3
|
+
export var LabelColor;
|
|
4
|
+
(function (LabelColor) {
|
|
5
|
+
LabelColor[LabelColor["Color1"] = 0] = "Color1";
|
|
6
|
+
LabelColor[LabelColor["Color2"] = 1] = "Color2";
|
|
7
|
+
LabelColor[LabelColor["Color3"] = 2] = "Color3";
|
|
8
|
+
LabelColor[LabelColor["Color4"] = 3] = "Color4";
|
|
9
|
+
LabelColor[LabelColor["Color5"] = 4] = "Color5";
|
|
10
|
+
LabelColor[LabelColor["Color6"] = 5] = "Color6";
|
|
11
|
+
LabelColor[LabelColor["Color7"] = 6] = "Color7";
|
|
12
|
+
LabelColor[LabelColor["Color8"] = 7] = "Color8";
|
|
13
|
+
LabelColor[LabelColor["Color9"] = 8] = "Color9";
|
|
14
|
+
LabelColor[LabelColor["Color10"] = 9] = "Color10";
|
|
15
|
+
LabelColor[LabelColor["Color11"] = 10] = "Color11";
|
|
16
|
+
LabelColor[LabelColor["Color12"] = 11] = "Color12";
|
|
17
|
+
LabelColor[LabelColor["Color13"] = 12] = "Color13";
|
|
18
|
+
LabelColor[LabelColor["Color14"] = 13] = "Color14";
|
|
19
|
+
LabelColor[LabelColor["Color15"] = 14] = "Color15";
|
|
20
|
+
LabelColor[LabelColor["Color16"] = 15] = "Color16";
|
|
21
|
+
LabelColor[LabelColor["Color17"] = 16] = "Color17";
|
|
22
|
+
LabelColor[LabelColor["Color18"] = 17] = "Color18";
|
|
23
|
+
LabelColor[LabelColor["Color19"] = 18] = "Color19";
|
|
24
|
+
LabelColor[LabelColor["Color20"] = 19] = "Color20";
|
|
25
|
+
})(LabelColor || (LabelColor = {}));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/* Elaina Baileys maintained distribution. Upstream notices and license are preserved in LICENSE and NOTICE.md. */
|
|
2
|
+
|
|
3
|
+
export var LabelAssociationType;
|
|
4
|
+
(function (LabelAssociationType) {
|
|
5
|
+
LabelAssociationType["Chat"] = "label_jid";
|
|
6
|
+
LabelAssociationType["Message"] = "label_message";
|
|
7
|
+
})(LabelAssociationType || (LabelAssociationType = {}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* Elaina Baileys maintained distribution. Upstream notices and license are preserved in LICENSE and NOTICE.md. */
|
|
2
|
+
export { proto as WAProto };
|
|
3
|
+
export const AssociationType: typeof proto.MessageAssociation.AssociationType;
|
|
4
|
+
export const ButtonHeaderType: typeof proto.Message.ButtonsMessage.HeaderType;
|
|
5
|
+
export const ButtonType: typeof proto.Message.ButtonsMessage.Button.Type;
|
|
6
|
+
export const CarouselCardType: typeof proto.Message.InteractiveMessage.CarouselMessage.CarouselCardType;
|
|
7
|
+
export const ListType: typeof proto.Message.ListMessage.ListType;
|
|
8
|
+
export const StatusFont: typeof proto.Message.ExtendedTextMessage.FontType;
|
|
9
|
+
export const StatusNotificationType: Readonly<Record<string, number>>;
|
|
10
|
+
export const ProtocolType: typeof proto.Message.ProtocolMessage.Type;
|
|
11
|
+
export const WAMessageStubType: typeof proto.WebMessageInfo.StubType;
|
|
12
|
+
export const WAMessageStatus: typeof proto.WebMessageInfo.Status;
|
|
13
|
+
export const WAMessageAddressingMode: any;
|
|
14
|
+
import { proto } from '../../WAProto/index.js';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/* Elaina Baileys maintained distribution. Upstream notices and license are preserved in LICENSE and NOTICE.md. */
|
|
2
|
+
import { proto } from '../../WAProto/index.js';
|
|
3
|
+
|
|
4
|
+
export { proto as WAProto };
|
|
5
|
+
|
|
6
|
+
export const AssociationType = proto.MessageAssociation.AssociationType;
|
|
7
|
+
export const ButtonHeaderType = proto.Message.ButtonsMessage.HeaderType;
|
|
8
|
+
export const ButtonType = proto.Message.ButtonsMessage.Button.Type;
|
|
9
|
+
export const CarouselCardType = proto.Message.InteractiveMessage.CarouselMessage.CarouselCardType;
|
|
10
|
+
export const ListType = proto.Message.ListMessage.ListType;
|
|
11
|
+
export const StatusFont = proto.Message.ExtendedTextMessage.FontType;
|
|
12
|
+
|
|
13
|
+
export const StatusNotificationType = Object.freeze({
|
|
14
|
+
...proto.Message.StatusNotificationMessage.StatusNotificationType,
|
|
15
|
+
STATUS_GROUP_STATUS_REPLY: 4
|
|
16
|
+
});
|
|
17
|
+
export const ProtocolType = proto.Message.ProtocolMessage.Type;
|
|
18
|
+
export const WAMessageStubType = proto.WebMessageInfo.StubType;
|
|
19
|
+
export const WAMessageStatus = proto.WebMessageInfo.Status;
|
|
20
|
+
export var WAMessageAddressingMode;
|
|
21
|
+
(function (WAMessageAddressingMode) {
|
|
22
|
+
WAMessageAddressingMode["PN"] = "pn";
|
|
23
|
+
WAMessageAddressingMode["LID"] = "lid";
|
|
24
|
+
})(WAMessageAddressingMode || (WAMessageAddressingMode = {}));
|
package/src/Types/Mex.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/* Elaina Baileys maintained distribution. Upstream notices and license are preserved in LICENSE and NOTICE.md. */
|
|
2
|
+
export var XWAPaths;
|
|
3
|
+
(function (XWAPaths) {
|
|
4
|
+
XWAPaths["xwa2_newsletter_create"] = "xwa2_newsletter_create";
|
|
5
|
+
XWAPaths["xwa2_newsletter_subscribed"] = "xwa2_newsletter_subscribed";
|
|
6
|
+
XWAPaths["xwa2_newsletter_metadata"] = "xwa2_newsletter";
|
|
7
|
+
XWAPaths["xwa2_newsletter_admin_count"] = "xwa2_newsletter_admin";
|
|
8
|
+
XWAPaths["xwa2_channel_enforcements"] = "xwa2_channel_enforcements";
|
|
9
|
+
XWAPaths["xwa2_channels_reports"] = "xwa2_channels_reports";
|
|
10
|
+
XWAPaths["xwa2_create_channel_report_appeal_v2"] = "xwa2_create_channel_report_appeal_v2";
|
|
11
|
+
XWAPaths["xwa2_newsletter_update_user_setting"] = "xwa2_newsletter_update_user_setting";
|
|
12
|
+
XWAPaths["xwa2_newsletter_join_v2"] = "xwa2_newsletter_join_v2";
|
|
13
|
+
XWAPaths["xwa2_newsletter_leave_v2"] = "xwa2_newsletter_leave_v2";
|
|
14
|
+
XWAPaths["xwa2_newsletter_change_owner"] = "xwa2_newsletter_change_owner";
|
|
15
|
+
XWAPaths["xwa2_newsletter_demote"] = "xwa2_newsletter_admin_demote";
|
|
16
|
+
XWAPaths["xwa2_newsletter_delete_v2"] = "xwa2_newsletter_delete_v2";
|
|
17
|
+
XWAPaths["xwa2_fetch_account_reachout_timelock"] = "xwa2_fetch_account_reachout_timelock";
|
|
18
|
+
XWAPaths["xwa2_message_capping_info"] = "xwa2_message_capping_info";
|
|
19
|
+
XWAPaths["xwa2_newsletter_admin_capabilities"] = "xwa2_newsletter_admin";
|
|
20
|
+
XWAPaths["xwa2_newsletter_admin_info"] = "xwa2_newsletter_admin";
|
|
21
|
+
XWAPaths["admin_profile"] = "xwa2_newsletter_admin";
|
|
22
|
+
XWAPaths["voter_list"] = "voter_list";
|
|
23
|
+
XWAPaths["xwa2_newsletters_reaction_sender_list"] = "xwa2_newsletters_reaction_sender_list";
|
|
24
|
+
XWAPaths["xwa2_newsletter_pin_messages"] = "xwa2_newsletter_pin_messages";
|
|
25
|
+
XWAPaths["xwa2_newsletter_unpin_messages"] = "xwa2_newsletter_unpin_messages";
|
|
26
|
+
XWAPaths["xwa2_newsletter_label_ai_content"] = "xwa2_newsletter_label_ai_content";
|
|
27
|
+
XWAPaths["xwa2_newsletter_label_paid_partnership"] = "xwa2_newsletter_label_paid_partnership";
|
|
28
|
+
XWAPaths["xwa2_newsletter_admin_invite_create"] = "xwa2_newsletter_admin_invite_create";
|
|
29
|
+
XWAPaths["xwa2_newsletter_admin_invite_revoke"] = "xwa2_newsletter_admin_invite_revoke";
|
|
30
|
+
XWAPaths["xwa2_newsletter_admin_invite_accept"] = "xwa2_newsletter_admin_invite_accept";
|
|
31
|
+
XWAPaths["xwa2_newsletters_recommended"] = "xwa2_newsletters_recommended";
|
|
32
|
+
XWAPaths["xwa2_newsletters_similar"] = "xwa2_newsletters_similar";
|
|
33
|
+
XWAPaths["xwa2_username_get"] = "xwa2_username_get";
|
|
34
|
+
XWAPaths["xwa2_username_set"] = "xwa2_username_set";
|
|
35
|
+
XWAPaths["xwa2_username_pin_set"] = "xwa2_username_pin_set";
|
|
36
|
+
XWAPaths["xwa2_update_text_status"] = "xwa2_update_text_status";
|
|
37
|
+
XWAPaths["xwa2_text_status_list"] = "xwa2_text_status_list";
|
|
38
|
+
XWAPaths["xwa2_users_updates_since"] = "xwa2_users_updates_since";
|
|
39
|
+
XWAPaths["xwa2_newsletter_link_preview"] = "xwa2_newsletter_link_preview";
|
|
40
|
+
XWAPaths["xwa2_newsletter_admin_insights"] = "xwa2_newsletter_admin_insights";
|
|
41
|
+
XWAPaths["xwa2_newsletter_followers"] = "xwa2_newsletter_followers";
|
|
42
|
+
XWAPaths["pending_admin_invites"] = "xwa2_newsletter_admin";
|
|
43
|
+
XWAPaths["xwa2_newsletter_question_response_state_update"] = "xwa2_newsletter_question_response_state_update";
|
|
44
|
+
XWAPaths["xwa2_username_check"] = "xwa2_username_check";
|
|
45
|
+
XWAPaths["xwa2_newsletters_directory_list"] = "xwa2_newsletters_directory_list";
|
|
46
|
+
XWAPaths["xwa2_newsletters_directory_search"] = "xwa2_newsletters_directory_search";
|
|
47
|
+
XWAPaths["xwa2_newsletters_directory_category_preview"] = "xwa2_newsletters_directory_category_preview";
|
|
48
|
+
})(XWAPaths || (XWAPaths = {}));
|
|
49
|
+
export var QueryIds;
|
|
50
|
+
(function (QueryIds) {
|
|
51
|
+
QueryIds["CREATE"] = "25149874324715067";
|
|
52
|
+
QueryIds["UPDATE_METADATA"] = "24250201037901610";
|
|
53
|
+
QueryIds["METADATA"] = "27456920720571478";
|
|
54
|
+
QueryIds["SUBSCRIBERS"] = "27472091235714801";
|
|
55
|
+
QueryIds["SUBSCRIBED"] = "25399611239711790";
|
|
56
|
+
QueryIds["FOLLOW"] = "24404358912487870";
|
|
57
|
+
QueryIds["UNFOLLOW"] = "9767147403369991";
|
|
58
|
+
QueryIds["ENFORCEMENTS"] = "27835373536068060";
|
|
59
|
+
QueryIds["CHANNEL_REPORTS"] = "35936238352686172";
|
|
60
|
+
QueryIds["CREATE_REPORT_APPEAL"] = "27103316329328467";
|
|
61
|
+
QueryIds["UPDATE_USER_SETTING"] = "31938993655691868";
|
|
62
|
+
QueryIds["ADMIN_COUNT"] = "26278439461859188";
|
|
63
|
+
QueryIds["CHANGE_OWNER"] = "9546742745432473";
|
|
64
|
+
QueryIds["DEMOTE"] = "9880997548630971";
|
|
65
|
+
QueryIds["DELETE"] = "30062808666639665";
|
|
66
|
+
QueryIds["REACHOUT_TIMELOCK"] = "23983697327930364";
|
|
67
|
+
QueryIds["MESSAGE_CAPPING_INFO"] = "27910975521856601";
|
|
68
|
+
QueryIds["ADMIN_CAPABILITIES"] = "9801384413216421";
|
|
69
|
+
QueryIds["ADMIN_INFO"] = "26278439461859188";
|
|
70
|
+
QueryIds["POLL_VOTERS"] = "9407762219322536";
|
|
71
|
+
QueryIds["REACTION_SENDER_LIST"] = "29575462448733991";
|
|
72
|
+
QueryIds["PIN_MESSAGES"] = "27165709459706559";
|
|
73
|
+
QueryIds["UNPIN_MESSAGES"] = "28007176042216937";
|
|
74
|
+
QueryIds["LABEL_AI_CONTENT"] = "27909718265289596";
|
|
75
|
+
QueryIds["PAID_PARTNERSHIP_LABEL"] = "26102375079404865";
|
|
76
|
+
QueryIds["CREATE_ADMIN_INVITE"] = "9387141988078609";
|
|
77
|
+
QueryIds["REVOKE_ADMIN_INVITE"] = "9656078347839416";
|
|
78
|
+
QueryIds["ACCEPT_ADMIN_INVITE"] = "9580828702035549";
|
|
79
|
+
QueryIds["RECOMMENDED"] = "25806748772361516";
|
|
80
|
+
QueryIds["SIMILAR"] = "26217043484590756";
|
|
81
|
+
QueryIds["USERNAME_GET"] = "25347099718279209";
|
|
82
|
+
QueryIds["USERNAME_SET"] = "25757341163897635";
|
|
83
|
+
QueryIds["USERNAME_PIN_SET"] = "9749436995157074";
|
|
84
|
+
QueryIds["UPDATE_TEXT_STATUS"] = "9152604461510864";
|
|
85
|
+
QueryIds["TEXT_STATUS_LIST"] = "24072923595647473";
|
|
86
|
+
QueryIds["ABOUT_STATUS"] = "24535500086059408";
|
|
87
|
+
QueryIds["PLAINTEXT_LINK_PREVIEW"] = "9101130456653613";
|
|
88
|
+
QueryIds["INSIGHTS"] = "9853618868050977";
|
|
89
|
+
QueryIds["FOLLOWERS"] = "27472091235714801";
|
|
90
|
+
QueryIds["PENDING_ADMIN_INVITES"] = "28049623068067370";
|
|
91
|
+
QueryIds["QUESTION_RESPONSE_STATE"] = "24636260219323456";
|
|
92
|
+
QueryIds["USERNAME_CHECK"] = "26122779627399568";
|
|
93
|
+
QueryIds["DIRECTORY_LIST"] = "26125047313831973";
|
|
94
|
+
QueryIds["DIRECTORY_SEARCH"] = "26301059626252132";
|
|
95
|
+
QueryIds["DIRECTORY_CATEGORIES"] = "35266481849605779";
|
|
96
|
+
})(QueryIds || (QueryIds = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* Elaina Baileys maintained distribution. Upstream notices and license are preserved in LICENSE and NOTICE.md. */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* Elaina Baileys maintained distribution. Upstream notices and license are preserved in LICENSE and NOTICE.md. */
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/* Elaina Baileys maintained distribution. Upstream notices and license are preserved in LICENSE and NOTICE.md. */
|
|
2
|
+
export const SyncState: any;
|
|
3
|
+
export const ReachoutTimelockEnforcementType: any;
|
|
4
|
+
export const NewChatMessageCappingStatusType: any;
|
|
5
|
+
export const NewChatMessageCappingMVStatusType: any;
|
|
6
|
+
export const NewChatMessageCappingOTEStatusType: any;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/* Elaina Baileys maintained distribution. Upstream notices and license are preserved in LICENSE and NOTICE.md. */
|
|
2
|
+
export var SyncState;
|
|
3
|
+
(function (SyncState) {
|
|
4
|
+
|
|
5
|
+
SyncState[SyncState["Connecting"] = 0] = "Connecting";
|
|
6
|
+
|
|
7
|
+
SyncState[SyncState["AwaitingInitialSync"] = 1] = "AwaitingInitialSync";
|
|
8
|
+
|
|
9
|
+
SyncState[SyncState["Syncing"] = 2] = "Syncing";
|
|
10
|
+
|
|
11
|
+
SyncState[SyncState["Online"] = 3] = "Online";
|
|
12
|
+
})(SyncState || (SyncState = {}));
|
|
13
|
+
export var ReachoutTimelockEnforcementType;
|
|
14
|
+
(function (ReachoutTimelockEnforcementType) {
|
|
15
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_ALCOHOL"] = "BIZ_COMMERCE_VIOLATION_ALCOHOL";
|
|
16
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_ADULT"] = "BIZ_COMMERCE_VIOLATION_ADULT";
|
|
17
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_ANIMALS"] = "BIZ_COMMERCE_VIOLATION_ANIMALS";
|
|
18
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_BODY_PARTS_FLUIDS"] = "BIZ_COMMERCE_VIOLATION_BODY_PARTS_FLUIDS";
|
|
19
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_DATING"] = "BIZ_COMMERCE_VIOLATION_DATING";
|
|
20
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_DIGITAL_SERVICES_PRODUCTS"] = "BIZ_COMMERCE_VIOLATION_DIGITAL_SERVICES_PRODUCTS";
|
|
21
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_DRUGS"] = "BIZ_COMMERCE_VIOLATION_DRUGS";
|
|
22
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_DRUGS_ONLY_OTC"] = "BIZ_COMMERCE_VIOLATION_DRUGS_ONLY_OTC";
|
|
23
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_GAMBLING"] = "BIZ_COMMERCE_VIOLATION_GAMBLING";
|
|
24
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_HEALTHCARE"] = "BIZ_COMMERCE_VIOLATION_HEALTHCARE";
|
|
25
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_REAL_FAKE_CURRENCY"] = "BIZ_COMMERCE_VIOLATION_REAL_FAKE_CURRENCY";
|
|
26
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_SUPPLEMENTS"] = "BIZ_COMMERCE_VIOLATION_SUPPLEMENTS";
|
|
27
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_TOBACCO"] = "BIZ_COMMERCE_VIOLATION_TOBACCO";
|
|
28
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_VIOLENT_CONTENT"] = "BIZ_COMMERCE_VIOLATION_VIOLENT_CONTENT";
|
|
29
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_WEAPONS"] = "BIZ_COMMERCE_VIOLATION_WEAPONS";
|
|
30
|
+
ReachoutTimelockEnforcementType["BIZ_QUALITY"] = "BIZ_QUALITY";
|
|
31
|
+
|
|
32
|
+
ReachoutTimelockEnforcementType["DEFAULT"] = "DEFAULT";
|
|
33
|
+
ReachoutTimelockEnforcementType["WEB_COMPANION_ONLY"] = "WEB_COMPANION_ONLY";
|
|
34
|
+
})(ReachoutTimelockEnforcementType || (ReachoutTimelockEnforcementType = {}));
|
|
35
|
+
export var NewChatMessageCappingStatusType;
|
|
36
|
+
(function (NewChatMessageCappingStatusType) {
|
|
37
|
+
NewChatMessageCappingStatusType["NONE"] = "NONE";
|
|
38
|
+
NewChatMessageCappingStatusType["FIRST_WARNING"] = "FIRST_WARNING";
|
|
39
|
+
NewChatMessageCappingStatusType["SECOND_WARNING"] = "SECOND_WARNING";
|
|
40
|
+
NewChatMessageCappingStatusType["CAPPED"] = "CAPPED";
|
|
41
|
+
})(NewChatMessageCappingStatusType || (NewChatMessageCappingStatusType = {}));
|
|
42
|
+
export var NewChatMessageCappingMVStatusType;
|
|
43
|
+
(function (NewChatMessageCappingMVStatusType) {
|
|
44
|
+
NewChatMessageCappingMVStatusType["NOT_ELIGIBLE"] = "NOT_ELIGIBLE";
|
|
45
|
+
NewChatMessageCappingMVStatusType["NOT_ACTIVE"] = "NOT_ACTIVE";
|
|
46
|
+
NewChatMessageCappingMVStatusType["ACTIVE"] = "ACTIVE";
|
|
47
|
+
NewChatMessageCappingMVStatusType["ACTIVE_UPGRADE_AVAILABLE"] = "ACTIVE_UPGRADE_AVAILABLE";
|
|
48
|
+
})(NewChatMessageCappingMVStatusType || (NewChatMessageCappingMVStatusType = {}));
|
|
49
|
+
export var NewChatMessageCappingOTEStatusType;
|
|
50
|
+
(function (NewChatMessageCappingOTEStatusType) {
|
|
51
|
+
NewChatMessageCappingOTEStatusType["NOT_ELIGIBLE"] = "NOT_ELIGIBLE";
|
|
52
|
+
NewChatMessageCappingOTEStatusType["ELIGIBLE"] = "ELIGIBLE";
|
|
53
|
+
NewChatMessageCappingOTEStatusType["ACTIVE_IN_CURRENT_CYCLE"] = "ACTIVE_IN_CURRENT_CYCLE";
|
|
54
|
+
NewChatMessageCappingOTEStatusType["EXHAUSTED"] = "EXHAUSTED";
|
|
55
|
+
})(NewChatMessageCappingOTEStatusType || (NewChatMessageCappingOTEStatusType = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* Elaina Baileys maintained distribution. Upstream notices and license are preserved in LICENSE and NOTICE.md. */
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* Elaina Baileys maintained distribution. Upstream notices and license are preserved in LICENSE and NOTICE.md. */
|
|
2
|
+
export * from "./Auth.js";
|
|
3
|
+
export * from "./GroupMetadata.js";
|
|
4
|
+
export * from "./Chat.js";
|
|
5
|
+
export * from "./Contact.js";
|
|
6
|
+
export * from "./State.js";
|
|
7
|
+
export * from "./Message.js";
|
|
8
|
+
export * from "./Socket.js";
|
|
9
|
+
export * from "./Events.js";
|
|
10
|
+
export * from "./Product.js";
|
|
11
|
+
export * from "./Call.js";
|
|
12
|
+
export * from "./Signal.js";
|
|
13
|
+
export * from "./Mex.js";
|
|
14
|
+
export const DisconnectReason: any;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/* Elaina Baileys maintained distribution. Upstream notices and license are preserved in LICENSE and NOTICE.md. */
|
|
2
|
+
export * from './Auth.js';
|
|
3
|
+
export * from './GroupMetadata.js';
|
|
4
|
+
export * from './Chat.js';
|
|
5
|
+
export * from './Contact.js';
|
|
6
|
+
export * from './State.js';
|
|
7
|
+
export * from './Message.js';
|
|
8
|
+
export * from './Socket.js';
|
|
9
|
+
export * from './Events.js';
|
|
10
|
+
export * from './Product.js';
|
|
11
|
+
export * from './Call.js';
|
|
12
|
+
export * from './Signal.js';
|
|
13
|
+
export * from './Mex.js';
|
|
14
|
+
export var DisconnectReason;
|
|
15
|
+
(function (DisconnectReason) {
|
|
16
|
+
DisconnectReason[DisconnectReason["connectionClosed"] = 428] = "connectionClosed";
|
|
17
|
+
DisconnectReason[DisconnectReason["connectionLost"] = 408] = "connectionLost";
|
|
18
|
+
DisconnectReason[DisconnectReason["connectionReplaced"] = 440] = "connectionReplaced";
|
|
19
|
+
DisconnectReason[DisconnectReason["timedOut"] = 408] = "timedOut";
|
|
20
|
+
DisconnectReason[DisconnectReason["loggedOut"] = 401] = "loggedOut";
|
|
21
|
+
DisconnectReason[DisconnectReason["badSession"] = 500] = "badSession";
|
|
22
|
+
DisconnectReason[DisconnectReason["restartRequired"] = 515] = "restartRequired";
|
|
23
|
+
DisconnectReason[DisconnectReason["multideviceMismatch"] = 411] = "multideviceMismatch";
|
|
24
|
+
DisconnectReason[DisconnectReason["forbidden"] = 403] = "forbidden";
|
|
25
|
+
DisconnectReason[DisconnectReason["unavailableService"] = 503] = "unavailableService";
|
|
26
|
+
})(DisconnectReason || (DisconnectReason = {}));
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/* Elaina Baileys maintained distribution. Upstream notices and license are preserved in LICENSE and NOTICE.md. */
|
|
2
|
+
export const CREDS_KEY: string;
|
|
3
|
+
export function encodeAuthValue(value: any): string;
|
|
4
|
+
export function decodeAuthValue(type: string, raw: any): any;
|
|
5
|
+
export function loadOptionalModule(name: string, usedBy: string): Promise<any>;
|
|
6
|
+
export interface AuthStoreEntry {
|
|
7
|
+
type: string;
|
|
8
|
+
id: string;
|
|
9
|
+
value: string;
|
|
10
|
+
}
|
|
11
|
+
export interface AuthStore {
|
|
12
|
+
read: (type: string, id: string) => Promise<any>;
|
|
13
|
+
readMany: (type: string, ids: string[]) => Promise<Record<string, any>>;
|
|
14
|
+
write: (type: string, id: string, value: string) => Promise<void>;
|
|
15
|
+
apply: (writes: AuthStoreEntry[], removals: Omit<AuthStoreEntry, 'value'>[]) => Promise<void>;
|
|
16
|
+
clear: () => Promise<void>;
|
|
17
|
+
close?: () => Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
export function makeAuthStateFromStore(store: AuthStore): Promise<{
|
|
20
|
+
state: {
|
|
21
|
+
creds: any;
|
|
22
|
+
keys: {
|
|
23
|
+
get: (type: any, ids: any) => Promise<{}>;
|
|
24
|
+
set: (data: any) => Promise<void>;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
saveCreds: () => Promise<void>;
|
|
28
|
+
clearAuth: () => Promise<void>;
|
|
29
|
+
close: () => Promise<void>;
|
|
30
|
+
}>;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/* Elaina Baileys maintained distribution. Upstream notices and license are preserved in LICENSE and NOTICE.md. */
|
|
2
|
+
import { proto } from '../../WAProto/index.js';
|
|
3
|
+
import { initAuthCreds } from './auth-utils.js';
|
|
4
|
+
import { BufferJSON } from './generics.js';
|
|
5
|
+
export const CREDS_KEY = 'creds';
|
|
6
|
+
export const encodeAuthValue = (value) => JSON.stringify(value, BufferJSON.replacer);
|
|
7
|
+
export const decodeAuthValue = (type, raw) => {
|
|
8
|
+
if (raw === null || raw === undefined) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
const value = typeof raw === 'string' ? JSON.parse(raw, BufferJSON.reviver) : raw;
|
|
12
|
+
if (type === 'app-state-sync-key' && value) {
|
|
13
|
+
return proto.Message.AppStateSyncKeyData.fromObject(value);
|
|
14
|
+
}
|
|
15
|
+
return value;
|
|
16
|
+
};
|
|
17
|
+
export const loadOptionalModule = async (name, usedBy) => {
|
|
18
|
+
try {
|
|
19
|
+
const mod = await import(name);
|
|
20
|
+
return mod.default ?? mod;
|
|
21
|
+
}
|
|
22
|
+
catch (err) {
|
|
23
|
+
const helpful = new Error(`\`${name}\` is required for \`${usedBy}\`. Install it as a peer dependency: \`npm install ${name}\`.`);
|
|
24
|
+
helpful.cause = err;
|
|
25
|
+
throw helpful;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
export const makeAuthStateFromStore = async (store) => {
|
|
29
|
+
const stored = await store.read(CREDS_KEY, CREDS_KEY);
|
|
30
|
+
const creds = decodeAuthValue(CREDS_KEY, stored) ?? initAuthCreds();
|
|
31
|
+
const state = {
|
|
32
|
+
creds,
|
|
33
|
+
keys: {
|
|
34
|
+
get: async (type, ids) => {
|
|
35
|
+
const data = {};
|
|
36
|
+
const rows = await store.readMany(type, ids);
|
|
37
|
+
for (const id of ids) {
|
|
38
|
+
const value = decodeAuthValue(type, rows[id]);
|
|
39
|
+
if (value) {
|
|
40
|
+
data[id] = value;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return data;
|
|
44
|
+
},
|
|
45
|
+
set: async (data) => {
|
|
46
|
+
const writes = [];
|
|
47
|
+
const removals = [];
|
|
48
|
+
for (const type in data) {
|
|
49
|
+
for (const id in data[type]) {
|
|
50
|
+
const value = data[type][id];
|
|
51
|
+
if (value) {
|
|
52
|
+
writes.push({ type, id, value: encodeAuthValue(value) });
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
removals.push({ type, id });
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (writes.length || removals.length) {
|
|
60
|
+
await store.apply(writes, removals);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
return {
|
|
66
|
+
state,
|
|
67
|
+
saveCreds: async () => {
|
|
68
|
+
await store.write(CREDS_KEY, CREDS_KEY, encodeAuthValue(creds));
|
|
69
|
+
},
|
|
70
|
+
clearAuth: async () => {
|
|
71
|
+
await store.clear();
|
|
72
|
+
},
|
|
73
|
+
close: async () => {
|
|
74
|
+
await store.close?.();
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/* Elaina Baileys maintained distribution. Upstream notices and license are preserved in LICENSE and NOTICE.md. */
|
|
2
|
+
/**
|
|
3
|
+
* Adds caching capability to a SignalKeyStore
|
|
4
|
+
* @param store the store to add caching to
|
|
5
|
+
* @param logger to log trace events
|
|
6
|
+
* @param _cache cache store to use
|
|
7
|
+
*/
|
|
8
|
+
export function makeCacheableSignalKeyStore(store: any, logger: any, _cache: any): {
|
|
9
|
+
get(type: any, ids: any): Promise<any>;
|
|
10
|
+
set(data: any): Promise<any>;
|
|
11
|
+
clear(): Promise<void>;
|
|
12
|
+
};
|
|
13
|
+
export function addTransactionCapability(state: any, logger: any, { maxCommitRetries, delayBetweenTriesMs }: {
|
|
14
|
+
maxCommitRetries: any;
|
|
15
|
+
delayBetweenTriesMs: any;
|
|
16
|
+
}): {
|
|
17
|
+
get: (type: any, ids: any) => Promise<any>;
|
|
18
|
+
set: (data: any) => Promise<void>;
|
|
19
|
+
isInTransaction: () => boolean;
|
|
20
|
+
transaction: (work: any, key: any) => Promise<any>;
|
|
21
|
+
};
|
|
22
|
+
export function assertMeId(creds: any): any;
|
|
23
|
+
export function initAuthCreds(): {
|
|
24
|
+
noiseKey: {
|
|
25
|
+
private: any;
|
|
26
|
+
public: any;
|
|
27
|
+
};
|
|
28
|
+
pairingEphemeralKeyPair: {
|
|
29
|
+
private: any;
|
|
30
|
+
public: any;
|
|
31
|
+
};
|
|
32
|
+
signedIdentityKey: {
|
|
33
|
+
private: any;
|
|
34
|
+
public: any;
|
|
35
|
+
};
|
|
36
|
+
signedPreKey: {
|
|
37
|
+
keyPair: {
|
|
38
|
+
private: any;
|
|
39
|
+
public: any;
|
|
40
|
+
};
|
|
41
|
+
signature: any;
|
|
42
|
+
keyId: any;
|
|
43
|
+
};
|
|
44
|
+
registrationId: number;
|
|
45
|
+
advSecretKey: any;
|
|
46
|
+
processedHistoryMessages: never[];
|
|
47
|
+
nextPreKeyId: number;
|
|
48
|
+
firstUnuploadedPreKeyId: number;
|
|
49
|
+
accountSyncCounter: number;
|
|
50
|
+
accountSettings: {
|
|
51
|
+
unarchiveChats: boolean;
|
|
52
|
+
};
|
|
53
|
+
registered: boolean;
|
|
54
|
+
pairingCode: undefined;
|
|
55
|
+
lastPropHash: undefined;
|
|
56
|
+
serverProps: undefined;
|
|
57
|
+
routingInfo: undefined;
|
|
58
|
+
additionalData: undefined;
|
|
59
|
+
};
|