@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
@@ -19,16 +19,16 @@ var _a;
19
19
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
20
20
  */
21
21
  import * as dntShim from "../_dnt.shims.js";
22
- import { AssertionError, basename, decodeHex, delay, extension, extname, ige256Decrypt, isAbsolute, join, MINUTE, SECOND, toFileUrl, unreachable } from "../0_deps.js";
22
+ import { AssertionError, basename, concat, crypto, decodeHex, delay, extension, extname, ige256Decrypt, ige256Encrypt, isAbsolute, join, MINUTE, SECOND, toFileUrl, unreachable } from "../0_deps.js";
23
23
  import { InputError } from "../0_errors.js";
24
- import { getLogger, getRandomId, iterateReadableStream, kilobyte, megabyte, mod, PartStream } from "../1_utilities.js";
24
+ import { getLogger, getRandomId, intFromBytes, iterateReadableStream, kilobyte, megabyte, mod, PartStream } from "../1_utilities.js";
25
25
  import { Api } from "../2_tl.js";
26
26
  import { TimeTooBig, TimeTooSmall } from "../3_errors.js";
27
27
  import { getDc } from "../3_transport.js";
28
28
  import { constructSticker, deserializeFileId, FileType, PhotoSourceType, serializeFileId, toUniqueFileId } from "../3_types.js";
29
29
  import { DOWNLOAD_MAX_CHUNK_SIZE, STICKER_SET_NAME_TTL } from "../4_constants.js";
30
30
  import { FloodWait, StickersetInvalid } from "../4_errors.js";
