@mtcute/core 0.26.3 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/highlevel/methods/bots/open-webview.d.cts +1 -1
  2. package/highlevel/methods/bots/open-webview.d.ts +1 -1
  3. package/highlevel/methods/messages/append-todo-list.d.cts +1 -1
  4. package/highlevel/methods/messages/append-todo-list.d.ts +1 -1
  5. package/highlevel/methods/premium/get-resale-star-gifts.cjs +5 -5
  6. package/highlevel/methods/premium/get-resale-star-gifts.d.cts +1 -1
  7. package/highlevel/methods/premium/get-resale-star-gifts.d.ts +1 -1
  8. package/highlevel/methods/premium/get-resale-star-gifts.js +1 -1
  9. package/highlevel/methods/premium/get-saved-star-gifts-by-id.d.cts +2 -2
  10. package/highlevel/methods/premium/get-saved-star-gifts-by-id.d.ts +2 -2
  11. package/highlevel/methods/premium/get-star-gift-options.cjs +2 -2
  12. package/highlevel/methods/premium/get-star-gift-options.d.cts +1 -1
  13. package/highlevel/methods/premium/get-star-gift-options.d.ts +1 -1
  14. package/highlevel/methods/premium/get-star-gift-options.js +1 -1
  15. package/highlevel/methods/premium/get-unique-star-gift.cjs +2 -2
  16. package/highlevel/methods/premium/get-unique-star-gift.js +1 -1
  17. package/highlevel/methods/premium/pin-star-gift.d.cts +2 -2
  18. package/highlevel/methods/premium/pin-star-gift.d.ts +2 -2
  19. package/highlevel/methods/premium/send-star-gift.d.cts +2 -2
  20. package/highlevel/methods/premium/send-star-gift.d.ts +2 -2
  21. package/highlevel/types/files/utils.d.cts +1 -1
  22. package/highlevel/types/files/utils.d.ts +1 -1
  23. package/highlevel/types/media/todo.cjs +4 -4
  24. package/highlevel/types/media/todo.d.cts +2 -2
  25. package/highlevel/types/media/todo.d.ts +2 -2
  26. package/highlevel/types/media/todo.js +3 -3
  27. package/highlevel/types/messages/message-action.cjs +9 -8
  28. package/highlevel/types/messages/message-action.d.cts +8 -4
  29. package/highlevel/types/messages/message-action.d.ts +8 -4
  30. package/highlevel/types/messages/message-action.js +5 -4
  31. package/highlevel/types/messages/message.cjs +4 -0
  32. package/highlevel/types/messages/message.d.cts +2 -0
  33. package/highlevel/types/messages/message.d.ts +2 -0
  34. package/highlevel/types/messages/message.js +4 -0
  35. package/highlevel/types/messages/replied-message.d.cts +1 -1
  36. package/highlevel/types/messages/replied-message.d.ts +1 -1
  37. package/highlevel/types/peers/chat.cjs +1 -1
  38. package/highlevel/types/peers/chat.d.cts +1 -1
  39. package/highlevel/types/peers/chat.d.ts +1 -1
  40. package/highlevel/types/peers/chat.js +1 -1
  41. package/highlevel/types/peers/full-chat.cjs +1 -1
  42. package/highlevel/types/peers/full-chat.js +1 -1
  43. package/highlevel/types/peers/user.cjs +1 -1
  44. package/highlevel/types/peers/user.d.cts +1 -1
  45. package/highlevel/types/peers/user.d.ts +1 -1
  46. package/highlevel/types/peers/user.js +1 -1
  47. package/highlevel/types/premium/index.d.cts +2 -2
  48. package/highlevel/types/premium/index.d.ts +2 -2
  49. package/highlevel/types/premium/saved-star-gift.cjs +4 -4
  50. package/highlevel/types/premium/saved-star-gift.d.cts +2 -2
  51. package/highlevel/types/premium/saved-star-gift.d.ts +2 -2
  52. package/highlevel/types/premium/saved-star-gift.js +2 -2
  53. package/highlevel/types/premium/{stars-gift.cjs → star-gift.cjs} +8 -0
  54. package/highlevel/types/premium/{stars-gift.d.ts → star-gift.d.cts} +6 -1
  55. package/highlevel/types/premium/{stars-gift.d.cts → star-gift.d.ts} +6 -1
  56. package/highlevel/types/premium/{stars-gift.js → star-gift.js} +8 -0
  57. package/highlevel/types/premium/stars-transaction.cjs +8 -8
  58. package/highlevel/types/premium/stars-transaction.d.cts +3 -3
  59. package/highlevel/types/premium/stars-transaction.d.ts +3 -3
  60. package/highlevel/types/premium/stars-transaction.js +2 -2
  61. package/highlevel/types/reactions/peer-reaction.d.cts +1 -1
  62. package/highlevel/types/reactions/peer-reaction.d.ts +1 -1
  63. package/highlevel/updates/manager.d.cts +1 -1
  64. package/highlevel/updates/manager.d.ts +1 -1
  65. package/highlevel/utils/misc-utils.cjs +1 -1
  66. package/highlevel/utils/misc-utils.js +1 -1
  67. package/index.cjs +9 -9
  68. package/index.js +2 -2
  69. package/network/mtproto-session.d.cts +1 -1
  70. package/network/mtproto-session.d.ts +1 -1
  71. package/network/mtproxy/_fake-tls.d.cts +1 -1
  72. package/network/mtproxy/_fake-tls.d.ts +1 -1
  73. package/network/network-manager.cjs +1 -1
  74. package/network/network-manager.d.cts +1 -1
  75. package/network/network-manager.d.ts +1 -1
  76. package/network/network-manager.js +1 -1
  77. package/package.json +6 -6
  78. package/utils/binary/compat.cjs +2 -0
  79. package/utils/binary/compat.js +2 -0
  80. /package/highlevel/types/premium/{stars-gift-unique.cjs → star-gift-unique.cjs} +0 -0
  81. /package/highlevel/types/premium/{stars-gift-unique.d.cts → star-gift-unique.d.cts} +0 -0
  82. /package/highlevel/types/premium/{stars-gift-unique.d.ts → star-gift-unique.d.ts} +0 -0
  83. /package/highlevel/types/premium/{stars-gift-unique.js → star-gift-unique.js} +0 -0
