@hf-chimera/store 0.1.0 → 0.2.0

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 (80) hide show
  1. package/README.md +171 -360
  2. package/dist/defaults-CDnbUToo.cjs +175 -0
  3. package/dist/defaults-CDnbUToo.cjs.map +1 -0
  4. package/dist/defaults-DkrKTPXY.mjs +91 -0
  5. package/dist/defaults-DkrKTPXY.mjs.map +1 -0
  6. package/dist/defaults.cjs +3 -14
  7. package/dist/defaults.d.cts +16 -42
  8. package/dist/defaults.d.cts.map +1 -1
  9. package/dist/defaults.d.mts +33 -0
  10. package/dist/defaults.d.mts.map +1 -0
  11. package/dist/defaults.mjs +3 -0
  12. package/dist/index.cjs +1709 -23
  13. package/dist/index.cjs.map +1 -0
  14. package/dist/index.d.cts +634 -2
  15. package/dist/index.d.cts.map +1 -0
  16. package/dist/index.d.mts +634 -0
  17. package/dist/index.d.mts.map +1 -0
  18. package/dist/{src-C74sq0jQ.js → index.mjs} +252 -246
  19. package/dist/index.mjs.map +1 -0
  20. package/dist/types-CNGIuRUw.d.mts +117 -0
  21. package/dist/types-CNGIuRUw.d.mts.map +1 -0
  22. package/dist/types-CuI5yXiY.d.cts +117 -0
  23. package/dist/types-CuI5yXiY.d.cts.map +1 -0
  24. package/package.json +10 -51
  25. package/.changeset/README.md +0 -8
  26. package/CHANGELOG.md +0 -98
  27. package/dist/adapters/react.cjs +0 -70
  28. package/dist/adapters/react.cjs.map +0 -1
  29. package/dist/adapters/react.d.cts +0 -15
  30. package/dist/adapters/react.d.cts.map +0 -1
  31. package/dist/adapters/react.d.ts +0 -15
  32. package/dist/adapters/react.d.ts.map +0 -1
  33. package/dist/adapters/react.js +0 -69
  34. package/dist/adapters/react.js.map +0 -1
  35. package/dist/adapters/vue.cjs +0 -92
  36. package/dist/adapters/vue.cjs.map +0 -1
  37. package/dist/adapters/vue.d.cts +0 -19
  38. package/dist/adapters/vue.d.cts.map +0 -1
  39. package/dist/adapters/vue.d.ts +0 -19
  40. package/dist/adapters/vue.d.ts.map +0 -1
  41. package/dist/adapters/vue.js +0 -91
  42. package/dist/adapters/vue.js.map +0 -1
  43. package/dist/defaults-C48gY1ow.cjs +0 -372
  44. package/dist/defaults-C48gY1ow.cjs.map +0 -1
  45. package/dist/defaults-CLUQg2zK.js +0 -210
  46. package/dist/defaults-CLUQg2zK.js.map +0 -1
  47. package/dist/defaults.cjs.map +0 -1
  48. package/dist/defaults.d.ts +0 -59
  49. package/dist/defaults.d.ts.map +0 -1
  50. package/dist/defaults.js +0 -13
  51. package/dist/defaults.js.map +0 -1
  52. package/dist/index-BuYMaiND.d.ts +0 -22
  53. package/dist/index-BuYMaiND.d.ts.map +0 -1
  54. package/dist/index-C45y61aH.d.ts +0 -821
  55. package/dist/index-C45y61aH.d.ts.map +0 -1
  56. package/dist/index-DP6-nR2O.d.cts +0 -821
  57. package/dist/index-DP6-nR2O.d.cts.map +0 -1
  58. package/dist/index-FQNcJwA7.d.cts +0 -22
  59. package/dist/index-FQNcJwA7.d.cts.map +0 -1
  60. package/dist/index.d.ts +0 -2
  61. package/dist/index.js +0 -4
  62. package/dist/params-B-wurzdZ.d.ts +0 -8
  63. package/dist/params-B-wurzdZ.d.ts.map +0 -1
  64. package/dist/params-C5dnCvJr.cjs +0 -47
  65. package/dist/params-C5dnCvJr.cjs.map +0 -1
  66. package/dist/params-DmOyCS2B.js +0 -13
  67. package/dist/params-DmOyCS2B.js.map +0 -1
  68. package/dist/params-uxNE-e4a.d.cts +0 -8
  69. package/dist/params-uxNE-e4a.d.cts.map +0 -1
  70. package/dist/qb-D6vPK6P0.cjs +0 -50
  71. package/dist/qb-D6vPK6P0.cjs.map +0 -1
  72. package/dist/qb-pchs-vdM.js +0 -45
  73. package/dist/qb-pchs-vdM.js.map +0 -1
  74. package/dist/qb.cjs +0 -5
  75. package/dist/qb.d.cts +0 -3
  76. package/dist/qb.d.ts +0 -3
  77. package/dist/qb.js +0 -5
  78. package/dist/src-C74sq0jQ.js.map +0 -1
  79. package/dist/src-YxpDmKvq.cjs +0 -1771
  80. package/dist/src-YxpDmKvq.cjs.map +0 -1
