@mtcute/core 0.7.3 → 0.9.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 (1169) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +26 -3
  3. package/cjs/highlevel/base.d.ts +3 -1
  4. package/cjs/highlevel/base.js +18 -0
  5. package/cjs/highlevel/base.js.map +1 -1
  6. package/cjs/highlevel/client.d.ts +23 -10
  7. package/cjs/highlevel/client.js +26 -19
  8. package/cjs/highlevel/client.js.map +1 -1
  9. package/cjs/highlevel/client.types.d.ts +14 -0
  10. package/cjs/highlevel/client.types.js.map +1 -1
  11. package/cjs/highlevel/index.d.ts +0 -2
  12. package/cjs/highlevel/index.js +0 -2
  13. package/cjs/highlevel/index.js.map +1 -1
  14. package/cjs/highlevel/methods/_imports.js.map +1 -1
  15. package/cjs/highlevel/methods/_init.js +4 -29
  16. package/cjs/highlevel/methods/_init.js.map +1 -1
  17. package/cjs/highlevel/methods/bots/get-callback-answer.js +2 -2
  18. package/cjs/highlevel/methods/bots/get-callback-answer.js.map +1 -1
  19. package/cjs/highlevel/methods/dialogs/create-folder.js +1 -1
  20. package/cjs/highlevel/methods/dialogs/create-folder.js.map +1 -1
  21. package/cjs/highlevel/methods/dialogs/edit-folder.js +1 -1
  22. package/cjs/highlevel/methods/dialogs/edit-folder.js.map +1 -1
  23. package/cjs/highlevel/methods/dialogs/find-folder.js +1 -1
  24. package/cjs/highlevel/methods/dialogs/find-folder.js.map +1 -1
  25. package/cjs/highlevel/methods/dialogs/get-folders.d.ts +1 -1
  26. package/cjs/highlevel/methods/dialogs/get-folders.js +1 -1
  27. package/cjs/highlevel/methods/dialogs/get-folders.js.map +1 -1
  28. package/cjs/highlevel/methods/files/download-file.d.ts +1 -10
  29. package/cjs/highlevel/methods/files/download-file.js +1 -32
  30. package/cjs/highlevel/methods/files/download-file.js.map +1 -1
  31. package/cjs/highlevel/methods/files/download-iterable.js +2 -1
  32. package/cjs/highlevel/methods/files/download-iterable.js.map +1 -1
  33. package/cjs/highlevel/methods/files/download-node-stream.js +4 -0
  34. package/cjs/highlevel/methods/files/download-node-stream.js.map +1 -0
  35. package/cjs/highlevel/methods/files/normalize-input-media.d.ts +1 -1
  36. package/cjs/highlevel/methods/files/normalize-input-media.js +2 -1
  37. package/cjs/highlevel/methods/files/normalize-input-media.js.map +1 -1
  38. package/cjs/highlevel/methods/files/upload-file.d.ts +0 -3
  39. package/cjs/highlevel/methods/files/upload-file.js +24 -11
  40. package/cjs/highlevel/methods/files/upload-file.js.map +1 -1
  41. package/cjs/highlevel/methods/messages/find-in-update.js +23 -8
  42. package/cjs/highlevel/methods/messages/find-in-update.js.map +1 -1
  43. package/cjs/highlevel/methods/messages/send-media-group.d.ts +1 -1
  44. package/cjs/highlevel/methods/messages/send-media-group.js.map +1 -1
  45. package/cjs/highlevel/methods/messages/send-media.d.ts +2 -2
  46. package/cjs/highlevel/methods/messages/send-media.js +5 -4
  47. package/cjs/highlevel/methods/messages/send-media.js.map +1 -1
  48. package/cjs/highlevel/methods/messages/send-text.d.ts +1 -1
  49. package/cjs/highlevel/methods/messages/send-text.js +7 -6
  50. package/cjs/highlevel/methods/messages/send-text.js.map +1 -1
  51. package/cjs/highlevel/methods/misc/with-params.d.ts +10 -0
  52. package/cjs/highlevel/methods/misc/with-params.js +32 -0
  53. package/cjs/highlevel/methods/misc/with-params.js.map +1 -0
  54. package/cjs/highlevel/methods.d.ts +13 -1
  55. package/cjs/highlevel/methods.js +4 -6
  56. package/cjs/highlevel/methods.js.map +1 -1
  57. package/cjs/highlevel/types/bots/command-scope/index.d.ts +10 -0
  58. package/cjs/highlevel/types/bots/command-scope/index.js +29 -0
  59. package/cjs/highlevel/types/bots/command-scope/index.js.map +1 -0
  60. package/cjs/highlevel/types/bots/command-scope/inner.d.ts +54 -0
  61. package/cjs/highlevel/types/bots/command-scope/inner.js +76 -0
  62. package/cjs/highlevel/types/bots/command-scope/inner.js.map +1 -0
  63. package/cjs/highlevel/types/bots/index.d.ts +4 -4
  64. package/cjs/highlevel/types/bots/index.js +4 -4
  65. package/cjs/highlevel/types/bots/index.js.map +1 -1
  66. package/cjs/highlevel/types/bots/inline-message/factories.d.ts +43 -0
  67. package/cjs/highlevel/types/bots/inline-message/factories.js +175 -0
  68. package/cjs/highlevel/types/bots/inline-message/factories.js.map +1 -0
  69. package/cjs/highlevel/types/bots/inline-message/index.d.ts +3 -0
  70. package/cjs/highlevel/types/bots/inline-message/index.js +33 -0
  71. package/cjs/highlevel/types/bots/inline-message/index.js.map +1 -0
  72. package/{esm/highlevel/types/bots/input/input-inline-message.d.ts → cjs/highlevel/types/bots/inline-message/types.d.ts} +2 -45
  73. package/cjs/highlevel/types/bots/inline-message/types.js +3 -0
  74. package/cjs/highlevel/types/bots/inline-message/types.js.map +1 -0
  75. package/cjs/highlevel/types/bots/inline-result/factories.d.ts +94 -0
  76. package/cjs/highlevel/types/bots/inline-result/factories.js +486 -0
  77. package/cjs/highlevel/types/bots/inline-result/factories.js.map +1 -0
  78. package/cjs/highlevel/types/bots/inline-result/index.d.ts +3 -0
  79. package/cjs/highlevel/types/bots/inline-result/index.js +33 -0
  80. package/cjs/highlevel/types/bots/inline-result/index.js.map +1 -0
  81. package/{esm/highlevel/types/bots/input/input-inline-result.d.ts → cjs/highlevel/types/bots/inline-result/types.d.ts} +1 -95
  82. package/cjs/highlevel/types/bots/inline-result/types.js +3 -0
  83. package/cjs/highlevel/types/bots/inline-result/types.js.map +1 -0
  84. package/cjs/highlevel/types/bots/{keyboard-builder.d.ts → keyboards/builder.d.ts} +1 -1
  85. package/cjs/highlevel/types/bots/{keyboard-builder.js → keyboards/builder.js} +1 -1
  86. package/cjs/highlevel/types/bots/keyboards/builder.js.map +1 -0
  87. package/cjs/highlevel/types/bots/keyboards/factories.d.ts +195 -0
  88. package/cjs/highlevel/types/bots/keyboards/factories.js +366 -0
  89. package/cjs/highlevel/types/bots/keyboards/factories.js.map +1 -0
  90. package/cjs/highlevel/types/bots/keyboards/index.d.ts +14 -0
  91. package/cjs/highlevel/types/bots/keyboards/index.js +33 -0
  92. package/cjs/highlevel/types/bots/keyboards/index.js.map +1 -0
  93. package/cjs/highlevel/types/bots/keyboards/types.d.ts +34 -0
  94. package/cjs/highlevel/types/bots/keyboards/types.js +3 -0
  95. package/cjs/highlevel/types/bots/keyboards/types.js.map +1 -0
  96. package/cjs/highlevel/types/files/utils.d.ts +9 -6
  97. package/cjs/highlevel/types/files/utils.js.map +1 -1
  98. package/cjs/highlevel/types/media/document.js +3 -2
  99. package/cjs/highlevel/types/media/document.js.map +1 -1
  100. package/cjs/highlevel/types/media/index.d.ts +1 -1
  101. package/cjs/highlevel/types/media/index.js +1 -1
  102. package/cjs/highlevel/types/media/index.js.map +1 -1
  103. package/cjs/highlevel/types/media/input-media/factories.d.ts +141 -0
  104. package/cjs/highlevel/types/media/input-media/factories.js +250 -0
  105. package/cjs/highlevel/types/media/input-media/factories.js.map +1 -0
  106. package/cjs/highlevel/types/media/input-media/index.d.ts +3 -0
  107. package/cjs/highlevel/types/media/input-media/index.js +33 -0
  108. package/cjs/highlevel/types/media/input-media/index.js.map +1 -0
  109. package/cjs/highlevel/types/media/{input-media.d.ts → input-media/types.d.ts} +5 -145
  110. package/cjs/highlevel/types/media/input-media/types.js +3 -0
  111. package/cjs/highlevel/types/media/input-media/types.js.map +1 -0
  112. package/cjs/highlevel/types/media/thumbnail.js +5 -4
  113. package/cjs/highlevel/types/media/thumbnail.js.map +1 -1
  114. package/cjs/highlevel/types/messages/message.d.ts +1 -1
  115. package/cjs/highlevel/types/messages/message.js +3 -3
  116. package/cjs/highlevel/types/messages/message.js.map +1 -1
  117. package/cjs/highlevel/types/misc/index.d.ts +1 -1
  118. package/cjs/highlevel/types/misc/index.js +1 -1
  119. package/cjs/highlevel/types/misc/index.js.map +1 -1
  120. package/cjs/highlevel/types/misc/input-privacy-rule/allow.d.ts +22 -0
  121. package/cjs/highlevel/types/misc/input-privacy-rule/allow.js +36 -0
  122. package/cjs/highlevel/types/misc/input-privacy-rule/allow.js.map +1 -0
  123. package/cjs/highlevel/types/misc/input-privacy-rule/bundle.d.ts +3 -0
  124. package/cjs/highlevel/types/misc/input-privacy-rule/bundle.js +31 -0
  125. package/cjs/highlevel/types/misc/input-privacy-rule/bundle.js.map +1 -0
  126. package/cjs/highlevel/types/misc/input-privacy-rule/disallow.d.ts +20 -0
  127. package/cjs/highlevel/types/misc/input-privacy-rule/disallow.js +32 -0
  128. package/cjs/highlevel/types/misc/input-privacy-rule/disallow.js.map +1 -0
  129. package/cjs/highlevel/types/misc/input-privacy-rule/index.d.ts +3 -0
  130. package/cjs/highlevel/types/misc/input-privacy-rule/index.js +33 -0
  131. package/cjs/highlevel/types/misc/input-privacy-rule/index.js.map +1 -0
  132. package/cjs/highlevel/types/misc/input-privacy-rule/types.d.ts +11 -0
  133. package/cjs/highlevel/types/misc/input-privacy-rule/types.js +3 -0
  134. package/cjs/highlevel/types/misc/input-privacy-rule/types.js.map +1 -0
  135. package/cjs/highlevel/types/peers/chat-photo.js +3 -2
  136. package/cjs/highlevel/types/peers/chat-photo.js.map +1 -1
  137. package/cjs/highlevel/types/updates/callback-query.js +2 -2
  138. package/cjs/highlevel/types/updates/callback-query.js.map +1 -1
  139. package/cjs/highlevel/types/updates/user-status-update.js +1 -1
  140. package/cjs/highlevel/types/updates/user-status-update.js.map +1 -1
  141. package/cjs/highlevel/updates/manager.d.ts +5 -3
  142. package/cjs/highlevel/updates/manager.js +81 -67
  143. package/cjs/highlevel/updates/manager.js.map +1 -1
  144. package/cjs/highlevel/utils/convert-file-id.js +7 -6
  145. package/cjs/highlevel/utils/convert-file-id.js.map +1 -1
  146. package/cjs/highlevel/utils/file-utils.js +8 -4
  147. package/cjs/highlevel/utils/file-utils.js.map +1 -1
  148. package/cjs/highlevel/utils/inline-utils.js +3 -2
  149. package/cjs/highlevel/utils/inline-utils.js.map +1 -1
  150. package/cjs/highlevel/utils/inspectable.d.ts +1 -1
  151. package/cjs/highlevel/utils/inspectable.js +3 -2
  152. package/cjs/highlevel/utils/inspectable.js.map +1 -1
  153. package/cjs/highlevel/utils/memoize.d.ts +1 -1
  154. package/cjs/highlevel/utils/memoize.js +1 -0
  155. package/cjs/highlevel/utils/memoize.js.map +1 -1
  156. package/cjs/highlevel/utils/stream-utils.d.ts +0 -2
  157. package/cjs/highlevel/utils/stream-utils.js +1 -28
  158. package/cjs/highlevel/utils/stream-utils.js.map +1 -1
  159. package/cjs/highlevel/utils/string-session.js +3 -2
  160. package/cjs/highlevel/utils/string-session.js.map +1 -1
  161. package/cjs/highlevel/worker/index.d.ts +3 -0
  162. package/cjs/highlevel/{types/bots/input → worker}/index.js +3 -2
  163. package/cjs/highlevel/worker/index.js.map +1 -0
  164. package/cjs/highlevel/worker/port.d.ts +6 -3
  165. package/cjs/highlevel/worker/port.js +8 -2
  166. package/cjs/highlevel/worker/port.js.map +1 -1
  167. package/cjs/highlevel/worker/protocol.d.ts +5 -1
  168. package/cjs/highlevel/worker/protocol.js.map +1 -1
  169. package/cjs/highlevel/worker/worker.d.ts +11 -4
  170. package/cjs/highlevel/worker/worker.js +53 -49
  171. package/cjs/highlevel/worker/worker.js.map +1 -1
  172. package/cjs/network/client.d.ts +4 -4
  173. package/cjs/network/client.js +3 -1
  174. package/cjs/network/client.js.map +1 -1
  175. package/cjs/network/multi-session-connection.d.ts +1 -0
  176. package/cjs/network/multi-session-connection.js +6 -0
  177. package/cjs/network/multi-session-connection.js.map +1 -1
  178. package/cjs/network/network-manager.d.ts +5 -1
  179. package/cjs/network/network-manager.js +24 -15
  180. package/cjs/network/network-manager.js.map +1 -1
  181. package/cjs/network/persistent-connection.d.ts +3 -0
  182. package/cjs/network/persistent-connection.js +23 -1
  183. package/cjs/network/persistent-connection.js.map +1 -1
  184. package/cjs/network/session-connection.d.ts +2 -0
  185. package/cjs/network/session-connection.js +18 -4
  186. package/cjs/network/session-connection.js.map +1 -1
  187. package/cjs/network/transports/index.d.ts +0 -3
  188. package/cjs/network/transports/index.js +0 -4
  189. package/cjs/network/transports/index.js.map +1 -1
  190. package/cjs/platform.d.ts +18 -0
  191. package/cjs/platform.js +36 -0
  192. package/cjs/platform.js.map +1 -0
  193. package/cjs/storage/index.d.ts +2 -2
  194. package/cjs/storage/index.js +2 -2
  195. package/cjs/storage/index.js.map +1 -1
  196. package/{esm/storage/providers → cjs/storage}/memory/driver.d.ts +1 -1
  197. package/cjs/storage/memory/driver.js.map +1 -0
  198. package/{esm/storage/providers → cjs/storage}/memory/index.d.ts +2 -2
  199. package/cjs/storage/memory/index.js.map +1 -0
  200. package/cjs/storage/{providers/memory → memory}/repository/auth-keys.d.ts +1 -1
  201. package/cjs/storage/memory/repository/auth-keys.js.map +1 -0
  202. package/{esm/storage/providers → cjs/storage}/memory/repository/kv.d.ts +1 -1
  203. package/cjs/storage/memory/repository/kv.js.map +1 -0
  204. package/{esm/storage/providers → cjs/storage}/memory/repository/peers.d.ts +1 -1
  205. package/cjs/storage/memory/repository/peers.js.map +1 -0
  206. package/{esm/storage/providers → cjs/storage}/memory/repository/ref-messages.d.ts +1 -1
  207. package/cjs/storage/memory/repository/ref-messages.js.map +1 -0
  208. package/cjs/storage/sqlite/driver.d.ts +24 -0
  209. package/cjs/storage/sqlite/driver.js +129 -0
  210. package/cjs/storage/sqlite/driver.js.map +1 -0
  211. package/cjs/storage/sqlite/index.d.ts +17 -0
  212. package/cjs/storage/sqlite/index.js +35 -0
  213. package/cjs/storage/sqlite/index.js.map +1 -0
  214. package/cjs/storage/sqlite/repository/auth-keys.d.ts +20 -0
  215. package/cjs/storage/sqlite/repository/auth-keys.js +68 -0
  216. package/cjs/storage/sqlite/repository/auth-keys.js.map +1 -0
  217. package/cjs/storage/sqlite/repository/kv.d.ts +14 -0
  218. package/cjs/storage/sqlite/repository/kv.js +96 -0
  219. package/cjs/storage/sqlite/repository/kv.js.map +1 -0
  220. package/cjs/storage/sqlite/repository/peers.d.ts +16 -0
  221. package/cjs/storage/sqlite/repository/peers.js +77 -0
  222. package/cjs/storage/sqlite/repository/peers.js.map +1 -0
  223. package/cjs/storage/sqlite/repository/ref-messages.d.ts +16 -0
  224. package/cjs/storage/sqlite/repository/ref-messages.js +49 -0
  225. package/cjs/storage/sqlite/repository/ref-messages.js.map +1 -0
  226. package/cjs/storage/sqlite/types.d.ts +18 -0
  227. package/cjs/storage/sqlite/types.js +3 -0
  228. package/cjs/storage/sqlite/types.js.map +1 -0
  229. package/cjs/storage/storage.js +2 -1
  230. package/cjs/storage/storage.js.map +1 -1
  231. package/cjs/utils/binary/asn1-parser.js +3 -3
  232. package/cjs/utils/binary/asn1-parser.js.map +1 -1
  233. package/cjs/utils/crypto/abstract.d.ts +0 -1
  234. package/cjs/utils/crypto/abstract.js.map +1 -1
  235. package/cjs/utils/crypto/index.d.ts +0 -2
  236. package/cjs/utils/crypto/index.js +0 -3
  237. package/cjs/utils/crypto/index.js.map +1 -1
  238. package/cjs/utils/crypto/keys.js +5 -3
  239. package/cjs/utils/crypto/keys.js.map +1 -1
  240. package/cjs/utils/crypto/password.js +3 -3
  241. package/cjs/utils/crypto/password.js.map +1 -1
  242. package/cjs/utils/dcs.d.ts +4 -0
  243. package/cjs/utils/dcs.js +0 -4
  244. package/cjs/utils/dcs.js.map +1 -1
  245. package/cjs/utils/{platform/error-reporting.d.ts → error-reporting.d.ts} +1 -1
  246. package/cjs/utils/error-reporting.js.map +1 -0
  247. package/cjs/utils/index.d.ts +4 -1
  248. package/cjs/utils/index.js +6 -1
  249. package/cjs/utils/index.js.map +1 -1
  250. package/cjs/utils/links/common.js +1 -1
  251. package/cjs/utils/links/common.js.map +1 -1
  252. package/cjs/utils/logger.d.ts +1 -0
  253. package/cjs/utils/logger.js +9 -22
  254. package/cjs/utils/logger.js.map +1 -1
  255. package/esm/highlevel/base.d.ts +3 -1
  256. package/esm/highlevel/base.js +18 -0
  257. package/esm/highlevel/base.js.map +1 -1
  258. package/esm/highlevel/client.d.ts +23 -10
  259. package/esm/highlevel/client.js +12 -19
  260. package/esm/highlevel/client.js.map +1 -1
  261. package/esm/highlevel/client.types.d.ts +14 -0
  262. package/esm/highlevel/client.types.js.map +1 -1
  263. package/esm/highlevel/index.d.ts +0 -2
  264. package/esm/highlevel/index.js +0 -2
  265. package/esm/highlevel/index.js.map +1 -1
  266. package/esm/highlevel/methods/_imports.js.map +1 -1
  267. package/esm/highlevel/methods/_init.js +4 -29
  268. package/esm/highlevel/methods/_init.js.map +1 -1
  269. package/esm/highlevel/methods/bots/get-callback-answer.js +2 -2
  270. package/esm/highlevel/methods/bots/get-callback-answer.js.map +1 -1
  271. package/esm/highlevel/methods/dialogs/create-folder.js +1 -1
  272. package/esm/highlevel/methods/dialogs/create-folder.js.map +1 -1
  273. package/esm/highlevel/methods/dialogs/edit-folder.js +1 -1
  274. package/esm/highlevel/methods/dialogs/edit-folder.js.map +1 -1
  275. package/esm/highlevel/methods/dialogs/find-folder.js +1 -1
  276. package/esm/highlevel/methods/dialogs/find-folder.js.map +1 -1
  277. package/esm/highlevel/methods/dialogs/get-folders.d.ts +1 -1
  278. package/esm/highlevel/methods/dialogs/get-folders.js +1 -1
  279. package/esm/highlevel/methods/dialogs/get-folders.js.map +1 -1
  280. package/esm/highlevel/methods/files/download-file.d.ts +1 -10
  281. package/esm/highlevel/methods/files/download-file.js +2 -30
  282. package/esm/highlevel/methods/files/download-file.js.map +1 -1
  283. package/esm/highlevel/methods/files/download-iterable.js +2 -1
  284. package/esm/highlevel/methods/files/download-iterable.js.map +1 -1
  285. package/esm/highlevel/methods/files/download-node-stream.js +3 -0
  286. package/esm/highlevel/methods/files/download-node-stream.js.map +1 -0
  287. package/esm/highlevel/methods/files/normalize-input-media.d.ts +1 -1
  288. package/esm/highlevel/methods/files/normalize-input-media.js +2 -1
  289. package/esm/highlevel/methods/files/normalize-input-media.js.map +1 -1
  290. package/esm/highlevel/methods/files/upload-file.d.ts +0 -3
  291. package/esm/highlevel/methods/files/upload-file.js +24 -11
  292. package/esm/highlevel/methods/files/upload-file.js.map +1 -1
  293. package/esm/highlevel/methods/messages/find-in-update.js +23 -8
  294. package/esm/highlevel/methods/messages/find-in-update.js.map +1 -1
  295. package/esm/highlevel/methods/messages/send-media-group.d.ts +1 -1
  296. package/esm/highlevel/methods/messages/send-media-group.js.map +1 -1
  297. package/esm/highlevel/methods/messages/send-media.d.ts +2 -2
  298. package/esm/highlevel/methods/messages/send-media.js +4 -3
  299. package/esm/highlevel/methods/messages/send-media.js.map +1 -1
  300. package/esm/highlevel/methods/messages/send-text.d.ts +1 -1
  301. package/esm/highlevel/methods/messages/send-text.js +4 -3
  302. package/esm/highlevel/methods/messages/send-text.js.map +1 -1
  303. package/esm/highlevel/methods/misc/with-params.d.ts +10 -0
  304. package/esm/highlevel/methods/misc/with-params.js +28 -0
  305. package/esm/highlevel/methods/misc/with-params.js.map +1 -0
  306. package/esm/highlevel/methods.d.ts +13 -1
  307. package/esm/highlevel/methods.js +0 -1
  308. package/esm/highlevel/methods.js.map +1 -1
  309. package/esm/highlevel/types/auth/sent-code.js +4 -3
  310. package/esm/highlevel/types/bots/command-scope/index.d.ts +10 -0
  311. package/esm/highlevel/types/bots/command-scope/index.js +11 -0
  312. package/esm/highlevel/types/bots/command-scope/index.js.map +1 -0
  313. package/esm/highlevel/types/bots/command-scope/inner.d.ts +54 -0
  314. package/esm/highlevel/types/bots/command-scope/inner.js +69 -0
  315. package/esm/highlevel/types/bots/command-scope/inner.js.map +1 -0
  316. package/esm/highlevel/types/bots/game-high-score.js +5 -4
  317. package/esm/highlevel/types/bots/index.d.ts +4 -4
  318. package/esm/highlevel/types/bots/index.js +4 -4
  319. package/esm/highlevel/types/bots/index.js.map +1 -1
  320. package/esm/highlevel/types/bots/inline-message/factories.d.ts +43 -0
  321. package/esm/highlevel/types/bots/inline-message/factories.js +163 -0
  322. package/esm/highlevel/types/bots/inline-message/factories.js.map +1 -0
  323. package/esm/highlevel/types/bots/inline-message/index.d.ts +3 -0
  324. package/esm/highlevel/types/bots/inline-message/index.js +4 -0
  325. package/esm/highlevel/types/bots/inline-message/index.js.map +1 -0
  326. package/{cjs/highlevel/types/bots/input/input-inline-message.d.ts → esm/highlevel/types/bots/inline-message/types.d.ts} +2 -45
  327. package/esm/highlevel/types/bots/inline-message/types.js +2 -0
  328. package/esm/highlevel/types/bots/inline-message/types.js.map +1 -0
  329. package/esm/highlevel/types/bots/inline-result/factories.d.ts +94 -0
  330. package/esm/highlevel/types/bots/inline-result/factories.js +470 -0
  331. package/esm/highlevel/types/bots/inline-result/factories.js.map +1 -0
  332. package/esm/highlevel/types/bots/inline-result/index.d.ts +3 -0
  333. package/esm/highlevel/types/bots/inline-result/index.js +4 -0
  334. package/esm/highlevel/types/bots/inline-result/index.js.map +1 -0
  335. package/{cjs/highlevel/types/bots/input/input-inline-result.d.ts → esm/highlevel/types/bots/inline-result/types.d.ts} +1 -95
  336. package/esm/highlevel/types/bots/inline-result/types.js +2 -0
  337. package/esm/highlevel/types/bots/inline-result/types.js.map +1 -0
  338. package/esm/highlevel/types/bots/{keyboard-builder.d.ts → keyboards/builder.d.ts} +1 -1
  339. package/esm/highlevel/types/bots/{keyboard-builder.js → keyboards/builder.js} +1 -1
  340. package/esm/highlevel/types/bots/keyboards/builder.js.map +1 -0
  341. package/esm/highlevel/types/bots/keyboards/factories.d.ts +195 -0
  342. package/esm/highlevel/types/bots/keyboards/factories.js +341 -0
  343. package/esm/highlevel/types/bots/keyboards/factories.js.map +1 -0
  344. package/esm/highlevel/types/bots/keyboards/index.d.ts +14 -0
  345. package/esm/highlevel/types/bots/keyboards/index.js +15 -0
  346. package/esm/highlevel/types/bots/keyboards/index.js.map +1 -0
  347. package/esm/highlevel/types/bots/keyboards/types.d.ts +34 -0
  348. package/esm/highlevel/types/bots/keyboards/types.js +2 -0
  349. package/esm/highlevel/types/bots/keyboards/types.js.map +1 -0
  350. package/esm/highlevel/types/files/file-location.js +4 -3
  351. package/esm/highlevel/types/files/utils.d.ts +9 -6
  352. package/esm/highlevel/types/files/utils.js.map +1 -1
  353. package/esm/highlevel/types/files/web-document.js +4 -3
  354. package/esm/highlevel/types/media/audio.js +5 -4
  355. package/esm/highlevel/types/media/contact.js +4 -3
  356. package/esm/highlevel/types/media/dice.js +4 -3
  357. package/esm/highlevel/types/media/document.js +8 -6
  358. package/esm/highlevel/types/media/document.js.map +1 -1
  359. package/esm/highlevel/types/media/game.js +5 -4
  360. package/esm/highlevel/types/media/index.d.ts +1 -1
  361. package/esm/highlevel/types/media/index.js +1 -1
  362. package/esm/highlevel/types/media/index.js.map +1 -1
  363. package/esm/highlevel/types/media/input-media/factories.d.ts +141 -0
  364. package/esm/highlevel/types/media/input-media/factories.js +228 -0
  365. package/esm/highlevel/types/media/input-media/factories.js.map +1 -0
  366. package/esm/highlevel/types/media/input-media/index.d.ts +3 -0
  367. package/esm/highlevel/types/media/input-media/index.js +4 -0
  368. package/esm/highlevel/types/media/input-media/index.js.map +1 -0
  369. package/esm/highlevel/types/media/{input-media.d.ts → input-media/types.d.ts} +5 -145
  370. package/esm/highlevel/types/media/input-media/types.js +2 -0
  371. package/esm/highlevel/types/media/input-media/types.js.map +1 -0
  372. package/esm/highlevel/types/media/invoice.js +9 -7
  373. package/esm/highlevel/types/media/location.js +7 -5
  374. package/esm/highlevel/types/media/photo.js +5 -4
  375. package/esm/highlevel/types/media/poll.js +5 -4
  376. package/esm/highlevel/types/media/sticker.js +5 -4
  377. package/esm/highlevel/types/media/story.js +4 -3
  378. package/esm/highlevel/types/media/thumbnail.js +10 -8
  379. package/esm/highlevel/types/media/thumbnail.js.map +1 -1
  380. package/esm/highlevel/types/media/venue.js +5 -4
  381. package/esm/highlevel/types/media/video.js +5 -4
  382. package/esm/highlevel/types/media/voice.js +5 -4
  383. package/esm/highlevel/types/media/web-page.js +5 -4
  384. package/esm/highlevel/types/messages/dialog.js +5 -4
  385. package/esm/highlevel/types/messages/draft-message.js +5 -4
  386. package/esm/highlevel/types/messages/message-entity.js +5 -4
  387. package/esm/highlevel/types/messages/message-forward.js +5 -4
  388. package/esm/highlevel/types/messages/message-reactions.js +5 -4
  389. package/esm/highlevel/types/messages/message-replies.js +5 -4
  390. package/esm/highlevel/types/messages/message.d.ts +1 -1
  391. package/esm/highlevel/types/messages/message.js +6 -5
  392. package/esm/highlevel/types/messages/message.js.map +1 -1
  393. package/esm/highlevel/types/messages/replied-message.js +5 -4
  394. package/esm/highlevel/types/misc/index.d.ts +1 -1
  395. package/esm/highlevel/types/misc/index.js +1 -1
  396. package/esm/highlevel/types/misc/index.js.map +1 -1
  397. package/esm/highlevel/types/misc/input-privacy-rule/allow.d.ts +22 -0
  398. package/esm/highlevel/types/misc/input-privacy-rule/allow.js +31 -0
  399. package/esm/highlevel/types/misc/input-privacy-rule/allow.js.map +1 -0
  400. package/esm/highlevel/types/misc/input-privacy-rule/bundle.d.ts +3 -0
  401. package/esm/highlevel/types/misc/input-privacy-rule/bundle.js +4 -0
  402. package/esm/highlevel/types/misc/input-privacy-rule/bundle.js.map +1 -0
  403. package/esm/highlevel/types/misc/input-privacy-rule/disallow.d.ts +20 -0
  404. package/esm/highlevel/types/misc/input-privacy-rule/disallow.js +27 -0
  405. package/esm/highlevel/types/misc/input-privacy-rule/disallow.js.map +1 -0
  406. package/esm/highlevel/types/misc/input-privacy-rule/index.d.ts +3 -0
  407. package/esm/highlevel/types/misc/input-privacy-rule/index.js +4 -0
  408. package/esm/highlevel/types/misc/input-privacy-rule/index.js.map +1 -0
  409. package/esm/highlevel/types/misc/input-privacy-rule/types.d.ts +11 -0
  410. package/esm/highlevel/types/misc/input-privacy-rule/types.js +2 -0
  411. package/esm/highlevel/types/misc/input-privacy-rule/types.js.map +1 -0
  412. package/esm/highlevel/types/misc/sticker-set.js +5 -4
  413. package/esm/highlevel/types/misc/takeout-session.js +4 -3
  414. package/esm/highlevel/types/peers/chat-colors.js +4 -3
  415. package/esm/highlevel/types/peers/chat-event/index.js +5 -4
  416. package/esm/highlevel/types/peers/chat-invite-link-member.js +5 -4
  417. package/esm/highlevel/types/peers/chat-invite-link.js +5 -4
  418. package/esm/highlevel/types/peers/chat-location.js +5 -4
  419. package/esm/highlevel/types/peers/chat-member.js +5 -4
  420. package/esm/highlevel/types/peers/chat-permissions.js +4 -3
  421. package/esm/highlevel/types/peers/chat-photo.js +12 -9
  422. package/esm/highlevel/types/peers/chat-photo.js.map +1 -1
  423. package/esm/highlevel/types/peers/chat-preview.js +5 -4
  424. package/esm/highlevel/types/peers/chat.js +5 -4
  425. package/esm/highlevel/types/peers/forum-topic.js +5 -4
  426. package/esm/highlevel/types/peers/user.js +5 -4
  427. package/esm/highlevel/types/premium/boost-slot.js +5 -4
  428. package/esm/highlevel/types/premium/boost-stats.js +4 -3
  429. package/esm/highlevel/types/premium/boost.js +5 -4
  430. package/esm/highlevel/types/reactions/emoji-status.js +4 -3
  431. package/esm/highlevel/types/reactions/peer-reaction.js +5 -4
  432. package/esm/highlevel/types/reactions/reaction-count.js +4 -3
  433. package/esm/highlevel/types/stories/all-stories.js +5 -4
  434. package/esm/highlevel/types/stories/interactive/channel-post.js +5 -4
  435. package/esm/highlevel/types/stories/interactive/location.js +5 -4
  436. package/esm/highlevel/types/stories/interactive/reaction.js +4 -3
  437. package/esm/highlevel/types/stories/interactive/venue.js +5 -4
  438. package/esm/highlevel/types/stories/peer-stories.js +5 -4
  439. package/esm/highlevel/types/stories/stealth-mode.js +4 -3
  440. package/esm/highlevel/types/stories/story-interactions.js +5 -4
  441. package/esm/highlevel/types/stories/story-viewer.js +9 -7
  442. package/esm/highlevel/types/stories/story.js +5 -4
  443. package/esm/highlevel/types/updates/bot-chat-join-request.js +5 -4
  444. package/esm/highlevel/types/updates/bot-reaction.js +9 -7
  445. package/esm/highlevel/types/updates/bot-stopped.js +5 -4
  446. package/esm/highlevel/types/updates/callback-query.js +11 -9
  447. package/esm/highlevel/types/updates/callback-query.js.map +1 -1
  448. package/esm/highlevel/types/updates/chat-join-request.js +5 -4
  449. package/esm/highlevel/types/updates/chat-member-update.js +5 -4
  450. package/esm/highlevel/types/updates/chosen-inline-result.js +5 -4
  451. package/esm/highlevel/types/updates/delete-message-update.js +4 -3
  452. package/esm/highlevel/types/updates/delete-story-update.js +5 -4
  453. package/esm/highlevel/types/updates/history-read-update.js +4 -3
  454. package/esm/highlevel/types/updates/inline-query.js +5 -4
  455. package/esm/highlevel/types/updates/poll-update.js +5 -4
  456. package/esm/highlevel/types/updates/poll-vote.js +5 -4
  457. package/esm/highlevel/types/updates/pre-checkout-query.js +5 -4
  458. package/esm/highlevel/types/updates/story-update.js +5 -4
  459. package/esm/highlevel/types/updates/user-status-update.js +5 -4
  460. package/esm/highlevel/types/updates/user-status-update.js.map +1 -1
  461. package/esm/highlevel/types/updates/user-typing-update.js +4 -3
  462. package/esm/highlevel/updates/manager.d.ts +5 -3
  463. package/esm/highlevel/updates/manager.js +81 -67
  464. package/esm/highlevel/updates/manager.js.map +1 -1
  465. package/esm/highlevel/utils/convert-file-id.js +7 -6
  466. package/esm/highlevel/utils/convert-file-id.js.map +1 -1
  467. package/esm/highlevel/utils/file-utils.js +8 -4
  468. package/esm/highlevel/utils/file-utils.js.map +1 -1
  469. package/esm/highlevel/utils/inline-utils.js +4 -3
  470. package/esm/highlevel/utils/inline-utils.js.map +1 -1
  471. package/esm/highlevel/utils/inspectable.d.ts +1 -1
  472. package/esm/highlevel/utils/inspectable.js +3 -2
  473. package/esm/highlevel/utils/inspectable.js.map +1 -1
  474. package/esm/highlevel/utils/memoize.d.ts +1 -1
  475. package/esm/highlevel/utils/memoize.js +1 -0
  476. package/esm/highlevel/utils/memoize.js.map +1 -1
  477. package/esm/highlevel/utils/stream-utils.d.ts +0 -2
  478. package/esm/highlevel/utils/stream-utils.js +0 -26
  479. package/esm/highlevel/utils/stream-utils.js.map +1 -1
  480. package/esm/highlevel/utils/string-session.js +4 -3
  481. package/esm/highlevel/utils/string-session.js.map +1 -1
  482. package/esm/highlevel/worker/index.d.ts +3 -0
  483. package/esm/highlevel/worker/index.js +4 -0
  484. package/esm/highlevel/worker/index.js.map +1 -0
  485. package/esm/highlevel/worker/port.d.ts +6 -3
  486. package/esm/highlevel/worker/port.js +8 -2
  487. package/esm/highlevel/worker/port.js.map +1 -1
  488. package/esm/highlevel/worker/protocol.d.ts +5 -1
  489. package/esm/highlevel/worker/protocol.js.map +1 -1
  490. package/esm/highlevel/worker/worker.d.ts +11 -4
  491. package/esm/highlevel/worker/worker.js +51 -47
  492. package/esm/highlevel/worker/worker.js.map +1 -1
  493. package/esm/network/client.d.ts +4 -4
  494. package/esm/network/client.js +4 -2
  495. package/esm/network/client.js.map +1 -1
  496. package/esm/network/multi-session-connection.d.ts +1 -0
  497. package/esm/network/multi-session-connection.js +6 -0
  498. package/esm/network/multi-session-connection.js.map +1 -1
  499. package/esm/network/network-manager.d.ts +5 -1
  500. package/esm/network/network-manager.js +24 -15
  501. package/esm/network/network-manager.js.map +1 -1
  502. package/esm/network/persistent-connection.d.ts +3 -0
  503. package/esm/network/persistent-connection.js +23 -1
  504. package/esm/network/persistent-connection.js.map +1 -1
  505. package/esm/network/session-connection.d.ts +2 -0
  506. package/esm/network/session-connection.js +18 -4
  507. package/esm/network/session-connection.js.map +1 -1
  508. package/esm/network/transports/index.d.ts +0 -3
  509. package/esm/network/transports/index.js +0 -3
  510. package/esm/network/transports/index.js.map +1 -1
  511. package/esm/platform.d.ts +18 -0
  512. package/esm/platform.js +31 -0
  513. package/esm/platform.js.map +1 -0
  514. package/esm/storage/index.d.ts +2 -2
  515. package/esm/storage/index.js +2 -2
  516. package/esm/storage/index.js.map +1 -1
  517. package/{cjs/storage/providers → esm/storage}/memory/driver.d.ts +1 -1
  518. package/esm/storage/memory/driver.js.map +1 -0
  519. package/{cjs/storage/providers → esm/storage}/memory/index.d.ts +2 -2
  520. package/esm/storage/memory/index.js.map +1 -0
  521. package/esm/storage/{providers/memory → memory}/repository/auth-keys.d.ts +1 -1
  522. package/esm/storage/memory/repository/auth-keys.js.map +1 -0
  523. package/{cjs/storage/providers → esm/storage}/memory/repository/kv.d.ts +1 -1
  524. package/esm/storage/memory/repository/kv.js.map +1 -0
  525. package/{cjs/storage/providers → esm/storage}/memory/repository/peers.d.ts +1 -1
  526. package/esm/storage/memory/repository/peers.js.map +1 -0
  527. package/{cjs/storage/providers → esm/storage}/memory/repository/ref-messages.d.ts +1 -1
  528. package/esm/storage/memory/repository/ref-messages.js.map +1 -0
  529. package/esm/storage/sqlite/driver.d.ts +24 -0
  530. package/esm/storage/sqlite/driver.js +125 -0
  531. package/esm/storage/sqlite/driver.js.map +1 -0
  532. package/esm/storage/sqlite/index.d.ts +17 -0
  533. package/esm/storage/sqlite/index.js +17 -0
  534. package/esm/storage/sqlite/index.js.map +1 -0
  535. package/esm/storage/sqlite/repository/auth-keys.d.ts +20 -0
  536. package/esm/storage/sqlite/repository/auth-keys.js +64 -0
  537. package/esm/storage/sqlite/repository/auth-keys.js.map +1 -0
  538. package/esm/storage/sqlite/repository/kv.d.ts +14 -0
  539. package/esm/storage/sqlite/repository/kv.js +92 -0
  540. package/esm/storage/sqlite/repository/kv.js.map +1 -0
  541. package/esm/storage/sqlite/repository/peers.d.ts +16 -0
  542. package/esm/storage/sqlite/repository/peers.js +73 -0
  543. package/esm/storage/sqlite/repository/peers.js.map +1 -0
  544. package/esm/storage/sqlite/repository/ref-messages.d.ts +16 -0
  545. package/esm/storage/sqlite/repository/ref-messages.js +45 -0
  546. package/esm/storage/sqlite/repository/ref-messages.js.map +1 -0
  547. package/esm/storage/sqlite/types.d.ts +18 -0
  548. package/esm/storage/sqlite/types.js +2 -0
  549. package/esm/storage/sqlite/types.js.map +1 -0
  550. package/esm/storage/storage.js +3 -2
  551. package/esm/storage/storage.js.map +1 -1
  552. package/esm/utils/binary/asn1-parser.js +3 -3
  553. package/esm/utils/binary/asn1-parser.js.map +1 -1
  554. package/esm/utils/crypto/abstract.d.ts +0 -1
  555. package/esm/utils/crypto/abstract.js.map +1 -1
  556. package/esm/utils/crypto/index.d.ts +0 -2
  557. package/esm/utils/crypto/index.js +0 -2
  558. package/esm/utils/crypto/index.js.map +1 -1
  559. package/esm/utils/crypto/keys.js +6 -4
  560. package/esm/utils/crypto/keys.js.map +1 -1
  561. package/esm/utils/crypto/password.js +3 -3
  562. package/esm/utils/crypto/password.js.map +1 -1
  563. package/esm/utils/dcs.d.ts +4 -0
  564. package/esm/utils/dcs.js +0 -4
  565. package/esm/utils/dcs.js.map +1 -1
  566. package/esm/utils/{platform/error-reporting.d.ts → error-reporting.d.ts} +1 -1
  567. package/esm/utils/error-reporting.js.map +1 -0
  568. package/esm/utils/index.d.ts +4 -1
  569. package/esm/utils/index.js +6 -1
  570. package/esm/utils/index.js.map +1 -1
  571. package/esm/utils/links/common.js +1 -1
  572. package/esm/utils/links/common.js.map +1 -1
  573. package/esm/utils/logger.d.ts +1 -0
  574. package/esm/utils/logger.js +9 -22
  575. package/esm/utils/logger.js.map +1 -1
  576. package/package.json +25 -53
  577. package/cjs/highlevel/base.test.js +0 -14
  578. package/cjs/highlevel/base.test.js.map +0 -1
  579. package/cjs/highlevel/methods/files/_platform.js +0 -33
  580. package/cjs/highlevel/methods/files/_platform.js.map +0 -1
  581. package/cjs/highlevel/methods/files/_platform.web.d.ts +0 -1
  582. package/cjs/highlevel/methods/files/_platform.web.js +0 -26
  583. package/cjs/highlevel/methods/files/_platform.web.js.map +0 -1
  584. package/cjs/highlevel/methods/files/download-file.web.d.ts +0 -1
  585. package/cjs/highlevel/methods/files/download-file.web.js +0 -9
  586. package/cjs/highlevel/methods/files/download-file.web.js.map +0 -1
  587. package/cjs/highlevel/methods/messages/send-text.test.d.ts +0 -1
  588. package/cjs/highlevel/methods/messages/send-text.test.js +0 -140
  589. package/cjs/highlevel/methods/messages/send-text.test.js.map +0 -1
  590. package/cjs/highlevel/methods/users/get-users.test.d.ts +0 -1
  591. package/cjs/highlevel/methods/users/get-users.test.js +0 -33
  592. package/cjs/highlevel/methods/users/get-users.test.js.map +0 -1
  593. package/cjs/highlevel/methods/users/resolve-peer.test.d.ts +0 -1
  594. package/cjs/highlevel/methods/users/resolve-peer.test.js +0 -307
  595. package/cjs/highlevel/methods/users/resolve-peer.test.js.map +0 -1
  596. package/cjs/highlevel/types/bots/command-scope.d.ts +0 -63
  597. package/cjs/highlevel/types/bots/command-scope.js +0 -87
  598. package/cjs/highlevel/types/bots/command-scope.js.map +0 -1
  599. package/cjs/highlevel/types/bots/input/index.d.ts +0 -2
  600. package/cjs/highlevel/types/bots/input/index.js.map +0 -1
  601. package/cjs/highlevel/types/bots/input/input-inline-message.js +0 -179
  602. package/cjs/highlevel/types/bots/input/input-inline-message.js.map +0 -1
  603. package/cjs/highlevel/types/bots/input/input-inline-result.js +0 -490
  604. package/cjs/highlevel/types/bots/input/input-inline-result.js.map +0 -1
  605. package/cjs/highlevel/types/bots/keyboard-builder.js.map +0 -1
  606. package/cjs/highlevel/types/bots/keyboard-builder.test.d.ts +0 -1
  607. package/cjs/highlevel/types/bots/keyboard-builder.test.js +0 -162
  608. package/cjs/highlevel/types/bots/keyboard-builder.test.js.map +0 -1
  609. package/cjs/highlevel/types/bots/keyboards.d.ts +0 -239
  610. package/cjs/highlevel/types/bots/keyboards.js +0 -380
  611. package/cjs/highlevel/types/bots/keyboards.js.map +0 -1
  612. package/cjs/highlevel/types/bots/keyboards.test.d.ts +0 -1
  613. package/cjs/highlevel/types/bots/keyboards.test.js +0 -146
  614. package/cjs/highlevel/types/bots/keyboards.test.js.map +0 -1
  615. package/cjs/highlevel/types/media/input-media.js +0 -254
  616. package/cjs/highlevel/types/media/input-media.js.map +0 -1
  617. package/cjs/highlevel/types/misc/input-privacy-rule.d.ts +0 -63
  618. package/cjs/highlevel/types/misc/input-privacy-rule.js +0 -85
  619. package/cjs/highlevel/types/misc/input-privacy-rule.js.map +0 -1
  620. package/cjs/highlevel/types/peers/peers-index.test.d.ts +0 -1
  621. package/cjs/highlevel/types/peers/peers-index.test.js +0 -71
  622. package/cjs/highlevel/types/peers/peers-index.test.js.map +0 -1
  623. package/cjs/highlevel/types/peers/user.test.d.ts +0 -1
  624. package/cjs/highlevel/types/peers/user.test.js +0 -176
  625. package/cjs/highlevel/types/peers/user.test.js.map +0 -1
  626. package/cjs/highlevel/utils/file-type.test.d.ts +0 -1
  627. package/cjs/highlevel/utils/file-type.test.js +0 -64
  628. package/cjs/highlevel/utils/file-type.test.js.map +0 -1
  629. package/cjs/highlevel/utils/file-utils.test.d.ts +0 -1
  630. package/cjs/highlevel/utils/file-utils.test.js +0 -126
  631. package/cjs/highlevel/utils/file-utils.test.js.map +0 -1
  632. package/cjs/highlevel/utils/inline-utils.test.d.ts +0 -1
  633. package/cjs/highlevel/utils/inline-utils.test.js +0 -47
  634. package/cjs/highlevel/utils/inline-utils.test.js.map +0 -1
  635. package/cjs/highlevel/utils/inspectable.test.d.ts +0 -1
  636. package/cjs/highlevel/utils/inspectable.test.js +0 -97
  637. package/cjs/highlevel/utils/inspectable.test.js.map +0 -1
  638. package/cjs/highlevel/utils/memoize.test.d.ts +0 -1
  639. package/cjs/highlevel/utils/memoize.test.js +0 -60
  640. package/cjs/highlevel/utils/memoize.test.js.map +0 -1
  641. package/cjs/highlevel/utils/peer-utils.test.d.ts +0 -1
  642. package/cjs/highlevel/utils/peer-utils.test.js +0 -109
  643. package/cjs/highlevel/utils/peer-utils.test.js.map +0 -1
  644. package/cjs/highlevel/utils/platform/storage.d.ts +0 -1
  645. package/cjs/highlevel/utils/platform/storage.js +0 -10
  646. package/cjs/highlevel/utils/platform/storage.js.map +0 -1
  647. package/cjs/highlevel/utils/platform/storage.web.d.ts +0 -1
  648. package/cjs/highlevel/utils/platform/storage.web.js +0 -14
  649. package/cjs/highlevel/utils/platform/storage.web.js.map +0 -1
  650. package/cjs/highlevel/utils/query-batcher.test.d.ts +0 -1
  651. package/cjs/highlevel/utils/query-batcher.test.js +0 -502
  652. package/cjs/highlevel/utils/query-batcher.test.js.map +0 -1
  653. package/cjs/highlevel/utils/stream-utils.test.d.ts +0 -1
  654. package/cjs/highlevel/utils/stream-utils.test.js +0 -98
  655. package/cjs/highlevel/utils/stream-utils.test.js.map +0 -1
  656. package/cjs/highlevel/utils/string-session.test.d.ts +0 -1
  657. package/cjs/highlevel/utils/string-session.test.js +0 -198
  658. package/cjs/highlevel/utils/string-session.test.js.map +0 -1
  659. package/cjs/highlevel/utils/voice-utils.test.d.ts +0 -1
  660. package/cjs/highlevel/utils/voice-utils.test.js +0 -28
  661. package/cjs/highlevel/utils/voice-utils.test.js.map +0 -1
  662. package/cjs/highlevel/worker/platform/connect.d.ts +0 -2
  663. package/cjs/highlevel/worker/platform/connect.js +0 -19
  664. package/cjs/highlevel/worker/platform/connect.js.map +0 -1
  665. package/cjs/highlevel/worker/platform/connect.web.d.ts +0 -2
  666. package/cjs/highlevel/worker/platform/connect.web.js +0 -51
  667. package/cjs/highlevel/worker/platform/connect.web.js.map +0 -1
  668. package/cjs/highlevel/worker/platform/register.d.ts +0 -2
  669. package/cjs/highlevel/worker/platform/register.js +0 -20
  670. package/cjs/highlevel/worker/platform/register.js.map +0 -1
  671. package/cjs/highlevel/worker/platform/register.web.d.ts +0 -2
  672. package/cjs/highlevel/worker/platform/register.web.js +0 -64
  673. package/cjs/highlevel/worker/platform/register.web.js.map +0 -1
  674. package/cjs/network/auth-key.test.d.ts +0 -1
  675. package/cjs/network/auth-key.test.js +0 -111
  676. package/cjs/network/auth-key.test.js.map +0 -1
  677. package/cjs/network/config-manager.test.d.ts +0 -1
  678. package/cjs/network/config-manager.test.js +0 -174
  679. package/cjs/network/config-manager.test.js.map +0 -1
  680. package/cjs/network/persistent-connection.test.d.ts +0 -1
  681. package/cjs/network/persistent-connection.test.js +0 -157
  682. package/cjs/network/persistent-connection.test.js.map +0 -1
  683. package/cjs/network/transports/intermediate.test.d.ts +0 -1
  684. package/cjs/network/transports/intermediate.test.js +0 -84
  685. package/cjs/network/transports/intermediate.test.js.map +0 -1
  686. package/cjs/network/transports/obfuscated.test.d.ts +0 -1
  687. package/cjs/network/transports/obfuscated.test.js +0 -131
  688. package/cjs/network/transports/obfuscated.test.js.map +0 -1
  689. package/cjs/network/transports/tcp.d.ts +0 -32
  690. package/cjs/network/transports/tcp.js +0 -130
  691. package/cjs/network/transports/tcp.js.map +0 -1
  692. package/cjs/network/transports/tcp.test.d.ts +0 -1
  693. package/cjs/network/transports/tcp.test.js +0 -103
  694. package/cjs/network/transports/tcp.test.js.map +0 -1
  695. package/cjs/network/transports/websocket.d.ts +0 -46
  696. package/cjs/network/transports/websocket.js +0 -124
  697. package/cjs/network/transports/websocket.js.map +0 -1
  698. package/cjs/network/transports/websocket.test.d.ts +0 -1
  699. package/cjs/network/transports/websocket.test.js +0 -91
  700. package/cjs/network/transports/websocket.test.js.map +0 -1
  701. package/cjs/storage/providers/idb/driver.d.ts +0 -18
  702. package/cjs/storage/providers/idb/driver.js +0 -138
  703. package/cjs/storage/providers/idb/driver.js.map +0 -1
  704. package/cjs/storage/providers/idb/idb.test.d.ts +0 -1
  705. package/cjs/storage/providers/idb/idb.test.js +0 -29
  706. package/cjs/storage/providers/idb/idb.test.js.map +0 -1
  707. package/cjs/storage/providers/idb/index.d.ts +0 -22
  708. package/cjs/storage/providers/idb/index.js +0 -28
  709. package/cjs/storage/providers/idb/index.js.map +0 -1
  710. package/cjs/storage/providers/idb/repository/auth-keys.d.ts +0 -14
  711. package/cjs/storage/providers/idb/repository/auth-keys.js +0 -70
  712. package/cjs/storage/providers/idb/repository/auth-keys.js.map +0 -1
  713. package/cjs/storage/providers/idb/repository/kv.d.ts +0 -11
  714. package/cjs/storage/providers/idb/repository/kv.js +0 -34
  715. package/cjs/storage/providers/idb/repository/kv.js.map +0 -1
  716. package/cjs/storage/providers/idb/repository/peers.d.ts +0 -12
  717. package/cjs/storage/providers/idb/repository/peers.js +0 -38
  718. package/cjs/storage/providers/idb/repository/peers.js.map +0 -1
  719. package/cjs/storage/providers/idb/repository/ref-messages.d.ts +0 -12
  720. package/cjs/storage/providers/idb/repository/ref-messages.js +0 -57
  721. package/cjs/storage/providers/idb/repository/ref-messages.js.map +0 -1
  722. package/cjs/storage/providers/idb/utils.d.ts +0 -3
  723. package/cjs/storage/providers/idb/utils.js +0 -27
  724. package/cjs/storage/providers/idb/utils.js.map +0 -1
  725. package/cjs/storage/providers/memory/driver.js.map +0 -1
  726. package/cjs/storage/providers/memory/index.js.map +0 -1
  727. package/cjs/storage/providers/memory/memory.test.d.ts +0 -1
  728. package/cjs/storage/providers/memory/memory.test.js +0 -13
  729. package/cjs/storage/providers/memory/memory.test.js.map +0 -1
  730. package/cjs/storage/providers/memory/repository/auth-keys.js.map +0 -1
  731. package/cjs/storage/providers/memory/repository/kv.js.map +0 -1
  732. package/cjs/storage/providers/memory/repository/peers.js.map +0 -1
  733. package/cjs/storage/providers/memory/repository/ref-messages.js.map +0 -1
  734. package/cjs/storage/service/auth-keys.test.d.ts +0 -1
  735. package/cjs/storage/service/auth-keys.test.js +0 -22
  736. package/cjs/storage/service/auth-keys.test.js.map +0 -1
  737. package/cjs/storage/service/updates.test.d.ts +0 -1
  738. package/cjs/storage/service/updates.test.js +0 -60
  739. package/cjs/storage/service/updates.test.js.map +0 -1
  740. package/cjs/storage/service/utils.test-utils.d.ts +0 -2
  741. package/cjs/storage/service/utils.test-utils.js +0 -19
  742. package/cjs/storage/service/utils.test-utils.js.map +0 -1
  743. package/cjs/utils/async-lock.test.d.ts +0 -1
  744. package/cjs/utils/async-lock.test.js +0 -25
  745. package/cjs/utils/async-lock.test.js.map +0 -1
  746. package/cjs/utils/bigint-utils.test.d.ts +0 -1
  747. package/cjs/utils/bigint-utils.test.js +0 -150
  748. package/cjs/utils/bigint-utils.test.js.map +0 -1
  749. package/cjs/utils/buffer-utils.test.d.ts +0 -1
  750. package/cjs/utils/buffer-utils.test.js +0 -69
  751. package/cjs/utils/buffer-utils.test.js.map +0 -1
  752. package/cjs/utils/condition-variable.test.d.ts +0 -1
  753. package/cjs/utils/condition-variable.test.js +0 -27
  754. package/cjs/utils/condition-variable.test.js.map +0 -1
  755. package/cjs/utils/controllable-promise.test.d.ts +0 -1
  756. package/cjs/utils/controllable-promise.test.js +0 -17
  757. package/cjs/utils/controllable-promise.test.js.map +0 -1
  758. package/cjs/utils/crypto/factorization.test.d.ts +0 -1
  759. package/cjs/utils/crypto/factorization.test.js +0 -19
  760. package/cjs/utils/crypto/factorization.test.js.map +0 -1
  761. package/cjs/utils/crypto/keys.test.d.ts +0 -1
  762. package/cjs/utils/crypto/keys.test.js +0 -40
  763. package/cjs/utils/crypto/keys.test.js.map +0 -1
  764. package/cjs/utils/crypto/miller-rabin.test.d.ts +0 -1
  765. package/cjs/utils/crypto/miller-rabin.test.js +0 -60
  766. package/cjs/utils/crypto/miller-rabin.test.js.map +0 -1
  767. package/cjs/utils/crypto/mtproto.test.d.ts +0 -1
  768. package/cjs/utils/crypto/mtproto.test.js +0 -50
  769. package/cjs/utils/crypto/mtproto.test.js.map +0 -1
  770. package/cjs/utils/crypto/node.d.ts +0 -21
  771. package/cjs/utils/crypto/node.js +0 -74
  772. package/cjs/utils/crypto/node.js.map +0 -1
  773. package/cjs/utils/crypto/node.test.d.ts +0 -1
  774. package/cjs/utils/crypto/node.test.js +0 -14
  775. package/cjs/utils/crypto/node.test.js.map +0 -1
  776. package/cjs/utils/crypto/password.test.d.ts +0 -1
  777. package/cjs/utils/crypto/password.test.js +0 -95
  778. package/cjs/utils/crypto/password.test.js.map +0 -1
  779. package/cjs/utils/crypto/utils.test.d.ts +0 -1
  780. package/cjs/utils/crypto/utils.test.js +0 -49
  781. package/cjs/utils/crypto/utils.test.js.map +0 -1
  782. package/cjs/utils/crypto/wasm.d.ts +0 -22
  783. package/cjs/utils/crypto/wasm.js +0 -41
  784. package/cjs/utils/crypto/wasm.js.map +0 -1
  785. package/cjs/utils/crypto/web.d.ts +0 -11
  786. package/cjs/utils/crypto/web.js +0 -40
  787. package/cjs/utils/crypto/web.js.map +0 -1
  788. package/cjs/utils/crypto/web.test.d.ts +0 -1
  789. package/cjs/utils/crypto/web.test.js +0 -17
  790. package/cjs/utils/crypto/web.test.js.map +0 -1
  791. package/cjs/utils/deque.test.d.ts +0 -1
  792. package/cjs/utils/deque.test.js +0 -128
  793. package/cjs/utils/deque.test.js.map +0 -1
  794. package/cjs/utils/function-utils.test.d.ts +0 -1
  795. package/cjs/utils/function-utils.test.js +0 -23
  796. package/cjs/utils/function-utils.test.js.map +0 -1
  797. package/cjs/utils/linked-list.test.d.ts +0 -1
  798. package/cjs/utils/linked-list.test.js +0 -36
  799. package/cjs/utils/linked-list.test.js.map +0 -1
  800. package/cjs/utils/links/bots.test.d.ts +0 -1
  801. package/cjs/utils/links/bots.test.js +0 -152
  802. package/cjs/utils/links/bots.test.js.map +0 -1
  803. package/cjs/utils/links/chat.test.d.ts +0 -1
  804. package/cjs/utils/links/chat.test.js +0 -84
  805. package/cjs/utils/links/chat.test.js.map +0 -1
  806. package/cjs/utils/links/misc.test.d.ts +0 -1
  807. package/cjs/utils/links/misc.test.js +0 -153
  808. package/cjs/utils/links/misc.test.js.map +0 -1
  809. package/cjs/utils/links/proxy.test.d.ts +0 -1
  810. package/cjs/utils/links/proxy.test.js +0 -74
  811. package/cjs/utils/links/proxy.test.js.map +0 -1
  812. package/cjs/utils/links/user.test.d.ts +0 -1
  813. package/cjs/utils/links/user.test.js +0 -63
  814. package/cjs/utils/links/user.test.js.map +0 -1
  815. package/cjs/utils/logger.test.d.ts +0 -1
  816. package/cjs/utils/logger.test.js +0 -139
  817. package/cjs/utils/logger.test.js.map +0 -1
  818. package/cjs/utils/long-utils.test.d.ts +0 -1
  819. package/cjs/utils/long-utils.test.js +0 -158
  820. package/cjs/utils/long-utils.test.js.map +0 -1
  821. package/cjs/utils/lru-map.test.d.ts +0 -1
  822. package/cjs/utils/lru-map.test.js +0 -96
  823. package/cjs/utils/lru-map.test.js.map +0 -1
  824. package/cjs/utils/lru-set.test.d.ts +0 -1
  825. package/cjs/utils/lru-set.test.js +0 -77
  826. package/cjs/utils/lru-set.test.js.map +0 -1
  827. package/cjs/utils/peer-utils.test.d.ts +0 -1
  828. package/cjs/utils/peer-utils.test.js +0 -110
  829. package/cjs/utils/peer-utils.test.js.map +0 -1
  830. package/cjs/utils/platform/crypto.d.ts +0 -1
  831. package/cjs/utils/platform/crypto.js +0 -8
  832. package/cjs/utils/platform/crypto.js.map +0 -1
  833. package/cjs/utils/platform/crypto.web.d.ts +0 -1
  834. package/cjs/utils/platform/crypto.web.js +0 -14
  835. package/cjs/utils/platform/crypto.web.js.map +0 -1
  836. package/cjs/utils/platform/error-reporting.js.map +0 -1
  837. package/cjs/utils/platform/exit-hook.d.ts +0 -1
  838. package/cjs/utils/platform/exit-hook.js +0 -45
  839. package/cjs/utils/platform/exit-hook.js.map +0 -1
  840. package/cjs/utils/platform/exit-hook.web.d.ts +0 -1
  841. package/cjs/utils/platform/exit-hook.web.js +0 -21
  842. package/cjs/utils/platform/exit-hook.web.js.map +0 -1
  843. package/cjs/utils/platform/logging.d.ts +0 -1
  844. package/cjs/utils/platform/logging.js +0 -34
  845. package/cjs/utils/platform/logging.js.map +0 -1
  846. package/cjs/utils/platform/logging.web.d.ts +0 -1
  847. package/cjs/utils/platform/logging.web.js +0 -35
  848. package/cjs/utils/platform/logging.web.js.map +0 -1
  849. package/cjs/utils/platform/transport.d.ts +0 -1
  850. package/cjs/utils/platform/transport.js +0 -8
  851. package/cjs/utils/platform/transport.js.map +0 -1
  852. package/cjs/utils/platform/transport.web.d.ts +0 -1
  853. package/cjs/utils/platform/transport.web.js +0 -15
  854. package/cjs/utils/platform/transport.web.js.map +0 -1
  855. package/cjs/utils/sorted-array.test.d.ts +0 -1
  856. package/cjs/utils/sorted-array.test.js +0 -66
  857. package/cjs/utils/sorted-array.test.js.map +0 -1
  858. package/cjs/utils/tl-json.test.d.ts +0 -1
  859. package/cjs/utils/tl-json.test.js +0 -83
  860. package/cjs/utils/tl-json.test.js.map +0 -1
  861. package/cjs/utils/type-assertions.test.d.ts +0 -1
  862. package/cjs/utils/type-assertions.test.js +0 -67
  863. package/cjs/utils/type-assertions.test.js.map +0 -1
  864. package/esm/highlevel/base.test.d.ts +0 -1
  865. package/esm/highlevel/base.test.js +0 -12
  866. package/esm/highlevel/base.test.js.map +0 -1
  867. package/esm/highlevel/methods/files/_platform.d.ts +0 -1
  868. package/esm/highlevel/methods/files/_platform.js +0 -26
  869. package/esm/highlevel/methods/files/_platform.js.map +0 -1
  870. package/esm/highlevel/methods/files/_platform.web.d.ts +0 -1
  871. package/esm/highlevel/methods/files/_platform.web.js +0 -19
  872. package/esm/highlevel/methods/files/_platform.web.js.map +0 -1
  873. package/esm/highlevel/methods/files/download-file.web.d.ts +0 -1
  874. package/esm/highlevel/methods/files/download-file.web.js +0 -5
  875. package/esm/highlevel/methods/files/download-file.web.js.map +0 -1
  876. package/esm/highlevel/methods/messages/send-text.test.d.ts +0 -1
  877. package/esm/highlevel/methods/messages/send-text.test.js +0 -135
  878. package/esm/highlevel/methods/messages/send-text.test.js.map +0 -1
  879. package/esm/highlevel/methods/users/get-users.test.d.ts +0 -1
  880. package/esm/highlevel/methods/users/get-users.test.js +0 -28
  881. package/esm/highlevel/methods/users/get-users.test.js.map +0 -1
  882. package/esm/highlevel/methods/users/resolve-peer.test.d.ts +0 -1
  883. package/esm/highlevel/methods/users/resolve-peer.test.js +0 -302
  884. package/esm/highlevel/methods/users/resolve-peer.test.js.map +0 -1
  885. package/esm/highlevel/types/bots/command-scope.d.ts +0 -63
  886. package/esm/highlevel/types/bots/command-scope.js +0 -84
  887. package/esm/highlevel/types/bots/command-scope.js.map +0 -1
  888. package/esm/highlevel/types/bots/input/index.d.ts +0 -2
  889. package/esm/highlevel/types/bots/input/index.js +0 -3
  890. package/esm/highlevel/types/bots/input/index.js.map +0 -1
  891. package/esm/highlevel/types/bots/input/input-inline-message.js +0 -176
  892. package/esm/highlevel/types/bots/input/input-inline-message.js.map +0 -1
  893. package/esm/highlevel/types/bots/input/input-inline-result.js +0 -487
  894. package/esm/highlevel/types/bots/input/input-inline-result.js.map +0 -1
  895. package/esm/highlevel/types/bots/keyboard-builder.js.map +0 -1
  896. package/esm/highlevel/types/bots/keyboard-builder.test.d.ts +0 -1
  897. package/esm/highlevel/types/bots/keyboard-builder.test.js +0 -160
  898. package/esm/highlevel/types/bots/keyboard-builder.test.js.map +0 -1
  899. package/esm/highlevel/types/bots/keyboards.d.ts +0 -239
  900. package/esm/highlevel/types/bots/keyboards.js +0 -377
  901. package/esm/highlevel/types/bots/keyboards.js.map +0 -1
  902. package/esm/highlevel/types/bots/keyboards.test.d.ts +0 -1
  903. package/esm/highlevel/types/bots/keyboards.test.js +0 -144
  904. package/esm/highlevel/types/bots/keyboards.test.js.map +0 -1
  905. package/esm/highlevel/types/media/input-media.js +0 -251
  906. package/esm/highlevel/types/media/input-media.js.map +0 -1
  907. package/esm/highlevel/types/misc/input-privacy-rule.d.ts +0 -63
  908. package/esm/highlevel/types/misc/input-privacy-rule.js +0 -82
  909. package/esm/highlevel/types/misc/input-privacy-rule.js.map +0 -1
  910. package/esm/highlevel/types/peers/peers-index.test.d.ts +0 -1
  911. package/esm/highlevel/types/peers/peers-index.test.js +0 -69
  912. package/esm/highlevel/types/peers/peers-index.test.js.map +0 -1
  913. package/esm/highlevel/types/peers/user.test.d.ts +0 -1
  914. package/esm/highlevel/types/peers/user.test.js +0 -171
  915. package/esm/highlevel/types/peers/user.test.js.map +0 -1
  916. package/esm/highlevel/utils/file-type.test.d.ts +0 -1
  917. package/esm/highlevel/utils/file-type.test.js +0 -62
  918. package/esm/highlevel/utils/file-type.test.js.map +0 -1
  919. package/esm/highlevel/utils/file-utils.test.d.ts +0 -1
  920. package/esm/highlevel/utils/file-utils.test.js +0 -124
  921. package/esm/highlevel/utils/file-utils.test.js.map +0 -1
  922. package/esm/highlevel/utils/inline-utils.test.d.ts +0 -1
  923. package/esm/highlevel/utils/inline-utils.test.js +0 -42
  924. package/esm/highlevel/utils/inline-utils.test.js.map +0 -1
  925. package/esm/highlevel/utils/inspectable.test.d.ts +0 -1
  926. package/esm/highlevel/utils/inspectable.test.js +0 -95
  927. package/esm/highlevel/utils/inspectable.test.js.map +0 -1
  928. package/esm/highlevel/utils/memoize.test.d.ts +0 -1
  929. package/esm/highlevel/utils/memoize.test.js +0 -58
  930. package/esm/highlevel/utils/memoize.test.js.map +0 -1
  931. package/esm/highlevel/utils/peer-utils.test.d.ts +0 -1
  932. package/esm/highlevel/utils/peer-utils.test.js +0 -107
  933. package/esm/highlevel/utils/peer-utils.test.js.map +0 -1
  934. package/esm/highlevel/utils/platform/storage.d.ts +0 -1
  935. package/esm/highlevel/utils/platform/storage.js +0 -6
  936. package/esm/highlevel/utils/platform/storage.js.map +0 -1
  937. package/esm/highlevel/utils/platform/storage.web.d.ts +0 -1
  938. package/esm/highlevel/utils/platform/storage.web.js +0 -10
  939. package/esm/highlevel/utils/platform/storage.web.js.map +0 -1
  940. package/esm/highlevel/utils/query-batcher.test.d.ts +0 -1
  941. package/esm/highlevel/utils/query-batcher.test.js +0 -500
  942. package/esm/highlevel/utils/query-batcher.test.js.map +0 -1
  943. package/esm/highlevel/utils/stream-utils.test.d.ts +0 -1
  944. package/esm/highlevel/utils/stream-utils.test.js +0 -96
  945. package/esm/highlevel/utils/stream-utils.test.js.map +0 -1
  946. package/esm/highlevel/utils/string-session.test.d.ts +0 -1
  947. package/esm/highlevel/utils/string-session.test.js +0 -196
  948. package/esm/highlevel/utils/string-session.test.js.map +0 -1
  949. package/esm/highlevel/utils/voice-utils.test.d.ts +0 -1
  950. package/esm/highlevel/utils/voice-utils.test.js +0 -26
  951. package/esm/highlevel/utils/voice-utils.test.js.map +0 -1
  952. package/esm/highlevel/worker/platform/connect.d.ts +0 -2
  953. package/esm/highlevel/worker/platform/connect.js +0 -15
  954. package/esm/highlevel/worker/platform/connect.js.map +0 -1
  955. package/esm/highlevel/worker/platform/connect.web.d.ts +0 -2
  956. package/esm/highlevel/worker/platform/connect.web.js +0 -47
  957. package/esm/highlevel/worker/platform/connect.web.js.map +0 -1
  958. package/esm/highlevel/worker/platform/register.d.ts +0 -2
  959. package/esm/highlevel/worker/platform/register.js +0 -16
  960. package/esm/highlevel/worker/platform/register.js.map +0 -1
  961. package/esm/highlevel/worker/platform/register.web.d.ts +0 -2
  962. package/esm/highlevel/worker/platform/register.web.js +0 -60
  963. package/esm/highlevel/worker/platform/register.web.js.map +0 -1
  964. package/esm/network/auth-key.test.d.ts +0 -1
  965. package/esm/network/auth-key.test.js +0 -106
  966. package/esm/network/auth-key.test.js.map +0 -1
  967. package/esm/network/config-manager.test.d.ts +0 -1
  968. package/esm/network/config-manager.test.js +0 -172
  969. package/esm/network/config-manager.test.js.map +0 -1
  970. package/esm/network/persistent-connection.test.d.ts +0 -1
  971. package/esm/network/persistent-connection.test.js +0 -155
  972. package/esm/network/persistent-connection.test.js.map +0 -1
  973. package/esm/network/transports/intermediate.test.d.ts +0 -1
  974. package/esm/network/transports/intermediate.test.js +0 -82
  975. package/esm/network/transports/intermediate.test.js.map +0 -1
  976. package/esm/network/transports/obfuscated.test.d.ts +0 -1
  977. package/esm/network/transports/obfuscated.test.js +0 -129
  978. package/esm/network/transports/obfuscated.test.js.map +0 -1
  979. package/esm/network/transports/tcp.d.ts +0 -32
  980. package/esm/network/transports/tcp.js +0 -122
  981. package/esm/network/transports/tcp.js.map +0 -1
  982. package/esm/network/transports/tcp.test.d.ts +0 -1
  983. package/esm/network/transports/tcp.test.js +0 -101
  984. package/esm/network/transports/tcp.test.js.map +0 -1
  985. package/esm/network/transports/websocket.d.ts +0 -46
  986. package/esm/network/transports/websocket.js +0 -116
  987. package/esm/network/transports/websocket.js.map +0 -1
  988. package/esm/network/transports/websocket.test.d.ts +0 -1
  989. package/esm/network/transports/websocket.test.js +0 -89
  990. package/esm/network/transports/websocket.test.js.map +0 -1
  991. package/esm/storage/providers/idb/driver.d.ts +0 -18
  992. package/esm/storage/providers/idb/driver.js +0 -134
  993. package/esm/storage/providers/idb/driver.js.map +0 -1
  994. package/esm/storage/providers/idb/idb.test.d.ts +0 -1
  995. package/esm/storage/providers/idb/idb.test.js +0 -27
  996. package/esm/storage/providers/idb/idb.test.js.map +0 -1
  997. package/esm/storage/providers/idb/index.d.ts +0 -22
  998. package/esm/storage/providers/idb/index.js +0 -23
  999. package/esm/storage/providers/idb/index.js.map +0 -1
  1000. package/esm/storage/providers/idb/repository/auth-keys.d.ts +0 -14
  1001. package/esm/storage/providers/idb/repository/auth-keys.js +0 -66
  1002. package/esm/storage/providers/idb/repository/auth-keys.js.map +0 -1
  1003. package/esm/storage/providers/idb/repository/kv.d.ts +0 -11
  1004. package/esm/storage/providers/idb/repository/kv.js +0 -30
  1005. package/esm/storage/providers/idb/repository/kv.js.map +0 -1
  1006. package/esm/storage/providers/idb/repository/peers.d.ts +0 -12
  1007. package/esm/storage/providers/idb/repository/peers.js +0 -34
  1008. package/esm/storage/providers/idb/repository/peers.js.map +0 -1
  1009. package/esm/storage/providers/idb/repository/ref-messages.d.ts +0 -12
  1010. package/esm/storage/providers/idb/repository/ref-messages.js +0 -53
  1011. package/esm/storage/providers/idb/repository/ref-messages.js.map +0 -1
  1012. package/esm/storage/providers/idb/utils.d.ts +0 -3
  1013. package/esm/storage/providers/idb/utils.js +0 -21
  1014. package/esm/storage/providers/idb/utils.js.map +0 -1
  1015. package/esm/storage/providers/memory/driver.js.map +0 -1
  1016. package/esm/storage/providers/memory/index.js.map +0 -1
  1017. package/esm/storage/providers/memory/memory.test.d.ts +0 -1
  1018. package/esm/storage/providers/memory/memory.test.js +0 -11
  1019. package/esm/storage/providers/memory/memory.test.js.map +0 -1
  1020. package/esm/storage/providers/memory/repository/auth-keys.js.map +0 -1
  1021. package/esm/storage/providers/memory/repository/kv.js.map +0 -1
  1022. package/esm/storage/providers/memory/repository/peers.js.map +0 -1
  1023. package/esm/storage/providers/memory/repository/ref-messages.js.map +0 -1
  1024. package/esm/storage/service/auth-keys.test.d.ts +0 -1
  1025. package/esm/storage/service/auth-keys.test.js +0 -20
  1026. package/esm/storage/service/auth-keys.test.js.map +0 -1
  1027. package/esm/storage/service/updates.test.d.ts +0 -1
  1028. package/esm/storage/service/updates.test.js +0 -58
  1029. package/esm/storage/service/updates.test.js.map +0 -1
  1030. package/esm/storage/service/utils.test-utils.d.ts +0 -2
  1031. package/esm/storage/service/utils.test-utils.js +0 -15
  1032. package/esm/storage/service/utils.test-utils.js.map +0 -1
  1033. package/esm/utils/async-lock.test.d.ts +0 -1
  1034. package/esm/utils/async-lock.test.js +0 -23
  1035. package/esm/utils/async-lock.test.js.map +0 -1
  1036. package/esm/utils/bigint-utils.test.d.ts +0 -1
  1037. package/esm/utils/bigint-utils.test.js +0 -148
  1038. package/esm/utils/bigint-utils.test.js.map +0 -1
  1039. package/esm/utils/buffer-utils.test.d.ts +0 -1
  1040. package/esm/utils/buffer-utils.test.js +0 -67
  1041. package/esm/utils/buffer-utils.test.js.map +0 -1
  1042. package/esm/utils/condition-variable.test.d.ts +0 -1
  1043. package/esm/utils/condition-variable.test.js +0 -25
  1044. package/esm/utils/condition-variable.test.js.map +0 -1
  1045. package/esm/utils/controllable-promise.test.d.ts +0 -1
  1046. package/esm/utils/controllable-promise.test.js +0 -15
  1047. package/esm/utils/controllable-promise.test.js.map +0 -1
  1048. package/esm/utils/crypto/factorization.test.d.ts +0 -1
  1049. package/esm/utils/crypto/factorization.test.js +0 -17
  1050. package/esm/utils/crypto/factorization.test.js.map +0 -1
  1051. package/esm/utils/crypto/keys.test.d.ts +0 -1
  1052. package/esm/utils/crypto/keys.test.js +0 -38
  1053. package/esm/utils/crypto/keys.test.js.map +0 -1
  1054. package/esm/utils/crypto/miller-rabin.test.d.ts +0 -1
  1055. package/esm/utils/crypto/miller-rabin.test.js +0 -58
  1056. package/esm/utils/crypto/miller-rabin.test.js.map +0 -1
  1057. package/esm/utils/crypto/mtproto.test.d.ts +0 -1
  1058. package/esm/utils/crypto/mtproto.test.js +0 -48
  1059. package/esm/utils/crypto/mtproto.test.js.map +0 -1
  1060. package/esm/utils/crypto/node.d.ts +0 -21
  1061. package/esm/utils/crypto/node.js +0 -69
  1062. package/esm/utils/crypto/node.js.map +0 -1
  1063. package/esm/utils/crypto/node.test.d.ts +0 -1
  1064. package/esm/utils/crypto/node.test.js +0 -12
  1065. package/esm/utils/crypto/node.test.js.map +0 -1
  1066. package/esm/utils/crypto/password.test.d.ts +0 -1
  1067. package/esm/utils/crypto/password.test.js +0 -90
  1068. package/esm/utils/crypto/password.test.js.map +0 -1
  1069. package/esm/utils/crypto/utils.test.d.ts +0 -1
  1070. package/esm/utils/crypto/utils.test.js +0 -47
  1071. package/esm/utils/crypto/utils.test.js.map +0 -1
  1072. package/esm/utils/crypto/wasm.d.ts +0 -22
  1073. package/esm/utils/crypto/wasm.js +0 -37
  1074. package/esm/utils/crypto/wasm.js.map +0 -1
  1075. package/esm/utils/crypto/web.d.ts +0 -11
  1076. package/esm/utils/crypto/web.js +0 -36
  1077. package/esm/utils/crypto/web.js.map +0 -1
  1078. package/esm/utils/crypto/web.test.d.ts +0 -1
  1079. package/esm/utils/crypto/web.test.js +0 -15
  1080. package/esm/utils/crypto/web.test.js.map +0 -1
  1081. package/esm/utils/deque.test.d.ts +0 -1
  1082. package/esm/utils/deque.test.js +0 -126
  1083. package/esm/utils/deque.test.js.map +0 -1
  1084. package/esm/utils/function-utils.test.d.ts +0 -1
  1085. package/esm/utils/function-utils.test.js +0 -21
  1086. package/esm/utils/function-utils.test.js.map +0 -1
  1087. package/esm/utils/linked-list.test.d.ts +0 -1
  1088. package/esm/utils/linked-list.test.js +0 -34
  1089. package/esm/utils/linked-list.test.js.map +0 -1
  1090. package/esm/utils/links/bots.test.d.ts +0 -1
  1091. package/esm/utils/links/bots.test.js +0 -150
  1092. package/esm/utils/links/bots.test.js.map +0 -1
  1093. package/esm/utils/links/chat.test.d.ts +0 -1
  1094. package/esm/utils/links/chat.test.js +0 -82
  1095. package/esm/utils/links/chat.test.js.map +0 -1
  1096. package/esm/utils/links/misc.test.d.ts +0 -1
  1097. package/esm/utils/links/misc.test.js +0 -151
  1098. package/esm/utils/links/misc.test.js.map +0 -1
  1099. package/esm/utils/links/proxy.test.d.ts +0 -1
  1100. package/esm/utils/links/proxy.test.js +0 -72
  1101. package/esm/utils/links/proxy.test.js.map +0 -1
  1102. package/esm/utils/links/user.test.d.ts +0 -1
  1103. package/esm/utils/links/user.test.js +0 -61
  1104. package/esm/utils/links/user.test.js.map +0 -1
  1105. package/esm/utils/logger.test.d.ts +0 -1
  1106. package/esm/utils/logger.test.js +0 -134
  1107. package/esm/utils/logger.test.js.map +0 -1
  1108. package/esm/utils/long-utils.test.d.ts +0 -1
  1109. package/esm/utils/long-utils.test.js +0 -153
  1110. package/esm/utils/long-utils.test.js.map +0 -1
  1111. package/esm/utils/lru-map.test.d.ts +0 -1
  1112. package/esm/utils/lru-map.test.js +0 -94
  1113. package/esm/utils/lru-map.test.js.map +0 -1
  1114. package/esm/utils/lru-set.test.d.ts +0 -1
  1115. package/esm/utils/lru-set.test.js +0 -72
  1116. package/esm/utils/lru-set.test.js.map +0 -1
  1117. package/esm/utils/peer-utils.test.d.ts +0 -1
  1118. package/esm/utils/peer-utils.test.js +0 -105
  1119. package/esm/utils/peer-utils.test.js.map +0 -1
  1120. package/esm/utils/platform/crypto.d.ts +0 -1
  1121. package/esm/utils/platform/crypto.js +0 -4
  1122. package/esm/utils/platform/crypto.js.map +0 -1
  1123. package/esm/utils/platform/crypto.web.d.ts +0 -1
  1124. package/esm/utils/platform/crypto.web.js +0 -10
  1125. package/esm/utils/platform/crypto.web.js.map +0 -1
  1126. package/esm/utils/platform/error-reporting.js.map +0 -1
  1127. package/esm/utils/platform/exit-hook.d.ts +0 -1
  1128. package/esm/utils/platform/exit-hook.js +0 -41
  1129. package/esm/utils/platform/exit-hook.js.map +0 -1
  1130. package/esm/utils/platform/exit-hook.web.d.ts +0 -1
  1131. package/esm/utils/platform/exit-hook.web.js +0 -17
  1132. package/esm/utils/platform/exit-hook.web.js.map +0 -1
  1133. package/esm/utils/platform/logging.d.ts +0 -1
  1134. package/esm/utils/platform/logging.js +0 -31
  1135. package/esm/utils/platform/logging.js.map +0 -1
  1136. package/esm/utils/platform/logging.web.d.ts +0 -1
  1137. package/esm/utils/platform/logging.web.js +0 -31
  1138. package/esm/utils/platform/logging.web.js.map +0 -1
  1139. package/esm/utils/platform/transport.d.ts +0 -1
  1140. package/esm/utils/platform/transport.js +0 -4
  1141. package/esm/utils/platform/transport.js.map +0 -1
  1142. package/esm/utils/platform/transport.web.d.ts +0 -1
  1143. package/esm/utils/platform/transport.web.js +0 -12
  1144. package/esm/utils/platform/transport.web.js.map +0 -1
  1145. package/esm/utils/sorted-array.test.d.ts +0 -1
  1146. package/esm/utils/sorted-array.test.js +0 -64
  1147. package/esm/utils/sorted-array.test.js.map +0 -1
  1148. package/esm/utils/tl-json.test.d.ts +0 -1
  1149. package/esm/utils/tl-json.test.js +0 -81
  1150. package/esm/utils/tl-json.test.js.map +0 -1
  1151. package/esm/utils/type-assertions.test.d.ts +0 -1
  1152. package/esm/utils/type-assertions.test.js +0 -65
  1153. package/esm/utils/type-assertions.test.js.map +0 -1
  1154. /package/cjs/highlevel/{base.test.d.ts → methods/files/download-node-stream.d.ts} +0 -0
  1155. /package/cjs/storage/{providers/memory → memory}/driver.js +0 -0
  1156. /package/cjs/storage/{providers/memory → memory}/index.js +0 -0
  1157. /package/cjs/storage/{providers/memory → memory}/repository/auth-keys.js +0 -0
  1158. /package/cjs/storage/{providers/memory → memory}/repository/kv.js +0 -0
  1159. /package/cjs/storage/{providers/memory → memory}/repository/peers.js +0 -0
  1160. /package/cjs/storage/{providers/memory → memory}/repository/ref-messages.js +0 -0
  1161. /package/cjs/utils/{platform/error-reporting.js → error-reporting.js} +0 -0
  1162. /package/{cjs/highlevel/methods/files/_platform.d.ts → esm/highlevel/methods/files/download-node-stream.d.ts} +0 -0
  1163. /package/esm/storage/{providers/memory → memory}/driver.js +0 -0
  1164. /package/esm/storage/{providers/memory → memory}/index.js +0 -0
  1165. /package/esm/storage/{providers/memory → memory}/repository/auth-keys.js +0 -0
  1166. /package/esm/storage/{providers/memory → memory}/repository/kv.js +0 -0
  1167. /package/esm/storage/{providers/memory → memory}/repository/peers.js +0 -0
  1168. /package/esm/storage/{providers/memory → memory}/repository/ref-messages.js +0 -0
  1169. /package/esm/utils/{platform/error-reporting.js → error-reporting.js} +0 -0
