@entifix/core 0.8.0 → 0.10.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 (82) hide show
  1. package/README.md +3 -3
  2. package/dist/deadline/deadline.d.ts +33 -0
  3. package/dist/deadline/deadline.d.ts.map +1 -0
  4. package/dist/deadline/deadline.js +33 -0
  5. package/dist/deadline/deadline.js.map +1 -0
  6. package/dist/entity-definition/links/entity-collection-link/entity-collection-link.d.ts +3 -3
  7. package/dist/entity-definition/links/entity-collection-link/entity-collection-link.d.ts.map +1 -1
  8. package/dist/entity-definition/links/entity-collection-link/entity-collection-link.js.map +1 -1
  9. package/dist/entity-definition/links/entity-link/entity-link.d.ts +4 -4
  10. package/dist/entity-definition/links/entity-link/entity-link.d.ts.map +1 -1
  11. package/dist/entity-definition/links/entity-link/entity-link.js.map +1 -1
  12. package/dist/entity-definition/links/entity-link-source/entity-link-source.d.ts +3 -3
  13. package/dist/entity-definition/links/entity-link-source/entity-link-source.d.ts.map +1 -1
  14. package/dist/entity-definition/links/entity-link-source/entity-link-source.js.map +1 -1
  15. package/dist/entity-definition/validate/validate-records.d.ts +23 -6
  16. package/dist/entity-definition/validate/validate-records.d.ts.map +1 -1
  17. package/dist/entity-definition/validate/validate-records.js +25 -10
  18. package/dist/entity-definition/validate/validate-records.js.map +1 -1
  19. package/dist/envelope/make-envelope.d.ts +7 -1
  20. package/dist/envelope/make-envelope.d.ts.map +1 -1
  21. package/dist/envelope/make-envelope.js +12 -0
  22. package/dist/envelope/make-envelope.js.map +1 -1
  23. package/dist/envelope/read-envelope.d.ts +14 -7
  24. package/dist/envelope/read-envelope.d.ts.map +1 -1
  25. package/dist/envelope/read-envelope.js +36 -25
  26. package/dist/envelope/read-envelope.js.map +1 -1
  27. package/dist/envelope/types.d.ts +3 -1
  28. package/dist/envelope/types.d.ts.map +1 -1
  29. package/dist/envelope/types.js.map +1 -1
  30. package/dist/failure/define.d.ts +39 -0
  31. package/dist/failure/define.d.ts.map +1 -0
  32. package/dist/failure/define.js +70 -0
  33. package/dist/failure/define.js.map +1 -0
  34. package/dist/failure/failure.d.ts +79 -0
  35. package/dist/failure/failure.d.ts.map +1 -0
  36. package/dist/failure/failure.js +39 -0
  37. package/dist/failure/failure.js.map +1 -0
  38. package/dist/failure/generic.d.ts +141 -0
  39. package/dist/failure/generic.d.ts.map +1 -0
  40. package/dist/failure/generic.js +101 -0
  41. package/dist/failure/generic.js.map +1 -0
  42. package/dist/failure/index.d.ts +50 -0
  43. package/dist/failure/index.d.ts.map +1 -0
  44. package/dist/failure/index.js +47 -0
  45. package/dist/failure/index.js.map +1 -0
  46. package/dist/failure/predicates.d.ts +56 -0
  47. package/dist/failure/predicates.d.ts.map +1 -0
  48. package/dist/failure/predicates.js +22 -0
  49. package/dist/failure/predicates.js.map +1 -0
  50. package/dist/failure/problem.d.ts +49 -0
  51. package/dist/failure/problem.d.ts.map +1 -0
  52. package/dist/failure/problem.js +87 -0
  53. package/dist/failure/problem.js.map +1 -0
  54. package/dist/failure/registry.d.ts +28 -0
  55. package/dist/failure/registry.d.ts.map +1 -0
  56. package/dist/failure/registry.js +36 -0
  57. package/dist/failure/registry.js.map +1 -0
  58. package/dist/index.d.ts +4 -0
  59. package/dist/index.d.ts.map +1 -1
  60. package/dist/index.js +4 -0
  61. package/dist/index.js.map +1 -1
  62. package/dist/query/fold.d.ts +40 -0
  63. package/dist/query/fold.d.ts.map +1 -0
  64. package/dist/query/fold.js +49 -0
  65. package/dist/query/fold.js.map +1 -0
  66. package/dist/query/in-memory-query.d.ts +12 -1
  67. package/dist/query/in-memory-query.d.ts.map +1 -1
  68. package/dist/query/in-memory-query.js +33 -3
  69. package/dist/query/in-memory-query.js.map +1 -1
  70. package/dist/rsql/facet-query-url.d.ts +25 -0
  71. package/dist/rsql/facet-query-url.d.ts.map +1 -0
  72. package/dist/rsql/facet-query-url.js +63 -0
  73. package/dist/rsql/facet-query-url.js.map +1 -0
  74. package/dist/rsql/index.d.ts +1 -0
  75. package/dist/rsql/index.d.ts.map +1 -1
  76. package/dist/rsql/index.js +1 -0
  77. package/dist/rsql/index.js.map +1 -1
  78. package/dist/types/EntityFacets.d.ts +30 -0
  79. package/dist/types/EntityFacets.d.ts.map +1 -0
  80. package/dist/types/EntityFacets.js +10 -0
  81. package/dist/types/EntityFacets.js.map +1 -0
  82. package/package.json +3 -3
