@mtkruto/node 0.1.600 → 0.1.701

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 (115) hide show
  1. package/esm/4_errors.js +2 -4
  2. package/esm/5_client.d.ts +1 -1
  3. package/esm/5_client.js +1 -1
  4. package/esm/client/0_params.d.ts +5 -1
  5. package/esm/client/0_storage_operations.d.ts +182 -0
  6. package/esm/client/0_storage_operations.js +611 -0
  7. package/esm/client/1_composer.d.ts +2 -0
  8. package/esm/client/1_composer.js +28 -0
  9. package/{script/client/0_types.d.ts → esm/client/1_types.d.ts} +3 -3
  10. package/{script/client/1_account_manager.d.ts → esm/client/2_account_manager.d.ts} +1 -1
  11. package/{script/client/1_bot_info_manager.d.ts → esm/client/2_bot_info_manager.d.ts} +1 -1
  12. package/esm/client/{1_business_connection_manager.d.ts → 2_business_connection_manager.d.ts} +1 -1
  13. package/{script/client/1_file_manager.d.ts → esm/client/2_file_manager.d.ts} +1 -1
  14. package/esm/client/{1_file_manager.js → 2_file_manager.js} +5 -3
  15. package/esm/client/{1_network_statistics_manager.d.ts → 2_network_statistics_manager.d.ts} +1 -1
  16. package/{script/client/1_reaction_manager.d.ts → esm/client/2_reaction_manager.d.ts} +1 -1
  17. package/{script/client/1_update_manager.d.ts → esm/client/2_update_manager.d.ts} +1 -1
  18. package/{script/client/2_message_manager.d.ts → esm/client/3_message_manager.d.ts} +2 -2
  19. package/esm/client/{2_video_chat_manager.d.ts → 3_video_chat_manager.d.ts} +2 -2
  20. package/{script/client/3_callback_query_manager.d.ts → esm/client/4_callback_query_manager.d.ts} +2 -2
  21. package/{script/client/3_chat_list_manager.d.ts → esm/client/4_chat_list_manager.d.ts} +3 -3
  22. package/{script/client/3_inline_query_manager.d.ts → esm/client/4_inline_query_manager.d.ts} +2 -2
  23. package/esm/client/{3_story_manager.d.ts → 4_story_manager.d.ts} +3 -3
  24. package/{script/client/4_client.d.ts → esm/client/5_client.d.ts} +39 -29
  25. package/esm/client/{4_client.js → 5_client.js} +83 -73
  26. package/esm/connection/0_connection.d.ts +6 -15
  27. package/esm/connection/0_connection.js +1 -38
  28. package/esm/connection/1_connection_web_socket.d.ts +3 -2
  29. package/esm/connection/1_connection_web_socket.js +7 -3
  30. package/esm/mod.d.ts +1 -1
  31. package/esm/mod.js +1 -1
  32. package/esm/storage/0_storage.d.ts +9 -159
  33. package/esm/storage/0_storage.js +1 -563
  34. package/esm/storage/2_storage_indexed_db.d.ts +3 -2
  35. package/esm/storage/2_storage_indexed_db.js +9 -8
  36. package/esm/storage/2_storage_local_storage.d.ts +3 -2
  37. package/esm/storage/2_storage_local_storage.js +5 -4
  38. package/esm/storage/2_storage_memory.d.ts +4 -4
  39. package/esm/storage/2_storage_memory.js +12 -19
  40. package/esm/storage/2_storage_session_storage.d.ts +2 -1
  41. package/esm/storage/2_storage_session_storage.js +5 -4
  42. package/esm/types/0_id.d.ts +1 -1
  43. package/package.json +1 -1
  44. package/script/4_errors.js +2 -4
  45. package/script/5_client.d.ts +1 -1
  46. package/script/5_client.js +1 -1
  47. package/script/client/0_params.d.ts +5 -1
  48. package/script/client/0_storage_operations.d.ts +182 -0
  49. package/script/client/0_storage_operations.js +615 -0
  50. package/script/client/1_composer.d.ts +2 -0
  51. package/script/client/1_composer.js +28 -0
  52. package/{esm/client/0_types.d.ts → script/client/1_types.d.ts} +3 -3
  53. package/{esm/client/1_account_manager.d.ts → script/client/2_account_manager.d.ts} +1 -1
  54. package/{esm/client/1_bot_info_manager.d.ts → script/client/2_bot_info_manager.d.ts} +1 -1
  55. package/script/client/{1_business_connection_manager.d.ts → 2_business_connection_manager.d.ts} +1 -1
  56. package/{esm/client/1_file_manager.d.ts → script/client/2_file_manager.d.ts} +1 -1
  57. package/script/client/{1_file_manager.js → 2_file_manager.js} +4 -2
  58. package/script/client/{1_network_statistics_manager.d.ts → 2_network_statistics_manager.d.ts} +1 -1
  59. package/{esm/client/1_reaction_manager.d.ts → script/client/2_reaction_manager.d.ts} +1 -1
  60. package/{esm/client/1_update_manager.d.ts → script/client/2_update_manager.d.ts} +1 -1
  61. package/{esm/client/2_message_manager.d.ts → script/client/3_message_manager.d.ts} +2 -2
  62. package/script/client/{2_video_chat_manager.d.ts → 3_video_chat_manager.d.ts} +2 -2
  63. package/{esm/client/3_callback_query_manager.d.ts → script/client/4_callback_query_manager.d.ts} +2 -2
  64. package/{esm/client/3_chat_list_manager.d.ts → script/client/4_chat_list_manager.d.ts} +3 -3
  65. package/{esm/client/3_inline_query_manager.d.ts → script/client/4_inline_query_manager.d.ts} +2 -2
  66. package/script/client/{3_story_manager.d.ts → 4_story_manager.d.ts} +3 -3
  67. package/{esm/client/4_client.d.ts → script/client/5_client.d.ts} +39 -29
  68. package/script/client/{4_client.js → 5_client.js} +105 -95
  69. package/script/connection/0_connection.d.ts +6 -15
  70. package/script/connection/0_connection.js +0 -41
  71. package/script/connection/1_connection_web_socket.d.ts +3 -2
  72. package/script/connection/1_connection_web_socket.js +7 -3
  73. package/script/mod.d.ts +1 -1
  74. package/script/mod.js +1 -1
  75. package/script/storage/0_storage.d.ts +9 -159
  76. package/script/storage/0_storage.js +0 -565
  77. package/script/storage/2_storage_indexed_db.d.ts +3 -2
  78. package/script/storage/2_storage_indexed_db.js +9 -8
  79. package/script/storage/2_storage_local_storage.d.ts +3 -2
  80. package/script/storage/2_storage_local_storage.js +5 -4
  81. package/script/storage/2_storage_memory.d.ts +4 -4
  82. package/script/storage/2_storage_memory.js +12 -19
  83. package/script/storage/2_storage_session_storage.d.ts +2 -1
  84. package/script/storage/2_storage_session_storage.js +5 -4
  85. package/script/types/0_id.d.ts +1 -1
  86. /package/esm/{3_storage.d.ts → 2_storage.d.ts} +0 -0
  87. /package/esm/{3_storage.js → 2_storage.js} +0 -0
  88. /package/esm/client/{0_types.js → 1_types.js} +0 -0
  89. /package/esm/client/{1_account_manager.js → 2_account_manager.js} +0 -0
  90. /package/esm/client/{1_bot_info_manager.js → 2_bot_info_manager.js} +0 -0
  91. /package/esm/client/{1_business_connection_manager.js → 2_business_connection_manager.js} +0 -0
  92. /package/esm/client/{1_network_statistics_manager.js → 2_network_statistics_manager.js} +0 -0
  93. /package/esm/client/{1_reaction_manager.js → 2_reaction_manager.js} +0 -0
  94. /package/esm/client/{1_update_manager.js → 2_update_manager.js} +0 -0
  95. /package/esm/client/{2_message_manager.js → 3_message_manager.js} +0 -0
  96. /package/esm/client/{2_video_chat_manager.js → 3_video_chat_manager.js} +0 -0
  97. /package/esm/client/{3_callback_query_manager.js → 4_callback_query_manager.js} +0 -0
  98. /package/esm/client/{3_chat_list_manager.js → 4_chat_list_manager.js} +0 -0
  99. /package/esm/client/{3_inline_query_manager.js → 4_inline_query_manager.js} +0 -0
  100. /package/esm/client/{3_story_manager.js → 4_story_manager.js} +0 -0
  101. /package/script/{3_storage.d.ts → 2_storage.d.ts} +0 -0
  102. /package/script/{3_storage.js → 2_storage.js} +0 -0
  103. /package/script/client/{0_types.js → 1_types.js} +0 -0
  104. /package/script/client/{1_account_manager.js → 2_account_manager.js} +0 -0
  105. /package/script/client/{1_bot_info_manager.js → 2_bot_info_manager.js} +0 -0
  106. /package/script/client/{1_business_connection_manager.js → 2_business_connection_manager.js} +0 -0
  107. /package/script/client/{1_network_statistics_manager.js → 2_network_statistics_manager.js} +0 -0
  108. /package/script/client/{1_reaction_manager.js → 2_reaction_manager.js} +0 -0
  109. /package/script/client/{1_update_manager.js → 2_update_manager.js} +0 -0
  110. /package/script/client/{2_message_manager.js → 3_message_manager.js} +0 -0
  111. /package/script/client/{2_video_chat_manager.js → 3_video_chat_manager.js} +0 -0
  112. /package/script/client/{3_callback_query_manager.js → 4_callback_query_manager.js} +0 -0
  113. /package/script/client/{3_chat_list_manager.js → 4_chat_list_manager.js} +0 -0
  114. /package/script/client/{3_inline_query_manager.js → 4_inline_query_manager.js} +0 -0
  115. /package/script/client/{3_story_manager.js → 4_story_manager.js} +0 -0
