@mtkruto/node 0.0.820 → 0.0.821
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.
- package/esm/_dnt.test_shims.d.ts +10 -0
- package/esm/tl/0_tl_raw_reader_test.d.ts +1 -0
- package/esm/tl/0_tl_raw_writer_test.d.ts +1 -0
- package/esm/tl/1_tl_object_test.d.ts +1 -0
- package/esm/tl/2_types_test.d.ts +1 -0
- package/esm/tl/3_deserialize_test.d.ts +1 -0
- package/esm/tl/3_functions_test.d.ts +1 -0
- package/esm/utilities/0_bigint_test.d.ts +1 -0
- package/esm/utilities/0_buffer_test.d.ts +1 -0
- package/esm/utilities/1_password_test.d.ts +1 -0
- package/package.json +5 -12
- package/script/_dnt.shims.d.ts +10 -0
- package/script/_dnt.test_shims.d.ts +10 -0
- package/script/client/client.d.ts +50 -0
- package/script/client/client_abstract.d.ts +16 -0
- package/script/client/client_plain.d.ts +9 -0
- package/script/connection/connection.d.ts +7 -0
- package/script/connection/connection_web_socket.d.ts +13 -0
- package/script/constants.d.ts +12 -0
- package/script/deps/deno.land/std@0.186.0/fmt/colors.d.ts +270 -0
- package/script/deps/deno.land/std@0.186.0/testing/_diff.d.ts +26 -0
- package/script/deps/deno.land/std@0.186.0/testing/_format.d.ts +1 -0
- package/script/deps/deno.land/std@0.186.0/testing/asserts.d.ts +284 -0
- package/script/deps/deno.land/x/crc32@v0.2.0/mod.d.ts +15 -0
- package/script/deps/deno.land/x/tgcrypto@0.1.3/mod.d.ts +47 -0
- package/script/deps/deno.land/x/tgcrypto@0.1.3/tgcrypto.d.ts +2 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/gzip/gzip.d.ts +16 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/utils/uint8.d.ts +1 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/deflate.d.ts +29 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/inflate.d.ts +23 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/mod.d.ts +2 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/adler32.d.ts +1 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/crc32.d.ts +2 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/deflate.d.ts +78 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/gzheader.d.ts +12 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/inffast.d.ts +1 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/inflate.d.ts +47 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/inftrees.d.ts +1 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/messages.d.ts +12 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/status.d.ts +30 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/trees.d.ts +5 -0
- package/script/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/zstream.d.ts +14 -0
- package/script/deps.d.ts +4 -0
- package/script/mod.d.ts +24 -0
- package/script/session/session.d.ts +12 -0
- package/script/session/session_local_storage.d.ts +7 -0
- package/script/session/session_memory.d.ts +5 -0
- package/script/tl/0_tl_raw_reader.d.ts +13 -0
- package/script/tl/0_tl_raw_reader_test.d.ts +1 -0
- package/script/tl/0_tl_raw_writer.d.ts +13 -0
- package/script/tl/0_tl_raw_writer_test.d.ts +1 -0
- package/script/tl/1_tl_object.d.ts +40 -0
- package/script/tl/1_tl_object_test.d.ts +1 -0
- package/script/tl/2_types.d.ts +14815 -0
- package/script/tl/2_types_test.d.ts +1 -0
- package/script/tl/3_deserialize.d.ts +3 -0
- package/script/tl/3_deserialize_test.d.ts +1 -0
- package/script/tl/3_functions.d.ts +6122 -0
- package/script/tl/3_functions_test.d.ts +1 -0
- package/script/tl/3_tl_reader.d.ts +6 -0
- package/script/tl/3_tl_writer.d.ts +5 -0
- package/script/tl/4_rpc_result.d.ts +8 -0
- package/script/tl/5_message.d.ts +11 -0
- package/script/tl/6_message_container.d.ts +9 -0
- package/script/transport/transport.d.ts +15 -0
- package/script/transport/transport_abridged.d.ts +11 -0
- package/script/transport/transport_intermediate.d.ts +11 -0
- package/script/transport/transport_provider.d.ts +17 -0
- package/script/types.d.ts +1 -0
- package/script/utilities/0_bigint.d.ts +5 -0
- package/script/utilities/0_bigint_test.d.ts +1 -0
- package/script/utilities/0_buffer.d.ts +2 -0
- package/script/utilities/0_buffer_test.d.ts +1 -0
- package/script/utilities/0_crypto.d.ts +8 -0
- package/script/utilities/0_hash.d.ts +2 -0
- package/script/utilities/1_auth.d.ts +1 -0
- package/script/utilities/1_message.d.ts +10 -0
- package/script/utilities/1_obfuscation.d.ts +6 -0
- package/script/utilities/1_password.d.ts +11 -0
- package/script/utilities/1_password_test.d.ts +1 -0
- /package/{types → esm}/_dnt.shims.d.ts +0 -0
- /package/{types → esm}/client/client.d.ts +0 -0
- /package/{types → esm}/client/client_abstract.d.ts +0 -0
- /package/{types → esm}/client/client_plain.d.ts +0 -0
- /package/{types → esm}/connection/connection.d.ts +0 -0
- /package/{types → esm}/connection/connection_web_socket.d.ts +0 -0
- /package/{types → esm}/constants.d.ts +0 -0
- /package/{types → esm}/deps/deno.land/std@0.186.0/fmt/colors.d.ts +0 -0
- /package/{types → esm}/deps/deno.land/std@0.186.0/testing/_diff.d.ts +0 -0
- /package/{types → esm}/deps/deno.land/std@0.186.0/testing/_format.d.ts +0 -0
- /package/{types → esm}/deps/deno.land/std@0.186.0/testing/asserts.d.ts +0 -0
- /package/{types → esm}/deps/deno.land/x/crc32@v0.2.0/mod.d.ts +0 -0
- /package/{types → esm}/deps/deno.land/x/tgcrypto@0.1.3/mod.d.ts +0 -0
- /package/{types → esm}/deps/deno.land/x/tgcrypto@0.1.3/tgcrypto.d.ts +0 -0
- /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/gzip/gzip.d.ts +0 -0
- /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/utils/uint8.d.ts +0 -0
- /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/deflate.d.ts +0 -0
- /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/inflate.d.ts +0 -0
- /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/mod.d.ts +0 -0
- /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/adler32.d.ts +0 -0
- /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/crc32.d.ts +0 -0
- /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/deflate.d.ts +0 -0
- /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/gzheader.d.ts +0 -0
- /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/inffast.d.ts +0 -0
- /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/inflate.d.ts +0 -0
- /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/inftrees.d.ts +0 -0
- /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/messages.d.ts +0 -0
- /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/status.d.ts +0 -0
- /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/trees.d.ts +0 -0
- /package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/zstream.d.ts +0 -0
- /package/{types → esm}/deps.d.ts +0 -0
- /package/{types → esm}/mod.d.ts +0 -0
- /package/{types → esm}/session/session.d.ts +0 -0
- /package/{types → esm}/session/session_local_storage.d.ts +0 -0
- /package/{types → esm}/session/session_memory.d.ts +0 -0
- /package/{types → esm}/tl/0_tl_raw_reader.d.ts +0 -0
- /package/{types → esm}/tl/0_tl_raw_writer.d.ts +0 -0
- /package/{types → esm}/tl/1_tl_object.d.ts +0 -0
- /package/{types → esm}/tl/2_types.d.ts +0 -0
- /package/{types → esm}/tl/3_deserialize.d.ts +0 -0
- /package/{types → esm}/tl/3_functions.d.ts +0 -0
- /package/{types → esm}/tl/3_tl_reader.d.ts +0 -0
- /package/{types → esm}/tl/3_tl_writer.d.ts +0 -0
- /package/{types → esm}/tl/4_rpc_result.d.ts +0 -0
- /package/{types → esm}/tl/5_message.d.ts +0 -0
- /package/{types → esm}/tl/6_message_container.d.ts +0 -0
- /package/{types → esm}/transport/transport.d.ts +0 -0
- /package/{types → esm}/transport/transport_abridged.d.ts +0 -0
- /package/{types → esm}/transport/transport_intermediate.d.ts +0 -0
- /package/{types → esm}/transport/transport_provider.d.ts +0 -0
- /package/{types → esm}/types.d.ts +0 -0
- /package/{types → esm}/utilities/0_bigint.d.ts +0 -0
- /package/{types → esm}/utilities/0_buffer.d.ts +0 -0
- /package/{types → esm}/utilities/0_crypto.d.ts +0 -0
- /package/{types → esm}/utilities/0_hash.d.ts +0 -0
- /package/{types → esm}/utilities/1_auth.d.ts +0 -0
- /package/{types → esm}/utilities/1_message.d.ts +0 -0
- /package/{types → esm}/utilities/1_obfuscation.d.ts +0 -0
- /package/{types → esm}/utilities/1_password.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { id, MaybeVectorTLObject } from "./1_tl_object.js";
|
|
2
|
+
export declare class RPCResult {
|
|
3
|
+
readonly messageId: bigint;
|
|
4
|
+
readonly result: MaybeVectorTLObject;
|
|
5
|
+
static get [id](): number;
|
|
6
|
+
constructor(messageId: bigint, result: MaybeVectorTLObject);
|
|
7
|
+
static deserialize(buffer: Uint8Array): RPCResult;
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MaybeVectorTLObject } from "./1_tl_object.js";
|
|
2
|
+
import { TLReader } from "./3_tl_reader.js";
|
|
3
|
+
import { RPCResult } from "./4_rpc_result.js";
|
|
4
|
+
export declare class Message {
|
|
5
|
+
readonly id: bigint;
|
|
6
|
+
readonly seqNo: number;
|
|
7
|
+
readonly body: MaybeVectorTLObject | RPCResult;
|
|
8
|
+
constructor(id: bigint, seqNo: number, body: MaybeVectorTLObject | RPCResult);
|
|
9
|
+
serialize(): Uint8Array;
|
|
10
|
+
static deserialize(reader: TLReader): Message;
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { id } from "./1_tl_object.js";
|
|
2
|
+
import { Message } from "./5_message.js";
|
|
3
|
+
export declare class MessageContainer {
|
|
4
|
+
messages: Message[];
|
|
5
|
+
static get [id](): number;
|
|
6
|
+
constructor(messages: Message[]);
|
|
7
|
+
serialize(): Uint8Array;
|
|
8
|
+
static deserialize(buffer: Uint8Array): MessageContainer;
|
|
9
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MaybePromise } from "../types.js";
|
|
2
|
+
import { CTR } from "../utilities/0_crypto.js";
|
|
3
|
+
export declare abstract class Transport {
|
|
4
|
+
protected initialized: boolean;
|
|
5
|
+
protected obfuscationParameters: {
|
|
6
|
+
encryptionCTR: CTR;
|
|
7
|
+
decryptionCTR: CTR;
|
|
8
|
+
} | null;
|
|
9
|
+
protected encrypt(buffer: Uint8Array): Uint8Array;
|
|
10
|
+
protected decrypt(buffer: Uint8Array): Uint8Array;
|
|
11
|
+
abstract initialize(): MaybePromise<void>;
|
|
12
|
+
abstract receive(): MaybePromise<Uint8Array>;
|
|
13
|
+
abstract send(buffer: Uint8Array): MaybePromise<void>;
|
|
14
|
+
abstract deinitialize(): MaybePromise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Connection } from "../connection/connection.js";
|
|
2
|
+
import { Transport } from "./transport.js";
|
|
3
|
+
export declare class TransportAbridged extends Transport implements Transport {
|
|
4
|
+
private readonly connection;
|
|
5
|
+
private readonly obfuscated;
|
|
6
|
+
constructor(connection: Connection, obfuscated?: boolean);
|
|
7
|
+
initialize(): Promise<void>;
|
|
8
|
+
receive(): Promise<Uint8Array>;
|
|
9
|
+
send(buffer: Uint8Array): Promise<void>;
|
|
10
|
+
deinitialize(): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Connection } from "../connection/connection.js";
|
|
2
|
+
import { Transport } from "./transport.js";
|
|
3
|
+
export declare class TransportIntermediate extends Transport implements Transport {
|
|
4
|
+
private readonly connection;
|
|
5
|
+
private readonly obfuscated;
|
|
6
|
+
constructor(connection: Connection, obfuscated?: boolean);
|
|
7
|
+
initialize(): Promise<void>;
|
|
8
|
+
receive(): Promise<Uint8Array>;
|
|
9
|
+
send(buffer: Uint8Array): Promise<void>;
|
|
10
|
+
deinitialize(): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Connection } from "../connection/connection.js";
|
|
2
|
+
import { Transport } from "./transport.js";
|
|
3
|
+
export type DC = "1" | "2" | "3" | "4" | "5" | "1-test" | "2-test" | "3-test";
|
|
4
|
+
export interface TransportProviderParams {
|
|
5
|
+
dc?: DC;
|
|
6
|
+
cdn: boolean;
|
|
7
|
+
}
|
|
8
|
+
export type TransportProvider = (params: TransportProviderParams) => {
|
|
9
|
+
connection: Connection;
|
|
10
|
+
transport: Transport;
|
|
11
|
+
dcId: number;
|
|
12
|
+
};
|
|
13
|
+
export interface TransportProviderCreatorParams {
|
|
14
|
+
initialDc: DC;
|
|
15
|
+
}
|
|
16
|
+
export type TransportProviderCreator = (params: TransportProviderCreatorParams) => TransportProvider;
|
|
17
|
+
export declare const defaultTransportProvider: TransportProviderCreator;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type MaybePromise<T> = T | Promise<T>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function modExp(a: bigint, b: bigint, n: bigint): bigint;
|
|
2
|
+
export declare function mod(n: bigint, m: bigint): bigint;
|
|
3
|
+
export declare function bigIntFromBuffer(buffer: Uint8Array, little?: boolean, signed?: boolean): bigint;
|
|
4
|
+
export declare function getRandomBigInt(byteLength: number, little?: boolean, signed?: boolean): bigint;
|
|
5
|
+
export declare function getRandomId(): bigint;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function rsaPad(data: Uint8Array, [serverKey, exponent]: [bigint, bigint]): Promise<Uint8Array>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Message } from "../tl/5_message.js";
|
|
2
|
+
import { MessageContainer } from "../tl/6_message_container.js";
|
|
3
|
+
export declare function getMessageId(): bigint;
|
|
4
|
+
export declare function packUnencryptedMessage(data: Uint8Array): Uint8Array;
|
|
5
|
+
export declare function unpackUnencryptedMessage(buffer: Uint8Array): {
|
|
6
|
+
messageId: bigint;
|
|
7
|
+
message: Uint8Array;
|
|
8
|
+
};
|
|
9
|
+
export declare function encryptMessage(message: Message, authKey: Uint8Array, authKeyId: bigint, salt: bigint, sessionId: bigint): Promise<Uint8Array>;
|
|
10
|
+
export declare function decryptMessage(buffer: Uint8Array, authKey: Uint8Array, authKeyId: bigint, _sessionId: bigint): Promise<Message | MessageContainer>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as types from "../tl/2_types.js";
|
|
2
|
+
import { sha256 } from "./0_hash.js";
|
|
3
|
+
export declare function isSafePrime(primeBytes: Uint8Array, g: number): boolean;
|
|
4
|
+
export declare const h: typeof sha256;
|
|
5
|
+
export declare const sh: (data: Uint8Array, salt: Uint8Array) => Promise<Uint8Array>;
|
|
6
|
+
export declare const ph1: (password: Uint8Array, salt1: Uint8Array, salt2: Uint8Array) => Promise<Uint8Array>;
|
|
7
|
+
export declare function pbkdf2(password: Uint8Array, salt: Uint8Array, iterations: number): Promise<Uint8Array>;
|
|
8
|
+
export declare const ph2: (password: Uint8Array, salt1: Uint8Array, salt2: Uint8Array) => Promise<Uint8Array>;
|
|
9
|
+
export declare function isGoodModExpFirst(modexp: bigint, prime: bigint): boolean;
|
|
10
|
+
export declare function pad(bigint: number | bigint | Uint8Array): Uint8Array;
|
|
11
|
+
export declare function checkPassword(password: Uint8Array, ap: types.AccountPassword): Promise<types.InputCheckPasswordSRP>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/gzip/gzip.d.ts
RENAMED
|
File without changes
|
/package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/utils/uint8.d.ts
RENAMED
|
File without changes
|
/package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/deflate.d.ts
RENAMED
|
File without changes
|
/package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/inflate.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
/package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/adler32.d.ts
RENAMED
|
File without changes
|
/package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/crc32.d.ts
RENAMED
|
File without changes
|
/package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/deflate.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
/package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/inffast.d.ts
RENAMED
|
File without changes
|
/package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/inflate.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/status.d.ts
RENAMED
|
File without changes
|
/package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/trees.d.ts
RENAMED
|
File without changes
|
/package/{types → esm}/deps/raw.githubusercontent.com/MTKruto/compress/master/zlib/zlib/zstream.d.ts
RENAMED
|
File without changes
|
/package/{types → esm}/deps.d.ts
RENAMED
|
File without changes
|
/package/{types → esm}/mod.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|