@mtkruto/node 0.2.24 → 0.2.30

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 (53) hide show
  1. package/esm/3_types.d.ts +1 -0
  2. package/esm/3_types.d.ts.map +1 -1
  3. package/esm/3_types.js +1 -0
  4. package/esm/client/0_html.d.ts.map +1 -1
  5. package/esm/client/0_html.js +3 -0
  6. package/esm/client/0_params.d.ts +4 -5
  7. package/esm/client/0_params.d.ts.map +1 -1
  8. package/esm/client/1_client_encrypted.d.ts.map +1 -1
  9. package/esm/client/1_client_encrypted.js +33 -24
  10. package/esm/client/3_message_manager.d.ts.map +1 -1
  11. package/esm/client/3_message_manager.js +14 -2
  12. package/esm/client/5_client.d.ts +16 -16
  13. package/esm/client/5_client.d.ts.map +1 -1
  14. package/esm/client/5_client.js +37 -35
  15. package/esm/types/0_failed_invitation.d.ts +19 -0
  16. package/esm/types/0_failed_invitation.d.ts.map +1 -1
  17. package/esm/types/0_failed_invitation.js +19 -0
  18. package/esm/types/0_message_entity.d.ts +1 -0
  19. package/esm/types/0_message_entity.d.ts.map +1 -1
  20. package/esm/types/0_message_entity.js +3 -2
  21. package/esm/types/2_reply_to.d.ts +35 -0
  22. package/esm/types/2_reply_to.d.ts.map +1 -0
  23. package/esm/types/2_reply_to.js +20 -0
  24. package/esm/types/3_join_request.d.ts +19 -0
  25. package/esm/types/3_join_request.d.ts.map +1 -1
  26. package/esm/types/3_join_request.js +19 -0
  27. package/package.json +1 -1
  28. package/script/3_types.d.ts +1 -0
  29. package/script/3_types.d.ts.map +1 -1
  30. package/script/3_types.js +1 -0
  31. package/script/client/0_html.d.ts.map +1 -1
  32. package/script/client/0_html.js +3 -0
  33. package/script/client/0_params.d.ts +4 -5
  34. package/script/client/0_params.d.ts.map +1 -1
  35. package/script/client/1_client_encrypted.d.ts.map +1 -1
  36. package/script/client/1_client_encrypted.js +32 -23
  37. package/script/client/3_message_manager.d.ts.map +1 -1
  38. package/script/client/3_message_manager.js +14 -2
  39. package/script/client/5_client.d.ts +16 -16
  40. package/script/client/5_client.d.ts.map +1 -1
  41. package/script/client/5_client.js +37 -35
  42. package/script/types/0_failed_invitation.d.ts +19 -0
  43. package/script/types/0_failed_invitation.d.ts.map +1 -1
  44. package/script/types/0_failed_invitation.js +19 -0
  45. package/script/types/0_message_entity.d.ts +1 -0
  46. package/script/types/0_message_entity.d.ts.map +1 -1
  47. package/script/types/0_message_entity.js +3 -2
  48. package/script/types/2_reply_to.d.ts +35 -0
  49. package/script/types/2_reply_to.d.ts.map +1 -0
  50. package/script/types/2_reply_to.js +21 -0
  51. package/script/types/3_join_request.d.ts +19 -0
  52. package/script/types/3_join_request.d.ts.map +1 -1
  53. package/script/types/3_join_request.js +19 -0
@@ -21,6 +21,7 @@
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
22
  exports.sortMessageEntities = exports.messageEntityToTlObject = exports.constructMessageEntity = void 0;
23
23
  const _0_deps_js_1 = require("../0_deps.js");
24
+ const _1_utilities_js_1 = require("../1_utilities.js");
24
25
  const _2_tl_js_1 = require("../2_tl.js");
25
26
  function constructMessageEntity(obj) {
26
27
  if ((0, _2_tl_js_1.is)("messageEntityMention", obj)) {
@@ -69,7 +70,7 @@ function constructMessageEntity(obj) {
69
70
  return { type: "strikethrough", offset: obj.offset, length: obj.length };
70
71
  }
71
72
  else if ((0, _2_tl_js_1.is)("messageEntityBlockquote", obj)) {
72
- return { type: "blockquote", offset: obj.offset, length: obj.length };
73
+ return (0, _1_utilities_js_1.cleanObject)({ type: "blockquote", offset: obj.offset, length: obj.length, collapsible: obj.collapsed ? true : undefined });
73
74
  }
74
75
  else if ((0, _2_tl_js_1.is)("messageEntityBankCard", obj)) {
75
76
  return { type: "bankCard", offset: obj.offset, length: obj.length };
@@ -141,7 +142,7 @@ async function messageEntityToTlObject(entity, getEntity) {
141
142
  case "strikethrough":
142
143
  return { _: "messageEntityStrike", offset, length };
143
144
  case "blockquote":
144
- return { _: "messageEntityBlockquote", offset, length };
145
+ return { _: "messageEntityBlockquote", offset, length, collapsed: entity.collapsible };
145
146
  case "bankCard":
146
147
  return { _: "messageEntityBankCard", offset, length };
147
148
  case "spoiler":
@@ -0,0 +1,35 @@
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 { ID } from "./0_id.js";
21
+ import { ReplyQuote } from "./1_reply_quote.js";
22
+ /** @unlisted */
23
+ export interface ReplyToMessage {
24
+ /** @discriminator */
25
+ messageId: number;
26
+ quote?: ReplyQuote;
27
+ }
28
+ /** @unlisted */
29
+ export interface ReplyToStory {
30
+ chatId: ID;
31
+ /** @discriminator */
32
+ storyId: number;
33
+ }
34
+ export type ReplyTo = ReplyToMessage | ReplyToStory;
35
+ //# sourceMappingURL=2_reply_to.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"2_reply_to.d.ts","sourceRoot":"","sources":["../../src/types/2_reply_to.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,gBAAgB;AAChB,MAAM,WAAW,cAAc;IAC7B,qBAAqB;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB;AAED,gBAAgB;AAChB,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,EAAE,CAAC;IACX,qBAAqB;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,OAAO,GAAG,cAAc,GAAG,YAAY,CAAC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ /**
3
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
4
+ * Copyright (C) 2023-2024 Roj <https://roj.im/>
5
+ *
6
+ * This file is part of MTKruto.
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU Lesser General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU Lesser General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU Lesser General Public License
19
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
20
+ */
21
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,22 @@
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
+ */
1
20
  import { Api } from "../2_tl.js";
2
21
  import { EntityGetter } from "./_getters.js";
3
22
  import { ChatP } from "./1_chat_p.js";
@@ -1 +1 @@
1
- {"version":3,"file":"3_join_request.d.ts","sourceRoot":"","sources":["../../src/types/3_join_request.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAM,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAkB,MAAM,eAAe,CAAC;AACtD,OAAO,EAAiB,IAAI,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAuB,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErE,sBAAsB;AACtB,MAAM,WAAW,WAAW;IAC1B,gDAAgD;IAChD,IAAI,EAAE,KAAK,CAAC;IACZ,0CAA0C;IAC1C,IAAI,EAAE,IAAI,CAAC;IACX,4DAA4D;IAC5D,IAAI,EAAE,IAAI,CAAC;IACX,qDAAqD;IACrD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,GAAG,CAAC,4BAA4B,EAAE,SAAS,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAmBlI"}
1
+ {"version":3,"file":"3_join_request.d.ts","sourceRoot":"","sources":["../../src/types/3_join_request.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,EAAM,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAkB,MAAM,eAAe,CAAC;AACtD,OAAO,EAAiB,IAAI,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAuB,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErE,sBAAsB;AACtB,MAAM,WAAW,WAAW;IAC1B,gDAAgD;IAChD,IAAI,EAAE,KAAK,CAAC;IACZ,0CAA0C;IAC1C,IAAI,EAAE,IAAI,CAAC;IACX,4DAA4D;IAC5D,IAAI,EAAE,IAAI,CAAC;IACX,qDAAqD;IACrD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,GAAG,CAAC,4BAA4B,EAAE,SAAS,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAmBlI"}
@@ -1,4 +1,23 @@
1
1
  "use strict";
2
+ /**
3
+ * MTKruto - Cross-runtime JavaScript library for building Telegram clients
4
+ * Copyright (C) 2023-2024 Roj <https://roj.im/>
5
+ *
6
+ * This file is part of MTKruto.
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU Lesser General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU Lesser General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU Lesser General Public License
19
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
20
+ */
2
21
  Object.defineProperty(exports, "__esModule", { value: true });
3
22
  exports.constructJoinRequest = void 0;
4
23
  const _0_deps_js_1 = require("../0_deps.js");