@mtcute/core 0.7.3 → 0.8.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 (1122) hide show
  1. package/README.md +26 -3
  2. package/cjs/highlevel/base.d.ts +3 -1
  3. package/cjs/highlevel/base.js +18 -0
  4. package/cjs/highlevel/base.js.map +1 -1
  5. package/cjs/highlevel/client.d.ts +23 -10
  6. package/cjs/highlevel/client.js +26 -19
  7. package/cjs/highlevel/client.js.map +1 -1
  8. package/cjs/highlevel/client.types.d.ts +14 -0
  9. package/cjs/highlevel/client.types.js.map +1 -1
  10. package/cjs/highlevel/index.d.ts +0 -2
  11. package/cjs/highlevel/index.js +0 -2
  12. package/cjs/highlevel/index.js.map +1 -1
  13. package/cjs/highlevel/methods/_imports.js.map +1 -1
  14. package/cjs/highlevel/methods/_init.js +4 -29
  15. package/cjs/highlevel/methods/_init.js.map +1 -1
  16. package/cjs/highlevel/methods/bots/get-callback-answer.js +2 -2
  17. package/cjs/highlevel/methods/bots/get-callback-answer.js.map +1 -1
  18. package/cjs/highlevel/methods/dialogs/create-folder.js +1 -1
  19. package/cjs/highlevel/methods/dialogs/create-folder.js.map +1 -1
  20. package/cjs/highlevel/methods/dialogs/edit-folder.js +1 -1
  21. package/cjs/highlevel/methods/dialogs/edit-folder.js.map +1 -1
  22. package/cjs/highlevel/methods/dialogs/find-folder.js +1 -1
  23. package/cjs/highlevel/methods/dialogs/find-folder.js.map +1 -1
  24. package/cjs/highlevel/methods/dialogs/get-folders.d.ts +1 -1
  25. package/cjs/highlevel/methods/dialogs/get-folders.js +1 -1
  26. package/cjs/highlevel/methods/dialogs/get-folders.js.map +1 -1
  27. package/cjs/highlevel/methods/files/download-file.d.ts +1 -10
  28. package/cjs/highlevel/methods/files/download-file.js +1 -32
  29. package/cjs/highlevel/methods/files/download-file.js.map +1 -1
  30. package/cjs/highlevel/methods/files/download-iterable.js +2 -1
  31. package/cjs/highlevel/methods/files/download-iterable.js.map +1 -1
  32. package/cjs/highlevel/methods/files/download-node-stream.js +4 -0
  33. package/cjs/highlevel/methods/files/download-node-stream.js.map +1 -0
  34. package/cjs/highlevel/methods/files/normalize-input-media.d.ts +1 -1
  35. package/cjs/highlevel/methods/files/normalize-input-media.js +2 -1
  36. package/cjs/highlevel/methods/files/normalize-input-media.js.map +1 -1
  37. package/cjs/highlevel/methods/files/upload-file.d.ts +0 -3
  38. package/cjs/highlevel/methods/files/upload-file.js +17 -13
  39. package/cjs/highlevel/methods/files/upload-file.js.map +1 -1
  40. package/cjs/highlevel/methods/messages/find-in-update.js +23 -8
  41. package/cjs/highlevel/methods/messages/find-in-update.js.map +1 -1
  42. package/cjs/highlevel/methods/messages/send-media-group.d.ts +1 -1
  43. package/cjs/highlevel/methods/messages/send-media-group.js.map +1 -1
  44. package/cjs/highlevel/methods/messages/send-media.d.ts +2 -2
  45. package/cjs/highlevel/methods/messages/send-media.js +5 -4
  46. package/cjs/highlevel/methods/messages/send-media.js.map +1 -1
  47. package/cjs/highlevel/methods/messages/send-text.d.ts +1 -1
  48. package/cjs/highlevel/methods/messages/send-text.js +7 -6
  49. package/cjs/highlevel/methods/messages/send-text.js.map +1 -1
  50. package/cjs/highlevel/methods/misc/with-params.d.ts +10 -0
  51. package/cjs/highlevel/methods/misc/with-params.js +32 -0
  52. package/cjs/highlevel/methods/misc/with-params.js.map +1 -0
  53. package/cjs/highlevel/methods.d.ts +13 -1
  54. package/cjs/highlevel/methods.js +4 -6
  55. package/cjs/highlevel/methods.js.map +1 -1
  56. package/cjs/highlevel/types/bots/command-scope/index.d.ts +10 -0
  57. package/cjs/highlevel/types/bots/command-scope/index.js +29 -0
  58. package/cjs/highlevel/types/bots/command-scope/index.js.map +1 -0
  59. package/cjs/highlevel/types/bots/command-scope/inner.d.ts +54 -0
  60. package/cjs/highlevel/types/bots/command-scope/inner.js +76 -0
  61. package/cjs/highlevel/types/bots/command-scope/inner.js.map +1 -0
  62. package/cjs/highlevel/types/bots/index.d.ts +4 -4
  63. package/cjs/highlevel/types/bots/index.js +4 -4
  64. package/cjs/highlevel/types/bots/index.js.map +1 -1
  65. package/cjs/highlevel/types/bots/inline-message/factories.d.ts +43 -0
  66. package/cjs/highlevel/types/bots/inline-message/factories.js +175 -0
  67. package/cjs/highlevel/types/bots/inline-message/factories.js.map +1 -0
  68. package/cjs/highlevel/types/bots/inline-message/index.d.ts +3 -0
  69. package/cjs/highlevel/types/bots/inline-message/index.js +33 -0
  70. package/cjs/highlevel/types/bots/inline-message/index.js.map +1 -0
  71. package/{esm/highlevel/types/bots/input/input-inline-message.d.ts → cjs/highlevel/types/bots/inline-message/types.d.ts} +2 -45
  72. package/cjs/highlevel/types/bots/inline-message/types.js +3 -0
  73. package/cjs/highlevel/types/bots/inline-message/types.js.map +1 -0
  74. package/cjs/highlevel/types/bots/inline-result/factories.d.ts +94 -0
  75. package/cjs/highlevel/types/bots/inline-result/factories.js +486 -0
  76. package/cjs/highlevel/types/bots/inline-result/factories.js.map +1 -0
  77. package/cjs/highlevel/types/bots/inline-result/index.d.ts +3 -0
  78. package/cjs/highlevel/types/bots/inline-result/index.js +33 -0
  79. package/cjs/highlevel/types/bots/inline-result/index.js.map +1 -0
  80. package/{esm/highlevel/types/bots/input/input-inline-result.d.ts → cjs/highlevel/types/bots/inline-result/types.d.ts} +1 -95
  81. package/cjs/highlevel/types/bots/inline-result/types.js +3 -0
  82. package/cjs/highlevel/types/bots/inline-result/types.js.map +1 -0
  83. package/cjs/highlevel/types/bots/{keyboard-builder.d.ts → keyboards/builder.d.ts} +1 -1
  84. package/cjs/highlevel/types/bots/{keyboard-builder.js → keyboards/builder.js} +1 -1
  85. package/cjs/highlevel/types/bots/keyboards/builder.js.map +1 -0
  86. package/cjs/highlevel/types/bots/keyboards/factories.d.ts +195 -0
  87. package/cjs/highlevel/types/bots/keyboards/factories.js +366 -0
  88. package/cjs/highlevel/types/bots/keyboards/factories.js.map +1 -0
  89. package/cjs/highlevel/types/bots/keyboards/index.d.ts +14 -0
  90. package/cjs/highlevel/types/bots/keyboards/index.js +33 -0
  91. package/cjs/highlevel/types/bots/keyboards/index.js.map +1 -0
  92. package/cjs/highlevel/types/bots/keyboards/types.d.ts +34 -0
  93. package/cjs/highlevel/types/bots/keyboards/types.js +3 -0
  94. package/cjs/highlevel/types/bots/keyboards/types.js.map +1 -0
  95. package/cjs/highlevel/types/media/document.js +3 -2
  96. package/cjs/highlevel/types/media/document.js.map +1 -1
  97. package/cjs/highlevel/types/media/index.d.ts +1 -1
  98. package/cjs/highlevel/types/media/index.js +1 -1
  99. package/cjs/highlevel/types/media/index.js.map +1 -1
  100. package/cjs/highlevel/types/media/input-media/factories.d.ts +141 -0
  101. package/cjs/highlevel/types/media/input-media/factories.js +250 -0
  102. package/cjs/highlevel/types/media/input-media/factories.js.map +1 -0
  103. package/cjs/highlevel/types/media/input-media/index.d.ts +3 -0
  104. package/cjs/highlevel/types/media/input-media/index.js +33 -0
  105. package/cjs/highlevel/types/media/input-media/index.js.map +1 -0
  106. package/cjs/highlevel/types/media/{input-media.d.ts → input-media/types.d.ts} +5 -145
  107. package/cjs/highlevel/types/media/input-media/types.js +3 -0
  108. package/cjs/highlevel/types/media/input-media/types.js.map +1 -0
  109. package/cjs/highlevel/types/media/thumbnail.js +5 -4
  110. package/cjs/highlevel/types/media/thumbnail.js.map +1 -1
  111. package/cjs/highlevel/types/messages/message.d.ts +1 -1
  112. package/cjs/highlevel/types/messages/message.js +3 -3
  113. package/cjs/highlevel/types/messages/message.js.map +1 -1
  114. package/cjs/highlevel/types/misc/index.d.ts +1 -1
  115. package/cjs/highlevel/types/misc/index.js +1 -1
  116. package/cjs/highlevel/types/misc/index.js.map +1 -1
  117. package/cjs/highlevel/types/misc/input-privacy-rule/allow.d.ts +22 -0
  118. package/cjs/highlevel/types/misc/input-privacy-rule/allow.js +36 -0
  119. package/cjs/highlevel/types/misc/input-privacy-rule/allow.js.map +1 -0
  120. package/cjs/highlevel/types/misc/input-privacy-rule/bundle.d.ts +3 -0
  121. package/cjs/highlevel/types/misc/input-privacy-rule/bundle.js +31 -0
  122. package/cjs/highlevel/types/misc/input-privacy-rule/bundle.js.map +1 -0
  123. package/cjs/highlevel/types/misc/input-privacy-rule/disallow.d.ts +20 -0
  124. package/cjs/highlevel/types/misc/input-privacy-rule/disallow.js +32 -0
  125. package/cjs/highlevel/types/misc/input-privacy-rule/disallow.js.map +1 -0
  126. package/cjs/highlevel/types/misc/input-privacy-rule/index.d.ts +3 -0
  127. package/cjs/highlevel/types/misc/input-privacy-rule/index.js +33 -0
  128. package/cjs/highlevel/types/misc/input-privacy-rule/index.js.map +1 -0
  129. package/cjs/highlevel/types/misc/input-privacy-rule/types.d.ts +11 -0
  130. package/cjs/highlevel/types/misc/input-privacy-rule/types.js +3 -0
  131. package/cjs/highlevel/types/misc/input-privacy-rule/types.js.map +1 -0
  132. package/cjs/highlevel/types/peers/chat-photo.js +3 -2
  133. package/cjs/highlevel/types/peers/chat-photo.js.map +1 -1
  134. package/cjs/highlevel/types/updates/callback-query.js +2 -2
  135. package/cjs/highlevel/types/updates/callback-query.js.map +1 -1
  136. package/cjs/highlevel/types/updates/user-status-update.js +1 -1
  137. package/cjs/highlevel/types/updates/user-status-update.js.map +1 -1
  138. package/cjs/highlevel/updates/manager.d.ts +5 -3
  139. package/cjs/highlevel/updates/manager.js +81 -67
  140. package/cjs/highlevel/updates/manager.js.map +1 -1
  141. package/cjs/highlevel/utils/convert-file-id.js +7 -6
  142. package/cjs/highlevel/utils/convert-file-id.js.map +1 -1
  143. package/cjs/highlevel/utils/file-utils.js +8 -4
  144. package/cjs/highlevel/utils/file-utils.js.map +1 -1
  145. package/cjs/highlevel/utils/inline-utils.js +3 -2
  146. package/cjs/highlevel/utils/inline-utils.js.map +1 -1
  147. package/cjs/highlevel/utils/inspectable.d.ts +1 -1
  148. package/cjs/highlevel/utils/inspectable.js +3 -2
  149. package/cjs/highlevel/utils/inspectable.js.map +1 -1
  150. package/cjs/highlevel/utils/memoize.d.ts +1 -1
  151. package/cjs/highlevel/utils/memoize.js +1 -0
  152. package/cjs/highlevel/utils/memoize.js.map +1 -1
  153. package/cjs/highlevel/utils/stream-utils.d.ts +0 -2
  154. package/cjs/highlevel/utils/stream-utils.js +1 -28
  155. package/cjs/highlevel/utils/stream-utils.js.map +1 -1
  156. package/cjs/highlevel/utils/string-session.js +3 -2
  157. package/cjs/highlevel/utils/string-session.js.map +1 -1
  158. package/cjs/highlevel/worker/index.d.ts +3 -0
  159. package/cjs/highlevel/{types/bots/input → worker}/index.js +3 -2
  160. package/cjs/highlevel/worker/index.js.map +1 -0
  161. package/cjs/highlevel/worker/port.d.ts +6 -3
  162. package/cjs/highlevel/worker/port.js +8 -2
  163. package/cjs/highlevel/worker/port.js.map +1 -1
  164. package/cjs/highlevel/worker/protocol.d.ts +5 -1
  165. package/cjs/highlevel/worker/protocol.js.map +1 -1
  166. package/cjs/highlevel/worker/worker.d.ts +11 -4
  167. package/cjs/highlevel/worker/worker.js +53 -49
  168. package/cjs/highlevel/worker/worker.js.map +1 -1
  169. package/cjs/network/client.d.ts +4 -4
  170. package/cjs/network/client.js +3 -1
  171. package/cjs/network/client.js.map +1 -1
  172. package/cjs/network/multi-session-connection.d.ts +1 -0
  173. package/cjs/network/multi-session-connection.js +6 -0
  174. package/cjs/network/multi-session-connection.js.map +1 -1
  175. package/cjs/network/network-manager.d.ts +5 -1
  176. package/cjs/network/network-manager.js +24 -15
  177. package/cjs/network/network-manager.js.map +1 -1
  178. package/cjs/network/persistent-connection.d.ts +3 -0
  179. package/cjs/network/persistent-connection.js +23 -1
  180. package/cjs/network/persistent-connection.js.map +1 -1
  181. package/cjs/network/session-connection.d.ts +2 -0
  182. package/cjs/network/session-connection.js +18 -4
  183. package/cjs/network/session-connection.js.map +1 -1
  184. package/cjs/network/transports/index.d.ts +0 -3
  185. package/cjs/network/transports/index.js +0 -4
  186. package/cjs/network/transports/index.js.map +1 -1
  187. package/cjs/platform.d.ts +18 -0
  188. package/cjs/platform.js +36 -0
  189. package/cjs/platform.js.map +1 -0
  190. package/cjs/storage/index.d.ts +1 -2
  191. package/cjs/storage/index.js +1 -2
  192. package/cjs/storage/index.js.map +1 -1
  193. package/{esm/storage/providers → cjs/storage}/memory/driver.d.ts +1 -1
  194. package/cjs/storage/memory/driver.js.map +1 -0
  195. package/{esm/storage/providers → cjs/storage}/memory/index.d.ts +2 -2
  196. package/cjs/storage/memory/index.js.map +1 -0
  197. package/cjs/storage/{providers/memory → memory}/repository/auth-keys.d.ts +1 -1
  198. package/cjs/storage/memory/repository/auth-keys.js.map +1 -0
  199. package/{esm/storage/providers → cjs/storage}/memory/repository/kv.d.ts +1 -1
  200. package/cjs/storage/memory/repository/kv.js.map +1 -0
  201. package/{esm/storage/providers → cjs/storage}/memory/repository/peers.d.ts +1 -1
  202. package/cjs/storage/memory/repository/peers.js.map +1 -0
  203. package/{esm/storage/providers → cjs/storage}/memory/repository/ref-messages.d.ts +1 -1
  204. package/cjs/storage/memory/repository/ref-messages.js.map +1 -0
  205. package/cjs/storage/storage.js +2 -1
  206. package/cjs/storage/storage.js.map +1 -1
  207. package/cjs/utils/binary/asn1-parser.js +3 -3
  208. package/cjs/utils/binary/asn1-parser.js.map +1 -1
  209. package/cjs/utils/crypto/abstract.d.ts +0 -1
  210. package/cjs/utils/crypto/abstract.js.map +1 -1
  211. package/cjs/utils/crypto/index.d.ts +0 -2
  212. package/cjs/utils/crypto/index.js +0 -3
  213. package/cjs/utils/crypto/index.js.map +1 -1
  214. package/cjs/utils/crypto/keys.js +5 -3
  215. package/cjs/utils/crypto/keys.js.map +1 -1
  216. package/cjs/utils/crypto/password.js +3 -3
  217. package/cjs/utils/crypto/password.js.map +1 -1
  218. package/cjs/utils/dcs.d.ts +4 -0
  219. package/cjs/utils/dcs.js +0 -4
  220. package/cjs/utils/dcs.js.map +1 -1
  221. package/cjs/utils/{platform/error-reporting.d.ts → error-reporting.d.ts} +1 -1
  222. package/cjs/utils/error-reporting.js.map +1 -0
  223. package/cjs/utils/index.d.ts +4 -1
  224. package/cjs/utils/index.js +6 -1
  225. package/cjs/utils/index.js.map +1 -1
  226. package/cjs/utils/links/common.js +1 -1
  227. package/cjs/utils/links/common.js.map +1 -1
  228. package/cjs/utils/logger.d.ts +1 -0
  229. package/cjs/utils/logger.js +9 -22
  230. package/cjs/utils/logger.js.map +1 -1
  231. package/esm/highlevel/base.d.ts +3 -1
  232. package/esm/highlevel/base.js +18 -0
  233. package/esm/highlevel/base.js.map +1 -1
  234. package/esm/highlevel/client.d.ts +23 -10
  235. package/esm/highlevel/client.js +12 -19
  236. package/esm/highlevel/client.js.map +1 -1
  237. package/esm/highlevel/client.types.d.ts +14 -0
  238. package/esm/highlevel/client.types.js.map +1 -1
  239. package/esm/highlevel/index.d.ts +0 -2
  240. package/esm/highlevel/index.js +0 -2
  241. package/esm/highlevel/index.js.map +1 -1
  242. package/esm/highlevel/methods/_imports.js.map +1 -1
  243. package/esm/highlevel/methods/_init.js +4 -29
  244. package/esm/highlevel/methods/_init.js.map +1 -1
  245. package/esm/highlevel/methods/bots/get-callback-answer.js +2 -2
  246. package/esm/highlevel/methods/bots/get-callback-answer.js.map +1 -1
  247. package/esm/highlevel/methods/dialogs/create-folder.js +1 -1
  248. package/esm/highlevel/methods/dialogs/create-folder.js.map +1 -1
  249. package/esm/highlevel/methods/dialogs/edit-folder.js +1 -1
  250. package/esm/highlevel/methods/dialogs/edit-folder.js.map +1 -1
  251. package/esm/highlevel/methods/dialogs/find-folder.js +1 -1
  252. package/esm/highlevel/methods/dialogs/find-folder.js.map +1 -1
  253. package/esm/highlevel/methods/dialogs/get-folders.d.ts +1 -1
  254. package/esm/highlevel/methods/dialogs/get-folders.js +1 -1
  255. package/esm/highlevel/methods/dialogs/get-folders.js.map +1 -1
  256. package/esm/highlevel/methods/files/download-file.d.ts +1 -10
  257. package/esm/highlevel/methods/files/download-file.js +2 -30
  258. package/esm/highlevel/methods/files/download-file.js.map +1 -1
  259. package/esm/highlevel/methods/files/download-iterable.js +2 -1
  260. package/esm/highlevel/methods/files/download-iterable.js.map +1 -1
  261. package/esm/highlevel/methods/files/download-node-stream.js +3 -0
  262. package/esm/highlevel/methods/files/download-node-stream.js.map +1 -0
  263. package/esm/highlevel/methods/files/normalize-input-media.d.ts +1 -1
  264. package/esm/highlevel/methods/files/normalize-input-media.js +2 -1
  265. package/esm/highlevel/methods/files/normalize-input-media.js.map +1 -1
  266. package/esm/highlevel/methods/files/upload-file.d.ts +0 -3
  267. package/esm/highlevel/methods/files/upload-file.js +17 -13
  268. package/esm/highlevel/methods/files/upload-file.js.map +1 -1
  269. package/esm/highlevel/methods/messages/find-in-update.js +23 -8
  270. package/esm/highlevel/methods/messages/find-in-update.js.map +1 -1
  271. package/esm/highlevel/methods/messages/send-media-group.d.ts +1 -1
  272. package/esm/highlevel/methods/messages/send-media-group.js.map +1 -1
  273. package/esm/highlevel/methods/messages/send-media.d.ts +2 -2
  274. package/esm/highlevel/methods/messages/send-media.js +4 -3
  275. package/esm/highlevel/methods/messages/send-media.js.map +1 -1
  276. package/esm/highlevel/methods/messages/send-text.d.ts +1 -1
  277. package/esm/highlevel/methods/messages/send-text.js +4 -3
  278. package/esm/highlevel/methods/messages/send-text.js.map +1 -1
  279. package/esm/highlevel/methods/misc/with-params.d.ts +10 -0
  280. package/esm/highlevel/methods/misc/with-params.js +28 -0
  281. package/esm/highlevel/methods/misc/with-params.js.map +1 -0
  282. package/esm/highlevel/methods.d.ts +13 -1
  283. package/esm/highlevel/methods.js +0 -1
  284. package/esm/highlevel/methods.js.map +1 -1
  285. package/esm/highlevel/types/auth/sent-code.js +4 -3
  286. package/esm/highlevel/types/bots/command-scope/index.d.ts +10 -0
  287. package/esm/highlevel/types/bots/command-scope/index.js +11 -0
  288. package/esm/highlevel/types/bots/command-scope/index.js.map +1 -0
  289. package/esm/highlevel/types/bots/command-scope/inner.d.ts +54 -0
  290. package/esm/highlevel/types/bots/command-scope/inner.js +69 -0
  291. package/esm/highlevel/types/bots/command-scope/inner.js.map +1 -0
  292. package/esm/highlevel/types/bots/game-high-score.js +5 -4
  293. package/esm/highlevel/types/bots/index.d.ts +4 -4
  294. package/esm/highlevel/types/bots/index.js +4 -4
  295. package/esm/highlevel/types/bots/index.js.map +1 -1
  296. package/esm/highlevel/types/bots/inline-message/factories.d.ts +43 -0
  297. package/esm/highlevel/types/bots/inline-message/factories.js +163 -0
  298. package/esm/highlevel/types/bots/inline-message/factories.js.map +1 -0
  299. package/esm/highlevel/types/bots/inline-message/index.d.ts +3 -0
  300. package/esm/highlevel/types/bots/inline-message/index.js +4 -0
  301. package/esm/highlevel/types/bots/inline-message/index.js.map +1 -0
  302. package/{cjs/highlevel/types/bots/input/input-inline-message.d.ts → esm/highlevel/types/bots/inline-message/types.d.ts} +2 -45
  303. package/esm/highlevel/types/bots/inline-message/types.js +2 -0
  304. package/esm/highlevel/types/bots/inline-message/types.js.map +1 -0
  305. package/esm/highlevel/types/bots/inline-result/factories.d.ts +94 -0
  306. package/esm/highlevel/types/bots/inline-result/factories.js +470 -0
  307. package/esm/highlevel/types/bots/inline-result/factories.js.map +1 -0
  308. package/esm/highlevel/types/bots/inline-result/index.d.ts +3 -0
  309. package/esm/highlevel/types/bots/inline-result/index.js +4 -0
  310. package/esm/highlevel/types/bots/inline-result/index.js.map +1 -0
  311. package/{cjs/highlevel/types/bots/input/input-inline-result.d.ts → esm/highlevel/types/bots/inline-result/types.d.ts} +1 -95
  312. package/esm/highlevel/types/bots/inline-result/types.js +2 -0
  313. package/esm/highlevel/types/bots/inline-result/types.js.map +1 -0
  314. package/esm/highlevel/types/bots/{keyboard-builder.d.ts → keyboards/builder.d.ts} +1 -1
  315. package/esm/highlevel/types/bots/{keyboard-builder.js → keyboards/builder.js} +1 -1
  316. package/esm/highlevel/types/bots/keyboards/builder.js.map +1 -0
  317. package/esm/highlevel/types/bots/keyboards/factories.d.ts +195 -0
  318. package/esm/highlevel/types/bots/keyboards/factories.js +341 -0
  319. package/esm/highlevel/types/bots/keyboards/factories.js.map +1 -0
  320. package/esm/highlevel/types/bots/keyboards/index.d.ts +14 -0
  321. package/esm/highlevel/types/bots/keyboards/index.js +15 -0
  322. package/esm/highlevel/types/bots/keyboards/index.js.map +1 -0
  323. package/esm/highlevel/types/bots/keyboards/types.d.ts +34 -0
  324. package/esm/highlevel/types/bots/keyboards/types.js +2 -0
  325. package/esm/highlevel/types/bots/keyboards/types.js.map +1 -0
  326. package/esm/highlevel/types/files/file-location.js +4 -3
  327. package/esm/highlevel/types/files/web-document.js +4 -3
  328. package/esm/highlevel/types/media/audio.js +5 -4
  329. package/esm/highlevel/types/media/contact.js +4 -3
  330. package/esm/highlevel/types/media/dice.js +4 -3
  331. package/esm/highlevel/types/media/document.js +8 -6
  332. package/esm/highlevel/types/media/document.js.map +1 -1
  333. package/esm/highlevel/types/media/game.js +5 -4
  334. package/esm/highlevel/types/media/index.d.ts +1 -1
  335. package/esm/highlevel/types/media/index.js +1 -1
  336. package/esm/highlevel/types/media/index.js.map +1 -1
  337. package/esm/highlevel/types/media/input-media/factories.d.ts +141 -0
  338. package/esm/highlevel/types/media/input-media/factories.js +228 -0
  339. package/esm/highlevel/types/media/input-media/factories.js.map +1 -0
  340. package/esm/highlevel/types/media/input-media/index.d.ts +3 -0
  341. package/esm/highlevel/types/media/input-media/index.js +4 -0
  342. package/esm/highlevel/types/media/input-media/index.js.map +1 -0
  343. package/esm/highlevel/types/media/{input-media.d.ts → input-media/types.d.ts} +5 -145
  344. package/esm/highlevel/types/media/input-media/types.js +2 -0
  345. package/esm/highlevel/types/media/input-media/types.js.map +1 -0
  346. package/esm/highlevel/types/media/invoice.js +9 -7
  347. package/esm/highlevel/types/media/location.js +7 -5
  348. package/esm/highlevel/types/media/photo.js +5 -4
  349. package/esm/highlevel/types/media/poll.js +5 -4
  350. package/esm/highlevel/types/media/sticker.js +5 -4
  351. package/esm/highlevel/types/media/story.js +4 -3
  352. package/esm/highlevel/types/media/thumbnail.js +10 -8
  353. package/esm/highlevel/types/media/thumbnail.js.map +1 -1
  354. package/esm/highlevel/types/media/venue.js +5 -4
  355. package/esm/highlevel/types/media/video.js +5 -4
  356. package/esm/highlevel/types/media/voice.js +5 -4
  357. package/esm/highlevel/types/media/web-page.js +5 -4
  358. package/esm/highlevel/types/messages/dialog.js +5 -4
  359. package/esm/highlevel/types/messages/draft-message.js +5 -4
  360. package/esm/highlevel/types/messages/message-entity.js +5 -4
  361. package/esm/highlevel/types/messages/message-forward.js +5 -4
  362. package/esm/highlevel/types/messages/message-reactions.js +5 -4
  363. package/esm/highlevel/types/messages/message-replies.js +5 -4
  364. package/esm/highlevel/types/messages/message.d.ts +1 -1
  365. package/esm/highlevel/types/messages/message.js +6 -5
  366. package/esm/highlevel/types/messages/message.js.map +1 -1
  367. package/esm/highlevel/types/messages/replied-message.js +5 -4
  368. package/esm/highlevel/types/misc/index.d.ts +1 -1
  369. package/esm/highlevel/types/misc/index.js +1 -1
  370. package/esm/highlevel/types/misc/index.js.map +1 -1
  371. package/esm/highlevel/types/misc/input-privacy-rule/allow.d.ts +22 -0
  372. package/esm/highlevel/types/misc/input-privacy-rule/allow.js +31 -0
  373. package/esm/highlevel/types/misc/input-privacy-rule/allow.js.map +1 -0
  374. package/esm/highlevel/types/misc/input-privacy-rule/bundle.d.ts +3 -0
  375. package/esm/highlevel/types/misc/input-privacy-rule/bundle.js +4 -0
  376. package/esm/highlevel/types/misc/input-privacy-rule/bundle.js.map +1 -0
  377. package/esm/highlevel/types/misc/input-privacy-rule/disallow.d.ts +20 -0
  378. package/esm/highlevel/types/misc/input-privacy-rule/disallow.js +27 -0
  379. package/esm/highlevel/types/misc/input-privacy-rule/disallow.js.map +1 -0
  380. package/esm/highlevel/types/misc/input-privacy-rule/index.d.ts +3 -0
  381. package/esm/highlevel/types/misc/input-privacy-rule/index.js +4 -0
  382. package/esm/highlevel/types/misc/input-privacy-rule/index.js.map +1 -0
  383. package/esm/highlevel/types/misc/input-privacy-rule/types.d.ts +11 -0
  384. package/esm/highlevel/types/misc/input-privacy-rule/types.js +2 -0
  385. package/esm/highlevel/types/misc/input-privacy-rule/types.js.map +1 -0
  386. package/esm/highlevel/types/misc/sticker-set.js +5 -4
  387. package/esm/highlevel/types/misc/takeout-session.js +4 -3
  388. package/esm/highlevel/types/peers/chat-colors.js +4 -3
  389. package/esm/highlevel/types/peers/chat-event/index.js +5 -4
  390. package/esm/highlevel/types/peers/chat-invite-link-member.js +5 -4
  391. package/esm/highlevel/types/peers/chat-invite-link.js +5 -4
  392. package/esm/highlevel/types/peers/chat-location.js +5 -4
  393. package/esm/highlevel/types/peers/chat-member.js +5 -4
  394. package/esm/highlevel/types/peers/chat-permissions.js +4 -3
  395. package/esm/highlevel/types/peers/chat-photo.js +12 -9
  396. package/esm/highlevel/types/peers/chat-photo.js.map +1 -1
  397. package/esm/highlevel/types/peers/chat-preview.js +5 -4
  398. package/esm/highlevel/types/peers/chat.js +5 -4
  399. package/esm/highlevel/types/peers/forum-topic.js +5 -4
  400. package/esm/highlevel/types/peers/user.js +5 -4
  401. package/esm/highlevel/types/premium/boost-slot.js +5 -4
  402. package/esm/highlevel/types/premium/boost-stats.js +4 -3
  403. package/esm/highlevel/types/premium/boost.js +5 -4
  404. package/esm/highlevel/types/reactions/emoji-status.js +4 -3
  405. package/esm/highlevel/types/reactions/peer-reaction.js +5 -4
  406. package/esm/highlevel/types/reactions/reaction-count.js +4 -3
  407. package/esm/highlevel/types/stories/all-stories.js +5 -4
  408. package/esm/highlevel/types/stories/interactive/channel-post.js +5 -4
  409. package/esm/highlevel/types/stories/interactive/location.js +5 -4
  410. package/esm/highlevel/types/stories/interactive/reaction.js +4 -3
  411. package/esm/highlevel/types/stories/interactive/venue.js +5 -4
  412. package/esm/highlevel/types/stories/peer-stories.js +5 -4
  413. package/esm/highlevel/types/stories/stealth-mode.js +4 -3
  414. package/esm/highlevel/types/stories/story-interactions.js +5 -4
  415. package/esm/highlevel/types/stories/story-viewer.js +9 -7
  416. package/esm/highlevel/types/stories/story.js +5 -4
  417. package/esm/highlevel/types/updates/bot-chat-join-request.js +5 -4
  418. package/esm/highlevel/types/updates/bot-reaction.js +9 -7
  419. package/esm/highlevel/types/updates/bot-stopped.js +5 -4
  420. package/esm/highlevel/types/updates/callback-query.js +11 -9
  421. package/esm/highlevel/types/updates/callback-query.js.map +1 -1
  422. package/esm/highlevel/types/updates/chat-join-request.js +5 -4
  423. package/esm/highlevel/types/updates/chat-member-update.js +5 -4
  424. package/esm/highlevel/types/updates/chosen-inline-result.js +5 -4
  425. package/esm/highlevel/types/updates/delete-message-update.js +4 -3
  426. package/esm/highlevel/types/updates/delete-story-update.js +5 -4
  427. package/esm/highlevel/types/updates/history-read-update.js +4 -3
  428. package/esm/highlevel/types/updates/inline-query.js +5 -4
  429. package/esm/highlevel/types/updates/poll-update.js +5 -4
  430. package/esm/highlevel/types/updates/poll-vote.js +5 -4
  431. package/esm/highlevel/types/updates/pre-checkout-query.js +5 -4
  432. package/esm/highlevel/types/updates/story-update.js +5 -4
  433. package/esm/highlevel/types/updates/user-status-update.js +5 -4
  434. package/esm/highlevel/types/updates/user-status-update.js.map +1 -1
  435. package/esm/highlevel/types/updates/user-typing-update.js +4 -3
  436. package/esm/highlevel/updates/manager.d.ts +5 -3
  437. package/esm/highlevel/updates/manager.js +81 -67
  438. package/esm/highlevel/updates/manager.js.map +1 -1
  439. package/esm/highlevel/utils/convert-file-id.js +7 -6
  440. package/esm/highlevel/utils/convert-file-id.js.map +1 -1
  441. package/esm/highlevel/utils/file-utils.js +8 -4
  442. package/esm/highlevel/utils/file-utils.js.map +1 -1
  443. package/esm/highlevel/utils/inline-utils.js +4 -3
  444. package/esm/highlevel/utils/inline-utils.js.map +1 -1
  445. package/esm/highlevel/utils/inspectable.d.ts +1 -1
  446. package/esm/highlevel/utils/inspectable.js +3 -2
  447. package/esm/highlevel/utils/inspectable.js.map +1 -1
  448. package/esm/highlevel/utils/memoize.d.ts +1 -1
  449. package/esm/highlevel/utils/memoize.js +1 -0
  450. package/esm/highlevel/utils/memoize.js.map +1 -1
  451. package/esm/highlevel/utils/stream-utils.d.ts +0 -2
  452. package/esm/highlevel/utils/stream-utils.js +0 -26
  453. package/esm/highlevel/utils/stream-utils.js.map +1 -1
  454. package/esm/highlevel/utils/string-session.js +4 -3
  455. package/esm/highlevel/utils/string-session.js.map +1 -1
  456. package/esm/highlevel/worker/index.d.ts +3 -0
  457. package/esm/highlevel/worker/index.js +4 -0
  458. package/esm/highlevel/worker/index.js.map +1 -0
  459. package/esm/highlevel/worker/port.d.ts +6 -3
  460. package/esm/highlevel/worker/port.js +8 -2
  461. package/esm/highlevel/worker/port.js.map +1 -1
  462. package/esm/highlevel/worker/protocol.d.ts +5 -1
  463. package/esm/highlevel/worker/protocol.js.map +1 -1
  464. package/esm/highlevel/worker/worker.d.ts +11 -4
  465. package/esm/highlevel/worker/worker.js +51 -47
  466. package/esm/highlevel/worker/worker.js.map +1 -1
  467. package/esm/network/client.d.ts +4 -4
  468. package/esm/network/client.js +4 -2
  469. package/esm/network/client.js.map +1 -1
  470. package/esm/network/multi-session-connection.d.ts +1 -0
  471. package/esm/network/multi-session-connection.js +6 -0
  472. package/esm/network/multi-session-connection.js.map +1 -1
  473. package/esm/network/network-manager.d.ts +5 -1
  474. package/esm/network/network-manager.js +24 -15
  475. package/esm/network/network-manager.js.map +1 -1
  476. package/esm/network/persistent-connection.d.ts +3 -0
  477. package/esm/network/persistent-connection.js +23 -1
  478. package/esm/network/persistent-connection.js.map +1 -1
  479. package/esm/network/session-connection.d.ts +2 -0
  480. package/esm/network/session-connection.js +18 -4
  481. package/esm/network/session-connection.js.map +1 -1
  482. package/esm/network/transports/index.d.ts +0 -3
  483. package/esm/network/transports/index.js +0 -3
  484. package/esm/network/transports/index.js.map +1 -1
  485. package/esm/platform.d.ts +18 -0
  486. package/esm/platform.js +31 -0
  487. package/esm/platform.js.map +1 -0
  488. package/esm/storage/index.d.ts +1 -2
  489. package/esm/storage/index.js +1 -2
  490. package/esm/storage/index.js.map +1 -1
  491. package/{cjs/storage/providers → esm/storage}/memory/driver.d.ts +1 -1
  492. package/esm/storage/memory/driver.js.map +1 -0
  493. package/{cjs/storage/providers → esm/storage}/memory/index.d.ts +2 -2
  494. package/esm/storage/memory/index.js.map +1 -0
  495. package/esm/storage/{providers/memory → memory}/repository/auth-keys.d.ts +1 -1
  496. package/esm/storage/memory/repository/auth-keys.js.map +1 -0
  497. package/{cjs/storage/providers → esm/storage}/memory/repository/kv.d.ts +1 -1
  498. package/esm/storage/memory/repository/kv.js.map +1 -0
  499. package/{cjs/storage/providers → esm/storage}/memory/repository/peers.d.ts +1 -1
  500. package/esm/storage/memory/repository/peers.js.map +1 -0
  501. package/{cjs/storage/providers → esm/storage}/memory/repository/ref-messages.d.ts +1 -1
  502. package/esm/storage/memory/repository/ref-messages.js.map +1 -0
  503. package/esm/storage/storage.js +3 -2
  504. package/esm/storage/storage.js.map +1 -1
  505. package/esm/utils/binary/asn1-parser.js +3 -3
  506. package/esm/utils/binary/asn1-parser.js.map +1 -1
  507. package/esm/utils/crypto/abstract.d.ts +0 -1
  508. package/esm/utils/crypto/abstract.js.map +1 -1
  509. package/esm/utils/crypto/index.d.ts +0 -2
  510. package/esm/utils/crypto/index.js +0 -2
  511. package/esm/utils/crypto/index.js.map +1 -1
  512. package/esm/utils/crypto/keys.js +6 -4
  513. package/esm/utils/crypto/keys.js.map +1 -1
  514. package/esm/utils/crypto/password.js +3 -3
  515. package/esm/utils/crypto/password.js.map +1 -1
  516. package/esm/utils/dcs.d.ts +4 -0
  517. package/esm/utils/dcs.js +0 -4
  518. package/esm/utils/dcs.js.map +1 -1
  519. package/esm/utils/{platform/error-reporting.d.ts → error-reporting.d.ts} +1 -1
  520. package/esm/utils/error-reporting.js.map +1 -0
  521. package/esm/utils/index.d.ts +4 -1
  522. package/esm/utils/index.js +6 -1
  523. package/esm/utils/index.js.map +1 -1
  524. package/esm/utils/links/common.js +1 -1
  525. package/esm/utils/links/common.js.map +1 -1
  526. package/esm/utils/logger.d.ts +1 -0
  527. package/esm/utils/logger.js +9 -22
  528. package/esm/utils/logger.js.map +1 -1
  529. package/package.json +24 -52
  530. package/cjs/highlevel/base.test.js +0 -14
  531. package/cjs/highlevel/base.test.js.map +0 -1
  532. package/cjs/highlevel/methods/files/_platform.js +0 -33
  533. package/cjs/highlevel/methods/files/_platform.js.map +0 -1
  534. package/cjs/highlevel/methods/files/_platform.web.d.ts +0 -1
  535. package/cjs/highlevel/methods/files/_platform.web.js +0 -26
  536. package/cjs/highlevel/methods/files/_platform.web.js.map +0 -1
  537. package/cjs/highlevel/methods/files/download-file.web.d.ts +0 -1
  538. package/cjs/highlevel/methods/files/download-file.web.js +0 -9
  539. package/cjs/highlevel/methods/files/download-file.web.js.map +0 -1
  540. package/cjs/highlevel/methods/messages/send-text.test.d.ts +0 -1
  541. package/cjs/highlevel/methods/messages/send-text.test.js +0 -140
  542. package/cjs/highlevel/methods/messages/send-text.test.js.map +0 -1
  543. package/cjs/highlevel/methods/users/get-users.test.d.ts +0 -1
  544. package/cjs/highlevel/methods/users/get-users.test.js +0 -33
  545. package/cjs/highlevel/methods/users/get-users.test.js.map +0 -1
  546. package/cjs/highlevel/methods/users/resolve-peer.test.d.ts +0 -1
  547. package/cjs/highlevel/methods/users/resolve-peer.test.js +0 -307
  548. package/cjs/highlevel/methods/users/resolve-peer.test.js.map +0 -1
  549. package/cjs/highlevel/types/bots/command-scope.d.ts +0 -63
  550. package/cjs/highlevel/types/bots/command-scope.js +0 -87
  551. package/cjs/highlevel/types/bots/command-scope.js.map +0 -1
  552. package/cjs/highlevel/types/bots/input/index.d.ts +0 -2
  553. package/cjs/highlevel/types/bots/input/index.js.map +0 -1
  554. package/cjs/highlevel/types/bots/input/input-inline-message.js +0 -179
  555. package/cjs/highlevel/types/bots/input/input-inline-message.js.map +0 -1
  556. package/cjs/highlevel/types/bots/input/input-inline-result.js +0 -490
  557. package/cjs/highlevel/types/bots/input/input-inline-result.js.map +0 -1
  558. package/cjs/highlevel/types/bots/keyboard-builder.js.map +0 -1
  559. package/cjs/highlevel/types/bots/keyboard-builder.test.d.ts +0 -1
  560. package/cjs/highlevel/types/bots/keyboard-builder.test.js +0 -162
  561. package/cjs/highlevel/types/bots/keyboard-builder.test.js.map +0 -1
  562. package/cjs/highlevel/types/bots/keyboards.d.ts +0 -239
  563. package/cjs/highlevel/types/bots/keyboards.js +0 -380
  564. package/cjs/highlevel/types/bots/keyboards.js.map +0 -1
  565. package/cjs/highlevel/types/bots/keyboards.test.d.ts +0 -1
  566. package/cjs/highlevel/types/bots/keyboards.test.js +0 -146
  567. package/cjs/highlevel/types/bots/keyboards.test.js.map +0 -1
  568. package/cjs/highlevel/types/media/input-media.js +0 -254
  569. package/cjs/highlevel/types/media/input-media.js.map +0 -1
  570. package/cjs/highlevel/types/misc/input-privacy-rule.d.ts +0 -63
  571. package/cjs/highlevel/types/misc/input-privacy-rule.js +0 -85
  572. package/cjs/highlevel/types/misc/input-privacy-rule.js.map +0 -1
  573. package/cjs/highlevel/types/peers/peers-index.test.d.ts +0 -1
  574. package/cjs/highlevel/types/peers/peers-index.test.js +0 -71
  575. package/cjs/highlevel/types/peers/peers-index.test.js.map +0 -1
  576. package/cjs/highlevel/types/peers/user.test.d.ts +0 -1
  577. package/cjs/highlevel/types/peers/user.test.js +0 -176
  578. package/cjs/highlevel/types/peers/user.test.js.map +0 -1
  579. package/cjs/highlevel/utils/file-type.test.d.ts +0 -1
  580. package/cjs/highlevel/utils/file-type.test.js +0 -64
  581. package/cjs/highlevel/utils/file-type.test.js.map +0 -1
  582. package/cjs/highlevel/utils/file-utils.test.d.ts +0 -1
  583. package/cjs/highlevel/utils/file-utils.test.js +0 -126
  584. package/cjs/highlevel/utils/file-utils.test.js.map +0 -1
  585. package/cjs/highlevel/utils/inline-utils.test.d.ts +0 -1
  586. package/cjs/highlevel/utils/inline-utils.test.js +0 -47
  587. package/cjs/highlevel/utils/inline-utils.test.js.map +0 -1
  588. package/cjs/highlevel/utils/inspectable.test.d.ts +0 -1
  589. package/cjs/highlevel/utils/inspectable.test.js +0 -97
  590. package/cjs/highlevel/utils/inspectable.test.js.map +0 -1
  591. package/cjs/highlevel/utils/memoize.test.d.ts +0 -1
  592. package/cjs/highlevel/utils/memoize.test.js +0 -60
  593. package/cjs/highlevel/utils/memoize.test.js.map +0 -1
  594. package/cjs/highlevel/utils/peer-utils.test.d.ts +0 -1
  595. package/cjs/highlevel/utils/peer-utils.test.js +0 -109
  596. package/cjs/highlevel/utils/peer-utils.test.js.map +0 -1
  597. package/cjs/highlevel/utils/platform/storage.d.ts +0 -1
  598. package/cjs/highlevel/utils/platform/storage.js +0 -10
  599. package/cjs/highlevel/utils/platform/storage.js.map +0 -1
  600. package/cjs/highlevel/utils/platform/storage.web.d.ts +0 -1
  601. package/cjs/highlevel/utils/platform/storage.web.js +0 -14
  602. package/cjs/highlevel/utils/platform/storage.web.js.map +0 -1
  603. package/cjs/highlevel/utils/query-batcher.test.d.ts +0 -1
  604. package/cjs/highlevel/utils/query-batcher.test.js +0 -502
  605. package/cjs/highlevel/utils/query-batcher.test.js.map +0 -1
  606. package/cjs/highlevel/utils/stream-utils.test.d.ts +0 -1
  607. package/cjs/highlevel/utils/stream-utils.test.js +0 -98
  608. package/cjs/highlevel/utils/stream-utils.test.js.map +0 -1
  609. package/cjs/highlevel/utils/string-session.test.d.ts +0 -1
  610. package/cjs/highlevel/utils/string-session.test.js +0 -198
  611. package/cjs/highlevel/utils/string-session.test.js.map +0 -1
  612. package/cjs/highlevel/utils/voice-utils.test.d.ts +0 -1
  613. package/cjs/highlevel/utils/voice-utils.test.js +0 -28
  614. package/cjs/highlevel/utils/voice-utils.test.js.map +0 -1
  615. package/cjs/highlevel/worker/platform/connect.d.ts +0 -2
  616. package/cjs/highlevel/worker/platform/connect.js +0 -19
  617. package/cjs/highlevel/worker/platform/connect.js.map +0 -1
  618. package/cjs/highlevel/worker/platform/connect.web.d.ts +0 -2
  619. package/cjs/highlevel/worker/platform/connect.web.js +0 -51
  620. package/cjs/highlevel/worker/platform/connect.web.js.map +0 -1
  621. package/cjs/highlevel/worker/platform/register.d.ts +0 -2
  622. package/cjs/highlevel/worker/platform/register.js +0 -20
  623. package/cjs/highlevel/worker/platform/register.js.map +0 -1
  624. package/cjs/highlevel/worker/platform/register.web.d.ts +0 -2
  625. package/cjs/highlevel/worker/platform/register.web.js +0 -64
  626. package/cjs/highlevel/worker/platform/register.web.js.map +0 -1
  627. package/cjs/network/auth-key.test.d.ts +0 -1
  628. package/cjs/network/auth-key.test.js +0 -111
  629. package/cjs/network/auth-key.test.js.map +0 -1
  630. package/cjs/network/config-manager.test.d.ts +0 -1
  631. package/cjs/network/config-manager.test.js +0 -174
  632. package/cjs/network/config-manager.test.js.map +0 -1
  633. package/cjs/network/persistent-connection.test.d.ts +0 -1
  634. package/cjs/network/persistent-connection.test.js +0 -157
  635. package/cjs/network/persistent-connection.test.js.map +0 -1
  636. package/cjs/network/transports/intermediate.test.d.ts +0 -1
  637. package/cjs/network/transports/intermediate.test.js +0 -84
  638. package/cjs/network/transports/intermediate.test.js.map +0 -1
  639. package/cjs/network/transports/obfuscated.test.d.ts +0 -1
  640. package/cjs/network/transports/obfuscated.test.js +0 -131
  641. package/cjs/network/transports/obfuscated.test.js.map +0 -1
  642. package/cjs/network/transports/tcp.d.ts +0 -32
  643. package/cjs/network/transports/tcp.js +0 -130
  644. package/cjs/network/transports/tcp.js.map +0 -1
  645. package/cjs/network/transports/tcp.test.d.ts +0 -1
  646. package/cjs/network/transports/tcp.test.js +0 -103
  647. package/cjs/network/transports/tcp.test.js.map +0 -1
  648. package/cjs/network/transports/websocket.d.ts +0 -46
  649. package/cjs/network/transports/websocket.js +0 -124
  650. package/cjs/network/transports/websocket.js.map +0 -1
  651. package/cjs/network/transports/websocket.test.d.ts +0 -1
  652. package/cjs/network/transports/websocket.test.js +0 -91
  653. package/cjs/network/transports/websocket.test.js.map +0 -1
  654. package/cjs/storage/providers/idb/driver.d.ts +0 -18
  655. package/cjs/storage/providers/idb/driver.js +0 -138
  656. package/cjs/storage/providers/idb/driver.js.map +0 -1
  657. package/cjs/storage/providers/idb/idb.test.d.ts +0 -1
  658. package/cjs/storage/providers/idb/idb.test.js +0 -29
  659. package/cjs/storage/providers/idb/idb.test.js.map +0 -1
  660. package/cjs/storage/providers/idb/index.d.ts +0 -22
  661. package/cjs/storage/providers/idb/index.js +0 -28
  662. package/cjs/storage/providers/idb/index.js.map +0 -1
  663. package/cjs/storage/providers/idb/repository/auth-keys.d.ts +0 -14
  664. package/cjs/storage/providers/idb/repository/auth-keys.js +0 -70
  665. package/cjs/storage/providers/idb/repository/auth-keys.js.map +0 -1
  666. package/cjs/storage/providers/idb/repository/kv.d.ts +0 -11
  667. package/cjs/storage/providers/idb/repository/kv.js +0 -34
  668. package/cjs/storage/providers/idb/repository/kv.js.map +0 -1
  669. package/cjs/storage/providers/idb/repository/peers.d.ts +0 -12
  670. package/cjs/storage/providers/idb/repository/peers.js +0 -38
  671. package/cjs/storage/providers/idb/repository/peers.js.map +0 -1
  672. package/cjs/storage/providers/idb/repository/ref-messages.d.ts +0 -12
  673. package/cjs/storage/providers/idb/repository/ref-messages.js +0 -57
  674. package/cjs/storage/providers/idb/repository/ref-messages.js.map +0 -1
  675. package/cjs/storage/providers/idb/utils.d.ts +0 -3
  676. package/cjs/storage/providers/idb/utils.js +0 -27
  677. package/cjs/storage/providers/idb/utils.js.map +0 -1
  678. package/cjs/storage/providers/memory/driver.js.map +0 -1
  679. package/cjs/storage/providers/memory/index.js.map +0 -1
  680. package/cjs/storage/providers/memory/memory.test.d.ts +0 -1
  681. package/cjs/storage/providers/memory/memory.test.js +0 -13
  682. package/cjs/storage/providers/memory/memory.test.js.map +0 -1
  683. package/cjs/storage/providers/memory/repository/auth-keys.js.map +0 -1
  684. package/cjs/storage/providers/memory/repository/kv.js.map +0 -1
  685. package/cjs/storage/providers/memory/repository/peers.js.map +0 -1
  686. package/cjs/storage/providers/memory/repository/ref-messages.js.map +0 -1
  687. package/cjs/storage/service/auth-keys.test.d.ts +0 -1
  688. package/cjs/storage/service/auth-keys.test.js +0 -22
  689. package/cjs/storage/service/auth-keys.test.js.map +0 -1
  690. package/cjs/storage/service/updates.test.d.ts +0 -1
  691. package/cjs/storage/service/updates.test.js +0 -60
  692. package/cjs/storage/service/updates.test.js.map +0 -1
  693. package/cjs/storage/service/utils.test-utils.d.ts +0 -2
  694. package/cjs/storage/service/utils.test-utils.js +0 -19
  695. package/cjs/storage/service/utils.test-utils.js.map +0 -1
  696. package/cjs/utils/async-lock.test.d.ts +0 -1
  697. package/cjs/utils/async-lock.test.js +0 -25
  698. package/cjs/utils/async-lock.test.js.map +0 -1
  699. package/cjs/utils/bigint-utils.test.d.ts +0 -1
  700. package/cjs/utils/bigint-utils.test.js +0 -150
  701. package/cjs/utils/bigint-utils.test.js.map +0 -1
  702. package/cjs/utils/buffer-utils.test.d.ts +0 -1
  703. package/cjs/utils/buffer-utils.test.js +0 -69
  704. package/cjs/utils/buffer-utils.test.js.map +0 -1
  705. package/cjs/utils/condition-variable.test.d.ts +0 -1
  706. package/cjs/utils/condition-variable.test.js +0 -27
  707. package/cjs/utils/condition-variable.test.js.map +0 -1
  708. package/cjs/utils/controllable-promise.test.d.ts +0 -1
  709. package/cjs/utils/controllable-promise.test.js +0 -17
  710. package/cjs/utils/controllable-promise.test.js.map +0 -1
  711. package/cjs/utils/crypto/factorization.test.d.ts +0 -1
  712. package/cjs/utils/crypto/factorization.test.js +0 -19
  713. package/cjs/utils/crypto/factorization.test.js.map +0 -1
  714. package/cjs/utils/crypto/keys.test.d.ts +0 -1
  715. package/cjs/utils/crypto/keys.test.js +0 -40
  716. package/cjs/utils/crypto/keys.test.js.map +0 -1
  717. package/cjs/utils/crypto/miller-rabin.test.d.ts +0 -1
  718. package/cjs/utils/crypto/miller-rabin.test.js +0 -60
  719. package/cjs/utils/crypto/miller-rabin.test.js.map +0 -1
  720. package/cjs/utils/crypto/mtproto.test.d.ts +0 -1
  721. package/cjs/utils/crypto/mtproto.test.js +0 -50
  722. package/cjs/utils/crypto/mtproto.test.js.map +0 -1
  723. package/cjs/utils/crypto/node.d.ts +0 -21
  724. package/cjs/utils/crypto/node.js +0 -74
  725. package/cjs/utils/crypto/node.js.map +0 -1
  726. package/cjs/utils/crypto/node.test.d.ts +0 -1
  727. package/cjs/utils/crypto/node.test.js +0 -14
  728. package/cjs/utils/crypto/node.test.js.map +0 -1
  729. package/cjs/utils/crypto/password.test.d.ts +0 -1
  730. package/cjs/utils/crypto/password.test.js +0 -95
  731. package/cjs/utils/crypto/password.test.js.map +0 -1
  732. package/cjs/utils/crypto/utils.test.d.ts +0 -1
  733. package/cjs/utils/crypto/utils.test.js +0 -49
  734. package/cjs/utils/crypto/utils.test.js.map +0 -1
  735. package/cjs/utils/crypto/wasm.d.ts +0 -22
  736. package/cjs/utils/crypto/wasm.js +0 -41
  737. package/cjs/utils/crypto/wasm.js.map +0 -1
  738. package/cjs/utils/crypto/web.d.ts +0 -11
  739. package/cjs/utils/crypto/web.js +0 -40
  740. package/cjs/utils/crypto/web.js.map +0 -1
  741. package/cjs/utils/crypto/web.test.d.ts +0 -1
  742. package/cjs/utils/crypto/web.test.js +0 -17
  743. package/cjs/utils/crypto/web.test.js.map +0 -1
  744. package/cjs/utils/deque.test.d.ts +0 -1
  745. package/cjs/utils/deque.test.js +0 -128
  746. package/cjs/utils/deque.test.js.map +0 -1
  747. package/cjs/utils/function-utils.test.d.ts +0 -1
  748. package/cjs/utils/function-utils.test.js +0 -23
  749. package/cjs/utils/function-utils.test.js.map +0 -1
  750. package/cjs/utils/linked-list.test.d.ts +0 -1
  751. package/cjs/utils/linked-list.test.js +0 -36
  752. package/cjs/utils/linked-list.test.js.map +0 -1
  753. package/cjs/utils/links/bots.test.d.ts +0 -1
  754. package/cjs/utils/links/bots.test.js +0 -152
  755. package/cjs/utils/links/bots.test.js.map +0 -1
  756. package/cjs/utils/links/chat.test.d.ts +0 -1
  757. package/cjs/utils/links/chat.test.js +0 -84
  758. package/cjs/utils/links/chat.test.js.map +0 -1
  759. package/cjs/utils/links/misc.test.d.ts +0 -1
  760. package/cjs/utils/links/misc.test.js +0 -153
  761. package/cjs/utils/links/misc.test.js.map +0 -1
  762. package/cjs/utils/links/proxy.test.d.ts +0 -1
  763. package/cjs/utils/links/proxy.test.js +0 -74
  764. package/cjs/utils/links/proxy.test.js.map +0 -1
  765. package/cjs/utils/links/user.test.d.ts +0 -1
  766. package/cjs/utils/links/user.test.js +0 -63
  767. package/cjs/utils/links/user.test.js.map +0 -1
  768. package/cjs/utils/logger.test.d.ts +0 -1
  769. package/cjs/utils/logger.test.js +0 -139
  770. package/cjs/utils/logger.test.js.map +0 -1
  771. package/cjs/utils/long-utils.test.d.ts +0 -1
  772. package/cjs/utils/long-utils.test.js +0 -158
  773. package/cjs/utils/long-utils.test.js.map +0 -1
  774. package/cjs/utils/lru-map.test.d.ts +0 -1
  775. package/cjs/utils/lru-map.test.js +0 -96
  776. package/cjs/utils/lru-map.test.js.map +0 -1
  777. package/cjs/utils/lru-set.test.d.ts +0 -1
  778. package/cjs/utils/lru-set.test.js +0 -77
  779. package/cjs/utils/lru-set.test.js.map +0 -1
  780. package/cjs/utils/peer-utils.test.d.ts +0 -1
  781. package/cjs/utils/peer-utils.test.js +0 -110
  782. package/cjs/utils/peer-utils.test.js.map +0 -1
  783. package/cjs/utils/platform/crypto.d.ts +0 -1
  784. package/cjs/utils/platform/crypto.js +0 -8
  785. package/cjs/utils/platform/crypto.js.map +0 -1
  786. package/cjs/utils/platform/crypto.web.d.ts +0 -1
  787. package/cjs/utils/platform/crypto.web.js +0 -14
  788. package/cjs/utils/platform/crypto.web.js.map +0 -1
  789. package/cjs/utils/platform/error-reporting.js.map +0 -1
  790. package/cjs/utils/platform/exit-hook.d.ts +0 -1
  791. package/cjs/utils/platform/exit-hook.js +0 -45
  792. package/cjs/utils/platform/exit-hook.js.map +0 -1
  793. package/cjs/utils/platform/exit-hook.web.d.ts +0 -1
  794. package/cjs/utils/platform/exit-hook.web.js +0 -21
  795. package/cjs/utils/platform/exit-hook.web.js.map +0 -1
  796. package/cjs/utils/platform/logging.d.ts +0 -1
  797. package/cjs/utils/platform/logging.js +0 -34
  798. package/cjs/utils/platform/logging.js.map +0 -1
  799. package/cjs/utils/platform/logging.web.d.ts +0 -1
  800. package/cjs/utils/platform/logging.web.js +0 -35
  801. package/cjs/utils/platform/logging.web.js.map +0 -1
  802. package/cjs/utils/platform/transport.d.ts +0 -1
  803. package/cjs/utils/platform/transport.js +0 -8
  804. package/cjs/utils/platform/transport.js.map +0 -1
  805. package/cjs/utils/platform/transport.web.d.ts +0 -1
  806. package/cjs/utils/platform/transport.web.js +0 -15
  807. package/cjs/utils/platform/transport.web.js.map +0 -1
  808. package/cjs/utils/sorted-array.test.d.ts +0 -1
  809. package/cjs/utils/sorted-array.test.js +0 -66
  810. package/cjs/utils/sorted-array.test.js.map +0 -1
  811. package/cjs/utils/tl-json.test.d.ts +0 -1
  812. package/cjs/utils/tl-json.test.js +0 -83
  813. package/cjs/utils/tl-json.test.js.map +0 -1
  814. package/cjs/utils/type-assertions.test.d.ts +0 -1
  815. package/cjs/utils/type-assertions.test.js +0 -67
  816. package/cjs/utils/type-assertions.test.js.map +0 -1
  817. package/esm/highlevel/base.test.d.ts +0 -1
  818. package/esm/highlevel/base.test.js +0 -12
  819. package/esm/highlevel/base.test.js.map +0 -1
  820. package/esm/highlevel/methods/files/_platform.d.ts +0 -1
  821. package/esm/highlevel/methods/files/_platform.js +0 -26
  822. package/esm/highlevel/methods/files/_platform.js.map +0 -1
  823. package/esm/highlevel/methods/files/_platform.web.d.ts +0 -1
  824. package/esm/highlevel/methods/files/_platform.web.js +0 -19
  825. package/esm/highlevel/methods/files/_platform.web.js.map +0 -1
  826. package/esm/highlevel/methods/files/download-file.web.d.ts +0 -1
  827. package/esm/highlevel/methods/files/download-file.web.js +0 -5
  828. package/esm/highlevel/methods/files/download-file.web.js.map +0 -1
  829. package/esm/highlevel/methods/messages/send-text.test.d.ts +0 -1
  830. package/esm/highlevel/methods/messages/send-text.test.js +0 -135
  831. package/esm/highlevel/methods/messages/send-text.test.js.map +0 -1
  832. package/esm/highlevel/methods/users/get-users.test.d.ts +0 -1
  833. package/esm/highlevel/methods/users/get-users.test.js +0 -28
  834. package/esm/highlevel/methods/users/get-users.test.js.map +0 -1
  835. package/esm/highlevel/methods/users/resolve-peer.test.d.ts +0 -1
  836. package/esm/highlevel/methods/users/resolve-peer.test.js +0 -302
  837. package/esm/highlevel/methods/users/resolve-peer.test.js.map +0 -1
  838. package/esm/highlevel/types/bots/command-scope.d.ts +0 -63
  839. package/esm/highlevel/types/bots/command-scope.js +0 -84
  840. package/esm/highlevel/types/bots/command-scope.js.map +0 -1
  841. package/esm/highlevel/types/bots/input/index.d.ts +0 -2
  842. package/esm/highlevel/types/bots/input/index.js +0 -3
  843. package/esm/highlevel/types/bots/input/index.js.map +0 -1
  844. package/esm/highlevel/types/bots/input/input-inline-message.js +0 -176
  845. package/esm/highlevel/types/bots/input/input-inline-message.js.map +0 -1
  846. package/esm/highlevel/types/bots/input/input-inline-result.js +0 -487
  847. package/esm/highlevel/types/bots/input/input-inline-result.js.map +0 -1
  848. package/esm/highlevel/types/bots/keyboard-builder.js.map +0 -1
  849. package/esm/highlevel/types/bots/keyboard-builder.test.d.ts +0 -1
  850. package/esm/highlevel/types/bots/keyboard-builder.test.js +0 -160
  851. package/esm/highlevel/types/bots/keyboard-builder.test.js.map +0 -1
  852. package/esm/highlevel/types/bots/keyboards.d.ts +0 -239
  853. package/esm/highlevel/types/bots/keyboards.js +0 -377
  854. package/esm/highlevel/types/bots/keyboards.js.map +0 -1
  855. package/esm/highlevel/types/bots/keyboards.test.d.ts +0 -1
  856. package/esm/highlevel/types/bots/keyboards.test.js +0 -144
  857. package/esm/highlevel/types/bots/keyboards.test.js.map +0 -1
  858. package/esm/highlevel/types/media/input-media.js +0 -251
  859. package/esm/highlevel/types/media/input-media.js.map +0 -1
  860. package/esm/highlevel/types/misc/input-privacy-rule.d.ts +0 -63
  861. package/esm/highlevel/types/misc/input-privacy-rule.js +0 -82
  862. package/esm/highlevel/types/misc/input-privacy-rule.js.map +0 -1
  863. package/esm/highlevel/types/peers/peers-index.test.d.ts +0 -1
  864. package/esm/highlevel/types/peers/peers-index.test.js +0 -69
  865. package/esm/highlevel/types/peers/peers-index.test.js.map +0 -1
  866. package/esm/highlevel/types/peers/user.test.d.ts +0 -1
  867. package/esm/highlevel/types/peers/user.test.js +0 -171
  868. package/esm/highlevel/types/peers/user.test.js.map +0 -1
  869. package/esm/highlevel/utils/file-type.test.d.ts +0 -1
  870. package/esm/highlevel/utils/file-type.test.js +0 -62
  871. package/esm/highlevel/utils/file-type.test.js.map +0 -1
  872. package/esm/highlevel/utils/file-utils.test.d.ts +0 -1
  873. package/esm/highlevel/utils/file-utils.test.js +0 -124
  874. package/esm/highlevel/utils/file-utils.test.js.map +0 -1
  875. package/esm/highlevel/utils/inline-utils.test.d.ts +0 -1
  876. package/esm/highlevel/utils/inline-utils.test.js +0 -42
  877. package/esm/highlevel/utils/inline-utils.test.js.map +0 -1
  878. package/esm/highlevel/utils/inspectable.test.d.ts +0 -1
  879. package/esm/highlevel/utils/inspectable.test.js +0 -95
  880. package/esm/highlevel/utils/inspectable.test.js.map +0 -1
  881. package/esm/highlevel/utils/memoize.test.d.ts +0 -1
  882. package/esm/highlevel/utils/memoize.test.js +0 -58
  883. package/esm/highlevel/utils/memoize.test.js.map +0 -1
  884. package/esm/highlevel/utils/peer-utils.test.d.ts +0 -1
  885. package/esm/highlevel/utils/peer-utils.test.js +0 -107
  886. package/esm/highlevel/utils/peer-utils.test.js.map +0 -1
  887. package/esm/highlevel/utils/platform/storage.d.ts +0 -1
  888. package/esm/highlevel/utils/platform/storage.js +0 -6
  889. package/esm/highlevel/utils/platform/storage.js.map +0 -1
  890. package/esm/highlevel/utils/platform/storage.web.d.ts +0 -1
  891. package/esm/highlevel/utils/platform/storage.web.js +0 -10
  892. package/esm/highlevel/utils/platform/storage.web.js.map +0 -1
  893. package/esm/highlevel/utils/query-batcher.test.d.ts +0 -1
  894. package/esm/highlevel/utils/query-batcher.test.js +0 -500
  895. package/esm/highlevel/utils/query-batcher.test.js.map +0 -1
  896. package/esm/highlevel/utils/stream-utils.test.d.ts +0 -1
  897. package/esm/highlevel/utils/stream-utils.test.js +0 -96
  898. package/esm/highlevel/utils/stream-utils.test.js.map +0 -1
  899. package/esm/highlevel/utils/string-session.test.d.ts +0 -1
  900. package/esm/highlevel/utils/string-session.test.js +0 -196
  901. package/esm/highlevel/utils/string-session.test.js.map +0 -1
  902. package/esm/highlevel/utils/voice-utils.test.d.ts +0 -1
  903. package/esm/highlevel/utils/voice-utils.test.js +0 -26
  904. package/esm/highlevel/utils/voice-utils.test.js.map +0 -1
  905. package/esm/highlevel/worker/platform/connect.d.ts +0 -2
  906. package/esm/highlevel/worker/platform/connect.js +0 -15
  907. package/esm/highlevel/worker/platform/connect.js.map +0 -1
  908. package/esm/highlevel/worker/platform/connect.web.d.ts +0 -2
  909. package/esm/highlevel/worker/platform/connect.web.js +0 -47
  910. package/esm/highlevel/worker/platform/connect.web.js.map +0 -1
  911. package/esm/highlevel/worker/platform/register.d.ts +0 -2
  912. package/esm/highlevel/worker/platform/register.js +0 -16
  913. package/esm/highlevel/worker/platform/register.js.map +0 -1
  914. package/esm/highlevel/worker/platform/register.web.d.ts +0 -2
  915. package/esm/highlevel/worker/platform/register.web.js +0 -60
  916. package/esm/highlevel/worker/platform/register.web.js.map +0 -1
  917. package/esm/network/auth-key.test.d.ts +0 -1
  918. package/esm/network/auth-key.test.js +0 -106
  919. package/esm/network/auth-key.test.js.map +0 -1
  920. package/esm/network/config-manager.test.d.ts +0 -1
  921. package/esm/network/config-manager.test.js +0 -172
  922. package/esm/network/config-manager.test.js.map +0 -1
  923. package/esm/network/persistent-connection.test.d.ts +0 -1
  924. package/esm/network/persistent-connection.test.js +0 -155
  925. package/esm/network/persistent-connection.test.js.map +0 -1
  926. package/esm/network/transports/intermediate.test.d.ts +0 -1
  927. package/esm/network/transports/intermediate.test.js +0 -82
  928. package/esm/network/transports/intermediate.test.js.map +0 -1
  929. package/esm/network/transports/obfuscated.test.d.ts +0 -1
  930. package/esm/network/transports/obfuscated.test.js +0 -129
  931. package/esm/network/transports/obfuscated.test.js.map +0 -1
  932. package/esm/network/transports/tcp.d.ts +0 -32
  933. package/esm/network/transports/tcp.js +0 -122
  934. package/esm/network/transports/tcp.js.map +0 -1
  935. package/esm/network/transports/tcp.test.d.ts +0 -1
  936. package/esm/network/transports/tcp.test.js +0 -101
  937. package/esm/network/transports/tcp.test.js.map +0 -1
  938. package/esm/network/transports/websocket.d.ts +0 -46
  939. package/esm/network/transports/websocket.js +0 -116
  940. package/esm/network/transports/websocket.js.map +0 -1
  941. package/esm/network/transports/websocket.test.d.ts +0 -1
  942. package/esm/network/transports/websocket.test.js +0 -89
  943. package/esm/network/transports/websocket.test.js.map +0 -1
  944. package/esm/storage/providers/idb/driver.d.ts +0 -18
  945. package/esm/storage/providers/idb/driver.js +0 -134
  946. package/esm/storage/providers/idb/driver.js.map +0 -1
  947. package/esm/storage/providers/idb/idb.test.d.ts +0 -1
  948. package/esm/storage/providers/idb/idb.test.js +0 -27
  949. package/esm/storage/providers/idb/idb.test.js.map +0 -1
  950. package/esm/storage/providers/idb/index.d.ts +0 -22
  951. package/esm/storage/providers/idb/index.js +0 -23
  952. package/esm/storage/providers/idb/index.js.map +0 -1
  953. package/esm/storage/providers/idb/repository/auth-keys.d.ts +0 -14
  954. package/esm/storage/providers/idb/repository/auth-keys.js +0 -66
  955. package/esm/storage/providers/idb/repository/auth-keys.js.map +0 -1
  956. package/esm/storage/providers/idb/repository/kv.d.ts +0 -11
  957. package/esm/storage/providers/idb/repository/kv.js +0 -30
  958. package/esm/storage/providers/idb/repository/kv.js.map +0 -1
  959. package/esm/storage/providers/idb/repository/peers.d.ts +0 -12
  960. package/esm/storage/providers/idb/repository/peers.js +0 -34
  961. package/esm/storage/providers/idb/repository/peers.js.map +0 -1
  962. package/esm/storage/providers/idb/repository/ref-messages.d.ts +0 -12
  963. package/esm/storage/providers/idb/repository/ref-messages.js +0 -53
  964. package/esm/storage/providers/idb/repository/ref-messages.js.map +0 -1
  965. package/esm/storage/providers/idb/utils.d.ts +0 -3
  966. package/esm/storage/providers/idb/utils.js +0 -21
  967. package/esm/storage/providers/idb/utils.js.map +0 -1
  968. package/esm/storage/providers/memory/driver.js.map +0 -1
  969. package/esm/storage/providers/memory/index.js.map +0 -1
  970. package/esm/storage/providers/memory/memory.test.d.ts +0 -1
  971. package/esm/storage/providers/memory/memory.test.js +0 -11
  972. package/esm/storage/providers/memory/memory.test.js.map +0 -1
  973. package/esm/storage/providers/memory/repository/auth-keys.js.map +0 -1
  974. package/esm/storage/providers/memory/repository/kv.js.map +0 -1
  975. package/esm/storage/providers/memory/repository/peers.js.map +0 -1
  976. package/esm/storage/providers/memory/repository/ref-messages.js.map +0 -1
  977. package/esm/storage/service/auth-keys.test.d.ts +0 -1
  978. package/esm/storage/service/auth-keys.test.js +0 -20
  979. package/esm/storage/service/auth-keys.test.js.map +0 -1
  980. package/esm/storage/service/updates.test.d.ts +0 -1
  981. package/esm/storage/service/updates.test.js +0 -58
  982. package/esm/storage/service/updates.test.js.map +0 -1
  983. package/esm/storage/service/utils.test-utils.d.ts +0 -2
  984. package/esm/storage/service/utils.test-utils.js +0 -15
  985. package/esm/storage/service/utils.test-utils.js.map +0 -1
  986. package/esm/utils/async-lock.test.d.ts +0 -1
  987. package/esm/utils/async-lock.test.js +0 -23
  988. package/esm/utils/async-lock.test.js.map +0 -1
  989. package/esm/utils/bigint-utils.test.d.ts +0 -1
  990. package/esm/utils/bigint-utils.test.js +0 -148
  991. package/esm/utils/bigint-utils.test.js.map +0 -1
  992. package/esm/utils/buffer-utils.test.d.ts +0 -1
  993. package/esm/utils/buffer-utils.test.js +0 -67
  994. package/esm/utils/buffer-utils.test.js.map +0 -1
  995. package/esm/utils/condition-variable.test.d.ts +0 -1
  996. package/esm/utils/condition-variable.test.js +0 -25
  997. package/esm/utils/condition-variable.test.js.map +0 -1
  998. package/esm/utils/controllable-promise.test.d.ts +0 -1
  999. package/esm/utils/controllable-promise.test.js +0 -15
  1000. package/esm/utils/controllable-promise.test.js.map +0 -1
  1001. package/esm/utils/crypto/factorization.test.d.ts +0 -1
  1002. package/esm/utils/crypto/factorization.test.js +0 -17
  1003. package/esm/utils/crypto/factorization.test.js.map +0 -1
  1004. package/esm/utils/crypto/keys.test.d.ts +0 -1
  1005. package/esm/utils/crypto/keys.test.js +0 -38
  1006. package/esm/utils/crypto/keys.test.js.map +0 -1
  1007. package/esm/utils/crypto/miller-rabin.test.d.ts +0 -1
  1008. package/esm/utils/crypto/miller-rabin.test.js +0 -58
  1009. package/esm/utils/crypto/miller-rabin.test.js.map +0 -1
  1010. package/esm/utils/crypto/mtproto.test.d.ts +0 -1
  1011. package/esm/utils/crypto/mtproto.test.js +0 -48
  1012. package/esm/utils/crypto/mtproto.test.js.map +0 -1
  1013. package/esm/utils/crypto/node.d.ts +0 -21
  1014. package/esm/utils/crypto/node.js +0 -69
  1015. package/esm/utils/crypto/node.js.map +0 -1
  1016. package/esm/utils/crypto/node.test.d.ts +0 -1
  1017. package/esm/utils/crypto/node.test.js +0 -12
  1018. package/esm/utils/crypto/node.test.js.map +0 -1
  1019. package/esm/utils/crypto/password.test.d.ts +0 -1
  1020. package/esm/utils/crypto/password.test.js +0 -90
  1021. package/esm/utils/crypto/password.test.js.map +0 -1
  1022. package/esm/utils/crypto/utils.test.d.ts +0 -1
  1023. package/esm/utils/crypto/utils.test.js +0 -47
  1024. package/esm/utils/crypto/utils.test.js.map +0 -1
  1025. package/esm/utils/crypto/wasm.d.ts +0 -22
  1026. package/esm/utils/crypto/wasm.js +0 -37
  1027. package/esm/utils/crypto/wasm.js.map +0 -1
  1028. package/esm/utils/crypto/web.d.ts +0 -11
  1029. package/esm/utils/crypto/web.js +0 -36
  1030. package/esm/utils/crypto/web.js.map +0 -1
  1031. package/esm/utils/crypto/web.test.d.ts +0 -1
  1032. package/esm/utils/crypto/web.test.js +0 -15
  1033. package/esm/utils/crypto/web.test.js.map +0 -1
  1034. package/esm/utils/deque.test.d.ts +0 -1
  1035. package/esm/utils/deque.test.js +0 -126
  1036. package/esm/utils/deque.test.js.map +0 -1
  1037. package/esm/utils/function-utils.test.d.ts +0 -1
  1038. package/esm/utils/function-utils.test.js +0 -21
  1039. package/esm/utils/function-utils.test.js.map +0 -1
  1040. package/esm/utils/linked-list.test.d.ts +0 -1
  1041. package/esm/utils/linked-list.test.js +0 -34
  1042. package/esm/utils/linked-list.test.js.map +0 -1
  1043. package/esm/utils/links/bots.test.d.ts +0 -1
  1044. package/esm/utils/links/bots.test.js +0 -150
  1045. package/esm/utils/links/bots.test.js.map +0 -1
  1046. package/esm/utils/links/chat.test.d.ts +0 -1
  1047. package/esm/utils/links/chat.test.js +0 -82
  1048. package/esm/utils/links/chat.test.js.map +0 -1
  1049. package/esm/utils/links/misc.test.d.ts +0 -1
  1050. package/esm/utils/links/misc.test.js +0 -151
  1051. package/esm/utils/links/misc.test.js.map +0 -1
  1052. package/esm/utils/links/proxy.test.d.ts +0 -1
  1053. package/esm/utils/links/proxy.test.js +0 -72
  1054. package/esm/utils/links/proxy.test.js.map +0 -1
  1055. package/esm/utils/links/user.test.d.ts +0 -1
  1056. package/esm/utils/links/user.test.js +0 -61
  1057. package/esm/utils/links/user.test.js.map +0 -1
  1058. package/esm/utils/logger.test.d.ts +0 -1
  1059. package/esm/utils/logger.test.js +0 -134
  1060. package/esm/utils/logger.test.js.map +0 -1
  1061. package/esm/utils/long-utils.test.d.ts +0 -1
  1062. package/esm/utils/long-utils.test.js +0 -153
  1063. package/esm/utils/long-utils.test.js.map +0 -1
  1064. package/esm/utils/lru-map.test.d.ts +0 -1
  1065. package/esm/utils/lru-map.test.js +0 -94
  1066. package/esm/utils/lru-map.test.js.map +0 -1
  1067. package/esm/utils/lru-set.test.d.ts +0 -1
  1068. package/esm/utils/lru-set.test.js +0 -72
  1069. package/esm/utils/lru-set.test.js.map +0 -1
  1070. package/esm/utils/peer-utils.test.d.ts +0 -1
  1071. package/esm/utils/peer-utils.test.js +0 -105
  1072. package/esm/utils/peer-utils.test.js.map +0 -1
  1073. package/esm/utils/platform/crypto.d.ts +0 -1
  1074. package/esm/utils/platform/crypto.js +0 -4
  1075. package/esm/utils/platform/crypto.js.map +0 -1
  1076. package/esm/utils/platform/crypto.web.d.ts +0 -1
  1077. package/esm/utils/platform/crypto.web.js +0 -10
  1078. package/esm/utils/platform/crypto.web.js.map +0 -1
  1079. package/esm/utils/platform/error-reporting.js.map +0 -1
  1080. package/esm/utils/platform/exit-hook.d.ts +0 -1
  1081. package/esm/utils/platform/exit-hook.js +0 -41
  1082. package/esm/utils/platform/exit-hook.js.map +0 -1
  1083. package/esm/utils/platform/exit-hook.web.d.ts +0 -1
  1084. package/esm/utils/platform/exit-hook.web.js +0 -17
  1085. package/esm/utils/platform/exit-hook.web.js.map +0 -1
  1086. package/esm/utils/platform/logging.d.ts +0 -1
  1087. package/esm/utils/platform/logging.js +0 -31
  1088. package/esm/utils/platform/logging.js.map +0 -1
  1089. package/esm/utils/platform/logging.web.d.ts +0 -1
  1090. package/esm/utils/platform/logging.web.js +0 -31
  1091. package/esm/utils/platform/logging.web.js.map +0 -1
  1092. package/esm/utils/platform/transport.d.ts +0 -1
  1093. package/esm/utils/platform/transport.js +0 -4
  1094. package/esm/utils/platform/transport.js.map +0 -1
  1095. package/esm/utils/platform/transport.web.d.ts +0 -1
  1096. package/esm/utils/platform/transport.web.js +0 -12
  1097. package/esm/utils/platform/transport.web.js.map +0 -1
  1098. package/esm/utils/sorted-array.test.d.ts +0 -1
  1099. package/esm/utils/sorted-array.test.js +0 -64
  1100. package/esm/utils/sorted-array.test.js.map +0 -1
  1101. package/esm/utils/tl-json.test.d.ts +0 -1
  1102. package/esm/utils/tl-json.test.js +0 -81
  1103. package/esm/utils/tl-json.test.js.map +0 -1
  1104. package/esm/utils/type-assertions.test.d.ts +0 -1
  1105. package/esm/utils/type-assertions.test.js +0 -65
  1106. package/esm/utils/type-assertions.test.js.map +0 -1
  1107. /package/cjs/highlevel/{base.test.d.ts → methods/files/download-node-stream.d.ts} +0 -0
  1108. /package/cjs/storage/{providers/memory → memory}/driver.js +0 -0
  1109. /package/cjs/storage/{providers/memory → memory}/index.js +0 -0
  1110. /package/cjs/storage/{providers/memory → memory}/repository/auth-keys.js +0 -0
  1111. /package/cjs/storage/{providers/memory → memory}/repository/kv.js +0 -0
  1112. /package/cjs/storage/{providers/memory → memory}/repository/peers.js +0 -0
  1113. /package/cjs/storage/{providers/memory → memory}/repository/ref-messages.js +0 -0
  1114. /package/cjs/utils/{platform/error-reporting.js → error-reporting.js} +0 -0
  1115. /package/{cjs/highlevel/methods/files/_platform.d.ts → esm/highlevel/methods/files/download-node-stream.d.ts} +0 -0
  1116. /package/esm/storage/{providers/memory → memory}/driver.js +0 -0
  1117. /package/esm/storage/{providers/memory → memory}/index.js +0 -0
  1118. /package/esm/storage/{providers/memory → memory}/repository/auth-keys.js +0 -0
  1119. /package/esm/storage/{providers/memory → memory}/repository/kv.js +0 -0
  1120. /package/esm/storage/{providers/memory → memory}/repository/peers.js +0 -0
  1121. /package/esm/storage/{providers/memory → memory}/repository/ref-messages.js +0 -0
  1122. /package/esm/utils/{platform/error-reporting.js → error-reporting.js} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"input-inline-result.js","sourceRoot":"","sources":["../../../../../../src/highlevel/types/bots/input/input-inline-result.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAE7D,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AAC7F,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAC9D,OAAO,EAAE,gBAAgB,EAAsB,MAAM,2BAA2B,CAAA;AAofhF,2DAA2D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A;gBACF,SAAQ;aACX;YAED,IAAI,KAAK,CAAC,CAAC,KAAK,YAAY,EAAE;gBAC1B,KAAK,CAAC,IAAI,CAAC;oBACP,CAAC,EAAE,2BAA2B;oBAC9B,EAAE,EAAE,GAAG,CAAC,EAAE;oBACV,IAAI,EAAE,GAAG,CAAC,IAAI;oBACd,KAAK,EAAE,KAAK;oBACZ,WAAW;iBACd,CAAC,CAAA;gBACF,SAAQ;aACX;YAED,KAAK,CAAC,IAAI,CAAC;gBACP,CAAC,EAAE,8BAA8B;gBACjC,EAAE,EAAE,GAAG,CAAC,EAAE;gBACV,IAAI,EAAE,GAAG,CAAC,IAAI;gBACd,KAAK;gBACL,WAAW;gBACX,QAAQ,EAAE,KAAK;gBACf,WAAW;aACd,CAAC,CAAA;SACL;QAED,OAAO,CAAC,SAAS,IAAI,CAAC,aAAa,EAAE,KAAK,CAAC,CAAA;IAC/C,CAAC;IA5TqB,sBAAY,eA4TjC,CAAA;AACL,CAAC,EAxhBgB,SAAS,KAAT,SAAS,QAwhBzB","sourcesContent":["import { tl } from '@mtcute/tl'\n\nimport { MtArgumentError } from '../../../../types/errors.js'\nimport { ITelegramClient } from '../../../client.types.js'\nimport { fileIdToInputDocument, fileIdToInputPhoto } from '../../../utils/convert-file-id.js'\nimport { extractFileName } from '../../../utils/file-utils.js'\nimport { BotInlineMessage, InputInlineMessage } from './input-inline-message.js'\n\nexport interface BaseInputInlineResult {\n /**\n * Unique ID of the result\n */\n id: string\n\n /**\n * Message to send when the result is selected.\n *\n * By default, is automatically generated,\n * and details about how it is generated can be found\n * in subclasses' description\n */\n message?: InputInlineMessage\n}\n\n/**\n * Inline result containing an article.\n *\n * If `message` is not provided, a {@link InputInlineMessageText} is created\n * with web preview enabled and text generated as follows:\n * ```\n * {{#if url}}\n * <a href=\"{{url}}\"><b>{{title}}</b></a>\n * {{else}}\n * <b>{{title}}</b>\n * {{/if}}\n * {{#if description}}\n * {{description}}\n * {{/if}}\n * ```\n * > Handlebars syntax is used. HTML tags are used to signify entities,\n * > but in fact raw TL entity objects are created\n */\nexport interface InputInlineResultArticle extends BaseInputInlineResult {\n type: 'article'\n\n /**\n * Title of the result (must not be empty)\n */\n title: string\n\n /**\n * Description of the result\n */\n description?: string\n\n /**\n * URL of the article\n */\n url?: string\n\n /**\n * Whether to prevent article URL from\n * displaying by the client\n *\n * @default `false`\n */\n hideUrl?: boolean\n\n /**\n * Article thumbnail URL (must be jpeg).\n */\n thumb?: string | tl.RawInputWebDocument\n}\n\n/**\n * Inline result containing an animation (silent mp4 or gif).\n *\n * If `message` is not provided, {@link InputInlineMessageMedia} is used\n * with empty caption\n */\nexport interface InputInlineResultGif extends BaseInputInlineResult {\n type: 'gif'\n\n /**\n * The animation itself.\n *\n * Can be a URL, a TDLib and Bot API compatible File ID,\n * or a TL object representing either of them.\n */\n media: string | tl.RawInputWebDocument | tl.RawInputDocument\n\n /**\n * Media MIME type, only applicable to URLs.\n *\n * Usually unnecessary, since Telegram automatically infers it.\n *\n * @default `video/mp4`\n */\n mime?: string\n\n /**\n * Title of the result\n */\n title?: string\n\n /**\n * Title of the result\n */\n description?: string\n\n /**\n * Animation thumbnail URL, only applicable in case `media` is a URL\n *\n * @default `media`\n */\n thumb?: string | tl.RawInputWebDocument\n\n /**\n * Thumbnail MIME type\n *\n * @default `image/jpeg`\n */\n thumbMime?: string\n\n /**\n * Width of the animation in pixels\n */\n width?: number\n\n /**\n * Height of the animation in pixels\n */\n height?: number\n\n /**\n * Duration of the animation in seconds\n */\n duration?: number\n}\n\n/**\n * Inline result containing a video (only MP4)\n *\n * If `message` is not provided, {@link InputInlineMessageMedia} is used\n * with empty caption for non-embed videos, {@link InputInlineMessageText}\n * is used with text containing the URL for embed videos.\n */\nexport interface InputInlineResultVideo extends BaseInputInlineResult {\n type: 'video'\n\n /**\n * The video itself, or a page containing an embedded video\n *\n * Can be a URL, a TDLib and Bot API compatible File ID,\n * or a TL object representing either of them.\n */\n media: string | tl.RawInputWebDocument | tl.RawInputDocument\n\n /**\n * In case `media` is a URL, whether that URL is a link\n * to an embedded video player.\n */\n isEmbed?: boolean\n\n /**\n * Title of the result\n */\n title: string\n\n /**\n * Description of the result\n */\n description?: string\n\n /**\n * Video thumbnail URL (must be jpeg), only applicable in case `media` is a URL.\n *\n * Must be provided explicitly if this is a video loaded by URL.\n *\n * @default `media`\n */\n thumb?: string | tl.RawInputWebDocument\n\n /**\n * Width of the video in pixels\n */\n width?: number\n\n /**\n * Height of the video in pixels\n */\n height?: number\n\n /**\n * Duration of the video in seconds\n */\n duration?: number\n}\n\n/**\n * Inline result containing an audio file\n *\n * If `message` is not provided, {@link InputInlineMessageMedia} is used\n * with empty caption.\n */\nexport interface InputInlineResultAudio extends BaseInputInlineResult {\n type: 'audio'\n\n /**\n * The audio itself\n *\n * Can be a URL, a TDLib and Bot API compatible File ID,\n * or a TL object representing either of them.\n */\n media: string | tl.RawInputWebDocument | tl.RawInputDocument\n\n /**\n * MIME type of the audio file\n *\n * Usually unnecessary, since Telegram infers it automatically.\n *\n * @default `audio/mpeg`\n */\n mime?: string\n\n /**\n * Title of the audio track\n */\n title: string\n\n /**\n * Performer of the audio track\n */\n performer?: string\n\n /**\n * Duration of the audio in seconds\n */\n duration?: number\n}\n\n/**\n * Inline result containing a voice note\n *\n * If `message` is not provided, {@link InputInlineMessageMedia} is used\n * with empty caption.\n */\nexport interface InputInlineResultVoice extends BaseInputInlineResult {\n type: 'voice'\n\n /**\n * The voice itself (.ogg, preferably encoded with OPUS)\n *\n * Can be a URL, a TDLib and Bot API compatible File ID,\n * or a TL object representing either of them.\n */\n media: string | tl.RawInputWebDocument | tl.RawInputDocument\n\n /**\n * Title of the result\n */\n title: string\n\n /**\n * Duration of the voice note in seconds\n */\n duration?: number\n}\n\n/**\n * Inline result containing a photo\n *\n * If `message` is not provided, {@link InputInlineMessageMedia} is used\n * with empty caption.\n */\nexport interface InputInlineResultPhoto extends BaseInputInlineResult {\n type: 'photo'\n\n /**\n * The photo itself\n *\n * Can be a URL, a TDLib and Bot API compatible File ID,\n * or a TL object representing either of them.\n */\n media: string | tl.RawInputWebDocument | tl.RawInputPhoto\n\n /**\n * Title of the result\n */\n title?: string\n\n /**\n * Description of the result\n */\n description?: string\n\n /**\n * Width of the photo in pixels\n */\n width?: number\n\n /**\n * Height of the photo in pixels\n */\n height?: number\n\n /**\n * Photo thumbnail URL (must be jpeg), only applicable in case `media` is a URL\n *\n * @default `media`\n */\n thumb?: string | tl.RawInputWebDocument\n}\n\n/**\n * Inline result containing a sticker\n *\n * If `message` is not provided, {@link InputInlineMessageMedia} is used.\n */\nexport interface InputInlineResultSticker extends BaseInputInlineResult {\n type: 'sticker'\n\n /**\n * The sticker itself. Can't be a URL.\n */\n media: string | tl.RawInputDocument\n}\n\n/**\n * Inline result containing a document\n *\n * If `message` is not provided, {@link InputInlineMessageMedia} is used\n * with empty caption.\n */\nexport interface InputInlineResultFile extends BaseInputInlineResult {\n type: 'file'\n\n /**\n * The file itself. When using URL, only PDF and ZIP are supported.\n *\n * Can be a URL, a TDLib and Bot API compatible File ID,\n * or a TL object representing either of them.\n */\n media: string | tl.RawInputWebDocument | tl.RawInputDocument\n\n /**\n * MIME type of the file.\n *\n * Due to some Telegram limitation, you can only send\n * PDF and ZIP files from URL\n * (`application/pdf` and `application/zip` MIMEs respectively).\n *\n * Must be provided if `media` is a URL\n */\n mime?: string\n\n /**\n * Title of the result\n */\n title: string\n\n /**\n * Description of the result\n */\n description?: string\n\n /**\n * Photo thumbnail URL (must be jpeg), only applicable in case `media` is a URL\n *\n * @default `media`\n */\n thumb?: string | tl.RawInputWebDocument\n}\n\n/**\n * Inline result containing a geolocation.\n *\n * If `message` is not passed, a {@link InputInlineMessageGeo} is\n * used, with the `latitude` and `longitude` parameters set\n * accordingly\n */\nexport interface InputInlineResultGeo extends BaseInputInlineResult {\n type: 'geo'\n\n /**\n * Title of the result\n */\n title: string\n\n /**\n * Latitude of the geolocation\n */\n latitude: number\n\n /**\n * Longitude of the geolocation\n */\n longitude: number\n\n /**\n * Location thumbnail URL (must be jpeg).\n *\n * By default, Telegram generates one based on\n * the location set by `latitude` and `longitude`\n */\n thumb?: string | tl.RawInputWebDocument\n}\n\n/**\n * Inline result containing a venue.\n *\n * If `message` is not passed, {@link BotInlineMessage.venue} is used with\n * given `latitude` and `longitude` were passed.\n * If they weren't passed either, an error is thrown.\n */\nexport interface InputInlineResultVenue extends BaseInputInlineResult {\n type: 'venue'\n\n /**\n * Title of the venue\n */\n title: string\n\n /**\n * Address of the venue\n */\n address: string\n\n /**\n * Latitude of the geolocation\n */\n latitude?: number\n\n /**\n * Longitude of the geolocation\n */\n longitude?: number\n\n /**\n * Venue thumbnail URL (must be jpeg).\n *\n * By default, Telegram generates one based on\n * the location in the `message`\n */\n thumb?: string | tl.RawInputWebDocument\n}\n\n/**\n * Inline result containing a game.\n *\n * If `message` is not passed, {@link InputInlineMessageGame} is used.\n *\n * Note that `message` can only be {@link InputInlineMessageGame}\n */\nexport interface InputInlineResultGame extends BaseInputInlineResult {\n type: 'game'\n\n /**\n * Short name of the game\n */\n shortName: string\n}\n\n/**\n * Inline result containing a contact.\n *\n * If `message` is not passed, {@link InputInlineMessageContact} is used.\n */\nexport interface InputInlineResultContact extends BaseInputInlineResult {\n type: 'contact'\n\n /**\n * First name of the contact\n */\n firstName: string\n\n /**\n * Last name of the contact\n */\n lastName?: string\n\n /**\n * Phone number of the contact\n */\n phone: string\n\n /**\n * Contact thumbnail URL (i.e. their avatar) (must be jpeg)\n */\n thumb?: string | tl.RawInputWebDocument\n}\n\nexport type InputInlineResult =\n | InputInlineResultArticle\n | InputInlineResultGif\n | InputInlineResultVideo\n | InputInlineResultAudio\n | InputInlineResultVoice\n | InputInlineResultPhoto\n | InputInlineResultSticker\n | InputInlineResultFile\n | InputInlineResultGeo\n | InputInlineResultVenue\n | InputInlineResultGame\n | InputInlineResultContact\n\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace BotInline {\n /**\n * Create an inline result containing an article\n *\n * @param id Inline result ID\n * @param params Article\n */\n export function article(\n id: string,\n params: Omit<InputInlineResultArticle, 'type' | 'id'>,\n ): InputInlineResultArticle {\n const ret = params as tl.Mutable<InputInlineResultArticle>\n ret.id = id\n ret.type = 'article'\n\n return ret\n }\n\n /**\n * Create an inline result containing a GIF\n *\n * @param id Inline result ID\n * @param media GIF animation\n * @param params Additional parameters\n */\n export function gif(\n id: string,\n media: string | tl.RawInputWebDocument | tl.RawInputDocument,\n params: Omit<InputInlineResultGif, 'type' | 'id' | 'media'> = {},\n ): InputInlineResultGif {\n const ret = params as tl.Mutable<InputInlineResultGif>\n ret.id = id\n ret.type = 'gif'\n ret.media = media\n\n return ret\n }\n\n /**\n * Create an inline result containing a video\n *\n * @param id Inline result ID\n * @param media Video\n * @param params Additional parameters\n */\n export function video(\n id: string,\n media: string | tl.RawInputWebDocument | tl.RawInputDocument,\n params: Omit<InputInlineResultVideo, 'type' | 'id' | 'media'>,\n ): InputInlineResultVideo {\n const ret = params as tl.Mutable<InputInlineResultVideo>\n ret.id = id\n ret.type = 'video'\n ret.media = media\n\n return ret\n }\n\n /**\n * Create an inline result containing an audio file\n *\n * @param id Inline result ID\n * @param media Audio file\n * @param params Additional parameters\n */\n export function audio(\n id: string,\n media: string | tl.RawInputWebDocument | tl.RawInputDocument,\n params: Omit<InputInlineResultAudio, 'type' | 'id' | 'media'>,\n ): InputInlineResultAudio {\n const ret = params as tl.Mutable<InputInlineResultAudio>\n ret.id = id\n ret.type = 'audio'\n ret.media = media\n\n return ret\n }\n\n /**\n * Create an inline result containing a voice note\n *\n * @param id Inline result ID\n * @param media Voice note\n * @param params Additional parameters\n */\n export function voice(\n id: string,\n media: string | tl.RawInputWebDocument | tl.RawInputDocument,\n params: Omit<InputInlineResultVoice, 'type' | 'id' | 'media'>,\n ): InputInlineResultVoice {\n const ret = params as tl.Mutable<InputInlineResultVoice>\n ret.id = id\n ret.type = 'voice'\n ret.media = media\n\n return ret\n }\n\n /**\n * Create an inline result containing a photo\n *\n * @param id Inline result ID\n * @param media Photo\n * @param params Additional parameters\n */\n export function photo(\n id: string,\n media: string | tl.RawInputWebDocument | tl.RawInputPhoto,\n params: Omit<InputInlineResultPhoto, 'type' | 'id' | 'media'> = {},\n ): InputInlineResultPhoto {\n const ret = params as tl.Mutable<InputInlineResultPhoto>\n ret.id = id\n ret.type = 'photo'\n ret.media = media\n\n return ret\n }\n\n /**\n * Create an inline result containing a sticker\n *\n * @param id Inline result ID\n * @param media Sticker\n */\n export function sticker(id: string, media: string | tl.RawInputDocument): InputInlineResultSticker {\n return {\n id,\n type: 'sticker',\n media,\n }\n }\n\n /**\n * Create an inline result containing a document\n * (only PDF and ZIP are supported when using URL)\n *\n * @param id Inline result ID\n * @param media Document\n * @param params Additional parameters\n */\n export function file(\n id: string,\n media: string | tl.RawInputWebDocument | tl.RawInputDocument,\n params: Omit<InputInlineResultFile, 'type' | 'id' | 'media'>,\n ): InputInlineResultFile {\n const ret = params as tl.Mutable<InputInlineResultFile>\n ret.id = id\n ret.type = 'file'\n ret.media = media\n\n return ret\n }\n\n /**\n * Create an inline result containing a geolocation\n *\n * @param id Inline result ID\n * @param params Additional parameters\n */\n export function geo(id: string, params: Omit<InputInlineResultGeo, 'type' | 'id'>): InputInlineResultGeo {\n const ret = params as tl.Mutable<InputInlineResultGeo>\n ret.id = id\n ret.type = 'geo'\n\n return ret\n }\n\n /**\n * Create an inline result containing a venue\n *\n * @param id Inline result ID\n * @param params Venue parameters\n */\n export function venue(id: string, params: Omit<InputInlineResultVenue, 'type' | 'id'>): InputInlineResultVenue {\n const ret = params as tl.Mutable<InputInlineResultVenue>\n ret.id = id\n ret.type = 'venue'\n\n return ret\n }\n\n /**\n * Create an inline result containing a contact\n *\n * @param id Inline result ID\n * @param params Contact parameters\n */\n export function contact(\n id: string,\n params: Omit<InputInlineResultContact, 'type' | 'id'>,\n ): InputInlineResultContact {\n const ret = params as tl.Mutable<InputInlineResultContact>\n ret.id = id\n ret.type = 'contact'\n\n return ret\n }\n\n /**\n * Create an inline result containing a game\n *\n * @param id Inline result ID\n * @param shortName Short name of the game\n * @param params Additional parameters\n */\n export function game(\n id: string,\n shortName: string,\n params: Omit<InputInlineResultGame, 'type' | 'id' | 'shortName'> = {},\n ): InputInlineResultGame {\n const ret = params as tl.Mutable<InputInlineResultGame>\n ret.id = id\n ret.type = 'game'\n ret.shortName = shortName\n\n return ret\n }\n\n /** @internal */\n export async function _convertToTl(\n client: ITelegramClient,\n results: InputInlineResult[],\n ): Promise<[boolean, tl.TypeInputBotInlineResult[]]> {\n const normalizeThumb = (obj: InputInlineResult, fallback?: string): tl.RawInputWebDocument | undefined => {\n if (obj.type !== 'voice' && obj.type !== 'audio' && obj.type !== 'sticker' && obj.type !== 'game') {\n if (!obj.thumb || typeof obj.thumb === 'string') {\n if (!obj.thumb && !fallback) {\n return undefined\n }\n\n return {\n _: 'inputWebDocument',\n size: 0,\n url: obj.thumb || fallback!,\n mimeType: obj.type === 'gif' ? obj.thumbMime ?? obj.mime ?? 'video/mp4' : 'image/jpeg',\n attributes: [],\n }\n }\n\n return obj.thumb\n }\n }\n\n const items: tl.TypeInputBotInlineResult[] = []\n\n let isGallery = false\n let forceVertical = false\n\n for (const obj of results) {\n switch (obj.type) {\n case 'article': {\n forceVertical = true\n\n let sendMessage: tl.TypeInputBotInlineMessage\n\n if (obj.message) {\n sendMessage = await BotInlineMessage._convertToTl(client, obj.message)\n } else {\n let message = obj.title\n const entities: tl.TypeMessageEntity[] = [\n {\n _: 'messageEntityBold',\n offset: 0,\n length: message.length,\n },\n ]\n\n if (obj.url) {\n entities.push({\n _: 'messageEntityTextUrl',\n url: obj.url,\n offset: 0,\n length: message.length,\n })\n }\n\n if (obj.description) {\n message += '\\n' + obj.description\n }\n\n sendMessage = {\n _: 'inputBotInlineMessageText',\n message,\n entities,\n }\n }\n\n items.push({\n _: 'inputBotInlineResult',\n id: obj.id,\n type: obj.type,\n title: obj.title,\n description: obj.description,\n url: obj.hideUrl ? undefined : obj.url,\n content:\n obj.url && obj.hideUrl ?\n {\n _: 'inputWebDocument',\n url: obj.url,\n mimeType: 'text/html',\n size: 0,\n attributes: [],\n } :\n undefined,\n thumb: typeof obj.thumb === 'string' ? normalizeThumb(obj) : obj.thumb,\n sendMessage,\n })\n continue\n }\n case 'game': {\n let sendMessage: tl.TypeInputBotInlineMessage\n\n if (obj.message) {\n sendMessage = await BotInlineMessage._convertToTl(client, obj.message)\n\n if (sendMessage._ !== 'inputBotInlineMessageGame') {\n throw new MtArgumentError('game inline result must contain a game inline message')\n }\n } else {\n sendMessage = {\n _: 'inputBotInlineMessageGame',\n }\n }\n\n items.push({\n _: 'inputBotInlineResultGame',\n id: obj.id,\n shortName: obj.shortName,\n sendMessage,\n })\n continue\n }\n case 'gif':\n case 'photo':\n case 'sticker':\n isGallery = true\n break\n case 'audio':\n case 'contact':\n case 'voice':\n forceVertical = true\n }\n\n let sendMessage: tl.TypeInputBotInlineMessage\n\n if (obj.message) {\n sendMessage = await BotInlineMessage._convertToTl(client, obj.message)\n } else if (obj.type === 'venue') {\n if (obj.latitude && obj.longitude) {\n sendMessage = {\n _: 'inputBotInlineMessageMediaVenue',\n title: obj.title,\n address: obj.address,\n geoPoint: {\n _: 'inputGeoPoint',\n lat: obj.latitude,\n long: obj.longitude,\n },\n provider: '',\n venueId: '',\n venueType: '',\n }\n } else {\n throw new MtArgumentError('message or location (lat&lon) bust be supplied for venue inline result')\n }\n } else if (obj.type === 'video' && obj.isEmbed && typeof obj.media === 'string') {\n sendMessage = {\n _: 'inputBotInlineMessageText',\n message: obj.media,\n }\n } else if (obj.type === 'geo') {\n sendMessage = {\n _: 'inputBotInlineMessageMediaGeo',\n geoPoint: {\n _: 'inputGeoPoint',\n lat: obj.latitude,\n long: obj.longitude,\n },\n }\n } else if (obj.type === 'contact') {\n sendMessage = {\n _: 'inputBotInlineMessageMediaContact',\n phoneNumber: obj.phone,\n firstName: obj.firstName,\n lastName: obj.lastName ?? '',\n vcard: '',\n }\n } else {\n sendMessage = {\n _: 'inputBotInlineMessageMediaAuto',\n message: '',\n }\n }\n\n let media: tl.TypeInputWebDocument | tl.TypeInputDocument | tl.TypeInputPhoto | undefined = undefined\n\n if (obj.type !== 'geo' && obj.type !== 'venue' && obj.type !== 'contact') {\n if (typeof obj.media === 'string') {\n // file id or url\n if (obj.media.match(/^https?:\\/\\//)) {\n if (obj.type === 'sticker') {\n throw new MtArgumentError('sticker inline result cannot contain a URL')\n }\n\n let mime: string\n if (obj.type === 'video') mime = 'video/mp4'\n else if (obj.type === 'audio') {\n mime = obj.mime ?? 'audio/mpeg'\n } else if (obj.type === 'gif') {\n mime = obj.mime ?? 'video/mp4'\n } else if (obj.type === 'voice') mime = 'audio/ogg'\n else if (obj.type === 'file') {\n if (!obj.mime) {\n throw new MtArgumentError('MIME type must be specified for file inline result')\n }\n\n mime = obj.mime\n } else mime = 'image/jpeg'\n\n const attributes: tl.TypeDocumentAttribute[] = []\n\n if (\n (obj.type === 'video' || obj.type === 'gif' || obj.type === 'photo') &&\n obj.width &&\n obj.height\n ) {\n if (obj.type !== 'photo' && obj.duration) {\n attributes.push({\n _: 'documentAttributeVideo',\n w: obj.width,\n h: obj.height,\n duration: obj.duration,\n })\n } else {\n attributes.push({\n _: 'documentAttributeImageSize',\n w: obj.width,\n h: obj.height,\n })\n }\n } else if (obj.type === 'audio' || obj.type === 'voice') {\n attributes.push({\n _: 'documentAttributeAudio',\n voice: obj.type === 'voice',\n duration: obj.duration ?? 0,\n title: obj.type === 'audio' ? obj.title : '',\n performer: obj.type === 'audio' ? obj.performer : '',\n })\n }\n\n attributes.push({\n _: 'documentAttributeFilename',\n fileName: extractFileName(obj.media),\n })\n\n media = {\n _: 'inputWebDocument',\n url: obj.media,\n mimeType: mime,\n size: 0,\n attributes,\n }\n } else if (obj.type === 'photo') {\n media = fileIdToInputPhoto(obj.media)\n } else {\n media = fileIdToInputDocument(obj.media)\n }\n } else {\n media = obj.media\n }\n }\n\n let title: string | undefined = undefined\n let description: string | undefined = undefined\n\n // incredible hacks by durov team.\n // i honestly don't understand why didn't they just\n // make a bunch of types, as they normally do,\n // but whatever.\n // ref: https://github.com/tdlib/td/blob/master/td/telegram/InlineQueriesManager.cpp\n if (obj.type === 'contact') {\n title = obj.lastName?.length ? `${obj.firstName} ${obj.lastName}` : obj.firstName\n } else if (obj.type !== 'sticker') {\n title = obj.title\n }\n\n if (obj.type === 'audio') {\n description = obj.performer\n } else if (obj.type === 'geo') {\n description = `${obj.latitude} ${obj.longitude}`\n } else if (obj.type === 'venue') {\n description = obj.address\n } else if (obj.type === 'contact') {\n description = obj.phone\n } else if (obj.type !== 'voice' && obj.type !== 'sticker') {\n description = obj.description\n }\n\n if (!media || media._ === 'inputWebDocument') {\n items.push({\n _: 'inputBotInlineResult',\n id: obj.id,\n type: obj.type,\n title,\n description,\n content: media,\n thumb: normalizeThumb(obj, media?.url),\n sendMessage,\n })\n continue\n }\n\n if (media._ === 'inputPhoto') {\n items.push({\n _: 'inputBotInlineResultPhoto',\n id: obj.id,\n type: obj.type,\n photo: media,\n sendMessage,\n })\n continue\n }\n\n items.push({\n _: 'inputBotInlineResultDocument',\n id: obj.id,\n type: obj.type,\n title,\n description,\n document: media,\n sendMessage,\n })\n }\n\n return [isGallery && !forceVertical, items]\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"keyboard-builder.js","sourceRoot":"","sources":["../../../../../src/highlevel/types/bots/keyboard-builder.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,MAAM,OAAO,kBAAkB;IAG3B,YAAqB,cAA6B,CAAC;QAA9B,gBAAW,GAAX,WAAW,CAAmB;QAF3C,aAAQ,GAA8B,EAAE,CAAA;IAEM,CAAC;IAEvD;;;;OAIG;IACH,IAAI,CAAC,GAAG,OAA4C;QAChD,IAAI,CAAC,OAAO,CAAC,MAAM;YAAE,OAAO,IAAI,CAAA;QAEhC,IAAI,GAAG,GAA4B,EAAE,CAAA;QACrC,OAAO,CAAC,OAAO,CAAC,CAA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,CAAC,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,EAC3G;YACE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;SACpD;aAAM;YACH,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;SAC5B;QAED,OAAO,IAAI,CAAA;IACf,CAAC;IAED;;OAEG;IACH,QAAQ;QACJ,OAAO;YACH,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,IAAI,CAAC,QAAQ;SACzB,CAAA;IACL,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,SAAwD,EAAE;QAC9D,MAAM,GAAG,GAAG,MAAyC,CAAA;QACrD,GAAG,CAAC,IAAI,GAAG,OAAO,CAAA;QAClB,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAA;QAE3B,OAAO,GAAG,CAAA;IACd,CAAC;CACJ","sourcesContent":["import { tl } from '@mtcute/tl'\n\nimport type { InlineKeyboardMarkup, ReplyKeyboardMarkup } from './keyboards.js'\n\nexport type ButtonLike = tl.TypeKeyboardButton | false | null | undefined | void\n\n/**\n * Builder for bot keyboards\n */\nexport class BotKeyboardBuilder {\n private _buttons: tl.TypeKeyboardButton[][] = []\n\n constructor(readonly maxRowWidth: number | null = 3) {}\n\n /**\n * Add buttons, wrapping them once {@link maxRowWidth} is reached\n *\n * @param buttons Buttons to add\n */\n push(...buttons: (ButtonLike | (() => ButtonLike))[]): this {\n if (!buttons.length) return this\n\n let row: tl.TypeKeyboardButton[] = []\n buttons.forEach((btn) => {\n if (typeof btn === 'function') btn = btn()\n if (!btn) return\n\n row.push(btn)\n\n if (row.length === this.maxRowWidth) {\n this._buttons.push(row)\n row = []\n }\n })\n\n if (row.length) {\n this._buttons.push(row)\n }\n\n return this\n }\n\n /**\n * Add a row of buttons. Will not be wrapped.\n *\n * @param row Row or a function that will populate it\n */\n row(row: ButtonLike[] | ((arr: ButtonLike[]) => void)): this {\n if (typeof row === 'function') {\n const fn = row\n row = []\n fn(row)\n }\n\n const normal = row.filter(Boolean) as tl.TypeKeyboardButton[]\n if (normal.length) this._buttons.push(normal)\n\n return this\n }\n\n /**\n * Append a button to the last row, wrapping if needed.\n *\n * @param btn Button to add\n * @param force Whether to forcefully add the button (i.e. do not wrap)\n */\n append(btn: ButtonLike | (() => ButtonLike), force = false): this {\n if (typeof btn === 'function') btn = btn()\n if (!btn) return this\n\n if (\n this._buttons.length &&\n (this.maxRowWidth === null || force || this._buttons[this._buttons.length - 1].length < this.maxRowWidth)\n ) {\n this._buttons[this._buttons.length - 1].push(btn)\n } else {\n this._buttons.push([btn])\n }\n\n return this\n }\n\n /**\n * Return contents of this builder as an inline keyboard\n */\n asInline(): InlineKeyboardMarkup {\n return {\n type: 'inline',\n buttons: this._buttons,\n }\n }\n\n /**\n * Return contents of this builder as a reply keyboard\n */\n asReply(params: Omit<ReplyKeyboardMarkup, 'type' | 'buttons'> = {}): ReplyKeyboardMarkup {\n const ret = params as tl.Mutable<ReplyKeyboardMarkup>\n ret.type = 'reply'\n ret.buttons = this._buttons\n\n return ret\n }\n}\n"]}
@@ -1 +0,0 @@
1
- export {};
@@ -1,160 +0,0 @@
1
- import { describe, expect, it } from 'vitest';
2
- import { BotKeyboardBuilder } from './keyboard-builder.js';
3
- describe('BotKeyboardBuilder', () => {
4
- describe('#push', () => {
5
- it('should add buttons', () => {
6
- const builder = new BotKeyboardBuilder();
7
- builder.push({ _: 'keyboardButton', text: '1' }, { _: 'keyboardButton', text: '2' }, { _: 'keyboardButton', text: '3' });
8
- expect(builder.asInline()).toEqual({
9
- type: 'inline',
10
- buttons: [
11
- [
12
- { _: 'keyboardButton', text: '1' },
13
- { _: 'keyboardButton', text: '2' },
14
- { _: 'keyboardButton', text: '3' },
15
- ],
16
- ],
17
- });
18
- });
19
- it('should wrap long rows buttons', () => {
20
- const builder = new BotKeyboardBuilder(3);
21
- builder.push({ _: 'keyboardButton', text: '1' }, { _: 'keyboardButton', text: '2' }, { _: 'keyboardButton', text: '3' }, { _: 'keyboardButton', text: '4' });
22
- expect(builder.asInline()).toEqual({
23
- type: 'inline',
24
- buttons: [
25
- [
26
- { _: 'keyboardButton', text: '1' },
27
- { _: 'keyboardButton', text: '2' },
28
- { _: 'keyboardButton', text: '3' },
29
- ],
30
- [{ _: 'keyboardButton', text: '4' }],
31
- ],
32
- });
33
- });
34
- it('should always add a new row', () => {
35
- const builder = new BotKeyboardBuilder(3);
36
- builder.push({ _: 'keyboardButton', text: '1' });
37
- builder.push({ _: 'keyboardButton', text: '2' });
38
- builder.push({ _: 'keyboardButton', text: '3' });
39
- expect(builder.asInline()).toEqual({
40
- type: 'inline',
41
- buttons: [
42
- [{ _: 'keyboardButton', text: '1' }],
43
- [{ _: 'keyboardButton', text: '2' }],
44
- [{ _: 'keyboardButton', text: '3' }],
45
- ],
46
- });
47
- });
48
- it('should accept functions and falsy values', () => {
49
- const builder = new BotKeyboardBuilder(3);
50
- builder.push({ _: 'keyboardButton', text: '1' });
51
- builder.push(() => ({ _: 'keyboardButton', text: '2' }));
52
- builder.push(1 > 1 && { _: 'keyboardButton', text: '3' });
53
- expect(builder.asInline()).toEqual({
54
- type: 'inline',
55
- buttons: [[{ _: 'keyboardButton', text: '1' }], [{ _: 'keyboardButton', text: '2' }]],
56
- });
57
- });
58
- });
59
- describe('#append', () => {
60
- it('should append (or wrap) to the last row', () => {
61
- const builder = new BotKeyboardBuilder(3);
62
- builder.append({ _: 'keyboardButton', text: '1' });
63
- builder.append({ _: 'keyboardButton', text: '2' });
64
- builder.append({ _: 'keyboardButton', text: '3' });
65
- builder.append({ _: 'keyboardButton', text: '4' });
66
- expect(builder.asInline()).toEqual({
67
- type: 'inline',
68
- buttons: [
69
- [
70
- { _: 'keyboardButton', text: '1' },
71
- { _: 'keyboardButton', text: '2' },
72
- { _: 'keyboardButton', text: '3' },
73
- ],
74
- [{ _: 'keyboardButton', text: '4' }],
75
- ],
76
- });
77
- });
78
- it('accept functions and falsy values', () => {
79
- const builder = new BotKeyboardBuilder(3);
80
- builder.append({ _: 'keyboardButton', text: '1' });
81
- builder.append(() => ({ _: 'keyboardButton', text: '2' }));
82
- builder.append(1 > 1 && { _: 'keyboardButton', text: '3' });
83
- expect(builder.asInline()).toEqual({
84
- type: 'inline',
85
- buttons: [
86
- [
87
- { _: 'keyboardButton', text: '1' },
88
- { _: 'keyboardButton', text: '2' },
89
- ],
90
- ],
91
- });
92
- });
93
- });
94
- it('should accept custom row size', () => {
95
- const builder = new BotKeyboardBuilder(5);
96
- builder.append({ _: 'keyboardButton', text: '1' });
97
- builder.append({ _: 'keyboardButton', text: '2' });
98
- builder.append({ _: 'keyboardButton', text: '3' });
99
- builder.append({ _: 'keyboardButton', text: '4' });
100
- builder.append({ _: 'keyboardButton', text: '5' });
101
- builder.append({ _: 'keyboardButton', text: '6' });
102
- expect(builder.asInline()).toEqual({
103
- type: 'inline',
104
- buttons: [
105
- [
106
- { _: 'keyboardButton', text: '1' },
107
- { _: 'keyboardButton', text: '2' },
108
- { _: 'keyboardButton', text: '3' },
109
- { _: 'keyboardButton', text: '4' },
110
- { _: 'keyboardButton', text: '5' },
111
- ],
112
- [{ _: 'keyboardButton', text: '6' }],
113
- ],
114
- });
115
- });
116
- it('#row should add entire rows of buttons', () => {
117
- const builder = new BotKeyboardBuilder(3);
118
- builder.row([
119
- { _: 'keyboardButton', text: '1' },
120
- { _: 'keyboardButton', text: '2' },
121
- { _: 'keyboardButton', text: '3' },
122
- { _: 'keyboardButton', text: '4' },
123
- { _: 'keyboardButton', text: '5' },
124
- ]);
125
- builder.append({ _: 'keyboardButton', text: '6' });
126
- expect(builder.asInline()).toEqual({
127
- type: 'inline',
128
- buttons: [
129
- [
130
- { _: 'keyboardButton', text: '1' },
131
- { _: 'keyboardButton', text: '2' },
132
- { _: 'keyboardButton', text: '3' },
133
- { _: 'keyboardButton', text: '4' },
134
- { _: 'keyboardButton', text: '5' },
135
- ],
136
- [{ _: 'keyboardButton', text: '6' }],
137
- ],
138
- });
139
- });
140
- it('should support reply keyboards', () => {
141
- const builder = new BotKeyboardBuilder(3);
142
- builder.append({ _: 'keyboardButton', text: '1' });
143
- builder.append({ _: 'keyboardButton', text: '2' });
144
- builder.append({ _: 'keyboardButton', text: '3' });
145
- builder.append({ _: 'keyboardButton', text: '4' });
146
- expect(builder.asReply({ resize: true })).toEqual({
147
- type: 'reply',
148
- resize: true,
149
- buttons: [
150
- [
151
- { _: 'keyboardButton', text: '1' },
152
- { _: 'keyboardButton', text: '2' },
153
- { _: 'keyboardButton', text: '3' },
154
- ],
155
- [{ _: 'keyboardButton', text: '4' }],
156
- ],
157
- });
158
- });
159
- });
160
- //# sourceMappingURL=keyboard-builder.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"keyboard-builder.test.js","sourceRoot":"","sources":["../../../../../src/highlevel/types/bots/keyboard-builder.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAE7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAE1D,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAChC,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;QACnB,EAAE,CAAC,oBAAoB,EAAE,GAAG,EAAE;YAC1B,MAAM,OAAO,GAAG,IAAI,kBAAkB,EAAE,CAAA;YAExC,OAAO,CAAC,IAAI,CACR,EAAE,CAAC,EAAE,gBAAgB,EAAE,IAAI,EAAE,GAAG,EAAE,EAClC,EAAE,CAAC,EAAE,gBAAgB,EAAE,IAAI,EAAE,GAAG,EAAE,EAClC,EAAE,CAAC,EAAE,gBAAgB,EAAE,IAAI,EAAE,GAAG,EAAE,CACrC,CAAA;YAED,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC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,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;YAC9C,IAAI,EAAE,OAAO;YACb,MAAM,EAAE,IAAI;YACZ,OAAO,EAAE;gBACL;oBACI,EAAE,CAAC,EAAE,gBAAgB,EAAE,IAAI,EAAE,GAAG,EAAE;oBAClC,EAAE,CAAC,EAAE,gBAAgB,EAAE,IAAI,EAAE,GAAG,EAAE;oBAClC,EAAE,CAAC,EAAE,gBAAgB,EAAE,IAAI,EAAE,GAAG,EAAE;iBACrC;gBACD,CAAC,EAAE,CAAC,EAAE,gBAAgB,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;aACvC;SACJ,CAAC,CAAA;IACN,CAAC,CAAC,CAAA;AACN,CAAC,CAAC,CAAA","sourcesContent":["import { describe, expect, it } from 'vitest'\n\nimport { BotKeyboardBuilder } from './keyboard-builder.js'\n\ndescribe('BotKeyboardBuilder', () => {\n describe('#push', () => {\n it('should add buttons', () => {\n const builder = new BotKeyboardBuilder()\n\n builder.push(\n { _: 'keyboardButton', text: '1' },\n { _: 'keyboardButton', text: '2' },\n { _: 'keyboardButton', text: '3' },\n )\n\n expect(builder.asInline()).toEqual({\n type: 'inline',\n buttons: [\n [\n { _: 'keyboardButton', text: '1' },\n { _: 'keyboardButton', text: '2' },\n { _: 'keyboardButton', text: '3' },\n ],\n ],\n })\n })\n\n it('should wrap long rows buttons', () => {\n const builder = new BotKeyboardBuilder(3)\n\n builder.push(\n { _: 'keyboardButton', text: '1' },\n { _: 'keyboardButton', text: '2' },\n { _: 'keyboardButton', text: '3' },\n { _: 'keyboardButton', text: '4' },\n )\n\n expect(builder.asInline()).toEqual({\n type: 'inline',\n buttons: [\n [\n { _: 'keyboardButton', text: '1' },\n { _: 'keyboardButton', text: '2' },\n { _: 'keyboardButton', text: '3' },\n ],\n [{ _: 'keyboardButton', text: '4' }],\n ],\n })\n })\n\n it('should always add a new row', () => {\n const builder = new BotKeyboardBuilder(3)\n\n builder.push({ _: 'keyboardButton', text: '1' })\n builder.push({ _: 'keyboardButton', text: '2' })\n builder.push({ _: 'keyboardButton', text: '3' })\n\n expect(builder.asInline()).toEqual({\n type: 'inline',\n buttons: [\n [{ _: 'keyboardButton', text: '1' }],\n [{ _: 'keyboardButton', text: '2' }],\n [{ _: 'keyboardButton', text: '3' }],\n ],\n })\n })\n\n it('should accept functions and falsy values', () => {\n const builder = new BotKeyboardBuilder(3)\n\n builder.push({ _: 'keyboardButton', text: '1' })\n builder.push(() => ({ _: 'keyboardButton', text: '2' }))\n builder.push(1 > 1 && { _: 'keyboardButton', text: '3' })\n\n expect(builder.asInline()).toEqual({\n type: 'inline',\n buttons: [[{ _: 'keyboardButton', text: '1' }], [{ _: 'keyboardButton', text: '2' }]],\n })\n })\n })\n\n describe('#append', () => {\n it('should append (or wrap) to the last row', () => {\n const builder = new BotKeyboardBuilder(3)\n\n builder.append({ _: 'keyboardButton', text: '1' })\n builder.append({ _: 'keyboardButton', text: '2' })\n builder.append({ _: 'keyboardButton', text: '3' })\n builder.append({ _: 'keyboardButton', text: '4' })\n\n expect(builder.asInline()).toEqual({\n type: 'inline',\n buttons: [\n [\n { _: 'keyboardButton', text: '1' },\n { _: 'keyboardButton', text: '2' },\n { _: 'keyboardButton', text: '3' },\n ],\n [{ _: 'keyboardButton', text: '4' }],\n ],\n })\n })\n\n it('accept functions and falsy values', () => {\n const builder = new BotKeyboardBuilder(3)\n\n builder.append({ _: 'keyboardButton', text: '1' })\n builder.append(() => ({ _: 'keyboardButton', text: '2' }))\n builder.append(1 > 1 && { _: 'keyboardButton', text: '3' })\n\n expect(builder.asInline()).toEqual({\n type: 'inline',\n buttons: [\n [\n { _: 'keyboardButton', text: '1' },\n { _: 'keyboardButton', text: '2' },\n ],\n ],\n })\n })\n })\n\n it('should accept custom row size', () => {\n const builder = new BotKeyboardBuilder(5)\n\n builder.append({ _: 'keyboardButton', text: '1' })\n builder.append({ _: 'keyboardButton', text: '2' })\n builder.append({ _: 'keyboardButton', text: '3' })\n builder.append({ _: 'keyboardButton', text: '4' })\n builder.append({ _: 'keyboardButton', text: '5' })\n builder.append({ _: 'keyboardButton', text: '6' })\n\n expect(builder.asInline()).toEqual({\n type: 'inline',\n buttons: [\n [\n { _: 'keyboardButton', text: '1' },\n { _: 'keyboardButton', text: '2' },\n { _: 'keyboardButton', text: '3' },\n { _: 'keyboardButton', text: '4' },\n { _: 'keyboardButton', text: '5' },\n ],\n [{ _: 'keyboardButton', text: '6' }],\n ],\n })\n })\n\n it('#row should add entire rows of buttons', () => {\n const builder = new BotKeyboardBuilder(3)\n\n builder.row([\n { _: 'keyboardButton', text: '1' },\n { _: 'keyboardButton', text: '2' },\n { _: 'keyboardButton', text: '3' },\n { _: 'keyboardButton', text: '4' },\n { _: 'keyboardButton', text: '5' },\n ])\n builder.append({ _: 'keyboardButton', text: '6' })\n\n expect(builder.asInline()).toEqual({\n type: 'inline',\n buttons: [\n [\n { _: 'keyboardButton', text: '1' },\n { _: 'keyboardButton', text: '2' },\n { _: 'keyboardButton', text: '3' },\n { _: 'keyboardButton', text: '4' },\n { _: 'keyboardButton', text: '5' },\n ],\n [{ _: 'keyboardButton', text: '6' }],\n ],\n })\n })\n\n it('should support reply keyboards', () => {\n const builder = new BotKeyboardBuilder(3)\n\n builder.append({ _: 'keyboardButton', text: '1' })\n builder.append({ _: 'keyboardButton', text: '2' })\n builder.append({ _: 'keyboardButton', text: '3' })\n builder.append({ _: 'keyboardButton', text: '4' })\n\n expect(builder.asReply({ resize: true })).toEqual({\n type: 'reply',\n resize: true,\n buttons: [\n [\n { _: 'keyboardButton', text: '1' },\n { _: 'keyboardButton', text: '2' },\n { _: 'keyboardButton', text: '3' },\n ],\n [{ _: 'keyboardButton', text: '4' }],\n ],\n })\n })\n})\n"]}
@@ -1,239 +0,0 @@
1
- import { tl } from '@mtcute/tl';
2
- import { BotKeyboardBuilder } from './keyboard-builder.js';
3
- /**
4
- * Reply keyboard markup
5
- */
6
- export interface ReplyKeyboardMarkup extends Omit<tl.RawReplyKeyboardMarkup, '_' | 'rows'> {
7
- readonly type: 'reply';
8
- /**
9
- * Two-dimensional array of buttons
10
- */
11
- readonly buttons: tl.TypeKeyboardButton[][];
12
- }
13
- /**
14
- * Hide previously sent bot keyboard
15
- */
16
- export interface ReplyKeyboardHide extends Omit<tl.RawReplyKeyboardHide, '_'> {
17
- readonly type: 'reply_hide';
18
- }
19
- /**
20
- * Force the user to send a reply
21
- */
22
- export interface ReplyKeyboardForceReply extends Omit<tl.RawReplyKeyboardForceReply, '_'> {
23
- readonly type: 'force_reply';
24
- }
25
- /**
26
- * Inline keyboard markup
27
- */
28
- export interface InlineKeyboardMarkup {
29
- readonly type: 'inline';
30
- /**
31
- * Two-dimensional array of buttons
32
- */
33
- readonly buttons: tl.TypeKeyboardButton[][];
34
- }
35
- export type ReplyMarkup = ReplyKeyboardMarkup | ReplyKeyboardHide | ReplyKeyboardForceReply | InlineKeyboardMarkup | tl.TypeReplyMarkup;
36
- /**
37
- * Convenience methods wrapping TL
38
- * objects creation for bot keyboard buttons.
39
- *
40
- * You can also use the type-discriminated objects directly.
41
- *
42
- * > **Note**: Button creation functions are intended to be used
43
- * > with inline reply markup, unless stated otherwise
44
- * > in the description.
45
- */
46
- export declare namespace BotKeyboard {
47
- /** Create a keyboard builder */
48
- function builder(maxRowWidth?: number | null): BotKeyboardBuilder;
49
- /**
50
- * Create an inline keyboard markup
51
- *
52
- * @param buttons Two-dimensional array of buttons
53
- */
54
- function inline(buttons: tl.TypeKeyboardButton[][]): InlineKeyboardMarkup;
55
- /**
56
- * Create a reply keyboard markup
57
- *
58
- * @param buttons Two-dimensional array of buttons
59
- * @param params Additional parameters for the keyboard
60
- */
61
- function reply(buttons: tl.TypeKeyboardButton[][], params?: Omit<ReplyKeyboardMarkup, 'type' | 'buttons'>): ReplyKeyboardMarkup;
62
- /**
63
- * Hide the previously sent reply keyboard
64
- *
65
- * @param selective
66
- * Whether to remove the keyboard for specific users only. Targets:
67
- * - users that are @mentioned in the text of the Message
68
- * - in case this is a reply, sender of the original message
69
- */
70
- function hideReply(selective?: boolean): ReplyKeyboardHide;
71
- /**
72
- * Force the user to send a reply
73
- */
74
- function forceReply(params?: Omit<ReplyKeyboardForceReply, 'type'>): ReplyKeyboardForceReply;
75
- /**
76
- * Create a text-only keyboard button.
77
- *
78
- * Used for reply keyboards, not inline!
79
- *
80
- * @param text Button text
81
- */
82
- function text(text: string): tl.RawKeyboardButton;
83
- /**
84
- * Create a keyboard button requesting for user's contact.
85
- * Available only for private chats.
86
- *
87
- * Used for reply keyboards, not inline!
88
- *
89
- * @param text Button text
90
- */
91
- function requestContact(text: string): tl.RawKeyboardButtonRequestPhone;
92
- /**
93
- * Create a keyboard button requesting for user's geo location.
94
- * Available only for private chats.
95
- *
96
- * Used for reply keyboards, not inline!
97
- *
98
- * @param text Button text
99
- */
100
- function requestGeo(text: string): tl.RawKeyboardButtonRequestGeoLocation;
101
- /**
102
- * Create a keyboard button requesting the user to create and send a poll.
103
- * Available only for private chats.
104
- *
105
- * Used for reply keyboards, not inline!
106
- *
107
- * @param text Button text
108
- * @param quiz If set, only quiz polls can be sent
109
- */
110
- function requestPoll(text: string, quiz?: boolean): tl.RawKeyboardButtonRequestPoll;
111
- /**
112
- * Create a keyboard button with a link.
113
- *
114
- * Used for inline keyboards, not reply!
115
- *
116
- * @param text Button text
117
- * @param url URL
118
- */
119
- function url(text: string, url: string): tl.RawKeyboardButtonUrl;
120
- /**
121
- * Create a keyboard button with a link.
122
- *
123
- * Used for inline keyboards, not reply!
124
- *
125
- * @param text Button text
126
- * @param data Callback data (1-64 bytes). String will be converted to `Buffer`
127
- * @param requiresPassword
128
- * Whether the user should verify their identity by entering 2FA password.
129
- * See more: {@link tl.RawKeyboardButtonCallback#requiresPassword}
130
- */
131
- function callback(text: string, data: string | Uint8Array, requiresPassword?: boolean): tl.RawKeyboardButtonCallback;
132
- /**
133
- * Button to force a user to switch to inline mode.
134
- *
135
- * Pressing the button will prompt the user to select
136
- * one of their chats, open that chat and insert the bot‘s
137
- * username and the specified inline query (if any) in the input field.
138
- *
139
- * Used for inline keyboards, not reply!
140
- *
141
- * @param text Button text
142
- * @param query Inline query (can be empty or omitted)
143
- * @param currentChat
144
- * If set, pressing the button will insert the bot's username
145
- * and the specified inline query in the current chat's input field
146
- */
147
- function switchInline(text: string, query?: string, currentChat?: boolean): tl.RawKeyboardButtonSwitchInline;
148
- /**
149
- * Button to start a game
150
- *
151
- * Used for inline keyboards, not reply!
152
- *
153
- * **Note**: This type of button must always be
154
- * the first button in the first row. ID of the
155
- * game is inferred from {@link InputMedia.game},
156
- * thus this button should only be used with it.
157
- */
158
- function game(text: string): tl.RawKeyboardButtonGame;
159
- /**
160
- * Button to pay for a product.
161
- *
162
- * Used for inline keyboards, not reply!
163
- *
164
- * **Note**: This type of button must always be
165
- * the first button in the first row. Related
166
- * invoice is inferred from {@link InputMedia.invoice},
167
- * thus this button should only be used with it.
168
- */
169
- function pay(text: string): tl.RawKeyboardButtonBuy;
170
- /**
171
- * Button to authorize a user
172
- *
173
- * Used for inline keyboards, not reply!
174
- *
175
- * @param text Button label
176
- * @param url Authorization URL (see {@link tl.RawInputKeyboardButtonUrlAuth})
177
- * @param params
178
- */
179
- function urlAuth(text: string, url: string, params?: {
180
- /**
181
- * Button label when forwarded
182
- */
183
- fwdText?: string;
184
- /**
185
- * Whether to request the permission for
186
- * your bot to send messages to the user
187
- */
188
- requestWriteAccess?: boolean;
189
- /**
190
- * Bot, which will be used for user authorization.
191
- * `url` domain must be the same as the domain linked
192
- * with the bot.
193
- *
194
- * @default current bot
195
- */
196
- bot?: tl.TypeInputUser;
197
- }): tl.RawInputKeyboardButtonUrlAuth;
198
- /**
199
- * Button to open webview
200
- *
201
- * Used for both inline keyboards and reply ones
202
- *
203
- * @param text Button label
204
- * @param url WebView URL
205
- */
206
- function webView(text: string, url: string): tl.RawKeyboardButtonWebView;
207
- /**
208
- * Button to open user profile
209
- *
210
- * @param text Text of the button
211
- * @param user User to be opened (use {@link TelegramClient.resolvePeer})
212
- */
213
- function userProfile(text: string, user: tl.TypeInputPeer): tl.RawInputKeyboardButtonUserProfile;
214
- /**
215
- * Button to request a peer from the user
216
- *
217
- * @param text Text of the button
218
- * @param buttonId ID of the button that will later be passed to the service message
219
- */
220
- function requestPeer(text: string, buttonId: number, params: {
221
- /**
222
- * Peer type, along with filters
223
- */
224
- peerType: tl.TypeRequestPeerType;
225
- /**
226
- * Maximum number of peers to be selected
227
- *
228
- * @default 1
229
- */
230
- count?: number;
231
- }): tl.RawKeyboardButtonRequestPeer;
232
- /**
233
- * Find a button in the keyboard by its text or by predicate
234
- *
235
- * @param buttons Two-dimensional array of buttons
236
- * @param predicate Button text or predicate function
237
- */
238
- function findButton(buttons: tl.TypeKeyboardButton[][], predicate: string | ((btn: tl.TypeKeyboardButton) => boolean)): tl.TypeKeyboardButton | null;
239
- }