@lde/search 0.34.0 → 0.35.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.
package/dist/adapter.d.ts CHANGED
@@ -6,8 +6,8 @@
6
6
  * deployment author declaring a schema and running searches needs none of
7
7
  * this; the main entry point carries that (small) authoring surface.
8
8
  */
9
- export { assertTypeInSchema, physicalFields, irAlias, displayFieldName, displayFieldPattern, displayLangOf, searchableFields, facetableFields, filterableFields, sortableFields, outputFields, isInternalField, isInlineReference, nestedReferenceType, nestedFieldName, localLookupTargetsOf, referencedTargetsOf, storedTargetOf, TARGET_FIELD, identityFieldOf, identityFieldName, inheritedFacetPolicies, referenceFields, referenceTypeNamed, rootTypeNamed, inlineFramingDepth, fieldNamed, datasetField, ID_FIELD, AND_KEY, OR_KEY, labelFieldOf, labelFieldNameOf, labelSourceNamesOf, labelTargetNamesOf, documentKeyOf, DEFAULT_LABEL_FIELD, isRangeFacet, isBinnedRangeFacet, isAbsoluteIri, isoToUnixSeconds, unixSecondsToIso, } from './schema.js';
10
- export type { PhysicalFields } from './schema.js';
9
+ export { assertTypeInSchema, physicalFields, irAlias, displayFieldName, displayFieldPattern, displayLangOf, searchableFields, facetableFields, filterableFields, sortableFields, outputFields, isInternalField, isInlineReference, nestedReferenceType, nestedFieldName, localLookupTargetsOf, referencedTargetsOf, storedTargetOf, TARGET_FIELD, identityFieldOf, identityFieldName, inheritedFacetPolicies, referenceFields, referenceTypeNamed, rootTypeNamed, inlineFramingDepth, fieldNamed, datasetField, ID_FIELD, AND_KEY, OR_KEY, labelFieldOf, labelFieldNameOf, labelSourceNamesOf, labelTargetNamesOf, documentKeyOf, DEFAULT_LABEL_FIELD, isRangeFacet, isBinnedRangeFacet, isAbsoluteIri, isoToUnixSeconds, unixSecondsToIso, isDatePrecision, } from './schema.js';
10
+ export type { PhysicalFields, DatePrecision, StoredDate } from './schema.js';
11
11
  export { missingRequiredFields } from './project.js';
12
12
  export { physicalNameTokens } from './physical-name.js';
13
13
  export { matchLanguage } from './language.js';
@@ -1 +1 @@
1
- {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,OAAO,EACP,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,MAAM,EACN,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC5D,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,WAAW,EACX,cAAc,EACd,UAAU,EACV,YAAY,EACZ,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,OAAO,EACP,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,MAAM,EACN,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,GAChB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC5D,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,WAAW,EACX,cAAc,EACd,UAAU,EACV,YAAY,EACZ,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC"}
package/dist/adapter.js CHANGED
@@ -6,7 +6,7 @@
6
6
  * deployment author declaring a schema and running searches needs none of
7
7
  * this; the main entry point carries that (small) authoring surface.
8
8
  */
9
- export { assertTypeInSchema, physicalFields, irAlias, displayFieldName, displayFieldPattern, displayLangOf, searchableFields, facetableFields, filterableFields, sortableFields, outputFields, isInternalField, isInlineReference, nestedReferenceType, nestedFieldName, localLookupTargetsOf, referencedTargetsOf, storedTargetOf, TARGET_FIELD, identityFieldOf, identityFieldName, inheritedFacetPolicies, referenceFields, referenceTypeNamed, rootTypeNamed, inlineFramingDepth, fieldNamed, datasetField, ID_FIELD, AND_KEY, OR_KEY, labelFieldOf, labelFieldNameOf, labelSourceNamesOf, labelTargetNamesOf, documentKeyOf, DEFAULT_LABEL_FIELD, isRangeFacet, isBinnedRangeFacet, isAbsoluteIri, isoToUnixSeconds, unixSecondsToIso, } from './schema.js';
9
+ export { assertTypeInSchema, physicalFields, irAlias, displayFieldName, displayFieldPattern, displayLangOf, searchableFields, facetableFields, filterableFields, sortableFields, outputFields, isInternalField, isInlineReference, nestedReferenceType, nestedFieldName, localLookupTargetsOf, referencedTargetsOf, storedTargetOf, TARGET_FIELD, identityFieldOf, identityFieldName, inheritedFacetPolicies, referenceFields, referenceTypeNamed, rootTypeNamed, inlineFramingDepth, fieldNamed, datasetField, ID_FIELD, AND_KEY, OR_KEY, labelFieldOf, labelFieldNameOf, labelSourceNamesOf, labelTargetNamesOf, documentKeyOf, DEFAULT_LABEL_FIELD, isRangeFacet, isBinnedRangeFacet, isAbsoluteIri, isoToUnixSeconds, unixSecondsToIso, isDatePrecision, } from './schema.js';
10
10
  export { missingRequiredFields } from './project.js';
11
11
  export { physicalNameTokens } from './physical-name.js';
12
12
  export { matchLanguage } from './language.js';
package/dist/engine.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { SearchQuery } from './query.js';
2
- import type { RootType, RootTypeOf, SearchSchema, SearchType } from './schema.js';
2
+ import type { RootType, RootTypeOf, SearchSchema, SearchType, StoredDate } from './schema.js';
3
3
  /**
4
4
  * The engine port: the boundary a concrete engine adapter (e.g. the engine
5
5
  * `@lde/search-typesense`’s `createTypesenseSearchEngine` returns) implements.
@@ -157,8 +157,14 @@ export interface SearchHit<OutputField extends string = string> {
157
157
  * deployment narrows it via {@link OutputFieldsOf} for typo-safe field access.
158
158
  */
159
159
  export type ResultDocument<OutputField extends string = string> = Readonly<Partial<Record<OutputField, SearchValue>>>;
160
- /** A logical field value. */
161
- export type SearchValue = string | number | boolean | readonly string[] | LocalizedValue | Reference | readonly Reference[] | NestedDocument | readonly NestedDocument[];
160
+ /**
161
+ * A logical field value. A `date` is a {@link StoredDate} – stored terms like
162
+ * every other value at this seam: the Unix seconds the index sorts and filters
163
+ * on, plus the precision its source gave, which a surface needs to serve it in
164
+ * that precision’s canonical form. An index built before precision was stored
165
+ * reports `dateTime`, the one form the seconds alone can always be read as.
166
+ */
167
+ export type SearchValue = string | number | StoredDate | boolean | readonly string[] | LocalizedValue | Reference | readonly Reference[] | NestedDocument | readonly NestedDocument[];
162
168
  /**
163
169
  * A **nested Search Document**: the referent of a surfaced (`output`) inline
164
170
  * reference, carrying its Reference Type’s own output fields – each referent’s
@@ -1 +1 @@
1
- {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EACV,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,UAAU,EACX,MAAM,aAAa,CAAC;AAErB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,MAAM,WAAW,YAAY,CAC3B,KAAK,SAAS,SAAS,UAAU,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,CAAC,CAC1C,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GACnB,MAAM,GACN,MAAM,GACN,UAAU,GACV,OAAO,GACP,SAAS,MAAM,EAAE,GACjB,cAAc,GACd,SAAS,GACT,SAAS,SAAS,EAAE,GACpB,cAAc,GACd,SAAS,cAAc,EAAE,CAAC;AAE9B;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAAC;IAClD;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,CAAC,oBAAoB,CAAC,CAAC,EAAE,MAAM,CAAC;CAC1C;AAED;oCACoC;AACpC,eAAO,MAAM,oBAAoB,EAAE,OAAO,MAEzC,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,CAAC;AAEzE;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC;CACjC;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC;IAChC;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC;CACvB"}
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { projectRoots } from './project.js';
2
2
  export type { ProjectedNode, ProjectionContext, SearchDocument, } from './project.js';
3
- export { defineSearchType, searchSchema, validateSearchType, assertValidSearchType, ID_FIELD, AND_KEY, OR_KEY, isoToUnixSeconds, unixSecondsToIso, } from './schema.js';
4
- export type { FieldKind, SearchField, SearchFieldBase, TextField, KeywordField, ReferenceField, ReferenceStrategy, NumericField, BooleanField, SearchType, SearchTypeBase, RootType, ReferenceType, RootTypeOf, SearchTypeIssue, KeyField, FacetKeys, SearchSchema, FacetRange, ProjectionValue, } from './schema.js';
3
+ export { defineSearchType, searchSchema, validateSearchType, assertValidSearchType, ID_FIELD, AND_KEY, OR_KEY, isoToUnixSeconds, unixSecondsToIso, isDatePrecision, } from './schema.js';
4
+ export type { FieldKind, SearchField, SearchFieldBase, TextField, KeywordField, ReferenceField, ReferenceStrategy, NumericField, BooleanField, SearchType, SearchTypeBase, RootType, ReferenceType, RootTypeOf, SearchTypeIssue, KeyField, FacetKeys, SearchSchema, FacetRange, ProjectionValue, DatePrecision, StoredDate, } from './schema.js';
5
5
  export { joinGraph, MAX_JOIN_DEPTH } from './join-graph.js';
6
6
  export type { JoinGraph } from './join-graph.js';
7
7
  export { filterOn } from './query.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,YAAY,EACV,aAAa,EACb,iBAAiB,EACjB,cAAc,GACf,MAAM,cAAc,CAAC;AAKtB,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,kBAAkB,EAClB,qBAAqB,EACrB,QAAQ,EACR,OAAO,EACP,MAAM,EAMN,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,SAAS,EACT,WAAW,EACX,eAAe,EACf,SAAS,EACT,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,cAAc,EACd,QAAQ,EACR,aAAa,EACb,UAAU,EACV,eAAe,EACf,QAAQ,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ACb,UAAU,EACV,eAAe,EACf,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,UAAU,EACV,eAAe,EACf,aAAa,EACb,UAAU,GACX,MAAM,aAAa,CAAC;AAKrB,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC5D,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAOjD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EACV,WAAW,EACX,mBAAmB,EACnB,MAAM,EACN,SAAS,EACT,aAAa,EACb,eAAe,EACf,IAAI,GACL,MAAM,YAAY,CAAC;AAIpB,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,YAAY,EACV,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,cAAc,EACd,WAAW,EACX,cAAc,EACd,SAAS,EACT,cAAc,EACd,KAAK,EACL,WAAW,EACX,WAAW,EACX,QAAQ,EACR,aAAa,EACb,aAAa,EACb,cAAc,GACf,MAAM,aAAa,CAAC;AAErB,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAKrD,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
package/dist/index.js CHANGED
@@ -16,7 +16,7 @@ export { defineSearchType, searchSchema, validateSearchType, assertValidSearchTy
16
16
  // projection, or a derive that computes seconds from something other than an
17
17
  // ISO string – so it belongs on the authoring surface, not only the adapter
18
18
  // one.
19
- isoToUnixSeconds, unixSecondsToIso, } from './schema.js';
19
+ isoToUnixSeconds, unixSecondsToIso, isDatePrecision, } from './schema.js';
20
20
  // The declared join edges between root types: which types a query can filter
21
21
  // across, and which collections must be rebuilt together. Built eagerly by
22
22
  // `searchSchema`, so declaring a schema is what validates the joins.
@@ -1 +1 @@
1
- {"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAA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searchType, schema, context, nested)
266
266
  // this is the busiest way a non-IRI could otherwise reach the index. A
267
267
  // value that survives nothing leaves the field absent, exactly as a derive
268
268
  // returning `undefined` does.
269
+ if (field.kind === 'date') {
270
+ return applyDerivedDate(document, field, derived);
271
+ }
269
272
  const value = field.kind === 'reference' && derived !== undefined
270
273
  ? derivedIris(derived)
271
- : // A derived `date` goes through the same storage codec as a read one:
272
- // the field is stored as Unix seconds, so an ISO string returned here
273
- // would otherwise land as a string in an int64 field.
274
- field.kind === 'date' && typeof derived === 'string'
275
- ? isoToUnixSeconds(derived)
276
- : // A derive that computed seconds itself returns a number, which the
277
- // codec never saw and so never range-checked. Seconds outside the
278
- // int64 a `date` field is stored in would be refused by the
279
- // engine, where an unparseable string merely leaves the field
280
- // absent. Drop it too.
281
- field.kind === 'date' && typeof derived === 'number'
282
- ? storableUnixSeconds(derived)
283
- : derived;
274
+ : derived;
284
275
  // NaN is not a value any kind stores, and a derive is the only route that
285
276
  // can produce one (`setNumber` guards the read route). It serializes as
286
277
  // `null`, which an engine rejects for a numeric field – so drop it, leaving
@@ -344,7 +335,7 @@ function applyField(document, node, field, searchType, schema, context, nested)
344
335
  return setNumber(document, field.name, toNumber(firstLiteralOf(node, alias)));
345
336
  case 'date': {
346
337
  const literal = firstLiteralOf(node, alias);
347
- return setNumber(document, field.name, literal === undefined ? undefined : isoToUnixSeconds(literal));
338
+ return setDate(document, field, literal === undefined ? undefined : isoToUnixSeconds(literal));
348
339
  }
349
340
  case 'boolean': {
350
341
  // The xsd:boolean lexical space: true/false/1/0.
@@ -1015,6 +1006,37 @@ function toInteger(literal) {
1015
1006
  function toNumber(literal) {
1016
1007
  return literal === undefined ? undefined : Number(literal);
1017
1008
  }
1009
+ /**
1010
+ * A derived `date` goes through the same storage codec as a read one: the field
1011
+ * is stored as Unix seconds, so an ISO string returned here would otherwise
1012
+ * land as a string in an int64 field – and it is parsed like any literal, its
1013
+ * precision included. A derive that computed seconds itself returns a number,
1014
+ * which states no precision and so is stored as a date-time; the codec never
1015
+ * saw it and so never range-checked it, and seconds outside the int64 a `date`
1016
+ * field is stored in would be refused by the engine where an unparseable
1017
+ * string merely leaves the field absent – so drop those too.
1018
+ */
1019
+ function applyDerivedDate(document, field, derived) {
1020
+ if (typeof derived === 'string') {
1021
+ return setDate(document, field, isoToUnixSeconds(derived));
1022
+ }
1023
+ if (typeof derived === 'number') {
1024
+ // Truncated, as the codec truncates a string’s fractional seconds: the
1025
+ // field is an int64. `storableUnixSeconds` drops NaN.
1026
+ const seconds = storableUnixSeconds(Math.trunc(derived));
1027
+ return setDate(document, field, seconds === undefined ? undefined : { seconds, precision: 'dateTime' });
1028
+ }
1029
+ }
1030
+ /** Store a `date` field’s seconds, and its precision in the companion beside
1031
+ * them ({@link physicalFields}), so the surface can serve the value in the
1032
+ * form its source gave. */
1033
+ function setDate(document, field, stored) {
1034
+ if (stored === undefined) {
1035
+ return;
1036
+ }
1037
+ document[field.name] = stored.seconds;
1038
+ document[physicalFields(field).precision] = stored.precision;
1039
+ }
1018
1040
  function setNumber(document, field, value) {
1019
1041
  if (value !== undefined && !Number.isNaN(value)) {
1020
1042
  document[field] = value;
package/dist/schema.d.ts CHANGED
@@ -780,7 +780,9 @@ export declare const TARGET_FIELD = "_target";
780
780
  * - field names are unique (a duplicate would silently shadow in every
781
781
  * consumer, each picking a different winner) and a metacharacter-free
782
782
  * identifier (the name is interpolated into physical field names and the
783
- * display RE2 pattern), and is not the reserved {@link ID_FIELD};
783
+ * display RE2 pattern), and is not the reserved {@link ID_FIELD}, nor the
784
+ * precision companion a `date` field stores beside itself
785
+ * ({@link PhysicalFields.precision});
784
786
  * - a `text` field’s declared locales are BCP-47-shaped (no `_`, which is the
785
787
  * reserved name↔locale separator);
786
788
  * - a `reference` field that is `output` declares `ref` (the API surfaces
@@ -863,6 +865,16 @@ export interface PhysicalFields {
863
865
  * name at the surface; only the physical fanout knows there are two.
864
866
  */
865
867
  readonly identity: string | undefined;
868
+ /**
869
+ * The **precision companion** of a `date` field: `${name}_precision`,
870
+ * holding the {@link DatePrecision} its source gave beside the Unix seconds
871
+ * the field itself stores. Stored, never indexed: sorting and filtering read
872
+ * the seconds alone, and only output reads this, to serve the value in the
873
+ * canonical form of its precision ({@link unixSecondsToIso}). Not part of the
874
+ * field model, so it never reaches a client’s schema. `undefined` for every
875
+ * other kind.
876
+ */
877
+ readonly precision: string | undefined;
866
878
  }
867
879
  /** The physical name of an inline reference’s
868
880
  * {@link ReferenceStrategy.identity identity companion}. */
@@ -1078,25 +1090,61 @@ export declare function isBinnedRangeFacet(field: SearchField): field is Numeric
1078
1090
  * someone forgot to percent-encode.
1079
1091
  */
1080
1092
  export declare function isAbsoluteIri(value: string): boolean;
1093
+ /**
1094
+ * How finely a `date` value’s source stated it: a year (`xsd:gYear`), a month
1095
+ * (`xsd:gYearMonth`), a day (`xsd:date`) or a point in time (`xsd:dateTime`).
1096
+ * Stored beside the Unix seconds ({@link PhysicalFields.precision}), because
1097
+ * the seconds alone cannot tell a year from the first second of it.
1098
+ */
1099
+ export type DatePrecision = 'year' | 'month' | 'day' | 'dateTime';
1100
+ /** A `date` value as it is stored: Unix seconds, and the precision its source
1101
+ * gave ({@link isoToUnixSeconds}). */
1102
+ export interface StoredDate {
1103
+ readonly seconds: number;
1104
+ readonly precision: DatePrecision;
1105
+ }
1106
+ /** Whether a stored value is a {@link DatePrecision} – what an adapter checks
1107
+ * before trusting the precision companion it reads back. */
1108
+ export declare function isDatePrecision(value: unknown): value is DatePrecision;
1081
1109
  /**
1082
1110
  * The engine storage codec for `date` fields: stored as Unix seconds (a
1083
- * sortable, range-filterable int64), ISO 8601 at the API edges. One pair for
1084
- * the projection (writes), the query compiler (filter bounds) and the surface
1085
- * (output), so the three cannot disagree. Returns `undefined` for an
1086
- * unparseable value.
1111
+ * sortable, range-filterable int64) plus the precision the source gave, ISO
1112
+ * 8601 at the API edges. One pair for the projection (writes), the query
1113
+ * compiler and `validateQuery` (filter bounds) and the surface (output), so
1114
+ * they cannot disagree. Returns `undefined` for an unparseable value.
1115
+ *
1116
+ * - A **year, month or day** names a calendar period, so its timezone is
1117
+ * ignored and it is stored at that period’s first second in UTC.
1118
+ * - A **date-time** is normalised to UTC; one without a timezone is read as
1119
+ * UTC, so what the index holds never depends on the host that built it.
1120
+ * Fractional seconds are truncated.
1121
+ * - A year beyond what `Date` can represent (±271,821 years around 1970) is
1122
+ * **deep time**, and deep time has no months or days: there the value is
1123
+ * read as an `xsd:gYear` – a bare year, such as a Carboniferous fossil’s
1124
+ * `-318000000` – and stored as that many average Gregorian years from 1970.
1125
+ * Anything finer at that depth is unparseable.
1087
1126
  *
1088
- * A year beyond what `Date` can represent (±271,821 years around 1970) is
1089
- * deep time, and deep time has no months or days: there the value is read as
1090
- * an `xsd:gYear` – a bare year, such as a Carboniferous fossil’s `-318000000` –
1091
- * and stored as that many average Gregorian years from 1970. Anything finer at
1092
- * that depth is unparseable.
1127
+ * A year may carry a sign and any number of digits, so the expanded form
1128
+ * `Date` itself emits (`+025000`, `-001100`) reads the same as `25000` and
1129
+ * `-1100`.
1093
1130
  */
1094
- export declare function isoToUnixSeconds(iso: string): number | undefined;
1131
+ export declare function isoToUnixSeconds(iso: string): StoredDate | undefined;
1095
1132
  /**
1096
- * The inverse of {@link isoToUnixSeconds}: stored Unix seconds → ISO 8601, or
1097
- * an `xsd:gYear` for seconds beyond what `Date` can represent.
1133
+ * The inverse of {@link isoToUnixSeconds}: stored Unix seconds → the canonical
1134
+ * ISO 8601 form of `precision`, so a client parses one shape per precision
1135
+ * whatever lexical variant the source used:
1136
+ *
1137
+ * | Precision | Canonical form |
1138
+ * | ---------- | -------------------------------------- |
1139
+ * | `year` | `1999`, `-0044`, `-250000` |
1140
+ * | `month` | `1999-05` |
1141
+ * | `day` | `1999-05-03` |
1142
+ * | `dateTime` | `1999-05-03T12:30:00Z` (always UTC) |
1143
+ *
1144
+ * A year has at least four digits and no `+`. Seconds beyond what `Date` can
1145
+ * represent are deep time, served as an `xsd:gYear` whatever `precision` says.
1098
1146
  */
1099
- export declare function unixSecondsToIso(seconds: number): string;
1147
+ export declare function unixSecondsToIso(seconds: number, precision: DatePrecision): string;
1100
1148
  /** `seconds` if a `date` field can store it – the int64 the engine keeps
1101
1149
  * Unix seconds in – or `undefined`, the same answer {@link isoToUnixSeconds}
1102
1150
  * gives a string it cannot parse. */
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGrE;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,GACnB,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,WAAW,CAAC;AAE/E;oEACoE;AACpE,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,OAAO,GAAG,IAAI,CAAC;AAcnD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,SAAS,GAAG,cAAc,GAAG,SAAS,CAE7E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,MAAM,WAAW,GACrB,SAAS,GAAG,YAAY,GAAG,cAAc,GAAG,YAAY,GAAG,YAAY,CAAC;AAE1E,qEAAqE;AACrE,MAAM,WAAW,eAAe;IAC9B;wCACoC;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B;+EAC2E;IAC3E,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;mEAK+D;IAC/D,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB;;yCAEqC;IACrC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,gEAAgE;IAChE,QAAQ,CAAC,MAAM,CA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SAAS,EAAE,aAAa,CAAC;CACnC;AAED;6DAC6D;AAC7D,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAOtE;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CA6CpE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,aAAa,GACvB,MAAM,CAyBR;AAED;;sCAEsC;AACtC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEvE;AAsGD;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,WAAW,EAClB,MAAM,CAAC,EAAE,YAAY,GACpB,cAAc,CAwChB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,YAAY,GAAG,SAAS,GAC/B,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,CAiBhC"}
package/dist/schema.js CHANGED
@@ -861,7 +861,9 @@ const LOCALE_PATTERN = /^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$/;
861
861
  * - field names are unique (a duplicate would silently shadow in every
862
862
  * consumer, each picking a different winner) and a metacharacter-free
863
863
  * identifier (the name is interpolated into physical field names and the
864
- * display RE2 pattern), and is not the reserved {@link ID_FIELD};
864
+ * display RE2 pattern), and is not the reserved {@link ID_FIELD}, nor the
865
+ * precision companion a `date` field stores beside itself
866
+ * ({@link PhysicalFields.precision});
865
867
  * - a `text` field’s declared locales are BCP-47-shaped (no `_`, which is the
866
868
  * reserved name↔locale separator);
867
869
  * - a `reference` field that is `output` declares `ref` (the API surfaces
@@ -908,6 +910,11 @@ export function validateSearchType(searchType) {
908
910
  const issues = [];
909
911
  const seen = new Set();
910
912
  const seenProjectionValues = new Set();
913
+ // A `date` field stores its precision under `${name}_precision`, so a
914
+ // declared field of that name would overwrite it, and be overwritten.
915
+ const precisionCompanions = new Set(searchType.fields
916
+ .filter((field) => field.kind === 'date')
917
+ .map((field) => physicalFields(field).precision));
911
918
  for (const declared of searchType.fields) {
912
919
  // Validation guards declarations built OUTSIDE TypeScript (a SHACL
913
920
  // generator, plain JS), so it inspects the uniform flat shape rather
@@ -927,7 +934,8 @@ export function validateSearchType(searchType) {
927
934
  // `and`/`or` are the `where` combinators; a declared field of any of those
928
935
  // names would shadow it in the API output or in `where`, silently
929
936
  // answering a different question.
930
- if (RESERVED_FIELD_NAMES.includes(field.name)) {
937
+ if (RESERVED_FIELD_NAMES.includes(field.name) ||
938
+ precisionCompanions.has(field.name)) {
931
939
  issue('reserved-field-name');
932
940
  }
933
941
  // Every kind-dependent rule below would silently pass for a kind outside
@@ -1486,43 +1494,106 @@ export function isAbsoluteIri(value) {
1486
1494
  * run of non-whitespace. Non-ASCII is deliberately allowed: an IRI is not
1487
1495
  * restricted to ASCII. */
1488
1496
  const ABSOLUTE_IRI = /^[A-Za-z][A-Za-z0-9+.-]*:\S*$/;
1497
+ /** Whether a stored value is a {@link DatePrecision} – what an adapter checks
1498
+ * before trusting the precision companion it reads back. */
1499
+ export function isDatePrecision(value) {
1500
+ return (value === 'year' ||
1501
+ value === 'month' ||
1502
+ value === 'day' ||
1503
+ value === 'dateTime');
1504
+ }
1489
1505
  /**
1490
1506
  * The engine storage codec for `date` fields: stored as Unix seconds (a
1491
- * sortable, range-filterable int64), ISO 8601 at the API edges. One pair for
1492
- * the projection (writes), the query compiler (filter bounds) and the surface
1493
- * (output), so the three cannot disagree. Returns `undefined` for an
1494
- * unparseable value.
1507
+ * sortable, range-filterable int64) plus the precision the source gave, ISO
1508
+ * 8601 at the API edges. One pair for the projection (writes), the query
1509
+ * compiler and `validateQuery` (filter bounds) and the surface (output), so
1510
+ * they cannot disagree. Returns `undefined` for an unparseable value.
1511
+ *
1512
+ * - A **year, month or day** names a calendar period, so its timezone is
1513
+ * ignored and it is stored at that period’s first second in UTC.
1514
+ * - A **date-time** is normalised to UTC; one without a timezone is read as
1515
+ * UTC, so what the index holds never depends on the host that built it.
1516
+ * Fractional seconds are truncated.
1517
+ * - A year beyond what `Date` can represent (±271,821 years around 1970) is
1518
+ * **deep time**, and deep time has no months or days: there the value is
1519
+ * read as an `xsd:gYear` – a bare year, such as a Carboniferous fossil’s
1520
+ * `-318000000` – and stored as that many average Gregorian years from 1970.
1521
+ * Anything finer at that depth is unparseable.
1495
1522
  *
1496
- * A year beyond what `Date` can represent (±271,821 years around 1970) is
1497
- * deep time, and deep time has no months or days: there the value is read as
1498
- * an `xsd:gYear` – a bare year, such as a Carboniferous fossil’s `-318000000` –
1499
- * and stored as that many average Gregorian years from 1970. Anything finer at
1500
- * that depth is unparseable.
1523
+ * A year may carry a sign and any number of digits, so the expanded form
1524
+ * `Date` itself emits (`+025000`, `-001100`) reads the same as `25000` and
1525
+ * `-1100`.
1501
1526
  */
1502
1527
  export function isoToUnixSeconds(iso) {
1503
1528
  // Trim first: XSD collapses whitespace around a date literal before parsing,
1504
- // so a padded lexical form is legal and reaches here verbatim. Left in place
1505
- // it defeats the year expansion below in both directions – a leading space
1506
- // stops the match, a trailing one survives it into the legacy parser – and
1507
- // each lands the value in a different year than it reads.
1529
+ // so a padded lexical form is legal and reaches here verbatim.
1508
1530
  const trimmed = iso.trim();
1509
- const millis = new Date(expandYear(trimmed)).getTime();
1510
- return Number.isNaN(millis)
1511
- ? deepTimeSeconds(trimmed)
1512
- : Math.trunc(millis / 1000);
1531
+ const calendar = CALENDAR_DATE.exec(trimmed);
1532
+ if (calendar !== null) {
1533
+ const [, year, month, day] = calendar;
1534
+ const precision = day !== undefined ? 'day' : month !== undefined ? 'month' : 'year';
1535
+ const millis = utcMillis(Number(year), Number(month ?? 1), Number(day ?? 1));
1536
+ if (millis === 'invalid') {
1537
+ return undefined;
1538
+ }
1539
+ if (millis === 'out of range') {
1540
+ // Only a year takes the deep-time route: deep time has no months or days.
1541
+ return precision === 'year' ? deepTimeDate(Number(year)) : undefined;
1542
+ }
1543
+ return { seconds: millis / 1000, precision };
1544
+ }
1545
+ const dateTime = DATE_TIME.exec(trimmed);
1546
+ if (dateTime === null) {
1547
+ return undefined;
1548
+ }
1549
+ const [, year, month, day, hour, minute, second, offset] = dateTime;
1550
+ const millis = utcMillis(Number(year), Number(month), Number(day), Number(hour), Number(minute), Number(second ?? 0));
1551
+ if (typeof millis !== 'number') {
1552
+ return undefined;
1553
+ }
1554
+ const seconds = millis / 1000 - offsetSeconds(offset);
1555
+ // The offset can carry a date-time at `Date`’s edge out of its range, where
1556
+ // the surface could no longer give it back as one.
1557
+ return Number.isNaN(new Date(seconds * 1000).getTime())
1558
+ ? undefined
1559
+ : { seconds, precision: 'dateTime' };
1513
1560
  }
1514
1561
  /**
1515
- * The inverse of {@link isoToUnixSeconds}: stored Unix seconds → ISO 8601, or
1516
- * an `xsd:gYear` for seconds beyond what `Date` can represent.
1562
+ * The inverse of {@link isoToUnixSeconds}: stored Unix seconds → the canonical
1563
+ * ISO 8601 form of `precision`, so a client parses one shape per precision
1564
+ * whatever lexical variant the source used:
1565
+ *
1566
+ * | Precision | Canonical form |
1567
+ * | ---------- | -------------------------------------- |
1568
+ * | `year` | `1999`, `-0044`, `-250000` |
1569
+ * | `month` | `1999-05` |
1570
+ * | `day` | `1999-05-03` |
1571
+ * | `dateTime` | `1999-05-03T12:30:00Z` (always UTC) |
1572
+ *
1573
+ * A year has at least four digits and no `+`. Seconds beyond what `Date` can
1574
+ * represent are deep time, served as an `xsd:gYear` whatever `precision` says.
1517
1575
  */
1518
- export function unixSecondsToIso(seconds) {
1576
+ export function unixSecondsToIso(seconds, precision) {
1519
1577
  if (!Number.isFinite(seconds)) {
1520
1578
  throw new RangeError(`Not a number of Unix seconds: ${seconds}`);
1521
1579
  }
1522
- const date = new Date(seconds * 1000);
1523
- return Number.isNaN(date.getTime())
1524
- ? String(Math.round(seconds / GREGORIAN_YEAR_SECONDS) + 1970)
1525
- : date.toISOString();
1580
+ const date = new Date(Math.trunc(seconds) * 1000);
1581
+ if (Number.isNaN(date.getTime())) {
1582
+ return String(Math.round(seconds / GREGORIAN_YEAR_SECONDS) + 1970);
1583
+ }
1584
+ const year = formatYear(date.getUTCFullYear());
1585
+ const month = twoDigits(date.getUTCMonth() + 1);
1586
+ const day = twoDigits(date.getUTCDate());
1587
+ switch (precision) {
1588
+ case 'year':
1589
+ return year;
1590
+ case 'month':
1591
+ return `${year}-${month}`;
1592
+ case 'day':
1593
+ return `${year}-${month}-${day}`;
1594
+ case 'dateTime':
1595
+ return `${year}-${month}-${day}T${twoDigits(date.getUTCHours())}:${twoDigits(date.getUTCMinutes())}:${twoDigits(date.getUTCSeconds())}Z`;
1596
+ }
1526
1597
  }
1527
1598
  /** `seconds` if a `date` field can store it – the int64 the engine keeps
1528
1599
  * Unix seconds in – or `undefined`, the same answer {@link isoToUnixSeconds}
@@ -1530,42 +1601,82 @@ export function unixSecondsToIso(seconds) {
1530
1601
  export function storableUnixSeconds(seconds) {
1531
1602
  return Math.abs(seconds) < 2 ** 63 ? seconds : undefined;
1532
1603
  }
1604
+ /** A timezone: `Z` or a `±hh:mm` offset no further from UTC than XSD allows
1605
+ * (±14:00), so an impossible one such as `+99:99` leaves the value
1606
+ * unparseable rather than shifting it by days. */
1607
+ const TIMEZONE = '(Z|[+-](?:(?:0\\d|1[0-3]):[0-5]\\d|14:00))?';
1608
+ /** A year, month or day (`xsd:gYear`, `xsd:gYearMonth`, `xsd:date`), with an
1609
+ * optional timezone the codec ignores. The year is signed and of any length,
1610
+ * so deep time and the expanded `±YYYYYY` form `Date` emits both read as the
1611
+ * year they spell. Deep time is real data, not a corner case: SCHEMA-AP-NDE
1612
+ * blesses years beyond four digits for `schema:dateCreated`. */
1613
+ const CALENDAR_DATE = new RegExp(`^([+-]?\\d+)(?:-(\\d{2})(?:-(\\d{2}))?)?${TIMEZONE}$`);
1614
+ /** An `xsd:dateTime`, its seconds optional and fraction ignored. */
1615
+ const DATE_TIME = new RegExp(`^([+-]?\\d+)-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2})(?::(\\d{2})(?:\\.\\d+)?)?${TIMEZONE}$`);
1533
1616
  /**
1534
- * Pad a year outside the plain four-digit form to the signed six digits ISO
1535
- * 8601 expects, so `Date` reads it as a year at all. Deep time is real data,
1536
- * not a corner case: SCHEMA-AP-NDE blesses years beyond four digits for
1537
- * `schema:dateCreated`. Left unexpanded, neither era parses as written and
1538
- * neither fails loudly – `-1100` is read as a bare UTC offset and lands
1539
- * around 1100 **CE** (shifted by the host’s offset), `25000` is read as a
1540
- * legacy local-time date and lands a year early, on a boundary that moves
1541
- * with the host’s timezone. Either way nothing throws, no field is left
1542
- * absent, and the value sorts and filters as if it were another date
1543
- * entirely. A plain four-digit year and an already-expanded one pass through
1544
- * unchanged, so the form the API itself emits round-trips.
1617
+ * Milliseconds since the epoch of a UTC calendar moment, read without `Date`’s
1618
+ * string parser – which reads an untimezoned date-time in the host’s local
1619
+ * time and a short or long year as something else entirely. `'invalid'` for a
1620
+ * moment the calendar does not have (month 13, 30 February, 25:00), and
1621
+ * `'out of range'` for a valid one beyond what `Date` can represent.
1622
+ * `24:00:00` is the end of the day, which XSD allows: the next day’s midnight.
1545
1623
  */
1546
- function expandYear(iso) {
1547
- // The year, then the rest: a non-digit stops the run, so a longer digit
1548
- // string (epoch millis, say) is left alone rather than cut into a year.
1549
- const year = /^([+-]?)(\d{1,6})(\D.*|)$/.exec(iso);
1550
- if (year === null || (year[1] === '' && year[2].length === 4)) {
1551
- return iso;
1624
+ function utcMillis(year, month, day, hour = 0, minute = 0, second = 0) {
1625
+ if (month < 1 ||
1626
+ month > 12 ||
1627
+ day < 1 ||
1628
+ day > daysInMonth(year, month) ||
1629
+ hour > 24 ||
1630
+ minute > 59 ||
1631
+ second > 59 ||
1632
+ (hour === 24 && (minute !== 0 || second !== 0))) {
1633
+ return 'invalid';
1634
+ }
1635
+ const date = new Date(0);
1636
+ // `setUTCFullYear` rather than `Date.UTC`, which maps years 0–99 to 1900–1999.
1637
+ date.setUTCFullYear(year, month - 1, day);
1638
+ date.setUTCHours(hour, minute, second, 0);
1639
+ const millis = date.getTime();
1640
+ return Number.isNaN(millis) ? 'out of range' : millis;
1641
+ }
1642
+ /** Days in a month of the proleptic Gregorian calendar, for any year. */
1643
+ function daysInMonth(year, month) {
1644
+ if (month === 2) {
1645
+ const leap = (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
1646
+ return leap ? 29 : 28;
1552
1647
  }
1553
- return `${year[1] || '+'}${year[2].padStart(6, '0')}${year[3]}`;
1648
+ return [4, 6, 9, 11].includes(month) ? 30 : 31;
1649
+ }
1650
+ /** Seconds east of UTC a timezone states; `0` for `Z` or none, which is what
1651
+ * makes an untimezoned date-time read as UTC. */
1652
+ function offsetSeconds(timezone) {
1653
+ if (timezone === undefined || timezone === 'Z') {
1654
+ return 0;
1655
+ }
1656
+ const sign = timezone.startsWith('-') ? -1 : 1;
1657
+ const [hours, minutes] = timezone.slice(1).split(':').map(Number);
1658
+ return sign * (hours * 3600 + minutes * 60);
1659
+ }
1660
+ /** A year in its canonical form: at least four digits, signed only when
1661
+ * negative (`1999`, `0800`, `-0044`, `-250000`). */
1662
+ function formatYear(year) {
1663
+ const digits = String(Math.abs(year)).padStart(4, '0');
1664
+ return year < 0 ? `-${digits}` : digits;
1665
+ }
1666
+ function twoDigits(value) {
1667
+ return String(value).padStart(2, '0');
1554
1668
  }
1555
1669
  /** The average Gregorian year: 146 097 days per 400 years. */
1556
1670
  const GREGORIAN_YEAR_SECONDS = (146_097 * 86_400) / 400;
1557
- /** Unix seconds of a deep-time `xsd:gYear` – a bare year `Date` could not
1558
- * hold, its timezone ignored as meaningless at that scale – or `undefined`
1559
- * for anything else. An average year is at most two
1671
+ /** The stored form of a deep-time `xsd:gYear` – a year `Date` could not hold –
1672
+ * or `undefined` beyond the int64 of seconds. An average year is at most two
1560
1673
  * days off the calendar’s 1 January, far less than the year between
1561
1674
  * neighbours, so deep time still sorts before (or after) the dates `Date`
1562
1675
  * holds; and it lands beyond `Date`’s range, so {@link unixSecondsToIso}
1563
1676
  * gives the year back. */
1564
- function deepTimeSeconds(iso) {
1565
- const year = /^(-?[1-9]\d*)(?:Z|[+-]\d{2}:\d{2})?$/.exec(iso);
1566
- return year === null
1567
- ? undefined
1568
- : storableUnixSeconds((Number(year[1]) - 1970) * GREGORIAN_YEAR_SECONDS);
1677
+ function deepTimeDate(year) {
1678
+ const seconds = storableUnixSeconds((year - 1970) * GREGORIAN_YEAR_SECONDS);
1679
+ return seconds === undefined ? undefined : { seconds, precision: 'year' };
1569
1680
  }
1570
1681
  /**
1571
1682
  * Derive the **indexed** physical engine field names a declaration produces:
@@ -1593,6 +1704,7 @@ export function physicalFields(field, schema) {
1593
1704
  // Text is never facetable (`validateSearchType`).
1594
1705
  facet: undefined,
1595
1706
  identity: undefined,
1707
+ precision: undefined,
1596
1708
  };
1597
1709
  }
1598
1710
  // A field storing a nested OBJECT cannot be filtered or faceted as itself, so
@@ -1615,6 +1727,7 @@ export function physicalFields(field, schema) {
1615
1727
  ? filtered
1616
1728
  : `${filtered}_facet`,
1617
1729
  identity,
1730
+ precision: field.kind === 'date' ? `${field.name}_precision` : undefined,
1618
1731
  };
1619
1732
  }
1620
1733
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lde/search",
3
- "version": "0.34.0",
3
+ "version": "0.35.0",
4
4
  "description": "Engine- and domain-agnostic core for RDF-backed search: a unified declarative field model (SearchField/SearchType/SearchSchema), a neutral query IR, the SearchEngine port with logical result types, and a streaming CONSTRUCT-to-document projection. Bakes in no engine, protocol, or domain.",
5
5
  "repository": {
6
6
  "url": "git+https://github.com/ldelements/lde.git",