@keq-request/cache 5.0.0-alpha.22 → 5.0.0-alpha.23

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 (95) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/cache-entry/cache-entry.d.ts.map +1 -1
  3. package/dist/cache.d.ts +13 -4
  4. package/dist/cache.d.ts.map +1 -1
  5. package/dist/constants/index.d.ts +5 -0
  6. package/dist/constants/index.d.ts.map +1 -0
  7. package/dist/constants/max-expired-at.d.ts +2 -0
  8. package/dist/constants/max-expired-at.d.ts.map +1 -0
  9. package/dist/exceptions/cache-exception.d.ts +5 -0
  10. package/dist/exceptions/cache-exception.d.ts.map +1 -0
  11. package/dist/exceptions/index.d.ts +2 -0
  12. package/dist/exceptions/index.d.ts.map +1 -0
  13. package/dist/index.d.ts +4 -9
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +295 -224
  16. package/dist/index.js.map +1 -1
  17. package/dist/index.mjs +295 -224
  18. package/dist/index.mjs.map +1 -1
  19. package/dist/request-cache-handler/index.d.ts +3 -0
  20. package/dist/request-cache-handler/index.d.ts.map +1 -0
  21. package/dist/request-cache-handler/request-cache-handler.d.ts +22 -0
  22. package/dist/request-cache-handler/request-cache-handler.d.ts.map +1 -0
  23. package/dist/request-cache-handler/types/index.d.ts +2 -0
  24. package/dist/request-cache-handler/types/index.d.ts.map +1 -0
  25. package/dist/{types/keq-cache-option.d.ts → request-cache-handler/types/request-cache-options.d.ts} +6 -4
  26. package/dist/request-cache-handler/types/request-cache-options.d.ts.map +1 -0
  27. package/dist/storage/index.d.ts +4 -4
  28. package/dist/storage/index.d.ts.map +1 -1
  29. package/dist/storage/indexed-db-storage/base-indexed-db-storage.d.ts +2 -4
  30. package/dist/storage/indexed-db-storage/base-indexed-db-storage.d.ts.map +1 -1
  31. package/dist/storage/indexed-db-storage/index.d.ts +3 -0
  32. package/dist/storage/indexed-db-storage/index.d.ts.map +1 -0
  33. package/dist/storage/indexed-db-storage/indexed-db-storage.d.ts.map +1 -1
  34. package/dist/storage/indexed-db-storage/types/index.d.ts +7 -0
  35. package/dist/storage/indexed-db-storage/types/index.d.ts.map +1 -0
  36. package/dist/storage/indexed-db-storage/types/indexed-db-storage-options.d.ts +1 -1
  37. package/dist/storage/indexed-db-storage/types/indexed-db-storage-options.d.ts.map +1 -1
  38. package/dist/storage/internal-storage/internal-storage.d.ts +1 -1
  39. package/dist/storage/internal-storage/internal-storage.d.ts.map +1 -1
  40. package/dist/storage/memory-storage/base-memory-storage.d.ts +5 -4
  41. package/dist/storage/memory-storage/base-memory-storage.d.ts.map +1 -1
  42. package/dist/storage/memory-storage/index.d.ts +3 -0
  43. package/dist/storage/memory-storage/index.d.ts.map +1 -0
  44. package/dist/storage/memory-storage/memory-storage.d.ts +1 -0
  45. package/dist/storage/memory-storage/memory-storage.d.ts.map +1 -1
  46. package/dist/storage/memory-storage/types/index.d.ts +3 -0
  47. package/dist/storage/memory-storage/types/index.d.ts.map +1 -0
  48. package/dist/storage/memory-storage/types/memory-storage-options.d.ts +1 -1
  49. package/dist/storage/memory-storage/types/memory-storage-options.d.ts.map +1 -1
  50. package/dist/storage/memory-storage/utils/humanize-size.d.ts +6 -0
  51. package/dist/storage/memory-storage/utils/humanize-size.d.ts.map +1 -0
  52. package/dist/storage/memory-storage/utils/index.d.ts +3 -0
  53. package/dist/storage/memory-storage/utils/index.d.ts.map +1 -0
  54. package/dist/storage/memory-storage/utils/serialize-response-body.d.ts +6 -0
  55. package/dist/storage/memory-storage/utils/serialize-response-body.d.ts.map +1 -0
  56. package/dist/storage/multi-tier-storage/index.d.ts +1 -0
  57. package/dist/storage/multi-tier-storage/index.d.ts.map +1 -1
  58. package/dist/storage/multi-tier-storage/types/index.d.ts +2 -0
  59. package/dist/storage/multi-tier-storage/types/index.d.ts.map +1 -0
  60. package/dist/storage/tier-storage/index.d.ts +2 -2
  61. package/dist/storage/tier-storage/index.d.ts.map +1 -1
  62. package/dist/storage/tier-storage/types/index.d.ts +2 -0
  63. package/dist/storage/tier-storage/types/index.d.ts.map +1 -0
  64. package/dist/strategies/cache-first.d.ts.map +1 -1
  65. package/dist/strategies/index.d.ts +5 -0
  66. package/dist/strategies/index.d.ts.map +1 -0
  67. package/dist/strategies/network-first.d.ts.map +1 -1
  68. package/dist/strategies/network-only.d.ts.map +1 -1
  69. package/dist/strategies/stale-while-revalidate.d.ts.map +1 -1
  70. package/dist/types/index.d.ts +5 -0
  71. package/dist/types/index.d.ts.map +1 -0
  72. package/dist/types/keq-cache-key.d.ts +2 -1
  73. package/dist/types/keq-cache-key.d.ts.map +1 -1
  74. package/dist/types/keq-cache-pattern.d.ts +3 -0
  75. package/dist/types/keq-cache-pattern.d.ts.map +1 -0
  76. package/dist/types/keq-cache-rule.d.ts +4 -4
  77. package/dist/types/keq-cache-rule.d.ts.map +1 -1
  78. package/dist/types/keq-cache-strategy.d.ts +2 -2
  79. package/dist/types/keq-cache-strategy.d.ts.map +1 -1
  80. package/dist/utils/index.d.ts +4 -0
  81. package/dist/utils/index.d.ts.map +1 -0
  82. package/dist/utils/logger.d.ts +5 -0
  83. package/dist/utils/logger.d.ts.map +1 -0
  84. package/package.json +6 -11
  85. package/dist/strategies/utils/cache-context.d.ts +0 -5
  86. package/dist/strategies/utils/cache-context.d.ts.map +0 -1
  87. package/dist/strategies/utils/index.d.ts +0 -2
  88. package/dist/strategies/utils/index.d.ts.map +0 -1
  89. package/dist/types/keq-cache-option.d.ts.map +0 -1
  90. package/dist/types/keq-cache-parameters.d.ts +0 -12
  91. package/dist/types/keq-cache-parameters.d.ts.map +0 -1
  92. package/dist/types/strategies-options.d.ts +0 -14
  93. package/dist/types/strategies-options.d.ts.map +0 -1
  94. package/dist/utils/debug.d.ts +0 -2
  95. package/dist/utils/debug.d.ts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/memory-storage/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAA;AAC3C,cAAc,0BAA0B,CAAA"}
