@mtkruto/node 0.6.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +76 -1
- package/esm/0_deps.d.ts +1 -1
- package/esm/0_deps.d.ts.map +1 -1
- package/esm/0_deps.js +1 -1
- package/esm/1_utilities.d.ts +1 -1
- package/esm/1_utilities.d.ts.map +1 -1
- package/esm/1_utilities.js +1 -1
- package/esm/4_constants.d.ts +1 -1
- package/esm/4_constants.js +1 -1
- package/esm/client/0_params.d.ts +4 -0
- package/esm/client/0_params.d.ts.map +1 -1
- package/esm/client/0_utilities.d.ts +2 -2
- package/esm/client/0_utilities.d.ts.map +1 -1
- package/esm/client/2_account_manager.d.ts +4 -0
- package/esm/client/2_account_manager.d.ts.map +1 -1
- package/esm/client/2_account_manager.js +34 -0
- package/esm/client/5_client.d.ts +16 -1
- package/esm/client/5_client.d.ts.map +1 -1
- package/esm/client/5_client.js +19 -0
- package/esm/deps/jsr.io/@roj/tgcrypto/1.0.0/dist/mod.d.ts +18 -0
- package/esm/deps/jsr.io/@roj/tgcrypto/1.0.0/dist/mod.d.ts.map +1 -0
- package/esm/deps/jsr.io/@roj/tgcrypto/1.0.0/dist/mod.js +63 -0
- package/esm/deps/jsr.io/@roj/tgcrypto/1.0.0/dist/tgcrypto.d.ts +3 -0
- package/esm/deps/jsr.io/@roj/tgcrypto/1.0.0/dist/tgcrypto.d.ts.map +1 -0
- package/esm/deps/jsr.io/@roj/tgcrypto/1.0.0/dist/tgcrypto.js +301 -0
- package/esm/tl/0_api.d.ts +119 -5
- package/esm/tl/0_api.d.ts.map +1 -1
- package/esm/tl/0_api.js +188 -17
- package/esm/transport/0_obfuscation.d.ts.map +1 -1
- package/esm/transport/0_obfuscation.js +5 -4
- package/esm/transport/0_transport.d.ts +2 -2
- package/esm/transport/0_transport.d.ts.map +1 -1
- package/esm/transport/0_transport.js +10 -6
- package/esm/transport/1_transport_abridged.d.ts.map +1 -1
- package/esm/transport/1_transport_abridged.js +6 -8
- package/esm/transport/1_transport_intermediate.d.ts.map +1 -1
- package/esm/transport/1_transport_intermediate.js +4 -6
- package/esm/types/0_switch_inline_query_chosen_chats.d.ts +19 -0
- package/esm/types/0_switch_inline_query_chosen_chats.d.ts.map +1 -1
- package/esm/types/0_switch_inline_query_chosen_chats.js +19 -0
- package/esm/types/2_forward_header.d.ts +19 -0
- package/esm/types/2_forward_header.d.ts.map +1 -1
- package/esm/types/2_forward_header.js +19 -0
- package/esm/utilities/0_env.d.ts.map +1 -1
- package/esm/utilities/0_env.js +19 -0
- package/esm/utilities/0_gunzip.d.ts +19 -0
- package/esm/utilities/0_gunzip.d.ts.map +1 -1
- package/esm/utilities/0_gunzip.js +19 -0
- package/{script/utilities/0_crypto.d.ts → esm/utilities/1_crypto.d.ts} +9 -5
- package/esm/utilities/1_crypto.d.ts.map +1 -0
- package/esm/utilities/{0_crypto.js → 1_crypto.js} +41 -21
- package/esm/utilities/1_crypto_test.d.ts.map +1 -0
- package/package.json +1 -1
- package/script/0_deps.d.ts +1 -1
- package/script/0_deps.d.ts.map +1 -1
- package/script/0_deps.js +2 -5
- package/script/1_utilities.d.ts +1 -1
- package/script/1_utilities.d.ts.map +1 -1
- package/script/1_utilities.js +1 -1
- package/script/4_constants.d.ts +1 -1
- package/script/4_constants.js +1 -1
- package/script/client/0_params.d.ts +4 -0
- package/script/client/0_params.d.ts.map +1 -1
- package/script/client/0_utilities.d.ts +2 -2
- package/script/client/0_utilities.d.ts.map +1 -1
- package/script/client/2_account_manager.d.ts +4 -0
- package/script/client/2_account_manager.d.ts.map +1 -1
- package/script/client/2_account_manager.js +34 -0
- package/script/client/5_client.d.ts +16 -1
- package/script/client/5_client.d.ts.map +1 -1
- package/script/client/5_client.js +19 -0
- package/script/deps/jsr.io/@roj/tgcrypto/1.0.0/dist/mod.d.ts +18 -0
- package/script/deps/jsr.io/@roj/tgcrypto/1.0.0/dist/mod.d.ts.map +1 -0
- package/script/deps/jsr.io/@roj/tgcrypto/1.0.0/dist/mod.js +71 -0
- package/script/deps/jsr.io/@roj/tgcrypto/1.0.0/dist/tgcrypto.d.ts +3 -0
- package/script/deps/jsr.io/@roj/tgcrypto/1.0.0/dist/tgcrypto.d.ts.map +1 -0
- package/script/deps/jsr.io/@roj/tgcrypto/1.0.0/dist/tgcrypto.js +303 -0
- package/script/tl/0_api.d.ts +119 -5
- package/script/tl/0_api.d.ts.map +1 -1
- package/script/tl/0_api.js +188 -17
- package/script/transport/0_obfuscation.d.ts.map +1 -1
- package/script/transport/0_obfuscation.js +5 -4
- package/script/transport/0_transport.d.ts +2 -2
- package/script/transport/0_transport.d.ts.map +1 -1
- package/script/transport/0_transport.js +10 -6
- package/script/transport/1_transport_abridged.d.ts.map +1 -1
- package/script/transport/1_transport_abridged.js +6 -8
- package/script/transport/1_transport_intermediate.d.ts.map +1 -1
- package/script/transport/1_transport_intermediate.js +4 -6
- package/script/types/0_switch_inline_query_chosen_chats.d.ts +19 -0
- package/script/types/0_switch_inline_query_chosen_chats.d.ts.map +1 -1
- package/script/types/0_switch_inline_query_chosen_chats.js +19 -0
- package/script/types/2_forward_header.d.ts +19 -0
- package/script/types/2_forward_header.d.ts.map +1 -1
- package/script/types/2_forward_header.js +19 -0
- package/script/utilities/0_env.d.ts.map +1 -1
- package/script/utilities/0_env.js +19 -0
- package/script/utilities/0_gunzip.d.ts +19 -0
- package/script/utilities/0_gunzip.d.ts.map +1 -1
- package/script/utilities/0_gunzip.js +19 -0
- package/{esm/utilities/0_crypto.d.ts → script/utilities/1_crypto.d.ts} +9 -5
- package/script/utilities/1_crypto.d.ts.map +1 -0
- package/script/utilities/1_crypto.js +95 -0
- package/script/utilities/1_crypto_test.d.ts.map +1 -0
- package/esm/deps/jsr.io/@roj/tgcrypto/0.4.1/dist/mod.d.ts +0 -55
- package/esm/deps/jsr.io/@roj/tgcrypto/0.4.1/dist/mod.js +0 -167
- package/esm/deps/jsr.io/@roj/tgcrypto/0.4.1/dist/tgcrypto.js +0 -308
- package/esm/utilities/0_crypto.d.ts.map +0 -1
- package/script/deps/jsr.io/@roj/tgcrypto/0.4.1/dist/mod.d.ts +0 -55
- package/script/deps/jsr.io/@roj/tgcrypto/0.4.1/dist/mod.js +0 -182
- package/script/deps/jsr.io/@roj/tgcrypto/0.4.1/dist/tgcrypto.js +0 -310
- package/script/utilities/0_crypto.d.ts.map +0 -1
- package/script/utilities/0_crypto.js +0 -52
package/script/tl/0_api.js
CHANGED
|
@@ -208,8 +208,8 @@ const map = new Map([
|
|
|
208
208
|
[0x94BD38ED, "messageActionPinMessage"],
|
|
209
209
|
[0x9FBAB604, "messageActionHistoryClear"],
|
|
210
210
|
[0x92A72876, "messageActionGameScore"],
|
|
211
|
-
[
|
|
212
|
-
[
|
|
211
|
+
[0xFFA00CCC, "messageActionPaymentSentMe"],
|
|
212
|
+
[0xC624B16E, "messageActionPaymentSent"],
|
|
213
213
|
[0x80E11A7F, "messageActionPhoneCall"],
|
|
214
214
|
[0x4792929B, "messageActionScreenshotTaken"],
|
|
215
215
|
[0xFAE69F56, "messageActionCustomAction"],
|
|
@@ -240,7 +240,7 @@ const map = new Map([
|
|
|
240
240
|
[0x41B3E202, "messageActionPaymentRefunded"],
|
|
241
241
|
[0x45D5B021, "messageActionGiftStars"],
|
|
242
242
|
[0xB00C47A2, "messageActionPrizeStars"],
|
|
243
|
-
[
|
|
243
|
+
[0x08557637, "messageActionStarGift"],
|
|
244
244
|
[0xD58A08C6, "dialog"],
|
|
245
245
|
[0x71BD134C, "dialogFolder"],
|
|
246
246
|
[0x2331B22D, "photoEmpty"],
|
|
@@ -537,6 +537,7 @@ const map = new Map([
|
|
|
537
537
|
[0xAEE69D68, "inputPrivacyKeyVoiceMessages"],
|
|
538
538
|
[0x3823CC40, "inputPrivacyKeyAbout"],
|
|
539
539
|
[0xD65A11CC, "inputPrivacyKeyBirthday"],
|
|
540
|
+
[0xE1732341, "inputPrivacyKeyStarGiftsAutoSave"],
|
|
540
541
|
[0xBC2EAB30, "privacyKeyStatusTimestamp"],
|
|
541
542
|
[0x500E6DFA, "privacyKeyChatInvite"],
|
|
542
543
|
[0x3D662B7B, "privacyKeyPhoneCall"],
|
|
@@ -548,6 +549,7 @@ const map = new Map([
|
|
|
548
549
|
[0x0697F414, "privacyKeyVoiceMessages"],
|
|
549
550
|
[0xA486B761, "privacyKeyAbout"],
|
|
550
551
|
[0x2000A518, "privacyKeyBirthday"],
|
|
552
|
+
[0x2CA4FDF8, "privacyKeyStarGiftsAutoSave"],
|
|
551
553
|
[0x0D09E07B, "inputPrivacyValueAllowContacts"],
|
|
552
554
|
[0x184B35CE, "inputPrivacyValueAllowAll"],
|
|
553
555
|
[0x131CC67F, "inputPrivacyValueAllowUsers"],
|
|
@@ -558,6 +560,8 @@ const map = new Map([
|
|
|
558
560
|
[0xE94F0F86, "inputPrivacyValueDisallowChatParticipants"],
|
|
559
561
|
[0x2F453E49, "inputPrivacyValueAllowCloseFriends"],
|
|
560
562
|
[0x77CDC9F1, "inputPrivacyValueAllowPremium"],
|
|
563
|
+
[0x5A4FCCE5, "inputPrivacyValueAllowBots"],
|
|
564
|
+
[0xC4E57915, "inputPrivacyValueDisallowBots"],
|
|
561
565
|
[0xFFFE1BAC, "privacyValueAllowContacts"],
|
|
562
566
|
[0x65427B82, "privacyValueAllowAll"],
|
|
563
567
|
[0xB8905FB2, "privacyValueAllowUsers"],
|
|
@@ -568,6 +572,8 @@ const map = new Map([
|
|
|
568
572
|
[0x41C87565, "privacyValueDisallowChatParticipants"],
|
|
569
573
|
[0xF7E8D89B, "privacyValueAllowCloseFriends"],
|
|
570
574
|
[0xECE9814B, "privacyValueAllowPremium"],
|
|
575
|
+
[0x21461B5D, "privacyValueAllowBots"],
|
|
576
|
+
[0xF6A5F82F, "privacyValueDisallowBots"],
|
|
571
577
|
[0x50A04E45, "account.privacyRules"],
|
|
572
578
|
[0xB8D0AFDF, "accountDaysTTL"],
|
|
573
579
|
[0x6C37C15C, "documentAttributeImageSize"],
|
|
@@ -615,7 +621,7 @@ const map = new Map([
|
|
|
615
621
|
[0x6E153F16, "messages.stickerSet"],
|
|
616
622
|
[0xD3F924EB, "messages.stickerSetNotModified"],
|
|
617
623
|
[0xC27AC8C7, "botCommand"],
|
|
618
|
-
[
|
|
624
|
+
[0x36607333, "botInfo"],
|
|
619
625
|
[0xA2FA4880, "keyboardButton"],
|
|
620
626
|
[0x258AFF05, "keyboardButtonUrl"],
|
|
621
627
|
[0x35BBDB6B, "keyboardButtonCallback"],
|
|
@@ -822,7 +828,7 @@ const map = new Map([
|
|
|
822
828
|
[0xFAF7E8C9, "phoneCallDiscardReasonBusy"],
|
|
823
829
|
[0x7D748D04, "dataJSON"],
|
|
824
830
|
[0xCB296BF8, "labeledPrice"],
|
|
825
|
-
[
|
|
831
|
+
[0x049EE584, "invoice"],
|
|
826
832
|
[0xEA02C27E, "paymentCharge"],
|
|
827
833
|
[0x1E8CAAEB, "postAddress"],
|
|
828
834
|
[0x909C3F94, "paymentRequestedInfo"],
|
|
@@ -1432,7 +1438,7 @@ const map = new Map([
|
|
|
1432
1438
|
[0x23E91BA3, "botPreviewMedia"],
|
|
1433
1439
|
[0x0CA71D64, "bots.previewInfo"],
|
|
1434
1440
|
[0x05416D58, "starsSubscriptionPricing"],
|
|
1435
|
-
[
|
|
1441
|
+
[0x2E6EAB1A, "starsSubscription"],
|
|
1436
1442
|
[0x4BA3A95A, "messageReactor"],
|
|
1437
1443
|
[0x94CE852A, "starsGiveawayOption"],
|
|
1438
1444
|
[0x54236209, "starsGiveawayWinnersOption"],
|
|
@@ -1445,6 +1451,9 @@ const map = new Map([
|
|
|
1445
1451
|
[0xF0E4E0B6, "reportResultChooseOption"],
|
|
1446
1452
|
[0x6F09AC31, "reportResultAddComment"],
|
|
1447
1453
|
[0x8DB33C4B, "reportResultReported"],
|
|
1454
|
+
[0x8ECF0511, "messages.botPreparedInlineMessage"],
|
|
1455
|
+
[0xFF57708D, "messages.preparedInlineMessage"],
|
|
1456
|
+
[0xC99B1950, "botAppSettings"],
|
|
1448
1457
|
]);
|
|
1449
1458
|
exports.getTypeName = map.get.bind(map);
|
|
1450
1459
|
exports.flags = Symbol();
|
|
@@ -1693,10 +1702,10 @@ const enums = new Map([
|
|
|
1693
1702
|
["NotifyPeer", ["notifyPeer", "notifyUsers", "notifyChats", "notifyBroadcasts", "notifyForumTopic"]],
|
|
1694
1703
|
["SendMessageAction", ["sendMessageTypingAction", "sendMessageCancelAction", "sendMessageRecordVideoAction", "sendMessageUploadVideoAction", "sendMessageRecordAudioAction", "sendMessageUploadAudioAction", "sendMessageUploadPhotoAction", "sendMessageUploadDocumentAction", "sendMessageGeoLocationAction", "sendMessageChooseContactAction", "sendMessageGamePlayAction", "sendMessageRecordRoundAction", "sendMessageUploadRoundAction", "speakingInGroupCallAction", "sendMessageHistoryImportAction", "sendMessageChooseStickerAction", "sendMessageEmojiInteraction", "sendMessageEmojiInteractionSeen"]],
|
|
1695
1704
|
["contacts.Found", ["contacts.found"]],
|
|
1696
|
-
["InputPrivacyKey", ["inputPrivacyKeyStatusTimestamp", "inputPrivacyKeyChatInvite", "inputPrivacyKeyPhoneCall", "inputPrivacyKeyPhoneP2P", "inputPrivacyKeyForwards", "inputPrivacyKeyProfilePhoto", "inputPrivacyKeyPhoneNumber", "inputPrivacyKeyAddedByPhone", "inputPrivacyKeyVoiceMessages", "inputPrivacyKeyAbout", "inputPrivacyKeyBirthday"]],
|
|
1697
|
-
["PrivacyKey", ["privacyKeyStatusTimestamp", "privacyKeyChatInvite", "privacyKeyPhoneCall", "privacyKeyPhoneP2P", "privacyKeyForwards", "privacyKeyProfilePhoto", "privacyKeyPhoneNumber", "privacyKeyAddedByPhone", "privacyKeyVoiceMessages", "privacyKeyAbout", "privacyKeyBirthday"]],
|
|
1698
|
-
["InputPrivacyRule", ["inputPrivacyValueAllowContacts", "inputPrivacyValueAllowAll", "inputPrivacyValueAllowUsers", "inputPrivacyValueDisallowContacts", "inputPrivacyValueDisallowAll", "inputPrivacyValueDisallowUsers", "inputPrivacyValueAllowChatParticipants", "inputPrivacyValueDisallowChatParticipants", "inputPrivacyValueAllowCloseFriends", "inputPrivacyValueAllowPremium"]],
|
|
1699
|
-
["PrivacyRule", ["privacyValueAllowContacts", "privacyValueAllowAll", "privacyValueAllowUsers", "privacyValueDisallowContacts", "privacyValueDisallowAll", "privacyValueDisallowUsers", "privacyValueAllowChatParticipants", "privacyValueDisallowChatParticipants", "privacyValueAllowCloseFriends", "privacyValueAllowPremium"]],
|
|
1705
|
+
["InputPrivacyKey", ["inputPrivacyKeyStatusTimestamp", "inputPrivacyKeyChatInvite", "inputPrivacyKeyPhoneCall", "inputPrivacyKeyPhoneP2P", "inputPrivacyKeyForwards", "inputPrivacyKeyProfilePhoto", "inputPrivacyKeyPhoneNumber", "inputPrivacyKeyAddedByPhone", "inputPrivacyKeyVoiceMessages", "inputPrivacyKeyAbout", "inputPrivacyKeyBirthday", "inputPrivacyKeyStarGiftsAutoSave"]],
|
|
1706
|
+
["PrivacyKey", ["privacyKeyStatusTimestamp", "privacyKeyChatInvite", "privacyKeyPhoneCall", "privacyKeyPhoneP2P", "privacyKeyForwards", "privacyKeyProfilePhoto", "privacyKeyPhoneNumber", "privacyKeyAddedByPhone", "privacyKeyVoiceMessages", "privacyKeyAbout", "privacyKeyBirthday", "privacyKeyStarGiftsAutoSave"]],
|
|
1707
|
+
["InputPrivacyRule", ["inputPrivacyValueAllowContacts", "inputPrivacyValueAllowAll", "inputPrivacyValueAllowUsers", "inputPrivacyValueDisallowContacts", "inputPrivacyValueDisallowAll", "inputPrivacyValueDisallowUsers", "inputPrivacyValueAllowChatParticipants", "inputPrivacyValueDisallowChatParticipants", "inputPrivacyValueAllowCloseFriends", "inputPrivacyValueAllowPremium", "inputPrivacyValueAllowBots", "inputPrivacyValueDisallowBots"]],
|
|
1708
|
+
["PrivacyRule", ["privacyValueAllowContacts", "privacyValueAllowAll", "privacyValueAllowUsers", "privacyValueDisallowContacts", "privacyValueDisallowAll", "privacyValueDisallowUsers", "privacyValueAllowChatParticipants", "privacyValueDisallowChatParticipants", "privacyValueAllowCloseFriends", "privacyValueAllowPremium", "privacyValueAllowBots", "privacyValueDisallowBots"]],
|
|
1700
1709
|
["account.PrivacyRules", ["account.privacyRules"]],
|
|
1701
1710
|
["AccountDaysTTL", ["accountDaysTTL"]],
|
|
1702
1711
|
["DocumentAttribute", ["documentAttributeImageSize", "documentAttributeAnimated", "documentAttributeSticker", "documentAttributeVideo", "documentAttributeAudio", "documentAttributeFilename", "documentAttributeHasStickers", "documentAttributeCustomEmoji"]],
|
|
@@ -2182,6 +2191,9 @@ const enums = new Map([
|
|
|
2182
2191
|
["payments.UserStarGifts", ["payments.userStarGifts"]],
|
|
2183
2192
|
["MessageReportOption", ["messageReportOption"]],
|
|
2184
2193
|
["ReportResult", ["reportResultChooseOption", "reportResultAddComment", "reportResultReported"]],
|
|
2194
|
+
["messages.BotPreparedInlineMessage", ["messages.botPreparedInlineMessage"]],
|
|
2195
|
+
["messages.PreparedInlineMessage", ["messages.preparedInlineMessage"]],
|
|
2196
|
+
["BotAppSettings", ["botAppSettings"]],
|
|
2185
2197
|
]);
|
|
2186
2198
|
const types = new Map([
|
|
2187
2199
|
[
|
|
@@ -4106,7 +4118,7 @@ const types = new Map([
|
|
|
4106
4118
|
[
|
|
4107
4119
|
"messageActionPaymentSentMe",
|
|
4108
4120
|
[
|
|
4109
|
-
|
|
4121
|
+
0xFFA00CCC,
|
|
4110
4122
|
[
|
|
4111
4123
|
["flags", exports.flags, "#"],
|
|
4112
4124
|
["recurring_init", "true", "flags.2?true"],
|
|
@@ -4117,13 +4129,14 @@ const types = new Map([
|
|
|
4117
4129
|
["info", "PaymentRequestedInfo", "flags.0?PaymentRequestedInfo"],
|
|
4118
4130
|
["shipping_option_id", "string", "flags.1?string"],
|
|
4119
4131
|
["charge", "PaymentCharge", "PaymentCharge"],
|
|
4132
|
+
["subscription_until_date", "number", "flags.4?int"],
|
|
4120
4133
|
],
|
|
4121
4134
|
],
|
|
4122
4135
|
],
|
|
4123
4136
|
[
|
|
4124
4137
|
"messageActionPaymentSent",
|
|
4125
4138
|
[
|
|
4126
|
-
|
|
4139
|
+
0xC624B16E,
|
|
4127
4140
|
[
|
|
4128
4141
|
["flags", exports.flags, "#"],
|
|
4129
4142
|
["recurring_init", "true", "flags.2?true"],
|
|
@@ -4131,6 +4144,7 @@ const types = new Map([
|
|
|
4131
4144
|
["currency", "string", "string"],
|
|
4132
4145
|
["total_amount", "bigint", "long"],
|
|
4133
4146
|
["invoice_slug", "string", "flags.0?string"],
|
|
4147
|
+
["subscription_until_date", "number", "flags.4?int"],
|
|
4134
4148
|
],
|
|
4135
4149
|
],
|
|
4136
4150
|
],
|
|
@@ -4467,7 +4481,7 @@ const types = new Map([
|
|
|
4467
4481
|
[
|
|
4468
4482
|
"messageActionStarGift",
|
|
4469
4483
|
[
|
|
4470
|
-
|
|
4484
|
+
0x08557637,
|
|
4471
4485
|
[
|
|
4472
4486
|
["flags", exports.flags, "#"],
|
|
4473
4487
|
["name_hidden", "true", "flags.0?true"],
|
|
@@ -4475,7 +4489,7 @@ const types = new Map([
|
|
|
4475
4489
|
["converted", "true", "flags.3?true"],
|
|
4476
4490
|
["gift", "StarGift", "StarGift"],
|
|
4477
4491
|
["message", "TextWithEntities", "flags.1?TextWithEntities"],
|
|
4478
|
-
["convert_stars", "bigint", "long"],
|
|
4492
|
+
["convert_stars", "bigint", "flags.4?long"],
|
|
4479
4493
|
],
|
|
4480
4494
|
],
|
|
4481
4495
|
],
|
|
@@ -4911,6 +4925,7 @@ const types = new Map([
|
|
|
4911
4925
|
["flags2", exports.flags, "#"],
|
|
4912
4926
|
["sponsored_enabled", "true", "flags2.7?true"],
|
|
4913
4927
|
["can_view_revenue", "true", "flags2.9?true"],
|
|
4928
|
+
["bot_can_manage_emoji_status", "true", "flags2.10?true"],
|
|
4914
4929
|
["id", "bigint", "long"],
|
|
4915
4930
|
["about", "string", "flags.1?string"],
|
|
4916
4931
|
["settings", "PeerSettings", "PeerSettings"],
|
|
@@ -7667,6 +7682,13 @@ const types = new Map([
|
|
|
7667
7682
|
[],
|
|
7668
7683
|
],
|
|
7669
7684
|
],
|
|
7685
|
+
[
|
|
7686
|
+
"inputPrivacyKeyStarGiftsAutoSave",
|
|
7687
|
+
[
|
|
7688
|
+
0xE1732341,
|
|
7689
|
+
[],
|
|
7690
|
+
],
|
|
7691
|
+
],
|
|
7670
7692
|
[
|
|
7671
7693
|
"privacyKeyStatusTimestamp",
|
|
7672
7694
|
[
|
|
@@ -7744,6 +7766,13 @@ const types = new Map([
|
|
|
7744
7766
|
[],
|
|
7745
7767
|
],
|
|
7746
7768
|
],
|
|
7769
|
+
[
|
|
7770
|
+
"privacyKeyStarGiftsAutoSave",
|
|
7771
|
+
[
|
|
7772
|
+
0x2CA4FDF8,
|
|
7773
|
+
[],
|
|
7774
|
+
],
|
|
7775
|
+
],
|
|
7747
7776
|
[
|
|
7748
7777
|
"inputPrivacyValueAllowContacts",
|
|
7749
7778
|
[
|
|
@@ -7822,6 +7851,20 @@ const types = new Map([
|
|
|
7822
7851
|
[],
|
|
7823
7852
|
],
|
|
7824
7853
|
],
|
|
7854
|
+
[
|
|
7855
|
+
"inputPrivacyValueAllowBots",
|
|
7856
|
+
[
|
|
7857
|
+
0x5A4FCCE5,
|
|
7858
|
+
[],
|
|
7859
|
+
],
|
|
7860
|
+
],
|
|
7861
|
+
[
|
|
7862
|
+
"inputPrivacyValueDisallowBots",
|
|
7863
|
+
[
|
|
7864
|
+
0xC4E57915,
|
|
7865
|
+
[],
|
|
7866
|
+
],
|
|
7867
|
+
],
|
|
7825
7868
|
[
|
|
7826
7869
|
"privacyValueAllowContacts",
|
|
7827
7870
|
[
|
|
@@ -7900,6 +7943,20 @@ const types = new Map([
|
|
|
7900
7943
|
[],
|
|
7901
7944
|
],
|
|
7902
7945
|
],
|
|
7946
|
+
[
|
|
7947
|
+
"privacyValueAllowBots",
|
|
7948
|
+
[
|
|
7949
|
+
0x21461B5D,
|
|
7950
|
+
[],
|
|
7951
|
+
],
|
|
7952
|
+
],
|
|
7953
|
+
[
|
|
7954
|
+
"privacyValueDisallowBots",
|
|
7955
|
+
[
|
|
7956
|
+
0xF6A5F82F,
|
|
7957
|
+
[],
|
|
7958
|
+
],
|
|
7959
|
+
],
|
|
7903
7960
|
[
|
|
7904
7961
|
"account.privacyRules",
|
|
7905
7962
|
[
|
|
@@ -8447,7 +8504,7 @@ const types = new Map([
|
|
|
8447
8504
|
[
|
|
8448
8505
|
"botInfo",
|
|
8449
8506
|
[
|
|
8450
|
-
|
|
8507
|
+
0x36607333,
|
|
8451
8508
|
[
|
|
8452
8509
|
["flags", exports.flags, "#"],
|
|
8453
8510
|
["has_preview_medias", "true", "flags.6?true"],
|
|
@@ -8458,6 +8515,7 @@ const types = new Map([
|
|
|
8458
8515
|
["commands", ["BotCommand"], "flags.2?Vector<BotCommand>"],
|
|
8459
8516
|
["menu_button", "BotMenuButton", "flags.3?BotMenuButton"],
|
|
8460
8517
|
["privacy_policy_url", "string", "flags.7?string"],
|
|
8518
|
+
["app_settings", "BotAppSettings", "flags.8?BotAppSettings"],
|
|
8461
8519
|
],
|
|
8462
8520
|
],
|
|
8463
8521
|
],
|
|
@@ -10656,7 +10714,7 @@ const types = new Map([
|
|
|
10656
10714
|
[
|
|
10657
10715
|
"invoice",
|
|
10658
10716
|
[
|
|
10659
|
-
|
|
10717
|
+
0x049EE584,
|
|
10660
10718
|
[
|
|
10661
10719
|
["flags", exports.flags, "#"],
|
|
10662
10720
|
["test", "true", "flags.0?true"],
|
|
@@ -10673,6 +10731,7 @@ const types = new Map([
|
|
|
10673
10731
|
["max_tip_amount", "bigint", "flags.8?long"],
|
|
10674
10732
|
["suggested_tip_amounts", ["bigint"], "flags.8?Vector<long>"],
|
|
10675
10733
|
["terms_url", "string", "flags.10?string"],
|
|
10734
|
+
["subscription_period", "number", "flags.11?int"],
|
|
10676
10735
|
],
|
|
10677
10736
|
],
|
|
10678
10737
|
],
|
|
@@ -14585,6 +14644,7 @@ const types = new Map([
|
|
|
14585
14644
|
[
|
|
14586
14645
|
["flags", exports.flags, "#"],
|
|
14587
14646
|
["fullsize", "true", "flags.1?true"],
|
|
14647
|
+
["fullscreen", "true", "flags.2?true"],
|
|
14588
14648
|
["query_id", "bigint", "flags.0?long"],
|
|
14589
14649
|
["url", "string", "string"],
|
|
14590
14650
|
],
|
|
@@ -17452,17 +17512,21 @@ const types = new Map([
|
|
|
17452
17512
|
[
|
|
17453
17513
|
"starsSubscription",
|
|
17454
17514
|
[
|
|
17455
|
-
|
|
17515
|
+
0x2E6EAB1A,
|
|
17456
17516
|
[
|
|
17457
17517
|
["flags", exports.flags, "#"],
|
|
17458
17518
|
["canceled", "true", "flags.0?true"],
|
|
17459
17519
|
["can_refulfill", "true", "flags.1?true"],
|
|
17460
17520
|
["missing_balance", "true", "flags.2?true"],
|
|
17521
|
+
["bot_canceled", "true", "flags.7?true"],
|
|
17461
17522
|
["id", "string", "string"],
|
|
17462
17523
|
["peer", "Peer", "Peer"],
|
|
17463
17524
|
["until_date", "number", "int"],
|
|
17464
17525
|
["pricing", "StarsSubscriptionPricing", "StarsSubscriptionPricing"],
|
|
17465
17526
|
["chat_invite_hash", "string", "flags.3?string"],
|
|
17527
|
+
["title", "string", "flags.4?string"],
|
|
17528
|
+
["photo", "WebDocument", "flags.5?WebDocument"],
|
|
17529
|
+
["invoice_slug", "string", "flags.6?string"],
|
|
17466
17530
|
],
|
|
17467
17531
|
],
|
|
17468
17532
|
],
|
|
@@ -17517,6 +17581,7 @@ const types = new Map([
|
|
|
17517
17581
|
["flags", exports.flags, "#"],
|
|
17518
17582
|
["limited", "true", "flags.0?true"],
|
|
17519
17583
|
["sold_out", "true", "flags.1?true"],
|
|
17584
|
+
["birthday", "true", "flags.2?true"],
|
|
17520
17585
|
["id", "bigint", "long"],
|
|
17521
17586
|
["sticker", "Document", "Document"],
|
|
17522
17587
|
["stars", "bigint", "long"],
|
|
@@ -17613,6 +17678,43 @@ const types = new Map([
|
|
|
17613
17678
|
[],
|
|
17614
17679
|
],
|
|
17615
17680
|
],
|
|
17681
|
+
[
|
|
17682
|
+
"messages.botPreparedInlineMessage",
|
|
17683
|
+
[
|
|
17684
|
+
0x8ECF0511,
|
|
17685
|
+
[
|
|
17686
|
+
["id", "string", "string"],
|
|
17687
|
+
["expire_date", "number", "int"],
|
|
17688
|
+
],
|
|
17689
|
+
],
|
|
17690
|
+
],
|
|
17691
|
+
[
|
|
17692
|
+
"messages.preparedInlineMessage",
|
|
17693
|
+
[
|
|
17694
|
+
0xFF57708D,
|
|
17695
|
+
[
|
|
17696
|
+
["query_id", "bigint", "long"],
|
|
17697
|
+
["result", "BotInlineResult", "BotInlineResult"],
|
|
17698
|
+
["peer_types", ["InlineQueryPeerType"], "Vector<InlineQueryPeerType>"],
|
|
17699
|
+
["cache_time", "number", "int"],
|
|
17700
|
+
["users", ["User"], "Vector<User>"],
|
|
17701
|
+
],
|
|
17702
|
+
],
|
|
17703
|
+
],
|
|
17704
|
+
[
|
|
17705
|
+
"botAppSettings",
|
|
17706
|
+
[
|
|
17707
|
+
0xC99B1950,
|
|
17708
|
+
[
|
|
17709
|
+
["flags", exports.flags, "#"],
|
|
17710
|
+
["placeholder_path", Uint8Array, "flags.0?bytes"],
|
|
17711
|
+
["background_color", "number", "flags.1?int"],
|
|
17712
|
+
["background_dark_color", "number", "flags.2?int"],
|
|
17713
|
+
["header_color", "number", "flags.3?int"],
|
|
17714
|
+
["header_dark_color", "number", "flags.4?int"],
|
|
17715
|
+
],
|
|
17716
|
+
],
|
|
17717
|
+
],
|
|
17616
17718
|
[
|
|
17617
17719
|
"req_pq_multi",
|
|
17618
17720
|
[
|
|
@@ -21330,6 +21432,7 @@ const types = new Map([
|
|
|
21330
21432
|
["from_bot_menu", "true", "flags.4?true"],
|
|
21331
21433
|
["silent", "true", "flags.5?true"],
|
|
21332
21434
|
["compact", "true", "flags.7?true"],
|
|
21435
|
+
["fullscreen", "true", "flags.8?true"],
|
|
21333
21436
|
["peer", "InputPeer", "InputPeer"],
|
|
21334
21437
|
["bot", "InputUser", "InputUser"],
|
|
21335
21438
|
["url", "string", "flags.1?string"],
|
|
@@ -21365,6 +21468,7 @@ const types = new Map([
|
|
|
21365
21468
|
["from_switch_webview", "true", "flags.1?true"],
|
|
21366
21469
|
["from_side_menu", "true", "flags.2?true"],
|
|
21367
21470
|
["compact", "true", "flags.7?true"],
|
|
21471
|
+
["fullscreen", "true", "flags.8?true"],
|
|
21368
21472
|
["bot", "InputUser", "InputUser"],
|
|
21369
21473
|
["url", "string", "flags.3?string"],
|
|
21370
21474
|
["start_param", "string", "flags.4?string"],
|
|
@@ -21586,6 +21690,7 @@ const types = new Map([
|
|
|
21586
21690
|
["flags", exports.flags, "#"],
|
|
21587
21691
|
["write_allowed", "true", "flags.0?true"],
|
|
21588
21692
|
["compact", "true", "flags.7?true"],
|
|
21693
|
+
["fullscreen", "true", "flags.8?true"],
|
|
21589
21694
|
["peer", "InputPeer", "InputPeer"],
|
|
21590
21695
|
["app", "InputBotApp", "InputBotApp"],
|
|
21591
21696
|
["start_param", "string", "flags.1?string"],
|
|
@@ -21890,6 +21995,7 @@ const types = new Map([
|
|
|
21890
21995
|
[
|
|
21891
21996
|
["flags", exports.flags, "#"],
|
|
21892
21997
|
["compact", "true", "flags.7?true"],
|
|
21998
|
+
["fullscreen", "true", "flags.8?true"],
|
|
21893
21999
|
["peer", "InputPeer", "InputPeer"],
|
|
21894
22000
|
["bot", "InputUser", "InputUser"],
|
|
21895
22001
|
["start_param", "string", "flags.1?string"],
|
|
@@ -21973,6 +22079,28 @@ const types = new Map([
|
|
|
21973
22079
|
],
|
|
21974
22080
|
],
|
|
21975
22081
|
],
|
|
22082
|
+
[
|
|
22083
|
+
"messages.savePreparedInlineMessage",
|
|
22084
|
+
[
|
|
22085
|
+
0xF21F7F2F,
|
|
22086
|
+
[
|
|
22087
|
+
["flags", exports.flags, "#"],
|
|
22088
|
+
["result", "InputBotInlineResult", "InputBotInlineResult"],
|
|
22089
|
+
["user_id", "InputUser", "InputUser"],
|
|
22090
|
+
["peer_types", ["InlineQueryPeerType"], "flags.0?Vector<InlineQueryPeerType>"],
|
|
22091
|
+
],
|
|
22092
|
+
],
|
|
22093
|
+
],
|
|
22094
|
+
[
|
|
22095
|
+
"messages.getPreparedInlineMessage",
|
|
22096
|
+
[
|
|
22097
|
+
0x857EBDB8,
|
|
22098
|
+
[
|
|
22099
|
+
["bot", "InputUser", "InputUser"],
|
|
22100
|
+
["id", "string", "string"],
|
|
22101
|
+
],
|
|
22102
|
+
],
|
|
22103
|
+
],
|
|
21976
22104
|
[
|
|
21977
22105
|
"updates.getState",
|
|
21978
22106
|
[
|
|
@@ -23263,6 +23391,37 @@ const types = new Map([
|
|
|
23263
23391
|
],
|
|
23264
23392
|
],
|
|
23265
23393
|
],
|
|
23394
|
+
[
|
|
23395
|
+
"bots.updateUserEmojiStatus",
|
|
23396
|
+
[
|
|
23397
|
+
0xED9F30C5,
|
|
23398
|
+
[
|
|
23399
|
+
["user_id", "InputUser", "InputUser"],
|
|
23400
|
+
["emoji_status", "EmojiStatus", "EmojiStatus"],
|
|
23401
|
+
],
|
|
23402
|
+
],
|
|
23403
|
+
],
|
|
23404
|
+
[
|
|
23405
|
+
"bots.toggleUserEmojiStatusPermission",
|
|
23406
|
+
[
|
|
23407
|
+
0x06DE6392,
|
|
23408
|
+
[
|
|
23409
|
+
["bot", "InputUser", "InputUser"],
|
|
23410
|
+
["enabled", "boolean", "Bool"],
|
|
23411
|
+
],
|
|
23412
|
+
],
|
|
23413
|
+
],
|
|
23414
|
+
[
|
|
23415
|
+
"bots.checkDownloadFileParams",
|
|
23416
|
+
[
|
|
23417
|
+
0x50077589,
|
|
23418
|
+
[
|
|
23419
|
+
["bot", "InputUser", "InputUser"],
|
|
23420
|
+
["file_name", "string", "string"],
|
|
23421
|
+
["url", "string", "string"],
|
|
23422
|
+
],
|
|
23423
|
+
],
|
|
23424
|
+
],
|
|
23266
23425
|
[
|
|
23267
23426
|
"payments.getPaymentForm",
|
|
23268
23427
|
[
|
|
@@ -23611,6 +23770,18 @@ const types = new Map([
|
|
|
23611
23770
|
],
|
|
23612
23771
|
],
|
|
23613
23772
|
],
|
|
23773
|
+
[
|
|
23774
|
+
"payments.botCancelStarsSubscription",
|
|
23775
|
+
[
|
|
23776
|
+
0x6DFA0622,
|
|
23777
|
+
[
|
|
23778
|
+
["flags", exports.flags, "#"],
|
|
23779
|
+
["restore", "true", "flags.0?true"],
|
|
23780
|
+
["user_id", "InputUser", "InputUser"],
|
|
23781
|
+
["charge_id", "string", "string"],
|
|
23782
|
+
],
|
|
23783
|
+
],
|
|
23784
|
+
],
|
|
23614
23785
|
[
|
|
23615
23786
|
"stickers.createStickerSet",
|
|
23616
23787
|
[
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"0_obfuscation.d.ts","sourceRoot":"","sources":["../../src/transport/0_obfuscation.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAoB,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,wBAAsB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU;;;
|
|
1
|
+
{"version":3,"file":"0_obfuscation.d.ts","sourceRoot":"","sources":["../../src/transport/0_obfuscation.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAoB,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,wBAAsB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU;;;GA0CtF"}
|
|
@@ -66,13 +66,14 @@ async function getObfuscationParameters(protocol, connection) {
|
|
|
66
66
|
}
|
|
67
67
|
const encryptKey = init.slice(8, 8 + 32);
|
|
68
68
|
const encryptIv = init.slice(40, 40 + 16);
|
|
69
|
-
const
|
|
70
|
-
const
|
|
71
|
-
encryptionCTR.call(
|
|
69
|
+
const importedEncryptedKey = await _1_utilities_js_1.CTR.importKey(encryptKey);
|
|
70
|
+
const encryptionCTR = new _1_utilities_js_1.CTR(importedEncryptedKey, encryptIv);
|
|
71
|
+
const encryptedInit = await encryptionCTR.call(init);
|
|
72
72
|
const initRev = new Uint8Array(init).reverse();
|
|
73
73
|
const decryptKey = initRev.slice(8, 8 + 32);
|
|
74
74
|
const decryptIv = initRev.slice(40, 40 + 16);
|
|
75
|
-
const
|
|
75
|
+
const importedDecryptKey = await _1_utilities_js_1.CTR.importKey(decryptKey);
|
|
76
|
+
const decryptionCTR = new _1_utilities_js_1.CTR(importedDecryptKey, decryptIv);
|
|
76
77
|
await connection.write((0, _0_deps_js_1.concat)([init.subarray(0, 56), encryptedInit.subarray(56, 56 + 8)]));
|
|
77
78
|
return { encryptionCTR, decryptionCTR };
|
|
78
79
|
}
|
|
@@ -23,8 +23,8 @@ export declare abstract class Transport {
|
|
|
23
23
|
encryptionCTR: CTR;
|
|
24
24
|
decryptionCTR: CTR;
|
|
25
25
|
} | null;
|
|
26
|
-
protected encrypt(buffer: Uint8Array):
|
|
27
|
-
protected decrypt(buffer: Uint8Array):
|
|
26
|
+
protected encrypt(buffer: Uint8Array): Promise<Uint8Array>;
|
|
27
|
+
protected decrypt(buffer: Uint8Array): Promise<Uint8Array>;
|
|
28
28
|
abstract get initialized(): boolean;
|
|
29
29
|
abstract initialize(): MaybePromise<void>;
|
|
30
30
|
abstract receive(): MaybePromise<Uint8Array>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"0_transport.d.ts","sourceRoot":"","sources":["../../src/transport/0_transport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,8BAAsB,SAAS;IAC7B,SAAS,CAAC,qBAAqB,EAAE;QAAE,aAAa,EAAE,GAAG,CAAC;QAAC,aAAa,EAAE,GAAG,CAAA;KAAE,GAAG,IAAI,CAAQ;
|
|
1
|
+
{"version":3,"file":"0_transport.d.ts","sourceRoot":"","sources":["../../src/transport/0_transport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,8BAAsB,SAAS;IAC7B,SAAS,CAAC,qBAAqB,EAAE;QAAE,aAAa,EAAE,GAAG,CAAC;QAAC,aAAa,EAAE,GAAG,CAAA;KAAE,GAAG,IAAI,CAAQ;cAE1E,OAAO,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;cAQhD,OAAO,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IAQhE,QAAQ,KAAK,WAAW,IAAI,OAAO,CAAC;IACpC,QAAQ,CAAC,UAAU,IAAI,YAAY,CAAC,IAAI,CAAC;IACzC,QAAQ,CAAC,OAAO,IAAI,YAAY,CAAC,UAAU,CAAC;IAC5C,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,UAAU,GAAG,YAAY,CAAC,IAAI,CAAC;IACrD,YAAY,IAAI,YAAY,CAAC,IAAI,CAAC;CAKnC"}
|
|
@@ -29,20 +29,24 @@ class Transport {
|
|
|
29
29
|
value: null
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
encrypt(buffer) {
|
|
32
|
+
async encrypt(buffer) {
|
|
33
33
|
if (this.obfuscationParameters) {
|
|
34
|
-
this.obfuscationParameters.encryptionCTR.call(buffer);
|
|
34
|
+
return await this.obfuscationParameters.encryptionCTR.call(buffer);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
return buffer;
|
|
35
38
|
}
|
|
36
39
|
}
|
|
37
|
-
decrypt(buffer) {
|
|
40
|
+
async decrypt(buffer) {
|
|
38
41
|
if (this.obfuscationParameters) {
|
|
39
|
-
this.obfuscationParameters.decryptionCTR.call(buffer);
|
|
42
|
+
return await this.obfuscationParameters.decryptionCTR.call(buffer);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
return buffer;
|
|
40
46
|
}
|
|
41
47
|
}
|
|
42
48
|
deinitialize() {
|
|
43
49
|
if (this.obfuscationParameters) {
|
|
44
|
-
this.obfuscationParameters.encryptionCTR.destroy();
|
|
45
|
-
this.obfuscationParameters.decryptionCTR.destroy();
|
|
46
50
|
this.obfuscationParameters = null;
|
|
47
51
|
}
|
|
48
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"1_transport_abridged.d.ts","sourceRoot":"","sources":["../../src/transport/1_transport_abridged.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,qBAAa,iBAAkB,SAAQ,SAAU,YAAW,SAAS;;gBAKvD,UAAU,EAAE,UAAU,EAAE,UAAU,UAAQ;IAMhD,UAAU;IAWV,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"1_transport_abridged.d.ts","sourceRoot":"","sources":["../../src/transport/1_transport_abridged.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,qBAAa,iBAAkB,SAAQ,SAAU,YAAW,SAAS;;gBAKvD,UAAU,EAAE,UAAU,EAAE,UAAU,UAAQ;IAMhD,UAAU;IAWV,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC;IA0B9B,IAAI,CAAC,MAAM,EAAE,UAAU;IAcpB,YAAY;IAKrB,IAAI,WAAW,IAAI,OAAO,CAEzB;CACF"}
|
|
@@ -60,24 +60,23 @@ class TransportAbridged extends _0_transport_js_1.Transport {
|
|
|
60
60
|
async receive() {
|
|
61
61
|
let length;
|
|
62
62
|
{
|
|
63
|
-
|
|
63
|
+
let buffer = new Uint8Array(1);
|
|
64
64
|
await __classPrivateFieldGet(this, _TransportAbridged_connection, "f").read(buffer);
|
|
65
|
-
this.decrypt(buffer);
|
|
65
|
+
buffer = await this.decrypt(buffer);
|
|
66
66
|
if (buffer[0] < 0x7F) {
|
|
67
67
|
length = buffer[0];
|
|
68
68
|
}
|
|
69
69
|
else {
|
|
70
|
-
|
|
70
|
+
let buffer = new Uint8Array(3);
|
|
71
71
|
await __classPrivateFieldGet(this, _TransportAbridged_connection, "f").read(buffer);
|
|
72
|
-
this.decrypt(buffer);
|
|
72
|
+
buffer = await this.decrypt(buffer);
|
|
73
73
|
length = Number((0, _1_utilities_js_1.bigIntFromBuffer)(buffer, true, true));
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
length *= 4;
|
|
77
77
|
const buffer = new Uint8Array(length);
|
|
78
78
|
await __classPrivateFieldGet(this, _TransportAbridged_connection, "f").read(buffer);
|
|
79
|
-
this.decrypt(buffer);
|
|
80
|
-
return buffer;
|
|
79
|
+
return await this.decrypt(buffer);
|
|
81
80
|
}
|
|
82
81
|
async send(buffer) {
|
|
83
82
|
if (!this.initialized) {
|
|
@@ -87,8 +86,7 @@ class TransportAbridged extends _0_transport_js_1.Transport {
|
|
|
87
86
|
const header = new Uint8Array([bufferLength >= 0x7F ? 0x7F : bufferLength]);
|
|
88
87
|
const length = bufferLength >= 0x7F ? (0, _1_utilities_js_1.bufferFromBigInt)(bufferLength, 3) : new Uint8Array();
|
|
89
88
|
const data = (0, _0_deps_js_1.concat)([header, length, buffer]);
|
|
90
|
-
this.encrypt(data);
|
|
91
|
-
await __classPrivateFieldGet(this, _TransportAbridged_connection, "f").write(data);
|
|
89
|
+
await __classPrivateFieldGet(this, _TransportAbridged_connection, "f").write(await this.encrypt(data));
|
|
92
90
|
}
|
|
93
91
|
deinitialize() {
|
|
94
92
|
super.deinitialize();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"1_transport_intermediate.d.ts","sourceRoot":"","sources":["../../src/transport/1_transport_intermediate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,qBAAa,qBAAsB,SAAQ,SAAU,YAAW,SAAS;;gBAK3D,UAAU,EAAE,UAAU,EAAE,UAAU,UAAQ;IAMhD,UAAU;IAaV,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC;IAiB9B,IAAI,CAAC,MAAM,EAAE,UAAU;
|
|
1
|
+
{"version":3,"file":"1_transport_intermediate.d.ts","sourceRoot":"","sources":["../../src/transport/1_transport_intermediate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,qBAAa,qBAAsB,SAAQ,SAAU,YAAW,SAAS;;gBAK3D,UAAU,EAAE,UAAU,EAAE,UAAU,UAAQ;IAMhD,UAAU;IAaV,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC;IAiB9B,IAAI,CAAC,MAAM,EAAE,UAAU;IAWpB,YAAY;IAKrB,IAAI,WAAW,IAAI,OAAO,CAEzB;CACF"}
|
|
@@ -62,16 +62,15 @@ class TransportIntermediate extends _0_transport_js_1.Transport {
|
|
|
62
62
|
async receive() {
|
|
63
63
|
let length;
|
|
64
64
|
{
|
|
65
|
-
|
|
65
|
+
let buffer = new Uint8Array(4);
|
|
66
66
|
await __classPrivateFieldGet(this, _TransportIntermediate_connection, "f").read(buffer);
|
|
67
|
-
this.decrypt(buffer);
|
|
67
|
+
buffer = await this.decrypt(buffer);
|
|
68
68
|
const dataView = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength);
|
|
69
69
|
length = dataView.getUint32(0, true);
|
|
70
70
|
}
|
|
71
71
|
const buffer = new Uint8Array(length);
|
|
72
72
|
await __classPrivateFieldGet(this, _TransportIntermediate_connection, "f").read(buffer);
|
|
73
|
-
this.decrypt(buffer);
|
|
74
|
-
return buffer;
|
|
73
|
+
return await this.decrypt(buffer);
|
|
75
74
|
}
|
|
76
75
|
async send(buffer) {
|
|
77
76
|
if (!this.initialized) {
|
|
@@ -79,8 +78,7 @@ class TransportIntermediate extends _0_transport_js_1.Transport {
|
|
|
79
78
|
}
|
|
80
79
|
const length = (0, _1_utilities_js_1.bufferFromBigInt)(buffer.length, 4);
|
|
81
80
|
const data = (0, _0_deps_js_1.concat)([length, buffer]);
|
|
82
|
-
this.encrypt(data);
|
|
83
|
-
await __classPrivateFieldGet(this, _TransportIntermediate_connection, "f").write(data);
|
|
81
|
+
await __classPrivateFieldGet(this, _TransportIntermediate_connection, "f").write(await this.encrypt(data));
|
|
84
82
|
}
|
|
85
83
|
deinitialize() {
|
|
86
84
|
super.deinitialize();
|
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2024 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
1
20
|
export interface SwitchInlineQueryChosenChats {
|
|
2
21
|
/** The query to type into the user's message box once switched to inline. */
|
|
3
22
|
query: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"0_switch_inline_query_chosen_chats.d.ts","sourceRoot":"","sources":["../../src/types/0_switch_inline_query_chosen_chats.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,4BAA4B;IAC3C,6EAA6E;IAC7E,KAAK,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kEAAkE;IAClE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,8DAA8D;IAC9D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,2DAA2D;IAC3D,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB"}
|
|
1
|
+
{"version":3,"file":"0_switch_inline_query_chosen_chats.d.ts","sourceRoot":"","sources":["../../src/types/0_switch_inline_query_chosen_chats.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,WAAW,4BAA4B;IAC3C,6EAA6E;IAC7E,KAAK,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,kEAAkE;IAClE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,8DAA8D;IAC9D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,2DAA2D;IAC3D,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB"}
|