@instruments/materialgraph 0.30.0 → 0.32.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/client.d.ts +14 -43
- package/client.js +14 -45
- 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/http-transport.d.ts +1 -1
- package/index.d.ts +1 -3
- package/index.js +0 -1
- package/material-types.d.ts +2 -1
- package/ndjson.d.ts +1 -1
- package/ndjson.js +1 -1
- package/operations.d.ts +1 -1
- package/operations.js +1 -1
- package/package.json +1 -1
- package/response-schemas.generated.d.ts +1 -1
- package/response-schemas.generated.js +31 -39
- package/search-index-plan-types.d.ts +2 -1
- package/search-result-validation.d.ts +0 -2
- package/search-result-validation.js +1 -17
- package/specifications.d.ts +1 -9
- package/specifications.js +0 -12
- package/types.d.ts +2 -63
- package/validation.d.ts +0 -88
- package/validation.js +2 -154
- package/webmcp.generated.js +7 -8
- package/match-stream-types.d.ts +0 -306
- package/match-stream-types.js +0 -65
- package/match-stream.d.ts +0 -22
- package/match-stream.js +0 -308
- package/match-types.d.ts +0 -138
- package/match-types.js +0 -1
package/client.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import type { ResolvedVerdictCitation } from "./citation-types.js";
|
|
|
7
7
|
import type { MaterialGraphClientOptions } from "./client-config.js";
|
|
8
8
|
import { ColoursClient } from "./colours-client.js";
|
|
9
9
|
import type { RateLimit } from "./errors.js";
|
|
10
|
+
import type { FindCompanionsInput, FindCompanionsOutput } from "./find-companions-types.js";
|
|
10
11
|
import type { FindVariantsByColourInput, FindVariantsByColourOutput } from "./find-variants-by-colour-types.js";
|
|
11
12
|
import type { FindVariantsByVectorInput, FindVariantsByVectorOutput } from "./find-variants-by-vector-types.js";
|
|
12
13
|
import type { GetVariantOptions, GetVariantOutput } from "./get-variant-types.js";
|
|
@@ -14,8 +15,6 @@ import type { VariantId } from "./identifiers.js";
|
|
|
14
15
|
import type { ListEnumValuesOptions, ListEnumValuesResult } from "./list-enum-values-types.js";
|
|
15
16
|
import type { ListVariantFacetsInput, ListVariantFacetsOutput } from "./list-variant-facets-types.js";
|
|
16
17
|
import type { ListVariantsInput, ListVariantsOutput } from "./list-variants-types.js";
|
|
17
|
-
import type { MatchStreamEvent } from "./match-stream-types.js";
|
|
18
|
-
import type { MatchAnswer, MatchInput } from "./match-types.js";
|
|
19
18
|
import type { ListVariantAssetsOptions, MaterialDocumentPageOptions, VariantAssetPage } from "./material-asset-types.js";
|
|
20
19
|
import type { MaterialQueryPlan } from "./material-query-plan-types.js";
|
|
21
20
|
import type { SourceMaterialBatchReceipt, UploadSourceMaterialInput } from "./run-types.js";
|
|
@@ -34,7 +33,6 @@ export * from "./client-config.js";
|
|
|
34
33
|
* | --- | --- |
|
|
35
34
|
* | "find me something like this / matching these words" | {@link MaterialGraphClient.search} |
|
|
36
35
|
* | "tell me about THIS variant" | {@link MaterialGraphClient.getVariant} |
|
|
37
|
-
* | "what's IN this photo?" | {@link MaterialGraphClient.match} / {@link MaterialGraphClient.matchStream} |
|
|
38
36
|
* | "which materials, from anyone, meet this hard spec?" | {@link MaterialGraphClient.listVariants} |
|
|
39
37
|
* | "what's near this colour / this palette?" | {@link MaterialGraphClient.byColour}, `colours.palette()` |
|
|
40
38
|
* | "what goes with THIS material?" | {@link MaterialGraphClient.pairings}, {@link MaterialGraphClient.listVariants} (same product, other colourways) |
|
|
@@ -106,7 +104,7 @@ export declare class MaterialGraphClient extends CatalogueClient {
|
|
|
106
104
|
* (ranking would be noise), {@link MaterialGraphClient.byColour} /
|
|
107
105
|
* `colours.palette()` for visual colour intent (`text` matches WORDS — "sage
|
|
108
106
|
* green" finds materials that SAY sage, not ones that look it),
|
|
109
|
-
* {@link MaterialGraphClient.
|
|
107
|
+
* {@link MaterialGraphClient.pairings}
|
|
110
108
|
* for what goes WITH something, {@link MaterialGraphClient.suggest} for typeahead.
|
|
111
109
|
*
|
|
112
110
|
* The full POST search primitive. `input.filters` are hard token sets on
|
|
@@ -129,44 +127,6 @@ export declare class MaterialGraphClient extends CatalogueClient {
|
|
|
129
127
|
view: "card";
|
|
130
128
|
}, signal?: AbortSignal): Promise<SearchCardResponse>;
|
|
131
129
|
searchGet(params: SearchGetParams, signal?: AbortSignal): Promise<SearchResponse>;
|
|
132
|
-
/**
|
|
133
|
-
* THE QUESTION: "what materials are in this PHOTO?" — Material Match classifies
|
|
134
|
-
* the image, decomposes it into surfaces, and answers each one.
|
|
135
|
-
*
|
|
136
|
-
* Instead use {@link MaterialGraphClient.matchStream} whenever a human is
|
|
137
|
-
* watching, {@link MaterialGraphClient.search} with `image` for ONE ranked list
|
|
138
|
-
* rather than a per-surface decomposition, and
|
|
139
|
-
* {@link MaterialGraphClient.extractPalette} for the image's colours only.
|
|
140
|
-
*
|
|
141
|
-
* Exactly one of `imageBase64`, `imageUrl` or `vector`. Read `qualityFloor` and
|
|
142
|
-
* `droppedBelowFloor` before reporting an empty result: "nothing was good
|
|
143
|
-
* enough" and "nothing was found" are different answers.
|
|
144
|
-
*/
|
|
145
|
-
match(input: MatchInput, signal?: AbortSignal): Promise<MatchAnswer>;
|
|
146
|
-
/**
|
|
147
|
-
* Material Match as a PROGRESSIVE stream — the same POST
|
|
148
|
-
* `/api/v1/search/match` endpoint negotiated with `Accept:
|
|
149
|
-
* application/x-ndjson`, which runs the scene workflow (classify → decompose →
|
|
150
|
-
* one match per surface) and emits an event as each surface resolves. Use this
|
|
151
|
-
* wherever the user watches a photo come apart; use {@link match} when you only
|
|
152
|
-
* want the finished answer.
|
|
153
|
-
*
|
|
154
|
-
* Iterate it directly — the request opens on the first `next()`:
|
|
155
|
-
*
|
|
156
|
-
* ```ts
|
|
157
|
-
* for await (const event of client.matchStream({ imageBase64 })) {
|
|
158
|
-
* if (event.type === "surface") render(event.surface);
|
|
159
|
-
* }
|
|
160
|
-
* ```
|
|
161
|
-
*
|
|
162
|
-
* Every frame is validated before it is yielded, and the iterator ends only on
|
|
163
|
-
* a `complete` or `error` event — a truncated connection raises rather than
|
|
164
|
-
* passing for a short run. `signal` cancels the in-flight request itself, as
|
|
165
|
-
* does breaking out of the loop; a cancelled stream ends without raising.
|
|
166
|
-
* Requires an image (`imageBase64` or `imageUrl`); a `vector` input is
|
|
167
|
-
* buffered-only.
|
|
168
|
-
*/
|
|
169
|
-
matchStream(input: MatchInput, signal?: AbortSignal): AsyncGenerator<MatchStreamEvent, void, unknown>;
|
|
170
130
|
/**
|
|
171
131
|
* THE QUESTION: "what materials are near THIS colour?" — one colour (or a small
|
|
172
132
|
* palette), ranked by OKLab closeness to colour extracted from product imagery.
|
|
@@ -265,6 +225,17 @@ export declare class MaterialGraphClient extends CatalogueClient {
|
|
|
265
225
|
* search index rather than the canonical variant graph.
|
|
266
226
|
*/
|
|
267
227
|
findVariantsByColour(input: FindVariantsByColourInput, signal?: AbortSignal): Promise<FindVariantsByColourOutput>;
|
|
228
|
+
/**
|
|
229
|
+
* THE QUESTION: "what did designers sample together with these?" (POST
|
|
230
|
+
* `/api/v1/variants/companions`, MG-2332). Give `variantIds` and/or
|
|
231
|
+
* `materials` (free-text names, one variant each, at most twelve together);
|
|
232
|
+
* companions come back strongest first, each with its `lift`,
|
|
233
|
+
* `seedMatchCount`, `relation` and a one-line `reason`. `projectType` reads one
|
|
234
|
+
* sector; `include` adds `image` and `colour` fields a lean page leaves out.
|
|
235
|
+
* A sample order shows sampling, never specification. Read `unresolved`
|
|
236
|
+
* before presenting: a scheme of four that resolved two is a different claim.
|
|
237
|
+
*/
|
|
238
|
+
findCompanions(input: FindCompanionsInput, signal?: AbortSignal): Promise<FindCompanionsOutput>;
|
|
268
239
|
/**
|
|
269
240
|
* THE QUESTION: "what looks or feels like this?" (POST
|
|
270
241
|
* `/api/v1/variants/by-vector`, MG-2231). Eligible variants ranked by
|
|
@@ -309,7 +280,7 @@ export declare class MaterialGraphClient extends CatalogueClient {
|
|
|
309
280
|
* materials. The bridge from an inspiration image into the colour lens: extract
|
|
310
281
|
* here, then feed the swatches to `colours.palette()` or
|
|
311
282
|
* {@link MaterialGraphClient.byColour}. Instead use
|
|
312
|
-
|
|
283
|
+
|
|
313
284
|
*/
|
|
314
285
|
extractPalette(input: ExtractPaletteInput, signal?: AbortSignal): Promise<ExtractPaletteResponse>;
|
|
315
286
|
/** "Whose catalogs are in here, and how big is each?" — {@link listBrands}. */
|
package/client.js
CHANGED
|
@@ -7,7 +7,6 @@ import { listAttributes as listAttributesCall, listEnumValues as listEnumValuesC
|
|
|
7
7
|
import { ColoursClient } from "./colours-client.js";
|
|
8
8
|
import { MaterialGraphError } from "./errors.js";
|
|
9
9
|
import { HttpTransport } from "./http-transport.js";
|
|
10
|
-
import { matchStream as matchStreamCall } from "./match-stream.js";
|
|
11
10
|
import { listVariantAssets as listVariantAssetsCall, materialBlocks as materialBlocksCall, materialDocuments as materialDocumentsCall, } from "./material-resources-client.js";
|
|
12
11
|
// Aliased to `operation` — the local name every call site here already used.
|
|
13
12
|
import { resolveOperation as operation } from "./operations.js";
|
|
@@ -26,7 +25,6 @@ export * from "./client-config.js";
|
|
|
26
25
|
* | --- | --- |
|
|
27
26
|
* | "find me something like this / matching these words" | {@link MaterialGraphClient.search} |
|
|
28
27
|
* | "tell me about THIS variant" | {@link MaterialGraphClient.getVariant} |
|
|
29
|
-
* | "what's IN this photo?" | {@link MaterialGraphClient.match} / {@link MaterialGraphClient.matchStream} |
|
|
30
28
|
* | "which materials, from anyone, meet this hard spec?" | {@link MaterialGraphClient.listVariants} |
|
|
31
29
|
* | "what's near this colour / this palette?" | {@link MaterialGraphClient.byColour}, `colours.palette()` |
|
|
32
30
|
* | "what goes with THIS material?" | {@link MaterialGraphClient.pairings}, {@link MaterialGraphClient.listVariants} (same product, other colourways) |
|
|
@@ -135,48 +133,6 @@ export class MaterialGraphClient extends CatalogueClient {
|
|
|
135
133
|
async searchGet(params, signal) {
|
|
136
134
|
return await this.#get("search_materials_get", { ...params }, signal);
|
|
137
135
|
}
|
|
138
|
-
/**
|
|
139
|
-
* THE QUESTION: "what materials are in this PHOTO?" — Material Match classifies
|
|
140
|
-
* the image, decomposes it into surfaces, and answers each one.
|
|
141
|
-
*
|
|
142
|
-
* Instead use {@link MaterialGraphClient.matchStream} whenever a human is
|
|
143
|
-
* watching, {@link MaterialGraphClient.search} with `image` for ONE ranked list
|
|
144
|
-
* rather than a per-surface decomposition, and
|
|
145
|
-
* {@link MaterialGraphClient.extractPalette} for the image's colours only.
|
|
146
|
-
*
|
|
147
|
-
* Exactly one of `imageBase64`, `imageUrl` or `vector`. Read `qualityFloor` and
|
|
148
|
-
* `droppedBelowFloor` before reporting an empty result: "nothing was good
|
|
149
|
-
* enough" and "nothing was found" are different answers.
|
|
150
|
-
*/
|
|
151
|
-
async match(input, signal) {
|
|
152
|
-
return await this.#post("match_material", input, signal);
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Material Match as a PROGRESSIVE stream — the same POST
|
|
156
|
-
* `/api/v1/search/match` endpoint negotiated with `Accept:
|
|
157
|
-
* application/x-ndjson`, which runs the scene workflow (classify → decompose →
|
|
158
|
-
* one match per surface) and emits an event as each surface resolves. Use this
|
|
159
|
-
* wherever the user watches a photo come apart; use {@link match} when you only
|
|
160
|
-
* want the finished answer.
|
|
161
|
-
*
|
|
162
|
-
* Iterate it directly — the request opens on the first `next()`:
|
|
163
|
-
*
|
|
164
|
-
* ```ts
|
|
165
|
-
* for await (const event of client.matchStream({ imageBase64 })) {
|
|
166
|
-
* if (event.type === "surface") render(event.surface);
|
|
167
|
-
* }
|
|
168
|
-
* ```
|
|
169
|
-
*
|
|
170
|
-
* Every frame is validated before it is yielded, and the iterator ends only on
|
|
171
|
-
* a `complete` or `error` event — a truncated connection raises rather than
|
|
172
|
-
* passing for a short run. `signal` cancels the in-flight request itself, as
|
|
173
|
-
* does breaking out of the loop; a cancelled stream ends without raising.
|
|
174
|
-
* Requires an image (`imageBase64` or `imageUrl`); a `vector` input is
|
|
175
|
-
* buffered-only.
|
|
176
|
-
*/
|
|
177
|
-
matchStream(input, signal) {
|
|
178
|
-
return matchStreamCall(this.#transport, input, signal);
|
|
179
|
-
}
|
|
180
136
|
/**
|
|
181
137
|
* THE QUESTION: "what materials are near THIS colour?" — one colour (or a small
|
|
182
138
|
* palette), ranked by OKLab closeness to colour extracted from product imagery.
|
|
@@ -341,6 +297,19 @@ export class MaterialGraphClient extends CatalogueClient {
|
|
|
341
297
|
async findVariantsByColour(input, signal) {
|
|
342
298
|
return await this.#post("find_variants_by_colour", input, signal);
|
|
343
299
|
}
|
|
300
|
+
/**
|
|
301
|
+
* THE QUESTION: "what did designers sample together with these?" (POST
|
|
302
|
+
* `/api/v1/variants/companions`, MG-2332). Give `variantIds` and/or
|
|
303
|
+
* `materials` (free-text names, one variant each, at most twelve together);
|
|
304
|
+
* companions come back strongest first, each with its `lift`,
|
|
305
|
+
* `seedMatchCount`, `relation` and a one-line `reason`. `projectType` reads one
|
|
306
|
+
* sector; `include` adds `image` and `colour` fields a lean page leaves out.
|
|
307
|
+
* A sample order shows sampling, never specification. Read `unresolved`
|
|
308
|
+
* before presenting: a scheme of four that resolved two is a different claim.
|
|
309
|
+
*/
|
|
310
|
+
async findCompanions(input, signal) {
|
|
311
|
+
return await this.#post("find_companions", input, signal);
|
|
312
|
+
}
|
|
344
313
|
/**
|
|
345
314
|
* THE QUESTION: "what looks or feels like this?" (POST
|
|
346
315
|
* `/api/v1/variants/by-vector`, MG-2231). Eligible variants ranked by
|
|
@@ -406,7 +375,7 @@ export class MaterialGraphClient extends CatalogueClient {
|
|
|
406
375
|
* materials. The bridge from an inspiration image into the colour lens: extract
|
|
407
376
|
* here, then feed the swatches to `colours.palette()` or
|
|
408
377
|
* {@link MaterialGraphClient.byColour}. Instead use
|
|
409
|
-
|
|
378
|
+
|
|
410
379
|
*/
|
|
411
380
|
async extractPalette(input, signal) {
|
|
412
381
|
return await this.#post("extract_image_palette", input, signal);
|
package/errors.d.ts
CHANGED
|
@@ -89,7 +89,7 @@ type TransportErrorInput = {
|
|
|
89
89
|
* member to a problem response means adding it here too, and
|
|
90
90
|
* `problem-extension-parity.test.ts` fails when the two disagree.
|
|
91
91
|
*/
|
|
92
|
-
export declare const MATERIALGRAPH_PROBLEM_EXTENSIONS: readonly ["ambiguous_brands", "brand_candidates", "content_length", "did_you_mean", "empty_brands", "limit_bytes", "missing_env", "orderable_attributes", "populated_alternatives", "refused_criteria", "unknown_attributes", "unknown_brands", "unknown_fields", "unorderable_attribute", "valid_group_keys", "valid_type_keys"];
|
|
92
|
+
export declare const MATERIALGRAPH_PROBLEM_EXTENSIONS: readonly ["ambiguous_brands", "brand_candidates", "content_length", "did_you_mean", "empty_brands", "limit_bytes", "missing_env", "orderable_attributes", "populated_alternatives", "refused_criteria", "unknown_attributes", "unknown_brands", "unknown_fields", "unknown_parameters", "unorderable_attribute", "valid_group_keys", "valid_type_keys"];
|
|
93
93
|
/** The one error class thrown by all SDK transport and HTTP failures. */
|
|
94
94
|
export declare class MaterialGraphError extends Error {
|
|
95
95
|
readonly kind: MaterialGraphErrorKind;
|
package/errors.js
CHANGED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module find-companions-types
|
|
3
|
+
* @description Hand-maintained mirror of `find_companions`' (MG-2332) input and
|
|
4
|
+
* output wire shapes. The source of truth is
|
|
5
|
+
* `packages/products/src/cospec/schema.ts` (`findCompanionsInputSchema`,
|
|
6
|
+
* `findCompanionsResultSchema`). This SDK has no RUNTIME dependency on
|
|
7
|
+
* `@materialgraph/products` (it's a devDependency only, for the parity tests in
|
|
8
|
+
* `__tests__/`), so the shapes are copied here rather than imported.
|
|
9
|
+
* `contract-parity.test.ts` keeps this mirror honest against the server types,
|
|
10
|
+
* the project-type list included.
|
|
11
|
+
*/
|
|
12
|
+
/** The closed sector vocabulary co-specification evidence is tagged with. */
|
|
13
|
+
export type CompanionProjectType = "Workplace" | "Residential" | "Institution Education" | "Hospitality: Hotel" | "Mixed-Use & Multi-Unit Residential" | "Healthcare" | "Hospitality: Restaurant" | "Government" | "Senior Living" | "Retail" | "Other" | "Sports Entertainment" | "Wellness" | "Medical Dental" | "Aviation" | "Industrial" | "Tech" | "Transportation" | "Single Family" | "Condominium Cooperative" | "Marine" | "Power & Energy" | "University Design Program: Interior Design" | "Non-Billable" | "University Design Program: Interior Architecture" | "University Design Program: Architecture" | "Historic Preservation";
|
|
14
|
+
/** At least one of `variantIds` and `materials`, at most twelve together. */
|
|
15
|
+
export type FindCompanionsInput = {
|
|
16
|
+
/** Optional row fields: image adds imageUrl, colour adds swatches. */
|
|
17
|
+
include?: ("image" | "colour")[];
|
|
18
|
+
/** Ops and audit switch: leave sample cards in. Default false. */
|
|
19
|
+
includeSamplingArtifacts?: boolean;
|
|
20
|
+
/** Companions to return, default 20, at most 100. */
|
|
21
|
+
limit?: number;
|
|
22
|
+
/** Names to resolve when you hold no ids. Misses come back unresolved. */
|
|
23
|
+
materials?: string[];
|
|
24
|
+
/** Only companions sampled together in projects of this sector. */
|
|
25
|
+
projectType?: CompanionProjectType;
|
|
26
|
+
/** Variants to find companions for. */
|
|
27
|
+
variantIds?: string[];
|
|
28
|
+
};
|
|
29
|
+
export type FindCompanionsRow = {
|
|
30
|
+
brand: string;
|
|
31
|
+
/** Palette likeness to the seeds. Present with `include: ["colour"]`; never reorders. */
|
|
32
|
+
colourFit?: number | null;
|
|
33
|
+
/** Present with `include: ["image"]`. */
|
|
34
|
+
imageUrl?: string | null;
|
|
35
|
+
/** Mean lift over the seeds it pairs with; above 1 is above average. */
|
|
36
|
+
lift: number;
|
|
37
|
+
product: string;
|
|
38
|
+
/** Why it was suggested, in one line. */
|
|
39
|
+
reason: string;
|
|
40
|
+
/** `companion` is another brand; `brand_sibling` and `colourway` share the seed's. */
|
|
41
|
+
relation: "companion" | "brand_sibling" | "colourway";
|
|
42
|
+
/** How many seeds it was sampled with. */
|
|
43
|
+
seedMatchCount: number;
|
|
44
|
+
/** Present with `include: ["colour"]`. */
|
|
45
|
+
swatches?: {
|
|
46
|
+
hex: string;
|
|
47
|
+
proportion: number;
|
|
48
|
+
}[];
|
|
49
|
+
variantId: string;
|
|
50
|
+
variantName: string | null;
|
|
51
|
+
};
|
|
52
|
+
export type FindCompanionsOutput = {
|
|
53
|
+
/** Strongest first: seeds matched, then summed lift, one row per product. */
|
|
54
|
+
companions: FindCompanionsRow[];
|
|
55
|
+
/** The seeds as resolved, so a caller sees what a name became. */
|
|
56
|
+
seeds: {
|
|
57
|
+
brand: string;
|
|
58
|
+
/** Present with `include: ["image"]`. */
|
|
59
|
+
imageUrl?: string | null;
|
|
60
|
+
product: string;
|
|
61
|
+
/** The id or name this seed came from. */
|
|
62
|
+
resolvedFrom: string;
|
|
63
|
+
variantId: string;
|
|
64
|
+
variantName: string | null;
|
|
65
|
+
}[];
|
|
66
|
+
/** Seed ids outside the materials catalogue; present only when at least one was. */
|
|
67
|
+
excludedByCorpusScope?: string[];
|
|
68
|
+
/** References that matched no variant. */
|
|
69
|
+
unresolved: string[];
|
|
70
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module find-companions-types
|
|
3
|
+
* @description Hand-maintained mirror of `find_companions`' (MG-2332) input and
|
|
4
|
+
* output wire shapes. The source of truth is
|
|
5
|
+
* `packages/products/src/cospec/schema.ts` (`findCompanionsInputSchema`,
|
|
6
|
+
* `findCompanionsResultSchema`). This SDK has no RUNTIME dependency on
|
|
7
|
+
* `@materialgraph/products` (it's a devDependency only, for the parity tests in
|
|
8
|
+
* `__tests__/`), so the shapes are copied here rather than imported.
|
|
9
|
+
* `contract-parity.test.ts` keeps this mirror honest against the server types,
|
|
10
|
+
* the project-type list included.
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
package/http-transport.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RateLimit } from "./errors.js";
|
|
2
2
|
import type { SdkOperation } from "./operations.js";
|
|
3
|
-
|
|
3
|
+
type QueryValue = string | number | boolean | undefined | null | (string | number | boolean)[];
|
|
4
4
|
export type QueryParams = Record<string, QueryValue>;
|
|
5
5
|
export type RequestOptions = {
|
|
6
6
|
/** Required by state-changing operations that support safe retries. */
|
package/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export type * from "./list-variant-facets-types.js";
|
|
|
5
5
|
export type * from "./list-enum-values-types.js";
|
|
6
6
|
export type * from "./get-variant-types.js";
|
|
7
7
|
export type * from "./image-reference-types.js";
|
|
8
|
+
export type * from "./find-companions-types.js";
|
|
8
9
|
export type * from "./find-variants-by-colour-types.js";
|
|
9
10
|
export { FIND_VARIANTS_BY_VECTOR_MODES } from "./find-variants-by-vector-types.js";
|
|
10
11
|
export type * from "./find-variants-by-vector-types.js";
|
|
@@ -27,9 +28,6 @@ export { ColoursClient } from "./colours-client.js";
|
|
|
27
28
|
export type { ColoursTransport } from "./colours-client.js";
|
|
28
29
|
export type * from "./palette-search-types.js";
|
|
29
30
|
export type * from "./query-understanding-types.js";
|
|
30
|
-
export type * from "./match-types.js";
|
|
31
|
-
export { MATCH_ERROR_REASONS, MATCH_IMAGE_TYPES, MATCH_OUTCOMES, MATCH_MATERIAL_FUNCTIONS, MATCH_STREAM_EVENT_TYPES, MATCH_SURFACE_STATUSES, MATCH_WORKFLOW_STEPS, } from "./match-stream-types.js";
|
|
32
|
-
export type * from "./match-stream-types.js";
|
|
33
31
|
export type * from "./material-query-plan-types.js";
|
|
34
32
|
export type * from "./association-types.js";
|
|
35
33
|
export type * from "./brand-types.js";
|
package/index.js
CHANGED
|
@@ -5,6 +5,5 @@ export { TERMINAL_RUN_EVENT_TYPES } from "./run-types.js";
|
|
|
5
5
|
export { MATERIALGRAPH_PROBLEM_EXTENSIONS, MaterialGraphError, } from "./errors.js";
|
|
6
6
|
export { CategoriesClient } from "./categories-client.js";
|
|
7
7
|
export { ColoursClient } from "./colours-client.js";
|
|
8
|
-
export { MATCH_ERROR_REASONS, MATCH_IMAGE_TYPES, MATCH_OUTCOMES, MATCH_MATERIAL_FUNCTIONS, MATCH_STREAM_EVENT_TYPES, MATCH_SURFACE_STATUSES, MATCH_WORKFLOW_STEPS, } from "./match-stream-types.js";
|
|
9
8
|
export { CERTIFICATION_PROGRAMME_ATTRIBUTE_ID } from "./spec-types.js";
|
|
10
9
|
export { certificationProgramme, hasSpec, specTerm } from "./specifications.js";
|
package/material-types.d.ts
CHANGED
|
@@ -57,7 +57,7 @@ export type MaterialTile = {
|
|
|
57
57
|
colourName?: string;
|
|
58
58
|
};
|
|
59
59
|
/** A retained product-type proposal. It is review evidence, never a category. */
|
|
60
|
-
|
|
60
|
+
type ProposedProductType = {
|
|
61
61
|
id: string;
|
|
62
62
|
displayName: string;
|
|
63
63
|
confidence: number | null;
|
|
@@ -71,3 +71,4 @@ export type ProductTypeReceipt = {
|
|
|
71
71
|
state: "accepted" | "proposed" | "unknown";
|
|
72
72
|
proposedProductTypes: ProposedProductType[];
|
|
73
73
|
};
|
|
74
|
+
export {};
|
package/ndjson.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A minimal, dependency-free NDJSON (newline-delimited JSON) line reader — the
|
|
3
|
-
* primitive
|
|
3
|
+
* primitive for line-oriented JSON streams. Hand-rolled so the
|
|
4
4
|
* SDK stays zero-runtime-dep and works unchanged inside Node route handlers,
|
|
5
5
|
* where `fetch` yields a byte `ReadableStream`.
|
|
6
6
|
*
|
package/ndjson.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A minimal, dependency-free NDJSON (newline-delimited JSON) line reader — the
|
|
3
|
-
* primitive
|
|
3
|
+
* primitive for line-oriented JSON streams. Hand-rolled so the
|
|
4
4
|
* SDK stays zero-runtime-dep and works unchanged inside Node route handlers,
|
|
5
5
|
* where `fetch` yields a byte `ReadableStream`.
|
|
6
6
|
*
|
package/operations.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const MATERIALGRAPH_API_VERSION = "0.7.0";
|
|
2
|
-
declare const OPERATION_DEFINITIONS: readonly [readonly ["samplizeColorVecCache", "GET", "/api/v1/catalogues/samplize/colorvec", "samplize_colorvec_cache"], readonly ["samplizeCatalogueSearch", "POST", "/api/v1/catalogues/samplize/search", "samplize_catalogue_search"], readonly ["catalogs", "GET", "/api/v1/catalogs", "list_catalog_documents"], readonly ["catalogPages", "GET", "/api/v1/catalogs/{catalogId}/pages", "list_catalog_pages"], readonly ["catalogPageRepresentation", "GET", "/api/v1/catalog-pages/{pageId}/representation", "get_catalog_page_representation"], readonly ["catalogReferences", "GET", "/api/v1/catalogs/{catalogId}/references", "list_catalog_product_references"], readonly ["search", "POST", "/api/v1/search", "search_materials_post"], readonly ["
|
|
2
|
+
declare const OPERATION_DEFINITIONS: readonly [readonly ["samplizeColorVecCache", "GET", "/api/v1/catalogues/samplize/colorvec", "samplize_colorvec_cache"], readonly ["samplizeCatalogueSearch", "POST", "/api/v1/catalogues/samplize/search", "samplize_catalogue_search"], readonly ["catalogs", "GET", "/api/v1/catalogs", "list_catalog_documents"], readonly ["catalogPages", "GET", "/api/v1/catalogs/{catalogId}/pages", "list_catalog_pages"], readonly ["catalogPageRepresentation", "GET", "/api/v1/catalog-pages/{pageId}/representation", "get_catalog_page_representation"], readonly ["catalogReferences", "GET", "/api/v1/catalogs/{catalogId}/references", "list_catalog_product_references"], readonly ["search", "POST", "/api/v1/search", "search_materials_post"], readonly ["planQuery", "POST", "/api/v1/search/plan", "plan_material_query"], readonly ["samplizeCatalogue", "GET", "/api/v1/catalogues/samplize/products", "samplize_catalogue_products"], readonly ["searchGet", "GET", "/api/v1/search", "search_materials_get"], readonly ["byColour", "GET", "/api/v1/search/colours", "search_by_colour"], readonly ["catalogueReferences", "POST", "/api/v1/catalogues/references", "get_catalogue_references_batch"], readonly ["catalogueCollections", "GET", "/api/v1/catalogues/collections", "list_catalogue_channel_collections"], readonly ["catalogueDocumentAccess", "GET", "/api/v1/catalogues/documents/{documentId}", "get_catalogue_document_access"], readonly ["materialBlocks", "GET", "/api/v1/materials/{variantId}/blocks", "list_material_blocks"], readonly ["listVariantAssets", "GET", "/api/v1/variants/{variantId}/assets", "list_variant_assets"], readonly ["materialDocuments", "GET", "/api/v1/materials/{variantId}/documents", "list_material_documents"], readonly ["schema", "GET", "/api/v1/schema/value-dictionaries", "list_schema_value_dictionaries"], readonly ["pairings", "GET", "/api/v1/materials/{variantId}/pairings", "get_material_pairings"], readonly ["associatedFinishes", "GET", "/api/v1/associated/finishes", "list_associated_finishes"], readonly ["associatedProducts", "GET", "/api/v1/associated/products", "list_associated_products"], readonly ["applicability", "GET", "/api/v1/applicability", "get_applicability"], readonly ["listVariants", "GET", "/api/v1/variants", "list_variants"], readonly ["listVariantFacets", "POST", "/api/v1/variants/facets", "list_variant_facets"], readonly ["findVariantsByColour", "POST", "/api/v1/variants/by-colour", "find_variants_by_colour"], readonly ["findVariantsByVector", "POST", "/api/v1/variants/by-vector", "find_variants_by_vector"], readonly ["findCompanions", "POST", "/api/v1/variants/companions", "find_companions"], readonly ["resolveVariant", "POST", "/api/v1/variants/resolve", "resolve_variant"], readonly ["getVariant", "GET", "/api/v1/variants/{variantId}", "get_variant"], readonly ["resolveColour", "GET", "/api/v1/search/colours/resolve", "resolve_colour_name"], readonly ["listAttributes", "GET", "/api/v1/catalog/attributes", "catalog_list_attributes"], readonly ["listEnumValues", "GET", "/api/v1/catalog/enum-values", "catalog_list_enum_values"], readonly ["categories.list", "GET", "/api/v1/categories", "list_categories"], readonly ["categories.get", "GET", "/api/v1/categories/{id}", "get_category"], readonly ["whoami", "GET", "/api/v1/whoami", "whoami"], readonly ["colours.palette", "POST", "/api/v1/search/palettes", "search_by_palette"], readonly ["extractPalette", "POST", "/api/v1/search/palettes/extract", "extract_image_palette"], readonly ["brands", "GET", "/api/v1/brands", "list_brands"], readonly ["uploadSourceMaterial", "POST", "/api/v1/source-material", "upload_source_material"], readonly ["workflows.start", "POST", "/api/v1/workflows/{workflowId}/runs", "create_public_run"], readonly ["workflows.run", "GET", "/api/v1/workflows/{workflowId}/runs/{runId}", "get_public_run"], readonly ["citation", "GET", "/api/v1/citations/{citationId}", "get_verdict_citation"], readonly ["workflows.streamRunEvents", "GET", "/api/v1/workflows/{workflowId}/runs/{runId}/events", "list_public_run_events"]];
|
|
3
3
|
export type SdkOperationId = (typeof OPERATION_DEFINITIONS)[number][3];
|
|
4
4
|
export type SdkOperation = Readonly<{
|
|
5
5
|
clientMethod: (typeof OPERATION_DEFINITIONS)[number][0];
|
package/operations.js
CHANGED
|
@@ -33,7 +33,6 @@ const OPERATION_DEFINITIONS = [
|
|
|
33
33
|
"list_catalog_product_references",
|
|
34
34
|
],
|
|
35
35
|
["search", "POST", "/api/v1/search", "search_materials_post"],
|
|
36
|
-
["match", "POST", "/api/v1/search/match", "match_material"],
|
|
37
36
|
["planQuery", "POST", "/api/v1/search/plan", "plan_material_query"],
|
|
38
37
|
[
|
|
39
38
|
"samplizeCatalogue",
|
|
@@ -123,6 +122,7 @@ const OPERATION_DEFINITIONS = [
|
|
|
123
122
|
"/api/v1/variants/by-vector",
|
|
124
123
|
"find_variants_by_vector",
|
|
125
124
|
],
|
|
125
|
+
["findCompanions", "POST", "/api/v1/variants/companions", "find_companions"],
|
|
126
126
|
["resolveVariant", "POST", "/api/v1/variants/resolve", "resolve_variant"],
|
|
127
127
|
["getVariant", "GET", "/api/v1/variants/{variantId}", "get_variant"],
|
|
128
128
|
[
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** The API contract version the schemas were generated from. */
|
|
2
2
|
export declare const RESPONSE_SCHEMA_API_VERSION = "0.7.0";
|
|
3
3
|
/** Every SDK operation whose success response has a published JSON Schema. */
|
|
4
|
-
export declare const RESPONSE_SCHEMA_OPERATION_IDS: readonly ["samplize_colorvec_cache", "samplize_catalogue_search", "list_catalog_documents", "list_catalog_pages", "get_catalog_page_representation", "list_catalog_product_references", "search_materials_post", "
|
|
4
|
+
export declare const RESPONSE_SCHEMA_OPERATION_IDS: readonly ["samplize_colorvec_cache", "samplize_catalogue_search", "list_catalog_documents", "list_catalog_pages", "get_catalog_page_representation", "list_catalog_product_references", "search_materials_post", "plan_material_query", "samplize_catalogue_products", "search_materials_get", "search_by_colour", "get_catalogue_references_batch", "list_catalogue_channel_collections", "get_catalogue_document_access", "list_material_blocks", "list_variant_assets", "list_material_documents", "list_schema_value_dictionaries", "get_material_pairings", "list_associated_finishes", "list_associated_products", "get_applicability", "list_variants", "list_variant_facets", "find_variants_by_colour", "find_variants_by_vector", "find_companions", "resolve_variant", "get_variant", "resolve_colour_name", "catalog_list_attributes", "catalog_list_enum_values", "list_categories", "get_category", "whoami", "search_by_palette", "extract_image_palette", "list_brands", "upload_source_material", "create_public_run", "get_public_run", "get_verdict_citation"];
|
|
5
5
|
export declare const RESPONSE_SCHEMA_CATALOGUE_JSON: string;
|