@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,57 +1,94 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Wire types for
|
|
3
|
-
* (`GET /api/v1/
|
|
2
|
+
* Wire types for `list_variant_assets`
|
|
3
|
+
* (`GET /api/v1/variants/{variantId}/assets`, MG-2232): one bounded, filtered,
|
|
4
|
+
* cursor-paged page of a variant's images and files.
|
|
4
5
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* Classification (`kind`, `imageRole`, `presentation`, `documentTypes`)
|
|
7
|
+
* mirrors the one registry `@materialgraph/schema/asset-classification`
|
|
8
|
+
* carries server-side; every field that names a registry term is an
|
|
9
|
+
* {@link OpenEnum} so a server-added term still type-checks here.
|
|
8
10
|
*/
|
|
9
11
|
import type { VariantId } from "./identifiers.js";
|
|
10
12
|
import type { OpenEnum } from "./types.js";
|
|
11
|
-
export type MaterialAssetVisualRole = OpenEnum<"grid" | "detail" | "scene" | "swatch" | "technical" | "unknown">;
|
|
12
13
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* a broken asset.
|
|
17
|
-
* - `failed` — we tried and could not. Says nothing about the source.
|
|
18
|
-
* - `retired_placeholder` — a stand-in for a withdrawn asset.
|
|
14
|
+
* `available`: MaterialGraph serves the file at `url`. `unknown`: `url` is the
|
|
15
|
+
* maker's own link, unchecked. `unavailable`: no working copy is known and
|
|
16
|
+
* `url` is null.
|
|
19
17
|
*/
|
|
20
|
-
export type
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
18
|
+
export type VariantAssetAvailability = OpenEnum<"available" | "unknown" | "unavailable">;
|
|
19
|
+
/** What an image primarily shows. */
|
|
20
|
+
export type VariantImageRole = OpenEnum<"product" | "swatch" | "detail" | "scene" | "technical" | "colour_chart" | "sample_collection" | "other" | "unknown">;
|
|
21
|
+
/** How an image must be framed, a different question from what it shows. */
|
|
22
|
+
export type VariantImagePresentation = OpenEnum<"edge_to_edge" | "packshot" | "cutout_margin" | "montage" | "unknown">;
|
|
23
|
+
/** What a document is for; a document can carry more than one purpose. */
|
|
24
|
+
export type VariantDocumentType = OpenEnum<"technical_data_sheet" | "product_sheet" | "technical_bulletin" | "sustainability_report" | "specification" | "installation_guide" | "care_maintenance_guide" | "operation_manual" | "warranty" | "parts_list" | "technical_drawing" | "test_report" | "certificate" | "declaration_of_performance" | "environmental_product_declaration" | "health_product_declaration" | "ingredient_disclosure" | "safety_data_sheet" | "brochure" | "catalogue" | "colour_finish_chart" | "other" | "unknown">;
|
|
25
|
+
/** Every asset kind the registry knows. */
|
|
26
|
+
export type VariantAssetKind = OpenEnum<"image" | "document" | "cad" | "bim" | "model_3d" | "texture" | "archive" | "other" | "unknown">;
|
|
27
|
+
/**
|
|
28
|
+
* One asset. A field is absent only where it says so: kind-scoped fields
|
|
29
|
+
* appear on their kind, and an absent value is unknown. `url` is absent when
|
|
30
|
+
* `availability` is `unavailable`; `appliesTo` appears only as `product`.
|
|
31
|
+
*/
|
|
32
|
+
export type VariantAssetItem = {
|
|
33
|
+
/** Only `product`: filed against the whole product. Absent: this variant's own. */
|
|
34
|
+
appliesTo?: "product";
|
|
35
|
+
assetId: string;
|
|
36
|
+
availability: VariantAssetAvailability;
|
|
37
|
+
/** Not on images; absent when unknown. */
|
|
38
|
+
byteSize?: number;
|
|
39
|
+
/** Documents only; absent when unknown. */
|
|
40
|
+
documentTypes?: VariantDocumentType[];
|
|
41
|
+
/** Images only; absent when unknown. */
|
|
42
|
+
height?: number;
|
|
43
|
+
/** Images only; absent when unknown. */
|
|
44
|
+
imageRole?: VariantImageRole;
|
|
45
|
+
kind: VariantAssetKind;
|
|
46
|
+
/** Not on images; absent when unknown. */
|
|
47
|
+
name?: string;
|
|
48
|
+
/** Images only; absent when unknown. */
|
|
49
|
+
presentation?: VariantImagePresentation;
|
|
50
|
+
url?: string;
|
|
51
|
+
/** Images only; absent when unknown. */
|
|
52
|
+
width?: number;
|
|
53
|
+
};
|
|
54
|
+
/** Whether the maker's document source was read for this variant. Absent when documents are filtered out. */
|
|
55
|
+
export type VariantDocumentCoverageState = OpenEnum<"available" | "none_declared" | "not_ingested" | "unavailable_source" | "dead_link" | "failed_ingest">;
|
|
56
|
+
export type VariantAssetPageInfo = {
|
|
57
|
+
nextCursor: string | null;
|
|
58
|
+
returnedCount: number;
|
|
59
|
+
totalMatches: number;
|
|
60
|
+
};
|
|
61
|
+
/** Request filters and paging for `listVariantAssets`. Each list is OR within itself, AND across lists. */
|
|
62
|
+
export type ListVariantAssetsOptions = {
|
|
63
|
+
kinds?: VariantAssetKind[];
|
|
64
|
+
imageRoles?: VariantImageRole[];
|
|
65
|
+
documentTypes?: VariantDocumentType[];
|
|
66
|
+
/** 1..50, default 20. */
|
|
67
|
+
limit?: number;
|
|
68
|
+
/** `pageInfo.nextCursor` from the previous page, with the same variantId and filters. */
|
|
69
|
+
cursor?: string;
|
|
70
|
+
};
|
|
71
|
+
/** One page. An unknown variant is a 404, never a page. */
|
|
72
|
+
export type VariantAssetPage = {
|
|
73
|
+
documentCoverage?: VariantDocumentCoverageState;
|
|
74
|
+
items: VariantAssetItem[];
|
|
75
|
+
pageInfo: VariantAssetPageInfo;
|
|
76
|
+
/** The variant's primary image. Absent when it has none. */
|
|
77
|
+
primaryAssetId?: string;
|
|
78
|
+
};
|
|
42
79
|
export type MaterialDocumentStatus = OpenEnum<"downloaded" | "linked_not_downloaded" | "unavailable_source" | "dead_link" | "failed_ingest">;
|
|
43
80
|
export type MaterialDocumentCoverageState = OpenEnum<"available" | "none_declared" | "not_ingested" | "unavailable_source" | "dead_link" | "failed_ingest">;
|
|
44
|
-
export
|
|
81
|
+
export type MaterialDocumentScope = {
|
|
45
82
|
kind: "product" | "variant";
|
|
46
83
|
id: string;
|
|
47
|
-
}
|
|
48
|
-
export
|
|
84
|
+
};
|
|
85
|
+
export type MaterialDocumentSource = {
|
|
49
86
|
/** Opaque, public identifier for one source collection; never a PIM/DAM path. */
|
|
50
87
|
id: string;
|
|
51
88
|
authority: string;
|
|
52
89
|
revision: string;
|
|
53
|
-
}
|
|
54
|
-
export
|
|
90
|
+
};
|
|
91
|
+
export type MaterialDocumentProjectionItem = {
|
|
55
92
|
id: string;
|
|
56
93
|
scope: MaterialDocumentScope & {
|
|
57
94
|
inherited: boolean;
|
|
@@ -61,12 +98,12 @@ export interface MaterialDocumentProjectionItem {
|
|
|
61
98
|
/** True only for a Product declaration or this exact requested Variant. */
|
|
62
99
|
appliesToRequestedVariant: boolean;
|
|
63
100
|
/** Every exact source-grain declaration collapsed into this URL identity. */
|
|
64
|
-
declarations:
|
|
101
|
+
declarations: {
|
|
65
102
|
scope: MaterialDocumentScope;
|
|
66
103
|
source: MaterialDocumentSource;
|
|
67
104
|
status: MaterialDocumentStatus;
|
|
68
105
|
readable: boolean;
|
|
69
|
-
}
|
|
106
|
+
}[];
|
|
70
107
|
documentType: string | null;
|
|
71
108
|
originalName: string;
|
|
72
109
|
status: MaterialDocumentStatus;
|
|
@@ -75,51 +112,34 @@ export interface MaterialDocumentProjectionItem {
|
|
|
75
112
|
contentType: string | null;
|
|
76
113
|
fileExtension: string | null;
|
|
77
114
|
source: MaterialDocumentSource;
|
|
78
|
-
}
|
|
79
|
-
export
|
|
115
|
+
};
|
|
116
|
+
export type MaterialDocumentCoverageSource = {
|
|
80
117
|
scope: MaterialDocumentScope;
|
|
81
118
|
state: MaterialDocumentCoverageState;
|
|
82
119
|
exact: boolean;
|
|
83
120
|
declaredCount: number | null;
|
|
84
121
|
readableCount: number;
|
|
85
122
|
source: MaterialDocumentSource;
|
|
86
|
-
}
|
|
87
|
-
export
|
|
123
|
+
};
|
|
124
|
+
export type MaterialDocumentCoverage = {
|
|
88
125
|
productUnion: MaterialDocumentCoverageSummary;
|
|
89
126
|
requestedVariant: MaterialDocumentCoverageSummary;
|
|
90
127
|
sources: MaterialDocumentCoverageSource[];
|
|
91
|
-
}
|
|
92
|
-
export
|
|
128
|
+
};
|
|
129
|
+
export type MaterialDocumentCoverageSummary = {
|
|
93
130
|
state: MaterialDocumentCoverageState;
|
|
94
131
|
exact: boolean;
|
|
95
132
|
declaredCount: number | null;
|
|
96
133
|
readableCount: number;
|
|
97
|
-
}
|
|
98
|
-
export
|
|
134
|
+
};
|
|
135
|
+
export type MaterialDocumentPageOptions = {
|
|
99
136
|
cursor?: string;
|
|
100
137
|
limit?: number;
|
|
101
|
-
}
|
|
102
|
-
export
|
|
138
|
+
};
|
|
139
|
+
export type MaterialDocumentPage = {
|
|
103
140
|
variantId: VariantId;
|
|
104
141
|
documents: MaterialDocumentProjectionItem[];
|
|
105
142
|
coverage: MaterialDocumentCoverage;
|
|
106
143
|
totalDocuments: number;
|
|
107
144
|
nextCursor: string | null;
|
|
108
|
-
}
|
|
109
|
-
/** Tallies over what this projection returned — never a claim about the brand's own library. */
|
|
110
|
-
export interface MaterialAssetProjectionSummary {
|
|
111
|
-
imageCount: number;
|
|
112
|
-
downloadCount: number;
|
|
113
|
-
documentCount: number;
|
|
114
|
-
readableDocumentCount: number;
|
|
115
|
-
downloadedImageCount: number;
|
|
116
|
-
}
|
|
117
|
-
export interface MaterialAssetProjection {
|
|
118
|
-
/** Opaque — echoed from the request. */
|
|
119
|
-
variantId: VariantId;
|
|
120
|
-
images: MaterialAssetProjectionImage[];
|
|
121
|
-
downloads: MaterialAssetProjectionDownload[];
|
|
122
|
-
documents: MaterialDocumentProjectionItem[];
|
|
123
|
-
documentCoverage: MaterialDocumentCoverage;
|
|
124
|
-
summary: MaterialAssetProjectionSummary;
|
|
125
|
-
}
|
|
145
|
+
};
|
|
@@ -45,32 +45,34 @@ export type MaterialBlockFieldValue = string | number | boolean | unknown[] | Re
|
|
|
45
45
|
* `status: "verified"` is a real negative you may publish; the same `false`
|
|
46
46
|
* under `missing` is a placeholder for an unanswered question.
|
|
47
47
|
*/
|
|
48
|
-
export
|
|
48
|
+
export type MaterialBlockProjectionField = {
|
|
49
49
|
/** Canonical vocabulary, not an opaque id — the same token `bySpec` accepts. */
|
|
50
50
|
attributeId: string;
|
|
51
51
|
label: string;
|
|
52
52
|
value: MaterialBlockFieldValue;
|
|
53
|
+
/** The value dictionary's label for a single-term `value`. Absent when no label is on record; `value` stays the canonical token. */
|
|
54
|
+
displayValue?: string;
|
|
53
55
|
unit?: string;
|
|
54
56
|
status: MaterialBlockFieldStatus;
|
|
55
57
|
/** Provenance supplied by the graph when a source-backed claim supports this field. */
|
|
56
58
|
sourceBasis?: string;
|
|
57
59
|
/** Claim confidence supplied by the graph; absence means no confidence was emitted. */
|
|
58
60
|
confidence?: number;
|
|
59
|
-
}
|
|
60
|
-
export
|
|
61
|
+
};
|
|
62
|
+
export type MaterialBlockProjectionItem = {
|
|
61
63
|
canonicalBlockId: string;
|
|
62
64
|
canonicalBlockName: string;
|
|
63
65
|
status: MaterialBlockStatus;
|
|
64
66
|
fields: MaterialBlockProjectionField[];
|
|
65
67
|
/** The work queue: attributes with `status: "missing"`. UNKNOWN, never "none". */
|
|
66
68
|
missingAttributeIds: string[];
|
|
67
|
-
}
|
|
69
|
+
};
|
|
68
70
|
/**
|
|
69
71
|
* Every canonical block for one material, each field carrying whether it is
|
|
70
72
|
* determined. The whole surface, not a page — there is no cursor here.
|
|
71
73
|
*/
|
|
72
|
-
export
|
|
74
|
+
export type MaterialBlockProjection = {
|
|
73
75
|
/** Opaque — echoed from the request. */
|
|
74
76
|
variantId: VariantId;
|
|
75
77
|
blocks: MaterialBlockProjectionItem[];
|
|
76
|
-
}
|
|
78
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The MATERIAL COMPOSITION lens: what a product is made of, and how far the
|
|
3
|
+
* corpus that answers that question has got (MG-1969).
|
|
4
|
+
*
|
|
5
|
+
* Not `./composition-client.ts`, which wraps the slot pools a scheme composer
|
|
6
|
+
* outside MaterialGraph reads.
|
|
7
|
+
*/
|
|
8
|
+
import type { HttpTransport } from "./http-transport.js";
|
|
9
|
+
import type { CompositionCorpusSummary } from "./material-composition-types.js";
|
|
10
|
+
/**
|
|
11
|
+
* THE QUESTION: "which product types can we answer that question for yet?"
|
|
12
|
+
*
|
|
13
|
+
* Coverage per product type, counted in Live SKUs as well as in tuples. Read
|
|
14
|
+
* the SKU figure: one tuple can carry a hundred thousand SKUs or one, so a
|
|
15
|
+
* corpus that resolved every rare tuple and none of the common ones reads as
|
|
16
|
+
* good coverage counted by tuple.
|
|
17
|
+
*
|
|
18
|
+
* A type in `completeness.authoringQueue` has no bar set, which is never the
|
|
19
|
+
* same as a bar it missed. Requires the `mg:read` scope.
|
|
20
|
+
*/
|
|
21
|
+
export declare const compositionReport: (transport: HttpTransport, signal?: AbortSignal) => Promise<CompositionCorpusSummary>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { resolveOperation } from "./operations.js";
|
|
2
|
+
/**
|
|
3
|
+
* THE QUESTION: "which product types can we answer that question for yet?"
|
|
4
|
+
*
|
|
5
|
+
* Coverage per product type, counted in Live SKUs as well as in tuples. Read
|
|
6
|
+
* the SKU figure: one tuple can carry a hundred thousand SKUs or one, so a
|
|
7
|
+
* corpus that resolved every rare tuple and none of the common ones reads as
|
|
8
|
+
* good coverage counted by tuple.
|
|
9
|
+
*
|
|
10
|
+
* A type in `completeness.authoringQueue` has no bar set, which is never the
|
|
11
|
+
* same as a bar it missed. Requires the `mg:read` scope.
|
|
12
|
+
*/
|
|
13
|
+
export const compositionReport = async (transport, signal) => await transport.requestJson(resolveOperation("get_composition_report"), { signal });
|