@instruments/materialgraph 0.16.0 → 0.18.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 +61 -0
- package/associations-client.d.ts +3 -1
- package/associations-client.js +4 -0
- package/catalogue-client.d.ts +14 -1
- package/catalogue-client.js +27 -0
- package/catalogue-types.d.ts +311 -2
- package/client.d.ts +6 -17
- package/client.js +12 -21
- package/corpus-scope-types.d.ts +6 -4
- package/index.d.ts +1 -0
- package/material-asset-types.d.ts +71 -0
- package/material-resources-client.d.ts +15 -0
- package/material-resources-client.js +25 -0
- package/material-types.d.ts +35 -0
- package/operations.d.ts +1 -1
- package/operations.js +32 -0
- package/package.json +1 -1
- package/query-understanding-types.d.ts +187 -0
- package/search-collapse-types.d.ts +69 -0
- package/search-collapse-types.js +1 -0
- package/search-refinement-types.d.ts +17 -8
- package/search-request-types.d.ts +24 -11
- package/search-response-receipt-types.d.ts +87 -6
- package/search-result-validation.js +25 -1
- package/search-window-types.d.ts +13 -5
- package/spec-types.d.ts +7 -1
- package/suggest-types.d.ts +6 -0
- package/suggest-types.js +1 -1
- package/types.d.ts +15 -18
package/association-types.d.ts
CHANGED
|
@@ -90,3 +90,64 @@ export interface AssociatedOptions {
|
|
|
90
90
|
*/
|
|
91
91
|
cursor?: Cursor;
|
|
92
92
|
}
|
|
93
|
+
export type ApplicabilitySubject = {
|
|
94
|
+
kind: "product";
|
|
95
|
+
id: string;
|
|
96
|
+
} | {
|
|
97
|
+
kind: "variant";
|
|
98
|
+
id: VariantId;
|
|
99
|
+
};
|
|
100
|
+
export type ApplicabilityCoverageState = "available" | "partial" | "none_declared" | "not_ingested" | "source_not_applicable" | "unavailable";
|
|
101
|
+
export interface ApplicabilityCoverage {
|
|
102
|
+
state: ApplicabilityCoverageState;
|
|
103
|
+
countKind: "exact" | "partial";
|
|
104
|
+
declaredCount: number | null;
|
|
105
|
+
sourceAuthority: string;
|
|
106
|
+
sourceLocator: string;
|
|
107
|
+
sourceRevision: string;
|
|
108
|
+
}
|
|
109
|
+
export interface ApplicabilityFact {
|
|
110
|
+
id: string;
|
|
111
|
+
subject: ApplicabilitySubject;
|
|
112
|
+
finish: {
|
|
113
|
+
kind: "variant";
|
|
114
|
+
id: VariantId;
|
|
115
|
+
};
|
|
116
|
+
relation: "applicable_finish";
|
|
117
|
+
evidenceScope: "manufacturer_declared";
|
|
118
|
+
declaringBrandId: string;
|
|
119
|
+
source: {
|
|
120
|
+
authority: string;
|
|
121
|
+
locator: string;
|
|
122
|
+
revision: string;
|
|
123
|
+
};
|
|
124
|
+
lifecycle: "active";
|
|
125
|
+
}
|
|
126
|
+
export interface ApplicabilitySourceEntry {
|
|
127
|
+
scope: {
|
|
128
|
+
sourceAuthority: string;
|
|
129
|
+
sourceLocator: string;
|
|
130
|
+
};
|
|
131
|
+
/** Null when facts exist but this direction has no coverage census. */
|
|
132
|
+
coverage: ApplicabilityCoverage | null;
|
|
133
|
+
/** Revisions carried by active facts, independent from the coverage revision. */
|
|
134
|
+
factRevisions: string[];
|
|
135
|
+
/** Active facts from this source only. */
|
|
136
|
+
facts: ApplicabilityFact[];
|
|
137
|
+
}
|
|
138
|
+
/** Source-grained response; sources are never merged or given hidden precedence. */
|
|
139
|
+
export interface ApplicabilityResponse {
|
|
140
|
+
kind: "manufacturer_declared_applicability";
|
|
141
|
+
requestedSubject: ApplicabilitySubject;
|
|
142
|
+
direction: "forward" | "reverse";
|
|
143
|
+
sources: ApplicabilitySourceEntry[];
|
|
144
|
+
}
|
|
145
|
+
export type ApplicabilityOptions = {
|
|
146
|
+
subjectKind: "product";
|
|
147
|
+
subjectId: string;
|
|
148
|
+
direction: "forward";
|
|
149
|
+
} | {
|
|
150
|
+
subjectKind: "variant";
|
|
151
|
+
subjectId: VariantId;
|
|
152
|
+
direction: "forward" | "reverse";
|
|
153
|
+
};
|
package/associations-client.d.ts
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* sections, never concatenate them, and never describe a pairing as
|
|
13
13
|
* "available on".
|
|
14
14
|
*/
|
|
15
|
-
import type { AssociatedOptions, DeclaredAssociationsResponse } from "./association-types.js";
|
|
15
|
+
import type { ApplicabilityOptions, ApplicabilityResponse, AssociatedOptions, DeclaredAssociationsResponse } from "./association-types.js";
|
|
16
16
|
import { HttpTransport } from "./http-transport.js";
|
|
17
17
|
import type { VariantId } from "./identifiers.js";
|
|
18
18
|
/**
|
|
@@ -49,3 +49,5 @@ export declare function declaredFinishes(transport: HttpTransport, variantId: Va
|
|
|
49
49
|
* @param variantId The FINISH variant. Opaque — pass back exactly what you were given.
|
|
50
50
|
*/
|
|
51
51
|
export declare function declaredProducts(transport: HttpTransport, variantId: VariantId, options?: AssociatedOptions, signal?: AbortSignal): Promise<DeclaredAssociationsResponse>;
|
|
52
|
+
/** Read manufacturer-declared applicability without collapsing Product/Variant grain. */
|
|
53
|
+
export declare function applicability(transport: HttpTransport, options: ApplicabilityOptions, signal?: AbortSignal): Promise<ApplicabilityResponse>;
|
package/associations-client.js
CHANGED
|
@@ -38,3 +38,7 @@ export function declaredFinishes(transport, variantId, options, signal) {
|
|
|
38
38
|
export function declaredProducts(transport, variantId, options, signal) {
|
|
39
39
|
return transport.requestJson(resolveOperation("list_associated_products"), { query: { variantId, ...options }, signal });
|
|
40
40
|
}
|
|
41
|
+
/** Read manufacturer-declared applicability without collapsing Product/Variant grain. */
|
|
42
|
+
export function applicability(transport, options, signal) {
|
|
43
|
+
return transport.requestJson(resolveOperation("get_applicability"), { query: options, signal });
|
|
44
|
+
}
|
package/catalogue-client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CatalogueDocumentAccessResult, CatalogueReferenceBatchResponse } from "./catalogue-types.js";
|
|
1
|
+
import type { CatalogDocumentList, CatalogPageListResult, CatalogProductReferenceReadResult, CatalogueChannelCollectionsResponse, CatalogueCollectionsOptions, CatalogueDocumentAccessResult, CataloguePageRepresentationReadResult, CatalogueReferenceBatchResponse } from "./catalogue-types.js";
|
|
2
2
|
import type { HttpTransport } from "./http-transport.js";
|
|
3
3
|
import type { VariantId } from "./identifiers.js";
|
|
4
4
|
/** Catalogue publication operations inherited by the public SDK client. */
|
|
@@ -13,6 +13,19 @@ export declare class CatalogueClient {
|
|
|
13
13
|
catalogueReferences(input: {
|
|
14
14
|
variantIds: VariantId[];
|
|
15
15
|
}, signal?: AbortSignal): Promise<CatalogueReferenceBatchResponse>;
|
|
16
|
+
/** List product collections with governed catalogue-channel membership. */
|
|
17
|
+
catalogueCollections(options?: CatalogueCollectionsOptions, signal?: AbortSignal): Promise<CatalogueChannelCollectionsResponse>;
|
|
18
|
+
/** List immutable catalog documents retained from verified source material. */
|
|
19
|
+
catalogs(signal?: AbortSignal): Promise<CatalogDocumentList>;
|
|
20
|
+
/** List stable one-based page identities and their representation status. */
|
|
21
|
+
catalogPages(catalogId: string, options?: {
|
|
22
|
+
limit?: number;
|
|
23
|
+
offset?: number;
|
|
24
|
+
}, signal?: AbortSignal): Promise<CatalogPageListResult>;
|
|
25
|
+
/** Read a retained page representation or its exact missing-artifact receipt. */
|
|
26
|
+
catalogPageRepresentation(pageId: string, signal?: AbortSignal): Promise<CataloguePageRepresentationReadResult>;
|
|
27
|
+
/** Read every verified product/page reference for one retained catalog. */
|
|
28
|
+
catalogReferences(catalogId: string, signal?: AbortSignal): Promise<CatalogProductReferenceReadResult>;
|
|
16
29
|
/** Resolve browser-safe access to one immutable catalogue document. */
|
|
17
30
|
catalogueDocumentAccess(documentId: string, signal?: AbortSignal): Promise<CatalogueDocumentAccessResult>;
|
|
18
31
|
}
|
package/catalogue-client.js
CHANGED
|
@@ -13,6 +13,33 @@ export class CatalogueClient {
|
|
|
13
13
|
catalogueReferences(input, signal) {
|
|
14
14
|
return this.#transport.requestJson(resolveOperation("get_catalogue_references_batch"), { body: input, signal });
|
|
15
15
|
}
|
|
16
|
+
/** List product collections with governed catalogue-channel membership. */
|
|
17
|
+
catalogueCollections(options = {}, signal) {
|
|
18
|
+
return this.#transport.requestJson(resolveOperation("list_catalogue_channel_collections"), {
|
|
19
|
+
query: {
|
|
20
|
+
limit: options.limit,
|
|
21
|
+
offset: options.offset,
|
|
22
|
+
sampleLimit: options.sampleLimit,
|
|
23
|
+
},
|
|
24
|
+
signal,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/** List immutable catalog documents retained from verified source material. */
|
|
28
|
+
catalogs(signal) {
|
|
29
|
+
return this.#transport.requestJson(resolveOperation("list_catalog_documents"), { signal });
|
|
30
|
+
}
|
|
31
|
+
/** List stable one-based page identities and their representation status. */
|
|
32
|
+
catalogPages(catalogId, options = {}, signal) {
|
|
33
|
+
return this.#transport.requestJson(resolveOperation("list_catalog_pages"), { pathParams: { catalogId }, query: options, signal });
|
|
34
|
+
}
|
|
35
|
+
/** Read a retained page representation or its exact missing-artifact receipt. */
|
|
36
|
+
catalogPageRepresentation(pageId, signal) {
|
|
37
|
+
return this.#transport.requestJson(resolveOperation("get_catalog_page_representation"), { pathParams: { pageId }, signal });
|
|
38
|
+
}
|
|
39
|
+
/** Read every verified product/page reference for one retained catalog. */
|
|
40
|
+
catalogReferences(catalogId, signal) {
|
|
41
|
+
return this.#transport.requestJson(resolveOperation("list_catalog_product_references"), { pathParams: { catalogId }, signal });
|
|
42
|
+
}
|
|
16
43
|
/** Resolve browser-safe access to one immutable catalogue document. */
|
|
17
44
|
catalogueDocumentAccess(documentId, signal) {
|
|
18
45
|
return this.#transport.requestJson(resolveOperation("get_catalogue_document_access"), { pathParams: { documentId }, signal });
|
package/catalogue-types.d.ts
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
/** A verified product location in a specific immutable brand publication. */
|
|
2
2
|
export interface CatalogueReference {
|
|
3
|
+
anchor: {
|
|
4
|
+
coordinateSpace: "normalized_0_1000";
|
|
5
|
+
height: number;
|
|
6
|
+
kind: "printed_code";
|
|
7
|
+
width: number;
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
};
|
|
11
|
+
productRegion?: {
|
|
12
|
+
coordinateSpace: "normalized_0_1000";
|
|
13
|
+
height: number;
|
|
14
|
+
kind: "product_region";
|
|
15
|
+
review: {
|
|
16
|
+
approvedBy: string;
|
|
17
|
+
confidence: {
|
|
18
|
+
evidenceBasis: "human_visual_review" | "model_assisted_visual_review";
|
|
19
|
+
level: "reviewed";
|
|
20
|
+
};
|
|
21
|
+
method: "human" | "model_assisted";
|
|
22
|
+
model?: string;
|
|
23
|
+
reviewedAt: string;
|
|
24
|
+
};
|
|
25
|
+
width: number;
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
};
|
|
3
29
|
variantId: string;
|
|
4
30
|
brand: {
|
|
5
31
|
id: string;
|
|
@@ -35,7 +61,16 @@ export type CatalogueReferenceResult = {
|
|
|
35
61
|
reference: CatalogueReference;
|
|
36
62
|
} | {
|
|
37
63
|
variantId: string;
|
|
38
|
-
status: "no_verified_reference"
|
|
64
|
+
status: "no_verified_reference";
|
|
65
|
+
} | {
|
|
66
|
+
variantId: string;
|
|
67
|
+
status: "unresolved_variant";
|
|
68
|
+
} | {
|
|
69
|
+
variantId: string;
|
|
70
|
+
status: "unavailable";
|
|
71
|
+
} | {
|
|
72
|
+
variantId: string;
|
|
73
|
+
status: "upstream_failure";
|
|
39
74
|
};
|
|
40
75
|
export interface CatalogueReferenceBatchResponse {
|
|
41
76
|
results: CatalogueReferenceResult[];
|
|
@@ -48,6 +83,50 @@ export interface CatalogueReferenceBatchResponse {
|
|
|
48
83
|
upstreamFailure: number;
|
|
49
84
|
};
|
|
50
85
|
}
|
|
86
|
+
/** Bounds for the flat catalogue-channel collection shelf. */
|
|
87
|
+
export interface CatalogueCollectionsOptions {
|
|
88
|
+
limit?: number;
|
|
89
|
+
offset?: number;
|
|
90
|
+
sampleLimit?: number;
|
|
91
|
+
}
|
|
92
|
+
/** One representative product image carried by a catalogue collection. */
|
|
93
|
+
export interface CatalogueCollectionSampleProduct {
|
|
94
|
+
assetId: string;
|
|
95
|
+
imageUrl: string;
|
|
96
|
+
sourceImageUrl: string;
|
|
97
|
+
productId: string;
|
|
98
|
+
productName: string;
|
|
99
|
+
variantId: string;
|
|
100
|
+
variantName: string | null;
|
|
101
|
+
}
|
|
102
|
+
/** A product collection whose variants have governed catalogue membership. */
|
|
103
|
+
export interface CatalogueChannelCollection {
|
|
104
|
+
id: string;
|
|
105
|
+
slug: string;
|
|
106
|
+
name: string;
|
|
107
|
+
homepageUrl: string | null;
|
|
108
|
+
productCount: number;
|
|
109
|
+
variantCount: number;
|
|
110
|
+
sampleProducts: CatalogueCollectionSampleProduct[];
|
|
111
|
+
}
|
|
112
|
+
/** The flat, paginated catalogue-channel collection read model. */
|
|
113
|
+
export interface CatalogueChannelCollectionsResponse {
|
|
114
|
+
collections: CatalogueChannelCollection[];
|
|
115
|
+
channel: {
|
|
116
|
+
token: "catalogue";
|
|
117
|
+
basis: "governed_variant_membership";
|
|
118
|
+
};
|
|
119
|
+
counts: {
|
|
120
|
+
basis: "exact_current_channel_membership";
|
|
121
|
+
};
|
|
122
|
+
pagination: {
|
|
123
|
+
count: number;
|
|
124
|
+
total: number;
|
|
125
|
+
limit: number;
|
|
126
|
+
offset: number;
|
|
127
|
+
hasMore: boolean;
|
|
128
|
+
};
|
|
129
|
+
}
|
|
51
130
|
export interface CatalogueDocumentAccess {
|
|
52
131
|
documentId: string;
|
|
53
132
|
contentType: "application/pdf";
|
|
@@ -61,5 +140,235 @@ export type CatalogueDocumentAccessResult = {
|
|
|
61
140
|
access: CatalogueDocumentAccess;
|
|
62
141
|
} | {
|
|
63
142
|
documentId: string;
|
|
64
|
-
status: "unresolved_document"
|
|
143
|
+
status: "unresolved_document";
|
|
144
|
+
} | {
|
|
145
|
+
documentId: string;
|
|
146
|
+
status: "unavailable";
|
|
147
|
+
} | {
|
|
148
|
+
documentId: string;
|
|
149
|
+
status: "forbidden";
|
|
150
|
+
} | {
|
|
151
|
+
documentId: string;
|
|
152
|
+
status: "upstream_failure";
|
|
153
|
+
};
|
|
154
|
+
export interface CatalogDocument {
|
|
155
|
+
availability: "available";
|
|
156
|
+
brand: {
|
|
157
|
+
id: string;
|
|
158
|
+
name: string;
|
|
159
|
+
};
|
|
160
|
+
document: {
|
|
161
|
+
contentScope: "full_document" | "cover_only";
|
|
162
|
+
id: string;
|
|
163
|
+
mediaType: "application/pdf";
|
|
164
|
+
pageCount: number;
|
|
165
|
+
};
|
|
166
|
+
edition: CatalogEdition;
|
|
167
|
+
id: string;
|
|
168
|
+
kind: "document";
|
|
169
|
+
productStatus: "partial" | "not_processed";
|
|
170
|
+
receipt: CatalogAvailableReceipt;
|
|
171
|
+
title: string;
|
|
172
|
+
}
|
|
173
|
+
export interface CatalogEdition {
|
|
174
|
+
id: string;
|
|
175
|
+
label: string;
|
|
176
|
+
title: string;
|
|
177
|
+
}
|
|
178
|
+
export interface CatalogAvailableReceipt {
|
|
179
|
+
extraction: {
|
|
180
|
+
references: number;
|
|
181
|
+
status: "partial" | "not_processed";
|
|
182
|
+
};
|
|
183
|
+
failures: CatalogFailureReceipt[];
|
|
184
|
+
pages: {
|
|
185
|
+
documentPositionBase: 1;
|
|
186
|
+
pageCount: number;
|
|
187
|
+
};
|
|
188
|
+
render: {
|
|
189
|
+
failedPages: Array<{
|
|
190
|
+
documentPage: number;
|
|
191
|
+
reason: string;
|
|
192
|
+
}>;
|
|
193
|
+
renderedPages: number;
|
|
194
|
+
status: "complete" | "partial" | "not_recorded";
|
|
195
|
+
};
|
|
196
|
+
source: {
|
|
197
|
+
checksum: {
|
|
198
|
+
algorithm: "sha256";
|
|
199
|
+
value: string;
|
|
200
|
+
};
|
|
201
|
+
sourceBasis: "brand_supplied";
|
|
202
|
+
retainedUrl: string;
|
|
203
|
+
status: "retained";
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
export interface CatalogFailureReceipt {
|
|
207
|
+
count: number;
|
|
208
|
+
reason: string;
|
|
209
|
+
stage: "source" | "render" | "extraction";
|
|
210
|
+
}
|
|
211
|
+
export interface UnavailableCatalogDocument {
|
|
212
|
+
availability: "source_unavailable";
|
|
213
|
+
brand: {
|
|
214
|
+
id: string;
|
|
215
|
+
name: string;
|
|
216
|
+
};
|
|
217
|
+
document: null;
|
|
218
|
+
edition: CatalogEdition;
|
|
219
|
+
id: string;
|
|
220
|
+
kind: "document";
|
|
221
|
+
productStatus: "not_processed";
|
|
222
|
+
receipt: {
|
|
223
|
+
extraction: {
|
|
224
|
+
references: 0;
|
|
225
|
+
status: "blocked_source_unavailable";
|
|
226
|
+
};
|
|
227
|
+
failures: CatalogFailureReceipt[];
|
|
228
|
+
pages: {
|
|
229
|
+
documentPositionBase: 1;
|
|
230
|
+
pageCount: null;
|
|
231
|
+
};
|
|
232
|
+
render: {
|
|
233
|
+
failedPages: never[];
|
|
234
|
+
renderedPages: 0;
|
|
235
|
+
status: "blocked_source_unavailable";
|
|
236
|
+
};
|
|
237
|
+
source: {
|
|
238
|
+
reason: "retained_source_not_found";
|
|
239
|
+
status: "unavailable";
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
title: string;
|
|
243
|
+
}
|
|
244
|
+
export type CatalogPublication = CatalogDocument | UnavailableCatalogDocument;
|
|
245
|
+
export interface CatalogDocumentList {
|
|
246
|
+
catalogs: CatalogPublication[];
|
|
247
|
+
source: "verified-source-material-registry";
|
|
248
|
+
}
|
|
249
|
+
export interface CatalogProductReferenceList {
|
|
250
|
+
catalog: CatalogDocument;
|
|
251
|
+
coverage: {
|
|
252
|
+
documentPages: {
|
|
253
|
+
total: number;
|
|
254
|
+
withVerifiedReferences: number;
|
|
255
|
+
};
|
|
256
|
+
pagesWithReferences: number;
|
|
257
|
+
precision: {
|
|
258
|
+
reason: "labelled_denominator_not_recorded";
|
|
259
|
+
status: "not_measured";
|
|
260
|
+
};
|
|
261
|
+
productCoverage: {
|
|
262
|
+
reason: "source_product_denominator_not_recorded";
|
|
263
|
+
status: "not_measured";
|
|
264
|
+
};
|
|
265
|
+
references: number;
|
|
266
|
+
unmatched: {
|
|
267
|
+
reasons: "unmatched_source_products_not_recorded"[];
|
|
268
|
+
status: "not_measured";
|
|
269
|
+
};
|
|
270
|
+
};
|
|
271
|
+
references: CatalogueReference[];
|
|
272
|
+
source: "verified-source-material-registry";
|
|
273
|
+
status: "available";
|
|
274
|
+
}
|
|
275
|
+
export interface CatalogProductReferenceUnavailable {
|
|
276
|
+
catalog: UnavailableCatalogDocument;
|
|
277
|
+
reason: "retained_source_not_found";
|
|
278
|
+
status: "source_unavailable";
|
|
279
|
+
}
|
|
280
|
+
export type CatalogProductReferenceReadResult = CatalogProductReferenceList | CatalogProductReferenceUnavailable;
|
|
281
|
+
export interface CataloguePageRequiredArtifact {
|
|
282
|
+
mediaType: "image/webp";
|
|
283
|
+
version: "catalogue-page-webp-v1";
|
|
284
|
+
}
|
|
285
|
+
export interface CataloguePageAvailableArtifact extends Omit<CataloguePageRequiredArtifact, "version"> {
|
|
286
|
+
bucket: "materialgraph";
|
|
287
|
+
key: string;
|
|
288
|
+
url: string;
|
|
289
|
+
}
|
|
290
|
+
export type CataloguePage = {
|
|
291
|
+
catalogId: string;
|
|
292
|
+
documentId: string;
|
|
293
|
+
editionId: string;
|
|
294
|
+
id: string;
|
|
295
|
+
original: {
|
|
296
|
+
documentId: string;
|
|
297
|
+
documentPage: number;
|
|
298
|
+
};
|
|
299
|
+
page: {
|
|
300
|
+
documentPage: number;
|
|
301
|
+
printedPageLabel?: string;
|
|
302
|
+
};
|
|
303
|
+
representation: {
|
|
304
|
+
artifact: CataloguePageAvailableArtifact;
|
|
305
|
+
status: "available";
|
|
306
|
+
};
|
|
307
|
+
} | {
|
|
308
|
+
catalogId: string;
|
|
309
|
+
documentId: string;
|
|
310
|
+
editionId: string;
|
|
311
|
+
id: string;
|
|
312
|
+
original: {
|
|
313
|
+
documentId: string;
|
|
314
|
+
documentPage: number;
|
|
315
|
+
};
|
|
316
|
+
page: {
|
|
317
|
+
documentPage: number;
|
|
318
|
+
printedPageLabel?: string;
|
|
319
|
+
};
|
|
320
|
+
representation: {
|
|
321
|
+
requiredArtifact: CataloguePageRequiredArtifact;
|
|
322
|
+
reason: "retained_representation_not_found";
|
|
323
|
+
status: "unavailable";
|
|
324
|
+
};
|
|
325
|
+
};
|
|
326
|
+
type CataloguePageAvailable = Extract<CataloguePage, {
|
|
327
|
+
representation: {
|
|
328
|
+
status: "available";
|
|
329
|
+
};
|
|
330
|
+
}>;
|
|
331
|
+
type CataloguePageUnavailable = Extract<CataloguePage, {
|
|
332
|
+
representation: {
|
|
333
|
+
status: "unavailable";
|
|
334
|
+
};
|
|
335
|
+
}>;
|
|
336
|
+
export type CatalogPageListResult = {
|
|
337
|
+
catalog: CatalogDocument;
|
|
338
|
+
pages: CataloguePage[];
|
|
339
|
+
pagination: {
|
|
340
|
+
count: number;
|
|
341
|
+
hasMore: boolean;
|
|
342
|
+
limit: number;
|
|
343
|
+
offset: number;
|
|
344
|
+
total: number;
|
|
345
|
+
};
|
|
346
|
+
representationCoverage: {
|
|
347
|
+
available: number;
|
|
348
|
+
failuresByReason: Array<{
|
|
349
|
+
count: number;
|
|
350
|
+
reason: "retained_representation_not_found";
|
|
351
|
+
}>;
|
|
352
|
+
total: number;
|
|
353
|
+
unavailable: number;
|
|
354
|
+
};
|
|
355
|
+
status: "available";
|
|
356
|
+
} | {
|
|
357
|
+
catalog: UnavailableCatalogDocument;
|
|
358
|
+
reason: "retained_source_not_found";
|
|
359
|
+
status: "source_unavailable";
|
|
360
|
+
};
|
|
361
|
+
export type CataloguePageRepresentationReadResult = {
|
|
362
|
+
artifact: CataloguePageAvailableArtifact;
|
|
363
|
+
page: CataloguePageAvailable;
|
|
364
|
+
status: "available";
|
|
365
|
+
} | {
|
|
366
|
+
requiredArtifact: CataloguePageRequiredArtifact;
|
|
367
|
+
page: CataloguePageUnavailable;
|
|
368
|
+
reason: "retained_representation_not_found";
|
|
369
|
+
status: "unavailable";
|
|
370
|
+
} | {
|
|
371
|
+
pageId: string;
|
|
372
|
+
status: "unresolved_page";
|
|
65
373
|
};
|
|
374
|
+
export {};
|
package/client.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export type { BrowseNamespace } from "./client-browse.js";
|
|
|
8
8
|
export type { ExplorationNamespace } from "./client-exploration.js";
|
|
9
9
|
import { type SourceMaterialCommentsNamespace } from "./client-source-material-comments.js";
|
|
10
10
|
export type { SourceMaterialCommentsNamespace } from "./client-source-material-comments.js";
|
|
11
|
-
import type { AssociatedOptions } from "./association-types.js";
|
|
11
|
+
import type { ApplicabilityOptions, AssociatedOptions } from "./association-types.js";
|
|
12
12
|
import type { BrandsOptions } from "./brand-types.js";
|
|
13
13
|
import type { ByColourParams, ByColourResponse } from "./by-colour-types.js";
|
|
14
14
|
import { CodesClient } from "./codes-client.js";
|
|
@@ -18,8 +18,7 @@ import type { VarySchemesRequest, VarySchemesResponse } from "./composition-type
|
|
|
18
18
|
import type { BatchId, ProjectId, RunId, VariantId } from "./identifiers.js";
|
|
19
19
|
import type { MatchStreamEvent } from "./match-stream-types.js";
|
|
20
20
|
import type { MatchInput, MatchResponse } from "./match-types.js";
|
|
21
|
-
import type {
|
|
22
|
-
import type { MaterialBlockProjection } from "./material-block-types.js";
|
|
21
|
+
import type { MaterialDocumentPageOptions } from "./material-asset-types.js";
|
|
23
22
|
import type { MaterialQueryPlan } from "./material-query-plan-types.js";
|
|
24
23
|
import type { AppendProjectEventRequest, CreateProjectRequest, ProjectEventReceipt, ProjectListResponse, ProjectState } from "./project-types.js";
|
|
25
24
|
import { resolvePhrasesRequest as resolvePhrases } from "./resolve-client.js";
|
|
@@ -217,20 +216,9 @@ export declare class MaterialGraphClient extends CatalogueClient {
|
|
|
217
216
|
* goes with this one, and `search({ similarTo })` for one that LOOKS like it.
|
|
218
217
|
*/
|
|
219
218
|
siblings(variantId: VariantId, signal?: AbortSignal): Promise<SiblingsResponse>;
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
* from an unasked question — every field carries a `status`, so this is the one
|
|
224
|
-
* surface entitled to back a negative ("no fire rating").
|
|
225
|
-
* {@link MaterialGraphClient.material} cannot: there an absence is merely unknown.
|
|
226
|
-
*/
|
|
227
|
-
materialBlocks(variantId: VariantId, signal?: AbortSignal): Promise<MaterialBlockProjection>;
|
|
228
|
-
/**
|
|
229
|
-
* THE QUESTION: "what images and documents may I SHOW for this material?" — the
|
|
230
|
-
* redistribution-safe set (GET `/api/v1/materials/{variantId}/assets`), not
|
|
231
|
-
* every file on record.
|
|
232
|
-
*/
|
|
233
|
-
materialAssets(variantId: VariantId, signal?: AbortSignal): Promise<MaterialAssetProjection>;
|
|
219
|
+
materialBlocks(variantId: VariantId, signal?: AbortSignal): Promise<import("./material-block-types.js").MaterialBlockProjection>;
|
|
220
|
+
materialAssets(variantId: VariantId, signal?: AbortSignal): Promise<import("./material-asset-types.js").MaterialAssetProjection>;
|
|
221
|
+
materialDocuments(variantId: VariantId, options?: MaterialDocumentPageOptions, signal?: AbortSignal): Promise<import("./material-asset-types.js").MaterialDocumentPage>;
|
|
234
222
|
/**
|
|
235
223
|
* THE QUESTION: "what does the schema DEFINE?" — the governed static registry.
|
|
236
224
|
*
|
|
@@ -258,6 +246,7 @@ export declare class MaterialGraphClient extends CatalogueClient {
|
|
|
258
246
|
associatedFinishes(variantId: VariantId, options?: AssociatedOptions, signal?: AbortSignal): Promise<import("./association-types.js").DeclaredAssociationsResponse>;
|
|
259
247
|
/** "What products does the manufacturer declare THIS finish for?" — {@link declaredProducts}. */
|
|
260
248
|
associatedProducts(variantId: VariantId, options?: AssociatedOptions, signal?: AbortSignal): Promise<import("./association-types.js").DeclaredAssociationsResponse>;
|
|
249
|
+
applicability(options: ApplicabilityOptions, signal?: AbortSignal): Promise<import("./association-types.js").ApplicabilityResponse>;
|
|
261
250
|
/**
|
|
262
251
|
* THE QUESTION: "hydrate these ids I already hold" (POST
|
|
263
252
|
* `/api/v1/materials/batch`, ≤ 100 ids) — never a discovery call. Throws
|
package/client.js
CHANGED
|
@@ -10,13 +10,14 @@ export * from "./client-config.js";
|
|
|
10
10
|
import { browseQuery, createBrowseNamespace, } from "./client-browse.js";
|
|
11
11
|
import { createExplorationNamespace, } from "./client-exploration.js";
|
|
12
12
|
import { createSourceMaterialCommentsNamespace, } from "./client-source-material-comments.js";
|
|
13
|
-
import
|
|
13
|
+
import * as assoc from "./associations-client.js";
|
|
14
14
|
import { brandColourDeck, brandProfile, listBrands } from "./brands-client.js";
|
|
15
15
|
import { CodesClient } from "./codes-client.js";
|
|
16
16
|
import { ColoursClient } from "./colours-client.js";
|
|
17
17
|
import { slotPools as slotPoolsCall, varyScheme as varySchemeCall, } from "./composition-client.js";
|
|
18
18
|
import { coordinate as coordinateCall } from "./coordinate-client.js";
|
|
19
19
|
import { matchStream as matchStreamCall } from "./match-stream.js";
|
|
20
|
+
import { materialAssets as materialAssetsCall, materialBlocks as materialBlocksCall, materialDocuments as materialDocumentsCall, } from "./material-resources-client.js";
|
|
20
21
|
import { appendProjectEvent as appendProjectEventCall, createProject as createProjectCall, getProject as getProjectCall, listProjects as listProjectsCall, } from "./projects.js";
|
|
21
22
|
import { resolvePhrasesRequest as resolvePhrases, searchVocabularyRequest, } from "./resolve-client.js";
|
|
22
23
|
import { SCHEMA_RESOURCE_OPERATION_IDS } from "./schema-resource-types.js";
|
|
@@ -275,27 +276,14 @@ export class MaterialGraphClient extends CatalogueClient {
|
|
|
275
276
|
siblings(variantId, signal) {
|
|
276
277
|
return this.#get("get_material_siblings", undefined, signal, { variantId });
|
|
277
278
|
}
|
|
278
|
-
/**
|
|
279
|
-
* THE QUESTION: "what do we actually KNOW about this material, and what have we
|
|
280
|
-
* simply not checked?" The only read that distinguishes a determined absence
|
|
281
|
-
* from an unasked question — every field carries a `status`, so this is the one
|
|
282
|
-
* surface entitled to back a negative ("no fire rating").
|
|
283
|
-
* {@link MaterialGraphClient.material} cannot: there an absence is merely unknown.
|
|
284
|
-
*/
|
|
285
279
|
materialBlocks(variantId, signal) {
|
|
286
|
-
return this.#
|
|
287
|
-
variantId,
|
|
288
|
-
});
|
|
280
|
+
return materialBlocksCall(this.#transport, variantId, signal);
|
|
289
281
|
}
|
|
290
|
-
/**
|
|
291
|
-
* THE QUESTION: "what images and documents may I SHOW for this material?" — the
|
|
292
|
-
* redistribution-safe set (GET `/api/v1/materials/{variantId}/assets`), not
|
|
293
|
-
* every file on record.
|
|
294
|
-
*/
|
|
295
282
|
materialAssets(variantId, signal) {
|
|
296
|
-
return this.#
|
|
297
|
-
|
|
298
|
-
|
|
283
|
+
return materialAssetsCall(this.#transport, variantId, signal);
|
|
284
|
+
}
|
|
285
|
+
materialDocuments(variantId, options, signal) {
|
|
286
|
+
return materialDocumentsCall(this.#transport, variantId, options, signal);
|
|
299
287
|
}
|
|
300
288
|
/**
|
|
301
289
|
* THE QUESTION: "what does the schema DEFINE?" — the governed static registry.
|
|
@@ -328,11 +316,14 @@ export class MaterialGraphClient extends CatalogueClient {
|
|
|
328
316
|
}
|
|
329
317
|
/** "What finishes does the manufacturer declare for THIS product?" — {@link declaredFinishes}. */
|
|
330
318
|
associatedFinishes(variantId, options, signal) {
|
|
331
|
-
return declaredFinishes(this.#transport, variantId, options, signal);
|
|
319
|
+
return assoc.declaredFinishes(this.#transport, variantId, options, signal);
|
|
332
320
|
}
|
|
333
321
|
/** "What products does the manufacturer declare THIS finish for?" — {@link declaredProducts}. */
|
|
334
322
|
associatedProducts(variantId, options, signal) {
|
|
335
|
-
return declaredProducts(this.#transport, variantId, options, signal);
|
|
323
|
+
return assoc.declaredProducts(this.#transport, variantId, options, signal);
|
|
324
|
+
}
|
|
325
|
+
applicability(options, signal) {
|
|
326
|
+
return assoc.applicability(this.#transport, options, signal);
|
|
336
327
|
}
|
|
337
328
|
materials(ids, options, signal) {
|
|
338
329
|
if (ids.length > MAX_BATCH_IDS) {
|
package/corpus-scope-types.d.ts
CHANGED
|
@@ -29,19 +29,21 @@ import { type OpenEnum } from "./types.js";
|
|
|
29
29
|
* `"all"` (and absence) is the WHOLE GRAPH — every material MaterialGraph
|
|
30
30
|
* knows, orderable or not. Absence is never a narrower default.
|
|
31
31
|
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
32
|
+
* Four members gate on governed CHANNEL membership:
|
|
33
|
+
* `"materialBankNaOrderable"` (Material Bank North America),
|
|
34
34
|
* `"materialBankEuOrderable"` (Material Bank Europe) and
|
|
35
35
|
* `"designShopOrderable"` (DesignShop, with the products DesignShop hides from
|
|
36
36
|
* browse excluded).
|
|
37
|
+
* `"materialBankNaAndCatalogue"` is a single producer-side union of Material
|
|
38
|
+
* Bank North America and governed Catalogue channel membership.
|
|
37
39
|
*
|
|
38
40
|
* `"materialBankOrderable"` is NOT one of them, despite the name. It selects
|
|
39
41
|
* materials carrying a Material Bank identity — PROVENANCE, not a storefront —
|
|
40
42
|
* and admits about 98% of the graph. Use it to exclude the crawl-sourced brands
|
|
41
43
|
* that were never in the Material Bank feed; if you mean orderable, use one of
|
|
42
|
-
* the
|
|
44
|
+
* the channel-backed scopes above.
|
|
43
45
|
*/
|
|
44
|
-
export type CorpusScope = OpenEnum<"all" | "designShopOrderable" | "materialBankEuOrderable" | "materialBankNaOrderable" | "materialBankOrderable">;
|
|
46
|
+
export type CorpusScope = OpenEnum<"all" | "designShopOrderable" | "materialBankEuOrderable" | "materialBankNaAndCatalogue" | "materialBankNaOrderable" | "materialBankOrderable">;
|
|
45
47
|
/**
|
|
46
48
|
* The corpus a response AND its counts were drawn from. Present only when a
|
|
47
49
|
* narrowing scope applied — absence means the whole graph. Read it alongside
|
package/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export type * from "./run-events.js";
|
|
|
17
17
|
export { MATERIALGRAPH_PROBLEM_EXTENSIONS, MaterialGraphError, } from "./errors.js";
|
|
18
18
|
export type { MaterialGraphErrorInit, MaterialGraphErrorKind, MaterialGraphRequestMetadata, ProblemDetail, RateLimit, SanitizedErrorValue, SanitizedIssue, SimpleErrorBody, } from "./errors.js";
|
|
19
19
|
export type * from "./types.js";
|
|
20
|
+
export type * from "./search-collapse-types.js";
|
|
20
21
|
export type * from "./match-types.js";
|
|
21
22
|
export type * from "./browse-types.js";
|
|
22
23
|
export type * from "./catalogue-types.js";
|