@@ -29,7 +29,7 @@ class FullChat extends Chat$2 {
29
29
  }
30
30
  /** Whether this channel has hidden participants */
31
31
  get hasHiddenParticipants() {
32
- return this.full._ === "channelFull" && !this.full.participantsHidden;
32
+ return this.full._ === "channelFull" && this.full.participantsHidden;
33
33
  }
34
34
  /** Whether the current user can change the chat's username */
35
35
  get canSetUsername() {
@@ -352,7 +352,7 @@ class User {
352
352
  * Maximum ID of stories this user has (or 0 if none)
353
353
  */
354
354
  get storiesMaxId() {
355
- return this.raw.storiesMaxId ?? 0;
355
+ return this.raw.storiesMaxId ?? null;
356
356
  }
357
357
  /**
358
358
  * Color that should be used when rendering replies to
@@ -200,7 +200,7 @@ export declare class User {
200
200
  /**
201
201
  * Maximum ID of stories this user has (or 0 if none)
202
202
  */
203
- get storiesMaxId(): number;
203
+ get storiesMaxId(): tl.RawRecentStory | null;
204
204
  /**
205
205
  * Color that should be used when rendering replies to
206
206
  * their messages and web previews sent by them,
@@ -200,7 +200,7 @@ export declare class User {
200
200
  /**
201
201
  * Maximum ID of stories this user has (or 0 if none)
202
202
  */
203
- get storiesMaxId(): number;
203
+ get storiesMaxId(): tl.RawRecentStory | null;
204
204
  /**
205
205
  * Color that should be used when rendering replies to
206
206
  * their messages and web previews sent by them,
@@ -345,7 +345,7 @@ class User {
345
345
  * Maximum ID of stories this user has (or 0 if none)
346
346
  */
347
347
  get storiesMaxId() {
348
- return this.raw.storiesMaxId ?? 0;
348
+ return this.raw.storiesMaxId ?? null;
349
349
  }
350
350
  /**
351
351
  * Color that should be used when rendering replies to
@@ -8,8 +8,8 @@ export * from './business-intro.js';
8
8
  export * from './business-location.js';
9
9
  export * from './business-work-hours.js';
10
10
  export * from './saved-star-gift.js';
11
+ export * from './star-gift-unique.js';
11
12
  export * from './star-gift-value.js';
12
- export * from './stars-gift-unique.js';
13
- export * from './stars-gift.js';
13
+ export * from './star-gift.js';
14
14
  export * from './stars-status.js';
15
15
  export * from './stars-transaction.js';
@@ -8,8 +8,8 @@ export * from './business-intro.js';
8
8
  export * from './business-location.js';
9
9
  export * from './business-work-hours.js';
10
10
  export * from './saved-star-gift.js';
11
+ export * from './star-gift-unique.js';
11
12
  export * from './star-gift-value.js';
12
- export * from './stars-gift-unique.js';
13
- export * from './stars-gift.js';
13
+ export * from './star-gift.js';
14
14
  export * from './stars-status.js';
15
15
  export * from './stars-transaction.js';
@@ -8,8 +8,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
8
8
  const inspectable = require("../../utils/inspectable.cjs");
9
9
  const memoize = require("../../utils/memoize.cjs");
10
10
  const peer = require("../peers/peer.cjs");
11
- const starsGiftUnique = require("./stars-gift-unique.cjs");
12
- const starsGift = require("./stars-gift.cjs");
11
+ const starGiftUnique = require("./star-gift-unique.cjs");
12
+ const starGift = require("./star-gift.cjs");
13
13
  class SavedStarGift {
14
14
  constructor(raw, _peers) {
15
15
  this.raw = raw;
@@ -46,9 +46,9 @@ class SavedStarGift {
46
46
  /** The gift itself */
47
47
  get gift() {
48
48
  if (this.raw.gift._ === "starGift") {
49
- return new starsGift.StarGift(this.raw.gift, this._peers);
49
+ return new starGift.StarGift(this.raw.gift, this._peers);
50
50
  }
51
- return new starsGiftUnique.StarGiftUnique(this.raw.gift, this._peers);
51
+ return new starGiftUnique.StarGiftUnique(this.raw.gift, this._peers);
52
52
  }
53
53
  /** The attached message */
54
54
  get message() {
@@ -2,8 +2,8 @@ import { tl } from '@mtcute/tl';
2
2
  import { TextWithEntities } from '../misc/entities.js';
3
3
  import { Peer } from '../peers/peer.js';
4
4
  import { PeersIndex } from '../peers/peers-index.js';
5
- import { StarGiftUnique } from './stars-gift-unique.js';
6
- import { StarGift } from './stars-gift.js';
5
+ import { StarGiftUnique } from './star-gift-unique.js';
6
+ import { StarGift } from './star-gift.js';
7
7
  export declare class SavedStarGift {
8
8
  readonly raw: tl.RawSavedStarGift;
9
9
  readonly _peers: PeersIndex;
@@ -2,8 +2,8 @@ import { tl } from '@mtcute/tl';
2
2
  import { TextWithEntities } from '../misc/entities.js';
3
3
  import { Peer } from '../peers/peer.js';
4
4
  import { PeersIndex } from '../peers/peers-index.js';
5
- import { StarGiftUnique } from './stars-gift-unique.js';
6
- import { StarGift } from './stars-gift.js';
5
+ import { StarGiftUnique } from './star-gift-unique.js';
6
+ import { StarGift } from './star-gift.js';
7
7
  export declare class SavedStarGift {
8
8
  readonly raw: tl.RawSavedStarGift;
9
9
  readonly _peers: PeersIndex;
@@ -1,8 +1,8 @@
1
1
  import { makeInspectable } from "../../utils/inspectable.js";
2
2
  import { memoizeGetters } from "../../utils/memoize.js";
3
3
  import { parsePeer } from "../peers/peer.js";
4
- import { StarGiftUnique as StarGiftUnique$2 } from "./stars-gift-unique.js";
5
- import { StarGift as StarGift$2 } from "./stars-gift.js";
4
+ import { StarGiftUnique as StarGiftUnique$2 } from "./star-gift-unique.js";
5
+ import { StarGift as StarGift$2 } from "./star-gift.js";
6
6
  class SavedStarGift {
7
7
  constructor(raw, _peers) {
8
8
  this.raw = raw;
@@ -33,6 +33,14 @@ class StarGift {
33
33
  get isPremiumOnly() {
34
34
  return this.raw.requirePremium;
35
35
  }
36
+ /** If this gift is currently sold through an auction, info about that auction. `null` otherwise */
37
+ get action() {
38
+ if (!this.raw.auctionSlug || this.raw.giftsPerRound == null) return null;
39
+ return {
40
+ slug: this.raw.auctionSlug,
41
+ giftsPerRound: this.raw.giftsPerRound
42
+ };
43
+ }
36
44
  /** Whether this gift includes a peer color that can be applied to user's profile */
37
45
  get hasPeerColor() {
38
46
  return this.raw.peerColorAvailable;
@@ -1,9 +1,9 @@
1
1
  import { tl } from '@mtcute/tl';
2
2
  import { Sticker } from '../media/sticker.js';
3
3
  import { Message } from '../messages/message.js';
4
+ import { InputPeerLike, Peer } from '../peers/peer.js';
4
5
  import { PeersIndex } from '../peers/peers-index.js';
5
6
  import { default as Long } from 'long';
6
- import { InputPeerLike, Peer } from '../peers/peer.js';
7
7
  export type InputStarGift = {
8
8
  /** ID of the message containing the gift */
9
9
  message: number | Message;
@@ -28,6 +28,11 @@ export declare class StarGift {
28
28
  get isLimited(): boolean;
29
29
  /** Whether this gift is available only to premium users */
30
30
  get isPremiumOnly(): boolean;
31
+ /** If this gift is currently sold through an auction, info about that auction. `null` otherwise */
32
+ get action(): {
33
+ slug: string;
34
+ giftsPerRound: number;
35
+ } | null;
31
36
  /** Whether this gift includes a peer color that can be applied to user's profile */
32
37
  get hasPeerColor(): boolean;
33
38
  /** Whether this gift is a unique gift */
@@ -1,9 +1,9 @@
1
1
  import { tl } from '@mtcute/tl';
2
2
  import { Sticker } from '../media/sticker.js';
3
3
  import { Message } from '../messages/message.js';
4
+ import { InputPeerLike, Peer } from '../peers/peer.js';
4
5
  import { PeersIndex } from '../peers/peers-index.js';
5
6
  import { default as Long } from 'long';
6
- import { InputPeerLike, Peer } from '../peers/peer.js';
7
7
  export type InputStarGift = {
8
8
  /** ID of the message containing the gift */
9
9
  message: number | Message;
@@ -28,6 +28,11 @@ export declare class StarGift {
28
28
  get isLimited(): boolean;
29
29
  /** Whether this gift is available only to premium users */
30
30
  get isPremiumOnly(): boolean;
31
+ /** If this gift is currently sold through an auction, info about that auction. `null` otherwise */
32
+ get action(): {
33
+ slug: string;
34
+ giftsPerRound: number;
35
+ } | null;
31
36
  /** Whether this gift includes a peer color that can be applied to user's profile */
32
37
  get hasPeerColor(): boolean;
33
38
  /** Whether this gift is a unique gift */
@@ -26,6 +26,14 @@ class StarGift {
26
26
  get isPremiumOnly() {
27
27
  return this.raw.requirePremium;
28
28
  }
29
+ /** If this gift is currently sold through an auction, info about that auction. `null` otherwise */
30
+ get action() {
31
+ if (!this.raw.auctionSlug || this.raw.giftsPerRound == null) return null;
32
+ return {
33
+ slug: this.raw.auctionSlug,
34
+ giftsPerRound: this.raw.giftsPerRound
35
+ };
36
+ }
29
37
  /** Whether this gift includes a peer color that can be applied to user's profile */
30
38
  get hasPeerColor() {
31
39
  return this.raw.peerColorAvailable;
@@ -10,8 +10,8 @@ const memoize = require("../../utils/memoize.cjs");
10
10
  const webDocument = require("../files/web-document.cjs");
11
11
  const messageMedia = require("../messages/message-media.cjs");
12
12
  const peer = require("../peers/peer.cjs");
13
- const starsGiftUnique = require("./stars-gift-unique.cjs");
14
- const starsGift = require("./stars-gift.cjs");
13
+ const starGiftUnique = require("./star-gift-unique.cjs");
14
+ const starGift = require("./star-gift.cjs");
15
15
  class StarsTransaction {
16
16
  constructor(raw, peers) {
17
17
  this.raw = raw;
@@ -121,37 +121,37 @@ class StarsTransaction {
121
121
  return {
122
122
  type: "star_gift",
123
123
  peer: peer$1,
124
- gift: new starsGift.StarGift(this.raw.stargift, this.peers)
124
+ gift: new starGift.StarGift(this.raw.stargift, this.peers)
125
125
  };
126
126
  } else if (this.raw.stargiftUpgrade) {
127
127
  return {
128
128
  type: "star_gift_upgrade",
129
129
  peer: peer$1,
130
- gift: new starsGiftUnique.StarGiftUnique(this.raw.stargift, this.peers)
130
+ gift: new starGiftUnique.StarGiftUnique(this.raw.stargift, this.peers)
131
131
  };
132
132
  } else if (this.raw.stargiftResale) {
133
133
  return {
134
134
  type: "star_gift_resale",
135
135
  peer: peer$1,
136
- gift: new starsGiftUnique.StarGiftUnique(this.raw.stargift, this.peers)
136
+ gift: new starGiftUnique.StarGiftUnique(this.raw.stargift, this.peers)
137
137
  };
138
138
  } else if (this.raw.stargiftPrepaidUpgrade) {
139
139
  return {
140
140
  peer: peer$1,
141
- gift: new starsGiftUnique.StarGiftUnique(this.raw.stargift, this.peers),
141
+ gift: new starGiftUnique.StarGiftUnique(this.raw.stargift, this.peers),
142
142
  type: "star_gift_prepaid_upgrade"
143
143
  };
144
144
  } else if (this.raw.stargiftDropOriginalDetails) {
145
145
  return {
146
146
  type: "star_gift_drop_details",
147
147
  peer: peer$1,
148
- gift: new starsGiftUnique.StarGiftUnique(this.raw.stargift, this.peers)
148
+ gift: new starGiftUnique.StarGiftUnique(this.raw.stargift, this.peers)
149
149
  };
150
150
  } else {
151
151
  return {
152
152
  type: "star_gift_transfer",
153
153
  recipient: peer$1,
154
- gift: new starsGiftUnique.StarGiftUnique(this.raw.stargift, this.peers)
154
+ gift: new starGiftUnique.StarGiftUnique(this.raw.stargift, this.peers)
155
155
  };
156
156
  }
157
157
  }
@@ -1,11 +1,11 @@
1
1
  import { tl } from '@mtcute/tl';
2
+ import { MessageMedia } from '../messages/message-media.js';
2
3
  import { Peer } from '../peers/peer.js';
3
4
  import { PeersIndex } from '../peers/peers-index.js';
4
5
  import { User } from '../peers/user.js';
5
6
  import { WebDocument } from '../files/web-document.js';
6
- import { MessageMedia } from '../messages/message-media.js';
7
- import { StarGiftUnique } from './stars-gift-unique.js';
8
- import { StarGift } from './stars-gift.js';
7
+ import { StarGiftUnique } from './star-gift-unique.js';
8
+ import { StarGift } from './star-gift.js';
9
9
  /**
10
10
  * Type of the transaction.
11
11
  *
@@ -1,11 +1,11 @@
1
1
  import { tl } from '@mtcute/tl';
2
+ import { MessageMedia } from '../messages/message-media.js';
2
3
  import { Peer } from '../peers/peer.js';
3
4
  import { PeersIndex } from '../peers/peers-index.js';
4
5
  import { User } from '../peers/user.js';
5
6
  import { WebDocument } from '../files/web-document.js';
6
- import { MessageMedia } from '../messages/message-media.js';
7
- import { StarGiftUnique } from './stars-gift-unique.js';
8
- import { StarGift } from './stars-gift.js';
7
+ import { StarGiftUnique } from './star-gift-unique.js';
8
+ import { StarGift } from './star-gift.js';
9
9
  /**
10
10
  * Type of the transaction.
11
11
  *
@@ -3,8 +3,8 @@ import { memoizeGetters } from "../../utils/memoize.js";
3
3
  import { WebDocument as WebDocument$1 } from "../files/web-document.js";
4
4
  import { _messageMediaFromTl } from "../messages/message-media.js";
5
5
  import { parsePeer } from "../peers/peer.js";
6
- import { StarGiftUnique as StarGiftUnique$2 } from "./stars-gift-unique.js";
7
- import { StarGift as StarGift$2 } from "./stars-gift.js";
6
+ import { StarGiftUnique as StarGiftUnique$2 } from "./star-gift-unique.js";
7
+ import { StarGift as StarGift$2 } from "./star-gift.js";
8
8
  class StarsTransaction {
9
9
  constructor(raw, peers) {
10
10
  this.raw = raw;
@@ -1,7 +1,7 @@
1
1
  import { tl } from '@mtcute/tl';
2
+ import { Peer } from '../peers/peer.js';
2
3
  import { PeersIndex } from '../peers/peers-index.js';
3
4
  import { ReactionEmoji } from './types.js';
4
- import { Peer } from '../peers/peer.js';
5
5
  import { User } from '../peers/user.js';
6
6
  /**
7
7
  * Reactions of a user to a message
@@ -1,7 +1,7 @@
1
1
  import { tl } from '@mtcute/tl';
2
+ import { Peer } from '../peers/peer.js';
2
3
  import { PeersIndex } from '../peers/peers-index.js';
3
4
  import { ReactionEmoji } from './types.js';
4
- import { Peer } from '../peers/peer.js';
5
5
  import { User } from '../peers/user.js';
6
6
  /**
7
7
  * Reactions of a user to a message
@@ -1,9 +1,9 @@
1
1
  import { Logger, EarlyTimer, SortedArray } from '../../utils/index.js';
2
2
  import { BaseTelegramClient } from '../base.js';
3
+ import { PendingUpdate, PendingUpdateContainer, UpdatesManagerParams } from './types.js';
3
4
  import { AsyncLock, ConditionVariable, Deque, timers } from '@fuman/utils';
4
5
  import { tl } from '@mtcute/tl';
5
6
  import { PeersIndex } from '../types/peers/peers-index.js';
6
- import { PendingUpdate, PendingUpdateContainer, UpdatesManagerParams } from './types.js';
7
7
  export declare class UpdatesManager {
8
8
  readonly client: BaseTelegramClient;
9
9
  readonly params: UpdatesManagerParams;
@@ -1,9 +1,9 @@
1
1
  import { Logger, EarlyTimer, SortedArray } from '../../utils/index.js';
2
2
  import { BaseTelegramClient } from '../base.js';
3
+ import { PendingUpdate, PendingUpdateContainer, UpdatesManagerParams } from './types.js';
3
4
  import { AsyncLock, ConditionVariable, Deque, timers } from '@fuman/utils';
4
5
  import { tl } from '@mtcute/tl';
5
6
  import { PeersIndex } from '../types/peers/peers-index.js';
6
- import { PendingUpdate, PendingUpdateContainer, UpdatesManagerParams } from './types.js';
7
7
  export declare class UpdatesManager {
8
8
  readonly client: BaseTelegramClient;
9
9
  readonly params: UpdatesManagerParams;
@@ -12,7 +12,7 @@ function normalizePhoneNumber(phone) {
12
12
  return phone;
13
13
  }
14
14
  async function resolveMaybeDynamic(val) {
15
- return val instanceof Function ? await val() : await val;
15
+ return typeof val === "function" ? await val() : await val;
16
16
  }
17
17
  function makeArrayWithTotal(arr, total) {
18
18
  const a = arr;
@@ -5,7 +5,7 @@ function normalizePhoneNumber(phone) {
5
5
  return phone;
6
6
  }
7
7
  async function resolveMaybeDynamic(val) {
8
- return val instanceof Function ? await val() : await val;
8
+ return typeof val === "function" ? await val() : await val;
9
9
  }
10
10
  function makeArrayWithTotal(arr, total) {
11
11
  const a = arr;
package/index.cjs CHANGED
@@ -93,9 +93,9 @@ const businessIntro = require("./highlevel/types/premium/business-intro.cjs");
93
93
  const businessLocation = require("./highlevel/types/premium/business-location.cjs");
94
94
  const businessWorkHours = require("./highlevel/types/premium/business-work-hours.cjs");
95
95
  const savedStarGift = require("./highlevel/types/premium/saved-star-gift.cjs");
96
+ const starGiftUnique = require("./highlevel/types/premium/star-gift-unique.cjs");
96
97
  const starGiftValue = require("./highlevel/types/premium/star-gift-value.cjs");
97
- const starsGiftUnique = require("./highlevel/types/premium/stars-gift-unique.cjs");
98
- const starsGift = require("./highlevel/types/premium/stars-gift.cjs");
98
+ const starGift = require("./highlevel/types/premium/star-gift.cjs");
99
99
  const starsStatus = require("./highlevel/types/premium/stars-status.cjs");
100
100
  const starsTransaction = require("./highlevel/types/premium/stars-transaction.cjs");
101
101
  const emojiStatus = require("./highlevel/types/reactions/emoji-status.cjs");
@@ -107,7 +107,7 @@ const input = require("./highlevel/types/stories/interactive/input.cjs");
107
107
  const channelPost = require("./highlevel/types/stories/interactive/channel-post.cjs");
108
108
  const location$1 = require("./highlevel/types/stories/interactive/location.cjs");
109
109
  const reaction = require("./highlevel/types/stories/interactive/reaction.cjs");
110
- const starGift = require("./highlevel/types/stories/interactive/star-gift.cjs");
110
+ const starGift$1 = require("./highlevel/types/stories/interactive/star-gift.cjs");
111
111
  const url = require("./highlevel/types/stories/interactive/url.cjs");
112
112
  const venue$1 = require("./highlevel/types/stories/interactive/venue.cjs");
113
113
  const weather = require("./highlevel/types/stories/interactive/weather.cjs");
@@ -270,12 +270,12 @@ exports.BusinessLocation = businessLocation.BusinessLocation;
270
270
  exports.BusinessWorkHours = businessWorkHours.BusinessWorkHours;
271
271
  exports.businessWorkHoursDaysToRaw = businessWorkHours.businessWorkHoursDaysToRaw;
272
272
  exports.SavedStarGift = savedStarGift.SavedStarGift;
273
+ exports.StarGiftUnique = starGiftUnique.StarGiftUnique;
274
+ exports.StarGiftUniqueAttribute = starGiftUnique.StarGiftUniqueAttribute;
275
+ exports.StarGiftUniqueBackdrop = starGiftUnique.StarGiftUniqueBackdrop;
276
+ exports.StarGiftUniqueOriginalDetails = starGiftUnique.StarGiftUniqueOriginalDetails;
273
277
  exports.StarGiftValue = starGiftValue.StarGiftValue;
274
- exports.StarGiftUnique = starsGiftUnique.StarGiftUnique;
275
- exports.StarGiftUniqueAttribute = starsGiftUnique.StarGiftUniqueAttribute;
276
- exports.StarGiftUniqueBackdrop = starsGiftUnique.StarGiftUniqueBackdrop;
277
- exports.StarGiftUniqueOriginalDetails = starsGiftUnique.StarGiftUniqueOriginalDetails;
278
- exports.StarGift = starsGift.StarGift;
278
+ exports.StarGift = starGift.StarGift;
279
279
  exports.StarsStatus = starsStatus.StarsStatus;
280
280
  exports.StarsTransaction = starsTransaction.StarsTransaction;
281
281
  exports.EmojiStatus = emojiStatus.EmojiStatus;
@@ -290,7 +290,7 @@ exports.StoryElement = input.StoryElement;
290
290
  exports.StoryInteractiveChannelPost = channelPost.StoryInteractiveChannelPost;
291
291
  exports.StoryInteractiveLocation = location$1.StoryInteractiveLocation;
292
292
  exports.StoryInteractiveReaction = reaction.StoryInteractiveReaction;
293
- exports.StoryInteractiveStarGift = starGift.StoryInteractiveStarGift;
293
+ exports.StoryInteractiveStarGift = starGift$1.StoryInteractiveStarGift;
294
294
  exports.StoryInteractiveUrl = url.StoryInteractiveUrl;
295
295
  exports.StoryInteractiveVenue = venue$1.StoryInteractiveVenue;
296
296
  exports.StoryInteractiveWeather = weather.StoryInteractiveWeather;
package/index.js CHANGED
@@ -86,9 +86,9 @@ import { BusinessIntro } from "./highlevel/types/premium/business-intro.js";
86
86
  import { BusinessLocation } from "./highlevel/types/premium/business-location.js";
87
87
  import { BusinessWorkHours, businessWorkHoursDaysToRaw } from "./highlevel/types/premium/business-work-hours.js";
88
88
  import { SavedStarGift } from "./highlevel/types/premium/saved-star-gift.js";
89
+ import { StarGiftUnique, StarGiftUniqueAttribute, StarGiftUniqueBackdrop, StarGiftUniqueOriginalDetails } from "./highlevel/types/premium/star-gift-unique.js";
89
90
  import { StarGiftValue } from "./highlevel/types/premium/star-gift-value.js";
90
- import { StarGiftUnique, StarGiftUniqueAttribute, StarGiftUniqueBackdrop, StarGiftUniqueOriginalDetails } from "./highlevel/types/premium/stars-gift-unique.js";
91
- import { StarGift } from "./highlevel/types/premium/stars-gift.js";
91
+ import { StarGift } from "./highlevel/types/premium/star-gift.js";
92
92
  import { StarsStatus } from "./highlevel/types/premium/stars-status.js";
93
93
  import { StarsTransaction } from "./highlevel/types/premium/stars-transaction.js";
94
94
  import { EmojiStatus, EmojiStatusCollectible } from "./highlevel/types/reactions/emoji-status.js";
@@ -1,8 +1,8 @@
1
+ import { Deferred, Deque, LruSet, timers } from '@fuman/utils';
1
2
  import { mtp, tl } from '@mtcute/tl';
2
3
  import { TlBinaryWriter, TlReaderMap, TlWriterMap } from '@mtcute/tl-runtime';
3
4
  import { ICryptoProvider, Logger, LongMap, SortedArray } from '../utils/index.js';
4
5
  import { ServerSaltManager } from './server-salt.js';
5
- import { Deferred, Deque, LruSet, timers } from '@fuman/utils';
6
6
  import { default as Long } from 'long';
7
7
  import { AuthKey } from './auth-key.js';
8
8
  export interface PendingRpc {
@@ -1,8 +1,8 @@
1
+ import { Deferred, Deque, LruSet, timers } from '@fuman/utils';
1
2
  import { mtp, tl } from '@mtcute/tl';
2
3
  import { TlBinaryWriter, TlReaderMap, TlWriterMap } from '@mtcute/tl-runtime';
3
4
  import { ICryptoProvider, Logger, LongMap, SortedArray } from '../utils/index.js';
4
5
  import { ServerSaltManager } from './server-salt.js';
5
- import { Deferred, Deque, LruSet, timers } from '@fuman/utils';
6
6
  import { default as Long } from 'long';
7
7
  import { AuthKey } from './auth-key.js';
8
8
  export interface PendingRpc {
@@ -1,7 +1,7 @@
1
+ import { ISyncWritable, Bytes } from '@fuman/io';
1
2
  import { ICryptoProvider } from '../../utils/crypto/abstract.js';
2
3
  import { Logger } from '../../utils/logger.js';
3
4
  import { IPacketCodec } from '../transports/index.js';
4
- import { Bytes, ISyncWritable } from '@fuman/io';
5
5
  export declare function generateFakeTlsHeader(domain: Uint8Array, secret: Uint8Array, crypto: ICryptoProvider): Promise<Uint8Array>;
6
6
  /**
7
7
  * Fake TLS packet codec, used for some MTProxies.
@@ -1,7 +1,7 @@
1
+ import { ISyncWritable, Bytes } from '@fuman/io';
1
2
  import { ICryptoProvider } from '../../utils/crypto/abstract.js';
2
3
  import { Logger } from '../../utils/logger.js';
3
4
  import { IPacketCodec } from '../transports/index.js';
4
- import { Bytes, ISyncWritable } from '@fuman/io';
5
5
  export declare function generateFakeTlsHeader(domain: Uint8Array, secret: Uint8Array, crypto: ICryptoProvider): Promise<Uint8Array>;
6
6
  /**
7
7
  * Fake TLS packet codec, used for some MTProxies.
@@ -225,7 +225,7 @@ class NetworkManager {
225
225
  _: "initConnection",
226
226
  deviceModel,
227
227
  systemVersion: "1.0",
228
- appVersion: "0.26.3",
228
+ appVersion: "0.27.0",
229
229
  systemLangCode: "en",
230
230
  langPack: "",
231
231
  // "langPacks are for official apps only"
@@ -1,3 +1,4 @@
1
+ import { ReconnectionStrategy } from '@fuman/net';
1
2
  import { Middleware, Deferred } from '@fuman/utils';
2
3
  import { mtp, tl } from '@mtcute/tl';
3
4
  import { TlReaderMap, TlWriterMap } from '@mtcute/tl-runtime';
@@ -7,7 +8,6 @@ import { ICorePlatform } from '../types/platform.js';
7
8
  import { DcOptions, ICryptoProvider, Logger } from '../utils/index.js';
8
9
  import { ConfigManager } from './config-manager.js';
9
10
  import { TelegramTransport } from './transports/abstract.js';
10
- import { ReconnectionStrategy } from '@fuman/net';
11
11
  import { MultiSessionConnection } from './multi-session-connection.js';
12
12
  export type ConnectionKind = 'main' | 'upload' | 'download' | 'downloadSmall';
13
13
  /**
@@ -1,3 +1,4 @@
1
+ import { ReconnectionStrategy } from '@fuman/net';
1
2
  import { Middleware, Deferred } from '@fuman/utils';
2
3
  import { mtp, tl } from '@mtcute/tl';
3
4
  import { TlReaderMap, TlWriterMap } from '@mtcute/tl-runtime';
@@ -7,7 +8,6 @@ import { ICorePlatform } from '../types/platform.js';
7
8
  import { DcOptions, ICryptoProvider, Logger } from '../utils/index.js';
8
9
  import { ConfigManager } from './config-manager.js';
9
10
  import { TelegramTransport } from './transports/abstract.js';
10
- import { ReconnectionStrategy } from '@fuman/net';
11
11
  import { MultiSessionConnection } from './multi-session-connection.js';
12
12
  export type ConnectionKind = 'main' | 'upload' | 'download' | 'downloadSmall';
13
13
  /**
@@ -218,7 +218,7 @@ class NetworkManager {
218
218
  _: "initConnection",
219
219
  deviceModel,
220
220
  systemVersion: "1.0",
221
- appVersion: "0.26.3",
221
+ appVersion: "0.27.0",
222
222
  systemLangCode: "en",
223
223
  langPack: "",
224
224
  // "langPacks are for official apps only"
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@mtcute/core",
3
3
  "type": "module",
4
- "version": "0.26.3",
4
+ "version": "0.27.0",
5
5
  "description": "Type-safe library for MTProto (Telegram API)",
6
6
  "license": "MIT",
7
7
  "scripts": {},
8
8
  "dependencies": {
9
- "@fuman/io": "0.0.15",
10
- "@fuman/net": "0.0.15",
11
- "@fuman/utils": "0.0.15",
12
- "@mtcute/file-id": "^0.24.3",
13
- "@mtcute/tl": "^216.0.0",
9
+ "@fuman/io": "0.0.17",
10
+ "@fuman/net": "0.0.17",
11
+ "@fuman/utils": "0.0.17",
12
+ "@mtcute/file-id": "^0.27.0",
13
+ "@mtcute/tl": "^218.0.0",
14
14
  "@mtcute/tl-runtime": "^0.24.3",
15
15
  "@types/events": "3.0.0",
16
16
  "long": "5.2.3"
@@ -211,6 +211,7 @@ function mapCompatObject(obj) {
211
211
  return {
212
212
  ...obj,
213
213
  _: "user",
214
+ storiesMaxId: obj.storiesMaxId ? { _: "recentStory", maxId: obj.storiesMaxId } : void 0,
214
215
  emojiStatus: obj.emojiStatus ? mapCompatEmojiStatus(obj.emojiStatus) : void 0
215
216
  };
216
217
  case "channel_layer199":
@@ -218,6 +219,7 @@ function mapCompatObject(obj) {
218
219
  return {
219
220
  ...obj,
220
221
  _: "channel",
222
+ storiesMaxId: obj.storiesMaxId ? { _: "recentStory", maxId: obj.storiesMaxId } : void 0,
221
223
  emojiStatus: obj.emojiStatus ? mapCompatEmojiStatus(obj.emojiStatus) : void 0
222
224
  };
223
225
  case "channelFull_layer211":
@@ -204,6 +204,7 @@ function mapCompatObject(obj) {
204
204
  return {
205
205
  ...obj,
206
206
  _: "user",
207
+ storiesMaxId: obj.storiesMaxId ? { _: "recentStory", maxId: obj.storiesMaxId } : void 0,
207
208
  emojiStatus: obj.emojiStatus ? mapCompatEmojiStatus(obj.emojiStatus) : void 0
208
209
  };
209
210
  case "channel_layer199":
@@ -211,6 +212,7 @@ function mapCompatObject(obj) {
211
212
  return {
212
213
  ...obj,
213
214
  _: "channel",
215
+ storiesMaxId: obj.storiesMaxId ? { _: "recentStory", maxId: obj.storiesMaxId } : void 0,
214
216
  emojiStatus: obj.emojiStatus ? mapCompatEmojiStatus(obj.emojiStatus) : void 0
215
217
  };
216
218
  case "channelFull_layer211":