31
- import { UPLOAD_REQUEST_PER_CONNECTION } from "./0_utilities.js";
31
+ import { DOWNLOAD_POOL_SIZE, DOWNLOAD_REQUEST_PER_CONNECTION, UPLOAD_REQUEST_PER_CONNECTION } from "./0_utilities.js";
32
32
  export class FileManager {
33
33
  #c;
34
34
  #Lupload;
@@ -48,7 +48,7 @@ export class FileManager {
48
48
  this.#progressIds.add(id);
49
49
  return Promise.resolve(String(id));
50
50
  }
51
- async upload(file, params, checkName, allowStream = true) {
51
+ async upload(file, params, checkName, allowStream = true, encryptionInformation) {
52
52
  if (params?.progressId !== undefined && !this.#progressIds.has(BigInt(params.progressId))) {
53
53
  throw new InputError("Invalid progressId.");
54
54
  }
@@ -72,15 +72,28 @@ export class FileManager {
72
72
  this.#Lupload.debug("uploading " + whatIsUploaded + " with chunk size of " + chunkSize + " and pool size of " + poolSize + " and file ID of " + fileId);
73
73
  let result;
74
74
  if (contents instanceof Uint8Array) {
75
- result = await this.#uploadBuffer(contents, fileId, mustTrackProgress, chunkSize, poolSize, params?.signal);
75
+ result = await this.#uploadBuffer(contents, fileId, mustTrackProgress, chunkSize, poolSize, params?.signal, encryptionInformation);
76
76
  }
77
77
  else {
78
- result = await this.#uploadStream(contents, fileId, mustTrackProgress, chunkSize, poolSize, params?.signal);
78
+ result = await this.#uploadStream(contents, fileId, mustTrackProgress, chunkSize, poolSize, params?.signal, encryptionInformation);
79
79
  }
80
80
  this.#Lupload.debug(`[${fileId}] uploaded ` + result.parts + " part(s)");
81
81
  if (checkName) {
82
82
  name = checkName(name, result.firstPart);
83
83
  }
84
+ if (encryptionInformation) {
85
+ const digest = new Uint8Array(await crypto.subtle.digest("MD5", concat([encryptionInformation.key, encryptionInformation.iv])));
86
+ const right = digest.subarray(4, 8);
87
+ const key_fingerprint = Number(intFromBytes(digest.subarray(0, 4).map((v, i) => v ^ right[i])));
88
+ if (result.isSmall) {
89
+ const inputEncryptedFile = { _: "inputEncryptedFileUploaded", id: fileId, parts: result.parts, key_fingerprint, md5_checksum: "" };
90
+ return { inputEncryptedFile, fileSize: result.fileSize };
91
+ }
92
+ else {
93
+ const inputEncryptedFile = { _: "inputEncryptedFileBigUploaded", id: fileId, parts: result.parts, key_fingerprint };
94
+ return { inputEncryptedFile, fileSize: result.fileSize };
95
+ }
96
+ }
84
97
  if (result.isSmall) {
85
98
  return { _: "inputFile", id: fileId, name, parts: result.parts, md5_checksum: "" };
86
99
  }
@@ -88,12 +101,14 @@ export class FileManager {
88
101
  return { _: "inputFileBig", id: fileId, name, parts: result.parts };
89
102
  }
90
103
  }
91
- async #uploadStream(stream, fileId, mustTrackProgress, chunkSize, poolSize, signal) {
104
+ async #uploadStream(stream, fileId, mustTrackProgress, chunkSize, poolSize, signal, encryptionInformation) {
92
105
  let part;
93
106
  let promises = new Array();
94
107
  let ms = 0.05;
95
108
  let uploaded = 0;
96
109
  let firstPart;
110
+ let iv = encryptionInformation?.iv;
111
+ let fileSize = 0;
97
112
  for await (part of iterateReadableStream(stream.pipeThrough(new PartStream(chunkSize)))) {
98
113
  if (!part.isSmall && part.part > 0) {
99
114
  await delay(ms);
@@ -102,6 +117,16 @@ export class FileManager {
102
117
  if (!firstPart) {
103
118
  firstPart = part.bytes;
104
119
  }
120
+ if (encryptionInformation) {
121
+ fileSize += part.bytes.byteLength;
122
+ if (part.bytes.byteLength % 16 !== 0) {
123
+ part.bytes = concat([part.bytes, crypto.getRandomValues(new Uint8Array((16 - part.bytes.length % 16) % 16))]);
124
+ }
125
+ const right = part.bytes.subarray(-16);
126
+ part.bytes = ige256Encrypt(part.bytes, encryptionInformation.key, iv);
127
+ const left = part.bytes.subarray(-16);
128
+ iv = concat([left, right]);
129
+ }
105
130
  promises.push(this.#uploadPart(fileId, part.totalParts, !part.isSmall, part.part, part.bytes, signal).then(() => {
106
131
  if (mustTrackProgress) {
107
132
  uploaded += part.bytes.byteLength;
@@ -131,9 +156,9 @@ export class FileManager {
131
156
  isUploaded: true,
132
157
  },
133
158
  });
134
- return { isSmall: part.isSmall, parts: part.totalParts, firstPart };
159
+ return { isSmall: part.isSmall, parts: part.totalParts, firstPart, fileSize };
135
160
  }
136
- async #uploadBuffer(buffer, fileId, mustTrackProgress, chunkSize, poolSize, signal) {
161
+ async #uploadBuffer(buffer, fileId, mustTrackProgress, chunkSize, poolSize, signal, encryptionInformation) {
137
162
  const isBig = buffer.byteLength > _a.#BIG_FILE_THRESHOLD;
138
163
  const partCount = Math.ceil(buffer.byteLength / chunkSize);
139
164
  let promises = new Array();
@@ -141,15 +166,30 @@ export class FileManager {
141
166
  let ms = 0.05;
142
167
  let uploaded = 0;
143
168
  let firstPart;
169
+ let iv = encryptionInformation?.iv;
170
+ let fileSize = 0;
144
171
  main: for (let part = 0; part < partCount;) {
145
172
  for (let i = 0; i < poolSize; ++i) {
146
173
  for (let i = 0; i < UPLOAD_REQUEST_PER_CONNECTION; ++i) {
147
174
  const start = part * chunkSize;
148
175
  const end = start + chunkSize;
149
- const bytes = buffer.subarray(start, end);
176
+ let bytes = buffer.subarray(start, end);
150
177
  if (!bytes.byteLength) {
151
178
  break main;
152
179
  }
180
+ if (!firstPart) {
181
+ firstPart = bytes;
182
+ }
183
+ if (encryptionInformation) {
184
+ fileSize += bytes.byteLength;
185
+ if (bytes.byteLength % 16 !== 0) {
186
+ bytes = concat([bytes, crypto.getRandomValues(new Uint8Array((16 - bytes.length % 16) % 16))]);
187
+ }
188
+ const right = bytes.subarray(-16);
189
+ bytes = ige256Encrypt(bytes, encryptionInformation.key, iv);
190
+ const left = bytes.subarray(-16);
191
+ iv = concat([left, right]);
192
+ }
153
193
  if (!started) {
154
194
  started = true;
155
195
  }
@@ -157,9 +197,6 @@ export class FileManager {
157
197
  await delay(ms);
158
198
  ms = Math.max(ms * .8, 0.003);
159
199
  }
160
- if (!firstPart) {
161
- firstPart = bytes;
162
- }
163
200
  promises.push(this.#uploadPart(fileId, partCount, isBig, part++, bytes, signal).then(() => {
164
201
  if (mustTrackProgress) {
165
202
  uploaded += bytes.byteLength;
@@ -193,7 +230,7 @@ export class FileManager {
193
230
  isUploaded: true,
194
231
  },
195
232
  });
196
- return { isSmall: !isBig, parts: partCount, firstPart };
233
+ return { isSmall: !isBig, parts: partCount, firstPart, fileSize };
197
234
  }
198
235
  async #uploadPart(fileId, partCount, isBig, index, bytes, signal) {
199
236
  let retryIn = 1;
@@ -363,27 +400,29 @@ export class FileManager {
363
400
  let offset = params?.offset ? BigInt(params.offset) : 0n;
364
401
  let part = 0;
365
402
  let totalSize = 0;
366
- let ms = 0.05;
403
+ const requestCount = DOWNLOAD_POOL_SIZE * DOWNLOAD_REQUEST_PER_CONNECTION;
404
+ let finished = false;
367
405
  while (true) {
368
406
  signal?.throwIfAborted();
369
- let retryIn = 1;
370
- let errorCount = 0;
371
- try {
372
- const file = await this.#c.invoke({ _: "upload.getFile", location, offset, limit }, { dc, type: "download" });
407
+ const results = await Promise.all(Array.from({ length: requestCount }, (_, i) => this.#downloadPart(location, offset + BigInt(i * limit), limit, dc, signal, id, part + i)));
408
+ for (const result of results) {
373
409
  signal?.throwIfAborted();
374
- if (Api.is("upload.file", file)) {
375
- const downloadedSize = file.bytes.byteLength;
376
- let finished = downloadedSize < limit;
410
+ if (Api.is("upload.file", result)) {
411
+ const downloadedSize = result.bytes.byteLength;
412
+ finished = downloadedSize < limit;
377
413
  if (decryptionInformation) {
378
- const decryptedBytes = ige256Decrypt(file.bytes, decryptionInformation.key, decryptionInformation.iv);
414
+ const left = result.bytes.subarray(-16);
415
+ const decryptedBytes = ige256Decrypt(result.bytes, decryptionInformation.key, decryptionInformation.iv);
416
+ const right = decryptedBytes.subarray(-16);
379
417
  const remainingSize = Math.max(0, fileSize - totalSize);
380
- file.bytes = decryptedBytes.slice(0, remainingSize);
381
- totalSize += file.bytes.byteLength;
418
+ result.bytes = decryptedBytes.slice(0, remainingSize);
419
+ totalSize += result.bytes.byteLength;
382
420
  finished = totalSize >= fileSize;
421
+ decryptionInformation.iv = concat([left, right]);
383
422
  }
384
- yield file.bytes;
423
+ yield result.bytes;
385
424
  if (id !== null) {
386
- await this.#c.storage.saveFilePart(id, part, file.bytes);
425
+ await this.#c.storage.saveFilePart(id, part, result.bytes);
387
426
  signal?.throwIfAborted();
388
427
  }
389
428
  ++part;
@@ -401,8 +440,19 @@ export class FileManager {
401
440
  else {
402
441
  unreachable();
403
442
  }
404
- await delay(ms);
405
- ms = Math.max(ms * .8, 0.003);
443
+ }
444
+ if (finished) {
445
+ break;
446
+ }
447
+ }
448
+ }
449
+ async #downloadPart(location, offset, limit, dc, signal, id, part) {
450
+ let retryIn = 1;
451
+ let errorCount = 0;
452
+ while (true) {
453
+ try {
454
+ signal?.throwIfAborted();
455
+ return await this.#c.invoke({ _: "upload.getFile", location, offset, limit }, { dc, type: "download" });
406
456
  }
407
457
  catch (err) {
408
458
  if (typeof err === "object" && err instanceof AssertionError) {
@@ -411,7 +461,7 @@ export class FileManager {
411
461
  ++errorCount;
412
462
  if (errorCount > 20) {
413
463
  retryIn = 0;
414
- errorCount = 0;
464
+ errorCount = 20;
415
465
  }
416
466
  await this.#handleError(err, retryIn, `[${id}-${part + 1}]`);
417
467
  signal?.throwIfAborted();
@@ -500,13 +550,19 @@ export class FileManager {
500
550
  }
501
551
  }
502
552
  else if (fileId_.location.type === "common") {
503
- const location = {
504
- _: "inputDocumentFileLocation",
505
- id: fileId_.location.id,
506
- access_hash: fileId_.location.accessHash,
507
- file_reference: fileId_.fileReference ?? new Uint8Array(),
508
- thumb_size: "",
509
- };
553
+ const location = fileId_.type === FileType.Encrypted
554
+ ? {
555
+ _: "inputEncryptedFileLocation",
556
+ id: fileId_.location.id,
557
+ access_hash: fileId_.location.accessHash,
558
+ }
559
+ : {
560
+ _: "inputDocumentFileLocation",
561
+ id: fileId_.location.id,
562
+ access_hash: fileId_.location.accessHash,
563
+ file_reference: fileId_.fileReference ?? new Uint8Array(),
564
+ thumb_size: "",
565
+ };
510
566
  yield* this.downloadInner(location, fileId_.dcId, params);
511
567
  }
512
568
  else {
@@ -1,6 +1,6 @@
1
1
  import { Api } from "../2_tl.js";
2
- import { type ID, type Update } from "../3_types.js";
3
- import type { SendSecretContactParams, SendSecretLocationParams, SendSecretMessageParams, SendSecretVenueParams } from "./0_params.js";
2
+ import { type FileSource, type ID, type Sticker, type Update } from "../3_types.js";
3
+ import type { EndSecretChatParams, SendSecretAnimationParams, SendSecretAudioParams, SendSecretContactParams, SendSecretDocumentParams, SendSecretLocationParams, SendSecretMessageParams, SendSecretPhotoParams, SendSecretStickerParams, SendSecretVenueParams, SendSecretVideoNoteParams, SendSecretVideoParams, SendSecretVoiceParams } from "./0_params.js";
4
4
  import type { UpdateProcessor } from "./0_update_processor.js";
5
5
  import type { C as C_ } from "./1_types.js";
6
6
  import type { FileManager } from "./2_file_manager.js";
@@ -15,10 +15,19 @@ export declare class SecretChatManager implements UpdateProcessor<SecretChatMana
15
15
  loadSecretChats(): Promise<void>;
16
16
  requestSecretChat(chatId: ID): Promise<import("../3_types.js").SecretChat>;
17
17
  acceptSecretChat(id: number): Promise<import("../3_types.js").SecretChat>;
18
+ endSecretChat(id: number, params?: EndSecretChatParams): Promise<import("../3_types.js").SecretChat>;
18
19
  sendSecretMessage(id: number, text: string, params?: SendSecretMessageParams): Promise<void>;
19
20
  sendSecretLocation(id: number, latitude: number, longitude: number, params?: SendSecretLocationParams): Promise<void>;
20
21
  sendSecretVenue(id: number, latitude: number, longitude: number, title: string, address: string, params?: SendSecretVenueParams): Promise<void>;
21
22
  sendSecretContact(id: number, firstName: string, phoneNumber: string, params?: SendSecretContactParams): Promise<void>;
23
+ sendSecretDocument(id: number, document: FileSource, params?: SendSecretDocumentParams): Promise<void>;
24
+ sendSecretVideo(id: number, video: FileSource, params?: SendSecretVideoParams): Promise<void>;
25
+ sendSecretVideoNote(id: number, videoNote: FileSource, params?: SendSecretVideoNoteParams): Promise<void>;
26
+ sendSecretAudio(id: number, audio: FileSource, params?: SendSecretAudioParams): Promise<void>;
27
+ sendSecretVoice(id: number, voice: FileSource, params?: SendSecretVoiceParams): Promise<void>;
28
+ sendSecretAnimation(id: number, animation: FileSource, params?: SendSecretAnimationParams): Promise<void>;
29
+ sendSecretPhoto(id: number, photo: FileSource, params?: SendSecretPhotoParams): Promise<void>;
30
+ sendSecretSticker(id: number, sticker: Sticker, params?: SendSecretStickerParams): Promise<void>;
22
31
  canHandleUpdate(update: Api.Update): update is SecretChatManagerUpdate;
23
32
  handleUpdate(update: SecretChatManagerUpdate): Promise<Update | null>;
24
33
  }
@@ -1 +1 @@
1
- {"version":3,"file":"3_secret_chat_manager.d.ts","sourceRoot":"","sources":["../../src/client/3_secret_chat_manager.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,GAAG,EAAsC,MAAM,YAAY,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,EAAiC,KAAK,MAAM,EAAE,MAAM,eAAe,CAAC;AAGpF,OAAO,KAAK,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,eAAe,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