@instruments/materialgraph 0.38.0 → 0.39.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/associations-client.js +12 -3
- package/by-spec-types.d.ts +1 -1
- package/catalogue-types.d.ts +36 -37
- package/categories-client.d.ts +2 -2
- package/client-response-schema.d.ts +3 -0
- package/client-response-schema.js +79 -0
- package/client.d.ts +9 -4
- package/client.js +46 -18
- package/colors-client.d.ts +5 -2
- package/colors-client.js +4 -0
- package/errors.d.ts +4 -4
- package/errors.js +13 -10
- package/find-variants-by-color-types.d.ts +6 -8
- package/find-variants-by-vector-types.d.ts +3 -0
- package/get-variant-types.d.ts +22 -1
- package/http-transport.d.ts +2 -1
- package/http-transport.js +12 -10
- package/index.d.ts +22 -21
- package/material-block-types.d.ts +7 -1
- package/material-resources-client.js +4 -1
- package/nearest-paints-types.d.ts +33 -0
- package/nearest-paints-types.js +1 -0
- package/operation-responses.d.ts +65 -0
- package/operation-responses.js +1 -0
- package/operations.d.ts +4 -12
- package/operations.generated.d.ts +11 -0
- package/operations.generated.js +189 -0
- package/operations.js +10 -178
- package/package.json +2 -2
- package/parse-operation-response.d.ts +5 -0
- package/parse-operation-response.js +202 -0
- package/response-schemas.generated.d.ts +1 -1
- package/response-schemas.generated.js +35 -32
- package/runs.d.ts +2 -1
- package/runs.js +45 -12
- package/samplize-catalogue-types.d.ts +8 -8
- package/samplize-colorvec.js +111 -80
- package/sse.d.ts +2 -1
- package/sse.js +7 -5
- package/types.d.ts +6 -6
|
@@ -47,14 +47,14 @@ export type FindVariantsByColorInput = {
|
|
|
47
47
|
variantIds?: string[];
|
|
48
48
|
};
|
|
49
49
|
export type ColorConditionReceipt = {
|
|
50
|
-
/**
|
|
50
|
+
/** CIEDE2000 difference to the assigned settled swatch. Never a probability. */
|
|
51
51
|
distance: number;
|
|
52
52
|
hex: string;
|
|
53
53
|
/** Position in the request's `colors[]`. */
|
|
54
54
|
index: number;
|
|
55
|
-
/** The
|
|
55
|
+
/** The assigned swatch's share of the settled palette, 0 to 1. */
|
|
56
56
|
proportion: number;
|
|
57
|
-
/** Requested
|
|
57
|
+
/** Requested share used for ColorVec retrieval, palette only; null otherwise. */
|
|
58
58
|
target: number | null;
|
|
59
59
|
};
|
|
60
60
|
export type PaintCatalogVariant = {
|
|
@@ -71,7 +71,7 @@ export type ResolvedColor = {
|
|
|
71
71
|
index: number;
|
|
72
72
|
/** `region`: a named meaning's own OKLCh bounds, kept — never collapsed to one hex. */
|
|
73
73
|
kind: "point" | "region";
|
|
74
|
-
/**
|
|
74
|
+
/** Image-extracted or stored target-variant swatch share; else null. */
|
|
75
75
|
share: number | null;
|
|
76
76
|
};
|
|
77
77
|
export type ColorAlternative = {
|
|
@@ -143,14 +143,12 @@ export type ColorRankedSeed = {
|
|
|
143
143
|
/** The variant's own name — paint colorway names live here (label contract). */
|
|
144
144
|
variantName: string | null;
|
|
145
145
|
};
|
|
146
|
-
/** RERANK's own card — the same shape `ColorVariantMatch` above (`brandId`, `code`), plus its
|
|
146
|
+
/** RERANK's own card — the same shape `ColorVariantMatch` above (`brandId`, `code`), plus its perceptual distance. */
|
|
147
147
|
export type ColorRankMatch = {
|
|
148
148
|
brand: string;
|
|
149
149
|
brandId: string;
|
|
150
150
|
code: string | null;
|
|
151
|
-
/**
|
|
152
|
-
colorSimilarity: number | null;
|
|
153
|
-
/** Cosine distance computed in TypeScript (0 = identical); null when unembedded. */
|
|
151
|
+
/** CIEDE2000 difference to the settled reference color (0 = identical); null without a settled palette. */
|
|
154
152
|
distance: number | null;
|
|
155
153
|
imageUrl: string | null;
|
|
156
154
|
product: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PaintCatalogVariant } from "./find-variants-by-color-types.js";
|
|
1
2
|
/**
|
|
2
3
|
* @module find-variants-by-vector-types
|
|
3
4
|
* @description Hand-maintained mirror of `find_variants_by_vector`'s
|
|
@@ -61,6 +62,8 @@ export type FindVariantsByVectorOutput = {
|
|
|
61
62
|
items: FindVariantsByVectorItem[];
|
|
62
63
|
mode: FindVariantsByVectorMode;
|
|
63
64
|
reference: FindVariantsByVectorReference;
|
|
65
|
+
/** The exact brand paint named by the text query, when held in the catalogue. */
|
|
66
|
+
namedPaint?: PaintCatalogVariant;
|
|
64
67
|
scan: FindVariantsByVectorScan;
|
|
65
68
|
timings: FindVariantsByVectorTimings;
|
|
66
69
|
/** Explicit `{field: "variant", op: "in"}` filter ids that named no eligible variant — present only when at least one did. */
|
package/get-variant-types.d.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* server types.
|
|
9
9
|
*/
|
|
10
10
|
import type { ListVariantsNotApplicable, ListVariantsSpecifications, SampleSubject } from "./list-variants-types.js";
|
|
11
|
+
import type { VariantColorPalette } from "./material-block-types.js";
|
|
11
12
|
/** The detail to add under `specifications`; absent, the answer is the compact item alone. */
|
|
12
13
|
export type GetVariantOptions = {
|
|
13
14
|
/** Canonical attribute ids, e.g. `["nrc_rating"]`. */
|
|
@@ -21,6 +22,20 @@ export type GetVariantOptions = {
|
|
|
21
22
|
* false or zero.
|
|
22
23
|
*/
|
|
23
24
|
export type GetVariantOutput = {
|
|
25
|
+
eligible: boolean;
|
|
26
|
+
channels: string[];
|
|
27
|
+
palette: {
|
|
28
|
+
hex: string;
|
|
29
|
+
share: number;
|
|
30
|
+
dominant: boolean;
|
|
31
|
+
method: "stated" | "isolated" | "crop";
|
|
32
|
+
}[];
|
|
33
|
+
attributes: Record<string, {
|
|
34
|
+
value: unknown;
|
|
35
|
+
valueSource: "brand" | "material_bank" | "samplize" | "measured" | null;
|
|
36
|
+
wording: string | null;
|
|
37
|
+
level: "variant" | "product" | "brand";
|
|
38
|
+
}>;
|
|
24
39
|
category: {
|
|
25
40
|
id: string;
|
|
26
41
|
name: string;
|
|
@@ -56,7 +71,13 @@ export type GetVariantOutput = {
|
|
|
56
71
|
id: string;
|
|
57
72
|
name: string;
|
|
58
73
|
};
|
|
59
|
-
specifications?: ListVariantsSpecifications
|
|
74
|
+
specifications?: ListVariantsSpecifications & {
|
|
75
|
+
color?: Record<string, unknown> & {
|
|
76
|
+
/** Measured bands, largest share first; paints use one declared color band. Absent means unknown. */
|
|
77
|
+
color_palette?: VariantColorPalette;
|
|
78
|
+
light_reflectance_value?: unknown;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
60
81
|
url: string | null;
|
|
61
82
|
variantId: string;
|
|
62
83
|
};
|
package/http-transport.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { RateLimit } from "./errors.js";
|
|
2
|
+
import type { JsonOperationId, OperationResponses } from "./operation-responses.js";
|
|
2
3
|
import type { SdkOperation } from "./operations.js";
|
|
3
4
|
type QueryValue = string | number | boolean | undefined | null | (string | number | boolean)[];
|
|
4
5
|
export type QueryParams = Record<string, QueryValue>;
|
|
@@ -63,6 +64,6 @@ export declare class HttpTransport {
|
|
|
63
64
|
*/
|
|
64
65
|
openStream(sdkOperation: SdkOperation, options: StreamRequestOptions): Promise<ReadableStream<Uint8Array>>;
|
|
65
66
|
/** Execute a registered JSON operation and return its typed body. */
|
|
66
|
-
requestJson<
|
|
67
|
+
requestJson<K extends JsonOperationId>(sdkOperation: SdkOperation<K>, options?: RequestOptions): Promise<OperationResponses[K]>;
|
|
67
68
|
}
|
|
68
69
|
export {};
|
package/http-transport.js
CHANGED
|
@@ -7,18 +7,19 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { MaterialGraphError } from "./errors.js";
|
|
9
9
|
import { operationPath } from "./operations.js";
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
import { parseOperationResponse } from "./parse-operation-response.js";
|
|
11
|
+
const parseNumberOrNull = (value) => {
|
|
12
|
+
if (value === null || value.trim() === "") {
|
|
12
13
|
return null;
|
|
13
14
|
}
|
|
14
|
-
const parsed = Number
|
|
15
|
-
return Number.
|
|
15
|
+
const parsed = Number(value);
|
|
16
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
16
17
|
};
|
|
17
18
|
const parseRateLimit = (headers) => {
|
|
18
|
-
const limit =
|
|
19
|
-
const remaining =
|
|
20
|
-
const reset =
|
|
21
|
-
const retryAfter =
|
|
19
|
+
const limit = parseNumberOrNull(headers.get("x-ratelimit-limit"));
|
|
20
|
+
const remaining = parseNumberOrNull(headers.get("x-ratelimit-remaining"));
|
|
21
|
+
const reset = parseNumberOrNull(headers.get("x-ratelimit-reset"));
|
|
22
|
+
const retryAfter = parseNumberOrNull(headers.get("retry-after"));
|
|
22
23
|
if (limit === null &&
|
|
23
24
|
remaining === null &&
|
|
24
25
|
reset === null &&
|
|
@@ -214,7 +215,8 @@ export class HttpTransport {
|
|
|
214
215
|
body: hasBody ? JSON.stringify(options.body) : undefined,
|
|
215
216
|
headers: this.authHeaders({
|
|
216
217
|
...(hasBody ? { "Content-Type": "application/json" } : {}),
|
|
217
|
-
...(options.idempotencyKey
|
|
218
|
+
...(options.idempotencyKey !== undefined &&
|
|
219
|
+
options.idempotencyKey !== ""
|
|
218
220
|
? { "Idempotency-Key": options.idempotencyKey }
|
|
219
221
|
: {}),
|
|
220
222
|
}),
|
|
@@ -222,6 +224,6 @@ export class HttpTransport {
|
|
|
222
224
|
signal: options.signal,
|
|
223
225
|
url,
|
|
224
226
|
});
|
|
225
|
-
return parsed;
|
|
227
|
+
return await parseOperationResponse(sdkOperation.operationId, parsed);
|
|
226
228
|
}
|
|
227
229
|
}
|
package/index.d.ts
CHANGED
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
export { MaterialGraphClient, DEFAULT_BASE_URL } from "./client.js";
|
|
2
2
|
export type { MaterialGraphClientOptions } from "./client.js";
|
|
3
|
-
export type
|
|
4
|
-
export type
|
|
5
|
-
export type
|
|
6
|
-
export type
|
|
7
|
-
export type
|
|
8
|
-
export type
|
|
9
|
-
export type
|
|
10
|
-
export type
|
|
3
|
+
export type { FilterOp, FilterTermCondition, FilterNumericCondition, FilterPresenceCondition, FilterAnyFieldCondition, FilterCondition, FilterGroups, OptionalFilterGroups, OrderByEntry, ListVariantsInclude, ListVariantsCollapse, ColorRegion, ColorRangeCondition, ListVariantsInput, ListVariantsPreference, ListVariantsSpecifications, ListVariantsNotApplicable, SampleSubject, ListVariantsItem, ListVariantsOutput, } from "./list-variants-types.js";
|
|
4
|
+
export type { ListVariantFacetsInput, VariantFacetValue, CategoricalVariantFacet, BooleanVariantFacet, NumericVariantFacet, VariantFacet, ListVariantFacetsOutput, } from "./list-variant-facets-types.js";
|
|
5
|
+
export type { SearchVariantsSelection, SearchVariantsInput, SearchVariantsUnderstood, SearchVariantsReading, SearchVariantsChoice, SearchVariantsOutput, } from "./search-variants-types.js";
|
|
6
|
+
export type { ListEnumValuesOptions, EnumValueMatch, EnumValueItem, ListEnumValuesResult, } from "./list-enum-values-types.js";
|
|
7
|
+
export type { GetVariantOptions, GetVariantOutput, } from "./get-variant-types.js";
|
|
8
|
+
export type { ImageReferenceInput } from "./image-reference-types.js";
|
|
9
|
+
export type { SampledTogetherProjectType, FindSampledTogetherInput, FindSampledTogetherRow, FindSampledTogetherOutput, } from "./find-sampled-together-types.js";
|
|
10
|
+
export type { FindVariantsByColorMode, ColorConditionInput, FindVariantsByColorInput, ColorConditionReceipt, PaintCatalogVariant, ResolvedColor, ColorAlternative, UnresolvedColor, ColorVariantMatch, ColorPageInfo, FindVariantsByColorContainsResult, FindVariantsByColorPaletteResult, ColorRankedSeed, ColorRankMatch, ResolvedColorReference, CompareColorSimilarityReference, FindVariantsByColorRerankResult, FindVariantsByColorOutput, } from "./find-variants-by-color-types.js";
|
|
11
11
|
export { FIND_VARIANTS_BY_VECTOR_MODES } from "./find-variants-by-vector-types.js";
|
|
12
|
-
export type
|
|
12
|
+
export type { FindVariantsByVectorMode, FindVariantsByVectorQuery, FindVariantsByVectorInput, FindVariantsByVectorItem, FindVariantsByVectorReference, FindVariantsByVectorScan, FindVariantsByVectorTimings, FindVariantsByVectorOutput, } from "./find-variants-by-vector-types.js";
|
|
13
13
|
export { MATERIALGRAPH_API_VERSION, SDK_OPERATIONS } from "./operations.js";
|
|
14
14
|
export type { SdkOperation, SdkOperationId } from "./operations.js";
|
|
15
|
-
export type
|
|
15
|
+
export type { OpaqueId, VariantId, ProductId, RunId, BatchId, SourceFileId, ProjectId, SchemeId, SlotId, Cursor, } from "./identifiers.js";
|
|
16
16
|
export { TERMINAL_RUN_EVENT_TYPES } from "./run-types.js";
|
|
17
|
-
export type
|
|
17
|
+
export type { FileInput, UploadSourceMaterialInput, SourceMaterialReceiptFile, SourceMaterialBatchReceipt, PublicRunStatus, PublicRunFailure, PublicRunArtifactRef, PublicRun, CreatePublicRunRequest, CreatePublicRunResponse, PublicRunResponse, RunEvent, StreamRunEventsOptions, DrainRunEventsOptions, } from "./run-types.js";
|
|
18
18
|
export { MATERIALGRAPH_PROBLEM_EXTENSIONS, MaterialGraphError, } from "./errors.js";
|
|
19
19
|
export type { MaterialGraphErrorInit, MaterialGraphErrorKind, MaterialGraphRequestMetadata, ProblemDetail, RateLimit, SanitizedErrorValue, SanitizedIssue, SimpleErrorBody, } from "./errors.js";
|
|
20
|
-
export type
|
|
21
|
-
export type
|
|
22
|
-
export type
|
|
20
|
+
export type { OpenEnum, JsonValue, OklabTriple, MaterialColor, ImageSource, MaterialAvailability, MaterialTile, DemandMomentum, CompanionDemand, ProjectTypeShare, CospecPairing, ColorPairing, PairingOrderMode, PairingRanking, PairingOrdering, PairingItem, PairingsResponse, AttributeMatch, AttributeListItem, OutsideScopeAttribute, ListAttributesResult, WhoamiResponse, PairingsOptions, ListAttributesOptions, ExtractedPalette, ExtractPaletteResponse, ExtractPaletteInput, ResolveValueCandidate, ValueResolution, ResolveColorOptions, ResolveColorCatalogueVariant, ResolveColorVariant, ResolveColorResponse, BySpecVerdictState, BySpecVerdictCell, BySpecVerdict, MaterialVerdict, BySpecUnresolvedCriterion, } from "./types.js";
|
|
21
|
+
export type { ResolveVariantInput, ResolveVariantSubject, ResolveVariantEvidence, ResolveVariantReceipt, ResolveVariantUnresolvedReason, ResolveVariantOutput, } from "./resolve-variant-types.js";
|
|
22
|
+
export type { CatalogueReference, CatalogueReferenceAbsenceReason, CatalogueReferencePublication, CatalogueReferenceResult, CatalogueReferenceBatchResponse, CatalogueCollectionsOptions, CatalogueCollectionSampleProduct, CatalogueChannelCollection, CatalogueChannelCollectionsResponse, CatalogueDocumentAccess, CatalogueDocumentAccessResult, CatalogDocument, CatalogEdition, CatalogAvailableReceipt, CatalogFailureReceipt, UnavailableCatalogDocument, CatalogPublication, CatalogDocumentList, CatalogProductReferenceList, CatalogProductReferenceUnavailable, CatalogProductReferenceReadResult, CataloguePageRequiredArtifact, CataloguePageAvailableArtifact, CataloguePage, CatalogPageListResult, CataloguePageRepresentationReadResult, } from "./catalogue-types.js";
|
|
23
23
|
export { CategoriesClient } from "./categories-client.js";
|
|
24
|
-
export type
|
|
24
|
+
export type { CategoryRef, CategoryKind, CategoryMatch, CategoryItem, CategoriesPageInfo, CategoriesListInput, CategoriesListResult, CategoryConcept, CategoryProductCategory, CategoriesGetResult, } from "./category-types.js";
|
|
25
25
|
export { ColorsClient } from "./colors-client.js";
|
|
26
26
|
export type { ColorsTransport } from "./colors-client.js";
|
|
27
|
-
export type
|
|
28
|
-
export type
|
|
29
|
-
export type
|
|
30
|
-
export type
|
|
31
|
-
export type
|
|
32
|
-
export type
|
|
27
|
+
export type { CategoryTier, CategoryColor, CategoryColorProfile, CategoryColorProfilesResponse, ColorProfilesParams, } from "./color-profiles-types.js";
|
|
28
|
+
export type { DeclaredProvenance, DeclaredAssociationSubject, DeclaredAssociation, DeclaredAssociationsResponse, AssociatedOptions, ApplicabilitySubject, ApplicabilityCoverageState, ApplicabilityCoverage, ApplicabilityFact, ApplicabilitySourceEntry, UnresolvedApplicabilityEndpoint, ApplicabilityResponse, ApplicabilityOptions, } from "./association-types.js";
|
|
29
|
+
export type { BrandsOptions, BrandItem, ListBrandsPage, } from "./brand-types.js";
|
|
30
|
+
export type { VariantAssetAvailability, VariantImageRole, VariantImagePresentation, VariantDocumentType, VariantAssetKind, VariantAssetItem, VariantDocumentCoverageState, VariantAssetPageInfo, ListVariantAssetsOptions, VariantAssetPage, MaterialDocumentStatus, MaterialDocumentCoverageState, MaterialDocumentScope, MaterialDocumentSource, MaterialDocumentProjectionItem, MaterialDocumentCoverageSource, MaterialDocumentCoverage, MaterialDocumentCoverageSummary, MaterialDocumentPageOptions, MaterialDocumentPage, } from "./material-asset-types.js";
|
|
31
|
+
export type { MaterialCoverageStatus, MaterialBlockStatus, MaterialBlockFieldStatus, MaterialBlockFieldValue, MaterialBlockProjectionField, MaterialBlockProjectionItem, MaterialBlockProjection, VariantColorPalette, } from "./material-block-types.js";
|
|
32
|
+
export type { SchemaResource, SCHEMA_RESOURCE_OPERATION_IDS, SchemaResourceRequest, SchemaLifecycle, SchemaExternalMapping, SchemaMatchStrength, SchemaValueDictionaryTerm, SchemaValueDictionaryItem, SchemaResourceItemMap, SchemaResourceResponse, } from "./schema-resource-types.js";
|
|
33
33
|
export type { SamplizePublicationSource, SamplizeLrvObservation, SamplizeDemand, SamplizeCollectionMembership, SamplizeCatalogueOptions, SamplizeCataloguePage, SamplizeCatalogueProduct, SamplizeHexObservation, } from "./samplize-catalogue-types.js";
|
|
34
|
+
export type { NearestPaintsParams, NearestPaintCard, NearestPaintsHexResult, NearestPaintsOutput, } from "./nearest-paints-types.js";
|
|
@@ -35,6 +35,12 @@ import type { OpenEnum } from "./types.js";
|
|
|
35
35
|
export type MaterialCoverageStatus = OpenEnum<"complete" | "partial" | "missing" | "not_applicable">;
|
|
36
36
|
export type MaterialBlockStatus = MaterialCoverageStatus;
|
|
37
37
|
export type MaterialBlockFieldStatus = MaterialCoverageStatus;
|
|
38
|
+
/** Stored image bands, or one declared paint color regardless of image bands. Hexes use uppercase #RRGGBB. */
|
|
39
|
+
export type VariantColorPalette = {
|
|
40
|
+
hex: string;
|
|
41
|
+
share: number;
|
|
42
|
+
dominant: boolean;
|
|
43
|
+
}[];
|
|
38
44
|
/**
|
|
39
45
|
* A field's value. `null` is AMBIGUOUS on its own — pair it with `status`:
|
|
40
46
|
* `complete` + `null` is a determined absence, `missing` + `null` is unread.
|
|
@@ -55,7 +61,7 @@ export type MaterialBlockProjectionField = {
|
|
|
55
61
|
unit?: string;
|
|
56
62
|
status: MaterialBlockFieldStatus;
|
|
57
63
|
/** Provenance supplied by the graph when a source-backed claim supports this field. */
|
|
58
|
-
|
|
64
|
+
valueSource?: string;
|
|
59
65
|
/** Claim confidence supplied by the graph; absence means no confidence was emitted. */
|
|
60
66
|
confidence?: number;
|
|
61
67
|
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { resolveOperation } from "./operations.js";
|
|
2
2
|
/** Read known and explicitly unobserved canonical material fields. */
|
|
3
|
-
export const materialBlocks = async (transport, variantId, signal) => await transport.requestJson(resolveOperation("list_material_blocks"), {
|
|
3
|
+
export const materialBlocks = async (transport, variantId, signal) => await transport.requestJson(resolveOperation("list_material_blocks"), {
|
|
4
|
+
pathParams: { variantId },
|
|
5
|
+
signal,
|
|
6
|
+
});
|
|
4
7
|
/**
|
|
5
8
|
* Read one bounded, filtered, cursor-paged page of a variant's images and
|
|
6
9
|
* files. `imageRoles` narrows only images and `documentTypes` narrows only
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export type NearestPaintsParams = {
|
|
2
|
+
hexes: string[];
|
|
3
|
+
limit?: number;
|
|
4
|
+
};
|
|
5
|
+
export type NearestPaintCard = {
|
|
6
|
+
variantId: string;
|
|
7
|
+
name: string;
|
|
8
|
+
brand: {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
};
|
|
12
|
+
code: string | null;
|
|
13
|
+
hex: string;
|
|
14
|
+
sampleSubject: "material" | "paint_color_sample" | "unknown" | "conflict";
|
|
15
|
+
productType: {
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
} | null;
|
|
19
|
+
image: {
|
|
20
|
+
url: string;
|
|
21
|
+
alt: string;
|
|
22
|
+
} | null;
|
|
23
|
+
lrv: number | null;
|
|
24
|
+
deltaE: number;
|
|
25
|
+
closeness: "very-near" | "very-close" | "close" | "related" | "unrelated";
|
|
26
|
+
};
|
|
27
|
+
export type NearestPaintsHexResult = {
|
|
28
|
+
hex: string;
|
|
29
|
+
paints: NearestPaintCard[];
|
|
30
|
+
};
|
|
31
|
+
export type NearestPaintsOutput = {
|
|
32
|
+
results: NearestPaintsHexResult[];
|
|
33
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/** Response types belong to operation ids, never a caller-selected generic. */
|
|
2
|
+
import type { ApplicabilityResponse, DeclaredAssociationsResponse } from "./association-types.js";
|
|
3
|
+
import type { ListBrandsPage } from "./brand-types.js";
|
|
4
|
+
import type { CatalogDocumentList, CatalogPageListResult, CatalogProductReferenceReadResult, CatalogueChannelCollectionsResponse, CatalogueDocumentAccessResult, CataloguePageRepresentationReadResult, CatalogueReferenceBatchResponse } from "./catalogue-types.js";
|
|
5
|
+
import type { CategoriesGetResult, CategoriesListResult } from "./category-types.js";
|
|
6
|
+
import type { CategoryColorProfilesResponse } from "./color-profiles-types.js";
|
|
7
|
+
import type { FindSampledTogetherOutput } from "./find-sampled-together-types.js";
|
|
8
|
+
import type { FindVariantsByColorOutput } from "./find-variants-by-color-types.js";
|
|
9
|
+
import type { FindVariantsByVectorOutput } from "./find-variants-by-vector-types.js";
|
|
10
|
+
import type { GetVariantOutput } from "./get-variant-types.js";
|
|
11
|
+
import type { ListEnumValuesResult } from "./list-enum-values-types.js";
|
|
12
|
+
import type { ListVariantFacetsOutput } from "./list-variant-facets-types.js";
|
|
13
|
+
import type { ListVariantsOutput } from "./list-variants-types.js";
|
|
14
|
+
import type { MaterialDocumentPage, VariantAssetPage } from "./material-asset-types.js";
|
|
15
|
+
import type { MaterialBlockProjection } from "./material-block-types.js";
|
|
16
|
+
import type { NearestPaintsOutput } from "./nearest-paints-types.js";
|
|
17
|
+
import type { ResolveVariantOutput } from "./resolve-variant-types.js";
|
|
18
|
+
import type { CreatePublicRunResponse, PublicRunResponse, SourceMaterialBatchReceipt } from "./run-types.js";
|
|
19
|
+
import type { SamplizeCataloguePage } from "./samplize-catalogue-types.js";
|
|
20
|
+
import type { SchemaResourceResponse } from "./schema-resource-types.js";
|
|
21
|
+
import type { SearchVariantsOutput } from "./search-variants-types.js";
|
|
22
|
+
import type { ExtractPaletteResponse, ListAttributesResult, PairingsResponse, ResolveColorResponse, WhoamiResponse } from "./types.js";
|
|
23
|
+
export type OperationResponses = {
|
|
24
|
+
find_nearest_paints: NearestPaintsOutput;
|
|
25
|
+
get_catalogue_generation: {
|
|
26
|
+
generation: number;
|
|
27
|
+
};
|
|
28
|
+
catalog_list_attributes: ListAttributesResult;
|
|
29
|
+
catalog_list_enum_values: ListEnumValuesResult;
|
|
30
|
+
create_public_run: CreatePublicRunResponse;
|
|
31
|
+
extract_image_palette: ExtractPaletteResponse;
|
|
32
|
+
find_sampled_together: FindSampledTogetherOutput;
|
|
33
|
+
find_variants_by_color: FindVariantsByColorOutput;
|
|
34
|
+
find_variants_by_vector: FindVariantsByVectorOutput;
|
|
35
|
+
get_applicability: ApplicabilityResponse;
|
|
36
|
+
get_catalog_page_representation: CataloguePageRepresentationReadResult;
|
|
37
|
+
get_catalogue_document_access: CatalogueDocumentAccessResult;
|
|
38
|
+
get_catalogue_references_batch: CatalogueReferenceBatchResponse;
|
|
39
|
+
get_category: CategoriesGetResult;
|
|
40
|
+
get_category_color_profiles: CategoryColorProfilesResponse;
|
|
41
|
+
get_material_pairings: PairingsResponse;
|
|
42
|
+
get_public_run: PublicRunResponse;
|
|
43
|
+
get_variant: GetVariantOutput;
|
|
44
|
+
list_associated_finishes: DeclaredAssociationsResponse;
|
|
45
|
+
list_associated_products: DeclaredAssociationsResponse;
|
|
46
|
+
list_brands: ListBrandsPage;
|
|
47
|
+
list_catalog_documents: CatalogDocumentList;
|
|
48
|
+
list_catalog_pages: CatalogPageListResult;
|
|
49
|
+
list_catalog_product_references: CatalogProductReferenceReadResult;
|
|
50
|
+
list_catalogue_channel_collections: CatalogueChannelCollectionsResponse;
|
|
51
|
+
list_categories: CategoriesListResult;
|
|
52
|
+
list_material_blocks: MaterialBlockProjection;
|
|
53
|
+
list_material_documents: MaterialDocumentPage;
|
|
54
|
+
list_schema_value_dictionaries: SchemaResourceResponse;
|
|
55
|
+
list_variant_assets: VariantAssetPage;
|
|
56
|
+
list_variant_facets: ListVariantFacetsOutput;
|
|
57
|
+
list_variants: ListVariantsOutput;
|
|
58
|
+
resolve_color_name: ResolveColorResponse;
|
|
59
|
+
resolve_variant: ResolveVariantOutput;
|
|
60
|
+
samplize_catalogue_products: SamplizeCataloguePage;
|
|
61
|
+
search_variants: SearchVariantsOutput;
|
|
62
|
+
upload_source_material: SourceMaterialBatchReceipt;
|
|
63
|
+
whoami: WhoamiResponse;
|
|
64
|
+
};
|
|
65
|
+
export type JsonOperationId = keyof OperationResponses;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/operations.d.ts
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export type SdkOperationId
|
|
4
|
-
export type SdkOperation = Readonly<{
|
|
5
|
-
clientMethod: (typeof OPERATION_DEFINITIONS)[number][0];
|
|
6
|
-
method: (typeof OPERATION_DEFINITIONS)[number][1];
|
|
7
|
-
path: (typeof OPERATION_DEFINITIONS)[number][2];
|
|
8
|
-
operationId: SdkOperationId;
|
|
9
|
-
}>;
|
|
10
|
-
export declare const SDK_OPERATIONS: readonly SdkOperation[];
|
|
1
|
+
import { type SdkOperation, type SdkOperationId } from "./operations.generated.js";
|
|
2
|
+
export { MATERIALGRAPH_API_VERSION, SDK_OPERATIONS, } from "./operations.generated.js";
|
|
3
|
+
export type { SdkOperation, SdkOperationId } from "./operations.generated.js";
|
|
11
4
|
/** Look up a registered operation by its OpenAPI `operationId`. */
|
|
12
5
|
export declare const findSdkOperation: (operationId: SdkOperationId) => SdkOperation | undefined;
|
|
13
6
|
/**
|
|
@@ -15,7 +8,6 @@ export declare const findSdkOperation: (operationId: SdkOperationId) => SdkOpera
|
|
|
15
8
|
* a literal `operationId` wants — lived as a private copy in `client.ts`
|
|
16
9
|
* before the association lens would have made it a second.
|
|
17
10
|
*/
|
|
18
|
-
export declare const resolveOperation: (operationId:
|
|
11
|
+
export declare const resolveOperation: <K extends SdkOperationId>(operationId: K) => SdkOperation<K>;
|
|
19
12
|
/** Substitute `{param}` path placeholders with percent-encoded values. */
|
|
20
13
|
export declare const operationPath: (sdkOperation: SdkOperation, pathParams?: Readonly<Record<string, string>>) => string;
|
|
21
|
-
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const MATERIALGRAPH_API_VERSION = "0.8.0";
|
|
2
|
+
declare const OPERATION_DEFINITIONS: readonly [readonly ["colors.nearestPaints", "GET", "/api/v1/colors/nearest-paints", "find_nearest_paints"], readonly ["getCatalogueGeneration", "GET", "/api/v1/catalog/generation", "get_catalogue_generation"], 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", "GET", "/api/v1/variants/by-color", "find_variants_by_color"], readonly ["findVariantsByVector", "POST", "/api/v1/variants/by-vector", "find_variants_by_vector"], readonly ["findSampledTogether", "GET", "/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 ["workflows.streamRunEvents", "GET", "/api/v1/workflows/{workflowId}/runs/{runId}/events", "list_public_run_events"]];
|
|
3
|
+
export type SdkOperationId = (typeof OPERATION_DEFINITIONS)[number][3];
|
|
4
|
+
export type SdkOperation<K extends SdkOperationId = SdkOperationId> = Readonly<{
|
|
5
|
+
clientMethod: (typeof OPERATION_DEFINITIONS)[number][0];
|
|
6
|
+
method: (typeof OPERATION_DEFINITIONS)[number][1];
|
|
7
|
+
path: (typeof OPERATION_DEFINITIONS)[number][2];
|
|
8
|
+
operationId: K;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const SDK_OPERATIONS: readonly SdkOperation[];
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
// GENERATED by apps/web/scripts/generate-openapi-v1.ts. Do not edit.
|
|
2
|
+
export const MATERIALGRAPH_API_VERSION = "0.8.0";
|
|
3
|
+
const OPERATION_DEFINITIONS = [
|
|
4
|
+
[
|
|
5
|
+
"colors.nearestPaints",
|
|
6
|
+
"GET",
|
|
7
|
+
"/api/v1/colors/nearest-paints",
|
|
8
|
+
"find_nearest_paints",
|
|
9
|
+
],
|
|
10
|
+
[
|
|
11
|
+
"getCatalogueGeneration",
|
|
12
|
+
"GET",
|
|
13
|
+
"/api/v1/catalog/generation",
|
|
14
|
+
"get_catalogue_generation",
|
|
15
|
+
],
|
|
16
|
+
["catalogs", "GET", "/api/v1/catalogs", "list_catalog_documents"],
|
|
17
|
+
[
|
|
18
|
+
"catalogPages",
|
|
19
|
+
"GET",
|
|
20
|
+
"/api/v1/catalogs/{catalogId}/pages",
|
|
21
|
+
"list_catalog_pages",
|
|
22
|
+
],
|
|
23
|
+
[
|
|
24
|
+
"catalogPageRepresentation",
|
|
25
|
+
"GET",
|
|
26
|
+
"/api/v1/catalog-pages/{pageId}/representation",
|
|
27
|
+
"get_catalog_page_representation",
|
|
28
|
+
],
|
|
29
|
+
[
|
|
30
|
+
"catalogReferences",
|
|
31
|
+
"GET",
|
|
32
|
+
"/api/v1/catalogs/{catalogId}/references",
|
|
33
|
+
"list_catalog_product_references",
|
|
34
|
+
],
|
|
35
|
+
[
|
|
36
|
+
"samplizeCatalogue",
|
|
37
|
+
"GET",
|
|
38
|
+
"/api/v1/catalogues/samplize/products",
|
|
39
|
+
"samplize_catalogue_products",
|
|
40
|
+
],
|
|
41
|
+
[
|
|
42
|
+
"catalogueReferences",
|
|
43
|
+
"POST",
|
|
44
|
+
"/api/v1/catalogues/references",
|
|
45
|
+
"get_catalogue_references_batch",
|
|
46
|
+
],
|
|
47
|
+
[
|
|
48
|
+
"catalogueCollections",
|
|
49
|
+
"GET",
|
|
50
|
+
"/api/v1/catalogues/collections",
|
|
51
|
+
"list_catalogue_channel_collections",
|
|
52
|
+
],
|
|
53
|
+
[
|
|
54
|
+
"catalogueDocumentAccess",
|
|
55
|
+
"GET",
|
|
56
|
+
"/api/v1/catalogues/documents/{documentId}",
|
|
57
|
+
"get_catalogue_document_access",
|
|
58
|
+
],
|
|
59
|
+
[
|
|
60
|
+
"materialBlocks",
|
|
61
|
+
"GET",
|
|
62
|
+
"/api/v1/materials/{variantId}/blocks",
|
|
63
|
+
"list_material_blocks",
|
|
64
|
+
],
|
|
65
|
+
[
|
|
66
|
+
"listVariantAssets",
|
|
67
|
+
"GET",
|
|
68
|
+
"/api/v1/variants/{variantId}/assets",
|
|
69
|
+
"list_variant_assets",
|
|
70
|
+
],
|
|
71
|
+
[
|
|
72
|
+
"materialDocuments",
|
|
73
|
+
"GET",
|
|
74
|
+
"/api/v1/materials/{variantId}/documents",
|
|
75
|
+
"list_material_documents",
|
|
76
|
+
],
|
|
77
|
+
[
|
|
78
|
+
"schema",
|
|
79
|
+
"GET",
|
|
80
|
+
"/api/v1/schema/value-dictionaries",
|
|
81
|
+
"list_schema_value_dictionaries",
|
|
82
|
+
],
|
|
83
|
+
[
|
|
84
|
+
"pairings",
|
|
85
|
+
"GET",
|
|
86
|
+
"/api/v1/materials/{variantId}/pairings",
|
|
87
|
+
"get_material_pairings",
|
|
88
|
+
],
|
|
89
|
+
[
|
|
90
|
+
"associatedFinishes",
|
|
91
|
+
"GET",
|
|
92
|
+
"/api/v1/associated/finishes",
|
|
93
|
+
"list_associated_finishes",
|
|
94
|
+
],
|
|
95
|
+
[
|
|
96
|
+
"associatedProducts",
|
|
97
|
+
"GET",
|
|
98
|
+
"/api/v1/associated/products",
|
|
99
|
+
"list_associated_products",
|
|
100
|
+
],
|
|
101
|
+
["applicability", "GET", "/api/v1/applicability", "get_applicability"],
|
|
102
|
+
["listVariants", "GET", "/api/v1/variants", "list_variants"],
|
|
103
|
+
[
|
|
104
|
+
"listVariantFacets",
|
|
105
|
+
"POST",
|
|
106
|
+
"/api/v1/variants/facets",
|
|
107
|
+
"list_variant_facets",
|
|
108
|
+
],
|
|
109
|
+
["searchVariants", "POST", "/api/v1/variants/search", "search_variants"],
|
|
110
|
+
[
|
|
111
|
+
"findVariantsByColor",
|
|
112
|
+
"GET",
|
|
113
|
+
"/api/v1/variants/by-color",
|
|
114
|
+
"find_variants_by_color",
|
|
115
|
+
],
|
|
116
|
+
[
|
|
117
|
+
"findVariantsByVector",
|
|
118
|
+
"POST",
|
|
119
|
+
"/api/v1/variants/by-vector",
|
|
120
|
+
"find_variants_by_vector",
|
|
121
|
+
],
|
|
122
|
+
[
|
|
123
|
+
"findSampledTogether",
|
|
124
|
+
"GET",
|
|
125
|
+
"/api/v1/variants/sampled-together",
|
|
126
|
+
"find_sampled_together",
|
|
127
|
+
],
|
|
128
|
+
["resolveVariant", "POST", "/api/v1/variants/resolve", "resolve_variant"],
|
|
129
|
+
["getVariant", "GET", "/api/v1/variants/{variantId}", "get_variant"],
|
|
130
|
+
[
|
|
131
|
+
"resolveColor",
|
|
132
|
+
"GET",
|
|
133
|
+
"/api/v1/search/colors/resolve",
|
|
134
|
+
"resolve_color_name",
|
|
135
|
+
],
|
|
136
|
+
[
|
|
137
|
+
"listAttributes",
|
|
138
|
+
"GET",
|
|
139
|
+
"/api/v1/catalog/attributes",
|
|
140
|
+
"catalog_list_attributes",
|
|
141
|
+
],
|
|
142
|
+
[
|
|
143
|
+
"listEnumValues",
|
|
144
|
+
"GET",
|
|
145
|
+
"/api/v1/catalog/enum-values",
|
|
146
|
+
"catalog_list_enum_values",
|
|
147
|
+
],
|
|
148
|
+
["categories.list", "GET", "/api/v1/categories", "list_categories"],
|
|
149
|
+
["categories.get", "GET", "/api/v1/categories/{id}", "get_category"],
|
|
150
|
+
["whoami", "GET", "/api/v1/whoami", "whoami"],
|
|
151
|
+
[
|
|
152
|
+
"colors.profiles",
|
|
153
|
+
"GET",
|
|
154
|
+
"/api/v1/colors/profiles",
|
|
155
|
+
"get_category_color_profiles",
|
|
156
|
+
],
|
|
157
|
+
[
|
|
158
|
+
"extractPalette",
|
|
159
|
+
"POST",
|
|
160
|
+
"/api/v1/search/palettes/extract",
|
|
161
|
+
"extract_image_palette",
|
|
162
|
+
],
|
|
163
|
+
["brands", "GET", "/api/v1/brands", "list_brands"],
|
|
164
|
+
[
|
|
165
|
+
"uploadSourceMaterial",
|
|
166
|
+
"POST",
|
|
167
|
+
"/api/v1/source-material",
|
|
168
|
+
"upload_source_material",
|
|
169
|
+
],
|
|
170
|
+
[
|
|
171
|
+
"workflows.start",
|
|
172
|
+
"POST",
|
|
173
|
+
"/api/v1/workflows/{workflowId}/runs",
|
|
174
|
+
"create_public_run",
|
|
175
|
+
],
|
|
176
|
+
[
|
|
177
|
+
"workflows.run",
|
|
178
|
+
"GET",
|
|
179
|
+
"/api/v1/workflows/{workflowId}/runs/{runId}",
|
|
180
|
+
"get_public_run",
|
|
181
|
+
],
|
|
182
|
+
[
|
|
183
|
+
"workflows.streamRunEvents",
|
|
184
|
+
"GET",
|
|
185
|
+
"/api/v1/workflows/{workflowId}/runs/{runId}/events",
|
|
186
|
+
"list_public_run_events",
|
|
187
|
+
],
|
|
188
|
+
];
|
|
189
|
+
export const SDK_OPERATIONS = Object.freeze(OPERATION_DEFINITIONS.map(([clientMethod, method, path, operationId]) => Object.freeze({ clientMethod, method, operationId, path })));
|