{"_id":"@bounkhong/idempotency-adapter-redis","name":"@bounkhong/idempotency-adapter-redis","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@bounkhong/idempotency-adapter-redis","version":"0.1.0","description":"Redis idempotency store adapter for AIF core","license":"MIT","author":{"name":"Bounkhong","url":"AIF"},"repository":{"type":"git","url":"git+https://github.com/aif/idempotency-package.git"},"bugs":{"url":"https://github.com/aif/idempotency-package/issues"},"homepage":"https://github.com/aif/idempotency-package#readme","keywords":["idempotency","adapter","redis","nodejs"],"type":"module","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"publishConfig":{"access":"public"},"dependencies":{"@bounkhong/idempotency-core":"0.1.0"},"scripts":{"build":"tsc -p tsconfig.json","test":"vitest run --passWithNoTests","lint":"tsc -p tsconfig.json --noEmit","typecheck":"tsc -p tsconfig.json --noEmit"},"_id":"@bounkhong/idempotency-adapter-redis@0.1.0","_integrity":"sha512-A+bSRUUgL3Zwkz5l2RBqdz8Pn3216OE1okklWOkvtB0LYnpS7yk9edKlegDSqDwf1HLo3z4ajVXdQ7fcwZzP3g==","_resolved":"/tmp/3f44daa5c031e00627c6cea561cccd31/bounkhong-idempotency-adapter-redis-0.1.0.tgz","_from":"file:bounkhong-idempotency-adapter-redis-0.1.0.tgz","_nodeVersion":"22.22.3","_npmVersion":"10.9.8","dist":{"integrity":"sha512-A+bSRUUgL3Zwkz5l2RBqdz8Pn3216OE1okklWOkvtB0LYnpS7yk9edKlegDSqDwf1HLo3z4ajVXdQ7fcwZzP3g==","shasum":"3e0b4452541e96aeb00b996713725fe31c534ec6","tarball":"https://registry.npmjs.org/@bounkhong/idempotency-adapter-redis/-/idempotency-adapter-redis-0.1.0.tgz","fileCount":6,"unpackedSize":7989,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIF/PkFkPhb+Bx43JWbY2NOHVjgCGljytyLgn7rfuxsN9AiEAou3WFYjyRFylfwRo8c9ZClp8DMX2XNIszK5d7Ov0nGo="}]},"_npmUser":{"name":"bounkhong","email":"bounkhong6655@gmail.com"},"directories":{},"maintainers":[{"name":"bounkhong","email":"bounkhong6655@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/idempotency-adapter-redis_0.1.0_1779338609532_0.673393248737421"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-21T04:43:29.364Z","0.1.0":"2026-05-21T04:43:29.668Z","modified":"2026-05-21T04:43:29.871Z"},"maintainers":[{"name":"bounkhong","email":"bounkhong6655@gmail.com"}],"description":"Redis idempotency store adapter for AIF core","homepage":"https://github.com/aif/idempotency-package#readme","keywords":["idempotency","adapter","redis","nodejs"],"repository":{"type":"git","url":"git+https://github.com/aif/idempotency-package.git"},"author":{"name":"Bounkhong","url":"AIF"},"bugs":{"url":"https://github.com/aif/idempotency-package/issues"},"license":"MIT","readme":"# @bounkhong/idempotency-adapter-redis\n\nRedis-backed idempotency store using `SET NX + EX` for atomic begin semantics.\n\n## Install\n\n```bash\npnpm add @bounkhong/idempotency-adapter-redis @bounkhong/idempotency-core\n```\n\n## Redis client contract\n\nYour Redis client should provide:\n\n```ts\ninterface RedisLike {\n  set(key: string, value: string, opts: { NX?: boolean; EX?: number }): Promise<\"OK\" | null>;\n  get(key: string): Promise<string | null>;\n  expire(key: string, seconds: number): Promise<number>;\n}\n```\n\n## Usage\n\n```ts\nimport { RedisIdempotencyStore } from \"@bounkhong/idempotency-adapter-redis\";\n\nconst store = new RedisIdempotencyStore(redisClient);\n```\n\n## Notes\n\n- `begin` uses `SET ... NX EX` to ensure one writer starts execution\n- completed/failed metadata is stored with remaining TTL\n- for long-running requests, call `heartbeat(scopeKey, ttlSeconds)` to extend lock lifetime\n","readmeFilename":"README.md","_rev":"1-20f995c04c5ca8694f9e670ec227ab89"}