@@ -19,12 +19,12 @@
19
19
  */
20
20
  import { MaybePromise } from "../1_utilities.js";
21
21
  import { GetManyFilter, Storage, StorageKeyPart } from "./0_storage.js";
22
- export declare class StorageMemory extends Storage implements Storage {
22
+ export declare class StorageMemory implements Storage {
23
23
  #private;
24
24
  protected map: Map<string, unknown>;
25
- constructor(authString?: string);
26
- get isMemoryStorage(): boolean;
27
- initialize(): Promise<void>;
25
+ constructor();
26
+ get mustSerialize(): boolean;
27
+ initialize(): void;
28
28
  branch(id: string): Storage;
29
29
  get supportsFiles(): boolean;
30
30
  get<T>(key: readonly StorageKeyPart[]): T | null;
@@ -18,25 +18,23 @@
18
18
  * You should have received a copy of the GNU Lesser General Public License
19
19
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
20
20
  */
21
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
22
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
23
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
24
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
25
+ };
21
26
  var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
22
27
  if (kind === "m") throw new TypeError("Private method is not writable");
23
28
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
24
29
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
25
30
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
26
31
  };
27
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
28
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
29
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
30
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
31
- };
32
- var _StorageMemory_instances, _StorageMemory_id, _StorageMemory_authString, _StorageMemory_fixKey, _StorageMemory_getEntries;
32
+ var _StorageMemory_instances, _StorageMemory_id, _StorageMemory_fixKey, _StorageMemory_getEntries;
33
33
  Object.defineProperty(exports, "__esModule", { value: true });
