@instruments/materialgraph 3.3.0 → 3.5.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/client.d.ts CHANGED
@@ -117,13 +117,13 @@ export declare class MaterialGraphClient {
117
117
  resolveVariant(input: ResolveVariantInput, signal?: AbortSignal): Promise<ResolveVariantOutput>;
118
118
  /**
119
119
  * How much each of 1 to 48 variants is sampled by Material Bank members
120
- * (POST `/api/v1/demand`): `samplePercentile` within its category, with a
120
+ * (POST `/api/v1/demand`): `samplePercentile` within its product type, with a
121
121
  * `trend` and the `change` of this year against the year before. Results
122
122
  * keep request order. No count is returned.
123
123
  */
124
124
  getVariantDemand(input: GetVariantDemandInput, signal?: AbortSignal): Promise<GetVariantDemandOutput>;
125
125
  /**
126
- * The variants of one category sampled at least 15% more this year than
126
+ * The variants of one product type sampled at least 15% more this year than
127
127
  * the year before (GET `/api/v1/demand/rising`), largest `change` first.
128
128
  * No count is returned.
129
129
  */
package/client.js CHANGED
@@ -155,7 +155,7 @@ export class MaterialGraphClient {
155
155
  }
156
156
  /**
157
157
  * How much each of 1 to 48 variants is sampled by Material Bank members
158
- * (POST `/api/v1/demand`): `samplePercentile` within its category, with a
158
+ * (POST `/api/v1/demand`): `samplePercentile` within its product type, with a
159
159
  * `trend` and the `change` of this year against the year before. Results
160
160
  * keep request order. No count is returned.
161
161
  */
@@ -166,14 +166,14 @@ export class MaterialGraphClient {
166
166
  });
167
167
  }
168
168
  /**
169
- * The variants of one category sampled at least 15% more this year than
169
+ * The variants of one product type sampled at least 15% more this year than
170
170
  * the year before (GET `/api/v1/demand/rising`), largest `change` first.
171
171
  * No count is returned.
172
172
  */
173
173
  async listRisingVariants(input, signal) {
174
174
  return await this.#get("list_rising_variants", {
175
- category: input.category,
176
175
  limit: input.limit === undefined ? undefined : String(input.limit),
176
+ productType: input.productType,
177
177
  projectType: input.projectType,
178
178
  }, signal);
179
179
  }
@@ -10,16 +10,20 @@ import type { OpenEnum } from "./types.js";
10
10
  export interface GetVariantDemandInput {
11
11
  /** 1 to 48 variant ids. */
12
12
  variantIds: string[];
13
- /** One Material Bank project type; omit for every project type together. */
13
+ /**
14
+ * One Material Bank project type, spelled as Material Bank spells it, such
15
+ * as "Hospitality: Hotel"; omit for every project type together. One the
16
+ * published build did not measure is a 400 that lists the ones it did.
17
+ */
14
18
  projectType?: string;
15
19
  }
16
20
  export type DemandTrend = OpenEnum<"rising" | "steady" | "falling">;