@@ -0,0 +1,25 @@
1
+ import type { Entity, EntityConstructor } from '../types/Entity.js';
2
+ import type { EntityFacetQuery } from '../types/EntityFacets.js';
3
+ /** The parameter naming one member to count, repeated once per facet. */
4
+ export declare const FACET_PARAM = "facet";
5
+ /** The parameter holding one facet's own filtering: `rsql.<member>`. */
6
+ export declare const facetFilterParam: (member: string) => string;
7
+ /**
8
+ * Serializes facet queries into query parameters: each member as a `facet`,
9
+ * and each one's filtering as RSQL under `rsql.<member>` — omitted when it
10
+ * filters nothing, so an unfiltered count keeps a clean URL.
11
+ */
12
+ export declare function serializeFacetQueryParams<TEntity extends Entity>(queries: readonly EntityFacetQuery<TEntity>[]): URLSearchParams;
13
+ /**
14
+ * Parses query parameters into facet queries, validated against the entity's
15
+ * own metadata — the server-side half of the facet protocol, and the same
16
+ * allowlist a load uses.
17
+ *
18
+ * A counted member must be `filterable`: a count is a question about the
19
+ * values a filter would choose between, and counting a member nobody may
20
+ * filter on would read out values the entity chose not to expose. A
21
+ * `localized` member is refused, since its value is a record of texts, not one
22
+ * to count. Every failure is an {@link EntifixBuildError}, so a `400`.
23
+ */
24
+ export declare function parseFacetQueryParams<TEntity extends Entity>(entityConstructor: EntityConstructor<TEntity>, params: URLSearchParams): EntityFacetQuery<TEntity>[];
25
+ //# sourceMappingURL=facet-query-url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"facet-query-url.d.ts","sourceRoot":"","sources":["../../src/rsql/facet-query-url.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAUjE,yEAAyE;AACzE,eAAO,MAAM,WAAW,UAAU,CAAC;AAEnC,wEAAwE;AACxE,eAAO,MAAM,gBAAgB,GAAI,QAAQ,MAAM,KAAG,MACvB,CAAC;AAE5B;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,SAAS,MAAM,EAC9D,OAAO,EAAE,SAAS,gBAAgB,CAAC,OAAO,CAAC,EAAE,GAC5C,eAAe,CAQjB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,SAAS,MAAM,EAC1D,iBAAiB,EAAE,iBAAiB,CAAC,OAAO,CAAC,EAC7C,MAAM,EAAE,eAAe,GACtB,gBAAgB,CAAC,OAAO,CAAC,EAAE,CA6C7B"}
@@ -0,0 +1,63 @@
1
+ import { _ as _extends } from "@swc/helpers/_/_extends";
2
+ import { EntifixBuildError } from '../base-entities/entifix-error/index.js';
3
+ import { allowedDescriptors, coerceFiltering, resolveAllowedProperty } from './coerce-rsql.js';
4
+ import { RSQL_PARAM } from './load-request-url.js';
5
+ import { parseRsql } from './parse-rsql.js';
6
+ import { serializeRsql } from './serialize-rsql.js';
7
+ /** The parameter naming one member to count, repeated once per facet. */ export const FACET_PARAM = 'facet';
8
+ /** The parameter holding one facet's own filtering: `rsql.<member>`. */ export const facetFilterParam = (member)=>`${RSQL_PARAM}.${member}`;
9
+ /**
10
+ * Serializes facet queries into query parameters: each member as a `facet`,
11
+ * and each one's filtering as RSQL under `rsql.<member>` — omitted when it
12
+ * filters nothing, so an unfiltered count keeps a clean URL.
13
+ */ export function serializeFacetQueryParams(queries) {
14
+ const params = new URLSearchParams();
15
+ for (const { member, filtering } of queries){
16
+ params.append(FACET_PARAM, member);
17
+ const rsql = serializeRsql(filtering);
18
+ if (rsql !== '') params.set(facetFilterParam(member), rsql);
19
+ }
20
+ return params;
21
+ }
22
+ /**
23
+ * Parses query parameters into facet queries, validated against the entity's
24
+ * own metadata — the server-side half of the facet protocol, and the same
25
+ * allowlist a load uses.
26
+ *
27
+ * A counted member must be `filterable`: a count is a question about the
28
+ * values a filter would choose between, and counting a member nobody may
29
+ * filter on would read out values the entity chose not to expose. A
30
+ * `localized` member is refused, since its value is a record of texts, not one
31
+ * to count. Every failure is an {@link EntifixBuildError}, so a `400`.
32
+ */ export function parseFacetQueryParams(entityConstructor, params) {
33
+ const members = params.getAll(FACET_PARAM);
34
+ if (members.length === 0) {
35
+ throw new EntifixBuildError(`name at least one "${FACET_PARAM}"`);
36
+ }
37
+ if (new Set(members).size !== members.length) {
38
+ throw new EntifixBuildError(`a "${FACET_PARAM}" is named twice`, undefined, {
39
+ members
40
+ });
41
+ }
42
+ const allowed = allowedDescriptors(entityConstructor, (descriptor)=>descriptor.filterable);
43
+ return members.map((member)=>{
44
+ const { key, locale } = resolveAllowedProperty(allowed, member, 'filterable');
45
+ if (locale !== undefined) {
46
+ // One locale of a localized member is prose, one value per record —
47
+ // there is nothing to choose between, so nothing to count.
48
+ throw new EntifixBuildError(`"${member}" cannot be counted`, undefined, {
49
+ member
50
+ });
51
+ }
52
+ const expression = params.get(facetFilterParam(member));
53
+ return _extends({
54
+ member: key
55
+ }, (expression == null ? void 0 : expression.trim()) ? {
56
+ filtering: [
57
+ coerceFiltering(entityConstructor, parseRsql(expression))
58
+ ]
59
+ } : {});
60
+ });
61
+ }
62
+
63
+ //# sourceMappingURL=facet-query-url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/rsql/facet-query-url.ts"],"sourcesContent":["import { EntifixBuildError } from '../base-entities/entifix-error/index.js';\nimport type { Entity, EntityConstructor } from '../types/Entity.js';\nimport type { EntityFacetQuery } from '../types/EntityFacets.js';\nimport {\n allowedDescriptors,\n coerceFiltering,\n resolveAllowedProperty,\n} from './coerce-rsql.js';\nimport { RSQL_PARAM } from './load-request-url.js';\nimport { parseRsql } from './parse-rsql.js';\nimport { serializeRsql } from './serialize-rsql.js';\n\n/** The parameter naming one member to count, repeated once per facet. */\nexport const FACET_PARAM = 'facet';\n\n/** The parameter holding one facet's own filtering: `rsql.<member>`. */\nexport const facetFilterParam = (member: string): string =>\n `${RSQL_PARAM}.${member}`;\n\n/**\n * Serializes facet queries into query parameters: each member as a `facet`,\n * and each one's filtering as RSQL under `rsql.<member>` — omitted when it\n * filters nothing, so an unfiltered count keeps a clean URL.\n */\nexport function serializeFacetQueryParams<TEntity extends Entity>(\n queries: readonly EntityFacetQuery<TEntity>[],\n): URLSearchParams {\n const params = new URLSearchParams();\n for (const { member, filtering } of queries) {\n params.append(FACET_PARAM, member);\n const rsql = serializeRsql(filtering);\n if (rsql !== '') params.set(facetFilterParam(member), rsql);\n }\n return params;\n}\n\n/**\n * Parses query parameters into facet queries, validated against the entity's\n * own metadata — the server-side half of the facet protocol, and the same\n * allowlist a load uses.\n *\n * A counted member must be `filterable`: a count is a question about the\n * values a filter would choose between, and counting a member nobody may\n * filter on would read out values the entity chose not to expose. A\n * `localized` member is refused, since its value is a record of texts, not one\n * to count. Every failure is an {@link EntifixBuildError}, so a `400`.\n */\nexport function parseFacetQueryParams<TEntity extends Entity>(\n entityConstructor: EntityConstructor<TEntity>,\n params: URLSearchParams,\n): EntityFacetQuery<TEntity>[] {\n const members = params.getAll(FACET_PARAM);\n if (members.length === 0) {\n throw new EntifixBuildError(`name at least one \"${FACET_PARAM}\"`);\n }\n if (new Set(members).size !== members.length) {\n throw new EntifixBuildError(\n `a \"${FACET_PARAM}\" is named twice`,\n undefined,\n {\n members,\n },\n );\n }\n\n const allowed = allowedDescriptors(\n entityConstructor,\n descriptor => descriptor.filterable,\n );\n\n return members.map(member => {\n const { key, locale } = resolveAllowedProperty(\n allowed,\n member,\n 'filterable',\n );\n if (locale !== undefined) {\n // One locale of a localized member is prose, one value per record —\n // there is nothing to choose between, so nothing to count.\n throw new EntifixBuildError(`\"${member}\" cannot be counted`, undefined, {\n member,\n });\n }\n const expression = params.get(facetFilterParam(member));\n return {\n member: key as keyof TEntity & string,\n ...(expression?.trim()\n ? {\n filtering: [\n coerceFiltering(entityConstructor, parseRsql(expression)),\n ],\n }\n : {}),\n };\n });\n}\n"],"names":["EntifixBuildError","allowedDescriptors","coerceFiltering","resolveAllowedProperty","RSQL_PARAM","parseRsql","serializeRsql","FACET_PARAM","facetFilterParam","member","serializeFacetQueryParams","queries","params","URLSearchParams","filtering","append","rsql","set","parseFacetQueryParams","entityConstructor","members","getAll","length","Set","size","undefined","allowed","descriptor","filterable","map","key","locale","expression","get","trim"],"mappings":";AAAA,SAASA,iBAAiB,QAAQ,0CAA0C;AAG5E,SACEC,kBAAkB,EAClBC,eAAe,EACfC,sBAAsB,QACjB,mBAAmB;AAC1B,SAASC,UAAU,QAAQ,wBAAwB;AACnD,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,aAAa,QAAQ,sBAAsB;AAEpD,uEAAuE,GACvE,OAAO,MAAMC,cAAc,QAAQ;AAEnC,sEAAsE,GACtE,OAAO,MAAMC,mBAAmB,CAACC,SAC/B,GAAGL,WAAW,CAAC,EAAEK,QAAQ,CAAC;AAE5B;;;;CAIC,GACD,OAAO,SAASC,0BACdC,OAA6C;IAE7C,MAAMC,SAAS,IAAIC;IACnB,KAAK,MAAM,EAAEJ,MAAM,EAAEK,SAAS,EAAE,IAAIH,QAAS;QAC3CC,OAAOG,MAAM,CAACR,aAAaE;QAC3B,MAAMO,OAAOV,cAAcQ;QAC3B,IAAIE,SAAS,IAAIJ,OAAOK,GAAG,CAACT,iBAAiBC,SAASO;IACxD;IACA,OAAOJ;AACT;AAEA;;;;;;;;;;CAUC,GACD,OAAO,SAASM,sBACdC,iBAA6C,EAC7CP,MAAuB;IAEvB,MAAMQ,UAAUR,OAAOS,MAAM,CAACd;IAC9B,IAAIa,QAAQE,MAAM,KAAK,GAAG;QACxB,MAAM,IAAItB,kBAAkB,CAAC,mBAAmB,EAAEO,YAAY,CAAC,CAAC;IAClE;IACA,IAAI,IAAIgB,IAAIH,SAASI,IAAI,KAAKJ,QAAQE,MAAM,EAAE;QAC5C,MAAM,IAAItB,kBACR,CAAC,GAAG,EAAEO,YAAY,gBAAgB,CAAC,EACnCkB,WACA;YACEL;QACF;IAEJ;IAEA,MAAMM,UAAUzB,mBACdkB,mBACAQ,CAAAA,aAAcA,WAAWC,UAAU;IAGrC,OAAOR,QAAQS,GAAG,CAACpB,CAAAA;QACjB,MAAM,EAAEqB,GAAG,EAAEC,MAAM,EAAE,GAAG5B,uBACtBuB,SACAjB,QACA;QAEF,IAAIsB,WAAWN,WAAW;YACxB,oEAAoE;YACpE,2DAA2D;YAC3D,MAAM,IAAIzB,kBAAkB,CAAC,CAAC,EAAES,OAAO,mBAAmB,CAAC,EAAEgB,WAAW;gBACtEhB;YACF;QACF;QACA,MAAMuB,aAAapB,OAAOqB,GAAG,CAACzB,iBAAiBC;QAC/C,OAAO;YACLA,QAAQqB;WACJE,CAAAA,8BAAAA,WAAYE,IAAI,MAChB;YACEpB,WAAW;gBACTZ,gBAAgBiB,mBAAmBd,UAAU2B;aAC9C;QACH,IACA,CAAC;IAET;AACF"}
@@ -1,4 +1,5 @@
1
1
  export * from './coerce-rsql.js';
2
+ export * from './facet-query-url.js';
2
3
  export * from './load-request-url.js';
3
4
  export * from './parse-rsql.js';
4
5
  export * from './rsql-operators.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rsql/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rsql/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export * from './coerce-rsql.js';
2
+ export * from './facet-query-url.js';
2
3
  export * from './load-request-url.js';
3
4
  export * from './parse-rsql.js';
4
5
  export * from './rsql-operators.js';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/rsql/index.ts"],"sourcesContent":["export * from './coerce-rsql.js';\nexport * from './load-request-url.js';\nexport * from './parse-rsql.js';\nexport * from './rsql-operators.js';\nexport * from './rsql-values.js';\nexport * from './serialize-rsql.js';\nexport * from './sort-param.js';\n"],"names":[],"mappings":"AAAA,cAAc,mBAAmB;AACjC,cAAc,wBAAwB;AACtC,cAAc,kBAAkB;AAChC,cAAc,sBAAsB;AACpC,cAAc,mBAAmB;AACjC,cAAc,sBAAsB;AACpC,cAAc,kBAAkB"}
1
+ {"version":3,"sources":["../../src/rsql/index.ts"],"sourcesContent":["export * from './coerce-rsql.js';\nexport * from './facet-query-url.js';\nexport * from './load-request-url.js';\nexport * from './parse-rsql.js';\nexport * from './rsql-operators.js';\nexport * from './rsql-values.js';\nexport * from './serialize-rsql.js';\nexport * from './sort-param.js';\n"],"names":[],"mappings":"AAAA,cAAc,mBAAmB;AACjC,cAAc,uBAAuB;AACrC,cAAc,wBAAwB;AACtC,cAAc,kBAAkB;AAChC,cAAc,sBAAsB;AACpC,cAAc,mBAAmB;AACjC,cAAc,sBAAsB;AACpC,cAAc,kBAAkB"}
@@ -0,0 +1,30 @@
1
+ import type { Entity } from './Entity.js';
2
+ import type { EntityFiltering } from './EntityFiltering.js';
3
+ /**
4
+ * One member to count the values of, under its own filtering.
5
+ *
6
+ * Each facet carries its own filtering rather than sharing one, because the
7
+ * counts a shop shows are usually **disjunctive**: a brand facet is counted
8
+ * under every filter except the brand choice itself, so choosing one brand
9
+ * does not drop every other brand to zero. Which filters a facet leaves out is
10
+ * the caller's to say — the counter counts what it is asked to.
11
+ */
12
+ export interface EntityFacetQuery<TEntity extends Entity = Entity> {
13
+ readonly member: keyof TEntity & string;
14
+ readonly filtering?: EntityFiltering<TEntity>[];
15
+ }
16
+ /** One value a member holds, and how many records hold it. */
17
+ export interface EntityFacetValue {
18
+ readonly value: string | number | boolean;
19
+ readonly count: number;
20
+ }
21
+ /**
22
+ * The values each queried member holds, keyed by the member as it was asked
23
+ * for. Every queried member is present; one no record holds is an empty list.
24
+ * A value held by no record is absent rather than counted `0`, since the
25
+ * counter cannot know which values the caller offers.
26
+ *
27
+ * Ordered by count, highest first, then by value.
28
+ */
29
+ export type EntityFacetCounts = Readonly<Record<string, readonly EntityFacetValue[]>>;
30
+ //# sourceMappingURL=EntityFacets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EntityFacets.d.ts","sourceRoot":"","sources":["../../src/types/EntityFacets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;;;;;;;GAQG;AACH,MAAM,WAAW,gBAAgB,CAAC,OAAO,SAAS,MAAM,GAAG,MAAM;IAC/D,QAAQ,CAAC,MAAM,EAAE,MAAM,OAAO,GAAG,MAAM,CAAC;IACxC,QAAQ,CAAC,SAAS,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC;CACjD;AAED,8DAA8D;AAC9D,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IAC1C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CACtC,MAAM,CAAC,MAAM,EAAE,SAAS,gBAAgB,EAAE,CAAC,CAC5C,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The values each queried member holds, keyed by the member as it was asked
3
+ * for. Every queried member is present; one no record holds is an empty list.
4
+ * A value held by no record is absent rather than counted `0`, since the
5
+ * counter cannot know which values the caller offers.
6
+ *
7
+ * Ordered by count, highest first, then by value.
8
+ */ export { };
9
+
10
+ //# sourceMappingURL=EntityFacets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/types/EntityFacets.ts"],"sourcesContent":["import type { Entity } from './Entity.js';\nimport type { EntityFiltering } from './EntityFiltering.js';\n\n/**\n * One member to count the values of, under its own filtering.\n *\n * Each facet carries its own filtering rather than sharing one, because the\n * counts a shop shows are usually **disjunctive**: a brand facet is counted\n * under every filter except the brand choice itself, so choosing one brand\n * does not drop every other brand to zero. Which filters a facet leaves out is\n * the caller's to say — the counter counts what it is asked to.\n */\nexport interface EntityFacetQuery<TEntity extends Entity = Entity> {\n readonly member: keyof TEntity & string;\n readonly filtering?: EntityFiltering<TEntity>[];\n}\n\n/** One value a member holds, and how many records hold it. */\nexport interface EntityFacetValue {\n readonly value: string | number | boolean;\n readonly count: number;\n}\n\n/**\n * The values each queried member holds, keyed by the member as it was asked\n * for. Every queried member is present; one no record holds is an empty list.\n * A value held by no record is absent rather than counted `0`, since the\n * counter cannot know which values the caller offers.\n *\n * Ordered by count, highest first, then by value.\n */\nexport type EntityFacetCounts = Readonly<\n Record<string, readonly EntityFacetValue[]>\n>;\n"],"names":[],"mappings":"AAuBA;;;;;;;CAOC,GACD,WAEE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@entifix/core",
3
- "version": "0.8.0",
3
+ "version": "0.10.0",
4
4
  "description": "The entity system: decorators that make a class describe itself, entity serialization, the RSQL query protocol and the wire envelopes.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -53,9 +53,9 @@
53
53
  "@swc/helpers": "0.5.23"
54
54
  },
55
55
  "peerDependencies": {
56
- "effect": "^4.0.5"
56
+ "effect": "^4.0.6"
57
57
  },
58
58
  "devDependencies": {
59
- "effect": "4.0.5"
59
+ "effect": "4.0.6"
60
60
  }
61
61
  }