@mtcute/core 0.19.10 → 0.20.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/client.cjs +20 -0
- package/client.js +20 -0
- package/highlevel/client.d.cts +64 -9
- package/highlevel/client.d.ts +64 -9
- package/highlevel/methods/files/normalize-input-media.cjs +12 -2
- package/highlevel/methods/files/normalize-input-media.js +12 -2
- package/highlevel/methods/messages/forward-messages.cjs +4 -2
- package/highlevel/methods/messages/forward-messages.d.cts +2 -0
- package/highlevel/methods/messages/forward-messages.d.ts +2 -0
- package/highlevel/methods/messages/forward-messages.js +4 -2
- package/highlevel/methods/premium/_normalize-input-star-gift.cjs +23 -0
- package/highlevel/methods/premium/_normalize-input-star-gift.d.cts +4 -0
- package/highlevel/methods/premium/_normalize-input-star-gift.d.ts +4 -0
- package/highlevel/methods/premium/_normalize-input-star-gift.js +18 -0
- package/highlevel/methods/premium/accept-star-gift.cjs +4 -3
- package/highlevel/methods/premium/accept-star-gift.d.cts +3 -3
- package/highlevel/methods/premium/accept-star-gift.d.ts +3 -3
- package/highlevel/methods/premium/accept-star-gift.js +4 -3
- package/highlevel/methods/premium/get-saved-star-gifts-by-id.cjs +21 -0
- package/highlevel/methods/premium/get-saved-star-gifts-by-id.d.cts +6 -0
- package/highlevel/methods/premium/get-saved-star-gifts-by-id.d.ts +6 -0
- package/highlevel/methods/premium/get-saved-star-gifts-by-id.js +16 -0
- package/highlevel/methods/premium/get-saved-star-gifts.cjs +32 -0
- package/highlevel/methods/premium/get-saved-star-gifts.d.cts +28 -0
- package/highlevel/methods/premium/get-saved-star-gifts.d.ts +28 -0
- package/highlevel/methods/premium/get-saved-star-gifts.js +27 -0
- package/highlevel/methods/premium/get-star-gift-withdrawal-url.cjs +23 -0
- package/highlevel/methods/premium/get-star-gift-withdrawal-url.d.cts +8 -0
- package/highlevel/methods/premium/get-star-gift-withdrawal-url.d.ts +8 -0
- package/highlevel/methods/premium/get-star-gift-withdrawal-url.js +18 -0
- package/highlevel/methods/premium/get-star-gifts.cjs +4 -13
- package/highlevel/methods/premium/get-star-gifts.d.cts +3 -2
- package/highlevel/methods/premium/get-star-gifts.d.ts +3 -2
- package/highlevel/methods/premium/get-star-gifts.js +4 -13
- package/highlevel/methods/premium/iter-saved-star-gifts.cjs +33 -0
- package/highlevel/methods/premium/iter-saved-star-gifts.d.cts +27 -0
- package/highlevel/methods/premium/iter-saved-star-gifts.d.ts +27 -0
- package/highlevel/methods/premium/iter-saved-star-gifts.js +28 -0
- package/highlevel/methods/premium/send-star-gift.cjs +2 -2
- package/highlevel/methods/premium/send-star-gift.d.cts +2 -2
- package/highlevel/methods/premium/send-star-gift.d.ts +2 -2
- package/highlevel/methods/premium/send-star-gift.js +3 -3
- package/highlevel/methods/premium/transfer-star-gift.cjs +4 -4
- package/highlevel/methods/premium/transfer-star-gift.d.cts +3 -3
- package/highlevel/methods/premium/transfer-star-gift.d.ts +3 -3
- package/highlevel/methods/premium/transfer-star-gift.js +5 -5
- package/highlevel/methods/premium/upgrade-star-gift.cjs +3 -3
- package/highlevel/methods/premium/upgrade-star-gift.d.cts +2 -2
- package/highlevel/methods/premium/upgrade-star-gift.d.ts +2 -2
- package/highlevel/methods/premium/upgrade-star-gift.js +3 -3
- package/highlevel/methods/users/set-emoji-status.cjs +8 -1
- package/highlevel/methods/users/set-emoji-status.d.cts +2 -0
- package/highlevel/methods/users/set-emoji-status.d.ts +2 -0
- package/highlevel/methods/users/set-emoji-status.js +8 -1
- package/highlevel/methods.d.cts +5 -0
- package/highlevel/methods.d.ts +5 -0
- package/highlevel/types/media/input-media/types.d.cts +4 -0
- package/highlevel/types/media/input-media/types.d.ts +4 -0
- package/highlevel/types/media/video.cjs +8 -0
- package/highlevel/types/media/video.d.cts +3 -0
- package/highlevel/types/media/video.d.ts +3 -0
- package/highlevel/types/media/video.js +8 -0
- package/highlevel/types/messages/message-action.cjs +22 -1
- package/highlevel/types/messages/message-action.d.cts +4 -0
- package/highlevel/types/messages/message-action.d.ts +4 -0
- package/highlevel/types/messages/message-action.js +22 -1
- package/highlevel/types/peers/chat.cjs +3 -1
- package/highlevel/types/peers/chat.js +3 -1
- package/highlevel/types/peers/full-chat.cjs +8 -0
- package/highlevel/types/peers/full-chat.d.cts +4 -0
- package/highlevel/types/peers/full-chat.d.ts +4 -0
- package/highlevel/types/peers/full-chat.js +8 -0
- package/highlevel/types/peers/user.cjs +3 -1
- package/highlevel/types/peers/user.js +3 -1
- package/highlevel/types/premium/index.d.cts +1 -0
- package/highlevel/types/premium/index.d.ts +1 -0
- package/highlevel/types/premium/saved-star-gift.cjs +81 -0
- package/highlevel/types/premium/saved-star-gift.d.cts +42 -0
- package/highlevel/types/premium/saved-star-gift.d.ts +42 -0
- package/highlevel/types/premium/saved-star-gift.js +76 -0
- package/highlevel/types/premium/stars-gift-unique.cjs +9 -5
- package/highlevel/types/premium/stars-gift-unique.d.cts +7 -5
- package/highlevel/types/premium/stars-gift-unique.d.ts +7 -5
- package/highlevel/types/premium/stars-gift-unique.js +9 -5
- package/highlevel/types/premium/stars-gift.cjs +0 -66
- package/highlevel/types/premium/stars-gift.d.cts +12 -40
- package/highlevel/types/premium/stars-gift.d.ts +12 -40
- package/highlevel/types/premium/stars-gift.js +1 -67
- package/highlevel/types/reactions/emoji-status.cjs +38 -1
- package/highlevel/types/reactions/emoji-status.d.cts +23 -2
- package/highlevel/types/reactions/emoji-status.d.ts +23 -2
- package/highlevel/types/reactions/emoji-status.js +39 -2
- package/index.cjs +4 -1
- package/index.js +5 -2
- package/methods.cjs +10 -0
- package/methods.js +10 -0
- package/network/middlewares/bundle.cjs +4 -0
- package/network/middlewares/bundle.d.cts +2 -0
- package/network/middlewares/bundle.d.ts +2 -0
- package/network/middlewares/bundle.js +4 -0
- package/network/middlewares/internal-errors.cjs +3 -1
- package/network/middlewares/internal-errors.d.cts +4 -0
- package/network/middlewares/internal-errors.d.ts +4 -0
- package/network/middlewares/internal-errors.js +3 -1
- package/network/network-manager.cjs +1 -1
- package/network/network-manager.js +1 -1
- package/package.json +2 -2
|
@@ -1,12 +1,33 @@
|
|
|
1
1
|
import { tl } from '@mtcute/tl';
|
|
2
|
+
export declare class EmojiStatusCollectible {
|
|
3
|
+
readonly raw: tl.RawEmojiStatusCollectible;
|
|
4
|
+
constructor(raw: tl.RawEmojiStatusCollectible);
|
|
5
|
+
/** ID of the collectible */
|
|
6
|
+
get id(): tl.Long;
|
|
7
|
+
/** Title of the collectible */
|
|
8
|
+
get title(): string;
|
|
9
|
+
/** Slug of the collectible */
|
|
10
|
+
get slug(): string;
|
|
11
|
+
/** Pattern emoji ID of the collectible */
|
|
12
|
+
get patternEmojiId(): tl.Long;
|
|
13
|
+
/** Colors of the collectible */
|
|
14
|
+
get colors(): {
|
|
15
|
+
center: number;
|
|
16
|
+
edge: number;
|
|
17
|
+
pattern: number;
|
|
18
|
+
text: number;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
2
21
|
/**
|
|
3
22
|
* Information about user's emoji status
|
|
4
23
|
*/
|
|
5
24
|
export declare class EmojiStatus {
|
|
6
|
-
readonly raw: Exclude<tl.TypeEmojiStatus, tl.RawEmojiStatusEmpty>;
|
|
7
|
-
constructor(raw: Exclude<tl.TypeEmojiStatus, tl.RawEmojiStatusEmpty>);
|
|
25
|
+
readonly raw: Exclude<tl.TypeEmojiStatus, tl.RawEmojiStatusEmpty | tl.RawInputEmojiStatusCollectible>;
|
|
26
|
+
constructor(raw: Exclude<tl.TypeEmojiStatus, tl.RawEmojiStatusEmpty | tl.RawInputEmojiStatusCollectible>);
|
|
8
27
|
/** ID of the custom emoji */
|
|
9
28
|
get emoji(): tl.Long;
|
|
10
29
|
/** This status is valid at most until this date */
|
|
11
30
|
get expireDate(): Date | null;
|
|
31
|
+
/** If this is a collectible emoji status, information about it */
|
|
32
|
+
get collectible(): EmojiStatusCollectible | null;
|
|
12
33
|
}
|
|
@@ -1,4 +1,35 @@
|
|
|
1
1
|
import { makeInspectable } from "../../utils/inspectable.js";
|
|
2
|
+
class EmojiStatusCollectible {
|
|
3
|
+
constructor(raw) {
|
|
4
|
+
this.raw = raw;
|
|
5
|
+
}
|
|
6
|
+
/** ID of the collectible */
|
|
7
|
+
get id() {
|
|
8
|
+
return this.raw.collectibleId;
|
|
9
|
+
}
|
|
10
|
+
/** Title of the collectible */
|
|
11
|
+
get title() {
|
|
12
|
+
return this.raw.title;
|
|
13
|
+
}
|
|
14
|
+
/** Slug of the collectible */
|
|
15
|
+
get slug() {
|
|
16
|
+
return this.raw.slug;
|
|
17
|
+
}
|
|
18
|
+
/** Pattern emoji ID of the collectible */
|
|
19
|
+
get patternEmojiId() {
|
|
20
|
+
return this.raw.patternDocumentId;
|
|
21
|
+
}
|
|
22
|
+
/** Colors of the collectible */
|
|
23
|
+
get colors() {
|
|
24
|
+
return {
|
|
25
|
+
center: this.raw.centerColor,
|
|
26
|
+
edge: this.raw.edgeColor,
|
|
27
|
+
pattern: this.raw.patternColor,
|
|
28
|
+
text: this.raw.textColor
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const EmojiStatusCollectible$1 = /* @__PURE__ */ makeInspectable(EmojiStatusCollectible);
|
|
2
33
|
class EmojiStatus {
|
|
3
34
|
constructor(raw) {
|
|
4
35
|
this.raw = raw;
|
|
@@ -9,11 +40,17 @@ class EmojiStatus {
|
|
|
9
40
|
}
|
|
10
41
|
/** This status is valid at most until this date */
|
|
11
42
|
get expireDate() {
|
|
12
|
-
if (this.raw.
|
|
43
|
+
if (!this.raw.until) return null;
|
|
13
44
|
return new Date(this.raw.until * 1e3);
|
|
14
45
|
}
|
|
46
|
+
/** If this is a collectible emoji status, information about it */
|
|
47
|
+
get collectible() {
|
|
48
|
+
if (this.raw._ !== "emojiStatusCollectible") return null;
|
|
49
|
+
return new EmojiStatusCollectible(this.raw);
|
|
50
|
+
}
|
|
15
51
|
}
|
|
16
52
|
const EmojiStatus$1 = /* @__PURE__ */ makeInspectable(EmojiStatus);
|
|
17
53
|
export {
|
|
18
|
-
EmojiStatus$1 as EmojiStatus
|
|
54
|
+
EmojiStatus$1 as EmojiStatus,
|
|
55
|
+
EmojiStatusCollectible$1 as EmojiStatusCollectible
|
|
19
56
|
};
|
package/index.cjs
CHANGED
|
@@ -89,6 +89,7 @@ const businessConnection = require("./highlevel/types/premium/business-connectio
|
|
|
89
89
|
const businessIntro = require("./highlevel/types/premium/business-intro.cjs");
|
|
90
90
|
const businessLocation = require("./highlevel/types/premium/business-location.cjs");
|
|
91
91
|
const businessWorkHours = require("./highlevel/types/premium/business-work-hours.cjs");
|
|
92
|
+
const savedStarGift = require("./highlevel/types/premium/saved-star-gift.cjs");
|
|
92
93
|
const starsGiftUnique = require("./highlevel/types/premium/stars-gift-unique.cjs");
|
|
93
94
|
const starsGift = require("./highlevel/types/premium/stars-gift.cjs");
|
|
94
95
|
const starsStatus = require("./highlevel/types/premium/stars-status.cjs");
|
|
@@ -254,15 +255,17 @@ exports.BusinessIntro = businessIntro.BusinessIntro;
|
|
|
254
255
|
exports.BusinessLocation = businessLocation.BusinessLocation;
|
|
255
256
|
exports.BusinessWorkHours = businessWorkHours.BusinessWorkHours;
|
|
256
257
|
exports.businessWorkHoursDaysToRaw = businessWorkHours.businessWorkHoursDaysToRaw;
|
|
258
|
+
exports.SavedStarGift = savedStarGift.SavedStarGift;
|
|
259
|
+
exports.UserStarGift = savedStarGift.UserStarGift;
|
|
257
260
|
exports.StarGiftUnique = starsGiftUnique.StarGiftUnique;
|
|
258
261
|
exports.StarGiftUniqueAttribute = starsGiftUnique.StarGiftUniqueAttribute;
|
|
259
262
|
exports.StarGiftUniqueBackdrop = starsGiftUnique.StarGiftUniqueBackdrop;
|
|
260
263
|
exports.StarGiftUniqueOriginalDetails = starsGiftUnique.StarGiftUniqueOriginalDetails;
|
|
261
264
|
exports.StarGift = starsGift.StarGift;
|
|
262
|
-
exports.UserStarGift = starsGift.UserStarGift;
|
|
263
265
|
exports.StarsStatus = starsStatus.StarsStatus;
|
|
264
266
|
exports.StarsTransaction = starsTransaction.StarsTransaction;
|
|
265
267
|
exports.EmojiStatus = emojiStatus.EmojiStatus;
|
|
268
|
+
exports.EmojiStatusCollectible = emojiStatus.EmojiStatusCollectible;
|
|
266
269
|
exports.PaidPeerReaction = peerReaction.PaidPeerReaction;
|
|
267
270
|
exports.PeerReaction = peerReaction.PeerReaction;
|
|
268
271
|
exports.ReactionCount = reactionCount.ReactionCount;
|
package/index.js
CHANGED
|
@@ -82,11 +82,12 @@ import { BusinessConnection } from "./highlevel/types/premium/business-connectio
|
|
|
82
82
|
import { BusinessIntro } from "./highlevel/types/premium/business-intro.js";
|
|
83
83
|
import { BusinessLocation } from "./highlevel/types/premium/business-location.js";
|
|
84
84
|
import { BusinessWorkHours, businessWorkHoursDaysToRaw } from "./highlevel/types/premium/business-work-hours.js";
|
|
85
|
+
import { SavedStarGift, UserStarGift } from "./highlevel/types/premium/saved-star-gift.js";
|
|
85
86
|
import { StarGiftUnique, StarGiftUniqueAttribute, StarGiftUniqueBackdrop, StarGiftUniqueOriginalDetails } from "./highlevel/types/premium/stars-gift-unique.js";
|
|
86
|
-
import { StarGift
|
|
87
|
+
import { StarGift } from "./highlevel/types/premium/stars-gift.js";
|
|
87
88
|
import { StarsStatus } from "./highlevel/types/premium/stars-status.js";
|
|
88
89
|
import { StarsTransaction } from "./highlevel/types/premium/stars-transaction.js";
|
|
89
|
-
import { EmojiStatus } from "./highlevel/types/reactions/emoji-status.js";
|
|
90
|
+
import { EmojiStatus, EmojiStatusCollectible } from "./highlevel/types/reactions/emoji-status.js";
|
|
90
91
|
import { PaidPeerReaction, PeerReaction } from "./highlevel/types/reactions/peer-reaction.js";
|
|
91
92
|
import { ReactionCount } from "./highlevel/types/reactions/reaction-count.js";
|
|
92
93
|
import { normalizeInputReaction, toReactionEmoji } from "./highlevel/types/reactions/types.js";
|
|
@@ -197,6 +198,7 @@ export {
|
|
|
197
198
|
Document,
|
|
198
199
|
DraftMessage,
|
|
199
200
|
EmojiStatus,
|
|
201
|
+
EmojiStatusCollectible,
|
|
200
202
|
ExtendedMediaPreview,
|
|
201
203
|
FactCheck,
|
|
202
204
|
FileLocation,
|
|
@@ -254,6 +256,7 @@ export {
|
|
|
254
256
|
RawUpdateInfo,
|
|
255
257
|
ReactionCount,
|
|
256
258
|
RepliedMessageInfo,
|
|
259
|
+
SavedStarGift,
|
|
257
260
|
SearchFilters,
|
|
258
261
|
SentCode,
|
|
259
262
|
SessionConnection,
|
package/methods.cjs
CHANGED
|
@@ -183,6 +183,7 @@ const changeCloudPassword = require("./highlevel/methods/password/change-cloud-p
|
|
|
183
183
|
const enableCloudPassword = require("./highlevel/methods/password/enable-cloud-password.cjs");
|
|
184
184
|
const passwordEmail = require("./highlevel/methods/password/password-email.cjs");
|
|
185
185
|
const removeCloudPassword = require("./highlevel/methods/password/remove-cloud-password.cjs");
|
|
186
|
+
const _normalizeInputStarGift = require("./highlevel/methods/premium/_normalize-input-star-gift.cjs");
|
|
186
187
|
const acceptStarGift = require("./highlevel/methods/premium/accept-star-gift.cjs");
|
|
187
188
|
const applyBoost = require("./highlevel/methods/premium/apply-boost.cjs");
|
|
188
189
|
const canApplyBoost = require("./highlevel/methods/premium/can-apply-boost.cjs");
|
|
@@ -193,11 +194,15 @@ const getBoosts = require("./highlevel/methods/premium/get-boosts.cjs");
|
|
|
193
194
|
const getBusinessChatLinks = require("./highlevel/methods/premium/get-business-chat-links.cjs");
|
|
194
195
|
const getBusinessConnection = require("./highlevel/methods/premium/get-business-connection.cjs");
|
|
195
196
|
const getMyBoostSlots = require("./highlevel/methods/premium/get-my-boost-slots.cjs");
|
|
197
|
+
const getSavedStarGiftsById = require("./highlevel/methods/premium/get-saved-star-gifts-by-id.cjs");
|
|
198
|
+
const getSavedStarGifts = require("./highlevel/methods/premium/get-saved-star-gifts.cjs");
|
|
196
199
|
const getStarGiftOptions = require("./highlevel/methods/premium/get-star-gift-options.cjs");
|
|
200
|
+
const getStarGiftWithdrawalUrl = require("./highlevel/methods/premium/get-star-gift-withdrawal-url.cjs");
|
|
197
201
|
const getStarGifts = require("./highlevel/methods/premium/get-star-gifts.cjs");
|
|
198
202
|
const getStarsTransactions = require("./highlevel/methods/premium/get-stars-transactions.cjs");
|
|
199
203
|
const getUniqueStarGift = require("./highlevel/methods/premium/get-unique-star-gift.cjs");
|
|
200
204
|
const iterBoosters = require("./highlevel/methods/premium/iter-boosters.cjs");
|
|
205
|
+
const iterSavedStarGifts = require("./highlevel/methods/premium/iter-saved-star-gifts.cjs");
|
|
201
206
|
const iterStarGifts = require("./highlevel/methods/premium/iter-star-gifts.cjs");
|
|
202
207
|
const iterStarsTransactions = require("./highlevel/methods/premium/iter-stars-transactions.cjs");
|
|
203
208
|
const sendStarGift = require("./highlevel/methods/premium/send-star-gift.cjs");
|
|
@@ -454,6 +459,7 @@ exports.cancelPasswordEmail = passwordEmail.cancelPasswordEmail;
|
|
|
454
459
|
exports.resendPasswordEmail = passwordEmail.resendPasswordEmail;
|
|
455
460
|
exports.verifyPasswordEmail = passwordEmail.verifyPasswordEmail;
|
|
456
461
|
exports.removeCloudPassword = removeCloudPassword.removeCloudPassword;
|
|
462
|
+
exports._normalizeInputStarGift = _normalizeInputStarGift._normalizeInputStarGift;
|
|
457
463
|
exports.acceptStarGift = acceptStarGift.acceptStarGift;
|
|
458
464
|
exports.applyBoost = applyBoost.applyBoost;
|
|
459
465
|
exports.canApplyBoost = canApplyBoost.canApplyBoost;
|
|
@@ -465,11 +471,15 @@ exports.getBoosts = getBoosts.getBoosts;
|
|
|
465
471
|
exports.getBusinessChatLinks = getBusinessChatLinks.getBusinessChatLinks;
|
|
466
472
|
exports.getBusinessConnection = getBusinessConnection.getBusinessConnection;
|
|
467
473
|
exports.getMyBoostSlots = getMyBoostSlots.getMyBoostSlots;
|
|
474
|
+
exports.getSavedStarGiftsById = getSavedStarGiftsById.getSavedStarGiftsById;
|
|
475
|
+
exports.getSavedStarGifts = getSavedStarGifts.getSavedStarGifts;
|
|
468
476
|
exports.getStarGiftOptions = getStarGiftOptions.getStarGiftOptions;
|
|
477
|
+
exports.getStarGiftWithdrawalUrl = getStarGiftWithdrawalUrl.getStarGiftWithdrawalUrl;
|
|
469
478
|
exports.getStarGifts = getStarGifts.getStarGifts;
|
|
470
479
|
exports.getStarsTransactions = getStarsTransactions.getStarsTransactions;
|
|
471
480
|
exports.getUniqueStarGift = getUniqueStarGift.getUniqueStarGift;
|
|
472
481
|
exports.iterBoosters = iterBoosters.iterBoosters;
|
|
482
|
+
exports.iterSavedStarGifts = iterSavedStarGifts.iterSavedStarGifts;
|
|
473
483
|
exports.iterStarGifts = iterStarGifts.iterStarGifts;
|
|
474
484
|
exports.iterStarsTransactions = iterStarsTransactions.iterStarsTransactions;
|
|
475
485
|
exports.sendStarGift = sendStarGift.sendStarGift;
|
package/methods.js
CHANGED
|
@@ -176,6 +176,7 @@ import { changeCloudPassword } from "./highlevel/methods/password/change-cloud-p
|
|
|
176
176
|
import { enableCloudPassword } from "./highlevel/methods/password/enable-cloud-password.js";
|
|
177
177
|
import { cancelPasswordEmail, resendPasswordEmail, verifyPasswordEmail } from "./highlevel/methods/password/password-email.js";
|
|
178
178
|
import { removeCloudPassword } from "./highlevel/methods/password/remove-cloud-password.js";
|
|
179
|
+
import { _normalizeInputStarGift } from "./highlevel/methods/premium/_normalize-input-star-gift.js";
|
|
179
180
|
import { acceptStarGift } from "./highlevel/methods/premium/accept-star-gift.js";
|
|
180
181
|
import { applyBoost } from "./highlevel/methods/premium/apply-boost.js";
|
|
181
182
|
import { canApplyBoost } from "./highlevel/methods/premium/can-apply-boost.js";
|
|
@@ -186,11 +187,15 @@ import { getBoosts } from "./highlevel/methods/premium/get-boosts.js";
|
|
|
186
187
|
import { getBusinessChatLinks } from "./highlevel/methods/premium/get-business-chat-links.js";
|
|
187
188
|
import { getBusinessConnection } from "./highlevel/methods/premium/get-business-connection.js";
|
|
188
189
|
import { getMyBoostSlots } from "./highlevel/methods/premium/get-my-boost-slots.js";
|
|
190
|
+
import { getSavedStarGiftsById } from "./highlevel/methods/premium/get-saved-star-gifts-by-id.js";
|
|
191
|
+
import { getSavedStarGifts } from "./highlevel/methods/premium/get-saved-star-gifts.js";
|
|
189
192
|
import { getStarGiftOptions } from "./highlevel/methods/premium/get-star-gift-options.js";
|
|
193
|
+
import { getStarGiftWithdrawalUrl } from "./highlevel/methods/premium/get-star-gift-withdrawal-url.js";
|
|
190
194
|
import { getStarGifts } from "./highlevel/methods/premium/get-star-gifts.js";
|
|
191
195
|
import { getStarsTransactions } from "./highlevel/methods/premium/get-stars-transactions.js";
|
|
192
196
|
import { getUniqueStarGift } from "./highlevel/methods/premium/get-unique-star-gift.js";
|
|
193
197
|
import { iterBoosters } from "./highlevel/methods/premium/iter-boosters.js";
|
|
198
|
+
import { iterSavedStarGifts } from "./highlevel/methods/premium/iter-saved-star-gifts.js";
|
|
194
199
|
import { iterStarGifts } from "./highlevel/methods/premium/iter-star-gifts.js";
|
|
195
200
|
import { iterStarsTransactions } from "./highlevel/methods/premium/iter-stars-transactions.js";
|
|
196
201
|
import { sendStarGift } from "./highlevel/methods/premium/send-star-gift.js";
|
|
@@ -254,6 +259,7 @@ import { updateProfile } from "./highlevel/methods/users/update-profile.js";
|
|
|
254
259
|
export {
|
|
255
260
|
_normalizeInputFile,
|
|
256
261
|
_normalizeInputMedia,
|
|
262
|
+
_normalizeInputStarGift,
|
|
257
263
|
_normalizePrivacyRules,
|
|
258
264
|
acceptStarGift,
|
|
259
265
|
addChatMembers,
|
|
@@ -381,9 +387,12 @@ export {
|
|
|
381
387
|
getProfileStories,
|
|
382
388
|
getReactionUsers,
|
|
383
389
|
getReplyTo,
|
|
390
|
+
getSavedStarGifts,
|
|
391
|
+
getSavedStarGiftsById,
|
|
384
392
|
getScheduledMessages,
|
|
385
393
|
getSimilarChannels,
|
|
386
394
|
getStarGiftOptions,
|
|
395
|
+
getStarGiftWithdrawalUrl,
|
|
387
396
|
getStarGifts,
|
|
388
397
|
getStarsTransactions,
|
|
389
398
|
getStickerSet,
|
|
@@ -414,6 +423,7 @@ export {
|
|
|
414
423
|
iterProfilePhotos,
|
|
415
424
|
iterProfileStories,
|
|
416
425
|
iterReactionUsers,
|
|
426
|
+
iterSavedStarGifts,
|
|
417
427
|
iterSearchGlobal,
|
|
418
428
|
iterSearchHashtag,
|
|
419
429
|
iterSearchMessages,
|
|
@@ -6,8 +6,12 @@ if (typeof globalThis !== "undefined" && !globalThis._MTCUTE_CJS_DEPRECATION_WAR
|
|
|
6
6
|
"use strict";
|
|
7
7
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
8
8
|
const _default = require("./default.cjs");
|
|
9
|
+
const floodWaiter = require("./flood-waiter.cjs");
|
|
10
|
+
const internalErrors = require("./internal-errors.cjs");
|
|
9
11
|
const onError = require("./on-error.cjs");
|
|
10
12
|
const onMethod = require("./on-method.cjs");
|
|
11
13
|
exports.basic = _default.basic;
|
|
14
|
+
exports.floodWaiter = floodWaiter.floodWaiter;
|
|
15
|
+
exports.internalErrorsHandler = internalErrors.internalErrorsHandler;
|
|
12
16
|
exports.onRpcError = onError.onRpcError;
|
|
13
17
|
exports.onMethod = onMethod.onMethod;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { basic } from "./default.js";
|
|
2
|
+
import { floodWaiter } from "./flood-waiter.js";
|
|
3
|
+
import { internalErrorsHandler } from "./internal-errors.js";
|
|
2
4
|
import { onRpcError } from "./on-error.js";
|
|
3
5
|
import { onMethod } from "./on-method.js";
|
|
4
6
|
export {
|
|
5
7
|
basic,
|
|
8
|
+
floodWaiter,
|
|
9
|
+
internalErrorsHandler,
|
|
6
10
|
onMethod,
|
|
7
11
|
onRpcError
|
|
8
12
|
};
|
|
@@ -20,13 +20,15 @@ const CLIENT_ERRORS = /* @__PURE__ */ new Set([
|
|
|
20
20
|
tl.tl.RpcError.NOT_ACCEPTABLE
|
|
21
21
|
]);
|
|
22
22
|
function internalErrorsHandler(params) {
|
|
23
|
-
const { maxRetries = Infinity, waitTime = 1 } = params;
|
|
23
|
+
const { maxRetries = Infinity, waitTime = 1, exceptErrors } = params;
|
|
24
|
+
const exceptErrorsSet = exceptErrors ? new Set(exceptErrors) : void 0;
|
|
24
25
|
return async (ctx, next) => {
|
|
25
26
|
const numRetries = ctx.params?.maxRetryCount ?? maxRetries;
|
|
26
27
|
for (let i = 0; i <= numRetries; i++) {
|
|
27
28
|
const res = await next(ctx);
|
|
28
29
|
if (!typeAssertions.isTlRpcError(res)) return res;
|
|
29
30
|
if (!CLIENT_ERRORS.has(res.errorCode)) {
|
|
31
|
+
if (exceptErrorsSet?.has(res.errorMessage)) return res;
|
|
30
32
|
if (ctx.params?.throw503 && res.errorCode === -503) {
|
|
31
33
|
throw new errors.MtTimeoutError();
|
|
32
34
|
}
|
|
@@ -13,5 +13,9 @@ export interface InternalErrorsHandlerOptions {
|
|
|
13
13
|
* @default 1
|
|
14
14
|
*/
|
|
15
15
|
waitTime?: number;
|
|
16
|
+
/**
|
|
17
|
+
* List of internal errors that should not be retried and should be thrown immediately.
|
|
18
|
+
*/
|
|
19
|
+
exceptErrors?: string[];
|
|
16
20
|
}
|
|
17
21
|
export declare function internalErrorsHandler(params: InternalErrorsHandlerOptions): RpcCallMiddleware;
|
|
@@ -13,5 +13,9 @@ export interface InternalErrorsHandlerOptions {
|
|
|
13
13
|
* @default 1
|
|
14
14
|
*/
|
|
15
15
|
waitTime?: number;
|
|
16
|
+
/**
|
|
17
|
+
* List of internal errors that should not be retried and should be thrown immediately.
|
|
18
|
+
*/
|
|
19
|
+
exceptErrors?: string[];
|
|
16
20
|
}
|
|
17
21
|
export declare function internalErrorsHandler(params: InternalErrorsHandlerOptions): RpcCallMiddleware;
|
|
@@ -13,13 +13,15 @@ const CLIENT_ERRORS = /* @__PURE__ */ new Set([
|
|
|
13
13
|
tl.RpcError.NOT_ACCEPTABLE
|
|
14
14
|
]);
|
|
15
15
|
function internalErrorsHandler(params) {
|
|
16
|
-
const { maxRetries = Infinity, waitTime = 1 } = params;
|
|
16
|
+
const { maxRetries = Infinity, waitTime = 1, exceptErrors } = params;
|
|
17
|
+
const exceptErrorsSet = exceptErrors ? new Set(exceptErrors) : void 0;
|
|
17
18
|
return async (ctx, next) => {
|
|
18
19
|
const numRetries = ctx.params?.maxRetryCount ?? maxRetries;
|
|
19
20
|
for (let i = 0; i <= numRetries; i++) {
|
|
20
21
|
const res = await next(ctx);
|
|
21
22
|
if (!isTlRpcError(res)) return res;
|
|
22
23
|
if (!CLIENT_ERRORS.has(res.errorCode)) {
|
|
24
|
+
if (exceptErrorsSet?.has(res.errorMessage)) return res;
|
|
23
25
|
if (ctx.params?.throw503 && res.errorCode === -503) {
|
|
24
26
|
throw new MtTimeoutError();
|
|
25
27
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mtcute/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.20.1",
|
|
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.9",
|
|
11
11
|
"@fuman/utils": "0.0.4",
|
|
12
12
|
"@mtcute/file-id": "^0.19.0",
|
|
13
|
-
"@mtcute/tl": "^
|
|
13
|
+
"@mtcute/tl": "^198.0.0",
|
|
14
14
|
"@mtcute/tl-runtime": "^0.19.0",
|
|
15
15
|
"@types/events": "3.0.0",
|
|
16
16
|
"long": "5.2.3"
|