17
21
  export type VariantDemand = {
18
22
  state: "measured";
19
23
  variantId: string;
20
- /** The category the percentile is ranked within. */
21
- category: string;
22
- /** Share of the category's variants sampled as much or less, 1 to 100. */
24
+ /** The id of the product type the percentile is ranked within. */
25
+ productType: string;
26
+ /** Share of the product type's variants sampled as much or less, 1 to 100. */
23
27
  samplePercentile: number;
24
28
  /** Null when the year before cannot be shown. */
25
29
  trend: DemandTrend | null;
@@ -43,16 +47,16 @@ export interface GetVariantDemandOutput {
43
47
  results: VariantDemand[];
44
48
  }
45
49
  export interface ListRisingVariantsInput {
46
- /** A MaterialGraph category id, such as `wallcovering`. */
47
- category: string;
50
+ /** A MaterialGraph product type id, such as `wallcovering`. An unknown id is a 400. */
51
+ productType: string;
48
52
  /** Variants to return, at most 100. Default 20. */
49
53
  limit?: number;
50
- /** One Material Bank project type; omit for every project type together. */
54
+ /** One Material Bank project type, as in `GetVariantDemandInput`. */
51
55
  projectType?: string;
52
56
  }
53
57
  export interface RisingVariant {
54
58
  variantId: string;
55
- /** Share of the category's variants sampled as much or less, 1 to 100. */
59
+ /** Share of the product type's variants sampled as much or less, 1 to 100. */
56
60
  samplePercentile: number;
57
61
  trend: DemandTrend | null;
58
62
  /** This year against the year before; 0.4 is 40% more. */
@@ -62,7 +66,7 @@ export interface ListRisingVariantsOutput {
62
66
  /** Last day of the measured year, as an ISO date. */
63
67
  asOf: string;
64
68
  basis: "measured";
65
- category: string;
69
+ productType: string;
66
70
  /** Largest change first. */
67
71
  results: RisingVariant[];
68
72
  source: string;
package/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export type { DiscoveryReference, DiscoveryTerms, InterpretDiscoveryTermsInput, ColorlessVariantsResult, VariantSibling, } from "./discovery-context-types.js";
2
2
  export { MaterialGraphClient, DEFAULT_BASE_URL } from "./client.js";
3
3
  export type { MaterialGraphClientOptions } from "./client.js";
4
- export type { FilterOp, FilterTermCondition, FilterNumericCondition, FilterPresenceCondition, FilterAnyFieldCondition, FilterCondition, FilterGroups, OptionalFilterGroups, OrderByEntry, ListVariantsInclude, ListVariantsCollapse, ColorRegion, ColorRangeCondition, ListVariantsInput, ListVariantsPreference, ListVariantsSpecifications, ListVariantsNotApplicable, SampleSizeObservation, VariantObservations, SampleSubject, ListVariantsItem, ListVariantsOutput, VariantCard, } from "./list-variants-types.js";
4
+ export type { FilterOp, FilterTermCondition, FilterNumericCondition, FilterPresenceCondition, FilterAnyFieldCondition, FilterCondition, FilterGroups, OptionalFilterGroups, OrderByEntry, ListVariantsInclude, ListVariantsCollapse, ColorRegion, ColorRangeCondition, ListVariantsInput, ListVariantsPreference, ListVariantsSpecifications, ListVariantsNotApplicable, SampleSizeObservation, VariantObservations, SampleSubject, ListVariantsItem, Market, ListVariantsOutput, VariantCard, } from "./list-variants-types.js";
5
5
  export type { ListVariantFacetsInput, VariantFacetValue, CategoricalVariantFacet, BooleanVariantFacet, NumericVariantFacet, VariantFacet, ListVariantFacetsOutput, } from "./list-variant-facets-types.js";
6
6
  export type { SearchVariantsSelection, SearchVariantsInput, SearchVariantsUnderstood, SearchVariantsReading, SearchVariantsSuggestion, SearchVariantsChoice, SearchVariantsOutput, } from "./search-variants-types.js";
7
7
  export type { Baseline, BaselineResult, BaselineSource, BaselineStrength, BaselineWayToMeet, CheckBaselinesInput, CheckBaselinesResult, ListBaselinesOptions, ListBaselinesResult, } from "./baseline-types.js";
@@ -93,7 +93,7 @@ export interface OptionalFilterGroups {
93
93
  }
94
94
  export interface OrderByEntry {
95
95
  direction: "asc" | "desc";
96
- /** A numeric attribute id. */
96
+ /** A single-valued numeric attribute id (`getAttribute` says orderable), or `color_lightness` or `color_chroma`: the lightness and chroma of the variant's dominant measured color. */
97
97
  field: string;
98
98
  }
99
99
  export type ListVariantsInclude = "image" | "url";
@@ -196,6 +196,8 @@ export interface ListVariantsNotApplicable {
196
196
  }
197
197
  /** What a sample represents, independently of its specification type. */
198
198
  export type SampleSubject = "material" | "paint_color_sample" | "unknown" | "conflict";
199
+ /** A Material Bank market: North America or Europe. */
200
+ export type Market = "na" | "eu";
199
201
  /**
200
202
  * One list item: the compact identity needed to pick a variant, with image
201
203
  * and brand page only when requested (`include`) and selected attributes
@@ -234,6 +236,8 @@ export interface ListVariantsItem {
234
236
  };
235
237
  /** The variant's Material Bank SKU. Absent means none is recorded. */
236
238
  materialBankId?: string;
239
+ /** The Material Bank markets it is orderable in: `na`, `eu`, both or neither. The `market` filter field takes them. */
240
+ markets: Market[];
237
241
  name: string;
238
242
  /** The trimmed source variant label; null when unknown or for a paint color sample, whose own name identifies its color. Separate from surface finish, color family and derived color names. */
239
243
  variantLabel: string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instruments/materialgraph",
3
- "version": "3.3.0",
3
+ "version": "3.5.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {