@instruments/materialgraph 0.5.0 → 0.6.1
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/brand-types.d.ts +20 -1
- package/brand-types.js +7 -0
- package/by-spec-types.d.ts +62 -3
- package/catalog-discovery-types.d.ts +19 -2
- package/client-browse.d.ts +7 -1
- package/client.d.ts +339 -53
- package/client.js +313 -32
- package/codes-client.d.ts +36 -0
- package/codes-client.js +26 -0
- package/codes-types.d.ts +77 -11
- package/colour-aggregate-types.d.ts +16 -4
- package/colours-client.d.ts +48 -6
- package/colours-client.js +34 -6
- package/composition-types.d.ts +27 -18
- package/demand-batch-types.d.ts +118 -0
- package/demand-batch-types.js +1 -0
- package/demand-types.d.ts +134 -0
- package/demand-types.js +1 -0
- package/identifiers.d.ts +71 -0
- package/identifiers.js +26 -0
- package/index.d.ts +1 -0
- package/material-asset-types.d.ts +20 -1
- package/material-block-types.d.ts +30 -1
- package/material-types.d.ts +45 -7
- package/package.json +1 -1
- package/palette-search-types.d.ts +17 -2
- package/project-types.d.ts +20 -8
- package/project-types.js +0 -7
- package/run-types.d.ts +20 -8
- package/schedule-types.d.ts +18 -7
- package/schedule-types.js +0 -11
- package/schema-resource-types.d.ts +15 -0
- package/search-refinement-types.d.ts +24 -4
- package/spec-types.d.ts +14 -5
- package/spec-types.js +14 -5
- package/suggest-types.d.ts +10 -1
- package/suggest-types.js +5 -0
- package/types.d.ts +179 -214
package/schedule-types.d.ts
CHANGED
|
@@ -8,7 +8,12 @@
|
|
|
8
8
|
* every row carries the IDENTICAL, fixed column set, and every attribute cell
|
|
9
9
|
* states its own verification alongside its value. An unknown is an explicit
|
|
10
10
|
* `missing` cell with a null value — never a blank that reads as complete.
|
|
11
|
+
*
|
|
12
|
+
* ABSENT IS NOT FALSE, enforced structurally: because the column set is fixed,
|
|
13
|
+
* "we do not know" has to be SAID rather than omitted. Read
|
|
14
|
+
* {@link FinishScheduleCell.state} before printing `value`.
|
|
11
15
|
*/
|
|
16
|
+
import type { RunId, SchemeId, SlotId, VariantId } from "./identifiers.js";
|
|
12
17
|
/** One schedule column: the attribute and its header text. */
|
|
13
18
|
export interface FinishScheduleColumn {
|
|
14
19
|
attributeId: string;
|
|
@@ -39,11 +44,16 @@ export interface FinishScheduleCell {
|
|
|
39
44
|
confidence: number | null;
|
|
40
45
|
sourceBasis: string | null;
|
|
41
46
|
}
|
|
42
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* The rolled-up grade for one row, from its EVALUATED criterion cells only.
|
|
49
|
+
* `meets_all` is all-green on the required cells; `close` means something
|
|
50
|
+
* deviated, went unverified or was missing — never round it up to a pass;
|
|
51
|
+
* `hard_no` means a required cell failed on a real value.
|
|
52
|
+
*/
|
|
43
53
|
export type FinishScheduleGrade = "meets_all" | "close" | "hard_no";
|
|
44
54
|
/** One row: one slot, one specified material, fully graded. */
|
|
45
55
|
export interface FinishScheduleRow {
|
|
46
|
-
slotId:
|
|
56
|
+
slotId: SlotId;
|
|
47
57
|
slotName: string;
|
|
48
58
|
/** The space NAME, or null for a spaceless slot. */
|
|
49
59
|
space: string | null;
|
|
@@ -53,7 +63,8 @@ export interface FinishScheduleRow {
|
|
|
53
63
|
brand: string;
|
|
54
64
|
product: string;
|
|
55
65
|
variant: string;
|
|
56
|
-
|
|
66
|
+
/** Opaque — round-trip verbatim into the material lenses. */
|
|
67
|
+
variantId: VariantId;
|
|
57
68
|
/** Relative path to the public material record (`/materials/{variantId}`). */
|
|
58
69
|
recordUrl: string;
|
|
59
70
|
imageUrl: string | null;
|
|
@@ -65,8 +76,8 @@ export interface FinishScheduleRow {
|
|
|
65
76
|
}
|
|
66
77
|
/** A whole composed scheme as an issuable finish schedule. */
|
|
67
78
|
export interface FinishSchedule {
|
|
68
|
-
runId:
|
|
69
|
-
schemeId:
|
|
79
|
+
runId: RunId;
|
|
80
|
+
schemeId: SchemeId;
|
|
70
81
|
title: string;
|
|
71
82
|
/** The compose contract version stamped on the Run, or `"unknown"`. */
|
|
72
83
|
composeVersion: string;
|
|
@@ -82,7 +93,7 @@ export interface FinishScheduleResponse {
|
|
|
82
93
|
}
|
|
83
94
|
/** Options for {@link getRunSchedule}. */
|
|
84
95
|
export interface GetRunScheduleOptions {
|
|
85
|
-
/** Which composed scheme to export; defaults to the Run's first scheme. */
|
|
86
|
-
schemeId?:
|
|
96
|
+
/** Which composed scheme to export; defaults to the Run's first scheme. Opaque. */
|
|
97
|
+
schemeId?: SchemeId;
|
|
87
98
|
signal?: AbortSignal;
|
|
88
99
|
}
|
package/schedule-types.js
CHANGED
|
@@ -1,12 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Finish-schedule wire types (MG-616) — the hand-mirror of
|
|
3
|
-
* `@materialgraph/products/schemes/finish-schedule`. Kept in their own module
|
|
4
|
-
* rather than `types.ts`, which sits at its source-size baseline.
|
|
5
|
-
*
|
|
6
|
-
* A finish schedule is a completed compose scheme rendered as ONE ROW PER SLOT:
|
|
7
|
-
* the shape a specifier issues. The contract that makes it trustworthy is that
|
|
8
|
-
* every row carries the IDENTICAL, fixed column set, and every attribute cell
|
|
9
|
-
* states its own verification alongside its value. An unknown is an explicit
|
|
10
|
-
* `missing` cell with a null value — never a blank that reads as complete.
|
|
11
|
-
*/
|
|
12
1
|
export {};
|
|
@@ -1,4 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire types for the governed STATIC schema (`GET /api/v1/schema/*`).
|
|
3
|
+
*
|
|
4
|
+
* THE LENS: "what does the registry DEFINE?" — blocks, attributes, units, value
|
|
5
|
+
* dictionaries, product types and their external mappings. Definitions, not
|
|
6
|
+
* data: nothing here says how many materials carry an attribute or which values
|
|
7
|
+
* the corpus holds. For that, use `mg.specificationFacets()` and
|
|
8
|
+
* `mg.attributeValues()`; for one term explained in prose, `mg.glossary()`; for
|
|
9
|
+
* what one material has been determined on, `mg.materialBlocks()`.
|
|
10
|
+
*
|
|
11
|
+
* Every id here (`attributeId`, `blockId`, product-type keys) is canonical
|
|
12
|
+
* VOCABULARY, not an opaque token — this is where you discover it rather than
|
|
13
|
+
* invent it.
|
|
14
|
+
*/
|
|
1
15
|
import type { OpenEnum } from "./types.js";
|
|
16
|
+
/** The nine governed static resources. */
|
|
2
17
|
export type SchemaResource = "blocks" | "attributes" | "verticals" | "productTypes" | "units" | "valueDictionaries" | "sourceRequirements" | "productTypeTemplates" | "mappings";
|
|
3
18
|
export type SchemaResourceRequest = SchemaResource;
|
|
4
19
|
export interface SchemaLifecycle {
|
|
@@ -14,16 +14,36 @@ import type { SearchInput } from "./types.js";
|
|
|
14
14
|
* and the `specifications` builders produce values assignable to this type.
|
|
15
15
|
*/
|
|
16
16
|
/**
|
|
17
|
-
* Optional per-filter TRUST bar the matching value must clear.
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
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".
|
|
21
24
|
*/
|
|
22
25
|
export interface SearchFilterTrust {
|
|
26
|
+
/** Confidence floor, 0–1. A value below it is excluded, not marked failed. */
|
|
23
27
|
minConfidence?: number;
|
|
28
|
+
/**
|
|
29
|
+
* Demand an EXACT source basis (closed enum — an unknown basis is rejected).
|
|
30
|
+
* Roughly strongest to weakest as evidence:
|
|
31
|
+
* - `tested` — a measured result. The strongest claim available.
|
|
32
|
+
* - `declared` — the manufacturer stated it. Attributable, not independent.
|
|
33
|
+
* - `catalog_feed` — it arrived in a catalog feed. Trusted at ingest, unreviewed.
|
|
34
|
+
* - `derived` — MaterialGraph inferred it. Ours, not the manufacturer's — never
|
|
35
|
+
* present a `derived` value as something the brand claims.
|
|
36
|
+
*/
|
|
24
37
|
sourceBasis?: "catalog_feed" | "declared" | "derived" | "tested";
|
|
38
|
+
/** Fold the attribute's own registry confidence requirement in, server-side. */
|
|
25
39
|
meetsRequirement?: true;
|
|
26
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* One HARD criterion. Applied as a restriction BEFORE ranking, so a filtered
|
|
43
|
+
* search's empty result means "nothing on record satisfies this", never "nothing
|
|
44
|
+
* exists" — the corpus's silence and the world's are different things. Use
|
|
45
|
+
* `preferences` instead when a miss should demote rather than remove.
|
|
46
|
+
*/
|
|
27
47
|
export type SearchFilter = {
|
|
28
48
|
attributeId: string;
|
|
29
49
|
term: string;
|
package/spec-types.d.ts
CHANGED
|
@@ -11,12 +11,21 @@
|
|
|
11
11
|
* class, but with an EPD on record" reaches for a NAMED, typed criterion instead
|
|
12
12
|
* of hand-assembling a magic `attribute:value` string.
|
|
13
13
|
*
|
|
14
|
-
* These criteria drive two operations equally
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
14
|
+
* These criteria drive two operations equally, and choosing between them IS the
|
|
15
|
+
* routing decision:
|
|
16
|
+
* - `client.search({ filters: [...] })` — spec gates layered onto a RANKED
|
|
17
|
+
* (colour / visual / lexical) search. Reach for it when relevance still
|
|
18
|
+
* matters: "something like this seed, but Class A".
|
|
19
|
+
* - `client.bySpec(...)` — the value-anchored, SPEC-ONLY primitive, which takes
|
|
18
20
|
* the same criteria as `attribute:value` strings (build them with the helpers
|
|
19
|
-
* in `./specifications`).
|
|
21
|
+
* in `./specifications`). Reach for it when the spec is the whole question and
|
|
22
|
+
* ranking would be noise.
|
|
23
|
+
*
|
|
24
|
+
* Discover the tokens before you spend them: `client.specificationFacets()` for
|
|
25
|
+
* what is facetable at all, `client.attributeValues()` for one attribute's
|
|
26
|
+
* values, `client.resolveAttribute()` / `client.resolveAttributeValue()` to turn
|
|
27
|
+
* a phrase into a canonical pair. A hand-guessed token returns an honest empty
|
|
28
|
+
* answer, which is the hardest kind of bug to see.
|
|
20
29
|
*/
|
|
21
30
|
/**
|
|
22
31
|
* The virtual attribute id that matches a certification PROGRAMME wherever it
|
package/spec-types.js
CHANGED
|
@@ -11,12 +11,21 @@
|
|
|
11
11
|
* class, but with an EPD on record" reaches for a NAMED, typed criterion instead
|
|
12
12
|
* of hand-assembling a magic `attribute:value` string.
|
|
13
13
|
*
|
|
14
|
-
* These criteria drive two operations equally
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
14
|
+
* These criteria drive two operations equally, and choosing between them IS the
|
|
15
|
+
* routing decision:
|
|
16
|
+
* - `client.search({ filters: [...] })` — spec gates layered onto a RANKED
|
|
17
|
+
* (colour / visual / lexical) search. Reach for it when relevance still
|
|
18
|
+
* matters: "something like this seed, but Class A".
|
|
19
|
+
* - `client.bySpec(...)` — the value-anchored, SPEC-ONLY primitive, which takes
|
|
18
20
|
* the same criteria as `attribute:value` strings (build them with the helpers
|
|
19
|
-
* in `./specifications`).
|
|
21
|
+
* in `./specifications`). Reach for it when the spec is the whole question and
|
|
22
|
+
* ranking would be noise.
|
|
23
|
+
*
|
|
24
|
+
* Discover the tokens before you spend them: `client.specificationFacets()` for
|
|
25
|
+
* what is facetable at all, `client.attributeValues()` for one attribute's
|
|
26
|
+
* values, `client.resolveAttribute()` / `client.resolveAttributeValue()` to turn
|
|
27
|
+
* a phrase into a canonical pair. A hand-guessed token returns an honest empty
|
|
28
|
+
* answer, which is the hardest kind of bug to see.
|
|
20
29
|
*/
|
|
21
30
|
/**
|
|
22
31
|
* The virtual attribute id that matches a certification PROGRAMME wherever it
|
package/suggest-types.d.ts
CHANGED
|
@@ -6,6 +6,11 @@
|
|
|
6
6
|
* Split out of `types.ts` for the repository's source-file size budget, the same
|
|
7
7
|
* reason `catalog-discovery-types.ts` sits beside it; both are re-exported from
|
|
8
8
|
* `types.ts`, so importers see no difference.
|
|
9
|
+
*
|
|
10
|
+
* THE LENS: entity typeahead — it ranks NAMES, not materials. `mg.search()` is
|
|
11
|
+
* what answers a committed query; `mg.suggestColour()` covers colour names and
|
|
12
|
+
* `mg.searchVocabulary()` covers attribute/value tokens. Suggestions are a page
|
|
13
|
+
* of the best matches, never a census of matching entities.
|
|
9
14
|
*/
|
|
10
15
|
/** Which kind of entity a suggestion is — and therefore what `refId` means. */
|
|
11
16
|
export type SuggestKind = "product" | "brand" | "category";
|
|
@@ -25,8 +30,12 @@ export interface Suggestion {
|
|
|
25
30
|
brandSlug: string | null;
|
|
26
31
|
brandName: string | null;
|
|
27
32
|
categoryKey: string | null;
|
|
28
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* A representative variant, so a client can open a material record directly.
|
|
35
|
+
* Opaque, and null when none was picked — not a product without variants.
|
|
36
|
+
*/
|
|
29
37
|
variantId: string | null;
|
|
38
|
+
/** Variants behind this entity IN MATERIALGRAPH — a coverage figure. */
|
|
30
39
|
variantCount: number;
|
|
31
40
|
}
|
|
32
41
|
/** The suggest response: the query as interpreted, plus the ranked suggestions. */
|
package/suggest-types.js
CHANGED
|
@@ -6,6 +6,11 @@
|
|
|
6
6
|
* Split out of `types.ts` for the repository's source-file size budget, the same
|
|
7
7
|
* reason `catalog-discovery-types.ts` sits beside it; both are re-exported from
|
|
8
8
|
* `types.ts`, so importers see no difference.
|
|
9
|
+
*
|
|
10
|
+
* THE LENS: entity typeahead — it ranks NAMES, not materials. `mg.search()` is
|
|
11
|
+
* what answers a committed query; `mg.suggestColour()` covers colour names and
|
|
12
|
+
* `mg.searchVocabulary()` covers attribute/value tokens. Suggestions are a page
|
|
13
|
+
* of the best matches, never a census of matching entities.
|
|
9
14
|
*/
|
|
10
15
|
/**
|
|
11
16
|
* Shape the query string for a suggest call.
|