@instruments/materialgraph 0.18.0 → 0.20.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 +29 -4
- package/attribution-types.d.ts +51 -0
- package/attribution-types.js +13 -0
- package/browse-types.d.ts +14 -3
- package/by-colour-types.d.ts +33 -6
- package/by-spec-types.d.ts +4 -0
- package/catalogue-client.d.ts +54 -0
- package/catalogue-client.js +16 -0
- package/catalogue-types.d.ts +3 -1
- package/citation-types.d.ts +34 -0
- package/citation-types.js +1 -0
- package/client-browse.d.ts +1 -0
- package/client-browse.js +1 -0
- package/client-vocabulary.d.ts +10 -0
- package/client-vocabulary.js +32 -0
- package/client.d.ts +22 -45
- package/client.js +40 -55
- package/colours-client.d.ts +8 -3
- package/colours-client.js +8 -0
- package/composition-types.d.ts +6 -0
- package/corpus-scope-types.d.ts +1 -1
- package/errors.d.ts +1 -1
- package/errors.js +2 -0
- package/identify-types.d.ts +72 -0
- package/identify-types.js +7 -0
- package/index.d.ts +10 -0
- package/json-value-types.d.ts +8 -0
- package/json-value-types.js +1 -0
- package/match-stream-types.d.ts +13 -0
- package/match-types.d.ts +13 -0
- package/material-block-types.d.ts +4 -0
- package/material-resources-client.d.ts +3 -0
- package/material-resources-client.js +4 -0
- package/material-types.d.ts +24 -0
- package/operations.d.ts +1 -1
- package/operations.js +64 -2
- package/package.json +8 -1
- package/palette-completion-types.d.ts +115 -0
- package/palette-completion-types.js +1 -0
- package/palette-search-types.d.ts +16 -2
- package/render-assets-types.d.ts +65 -0
- package/render-assets-types.js +1 -0
- package/run-events.d.ts +13 -0
- package/samplize-catalogue-types.d.ts +92 -0
- package/samplize-catalogue-types.js +1 -0
- package/samplize-colorvec.d.ts +70 -0
- package/samplize-colorvec.js +167 -0
- package/schedule-reference-types.d.ts +46 -0
- package/schedule-reference-types.js +1 -0
- package/schedule-references-client.d.ts +14 -0
- package/schedule-references-client.js +26 -0
- package/schedule-types.d.ts +34 -0
- package/search-card-types.d.ts +53 -0
- package/search-card-types.js +1 -0
- package/search-mood-types.d.ts +6 -0
- package/search-mood-types.js +1 -0
- package/search-refinement-types.d.ts +5 -0
- package/search-request-types.d.ts +5 -0
- package/search-response-receipt-types.d.ts +8 -0
- package/search-result-validation.js +10 -0
- package/slot-pool-types.d.ts +2 -0
- package/spec-types.d.ts +6 -1
- package/specifications.d.ts +3 -1
- package/specifications.js +4 -0
- package/substitute-types.d.ts +102 -0
- package/substitute-types.js +1 -0
- package/taxonomy-coverage-types.d.ts +34 -0
- package/taxonomy-coverage-types.js +1 -0
- package/types.d.ts +42 -57
package/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ResponseAttribution } from "./attribution-types.js";
|
|
1
2
|
import type { BySpecVerdict } from "./by-spec-types.js";
|
|
2
3
|
/**
|
|
3
4
|
* Hand-mirrored wire types for the MaterialGraph public API (spec 0.5.0).
|
|
@@ -31,19 +32,14 @@ import type { Cursor, ProductId, VariantId } from "./identifiers.js";
|
|
|
31
32
|
import type { MaterialDetail, MaterialTile } from "./material-types.js";
|
|
32
33
|
import type { QueryUnderstanding } from "./query-understanding-types.js";
|
|
33
34
|
import type { CollapsedVariant, SearchAnatomyMember } from "./search-collapse-types.js";
|
|
35
|
+
import type { MoodInterpretation } from "./search-mood-types.js";
|
|
34
36
|
import type { SearchDisambiguation, SearchSuggestion } from "./search-refinement-types.js";
|
|
35
|
-
import type { CompoundColourConstraintReceipt, CompoundFormConstraintReceipt, SearchExecutionPlan, SearchMode, SearchRerankReport, SearchResponseExplainReceipts } from "./search-response-receipt-types.js";
|
|
37
|
+
import type { CompoundColourConstraintReceipt, CompoundFormConstraintReceipt, SearchExecutionPlan, SearchMode, SearchRefinementReceipt, SearchRerankReport, SearchResponseExplainReceipts } from "./search-response-receipt-types.js";
|
|
36
38
|
import type { SearchWindowReceipt } from "./search-window-types.js";
|
|
37
39
|
export type * from "./search-response-receipt-types.js";
|
|
40
|
+
export type { MoodInterpretation } from "./search-mood-types.js";
|
|
38
41
|
export type OpenEnum<T extends string> = T | (string & {});
|
|
39
|
-
|
|
40
|
-
* A JSON value, recursively — exactly what survives a `jsonb` round-trip
|
|
41
|
-
* unchanged. Used where a payload's SHAPE belongs to its producer but its values
|
|
42
|
-
* must still be JSON: `Date`, `bigint`, `undefined`, and functions are not.
|
|
43
|
-
*/
|
|
44
|
-
export type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
45
|
-
[key: string]: JsonValue;
|
|
46
|
-
};
|
|
42
|
+
export type { JsonValue } from "./json-value-types.js";
|
|
47
43
|
/**
|
|
48
44
|
* One palette swatch of a material's main image — colour DERIVED FROM PRODUCT
|
|
49
45
|
* IMAGERY, so read it as visual likeness, never as a declared colour spec.
|
|
@@ -120,6 +116,10 @@ export interface VisualMeaning {
|
|
|
120
116
|
* `visualMeanings` is not "this material has no visual meaning".
|
|
121
117
|
*/
|
|
122
118
|
export interface SearchResultItem {
|
|
119
|
+
/** This hit's attribution key — see {@link ResponseAttribution}. Opaque. */
|
|
120
|
+
resultId?: string;
|
|
121
|
+
/** Accepted sampleability fact. Absent means unknown, never false. */
|
|
122
|
+
sampleable?: boolean;
|
|
123
123
|
/** Opaque — round-trip verbatim into `material()`, `pairings()`, `similarTo`. */
|
|
124
124
|
variantId: VariantId;
|
|
125
125
|
brand: string;
|
|
@@ -134,7 +134,7 @@ export interface SearchResultItem {
|
|
|
134
134
|
* Populated on EVERY lane: `search()` (all four arms), `match()`, and
|
|
135
135
|
* `matchStream()` frames.
|
|
136
136
|
* ABSENT means no MB identity is known for the variant — never that the SKU
|
|
137
|
-
* cannot be ordered. Presence
|
|
137
|
+
* cannot be ordered. Presence identifies the source; it does not establish sampleability.
|
|
138
138
|
*/
|
|
139
139
|
materialBankId?: string;
|
|
140
140
|
manufacturerCode?: string;
|
|
@@ -267,40 +267,6 @@ export interface SearchResultItem {
|
|
|
267
267
|
*/
|
|
268
268
|
attributes?: Record<string, string | string[] | null>;
|
|
269
269
|
}
|
|
270
|
-
/**
|
|
271
|
-
* The lean `view:"card"` result item — identity + name + thumbnail + score.
|
|
272
|
-
*
|
|
273
|
-
* A PROJECTION, not a smaller answer: a field the card omits (palette, verdict,
|
|
274
|
-
* signals, availability) is unread here, never known-absent. Re-read the same
|
|
275
|
-
* `variantId` at `view: "full"` or via `material()` before claiming anything the
|
|
276
|
-
* card does not carry.
|
|
277
|
-
*/
|
|
278
|
-
export interface SearchCardItem {
|
|
279
|
-
/** Opaque — round-trip verbatim. */
|
|
280
|
-
variantId: VariantId;
|
|
281
|
-
productId: ProductId | null;
|
|
282
|
-
brandSlug: string | null;
|
|
283
|
-
brand: string;
|
|
284
|
-
/** Product name (the full item's `product`). */
|
|
285
|
-
name: string;
|
|
286
|
-
variantName: string | null;
|
|
287
|
-
imageUrl: string | null;
|
|
288
|
-
projectSaveCapability?: "allowed";
|
|
289
|
-
sourceStatus?: "provisional";
|
|
290
|
-
score: number;
|
|
291
|
-
/**
|
|
292
|
-
* Resolved values for the attribute ids sent in `returnAttributes`, keyed by
|
|
293
|
-
* attribute id. ABSENT entirely when `returnAttributes` was not sent.
|
|
294
|
-
*
|
|
295
|
-
* Three states, all different, and reading them as two is the mistake this
|
|
296
|
-
* shape exists to prevent: no `attributes` key means you did not ask; a key
|
|
297
|
-
* whose value is `null` means this material carries no accepted value for that
|
|
298
|
-
* attribute; anything else is what the graph holds. Values resolve with the
|
|
299
|
-
* normal variant-over-product precedence, and an array is a multi-valued
|
|
300
|
-
* attribute rather than a list of candidates.
|
|
301
|
-
*/
|
|
302
|
-
attributes?: Record<string, string | string[] | null>;
|
|
303
|
-
}
|
|
304
270
|
/**
|
|
305
271
|
* A feed total with its honesty basis — THE CLAIM ABOUT THE MATCH SET, which is
|
|
306
272
|
* a different number from `results.length` (this page).
|
|
@@ -380,14 +346,6 @@ export interface SearchFacets {
|
|
|
380
346
|
absent: SearchAbsentFacet[];
|
|
381
347
|
counts: Record<string, SearchFacetCount>;
|
|
382
348
|
}
|
|
383
|
-
/** Inspectable metadata for an opaque, principal-bound search refinement receipt. */
|
|
384
|
-
export interface SearchRefinementReceipt {
|
|
385
|
-
token: string;
|
|
386
|
-
expiresAt: string;
|
|
387
|
-
poolSize: number;
|
|
388
|
-
schemaVersion: string;
|
|
389
|
-
projectionVersion: number;
|
|
390
|
-
}
|
|
391
349
|
/**
|
|
392
350
|
* The search response envelope. `view` discriminates the `results` union:
|
|
393
351
|
* `"full"` (default) carries {@link SearchResultItem}s, `"card"` the lean
|
|
@@ -401,11 +359,29 @@ export interface SearchRefinementReceipt {
|
|
|
401
359
|
* wrong whenever `limit` was 24.
|
|
402
360
|
*/
|
|
403
361
|
export interface SearchResponse extends SearchResponseExplainReceipts {
|
|
362
|
+
/** Result attribution — see {@link ResponseAttribution}. `basis` is `mode` verbatim here. */
|
|
363
|
+
attribution?: ResponseAttribution;
|
|
404
364
|
view: OpenEnum<"full" | "card">;
|
|
405
365
|
/** THIS PAGE. Its length is a page size, never a total. */
|
|
406
366
|
results: SearchResultItem[];
|
|
407
367
|
suggestions: SearchSuggestion[];
|
|
408
368
|
mode: SearchMode;
|
|
369
|
+
/**
|
|
370
|
+
* Which dense text lane answered, when one did (MG-1796). `image-text` — the
|
|
371
|
+
* query carried evidence it describes appearance, so it was ranked against
|
|
372
|
+
* image vectors; `variant-text` — ranked against each variant's written
|
|
373
|
+
* portrait.
|
|
374
|
+
*
|
|
375
|
+
* ABSENT means the answer did not come from the dense text arm at all: `mode`
|
|
376
|
+
* was never `text`, or the text arm resolved without a lane. Absence is
|
|
377
|
+
* UNKNOWN and never a default of `image-text` — treating it as one asserts a
|
|
378
|
+
* dense reading of a lexical, colour or browse answer. Absent too from any
|
|
379
|
+
* response produced by a server predating MG-1793.
|
|
380
|
+
*
|
|
381
|
+
* An {@link OpenEnum} because the lane vocabulary can grow: a value you do
|
|
382
|
+
* not recognise is a lane this client predates, not a malformed response.
|
|
383
|
+
*/
|
|
384
|
+
textLane?: OpenEnum<"image-text" | "variant-text">;
|
|
409
385
|
maxScore: number;
|
|
410
386
|
cursor?: Cursor;
|
|
411
387
|
window?: SearchWindowReceipt;
|
|
@@ -438,6 +414,11 @@ export interface SearchResponse extends SearchResponseExplainReceipts {
|
|
|
438
414
|
timings?: Record<string, number>;
|
|
439
415
|
/** A detected mood term overridden by a stronger colour reading. */
|
|
440
416
|
supersededMoodId?: string;
|
|
417
|
+
/**
|
|
418
|
+
* Explicit standard-search mood reading; null ids mean no selected mood.
|
|
419
|
+
* Absent when mood was not evaluated or an older server produced the result.
|
|
420
|
+
*/
|
|
421
|
+
moodInterpretation?: MoodInterpretation;
|
|
441
422
|
/**
|
|
442
423
|
* Present when the query had multiple defensible readings. Says which one
|
|
443
424
|
* ran, or leaves every reading non-default when the engine chose none. Every
|
|
@@ -458,11 +439,6 @@ export interface SearchResponse extends SearchResponseExplainReceipts {
|
|
|
458
439
|
/** A `getVariantBrief` echo of the seed variant, present only in `variantId` seed mode. */
|
|
459
440
|
seed?: MaterialTile | Record<string, unknown>;
|
|
460
441
|
}
|
|
461
|
-
/** The `view:"card"` response form — the lean grid projection of {@link SearchResponse}. */
|
|
462
|
-
export interface SearchCardResponse extends Omit<SearchResponse, "view" | "results"> {
|
|
463
|
-
view: OpenEnum<"card">;
|
|
464
|
-
results: SearchCardItem[];
|
|
465
|
-
}
|
|
466
442
|
export type ColourDictionaryId = OpenEnum<"colour_family" | "colour_mood" | "colour_undertone">;
|
|
467
443
|
export interface ColourFacetTerm {
|
|
468
444
|
id: string;
|
|
@@ -611,6 +587,13 @@ export interface PairingsResponse {
|
|
|
611
587
|
* check it before presenting the rail as demand evidence.
|
|
612
588
|
*/
|
|
613
589
|
cospecCount: number;
|
|
590
|
+
/**
|
|
591
|
+
* Candidates dropped at hydration for violating the material contract
|
|
592
|
+
* (MG-985). Present ONLY when > 0. A non-zero count means the rail is
|
|
593
|
+
* shorter than the evidence behind it — read it before calling the rail
|
|
594
|
+
* complete.
|
|
595
|
+
*/
|
|
596
|
+
skippedCandidates?: number;
|
|
614
597
|
/** Present only when `order` was requested. Evidence tiers remain independent. */
|
|
615
598
|
ordering?: PairingOrdering;
|
|
616
599
|
/** Opaque continuation bound to the seed, filters, corpus, and order. */
|
|
@@ -713,6 +696,8 @@ export interface PairingsOptions {
|
|
|
713
696
|
categories?: string;
|
|
714
697
|
/** Page size, 1–24 inclusive (default 12). The server rejects (400), not clamps, values outside this range. */
|
|
715
698
|
limit?: number;
|
|
699
|
+
/** Return sampled order evidence only, without board or colour fallback. */
|
|
700
|
+
sampledOnly?: boolean;
|
|
716
701
|
/** Graph-owned order applied within fixed cospec → considered → colour tiers. */
|
|
717
702
|
order?: PairingOrderMode;
|
|
718
703
|
/** Optional Material Bank/orderable gate; requires an explicit `order`. */
|