@mtkruto/node 0.171.0 → 0.180.1

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 (107) hide show
  1. package/esm/0_deps.d.ts +1 -0
  2. package/esm/0_deps.d.ts.map +1 -1
  3. package/esm/0_deps.js +1 -0
  4. package/esm/client/0_params.d.ts +54 -8
  5. package/esm/client/0_params.d.ts.map +1 -1
  6. package/esm/client/1_client_generic.d.ts +72 -1
  7. package/esm/client/1_client_generic.d.ts.map +1 -1
  8. package/esm/client/2_file_manager.d.ts +9 -1
  9. package/esm/client/2_file_manager.d.ts.map +1 -1
  10. package/esm/client/2_file_manager.js +93 -37
  11. package/esm/client/3_secret_chat_manager.d.ts +11 -2
  12. package/esm/client/3_secret_chat_manager.d.ts.map +1 -1
  13. package/esm/client/3_secret_chat_manager.js +322 -11
  14. package/esm/client/4_context.d.ts +24 -6
  15. package/esm/client/4_context.d.ts.map +1 -1
  16. package/esm/client/4_context.js +53 -0
  17. package/esm/client/6_client.d.ts +72 -1
  18. package/esm/client/6_client.d.ts.map +1 -1
  19. package/esm/client/6_client.js +89 -0
  20. package/esm/client/6_client_dispatcher.d.ts +72 -1
  21. package/esm/client/6_client_dispatcher.d.ts.map +1 -1
  22. package/esm/client/6_client_dispatcher.js +89 -0
  23. package/esm/deps/jsr.io/@std/crypto/1.1.0/_types.d.ts +9 -0
  24. package/esm/deps/jsr.io/@std/crypto/1.1.0/_types.d.ts.map +1 -0
  25. package/esm/deps/jsr.io/@std/crypto/1.1.0/_types.js +2 -0
  26. package/esm/deps/jsr.io/@std/crypto/1.1.0/_wasm/lib/deno_std_wasm_crypto.d.ts +2 -0
  27. package/esm/deps/jsr.io/@std/crypto/1.1.0/_wasm/lib/deno_std_wasm_crypto.d.ts.map +1 -0
  28. package/esm/deps/jsr.io/@std/crypto/1.1.0/_wasm/lib/deno_std_wasm_crypto.internal.d.ts +69 -0
  29. package/esm/deps/jsr.io/@std/crypto/1.1.0/_wasm/lib/deno_std_wasm_crypto.internal.d.ts.map +1 -0
  30. package/esm/deps/jsr.io/@std/crypto/1.1.0/_wasm/lib/deno_std_wasm_crypto.internal.js +237 -0
  31. package/esm/deps/jsr.io/@std/crypto/1.1.0/_wasm/lib/deno_std_wasm_crypto.js +2277 -0
  32. package/esm/deps/jsr.io/@std/crypto/1.1.0/_wasm/mod.d.ts +13 -0
  33. package/esm/deps/jsr.io/@std/crypto/1.1.0/_wasm/mod.d.ts.map +1 -0
  34. package/esm/deps/jsr.io/@std/crypto/1.1.0/_wasm/mod.js +46 -0
  35. package/esm/deps/jsr.io/@std/crypto/1.1.0/aes_gcm.d.ts +76 -0
  36. package/esm/deps/jsr.io/@std/crypto/1.1.0/aes_gcm.d.ts.map +1 -0
  37. package/esm/deps/jsr.io/@std/crypto/1.1.0/aes_gcm.js +132 -0
  38. package/esm/deps/jsr.io/@std/crypto/1.1.0/crypto.d.ts +149 -0
  39. package/esm/deps/jsr.io/@std/crypto/1.1.0/crypto.d.ts.map +1 -0
  40. package/esm/deps/jsr.io/@std/crypto/1.1.0/crypto.js +270 -0
  41. package/esm/deps/jsr.io/@std/crypto/1.1.0/mod.d.ts +22 -0
  42. package/esm/deps/jsr.io/@std/crypto/1.1.0/mod.d.ts.map +1 -0
  43. package/esm/deps/jsr.io/@std/crypto/1.1.0/mod.js +23 -0
  44. package/esm/deps/jsr.io/@std/crypto/1.1.0/timing_safe_equal.d.ts +40 -0
  45. package/esm/deps/jsr.io/@std/crypto/1.1.0/timing_safe_equal.d.ts.map +1 -0
  46. package/esm/deps/jsr.io/@std/crypto/1.1.0/timing_safe_equal.js +61 -0
  47. package/esm/tl/0_utilities.d.ts.map +1 -1
  48. package/esm/tl/0_utilities.js +44 -2
  49. package/esm/tl/1_tl_writer.d.ts.map +1 -1
  50. package/esm/tl/1_tl_writer.js +6 -1
  51. package/esm/types/1_sticker.d.ts +7 -9
  52. package/esm/types/1_sticker.d.ts.map +1 -1
  53. package/esm/types/1_sticker.js +1 -6
  54. package/package.json +1 -1
  55. package/script/0_deps.d.ts +1 -0
  56. package/script/0_deps.d.ts.map +1 -1
  57. package/script/0_deps.js +7 -5
  58. package/script/client/0_params.d.ts +54 -8
  59. package/script/client/0_params.d.ts.map +1 -1
  60. package/script/client/1_client_generic.d.ts +72 -1
  61. package/script/client/1_client_generic.d.ts.map +1 -1
  62. package/script/client/2_file_manager.d.ts +9 -1
  63. package/script/client/2_file_manager.d.ts.map +1 -1
  64. package/script/client/2_file_manager.js +90 -34
  65. package/script/client/3_secret_chat_manager.d.ts +11 -2
  66. package/script/client/3_secret_chat_manager.d.ts.map +1 -1
  67. package/script/client/3_secret_chat_manager.js +319 -8
  68. package/script/client/4_context.d.ts +24 -6
  69. package/script/client/4_context.d.ts.map +1 -1
  70. package/script/client/4_context.js +53 -0
  71. package/script/client/6_client.d.ts +72 -1
  72. package/script/client/6_client.d.ts.map +1 -1
  73. package/script/client/6_client.js +89 -0
  74. package/script/client/6_client_dispatcher.d.ts +72 -1
  75. package/script/client/6_client_dispatcher.d.ts.map +1 -1
  76. package/script/client/6_client_dispatcher.js +89 -0
  77. package/script/deps/jsr.io/@std/crypto/1.1.0/_types.d.ts +9 -0
  78. package/script/deps/jsr.io/@std/crypto/1.1.0/_types.d.ts.map +1 -0
  79. package/script/deps/jsr.io/@std/crypto/1.1.0/_types.js +3 -0
  80. package/script/deps/jsr.io/@std/crypto/1.1.0/_wasm/lib/deno_std_wasm_crypto.d.ts +2 -0
  81. package/script/deps/jsr.io/@std/crypto/1.1.0/_wasm/lib/deno_std_wasm_crypto.d.ts.map +1 -0
  82. package/script/deps/jsr.io/@std/crypto/1.1.0/_wasm/lib/deno_std_wasm_crypto.internal.d.ts +69 -0
  83. package/script/deps/jsr.io/@std/crypto/1.1.0/_wasm/lib/deno_std_wasm_crypto.internal.d.ts.map +1 -0
  84. package/script/deps/jsr.io/@std/crypto/1.1.0/_wasm/lib/deno_std_wasm_crypto.internal.js +255 -0
  85. package/script/deps/jsr.io/@std/crypto/1.1.0/_wasm/lib/deno_std_wasm_crypto.js +2315 -0
  86. package/script/deps/jsr.io/@std/crypto/1.1.0/_wasm/mod.d.ts +13 -0
  87. package/script/deps/jsr.io/@std/crypto/1.1.0/_wasm/mod.d.ts.map +1 -0
  88. package/script/deps/jsr.io/@std/crypto/1.1.0/_wasm/mod.js +51 -0
  89. package/script/deps/jsr.io/@std/crypto/1.1.0/aes_gcm.d.ts +76 -0
  90. package/script/deps/jsr.io/@std/crypto/1.1.0/aes_gcm.d.ts.map +1 -0
  91. package/script/deps/jsr.io/@std/crypto/1.1.0/aes_gcm.js +169 -0
  92. package/script/deps/jsr.io/@std/crypto/1.1.0/crypto.d.ts +149 -0
  93. package/script/deps/jsr.io/@std/crypto/1.1.0/crypto.d.ts.map +1 -0
  94. package/script/deps/jsr.io/@std/crypto/1.1.0/crypto.js +306 -0
  95. package/script/deps/jsr.io/@std/crypto/1.1.0/mod.d.ts +22 -0
  96. package/script/deps/jsr.io/@std/crypto/1.1.0/mod.d.ts.map +1 -0
  97. package/script/deps/jsr.io/@std/crypto/1.1.0/mod.js +39 -0
  98. package/script/deps/jsr.io/@std/crypto/1.1.0/timing_safe_equal.d.ts +40 -0
  99. package/script/deps/jsr.io/@std/crypto/1.1.0/timing_safe_equal.d.ts.map +1 -0
  100. package/script/deps/jsr.io/@std/crypto/1.1.0/timing_safe_equal.js +64 -0
  101. package/script/tl/0_utilities.d.ts.map +1 -1
  102. package/script/tl/0_utilities.js +43 -1
  103. package/script/tl/1_tl_writer.d.ts.map +1 -1
  104. package/script/tl/1_tl_writer.js +6 -1
  105. package/script/types/1_sticker.d.ts +7 -9
  106. package/script/types/1_sticker.d.ts.map +1 -1
  107. package/script/types/1_sticker.js +1 -6
