@fjell/cache 4.6.7 → 4.6.11

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 (77) hide show
  1. package/dist/Aggregator.cjs.js +26 -20
  2. package/dist/Aggregator.d.ts +17 -1
  3. package/dist/Aggregator.es.js +26 -20
  4. package/dist/Cache.cjs.js +22 -345
  5. package/dist/Cache.d.ts +25 -20
  6. package/dist/Cache.es.js +22 -346
  7. package/dist/Instance.cjs.js +23 -0
  8. package/dist/Instance.d.ts +17 -0
  9. package/dist/Instance.es.js +18 -0
  10. package/dist/InstanceFactory.cjs.js +35 -0
  11. package/dist/InstanceFactory.d.ts +8 -0
  12. package/dist/InstanceFactory.es.js +31 -0
  13. package/dist/Operations.cjs.js +43 -0
  14. package/dist/Operations.d.ts +70 -0
  15. package/dist/Operations.es.js +39 -0
  16. package/dist/Registry.cjs.js +36 -0
  17. package/dist/Registry.d.ts +15 -0
  18. package/dist/Registry.es.js +31 -0
  19. package/dist/index.cjs +459 -408
  20. package/dist/index.cjs.js +12 -3
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.ts +4 -1
  23. package/dist/index.es.js +6 -3
  24. package/dist/ops/action.cjs.js +28 -0
  25. package/dist/ops/action.d.ts +4 -0
  26. package/dist/ops/action.es.js +24 -0
  27. package/dist/ops/all.cjs.js +33 -0
  28. package/dist/ops/all.d.ts +4 -0
  29. package/dist/ops/all.es.js +29 -0
  30. package/dist/ops/allAction.cjs.js +35 -0
  31. package/dist/ops/allAction.d.ts +4 -0
  32. package/dist/ops/allAction.es.js +31 -0
  33. package/dist/ops/allFacet.cjs.js +22 -0
  34. package/dist/ops/allFacet.d.ts +4 -0
  35. package/dist/ops/allFacet.es.js +18 -0
  36. package/dist/ops/create.cjs.js +23 -0
  37. package/dist/ops/create.d.ts +4 -0
  38. package/dist/ops/create.es.js +19 -0
  39. package/dist/ops/facet.cjs.js +21 -0
  40. package/dist/ops/facet.d.ts +4 -0
  41. package/dist/ops/facet.es.js +17 -0
  42. package/dist/ops/find.cjs.js +26 -0
  43. package/dist/ops/find.d.ts +4 -0
  44. package/dist/ops/find.es.js +22 -0
  45. package/dist/ops/findOne.cjs.js +24 -0
  46. package/dist/ops/findOne.d.ts +4 -0
  47. package/dist/ops/findOne.es.js +20 -0
  48. package/dist/ops/get.cjs.js +38 -0
  49. package/dist/ops/get.d.ts +4 -0
  50. package/dist/ops/get.es.js +34 -0
  51. package/dist/ops/one.cjs.js +33 -0
  52. package/dist/ops/one.d.ts +4 -0
  53. package/dist/ops/one.es.js +29 -0
  54. package/dist/ops/remove.cjs.js +30 -0
  55. package/dist/ops/remove.d.ts +4 -0
  56. package/dist/ops/remove.es.js +26 -0
  57. package/dist/ops/reset.cjs.js +15 -0
  58. package/dist/ops/reset.d.ts +4 -0
  59. package/dist/ops/reset.es.js +11 -0
  60. package/dist/ops/retrieve.cjs.js +37 -0
  61. package/dist/ops/retrieve.d.ts +4 -0
  62. package/dist/ops/retrieve.es.js +33 -0
  63. package/dist/ops/set.cjs.js +71 -0
  64. package/dist/ops/set.d.ts +3 -0
  65. package/dist/ops/set.es.js +67 -0
  66. package/dist/ops/update.cjs.js +34 -0
  67. package/dist/ops/update.d.ts +4 -0
  68. package/dist/ops/update.es.js +30 -0
  69. package/examples/README.md +302 -0
  70. package/examples/aggregator-example.ts +328 -0
  71. package/examples/basic-cache-example.ts +270 -0
  72. package/examples/cache-map-example.ts +265 -0
  73. package/package.json +7 -6
  74. package/vitest.config.ts +2 -2
  75. package/dist/CacheRegistry.cjs.js +0 -66
  76. package/dist/CacheRegistry.d.ts +0 -10
  77. package/dist/CacheRegistry.es.js +0 -62
