@hf-chimera/store 0.0.8 → 0.0.9
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/CHANGELOG.md +6 -0
- package/dist/adapters/react.cjs +3 -2
- package/dist/adapters/react.d.cts +2 -2
- package/dist/adapters/react.d.ts +2 -2
- package/dist/adapters/react.js +3 -2
- package/dist/adapters/react.js.map +1 -1
- package/dist/defaults-Bg1kIemd.cjs +371 -0
- package/dist/defaults-CLUQg2zK.js +210 -0
- package/dist/defaults-CLUQg2zK.js.map +1 -0
- package/dist/defaults.cjs +21 -0
- package/dist/defaults.d.cts +59 -0
- package/dist/defaults.d.cts.map +1 -0
- package/dist/defaults.d.ts +59 -0
- package/dist/defaults.d.ts.map +1 -0
- package/dist/defaults.js +13 -0
- package/dist/defaults.js.map +1 -0
- package/dist/{index-kFATKhTP.d.ts → index-BXn5xYo5.d.ts} +21 -2
- package/dist/index-BXn5xYo5.d.ts.map +1 -0
- package/dist/{index-DgwhyIVQ.d.cts → index-Bl61_G1s.d.cts} +21 -2
- package/dist/index-Bl61_G1s.d.cts.map +1 -0
- package/dist/{index-Mu4KG7Z7.d.cts → index-DJ2lT0xs.d.cts} +2 -2
- package/dist/{index-Mu4KG7Z7.d.cts.map → index-DJ2lT0xs.d.cts.map} +1 -1
- package/dist/{index-CqYNg3Vx.d.ts → index-DNJ6xgnR.d.ts} +2 -2
- package/dist/{index-CqYNg3Vx.d.ts.map → index-DNJ6xgnR.d.ts.map} +1 -1
- package/dist/index.cjs +13 -12
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/{qb-DHuihkTp.js → qb-DNcihcMP.js} +2 -2
- package/dist/{qb-DHuihkTp.js.map → qb-DNcihcMP.js.map} +1 -1
- package/dist/{qb-Cg4Q_DkJ.cjs → qb-pl8eUjYV.cjs} +1 -1
- package/dist/qb.cjs +3 -2
- package/dist/qb.d.cts +2 -2
- package/dist/qb.d.ts +2 -2
- package/dist/qb.js +3 -2
- package/dist/{src-Bx-gbHfm.js → src-BTo-wGWx.js} +3 -209
- package/dist/src-BTo-wGWx.js.map +1 -0
- package/dist/{src-u2_wgi_K.cjs → src-FCZZKq4W.cjs} +47 -320
- package/package.json +6 -1
- package/dist/index-DgwhyIVQ.d.cts.map +0 -1
- package/dist/index-kFATKhTP.d.ts.map +0 -1
- package/dist/src-Bx-gbHfm.js.map +0 -1
package/CHANGELOG.md
CHANGED
package/dist/adapters/react.cjs
CHANGED
|
@@ -21,8 +21,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
21
21
|
}) : target, mod));
|
|
22
22
|
|
|
23
23
|
//#endregion
|
|
24
|
-
require('../
|
|
25
|
-
|
|
24
|
+
require('../defaults-Bg1kIemd.cjs');
|
|
25
|
+
require('../src-FCZZKq4W.cjs');
|
|
26
|
+
const require_qb = require('../qb-pl8eUjYV.cjs');
|
|
26
27
|
let react = require("react");
|
|
27
28
|
react = __toESM(react);
|
|
28
29
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ChimeraItemQuery, P as ChimeraCollectionQuery, _ as ChimeraStoreEntityType, b as ChimeraEntityRepository,
|
|
2
|
-
import { n as QueryBuilderCreator } from "../index-
|
|
1
|
+
import { C as ChimeraItemQuery, Et as ChimeraEntityId, P as ChimeraCollectionQuery, _ as ChimeraStoreEntityType, b as ChimeraEntityRepository, h as ChimeraStoreEntities, p as AnyChimeraStore, x as ChimeraCollectionParams, y as ChimeraStoreOperatorMap } from "../index-Bl61_G1s.cjs";
|
|
2
|
+
import { n as QueryBuilderCreator } from "../index-DJ2lT0xs.cjs";
|
|
3
3
|
import * as react0 from "react";
|
|
4
4
|
import { ReactNode } from "react";
|
|
5
5
|
|
package/dist/adapters/react.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ChimeraItemQuery, P as ChimeraCollectionQuery, _ as ChimeraStoreEntityType, b as ChimeraEntityRepository,
|
|
2
|
-
import { n as QueryBuilderCreator } from "../index-
|
|
1
|
+
import { C as ChimeraItemQuery, Et as ChimeraEntityId, P as ChimeraCollectionQuery, _ as ChimeraStoreEntityType, b as ChimeraEntityRepository, h as ChimeraStoreEntities, p as AnyChimeraStore, x as ChimeraCollectionParams, y as ChimeraStoreOperatorMap } from "../index-BXn5xYo5.js";
|
|
2
|
+
import { n as QueryBuilderCreator } from "../index-DNJ6xgnR.js";
|
|
3
3
|
import * as react0 from "react";
|
|
4
4
|
import { ReactNode } from "react";
|
|
5
5
|
|
package/dist/adapters/react.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import
|
|
1
|
+
import "../defaults-CLUQg2zK.js";
|
|
2
|
+
import "../src-BTo-wGWx.js";
|
|
3
|
+
import { t as ChimeraQueryBuilder } from "../qb-DNcihcMP.js";
|
|
3
4
|
import { createContext, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
4
5
|
|
|
5
6
|
//#region packages/adapters/react/context.tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","names":[],"sources":["../../packages/adapters/react/context.tsx","../../packages/adapters/react/hooks.ts"],"sourcesContent":["import { createContext, type ReactNode, useMemo } from \"react\";\nimport type { AnyChimeraStore } from \"../../../src/store\";\n\nexport interface ChimeraStoreContextValue<T extends AnyChimeraStore> {\n\tstore: T;\n}\n\nexport interface ChimeraStoreProviderProps<T extends AnyChimeraStore> {\n\tchildren: ReactNode;\n\tstore: T;\n}\n\nexport const ChimeraStoreContext = createContext<ChimeraStoreContextValue<AnyChimeraStore> | null>(null);\n\nexport const ChimeraStoreProvider = <T extends AnyChimeraStore>({ children, store }: ChimeraStoreProviderProps<T>) => (\n\t<ChimeraStoreContext.Provider value={useMemo(() => ({ store }), [store])}>{children}</ChimeraStoreContext.Provider>\n);\n","import { useContext, useEffect, useMemo, useRef, useState } from \"react\";\nimport type { ChimeraCollectionQuery } from \"../../../src/query/ChimeraCollectionQuery\";\nimport type { ChimeraItemQuery } from \"../../../src/query/ChimeraItemQuery\";\nimport type { ChimeraEntityId } from \"../../../src/shared/types\";\nimport type { ChimeraEntityRepository } from \"../../../src/store/ChimeraEntityRepository\";\nimport type {\n\tAnyChimeraStore,\n\tChimeraStoreEntities,\n\tChimeraStoreEntityType,\n\tChimeraStoreOperatorMap,\n} from \"../../../src/store/ChimeraStore\";\nimport type { ChimeraCollectionParams } from \"../../../src/store/types\";\nimport { ChimeraQueryBuilder, type QueryBuilderCreator } from \"../../qb\";\nimport { ChimeraStoreContext } from \"./context\";\n\nexport function useChimeraStore<T extends AnyChimeraStore>(): T {\n\tconst context = useContext(ChimeraStoreContext);\n\tif (!context) {\n\t\tthrow new Error(\"useChimeraStore must be used within a ChimeraStoreProvider\");\n\t}\n\treturn context.store as T;\n}\n\nexport function useChimeraRepository<T extends AnyChimeraStore, EntityName extends ChimeraStoreEntities<T>>(\n\tentityName: EntityName,\n): ChimeraEntityRepository<ChimeraStoreEntityType<T, EntityName>, ChimeraStoreOperatorMap<T>> {\n\tconst store = useChimeraStore<T>();\n\treturn store.from(entityName);\n}\n\nconst CHIMERA_COLLECTION_UPDATE_EVENTS = [\n\t\"ready\",\n\t\"updated\",\n\t\"selfUpdated\",\n\t\"selfItemCreated\",\n\t\"itemAdded\",\n\t\"itemUpdated\",\n\t\"selfItemUpdated\",\n\t\"itemDeleted\",\n\t\"selfItemDeleted\",\n\t\"error\",\n] as const;\nexport const useChimeraCollection = <T extends AnyChimeraStore, EntityName extends ChimeraStoreEntities<T>, Meta = any>(\n\tentityName: EntityName,\n\tparams:\n\t\t| ChimeraCollectionParams<ChimeraStoreOperatorMap<T>, ChimeraStoreEntityType<T, EntityName>, Meta>\n\t\t| QueryBuilderCreator<T, ChimeraStoreEntityType<T, EntityName>, ChimeraStoreOperatorMap<T>>,\n\tdeps?: unknown[],\n): ChimeraCollectionQuery<ChimeraStoreEntityType<T, EntityName>, ChimeraStoreOperatorMap<T>> => {\n\tconst [, trigger] = useState(() => ({}));\n\n\tconst repository = useChimeraRepository<T, EntityName>(entityName);\n\n\tconst oldDeps = useRef(deps);\n\tif ((oldDeps.current && !deps) || (!oldDeps.current && deps)) {\n\t\tconsole.warn(\n\t\t\t\"useChimeraCollection deps is not a reactive param!\\n\" +\n\t\t\t\t\"Use deps if you want to control dependencies manually.\\n\" +\n\t\t\t\t\"Omit it if you already have a stable reference to params\",\n\t\t);\n\t}\n\toldDeps.current = deps;\n\n\tconst memeParams = useMemo(\n\t\t() => {\n\t\t\tif (typeof params !== \"function\") return params;\n\n\t\t\tconst q = new ChimeraQueryBuilder();\n\t\t\tparams(q);\n\t\t\treturn q.build();\n\t\t},\n\t\t// biome-ignore lint/correctness/useExhaustiveDependencies: Very unlikely it will be changed over time, anyway warning for this already added.\n\t\tdeps ? deps : [params],\n\t);\n\tconst collection = useMemo(() => repository.getCollection(memeParams), [repository, memeParams]);\n\n\tuseEffect(() => {\n\t\tconst handler = () => trigger({});\n\t\tfor (const event of CHIMERA_COLLECTION_UPDATE_EVENTS) {\n\t\t\tcollection.on(event, handler);\n\t\t}\n\t\treturn () => {\n\t\t\tfor (const event of CHIMERA_COLLECTION_UPDATE_EVENTS) {\n\t\t\t\tcollection.off(event, handler);\n\t\t\t}\n\t\t};\n\t}, [collection]);\n\n\treturn collection;\n};\n\nconst CHIMERA_ITEM_UPDATE_EVENTS = [\n\t\"initialized\",\n\t\"selfCreated\",\n\t\"ready\",\n\t\"updated\",\n\t\"selfUpdated\",\n\t\"deleted\",\n\t\"selfDeleted\",\n\t\"error\",\n] as const;\nexport const useChimeraItem = <T extends AnyChimeraStore, EntityName extends ChimeraStoreEntities<T>, Meta = any>(\n\tentityName: EntityName,\n\tid: ChimeraEntityId,\n\tmeta?: Meta,\n): ChimeraItemQuery<ChimeraStoreEntityType<T, EntityName>> => {\n\tconst [, trigger] = useState(() => ({}));\n\n\tconst repository = useChimeraRepository<T, EntityName>(entityName);\n\tconst item = repository.getItem(id, meta);\n\n\tuseEffect(() => {\n\t\tconst handler = () => trigger({});\n\t\tfor (const event of CHIMERA_ITEM_UPDATE_EVENTS) {\n\t\t\titem.on(event, handler);\n\t\t}\n\t\treturn () => {\n\t\t\tfor (const event of CHIMERA_ITEM_UPDATE_EVENTS) {\n\t\t\t\titem.off(event, handler);\n\t\t\t}\n\t\t};\n\t}, [item]);\n\n\treturn item;\n};\n\nexport function getChimeraTypedHooks<T extends AnyChimeraStore>(\n\twithoutPrefix: true,\n): {\n\tuseStore: () => T;\n\tuseRepository: <EntityName extends ChimeraStoreEntities<T>>(\n\t\tentityName: EntityName,\n\t) => ChimeraEntityRepository<ChimeraStoreEntityType<T, EntityName>, ChimeraStoreOperatorMap<T>>;\n\tuseCollection: <EntityName extends ChimeraStoreEntities<T>, Meta = any>(\n\t\tentityName: EntityName,\n\t\tparams: ChimeraCollectionParams<ChimeraStoreOperatorMap<T>, ChimeraStoreEntityType<T, EntityName>, Meta>,\n\t\tdeps?: unknown[],\n\t) => ChimeraCollectionQuery<ChimeraStoreEntityType<T, EntityName>, ChimeraStoreOperatorMap<T>>;\n\tuseItem: <EntityName extends ChimeraStoreEntities<T>, Meta = any>(\n\t\tentityName: EntityName,\n\t\tid: ChimeraEntityId,\n\t\tmeta?: Meta,\n\t) => ChimeraItemQuery<ChimeraStoreEntityType<T, EntityName>>;\n};\nexport function getChimeraTypedHooks<T extends AnyChimeraStore>(\n\twithoutPrefix?: false,\n): {\n\tuseChimeraStore: () => T;\n\tuseChimeraRepository: <EntityName extends ChimeraStoreEntities<T>>(\n\t\tentityName: EntityName,\n\t) => ChimeraEntityRepository<ChimeraStoreEntityType<T, EntityName>, ChimeraStoreOperatorMap<T>>;\n\tuseChimeraCollection: <EntityName extends ChimeraStoreEntities<T>, Meta = any>(\n\t\tentityName: EntityName,\n\t\tparams:\n\t\t\t| ChimeraCollectionParams<ChimeraStoreOperatorMap<T>, ChimeraStoreEntityType<T, EntityName>, Meta>\n\t\t\t| QueryBuilderCreator<T, ChimeraStoreEntityType<T, EntityName>, ChimeraStoreOperatorMap<T>>,\n\t\tdeps?: unknown[],\n\t) => ChimeraCollectionQuery<ChimeraStoreEntityType<T, EntityName>, ChimeraStoreOperatorMap<T>>;\n\tuseChimeraItem: <EntityName extends ChimeraStoreEntities<T>, Meta = any>(\n\t\tentityName: EntityName,\n\t\tid: ChimeraEntityId,\n\t\tmeta?: Meta,\n\t) => ChimeraItemQuery<ChimeraStoreEntityType<T, EntityName>>;\n};\nexport function getChimeraTypedHooks<T extends AnyChimeraStore>(\n\twithoutPrefix?: boolean,\n):\n\t| {\n\t\t\tuseChimeraStore: () => T;\n\t\t\tuseChimeraRepository: <EntityName extends ChimeraStoreEntities<T>>(\n\t\t\t\tentityName: EntityName,\n\t\t\t) => ChimeraEntityRepository<ChimeraStoreEntityType<T, EntityName>, ChimeraStoreOperatorMap<T>>;\n\t\t\tuseChimeraCollection: <EntityName extends ChimeraStoreEntities<T>, Meta = any>(\n\t\t\t\tentityName: EntityName,\n\t\t\t\tparams: ChimeraCollectionParams<ChimeraStoreOperatorMap<T>, ChimeraStoreEntityType<T, EntityName>, Meta>,\n\t\t\t\tdeps?: unknown[],\n\t\t\t) => ChimeraCollectionQuery<ChimeraStoreEntityType<T, EntityName>, ChimeraStoreOperatorMap<T>>;\n\t\t\tuseChimeraItem: <EntityName extends ChimeraStoreEntities<T>, Meta = any>(\n\t\t\t\tentityName: EntityName,\n\t\t\t\tid: ChimeraEntityId,\n\t\t\t\tmeta?: Meta,\n\t\t\t) => ChimeraItemQuery<ChimeraStoreEntityType<T, EntityName>>;\n\t }\n\t| {\n\t\t\tuseStore: () => T;\n\t\t\tuseRepository: <EntityName extends ChimeraStoreEntities<T>>(\n\t\t\t\tentityName: EntityName,\n\t\t\t) => ChimeraEntityRepository<ChimeraStoreEntityType<T, EntityName>, ChimeraStoreOperatorMap<T>>;\n\t\t\tuseCollection: <EntityName extends ChimeraStoreEntities<T>, Meta = any>(\n\t\t\t\tentityName: EntityName,\n\t\t\t\tparams: ChimeraCollectionParams<ChimeraStoreOperatorMap<T>, ChimeraStoreEntityType<T, EntityName>, Meta>,\n\t\t\t\tdeps?: unknown[],\n\t\t\t) => ChimeraCollectionQuery<ChimeraStoreEntityType<T, EntityName>, ChimeraStoreOperatorMap<T>>;\n\t\t\tuseItem: <EntityName extends ChimeraStoreEntities<T>, Meta = any>(\n\t\t\t\tentityName: EntityName,\n\t\t\t\tid: ChimeraEntityId,\n\t\t\t\tmeta?: Meta,\n\t\t\t) => ChimeraItemQuery<ChimeraStoreEntityType<T, EntityName>>;\n\t } {\n\treturn (\n\t\twithoutPrefix\n\t\t\t? {\n\t\t\t\t\tuseCollection: useChimeraCollection,\n\t\t\t\t\tuseItem: useChimeraItem,\n\t\t\t\t\tuseRepository: useChimeraRepository,\n\t\t\t\t\tuseStore: useChimeraStore,\n\t\t\t\t}\n\t\t\t: {\n\t\t\t\t\tuseChimeraCollection,\n\t\t\t\t\tuseChimeraItem,\n\t\t\t\t\tuseChimeraRepository,\n\t\t\t\t\tuseChimeraStore,\n\t\t\t\t}\n\t) as ReturnType<typeof getChimeraTypedHooks<T>>;\n}\n"],"mappings":";;;;;AAYA,MAAa,sBAAsB,cAAgE,KAAK;AAExG,MAAa,wBAAmD,EAAE,UAAU,YAC3E,CAAC,oBAAoB,SAAS,OAAO,eAAe,EAAE,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,SAAS,EAAE,oBAAoB;;;;ACA3G,SAAgB,kBAAgD;CAC/D,MAAM,UAAU,WAAW,oBAAoB;AAC/C,KAAI,CAAC,QACJ,OAAM,IAAI,MAAM,6DAA6D;AAE9E,QAAO,QAAQ;;AAGhB,SAAgB,qBACf,YAC6F;AAE7F,QADc,iBAAoB,CACrB,KAAK,WAAW;;AAG9B,MAAM,mCAAmC;CACxC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,MAAa,wBACZ,YACA,QAGA,SAC+F;CAC/F,MAAM,GAAG,WAAW,gBAAgB,EAAE,EAAE;CAExC,MAAM,aAAa,qBAAoC,WAAW;CAElE,MAAM,UAAU,OAAO,KAAK;AAC5B,KAAK,QAAQ,WAAW,CAAC,QAAU,CAAC,QAAQ,WAAW,KACtD,SAAQ,KACP,uKAGA;AAEF,SAAQ,UAAU;CAElB,MAAM,aAAa,cACZ;AACL,MAAI,OAAO,WAAW,WAAY,QAAO;EAEzC,MAAM,IAAI,IAAI,qBAAqB;AACnC,SAAO,EAAE;AACT,SAAO,EAAE,OAAO;IAGjB,OAAO,OAAO,CAAC,OAAO,CACtB;CACD,MAAM,aAAa,cAAc,WAAW,cAAc,WAAW,EAAE,CAAC,YAAY,WAAW,CAAC;AAEhG,iBAAgB;EACf,MAAM,gBAAgB,QAAQ,EAAE,CAAC;AACjC,OAAK,MAAM,SAAS,iCACnB,YAAW,GAAG,OAAO,QAAQ;AAE9B,eAAa;AACZ,QAAK,MAAM,SAAS,iCACnB,YAAW,IAAI,OAAO,QAAQ;;IAG9B,CAAC,WAAW,CAAC;AAEhB,QAAO;;AAGR,MAAM,6BAA6B;CAClC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,MAAa,kBACZ,YACA,IACA,SAC6D;CAC7D,MAAM,GAAG,WAAW,gBAAgB,EAAE,EAAE;CAGxC,MAAM,OADa,qBAAoC,WAAW,CAC1C,QAAQ,IAAI,KAAK;AAEzC,iBAAgB;EACf,MAAM,gBAAgB,QAAQ,EAAE,CAAC;AACjC,OAAK,MAAM,SAAS,2BACnB,MAAK,GAAG,OAAO,QAAQ;AAExB,eAAa;AACZ,QAAK,MAAM,SAAS,2BACnB,MAAK,IAAI,OAAO,QAAQ;;IAGxB,CAAC,KAAK,CAAC;AAEV,QAAO;;AAyCR,SAAgB,qBACf,eAiCI;AACJ,QACC,gBACG;EACA,eAAe;EACf,SAAS;EACT,eAAe;EACf,UAAU;EACV,GACA;EACA;EACA;EACA;EACA;EACA"}
|
|
1
|
+
{"version":3,"file":"react.js","names":[],"sources":["../../packages/adapters/react/context.tsx","../../packages/adapters/react/hooks.ts"],"sourcesContent":["import { createContext, type ReactNode, useMemo } from \"react\";\nimport type { AnyChimeraStore } from \"../../../src/store\";\n\nexport interface ChimeraStoreContextValue<T extends AnyChimeraStore> {\n\tstore: T;\n}\n\nexport interface ChimeraStoreProviderProps<T extends AnyChimeraStore> {\n\tchildren: ReactNode;\n\tstore: T;\n}\n\nexport const ChimeraStoreContext = createContext<ChimeraStoreContextValue<AnyChimeraStore> | null>(null);\n\nexport const ChimeraStoreProvider = <T extends AnyChimeraStore>({ children, store }: ChimeraStoreProviderProps<T>) => (\n\t<ChimeraStoreContext.Provider value={useMemo(() => ({ store }), [store])}>{children}</ChimeraStoreContext.Provider>\n);\n","import { useContext, useEffect, useMemo, useRef, useState } from \"react\";\nimport type { ChimeraCollectionQuery } from \"../../../src/query/ChimeraCollectionQuery\";\nimport type { ChimeraItemQuery } from \"../../../src/query/ChimeraItemQuery\";\nimport type { ChimeraEntityId } from \"../../../src/shared/types\";\nimport type { ChimeraEntityRepository } from \"../../../src/store/ChimeraEntityRepository\";\nimport type {\n\tAnyChimeraStore,\n\tChimeraStoreEntities,\n\tChimeraStoreEntityType,\n\tChimeraStoreOperatorMap,\n} from \"../../../src/store/ChimeraStore\";\nimport type { ChimeraCollectionParams } from \"../../../src/store/types\";\nimport { ChimeraQueryBuilder, type QueryBuilderCreator } from \"../../qb\";\nimport { ChimeraStoreContext } from \"./context\";\n\nexport function useChimeraStore<T extends AnyChimeraStore>(): T {\n\tconst context = useContext(ChimeraStoreContext);\n\tif (!context) {\n\t\tthrow new Error(\"useChimeraStore must be used within a ChimeraStoreProvider\");\n\t}\n\treturn context.store as T;\n}\n\nexport function useChimeraRepository<T extends AnyChimeraStore, EntityName extends ChimeraStoreEntities<T>>(\n\tentityName: EntityName,\n): ChimeraEntityRepository<ChimeraStoreEntityType<T, EntityName>, ChimeraStoreOperatorMap<T>> {\n\tconst store = useChimeraStore<T>();\n\treturn store.from(entityName);\n}\n\nconst CHIMERA_COLLECTION_UPDATE_EVENTS = [\n\t\"ready\",\n\t\"updated\",\n\t\"selfUpdated\",\n\t\"selfItemCreated\",\n\t\"itemAdded\",\n\t\"itemUpdated\",\n\t\"selfItemUpdated\",\n\t\"itemDeleted\",\n\t\"selfItemDeleted\",\n\t\"error\",\n] as const;\nexport const useChimeraCollection = <T extends AnyChimeraStore, EntityName extends ChimeraStoreEntities<T>, Meta = any>(\n\tentityName: EntityName,\n\tparams:\n\t\t| ChimeraCollectionParams<ChimeraStoreOperatorMap<T>, ChimeraStoreEntityType<T, EntityName>, Meta>\n\t\t| QueryBuilderCreator<T, ChimeraStoreEntityType<T, EntityName>, ChimeraStoreOperatorMap<T>>,\n\tdeps?: unknown[],\n): ChimeraCollectionQuery<ChimeraStoreEntityType<T, EntityName>, ChimeraStoreOperatorMap<T>> => {\n\tconst [, trigger] = useState(() => ({}));\n\n\tconst repository = useChimeraRepository<T, EntityName>(entityName);\n\n\tconst oldDeps = useRef(deps);\n\tif ((oldDeps.current && !deps) || (!oldDeps.current && deps)) {\n\t\tconsole.warn(\n\t\t\t\"useChimeraCollection deps is not a reactive param!\\n\" +\n\t\t\t\t\"Use deps if you want to control dependencies manually.\\n\" +\n\t\t\t\t\"Omit it if you already have a stable reference to params\",\n\t\t);\n\t}\n\toldDeps.current = deps;\n\n\tconst memeParams = useMemo(\n\t\t() => {\n\t\t\tif (typeof params !== \"function\") return params;\n\n\t\t\tconst q = new ChimeraQueryBuilder();\n\t\t\tparams(q);\n\t\t\treturn q.build();\n\t\t},\n\t\t// biome-ignore lint/correctness/useExhaustiveDependencies: Very unlikely it will be changed over time, anyway warning for this already added.\n\t\tdeps ? deps : [params],\n\t);\n\tconst collection = useMemo(() => repository.getCollection(memeParams), [repository, memeParams]);\n\n\tuseEffect(() => {\n\t\tconst handler = () => trigger({});\n\t\tfor (const event of CHIMERA_COLLECTION_UPDATE_EVENTS) {\n\t\t\tcollection.on(event, handler);\n\t\t}\n\t\treturn () => {\n\t\t\tfor (const event of CHIMERA_COLLECTION_UPDATE_EVENTS) {\n\t\t\t\tcollection.off(event, handler);\n\t\t\t}\n\t\t};\n\t}, [collection]);\n\n\treturn collection;\n};\n\nconst CHIMERA_ITEM_UPDATE_EVENTS = [\n\t\"initialized\",\n\t\"selfCreated\",\n\t\"ready\",\n\t\"updated\",\n\t\"selfUpdated\",\n\t\"deleted\",\n\t\"selfDeleted\",\n\t\"error\",\n] as const;\nexport const useChimeraItem = <T extends AnyChimeraStore, EntityName extends ChimeraStoreEntities<T>, Meta = any>(\n\tentityName: EntityName,\n\tid: ChimeraEntityId,\n\tmeta?: Meta,\n): ChimeraItemQuery<ChimeraStoreEntityType<T, EntityName>> => {\n\tconst [, trigger] = useState(() => ({}));\n\n\tconst repository = useChimeraRepository<T, EntityName>(entityName);\n\tconst item = repository.getItem(id, meta);\n\n\tuseEffect(() => {\n\t\tconst handler = () => trigger({});\n\t\tfor (const event of CHIMERA_ITEM_UPDATE_EVENTS) {\n\t\t\titem.on(event, handler);\n\t\t}\n\t\treturn () => {\n\t\t\tfor (const event of CHIMERA_ITEM_UPDATE_EVENTS) {\n\t\t\t\titem.off(event, handler);\n\t\t\t}\n\t\t};\n\t}, [item]);\n\n\treturn item;\n};\n\nexport function getChimeraTypedHooks<T extends AnyChimeraStore>(\n\twithoutPrefix: true,\n): {\n\tuseStore: () => T;\n\tuseRepository: <EntityName extends ChimeraStoreEntities<T>>(\n\t\tentityName: EntityName,\n\t) => ChimeraEntityRepository<ChimeraStoreEntityType<T, EntityName>, ChimeraStoreOperatorMap<T>>;\n\tuseCollection: <EntityName extends ChimeraStoreEntities<T>, Meta = any>(\n\t\tentityName: EntityName,\n\t\tparams: ChimeraCollectionParams<ChimeraStoreOperatorMap<T>, ChimeraStoreEntityType<T, EntityName>, Meta>,\n\t\tdeps?: unknown[],\n\t) => ChimeraCollectionQuery<ChimeraStoreEntityType<T, EntityName>, ChimeraStoreOperatorMap<T>>;\n\tuseItem: <EntityName extends ChimeraStoreEntities<T>, Meta = any>(\n\t\tentityName: EntityName,\n\t\tid: ChimeraEntityId,\n\t\tmeta?: Meta,\n\t) => ChimeraItemQuery<ChimeraStoreEntityType<T, EntityName>>;\n};\nexport function getChimeraTypedHooks<T extends AnyChimeraStore>(\n\twithoutPrefix?: false,\n): {\n\tuseChimeraStore: () => T;\n\tuseChimeraRepository: <EntityName extends ChimeraStoreEntities<T>>(\n\t\tentityName: EntityName,\n\t) => ChimeraEntityRepository<ChimeraStoreEntityType<T, EntityName>, ChimeraStoreOperatorMap<T>>;\n\tuseChimeraCollection: <EntityName extends ChimeraStoreEntities<T>, Meta = any>(\n\t\tentityName: EntityName,\n\t\tparams:\n\t\t\t| ChimeraCollectionParams<ChimeraStoreOperatorMap<T>, ChimeraStoreEntityType<T, EntityName>, Meta>\n\t\t\t| QueryBuilderCreator<T, ChimeraStoreEntityType<T, EntityName>, ChimeraStoreOperatorMap<T>>,\n\t\tdeps?: unknown[],\n\t) => ChimeraCollectionQuery<ChimeraStoreEntityType<T, EntityName>, ChimeraStoreOperatorMap<T>>;\n\tuseChimeraItem: <EntityName extends ChimeraStoreEntities<T>, Meta = any>(\n\t\tentityName: EntityName,\n\t\tid: ChimeraEntityId,\n\t\tmeta?: Meta,\n\t) => ChimeraItemQuery<ChimeraStoreEntityType<T, EntityName>>;\n};\nexport function getChimeraTypedHooks<T extends AnyChimeraStore>(\n\twithoutPrefix?: boolean,\n):\n\t| {\n\t\t\tuseChimeraStore: () => T;\n\t\t\tuseChimeraRepository: <EntityName extends ChimeraStoreEntities<T>>(\n\t\t\t\tentityName: EntityName,\n\t\t\t) => ChimeraEntityRepository<ChimeraStoreEntityType<T, EntityName>, ChimeraStoreOperatorMap<T>>;\n\t\t\tuseChimeraCollection: <EntityName extends ChimeraStoreEntities<T>, Meta = any>(\n\t\t\t\tentityName: EntityName,\n\t\t\t\tparams: ChimeraCollectionParams<ChimeraStoreOperatorMap<T>, ChimeraStoreEntityType<T, EntityName>, Meta>,\n\t\t\t\tdeps?: unknown[],\n\t\t\t) => ChimeraCollectionQuery<ChimeraStoreEntityType<T, EntityName>, ChimeraStoreOperatorMap<T>>;\n\t\t\tuseChimeraItem: <EntityName extends ChimeraStoreEntities<T>, Meta = any>(\n\t\t\t\tentityName: EntityName,\n\t\t\t\tid: ChimeraEntityId,\n\t\t\t\tmeta?: Meta,\n\t\t\t) => ChimeraItemQuery<ChimeraStoreEntityType<T, EntityName>>;\n\t }\n\t| {\n\t\t\tuseStore: () => T;\n\t\t\tuseRepository: <EntityName extends ChimeraStoreEntities<T>>(\n\t\t\t\tentityName: EntityName,\n\t\t\t) => ChimeraEntityRepository<ChimeraStoreEntityType<T, EntityName>, ChimeraStoreOperatorMap<T>>;\n\t\t\tuseCollection: <EntityName extends ChimeraStoreEntities<T>, Meta = any>(\n\t\t\t\tentityName: EntityName,\n\t\t\t\tparams: ChimeraCollectionParams<ChimeraStoreOperatorMap<T>, ChimeraStoreEntityType<T, EntityName>, Meta>,\n\t\t\t\tdeps?: unknown[],\n\t\t\t) => ChimeraCollectionQuery<ChimeraStoreEntityType<T, EntityName>, ChimeraStoreOperatorMap<T>>;\n\t\t\tuseItem: <EntityName extends ChimeraStoreEntities<T>, Meta = any>(\n\t\t\t\tentityName: EntityName,\n\t\t\t\tid: ChimeraEntityId,\n\t\t\t\tmeta?: Meta,\n\t\t\t) => ChimeraItemQuery<ChimeraStoreEntityType<T, EntityName>>;\n\t } {\n\treturn (\n\t\twithoutPrefix\n\t\t\t? {\n\t\t\t\t\tuseCollection: useChimeraCollection,\n\t\t\t\t\tuseItem: useChimeraItem,\n\t\t\t\t\tuseRepository: useChimeraRepository,\n\t\t\t\t\tuseStore: useChimeraStore,\n\t\t\t\t}\n\t\t\t: {\n\t\t\t\t\tuseChimeraCollection,\n\t\t\t\t\tuseChimeraItem,\n\t\t\t\t\tuseChimeraRepository,\n\t\t\t\t\tuseChimeraStore,\n\t\t\t\t}\n\t) as ReturnType<typeof getChimeraTypedHooks<T>>;\n}\n"],"mappings":";;;;;;AAYA,MAAa,sBAAsB,cAAgE,KAAK;AAExG,MAAa,wBAAmD,EAAE,UAAU,YAC3E,CAAC,oBAAoB,SAAS,OAAO,eAAe,EAAE,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,SAAS,EAAE,oBAAoB;;;;ACA3G,SAAgB,kBAAgD;CAC/D,MAAM,UAAU,WAAW,oBAAoB;AAC/C,KAAI,CAAC,QACJ,OAAM,IAAI,MAAM,6DAA6D;AAE9E,QAAO,QAAQ;;AAGhB,SAAgB,qBACf,YAC6F;AAE7F,QADc,iBAAoB,CACrB,KAAK,WAAW;;AAG9B,MAAM,mCAAmC;CACxC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,MAAa,wBACZ,YACA,QAGA,SAC+F;CAC/F,MAAM,GAAG,WAAW,gBAAgB,EAAE,EAAE;CAExC,MAAM,aAAa,qBAAoC,WAAW;CAElE,MAAM,UAAU,OAAO,KAAK;AAC5B,KAAK,QAAQ,WAAW,CAAC,QAAU,CAAC,QAAQ,WAAW,KACtD,SAAQ,KACP,uKAGA;AAEF,SAAQ,UAAU;CAElB,MAAM,aAAa,cACZ;AACL,MAAI,OAAO,WAAW,WAAY,QAAO;EAEzC,MAAM,IAAI,IAAI,qBAAqB;AACnC,SAAO,EAAE;AACT,SAAO,EAAE,OAAO;IAGjB,OAAO,OAAO,CAAC,OAAO,CACtB;CACD,MAAM,aAAa,cAAc,WAAW,cAAc,WAAW,EAAE,CAAC,YAAY,WAAW,CAAC;AAEhG,iBAAgB;EACf,MAAM,gBAAgB,QAAQ,EAAE,CAAC;AACjC,OAAK,MAAM,SAAS,iCACnB,YAAW,GAAG,OAAO,QAAQ;AAE9B,eAAa;AACZ,QAAK,MAAM,SAAS,iCACnB,YAAW,IAAI,OAAO,QAAQ;;IAG9B,CAAC,WAAW,CAAC;AAEhB,QAAO;;AAGR,MAAM,6BAA6B;CAClC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,MAAa,kBACZ,YACA,IACA,SAC6D;CAC7D,MAAM,GAAG,WAAW,gBAAgB,EAAE,EAAE;CAGxC,MAAM,OADa,qBAAoC,WAAW,CAC1C,QAAQ,IAAI,KAAK;AAEzC,iBAAgB;EACf,MAAM,gBAAgB,QAAQ,EAAE,CAAC;AACjC,OAAK,MAAM,SAAS,2BACnB,MAAK,GAAG,OAAO,QAAQ;AAExB,eAAa;AACZ,QAAK,MAAM,SAAS,2BACnB,MAAK,IAAI,OAAO,QAAQ;;IAGxB,CAAC,KAAK,CAAC;AAEV,QAAO;;AAyCR,SAAgB,qBACf,eAiCI;AACJ,QACC,gBACG;EACA,eAAe;EACf,SAAS;EACT,eAAe;EACf,UAAU;EACV,GACA;EACA;EACA;EACA;EACA;EACA"}
|
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/shared/errors.ts
|
|
3
|
+
var ChimeraError = class extends Error {};
|
|
4
|
+
var ChimeraInternalError = class extends ChimeraError {
|
|
5
|
+
constructor(message, options) {
|
|
6
|
+
super(`${message}\nIf you have this bug, feel free to create an issue in https://github.com/hf-chimera/store/issues`, options);
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/order/errors.ts
|
|
12
|
+
var ChimeraOrderError = class extends ChimeraError {};
|
|
13
|
+
var ChimeraOrderTypeError = class extends ChimeraOrderError {};
|
|
14
|
+
var ChimeraOrderTypeComparisonError = class extends ChimeraOrderTypeError {
|
|
15
|
+
constructor(a, b) {
|
|
16
|
+
super(`Unsupported comparison "${a}"(${typeof a}[${a != null ? a.constructor.name : a}]) with "${b}"(${typeof b}[${b != null ? b.constructor.name : b}])`);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/query/errors.ts
|
|
22
|
+
const formatDeepErrorMessage = (message, cause) => `${message}: ${cause instanceof Error ? `\n ${cause.stack}` : cause}`;
|
|
23
|
+
var ChimeraQueryError = class extends ChimeraError {
|
|
24
|
+
entityName;
|
|
25
|
+
constructor(entityName, message, options) {
|
|
26
|
+
super(message, options);
|
|
27
|
+
this.entityName = entityName;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
var ChimeraQueryIdMismatchError = class extends ChimeraQueryError {
|
|
31
|
+
old;
|
|
32
|
+
new;
|
|
33
|
+
constructor(entityName, oldId, newId) {
|
|
34
|
+
super(entityName, `
|
|
35
|
+
Can't update "${entityName}" item if the change updates it's [id] (changed from "${oldId}" to "${newId}").
|
|
36
|
+
If such an update should not be an error, update <idGetter> field in "${entityName}" entity config to make Chimera get the [id] value properly.
|
|
37
|
+
`.trim());
|
|
38
|
+
this.old = oldId;
|
|
39
|
+
this.new = newId;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var ChimeraQueryNotSpecifiedError = class extends ChimeraQueryError {
|
|
43
|
+
methodName;
|
|
44
|
+
constructor(entityName, methodName) {
|
|
45
|
+
super(entityName, `<${methodName}> for entity "${entityName}" was not specified`);
|
|
46
|
+
this.methodName = methodName;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var ChimeraQueryTrustError = class extends ChimeraQueryError {
|
|
50
|
+
constructor(entityName, description) {
|
|
51
|
+
super(entityName, `
|
|
52
|
+
DO NOT IGNORE THIS ERROR OR YOUR PROD MAY BREAK!
|
|
53
|
+
|
|
54
|
+
Looks like your "${entityName}" query provider ${description}
|
|
55
|
+
|
|
56
|
+
By default Chimera tend to trust external query provider to avoid extra data processing.
|
|
57
|
+
If it is not your case, set field "trustQuery" to "false" in config defaults or for specific entity.
|
|
58
|
+
This error visible only if "devMode" is "true".
|
|
59
|
+
If you'll ignore it, your production may fail, because Chimera won't check the data correctness.
|
|
60
|
+
`.trim());
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
var ChimeraQueryTrustIdMismatchError = class extends ChimeraQueryTrustError {
|
|
64
|
+
old;
|
|
65
|
+
new;
|
|
66
|
+
constructor(entityName, oldId, newId) {
|
|
67
|
+
super(entityName, `
|
|
68
|
+
returned an item with [id] that not matches with the [id] of item that was updated (changed from "${oldId}" to "${newId}").
|
|
69
|
+
If it is not an error, update <idGetter> field in "${entityName}" entity config to make Chimera get the [id] value properly.
|
|
70
|
+
`.trim());
|
|
71
|
+
this.old = oldId;
|
|
72
|
+
this.new = newId;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
var ChimeraQueryTrustFetchedCollectionError = class extends ChimeraQueryTrustError {
|
|
76
|
+
old;
|
|
77
|
+
new;
|
|
78
|
+
constructor(entityName, input, output) {
|
|
79
|
+
super(entityName, "returned not properly sorted or ordered collection.");
|
|
80
|
+
this.old = input;
|
|
81
|
+
this.new = output;
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
var ChimeraQueryFetchingError = class extends ChimeraQueryError {
|
|
85
|
+
constructor(entityName, cause) {
|
|
86
|
+
super(entityName, formatDeepErrorMessage("Something went wrong", cause), { cause });
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
var ChimeraQueryDeletingError = class extends ChimeraQueryError {
|
|
90
|
+
constructor(entityName, cause) {
|
|
91
|
+
super(entityName, formatDeepErrorMessage("Something went wrong", cause), { cause });
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
var ChimeraQueryNotReadyError = class extends ChimeraQueryError {
|
|
95
|
+
constructor(entityName) {
|
|
96
|
+
super(entityName, "Unable to get unready value.");
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
var ChimeraQueryDeletedItemError = class extends ChimeraQueryError {
|
|
100
|
+
constructor(entityName, id) {
|
|
101
|
+
super(entityName, `Unable to updated deleted item with [id] "${id}."`);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
var ChimeraQueryUnsuccessfulDeletionError = class extends ChimeraQueryError {
|
|
105
|
+
constructor(entityName, id) {
|
|
106
|
+
super(entityName, `Item with [id] "${id}" was not deleted.`);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
var ChimeraQueryAlreadyRunningError = class extends ChimeraQueryError {
|
|
110
|
+
constructor(entityName, status) {
|
|
111
|
+
super(entityName, `Unable to operate query. Other process already running ${status}.`);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
var ChimeraQueryNotCreatedError = class extends ChimeraQueryError {
|
|
115
|
+
constructor(entityName) {
|
|
116
|
+
super(entityName, "Unable to operate not created item.");
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region src/debug/defaults.ts
|
|
122
|
+
const chimeraDefaultDebugConfig = {
|
|
123
|
+
devMode: false,
|
|
124
|
+
logs: "info",
|
|
125
|
+
name: "chimera"
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region src/filter/defaults.ts
|
|
130
|
+
const getKeyFromOperation = (operator) => JSON.stringify(operator);
|
|
131
|
+
const chimeraDefaultGetKeyFromFilter = (filter) => JSON.stringify(filter);
|
|
132
|
+
const chimeraDefaultFilterOperators = {
|
|
133
|
+
contains: (a, b) => {
|
|
134
|
+
if (typeof a === "string") return a.includes(b);
|
|
135
|
+
if (Array.isArray(a)) return Array.isArray(b) ? b.every((v) => a.includes(v)) : a.includes(b);
|
|
136
|
+
return false;
|
|
137
|
+
},
|
|
138
|
+
endsWith: (a, b) => a.endsWith(b),
|
|
139
|
+
startsWith: (a, b) => a.startsWith(b),
|
|
140
|
+
eq: (a, b) => a === b,
|
|
141
|
+
gt: (a, b) => a > b,
|
|
142
|
+
gte: (a, b) => a >= b,
|
|
143
|
+
in: (a, b) => (Array.isArray(a) ? a : [a]).some((v) => b.includes(v)),
|
|
144
|
+
lt: (a, b) => a < b,
|
|
145
|
+
lte: (a, b) => a <= b,
|
|
146
|
+
neq: (a, b) => a !== b,
|
|
147
|
+
notIn: (a, b) => (Array.isArray(a) ? a : [a]).every((v) => !b.includes(v))
|
|
148
|
+
};
|
|
149
|
+
const chimeraDefaultFilterConfig = {
|
|
150
|
+
getFilterKey: chimeraDefaultGetKeyFromFilter,
|
|
151
|
+
getOperatorKey: getKeyFromOperation,
|
|
152
|
+
operators: chimeraDefaultFilterOperators
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
//#endregion
|
|
156
|
+
//#region src/order/defaults.ts
|
|
157
|
+
const chimeraDefaultComparator = (a, b) => {
|
|
158
|
+
let result = 0;
|
|
159
|
+
if (typeof a === "string" && typeof b === "string") result = a.localeCompare(b);
|
|
160
|
+
else if (typeof a === "number" && typeof b === "number" || typeof a === "boolean" && typeof b === "boolean") result = a - b;
|
|
161
|
+
else if (a instanceof Date && b instanceof Date) result = a.getTime() - b.getTime();
|
|
162
|
+
else if (a == null || b == null) result = a == b ? 0 : a == null ? -1 : 1;
|
|
163
|
+
else throw new ChimeraOrderTypeComparisonError(a, b);
|
|
164
|
+
return result;
|
|
165
|
+
};
|
|
166
|
+
const chimeraDefaultKeyFromOrder = (order) => JSON.stringify(order);
|
|
167
|
+
const chimeraDefaultOrderConfig = {
|
|
168
|
+
getKey: chimeraDefaultKeyFromOrder,
|
|
169
|
+
primitiveComparator: chimeraDefaultComparator
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region src/query/defaults.ts
|
|
174
|
+
const chimeraDefaultQueryConfig = {
|
|
175
|
+
defaults: {
|
|
176
|
+
batchedCreator: (entity) => {
|
|
177
|
+
throw new ChimeraQueryNotSpecifiedError(entity, "batchedCreator");
|
|
178
|
+
},
|
|
179
|
+
batchedDeleter: (entity) => {
|
|
180
|
+
throw new ChimeraQueryNotSpecifiedError(entity, "batchedDeleter");
|
|
181
|
+
},
|
|
182
|
+
batchedUpdater: (entity) => {
|
|
183
|
+
throw new ChimeraQueryNotSpecifiedError(entity, "batchedUpdater");
|
|
184
|
+
},
|
|
185
|
+
collectionFetcher: (entity) => {
|
|
186
|
+
throw new ChimeraQueryNotSpecifiedError(entity, "collectionFetcher");
|
|
187
|
+
},
|
|
188
|
+
idGetter: (entity) => {
|
|
189
|
+
throw new ChimeraQueryNotSpecifiedError(entity, "idGetter");
|
|
190
|
+
},
|
|
191
|
+
itemCreator: (entity) => {
|
|
192
|
+
throw new ChimeraQueryNotSpecifiedError(entity, "itemCreator");
|
|
193
|
+
},
|
|
194
|
+
itemDeleter: (entity) => {
|
|
195
|
+
throw new ChimeraQueryNotSpecifiedError(entity, "itemDeleter");
|
|
196
|
+
},
|
|
197
|
+
itemFetcher: (entity) => {
|
|
198
|
+
throw new ChimeraQueryNotSpecifiedError(entity, "itemFetcher");
|
|
199
|
+
},
|
|
200
|
+
itemUpdater: (entity) => {
|
|
201
|
+
throw new ChimeraQueryNotSpecifiedError(entity, "itemUpdater");
|
|
202
|
+
},
|
|
203
|
+
trustQuery: true,
|
|
204
|
+
updateDebounceTimeout: 0
|
|
205
|
+
},
|
|
206
|
+
entities: {}
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
//#endregion
|
|
210
|
+
Object.defineProperty(exports, 'ChimeraError', {
|
|
211
|
+
enumerable: true,
|
|
212
|
+
get: function () {
|
|
213
|
+
return ChimeraError;
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
Object.defineProperty(exports, 'ChimeraInternalError', {
|
|
217
|
+
enumerable: true,
|
|
218
|
+
get: function () {
|
|
219
|
+
return ChimeraInternalError;
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
Object.defineProperty(exports, 'ChimeraOrderError', {
|
|
223
|
+
enumerable: true,
|
|
224
|
+
get: function () {
|
|
225
|
+
return ChimeraOrderError;
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
Object.defineProperty(exports, 'ChimeraOrderTypeComparisonError', {
|
|
229
|
+
enumerable: true,
|
|
230
|
+
get: function () {
|
|
231
|
+
return ChimeraOrderTypeComparisonError;
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
Object.defineProperty(exports, 'ChimeraOrderTypeError', {
|
|
235
|
+
enumerable: true,
|
|
236
|
+
get: function () {
|
|
237
|
+
return ChimeraOrderTypeError;
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
Object.defineProperty(exports, 'ChimeraQueryAlreadyRunningError', {
|
|
241
|
+
enumerable: true,
|
|
242
|
+
get: function () {
|
|
243
|
+
return ChimeraQueryAlreadyRunningError;
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
Object.defineProperty(exports, 'ChimeraQueryDeletedItemError', {
|
|
247
|
+
enumerable: true,
|
|
248
|
+
get: function () {
|
|
249
|
+
return ChimeraQueryDeletedItemError;
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
Object.defineProperty(exports, 'ChimeraQueryDeletingError', {
|
|
253
|
+
enumerable: true,
|
|
254
|
+
get: function () {
|
|
255
|
+
return ChimeraQueryDeletingError;
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
Object.defineProperty(exports, 'ChimeraQueryError', {
|
|
259
|
+
enumerable: true,
|
|
260
|
+
get: function () {
|
|
261
|
+
return ChimeraQueryError;
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
Object.defineProperty(exports, 'ChimeraQueryFetchingError', {
|
|
265
|
+
enumerable: true,
|
|
266
|
+
get: function () {
|
|
267
|
+
return ChimeraQueryFetchingError;
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
Object.defineProperty(exports, 'ChimeraQueryIdMismatchError', {
|
|
271
|
+
enumerable: true,
|
|
272
|
+
get: function () {
|
|
273
|
+
return ChimeraQueryIdMismatchError;
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
Object.defineProperty(exports, 'ChimeraQueryNotCreatedError', {
|
|
277
|
+
enumerable: true,
|
|
278
|
+
get: function () {
|
|
279
|
+
return ChimeraQueryNotCreatedError;
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
Object.defineProperty(exports, 'ChimeraQueryNotReadyError', {
|
|
283
|
+
enumerable: true,
|
|
284
|
+
get: function () {
|
|
285
|
+
return ChimeraQueryNotReadyError;
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
Object.defineProperty(exports, 'ChimeraQueryNotSpecifiedError', {
|
|
289
|
+
enumerable: true,
|
|
290
|
+
get: function () {
|
|
291
|
+
return ChimeraQueryNotSpecifiedError;
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
Object.defineProperty(exports, 'ChimeraQueryTrustError', {
|
|
295
|
+
enumerable: true,
|
|
296
|
+
get: function () {
|
|
297
|
+
return ChimeraQueryTrustError;
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
Object.defineProperty(exports, 'ChimeraQueryTrustFetchedCollectionError', {
|
|
301
|
+
enumerable: true,
|
|
302
|
+
get: function () {
|
|
303
|
+
return ChimeraQueryTrustFetchedCollectionError;
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
Object.defineProperty(exports, 'ChimeraQueryTrustIdMismatchError', {
|
|
307
|
+
enumerable: true,
|
|
308
|
+
get: function () {
|
|
309
|
+
return ChimeraQueryTrustIdMismatchError;
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
Object.defineProperty(exports, 'ChimeraQueryUnsuccessfulDeletionError', {
|
|
313
|
+
enumerable: true,
|
|
314
|
+
get: function () {
|
|
315
|
+
return ChimeraQueryUnsuccessfulDeletionError;
|
|
316
|
+
}
|
|
317
|
+
});
|
|
318
|
+
Object.defineProperty(exports, 'chimeraDefaultComparator', {
|
|
319
|
+
enumerable: true,
|
|
320
|
+
get: function () {
|
|
321
|
+
return chimeraDefaultComparator;
|
|
322
|
+
}
|
|
323
|
+
});
|
|
324
|
+
Object.defineProperty(exports, 'chimeraDefaultDebugConfig', {
|
|
325
|
+
enumerable: true,
|
|
326
|
+
get: function () {
|
|
327
|
+
return chimeraDefaultDebugConfig;
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
Object.defineProperty(exports, 'chimeraDefaultFilterConfig', {
|
|
331
|
+
enumerable: true,
|
|
332
|
+
get: function () {
|
|
333
|
+
return chimeraDefaultFilterConfig;
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
Object.defineProperty(exports, 'chimeraDefaultFilterOperators', {
|
|
337
|
+
enumerable: true,
|
|
338
|
+
get: function () {
|
|
339
|
+
return chimeraDefaultFilterOperators;
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
Object.defineProperty(exports, 'chimeraDefaultGetKeyFromFilter', {
|
|
343
|
+
enumerable: true,
|
|
344
|
+
get: function () {
|
|
345
|
+
return chimeraDefaultGetKeyFromFilter;
|
|
346
|
+
}
|
|
347
|
+
});
|
|
348
|
+
Object.defineProperty(exports, 'chimeraDefaultKeyFromOrder', {
|
|
349
|
+
enumerable: true,
|
|
350
|
+
get: function () {
|
|
351
|
+
return chimeraDefaultKeyFromOrder;
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
Object.defineProperty(exports, 'chimeraDefaultOrderConfig', {
|
|
355
|
+
enumerable: true,
|
|
356
|
+
get: function () {
|
|
357
|
+
return chimeraDefaultOrderConfig;
|
|
358
|
+
}
|
|
359
|
+
});
|
|
360
|
+
Object.defineProperty(exports, 'chimeraDefaultQueryConfig', {
|
|
361
|
+
enumerable: true,
|
|
362
|
+
get: function () {
|
|
363
|
+
return chimeraDefaultQueryConfig;
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
Object.defineProperty(exports, 'getKeyFromOperation', {
|
|
367
|
+
enumerable: true,
|
|
368
|
+
get: function () {
|
|
369
|
+
return getKeyFromOperation;
|
|
370
|
+
}
|
|
371
|
+
});
|