@bymax-one/nest-cache 1.0.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/CHANGELOG.md +38 -0
- package/LICENSE +21 -0
- package/README.md +677 -0
- package/dist/server/index.cjs +1653 -0
- package/dist/server/index.d.cts +1296 -0
- package/dist/server/index.d.ts +1296 -0
- package/dist/server/index.mjs +1642 -0
- package/dist/shared/index.cjs +33 -0
- package/dist/shared/index.d.cts +114 -0
- package/dist/shared/index.d.ts +114 -0
- package/dist/shared/index.mjs +30 -0
- package/package.json +123 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file. The format is
|
|
4
|
+
based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this
|
|
5
|
+
project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
## [1.0.0] - 2026-07-29
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Initial public release of `@bymax-one/nest-cache`
|
|
12
|
+
- `BymaxCacheModule.forRoot()` and `forRootAsync()` via `ConfigurableModuleBuilder` — global by default
|
|
13
|
+
- `ConnectionManager` — singleton ioredis 5 client with full lifecycle (`OnModuleInit` / `OnModuleDestroy`), bounded retry strategy, `READONLY`-failover reconnect, and graceful `quit()` with configurable shutdown timeout
|
|
14
|
+
- Standalone, Sentinel, and Cluster connection topologies from a single options shape
|
|
15
|
+
- `CacheService` — typed, namespaced command API:
|
|
16
|
+
- Strings: `get<T>` · `getRaw` · `set<T>` · `setRaw` · `setNx<T>`
|
|
17
|
+
- Delete / exists: `del` · `delMany` · `exists`
|
|
18
|
+
- TTL: `expire` · `persist` · `ttl`
|
|
19
|
+
- Numerics: `incr` · `decr`
|
|
20
|
+
- Batch: `mget<T>` · `mset<T>`
|
|
21
|
+
- Hashes: `hget<T>` · `hset<T>` · `hgetall<T>` · `hdel`
|
|
22
|
+
- Sets: `sadd` · `srem` · `smembers` · `sismember` · `scard`
|
|
23
|
+
- Iteration: `keys` (dev only) · `scan` (cursor-based, async iterator)
|
|
24
|
+
- Pipeline / escape hatch: `pipeline` · `getClient`
|
|
25
|
+
- Namespace: `flushNamespace` (production safety guard)
|
|
26
|
+
- Health: `isHealthy` · `ping` · `info`
|
|
27
|
+
- `KeyBuilder` — `{namespace}{separator}{prefix}{separator}{id}` composition with configurable namespace and separator; all keys namespaced automatically; raw access via `getClient()` documented as an anti-pattern
|
|
28
|
+
- `ISerializer` interface + default `JsonSerializer` — fail-closed deserialization (malformed payloads throw `CacheException(DESERIALIZATION_FAILED)`, never a partial value)
|
|
29
|
+
- `PubSubService` — `publish<T>` / `subscribe<T>` / `psubscribe<T>` on namespaced channels; subscriber connection created lazily on first subscription
|
|
30
|
+
- `ScriptManagerService` — `register` / `load` / `eval` with `EVALSHA` + automatic `NOSCRIPT` reload-and-retry; cluster mode uses `EVAL` (body routing by key)
|
|
31
|
+
- Connection lifecycle events surfaced via `events.onEvent` callback (plug any logger or metrics backend — no observability peer dep forced)
|
|
32
|
+
- `CacheException` (extends `HttpException`) + `CACHE_ERROR_CODES` — stable `cache.*` error codes with mapped HTTP statuses
|
|
33
|
+
- Subpath exports: `.` (server — NestJS module + services) and `./shared` (zero-dependency types + constants)
|
|
34
|
+
- 100% coverage gate (statements / branches / functions / lines) enforced by `jest.coverage.config.ts`
|
|
35
|
+
- Mutation score: **100% global** (427 killed, 6 timeout, 0 survived) under Node 24 — `pnpm mutation` exits 0 (`break: 95`)
|
|
36
|
+
- E2E suite: `@nestjs/testing` with `ioredis-mock` + Testcontainers (standalone, sentinel, cluster, connection resilience)
|
|
37
|
+
- Published with npm OIDC provenance — no long-lived tokens
|
|
38
|
+
- Zero direct runtime dependencies (`dependencies: {}`) — `ioredis` and NestJS via peer deps
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Bymax One
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|