@instruments/materialgraph 0.25.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 +22 -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 +1 -1
- package/palette-completion-types.d.ts +22 -22
- package/palette-search-types.d.ts +28 -28
- package/query-understanding-types.d.ts +38 -35
- 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 +8 -8
- 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 +4 -4
- 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 +5 -5
- package/search-response-receipt-types.d.ts +58 -42
- 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 -93
- 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/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
|
@@ -47,7 +47,7 @@ import type { OpenEnum } from "./types.js";
|
|
|
47
47
|
* locations, and the room correlations themselves — from
|
|
48
48
|
* {@link CodesClient.context}. Nothing here should be hardcoded.
|
|
49
49
|
*/
|
|
50
|
-
export
|
|
50
|
+
export type CodeContextRequest = {
|
|
51
51
|
/** A seeded jurisdiction id (e.g. `"us-tx"`); an unknown id is a 400 listing the seeded set. */
|
|
52
52
|
jurisdictionId: string;
|
|
53
53
|
/**
|
|
@@ -69,29 +69,29 @@ export interface CodeContextRequest {
|
|
|
69
69
|
roomType?: string;
|
|
70
70
|
/** Whether the space is sprinklered — relaxes several fire-finish floors. No default. */
|
|
71
71
|
sprinklered: boolean;
|
|
72
|
-
}
|
|
73
|
-
export
|
|
72
|
+
};
|
|
73
|
+
export type CodeAdvisoryInput = {
|
|
74
74
|
/**
|
|
75
75
|
* 1–100 opaque variant ids to badge, echoed back in `results` in this exact
|
|
76
76
|
* order and cardinality (duplicates are echoed, never collapsed). Preserve
|
|
77
77
|
* them verbatim — never parse or construct one.
|
|
78
78
|
*/
|
|
79
79
|
variantIds: VariantId[];
|
|
80
|
-
}
|
|
80
|
+
} & CodeContextRequest;
|
|
81
81
|
/** The resolved jurisdiction the verdicts were evaluated against. */
|
|
82
|
-
export
|
|
82
|
+
export type CodeAdvisoryJurisdiction = {
|
|
83
83
|
id: string;
|
|
84
84
|
name: string;
|
|
85
85
|
codeFamily: string;
|
|
86
86
|
edition: string;
|
|
87
87
|
adoptionNote: string;
|
|
88
|
-
}
|
|
88
|
+
};
|
|
89
89
|
/** The echoed evaluation context (the space the badges apply to). */
|
|
90
|
-
export
|
|
90
|
+
export type CodeAdvisoryContext = {
|
|
91
91
|
occupancyGroup: string;
|
|
92
92
|
spaceType: string;
|
|
93
93
|
sprinklered: boolean;
|
|
94
|
-
}
|
|
94
|
+
};
|
|
95
95
|
/**
|
|
96
96
|
* What one material is, and therefore what it was held to. `dimensions` are the
|
|
97
97
|
* regulatory dimensions the material can be scored on; `basis` names which
|
|
@@ -104,7 +104,7 @@ export interface CodeAdvisoryContext {
|
|
|
104
104
|
* list under `product_type` / `application` / `both` is a genuine intersection;
|
|
105
105
|
* a full list under `unresolved` is the map falling short.
|
|
106
106
|
*/
|
|
107
|
-
export
|
|
107
|
+
export type MaterialCodeProfile = {
|
|
108
108
|
/** The variant's accepted primary product type, or null if it has none. */
|
|
109
109
|
productTypeId: string | null;
|
|
110
110
|
/** The variant's accepted `applications` terms, as stored. */
|
|
@@ -112,17 +112,17 @@ export interface MaterialCodeProfile {
|
|
|
112
112
|
/** Regulatory dimensions this material can be held to. Empty ONLY when `basis` is `unresolved`. */
|
|
113
113
|
dimensions: OpenEnum<"fire" | "floor" | "slip" | "decorative">[];
|
|
114
114
|
basis: OpenEnum<"product_type" | "application" | "both" | "unresolved">;
|
|
115
|
-
}
|
|
115
|
+
};
|
|
116
116
|
/** Why one requirement the space imposes was excluded from this material's `requirements`. */
|
|
117
|
-
export
|
|
117
|
+
export type CodeRequirementExclusion = {
|
|
118
118
|
requirementId: string;
|
|
119
119
|
dimension: OpenEnum<"fire" | "floor" | "slip" | "decorative">;
|
|
120
120
|
reason: OpenEnum<"not_a_material_dimension">;
|
|
121
121
|
/** One readable line, e.g. `"Slip resistance is not a dimension wallcovering answers for."`. */
|
|
122
122
|
detail: string;
|
|
123
|
-
}
|
|
123
|
+
};
|
|
124
124
|
/** The threshold one requirement imposes: a class floor and/or a numeric floor. */
|
|
125
|
-
export
|
|
125
|
+
export type CodeRequirementThreshold = {
|
|
126
126
|
/** The IBC classification scale this requirement is measured on (open id). */
|
|
127
127
|
scale: string;
|
|
128
128
|
/** The minimum acceptable class on `scale`, or null when only a numeric floor applies. */
|
|
@@ -133,7 +133,7 @@ export interface CodeRequirementThreshold {
|
|
|
133
133
|
value: number;
|
|
134
134
|
unit: string;
|
|
135
135
|
} | null;
|
|
136
|
-
}
|
|
136
|
+
};
|
|
137
137
|
/**
|
|
138
138
|
* The accepted fact a verdict was decided from — null when the material carried
|
|
139
139
|
* none, which is exactly the case that produces `verdict: "unknown"`.
|
|
@@ -143,14 +143,14 @@ export interface CodeRequirementThreshold {
|
|
|
143
143
|
* `derived` value at low confidence is a materially different statement from one
|
|
144
144
|
* resting on a `tested` figure.
|
|
145
145
|
*/
|
|
146
|
-
export
|
|
146
|
+
export type CodeRequirementEvidence = {
|
|
147
147
|
attributeId: OpenEnum<"fire_classifications" | "slip_resistance_dcof">;
|
|
148
148
|
value: string;
|
|
149
149
|
confidence: number | null;
|
|
150
150
|
sourceBasis: string | null;
|
|
151
|
-
}
|
|
151
|
+
};
|
|
152
152
|
/** One requirement badged against one material. */
|
|
153
|
-
export
|
|
153
|
+
export type CodeRequirementVerdict = {
|
|
154
154
|
requirementId: string;
|
|
155
155
|
dimension: OpenEnum<"fire" | "floor" | "slip" | "decorative">;
|
|
156
156
|
section: string;
|
|
@@ -167,13 +167,13 @@ export interface CodeRequirementVerdict {
|
|
|
167
167
|
evidence: CodeRequirementEvidence | null;
|
|
168
168
|
/** The AHJ advisory caveat — model code as adopted, never a legal determination. */
|
|
169
169
|
caveat: string;
|
|
170
|
-
}
|
|
170
|
+
};
|
|
171
171
|
/**
|
|
172
172
|
* One candidate's requirement verdicts folded into a single status and sentence.
|
|
173
173
|
* A shortfall outranks an unknown, and an unknown NEVER rolls up to a pass:
|
|
174
174
|
* `not_applicable` (nothing applied) is deliberately distinct from `meets`.
|
|
175
175
|
*/
|
|
176
|
-
export
|
|
176
|
+
export type CodeAdvisorySummary = {
|
|
177
177
|
/**
|
|
178
178
|
* The rolled-up card, and what each token licenses:
|
|
179
179
|
* - `meets` — every applicable requirement was `meets`. Advisory pass.
|
|
@@ -189,9 +189,9 @@ export interface CodeAdvisorySummary {
|
|
|
189
189
|
headline: string;
|
|
190
190
|
shortfallDimensions: OpenEnum<"fire" | "floor" | "slip" | "decorative">[];
|
|
191
191
|
unverifiedDimensions: OpenEnum<"fire" | "floor" | "slip" | "decorative">[];
|
|
192
|
-
}
|
|
192
|
+
};
|
|
193
193
|
/** Per-variant advisory outcome, in input order. */
|
|
194
|
-
export
|
|
194
|
+
export type CodeAdvisoryVariantResult = {
|
|
195
195
|
/** Opaque — echoed verbatim from `variantIds`, in that position. */
|
|
196
196
|
variantId: VariantId;
|
|
197
197
|
/** `evaluated` when the id resolved; `unknown_variant` (with `requirements: []`) when it did not. */
|
|
@@ -204,9 +204,9 @@ export interface CodeAdvisoryVariantResult {
|
|
|
204
204
|
notApplicable: CodeRequirementExclusion[];
|
|
205
205
|
/** The rolled-up card, or null for an id that resolved to nothing. */
|
|
206
206
|
summary: CodeAdvisorySummary | null;
|
|
207
|
-
}
|
|
207
|
+
};
|
|
208
208
|
/** The `POST /api/v1/codes/advisory` envelope — per-variant, per-requirement verdicts. */
|
|
209
|
-
export
|
|
209
|
+
export type CodeAdvisoryResponse = {
|
|
210
210
|
jurisdiction: CodeAdvisoryJurisdiction;
|
|
211
211
|
/** The context AS SUPPLIED, echoed verbatim. */
|
|
212
212
|
context: CodeAdvisoryContext;
|
|
@@ -215,9 +215,9 @@ export interface CodeAdvisoryResponse {
|
|
|
215
215
|
/** The AHJ advisory caveat, at the envelope level too. */
|
|
216
216
|
caveat: string;
|
|
217
217
|
results: CodeAdvisoryVariantResult[];
|
|
218
|
-
}
|
|
218
|
+
};
|
|
219
219
|
/** Where a resolved axis came from: stated outright, or correlated from a room type. */
|
|
220
|
-
export
|
|
220
|
+
export type ResolvedCodeContext = {
|
|
221
221
|
jurisdictionId: string;
|
|
222
222
|
occupancyGroup: string;
|
|
223
223
|
/** The canonical finish-location term id the registry was queried with. */
|
|
@@ -226,7 +226,7 @@ export interface ResolvedCodeContext {
|
|
|
226
226
|
basis: OpenEnum<"explicit" | "derived_from_room">;
|
|
227
227
|
/** The `room` term the axes were correlated from, or null. */
|
|
228
228
|
roomType: string | null;
|
|
229
|
-
}
|
|
229
|
+
};
|
|
230
230
|
/**
|
|
231
231
|
* How far a jurisdiction's rows have been reviewed against that AHJ's own tables.
|
|
232
232
|
*
|
|
@@ -236,7 +236,7 @@ export interface ResolvedCodeContext {
|
|
|
236
236
|
* say "per model IBC" rather than naming the jurisdiction as the authority.
|
|
237
237
|
*/
|
|
238
238
|
export type CodeCoverageTier = OpenEnum<"thorough" | "model_baseline">;
|
|
239
|
-
export
|
|
239
|
+
export type CodeJurisdictionSummary = {
|
|
240
240
|
id: string;
|
|
241
241
|
name: string;
|
|
242
242
|
codeFamily: string;
|
|
@@ -244,9 +244,9 @@ export interface CodeJurisdictionSummary {
|
|
|
244
244
|
coverage: CodeCoverageTier;
|
|
245
245
|
/** One honest line on how the model code actually applies in this jurisdiction. */
|
|
246
246
|
adoptionNote: string;
|
|
247
|
-
}
|
|
247
|
+
};
|
|
248
248
|
/** The `GET /api/v1/codes/context` envelope — the vocabulary for stating a context. */
|
|
249
|
-
export
|
|
249
|
+
export type CodeContextResponse = {
|
|
250
250
|
jurisdictions: CodeJurisdictionSummary[];
|
|
251
251
|
occupancyGroups: {
|
|
252
252
|
id: string;
|
|
@@ -280,9 +280,9 @@ export interface CodeContextResponse {
|
|
|
280
280
|
}[];
|
|
281
281
|
/** The AHJ advisory caveat. */
|
|
282
282
|
caveat: string;
|
|
283
|
-
}
|
|
283
|
+
};
|
|
284
284
|
/** One requirement a context imposes, independent of any candidate material. */
|
|
285
|
-
export
|
|
285
|
+
export type CodeRequirementListing = {
|
|
286
286
|
requirementId: string;
|
|
287
287
|
dimension: OpenEnum<"fire" | "floor" | "slip" | "decorative">;
|
|
288
288
|
/** The code section this demand is cited from. */
|
|
@@ -291,14 +291,14 @@ export interface CodeRequirementListing {
|
|
|
291
291
|
requirement: CodeRequirementThreshold;
|
|
292
292
|
/** One readable line, e.g. `"Class A or better · ASTM E84 / UL 723"`. */
|
|
293
293
|
label: string;
|
|
294
|
-
}
|
|
294
|
+
};
|
|
295
295
|
/**
|
|
296
296
|
* The `GET /api/v1/codes/requirements` envelope. An empty `requirements` array
|
|
297
297
|
* means the registry holds nothing for this context — it is not a pass.
|
|
298
298
|
*/
|
|
299
|
-
export
|
|
299
|
+
export type CodeRequirementsResponse = {
|
|
300
300
|
jurisdiction: CodeJurisdictionSummary;
|
|
301
301
|
context: ResolvedCodeContext;
|
|
302
302
|
requirements: CodeRequirementListing[];
|
|
303
303
|
caveat: string;
|
|
304
|
-
}
|
|
304
|
+
};
|
|
@@ -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
|
@@ -38,10 +38,10 @@ import type { SdkOperationId } from "./operations.js";
|
|
|
38
38
|
import type { PaletteCompleteInput, PaletteCompleteResponse, PaletteDiscoverInput, PaletteDiscoverResponse } from "./palette-completion-types.js";
|
|
39
39
|
import type { SearchGradientInput, SearchGradientResponse, SearchPaletteInput, SearchPaletteResponse } from "./palette-search-types.js";
|
|
40
40
|
/** The client's own request primitives, handed down so this file owns no transport. */
|
|
41
|
-
export
|
|
41
|
+
export type ColoursTransport = {
|
|
42
42
|
get<T>(operationId: SdkOperationId, query?: QueryParams, signal?: AbortSignal): Promise<T>;
|
|
43
43
|
post<T>(operationId: SdkOperationId, body: unknown, signal?: AbortSignal): Promise<T>;
|
|
44
|
-
}
|
|
44
|
+
};
|
|
45
45
|
export declare class ColoursClient {
|
|
46
46
|
#private;
|
|
47
47
|
constructor(transport: ColoursTransport);
|
package/colours-client.js
CHANGED
|
@@ -4,12 +4,12 @@ export class ColoursClient {
|
|
|
4
4
|
this.#transport = transport;
|
|
5
5
|
}
|
|
6
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);
|
|
7
|
+
async complete(input, signal) {
|
|
8
|
+
return await this.#transport.post("complete_interior_palette", input, signal);
|
|
9
9
|
}
|
|
10
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);
|
|
11
|
+
async discover(input, signal) {
|
|
12
|
+
return await this.#transport.get("discover_interior_palettes", { ...input }, signal);
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* THE QUESTION: "what colours does this CATEGORY come in?" — the representative
|
|
@@ -39,12 +39,12 @@ export class ColoursClient {
|
|
|
39
39
|
* A selected category with no colour data comes back as a zero-count profile,
|
|
40
40
|
* not a missing key.
|
|
41
41
|
*/
|
|
42
|
-
profiles(params, signal) {
|
|
43
|
-
return this.#transport.get("get_category_colour_profiles", {
|
|
44
|
-
productTypeIds: params.productTypeIds.join(","),
|
|
42
|
+
async profiles(params, signal) {
|
|
43
|
+
return await this.#transport.get("get_category_colour_profiles", {
|
|
45
44
|
groupBy: params.groupBy,
|
|
46
|
-
|
|
45
|
+
productTypeIds: params.productTypeIds.join(","),
|
|
47
46
|
select: params.select,
|
|
47
|
+
topN: params.topN,
|
|
48
48
|
}, signal);
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
@@ -68,13 +68,13 @@ export class ColoursClient {
|
|
|
68
68
|
* `brandSlug` to join on. Without any of those parameters the payload is the
|
|
69
69
|
* platform-wide one and `rows` is absent. `families` is never scoped by them.
|
|
70
70
|
*/
|
|
71
|
-
stats(params = {}, signal) {
|
|
72
|
-
return this.#transport.get("get_colour_stats", {
|
|
73
|
-
groupBy: params.groupBy,
|
|
71
|
+
async stats(params = {}, signal) {
|
|
72
|
+
return await this.#transport.get("get_colour_stats", {
|
|
74
73
|
brandId: params.brandId,
|
|
75
74
|
brandSlug: params.brandSlug,
|
|
76
75
|
categoryKey: params.categoryKey,
|
|
77
76
|
family: params.family,
|
|
77
|
+
groupBy: params.groupBy,
|
|
78
78
|
limit: params.limit,
|
|
79
79
|
}, signal);
|
|
80
80
|
}
|
|
@@ -109,8 +109,8 @@ export class ColoursClient {
|
|
|
109
109
|
* ],
|
|
110
110
|
* });
|
|
111
111
|
*/
|
|
112
|
-
palette(input, signal) {
|
|
113
|
-
return this.#transport.post("search_by_palette", input, signal);
|
|
112
|
+
async palette(input, signal) {
|
|
113
|
+
return await this.#transport.post("search_by_palette", input, signal);
|
|
114
114
|
}
|
|
115
115
|
/**
|
|
116
116
|
* THE QUESTION: "what moves from this colour to that one?" — materials that
|
|
@@ -124,7 +124,7 @@ export class ColoursClient {
|
|
|
124
124
|
* one that travels the whole way, and a flat single-colour material is
|
|
125
125
|
* rejected outright however close its hue sits to the path.
|
|
126
126
|
*/
|
|
127
|
-
gradient(input, signal) {
|
|
128
|
-
return this.#transport.post("search_by_gradient", input, signal);
|
|
127
|
+
async gradient(input, signal) {
|
|
128
|
+
return await this.#transport.post("search_by_gradient", input, signal);
|
|
129
129
|
}
|
|
130
130
|
}
|
package/compare-types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type CompareInput = {
|
|
2
2
|
variantIds: string[];
|
|
3
3
|
selection?: {
|
|
4
4
|
kind: "blocks";
|
|
@@ -7,10 +7,10 @@ export interface CompareInput {
|
|
|
7
7
|
kind: "attributes";
|
|
8
8
|
attributeIds: string[];
|
|
9
9
|
};
|
|
10
|
-
}
|
|
10
|
+
};
|
|
11
11
|
type Availability = "available" | "discontinued" | "superseded" | "unknown";
|
|
12
12
|
type ClaimScope = "variant" | "product" | "brand";
|
|
13
|
-
export
|
|
13
|
+
export type CompareTarget = {
|
|
14
14
|
variantId: string;
|
|
15
15
|
version: string;
|
|
16
16
|
freshness: {
|
|
@@ -47,8 +47,8 @@ export interface CompareTarget {
|
|
|
47
47
|
} | null;
|
|
48
48
|
};
|
|
49
49
|
sampleability: boolean | null;
|
|
50
|
-
}
|
|
51
|
-
export
|
|
50
|
+
};
|
|
51
|
+
export type CompareCell = {
|
|
52
52
|
variantId: string;
|
|
53
53
|
state: "known" | "unknown" | "conflicting" | "inapplicable";
|
|
54
54
|
recordState: "stated" | "conflicting" | "stale" | "unknown" | "missing" | "not_applicable" | "not_evaluated";
|
|
@@ -65,8 +65,8 @@ export interface CompareCell {
|
|
|
65
65
|
value: unknown;
|
|
66
66
|
sourceRef: string | null;
|
|
67
67
|
}[];
|
|
68
|
-
}
|
|
69
|
-
export
|
|
68
|
+
};
|
|
69
|
+
export type CompareResult = {
|
|
70
70
|
targets: CompareTarget[];
|
|
71
71
|
rows: {
|
|
72
72
|
blockId: string;
|
|
@@ -76,8 +76,8 @@ export interface CompareResult {
|
|
|
76
76
|
outcome: "same" | "different" | "incomplete" | "indeterminate" | "not_applicable";
|
|
77
77
|
cells: CompareCell[];
|
|
78
78
|
}[];
|
|
79
|
-
}
|
|
80
|
-
export
|
|
79
|
+
};
|
|
80
|
+
export type CompareResponse = {
|
|
81
81
|
data: CompareResult;
|
|
82
82
|
meta: {
|
|
83
83
|
operationId: "retrieval.compare";
|
|
@@ -85,5 +85,5 @@ export interface CompareResponse {
|
|
|
85
85
|
};
|
|
86
86
|
links: Record<string, never>;
|
|
87
87
|
warnings: never[];
|
|
88
|
-
}
|
|
88
|
+
};
|
|
89
89
|
export {};
|
package/composition-client.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* to a composer that is not MaterialGraph, and keeps none of the ownership.
|
|
9
9
|
*/
|
|
10
10
|
import type { VarySchemesRequest, VarySchemesResponse } from "./composition-types.js";
|
|
11
|
-
import { HttpTransport } from "./http-transport.js";
|
|
11
|
+
import type { HttpTransport } from "./http-transport.js";
|
|
12
12
|
import type { SlotPoolsRequest, SlotPoolsResponse } from "./slot-pool-types.js";
|
|
13
13
|
/**
|
|
14
14
|
* THE QUESTION: "show me the same brief, decided differently." Re-derives an
|
|
@@ -17,7 +17,7 @@ import type { SlotPoolsRequest, SlotPoolsResponse } from "./slot-pool-types.js";
|
|
|
17
17
|
* stamped with axis + source provenance whose `notes` are the receipts.
|
|
18
18
|
* Requires the `mg:read` scope.
|
|
19
19
|
*/
|
|
20
|
-
export declare
|
|
20
|
+
export declare const varyScheme: (transport: HttpTransport, body: VarySchemesRequest, signal?: AbortSignal) => Promise<VarySchemesResponse>;
|
|
21
21
|
/**
|
|
22
22
|
* THE QUESTION: "for each of these slots, what should I be choosing between?"
|
|
23
23
|
* Up to 24 self-contained tasks in, one ranked and gated candidate pool each
|
|
@@ -30,4 +30,4 @@ export declare function varyScheme(transport: HttpTransport, body: VarySchemesRe
|
|
|
30
30
|
* criterion that graded `missing` or `not_evaluated` was never a failure.
|
|
31
31
|
* Requires the `mg:read` scope.
|
|
32
32
|
*/
|
|
33
|
-
export declare
|
|
33
|
+
export declare const slotPools: (transport: HttpTransport, body: SlotPoolsRequest, signal?: AbortSignal) => Promise<SlotPoolsResponse>;
|
package/composition-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: "show me the same brief, decided differently." Re-derives an
|
|
@@ -7,9 +6,10 @@ import { resolveOperation } from "./operations.js";
|
|
|
7
6
|
* stamped with axis + source provenance whose `notes` are the receipts.
|
|
8
7
|
* Requires the `mg:read` scope.
|
|
9
8
|
*/
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
export const varyScheme = async (transport, body, signal) => await transport.requestJson(resolveOperation("vary_schemes"), {
|
|
10
|
+
body,
|
|
11
|
+
signal,
|
|
12
|
+
});
|
|
13
13
|
/**
|
|
14
14
|
* THE QUESTION: "for each of these slots, what should I be choosing between?"
|
|
15
15
|
* Up to 24 self-contained tasks in, one ranked and gated candidate pool each
|
|
@@ -22,6 +22,7 @@ export function varyScheme(transport, body, signal) {
|
|
|
22
22
|
* criterion that graded `missing` or `not_evaluated` was never a failure.
|
|
23
23
|
* Requires the `mg:read` scope.
|
|
24
24
|
*/
|
|
25
|
-
export
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
export const slotPools = async (transport, body, signal) => await transport.requestJson(resolveOperation("slot_pools"), {
|
|
26
|
+
body,
|
|
27
|
+
signal,
|
|
28
|
+
});
|
package/composition-types.d.ts
CHANGED
|
@@ -292,13 +292,13 @@ export type SlotCategorySource = OpenEnum<"resolved" | "resolved-coverage" | "mo
|
|
|
292
292
|
* a counted shortfall unless a `set-slot-category` correction supplies one.
|
|
293
293
|
*/
|
|
294
294
|
export interface ReviewProgrammeSuspendPayload {
|
|
295
|
-
spaces:
|
|
295
|
+
spaces: {
|
|
296
296
|
spaceId: string;
|
|
297
297
|
name: string;
|
|
298
298
|
spaceType?: string;
|
|
299
299
|
provenance: ProgrammeProvenance;
|
|
300
|
-
}
|
|
301
|
-
slots:
|
|
300
|
+
}[];
|
|
301
|
+
slots: {
|
|
302
302
|
slotId: string;
|
|
303
303
|
name: string;
|
|
304
304
|
spaceId?: string;
|
|
@@ -310,7 +310,7 @@ export interface ReviewProgrammeSuspendPayload {
|
|
|
310
310
|
reason: "criteria-resolution-failed";
|
|
311
311
|
};
|
|
312
312
|
provenance: ProgrammeProvenance;
|
|
313
|
-
}
|
|
313
|
+
}[];
|
|
314
314
|
/**
|
|
315
315
|
* Lines this room usually carries that the brief never named.
|
|
316
316
|
*
|
|
@@ -320,7 +320,7 @@ export interface ReviewProgrammeSuspendPayload {
|
|
|
320
320
|
* serve yet, carried because a bedroom with no bed on the schedule is a gap
|
|
321
321
|
* worth seeing coming. Add one with an `add-slot` correction.
|
|
322
322
|
*/
|
|
323
|
-
unstated?:
|
|
323
|
+
unstated?: {
|
|
324
324
|
spaceId: string;
|
|
325
325
|
key: string;
|
|
326
326
|
name: string;
|
|
@@ -338,7 +338,7 @@ export interface ReviewProgrammeSuspendPayload {
|
|
|
338
338
|
category?: string | null;
|
|
339
339
|
weight: "essential" | "optional";
|
|
340
340
|
ffe?: boolean;
|
|
341
|
-
}
|
|
341
|
+
}[];
|
|
342
342
|
}
|
|
343
343
|
/**
|
|
344
344
|
* Resume grammar for the `review-programme` step: drop a slot, drop a space
|
|
@@ -351,7 +351,7 @@ export interface ReviewProgrammeSuspendPayload {
|
|
|
351
351
|
* suspend — the suspension discloses, it does not coerce.
|
|
352
352
|
*/
|
|
353
353
|
export interface ReviewProgrammeResumeData {
|
|
354
|
-
corrections:
|
|
354
|
+
corrections: ({
|
|
355
355
|
action: "drop-slot";
|
|
356
356
|
slotId: string;
|
|
357
357
|
} | {
|
|
@@ -383,7 +383,7 @@ export interface ReviewProgrammeResumeData {
|
|
|
383
383
|
name: string;
|
|
384
384
|
element: SlotElement;
|
|
385
385
|
category?: string | null;
|
|
386
|
-
}
|
|
386
|
+
})[];
|
|
387
387
|
}
|
|
388
388
|
/**
|
|
389
389
|
* Suspend payload for the compose `commit-palette` step. Today only the
|
|
@@ -409,7 +409,7 @@ export type CommitPaletteResumeData = {
|
|
|
409
409
|
* attribute/term for an unresolved phrase, or drop it.
|
|
410
410
|
*/
|
|
411
411
|
export interface ReviewCriteriaResumeData {
|
|
412
|
-
corrections:
|
|
412
|
+
corrections: ({
|
|
413
413
|
action: "accept";
|
|
414
414
|
slotId: string;
|
|
415
415
|
raw: string;
|
|
@@ -419,7 +419,7 @@ export interface ReviewCriteriaResumeData {
|
|
|
419
419
|
action: "drop";
|
|
420
420
|
slotId: string;
|
|
421
421
|
raw: string;
|
|
422
|
-
}
|
|
422
|
+
})[];
|
|
423
423
|
}
|
|
424
424
|
/** The union of every socratic-step resume payload, keyed by the suspended step. */
|
|
425
425
|
export type InterviewResumeData = ReviewCriteriaResumeData | ReviewProgrammeResumeData | CommitPaletteResumeData;
|
|
@@ -445,11 +445,11 @@ export interface SlotPoolEventPayload {
|
|
|
445
445
|
slotName: string;
|
|
446
446
|
/** How many candidates were WEIGHED, not how many qualified. */
|
|
447
447
|
considered: number;
|
|
448
|
-
top:
|
|
448
|
+
top: {
|
|
449
449
|
variantId: VariantId;
|
|
450
450
|
brand: string;
|
|
451
451
|
product: string;
|
|
452
452
|
imageUrl: string | null;
|
|
453
453
|
score: number;
|
|
454
|
-
}
|
|
454
|
+
}[];
|
|
455
455
|
}
|