@deffa5556/bail 1.0.6 → 1.0.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/cjs/WAProto/index.cjs +106053 -0
- package/cjs/deffa/config.cjs +14 -0
- package/cjs/deffa/plugins/ai/deepseekr1.cjs +35 -0
- package/cjs/deffa/plugins/ai/gita.cjs +26 -0
- package/cjs/deffa/plugins/ai/glm47flash.cjs +35 -0
- package/cjs/deffa/plugins/ai/gptoss120b.cjs +35 -0
- package/cjs/deffa/plugins/ai/qwq32b.cjs +35 -0
- package/cjs/deffa/plugins/berita/antara.cjs +25 -0
- package/cjs/deffa/plugins/berita/cnbcindonesia.cjs +25 -0
- package/cjs/deffa/plugins/berita/cnn.cjs +25 -0
- package/cjs/deffa/plugins/berita/kompas.cjs +25 -0
- package/cjs/deffa/plugins/berita/liputan6.cjs +25 -0
- package/cjs/deffa/plugins/berita/merdeka.cjs +25 -0
- package/cjs/deffa/plugins/berita/sindonews.cjs +25 -0
- package/cjs/deffa/plugins/berita/tribunnews.cjs +25 -0
- package/cjs/deffa/plugins/downloader/douyin.cjs +30 -0
- package/cjs/deffa/plugins/downloader/facebook.cjs +30 -0
- package/cjs/deffa/plugins/downloader/github.cjs +35 -0
- package/cjs/deffa/plugins/downloader/lahelu.cjs +30 -0
- package/cjs/deffa/plugins/downloader/snackvideo.cjs +30 -0
- package/cjs/deffa/plugins/downloader/soundcloud.cjs +30 -0
- package/cjs/deffa/plugins/downloader/tiktok.cjs +30 -0
- package/cjs/deffa/plugins/downloader/tiktokhd.cjs +30 -0
- package/cjs/deffa/plugins/downloader/twitter.cjs +30 -0
- package/cjs/deffa/plugins/downloader/ummy.cjs +36 -0
- package/cjs/deffa/plugins/index.cjs +213 -0
- package/cjs/deffa/plugins/info/bmkg.cjs +34 -0
- package/cjs/deffa/plugins/info/cuaca.cjs +31 -0
- package/cjs/deffa/plugins/info/jadwaltv.cjs +29 -0
- package/cjs/deffa/plugins/maker/brat.cjs +45 -0
- package/cjs/deffa/plugins/maker/bratvid.cjs +52 -0
- package/cjs/deffa/plugins/search/8font.cjs +28 -0
- package/cjs/deffa/plugins/search/applemusic.cjs +28 -0
- package/cjs/deffa/plugins/search/bimg.cjs +30 -0
- package/cjs/deffa/plugins/search/brave.cjs +34 -0
- package/cjs/deffa/plugins/search/duckduckgo.cjs +28 -0
- package/cjs/deffa/plugins/search/lahelu.cjs +28 -0
- package/cjs/deffa/plugins/search/mangatoon.cjs +28 -0
- package/cjs/deffa/plugins/search/mcpedl.cjs +28 -0
- package/cjs/deffa/plugins/search/myinstants.cjs +28 -0
- package/cjs/deffa/plugins/search/otakotaku.cjs +28 -0
- package/cjs/deffa/plugins/search/pinterest.cjs +30 -0
- package/cjs/deffa/plugins/search/resep.cjs +28 -0
- package/cjs/deffa/plugins/search/seegore.cjs +30 -0
- package/cjs/deffa/plugins/search/soundcloud.cjs +28 -0
- package/cjs/deffa/plugins/search/youtube.cjs +28 -0
- package/cjs/deffa/plugins/stalk/github.cjs +38 -0
- package/cjs/deffa/plugins/stalk/pinterest.cjs +37 -0
- package/cjs/deffa/plugins/stalk/threads.cjs +34 -0
- package/cjs/deffa/plugins/stalk/tiktok.cjs +37 -0
- package/cjs/deffa/plugins/stalk/twitter.cjs +37 -0
- package/cjs/deffa/plugins/stalk/youtube.cjs +37 -0
- package/cjs/lib/Defaults/index.cjs +158 -0
- package/cjs/lib/Discord/Client.cjs +263 -0
- package/cjs/lib/Discord/Constants.cjs +1842 -0
- package/cjs/lib/Discord/connect-dc.cjs +11 -0
- package/cjs/lib/Discord/esm-bridge.cjs +136 -0
- package/cjs/lib/Discord/gateway/Dispatcher.cjs +93 -0
- package/cjs/lib/Discord/gateway/Shard.cjs +695 -0
- package/cjs/lib/Discord/gateway/ShardManager.cjs +344 -0
- package/cjs/lib/Discord/gateway/compression/base.cjs +13 -0
- package/cjs/lib/Discord/gateway/compression/config.cjs +47 -0
- package/cjs/lib/Discord/gateway/compression/pako.cjs +44 -0
- package/cjs/lib/Discord/gateway/compression/zlib-native.cjs +47 -0
- package/cjs/lib/Discord/gateway/compression/zlib-sync.cjs +31 -0
- package/cjs/lib/Discord/gateway/compression/zstd-napi.cjs +80 -0
- package/cjs/lib/Discord/gateway/compression/zstd-native.cjs +46 -0
- package/cjs/lib/Discord/gateway/events.cjs +956 -0
- package/cjs/lib/Discord/index.cjs +238 -0
- package/cjs/lib/Discord/rest/Bucket.cjs +69 -0
- package/cjs/lib/Discord/rest/DiscordHTTPError.cjs +63 -0
- package/cjs/lib/Discord/rest/DiscordRESTError.cjs +84 -0
- package/cjs/lib/Discord/rest/OAuthHelper.cjs +226 -0
- package/cjs/lib/Discord/rest/RESTManager.cjs +116 -0
- package/cjs/lib/Discord/rest/RequestHandler.cjs +320 -0
- package/cjs/lib/Discord/rest/SequentialBucket.cjs +69 -0
- package/cjs/lib/Discord/routes/Applications.cjs +625 -0
- package/cjs/lib/Discord/routes/Channels.cjs +1199 -0
- package/cjs/lib/Discord/routes/Guilds.cjs +1792 -0
- package/cjs/lib/Discord/routes/Interactions.cjs +212 -0
- package/cjs/lib/Discord/routes/Lobbies.cjs +197 -0
- package/cjs/lib/Discord/routes/Miscellaneous.cjs +120 -0
- package/cjs/lib/Discord/routes/OAuth.cjs +350 -0
- package/cjs/lib/Discord/routes/Users.cjs +107 -0
- package/cjs/lib/Discord/routes/Webhooks.cjs +308 -0
- package/cjs/lib/Discord/structures/AnnouncementChannel.cjs +46 -0
- package/cjs/lib/Discord/structures/AnnouncementThreadChannel.cjs +28 -0
- package/cjs/lib/Discord/structures/Application.cjs +345 -0
- package/cjs/lib/Discord/structures/ApplicationCommand.cjs +109 -0
- package/cjs/lib/Discord/structures/Attachment.cjs +46 -0
- package/cjs/lib/Discord/structures/AuditLogEntry.cjs +41 -0
- package/cjs/lib/Discord/structures/AutoModerationRule.cjs +117 -0
- package/cjs/lib/Discord/structures/AutocompleteInteraction.cjs +90 -0
- package/cjs/lib/Discord/structures/Base.cjs +56 -0
- package/cjs/lib/Discord/structures/BaseEntitlement.cjs +40 -0
- package/cjs/lib/Discord/structures/CategoryChannel.cjs +102 -0
- package/cjs/lib/Discord/structures/Channel.cjs +89 -0
- package/cjs/lib/Discord/structures/ClientApplication.cjs +269 -0
- package/cjs/lib/Discord/structures/CommandInteraction.cjs +294 -0
- package/cjs/lib/Discord/structures/ComponentInteraction.cjs +306 -0
- package/cjs/lib/Discord/structures/Entitlement.cjs +24 -0
- package/cjs/lib/Discord/structures/ExtendedUser.cjs +48 -0
- package/cjs/lib/Discord/structures/ForumChannel.cjs +20 -0
- package/cjs/lib/Discord/structures/GroupChannel.cjs +160 -0
- package/cjs/lib/Discord/structures/Guild.cjs +1289 -0
- package/cjs/lib/Discord/structures/GuildChannel.cjs +82 -0
- package/cjs/lib/Discord/structures/GuildPreview.cjs +141 -0
- package/cjs/lib/Discord/structures/GuildScheduledEvent.cjs +166 -0
- package/cjs/lib/Discord/structures/GuildTemplate.cjs +96 -0
- package/cjs/lib/Discord/structures/Integration.cjs +123 -0
- package/cjs/lib/Discord/structures/Interaction.cjs +78 -0
- package/cjs/lib/Discord/structures/InteractionResolvedChannel.cjs +36 -0
- package/cjs/lib/Discord/structures/Invite.cjs +196 -0
- package/cjs/lib/Discord/structures/InviteGuild.cjs +117 -0
- package/cjs/lib/Discord/structures/InviteRole.cjs +88 -0
- package/cjs/lib/Discord/structures/Lobby.cjs +84 -0
- package/cjs/lib/Discord/structures/LobbyMember.cjs +30 -0
- package/cjs/lib/Discord/structures/MediaChannel.cjs +20 -0
- package/cjs/lib/Discord/structures/Member.cjs +300 -0
- package/cjs/lib/Discord/structures/Message.cjs +553 -0
- package/cjs/lib/Discord/structures/ModalSubmitInteraction.cjs +263 -0
- package/cjs/lib/Discord/structures/OAuthApplication.cjs +203 -0
- package/cjs/lib/Discord/structures/OAuthGuild.cjs +98 -0
- package/cjs/lib/Discord/structures/PartialApplication.cjs +97 -0
- package/cjs/lib/Discord/structures/Permission.cjs +61 -0
- package/cjs/lib/Discord/structures/PermissionOverwrite.cjs +46 -0
- package/cjs/lib/Discord/structures/PingInteraction.cjs +27 -0
- package/cjs/lib/Discord/structures/Poll.cjs +69 -0
- package/cjs/lib/Discord/structures/PrimaryGuild.cjs +93 -0
- package/cjs/lib/Discord/structures/PrivateChannel.cjs +131 -0
- package/cjs/lib/Discord/structures/PrivateThreadChannel.cjs +28 -0
- package/cjs/lib/Discord/structures/PublicThreadChannel.cjs +36 -0
- package/cjs/lib/Discord/structures/Role.cjs +126 -0
- package/cjs/lib/Discord/structures/SKU.cjs +58 -0
- package/cjs/lib/Discord/structures/Soundboard.cjs +58 -0
- package/cjs/lib/Discord/structures/StageChannel.cjs +45 -0
- package/cjs/lib/Discord/structures/StageInstance.cjs +80 -0
- package/cjs/lib/Discord/structures/Subscription.cjs +21 -0
- package/cjs/lib/Discord/structures/Team.cjs +70 -0
- package/cjs/lib/Discord/structures/TestEntitlement.cjs +22 -0
- package/cjs/lib/Discord/structures/TextChannel.cjs +48 -0
- package/cjs/lib/Discord/structures/TextableChannel.cjs +265 -0
- package/cjs/lib/Discord/structures/TextableVoiceChannel.cjs +70 -0
- package/cjs/lib/Discord/structures/ThreadChannel.cjs +276 -0
- package/cjs/lib/Discord/structures/ThreadOnlyChannel.cjs +205 -0
- package/cjs/lib/Discord/structures/ThreadableChannel.cjs +57 -0
- package/cjs/lib/Discord/structures/UnavailableGuild.cjs +21 -0
- package/cjs/lib/Discord/structures/User.cjs +223 -0
- package/cjs/lib/Discord/structures/VoiceChannel.cjs +34 -0
- package/cjs/lib/Discord/structures/VoiceState.cjs +113 -0
- package/cjs/lib/Discord/structures/Webhook.cjs +224 -0
- package/cjs/lib/Discord/util/Collection.cjs +77 -0
- package/cjs/lib/Discord/util/Errors.cjs +81 -0
- package/cjs/lib/Discord/util/QueryBuilder.cjs +20 -0
- package/cjs/lib/Discord/util/Routes.cjs +293 -0
- package/cjs/lib/Discord/util/SimpleCollection.cjs +78 -0
- package/cjs/lib/Discord/util/Time.cjs +92 -0
- package/cjs/lib/Discord/util/TypedCollection.cjs +78 -0
- package/cjs/lib/Discord/util/TypedEmitter.cjs +20 -0
- package/cjs/lib/Discord/util/Util.cjs +906 -0
- package/cjs/lib/Discord/util/interactions/InteractionOptionsWrapper.cjs +207 -0
- package/cjs/lib/Discord/util/interactions/MessageInteractionResponse.cjs +26 -0
- package/cjs/lib/Discord/util/interactions/ModalSubmitInteractionComponentsWrapper.cjs +98 -0
- package/cjs/lib/Discord/util/interactions/SelectMenuValuesWrapper.cjs +77 -0
- package/cjs/lib/Discord/util/interactions/shared.cjs +20 -0
- package/cjs/lib/Discord/util/warning.cjs +34 -0
- package/cjs/lib/Signal/Group/ciphertext-message.cjs +16 -0
- package/cjs/lib/Signal/Group/group-session-builder.cjs +67 -0
- package/cjs/lib/Signal/Group/group_cipher.cjs +86 -0
- package/cjs/lib/Signal/Group/index.cjs +58 -0
- package/cjs/lib/Signal/Group/keyhelper.cjs +56 -0
- package/cjs/lib/Signal/Group/sender-chain-key.cjs +30 -0
- package/cjs/lib/Signal/Group/sender-key-distribution-message.cjs +67 -0
- package/cjs/lib/Signal/Group/sender-key-message.cjs +70 -0
- package/cjs/lib/Signal/Group/sender-key-name.cjs +52 -0
- package/cjs/lib/Signal/Group/sender-key-record.cjs +45 -0
- package/cjs/lib/Signal/Group/sender-key-state.cjs +88 -0
- package/cjs/lib/Signal/Group/sender-message-key.cjs +30 -0
- package/cjs/lib/Signal/libsignal.cjs +467 -0
- package/cjs/lib/Signal/lid-mapping.cjs +281 -0
- package/cjs/lib/Socket/Client/index.cjs +19 -0
- package/cjs/lib/Socket/Client/types.cjs +15 -0
- package/cjs/lib/Socket/Client/websocket.cjs +61 -0
- package/cjs/lib/Socket/business.cjs +384 -0
- package/cjs/lib/Socket/chats.cjs +1221 -0
- package/cjs/lib/Socket/communities.cjs +440 -0
- package/cjs/lib/Socket/groups.cjs +353 -0
- package/cjs/lib/Socket/index.cjs +14 -0
- package/cjs/lib/Socket/messages-recv.cjs +1772 -0
- package/cjs/lib/Socket/messages-send.cjs +1376 -0
- package/cjs/lib/Socket/mex.cjs +46 -0
- package/cjs/lib/Socket/newsletter.cjs +230 -0
- package/cjs/lib/Socket/socket.cjs +976 -0
- package/cjs/lib/Store/index.cjs +20 -0
- package/cjs/lib/Store/make-in-memory-store.cjs +470 -0
- package/cjs/lib/Store/make-ordered-dictionary.cjs +82 -0
- package/cjs/lib/Store/object-repository.cjs +28 -0
- package/cjs/lib/Telegram/button.cjs +147 -0
- package/cjs/lib/Telegram/composer.cjs +582 -0
- package/cjs/lib/Telegram/context.cjs +853 -0
- package/cjs/lib/Telegram/core/helpers/args.cjs +57 -0
- package/cjs/lib/Telegram/core/helpers/check.cjs +55 -0
- package/cjs/lib/Telegram/core/helpers/compact.cjs +16 -0
- package/cjs/lib/Telegram/core/helpers/deunionize.cjs +12 -0
- package/cjs/lib/Telegram/core/helpers/formatting.cjs +91 -0
- package/cjs/lib/Telegram/core/helpers/util.cjs +50 -0
- package/cjs/lib/Telegram/core/network/client.cjs +338 -0
- package/cjs/lib/Telegram/core/network/error.cjs +21 -0
- package/cjs/lib/Telegram/core/network/multipart-stream.cjs +79 -0
- package/cjs/lib/Telegram/core/network/polling.cjs +87 -0
- package/cjs/lib/Telegram/core/network/webhook.cjs +54 -0
- package/cjs/lib/Telegram/core/types/typegram.cjs +31 -0
- package/cjs/lib/Telegram/deffa-telegraf.cjs +264 -0
- package/cjs/lib/Telegram/esm-bridge.cjs +20 -0
- package/cjs/lib/Telegram/filters.cjs +69 -0
- package/cjs/lib/Telegram/format.cjs +58 -0
- package/cjs/lib/Telegram/future.cjs +140 -0
- package/cjs/lib/Telegram/index.cjs +67 -0
- package/cjs/lib/Telegram/input.cjs +61 -0
- package/cjs/lib/Telegram/markup.cjs +129 -0
- package/cjs/lib/Telegram/middleware.cjs +2 -0
- package/cjs/lib/Telegram/reactions.cjs +84 -0
- package/cjs/lib/Telegram/router.cjs +46 -0
- package/cjs/lib/Telegram/scenes/base.cjs +39 -0
- package/cjs/lib/Telegram/scenes/context.cjs +104 -0
- package/cjs/lib/Telegram/scenes/index.cjs +21 -0
- package/cjs/lib/Telegram/scenes/stage.cjs +49 -0
- package/cjs/lib/Telegram/scenes/wizard/context.cjs +31 -0
- package/cjs/lib/Telegram/scenes/wizard/index.cjs +45 -0
- package/cjs/lib/Telegram/scenes.cjs +21 -0
- package/cjs/lib/Telegram/session.cjs +166 -0
- package/cjs/lib/Telegram/telegram-types.cjs +6 -0
- package/cjs/lib/Telegram/telegram.cjs +945 -0
- package/cjs/lib/Telegram/types.cjs +2 -0
- package/cjs/lib/Telegram/utils.cjs +5 -0
- package/cjs/lib/Types/Auth.cjs +3 -0
- package/cjs/lib/Types/Bussines.cjs +3 -0
- package/cjs/lib/Types/Call.cjs +3 -0
- package/cjs/lib/Types/Chat.cjs +11 -0
- package/cjs/lib/Types/Contact.cjs +3 -0
- package/cjs/lib/Types/Events.cjs +4 -0
- package/cjs/lib/Types/GroupMetadata.cjs +3 -0
- package/cjs/lib/Types/Label.cjs +26 -0
- package/cjs/lib/Types/LabelAssociation.cjs +8 -0
- package/cjs/lib/Types/Message.cjs +19 -0
- package/cjs/lib/Types/Mex.cjs +40 -0
- package/cjs/lib/Types/Product.cjs +3 -0
- package/cjs/lib/Types/RichType.cjs +24 -0
- package/cjs/lib/Types/Signal.cjs +4 -0
- package/cjs/lib/Types/Socket.cjs +4 -0
- package/cjs/lib/Types/State.cjs +54 -0
- package/cjs/lib/Types/USync.cjs +4 -0
- package/cjs/lib/Types/index.cjs +42 -0
- package/cjs/lib/Utils/auth-utils.cjs +312 -0
- package/cjs/lib/Utils/browser-utils.cjs +39 -0
- package/cjs/lib/Utils/business.cjs +241 -0
- package/cjs/lib/Utils/chat-utils.cjs +890 -0
- package/cjs/lib/Utils/companion-reg-client-utils.cjs +51 -0
- package/cjs/lib/Utils/crypto.cjs +170 -0
- package/cjs/lib/Utils/decode-wa-message.cjs +330 -0
- package/cjs/lib/Utils/event-buffer.cjs +629 -0
- package/cjs/lib/Utils/generics.cjs +427 -0
- package/cjs/lib/Utils/history.cjs +141 -0
- package/cjs/lib/Utils/identity-change-handler.cjs +56 -0
- package/cjs/lib/Utils/index.cjs +43 -0
- package/cjs/lib/Utils/link-preview.cjs +122 -0
- package/cjs/lib/Utils/logger.cjs +8 -0
- package/cjs/lib/Utils/lt-hash.cjs +11 -0
- package/cjs/lib/Utils/make-mutex.cjs +38 -0
- package/cjs/lib/Utils/message-retry-manager.cjs +267 -0
- package/cjs/lib/Utils/messages-media.cjs +906 -0
- package/cjs/lib/Utils/messages.cjs +1909 -0
- package/cjs/lib/Utils/noise-handler.cjs +205 -0
- package/cjs/lib/Utils/offline-node-processor.cjs +43 -0
- package/cjs/lib/Utils/pre-key-manager.cjs +113 -0
- package/cjs/lib/Utils/process-message.cjs +755 -0
- package/cjs/lib/Utils/reporting-utils.cjs +263 -0
- package/cjs/lib/Utils/rich-message-utils.cjs +434 -0
- package/cjs/lib/Utils/session-guard.cjs +163 -0
- package/cjs/lib/Utils/signal.cjs +214 -0
- package/cjs/lib/Utils/stanza-ack.cjs +41 -0
- package/cjs/lib/Utils/sync-action-utils.cjs +54 -0
- package/cjs/lib/Utils/tc-token-utils.cjs +174 -0
- package/cjs/lib/Utils/text-sticker.cjs +174 -0
- package/cjs/lib/Utils/use-multi-file-auth-state.cjs +125 -0
- package/cjs/lib/Utils/use-single-file-auth-state.cjs +113 -0
- package/cjs/lib/Utils/use-sqlite-auth-state.cjs +145 -0
- package/cjs/lib/Utils/validate-connection.cjs +210 -0
- package/cjs/lib/WABinary/constants.cjs +1470 -0
- package/cjs/lib/WABinary/decode.cjs +301 -0
- package/cjs/lib/WABinary/encode.cjs +257 -0
- package/cjs/lib/WABinary/generic-utils.cjs +240 -0
- package/cjs/lib/WABinary/index.cjs +22 -0
- package/cjs/lib/WABinary/jid-utils.cjs +114 -0
- package/cjs/lib/WABinary/types.cjs +37 -0
- package/cjs/lib/WAM/BinaryInfo.cjs +14 -0
- package/cjs/lib/WAM/constants.cjs +22856 -0
- package/cjs/lib/WAM/encode.cjs +154 -0
- package/cjs/lib/WAM/index.cjs +20 -0
- package/cjs/lib/WAUSync/Protocols/USyncContactProtocol.cjs +56 -0
- package/cjs/lib/WAUSync/Protocols/USyncDeviceProtocol.cjs +58 -0
- package/cjs/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.cjs +31 -0
- package/cjs/lib/WAUSync/Protocols/USyncStatusProtocol.cjs +42 -0
- package/cjs/lib/WAUSync/Protocols/USyncUsernameProtocol.cjs +29 -0
- package/cjs/lib/WAUSync/Protocols/UsyncBotProfileProtocol.cjs +55 -0
- package/cjs/lib/WAUSync/Protocols/UsyncLIDProtocol.cjs +33 -0
- package/cjs/lib/WAUSync/Protocols/index.cjs +22 -0
- package/cjs/lib/WAUSync/USyncQuery.cjs +102 -0
- package/cjs/lib/WAUSync/USyncUser.cjs +35 -0
- package/cjs/lib/WAUSync/index.cjs +20 -0
- package/cjs/lib/index.cjs +372 -0
- package/cjs/lib/plugins/loader.cjs +117 -0
- package/lib/Defaults/index.js +1 -1
- package/package.json +11 -6
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.argsParser = void 0;
|
|
4
|
+
var args_1 = require("./core/helpers/args");
|
|
5
|
+
Object.defineProperty(exports, "argsParser", { enumerable: true, get: function () { return args_1.argsParser; } });
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ALL_WA_PATCH_NAMES = void 0;
|
|
4
|
+
exports.ALL_WA_PATCH_NAMES = [
|
|
5
|
+
'critical_block',
|
|
6
|
+
'critical_unblock_low',
|
|
7
|
+
'regular_high',
|
|
8
|
+
'regular_low',
|
|
9
|
+
'regular'
|
|
10
|
+
];
|
|
11
|
+
//# sourceMappingURL=Chat.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LabelColor = void 0;
|
|
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
|
+
})(exports.LabelColor || (exports.LabelColor = {}));
|
|
26
|
+
//# sourceMappingURL=Label.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LabelAssociationType = void 0;
|
|
4
|
+
(function (LabelAssociationType) {
|
|
5
|
+
LabelAssociationType["Chat"] = "label_jid";
|
|
6
|
+
LabelAssociationType["Message"] = "label_message";
|
|
7
|
+
})(exports.LabelAssociationType || (exports.LabelAssociationType = {}));
|
|
8
|
+
//# sourceMappingURL=LabelAssociation.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WAMessageAddressingMode = exports.WAMessageStatus = exports.WAMessageStubType = exports.ProtocolType = exports.ListType = exports.CarouselCardType = exports.ButtonType = exports.ButtonHeaderType = exports.AssociationType = exports.WAProto = void 0;
|
|
4
|
+
const index_js_1 = require("../../WAProto/index.cjs");
|
|
5
|
+
Object.defineProperty(exports, "WAProto", { enumerable: true, get: function () { return index_js_1.proto; } });
|
|
6
|
+
// Lia@Changes 03-02-26 --- Add exported message-related enum types from proto.Message
|
|
7
|
+
exports.AssociationType = index_js_1.proto.MessageAssociation.AssociationType;
|
|
8
|
+
exports.ButtonHeaderType = index_js_1.proto.Message.ButtonsMessage.HeaderType;
|
|
9
|
+
exports.ButtonType = index_js_1.proto.Message.ButtonsMessage.Button.Type;
|
|
10
|
+
exports.CarouselCardType = index_js_1.proto.Message.InteractiveMessage.CarouselMessage.CarouselCardType;
|
|
11
|
+
exports.ListType = index_js_1.proto.Message.ListMessage.ListType;
|
|
12
|
+
exports.ProtocolType = index_js_1.proto.Message.ProtocolMessage.Type;
|
|
13
|
+
exports.WAMessageStubType = index_js_1.proto.WebMessageInfo.StubType;
|
|
14
|
+
exports.WAMessageStatus = index_js_1.proto.WebMessageInfo.Status;
|
|
15
|
+
(function (WAMessageAddressingMode) {
|
|
16
|
+
WAMessageAddressingMode["PN"] = "pn";
|
|
17
|
+
WAMessageAddressingMode["LID"] = "lid";
|
|
18
|
+
})(exports.WAMessageAddressingMode || (exports.WAMessageAddressingMode = {}));
|
|
19
|
+
//# sourceMappingURL=Message.js.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QueryIds = exports.XWAPaths = void 0;
|
|
4
|
+
(function (XWAPaths) {
|
|
5
|
+
XWAPaths["xwa2_newsletter_create"] = "xwa2_newsletter_create";
|
|
6
|
+
XWAPaths["xwa2_newsletter_subscribers"] = "xwa2_newsletter_subscribers";
|
|
7
|
+
XWAPaths["xwa2_newsletter_subscribed"] = "xwa2_newsletter_subscribed";
|
|
8
|
+
XWAPaths["xwa2_newsletter_view"] = "xwa2_newsletter_view";
|
|
9
|
+
XWAPaths["xwa2_newsletter_metadata"] = "xwa2_newsletter";
|
|
10
|
+
XWAPaths["xwa2_newsletter_admin_count"] = "xwa2_newsletter_admin";
|
|
11
|
+
XWAPaths["xwa2_newsletter_mute_v2"] = "xwa2_newsletter_mute_v2";
|
|
12
|
+
XWAPaths["xwa2_newsletter_unmute_v2"] = "xwa2_newsletter_unmute_v2";
|
|
13
|
+
XWAPaths["xwa2_newsletter_follow"] = "xwa2_newsletter_follow";
|
|
14
|
+
XWAPaths["xwa2_newsletter_unfollow"] = "xwa2_newsletter_unfollow";
|
|
15
|
+
XWAPaths["xwa2_newsletter_join_v2"] = "xwa2_newsletter_join_v2";
|
|
16
|
+
XWAPaths["xwa2_newsletter_leave_v2"] = "xwa2_newsletter_leave_v2";
|
|
17
|
+
XWAPaths["xwa2_newsletter_change_owner"] = "xwa2_newsletter_change_owner";
|
|
18
|
+
XWAPaths["xwa2_newsletter_demote"] = "xwa2_newsletter_demote";
|
|
19
|
+
XWAPaths["xwa2_newsletter_delete_v2"] = "xwa2_newsletter_delete_v2";
|
|
20
|
+
XWAPaths["xwa2_fetch_account_reachout_timelock"] = "xwa2_fetch_account_reachout_timelock";
|
|
21
|
+
XWAPaths["xwa2_message_capping_info"] = "xwa2_message_capping_info";
|
|
22
|
+
})(exports.XWAPaths || (exports.XWAPaths = {}));
|
|
23
|
+
(function (QueryIds) {
|
|
24
|
+
QueryIds["CREATE"] = "8823471724422422";
|
|
25
|
+
QueryIds["UPDATE_METADATA"] = "24250201037901610";
|
|
26
|
+
QueryIds["METADATA"] = "6563316087068696";
|
|
27
|
+
QueryIds["SUBSCRIBERS"] = "9783111038412085";
|
|
28
|
+
QueryIds["SUBSCRIBED"] = "6388546374527196";
|
|
29
|
+
QueryIds["FOLLOW"] = "24404358912487870";
|
|
30
|
+
QueryIds["UNFOLLOW"] = "9767147403369991";
|
|
31
|
+
QueryIds["MUTE"] = "29766401636284406";
|
|
32
|
+
QueryIds["UNMUTE"] = "9864994326891137";
|
|
33
|
+
QueryIds["ADMIN_COUNT"] = "7130823597031706";
|
|
34
|
+
QueryIds["CHANGE_OWNER"] = "7341777602580933";
|
|
35
|
+
QueryIds["DEMOTE"] = "6551828931592903";
|
|
36
|
+
QueryIds["DELETE"] = "30062808666639665";
|
|
37
|
+
QueryIds["REACHOUT_TIMELOCK"] = "23983697327930364";
|
|
38
|
+
QueryIds["MESSAGE_CAPPING_INFO"] = "24503548349331633";
|
|
39
|
+
})(exports.QueryIds || (exports.QueryIds = {}));
|
|
40
|
+
//# sourceMappingURL=Mex.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RichSubMessageType = exports.CodeHighlightType = void 0;
|
|
4
|
+
(function (CodeHighlightType) {
|
|
5
|
+
CodeHighlightType[CodeHighlightType["DEFAULT"] = 0] = "DEFAULT";
|
|
6
|
+
CodeHighlightType[CodeHighlightType["KEYWORD"] = 1] = "KEYWORD";
|
|
7
|
+
CodeHighlightType[CodeHighlightType["METHOD"] = 2] = "METHOD";
|
|
8
|
+
CodeHighlightType[CodeHighlightType["STRING"] = 3] = "STRING";
|
|
9
|
+
CodeHighlightType[CodeHighlightType["NUMBER"] = 4] = "NUMBER";
|
|
10
|
+
CodeHighlightType[CodeHighlightType["COMMENT"] = 5] = "COMMENT";
|
|
11
|
+
})(exports.CodeHighlightType || (exports.CodeHighlightType = {}));
|
|
12
|
+
(function (RichSubMessageType) {
|
|
13
|
+
RichSubMessageType[RichSubMessageType["UNKNOWN"] = 0] = "UNKNOWN";
|
|
14
|
+
RichSubMessageType[RichSubMessageType["GRID_IMAGE"] = 1] = "GRID_IMAGE";
|
|
15
|
+
RichSubMessageType[RichSubMessageType["TEXT"] = 2] = "TEXT";
|
|
16
|
+
RichSubMessageType[RichSubMessageType["INLINE_IMAGE"] = 3] = "INLINE_IMAGE";
|
|
17
|
+
RichSubMessageType[RichSubMessageType["TABLE"] = 4] = "TABLE";
|
|
18
|
+
RichSubMessageType[RichSubMessageType["CODE"] = 5] = "CODE";
|
|
19
|
+
RichSubMessageType[RichSubMessageType["DYNAMIC"] = 6] = "DYNAMIC";
|
|
20
|
+
RichSubMessageType[RichSubMessageType["MAP"] = 7] = "MAP";
|
|
21
|
+
RichSubMessageType[RichSubMessageType["LATEX"] = 8] = "LATEX";
|
|
22
|
+
RichSubMessageType[RichSubMessageType["CONTENT_ITEMS"] = 9] = "CONTENT_ITEMS";
|
|
23
|
+
})(exports.RichSubMessageType || (exports.RichSubMessageType = {}));
|
|
24
|
+
//# sourceMappingURL=RichType.js.map
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NewChatMessageCappingOTEStatusType = exports.NewChatMessageCappingMVStatusType = exports.NewChatMessageCappingStatusType = exports.ReachoutTimelockEnforcementType = exports.SyncState = void 0;
|
|
4
|
+
const boom_1 = require("@hapi/boom");
|
|
5
|
+
(function (SyncState) {
|
|
6
|
+
/** The socket is connecting, but we haven't received pending notifications yet. */
|
|
7
|
+
SyncState[SyncState["Connecting"] = 0] = "Connecting";
|
|
8
|
+
/** Pending notifications received. Buffering events until we decide whether to sync or not. */
|
|
9
|
+
SyncState[SyncState["AwaitingInitialSync"] = 1] = "AwaitingInitialSync";
|
|
10
|
+
/** The initial app state sync (history, etc.) is in progress. Buffering continues. */
|
|
11
|
+
SyncState[SyncState["Syncing"] = 2] = "Syncing";
|
|
12
|
+
/** Initial sync is complete, or was skipped. The socket is fully operational and events are processed in real-time. */
|
|
13
|
+
SyncState[SyncState["Online"] = 3] = "Online";
|
|
14
|
+
})(exports.SyncState || (exports.SyncState = {}));
|
|
15
|
+
(function (ReachoutTimelockEnforcementType) {
|
|
16
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_ALCOHOL"] = "BIZ_COMMERCE_VIOLATION_ALCOHOL";
|
|
17
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_ADULT"] = "BIZ_COMMERCE_VIOLATION_ADULT";
|
|
18
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_ANIMALS"] = "BIZ_COMMERCE_VIOLATION_ANIMALS";
|
|
19
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_BODY_PARTS_FLUIDS"] = "BIZ_COMMERCE_VIOLATION_BODY_PARTS_FLUIDS";
|
|
20
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_DATING"] = "BIZ_COMMERCE_VIOLATION_DATING";
|
|
21
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_DIGITAL_SERVICES_PRODUCTS"] = "BIZ_COMMERCE_VIOLATION_DIGITAL_SERVICES_PRODUCTS";
|
|
22
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_DRUGS"] = "BIZ_COMMERCE_VIOLATION_DRUGS";
|
|
23
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_DRUGS_ONLY_OTC"] = "BIZ_COMMERCE_VIOLATION_DRUGS_ONLY_OTC";
|
|
24
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_GAMBLING"] = "BIZ_COMMERCE_VIOLATION_GAMBLING";
|
|
25
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_HEALTHCARE"] = "BIZ_COMMERCE_VIOLATION_HEALTHCARE";
|
|
26
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_REAL_FAKE_CURRENCY"] = "BIZ_COMMERCE_VIOLATION_REAL_FAKE_CURRENCY";
|
|
27
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_SUPPLEMENTS"] = "BIZ_COMMERCE_VIOLATION_SUPPLEMENTS";
|
|
28
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_TOBACCO"] = "BIZ_COMMERCE_VIOLATION_TOBACCO";
|
|
29
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_VIOLENT_CONTENT"] = "BIZ_COMMERCE_VIOLATION_VIOLENT_CONTENT";
|
|
30
|
+
ReachoutTimelockEnforcementType["BIZ_COMMERCE_VIOLATION_WEAPONS"] = "BIZ_COMMERCE_VIOLATION_WEAPONS";
|
|
31
|
+
ReachoutTimelockEnforcementType["BIZ_QUALITY"] = "BIZ_QUALITY";
|
|
32
|
+
/** This means there is no restriction */
|
|
33
|
+
ReachoutTimelockEnforcementType["DEFAULT"] = "DEFAULT";
|
|
34
|
+
ReachoutTimelockEnforcementType["WEB_COMPANION_ONLY"] = "WEB_COMPANION_ONLY";
|
|
35
|
+
})(exports.ReachoutTimelockEnforcementType || (exports.ReachoutTimelockEnforcementType = {}));
|
|
36
|
+
(function (NewChatMessageCappingStatusType) {
|
|
37
|
+
NewChatMessageCappingStatusType["NONE"] = "NONE";
|
|
38
|
+
NewChatMessageCappingStatusType["FIRST_WARNING"] = "FIRST_WARNING";
|
|
39
|
+
NewChatMessageCappingStatusType["SECOND_WARNING"] = "SECOND_WARNING";
|
|
40
|
+
NewChatMessageCappingStatusType["CAPPED"] = "CAPPED";
|
|
41
|
+
})(exports.NewChatMessageCappingStatusType || (exports.NewChatMessageCappingStatusType = {}));
|
|
42
|
+
(function (NewChatMessageCappingMVStatusType) {
|
|
43
|
+
NewChatMessageCappingMVStatusType["NOT_ELIGIBLE"] = "NOT_ELIGIBLE";
|
|
44
|
+
NewChatMessageCappingMVStatusType["NOT_ACTIVE"] = "NOT_ACTIVE";
|
|
45
|
+
NewChatMessageCappingMVStatusType["ACTIVE"] = "ACTIVE";
|
|
46
|
+
NewChatMessageCappingMVStatusType["ACTIVE_UPGRADE_AVAILABLE"] = "ACTIVE_UPGRADE_AVAILABLE";
|
|
47
|
+
})(exports.NewChatMessageCappingMVStatusType || (exports.NewChatMessageCappingMVStatusType = {}));
|
|
48
|
+
(function (NewChatMessageCappingOTEStatusType) {
|
|
49
|
+
NewChatMessageCappingOTEStatusType["NOT_ELIGIBLE"] = "NOT_ELIGIBLE";
|
|
50
|
+
NewChatMessageCappingOTEStatusType["ELIGIBLE"] = "ELIGIBLE";
|
|
51
|
+
NewChatMessageCappingOTEStatusType["ACTIVE_IN_CURRENT_CYCLE"] = "ACTIVE_IN_CURRENT_CYCLE";
|
|
52
|
+
NewChatMessageCappingOTEStatusType["EXHAUSTED"] = "EXHAUSTED";
|
|
53
|
+
})(exports.NewChatMessageCappingOTEStatusType || (exports.NewChatMessageCappingOTEStatusType = {}));
|
|
54
|
+
//# sourceMappingURL=State.js.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.DisconnectReason = void 0;
|
|
18
|
+
__exportStar(require("./Auth.cjs"), exports);
|
|
19
|
+
__exportStar(require("./GroupMetadata.cjs"), exports);
|
|
20
|
+
__exportStar(require("./Chat.cjs"), exports);
|
|
21
|
+
__exportStar(require("./Contact.cjs"), exports);
|
|
22
|
+
__exportStar(require("./State.cjs"), exports);
|
|
23
|
+
__exportStar(require("./Message.cjs"), exports);
|
|
24
|
+
__exportStar(require("./Socket.cjs"), exports);
|
|
25
|
+
__exportStar(require("./Events.cjs"), exports);
|
|
26
|
+
__exportStar(require("./Product.cjs"), exports);
|
|
27
|
+
__exportStar(require("./Call.cjs"), exports);
|
|
28
|
+
__exportStar(require("./Signal.cjs"), exports);
|
|
29
|
+
__exportStar(require("./Mex.cjs"), exports);
|
|
30
|
+
(function (DisconnectReason) {
|
|
31
|
+
DisconnectReason[DisconnectReason["connectionClosed"] = 428] = "connectionClosed";
|
|
32
|
+
DisconnectReason[DisconnectReason["connectionLost"] = 408] = "connectionLost";
|
|
33
|
+
DisconnectReason[DisconnectReason["connectionReplaced"] = 440] = "connectionReplaced";
|
|
34
|
+
DisconnectReason[DisconnectReason["timedOut"] = 408] = "timedOut";
|
|
35
|
+
DisconnectReason[DisconnectReason["loggedOut"] = 401] = "loggedOut";
|
|
36
|
+
DisconnectReason[DisconnectReason["badSession"] = 500] = "badSession";
|
|
37
|
+
DisconnectReason[DisconnectReason["restartRequired"] = 515] = "restartRequired";
|
|
38
|
+
DisconnectReason[DisconnectReason["multideviceMismatch"] = 411] = "multideviceMismatch";
|
|
39
|
+
DisconnectReason[DisconnectReason["forbidden"] = 403] = "forbidden";
|
|
40
|
+
DisconnectReason[DisconnectReason["unavailableService"] = 503] = "unavailableService";
|
|
41
|
+
})(exports.DisconnectReason || (exports.DisconnectReason = {}));
|
|
42
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.initAuthCreds = exports.assertMeId = exports.addTransactionCapability = void 0;
|
|
7
|
+
exports.makeCacheableSignalKeyStore = makeCacheableSignalKeyStore;
|
|
8
|
+
const node_cache_1 = __importDefault(require("@cacheable/node-cache"));
|
|
9
|
+
const boom_1 = require("@hapi/boom");
|
|
10
|
+
const async_hooks_1 = require("async_hooks");
|
|
11
|
+
const async_mutex_1 = require("async-mutex");
|
|
12
|
+
const crypto_1 = require("crypto");
|
|
13
|
+
const p_queue_1 = __importDefault(require("p-queue"));
|
|
14
|
+
const index_js_1 = require("../Defaults/index.cjs");
|
|
15
|
+
const crypto_js_1 = require("./crypto.cjs");
|
|
16
|
+
const generics_js_1 = require("./generics.cjs");
|
|
17
|
+
const pre_key_manager_js_1 = require("./pre-key-manager.cjs");
|
|
18
|
+
/**
|
|
19
|
+
* Adds caching capability to a SignalKeyStore
|
|
20
|
+
* @param store the store to add caching to
|
|
21
|
+
* @param logger to log trace events
|
|
22
|
+
* @param _cache cache store to use
|
|
23
|
+
*/
|
|
24
|
+
function makeCacheableSignalKeyStore(store, logger, _cache) {
|
|
25
|
+
const cache = _cache ||
|
|
26
|
+
new node_cache_1.default({
|
|
27
|
+
stdTTL: index_js_1.DEFAULT_CACHE_TTLS.SIGNAL_STORE, // 5 minutes
|
|
28
|
+
useClones: false,
|
|
29
|
+
deleteOnExpire: true
|
|
30
|
+
});
|
|
31
|
+
// Mutex for protecting cache operations
|
|
32
|
+
const cacheMutex = new async_mutex_1.Mutex();
|
|
33
|
+
function getUniqueId(type, id) {
|
|
34
|
+
return `${type}.${id}`;
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
async get(type, ids) {
|
|
38
|
+
return cacheMutex.runExclusive(async () => {
|
|
39
|
+
const data = {};
|
|
40
|
+
const idsToFetch = [];
|
|
41
|
+
for (const id of ids) {
|
|
42
|
+
const item = (await cache.get(getUniqueId(type, id)));
|
|
43
|
+
if (typeof item !== 'undefined') {
|
|
44
|
+
data[id] = item;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
idsToFetch.push(id);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (idsToFetch.length) {
|
|
51
|
+
logger?.trace({ items: idsToFetch.length }, 'loading from store');
|
|
52
|
+
const fetched = await store.get(type, idsToFetch);
|
|
53
|
+
for (const id of idsToFetch) {
|
|
54
|
+
const item = fetched[id];
|
|
55
|
+
if (item) {
|
|
56
|
+
data[id] = item;
|
|
57
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
58
|
+
await cache.set(getUniqueId(type, id), item);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return data;
|
|
63
|
+
});
|
|
64
|
+
},
|
|
65
|
+
async set(data) {
|
|
66
|
+
return cacheMutex.runExclusive(async () => {
|
|
67
|
+
let keys = 0;
|
|
68
|
+
for (const type in data) {
|
|
69
|
+
for (const id in data[type]) {
|
|
70
|
+
await cache.set(getUniqueId(type, id), data[type][id]);
|
|
71
|
+
keys += 1;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
logger?.trace({ keys }, 'updated cache');
|
|
75
|
+
await store.set(data);
|
|
76
|
+
});
|
|
77
|
+
},
|
|
78
|
+
async clear() {
|
|
79
|
+
await cache.flushAll();
|
|
80
|
+
await store.clear?.();
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Adds DB-like transaction capability to the SignalKeyStore
|
|
86
|
+
* Uses AsyncLocalStorage for automatic context management
|
|
87
|
+
* @param state the key store to apply this capability to
|
|
88
|
+
* @param logger logger to log events
|
|
89
|
+
* @returns SignalKeyStore with transaction capability
|
|
90
|
+
*/
|
|
91
|
+
const addTransactionCapability = (state, logger, { maxCommitRetries, delayBetweenTriesMs }) => {
|
|
92
|
+
const txStorage = new async_hooks_1.AsyncLocalStorage();
|
|
93
|
+
// Queues for concurrency control (keyed by signal data type - bounded set)
|
|
94
|
+
const keyQueues = new Map();
|
|
95
|
+
// Transaction mutexes with reference counting for cleanup
|
|
96
|
+
const txMutexes = new Map();
|
|
97
|
+
const txMutexRefCounts = new Map();
|
|
98
|
+
// Pre-key manager for specialized operations
|
|
99
|
+
const preKeyManager = new pre_key_manager_js_1.PreKeyManager(state, logger);
|
|
100
|
+
/**
|
|
101
|
+
* Get or create a queue for a specific key type
|
|
102
|
+
*/
|
|
103
|
+
function getQueue(key) {
|
|
104
|
+
if (!keyQueues.has(key)) {
|
|
105
|
+
keyQueues.set(key, new p_queue_1.default({ concurrency: 1 }));
|
|
106
|
+
}
|
|
107
|
+
return keyQueues.get(key);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Get or create a transaction mutex
|
|
111
|
+
*/
|
|
112
|
+
function getTxMutex(key) {
|
|
113
|
+
if (!txMutexes.has(key)) {
|
|
114
|
+
txMutexes.set(key, new async_mutex_1.Mutex());
|
|
115
|
+
txMutexRefCounts.set(key, 0);
|
|
116
|
+
}
|
|
117
|
+
return txMutexes.get(key);
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Acquire a reference to a transaction mutex
|
|
121
|
+
*/
|
|
122
|
+
function acquireTxMutexRef(key) {
|
|
123
|
+
const count = txMutexRefCounts.get(key) ?? 0;
|
|
124
|
+
txMutexRefCounts.set(key, count + 1);
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Release a reference to a transaction mutex and cleanup if no longer needed
|
|
128
|
+
*/
|
|
129
|
+
function releaseTxMutexRef(key) {
|
|
130
|
+
const count = (txMutexRefCounts.get(key) ?? 1) - 1;
|
|
131
|
+
txMutexRefCounts.set(key, count);
|
|
132
|
+
// Cleanup if no more references and mutex is not locked
|
|
133
|
+
if (count <= 0) {
|
|
134
|
+
const mutex = txMutexes.get(key);
|
|
135
|
+
if (mutex && !mutex.isLocked()) {
|
|
136
|
+
txMutexes.delete(key);
|
|
137
|
+
txMutexRefCounts.delete(key);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Check if currently in a transaction
|
|
143
|
+
*/
|
|
144
|
+
function isInTransaction() {
|
|
145
|
+
return !!txStorage.getStore();
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Commit transaction with retries
|
|
149
|
+
*/
|
|
150
|
+
async function commitWithRetry(mutations) {
|
|
151
|
+
if (Object.keys(mutations).length === 0) {
|
|
152
|
+
logger.trace('no mutations in transaction');
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
logger.trace('committing transaction');
|
|
156
|
+
for (let attempt = 0; attempt < maxCommitRetries; attempt++) {
|
|
157
|
+
try {
|
|
158
|
+
await state.set(mutations);
|
|
159
|
+
logger.trace({ mutationCount: Object.keys(mutations).length }, 'committed transaction');
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
const retriesLeft = maxCommitRetries - attempt - 1;
|
|
164
|
+
logger.warn(`failed to commit mutations, retries left=${retriesLeft}`);
|
|
165
|
+
if (retriesLeft === 0) {
|
|
166
|
+
throw error;
|
|
167
|
+
}
|
|
168
|
+
await (0, generics_js_1.delay)(delayBetweenTriesMs);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return {
|
|
173
|
+
get: async (type, ids) => {
|
|
174
|
+
const ctx = txStorage.getStore();
|
|
175
|
+
if (!ctx) {
|
|
176
|
+
// No transaction - direct read without exclusive lock for concurrency
|
|
177
|
+
return state.get(type, ids);
|
|
178
|
+
}
|
|
179
|
+
// In transaction - check cache first
|
|
180
|
+
const cached = ctx.cache[type] || {};
|
|
181
|
+
const missing = ids.filter(id => !(id in cached));
|
|
182
|
+
if (missing.length > 0) {
|
|
183
|
+
ctx.dbQueries++;
|
|
184
|
+
logger.trace({ type, count: missing.length }, 'fetching missing keys in transaction');
|
|
185
|
+
const fetched = await getTxMutex(type).runExclusive(() => state.get(type, missing));
|
|
186
|
+
// Update cache
|
|
187
|
+
ctx.cache[type] = ctx.cache[type] || {};
|
|
188
|
+
Object.assign(ctx.cache[type], fetched);
|
|
189
|
+
}
|
|
190
|
+
// Return requested ids from cache
|
|
191
|
+
const result = {};
|
|
192
|
+
for (const id of ids) {
|
|
193
|
+
const value = ctx.cache[type]?.[id];
|
|
194
|
+
if (value !== undefined && value !== null) {
|
|
195
|
+
result[id] = value;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return result;
|
|
199
|
+
},
|
|
200
|
+
set: async (data) => {
|
|
201
|
+
const ctx = txStorage.getStore();
|
|
202
|
+
if (!ctx) {
|
|
203
|
+
// No transaction - direct write with queue protection
|
|
204
|
+
const types = Object.keys(data);
|
|
205
|
+
// Process pre-keys with validation
|
|
206
|
+
for (const type_ of types) {
|
|
207
|
+
const type = type_;
|
|
208
|
+
if (type === 'pre-key') {
|
|
209
|
+
await preKeyManager.validateDeletions(data, type);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
// Write all data in parallel
|
|
213
|
+
await Promise.all(types.map(type => getQueue(type).add(async () => {
|
|
214
|
+
const typeData = { [type]: data[type] };
|
|
215
|
+
await state.set(typeData);
|
|
216
|
+
})));
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
// In transaction - update cache and mutations
|
|
220
|
+
logger.trace({ types: Object.keys(data) }, 'caching in transaction');
|
|
221
|
+
for (const key_ in data) {
|
|
222
|
+
const key = key_;
|
|
223
|
+
// Ensure structures exist
|
|
224
|
+
ctx.cache[key] = ctx.cache[key] || {};
|
|
225
|
+
ctx.mutations[key] = ctx.mutations[key] || {};
|
|
226
|
+
// Special handling for pre-keys
|
|
227
|
+
if (key === 'pre-key') {
|
|
228
|
+
await preKeyManager.processOperations(data, key, ctx.cache, ctx.mutations, true);
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
// Normal key types
|
|
232
|
+
Object.assign(ctx.cache[key], data[key]);
|
|
233
|
+
Object.assign(ctx.mutations[key], data[key]);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
isInTransaction,
|
|
238
|
+
transaction: async (work, key) => {
|
|
239
|
+
const existing = txStorage.getStore();
|
|
240
|
+
// Nested transaction - reuse existing context
|
|
241
|
+
if (existing) {
|
|
242
|
+
logger.trace('reusing existing transaction context');
|
|
243
|
+
return work();
|
|
244
|
+
}
|
|
245
|
+
// New transaction - acquire mutex and create context
|
|
246
|
+
const mutex = getTxMutex(key);
|
|
247
|
+
acquireTxMutexRef(key);
|
|
248
|
+
try {
|
|
249
|
+
return await mutex.runExclusive(async () => {
|
|
250
|
+
const ctx = {
|
|
251
|
+
cache: {},
|
|
252
|
+
mutations: {},
|
|
253
|
+
dbQueries: 0
|
|
254
|
+
};
|
|
255
|
+
logger.trace('entering transaction');
|
|
256
|
+
try {
|
|
257
|
+
const result = await txStorage.run(ctx, work);
|
|
258
|
+
// Commit mutations
|
|
259
|
+
await commitWithRetry(ctx.mutations);
|
|
260
|
+
logger.trace({ dbQueries: ctx.dbQueries }, 'transaction completed');
|
|
261
|
+
return result;
|
|
262
|
+
}
|
|
263
|
+
catch (error) {
|
|
264
|
+
logger.error({ error }, 'transaction failed, rolling back');
|
|
265
|
+
throw error;
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
finally {
|
|
270
|
+
releaseTxMutexRef(key);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
};
|
|
274
|
+
};
|
|
275
|
+
exports.addTransactionCapability = addTransactionCapability;
|
|
276
|
+
/**
|
|
277
|
+
* Returns the authenticated user's JID, or throws a Boom-401 if creds are not yet authenticated.
|
|
278
|
+
* Use this anywhere we'd otherwise reach for `creds.me!.id` to fail fast with a descriptive error.
|
|
279
|
+
*/
|
|
280
|
+
const assertMeId = (creds) => {
|
|
281
|
+
const id = creds.me?.id;
|
|
282
|
+
if (!id) {
|
|
283
|
+
throw new boom_1.Boom('Cannot proceed: socket is not authenticated yet (creds.me.id is missing)', { statusCode: 401 });
|
|
284
|
+
}
|
|
285
|
+
return id;
|
|
286
|
+
};
|
|
287
|
+
exports.assertMeId = assertMeId;
|
|
288
|
+
const initAuthCreds = () => {
|
|
289
|
+
const identityKey = crypto_js_1.Curve.generateKeyPair();
|
|
290
|
+
return {
|
|
291
|
+
noiseKey: crypto_js_1.Curve.generateKeyPair(),
|
|
292
|
+
pairingEphemeralKeyPair: crypto_js_1.Curve.generateKeyPair(),
|
|
293
|
+
signedIdentityKey: identityKey,
|
|
294
|
+
signedPreKey: (0, crypto_js_1.signedKeyPair)(identityKey, 1),
|
|
295
|
+
registrationId: (0, generics_js_1.generateRegistrationId)(),
|
|
296
|
+
advSecretKey: (0, crypto_1.randomBytes)(32).toString('base64'),
|
|
297
|
+
processedHistoryMessages: [],
|
|
298
|
+
nextPreKeyId: 1,
|
|
299
|
+
firstUnuploadedPreKeyId: 1,
|
|
300
|
+
accountSyncCounter: 0,
|
|
301
|
+
accountSettings: {
|
|
302
|
+
unarchiveChats: false
|
|
303
|
+
},
|
|
304
|
+
registered: false,
|
|
305
|
+
pairingCode: undefined,
|
|
306
|
+
lastPropHash: undefined,
|
|
307
|
+
routingInfo: undefined,
|
|
308
|
+
additionalData: undefined
|
|
309
|
+
};
|
|
310
|
+
};
|
|
311
|
+
exports.initAuthCreds = initAuthCreds;
|
|
312
|
+
//# sourceMappingURL=auth-utils.js.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// modif by deffa
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.getPlatformId = exports.Browsers = void 0;
|
|
5
|
+
const os_1 = require("os");
|
|
6
|
+
const index_js_1 = require("../../WAProto/index.cjs");
|
|
7
|
+
const PLATFORM_MAP = {
|
|
8
|
+
aix: 'AIX',
|
|
9
|
+
darwin: 'Mac OS',
|
|
10
|
+
win32: 'Windows',
|
|
11
|
+
android: 'Android',
|
|
12
|
+
freebsd: 'FreeBSD',
|
|
13
|
+
openbsd: 'OpenBSD',
|
|
14
|
+
sunos: 'Solaris',
|
|
15
|
+
linux: undefined,
|
|
16
|
+
haiku: undefined,
|
|
17
|
+
cygwin: undefined,
|
|
18
|
+
netbsd: undefined
|
|
19
|
+
};
|
|
20
|
+
exports.Browsers = {
|
|
21
|
+
ubuntu: browser => ['Ubuntu', browser, '22.04.4'],
|
|
22
|
+
macOS: browser => ['Mac OS', browser, '14.4.1'],
|
|
23
|
+
baileys: browser => ['Baileys', browser, '6.5.0'],
|
|
24
|
+
windows: browser => ['Windows', browser, '10.0.22631'],
|
|
25
|
+
android: browser => ['Android', browser, '14.0'],
|
|
26
|
+
kiwi: () => ['Android', 'Chrome', '130.0.6723.58'],
|
|
27
|
+
ucBrowser: () => ['Android', 'Chrome', '16.4.0.1'],
|
|
28
|
+
brave: () => ['Windows', 'Chrome', '130.0.0.0'],
|
|
29
|
+
vivaldi: () => ['Windows', 'Chrome', '6.9.3447.48'],
|
|
30
|
+
arc: () => ['Mac OS', 'Chrome', '1.60.0'],
|
|
31
|
+
/** The appropriate browser based on your OS & release */
|
|
32
|
+
appropriate: browser => [PLATFORM_MAP[(0, os_1.platform)()] || 'Ubuntu', browser, (0, os_1.release)()]
|
|
33
|
+
};
|
|
34
|
+
const getPlatformId = (browser) => {
|
|
35
|
+
const platformType = index_js_1.proto.DeviceProps.PlatformType[browser.toUpperCase()];
|
|
36
|
+
return platformType ? platformType.toString() : '1'; //chrome
|
|
37
|
+
};
|
|
38
|
+
exports.getPlatformId = getPlatformId;
|
|
39
|
+
//# sourceMappingURL=browser-utils.js.map
|