@instruments/materialgraph 0.29.0 → 0.31.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/brands-client.d.ts +1 -1
- package/by-colour-types.d.ts +4 -4
- package/catalogue-client.d.ts +3 -3
- package/catalogue-client.js +3 -3
- package/catalogue-types.d.ts +1 -1
- package/client-vocabulary.d.ts +3 -5
- package/client-vocabulary.js +9 -6
- package/client.d.ts +85 -174
- package/client.js +98 -211
- package/colour-region-types.d.ts +18 -0
- package/colours-client.d.ts +10 -83
- package/colours-client.js +1 -85
- package/errors.d.ts +1 -1
- package/errors.js +1 -0
- package/find-companions-types.d.ts +70 -0
- package/find-companions-types.js +12 -0
- package/find-variants-by-colour-types.d.ts +197 -0
- package/find-variants-by-vector-types.d.ts +67 -0
- package/find-variants-by-vector-types.js +5 -0
- package/get-variant-types.d.ts +50 -0
- package/get-variant-types.js +10 -0
- package/http-transport.d.ts +1 -1
- package/identifiers.d.ts +1 -1
- package/identifiers.js +1 -1
- package/image-reference-types.d.ts +18 -0
- package/index.d.ts +9 -7
- package/index.js +1 -1
- package/list-enum-values-types.d.ts +58 -0
- package/list-variants-types.d.ts +6 -2
- package/material-asset-types.d.ts +2 -2
- package/material-types.d.ts +13 -151
- package/operations.d.ts +1 -1
- package/operations.js +27 -88
- package/package.json +1 -1
- package/palette-search-types.d.ts +3 -49
- package/resolve-colour-types.d.ts +5 -5
- package/resolve-variant-types.d.ts +75 -0
- package/{identify-types.js → resolve-variant-types.js} +2 -2
- package/response-schemas.generated.d.ts +1 -1
- package/response-schemas.generated.js +46 -84
- package/run-types.d.ts +23 -216
- package/runs.d.ts +10 -58
- package/runs.js +19 -106
- package/schema-resource-types.d.ts +2 -139
- package/schema-resource-types.js +0 -8
- package/search-card-types.d.ts +1 -1
- package/search-index-plan-types.d.ts +6 -2
- package/search-request-types.d.ts +10 -2
- package/spec-types.d.ts +4 -4
- package/spec-types.js +2 -2
- package/specifications.d.ts +1 -9
- package/specifications.js +0 -12
- package/sse.d.ts +2 -2
- package/sse.js +2 -2
- package/types.d.ts +4 -38
- package/validation.d.ts +0 -74
- package/validation.js +2 -116
- package/webmcp.generated.js +9 -9
- package/workflows-client.d.ts +54 -0
- package/workflows-client.js +41 -0
- package/client-source-material-comments.d.ts +0 -51
- package/client-source-material-comments.js +0 -6
- package/codes-client.d.ts +0 -118
- package/codes-client.js +0 -99
- package/codes-types.d.ts +0 -325
- package/colour-aggregate-types.d.ts +0 -163
- package/coordinate-client.d.ts +0 -23
- package/coordinate-client.js +0 -13
- package/demand-batch-types.d.ts +0 -118
- package/demand-types.d.ts +0 -154
- package/identify-types.d.ts +0 -82
- package/material-composition-client.d.ts +0 -21
- package/material-composition-client.js +0 -13
- package/material-composition-types.d.ts +0 -403
- package/material-composition-types.js +0 -1
- package/source-material-validation.d.ts +0 -7
- package/source-material-validation.js +0 -214
- package/spec-facet-types.d.ts +0 -48
- package/spec-facet-types.js +0 -7
- package/substitute-types.d.ts +0 -102
- package/substitute-types.js +0 -1
- package/suggest-types.d.ts +0 -67
- package/suggest-types.js +0 -28
- package/taxonomy-coverage-types.d.ts +0 -34
- package/taxonomy-coverage-types.js +0 -1
- /package/{codes-types.js → colour-region-types.js} +0 -0
- /package/{colour-aggregate-types.js → find-variants-by-colour-types.js} +0 -0
- /package/{demand-batch-types.js → image-reference-types.js} +0 -0
- /package/{demand-types.js → list-enum-values-types.js} +0 -0
package/brands-client.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* A brand is a COMPANY, not a catalogue. Every count this read returns is
|
|
7
7
|
* coverage — what MaterialGraph has ingested — and never a claim about how
|
|
8
|
-
* many products the
|
|
8
|
+
* many products the brand sells.
|
|
9
9
|
*/
|
|
10
10
|
import type { BrandCatalogListPage, BrandsOptions } from "./brand-types.js";
|
|
11
11
|
import type { HttpTransport } from "./http-transport.js";
|
package/by-colour-types.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Wire types for the single-colour lane — GET `/api/v1/search/colours`.
|
|
3
3
|
*
|
|
4
|
-
* Kept out of `types.ts` for the same reason `palette-search-types.ts`
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* Kept out of `types.ts` for the same reason `palette-search-types.ts` is: the
|
|
5
|
+
* shared mirror is at its source-size budget. Same tolerant-parsing contract as
|
|
6
|
+
* the rest of the mirror — response enums are widened so a new server value
|
|
7
|
+
* still type-checks.
|
|
8
8
|
*/
|
|
9
9
|
import type { CorpusScope, CorpusScopeReceipt } from "./corpus-scope-types.js";
|
|
10
10
|
import type { VariantId } from "./identifiers.js";
|
package/catalogue-client.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CatalogDocumentList, CatalogPageListResult, CatalogProductReferenceReadResult, CatalogueChannelCollectionsResponse, CatalogueCollectionsOptions, CatalogueDocumentAccessResult, CataloguePageRepresentationReadResult, CatalogueReferenceBatchResponse } from "./catalogue-types.js";
|
|
2
2
|
import type { HttpTransport } from "./http-transport.js";
|
|
3
3
|
import type { VariantId } from "./identifiers.js";
|
|
4
|
-
import type {
|
|
4
|
+
import type { ResolveVariantInput, ResolveVariantOutput } from "./resolve-variant-types.js";
|
|
5
5
|
import type { SamplizeCatalogueOptions, SamplizeCataloguePage } from "./samplize-catalogue-types.js";
|
|
6
6
|
import type { SamplizeColorVecCache } from "./samplize-colorvec.js";
|
|
7
7
|
/** Catalogue publication operations inherited by the public SDK client. */
|
|
@@ -15,12 +15,12 @@ export declare class CatalogueClient {
|
|
|
15
15
|
* when there is no page to read.
|
|
16
16
|
*
|
|
17
17
|
* Exact and scoreless: a sibling colourway, a similar image or a brand match
|
|
18
|
-
* alone never identifies a variant. Read `
|
|
18
|
+
* alone never identifies a variant. Read `outcome` - `identified` names
|
|
19
19
|
* an exact stored variant, `placed` an exact brand with no variant match,
|
|
20
20
|
* `ambiguous` carries bounded `candidates`, and `unresolved` states why,
|
|
21
21
|
* never a guess. The submitted URL is never persisted.
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
resolveVariant(input: ResolveVariantInput, signal?: AbortSignal): Promise<ResolveVariantOutput>;
|
|
24
24
|
/** Complete producer-owned vectors and classifications for portable colour matching. */
|
|
25
25
|
samplizeColorVecCache(sourceVersion: string, signal?: AbortSignal): Promise<SamplizeColorVecCache>;
|
|
26
26
|
/** MG-owned full-catalogue facets and directional colour refinement before page limiting. */
|
package/catalogue-client.js
CHANGED
|
@@ -12,13 +12,13 @@ export class CatalogueClient {
|
|
|
12
12
|
* when there is no page to read.
|
|
13
13
|
*
|
|
14
14
|
* Exact and scoreless: a sibling colourway, a similar image or a brand match
|
|
15
|
-
* alone never identifies a variant. Read `
|
|
15
|
+
* alone never identifies a variant. Read `outcome` - `identified` names
|
|
16
16
|
* an exact stored variant, `placed` an exact brand with no variant match,
|
|
17
17
|
* `ambiguous` carries bounded `candidates`, and `unresolved` states why,
|
|
18
18
|
* never a guess. The submitted URL is never persisted.
|
|
19
19
|
*/
|
|
20
|
-
async
|
|
21
|
-
return await this.#transport.requestJson(resolveOperation("
|
|
20
|
+
async resolveVariant(input, signal) {
|
|
21
|
+
return await this.#transport.requestJson(resolveOperation("resolve_variant"), { body: input, signal });
|
|
22
22
|
}
|
|
23
23
|
/** Complete producer-owned vectors and classifications for portable colour matching. */
|
|
24
24
|
async samplizeColorVecCache(sourceVersion, signal) {
|
package/catalogue-types.d.ts
CHANGED
|
@@ -65,7 +65,7 @@ export interface CatalogueReference {
|
|
|
65
65
|
export type CatalogueReferenceAbsenceReason =
|
|
66
66
|
/**
|
|
67
67
|
* The registry retains no publication for the variant's brand. It says
|
|
68
|
-
* nothing about whether the
|
|
68
|
+
* nothing about whether the brand publishes one.
|
|
69
69
|
*/
|
|
70
70
|
"no_publication_on_record"
|
|
71
71
|
/** The edition is known but its document is not retained. */
|
package/client-vocabulary.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { HttpTransport } from "./http-transport.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ListEnumValuesOptions, ListEnumValuesResult } from "./list-enum-values-types.js";
|
|
3
|
+
import type { ListAttributesOptions, ListAttributesResult, ResolveColourOptions, ResolveColourResponse } from "./types.js";
|
|
3
4
|
export declare const resolveColour: (transport: HttpTransport, name: string, signal?: AbortSignal, options?: ResolveColourOptions) => Promise<ResolveColourResponse>;
|
|
4
|
-
export declare const suggestColour: (transport: HttpTransport, q: string, options?: {
|
|
5
|
-
limit?: number;
|
|
6
|
-
}, signal?: AbortSignal) => Promise<SuggestColourResponse>;
|
|
7
|
-
export declare const suggest: (transport: HttpTransport, q: string, options?: SuggestOptions, signal?: AbortSignal) => Promise<SuggestResponse>;
|
|
8
5
|
export declare const listAttributes: (transport: HttpTransport, options?: ListAttributesOptions, signal?: AbortSignal) => Promise<ListAttributesResult>;
|
|
6
|
+
export declare const listEnumValues: (transport: HttpTransport, options?: ListEnumValuesOptions, signal?: AbortSignal) => Promise<ListEnumValuesResult>;
|
package/client-vocabulary.js
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import { resolveOperation } from "./operations.js";
|
|
2
|
-
import { suggestQuery } from "./suggest-types.js";
|
|
3
2
|
export const resolveColour = async (transport, name, signal, options) => await transport.requestJson(resolveOperation("resolve_colour_name"), { query: { corpusScope: options?.corpusScope, name }, signal });
|
|
4
|
-
export const suggestColour = async (transport, q, options, signal) => await transport.requestJson(resolveOperation("suggest_colour_names"), { query: { limit: options?.limit, q }, signal });
|
|
5
|
-
export const suggest = async (transport, q, options, signal) => await transport.requestJson(resolveOperation("search_suggest"), {
|
|
6
|
-
query: suggestQuery(q, options),
|
|
7
|
-
signal,
|
|
8
|
-
});
|
|
9
3
|
/**
|
|
10
4
|
* A comma list, or nothing at all for an empty one. `[].join(",")` is `""`, and
|
|
11
5
|
* an absent parameter is the one honest spelling of "no restriction".
|
|
@@ -22,3 +16,12 @@ export const listAttributes = async (transport, options, signal) => await transp
|
|
|
22
16
|
},
|
|
23
17
|
signal,
|
|
24
18
|
});
|
|
19
|
+
export const listEnumValues = async (transport, options, signal) => await transport.requestJson(resolveOperation("catalog_list_enum_values"), {
|
|
20
|
+
query: {
|
|
21
|
+
cursor: options?.cursor,
|
|
22
|
+
dictionaryId: options?.dictionaryId,
|
|
23
|
+
limit: options?.limit,
|
|
24
|
+
query: options?.query,
|
|
25
|
+
},
|
|
26
|
+
signal,
|
|
27
|
+
});
|
package/client.d.ts
CHANGED
|
@@ -5,26 +5,26 @@ import { CatalogueClient } from "./catalogue-client.js";
|
|
|
5
5
|
import { CategoriesClient } from "./categories-client.js";
|
|
6
6
|
import type { ResolvedVerdictCitation } from "./citation-types.js";
|
|
7
7
|
import type { MaterialGraphClientOptions } from "./client-config.js";
|
|
8
|
-
import type { SourceMaterialCommentsNamespace } from "./client-source-material-comments.js";
|
|
9
|
-
import { CodesClient } from "./codes-client.js";
|
|
10
|
-
import type { CodeAdvisoryInput, CodeAdvisoryResponse } from "./codes-types.js";
|
|
11
8
|
import { ColoursClient } from "./colours-client.js";
|
|
12
9
|
import type { RateLimit } from "./errors.js";
|
|
13
|
-
import type {
|
|
10
|
+
import type { FindCompanionsInput, FindCompanionsOutput } from "./find-companions-types.js";
|
|
11
|
+
import type { FindVariantsByColourInput, FindVariantsByColourOutput } from "./find-variants-by-colour-types.js";
|
|
12
|
+
import type { FindVariantsByVectorInput, FindVariantsByVectorOutput } from "./find-variants-by-vector-types.js";
|
|
13
|
+
import type { GetVariantOptions, GetVariantOutput } from "./get-variant-types.js";
|
|
14
|
+
import type { VariantId } from "./identifiers.js";
|
|
15
|
+
import type { ListEnumValuesOptions, ListEnumValuesResult } from "./list-enum-values-types.js";
|
|
14
16
|
import type { ListVariantFacetsInput, ListVariantFacetsOutput } from "./list-variant-facets-types.js";
|
|
15
17
|
import type { ListVariantsInput, ListVariantsOutput } from "./list-variants-types.js";
|
|
16
18
|
import type { MatchStreamEvent } from "./match-stream-types.js";
|
|
17
19
|
import type { MatchAnswer, MatchInput } from "./match-types.js";
|
|
18
20
|
import type { ListVariantAssetsOptions, MaterialDocumentPageOptions, VariantAssetPage } from "./material-asset-types.js";
|
|
19
|
-
import type { CompositionCorpusSummary } from "./material-composition-types.js";
|
|
20
21
|
import type { MaterialQueryPlan } from "./material-query-plan-types.js";
|
|
21
|
-
import type {
|
|
22
|
+
import type { SourceMaterialBatchReceipt, UploadSourceMaterialInput } from "./run-types.js";
|
|
22
23
|
import type { SchemaResource, SchemaResourceResponse } from "./schema-resource-types.js";
|
|
23
24
|
import type { CardProjectionRequest, SearchCardResponse } from "./search-card-types.js";
|
|
24
|
-
import type {
|
|
25
|
-
import
|
|
25
|
+
import type { ExtractPaletteInput, ExtractPaletteResponse, ListAttributesOptions, ListAttributesResult, PairingsOptions, PairingsResponse, ResolveColourOptions, ResolveColourResponse, SearchGetParams, SearchInput, SearchResponse, WhoamiResponse } from "./types.js";
|
|
26
|
+
import { WorkflowsClient } from "./workflows-client.js";
|
|
26
27
|
export * from "./client-config.js";
|
|
27
|
-
export type { SourceMaterialCommentsNamespace } from "./client-source-material-comments.js";
|
|
28
28
|
/**
|
|
29
29
|
* The MaterialGraph client — every lens on the graph, on one object.
|
|
30
30
|
*
|
|
@@ -34,16 +34,15 @@ export type { SourceMaterialCommentsNamespace } from "./client-source-material-c
|
|
|
34
34
|
* | The question | The lens |
|
|
35
35
|
* | --- | --- |
|
|
36
36
|
* | "find me something like this / matching these words" | {@link MaterialGraphClient.search} |
|
|
37
|
+
* | "tell me about THIS variant" | {@link MaterialGraphClient.getVariant} |
|
|
37
38
|
* | "what's IN this photo?" | {@link MaterialGraphClient.match} / {@link MaterialGraphClient.matchStream} |
|
|
38
39
|
* | "which materials, from anyone, meet this hard spec?" | {@link MaterialGraphClient.listVariants} |
|
|
39
|
-
* | "what's near this colour / this palette
|
|
40
|
-
* | "what goes with THIS material?" | {@link MaterialGraphClient.pairings}, {@link MaterialGraphClient.listVariants} (same product, other colourways)
|
|
40
|
+
* | "what's near this colour / this palette?" | {@link MaterialGraphClient.byColour}, `colours.palette()` |
|
|
41
|
+
* | "what goes with THIS material?" | {@link MaterialGraphClient.pairings}, {@link MaterialGraphClient.listVariants} (same product, other colourways) |
|
|
41
42
|
* | "what does the manufacturer say is AVAILABLE on this?" | {@link MaterialGraphClient.associatedFinishes}, {@link MaterialGraphClient.associatedProducts} |
|
|
42
|
-
* | "
|
|
43
|
-
* | "is this allowed in an A-2 corridor?" | `codes.*` |
|
|
44
|
-
* | "what can I even ask for?" | {@link MaterialGraphClient.specificationFacets}, `categories.list()` |
|
|
43
|
+
* | "what can I even ask for?" | {@link MaterialGraphClient.listVariantFacets}, `categories.list()` |
|
|
45
44
|
* | "what is this word called here?" | {@link MaterialGraphClient.listAttributes} |
|
|
46
|
-
* | "do the whole job for me, async" |
|
|
45
|
+
* | "do the whole job for me, async" | `workflows.start()` + `mg:compose` |
|
|
47
46
|
*
|
|
48
47
|
* Three structural rules that fall out of that table:
|
|
49
48
|
* - **Colour is a separate lens.** {@link MaterialGraphClient.search} matches
|
|
@@ -78,35 +77,25 @@ export declare class MaterialGraphClient extends CatalogueClient {
|
|
|
78
77
|
*/
|
|
79
78
|
readonly categories: CategoriesClient;
|
|
80
79
|
/**
|
|
81
|
-
* THE QUESTION: "
|
|
82
|
-
*
|
|
83
|
-
* discovers the vocabulary, `codes.requirements()` states a space,
|
|
84
|
-
* `codes.advisory()` badges candidates.
|
|
85
|
-
*
|
|
86
|
-
* Instead use {@link MaterialGraphClient.listVariants} to find materials by a
|
|
87
|
-
* classification you already know you need; codes is what tells you WHICH one
|
|
88
|
-
* the space demands. ADVISORY ONLY: model code as adopted, never a
|
|
89
|
-
* determination for an authority having jurisdiction.
|
|
90
|
-
*/
|
|
91
|
-
readonly codes: CodesClient;
|
|
92
|
-
/**
|
|
93
|
-
* THE QUESTION: "what colours exist here?" (`profiles`, `stats`) and "what
|
|
94
|
-
* matches this whole SET of colours?" (`palette`, `gradient`).
|
|
80
|
+
* THE QUESTION: "what colours exist here?" and "what matches this whole SET
|
|
81
|
+
* of colours?" (`palette`).
|
|
95
82
|
*
|
|
96
83
|
* Instead use {@link MaterialGraphClient.byColour} for ONE colour and
|
|
97
84
|
* {@link MaterialGraphClient.listVariants} to page through a colour's family.
|
|
98
85
|
* Colour is usually derived from product imagery, which is visual likeness,
|
|
99
|
-
* not a colour specification. A
|
|
86
|
+
* not a colour specification. A brand's declared colour, such as a paint's
|
|
100
87
|
* published hex, wins where MaterialGraph holds one, and each value's
|
|
101
88
|
* source basis says which.
|
|
102
89
|
*/
|
|
103
90
|
readonly colours: ColoursClient;
|
|
104
91
|
/**
|
|
105
|
-
* THE QUESTION: "
|
|
106
|
-
*
|
|
107
|
-
*
|
|
92
|
+
* THE QUESTION: "do a whole job for me" — the ASYNC lens. `start()` begins a
|
|
93
|
+
* Run of one registered workflow, `run()` polls it, `streamRunEvents()` and
|
|
94
|
+
* `drainRunEvents()` follow it live. Everything else on this client answers
|
|
95
|
+
* in one round trip; a Run may suspend for human input and finish minutes
|
|
96
|
+
* later. Replaces the flat `createRun()` / `run()` family, with no shim.
|
|
108
97
|
*/
|
|
109
|
-
readonly
|
|
98
|
+
readonly workflows: WorkflowsClient;
|
|
110
99
|
constructor(options: MaterialGraphClientOptions);
|
|
111
100
|
get lastRateLimit(): RateLimit | null;
|
|
112
101
|
/**
|
|
@@ -184,7 +173,7 @@ export declare class MaterialGraphClient extends CatalogueClient {
|
|
|
184
173
|
* palette), ranked by OKLab closeness to colour extracted from product imagery.
|
|
185
174
|
*
|
|
186
175
|
* Instead use `colours.palette()` for N colours at stated proportions (a
|
|
187
|
-
* different ranking, not a wrapper),
|
|
176
|
+
* different ranking, not a wrapper),
|
|
188
177
|
* {@link MaterialGraphClient.resolveColour} first if you hold a NAME,
|
|
189
178
|
* {@link MaterialGraphClient.listVariants} to page through a category or a brand, and
|
|
190
179
|
* {@link MaterialGraphClient.search} when colour is one signal among many.
|
|
@@ -193,36 +182,30 @@ export declare class MaterialGraphClient extends CatalogueClient {
|
|
|
193
182
|
*/
|
|
194
183
|
byColour(params: ByColourParams, signal?: AbortSignal): Promise<ByColourResponse>;
|
|
195
184
|
/**
|
|
196
|
-
* THE QUESTION: "tell me
|
|
197
|
-
* `/api/v1/
|
|
185
|
+
* THE QUESTION: "tell me about THIS variant" (GET
|
|
186
|
+
* `/api/v1/variants/{variantId}`, `get_variant`).
|
|
198
187
|
*
|
|
199
188
|
* The hinge of the API: every relationship lens
|
|
200
|
-
* ({@link MaterialGraphClient.listVariants}, {@link MaterialGraphClient.pairings}
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
*
|
|
207
|
-
*
|
|
189
|
+
* ({@link MaterialGraphClient.listVariants}, {@link MaterialGraphClient.pairings})
|
|
190
|
+
* hangs off a `variantId`. The answer is compact on purpose: name, code,
|
|
191
|
+
* product, brand, category, image and page. Name `attributes` and `blocks`
|
|
192
|
+
* to add their values under `specifications`; a null value is unknown, never
|
|
193
|
+
* false or zero. Instead use {@link MaterialGraphClient.listVariants} for many
|
|
194
|
+
* ids, or for the other colourways of the same product (ask `listVariants`
|
|
195
|
+
* with a `product in` filter),
|
|
196
|
+
* {@link MaterialGraphClient.materialBlocks} to tell "no value" from "not
|
|
197
|
+
* checked", {@link MaterialGraphClient.search} when you have no id yet.
|
|
208
198
|
*
|
|
209
199
|
* @param variantId Opaque — pass back exactly what you were given.
|
|
210
200
|
*/
|
|
211
|
-
|
|
201
|
+
getVariant(variantId: VariantId, options?: GetVariantOptions, signal?: AbortSignal): Promise<GetVariantOutput>;
|
|
212
202
|
materialBlocks(variantId: VariantId, signal?: AbortSignal): Promise<import("./material-block-types.js").MaterialBlockProjection>;
|
|
213
|
-
/**
|
|
214
|
-
* THE QUESTION: "which product types can composition be answered for yet?"
|
|
215
|
-
*
|
|
216
|
-
* Coverage per product type, in Live SKUs as well as tuples. Read the SKU
|
|
217
|
-
* figure: one tuple can carry a hundred thousand SKUs or one.
|
|
218
|
-
*/
|
|
219
|
-
compositionReport(signal?: AbortSignal): Promise<CompositionCorpusSummary>;
|
|
220
203
|
listVariantAssets(variantId: VariantId, options?: ListVariantAssetsOptions, signal?: AbortSignal): Promise<VariantAssetPage>;
|
|
221
204
|
materialDocuments(variantId: VariantId, options?: MaterialDocumentPageOptions, signal?: AbortSignal): Promise<import("./material-asset-types.js").MaterialDocumentPage>;
|
|
222
205
|
/**
|
|
223
206
|
* THE QUESTION: "what does the schema DEFINE?" — the governed static registry.
|
|
224
207
|
*
|
|
225
|
-
* Definitions, not data: use {@link MaterialGraphClient.
|
|
208
|
+
* Definitions, not data: use {@link MaterialGraphClient.listVariantFacets} for
|
|
226
209
|
* what the corpus actually holds.
|
|
227
210
|
*/
|
|
228
211
|
schema<K extends SchemaResource>(resource: K, signal?: AbortSignal): Promise<SchemaResourceResponse<K>>;
|
|
@@ -230,8 +213,7 @@ export declare class MaterialGraphClient extends CatalogueClient {
|
|
|
230
213
|
* THE QUESTION: "what goes WITH this material?" — the companionship rail, hung
|
|
231
214
|
* off one resolved material (GET `/api/v1/materials/{variantId}/pairings`).
|
|
232
215
|
*
|
|
233
|
-
* Instead use {@link MaterialGraphClient.
|
|
234
|
-
* picks, {@link MaterialGraphClient.listVariants} for the same product in
|
|
216
|
+
* Instead use {@link MaterialGraphClient.listVariants} for the same product in
|
|
235
217
|
* another colour, and `search({ similarTo })` for a LIKE-THIS substitute —
|
|
236
218
|
* similar and complementary are opposite questions.
|
|
237
219
|
*
|
|
@@ -254,10 +236,11 @@ export declare class MaterialGraphClient extends CatalogueClient {
|
|
|
254
236
|
* of a product (`{terms: [{field: "product", op: "in", values:
|
|
255
237
|
* [productId]}, {field: "variant", op: "not_in", values: [variantId]}]}` —
|
|
256
238
|
* `filters` is kind-grouped, `{terms, numbers, presence}`, every condition
|
|
257
|
-
* across all three ANDed), or a category/
|
|
239
|
+
* across all three ANDed), or a category/brand listing. An explicit
|
|
258
240
|
* `variant in` id that does not resolve to an eligible variant is
|
|
259
|
-
* reported in `unresolvedVariantIds`,
|
|
260
|
-
*
|
|
241
|
+
* reported in `unresolvedVariantIds`, or in `excludedByCorpusScope` when
|
|
242
|
+
* it names a real variant outside the materials catalogue, never silently
|
|
243
|
+
* dropped from the page.
|
|
261
244
|
*
|
|
262
245
|
* `filters`/`optionalFilters`/`orderBy` are sent as URL-encoded JSON;
|
|
263
246
|
* `attributes`/`include` as comma-separated lists — the server validates,
|
|
@@ -272,14 +255,40 @@ export declare class MaterialGraphClient extends CatalogueClient {
|
|
|
272
255
|
* `listVariants()` takes; the server validates both.
|
|
273
256
|
*/
|
|
274
257
|
listVariantFacets(input: ListVariantFacetsInput, signal?: AbortSignal): Promise<ListVariantFacetsOutput>;
|
|
258
|
+
/**
|
|
259
|
+
* THE QUESTION: "which variants hold, resemble, or can be ranked by, this
|
|
260
|
+
* colour?" (POST `/api/v1/variants/by-colour`, MG-2217/MG-2230/MG-2247).
|
|
261
|
+
* One required `mode`: `contains` (a swatch for every required `colours[]`
|
|
262
|
+
* condition), `palette` (whole-palette closeness to `colours[]`, an
|
|
263
|
+
* image's extracted palette, or `targetVariantId`'s own palette) or
|
|
264
|
+
* `rerank` (reorder a held `variantIds` set by colour closeness). Use
|
|
265
|
+
* {@link MaterialGraphClient.byColour} instead for ONE colour against the
|
|
266
|
+
* search index rather than the canonical variant graph.
|
|
267
|
+
*/
|
|
268
|
+
findVariantsByColour(input: FindVariantsByColourInput, signal?: AbortSignal): Promise<FindVariantsByColourOutput>;
|
|
269
|
+
/**
|
|
270
|
+
* THE QUESTION: "what did designers sample together with these?" (POST
|
|
271
|
+
* `/api/v1/variants/companions`, MG-2332). Give `variantIds` and/or
|
|
272
|
+
* `materials` (free-text names, one variant each, at most twelve together);
|
|
273
|
+
* companions come back strongest first, each with its `lift`,
|
|
274
|
+
* `seedMatchCount`, `relation` and a one-line `reason`. `projectType` reads one
|
|
275
|
+
* sector; `include` adds `image` and `colour` fields a lean page leaves out.
|
|
276
|
+
* A sample order shows sampling, never specification. Read `unresolved`
|
|
277
|
+
* before presenting: a scheme of four that resolved two is a different claim.
|
|
278
|
+
*/
|
|
279
|
+
findCompanions(input: FindCompanionsInput, signal?: AbortSignal): Promise<FindCompanionsOutput>;
|
|
280
|
+
/**
|
|
281
|
+
* THE QUESTION: "what looks or feels like this?" (POST
|
|
282
|
+
* `/api/v1/variants/by-vector`, MG-2231). Eligible variants ranked by
|
|
283
|
+
* semantic or visual similarity to a text description (mood words count),
|
|
284
|
+
* an image reference, or both fused into one embedding. `filters` is the
|
|
285
|
+
* same tree {@link MaterialGraphClient.listVariants} takes. `query.mode`
|
|
286
|
+
* values other than `"text"` embed through Voyage and spend the shared
|
|
287
|
+
* per-key `embed` rate budget.
|
|
288
|
+
*/
|
|
289
|
+
findVariantsByVector(input: FindVariantsByVectorInput, signal?: AbortSignal): Promise<FindVariantsByVectorOutput>;
|
|
275
290
|
/** Resolve a colour name to its hex, and the named paint's catalogue variant. */
|
|
276
291
|
resolveColour(name: string, signal?: AbortSignal, options?: ResolveColourOptions): Promise<ResolveColourResponse>;
|
|
277
|
-
/** Ranked colour-name typeahead (GET `/api/v1/search/colours/suggest`). */
|
|
278
|
-
suggestColour(q: string, options?: {
|
|
279
|
-
limit?: number;
|
|
280
|
-
}, signal?: AbortSignal): Promise<SuggestColourResponse>;
|
|
281
|
-
/** Entity typeahead. Navigate using the selected `refId`; use `search()` for materials. */
|
|
282
|
-
suggest(q: string, options?: SuggestOptions, signal?: AbortSignal): Promise<SuggestResponse>;
|
|
283
292
|
/**
|
|
284
293
|
* THE QUESTION: "which attribute means this phrase?" or "what could a
|
|
285
294
|
* <category> be specified by?" (GET `/api/v1/catalog/attributes`). One page of
|
|
@@ -291,67 +300,22 @@ export declare class MaterialGraphClient extends CatalogueClient {
|
|
|
291
300
|
*/
|
|
292
301
|
listAttributes(options?: ListAttributesOptions, signal?: AbortSignal): Promise<ListAttributesResult>;
|
|
293
302
|
/**
|
|
294
|
-
*
|
|
295
|
-
*
|
|
296
|
-
*
|
|
303
|
+
* THE QUESTION: "which value means this phrase?" or "what may this attribute
|
|
304
|
+
* be set to?" (GET `/api/v1/catalog/enum-values`). One page of a value
|
|
305
|
+
* dictionary's allowed values, browsed by `dictionaryId` (from a
|
|
306
|
+
* {@link MaterialGraphClient.listAttributes} item) or found by name, alias,
|
|
307
|
+
* misspelling or meaning across every dictionary. Pass an item's `valueId`
|
|
308
|
+
* with one of its `attributeIds` to {@link MaterialGraphClient.listVariants};
|
|
309
|
+
* an item with no `attributeIds` cannot be filtered on. Follow
|
|
310
|
+
* `pageInfo.endCursor` for the next page.
|
|
297
311
|
*/
|
|
298
|
-
|
|
312
|
+
listEnumValues(options?: ListEnumValuesOptions, signal?: AbortSignal): Promise<ListEnumValuesResult>;
|
|
299
313
|
/**
|
|
300
314
|
* THE QUESTION: "what is this key allowed to do?" Check `scopes` before
|
|
301
315
|
* offering a capability: the write surfaces need `mg:ingest` / `mg:compose`,
|
|
302
316
|
* and `mg:admin` unlocks extra evidence fields.
|
|
303
317
|
*/
|
|
304
318
|
whoami(signal?: AbortSignal): Promise<WhoamiResponse>;
|
|
305
|
-
/** What completes a scheme already part-chosen. See {@link coordinateCall}. */
|
|
306
|
-
coordinate(input: CoordinateInput, signal?: AbortSignal): Promise<CoordinateResponse>;
|
|
307
|
-
/**
|
|
308
|
-
* THE QUESTION: "how much is this material actually specified, and what gets
|
|
309
|
-
* specified alongside it?" — real order behaviour, trailing 36 months.
|
|
310
|
-
*
|
|
311
|
-
* Instead use {@link MaterialGraphClient.demandBatch} for many ids (this one
|
|
312
|
-
* also resolves free text, which the batch deliberately does not) and
|
|
313
|
-
* {@link MaterialGraphClient.pairings} for a presentable rail. A null `demand`
|
|
314
|
-
* means UNREAD, never zero. Provide EXACTLY ONE of `variantId` or `material`.
|
|
315
|
-
*/
|
|
316
|
-
demand(params: DemandParams, signal?: AbortSignal): Promise<DemandResponse>;
|
|
317
|
-
/**
|
|
318
|
-
* THE QUESTION: "for each of these picks I already hold, how much momentum does
|
|
319
|
-
* it have?" Enrichment, never discovery or ranking. Instead use
|
|
320
|
-
* {@link MaterialGraphClient.demand} for one material named in free text and
|
|
321
|
-
* {@link MaterialGraphClient.search} to find candidates at all. Only
|
|
322
|
-
* `state: "available"` carries numbers; the other three mean "no number", never
|
|
323
|
-
* "no demand".
|
|
324
|
-
*
|
|
325
|
-
* Enrich a bounded set of ALREADY-CHOSEN candidate ids with their real
|
|
326
|
-
* specification demand (POST `/api/v1/demand/batch`, 1–48 ids). The bounded
|
|
327
|
-
* batch complement to {@link demand}: no fuzzy resolution, ranking, or
|
|
328
|
-
* reordering — each id yields one discriminated `state` (`available` /
|
|
329
|
-
* `insufficient_data` / `no_signal` / `unknown_variant`) in input order and
|
|
330
|
-
* cardinality. This is the Desk's "show demand momentum for every pick in this
|
|
331
|
-
* scheme" read; an `mg:admin` key additionally sees per-result `evidence`.
|
|
332
|
-
*
|
|
333
|
-
* @example
|
|
334
|
-
* // Rank a shortlist by real specification momentum before locking the scheme.
|
|
335
|
-
* const { results } = await mg.demandBatch({
|
|
336
|
-
* variantIds: scheme.picks.map((p) => p.variantId),
|
|
337
|
-
* signal: "sampled",
|
|
338
|
-
* context: { projectType: "hospitality" },
|
|
339
|
-
* });
|
|
340
|
-
* const rising = results.filter(
|
|
341
|
-
* (r) => r.state === "available" && r.momentum.state === "rising",
|
|
342
|
-
* );
|
|
343
|
-
*/
|
|
344
|
-
demandBatch(input: DemandBatchInput, signal?: AbortSignal): Promise<DemandBatchResponse>;
|
|
345
|
-
/**
|
|
346
|
-
* THE QUESTION: "may I put these materials in an A-2 corridor in Texas?"
|
|
347
|
-
*
|
|
348
|
-
* Badge materials against the advisory building-code registry (POST
|
|
349
|
-
* `/api/v1/codes/advisory`). Identical to {@link CodesClient.advisory}, kept
|
|
350
|
-
* flat because it shipped before the `codes` namespace existed — prefer
|
|
351
|
-
* `mg.codes.advisory()` in new code, and start at `mg.codes.context()` to
|
|
352
|
-
* discover every accepted context value. `unverified` is not a pass.
|
|
353
|
-
*/
|
|
354
|
-
codeAdvisory(input: CodeAdvisoryInput, signal?: AbortSignal): Promise<CodeAdvisoryResponse>;
|
|
355
319
|
/**
|
|
356
320
|
* THE QUESTION: "what colours are in this image?" — the palette only, no
|
|
357
321
|
* materials. The bridge from an inspiration image into the colour lens: extract
|
|
@@ -360,68 +324,15 @@ export declare class MaterialGraphClient extends CatalogueClient {
|
|
|
360
324
|
* {@link MaterialGraphClient.match} for the MATERIALS in the photo.
|
|
361
325
|
*/
|
|
362
326
|
extractPalette(input: ExtractPaletteInput, signal?: AbortSignal): Promise<ExtractPaletteResponse>;
|
|
363
|
-
/**
|
|
364
|
-
* THE QUESTION: "what can I even filter on, and what values does the corpus
|
|
365
|
-
* actually hold?" The start of every spec-driven workflow. Instead use
|
|
366
|
-
* {@link MaterialGraphClient.listAttributes} with `categoryIds` for what a
|
|
367
|
-
* product type COULD carry, {@link MaterialGraphClient.schema} for the definition.
|
|
368
|
-
*
|
|
369
|
-
* Discover the live specification vocabulary (GET
|
|
370
|
-
* `/api/v1/catalog/specifications/facets`) — the facetable spec attributes that
|
|
371
|
-
* have real product-graph data, each with its top canonical values and the
|
|
372
|
-
* variants/brands behind them. This is where a caller LEARNS that the data
|
|
373
|
-
* exists: LEED, GREENGUARD, ASTM E84 Class A, FloorScore, EPDs all surface here
|
|
374
|
-
* with counts. Includes the virtual `certification_programme` facet (its values
|
|
375
|
-
* are programme names). Learn an `attribute:value` here, then reuse it as a
|
|
376
|
-
* {@link MaterialGraphClient.listVariants} filter leaf or a {@link search}
|
|
377
|
-
* `filters` entry. NOTE: continuous
|
|
378
|
-
* numeric specs (e.g. `slip_resistance_dcof`, a 0–1 DCOF range) are NOT
|
|
379
|
-
* token-facetable and do not appear here — read those per-attribute.
|
|
380
|
-
*/
|
|
381
|
-
specificationFacets(signal?: AbortSignal): Promise<SpecFacetsListResponse>;
|
|
382
327
|
/** "Whose catalogs are in here, and how big is each?" — {@link listBrands}. */
|
|
383
328
|
brands(options?: BrandsOptions, signal?: AbortSignal): Promise<import("./brand-types.js").BrandCatalogListPage>;
|
|
384
329
|
/**
|
|
385
330
|
* Upload one atomic source-material batch (POST `/api/v1/source-material`,
|
|
386
331
|
* multipart). Pass a heterogeneous pile via `{ files }` (any mix of PDF,
|
|
387
|
-
* text/markdown, and images — the server classifies each)
|
|
388
|
-
* `
|
|
332
|
+
* text/markdown, and images — the server classifies each). Requires the
|
|
333
|
+
* `mg:source` scope, which a `source`, `ingest` or `admin` key carries.
|
|
389
334
|
*/
|
|
390
335
|
uploadSourceMaterial(input: UploadSourceMaterialInput, signal?: AbortSignal): Promise<SourceMaterialBatchReceipt>;
|
|
391
|
-
/**
|
|
392
|
-
* Read back an uploaded batch (GET `/api/v1/source-material/{batchId}`): every
|
|
393
|
-
* file with a fetchable `url` and its analyses inlined. `analyses` is always
|
|
394
|
-
* an array — `[]` means nothing has been computed yet. Analyses are shared by
|
|
395
|
-
* content hash, so re-uploading an already-analysed image returns its analysis
|
|
396
|
-
* immediately. A batch you do not own raises the same 404 as one that does not
|
|
397
|
-
* exist. Requires the `mg:compose` scope.
|
|
398
|
-
*/
|
|
399
|
-
sourceMaterialBatch(batchId: BatchId, signal?: AbortSignal): Promise<SourceMaterialBatchDetail>;
|
|
400
|
-
/**
|
|
401
|
-
* THE QUESTION: "do a whole job for me" — the ASYNC lens. Everything else here
|
|
402
|
-
* answers in one round trip; a Run may suspend for human input and finish
|
|
403
|
-
* minutes later. Follow with {@link MaterialGraphClient.streamRunEvents} (live)
|
|
404
|
-
* or {@link MaterialGraphClient.run} (poll). Pass `idempotencyKey` so a retry
|
|
405
|
-
* replays rather than duplicates.
|
|
406
|
-
*/
|
|
407
|
-
createRun(body: CreatePublicRunRequest, signal?: AbortSignal): Promise<CreatePublicRunResponse>;
|
|
408
|
-
/**
|
|
409
|
-
* THE QUESTION: "where has this Run got to?" — the caller-owned, redacted
|
|
410
|
-
* ledger record. Polling; prefer {@link MaterialGraphClient.streamRunEvents}
|
|
411
|
-
* when a human is waiting.
|
|
412
|
-
*/
|
|
413
|
-
run(runId: RunId, signal?: AbortSignal): Promise<PublicRunResponse>;
|
|
414
336
|
/** Follow a verdict cell's citation handle to its canonical claim source. */
|
|
415
337
|
citation(citationId: string, signal?: AbortSignal): Promise<ResolvedVerdictCitation>;
|
|
416
|
-
/**
|
|
417
|
-
* Stream ordered Run events as an async iterator (GET
|
|
418
|
-
* `/api/v1/runs/{runId}/events`, SSE). Iterates until the stream ends or the
|
|
419
|
-
* signal aborts; pass `after` to resume from the last observed sequence.
|
|
420
|
-
*/
|
|
421
|
-
streamRunEvents(runId: RunId, options?: StreamRunEventsOptions): AsyncGenerator<RunEvent>;
|
|
422
|
-
/**
|
|
423
|
-
* Collect Run events until a terminal event, the deadline, or the stream ends
|
|
424
|
-
* — the bounded events-log pattern (a single pass over {@link streamRunEvents}).
|
|
425
|
-
*/
|
|
426
|
-
drainRunEvents(runId: RunId, options: DrainRunEventsOptions): Promise<RunEvent[]>;
|
|
427
338
|
}
|