@instruments/materialgraph 0.29.0 → 0.31.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.
Files changed (89) hide show
  1. package/brands-client.d.ts +1 -1
  2. package/by-colour-types.d.ts +4 -4
  3. package/catalogue-client.d.ts +3 -3
  4. package/catalogue-client.js +3 -3
  5. package/catalogue-types.d.ts +1 -1
  6. package/client-vocabulary.d.ts +3 -5
  7. package/client-vocabulary.js +9 -6
  8. package/client.d.ts +85 -174
  9. package/client.js +98 -211
  10. package/colour-region-types.d.ts +18 -0
  11. package/colours-client.d.ts +10 -83
  12. package/colours-client.js +1 -85
  13. package/errors.d.ts +1 -1
  14. package/errors.js +1 -0
  15. package/find-companions-types.d.ts +70 -0
  16. package/find-companions-types.js +12 -0
  17. package/find-variants-by-colour-types.d.ts +197 -0
  18. package/find-variants-by-vector-types.d.ts +67 -0
  19. package/find-variants-by-vector-types.js +5 -0
  20. package/get-variant-types.d.ts +50 -0
  21. package/get-variant-types.js +10 -0
  22. package/http-transport.d.ts +1 -1
  23. package/identifiers.d.ts +1 -1
  24. package/identifiers.js +1 -1
  25. package/image-reference-types.d.ts +18 -0
  26. package/index.d.ts +9 -7
  27. package/index.js +1 -1
  28. package/list-enum-values-types.d.ts +58 -0
  29. package/list-variants-types.d.ts +6 -2
  30. package/material-asset-types.d.ts +2 -2
  31. package/material-types.d.ts +13 -151
  32. package/operations.d.ts +1 -1
  33. package/operations.js +27 -88
  34. package/package.json +1 -1
  35. package/palette-search-types.d.ts +3 -49
  36. package/resolve-colour-types.d.ts +5 -5
  37. package/resolve-variant-types.d.ts +75 -0
  38. package/{identify-types.js → resolve-variant-types.js} +2 -2
  39. package/response-schemas.generated.d.ts +1 -1
  40. package/response-schemas.generated.js +46 -84
  41. package/run-types.d.ts +23 -216
  42. package/runs.d.ts +10 -58
  43. package/runs.js +19 -106
  44. package/schema-resource-types.d.ts +2 -139
  45. package/schema-resource-types.js +0 -8
  46. package/search-card-types.d.ts +1 -1
  47. package/search-index-plan-types.d.ts +6 -2
  48. package/search-request-types.d.ts +10 -2
  49. package/spec-types.d.ts +4 -4
  50. package/spec-types.js +2 -2
  51. package/specifications.d.ts +1 -9
  52. package/specifications.js +0 -12
  53. package/sse.d.ts +2 -2
  54. package/sse.js +2 -2
  55. package/types.d.ts +4 -38
  56. package/validation.d.ts +0 -74
  57. package/validation.js +2 -116
  58. package/webmcp.generated.js +9 -9
  59. package/workflows-client.d.ts +54 -0
  60. package/workflows-client.js +41 -0
  61. package/client-source-material-comments.d.ts +0 -51
  62. package/client-source-material-comments.js +0 -6
  63. package/codes-client.d.ts +0 -118
  64. package/codes-client.js +0 -99
  65. package/codes-types.d.ts +0 -325
  66. package/colour-aggregate-types.d.ts +0 -163
  67. package/coordinate-client.d.ts +0 -23
  68. package/coordinate-client.js +0 -13
  69. package/demand-batch-types.d.ts +0 -118
  70. package/demand-types.d.ts +0 -154
  71. package/identify-types.d.ts +0 -82
  72. package/material-composition-client.d.ts +0 -21
  73. package/material-composition-client.js +0 -13
  74. package/material-composition-types.d.ts +0 -403
  75. package/material-composition-types.js +0 -1
  76. package/source-material-validation.d.ts +0 -7
  77. package/source-material-validation.js +0 -214
  78. package/spec-facet-types.d.ts +0 -48
  79. package/spec-facet-types.js +0 -7
  80. package/substitute-types.d.ts +0 -102
  81. package/substitute-types.js +0 -1
  82. package/suggest-types.d.ts +0 -67
  83. package/suggest-types.js +0 -28
  84. package/taxonomy-coverage-types.d.ts +0 -34
  85. package/taxonomy-coverage-types.js +0 -1
  86. /package/{codes-types.js → colour-region-types.js} +0 -0
  87. /package/{colour-aggregate-types.js → find-variants-by-colour-types.js} +0 -0
  88. /package/{demand-batch-types.js → image-reference-types.js} +0 -0
  89. /package/{demand-types.js → list-enum-values-types.js} +0 -0
