@aezakmiproject/telemt-sdk-nest 1.0.0 → 1.1.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 (2) hide show
  1. package/README.md +19 -6
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -7,19 +7,30 @@ NestJS module for the [Telemt](https://github.com/telemt/telemt) Control API.
7
7
 
8
8
  Wraps [`@aezakmiproject/telemt-sdk`](https://www.npmjs.com/package/@aezakmiproject/telemt-sdk) in an injectable provider: one configured `TelemtAPI` per registration, resolved through Nest DI, with sync and async registration and an opt-in helper that turns the SDK's no-throw envelope into a thrown exception.
9
9
 
10
- Requires **Node.js 18+** (the SDK uses global `fetch` and `AbortSignal.timeout`).
10
+ Requires **Node.js 22.12+**. `@nestjs/common` v12 is ESM-only while this package is published as CommonJS, so it relies on `require(esm)`, which is unflagged only from that version.
11
11
 
12
12
  This project is an independent open-source client. It is not affiliated with Telegram or the Telemt authors.
13
13
 
14
14
  ## Install
15
15
 
16
+ This package declares its runtime dependencies as peers, so install the SDK alongside it:
17
+
16
18
  ```bash
17
- npm install @aezakmiproject/telemt-sdk-nest
19
+ npm install @aezakmiproject/telemt-sdk-nest @aezakmiproject/telemt-sdk
18
20
  # or
19
- pnpm add @aezakmiproject/telemt-sdk-nest
21
+ pnpm add @aezakmiproject/telemt-sdk-nest @aezakmiproject/telemt-sdk
20
22
  ```
21
23
 
22
- `@nestjs/common` and `@nestjs/core` are expected to be present in the host application.
24
+ The full peer set is:
25
+
26
+ | Peer | Range | Notes |
27
+ | --- | --- | --- |
28
+ | `@aezakmiproject/telemt-sdk` | `^1.2.0` | The client this module wraps — install it explicitly |
29
+ | `@nestjs/common` | `^12.0.0` | Already present in any Nest application |
30
+ | `reflect-metadata` | `^0.2.0` | Already present in any Nest application |
31
+
32
+ Keeping the SDK a peer means your application owns its version, and the module does
33
+ not pin a second copy of the client into your tree.
23
34
 
24
35
  ## Quick start
25
36
 
@@ -126,9 +137,13 @@ Thin, stateless facade over the underlying `TelemtAPI`. Each getter forwards to
126
137
  | `runtime` | Gates, ME pool/quality, events, TLS fingerprints |
127
138
  | `security` | API posture and IP whitelist |
128
139
  | `limits` | Effective timeouts / pool / per-user limits |
140
+ | `web` | WEB-proxy session control — **requires Telemt 3.5.1+** |
129
141
  | `client` | The raw `TelemtAPI`, for anything not surfaced above |
130
142
  | `unwrap(res)` | Returns `data`, or throws `TelemtApiException` |
131
143
 
144
+ `web` is version-gated: on a Telemt older than 3.5.1 its calls come back as a failed
145
+ `ISdkResponse` rather than throwing, like every other SDK call.
146
+
132
147
  The full method list and request/response types live in the [SDK's API reference](https://github.com/AezakmiProject/telemt-sdk/blob/main/docs/api.md).
133
148
 
134
149
  ## Responses and `unwrap`
@@ -181,8 +196,6 @@ A `202` from a user mutation is still `isOk: true` — the write is on disk, but
181
196
 
182
197
  Each registration builds its own client, so registering the module in two places gives two independent `TelemtAPI` instances. The module is **not** global: every consuming module must import it, and only `TelemtService` is exported — `TELEMT_CLIENT` and `TELEMT_MODULE_OPTIONS` stay internal to the module.
183
198
 
184
- WEB-proxy session control (`api.web`) is not implemented in the SDK, so it is deliberately not surfaced here.
185
-
186
199
  ## Development
187
200
 
188
201
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aezakmiproject/telemt-sdk-nest",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "NestJS module for the Telemt MTProto proxy Control API: injectable typed client, sync and async registration, no-throw responses, Node 22+",
5
5
  "homepage": "https://github.com/AezakmiProject/telemt-sdk-nest#readme",
6
6
  "repository": {