@instruments/materialgraph 0.25.0 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/association-types.d.ts +38 -27
- package/associations-client.d.ts +4 -4
- package/associations-client.js +3 -10
- package/attribution-types.d.ts +4 -4
- package/brand-types.d.ts +14 -6
- package/brands-client.d.ts +7 -38
- package/brands-client.js +10 -40
- package/by-colour-types.d.ts +58 -31
- package/by-spec-types.d.ts +6 -73
- package/by-spec-types.js +7 -5
- package/catalog-discovery-types.d.ts +11 -26
- package/catalogue-client.d.ts +16 -35
- package/catalogue-client.js +32 -67
- package/catalogue-types.d.ts +44 -4
- package/categories-client.d.ts +63 -0
- package/categories-client.js +48 -0
- package/category-types.d.ts +114 -0
- package/citation-types.d.ts +4 -4
- package/client-config.d.ts +4 -6
- package/client-config.js +2 -4
- package/client-source-material-comments.d.ts +4 -4
- package/client-source-material-comments.js +4 -38
- package/client-vocabulary.d.ts +7 -9
- package/client-vocabulary.js +22 -30
- package/client.d.ts +110 -244
- package/client.js +217 -387
- package/codes-client.d.ts +2 -2
- package/codes-client.js +8 -8
- package/codes-types.d.ts +55 -34
- package/colour-aggregate-types.d.ts +24 -24
- package/colours-client.d.ts +6 -11
- package/colours-client.js +11 -19
- package/coordinate-client.d.ts +2 -2
- package/coordinate-client.js +1 -13
- package/corpus-scope-types.d.ts +3 -3
- package/corpus-scope-types.js +1 -25
- package/demand-batch-types.d.ts +18 -18
- package/demand-types.d.ts +24 -24
- package/errors.d.ts +13 -13
- package/errors.js +54 -52
- package/http-transport.d.ts +13 -21
- package/http-transport.js +31 -28
- package/identify-types.d.ts +54 -44
- package/identify-types.js +5 -3
- package/index.d.ts +11 -27
- package/index.js +4 -6
- package/list-variant-facets-types.d.ts +60 -0
- package/list-variants-types.d.ts +142 -0
- package/list-variants-types.js +12 -0
- package/match-stream-types.d.ts +45 -32
- package/match-stream-types.js +2 -0
- package/match-stream.d.ts +2 -2
- package/match-stream.js +67 -49
- package/match-types.d.ts +32 -8
- package/material-asset-types.d.ts +89 -69
- package/material-block-types.d.ts +8 -6
- package/material-composition-client.d.ts +21 -0
- package/material-composition-client.js +13 -0
- package/material-composition-types.d.ts +403 -0
- package/material-query-plan-types.d.ts +61 -145
- package/material-resources-client.d.ts +12 -10
- package/material-resources-client.js +27 -22
- package/material-types.d.ts +16 -24
- package/ndjson.js +16 -8
- package/operations.d.ts +6 -6
- package/operations.js +29 -156
- package/package.json +5 -1
- package/palette-search-types.d.ts +87 -52
- package/query-understanding-types.d.ts +65 -40
- package/resolve-client.d.ts +8 -12
- package/resolve-client.js +9 -13
- package/resolve-colour-types.d.ts +8 -8
- package/resolve-types.d.ts +10 -10
- package/response-schemas.d.ts +20 -0
- package/response-schemas.generated.d.ts +5 -0
- package/response-schemas.generated.js +160 -0
- package/response-schemas.js +113 -0
- package/run-types.d.ts +64 -145
- package/runs.d.ts +9 -58
- package/runs.js +60 -149
- package/samplize-catalogue-types.d.ts +18 -18
- package/samplize-colorvec.d.ts +20 -20
- package/samplize-colorvec.js +66 -42
- package/schema-resource-types.d.ts +52 -39
- package/schema-resource-types.js +5 -5
- package/search-card-types.d.ts +26 -4
- package/search-index-plan-types.d.ts +70 -0
- package/search-refinement-types.d.ts +10 -40
- package/search-refinement-types.js +1 -0
- package/search-request-types.d.ts +121 -204
- package/search-response-receipt-types.d.ts +13 -253
- package/search-response-types.d.ts +2 -2
- package/search-result-validation.d.ts +3 -19
- package/search-result-validation.js +42 -183
- package/source-material-validation.d.ts +3 -3
- package/source-material-validation.js +35 -39
- package/spec-facet-types.d.ts +11 -16
- package/spec-types.d.ts +23 -16
- package/spec-types.js +8 -7
- package/specifications.d.ts +14 -72
- package/specifications.js +39 -89
- package/sse.d.ts +2 -2
- package/sse.js +32 -16
- package/substitute-types.d.ts +22 -22
- package/suggest-types.d.ts +11 -17
- package/suggest-types.js +3 -3
- package/taxonomy-coverage-types.d.ts +8 -8
- package/types.d.ts +202 -405
- package/validation.d.ts +26 -26
- package/validation.js +97 -92
- package/webmcp.d.ts +3 -3
- package/webmcp.generated.js +10 -93
- package/brand-most-sampled-types.d.ts +0 -33
- package/browse-types.d.ts +0 -236
- package/client-browse.d.ts +0 -78
- package/client-browse.js +0 -72
- package/client-exploration.d.ts +0 -9
- package/client-exploration.js +0 -7
- package/compare-types.d.ts +0 -89
- package/composition-client.d.ts +0 -33
- package/composition-client.js +0 -27
- package/composition-types.d.ts +0 -455
- package/composition-types.js +0 -10
- package/correction-types.d.ts +0 -88
- package/exploration-types.d.ts +0 -118
- package/exploration-types.js +0 -1
- package/fan-deck-types.d.ts +0 -42
- package/fan-deck-types.js +0 -9
- package/match-rejection-types.d.ts +0 -43
- package/match-rejection-types.js +0 -7
- package/palette-completion-types.d.ts +0 -115
- package/palette-completion-types.js +0 -1
- package/project-types.d.ts +0 -79
- package/project-types.js +0 -9
- package/projects.d.ts +0 -13
- package/projects.js +0 -46
- package/render-assets-types.d.ts +0 -65
- package/render-assets-types.js +0 -1
- package/run-events.d.ts +0 -106
- package/run-events.js +0 -32
- package/schedule-reference-types.d.ts +0 -46
- package/schedule-reference-types.js +0 -1
- package/schedule-references-client.d.ts +0 -14
- package/schedule-references-client.js +0 -26
- package/schedule-types.d.ts +0 -261
- package/schedule-types.js +0 -1
- package/search-collapse-types.d.ts +0 -69
- package/search-collapse-types.js +0 -1
- package/search-mood-types.d.ts +0 -6
- package/search-mood-types.js +0 -1
- package/search-window-types.d.ts +0 -25
- package/search-window-types.js +0 -1
- package/slot-pool-types.d.ts +0 -372
- package/slot-pool-types.js +0 -1
- /package/{brand-most-sampled-types.js → category-types.js} +0 -0
- /package/{browse-types.js → list-variant-facets-types.js} +0 -0
- /package/{compare-types.js → material-composition-types.js} +0 -0
- /package/{correction-types.js → search-index-plan-types.js} +0 -0
package/codes-client.d.ts
CHANGED
|
@@ -27,10 +27,10 @@ import type { CodeAdvisoryInput, CodeAdvisoryResponse, CodeContextRequest, CodeC
|
|
|
27
27
|
import type { QueryParams } from "./http-transport.js";
|
|
28
28
|
import type { SdkOperationId } from "./operations.js";
|
|
29
29
|
/** The client's own request primitives, handed down so this file owns no transport. */
|
|
30
|
-
export
|
|
30
|
+
export type CodesTransport = {
|
|
31
31
|
get<T>(operationId: SdkOperationId, query?: QueryParams, signal?: AbortSignal): Promise<T>;
|
|
32
32
|
post<T>(operationId: SdkOperationId, body: unknown, signal?: AbortSignal): Promise<T>;
|
|
33
|
-
}
|
|
33
|
+
};
|
|
34
34
|
export declare class CodesClient {
|
|
35
35
|
#private;
|
|
36
36
|
constructor(transport: CodesTransport);
|
package/codes-client.js
CHANGED
|
@@ -27,8 +27,8 @@ export class CodesClient {
|
|
|
27
27
|
* // `model_baseline` means unamended model IBC stood in for this AHJ's own table.
|
|
28
28
|
* console.log(texas?.coverage, texas?.adoptionNote);
|
|
29
29
|
*/
|
|
30
|
-
context(signal) {
|
|
31
|
-
return this.#transport.get("list_code_context", undefined, signal);
|
|
30
|
+
async context(signal) {
|
|
31
|
+
return await this.#transport.get("list_code_context", undefined, signal);
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* THE QUESTION: "what does this space DEMAND?" — before any candidate exists.
|
|
@@ -53,13 +53,13 @@ export class CodesClient {
|
|
|
53
53
|
* });
|
|
54
54
|
* requirements.map((r) => `${r.dimension}: ${r.label} (${r.section})`);
|
|
55
55
|
*/
|
|
56
|
-
requirements(input, signal) {
|
|
57
|
-
return this.#transport.get("list_code_requirements", {
|
|
56
|
+
async requirements(input, signal) {
|
|
57
|
+
return await this.#transport.get("list_code_requirements", {
|
|
58
58
|
jurisdiction: input.jurisdictionId,
|
|
59
|
-
sprinklered: input.sprinklered,
|
|
60
59
|
occupancy: input.occupancyGroup,
|
|
61
|
-
space: input.spaceType,
|
|
62
60
|
room: input.roomType,
|
|
61
|
+
space: input.spaceType,
|
|
62
|
+
sprinklered: input.sprinklered,
|
|
63
63
|
}, signal);
|
|
64
64
|
}
|
|
65
65
|
/**
|
|
@@ -93,7 +93,7 @@ export class CodesClient {
|
|
|
93
93
|
* // `unverified` means no comparable rating is on file — common, never a pass.
|
|
94
94
|
* const blocked = advisory.results.filter((r) => r.summary?.status === "shortfall");
|
|
95
95
|
*/
|
|
96
|
-
advisory(input, signal) {
|
|
97
|
-
return this.#transport.post("resolveCodeAdvisory", input, signal);
|
|
96
|
+
async advisory(input, signal) {
|
|
97
|
+
return await this.#transport.post("resolveCodeAdvisory", input, signal);
|
|
98
98
|
}
|
|
99
99
|
}
|
package/codes-types.d.ts
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* model code as adopted, never a legal determination.
|
|
15
15
|
*/
|
|
16
16
|
import type { VariantId } from "./identifiers.js";
|
|
17
|
+
import type { FilterGroups } from "./list-variants-types.js";
|
|
17
18
|
import type { OpenEnum } from "./types.js";
|
|
18
19
|
/**
|
|
19
20
|
* A code context: the space the registry is queried for.
|
|
@@ -47,7 +48,7 @@ import type { OpenEnum } from "./types.js";
|
|
|
47
48
|
* locations, and the room correlations themselves — from
|
|
48
49
|
* {@link CodesClient.context}. Nothing here should be hardcoded.
|
|
49
50
|
*/
|
|
50
|
-
export
|
|
51
|
+
export type CodeContextRequest = {
|
|
51
52
|
/** A seeded jurisdiction id (e.g. `"us-tx"`); an unknown id is a 400 listing the seeded set. */
|
|
52
53
|
jurisdictionId: string;
|
|
53
54
|
/**
|
|
@@ -69,29 +70,29 @@ export interface CodeContextRequest {
|
|
|
69
70
|
roomType?: string;
|
|
70
71
|
/** Whether the space is sprinklered — relaxes several fire-finish floors. No default. */
|
|
71
72
|
sprinklered: boolean;
|
|
72
|
-
}
|
|
73
|
-
export
|
|
73
|
+
};
|
|
74
|
+
export type CodeAdvisoryInput = {
|
|
74
75
|
/**
|
|
75
76
|
* 1–100 opaque variant ids to badge, echoed back in `results` in this exact
|
|
76
77
|
* order and cardinality (duplicates are echoed, never collapsed). Preserve
|
|
77
78
|
* them verbatim — never parse or construct one.
|
|
78
79
|
*/
|
|
79
80
|
variantIds: VariantId[];
|
|
80
|
-
}
|
|
81
|
+
} & CodeContextRequest;
|
|
81
82
|
/** The resolved jurisdiction the verdicts were evaluated against. */
|
|
82
|
-
export
|
|
83
|
+
export type CodeAdvisoryJurisdiction = {
|
|
83
84
|
id: string;
|
|
84
85
|
name: string;
|
|
85
86
|
codeFamily: string;
|
|
86
87
|
edition: string;
|
|
87
88
|
adoptionNote: string;
|
|
88
|
-
}
|
|
89
|
+
};
|
|
89
90
|
/** The echoed evaluation context (the space the badges apply to). */
|
|
90
|
-
export
|
|
91
|
+
export type CodeAdvisoryContext = {
|
|
91
92
|
occupancyGroup: string;
|
|
92
93
|
spaceType: string;
|
|
93
94
|
sprinklered: boolean;
|
|
94
|
-
}
|
|
95
|
+
};
|
|
95
96
|
/**
|
|
96
97
|
* What one material is, and therefore what it was held to. `dimensions` are the
|
|
97
98
|
* regulatory dimensions the material can be scored on; `basis` names which
|
|
@@ -104,7 +105,7 @@ export interface CodeAdvisoryContext {
|
|
|
104
105
|
* list under `product_type` / `application` / `both` is a genuine intersection;
|
|
105
106
|
* a full list under `unresolved` is the map falling short.
|
|
106
107
|
*/
|
|
107
|
-
export
|
|
108
|
+
export type MaterialCodeProfile = {
|
|
108
109
|
/** The variant's accepted primary product type, or null if it has none. */
|
|
109
110
|
productTypeId: string | null;
|
|
110
111
|
/** The variant's accepted `applications` terms, as stored. */
|
|
@@ -112,17 +113,17 @@ export interface MaterialCodeProfile {
|
|
|
112
113
|
/** Regulatory dimensions this material can be held to. Empty ONLY when `basis` is `unresolved`. */
|
|
113
114
|
dimensions: OpenEnum<"fire" | "floor" | "slip" | "decorative">[];
|
|
114
115
|
basis: OpenEnum<"product_type" | "application" | "both" | "unresolved">;
|
|
115
|
-
}
|
|
116
|
+
};
|
|
116
117
|
/** Why one requirement the space imposes was excluded from this material's `requirements`. */
|
|
117
|
-
export
|
|
118
|
+
export type CodeRequirementExclusion = {
|
|
118
119
|
requirementId: string;
|
|
119
120
|
dimension: OpenEnum<"fire" | "floor" | "slip" | "decorative">;
|
|
120
121
|
reason: OpenEnum<"not_a_material_dimension">;
|
|
121
122
|
/** One readable line, e.g. `"Slip resistance is not a dimension wallcovering answers for."`. */
|
|
122
123
|
detail: string;
|
|
123
|
-
}
|
|
124
|
+
};
|
|
124
125
|
/** The threshold one requirement imposes: a class floor and/or a numeric floor. */
|
|
125
|
-
export
|
|
126
|
+
export type CodeRequirementThreshold = {
|
|
126
127
|
/** The IBC classification scale this requirement is measured on (open id). */
|
|
127
128
|
scale: string;
|
|
128
129
|
/** The minimum acceptable class on `scale`, or null when only a numeric floor applies. */
|
|
@@ -133,7 +134,7 @@ export interface CodeRequirementThreshold {
|
|
|
133
134
|
value: number;
|
|
134
135
|
unit: string;
|
|
135
136
|
} | null;
|
|
136
|
-
}
|
|
137
|
+
};
|
|
137
138
|
/**
|
|
138
139
|
* The accepted fact a verdict was decided from — null when the material carried
|
|
139
140
|
* none, which is exactly the case that produces `verdict: "unknown"`.
|
|
@@ -143,14 +144,14 @@ export interface CodeRequirementThreshold {
|
|
|
143
144
|
* `derived` value at low confidence is a materially different statement from one
|
|
144
145
|
* resting on a `tested` figure.
|
|
145
146
|
*/
|
|
146
|
-
export
|
|
147
|
+
export type CodeRequirementEvidence = {
|
|
147
148
|
attributeId: OpenEnum<"fire_classifications" | "slip_resistance_dcof">;
|
|
148
149
|
value: string;
|
|
149
150
|
confidence: number | null;
|
|
150
151
|
sourceBasis: string | null;
|
|
151
|
-
}
|
|
152
|
+
};
|
|
152
153
|
/** One requirement badged against one material. */
|
|
153
|
-
export
|
|
154
|
+
export type CodeRequirementVerdict = {
|
|
154
155
|
requirementId: string;
|
|
155
156
|
dimension: OpenEnum<"fire" | "floor" | "slip" | "decorative">;
|
|
156
157
|
section: string;
|
|
@@ -167,13 +168,13 @@ export interface CodeRequirementVerdict {
|
|
|
167
168
|
evidence: CodeRequirementEvidence | null;
|
|
168
169
|
/** The AHJ advisory caveat — model code as adopted, never a legal determination. */
|
|
169
170
|
caveat: string;
|
|
170
|
-
}
|
|
171
|
+
};
|
|
171
172
|
/**
|
|
172
173
|
* One candidate's requirement verdicts folded into a single status and sentence.
|
|
173
174
|
* A shortfall outranks an unknown, and an unknown NEVER rolls up to a pass:
|
|
174
175
|
* `not_applicable` (nothing applied) is deliberately distinct from `meets`.
|
|
175
176
|
*/
|
|
176
|
-
export
|
|
177
|
+
export type CodeAdvisorySummary = {
|
|
177
178
|
/**
|
|
178
179
|
* The rolled-up card, and what each token licenses:
|
|
179
180
|
* - `meets` — every applicable requirement was `meets`. Advisory pass.
|
|
@@ -189,9 +190,9 @@ export interface CodeAdvisorySummary {
|
|
|
189
190
|
headline: string;
|
|
190
191
|
shortfallDimensions: OpenEnum<"fire" | "floor" | "slip" | "decorative">[];
|
|
191
192
|
unverifiedDimensions: OpenEnum<"fire" | "floor" | "slip" | "decorative">[];
|
|
192
|
-
}
|
|
193
|
+
};
|
|
193
194
|
/** Per-variant advisory outcome, in input order. */
|
|
194
|
-
export
|
|
195
|
+
export type CodeAdvisoryVariantResult = {
|
|
195
196
|
/** Opaque — echoed verbatim from `variantIds`, in that position. */
|
|
196
197
|
variantId: VariantId;
|
|
197
198
|
/** `evaluated` when the id resolved; `unknown_variant` (with `requirements: []`) when it did not. */
|
|
@@ -204,9 +205,9 @@ export interface CodeAdvisoryVariantResult {
|
|
|
204
205
|
notApplicable: CodeRequirementExclusion[];
|
|
205
206
|
/** The rolled-up card, or null for an id that resolved to nothing. */
|
|
206
207
|
summary: CodeAdvisorySummary | null;
|
|
207
|
-
}
|
|
208
|
+
};
|
|
208
209
|
/** The `POST /api/v1/codes/advisory` envelope — per-variant, per-requirement verdicts. */
|
|
209
|
-
export
|
|
210
|
+
export type CodeAdvisoryResponse = {
|
|
210
211
|
jurisdiction: CodeAdvisoryJurisdiction;
|
|
211
212
|
/** The context AS SUPPLIED, echoed verbatim. */
|
|
212
213
|
context: CodeAdvisoryContext;
|
|
@@ -215,9 +216,9 @@ export interface CodeAdvisoryResponse {
|
|
|
215
216
|
/** The AHJ advisory caveat, at the envelope level too. */
|
|
216
217
|
caveat: string;
|
|
217
218
|
results: CodeAdvisoryVariantResult[];
|
|
218
|
-
}
|
|
219
|
+
};
|
|
219
220
|
/** Where a resolved axis came from: stated outright, or correlated from a room type. */
|
|
220
|
-
export
|
|
221
|
+
export type ResolvedCodeContext = {
|
|
221
222
|
jurisdictionId: string;
|
|
222
223
|
occupancyGroup: string;
|
|
223
224
|
/** The canonical finish-location term id the registry was queried with. */
|
|
@@ -226,7 +227,7 @@ export interface ResolvedCodeContext {
|
|
|
226
227
|
basis: OpenEnum<"explicit" | "derived_from_room">;
|
|
227
228
|
/** The `room` term the axes were correlated from, or null. */
|
|
228
229
|
roomType: string | null;
|
|
229
|
-
}
|
|
230
|
+
};
|
|
230
231
|
/**
|
|
231
232
|
* How far a jurisdiction's rows have been reviewed against that AHJ's own tables.
|
|
232
233
|
*
|
|
@@ -236,7 +237,7 @@ export interface ResolvedCodeContext {
|
|
|
236
237
|
* say "per model IBC" rather than naming the jurisdiction as the authority.
|
|
237
238
|
*/
|
|
238
239
|
export type CodeCoverageTier = OpenEnum<"thorough" | "model_baseline">;
|
|
239
|
-
export
|
|
240
|
+
export type CodeJurisdictionSummary = {
|
|
240
241
|
id: string;
|
|
241
242
|
name: string;
|
|
242
243
|
codeFamily: string;
|
|
@@ -244,9 +245,9 @@ export interface CodeJurisdictionSummary {
|
|
|
244
245
|
coverage: CodeCoverageTier;
|
|
245
246
|
/** One honest line on how the model code actually applies in this jurisdiction. */
|
|
246
247
|
adoptionNote: string;
|
|
247
|
-
}
|
|
248
|
+
};
|
|
248
249
|
/** The `GET /api/v1/codes/context` envelope — the vocabulary for stating a context. */
|
|
249
|
-
export
|
|
250
|
+
export type CodeContextResponse = {
|
|
250
251
|
jurisdictions: CodeJurisdictionSummary[];
|
|
251
252
|
occupancyGroups: {
|
|
252
253
|
id: string;
|
|
@@ -280,9 +281,9 @@ export interface CodeContextResponse {
|
|
|
280
281
|
}[];
|
|
281
282
|
/** The AHJ advisory caveat. */
|
|
282
283
|
caveat: string;
|
|
283
|
-
}
|
|
284
|
+
};
|
|
284
285
|
/** One requirement a context imposes, independent of any candidate material. */
|
|
285
|
-
export
|
|
286
|
+
export type CodeRequirementListing = {
|
|
286
287
|
requirementId: string;
|
|
287
288
|
dimension: OpenEnum<"fire" | "floor" | "slip" | "decorative">;
|
|
288
289
|
/** The code section this demand is cited from. */
|
|
@@ -291,14 +292,34 @@ export interface CodeRequirementListing {
|
|
|
291
292
|
requirement: CodeRequirementThreshold;
|
|
292
293
|
/** One readable line, e.g. `"Class A or better · ASTM E84 / UL 723"`. */
|
|
293
294
|
label: string;
|
|
294
|
-
}
|
|
295
|
+
};
|
|
296
|
+
/** Why one requirement the context imposes could not become a `list_variants` filter predicate. */
|
|
297
|
+
export type CodeSpecFilterUnexpressible = {
|
|
298
|
+
requirementId: string;
|
|
299
|
+
dimension: OpenEnum<"fire" | "floor" | "slip" | "decorative">;
|
|
300
|
+
reason: OpenEnum<"no_matchable_tokens" | "unsupported_scale" | "no_floor">;
|
|
301
|
+
/** One readable line naming why, e.g. `"Scale ... has no ordinal definition..."`. */
|
|
302
|
+
detail: string;
|
|
303
|
+
};
|
|
295
304
|
/**
|
|
296
305
|
* The `GET /api/v1/codes/requirements` envelope. An empty `requirements` array
|
|
297
306
|
* means the registry holds nothing for this context — it is not a pass.
|
|
298
307
|
*/
|
|
299
|
-
export
|
|
308
|
+
export type CodeRequirementsResponse = {
|
|
300
309
|
jurisdiction: CodeJurisdictionSummary;
|
|
301
310
|
context: ResolvedCodeContext;
|
|
302
311
|
requirements: CodeRequirementListing[];
|
|
312
|
+
/**
|
|
313
|
+
* The same requirements as a ready-to-use `list_variants` `filters` group
|
|
314
|
+
* (MG-2222, `{terms, numbers, presence}`) — pass it straight through as
|
|
315
|
+
* `listVariants({ filters })`.
|
|
316
|
+
* `null` when nothing here is filterable; read `specFilterUnexpressible`
|
|
317
|
+
* for why, not an empty `requirements` list.
|
|
318
|
+
*/
|
|
319
|
+
specFilter: FilterGroups | null;
|
|
320
|
+
/** The dimensions `specFilter` actually narrows on — a subset of `requirements`' dimensions. */
|
|
321
|
+
specFilterApplied: OpenEnum<"fire" | "floor" | "slip" | "decorative">[];
|
|
322
|
+
/** Requirements that could not be turned into a filter predicate, and why. */
|
|
323
|
+
specFilterUnexpressible: CodeSpecFilterUnexpressible[];
|
|
303
324
|
caveat: string;
|
|
304
|
-
}
|
|
325
|
+
};
|
|
@@ -17,7 +17,7 @@ export type CategoryTier = OpenEnum<"group" | "type" | "merged">;
|
|
|
17
17
|
/** How the endpoint picks which colours to keep. */
|
|
18
18
|
export type ColourProfileSelect = OpenEnum<"frequency" | "diverse">;
|
|
19
19
|
/** One representative colour bucket of a category. */
|
|
20
|
-
export
|
|
20
|
+
export type CategoryColour = {
|
|
21
21
|
hex: string;
|
|
22
22
|
oklab: {
|
|
23
23
|
l: number;
|
|
@@ -27,8 +27,8 @@ export interface CategoryColour {
|
|
|
27
27
|
variantCount: number;
|
|
28
28
|
/** This bucket's share of the category's coloured variants, 0–1. */
|
|
29
29
|
proportion: number;
|
|
30
|
-
}
|
|
31
|
-
export
|
|
30
|
+
};
|
|
31
|
+
export type CategoryColourProfile = {
|
|
32
32
|
categoryKey: string;
|
|
33
33
|
level: CategoryTier;
|
|
34
34
|
name: string;
|
|
@@ -42,22 +42,22 @@ export interface CategoryColourProfile {
|
|
|
42
42
|
avgLightness: number;
|
|
43
43
|
avgChroma: number;
|
|
44
44
|
colours: CategoryColour[];
|
|
45
|
-
}
|
|
45
|
+
};
|
|
46
46
|
/**
|
|
47
47
|
* The snapshot a profile response was computed from. Compare `variantCount`
|
|
48
48
|
* against `colours/stats`' `corpus.withColour` to see how complete the
|
|
49
49
|
* underlying materialized view currently is, and `refreshedAt` for its age.
|
|
50
50
|
*/
|
|
51
|
-
export
|
|
51
|
+
export type CategoryColourProfilesBasis = {
|
|
52
52
|
variantCount: number;
|
|
53
53
|
refreshedAt: string | null;
|
|
54
|
-
}
|
|
55
|
-
export
|
|
54
|
+
};
|
|
55
|
+
export type CategoryColourProfilesResponse = {
|
|
56
56
|
profiles: CategoryColourProfile[];
|
|
57
57
|
basis: CategoryColourProfilesBasis;
|
|
58
|
-
}
|
|
58
|
+
};
|
|
59
59
|
/** Request parameters for `colours.profiles()`. */
|
|
60
|
-
export
|
|
60
|
+
export type ColourProfilesParams = {
|
|
61
61
|
/** 1–8 category keys, at the tier named by `groupBy`. */
|
|
62
62
|
productTypeIds: readonly string[];
|
|
63
63
|
/**
|
|
@@ -69,31 +69,31 @@ export interface ColourProfilesParams {
|
|
|
69
69
|
topN?: number;
|
|
70
70
|
/** `"diverse"` maximises visual distinctness instead of frequency. */
|
|
71
71
|
select?: "frequency" | "diverse";
|
|
72
|
-
}
|
|
73
|
-
export
|
|
72
|
+
};
|
|
73
|
+
export type ColourStatsCorpus = {
|
|
74
74
|
variants: number;
|
|
75
75
|
withColour: number;
|
|
76
76
|
/** `withColour / variants`, 0–1. */
|
|
77
77
|
coverage: number;
|
|
78
|
-
}
|
|
79
|
-
export
|
|
78
|
+
};
|
|
79
|
+
export type ColourStatsFamily = {
|
|
80
80
|
id: string;
|
|
81
81
|
label: string;
|
|
82
82
|
variants: number;
|
|
83
83
|
brands: number;
|
|
84
|
-
}
|
|
85
|
-
export
|
|
84
|
+
};
|
|
85
|
+
export type ColourStatsGroup = {
|
|
86
86
|
key: string;
|
|
87
87
|
name: string;
|
|
88
88
|
productTypes: number;
|
|
89
89
|
variants: number;
|
|
90
|
-
}
|
|
90
|
+
};
|
|
91
91
|
/**
|
|
92
92
|
* One cell of the brand x category x colour-family matrix — the shape that
|
|
93
93
|
* answers questions no single dimension can, such as "how many whites does
|
|
94
94
|
* Benjamin Moore offer in paint".
|
|
95
95
|
*/
|
|
96
|
-
export
|
|
96
|
+
export type ColourStatsRow = {
|
|
97
97
|
/** Opaque brand id — the join key for brand reads. Never parse it. */
|
|
98
98
|
brandId: string;
|
|
99
99
|
brandSlug: string;
|
|
@@ -110,9 +110,9 @@ export interface ColourStatsRow {
|
|
|
110
110
|
* `colour_family`. Not every variant of the brand.
|
|
111
111
|
*/
|
|
112
112
|
variants: number;
|
|
113
|
-
}
|
|
113
|
+
};
|
|
114
114
|
/** How to narrow the matrix. Passing ANY of these asks for `rows`. */
|
|
115
|
-
export
|
|
115
|
+
export type ColourStatsParams = {
|
|
116
116
|
/** `"brand,category"` — ask for the whole matrix, unscoped. */
|
|
117
117
|
groupBy?: string;
|
|
118
118
|
brandId?: string;
|
|
@@ -124,9 +124,9 @@ export interface ColourStatsParams {
|
|
|
124
124
|
categoryKey?: string;
|
|
125
125
|
family?: string;
|
|
126
126
|
limit?: number;
|
|
127
|
-
}
|
|
127
|
+
};
|
|
128
128
|
/** Where each section came from, how fresh it is, and what it does NOT answer. */
|
|
129
|
-
export
|
|
129
|
+
export type ColourStatsBasis = {
|
|
130
130
|
corpus: string;
|
|
131
131
|
families: string;
|
|
132
132
|
groups: string;
|
|
@@ -139,8 +139,8 @@ export interface ColourStatsBasis {
|
|
|
139
139
|
*/
|
|
140
140
|
rows?: string;
|
|
141
141
|
omissions: string[];
|
|
142
|
-
}
|
|
143
|
-
export
|
|
142
|
+
};
|
|
143
|
+
export type ColourStatsResponse = {
|
|
144
144
|
corpus: ColourStatsCorpus;
|
|
145
145
|
families: ColourStatsFamily[];
|
|
146
146
|
groups: ColourStatsGroup[];
|
|
@@ -160,4 +160,4 @@ export interface ColourStatsResponse {
|
|
|
160
160
|
/** TRUE when the matrix exceeded the cap and `rows` is a prefix. */
|
|
161
161
|
rowsTruncated?: boolean;
|
|
162
162
|
basis: ColourStatsBasis;
|
|
163
|
-
}
|
|
163
|
+
};
|
package/colours-client.d.ts
CHANGED
|
@@ -9,8 +9,8 @@ import type { SdkOperationId } from "./operations.js";
|
|
|
9
9
|
* client facade: "how much colour does the graph hold at all" (`stats`), "what
|
|
10
10
|
* colours does this category come in" (`profiles`), "what goes with these
|
|
11
11
|
* colours" (`palette`), and "what moves from this colour to that one"
|
|
12
|
-
* (`gradient`). `mg.codes`
|
|
13
|
-
*
|
|
12
|
+
* (`gradient`). `mg.codes` sets the precedent for a namespace when a
|
|
13
|
+
* capability is a family rather than a single verb.
|
|
14
14
|
*
|
|
15
15
|
* The namespace holds no transport of its own: the client hands it a bound
|
|
16
16
|
* `get`/`post`, so auth, rate-limit accounting and error shaping stay in one
|
|
@@ -28,27 +28,22 @@ import type { SdkOperationId } from "./operations.js";
|
|
|
28
28
|
* convenience wrapper.
|
|
29
29
|
* - A colour NAME rather than a hex → `mg.resolveColour(name)` first.
|
|
30
30
|
* - Colour WORDS (families, moods, undertones) → `mg.colourFacets()`.
|
|
31
|
-
* - Walking the corpus by lightness/vividness → `mg.
|
|
32
|
-
* - Colour as one signal among words
|
|
31
|
+
* - Walking the corpus by lightness/vividness → `mg.listVariants({ orderBy })`.
|
|
32
|
+
* - Colour as one signal among words and a seed → `mg.search(...)`.
|
|
33
33
|
*
|
|
34
34
|
* And the honesty rule the whole lens rests on: every colour here is DERIVED
|
|
35
35
|
* FROM PRODUCT IMAGERY, not declared by the manufacturer. Report visual
|
|
36
36
|
* likeness, never a stated colour specification.
|
|
37
37
|
*/
|
|
38
|
-
import type { PaletteCompleteInput, PaletteCompleteResponse, PaletteDiscoverInput, PaletteDiscoverResponse } from "./palette-completion-types.js";
|
|
39
38
|
import type { SearchGradientInput, SearchGradientResponse, SearchPaletteInput, SearchPaletteResponse } from "./palette-search-types.js";
|
|
40
39
|
/** The client's own request primitives, handed down so this file owns no transport. */
|
|
41
|
-
export
|
|
40
|
+
export type ColoursTransport = {
|
|
42
41
|
get<T>(operationId: SdkOperationId, query?: QueryParams, signal?: AbortSignal): Promise<T>;
|
|
43
42
|
post<T>(operationId: SdkOperationId, body: unknown, signal?: AbortSignal): Promise<T>;
|
|
44
|
-
}
|
|
43
|
+
};
|
|
45
44
|
export declare class ColoursClient {
|
|
46
45
|
#private;
|
|
47
46
|
constructor(transport: ColoursTransport);
|
|
48
|
-
/** Complete exact retained colors against a shared published interior reference. No Cart mutation. */
|
|
49
|
-
complete(input: PaletteCompleteInput, signal?: AbortSignal): Promise<PaletteCompleteResponse>;
|
|
50
|
-
/** Browse diverse published interior compositions against a version-pinned eligible catalogue. */
|
|
51
|
-
discover(input: PaletteDiscoverInput, signal?: AbortSignal): Promise<PaletteDiscoverResponse>;
|
|
52
47
|
/**
|
|
53
48
|
* THE QUESTION: "what colours does this CATEGORY come in?" — the representative
|
|
54
49
|
* palette of 1–8 categories in ONE call (GET `/api/v1/colours/profiles`).
|
package/colours-client.js
CHANGED
|
@@ -3,14 +3,6 @@ export class ColoursClient {
|
|
|
3
3
|
constructor(transport) {
|
|
4
4
|
this.#transport = transport;
|
|
5
5
|
}
|
|
6
|
-
/** Complete exact retained colors against a shared published interior reference. No Cart mutation. */
|
|
7
|
-
complete(input, signal) {
|
|
8
|
-
return this.#transport.post("complete_interior_palette", input, signal);
|
|
9
|
-
}
|
|
10
|
-
/** Browse diverse published interior compositions against a version-pinned eligible catalogue. */
|
|
11
|
-
discover(input, signal) {
|
|
12
|
-
return this.#transport.get("discover_interior_palettes", { ...input }, signal);
|
|
13
|
-
}
|
|
14
6
|
/**
|
|
15
7
|
* THE QUESTION: "what colours does this CATEGORY come in?" — the representative
|
|
16
8
|
* palette of 1–8 categories in ONE call (GET `/api/v1/colours/profiles`).
|
|
@@ -39,12 +31,12 @@ export class ColoursClient {
|
|
|
39
31
|
* A selected category with no colour data comes back as a zero-count profile,
|
|
40
32
|
* not a missing key.
|
|
41
33
|
*/
|
|
42
|
-
profiles(params, signal) {
|
|
43
|
-
return this.#transport.get("get_category_colour_profiles", {
|
|
44
|
-
productTypeIds: params.productTypeIds.join(","),
|
|
34
|
+
async profiles(params, signal) {
|
|
35
|
+
return await this.#transport.get("get_category_colour_profiles", {
|
|
45
36
|
groupBy: params.groupBy,
|
|
46
|
-
|
|
37
|
+
productTypeIds: params.productTypeIds.join(","),
|
|
47
38
|
select: params.select,
|
|
39
|
+
topN: params.topN,
|
|
48
40
|
}, signal);
|
|
49
41
|
}
|
|
50
42
|
/**
|
|
@@ -68,13 +60,13 @@ export class ColoursClient {
|
|
|
68
60
|
* `brandSlug` to join on. Without any of those parameters the payload is the
|
|
69
61
|
* platform-wide one and `rows` is absent. `families` is never scoped by them.
|
|
70
62
|
*/
|
|
71
|
-
stats(params = {}, signal) {
|
|
72
|
-
return this.#transport.get("get_colour_stats", {
|
|
73
|
-
groupBy: params.groupBy,
|
|
63
|
+
async stats(params = {}, signal) {
|
|
64
|
+
return await this.#transport.get("get_colour_stats", {
|
|
74
65
|
brandId: params.brandId,
|
|
75
66
|
brandSlug: params.brandSlug,
|
|
76
67
|
categoryKey: params.categoryKey,
|
|
77
68
|
family: params.family,
|
|
69
|
+
groupBy: params.groupBy,
|
|
78
70
|
limit: params.limit,
|
|
79
71
|
}, signal);
|
|
80
72
|
}
|
|
@@ -109,8 +101,8 @@ export class ColoursClient {
|
|
|
109
101
|
* ],
|
|
110
102
|
* });
|
|
111
103
|
*/
|
|
112
|
-
palette(input, signal) {
|
|
113
|
-
return this.#transport.post("search_by_palette", input, signal);
|
|
104
|
+
async palette(input, signal) {
|
|
105
|
+
return await this.#transport.post("search_by_palette", input, signal);
|
|
114
106
|
}
|
|
115
107
|
/**
|
|
116
108
|
* THE QUESTION: "what moves from this colour to that one?" — materials that
|
|
@@ -124,7 +116,7 @@ export class ColoursClient {
|
|
|
124
116
|
* one that travels the whole way, and a flat single-colour material is
|
|
125
117
|
* rejected outright however close its hue sits to the path.
|
|
126
118
|
*/
|
|
127
|
-
gradient(input, signal) {
|
|
128
|
-
return this.#transport.post("search_by_gradient", input, signal);
|
|
119
|
+
async gradient(input, signal) {
|
|
120
|
+
return await this.#transport.post("search_by_gradient", input, signal);
|
|
129
121
|
}
|
|
130
122
|
}
|
package/coordinate-client.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* limit, in the same per-lens shape as `brands-client` / `codes-client` /
|
|
8
8
|
* `colours-client`. Behaviour is unchanged.
|
|
9
9
|
*/
|
|
10
|
-
import { HttpTransport } from "./http-transport.js";
|
|
10
|
+
import type { HttpTransport } from "./http-transport.js";
|
|
11
11
|
import type { CoordinateInput, CoordinateResponse } from "./types.js";
|
|
12
12
|
/**
|
|
13
13
|
* THE QUESTION: "here is my whole scheme so far — what completes it?" The
|
|
@@ -20,4 +20,4 @@ import type { CoordinateInput, CoordinateResponse } from "./types.js";
|
|
|
20
20
|
* scheme is COLOURS rather than materials. Check `unresolved` before presenting:
|
|
21
21
|
* a reference that resolved to nothing is named there, not dropped.
|
|
22
22
|
*/
|
|
23
|
-
export declare
|
|
23
|
+
export declare const coordinate: (transport: HttpTransport, input: CoordinateInput, signal?: AbortSignal) => Promise<CoordinateResponse>;
|
package/coordinate-client.js
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The COORDINATION lens: given several materials already chosen, what completes
|
|
3
|
-
* them. A thin wrapper over the shared {@link HttpTransport};
|
|
4
|
-
* `MaterialGraphClient.coordinate` delegates here.
|
|
5
|
-
*
|
|
6
|
-
* Extracted from `client.ts`, which sits above the repository's source-size
|
|
7
|
-
* limit, in the same per-lens shape as `brands-client` / `codes-client` /
|
|
8
|
-
* `colours-client`. Behaviour is unchanged.
|
|
9
|
-
*/
|
|
10
|
-
import { HttpTransport } from "./http-transport.js";
|
|
11
1
|
import { resolveOperation } from "./operations.js";
|
|
12
2
|
/**
|
|
13
3
|
* THE QUESTION: "here is my whole scheme so far — what completes it?" The
|
|
@@ -20,6 +10,4 @@ import { resolveOperation } from "./operations.js";
|
|
|
20
10
|
* scheme is COLOURS rather than materials. Check `unresolved` before presenting:
|
|
21
11
|
* a reference that resolved to nothing is named there, not dropped.
|
|
22
12
|
*/
|
|
23
|
-
export
|
|
24
|
-
return transport.requestJson(resolveOperation("coordinate_materials"), { body: input, signal });
|
|
25
|
-
}
|
|
13
|
+
export const coordinate = async (transport, input, signal) => await transport.requestJson(resolveOperation("coordinate_materials"), { body: input, signal });
|
package/corpus-scope-types.d.ts
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* and this build does not, so a new scope is not a compile error in a client
|
|
23
23
|
* that simply has not been republished yet.
|
|
24
24
|
*/
|
|
25
|
-
import {
|
|
25
|
+
import type { OpenEnum } from "./types.js";
|
|
26
26
|
/**
|
|
27
27
|
* Every corpus a caller may ask for.
|
|
28
28
|
*
|
|
@@ -50,8 +50,8 @@ export type CorpusScope = OpenEnum<"samplizeCatalogue" | "all" | "designShopOrde
|
|
|
50
50
|
* the counts: a short page under a scope is a small SCOPED corpus, never a
|
|
51
51
|
* truncated one.
|
|
52
52
|
*/
|
|
53
|
-
export
|
|
53
|
+
export type CorpusScopeReceipt = {
|
|
54
54
|
scope: CorpusScope;
|
|
55
55
|
/** What the scope admits, in one sentence, for a human reader. */
|
|
56
56
|
description: string;
|
|
57
|
-
}
|
|
57
|
+
};
|
package/corpus-scope-types.js
CHANGED
|
@@ -1,25 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* The corpus scope vocabulary, declared ONCE for the whole client.
|
|
3
|
-
*
|
|
4
|
-
* ── Why this file exists ──
|
|
5
|
-
* Until MG-1168 the union was spelled inline at six places across the SDK, and
|
|
6
|
-
* five of them had gone stale: `designShopOrderable` shipped in MG-1144 and
|
|
7
|
-
* reached only the search request type, so a TypeScript consumer could send the
|
|
8
|
-
* scope to `/search` and not to `/browse` — against a server that had accepted
|
|
9
|
-
* it on both since the day it landed. The narrowed RECEIPT types were worse
|
|
10
|
-
* than the request ones, because a caller could not even name the scope it got
|
|
11
|
-
* back.
|
|
12
|
-
*
|
|
13
|
-
* That is the third hop of the reachability checklist failing quietly: server
|
|
14
|
-
* correct, published client unable to reach the surface. One alias means the
|
|
15
|
-
* next member is one edit here rather than six edits nobody is reminded to
|
|
16
|
-
* make. `corpus-scope-parity.test.ts` in `apps/web/config` fails if this file
|
|
17
|
-
* falls behind `CORPUS_SCOPES`.
|
|
18
|
-
*
|
|
19
|
-
* ── Why `OpenEnum` ──
|
|
20
|
-
* The server may add a scope before a consumer upgrades. `OpenEnum` keeps the
|
|
21
|
-
* known members as autocomplete while still accepting a string the server knows
|
|
22
|
-
* and this build does not, so a new scope is not a compile error in a client
|
|
23
|
-
* that simply has not been republished yet.
|
|
24
|
-
*/
|
|
25
|
-
import {} from "./types.js";
|
|
1
|
+
export {};
|