@@ -0,0 +1,58 @@
1
+ /**
2
+ * @module list-enum-values-types
3
+ * @description Hand-maintained mirror of `list_enum_values`'s (MG-2225) input
4
+ * and output wire shapes. The source of truth is
5
+ * `packages/products/src/materials/list-enum-values.ts`; this SDK has no
6
+ * runtime dependency on `@materialgraph/products`, so the shapes are copied
7
+ * here and `contract-parity.test.ts` keeps them honest.
8
+ */
9
+ import type { OpenEnum } from "./types.js";
10
+ /** Options for `listEnumValues()` (GET `/api/v1/catalog/enum-values`). */
11
+ export type ListEnumValuesOptions = {
12
+ /**
13
+ * A value dictionary id, from a `listAttributes()` item's `dictionaryId`.
14
+ * Required without a `query`; with a `query`, omit it to search every
15
+ * dictionary.
16
+ */
17
+ dictionaryId?: string;
18
+ /** A value name, alias, misspelling or meaning. Omit to browse a dictionary. */
19
+ query?: string;
20
+ /** Items per page, 1 to 50. Default 20. */
21
+ limit?: number;
22
+ /** `pageInfo.endCursor` from the previous page, with the same query and dictionary. */
23
+ cursor?: string;
24
+ };
25
+ /** How an item was found. A distance or similarity compares only within one method. */
26
+ export type EnumValueMatch = {
27
+ method: OpenEnum<"exact" | "alias" | "fuzzy" | "vector">;
28
+ /** The id, label or alias that matched, or null for a match by meaning. */
29
+ matchedText: string | null;
30
+ /** Fuse distance, 0 best. */
31
+ distance?: number;
32
+ /** Set when the query named a deprecated term: the active term it was resolved from. */
33
+ resolvedFrom?: string;
34
+ /** Cosine similarity, 1 best. */
35
+ similarity?: number;
36
+ };
37
+ /** One allowed value of a dictionary. */
38
+ export type EnumValueItem = {
39
+ /** The attributes this value can filter `listVariants()` on; empty when it cannot be filtered on. */
40
+ attributeIds: string[];
41
+ /** The taxonomy's definition when the value resolves to a canonical concept, otherwise null. */
42
+ definition: string | null;
43
+ dictionaryId: string;
44
+ label: string;
45
+ /** Present only when the page answers a query. */
46
+ match?: EnumValueMatch;
47
+ /** The bare term id `listVariants()` accepts for any of `attributeIds`. */
48
+ valueId: string;
49
+ };
50
+ export type ListEnumValuesResult = {
51
+ /** The dictionary the page was read from; null when a query searched every dictionary. */
52
+ dictionaryId: string | null;
53
+ items: EnumValueItem[];
54
+ pageInfo: {
55
+ endCursor: string | null;
56
+ hasNextPage: boolean;
57
+ };
58
+ };
@@ -107,14 +107,14 @@ export type ListVariantsNotApplicable = {
107
107
  };
108
108
  /**
109
109
  * One list item: the compact identity needed to pick a variant, with image
110
- * and maker page only when requested (`include`) and selected attributes
110
+ * and brand page only when requested (`include`) and selected attributes
111
111
  * under `specifications`. Leaner than `get_variant`'s item on purpose.
112
112
  */