@@ -0,0 +1,255 @@
1
+ "use strict";
2
+ // @generated file from wasmbuild -- do not edit
3
+ // @ts-nocheck: generated
4
+ // deno-lint-ignore-file
5
+ // deno-fmt-ignore-file
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.DigestContext = void 0;
8
+ exports.__wbg_set_wasm = __wbg_set_wasm;
9
+ exports.digest = digest;
10
+ exports.__wbg_buffer_09165b52af8c5237 = __wbg_buffer_09165b52af8c5237;
11
+ exports.__wbg_buffer_609cc3eee51ed158 = __wbg_buffer_609cc3eee51ed158;
12
+ exports.__wbg_byteLength_e674b853d9c77e1d = __wbg_byteLength_e674b853d9c77e1d;
13
+ exports.__wbg_byteOffset_fd862df290ef848d = __wbg_byteOffset_fd862df290ef848d;
14
+ exports.__wbg_length_a446193dc22c12f8 = __wbg_length_a446193dc22c12f8;
15
+ exports.__wbg_new_a12002a7f91c75be = __wbg_new_a12002a7f91c75be;
16
+ exports.__wbg_new_b08a00743b8ae2f3 = __wbg_new_b08a00743b8ae2f3;
17
+ exports.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = __wbg_newwithbyteoffsetandlength_d97e637ebe145a9a;
18
+ exports.__wbg_set_65595bdd868b3009 = __wbg_set_65595bdd868b3009;
19
+ exports.__wbindgen_init_externref_table = __wbindgen_init_externref_table;
20
+ exports.__wbindgen_memory = __wbindgen_memory;
21
+ exports.__wbindgen_throw = __wbindgen_throw;
22
+ let wasm;
23
+ function __wbg_set_wasm(val) {
24
+ wasm = val;
25
+ }
26
+ const lTextDecoder = typeof TextDecoder === "undefined"
27
+ ? (0, module.require)("util").TextDecoder
28
+ : TextDecoder;
29
+ let cachedTextDecoder = new lTextDecoder("utf-8", {
30
+ ignoreBOM: true,
31
+ fatal: true,
32
+ });
33
+ cachedTextDecoder.decode();
34
+ let cachedUint8ArrayMemory0 = null;
35
+ function getUint8ArrayMemory0() {
36
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
37
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
38
+ }
39
+ return cachedUint8ArrayMemory0;
40
+ }
41
+ function getStringFromWasm0(ptr, len) {
42
+ ptr = ptr >>> 0;
43
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
44
+ }
45
+ let WASM_VECTOR_LEN = 0;
46
+ const lTextEncoder = typeof TextEncoder === "undefined"
47
+ ? (0, module.require)("util").TextEncoder
48
+ : TextEncoder;
49
+ let cachedTextEncoder = new lTextEncoder("utf-8");
50
+ const encodeString = typeof cachedTextEncoder.encodeInto === "function"
51
+ ? function (arg, view) {
52
+ return cachedTextEncoder.encodeInto(arg, view);
53
+ }
54
+ : function (arg, view) {
55
+ const buf = cachedTextEncoder.encode(arg);
56
+ view.set(buf);
57
+ return {
58
+ read: arg.length,
59
+ written: buf.length,
60
+ };
61
+ };
62
+ function passStringToWasm0(arg, malloc, realloc) {
63
+ if (realloc === undefined) {
64
+ const buf = cachedTextEncoder.encode(arg);
65
+ const ptr = malloc(buf.length, 1) >>> 0;
66
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
67
+ WASM_VECTOR_LEN = buf.length;
68
+ return ptr;
69
+ }
70
+ let len = arg.length;
71
+ let ptr = malloc(len, 1) >>> 0;
72
+ const mem = getUint8ArrayMemory0();
73
+ let offset = 0;
74
+ for (; offset < len; offset++) {
75
+ const code = arg.charCodeAt(offset);
76
+ if (code > 0x7F)
77
+ break;
78
+ mem[ptr + offset] = code;
79
+ }
80
+ if (offset !== len) {
81
+ if (offset !== 0) {
82
+ arg = arg.slice(offset);
83
+ }
84
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
85
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
86
+ const ret = encodeString(arg, view);
87
+ offset += ret.written;
88
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
89
+ }
90
+ WASM_VECTOR_LEN = offset;
91
+ return ptr;
92
+ }
93
+ function isLikeNone(x) {
94
+ return x === undefined || x === null;
95
+ }
96
+ function takeFromExternrefTable0(idx) {
97
+ const value = wasm.__wbindgen_export_0.get(idx);
98
+ wasm.__externref_table_dealloc(idx);
99
+ return value;
100
+ }
101
+ function getArrayU8FromWasm0(ptr, len) {
102
+ ptr = ptr >>> 0;
103
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
104
+ }
105
+ /**
106
+ * Returns the digest of the given `data` using the given hash `algorithm`.
107
+ *
108
+ * `length` will usually be left `undefined` to use the default length for
109
+ * the algorithm. For algorithms with variable-length output, it can be used
110
+ * to specify a non-negative integer number of bytes.
111
+ *
112
+ * An error will be thrown if `algorithm` is not a supported hash algorithm or
113
+ * `length` is not a supported length for the algorithm.
114
+ * @param {string} algorithm
115
+ * @param {Uint8Array} data
116
+ * @param {number | null} [length]
117
+ * @returns {Uint8Array}
118
+ */
119
+ function digest(algorithm, data, length) {
120
+ const ptr0 = passStringToWasm0(algorithm, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
121
+ const len0 = WASM_VECTOR_LEN;
122
+ const ret = wasm.digest(ptr0, len0, data, isLikeNone(length) ? 0x100000001 : length >>> 0);
123
+ if (ret[3]) {
124
+ throw takeFromExternrefTable0(ret[2]);
125
+ }
126
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
127
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
128
+ return v2;
129
+ }
130
+ const DigestContextFinalization = (typeof FinalizationRegistry === "undefined")
131
+ ? { register: () => { }, unregister: () => { } }
132
+ : new FinalizationRegistry((ptr) => wasm.__wbg_digestcontext_free(ptr >>> 0, 1));
133
+ /**
134
+ * A context for incrementally computing a digest using a given hash algorithm.
135
+ */
136
+ class DigestContext {
137
+ __destroy_into_raw() {
138
+ const ptr = this.__wbg_ptr;
139
+ this.__wbg_ptr = 0;
140
+ DigestContextFinalization.unregister(this);
141
+ return ptr;
142
+ }
143
+ free() {
144
+ const ptr = this.__destroy_into_raw();
145
+ wasm.__wbg_digestcontext_free(ptr, 0);
146
+ }
147
+ /**
148
+ * Creates a new context incrementally computing a digest using the given
149
+ * hash algorithm.
150
+ *
151
+ * An error will be thrown if `algorithm` is not a supported hash algorithm.
152
+ * @param {string} algorithm
153
+ */
154
+ constructor(algorithm) {
155
+ const ptr0 = passStringToWasm0(algorithm, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
156
+ const len0 = WASM_VECTOR_LEN;
157
+ const ret = wasm.digestcontext_new(ptr0, len0);
158
+ if (ret[2]) {
159
+ throw takeFromExternrefTable0(ret[1]);
160
+ }
161
+ this.__wbg_ptr = ret[0] >>> 0;
162
+ DigestContextFinalization.register(this, this.__wbg_ptr, this);
163
+ return this;
164
+ }
165
+ /**
166
+ * Update the digest's internal state with the additional input `data`.
167
+ *
168
+ * If the `data` array view is large, it will be split into subarrays (via
169
+ * JavaScript bindings) which will be processed sequentially in order to
170
+ * limit the amount of memory that needs to be allocated in the Wasm heap.
171
+ * @param {Uint8Array} data
172
+ */
173
+ update(data) {
174
+ const ret = wasm.digestcontext_update(this.__wbg_ptr, data);
175
+ if (ret[1]) {
176
+ throw takeFromExternrefTable0(ret[0]);
177
+ }
178
+ }
179
+ /**
180
+ * Returns the digest of the input data so far, and then drops the context
181
+ * from memory on the Wasm side. This context must no longer be used, and any
182
+ * further method calls will result in null pointer errors being thrown.
183
+ * https://github.com/rustwasm/wasm-bindgen/blob/bf39cfd8/crates/backend/src/codegen.rs#L186
184
+ *
185
+ * `length` will usually be left `undefined` to use the default length for
186
+ * the algorithm. For algorithms with variable-length output, it can be used
187
+ * to specify a non-negative integer number of bytes.
188
+ *
189
+ * An error will be thrown if `length` is not a supported length for the algorithm.
190
+ * @param {number | null} [length]
191
+ * @returns {Uint8Array}
192
+ */
193
+ digestAndDrop(length) {
194
+ const ptr = this.__destroy_into_raw();
195
+ const ret = wasm.digestcontext_digestAndDrop(ptr, isLikeNone(length) ? 0x100000001 : length >>> 0);
196
+ if (ret[3]) {
197
+ throw takeFromExternrefTable0(ret[2]);
198
+ }
199
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
200
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
201
+ return v1;
202
+ }
203
+ }
204
+ exports.DigestContext = DigestContext;
205
+ function __wbg_buffer_09165b52af8c5237(arg0) {
206
+ const ret = arg0.buffer;
207
+ return ret;
208
+ }
209
+ function __wbg_buffer_609cc3eee51ed158(arg0) {
210
+ const ret = arg0.buffer;
211
+ return ret;
212
+ }
213
+ function __wbg_byteLength_e674b853d9c77e1d(arg0) {
214
+ const ret = arg0.byteLength;
215
+ return ret;
216
+ }
217
+ function __wbg_byteOffset_fd862df290ef848d(arg0) {
218
+ const ret = arg0.byteOffset;
219
+ return ret;
220
+ }
221
+ function __wbg_length_a446193dc22c12f8(arg0) {
222
+ const ret = arg0.length;
223
+ return ret;
224
+ }
225
+ function __wbg_new_a12002a7f91c75be(arg0) {
226
+ const ret = new Uint8Array(arg0);
227
+ return ret;
228
+ }
229
+ function __wbg_new_b08a00743b8ae2f3(arg0, arg1) {
230
+ const ret = new TypeError(getStringFromWasm0(arg0, arg1));
231
+ return ret;
232
+ }
233
+ function __wbg_newwithbyteoffsetandlength_d97e637ebe145a9a(arg0, arg1, arg2) {
234
+ const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
235
+ return ret;
236
+ }
237
+ function __wbg_set_65595bdd868b3009(arg0, arg1, arg2) {
238
+ arg0.set(arg1, arg2 >>> 0);
239
+ }
240
+ function __wbindgen_init_externref_table() {
241
+ const table = wasm.__wbindgen_export_0;
242
+ const offset = table.grow(4);
243
+ table.set(0, undefined);
244
+ table.set(offset + 0, undefined);
245
+ table.set(offset + 1, null);
246
+ table.set(offset + 2, true);
247
+ table.set(offset + 3, false);
248
+ }
249
+ function __wbindgen_memory() {
250
+ const ret = wasm.memory;
251
+ return ret;
252
+ }
253
+ function __wbindgen_throw(arg0, arg1) {
254
+ throw new Error(getStringFromWasm0(arg0, arg1));
255
+ }