@hf-chimera/adapters-shared 0.2.0 → 0.2.2
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/LICENSE +21 -0
- package/dist/index.cjs +1 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -3
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +7 -3
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +44 -44
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Hewston Fox
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.cjs
CHANGED
|
@@ -37,6 +37,7 @@ const isQueryBuilder = (params) => "isChimeraQueryBuilder" in params && params.i
|
|
|
37
37
|
const normalizeParams = (createQueryBuilder, params) => {
|
|
38
38
|
if (isQueryBuilder(params)) return params.build();
|
|
39
39
|
if (typeof params === "function") {
|
|
40
|
+
if (!createQueryBuilder) throw new Error("Query builder creator function provided but no query builder factory was supplied. Either pass a query builder factory as the second argument to createChimeraStoreHooks/createChimeraStoreComposables, or install the official @hf-chimera/query-builder package and use 'createDefaultQueryBuilder'. Alternatively, use plain ChimeraCollectionParams instead of a creator function.");
|
|
40
41
|
const q = createQueryBuilder();
|
|
41
42
|
return (params(q) ?? q).build();
|
|
42
43
|
}
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../events.ts","../params.ts"],"sourcesContent":["import type {\n\tAnyChimeraCollectionQuery,\n\tAnyChimeraEntityStore,\n\tAnyChimeraItemQuery,\n\tChimeraEventEmitterEventNames,\n} from \"@hf-chimera/store\";\n\nexport const CHIMERA_ENTITY_STORE_UPDATE_EVENTS = [\n\t\"initialized\",\n\t\"updated\",\n\t\"itemAdded\",\n\t\"itemUpdated\",\n\t\"deleted\",\n\t\"itemDeleted\",\n] as const satisfies ChimeraEventEmitterEventNames<AnyChimeraEntityStore>[];\n\nexport const 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 satisfies ChimeraEventEmitterEventNames<AnyChimeraCollectionQuery>[];\n\nexport const 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 satisfies ChimeraEventEmitterEventNames<AnyChimeraItemQuery>[];\n","import type {
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../events.ts","../params.ts"],"sourcesContent":["import type {\n\tAnyChimeraCollectionQuery,\n\tAnyChimeraEntityStore,\n\tAnyChimeraItemQuery,\n\tChimeraEventEmitterEventNames,\n} from \"@hf-chimera/store\";\n\nexport const CHIMERA_ENTITY_STORE_UPDATE_EVENTS = [\n\t\"initialized\",\n\t\"updated\",\n\t\"itemAdded\",\n\t\"itemUpdated\",\n\t\"deleted\",\n\t\"itemDeleted\",\n] as const satisfies ChimeraEventEmitterEventNames<AnyChimeraEntityStore>[];\n\nexport const 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 satisfies ChimeraEventEmitterEventNames<AnyChimeraCollectionQuery>[];\n\nexport const 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 satisfies ChimeraEventEmitterEventNames<AnyChimeraItemQuery>[];\n","import type {\n\tAnyChimeraEntityStore,\n\tChimeraCollectionParams,\n\tChimeraEntityStoreEntity,\n\tChimeraEntityStoreOperatorsMap,\n} from \"@hf-chimera/store\";\n\n// Minimal query builder interface that adapters expect\n// This allows using any query builder implementation (including custom ones)\n// The official implementation is available in @hf-chimera/query-builder\nexport interface ChimeraQueryBuilder<TStore extends AnyChimeraEntityStore> {\n\tisChimeraQueryBuilder: true;\n\tbuild(): ChimeraCollectionParams<ChimeraEntityStoreOperatorsMap<TStore>, ChimeraEntityStoreEntity<TStore>, any>;\n}\n\nexport type QueryBuilderCreator<TStore extends AnyChimeraEntityStore> = (\n\tqb: ChimeraQueryBuilder<TStore>,\n) => ChimeraQueryBuilder<TStore> | undefined;\n\nexport type AnyChimeraParams<\n\tTStore extends AnyChimeraEntityStore,\n\tTMeta = any,\n\tQueryBuilder extends ChimeraQueryBuilder<TStore> = ChimeraQueryBuilder<TStore>,\n> =\n\t| ChimeraCollectionParams<ChimeraEntityStoreOperatorsMap<TStore>, ChimeraEntityStoreEntity<TStore>, TMeta>\n\t| QueryBuilderCreator<TStore>\n\t| QueryBuilder;\n\nconst isQueryBuilder = <TStore extends AnyChimeraEntityStore, Meta = any>(\n\tparams: AnyChimeraParams<TStore, Meta>,\n): params is ChimeraQueryBuilder<TStore> => \"isChimeraQueryBuilder\" in params && params.isChimeraQueryBuilder;\n\nexport const normalizeParams = <TStore extends AnyChimeraEntityStore, TMeta = any>(\n\tcreateQueryBuilder: (() => ChimeraQueryBuilder<TStore>) | undefined,\n\tparams: AnyChimeraParams<TStore, TMeta>,\n): ChimeraCollectionParams<ChimeraEntityStoreOperatorsMap<TStore>, ChimeraEntityStoreEntity<TStore>, TMeta> => {\n\tif (isQueryBuilder(params)) return params.build();\n\tif (typeof params === \"function\") {\n\t\tif (!createQueryBuilder) {\n\t\t\tthrow new Error(\n\t\t\t\t\"Query builder creator function provided but no query builder factory was supplied. \" +\n\t\t\t\t\t\"Either pass a query builder factory as the second argument to createChimeraStoreHooks/createChimeraStoreComposables, \" +\n\t\t\t\t\t\"or install the official @hf-chimera/query-builder package and use 'createDefaultQueryBuilder'. \" +\n\t\t\t\t\t\"Alternatively, use plain ChimeraCollectionParams instead of a creator function.\",\n\t\t\t);\n\t\t}\n\t\tconst q = createQueryBuilder();\n\t\treturn (params(q) ?? q).build();\n\t}\n\treturn params;\n};\n"],"mappings":";;AAOA,MAAa,qCAAqC;CACjD;CACA;CACA;CACA;CACA;CACA;CACA;AAED,MAAa,mCAAmC;CAC/C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAED,MAAa,6BAA6B;CACzC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;;;ACVD,MAAM,kBACL,WAC2C,2BAA2B,UAAU,OAAO;AAExF,MAAa,mBACZ,oBACA,WAC8G;AAC9G,KAAI,eAAe,OAAO,CAAE,QAAO,OAAO,OAAO;AACjD,KAAI,OAAO,WAAW,YAAY;AACjC,MAAI,CAAC,mBACJ,OAAM,IAAI,MACT,yXAIA;EAEF,MAAM,IAAI,oBAAoB;AAC9B,UAAQ,OAAO,EAAE,IAAI,GAAG,OAAO;;AAEhC,QAAO"}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ChimeraQueryBuilder, QueryBuilderCreator } from "@hf-chimera/query-builder";
|
|
2
1
|
import { AnyChimeraEntityStore, ChimeraCollectionParams, ChimeraEntityStoreEntity, ChimeraEntityStoreOperatorsMap } from "@hf-chimera/store";
|
|
3
2
|
|
|
4
3
|
//#region events.d.ts
|
|
@@ -7,8 +6,13 @@ declare const CHIMERA_COLLECTION_UPDATE_EVENTS: ["ready", "updated", "selfUpdate
|
|
|
7
6
|
declare const CHIMERA_ITEM_UPDATE_EVENTS: ["initialized", "selfCreated", "ready", "updated", "selfUpdated", "deleted", "selfDeleted", "error"];
|
|
8
7
|
//#endregion
|
|
9
8
|
//#region params.d.ts
|
|
9
|
+
interface ChimeraQueryBuilder<TStore extends AnyChimeraEntityStore> {
|
|
10
|
+
isChimeraQueryBuilder: true;
|
|
11
|
+
build(): ChimeraCollectionParams<ChimeraEntityStoreOperatorsMap<TStore>, ChimeraEntityStoreEntity<TStore>, any>;
|
|
12
|
+
}
|
|
13
|
+
type QueryBuilderCreator<TStore extends AnyChimeraEntityStore> = (qb: ChimeraQueryBuilder<TStore>) => ChimeraQueryBuilder<TStore> | undefined;
|
|
10
14
|
type AnyChimeraParams<TStore extends AnyChimeraEntityStore, TMeta = any, QueryBuilder extends ChimeraQueryBuilder<TStore> = ChimeraQueryBuilder<TStore>> = ChimeraCollectionParams<ChimeraEntityStoreOperatorsMap<TStore>, ChimeraEntityStoreEntity<TStore>, TMeta> | QueryBuilderCreator<TStore> | QueryBuilder;
|
|
11
|
-
declare const normalizeParams: <TStore extends AnyChimeraEntityStore, TMeta = any>(createQueryBuilder: () => ChimeraQueryBuilder<TStore
|
|
15
|
+
declare const normalizeParams: <TStore extends AnyChimeraEntityStore, TMeta = any>(createQueryBuilder: (() => ChimeraQueryBuilder<TStore>) | undefined, params: AnyChimeraParams<TStore, TMeta>) => ChimeraCollectionParams<ChimeraEntityStoreOperatorsMap<TStore>, ChimeraEntityStoreEntity<TStore>, TMeta>;
|
|
12
16
|
//#endregion
|
|
13
|
-
export { AnyChimeraParams, CHIMERA_COLLECTION_UPDATE_EVENTS, CHIMERA_ENTITY_STORE_UPDATE_EVENTS, CHIMERA_ITEM_UPDATE_EVENTS, normalizeParams };
|
|
17
|
+
export { AnyChimeraParams, CHIMERA_COLLECTION_UPDATE_EVENTS, CHIMERA_ENTITY_STORE_UPDATE_EVENTS, CHIMERA_ITEM_UPDATE_EVENTS, ChimeraQueryBuilder, QueryBuilderCreator, normalizeParams };
|
|
14
18
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../events.ts","../params.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../events.ts","../params.ts"],"sourcesContent":[],"mappings":";;;cAOa;cASA;cAaA;;;UCnBI,mCAAmC;;EDHvC,KAAA,EAAA,ECKH,uBDLG,CCKqB,8BDEyC,CCFV,MDEU,CAAA,ECFD,wBDEC,CCFwB,MDExB,CAAA,EAAA,GAAA,CAAA;AAE3E;AAaa,KCdD,mBDcC,CAAA,eCdkC,qBDuB0B,CAAA,GAAA,CAAA,EAAA,ECtBpE,mBDsBoE,CCtBhD,MDsBgD,CAAA,EAAA,GCrBpE,mBDqBoE,CCrBhD,MDqBgD,CAAA,GAAA,SAAA;KCnB7D,gCACI,yDAEM,oBAAoB,UAAU,oBAAoB,WAErE,wBAAwB,+BAA+B,SAAS,yBAAyB,SAAS,SAClG,oBAAoB,UACpB;cAMU,iCAAkC,+DACnB,oBAAoB,8BACvC,iBAAiB,QAAQ,WAC/B,wBAAwB,+BAA+B,SAAS,yBAAyB,SAAS"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ChimeraQueryBuilder, QueryBuilderCreator } from "@hf-chimera/query-builder";
|
|
2
1
|
import { AnyChimeraEntityStore, ChimeraCollectionParams, ChimeraEntityStoreEntity, ChimeraEntityStoreOperatorsMap } from "@hf-chimera/store";
|
|
3
2
|
|
|
4
3
|
//#region events.d.ts
|
|
@@ -7,8 +6,13 @@ declare const CHIMERA_COLLECTION_UPDATE_EVENTS: ["ready", "updated", "selfUpdate
|
|
|
7
6
|
declare const CHIMERA_ITEM_UPDATE_EVENTS: ["initialized", "selfCreated", "ready", "updated", "selfUpdated", "deleted", "selfDeleted", "error"];
|
|
8
7
|
//#endregion
|
|
9
8
|
//#region params.d.ts
|
|
9
|
+
interface ChimeraQueryBuilder<TStore extends AnyChimeraEntityStore> {
|
|
10
|
+
isChimeraQueryBuilder: true;
|
|
11
|
+
build(): ChimeraCollectionParams<ChimeraEntityStoreOperatorsMap<TStore>, ChimeraEntityStoreEntity<TStore>, any>;
|
|
12
|
+
}
|
|
13
|
+
type QueryBuilderCreator<TStore extends AnyChimeraEntityStore> = (qb: ChimeraQueryBuilder<TStore>) => ChimeraQueryBuilder<TStore> | undefined;
|
|
10
14
|
type AnyChimeraParams<TStore extends AnyChimeraEntityStore, TMeta = any, QueryBuilder extends ChimeraQueryBuilder<TStore> = ChimeraQueryBuilder<TStore>> = ChimeraCollectionParams<ChimeraEntityStoreOperatorsMap<TStore>, ChimeraEntityStoreEntity<TStore>, TMeta> | QueryBuilderCreator<TStore> | QueryBuilder;
|
|
11
|
-
declare const normalizeParams: <TStore extends AnyChimeraEntityStore, TMeta = any>(createQueryBuilder: () => ChimeraQueryBuilder<TStore
|
|
15
|
+
declare const normalizeParams: <TStore extends AnyChimeraEntityStore, TMeta = any>(createQueryBuilder: (() => ChimeraQueryBuilder<TStore>) | undefined, params: AnyChimeraParams<TStore, TMeta>) => ChimeraCollectionParams<ChimeraEntityStoreOperatorsMap<TStore>, ChimeraEntityStoreEntity<TStore>, TMeta>;
|
|
12
16
|
//#endregion
|
|
13
|
-
export { AnyChimeraParams, CHIMERA_COLLECTION_UPDATE_EVENTS, CHIMERA_ENTITY_STORE_UPDATE_EVENTS, CHIMERA_ITEM_UPDATE_EVENTS, normalizeParams };
|
|
17
|
+
export { AnyChimeraParams, CHIMERA_COLLECTION_UPDATE_EVENTS, CHIMERA_ENTITY_STORE_UPDATE_EVENTS, CHIMERA_ITEM_UPDATE_EVENTS, ChimeraQueryBuilder, QueryBuilderCreator, normalizeParams };
|
|
14
18
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../events.ts","../params.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../events.ts","../params.ts"],"sourcesContent":[],"mappings":";;;cAOa;cASA;cAaA;;;UCnBI,mCAAmC;;EDHvC,KAAA,EAAA,ECKH,uBDLG,CCKqB,8BDEyC,CCFV,MDEU,CAAA,ECFD,wBDEC,CCFwB,MDExB,CAAA,EAAA,GAAA,CAAA;AAE3E;AAaa,KCdD,mBDcC,CAAA,eCdkC,qBDuB0B,CAAA,GAAA,CAAA,EAAA,ECtBpE,mBDsBoE,CCtBhD,MDsBgD,CAAA,EAAA,GCrBpE,mBDqBoE,CCrBhD,MDqBgD,CAAA,GAAA,SAAA;KCnB7D,gCACI,yDAEM,oBAAoB,UAAU,oBAAoB,WAErE,wBAAwB,+BAA+B,SAAS,yBAAyB,SAAS,SAClG,oBAAoB,UACpB;cAMU,iCAAkC,+DACnB,oBAAoB,8BACvC,iBAAiB,QAAQ,WAC/B,wBAAwB,+BAA+B,SAAS,yBAAyB,SAAS"}
|
package/dist/index.mjs
CHANGED
|
@@ -36,6 +36,7 @@ const isQueryBuilder = (params) => "isChimeraQueryBuilder" in params && params.i
|
|
|
36
36
|
const normalizeParams = (createQueryBuilder, params) => {
|
|
37
37
|
if (isQueryBuilder(params)) return params.build();
|
|
38
38
|
if (typeof params === "function") {
|
|
39
|
+
if (!createQueryBuilder) throw new Error("Query builder creator function provided but no query builder factory was supplied. Either pass a query builder factory as the second argument to createChimeraStoreHooks/createChimeraStoreComposables, or install the official @hf-chimera/query-builder package and use 'createDefaultQueryBuilder'. Alternatively, use plain ChimeraCollectionParams instead of a creator function.");
|
|
39
40
|
const q = createQueryBuilder();
|
|
40
41
|
return (params(q) ?? q).build();
|
|
41
42
|
}
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../events.ts","../params.ts"],"sourcesContent":["import type {\n\tAnyChimeraCollectionQuery,\n\tAnyChimeraEntityStore,\n\tAnyChimeraItemQuery,\n\tChimeraEventEmitterEventNames,\n} from \"@hf-chimera/store\";\n\nexport const CHIMERA_ENTITY_STORE_UPDATE_EVENTS = [\n\t\"initialized\",\n\t\"updated\",\n\t\"itemAdded\",\n\t\"itemUpdated\",\n\t\"deleted\",\n\t\"itemDeleted\",\n] as const satisfies ChimeraEventEmitterEventNames<AnyChimeraEntityStore>[];\n\nexport const 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 satisfies ChimeraEventEmitterEventNames<AnyChimeraCollectionQuery>[];\n\nexport const 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 satisfies ChimeraEventEmitterEventNames<AnyChimeraItemQuery>[];\n","import type {
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../events.ts","../params.ts"],"sourcesContent":["import type {\n\tAnyChimeraCollectionQuery,\n\tAnyChimeraEntityStore,\n\tAnyChimeraItemQuery,\n\tChimeraEventEmitterEventNames,\n} from \"@hf-chimera/store\";\n\nexport const CHIMERA_ENTITY_STORE_UPDATE_EVENTS = [\n\t\"initialized\",\n\t\"updated\",\n\t\"itemAdded\",\n\t\"itemUpdated\",\n\t\"deleted\",\n\t\"itemDeleted\",\n] as const satisfies ChimeraEventEmitterEventNames<AnyChimeraEntityStore>[];\n\nexport const 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 satisfies ChimeraEventEmitterEventNames<AnyChimeraCollectionQuery>[];\n\nexport const 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 satisfies ChimeraEventEmitterEventNames<AnyChimeraItemQuery>[];\n","import type {\n\tAnyChimeraEntityStore,\n\tChimeraCollectionParams,\n\tChimeraEntityStoreEntity,\n\tChimeraEntityStoreOperatorsMap,\n} from \"@hf-chimera/store\";\n\n// Minimal query builder interface that adapters expect\n// This allows using any query builder implementation (including custom ones)\n// The official implementation is available in @hf-chimera/query-builder\nexport interface ChimeraQueryBuilder<TStore extends AnyChimeraEntityStore> {\n\tisChimeraQueryBuilder: true;\n\tbuild(): ChimeraCollectionParams<ChimeraEntityStoreOperatorsMap<TStore>, ChimeraEntityStoreEntity<TStore>, any>;\n}\n\nexport type QueryBuilderCreator<TStore extends AnyChimeraEntityStore> = (\n\tqb: ChimeraQueryBuilder<TStore>,\n) => ChimeraQueryBuilder<TStore> | undefined;\n\nexport type AnyChimeraParams<\n\tTStore extends AnyChimeraEntityStore,\n\tTMeta = any,\n\tQueryBuilder extends ChimeraQueryBuilder<TStore> = ChimeraQueryBuilder<TStore>,\n> =\n\t| ChimeraCollectionParams<ChimeraEntityStoreOperatorsMap<TStore>, ChimeraEntityStoreEntity<TStore>, TMeta>\n\t| QueryBuilderCreator<TStore>\n\t| QueryBuilder;\n\nconst isQueryBuilder = <TStore extends AnyChimeraEntityStore, Meta = any>(\n\tparams: AnyChimeraParams<TStore, Meta>,\n): params is ChimeraQueryBuilder<TStore> => \"isChimeraQueryBuilder\" in params && params.isChimeraQueryBuilder;\n\nexport const normalizeParams = <TStore extends AnyChimeraEntityStore, TMeta = any>(\n\tcreateQueryBuilder: (() => ChimeraQueryBuilder<TStore>) | undefined,\n\tparams: AnyChimeraParams<TStore, TMeta>,\n): ChimeraCollectionParams<ChimeraEntityStoreOperatorsMap<TStore>, ChimeraEntityStoreEntity<TStore>, TMeta> => {\n\tif (isQueryBuilder(params)) return params.build();\n\tif (typeof params === \"function\") {\n\t\tif (!createQueryBuilder) {\n\t\t\tthrow new Error(\n\t\t\t\t\"Query builder creator function provided but no query builder factory was supplied. \" +\n\t\t\t\t\t\"Either pass a query builder factory as the second argument to createChimeraStoreHooks/createChimeraStoreComposables, \" +\n\t\t\t\t\t\"or install the official @hf-chimera/query-builder package and use 'createDefaultQueryBuilder'. \" +\n\t\t\t\t\t\"Alternatively, use plain ChimeraCollectionParams instead of a creator function.\",\n\t\t\t);\n\t\t}\n\t\tconst q = createQueryBuilder();\n\t\treturn (params(q) ?? q).build();\n\t}\n\treturn params;\n};\n"],"mappings":";AAOA,MAAa,qCAAqC;CACjD;CACA;CACA;CACA;CACA;CACA;CACA;AAED,MAAa,mCAAmC;CAC/C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAED,MAAa,6BAA6B;CACzC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;;;ACVD,MAAM,kBACL,WAC2C,2BAA2B,UAAU,OAAO;AAExF,MAAa,mBACZ,oBACA,WAC8G;AAC9G,KAAI,eAAe,OAAO,CAAE,QAAO,OAAO,OAAO;AACjD,KAAI,OAAO,WAAW,YAAY;AACjC,MAAI,CAAC,mBACJ,OAAM,IAAI,MACT,yXAIA;EAEF,MAAM,IAAI,oBAAoB;AAC9B,UAAQ,OAAO,EAAE,IAAI,GAAG,OAAO;;AAEhC,QAAO"}
|
package/package.json
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
2
|
+
"name": "@hf-chimera/adapters-shared",
|
|
3
|
+
"version": "0.2.2",
|
|
4
|
+
"description": "Cross-end reactivity API - Shared adapter utilities",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "hewston",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"reactivity",
|
|
9
|
+
"reactive",
|
|
10
|
+
"adapters",
|
|
11
|
+
"typescript",
|
|
12
|
+
"utilities"
|
|
13
|
+
],
|
|
14
|
+
"type": "module",
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"main": "./dist/index.cjs",
|
|
17
|
+
"module": "./dist/index.js",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"require": "./dist/index.cjs",
|
|
22
|
+
"import": "./dist/index.js"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist"
|
|
27
|
+
],
|
|
28
|
+
"bugs": {
|
|
29
|
+
"url": "https://github.com/hf-chimera/store/issues"
|
|
30
|
+
},
|
|
31
|
+
"repository": {
|
|
32
|
+
"url": "https://github.com/hf-chimera/store"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"@hf-chimera/store": "~0.2.0"
|
|
36
|
+
},
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public",
|
|
39
|
+
"provenance": true
|
|
40
|
+
},
|
|
41
|
+
"scripts": {
|
|
42
|
+
"build": "tsdown",
|
|
43
|
+
"changeset:patch": "node ../../../scripts/changeset-patch.mjs @hf-chimera/adapters-shared"
|
|
44
|
+
}
|
|
45
|
+
}
|