113
113
  export type ListVariantsItem = {
114
114
  category: string;
115
115
  code: string | null;
116
116
  image?: string | null;
117
- maker: {
117
+ brand: {
118
118
  id: string;
119
119
  name: string;
120
120
  };
@@ -137,6 +137,8 @@ export type ListVariantsItem = {
137
137
  variantId: string;
138
138
  };
139
139
  export type ListVariantsOutput = {
140
+ /** Explicit `{field: "variant", op: "in"}` ids that name a real variant outside the materials catalogue. Present only when at least one did. */
141
+ excludedByCorpusScope?: string[];
140
142
  items: ListVariantsItem[];
141
143
  pageInfo: {
142
144
  endCursor: string | null;
@@ -146,4 +148,6 @@ export type ListVariantsOutput = {
146
148
  preferenceMatchesRemain?: boolean;
147
149
  /** Explicit `{field: "variant", op: "in"}` ids anywhere in `filters.terms` that did not resolve to an eligible variant in the requested `corpusScope`. */
148
150
  unresolvedVariantIds?: string[];
151
+ /** Filtered attributes no variant in scope states at all. Present only on an empty first page, so its absence means the empty page is a genuine no-match. */
152
+ unstated?: string[];
149
153
  };
@@ -12,7 +12,7 @@ import type { VariantId } from "./identifiers.js";
12
12
  import type { OpenEnum } from "./types.js";
13
13
  /**
14
14
  * `available`: MaterialGraph serves the file at `url`. `unknown`: `url` is the
15
- * maker's own link, unchecked. `unavailable`: no working copy is known and
15
+ * brand's own link, unchecked. `unavailable`: no working copy is known and
16
16
  * `url` is null.
17
17
  */
18
18
  export type VariantAssetAvailability = OpenEnum<"available" | "unknown" | "unavailable">;
@@ -51,7 +51,7 @@ export type VariantAssetItem = {
51
51
  /** Images only; absent when unknown. */
52
52
  width?: number;
53
53
  };
54
- /** Whether the maker's document source was read for this variant. Absent when documents are filtered out. */
54
+ /** Whether the brand's document source was read for this variant. Absent when documents are filtered out. */
55
55
  export type VariantDocumentCoverageState = OpenEnum<"available" | "none_declared" | "not_ingested" | "unavailable_source" | "dead_link" | "failed_ingest">;
56
56
  export type VariantAssetPageInfo = {
57
57
  nextCursor: string | null;
@@ -1,7 +1,7 @@
1
- import type { ProductId, VariantId } from "./identifiers.js";
1
+ import type { VariantId } from "./identifiers.js";
2
2
  /**
3
- * Hand-mirrored wire types for the material projections — the grid-card tile,
4
- * the detail record, and the availability/successor block they carry.
3
+ * Hand-mirrored wire types for the material projections — the grid-card tile
4
+ * and the availability it carries.
5
5
  *
6
6
  * Extracted from `./types.ts` (which re-exports everything here) so that module
7
7
  * stays within the repository's source-size budget. Same contract, same
@@ -9,20 +9,15 @@ import type { ProductId, VariantId } from "./identifiers.js";
9
9
  * widened — a new server state still type-checks.
10
10
  *
11
11
  * ABSENT IS NOT FALSE, and it is the rule this whole file hangs on. A material
12
- * record reports what the graph HOLDS, never what is true of the object in the
13
- * world. `null` and a missing key both mean UNKNOWN:
14
- * - `dimensions: null` does not mean the material has no dimensions.
15
- * - `supersededBy: null` does not mean the product is current.
16
- * - a `facets` array without an attribute does not mean the material lacks that
17
- * property — it means nobody has recorded one.
18
- * - most dangerously, no boolean here may be inverted from an absence. Never
19
- * render "not certified" / "no fire rating" from a missing entry; render
20
- * "not on record".
12
+ * projection reports what the graph HOLDS, never what is true of the object in
13
+ * the world. `null` and a missing key both mean UNKNOWN, and no boolean here may
14
+ * be inverted from an absence: never render "not certified" / "no fire rating"
15
+ * from a missing entry; render "not on record".
21
16
  * Read {@link MaterialBlockProjection} when you need to tell "we looked and
22
17
  * there is none" apart from "nobody has looked" — that is the only projection
23
18
  * that says which.
24
19
  */
25
- import type { ImageSource, MaterialColour, OpenEnum, PaletteSwatch } from "./types.js";
20
+ import type { ImageSource, MaterialColour, OpenEnum } from "./types.js";
26
21
  /**
27
22
  * Whether a material can still be bought.
28
23
  *
@@ -31,30 +26,13 @@ import type { ImageSource, MaterialColour, OpenEnum, PaletteSwatch } from "./typ
31
26
  * listing state, not a reviewed manufacturer-discontinuation claim; do not
32
27
  * present it as the manufacturer having discontinued the product.
33
28
  * - `superseded` — a reviewed product relationship names a successor and the
34
- * material is no longer listed. See `MaterialDetail.supersededBy`.
29
+ * material is no longer listed.
35
30
  * - `unknown` — never checked. A real answer, not an error.
36
31
  */
37
32
  export type MaterialAvailability = OpenEnum<"available" | "discontinued" | "superseded" | "unknown">;
38
33
  /**
39
- * The variant a reviewed product relationship names as replacing another.
40
- * `availability` is the successor's OWN state, resolved ONE HOP only — a
41
- * successor that has itself been superseded reports `discontinued`/`unknown`
42
- * here; follow `variantId` for the next link in the chain.
43
- */
44
- export type MaterialSuccessor = {
45
- /** Opaque — round-trip verbatim to read the successor. */
46
- variantId: VariantId;
47
- brandSlug: string;
48
- productId: ProductId;
49
- brand: string;
50
- product: string;
51
- variant: string;
52
- color: string | null;
53
- availability: MaterialAvailability;
54
- };
55
- /**
56
- * The grid-card projection of a material. Tiles carry `availability` but not the
57
- * successor record — read the detail projection for that.
34
+ * The grid-card projection of a material. Tiles carry `availability` but not a
35
+ * successor record.
58
36
  */
59
37
  export type MaterialTile = {
60
38
  /** Accepted sampleability fact. Absent means unknown, never false. */
@@ -78,26 +56,8 @@ export type MaterialTile = {
78
56
  */
79
57
  colourName?: string;
80
58
  };
81
- /**
82
- * A canonical attribute/term pair carried on a detail record.
83
- *
84
- * `attributeId` and `term` are canonical VOCABULARY, not opaque ids — the same
85
- * tokens `bySpec` / `search({ filters })` accept, discoverable through
86
- * `specificationFacets()` and `attributeValues()`. An attribute absent from
87
- * `facets` is unrecorded, never known-false.
88
- */
89
- export type MaterialFacet = {
90
- attributeId: string;
91
- term: string;
92
- /**
93
- * Whether this value identifies the variant or specifies its performance /
94
- * composition. Present on current responses; optional for captured older
95
- * payloads. Only `specification` facets are valid inputs to `bySpec`.
96
- */
97
- role?: "identity" | "specification";
98
- };
99
59
  /** A retained product-type proposal. It is review evidence, never a category. */
100
- export type ProposedProductType = {
60
+ type ProposedProductType = {
101
61
  id: string;
102
62
  displayName: string;
103
63
  confidence: number | null;
@@ -111,102 +71,4 @@ export type ProductTypeReceipt = {
111
71
  state: "accepted" | "proposed" | "unknown";
112
72
  proposedProductTypes: ProposedProductType[];
113
73
  };
114
- /**
115
- * One dimensional configuration of a material. Numeric fields are millimetres
116
- * (mass in kilograms); string fields are the source's own descriptors. The
117
- * index signature preserves the corpus's long tail of rarer keys.
118
- */
119
- export interface DimensionEntry {
120
- label?: string;
121
- tile_size?: string;
122
- measurement_basis?: string;
123
- width_mm?: number;
124
- length_mm?: number;
125
- height_mm?: number;
126
- depth_mm?: number;
127
- thickness_mm?: number;
128
- diameter_mm?: number;
129
- visible_projection_mm?: number;
130
- weight_kg?: number;
131
- [key: string]: unknown;
132
- }
133
- /**
134
- * The record projection of a material — the tile plus detail-only fields.
135
- *
136
- * The deepest read of ONE material, and still not an assertion about the object:
137
- * every `| null` below is UNKNOWN, not "none". See the module docblock.
138
- */
139
- export interface MaterialDetail extends MaterialTile {
140
- brandSlug: string;
141
- /** Opaque — the product family; siblings share it. */
142
- productId: ProductId;
143
- color: string | null;
144
- /** The variant's Material Bank SKU. Null means none is recorded, not unknown. */
145
- materialBankId: string | null;
146
- /**
147
- * The manufacturer's own item code from `variants.code`, the same key search
148
- * results carry. ABSENT means no code is recorded, never an invented one.
149
- */
150
- manufacturerCode?: string;
151
- /**
152
- * Explicit source-governed permission to save this exact source-coded variant
153
- * to a Project. Absent means unknown/not allowed; never infer it from identity.
154
- */
155
- projectSaveCapability?: "allowed";
156
- /**
157
- * The governed source status behind Project capture. Provisional remains
158
- * source-backed, but is not a verified catalogue claim.
159
- */
160
- sourceStatus?: "provisional";
161
- installationImageUrl: string | null;
162
- displayCategory: string | null;
163
- productTypeReceipt: ProductTypeReceipt;
164
- categoryPath: string[];
165
- /** Durable state of image-colour extraction and its variant projection. */
166
- colourEvidence: {
167
- status: "no_eligible_asset";
168
- } | {
169
- status: "extractor_not_run";
170
- origin: {
171
- assetId: string;
172
- method: "colorscope_primary_image";
173
- };
174
- } | {
175
- status: "available";
176
- basis: "palette" | "palette_and_dominant_oklab" | "dominant_oklab";
177
- extractedAt: string;
178
- extractionVersion: string | null;
179
- origin: {
180
- assetId: string;
181
- method: "colorscope_primary_image";
182
- };
183
- } | {
184
- status: "projection_missing";
185
- extractedAt: string;
186
- extractionVersion: string | null;
187
- origin: {
188
- assetId: string;
189
- method: "colorscope_primary_image";
190
- };
191
- } | {
192
- status: "genuinely_colourless";
193
- extractedAt: string;
194
- extractionVersion: string | null;
195
- origin: {
196
- assetId: string;
197
- method: "colorscope_primary_image";
198
- };
199
- };
200
- /** Extracted from imagery — visual likeness, never a declared colour spec. */
201
- palette: PaletteSwatch[];
202
- /** What is ON RECORD. An absent attribute is unrecorded, never known-false. */
203
- facets: MaterialFacet[];
204
- /** `null` = no dimensions recorded, NOT a dimensionless material. */
205
- dimensions: DimensionEntry[] | null;
206
- /**
207
- * The declared successor, or null when NO REVIEWED RELATIONSHIP NAMES ONE —
208
- * which is not the same as "this product is current". Read `availability` for
209
- * that, and even then `unknown` is a real answer.
210
- */
211
- supersededBy: MaterialSuccessor | null;
212
- }
74
+ export {};
package/operations.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export declare const MATERIALGRAPH_API_VERSION = "0.7.0";
2
- declare const OPERATION_DEFINITIONS: readonly [readonly ["samplizeColorVecCache", "GET", "/api/v1/catalogues/samplize/colorvec", "samplize_colorvec_cache"], readonly ["samplizeCatalogueSearch", "POST", "/api/v1/catalogues/samplize/search", "samplize_catalogue_search"], readonly ["catalogs", "GET", "/api/v1/catalogs", "list_catalog_documents"], readonly ["catalogPages", "GET", "/api/v1/catalogs/{catalogId}/pages", "list_catalog_pages"], readonly ["catalogPageRepresentation", "GET", "/api/v1/catalog-pages/{pageId}/representation", "get_catalog_page_representation"], readonly ["catalogReferences", "GET", "/api/v1/catalogs/{catalogId}/references", "list_catalog_product_references"], readonly ["search", "POST", "/api/v1/search", "search_materials_post"], readonly ["identify", "POST", "/api/v1/identify", "retrieval.identify"], readonly ["match", "POST", "/api/v1/search/match", "match_material"], readonly ["suggest", "GET", "/api/v1/search/suggest", "search_suggest"], readonly ["colours.stats", "GET", "/api/v1/colours/stats", "get_colour_stats"], readonly ["coordinate", "POST", "/api/v1/pairings/coordinate", "coordinate_materials"], readonly ["planQuery", "POST", "/api/v1/search/plan", "plan_material_query"], readonly ["samplizeCatalogue", "GET", "/api/v1/catalogues/samplize/products", "samplize_catalogue_products"], readonly ["searchGet", "GET", "/api/v1/search", "search_materials_get"], readonly ["byColour", "GET", "/api/v1/search/colours", "search_by_colour"], readonly ["material", "GET", "/api/v1/materials/{variantId}", "get_material"], readonly ["catalogueReferences", "POST", "/api/v1/catalogues/references", "get_catalogue_references_batch"], readonly ["catalogueCollections", "GET", "/api/v1/catalogues/collections", "list_catalogue_channel_collections"], readonly ["catalogueDocumentAccess", "GET", "/api/v1/catalogues/documents/{documentId}", "get_catalogue_document_access"], readonly ["materialBlocks", "GET", "/api/v1/materials/{variantId}/blocks", "list_material_blocks"], readonly ["listVariantAssets", "GET", "/api/v1/variants/{variantId}/assets", "list_variant_assets"], readonly ["materialDocuments", "GET", "/api/v1/materials/{variantId}/documents", "list_material_documents"], readonly ["compositionReport", "GET", "/api/v1/composition/report", "get_composition_report"], readonly ["schema", "GET", "/api/v1/schema/blocks", "list_schema_blocks"], readonly ["schema", "GET", "/api/v1/schema/attributes", "list_schema_attributes"], readonly ["schema", "GET", "/api/v1/schema/verticals", "list_schema_verticals"], readonly ["schema", "GET", "/api/v1/schema/product-types", "list_schema_product_types"], readonly ["schema", "GET", "/api/v1/schema/units", "list_schema_units"], readonly ["schema", "GET", "/api/v1/schema/value-dictionaries", "list_schema_value_dictionaries"], readonly ["schema", "GET", "/api/v1/schema/source-requirements", "list_schema_source_requirements"], readonly ["schema", "GET", "/api/v1/schema/product-type-templates", "list_schema_product_type_templates"], readonly ["schema", "GET", "/api/v1/schema/mappings", "list_schema_mappings"], readonly ["pairings", "GET", "/api/v1/materials/{variantId}/pairings", "get_material_pairings"], readonly ["associatedFinishes", "GET", "/api/v1/associated/finishes", "list_associated_finishes"], readonly ["associatedProducts", "GET", "/api/v1/associated/products", "list_associated_products"], readonly ["applicability", "GET", "/api/v1/applicability", "get_applicability"], readonly ["listVariants", "GET", "/api/v1/variants", "list_variants"], readonly ["listVariantFacets", "POST", "/api/v1/variants/facets", "list_variant_facets"], readonly ["colours.profiles", "GET", "/api/v1/colours/profiles", "get_category_colour_profiles"], readonly ["resolveColour", "GET", "/api/v1/search/colours/resolve", "resolve_colour_name"], readonly ["suggestColour", "GET", "/api/v1/search/colours/suggest", "suggest_colour_names"], readonly ["listAttributes", "GET", "/api/v1/catalog/attributes", "catalog_list_attributes"], readonly ["categories.list", "GET", "/api/v1/categories", "list_categories"], readonly ["categories.get", "GET", "/api/v1/categories/{id}", "get_category"], readonly ["productTypeCoverage", "GET", "/api/v1/taxonomy/coverage", "get_product_type_status_coverage"], readonly ["whoami", "GET", "/api/v1/whoami", "whoami"], readonly ["demand", "GET", "/api/v1/demand", "get_material_demand"], readonly ["colours.palette", "POST", "/api/v1/search/palettes", "search_by_palette"], readonly ["extractPalette", "POST", "/api/v1/search/palettes/extract", "extract_image_palette"], readonly ["colours.gradient", "POST", "/api/v1/search/gradients", "search_by_gradient"], readonly ["specificationFacets", "GET", "/api/v1/catalog/specifications/facets", "list_spec_facets"], readonly ["brands", "GET", "/api/v1/brands", "list_brands"], readonly ["uploadSourceMaterial", "POST", "/api/v1/source-material", "upload_source_material"], readonly ["sourceMaterialBatch", "GET", "/api/v1/source-material/{batchId}", "get_source_material_batch"], readonly ["sourceMaterialComments.list", "GET", "/api/v1/source-material/{batchId}/sources/{sourceId}/comments", "list_source_material_comments"], readonly ["sourceMaterialComments.post", "POST", "/api/v1/source-material/{batchId}/sources/{sourceId}/comments", "post_source_material_comment"], readonly ["createRun", "POST", "/api/v1/runs", "create_public_run"], readonly ["run", "GET", "/api/v1/runs/{runId}", "get_public_run"], readonly ["citation", "GET", "/api/v1/citations/{citationId}", "get_verdict_citation"], readonly ["streamRunEvents", "GET", "/api/v1/runs/{runId}/events", "list_public_run_events"], readonly ["demandBatch", "POST", "/api/v1/demand/batch", "get_demand_batch"], readonly ["codeAdvisory", "POST", "/api/v1/codes/advisory", "resolveCodeAdvisory"], readonly ["codes.context", "GET", "/api/v1/codes/context", "list_code_context"], readonly ["codes.requirements", "GET", "/api/v1/codes/requirements", "list_code_requirements"]];
2
+ declare const OPERATION_DEFINITIONS: readonly [readonly ["samplizeColorVecCache", "GET", "/api/v1/catalogues/samplize/colorvec", "samplize_colorvec_cache"], readonly ["samplizeCatalogueSearch", "POST", "/api/v1/catalogues/samplize/search", "samplize_catalogue_search"], readonly ["catalogs", "GET", "/api/v1/catalogs", "list_catalog_documents"], readonly ["catalogPages", "GET", "/api/v1/catalogs/{catalogId}/pages", "list_catalog_pages"], readonly ["catalogPageRepresentation", "GET", "/api/v1/catalog-pages/{pageId}/representation", "get_catalog_page_representation"], readonly ["catalogReferences", "GET", "/api/v1/catalogs/{catalogId}/references", "list_catalog_product_references"], readonly ["search", "POST", "/api/v1/search", "search_materials_post"], readonly ["match", "POST", "/api/v1/search/match", "match_material"], readonly ["planQuery", "POST", "/api/v1/search/plan", "plan_material_query"], readonly ["samplizeCatalogue", "GET", "/api/v1/catalogues/samplize/products", "samplize_catalogue_products"], readonly ["searchGet", "GET", "/api/v1/search", "search_materials_get"], readonly ["byColour", "GET", "/api/v1/search/colours", "search_by_colour"], readonly ["catalogueReferences", "POST", "/api/v1/catalogues/references", "get_catalogue_references_batch"], readonly ["catalogueCollections", "GET", "/api/v1/catalogues/collections", "list_catalogue_channel_collections"], readonly ["catalogueDocumentAccess", "GET", "/api/v1/catalogues/documents/{documentId}", "get_catalogue_document_access"], readonly ["materialBlocks", "GET", "/api/v1/materials/{variantId}/blocks", "list_material_blocks"], readonly ["listVariantAssets", "GET", "/api/v1/variants/{variantId}/assets", "list_variant_assets"], readonly ["materialDocuments", "GET", "/api/v1/materials/{variantId}/documents", "list_material_documents"], readonly ["schema", "GET", "/api/v1/schema/value-dictionaries", "list_schema_value_dictionaries"], readonly ["pairings", "GET", "/api/v1/materials/{variantId}/pairings", "get_material_pairings"], readonly ["associatedFinishes", "GET", "/api/v1/associated/finishes", "list_associated_finishes"], readonly ["associatedProducts", "GET", "/api/v1/associated/products", "list_associated_products"], readonly ["applicability", "GET", "/api/v1/applicability", "get_applicability"], readonly ["listVariants", "GET", "/api/v1/variants", "list_variants"], readonly ["listVariantFacets", "POST", "/api/v1/variants/facets", "list_variant_facets"], readonly ["findVariantsByColour", "POST", "/api/v1/variants/by-colour", "find_variants_by_colour"], readonly ["findVariantsByVector", "POST", "/api/v1/variants/by-vector", "find_variants_by_vector"], readonly ["findCompanions", "POST", "/api/v1/variants/companions", "find_companions"], readonly ["resolveVariant", "POST", "/api/v1/variants/resolve", "resolve_variant"], readonly ["getVariant", "GET", "/api/v1/variants/{variantId}", "get_variant"], readonly ["resolveColour", "GET", "/api/v1/search/colours/resolve", "resolve_colour_name"], readonly ["listAttributes", "GET", "/api/v1/catalog/attributes", "catalog_list_attributes"], readonly ["listEnumValues", "GET", "/api/v1/catalog/enum-values", "catalog_list_enum_values"], readonly ["categories.list", "GET", "/api/v1/categories", "list_categories"], readonly ["categories.get", "GET", "/api/v1/categories/{id}", "get_category"], readonly ["whoami", "GET", "/api/v1/whoami", "whoami"], readonly ["colours.palette", "POST", "/api/v1/search/palettes", "search_by_palette"], readonly ["extractPalette", "POST", "/api/v1/search/palettes/extract", "extract_image_palette"], readonly ["brands", "GET", "/api/v1/brands", "list_brands"], readonly ["uploadSourceMaterial", "POST", "/api/v1/source-material", "upload_source_material"], readonly ["workflows.start", "POST", "/api/v1/workflows/{workflowId}/runs", "create_public_run"], readonly ["workflows.run", "GET", "/api/v1/workflows/{workflowId}/runs/{runId}", "get_public_run"], readonly ["citation", "GET", "/api/v1/citations/{citationId}", "get_verdict_citation"], readonly ["workflows.streamRunEvents", "GET", "/api/v1/workflows/{workflowId}/runs/{runId}/events", "list_public_run_events"]];
3
3
  export type SdkOperationId = (typeof OPERATION_DEFINITIONS)[number][3];
4
4
  export type SdkOperation = Readonly<{
5
5
  clientMethod: (typeof OPERATION_DEFINITIONS)[number][0];
package/operations.js CHANGED
@@ -33,11 +33,7 @@ const OPERATION_DEFINITIONS = [
33
33
  "list_catalog_product_references",
34
34
  ],
35
35
  ["search", "POST", "/api/v1/search", "search_materials_post"],
36
- ["identify", "POST", "/api/v1/identify", "retrieval.identify"],
37
36
  ["match", "POST", "/api/v1/search/match", "match_material"],
38
- ["suggest", "GET", "/api/v1/search/suggest", "search_suggest"],
39
- ["colours.stats", "GET", "/api/v1/colours/stats", "get_colour_stats"],
40
- ["coordinate", "POST", "/api/v1/pairings/coordinate", "coordinate_materials"],
41
37
  ["planQuery", "POST", "/api/v1/search/plan", "plan_material_query"],
42
38
  [
43
39
  "samplizeCatalogue",
@@ -47,7 +43,6 @@ const OPERATION_DEFINITIONS = [
47
43
  ],
48
44
  ["searchGet", "GET", "/api/v1/search", "search_materials_get"],
49
45
  ["byColour", "GET", "/api/v1/search/colours", "search_by_colour"],
50
- ["material", "GET", "/api/v1/materials/{variantId}", "get_material"],
51
46
  [
52
47
  "catalogueReferences",
53
48
  "POST",
@@ -84,41 +79,12 @@ const OPERATION_DEFINITIONS = [
84
79
  "/api/v1/materials/{variantId}/documents",
85
80
  "list_material_documents",
86
81
  ],
87
- [
88
- "compositionReport",
89
- "GET",
90
- "/api/v1/composition/report",
91
- "get_composition_report",
92
- ],
93
- ["schema", "GET", "/api/v1/schema/blocks", "list_schema_blocks"],
94
- ["schema", "GET", "/api/v1/schema/attributes", "list_schema_attributes"],
95
- ["schema", "GET", "/api/v1/schema/verticals", "list_schema_verticals"],
96
- [
97
- "schema",
98
- "GET",
99
- "/api/v1/schema/product-types",
100
- "list_schema_product_types",
101
- ],
102
- ["schema", "GET", "/api/v1/schema/units", "list_schema_units"],
103
82
  [
104
83
  "schema",
105
84
  "GET",
106
85
  "/api/v1/schema/value-dictionaries",
107
86
  "list_schema_value_dictionaries",
108
87
  ],
109
- [
110
- "schema",
111
- "GET",
112
- "/api/v1/schema/source-requirements",
113
- "list_schema_source_requirements",
114
- ],
115
- [
116
- "schema",
117
- "GET",
118
- "/api/v1/schema/product-type-templates",
119
- "list_schema_product_type_templates",
120
- ],
121
- ["schema", "GET", "/api/v1/schema/mappings", "list_schema_mappings"],
122
88
  [
123
89
  "pairings",
124
90
  "GET",
@@ -146,39 +112,41 @@ const OPERATION_DEFINITIONS = [
146
112
  "list_variant_facets",
147
113
  ],
148
114
  [
149
- "colours.profiles",
150
- "GET",
151
- "/api/v1/colours/profiles",
152
- "get_category_colour_profiles",
115
+ "findVariantsByColour",
116
+ "POST",
117
+ "/api/v1/variants/by-colour",
118
+ "find_variants_by_colour",
153
119
  ],
120
+ [
121
+ "findVariantsByVector",
122
+ "POST",
123
+ "/api/v1/variants/by-vector",
124
+ "find_variants_by_vector",
125
+ ],
126
+ ["findCompanions", "POST", "/api/v1/variants/companions", "find_companions"],
127
+ ["resolveVariant", "POST", "/api/v1/variants/resolve", "resolve_variant"],
128
+ ["getVariant", "GET", "/api/v1/variants/{variantId}", "get_variant"],
154
129
  [
155
130
  "resolveColour",
156
131
  "GET",
157
132
  "/api/v1/search/colours/resolve",
158
133
  "resolve_colour_name",
159
134
  ],
160
- [
161
- "suggestColour",
162
- "GET",
163
- "/api/v1/search/colours/suggest",
164
- "suggest_colour_names",
165
- ],
166
135
  [
167
136
  "listAttributes",
168
137
  "GET",
169
138
  "/api/v1/catalog/attributes",
170
139
  "catalog_list_attributes",
171
140
  ],
172
- ["categories.list", "GET", "/api/v1/categories", "list_categories"],
173
- ["categories.get", "GET", "/api/v1/categories/{id}", "get_category"],
174
141
  [
175
- "productTypeCoverage",
142
+ "listEnumValues",
176
143
  "GET",
177
- "/api/v1/taxonomy/coverage",
178
- "get_product_type_status_coverage",
144
+ "/api/v1/catalog/enum-values",
145
+ "catalog_list_enum_values",
179
146
  ],
147
+ ["categories.list", "GET", "/api/v1/categories", "list_categories"],
148
+ ["categories.get", "GET", "/api/v1/categories/{id}", "get_category"],
180
149
  ["whoami", "GET", "/api/v1/whoami", "whoami"],
181
- ["demand", "GET", "/api/v1/demand", "get_material_demand"],
182
150
  ["colours.palette", "POST", "/api/v1/search/palettes", "search_by_palette"],
183
151
  [
184
152
  "extractPalette",
@@ -186,18 +154,6 @@ const OPERATION_DEFINITIONS = [
186
154
  "/api/v1/search/palettes/extract",
187
155
  "extract_image_palette",
188
156
  ],
189
- [
190
- "colours.gradient",
191
- "POST",
192
- "/api/v1/search/gradients",
193
- "search_by_gradient",
194
- ],
195
- [
196
- "specificationFacets",
197
- "GET",
198
- "/api/v1/catalog/specifications/facets",
199
- "list_spec_facets",
200
- ],
201
157
  ["brands", "GET", "/api/v1/brands", "list_brands"],
202
158
  [
203
159
  "uploadSourceMaterial",
@@ -206,41 +162,24 @@ const OPERATION_DEFINITIONS = [
206
162
  "upload_source_material",
207
163
  ],
208
164
  [
209
- "sourceMaterialBatch",
210
- "GET",
211
- "/api/v1/source-material/{batchId}",
212
- "get_source_material_batch",
165
+ "workflows.start",
166
+ "POST",
167
+ "/api/v1/workflows/{workflowId}/runs",
168
+ "create_public_run",
213
169
  ],
214
170
  [
215
- "sourceMaterialComments.list",
171
+ "workflows.run",
216
172
  "GET",
217
- "/api/v1/source-material/{batchId}/sources/{sourceId}/comments",
218
- "list_source_material_comments",
219
- ],
220
- [
221
- "sourceMaterialComments.post",
222
- "POST",
223
- "/api/v1/source-material/{batchId}/sources/{sourceId}/comments",
224
- "post_source_material_comment",
173
+ "/api/v1/workflows/{workflowId}/runs/{runId}",
174
+ "get_public_run",
225
175
  ],
226
- ["createRun", "POST", "/api/v1/runs", "create_public_run"],
227
- ["run", "GET", "/api/v1/runs/{runId}", "get_public_run"],
228
176
  ["citation", "GET", "/api/v1/citations/{citationId}", "get_verdict_citation"],
229
177
  [
230
- "streamRunEvents",
178
+ "workflows.streamRunEvents",
231
179
  "GET",
232
- "/api/v1/runs/{runId}/events",
180
+ "/api/v1/workflows/{workflowId}/runs/{runId}/events",
233
181
  "list_public_run_events",
234
182
  ],
235
- ["demandBatch", "POST", "/api/v1/demand/batch", "get_demand_batch"],
236
- ["codeAdvisory", "POST", "/api/v1/codes/advisory", "resolveCodeAdvisory"],
237
- ["codes.context", "GET", "/api/v1/codes/context", "list_code_context"],
238
- [
239
- "codes.requirements",
240
- "GET",
241
- "/api/v1/codes/requirements",
242
- "list_code_requirements",
243
- ],
244
183
  ];
245
184
  export const SDK_OPERATIONS = Object.freeze(OPERATION_DEFINITIONS.map(([clientMethod, method, path, operationId]) => Object.freeze({ clientMethod, method, operationId, path })));
246
185
  /** Look up a registered operation by its OpenAPI `operationId`. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instruments/materialgraph",
3
- "version": "0.29.0",
3
+ "version": "0.31.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,17 +1,14 @@
1
1
  import type { ColourCategoryGate } from "./by-colour-types.js";
2
2
  import type { CorpusScope, CorpusScopeReceipt } from "./corpus-scope-types.js";
3
3
  /**
4
- * Wire types for MULTI-COLOUR search — `POST /api/v1/search/palettes` and
5
- * `POST /api/v1/search/gradients`.
4
+ * Wire types for MULTI-COLOUR search — `POST /api/v1/search/palettes`.
6
5
  *
7
- * Kept out of `types.ts` for the same reason `colour-aggregate-types.ts` and
8
- * `codes-types.ts` are: the shared mirror is at its source-size budget. Same
6
+ * Kept out of `types.ts` for the repository's source-file size budget. Same
9
7
  * tolerant-parsing contract as the rest of the mirror — response enums are
10
8
  * widened so a new server value still type-checks.
11
9
  *
12
10
  * The MATCH SEMANTICS these types carry are the server's, stated on
13
- * {@link SearchPaletteInput.logic} and {@link GradientMatch.coverage} rather
14
- * than left to the endpoint docs.
11
+ * {@link SearchPaletteInput.logic} rather than left to the endpoint docs.
15
12
  */
16
13
  import type { VariantId } from "./identifiers.js";
17
14
  import type { OklabTriple, OpenEnum } from "./types.js";
@@ -30,11 +27,6 @@ export type PaletteQueryColour = {
30
27
  /** Relative importance. Not applied: a palette is ordered by its first colour. */
31
28
  weight?: number;
32
29
  };
33
- /** One gradient stop — exactly one of `hex` or `oklab`. Order is meaningful. */
34
- export type GradientStop = {
35
- hex?: string;
36
- oklab?: OklabTriple;
37
- };
38
30
  export type SearchPaletteInput = {
39
31
  /**
40
32
  * HARD category filter: category-group or product-type names or keys.
@@ -57,19 +49,6 @@ export type SearchPaletteInput = {
57
49
  /** Results to return; defaults to 24, capped at 48. */
58
50
  limit?: number;
59
51
  };
60
- export type SearchGradientInput = {
61
- /**
62
- * HARD category filter: category-group or product-type names or keys.
63
- * Absent, the page holds surface materials only, so lights, taps and
64
- * furniture are left out.
65
- */
66
- category?: string[];
67
- corpusScope?: CorpusScope;
68
- /** The ordered colour transition, 2–6 stops. */
69
- stops: GradientStop[];
70
- /** Results to return; defaults to 24, capped at 48. */
71
- limit?: number;
72
- };
73
52
  /**
74
53
  * One swatch used for scoring. Samplize paint uses its selected published hex;
75
54
  * other materials use colorscope palettes extracted from imagery. `name` is null when no human
@@ -143,15 +122,6 @@ export type PaletteMatch = {
143
122
  /** One receipt per queried colour, in query order. */
144
123
  colours: ColourMatchReceipt[];
145
124
  } & MultiColourMatchBase;
146
- export type GradientMatch = {
147
- /**
148
- * Thirds of the path where the material holds a swatch near a sampled point,
149
- * over 3. A receipt beside the order, which is by the first stop.
150
- */
151
- coverage: number;
152
- /** One receipt per sampled point along the path, in path order. */
153
- samples: ColourMatchReceipt[];
154
- } & MultiColourMatchBase;
155
125
  /**
156
126
  * The thresholds behind every receipt's `hueCompatible`: the exact values
157
127
  * passed to colorscope's `isHueCompatible`, fixed server-side with no request
@@ -199,19 +169,3 @@ export type SearchPaletteResponse = {
199
169
  count: number;
200
170
  matches: PaletteMatch[];
201
171
  };
202
- /** A PAGE, NOT A CORPUS — see {@link SearchPaletteResponse}. */
203
- export type SearchGradientResponse = {
204
- /** The category gate the page ran under. */
205
- categoryGate?: ColourCategoryGate;
206
- corpusScope?: CorpusScopeReceipt;
207
- query: {
208
- stops: string[];
209
- /** The sampled path points the search actually ran against. */
210
- samples: string[];
211
- };
212
- /** The thresholds behind each sample receipt's `hueCompatible`. */
213
- hueGate?: HueGateReceipt;
214
- /** `matches.length`, capped by `limit`. Never a corpus total. */
215
- count: number;
216
- matches: GradientMatch[];
217
- };