@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.
Files changed (147) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +124 -15
  3. package/dist/mod.d.ts +10 -0
  4. package/dist/mod.js +10 -0
  5. package/dist/src/Logger.d.ts +20 -0
  6. package/dist/src/Logger.js +23 -0
  7. package/dist/src/deps.d.ts +29 -0
  8. package/dist/src/deps.js +34 -0
  9. package/dist/src/errors/Base.d.ts +53 -0
  10. package/dist/src/errors/Base.js +114 -0
  11. package/dist/src/errors/Client.d.ts +69 -0
  12. package/dist/src/errors/Client.js +69 -0
  13. package/dist/src/errors/File.d.ts +89 -0
  14. package/dist/src/errors/File.js +99 -0
  15. package/dist/src/errors/RpcError.d.ts +115 -0
  16. package/dist/src/errors/RpcError.js +226 -0
  17. package/dist/src/errors/SecretChat.d.ts +78 -0
  18. package/dist/src/errors/SecretChat.js +88 -0
  19. package/dist/src/errors/WebSocket.d.ts +70 -0
  20. package/dist/src/errors/WebSocket.js +80 -0
  21. package/dist/{errors → src/errors}/exceptions/All.d.ts +14 -0
  22. package/dist/{errors → src/errors}/exceptions/All.js +15 -5
  23. package/dist/{errors → src/errors}/exceptions/BadRequest400.d.ts +15 -1
  24. package/dist/src/errors/exceptions/BadRequest400.js +2683 -0
  25. package/dist/{errors → src/errors}/exceptions/Flood420.d.ts +15 -1
  26. package/dist/{errors → src/errors}/exceptions/Flood420.js +25 -24
  27. package/dist/{errors → src/errors}/exceptions/Forbidden403.d.ts +15 -1
  28. package/dist/src/errors/exceptions/Forbidden403.js +243 -0
  29. package/dist/{errors → src/errors}/exceptions/InternalServerError500.d.ts +15 -1
  30. package/dist/src/errors/exceptions/InternalServerError500.js +255 -0
  31. package/dist/{errors → src/errors}/exceptions/NotAcceptable406.d.ts +15 -1
  32. package/dist/{errors → src/errors}/exceptions/NotAcceptable406.js +51 -76
  33. package/dist/src/errors/exceptions/NotFound404.d.ts +27 -0
  34. package/dist/src/errors/exceptions/NotFound404.js +27 -0
  35. package/dist/src/errors/exceptions/SeeOther303.d.ts +39 -0
  36. package/dist/src/errors/exceptions/SeeOther303.js +39 -0
  37. package/dist/src/errors/exceptions/ServiceUnavailable503.d.ts +31 -0
  38. package/dist/src/errors/exceptions/ServiceUnavailable503.js +31 -0
  39. package/dist/{errors → src/errors}/exceptions/Unauthorized401.d.ts +15 -1
  40. package/dist/src/errors/exceptions/Unauthorized401.js +55 -0
  41. package/dist/src/errors/exceptions/index.d.ts +24 -0
  42. package/dist/src/errors/exceptions/index.js +24 -0
  43. package/dist/src/errors/index.d.ts +142 -0
  44. package/dist/src/errors/index.js +178 -0
  45. package/dist/src/helpers.d.ts +102 -0
  46. package/dist/src/helpers.js +176 -0
  47. package/dist/src/index.d.ts +12 -0
  48. package/dist/src/index.js +12 -0
  49. package/dist/{raw → src/raw}/All.d.ts +14 -0
  50. package/dist/{raw → src/raw}/All.js +15 -4
  51. package/dist/{raw → src/raw}/Raw.d.ts +17205 -3
  52. package/dist/{raw → src/raw}/Raw.js +44035 -21917
  53. package/dist/src/raw/UpdateSecretChat.d.ts +186 -0
  54. package/dist/src/raw/UpdateSecretChat.js +215 -0
  55. package/dist/src/raw/core/GzipPacked.d.ts +63 -0
  56. package/dist/src/raw/core/GzipPacked.js +76 -0
  57. package/dist/src/raw/core/Message.d.ts +68 -0
  58. package/dist/src/raw/core/Message.js +105 -0
  59. package/dist/src/raw/core/MsgContainer.d.ts +56 -0
  60. package/dist/src/raw/core/MsgContainer.js +77 -0
  61. package/dist/src/raw/core/TLObject.d.ts +108 -0
  62. package/dist/src/raw/core/TLObject.js +209 -0
  63. package/dist/src/raw/core/index.d.ts +19 -0
  64. package/dist/src/raw/core/index.js +19 -0
  65. package/dist/src/raw/core/primitive/Bool.d.ts +104 -0
  66. package/dist/src/raw/core/primitive/Bool.js +120 -0
  67. package/dist/src/raw/core/primitive/Bytes.d.ts +45 -0
  68. package/dist/src/raw/core/primitive/Bytes.js +76 -0
  69. package/dist/src/raw/core/primitive/Double.d.ts +37 -0
  70. package/dist/src/raw/core/primitive/Double.js +51 -0
  71. package/dist/src/raw/core/primitive/Float.d.ts +37 -0
  72. package/dist/src/raw/core/primitive/Float.js +51 -0
  73. package/dist/src/raw/core/primitive/Int.d.ts +144 -0
  74. package/dist/src/raw/core/primitive/Int.js +237 -0
  75. package/dist/src/raw/core/primitive/String.d.ts +37 -0
  76. package/dist/src/raw/core/primitive/String.js +42 -0
  77. package/dist/src/raw/core/primitive/Vector.d.ts +56 -0
  78. package/dist/src/raw/core/primitive/Vector.js +93 -0
  79. package/dist/src/raw/core/primitive/index.d.ts +20 -0
  80. package/dist/src/raw/core/primitive/index.js +20 -0
  81. package/dist/src/raw/index.d.ts +17 -0
  82. package/dist/src/raw/index.js +17 -0
  83. package/package.json +54 -50
  84. package/dist/Logger.d.ts +0 -3
  85. package/dist/Logger.js +0 -9
  86. package/dist/deps.d.ts +0 -8
  87. package/dist/deps.js +0 -19
  88. package/dist/errors/Base.d.ts +0 -9
  89. package/dist/errors/Base.js +0 -50
  90. package/dist/errors/Client.d.ts +0 -21
  91. package/dist/errors/Client.js +0 -29
  92. package/dist/errors/File.d.ts +0 -13
  93. package/dist/errors/File.js +0 -30
  94. package/dist/errors/RpcError.d.ts +0 -22
  95. package/dist/errors/RpcError.js +0 -120
  96. package/dist/errors/SecretChat.d.ts +0 -13
  97. package/dist/errors/SecretChat.js +0 -30
  98. package/dist/errors/WebSocket.d.ts +0 -13
  99. package/dist/errors/WebSocket.js +0 -30
  100. package/dist/errors/exceptions/BadRequest400.js +0 -3352
  101. package/dist/errors/exceptions/Forbidden403.js +0 -290
  102. package/dist/errors/exceptions/InternalServerError500.js +0 -305
  103. package/dist/errors/exceptions/NotFound404.d.ts +0 -13
  104. package/dist/errors/exceptions/NotFound404.js +0 -19
  105. package/dist/errors/exceptions/SeeOther303.d.ts +0 -25
  106. package/dist/errors/exceptions/SeeOther303.js +0 -34
  107. package/dist/errors/exceptions/ServiceUnavailable503.d.ts +0 -17
  108. package/dist/errors/exceptions/ServiceUnavailable503.js +0 -24
  109. package/dist/errors/exceptions/Unauthorized401.js +0 -54
  110. package/dist/errors/exceptions/index.d.ts +0 -10
  111. package/dist/errors/exceptions/index.js +0 -48
  112. package/dist/errors/index.d.ts +0 -31
  113. package/dist/errors/index.js +0 -111
  114. package/dist/helpers.d.ts +0 -6
  115. package/dist/helpers.js +0 -85
  116. package/dist/index.d.ts +0 -3
  117. package/dist/index.js +0 -34
  118. package/dist/raw/UpdateSecretChat.d.ts +0 -43
  119. package/dist/raw/UpdateSecretChat.js +0 -91
  120. package/dist/raw/core/GzipPacked.d.ts +0 -9
  121. package/dist/raw/core/GzipPacked.js +0 -59
  122. package/dist/raw/core/Message.d.ts +0 -12
  123. package/dist/raw/core/Message.js +0 -80
  124. package/dist/raw/core/MsgContainer.d.ts +0 -10
  125. package/dist/raw/core/MsgContainer.js +0 -68
  126. package/dist/raw/core/TLObject.d.ts +0 -18
  127. package/dist/raw/core/TLObject.js +0 -108
  128. package/dist/raw/core/index.d.ts +0 -6
  129. package/dist/raw/core/index.js +0 -46
  130. package/dist/raw/core/primitive/Bool.d.ts +0 -19
  131. package/dist/raw/core/primitive/Bool.js +0 -41
  132. package/dist/raw/core/primitive/Bytes.d.ts +0 -6
  133. package/dist/raw/core/primitive/Bytes.js +0 -41
  134. package/dist/raw/core/primitive/Double.d.ts +0 -6
  135. package/dist/raw/core/primitive/Double.js +0 -24
  136. package/dist/raw/core/primitive/Float.d.ts +0 -6
  137. package/dist/raw/core/primitive/Float.js +0 -24
  138. package/dist/raw/core/primitive/Int.d.ts +0 -22
  139. package/dist/raw/core/primitive/Int.js +0 -122
  140. package/dist/raw/core/primitive/String.d.ts +0 -6
  141. package/dist/raw/core/primitive/String.js +0 -15
  142. package/dist/raw/core/primitive/Vector.d.ts +0 -8
  143. package/dist/raw/core/primitive/Vector.js +0 -49
  144. package/dist/raw/core/primitive/index.d.ts +0 -7
  145. package/dist/raw/core/primitive/index.js +0 -22
  146. package/dist/raw/index.d.ts +0 -4
  147. 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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.count = exports.Exceptions = void 0;
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
- exports.Exceptions = Exceptions;
889
+ export { Exceptions, count };
@@ -1,4 +1,18 @@
1
- import { RPCError } from '@/errors/RpcError.js';
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;