@@ -1,254 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InputMedia = void 0;
4
- // eslint-disable-next-line @typescript-eslint/no-namespace
5
- var InputMedia;
6
- (function (InputMedia) {
7
- /**
8
- * Create an animation to be sent
9
- *
10
- * @param file Animation
11
- * @param params Additional parameters
12
- */
13
- function animation(file, params = {}) {
14
- const ret = params;
15
- ret.type = 'video';
16
- ret.file = file;
17
- ret.isAnimated = true;
18
- return ret;
19
- }
20
- InputMedia.animation = animation;
21
- /**
22
- * Create an audio to be sent
23
- *
24
- * @param file Audio file
25
- * @param params Additional parameters
26
- */
27
- function audio(file, params = {}) {
28
- const ret = params;
29
- ret.type = 'audio';
30
- ret.file = file;
31
- return ret;
32
- }
33
- InputMedia.audio = audio;
34
- /**
35
- * Create an document to be sent
36
- *
37
- * @param file Document
38
- * @param params Additional parameters
39
- */
40
- function document(file, params = {}) {
41
- const ret = params;
42
- ret.type = 'document';
43
- ret.file = file;
44
- return ret;
45
- }
46
- InputMedia.document = document;
47
- /**
48
- * Create an photo to be sent
49
- *
50
- * @param file Photo
51
- * @param params Additional parameters
52
- */
53
- function photo(file, params = {}) {
54
- const ret = params;
55
- ret.type = 'photo';
56
- ret.file = file;
57
- return ret;
58
- }
59
- InputMedia.photo = photo;
60
- /**
61
- * Create an video to be sent
62
- *
63
- * @param file Video
64
- * @param params Additional parameters
65
- */
66
- function video(file, params = {}) {
67
- const ret = params;
68
- ret.type = 'video';
69
- ret.file = file;
70
- return ret;
71
- }
72
- InputMedia.video = video;
73
- /**
74
- * Create a voice note to be sent
75
- *
76
- * @param file Voice note
77
- * @param params Additional parameters
78
- */
79
- function voice(file, params = {}) {
80
- const ret = params;
81
- ret.type = 'voice';
82
- ret.file = file;
83
- return ret;
84
- }
85
- InputMedia.voice = voice;
86
- /**
87
- * Create a sticker to be sent
88
- *
89
- * @param file Sticker
90
- * @param params Additional parameters
91
- */
92
- function sticker(file, params = {}) {
93
- const ret = params;
94
- ret.type = 'sticker';
95
- ret.file = file;
96
- return ret;
97
- }
98
- InputMedia.sticker = sticker;
99
- /**
100
- * Create a venue to be sent
101
- *
102
- * @param params Venue parameters
103
- */
104
- function venue(params) {
105
- const ret = params;
106
- ret.type = 'venue';
107
- return ret;
108
- }
109
- InputMedia.venue = venue;
110
- /**
111
- * Create a geolocation to be sent
112
- *
113
- * @param latitude Latitude of the location
114
- * @param longitude Longitude of the location
115
- * @param params Additional parameters
116
- */
117
- function geo(latitude, longitude, params = {}) {
118
- const ret = params;
119
- ret.type = 'geo';
120
- ret.latitude = latitude;
121
- ret.longitude = longitude;
122
- return ret;
123
- }
124
- InputMedia.geo = geo;
125
- /**
126
- * Create a live geolocation to be sent
127
- *
128
- * @param latitude Latitude of the current location
129
- * @param longitude Longitude of the current location
130
- * @param params Additional parameters
131
- */
132
- function geoLive(latitude, longitude, params = {}) {
133
- const ret = params;
134
- ret.type = 'geo_live';
135
- ret.latitude = latitude;
136
- ret.longitude = longitude;
137
- return ret;
138
- }
139
- InputMedia.geoLive = geoLive;
140
- /**
141
- * Create a dice to be sent
142
- *
143
- * For convenience, known dice emojis are available
144
- * as static members of {@link Dice}.
145
- *
146
- * @param emoji Emoji representing the dice
147
- * @param params Additional parameters
148
- */
149
- function dice(emoji, params) {
150
- const ret = params;
151
- ret.type = 'dice';
152
- return ret;
153
- }
154
- InputMedia.dice = dice;
155
- /**
156
- * Create a contact to be sent
157
- *
158
- * @param params Contact parameters
159
- */
160
- function contact(params) {
161
- const ret = params;
162
- ret.type = 'contact';
163
- return ret;
164
- }
165
- InputMedia.contact = contact;
166
- /**
167
- * Create a game to be sent
168
- *
169
- * @param game Game short name or TL object representing one
170
- */
171
- function game(game) {
172
- return {
173
- type: 'game',
174
- game,
175
- };
176
- }
177
- InputMedia.game = game;
178
- /**
179
- * Create an invoice to be sent
180
- *
181
- * @param params Invoice parameters
182
- */
183
- function invoice(params) {
184
- const ret = params;
185
- ret.type = 'invoice';
186
- return ret;
187
- }
188
- InputMedia.invoice = invoice;
189
- /**
190
- * Create a poll to be sent
191
- *
192
- * @param params Poll parameters
193
- */
194
- function poll(params) {
195
- const ret = params;
196
- ret.type = 'poll';
197
- return ret;
198
- }
199
- InputMedia.poll = poll;
200
- /**
201
- * Create a quiz to be sent
202
- *
203
- * @param params Quiz parameters
204
- */
205
- function quiz(params) {
206
- const ret = params;
207
- ret.type = 'quiz';
208
- return ret;
209
- }
210
- InputMedia.quiz = quiz;
211
- /**
212
- * Create a story to be sent
213
- *
214
- * @param params Story parameters
215
- */
216
- function story(params) {
217
- const ret = params;
218
- ret.type = 'story';
219
- return ret;
220
- }
221
- InputMedia.story = story;
222
- /**
223
- * Create a webpage to be sent
224
- *
225
- * @param url Webpage URL
226
- * @param params Additional parameters
227
- */
228
- function webpage(url, params = {}) {
229
- const ret = params;
230
- ret.type = 'webpage';
231
- ret.url = url;
232
- return ret;
233
- }
234
- InputMedia.webpage = webpage;
235
- /**
236
- * Create a document to be sent, which subtype
237
- * is inferred automatically by file contents.
238
- *
239
- * Photo type is only inferred for reused files,
240
- * newly uploaded photos with `auto` will be
241
- * uploaded as a document
242
- *
243
- * @param file The media file
244
- * @param params Additional parameters
245
- */
246
- function auto(file, params = {}) {
247
- const ret = params;
248
- ret.type = 'auto';
249
- ret.file = file;
250
- return ret;
251
- }
252
- InputMedia.auto = auto;
253
- })(InputMedia || (exports.InputMedia = InputMedia = {}));
254
- //# sourceMappingURL=input-media.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"input-media.js","sourceRoot":"","sources":["../../../../../src/highlevel/types/media/input-media.ts"],"names":[],"mappings":";;;AAkmBA,2DAA2D;AAC3D,IAAiB,UAAU,CAsR1B;AAtRD,W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IG;IACH,SAAgB,KAAK,CAAC,MAAwC;QAC1D,MAAM,GAAG,GAAG,MAAqC,CAAA;QACjD,GAAG,CAAC,IAAI,GAAG,OAAO,CAAA;QAElB,OAAO,GAAG,CAAA;IACd,CAAC;IALe,gBAAK,QAKpB,CAAA;IAED;;;;;OAKG;IACH,SAAgB,OAAO,CAAC,GAAW,EAAE,SAAoD,EAAE;QACvF,MAAM,GAAG,GAAG,MAAuC,CAAA;QACnD,GAAG,CAAC,IAAI,GAAG,SAAS,CAAA;QACpB,GAAG,CAAC,GAAG,GAAG,GAAG,CAAA;QAEb,OAAO,GAAG,CAAA;IACd,CAAC;IANe,kBAAO,UAMtB,CAAA;IAED;;;;;;;;;;OAUG;IACH,SAAgB,IAAI,CAAC,IAAmB,EAAE,SAA0C,EAAE;QAClF,MAAM,GAAG,GAAG,MAAoC,CAAA;QAChD,GAAG,CAAC,IAAI,GAAG,MAAM,CAAA;QACjB,GAAG,CAAC,IAAI,GAAG,IAAI,CAAA;QAEf,OAAO,GAAG,CAAA;IACd,CAAC;IANe,eAAI,OAMnB,CAAA;AACL,CAAC,EAtRgB,UAAU,0BAAV,UAAU,QAsR1B","sourcesContent":["import { tl } from '@mtcute/tl'\n\nimport { MaybeArray } from '../../../types/utils.js'\nimport { InputText } from '../../types/misc/entities.js'\nimport { InputFileLike } from '../files/index.js'\nimport { InputPeerLike } from '../peers/index.js'\nimport { VenueSource } from './venue.js'\n\nexport interface CaptionMixin {\n /**\n * Caption of the media\n */\n caption?: InputText\n}\n\nexport interface FileMixin {\n /**\n * File to be sent\n */\n file: InputFileLike\n\n /**\n * Override file name for the file.\n *\n * Only applicable to newly uploaded files.\n */\n fileName?: string\n\n /**\n * Override MIME type for the file\n *\n * Only applicable to newly uploaded files.\n */\n fileMime?: string\n\n /**\n * Override file size for the file\n *\n * Only applicable to newly uploaded files.\n */\n fileSize?: number\n\n /**\n * TTL for the media in seconds.\n *\n * Only applicable to some media types\n */\n ttlSeconds?: number\n}\n\n/**\n * Automatically detect media type based on file contents.\n *\n * Photo type is only inferred for reused files,\n * newly uploaded photos with `auto` will be\n * uploaded as a document\n */\nexport interface InputMediaAuto extends FileMixin, CaptionMixin {\n type: 'auto'\n}\n\n/**\n * An audio file or voice message to be sent\n */\nexport interface InputMediaAudio extends FileMixin, CaptionMixin {\n type: 'audio'\n\n /**\n * Thumbnail of the audio file album cover.\n *\n * The thumbnail should be in JPEG format and less than 200 KB in size.\n * A thumbnail's width and height should not exceed 320 pixels.\n * Thumbnails can't be reused and can be only uploaded as a new file.\n *\n * Only applicable to newly uploaded files.\n */\n thumb?: InputFileLike\n\n /**\n * Duration of the audio in seconds\n *\n * Only applicable to newly uploaded files.\n */\n duration?: number\n\n /**\n * Performer of the audio\n *\n * Only applicable to newly uploaded files.\n */\n performer?: string\n\n /**\n * Title of the audio\n *\n * Only applicable to newly uploaded files.\n */\n title?: string\n}\n\n/**\n * Voice message to be sent\n */\nexport interface InputMediaVoice extends FileMixin, CaptionMixin {\n type: 'voice'\n\n /**\n * Duration of the voice message in seconds\n *\n * Only applicable to newly uploaded files.\n */\n duration?: number\n\n /**\n * Waveform of the voice message.\n *\n * Represented with integers in range [0, 31],\n * usually has length of 100.\n * Generated by the server if omitted.\n *\n * Only applicable to newly uploaded files.\n */\n waveform?: number[]\n}\n\n/**\n * A generic file to be sent\n */\nexport interface InputMediaDocument extends FileMixin, CaptionMixin {\n type: 'document'\n\n /**\n * Thumbnail of the document.\n *\n * The thumbnail should be in JPEG format and less than 200 KB in size.\n * A thumbnail's width and height should not exceed 320 pixels.\n * Thumbnails can't be reused and can be only uploaded as a new file.\n *\n * Only applicable to newly uploaded files.\n */\n thumb?: InputFileLike\n}\n\n/**\n * A photo to be sent\n */\nexport interface InputMediaPhoto extends FileMixin, CaptionMixin {\n type: 'photo'\n\n /**\n * Whether this photo should be hidden with a spoiler\n */\n spoiler?: boolean\n}\n\n/**\n * A sticker to be sent\n */\nexport interface InputMediaSticker extends FileMixin, CaptionMixin {\n type: 'sticker'\n\n /**\n * Whether this sticker is animated?\n *\n * Note that animated stickers must be in TGS\n * format, which is Lottie JSON compressed using GZip\n *\n * Only applicable to newly uploaded files.\n *\n * @default false\n */\n isAnimated?: boolean\n\n /**\n * An emoji representing this sticker\n *\n * Only applicable to newly uploaded files,\n * for some reason doesn't work with animated stickers.\n */\n alt?: string\n}\n\n/**\n * A video to be sent\n */\nexport interface InputMediaVideo extends FileMixin, CaptionMixin {\n type: 'video'\n\n /**\n * Thumbnail of the video.\n *\n * The thumbnail should be in JPEG format and less than 200 KB in size.\n * A thumbnail's width and height should not exceed 320 pixels.\n * Thumbnails can't be reused and can be only uploaded as a new file.\n *\n * Only applicable to newly uploaded files.\n */\n thumb?: InputFileLike\n\n /**\n * Width of the video in pixels\n *\n * Only applicable to newly uploaded files.\n */\n width?: number\n\n /**\n * Height of the video in pixels\n *\n * Only applicable to newly uploaded files.\n */\n height?: number\n\n /**\n * Duration of the video in seconds\n *\n * Only applicable to newly uploaded files.\n */\n duration?: number\n\n /**\n * Whether the video is suitable for streaming\n *\n * Only applicable to newly uploaded files.\n */\n supportsStreaming?: boolean\n\n /**\n * Whether this video is an animated GIF\n *\n * Only applicable to newly uploaded files.\n */\n isAnimated?: boolean\n\n /**\n * Whether this video is a round message (aka video note)\n *\n * Only applicable to newly uploaded files.\n */\n isRound?: boolean\n\n /**\n * Whether this video should be hidden with a spoiler\n */\n spoiler?: boolean\n}\n\n/**\n * A geolocation to be sent\n */\nexport interface InputMediaGeo extends CaptionMixin {\n type: 'geo'\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 * The estimated horizontal accuracy of the\n * geolocation, in meters (0-1500)\n */\n accuracy?: number\n}\n\n/**\n * A live geolocation to be sent\n */\nexport interface InputMediaGeoLive extends Omit<InputMediaGeo, 'type'> {\n type: 'geo_live'\n\n /**\n * Whether sending of the geolocation has stopped\n */\n stopped?: boolean\n\n /**\n * Direction in which the location moves, in degrees (1-360)\n */\n heading?: number\n\n /**\n * Validity period of the live location\n */\n period?: number\n\n /**\n * Maximum distance to another chat member for proximity\n * alerts, in meters (0-100000)\n */\n proximityNotificationRadius?: number\n}\n\n/**\n * An animated dice with a random value to be sent\n *\n * For convenience, known dice emojis are available\n * as static members of {@link Dice}.\n *\n * Note that dice result value is generated randomly on the server,\n * you can't influence it in any way!\n */\nexport interface InputMediaDice extends CaptionMixin {\n type: 'dice'\n\n /**\n * Emoji representing a dice\n */\n emoji: string\n}\n\n/**\n * A venue to be sent\n */\nexport interface InputMediaVenue extends CaptionMixin {\n type: 'venue'\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 name\n */\n title: string\n\n /**\n * Venue address\n */\n address: string\n\n /**\n * When available, source from where this venue was acquired\n */\n source?: VenueSource\n}\n\n/**\n * A contact to be sent\n */\nexport interface InputMediaContact extends CaptionMixin {\n type: 'contact'\n\n /**\n * Contact's phone number\n */\n phone: string\n\n /**\n * Contact's first name\n */\n firstName: string\n\n /**\n * Contact's last name\n */\n lastName?: string\n\n /**\n * Additional data about the contact\n * as a vCard (0-2048 bytes)\n */\n vcard?: string\n}\n\n/**\n * A game to be sent\n */\nexport interface InputMediaGame extends CaptionMixin {\n type: 'game'\n\n /**\n * Game's short name, or a TL object with an input game\n */\n game: string | tl.TypeInputGame\n}\n\n/**\n * An invoice to be sent (see https://core.telegram.org/bots/payments)\n */\nexport interface InputMediaInvoice extends CaptionMixin {\n type: 'invoice'\n\n /**\n * Product name (1-32 chars)\n */\n title: string\n\n /**\n * Product description (1-255 chars)\n */\n description: string\n\n /**\n * The invoice itself\n */\n invoice: tl.TypeInvoice\n\n /**\n * Bot-defined invoice payload (1-128 bytes).\n *\n * Will not be displayed to the user and can be used\n * for internal processes\n */\n payload: Uint8Array\n\n /**\n * Payments provider token, obtained from\n * [@BotFather](//t.me/botfather)\n */\n token: string\n\n /**\n * Data about the invoice as a plain JS object, which\n * will be shared with the payment provider. A detailed\n * description of required fields should be provided by\n * the payment provider.\n */\n providerData: unknown\n\n /**\n * Start parameter for the bot\n */\n startParam: string\n\n /**\n * Product photo. Can be a photo of the goods or a marketing image for a service.\n *\n * Can be a URL, or a TL object with input web document\n */\n photo?: string | tl.TypeInputWebDocument\n\n /**\n * Extended media (i.e. media that will be available once the invoice is paid)\n */\n extendedMedia?: InputMediaLike\n}\n\n/**\n * A simple poll to be sent\n *\n * > **Note**: when using user account,\n * > the poll can't be sent to PMs, only to channels/groups,\n * > otherwise there will be `MEDIA_INVALID` error.\n */\nexport interface InputMediaPoll extends CaptionMixin {\n type: 'poll'\n\n /**\n * Question of the poll (1-255 chars for users, 1-300 chars for bots)\n */\n question: string\n\n /**\n * Answers of the poll.\n *\n * You can either provide a string, or a\n * TL object representing an answer.\n * Strings will be transformed to TL\n * objects, with a single=byte incrementing\n * `option` value.\n */\n answers: (string | tl.TypePollAnswer)[]\n\n /**\n * Whether this is poll is closed\n * (i.e. nobody can vote anymore)\n */\n closed?: boolean\n\n /**\n * Whether this is a public poll\n * (i.e. users who have voted are visible to everyone)\n */\n public?: boolean\n\n /**\n * Whether users can select multiple answers\n * as an answer\n */\n multiple?: boolean\n\n /**\n * Amount of time in seconds the poll will be active after creation (5-600).\n *\n * Can't be used together with `closeDate`.\n */\n closePeriod?: number\n\n /**\n * Point in time when the poll will be automatically closed.\n *\n * Must be at least 5 and no more than 600 seconds in the future,\n * can't be used together with `closePeriod`.\n *\n * When `number` is used, UNIX time in ms is expected\n */\n closeDate?: number | Date\n}\n\n/**\n * A quiz to be sent.\n *\n * Quiz is an extended version of a poll, but quizzes have\n * correct answers, and votes can't be retracted from them\n */\nexport interface InputMediaQuiz extends Omit<InputMediaPoll, 'type'> {\n type: 'quiz'\n\n /**\n * Correct answer ID(s) or index(es).\n *\n * > **Note**: even though quizzes can actually\n * > only have exactly one correct answer,\n * > the API itself has the possibility to pass\n * > multiple or zero correct answers,\n * > but that would result in `QUIZ_CORRECT_ANSWERS_TOO_MUCH`\n * > and `QUIZ_CORRECT_ANSWERS_EMPTY` errors respectively.\n * >\n * > But since the API has that option, we also provide it,\n * > maybe to future-proof this :shrug:\n */\n correct: MaybeArray<number | Uint8Array>\n\n /**\n * Explanation of the quiz solution\n */\n solution?: InputText\n}\n\n/**\n * A story to be sent\n */\nexport interface InputMediaStory extends CaptionMixin {\n type: 'story'\n\n /**\n * Owner of the story\n */\n peer: InputPeerLike\n\n /**\n * ID of the story\n */\n id: number\n}\n\n/** A webpage to be sent */\nexport interface InputMediaWebpage extends CaptionMixin {\n type: 'webpage'\n\n /**\n * Whether the link must be present in the message\n * for the preview to appear\n */\n required?: boolean\n\n /**\n * By default, size of the media in the preview\n * is determined based on content type.\n *\n * You can override this behaviour by passing the wanted size here\n */\n size?: 'large' | 'small'\n\n /** Webpage URL */\n url: string\n}\n\n/**\n * Input media that can be sent somewhere.\n *\n * Note that meta-fields (like `duration`) are only\n * applicable if `file` is {@link UploadFileLike},\n * otherwise they are ignored.\n *\n * @link InputMedia\n */\nexport type InputMediaLike =\n | InputMediaAudio\n | InputMediaVoice\n | InputMediaDocument\n | InputMediaPhoto\n | InputMediaVideo\n | InputMediaAuto\n | InputMediaSticker\n | InputMediaVenue\n | InputMediaGeo\n | InputMediaGeoLive\n | InputMediaDice\n | InputMediaContact\n | InputMediaGame\n | InputMediaInvoice\n | InputMediaPoll\n | InputMediaQuiz\n | InputMediaStory\n | InputMediaWebpage\n | tl.TypeInputMedia\n\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace InputMedia {\n /** Omit `type` and `file` from the given type */\n export type OmitTypeAndFile<T extends InputMediaLike, K extends keyof T = never> = Omit<T, 'type' | 'file' | K>\n\n /**\n * Create an animation to be sent\n *\n * @param file Animation\n * @param params Additional parameters\n */\n export function animation(file: InputFileLike, params: OmitTypeAndFile<InputMediaVideo> = {}): InputMediaVideo {\n const ret = params as tl.Mutable<InputMediaVideo>\n ret.type = 'video'\n ret.file = file\n ret.isAnimated = true\n\n return ret\n }\n\n /**\n * Create an audio to be sent\n *\n * @param file Audio file\n * @param params Additional parameters\n */\n export function audio(file: InputFileLike, params: OmitTypeAndFile<InputMediaAudio> = {}): InputMediaAudio {\n const ret = params as tl.Mutable<InputMediaAudio>\n ret.type = 'audio'\n ret.file = file\n\n return ret\n }\n\n /**\n * Create an document to be sent\n *\n * @param file Document\n * @param params Additional parameters\n */\n export function document(\n file: InputFileLike,\n params: OmitTypeAndFile<InputMediaDocument> = {},\n ): InputMediaDocument {\n const ret = params as tl.Mutable<InputMediaDocument>\n ret.type = 'document'\n ret.file = file\n\n return ret\n }\n\n /**\n * Create an photo to be sent\n *\n * @param file Photo\n * @param params Additional parameters\n */\n export function photo(file: InputFileLike, params: OmitTypeAndFile<InputMediaPhoto> = {}): InputMediaPhoto {\n const ret = params as tl.Mutable<InputMediaPhoto>\n ret.type = 'photo'\n ret.file = file\n\n return ret\n }\n\n /**\n * Create an video to be sent\n *\n * @param file Video\n * @param params Additional parameters\n */\n export function video(file: InputFileLike, params: OmitTypeAndFile<InputMediaVideo> = {}): InputMediaVideo {\n const ret = params as tl.Mutable<InputMediaVideo>\n ret.type = 'video'\n ret.file = file\n\n return ret\n }\n\n /**\n * Create a voice note to be sent\n *\n * @param file Voice note\n * @param params Additional parameters\n */\n export function voice(file: InputFileLike, params: OmitTypeAndFile<InputMediaVoice> = {}): InputMediaVoice {\n const ret = params as tl.Mutable<InputMediaVoice>\n ret.type = 'voice'\n ret.file = file\n\n return ret\n }\n\n /**\n * Create a sticker to be sent\n *\n * @param file Sticker\n * @param params Additional parameters\n */\n export function sticker(file: InputFileLike, params: OmitTypeAndFile<InputMediaSticker> = {}): InputMediaSticker {\n const ret = params as tl.Mutable<InputMediaSticker>\n ret.type = 'sticker'\n ret.file = file\n\n return ret\n }\n\n /**\n * Create a venue to be sent\n *\n * @param params Venue parameters\n */\n export function venue(params: OmitTypeAndFile<InputMediaVenue>): InputMediaVenue {\n const ret = params as tl.Mutable<InputMediaVenue>\n ret.type = 'venue'\n\n return ret\n }\n\n /**\n * Create a geolocation to be sent\n *\n * @param latitude Latitude of the location\n * @param longitude Longitude of the location\n * @param params Additional parameters\n */\n export function geo(\n latitude: number,\n longitude: number,\n params: OmitTypeAndFile<InputMediaGeo, 'latitude' | 'longitude'> = {},\n ): InputMediaGeo {\n const ret = params as tl.Mutable<InputMediaGeo>\n ret.type = 'geo'\n ret.latitude = latitude\n ret.longitude = longitude\n\n return ret\n }\n\n /**\n * Create a live geolocation to be sent\n *\n * @param latitude Latitude of the current location\n * @param longitude Longitude of the current location\n * @param params Additional parameters\n */\n export function geoLive(\n latitude: number,\n longitude: number,\n params: OmitTypeAndFile<InputMediaGeoLive, 'latitude' | 'longitude'> = {},\n ): InputMediaGeoLive {\n const ret = params as tl.Mutable<InputMediaGeoLive>\n ret.type = 'geo_live'\n ret.latitude = latitude\n ret.longitude = longitude\n\n return ret\n }\n\n /**\n * Create a dice to be sent\n *\n * For convenience, known dice emojis are available\n * as static members of {@link Dice}.\n *\n * @param emoji Emoji representing the dice\n * @param params Additional parameters\n */\n export function dice(emoji: string, params: CaptionMixin): InputMediaDice {\n const ret = params as tl.Mutable<InputMediaDice>\n ret.type = 'dice'\n\n return ret\n }\n\n /**\n * Create a contact to be sent\n *\n * @param params Contact parameters\n */\n export function contact(params: OmitTypeAndFile<InputMediaContact>): InputMediaContact {\n const ret = params as tl.Mutable<InputMediaContact>\n ret.type = 'contact'\n\n return ret\n }\n\n /**\n * Create a game to be sent\n *\n * @param game Game short name or TL object representing one\n */\n export function game(game: string | tl.TypeInputGame): InputMediaGame {\n return {\n type: 'game',\n game,\n }\n }\n\n /**\n * Create an invoice to be sent\n *\n * @param params Invoice parameters\n */\n export function invoice(params: OmitTypeAndFile<InputMediaInvoice>): InputMediaInvoice {\n const ret = params as tl.Mutable<InputMediaInvoice>\n ret.type = 'invoice'\n\n return ret\n }\n\n /**\n * Create a poll to be sent\n *\n * @param params Poll parameters\n */\n export function poll(params: OmitTypeAndFile<InputMediaPoll>): InputMediaPoll {\n const ret = params as tl.Mutable<InputMediaPoll>\n ret.type = 'poll'\n\n return ret\n }\n\n /**\n * Create a quiz to be sent\n *\n * @param params Quiz parameters\n */\n export function quiz(params: OmitTypeAndFile<InputMediaQuiz>): InputMediaQuiz {\n const ret = params as tl.Mutable<InputMediaQuiz>\n ret.type = 'quiz'\n\n return ret\n }\n\n /**\n * Create a story to be sent\n *\n * @param params Story parameters\n */\n export function story(params: OmitTypeAndFile<InputMediaStory>): InputMediaStory {\n const ret = params as tl.Mutable<InputMediaStory>\n ret.type = 'story'\n\n return ret\n }\n\n /**\n * Create a webpage to be sent\n *\n * @param url Webpage URL\n * @param params Additional parameters\n */\n export function webpage(url: string, params: OmitTypeAndFile<InputMediaWebpage, 'url'> = {}): InputMediaWebpage {\n const ret = params as tl.Mutable<InputMediaWebpage>\n ret.type = 'webpage'\n ret.url = url\n\n return ret\n }\n\n /**\n * Create a document to be sent, which subtype\n * is inferred automatically by file contents.\n *\n * Photo type is only inferred for reused files,\n * newly uploaded photos with `auto` will be\n * uploaded as a document\n *\n * @param file The media file\n * @param params Additional parameters\n */\n export function auto(file: InputFileLike, params: OmitTypeAndFile<InputMediaAuto> = {}): InputMediaAuto {\n const ret = params as tl.Mutable<InputMediaAuto>\n ret.type = 'auto'\n ret.file = file\n\n return ret\n }\n}\n"]}
@@ -1,63 +0,0 @@
1
- import { tl } from '@mtcute/tl';
2
- import { MaybeArray } from '../../../types/utils.js';
3
- import { InputPeerLike } from '../peers/index.js';
4
- export interface InputPrivacyRuleUsers {
5
- allow: boolean;
6
- users: InputPeerLike[];
7
- }
8
- export interface InputPrivacyRuleChatParticipants {
9
- allow: boolean;
10
- chats: InputPeerLike[];
11
- }
12
- export type InputPrivacyRule = InputPrivacyRuleChatParticipants | InputPrivacyRuleUsers | tl.TypeInputPrivacyRule;
13
- /**
14
- * Helpers for creating {@link InputPrivacyRule}s
15
- *
16
- * @example
17
- * ```typescript
18
- * const rules = [
19
- * PrivacyRule.allow.all,
20
- * PrivacyRule.disallow.users([123456789, 'username']),
21
- * ]
22
- * ```
23
- */
24
- export declare namespace PrivacyRule {
25
- namespace allow {
26
- /** Allow all users */
27
- const all: tl.RawInputPrivacyValueAllowAll;
28
- /** Allow only contacts */
29
- const contacts: tl.RawInputPrivacyValueAllowContacts;
30
- /** Allow only "close friends" list */
31
- const closeFriends: tl.RawInputPrivacyValueAllowCloseFriends;
32
- /**
33
- * Allow only users specified in `users`
34
- *
35
- * @param users Users to allow
36
- */
37
- function users(users: MaybeArray<InputPeerLike>): InputPrivacyRuleUsers;
38
- /**
39
- * Allow only participants of chats specified in `chats`
40
- *
41
- * @param chats Chats to allow
42
- */
43
- function chatParticipants(chats: MaybeArray<InputPeerLike>): InputPrivacyRuleChatParticipants;
44
- }
45
- namespace disallow {
46
- /** Disallow all users */
47
- const all: tl.RawInputPrivacyValueDisallowAll;
48
- /** Disallow contacts */
49
- const contacts: tl.RawInputPrivacyValueDisallowContacts;
50
- /**
51
- * Disallow users specified in `users`
52
- *
53
- * @param users Users to disallow
54
- */
55
- function users(users: MaybeArray<InputPeerLike>): InputPrivacyRuleUsers;
56
- /**
57
- * Disallow participants of chats specified in `chats`
58
- *
59
- * @param chats Chats to disallow
60
- */
61
- function chatParticipants(chats: MaybeArray<InputPeerLike>): InputPrivacyRuleChatParticipants;
62
- }
63
- }
@@ -1,85 +0,0 @@
1
- "use strict";
2
- /* eslint-disable @typescript-eslint/no-namespace */
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.PrivacyRule = void 0;
5
- /**
6
- * Helpers for creating {@link InputPrivacyRule}s
7
- *
8
- * @example
9
- * ```typescript
10
- * const rules = [
11
- * PrivacyRule.allow.all,
12
- * PrivacyRule.disallow.users([123456789, 'username']),
13
- * ]
14
- * ```
15
- */
16
- var PrivacyRule;
17
- (function (PrivacyRule) {
18
- let allow;
19
- (function (allow) {
20
- /** Allow all users */
21
- allow.all = { _: 'inputPrivacyValueAllowAll' };
22
- /** Allow only contacts */
23
- allow.contacts = { _: 'inputPrivacyValueAllowContacts' };
24
- /** Allow only "close friends" list */
25
- allow.closeFriends = {
26
- _: 'inputPrivacyValueAllowCloseFriends',
27
- };
28
- /**
29
- * Allow only users specified in `users`
30
- *
31
- * @param users Users to allow
32
- */
33
- function users(users) {
34
- return {
35
- allow: true,
36
- users: Array.isArray(users) ? users : [users],
37
- };
38
- }
39
- allow.users = users;
40
- /**
41
- * Allow only participants of chats specified in `chats`
42
- *
43
- * @param chats Chats to allow
44
- */
45
- function chatParticipants(chats) {
46
- return {
47
- allow: true,
48
- chats: Array.isArray(chats) ? chats : [chats],
49
- };
50
- }
51
- allow.chatParticipants = chatParticipants;
52
- })(allow = PrivacyRule.allow || (PrivacyRule.allow = {}));
53
- let disallow;
54
- (function (disallow) {
55
- /** Disallow all users */
56
- disallow.all = { _: 'inputPrivacyValueDisallowAll' };
57
- /** Disallow contacts */
58
- disallow.contacts = { _: 'inputPrivacyValueDisallowContacts' };
59
- /**
60
- * Disallow users specified in `users`
61
- *
62
- * @param users Users to disallow
63
- */
64
- function users(users) {
65
- return {
66
- allow: false,
67
- users: Array.isArray(users) ? users : [users],
68
- };
69
- }
70
- disallow.users = users;
71
- /**
72
- * Disallow participants of chats specified in `chats`
73
- *
74
- * @param chats Chats to disallow
75
- */
76
- function chatParticipants(chats) {
77
- return {
78
- allow: false,
79
- chats: Array.isArray(chats) ? chats : [chats],
80
- };
81
- }
82
- disallow.chatParticipants = chatParticipants;
83
- })(disallow = PrivacyRule.disallow || (PrivacyRule.disallow = {}));
84
- })(PrivacyRule || (exports.PrivacyRule = PrivacyRule = {}));
85
- //# sourceMappingURL=input-privacy-rule.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"input-privacy-rule.js","sourceRoot":"","sources":["../../../../../src/highlevel/types/misc/input-privacy-rule.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;AAmBpD;;;;;;;;;;GAUG;AACH,IAA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C,CAAC,KAAK,CAAC;aAChD,CAAA;QACL,CAAC;QALe,cAAK,QAKpB,CAAA;QAED;;;;WAIG;QACH,SAAgB,gBAAgB,CAAC,KAAgC;YAC7D,OAAO;gBACH,KAAK,EAAE,KAAK;gBACZ,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;aAChD,CAAA;QACL,CAAC;QALe,yBAAgB,mBAK/B,CAAA;IACL,CAAC,EA7BgB,QAAQ,GAAR,oBAAQ,KAAR,oBAAQ,QA6BxB;AACL,CAAC,EAlEgB,WAAW,2BAAX,WAAW,QAkE3B","sourcesContent":["/* eslint-disable @typescript-eslint/no-namespace */\n\nimport { tl } from '@mtcute/tl'\n\nimport { MaybeArray } from '../../../types/utils.js'\nimport { InputPeerLike } from '../peers/index.js'\n\nexport interface InputPrivacyRuleUsers {\n allow: boolean\n users: InputPeerLike[]\n}\n\nexport interface InputPrivacyRuleChatParticipants {\n allow: boolean\n chats: InputPeerLike[]\n}\n\nexport type InputPrivacyRule = InputPrivacyRuleChatParticipants | InputPrivacyRuleUsers | tl.TypeInputPrivacyRule\n\n/**\n * Helpers for creating {@link InputPrivacyRule}s\n *\n * @example\n * ```typescript\n * const rules = [\n * PrivacyRule.allow.all,\n * PrivacyRule.disallow.users([123456789, 'username']),\n * ]\n * ```\n */\nexport namespace PrivacyRule {\n export namespace allow {\n /** Allow all users */\n export const all: tl.RawInputPrivacyValueAllowAll = { _: 'inputPrivacyValueAllowAll' }\n /** Allow only contacts */\n export const contacts: tl.RawInputPrivacyValueAllowContacts = { _: 'inputPrivacyValueAllowContacts' }\n /** Allow only \"close friends\" list */\n export const closeFriends: tl.RawInputPrivacyValueAllowCloseFriends = {\n _: 'inputPrivacyValueAllowCloseFriends',\n }\n\n /**\n * Allow only users specified in `users`\n *\n * @param users Users to allow\n */\n export function users(users: MaybeArray<InputPeerLike>): InputPrivacyRuleUsers {\n return {\n allow: true,\n users: Array.isArray(users) ? users : [users],\n }\n }\n\n /**\n * Allow only participants of chats specified in `chats`\n *\n * @param chats Chats to allow\n */\n export function chatParticipants(chats: MaybeArray<InputPeerLike>): InputPrivacyRuleChatParticipants {\n return {\n allow: true,\n chats: Array.isArray(chats) ? chats : [chats],\n }\n }\n }\n\n export namespace disallow {\n /** Disallow all users */\n export const all: tl.RawInputPrivacyValueDisallowAll = { _: 'inputPrivacyValueDisallowAll' }\n /** Disallow contacts */\n export const contacts: tl.RawInputPrivacyValueDisallowContacts = { _: 'inputPrivacyValueDisallowContacts' }\n\n /**\n * Disallow users specified in `users`\n *\n * @param users Users to disallow\n */\n export function users(users: MaybeArray<InputPeerLike>): InputPrivacyRuleUsers {\n return {\n allow: false,\n users: Array.isArray(users) ? users : [users],\n }\n }\n\n /**\n * Disallow participants of chats specified in `chats`\n *\n * @param chats Chats to disallow\n */\n export function chatParticipants(chats: MaybeArray<InputPeerLike>): InputPrivacyRuleChatParticipants {\n return {\n allow: false,\n chats: Array.isArray(chats) ? chats : [chats],\n }\n }\n }\n}\n"]}
@@ -1 +0,0 @@
1
- export {};
@@ -1,71 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const vitest_1 = require("vitest");
4
- const test_1 = require("@mtcute/test");
5
- const errors_js_1 = require("../../../types/errors.js");
6
- const peers_index_js_1 = require("./peers-index.js");
7
- (0, vitest_1.describe)('PeersIndex', () => {
8
- (0, vitest_1.it)('should build the index from an object with users/chats fields', () => {
9
- const obj = {
10
- users: [(0, test_1.createStub)('user', { id: 1 }), (0, test_1.createStub)('user', { id: 2 })],
11
- chats: [(0, test_1.createStub)('chat', { id: 1 }), (0, test_1.createStub)('channel', { id: 2 })],
12
- };
13
- const peers = peers_index_js_1.PeersIndex.from(obj);
14
- (0, vitest_1.expect)(peers.users.size).toBe(2);
15
- (0, vitest_1.expect)(peers.chats.size).toBe(2);
16
- (0, vitest_1.expect)(peers.users.get(1)).toBe(obj.users[0]);
17
- (0, vitest_1.expect)(peers.users.get(2)).toBe(obj.users[1]);
18
- (0, vitest_1.expect)(peers.chats.get(1)).toBe(obj.chats[0]);
19
- (0, vitest_1.expect)(peers.chats.get(2)).toBe(obj.chats[1]);
20
- });
21
- (0, vitest_1.it)('should detect min peers and set hasMin', () => {
22
- const obj = {
23
- users: [(0, test_1.createStub)('user', { id: 1 }), (0, test_1.createStub)('user', { id: 2, min: true })],
24
- chats: [(0, test_1.createStub)('chat', { id: 1 }), (0, test_1.createStub)('channel', { id: 2, min: true })],
25
- };
26
- const peers = peers_index_js_1.PeersIndex.from(obj);
27
- (0, vitest_1.expect)(peers.hasMin).toBe(true);
28
- });
29
- (0, vitest_1.describe)('#user', () => {
30
- (0, vitest_1.it)('should find user info by its id', () => {
31
- const peers = peers_index_js_1.PeersIndex.from({
32
- users: [(0, test_1.createStub)('user', { id: 1 }), (0, test_1.createStub)('user', { id: 2 })],
33
- });
34
- (0, vitest_1.expect)(peers.user(1)).toBe(peers.users.get(1));
35
- (0, vitest_1.expect)(peers.user(2)).toBe(peers.users.get(2));
36
- });
37
- (0, vitest_1.it)('should throw if user is not found', () => {
38
- const peers = peers_index_js_1.PeersIndex.from({
39
- users: [(0, test_1.createStub)('user', { id: 1 }), (0, test_1.createStub)('user', { id: 2 })],
40
- });
41
- (0, vitest_1.expect)(() => peers.user(3)).toThrow(errors_js_1.MtArgumentError);
42
- });
43
- });
44
- (0, vitest_1.describe)('#chat', () => {
45
- (0, vitest_1.it)('should find chat info by its id', () => {
46
- const peers = peers_index_js_1.PeersIndex.from({
47
- chats: [(0, test_1.createStub)('chat', { id: 1 }), (0, test_1.createStub)('channel', { id: 2 })],
48
- });
49
- (0, vitest_1.expect)(peers.chat(1)).toBe(peers.chats.get(1));
50
- (0, vitest_1.expect)(peers.chat(2)).toBe(peers.chats.get(2));
51
- });
52
- (0, vitest_1.it)('should throw if chat is not found', () => {
53
- const peers = peers_index_js_1.PeersIndex.from({
54
- chats: [(0, test_1.createStub)('chat', { id: 1 }), (0, test_1.createStub)('channel', { id: 2 })],
55
- });
56
- (0, vitest_1.expect)(() => peers.chat(3)).toThrow(errors_js_1.MtArgumentError);
57
- });
58
- });
59
- (0, vitest_1.describe)('#get', () => {
60
- (0, vitest_1.it)('should find peer info by Peer', () => {
61
- const peers = peers_index_js_1.PeersIndex.from({
62
- users: [(0, test_1.createStub)('user', { id: 1 }), (0, test_1.createStub)('user', { id: 2 })],
63
- chats: [(0, test_1.createStub)('chat', { id: 1 }), (0, test_1.createStub)('channel', { id: 2 })],
64
- });
65
- (0, vitest_1.expect)(peers.get({ _: 'peerUser', userId: 1 })).toBe(peers.users.get(1));
66
- (0, vitest_1.expect)(peers.get({ _: 'peerChat', chatId: 1 })).toBe(peers.chats.get(1));
67
- (0, vitest_1.expect)(peers.get({ _: 'peerChannel', channelId: 2 })).toBe(peers.chats.get(2));
68
- });
69
- });
70
- });
71
- //# sourceMappingURL=peers-index.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"peers-index.test.js","sourceRoot":"","sources":["../../../../../src/highlevel/types/peers/peers-index.test.ts"],"names":[],"mappings":";;AAAA,mCAA6C;AAE7C,uCAAyC;AAEzC,wDAA0D;AAC1D,qDAA6C;AAE7C,IAAA,iBAAQ,EAAC,YAAY,EAAE,GAAG,EAAE;IACxB,IAAA,WAAE,EAAC,+DAA+D,EAAE,GAAG,EAAE;QACrE,MAAM,GAAG,GAAG;YACR,KAAK,EAAE,CAAC,IAAA,iBAAU,EAAC,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,IAAA,iBAAU,EAAC,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;YACrE,KAAK,EAAE,CAAC,IAAA,iBAAU,EAAC,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,IAAA,iBAAU,EAAC,SAAS,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CA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AAA","sourcesContent":["import { describe, expect, it } from 'vitest'\n\nimport { createStub } from '@mtcute/test'\n\nimport { MtArgumentError } from '../../../types/errors.js'\nimport { PeersIndex } from './peers-index.js'\n\ndescribe('PeersIndex', () => {\n it('should build the index from an object with users/chats fields', () => {\n const obj = {\n users: [createStub('user', { id: 1 }), createStub('user', { id: 2 })],\n chats: [createStub('chat', { id: 1 }), createStub('channel', { id: 2 })],\n }\n\n const peers = PeersIndex.from(obj)\n\n expect(peers.users.size).toBe(2)\n expect(peers.chats.size).toBe(2)\n expect(peers.users.get(1)).toBe(obj.users[0])\n expect(peers.users.get(2)).toBe(obj.users[1])\n expect(peers.chats.get(1)).toBe(obj.chats[0])\n expect(peers.chats.get(2)).toBe(obj.chats[1])\n })\n\n it('should detect min peers and set hasMin', () => {\n const obj = {\n users: [createStub('user', { id: 1 }), createStub('user', { id: 2, min: true })],\n chats: [createStub('chat', { id: 1 }), createStub('channel', { id: 2, min: true })],\n }\n\n const peers = PeersIndex.from(obj)\n\n expect(peers.hasMin).toBe(true)\n })\n\n describe('#user', () => {\n it('should find user info by its id', () => {\n const peers = PeersIndex.from({\n users: [createStub('user', { id: 1 }), createStub('user', { id: 2 })],\n })\n\n expect(peers.user(1)).toBe(peers.users.get(1))\n expect(peers.user(2)).toBe(peers.users.get(2))\n })\n\n it('should throw if user is not found', () => {\n const peers = PeersIndex.from({\n users: [createStub('user', { id: 1 }), createStub('user', { id: 2 })],\n })\n\n expect(() => peers.user(3)).toThrow(MtArgumentError)\n })\n })\n\n describe('#chat', () => {\n it('should find chat info by its id', () => {\n const peers = PeersIndex.from({\n chats: [createStub('chat', { id: 1 }), createStub('channel', { id: 2 })],\n })\n\n expect(peers.chat(1)).toBe(peers.chats.get(1))\n expect(peers.chat(2)).toBe(peers.chats.get(2))\n })\n\n it('should throw if chat is not found', () => {\n const peers = PeersIndex.from({\n chats: [createStub('chat', { id: 1 }), createStub('channel', { id: 2 })],\n })\n\n expect(() => peers.chat(3)).toThrow(MtArgumentError)\n })\n })\n\n describe('#get', () => {\n it('should find peer info by Peer', () => {\n const peers = PeersIndex.from({\n users: [createStub('user', { id: 1 }), createStub('user', { id: 2 })],\n chats: [createStub('chat', { id: 1 }), createStub('channel', { id: 2 })],\n })\n\n expect(peers.get({ _: 'peerUser', userId: 1 })).toBe(peers.users.get(1))\n expect(peers.get({ _: 'peerChat', chatId: 1 })).toBe(peers.chats.get(1))\n expect(peers.get({ _: 'peerChannel', channelId: 2 })).toBe(peers.chats.get(2))\n })\n })\n})\n"]}
@@ -1 +0,0 @@
1
- export {};