@mtkruto/node 0.1.129 → 0.1.130

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 (39) hide show
  1. package/esm/0_deps.d.ts +1 -0
  2. package/esm/0_deps.js +9 -0
  3. package/esm/4_constants.d.ts +1 -1
  4. package/esm/4_constants.js +1 -1
  5. package/esm/client/5_client.d.ts +17 -3
  6. package/esm/client/5_client.js +229 -73
  7. package/esm/deps/deno.land/std@0.209.0/media_types/extension.d.ts +17 -0
  8. package/esm/deps/deno.land/std@0.209.0/media_types/extension.js +26 -0
  9. package/esm/deps/deno.land/std@0.209.0/media_types/extensions_by_type.d.ts +20 -0
  10. package/esm/deps/deno.land/std@0.209.0/media_types/extensions_by_type.js +31 -0
  11. package/esm/storage/0_storage.d.ts +3 -1
  12. package/esm/storage/0_storage.js +18 -5
  13. package/esm/tl/0_tl_raw_reader.js +1 -1
  14. package/esm/tl/3_utilities.d.ts +1 -0
  15. package/esm/tl/3_utilities.js +11 -0
  16. package/esm/types/1__getters.d.ts +1 -0
  17. package/esm/types/1_sticker.js +5 -4
  18. package/esm/types/4_chat.d.ts +3 -2
  19. package/esm/types/4_chat.js +16 -27
  20. package/package.json +1 -1
  21. package/script/0_deps.d.ts +1 -0
  22. package/script/0_deps.js +11 -1
  23. package/script/4_constants.d.ts +1 -1
  24. package/script/4_constants.js +1 -1
  25. package/script/client/5_client.d.ts +17 -3
  26. package/script/client/5_client.js +226 -70
  27. package/script/deps/deno.land/std@0.209.0/media_types/extension.d.ts +17 -0
  28. package/script/deps/deno.land/std@0.209.0/media_types/extension.js +30 -0
  29. package/script/deps/deno.land/std@0.209.0/media_types/extensions_by_type.d.ts +20 -0
  30. package/script/deps/deno.land/std@0.209.0/media_types/extensions_by_type.js +35 -0
  31. package/script/storage/0_storage.d.ts +3 -1
  32. package/script/storage/0_storage.js +18 -5
  33. package/script/tl/0_tl_raw_reader.js +1 -1
  34. package/script/tl/3_utilities.d.ts +1 -0
  35. package/script/tl/3_utilities.js +13 -1
  36. package/script/types/1__getters.d.ts +1 -0
  37. package/script/types/1_sticker.js +4 -3
  38. package/script/types/4_chat.d.ts +3 -2
  39. package/script/types/4_chat.js +17 -27
package/esm/0_deps.d.ts CHANGED
@@ -2,6 +2,7 @@ export * from "./deps/deno.land/std@0.209.0/assert/mod.js";
2
2
  export * as path from "./deps/deno.land/std@0.209.0/path/mod.js";
3
3
  export { decodeBase64, encodeBase64 } from "./deps/deno.land/std@0.209.0/encoding/base64.js";
4
4
  export { contentType } from "./deps/deno.land/std@0.209.0/media_types/content_type.js";
5
+ export declare function extension(mimeType: string): string;
5
6
  export { ctr256, factorize, ige256Decrypt, ige256Encrypt, init as initTgCrypto } from "./deps/deno.land/x/tgcrypto@0.3.3/mod.js";
6
7
  export { gunzip, gzip } from "./deps/raw.githubusercontent.com/MTKruto/compress/main/gzip/gzip.js";
7
8
  export { Mutex, type MutexInterface } from "async-mutex";
package/esm/0_deps.js CHANGED
@@ -2,6 +2,15 @@ export * from "./deps/deno.land/std@0.209.0/assert/mod.js";
2
2
  export * as path from "./deps/deno.land/std@0.209.0/path/mod.js";
3
3
  export { decodeBase64, encodeBase64 } from "./deps/deno.land/std@0.209.0/encoding/base64.js";
4
4
  export { contentType } from "./deps/deno.land/std@0.209.0/media_types/content_type.js";
5
+ import { extension as extension_ } from "./deps/deno.land/std@0.209.0/media_types/extension.js";
6
+ export function extension(mimeType) {
7
+ if (mimeType == "application/x-tgsticker") {
8
+ return "tgs";
9
+ }
10
+ else {
11
+ return extension_(mimeType) || "unknown";
12
+ }
13
+ }
5
14
  export { ctr256, factorize, ige256Decrypt, ige256Encrypt, init as initTgCrypto } from "./deps/deno.land/x/tgcrypto@0.3.3/mod.js";
