@nestjs-redisx/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.
Files changed (117) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +50 -0
  3. package/dist/cache/api/decorators/cached.decorator.d.ts +152 -0
  4. package/dist/cache/api/decorators/cached.decorator.d.ts.map +1 -0
  5. package/dist/cache/api/decorators/invalidate-tags.decorator.d.ts +44 -0
  6. package/dist/cache/api/decorators/invalidate-tags.decorator.d.ts.map +1 -0
  7. package/dist/cache/application/ports/cache-service.port.d.ts +120 -0
  8. package/dist/cache/application/ports/cache-service.port.d.ts.map +1 -0
  9. package/dist/cache/application/ports/l1-cache-store.port.d.ts +56 -0
  10. package/dist/cache/application/ports/l1-cache-store.port.d.ts.map +1 -0
  11. package/dist/cache/application/ports/l2-cache-store.port.d.ts +98 -0
  12. package/dist/cache/application/ports/l2-cache-store.port.d.ts.map +1 -0
  13. package/dist/cache/application/services/cache-decorator-initializer.service.d.ts +25 -0
  14. package/dist/cache/application/services/cache-decorator-initializer.service.d.ts.map +1 -0
  15. package/dist/cache/application/services/cache.service.d.ts +106 -0
  16. package/dist/cache/application/services/cache.service.d.ts.map +1 -0
  17. package/dist/cache/application/services/warmup.service.d.ts +25 -0
  18. package/dist/cache/application/services/warmup.service.d.ts.map +1 -0
  19. package/dist/cache/domain/services/serializer.service.d.ts +29 -0
  20. package/dist/cache/domain/services/serializer.service.d.ts.map +1 -0
  21. package/dist/cache/domain/value-objects/cache-entry.vo.d.ts +69 -0
  22. package/dist/cache/domain/value-objects/cache-entry.vo.d.ts.map +1 -0
  23. package/dist/cache/domain/value-objects/cache-key.vo.d.ts +45 -0
  24. package/dist/cache/domain/value-objects/cache-key.vo.d.ts.map +1 -0
  25. package/dist/cache/domain/value-objects/tag.vo.d.ts +36 -0
  26. package/dist/cache/domain/value-objects/tag.vo.d.ts.map +1 -0
  27. package/dist/cache/domain/value-objects/tags.vo.d.ts +57 -0
  28. package/dist/cache/domain/value-objects/tags.vo.d.ts.map +1 -0
  29. package/dist/cache/domain/value-objects/ttl.vo.d.ts +58 -0
  30. package/dist/cache/domain/value-objects/ttl.vo.d.ts.map +1 -0
  31. package/dist/cache/infrastructure/adapters/l1-memory-store.adapter.d.ts +36 -0
  32. package/dist/cache/infrastructure/adapters/l1-memory-store.adapter.d.ts.map +1 -0
  33. package/dist/cache/infrastructure/adapters/l2-redis-store.adapter.d.ts +41 -0
  34. package/dist/cache/infrastructure/adapters/l2-redis-store.adapter.d.ts.map +1 -0
  35. package/dist/cache.plugin.d.ts +17 -0
  36. package/dist/cache.plugin.d.ts.map +1 -0
  37. package/dist/cache.service.d.ts +234 -0
  38. package/dist/cache.service.d.ts.map +1 -0
  39. package/dist/decorators/cache-evict.decorator.d.ts +97 -0
  40. package/dist/decorators/cache-evict.decorator.d.ts.map +1 -0
  41. package/dist/decorators/cache-put.decorator.d.ts +95 -0
  42. package/dist/decorators/cache-put.decorator.d.ts.map +1 -0
  43. package/dist/decorators/cache.interceptor.d.ts +63 -0
  44. package/dist/decorators/cache.interceptor.d.ts.map +1 -0
  45. package/dist/decorators/cacheable.decorator.d.ts +88 -0
  46. package/dist/decorators/cacheable.decorator.d.ts.map +1 -0
  47. package/dist/decorators/key-generator.util.d.ts +69 -0
  48. package/dist/decorators/key-generator.util.d.ts.map +1 -0
  49. package/dist/index.d.ts +39 -0
  50. package/dist/index.d.ts.map +1 -0
  51. package/dist/index.js +4199 -0
  52. package/dist/index.js.map +1 -0
  53. package/dist/index.mjs +4152 -0
  54. package/dist/index.mjs.map +1 -0
  55. package/dist/invalidation/application/ports/event-invalidation.port.d.ts +28 -0
  56. package/dist/invalidation/application/ports/event-invalidation.port.d.ts.map +1 -0
  57. package/dist/invalidation/application/ports/invalidation-registry.port.d.ts +36 -0
  58. package/dist/invalidation/application/ports/invalidation-registry.port.d.ts.map +1 -0
  59. package/dist/invalidation/application/services/event-invalidation.service.d.ts +30 -0
  60. package/dist/invalidation/application/services/event-invalidation.service.d.ts.map +1 -0
  61. package/dist/invalidation/application/services/invalidation-registry.service.d.ts +17 -0
  62. package/dist/invalidation/application/services/invalidation-registry.service.d.ts.map +1 -0
  63. package/dist/invalidation/domain/entities/invalidation-rule.entity.d.ts +60 -0
  64. package/dist/invalidation/domain/entities/invalidation-rule.entity.d.ts.map +1 -0
  65. package/dist/invalidation/domain/value-objects/event-pattern.vo.d.ts +27 -0
  66. package/dist/invalidation/domain/value-objects/event-pattern.vo.d.ts.map +1 -0
  67. package/dist/invalidation/domain/value-objects/tag-template.vo.d.ts +34 -0
  68. package/dist/invalidation/domain/value-objects/tag-template.vo.d.ts.map +1 -0
  69. package/dist/invalidation/infrastructure/adapters/amqp-event-source.adapter.d.ts +51 -0
  70. package/dist/invalidation/infrastructure/adapters/amqp-event-source.adapter.d.ts.map +1 -0
  71. package/dist/invalidation/infrastructure/decorators/invalidate-on.decorator.d.ts +69 -0
  72. package/dist/invalidation/infrastructure/decorators/invalidate-on.decorator.d.ts.map +1 -0
  73. package/dist/key-builder.d.ts +199 -0
  74. package/dist/key-builder.d.ts.map +1 -0
  75. package/dist/serializers/index.d.ts +19 -0
  76. package/dist/serializers/index.d.ts.map +1 -0
  77. package/dist/serializers/json.serializer.d.ts +51 -0
  78. package/dist/serializers/json.serializer.d.ts.map +1 -0
  79. package/dist/serializers/msgpack.serializer.d.ts +67 -0
  80. package/dist/serializers/msgpack.serializer.d.ts.map +1 -0
  81. package/dist/serializers/serializer.interface.d.ts +36 -0
  82. package/dist/serializers/serializer.interface.d.ts.map +1 -0
  83. package/dist/shared/constants/index.d.ts +73 -0
  84. package/dist/shared/constants/index.d.ts.map +1 -0
  85. package/dist/shared/errors/index.d.ts +46 -0
  86. package/dist/shared/errors/index.d.ts.map +1 -0
  87. package/dist/shared/types/context-provider.interface.d.ts +58 -0
  88. package/dist/shared/types/context-provider.interface.d.ts.map +1 -0
  89. package/dist/shared/types/index.d.ts +259 -0
  90. package/dist/shared/types/index.d.ts.map +1 -0
  91. package/dist/stampede/application/ports/stampede-protection.port.d.ts +33 -0
  92. package/dist/stampede/application/ports/stampede-protection.port.d.ts.map +1 -0
  93. package/dist/stampede/infrastructure/stampede-protection.service.d.ts +30 -0
  94. package/dist/stampede/infrastructure/stampede-protection.service.d.ts.map +1 -0
  95. package/dist/strategies/eviction-strategy.interface.d.ts +39 -0
  96. package/dist/strategies/eviction-strategy.interface.d.ts.map +1 -0
  97. package/dist/strategies/fifo.strategy.d.ts +86 -0
  98. package/dist/strategies/fifo.strategy.d.ts.map +1 -0
  99. package/dist/strategies/index.d.ts +19 -0
  100. package/dist/strategies/index.d.ts.map +1 -0
  101. package/dist/strategies/lfu.strategy.d.ts +87 -0
  102. package/dist/strategies/lfu.strategy.d.ts.map +1 -0
  103. package/dist/strategies/lru.strategy.d.ts +78 -0
  104. package/dist/strategies/lru.strategy.d.ts.map +1 -0
  105. package/dist/swr/application/ports/swr-manager.port.d.ts +83 -0
  106. package/dist/swr/application/ports/swr-manager.port.d.ts.map +1 -0
  107. package/dist/swr/infrastructure/swr-manager.service.d.ts +30 -0
  108. package/dist/swr/infrastructure/swr-manager.service.d.ts.map +1 -0
  109. package/dist/tags/application/ports/tag-index.port.d.ts +55 -0
  110. package/dist/tags/application/ports/tag-index.port.d.ts.map +1 -0
  111. package/dist/tags/infrastructure/repositories/tag-index.repository.d.ts +37 -0
  112. package/dist/tags/infrastructure/repositories/tag-index.repository.d.ts.map +1 -0
  113. package/dist/tags/infrastructure/scripts/lua-scripts.d.ts +25 -0
  114. package/dist/tags/infrastructure/scripts/lua-scripts.d.ts.map +1 -0
  115. package/dist/tags/infrastructure/services/lua-script-loader.service.d.ts +44 -0
  116. package/dist/tags/infrastructure/services/lua-script-loader.service.d.ts.map +1 -0
  117. package/package.json +79 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lua-script-loader.service.d.ts","sourceRoot":"","sources":["../../../../src/tags/infrastructure/services/lua-script-loader.service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAsB,YAAY,EAAU,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAgB,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAYjE,qBACa,eAAgB,YAAW,YAAY;IAIhB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAHzD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoC;IAC3D,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA6B;gBAEL,MAAM,EAAE,YAAY;IAEjE,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAInC;;OAEG;YACW,WAAW;IAiBzB;;;;;;;OAOG;IACG,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;IAU9F;;;;;OAKG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAI9C;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;CAGtC"}
