@instruments/materialgraph 0.24.0 → 0.26.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/association-types.d.ts +20 -20
- package/associations-client.d.ts +4 -4
- package/associations-client.js +3 -10
- package/attribution-types.d.ts +3 -3
- package/brand-most-sampled-types.d.ts +4 -4
- package/brand-types.d.ts +6 -6
- package/brands-client.d.ts +4 -4
- package/brands-client.js +9 -13
- package/browse-types.d.ts +8 -8
- package/by-colour-types.d.ts +18 -18
- package/by-spec-types.d.ts +14 -14
- package/catalog-discovery-types.d.ts +14 -14
- package/catalogue-client.d.ts +4 -4
- package/catalogue-client.js +38 -37
- package/catalogue-types.d.ts +4 -4
- package/citation-types.d.ts +4 -4
- package/client-browse.d.ts +4 -4
- package/client-browse.js +24 -25
- package/client-config.d.ts +2 -2
- package/client-exploration.d.ts +3 -3
- package/client-exploration.js +4 -6
- package/client-source-material-comments.d.ts +4 -4
- package/client-source-material-comments.js +4 -38
- package/client-vocabulary.d.ts +8 -8
- package/client-vocabulary.js +20 -30
- package/client.d.ts +11 -45
- package/client.js +143 -188
- package/codes-client.d.ts +2 -2
- package/codes-client.js +8 -8
- package/codes-types.d.ts +34 -34
- package/colour-aggregate-types.d.ts +24 -24
- package/colours-client.d.ts +2 -2
- package/colours-client.js +15 -15
- package/compare-types.d.ts +10 -10
- package/composition-client.d.ts +3 -3
- package/composition-client.js +8 -7
- package/composition-types.d.ts +12 -12
- package/coordinate-client.d.ts +2 -2
- package/coordinate-client.js +1 -13
- package/corpus-scope-types.d.ts +3 -3
- package/corpus-scope-types.js +1 -25
- package/correction-types.d.ts +10 -10
- package/demand-batch-types.d.ts +18 -18
- package/demand-types.d.ts +24 -24
- package/errors.d.ts +12 -12
- package/errors.js +53 -52
- package/exploration-types.d.ts +29 -22
- package/fan-deck-types.d.ts +6 -6
- package/http-transport.d.ts +13 -21
- package/http-transport.js +31 -28
- package/identify-types.d.ts +10 -10
- package/index.d.ts +0 -6
- package/index.js +0 -2
- package/match-rejection-types.d.ts +6 -6
- package/match-stream-types.d.ts +32 -32
- package/match-stream.d.ts +2 -2
- package/match-stream.js +55 -41
- package/match-types.d.ts +8 -8
- package/material-asset-types.d.ts +26 -26
- package/material-block-types.d.ts +6 -6
- package/material-query-plan-types.d.ts +26 -26
- package/material-resources-client.d.ts +5 -5
- package/material-resources-client.js +10 -20
- package/material-types.d.ts +12 -12
- package/ndjson.js +16 -8
- package/operations.d.ts +6 -6
- package/operations.js +9 -39
- package/package.json +2 -2
- package/palette-completion-types.d.ts +22 -22
- package/palette-search-types.d.ts +28 -28
- package/query-understanding-types.d.ts +43 -36
- package/render-assets-types.d.ts +8 -8
- package/resolve-client.d.ts +2 -2
- package/resolve-client.js +4 -6
- package/resolve-colour-types.d.ts +22 -6
- package/resolve-types.d.ts +10 -10
- package/run-types.d.ts +70 -70
- package/runs.d.ts +13 -26
- package/runs.js +77 -89
- package/samplize-catalogue-types.d.ts +18 -18
- package/samplize-colorvec.d.ts +20 -20
- package/samplize-colorvec.js +66 -42
- package/schema-resource-types.d.ts +38 -38
- package/schema-resource-types.js +5 -5
- package/search-card-types.d.ts +14 -5
- package/search-collapse-types.d.ts +4 -4
- package/search-mood-types.d.ts +2 -2
- package/search-refinement-types.d.ts +8 -8
- package/search-request-types.d.ts +6 -6
- package/search-response-receipt-types.d.ts +135 -34
- package/search-response-types.d.ts +2 -2
- package/search-result-validation.d.ts +3 -3
- package/search-result-validation.js +53 -36
- package/search-window-types.d.ts +2 -2
- package/slot-pool-types.d.ts +20 -20
- package/source-material-validation.d.ts +3 -3
- package/source-material-validation.js +35 -39
- package/spec-facet-types.d.ts +10 -10
- package/spec-types.d.ts +6 -6
- package/specifications.d.ts +9 -25
- package/specifications.js +15 -21
- package/sse.d.ts +2 -2
- package/sse.js +32 -16
- package/substitute-types.d.ts +22 -22
- package/suggest-types.d.ts +7 -7
- package/suggest-types.js +3 -3
- package/taxonomy-coverage-types.d.ts +8 -8
- package/types.d.ts +119 -119
- package/validation.d.ts +26 -26
- package/validation.js +97 -92
- package/webmcp.d.ts +2 -2
- package/webmcp.generated.js +94 -87
- package/project-types.d.ts +0 -79
- package/project-types.js +0 -9
- package/projects.d.ts +0 -13
- package/projects.js +0 -46
- package/run-events.d.ts +0 -106
- package/run-events.js +0 -32
- package/schedule-reference-types.d.ts +0 -46
- package/schedule-reference-types.js +0 -1
- package/schedule-references-client.d.ts +0 -14
- package/schedule-references-client.js +0 -26
- package/schedule-types.d.ts +0 -261
- package/schedule-types.js +0 -1
|
@@ -4,21 +4,21 @@ import type { ResolvedMeaning } from "./resolve-types.js";
|
|
|
4
4
|
import type { SearchInput } from "./search-request-types.js";
|
|
5
5
|
import type { OpenEnum } from "./types.js";
|
|
6
6
|
export type MaterialQueryVocabularyKind = OpenEnum<"attribute" | "dictionary_term" | "inline_enum" | "product_type" | "product_type_group">;
|
|
7
|
-
export
|
|
7
|
+
export type MaterialQuerySpan = {
|
|
8
8
|
start: number;
|
|
9
9
|
end: number;
|
|
10
10
|
text: string;
|
|
11
|
-
}
|
|
12
|
-
export
|
|
11
|
+
};
|
|
12
|
+
export type MaterialQueryOwner = {
|
|
13
13
|
attributeId: string;
|
|
14
14
|
attributeName: string;
|
|
15
|
-
}
|
|
16
|
-
export
|
|
15
|
+
};
|
|
16
|
+
export type MaterialQueryLifecycle = {
|
|
17
17
|
status: string;
|
|
18
18
|
introducedIn?: string;
|
|
19
19
|
deprecatedIn?: string;
|
|
20
20
|
supersededBy?: string;
|
|
21
|
-
}
|
|
21
|
+
};
|
|
22
22
|
export type MaterialQueryOntologyContext = {
|
|
23
23
|
description: string;
|
|
24
24
|
valueKind: string;
|
|
@@ -26,10 +26,10 @@ export type MaterialQueryOntologyContext = {
|
|
|
26
26
|
} | {
|
|
27
27
|
dictionaryId: string;
|
|
28
28
|
dictionaryName: string;
|
|
29
|
-
owningAttributes:
|
|
29
|
+
owningAttributes: {
|
|
30
30
|
id: string;
|
|
31
31
|
name: string;
|
|
32
|
-
}
|
|
32
|
+
}[];
|
|
33
33
|
lifecycle: MaterialQueryLifecycle;
|
|
34
34
|
} | {
|
|
35
35
|
attributeId: string;
|
|
@@ -41,23 +41,23 @@ export type MaterialQueryOntologyContext = {
|
|
|
41
41
|
} | {
|
|
42
42
|
description: string;
|
|
43
43
|
};
|
|
44
|
-
export
|
|
44
|
+
export type MaterialQueryApplicability = {
|
|
45
45
|
status: OpenEnum<"all" | "some" | "none" | "unknown">;
|
|
46
46
|
categoryId?: string;
|
|
47
47
|
productTypeIds: string[];
|
|
48
48
|
applicableProductTypeIds: string[];
|
|
49
|
-
}
|
|
50
|
-
export
|
|
49
|
+
};
|
|
50
|
+
export type MaterialQueryCoverage = {
|
|
51
51
|
variants: number;
|
|
52
52
|
basis: OpenEnum<"facet_index">;
|
|
53
53
|
scope: OpenEnum<"corpus">;
|
|
54
|
-
}
|
|
55
|
-
export
|
|
54
|
+
};
|
|
55
|
+
export type MaterialQueryReachability = {
|
|
56
56
|
status: OpenEnum<"positive" | "zero" | "unknown">;
|
|
57
57
|
categoryId: string;
|
|
58
58
|
basis: OpenEnum<"bounded_probe" | "unmeasured">;
|
|
59
|
-
}
|
|
60
|
-
export
|
|
59
|
+
};
|
|
60
|
+
export type MaterialQueryCandidate = {
|
|
61
61
|
kind: MaterialQueryVocabularyKind;
|
|
62
62
|
subjectType: MaterialQueryVocabularyKind;
|
|
63
63
|
subjectId: string;
|
|
@@ -76,8 +76,8 @@ export interface MaterialQueryCandidate {
|
|
|
76
76
|
coverage?: MaterialQueryCoverage;
|
|
77
77
|
reachability?: MaterialQueryReachability;
|
|
78
78
|
reason?: string;
|
|
79
|
-
}
|
|
80
|
-
export
|
|
79
|
+
};
|
|
80
|
+
export type MaterialQueryCriterion = {
|
|
81
81
|
source: {
|
|
82
82
|
subjectType: MaterialQueryVocabularyKind;
|
|
83
83
|
subjectId: string;
|
|
@@ -95,7 +95,7 @@ export interface MaterialQueryCriterion {
|
|
|
95
95
|
coverage: MaterialQueryCoverage;
|
|
96
96
|
applicability: MaterialQueryApplicability;
|
|
97
97
|
reachability?: MaterialQueryReachability;
|
|
98
|
-
}
|
|
98
|
+
};
|
|
99
99
|
export type MaterialQueryStandardMeaning = ResolvedMeaning | QuerySense;
|
|
100
100
|
export type MaterialQueryAmbiguityAlternative = (MaterialQueryOwner & {
|
|
101
101
|
kind: OpenEnum<"owner">;
|
|
@@ -108,7 +108,7 @@ export type MaterialQueryAmbiguityAlternative = (MaterialQueryOwner & {
|
|
|
108
108
|
kind: OpenEnum<"standard_meaning">;
|
|
109
109
|
meaning: MaterialQueryStandardMeaning;
|
|
110
110
|
};
|
|
111
|
-
export
|
|
111
|
+
export type MaterialQueryPlan = {
|
|
112
112
|
version: OpenEnum<"1">;
|
|
113
113
|
verdict: OpenEnum<"executable" | "partial" | "refused">;
|
|
114
114
|
rawQuery: string;
|
|
@@ -135,20 +135,20 @@ export interface MaterialQueryPlan {
|
|
|
135
135
|
undertone?: string;
|
|
136
136
|
} | null;
|
|
137
137
|
residualText: string;
|
|
138
|
-
unspentSpans:
|
|
138
|
+
unspentSpans: (MaterialQuerySpan & {
|
|
139
139
|
reason: OpenEnum<"residual" | "ambiguous" | "refused">;
|
|
140
|
-
}
|
|
141
|
-
ambiguities:
|
|
140
|
+
})[];
|
|
141
|
+
ambiguities: {
|
|
142
142
|
subjectType: MaterialQueryVocabularyKind;
|
|
143
143
|
subjectId: string;
|
|
144
144
|
span: MaterialQuerySpan;
|
|
145
145
|
reason: string;
|
|
146
146
|
alternatives: MaterialQueryAmbiguityAlternative[];
|
|
147
|
-
}
|
|
148
|
-
standardMeanings:
|
|
147
|
+
}[];
|
|
148
|
+
standardMeanings: {
|
|
149
149
|
span: MaterialQuerySpan;
|
|
150
150
|
meanings: MaterialQueryStandardMeaning[];
|
|
151
|
-
}
|
|
151
|
+
}[];
|
|
152
152
|
/** Complete ordinary-search requests authored by MaterialGraph. Execute verbatim. */
|
|
153
153
|
requests: SearchInput[];
|
|
154
|
-
}
|
|
154
|
+
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/** Material blocks, safe assets, and technical documents over one shared transport. */
|
|
2
|
-
import { HttpTransport } from "./http-transport.js";
|
|
2
|
+
import type { HttpTransport } from "./http-transport.js";
|
|
3
3
|
import type { VariantId } from "./identifiers.js";
|
|
4
4
|
import type { MaterialAssetProjection, MaterialDocumentPage, MaterialDocumentPageOptions } from "./material-asset-types.js";
|
|
5
5
|
import type { MaterialBlockProjection } from "./material-block-types.js";
|
|
6
6
|
import type { MaterialRenderAssets } from "./render-assets-types.js";
|
|
7
7
|
/** Read known and explicitly unobserved canonical material fields. */
|
|
8
|
-
export declare
|
|
8
|
+
export declare const materialBlocks: (transport: HttpTransport, variantId: VariantId, signal?: AbortSignal) => Promise<MaterialBlockProjection>;
|
|
9
9
|
/** Read only redistribution-safe images and downloads for a material. */
|
|
10
|
-
export declare
|
|
10
|
+
export declare const materialAssets: (transport: HttpTransport, variantId: VariantId, signal?: AbortSignal) => Promise<MaterialAssetProjection>;
|
|
11
11
|
/** Read the accepted render-ready appearance projection, or an explicit unavailable reason. */
|
|
12
|
-
export declare
|
|
12
|
+
export declare const materialRenderAssets: (transport: HttpTransport, variantId: VariantId, signal?: AbortSignal) => Promise<MaterialRenderAssets>;
|
|
13
13
|
/**
|
|
14
14
|
* Read the owning Product's URL-deduplicated document page. Variant declarations
|
|
15
15
|
* retain exact attribution; consumers inspect `appliesToRequestedVariant`
|
|
16
16
|
* before presenting a sibling Variant declaration as applicable.
|
|
17
17
|
*/
|
|
18
|
-
export declare
|
|
18
|
+
export declare const materialDocuments: (transport: HttpTransport, variantId: VariantId, options?: MaterialDocumentPageOptions, signal?: AbortSignal) => Promise<MaterialDocumentPage>;
|
|
@@ -1,29 +1,19 @@
|
|
|
1
|
-
/** Material blocks, safe assets, and technical documents over one shared transport. */
|
|
2
|
-
import { HttpTransport } from "./http-transport.js";
|
|
3
1
|
import { resolveOperation } from "./operations.js";
|
|
4
2
|
/** Read known and explicitly unobserved canonical material fields. */
|
|
5
|
-
export
|
|
6
|
-
return transport.requestJson(resolveOperation("list_material_blocks"), { signal, pathParams: { variantId } });
|
|
7
|
-
}
|
|
3
|
+
export const materialBlocks = async (transport, variantId, signal) => await transport.requestJson(resolveOperation("list_material_blocks"), { pathParams: { variantId }, signal });
|
|
8
4
|
/** Read only redistribution-safe images and downloads for a material. */
|
|
9
|
-
export
|
|
10
|
-
return transport.requestJson(resolveOperation("list_material_assets"), { signal, pathParams: { variantId } });
|
|
11
|
-
}
|
|
5
|
+
export const materialAssets = async (transport, variantId, signal) => await transport.requestJson(resolveOperation("list_material_assets"), { pathParams: { variantId }, signal });
|
|
12
6
|
/** Read the accepted render-ready appearance projection, or an explicit unavailable reason. */
|
|
13
|
-
export
|
|
14
|
-
return transport.requestJson(resolveOperation("get_material_render_assets"), { signal, pathParams: { variantId } });
|
|
15
|
-
}
|
|
7
|
+
export const materialRenderAssets = async (transport, variantId, signal) => await transport.requestJson(resolveOperation("get_material_render_assets"), { pathParams: { variantId }, signal });
|
|
16
8
|
/**
|
|
17
9
|
* Read the owning Product's URL-deduplicated document page. Variant declarations
|
|
18
10
|
* retain exact attribution; consumers inspect `appliesToRequestedVariant`
|
|
19
11
|
* before presenting a sibling Variant declaration as applicable.
|
|
20
12
|
*/
|
|
21
|
-
export
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
});
|
|
29
|
-
}
|
|
13
|
+
export const materialDocuments = async (transport, variantId, options, signal) => await transport.requestJson(resolveOperation("list_material_documents"), {
|
|
14
|
+
pathParams: { variantId },
|
|
15
|
+
query: options
|
|
16
|
+
? { cursor: options.cursor, limit: options.limit }
|
|
17
|
+
: undefined,
|
|
18
|
+
signal,
|
|
19
|
+
});
|
package/material-types.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ export type MaterialAvailability = OpenEnum<"available" | "discontinued" | "supe
|
|
|
41
41
|
* successor that has itself been superseded reports `discontinued`/`unknown`
|
|
42
42
|
* here; follow `variantId` for the next link in the chain.
|
|
43
43
|
*/
|
|
44
|
-
export
|
|
44
|
+
export type MaterialSuccessor = {
|
|
45
45
|
/** Opaque — round-trip verbatim to read the successor. */
|
|
46
46
|
variantId: VariantId;
|
|
47
47
|
brandSlug: string;
|
|
@@ -51,12 +51,12 @@ export interface MaterialSuccessor {
|
|
|
51
51
|
variant: string;
|
|
52
52
|
color: string | null;
|
|
53
53
|
availability: MaterialAvailability;
|
|
54
|
-
}
|
|
54
|
+
};
|
|
55
55
|
/**
|
|
56
56
|
* The grid-card projection of a material. Tiles carry `availability` but not the
|
|
57
57
|
* successor record — read the detail projection for that.
|
|
58
58
|
*/
|
|
59
|
-
export
|
|
59
|
+
export type MaterialTile = {
|
|
60
60
|
/** Accepted sampleability fact. Absent means unknown, never false. */
|
|
61
61
|
sampleable?: boolean;
|
|
62
62
|
/** Opaque — round-trip verbatim into every other material read. */
|
|
@@ -77,7 +77,7 @@ export interface MaterialTile {
|
|
|
77
77
|
* the attribute is absent — never render a missing key as "unnamed".
|
|
78
78
|
*/
|
|
79
79
|
colourName?: string;
|
|
80
|
-
}
|
|
80
|
+
};
|
|
81
81
|
/**
|
|
82
82
|
* A sibling card: the tile, plus — when another variant of the same product
|
|
83
83
|
* shares both its `variantName` and its `colourName` — the one attribute that
|
|
@@ -86,11 +86,11 @@ export interface MaterialTile {
|
|
|
86
86
|
* code. The two fields arrive together or not at all; absent means nothing
|
|
87
87
|
* collides, or neither attribute separates every look-alike.
|
|
88
88
|
*/
|
|
89
|
-
export
|
|
89
|
+
export type SiblingTile = {
|
|
90
90
|
distinguishedBy?: OpenEnum<"size" | "code">;
|
|
91
91
|
/** This sibling's value of `distinguishedBy`, e.g. `"3.5 in"`. */
|
|
92
92
|
distinction?: string;
|
|
93
|
-
}
|
|
93
|
+
} & MaterialTile;
|
|
94
94
|
/**
|
|
95
95
|
* A canonical attribute/term pair carried on a detail record.
|
|
96
96
|
*
|
|
@@ -99,7 +99,7 @@ export interface SiblingTile extends MaterialTile {
|
|
|
99
99
|
* `specificationFacets()` and `attributeValues()`. An attribute absent from
|
|
100
100
|
* `facets` is unrecorded, never known-false.
|
|
101
101
|
*/
|
|
102
|
-
export
|
|
102
|
+
export type MaterialFacet = {
|
|
103
103
|
attributeId: string;
|
|
104
104
|
term: string;
|
|
105
105
|
/**
|
|
@@ -108,9 +108,9 @@ export interface MaterialFacet {
|
|
|
108
108
|
* payloads. Only `specification` facets are valid inputs to `bySpec`.
|
|
109
109
|
*/
|
|
110
110
|
role?: "identity" | "specification";
|
|
111
|
-
}
|
|
111
|
+
};
|
|
112
112
|
/** A retained product-type proposal. It is review evidence, never a category. */
|
|
113
|
-
export
|
|
113
|
+
export type ProposedProductType = {
|
|
114
114
|
id: string;
|
|
115
115
|
displayName: string;
|
|
116
116
|
confidence: number | null;
|
|
@@ -118,12 +118,12 @@ export interface ProposedProductType {
|
|
|
118
118
|
sourceUrl: string | null;
|
|
119
119
|
isPrimary: boolean;
|
|
120
120
|
scope: "variant" | "product";
|
|
121
|
-
}
|
|
121
|
+
};
|
|
122
122
|
/** Accepted display categories remain separate from this review-state receipt. */
|
|
123
|
-
export
|
|
123
|
+
export type ProductTypeReceipt = {
|
|
124
124
|
state: "accepted" | "proposed" | "unknown";
|
|
125
125
|
proposedProductTypes: ProposedProductType[];
|
|
126
|
-
}
|
|
126
|
+
};
|
|
127
127
|
/**
|
|
128
128
|
* One dimensional configuration of a material. Numeric fields are millimetres
|
|
129
129
|
* (mass in kilograms); string fields are the source's own descriptors. The
|
package/ndjson.js
CHANGED
|
@@ -32,8 +32,9 @@ export class NdjsonDecoder {
|
|
|
32
32
|
const lines = [];
|
|
33
33
|
for (;;) {
|
|
34
34
|
const index = this.#buffer.indexOf("\n");
|
|
35
|
-
if (index === -1)
|
|
35
|
+
if (index === -1) {
|
|
36
36
|
break;
|
|
37
|
+
}
|
|
37
38
|
lines.push(this.#buffer.slice(0, index));
|
|
38
39
|
this.#buffer = this.#buffer.slice(index + 1);
|
|
39
40
|
}
|
|
@@ -46,8 +47,9 @@ export class NdjsonDecoder {
|
|
|
46
47
|
* raise, not this decoder's fragment to discard.
|
|
47
48
|
*/
|
|
48
49
|
flush() {
|
|
49
|
-
if (this.#buffer.length === 0)
|
|
50
|
+
if (this.#buffer.length === 0) {
|
|
50
51
|
return [];
|
|
52
|
+
}
|
|
51
53
|
const remainder = this.#buffer;
|
|
52
54
|
this.#buffer = "";
|
|
53
55
|
return [remainder];
|
|
@@ -66,34 +68,40 @@ export async function* readNdjsonLines(body, signal) {
|
|
|
66
68
|
const ndjson = new NdjsonDecoder();
|
|
67
69
|
try {
|
|
68
70
|
for (;;) {
|
|
69
|
-
if (signal?.aborted)
|
|
71
|
+
if (signal?.aborted) {
|
|
70
72
|
return;
|
|
73
|
+
}
|
|
71
74
|
let result;
|
|
72
75
|
try {
|
|
73
76
|
result = await reader.read();
|
|
74
77
|
}
|
|
75
78
|
catch (error) {
|
|
76
|
-
if (signal?.aborted)
|
|
79
|
+
if (signal?.aborted) {
|
|
77
80
|
return;
|
|
81
|
+
}
|
|
78
82
|
throw error;
|
|
79
83
|
}
|
|
80
84
|
if (result.done) {
|
|
81
85
|
// `decode()` with no argument flushes any dangling multi-byte sequence.
|
|
82
86
|
for (const line of ndjson.push(decoder.decode())) {
|
|
83
|
-
if (line.trim().length > 0)
|
|
87
|
+
if (line.trim().length > 0) {
|
|
84
88
|
yield line;
|
|
89
|
+
}
|
|
85
90
|
}
|
|
86
91
|
for (const line of ndjson.flush()) {
|
|
87
|
-
if (line.trim().length > 0)
|
|
92
|
+
if (line.trim().length > 0) {
|
|
88
93
|
yield line;
|
|
94
|
+
}
|
|
89
95
|
}
|
|
90
96
|
return;
|
|
91
97
|
}
|
|
92
98
|
for (const line of ndjson.push(decoder.decode(result.value, { stream: true }))) {
|
|
93
|
-
if (signal?.aborted)
|
|
99
|
+
if (signal?.aborted) {
|
|
94
100
|
return;
|
|
95
|
-
|
|
101
|
+
}
|
|
102
|
+
if (line.trim().length > 0) {
|
|
96
103
|
yield line;
|
|
104
|
+
}
|
|
97
105
|
}
|
|
98
106
|
}
|
|
99
107
|
}
|
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 ["brandMostSampled", "GET", "/api/v1/brands/most-sampled", "brands.most_sampled"], readonly ["colours.complete", "POST", "/api/v1/colours/palettes/complete", "complete_interior_palette"], readonly ["colours.discover", "GET", "/api/v1/colours/palettes", "discover_interior_palettes"], readonly ["samplizeColorVecCache", "GET", "/api/v1/catalogues/samplize/colorvec", "samplize_colorvec_cache"], readonly ["samplizeCatalogueSearch", "POST", "/api/v1/catalogues/samplize/search", "samplize_catalogue_search"], readonly ["
|
|
2
|
+
declare const OPERATION_DEFINITIONS: readonly [readonly ["brandMostSampled", "GET", "/api/v1/brands/most-sampled", "brands.most_sampled"], readonly ["colours.complete", "POST", "/api/v1/colours/palettes/complete", "complete_interior_palette"], readonly ["colours.discover", "GET", "/api/v1/colours/palettes", "discover_interior_palettes"], readonly ["samplizeColorVecCache", "GET", "/api/v1/catalogues/samplize/colorvec", "samplize_colorvec_cache"], readonly ["samplizeCatalogueSearch", "POST", "/api/v1/catalogues/samplize/search", "samplize_catalogue_search"], readonly ["catalogs", "GET", "/api/v1/catalogs", "list_catalog_documents"], readonly ["catalogPages", "GET", "/api/v1/catalogs/{catalogId}/pages", "list_catalog_pages"], readonly ["catalogPageRepresentation", "GET", "/api/v1/catalog-pages/{pageId}/representation", "get_catalog_page_representation"], readonly ["catalogReferences", "GET", "/api/v1/catalogs/{catalogId}/references", "list_catalog_product_references"], readonly ["search", "POST", "/api/v1/search", "search_materials_post"], readonly ["identify", "POST", "/api/v1/identify", "retrieval.identify"], readonly ["compare", "POST", "/api/v1/compare", "retrieval.compare"], readonly ["createCorrection", "POST", "/api/v1/corrections", "corrections.create"], readonly ["getCorrection", "GET", "/api/v1/corrections/{correctionId}", "corrections.get"], readonly ["listCorrections", "GET", "/api/v1/corrections", "corrections.list"], readonly ["planQuery", "POST", "/api/v1/search/plan", "plan_material_query"], readonly ["samplizeCatalogue", "GET", "/api/v1/catalogues/samplize/products", "samplize_catalogue_products"], readonly ["searchGet", "GET", "/api/v1/search", "search_materials_get"], readonly ["match", "POST", "/api/v1/search/match", "match_material"], readonly ["rejectMatchResult", "POST", "/api/v1/search/match/{responseId}/rejections", "reject_match_result"], readonly ["matchRejections", "GET", "/api/v1/search/match/{responseId}/rejections", "list_match_rejections"], readonly ["byColour", "GET", "/api/v1/search/colours", "search_by_colour"], readonly ["material", "GET", "/api/v1/materials/{variantId}", "get_material"], readonly ["catalogueReferences", "POST", "/api/v1/catalogues/references", "get_catalogue_references_batch"], readonly ["catalogueCollections", "GET", "/api/v1/catalogues/collections", "list_catalogue_channel_collections"], readonly ["catalogueDocumentAccess", "GET", "/api/v1/catalogues/documents/{documentId}", "get_catalogue_document_access"], readonly ["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 ["materialRenderAssets", "GET", "/api/v1/materials/{variantId}/render-assets", "get_material_render_assets"], readonly ["materialDocuments", "GET", "/api/v1/materials/{variantId}/documents", "list_material_documents"], 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 ["findSubstitutes", "POST", "/api/v1/materials/{variantId}/substitutes", "find_material_substitutes"], 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 ["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 ["productTypeCoverage", "GET", "/api/v1/taxonomy/coverage", "get_product_type_status_coverage"], 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.list", "GET", "/api/v1/source-material/{batchId}/sources/{sourceId}/comments", "list_source_material_comments"], readonly ["sourceMaterialComments.post", "POST", "/api/v1/source-material/{batchId}/sources/{sourceId}/comments", "post_source_material_comment"], readonly ["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 ["citation", "GET", "/api/v1/citations/{citationId}", "get_verdict_citation"], 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 ["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];
|
|
@@ -9,13 +9,13 @@ export type SdkOperation = Readonly<{
|
|
|
9
9
|
}>;
|
|
10
10
|
export declare const SDK_OPERATIONS: readonly SdkOperation[];
|
|
11
11
|
/** Look up a registered operation by its OpenAPI `operationId`. */
|
|
12
|
-
export declare
|
|
12
|
+
export declare const findSdkOperation: (operationId: SdkOperationId) => SdkOperation | undefined;
|
|
13
13
|
/**
|
|
14
14
|
* Look up a registered operation, or throw. The lookup every caller that holds
|
|
15
|
-
* a literal `operationId` wants — lived as a private copy in `client.ts`
|
|
16
|
-
*
|
|
15
|
+
* a literal `operationId` wants — lived as a private copy in `client.ts`
|
|
16
|
+
* before the association lens would have made it a second.
|
|
17
17
|
*/
|
|
18
|
-
export declare
|
|
18
|
+
export declare const resolveOperation: (operationId: SdkOperationId) => SdkOperation;
|
|
19
19
|
/** Substitute `{param}` path placeholders with percent-encoded values. */
|
|
20
|
-
export declare
|
|
20
|
+
export declare const operationPath: (sdkOperation: SdkOperation, pathParams?: Readonly<Record<string, string>>) => string;
|
|
21
21
|
export {};
|
package/operations.js
CHANGED
|
@@ -31,18 +31,6 @@ const OPERATION_DEFINITIONS = [
|
|
|
31
31
|
"/api/v1/catalogues/samplize/search",
|
|
32
32
|
"samplize_catalogue_search",
|
|
33
33
|
],
|
|
34
|
-
[
|
|
35
|
-
"scheduleReferences.list",
|
|
36
|
-
"GET",
|
|
37
|
-
"/api/v1/schedules/{scheduleId}/references",
|
|
38
|
-
"list_schedule_reference_feedback",
|
|
39
|
-
],
|
|
40
|
-
[
|
|
41
|
-
"scheduleReferences.put",
|
|
42
|
-
"PUT",
|
|
43
|
-
"/api/v1/schedules/{scheduleId}/references/{referenceId}",
|
|
44
|
-
"put_schedule_reference_feedback",
|
|
45
|
-
],
|
|
46
34
|
["catalogs", "GET", "/api/v1/catalogs", "list_catalog_documents"],
|
|
47
35
|
[
|
|
48
36
|
"catalogPages",
|
|
@@ -337,12 +325,6 @@ const OPERATION_DEFINITIONS = [
|
|
|
337
325
|
["createRun", "POST", "/api/v1/runs", "create_public_run"],
|
|
338
326
|
["listRuns", "GET", "/api/v1/runs", "list_public_runs"],
|
|
339
327
|
["run", "GET", "/api/v1/runs/{runId}", "get_public_run"],
|
|
340
|
-
[
|
|
341
|
-
"runSchedule",
|
|
342
|
-
"GET",
|
|
343
|
-
"/api/v1/runs/{runId}/schedule",
|
|
344
|
-
"get_run_finish_schedule",
|
|
345
|
-
],
|
|
346
328
|
["citation", "GET", "/api/v1/citations/{citationId}", "get_verdict_citation"],
|
|
347
329
|
[
|
|
348
330
|
"streamRunEvents",
|
|
@@ -354,15 +336,6 @@ const OPERATION_DEFINITIONS = [
|
|
|
354
336
|
["cancelRun", "POST", "/api/v1/runs/{runId}/cancel", "cancel_public_run"],
|
|
355
337
|
["varyScheme", "POST", "/api/v1/schemes/vary", "vary_schemes"],
|
|
356
338
|
["slotPools", "POST", "/api/v1/schemes/pools", "slot_pools"],
|
|
357
|
-
["createProject", "POST", "/api/v1/projects", "create_box_project"],
|
|
358
|
-
["listProjects", "GET", "/api/v1/projects", "list_box_projects"],
|
|
359
|
-
["getProject", "GET", "/api/v1/projects/{projectId}", "get_box_project"],
|
|
360
|
-
[
|
|
361
|
-
"appendProjectEvent",
|
|
362
|
-
"POST",
|
|
363
|
-
"/api/v1/projects/{projectId}/events",
|
|
364
|
-
"append_box_project_event",
|
|
365
|
-
],
|
|
366
339
|
["demandBatch", "POST", "/api/v1/demand/batch", "get_demand_batch"],
|
|
367
340
|
["codeAdvisory", "POST", "/api/v1/codes/advisory", "resolveCodeAdvisory"],
|
|
368
341
|
["codes.context", "GET", "/api/v1/codes/context", "list_code_context"],
|
|
@@ -373,23 +346,20 @@ const OPERATION_DEFINITIONS = [
|
|
|
373
346
|
"list_code_requirements",
|
|
374
347
|
],
|
|
375
348
|
];
|
|
376
|
-
export const SDK_OPERATIONS = Object.freeze(OPERATION_DEFINITIONS.map(([clientMethod, method, path, operationId]) => Object.freeze({ clientMethod, method,
|
|
349
|
+
export const SDK_OPERATIONS = Object.freeze(OPERATION_DEFINITIONS.map(([clientMethod, method, path, operationId]) => Object.freeze({ clientMethod, method, operationId, path })));
|
|
377
350
|
/** Look up a registered operation by its OpenAPI `operationId`. */
|
|
378
|
-
export
|
|
379
|
-
return SDK_OPERATIONS.find((candidate) => candidate.operationId === operationId);
|
|
380
|
-
}
|
|
351
|
+
export const findSdkOperation = (operationId) => SDK_OPERATIONS.find((candidate) => candidate.operationId === operationId);
|
|
381
352
|
/**
|
|
382
353
|
* Look up a registered operation, or throw. The lookup every caller that holds
|
|
383
|
-
* a literal `operationId` wants — lived as a private copy in `client.ts`
|
|
384
|
-
*
|
|
354
|
+
* a literal `operationId` wants — lived as a private copy in `client.ts`
|
|
355
|
+
* before the association lens would have made it a second.
|
|
385
356
|
*/
|
|
386
|
-
export
|
|
357
|
+
export const resolveOperation = (operationId) => {
|
|
387
358
|
const match = findSdkOperation(operationId);
|
|
388
|
-
if (!match)
|
|
359
|
+
if (!match) {
|
|
389
360
|
throw MaterialGraphError.unexpected(`Unknown SDK operation: ${operationId}`);
|
|
361
|
+
}
|
|
390
362
|
return match;
|
|
391
|
-
}
|
|
363
|
+
};
|
|
392
364
|
/** Substitute `{param}` path placeholders with percent-encoded values. */
|
|
393
|
-
export
|
|
394
|
-
return Object.entries(pathParams).reduce((path, [name, value]) => path.replace(`{${name}}`, encodeURIComponent(value)), sdkOperation.path);
|
|
395
|
-
}
|
|
365
|
+
export const operationPath = (sdkOperation, pathParams = {}) => Object.entries(pathParams).reduce((path, [name, value]) => path.replace(`{${name}}`, encodeURIComponent(value)), sdkOperation.path);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instruments/materialgraph",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@instruments/colorscope": "
|
|
20
|
+
"@instruments/colorscope": "9.0.1"
|
|
21
21
|
},
|
|
22
22
|
"license": "Proprietary",
|
|
23
23
|
"engines": {
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
/** Public wire types; the SDK does not load the producer corpus. */
|
|
2
2
|
export type CompositionalRole = "Foundation" | "Supporting" | "Accent";
|
|
3
|
-
export
|
|
3
|
+
export type RetainedColor = {
|
|
4
4
|
readonly id: string;
|
|
5
5
|
readonly hex: string;
|
|
6
6
|
readonly role?: CompositionalRole;
|
|
7
7
|
readonly paintVariantId?: string;
|
|
8
|
-
}
|
|
9
|
-
export
|
|
8
|
+
};
|
|
9
|
+
export type CompletionRequest = {
|
|
10
10
|
readonly inputs: readonly RetainedColor[];
|
|
11
11
|
readonly maxDistance?: number;
|
|
12
12
|
readonly limit?: number;
|
|
13
13
|
readonly white?: "published" | "perceptual";
|
|
14
14
|
readonly memberCount?: number;
|
|
15
15
|
readonly excludeHexes?: readonly string[];
|
|
16
|
-
}
|
|
17
|
-
export
|
|
16
|
+
};
|
|
17
|
+
export type CompletionAssignment = {
|
|
18
18
|
readonly input: RetainedColor;
|
|
19
19
|
readonly referenceIndex: number;
|
|
20
20
|
readonly referenceHex: string;
|
|
21
21
|
readonly distance: number;
|
|
22
|
-
}
|
|
23
|
-
export
|
|
22
|
+
};
|
|
23
|
+
export type CompletionMember = {
|
|
24
24
|
readonly hex: string;
|
|
25
25
|
readonly referenceHex: string;
|
|
26
26
|
readonly referenceIndex: number;
|
|
@@ -29,8 +29,8 @@ export interface CompletionMember {
|
|
|
29
29
|
readonly proportion: number;
|
|
30
30
|
readonly sourceRole: string | null;
|
|
31
31
|
readonly sourceRelation: string | null;
|
|
32
|
-
}
|
|
33
|
-
export
|
|
32
|
+
};
|
|
33
|
+
export type PaletteCompletion = {
|
|
34
34
|
readonly uses?: readonly {
|
|
35
35
|
readonly inputId: string;
|
|
36
36
|
readonly role: CompositionalRole;
|
|
@@ -52,20 +52,20 @@ export interface PaletteCompletion {
|
|
|
52
52
|
readonly proportionBasis: "sourced" | "proposed";
|
|
53
53
|
readonly worstDistance: number;
|
|
54
54
|
readonly totalDistance: number;
|
|
55
|
-
}
|
|
55
|
+
};
|
|
56
56
|
export type PaletteCompleteInput = CompletionRequest & {
|
|
57
57
|
sourceVersion: string;
|
|
58
58
|
};
|
|
59
|
-
export
|
|
59
|
+
export type PaletteDiscoverInput = {
|
|
60
60
|
sourceVersion: string;
|
|
61
61
|
character?: "warm" | "cool" | "very-light" | "light" | "dark" | "muted" | "soft" | "vivid";
|
|
62
62
|
moreLike?: string;
|
|
63
63
|
cursor?: string;
|
|
64
64
|
limit?: number;
|
|
65
|
-
}
|
|
66
|
-
export
|
|
65
|
+
};
|
|
66
|
+
export type MaterializedPalette = {
|
|
67
67
|
completion: PaletteCompletion;
|
|
68
|
-
samples:
|
|
68
|
+
samples: {
|
|
69
69
|
retainedPaint?: {
|
|
70
70
|
variantId: string;
|
|
71
71
|
name: string;
|
|
@@ -87,15 +87,15 @@ export interface MaterializedPalette {
|
|
|
87
87
|
status: string;
|
|
88
88
|
distance: number | null;
|
|
89
89
|
units: "oklab-euclidean";
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
90
|
+
}[];
|
|
91
|
+
};
|
|
92
|
+
type PaletteVersions = {
|
|
93
93
|
sourceVersion: string;
|
|
94
94
|
corpusVersion: string;
|
|
95
95
|
algorithmVersion: string;
|
|
96
96
|
transport: "colorscope-package";
|
|
97
|
-
}
|
|
98
|
-
export
|
|
97
|
+
};
|
|
98
|
+
export type PaletteCompleteResponse = {
|
|
99
99
|
results: MaterializedPalette[];
|
|
100
100
|
coverage: {
|
|
101
101
|
status: string;
|
|
@@ -106,10 +106,10 @@ export interface PaletteCompleteResponse extends PaletteVersions {
|
|
|
106
106
|
units: string;
|
|
107
107
|
policy: string;
|
|
108
108
|
};
|
|
109
|
-
}
|
|
110
|
-
export
|
|
109
|
+
} & PaletteVersions;
|
|
110
|
+
export type PaletteDiscoverResponse = {
|
|
111
111
|
results: MaterializedPalette[];
|
|
112
112
|
total: number;
|
|
113
113
|
nextCursor: string | null;
|
|
114
|
-
}
|
|
114
|
+
} & PaletteVersions;
|
|
115
115
|
export {};
|