@instruments/materialgraph 0.33.0 → 0.36.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 (92) hide show
  1. package/association-types.d.ts +11 -11
  2. package/associations-client.d.ts +7 -7
  3. package/associations-client.js +5 -5
  4. package/brand-types.d.ts +37 -41
  5. package/brand-types.js +3 -5
  6. package/brands-client.d.ts +22 -9
  7. package/brands-client.js +20 -6
  8. package/by-spec-types.d.ts +1 -1
  9. package/catalog-discovery-types.d.ts +3 -3
  10. package/catalogue-client.d.ts +2 -50
  11. package/catalogue-client.js +2 -10
  12. package/catalogue-types.d.ts +1 -1
  13. package/categories-client.d.ts +3 -5
  14. package/categories-client.js +1 -1
  15. package/category-types.d.ts +17 -30
  16. package/citation-types.d.ts +2 -2
  17. package/client-vocabulary.d.ts +2 -2
  18. package/client-vocabulary.js +4 -1
  19. package/client.d.ts +62 -105
  20. package/client.js +68 -106
  21. package/color-profiles-types.d.ts +70 -0
  22. package/colors-client.d.ts +76 -0
  23. package/colors-client.js +52 -0
  24. package/find-sampled-together-types.d.ts +70 -0
  25. package/{find-companions-types.js → find-sampled-together-types.js} +4 -4
  26. package/{find-variants-by-colour-types.d.ts → find-variants-by-color-types.d.ts} +70 -64
  27. package/find-variants-by-vector-types.d.ts +4 -1
  28. package/get-variant-types.d.ts +14 -2
  29. package/http-transport.d.ts +1 -1
  30. package/http-transport.js +1 -2
  31. package/identifiers.d.ts +2 -2
  32. package/identifiers.js +1 -1
  33. package/index.d.ts +5 -14
  34. package/index.js +1 -3
  35. package/list-variant-facets-types.d.ts +4 -4
  36. package/list-variants-types.d.ts +71 -21
  37. package/material-asset-types.d.ts +3 -3
  38. package/material-block-types.d.ts +9 -9
  39. package/material-types.d.ts +10 -8
  40. package/operations.d.ts +2 -2
  41. package/operations.js +19 -25
  42. package/package.json +2 -2
  43. package/{resolve-colour-types.d.ts → resolve-color-types.d.ts} +18 -18
  44. package/response-schemas.generated.d.ts +2 -2
  45. package/response-schemas.generated.js +41 -71
  46. package/response-schemas.js +1 -1
  47. package/samplize-catalogue-types.d.ts +4 -4
  48. package/samplize-colorvec.js +6 -6
  49. package/{corpus-scope-types.d.ts → search-catalogue-subset-types.d.ts} +3 -3
  50. package/search-variants-types.d.ts +33 -2
  51. package/types.d.ts +32 -284
  52. package/webmcp.generated.js +4 -9
  53. package/attribution-types.d.ts +0 -51
  54. package/attribution-types.js +0 -13
  55. package/by-colour-types.d.ts +0 -320
  56. package/colour-region-types.d.ts +0 -18
  57. package/colours-client.d.ts +0 -70
  58. package/colours-client.js +0 -38
  59. package/find-companions-types.d.ts +0 -70
  60. package/material-query-plan-types.d.ts +0 -70
  61. package/material-query-plan-types.js +0 -1
  62. package/ndjson.d.ts +0 -46
  63. package/ndjson.js +0 -111
  64. package/palette-search-types.d.ts +0 -171
  65. package/palette-search-types.js +0 -1
  66. package/query-understanding-types.d.ts +0 -254
  67. package/query-understanding-types.js +0 -1
  68. package/resolve-colour-types.js +0 -1
  69. package/search-card-types.d.ts +0 -86
  70. package/search-card-types.js +0 -1
  71. package/search-index-plan-types.d.ts +0 -74
  72. package/search-index-plan-types.js +0 -1
  73. package/search-refinement-types.d.ts +0 -103
  74. package/search-refinement-types.js +0 -2
  75. package/search-request-types.d.ts +0 -170
  76. package/search-request-types.js +0 -1
  77. package/search-response-receipt-types.d.ts +0 -24
  78. package/search-response-receipt-types.js +0 -1
  79. package/search-response-types.d.ts +0 -11
  80. package/search-response-types.js +0 -1
  81. package/search-result-validation.d.ts +0 -9
  82. package/search-result-validation.js +0 -83
  83. package/spec-types.d.ts +0 -109
  84. package/spec-types.js +0 -54
  85. package/specifications.d.ts +0 -34
  86. package/specifications.js +0 -56
  87. package/validation.d.ts +0 -43
  88. package/validation.js +0 -117
  89. /package/{by-colour-types.js → color-profiles-types.js} +0 -0
  90. /package/{colour-region-types.js → find-variants-by-color-types.js} +0 -0
  91. /package/{corpus-scope-types.js → resolve-color-types.js} +0 -0
  92. /package/{find-variants-by-colour-types.js → search-catalogue-subset-types.js} +0 -0