@@ -1,91 +0,0 @@
1
- import "../defaults-CLUQg2zK.js";
2
- import "../src-C74sq0jQ.js";
3
- import "../qb-pchs-vdM.js";
4
- import { t as normalizeParams } from "../params-DmOyCS2B.js";
5
- import { computed, customRef, isRef, watch } from "vue";
6
-
7
- //#region packages/adapters/vue/composables.ts
8
- const isFunction = (value) => typeof value === "function";
9
- const toValue = (value) => isFunction(value) ? value() : isRef(value) ? value.value : value;
10
- const CHIMERA_COLLECTION_UPDATE_EVENTS = [
11
- "ready",
12
- "updated",
13
- "selfUpdated",
14
- "selfItemCreated",
15
- "itemAdded",
16
- "itemUpdated",
17
- "selfItemUpdated",
18
- "itemDeleted",
19
- "selfItemDeleted",
20
- "error"
21
- ];
22
- const CHIMERA_ITEM_UPDATE_EVENTS = [
23
- "initialized",
24
- "selfCreated",
25
- "ready",
26
- "updated",
27
- "selfUpdated",
28
- "deleted",
29
- "selfDeleted",
30
- "error"
31
- ];
32
- const createChimeraComposables = (store) => {
33
- const useChimeraRepository = (entityName) => computed(() => store.from(toValue(entityName)));
34
- return {
35
- useChimeraStore: () => store,
36
- useChimeraRepository,
37
- useChimeraCollection: (entityName, params) => {
38
- const repository = useChimeraRepository(entityName);
39
- const normalizedParams = computed(() => normalizeParams(toValue(params)));
40
- const collection = computed(() => repository.value.getCollection(normalizedParams.value));
41
- return customRef((track, trigger) => {
42
- watch(collection, (collection$1, _, onCleanup) => {
43
- const handler = () => trigger();
44
- CHIMERA_COLLECTION_UPDATE_EVENTS.forEach((event) => {
45
- collection$1.on(event, handler);
46
- });
47
- onCleanup(() => CHIMERA_COLLECTION_UPDATE_EVENTS.forEach((event) => {
48
- collection$1.off(event, handler);
49
- }));
50
- }, { immediate: true });
51
- return {
52
- get() {
53
- track();
54
- return collection.value;
55
- },
56
- set() {
57
- console.warn("ChimeraCollectionRef is readonly");
58
- }
59
- };
60
- });
61
- },
62
- useChimeraItem: (entityName, id, meta) => {
63
- const repository = useChimeraRepository(entityName);
64
- const item = computed(() => repository.value.getItem(toValue(id), toValue(meta)));
65
- return customRef((track, trigger) => {
66
- watch(item, (item$1, _, onCleanup) => {
67
- const handler = () => trigger();
68
- CHIMERA_ITEM_UPDATE_EVENTS.forEach((event) => {
69
- item$1.on(event, handler);
70
- });
71
- onCleanup(() => CHIMERA_ITEM_UPDATE_EVENTS.forEach((event) => {
72
- item$1.off(event, handler);
73
- }));
74
- }, { immediate: true });
75
- return {
76
- get() {
77
- track();
78
- return item.value;
79
- },
80
- set() {
81
- console.warn("ChimeraItemRef is readonly");
82
- }
83
- };
84
- });
85
- }
86
- };
87
- };
88
-
89
- //#endregion
90
- export { createChimeraComposables };
91
- //# sourceMappingURL=vue.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vue.js","names":[],"sources":["../../packages/adapters/vue/composables.ts"],"sourcesContent":["import { computed, customRef, isRef, type Ref, watch } from \"vue\";\nimport type {\n\tAnyChimeraStore,\n\tChimeraCollectionQuery,\n\tChimeraEntityId,\n\tChimeraItemQuery,\n\tChimeraStoreEntities,\n\tChimeraStoreEntityType,\n\tChimeraStoreOperatorMap,\n} from \"../../../src\";\nimport type { ChimeraEntityRepository } from \"../../../src/store/ChimeraEntityRepository\";\nimport { type AnyChimeraParams, normalizeParams } from \"../shared/params\";\n\ntype MaybeRef<T> = T | Ref<T>;\ntype MaybeRefOrGetter<T> = MaybeRef<T> | (() => T);\n\nconst isFunction = (value: any): value is () => any => typeof value === \"function\";\nconst toValue = <T>(value: MaybeRefOrGetter<T>): T =>\n\tisFunction(value) ? value() : isRef(value) ? value.value : value;\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;\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;\n\nexport type ChimeraCollectionRef<T extends AnyChimeraStore, EntityName extends ChimeraStoreEntities<T>> = Ref<\n\tChimeraCollectionQuery<ChimeraStoreEntityType<T, EntityName>, ChimeraStoreOperatorMap<T>>\n>;\n\nexport type ChimeraItemRef<T extends AnyChimeraStore, EntityName extends ChimeraStoreEntities<T>> = Ref<\n\tChimeraItemQuery<ChimeraStoreEntityType<T, EntityName>>\n>;\n\nexport const createChimeraComposables = <T extends AnyChimeraStore>(\n\tstore: T,\n): {\n\tuseChimeraStore: () => T;\n\tuseChimeraRepository: <EntityName extends ChimeraStoreEntities<T>>(\n\t\tentityName: MaybeRefOrGetter<EntityName>,\n\t) => Ref<ChimeraEntityRepository<ChimeraStoreEntityType<T, EntityName>, ChimeraStoreOperatorMap<T>>>;\n\tuseChimeraCollection: <EntityName extends ChimeraStoreEntities<T>, Meta = any>(\n\t\tentityName: MaybeRefOrGetter<EntityName>,\n\t\tparams: MaybeRefOrGetter<AnyChimeraParams<T, EntityName, Meta>>,\n\t) => ChimeraCollectionRef<T, EntityName>;\n\tuseChimeraItem: <EntityName extends ChimeraStoreEntities<T>, Meta = any>(\n\t\tentityName: MaybeRefOrGetter<EntityName>,\n\t\tid: MaybeRefOrGetter<ChimeraEntityId>,\n\t\tmeta?: MaybeRefOrGetter<Meta>,\n\t) => ChimeraItemRef<T, EntityName>;\n} => {\n\tconst useChimeraRepository = <EntityName extends ChimeraStoreEntities<T>>(entityName: MaybeRefOrGetter<EntityName>) =>\n\t\tcomputed(() => store.from(toValue(entityName)));\n\n\treturn {\n\t\tuseChimeraStore: () => store,\n\t\tuseChimeraRepository,\n\t\tuseChimeraCollection: (entityName, params) => {\n\t\t\tconst repository = useChimeraRepository(entityName);\n\t\t\tconst normalizedParams = computed(() => normalizeParams(toValue(params)));\n\t\t\tconst collection = computed(() => repository.value.getCollection(normalizedParams.value));\n\n\t\t\treturn customRef((track, trigger) => {\n\t\t\t\twatch(\n\t\t\t\t\tcollection,\n\t\t\t\t\t(collection, _, onCleanup) => {\n\t\t\t\t\t\tconst handler = () => trigger();\n\t\t\t\t\t\tCHIMERA_COLLECTION_UPDATE_EVENTS.forEach((event) => {\n\t\t\t\t\t\t\tcollection.on(event, handler);\n\t\t\t\t\t\t});\n\t\t\t\t\t\tonCleanup(() =>\n\t\t\t\t\t\t\tCHIMERA_COLLECTION_UPDATE_EVENTS.forEach((event) => {\n\t\t\t\t\t\t\t\tcollection.off(event, handler);\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t\t{ immediate: true },\n\t\t\t\t);\n\n\t\t\t\treturn {\n\t\t\t\t\tget() {\n\t\t\t\t\t\ttrack();\n\t\t\t\t\t\treturn collection.value;\n\t\t\t\t\t},\n\t\t\t\t\tset() {\n\t\t\t\t\t\tconsole.warn(\"ChimeraCollectionRef is readonly\");\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t});\n\t\t},\n\t\tuseChimeraItem: (entityName, id, meta) => {\n\t\t\tconst repository = useChimeraRepository(entityName);\n\t\t\tconst item = computed(() => repository.value.getItem(toValue(id), toValue(meta)));\n\n\t\t\treturn customRef((track, trigger) => {\n\t\t\t\twatch(\n\t\t\t\t\titem,\n\t\t\t\t\t(item, _, onCleanup) => {\n\t\t\t\t\t\tconst handler = () => trigger();\n\t\t\t\t\t\tCHIMERA_ITEM_UPDATE_EVENTS.forEach((event) => {\n\t\t\t\t\t\t\titem.on(event, handler);\n\t\t\t\t\t\t});\n\t\t\t\t\t\tonCleanup(() =>\n\t\t\t\t\t\t\tCHIMERA_ITEM_UPDATE_EVENTS.forEach((event) => {\n\t\t\t\t\t\t\t\titem.off(event, handler);\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t\t{ immediate: true },\n\t\t\t\t);\n\n\t\t\t\treturn {\n\t\t\t\t\tget() {\n\t\t\t\t\t\ttrack();\n\t\t\t\t\t\treturn item.value;\n\t\t\t\t\t},\n\t\t\t\t\tset() {\n\t\t\t\t\t\tconsole.warn(\"ChimeraItemRef is readonly\");\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t});\n\t\t},\n\t};\n};\n"],"mappings":";;;;;;;AAgBA,MAAM,cAAc,UAAmC,OAAO,UAAU;AACxE,MAAM,WAAc,UACnB,WAAW,MAAM,GAAG,OAAO,GAAG,MAAM,MAAM,GAAG,MAAM,QAAQ;AAE5D,MAAM,mCAAmC;CACxC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAED,MAAM,6BAA6B;CAClC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAUD,MAAa,4BACZ,UAeI;CACJ,MAAM,wBAAoE,eACzE,eAAe,MAAM,KAAK,QAAQ,WAAW,CAAC,CAAC;AAEhD,QAAO;EACN,uBAAuB;EACvB;EACA,uBAAuB,YAAY,WAAW;GAC7C,MAAM,aAAa,qBAAqB,WAAW;GACnD,MAAM,mBAAmB,eAAe,gBAAgB,QAAQ,OAAO,CAAC,CAAC;GACzE,MAAM,aAAa,eAAe,WAAW,MAAM,cAAc,iBAAiB,MAAM,CAAC;AAEzF,UAAO,WAAW,OAAO,YAAY;AACpC,UACC,aACC,cAAY,GAAG,cAAc;KAC7B,MAAM,gBAAgB,SAAS;AAC/B,sCAAiC,SAAS,UAAU;AACnD,mBAAW,GAAG,OAAO,QAAQ;OAC5B;AACF,qBACC,iCAAiC,SAAS,UAAU;AACnD,mBAAW,IAAI,OAAO,QAAQ;OAC7B,CACF;OAEF,EAAE,WAAW,MAAM,CACnB;AAED,WAAO;KACN,MAAM;AACL,aAAO;AACP,aAAO,WAAW;;KAEnB,MAAM;AACL,cAAQ,KAAK,mCAAmC;;KAEjD;KACA;;EAEH,iBAAiB,YAAY,IAAI,SAAS;GACzC,MAAM,aAAa,qBAAqB,WAAW;GACnD,MAAM,OAAO,eAAe,WAAW,MAAM,QAAQ,QAAQ,GAAG,EAAE,QAAQ,KAAK,CAAC,CAAC;AAEjF,UAAO,WAAW,OAAO,YAAY;AACpC,UACC,OACC,QAAM,GAAG,cAAc;KACvB,MAAM,gBAAgB,SAAS;AAC/B,gCAA2B,SAAS,UAAU;AAC7C,aAAK,GAAG,OAAO,QAAQ;OACtB;AACF,qBACC,2BAA2B,SAAS,UAAU;AAC7C,aAAK,IAAI,OAAO,QAAQ;OACvB,CACF;OAEF,EAAE,WAAW,MAAM,CACnB;AAED,WAAO;KACN,MAAM;AACL,aAAO;AACP,aAAO,KAAK;;KAEb,MAAM;AACL,cAAQ,KAAK,6BAA6B;;KAE3C;KACA;;EAEH"}
@@ -1,372 +0,0 @@
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
- });
372
- //# sourceMappingURL=defaults-C48gY1ow.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"defaults-C48gY1ow.cjs","names":["getKeyFromOperation: ChimeraKeyFromOperatorGetter","chimeraDefaultGetKeyFromFilter: ChimeraKeyFromFilterGetter","chimeraDefaultComparator: ChimeraPrimitiveComparator","chimeraDefaultKeyFromOrder: ChimeraKeyFromOrderGetter"],"sources":["../src/shared/errors.ts","../src/order/errors.ts","../src/query/errors.ts","../src/debug/defaults.ts","../src/filter/defaults.ts","../src/order/defaults.ts","../src/query/defaults.ts"],"sourcesContent":["export class ChimeraError extends Error {}\n\nexport class ChimeraInternalError extends ChimeraError {\n\tconstructor(message: string, options?: ErrorOptions) {\n\t\tsuper(\n\t\t\t`${message}\\nIf you have this bug, feel free to create an issue in https://github.com/hf-chimera/store/issues`,\n\t\t\toptions,\n\t\t);\n\t}\n}\n","import { ChimeraError } from \"../shared/errors.ts\";\n\nexport class ChimeraOrderError extends ChimeraError {}\n\nexport class ChimeraOrderTypeError extends ChimeraOrderError {}\n\nexport class ChimeraOrderTypeComparisonError extends ChimeraOrderTypeError {\n\tconstructor(a: unknown, b: unknown) {\n\t\tsuper(\n\t\t\t`Unsupported comparison \"${a}\"(${typeof a}[${a != null ? a.constructor.name : a}]) with \"${b}\"(${typeof b}[${b != null ? b.constructor.name : b}])`,\n\t\t);\n\t}\n}\n","import { ChimeraError } from \"../shared/errors.ts\";\nimport type { ChimeraEntityId } from \"../shared/types.ts\";\nimport type { ChimeraQueryFetchingState } from \"./types.ts\";\n\nconst formatDeepErrorMessage = (message: string, cause: unknown): string =>\n\t`${message}: ${cause instanceof Error ? `\\n ${cause.stack}` : cause}`;\n\nexport class ChimeraQueryError extends ChimeraError {\n\treadonly entityName: string;\n\n\tconstructor(entityName: string, message: string, options?: ErrorOptions) {\n\t\tsuper(message, options);\n\t\tthis.entityName = entityName;\n\t}\n}\n\nexport class ChimeraQueryIdMismatchError extends ChimeraQueryError {\n\treadonly old: ChimeraEntityId;\n\treadonly new: ChimeraEntityId;\n\n\tconstructor(entityName: string, oldId: ChimeraEntityId, newId: ChimeraEntityId) {\n\t\tsuper(\n\t\t\tentityName,\n\t\t\t`\nCan't update \"${entityName}\" item if the change updates it's [id] (changed from \"${oldId}\" to \"${newId}\").\nIf such an update should not be an error, update <idGetter> field in \"${entityName}\" entity config to make Chimera get the [id] value properly.\n\t\t`.trim(),\n\t\t);\n\t\tthis.old = oldId;\n\t\tthis.new = newId;\n\t}\n}\n\nexport class ChimeraQueryNotSpecifiedError extends ChimeraQueryError {\n\treadonly methodName: string;\n\n\tconstructor(entityName: string, methodName: string) {\n\t\tsuper(entityName, `<${methodName}> for entity \"${entityName}\" was not specified`);\n\t\tthis.methodName = methodName;\n\t}\n}\n\nexport class ChimeraQueryTrustError extends ChimeraQueryError {\n\tconstructor(entityName: string, description: string) {\n\t\tsuper(\n\t\t\tentityName,\n\t\t\t`\nDO NOT IGNORE THIS ERROR OR YOUR PROD MAY BREAK!\n\nLooks like your \"${entityName}\" query provider ${description}\n\nBy default Chimera tend to trust external query provider to avoid extra data processing.\nIf it is not your case, set field \"trustQuery\" to \"false\" in config defaults or for specific entity.\nThis error visible only if \"devMode\" is \"true\".\nIf you'll ignore it, your production may fail, because Chimera won't check the data correctness.\n`.trim(),\n\t\t);\n\t}\n}\n\nexport class ChimeraQueryTrustIdMismatchError extends ChimeraQueryTrustError {\n\treadonly old: ChimeraEntityId;\n\treadonly new: ChimeraEntityId;\n\n\tconstructor(entityName: string, oldId: ChimeraEntityId, newId: ChimeraEntityId) {\n\t\tsuper(\n\t\t\tentityName,\n\t\t\t`\nreturned an item with [id] that not matches with the [id] of item that was updated (changed from \"${oldId}\" to \"${newId}\"). \nIf it is not an error, update <idGetter> field in \"${entityName}\" entity config to make Chimera get the [id] value properly.\n`.trim(),\n\t\t);\n\t\tthis.old = oldId;\n\t\tthis.new = newId;\n\t}\n}\n\nexport class ChimeraQueryTrustFetchedCollectionError extends ChimeraQueryTrustError {\n\treadonly old: unknown[];\n\treadonly new: unknown[];\n\n\tconstructor(entityName: string, input: unknown[], output: unknown[]) {\n\t\tsuper(entityName, \"returned not properly sorted or ordered collection.\");\n\t\tthis.old = input;\n\t\tthis.new = output;\n\t}\n}\n\nexport class ChimeraQueryFetchingError extends ChimeraQueryError {\n\tconstructor(entityName: string, cause: unknown) {\n\t\tsuper(entityName, formatDeepErrorMessage(\"Something went wrong\", cause), { cause });\n\t}\n}\n\nexport class ChimeraQueryDeletingError extends ChimeraQueryError {\n\tconstructor(entityName: string, cause: unknown) {\n\t\tsuper(entityName, formatDeepErrorMessage(\"Something went wrong\", cause), { cause });\n\t}\n}\n\nexport class ChimeraQueryNotReadyError extends ChimeraQueryError {\n\tconstructor(entityName: string) {\n\t\tsuper(entityName, \"Unable to get unready value.\");\n\t}\n}\n\nexport class ChimeraQueryDeletedItemError extends ChimeraQueryError {\n\tconstructor(entityName: string, id: ChimeraEntityId) {\n\t\tsuper(entityName, `Unable to updated deleted item with [id] \"${id}.\"`);\n\t}\n}\n\nexport class ChimeraQueryUnsuccessfulDeletionError extends ChimeraQueryError {\n\tconstructor(entityName: string, id: ChimeraEntityId) {\n\t\tsuper(entityName, `Item with [id] \"${id}\" was not deleted.`);\n\t}\n}\n\nexport class ChimeraQueryAlreadyRunningError extends ChimeraQueryError {\n\tconstructor(entityName: string, status: ChimeraQueryFetchingState) {\n\t\tsuper(entityName, `Unable to operate query. Other process already running ${status}.`);\n\t}\n}\n\nexport class ChimeraQueryNotCreatedError extends ChimeraQueryError {\n\tconstructor(entityName: string) {\n\t\tsuper(entityName, \"Unable to operate not created item.\");\n\t}\n}\n","import type { ChimeraDebugConfig } from \"./types.ts\";\n\nexport const chimeraDefaultDebugConfig = {\n\tdevMode: false,\n\tlogs: \"info\",\n\tname: \"chimera\",\n} satisfies Required<ChimeraDebugConfig>;\n","import type {\n\tChimeraFilterConfig,\n\tChimeraKeyFromFilterGetter,\n\tChimeraKeyFromOperatorGetter,\n\tChimeraOperatorMap,\n} from \"./types.ts\";\n\nexport const getKeyFromOperation: ChimeraKeyFromOperatorGetter = (operator) => JSON.stringify(operator);\nexport const chimeraDefaultGetKeyFromFilter: ChimeraKeyFromFilterGetter = (filter) => JSON.stringify(filter);\n\nexport const chimeraDefaultFilterOperators = {\n\tcontains: <\n\t\tI extends string | unknown[],\n\t\tT extends I extends never[] ? unknown : I extends unknown[] ? I[number] | I : I extends string ? string : never,\n\t>(\n\t\ta: I,\n\t\tb: T,\n\t) => {\n\t\tif (typeof a === \"string\") return a.includes(b as string);\n\t\tif (Array.isArray(a)) return Array.isArray(b) ? b.every((v) => a.includes(v)) : a.includes(b);\n\t\treturn false;\n\t},\n\tendsWith: (a: string, b: string) => a.endsWith(b),\n\tstartsWith: (a: string, b: string) => a.startsWith(b),\n\teq: <T>(a: T, b: T) => a === b,\n\tgt: (a, b) => a > b,\n\tgte: (a, b) => a >= b,\n\tin: <I, T extends I extends never[] ? unknown[] : I extends unknown[] ? I : I[]>(a: I, b: T) =>\n\t\t(Array.isArray(a) ? a : [a]).some((v) => b.includes(v)),\n\tlt: (a, b) => a < b,\n\tlte: (a, b) => a <= b,\n\tneq: <T>(a: T, b: T) => a !== b,\n\tnotIn: (a, b) => (Array.isArray(a) ? a : [a]).every((v) => !b.includes(v)),\n} satisfies ChimeraOperatorMap;\n\nexport const chimeraDefaultFilterConfig = {\n\tgetFilterKey: chimeraDefaultGetKeyFromFilter,\n\tgetOperatorKey: getKeyFromOperation,\n\toperators: chimeraDefaultFilterOperators,\n} satisfies ChimeraFilterConfig<typeof chimeraDefaultFilterOperators>;\n","import { ChimeraOrderTypeComparisonError } from \"./errors.ts\";\nimport type { ChimeraKeyFromOrderGetter, ChimeraOrderConfig, ChimeraPrimitiveComparator } from \"./types.ts\";\n\nexport const chimeraDefaultComparator: ChimeraPrimitiveComparator = (a: unknown, b: unknown): number => {\n\tlet result = 0;\n\n\tif (typeof a === \"string\" && typeof b === \"string\") {\n\t\tresult = a.localeCompare(b);\n\t} else if ((typeof a === \"number\" && typeof b === \"number\") || (typeof a === \"boolean\" && typeof b === \"boolean\")) {\n\t\tresult = (a as number) - (b as number);\n\t} else if (a instanceof Date && b instanceof Date) {\n\t\tresult = a.getTime() - b.getTime();\n\t} else if (a == null || b == null) {\n\t\t// biome-ignore lint/suspicious/noDoubleEquals: At least one of the operands should be null or undefined. If one of them is null and the other is undefined, we should get true.\n\t\tresult = a == b ? 0 : a == null ? -1 : 1;\n\t} else {\n\t\tthrow new ChimeraOrderTypeComparisonError(a, b);\n\t}\n\treturn result;\n};\n\nexport const chimeraDefaultKeyFromOrder: ChimeraKeyFromOrderGetter = (order): string => JSON.stringify(order);\n\nexport const chimeraDefaultOrderConfig = {\n\tgetKey: chimeraDefaultKeyFromOrder,\n\tprimitiveComparator: chimeraDefaultComparator,\n} satisfies Required<ChimeraOrderConfig>;\n","import type { chimeraDefaultFilterOperators } from \"../filter/defaults\";\nimport type { ChimeraEntityMap } from \"../shared/types.ts\";\nimport { ChimeraQueryNotSpecifiedError } from \"./errors.ts\";\nimport type { ChimeraQueryConfig, ChimeraQueryDefaultsConfig } from \"./types.ts\";\n\nexport const chimeraDefaultQueryConfig = {\n\tdefaults: {\n\t\tbatchedCreator: (entity: string) => {\n\t\t\tthrow new ChimeraQueryNotSpecifiedError(entity, \"batchedCreator\");\n\t\t},\n\t\tbatchedDeleter: (entity: string) => {\n\t\t\tthrow new ChimeraQueryNotSpecifiedError(entity, \"batchedDeleter\");\n\t\t},\n\t\tbatchedUpdater: (entity: string) => {\n\t\t\tthrow new ChimeraQueryNotSpecifiedError(entity, \"batchedUpdater\");\n\t\t},\n\n\t\tcollectionFetcher: (entity: string) => {\n\t\t\tthrow new ChimeraQueryNotSpecifiedError(entity, \"collectionFetcher\");\n\t\t},\n\n\t\tidGetter: (entity: string) => {\n\t\t\tthrow new ChimeraQueryNotSpecifiedError(entity, \"idGetter\");\n\t\t},\n\n\t\titemCreator: (entity: string) => {\n\t\t\tthrow new ChimeraQueryNotSpecifiedError(entity, \"itemCreator\");\n\t\t},\n\n\t\titemDeleter: (entity: string) => {\n\t\t\tthrow new ChimeraQueryNotSpecifiedError(entity, \"itemDeleter\");\n\t\t},\n\t\titemFetcher: (entity: string) => {\n\t\t\tthrow new ChimeraQueryNotSpecifiedError(entity, \"itemFetcher\");\n\t\t},\n\n\t\titemUpdater: (entity: string) => {\n\t\t\tthrow new ChimeraQueryNotSpecifiedError(entity, \"itemUpdater\");\n\t\t},\n\t\ttrustQuery: true,\n\t\tupdateDebounceTimeout: 0,\n\t} as Required<ChimeraQueryDefaultsConfig<ChimeraEntityMap, typeof chimeraDefaultFilterOperators>>,\n\tentities: {},\n} satisfies ChimeraQueryConfig<ChimeraEntityMap, typeof chimeraDefaultFilterOperators>;\n"],"mappings":";;AAAA,IAAa,eAAb,cAAkC,MAAM;AAExC,IAAa,uBAAb,cAA0C,aAAa;CACtD,YAAY,SAAiB,SAAwB;AACpD,QACC,GAAG,QAAQ,qGACX,QACA;;;;;;ACLH,IAAa,oBAAb,cAAuC,aAAa;AAEpD,IAAa,wBAAb,cAA2C,kBAAkB;AAE7D,IAAa,kCAAb,cAAqD,sBAAsB;CAC1E,YAAY,GAAY,GAAY;AACnC,QACC,2BAA2B,EAAE,IAAI,OAAO,EAAE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