@instruments/materialgraph 0.9.1 → 0.11.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 (64) hide show
  1. package/brands-client.d.ts +48 -0
  2. package/brands-client.js +45 -0
  3. package/browse-types.d.ts +147 -0
  4. package/browse-types.js +1 -0
  5. package/by-colour-types.d.ts +105 -5
  6. package/client-browse.d.ts +13 -3
  7. package/client-browse.js +12 -2
  8. package/client-exploration.d.ts +9 -0
  9. package/client-exploration.js +7 -0
  10. package/client-source-material-comments.d.ts +51 -0
  11. package/client-source-material-comments.js +40 -0
  12. package/client.d.ts +64 -71
  13. package/client.js +90 -78
  14. package/colour-aggregate-types.d.ts +58 -0
  15. package/colours-client.d.ts +8 -2
  16. package/colours-client.js +15 -2
  17. package/composition-client.d.ts +33 -0
  18. package/composition-client.js +27 -0
  19. package/composition-types.d.ts +46 -0
  20. package/coordinate-client.d.ts +23 -0
  21. package/coordinate-client.js +25 -0
  22. package/errors.js +24 -8
  23. package/exploration-types.d.ts +110 -0
  24. package/exploration-types.js +1 -0
  25. package/fan-deck-types.d.ts +42 -0
  26. package/fan-deck-types.js +9 -0
  27. package/http-transport.js +24 -5
  28. package/index.d.ts +7 -3
  29. package/index.js +2 -2
  30. package/match-stream-types.d.ts +1 -1
  31. package/match-stream-types.js +16 -3
  32. package/match-stream.js +14 -4
  33. package/material-types.d.ts +1 -1
  34. package/operations.d.ts +1 -1
  35. package/operations.js +187 -26
  36. package/package.json +1 -1
  37. package/palette-search-types.d.ts +31 -0
  38. package/resolve-client.d.ts +22 -3
  39. package/resolve-client.js +31 -4
  40. package/resolve-types.d.ts +70 -1
  41. package/run-events.d.ts +1 -1
  42. package/run-events.js +4 -1
  43. package/run-types.d.ts +132 -0
  44. package/runs.d.ts +35 -1
  45. package/runs.js +69 -5
  46. package/schedule-types.d.ts +128 -0
  47. package/schema-resource-types.d.ts +1 -1
  48. package/search-refinement-types.d.ts +39 -4
  49. package/search-request-types.d.ts +172 -0
  50. package/search-request-types.js +1 -0
  51. package/search-result-validation.js +21 -4
  52. package/slot-pool-types.d.ts +370 -0
  53. package/slot-pool-types.js +1 -0
  54. package/source-material-validation.d.ts +5 -1
  55. package/source-material-validation.js +114 -5
  56. package/spec-facet-types.d.ts +53 -0
  57. package/spec-facet-types.js +7 -0
  58. package/specifications.d.ts +26 -0
  59. package/specifications.js +32 -0
  60. package/sse.js +3 -1
  61. package/suggest-types.js +3 -1
  62. package/types.d.ts +176 -216
  63. package/validation.d.ts +12 -0
  64. package/validation.js +23 -0
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 ["search", "POST", "/api/v1/search", "search_materials_post"], readonly ["searchGet", "GET", "/api/v1/search", "search_materials_get"], readonly ["match", "POST", "/api/v1/search/match", "match_material"], readonly ["byColour", "GET", "/api/v1/search/colours", "search_by_colour"], readonly ["material", "GET", "/api/v1/materials/{variantId}", "get_material"], readonly ["siblings", "GET", "/api/v1/materials/{variantId}/siblings", "get_material_siblings"], readonly ["materialBlocks", "GET", "/api/v1/materials/{variantId}/blocks", "list_material_blocks"], readonly ["materialAssets", "GET", "/api/v1/materials/{variantId}/assets", "list_material_assets"], readonly ["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 ["materials", "POST", "/api/v1/materials/batch", "get_materials_batch_post"], readonly ["materialsCached", "GET", "/api/v1/materials/batch", "get_materials_batch_get"], readonly ["browse", "GET", "/api/v1/search/browse", "search_browse_by_colour"], readonly ["colourFacets", "GET", "/api/v1/colours/facets", "get_colour_facets"], readonly ["colours.profiles", "GET", "/api/v1/colours/profiles", "get_category_colour_profiles"], readonly ["colours.stats", "GET", "/api/v1/colours/stats", "get_colour_stats"], readonly ["resolveColour", "GET", "/api/v1/search/colours/resolve", "resolve_colour_name"], readonly ["suggestColour", "GET", "/api/v1/search/colours/suggest", "suggest_colour_names"], readonly ["suggest", "GET", "/api/v1/search/suggest", "search_suggest"], readonly ["resolveAttribute", "GET", "/api/v1/catalog/attributes/resolve", "catalog_resolve_attribute"], readonly ["resolveAttributeValue", "GET", "/api/v1/catalog/attributes/{attributeId}/values/resolve", "catalog_resolve_value"], readonly ["searchVocabulary", "GET", "/api/v1/catalog/vocabulary/search", "catalog_vocabulary_search"], readonly ["resolve", "POST", "/api/v1/resolve", "resolve_phrases"], readonly ["bySpec", "GET", "/api/v1/search/specifications", "catalog_by_spec"], readonly ["taxonomy", "GET", "/api/v1/taxonomy/categories", "get_category_taxonomy"], readonly ["whoami", "GET", "/api/v1/whoami", "whoami"], readonly ["coordinate", "POST", "/api/v1/pairings/coordinate", "coordinate_materials"], readonly ["demand", "GET", "/api/v1/demand", "get_material_demand"], readonly ["colours.palette", "POST", "/api/v1/search/palettes", "search_by_palette"], readonly ["extractPalette", "POST", "/api/v1/search/palettes/extract", "extract_image_palette"], readonly ["colours.gradient", "POST", "/api/v1/search/gradients", "search_by_gradient"], readonly ["specificationFacets", "GET", "/api/v1/catalog/specifications/facets", "list_spec_facets"], readonly ["attributeValues", "GET", "/api/v1/catalog/attributes/{attributeId}/values", "list_attribute_values"], readonly ["applicableSpecs", "GET", "/api/v1/taxonomy/categories/{key}/specs", "get_applicable_specs"], readonly ["glossary", "GET", "/api/v1/glossary/{term}", "explain_material_term"], readonly ["brands", "GET", "/api/v1/brands", "list_brands"], readonly ["brand", "GET", "/api/v1/brands/{brandSlug}", "get_brand_profile"], readonly ["uploadSourceMaterial", "POST", "/api/v1/source-material", "upload_source_material"], readonly ["sourceMaterialBatch", "GET", "/api/v1/source-material/{batchId}", "get_source_material_batch"], readonly ["capabilities", "GET", "/api/v1/capabilities", "list_public_capabilities"], readonly ["createRun", "POST", "/api/v1/runs", "create_public_run"], readonly ["listRuns", "GET", "/api/v1/runs", "list_public_runs"], readonly ["run", "GET", "/api/v1/runs/{runId}", "get_public_run"], readonly ["runSchedule", "GET", "/api/v1/runs/{runId}/schedule", "get_run_finish_schedule"], readonly ["streamRunEvents", "GET", "/api/v1/runs/{runId}/events", "list_public_run_events"], readonly ["resumeRun", "POST", "/api/v1/runs/{runId}/resume", "resume_public_run"], readonly ["cancelRun", "POST", "/api/v1/runs/{runId}/cancel", "cancel_public_run"], readonly ["varyScheme", "POST", "/api/v1/schemes/vary", "vary_schemes"], readonly ["createProject", "POST", "/api/v1/projects", "create_box_project"], readonly ["listProjects", "GET", "/api/v1/projects", "list_box_projects"], readonly ["getProject", "GET", "/api/v1/projects/{projectId}", "get_box_project"], readonly ["appendProjectEvent", "POST", "/api/v1/projects/{projectId}/events", "append_box_project_event"], readonly ["demandBatch", "POST", "/api/v1/demand/batch", "get_demand_batch"], readonly ["codeAdvisory", "POST", "/api/v1/codes/advisory", "resolveCodeAdvisory"], readonly ["codes.context", "GET", "/api/v1/codes/context", "list_code_context"], readonly ["codes.requirements", "GET", "/api/v1/codes/requirements", "list_code_requirements"]];
2
+ declare const OPERATION_DEFINITIONS: readonly [readonly ["search", "POST", "/api/v1/search", "search_materials_post"], readonly ["searchGet", "GET", "/api/v1/search", "search_materials_get"], readonly ["match", "POST", "/api/v1/search/match", "match_material"], readonly ["byColour", "GET", "/api/v1/search/colours", "search_by_colour"], readonly ["material", "GET", "/api/v1/materials/{variantId}", "get_material"], readonly ["siblings", "GET", "/api/v1/materials/{variantId}/siblings", "get_material_siblings"], readonly ["materialBlocks", "GET", "/api/v1/materials/{variantId}/blocks", "list_material_blocks"], readonly ["materialAssets", "GET", "/api/v1/materials/{variantId}/assets", "list_material_assets"], readonly ["exploration.operators", "GET", "/api/v1/materials/{variantId}/operators", "list_material_operators"], readonly ["exploration.candidates", "POST", "/api/v1/materials/{variantId}/candidates", "read_material_candidates"], readonly ["schema", "GET", "/api/v1/schema/blocks", "list_schema_blocks"], readonly ["schema", "GET", "/api/v1/schema/attributes", "list_schema_attributes"], readonly ["schema", "GET", "/api/v1/schema/verticals", "list_schema_verticals"], readonly ["schema", "GET", "/api/v1/schema/product-types", "list_schema_product_types"], readonly ["schema", "GET", "/api/v1/schema/units", "list_schema_units"], readonly ["schema", "GET", "/api/v1/schema/value-dictionaries", "list_schema_value_dictionaries"], readonly ["schema", "GET", "/api/v1/schema/source-requirements", "list_schema_source_requirements"], readonly ["schema", "GET", "/api/v1/schema/product-type-templates", "list_schema_product_type_templates"], readonly ["schema", "GET", "/api/v1/schema/mappings", "list_schema_mappings"], readonly ["pairings", "GET", "/api/v1/materials/{variantId}/pairings", "get_material_pairings"], readonly ["associatedFinishes", "GET", "/api/v1/associated/finishes", "list_associated_finishes"], readonly ["associatedProducts", "GET", "/api/v1/associated/products", "list_associated_products"], readonly ["materials", "POST", "/api/v1/materials/batch", "get_materials_batch_post"], readonly ["materialsCached", "GET", "/api/v1/materials/batch", "get_materials_batch_get"], readonly ["browse", "GET", "/api/v1/search/browse", "search_browse_by_colour"], readonly ["colourFacets", "GET", "/api/v1/colours/facets", "get_colour_facets"], readonly ["colours.profiles", "GET", "/api/v1/colours/profiles", "get_category_colour_profiles"], readonly ["colours.stats", "GET", "/api/v1/colours/stats", "get_colour_stats"], readonly ["resolveColour", "GET", "/api/v1/search/colours/resolve", "resolve_colour_name"], readonly ["suggestColour", "GET", "/api/v1/search/colours/suggest", "suggest_colour_names"], readonly ["suggest", "GET", "/api/v1/search/suggest", "search_suggest"], readonly ["resolveAttribute", "GET", "/api/v1/catalog/attributes/resolve", "catalog_resolve_attribute"], readonly ["resolveAttributeValue", "GET", "/api/v1/catalog/attributes/{attributeId}/values/resolve", "catalog_resolve_value"], readonly ["searchVocabulary", "GET", "/api/v1/catalog/vocabulary/search", "catalog_vocabulary_search"], readonly ["resolve", "POST", "/api/v1/resolve", "resolve_phrases"], readonly ["bySpec", "GET", "/api/v1/search/specifications", "catalog_by_spec"], readonly ["taxonomy", "GET", "/api/v1/taxonomy/categories", "get_category_taxonomy"], readonly ["whoami", "GET", "/api/v1/whoami", "whoami"], readonly ["coordinate", "POST", "/api/v1/pairings/coordinate", "coordinate_materials"], readonly ["demand", "GET", "/api/v1/demand", "get_material_demand"], readonly ["colours.palette", "POST", "/api/v1/search/palettes", "search_by_palette"], readonly ["extractPalette", "POST", "/api/v1/search/palettes/extract", "extract_image_palette"], readonly ["colours.gradient", "POST", "/api/v1/search/gradients", "search_by_gradient"], readonly ["specificationFacets", "GET", "/api/v1/catalog/specifications/facets", "list_spec_facets"], readonly ["attributeValues", "GET", "/api/v1/catalog/attributes/{attributeId}/values", "list_attribute_values"], readonly ["applicableSpecs", "GET", "/api/v1/taxonomy/categories/{key}/specs", "get_applicable_specs"], readonly ["glossary", "GET", "/api/v1/glossary/{term}", "explain_material_term"], readonly ["brands", "GET", "/api/v1/brands", "list_brands"], readonly ["brand", "GET", "/api/v1/brands/{brandSlug}", "get_brand_profile"], readonly ["brandColourDeck", "GET", "/api/v1/brands/{brandSlug}/colours", "brand_colour_deck"], readonly ["uploadSourceMaterial", "POST", "/api/v1/source-material", "upload_source_material"], readonly ["sourceMaterialBatch", "GET", "/api/v1/source-material/{batchId}", "get_source_material_batch"], readonly ["sourceMaterialComments", "GET", "/api/v1/source-material/{batchId}/sources/{sourceId}/comments", "list_source_material_comments"], readonly ["sourceMaterialComments", "POST", "/api/v1/source-material/{batchId}/sources/{sourceId}/comments", "post_source_material_comment"], readonly ["capabilities", "GET", "/api/v1/capabilities", "list_public_capabilities"], readonly ["createRun", "POST", "/api/v1/runs", "create_public_run"], readonly ["listRuns", "GET", "/api/v1/runs", "list_public_runs"], readonly ["run", "GET", "/api/v1/runs/{runId}", "get_public_run"], readonly ["runSchedule", "GET", "/api/v1/runs/{runId}/schedule", "get_run_finish_schedule"], readonly ["streamRunEvents", "GET", "/api/v1/runs/{runId}/events", "list_public_run_events"], readonly ["resumeRun", "POST", "/api/v1/runs/{runId}/resume", "resume_public_run"], readonly ["cancelRun", "POST", "/api/v1/runs/{runId}/cancel", "cancel_public_run"], readonly ["varyScheme", "POST", "/api/v1/schemes/vary", "vary_schemes"], readonly ["slotPools", "POST", "/api/v1/schemes/pools", "slot_pools"], readonly ["createProject", "POST", "/api/v1/projects", "create_box_project"], readonly ["listProjects", "GET", "/api/v1/projects", "list_box_projects"], readonly ["getProject", "GET", "/api/v1/projects/{projectId}", "get_box_project"], readonly ["appendProjectEvent", "POST", "/api/v1/projects/{projectId}/events", "append_box_project_event"], readonly ["demandBatch", "POST", "/api/v1/demand/batch", "get_demand_batch"], readonly ["codeAdvisory", "POST", "/api/v1/codes/advisory", "resolveCodeAdvisory"], readonly ["codes.context", "GET", "/api/v1/codes/context", "list_code_context"], readonly ["codes.requirements", "GET", "/api/v1/codes/requirements", "list_code_requirements"]];
3
3
  export type SdkOperationId = (typeof OPERATION_DEFINITIONS)[number][3];
4
4
  export type SdkOperation = Readonly<{
5
5
  clientMethod: (typeof OPERATION_DEFINITIONS)[number][0];
package/operations.js CHANGED
@@ -6,38 +6,130 @@ const OPERATION_DEFINITIONS = [
6
6
  ["match", "POST", "/api/v1/search/match", "match_material"],
7
7
  ["byColour", "GET", "/api/v1/search/colours", "search_by_colour"],
8
8
  ["material", "GET", "/api/v1/materials/{variantId}", "get_material"],
9
- ["siblings", "GET", "/api/v1/materials/{variantId}/siblings", "get_material_siblings"],
10
- ["materialBlocks", "GET", "/api/v1/materials/{variantId}/blocks", "list_material_blocks"],
11
- ["materialAssets", "GET", "/api/v1/materials/{variantId}/assets", "list_material_assets"],
9
+ [
10
+ "siblings",
11
+ "GET",
12
+ "/api/v1/materials/{variantId}/siblings",
13
+ "get_material_siblings",
14
+ ],
15
+ [
16
+ "materialBlocks",
17
+ "GET",
18
+ "/api/v1/materials/{variantId}/blocks",
19
+ "list_material_blocks",
20
+ ],
21
+ [
22
+ "materialAssets",
23
+ "GET",
24
+ "/api/v1/materials/{variantId}/assets",
25
+ "list_material_assets",
26
+ ],
27
+ [
28
+ "exploration.operators",
29
+ "GET",
30
+ "/api/v1/materials/{variantId}/operators",
31
+ "list_material_operators",
32
+ ],
33
+ [
34
+ "exploration.candidates",
35
+ "POST",
36
+ "/api/v1/materials/{variantId}/candidates",
37
+ "read_material_candidates",
38
+ ],
12
39
  ["schema", "GET", "/api/v1/schema/blocks", "list_schema_blocks"],
13
40
  ["schema", "GET", "/api/v1/schema/attributes", "list_schema_attributes"],
14
41
  ["schema", "GET", "/api/v1/schema/verticals", "list_schema_verticals"],
15
- ["schema", "GET", "/api/v1/schema/product-types", "list_schema_product_types"],
42
+ [
43
+ "schema",
44
+ "GET",
45
+ "/api/v1/schema/product-types",
46
+ "list_schema_product_types",
47
+ ],
16
48
  ["schema", "GET", "/api/v1/schema/units", "list_schema_units"],
17
- ["schema", "GET", "/api/v1/schema/value-dictionaries", "list_schema_value_dictionaries"],
18
- ["schema", "GET", "/api/v1/schema/source-requirements", "list_schema_source_requirements"],
19
- ["schema", "GET", "/api/v1/schema/product-type-templates", "list_schema_product_type_templates"],
49
+ [
50
+ "schema",
51
+ "GET",
52
+ "/api/v1/schema/value-dictionaries",
53
+ "list_schema_value_dictionaries",
54
+ ],
55
+ [
56
+ "schema",
57
+ "GET",
58
+ "/api/v1/schema/source-requirements",
59
+ "list_schema_source_requirements",
60
+ ],
61
+ [
62
+ "schema",
63
+ "GET",
64
+ "/api/v1/schema/product-type-templates",
65
+ "list_schema_product_type_templates",
66
+ ],
20
67
  ["schema", "GET", "/api/v1/schema/mappings", "list_schema_mappings"],
21
- ["pairings", "GET", "/api/v1/materials/{variantId}/pairings", "get_material_pairings"],
22
- ["associatedFinishes", "GET", "/api/v1/associated/finishes", "list_associated_finishes"],
23
- ["associatedProducts", "GET", "/api/v1/associated/products", "list_associated_products"],
68
+ [
69
+ "pairings",
70
+ "GET",
71
+ "/api/v1/materials/{variantId}/pairings",
72
+ "get_material_pairings",
73
+ ],
74
+ [
75
+ "associatedFinishes",
76
+ "GET",
77
+ "/api/v1/associated/finishes",
78
+ "list_associated_finishes",
79
+ ],
80
+ [
81
+ "associatedProducts",
82
+ "GET",
83
+ "/api/v1/associated/products",
84
+ "list_associated_products",
85
+ ],
24
86
  ["materials", "POST", "/api/v1/materials/batch", "get_materials_batch_post"],
25
- ["materialsCached", "GET", "/api/v1/materials/batch", "get_materials_batch_get"],
87
+ [
88
+ "materialsCached",
89
+ "GET",
90
+ "/api/v1/materials/batch",
91
+ "get_materials_batch_get",
92
+ ],
26
93
  ["browse", "GET", "/api/v1/search/browse", "search_browse_by_colour"],
27
94
  ["colourFacets", "GET", "/api/v1/colours/facets", "get_colour_facets"],
28
- ["colours.profiles", "GET", "/api/v1/colours/profiles", "get_category_colour_profiles"],
95
+ [
96
+ "colours.profiles",
97
+ "GET",
98
+ "/api/v1/colours/profiles",
99
+ "get_category_colour_profiles",
100
+ ],
29
101
  ["colours.stats", "GET", "/api/v1/colours/stats", "get_colour_stats"],
30
- ["resolveColour", "GET", "/api/v1/search/colours/resolve", "resolve_colour_name"],
31
- ["suggestColour", "GET", "/api/v1/search/colours/suggest", "suggest_colour_names"],
102
+ [
103
+ "resolveColour",
104
+ "GET",
105
+ "/api/v1/search/colours/resolve",
106
+ "resolve_colour_name",
107
+ ],
108
+ [
109
+ "suggestColour",
110
+ "GET",
111
+ "/api/v1/search/colours/suggest",
112
+ "suggest_colour_names",
113
+ ],
32
114
  ["suggest", "GET", "/api/v1/search/suggest", "search_suggest"],
33
- ["resolveAttribute", "GET", "/api/v1/catalog/attributes/resolve", "catalog_resolve_attribute"],
115
+ [
116
+ "resolveAttribute",
117
+ "GET",
118
+ "/api/v1/catalog/attributes/resolve",
119
+ "catalog_resolve_attribute",
120
+ ],
34
121
  [
35
122
  "resolveAttributeValue",
36
123
  "GET",
37
124
  "/api/v1/catalog/attributes/{attributeId}/values/resolve",
38
125
  "catalog_resolve_value",
39
126
  ],
40
- ["searchVocabulary", "GET", "/api/v1/catalog/vocabulary/search", "catalog_vocabulary_search"],
127
+ [
128
+ "searchVocabulary",
129
+ "GET",
130
+ "/api/v1/catalog/vocabulary/search",
131
+ "catalog_vocabulary_search",
132
+ ],
41
133
  ["resolve", "POST", "/api/v1/resolve", "resolve_phrases"],
42
134
  ["bySpec", "GET", "/api/v1/search/specifications", "catalog_by_spec"],
43
135
  ["taxonomy", "GET", "/api/v1/taxonomy/categories", "get_category_taxonomy"],
@@ -45,38 +137,107 @@ const OPERATION_DEFINITIONS = [
45
137
  ["coordinate", "POST", "/api/v1/pairings/coordinate", "coordinate_materials"],
46
138
  ["demand", "GET", "/api/v1/demand", "get_material_demand"],
47
139
  ["colours.palette", "POST", "/api/v1/search/palettes", "search_by_palette"],
48
- ["extractPalette", "POST", "/api/v1/search/palettes/extract", "extract_image_palette"],
49
- ["colours.gradient", "POST", "/api/v1/search/gradients", "search_by_gradient"],
50
- ["specificationFacets", "GET", "/api/v1/catalog/specifications/facets", "list_spec_facets"],
140
+ [
141
+ "extractPalette",
142
+ "POST",
143
+ "/api/v1/search/palettes/extract",
144
+ "extract_image_palette",
145
+ ],
146
+ [
147
+ "colours.gradient",
148
+ "POST",
149
+ "/api/v1/search/gradients",
150
+ "search_by_gradient",
151
+ ],
152
+ [
153
+ "specificationFacets",
154
+ "GET",
155
+ "/api/v1/catalog/specifications/facets",
156
+ "list_spec_facets",
157
+ ],
51
158
  [
52
159
  "attributeValues",
53
160
  "GET",
54
161
  "/api/v1/catalog/attributes/{attributeId}/values",
55
162
  "list_attribute_values",
56
163
  ],
57
- ["applicableSpecs", "GET", "/api/v1/taxonomy/categories/{key}/specs", "get_applicable_specs"],
164
+ [
165
+ "applicableSpecs",
166
+ "GET",
167
+ "/api/v1/taxonomy/categories/{key}/specs",
168
+ "get_applicable_specs",
169
+ ],
58
170
  ["glossary", "GET", "/api/v1/glossary/{term}", "explain_material_term"],
59
171
  ["brands", "GET", "/api/v1/brands", "list_brands"],
60
172
  ["brand", "GET", "/api/v1/brands/{brandSlug}", "get_brand_profile"],
61
- ["uploadSourceMaterial", "POST", "/api/v1/source-material", "upload_source_material"],
62
- ["sourceMaterialBatch", "GET", "/api/v1/source-material/{batchId}", "get_source_material_batch"],
173
+ [
174
+ "brandColourDeck",
175
+ "GET",
176
+ "/api/v1/brands/{brandSlug}/colours",
177
+ "brand_colour_deck",
178
+ ],
179
+ [
180
+ "uploadSourceMaterial",
181
+ "POST",
182
+ "/api/v1/source-material",
183
+ "upload_source_material",
184
+ ],
185
+ [
186
+ "sourceMaterialBatch",
187
+ "GET",
188
+ "/api/v1/source-material/{batchId}",
189
+ "get_source_material_batch",
190
+ ],
191
+ [
192
+ "sourceMaterialComments",
193
+ "GET",
194
+ "/api/v1/source-material/{batchId}/sources/{sourceId}/comments",
195
+ "list_source_material_comments",
196
+ ],
197
+ [
198
+ "sourceMaterialComments",
199
+ "POST",
200
+ "/api/v1/source-material/{batchId}/sources/{sourceId}/comments",
201
+ "post_source_material_comment",
202
+ ],
63
203
  ["capabilities", "GET", "/api/v1/capabilities", "list_public_capabilities"],
64
204
  ["createRun", "POST", "/api/v1/runs", "create_public_run"],
65
205
  ["listRuns", "GET", "/api/v1/runs", "list_public_runs"],
66
206
  ["run", "GET", "/api/v1/runs/{runId}", "get_public_run"],
67
- ["runSchedule", "GET", "/api/v1/runs/{runId}/schedule", "get_run_finish_schedule"],
68
- ["streamRunEvents", "GET", "/api/v1/runs/{runId}/events", "list_public_run_events"],
207
+ [
208
+ "runSchedule",
209
+ "GET",
210
+ "/api/v1/runs/{runId}/schedule",
211
+ "get_run_finish_schedule",
212
+ ],
213
+ [
214
+ "streamRunEvents",
215
+ "GET",
216
+ "/api/v1/runs/{runId}/events",
217
+ "list_public_run_events",
218
+ ],
69
219
  ["resumeRun", "POST", "/api/v1/runs/{runId}/resume", "resume_public_run"],
70
220
  ["cancelRun", "POST", "/api/v1/runs/{runId}/cancel", "cancel_public_run"],
71
221
  ["varyScheme", "POST", "/api/v1/schemes/vary", "vary_schemes"],
222
+ ["slotPools", "POST", "/api/v1/schemes/pools", "slot_pools"],
72
223
  ["createProject", "POST", "/api/v1/projects", "create_box_project"],
73
224
  ["listProjects", "GET", "/api/v1/projects", "list_box_projects"],
74
225
  ["getProject", "GET", "/api/v1/projects/{projectId}", "get_box_project"],
75
- ["appendProjectEvent", "POST", "/api/v1/projects/{projectId}/events", "append_box_project_event"],
226
+ [
227
+ "appendProjectEvent",
228
+ "POST",
229
+ "/api/v1/projects/{projectId}/events",
230
+ "append_box_project_event",
231
+ ],
76
232
  ["demandBatch", "POST", "/api/v1/demand/batch", "get_demand_batch"],
77
233
  ["codeAdvisory", "POST", "/api/v1/codes/advisory", "resolveCodeAdvisory"],
78
234
  ["codes.context", "GET", "/api/v1/codes/context", "list_code_context"],
79
- ["codes.requirements", "GET", "/api/v1/codes/requirements", "list_code_requirements"],
235
+ [
236
+ "codes.requirements",
237
+ "GET",
238
+ "/api/v1/codes/requirements",
239
+ "list_code_requirements",
240
+ ],
80
241
  ];
81
242
  export const SDK_OPERATIONS = Object.freeze(OPERATION_DEFINITIONS.map(([clientMethod, method, path, operationId]) => Object.freeze({ clientMethod, method, path, operationId })));
82
243
  /** 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.9.1",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -86,6 +86,18 @@ export interface MultiColourMatchBase {
86
86
  imageUrl: string | null;
87
87
  /** MB has retired or hidden this SKU. */
88
88
  retired: boolean;
89
+ /**
90
+ * The catalog GROUP — "Flooring", "Textile Materials", "Coatings" — or null
91
+ * when the material has no accepted primary product type.
92
+ *
93
+ * A palette query is cross-category BY INTENT: a designer building a scheme,
94
+ * not browsing one aisle. So this is the field that says whether a result
95
+ * answers the question — one real palette returned 30 of 40 results in a
96
+ * single category while every one of the fourteen groups held something
97
+ * closer on the same colours (MG-1245). Group by it, and keep null as its own
98
+ * bucket: null means UNKNOWN, not uncategorised, and it is not rare.
99
+ */
100
+ category: string | null;
89
101
  /** The candidate's full extracted palette — the evidence scored against. */
90
102
  palette: CandidateSwatch[];
91
103
  /** The aggregate match score in [0,1]; higher is closer. */
@@ -105,6 +117,23 @@ export interface GradientMatch extends MultiColourMatchBase {
105
117
  /** One receipt per sampled point along the path, in path order. */
106
118
  samples: ColourMatchReceipt[];
107
119
  }
120
+ /**
121
+ * The hue-family ADMISSION gate the page was scored under: a candidate swatch
122
+ * may satisfy a query colour only if colorscope's `isHueCompatible` admits it
123
+ * at these exact thresholds. A refused swatch is absent from that colour's
124
+ * matching entirely — it did not merely rank low. Admission, not ranking: it
125
+ * decides which swatches count, never their order. Server-side and fixed (no
126
+ * request knob); the receipt exists so a threshold change is visible on the
127
+ * wire.
128
+ */
129
+ export interface HueGateReceipt {
130
+ /** Below this query chroma the colour is achromatic and any hue is admitted. */
131
+ achromaticQueryChroma: number;
132
+ /** A swatch must carry at least this share of the query colour's chroma. */
133
+ minChromaRatio: number;
134
+ /** Floor on the cosine agreement between the two hue vectors. */
135
+ minHueCosine: number;
136
+ }
108
137
  /**
109
138
  * A PAGE, NOT A CORPUS. `count` is `matches.length` under `limit` (24 default,
110
139
  * 48 max) — this surface states no corpus total and has no cursor, so "N
@@ -120,6 +149,8 @@ export interface SearchPaletteResponse {
120
149
  }>;
121
150
  logic: PaletteLogic;
122
151
  };
152
+ /** The hue-family admission gate this page was scored under. */
153
+ hueGate: HueGateReceipt;
123
154
  /** `matches.length`, capped by `limit`. Never a corpus total. */
124
155
  count: number;
125
156
  matches: PaletteMatch[];
@@ -24,13 +24,19 @@
24
24
  * - You want MATERIALS → `mg.search()`. This lens never returns one.
25
25
  */
26
26
  import type { HttpTransport } from "./http-transport.js";
27
- import type { ResolveResponse } from "./resolve-types.js";
27
+ import type { ResolvePhrasesScope, ResolveResponse } from "./resolve-types.js";
28
28
  import type { VocabularySearchOptions, VocabularySearchResponse } from "./types.js";
29
29
  /**
30
30
  * THE QUESTION: "I have words — what do they mean in YOUR vocabulary?" Send up
31
31
  * to 50 phrases as your users typed them; each comes back with every canonical
32
32
  * token MaterialGraph knows it as — brand, exact paint, colour family, category,
33
- * attribute, value — best first, in request order. Backs `mg.resolve()`.
33
+ * attribute, value, and the two code axes (jurisdiction, occupancy group) — best
34
+ * first, in request order. Backs `mg.resolve()`.
35
+ *
36
+ * The code axes read out of a sentence: "a maximum security prison in Kansas"
37
+ * returns `us-ks` and `I-3`, the pair `mg.codeAdvisory()` is keyed on. They are
38
+ * half a context, not a whole one — that call also wants a space type and a
39
+ * sprinklered flag, and validates the combination before it answers.
34
40
  *
35
41
  * A phrase can legitimately mean several things at once ("sage" is two vendor
36
42
  * paints AND a colour family), so each entry carries a LIST of readings rather
@@ -54,10 +60,23 @@ import type { VocabularySearchOptions, VocabularySearchResponse } from "./types.
54
60
  * complete a name as someone types, and `mg.glossary()` to EXPLAIN a token you
55
61
  * have already resolved.
56
62
  *
63
+ * - **Every reading says what stands behind it.** `coverage.variants` is how
64
+ * many variants carry it corpus-wide, and `0` is a measured answer rather
65
+ * than missing data — a word this vocabulary knows and the catalogue holds
66
+ * nothing under. That is the case you would otherwise discover only by making
67
+ * a second call, on a hot path, where a second call gets skipped. An ABSENT
68
+ * `coverage` means it could not be determined; never read it as none.
69
+ *
70
+ * Pass `category` when you are grounding these words for a SLOT, and read
71
+ * `coverage.inCategory`: a corpus-wide count is not a promise the reading is
72
+ * reachable inside a given category, and that conflation is what turns a
73
+ * top-ranked suggestion into an unsatisfiable requirement.
74
+ *
57
75
  * @param phrases 1-50 phrases, each 1-200 characters. Sent as-is; each is
58
76
  * resolved independently, so one meaningless phrase never spoils the batch.
77
+ * @param options `category` to scope the coverage answer, and an `AbortSignal`.
59
78
  */
60
- export declare function resolvePhrasesRequest(transport: HttpTransport, phrases: string[], signal?: AbortSignal): Promise<ResolveResponse>;
79
+ export declare function resolvePhrasesRequest(transport: HttpTransport, phrases: string[], scope?: ResolvePhrasesScope): Promise<ResolveResponse>;
61
80
  /**
62
81
  * THE QUESTION: "is 'FloorScore' an attribute or a value, and what is it called
63
82
  * here?" The catch-all for ONE phrase when you do not know which half of an
package/resolve-client.js CHANGED
@@ -3,7 +3,13 @@ import { resolveOperation } from "./operations.js";
3
3
  * THE QUESTION: "I have words — what do they mean in YOUR vocabulary?" Send up
4
4
  * to 50 phrases as your users typed them; each comes back with every canonical
5
5
  * token MaterialGraph knows it as — brand, exact paint, colour family, category,
6
- * attribute, value — best first, in request order. Backs `mg.resolve()`.
6
+ * attribute, value, and the two code axes (jurisdiction, occupancy group) — best
7
+ * first, in request order. Backs `mg.resolve()`.
8
+ *
9
+ * The code axes read out of a sentence: "a maximum security prison in Kansas"
10
+ * returns `us-ks` and `I-3`, the pair `mg.codeAdvisory()` is keyed on. They are
11
+ * half a context, not a whole one — that call also wants a space type and a
12
+ * sprinklered flag, and validates the combination before it answers.
7
13
  *
8
14
  * A phrase can legitimately mean several things at once ("sage" is two vendor
9
15
  * paints AND a colour family), so each entry carries a LIST of readings rather
@@ -27,13 +33,34 @@ import { resolveOperation } from "./operations.js";
27
33
  * complete a name as someone types, and `mg.glossary()` to EXPLAIN a token you
28
34
  * have already resolved.
29
35
  *
36
+ * - **Every reading says what stands behind it.** `coverage.variants` is how
37
+ * many variants carry it corpus-wide, and `0` is a measured answer rather
38
+ * than missing data — a word this vocabulary knows and the catalogue holds
39
+ * nothing under. That is the case you would otherwise discover only by making
40
+ * a second call, on a hot path, where a second call gets skipped. An ABSENT
41
+ * `coverage` means it could not be determined; never read it as none.
42
+ *
43
+ * Pass `category` when you are grounding these words for a SLOT, and read
44
+ * `coverage.inCategory`: a corpus-wide count is not a promise the reading is
45
+ * reachable inside a given category, and that conflation is what turns a
46
+ * top-ranked suggestion into an unsatisfiable requirement.
47
+ *
30
48
  * @param phrases 1-50 phrases, each 1-200 characters. Sent as-is; each is
31
49
  * resolved independently, so one meaningless phrase never spoils the batch.
50
+ * @param options `category` to scope the coverage answer, and an `AbortSignal`.
32
51
  */
33
- export function resolvePhrasesRequest(transport, phrases, signal) {
52
+ export function resolvePhrasesRequest(transport, phrases, scope) {
53
+ // A bare signal is what this took before `category` existed; keep accepting it
54
+ // so no published call site had to change to gain coverage.
55
+ const options = scope instanceof AbortSignal ? { signal: scope } : (scope ?? {});
34
56
  return transport.requestJson(resolveOperation("resolve_phrases"), {
35
- body: { phrases },
36
- signal,
57
+ body: {
58
+ phrases,
59
+ ...(options.category === undefined
60
+ ? {}
61
+ : { category: options.category }),
62
+ },
63
+ signal: options.signal,
37
64
  });
38
65
  }
39
66
  /**
@@ -27,8 +27,18 @@
27
27
  * pair, for `mg.bySpec()` or `search({ filters })`.
28
28
  * - `attribute_value` — a value-dictionary term, namespaced (`ms_sheen.matte`):
29
29
  * the RIGHT half.
30
+ * - `jurisdiction` — a code jurisdiction id (`us-tx`), for `mg.codeAdvisory()`.
31
+ * - `occupancy_group` — an IBC occupancy group (`R-1`), the other axis the code
32
+ * endpoints are keyed on. BARE, not namespaced, even though the groups live in
33
+ * a value dictionary: `R-1` is the token those endpoints take.
34
+ *
35
+ * The two code axes are half a context, not a whole one. `/codes/advisory` also
36
+ * needs a `spaceType` (or a `roomType` to correlate one from) and a
37
+ * `sprinklered` flag — neither of which a phrase can state — and it validates
38
+ * the combination before it answers, so send them and read its verdict rather
39
+ * than assuming a resolved pair is usable.
30
40
  */
31
- export type ResolutionKind = "brand" | "paint_identity" | "colour" | "category" | "attribute" | "attribute_value";
41
+ export type ResolutionKind = "brand" | "paint_identity" | "colour" | "category" | "attribute" | "attribute_value" | "jurisdiction" | "occupancy_group";
32
42
  /**
33
43
  * How the phrase matched, strongest first. `exact` — it IS the canonical token;
34
44
  * `alias` — it IS a recorded alternative name for it; `lexical` — it resembles
@@ -68,6 +78,49 @@ export interface ResolvedMeaning {
68
78
  ambiguity?: {
69
79
  gap: number;
70
80
  };
81
+ /**
82
+ * How much of the catalogue stands behind this reading — so you never have to
83
+ * make a second, differently-shaped call to find out that a confident answer
84
+ * is empty.
85
+ *
86
+ * ABSENT means coverage could not be determined for this reading; it is a
87
+ * statement about the MEASUREMENT, never about the catalogue. A measured
88
+ * nothing is `{ variants: 0 }`. Do not collapse the two: `attribute` and
89
+ * `attribute_value` readings (and `brand`, whose corpus weight comes free)
90
+ * carry it; the rest have no equivalently cheap count behind them and report
91
+ * nothing rather than a figure measured a different way.
92
+ */
93
+ coverage?: MeaningCoverage;
94
+ }
95
+ /** How much of the catalogue stands behind one reading. */
96
+ export interface MeaningCoverage {
97
+ /**
98
+ * How many variants carry this reading, CORPUS-WIDE and across every brand —
99
+ * never scoped to the `category` you sent, even when you sent one. `0` is a
100
+ * measured answer, not missing data: MaterialGraph knows the word and the
101
+ * catalogue holds nothing under it, which is the case worth catching before
102
+ * you spend the token on a filter.
103
+ *
104
+ * For an `attribute` reading over an ARRAY-valued attribute a variant is
105
+ * counted once per token it carries, so the figure is an upper bound on
106
+ * distinct variants there. It is exact for scalar attributes, exact for every
107
+ * `attribute_value`, and the zero is exact in every case.
108
+ */
109
+ variants: number;
110
+ /**
111
+ * Whether the `category` you sent holds ANY accepted value for the attribute
112
+ * behind this reading. Present only when you sent a category AND the answer
113
+ * could be determined — its absence is a statement about the measurement, not
114
+ * a `false`.
115
+ *
116
+ * `false` means no criterion built on this reading can be satisfied inside
117
+ * that category at any rung of retrieval's relaxation ladder, however large
118
+ * `variants` is. Read this rather than inferring reachability from the count:
119
+ * an attribute with forty thousand values across the catalogue can hold none
120
+ * at all in Wall Finishes. The probe is ATTRIBUTE-level, so `true` says the
121
+ * category holds SOME value for the attribute, not that it holds this one.
122
+ */
123
+ inCategory?: boolean;
71
124
  }
72
125
  /** What one phrase resolved to — including, explicitly, nothing. */
73
126
  export interface PhraseResolution {
@@ -95,6 +148,22 @@ export interface PhraseResolution {
95
148
  */
96
149
  unresolved: boolean;
97
150
  }
151
+ /** Optional scoping for a resolve call. */
152
+ export interface ResolvePhrasesOptions {
153
+ /**
154
+ * The product category you are grounding these words FOR — a slot, not a
155
+ * filter. It adds {@link MeaningCoverage.inCategory} to every `attribute` and
156
+ * `attribute_value` reading. Omit for corpus-wide only.
157
+ */
158
+ category?: string;
159
+ signal?: AbortSignal;
160
+ }
161
+ /**
162
+ * What `mg.resolve()` accepts as its second argument. A bare `AbortSignal` is
163
+ * still accepted, exactly as before {@link ResolvePhrasesOptions} existed, so no
164
+ * existing call site had to move.
165
+ */
166
+ export type ResolvePhrasesScope = AbortSignal | ResolvePhrasesOptions;
98
167
  /** The resolve response: one entry per phrase, in the order you sent them. */
99
168
  export interface ResolveResponse {
100
169
  /** One per phrase, in request order — never reordered, never deduplicated. */
package/run-events.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { RunEvent } from "./run-types.js";
1
2
  /**
2
3
  * Typed payloads for the composition Run event family — the friction fix flagged
3
4
  * by the MG-443 walk. These narrow the loose {@link RunEvent.payloadJson} so
@@ -13,7 +14,6 @@
13
14
  * as standalone TS types (no cross-package import; the SDK is publishable).
14
15
  */
15
16
  import type { OpenEnum } from "./types.js";
16
- import type { RunEvent } from "./run-types.js";
17
17
  export declare const COMPOSITION_PHASE_EVENT_TYPES: readonly ["composition.phase", "material-box.phase"];
18
18
  export declare const COMPOSITION_PROGRAMME_EVENT_TYPES: readonly ["composition.programme", "material-box.brief"];
19
19
  export declare const COMPOSITION_REVIEW_CRITERIA_EVENT_TYPES: readonly ["composition.review-criteria", "material-box.review-criteria"];
package/run-events.js CHANGED
@@ -1,5 +1,8 @@
1
1
  // ── Wire event-type strings (both generations) ───────────────────────────────
2
- export const COMPOSITION_PHASE_EVENT_TYPES = ["composition.phase", "material-box.phase"];
2
+ export const COMPOSITION_PHASE_EVENT_TYPES = [
3
+ "composition.phase",
4
+ "material-box.phase",
5
+ ];
3
6
  export const COMPOSITION_PROGRAMME_EVENT_TYPES = [
4
7
  "composition.programme",
5
8
  "material-box.brief",