@instruments/materialgraph 0.24.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/association-types.d.ts +20 -20
- package/associations-client.d.ts +4 -4
- package/associations-client.js +3 -10
- package/attribution-types.d.ts +3 -3
- package/brand-most-sampled-types.d.ts +4 -4
- package/brand-types.d.ts +6 -6
- package/brands-client.d.ts +4 -4
- package/brands-client.js +9 -13
- package/browse-types.d.ts +8 -8
- package/by-colour-types.d.ts +18 -18
- package/by-spec-types.d.ts +14 -14
- package/catalog-discovery-types.d.ts +14 -14
- package/catalogue-client.d.ts +4 -4
- package/catalogue-client.js +38 -37
- package/catalogue-types.d.ts +4 -4
- package/citation-types.d.ts +4 -4
- package/client-browse.d.ts +4 -4
- package/client-browse.js +24 -25
- package/client-config.d.ts +2 -2
- package/client-exploration.d.ts +3 -3
- package/client-exploration.js +4 -6
- package/client-source-material-comments.d.ts +4 -4
- package/client-source-material-comments.js +4 -38
- package/client-vocabulary.d.ts +8 -8
- package/client-vocabulary.js +20 -30
- package/client.d.ts +11 -45
- package/client.js +143 -188
- package/codes-client.d.ts +2 -2
- package/codes-client.js +8 -8
- package/codes-types.d.ts +34 -34
- package/colour-aggregate-types.d.ts +24 -24
- package/colours-client.d.ts +2 -2
- package/colours-client.js +15 -15
- package/compare-types.d.ts +10 -10
- package/composition-client.d.ts +3 -3
- package/composition-client.js +8 -7
- package/composition-types.d.ts +12 -12
- package/coordinate-client.d.ts +2 -2
- package/coordinate-client.js +1 -13
- package/corpus-scope-types.d.ts +3 -3
- package/corpus-scope-types.js +1 -25
- package/correction-types.d.ts +10 -10
- package/demand-batch-types.d.ts +18 -18
- package/demand-types.d.ts +24 -24
- package/errors.d.ts +12 -12
- package/errors.js +53 -52
- package/exploration-types.d.ts +29 -22
- package/fan-deck-types.d.ts +6 -6
- package/http-transport.d.ts +13 -21
- package/http-transport.js +31 -28
- package/identify-types.d.ts +10 -10
- package/index.d.ts +0 -6
- package/index.js +0 -2
- package/match-rejection-types.d.ts +6 -6
- package/match-stream-types.d.ts +32 -32
- package/match-stream.d.ts +2 -2
- package/match-stream.js +55 -41
- package/match-types.d.ts +8 -8
- package/material-asset-types.d.ts +26 -26
- package/material-block-types.d.ts +6 -6
- package/material-query-plan-types.d.ts +26 -26
- package/material-resources-client.d.ts +5 -5
- package/material-resources-client.js +10 -20
- package/material-types.d.ts +12 -12
- package/ndjson.js +16 -8
- package/operations.d.ts +6 -6
- package/operations.js +9 -39
- package/package.json +2 -2
- package/palette-completion-types.d.ts +22 -22
- package/palette-search-types.d.ts +28 -28
- package/query-understanding-types.d.ts +43 -36
- package/render-assets-types.d.ts +8 -8
- package/resolve-client.d.ts +2 -2
- package/resolve-client.js +4 -6
- package/resolve-colour-types.d.ts +22 -6
- package/resolve-types.d.ts +10 -10
- package/run-types.d.ts +70 -70
- package/runs.d.ts +13 -26
- package/runs.js +77 -89
- package/samplize-catalogue-types.d.ts +18 -18
- package/samplize-colorvec.d.ts +20 -20
- package/samplize-colorvec.js +66 -42
- package/schema-resource-types.d.ts +38 -38
- package/schema-resource-types.js +5 -5
- package/search-card-types.d.ts +14 -5
- package/search-collapse-types.d.ts +4 -4
- package/search-mood-types.d.ts +2 -2
- package/search-refinement-types.d.ts +8 -8
- package/search-request-types.d.ts +6 -6
- package/search-response-receipt-types.d.ts +135 -34
- package/search-response-types.d.ts +2 -2
- package/search-result-validation.d.ts +3 -3
- package/search-result-validation.js +53 -36
- package/search-window-types.d.ts +2 -2
- package/slot-pool-types.d.ts +20 -20
- package/source-material-validation.d.ts +3 -3
- package/source-material-validation.js +35 -39
- package/spec-facet-types.d.ts +10 -10
- package/spec-types.d.ts +6 -6
- package/specifications.d.ts +9 -25
- package/specifications.js +15 -21
- package/sse.d.ts +2 -2
- package/sse.js +32 -16
- package/substitute-types.d.ts +22 -22
- package/suggest-types.d.ts +7 -7
- package/suggest-types.js +3 -3
- package/taxonomy-coverage-types.d.ts +8 -8
- package/types.d.ts +119 -119
- package/validation.d.ts +26 -26
- package/validation.js +97 -92
- package/webmcp.d.ts +2 -2
- package/webmcp.generated.js +94 -87
- package/project-types.d.ts +0 -79
- package/project-types.js +0 -9
- package/projects.d.ts +0 -13
- package/projects.js +0 -46
- package/run-events.d.ts +0 -106
- package/run-events.js +0 -32
- package/schedule-reference-types.d.ts +0 -46
- package/schedule-reference-types.js +0 -1
- package/schedule-references-client.d.ts +0 -14
- package/schedule-references-client.js +0 -26
- package/schedule-types.d.ts +0 -261
- package/schedule-types.js +0 -1
package/association-types.d.ts
CHANGED
|
@@ -21,24 +21,24 @@ import type { ProductTypeReceipt } from "./material-types.js";
|
|
|
21
21
|
* score or used to rank. Declared associations carry no ranking at all: that is
|
|
22
22
|
* the point of them.
|
|
23
23
|
*/
|
|
24
|
-
export
|
|
24
|
+
export type DeclaredProvenance = {
|
|
25
25
|
/** The stored convention value (0.9 today). Never a per-edge measurement. */
|
|
26
26
|
confidence: number;
|
|
27
27
|
/** The manufacturer enumerated this association in their own catalog data. */
|
|
28
28
|
basis: "manufacturer_declared";
|
|
29
29
|
/** The provenance recorded on the edge — the manufacturer catalog feed. */
|
|
30
30
|
source: "warehouse";
|
|
31
|
-
}
|
|
31
|
+
};
|
|
32
32
|
/** The material the question was asked about, resolved to its identity. */
|
|
33
|
-
export
|
|
33
|
+
export type DeclaredAssociationSubject = {
|
|
34
34
|
variantId: VariantId;
|
|
35
35
|
brand: string;
|
|
36
36
|
product: string;
|
|
37
37
|
/** The variant's own name; null when it is unnamed. */
|
|
38
38
|
variantName: string | null;
|
|
39
|
-
}
|
|
39
|
+
};
|
|
40
40
|
/** One declared association, plus why it is believed. */
|
|
41
|
-
export
|
|
41
|
+
export type DeclaredAssociation = {
|
|
42
42
|
variantId: VariantId;
|
|
43
43
|
brand: string;
|
|
44
44
|
product: string;
|
|
@@ -54,7 +54,7 @@ export interface DeclaredAssociation {
|
|
|
54
54
|
/** Review receipt; proposed types are never accepted categories. */
|
|
55
55
|
productTypeReceipt: ProductTypeReceipt;
|
|
56
56
|
declared: DeclaredProvenance;
|
|
57
|
-
}
|
|
57
|
+
};
|
|
58
58
|
/**
|
|
59
59
|
* One page of declared associations.
|
|
60
60
|
*
|
|
@@ -63,7 +63,7 @@ export interface DeclaredAssociation {
|
|
|
63
63
|
* is the whole set for this subject, direction and corpus. A page is not a
|
|
64
64
|
* corpus — walk `nextCursor` before making any claim about the full set.
|
|
65
65
|
*/
|
|
66
|
-
export
|
|
66
|
+
export type DeclaredAssociationsResponse = {
|
|
67
67
|
subject: DeclaredAssociationSubject;
|
|
68
68
|
/**
|
|
69
69
|
* Constant discriminator. Its presence is how a caller tells a declared fact
|
|
@@ -77,9 +77,9 @@ export interface DeclaredAssociationsResponse {
|
|
|
77
77
|
returnedCount: number;
|
|
78
78
|
/** Present only when another page exists; pass back verbatim as `cursor`. */
|
|
79
79
|
nextCursor?: Cursor;
|
|
80
|
-
}
|
|
80
|
+
};
|
|
81
81
|
/** Options for a declared-association read. */
|
|
82
|
-
export
|
|
82
|
+
export type AssociatedOptions = {
|
|
83
83
|
/**
|
|
84
84
|
* Page size, 1–48 inclusive (default 24). The server rejects (400), not
|
|
85
85
|
* clamps, values outside this range.
|
|
@@ -99,7 +99,7 @@ export interface AssociatedOptions {
|
|
|
99
99
|
* different one is a 400, never a silently different page.
|
|
100
100
|
*/
|
|
101
101
|
cursor?: Cursor;
|
|
102
|
-
}
|
|
102
|
+
};
|
|
103
103
|
export type ApplicabilitySubject = {
|
|
104
104
|
kind: "product";
|
|
105
105
|
id: string;
|
|
@@ -108,15 +108,15 @@ export type ApplicabilitySubject = {
|
|
|
108
108
|
id: VariantId;
|
|
109
109
|
};
|
|
110
110
|
export type ApplicabilityCoverageState = "available" | "partial" | "none_declared" | "not_ingested" | "source_not_applicable" | "unavailable";
|
|
111
|
-
export
|
|
111
|
+
export type ApplicabilityCoverage = {
|
|
112
112
|
state: ApplicabilityCoverageState;
|
|
113
113
|
countKind: "exact" | "partial";
|
|
114
114
|
declaredCount: number | null;
|
|
115
115
|
sourceAuthority: string;
|
|
116
116
|
sourceLocator: string;
|
|
117
117
|
sourceRevision: string;
|
|
118
|
-
}
|
|
119
|
-
export
|
|
118
|
+
};
|
|
119
|
+
export type ApplicabilityFact = {
|
|
120
120
|
id: string;
|
|
121
121
|
subject: ApplicabilitySubject;
|
|
122
122
|
finish: {
|
|
@@ -132,8 +132,8 @@ export interface ApplicabilityFact {
|
|
|
132
132
|
revision: string;
|
|
133
133
|
};
|
|
134
134
|
lifecycle: "active";
|
|
135
|
-
}
|
|
136
|
-
export
|
|
135
|
+
};
|
|
136
|
+
export type ApplicabilitySourceEntry = {
|
|
137
137
|
scope: {
|
|
138
138
|
sourceAuthority: string;
|
|
139
139
|
sourceLocator: string;
|
|
@@ -146,8 +146,8 @@ export interface ApplicabilitySourceEntry {
|
|
|
146
146
|
facts: ApplicabilityFact[];
|
|
147
147
|
/** Source endpoints that could not be resolved during reconciliation. */
|
|
148
148
|
unresolved: UnresolvedApplicabilityEndpoint[];
|
|
149
|
-
}
|
|
150
|
-
export
|
|
149
|
+
};
|
|
150
|
+
export type UnresolvedApplicabilityEndpoint = {
|
|
151
151
|
subjectLocator: string;
|
|
152
152
|
subjectKind: "product" | "variant" | "unknown";
|
|
153
153
|
finishLocator: string;
|
|
@@ -159,14 +159,14 @@ export interface UnresolvedApplicabilityEndpoint {
|
|
|
159
159
|
locator: string;
|
|
160
160
|
revision: string;
|
|
161
161
|
};
|
|
162
|
-
}
|
|
162
|
+
};
|
|
163
163
|
/** Source-grained response; sources are never merged or given hidden precedence. */
|
|
164
|
-
export
|
|
164
|
+
export type ApplicabilityResponse = {
|
|
165
165
|
kind: "manufacturer_declared_applicability";
|
|
166
166
|
requestedSubject: ApplicabilitySubject;
|
|
167
167
|
direction: "forward" | "reverse";
|
|
168
168
|
sources: ApplicabilitySourceEntry[];
|
|
169
|
-
}
|
|
169
|
+
};
|
|
170
170
|
export type ApplicabilityOptions = {
|
|
171
171
|
subjectKind: "product";
|
|
172
172
|
subjectId: string;
|
package/associations-client.d.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* "available on".
|
|
14
14
|
*/
|
|
15
15
|
import type { ApplicabilityOptions, ApplicabilityResponse, AssociatedOptions, DeclaredAssociationsResponse } from "./association-types.js";
|
|
16
|
-
import { HttpTransport } from "./http-transport.js";
|
|
16
|
+
import type { HttpTransport } from "./http-transport.js";
|
|
17
17
|
import type { VariantId } from "./identifiers.js";
|
|
18
18
|
/**
|
|
19
19
|
* THE QUESTION: "what finishes can I get on THIS chair?" — the fabrics,
|
|
@@ -33,7 +33,7 @@ import type { VariantId } from "./identifiers.js";
|
|
|
33
33
|
*
|
|
34
34
|
* @param variantId The PRODUCT variant. Opaque — pass back exactly what you were given.
|
|
35
35
|
*/
|
|
36
|
-
export declare
|
|
36
|
+
export declare const declaredFinishes: (transport: HttpTransport, variantId: VariantId, options?: AssociatedOptions, signal?: AbortSignal) => Promise<DeclaredAssociationsResponse>;
|
|
37
37
|
/**
|
|
38
38
|
* THE QUESTION: "what furniture takes THIS fabric?" — the products the
|
|
39
39
|
* MANUFACTURER declares a finish variant is available on (GET
|
|
@@ -48,6 +48,6 @@ export declare function declaredFinishes(transport: HttpTransport, variantId: Va
|
|
|
48
48
|
*
|
|
49
49
|
* @param variantId The FINISH variant. Opaque — pass back exactly what you were given.
|
|
50
50
|
*/
|
|
51
|
-
export declare
|
|
51
|
+
export declare const declaredProducts: (transport: HttpTransport, variantId: VariantId, options?: AssociatedOptions, signal?: AbortSignal) => Promise<DeclaredAssociationsResponse>;
|
|
52
52
|
/** Read manufacturer-declared applicability without collapsing Product/Variant grain. */
|
|
53
|
-
export declare
|
|
53
|
+
export declare const applicability: (transport: HttpTransport, options: ApplicabilityOptions, signal?: AbortSignal) => Promise<ApplicabilityResponse>;
|
package/associations-client.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { HttpTransport } from "./http-transport.js";
|
|
2
1
|
import { resolveOperation } from "./operations.js";
|
|
3
2
|
/**
|
|
4
3
|
* THE QUESTION: "what finishes can I get on THIS chair?" — the fabrics,
|
|
@@ -18,9 +17,7 @@ import { resolveOperation } from "./operations.js";
|
|
|
18
17
|
*
|
|
19
18
|
* @param variantId The PRODUCT variant. Opaque — pass back exactly what you were given.
|
|
20
19
|
*/
|
|
21
|
-
export
|
|
22
|
-
return transport.requestJson(resolveOperation("list_associated_finishes"), { query: { variantId, ...options }, signal });
|
|
23
|
-
}
|
|
20
|
+
export const declaredFinishes = async (transport, variantId, options, signal) => await transport.requestJson(resolveOperation("list_associated_finishes"), { query: { variantId, ...options }, signal });
|
|
24
21
|
/**
|
|
25
22
|
* THE QUESTION: "what furniture takes THIS fabric?" — the products the
|
|
26
23
|
* MANUFACTURER declares a finish variant is available on (GET
|
|
@@ -35,10 +32,6 @@ export function declaredFinishes(transport, variantId, options, signal) {
|
|
|
35
32
|
*
|
|
36
33
|
* @param variantId The FINISH variant. Opaque — pass back exactly what you were given.
|
|
37
34
|
*/
|
|
38
|
-
export
|
|
39
|
-
return transport.requestJson(resolveOperation("list_associated_products"), { query: { variantId, ...options }, signal });
|
|
40
|
-
}
|
|
35
|
+
export const declaredProducts = async (transport, variantId, options, signal) => await transport.requestJson(resolveOperation("list_associated_products"), { query: { variantId, ...options }, signal });
|
|
41
36
|
/** Read manufacturer-declared applicability without collapsing Product/Variant grain. */
|
|
42
|
-
export
|
|
43
|
-
return transport.requestJson(resolveOperation("get_applicability"), { query: options, signal });
|
|
44
|
-
}
|
|
37
|
+
export const applicability = async (transport, options, signal) => await transport.requestJson(resolveOperation("get_applicability"), { query: options, signal });
|
package/attribution-types.d.ts
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* that route has no `mode`, so this is the only field its outcomes can be
|
|
19
19
|
* grouped by.
|
|
20
20
|
*/
|
|
21
|
-
export type AttributionBasis = "image" | "colour" | "text" | "lexical" | "entity-browse" | "match";
|
|
21
|
+
export type AttributionBasis = "image" | "colour" | "text" | "lexical" | "entity-browse" | "agent" | "match";
|
|
22
22
|
/**
|
|
23
23
|
* Envelope-level attribution receipt, on every successful ranked response.
|
|
24
24
|
*
|
|
@@ -37,7 +37,7 @@ export type AttributionBasis = "image" | "colour" | "text" | "lexical" | "entity
|
|
|
37
37
|
* Both fields are optional in the SDK types for one reason only: a server
|
|
38
38
|
* predating MG-1131 does not send them. Every current response does.
|
|
39
39
|
*/
|
|
40
|
-
export
|
|
40
|
+
export type ResponseAttribution = {
|
|
41
41
|
/**
|
|
42
42
|
* This response's stable id — the same value as the `X-Request-Id` header.
|
|
43
43
|
* Opaque: store it verbatim, never parse it. Group your stored outcomes by
|
|
@@ -48,4 +48,4 @@ export interface ResponseAttribution {
|
|
|
48
48
|
basis: AttributionBasis;
|
|
49
49
|
/** ISO-8601 timestamp of when the response was assembled. */
|
|
50
50
|
issuedAt: string;
|
|
51
|
-
}
|
|
51
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CandidateReadCard } from "./exploration-types.js";
|
|
2
|
-
export
|
|
2
|
+
export type BrandMostSampledResponse = {
|
|
3
3
|
data: {
|
|
4
4
|
brand: {
|
|
5
5
|
id: string;
|
|
@@ -15,14 +15,14 @@ export interface BrandMostSampledResponse {
|
|
|
15
15
|
windowStart: string;
|
|
16
16
|
windowEnd: string;
|
|
17
17
|
} | null;
|
|
18
|
-
products:
|
|
18
|
+
products: {
|
|
19
19
|
rank: number;
|
|
20
20
|
sampleOrderLines: number;
|
|
21
21
|
representativeVariantSampleOrderLines: number;
|
|
22
22
|
card: CandidateReadCard & {
|
|
23
23
|
category: string | null;
|
|
24
24
|
};
|
|
25
|
-
}
|
|
25
|
+
}[];
|
|
26
26
|
};
|
|
27
27
|
meta: {
|
|
28
28
|
operationId: "brands.most_sampled";
|
|
@@ -30,4 +30,4 @@ export interface BrandMostSampledResponse {
|
|
|
30
30
|
};
|
|
31
31
|
links: Record<string, never>;
|
|
32
32
|
warnings: never[];
|
|
33
|
-
}
|
|
33
|
+
};
|
package/brand-types.d.ts
CHANGED
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
* The SDK's one OFFSET-paginated surface — everything else that pages uses an
|
|
6
6
|
* opaque cursor. `meta` is where the page/corpus distinction is settled here.
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export type BrandsOptions = {
|
|
9
9
|
/** Fuzzy name filter. Omit for the whole collection. */
|
|
10
10
|
q?: string;
|
|
11
11
|
/** Page size. Never a bound on the collection. */
|
|
12
12
|
limit?: number;
|
|
13
13
|
/** Row offset for the next page. Paired with `meta.hasMore`. */
|
|
14
14
|
offset?: number;
|
|
15
|
-
}
|
|
16
|
-
export
|
|
15
|
+
};
|
|
16
|
+
export type BrandCatalogListItem = {
|
|
17
17
|
id: string;
|
|
18
18
|
slug: string;
|
|
19
19
|
name: string;
|
|
@@ -23,8 +23,8 @@ export interface BrandCatalogListItem {
|
|
|
23
23
|
productCount: number;
|
|
24
24
|
/** Variants ingested into MaterialGraph. A coverage figure, not a claim about the brand. */
|
|
25
25
|
variantCount: number;
|
|
26
|
-
}
|
|
27
|
-
export
|
|
26
|
+
};
|
|
27
|
+
export type BrandCatalogListPage = {
|
|
28
28
|
/** THIS PAGE. Its length is `meta.count`, never `meta.total`. */
|
|
29
29
|
items: BrandCatalogListItem[];
|
|
30
30
|
/**
|
|
@@ -41,4 +41,4 @@ export interface BrandCatalogListPage {
|
|
|
41
41
|
offset: number;
|
|
42
42
|
hasMore: boolean;
|
|
43
43
|
};
|
|
44
|
-
}
|
|
44
|
+
};
|
package/brands-client.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import type { BrandCatalogListPage, BrandsOptions } from "./brand-types.js";
|
|
12
12
|
import type { BrandFanDeck } from "./fan-deck-types.js";
|
|
13
|
-
import { HttpTransport } from "./http-transport.js";
|
|
13
|
+
import type { HttpTransport } from "./http-transport.js";
|
|
14
14
|
import type { BrandOptions, BrandProfileResponse } from "./types.js";
|
|
15
15
|
/**
|
|
16
16
|
* THE QUESTION: "whose catalogs are in here, and how big is each?" The SDK's
|
|
@@ -18,14 +18,14 @@ import type { BrandOptions, BrandProfileResponse } from "./types.js";
|
|
|
18
18
|
* `meta.hasMore` to keep walking. Instead use {@link brandProfile} for one
|
|
19
19
|
* brand's profile and trade signals.
|
|
20
20
|
*/
|
|
21
|
-
export declare
|
|
21
|
+
export declare const listBrands: (transport: HttpTransport, options?: BrandsOptions, signal?: AbortSignal) => Promise<BrandCatalogListPage>;
|
|
22
22
|
/**
|
|
23
23
|
* THE QUESTION: "who is this brand, and what do they claim?" — profile plus the
|
|
24
24
|
* trade/spec signals ON RECORD. `trade` is keyed by attribute id and an ABSENT
|
|
25
25
|
* key means no value is held — never infer `false`. Instead use `search()` to
|
|
26
26
|
* find their materials; this describes the company, not the catalog.
|
|
27
27
|
*/
|
|
28
|
-
export declare
|
|
28
|
+
export declare const brandProfile: (transport: HttpTransport, brandSlug: string, options?: BrandOptions, signal?: AbortSignal) => Promise<BrandProfileResponse>;
|
|
29
29
|
/**
|
|
30
30
|
* THE QUESTION: "show me this maker's whole range, the way a fan deck reads."
|
|
31
31
|
* Colours grouped by family — creams together, then greys, then browns — and
|
|
@@ -45,4 +45,4 @@ export declare function brandProfile(transport: HttpTransport, brandSlug: string
|
|
|
45
45
|
*
|
|
46
46
|
* @param brandSlug The brand's slug, as `listBrands()` reports it.
|
|
47
47
|
*/
|
|
48
|
-
export declare
|
|
48
|
+
export declare const brandColourDeck: (transport: HttpTransport, brandSlug: string, signal?: AbortSignal) => Promise<BrandFanDeck>;
|
package/brands-client.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { HttpTransport } from "./http-transport.js";
|
|
2
1
|
import { resolveOperation } from "./operations.js";
|
|
3
2
|
/**
|
|
4
3
|
* THE QUESTION: "whose catalogs are in here, and how big is each?" The SDK's
|
|
@@ -6,21 +5,17 @@ import { resolveOperation } from "./operations.js";
|
|
|
6
5
|
* `meta.hasMore` to keep walking. Instead use {@link brandProfile} for one
|
|
7
6
|
* brand's profile and trade signals.
|
|
8
7
|
*/
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
});
|
|
14
|
-
}
|
|
8
|
+
export const listBrands = async (transport, options = {}, signal) => await transport.requestJson(resolveOperation("list_brands"), {
|
|
9
|
+
query: { limit: options.limit, offset: options.offset, q: options.q },
|
|
10
|
+
signal,
|
|
11
|
+
});
|
|
15
12
|
/**
|
|
16
13
|
* THE QUESTION: "who is this brand, and what do they claim?" — profile plus the
|
|
17
14
|
* trade/spec signals ON RECORD. `trade` is keyed by attribute id and an ABSENT
|
|
18
15
|
* key means no value is held — never infer `false`. Instead use `search()` to
|
|
19
16
|
* find their materials; this describes the company, not the catalog.
|
|
20
17
|
*/
|
|
21
|
-
export
|
|
22
|
-
return transport.requestJson(resolveOperation("get_brand_profile"), { query: { q: options?.q }, pathParams: { brandSlug }, signal });
|
|
23
|
-
}
|
|
18
|
+
export const brandProfile = async (transport, brandSlug, options, signal) => await transport.requestJson(resolveOperation("get_brand_profile"), { pathParams: { brandSlug }, query: { q: options?.q }, signal });
|
|
24
19
|
/**
|
|
25
20
|
* THE QUESTION: "show me this maker's whole range, the way a fan deck reads."
|
|
26
21
|
* Colours grouped by family — creams together, then greys, then browns — and
|
|
@@ -40,6 +35,7 @@ export function brandProfile(transport, brandSlug, options, signal) {
|
|
|
40
35
|
*
|
|
41
36
|
* @param brandSlug The brand's slug, as `listBrands()` reports it.
|
|
42
37
|
*/
|
|
43
|
-
export
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
export const brandColourDeck = async (transport, brandSlug, signal) => await transport.requestJson(resolveOperation("brand_colour_deck"), {
|
|
39
|
+
pathParams: { brandSlug },
|
|
40
|
+
signal,
|
|
41
|
+
});
|
package/browse-types.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ import type { CorpusScope, CorpusScopeReceipt } from "./corpus-scope-types.js";
|
|
|
17
17
|
import type { Cursor, ProductId, VariantId } from "./identifiers.js";
|
|
18
18
|
import type { CountedTotal, OpenEnum, SearchFacets } from "./types.js";
|
|
19
19
|
/** One item from the pure colour-scalar browse. */
|
|
20
|
-
export
|
|
20
|
+
export type BrowseResultItem = {
|
|
21
21
|
/** Opaque — round-trip verbatim. */
|
|
22
22
|
variantId: VariantId;
|
|
23
23
|
brand: string;
|
|
@@ -53,7 +53,7 @@ export interface BrowseResultItem {
|
|
|
53
53
|
* attribute. Three states, all different.
|
|
54
54
|
*/
|
|
55
55
|
attributes?: Record<string, string | string[] | null>;
|
|
56
|
-
}
|
|
56
|
+
};
|
|
57
57
|
/**
|
|
58
58
|
* The browse orders. `name` (A→Z) is the default, `name_desc` the same index
|
|
59
59
|
* read Z→A, `recent` newest first; the rest are the colour ramps. `/search`
|
|
@@ -71,9 +71,9 @@ export type BrowseSort = OpenEnum<"name" | "name_desc" | "recent" | "light" | "d
|
|
|
71
71
|
* narrowed total — you will never get a whole-graph number beside a filtered
|
|
72
72
|
* page.
|
|
73
73
|
*/
|
|
74
|
-
export
|
|
74
|
+
export type BrowseCounts = {
|
|
75
75
|
variants: CountedTotal;
|
|
76
|
-
}
|
|
76
|
+
};
|
|
77
77
|
/**
|
|
78
78
|
* A single page of the browse — the SDK's one genuinely cursor-paginated
|
|
79
79
|
* surface. `results.length` is this page. Ask for `count: true` and `counts`
|
|
@@ -81,7 +81,7 @@ export interface BrowseCounts {
|
|
|
81
81
|
* claim can only come from walking every page (`client.browse.pages(...)` does
|
|
82
82
|
* the loop).
|
|
83
83
|
*/
|
|
84
|
-
export
|
|
84
|
+
export type BrowseResponse = {
|
|
85
85
|
/** THIS PAGE. */
|
|
86
86
|
results: BrowseResultItem[];
|
|
87
87
|
/** Opaque keyset for the next page. Absent = the walk is finished. */
|
|
@@ -129,9 +129,9 @@ export interface BrowseResponse {
|
|
|
129
129
|
* knows, orderable or not.
|
|
130
130
|
*/
|
|
131
131
|
corpusScope?: CorpusScopeReceipt;
|
|
132
|
-
}
|
|
132
|
+
};
|
|
133
133
|
/** Params for the pure colour `search/browse` surface. */
|
|
134
|
-
export
|
|
134
|
+
export type BrowseParams = {
|
|
135
135
|
/**
|
|
136
136
|
* OPTIONAL. Defaults to `name` (A→Z); `recent` is newest first.
|
|
137
137
|
*
|
|
@@ -233,4 +233,4 @@ export interface BrowseParams {
|
|
|
233
233
|
* comma-separated `returnAttributes=` parameter.
|
|
234
234
|
*/
|
|
235
235
|
returnAttributes?: readonly string[];
|
|
236
|
-
}
|
|
236
|
+
};
|
package/by-colour-types.d.ts
CHANGED
|
@@ -11,10 +11,10 @@ import type { VariantId } from "./identifiers.js";
|
|
|
11
11
|
import type { QueryUnderstanding } from "./query-understanding-types.js";
|
|
12
12
|
import type { OklabTriple, OpenEnum, PaletteSwatch } from "./types.js";
|
|
13
13
|
/** Coarse group + fine type of a colour match's primary product type. */
|
|
14
|
-
export
|
|
14
|
+
export type MatchCategory = {
|
|
15
15
|
group: string | null;
|
|
16
16
|
type: string | null;
|
|
17
|
-
}
|
|
17
|
+
};
|
|
18
18
|
/**
|
|
19
19
|
* One colour-palette match.
|
|
20
20
|
*
|
|
@@ -23,7 +23,7 @@ export interface MatchCategory {
|
|
|
23
23
|
* colour"), never as a stated colour specification. `hex` itself may be the
|
|
24
24
|
* manufacturer's published colour — read `sourceBasis` before repeating it.
|
|
25
25
|
*/
|
|
26
|
-
export
|
|
26
|
+
export type ByColourMatch = {
|
|
27
27
|
/** Opaque — round-trip verbatim. */
|
|
28
28
|
variantId: VariantId;
|
|
29
29
|
brand: string;
|
|
@@ -78,17 +78,17 @@ export interface ByColourMatch {
|
|
|
78
78
|
* manufacturer.
|
|
79
79
|
*/
|
|
80
80
|
palette?: ByColourSwatch[];
|
|
81
|
-
}
|
|
81
|
+
};
|
|
82
82
|
/** A {@link PaletteSwatch} on the colour lane, where `oklab` is always derived. */
|
|
83
|
-
export
|
|
83
|
+
export type ByColourSwatch = {
|
|
84
84
|
/** `hex` in OKLab — guaranteed present on this surface. */
|
|
85
85
|
oklab: OklabTriple;
|
|
86
|
-
}
|
|
86
|
+
} & PaletteSwatch;
|
|
87
87
|
/**
|
|
88
88
|
* Receipt for the `family` filter — ABSENT when none was asked for, so absence
|
|
89
89
|
* means "no gate ran", never "a gate that dropped nothing".
|
|
90
90
|
*/
|
|
91
|
-
export
|
|
91
|
+
export type ColourFamilyGate = {
|
|
92
92
|
/** The colorscope taxonomy family id the gate kept (normalised). */
|
|
93
93
|
family: string;
|
|
94
94
|
/** Candidates the gate examined — the retrieved pool. NOT a corpus total. */
|
|
@@ -108,30 +108,30 @@ export interface ColourFamilyGate {
|
|
|
108
108
|
* boundary.
|
|
109
109
|
*/
|
|
110
110
|
droppedOnPublishedHex?: number;
|
|
111
|
-
}
|
|
111
|
+
};
|
|
112
112
|
/** Receipt for the hard category gate and its treatment of unknown typing. */
|
|
113
|
-
export
|
|
113
|
+
export type ColourCategoryGate = {
|
|
114
114
|
/** Category names or keys the caller asked the gate to keep. */
|
|
115
115
|
requested: string[];
|
|
116
116
|
/** Only accepted primary product types can establish membership. */
|
|
117
117
|
requiresAcceptedPrimaryProductType: true;
|
|
118
118
|
/** Unknown/unclassified variants were ineligible, not proven non-members. */
|
|
119
119
|
unclassifiedVariantsExcluded: true;
|
|
120
|
-
}
|
|
120
|
+
};
|
|
121
121
|
/**
|
|
122
122
|
* Receipt for the colour-identity collapse that turns a variant-grain ranking
|
|
123
123
|
* into a page of TILES — one per (brand, product, dominant hex), one per stored
|
|
124
124
|
* photograph. The live endpoint always sends it; it is optional here only so
|
|
125
125
|
* responses captured before the collapse existed still type-check.
|
|
126
126
|
*/
|
|
127
|
-
export
|
|
127
|
+
export type ColourCollapse = {
|
|
128
128
|
/** Ranked rows the collapse examined — this page's pool, never a corpus total. */
|
|
129
129
|
considered: number;
|
|
130
130
|
/** Rows dropped for repeating a better-ranked row's brand, product and hex. */
|
|
131
131
|
droppedByIdentity: number;
|
|
132
132
|
/** Rows dropped for resolving to a better-ranked row's stored photograph. */
|
|
133
133
|
droppedBySharedImage: number;
|
|
134
|
-
}
|
|
134
|
+
};
|
|
135
135
|
/**
|
|
136
136
|
* Receipt naming which retrieval lane answered, and the colours it actually ran
|
|
137
137
|
* on. The live endpoint always sends it.
|
|
@@ -144,7 +144,7 @@ export interface ColourCollapse {
|
|
|
144
144
|
* different geometries, so `colourDistance` on a match means a different thing
|
|
145
145
|
* in each and is NOT comparable across them.
|
|
146
146
|
*/
|
|
147
|
-
export
|
|
147
|
+
export type ColourLaneReceipt = {
|
|
148
148
|
/** Which lane answered. Widened so a new server lane still type-checks. */
|
|
149
149
|
lane: OpenEnum<"containment" | "palette">;
|
|
150
150
|
/** Why this lane, in one sentence, for a human reader. */
|
|
@@ -169,9 +169,9 @@ export interface ColourLaneReceipt {
|
|
|
169
169
|
* result is not evidence that nothing holds them.
|
|
170
170
|
*/
|
|
171
171
|
droppedColours: string[];
|
|
172
|
-
}
|
|
172
|
+
};
|
|
173
173
|
/** The `search/colours` response. */
|
|
174
|
-
export
|
|
174
|
+
export type ByColourResponse = {
|
|
175
175
|
query: {
|
|
176
176
|
/** Raw query provenance, when supplied. */
|
|
177
177
|
q?: string;
|
|
@@ -234,9 +234,9 @@ export interface ByColourResponse {
|
|
|
234
234
|
corpusScope?: CorpusScopeReceipt;
|
|
235
235
|
/** Shared standard-search query-understanding receipt. */
|
|
236
236
|
understanding?: QueryUnderstanding;
|
|
237
|
-
}
|
|
237
|
+
};
|
|
238
238
|
/** Params for `search/colours`. */
|
|
239
|
-
export
|
|
239
|
+
export type ByColourParams = {
|
|
240
240
|
/** Raw material-domain query provenance for shared query understanding. */
|
|
241
241
|
q?: string;
|
|
242
242
|
/** A single hex (with or without `#`). */
|
|
@@ -290,4 +290,4 @@ export interface ByColourParams {
|
|
|
290
290
|
/** Narrow retrieval inside the server query; absent means the whole graph. */
|
|
291
291
|
corpusScope?: CorpusScope;
|
|
292
292
|
limit?: number;
|
|
293
|
-
}
|
|
293
|
+
};
|
package/by-spec-types.d.ts
CHANGED
|
@@ -8,11 +8,11 @@ import type { VariantId } from "./identifiers.js";
|
|
|
8
8
|
* — quote them wherever the value is quoted. A `null` on either means the trust
|
|
9
9
|
* is unrecorded, which is weaker than a low number, not stronger.
|
|
10
10
|
*/
|
|
11
|
-
export
|
|
11
|
+
export type BySpecMatchedCell = {
|
|
12
12
|
attributeId: string;
|
|
13
13
|
confidence: number | null;
|
|
14
14
|
sourceBasis: string | null;
|
|
15
|
-
}
|
|
15
|
+
};
|
|
16
16
|
/**
|
|
17
17
|
* The six states a verdict cell can report — and what each licenses you to say.
|
|
18
18
|
*
|
|
@@ -36,7 +36,7 @@ export type BySpecVerdictState = "matched" | "deviated" | "failed" | "unverified
|
|
|
36
36
|
* Hand-mirrors the `AttributeVerdict` contract from `@materialgraph/contracts`;
|
|
37
37
|
* the OpenAPI `CatalogBySpecResponse` schema is the source of truth on the wire.
|
|
38
38
|
*/
|
|
39
|
-
export
|
|
39
|
+
export type BySpecVerdictCell = {
|
|
40
40
|
attributeId: string;
|
|
41
41
|
state: BySpecVerdictState;
|
|
42
42
|
strength: "required" | "preferred";
|
|
@@ -73,7 +73,7 @@ export interface BySpecVerdictCell {
|
|
|
73
73
|
*/
|
|
74
74
|
trustGap: "below_confidence" | "basis_unmet" | "proposed" | null;
|
|
75
75
|
citation?: VerdictCitation;
|
|
76
|
-
}
|
|
76
|
+
};
|
|
77
77
|
/**
|
|
78
78
|
* A match's full report card: every cell, the rolled-up grade, weakest confidence.
|
|
79
79
|
*
|
|
@@ -86,18 +86,18 @@ export interface BySpecVerdictCell {
|
|
|
86
86
|
* `minConfidence` is the WEAKEST cell's confidence — the honest ceiling on the
|
|
87
87
|
* whole card, not an average. Quote it alongside the grade.
|
|
88
88
|
*/
|
|
89
|
-
export
|
|
89
|
+
export type BySpecVerdict = {
|
|
90
90
|
cells: BySpecVerdictCell[];
|
|
91
91
|
grade: "meets_all" | "close" | "hard_no";
|
|
92
92
|
minConfidence: number | null;
|
|
93
|
-
}
|
|
93
|
+
};
|
|
94
94
|
/**
|
|
95
95
|
* The verdict a materials-search hit carries (MG-625). It IS the shared
|
|
96
96
|
* {@link BySpecVerdict} shape — the single CandidateVerdict mirror — aliased here
|
|
97
97
|
* so search-surface code can name it for what it is rather than duplicating it.
|
|
98
98
|
*/
|
|
99
99
|
export type MaterialVerdict = BySpecVerdict;
|
|
100
|
-
export
|
|
100
|
+
export type BySpecMatch = {
|
|
101
101
|
/** Opaque — round-trip verbatim. */
|
|
102
102
|
variantId: VariantId;
|
|
103
103
|
brand: string;
|
|
@@ -109,7 +109,7 @@ export interface BySpecMatch {
|
|
|
109
109
|
matched: BySpecMatchedCell[];
|
|
110
110
|
minConfidence: number | null;
|
|
111
111
|
verdict: BySpecVerdict;
|
|
112
|
-
}
|
|
112
|
+
};
|
|
113
113
|
/**
|
|
114
114
|
* One criterion the server could not resolve to canonical vocabulary, with the
|
|
115
115
|
* resolver's ranked suggestions for it.
|
|
@@ -128,7 +128,7 @@ export interface BySpecMatch {
|
|
|
128
128
|
* EVERY miss is reported, not just the first, so one round trip is enough to fix
|
|
129
129
|
* a whole spec.
|
|
130
130
|
*/
|
|
131
|
-
export
|
|
131
|
+
export type BySpecUnresolvedCriterion = {
|
|
132
132
|
/** The parsed attribute id, after the route's surrounding-whitespace trim. */
|
|
133
133
|
attributeId: string;
|
|
134
134
|
/** The parsed value — never overwritten by the attribute id when that id is unknown. */
|
|
@@ -137,7 +137,7 @@ export interface BySpecUnresolvedCriterion {
|
|
|
137
137
|
reason?: "unknown_attribute_or_term" | "not_a_specification";
|
|
138
138
|
/** Ranked candidates for whichever half failed. See {@link ValueResolution}. */
|
|
139
139
|
resolution: ValueResolution;
|
|
140
|
-
}
|
|
140
|
+
};
|
|
141
141
|
/**
|
|
142
142
|
* The find-by-spec envelope — A PAGE, AND NOTHING BUT A PAGE.
|
|
143
143
|
*
|
|
@@ -151,12 +151,12 @@ export interface BySpecUnresolvedCriterion {
|
|
|
151
151
|
* And check `unresolvedCriteria` BEFORE reading any of that: when it is present
|
|
152
152
|
* the numbers beside it describe a query that never ran.
|
|
153
153
|
*/
|
|
154
|
-
export
|
|
154
|
+
export type BySpecResponse = {
|
|
155
155
|
/** The criteria as parsed — check them before trusting a surprising result. */
|
|
156
|
-
criteria:
|
|
156
|
+
criteria: {
|
|
157
157
|
attribute: string;
|
|
158
158
|
value: string;
|
|
159
|
-
}
|
|
159
|
+
}[];
|
|
160
160
|
/** `matches.length`, i.e. THIS SAMPLE under `limit`. Never a corpus total. */
|
|
161
161
|
totalMatches: number;
|
|
162
162
|
/** Distinct brands in the returned sample — a lower bound on cross-brand reach. */
|
|
@@ -178,4 +178,4 @@ export interface BySpecResponse {
|
|
|
178
178
|
* every criterion resolved and the query did run.
|
|
179
179
|
*/
|
|
180
180
|
unresolvedCriteria?: BySpecUnresolvedCriterion[];
|
|
181
|
-
}
|
|
181
|
+
};
|