@instruments/materialgraph 0.22.0 → 0.24.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/catalogue-client.d.ts +11 -0
- package/catalogue-client.js +14 -0
- package/client-vocabulary.d.ts +2 -2
- package/client-vocabulary.js +2 -2
- package/client.d.ts +3 -3
- package/client.js +3 -3
- package/index.d.ts +1 -0
- package/match-rejection-types.d.ts +43 -0
- package/match-rejection-types.js +7 -0
- package/material-types.d.ts +13 -0
- package/operations.d.ts +1 -1
- package/operations.js +12 -0
- package/package.json +1 -1
- package/resolve-colour-types.d.ts +67 -0
- package/resolve-colour-types.js +1 -0
- package/search-response-receipt-types.d.ts +1 -1
- package/types.d.ts +5 -12
package/catalogue-client.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import type { CreateCorrectionInput, CorrectionResponse, CorrectionsListResponse
|
|
|
5
5
|
import type { HttpTransport } from "./http-transport.js";
|
|
6
6
|
import type { VariantId } from "./identifiers.js";
|
|
7
7
|
import type { IdentifySelectedPageInput, IdentifySelectedPageResult } from "./identify-types.js";
|
|
8
|
+
import type { MatchRejection, MatchRejectionList, RejectMatchResultInput } from "./match-rejection-types.js";
|
|
8
9
|
import type { SamplizeCatalogueOptions, SamplizeCataloguePage } from "./samplize-catalogue-types.js";
|
|
9
10
|
import type { SamplizeColorVecCache } from "./samplize-colorvec.js";
|
|
10
11
|
/** Catalogue publication operations inherited by the public SDK client. */
|
|
@@ -27,6 +28,16 @@ export declare class CatalogueClient {
|
|
|
27
28
|
cursor?: string;
|
|
28
29
|
limit?: number;
|
|
29
30
|
}, signal?: AbortSignal): Promise<CorrectionsListResponse>;
|
|
31
|
+
/**
|
|
32
|
+
* Record "not this" on one result a match showed, against the response it
|
|
33
|
+
* came from. `responseId` is that response's `attribution.responseId`; the
|
|
34
|
+
* call needs the same key the match was made with. Repeating a rejection
|
|
35
|
+
* returns the original receipt. This judges the match ranking and is never a
|
|
36
|
+
* catalogue correction - wrong product facts go through `createCorrection`.
|
|
37
|
+
*/
|
|
38
|
+
rejectMatchResult(responseId: string, input: RejectMatchResultInput, signal?: AbortSignal): Promise<MatchRejection>;
|
|
39
|
+
/** Read one match response back with every rejection recorded against it. */
|
|
40
|
+
matchRejections(responseId: string, signal?: AbortSignal): Promise<MatchRejectionList>;
|
|
30
41
|
/** Identify the canonical graph subject for one explicitly selected page. */
|
|
31
42
|
identify(input: IdentifySelectedPageInput, signal?: AbortSignal): Promise<IdentifySelectedPageResult>;
|
|
32
43
|
/** Complete producer-owned vectors and classifications for portable colour matching. */
|
package/catalogue-client.js
CHANGED
|
@@ -37,6 +37,20 @@ export class CatalogueClient {
|
|
|
37
37
|
signal,
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Record "not this" on one result a match showed, against the response it
|
|
42
|
+
* came from. `responseId` is that response's `attribution.responseId`; the
|
|
43
|
+
* call needs the same key the match was made with. Repeating a rejection
|
|
44
|
+
* returns the original receipt. This judges the match ranking and is never a
|
|
45
|
+
* catalogue correction - wrong product facts go through `createCorrection`.
|
|
46
|
+
*/
|
|
47
|
+
rejectMatchResult(responseId, input, signal) {
|
|
48
|
+
return this.#transport.requestJson(resolveOperation("reject_match_result"), { pathParams: { responseId }, body: input, signal });
|
|
49
|
+
}
|
|
50
|
+
/** Read one match response back with every rejection recorded against it. */
|
|
51
|
+
matchRejections(responseId, signal) {
|
|
52
|
+
return this.#transport.requestJson(resolveOperation("list_match_rejections"), { pathParams: { responseId }, signal });
|
|
53
|
+
}
|
|
40
54
|
/** Identify the canonical graph subject for one explicitly selected page. */
|
|
41
55
|
identify(input, signal) {
|
|
42
56
|
return this.#transport.requestJson(resolveOperation("retrieval.identify"), { body: input, signal });
|
package/client-vocabulary.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HttpTransport } from "./http-transport.js";
|
|
2
|
-
import type { ColourFacetsResponse, ResolveAttributeOptions, ResolveAttributeResponse, ResolveAttributeValueOptions, ResolveAttributeValueResponse, ResolveColourResponse, SuggestColourResponse, SuggestOptions, SuggestResponse } from "./types.js";
|
|
2
|
+
import type { ColourFacetsResponse, ResolveAttributeOptions, ResolveAttributeResponse, ResolveAttributeValueOptions, ResolveAttributeValueResponse, ResolveColourOptions, ResolveColourResponse, SuggestColourResponse, SuggestOptions, SuggestResponse } from "./types.js";
|
|
3
3
|
export declare function colourFacets(transport: HttpTransport, signal?: AbortSignal): Promise<ColourFacetsResponse>;
|
|
4
|
-
export declare function resolveColour(transport: HttpTransport, name: string, signal?: AbortSignal): Promise<ResolveColourResponse>;
|
|
4
|
+
export declare function resolveColour(transport: HttpTransport, name: string, signal?: AbortSignal, options?: ResolveColourOptions): Promise<ResolveColourResponse>;
|
|
5
5
|
export declare function suggestColour(transport: HttpTransport, q: string, options?: {
|
|
6
6
|
limit?: number;
|
|
7
7
|
}, signal?: AbortSignal): Promise<SuggestColourResponse>;
|
package/client-vocabulary.js
CHANGED
|
@@ -4,8 +4,8 @@ import { suggestQuery } from "./suggest-types.js";
|
|
|
4
4
|
export function colourFacets(transport, signal) {
|
|
5
5
|
return transport.requestJson(resolveOperation("get_colour_facets"), { signal });
|
|
6
6
|
}
|
|
7
|
-
export function resolveColour(transport, name, signal) {
|
|
8
|
-
return transport.requestJson(resolveOperation("resolve_colour_name"), { query: { name }, signal });
|
|
7
|
+
export function resolveColour(transport, name, signal, options) {
|
|
8
|
+
return transport.requestJson(resolveOperation("resolve_colour_name"), { query: { name, corpusScope: options?.corpusScope }, signal });
|
|
9
9
|
}
|
|
10
10
|
export function suggestColour(transport, q, options, signal) {
|
|
11
11
|
return transport.requestJson(resolveOperation("suggest_colour_names"), { query: { q, limit: options?.limit }, signal });
|
package/client.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ import type { SchemaResource, SchemaResourceResponse } from "./schema-resource-t
|
|
|
30
30
|
import type { SlotPoolsRequest, SlotPoolsResponse } from "./slot-pool-types.js";
|
|
31
31
|
import type { FindSubstitutesOptions, FindSubstitutesResponse } from "./substitute-types.js";
|
|
32
32
|
import type { ProductTypeCoverageOptions, ProductTypeStatusCoverage } from "./taxonomy-coverage-types.js";
|
|
33
|
-
import type { ApplicableSpecsResponse, BrandOptions, BySpecOptions, BySpecResponse, ColourFacetsResponse, CoordinateInput, CoordinateResponse, DemandBatchInput, DemandBatchResponse, DemandParams, DemandResponse, ExtractPaletteInput, ExtractPaletteResponse, GlossaryTermResponse, MaterialResponse, MaterialsBatchDetailResponse, MaterialsBatchGetOptions, MaterialsBatchOptions, MaterialsBatchTileResponse, PairingsOptions, PairingsResponse, ResolveAttributeOptions, ResolveAttributeResponse, ResolveAttributeValueOptions, ResolveAttributeValueResponse, ResolveColourResponse, SearchGetParams, SearchInput, SearchResponse, SiblingsResponse, SpecFacetsDistributionResponse, SpecFacetsListResponse, SuggestColourResponse, SuggestOptions, SuggestResponse, TaxonomyResponse, VocabularySearchOptions, WhoamiResponse } from "./types.js";
|
|
33
|
+
import type { ApplicableSpecsResponse, BrandOptions, BySpecOptions, BySpecResponse, ColourFacetsResponse, CoordinateInput, CoordinateResponse, DemandBatchInput, DemandBatchResponse, DemandParams, DemandResponse, ExtractPaletteInput, ExtractPaletteResponse, GlossaryTermResponse, MaterialResponse, MaterialsBatchDetailResponse, MaterialsBatchGetOptions, MaterialsBatchOptions, MaterialsBatchTileResponse, PairingsOptions, PairingsResponse, ResolveAttributeOptions, ResolveAttributeResponse, ResolveAttributeValueOptions, ResolveAttributeValueResponse, ResolveColourOptions, ResolveColourResponse, SearchGetParams, SearchInput, SearchResponse, SiblingsResponse, SpecFacetsDistributionResponse, SpecFacetsListResponse, SuggestColourResponse, SuggestOptions, SuggestResponse, TaxonomyResponse, VocabularySearchOptions, WhoamiResponse } from "./types.js";
|
|
34
34
|
/**
|
|
35
35
|
* The MaterialGraph client — every lens on the graph, on one object.
|
|
36
36
|
*
|
|
@@ -287,8 +287,8 @@ export declare class MaterialGraphClient extends CatalogueClient {
|
|
|
287
287
|
}, signal?: AbortSignal): Promise<MaterialsBatchTileResponse>;
|
|
288
288
|
/** Vocabulary families and counts; use `colours.profiles()` for a material palette. */
|
|
289
289
|
colourFacets(signal?: AbortSignal): Promise<ColourFacetsResponse>;
|
|
290
|
-
/** Resolve a colour name to its
|
|
291
|
-
resolveColour(name: string, signal?: AbortSignal): Promise<ResolveColourResponse>;
|
|
290
|
+
/** Resolve a colour name to its hex, and the named paint's catalogue variant. */
|
|
291
|
+
resolveColour(name: string, signal?: AbortSignal, options?: ResolveColourOptions): Promise<ResolveColourResponse>;
|
|
292
292
|
/** Ranked colour-name typeahead (GET `/api/v1/search/colours/suggest`). */
|
|
293
293
|
suggestColour(q: string, options?: {
|
|
294
294
|
limit?: number;
|
package/client.js
CHANGED
|
@@ -362,9 +362,9 @@ export class MaterialGraphClient extends CatalogueClient {
|
|
|
362
362
|
colourFacets(signal) {
|
|
363
363
|
return colourFacetsCall(this.#transport, signal);
|
|
364
364
|
}
|
|
365
|
-
/** Resolve a colour name to its
|
|
366
|
-
resolveColour(name, signal) {
|
|
367
|
-
return resolveColourCall(this.#transport, name, signal);
|
|
365
|
+
/** Resolve a colour name to its hex, and the named paint's catalogue variant. */
|
|
366
|
+
resolveColour(name, signal, options) {
|
|
367
|
+
return resolveColourCall(this.#transport, name, signal, options);
|
|
368
368
|
}
|
|
369
369
|
/** Ranked colour-name typeahead (GET `/api/v1/search/colours/suggest`). */
|
|
370
370
|
suggestColour(q, options, signal) {
|
package/index.d.ts
CHANGED
|
@@ -50,6 +50,7 @@ export type * from "./substitute-types.js";
|
|
|
50
50
|
export type * from "./search-refinement-types.js";
|
|
51
51
|
export type * from "./search-window-types.js";
|
|
52
52
|
export type * from "./attribution-types.js";
|
|
53
|
+
export type * from "./match-rejection-types.js";
|
|
53
54
|
export { CERTIFICATION_PROGRAMME_ATTRIBUTE_ID } from "./spec-types.js";
|
|
54
55
|
export type * from "./spec-types.js";
|
|
55
56
|
export { certificationProgramme, certificationProgrammeCriterion, hasSpec, specCriterion, specRangeCriterion, specTerm, } from "./specifications.js";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Not this" on a photo match result (MG-1859). A rejection is feedback on the
|
|
3
|
+
* match ranking, recorded against the response that showed the result. It is
|
|
4
|
+
* never a catalogue correction; wrong facts about a product go through
|
|
5
|
+
* `createCorrection`.
|
|
6
|
+
*/
|
|
7
|
+
export interface RejectMatchResultInput {
|
|
8
|
+
/**
|
|
9
|
+
* The surface the result was shown under - `surfaces[].surface.id` on a scene
|
|
10
|
+
* match. Omit it for a result from the run-level `results` list.
|
|
11
|
+
*/
|
|
12
|
+
surfaceId?: string;
|
|
13
|
+
/** The rejected result's `variantId`, verbatim. */
|
|
14
|
+
variantId: string;
|
|
15
|
+
/** Optional free text, up to 500 characters. Stored as given. */
|
|
16
|
+
reason?: string;
|
|
17
|
+
}
|
|
18
|
+
/** The receipt for one rejection. A repeat of the same rejection returns the original. */
|
|
19
|
+
export interface MatchRejection {
|
|
20
|
+
rejectionId: string;
|
|
21
|
+
/** The match response's `attribution.responseId`. */
|
|
22
|
+
responseId: string;
|
|
23
|
+
/** Null when the result came from the run-level list. */
|
|
24
|
+
surfaceId: string | null;
|
|
25
|
+
variantId: string;
|
|
26
|
+
/** The 1-based position the match response showed this result at, within its surface. */
|
|
27
|
+
rank: number;
|
|
28
|
+
reason: string | null;
|
|
29
|
+
/** ISO-8601. */
|
|
30
|
+
rejectedAt: string;
|
|
31
|
+
}
|
|
32
|
+
/** One match response and every rejection recorded against it. */
|
|
33
|
+
export interface MatchRejectionList {
|
|
34
|
+
responseId: string;
|
|
35
|
+
/** `stream` for a scene match, `buffered` for the single-image JSON response. */
|
|
36
|
+
lane: "buffered" | "stream";
|
|
37
|
+
/** ISO-8601 time the match response was issued. */
|
|
38
|
+
issuedAt: string;
|
|
39
|
+
/** Ranked results the response showed, across every surface - a rejection rate's denominator. */
|
|
40
|
+
resultCount: number;
|
|
41
|
+
/** Oldest first. Empty means nothing was rejected. */
|
|
42
|
+
rejections: MatchRejection[];
|
|
43
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Not this" on a photo match result (MG-1859). A rejection is feedback on the
|
|
3
|
+
* match ranking, recorded against the response that showed the result. It is
|
|
4
|
+
* never a catalogue correction; wrong facts about a product go through
|
|
5
|
+
* `createCorrection`.
|
|
6
|
+
*/
|
|
7
|
+
export {};
|
package/material-types.d.ts
CHANGED
|
@@ -78,6 +78,19 @@ export interface MaterialTile {
|
|
|
78
78
|
*/
|
|
79
79
|
colourName?: string;
|
|
80
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* A sibling card: the tile, plus — when another variant of the same product
|
|
83
|
+
* shares both its `variantName` and its `colourName` — the one attribute that
|
|
84
|
+
* tells them apart (MG-1857: IndoTeak's Reclaimed Teak is ten "Unfinished"
|
|
85
|
+
* variants that differ only by product code). Declared size first, then product
|
|
86
|
+
* code. The two fields arrive together or not at all; absent means nothing
|
|
87
|
+
* collides, or neither attribute separates every look-alike.
|
|
88
|
+
*/
|
|
89
|
+
export interface SiblingTile extends MaterialTile {
|
|
90
|
+
distinguishedBy?: OpenEnum<"size" | "code">;
|
|
91
|
+
/** This sibling's value of `distinguishedBy`, e.g. `"3.5 in"`. */
|
|
92
|
+
distinction?: string;
|
|
93
|
+
}
|
|
81
94
|
/**
|
|
82
95
|
* A canonical attribute/term pair carried on a detail record.
|
|
83
96
|
*
|
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 ["brandMostSampled", "GET", "/api/v1/brands/most-sampled", "brands.most_sampled"], readonly ["colours.complete", "POST", "/api/v1/colours/palettes/complete", "complete_interior_palette"], readonly ["colours.discover", "GET", "/api/v1/colours/palettes", "discover_interior_palettes"], readonly ["samplizeColorVecCache", "GET", "/api/v1/catalogues/samplize/colorvec", "samplize_colorvec_cache"], readonly ["samplizeCatalogueSearch", "POST", "/api/v1/catalogues/samplize/search", "samplize_catalogue_search"], readonly ["scheduleReferences.list", "GET", "/api/v1/schedules/{scheduleId}/references", "list_schedule_reference_feedback"], readonly ["scheduleReferences.put", "PUT", "/api/v1/schedules/{scheduleId}/references/{referenceId}", "put_schedule_reference_feedback"], 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 ["identify", "POST", "/api/v1/identify", "retrieval.identify"], readonly ["compare", "POST", "/api/v1/compare", "retrieval.compare"], readonly ["createCorrection", "POST", "/api/v1/corrections", "corrections.create"], readonly ["getCorrection", "GET", "/api/v1/corrections/{correctionId}", "corrections.get"], readonly ["listCorrections", "GET", "/api/v1/corrections", "corrections.list"], 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 ["match", "POST", "/api/v1/search/match", "match_material"], readonly ["byColour", "GET", "/api/v1/search/colours", "search_by_colour"], readonly ["material", "GET", "/api/v1/materials/{variantId}", "get_material"], 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 ["siblings", "GET", "/api/v1/materials/{variantId}/siblings", "get_material_siblings"], readonly ["materialBlocks", "GET", "/api/v1/materials/{variantId}/blocks", "list_material_blocks"], readonly ["materialAssets", "GET", "/api/v1/materials/{variantId}/assets", "list_material_assets"], readonly ["materialRenderAssets", "GET", "/api/v1/materials/{variantId}/render-assets", "get_material_render_assets"], readonly ["materialDocuments", "GET", "/api/v1/materials/{variantId}/documents", "list_material_documents"], readonly ["exploration.operators", "GET", "/api/v1/materials/{variantId}/operators", "list_material_operators"], readonly ["exploration.candidates", "POST", "/api/v1/materials/{variantId}/candidates", "read_material_candidates"], readonly ["schema", "GET", "/api/v1/schema/blocks", "list_schema_blocks"], readonly ["schema", "GET", "/api/v1/schema/attributes", "list_schema_attributes"], readonly ["schema", "GET", "/api/v1/schema/verticals", "list_schema_verticals"], readonly ["schema", "GET", "/api/v1/schema/product-types", "list_schema_product_types"], readonly ["schema", "GET", "/api/v1/schema/units", "list_schema_units"], readonly ["schema", "GET", "/api/v1/schema/value-dictionaries", "list_schema_value_dictionaries"], readonly ["schema", "GET", "/api/v1/schema/source-requirements", "list_schema_source_requirements"], readonly ["schema", "GET", "/api/v1/schema/product-type-templates", "list_schema_product_type_templates"], readonly ["schema", "GET", "/api/v1/schema/mappings", "list_schema_mappings"], readonly ["pairings", "GET", "/api/v1/materials/{variantId}/pairings", "get_material_pairings"], readonly ["findSubstitutes", "POST", "/api/v1/materials/{variantId}/substitutes", "find_material_substitutes"], 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 ["materials", "POST", "/api/v1/materials/batch", "get_materials_batch_post"], readonly ["materialsCached", "GET", "/api/v1/materials/batch", "get_materials_batch_get"], readonly ["browse", "GET", "/api/v1/search/browse", "search_browse_by_colour"], readonly ["colourFacets", "GET", "/api/v1/colours/facets", "get_colour_facets"], readonly ["colours.profiles", "GET", "/api/v1/colours/profiles", "get_category_colour_profiles"], readonly ["colours.stats", "GET", "/api/v1/colours/stats", "get_colour_stats"], readonly ["resolveColour", "GET", "/api/v1/search/colours/resolve", "resolve_colour_name"], readonly ["suggestColour", "GET", "/api/v1/search/colours/suggest", "suggest_colour_names"], readonly ["suggest", "GET", "/api/v1/search/suggest", "search_suggest"], readonly ["resolveAttribute", "GET", "/api/v1/catalog/attributes/resolve", "catalog_resolve_attribute"], readonly ["resolveAttributeValue", "GET", "/api/v1/catalog/attributes/{attributeId}/values/resolve", "catalog_resolve_value"], readonly ["searchVocabulary", "GET", "/api/v1/catalog/vocabulary/search", "catalog_vocabulary_search"], readonly ["resolve", "POST", "/api/v1/resolve", "resolve_phrases"], readonly ["bySpec", "GET", "/api/v1/search/specifications", "catalog_by_spec"], readonly ["taxonomy", "GET", "/api/v1/taxonomy/categories", "get_category_taxonomy"], readonly ["productTypeCoverage", "GET", "/api/v1/taxonomy/coverage", "get_product_type_status_coverage"], readonly ["whoami", "GET", "/api/v1/whoami", "whoami"], readonly ["coordinate", "POST", "/api/v1/pairings/coordinate", "coordinate_materials"], readonly ["demand", "GET", "/api/v1/demand", "get_material_demand"], readonly ["colours.palette", "POST", "/api/v1/search/palettes", "search_by_palette"], readonly ["extractPalette", "POST", "/api/v1/search/palettes/extract", "extract_image_palette"], readonly ["colours.gradient", "POST", "/api/v1/search/gradients", "search_by_gradient"], readonly ["specificationFacets", "GET", "/api/v1/catalog/specifications/facets", "list_spec_facets"], readonly ["attributeValues", "GET", "/api/v1/catalog/attributes/{attributeId}/values", "list_attribute_values"], readonly ["applicableSpecs", "GET", "/api/v1/taxonomy/categories/{key}/specs", "get_applicable_specs"], readonly ["glossary", "GET", "/api/v1/glossary/{term}", "explain_material_term"], readonly ["brands", "GET", "/api/v1/brands", "list_brands"], readonly ["brand", "GET", "/api/v1/brands/{brandSlug}", "get_brand_profile"], readonly ["brandColourDeck", "GET", "/api/v1/brands/{brandSlug}/colours", "brand_colour_deck"], readonly ["uploadSourceMaterial", "POST", "/api/v1/source-material", "upload_source_material"], readonly ["sourceMaterialBatch", "GET", "/api/v1/source-material/{batchId}", "get_source_material_batch"], readonly ["sourceMaterialComments.list", "GET", "/api/v1/source-material/{batchId}/sources/{sourceId}/comments", "list_source_material_comments"], readonly ["sourceMaterialComments.post", "POST", "/api/v1/source-material/{batchId}/sources/{sourceId}/comments", "post_source_material_comment"], readonly ["capabilities", "GET", "/api/v1/capabilities", "list_public_capabilities"], readonly ["createRun", "POST", "/api/v1/runs", "create_public_run"], readonly ["listRuns", "GET", "/api/v1/runs", "list_public_runs"], readonly ["run", "GET", "/api/v1/runs/{runId}", "get_public_run"], readonly ["runSchedule", "GET", "/api/v1/runs/{runId}/schedule", "get_run_finish_schedule"], readonly ["citation", "GET", "/api/v1/citations/{citationId}", "get_verdict_citation"], readonly ["streamRunEvents", "GET", "/api/v1/runs/{runId}/events", "list_public_run_events"], readonly ["resumeRun", "POST", "/api/v1/runs/{runId}/resume", "resume_public_run"], readonly ["cancelRun", "POST", "/api/v1/runs/{runId}/cancel", "cancel_public_run"], readonly ["varyScheme", "POST", "/api/v1/schemes/vary", "vary_schemes"], readonly ["slotPools", "POST", "/api/v1/schemes/pools", "slot_pools"], readonly ["createProject", "POST", "/api/v1/projects", "create_box_project"], readonly ["listProjects", "GET", "/api/v1/projects", "list_box_projects"], readonly ["getProject", "GET", "/api/v1/projects/{projectId}", "get_box_project"], readonly ["appendProjectEvent", "POST", "/api/v1/projects/{projectId}/events", "append_box_project_event"], readonly ["demandBatch", "POST", "/api/v1/demand/batch", "get_demand_batch"], readonly ["codeAdvisory", "POST", "/api/v1/codes/advisory", "resolveCodeAdvisory"], readonly ["codes.context", "GET", "/api/v1/codes/context", "list_code_context"], readonly ["codes.requirements", "GET", "/api/v1/codes/requirements", "list_code_requirements"]];
|
|
2
|
+
declare const OPERATION_DEFINITIONS: readonly [readonly ["brandMostSampled", "GET", "/api/v1/brands/most-sampled", "brands.most_sampled"], readonly ["colours.complete", "POST", "/api/v1/colours/palettes/complete", "complete_interior_palette"], readonly ["colours.discover", "GET", "/api/v1/colours/palettes", "discover_interior_palettes"], readonly ["samplizeColorVecCache", "GET", "/api/v1/catalogues/samplize/colorvec", "samplize_colorvec_cache"], readonly ["samplizeCatalogueSearch", "POST", "/api/v1/catalogues/samplize/search", "samplize_catalogue_search"], readonly ["scheduleReferences.list", "GET", "/api/v1/schedules/{scheduleId}/references", "list_schedule_reference_feedback"], readonly ["scheduleReferences.put", "PUT", "/api/v1/schedules/{scheduleId}/references/{referenceId}", "put_schedule_reference_feedback"], 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 ["identify", "POST", "/api/v1/identify", "retrieval.identify"], readonly ["compare", "POST", "/api/v1/compare", "retrieval.compare"], readonly ["createCorrection", "POST", "/api/v1/corrections", "corrections.create"], readonly ["getCorrection", "GET", "/api/v1/corrections/{correctionId}", "corrections.get"], readonly ["listCorrections", "GET", "/api/v1/corrections", "corrections.list"], 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 ["match", "POST", "/api/v1/search/match", "match_material"], readonly ["rejectMatchResult", "POST", "/api/v1/search/match/{responseId}/rejections", "reject_match_result"], readonly ["matchRejections", "GET", "/api/v1/search/match/{responseId}/rejections", "list_match_rejections"], readonly ["byColour", "GET", "/api/v1/search/colours", "search_by_colour"], readonly ["material", "GET", "/api/v1/materials/{variantId}", "get_material"], 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 ["siblings", "GET", "/api/v1/materials/{variantId}/siblings", "get_material_siblings"], readonly ["materialBlocks", "GET", "/api/v1/materials/{variantId}/blocks", "list_material_blocks"], readonly ["materialAssets", "GET", "/api/v1/materials/{variantId}/assets", "list_material_assets"], readonly ["materialRenderAssets", "GET", "/api/v1/materials/{variantId}/render-assets", "get_material_render_assets"], readonly ["materialDocuments", "GET", "/api/v1/materials/{variantId}/documents", "list_material_documents"], readonly ["exploration.operators", "GET", "/api/v1/materials/{variantId}/operators", "list_material_operators"], readonly ["exploration.candidates", "POST", "/api/v1/materials/{variantId}/candidates", "read_material_candidates"], readonly ["schema", "GET", "/api/v1/schema/blocks", "list_schema_blocks"], readonly ["schema", "GET", "/api/v1/schema/attributes", "list_schema_attributes"], readonly ["schema", "GET", "/api/v1/schema/verticals", "list_schema_verticals"], readonly ["schema", "GET", "/api/v1/schema/product-types", "list_schema_product_types"], readonly ["schema", "GET", "/api/v1/schema/units", "list_schema_units"], readonly ["schema", "GET", "/api/v1/schema/value-dictionaries", "list_schema_value_dictionaries"], readonly ["schema", "GET", "/api/v1/schema/source-requirements", "list_schema_source_requirements"], readonly ["schema", "GET", "/api/v1/schema/product-type-templates", "list_schema_product_type_templates"], readonly ["schema", "GET", "/api/v1/schema/mappings", "list_schema_mappings"], readonly ["pairings", "GET", "/api/v1/materials/{variantId}/pairings", "get_material_pairings"], readonly ["findSubstitutes", "POST", "/api/v1/materials/{variantId}/substitutes", "find_material_substitutes"], 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 ["materials", "POST", "/api/v1/materials/batch", "get_materials_batch_post"], readonly ["materialsCached", "GET", "/api/v1/materials/batch", "get_materials_batch_get"], readonly ["browse", "GET", "/api/v1/search/browse", "search_browse_by_colour"], readonly ["colourFacets", "GET", "/api/v1/colours/facets", "get_colour_facets"], readonly ["colours.profiles", "GET", "/api/v1/colours/profiles", "get_category_colour_profiles"], readonly ["colours.stats", "GET", "/api/v1/colours/stats", "get_colour_stats"], readonly ["resolveColour", "GET", "/api/v1/search/colours/resolve", "resolve_colour_name"], readonly ["suggestColour", "GET", "/api/v1/search/colours/suggest", "suggest_colour_names"], readonly ["suggest", "GET", "/api/v1/search/suggest", "search_suggest"], readonly ["resolveAttribute", "GET", "/api/v1/catalog/attributes/resolve", "catalog_resolve_attribute"], readonly ["resolveAttributeValue", "GET", "/api/v1/catalog/attributes/{attributeId}/values/resolve", "catalog_resolve_value"], readonly ["searchVocabulary", "GET", "/api/v1/catalog/vocabulary/search", "catalog_vocabulary_search"], readonly ["resolve", "POST", "/api/v1/resolve", "resolve_phrases"], readonly ["bySpec", "GET", "/api/v1/search/specifications", "catalog_by_spec"], readonly ["taxonomy", "GET", "/api/v1/taxonomy/categories", "get_category_taxonomy"], readonly ["productTypeCoverage", "GET", "/api/v1/taxonomy/coverage", "get_product_type_status_coverage"], readonly ["whoami", "GET", "/api/v1/whoami", "whoami"], readonly ["coordinate", "POST", "/api/v1/pairings/coordinate", "coordinate_materials"], readonly ["demand", "GET", "/api/v1/demand", "get_material_demand"], readonly ["colours.palette", "POST", "/api/v1/search/palettes", "search_by_palette"], readonly ["extractPalette", "POST", "/api/v1/search/palettes/extract", "extract_image_palette"], readonly ["colours.gradient", "POST", "/api/v1/search/gradients", "search_by_gradient"], readonly ["specificationFacets", "GET", "/api/v1/catalog/specifications/facets", "list_spec_facets"], readonly ["attributeValues", "GET", "/api/v1/catalog/attributes/{attributeId}/values", "list_attribute_values"], readonly ["applicableSpecs", "GET", "/api/v1/taxonomy/categories/{key}/specs", "get_applicable_specs"], readonly ["glossary", "GET", "/api/v1/glossary/{term}", "explain_material_term"], readonly ["brands", "GET", "/api/v1/brands", "list_brands"], readonly ["brand", "GET", "/api/v1/brands/{brandSlug}", "get_brand_profile"], readonly ["brandColourDeck", "GET", "/api/v1/brands/{brandSlug}/colours", "brand_colour_deck"], readonly ["uploadSourceMaterial", "POST", "/api/v1/source-material", "upload_source_material"], readonly ["sourceMaterialBatch", "GET", "/api/v1/source-material/{batchId}", "get_source_material_batch"], readonly ["sourceMaterialComments.list", "GET", "/api/v1/source-material/{batchId}/sources/{sourceId}/comments", "list_source_material_comments"], readonly ["sourceMaterialComments.post", "POST", "/api/v1/source-material/{batchId}/sources/{sourceId}/comments", "post_source_material_comment"], readonly ["capabilities", "GET", "/api/v1/capabilities", "list_public_capabilities"], readonly ["createRun", "POST", "/api/v1/runs", "create_public_run"], readonly ["listRuns", "GET", "/api/v1/runs", "list_public_runs"], readonly ["run", "GET", "/api/v1/runs/{runId}", "get_public_run"], readonly ["runSchedule", "GET", "/api/v1/runs/{runId}/schedule", "get_run_finish_schedule"], readonly ["citation", "GET", "/api/v1/citations/{citationId}", "get_verdict_citation"], readonly ["streamRunEvents", "GET", "/api/v1/runs/{runId}/events", "list_public_run_events"], readonly ["resumeRun", "POST", "/api/v1/runs/{runId}/resume", "resume_public_run"], readonly ["cancelRun", "POST", "/api/v1/runs/{runId}/cancel", "cancel_public_run"], readonly ["varyScheme", "POST", "/api/v1/schemes/vary", "vary_schemes"], readonly ["slotPools", "POST", "/api/v1/schemes/pools", "slot_pools"], readonly ["createProject", "POST", "/api/v1/projects", "create_box_project"], readonly ["listProjects", "GET", "/api/v1/projects", "list_box_projects"], readonly ["getProject", "GET", "/api/v1/projects/{projectId}", "get_box_project"], readonly ["appendProjectEvent", "POST", "/api/v1/projects/{projectId}/events", "append_box_project_event"], readonly ["demandBatch", "POST", "/api/v1/demand/batch", "get_demand_batch"], readonly ["codeAdvisory", "POST", "/api/v1/codes/advisory", "resolveCodeAdvisory"], readonly ["codes.context", "GET", "/api/v1/codes/context", "list_code_context"], readonly ["codes.requirements", "GET", "/api/v1/codes/requirements", "list_code_requirements"]];
|
|
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
|
@@ -82,6 +82,18 @@ const OPERATION_DEFINITIONS = [
|
|
|
82
82
|
],
|
|
83
83
|
["searchGet", "GET", "/api/v1/search", "search_materials_get"],
|
|
84
84
|
["match", "POST", "/api/v1/search/match", "match_material"],
|
|
85
|
+
[
|
|
86
|
+
"rejectMatchResult",
|
|
87
|
+
"POST",
|
|
88
|
+
"/api/v1/search/match/{responseId}/rejections",
|
|
89
|
+
"reject_match_result",
|
|
90
|
+
],
|
|
91
|
+
[
|
|
92
|
+
"matchRejections",
|
|
93
|
+
"GET",
|
|
94
|
+
"/api/v1/search/match/{responseId}/rejections",
|
|
95
|
+
"list_match_rejections",
|
|
96
|
+
],
|
|
85
97
|
["byColour", "GET", "/api/v1/search/colours", "search_by_colour"],
|
|
86
98
|
["material", "GET", "/api/v1/materials/{variantId}", "get_material"],
|
|
87
99
|
[
|
package/package.json
CHANGED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Colour-name resolution (GET `/api/v1/search/colours/resolve`): the resolved
|
|
3
|
+
* colour, and whether the named paint is a variant in the catalogue.
|
|
4
|
+
*/
|
|
5
|
+
import type { CorpusScope } from "./corpus-scope-types.js";
|
|
6
|
+
import type { VariantId } from "./identifiers.js";
|
|
7
|
+
import type { OpenEnum } from "./types.js";
|
|
8
|
+
/** Options for `resolveColour`. */
|
|
9
|
+
export interface ResolveColourOptions {
|
|
10
|
+
/**
|
|
11
|
+
* Sets `inScope` on each catalogue variant the lookup reports. It never
|
|
12
|
+
* narrows the lookup. Absent leaves every `inScope` null.
|
|
13
|
+
*/
|
|
14
|
+
corpusScope?: CorpusScope;
|
|
15
|
+
}
|
|
16
|
+
/** One catalogue variant carrying the named paint. */
|
|
17
|
+
export interface ResolveColourCatalogueVariant {
|
|
18
|
+
variantId: VariantId;
|
|
19
|
+
/** The brand exactly as stored, suspect or not. */
|
|
20
|
+
brand: {
|
|
21
|
+
id: string;
|
|
22
|
+
slug: string;
|
|
23
|
+
name: string;
|
|
24
|
+
};
|
|
25
|
+
/** Whether the variant is in the requested scope; null when none was asked for. */
|
|
26
|
+
inScope: boolean | null;
|
|
27
|
+
/**
|
|
28
|
+
* True when the stored brand is Samplize, a sampling channel, and the listing
|
|
29
|
+
* is not Samplize's own: the colour is another maker's, so `brand` is not who
|
|
30
|
+
* made it. The variant is still the right one for the name.
|
|
31
|
+
*/
|
|
32
|
+
parentageSuspect: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Whether the named paint is a variant in the catalogue. Exact, global, and
|
|
36
|
+
* never narrowed by `corpusScope`, and run only for a `brand` library hit.
|
|
37
|
+
* `not-in-catalogue` means the catalogue was searched and nothing carries the
|
|
38
|
+
* paint; `not-looked-up` means there was no one maker's paint to search for.
|
|
39
|
+
*/
|
|
40
|
+
export type ResolveColourVariant = ({
|
|
41
|
+
status: "matched";
|
|
42
|
+
} & ResolveColourCatalogueVariant) | {
|
|
43
|
+
status: "ambiguous";
|
|
44
|
+
candidates: ResolveColourCatalogueVariant[];
|
|
45
|
+
} | {
|
|
46
|
+
status: "not-in-catalogue";
|
|
47
|
+
} | {
|
|
48
|
+
status: "not-looked-up";
|
|
49
|
+
reason: OpenEnum<"reference-colour" | "descriptive-colour" | "no-paint-identity" | "generic-colour" | "several-paints">;
|
|
50
|
+
};
|
|
51
|
+
export interface ResolveColourResponse {
|
|
52
|
+
match: {
|
|
53
|
+
hex: string;
|
|
54
|
+
name: string;
|
|
55
|
+
code?: string;
|
|
56
|
+
/** The ColorScope library the colour resolved in. Not necessarily a maker. */
|
|
57
|
+
libraryId?: string;
|
|
58
|
+
/**
|
|
59
|
+
* The library's own type: `brand` is a maker's paint, `reference` a colour
|
|
60
|
+
* standard (RAL, Pantone, HKS), `core` ColorScope's descriptive vocabulary.
|
|
61
|
+
* Present exactly when `libraryId` is. Only a `brand` hit is looked up.
|
|
62
|
+
*/
|
|
63
|
+
libraryType?: OpenEnum<"brand" | "reference" | "core" | "consumer">;
|
|
64
|
+
/** The catalogue lookup for the name. Absent from servers that predate it. */
|
|
65
|
+
variant?: ResolveColourVariant;
|
|
66
|
+
} | null;
|
|
67
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -37,7 +37,7 @@ export interface SearchEmptyOutcomeCounts {
|
|
|
37
37
|
*/
|
|
38
38
|
export type SearchEmptyOutcome = {
|
|
39
39
|
kind: "proven-corpus-empty";
|
|
40
|
-
basis: OpenEnum<"spec-allowlist" | "brand-scope">;
|
|
40
|
+
basis: OpenEnum<"spec-allowlist" | "brand-scope" | "brand-product-type">;
|
|
41
41
|
exhaustive: true;
|
|
42
42
|
sourceEmpty?: boolean | null;
|
|
43
43
|
counts?: SearchEmptyOutcomeCounts;
|
package/types.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ import type { BySpecVerdict } from "./by-spec-types.js";
|
|
|
29
29
|
*/
|
|
30
30
|
import type { CorpusScopeReceipt } from "./corpus-scope-types.js";
|
|
31
31
|
import type { Cursor, ProductId, VariantId } from "./identifiers.js";
|
|
32
|
-
import type { MaterialDetail, MaterialTile } from "./material-types.js";
|
|
32
|
+
import type { MaterialDetail, MaterialTile, SiblingTile } from "./material-types.js";
|
|
33
33
|
import type { QueryUnderstanding } from "./query-understanding-types.js";
|
|
34
34
|
import type { CollapsedVariant, SearchAnatomyMember } from "./search-collapse-types.js";
|
|
35
35
|
import type { MoodInterpretation } from "./search-mood-types.js";
|
|
@@ -83,7 +83,7 @@ export interface MaterialColour {
|
|
|
83
83
|
}
|
|
84
84
|
/** Where the served image came from. */
|
|
85
85
|
export type ImageSource = OpenEnum<"r2" | "origin">;
|
|
86
|
-
export type { DimensionEntry, MaterialAvailability, MaterialDetail, MaterialFacet, MaterialSuccessor, MaterialTile, } from "./material-types.js";
|
|
86
|
+
export type { DimensionEntry, MaterialAvailability, MaterialDetail, MaterialFacet, MaterialSuccessor, MaterialTile, SiblingTile, } from "./material-types.js";
|
|
87
87
|
/** Per-signal scores, present on a result when `explain` was requested. */
|
|
88
88
|
export interface SearchResultSignals {
|
|
89
89
|
/** Voyage similarity in the dedicated variant text-portrait space. */
|
|
@@ -602,10 +602,10 @@ export interface PairingsResponse {
|
|
|
602
602
|
export interface MaterialResponse {
|
|
603
603
|
material: MaterialDetail;
|
|
604
604
|
/** Present only when `include: "siblings"` was requested. */
|
|
605
|
-
siblings?:
|
|
605
|
+
siblings?: SiblingTile[];
|
|
606
606
|
}
|
|
607
607
|
export interface SiblingsResponse {
|
|
608
|
-
siblings:
|
|
608
|
+
siblings: SiblingTile[];
|
|
609
609
|
}
|
|
610
610
|
/**
|
|
611
611
|
* Batch read of tile projections. `materials` is NOT positional — resolve by
|
|
@@ -625,14 +625,6 @@ export interface MaterialsBatchDetailResponse {
|
|
|
625
625
|
/** Requested ids that resolved to nothing. Echoed verbatim, opaque. */
|
|
626
626
|
missingIds: VariantId[];
|
|
627
627
|
}
|
|
628
|
-
export interface ResolveColourResponse {
|
|
629
|
-
match: {
|
|
630
|
-
hex: string;
|
|
631
|
-
name: string;
|
|
632
|
-
code?: string;
|
|
633
|
-
libraryId?: string;
|
|
634
|
-
} | null;
|
|
635
|
-
}
|
|
636
628
|
export interface SuggestColourResponse {
|
|
637
629
|
suggestions: Array<{
|
|
638
630
|
term: string;
|
|
@@ -655,6 +647,7 @@ export interface ResolveAttributeResponse {
|
|
|
655
647
|
}
|
|
656
648
|
export type * from "./catalog-discovery-types.js";
|
|
657
649
|
export type * from "./resolve-types.js";
|
|
650
|
+
export type * from "./resolve-colour-types.js";
|
|
658
651
|
export type * from "./suggest-types.js";
|
|
659
652
|
export type * from "./by-spec-types.js";
|
|
660
653
|
export interface WhoamiResponse {
|