@tgsnake/skema 1.12.0 → 2.0.0-browser.0
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/LICENSE +1 -1
- package/README.md +125 -16
- package/dist/mod.d.ts +10 -0
- package/dist/mod.js +10 -0
- package/dist/src/Logger.d.ts +20 -0
- package/dist/src/Logger.js +23 -0
- package/dist/src/deps.d.ts +29 -0
- package/dist/src/deps.js +34 -0
- package/dist/src/errors/Base.d.ts +53 -0
- package/dist/src/errors/Base.js +114 -0
- package/dist/src/errors/Client.d.ts +69 -0
- package/dist/src/errors/Client.js +69 -0
- package/dist/src/errors/File.d.ts +89 -0
- package/dist/src/errors/File.js +99 -0
- package/dist/src/errors/RpcError.d.ts +115 -0
- package/dist/src/errors/RpcError.js +226 -0
- package/dist/src/errors/SecretChat.d.ts +78 -0
- package/dist/src/errors/SecretChat.js +88 -0
- package/dist/src/errors/WebSocket.d.ts +70 -0
- package/dist/src/errors/WebSocket.js +80 -0
- package/dist/{errors → src/errors}/exceptions/All.d.ts +14 -0
- package/dist/{errors → src/errors}/exceptions/All.js +15 -5
- package/dist/{errors → src/errors}/exceptions/BadRequest400.d.ts +15 -1
- package/dist/src/errors/exceptions/BadRequest400.js +2683 -0
- package/dist/{errors → src/errors}/exceptions/Flood420.d.ts +15 -1
- package/dist/{errors → src/errors}/exceptions/Flood420.js +25 -24
- package/dist/{errors → src/errors}/exceptions/Forbidden403.d.ts +15 -1
- package/dist/src/errors/exceptions/Forbidden403.js +243 -0
- package/dist/{errors → src/errors}/exceptions/InternalServerError500.d.ts +15 -1
- package/dist/src/errors/exceptions/InternalServerError500.js +255 -0
- package/dist/{errors → src/errors}/exceptions/NotAcceptable406.d.ts +15 -1
- package/dist/{errors → src/errors}/exceptions/NotAcceptable406.js +51 -76
- package/dist/src/errors/exceptions/NotFound404.d.ts +27 -0
- package/dist/src/errors/exceptions/NotFound404.js +27 -0
- package/dist/src/errors/exceptions/SeeOther303.d.ts +39 -0
- package/dist/src/errors/exceptions/SeeOther303.js +39 -0
- package/dist/src/errors/exceptions/ServiceUnavailable503.d.ts +31 -0
- package/dist/src/errors/exceptions/ServiceUnavailable503.js +31 -0
- package/dist/{errors → src/errors}/exceptions/Unauthorized401.d.ts +15 -1
- package/dist/src/errors/exceptions/Unauthorized401.js +55 -0
- package/dist/src/errors/exceptions/index.d.ts +24 -0
- package/dist/src/errors/exceptions/index.js +24 -0
- package/dist/src/errors/index.d.ts +142 -0
- package/dist/src/errors/index.js +178 -0
- package/dist/src/helpers.d.ts +102 -0
- package/dist/src/helpers.js +176 -0
- package/dist/src/index.d.ts +12 -0
- package/dist/src/index.js +12 -0
- package/dist/{raw → src/raw}/All.d.ts +47 -5
- package/dist/{raw → src/raw}/All.js +48 -9
- package/dist/{raw → src/raw}/Raw.d.ts +17546 -9
- package/dist/{raw → src/raw}/Raw.js +44899 -21694
- package/dist/src/raw/UpdateSecretChat.d.ts +186 -0
- package/dist/src/raw/UpdateSecretChat.js +215 -0
- package/dist/src/raw/core/GzipPacked.d.ts +63 -0
- package/dist/src/raw/core/GzipPacked.js +76 -0
- package/dist/src/raw/core/Message.d.ts +68 -0
- package/dist/src/raw/core/Message.js +105 -0
- package/dist/src/raw/core/MsgContainer.d.ts +56 -0
- package/dist/src/raw/core/MsgContainer.js +77 -0
- package/dist/src/raw/core/TLObject.d.ts +108 -0
- package/dist/src/raw/core/TLObject.js +209 -0
- package/dist/src/raw/core/index.d.ts +19 -0
- package/dist/src/raw/core/index.js +19 -0
- package/dist/src/raw/core/primitive/Bool.d.ts +104 -0
- package/dist/src/raw/core/primitive/Bool.js +120 -0
- package/dist/src/raw/core/primitive/Bytes.d.ts +45 -0
- package/dist/src/raw/core/primitive/Bytes.js +76 -0
- package/dist/src/raw/core/primitive/Double.d.ts +37 -0
- package/dist/src/raw/core/primitive/Double.js +51 -0
- package/dist/src/raw/core/primitive/Float.d.ts +37 -0
- package/dist/src/raw/core/primitive/Float.js +51 -0
- package/dist/src/raw/core/primitive/Int.d.ts +144 -0
- package/dist/src/raw/core/primitive/Int.js +237 -0
- package/dist/src/raw/core/primitive/String.d.ts +37 -0
- package/dist/src/raw/core/primitive/String.js +42 -0
- package/dist/src/raw/core/primitive/Vector.d.ts +56 -0
- package/dist/src/raw/core/primitive/Vector.js +93 -0
- package/dist/src/raw/core/primitive/index.d.ts +20 -0
- package/dist/src/raw/core/primitive/index.js +20 -0
- package/dist/src/raw/index.d.ts +17 -0
- package/dist/src/raw/index.js +17 -0
- package/package.json +54 -50
- package/dist/Logger.d.ts +0 -3
- package/dist/Logger.js +0 -9
- package/dist/deps.d.ts +0 -8
- package/dist/deps.js +0 -19
- package/dist/errors/Base.d.ts +0 -9
- package/dist/errors/Base.js +0 -50
- package/dist/errors/Client.d.ts +0 -21
- package/dist/errors/Client.js +0 -29
- package/dist/errors/File.d.ts +0 -13
- package/dist/errors/File.js +0 -30
- package/dist/errors/RpcError.d.ts +0 -22
- package/dist/errors/RpcError.js +0 -120
- package/dist/errors/SecretChat.d.ts +0 -13
- package/dist/errors/SecretChat.js +0 -30
- package/dist/errors/WebSocket.d.ts +0 -13
- package/dist/errors/WebSocket.js +0 -30
- package/dist/errors/exceptions/BadRequest400.js +0 -3352
- package/dist/errors/exceptions/Forbidden403.js +0 -290
- package/dist/errors/exceptions/InternalServerError500.js +0 -305
- package/dist/errors/exceptions/NotFound404.d.ts +0 -13
- package/dist/errors/exceptions/NotFound404.js +0 -19
- package/dist/errors/exceptions/SeeOther303.d.ts +0 -25
- package/dist/errors/exceptions/SeeOther303.js +0 -34
- package/dist/errors/exceptions/ServiceUnavailable503.d.ts +0 -17
- package/dist/errors/exceptions/ServiceUnavailable503.js +0 -24
- package/dist/errors/exceptions/Unauthorized401.js +0 -54
- package/dist/errors/exceptions/index.d.ts +0 -10
- package/dist/errors/exceptions/index.js +0 -48
- package/dist/errors/index.d.ts +0 -31
- package/dist/errors/index.js +0 -111
- package/dist/helpers.d.ts +0 -6
- package/dist/helpers.js +0 -85
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -34
- package/dist/raw/UpdateSecretChat.d.ts +0 -43
- package/dist/raw/UpdateSecretChat.js +0 -91
- package/dist/raw/core/GzipPacked.d.ts +0 -9
- package/dist/raw/core/GzipPacked.js +0 -59
- package/dist/raw/core/Message.d.ts +0 -12
- package/dist/raw/core/Message.js +0 -80
- package/dist/raw/core/MsgContainer.d.ts +0 -10
- package/dist/raw/core/MsgContainer.js +0 -68
- package/dist/raw/core/TLObject.d.ts +0 -18
- package/dist/raw/core/TLObject.js +0 -108
- package/dist/raw/core/index.d.ts +0 -6
- package/dist/raw/core/index.js +0 -46
- package/dist/raw/core/primitive/Bool.d.ts +0 -19
- package/dist/raw/core/primitive/Bool.js +0 -41
- package/dist/raw/core/primitive/Bytes.d.ts +0 -6
- package/dist/raw/core/primitive/Bytes.js +0 -41
- package/dist/raw/core/primitive/Double.d.ts +0 -6
- package/dist/raw/core/primitive/Double.js +0 -24
- package/dist/raw/core/primitive/Float.d.ts +0 -6
- package/dist/raw/core/primitive/Float.js +0 -24
- package/dist/raw/core/primitive/Int.d.ts +0 -22
- package/dist/raw/core/primitive/Int.js +0 -122
- package/dist/raw/core/primitive/String.d.ts +0 -6
- package/dist/raw/core/primitive/String.js +0 -15
- package/dist/raw/core/primitive/Vector.d.ts +0 -8
- package/dist/raw/core/primitive/Vector.js +0 -49
- package/dist/raw/core/primitive/index.d.ts +0 -7
- package/dist/raw/core/primitive/index.js +0 -22
- package/dist/raw/index.d.ts +0 -4
- package/dist/raw/index.js +0 -17
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UserMigrate = exports.StatsMigrate = exports.PhoneMigrate = exports.NetworkMigrate = exports.FileMigrate = exports.SeeOther = void 0;
|
|
4
|
-
const RpcError_js_1 = require("@/errors/RpcError.js");
|
|
5
|
-
class SeeOther extends RpcError_js_1.RPCError {
|
|
6
|
-
code = 303;
|
|
7
|
-
name = 'SEE_OTHER';
|
|
8
|
-
}
|
|
9
|
-
exports.SeeOther = SeeOther;
|
|
10
|
-
class FileMigrate extends SeeOther {
|
|
11
|
-
id = 'FILE_MIGRATE_X';
|
|
12
|
-
message = 'The file to be accessed is currently stored in DC{value}';
|
|
13
|
-
}
|
|
14
|
-
exports.FileMigrate = FileMigrate;
|
|
15
|
-
class NetworkMigrate extends SeeOther {
|
|
16
|
-
id = 'NETWORK_MIGRATE_X';
|
|
17
|
-
message = 'Your IP address is associated to DC {value}, please re-send the query to that DC.';
|
|
18
|
-
}
|
|
19
|
-
exports.NetworkMigrate = NetworkMigrate;
|
|
20
|
-
class PhoneMigrate extends SeeOther {
|
|
21
|
-
id = 'PHONE_MIGRATE_X';
|
|
22
|
-
message = 'Your phone number is associated to DC {value}, please re-send the query to that DC.';
|
|
23
|
-
}
|
|
24
|
-
exports.PhoneMigrate = PhoneMigrate;
|
|
25
|
-
class StatsMigrate extends SeeOther {
|
|
26
|
-
id = 'STATS_MIGRATE_X';
|
|
27
|
-
message = 'Channel statistics for the specified channel are stored on DC {value}, please re-send the query to that DC.';
|
|
28
|
-
}
|
|
29
|
-
exports.StatsMigrate = StatsMigrate;
|
|
30
|
-
class UserMigrate extends SeeOther {
|
|
31
|
-
id = 'USER_MIGRATE_X';
|
|
32
|
-
message = 'Your account is associated to DC {value}, please re-send the query to that DC.';
|
|
33
|
-
}
|
|
34
|
-
exports.UserMigrate = UserMigrate;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { RPCError } from '@/errors/RpcError.js';
|
|
2
|
-
export declare class ServiceUnavailable extends RPCError {
|
|
3
|
-
code: number;
|
|
4
|
-
name: string;
|
|
5
|
-
}
|
|
6
|
-
export declare class ApiCallError extends ServiceUnavailable {
|
|
7
|
-
id: string;
|
|
8
|
-
message: string;
|
|
9
|
-
}
|
|
10
|
-
export declare class MsgWaitTimeout extends ServiceUnavailable {
|
|
11
|
-
id: string;
|
|
12
|
-
message: string;
|
|
13
|
-
}
|
|
14
|
-
export declare class Timeout extends ServiceUnavailable {
|
|
15
|
-
id: string;
|
|
16
|
-
message: string;
|
|
17
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Timeout = exports.MsgWaitTimeout = exports.ApiCallError = exports.ServiceUnavailable = void 0;
|
|
4
|
-
const RpcError_js_1 = require("@/errors/RpcError.js");
|
|
5
|
-
class ServiceUnavailable extends RpcError_js_1.RPCError {
|
|
6
|
-
code = 503;
|
|
7
|
-
name = 'SERVICE_UNAVAILABLE';
|
|
8
|
-
}
|
|
9
|
-
exports.ServiceUnavailable = ServiceUnavailable;
|
|
10
|
-
class ApiCallError extends ServiceUnavailable {
|
|
11
|
-
id = 'ApiCallError';
|
|
12
|
-
message = 'Telegram is having internal problems. Please try again later.';
|
|
13
|
-
}
|
|
14
|
-
exports.ApiCallError = ApiCallError;
|
|
15
|
-
class MsgWaitTimeout extends ServiceUnavailable {
|
|
16
|
-
id = 'MSG_WAIT_TIMEOUT';
|
|
17
|
-
message = 'Spent too much time waiting for a previous query in the invokeAfterMsg request queue, aborting!';
|
|
18
|
-
}
|
|
19
|
-
exports.MsgWaitTimeout = MsgWaitTimeout;
|
|
20
|
-
class Timeout extends ServiceUnavailable {
|
|
21
|
-
id = 'Timeout';
|
|
22
|
-
message = 'Timeout while fetching data.';
|
|
23
|
-
}
|
|
24
|
-
exports.Timeout = Timeout;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UserDeactivatedBan = exports.UserDeactivated = exports.SessionRevoked = exports.SessionPasswordNeeded = exports.SessionExpired = exports.AuthKeyUnregistered = exports.AuthKeyPermEmpty = exports.AuthKeyInvalid = exports.ActiveUserRequired = exports.Unauthorized = void 0;
|
|
4
|
-
const RpcError_js_1 = require("@/errors/RpcError.js");
|
|
5
|
-
class Unauthorized extends RpcError_js_1.RPCError {
|
|
6
|
-
code = 401;
|
|
7
|
-
name = 'UNAUTHORIZED';
|
|
8
|
-
}
|
|
9
|
-
exports.Unauthorized = Unauthorized;
|
|
10
|
-
class ActiveUserRequired extends Unauthorized {
|
|
11
|
-
id = 'ACTIVE_USER_REQUIRED';
|
|
12
|
-
message = 'The method is only available to already activated users';
|
|
13
|
-
}
|
|
14
|
-
exports.ActiveUserRequired = ActiveUserRequired;
|
|
15
|
-
class AuthKeyInvalid extends Unauthorized {
|
|
16
|
-
id = 'AUTH_KEY_INVALID';
|
|
17
|
-
message = 'The specified auth key is invalid.';
|
|
18
|
-
}
|
|
19
|
-
exports.AuthKeyInvalid = AuthKeyInvalid;
|
|
20
|
-
class AuthKeyPermEmpty extends Unauthorized {
|
|
21
|
-
id = 'AUTH_KEY_PERM_EMPTY';
|
|
22
|
-
message = 'The method is unavailable for temporary authorization keys, not bound to a permanent authorization key.';
|
|
23
|
-
}
|
|
24
|
-
exports.AuthKeyPermEmpty = AuthKeyPermEmpty;
|
|
25
|
-
class AuthKeyUnregistered extends Unauthorized {
|
|
26
|
-
id = 'AUTH_KEY_UNREGISTERED';
|
|
27
|
-
message = 'The specified authorization key is not registered in the system (for example, a PFS temporary key has expired).';
|
|
28
|
-
}
|
|
29
|
-
exports.AuthKeyUnregistered = AuthKeyUnregistered;
|
|
30
|
-
class SessionExpired extends Unauthorized {
|
|
31
|
-
id = 'SESSION_EXPIRED';
|
|
32
|
-
message = 'The session has expired.';
|
|
33
|
-
}
|
|
34
|
-
exports.SessionExpired = SessionExpired;
|
|
35
|
-
class SessionPasswordNeeded extends Unauthorized {
|
|
36
|
-
id = 'SESSION_PASSWORD_NEEDED';
|
|
37
|
-
message = '2FA is enabled, use a password to login.';
|
|
38
|
-
}
|
|
39
|
-
exports.SessionPasswordNeeded = SessionPasswordNeeded;
|
|
40
|
-
class SessionRevoked extends Unauthorized {
|
|
41
|
-
id = 'SESSION_REVOKED';
|
|
42
|
-
message = 'The session was revoked by the user.';
|
|
43
|
-
}
|
|
44
|
-
exports.SessionRevoked = SessionRevoked;
|
|
45
|
-
class UserDeactivated extends Unauthorized {
|
|
46
|
-
id = 'USER_DEACTIVATED';
|
|
47
|
-
message = 'The current account was deleted by the user.';
|
|
48
|
-
}
|
|
49
|
-
exports.UserDeactivated = UserDeactivated;
|
|
50
|
-
class UserDeactivatedBan extends Unauthorized {
|
|
51
|
-
id = 'USER_DEACTIVATED_BAN';
|
|
52
|
-
message = "The current account was deleted and banned by Telegram's antispam system.";
|
|
53
|
-
}
|
|
54
|
-
exports.UserDeactivatedBan = UserDeactivatedBan;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { count, Exceptions } from '@/errors/exceptions/All.js';
|
|
2
|
-
export * as SeeOther from '@/errors/exceptions/SeeOther303.js';
|
|
3
|
-
export * as BadRequest from '@/errors/exceptions/BadRequest400.js';
|
|
4
|
-
export * as Unauthorized from '@/errors/exceptions/Unauthorized401.js';
|
|
5
|
-
export * as Forbidden from '@/errors/exceptions/Forbidden403.js';
|
|
6
|
-
export * as NotFound from '@/errors/exceptions/NotFound404.js';
|
|
7
|
-
export * as NotAcceptable from '@/errors/exceptions/NotAcceptable406.js';
|
|
8
|
-
export * as Flood from '@/errors/exceptions/Flood420.js';
|
|
9
|
-
export * as InternalServerError from '@/errors/exceptions/InternalServerError500.js';
|
|
10
|
-
export * as ServiceUnavailable from '@/errors/exceptions/ServiceUnavailable503.js';
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.ServiceUnavailable = exports.InternalServerError = exports.Flood = exports.NotAcceptable = exports.NotFound = exports.Forbidden = exports.Unauthorized = exports.BadRequest = exports.SeeOther = exports.Exceptions = exports.count = void 0;
|
|
37
|
-
var All_js_1 = require("@/errors/exceptions/All.js");
|
|
38
|
-
Object.defineProperty(exports, "count", { enumerable: true, get: function () { return All_js_1.count; } });
|
|
39
|
-
Object.defineProperty(exports, "Exceptions", { enumerable: true, get: function () { return All_js_1.Exceptions; } });
|
|
40
|
-
exports.SeeOther = __importStar(require("@/errors/exceptions/SeeOther303.js"));
|
|
41
|
-
exports.BadRequest = __importStar(require("@/errors/exceptions/BadRequest400.js"));
|
|
42
|
-
exports.Unauthorized = __importStar(require("@/errors/exceptions/Unauthorized401.js"));
|
|
43
|
-
exports.Forbidden = __importStar(require("@/errors/exceptions/Forbidden403.js"));
|
|
44
|
-
exports.NotFound = __importStar(require("@/errors/exceptions/NotFound404.js"));
|
|
45
|
-
exports.NotAcceptable = __importStar(require("@/errors/exceptions/NotAcceptable406.js"));
|
|
46
|
-
exports.Flood = __importStar(require("@/errors/exceptions/Flood420.js"));
|
|
47
|
-
exports.InternalServerError = __importStar(require("@/errors/exceptions/InternalServerError500.js"));
|
|
48
|
-
exports.ServiceUnavailable = __importStar(require("@/errors/exceptions/ServiceUnavailable503.js"));
|
package/dist/errors/index.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export * as Exceptions from '@/errors/exceptions/index.js';
|
|
2
|
-
export * as ClientError from '@/errors/Client.js';
|
|
3
|
-
export * as WSError from '@/errors/WebSocket.js';
|
|
4
|
-
export * as SecretChatError from '@/errors/SecretChat.js';
|
|
5
|
-
export * as FileErrors from '@/errors/File.js';
|
|
6
|
-
export { RPCError, UnknownError } from '@/errors/RpcError.js';
|
|
7
|
-
import { BaseError } from '@/errors/Base.js';
|
|
8
|
-
export declare class TimeoutError extends BaseError {
|
|
9
|
-
timeout: number;
|
|
10
|
-
constructor(timeout: number);
|
|
11
|
-
}
|
|
12
|
-
export declare class NotAFunctionClass extends BaseError {
|
|
13
|
-
message: string;
|
|
14
|
-
description: string;
|
|
15
|
-
constructor(className: string);
|
|
16
|
-
}
|
|
17
|
-
export declare class BadMsgNotification extends BaseError {
|
|
18
|
-
constructor(code: number);
|
|
19
|
-
}
|
|
20
|
-
export declare class SecurityError extends BaseError {
|
|
21
|
-
constructor(description?: string);
|
|
22
|
-
static check(cond: boolean, description?: string): void;
|
|
23
|
-
}
|
|
24
|
-
export declare class SecurityCheckMismatch extends SecurityError {
|
|
25
|
-
message: string;
|
|
26
|
-
static check(cond: boolean, description?: string): void;
|
|
27
|
-
}
|
|
28
|
-
export declare class CDNFileHashMismatch extends SecurityError {
|
|
29
|
-
message: string;
|
|
30
|
-
static check(cond: boolean, description?: string): void;
|
|
31
|
-
}
|
package/dist/errors/index.js
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.CDNFileHashMismatch = exports.SecurityCheckMismatch = exports.SecurityError = exports.BadMsgNotification = exports.NotAFunctionClass = exports.TimeoutError = exports.UnknownError = exports.RPCError = exports.FileErrors = exports.SecretChatError = exports.WSError = exports.ClientError = exports.Exceptions = void 0;
|
|
37
|
-
exports.Exceptions = __importStar(require("@/errors/exceptions/index.js"));
|
|
38
|
-
exports.ClientError = __importStar(require("@/errors/Client.js"));
|
|
39
|
-
exports.WSError = __importStar(require("@/errors/WebSocket.js"));
|
|
40
|
-
exports.SecretChatError = __importStar(require("@/errors/SecretChat.js"));
|
|
41
|
-
exports.FileErrors = __importStar(require("@/errors/File.js"));
|
|
42
|
-
var RpcError_js_1 = require("@/errors/RpcError.js");
|
|
43
|
-
Object.defineProperty(exports, "RPCError", { enumerable: true, get: function () { return RpcError_js_1.RPCError; } });
|
|
44
|
-
Object.defineProperty(exports, "UnknownError", { enumerable: true, get: function () { return RpcError_js_1.UnknownError; } });
|
|
45
|
-
const Base_js_1 = require("@/errors/Base.js");
|
|
46
|
-
class TimeoutError extends Base_js_1.BaseError {
|
|
47
|
-
timeout;
|
|
48
|
-
constructor(timeout) {
|
|
49
|
-
super();
|
|
50
|
-
this.message = `Running timeout after ${timeout} ms`;
|
|
51
|
-
this.timeout = timeout;
|
|
52
|
-
this.description = `The function is running too long, until it reaches the time limit that has been given.`;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
exports.TimeoutError = TimeoutError;
|
|
56
|
-
class NotAFunctionClass extends Base_js_1.BaseError {
|
|
57
|
-
message = '{value} is not a function.';
|
|
58
|
-
description = "The provided class {value} is not a function constructor, can't sending request with that class.";
|
|
59
|
-
constructor(className) {
|
|
60
|
-
super();
|
|
61
|
-
this.message = this.message.replace('{value}', className);
|
|
62
|
-
this.description = this.description.replace('{value}', className);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
exports.NotAFunctionClass = NotAFunctionClass;
|
|
66
|
-
class BadMsgNotification extends Base_js_1.BaseError {
|
|
67
|
-
constructor(code) {
|
|
68
|
-
const description = {
|
|
69
|
-
16: 'The msg_id is too low, the client time has to be synchronized.',
|
|
70
|
-
17: 'The msg_id is too high, the client time has to be synchronized.',
|
|
71
|
-
18: 'Incorrect two lower order of the msg_id bits, the server expects the client message\nmsg_id to be divisible by 4.',
|
|
72
|
-
19: 'The container msg_id is the same as the msg_id of a previously received message.',
|
|
73
|
-
20: 'The message is too old, it cannot be verified by the server.',
|
|
74
|
-
32: 'The msg_seqno is too low.',
|
|
75
|
-
33: 'The msg_seqno is too high.',
|
|
76
|
-
34: 'An even msg_seqno was expected, but an odd one was received.',
|
|
77
|
-
35: 'An odd msg_seqno was expected, but an even one was received.',
|
|
78
|
-
48: 'Incorrect server salt.',
|
|
79
|
-
64: 'Invalid container.',
|
|
80
|
-
};
|
|
81
|
-
super(`[${code}] ${description[code] ?? 'Unknown Error'}`);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
exports.BadMsgNotification = BadMsgNotification;
|
|
85
|
-
class SecurityError extends Base_js_1.BaseError {
|
|
86
|
-
constructor(description) {
|
|
87
|
-
super();
|
|
88
|
-
this.description = description;
|
|
89
|
-
}
|
|
90
|
-
static check(cond, description) {
|
|
91
|
-
if (!cond)
|
|
92
|
-
throw new SecurityError(description);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
exports.SecurityError = SecurityError;
|
|
96
|
-
class SecurityCheckMismatch extends SecurityError {
|
|
97
|
-
message = 'A security check mismatch has occurred.';
|
|
98
|
-
static check(cond, description) {
|
|
99
|
-
if (!cond)
|
|
100
|
-
throw new SecurityCheckMismatch(description);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
exports.SecurityCheckMismatch = SecurityCheckMismatch;
|
|
104
|
-
class CDNFileHashMismatch extends SecurityError {
|
|
105
|
-
message = 'A CDN file hash mismatch has occurred.';
|
|
106
|
-
static check(cond, description) {
|
|
107
|
-
if (!cond)
|
|
108
|
-
throw new CDNFileHashMismatch(description);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
exports.CDNFileHashMismatch = CDNFileHashMismatch;
|
package/dist/helpers.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Buffer } from '@/deps.js';
|
|
2
|
-
export declare function bigintToBuffer(int: bigint, padding: number, litte?: boolean, signed?: boolean): Buffer<ArrayBuffer>;
|
|
3
|
-
export declare function bigIntPow(x: bigint, y: bigint, z?: bigint): bigint;
|
|
4
|
-
export declare function mod(n: number, m: number): number;
|
|
5
|
-
export declare function bigIntMod(n: bigint, m: bigint): bigint;
|
|
6
|
-
export declare function bufferToBigint(buffer: Buffer, little?: boolean, signed?: boolean): bigint;
|
package/dist/helpers.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.bigintToBuffer = bigintToBuffer;
|
|
4
|
-
exports.bigIntPow = bigIntPow;
|
|
5
|
-
exports.mod = mod;
|
|
6
|
-
exports.bigIntMod = bigIntMod;
|
|
7
|
-
exports.bufferToBigint = bufferToBigint;
|
|
8
|
-
const deps_js_1 = require("@/deps.js");
|
|
9
|
-
function bigintToBuffer(int, padding, litte = true, signed = false) {
|
|
10
|
-
const bigintLength = int.toString(2).length;
|
|
11
|
-
const bytes = Math.ceil(bigintLength / 8);
|
|
12
|
-
if (padding < bytes) {
|
|
13
|
-
throw new Error("Too big, Can't convert it to buffer with that padding.");
|
|
14
|
-
}
|
|
15
|
-
if (!signed && int < BigInt(0)) {
|
|
16
|
-
throw new Error('Too small, can convert it when unsigned.');
|
|
17
|
-
}
|
|
18
|
-
let isBellow = false;
|
|
19
|
-
if (int < BigInt(0)) {
|
|
20
|
-
isBellow = true;
|
|
21
|
-
int = int * BigInt(-1);
|
|
22
|
-
}
|
|
23
|
-
const hex = int.toString(16).padStart(padding * 2, '0');
|
|
24
|
-
let buffer = deps_js_1.Buffer.from(hex, 'hex');
|
|
25
|
-
if (litte)
|
|
26
|
-
buffer = buffer.reverse();
|
|
27
|
-
if (isBellow && signed) {
|
|
28
|
-
if (litte) {
|
|
29
|
-
let isReminder = false;
|
|
30
|
-
if (buffer[0])
|
|
31
|
-
buffer[0] -= 1;
|
|
32
|
-
for (let b = 0; b < deps_js_1.Buffer.byteLength(buffer); b++) {
|
|
33
|
-
if (!buffer[b]) {
|
|
34
|
-
isReminder = true;
|
|
35
|
-
continue;
|
|
36
|
-
}
|
|
37
|
-
if (isReminder) {
|
|
38
|
-
buffer[b] -= 1;
|
|
39
|
-
isReminder = false;
|
|
40
|
-
}
|
|
41
|
-
buffer[b] = 255 - buffer[b];
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
buffer[deps_js_1.Buffer.byteLength(buffer) - 1] =
|
|
46
|
-
256 - buffer[deps_js_1.Buffer.byteLength(buffer) - 1];
|
|
47
|
-
for (let b = 0; b < deps_js_1.Buffer.byteLength(buffer); b++) {
|
|
48
|
-
buffer[b] = 255 - buffer[b];
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return buffer;
|
|
53
|
-
}
|
|
54
|
-
function bigIntPow(x, y, z) {
|
|
55
|
-
if (z === undefined) {
|
|
56
|
-
return x ** y;
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
let result = BigInt(1);
|
|
60
|
-
while (y > BigInt(0)) {
|
|
61
|
-
if (bigIntMod(y, BigInt(2)) === BigInt(1)) {
|
|
62
|
-
result = bigIntMod(result * x, z);
|
|
63
|
-
}
|
|
64
|
-
y = y >> BigInt(1);
|
|
65
|
-
x = bigIntMod(x * x, z);
|
|
66
|
-
}
|
|
67
|
-
return result;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
function mod(n, m) {
|
|
71
|
-
return ((n % m) + m) % m;
|
|
72
|
-
}
|
|
73
|
-
function bigIntMod(n, m) {
|
|
74
|
-
return ((n % m) + m) % m;
|
|
75
|
-
}
|
|
76
|
-
function bufferToBigint(buffer, little = true, signed = false) {
|
|
77
|
-
const length = deps_js_1.Buffer.byteLength(buffer);
|
|
78
|
-
const value = little ? buffer.reverse().toString('hex') : buffer.toString('hex');
|
|
79
|
-
const _bigint = (0, deps_js_1.bigInt)(value, 16);
|
|
80
|
-
let bigint = BigInt(String(_bigint));
|
|
81
|
-
if (signed && Math.floor(bigint.toString(2).length / 8) >= length) {
|
|
82
|
-
bigint = bigint - bigIntPow(BigInt(2), BigInt(length * 8));
|
|
83
|
-
}
|
|
84
|
-
return BigInt(bigint);
|
|
85
|
-
}
|
package/dist/index.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export { Raw, AllTLObject, Primitive, TLObject, GzipPacked, Message, MsgContainer, SecretChatMessage, SecretChatMessageService, UpdateSecretChatMessage, TypeTGenerate, } from '@/raw/index.js';
|
|
2
|
-
export { bufferToBigint, bigIntMod, bigIntPow, bigintToBuffer, mod } from '@/helpers.js';
|
|
3
|
-
export { BadMsgNotification, CDNFileHashMismatch, ClientError, Exceptions, FileErrors, NotAFunctionClass, RPCError, SecretChatError, SecurityCheckMismatch, SecurityError, TimeoutError, UnknownError, WSError, } from '@/errors/index.js';
|
package/dist/index.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WSError = exports.UnknownError = exports.TimeoutError = exports.SecurityError = exports.SecurityCheckMismatch = exports.SecretChatError = exports.RPCError = exports.NotAFunctionClass = exports.FileErrors = exports.Exceptions = exports.ClientError = exports.CDNFileHashMismatch = exports.BadMsgNotification = exports.mod = exports.bigintToBuffer = exports.bigIntPow = exports.bigIntMod = exports.bufferToBigint = exports.UpdateSecretChatMessage = exports.SecretChatMessageService = exports.SecretChatMessage = exports.MsgContainer = exports.Message = exports.GzipPacked = exports.TLObject = exports.Primitive = exports.AllTLObject = exports.Raw = void 0;
|
|
4
|
-
var index_js_1 = require("@/raw/index.js");
|
|
5
|
-
Object.defineProperty(exports, "Raw", { enumerable: true, get: function () { return index_js_1.Raw; } });
|
|
6
|
-
Object.defineProperty(exports, "AllTLObject", { enumerable: true, get: function () { return index_js_1.AllTLObject; } });
|
|
7
|
-
Object.defineProperty(exports, "Primitive", { enumerable: true, get: function () { return index_js_1.Primitive; } });
|
|
8
|
-
Object.defineProperty(exports, "TLObject", { enumerable: true, get: function () { return index_js_1.TLObject; } });
|
|
9
|
-
Object.defineProperty(exports, "GzipPacked", { enumerable: true, get: function () { return index_js_1.GzipPacked; } });
|
|
10
|
-
Object.defineProperty(exports, "Message", { enumerable: true, get: function () { return index_js_1.Message; } });
|
|
11
|
-
Object.defineProperty(exports, "MsgContainer", { enumerable: true, get: function () { return index_js_1.MsgContainer; } });
|
|
12
|
-
Object.defineProperty(exports, "SecretChatMessage", { enumerable: true, get: function () { return index_js_1.SecretChatMessage; } });
|
|
13
|
-
Object.defineProperty(exports, "SecretChatMessageService", { enumerable: true, get: function () { return index_js_1.SecretChatMessageService; } });
|
|
14
|
-
Object.defineProperty(exports, "UpdateSecretChatMessage", { enumerable: true, get: function () { return index_js_1.UpdateSecretChatMessage; } });
|
|
15
|
-
var helpers_js_1 = require("@/helpers.js");
|
|
16
|
-
Object.defineProperty(exports, "bufferToBigint", { enumerable: true, get: function () { return helpers_js_1.bufferToBigint; } });
|
|
17
|
-
Object.defineProperty(exports, "bigIntMod", { enumerable: true, get: function () { return helpers_js_1.bigIntMod; } });
|
|
18
|
-
Object.defineProperty(exports, "bigIntPow", { enumerable: true, get: function () { return helpers_js_1.bigIntPow; } });
|
|
19
|
-
Object.defineProperty(exports, "bigintToBuffer", { enumerable: true, get: function () { return helpers_js_1.bigintToBuffer; } });
|
|
20
|
-
Object.defineProperty(exports, "mod", { enumerable: true, get: function () { return helpers_js_1.mod; } });
|
|
21
|
-
var index_js_2 = require("@/errors/index.js");
|
|
22
|
-
Object.defineProperty(exports, "BadMsgNotification", { enumerable: true, get: function () { return index_js_2.BadMsgNotification; } });
|
|
23
|
-
Object.defineProperty(exports, "CDNFileHashMismatch", { enumerable: true, get: function () { return index_js_2.CDNFileHashMismatch; } });
|
|
24
|
-
Object.defineProperty(exports, "ClientError", { enumerable: true, get: function () { return index_js_2.ClientError; } });
|
|
25
|
-
Object.defineProperty(exports, "Exceptions", { enumerable: true, get: function () { return index_js_2.Exceptions; } });
|
|
26
|
-
Object.defineProperty(exports, "FileErrors", { enumerable: true, get: function () { return index_js_2.FileErrors; } });
|
|
27
|
-
Object.defineProperty(exports, "NotAFunctionClass", { enumerable: true, get: function () { return index_js_2.NotAFunctionClass; } });
|
|
28
|
-
Object.defineProperty(exports, "RPCError", { enumerable: true, get: function () { return index_js_2.RPCError; } });
|
|
29
|
-
Object.defineProperty(exports, "SecretChatError", { enumerable: true, get: function () { return index_js_2.SecretChatError; } });
|
|
30
|
-
Object.defineProperty(exports, "SecurityCheckMismatch", { enumerable: true, get: function () { return index_js_2.SecurityCheckMismatch; } });
|
|
31
|
-
Object.defineProperty(exports, "SecurityError", { enumerable: true, get: function () { return index_js_2.SecurityError; } });
|
|
32
|
-
Object.defineProperty(exports, "TimeoutError", { enumerable: true, get: function () { return index_js_2.TimeoutError; } });
|
|
33
|
-
Object.defineProperty(exports, "UnknownError", { enumerable: true, get: function () { return index_js_2.UnknownError; } });
|
|
34
|
-
Object.defineProperty(exports, "WSError", { enumerable: true, get: function () { return index_js_2.WSError; } });
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Raw } from '@/raw/Raw.js';
|
|
2
|
-
import { TLObject } from '@/raw/core/TLObject.js';
|
|
3
|
-
export interface TypeTGenerate {
|
|
4
|
-
decrypt: (message: Raw.TypeEncryptedMessage) => Promise<Raw.TypeDecryptedMessage>;
|
|
5
|
-
}
|
|
6
|
-
export declare class UpdateSecretChatMessage extends TLObject {
|
|
7
|
-
message: SecretChatMessage | SecretChatMessageService;
|
|
8
|
-
qts: number;
|
|
9
|
-
_original: Raw.UpdateNewEncryptedMessage;
|
|
10
|
-
constructor(params: {
|
|
11
|
-
message: SecretChatMessage | SecretChatMessageService;
|
|
12
|
-
qts: number;
|
|
13
|
-
original: Raw.UpdateNewEncryptedMessage;
|
|
14
|
-
});
|
|
15
|
-
static generate<T>(update: Raw.UpdateNewEncryptedMessage, secretChat: T): Promise<UpdateSecretChatMessage>;
|
|
16
|
-
get original(): Raw.UpdateNewEncryptedMessage;
|
|
17
|
-
}
|
|
18
|
-
export declare class SecretChatMessage extends TLObject {
|
|
19
|
-
randomId: bigint;
|
|
20
|
-
chatId: number;
|
|
21
|
-
date: number;
|
|
22
|
-
message: Raw.DecryptedMessage8 | Raw.DecryptedMessage17 | Raw.DecryptedMessage45 | Raw.DecryptedMessage73;
|
|
23
|
-
file: Raw.TypeEncryptedFile;
|
|
24
|
-
constructor(params: {
|
|
25
|
-
randomId: bigint;
|
|
26
|
-
chatId: number;
|
|
27
|
-
date: number;
|
|
28
|
-
message: Raw.DecryptedMessage8 | Raw.DecryptedMessage17 | Raw.DecryptedMessage45 | Raw.DecryptedMessage73;
|
|
29
|
-
file: Raw.TypeEncryptedFile;
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
export declare class SecretChatMessageService extends TLObject {
|
|
33
|
-
randomId: bigint;
|
|
34
|
-
chatId: number;
|
|
35
|
-
date: number;
|
|
36
|
-
message: Raw.DecryptedMessageService8 | Raw.DecryptedMessageService17;
|
|
37
|
-
constructor(params: {
|
|
38
|
-
randomId: bigint;
|
|
39
|
-
chatId: number;
|
|
40
|
-
date: number;
|
|
41
|
-
message: Raw.DecryptedMessageService8 | Raw.DecryptedMessageService17;
|
|
42
|
-
});
|
|
43
|
-
}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SecretChatMessageService = exports.SecretChatMessage = exports.UpdateSecretChatMessage = void 0;
|
|
4
|
-
const Raw_js_1 = require("@/raw/Raw.js");
|
|
5
|
-
const TLObject_js_1 = require("@/raw/core/TLObject.js");
|
|
6
|
-
class UpdateSecretChatMessage extends TLObject_js_1.TLObject {
|
|
7
|
-
message;
|
|
8
|
-
qts;
|
|
9
|
-
_original;
|
|
10
|
-
constructor(params) {
|
|
11
|
-
super();
|
|
12
|
-
this.classType = 'modified_types_UpdateNewEncryptedMessage';
|
|
13
|
-
this.className = 'UpdateSecretChatMessage';
|
|
14
|
-
this.constructorId = 1;
|
|
15
|
-
this.subclassOfId = 0x9f89304e;
|
|
16
|
-
this._slots = ['message', 'qts'];
|
|
17
|
-
this.message = params.message;
|
|
18
|
-
this.qts = params.qts;
|
|
19
|
-
this._original = params.original;
|
|
20
|
-
}
|
|
21
|
-
static async generate(update, secretChat) {
|
|
22
|
-
const decrypted = await secretChat.decrypt(update.message);
|
|
23
|
-
if (update.message instanceof Raw_js_1.Raw.EncryptedMessageService) {
|
|
24
|
-
return new UpdateSecretChatMessage({
|
|
25
|
-
message: new SecretChatMessageService({
|
|
26
|
-
randomId: update.message.randomId,
|
|
27
|
-
chatId: update.message.chatId,
|
|
28
|
-
date: update.message.date,
|
|
29
|
-
message: decrypted,
|
|
30
|
-
}),
|
|
31
|
-
qts: update.qts,
|
|
32
|
-
original: update,
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
return new UpdateSecretChatMessage({
|
|
36
|
-
message: new SecretChatMessage({
|
|
37
|
-
randomId: update.message.randomId,
|
|
38
|
-
chatId: update.message.chatId,
|
|
39
|
-
date: update.message.date,
|
|
40
|
-
file: update.message.file,
|
|
41
|
-
message: decrypted,
|
|
42
|
-
}),
|
|
43
|
-
qts: update.qts,
|
|
44
|
-
original: update,
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
get original() {
|
|
48
|
-
return this._original;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
exports.UpdateSecretChatMessage = UpdateSecretChatMessage;
|
|
52
|
-
class SecretChatMessage extends TLObject_js_1.TLObject {
|
|
53
|
-
randomId;
|
|
54
|
-
chatId;
|
|
55
|
-
date;
|
|
56
|
-
message;
|
|
57
|
-
file;
|
|
58
|
-
constructor(params) {
|
|
59
|
-
super();
|
|
60
|
-
this.classType = 'modified_types_EncryptedMessage';
|
|
61
|
-
this.className = 'SecretChatMessage';
|
|
62
|
-
this.constructorId = 2;
|
|
63
|
-
this.subclassOfId = 0x239f2e51;
|
|
64
|
-
this._slots = ['randomId', 'chatId', 'date', 'message', 'file'];
|
|
65
|
-
this.randomId = params.randomId;
|
|
66
|
-
this.chatId = params.chatId;
|
|
67
|
-
this.date = params.date;
|
|
68
|
-
this.message = params.message;
|
|
69
|
-
this.file = params.file;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
exports.SecretChatMessage = SecretChatMessage;
|
|
73
|
-
class SecretChatMessageService extends TLObject_js_1.TLObject {
|
|
74
|
-
randomId;
|
|
75
|
-
chatId;
|
|
76
|
-
date;
|
|
77
|
-
message;
|
|
78
|
-
constructor(params) {
|
|
79
|
-
super();
|
|
80
|
-
this.classType = 'modified_types_EncryptedMessageService';
|
|
81
|
-
this.className = 'SecretChatMessageService';
|
|
82
|
-
this.constructorId = 3;
|
|
83
|
-
this.subclassOfId = 0x239f2e51;
|
|
84
|
-
this._slots = ['randomId', 'chatId', 'date', 'message'];
|
|
85
|
-
this.randomId = params.randomId;
|
|
86
|
-
this.chatId = params.chatId;
|
|
87
|
-
this.date = params.date;
|
|
88
|
-
this.message = params.message;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
exports.SecretChatMessageService = SecretChatMessageService;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { BytesIO, Buffer } from '@/deps.js';
|
|
2
|
-
import { TLObject } from '@/raw/core/TLObject.js';
|
|
3
|
-
export declare class GzipPacked extends TLObject {
|
|
4
|
-
static ID: number;
|
|
5
|
-
packedData: TLObject;
|
|
6
|
-
constructor(packedData: TLObject);
|
|
7
|
-
static read(data: BytesIO, ..._args: Array<any>): Promise<GzipPacked>;
|
|
8
|
-
write(): Buffer;
|
|
9
|
-
}
|