@@ -1,4 +1,4 @@
1
- import { Eviction } from '../../../constants/eviction.enum.js';
1
+ import { Eviction } from '../../../constants/index.js';
2
2
  import { InternalStorageOptions } from '../../../storage/internal-storage/types/storage-options.js';
3
3
  export interface MemoryStorageOptions extends InternalStorageOptions {
4
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"memory-storage-options.d.ts","sourceRoot":"","sources":["../../../../src/storage/memory-storage/types/memory-storage-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAA;AAE5F,MAAM,WAAW,oBAAqB,SAAQ,sBAAsB;IAClE;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACpB"}
1
+ {"version":3,"file":"memory-storage-options.d.ts","sourceRoot":"","sources":["../../../../src/storage/memory-storage/types/memory-storage-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAA;AAE5F,MAAM,WAAW,oBAAqB,SAAQ,sBAAsB;IAClE;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACpB"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @en Humanize size in bytes to KB, MB, GB
3
+ * @zh 将字节数转换为 KB、MB、GB 等易读格式
4
+ */
5
+ export declare function humanizeSize(size: number): string;
6
+ //# sourceMappingURL=humanize-size.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"humanize-size.d.ts","sourceRoot":"","sources":["../../../../src/storage/memory-storage/utils/humanize-size.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKjD"}
@@ -0,0 +1,3 @@
1
+ export * from './humanize-size';
2
+ export * from './serialize-response-body';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/memory-storage/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,2BAA2B,CAAA"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @en Serialize the response body based on content-type
3
+ * @zh 根据 content-type 序列化响应体
4
+ */
5
+ export declare function serializeResponseBody(response: Response): Promise<string>;
6
+ //# sourceMappingURL=serialize-response-body.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serialize-response-body.d.ts","sourceRoot":"","sources":["../../../../src/storage/memory-storage/utils/serialize-response-body.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAsB,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAqB/E"}
@@ -1,2 +1,3 @@
1
1
  export * from './multi-tier-storage.js';
2
+ export { MultiTierStorageOptions } from './types/index.js';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/multi-tier-storage/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/multi-tier-storage/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './multi-tier-storage-options.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/multi-tier-storage/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAA"}
@@ -1,3 +1,3 @@
1
- export { TierStorage } from './tier-storage.js';
2
- export type { TierStorageOptions } from './types/tier-storage-options.js';
1
+ export * from './tier-storage.js';
2
+ export { TierStorageOptions } from './types/index.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/tier-storage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,YAAY,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/tier-storage/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './tier-storage-options.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/tier-storage/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"cache-first.d.ts","sourceRoot":"","sources":["../../src/strategies/cache-first.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAIhE,eAAO,MAAM,UAAU,EAAE,gBA0BxB,CAAA"}
1
+ {"version":3,"file":"cache-first.d.ts","sourceRoot":"","sources":["../../src/strategies/cache-first.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAGhE,eAAO,MAAM,UAAU,EAAE,gBAwBxB,CAAA"}
@@ -0,0 +1,5 @@
1
+ export * from './cache-first.js';
2
+ export * from './network-first.js';
3
+ export * from './network-only.js';
4
+ export * from './stale-while-revalidate.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/strategies/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,mBAAmB,CAAA;AACjC,cAAc,6BAA6B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"network-first.d.ts","sourceRoot":"","sources":["../../src/strategies/network-first.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAKhE,eAAO,MAAM,YAAY,EAAE,gBA4B1B,CAAA"}
1
+ {"version":3,"file":"network-first.d.ts","sourceRoot":"","sources":["../../src/strategies/network-first.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAGhE,eAAO,MAAM,YAAY,EAAE,gBAwB1B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"network-only.d.ts","sourceRoot":"","sources":["../../src/strategies/network-only.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAIhE,eAAO,MAAM,WAAW,EAAE,gBAIzB,CAAA"}
1
+ {"version":3,"file":"network-only.d.ts","sourceRoot":"","sources":["../../src/strategies/network-only.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAGhE,eAAO,MAAM,WAAW,EAAE,gBAEzB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"stale-while-revalidate.d.ts","sourceRoot":"","sources":["../../src/strategies/stale-while-revalidate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAIhE,eAAO,MAAM,oBAAoB,EAAE,gBA8ClC,CAAA"}
1
+ {"version":3,"file":"stale-while-revalidate.d.ts","sourceRoot":"","sources":["../../src/strategies/stale-while-revalidate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAEhE,eAAO,MAAM,oBAAoB,EAAE,gBA4ClC,CAAA"}
@@ -0,0 +1,5 @@
1
+ export * from './keq-cache-key.js';
2
+ export * from './keq-cache-strategy.js';
3
+ export * from './keq-cache-rule.js';
4
+ export * from './keq-cache-pattern.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,wBAAwB,CAAA"}
@@ -1,3 +1,4 @@
1
1
  import { KeqContext } from 'keq';
2
- export type KeqCacheKey = string | ((context: KeqContext) => string);
2
+ export type KeqCacheKeyFactory = ((context: KeqContext) => string);
3
+ export type KeqCacheKey = string | KeqCacheKeyFactory;
3
4
  //# sourceMappingURL=keq-cache-key.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"keq-cache-key.d.ts","sourceRoot":"","sources":["../../src/types/keq-cache-key.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAGhC,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,CAAC,CAAC,OAAO,EAAE,UAAU,KAAK,MAAM,CAAC,CAAA"}
1
+ {"version":3,"file":"keq-cache-key.d.ts","sourceRoot":"","sources":["../../src/types/keq-cache-key.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAEhC,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,OAAO,EAAE,UAAU,KAAK,MAAM,CAAC,CAAA;AAClE,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,kBAAkB,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { KeqContext } from 'keq';
2
+ export type KeqCachePattern = RegExp | ((ctx: KeqContext) => boolean) | true;
3
+ //# sourceMappingURL=keq-cache-pattern.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keq-cache-pattern.d.ts","sourceRoot":"","sources":["../../src/types/keq-cache-pattern.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAGhC,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,CAAC,CAAC,GAAG,EAAE,UAAU,KAAK,OAAO,CAAC,GAAG,IAAI,CAAA"}
@@ -1,6 +1,6 @@
1
- import { KeqContext } from 'keq';
2
- import { KeqCacheOption } from './keq-cache-option.js';
3
- export interface KeqCacheRule extends KeqCacheOption {
4
- pattern?: RegExp | ((ctx: KeqContext) => boolean) | true;
1
+ import { RequestCacheOptions } from '../request-cache-handler/index.js';
2
+ import { KeqCachePattern } from './keq-cache-pattern.js';
3
+ export interface KeqCacheRule extends RequestCacheOptions {
4
+ pattern?: KeqCachePattern;
5
5
  }
6
6
  //# sourceMappingURL=keq-cache-rule.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"keq-cache-rule.d.ts","sourceRoot":"","sources":["../../src/types/keq-cache-rule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAGtD,MAAM,WAAW,YAAa,SAAQ,cAAc;IAClD,OAAO,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,EAAE,UAAU,KAAK,OAAO,CAAC,GAAG,IAAI,CAAA;CACzD"}
1
+ {"version":3,"file":"keq-cache-rule.d.ts","sourceRoot":"","sources":["../../src/types/keq-cache-rule.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAA;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAGxD,MAAM,WAAW,YAAa,SAAQ,mBAAmB;IACvD,OAAO,CAAC,EAAE,eAAe,CAAA;CAC1B"}
@@ -1,6 +1,6 @@
1
1
  import { KeqExecutionContext, KeqNext } from 'keq';
2
- import { StrategyOptions } from './strategies-options.js';
2
+ import { RequestCacheHandler } from '../request-cache-handler';
3
3
  export interface KeqCacheStrategy {
4
- (options: StrategyOptions): (context: KeqExecutionContext, next: KeqNext) => Promise<void>;
4
+ (handler: RequestCacheHandler, context: KeqExecutionContext, next: KeqNext): Promise<void>;
5
5
  }
6
6
  //# sourceMappingURL=keq-cache-strategy.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"keq-cache-strategy.d.ts","sourceRoot":"","sources":["../../src/types/keq-cache-strategy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAGzD,MAAM,WAAW,gBAAgB;IAC/B,CAAC,OAAO,EAAE,eAAe,GAAG,CAAC,OAAO,EAAE,mBAAmB,EAAE,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3F"}
1
+ {"version":3,"file":"keq-cache-strategy.d.ts","sourceRoot":"","sources":["../../src/types/keq-cache-strategy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAG7D,MAAM,WAAW,gBAAgB;IAC/B,CAAC,OAAO,EAAE,mBAAmB,EAAE,OAAO,EAAE,mBAAmB,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3F"}
@@ -0,0 +1,4 @@
1
+ export * from './logger.js';
2
+ export * from './random.js';
3
+ export * from './get-response-bytes.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,yBAAyB,CAAA"}
@@ -0,0 +1,5 @@
1
+ export declare class Logger {
2
+ static debug(...args: unknown[]): void;
3
+ static error(...args: unknown[]): void;
4
+ }
5
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA,qBAAa,MAAM;IACjB,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAItC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;CAGvC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keq-request/cache",
3
- "version": "5.0.0-alpha.22",
3
+ "version": "5.0.0-alpha.23",
4
4
  "description": "Adds request caching capabilities similar to service workers",
5
5
  "keywords": [
6
6
  "keq",
@@ -12,14 +12,9 @@
12
12
  "main": "dist/index.js",
13
13
  "exports": {
14
14
  ".": {
15
- "require": {
16
- "types": "./dist/index.d.ts",
17
- "default": "./dist/index.js"
18
- },
19
- "import": {
20
- "types": "./dist/index.d.mts",
21
- "default": "./dist/index.mjs"
22
- }
15
+ "types": "./dist/index.d.ts",
16
+ "require": "./dist/index.js",
17
+ "import": "./dist/index.mjs"
23
18
  }
24
19
  },
25
20
  "homepage": "https://keq-request.github.io",
@@ -35,10 +30,10 @@
35
30
  "@types/ramda": "^0.31.1",
36
31
  "fake-indexeddb": "^6.2.5",
37
32
  "isomorphic-fetch": "^3.0.0",
38
- "keq": "5.0.0-alpha.22"
33
+ "keq": "5.0.0-alpha.23"
39
34
  },
40
35
  "peerDependencies": {
41
- "keq": "^5.0.0-alpha.22"
36
+ "keq": "^5.0.0-alpha.23"
42
37
  },
43
38
  "dependencies": {
44
39
  "dayjs": "^1.11.19",
@@ -1,5 +0,0 @@
1
- import { KeqContext, KeqSharedContext } from 'keq';
2
- import { CacheEntry } from '../../cache-entry';
3
- import { StrategyOptions } from '../../types/strategies-options';
4
- export declare function cacheContext(opts: StrategyOptions, context: KeqContext | KeqSharedContext): Promise<CacheEntry | undefined>;
5
- //# sourceMappingURL=cache-context.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cache-context.d.ts","sourceRoot":"","sources":["../../../src/strategies/utils/cache-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAG5D,wBAAsB,YAAY,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,UAAU,GAAG,gBAAgB,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAejI"}
@@ -1,2 +0,0 @@
1
- export * from './cache-context.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/strategies/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"keq-cache-option.d.ts","sourceRoot":"","sources":["../../src/types/keq-cache-option.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAGhD,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,GAAG,CAAC,EAAE,WAAW,CAAA;IAEjB;;OAEG;IACH,QAAQ,EAAE,gBAAgB,CAAA;IAE1B;;;;;OAKG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,QAAQ,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,CAAA;CAC1D"}
@@ -1,12 +0,0 @@
1
- import { KeqContext } from 'keq';
2
- import { KeqCacheRule } from './keq-cache-rule.js';
3
- import { KeqCacheStorage } from '../storage/keq-cache-storage.js';
4
- export interface KeqCacheParameters {
5
- storage: KeqCacheStorage;
6
- /**
7
- * Cache Key Factory
8
- */
9
- keyFactory?: (context: KeqContext) => string;
10
- rules?: KeqCacheRule[];
11
- }
12
- //# sourceMappingURL=keq-cache-parameters.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"keq-cache-parameters.d.ts","sourceRoot":"","sources":["../../src/types/keq-cache-parameters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAGhE,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,eAAe,CAAA;IAExB;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,MAAM,CAAA;IAE5C,KAAK,CAAC,EAAE,YAAY,EAAE,CAAA;CACvB"}
@@ -1,14 +0,0 @@
1
- import { KeqCacheStorage } from '../storage/keq-cache-storage.js';
2
- export interface StrategyOptions {
3
- key: string;
4
- /**
5
- * @en seconds
6
- * @zh 秒
7
- *
8
- * @default Infinity
9
- */
10
- ttl?: number;
11
- storage: KeqCacheStorage;
12
- exclude?: (res: Response) => (boolean | Promise<boolean>);
13
- }
14
- //# sourceMappingURL=strategies-options.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"strategies-options.d.ts","sourceRoot":"","sources":["../../src/types/strategies-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAGhE,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAA;IAEX;;;;;OAKG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ,OAAO,EAAE,eAAe,CAAA;IAExB,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,QAAQ,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAA;CAC1D"}
@@ -1,2 +0,0 @@
1
- export declare function debug(...args: unknown[]): void;
2
- //# sourceMappingURL=debug.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/utils/debug.ts"],"names":[],"mappings":"AAAA,wBAAgB,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAE9C"}