34
34
  exports.StorageMemory = void 0;
35
- const _0_storage_js_1 = require("./0_storage.js");
36
35
  const _1_utilities_js_1 = require("./1_utilities.js");
37
- class StorageMemory extends _0_storage_js_1.Storage {
38
- constructor(authString) {
39
- super();
36
+ class StorageMemory {
37
+ constructor() {
40
38
  _StorageMemory_instances.add(this);
41
39
  Object.defineProperty(this, "map", {
42
40
  enumerable: true,
@@ -45,16 +43,11 @@ class StorageMemory extends _0_storage_js_1.Storage {
45
43
  value: new Map()
46
44
  });
47
45
  _StorageMemory_id.set(this, null);
48
- _StorageMemory_authString.set(this, void 0);
49
- __classPrivateFieldSet(this, _StorageMemory_authString, authString, "f");
50
46
  }
51
- get isMemoryStorage() {
52
- return true;
47
+ get mustSerialize() {
48
+ return false;
53
49
  }
54
- async initialize() {
55
- if (__classPrivateFieldGet(this, _StorageMemory_authString, "f")) {
56
- await this.importAuthString(__classPrivateFieldGet(this, _StorageMemory_authString, "f"));
57
- }
50
+ initialize() {
58
51
  }
59
52
  branch(id) {
60
53
  const storage = new StorageMemory();
@@ -110,7 +103,7 @@ class StorageMemory extends _0_storage_js_1.Storage {
110
103
  }
111
104
  }
112
105
  exports.StorageMemory = StorageMemory;
113
- _StorageMemory_id = new WeakMap(), _StorageMemory_authString = new WeakMap(), _StorageMemory_instances = new WeakSet(), _StorageMemory_fixKey = function _StorageMemory_fixKey(key) {
106
+ _StorageMemory_id = new WeakMap(), _StorageMemory_instances = new WeakSet(), _StorageMemory_fixKey = function _StorageMemory_fixKey(key) {
114
107
  if (__classPrivateFieldGet(this, _StorageMemory_id, "f") !== null) {
115
108
  return ["__S" + __classPrivateFieldGet(this, _StorageMemory_id, "f"), ...key];
116
109
  }
@@ -19,9 +19,10 @@
19
19
  */
20
20
  import { MaybePromise } from "../1_utilities.js";
21
21
  import { GetManyFilter, Storage, StorageKeyPart } from "./0_storage.js";
22
- export declare class StorageSessionStorage extends Storage implements Storage {
22
+ export declare class StorageSessionStorage implements Storage {
23
23
  #private;
24
24
  constructor(prefix: string);
25
+ get mustSerialize(): boolean;
25
26
  get prefix(): string;
26
27
  branch(id: string): StorageSessionStorage;
27
28
  initialize(): void;
@@ -32,20 +32,21 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
32
32
  var _StorageSessionStorage_prefix;
33
33
  Object.defineProperty(exports, "__esModule", { value: true });
34
34
  exports.StorageSessionStorage = void 0;
35
- const _0_storage_js_1 = require("./0_storage.js");
36
35
  const _1_utilities_js_1 = require("./1_utilities.js");
37
- class StorageSessionStorage extends _0_storage_js_1.Storage {
36
+ class StorageSessionStorage {
38
37
  constructor(prefix) {
38
+ _StorageSessionStorage_prefix.set(this, void 0);
39
39
  if (typeof sessionStorage === "undefined") {
40
40
  throw new Error("Unavailable in current environment");
41
41
  }
42
42
  if (prefix.length <= 0) {
43
43
  throw new Error("Empty prefix");
44
44
  }
45
- super();
46
- _StorageSessionStorage_prefix.set(this, void 0);
47
45
  __classPrivateFieldSet(this, _StorageSessionStorage_prefix, prefix, "f");
48
46
  }
47
+ get mustSerialize() {
48
+ return true;
49
+ }
49
50
  get prefix() {
50
51
  return __classPrivateFieldGet(this, _StorageSessionStorage_prefix, "f");
51
52
  }
@@ -18,6 +18,6 @@
18
18
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
19
  */
20
20
  /**
21
- * The identifier of a channel, a group, or a user (as provided by MTKruto), a username, or a chat link (e.g., https://mtkruto.t.me, https://telegram.me/mtkruto). `"me"` resolves to the currently authorized account.
21
+ * The identifier of a channel, a group, or a user (as provided by MTKruto), a username, or a chat link (e.g., https://mtkruto.t.me, https://telegram.me/mtkruto). `"me"` resolves to current the account.
22
22
  */
23
23
  export type ID = number | string | "me";
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes