@omnitron-dev/titan-ratelimit 0.4.6 → 0.4.9

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 +26 -7
  2. package/package.json +6 -6
package/README.md CHANGED
@@ -1,19 +1,38 @@
1
1
  # @omnitron-dev/titan-ratelimit
2
2
 
3
- > Redis-backed rate limiting for the Titan framework
3
+ Request and operation rate limits for Titan services.
4
4
 
5
- Part of the [Omni](../../README.md) monorepo — Fullstack Type-Safe RPC Framework.
5
+ ## Capabilities
6
6
 
7
- ## Installation
7
+ - Fixed-window, sliding-window and token-bucket strategies.
8
+ - Memory or Redis storage selected by configuration.
9
+ - Service decorators and HTTP middleware.
8
10
 
9
- ```bash
11
+ ## Quick start
12
+
13
+ ```sh
10
14
  pnpm add @omnitron-dev/titan-ratelimit
11
15
  ```
12
16
 
13
- ## Overview
17
+ ```ts
18
+ import { TitanRateLimitModule } from '@omnitron-dev/titan-ratelimit';
19
+
20
+ export const ratelimit = TitanRateLimitModule.forRoot({
21
+ storageType: 'memory',
22
+ strategy: 'sliding-window',
23
+ defaultLimit: 100,
24
+ defaultWindowMs: 60_000,
25
+ });
26
+ ```
27
+
28
+ Add this dynamic module to the `imports` of an existing Titan application.
29
+
30
+ Memory limits belong to one process. Configure Redis when multiple instances must share a budget, and derive keys from admitted identity rather than untrusted headers. Rate limiting supplements authentication and resource authorization.
31
+
32
+ ## Documentation
14
33
 
15
- Rate limiting module backed by Redis. Supports fixed-window and sliding-window algorithms with configurable limits per key, endpoint, or user.
34
+ [Public API](src/index.ts) · [Package exports](package.json) · [Omni](../../README.md)
16
35
 
17
36
  ## License
18
37
 
19
- MIT
38
+ [MIT](../../LICENSE).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omnitron-dev/titan-ratelimit",
3
- "version": "0.4.6",
3
+ "version": "0.4.9",
4
4
  "description": "Rate limiting module for Titan framework with Redis-backed storage",
5
5
  "author": "LuxQuant",
6
6
  "license": "MIT",
@@ -20,12 +20,12 @@
20
20
  "reflect-metadata": "^0.2.2"
21
21
  },
22
22
  "peerDependencies": {
23
- "@omnitron-dev/titan": "0.4.6",
24
- "@omnitron-dev/titan-redis": "0.4.6"
23
+ "@omnitron-dev/titan": "0.4.9",
24
+ "@omnitron-dev/titan-redis": "0.4.9"
25
25
  },
26
26
  "devDependencies": {
27
- "@omnitron-dev/titan": "0.4.6",
28
- "@omnitron-dev/titan-redis": "0.4.6",
27
+ "@omnitron-dev/titan": "0.4.9",
28
+ "@omnitron-dev/titan-redis": "0.4.9",
29
29
  "@types/node": "26.6.6",
30
30
  "typescript": "npm:@typescript/typescript6@^6.0.2",
31
31
  "vitest": "^5.0.5",
@@ -36,7 +36,7 @@
36
36
  "url": "git+https://github.com/omnitron-dev/omni.git",
37
37
  "directory": "packages/titan-ratelimit"
38
38
  },
39
- "gitHead": "3a912fa181e97ddd238a28bb355cd7445c1b7364",
39
+ "gitHead": "c6005ff1d0cde480cfa6b0bc346c9b53b2e638bf",
40
40
  "scripts": {
41
41
  "build": "../../scripts/build-package.sh -p ./tsconfig.json",
42
42
  "test": "vitest run",