@mtkruto/node 0.0.820 → 0.0.822
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/client/client.d.ts +114 -0
- package/esm/client/client.js +126 -1
- 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/{types → esm}/tl/2_types.d.ts +48 -48
- package/esm/tl/2_types.js +180 -180
- package/esm/tl/2_types_test.d.ts +1 -0
- package/esm/tl/3_deserialize_test.d.ts +1 -0
- package/{types → esm}/tl/3_functions.d.ts +13 -13
- package/esm/tl/3_functions.js +39 -39
- 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/{types → esm}/utilities/1_password.d.ts +1 -1
- package/esm/utilities/1_password.js +2 -1
- 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 +114 -0
- package/script/client/client.js +127 -2
- 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.js +180 -180
- 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.js +39 -39
- 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.js +2 -1
- package/script/utilities/1_password_test.d.ts +1 -0
- package/types/client/client.d.ts +0 -50
- /package/{types → esm}/_dnt.shims.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/3_deserialize.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/script/tl/3_functions.js
CHANGED
|
@@ -1674,9 +1674,9 @@ class AccountUpdateProfile extends Function {
|
|
|
1674
1674
|
writable: true,
|
|
1675
1675
|
value: void 0
|
|
1676
1676
|
});
|
|
1677
|
-
this.firstName = params
|
|
1678
|
-
this.lastName = params
|
|
1679
|
-
this.about = params
|
|
1677
|
+
this.firstName = params?.firstName;
|
|
1678
|
+
this.lastName = params?.lastName;
|
|
1679
|
+
this.about = params?.about;
|
|
1680
1680
|
}
|
|
1681
1681
|
}
|
|
1682
1682
|
exports.AccountUpdateProfile = AccountUpdateProfile;
|
|
@@ -2779,13 +2779,13 @@ class AccountInitTakeoutSession extends Function {
|
|
|
2779
2779
|
writable: true,
|
|
2780
2780
|
value: void 0
|
|
2781
2781
|
});
|
|
2782
|
-
this.contacts = params
|
|
2783
|
-
this.messageUsers = params
|
|
2784
|
-
this.messageChats = params
|
|
2785
|
-
this.messageMegagroups = params
|
|
2786
|
-
this.messageChannels = params
|
|
2787
|
-
this.files = params
|
|
2788
|
-
this.fileMaxSize = params
|
|
2782
|
+
this.contacts = params?.contacts;
|
|
2783
|
+
this.messageUsers = params?.messageUsers;
|
|
2784
|
+
this.messageChats = params?.messageChats;
|
|
2785
|
+
this.messageMegagroups = params?.messageMegagroups;
|
|
2786
|
+
this.messageChannels = params?.messageChannels;
|
|
2787
|
+
this.files = params?.files;
|
|
2788
|
+
this.fileMaxSize = params?.fileMaxSize;
|
|
2789
2789
|
}
|
|
2790
2790
|
}
|
|
2791
2791
|
exports.AccountInitTakeoutSession = AccountInitTakeoutSession;
|
|
@@ -2813,7 +2813,7 @@ class AccountFinishTakeoutSession extends Function {
|
|
|
2813
2813
|
writable: true,
|
|
2814
2814
|
value: void 0
|
|
2815
2815
|
});
|
|
2816
|
-
this.success = params
|
|
2816
|
+
this.success = params?.success;
|
|
2817
2817
|
}
|
|
2818
2818
|
}
|
|
2819
2819
|
exports.AccountFinishTakeoutSession = AccountFinishTakeoutSession;
|
|
@@ -2946,8 +2946,8 @@ class AccountGetNotifyExceptions extends Function {
|
|
|
2946
2946
|
writable: true,
|
|
2947
2947
|
value: void 0
|
|
2948
2948
|
});
|
|
2949
|
-
this.compareSound = params
|
|
2950
|
-
this.peer = params
|
|
2949
|
+
this.compareSound = params?.compareSound;
|
|
2950
|
+
this.peer = params?.peer;
|
|
2951
2951
|
}
|
|
2952
2952
|
}
|
|
2953
2953
|
exports.AccountGetNotifyExceptions = AccountGetNotifyExceptions;
|
|
@@ -3453,10 +3453,10 @@ class AccountInstallTheme extends Function {
|
|
|
3453
3453
|
writable: true,
|
|
3454
3454
|
value: void 0
|
|
3455
3455
|
});
|
|
3456
|
-
this.dark = params
|
|
3457
|
-
this.theme = params
|
|
3458
|
-
this.format = params
|
|
3459
|
-
this.baseTheme = params
|
|
3456
|
+
this.dark = params?.dark;
|
|
3457
|
+
this.theme = params?.theme;
|
|
3458
|
+
this.format = params?.format;
|
|
3459
|
+
this.baseTheme = params?.baseTheme;
|
|
3460
3460
|
}
|
|
3461
3461
|
}
|
|
3462
3462
|
exports.AccountInstallTheme = AccountInstallTheme;
|
|
@@ -3554,7 +3554,7 @@ class AccountSetContentSettings extends Function {
|
|
|
3554
3554
|
writable: true,
|
|
3555
3555
|
value: void 0
|
|
3556
3556
|
});
|
|
3557
|
-
this.sensitiveEnabled = params
|
|
3557
|
+
this.sensitiveEnabled = params?.sensitiveEnabled;
|
|
3558
3558
|
}
|
|
3559
3559
|
}
|
|
3560
3560
|
exports.AccountSetContentSettings = AccountSetContentSettings;
|
|
@@ -8520,7 +8520,7 @@ class MessagesClearRecentStickers extends Function {
|
|
|
8520
8520
|
writable: true,
|
|
8521
8521
|
value: void 0
|
|
8522
8522
|
});
|
|
8523
|
-
this.attached = params
|
|
8523
|
+
this.attached = params?.attached;
|
|
8524
8524
|
}
|
|
8525
8525
|
}
|
|
8526
8526
|
exports.MessagesClearRecentStickers = MessagesClearRecentStickers;
|
|
@@ -10183,10 +10183,10 @@ class MessagesRequestURLAuth extends Function {
|
|
|
10183
10183
|
writable: true,
|
|
10184
10184
|
value: void 0
|
|
10185
10185
|
});
|
|
10186
|
-
this.peer = params
|
|
10187
|
-
this.msgId = params
|
|
10188
|
-
this.buttonId = params
|
|
10189
|
-
this.url = params
|
|
10186
|
+
this.peer = params?.peer;
|
|
10187
|
+
this.msgId = params?.msgId;
|
|
10188
|
+
this.buttonId = params?.buttonId;
|
|
10189
|
+
this.url = params?.url;
|
|
10190
10190
|
}
|
|
10191
10191
|
}
|
|
10192
10192
|
exports.MessagesRequestURLAuth = MessagesRequestURLAuth;
|
|
@@ -10246,11 +10246,11 @@ class MessagesAcceptURLAuth extends Function {
|
|
|
10246
10246
|
writable: true,
|
|
10247
10247
|
value: void 0
|
|
10248
10248
|
});
|
|
10249
|
-
this.writeAllowed = params
|
|
10250
|
-
this.peer = params
|
|
10251
|
-
this.msgId = params
|
|
10252
|
-
this.buttonId = params
|
|
10253
|
-
this.url = params
|
|
10249
|
+
this.writeAllowed = params?.writeAllowed;
|
|
10250
|
+
this.peer = params?.peer;
|
|
10251
|
+
this.msgId = params?.msgId;
|
|
10252
|
+
this.buttonId = params?.buttonId;
|
|
10253
|
+
this.url = params?.url;
|
|
10254
10254
|
}
|
|
10255
10255
|
}
|
|
10256
10256
|
exports.MessagesAcceptURLAuth = MessagesAcceptURLAuth;
|
|
@@ -10940,7 +10940,7 @@ class MessagesDeletePhoneCallHistory extends Function {
|
|
|
10940
10940
|
writable: true,
|
|
10941
10941
|
value: void 0
|
|
10942
10942
|
});
|
|
10943
|
-
this.revoke = params
|
|
10943
|
+
this.revoke = params?.revoke;
|
|
10944
10944
|
}
|
|
10945
10945
|
}
|
|
10946
10946
|
exports.MessagesDeletePhoneCallHistory = MessagesDeletePhoneCallHistory;
|
|
@@ -13768,12 +13768,12 @@ class PhotosUploadProfilePhoto extends Function {
|
|
|
13768
13768
|
writable: true,
|
|
13769
13769
|
value: void 0
|
|
13770
13770
|
});
|
|
13771
|
-
this.fallback = params
|
|
13772
|
-
this.bot = params
|
|
13773
|
-
this.file = params
|
|
13774
|
-
this.video = params
|
|
13775
|
-
this.videoStartTs = params
|
|
13776
|
-
this.videoEmojiMarkup = params
|
|
13771
|
+
this.fallback = params?.fallback;
|
|
13772
|
+
this.bot = params?.bot;
|
|
13773
|
+
this.file = params?.file;
|
|
13774
|
+
this.video = params?.video;
|
|
13775
|
+
this.videoStartTs = params?.videoStartTs;
|
|
13776
|
+
this.videoEmojiMarkup = params?.videoEmojiMarkup;
|
|
13777
13777
|
}
|
|
13778
13778
|
}
|
|
13779
13779
|
exports.PhotosUploadProfilePhoto = PhotosUploadProfilePhoto;
|
|
@@ -15662,8 +15662,8 @@ class ChannelsGetAdminedPublicChannels extends Function {
|
|
|
15662
15662
|
writable: true,
|
|
15663
15663
|
value: void 0
|
|
15664
15664
|
});
|
|
15665
|
-
this.byLocation = params
|
|
15666
|
-
this.checkLimit = params
|
|
15665
|
+
this.byLocation = params?.byLocation;
|
|
15666
|
+
this.checkLimit = params?.checkLimit;
|
|
15667
15667
|
}
|
|
15668
15668
|
}
|
|
15669
15669
|
exports.ChannelsGetAdminedPublicChannels = ChannelsGetAdminedPublicChannels;
|
|
@@ -17715,8 +17715,8 @@ class PaymentsClearSavedInfo extends Function {
|
|
|
17715
17715
|
writable: true,
|
|
17716
17716
|
value: void 0
|
|
17717
17717
|
});
|
|
17718
|
-
this.credentials = params
|
|
17719
|
-
this.info = params
|
|
17718
|
+
this.credentials = params?.credentials;
|
|
17719
|
+
this.info = params?.info;
|
|
17720
17720
|
}
|
|
17721
17721
|
}
|
|
17722
17722
|
exports.PaymentsClearSavedInfo = PaymentsClearSavedInfo;
|
|
@@ -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_: string, ap: types.AccountPassword): Promise<types.InputCheckPasswordSRP>;
|
|
@@ -102,7 +102,8 @@ function pad(bigint) {
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
exports.pad = pad;
|
|
105
|
-
async function checkPassword(
|
|
105
|
+
async function checkPassword(password_, ap) {
|
|
106
|
+
const password = new TextEncoder().encode(password_);
|
|
106
107
|
const algo = ap.currentAlgo;
|
|
107
108
|
if (!(algo instanceof
|
|
108
109
|
types.PasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow)) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/types/client/client.d.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { MaybePromise } from "../types.js";
|
|
2
|
-
import * as types from "../tl/2_types.js";
|
|
3
|
-
import * as functions from "../tl/3_functions.js";
|
|
4
|
-
import { ClientAbstract } from "./client_abstract.js";
|
|
5
|
-
import { Session } from "../session/session.js";
|
|
6
|
-
import { DC, TransportProvider } from "../transport/transport_provider.js";
|
|
7
|
-
export interface AuthorizeUserParams<S = string, N = {
|
|
8
|
-
first: S;
|
|
9
|
-
last: S;
|
|
10
|
-
}> {
|
|
11
|
-
phone: S | (() => MaybePromise<S>);
|
|
12
|
-
code: S | (() => MaybePromise<S>);
|
|
13
|
-
password: S | (() => MaybePromise<S>);
|
|
14
|
-
names: N | (() => MaybePromise<N>);
|
|
15
|
-
}
|
|
16
|
-
export type UpdatesHandler = null | ((client: Client, update: types.Updates) => MaybePromise<void>);
|
|
17
|
-
export declare class Client extends ClientAbstract {
|
|
18
|
-
readonly session: Session;
|
|
19
|
-
readonly apiId: number;
|
|
20
|
-
readonly apiHash: string;
|
|
21
|
-
private sessionId;
|
|
22
|
-
private state;
|
|
23
|
-
private promises;
|
|
24
|
-
private toAcknowledge;
|
|
25
|
-
updatesHandler: UpdatesHandler;
|
|
26
|
-
readonly appVersion: string;
|
|
27
|
-
readonly deviceModel: string;
|
|
28
|
-
readonly langCode: string;
|
|
29
|
-
readonly langPack: string;
|
|
30
|
-
readonly systemLangCode: string;
|
|
31
|
-
readonly systemVersion: string;
|
|
32
|
-
constructor(session?: Session, apiId?: number, apiHash?: string, params?: {
|
|
33
|
-
transportProvider?: TransportProvider;
|
|
34
|
-
appVersion?: string;
|
|
35
|
-
deviceModel?: string;
|
|
36
|
-
langCode?: string;
|
|
37
|
-
langPack?: string;
|
|
38
|
-
systemLangCode?: string;
|
|
39
|
-
systemVersion?: string;
|
|
40
|
-
});
|
|
41
|
-
private shouldLoadSession;
|
|
42
|
-
setDc(dc: DC): void;
|
|
43
|
-
connect(): Promise<void>;
|
|
44
|
-
authorize(params: string | types.AuthExportedAuthorization | AuthorizeUserParams): Promise<void>;
|
|
45
|
-
private receiveLoop;
|
|
46
|
-
private pingLoop;
|
|
47
|
-
invoke<T extends (functions.Function<unknown> | types.Type) = functions.Function<unknown>>(function_: T): Promise<T extends functions.Function<unknown> ? T["__R"] : void>;
|
|
48
|
-
invoke<T extends (functions.Function<unknown> | types.Type) = functions.Function<unknown>>(function_: T, noWait: true): Promise<void>;
|
|
49
|
-
send<T extends (functions.Function<unknown> | types.Type) = functions.Function<unknown>>(function_: T): Promise<void>;
|
|
50
|
-
}
|
|
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
|