@mtcute/core 0.27.1 → 0.27.3
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/client.cjs +92 -68
- package/client.js +93 -69
- package/highlevel/base.cjs +4 -0
- package/highlevel/base.d.cts +1 -0
- package/highlevel/base.d.ts +1 -0
- package/highlevel/base.js +4 -0
- package/highlevel/client.d.cts +497 -412
- package/highlevel/client.d.ts +497 -412
- package/highlevel/client.test.d.cts +1 -0
- package/highlevel/client.test.d.ts +1 -0
- package/highlevel/methods/contacts/set-contact-note.cjs +21 -0
- package/highlevel/methods/contacts/set-contact-note.js +16 -0
- package/highlevel/methods/files/download-chunk.cjs +63 -0
- package/highlevel/methods/files/download-chunk.d.cts +29 -0
- package/highlevel/methods/files/download-chunk.d.ts +29 -0
- package/highlevel/methods/files/download-chunk.js +58 -0
- package/highlevel/methods/files/download-chunk.test.d.cts +1 -0
- package/highlevel/methods/files/download-chunk.test.d.ts +1 -0
- package/highlevel/methods/files/download-iterable.cjs +39 -23
- package/highlevel/methods/files/download-iterable.d.cts +6 -0
- package/highlevel/methods/files/download-iterable.d.ts +6 -0
- package/highlevel/methods/files/download-iterable.js +33 -17
- package/highlevel/methods/forums/reorder-pinned-forum-topics.cjs +2 -2
- package/highlevel/methods/forums/reorder-pinned-forum-topics.js +3 -3
- package/highlevel/methods/forums/toggle-forum-topic-closed.cjs +2 -2
- package/highlevel/methods/forums/toggle-forum-topic-closed.js +3 -3
- package/highlevel/methods/forums/toggle-forum-topic-pinned.cjs +2 -2
- package/highlevel/methods/forums/toggle-forum-topic-pinned.js +3 -3
- package/highlevel/methods/gifts/get-star-gift-upgrade-options.cjs +30 -0
- package/highlevel/methods/gifts/get-star-gift-upgrade-options.d.cts +12 -0
- package/highlevel/methods/gifts/get-star-gift-upgrade-options.d.ts +12 -0
- package/highlevel/methods/gifts/get-star-gift-upgrade-options.js +25 -0
- package/highlevel/methods/gifts/resolve-star-gift-offer.cjs +17 -0
- package/highlevel/methods/gifts/resolve-star-gift-offer.d.cts +18 -0
- package/highlevel/methods/gifts/resolve-star-gift-offer.d.ts +18 -0
- package/highlevel/methods/gifts/resolve-star-gift-offer.js +12 -0
- package/highlevel/methods/gifts/send-star-gift-offer.cjs +26 -0
- package/highlevel/methods/gifts/send-star-gift-offer.d.cts +26 -0
- package/highlevel/methods/gifts/send-star-gift-offer.d.ts +26 -0
- package/highlevel/methods/gifts/send-star-gift-offer.js +21 -0
- package/highlevel/methods/{premium → gifts}/set-gift-resale-price.cjs +2 -5
- package/highlevel/methods/{premium → gifts}/set-gift-resale-price.d.cts +2 -2
- package/highlevel/methods/{premium → gifts}/set-gift-resale-price.d.ts +2 -2
- package/highlevel/methods/{premium → gifts}/set-gift-resale-price.js +2 -5
- package/highlevel/methods/premium/_normalize-stars-amount.cjs +18 -0
- package/highlevel/methods/premium/_normalize-stars-amount.d.cts +12 -0
- package/highlevel/methods/premium/_normalize-stars-amount.d.ts +12 -0
- package/highlevel/methods/premium/_normalize-stars-amount.js +13 -0
- package/highlevel/methods.d.cts +26 -18
- package/highlevel/methods.d.ts +26 -18
- package/highlevel/types/messages/message-action.cjs +27 -4
- package/highlevel/types/messages/message-action.d.cts +28 -1
- package/highlevel/types/messages/message-action.d.ts +28 -1
- package/highlevel/types/messages/message-action.js +27 -4
- package/highlevel/types/premium/saved-star-gift.cjs +4 -0
- package/highlevel/types/premium/saved-star-gift.d.cts +2 -0
- package/highlevel/types/premium/saved-star-gift.d.ts +2 -0
- package/highlevel/types/premium/saved-star-gift.js +4 -0
- package/highlevel/types/premium/star-gift-unique.cjs +8 -0
- package/highlevel/types/premium/star-gift-unique.d.cts +4 -0
- package/highlevel/types/premium/star-gift-unique.d.ts +4 -0
- package/highlevel/types/premium/star-gift-unique.js +8 -0
- package/highlevel/types/premium/star-gift.cjs +17 -4
- package/highlevel/types/premium/star-gift.d.cts +8 -1
- package/highlevel/types/premium/star-gift.d.ts +8 -1
- package/highlevel/types/premium/star-gift.js +17 -4
- package/highlevel/types/premium/stars-transaction.cjs +6 -0
- package/highlevel/types/premium/stars-transaction.d.cts +6 -0
- package/highlevel/types/premium/stars-transaction.d.ts +6 -0
- package/highlevel/types/premium/stars-transaction.js +6 -0
- package/highlevel/updates/manager.cjs +7 -0
- package/highlevel/updates/manager.js +7 -0
- package/methods.cjs +45 -34
- package/methods.js +29 -18
- package/network/middlewares/internal-errors.cjs +5 -0
- package/network/middlewares/internal-errors.js +5 -0
- package/network/network-manager.cjs +1 -1
- package/network/network-manager.js +1 -1
- package/package.json +2 -2
- package/utils/binary/compat.cjs +12 -0
- package/utils/binary/compat.js +12 -0
- /package/highlevel/methods/{premium → gifts}/_normalize-input-star-gift.cjs +0 -0
- /package/highlevel/methods/{premium → gifts}/_normalize-input-star-gift.d.cts +0 -0
- /package/highlevel/methods/{premium → gifts}/_normalize-input-star-gift.d.ts +0 -0
- /package/highlevel/methods/{premium → gifts}/_normalize-input-star-gift.js +0 -0
- /package/highlevel/methods/{premium → gifts}/accept-star-gift.cjs +0 -0
- /package/highlevel/methods/{premium → gifts}/accept-star-gift.d.cts +0 -0
- /package/highlevel/methods/{premium → gifts}/accept-star-gift.d.ts +0 -0
- /package/highlevel/methods/{premium → gifts}/accept-star-gift.js +0 -0
- /package/highlevel/methods/{premium → gifts}/buy-resale-gift.cjs +0 -0
- /package/highlevel/methods/{premium → gifts}/buy-resale-gift.d.cts +0 -0
- /package/highlevel/methods/{premium → gifts}/buy-resale-gift.d.ts +0 -0
- /package/highlevel/methods/{premium → gifts}/buy-resale-gift.js +0 -0
- /package/highlevel/methods/{premium → gifts}/get-resale-star-gifts.cjs +0 -0
- /package/highlevel/methods/{premium → gifts}/get-resale-star-gifts.d.cts +0 -0
- /package/highlevel/methods/{premium → gifts}/get-resale-star-gifts.d.ts +0 -0
- /package/highlevel/methods/{premium → gifts}/get-resale-star-gifts.js +0 -0
- /package/highlevel/methods/{premium → gifts}/get-saved-star-gifts-by-id.cjs +0 -0
- /package/highlevel/methods/{premium → gifts}/get-saved-star-gifts-by-id.d.cts +0 -0
- /package/highlevel/methods/{premium → gifts}/get-saved-star-gifts-by-id.d.ts +0 -0
- /package/highlevel/methods/{premium → gifts}/get-saved-star-gifts-by-id.js +0 -0
- /package/highlevel/methods/{premium → gifts}/get-saved-star-gifts.cjs +0 -0
- /package/highlevel/methods/{premium → gifts}/get-saved-star-gifts.d.cts +0 -0
- /package/highlevel/methods/{premium → gifts}/get-saved-star-gifts.d.ts +0 -0
- /package/highlevel/methods/{premium → gifts}/get-saved-star-gifts.js +0 -0
- /package/highlevel/methods/{premium → gifts}/get-star-gift-options.cjs +0 -0
- /package/highlevel/methods/{premium → gifts}/get-star-gift-options.d.cts +0 -0
- /package/highlevel/methods/{premium → gifts}/get-star-gift-options.d.ts +0 -0
- /package/highlevel/methods/{premium → gifts}/get-star-gift-options.js +0 -0
- /package/highlevel/methods/{premium → gifts}/get-star-gift-value.cjs +0 -0
- /package/highlevel/methods/{premium → gifts}/get-star-gift-value.d.cts +0 -0
- /package/highlevel/methods/{premium → gifts}/get-star-gift-value.d.ts +0 -0
- /package/highlevel/methods/{premium → gifts}/get-star-gift-value.js +0 -0
- /package/highlevel/methods/{premium → gifts}/get-star-gift-withdrawal-url.cjs +0 -0
- /package/highlevel/methods/{premium → gifts}/get-star-gift-withdrawal-url.d.cts +0 -0
- /package/highlevel/methods/{premium → gifts}/get-star-gift-withdrawal-url.d.ts +0 -0
- /package/highlevel/methods/{premium → gifts}/get-star-gift-withdrawal-url.js +0 -0
- /package/highlevel/methods/{premium → gifts}/get-unique-star-gift.cjs +0 -0
- /package/highlevel/methods/{premium → gifts}/get-unique-star-gift.d.cts +0 -0
- /package/highlevel/methods/{premium → gifts}/get-unique-star-gift.d.ts +0 -0
- /package/highlevel/methods/{premium → gifts}/get-unique-star-gift.js +0 -0
- /package/highlevel/methods/{premium → gifts}/iter-saved-star-gifts.cjs +0 -0
- /package/highlevel/methods/{premium → gifts}/iter-saved-star-gifts.d.cts +0 -0
- /package/highlevel/methods/{premium → gifts}/iter-saved-star-gifts.d.ts +0 -0
- /package/highlevel/methods/{premium → gifts}/iter-saved-star-gifts.js +0 -0
- /package/highlevel/methods/{premium → gifts}/pin-star-gift.cjs +0 -0
- /package/highlevel/methods/{premium → gifts}/pin-star-gift.d.cts +0 -0
- /package/highlevel/methods/{premium → gifts}/pin-star-gift.d.ts +0 -0
- /package/highlevel/methods/{premium → gifts}/pin-star-gift.js +0 -0
- /package/highlevel/methods/{premium → gifts}/prepay-star-gift-upgrade.cjs +0 -0
- /package/highlevel/methods/{premium → gifts}/prepay-star-gift-upgrade.d.cts +0 -0
- /package/highlevel/methods/{premium → gifts}/prepay-star-gift-upgrade.d.ts +0 -0
- /package/highlevel/methods/{premium → gifts}/prepay-star-gift-upgrade.js +0 -0
- /package/highlevel/methods/{premium → gifts}/send-star-gift.cjs +0 -0
- /package/highlevel/methods/{premium → gifts}/send-star-gift.d.cts +0 -0
- /package/highlevel/methods/{premium → gifts}/send-star-gift.d.ts +0 -0
- /package/highlevel/methods/{premium → gifts}/send-star-gift.js +0 -0
- /package/highlevel/methods/{premium → gifts}/transfer-star-gift.cjs +0 -0
- /package/highlevel/methods/{premium → gifts}/transfer-star-gift.d.cts +0 -0
- /package/highlevel/methods/{premium → gifts}/transfer-star-gift.d.ts +0 -0
- /package/highlevel/methods/{premium → gifts}/transfer-star-gift.js +0 -0
- /package/highlevel/methods/{premium → gifts}/upgrade-star-gift.cjs +0 -0
- /package/highlevel/methods/{premium → gifts}/upgrade-star-gift.d.cts +0 -0
- /package/highlevel/methods/{premium → gifts}/upgrade-star-gift.d.ts +0 -0
- /package/highlevel/methods/{premium → gifts}/upgrade-star-gift.js +0 -0
package/methods.js
CHANGED
|
@@ -80,6 +80,7 @@ import { addContact } from "./highlevel/methods/contacts/add-contact.js";
|
|
|
80
80
|
import { deleteContacts } from "./highlevel/methods/contacts/delete-contacts.js";
|
|
81
81
|
import { getContacts } from "./highlevel/methods/contacts/get-contacts.js";
|
|
82
82
|
import { importContacts } from "./highlevel/methods/contacts/import-contacts.js";
|
|
83
|
+
import { setContactNote } from "./highlevel/methods/contacts/set-contact-note.js";
|
|
83
84
|
import { createFolder } from "./highlevel/methods/dialogs/create-folder.js";
|
|
84
85
|
import { deleteFolder } from "./highlevel/methods/dialogs/delete-folder.js";
|
|
85
86
|
import { editFolder } from "./highlevel/methods/dialogs/edit-folder.js";
|
|
@@ -92,7 +93,8 @@ import { iterDialogs } from "./highlevel/methods/dialogs/iter-dialogs.js";
|
|
|
92
93
|
import { joinChatlist } from "./highlevel/methods/dialogs/join-chatlist.js";
|
|
93
94
|
import { setFoldersOrder } from "./highlevel/methods/dialogs/set-folders-order.js";
|
|
94
95
|
import { downloadAsBuffer } from "./highlevel/methods/files/download-buffer.js";
|
|
95
|
-
import {
|
|
96
|
+
import { downloadChunk } from "./highlevel/methods/files/download-chunk.js";
|
|
97
|
+
import { _normalizeFileDownloadLocation, downloadAsIterable } from "./highlevel/methods/files/download-iterable.js";
|
|
96
98
|
import { downloadAsStream } from "./highlevel/methods/files/download-stream.js";
|
|
97
99
|
import { _normalizeInputFile } from "./highlevel/methods/files/normalize-input-file.js";
|
|
98
100
|
import { _normalizeInputMedia } from "./highlevel/methods/files/normalize-input-media.js";
|
|
@@ -109,6 +111,26 @@ import { toggleForumTopicClosed } from "./highlevel/methods/forums/toggle-forum-
|
|
|
109
111
|
import { toggleForumTopicPinned } from "./highlevel/methods/forums/toggle-forum-topic-pinned.js";
|
|
110
112
|
import { updateForumSettings } from "./highlevel/methods/forums/toggle-forum.js";
|
|
111
113
|
import { toggleGeneralTopicHidden } from "./highlevel/methods/forums/toggle-general-topic-hidden.js";
|
|
114
|
+
import { _normalizeInputStarGift } from "./highlevel/methods/gifts/_normalize-input-star-gift.js";
|
|
115
|
+
import { acceptStarGift } from "./highlevel/methods/gifts/accept-star-gift.js";
|
|
116
|
+
import { buyResaleGift } from "./highlevel/methods/gifts/buy-resale-gift.js";
|
|
117
|
+
import { getStarGiftResaleOptions } from "./highlevel/methods/gifts/get-resale-star-gifts.js";
|
|
118
|
+
import { getSavedStarGiftsById } from "./highlevel/methods/gifts/get-saved-star-gifts-by-id.js";
|
|
119
|
+
import { getSavedStarGifts } from "./highlevel/methods/gifts/get-saved-star-gifts.js";
|
|
120
|
+
import { getStarGiftOptions } from "./highlevel/methods/gifts/get-star-gift-options.js";
|
|
121
|
+
import { getStarGiftUpgradeOptions } from "./highlevel/methods/gifts/get-star-gift-upgrade-options.js";
|
|
122
|
+
import { getStarGiftValue } from "./highlevel/methods/gifts/get-star-gift-value.js";
|
|
123
|
+
import { getStarGiftWithdrawalUrl } from "./highlevel/methods/gifts/get-star-gift-withdrawal-url.js";
|
|
124
|
+
import { getUniqueStarGift } from "./highlevel/methods/gifts/get-unique-star-gift.js";
|
|
125
|
+
import { iterSavedStarGifts } from "./highlevel/methods/gifts/iter-saved-star-gifts.js";
|
|
126
|
+
import { togglePinnedStarGifts } from "./highlevel/methods/gifts/pin-star-gift.js";
|
|
127
|
+
import { prepayStarGiftUpgrade } from "./highlevel/methods/gifts/prepay-star-gift-upgrade.js";
|
|
128
|
+
import { resolveStarGiftOffer } from "./highlevel/methods/gifts/resolve-star-gift-offer.js";
|
|
129
|
+
import { sendStarGiftOffer } from "./highlevel/methods/gifts/send-star-gift-offer.js";
|
|
130
|
+
import { sendStarGift } from "./highlevel/methods/gifts/send-star-gift.js";
|
|
131
|
+
import { setResaleStarGiftPrice } from "./highlevel/methods/gifts/set-gift-resale-price.js";
|
|
132
|
+
import { transferStarGift } from "./highlevel/methods/gifts/transfer-star-gift.js";
|
|
133
|
+
import { upgradeStarGift } from "./highlevel/methods/gifts/upgrade-star-gift.js";
|
|
112
134
|
import { createInviteLink } from "./highlevel/methods/invite-links/create-invite-link.js";
|
|
113
135
|
import { editInviteLink } from "./highlevel/methods/invite-links/edit-invite-link.js";
|
|
114
136
|
import { exportInviteLink } from "./highlevel/methods/invite-links/export-invite-link.js";
|
|
@@ -181,10 +203,7 @@ import { changeCloudPassword } from "./highlevel/methods/password/change-cloud-p
|
|
|
181
203
|
import { enableCloudPassword } from "./highlevel/methods/password/enable-cloud-password.js";
|
|
182
204
|
import { cancelPasswordEmail, resendPasswordEmail, verifyPasswordEmail } from "./highlevel/methods/password/password-email.js";
|
|
183
205
|
import { removeCloudPassword } from "./highlevel/methods/password/remove-cloud-password.js";
|
|
184
|
-
import { _normalizeInputStarGift } from "./highlevel/methods/premium/_normalize-input-star-gift.js";
|
|
185
|
-
import { acceptStarGift } from "./highlevel/methods/premium/accept-star-gift.js";
|
|
186
206
|
import { applyBoost } from "./highlevel/methods/premium/apply-boost.js";
|
|
187
|
-
import { buyResaleGift } from "./highlevel/methods/premium/buy-resale-gift.js";
|
|
188
207
|
import { canApplyBoost } from "./highlevel/methods/premium/can-apply-boost.js";
|
|
189
208
|
import { createBusinessChatLink } from "./highlevel/methods/premium/create-business-chat-link.js";
|
|
190
209
|
import { deleteBusinessChatLink, editBusinessChatLink } from "./highlevel/methods/premium/edit-business-chat-link.js";
|
|
@@ -193,25 +212,11 @@ import { getBoosts } from "./highlevel/methods/premium/get-boosts.js";
|
|
|
193
212
|
import { getBusinessChatLinks } from "./highlevel/methods/premium/get-business-chat-links.js";
|
|
194
213
|
import { getBusinessConnection } from "./highlevel/methods/premium/get-business-connection.js";
|
|
195
214
|
import { getMyBoostSlots } from "./highlevel/methods/premium/get-my-boost-slots.js";
|
|
196
|
-
import { getStarGiftResaleOptions } from "./highlevel/methods/premium/get-resale-star-gifts.js";
|
|
197
|
-
import { getSavedStarGiftsById } from "./highlevel/methods/premium/get-saved-star-gifts-by-id.js";
|
|
198
|
-
import { getSavedStarGifts } from "./highlevel/methods/premium/get-saved-star-gifts.js";
|
|
199
|
-
import { getStarGiftOptions } from "./highlevel/methods/premium/get-star-gift-options.js";
|
|
200
|
-
import { getStarGiftValue } from "./highlevel/methods/premium/get-star-gift-value.js";
|
|
201
|
-
import { getStarGiftWithdrawalUrl } from "./highlevel/methods/premium/get-star-gift-withdrawal-url.js";
|
|
202
215
|
import { getStarsTransactions } from "./highlevel/methods/premium/get-stars-transactions.js";
|
|
203
|
-
import { getUniqueStarGift } from "./highlevel/methods/premium/get-unique-star-gift.js";
|
|
204
216
|
import { iterBoosters } from "./highlevel/methods/premium/iter-boosters.js";
|
|
205
|
-
import { iterSavedStarGifts } from "./highlevel/methods/premium/iter-saved-star-gifts.js";
|
|
206
217
|
import { iterStarsTransactions } from "./highlevel/methods/premium/iter-stars-transactions.js";
|
|
207
|
-
import { togglePinnedStarGifts } from "./highlevel/methods/premium/pin-star-gift.js";
|
|
208
|
-
import { prepayStarGiftUpgrade } from "./highlevel/methods/premium/prepay-star-gift-upgrade.js";
|
|
209
|
-
import { sendStarGift } from "./highlevel/methods/premium/send-star-gift.js";
|
|
210
218
|
import { setBusinessIntro } from "./highlevel/methods/premium/set-business-intro.js";
|
|
211
219
|
import { setBusinessWorkHours } from "./highlevel/methods/premium/set-business-work-hours.js";
|
|
212
|
-
import { setResaleStarGiftPrice } from "./highlevel/methods/premium/set-gift-resale-price.js";
|
|
213
|
-
import { transferStarGift } from "./highlevel/methods/premium/transfer-star-gift.js";
|
|
214
|
-
import { upgradeStarGift } from "./highlevel/methods/premium/upgrade-star-gift.js";
|
|
215
220
|
import { addStickerToSet } from "./highlevel/methods/stickers/add-sticker-to-set.js";
|
|
216
221
|
import { createStickerSet } from "./highlevel/methods/stickers/create-sticker-set.js";
|
|
217
222
|
import { deleteStickerFromSet } from "./highlevel/methods/stickers/delete-sticker-from-set.js";
|
|
@@ -270,6 +275,7 @@ import { sendOnline, setOnline } from "./highlevel/methods/users/set-online.js";
|
|
|
270
275
|
import { unblockUser } from "./highlevel/methods/users/unblock-user.js";
|
|
271
276
|
import { updateProfile } from "./highlevel/methods/users/update-profile.js";
|
|
272
277
|
export {
|
|
278
|
+
_normalizeFileDownloadLocation,
|
|
273
279
|
_normalizeInputFile,
|
|
274
280
|
_normalizeInputMedia,
|
|
275
281
|
_normalizeInputStarGift,
|
|
@@ -328,6 +334,7 @@ export {
|
|
|
328
334
|
downloadAsBuffer,
|
|
329
335
|
downloadAsIterable,
|
|
330
336
|
downloadAsStream,
|
|
337
|
+
downloadChunk,
|
|
331
338
|
editAdminRights,
|
|
332
339
|
editBusinessChatLink,
|
|
333
340
|
editCloseFriends,
|
|
@@ -412,6 +419,7 @@ export {
|
|
|
412
419
|
getSimilarChannels,
|
|
413
420
|
getStarGiftOptions,
|
|
414
421
|
getStarGiftResaleOptions,
|
|
422
|
+
getStarGiftUpgradeOptions,
|
|
415
423
|
getStarGiftValue,
|
|
416
424
|
getStarGiftWithdrawalUrl,
|
|
417
425
|
getStarsTransactions,
|
|
@@ -482,6 +490,7 @@ export {
|
|
|
482
490
|
resolvePeer,
|
|
483
491
|
resolvePeerMany,
|
|
484
492
|
resolvePhoneNumber,
|
|
493
|
+
resolveStarGiftOffer,
|
|
485
494
|
resolveUser,
|
|
486
495
|
restrictChatMember,
|
|
487
496
|
revokeInviteLink,
|
|
@@ -502,6 +511,7 @@ export {
|
|
|
502
511
|
sendRecoveryCode,
|
|
503
512
|
sendScheduled,
|
|
504
513
|
sendStarGift,
|
|
514
|
+
sendStarGiftOffer,
|
|
505
515
|
sendStory,
|
|
506
516
|
sendStoryReaction,
|
|
507
517
|
sendText,
|
|
@@ -519,6 +529,7 @@ export {
|
|
|
519
529
|
setChatTitle,
|
|
520
530
|
setChatTtl,
|
|
521
531
|
setChatUsername,
|
|
532
|
+
setContactNote,
|
|
522
533
|
setEmojiStatus,
|
|
523
534
|
setFoldersOrder,
|
|
524
535
|
setGameScore,
|
|
@@ -19,6 +19,10 @@ const CLIENT_ERRORS = /* @__PURE__ */ new Set([
|
|
|
19
19
|
tl.tl.RpcError.SEE_OTHER,
|
|
20
20
|
tl.tl.RpcError.NOT_ACCEPTABLE
|
|
21
21
|
]);
|
|
22
|
+
const PTS_ERRORS = /* @__PURE__ */ new Set([
|
|
23
|
+
"PERSISTENT_TIMESTAMP_INVALID",
|
|
24
|
+
"PERSISTENT_TIMESTAMP_OUTDATED"
|
|
25
|
+
]);
|
|
22
26
|
function internalErrorsHandler(params) {
|
|
23
27
|
const { maxRetries = Infinity, waitTime = 1, exceptErrors } = params;
|
|
24
28
|
const exceptErrorsSet = exceptErrors ? new Set(exceptErrors) : void 0;
|
|
@@ -29,6 +33,7 @@ function internalErrorsHandler(params) {
|
|
|
29
33
|
const res = await next(ctx);
|
|
30
34
|
if (!typeAssertions.isTlRpcError(res)) return res;
|
|
31
35
|
if (!CLIENT_ERRORS.has(res.errorCode)) {
|
|
36
|
+
if (PTS_ERRORS.has(res.errorMessage)) return res;
|
|
32
37
|
if (exceptErrorsSet?.has(res.errorMessage)) return res;
|
|
33
38
|
lastError = res;
|
|
34
39
|
if (ctx.params?.throw503 && res.errorCode === -503) {
|
|
@@ -12,6 +12,10 @@ const CLIENT_ERRORS = /* @__PURE__ */ new Set([
|
|
|
12
12
|
tl.RpcError.SEE_OTHER,
|
|
13
13
|
tl.RpcError.NOT_ACCEPTABLE
|
|
14
14
|
]);
|
|
15
|
+
const PTS_ERRORS = /* @__PURE__ */ new Set([
|
|
16
|
+
"PERSISTENT_TIMESTAMP_INVALID",
|
|
17
|
+
"PERSISTENT_TIMESTAMP_OUTDATED"
|
|
18
|
+
]);
|
|
15
19
|
function internalErrorsHandler(params) {
|
|
16
20
|
const { maxRetries = Infinity, waitTime = 1, exceptErrors } = params;
|
|
17
21
|
const exceptErrorsSet = exceptErrors ? new Set(exceptErrors) : void 0;
|
|
@@ -22,6 +26,7 @@ function internalErrorsHandler(params) {
|
|
|
22
26
|
const res = await next(ctx);
|
|
23
27
|
if (!isTlRpcError(res)) return res;
|
|
24
28
|
if (!CLIENT_ERRORS.has(res.errorCode)) {
|
|
29
|
+
if (PTS_ERRORS.has(res.errorMessage)) return res;
|
|
25
30
|
if (exceptErrorsSet?.has(res.errorMessage)) return res;
|
|
26
31
|
lastError = res;
|
|
27
32
|
if (ctx.params?.throw503 && res.errorCode === -503) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mtcute/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.27.
|
|
4
|
+
"version": "0.27.3",
|
|
5
5
|
"description": "Type-safe library for MTProto (Telegram API)",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"scripts": {},
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"@fuman/net": "0.0.17",
|
|
11
11
|
"@fuman/utils": "0.0.17",
|
|
12
12
|
"@mtcute/file-id": "^0.27.0",
|
|
13
|
-
"@mtcute/tl": "^
|
|
13
|
+
"@mtcute/tl": "^220.0.0",
|
|
14
14
|
"@mtcute/tl-runtime": "^0.24.3",
|
|
15
15
|
"@types/events": "3.0.0",
|
|
16
16
|
"long": "5.2.3"
|
package/utils/binary/compat.cjs
CHANGED
|
@@ -57,12 +57,14 @@ function mapCompatStarGift(obj) {
|
|
|
57
57
|
giftId: Long.ZERO
|
|
58
58
|
};
|
|
59
59
|
case "starGiftUnique_layer214":
|
|
60
|
+
case "starGiftUnique_layer218":
|
|
60
61
|
return replaceType(obj, "starGiftUnique");
|
|
61
62
|
case "starGift_layer202":
|
|
62
63
|
case "starGift_layer206":
|
|
63
64
|
case "starGift_layer209":
|
|
64
65
|
case "starGift_layer211":
|
|
65
66
|
case "starGift_layer216":
|
|
67
|
+
case "starGift_layer218":
|
|
66
68
|
return replaceType(obj, "starGift");
|
|
67
69
|
default:
|
|
68
70
|
return obj;
|
|
@@ -118,6 +120,7 @@ function mapCompatMessageAction(obj) {
|
|
|
118
120
|
case "messageActionStarGift_layer197":
|
|
119
121
|
case "messageActionStarGift_layer211":
|
|
120
122
|
case "messageActionStarGift_layer216":
|
|
123
|
+
case "messageActionStarGift_layer218":
|
|
121
124
|
return {
|
|
122
125
|
...obj,
|
|
123
126
|
_: "messageActionStarGift",
|
|
@@ -192,11 +195,13 @@ function mapCompatObject(obj) {
|
|
|
192
195
|
case "starGiftUnique_layer210":
|
|
193
196
|
case "starGiftUnique_layer211":
|
|
194
197
|
case "starGiftUnique_layer214":
|
|
198
|
+
case "starGiftUnique_layer218":
|
|
195
199
|
case "starGift_layer202":
|
|
196
200
|
case "starGift_layer206":
|
|
197
201
|
case "starGift_layer209":
|
|
198
202
|
case "starGift_layer211":
|
|
199
203
|
case "starGift_layer216":
|
|
204
|
+
case "starGift_layer218":
|
|
200
205
|
return mapCompatStarGift(obj);
|
|
201
206
|
case "emojiStatus_layer197":
|
|
202
207
|
case "emojiStatusUntil_layer214":
|
|
@@ -217,6 +222,7 @@ function mapCompatObject(obj) {
|
|
|
217
222
|
case "messageActionGiftCode_layer216":
|
|
218
223
|
case "messageActionGiftPremium_layer216":
|
|
219
224
|
case "messageActionStarGift_layer216":
|
|
225
|
+
case "messageActionStarGift_layer218":
|
|
220
226
|
return mapCompatMessageAction(obj);
|
|
221
227
|
case "userFull_layer199":
|
|
222
228
|
return replaceType(dropFields(obj, ["premiumGifts"]), "userFull");
|
|
@@ -269,6 +275,12 @@ function mapCompatObject(obj) {
|
|
|
269
275
|
};
|
|
270
276
|
case "premiumGiftOption_layer199":
|
|
271
277
|
return null;
|
|
278
|
+
case "webPageAttributeStarGiftAuction_layer218":
|
|
279
|
+
return {
|
|
280
|
+
_: "webPageAttributeStarGiftAuction",
|
|
281
|
+
gift: mapCompatStarGift(obj.gift),
|
|
282
|
+
endDate: obj.endDate
|
|
283
|
+
};
|
|
272
284
|
default:
|
|
273
285
|
return obj;
|
|
274
286
|
}
|
package/utils/binary/compat.js
CHANGED
|
@@ -50,12 +50,14 @@ function mapCompatStarGift(obj) {
|
|
|
50
50
|
giftId: Long.ZERO
|
|
51
51
|
};
|
|
52
52
|
case "starGiftUnique_layer214":
|
|
53
|
+
case "starGiftUnique_layer218":
|
|
53
54
|
return replaceType(obj, "starGiftUnique");
|
|
54
55
|
case "starGift_layer202":
|
|
55
56
|
case "starGift_layer206":
|
|
56
57
|
case "starGift_layer209":
|
|
57
58
|
case "starGift_layer211":
|
|
58
59
|
case "starGift_layer216":
|
|
60
|
+
case "starGift_layer218":
|
|
59
61
|
return replaceType(obj, "starGift");
|
|
60
62
|
default:
|
|
61
63
|
return obj;
|
|
@@ -111,6 +113,7 @@ function mapCompatMessageAction(obj) {
|
|
|
111
113
|
case "messageActionStarGift_layer197":
|
|
112
114
|
case "messageActionStarGift_layer211":
|
|
113
115
|
case "messageActionStarGift_layer216":
|
|
116
|
+
case "messageActionStarGift_layer218":
|
|
114
117
|
return {
|
|
115
118
|
...obj,
|
|
116
119
|
_: "messageActionStarGift",
|
|
@@ -185,11 +188,13 @@ function mapCompatObject(obj) {
|
|
|
185
188
|
case "starGiftUnique_layer210":
|
|
186
189
|
case "starGiftUnique_layer211":
|
|
187
190
|
case "starGiftUnique_layer214":
|
|
191
|
+
case "starGiftUnique_layer218":
|
|
188
192
|
case "starGift_layer202":
|
|
189
193
|
case "starGift_layer206":
|
|
190
194
|
case "starGift_layer209":
|
|
191
195
|
case "starGift_layer211":
|
|
192
196
|
case "starGift_layer216":
|
|
197
|
+
case "starGift_layer218":
|
|
193
198
|
return mapCompatStarGift(obj);
|
|
194
199
|
case "emojiStatus_layer197":
|
|
195
200
|
case "emojiStatusUntil_layer214":
|
|
@@ -210,6 +215,7 @@ function mapCompatObject(obj) {
|
|
|
210
215
|
case "messageActionGiftCode_layer216":
|
|
211
216
|
case "messageActionGiftPremium_layer216":
|
|
212
217
|
case "messageActionStarGift_layer216":
|
|
218
|
+
case "messageActionStarGift_layer218":
|
|
213
219
|
return mapCompatMessageAction(obj);
|
|
214
220
|
case "userFull_layer199":
|
|
215
221
|
return replaceType(dropFields(obj, ["premiumGifts"]), "userFull");
|
|
@@ -262,6 +268,12 @@ function mapCompatObject(obj) {
|
|
|
262
268
|
};
|
|
263
269
|
case "premiumGiftOption_layer199":
|
|
264
270
|
return null;
|
|
271
|
+
case "webPageAttributeStarGiftAuction_layer218":
|
|
272
|
+
return {
|
|
273
|
+
_: "webPageAttributeStarGiftAuction",
|
|
274
|
+
gift: mapCompatStarGift(obj.gift),
|
|
275
|
+
endDate: obj.endDate
|
|
276
|
+
};
|
|
265
277
|
default:
|
|
266
278
|
return obj;
|
|
267
279
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|