@@ -0,0 +1,36 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const logger$1 = require('./logger.cjs.js');
6
+ const registry = require('@fjell/registry');
7
+
8
+ const logger = logger$1.default.get("Registry");
9
+ /**
10
+ * Factory function for creating cache registries
11
+ */ const createRegistryFactory = ()=>{
12
+ return (type, registryHub)=>{
13
+ if (type !== 'cache') {
14
+ throw new Error(`Cache registry factory can only create 'cache' type registries, got: ${type}`);
15
+ }
16
+ logger.debug("Creating cache registry", {
17
+ type,
18
+ registryHub
19
+ });
20
+ const baseRegistry = registry.createRegistry(type, registryHub);
21
+ // Cast to Registry for type safety
22
+ return baseRegistry;
23
+ };
24
+ };
25
+ /**
26
+ * Creates a new cache registry instance
27
+ */ const createRegistry = (registryHub)=>{
28
+ const baseRegistry = registry.createRegistry('cache', registryHub);
29
+ return {
30
+ ...baseRegistry
31
+ };
32
+ };
33
+
34
+ exports.createRegistry = createRegistry;
35
+ exports.createRegistryFactory = createRegistryFactory;
36
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVnaXN0cnkuY2pzLmpzIiwic291cmNlcyI6W10sInNvdXJjZXNDb250ZW50IjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OyJ9
@@ -0,0 +1,15 @@
1
+ import { Registry as BaseRegistry, RegistryFactory, RegistryHub } from '@fjell/registry';
2
+ /**
3
+ * Extended Registry interface for cache-specific functionality
4
+ */
5
+ export interface Registry extends BaseRegistry {
6
+ type: 'cache';
7
+ }
8
+ /**
9
+ * Factory function for creating cache registries
10
+ */
11
+ export declare const createRegistryFactory: () => RegistryFactory;
12
+ /**
13
+ * Creates a new cache registry instance
14
+ */
15
+ export declare const createRegistry: (registryHub?: RegistryHub) => Registry;
@@ -0,0 +1,31 @@
1
+ import LibLogger from './logger.es.js';
2
+ import { createRegistry as createRegistry$1 } from '@fjell/registry';
3
+
4
+ const logger = LibLogger.get("Registry");
5
+ /**
6
+ * Factory function for creating cache registries
7
+ */ const createRegistryFactory = ()=>{
8
+ return (type, registryHub)=>{
9
+ if (type !== 'cache') {
10
+ throw new Error(`Cache registry factory can only create 'cache' type registries, got: ${type}`);
11
+ }
12
+ logger.debug("Creating cache registry", {
13
+ type,
14
+ registryHub
15
+ });
16
+ const baseRegistry = createRegistry$1(type, registryHub);
17
+ // Cast to Registry for type safety
18
+ return baseRegistry;
19
+ };
20
+ };
21
+ /**
22
+ * Creates a new cache registry instance
23
+ */ const createRegistry = (registryHub)=>{
24
+ const baseRegistry = createRegistry$1('cache', registryHub);
25
+ return {
26
+ ...baseRegistry
27
+ };
28
+ };
29
+
30
+ export { createRegistry, createRegistryFactory };
31
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVnaXN0cnkuZXMuanMiLCJzb3VyY2VzIjpbXSwic291cmNlc0NvbnRlbnQiOltdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OyJ9