@mtkruto/node 0.2.7 → 0.2.11

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 (75) hide show
  1. package/esm/3_types.d.ts +4 -3
  2. package/esm/3_types.d.ts.map +1 -1
  3. package/esm/3_types.js +4 -3
  4. package/esm/4_constants.d.ts +1 -1
  5. package/esm/4_constants.js +1 -1
  6. package/esm/client/0_params.d.ts +24 -0
  7. package/esm/client/0_params.d.ts.map +1 -1
  8. package/esm/client/3_message_manager.d.ts +4 -3
  9. package/esm/client/3_message_manager.d.ts.map +1 -1
  10. package/esm/client/3_message_manager.js +61 -3
  11. package/esm/client/5_client.d.ts +15 -2
  12. package/esm/client/5_client.d.ts.map +1 -1
  13. package/esm/client/5_client.js +20 -11
  14. package/esm/connection/1_connection_tcp.node.d.ts +12 -0
  15. package/esm/connection/1_connection_tcp.node.d.ts.map +1 -0
  16. package/esm/connection/1_connection_tcp.node.js +122 -0
  17. package/esm/tl/0_api.d.ts +386 -33
  18. package/esm/tl/0_api.d.ts.map +1 -1
  19. package/esm/tl/0_api.js +621 -66
  20. package/esm/transport/3_transport_provider_tcp.js +1 -1
  21. package/esm/types/0_invoice.d.ts +10 -0
  22. package/esm/types/0_invoice.d.ts.map +1 -0
  23. package/esm/types/0_invoice.js +9 -0
  24. package/{script/types/0_poll_option.d.ts → esm/types/1_poll_option.d.ts} +4 -1
  25. package/esm/types/1_poll_option.d.ts.map +1 -0
  26. package/esm/types/{0_poll_option.js → 1_poll_option.js} +3 -1
  27. package/esm/types/{1_poll.d.ts → 2_poll.d.ts} +4 -2
  28. package/esm/types/2_poll.d.ts.map +1 -0
  29. package/esm/types/{1_poll.js → 2_poll.js} +3 -2
  30. package/esm/types/4_message.d.ts +15 -2
  31. package/esm/types/4_message.d.ts.map +1 -1
  32. package/esm/types/4_message.js +7 -1
  33. package/package.json +1 -1
  34. package/script/3_types.d.ts +4 -3
  35. package/script/3_types.d.ts.map +1 -1
  36. package/script/3_types.js +4 -3
  37. package/script/4_constants.d.ts +1 -1
  38. package/script/4_constants.js +1 -1
  39. package/script/client/0_params.d.ts +24 -0
  40. package/script/client/0_params.d.ts.map +1 -1
  41. package/script/client/3_message_manager.d.ts +4 -3
  42. package/script/client/3_message_manager.d.ts.map +1 -1
  43. package/script/client/3_message_manager.js +61 -3
  44. package/script/client/5_client.d.ts +15 -2
  45. package/script/client/5_client.d.ts.map +1 -1
  46. package/script/client/5_client.js +20 -11
  47. package/script/connection/1_connection_tcp.node.d.ts +12 -0
  48. package/script/connection/1_connection_tcp.node.d.ts.map +1 -0
  49. package/script/connection/1_connection_tcp.node.js +126 -0
  50. package/script/tl/0_api.d.ts +386 -33
  51. package/script/tl/0_api.d.ts.map +1 -1
  52. package/script/tl/0_api.js +621 -66
  53. package/script/transport/3_transport_provider_tcp.js +2 -2
  54. package/script/types/0_invoice.d.ts +10 -0
  55. package/script/types/0_invoice.d.ts.map +1 -0
  56. package/script/types/0_invoice.js +13 -0
  57. package/{esm/types/0_poll_option.d.ts → script/types/1_poll_option.d.ts} +4 -1
  58. package/script/types/1_poll_option.d.ts.map +1 -0
  59. package/script/types/{0_poll_option.js → 1_poll_option.js} +3 -1
  60. package/script/types/{1_poll.d.ts → 2_poll.d.ts} +4 -2
  61. package/script/types/2_poll.d.ts.map +1 -0
  62. package/script/types/{1_poll.js → 2_poll.js} +4 -3
  63. package/script/types/4_message.d.ts +15 -2
  64. package/script/types/4_message.d.ts.map +1 -1
  65. package/script/types/4_message.js +8 -2
  66. package/esm/connection/1_connection_tcp.d.ts +0 -34
  67. package/esm/connection/1_connection_tcp.d.ts.map +0 -1
  68. package/esm/connection/1_connection_tcp.js +0 -173
  69. package/esm/types/0_poll_option.d.ts.map +0 -1
  70. package/esm/types/1_poll.d.ts.map +0 -1
  71. package/script/connection/1_connection_tcp.d.ts +0 -34
  72. package/script/connection/1_connection_tcp.d.ts.map +0 -1
  73. package/script/connection/1_connection_tcp.js +0 -200
  74. package/script/types/0_poll_option.d.ts.map +0 -1
  75. package/script/types/1_poll.d.ts.map +0 -1
