@mtkruto/node 0.78.0 → 0.78.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.
- package/esm/0_errors.d.ts +1 -0
- package/esm/0_errors.d.ts.map +1 -1
- package/esm/0_errors.js +5 -0
- package/esm/3_types.d.ts +3 -0
- package/esm/3_types.d.ts.map +1 -1
- package/esm/3_types.js +3 -0
- package/esm/4_constants.d.ts +1 -0
- package/esm/4_constants.d.ts.map +1 -1
- package/esm/4_constants.js +2 -0
- package/esm/5_client.d.ts +6 -1
- package/esm/5_client.d.ts.map +1 -1
- package/esm/5_client.js +6 -1
- package/esm/_dnt.polyfills.d.ts +13 -13
- package/esm/_dnt.polyfills.d.ts.map +1 -1
- package/esm/_dnt.polyfills.js +11 -11
- package/esm/client/0_worker_request.d.ts +26 -0
- package/esm/client/0_worker_request.d.ts.map +1 -0
- package/esm/client/0_worker_request.js +20 -0
- package/esm/client/0_worker_response.d.ts +39 -0
- package/esm/client/0_worker_response.d.ts.map +1 -0
- package/esm/client/0_worker_response.js +20 -0
- package/esm/client/1_client_generic.d.ts +1602 -0
- package/esm/client/1_client_generic.d.ts.map +1 -0
- package/esm/client/1_client_generic.js +24 -0
- package/esm/client/2_account_manager.d.ts +6 -1
- package/esm/client/2_account_manager.d.ts.map +1 -1
- package/esm/client/2_account_manager.js +84 -0
- package/esm/client/2_context.d.ts +114 -0
- package/esm/client/2_context.d.ts.map +1 -0
- package/esm/client/2_context.js +453 -0
- package/esm/client/2_file_manager.d.ts.map +1 -1
- package/esm/client/2_file_manager.js +3 -4
- package/esm/client/2_sign_in.d.ts +25 -0
- package/esm/client/2_sign_in.d.ts.map +1 -0
- package/esm/client/2_sign_in.js +114 -0
- package/esm/client/{0_filters.d.ts → 3_filters.d.ts} +6 -3
- package/esm/client/3_filters.d.ts.map +1 -0
- package/esm/client/3_filters_test.d.ts.map +1 -0
- package/esm/client/{1_composer.d.ts → 4_composer.d.ts} +12 -11
- package/esm/client/4_composer.d.ts.map +1 -0
- package/esm/client/{1_composer.js → 4_composer.js} +17 -7
- package/esm/client/4_composer_test.d.ts.map +1 -0
- package/esm/client/5_client.d.ts +43 -179
- package/esm/client/5_client.d.ts.map +1 -1
- package/esm/client/5_client.js +141 -595
- package/esm/client/5_client_dispatcher.d.ts +1660 -0
- package/esm/client/5_client_dispatcher.d.ts.map +1 -0
- package/esm/client/5_client_dispatcher.js +2141 -0
- package/esm/client/6_client_worker.d.ts +27 -0
- package/esm/client/6_client_worker.d.ts.map +1 -0
- package/esm/client/6_client_worker.js +51 -0
- package/esm/types/0_bot_token_check_result.d.ts +29 -0
- package/esm/types/0_bot_token_check_result.d.ts.map +1 -0
- package/esm/types/0_bot_token_check_result.js +20 -0
- package/esm/types/0_code_check_result.d.ts +37 -0
- package/esm/types/0_code_check_result.d.ts.map +1 -0
- package/esm/types/0_code_check_result.js +20 -0
- package/esm/types/0_password_check_result.d.ts +33 -0
- package/esm/types/0_password_check_result.d.ts.map +1 -0
- package/esm/types/0_password_check_result.js +20 -0
- package/package.json +1 -1
- package/script/0_errors.d.ts +1 -0
- package/script/0_errors.d.ts.map +1 -1
- package/script/0_errors.js +5 -0
- package/script/3_types.d.ts +3 -0
- package/script/3_types.d.ts.map +1 -1
- package/script/3_types.js +3 -0
- package/script/4_constants.d.ts +1 -0
- package/script/4_constants.d.ts.map +1 -1
- package/script/4_constants.js +3 -1
- package/script/5_client.d.ts +6 -1
- package/script/5_client.d.ts.map +1 -1
- package/script/5_client.js +6 -1
- package/script/_dnt.polyfills.d.ts +13 -13
- package/script/_dnt.polyfills.d.ts.map +1 -1
- package/script/_dnt.polyfills.js +11 -11
- package/script/client/0_worker_request.d.ts +26 -0
- package/script/client/0_worker_request.d.ts.map +1 -0
- package/script/client/0_worker_request.js +21 -0
- package/script/client/0_worker_response.d.ts +39 -0
- package/script/client/0_worker_response.d.ts.map +1 -0
- package/script/client/0_worker_response.js +21 -0
- package/script/client/1_client_generic.d.ts +1602 -0
- package/script/client/1_client_generic.d.ts.map +1 -0
- package/script/client/1_client_generic.js +28 -0
- package/script/client/2_account_manager.d.ts +6 -1
- package/script/client/2_account_manager.d.ts.map +1 -1
- package/script/client/2_account_manager.js +84 -0
- package/script/client/2_context.d.ts +114 -0
- package/script/client/2_context.d.ts.map +1 -0
- package/script/client/2_context.js +457 -0
- package/script/client/2_file_manager.d.ts.map +1 -1
- package/script/client/2_file_manager.js +2 -3
- package/script/client/2_sign_in.d.ts +25 -0
- package/script/client/2_sign_in.d.ts.map +1 -0
- package/script/client/2_sign_in.js +118 -0
- package/script/client/{0_filters.d.ts → 3_filters.d.ts} +6 -3
- package/script/client/3_filters.d.ts.map +1 -0
- package/script/client/3_filters_test.d.ts.map +1 -0
- package/script/client/{1_composer.d.ts → 4_composer.d.ts} +12 -11
- package/script/client/4_composer.d.ts.map +1 -0
- package/script/client/{1_composer.js → 4_composer.js} +17 -7
- package/script/client/4_composer_test.d.ts.map +1 -0
- package/script/client/5_client.d.ts +43 -179
- package/script/client/5_client.d.ts.map +1 -1
- package/script/client/5_client.js +140 -594
- package/script/client/5_client_dispatcher.d.ts +1660 -0
- package/script/client/5_client_dispatcher.d.ts.map +1 -0
- package/script/client/5_client_dispatcher.js +2178 -0
- package/script/client/6_client_worker.d.ts +27 -0
- package/script/client/6_client_worker.d.ts.map +1 -0
- package/script/client/6_client_worker.js +55 -0
- package/script/types/0_bot_token_check_result.d.ts +29 -0
- package/script/types/0_bot_token_check_result.d.ts.map +1 -0
- package/script/types/0_bot_token_check_result.js +21 -0
- package/script/types/0_code_check_result.d.ts +37 -0
- package/script/types/0_code_check_result.d.ts.map +1 -0
- package/script/types/0_code_check_result.js +21 -0
- package/script/types/0_password_check_result.d.ts +33 -0
- package/script/types/0_password_check_result.d.ts.map +1 -0
- package/script/types/0_password_check_result.js +21 -0
- package/esm/client/0_filters.d.ts.map +0 -1
- package/esm/client/0_filters_test.d.ts.map +0 -1
- package/esm/client/1_composer.d.ts.map +0 -1
- package/script/client/0_filters.d.ts.map +0 -1
- package/script/client/0_filters_test.d.ts.map +0 -1
- package/script/client/1_composer.d.ts.map +0 -1
- /package/esm/client/{0_filters.js → 3_filters.js} +0 -0
- /package/script/client/{0_filters.js → 3_filters.js} +0 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
import { ClientDispatcher, type ClientDispatcherParams } from "./5_client_dispatcher.js";
|
|
21
|
+
export declare class ClientWorker {
|
|
22
|
+
#private;
|
|
23
|
+
constructor(specifier: string | URL, options?: WorkerOptions);
|
|
24
|
+
terminate(): void;
|
|
25
|
+
createClient(params?: ClientDispatcherParams): Promise<ClientDispatcher>;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=6_client_worker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"6_client_worker.d.ts","sourceRoot":"","sources":["../../src/client/6_client_worker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAEzF,qBAAa,YAAY;;gBAMX,SAAS,EAAE,MAAM,GAAG,GAAG,EAAE,OAAO,CAAC,EAAE,aAAa;IAU5D,SAAS;IAIH,YAAY,CAAC,MAAM,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAY/E"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
import { getLogger } from "../utilities/1_logger.js";
|
|
21
|
+
import { ClientDispatcher } from "./5_client_dispatcher.js";
|
|
22
|
+
export class ClientWorker {
|
|
23
|
+
#worker;
|
|
24
|
+
#idCounter = 0;
|
|
25
|
+
#clients = new Array();
|
|
26
|
+
#L = getLogger("ClientWorker");
|
|
27
|
+
constructor(specifier, options) {
|
|
28
|
+
this.#worker = new Worker(specifier, options);
|
|
29
|
+
this.#worker.addEventListener("message", (e) => {
|
|
30
|
+
this.#L.debug("received message from worker", e.data);
|
|
31
|
+
const response = e.data;
|
|
32
|
+
this.#clients[response.clientId]?.handleResponse(response);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
terminate() {
|
|
36
|
+
this.#worker.terminate();
|
|
37
|
+
}
|
|
38
|
+
async createClient(params) {
|
|
39
|
+
const clientId = this.#idCounter++;
|
|
40
|
+
const client = new ClientDispatcher(this.#worker, clientId);
|
|
41
|
+
this.#clients.push(client);
|
|
42
|
+
try {
|
|
43
|
+
await client.init(params);
|
|
44
|
+
}
|
|
45
|
+
catch (err) {
|
|
46
|
+
this.#clients = this.#clients.filter((v) => v !== client);
|
|
47
|
+
throw err;
|
|
48
|
+
}
|
|
49
|
+
return client;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
export declare namespace BotTokenCheckResult {
|
|
21
|
+
/** The bot token was correct. The bot was signed in. */
|
|
22
|
+
interface SignedIn {
|
|
23
|
+
type: "signed_in";
|
|
24
|
+
userId: number;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/** A result after checking a sent code. */
|
|
28
|
+
export type BotTokenCheckResult = BotTokenCheckResult.SignedIn;
|
|
29
|
+
//# sourceMappingURL=0_bot_token_check_result.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"0_bot_token_check_result.d.ts","sourceRoot":"","sources":["../../src/types/0_bot_token_check_result.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,CAAC,OAAO,WAAW,mBAAmB,CAAC;IAC3C,wDAAwD;IACxD,UAAiB,QAAQ;QACvB,IAAI,EAAE,WAAW,CAAC;QAClB,MAAM,EAAE,MAAM,CAAC;KAChB;CACF;AAED,2CAA2C;AAC3C,MAAM,MAAM,mBAAmB,GAAG,mBAAmB,CAAC,QAAQ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
export declare namespace CodeCheckResult {
|
|
21
|
+
/** The code was correct, but an additional password is required to sign in. */
|
|
22
|
+
interface PasswordRequired {
|
|
23
|
+
type: "password_required";
|
|
24
|
+
}
|
|
25
|
+
/** The code entered was incorrect. */
|
|
26
|
+
interface InvalidCode {
|
|
27
|
+
type: "invalid_code";
|
|
28
|
+
}
|
|
29
|
+
/** The code was correct. The user was signed in. */
|
|
30
|
+
interface SignedIn {
|
|
31
|
+
type: "signed_in";
|
|
32
|
+
userId: number;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/** A result after checking a sent code. */
|
|
36
|
+
export type CodeCheckResult = CodeCheckResult.PasswordRequired | CodeCheckResult.InvalidCode | CodeCheckResult.SignedIn;
|
|
37
|
+
//# sourceMappingURL=0_code_check_result.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"0_code_check_result.d.ts","sourceRoot":"","sources":["../../src/types/0_code_check_result.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,CAAC,OAAO,WAAW,eAAe,CAAC;IACvC,+EAA+E;IAC/E,UAAiB,gBAAgB;QAC/B,IAAI,EAAE,mBAAmB,CAAC;KAC3B;IAED,sCAAsC;IACtC,UAAiB,WAAW;QAC1B,IAAI,EAAE,cAAc,CAAC;KACtB;IAED,oDAAoD;IACpD,UAAiB,QAAQ;QACvB,IAAI,EAAE,WAAW,CAAC;QAClB,MAAM,EAAE,MAAM,CAAC;KAChB;CACF;AAED,2CAA2C;AAC3C,MAAM,MAAM,eAAe,GAAG,eAAe,CAAC,gBAAgB,GAAG,eAAe,CAAC,WAAW,GAAG,eAAe,CAAC,QAAQ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
export declare namespace PasswordCheckResult {
|
|
21
|
+
/** The password entered was incorrect. */
|
|
22
|
+
interface InvalidPassword {
|
|
23
|
+
type: "invalid_password";
|
|
24
|
+
}
|
|
25
|
+
/** The password was correct. The user was signed in. */
|
|
26
|
+
interface SignedIn {
|
|
27
|
+
type: "signed_in";
|
|
28
|
+
userId: number;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/** A result after checking a sent code. */
|
|
32
|
+
export type PasswordCheckResult = PasswordCheckResult.InvalidPassword | PasswordCheckResult.SignedIn;
|
|
33
|
+
//# sourceMappingURL=0_password_check_result.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"0_password_check_result.d.ts","sourceRoot":"","sources":["../../src/types/0_password_check_result.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,CAAC,OAAO,WAAW,mBAAmB,CAAC;IAC3C,0CAA0C;IAC1C,UAAiB,eAAe;QAC9B,IAAI,EAAE,kBAAkB,CAAC;KAC1B;IAED,wDAAwD;IACxD,UAAiB,QAAQ;QACvB,IAAI,EAAE,WAAW,CAAC;QAClB,MAAM,EAAE,MAAM,CAAC;KAChB;CACF;AAED,2CAA2C;AAC3C,MAAM,MAAM,mBAAmB,GAAG,mBAAmB,CAAC,eAAe,GAAG,mBAAmB,CAAC,QAAQ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
export {};
|
package/package.json
CHANGED
package/script/0_errors.d.ts
CHANGED
package/script/0_errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"0_errors.d.ts","sourceRoot":"","sources":["../src/0_errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,8BAAsB,YAAa,SAAQ,KAAK;CAC/C;AAED,qBAAa,eAAgB,SAAQ,YAAY;gBACnC,GAAG,IAAI,EAAE,qBAAqB,CAAC,OAAO,KAAK,CAAC;CAIzD;AAED,qBAAa,WAAY,SAAQ,YAAY;gBAC/B,GAAG,IAAI,EAAE,qBAAqB,CAAC,OAAO,KAAK,CAAC;CAIzD;AAED,qBAAa,UAAW,SAAQ,YAAY;gBAC9B,GAAG,IAAI,EAAE,qBAAqB,CAAC,OAAO,KAAK,CAAC;CAIzD;AAED,qBAAa,cAAe,SAAQ,YAAY;aAClB,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM;CAIzC;AAED,qBAAa,OAAQ,SAAQ,YAAY;;IAC9B,IAAI,SAAa;
|
|
1
|
+
{"version":3,"file":"0_errors.d.ts","sourceRoot":"","sources":["../src/0_errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,8BAAsB,YAAa,SAAQ,KAAK;CAC/C;AAED,qBAAa,eAAgB,SAAQ,YAAY;gBACnC,GAAG,IAAI,EAAE,qBAAqB,CAAC,OAAO,KAAK,CAAC;CAIzD;AAED,qBAAa,WAAY,SAAQ,YAAY;gBAC/B,GAAG,IAAI,EAAE,qBAAqB,CAAC,OAAO,KAAK,CAAC;CAIzD;AAED,qBAAa,UAAW,SAAQ,YAAY;gBAC9B,GAAG,IAAI,EAAE,qBAAqB,CAAC,OAAO,KAAK,CAAC;CAIzD;AAED,qBAAa,cAAe,SAAQ,YAAY;aAClB,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM;CAIzC;AAED,qBAAa,OAAQ,SAAQ,YAAY;;IAC9B,IAAI,SAAa;gBAId,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE;IAM3C,IAAI,eAAe,IAAI,MAAM,CAE5B;IAED,IAAI,IAAI,IAAI,MAAM,EAAE,CAEnB;CACF"}
|
package/script/0_errors.js
CHANGED
|
@@ -55,11 +55,16 @@ class TransportError extends MtkrutoError {
|
|
|
55
55
|
exports.TransportError = TransportError;
|
|
56
56
|
class TLError extends MtkrutoError {
|
|
57
57
|
name = "TLError";
|
|
58
|
+
#originalMessage;
|
|
58
59
|
#path;
|
|
59
60
|
constructor(message, path) {
|
|
60
61
|
super(`${message}${path.length ? ` at ${path.join(" ")}` : ""}`);
|
|
62
|
+
this.#originalMessage = message;
|
|
61
63
|
this.#path = path;
|
|
62
64
|
}
|
|
65
|
+
get originalMessage() {
|
|
66
|
+
return this.#originalMessage;
|
|
67
|
+
}
|
|
63
68
|
get path() {
|
|
64
69
|
return this.#path;
|
|
65
70
|
}
|
package/script/3_types.d.ts
CHANGED
|
@@ -22,12 +22,14 @@ export * from "./types/_getters.js";
|
|
|
22
22
|
export * from "./types/0_authorization_state.js";
|
|
23
23
|
export * from "./types/0_birthday.js";
|
|
24
24
|
export * from "./types/0_bot_command.js";
|
|
25
|
+
export * from "./types/0_bot_token_check_result.js";
|
|
25
26
|
export * from "./types/0_callback_query_answer.js";
|
|
26
27
|
export * from "./types/0_callback_query_question.js";
|
|
27
28
|
export * from "./types/0_chat_action.js";
|
|
28
29
|
export * from "./types/0_chat_administrator_rights.js";
|
|
29
30
|
export * from "./types/0_chat_member_rights.js";
|
|
30
31
|
export * from "./types/0_chat_photo.js";
|
|
32
|
+
export * from "./types/0_code_check_result.js";
|
|
31
33
|
export * from "./types/0_connection_state.js";
|
|
32
34
|
export * from "./types/0_contact.js";
|
|
33
35
|
export * from "./types/0_dice.js";
|
|
@@ -50,6 +52,7 @@ export * from "./types/0_mini_app_mode.js";
|
|
|
50
52
|
export * from "./types/0_network_statistics_entry.js";
|
|
51
53
|
export * from "./types/0_opening_hours.js";
|
|
52
54
|
export * from "./types/0_parse_mode.js";
|
|
55
|
+
export * from "./types/0_password_check_result.js";
|
|
53
56
|
export * from "./types/0_price_tag.js";
|
|
54
57
|
export * from "./types/0_reaction.js";
|
|
55
58
|
export * from "./types/0_refunded_payment.js";
|
package/script/3_types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"3_types.d.ts","sourceRoot":"","sources":["../src/3_types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kCAAkC,CAAC;AACjD,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oCAAo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,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC"}
|
package/script/3_types.js
CHANGED
|
@@ -38,12 +38,14 @@ __exportStar(require("./types/_getters.js"), exports);
|
|
|
38
38
|
__exportStar(require("./types/0_authorization_state.js"), exports);
|
|
39
39
|
__exportStar(require("./types/0_birthday.js"), exports);
|
|
40
40
|
__exportStar(require("./types/0_bot_command.js"), exports);
|
|
41
|
+
__exportStar(require("./types/0_bot_token_check_result.js"), exports);
|
|
41
42
|
__exportStar(require("./types/0_callback_query_answer.js"), exports);
|
|
42
43
|
__exportStar(require("./types/0_callback_query_question.js"), exports);
|
|
43
44
|
__exportStar(require("./types/0_chat_action.js"), exports);
|
|
44
45
|
__exportStar(require("./types/0_chat_administrator_rights.js"), exports);
|
|
45
46
|
__exportStar(require("./types/0_chat_member_rights.js"), exports);
|
|
46
47
|
__exportStar(require("./types/0_chat_photo.js"), exports);
|
|
48
|
+
__exportStar(require("./types/0_code_check_result.js"), exports);
|
|
47
49
|
__exportStar(require("./types/0_connection_state.js"), exports);
|
|
48
50
|
__exportStar(require("./types/0_contact.js"), exports);
|
|
49
51
|
__exportStar(require("./types/0_dice.js"), exports);
|
|
@@ -66,6 +68,7 @@ __exportStar(require("./types/0_mini_app_mode.js"), exports);
|
|
|
66
68
|
__exportStar(require("./types/0_network_statistics_entry.js"), exports);
|
|
67
69
|
__exportStar(require("./types/0_opening_hours.js"), exports);
|
|
68
70
|
__exportStar(require("./types/0_parse_mode.js"), exports);
|
|
71
|
+
__exportStar(require("./types/0_password_check_result.js"), exports);
|
|
69
72
|
__exportStar(require("./types/0_price_tag.js"), exports);
|
|
70
73
|
__exportStar(require("./types/0_reaction.js"), exports);
|
|
71
74
|
__exportStar(require("./types/0_refunded_payment.js"), exports);
|
package/script/4_constants.d.ts
CHANGED
|
@@ -14,4 +14,5 @@ export declare const MAX_CHAT_ID = 999999999999;
|
|
|
14
14
|
export declare const MAX_CHANNEL_ID = 997852516352;
|
|
15
15
|
export declare const CHANNEL_DIFFERENCE_LIMIT_USER = 100;
|
|
16
16
|
export declare const CHANNEL_DIFFERENCE_LIMIT_BOT = 100000;
|
|
17
|
+
export declare const DOWNLOAD_MAX_CHUNK_SIZE: number;
|
|
17
18
|
//# sourceMappingURL=4_constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"4_constants.d.ts","sourceRoot":"","sources":["../src/4_constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"4_constants.d.ts","sourceRoot":"","sources":["../src/4_constants.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAE3C,MAAM,MAAM,UAAU,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;AAE/D,eAAO,MAAM,WAAW,EAAE,UAkDxB,CAAC;AAEH,eAAO,MAAM,UAAU,EAAE,EAAQ,CAAC;AAElC,eAAO,MAAM,WAAW,YAAY,CAAC;AAGrC,eAAO,MAAM,YAAY,EAAE,MAA+Q,CAAC;AAE3S,eAAO,MAAM,SAAS,EAAE,MAA6H,CAAC;AAEtJ,eAAO,MAAM,SAAS,KAAK,CAAC;AAE5B,eAAO,MAAM,gBAAgB,QAAY,CAAC;AAG1C,eAAO,MAAM,cAAc,QAA2I,CAAC;AAEvK,eAAO,MAAM,YAAY,QAAS,CAAC;AAEnC,eAAO,MAAM,oBAAoB,SAAU,CAAC;AAE5C,eAAO,MAAM,WAAW,eAAe,CAAC;AAExC,eAAO,MAAM,cAAc,eAAe,CAAC;AAE3C,eAAO,MAAM,6BAA6B,MAAM,CAAC;AAEjD,eAAO,MAAM,4BAA4B,SAAU,CAAC;AAEpD,eAAO,MAAM,uBAAuB,QAAe,CAAC"}
|
package/script/4_constants.js
CHANGED
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.CHANNEL_DIFFERENCE_LIMIT_BOT = exports.CHANNEL_DIFFERENCE_LIMIT_USER = exports.MAX_CHANNEL_ID = exports.MAX_CHAT_ID = exports.STICKER_SET_NAME_TTL = exports.USERNAME_TTL = exports.SYSTEM_VERSION = exports.SYSTEM_LANG_CODE = exports.LANG_PACK = exports.LANG_CODE = exports.DEVICE_MODEL = exports.APP_VERSION = exports.INITIAL_DC = exports.PUBLIC_KEYS = void 0;
|
|
36
|
+
exports.DOWNLOAD_MAX_CHUNK_SIZE = exports.CHANNEL_DIFFERENCE_LIMIT_BOT = exports.CHANNEL_DIFFERENCE_LIMIT_USER = exports.MAX_CHANNEL_ID = exports.MAX_CHAT_ID = exports.STICKER_SET_NAME_TTL = exports.USERNAME_TTL = exports.SYSTEM_VERSION = exports.SYSTEM_LANG_CODE = exports.LANG_PACK = exports.LANG_CODE = exports.DEVICE_MODEL = exports.APP_VERSION = exports.INITIAL_DC = exports.PUBLIC_KEYS = void 0;
|
|
37
37
|
/**
|
|
38
38
|
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
39
39
|
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
@@ -54,6 +54,7 @@ exports.CHANNEL_DIFFERENCE_LIMIT_BOT = exports.CHANNEL_DIFFERENCE_LIMIT_USER = e
|
|
|
54
54
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
55
55
|
*/
|
|
56
56
|
const dntShim = __importStar(require("./_dnt.shims.js"));
|
|
57
|
+
const _1_utilities_js_1 = require("./1_utilities.js");
|
|
57
58
|
exports.PUBLIC_KEYS = Object.freeze([
|
|
58
59
|
[
|
|
59
60
|
1562291298945373506n,
|
|
@@ -120,3 +121,4 @@ exports.MAX_CHAT_ID = 999999999999;
|
|
|
120
121
|
exports.MAX_CHANNEL_ID = 997852516352;
|
|
121
122
|
exports.CHANNEL_DIFFERENCE_LIMIT_USER = 100;
|
|
122
123
|
exports.CHANNEL_DIFFERENCE_LIMIT_BOT = 100_000;
|
|
124
|
+
exports.DOWNLOAD_MAX_CHUNK_SIZE = 1 * _1_utilities_js_1.megabyte;
|
package/script/5_client.d.ts
CHANGED
|
@@ -18,7 +18,12 @@
|
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
20
|
export * from "./client/0_params.js";
|
|
21
|
-
export * from "./client/
|
|
21
|
+
export * from "./client/0_worker_request.js";
|
|
22
|
+
export * from "./client/0_worker_response.js";
|
|
22
23
|
export * from "./client/1_client_plain.js";
|
|
24
|
+
export * from "./client/2_client_encrypted.js";
|
|
25
|
+
export * from "./client/4_composer.js";
|
|
23
26
|
export * from "./client/5_client.js";
|
|
27
|
+
export * from "./client/5_client_dispatcher.js";
|
|
28
|
+
export * from "./client/6_client_worker.js";
|
|
24
29
|
//# sourceMappingURL=5_client.d.ts.map
|
package/script/5_client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"5_client.d.ts","sourceRoot":"","sources":["../src/5_client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,
|
|
1
|
+
{"version":3,"file":"5_client.d.ts","sourceRoot":"","sources":["../src/5_client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC"}
|
package/script/5_client.js
CHANGED
|
@@ -34,6 +34,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
34
34
|
};
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
__exportStar(require("./client/0_params.js"), exports);
|
|
37
|
-
__exportStar(require("./client/
|
|
37
|
+
__exportStar(require("./client/0_worker_request.js"), exports);
|
|
38
|
+
__exportStar(require("./client/0_worker_response.js"), exports);
|
|
38
39
|
__exportStar(require("./client/1_client_plain.js"), exports);
|
|
40
|
+
__exportStar(require("./client/2_client_encrypted.js"), exports);
|
|
41
|
+
__exportStar(require("./client/4_composer.js"), exports);
|
|
39
42
|
__exportStar(require("./client/5_client.js"), exports);
|
|
43
|
+
__exportStar(require("./client/5_client_dispatcher.js"), exports);
|
|
44
|
+
__exportStar(require("./client/6_client_worker.js"), exports);
|
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
interface ArrayConstructor {
|
|
3
|
-
fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | Promise<T>> | ArrayLike<T | Promise<T>>): Promise<T[]>;
|
|
4
|
-
fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>) => U, thisArg?: any): Promise<Awaited<U>[]>;
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
export {};
|
|
8
|
-
declare global {
|
|
9
|
-
interface Error {
|
|
10
|
-
cause?: unknown;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
export {};
|
|
14
1
|
declare global {
|
|
15
2
|
interface PromiseConstructor {
|
|
16
3
|
/**
|
|
@@ -24,6 +11,19 @@ declare global {
|
|
|
24
11
|
};
|
|
25
12
|
}
|
|
26
13
|
}
|
|
14
|
+
declare global {
|
|
15
|
+
interface ArrayConstructor {
|
|
16
|
+
fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | Promise<T>> | ArrayLike<T | Promise<T>>): Promise<T[]>;
|
|
17
|
+
fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>) => U, thisArg?: any): Promise<Awaited<U>[]>;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
21
|
+
declare global {
|
|
22
|
+
interface Error {
|
|
23
|
+
cause?: unknown;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
27
27
|
/**
|
|
28
28
|
* Based on [import-meta-ponyfill](https://github.com/gaubee/import-meta-ponyfill),
|
|
29
29
|
* but instead of using npm to install additional dependencies,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_dnt.polyfills.d.ts","sourceRoot":"","sources":["../src/_dnt.polyfills.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"_dnt.polyfills.d.ts","sourceRoot":"","sources":["../src/_dnt.polyfills.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,CAAC;IAEb,UAAU,kBAAkB;QAC1B;;;WAGG;QACH,aAAa,CAAC,CAAC,KAAK;YAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;YAAC,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;YAAC,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,IAAI,CAAA;SAAE,CAAC;KAC3H;CACF;AAcD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,gBAAgB;QACxB,SAAS,CAAC,CAAC,EACP,mBAAmB,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAA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IAClC,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,GAAG,UAAU,CAAC;CACxD;AACD,UAAU,0BAA0B;IAClC,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CAAC;CACtC;AACD,UAAU,kBACR,SAAQ,0BAA0B,EAAE,0BAA0B;CAC/D;AAiBD,eAAO,IAAI,6BAA6B,EA2BnC,0BAA0B,CAAC;AAMhC,eAAO,IAAI,6BAA6B,EA4DnC,0BAA0B,CAAC;AAMhC,eAAO,IAAI,oBAAoB,EAoB1B,kBAAkB,CAAC"}
|
package/script/_dnt.polyfills.js
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.import_meta_ponyfill = exports.import_meta_ponyfill_esmodule = exports.import_meta_ponyfill_commonjs = void 0;
|
|
4
|
+
// https://github.com/tc39/proposal-promise-with-resolvers/blob/3a78801e073e99217dbeb2c43ba7212f3bdc8b83/polyfills.js#L1C1-L9C2
|
|
5
|
+
if (Promise.withResolvers === undefined) {
|
|
6
|
+
Promise.withResolvers = () => {
|
|
7
|
+
const out = {};
|
|
8
|
+
out.promise = new Promise((resolve_, reject_) => {
|
|
9
|
+
out.resolve = resolve_;
|
|
10
|
+
out.reject = reject_;
|
|
11
|
+
});
|
|
12
|
+
return out;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
4
15
|
// From https://github.com/es-shims/array-from-async/blob/4a5ff83947b861f35b380d5d4f20da2f07698638/index.mjs
|
|
5
16
|
// Tried to have dnt depend on the package instead, but it distributes as an
|
|
6
17
|
// ES module, so doesn't work with CommonJS.
|
|
@@ -110,17 +121,6 @@ async function fromAsync(items, mapfn, thisArg) {
|
|
|
110
121
|
if (!Array.fromAsync) {
|
|
111
122
|
Array.fromAsync = fromAsync;
|
|
112
123
|
}
|
|
113
|
-
// https://github.com/tc39/proposal-promise-with-resolvers/blob/3a78801e073e99217dbeb2c43ba7212f3bdc8b83/polyfills.js#L1C1-L9C2
|
|
114
|
-
if (Promise.withResolvers === undefined) {
|
|
115
|
-
Promise.withResolvers = () => {
|
|
116
|
-
const out = {};
|
|
117
|
-
out.promise = new Promise((resolve_, reject_) => {
|
|
118
|
-
out.resolve = resolve_;
|
|
119
|
-
out.reject = reject_;
|
|
120
|
-
});
|
|
121
|
-
return out;
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
124
|
/**
|
|
125
125
|
* Based on [import-meta-ponyfill](https://github.com/gaubee/import-meta-ponyfill),
|
|
126
126
|
* but instead of using npm to install additional dependencies,
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
export interface WorkerRequest {
|
|
21
|
+
clientId: number;
|
|
22
|
+
id: number;
|
|
23
|
+
method: "initClient" | string;
|
|
24
|
+
args: unknown[];
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=0_worker_request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"0_worker_request.d.ts","sourceRoot":"","sources":["../../src/client/0_worker_request.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,YAAY,GAAG,MAAM,CAAC;IAC9B,IAAI,EAAE,OAAO,EAAE,CAAC;CACjB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
4
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
5
|
+
*
|
|
6
|
+
* This file is part of MTKruto.
|
|
7
|
+
*
|
|
8
|
+
* This program is free software: you can redistribute it and/or modify
|
|
9
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
10
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
* (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* This program is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
* GNU Lesser General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
19
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
export interface WorkerError {
|
|
21
|
+
name: "TelegramError" | "ConnectionError" | "AccessError" | "InputError" | "TransportError" | "TLError";
|
|
22
|
+
args: any;
|
|
23
|
+
}
|
|
24
|
+
export declare namespace WorkerResponse {
|
|
25
|
+
interface Base {
|
|
26
|
+
clientId: number;
|
|
27
|
+
id: number;
|
|
28
|
+
}
|
|
29
|
+
interface Error extends Base {
|
|
30
|
+
isError: true;
|
|
31
|
+
data: WorkerError;
|
|
32
|
+
}
|
|
33
|
+
interface Data extends Base {
|
|
34
|
+
isError: false;
|
|
35
|
+
data: unknown;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export type WorkerResponse = WorkerResponse.Error | WorkerResponse.Data;
|
|
39
|
+
//# sourceMappingURL=0_worker_response.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"0_worker_response.d.ts","sourceRoot":"","sources":["../../src/client/0_worker_response.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,eAAe,GAAG,iBAAiB,GAAG,aAAa,GAAG,YAAY,GAAG,gBAAgB,GAAG,SAAS,CAAC;IAExG,IAAI,EAAE,GAAG,CAAC;CACX;AAED,MAAM,CAAC,OAAO,WAAW,cAAc,CAAC;IACtC,UAAiB,IAAI;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,EAAE,EAAE,MAAM,CAAC;KACZ;IAED,UAAiB,KAAM,SAAQ,IAAI;QACjC,OAAO,EAAE,IAAI,CAAC;QACd,IAAI,EAAE,WAAW,CAAC;KACnB;IAED,UAAiB,IAAK,SAAQ,IAAI;QAChC,OAAO,EAAE,KAAK,CAAC;QACf,IAAI,EAAE,OAAO,CAAC;KACf;CACF;AAED,MAAM,MAAM,cAAc,GAAG,cAAc,CAAC,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC"}
|