elynn-baileys 1.0.1
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/LICENSE +22 -0
- package/README.md +2372 -0
- package/WAProto/index.d.ts +15871 -0
- package/WAProto/index.js +115447 -0
- package/elynn/config.js +12 -0
- package/elynn/plugins/README.md +24 -0
- package/elynn/plugins/ai/deepseekr1.js +27 -0
- package/elynn/plugins/ai/gita.js +16 -0
- package/elynn/plugins/ai/glm47flash.js +27 -0
- package/elynn/plugins/ai/gptoss120b.js +27 -0
- package/elynn/plugins/ai/qwq32b.js +27 -0
- package/elynn/plugins/berita/antara.js +18 -0
- package/elynn/plugins/berita/cnbcindonesia.js +18 -0
- package/elynn/plugins/berita/cnn.js +18 -0
- package/elynn/plugins/berita/kompas.js +18 -0
- package/elynn/plugins/berita/liputan6.js +18 -0
- package/elynn/plugins/berita/merdeka.js +18 -0
- package/elynn/plugins/berita/sindonews.js +18 -0
- package/elynn/plugins/berita/tribunnews.js +18 -0
- package/elynn/plugins/downloader/douyin.js +19 -0
- package/elynn/plugins/downloader/facebook.js +19 -0
- package/elynn/plugins/downloader/github.js +25 -0
- package/elynn/plugins/downloader/lahelu.js +19 -0
- package/elynn/plugins/downloader/snackvideo.js +19 -0
- package/elynn/plugins/downloader/soundcloud.js +19 -0
- package/elynn/plugins/downloader/tiktok.js +19 -0
- package/elynn/plugins/downloader/tiktokhd.js +19 -0
- package/elynn/plugins/downloader/twitter.js +19 -0
- package/elynn/plugins/downloader/ummy.js +26 -0
- package/elynn/plugins/index.cjs +26 -0
- package/elynn/plugins/index.js +232 -0
- package/elynn/plugins/info/bmkg.js +25 -0
- package/elynn/plugins/info/cuaca.js +23 -0
- package/elynn/plugins/info/jadwaltv.js +21 -0
- package/elynn/plugins/maker/brat.js +45 -0
- package/elynn/plugins/maker/bratvid.js +52 -0
- package/elynn/plugins/search/8font.js +18 -0
- package/elynn/plugins/search/applemusic.js +18 -0
- package/elynn/plugins/search/bimg.js +19 -0
- package/elynn/plugins/search/brave.js +24 -0
- package/elynn/plugins/search/duckduckgo.js +18 -0
- package/elynn/plugins/search/lahelu.js +18 -0
- package/elynn/plugins/search/mangatoon.js +18 -0
- package/elynn/plugins/search/mcpedl.js +18 -0
- package/elynn/plugins/search/myinstants.js +18 -0
- package/elynn/plugins/search/otakotaku.js +18 -0
- package/elynn/plugins/search/pinterest.js +19 -0
- package/elynn/plugins/search/resep.js +18 -0
- package/elynn/plugins/search/seegore.js +19 -0
- package/elynn/plugins/search/soundcloud.js +18 -0
- package/elynn/plugins/search/youtube.js +18 -0
- package/elynn/plugins/stalk/github.js +28 -0
- package/elynn/plugins/stalk/pinterest.js +27 -0
- package/elynn/plugins/stalk/threads.js +24 -0
- package/elynn/plugins/stalk/tiktok.js +27 -0
- package/elynn/plugins/stalk/twitter.js +27 -0
- package/elynn/plugins/stalk/youtube.js +27 -0
- package/engine-requirements.js +45 -0
- package/lib/Defaults/index.d.ts +145 -0
- package/lib/Defaults/index.d.ts.map +1 -0
- package/lib/Defaults/index.js +152 -0
- package/lib/Defaults/index.js.map +1 -0
- package/lib/Discord/Client.cjs +274 -0
- package/lib/Discord/Client.d.ts +98 -0
- package/lib/Discord/Client.js +274 -0
- package/lib/Discord/Constants.cjs +1842 -0
- package/lib/Discord/Constants.d.ts +1514 -0
- package/lib/Discord/Constants.js +1842 -0
- package/lib/Discord/connect-dc.js +5 -0
- package/lib/Discord/esm-bridge.mjs +128 -0
- package/lib/Discord/gateway/Dispatcher.cjs +86 -0
- package/lib/Discord/gateway/Dispatcher.d.ts +17 -0
- package/lib/Discord/gateway/Dispatcher.js +86 -0
- package/lib/Discord/gateway/Shard.cjs +723 -0
- package/lib/Discord/gateway/Shard.d.ts +87 -0
- package/lib/Discord/gateway/Shard.js +723 -0
- package/lib/Discord/gateway/ShardManager.cjs +350 -0
- package/lib/Discord/gateway/ShardManager.d.ts +31 -0
- package/lib/Discord/gateway/ShardManager.js +350 -0
- package/lib/Discord/gateway/compression/base.cjs +14 -0
- package/lib/Discord/gateway/compression/base.d.ts +6 -0
- package/lib/Discord/gateway/compression/base.js +14 -0
- package/lib/Discord/gateway/compression/config.cjs +47 -0
- package/lib/Discord/gateway/compression/config.d.ts +17 -0
- package/lib/Discord/gateway/compression/config.js +47 -0
- package/lib/Discord/gateway/compression/pako.cjs +45 -0
- package/lib/Discord/gateway/compression/pako.d.ts +16 -0
- package/lib/Discord/gateway/compression/pako.js +45 -0
- package/lib/Discord/gateway/compression/zlib-native.cjs +50 -0
- package/lib/Discord/gateway/compression/zlib-native.d.ts +10 -0
- package/lib/Discord/gateway/compression/zlib-native.js +50 -0
- package/lib/Discord/gateway/compression/zlib-sync.cjs +32 -0
- package/lib/Discord/gateway/compression/zlib-sync.d.ts +8 -0
- package/lib/Discord/gateway/compression/zlib-sync.js +32 -0
- package/lib/Discord/gateway/compression/zstd-napi.cjs +74 -0
- package/lib/Discord/gateway/compression/zstd-napi.d.ts +9 -0
- package/lib/Discord/gateway/compression/zstd-napi.js +74 -0
- package/lib/Discord/gateway/compression/zstd-native.cjs +48 -0
- package/lib/Discord/gateway/compression/zstd-native.d.ts +9 -0
- package/lib/Discord/gateway/compression/zstd-native.js +48 -0
- package/lib/Discord/gateway/events.cjs +956 -0
- package/lib/Discord/gateway/events.d.ts +75 -0
- package/lib/Discord/gateway/events.js +956 -0
- package/lib/Discord/index.cjs +228 -0
- package/lib/Discord/index.d.ts +98 -0
- package/lib/Discord/index.js +228 -0
- package/lib/Discord/rest/Bucket.cjs +77 -0
- package/lib/Discord/rest/Bucket.d.ts +32 -0
- package/lib/Discord/rest/Bucket.js +77 -0
- package/lib/Discord/rest/DiscordHTTPError.cjs +66 -0
- package/lib/Discord/rest/DiscordHTTPError.d.ts +15 -0
- package/lib/Discord/rest/DiscordHTTPError.js +66 -0
- package/lib/Discord/rest/DiscordRESTError.cjs +88 -0
- package/lib/Discord/rest/DiscordRESTError.d.ts +18 -0
- package/lib/Discord/rest/DiscordRESTError.js +88 -0
- package/lib/Discord/rest/OAuthHelper.cjs +220 -0
- package/lib/Discord/rest/OAuthHelper.d.ts +61 -0
- package/lib/Discord/rest/OAuthHelper.js +220 -0
- package/lib/Discord/rest/RESTManager.cjs +119 -0
- package/lib/Discord/rest/RESTManager.d.ts +42 -0
- package/lib/Discord/rest/RESTManager.js +119 -0
- package/lib/Discord/rest/RequestHandler.cjs +323 -0
- package/lib/Discord/rest/RequestHandler.d.ts +27 -0
- package/lib/Discord/rest/RequestHandler.js +323 -0
- package/lib/Discord/rest/SequentialBucket.cjs +74 -0
- package/lib/Discord/rest/SequentialBucket.d.ts +24 -0
- package/lib/Discord/rest/SequentialBucket.js +74 -0
- package/lib/Discord/routes/Applications.cjs +618 -0
- package/lib/Discord/routes/Applications.d.ts +230 -0
- package/lib/Discord/routes/Applications.js +618 -0
- package/lib/Discord/routes/Channels.cjs +1191 -0
- package/lib/Discord/routes/Channels.d.ts +428 -0
- package/lib/Discord/routes/Channels.js +1192 -0
- package/lib/Discord/routes/Guilds.cjs +1785 -0
- package/lib/Discord/routes/Guilds.d.ts +644 -0
- package/lib/Discord/routes/Guilds.js +1785 -0
- package/lib/Discord/routes/Interactions.cjs +205 -0
- package/lib/Discord/routes/Interactions.d.ts +74 -0
- package/lib/Discord/routes/Interactions.js +205 -0
- package/lib/Discord/routes/Lobbies.cjs +190 -0
- package/lib/Discord/routes/Lobbies.d.ts +70 -0
- package/lib/Discord/routes/Lobbies.js +190 -0
- package/lib/Discord/routes/Miscellaneous.cjs +113 -0
- package/lib/Discord/routes/Miscellaneous.d.ts +36 -0
- package/lib/Discord/routes/Miscellaneous.js +113 -0
- package/lib/Discord/routes/OAuth.cjs +343 -0
- package/lib/Discord/routes/OAuth.d.ts +107 -0
- package/lib/Discord/routes/OAuth.js +343 -0
- package/lib/Discord/routes/Users.cjs +100 -0
- package/lib/Discord/routes/Users.d.ts +32 -0
- package/lib/Discord/routes/Users.js +100 -0
- package/lib/Discord/routes/Webhooks.cjs +301 -0
- package/lib/Discord/routes/Webhooks.d.ts +126 -0
- package/lib/Discord/routes/Webhooks.js +301 -0
- package/lib/Discord/structures/AnnouncementChannel.cjs +46 -0
- package/lib/Discord/structures/AnnouncementChannel.d.ts +34 -0
- package/lib/Discord/structures/AnnouncementChannel.js +46 -0
- package/lib/Discord/structures/AnnouncementThreadChannel.cjs +28 -0
- package/lib/Discord/structures/AnnouncementThreadChannel.d.ts +17 -0
- package/lib/Discord/structures/AnnouncementThreadChannel.js +28 -0
- package/lib/Discord/structures/Application.cjs +477 -0
- package/lib/Discord/structures/Application.d.ts +166 -0
- package/lib/Discord/structures/Application.js +477 -0
- package/lib/Discord/structures/ApplicationCommand.cjs +146 -0
- package/lib/Discord/structures/ApplicationCommand.d.ts +75 -0
- package/lib/Discord/structures/ApplicationCommand.js +146 -0
- package/lib/Discord/structures/Attachment.cjs +78 -0
- package/lib/Discord/structures/Attachment.d.ts +43 -0
- package/lib/Discord/structures/Attachment.js +78 -0
- package/lib/Discord/structures/AuditLogEntry.cjs +54 -0
- package/lib/Discord/structures/AuditLogEntry.d.ts +25 -0
- package/lib/Discord/structures/AuditLogEntry.js +54 -0
- package/lib/Discord/structures/AutoModerationRule.cjs +140 -0
- package/lib/Discord/structures/AutoModerationRule.d.ts +48 -0
- package/lib/Discord/structures/AutoModerationRule.js +140 -0
- package/lib/Discord/structures/AutocompleteInteraction.cjs +120 -0
- package/lib/Discord/structures/AutocompleteInteraction.d.ts +61 -0
- package/lib/Discord/structures/AutocompleteInteraction.js +120 -0
- package/lib/Discord/structures/Base.cjs +58 -0
- package/lib/Discord/structures/Base.d.ts +19 -0
- package/lib/Discord/structures/Base.js +58 -0
- package/lib/Discord/structures/BaseEntitlement.cjs +49 -0
- package/lib/Discord/structures/BaseEntitlement.d.ts +20 -0
- package/lib/Discord/structures/BaseEntitlement.js +49 -0
- package/lib/Discord/structures/CategoryChannel.cjs +106 -0
- package/lib/Discord/structures/CategoryChannel.d.ts +40 -0
- package/lib/Discord/structures/CategoryChannel.js +106 -0
- package/lib/Discord/structures/Channel.cjs +92 -0
- package/lib/Discord/structures/Channel.d.ts +19 -0
- package/lib/Discord/structures/Channel.js +92 -0
- package/lib/Discord/structures/ClientApplication.cjs +273 -0
- package/lib/Discord/structures/ClientApplication.d.ts +189 -0
- package/lib/Discord/structures/ClientApplication.js +273 -0
- package/lib/Discord/structures/CommandInteraction.cjs +324 -0
- package/lib/Discord/structures/CommandInteraction.d.ts +166 -0
- package/lib/Discord/structures/CommandInteraction.js +324 -0
- package/lib/Discord/structures/ComponentInteraction.cjs +338 -0
- package/lib/Discord/structures/ComponentInteraction.d.ts +180 -0
- package/lib/Discord/structures/ComponentInteraction.js +338 -0
- package/lib/Discord/structures/Entitlement.cjs +27 -0
- package/lib/Discord/structures/Entitlement.d.ts +11 -0
- package/lib/Discord/structures/Entitlement.js +27 -0
- package/lib/Discord/structures/ExtendedUser.cjs +58 -0
- package/lib/Discord/structures/ExtendedUser.d.ts +25 -0
- package/lib/Discord/structures/ExtendedUser.js +58 -0
- package/lib/Discord/structures/ForumChannel.cjs +20 -0
- package/lib/Discord/structures/ForumChannel.d.ts +11 -0
- package/lib/Discord/structures/ForumChannel.js +20 -0
- package/lib/Discord/structures/GroupChannel.cjs +172 -0
- package/lib/Discord/structures/GroupChannel.d.ts +60 -0
- package/lib/Discord/structures/GroupChannel.js +172 -0
- package/lib/Discord/structures/Guild.cjs +1415 -0
- package/lib/Discord/structures/Guild.d.ts +687 -0
- package/lib/Discord/structures/Guild.js +1415 -0
- package/lib/Discord/structures/GuildChannel.cjs +90 -0
- package/lib/Discord/structures/GuildChannel.d.ts +36 -0
- package/lib/Discord/structures/GuildChannel.js +90 -0
- package/lib/Discord/structures/GuildPreview.cjs +153 -0
- package/lib/Discord/structures/GuildPreview.d.ts +49 -0
- package/lib/Discord/structures/GuildPreview.js +153 -0
- package/lib/Discord/structures/GuildScheduledEvent.cjs +188 -0
- package/lib/Discord/structures/GuildScheduledEvent.d.ts +59 -0
- package/lib/Discord/structures/GuildScheduledEvent.js +188 -0
- package/lib/Discord/structures/GuildTemplate.cjs +118 -0
- package/lib/Discord/structures/GuildTemplate.d.ts +48 -0
- package/lib/Discord/structures/GuildTemplate.js +118 -0
- package/lib/Discord/structures/Integration.cjs +157 -0
- package/lib/Discord/structures/Integration.d.ts +53 -0
- package/lib/Discord/structures/Integration.js +157 -0
- package/lib/Discord/structures/Interaction.cjs +91 -0
- package/lib/Discord/structures/Interaction.d.ts +39 -0
- package/lib/Discord/structures/Interaction.js +91 -0
- package/lib/Discord/structures/InteractionResolvedChannel.cjs +46 -0
- package/lib/Discord/structures/InteractionResolvedChannel.d.ts +27 -0
- package/lib/Discord/structures/InteractionResolvedChannel.js +46 -0
- package/lib/Discord/structures/Invite.cjs +240 -0
- package/lib/Discord/structures/Invite.d.ts +132 -0
- package/lib/Discord/structures/Invite.js +240 -0
- package/lib/Discord/structures/InviteGuild.cjs +130 -0
- package/lib/Discord/structures/InviteGuild.d.ts +54 -0
- package/lib/Discord/structures/InviteGuild.js +130 -0
- package/lib/Discord/structures/InviteRole.cjs +110 -0
- package/lib/Discord/structures/InviteRole.d.ts +53 -0
- package/lib/Discord/structures/InviteRole.js +110 -0
- package/lib/Discord/structures/Lobby.cjs +88 -0
- package/lib/Discord/structures/Lobby.d.ts +54 -0
- package/lib/Discord/structures/Lobby.js +88 -0
- package/lib/Discord/structures/LobbyMember.cjs +33 -0
- package/lib/Discord/structures/LobbyMember.d.ts +15 -0
- package/lib/Discord/structures/LobbyMember.js +33 -0
- package/lib/Discord/structures/MediaChannel.cjs +20 -0
- package/lib/Discord/structures/MediaChannel.d.ts +11 -0
- package/lib/Discord/structures/MediaChannel.js +20 -0
- package/lib/Discord/structures/Member.cjs +325 -0
- package/lib/Discord/structures/Member.d.ts +140 -0
- package/lib/Discord/structures/Member.js +325 -0
- package/lib/Discord/structures/Message.cjs +627 -0
- package/lib/Discord/structures/Message.d.ts +223 -0
- package/lib/Discord/structures/Message.js +627 -0
- package/lib/Discord/structures/ModalSubmitInteraction.cjs +295 -0
- package/lib/Discord/structures/ModalSubmitInteraction.d.ts +138 -0
- package/lib/Discord/structures/ModalSubmitInteraction.js +295 -0
- package/lib/Discord/structures/OAuthApplication.cjs +244 -0
- package/lib/Discord/structures/OAuthApplication.d.ts +77 -0
- package/lib/Discord/structures/OAuthApplication.js +244 -0
- package/lib/Discord/structures/OAuthGuild.cjs +107 -0
- package/lib/Discord/structures/OAuthGuild.d.ts +43 -0
- package/lib/Discord/structures/OAuthGuild.js +107 -0
- package/lib/Discord/structures/PartialApplication.cjs +101 -0
- package/lib/Discord/structures/PartialApplication.d.ts +29 -0
- package/lib/Discord/structures/PartialApplication.js +101 -0
- package/lib/Discord/structures/Permission.cjs +66 -0
- package/lib/Discord/structures/Permission.d.ts +21 -0
- package/lib/Discord/structures/Permission.js +66 -0
- package/lib/Discord/structures/PermissionOverwrite.cjs +50 -0
- package/lib/Discord/structures/PermissionOverwrite.d.ts +25 -0
- package/lib/Discord/structures/PermissionOverwrite.js +50 -0
- package/lib/Discord/structures/PingInteraction.cjs +27 -0
- package/lib/Discord/structures/PingInteraction.d.ts +15 -0
- package/lib/Discord/structures/PingInteraction.js +27 -0
- package/lib/Discord/structures/Poll.cjs +77 -0
- package/lib/Discord/structures/Poll.d.ts +27 -0
- package/lib/Discord/structures/Poll.js +77 -0
- package/lib/Discord/structures/PrimaryGuild.cjs +92 -0
- package/lib/Discord/structures/PrimaryGuild.d.ts +23 -0
- package/lib/Discord/structures/PrimaryGuild.js +92 -0
- package/lib/Discord/structures/PrivateChannel.cjs +139 -0
- package/lib/Discord/structures/PrivateChannel.d.ts +102 -0
- package/lib/Discord/structures/PrivateChannel.js +139 -0
- package/lib/Discord/structures/PrivateThreadChannel.cjs +28 -0
- package/lib/Discord/structures/PrivateThreadChannel.d.ts +17 -0
- package/lib/Discord/structures/PrivateThreadChannel.js +28 -0
- package/lib/Discord/structures/PublicThreadChannel.cjs +38 -0
- package/lib/Discord/structures/PublicThreadChannel.d.ts +20 -0
- package/lib/Discord/structures/PublicThreadChannel.js +38 -0
- package/lib/Discord/structures/Role.cjs +156 -0
- package/lib/Discord/structures/Role.d.ts +56 -0
- package/lib/Discord/structures/Role.js +156 -0
- package/lib/Discord/structures/SKU.cjs +70 -0
- package/lib/Discord/structures/SKU.d.ts +33 -0
- package/lib/Discord/structures/SKU.js +70 -0
- package/lib/Discord/structures/Soundboard.cjs +74 -0
- package/lib/Discord/structures/Soundboard.d.ts +42 -0
- package/lib/Discord/structures/Soundboard.js +74 -0
- package/lib/Discord/structures/StageChannel.cjs +45 -0
- package/lib/Discord/structures/StageChannel.d.ts +31 -0
- package/lib/Discord/structures/StageChannel.js +45 -0
- package/lib/Discord/structures/StageInstance.cjs +95 -0
- package/lib/Discord/structures/StageInstance.d.ts +35 -0
- package/lib/Discord/structures/StageInstance.js +95 -0
- package/lib/Discord/structures/Subscription.cjs +39 -0
- package/lib/Discord/structures/Subscription.d.ts +25 -0
- package/lib/Discord/structures/Subscription.js +39 -0
- package/lib/Discord/structures/Team.cjs +86 -0
- package/lib/Discord/structures/Team.d.ts +28 -0
- package/lib/Discord/structures/Team.js +86 -0
- package/lib/Discord/structures/TestEntitlement.cjs +22 -0
- package/lib/Discord/structures/TestEntitlement.d.ts +10 -0
- package/lib/Discord/structures/TestEntitlement.js +22 -0
- package/lib/Discord/structures/TextChannel.cjs +48 -0
- package/lib/Discord/structures/TextChannel.d.ts +34 -0
- package/lib/Discord/structures/TextChannel.js +48 -0
- package/lib/Discord/structures/TextableChannel.cjs +281 -0
- package/lib/Discord/structures/TextableChannel.d.ts +167 -0
- package/lib/Discord/structures/TextableChannel.js +281 -0
- package/lib/Discord/structures/TextableVoiceChannel.cjs +79 -0
- package/lib/Discord/structures/TextableVoiceChannel.d.ts +34 -0
- package/lib/Discord/structures/TextableVoiceChannel.js +79 -0
- package/lib/Discord/structures/ThreadChannel.cjs +300 -0
- package/lib/Discord/structures/ThreadChannel.d.ts +170 -0
- package/lib/Discord/structures/ThreadChannel.js +300 -0
- package/lib/Discord/structures/ThreadOnlyChannel.cjs +231 -0
- package/lib/Discord/structures/ThreadOnlyChannel.d.ts +95 -0
- package/lib/Discord/structures/ThreadOnlyChannel.js +231 -0
- package/lib/Discord/structures/ThreadableChannel.cjs +59 -0
- package/lib/Discord/structures/ThreadableChannel.d.ts +35 -0
- package/lib/Discord/structures/ThreadableChannel.js +59 -0
- package/lib/Discord/structures/UnavailableGuild.cjs +22 -0
- package/lib/Discord/structures/UnavailableGuild.d.ts +10 -0
- package/lib/Discord/structures/UnavailableGuild.js +22 -0
- package/lib/Discord/structures/User.cjs +240 -0
- package/lib/Discord/structures/User.d.ts +90 -0
- package/lib/Discord/structures/User.js +240 -0
- package/lib/Discord/structures/VoiceChannel.cjs +36 -0
- package/lib/Discord/structures/VoiceChannel.d.ts +19 -0
- package/lib/Discord/structures/VoiceChannel.js +36 -0
- package/lib/Discord/structures/VoiceState.cjs +141 -0
- package/lib/Discord/structures/VoiceState.d.ts +49 -0
- package/lib/Discord/structures/VoiceState.js +141 -0
- package/lib/Discord/structures/Webhook.cjs +240 -0
- package/lib/Discord/structures/Webhook.d.ts +126 -0
- package/lib/Discord/structures/Webhook.js +240 -0
- package/lib/Discord/types/applications.d.ts +695 -0
- package/lib/Discord/types/audit-log.d.ts +116 -0
- package/lib/Discord/types/auto-moderation.d.ts +99 -0
- package/lib/Discord/types/channels.d.ts +1570 -0
- package/lib/Discord/types/client.d.ts +250 -0
- package/lib/Discord/types/events.d.ts +224 -0
- package/lib/Discord/types/gateway-raw.d.ts +585 -0
- package/lib/Discord/types/gateway.d.ts +401 -0
- package/lib/Discord/types/guild-template.d.ts +25 -0
- package/lib/Discord/types/guilds.d.ts +987 -0
- package/lib/Discord/types/index.d.ts +24 -0
- package/lib/Discord/types/interactions.d.ts +524 -0
- package/lib/Discord/types/invites.d.ts +117 -0
- package/lib/Discord/types/json.d.ts +833 -0
- package/lib/Discord/types/lobbies.d.ts +31 -0
- package/lib/Discord/types/misc.d.ts +25 -0
- package/lib/Discord/types/namespaced.d.ts +22 -0
- package/lib/Discord/types/oauth.d.ts +206 -0
- package/lib/Discord/types/request-handler.d.ts +54 -0
- package/lib/Discord/types/scheduled-events.d.ts +87 -0
- package/lib/Discord/types/shared.d.ts +24 -0
- package/lib/Discord/types/users.d.ts +104 -0
- package/lib/Discord/types/voice.d.ts +45 -0
- package/lib/Discord/types/webhooks.d.ts +75 -0
- package/lib/Discord/util/Collection.cjs +77 -0
- package/lib/Discord/util/Collection.d.ts +47 -0
- package/lib/Discord/util/Collection.js +77 -0
- package/lib/Discord/util/Errors.cjs +84 -0
- package/lib/Discord/util/Errors.d.ts +43 -0
- package/lib/Discord/util/Errors.js +84 -0
- package/lib/Discord/util/QueryBuilder.cjs +20 -0
- package/lib/Discord/util/QueryBuilder.d.ts +4 -0
- package/lib/Discord/util/QueryBuilder.js +20 -0
- package/lib/Discord/util/Routes.cjs +293 -0
- package/lib/Discord/util/Routes.d.ts +145 -0
- package/lib/Discord/util/Routes.js +293 -0
- package/lib/Discord/util/SimpleCollection.cjs +82 -0
- package/lib/Discord/util/SimpleCollection.d.ts +12 -0
- package/lib/Discord/util/SimpleCollection.js +82 -0
- package/lib/Discord/util/Time.cjs +93 -0
- package/lib/Discord/util/Time.d.ts +39 -0
- package/lib/Discord/util/Time.js +93 -0
- package/lib/Discord/util/TypedCollection.cjs +81 -0
- package/lib/Discord/util/TypedCollection.d.ts +24 -0
- package/lib/Discord/util/TypedCollection.js +81 -0
- package/lib/Discord/util/TypedEmitter.cjs +20 -0
- package/lib/Discord/util/TypedEmitter.d.ts +18 -0
- package/lib/Discord/util/TypedEmitter.js +20 -0
- package/lib/Discord/util/Util.cjs +906 -0
- package/lib/Discord/util/Util.d.ts +66 -0
- package/lib/Discord/util/Util.js +906 -0
- package/lib/Discord/util/interactions/InteractionOptionsWrapper.cjs +211 -0
- package/lib/Discord/util/interactions/InteractionOptionsWrapper.d.ts +170 -0
- package/lib/Discord/util/interactions/InteractionOptionsWrapper.js +211 -0
- package/lib/Discord/util/interactions/MessageInteractionResponse.cjs +29 -0
- package/lib/Discord/util/interactions/MessageInteractionResponse.d.ts +27 -0
- package/lib/Discord/util/interactions/MessageInteractionResponse.js +29 -0
- package/lib/Discord/util/interactions/ModalSubmitInteractionComponentsWrapper.cjs +101 -0
- package/lib/Discord/util/interactions/ModalSubmitInteractionComponentsWrapper.d.ts +157 -0
- package/lib/Discord/util/interactions/ModalSubmitInteractionComponentsWrapper.js +101 -0
- package/lib/Discord/util/interactions/SelectMenuValuesWrapper.cjs +81 -0
- package/lib/Discord/util/interactions/SelectMenuValuesWrapper.d.ts +59 -0
- package/lib/Discord/util/interactions/SelectMenuValuesWrapper.js +81 -0
- package/lib/Discord/util/interactions/shared.cjs +20 -0
- package/lib/Discord/util/interactions/shared.d.ts +7 -0
- package/lib/Discord/util/interactions/shared.js +20 -0
- package/lib/Discord/util/warning.cjs +34 -0
- package/lib/Discord/util/warning.d.ts +6 -0
- package/lib/Discord/util/warning.js +34 -0
- package/lib/Signal/Group/ciphertext-message.d.ts +10 -0
- package/lib/Signal/Group/ciphertext-message.d.ts.map +1 -0
- package/lib/Signal/Group/ciphertext-message.js +12 -0
- package/lib/Signal/Group/ciphertext-message.js.map +1 -0
- package/lib/Signal/Group/group-session-builder.d.ts +8 -0
- package/lib/Signal/Group/group-session-builder.d.ts.map +1 -0
- package/lib/Signal/Group/group-session-builder.js +30 -0
- package/lib/Signal/Group/group-session-builder.js.map +1 -0
- package/lib/Signal/Group/group_cipher.d.ts +11 -0
- package/lib/Signal/Group/group_cipher.d.ts.map +1 -0
- package/lib/Signal/Group/group_cipher.js +82 -0
- package/lib/Signal/Group/group_cipher.js.map +1 -0
- package/lib/Signal/Group/index.d.ts +12 -0
- package/lib/Signal/Group/index.d.ts.map +1 -0
- package/lib/Signal/Group/index.js +12 -0
- package/lib/Signal/Group/index.js.map +1 -0
- package/lib/Signal/Group/keyhelper.d.ts +7 -0
- package/lib/Signal/Group/keyhelper.d.ts.map +1 -0
- package/lib/Signal/Group/keyhelper.js +18 -0
- package/lib/Signal/Group/keyhelper.js.map +1 -0
- package/lib/Signal/Group/sender-chain-key.d.ts +14 -0
- package/lib/Signal/Group/sender-chain-key.d.ts.map +1 -0
- package/lib/Signal/Group/sender-chain-key.js +26 -0
- package/lib/Signal/Group/sender-chain-key.js.map +1 -0
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +17 -0
- package/lib/Signal/Group/sender-key-distribution-message.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-distribution-message.js +63 -0
- package/lib/Signal/Group/sender-key-distribution-message.js.map +1 -0
- package/lib/Signal/Group/sender-key-message.d.ts +19 -0
- package/lib/Signal/Group/sender-key-message.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-message.js +66 -0
- package/lib/Signal/Group/sender-key-message.js.map +1 -0
- package/lib/Signal/Group/sender-key-name.d.ts +12 -0
- package/lib/Signal/Group/sender-key-name.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-name.js +48 -0
- package/lib/Signal/Group/sender-key-name.js.map +1 -0
- package/lib/Signal/Group/sender-key-record.d.ts +13 -0
- package/lib/Signal/Group/sender-key-record.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-record.js +41 -0
- package/lib/Signal/Group/sender-key-record.js.map +1 -0
- package/lib/Signal/Group/sender-key-state.d.ts +17 -0
- package/lib/Signal/Group/sender-key-state.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-state.js +84 -0
- package/lib/Signal/Group/sender-key-state.js.map +1 -0
- package/lib/Signal/Group/sender-message-key.d.ts +12 -0
- package/lib/Signal/Group/sender-message-key.d.ts.map +1 -0
- package/lib/Signal/Group/sender-message-key.js +26 -0
- package/lib/Signal/Group/sender-message-key.js.map +1 -0
- package/lib/Signal/libsignal.d.ts +55 -0
- package/lib/Signal/libsignal.d.ts.map +1 -0
- package/lib/Signal/libsignal.js +431 -0
- package/lib/Signal/libsignal.js.map +1 -0
- package/lib/Signal/lid-mapping.d.ts +21 -0
- package/lib/Signal/lid-mapping.d.ts.map +1 -0
- package/lib/Signal/lid-mapping.js +277 -0
- package/lib/Signal/lid-mapping.js.map +1 -0
- package/lib/Socket/Client/index.d.ts +3 -0
- package/lib/Socket/Client/index.d.ts.map +1 -0
- package/lib/Socket/Client/index.js +3 -0
- package/lib/Socket/Client/index.js.map +1 -0
- package/lib/Socket/Client/types.d.ts +6 -0
- package/lib/Socket/Client/types.d.ts.map +1 -0
- package/lib/Socket/Client/types.js +11 -0
- package/lib/Socket/Client/types.js.map +1 -0
- package/lib/Socket/Client/websocket.d.ts +13 -0
- package/lib/Socket/Client/websocket.d.ts.map +1 -0
- package/lib/Socket/Client/websocket.js +54 -0
- package/lib/Socket/Client/websocket.js.map +1 -0
- package/lib/Socket/business.d.ts +395 -0
- package/lib/Socket/business.d.ts.map +1 -0
- package/lib/Socket/business.js +380 -0
- package/lib/Socket/business.js.map +1 -0
- package/lib/Socket/chats.d.ts +137 -0
- package/lib/Socket/chats.d.ts.map +1 -0
- package/lib/Socket/chats.js +1214 -0
- package/lib/Socket/chats.js.map +1 -0
- package/lib/Socket/communities.d.ts +562 -0
- package/lib/Socket/communities.d.ts.map +1 -0
- package/lib/Socket/communities.js +432 -0
- package/lib/Socket/communities.js.map +1 -0
- package/lib/Socket/groups.d.ts +286 -0
- package/lib/Socket/groups.d.ts.map +1 -0
- package/lib/Socket/groups.js +348 -0
- package/lib/Socket/groups.js.map +1 -0
- package/lib/Socket/index.d.ts +530 -0
- package/lib/Socket/index.d.ts.map +1 -0
- package/lib/Socket/index.js +12 -0
- package/lib/Socket/index.js.map +1 -0
- package/lib/Socket/messages-recv.d.ts +334 -0
- package/lib/Socket/messages-recv.d.ts.map +1 -0
- package/lib/Socket/messages-recv.js +1765 -0
- package/lib/Socket/messages-recv.js.map +1 -0
- package/lib/Socket/messages-send.d.ts +330 -0
- package/lib/Socket/messages-send.d.ts.map +1 -0
- package/lib/Socket/messages-send.js +1368 -0
- package/lib/Socket/messages-send.js.map +1 -0
- package/lib/Socket/mex.d.ts +2 -0
- package/lib/Socket/mex.d.ts.map +1 -0
- package/lib/Socket/mex.js +42 -0
- package/lib/Socket/mex.js.map +1 -0
- package/lib/Socket/newsletter.d.ts +283 -0
- package/lib/Socket/newsletter.d.ts.map +1 -0
- package/lib/Socket/newsletter.js +226 -0
- package/lib/Socket/newsletter.js.map +1 -0
- package/lib/Socket/socket.d.ts +61 -0
- package/lib/Socket/socket.d.ts.map +1 -0
- package/lib/Socket/socket.js +972 -0
- package/lib/Socket/socket.js.map +1 -0
- package/lib/Store/index.d.ts +4 -0
- package/lib/Store/index.d.ts.map +1 -0
- package/lib/Store/index.js +4 -0
- package/lib/Store/index.js.map +1 -0
- package/lib/Store/make-in-memory-store.d.ts +63 -0
- package/lib/Store/make-in-memory-store.d.ts.map +1 -0
- package/lib/Store/make-in-memory-store.js +471 -0
- package/lib/Store/make-in-memory-store.js.map +1 -0
- package/lib/Store/make-ordered-dictionary.d.ts +13 -0
- package/lib/Store/make-ordered-dictionary.d.ts.map +1 -0
- package/lib/Store/make-ordered-dictionary.js +79 -0
- package/lib/Store/make-ordered-dictionary.js.map +1 -0
- package/lib/Store/object-repository.d.ts +11 -0
- package/lib/Store/object-repository.d.ts.map +1 -0
- package/lib/Store/object-repository.js +24 -0
- package/lib/Store/object-repository.js.map +1 -0
- package/lib/Telegram/button.js +147 -0
- package/lib/Telegram/cli.mjs +105 -0
- package/lib/Telegram/composer.js +582 -0
- package/lib/Telegram/context.js +855 -0
- package/lib/Telegram/core/helpers/args.js +57 -0
- package/lib/Telegram/core/helpers/check.js +55 -0
- package/lib/Telegram/core/helpers/compact.js +16 -0
- package/lib/Telegram/core/helpers/deunionize.js +12 -0
- package/lib/Telegram/core/helpers/formatting.js +91 -0
- package/lib/Telegram/core/helpers/util.js +50 -0
- package/lib/Telegram/core/network/client.js +330 -0
- package/lib/Telegram/core/network/error.js +21 -0
- package/lib/Telegram/core/network/multipart-stream.js +71 -0
- package/lib/Telegram/core/network/polling.js +87 -0
- package/lib/Telegram/core/network/webhook.js +54 -0
- package/lib/Telegram/core/types/typegram.js +27 -0
- package/lib/Telegram/elynn-telegraf.js +256 -0
- package/lib/Telegram/esm-bridge.mjs +21 -0
- package/lib/Telegram/filters.js +69 -0
- package/lib/Telegram/format.js +58 -0
- package/lib/Telegram/future.js +140 -0
- package/lib/Telegram/index.js +59 -0
- package/lib/Telegram/input.js +61 -0
- package/lib/Telegram/markup.js +121 -0
- package/lib/Telegram/middleware.js +2 -0
- package/lib/Telegram/package.json +3 -0
- package/lib/Telegram/reactions.js +84 -0
- package/lib/Telegram/router.js +46 -0
- package/lib/Telegram/scenes/base.js +39 -0
- package/lib/Telegram/scenes/context.js +104 -0
- package/lib/Telegram/scenes/index.js +21 -0
- package/lib/Telegram/scenes/stage.js +49 -0
- package/lib/Telegram/scenes/wizard/context.js +31 -0
- package/lib/Telegram/scenes/wizard/index.js +45 -0
- package/lib/Telegram/scenes.js +17 -0
- package/lib/Telegram/session.js +166 -0
- package/lib/Telegram/telegram-types.js +6 -0
- package/lib/Telegram/telegram.js +945 -0
- package/lib/Telegram/types.js +2 -0
- package/lib/Telegram/utils.js +5 -0
- package/lib/Types/Auth.d.ts +2 -0
- package/lib/Types/Auth.d.ts.map +1 -0
- package/lib/Types/Auth.js +2 -0
- package/lib/Types/Auth.js.map +1 -0
- package/lib/Types/Bussines.d.ts +2 -0
- package/lib/Types/Bussines.d.ts.map +1 -0
- package/lib/Types/Bussines.js +2 -0
- package/lib/Types/Bussines.js.map +1 -0
- package/lib/Types/Call.d.ts +2 -0
- package/lib/Types/Call.d.ts.map +1 -0
- package/lib/Types/Call.js +2 -0
- package/lib/Types/Call.js.map +1 -0
- package/lib/Types/Chat.d.ts +2 -0
- package/lib/Types/Chat.d.ts.map +1 -0
- package/lib/Types/Chat.js +8 -0
- package/lib/Types/Chat.js.map +1 -0
- package/lib/Types/Contact.d.ts +2 -0
- package/lib/Types/Contact.d.ts.map +1 -0
- package/lib/Types/Contact.js +2 -0
- package/lib/Types/Contact.js.map +1 -0
- package/lib/Types/Events.d.ts +2 -0
- package/lib/Types/Events.d.ts.map +1 -0
- package/lib/Types/Events.js +2 -0
- package/lib/Types/Events.js.map +1 -0
- package/lib/Types/GroupMetadata.d.ts +2 -0
- package/lib/Types/GroupMetadata.d.ts.map +1 -0
- package/lib/Types/GroupMetadata.js +2 -0
- package/lib/Types/GroupMetadata.js.map +1 -0
- package/lib/Types/Label.d.ts +3 -0
- package/lib/Types/Label.d.ts.map +1 -0
- package/lib/Types/Label.js +25 -0
- package/lib/Types/Label.js.map +1 -0
- package/lib/Types/LabelAssociation.d.ts +3 -0
- package/lib/Types/LabelAssociation.d.ts.map +1 -0
- package/lib/Types/LabelAssociation.js +7 -0
- package/lib/Types/LabelAssociation.js.map +1 -0
- package/lib/Types/Message.d.ts +12 -0
- package/lib/Types/Message.d.ts.map +1 -0
- package/lib/Types/Message.js +18 -0
- package/lib/Types/Message.js.map +1 -0
- package/lib/Types/Mex.d.ts +3 -0
- package/lib/Types/Mex.d.ts.map +1 -0
- package/lib/Types/Mex.js +39 -0
- package/lib/Types/Mex.js.map +1 -0
- package/lib/Types/Product.d.ts +2 -0
- package/lib/Types/Product.d.ts.map +1 -0
- package/lib/Types/Product.js +2 -0
- package/lib/Types/Product.js.map +1 -0
- package/lib/Types/RichType.d.ts +3 -0
- package/lib/Types/RichType.d.ts.map +1 -0
- package/lib/Types/RichType.js +23 -0
- package/lib/Types/RichType.js.map +1 -0
- package/lib/Types/Signal.d.ts +2 -0
- package/lib/Types/Signal.d.ts.map +1 -0
- package/lib/Types/Signal.js +2 -0
- package/lib/Types/Signal.js.map +1 -0
- package/lib/Types/Socket.d.ts +2 -0
- package/lib/Types/Socket.d.ts.map +1 -0
- package/lib/Types/Socket.js +2 -0
- package/lib/Types/Socket.js.map +1 -0
- package/lib/Types/State.d.ts +6 -0
- package/lib/Types/State.d.ts.map +1 -0
- package/lib/Types/State.js +56 -0
- package/lib/Types/State.js.map +1 -0
- package/lib/Types/USync.d.ts +2 -0
- package/lib/Types/USync.d.ts.map +1 -0
- package/lib/Types/USync.js +2 -0
- package/lib/Types/USync.js.map +1 -0
- package/lib/Types/index.d.ts +14 -0
- package/lib/Types/index.d.ts.map +1 -0
- package/lib/Types/index.js +26 -0
- package/lib/Types/index.js.map +1 -0
- package/lib/Utils/auth-utils.d.ts +58 -0
- package/lib/Utils/auth-utils.d.ts.map +1 -0
- package/lib/Utils/auth-utils.js +302 -0
- package/lib/Utils/auth-utils.js.map +1 -0
- package/lib/Utils/browser-utils.d.ts +9 -0
- package/lib/Utils/browser-utils.d.ts.map +1 -0
- package/lib/Utils/browser-utils.js +36 -0
- package/lib/Utils/browser-utils.js.map +1 -0
- package/lib/Utils/business.d.ts +50 -0
- package/lib/Utils/business.d.ts.map +1 -0
- package/lib/Utils/business.js +231 -0
- package/lib/Utils/business.js.map +1 -0
- package/lib/Utils/chat-utils.d.ts +409 -0
- package/lib/Utils/chat-utils.d.ts.map +1 -0
- package/lib/Utils/chat-utils.js +872 -0
- package/lib/Utils/chat-utils.js.map +1 -0
- package/lib/Utils/companion-reg-client-utils.d.ts +5 -0
- package/lib/Utils/companion-reg-client-utils.d.ts.map +1 -0
- package/lib/Utils/companion-reg-client-utils.js +46 -0
- package/lib/Utils/companion-reg-client-utils.js.map +1 -0
- package/lib/Utils/crypto.d.ts +40 -0
- package/lib/Utils/crypto.d.ts.map +1 -0
- package/lib/Utils/crypto.js +119 -0
- package/lib/Utils/crypto.js.map +1 -0
- package/lib/Utils/decode-wa-message.d.ts +84 -0
- package/lib/Utils/decode-wa-message.d.ts.map +1 -0
- package/lib/Utils/decode-wa-message.js +325 -0
- package/lib/Utils/decode-wa-message.js.map +1 -0
- package/lib/Utils/event-buffer.d.ts +13 -0
- package/lib/Utils/event-buffer.d.ts.map +1 -0
- package/lib/Utils/event-buffer.js +622 -0
- package/lib/Utils/event-buffer.js.map +1 -0
- package/lib/Utils/generics.d.ts +64 -0
- package/lib/Utils/generics.d.ts.map +1 -0
- package/lib/Utils/generics.js +395 -0
- package/lib/Utils/generics.js.map +1 -0
- package/lib/Utils/history.d.ts +76 -0
- package/lib/Utils/history.d.ts.map +1 -0
- package/lib/Utils/history.js +134 -0
- package/lib/Utils/history.js.map +1 -0
- package/lib/Utils/identity-change-handler.d.ts +14 -0
- package/lib/Utils/identity-change-handler.d.ts.map +1 -0
- package/lib/Utils/identity-change-handler.js +50 -0
- package/lib/Utils/identity-change-handler.js.map +1 -0
- package/lib/Utils/index.d.ts +25 -0
- package/lib/Utils/index.d.ts.map +1 -0
- package/lib/Utils/index.js +27 -0
- package/lib/Utils/index.js.map +1 -0
- package/lib/Utils/link-preview.d.ts +13 -0
- package/lib/Utils/link-preview.d.ts.map +1 -0
- package/lib/Utils/link-preview.js +85 -0
- package/lib/Utils/link-preview.js.map +1 -0
- package/lib/Utils/logger.d.ts +3 -0
- package/lib/Utils/logger.d.ts.map +1 -0
- package/lib/Utils/logger.js +3 -0
- package/lib/Utils/logger.js.map +1 -0
- package/lib/Utils/lt-hash.d.ts +7 -0
- package/lib/Utils/lt-hash.d.ts.map +1 -0
- package/lib/Utils/lt-hash.js +8 -0
- package/lib/Utils/lt-hash.js.map +1 -0
- package/lib/Utils/make-mutex.d.ts +7 -0
- package/lib/Utils/make-mutex.d.ts.map +1 -0
- package/lib/Utils/make-mutex.js +33 -0
- package/lib/Utils/make-mutex.js.map +1 -0
- package/lib/Utils/message-retry-manager.d.ts +80 -0
- package/lib/Utils/message-retry-manager.d.ts.map +1 -0
- package/lib/Utils/message-retry-manager.js +265 -0
- package/lib/Utils/message-retry-manager.js.map +1 -0
- package/lib/Utils/messages-media.d.ts +137 -0
- package/lib/Utils/messages-media.d.ts.map +1 -0
- package/lib/Utils/messages-media.js +843 -0
- package/lib/Utils/messages-media.js.map +1 -0
- package/lib/Utils/messages.d.ts +46 -0
- package/lib/Utils/messages.d.ts.map +1 -0
- package/lib/Utils/messages.js +1878 -0
- package/lib/Utils/messages.js.map +1 -0
- package/lib/Utils/noise-handler.d.ts +21 -0
- package/lib/Utils/noise-handler.d.ts.map +1 -0
- package/lib/Utils/noise-handler.js +201 -0
- package/lib/Utils/noise-handler.js.map +1 -0
- package/lib/Utils/offline-node-processor.d.ts +10 -0
- package/lib/Utils/offline-node-processor.d.ts.map +1 -0
- package/lib/Utils/offline-node-processor.js +40 -0
- package/lib/Utils/offline-node-processor.js.map +1 -0
- package/lib/Utils/pre-key-manager.d.ts +26 -0
- package/lib/Utils/pre-key-manager.d.ts.map +1 -0
- package/lib/Utils/pre-key-manager.js +106 -0
- package/lib/Utils/pre-key-manager.js.map +1 -0
- package/lib/Utils/process-message.d.ts +84 -0
- package/lib/Utils/process-message.d.ts.map +1 -0
- package/lib/Utils/process-message.js +745 -0
- package/lib/Utils/process-message.js.map +1 -0
- package/lib/Utils/reporting-utils.d.ts +13 -0
- package/lib/Utils/reporting-utils.d.ts.map +1 -0
- package/lib/Utils/reporting-utils.js +258 -0
- package/lib/Utils/reporting-utils.js.map +1 -0
- package/lib/Utils/rich-message-utils.d.ts +49 -0
- package/lib/Utils/rich-message-utils.d.ts.map +1 -0
- package/lib/Utils/rich-message-utils.js +400 -0
- package/lib/Utils/rich-message-utils.js.map +1 -0
- package/lib/Utils/session-guard.js +148 -0
- package/lib/Utils/signal.d.ts +83 -0
- package/lib/Utils/signal.d.ts.map +1 -0
- package/lib/Utils/signal.js +201 -0
- package/lib/Utils/signal.js.map +1 -0
- package/lib/Utils/stanza-ack.d.ts +17 -0
- package/lib/Utils/stanza-ack.d.ts.map +1 -0
- package/lib/Utils/stanza-ack.js +38 -0
- package/lib/Utils/stanza-ack.js.map +1 -0
- package/lib/Utils/sync-action-utils.d.ts +3 -0
- package/lib/Utils/sync-action-utils.d.ts.map +1 -0
- package/lib/Utils/sync-action-utils.js +49 -0
- package/lib/Utils/sync-action-utils.js.map +1 -0
- package/lib/Utils/tc-token-utils.d.ts +30 -0
- package/lib/Utils/tc-token-utils.d.ts.map +1 -0
- package/lib/Utils/tc-token-utils.js +163 -0
- package/lib/Utils/tc-token-utils.js.map +1 -0
- package/lib/Utils/text-sticker.js +149 -0
- package/lib/Utils/use-multi-file-auth-state.d.ts +11 -0
- package/lib/Utils/use-multi-file-auth-state.d.ts.map +1 -0
- package/lib/Utils/use-multi-file-auth-state.js +121 -0
- package/lib/Utils/use-multi-file-auth-state.js.map +1 -0
- package/lib/Utils/use-single-file-auth-state.d.ts +11 -0
- package/lib/Utils/use-single-file-auth-state.d.ts.map +1 -0
- package/lib/Utils/use-single-file-auth-state.js +109 -0
- package/lib/Utils/use-single-file-auth-state.js.map +1 -0
- package/lib/Utils/use-sqlite-auth-state.d.ts +11 -0
- package/lib/Utils/use-sqlite-auth-state.d.ts.map +1 -0
- package/lib/Utils/use-sqlite-auth-state.js +109 -0
- package/lib/Utils/use-sqlite-auth-state.js.map +1 -0
- package/lib/Utils/validate-connection.d.ts +44 -0
- package/lib/Utils/validate-connection.d.ts.map +1 -0
- package/lib/Utils/validate-connection.js +203 -0
- package/lib/Utils/validate-connection.js.map +1 -0
- package/lib/WABinary/constants.d.ts +62 -0
- package/lib/WABinary/constants.d.ts.map +1 -0
- package/lib/WABinary/constants.js +1467 -0
- package/lib/WABinary/constants.js.map +1 -0
- package/lib/WABinary/decode.d.ts +10 -0
- package/lib/WABinary/decode.d.ts.map +1 -0
- package/lib/WABinary/decode.js +262 -0
- package/lib/WABinary/decode.js.map +1 -0
- package/lib/WABinary/encode.d.ts +3 -0
- package/lib/WABinary/encode.d.ts.map +1 -0
- package/lib/WABinary/encode.js +220 -0
- package/lib/WABinary/encode.js.map +1 -0
- package/lib/WABinary/generic-utils.d.ts +77 -0
- package/lib/WABinary/generic-utils.d.ts.map +1 -0
- package/lib/WABinary/generic-utils.js +226 -0
- package/lib/WABinary/generic-utils.js.map +1 -0
- package/lib/WABinary/index.d.ts +6 -0
- package/lib/WABinary/index.d.ts.map +1 -0
- package/lib/WABinary/index.js +6 -0
- package/lib/WABinary/index.js.map +1 -0
- package/lib/WABinary/jid-utils.d.ts +29 -0
- package/lib/WABinary/jid-utils.d.ts.map +1 -0
- package/lib/WABinary/jid-utils.js +96 -0
- package/lib/WABinary/jid-utils.js.map +1 -0
- package/lib/WABinary/types.d.ts +2 -0
- package/lib/WABinary/types.d.ts.map +1 -0
- package/lib/WABinary/types.js +2 -0
- package/lib/WABinary/types.js.map +1 -0
- package/lib/WAM/BinaryInfo.d.ts +8 -0
- package/lib/WAM/BinaryInfo.d.ts.map +1 -0
- package/lib/WAM/BinaryInfo.js +10 -0
- package/lib/WAM/BinaryInfo.js.map +1 -0
- package/lib/WAM/constants.d.ts +34927 -0
- package/lib/WAM/constants.d.ts.map +1 -0
- package/lib/WAM/constants.js +22853 -0
- package/lib/WAM/constants.js.map +1 -0
- package/lib/WAM/encode.d.ts +2 -0
- package/lib/WAM/encode.d.ts.map +1 -0
- package/lib/WAM/encode.js +150 -0
- package/lib/WAM/encode.js.map +1 -0
- package/lib/WAM/index.d.ts +4 -0
- package/lib/WAM/index.d.ts.map +1 -0
- package/lib/WAM/index.js +4 -0
- package/lib/WAM/index.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +37 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +52 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +23 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +54 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +13 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +27 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +13 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +38 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts +10 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +25 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +39 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +51 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +15 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +29 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/index.d.ts +6 -0
- package/lib/WAUSync/Protocols/index.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/index.js +6 -0
- package/lib/WAUSync/Protocols/index.js.map +1 -0
- package/lib/WAUSync/USyncQuery.d.ts +21 -0
- package/lib/WAUSync/USyncQuery.d.ts.map +1 -0
- package/lib/WAUSync/USyncQuery.js +98 -0
- package/lib/WAUSync/USyncQuery.js.map +1 -0
- package/lib/WAUSync/USyncUser.d.ts +17 -0
- package/lib/WAUSync/USyncUser.d.ts.map +1 -0
- package/lib/WAUSync/USyncUser.js +31 -0
- package/lib/WAUSync/USyncUser.js.map +1 -0
- package/lib/WAUSync/index.d.ts +4 -0
- package/lib/WAUSync/index.d.ts.map +1 -0
- package/lib/WAUSync/index.js +4 -0
- package/lib/WAUSync/index.js.map +1 -0
- package/lib/index.d.ts +201 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +314 -0
- package/lib/index.js.map +1 -0
- package/lib/plugins/loader.cjs +26 -0
- package/lib/plugins/loader.js +94 -0
- package/package.json +148 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare enum WarningCodes {
|
|
2
|
+
OCEANIC_CACHE_DISABLED = "OCEANIC_CACHE_DISABLED",
|
|
3
|
+
OCEANIC_COLLECTIONS_LIMIT_WITH_CACHE_DISABLED = "OCEANIC_COLLECTIONS_LIMIT_WITH_CACHE_DISABLED",
|
|
4
|
+
OCEANIC_AUTH_AND_TOKEN_PROVIDED = "OCEANIC_AUTH_AND_TOKEN_PROVIDED"
|
|
5
|
+
}
|
|
6
|
+
export declare function warning(code: WarningCodes): void;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WarningCodes = void 0;
|
|
4
|
+
exports.warning = warning;
|
|
5
|
+
var WarningCodes;
|
|
6
|
+
(function (WarningCodes) {
|
|
7
|
+
WarningCodes["OCEANIC_CACHE_DISABLED"] = "OCEANIC_CACHE_DISABLED";
|
|
8
|
+
WarningCodes["OCEANIC_COLLECTIONS_LIMIT_WITH_CACHE_DISABLED"] = "OCEANIC_COLLECTIONS_LIMIT_WITH_CACHE_DISABLED";
|
|
9
|
+
WarningCodes["OCEANIC_AUTH_AND_TOKEN_PROVIDED"] = "OCEANIC_AUTH_AND_TOKEN_PROVIDED";
|
|
10
|
+
})(WarningCodes || (exports.WarningCodes = WarningCodes = {}));
|
|
11
|
+
const WarningOptions = {
|
|
12
|
+
[WarningCodes.OCEANIC_CACHE_DISABLED]: {
|
|
13
|
+
detail: "Set the disableCache option to the literal string \"no-warning\" to disable this warning.",
|
|
14
|
+
message: "Enabling the disableCache option is not recommended. This will break many aspects of the library, as it is not designed to function without cache."
|
|
15
|
+
},
|
|
16
|
+
[WarningCodes.OCEANIC_COLLECTIONS_LIMIT_WITH_CACHE_DISABLED]: {
|
|
17
|
+
detail: "Remove the collectionsLimit option, or zero out all of the possible options to disable this warning.",
|
|
18
|
+
message: "Providing the collectionsLimit option when the disableCache option has been enabled is redundant. Any provided values will be ignored."
|
|
19
|
+
},
|
|
20
|
+
[WarningCodes.OCEANIC_AUTH_AND_TOKEN_PROVIDED]: {
|
|
21
|
+
detail: "Remove either the auth or token option to disable this warning.",
|
|
22
|
+
message: "Providing both the token and auth options is redundant. The auth option will be used over token."
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const warnedCodes = new Set();
|
|
26
|
+
function warning(code) {
|
|
27
|
+
if (warnedCodes.has(code))
|
|
28
|
+
return;
|
|
29
|
+
const options = WarningOptions[code];
|
|
30
|
+
process.emitWarning(options.message, {
|
|
31
|
+
code,
|
|
32
|
+
detail: options.detail
|
|
33
|
+
});
|
|
34
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export class CiphertextMessage {
|
|
2
|
+
UNSUPPORTED_VERSION: number;
|
|
3
|
+
CURRENT_VERSION: number;
|
|
4
|
+
WHISPER_TYPE: number;
|
|
5
|
+
PREKEY_TYPE: number;
|
|
6
|
+
SENDERKEY_TYPE: number;
|
|
7
|
+
SENDERKEY_DISTRIBUTION_TYPE: number;
|
|
8
|
+
ENCRYPTED_MESSAGE_OVERHEAD: number;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=ciphertext-message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ciphertext-message.d.ts","sourceRoot":"","sources":["../../../src/Signal/Group/ciphertext-message.js"],"names":[],"mappings":"AAAA;IAEQ,4BAA4B;IAC5B,wBAAwB;IACxB,qBAAqB;IACrB,oBAAoB;IACpB,uBAAuB;IACvB,oCAAoC;IACpC,mCAAoC;CAE3C"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export class CiphertextMessage {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.UNSUPPORTED_VERSION = 1;
|
|
4
|
+
this.CURRENT_VERSION = 3;
|
|
5
|
+
this.WHISPER_TYPE = 2;
|
|
6
|
+
this.PREKEY_TYPE = 3;
|
|
7
|
+
this.SENDERKEY_TYPE = 4;
|
|
8
|
+
this.SENDERKEY_DISTRIBUTION_TYPE = 5;
|
|
9
|
+
this.ENCRYPTED_MESSAGE_OVERHEAD = 53;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=ciphertext-message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ciphertext-message.js","sourceRoot":"","sources":["../../../src/Signal/Group/ciphertext-message.js"],"names":[],"mappings":"AAAA,MAAM,OAAO,iBAAiB;IAC1B;QACI,IAAI,CAAC,mBAAmB,GAAG,CAAC,CAAC;QAC7B,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC;QACzB,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC;QACxB,IAAI,CAAC,2BAA2B,GAAG,CAAC,CAAC;QACrC,IAAI,CAAC,0BAA0B,GAAG,EAAE,CAAC;IACzC,CAAC;CACJ"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export class GroupSessionBuilder {
|
|
2
|
+
constructor(senderKeyStore: any);
|
|
3
|
+
senderKeyStore: any;
|
|
4
|
+
process(senderKeyName: any, senderKeyDistributionMessage: any): Promise<void>;
|
|
5
|
+
create(senderKeyName: any): Promise<SenderKeyDistributionMessage>;
|
|
6
|
+
}
|
|
7
|
+
import { SenderKeyDistributionMessage } from './sender-key-distribution-message.js';
|
|
8
|
+
//# sourceMappingURL=group-session-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-session-builder.d.ts","sourceRoot":"","sources":["../../../src/Signal/Group/group-session-builder.js"],"names":[],"mappings":"AAIA;IACI,iCAEC;IADG,oBAAoC;IAExC,8EAIC;IACD,kEAcC;CACJ;6CA3B4C,sCAAsC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as keyhelper from './keyhelper.js';
|
|
2
|
+
import { SenderKeyDistributionMessage } from './sender-key-distribution-message.js';
|
|
3
|
+
import { SenderKeyName } from './sender-key-name.js';
|
|
4
|
+
import { SenderKeyRecord } from './sender-key-record.js';
|
|
5
|
+
export class GroupSessionBuilder {
|
|
6
|
+
constructor(senderKeyStore) {
|
|
7
|
+
this.senderKeyStore = senderKeyStore;
|
|
8
|
+
}
|
|
9
|
+
async process(senderKeyName, senderKeyDistributionMessage) {
|
|
10
|
+
const senderKeyRecord = await this.senderKeyStore.loadSenderKey(senderKeyName);
|
|
11
|
+
senderKeyRecord.addSenderKeyState(senderKeyDistributionMessage.getId(), senderKeyDistributionMessage.getIteration(), senderKeyDistributionMessage.getChainKey(), senderKeyDistributionMessage.getSignatureKey());
|
|
12
|
+
await this.senderKeyStore.storeSenderKey(senderKeyName, senderKeyRecord);
|
|
13
|
+
}
|
|
14
|
+
async create(senderKeyName) {
|
|
15
|
+
const senderKeyRecord = await this.senderKeyStore.loadSenderKey(senderKeyName);
|
|
16
|
+
if (senderKeyRecord.isEmpty()) {
|
|
17
|
+
const keyId = keyhelper.generateSenderKeyId();
|
|
18
|
+
const senderKey = keyhelper.generateSenderKey();
|
|
19
|
+
const signingKey = keyhelper.generateSenderSigningKey();
|
|
20
|
+
senderKeyRecord.setSenderKeyState(keyId, 0, senderKey, signingKey);
|
|
21
|
+
await this.senderKeyStore.storeSenderKey(senderKeyName, senderKeyRecord);
|
|
22
|
+
}
|
|
23
|
+
const state = senderKeyRecord.getSenderKeyState();
|
|
24
|
+
if (!state) {
|
|
25
|
+
throw new Error('No session state available');
|
|
26
|
+
}
|
|
27
|
+
return new SenderKeyDistributionMessage(state.getKeyId(), state.getSenderChainKey().getIteration(), state.getSenderChainKey().getSeed(), state.getSigningKeyPublic());
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=group-session-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-session-builder.js","sourceRoot":"","sources":["../../../src/Signal/Group/group-session-builder.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,MAAM,OAAO,mBAAmB;IAC5B,YAAY,cAAc;QACtB,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;IACzC,CAAC;IACD,KAAK,CAAC,OAAO,CAAC,aAAa,EAAE,4BAA4B;QACrD,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;QAC/E,eAAe,CAAC,iBAAiB,CAAC,4BAA4B,CAAC,KAAK,EAAE,EAAE,4BAA4B,CAAC,YAAY,EAAE,EAAE,4BAA4B,CAAC,WAAW,EAAE,EAAE,4BAA4B,CAAC,eAAe,EAAE,CAAC,CAAC;QACjN,MAAM,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;IAC7E,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,aAAa;QACtB,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;QAC/E,IAAI,eAAe,CAAC,OAAO,EAAE,EAAE,CAAC;YAC5B,MAAM,KAAK,GAAG,SAAS,CAAC,mBAAmB,EAAE,CAAC;YAC9C,MAAM,SAAS,GAAG,SAAS,CAAC,iBAAiB,EAAE,CAAC;YAChD,MAAM,UAAU,GAAG,SAAS,CAAC,wBAAwB,EAAE,CAAC;YACxD,eAAe,CAAC,iBAAiB,CAAC,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;YACnE,MAAM,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;QAC7E,CAAC;QACD,MAAM,KAAK,GAAG,eAAe,CAAC,iBAAiB,EAAE,CAAC;QAClD,IAAI,CAAC,KAAK,EAAE,CAAC;YACT,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;QAClD,CAAC;QACD,OAAO,IAAI,4BAA4B,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC,iBAAiB,EAAE,CAAC,YAAY,EAAE,EAAE,KAAK,CAAC,iBAAiB,EAAE,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,mBAAmB,EAAE,CAAC,CAAC;IAC1K,CAAC;CACJ"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export class GroupCipher {
|
|
2
|
+
constructor(senderKeyStore: any, senderKeyName: any);
|
|
3
|
+
senderKeyStore: any;
|
|
4
|
+
senderKeyName: any;
|
|
5
|
+
encrypt(paddedPlaintext: any): Promise<any>;
|
|
6
|
+
decrypt(senderKeyMessageBytes: any): Promise<any>;
|
|
7
|
+
getSenderKey(senderKeyState: any, iteration: any): any;
|
|
8
|
+
getPlainText(iv: any, key: any, ciphertext: any): Promise<any>;
|
|
9
|
+
getCipherText(iv: any, key: any, plaintext: any): Promise<any>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=group_cipher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group_cipher.d.ts","sourceRoot":"","sources":["../../../src/Signal/Group/group_cipher.js"],"names":[],"mappings":"AAKA;IACI,qDAGC;IAFG,oBAAoC;IACpC,mBAAkC;IAEtC,4CAeC;IACD,kDAeC;IACD,uDAqBC;IACD,+DAOC;IACD,+DAOC;CACJ"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { decrypt, encrypt } from 'libsignal/src/crypto.js';
|
|
2
|
+
import { SenderKeyMessage } from './sender-key-message.js';
|
|
3
|
+
import { SenderKeyName } from './sender-key-name.js';
|
|
4
|
+
import { SenderKeyRecord } from './sender-key-record.js';
|
|
5
|
+
import { SenderKeyState } from './sender-key-state.js';
|
|
6
|
+
export class GroupCipher {
|
|
7
|
+
constructor(senderKeyStore, senderKeyName) {
|
|
8
|
+
this.senderKeyStore = senderKeyStore;
|
|
9
|
+
this.senderKeyName = senderKeyName;
|
|
10
|
+
}
|
|
11
|
+
async encrypt(paddedPlaintext) {
|
|
12
|
+
const record = await this.senderKeyStore.loadSenderKey(this.senderKeyName);
|
|
13
|
+
if (!record) {
|
|
14
|
+
throw new Error('No SenderKeyRecord found for encryption');
|
|
15
|
+
}
|
|
16
|
+
const senderKeyState = record.getSenderKeyState();
|
|
17
|
+
if (!senderKeyState) {
|
|
18
|
+
throw new Error('No session to encrypt message');
|
|
19
|
+
}
|
|
20
|
+
const iteration = senderKeyState.getSenderChainKey().getIteration();
|
|
21
|
+
const senderKey = this.getSenderKey(senderKeyState, iteration === 0 ? 0 : iteration + 1);
|
|
22
|
+
const ciphertext = await this.getCipherText(senderKey.getIv(), senderKey.getCipherKey(), paddedPlaintext);
|
|
23
|
+
const senderKeyMessage = new SenderKeyMessage(senderKeyState.getKeyId(), senderKey.getIteration(), ciphertext, senderKeyState.getSigningKeyPrivate());
|
|
24
|
+
await this.senderKeyStore.storeSenderKey(this.senderKeyName, record);
|
|
25
|
+
return senderKeyMessage.serialize();
|
|
26
|
+
}
|
|
27
|
+
async decrypt(senderKeyMessageBytes) {
|
|
28
|
+
const record = await this.senderKeyStore.loadSenderKey(this.senderKeyName);
|
|
29
|
+
if (!record) {
|
|
30
|
+
throw new Error('No SenderKeyRecord found for decryption');
|
|
31
|
+
}
|
|
32
|
+
const senderKeyMessage = new SenderKeyMessage(null, null, null, null, senderKeyMessageBytes);
|
|
33
|
+
const senderKeyState = record.getSenderKeyState(senderKeyMessage.getKeyId());
|
|
34
|
+
if (!senderKeyState) {
|
|
35
|
+
throw new Error('No session found to decrypt message');
|
|
36
|
+
}
|
|
37
|
+
senderKeyMessage.verifySignature(senderKeyState.getSigningKeyPublic());
|
|
38
|
+
const senderKey = this.getSenderKey(senderKeyState, senderKeyMessage.getIteration());
|
|
39
|
+
const plaintext = await this.getPlainText(senderKey.getIv(), senderKey.getCipherKey(), senderKeyMessage.getCipherText());
|
|
40
|
+
await this.senderKeyStore.storeSenderKey(this.senderKeyName, record);
|
|
41
|
+
return plaintext;
|
|
42
|
+
}
|
|
43
|
+
getSenderKey(senderKeyState, iteration) {
|
|
44
|
+
let senderChainKey = senderKeyState.getSenderChainKey();
|
|
45
|
+
if (senderChainKey.getIteration() > iteration) {
|
|
46
|
+
if (senderKeyState.hasSenderMessageKey(iteration)) {
|
|
47
|
+
const messageKey = senderKeyState.removeSenderMessageKey(iteration);
|
|
48
|
+
if (!messageKey) {
|
|
49
|
+
throw new Error('No sender message key found for iteration');
|
|
50
|
+
}
|
|
51
|
+
return messageKey;
|
|
52
|
+
}
|
|
53
|
+
throw new Error(`Received message with old counter: ${senderChainKey.getIteration()}, ${iteration}`);
|
|
54
|
+
}
|
|
55
|
+
if (iteration - senderChainKey.getIteration() > 2000) {
|
|
56
|
+
throw new Error('Over 2000 messages into the future!');
|
|
57
|
+
}
|
|
58
|
+
while (senderChainKey.getIteration() < iteration) {
|
|
59
|
+
senderKeyState.addSenderMessageKey(senderChainKey.getSenderMessageKey());
|
|
60
|
+
senderChainKey = senderChainKey.getNext();
|
|
61
|
+
}
|
|
62
|
+
senderKeyState.setSenderChainKey(senderChainKey.getNext());
|
|
63
|
+
return senderChainKey.getSenderMessageKey();
|
|
64
|
+
}
|
|
65
|
+
async getPlainText(iv, key, ciphertext) {
|
|
66
|
+
try {
|
|
67
|
+
return decrypt(key, ciphertext, iv);
|
|
68
|
+
}
|
|
69
|
+
catch (e) {
|
|
70
|
+
throw new Error('InvalidMessageException');
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
async getCipherText(iv, key, plaintext) {
|
|
74
|
+
try {
|
|
75
|
+
return encrypt(key, plaintext, iv);
|
|
76
|
+
}
|
|
77
|
+
catch (e) {
|
|
78
|
+
throw new Error('InvalidMessageException');
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=group_cipher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group_cipher.js","sourceRoot":"","sources":["../../../src/Signal/Group/group_cipher.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,MAAM,OAAO,WAAW;IACpB,YAAY,cAAc,EAAE,aAAa;QACrC,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACvC,CAAC;IACD,KAAK,CAAC,OAAO,CAAC,eAAe;QACzB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC3E,IAAI,CAAC,MAAM,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;QAC/D,CAAC;QACD,MAAM,cAAc,GAAG,MAAM,CAAC,iBAAiB,EAAE,CAAC;QAClD,IAAI,CAAC,cAAc,EAAE,CAAC;YAClB,M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Ac,CAAC,mBAAmB,EAAE,CAAC,CAAC;YACzE,cAAc,GAAG,cAAc,CAAC,OAAO,EAAE,CAAC;QAC9C,CAAC;QACD,cAAc,CAAC,iBAAiB,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC,CAAC;QAC3D,OAAO,cAAc,CAAC,mBAAmB,EAAE,CAAC;IAChD,CAAC;IACD,KAAK,CAAC,YAAY,CAAC,EAAE,EAAE,GAAG,EAAE,UAAU;QAClC,IAAI,CAAC;YACD,OAAO,OAAO,CAAC,GAAG,EAAE,UAAU,EAAE,EAAE,CAAC,CAAC;QACxC,CAAC;QACD,OAAO,CAAC,EAAE,CAAC;YACP,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC/C,CAAC;IACL,CAAC;IACD,KAAK,CAAC,aAAa,CAAC,EAAE,EAAE,GAAG,EAAE,SAAS;QAClC,IAAI,CAAC;YACD,OAAO,OAAO,CAAC,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC;QACvC,CAAC;QACD,OAAO,CAAC,EAAE,CAAC;YACP,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC/C,CAAC;IACL,CAAC;CACJ"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { GroupSessionBuilder } from "./group-session-builder.js";
|
|
2
|
+
export { SenderKeyDistributionMessage } from "./sender-key-distribution-message.js";
|
|
3
|
+
export { SenderKeyRecord } from "./sender-key-record.js";
|
|
4
|
+
export { SenderKeyName } from "./sender-key-name.js";
|
|
5
|
+
export { GroupCipher } from "./group_cipher.js";
|
|
6
|
+
export { SenderKeyState } from "./sender-key-state.js";
|
|
7
|
+
export { SenderKeyMessage } from "./sender-key-message.js";
|
|
8
|
+
export { SenderMessageKey } from "./sender-message-key.js";
|
|
9
|
+
export { SenderChainKey } from "./sender-chain-key.js";
|
|
10
|
+
export { CiphertextMessage } from "./ciphertext-message.js";
|
|
11
|
+
export * as keyhelper from "./keyhelper.js";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Signal/Group/index.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { GroupSessionBuilder } from './group-session-builder.js';
|
|
2
|
+
export { SenderKeyDistributionMessage } from './sender-key-distribution-message.js';
|
|
3
|
+
export { SenderKeyRecord } from './sender-key-record.js';
|
|
4
|
+
export { SenderKeyName } from './sender-key-name.js';
|
|
5
|
+
export { GroupCipher } from './group_cipher.js';
|
|
6
|
+
export { SenderKeyState } from './sender-key-state.js';
|
|
7
|
+
export { SenderKeyMessage } from './sender-key-message.js';
|
|
8
|
+
export { SenderMessageKey } from './sender-message-key.js';
|
|
9
|
+
export { SenderChainKey } from './sender-chain-key.js';
|
|
10
|
+
export { CiphertextMessage } from './ciphertext-message.js';
|
|
11
|
+
export * as keyhelper from './keyhelper.js';
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Signal/Group/index.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyhelper.d.ts","sourceRoot":"","sources":["../../../src/Signal/Group/keyhelper.js"],"names":[],"mappings":"AAEA,yCAEC;AACD,2CAEC;AACD;;;EAQC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as nodeCrypto from 'crypto';
|
|
2
|
+
import { generateKeyPair } from 'libsignal/src/curve.js';
|
|
3
|
+
export function generateSenderKey() {
|
|
4
|
+
return nodeCrypto.randomBytes(32);
|
|
5
|
+
}
|
|
6
|
+
export function generateSenderKeyId() {
|
|
7
|
+
return nodeCrypto.randomInt(2147483647);
|
|
8
|
+
}
|
|
9
|
+
export function generateSenderSigningKey(key) {
|
|
10
|
+
if (!key) {
|
|
11
|
+
key = generateKeyPair();
|
|
12
|
+
}
|
|
13
|
+
return {
|
|
14
|
+
public: Buffer.from(key.pubKey),
|
|
15
|
+
private: Buffer.from(key.privKey)
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=keyhelper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyhelper.js","sourceRoot":"","sources":["../../../src/Signal/Group/keyhelper.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,MAAM,UAAU,iBAAiB;IAC7B,OAAO,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;AACtC,CAAC;AACD,MAAM,UAAU,mBAAmB;IAC/B,OAAO,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;AAC5C,CAAC;AACD,MAAM,UAAU,wBAAwB,CAAC,GAAG;IACxC,IAAI,CAAC,GAAG,EAAE,CAAC;QACP,GAAG,GAAG,eAAe,EAAE,CAAC;IAC5B,CAAC;IACD,OAAO;QACH,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC;QAC/B,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC;KACpC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export class SenderChainKey {
|
|
2
|
+
constructor(iteration: any, chainKey: any);
|
|
3
|
+
MESSAGE_KEY_SEED: any;
|
|
4
|
+
CHAIN_KEY_SEED: any;
|
|
5
|
+
iteration: any;
|
|
6
|
+
chainKey: any;
|
|
7
|
+
getIteration(): any;
|
|
8
|
+
getSenderMessageKey(): SenderMessageKey;
|
|
9
|
+
getNext(): SenderChainKey;
|
|
10
|
+
getSeed(): any;
|
|
11
|
+
getDerivative(seed: any, key: any): any;
|
|
12
|
+
}
|
|
13
|
+
import { SenderMessageKey } from './sender-message-key.js';
|
|
14
|
+
//# sourceMappingURL=sender-chain-key.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sender-chain-key.d.ts","sourceRoot":"","sources":["../../../src/Signal/Group/sender-chain-key.js"],"names":[],"mappings":"AAEA;IACI,2CAKC;IAJG,sBAA2C;IAC3C,oBAAyC;IACzC,eAA0B;IAC1B,cAAqC;IAEzC,oBAEC;IACD,wCAEC;IACD,0BAEC;IACD,eAEC;IACD,wCAEC;CACJ;iCAvBgC,yBAAyB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { calculateMAC } from 'libsignal/src/crypto.js';
|
|
2
|
+
import { SenderMessageKey } from './sender-message-key.js';
|
|
3
|
+
export class SenderChainKey {
|
|
4
|
+
constructor(iteration, chainKey) {
|
|
5
|
+
this.MESSAGE_KEY_SEED = Buffer.from([0x01]);
|
|
6
|
+
this.CHAIN_KEY_SEED = Buffer.from([0x02]);
|
|
7
|
+
this.iteration = iteration;
|
|
8
|
+
this.chainKey = Buffer.from(chainKey);
|
|
9
|
+
}
|
|
10
|
+
getIteration() {
|
|
11
|
+
return this.iteration;
|
|
12
|
+
}
|
|
13
|
+
getSenderMessageKey() {
|
|
14
|
+
return new SenderMessageKey(this.iteration, this.getDerivative(this.MESSAGE_KEY_SEED, this.chainKey));
|
|
15
|
+
}
|
|
16
|
+
getNext() {
|
|
17
|
+
return new SenderChainKey(this.iteration + 1, this.getDerivative(this.CHAIN_KEY_SEED, this.chainKey));
|
|
18
|
+
}
|
|
19
|
+
getSeed() {
|
|
20
|
+
return this.chainKey;
|
|
21
|
+
}
|
|
22
|
+
getDerivative(seed, key) {
|
|
23
|
+
return calculateMAC(key, seed);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=sender-chain-key.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sender-chain-key.js","sourceRoot":"","sources":["../../../src/Signal/Group/sender-chain-key.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,MAAM,OAAO,cAAc;IACvB,YAAY,SAAS,EAAE,QAAQ;QAC3B,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5C,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QAC1C,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IACD,YAAY;QACR,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IACD,mBAAmB;QACf,OAAO,IAAI,gBAAgB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC1G,CAAC;IACD,OAAO;QACH,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,SAAS,GAAG,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC1G,CAAC;IACD,OAAO;QACH,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IACD,aAAa,CAAC,IAAI,EAAE,GAAG;QACnB,OAAO,YAAY,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACnC,CAAC;CACJ"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export class SenderKeyDistributionMessage extends CiphertextMessage {
|
|
2
|
+
constructor(id: any, iteration: any, chainKey: any, signatureKey: any, serialized: any);
|
|
3
|
+
serialized: any;
|
|
4
|
+
id: any;
|
|
5
|
+
iteration: any;
|
|
6
|
+
chainKey: any;
|
|
7
|
+
signatureKey: any;
|
|
8
|
+
intsToByteHighAndLow(highValue: any, lowValue: any): number;
|
|
9
|
+
serialize(): any;
|
|
10
|
+
getType(): number;
|
|
11
|
+
getIteration(): any;
|
|
12
|
+
getChainKey(): any;
|
|
13
|
+
getSignatureKey(): any;
|
|
14
|
+
getId(): any;
|
|
15
|
+
}
|
|
16
|
+
import { CiphertextMessage } from './ciphertext-message.js';
|
|
17
|
+
//# sourceMappingURL=sender-key-distribution-message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sender-key-distribution-message.d.ts","sourceRoot":"","sources":["../../../src/Signal/Group/sender-key-distribution-message.js"],"names":[],"mappings":"AAEA;IACI,wFAoCC;IA9BW,gBAA4B;IAC5B,QAAgC;IAChC,eAA8C;IAC9C,cAGsC;IACtC,kBAGwC;IAqBpD,4DAEC;IACD,iBAEC;IACD,kBAEC;IACD,oBAEC;IACD,mBAEC;IACD,uBAEC;IACD,aAEC;CACJ;kCA5DiC,yBAAyB"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { proto } from '../../../WAProto/index.js';
|
|
2
|
+
import { CiphertextMessage } from './ciphertext-message.js';
|
|
3
|
+
export class SenderKeyDistributionMessage extends CiphertextMessage {
|
|
4
|
+
constructor(id, iteration, chainKey, signatureKey, serialized) {
|
|
5
|
+
super();
|
|
6
|
+
if (serialized) {
|
|
7
|
+
try {
|
|
8
|
+
const message = serialized.slice(1);
|
|
9
|
+
const distributionMessage = proto.SenderKeyDistributionMessage.decode(message).toJSON();
|
|
10
|
+
this.serialized = serialized;
|
|
11
|
+
this.id = distributionMessage.id;
|
|
12
|
+
this.iteration = distributionMessage.iteration;
|
|
13
|
+
this.chainKey =
|
|
14
|
+
typeof distributionMessage.chainKey === 'string'
|
|
15
|
+
? Buffer.from(distributionMessage.chainKey, 'base64')
|
|
16
|
+
: distributionMessage.chainKey;
|
|
17
|
+
this.signatureKey =
|
|
18
|
+
typeof distributionMessage.signingKey === 'string'
|
|
19
|
+
? Buffer.from(distributionMessage.signingKey, 'base64')
|
|
20
|
+
: distributionMessage.signingKey;
|
|
21
|
+
}
|
|
22
|
+
catch (e) {
|
|
23
|
+
throw new Error(String(e));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
const version = this.intsToByteHighAndLow(this.CURRENT_VERSION, this.CURRENT_VERSION);
|
|
28
|
+
this.id = id;
|
|
29
|
+
this.iteration = iteration;
|
|
30
|
+
this.chainKey = chainKey;
|
|
31
|
+
this.signatureKey = signatureKey;
|
|
32
|
+
const message = proto.SenderKeyDistributionMessage.encode(proto.SenderKeyDistributionMessage.create({
|
|
33
|
+
id,
|
|
34
|
+
iteration,
|
|
35
|
+
chainKey,
|
|
36
|
+
signingKey: this.signatureKey
|
|
37
|
+
})).finish();
|
|
38
|
+
this.serialized = Buffer.concat([Buffer.from([version]), message]);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
intsToByteHighAndLow(highValue, lowValue) {
|
|
42
|
+
return (((highValue << 4) | lowValue) & 0xff) % 256;
|
|
43
|
+
}
|
|
44
|
+
serialize() {
|
|
45
|
+
return this.serialized;
|
|
46
|
+
}
|
|
47
|
+
getType() {
|
|
48
|
+
return this.SENDERKEY_DISTRIBUTION_TYPE;
|
|
49
|
+
}
|
|
50
|
+
getIteration() {
|
|
51
|
+
return this.iteration;
|
|
52
|
+
}
|
|
53
|
+
getChainKey() {
|
|
54
|
+
return this.chainKey;
|
|
55
|
+
}
|
|
56
|
+
getSignatureKey() {
|
|
57
|
+
return this.signatureKey;
|
|
58
|
+
}
|
|
59
|
+
getId() {
|
|
60
|
+
return this.id;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=sender-key-distribution-message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sender-key-distribution-message.js","sourceRoot":"","sources":["../../../src/Signal/Group/sender-key-distribution-message.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,MAAM,OAAO,4BAA6B,SAAQ,iBAAiB;IAC/D,YAAY,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU;QACzD,KAAK,EAAE,CAAC;QACR,IAAI,UAAU,EAAE,CAAC;YACb,IAAI,CAAC;gBACD,MAAM,OAAO,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBACpC,MAAM,mBAAmB,GAAG,KAAK,CAAC,4BAA4B,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC;gBACxF,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;gBAC7B,IAAI,CAAC,EAAE,GAAG,mBAAmB,CAAC,EAAE,CAAC;gBACjC,IAAI,CAAC,SAAS,GAAG,mBAAmB,CAAC,SAAS,CAAC;gBAC/C,IAAI,CAA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AO,CAAC,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,GAAG,QAAQ,CAAC,GAAG,IAAI,CAAC,GAAG,GAAG,CAAC;IACxD,CAAC;IACD,SAAS;QACL,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IACD,OAAO;QACH,OAAO,IAAI,CAAC,2BAA2B,CAAC;IAC5C,CAAC;IACD,YAAY;QACR,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IACD,WAAW;QACP,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IACD,eAAe;QACX,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IACD,KAAK;QACD,OAAO,IAAI,CAAC,EAAE,CAAC;IACnB,CAAC;CACJ"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export class SenderKeyMessage extends CiphertextMessage {
|
|
2
|
+
constructor(keyId: any, iteration: any, ciphertext: any, signatureKey: any, serialized: any);
|
|
3
|
+
SIGNATURE_LENGTH: number;
|
|
4
|
+
serialized: any;
|
|
5
|
+
messageVersion: number;
|
|
6
|
+
keyId: any;
|
|
7
|
+
iteration: any;
|
|
8
|
+
ciphertext: any;
|
|
9
|
+
signature: any;
|
|
10
|
+
getKeyId(): any;
|
|
11
|
+
getIteration(): any;
|
|
12
|
+
getCipherText(): any;
|
|
13
|
+
verifySignature(signatureKey: any): void;
|
|
14
|
+
getSignature(signatureKey: any, serialized: any): any;
|
|
15
|
+
serialize(): any;
|
|
16
|
+
getType(): number;
|
|
17
|
+
}
|
|
18
|
+
import { CiphertextMessage } from './ciphertext-message.js';
|
|
19
|
+
//# sourceMappingURL=sender-key-message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sender-key-message.d.ts","sourceRoot":"","sources":["../../../src/Signal/Group/sender-key-message.js"],"names":[],"mappings":"AAGA;IACI,6FAkCC;IAhCG,yBAA0B;IAMtB,gBAA4B;IAC5B,uBAA2C;IAC3C,WAAgC;IAChC,eAA2C;IAC3C,gBAGqC;IACrC,eAA0B;IAmBlC,gBAEC;IACD,oBAEC;IACD,qBAEC;IACD,yCAMC;IACD,sDAEC;IACD,iBAEC;IACD,kBAEC;CACJ;kCA9DiC,yBAAyB"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { calculateSignature, verifySignature } from 'libsignal/src/curve.js';
|
|
2
|
+
import { proto } from '../../../WAProto/index.js';
|
|
3
|
+
import { CiphertextMessage } from './ciphertext-message.js';
|
|
4
|
+
export class SenderKeyMessage extends CiphertextMessage {
|
|
5
|
+
constructor(keyId, iteration, ciphertext, signatureKey, serialized) {
|
|
6
|
+
super();
|
|
7
|
+
this.SIGNATURE_LENGTH = 64;
|
|
8
|
+
if (serialized) {
|
|
9
|
+
const version = serialized[0];
|
|
10
|
+
const message = serialized.slice(1, serialized.length - this.SIGNATURE_LENGTH);
|
|
11
|
+
const signature = serialized.slice(-1 * this.SIGNATURE_LENGTH);
|
|
12
|
+
const senderKeyMessage = proto.SenderKeyMessage.decode(message).toJSON();
|
|
13
|
+
this.serialized = serialized;
|
|
14
|
+
this.messageVersion = (version & 0xff) >> 4;
|
|
15
|
+
this.keyId = senderKeyMessage.id;
|
|
16
|
+
this.iteration = senderKeyMessage.iteration;
|
|
17
|
+
this.ciphertext =
|
|
18
|
+
typeof senderKeyMessage.ciphertext === 'string'
|
|
19
|
+
? Buffer.from(senderKeyMessage.ciphertext, 'base64')
|
|
20
|
+
: senderKeyMessage.ciphertext;
|
|
21
|
+
this.signature = signature;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
const version = (((this.CURRENT_VERSION << 4) | this.CURRENT_VERSION) & 0xff) % 256;
|
|
25
|
+
const ciphertextBuffer = Buffer.from(ciphertext);
|
|
26
|
+
const message = proto.SenderKeyMessage.encode(proto.SenderKeyMessage.create({
|
|
27
|
+
id: keyId,
|
|
28
|
+
iteration: iteration,
|
|
29
|
+
ciphertext: ciphertextBuffer
|
|
30
|
+
})).finish();
|
|
31
|
+
const signature = this.getSignature(signatureKey, Buffer.concat([Buffer.from([version]), message]));
|
|
32
|
+
this.serialized = Buffer.concat([Buffer.from([version]), message, Buffer.from(signature)]);
|
|
33
|
+
this.messageVersion = this.CURRENT_VERSION;
|
|
34
|
+
this.keyId = keyId;
|
|
35
|
+
this.iteration = iteration;
|
|
36
|
+
this.ciphertext = ciphertextBuffer;
|
|
37
|
+
this.signature = signature;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
getKeyId() {
|
|
41
|
+
return this.keyId;
|
|
42
|
+
}
|
|
43
|
+
getIteration() {
|
|
44
|
+
return this.iteration;
|
|
45
|
+
}
|
|
46
|
+
getCipherText() {
|
|
47
|
+
return this.ciphertext;
|
|
48
|
+
}
|
|
49
|
+
verifySignature(signatureKey) {
|
|
50
|
+
const part1 = this.serialized.slice(0, this.serialized.length - this.SIGNATURE_LENGTH);
|
|
51
|
+
const part2 = this.serialized.slice(-1 * this.SIGNATURE_LENGTH);
|
|
52
|
+
const res = verifySignature(signatureKey, part1, part2);
|
|
53
|
+
if (!res)
|
|
54
|
+
throw new Error('Invalid signature!');
|
|
55
|
+
}
|
|
56
|
+
getSignature(signatureKey, serialized) {
|
|
57
|
+
return Buffer.from(calculateSignature(signatureKey, serialized));
|
|
58
|
+
}
|
|
59
|
+
serialize() {
|
|
60
|
+
return this.serialized;
|
|
61
|
+
}
|
|
62
|
+
getType() {
|
|
63
|
+
return 4;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=sender-key-message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sender-key-message.js","sourceRoot":"","sources":["../../../src/Signal/Group/sender-key-message.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,iBAA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IAAI,CAAC,gBAAgB,CAAC,CAAC;QACvF,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAChE,MAAM,GAAG,GAAG,eAAe,CAAC,YAAY,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QACxD,IAAI,CAAC,GAAG;YACJ,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IAC9C,CAAC;IACD,YAAY,CAAC,YAAY,EAAE,UAAU;QACjC,OAAO,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC;IACrE,CAAC;IACD,SAAS;QACL,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IACD,OAAO;QACH,OAAO,CAAC,CAAC;IACb,CAAC;CACJ"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export class SenderKeyName {
|
|
2
|
+
constructor(groupId: any, sender: any);
|
|
3
|
+
groupId: any;
|
|
4
|
+
sender: any;
|
|
5
|
+
getGroupId(): any;
|
|
6
|
+
getSender(): any;
|
|
7
|
+
serialize(): string;
|
|
8
|
+
toString(): string;
|
|
9
|
+
equals(other: any): boolean;
|
|
10
|
+
hashCode(): number;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=sender-key-name.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sender-key-name.d.ts","sourceRoot":"","sources":["../../../src/Signal/Group/sender-key-name.js"],"names":[],"mappings":"AAqBA;IACI,uCAGC;IAFG,aAAsB;IACtB,YAAoB;IAExB,kBAEC;IACD,iBAEC;IACD,oBAEC;IACD,mBAEC;IACD,4BAIC;IACD,mBAEC;CACJ"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
function isNull(str) {
|
|
2
|
+
return str === null || str === '';
|
|
3
|
+
}
|
|
4
|
+
function intValue(num) {
|
|
5
|
+
const MAX_VALUE = 0x7fffffff;
|
|
6
|
+
const MIN_VALUE = -0x80000000;
|
|
7
|
+
if (num > MAX_VALUE || num < MIN_VALUE) {
|
|
8
|
+
return num & 0xffffffff;
|
|
9
|
+
}
|
|
10
|
+
return num;
|
|
11
|
+
}
|
|
12
|
+
function hashCode(strKey) {
|
|
13
|
+
let hash = 0;
|
|
14
|
+
if (!isNull(strKey)) {
|
|
15
|
+
for (let i = 0; i < strKey.length; i++) {
|
|
16
|
+
hash = hash * 31 + strKey.charCodeAt(i);
|
|
17
|
+
hash = intValue(hash);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return hash;
|
|
21
|
+
}
|
|
22
|
+
export class SenderKeyName {
|
|
23
|
+
constructor(groupId, sender) {
|
|
24
|
+
this.groupId = groupId;
|
|
25
|
+
this.sender = sender;
|
|
26
|
+
}
|
|
27
|
+
getGroupId() {
|
|
28
|
+
return this.groupId;
|
|
29
|
+
}
|
|
30
|
+
getSender() {
|
|
31
|
+
return this.sender;
|
|
32
|
+
}
|
|
33
|
+
serialize() {
|
|
34
|
+
return `${this.groupId}::${this.sender.id}::${this.sender.deviceId}`;
|
|
35
|
+
}
|
|
36
|
+
toString() {
|
|
37
|
+
return this.serialize();
|
|
38
|
+
}
|
|
39
|
+
equals(other) {
|
|
40
|
+
if (other === null)
|
|
41
|
+
return false;
|
|
42
|
+
return this.groupId === other.groupId && this.sender.toString() === other.sender.toString();
|
|
43
|
+
}
|
|
44
|
+
hashCode() {
|
|
45
|
+
return hashCode(this.groupId) ^ hashCode(this.sender.toString());
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=sender-key-name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sender-key-name.js","sourceRoot":"","sources":["../../../src/Signal/Group/sender-key-name.js"],"names":[],"mappings":"AAAA,SAAS,MAAM,CAAC,GAAG;IACf,OAAO,GAAG,KAAK,IAAI,IAAI,GAAG,K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d,OAAO,KAAK,CAAC;QACjB,OAAO,IAAI,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;IAChG,CAAC;IACD,QAAQ;QACJ,OAAO,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;IACrE,CAAC;CACJ"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export class SenderKeyRecord {
|
|
2
|
+
static deserialize(data: any): SenderKeyRecord;
|
|
3
|
+
constructor(serialized: any);
|
|
4
|
+
MAX_STATES: number;
|
|
5
|
+
senderKeyStates: SenderKeyState[];
|
|
6
|
+
isEmpty(): boolean;
|
|
7
|
+
getSenderKeyState(keyId: any): SenderKeyState | undefined;
|
|
8
|
+
addSenderKeyState(id: any, iteration: any, chainKey: any, signatureKey: any): void;
|
|
9
|
+
setSenderKeyState(id: any, iteration: any, chainKey: any, keyPair: any): void;
|
|
10
|
+
serialize(): any[];
|
|
11
|
+
}
|
|
12
|
+
import { SenderKeyState } from './sender-key-state.js';
|
|
13
|
+
//# sourceMappingURL=sender-key-record.d.ts.map
|