@instruments/materialgraph 0.35.0 → 0.36.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
@@ -6,7 +6,7 @@ import type { ResolvedVerdictCitation } from "./citation-types.js";
6
6
  import type { MaterialGraphClientOptions } from "./client-config.js";
7
7
  import { ColorsClient } from "./colors-client.js";
8
8
  import type { RateLimit } from "./errors.js";
9
- import type { FindCompanionsInput, FindCompanionsOutput } from "./find-companions-types.js";
9
+ import type { FindSampledTogetherInput, FindSampledTogetherOutput } from "./find-sampled-together-types.js";
10
10
  import type { FindVariantsByColorInput, FindVariantsByColorOutput } from "./find-variants-by-color-types.js";
11
11
  import type { FindVariantsByVectorInput, FindVariantsByVectorOutput } from "./find-variants-by-vector-types.js";
12
12
  import type { GetVariantOptions, GetVariantOutput } from "./get-variant-types.js";
@@ -200,15 +200,15 @@ export declare class MaterialGraphClient extends CatalogueClient {
200
200
  findVariantsByColor(input: FindVariantsByColorInput, signal?: AbortSignal): Promise<FindVariantsByColorOutput>;
201
201
  /**
202
202
  * THE QUESTION: "what did designers sample together with these?" (POST
203
- * `/api/v1/variants/companions`, MG-2332). Give `variantIds` and/or
203
+ * `/api/v1/variants/sampled-together`, MG-2332). Give `variantIds` and/or
204
204
  * `materials` (free-text names, one variant each, at most twelve together);
205
- * companions come back strongest first, each with its `lift`,
206
- * `seedMatchCount`, `relation` and a one-line `reason`. `projectType` reads one
205
+ * the materials come back other brands first, then the most projects, each
206
+ * with its `lift`, `seedMatchCount`, `relation` and a one-line `reason`. `projectType` reads one
207
207
  * sector; `include` adds `image` and `color` fields a lean page leaves out.
208
208
  * A sample order shows sampling, never specification. Read `unresolved`
209
209
  * before presenting: a scheme of four that resolved two is a different claim.
210
210
  */
211
- findCompanions(input: FindCompanionsInput, signal?: AbortSignal): Promise<FindCompanionsOutput>;
211
+ findSampledTogether(input: FindSampledTogetherInput, signal?: AbortSignal): Promise<FindSampledTogetherOutput>;
212
212
  /**
213
213
  * THE QUESTION: "what looks or feels like this?" (POST
214
214
  * `/api/v1/variants/by-vector`, MG-2231). Eligible variants ranked by
package/client.js CHANGED
@@ -282,16 +282,16 @@ export class MaterialGraphClient extends CatalogueClient {
282
282
  }
283
283
  /**
284
284
  * THE QUESTION: "what did designers sample together with these?" (POST
285
- * `/api/v1/variants/companions`, MG-2332). Give `variantIds` and/or
285
+ * `/api/v1/variants/sampled-together`, MG-2332). Give `variantIds` and/or
286
286
  * `materials` (free-text names, one variant each, at most twelve together);
287
- * companions come back strongest first, each with its `lift`,
288
- * `seedMatchCount`, `relation` and a one-line `reason`. `projectType` reads one
287
+ * the materials come back other brands first, then the most projects, each
288
+ * with its `lift`, `seedMatchCount`, `relation` and a one-line `reason`. `projectType` reads one
289
289
  * sector; `include` adds `image` and `color` fields a lean page leaves out.
290
290
  * A sample order shows sampling, never specification. Read `unresolved`
291
291
  * before presenting: a scheme of four that resolved two is a different claim.
292
292
  */
293
- async findCompanions(input, signal) {
294
- return await this.#post("find_companions", input, signal);
293
+ async findSampledTogether(input, signal) {
294
+ return await this.#post("find_sampled_together", input, signal);
295
295
  }
296
296
  /**
297
297
  * THE QUESTION: "what looks or feels like this?" (POST
@@ -1,32 +1,32 @@
1
1
  /**
2
- * @module find-companions-types
3
- * @description Hand-maintained mirror of `find_companions`' (MG-2332) input and
2
+ * @module find-sampled-together-types
3
+ * @description Hand-maintained mirror of `find_sampled_together`'s (MG-2332) input and
4
4
  * output wire shapes. The source of truth is
5
- * `packages/products/src/cospec/schema.ts` (`findCompanionsInputSchema`,
6
- * `findCompanionsResultSchema`). This SDK has no RUNTIME dependency on
5
+ * `packages/products/src/cospec/schema.ts` (`findSampledTogetherInputSchema`,
6
+ * `findSampledTogetherResultSchema`). This SDK has no RUNTIME dependency on
7
7
  * `@materialgraph/products` (it's a devDependency only, for the parity tests in
8
8
  * `__tests__/`), so the shapes are copied here rather than imported.
9
9
  * `contract-parity.test.ts` keeps this mirror honest against the server types,
10
10
  * the project-type list included.
11
11
  */
12
12
  /** The closed sector vocabulary co-specification evidence is tagged with. */
13
- export type CompanionProjectType = "Workplace" | "Residential" | "Institution Education" | "Hospitality: Hotel" | "Mixed-Use & Multi-Unit Residential" | "Healthcare" | "Hospitality: Restaurant" | "Government" | "Senior Living" | "Retail" | "Other" | "Sports Entertainment" | "Wellness" | "Medical Dental" | "Aviation" | "Industrial" | "Tech" | "Transportation" | "Single Family" | "Condominium Cooperative" | "Marine" | "Power & Energy" | "University Design Program: Interior Design" | "Non-Billable" | "University Design Program: Interior Architecture" | "University Design Program: Architecture" | "Historic Preservation";
13
+ export type SampledTogetherProjectType = "Workplace" | "Residential" | "Institution Education" | "Hospitality: Hotel" | "Mixed-Use & Multi-Unit Residential" | "Healthcare" | "Hospitality: Restaurant" | "Government" | "Senior Living" | "Retail" | "Other" | "Sports Entertainment" | "Wellness" | "Medical Dental" | "Aviation" | "Industrial" | "Tech" | "Transportation" | "Single Family" | "Condominium Cooperative" | "Marine" | "Power & Energy" | "University Design Program: Interior Design" | "Non-Billable" | "University Design Program: Interior Architecture" | "University Design Program: Architecture" | "Historic Preservation";
14
14
  /** At least one of `variantIds` and `materials`, at most twelve together. */
15
- export type FindCompanionsInput = {
15
+ export type FindSampledTogetherInput = {
16
16
  /** Optional row fields: image adds imageUrl, color adds swatches. */
17
17
  include?: ("image" | "color")[];
18
18
  /** Ops and audit switch: leave sample cards in. Default false. */
19
19
  includeSamplingArtifacts?: boolean;
20
- /** Companions to return, default 20, at most 100. */
20
+ /** Materials to return, default 20, at most 100. */
21
21
  limit?: number;
22
22
  /** Names to resolve when you hold no ids. Misses come back unresolved. */
23
23
  materials?: string[];
24
- /** Only companions sampled together in projects of this sector. */
25
- projectType?: CompanionProjectType;
26
- /** Variants to find companions for. */
24
+ /** Only materials sampled together in projects of this sector. */
25
+ projectType?: SampledTogetherProjectType;
26
+ /** Variants to find sampled-together materials for. */
27
27
  variantIds?: string[];
28
28
  };
29
- export type FindCompanionsRow = {
29
+ export type FindSampledTogetherRow = {
30
30
  brand: string;
31
31
  /** Palette likeness to the seeds. Present with `include: ["color"]`; never reorders. */
32
32
  colorFit?: number | null;
@@ -37,8 +37,8 @@ export type FindCompanionsRow = {
37
37
  product: string;
38
38
  /** Why it was suggested, in one line. */
39
39
  reason: string;
40
- /** `companion` is another brand; `brand_sibling` and `colorway` share the seed's. */
41
- relation: "companion" | "brand_sibling" | "colorway";
40
+ /** `other_brand` is another brand; `brand_sibling` and `colorway` share the seed's. */
41
+ relation: "other_brand" | "brand_sibling" | "colorway";
42
42
  /** How many seeds it was sampled with. */
43
43
  seedMatchCount: number;
44
44
  /** Present with `include: ["color"]`. */
@@ -49,9 +49,9 @@ export type FindCompanionsRow = {
49
49
  variantId: string;
50
50
  variantName: string | null;
51
51
  };
52
- export type FindCompanionsOutput = {
53
- /** Strongest first: seeds matched, then summed lift, one row per product. */
54
- companions: FindCompanionsRow[];
52
+ export type FindSampledTogetherOutput = {
53
+ /** Other brands first, then seeds matched, then lift weighted by projects; one row per product. */
54
+ sampledTogether: FindSampledTogetherRow[];
55
55
  /** The seeds as resolved, so a caller sees what a name became. */
56
56
  seeds: {
57
57
  brand: string;
@@ -1,9 +1,9 @@
1
1
  /**
2
- * @module find-companions-types
3
- * @description Hand-maintained mirror of `find_companions`' (MG-2332) input and
2
+ * @module find-sampled-together-types
3
+ * @description Hand-maintained mirror of `find_sampled_together`'s (MG-2332) input and
4
4
  * output wire shapes. The source of truth is
5
- * `packages/products/src/cospec/schema.ts` (`findCompanionsInputSchema`,
6
- * `findCompanionsResultSchema`). This SDK has no RUNTIME dependency on
5
+ * `packages/products/src/cospec/schema.ts` (`findSampledTogetherInputSchema`,
6
+ * `findSampledTogetherResultSchema`). This SDK has no RUNTIME dependency on
7
7
  * `@materialgraph/products` (it's a devDependency only, for the parity tests in
8
8
  * `__tests__/`), so the shapes are copied here rather than imported.
9
9
  * `contract-parity.test.ts` keeps this mirror honest against the server types,
package/index.d.ts CHANGED
@@ -6,7 +6,7 @@ export type * from "./search-variants-types.js";
6
6
  export type * from "./list-enum-values-types.js";
7
7
  export type * from "./get-variant-types.js";
8
8
  export type * from "./image-reference-types.js";
9
- export type * from "./find-companions-types.js";
9
+ export type * from "./find-sampled-together-types.js";
10
10
  export type * from "./find-variants-by-color-types.js";
11
11
  export { FIND_VARIANTS_BY_VECTOR_MODES } from "./find-variants-by-vector-types.js";
12
12
  export type * from "./find-variants-by-vector-types.js";
package/operations.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export declare const MATERIALGRAPH_API_VERSION = "0.8.0";
2
- declare const OPERATION_DEFINITIONS: readonly [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 ["samplizeCatalogue", "GET", "/api/v1/catalogues/samplize/products", "samplize_catalogue_products"], 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 ["searchVariants", "POST", "/api/v1/variants/search", "search_variants"], readonly ["findVariantsByColor", "POST", "/api/v1/variants/by-color", "find_variants_by_color"], 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 ["resolveColor", "GET", "/api/v1/search/colors/resolve", "resolve_color_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 ["colors.profiles", "GET", "/api/v1/colors/profiles", "get_category_color_profiles"], 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"]];
2
+ declare const OPERATION_DEFINITIONS: readonly [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 ["samplizeCatalogue", "GET", "/api/v1/catalogues/samplize/products", "samplize_catalogue_products"], 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 ["searchVariants", "POST", "/api/v1/variants/search", "search_variants"], readonly ["findVariantsByColor", "POST", "/api/v1/variants/by-color", "find_variants_by_color"], readonly ["findVariantsByVector", "POST", "/api/v1/variants/by-vector", "find_variants_by_vector"], readonly ["findSampledTogether", "POST", "/api/v1/variants/sampled-together", "find_sampled_together"], readonly ["resolveVariant", "POST", "/api/v1/variants/resolve", "resolve_variant"], readonly ["getVariant", "GET", "/api/v1/variants/{variantId}", "get_variant"], readonly ["resolveColor", "GET", "/api/v1/search/colors/resolve", "resolve_color_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 ["colors.profiles", "GET", "/api/v1/colors/profiles", "get_category_color_profiles"], 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
@@ -107,7 +107,12 @@ const OPERATION_DEFINITIONS = [
107
107
  "/api/v1/variants/by-vector",
108
108
  "find_variants_by_vector",
109
109
  ],
110
- ["findCompanions", "POST", "/api/v1/variants/companions", "find_companions"],
110
+ [
111
+ "findSampledTogether",
112
+ "POST",
113
+ "/api/v1/variants/sampled-together",
114
+ "find_sampled_together",
115
+ ],
111
116
  ["resolveVariant", "POST", "/api/v1/variants/resolve", "resolve_variant"],
112
117
  ["getVariant", "GET", "/api/v1/variants/{variantId}", "get_variant"],
113
118
  [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instruments/materialgraph",
3
- "version": "0.35.0",
3
+ "version": "0.36.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,5 +1,5 @@
1
1
  /** The API contract version the schemas were generated from. */
2
2
  export declare const RESPONSE_SCHEMA_API_VERSION = "0.8.0";
3
3
  /** Every SDK operation whose success response has a published JSON Schema. */
4
- export declare const RESPONSE_SCHEMA_OPERATION_IDS: readonly ["list_catalog_documents", "list_catalog_pages", "get_catalog_page_representation", "list_catalog_product_references", "samplize_catalogue_products", "get_catalogue_references_batch", "list_catalogue_channel_collections", "get_catalogue_document_access", "list_material_blocks", "list_variant_assets", "list_material_documents", "list_schema_value_dictionaries", "get_material_pairings", "list_associated_finishes", "list_associated_products", "get_applicability", "list_variants", "list_variant_facets", "search_variants", "find_variants_by_color", "find_variants_by_vector", "find_companions", "resolve_variant", "get_variant", "resolve_color_name", "catalog_list_attributes", "catalog_list_enum_values", "list_categories", "get_category", "whoami", "get_category_color_profiles", "extract_image_palette", "list_brands", "upload_source_material", "create_public_run", "get_public_run", "get_verdict_citation"];
4
+ export declare const RESPONSE_SCHEMA_OPERATION_IDS: readonly ["list_catalog_documents", "list_catalog_pages", "get_catalog_page_representation", "list_catalog_product_references", "samplize_catalogue_products", "get_catalogue_references_batch", "list_catalogue_channel_collections", "get_catalogue_document_access", "list_material_blocks", "list_variant_assets", "list_material_documents", "list_schema_value_dictionaries", "get_material_pairings", "list_associated_finishes", "list_associated_products", "get_applicability", "list_variants", "list_variant_facets", "search_variants", "find_variants_by_color", "find_variants_by_vector", "find_sampled_together", "resolve_variant", "get_variant", "resolve_color_name", "catalog_list_attributes", "catalog_list_enum_values", "list_categories", "get_category", "whoami", "get_category_color_profiles", "extract_image_palette", "list_brands", "upload_source_material", "create_public_run", "get_public_run", "get_verdict_citation"];
5
5
  export declare const RESPONSE_SCHEMA_CATALOGUE_JSON: string;