@mtcute/core 0.27.2 → 0.27.4
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 +80 -68
- package/client.js +80 -68
- 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 +484 -420
- package/highlevel/client.d.ts +484 -420
- package/highlevel/methods/files/download-iterable.cjs +4 -0
- package/highlevel/methods/files/download-iterable.d.cts +11 -1
- package/highlevel/methods/files/download-iterable.d.ts +11 -1
- package/highlevel/methods/files/download-iterable.js +4 -0
- package/highlevel/methods/files/download-stream.cjs +14 -0
- package/highlevel/methods/files/download-stream.d.cts +13 -2
- package/highlevel/methods/files/download-stream.d.ts +13 -2
- package/highlevel/methods/files/download-stream.js +14 -0
- 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 +23 -18
- package/highlevel/methods.d.ts +23 -18
- package/highlevel/types/media/document-utils.cjs +1 -1
- package/highlevel/types/media/document-utils.js +1 -1
- package/highlevel/types/media/voice.cjs +6 -1
- package/highlevel/types/media/voice.d.cts +4 -1
- package/highlevel/types/media/voice.d.ts +4 -1
- package/highlevel/types/media/voice.js +6 -1
- 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 +12 -3
- package/highlevel/types/premium/star-gift.d.cts +5 -0
- package/highlevel/types/premium/star-gift.d.ts +5 -0
- package/highlevel/types/premium/star-gift.js +12 -3
- 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 +40 -34
- package/methods.js +23 -17
- 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
|
@@ -32,6 +32,7 @@ export declare class StarGift {
|
|
|
32
32
|
get auction(): {
|
|
33
33
|
slug: string;
|
|
34
34
|
giftsPerRound: number;
|
|
35
|
+
startDate: Date;
|
|
35
36
|
} | null;
|
|
36
37
|
/** @deprecated Use {@link auction} instead (typo in older versions) */
|
|
37
38
|
get action(): this['auction'];
|
|
@@ -84,4 +85,8 @@ export declare class StarGift {
|
|
|
84
85
|
* User/channel who released this collection
|
|
85
86
|
*/
|
|
86
87
|
get releasedBy(): Peer | null;
|
|
88
|
+
/** Number of unique upgrade variants that will be available for the gift */
|
|
89
|
+
get upgradeVariants(): number;
|
|
90
|
+
/** Background color of the gift */
|
|
91
|
+
get background(): tl.TypeStarGiftBackground | null;
|
|
87
92
|
}
|
|
@@ -32,6 +32,7 @@ export declare class StarGift {
|
|
|
32
32
|
get auction(): {
|
|
33
33
|
slug: string;
|
|
34
34
|
giftsPerRound: number;
|
|
35
|
+
startDate: Date;
|
|
35
36
|
} | null;
|
|
36
37
|
/** @deprecated Use {@link auction} instead (typo in older versions) */
|
|
37
38
|
get action(): this['auction'];
|
|
@@ -84,4 +85,8 @@ export declare class StarGift {
|
|
|
84
85
|
* User/channel who released this collection
|
|
85
86
|
*/
|
|
86
87
|
get releasedBy(): Peer | null;
|
|
88
|
+
/** Number of unique upgrade variants that will be available for the gift */
|
|
89
|
+
get upgradeVariants(): number;
|
|
90
|
+
/** Background color of the gift */
|
|
91
|
+
get background(): tl.TypeStarGiftBackground | null;
|
|
87
92
|
}
|
|
@@ -28,10 +28,11 @@ class StarGift {
|
|
|
28
28
|
}
|
|
29
29
|
/** If this gift is currently sold through an auction, info about that auction. `null` otherwise */
|
|
30
30
|
get auction() {
|
|
31
|
-
if (!this.raw.auctionSlug || this.raw.giftsPerRound == null) return null;
|
|
31
|
+
if (!this.raw.auctionSlug || this.raw.giftsPerRound == null || !this.raw.auctionStartDate) return null;
|
|
32
32
|
return {
|
|
33
33
|
slug: this.raw.auctionSlug,
|
|
34
|
-
giftsPerRound: this.raw.giftsPerRound
|
|
34
|
+
giftsPerRound: this.raw.giftsPerRound,
|
|
35
|
+
startDate: new Date(this.raw.auctionStartDate * 1e3)
|
|
35
36
|
};
|
|
36
37
|
}
|
|
37
38
|
/** @deprecated Use {@link auction} instead (typo in older versions) */
|
|
@@ -120,9 +121,17 @@ class StarGift {
|
|
|
120
121
|
if (!this.raw.releasedBy) return null;
|
|
121
122
|
return parsePeer(this.raw.releasedBy, this._peers);
|
|
122
123
|
}
|
|
124
|
+
/** Number of unique upgrade variants that will be available for the gift */
|
|
125
|
+
get upgradeVariants() {
|
|
126
|
+
return this.raw.upgradeVariants ?? 0;
|
|
127
|
+
}
|
|
128
|
+
/** Background color of the gift */
|
|
129
|
+
get background() {
|
|
130
|
+
return this.raw.background ?? null;
|
|
131
|
+
}
|
|
123
132
|
}
|
|
124
133
|
const StarGift$1 = /* @__PURE__ */ makeInspectable(StarGift);
|
|
125
|
-
const StarGift$2 = /* @__PURE__ */ memoizeGetters(StarGift$1, ["sticker"]);
|
|
134
|
+
const StarGift$2 = /* @__PURE__ */ memoizeGetters(StarGift$1, ["sticker", "auction"]);
|
|
126
135
|
export {
|
|
127
136
|
StarGift$2 as StarGift
|
|
128
137
|
};
|
|
@@ -147,6 +147,12 @@ class StarsTransaction {
|
|
|
147
147
|
peer: peer$1,
|
|
148
148
|
gift: new starGiftUnique.StarGiftUnique(this.raw.stargift, this.peers)
|
|
149
149
|
};
|
|
150
|
+
} else if (this.raw.offer) {
|
|
151
|
+
return {
|
|
152
|
+
type: "star_gift_offer",
|
|
153
|
+
peer: peer$1,
|
|
154
|
+
gift: new starGiftUnique.StarGiftUnique(this.raw.stargift, this.peers)
|
|
155
|
+
};
|
|
150
156
|
} else {
|
|
151
157
|
return {
|
|
152
158
|
type: "star_gift_transfer",
|
|
@@ -137,6 +137,12 @@ export type StarsTransactionType = {
|
|
|
137
137
|
recipient: Peer;
|
|
138
138
|
/** The upgraded gift */
|
|
139
139
|
gift: StarGiftUnique;
|
|
140
|
+
} | {
|
|
141
|
+
type: 'star_gift_offer';
|
|
142
|
+
/** Related peer */
|
|
143
|
+
peer: Peer;
|
|
144
|
+
/** The gift that was offered for sale */
|
|
145
|
+
gift: StarGiftUnique;
|
|
140
146
|
} | {
|
|
141
147
|
type: 'paid_message';
|
|
142
148
|
/** Related peer */
|
|
@@ -137,6 +137,12 @@ export type StarsTransactionType = {
|
|
|
137
137
|
recipient: Peer;
|
|
138
138
|
/** The upgraded gift */
|
|
139
139
|
gift: StarGiftUnique;
|
|
140
|
+
} | {
|
|
141
|
+
type: 'star_gift_offer';
|
|
142
|
+
/** Related peer */
|
|
143
|
+
peer: Peer;
|
|
144
|
+
/** The gift that was offered for sale */
|
|
145
|
+
gift: StarGiftUnique;
|
|
140
146
|
} | {
|
|
141
147
|
type: 'paid_message';
|
|
142
148
|
/** Related peer */
|
|
@@ -140,6 +140,12 @@ class StarsTransaction {
|
|
|
140
140
|
peer,
|
|
141
141
|
gift: new StarGiftUnique$2(this.raw.stargift, this.peers)
|
|
142
142
|
};
|
|
143
|
+
} else if (this.raw.offer) {
|
|
144
|
+
return {
|
|
145
|
+
type: "star_gift_offer",
|
|
146
|
+
peer,
|
|
147
|
+
gift: new StarGiftUnique$2(this.raw.stargift, this.peers)
|
|
148
|
+
};
|
|
143
149
|
} else {
|
|
144
150
|
return {
|
|
145
151
|
type: "star_gift_transfer",
|
|
@@ -720,6 +720,11 @@ class UpdatesManager {
|
|
|
720
720
|
channelId,
|
|
721
721
|
this._fetchChannelDifference(channelId, fallbackPts).catch((err) => {
|
|
722
722
|
this.log.warn("error fetching difference for %d: %e", channelId, err);
|
|
723
|
+
if (tl.tl.RpcError.is("PERSISTENT_TIMESTAMP_INVALID")) {
|
|
724
|
+
this.log.warn("received PERSISTENT_TIMESTAMP_INVALID, resetting channel pts value");
|
|
725
|
+
this.cpts.delete(channelId);
|
|
726
|
+
this.cptsMod.delete(channelId);
|
|
727
|
+
}
|
|
723
728
|
}).then((ok) => {
|
|
724
729
|
requestedDiff.delete(channelId);
|
|
725
730
|
if (!ok) {
|
|
@@ -821,6 +826,7 @@ class UpdatesManager {
|
|
|
821
826
|
}
|
|
822
827
|
this.log.warn("error fetching common difference: %e", err);
|
|
823
828
|
if (tl.tl.RpcError.is(err, "PERSISTENT_TIMESTAMP_INVALID")) {
|
|
829
|
+
this.log.warn("received PERSISTENT_TIMESTAMP_INVALID, re-fetching updates state");
|
|
824
830
|
return this._fetchUpdatesState();
|
|
825
831
|
}
|
|
826
832
|
}).then(() => {
|
|
@@ -1464,6 +1470,7 @@ class UpdatesManager {
|
|
|
1464
1470
|
}
|
|
1465
1471
|
log.debug("updates loop stopped");
|
|
1466
1472
|
} catch (e) {
|
|
1473
|
+
if (this.client.destroyed) return;
|
|
1467
1474
|
log.error("updates loop encountered error, restarting: %s", e);
|
|
1468
1475
|
return this._loop();
|
|
1469
1476
|
}
|
|
@@ -713,6 +713,11 @@ class UpdatesManager {
|
|
|
713
713
|
channelId,
|
|
714
714
|
this._fetchChannelDifference(channelId, fallbackPts).catch((err) => {
|
|
715
715
|
this.log.warn("error fetching difference for %d: %e", channelId, err);
|
|
716
|
+
if (tl.RpcError.is("PERSISTENT_TIMESTAMP_INVALID")) {
|
|
717
|
+
this.log.warn("received PERSISTENT_TIMESTAMP_INVALID, resetting channel pts value");
|
|
718
|
+
this.cpts.delete(channelId);
|
|
719
|
+
this.cptsMod.delete(channelId);
|
|
720
|
+
}
|
|
716
721
|
}).then((ok) => {
|
|
717
722
|
requestedDiff.delete(channelId);
|
|
718
723
|
if (!ok) {
|
|
@@ -814,6 +819,7 @@ class UpdatesManager {
|
|
|
814
819
|
}
|
|
815
820
|
this.log.warn("error fetching common difference: %e", err);
|
|
816
821
|
if (tl.RpcError.is(err, "PERSISTENT_TIMESTAMP_INVALID")) {
|
|
822
|
+
this.log.warn("received PERSISTENT_TIMESTAMP_INVALID, re-fetching updates state");
|
|
817
823
|
return this._fetchUpdatesState();
|
|
818
824
|
}
|
|
819
825
|
}).then(() => {
|
|
@@ -1457,6 +1463,7 @@ class UpdatesManager {
|
|
|
1457
1463
|
}
|
|
1458
1464
|
log.debug("updates loop stopped");
|
|
1459
1465
|
} catch (e) {
|
|
1466
|
+
if (this.client.destroyed) return;
|
|
1460
1467
|
log.error("updates loop encountered error, restarting: %s", e);
|
|
1461
1468
|
return this._loop();
|
|
1462
1469
|
}
|
package/methods.cjs
CHANGED
|
@@ -118,6 +118,26 @@ const toggleForumTopicClosed = require("./highlevel/methods/forums/toggle-forum-
|
|
|
118
118
|
const toggleForumTopicPinned = require("./highlevel/methods/forums/toggle-forum-topic-pinned.cjs");
|
|
119
119
|
const toggleForum = require("./highlevel/methods/forums/toggle-forum.cjs");
|
|
120
120
|
const toggleGeneralTopicHidden = require("./highlevel/methods/forums/toggle-general-topic-hidden.cjs");
|
|
121
|
+
const _normalizeInputStarGift = require("./highlevel/methods/gifts/_normalize-input-star-gift.cjs");
|
|
122
|
+
const acceptStarGift = require("./highlevel/methods/gifts/accept-star-gift.cjs");
|
|
123
|
+
const buyResaleGift = require("./highlevel/methods/gifts/buy-resale-gift.cjs");
|
|
124
|
+
const getResaleStarGifts = require("./highlevel/methods/gifts/get-resale-star-gifts.cjs");
|
|
125
|
+
const getSavedStarGiftsById = require("./highlevel/methods/gifts/get-saved-star-gifts-by-id.cjs");
|
|
126
|
+
const getSavedStarGifts = require("./highlevel/methods/gifts/get-saved-star-gifts.cjs");
|
|
127
|
+
const getStarGiftOptions = require("./highlevel/methods/gifts/get-star-gift-options.cjs");
|
|
128
|
+
const getStarGiftUpgradeOptions = require("./highlevel/methods/gifts/get-star-gift-upgrade-options.cjs");
|
|
129
|
+
const getStarGiftValue = require("./highlevel/methods/gifts/get-star-gift-value.cjs");
|
|
130
|
+
const getStarGiftWithdrawalUrl = require("./highlevel/methods/gifts/get-star-gift-withdrawal-url.cjs");
|
|
131
|
+
const getUniqueStarGift = require("./highlevel/methods/gifts/get-unique-star-gift.cjs");
|
|
132
|
+
const iterSavedStarGifts = require("./highlevel/methods/gifts/iter-saved-star-gifts.cjs");
|
|
133
|
+
const pinStarGift = require("./highlevel/methods/gifts/pin-star-gift.cjs");
|
|
134
|
+
const prepayStarGiftUpgrade = require("./highlevel/methods/gifts/prepay-star-gift-upgrade.cjs");
|
|
135
|
+
const resolveStarGiftOffer = require("./highlevel/methods/gifts/resolve-star-gift-offer.cjs");
|
|
136
|
+
const sendStarGiftOffer = require("./highlevel/methods/gifts/send-star-gift-offer.cjs");
|
|
137
|
+
const sendStarGift = require("./highlevel/methods/gifts/send-star-gift.cjs");
|
|
138
|
+
const setGiftResalePrice = require("./highlevel/methods/gifts/set-gift-resale-price.cjs");
|
|
139
|
+
const transferStarGift = require("./highlevel/methods/gifts/transfer-star-gift.cjs");
|
|
140
|
+
const upgradeStarGift = require("./highlevel/methods/gifts/upgrade-star-gift.cjs");
|
|
121
141
|
const createInviteLink = require("./highlevel/methods/invite-links/create-invite-link.cjs");
|
|
122
142
|
const editInviteLink = require("./highlevel/methods/invite-links/edit-invite-link.cjs");
|
|
123
143
|
const exportInviteLink = require("./highlevel/methods/invite-links/export-invite-link.cjs");
|
|
@@ -190,10 +210,7 @@ const changeCloudPassword = require("./highlevel/methods/password/change-cloud-p
|
|
|
190
210
|
const enableCloudPassword = require("./highlevel/methods/password/enable-cloud-password.cjs");
|
|
191
211
|
const passwordEmail = require("./highlevel/methods/password/password-email.cjs");
|
|
192
212
|
const removeCloudPassword = require("./highlevel/methods/password/remove-cloud-password.cjs");
|
|
193
|
-
const _normalizeInputStarGift = require("./highlevel/methods/premium/_normalize-input-star-gift.cjs");
|
|
194
|
-
const acceptStarGift = require("./highlevel/methods/premium/accept-star-gift.cjs");
|
|
195
213
|
const applyBoost = require("./highlevel/methods/premium/apply-boost.cjs");
|
|
196
|
-
const buyResaleGift = require("./highlevel/methods/premium/buy-resale-gift.cjs");
|
|
197
214
|
const canApplyBoost = require("./highlevel/methods/premium/can-apply-boost.cjs");
|
|
198
215
|
const createBusinessChatLink = require("./highlevel/methods/premium/create-business-chat-link.cjs");
|
|
199
216
|
const editBusinessChatLink = require("./highlevel/methods/premium/edit-business-chat-link.cjs");
|
|
@@ -202,25 +219,11 @@ const getBoosts = require("./highlevel/methods/premium/get-boosts.cjs");
|
|
|
202
219
|
const getBusinessChatLinks = require("./highlevel/methods/premium/get-business-chat-links.cjs");
|
|
203
220
|
const getBusinessConnection = require("./highlevel/methods/premium/get-business-connection.cjs");
|
|
204
221
|
const getMyBoostSlots = require("./highlevel/methods/premium/get-my-boost-slots.cjs");
|
|
205
|
-
const getResaleStarGifts = require("./highlevel/methods/premium/get-resale-star-gifts.cjs");
|
|
206
|
-
const getSavedStarGiftsById = require("./highlevel/methods/premium/get-saved-star-gifts-by-id.cjs");
|
|
207
|
-
const getSavedStarGifts = require("./highlevel/methods/premium/get-saved-star-gifts.cjs");
|
|
208
|
-
const getStarGiftOptions = require("./highlevel/methods/premium/get-star-gift-options.cjs");
|
|
209
|
-
const getStarGiftValue = require("./highlevel/methods/premium/get-star-gift-value.cjs");
|
|
210
|
-
const getStarGiftWithdrawalUrl = require("./highlevel/methods/premium/get-star-gift-withdrawal-url.cjs");
|
|
211
222
|
const getStarsTransactions = require("./highlevel/methods/premium/get-stars-transactions.cjs");
|
|
212
|
-
const getUniqueStarGift = require("./highlevel/methods/premium/get-unique-star-gift.cjs");
|
|
213
223
|
const iterBoosters = require("./highlevel/methods/premium/iter-boosters.cjs");
|
|
214
|
-
const iterSavedStarGifts = require("./highlevel/methods/premium/iter-saved-star-gifts.cjs");
|
|
215
224
|
const iterStarsTransactions = require("./highlevel/methods/premium/iter-stars-transactions.cjs");
|
|
216
|
-
const pinStarGift = require("./highlevel/methods/premium/pin-star-gift.cjs");
|
|
217
|
-
const prepayStarGiftUpgrade = require("./highlevel/methods/premium/prepay-star-gift-upgrade.cjs");
|
|
218
|
-
const sendStarGift = require("./highlevel/methods/premium/send-star-gift.cjs");
|
|
219
225
|
const setBusinessIntro = require("./highlevel/methods/premium/set-business-intro.cjs");
|
|
220
226
|
const setBusinessWorkHours = require("./highlevel/methods/premium/set-business-work-hours.cjs");
|
|
221
|
-
const setGiftResalePrice = require("./highlevel/methods/premium/set-gift-resale-price.cjs");
|
|
222
|
-
const transferStarGift = require("./highlevel/methods/premium/transfer-star-gift.cjs");
|
|
223
|
-
const upgradeStarGift = require("./highlevel/methods/premium/upgrade-star-gift.cjs");
|
|
224
227
|
const addStickerToSet = require("./highlevel/methods/stickers/add-sticker-to-set.cjs");
|
|
225
228
|
const createStickerSet = require("./highlevel/methods/stickers/create-sticker-set.cjs");
|
|
226
229
|
const deleteStickerFromSet = require("./highlevel/methods/stickers/delete-sticker-from-set.cjs");
|
|
@@ -396,6 +399,26 @@ exports.toggleForumTopicClosed = toggleForumTopicClosed.toggleForumTopicClosed;
|
|
|
396
399
|
exports.toggleForumTopicPinned = toggleForumTopicPinned.toggleForumTopicPinned;
|
|
397
400
|
exports.updateForumSettings = toggleForum.updateForumSettings;
|
|
398
401
|
exports.toggleGeneralTopicHidden = toggleGeneralTopicHidden.toggleGeneralTopicHidden;
|
|
402
|
+
exports._normalizeInputStarGift = _normalizeInputStarGift._normalizeInputStarGift;
|
|
403
|
+
exports.acceptStarGift = acceptStarGift.acceptStarGift;
|
|
404
|
+
exports.buyResaleGift = buyResaleGift.buyResaleGift;
|
|
405
|
+
exports.getStarGiftResaleOptions = getResaleStarGifts.getStarGiftResaleOptions;
|
|
406
|
+
exports.getSavedStarGiftsById = getSavedStarGiftsById.getSavedStarGiftsById;
|
|
407
|
+
exports.getSavedStarGifts = getSavedStarGifts.getSavedStarGifts;
|
|
408
|
+
exports.getStarGiftOptions = getStarGiftOptions.getStarGiftOptions;
|
|
409
|
+
exports.getStarGiftUpgradeOptions = getStarGiftUpgradeOptions.getStarGiftUpgradeOptions;
|
|
410
|
+
exports.getStarGiftValue = getStarGiftValue.getStarGiftValue;
|
|
411
|
+
exports.getStarGiftWithdrawalUrl = getStarGiftWithdrawalUrl.getStarGiftWithdrawalUrl;
|
|
412
|
+
exports.getUniqueStarGift = getUniqueStarGift.getUniqueStarGift;
|
|
413
|
+
exports.iterSavedStarGifts = iterSavedStarGifts.iterSavedStarGifts;
|
|
414
|
+
exports.togglePinnedStarGifts = pinStarGift.togglePinnedStarGifts;
|
|
415
|
+
exports.prepayStarGiftUpgrade = prepayStarGiftUpgrade.prepayStarGiftUpgrade;
|
|
416
|
+
exports.resolveStarGiftOffer = resolveStarGiftOffer.resolveStarGiftOffer;
|
|
417
|
+
exports.sendStarGiftOffer = sendStarGiftOffer.sendStarGiftOffer;
|
|
418
|
+
exports.sendStarGift = sendStarGift.sendStarGift;
|
|
419
|
+
exports.setResaleStarGiftPrice = setGiftResalePrice.setResaleStarGiftPrice;
|
|
420
|
+
exports.transferStarGift = transferStarGift.transferStarGift;
|
|
421
|
+
exports.upgradeStarGift = upgradeStarGift.upgradeStarGift;
|
|
399
422
|
exports.createInviteLink = createInviteLink.createInviteLink;
|
|
400
423
|
exports.editInviteLink = editInviteLink.editInviteLink;
|
|
401
424
|
exports.exportInviteLink = exportInviteLink.exportInviteLink;
|
|
@@ -482,10 +505,7 @@ exports.cancelPasswordEmail = passwordEmail.cancelPasswordEmail;
|
|
|
482
505
|
exports.resendPasswordEmail = passwordEmail.resendPasswordEmail;
|
|
483
506
|
exports.verifyPasswordEmail = passwordEmail.verifyPasswordEmail;
|
|
484
507
|
exports.removeCloudPassword = removeCloudPassword.removeCloudPassword;
|
|
485
|
-
exports._normalizeInputStarGift = _normalizeInputStarGift._normalizeInputStarGift;
|
|
486
|
-
exports.acceptStarGift = acceptStarGift.acceptStarGift;
|
|
487
508
|
exports.applyBoost = applyBoost.applyBoost;
|
|
488
|
-
exports.buyResaleGift = buyResaleGift.buyResaleGift;
|
|
489
509
|
exports.canApplyBoost = canApplyBoost.canApplyBoost;
|
|
490
510
|
exports.createBusinessChatLink = createBusinessChatLink.createBusinessChatLink;
|
|
491
511
|
exports.deleteBusinessChatLink = editBusinessChatLink.deleteBusinessChatLink;
|
|
@@ -495,25 +515,11 @@ exports.getBoosts = getBoosts.getBoosts;
|
|
|
495
515
|
exports.getBusinessChatLinks = getBusinessChatLinks.getBusinessChatLinks;
|
|
496
516
|
exports.getBusinessConnection = getBusinessConnection.getBusinessConnection;
|
|
497
517
|
exports.getMyBoostSlots = getMyBoostSlots.getMyBoostSlots;
|
|
498
|
-
exports.getStarGiftResaleOptions = getResaleStarGifts.getStarGiftResaleOptions;
|
|
499
|
-
exports.getSavedStarGiftsById = getSavedStarGiftsById.getSavedStarGiftsById;
|
|
500
|
-
exports.getSavedStarGifts = getSavedStarGifts.getSavedStarGifts;
|
|
501
|
-
exports.getStarGiftOptions = getStarGiftOptions.getStarGiftOptions;
|
|
502
|
-
exports.getStarGiftValue = getStarGiftValue.getStarGiftValue;
|
|
503
|
-
exports.getStarGiftWithdrawalUrl = getStarGiftWithdrawalUrl.getStarGiftWithdrawalUrl;
|
|
504
518
|
exports.getStarsTransactions = getStarsTransactions.getStarsTransactions;
|
|
505
|
-
exports.getUniqueStarGift = getUniqueStarGift.getUniqueStarGift;
|
|
506
519
|
exports.iterBoosters = iterBoosters.iterBoosters;
|
|
507
|
-
exports.iterSavedStarGifts = iterSavedStarGifts.iterSavedStarGifts;
|
|
508
520
|
exports.iterStarsTransactions = iterStarsTransactions.iterStarsTransactions;
|
|
509
|
-
exports.togglePinnedStarGifts = pinStarGift.togglePinnedStarGifts;
|
|
510
|
-
exports.prepayStarGiftUpgrade = prepayStarGiftUpgrade.prepayStarGiftUpgrade;
|
|
511
|
-
exports.sendStarGift = sendStarGift.sendStarGift;
|
|
512
521
|
exports.setBusinessIntro = setBusinessIntro.setBusinessIntro;
|
|
513
522
|
exports.setBusinessWorkHours = setBusinessWorkHours.setBusinessWorkHours;
|
|
514
|
-
exports.setResaleStarGiftPrice = setGiftResalePrice.setResaleStarGiftPrice;
|
|
515
|
-
exports.transferStarGift = transferStarGift.transferStarGift;
|
|
516
|
-
exports.upgradeStarGift = upgradeStarGift.upgradeStarGift;
|
|
517
523
|
exports.addStickerToSet = addStickerToSet.addStickerToSet;
|
|
518
524
|
exports.createStickerSet = createStickerSet.createStickerSet;
|
|
519
525
|
exports.deleteStickerFromSet = deleteStickerFromSet.deleteStickerFromSet;
|
package/methods.js
CHANGED
|
@@ -111,6 +111,26 @@ import { toggleForumTopicClosed } from "./highlevel/methods/forums/toggle-forum-
|
|
|
111
111
|
import { toggleForumTopicPinned } from "./highlevel/methods/forums/toggle-forum-topic-pinned.js";
|
|
112
112
|
import { updateForumSettings } from "./highlevel/methods/forums/toggle-forum.js";
|
|
113
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";
|
|
114
134
|
import { createInviteLink } from "./highlevel/methods/invite-links/create-invite-link.js";
|
|
115
135
|
import { editInviteLink } from "./highlevel/methods/invite-links/edit-invite-link.js";
|
|
116
136
|
import { exportInviteLink } from "./highlevel/methods/invite-links/export-invite-link.js";
|
|
@@ -183,10 +203,7 @@ import { changeCloudPassword } from "./highlevel/methods/password/change-cloud-p
|
|
|
183
203
|
import { enableCloudPassword } from "./highlevel/methods/password/enable-cloud-password.js";
|
|
184
204
|
import { cancelPasswordEmail, resendPasswordEmail, verifyPasswordEmail } from "./highlevel/methods/password/password-email.js";
|
|
185
205
|
import { removeCloudPassword } from "./highlevel/methods/password/remove-cloud-password.js";
|
|
186
|
-
import { _normalizeInputStarGift } from "./highlevel/methods/premium/_normalize-input-star-gift.js";
|
|
187
|
-
import { acceptStarGift } from "./highlevel/methods/premium/accept-star-gift.js";
|
|
188
206
|
import { applyBoost } from "./highlevel/methods/premium/apply-boost.js";
|
|
189
|
-
import { buyResaleGift } from "./highlevel/methods/premium/buy-resale-gift.js";
|
|
190
207
|
import { canApplyBoost } from "./highlevel/methods/premium/can-apply-boost.js";
|
|
191
208
|
import { createBusinessChatLink } from "./highlevel/methods/premium/create-business-chat-link.js";
|
|
192
209
|
import { deleteBusinessChatLink, editBusinessChatLink } from "./highlevel/methods/premium/edit-business-chat-link.js";
|
|
@@ -195,25 +212,11 @@ import { getBoosts } from "./highlevel/methods/premium/get-boosts.js";
|
|
|
195
212
|
import { getBusinessChatLinks } from "./highlevel/methods/premium/get-business-chat-links.js";
|
|
196
213
|
import { getBusinessConnection } from "./highlevel/methods/premium/get-business-connection.js";
|
|
197
214
|
import { getMyBoostSlots } from "./highlevel/methods/premium/get-my-boost-slots.js";
|
|
198
|
-
import { getStarGiftResaleOptions } from "./highlevel/methods/premium/get-resale-star-gifts.js";
|
|
199
|
-
import { getSavedStarGiftsById } from "./highlevel/methods/premium/get-saved-star-gifts-by-id.js";
|
|
200
|
-
import { getSavedStarGifts } from "./highlevel/methods/premium/get-saved-star-gifts.js";
|
|
201
|
-
import { getStarGiftOptions } from "./highlevel/methods/premium/get-star-gift-options.js";
|
|
202
|
-
import { getStarGiftValue } from "./highlevel/methods/premium/get-star-gift-value.js";
|
|
203
|
-
import { getStarGiftWithdrawalUrl } from "./highlevel/methods/premium/get-star-gift-withdrawal-url.js";
|
|
204
215
|
import { getStarsTransactions } from "./highlevel/methods/premium/get-stars-transactions.js";
|
|
205
|
-
import { getUniqueStarGift } from "./highlevel/methods/premium/get-unique-star-gift.js";
|
|
206
216
|
import { iterBoosters } from "./highlevel/methods/premium/iter-boosters.js";
|
|
207
|
-
import { iterSavedStarGifts } from "./highlevel/methods/premium/iter-saved-star-gifts.js";
|
|
208
217
|
import { iterStarsTransactions } from "./highlevel/methods/premium/iter-stars-transactions.js";
|
|
209
|
-
import { togglePinnedStarGifts } from "./highlevel/methods/premium/pin-star-gift.js";
|
|
210
|
-
import { prepayStarGiftUpgrade } from "./highlevel/methods/premium/prepay-star-gift-upgrade.js";
|
|
211
|
-
import { sendStarGift } from "./highlevel/methods/premium/send-star-gift.js";
|
|
212
218
|
import { setBusinessIntro } from "./highlevel/methods/premium/set-business-intro.js";
|
|
213
219
|
import { setBusinessWorkHours } from "./highlevel/methods/premium/set-business-work-hours.js";
|
|
214
|
-
import { setResaleStarGiftPrice } from "./highlevel/methods/premium/set-gift-resale-price.js";
|
|
215
|
-
import { transferStarGift } from "./highlevel/methods/premium/transfer-star-gift.js";
|
|
216
|
-
import { upgradeStarGift } from "./highlevel/methods/premium/upgrade-star-gift.js";
|
|
217
220
|
import { addStickerToSet } from "./highlevel/methods/stickers/add-sticker-to-set.js";
|
|
218
221
|
import { createStickerSet } from "./highlevel/methods/stickers/create-sticker-set.js";
|
|
219
222
|
import { deleteStickerFromSet } from "./highlevel/methods/stickers/delete-sticker-from-set.js";
|
|
@@ -416,6 +419,7 @@ export {
|
|
|
416
419
|
getSimilarChannels,
|
|
417
420
|
getStarGiftOptions,
|
|
418
421
|
getStarGiftResaleOptions,
|
|
422
|
+
getStarGiftUpgradeOptions,
|
|
419
423
|
getStarGiftValue,
|
|
420
424
|
getStarGiftWithdrawalUrl,
|
|
421
425
|
getStarsTransactions,
|
|
@@ -486,6 +490,7 @@ export {
|
|
|
486
490
|
resolvePeer,
|
|
487
491
|
resolvePeerMany,
|
|
488
492
|
resolvePhoneNumber,
|
|
493
|
+
resolveStarGiftOffer,
|
|
489
494
|
resolveUser,
|
|
490
495
|
restrictChatMember,
|
|
491
496
|
revokeInviteLink,
|
|
@@ -506,6 +511,7 @@ export {
|
|
|
506
511
|
sendRecoveryCode,
|
|
507
512
|
sendScheduled,
|
|
508
513
|
sendStarGift,
|
|
514
|
+
sendStarGiftOffer,
|
|
509
515
|
sendStory,
|
|
510
516
|
sendStoryReaction,
|
|
511
517
|
sendText,
|
|
@@ -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.4",
|
|
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
|