@@ -2,12 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.transportProviderTcp = void 0;
4
4
  const _0_deps_js_1 = require("../0_deps.js");
5
- const _1_connection_tcp_js_1 = require("../connection/1_connection_tcp.js");
5
+ const _1_connection_tcp_node_js_1 = require("../connection/1_connection_tcp.node.js");
6
6
  const _1_transport_abridged_js_1 = require("./1_transport_abridged.js");
7
7
  const _2_transport_provider_js_1 = require("./2_transport_provider.js");
8
8
  function transportProviderTcp(params) {
9
9
  return ({ dc, cdn }) => {
10
- const connection = new _1_connection_tcp_js_1.ConnectionTCP((0, _2_transport_provider_js_1.getDcIps)(dc, params?.ipv6 ? "ipv6" : "ipv4")[0], 80);
10
+ const connection = new _1_connection_tcp_node_js_1.ConnectionTCP((0, _2_transport_provider_js_1.getDcIps)(dc, params?.ipv6 ? "ipv6" : "ipv4")[0], 80);
11
11
  if (params?.proxy) {
12
12
  const socksClient = new _0_deps_js_1.SocksClient(params.proxy);
13
13
  connection.connect = socksClient.connect.bind(socksClient);
@@ -0,0 +1,10 @@
1
+ import { Api } from "../2_tl.js";
2
+ export interface Invoice {
3
+ title: string;
4
+ description: string;
5
+ startParameter: string;
6
+ currency: string;
7
+ totalAmount: number;
8
+ }
9
+ export declare function constructInvoice(invoice: Api.messageMediaInvoice): Invoice;
10
+ //# sourceMappingURL=0_invoice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"0_invoice.d.ts","sourceRoot":"","sources":["../../src/types/0_invoice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,GAAG,CAAC,mBAAmB,GAAG,OAAO,CAQ1E"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.constructInvoice = void 0;
4
+ function constructInvoice(invoice) {
5
+ return {
6
+ title: invoice.title,
7
+ description: invoice.description,
8
+ startParameter: invoice.start_param,
9
+ currency: invoice.currency,
10
+ totalAmount: Number(invoice.total_amount),
11
+ };
12
+ }
13
+ exports.constructInvoice = constructInvoice;
@@ -18,12 +18,15 @@
18
18
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
19
  */
20
20
  import { Api } from "../2_tl.js";
21
+ import { MessageEntity } from "./0_message_entity.js";
21
22
  /** A poll option. */
22
23
  export interface PollOption {
23
24
  /** The option's text (1-100 characters). */
24
25
  text: string;
26
+ /** The entities of the option's text. */
27
+ entities: MessageEntity[];
25
28
  /** Number of users that voted this option. */
26
29
  voterCount: number;
27
30
  }
28
31
  export declare function constructPollOption(option: Api.PollAnswer, results: Array<Api.PollAnswerVoters>): PollOption;
29
- //# sourceMappingURL=0_poll_option.d.ts.map
32
+ //# sourceMappingURL=1_poll_option.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1_poll_option.d.ts","sourceRoot":"","sources":["../../src/types/1_poll_option.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAA0B,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE9E,qBAAqB;AACrB,MAAM,WAAW,UAAU;IACzB,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,8CAA8C;IAC9C,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,GAAG,UAAU,CAM5G"}
@@ -20,9 +20,11 @@
20
20
  */
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
22
  exports.constructPollOption = void 0;
23
+ const _0_message_entity_js_1 = require("./0_message_entity.js");
23
24
  function constructPollOption(option, results) {
24
25
  return {
25
- text: option.text,
26
+ text: option.text.text,
27
+ entities: option.text.entities?.map(_0_message_entity_js_1.constructMessageEntity).filter((v) => v != null),
26
28
  voterCount: results.find((v) => v.option.every((v, i) => option.option[i] == v))?.voters ?? 0,
27
29
  };
28
30
  }
@@ -19,13 +19,15 @@
19
19
  */
20
20
  import { Api } from "../2_tl.js";
21
21
  import { MessageEntity } from "./0_message_entity.js";
22
- import { PollOption } from "./0_poll_option.js";
22
+ import { PollOption } from "./1_poll_option.js";
23
23
  /** A poll. */
24
24
  export interface Poll {
25
25
  /** The identifier of the poll. */
26
26
  id: string;
27
27
  /** The poll's question. */
28
28
  question: string;
29
+ /** The entities of the poll's question. */
30
+ questionEntities: MessageEntity[];
29
31
  /** The poll's options. */
30
32
  options: PollOption[];
31
33
  /** The number of users who have participated in the poll. */
@@ -50,4 +52,4 @@ export interface Poll {
50
52
  closeDate?: Date;
51
53
  }
52
54
  export declare function constructPoll(media_: Api.messageMediaPoll): Poll;
53
- //# sourceMappingURL=1_poll.d.ts.map
55
+ //# sourceMappingURL=2_poll.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2_poll.d.ts","sourceRoot":"","sources":["../../src/types/2_poll.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAA0B,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAuB,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErE,cAAc;AACd,MAAM,WAAW,IAAI;IACnB,kCAAkC;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,2BAA2B;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,gBAAgB,EAAE,aAAa,EAAE,CAAC;IAClC,0BAA0B;IAC1B,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,6DAA6D;IAC7D,eAAe,EAAE,MAAM,CAAC;IACxB,kCAAkC;IAClC,QAAQ,EAAE,OAAO,CAAC;IAClB,qCAAqC;IACrC,WAAW,EAAE,OAAO,CAAC;IACrB,4BAA4B;IAC5B,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC;IACzB,gDAAgD;IAChD,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,mCAAmC;IACnC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,kEAAkE;IAClE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kCAAkC;IAClC,mBAAmB,CAAC,EAAE,aAAa,EAAE,CAAC;IACtC,uCAAuC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iDAAiD;IACjD,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,GAAG,CAAC,gBAAgB,GAAG,IAAI,CAqBhE"}
@@ -22,15 +22,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
22
22
  exports.constructPoll = void 0;
23
23
  const _1_utilities_js_1 = require("../1_utilities.js");
24
24
  const _0_message_entity_js_1 = require("./0_message_entity.js");
25
- const _0_poll_option_js_1 = require("./0_poll_option.js");
25
+ const _1_poll_option_js_1 = require("./1_poll_option.js");
26
26
  function constructPoll(media_) {
27
27
  const poll = media_.poll;
28
28
  const correctOption = media_.results.results?.find((v) => v.correct)?.option;
29
29
  const correctOptionId = correctOption !== undefined ? poll.answers.findIndex((v) => v.option.every((v, i) => correctOption[i] == v)) : undefined;
30
30
  return (0, _1_utilities_js_1.cleanObject)({
31
31
  id: String(poll.id),
32
- question: poll.question,
33
- options: poll.answers.map((v) => (0, _0_poll_option_js_1.constructPollOption)(v, media_.results.results ?? [])),
32
+ question: poll.question.text,
33
+ questionEntities: poll.question.entities.map(_0_message_entity_js_1.constructMessageEntity).filter((v) => v != null),
34
+ options: poll.answers.map((v) => (0, _1_poll_option_js_1.constructPollOption)(v, media_.results.results ?? [])),
34
35
  totalVoterCount: media_.results.total_voters ?? 0,
35
36
  isClosed: poll.closed || false,
36
37
  isAnonymous: !poll.public_voters,
@@ -22,6 +22,7 @@ import { Api } from "../2_tl.js";
22
22
  import { EntityGetter } from "./_getters.js";
23
23
  import { Contact } from "./0_contact.js";
24
24
  import { Dice } from "./0_dice.js";
25
+ import { Invoice } from "./0_invoice.js";
25
26
  import { LinkPreview } from "./0_link_preview.js";
26
27
  import { Location } from "./0_location.js";
27
28
  import { MessageEntity } from "./0_message_entity.js";
@@ -33,7 +34,6 @@ import { Document } from "./1_document.js";
33
34
  import { Giveaway } from "./1_giveaway.js";
34
35
  import { MessageReaction } from "./1_message_reaction.js";
35
36
  import { Photo } from "./1_photo.js";
36
- import { Poll } from "./1_poll.js";
37
37
  import { ReplyQuote } from "./1_reply_quote.js";
38
38
  import { Sticker, StickerSetNameGetter } from "./1_sticker.js";
39
39
  import { User } from "./1_user.js";
@@ -41,6 +41,7 @@ import { Venue } from "./1_venue.js";
41
41
  import { VideoNote } from "./1_video_note.js";
42
42
  import { Video } from "./1_video.js";
43
43
  import { Game } from "./2_game.js";
44
+ import { Poll } from "./2_poll.js";
44
45
  import { ReplyMarkup } from "./3_reply_markup.js";
45
46
  /**
46
47
  * Properties shared between all message types.
@@ -272,6 +273,17 @@ export interface MessagePoll extends _MessageBase {
272
273
  */
273
274
  poll: Poll;
274
275
  }
276
+ /**
277
+ * An invoice message.
278
+ * @unlisted
279
+ */
280
+ export interface MessageInvoice extends _MessageBase {
281
+ /**
282
+ * The invoice included in the message
283
+ * @discriminator
284
+ */
285
+ invoice: Invoice;
286
+ }
275
287
  /**
276
288
  * A venue message.
277
289
  * @unlisted
@@ -542,6 +554,7 @@ export interface MessageTypes {
542
554
  contact: MessageContact;
543
555
  game: MessageGame;
544
556
  poll: MessagePoll;
557
+ invoice: MessageInvoice;
545
558
  venue: MessageVenue;
546
559
  location: MessageLocation;
547
560
  newChatMembers: MessageNewChatMembers;
@@ -570,7 +583,7 @@ export interface MessageTypes {
570
583
  }
571
584
  export declare function assertMessageType<T extends keyof MessageTypes>(message: Message, type: T): MessageTypes[T];
572
585
  /** Any type of message. */
573
- export type Message = MessageText | MessageLink | MessagePhoto | MessageDocument | MessageVideo | MessageSticker | MessageAnimation | MessageVoice | MessageAudio | MessageDice | MessageVideoNote | MessageContact | MessageGame | MessagePoll | MessageVenue | MessageLocation | MessageNewChatMembers | MessageLeftChatMember | MessageNewChatTitle | MessageNewChatPhoto | MessageDeletedChatPhoto | MessageGroupCreated | MessageSupergroupCreated | MessageChannelCreated | MessageAutoDeleteTimerChanged | MessageChatMigratedTo | MessageChatMigratedFrom | MessagePinnedMessage | MessageUserShared | MessageWriteAccessAllowed | MessageForumTopicCreated | MessageForumTopicEdited | MessageForumTopicClosed | MessageForumTopicReopened | MessageVideoChatScheduled | MessageVideoChatStarted | MessageVideoChatEnded | MessageGiveaway | MessageUnsupported;
586
+ export type Message = MessageText | MessageLink | MessagePhoto | MessageDocument | MessageVideo | MessageSticker | MessageAnimation | MessageVoice | MessageAudio | MessageDice | MessageVideoNote | MessageContact | MessageGame | MessagePoll | MessageInvoice | MessageVenue | MessageLocation | MessageNewChatMembers | MessageLeftChatMember | MessageNewChatTitle | MessageNewChatPhoto | MessageDeletedChatPhoto | MessageGroupCreated | MessageSupergroupCreated | MessageChannelCreated | MessageAutoDeleteTimerChanged | MessageChatMigratedTo | MessageChatMigratedFrom | MessagePinnedMessage | MessageUserShared | MessageWriteAccessAllowed | MessageForumTopicCreated | MessageForumTopicEdited | MessageForumTopicClosed | MessageForumTopicReopened | MessageVideoChatScheduled | MessageVideoChatStarted | MessageVideoChatEnded | MessageGiveaway | MessageUnsupported;
574
587
  /** @unlisted */
575
588
  export interface MessageGetter {
576
589
  (chatId: number, messageId: number): MaybePromise<Message | null>;
@@ -1 +1 @@
1
- {"version":3,"file":"4_message.d.ts","sourceRoot":"","sources":["../../src/types/4_message.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAA6C,YAAY,EAAmB,MAAM,mBAAmB,CAAC;AAC7G,OAAO,EAAE,GAAG,EAAU,MAAM,YAAY,CAAC;AAGzC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAoB,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAiB,IAAI,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAwB,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAqB,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAA0B,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAkB,KAAK,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,SAAS,EAAsB,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,KAAK,EAAkB,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,KAAK,EAAkB,MAAM,eAAe,CAAC;AACtD,OAAO,EAAqB,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAqB,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAA4B,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAkB,KAAK,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAiB,IAAI,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAuB,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAoB,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACjF,OAAO,EAAiB,IAAI,EAAE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3B,MAAM,MAAM,OAAO,GACf,WAAW,GACX,WAAW,GACX,YAAY,GACZ,eAAe,GACf,YAAY,GACZ,cAAc,GACd,gBAAgB,GAChB,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,gBAAgB,GAChB,cAAc,GACd,WAAW,GACX,WAAW,GACX,cAAc,GACd,YAAY,GACZ,eAAe,GACf,qBAAqB,GACrB,qBAAqB,GACrB,mBAAmB,GACnB,mBAAmB,GACnB,uBAAuB,GACvB,mBAAmB,GACnB,wBAAwB,GACxB,qBAAqB,GACrB,6BAA6B,GAC7B,qBAAqB,GACrB,uBAAuB,GACvB,oBAAoB,GACpB,iBAAiB,GACjB,yBAAyB,GACzB,wBAAwB,GACxB,uBAAuB,GACvB,uBAAuB,GACvB,yBAAyB,GACzB,yBAAyB,GACzB,uBAAuB,GACvB,qBAAqB,GACrB,eAAe,GACf,kBAAkB,CAAC;AAEvB,gBAAgB;AAChB,MAAM,WAAW,aAAa;IAC5B,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,YAAY,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;CACnE;AAED,KAAK,qBAAqB,GAAG,aAAa,GAAG,IAAI,CAAC;AAqKlD,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,GAAG,CAAC,OAAO,EACrB,SAAS,EAAE,YAAY,EACvB,UAAU,EAAE,qBAAqB,EACjC,iBAAiB,EAAE,oBAAoB,EACvC,SAAS,UAAO,EAChB,QAAQ,CAAC,EAAE;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;CAAE,GAChE,OAAO,CAAC,OAAO,CAAC,CAwPlB"}
@@ -27,6 +27,7 @@ const _file_id_js_1 = require("./_file_id.js");
27
27
  const _file_id_js_2 = require("./_file_id.js");
28
28
  const _0_contact_js_1 = require("./0_contact.js");
29
29
  const _0_dice_js_1 = require("./0_dice.js");
30
+ const _0_invoice_js_1 = require("./0_invoice.js");
30
31
  const _0_link_preview_js_1 = require("./0_link_preview.js");
31
32
  const _0_location_js_1 = require("./0_location.js");
32
33
  const _0_message_entity_js_1 = require("./0_message_entity.js");
@@ -38,7 +39,6 @@ const _1_document_js_1 = require("./1_document.js");
38
39
  const _1_giveaway_js_1 = require("./1_giveaway.js");
39
40
  const _1_message_reaction_js_1 = require("./1_message_reaction.js");
40
41
  const _1_photo_js_1 = require("./1_photo.js");
41
- const _1_poll_js_1 = require("./1_poll.js");
42
42
  const _1_reply_quote_js_1 = require("./1_reply_quote.js");
43
43
  const _1_sticker_js_1 = require("./1_sticker.js");
44
44
  const _1_user_js_1 = require("./1_user.js");
@@ -46,6 +46,7 @@ const _1_venue_js_1 = require("./1_venue.js");
46
46
  const _1_video_note_js_1 = require("./1_video_note.js");
47
47
  const _1_video_js_1 = require("./1_video.js");
48
48
  const _2_game_js_1 = require("./2_game.js");
49
+ const _2_poll_js_1 = require("./2_poll.js");
49
50
  const _3_reply_markup_js_1 = require("./3_reply_markup.js");
50
51
  const L = (0, _1_utilities_js_1.getLogger)("Message");
51
52
  const keys = {
@@ -63,6 +64,7 @@ const keys = {
63
64
  contact: ["contact"],
64
65
  game: ["game"],
65
66
  poll: ["poll"],
67
+ invoice: ["invoice"],
66
68
  venue: ["venue"],
67
69
  location: ["location"],
68
70
  newChatMembers: ["newChatMembers"],
@@ -502,7 +504,7 @@ async function constructMessage(message_, getEntity, getMessage, getStickerSetNa
502
504
  m = { ...message, game };
503
505
  }
504
506
  else if ((0, _2_tl_js_1.is)("messageMediaPoll", message_.media)) {
505
- const poll = (0, _1_poll_js_1.constructPoll)(message_.media);
507
+ const poll = (0, _2_poll_js_1.constructPoll)(message_.media);
506
508
  m = { ...message, poll };
507
509
  }
508
510
  else if ((0, _2_tl_js_1.is)("messageMediaVenue", message_.media)) {
@@ -526,6 +528,10 @@ async function constructMessage(message_, getEntity, getMessage, getStickerSetNa
526
528
  const giveaway = (0, _1_giveaway_js_1.constructGiveaway)(message_.media);
527
529
  m = { ...message, giveaway };
528
530
  }
531
+ else if ((0, _2_tl_js_1.is)("messageMediaInvoice", message_.media)) {
532
+ const invoice = (0, _0_invoice_js_1.constructInvoice)(message_.media);
533
+ m = { ...message, invoice };
534
+ }
529
535
  if (m == null) {
530
536
  const unsupported = true;
531
537
  m = { ...message, unsupported };
@@ -1,34 +0,0 @@
1
- /**
2
- * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
- * Copyright (C) 2023-2024 Roj <https://roj.im/>
4
- *
5
- * This file is part of MTKruto.
6
- *
7
- * This program is free software: you can redistribute it and/or modify
8
- * it under the terms of the GNU Lesser General Public License as published by
9
- * the Free Software Foundation, either version 3 of the License, or
10
- * (at your option) any later version.
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- * GNU Lesser General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU Lesser General Public License
18
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
- */
20
- import * as dntShim from "../_dnt.shims.js";
21
- import { Connection } from "./0_connection.js";
22
- export declare class ConnectionTCP implements Connection {
23
- #private;
24
- connect: typeof dntShim.Deno.connect;
25
- stateChangeHandler?: Connection["stateChangeHandler"];
26
- callback?: Connection["callback"];
27
- constructor(hostname: string, port: number);
28
- get connected(): boolean;
29
- open(): Promise<void>;
30
- read(p: Uint8Array): Promise<void>;
31
- write(p: Uint8Array): Promise<void>;
32
- close(): void;
33
- }
34
- //# sourceMappingURL=1_connection_tcp.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"1_connection_tcp.d.ts","sourceRoot":"","sources":["../../src/connection/1_connection_tcp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAM5C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI/C,qBAAa,aAAc,YAAW,UAAU;;IAU9C,OAAO,EAAE,OAAO,OAAO,CAAC,IAAI,CAAC,OAAO,CAAwB;IAC5D,kBAAkB,CAAC,EAAE,UAAU,CAAC,oBAAoB,CAAC,CAAC;IACtD,QAAQ,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;gBAEtB,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAK1C,IAAI,SAAS,IAAI,OAAO,CAEvB;IAQK,IAAI;IA+CJ,IAAI,CAAC,CAAC,EAAE,UAAU;IAgBlB,KAAK,CAAC,CAAC,EAAE,UAAU;IA4BzB,KAAK;CAON"}
@@ -1,173 +0,0 @@
1
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
2
- if (kind === "m") throw new TypeError("Private method is not writable");
3
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
4
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
5
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
6
- };
7
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
9
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
- };
12
- var _ConnectionTCP_instances, _ConnectionTCP_hostname, _ConnectionTCP_port, _ConnectionTCP_connection, _ConnectionTCP_rMutex, _ConnectionTCP_wMutex, _ConnectionTCP_buffer, _ConnectionTCP_nextResolve, _ConnectionTCP_canRead, _ConnectionTCP_canWrite, _ConnectionTCP_assertConnected, _ConnectionTCP_rejectRead;
13
- /**
14
- * MTKruto - Cross-runtime JavaScript library for building Telegram clients
15
- * Copyright (C) 2023-2024 Roj <https://roj.im/>
16
- *
17
- * This file is part of MTKruto.
18
- *
19
- * This program is free software: you can redistribute it and/or modify
20
- * it under the terms of the GNU Lesser General Public License as published by
21
- * the Free Software Foundation, either version 3 of the License, or
22
- * (at your option) any later version.
23
- *
24
- * This program is distributed in the hope that it will be useful,
25
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
26
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27
- * GNU Lesser General Public License for more details.
28
- *
29
- * You should have received a copy of the GNU Lesser General Public License
30
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
31
- */
32
- import * as dntShim from "../_dnt.shims.js";
33
- import { concat, iterateReader } from "../0_deps.js";
34
- import { ConnectionError } from "../0_errors.js";
35
- import { getLogger, Mutex } from "../1_utilities.js";
36
- const L = getLogger("ConnectionTCP");
37
- export class ConnectionTCP {
38
- constructor(hostname, port) {
39
- _ConnectionTCP_instances.add(this);
40
- _ConnectionTCP_hostname.set(this, void 0);
41
- _ConnectionTCP_port.set(this, void 0);
42
- _ConnectionTCP_connection.set(this, void 0);
43
- _ConnectionTCP_rMutex.set(this, new Mutex());
44
- _ConnectionTCP_wMutex.set(this, new Mutex());
45
- _ConnectionTCP_buffer.set(this, new Uint8Array());
46
- _ConnectionTCP_nextResolve.set(this, null);
47
- _ConnectionTCP_canRead.set(this, false);
48
- _ConnectionTCP_canWrite.set(this, false);
49
- Object.defineProperty(this, "connect", {
50
- enumerable: true,
51
- configurable: true,
52
- writable: true,
53
- value: dntShim.Deno.connect
54
- });
55
- Object.defineProperty(this, "stateChangeHandler", {
56
- enumerable: true,
57
- configurable: true,
58
- writable: true,
59
- value: void 0
60
- });
61
- Object.defineProperty(this, "callback", {
62
- enumerable: true,
63
- configurable: true,
64
- writable: true,
65
- value: void 0
66
- });
67
- __classPrivateFieldSet(this, _ConnectionTCP_hostname, hostname, "f");
68
- __classPrivateFieldSet(this, _ConnectionTCP_port, port, "f");
69
- }
70
- get connected() {
71
- return !!__classPrivateFieldGet(this, _ConnectionTCP_connection, "f") && __classPrivateFieldGet(this, _ConnectionTCP_canRead, "f") && __classPrivateFieldGet(this, _ConnectionTCP_canWrite, "f");
72
- }
73
- async open() {
74
- if (this.connected) {
75
- throw new Error("Connection already open");
76
- }
77
- const connection = await this.connect({
78
- hostname: __classPrivateFieldGet(this, _ConnectionTCP_hostname, "f"),
79
- port: __classPrivateFieldGet(this, _ConnectionTCP_port, "f"),
80
- });
81
- connection.setNoDelay(true);
82
- connection.setKeepAlive(true);
83
- __classPrivateFieldSet(this, _ConnectionTCP_canRead, __classPrivateFieldSet(this, _ConnectionTCP_canWrite, true, "f"), "f");
84
- this.stateChangeHandler?.(true);
85
- Promise.resolve().then(async () => {
86
- do {
87
- try {
88
- for await (const chunk of iterateReader(connection)) {
89
- this.callback?.read(chunk.length);
90
- __classPrivateFieldSet(this, _ConnectionTCP_buffer, concat([__classPrivateFieldGet(this, _ConnectionTCP_buffer, "f"), chunk]), "f");
91
- if (__classPrivateFieldGet(this, _ConnectionTCP_nextResolve, "f") != null && __classPrivateFieldGet(this, _ConnectionTCP_buffer, "f").length >= __classPrivateFieldGet(this, _ConnectionTCP_nextResolve, "f")[0]) {
92
- __classPrivateFieldGet(this, _ConnectionTCP_nextResolve, "f")[1].resolve();
93
- __classPrivateFieldSet(this, _ConnectionTCP_nextResolve, null, "f");
94
- }
95
- }
96
- __classPrivateFieldSet(this, _ConnectionTCP_canRead, false, "f");
97
- break;
98
- }
99
- catch (err) {
100
- __classPrivateFieldSet(this, _ConnectionTCP_canRead, false, "f");
101
- this.stateChangeHandler?.(false);
102
- __classPrivateFieldGet(this, _ConnectionTCP_instances, "m", _ConnectionTCP_rejectRead).call(this);
103
- L.error(err);
104
- }
105
- } while (this.connected);
106
- this.stateChangeHandler?.(false);
107
- });
108
- __classPrivateFieldSet(this, _ConnectionTCP_connection, connection, "f");
109
- }
110
- async read(p) {
111
- __classPrivateFieldGet(this, _ConnectionTCP_instances, "m", _ConnectionTCP_assertConnected).call(this);
112
- const unlock = await __classPrivateFieldGet(this, _ConnectionTCP_rMutex, "f").lock();
113
- try {
114
- __classPrivateFieldGet(this, _ConnectionTCP_instances, "m", _ConnectionTCP_assertConnected).call(this);
115
- if (__classPrivateFieldGet(this, _ConnectionTCP_buffer, "f").length < p.length) {
116
- await new Promise((resolve, reject) => __classPrivateFieldSet(this, _ConnectionTCP_nextResolve, [p.length, { resolve, reject }], "f"));
117
- }
118
- const slice = __classPrivateFieldGet(this, _ConnectionTCP_buffer, "f").slice(0, p.length);
119
- p.set(slice);
120
- __classPrivateFieldSet(this, _ConnectionTCP_buffer, __classPrivateFieldGet(this, _ConnectionTCP_buffer, "f").slice(slice.length), "f");
121
- }
122
- finally {
123
- unlock();
124
- }
125
- }
126
- async write(p) {
127
- __classPrivateFieldGet(this, _ConnectionTCP_instances, "m", _ConnectionTCP_assertConnected).call(this);
128
- const unlock = await __classPrivateFieldGet(this, _ConnectionTCP_wMutex, "f").lock();
129
- try {
130
- __classPrivateFieldGet(this, _ConnectionTCP_instances, "m", _ConnectionTCP_assertConnected).call(this);
131
- let written = 0;
132
- while (written < p.length) {
133
- try {
134
- const wrote = await __classPrivateFieldGet(this, _ConnectionTCP_connection, "f").write(p.subarray(written));
135
- this.callback?.write(wrote);
136
- written += wrote;
137
- }
138
- catch (err) {
139
- if (err instanceof dntShim.Deno.errors.BrokenPipe || err instanceof dntShim.Deno.errors.ConnectionReset || (err instanceof Error && "code" in err && err.code == "EAGAIN" || err.code == "ECONNRESET")) {
140
- __classPrivateFieldSet(this, _ConnectionTCP_canWrite, false, "f");
141
- }
142
- if (!this.connected) {
143
- this.stateChangeHandler?.(false);
144
- throw new ConnectionError("Connection was closed");
145
- }
146
- else {
147
- throw err;
148
- }
149
- }
150
- }
151
- }
152
- finally {
153
- unlock();
154
- }
155
- }
156
- close() {
157
- __classPrivateFieldGet(this, _ConnectionTCP_instances, "m", _ConnectionTCP_assertConnected).call(this);
158
- __classPrivateFieldGet(this, _ConnectionTCP_connection, "f").close();
159
- __classPrivateFieldSet(this, _ConnectionTCP_canRead, __classPrivateFieldSet(this, _ConnectionTCP_canWrite, false, "f"), "f");
160
- __classPrivateFieldSet(this, _ConnectionTCP_connection, undefined, "f");
161
- __classPrivateFieldGet(this, _ConnectionTCP_instances, "m", _ConnectionTCP_rejectRead).call(this);
162
- }
163
- }
164
- _ConnectionTCP_hostname = new WeakMap(), _ConnectionTCP_port = new WeakMap(), _ConnectionTCP_connection = new WeakMap(), _ConnectionTCP_rMutex = new WeakMap(), _ConnectionTCP_wMutex = new WeakMap(), _ConnectionTCP_buffer = new WeakMap(), _ConnectionTCP_nextResolve = new WeakMap(), _ConnectionTCP_canRead = new WeakMap(), _ConnectionTCP_canWrite = new WeakMap(), _ConnectionTCP_instances = new WeakSet(), _ConnectionTCP_assertConnected = function _ConnectionTCP_assertConnected() {
165
- if (!this.connected) {
166
- throw new ConnectionError("Connection not open");
167
- }
168
- }, _ConnectionTCP_rejectRead = function _ConnectionTCP_rejectRead() {
169
- if (__classPrivateFieldGet(this, _ConnectionTCP_nextResolve, "f") != null) {
170
- __classPrivateFieldGet(this, _ConnectionTCP_nextResolve, "f")[1].reject(new ConnectionError("Connection was closed"));
171
- __classPrivateFieldSet(this, _ConnectionTCP_nextResolve, null, "f");
172
- }
173
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"0_poll_option.d.ts","sourceRoot":"","sources":["../../src/types/0_poll_option.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,qBAAqB;AACrB,MAAM,WAAW,UAAU;IACzB,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,GAAG,UAAU,CAK5G"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"1_poll.d.ts","sourceRoot":"","sources":["../../src/types/1_poll.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAA0B,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAuB,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErE,cAAc;AACd,MAAM,WAAW,IAAI;IACnB,kCAAkC;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,2BAA2B;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,0BAA0B;IAC1B,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,6DAA6D;IAC7D,eAAe,EAAE,MAAM,CAAC;IACxB,kCAAkC;IAClC,QAAQ,EAAE,OAAO,CAAC;IAClB,qCAAqC;IACrC,WAAW,EAAE,OAAO,CAAC;IACrB,4BAA4B;IAC5B,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC;IACzB,gDAAgD;IAChD,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,mCAAmC;IACnC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,kEAAkE;IAClE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kCAAkC;IAClC,mBAAmB,CAAC,EAAE,aAAa,EAAE,CAAC;IACtC,uCAAuC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iDAAiD;IACjD,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,GAAG,CAAC,gBAAgB,GAAG,IAAI,CAoBhE"}
@@ -1,34 +0,0 @@
1
- /**
2
- * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
- * Copyright (C) 2023-2024 Roj <https://roj.im/>
4
- *
5
- * This file is part of MTKruto.
6
- *
7
- * This program is free software: you can redistribute it and/or modify
8
- * it under the terms of the GNU Lesser General Public License as published by
9
- * the Free Software Foundation, either version 3 of the License, or
10
- * (at your option) any later version.
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- * GNU Lesser General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU Lesser General Public License
18
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
- */
20
- import * as dntShim from "../_dnt.shims.js";
21
- import { Connection } from "./0_connection.js";
22
- export declare class ConnectionTCP implements Connection {
23
- #private;
24
- connect: typeof dntShim.Deno.connect;
25
- stateChangeHandler?: Connection["stateChangeHandler"];
26
- callback?: Connection["callback"];
27
- constructor(hostname: string, port: number);
28
- get connected(): boolean;
29
- open(): Promise<void>;
30
- read(p: Uint8Array): Promise<void>;
31
- write(p: Uint8Array): Promise<void>;
32
- close(): void;
33
- }
34
- //# sourceMappingURL=1_connection_tcp.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"1_connection_tcp.d.ts","sourceRoot":"","sources":["../../src/connection/1_connection_tcp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAM5C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI/C,qBAAa,aAAc,YAAW,UAAU;;IAU9C,OAAO,EAAE,OAAO,OAAO,CAAC,IAAI,CAAC,OAAO,CAAwB;IAC5D,kBAAkB,CAAC,EAAE,UAAU,CAAC,oBAAoB,CAAC,CAAC;IACtD,QAAQ,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;gBAEtB,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAK1C,IAAI,SAAS,IAAI,OAAO,CAEvB;IAQK,IAAI;IA+CJ,IAAI,CAAC,CAAC,EAAE,UAAU;IAgBlB,KAAK,CAAC,CAAC,EAAE,UAAU;IA4BzB,KAAK;CAON"}