@@ -1,254 +0,0 @@
1
- import type { MatchTarget } from "@instruments/colorscope/match";
2
- import type { ColorResolution } from "@instruments/colorscope/naming";
3
- import type { SearchFilter } from "./search-refinement-types.js";
4
- import type { OpenEnum } from "./types.js";
5
- export type QuerySenseKind = OpenEnum<"brand" | "product" | "paint_identity" | "category" | "material" | "colour" | "attribute" | "attribute_value" | "certification">;
6
- export type QuerySense = {
7
- id: string;
8
- kind: QuerySenseKind;
9
- label: string;
10
- outcome: OpenEnum<"applied" | "ambiguous" | "recognized" | "refused">;
11
- effect: OpenEnum<"restrict" | "prioritize" | "rerank" | "offer" | "none">;
12
- confidence: number;
13
- evidence: {
14
- source: string;
15
- matchedText: string;
16
- span?: {
17
- start: number;
18
- end: number;
19
- };
20
- };
21
- entity?: {
22
- brandSlug?: string;
23
- productId?: string;
24
- variantId?: string;
25
- materialBankId?: string;
26
- productTypeId?: string;
27
- paintCode?: string;
28
- hex?: string;
29
- };
30
- reason?: string;
31
- };
32
- export type CanonicalLexicalAuthorityReceipt = {
33
- authority: OpenEnum<"taxonomy" | "colorscope">;
34
- version: string;
35
- revision: string;
36
- digest?: string;
37
- };
38
- export type CanonicalLexicalReading = {
39
- matchTarget?: MatchTarget;
40
- colorResolution?: ColorResolution;
41
- authority: OpenEnum<"taxonomy" | "colorscope">;
42
- identity: string;
43
- outcome: OpenEnum<"equivalent" | "ambiguous" | "declined">;
44
- executionStatus: OpenEnum<"applied" | "suppressed" | "executable" | "recognized-but-unexecutable" | "declined">;
45
- role: OpenEnum<"primary" | "secondary"> | null;
46
- kind?: OpenEnum<"domain" | "core-colour" | "paint">;
47
- label?: string;
48
- libraryId?: string;
49
- code?: string;
50
- aliasCount?: number;
51
- matchForm?: OpenEnum<"name" | "code" | "authoritative-term">;
52
- collisionCount?: number;
53
- familyId?: string;
54
- hex?: string;
55
- level?: OpenEnum<"family" | "tone-band" | "branch" | "concept">;
56
- lifecycle?: {
57
- introducedAt: string;
58
- reviewedAt?: string;
59
- status: string;
60
- };
61
- provenance?: {
62
- basis: string;
63
- snapshot?: string;
64
- source: string;
65
- };
66
- };
67
- export type CanonicalLexicalMatch = {
68
- original: string;
69
- canonical: string;
70
- rule: OpenEnum<"exact" | "plural-to-singular" | "typo-to-canonical">;
71
- span: {
72
- start: number;
73
- end: number;
74
- };
75
- coverage: number;
76
- readings: CanonicalLexicalReading[];
77
- receipt: {
78
- original: string;
79
- canonical: string;
80
- rule: OpenEnum<"exact" | "plural-to-singular" | "typo-to-canonical">;
81
- authorities: CanonicalLexicalAuthorityReceipt[];
82
- };
83
- };
84
- export type CanonicalLexicalReceipt = {
85
- original: string;
86
- outcome: OpenEnum<"resolved" | "ambiguous" | "declined" | "partial" | "unresolved">;
87
- matches: CanonicalLexicalMatch[];
88
- unresolved: CanonicalLexicalMatch[];
89
- };
90
- export type QueryResidualReceipt = {
91
- kind: OpenEnum<"compound" | "descriptive" | "ambiguous" | "empty">;
92
- tokens: string[];
93
- resolvedTokens: string[];
94
- unresolvedTokens: string[];
95
- resolvedRatio: number;
96
- comparisonFrame: boolean;
97
- };
98
- /** Deterministic criteria compiled from the query before retrieval. */
99
- export type QueryCriteriaReceipt = {
100
- applied: {
101
- criterion: SearchFilter;
102
- lane: OpenEnum<"filter" | "preference">;
103
- lexicalSignal?: {
104
- attributeId: string;
105
- canonical: string;
106
- identity: string;
107
- original: string;
108
- relation: OpenEnum<"equivalent" | "broader-storage-term">;
109
- span: {
110
- start: number;
111
- end: number;
112
- };
113
- storedTerm: string;
114
- };
115
- source: OpenEnum<"compiled" | "taxonomy-adapter">;
116
- span: string;
117
- }[];
118
- conflicts: {
119
- attributeId: string;
120
- caller: SearchFilter;
121
- compiled: SearchFilter;
122
- reason: string;
123
- }[];
124
- exclusions: {
125
- criterion: SearchFilter;
126
- execution: OpenEnum<"blocked-positive-only-contract">;
127
- lane: OpenEnum<"hard" | "soft">;
128
- missingValuePolicy: OpenEnum<"retain-unknown">;
129
- span: string;
130
- }[];
131
- preferences: SearchFilter[];
132
- residualText: string | null;
133
- unresolved: {
134
- code: OpenEnum<"missing-searchable-attribute" | "missing-dimension-pair-contract" | "missing-explicit-comparator" | "negative-criterion-contract-blocked" | "registry-contract-drift" | "unsupported-numeric-format" | "unsupported-unit" | "unsupported-strict-comparator">;
135
- reason: string;
136
- span: string;
137
- }[];
138
- };
139
- /** How the query named or inferred a product type before retrieval. */
140
- export type QueryProductTypeReceipt = {
141
- kind: OpenEnum<"leaf" | "group" | "vector" | "ambiguous" | "none">;
142
- gate: OpenEnum<"hard" | "constrain" | "none">;
143
- pass: OpenEnum<"taxonomy" | "synonym" | "display-name" | "group" | "head-noun" | "vector" | "none">;
144
- reason: string;
145
- displayName: string | null;
146
- productTypeId: string | null;
147
- groupKey: string | null;
148
- productTypeIds: string[];
149
- similarity: number | null;
150
- margin: number | null;
151
- residualText: string;
152
- vectorPassRan: boolean;
153
- registryVersion: string;
154
- durationMs: number;
155
- candidates: {
156
- productTypeId: string;
157
- displayName: string;
158
- similarity: number;
159
- }[];
160
- };
161
- /** The selected retrieval arm; null when the path is browse or criteria-only. */
162
- export type QueryArmReceipt = {
163
- arm: OpenEnum<"dense" | "lexical" | "colour"> | null;
164
- reason: string;
165
- reasonDetail?: OpenEnum<"derived-colour-veto" | "typo-recovery" | "literal-compound-without-type">;
166
- outcome: OpenEnum<"dense" | "lexical" | "colour" | "browse" | "criteria-only" | "ambiguous">;
167
- decidedBy: OpenEnum<"deterministic" | "model">;
168
- productTypeGate: OpenEnum<"hard" | "constrain" | "none">;
169
- productTypeIds: string[];
170
- residual: QueryResidualReceipt;
171
- registryVersion: string;
172
- };
173
- export type QueryAmbiguityReceipt = {
174
- outcome: OpenEnum<"applied" | "abstained" | "refused" | "timeout">;
175
- modelId: string | null;
176
- providerRan: boolean;
177
- durationMs: number;
178
- timeoutMs: number;
179
- validation: OpenEnum<"valid" | "invalid" | "not-run">;
180
- refusalCode: string | null;
181
- confidence: number | null;
182
- routing: OpenEnum<"compound" | "descriptive"> | null;
183
- productTypeIds: string[];
184
- changedArm: boolean;
185
- };
186
- export type QueryCategoryScopeReceipt = {
187
- source: OpenEnum<"caller" | "anchor">;
188
- mechanism: OpenEnum<"sql-predicate" | "provider-filter" | "allowlist" | "prune">;
189
- variantCount: number | null;
190
- ceiling: number;
191
- specScanBounded?: boolean;
192
- [key: string]: unknown;
193
- };
194
- export type QuerySpecAllowlistReceipt = {
195
- limit: number;
196
- returned: number;
197
- retrieved?: number;
198
- truncated: boolean;
199
- emptyMeansScarcity: boolean;
200
- outcome?: OpenEnum<"corpus-scarcity" | "retrieval-miss" | "unknown">;
201
- };
202
- /**
203
- * Whether the phrase-reading step turned the query's descriptive words into
204
- * filters and preferences. Present only on the workflow lane.
205
- */
206
- export type QueryPhraseReadingReceipt = {
207
- outcome: OpenEnum<"skipped">;
208
- reason: string;
209
- } | {
210
- outcome: OpenEnum<"read">;
211
- /** Which model read the phrase: `jev`, or `second` behind it. */
212
- reader: OpenEnum<"jev" | "second">;
213
- elapsedMs: number;
214
- leftAsText: string[];
215
- rows: {
216
- kind: OpenEnum<"want" | "avoid">;
217
- attributeId: string;
218
- values: string[];
219
- confidence: number;
220
- applied: boolean;
221
- }[];
222
- };
223
- export type QueryUnsatisfiableNarrowing = {
224
- narrowing: OpenEnum<"product-type">;
225
- gate: OpenEnum<"hard">;
226
- productTypeId: string;
227
- displayName: string;
228
- productTypeIds: string[];
229
- pass: string;
230
- evidence: OpenEnum<"zero-accepted-variants">;
231
- relaxedDisplayName?: string;
232
- relaxedProductTypeId?: string;
233
- relaxedProductTypeIds?: string[];
234
- relaxedTo: OpenEnum<"head-noun" | "none">;
235
- };
236
- /** Inspectable interpretation of the raw query by ordinary MaterialGraph search. */
237
- export type QueryUnderstanding = {
238
- version: OpenEnum<"1">;
239
- rawQuery: string;
240
- normalisedQuery: string;
241
- residualText: string;
242
- status: OpenEnum<"resolved" | "ambiguous" | "partial" | "unresolved">;
243
- mode: OpenEnum<"image" | "colour" | "text" | "lexical" | "entity-browse" | "attribute">;
244
- senses: QuerySense[];
245
- canonicalLexical?: CanonicalLexicalReceipt;
246
- criteria?: QueryCriteriaReceipt;
247
- productType?: QueryProductTypeReceipt;
248
- arm?: QueryArmReceipt;
249
- ambiguity?: QueryAmbiguityReceipt;
250
- categoryScope?: QueryCategoryScopeReceipt;
251
- specAllowlist?: QuerySpecAllowlistReceipt;
252
- unsatisfiableNarrowing?: QueryUnsatisfiableNarrowing;
253
- phraseReading?: QueryPhraseReadingReceipt;
254
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,86 +0,0 @@
1
- /**
2
- * @module sdk/search-card-types
3
- * @description The `view:"card"` search projection — the lean grid item and the
4
- * envelope that carries it.
5
- *
6
- * Split out of `types.ts` — which is over the repository's source-size limit —
7
- * along the same seam `match-types.ts` took: one view of one surface, and
8
- * nothing else. The full-view item and the shared envelope stay in `types.ts`,
9
- * which this module reads `SearchResponse` from.
10
- */
11
- import type { ProductId, VariantId } from "./identifiers.js";
12
- import type { OpenEnum, SearchData, SearchResponse } from "./types.js";
13
- /**
14
- * The lean `view:"card"` result item — identity + name + code + thumbnail +
15
- * score.
16
- *
17
- * A PROJECTION, not a smaller answer: a field the card omits (palette, verdict,
18
- * signals, availability) is unread here, never known-absent. Re-read the same
19
- * `variantId` at `view: "full"` or via `getVariant()` before claiming anything the
20
- * card does not carry.
21
- */
22
- export type SearchCardItem = {
23
- /** Accepted sampleability fact. Absent means unknown, never false. */
24
- sampleable?: boolean;
25
- /** Opaque — round-trip verbatim. */
26
- variantId: VariantId;
27
- productId: ProductId | null;
28
- brandSlug: string | null;
29
- brand: string;
30
- /** Product name (the full item's `product`). */
31
- name: string;
32
- variantName: string | null;
33
- imageUrl: string | null;
34
- /**
35
- * SHA-256 of the displayed image `imageUrl` points at, as a hex digest. Key a
36
- * cache or dedupe on it rather than the URL. ABSENT means no hash is on
37
- * record, never that there is no image.
38
- */
39
- imageSha256?: string;
40
- /**
41
- * How many eligible variants the row's product has, the same set
42
- * `listVariants` pages, so a follow-up list returns this many: the card's
43
- * "12 colourways". ABSENT means the product is unknown or has no eligible
44
- * variant.
45
- */
46
- variantCount?: number;
47
- /**
48
- * The manufacturer's own item code, the same key the full item carries.
49
- * Reach for it when two cards read alike: `name` is the PRODUCT name, and a
50
- * paint product is a whole collection, so brand, product name and variant
51
- * name together are shared by most of the catalogue. ABSENT means no code is
52
- * recorded, never that the variant cannot be ordered.
53
- */
54
- manufacturerCode?: string;
55
- projectSaveCapability?: "allowed";
56
- sourceStatus?: "provisional";
57
- score: number;
58
- /**
59
- * Resolved values for the attribute ids sent in `returnAttributes`, keyed by
60
- * attribute id. ABSENT entirely when `returnAttributes` was not sent.
61
- *
62
- * Three states, all different, and reading them as two is the mistake this
63
- * shape exists to prevent: no `attributes` key means you did not ask; a key
64
- * whose value is `null` means this material carries no accepted value for that
65
- * attribute; anything else is what the graph holds. Values resolve with the
66
- * normal variant-over-product precedence, and an array is a multi-valued
67
- * attribute rather than a list of candidates.
68
- */
69
- attributes?: Record<string, string | string[] | null>;
70
- };
71
- /** The `view:"card"` response form — the lean grid projection of {@link SearchResponse}. */
72
- export type SearchCardResponse = {
73
- data: Omit<SearchData, "view" | "results"> & {
74
- view: OpenEnum<"card">;
75
- results: SearchCardItem[];
76
- };
77
- } & Omit<SearchResponse, "data">;
78
- /**
79
- * The request forms the server answers with {@link SearchCardResponse}:
80
- * `view: "card"`, or `intent: "typeahead"`, which forces the card view.
81
- */
82
- export type CardProjectionRequest = {
83
- view: "card";
84
- } | {
85
- intent: "typeahead";
86
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,74 +0,0 @@
1
- /**
2
- * @module search-index-plan-types
3
- * @description The plan the one search ran on, as `/search` reports it under
4
- * `explain.plan` (ADR 0031). Mirrors `searchIndexPlanReceiptSchema` in
5
- * `@materialgraph/products/search-index/plan-schema`; `key-parity.test.ts`
6
- * holds the two to the same fields.
7
- */
8
- import type { ColourRegionRange } from "./colour-region-types.js";
9
- import type { CorpusScope } from "./corpus-scope-types.js";
10
- /** One attribute the plan wants: its terms, or any value when `presence`. */
11
- type SearchIndexPlanWant = {
12
- attributeId: string;
13
- /** Share of the category's materials stating the attribute, 0 to 1. */
14
- fill: number;
15
- /** The words it was read from, or `"(filter)"` for a caller's filter. */
16
- phrase: string;
17
- /** Any stated value satisfies it; `terms` is then empty. */
18
- presence?: true;
19
- /** A hard want removes rows; a soft one only counts toward the order. */
20
- strength: "hard" | "soft";
21
- terms: string[];
22
- };
23
- /**
24
- * The query's plan: the category, brands, wanted and excluded attribute terms,
25
- * the colour, the words left for text, and the caller's corpus scope.
26
- */
27
- export type SearchIndexPlan = {
28
- brands: {
29
- ids: string[];
30
- names: string[];
31
- phrase: string;
32
- } | null;
33
- category: {
34
- label: string;
35
- phrase: string;
36
- productTypeIds: string[];
37
- } | null;
38
- colour: {
39
- family12: string[];
40
- familyId: string;
41
- hex: string;
42
- oklab: [number, number, number];
43
- phrase: string;
44
- /** The colour's region, when the plan holds one rather than a point. */
45
- range?: ColourRegionRange;
46
- } | null;
47
- /** Present only when the caller sent a scope narrower than the whole graph. */
48
- corpusScope?: Exclude<CorpusScope, "all">;
49
- excludeBrands: string[];
50
- excludes: {
51
- attributeId: string;
52
- phrase: string;
53
- term: string;
54
- }[];
55
- /** Words the reading did not place, left for the text match. */
56
- leftover: string[];
57
- normalised: string;
58
- softAlone: boolean;
59
- vendorColourNames: string[];
60
- wants: SearchIndexPlanWant[];
61
- };
62
- /**
63
- * Which reading a search ran on (`version`, `source`), whether it came from
64
- * the cache, the plan itself, and its signature, so two runs of one request
65
- * can be compared plan for plan.
66
- */
67
- export type SearchPlanReceipt = {
68
- cached: boolean;
69
- plan: SearchIndexPlan;
70
- signature: string;
71
- source: "dictionary" | "jev";
72
- version: string;
73
- };
74
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,103 +0,0 @@
1
- /** The spec-filter vocabulary MaterialGraph's filter and preference inputs share. */
2
- /**
3
- * A hard canonical-attribute filter accepted by the search engine — a term match
4
- * (`{ attributeId, term }`), a presence check (`{ attributeId, hasValue: true }`)
5
- * or a NUMERIC RANGE (`{ attributeId, min, max }`, bounds inclusive, at least one
6
- * stated). Applied as a restriction BEFORE ranking.
7
- *
8
- * The `attributeId` may be a real registry id (`"fire_classifications"`,
9
- * `"environmental_product_declaration"`) OR the virtual
10
- * `"certification_programme"` (see `CERTIFICATION_PROGRAMME_ATTRIBUTE_ID`),
11
- * which matches a programme — GREENGUARD, FloorScore, LEED, an EPD — wherever it
12
- * landed across the four certification buckets. Presence (`hasValue`) is NOT
13
- * supported for the virtual programme attribute. The typed `spec-types` mirror
14
- * and the `specifications` builders produce values assignable to this type.
15
- */
16
- /**
17
- * Optional per-filter TRUST bar the matching value must clear.
18
- *
19
- * Raising the bar shrinks the result set for a reason worth stating: the
20
- * materials it removes are not materials that fail the spec, they are materials
21
- * whose claim is weaker than you demanded. That distinction is the whole point
22
- * of this object — without it, "no GREENGUARD results" reads as "nobody is
23
- * certified" when it means "nobody is certified TO THIS EVIDENTIAL STANDARD".
24
- */
25
- export type SearchFilterTrust = {
26
- /** Confidence floor, 0–1. A value below it is excluded, not marked failed. */
27
- minConfidence?: number;
28
- /**
29
- * Demand an EXACT source basis (closed enum — an unknown basis is rejected).
30
- * Strongest to weakest as evidence:
31
- * - `declared` — the manufacturer stated it. Attributable, not independent.
32
- * - `catalog_feed` — it arrived in a catalog feed. Trusted at ingest, unreviewed.
33
- * - `derived` — MaterialGraph inferred it. Ours, not the manufacturer's — never
34
- * present a `derived` value as something the brand claims.
35
- *
36
- * There is NO `tested` basis. This docblock advertised one as "the strongest
37
- * claim available" through 0.12.0, and the union listed `declared` twice in
38
- * its place — so a caller reading the documentation would write a value the
39
- * server rejects with a 400, and the type would not stop them because the
40
- * fourth arm was a duplicate rather than the value described.
41
- * `packages/schema/src/source-basis.test.ts` asserts `tested` parses false;
42
- * its absence is deliberate, not an omission.
43
- */
44
- sourceBasis?: "catalog_feed" | "declared" | "derived";
45
- /** Fold the attribute's own registry confidence requirement in, server-side. */
46
- meetsRequirement?: true;
47
- };
48
- /**
49
- * One HARD criterion. Applied as a restriction BEFORE ranking, so a filtered
50
- * search's empty result means "nothing on record satisfies this", never "nothing
51
- * exists" — the corpus's silence and the world's are different things. Use
52
- * `preferences` instead when a miss should demote rather than remove.
53
- */
54
- export type SearchFilter = {
55
- attributeId: string;
56
- term: string;
57
- trust?: SearchFilterTrust;
58
- } | {
59
- attributeId: string;
60
- excludesTerm: string;
61
- trust?: SearchFilterTrust;
62
- /**
63
- * What an UNKNOWN effective value does. Absent or `"drop"` (default)
64
- * requires a known effective value — a variant that never states the
65
- * attribute does not pass. `"pass"` admits it — a variant only fails by
66
- * STATING the excluded term.
67
- */
68
- whenUnstated?: "drop" | "pass";
69
- }
70
- /**
71
- * TERM SET — the attribute must equal any ONE of these. OR within the entry;
72
- * AND still holds between entries, so a filter rail composes the same way
73
- * whatever it is filtering on.
74
- *
75
- * The server has accepted this since the term-set arm shipped, and a consumer
76
- * has been sending it successfully on the wire — but it was missing from this
77
- * union through 0.12.0, so multi-value filtering type-checked nowhere while
78
- * working everywhere. Brand multi-select is the common case:
79
- * `{attributeId: "brand", terms: ["kvadrat", "interface"]}`.
80
- */
81
- | {
82
- attributeId: string;
83
- terms: string[];
84
- trust?: SearchFilterTrust;
85
- } | {
86
- attributeId: string;
87
- hasValue: true;
88
- trust?: SearchFilterTrust;
89
- }
90
- /** Date-sensitive presence is currently executable only for EPD expiration. */
91
- | {
92
- attributeId: "epd_expiration_date";
93
- hasValue: true;
94
- asOf: string;
95
- trust?: SearchFilterTrust;
96
- } | {
97
- attributeId: string;
98
- /** Inclusive lower bound. Omit for a ceiling-only range. */
99
- min?: number;
100
- /** Inclusive upper bound. Omit for a floor-only range. */
101
- max?: number;
102
- trust?: SearchFilterTrust;
103
- };
@@ -1,2 +0,0 @@
1
- /** The spec-filter vocabulary MaterialGraph's filter and preference inputs share. */
2
- export {};