@instruments/materialgraph 0.17.0 → 0.19.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 +90 -4
- package/associations-client.d.ts +3 -1
- package/associations-client.js +4 -0
- package/browse-types.d.ts +14 -3
- package/by-colour-types.d.ts +24 -6
- package/by-spec-types.d.ts +4 -0
- package/catalogue-client.d.ts +14 -2
- package/catalogue-client.js +23 -0
- package/catalogue-types.d.ts +278 -4
- package/citation-types.d.ts +34 -0
- package/citation-types.js +1 -0
- package/client-browse.d.ts +1 -0
- package/client-browse.js +1 -0
- package/client-vocabulary.d.ts +10 -0
- package/client-vocabulary.js +32 -0
- package/client.d.ts +28 -62
- package/client.js +51 -75
- package/composition-types.d.ts +6 -0
- package/corpus-scope-types.d.ts +6 -4
- package/errors.d.ts +1 -1
- package/errors.js +2 -0
- package/index.d.ts +6 -0
- package/json-value-types.d.ts +8 -0
- package/json-value-types.js +1 -0
- package/match-types.d.ts +3 -0
- package/material-asset-types.d.ts +71 -0
- package/material-resources-client.d.ts +18 -0
- package/material-resources-client.js +29 -0
- package/material-types.d.ts +59 -0
- package/operations.d.ts +1 -1
- package/operations.js +62 -0
- package/package.json +1 -1
- package/palette-search-types.d.ts +16 -2
- package/query-understanding-types.d.ts +5 -2
- package/render-assets-types.d.ts +65 -0
- package/render-assets-types.js +1 -0
- package/run-events.d.ts +13 -0
- package/samplize-catalogue-types.d.ts +92 -0
- package/samplize-catalogue-types.js +1 -0
- package/schedule-reference-types.d.ts +46 -0
- package/schedule-reference-types.js +1 -0
- package/schedule-references-client.d.ts +14 -0
- package/schedule-references-client.js +26 -0
- package/schedule-types.d.ts +34 -0
- package/search-collapse-types.d.ts +1 -1
- package/search-mood-types.d.ts +6 -0
- package/search-mood-types.js +1 -0
- package/search-refinement-types.d.ts +5 -0
- package/search-request-types.d.ts +29 -11
- package/search-response-receipt-types.d.ts +59 -3
- package/search-result-validation.js +14 -1
- package/search-window-types.d.ts +13 -5
- package/slot-pool-types.d.ts +2 -0
- package/spec-types.d.ts +6 -1
- package/specifications.d.ts +3 -1
- package/specifications.js +4 -0
- package/substitute-types.d.ts +75 -0
- package/substitute-types.js +1 -0
- package/suggest-types.d.ts +6 -0
- package/suggest-types.js +1 -1
- package/taxonomy-coverage-types.d.ts +34 -0
- package/taxonomy-coverage-types.js +1 -0
- package/types.d.ts +20 -21
package/operations.js
CHANGED
|
@@ -1,7 +1,31 @@
|
|
|
1
1
|
import { MaterialGraphError } from "./errors.js";
|
|
2
2
|
export const MATERIALGRAPH_API_VERSION = "0.7.0";
|
|
3
3
|
const OPERATION_DEFINITIONS = [
|
|
4
|
+
[
|
|
5
|
+
"scheduleReferences.list",
|
|
6
|
+
"GET",
|
|
7
|
+
"/api/v1/schedules/{scheduleId}/references",
|
|
8
|
+
"list_schedule_reference_feedback",
|
|
9
|
+
],
|
|
10
|
+
[
|
|
11
|
+
"scheduleReferences.put",
|
|
12
|
+
"PUT",
|
|
13
|
+
"/api/v1/schedules/{scheduleId}/references/{referenceId}",
|
|
14
|
+
"put_schedule_reference_feedback",
|
|
15
|
+
],
|
|
4
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
|
+
],
|
|
5
29
|
[
|
|
6
30
|
"catalogReferences",
|
|
7
31
|
"GET",
|
|
@@ -10,6 +34,12 @@ const OPERATION_DEFINITIONS = [
|
|
|
10
34
|
],
|
|
11
35
|
["search", "POST", "/api/v1/search", "search_materials_post"],
|
|
12
36
|
["planQuery", "POST", "/api/v1/search/plan", "plan_material_query"],
|
|
37
|
+
[
|
|
38
|
+
"samplizeCatalogue",
|
|
39
|
+
"GET",
|
|
40
|
+
"/api/v1/catalogues/samplize/products",
|
|
41
|
+
"samplize_catalogue_products",
|
|
42
|
+
],
|
|
13
43
|
["searchGet", "GET", "/api/v1/search", "search_materials_get"],
|
|
14
44
|
["match", "POST", "/api/v1/search/match", "match_material"],
|
|
15
45
|
["byColour", "GET", "/api/v1/search/colours", "search_by_colour"],
|
|
@@ -20,6 +50,12 @@ const OPERATION_DEFINITIONS = [
|
|
|
20
50
|
"/api/v1/catalogues/references",
|
|
21
51
|
"get_catalogue_references_batch",
|
|
22
52
|
],
|
|
53
|
+
[
|
|
54
|
+
"catalogueCollections",
|
|
55
|
+
"GET",
|
|
56
|
+
"/api/v1/catalogues/collections",
|
|
57
|
+
"list_catalogue_channel_collections",
|
|
58
|
+
],
|
|
23
59
|
[
|
|
24
60
|
"catalogueDocumentAccess",
|
|
25
61
|
"GET",
|
|
@@ -44,6 +80,18 @@ const OPERATION_DEFINITIONS = [
|
|
|
44
80
|
"/api/v1/materials/{variantId}/assets",
|
|
45
81
|
"list_material_assets",
|
|
46
82
|
],
|
|
83
|
+
[
|
|
84
|
+
"materialRenderAssets",
|
|
85
|
+
"GET",
|
|
86
|
+
"/api/v1/materials/{variantId}/render-assets",
|
|
87
|
+
"get_material_render_assets",
|
|
88
|
+
],
|
|
89
|
+
[
|
|
90
|
+
"materialDocuments",
|
|
91
|
+
"GET",
|
|
92
|
+
"/api/v1/materials/{variantId}/documents",
|
|
93
|
+
"list_material_documents",
|
|
94
|
+
],
|
|
47
95
|
[
|
|
48
96
|
"exploration.operators",
|
|
49
97
|
"GET",
|
|
@@ -91,6 +139,12 @@ const OPERATION_DEFINITIONS = [
|
|
|
91
139
|
"/api/v1/materials/{variantId}/pairings",
|
|
92
140
|
"get_material_pairings",
|
|
93
141
|
],
|
|
142
|
+
[
|
|
143
|
+
"findSubstitutes",
|
|
144
|
+
"POST",
|
|
145
|
+
"/api/v1/materials/{variantId}/substitutes",
|
|
146
|
+
"find_material_substitutes",
|
|
147
|
+
],
|
|
94
148
|
[
|
|
95
149
|
"associatedFinishes",
|
|
96
150
|
"GET",
|
|
@@ -103,6 +157,7 @@ const OPERATION_DEFINITIONS = [
|
|
|
103
157
|
"/api/v1/associated/products",
|
|
104
158
|
"list_associated_products",
|
|
105
159
|
],
|
|
160
|
+
["applicability", "GET", "/api/v1/applicability", "get_applicability"],
|
|
106
161
|
["materials", "POST", "/api/v1/materials/batch", "get_materials_batch_post"],
|
|
107
162
|
[
|
|
108
163
|
"materialsCached",
|
|
@@ -153,6 +208,12 @@ const OPERATION_DEFINITIONS = [
|
|
|
153
208
|
["resolve", "POST", "/api/v1/resolve", "resolve_phrases"],
|
|
154
209
|
["bySpec", "GET", "/api/v1/search/specifications", "catalog_by_spec"],
|
|
155
210
|
["taxonomy", "GET", "/api/v1/taxonomy/categories", "get_category_taxonomy"],
|
|
211
|
+
[
|
|
212
|
+
"productTypeCoverage",
|
|
213
|
+
"GET",
|
|
214
|
+
"/api/v1/taxonomy/coverage",
|
|
215
|
+
"get_product_type_status_coverage",
|
|
216
|
+
],
|
|
156
217
|
["whoami", "GET", "/api/v1/whoami", "whoami"],
|
|
157
218
|
["coordinate", "POST", "/api/v1/pairings/coordinate", "coordinate_materials"],
|
|
158
219
|
["demand", "GET", "/api/v1/demand", "get_material_demand"],
|
|
@@ -230,6 +291,7 @@ const OPERATION_DEFINITIONS = [
|
|
|
230
291
|
"/api/v1/runs/{runId}/schedule",
|
|
231
292
|
"get_run_finish_schedule",
|
|
232
293
|
],
|
|
294
|
+
["citation", "GET", "/api/v1/citations/{citationId}", "get_verdict_citation"],
|
|
233
295
|
[
|
|
234
296
|
"streamRunEvents",
|
|
235
297
|
"GET",
|
package/package.json
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CorpusScope, CorpusScopeReceipt } from "./corpus-scope-types.js";
|
|
1
2
|
/**
|
|
2
3
|
* Wire types for MULTI-COLOUR search — `POST /api/v1/search/palettes` and
|
|
3
4
|
* `POST /api/v1/search/gradients`.
|
|
@@ -34,6 +35,7 @@ export interface GradientStop {
|
|
|
34
35
|
oklab?: OklabTriple;
|
|
35
36
|
}
|
|
36
37
|
export interface SearchPaletteInput {
|
|
38
|
+
corpusScope?: CorpusScope;
|
|
37
39
|
/** The palette to match, 1–8 colours. */
|
|
38
40
|
colours: PaletteQueryColour[];
|
|
39
41
|
/**
|
|
@@ -46,14 +48,15 @@ export interface SearchPaletteInput {
|
|
|
46
48
|
limit?: number;
|
|
47
49
|
}
|
|
48
50
|
export interface SearchGradientInput {
|
|
51
|
+
corpusScope?: CorpusScope;
|
|
49
52
|
/** The ordered colour transition, 2–6 stops. */
|
|
50
53
|
stops: GradientStop[];
|
|
51
54
|
/** Results to return; defaults to 24, capped at 48. */
|
|
52
55
|
limit?: number;
|
|
53
56
|
}
|
|
54
57
|
/**
|
|
55
|
-
* One swatch
|
|
56
|
-
*
|
|
58
|
+
* One swatch used for scoring. Samplize paint uses its selected published hex;
|
|
59
|
+
* other materials use colorscope palettes extracted from imagery. `name` is null when no human
|
|
57
60
|
* name was resolved — unnamed, not colourless.
|
|
58
61
|
*/
|
|
59
62
|
export interface CandidateSwatch {
|
|
@@ -140,14 +143,24 @@ export interface HueGateReceipt {
|
|
|
140
143
|
* materials match this palette" is not a claim you can make from it.
|
|
141
144
|
*/
|
|
142
145
|
export interface SearchPaletteResponse {
|
|
146
|
+
corpusScope?: CorpusScopeReceipt;
|
|
143
147
|
/** The query as interpreted — check it before trusting a surprising order. */
|
|
144
148
|
query: {
|
|
149
|
+
/** Colours that actually ran after minor stated shares were omitted. */
|
|
145
150
|
colours: Array<{
|
|
146
151
|
hex: string;
|
|
147
152
|
proportion?: number;
|
|
148
153
|
weight?: number;
|
|
149
154
|
}>;
|
|
155
|
+
/** Colours not searched because their stated share was below 5%. */
|
|
156
|
+
droppedColours: Array<{
|
|
157
|
+
hex: string;
|
|
158
|
+
proportion?: number;
|
|
159
|
+
weight?: number;
|
|
160
|
+
}>;
|
|
150
161
|
logic: PaletteLogic;
|
|
162
|
+
/** `no_effective_colours` means no material query ran. */
|
|
163
|
+
outcome: OpenEnum<"matches" | "no_effective_colours">;
|
|
151
164
|
};
|
|
152
165
|
/** The hue-family admission gate this page was scored under. */
|
|
153
166
|
hueGate: HueGateReceipt;
|
|
@@ -157,6 +170,7 @@ export interface SearchPaletteResponse {
|
|
|
157
170
|
}
|
|
158
171
|
/** A PAGE, NOT A CORPUS — see {@link SearchPaletteResponse}. */
|
|
159
172
|
export interface SearchGradientResponse {
|
|
173
|
+
corpusScope?: CorpusScopeReceipt;
|
|
160
174
|
query: {
|
|
161
175
|
stops: string[];
|
|
162
176
|
/** The sampled path points the search actually ran against. */
|
|
@@ -63,7 +63,7 @@ export interface CanonicalLexicalReading {
|
|
|
63
63
|
export interface CanonicalLexicalMatch {
|
|
64
64
|
original: string;
|
|
65
65
|
canonical: string;
|
|
66
|
-
rule: OpenEnum<"exact" | "plural-to-singular">;
|
|
66
|
+
rule: OpenEnum<"exact" | "plural-to-singular" | "typo-to-canonical">;
|
|
67
67
|
span: {
|
|
68
68
|
start: number;
|
|
69
69
|
end: number;
|
|
@@ -73,7 +73,7 @@ export interface CanonicalLexicalMatch {
|
|
|
73
73
|
receipt: {
|
|
74
74
|
original: string;
|
|
75
75
|
canonical: string;
|
|
76
|
-
rule: OpenEnum<"exact" | "plural-to-singular">;
|
|
76
|
+
rule: OpenEnum<"exact" | "plural-to-singular" | "typo-to-canonical">;
|
|
77
77
|
authorities: CanonicalLexicalAuthorityReceipt[];
|
|
78
78
|
};
|
|
79
79
|
}
|
|
@@ -158,6 +158,7 @@ export interface QueryProductTypeReceipt {
|
|
|
158
158
|
export interface QueryArmReceipt {
|
|
159
159
|
arm: OpenEnum<"dense" | "lexical" | "colour"> | null;
|
|
160
160
|
reason: string;
|
|
161
|
+
reasonDetail?: OpenEnum<"derived-colour-veto" | "typo-recovery" | "literal-compound-without-type">;
|
|
161
162
|
outcome: OpenEnum<"dense" | "lexical" | "colour" | "browse" | "criteria-only" | "ambiguous">;
|
|
162
163
|
decidedBy: OpenEnum<"deterministic" | "model">;
|
|
163
164
|
productTypeGate: OpenEnum<"hard" | "constrain" | "none">;
|
|
@@ -189,8 +190,10 @@ export interface QueryCategoryScopeReceipt {
|
|
|
189
190
|
export interface QuerySpecAllowlistReceipt {
|
|
190
191
|
limit: number;
|
|
191
192
|
returned: number;
|
|
193
|
+
retrieved?: number;
|
|
192
194
|
truncated: boolean;
|
|
193
195
|
emptyMeansScarcity: boolean;
|
|
196
|
+
outcome?: OpenEnum<"corpus-scarcity" | "retrieval-miss" | "unknown">;
|
|
194
197
|
}
|
|
195
198
|
export interface QueryUnsatisfiableNarrowing {
|
|
196
199
|
narrowing: OpenEnum<"product-type">;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { VariantId } from "./identifiers.js";
|
|
2
|
+
export type RenderAssetChannelRole = "base-color" | "normal" | "roughness" | "metalness" | "height" | "ambient-occlusion";
|
|
3
|
+
export type RenderAssetSourceBasis = "catalog_feed" | "declared" | "derived";
|
|
4
|
+
export type RenderAssetUnavailableReason = "no_accepted_appearance" | "pending" | "withheld" | "rejected" | "superseded" | "variant_inactive" | "delivery_unverified" | "integrity_error";
|
|
5
|
+
export interface RenderAssetFreshness {
|
|
6
|
+
revision: string;
|
|
7
|
+
updatedAt: string | null;
|
|
8
|
+
checkedAt: string | null;
|
|
9
|
+
}
|
|
10
|
+
export interface RenderAssetChannel {
|
|
11
|
+
role: RenderAssetChannelRole;
|
|
12
|
+
url: string;
|
|
13
|
+
sha256: string;
|
|
14
|
+
byteSize: number;
|
|
15
|
+
mimeType: "image/png";
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
bitDepth: 8 | 16;
|
|
19
|
+
colorSpace: "srgb" | "linear";
|
|
20
|
+
}
|
|
21
|
+
export interface MaterialRenderAssetsAvailable {
|
|
22
|
+
schemaVersion: "pbr-render-assets/v1";
|
|
23
|
+
variantId: VariantId;
|
|
24
|
+
status: "available";
|
|
25
|
+
setId: string;
|
|
26
|
+
state: "accepted";
|
|
27
|
+
sourceBasis: "derived";
|
|
28
|
+
fidelity: "unassessed";
|
|
29
|
+
acceptance: {
|
|
30
|
+
id: string;
|
|
31
|
+
verificationDecisionId: string;
|
|
32
|
+
acceptedAt: string;
|
|
33
|
+
checkVersion: string;
|
|
34
|
+
qa: {
|
|
35
|
+
status: "passed";
|
|
36
|
+
checkCount: number;
|
|
37
|
+
};
|
|
38
|
+
checkCount: number;
|
|
39
|
+
};
|
|
40
|
+
physicalRepeat: {
|
|
41
|
+
uMm: number;
|
|
42
|
+
vMm: number;
|
|
43
|
+
basis: "declared" | "measured";
|
|
44
|
+
};
|
|
45
|
+
tiling: {
|
|
46
|
+
u: boolean;
|
|
47
|
+
v: boolean;
|
|
48
|
+
};
|
|
49
|
+
normalConvention: "opengl" | "directx";
|
|
50
|
+
heightAmplitudeMm?: number;
|
|
51
|
+
channels: RenderAssetChannel[];
|
|
52
|
+
supersedesSetIds: string[];
|
|
53
|
+
freshness: RenderAssetFreshness;
|
|
54
|
+
}
|
|
55
|
+
export interface MaterialRenderAssetsUnavailable {
|
|
56
|
+
schemaVersion: "pbr-render-assets/v1";
|
|
57
|
+
variantId: VariantId;
|
|
58
|
+
status: "unavailable";
|
|
59
|
+
setId: string | null;
|
|
60
|
+
state: "pending" | "withheld" | "rejected" | "superseded" | "accepted" | null;
|
|
61
|
+
sourceBasis: RenderAssetSourceBasis | null;
|
|
62
|
+
reasonCodes: RenderAssetUnavailableReason[];
|
|
63
|
+
freshness: RenderAssetFreshness;
|
|
64
|
+
}
|
|
65
|
+
export type MaterialRenderAssets = MaterialRenderAssetsAvailable | MaterialRenderAssetsUnavailable;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/run-events.d.ts
CHANGED
|
@@ -47,9 +47,22 @@ export interface CompositionReviewCriteriaSuggestion {
|
|
|
47
47
|
term?: string;
|
|
48
48
|
score: number;
|
|
49
49
|
}
|
|
50
|
+
/** Exact UTF-16 passage retained from the brief; no page coordinate is implied. */
|
|
51
|
+
export interface CompositionBriefCriterionSourceRef {
|
|
52
|
+
sourceId: string;
|
|
53
|
+
quote: string;
|
|
54
|
+
textRange: {
|
|
55
|
+
start: number;
|
|
56
|
+
end: number;
|
|
57
|
+
unit: "utf16";
|
|
58
|
+
};
|
|
59
|
+
}
|
|
50
60
|
export interface CompositionReviewCriteriaUnresolved {
|
|
51
61
|
slotId: string;
|
|
62
|
+
/** Unresolved negative language requires an explicit review decision. */
|
|
63
|
+
polarity?: "exclusion";
|
|
52
64
|
raw: string;
|
|
65
|
+
sourceRefs?: CompositionBriefCriterionSourceRef[];
|
|
53
66
|
/**
|
|
54
67
|
* Ranked corrections, best first. MG-994: every one of these is an attribute
|
|
55
68
|
* the slot's own category holds accepted values for, so accepting the top
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
export interface SamplizeCatalogueOptions {
|
|
2
|
+
limit?: number;
|
|
3
|
+
after?: string;
|
|
4
|
+
/** Pin every subsequent page to the version returned by the first page. */
|
|
5
|
+
sourceVersion?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface SamplizeCatalogueProduct {
|
|
8
|
+
variantId: string;
|
|
9
|
+
productId: string;
|
|
10
|
+
name: string;
|
|
11
|
+
code: string;
|
|
12
|
+
brand: {
|
|
13
|
+
slug: string;
|
|
14
|
+
name: string;
|
|
15
|
+
};
|
|
16
|
+
hex: string;
|
|
17
|
+
hexSource: {
|
|
18
|
+
publisher: "Samplize";
|
|
19
|
+
url: string;
|
|
20
|
+
source: "snowflake_product_tags";
|
|
21
|
+
};
|
|
22
|
+
lrv: number | null;
|
|
23
|
+
lrvSource: SamplizeLrvObservation | null;
|
|
24
|
+
lrvObservations: SamplizeLrvObservation[];
|
|
25
|
+
/** The primary sample variant count, never an aggregate of product orders. */
|
|
26
|
+
demand: SamplizeDemand | null;
|
|
27
|
+
collectionMemberships: SamplizeCollectionMembership[];
|
|
28
|
+
colourAnalysis: Record<string, unknown>;
|
|
29
|
+
oklab: {
|
|
30
|
+
L: number;
|
|
31
|
+
a: number;
|
|
32
|
+
b: number;
|
|
33
|
+
};
|
|
34
|
+
sourceProductId: string;
|
|
35
|
+
url: string;
|
|
36
|
+
sizeVariants: Array<{
|
|
37
|
+
sourceVariantId: string;
|
|
38
|
+
sku: string | null;
|
|
39
|
+
title: string | null;
|
|
40
|
+
price: number | null;
|
|
41
|
+
inventoryAvailable: boolean;
|
|
42
|
+
demand: SamplizeDemand | null;
|
|
43
|
+
}>;
|
|
44
|
+
publishedHexes: SamplizeHexObservation[];
|
|
45
|
+
hexObservations: SamplizeHexObservation[];
|
|
46
|
+
}
|
|
47
|
+
export interface SamplizeCataloguePage {
|
|
48
|
+
schemaVersion: 2;
|
|
49
|
+
corpusScope: "samplizeCatalogue";
|
|
50
|
+
sourceVersion: string;
|
|
51
|
+
source: Record<string, unknown>;
|
|
52
|
+
total: number;
|
|
53
|
+
items: SamplizeCatalogueProduct[];
|
|
54
|
+
nextCursor: string | null;
|
|
55
|
+
/** True on the final page; completeness requires collecting total unique IDs. */
|
|
56
|
+
complete: boolean;
|
|
57
|
+
}
|
|
58
|
+
export interface SamplizeHexObservation {
|
|
59
|
+
hex: string;
|
|
60
|
+
publisher: string;
|
|
61
|
+
source: string;
|
|
62
|
+
sourceUrl: string | null;
|
|
63
|
+
sourceBasis: string;
|
|
64
|
+
observedAt: string | null;
|
|
65
|
+
differsFromSelected: boolean;
|
|
66
|
+
}
|
|
67
|
+
export interface SamplizePublicationSource {
|
|
68
|
+
publisher: "Samplize";
|
|
69
|
+
source: "algolia_shopify_products";
|
|
70
|
+
sourceUrl: string;
|
|
71
|
+
observedAt: string | null;
|
|
72
|
+
}
|
|
73
|
+
export interface SamplizeLrvObservation extends SamplizePublicationSource {
|
|
74
|
+
field: string;
|
|
75
|
+
value: number;
|
|
76
|
+
}
|
|
77
|
+
export interface SamplizeDemand extends SamplizePublicationSource {
|
|
78
|
+
field: "recently_ordered_count";
|
|
79
|
+
sourceVariantId: string;
|
|
80
|
+
grain: "shopify_variant";
|
|
81
|
+
recentlyOrderedCount: number;
|
|
82
|
+
/** The publisher does not supply the time window. */
|
|
83
|
+
window: null;
|
|
84
|
+
}
|
|
85
|
+
export interface SamplizeCollectionMembership {
|
|
86
|
+
sourceCollectionId: string;
|
|
87
|
+
handle: string;
|
|
88
|
+
url: string;
|
|
89
|
+
publisher: "Samplize";
|
|
90
|
+
source: "algolia_shopify_products";
|
|
91
|
+
observedAt: string | null;
|
|
92
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/** A personal preference; diminished references stay on the research board. */
|
|
2
|
+
export type ScheduleReferenceInfluence = "kept" | "diminished";
|
|
3
|
+
export interface PutScheduleReferenceFeedback {
|
|
4
|
+
/** Reuse unchanged after an uncertain response; a different command needs a new id. */
|
|
5
|
+
requestId: string;
|
|
6
|
+
/** The version last read for this reference, or zero before its first decision. */
|
|
7
|
+
expectedFeedbackVersion: number;
|
|
8
|
+
sourceRunId: string;
|
|
9
|
+
influence: ScheduleReferenceInfluence;
|
|
10
|
+
}
|
|
11
|
+
export type ScheduleReferenceSource = {
|
|
12
|
+
kind: "image";
|
|
13
|
+
laneId: string;
|
|
14
|
+
imageRef: string;
|
|
15
|
+
sourceName: string;
|
|
16
|
+
sourceDomain: string;
|
|
17
|
+
url: string | null;
|
|
18
|
+
caption: string;
|
|
19
|
+
} | {
|
|
20
|
+
kind: "web";
|
|
21
|
+
domain: string;
|
|
22
|
+
url: string;
|
|
23
|
+
statement: string;
|
|
24
|
+
implication: string;
|
|
25
|
+
};
|
|
26
|
+
/** Immutable receipt for one decision, including the exact research frame it came from. */
|
|
27
|
+
export interface ScheduleReferenceFeedback {
|
|
28
|
+
eventId: string;
|
|
29
|
+
scheduleId: string;
|
|
30
|
+
referenceId: string;
|
|
31
|
+
version: number;
|
|
32
|
+
requestId: string;
|
|
33
|
+
sourceRunId: string;
|
|
34
|
+
sourceEventSequence: number;
|
|
35
|
+
source: ScheduleReferenceSource;
|
|
36
|
+
scope: {
|
|
37
|
+
kind: "project";
|
|
38
|
+
};
|
|
39
|
+
originalVerdict: "kept" | "set-aside";
|
|
40
|
+
influence: ScheduleReferenceInfluence;
|
|
41
|
+
decidedByPrincipalId: string;
|
|
42
|
+
decidedAt: string;
|
|
43
|
+
}
|
|
44
|
+
export interface ScheduleReferenceFeedbackList {
|
|
45
|
+
items: ScheduleReferenceFeedback[];
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { HttpTransport } from "./http-transport.js";
|
|
2
|
+
import type { PutScheduleReferenceFeedback, ScheduleReferenceFeedback, ScheduleReferenceFeedbackList } from "./schedule-reference-types.js";
|
|
3
|
+
/** Schedule-owned preferences, independent of an issued document's revision. */
|
|
4
|
+
export declare class ScheduleReferencesClient {
|
|
5
|
+
#private;
|
|
6
|
+
constructor(transport: HttpTransport);
|
|
7
|
+
/** Read the latest saved preference for each reference. Empty means no decisions yet. */
|
|
8
|
+
list(scheduleId: string, signal?: AbortSignal): Promise<ScheduleReferenceFeedbackList>;
|
|
9
|
+
/**
|
|
10
|
+
* Save or reverse a preference. An exact request replay returns its original receipt;
|
|
11
|
+
* it does not undo newer decisions. A stale reference version raises a 409.
|
|
12
|
+
*/
|
|
13
|
+
put(scheduleId: string, referenceId: string, input: PutScheduleReferenceFeedback, signal?: AbortSignal): Promise<ScheduleReferenceFeedback>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { resolveOperation } from "./operations.js";
|
|
2
|
+
/** Schedule-owned preferences, independent of an issued document's revision. */
|
|
3
|
+
export class ScheduleReferencesClient {
|
|
4
|
+
#transport;
|
|
5
|
+
constructor(transport) {
|
|
6
|
+
this.#transport = transport;
|
|
7
|
+
}
|
|
8
|
+
/** Read the latest saved preference for each reference. Empty means no decisions yet. */
|
|
9
|
+
list(scheduleId, signal) {
|
|
10
|
+
return this.#transport.requestJson(resolveOperation("list_schedule_reference_feedback"), {
|
|
11
|
+
pathParams: { scheduleId },
|
|
12
|
+
signal,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Save or reverse a preference. An exact request replay returns its original receipt;
|
|
17
|
+
* it does not undo newer decisions. A stale reference version raises a 409.
|
|
18
|
+
*/
|
|
19
|
+
put(scheduleId, referenceId, input, signal) {
|
|
20
|
+
return this.#transport.requestJson(resolveOperation("put_schedule_reference_feedback"), {
|
|
21
|
+
pathParams: { scheduleId, referenceId },
|
|
22
|
+
body: input,
|
|
23
|
+
signal,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
package/schedule-types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { VerdictCitation } from "./citation-types.js";
|
|
1
2
|
/**
|
|
2
3
|
* Finish-schedule wire types (MG-616) — the hand-mirror of
|
|
3
4
|
* `@materialgraph/products/schemes/finish-schedule`. Kept in their own module
|
|
@@ -51,6 +52,8 @@ export interface FinishScheduleCell {
|
|
|
51
52
|
state: FinishScheduleCellState;
|
|
52
53
|
confidence: number | null;
|
|
53
54
|
sourceBasis: string | null;
|
|
55
|
+
/** Omitted when the exact current claim has no supporting source. */
|
|
56
|
+
citation?: VerdictCitation;
|
|
54
57
|
}
|
|
55
58
|
/**
|
|
56
59
|
* The rolled-up grade for one row, from its EVALUATED criterion cells only.
|
|
@@ -59,6 +62,33 @@ export interface FinishScheduleCell {
|
|
|
59
62
|
* `hard_no` means a required cell failed on a real value.
|
|
60
63
|
*/
|
|
61
64
|
export type FinishScheduleGrade = "meets_all" | "close" | "hard_no";
|
|
65
|
+
/** Exact retained brief passage behind a schedule criterion. */
|
|
66
|
+
export interface FinishScheduleCriterionSourceRef {
|
|
67
|
+
sourceId: string;
|
|
68
|
+
quote: string;
|
|
69
|
+
textRange: {
|
|
70
|
+
start: number;
|
|
71
|
+
end: number;
|
|
72
|
+
unit: "utf16";
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
/** Brief criterion carried into the issued row, including explicit exclusions. */
|
|
76
|
+
export type FinishScheduleCriterion = {
|
|
77
|
+
kind: "attribute" | "attribute-presence" | "attribute-exclusion" | "attribute-numeric" | "unresolved";
|
|
78
|
+
raw: string;
|
|
79
|
+
attributeId?: string;
|
|
80
|
+
term?: string;
|
|
81
|
+
comparator?: "at-least" | "at-most";
|
|
82
|
+
value?: number;
|
|
83
|
+
unit?: string;
|
|
84
|
+
polarity?: "exclusion";
|
|
85
|
+
coverageNote?: string;
|
|
86
|
+
suggestion?: {
|
|
87
|
+
attributeId: string;
|
|
88
|
+
term?: string;
|
|
89
|
+
};
|
|
90
|
+
sourceRefs?: FinishScheduleCriterionSourceRef[];
|
|
91
|
+
};
|
|
62
92
|
/** One numbered section of the schedule, and the heading it prints. */
|
|
63
93
|
export interface FinishScheduleSection {
|
|
64
94
|
/** The hundreds block, e.g. `100`. Also the base of every line number in it. */
|
|
@@ -147,6 +177,10 @@ export interface FinishScheduleOpenSlot {
|
|
|
147
177
|
}
|
|
148
178
|
/** One row: one slot, one specified material, fully graded. */
|
|
149
179
|
export interface FinishScheduleRow {
|
|
180
|
+
/** Criteria carried from the programme; absent on older schedule artifacts. */
|
|
181
|
+
criteria?: FinishScheduleCriterion[];
|
|
182
|
+
requiredCriteria?: FinishScheduleCriterion[];
|
|
183
|
+
preferredCriteria?: FinishScheduleCriterion[];
|
|
150
184
|
/**
|
|
151
185
|
* The printed line reference, e.g. `L-101` — how a drawing, an RFI or a
|
|
152
186
|
* substitution request names this line. Allocated from the Run's PROGRAMME
|
|
@@ -50,7 +50,7 @@ export interface CollapsedVariant {
|
|
|
50
50
|
* ABSENT means no MB identity is on record, never that it cannot be ordered.
|
|
51
51
|
*/
|
|
52
52
|
materialBankId?: string;
|
|
53
|
-
/** This variant's own
|
|
53
|
+
/** This variant's own mode-primary score — the value the array is ordered by. */
|
|
54
54
|
score: number;
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -56,6 +56,11 @@ export type SearchFilter = {
|
|
|
56
56
|
attributeId: string;
|
|
57
57
|
term: string;
|
|
58
58
|
trust?: SearchFilterTrust;
|
|
59
|
+
} | {
|
|
60
|
+
/** Known effective values are required, and this term must be absent. */
|
|
61
|
+
attributeId: string;
|
|
62
|
+
excludesTerm: string;
|
|
63
|
+
trust?: SearchFilterTrust;
|
|
59
64
|
}
|
|
60
65
|
/**
|
|
61
66
|
* TERM SET — the attribute must equal any ONE of these. OR within the entry;
|