6
15
  export { gunzip, gzip } from "./deps/raw.githubusercontent.com/MTKruto/compress/main/gzip/gzip.js";
7
16
  export { Mutex } from "async-mutex";
@@ -4,7 +4,7 @@ export type PublicKeys = readonly [bigint, [bigint, bigint]][];
4
4
  export declare const PUBLIC_KEYS: PublicKeys;
5
5
  export declare const INITIAL_DC: DC;
6
6
  export declare const LAYER = 167;
7
- export declare const APP_VERSION = "MTKruto 0.1.129";
7
+ export declare const APP_VERSION = "MTKruto 0.1.130";
8
8
  export declare const DEVICE_MODEL: string;
9
9
  export declare const LANG_CODE: string;
10
10
  export declare const LANG_PACK = "";
@@ -53,7 +53,7 @@ export const PUBLIC_KEYS = Object.freeze([
53
53
  ]);
54
54
  export const INITIAL_DC = "2";
55
55
  export const LAYER = 167;
56
- export const APP_VERSION = "MTKruto 0.1.129";
56
+ export const APP_VERSION = "MTKruto 0.1.130";
57
57
  // @ts-ignore: lib
58
58
  export const DEVICE_MODEL = typeof dntShim.Deno === "undefined" ? typeof navigator === "undefined" ? typeof process === "undefined" ? "Unknown" : process.platform + "-" + process.arch : navigator.userAgent.split(" ")[0] : dntShim.Deno.build.os + "-" + dntShim.Deno.build.arch;
59
59
  export const LANG_CODE = typeof navigator === "undefined" ? "en" : navigator.language.split("-")[0];
@@ -2,7 +2,7 @@ import { MaybePromise } from "../1_utilities.js";
2
2
  import { functions, ReadObject, types } from "../2_tl.js";
3
3
  import { Storage } from "../3_storage.js";
4
4
  import { DC } from "../3_transport.js";
5
- import { BotCommand, CallbackQuery, Chat, ChatAction, ChatID, InlineQuery, InlineQueryResult, Message, ParseMode, User } from "../3_types.js";
5
+ import { BotCommand, CallbackQuery, Chat, ChatAction, ChatID, Document, InlineQuery, InlineQueryResult, Message, ParseMode, User } from "../3_types.js";
6
6
  import { Migrate } from "../4_errors.js";
7
7
  import { FileSource, With } from "./0_utilities.js";
8
8
  import { ClientAbstract } from "./1_client_abstract.js";
@@ -157,6 +157,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
157
157
  private [getEntity];
158
158
  private [getEntity];
159
159
  private [getEntity];
160
+ private [getEntity];
160
161
  processResult(result: ReadObject): Promise<void>;
161
162
  /**
162
163
  * Send a text message.
@@ -214,7 +215,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
214
215
  * ```
215
216
  * @returns A generator yielding the contents of the file.
216
217
  */
217
- download(fileId: string, params?: DownloadParams): Promise<AsyncGenerator<Uint8Array, void, unknown>>;
218
+ download(fileId: string, params?: DownloadParams): AsyncGenerator<Uint8Array, void, unknown>;
218
219
  private [getStickerSetName];
219
220
  /**
220
221
  * Forward multiple messages.
@@ -395,11 +396,17 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
395
396
  */
396
397
  getNetworkStatistics(): Promise<NetworkStatistics>;
397
398
  /**
398
- * Get chats.
399
+ * Get chats from a chat list.
399
400
  *
400
401
  * @method
401
402
  */
402
403
  getChats(params?: GetChatsParams): Promise<Chat[]>;
404
+ /**
405
+ * Get a chat.
406
+ *
407
+ * @method
408
+ */
409
+ getChat(chatId: ChatID): Promise<Chat>;
403
410
  /**
404
411
  * Get chat history.
405
412
  *
@@ -407,5 +414,12 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
407
414
  * @method
408
415
  */
409
416
  getHistory(chatId: ChatID, params?: GetHistoryParams): Promise<Message[]>;
417
+ /**
418
+ * Get custom emoji documents for download.
419
+ *
420
+ * @param id Identifier of one or more of custom emojis.
421
+ * @method
422
+ */
423
+ getCustomEmojiDocuments(id: string | string[]): Promise<Document[]>;
410
424
  }
411
425
  export {};