@printy3d/sdk 0.0.0-stage → 0.4.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/LICENSE +201 -0
- package/README.md +85 -2
- package/dist/cad-documents.d.ts +169 -0
- package/dist/cad-documents.d.ts.map +1 -0
- package/dist/cad-documents.js +17 -0
- package/dist/cad-documents.js.map +1 -0
- package/dist/client.d.ts +116 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +165 -0
- package/dist/client.js.map +1 -0
- package/dist/errors.d.ts +125 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +202 -0
- package/dist/errors.js.map +1 -0
- package/dist/http.d.ts +70 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +291 -0
- package/dist/http.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/resources.d.ts +222 -0
- package/dist/resources.d.ts.map +1 -0
- package/dist/resources.js +629 -0
- package/dist/resources.js.map +1 -0
- package/dist/runtime.d.ts +30 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +88 -0
- package/dist/runtime.js.map +1 -0
- package/dist/sources.d.ts +13 -0
- package/dist/sources.d.ts.map +1 -0
- package/dist/sources.js +82 -0
- package/dist/sources.js.map +1 -0
- package/dist/types.d.ts +776 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +18 -0
- package/dist/types.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +2 -0
- package/dist/version.js.map +1 -0
- package/dist/webhooks.d.ts +24 -0
- package/dist/webhooks.d.ts.map +1 -0
- package/dist/webhooks.js +95 -0
- package/dist/webhooks.js.map +1 -0
- package/package.json +48 -4
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,776 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire types, written by hand from `spec/openapi.json` (`components.schemas`). Field names
|
|
3
|
+
* are the API's snake_case. `/v1` grows additively: responses may carry fields not listed
|
|
4
|
+
* here, and nothing in the SDK drops them. Timestamps are RFC 3339 strings.
|
|
5
|
+
*
|
|
6
|
+
* Tool parameter shapes follow the API's validation models (`printy3d_contracts/tools.py`);
|
|
7
|
+
* the spec types tool `params` as a free-form object.
|
|
8
|
+
*/
|
|
9
|
+
export type Scope = "files:read" | "files:write" | "jobs:read" | "jobs:write" | "artifacts:read" | "webhooks:manage" | "keys:manage" | "usage:read" | "org:read" | "admin:billing";
|
|
10
|
+
export type ApiKeyKind = "live" | "test";
|
|
11
|
+
export type FormatKind = "mesh" | "splat" | "pointcloud" | "medical" | "cad" | "archive";
|
|
12
|
+
export type InputFormat = "stl" | "obj" | "3mf" | "ply" | "wrl" | "vrm" | "fbx" | "gltf" | "glb" | "dae" | "off" | "dcm" | "dicom" | "las" | "laz" | "step" | "zip" | "tar" | "tgz" | "rar";
|
|
13
|
+
export type FileStatus = "awaiting_upload" | "verifying" | "ready" | "rejected";
|
|
14
|
+
export type Recipe = "inspect" | "repair" | "tool" | "cad_check";
|
|
15
|
+
export type ToolName = "measure" | "convert" | "cut" | "lattice" | "label" | "mirror" | "remove_small_parts" | "thickness" | "analyze" | "medial" | "structural.components" | "structural.fea" | "structural.heatmap" | "structural.fragility" | "structural.measure_all" | "structural.relief";
|
|
16
|
+
export type JobStatus = "queued" | "running" | "verifying" | "succeeded" | "failed" | "cancelled";
|
|
17
|
+
export declare const TERMINAL_JOB_STATUSES: readonly JobStatus[];
|
|
18
|
+
export type ExportFormat = "glb" | "obj" | "3mf" | "stl" | "ply";
|
|
19
|
+
export type ExportStatus = "ready" | "converting" | "failed";
|
|
20
|
+
export type ProfileId = "recommended" | "character" | "mechanical" | "vehicle" | "custom";
|
|
21
|
+
export type ErrorCode = "malformed_request" | "unauthenticated" | "invalid_api_key" | "bootstrap_invalid" | "insufficient_credits" | "insufficient_scope" | "org_required" | "origin_not_allowed" | "ip_not_allowed" | "image_not_allowed" | "account_pending" | "not_found" | "method_not_allowed" | "conflict" | "job_not_cancellable" | "idempotency_in_progress" | "lease_expired" | "lease_terminal" | "expired" | "file_too_large" | "unsupported_format" | "validation_failed" | "idempotency_key_reused" | "input_too_large" | "contracts_mismatch" | "rate_limited" | "concurrency_limit" | "quota_exceeded" | "internal" | "feature_unavailable" | "service_unavailable" | "capacity_exhausted";
|
|
22
|
+
export type Vec3 = readonly [number, number, number] | number[];
|
|
23
|
+
export interface ProblemField {
|
|
24
|
+
field: string;
|
|
25
|
+
message: string;
|
|
26
|
+
}
|
|
27
|
+
export interface Problem {
|
|
28
|
+
type: string;
|
|
29
|
+
title: string;
|
|
30
|
+
status: number;
|
|
31
|
+
code: ErrorCode;
|
|
32
|
+
detail?: string | null;
|
|
33
|
+
instance?: string | null;
|
|
34
|
+
errors?: ProblemField[];
|
|
35
|
+
request_id?: string | null;
|
|
36
|
+
[extra: string]: unknown;
|
|
37
|
+
}
|
|
38
|
+
export interface Organization {
|
|
39
|
+
id: string;
|
|
40
|
+
name: string;
|
|
41
|
+
plan_id: string;
|
|
42
|
+
status: "active" | "suspended" | "deleting";
|
|
43
|
+
}
|
|
44
|
+
export interface Format {
|
|
45
|
+
ext: string;
|
|
46
|
+
kind: FormatKind;
|
|
47
|
+
/** Live qualification. */
|
|
48
|
+
enabled: boolean;
|
|
49
|
+
/** Sandbox (test key) support. */
|
|
50
|
+
test_enabled?: boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface FormatList {
|
|
53
|
+
data: Format[];
|
|
54
|
+
}
|
|
55
|
+
export interface RepairProfile {
|
|
56
|
+
id: ProfileId;
|
|
57
|
+
description: string;
|
|
58
|
+
params: RepairParams;
|
|
59
|
+
}
|
|
60
|
+
export interface RepairProfileList {
|
|
61
|
+
data: RepairProfile[];
|
|
62
|
+
}
|
|
63
|
+
export interface ApiKey {
|
|
64
|
+
id: string;
|
|
65
|
+
org_id: string;
|
|
66
|
+
kind: ApiKeyKind;
|
|
67
|
+
prefix: string;
|
|
68
|
+
name: string;
|
|
69
|
+
scopes: Scope[];
|
|
70
|
+
created_at: string;
|
|
71
|
+
expires_at: string | null;
|
|
72
|
+
last_used_at: string | null;
|
|
73
|
+
revoked_at: string | null;
|
|
74
|
+
superseded_by: string | null;
|
|
75
|
+
grace_until: string | null;
|
|
76
|
+
}
|
|
77
|
+
export interface ApiKeyPage {
|
|
78
|
+
data: ApiKey[];
|
|
79
|
+
next_cursor?: string | null;
|
|
80
|
+
}
|
|
81
|
+
/** `secret` is the plaintext key, returned once; `null` on an idempotent replay. */
|
|
82
|
+
export interface IssuedApiKey {
|
|
83
|
+
api_key: ApiKey;
|
|
84
|
+
secret?: string | null;
|
|
85
|
+
}
|
|
86
|
+
export interface CreateApiKey {
|
|
87
|
+
/** 1-100 characters. */
|
|
88
|
+
name: string;
|
|
89
|
+
/** 1-10 scopes, never more than the issuing key holds. */
|
|
90
|
+
scopes: Scope[];
|
|
91
|
+
expires_at?: string | null;
|
|
92
|
+
}
|
|
93
|
+
export interface RotateApiKey {
|
|
94
|
+
/** 0-604800, default 86400. */
|
|
95
|
+
grace_seconds?: number;
|
|
96
|
+
}
|
|
97
|
+
export interface File {
|
|
98
|
+
id: string;
|
|
99
|
+
filename: string;
|
|
100
|
+
size_bytes: number;
|
|
101
|
+
sha256: string;
|
|
102
|
+
status: FileStatus;
|
|
103
|
+
livemode: boolean;
|
|
104
|
+
created_at: string;
|
|
105
|
+
input_format?: InputFormat;
|
|
106
|
+
kind?: FormatKind;
|
|
107
|
+
rejected_reason?: string | null;
|
|
108
|
+
}
|
|
109
|
+
export interface FilePage {
|
|
110
|
+
data: File[];
|
|
111
|
+
next_cursor?: string | null;
|
|
112
|
+
}
|
|
113
|
+
/** A presigned storage request. `url` is a capability: never log it. */
|
|
114
|
+
export interface Transfer {
|
|
115
|
+
url: string;
|
|
116
|
+
method: "GET" | "PUT";
|
|
117
|
+
expires_at: string;
|
|
118
|
+
headers?: Record<string, string>;
|
|
119
|
+
}
|
|
120
|
+
export interface CreateFile {
|
|
121
|
+
/** 5-200 characters; the extension names the format. */
|
|
122
|
+
filename: string;
|
|
123
|
+
/** At most 10 MiB. */
|
|
124
|
+
size_bytes: number;
|
|
125
|
+
/** Lower-case hex SHA-256 of the exact bytes. */
|
|
126
|
+
sha256: string;
|
|
127
|
+
}
|
|
128
|
+
export interface CreateResumableFile extends Omit<CreateFile, "size_bytes"> {
|
|
129
|
+
/** At most 1 GiB. */
|
|
130
|
+
size_bytes: number;
|
|
131
|
+
input_format: InputFormat;
|
|
132
|
+
}
|
|
133
|
+
export interface FileUpload {
|
|
134
|
+
file: File;
|
|
135
|
+
upload: Transfer;
|
|
136
|
+
}
|
|
137
|
+
/** One part: PUT exactly `size_bytes` bytes from `offset` to `url`. */
|
|
138
|
+
export interface UploadPart {
|
|
139
|
+
part_number: number;
|
|
140
|
+
offset: number;
|
|
141
|
+
size_bytes: number;
|
|
142
|
+
url: string;
|
|
143
|
+
}
|
|
144
|
+
/** An S3 multipart upload; `parts` lists only the parts the store does not hold yet. */
|
|
145
|
+
export interface ResumableUpload {
|
|
146
|
+
protocol?: "s3_multipart";
|
|
147
|
+
method?: "PUT";
|
|
148
|
+
part_size_bytes: number;
|
|
149
|
+
expires_at: string;
|
|
150
|
+
parts: UploadPart[];
|
|
151
|
+
}
|
|
152
|
+
export interface ResumableFileUpload {
|
|
153
|
+
file: File;
|
|
154
|
+
upload: ResumableUpload;
|
|
155
|
+
}
|
|
156
|
+
export interface Scale {
|
|
157
|
+
mode?: "none" | "target" | "multiplier";
|
|
158
|
+
/** > 0, <= 10000. */
|
|
159
|
+
value?: number | null;
|
|
160
|
+
unit?: "mm" | "cm" | "in";
|
|
161
|
+
}
|
|
162
|
+
export interface Smoothing {
|
|
163
|
+
/** 0-50. */
|
|
164
|
+
post_construct?: number;
|
|
165
|
+
/** 0-256. */
|
|
166
|
+
clr?: number;
|
|
167
|
+
pre_smooth?: boolean | null;
|
|
168
|
+
}
|
|
169
|
+
export interface Thickness {
|
|
170
|
+
method?: "medial" | "lattice";
|
|
171
|
+
structural?: boolean;
|
|
172
|
+
/** > 0, <= 50. */
|
|
173
|
+
tip_load_n?: number;
|
|
174
|
+
/** 1-10. */
|
|
175
|
+
target_sf?: number;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Every field is optional; unset fields come from `profile` (default `recommended`), then
|
|
179
|
+
* the engine's recommendation or the documented defaults.
|
|
180
|
+
*/
|
|
181
|
+
export interface RepairParams {
|
|
182
|
+
profile?: ProfileId;
|
|
183
|
+
printer?: "mimaki" | "fdm" | null;
|
|
184
|
+
quality?: "draft" | "standard" | "high";
|
|
185
|
+
scale?: Scale;
|
|
186
|
+
/** 0-10. */
|
|
187
|
+
wall_thickness_mm?: number;
|
|
188
|
+
/** 0-10. */
|
|
189
|
+
clearance_mm?: number;
|
|
190
|
+
preserve_shells?: boolean;
|
|
191
|
+
/** 0-20, 0 = off. */
|
|
192
|
+
hollow_mm?: number;
|
|
193
|
+
/** 0-5,000,000, 0 = off. */
|
|
194
|
+
target_faces?: number;
|
|
195
|
+
/** 0-2000. */
|
|
196
|
+
close_holes_mm?: number;
|
|
197
|
+
cut_transparent?: boolean;
|
|
198
|
+
smoothing?: Smoothing;
|
|
199
|
+
mix_textures?: boolean;
|
|
200
|
+
thickness?: Thickness;
|
|
201
|
+
}
|
|
202
|
+
export interface MeasureParams {
|
|
203
|
+
point_a: Vec3;
|
|
204
|
+
point_b: Vec3;
|
|
205
|
+
/** Default false. */
|
|
206
|
+
compute_geodesic?: boolean;
|
|
207
|
+
}
|
|
208
|
+
export interface ConvertParams {
|
|
209
|
+
/** Default "stl". */
|
|
210
|
+
target_format?: "stl" | "obj" | "ply" | "3mf" | "glb";
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* A plane through `origin` with `normal`, in model coordinates. With `width` and `height`
|
|
214
|
+
* it is a rectangle centred on `origin` cutting only the section loops it touches;
|
|
215
|
+
* `u_axis` (needs both sizes, not parallel to `normal`) is its width direction.
|
|
216
|
+
*/
|
|
217
|
+
export interface CuttingPlane {
|
|
218
|
+
origin: Vec3;
|
|
219
|
+
normal: Vec3;
|
|
220
|
+
width?: number | null;
|
|
221
|
+
height?: number | null;
|
|
222
|
+
u_axis?: Vec3 | null;
|
|
223
|
+
}
|
|
224
|
+
export interface KeyParams {
|
|
225
|
+
key_type?: string | null;
|
|
226
|
+
clearance?: number | null;
|
|
227
|
+
auto_count?: boolean | null;
|
|
228
|
+
fixed_count?: number | null;
|
|
229
|
+
pin_diameter?: number | null;
|
|
230
|
+
pin_depth?: number | null;
|
|
231
|
+
dovetail_width_base?: number | null;
|
|
232
|
+
dovetail_width_tip?: number | null;
|
|
233
|
+
dovetail_depth?: number | null;
|
|
234
|
+
dovetail_height?: number | null;
|
|
235
|
+
snap_stem_diameter?: number | null;
|
|
236
|
+
snap_head_diameter?: number | null;
|
|
237
|
+
snap_depth?: number | null;
|
|
238
|
+
puzzle_width?: number | null;
|
|
239
|
+
puzzle_depth?: number | null;
|
|
240
|
+
puzzle_arm_width?: number | null;
|
|
241
|
+
flip?: boolean | null;
|
|
242
|
+
}
|
|
243
|
+
export interface CutParams {
|
|
244
|
+
/** 1-8 planes; required by the API. */
|
|
245
|
+
planes: CuttingPlane[];
|
|
246
|
+
/** Forwarded, not read by the engine. */
|
|
247
|
+
axis?: "x" | "y" | "z";
|
|
248
|
+
/** Forwarded, not read by the engine. */
|
|
249
|
+
position?: number;
|
|
250
|
+
/** Default true. */
|
|
251
|
+
cap_holes?: boolean;
|
|
252
|
+
/** Default false. */
|
|
253
|
+
keep_both_sides?: boolean;
|
|
254
|
+
key_params?: KeyParams | null;
|
|
255
|
+
}
|
|
256
|
+
export interface LatticeParams {
|
|
257
|
+
lattice_type?: "gyroid" | "schwarz_p" | "bcc" | "octet" | "diamond";
|
|
258
|
+
cell_size_mm?: number;
|
|
259
|
+
strut_thickness_mm?: number;
|
|
260
|
+
shell_thickness_mm?: number;
|
|
261
|
+
interior_erosion_mm?: number;
|
|
262
|
+
include_shell?: boolean;
|
|
263
|
+
band_thickness_mm?: number;
|
|
264
|
+
/** Components 0..1. */
|
|
265
|
+
material_color?: Vec3 | null;
|
|
266
|
+
}
|
|
267
|
+
export interface LabelParams {
|
|
268
|
+
/** 1-500 characters. */
|
|
269
|
+
text: string;
|
|
270
|
+
position?: Vec3;
|
|
271
|
+
direction?: Vec3 | null;
|
|
272
|
+
depth_mm?: number;
|
|
273
|
+
font_size_mm?: number;
|
|
274
|
+
font_name?: string;
|
|
275
|
+
mode?: "snapoff" | "emboss" | "engrave" | "extrude";
|
|
276
|
+
cylinder_radius_mm?: number;
|
|
277
|
+
cylinder_length_mm?: number;
|
|
278
|
+
material_color?: Vec3 | null;
|
|
279
|
+
rotation_angle?: number;
|
|
280
|
+
line_spacing?: number;
|
|
281
|
+
text_alignment?: "left" | "center" | "right";
|
|
282
|
+
}
|
|
283
|
+
export interface MirrorParams {
|
|
284
|
+
axis?: "x" | "y" | "z";
|
|
285
|
+
offset_mm?: number;
|
|
286
|
+
merge?: boolean;
|
|
287
|
+
flip_uvs?: boolean;
|
|
288
|
+
auto_offset?: boolean;
|
|
289
|
+
}
|
|
290
|
+
export interface RemoveSmallPartsParams {
|
|
291
|
+
min_faces?: number;
|
|
292
|
+
min_percent?: number;
|
|
293
|
+
}
|
|
294
|
+
export interface ThicknessToolParams {
|
|
295
|
+
/** Required: > 0, <= 100. */
|
|
296
|
+
thickness_mm: number;
|
|
297
|
+
resolution?: number;
|
|
298
|
+
soft_sel_radius?: number;
|
|
299
|
+
flag_at?: number;
|
|
300
|
+
severe_at?: number;
|
|
301
|
+
export_mesh?: boolean;
|
|
302
|
+
support_aware?: boolean;
|
|
303
|
+
profile?: string | null;
|
|
304
|
+
}
|
|
305
|
+
export interface MedialParams {
|
|
306
|
+
threshold_mm?: number;
|
|
307
|
+
exterior?: boolean;
|
|
308
|
+
export_mesh?: boolean;
|
|
309
|
+
paint_dilate_mm?: number | null;
|
|
310
|
+
beams?: boolean;
|
|
311
|
+
selftest?: boolean;
|
|
312
|
+
}
|
|
313
|
+
export interface AnalyzeToolParams {
|
|
314
|
+
volume?: boolean;
|
|
315
|
+
volume_resolution?: number;
|
|
316
|
+
}
|
|
317
|
+
export type MaterialPreset = "generic" | "pla" | "formlabs_grey_v5" | "mimaki_mh100";
|
|
318
|
+
export interface Material {
|
|
319
|
+
youngs_modulus_mpa: number;
|
|
320
|
+
poisson_ratio: number;
|
|
321
|
+
density_g_cm3: number;
|
|
322
|
+
yield_strength_mpa: number;
|
|
323
|
+
stress_metric?: "von_mises" | "max_principal";
|
|
324
|
+
}
|
|
325
|
+
export interface StructuralCommonParams {
|
|
326
|
+
up_axis?: 0 | 1 | 2;
|
|
327
|
+
voxel_size_mm?: number;
|
|
328
|
+
support_gap_voxels?: number;
|
|
329
|
+
material?: MaterialPreset | Material;
|
|
330
|
+
target_safety_factor?: number;
|
|
331
|
+
load_g?: number;
|
|
332
|
+
}
|
|
333
|
+
export interface StressFieldParams extends StructuralCommonParams {
|
|
334
|
+
support_point?: Vec3 | null;
|
|
335
|
+
support_radius_mm?: number;
|
|
336
|
+
load_point?: Vec3 | null;
|
|
337
|
+
load_radius_mm?: number;
|
|
338
|
+
load_dir?: Vec3 | null;
|
|
339
|
+
load_force_n?: number;
|
|
340
|
+
support_frac?: number;
|
|
341
|
+
}
|
|
342
|
+
export interface ComponentsRemove {
|
|
343
|
+
max_dim_mm?: number;
|
|
344
|
+
volume_mm3?: number;
|
|
345
|
+
faces?: number;
|
|
346
|
+
bbox_mm?: Vec3 | null;
|
|
347
|
+
logic?: "or" | "and";
|
|
348
|
+
keep_main?: boolean;
|
|
349
|
+
}
|
|
350
|
+
export interface StructuralComponentsParams extends StructuralCommonParams {
|
|
351
|
+
weld?: boolean;
|
|
352
|
+
weld_mm?: number;
|
|
353
|
+
min_faces?: number;
|
|
354
|
+
export?: boolean;
|
|
355
|
+
remove?: ComponentsRemove | null;
|
|
356
|
+
}
|
|
357
|
+
export interface StructuralFeaParams extends StructuralCommonParams {
|
|
358
|
+
grid_cell_budget?: number;
|
|
359
|
+
solver?: "amgcg_gpu" | "gpu" | "mgcg" | "amgcg" | "cpu";
|
|
360
|
+
tol?: number;
|
|
361
|
+
band?: number;
|
|
362
|
+
max_iters?: number;
|
|
363
|
+
fixed_axis?: number;
|
|
364
|
+
nonlinear?: {
|
|
365
|
+
enabled?: boolean;
|
|
366
|
+
model?: number;
|
|
367
|
+
load_steps?: number;
|
|
368
|
+
newton_iters?: number;
|
|
369
|
+
newton_tol?: number;
|
|
370
|
+
gpu?: boolean;
|
|
371
|
+
};
|
|
372
|
+
thicken?: {
|
|
373
|
+
enabled?: boolean;
|
|
374
|
+
max_mm?: number;
|
|
375
|
+
};
|
|
376
|
+
hollow_graded?: {
|
|
377
|
+
enabled?: boolean;
|
|
378
|
+
wall_min_mm?: number;
|
|
379
|
+
wall_max_mm?: number;
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
export interface StructuralHeatmapParams extends StressFieldParams {
|
|
383
|
+
normalize?: "p99" | "max";
|
|
384
|
+
percentile?: number;
|
|
385
|
+
sample_radius?: number;
|
|
386
|
+
}
|
|
387
|
+
export interface StructuralFragilityParams extends StressFieldParams {
|
|
388
|
+
sample_radius?: number;
|
|
389
|
+
}
|
|
390
|
+
export interface StructuralMeasureAllParams extends StructuralCommonParams {
|
|
391
|
+
sample_radius?: number;
|
|
392
|
+
}
|
|
393
|
+
export interface StructuralReliefParams {
|
|
394
|
+
up_axis?: 0 | 1 | 2;
|
|
395
|
+
amount_mm?: number;
|
|
396
|
+
min_feature_mm?: number;
|
|
397
|
+
mode?: "emboss" | "deboss" | "signed";
|
|
398
|
+
input_is_height?: boolean;
|
|
399
|
+
strength?: number;
|
|
400
|
+
compress?: number;
|
|
401
|
+
max_edge_mm?: number;
|
|
402
|
+
up_only?: boolean;
|
|
403
|
+
fix?: boolean;
|
|
404
|
+
fix_resolution?: number;
|
|
405
|
+
}
|
|
406
|
+
/** Params per tool name. */
|
|
407
|
+
export interface ToolParamsMap {
|
|
408
|
+
measure: MeasureParams;
|
|
409
|
+
convert: ConvertParams;
|
|
410
|
+
cut: CutParams;
|
|
411
|
+
lattice: LatticeParams;
|
|
412
|
+
label: LabelParams;
|
|
413
|
+
mirror: MirrorParams;
|
|
414
|
+
remove_small_parts: RemoveSmallPartsParams;
|
|
415
|
+
thickness: ThicknessToolParams;
|
|
416
|
+
analyze: AnalyzeToolParams;
|
|
417
|
+
medial: MedialParams;
|
|
418
|
+
"structural.components": StructuralComponentsParams;
|
|
419
|
+
"structural.fea": StructuralFeaParams;
|
|
420
|
+
"structural.heatmap": StructuralHeatmapParams;
|
|
421
|
+
"structural.fragility": StructuralFragilityParams;
|
|
422
|
+
"structural.measure_all": StructuralMeasureAllParams;
|
|
423
|
+
"structural.relief": StructuralReliefParams;
|
|
424
|
+
}
|
|
425
|
+
export interface CreateJob {
|
|
426
|
+
/** `file_` + 26 Crockford base32 characters. */
|
|
427
|
+
input_file_id: string;
|
|
428
|
+
/** Default "inspect". */
|
|
429
|
+
recipe?: Recipe;
|
|
430
|
+
/** Required for the `tool` recipe only. */
|
|
431
|
+
tool?: ToolName | null;
|
|
432
|
+
/** `RepairParams` for `repair`, the tool's params for `tool`, nothing for `inspect`. */
|
|
433
|
+
params?: RepairParams | ToolParamsMap[ToolName] | CadCheckParams | Record<string, unknown> | null;
|
|
434
|
+
/** Announce the job's end to one of your webhook endpoints (`cad_check` only). */
|
|
435
|
+
notify?: {
|
|
436
|
+
webhook_endpoint: string;
|
|
437
|
+
} | null;
|
|
438
|
+
}
|
|
439
|
+
/** `params` of the `cad_check` recipe. */
|
|
440
|
+
export interface CadCheckParams {
|
|
441
|
+
/** Spending cap in credits, an integer of at least 10. */
|
|
442
|
+
max_credits?: number;
|
|
443
|
+
}
|
|
444
|
+
/** `Job.result` of a succeeded `cad_check` job: a count summary. */
|
|
445
|
+
export interface CadCheckResult {
|
|
446
|
+
schema_version: 1 | 2 | 3;
|
|
447
|
+
parts: number;
|
|
448
|
+
placed_copies: number;
|
|
449
|
+
pairs: number;
|
|
450
|
+
open_parts: number;
|
|
451
|
+
sheet_parts: number;
|
|
452
|
+
/** Tolerance of the measurements, in millimetres. */
|
|
453
|
+
accuracy_mm: number;
|
|
454
|
+
sample_limit_per_shape: number;
|
|
455
|
+
/** True when the checker capped the pairs or regions it reported. */
|
|
456
|
+
truncated: boolean;
|
|
457
|
+
/** Placements the checker could not read; `null` for a check made before 2026-11-10. */
|
|
458
|
+
unsupported_placements: number | null;
|
|
459
|
+
}
|
|
460
|
+
export type FindingSeverity = "blocking" | "warning" | "information";
|
|
461
|
+
export type FindingFrame = "part" | "assembly";
|
|
462
|
+
export type AssemblyIntent = "separate" | "together";
|
|
463
|
+
export type EvaluationSummary = "ok" | "warnings" | "blocked";
|
|
464
|
+
/** One finding of an evaluation. */
|
|
465
|
+
export interface Finding {
|
|
466
|
+
/**
|
|
467
|
+
* `NOT_CLOSED`, `SHEET_NO_THICKNESS`, `WALL_BELOW_MIN`, `WALL_BELOW_SIZE_RECOMMENDATION`,
|
|
468
|
+
* `GAP_BELOW_MIN`, `PARTS_TOUCH`, `PARTS_OVERLAP`, `SAMPLING_REDUCED`, `PLACEMENTS_UNREAD`,
|
|
469
|
+
* `SCALE_BEYOND_MEASURED` or `TOUCHES_ITSELF`. New codes can appear; treat the rest as text.
|
|
470
|
+
*/
|
|
471
|
+
code: string;
|
|
472
|
+
severity: FindingSeverity;
|
|
473
|
+
message: string;
|
|
474
|
+
/** The part's name in the file; `null` for a finding with no single part. */
|
|
475
|
+
part: string | null;
|
|
476
|
+
/** The part's id; `null` when `part` is. */
|
|
477
|
+
part_id: string | null;
|
|
478
|
+
value_mm: number | null;
|
|
479
|
+
limit_mm: number | null;
|
|
480
|
+
/** A point in millimetres, in `frame`; `null` when there is none. */
|
|
481
|
+
location: [number, number, number] | null;
|
|
482
|
+
frame: FindingFrame | null;
|
|
483
|
+
/**
|
|
484
|
+
* The two copy ids `[a, b]` of a finding between two parts, and of a `GAP_BELOW_MIN` between two
|
|
485
|
+
* bodies of one part (schema 2 or 3 check); `null` for every other finding.
|
|
486
|
+
*/
|
|
487
|
+
copies: [string, string] | null;
|
|
488
|
+
/**
|
|
489
|
+
* A wall or an inside gap (schema 3 check): the far end of the measurement, in `frame` (always
|
|
490
|
+
* `part`) and the model's own millimetres; the line from `location` to here is
|
|
491
|
+
* `value_mm / scale` long. `null` otherwise.
|
|
492
|
+
*/
|
|
493
|
+
location_to: [number, number, number] | null;
|
|
494
|
+
/**
|
|
495
|
+
* Set exactly when `location_to` is: the preview's thickness field is below the finding's
|
|
496
|
+
* limit where it reads under this, in the model's own millimetres.
|
|
497
|
+
*/
|
|
498
|
+
shade_below_mm: number | null;
|
|
499
|
+
}
|
|
500
|
+
export interface Evaluation {
|
|
501
|
+
process: string;
|
|
502
|
+
material: string;
|
|
503
|
+
summary: EvaluationSummary;
|
|
504
|
+
findings: Finding[];
|
|
505
|
+
/**
|
|
506
|
+
* Findings left out of `findings` by either cap: at most 1000 between two parts (worst first)
|
|
507
|
+
* and at most 1000 about single parts (most severe first). The summary is decided from all
|
|
508
|
+
* findings, the omitted ones included.
|
|
509
|
+
*/
|
|
510
|
+
omitted: number;
|
|
511
|
+
}
|
|
512
|
+
/** `GET /v1/jobs/{id}/evaluation`. */
|
|
513
|
+
export interface EvaluationList {
|
|
514
|
+
table_version: number;
|
|
515
|
+
items: Evaluation[];
|
|
516
|
+
}
|
|
517
|
+
export interface EvaluationQuery {
|
|
518
|
+
process?: string;
|
|
519
|
+
/** Needs `process`. */
|
|
520
|
+
material?: string;
|
|
521
|
+
/** Greater than 0; default 1. */
|
|
522
|
+
scale?: number;
|
|
523
|
+
/** Default `separate`. */
|
|
524
|
+
assembly_intent?: AssemblyIntent;
|
|
525
|
+
/** Judge by the moving-parts gap (default false). */
|
|
526
|
+
moving?: boolean;
|
|
527
|
+
}
|
|
528
|
+
export interface TechnologyRow {
|
|
529
|
+
process: string;
|
|
530
|
+
material: string;
|
|
531
|
+
label: string;
|
|
532
|
+
wall_min_mm: number | null;
|
|
533
|
+
gap_inside_mm: number | null;
|
|
534
|
+
gap_assembled_mm: number | null;
|
|
535
|
+
gap_moving_mm: number | null;
|
|
536
|
+
interior: "closed_ok" | "needs_holes" | "not_offered";
|
|
537
|
+
hole_count: number | null;
|
|
538
|
+
hole_min_diameter_mm: number | null;
|
|
539
|
+
source: string | null;
|
|
540
|
+
wall_by_size?: unknown;
|
|
541
|
+
}
|
|
542
|
+
/** `GET /v1/technologies`: the limits that apply to your organization. */
|
|
543
|
+
export interface TechnologyTable {
|
|
544
|
+
version: number;
|
|
545
|
+
gap_floor_mm: number;
|
|
546
|
+
notice: {
|
|
547
|
+
processing_region: string;
|
|
548
|
+
retention_days: number;
|
|
549
|
+
};
|
|
550
|
+
rows: TechnologyRow[];
|
|
551
|
+
}
|
|
552
|
+
export interface WebhookEndpoint {
|
|
553
|
+
id: string;
|
|
554
|
+
url: string;
|
|
555
|
+
enabled: boolean;
|
|
556
|
+
livemode: boolean;
|
|
557
|
+
created_at: string;
|
|
558
|
+
}
|
|
559
|
+
/** The create response: the only time `secret` (`whsec_...`) is shown. */
|
|
560
|
+
export interface IssuedWebhookEndpoint extends WebhookEndpoint {
|
|
561
|
+
secret: string;
|
|
562
|
+
}
|
|
563
|
+
/** The body of a delivery, as verified by `verifyWebhook`. */
|
|
564
|
+
export interface WebhookEvent {
|
|
565
|
+
event: string;
|
|
566
|
+
job_id: string;
|
|
567
|
+
status: string;
|
|
568
|
+
}
|
|
569
|
+
export interface Capacity {
|
|
570
|
+
state: "available" | "busy" | "exhausted";
|
|
571
|
+
reason?: "paused" | "spend_limit" | "no_gpu_available" | "controller_offline" | null;
|
|
572
|
+
retry_after_s?: number | null;
|
|
573
|
+
}
|
|
574
|
+
/** A queued live job's place, refreshed every 30 s. */
|
|
575
|
+
export interface JobQueue {
|
|
576
|
+
position?: number | null;
|
|
577
|
+
estimated_start_at?: string | null;
|
|
578
|
+
capacity?: Capacity | null;
|
|
579
|
+
}
|
|
580
|
+
/** Credits of one live job: held at admission, charged once it finishes. */
|
|
581
|
+
export interface JobUsage {
|
|
582
|
+
held_credits: number;
|
|
583
|
+
charged_credits?: number | null;
|
|
584
|
+
charge_basis?: "run_time" | "minimum" | "free" | null;
|
|
585
|
+
}
|
|
586
|
+
export type Source = "explicit" | "printer" | "profile" | "recommended" | "default";
|
|
587
|
+
export interface AppliedRepair {
|
|
588
|
+
params: RepairParams;
|
|
589
|
+
sources: Record<string, Source>;
|
|
590
|
+
diagnostic_overrides?: Record<string, number | boolean>;
|
|
591
|
+
effective_engine_settings?: Record<string, unknown> | null;
|
|
592
|
+
wall_thickness_applied_mm?: number | null;
|
|
593
|
+
wall_thickness_clamped?: boolean | null;
|
|
594
|
+
}
|
|
595
|
+
export type AssessmentStatus = "not_assessed" | "needs_review" | "passed" | "failed";
|
|
596
|
+
export interface FidelityReport {
|
|
597
|
+
calibration_id?: string | null;
|
|
598
|
+
config_sha256?: string | null;
|
|
599
|
+
coordinate_frame?: string | null;
|
|
600
|
+
error?: string | null;
|
|
601
|
+
input_sha256?: string | null;
|
|
602
|
+
limitations?: string[];
|
|
603
|
+
method_version?: string | null;
|
|
604
|
+
metrics?: Record<string, unknown>;
|
|
605
|
+
output_sha256?: string | null;
|
|
606
|
+
reason_codes?: string[];
|
|
607
|
+
schema_version?: "1";
|
|
608
|
+
source_scope?: "original_input" | "engine_transformed_source";
|
|
609
|
+
source_sha256?: string | null;
|
|
610
|
+
source_to_output_transform?: number[][] | null;
|
|
611
|
+
status?: AssessmentStatus;
|
|
612
|
+
thresholds?: Record<string, unknown>;
|
|
613
|
+
thresholds_calibrated?: boolean;
|
|
614
|
+
transform_verified?: boolean;
|
|
615
|
+
}
|
|
616
|
+
/** Source-wall prediction at one size, never a certificate of the repaired print. */
|
|
617
|
+
export interface RecommendationAssessment {
|
|
618
|
+
clearance_basis?: "shell_count_heuristic" | "unavailable";
|
|
619
|
+
measurement_confidence?: "unavailable" | "limited";
|
|
620
|
+
open_surface_fraction?: number | null;
|
|
621
|
+
predicted_minimum_size_mm?: number | null;
|
|
622
|
+
process?: string | null;
|
|
623
|
+
reason_codes?: string[];
|
|
624
|
+
source_below_wall_fraction?: number | null;
|
|
625
|
+
source_below_wall_fraction_lower?: number | null;
|
|
626
|
+
source_below_wall_fraction_upper?: number | null;
|
|
627
|
+
status?: "not_assessed" | "needs_review";
|
|
628
|
+
target_mm?: number | null;
|
|
629
|
+
verified_minimum_size_mm?: number | null;
|
|
630
|
+
wall_basis?: "unavailable" | "measured" | "percentile_interpolation";
|
|
631
|
+
wall_floor_mm?: number | null;
|
|
632
|
+
wall_quantile_sizes_mm?: Record<string, number>;
|
|
633
|
+
}
|
|
634
|
+
export interface QualityAssessment {
|
|
635
|
+
print_readiness?: "not_assessed";
|
|
636
|
+
reason_codes?: string[];
|
|
637
|
+
status?: AssessmentStatus;
|
|
638
|
+
}
|
|
639
|
+
export interface Analysis {
|
|
640
|
+
schema_version?: "1";
|
|
641
|
+
simulated: boolean;
|
|
642
|
+
vertices: number;
|
|
643
|
+
faces: number;
|
|
644
|
+
volume_mm3: number;
|
|
645
|
+
surface_area_mm2: number;
|
|
646
|
+
dimensions_mm: [number, number, number];
|
|
647
|
+
is_watertight: boolean;
|
|
648
|
+
shells?: number | null;
|
|
649
|
+
warnings?: string[];
|
|
650
|
+
applied?: AppliedRepair | null;
|
|
651
|
+
fidelity?: FidelityReport;
|
|
652
|
+
recommendation_assessment?: RecommendationAssessment | null;
|
|
653
|
+
recommendation_assessments_by_scale?: Record<string, RecommendationAssessment> | null;
|
|
654
|
+
/** The engine's recommended repair params; send it back as `params` as-is. */
|
|
655
|
+
recommended?: RepairParams | null;
|
|
656
|
+
/** One entry per print-size group (`1in` ... `20in`), each with its `scale`. */
|
|
657
|
+
recommended_by_scale?: Record<string, RepairParams> | null;
|
|
658
|
+
}
|
|
659
|
+
export interface RepairIssue {
|
|
660
|
+
severity: "critical" | "warning" | "info";
|
|
661
|
+
name: string;
|
|
662
|
+
description: string;
|
|
663
|
+
fixed: boolean;
|
|
664
|
+
}
|
|
665
|
+
/** Before/after comparison of a repair job. */
|
|
666
|
+
export interface RepairResult {
|
|
667
|
+
schema_version?: "1";
|
|
668
|
+
simulated: boolean;
|
|
669
|
+
before: Analysis;
|
|
670
|
+
after: Analysis;
|
|
671
|
+
printability_score: number;
|
|
672
|
+
output_bytes: number;
|
|
673
|
+
applied?: AppliedRepair | null;
|
|
674
|
+
improvements?: string[];
|
|
675
|
+
issues?: RepairIssue[];
|
|
676
|
+
quality?: QualityAssessment;
|
|
677
|
+
}
|
|
678
|
+
/** The engine's result object of a tool job (keys depend on the tool). */
|
|
679
|
+
export interface ToolResult {
|
|
680
|
+
schema_version?: "1";
|
|
681
|
+
simulated: boolean;
|
|
682
|
+
tool: ToolName;
|
|
683
|
+
result: Record<string, unknown>;
|
|
684
|
+
}
|
|
685
|
+
export interface Job {
|
|
686
|
+
id: string;
|
|
687
|
+
input_file_id: string;
|
|
688
|
+
recipe: Recipe;
|
|
689
|
+
status: JobStatus;
|
|
690
|
+
livemode: boolean;
|
|
691
|
+
attempt: number;
|
|
692
|
+
created_at: string;
|
|
693
|
+
updated_at: string;
|
|
694
|
+
simulated?: boolean;
|
|
695
|
+
tool?: ToolName | null;
|
|
696
|
+
params?: Record<string, unknown> | null;
|
|
697
|
+
progress?: number | null;
|
|
698
|
+
stage?: string | null;
|
|
699
|
+
queue?: JobQueue | null;
|
|
700
|
+
analysis?: Analysis | null;
|
|
701
|
+
result?: RepairResult | ToolResult | CadCheckResult | null;
|
|
702
|
+
error_code?: string | null;
|
|
703
|
+
error_detail?: string | null;
|
|
704
|
+
usage?: JobUsage | null;
|
|
705
|
+
}
|
|
706
|
+
export interface JobPage {
|
|
707
|
+
data: Job[];
|
|
708
|
+
next_cursor?: string | null;
|
|
709
|
+
}
|
|
710
|
+
export interface JobEvent {
|
|
711
|
+
sequence: number;
|
|
712
|
+
status: string;
|
|
713
|
+
created_at: string;
|
|
714
|
+
progress?: number | null;
|
|
715
|
+
stage?: string | null;
|
|
716
|
+
}
|
|
717
|
+
/** Pass `next_after` as `after` to resume polling. */
|
|
718
|
+
export interface EventPage {
|
|
719
|
+
data: JobEvent[];
|
|
720
|
+
next_after: number;
|
|
721
|
+
}
|
|
722
|
+
export interface Artifact {
|
|
723
|
+
id: string;
|
|
724
|
+
job_id: string;
|
|
725
|
+
label: string;
|
|
726
|
+
size_bytes: number;
|
|
727
|
+
sha256: string;
|
|
728
|
+
media_type: string;
|
|
729
|
+
}
|
|
730
|
+
export interface ArtifactList {
|
|
731
|
+
data: Artifact[];
|
|
732
|
+
}
|
|
733
|
+
/**
|
|
734
|
+
* `ready`: download `artifact`. `converting`: `conversion_job_id` is making it.
|
|
735
|
+
* `failed`: `error_code` says why; creating the export again starts a new conversion.
|
|
736
|
+
*/
|
|
737
|
+
export interface Export {
|
|
738
|
+
job_id: string;
|
|
739
|
+
format: ExportFormat;
|
|
740
|
+
status: ExportStatus;
|
|
741
|
+
artifact?: Artifact | null;
|
|
742
|
+
conversion_job_id?: string | null;
|
|
743
|
+
error_code?: string | null;
|
|
744
|
+
}
|
|
745
|
+
/** 1 credit = 1 second of a job's run. `available` = included + purchased - held. */
|
|
746
|
+
export interface Balance {
|
|
747
|
+
included_credits: number;
|
|
748
|
+
purchased_credits: number;
|
|
749
|
+
held_credits: number;
|
|
750
|
+
available_credits: number;
|
|
751
|
+
period_start: string;
|
|
752
|
+
period_end: string;
|
|
753
|
+
low: boolean;
|
|
754
|
+
exhausted: boolean;
|
|
755
|
+
}
|
|
756
|
+
export interface CreditTransaction {
|
|
757
|
+
sequence: number;
|
|
758
|
+
kind: "plan_grant" | "expire" | "topup" | "adjust" | "hold" | "settle";
|
|
759
|
+
included_delta: number;
|
|
760
|
+
purchased_delta: number;
|
|
761
|
+
held_delta: number;
|
|
762
|
+
available_after: number;
|
|
763
|
+
created_at: string;
|
|
764
|
+
job_id?: string | null;
|
|
765
|
+
note?: string | null;
|
|
766
|
+
}
|
|
767
|
+
/** Newest first; pass `next_before` as `before` for the next page. */
|
|
768
|
+
export interface CreditTransactionPage {
|
|
769
|
+
data: CreditTransaction[];
|
|
770
|
+
next_before?: number | null;
|
|
771
|
+
}
|
|
772
|
+
/** Whether a job result is a repair's before/after comparison. */
|
|
773
|
+
export declare function isRepairResult(result: Job["result"]): result is RepairResult;
|
|
774
|
+
/** Whether a job result is a tool's result envelope. */
|
|
775
|
+
export declare function isToolResult(result: Job["result"]): result is ToolResult;
|
|
776
|
+
//# sourceMappingURL=types.d.ts.map
|