@instruments/materialgraph 0.25.0 → 0.27.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/association-types.d.ts +38 -27
- package/associations-client.d.ts +4 -4
- package/associations-client.js +3 -10
- package/attribution-types.d.ts +4 -4
- package/brand-types.d.ts +14 -6
- package/brands-client.d.ts +7 -38
- package/brands-client.js +10 -40
- package/by-colour-types.d.ts +58 -31
- package/by-spec-types.d.ts +6 -73
- package/by-spec-types.js +7 -5
- package/catalog-discovery-types.d.ts +11 -26
- package/catalogue-client.d.ts +16 -35
- package/catalogue-client.js +32 -67
- package/catalogue-types.d.ts +44 -4
- package/categories-client.d.ts +63 -0
- package/categories-client.js +48 -0
- package/category-types.d.ts +114 -0
- package/citation-types.d.ts +4 -4
- package/client-config.d.ts +4 -6
- package/client-config.js +2 -4
- package/client-source-material-comments.d.ts +4 -4
- package/client-source-material-comments.js +4 -38
- package/client-vocabulary.d.ts +7 -9
- package/client-vocabulary.js +22 -30
- package/client.d.ts +110 -244
- package/client.js +217 -387
- package/codes-client.d.ts +2 -2
- package/codes-client.js +8 -8
- package/codes-types.d.ts +55 -34
- package/colour-aggregate-types.d.ts +24 -24
- package/colours-client.d.ts +6 -11
- package/colours-client.js +11 -19
- package/coordinate-client.d.ts +2 -2
- package/coordinate-client.js +1 -13
- package/corpus-scope-types.d.ts +3 -3
- package/corpus-scope-types.js +1 -25
- package/demand-batch-types.d.ts +18 -18
- package/demand-types.d.ts +24 -24
- package/errors.d.ts +13 -13
- package/errors.js +54 -52
- package/http-transport.d.ts +13 -21
- package/http-transport.js +31 -28
- package/identify-types.d.ts +54 -44
- package/identify-types.js +5 -3
- package/index.d.ts +11 -27
- package/index.js +4 -6
- package/list-variant-facets-types.d.ts +60 -0
- package/list-variants-types.d.ts +142 -0
- package/list-variants-types.js +12 -0
- package/match-stream-types.d.ts +45 -32
- package/match-stream-types.js +2 -0
- package/match-stream.d.ts +2 -2
- package/match-stream.js +67 -49
- package/match-types.d.ts +32 -8
- package/material-asset-types.d.ts +89 -69
- package/material-block-types.d.ts +8 -6
- package/material-composition-client.d.ts +21 -0
- package/material-composition-client.js +13 -0
- package/material-composition-types.d.ts +403 -0
- package/material-query-plan-types.d.ts +61 -145
- package/material-resources-client.d.ts +12 -10
- package/material-resources-client.js +27 -22
- package/material-types.d.ts +16 -24
- package/ndjson.js +16 -8
- package/operations.d.ts +6 -6
- package/operations.js +29 -156
- package/package.json +5 -1
- package/palette-search-types.d.ts +87 -52
- package/query-understanding-types.d.ts +65 -40
- package/resolve-client.d.ts +8 -12
- package/resolve-client.js +9 -13
- package/resolve-colour-types.d.ts +8 -8
- package/resolve-types.d.ts +10 -10
- package/response-schemas.d.ts +20 -0
- package/response-schemas.generated.d.ts +5 -0
- package/response-schemas.generated.js +160 -0
- package/response-schemas.js +113 -0
- package/run-types.d.ts +64 -145
- package/runs.d.ts +9 -58
- package/runs.js +60 -149
- package/samplize-catalogue-types.d.ts +18 -18
- package/samplize-colorvec.d.ts +20 -20
- package/samplize-colorvec.js +66 -42
- package/schema-resource-types.d.ts +52 -39
- package/schema-resource-types.js +5 -5
- package/search-card-types.d.ts +26 -4
- package/search-index-plan-types.d.ts +70 -0
- package/search-refinement-types.d.ts +10 -40
- package/search-refinement-types.js +1 -0
- package/search-request-types.d.ts +121 -204
- package/search-response-receipt-types.d.ts +13 -253
- package/search-response-types.d.ts +2 -2
- package/search-result-validation.d.ts +3 -19
- package/search-result-validation.js +42 -183
- package/source-material-validation.d.ts +3 -3
- package/source-material-validation.js +35 -39
- package/spec-facet-types.d.ts +11 -16
- package/spec-types.d.ts +23 -16
- package/spec-types.js +8 -7
- package/specifications.d.ts +14 -72
- package/specifications.js +39 -89
- package/sse.d.ts +2 -2
- package/sse.js +32 -16
- package/substitute-types.d.ts +22 -22
- package/suggest-types.d.ts +11 -17
- package/suggest-types.js +3 -3
- package/taxonomy-coverage-types.d.ts +8 -8
- package/types.d.ts +202 -405
- package/validation.d.ts +26 -26
- package/validation.js +97 -92
- package/webmcp.d.ts +3 -3
- package/webmcp.generated.js +10 -93
- package/brand-most-sampled-types.d.ts +0 -33
- package/browse-types.d.ts +0 -236
- package/client-browse.d.ts +0 -78
- package/client-browse.js +0 -72
- package/client-exploration.d.ts +0 -9
- package/client-exploration.js +0 -7
- package/compare-types.d.ts +0 -89
- package/composition-client.d.ts +0 -33
- package/composition-client.js +0 -27
- package/composition-types.d.ts +0 -455
- package/composition-types.js +0 -10
- package/correction-types.d.ts +0 -88
- package/exploration-types.d.ts +0 -118
- package/exploration-types.js +0 -1
- package/fan-deck-types.d.ts +0 -42
- package/fan-deck-types.js +0 -9
- package/match-rejection-types.d.ts +0 -43
- package/match-rejection-types.js +0 -7
- package/palette-completion-types.d.ts +0 -115
- package/palette-completion-types.js +0 -1
- package/project-types.d.ts +0 -79
- package/project-types.js +0 -9
- package/projects.d.ts +0 -13
- package/projects.js +0 -46
- package/render-assets-types.d.ts +0 -65
- package/render-assets-types.js +0 -1
- package/run-events.d.ts +0 -106
- package/run-events.js +0 -32
- package/schedule-reference-types.d.ts +0 -46
- package/schedule-reference-types.js +0 -1
- package/schedule-references-client.d.ts +0 -14
- package/schedule-references-client.js +0 -26
- package/schedule-types.d.ts +0 -261
- package/schedule-types.js +0 -1
- package/search-collapse-types.d.ts +0 -69
- package/search-collapse-types.js +0 -1
- package/search-mood-types.d.ts +0 -6
- package/search-mood-types.js +0 -1
- package/search-window-types.d.ts +0 -25
- package/search-window-types.js +0 -1
- package/slot-pool-types.d.ts +0 -372
- package/slot-pool-types.js +0 -1
- /package/{brand-most-sampled-types.js → category-types.js} +0 -0
- /package/{browse-types.js → list-variant-facets-types.js} +0 -0
- /package/{compare-types.js → material-composition-types.js} +0 -0
- /package/{correction-types.js → search-index-plan-types.js} +0 -0
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { resolveOperation } from "./operations.js";
|
|
2
|
-
/** Schedule-owned preferences, independent of an issued document's revision. */
|
|
3
|
-
export class ScheduleReferencesClient {
|
|
4
|
-
#transport;
|
|
5
|
-
constructor(transport) {
|
|
6
|
-
this.#transport = transport;
|
|
7
|
-
}
|
|
8
|
-
/** Read the latest saved preference for each reference. Empty means no decisions yet. */
|
|
9
|
-
list(scheduleId, signal) {
|
|
10
|
-
return this.#transport.requestJson(resolveOperation("list_schedule_reference_feedback"), {
|
|
11
|
-
pathParams: { scheduleId },
|
|
12
|
-
signal,
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Save or reverse a preference. An exact request replay returns its original receipt;
|
|
17
|
-
* it does not undo newer decisions. A stale reference version raises a 409.
|
|
18
|
-
*/
|
|
19
|
-
put(scheduleId, referenceId, input, signal) {
|
|
20
|
-
return this.#transport.requestJson(resolveOperation("put_schedule_reference_feedback"), {
|
|
21
|
-
pathParams: { scheduleId, referenceId },
|
|
22
|
-
body: input,
|
|
23
|
-
signal,
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
}
|
package/schedule-types.d.ts
DELETED
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
import type { VerdictCitation } from "./citation-types.js";
|
|
2
|
-
/**
|
|
3
|
-
* Finish-schedule wire types (MG-616) — the hand-mirror of
|
|
4
|
-
* `@materialgraph/products/schemes/finish-schedule`. Kept in their own module
|
|
5
|
-
* rather than `types.ts`, which sits at its source-size baseline.
|
|
6
|
-
*
|
|
7
|
-
* A finish schedule is a completed compose scheme rendered as ONE ROW PER SLOT:
|
|
8
|
-
* the shape a specifier issues. The contract that makes it trustworthy is that
|
|
9
|
-
* every row carries the IDENTICAL, fixed column set, and every attribute cell
|
|
10
|
-
* states its own verification alongside its value. An unknown is an explicit
|
|
11
|
-
* `missing` cell with a null value — never a blank that reads as complete.
|
|
12
|
-
*
|
|
13
|
-
* ABSENT IS NOT FALSE, enforced structurally: because the column set is fixed,
|
|
14
|
-
* "we do not know" has to be SAID rather than omitted. Read
|
|
15
|
-
* {@link FinishScheduleCell.state} before printing `value`.
|
|
16
|
-
*
|
|
17
|
-
* MG-1351 added the schedule's organising principle: every row carries an
|
|
18
|
-
* {@link FinishScheduleRow.code} L-code under a numbered section, rows arrive in
|
|
19
|
-
* READING order, slots with nothing specified are served as
|
|
20
|
-
* {@link FinishSchedule.openSlots}, and a row may carry or-equal
|
|
21
|
-
* {@link FinishScheduleAlternate}s. Read `alternates` with
|
|
22
|
-
* {@link FinishSchedule.alternatesResolved}: an empty list means either "we did
|
|
23
|
-
* not ask" or "there is none", and those are different claims.
|
|
24
|
-
*/
|
|
25
|
-
import type { RunId, SchemeId, SlotId, VariantId } from "./identifiers.js";
|
|
26
|
-
/** One schedule column: the attribute and its header text. */
|
|
27
|
-
export interface FinishScheduleColumn {
|
|
28
|
-
attributeId: string;
|
|
29
|
-
/** The registry presentation label. */
|
|
30
|
-
label: string;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* The six verification states a schedule cell can report, mirroring the shared
|
|
34
|
-
* verdict contract. On this public surface a `proposed` (pending-review) value
|
|
35
|
-
* is projected to `missing`, so it can never be told apart from a value that
|
|
36
|
-
* never existed.
|
|
37
|
-
*/
|
|
38
|
-
export type FinishScheduleCellState = "matched" | "deviated" | "failed" | "unverified" | "missing" | "not_evaluated";
|
|
39
|
-
/**
|
|
40
|
-
* One attribute cell of one row: the value AND how far it can be trusted.
|
|
41
|
-
*
|
|
42
|
-
* Columns the Run's criteria evaluated carry the real verdict state. Columns
|
|
43
|
-
* backfilled from the catalogue (nothing in the brief asked about them) only
|
|
44
|
-
* ever read `matched` or `missing`: they assert presence-with-trust, not that
|
|
45
|
-
* the brief was met.
|
|
46
|
-
*/
|
|
47
|
-
export interface FinishScheduleCell {
|
|
48
|
-
attributeId: string;
|
|
49
|
-
label: string;
|
|
50
|
-
/** The display value, or null when unknown. */
|
|
51
|
-
value: string | null;
|
|
52
|
-
state: FinishScheduleCellState;
|
|
53
|
-
confidence: number | null;
|
|
54
|
-
sourceBasis: string | null;
|
|
55
|
-
/** Omitted when the exact current claim has no supporting source. */
|
|
56
|
-
citation?: VerdictCitation;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* The rolled-up grade for one row, from its EVALUATED criterion cells only.
|
|
60
|
-
* `meets_all` is all-green on the required cells; `close` means something
|
|
61
|
-
* deviated, went unverified or was missing — never round it up to a pass;
|
|
62
|
-
* `hard_no` means a required cell failed on a real value.
|
|
63
|
-
*/
|
|
64
|
-
export type FinishScheduleGrade = "meets_all" | "close" | "hard_no";
|
|
65
|
-
/** Exact retained brief passage behind a schedule criterion. */
|
|
66
|
-
export interface FinishScheduleCriterionSourceRef {
|
|
67
|
-
sourceId: string;
|
|
68
|
-
quote: string;
|
|
69
|
-
textRange: {
|
|
70
|
-
start: number;
|
|
71
|
-
end: number;
|
|
72
|
-
unit: "utf16";
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
/** Brief criterion carried into the issued row, including explicit exclusions. */
|
|
76
|
-
export type FinishScheduleCriterion = {
|
|
77
|
-
kind: "attribute" | "attribute-presence" | "attribute-exclusion" | "attribute-numeric" | "unresolved";
|
|
78
|
-
raw: string;
|
|
79
|
-
attributeId?: string;
|
|
80
|
-
term?: string;
|
|
81
|
-
comparator?: "at-least" | "at-most";
|
|
82
|
-
value?: number;
|
|
83
|
-
unit?: string;
|
|
84
|
-
polarity?: "exclusion";
|
|
85
|
-
coverageNote?: string;
|
|
86
|
-
suggestion?: {
|
|
87
|
-
attributeId: string;
|
|
88
|
-
term?: string;
|
|
89
|
-
};
|
|
90
|
-
sourceRefs?: FinishScheduleCriterionSourceRef[];
|
|
91
|
-
};
|
|
92
|
-
/** One numbered section of the schedule, and the heading it prints. */
|
|
93
|
-
export interface FinishScheduleSection {
|
|
94
|
-
/** The hundreds block, e.g. `100`. Also the base of every line number in it. */
|
|
95
|
-
code: number;
|
|
96
|
-
name: string;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* What MaterialGraph claims about an alternate — and never more than it can
|
|
100
|
-
* support. None of the three means "interchangeable": accepting an alternate is
|
|
101
|
-
* a specification decision, and this API does not make it.
|
|
102
|
-
*
|
|
103
|
-
* `or_equal` matched the specified material's equivalence signature with every
|
|
104
|
-
* supporting value above its confidence floor. `or_equal_unverified` matched the
|
|
105
|
-
* same signature on values that did not clear it. `successor` is the brand's own
|
|
106
|
-
* declared replacement, from a reviewed relationship rather than a spec match —
|
|
107
|
-
* its verdict cells are `not_evaluated` by construction.
|
|
108
|
-
*/
|
|
109
|
-
export type FinishScheduleAlternateStance = "or_equal" | "or_equal_unverified" | "successor";
|
|
110
|
-
/** One criterion of the equivalence signature an alternate was matched on. */
|
|
111
|
-
export interface FinishScheduleAlternateCriterion {
|
|
112
|
-
role: "primary_material" | "performance";
|
|
113
|
-
attributeId: string;
|
|
114
|
-
term: string;
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Why an alternate is on the row. Every field is evidence, not adjective — a
|
|
118
|
-
* substitute presented without its basis looks like a decision when it is a
|
|
119
|
-
* lookup, so this is never absent from an alternate.
|
|
120
|
-
*/
|
|
121
|
-
export interface FinishScheduleAlternateBasis {
|
|
122
|
-
/** The SPECIFIED variant this alternate was graded against. Opaque. */
|
|
123
|
-
specifiedVariantId: VariantId;
|
|
124
|
-
/** The product-type form the signature was projected in; null for a successor. */
|
|
125
|
-
form: string | null;
|
|
126
|
-
/** The criteria that matched. Empty for a successor: nothing was matched. */
|
|
127
|
-
signature: FinishScheduleAlternateCriterion[];
|
|
128
|
-
/** The seed-relative report card, projected exactly as row cells are. */
|
|
129
|
-
verdict: {
|
|
130
|
-
cells: FinishScheduleCell[];
|
|
131
|
-
grade: FinishScheduleGrade;
|
|
132
|
-
minConfidence: number | null;
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
/** One or-equal line sitting beneath the specified line it answers. */
|
|
136
|
-
export interface FinishScheduleAlternate {
|
|
137
|
-
stance: FinishScheduleAlternateStance;
|
|
138
|
-
/** Opaque — round-trip verbatim into the material lenses. */
|
|
139
|
-
variantId: VariantId;
|
|
140
|
-
brand: string;
|
|
141
|
-
product: string;
|
|
142
|
-
variant: string;
|
|
143
|
-
/**
|
|
144
|
-
* The colourway, when the catalogue names one. Carried separately because a
|
|
145
|
-
* substitute's `variant` is frequently the product name repeated, and a line
|
|
146
|
-
* that cannot name the colour has not named a material.
|
|
147
|
-
*/
|
|
148
|
-
colour: string | null;
|
|
149
|
-
imageUrl: string | null;
|
|
150
|
-
hex: string | null;
|
|
151
|
-
recordUrl: string;
|
|
152
|
-
/**
|
|
153
|
-
* Further colourways of this same product that also cleared the signature and
|
|
154
|
-
* were collapsed into this line. A COUNTED collapse: `0` means this product
|
|
155
|
-
* offered exactly one match, never that the count is unknown.
|
|
156
|
-
*/
|
|
157
|
-
otherColourways: number;
|
|
158
|
-
basis: FinishScheduleAlternateBasis;
|
|
159
|
-
}
|
|
160
|
-
/** A slot holding a code with nothing specified against it yet. */
|
|
161
|
-
export interface FinishScheduleOpenSlot {
|
|
162
|
-
code: string;
|
|
163
|
-
sectionCode: number;
|
|
164
|
-
sectionName: string;
|
|
165
|
-
line: number;
|
|
166
|
-
slotId: SlotId;
|
|
167
|
-
slotName: string;
|
|
168
|
-
space: string | null;
|
|
169
|
-
/**
|
|
170
|
-
* Why this line is blank, in words — or `null` when nothing measured a reason.
|
|
171
|
-
*
|
|
172
|
-
* `null` is NOT "nothing was found". It means no diagnosis was recorded for
|
|
173
|
-
* this slot, most often because it was never searched, and it must not be
|
|
174
|
-
* rendered as a search that came back empty.
|
|
175
|
-
*/
|
|
176
|
-
reason: string | null;
|
|
177
|
-
}
|
|
178
|
-
/** One row: one slot, one specified material, fully graded. */
|
|
179
|
-
export interface FinishScheduleRow {
|
|
180
|
-
/** Criteria carried from the programme; absent on older schedule artifacts. */
|
|
181
|
-
criteria?: FinishScheduleCriterion[];
|
|
182
|
-
requiredCriteria?: FinishScheduleCriterion[];
|
|
183
|
-
preferredCriteria?: FinishScheduleCriterion[];
|
|
184
|
-
/**
|
|
185
|
-
* The printed line reference, e.g. `L-101` — how a drawing, an RFI or a
|
|
186
|
-
* substitution request names this line. Allocated from the Run's PROGRAMME
|
|
187
|
-
* rather than its picks, so recomposing the scheme, varying it, or accepting a
|
|
188
|
-
* substitution renumbers nothing.
|
|
189
|
-
*/
|
|
190
|
-
code: string;
|
|
191
|
-
/** The hundreds block this line sits in, e.g. `100`. */
|
|
192
|
-
sectionCode: number;
|
|
193
|
-
sectionName: string;
|
|
194
|
-
/** The 1-based line within its (space, section) group. */
|
|
195
|
-
line: number;
|
|
196
|
-
slotId: SlotId;
|
|
197
|
-
slotName: string;
|
|
198
|
-
/** The space NAME, or null for a spaceless slot. */
|
|
199
|
-
space: string | null;
|
|
200
|
-
element: string | null;
|
|
201
|
-
/** True when the designer pinned this pick rather than the engine choosing it. */
|
|
202
|
-
anchored: boolean;
|
|
203
|
-
brand: string;
|
|
204
|
-
product: string;
|
|
205
|
-
variant: string;
|
|
206
|
-
/** Opaque — round-trip verbatim into the material lenses. */
|
|
207
|
-
variantId: VariantId;
|
|
208
|
-
/** Relative path to the public material record (`/materials/{variantId}`). */
|
|
209
|
-
recordUrl: string;
|
|
210
|
-
imageUrl: string | null;
|
|
211
|
-
hex: string | null;
|
|
212
|
-
/** Always the full, identically-ordered column set. */
|
|
213
|
-
attributes: FinishScheduleCell[];
|
|
214
|
-
fitNotes: string[];
|
|
215
|
-
grade: FinishScheduleGrade;
|
|
216
|
-
/**
|
|
217
|
-
* Or-equal alternates for this line. An empty array is AMBIGUOUS on its own —
|
|
218
|
-
* read it with {@link FinishSchedule.alternatesResolved}.
|
|
219
|
-
*/
|
|
220
|
-
alternates: FinishScheduleAlternate[];
|
|
221
|
-
}
|
|
222
|
-
/** A whole composed scheme as an issuable finish schedule. */
|
|
223
|
-
export interface FinishSchedule {
|
|
224
|
-
runId: RunId;
|
|
225
|
-
schemeId: SchemeId;
|
|
226
|
-
title: string;
|
|
227
|
-
/** The compose contract version stamped on the Run, or `"unknown"`. */
|
|
228
|
-
composeVersion: string;
|
|
229
|
-
/** ISO timestamp the export was compiled at. */
|
|
230
|
-
generatedAt: string;
|
|
231
|
-
/** The stable column order every row's `attributes` array follows. */
|
|
232
|
-
columns: FinishScheduleColumn[];
|
|
233
|
-
/**
|
|
234
|
-
* The section table to group by, in schedule order. A section may carry no
|
|
235
|
-
* rows: three are reserved so their conventional numbers are held rather than
|
|
236
|
-
* reused, and any section can simply be unspecified in this scheme.
|
|
237
|
-
*/
|
|
238
|
-
sections: FinishScheduleSection[];
|
|
239
|
-
/** In READING order — space, then section, then line. Not pick order. */
|
|
240
|
-
rows: FinishScheduleRow[];
|
|
241
|
-
/**
|
|
242
|
-
* Slots holding a code with nothing specified against them. Served explicitly
|
|
243
|
-
* because a schedule that omitted them would read as complete.
|
|
244
|
-
*/
|
|
245
|
-
openSlots: FinishScheduleOpenSlot[];
|
|
246
|
-
/**
|
|
247
|
-
* Whether the or-equal lookup RAN. When false, no row's empty `alternates`
|
|
248
|
-
* may be read as "no alternate exists".
|
|
249
|
-
*/
|
|
250
|
-
alternatesResolved: boolean;
|
|
251
|
-
}
|
|
252
|
-
/** `GET /api/v1/runs/{runId}/schedule`. */
|
|
253
|
-
export interface FinishScheduleResponse {
|
|
254
|
-
schedule: FinishSchedule;
|
|
255
|
-
}
|
|
256
|
-
/** Options for {@link getRunSchedule}. */
|
|
257
|
-
export interface GetRunScheduleOptions {
|
|
258
|
-
/** Which composed scheme to export; defaults to the Run's first scheme. Opaque. */
|
|
259
|
-
schemeId?: SchemeId;
|
|
260
|
-
signal?: AbortSignal;
|
|
261
|
-
}
|
package/schedule-types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The product-collapsed view of a search result — what `collapse: "product"`
|
|
3
|
-
* hands back beside each card. Kept out of `types.ts` for the same reason
|
|
4
|
-
* `palette-search-types.ts` and `by-colour-types.ts` are: that file is at its
|
|
5
|
-
* source-size ceiling, and this is a self-contained corner of the contract.
|
|
6
|
-
*
|
|
7
|
-
* READ THIS FIRST, because the default is the opposite of what "duplicates"
|
|
8
|
-
* intuition suggests. MaterialGraph search is VARIANT-based: without `collapse`,
|
|
9
|
-
* every matching variant comes back as its own result, and that is correct —
|
|
10
|
-
* twelve SKUs of one tile are twelve separately orderable products, not twelve
|
|
11
|
-
* copies of one. Product grouping is an optional VIEW over that, not a fix for
|
|
12
|
-
* it.
|
|
13
|
-
*
|
|
14
|
-
* When you do ask for the view, the product arrives CARRYING its variants
|
|
15
|
-
* (`SearchResultItem.variants`) rather than a bare count, so a colourway strip
|
|
16
|
-
* renders from the same response as the card. That array is CAPPED at 12, while
|
|
17
|
-
* `SearchResultItem.siblingCount` stays the complete tally — so a truncated list
|
|
18
|
-
* is decidable from the response alone: `(siblingCount ?? 0) + 1 >
|
|
19
|
-
* variants.length`. A full-length array is never on its own evidence that the
|
|
20
|
-
* product holds no further variants.
|
|
21
|
-
*/
|
|
22
|
-
import type { VariantId } from "./identifiers.js";
|
|
23
|
-
import type { SearchResultSignals } from "./types.js";
|
|
24
|
-
/**
|
|
25
|
-
* One variant of a product-collapsed result.
|
|
26
|
-
*
|
|
27
|
-
* A slim shape, deliberately: the fields a colourway strip renders, projected
|
|
28
|
-
* from the row the engine already held in memory, so the array costs no extra
|
|
29
|
-
* query. It is NOT a nested search result — no `attributes`, `palette`,
|
|
30
|
-
* `verdict` or `productType` — because those come from per-result reads the
|
|
31
|
-
* engine issues for the card only. Fetch the variant by `variantId` when you
|
|
32
|
-
* need its full record.
|
|
33
|
-
*/
|
|
34
|
-
export interface CollapsedVariant {
|
|
35
|
-
/** Opaque — round-trip verbatim. */
|
|
36
|
-
variantId: VariantId;
|
|
37
|
-
/** The variant's own label; for paint, the colourway name. Null when unnamed. */
|
|
38
|
-
variantName: string | null;
|
|
39
|
-
/** The variant's coarse colour family. */
|
|
40
|
-
color: string | null;
|
|
41
|
-
/**
|
|
42
|
-
* `#rrggbb` dominant colour EXTRACTED FROM the variant's image — a visual
|
|
43
|
-
* likeness, never a manufacturer-declared colour specification. ABSENT means
|
|
44
|
-
* no palette is on record: unknown, never "this variant has no colour".
|
|
45
|
-
*/
|
|
46
|
-
hex?: string;
|
|
47
|
-
imageUrl: string | null;
|
|
48
|
-
/**
|
|
49
|
-
* The variant's Material Bank SKU, on the same contract as the result item's:
|
|
50
|
-
* ABSENT means no MB identity is on record, never that it cannot be ordered.
|
|
51
|
-
*/
|
|
52
|
-
materialBankId?: string;
|
|
53
|
-
/** This variant's own mode-primary score — the value the array is ordered by. */
|
|
54
|
-
score: number;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* One member of a collapsed result's `SearchResultItem.anatomy` — the
|
|
58
|
-
* EXPLAIN-only readout of the same grouping {@link CollapsedVariant} publishes.
|
|
59
|
-
* Where a collapsed variant is what a surface renders, this is what an operator
|
|
60
|
-
* inspects: it carries the per-arm `signals` that made the variant a candidate.
|
|
61
|
-
*/
|
|
62
|
-
export interface SearchAnatomyMember {
|
|
63
|
-
/** Opaque — round-trip verbatim. */
|
|
64
|
-
variantId: VariantId;
|
|
65
|
-
variantName: string | null;
|
|
66
|
-
color: string | null;
|
|
67
|
-
score: number;
|
|
68
|
-
signals: SearchResultSignals;
|
|
69
|
-
}
|
package/search-collapse-types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/search-mood-types.d.ts
DELETED
package/search-mood-types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/search-window-types.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/** The bounded candidate window that produced a search page. */
|
|
2
|
-
export interface SearchWindowReceipt {
|
|
3
|
-
/** Versioned budget profile; interpret the remaining fields under this version. */
|
|
4
|
-
profile: "interactive-r1" | (string & {});
|
|
5
|
-
/** Candidate depth used by the final retrieval. */
|
|
6
|
-
candidateTier: number;
|
|
7
|
-
/** Candidate retrieval count; `searchMaterials` reports exactly one selected retrieval. */
|
|
8
|
-
retrievalRounds: number;
|
|
9
|
-
/** Candidate-retrieval wall time only, in milliseconds. */
|
|
10
|
-
retrievalMs: number;
|
|
11
|
-
/** True when the serving source proved there were no more candidates. */
|
|
12
|
-
exhaustive: boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Candidate attrition through the selected retrieval source. Absent when the
|
|
15
|
-
* response path did not perform ordinary retrieval (for example typeahead).
|
|
16
|
-
*/
|
|
17
|
-
candidateCounts?: {
|
|
18
|
-
/** Provider-returned matches before bounded selection; null for SQL/exact arms. */
|
|
19
|
-
rawProviderMatches: number | null;
|
|
20
|
-
/** Matches selected from that provider response; null for SQL/exact arms. */
|
|
21
|
-
selectedMatches: number | null;
|
|
22
|
-
/** Canonical candidates returned by the selected retrieval arm. */
|
|
23
|
-
hydratedCanonicalCandidates: number;
|
|
24
|
-
};
|
|
25
|
-
}
|
package/search-window-types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|