package/package.json ADDED
@@ -0,0 +1,79 @@
1
+ {
2
+ "name": "@nestjs-redisx/cache",
3
+ "version": "1.0.0",
4
+ "description": "Advanced caching plugin for NestJS RedisX with L1+L2, anti-stampede, SWR, and tag invalidation",
5
+ "author": "NestJS RedisX Team",
6
+ "license": "MIT",
7
+ "main": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "require": "./dist/index.js",
13
+ "import": "./dist/index.js",
14
+ "default": "./dist/index.js"
15
+ }
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "README.md",
20
+ "LICENSE"
21
+ ],
22
+ "scripts": {
23
+ "build": "tsup",
24
+ "test": "SKIP_INTEGRATION=true vitest run",
25
+ "test:watch": "SKIP_INTEGRATION=true vitest",
26
+ "test:cov": "SKIP_INTEGRATION=true vitest run --coverage",
27
+ "test:integration": "vitest run test/integration/cache-with-redis.integration.spec.ts",
28
+ "test:integration:watch": "vitest watch test/integration/cache-with-redis.integration.spec.ts",
29
+ "docker:up": "docker-compose up -d",
30
+ "docker:down": "docker-compose down",
31
+ "docker:logs": "docker-compose logs -f redis",
32
+ "test:docker": "npm run docker:up && sleep 3 && npm run test:integration; TEST_EXIT=$?; npm run docker:down; exit $TEST_EXIT",
33
+ "test:all": "npm test && npm run test:integration",
34
+ "lint": "eslint \"{src,test}/**/*.ts\"",
35
+ "format": "prettier --write \"{src,test}/**/*.ts\""
36
+ },
37
+ "keywords": [
38
+ "nestjs",
39
+ "redis",
40
+ "cache",
41
+ "l1",
42
+ "l2",
43
+ "stampede",
44
+ "swr",
45
+ "tags",
46
+ "invalidation"
47
+ ],
48
+ "repository": {
49
+ "type": "git",
50
+ "url": "https://github.com/nestjs-redisx/nestjs-redisx.git",
51
+ "directory": "packages/cache"
52
+ },
53
+ "homepage": "https://nestjs-redisx.dev/en/reference/cache/",
54
+ "bugs": {
55
+ "url": "https://github.com/nestjs-redisx/nestjs-redisx/issues"
56
+ },
57
+ "peerDependencies": {
58
+ "@nestjs-redisx/core": "^1.0.0",
59
+ "@nestjs/common": "^10.0.0",
60
+ "@nestjs/core": "^10.0.0",
61
+ "reflect-metadata": "^0.2.0",
62
+ "rxjs": "^7.8.0"
63
+ },
64
+ "devDependencies": {
65
+ "@nestjs/testing": "^10.0.0",
66
+ "@types/node": "^20.0.0",
67
+ "@typescript-eslint/eslint-plugin": "^6.0.0",
68
+ "@typescript-eslint/parser": "^6.0.0",
69
+ "eslint": "^8.0.0",
70
+ "prettier": "^3.0.0",
71
+ "tsup": "^8.0.0",
72
+ "typescript": "^5.3.0",
73
+ "vitest": "^1.6.0",
74
+ "@vitest/coverage-v8": "^1.6.0"
75
+ },
76
+ "publishConfig": {
77
+ "access": "public"
78
+ }
79
+ }