@fjell/cache 4.6.13 → 4.6.15
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/dist/Aggregator.d.ts +3 -3
- package/dist/Cache.d.ts +6 -6
- package/dist/CacheMap.d.ts +1 -1
- package/dist/Instance.d.ts +5 -5
- package/dist/InstanceFactory.d.ts +3 -3
- package/dist/Operations.d.ts +4 -4
- package/dist/index.js +715 -0
- package/dist/index.js.map +7 -0
- package/dist/logger.d.ts +1 -1
- package/dist/ops/action.d.ts +3 -3
- package/dist/ops/all.d.ts +3 -3
- package/dist/ops/allAction.d.ts +3 -3
- package/dist/ops/allFacet.d.ts +3 -3
- package/dist/ops/create.d.ts +3 -3
- package/dist/ops/facet.d.ts +3 -3
- package/dist/ops/find.d.ts +3 -3
- package/dist/ops/findOne.d.ts +3 -3
- package/dist/ops/get.d.ts +3 -3
- package/dist/ops/one.d.ts +3 -3
- package/dist/ops/remove.d.ts +3 -3
- package/dist/ops/reset.d.ts +3 -3
- package/dist/ops/retrieve.d.ts +3 -3
- package/dist/ops/set.d.ts +2 -2
- package/dist/ops/update.d.ts +3 -3
- package/package.json +8 -12
- package/dist/Aggregator.cjs.js +0 -322
- package/dist/Aggregator.es.js +0 -317
- package/dist/Cache.cjs.js +0 -35
- package/dist/Cache.es.js +0 -30
- package/dist/CacheMap.cjs.js +0 -170
- package/dist/CacheMap.es.js +0 -166
- package/dist/Instance.cjs.js +0 -23
- package/dist/Instance.es.js +0 -18
- package/dist/InstanceFactory.cjs.js +0 -35
- package/dist/InstanceFactory.es.js +0 -31
- package/dist/Operations.cjs.js +0 -43
- package/dist/Operations.es.js +0 -39
- package/dist/Registry.cjs.js +0 -36
- package/dist/Registry.es.js +0 -31
- package/dist/index.cjs +0 -940
- package/dist/index.cjs.js +0 -26
- package/dist/index.cjs.map +0 -1
- package/dist/index.es.js +0 -8
- package/dist/logger.cjs.js +0 -10
- package/dist/logger.es.js +0 -6
- package/dist/ops/action.cjs.js +0 -28
- package/dist/ops/action.es.js +0 -24
- package/dist/ops/all.cjs.js +0 -33
- package/dist/ops/all.es.js +0 -29
- package/dist/ops/allAction.cjs.js +0 -35
- package/dist/ops/allAction.es.js +0 -31
- package/dist/ops/allFacet.cjs.js +0 -22
- package/dist/ops/allFacet.es.js +0 -18
- package/dist/ops/create.cjs.js +0 -23
- package/dist/ops/create.es.js +0 -19
- package/dist/ops/facet.cjs.js +0 -21
- package/dist/ops/facet.es.js +0 -17
- package/dist/ops/find.cjs.js +0 -26
- package/dist/ops/find.es.js +0 -22
- package/dist/ops/findOne.cjs.js +0 -24
- package/dist/ops/findOne.es.js +0 -20
- package/dist/ops/get.cjs.js +0 -38
- package/dist/ops/get.es.js +0 -34
- package/dist/ops/one.cjs.js +0 -33
- package/dist/ops/one.es.js +0 -29
- package/dist/ops/remove.cjs.js +0 -30
- package/dist/ops/remove.es.js +0 -26
- package/dist/ops/reset.cjs.js +0 -15
- package/dist/ops/reset.es.js +0 -11
- package/dist/ops/retrieve.cjs.js +0 -37
- package/dist/ops/retrieve.es.js +0 -33
- package/dist/ops/set.cjs.js +0 -71
- package/dist/ops/set.es.js +0 -67
- package/dist/ops/update.cjs.js +0 -34
- package/dist/ops/update.es.js +0 -30
- package/docs/docs.config.ts +0 -75
- package/docs/index.html +0 -18
- package/docs/package.json +0 -34
- package/docs/public/README.md +0 -96
- package/docs/public/examples-README.md +0 -302
- package/docs/public/test.txt +0 -0
- package/docs/src/index.css +0 -3
- package/docs/src/main.tsx +0 -12
- package/docs/src/test/setup.ts +0 -1
- package/docs/tsconfig.node.json +0 -15
- package/examples/README.md +0 -302
- package/examples/aggregator-example.ts +0 -329
- package/examples/basic-cache-example.ts +0 -270
- package/examples/cache-map-example.ts +0 -265
- package/vitest.config.ts +0 -44
package/dist/Aggregator.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ComKey, Item, ItemQuery, LocKeyArray, PriKey } from
|
|
2
|
-
import { Cache } from
|
|
3
|
-
import { CacheMap } from
|
|
1
|
+
import { ComKey, Item, ItemQuery, LocKeyArray, PriKey } from "@fjell/core";
|
|
2
|
+
import { Cache } from "./Cache";
|
|
3
|
+
import { CacheMap } from "./CacheMap";
|
|
4
4
|
export interface Aggregator<V extends Item<S, L1, L2, L3, L4, L5>, S extends string, L1 extends string = never, L2 extends string = never, L3 extends string = never, L4 extends string = never, L5 extends string = never> extends Cache<V, S, L1, L2, L3, L4, L5> {
|
|
5
5
|
all: (query?: ItemQuery, locations?: LocKeyArray<L1, L2, L3, L4, L5> | []) => Promise<[CacheMap<V, S, L1, L2, L3, L4, L5>, V[]]>;
|
|
6
6
|
one: (query?: ItemQuery, locations?: LocKeyArray<L1, L2, L3, L4, L5> | []) => Promise<[CacheMap<V, S, L1, L2, L3, L4, L5>, V | null]>;
|
package/dist/Cache.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Item } from
|
|
2
|
-
import { Instance as BaseInstance, Coordinate, Registry } from
|
|
3
|
-
import { ClientApi } from
|
|
4
|
-
import { CacheMap } from
|
|
5
|
-
import { Operations } from
|
|
1
|
+
import { Item } from "@fjell/core";
|
|
2
|
+
import { Instance as BaseInstance, Coordinate, Registry } from "@fjell/registry";
|
|
3
|
+
import { ClientApi } from "@fjell/client-api";
|
|
4
|
+
import { CacheMap } from "@/CacheMap";
|
|
5
|
+
import { Operations } from "@/Operations";
|
|
6
6
|
/**
|
|
7
7
|
* The Cache interface extends the base Instance from @fjell/registry and adds cache operations
|
|
8
8
|
* for interacting with cached data.
|
|
@@ -24,5 +24,5 @@ export interface Cache<V extends Item<S, L1, L2, L3, L4, L5>, S extends string,
|
|
|
24
24
|
/** All cache operations that work with both cache and API */
|
|
25
25
|
operations: Operations<V, S, L1, L2, L3, L4, L5>;
|
|
26
26
|
}
|
|
27
|
-
export declare const createCache: <V extends Item<S, L1, L2, L3, L4, L5>, S extends string, L1 extends string = never, L2 extends string = never, L3 extends string = never, L4 extends string = never, L5 extends string = never>(api: ClientApi<V, S, L1, L2, L3, L4, L5>, coordinate: Coordinate<S, L1, L2, L3, L4, L5>, registry: Registry) =>
|
|
27
|
+
export declare const createCache: <V extends Item<S, L1, L2, L3, L4, L5>, S extends string, L1 extends string = never, L2 extends string = never, L3 extends string = never, L4 extends string = never, L5 extends string = never>(api: ClientApi<V, S, L1, L2, L3, L4, L5>, coordinate: Coordinate<S, L1, L2, L3, L4, L5>, registry: Registry) => Cache<V, S, L1, L2, L3, L4, L5>;
|
|
28
28
|
export declare const isCache: (cache: any) => cache is Cache<any, any, any, any, any, any, any>;
|
package/dist/CacheMap.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AllItemTypeArrays, ComKey, Dictionary, Item, ItemQuery, LocKeyArray, PriKey } from
|
|
1
|
+
import { AllItemTypeArrays, ComKey, Dictionary, Item, ItemQuery, LocKeyArray, PriKey } from "@fjell/core";
|
|
2
2
|
export declare class CacheMap<V extends Item<S, L1, L2, L3, L4, L5>, S extends string, L1 extends string = never, L2 extends string = never, L3 extends string = never, L4 extends string = never, L5 extends string = never> extends Dictionary<ComKey<S, L1, L2, L3, L4, L5> | PriKey<S>, V> {
|
|
3
3
|
private types;
|
|
4
4
|
constructor(types: AllItemTypeArrays<S, L1, L2, L3, L4, L5>, map?: {
|
package/dist/Instance.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Item } from
|
|
2
|
-
import { Coordinate, Registry } from
|
|
3
|
-
import { ClientApi } from
|
|
4
|
-
import { Cache } from
|
|
1
|
+
import { Item } from "@fjell/core";
|
|
2
|
+
import { Coordinate, Registry } from "@fjell/registry";
|
|
3
|
+
import { ClientApi } from "@fjell/client-api";
|
|
4
|
+
import { Cache } from "./Cache";
|
|
5
5
|
/**
|
|
6
6
|
* The Cache Instance interface represents a cache model instance that extends the base Instance
|
|
7
7
|
* from @fjell/registry and adds cache operations for interacting with cached data.
|
|
@@ -13,5 +13,5 @@ import { Cache } from './Cache';
|
|
|
13
13
|
* @template L1-L5 - Optional string literal types for location hierarchy levels
|
|
14
14
|
*/
|
|
15
15
|
export type Instance<V extends Item<S, L1, L2, L3, L4, L5>, S extends string, L1 extends string = never, L2 extends string = never, L3 extends string = never, L4 extends string = never, L5 extends string = never> = Cache<V, S, L1, L2, L3, L4, L5>;
|
|
16
|
-
export declare const createInstance: <V extends Item<S, L1, L2, L3, L4, L5>, S extends string, L1 extends string = never, L2 extends string = never, L3 extends string = never, L4 extends string = never, L5 extends string = never>(registry: Registry, coordinate: Coordinate<S, L1, L2, L3, L4, L5>, api: ClientApi<V, S, L1, L2, L3, L4, L5>) =>
|
|
16
|
+
export declare const createInstance: <V extends Item<S, L1, L2, L3, L4, L5>, S extends string, L1 extends string = never, L2 extends string = never, L3 extends string = never, L4 extends string = never, L5 extends string = never>(registry: Registry, coordinate: Coordinate<S, L1, L2, L3, L4, L5>, api: ClientApi<V, S, L1, L2, L3, L4, L5>) => Instance<V, S, L1, L2, L3, L4, L5>;
|
|
17
17
|
export declare const isInstance: (instance: any) => instance is Instance<any, any, any, any, any, any, any>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Item } from
|
|
2
|
-
import { ClientApi } from
|
|
3
|
-
import { InstanceFactory as BaseInstanceFactory } from
|
|
1
|
+
import { Item } from "@fjell/core";
|
|
2
|
+
import { ClientApi } from "@fjell/client-api";
|
|
3
|
+
import { InstanceFactory as BaseInstanceFactory } from "@fjell/registry";
|
|
4
4
|
export type InstanceFactory<V extends Item<S, L1, L2, L3, L4, L5>, S extends string, L1 extends string = never, L2 extends string = never, L3 extends string = never, L4 extends string = never, L5 extends string = never> = (api: ClientApi<V, S, L1, L2, L3, L4, L5>) => BaseInstanceFactory<S, L1, L2, L3, L4, L5>;
|
|
5
5
|
/**
|
|
6
6
|
* Factory function for creating cache instances
|
package/dist/Operations.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ComKey, Item, ItemQuery, LocKeyArray, PriKey } from
|
|
2
|
-
import { ClientApi } from
|
|
3
|
-
import { Coordinate } from
|
|
4
|
-
import { CacheMap } from
|
|
1
|
+
import { ComKey, Item, ItemQuery, LocKeyArray, PriKey } from "@fjell/core";
|
|
2
|
+
import { ClientApi } from "@fjell/client-api";
|
|
3
|
+
import { Coordinate } from "@fjell/registry";
|
|
4
|
+
import { CacheMap } from "@/CacheMap";
|
|
5
5
|
export interface Operations<V extends Item<S, L1, L2, L3, L4, L5>, S extends string, L1 extends string = never, L2 extends string = never, L3 extends string = never, L4 extends string = never, L5 extends string = never> {
|
|
6
6
|
/**
|
|
7
7
|
* Retrieves all the items that match the query from cache or API.
|