@tgsnake/skema 1.13.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 +124 -15
- 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 +14 -0
- package/dist/{raw → src/raw}/All.js +15 -4
- package/dist/{raw → src/raw}/Raw.d.ts +17205 -3
- package/dist/{raw → src/raw}/Raw.js +44035 -21917
- 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
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* tgsnake - Telegram MTProto library for javascript or typescript.
|
|
3
|
+
* Copyright (C) 2026 tgsnake <https://github.com/tgsnake>
|
|
4
|
+
*
|
|
5
|
+
* THIS FILE IS PART OF TGSNAKE
|
|
6
|
+
*
|
|
7
|
+
* tgsnake is a free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the MIT License as published.
|
|
9
|
+
*/
|
|
10
|
+
import { BaseError } from './Base.js';
|
|
11
|
+
/**
|
|
12
|
+
* Base custom error class for all WebSocket communication issues.
|
|
13
|
+
*
|
|
14
|
+
* @extends BaseError
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* throw new WebSocketError('Connection failed', 'Unable to connect to the WebSocket server');
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare class WebSocketError extends BaseError {
|
|
21
|
+
/**
|
|
22
|
+
* Constructs a new WebSocketError instance.
|
|
23
|
+
*
|
|
24
|
+
* @param message - A brief message describing the error.
|
|
25
|
+
* @param description - An optional detailed description or troubleshooting context.
|
|
26
|
+
*/
|
|
27
|
+
constructor(message: string, description?: string);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Error thrown when an attempt is made to send a request or receive an update while the WebSocket connection is disconnected.
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Ensure the client is fully initialized and that the active socket has connected successfully.
|
|
34
|
+
*
|
|
35
|
+
* @extends WebSocketError
|
|
36
|
+
*/
|
|
37
|
+
export declare class Disconnected extends WebSocketError {
|
|
38
|
+
/**
|
|
39
|
+
* Constructs a new Disconnected instance with predefined error messages.
|
|
40
|
+
*/
|
|
41
|
+
constructor();
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Error thrown when the active WebSocket connection is closed unexpectedly while a read operation is in progress.
|
|
45
|
+
*
|
|
46
|
+
* @remarks
|
|
47
|
+
* This commonly happens due to abrupt physical network drops, heartbeat losses, or the server closing the channel.
|
|
48
|
+
*
|
|
49
|
+
* @extends WebSocketError
|
|
50
|
+
*/
|
|
51
|
+
export declare class ReadClosed extends WebSocketError {
|
|
52
|
+
/**
|
|
53
|
+
* Constructs a new ReadClosed instance with predefined error messages.
|
|
54
|
+
*/
|
|
55
|
+
constructor();
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Error thrown when an attempt is made to use a WebSocket proxy configuration that is unsupported by the framework.
|
|
59
|
+
*
|
|
60
|
+
* @remarks
|
|
61
|
+
* Browsers or proxy modes may not be fully supported inside certain modular runtime setups.
|
|
62
|
+
*
|
|
63
|
+
* @extends WebSocketError
|
|
64
|
+
*/
|
|
65
|
+
export declare class ProxyUnsupported extends WebSocketError {
|
|
66
|
+
/**
|
|
67
|
+
* Constructs a new ProxyUnsupported instance with predefined error messages.
|
|
68
|
+
*/
|
|
69
|
+
constructor();
|
|
70
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* tgsnake - Telegram MTProto library for javascript or typescript.
|
|
3
|
+
* Copyright (C) 2026 tgsnake <https://github.com/tgsnake>
|
|
4
|
+
*
|
|
5
|
+
* THIS FILE IS PART OF TGSNAKE
|
|
6
|
+
*
|
|
7
|
+
* tgsnake is a free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the MIT License as published.
|
|
9
|
+
*/
|
|
10
|
+
import { BaseError } from './Base.js';
|
|
11
|
+
/**
|
|
12
|
+
* Base custom error class for all WebSocket communication issues.
|
|
13
|
+
*
|
|
14
|
+
* @extends BaseError
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* throw new WebSocketError('Connection failed', 'Unable to connect to the WebSocket server');
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export class WebSocketError extends BaseError {
|
|
21
|
+
/**
|
|
22
|
+
* Constructs a new WebSocketError instance.
|
|
23
|
+
*
|
|
24
|
+
* @param message - A brief message describing the error.
|
|
25
|
+
* @param description - An optional detailed description or troubleshooting context.
|
|
26
|
+
*/
|
|
27
|
+
constructor(message, description) {
|
|
28
|
+
super();
|
|
29
|
+
this.message = message;
|
|
30
|
+
this.description = description;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Error thrown when an attempt is made to send a request or receive an update while the WebSocket connection is disconnected.
|
|
35
|
+
*
|
|
36
|
+
* @remarks
|
|
37
|
+
* Ensure the client is fully initialized and that the active socket has connected successfully.
|
|
38
|
+
*
|
|
39
|
+
* @extends WebSocketError
|
|
40
|
+
*/
|
|
41
|
+
export class Disconnected extends WebSocketError {
|
|
42
|
+
/**
|
|
43
|
+
* Constructs a new Disconnected instance with predefined error messages.
|
|
44
|
+
*/
|
|
45
|
+
constructor() {
|
|
46
|
+
super('WebSocket Disconnected', "This happen when you trying to send request or receive update from websocket server hut the websocket client is doesn't ready. Make sure the websocket client is connected to server.");
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Error thrown when the active WebSocket connection is closed unexpectedly while a read operation is in progress.
|
|
51
|
+
*
|
|
52
|
+
* @remarks
|
|
53
|
+
* This commonly happens due to abrupt physical network drops, heartbeat losses, or the server closing the channel.
|
|
54
|
+
*
|
|
55
|
+
* @extends WebSocketError
|
|
56
|
+
*/
|
|
57
|
+
export class ReadClosed extends WebSocketError {
|
|
58
|
+
/**
|
|
59
|
+
* Constructs a new ReadClosed instance with predefined error messages.
|
|
60
|
+
*/
|
|
61
|
+
constructor() {
|
|
62
|
+
super('WebSocket connection closed when reading data', 'This happen when suddenly the connection between the websocket client and the server is lost when fetching data updates from the server.');
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Error thrown when an attempt is made to use a WebSocket proxy configuration that is unsupported by the framework.
|
|
67
|
+
*
|
|
68
|
+
* @remarks
|
|
69
|
+
* Browsers or proxy modes may not be fully supported inside certain modular runtime setups.
|
|
70
|
+
*
|
|
71
|
+
* @extends WebSocketError
|
|
72
|
+
*/
|
|
73
|
+
export class ProxyUnsupported extends WebSocketError {
|
|
74
|
+
/**
|
|
75
|
+
* Constructs a new ProxyUnsupported instance with predefined error messages.
|
|
76
|
+
*/
|
|
77
|
+
constructor() {
|
|
78
|
+
super('WebSocket proxy unsupported', 'This is because browser telegram or websocket proxy are not supported by the framework at this time.');
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* tgsnake - Telegram MTProto library for javascript or typescript.
|
|
3
|
+
* Copyright (C) 2026 tgsnake <https://github.com/tgsnake>
|
|
4
|
+
*
|
|
5
|
+
* THIS FILE IS PART OF TGSNAKE
|
|
6
|
+
*
|
|
7
|
+
* tgsnake is a free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the MIT License as published.
|
|
9
|
+
*/
|
|
10
|
+
/***********************************************************
|
|
11
|
+
* Warning!! *
|
|
12
|
+
* This file is auto generate. *
|
|
13
|
+
* All change made in this file will be lost! *
|
|
14
|
+
***********************************************************/
|
|
1
15
|
declare const count = 844;
|
|
2
16
|
declare const Exceptions: {
|
|
3
17
|
303: {
|
|
@@ -1,8 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* tgsnake - Telegram MTProto library for javascript or typescript.
|
|
3
|
+
* Copyright (C) 2026 tgsnake <https://github.com/tgsnake>
|
|
4
|
+
*
|
|
5
|
+
* THIS FILE IS PART OF TGSNAKE
|
|
6
|
+
*
|
|
7
|
+
* tgsnake is a free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the MIT License as published.
|
|
9
|
+
*/
|
|
10
|
+
/***********************************************************
|
|
11
|
+
* Warning!! *
|
|
12
|
+
* This file is auto generate. *
|
|
13
|
+
* All change made in this file will be lost! *
|
|
14
|
+
***********************************************************/
|
|
4
15
|
const count = 844;
|
|
5
|
-
exports.count = count;
|
|
6
16
|
const Exceptions = {
|
|
7
17
|
303: {
|
|
8
18
|
_: 'SeeOther.SeeOther',
|
|
@@ -876,4 +886,4 @@ const Exceptions = {
|
|
|
876
886
|
Timeout: 'ServiceUnavailable.Timeout',
|
|
877
887
|
},
|
|
878
888
|
};
|
|
879
|
-
|
|
889
|
+
export { Exceptions, count };
|
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* tgsnake - Telegram MTProto library for javascript or typescript.
|
|
3
|
+
* Copyright (C) 2026 tgsnake <https://github.com/tgsnake>
|
|
4
|
+
*
|
|
5
|
+
* THIS FILE IS PART OF TGSNAKE
|
|
6
|
+
*
|
|
7
|
+
* tgsnake is a free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the MIT License as published.
|
|
9
|
+
*/
|
|
10
|
+
/***********************************************************
|
|
11
|
+
* Warning!! *
|
|
12
|
+
* This file is auto generate. *
|
|
13
|
+
* All change made in this file will be lost! *
|
|
14
|
+
***********************************************************/
|
|
15
|
+
import { RPCError } from '../RpcError.js';
|
|
2
16
|
export declare class BadRequest extends RPCError {
|
|
3
17
|
code: number;
|
|
4
18
|
name: string;
|