@printy3d/sdk 0.0.0-stage → 0.4.1
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 +86 -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/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
https://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
https://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,87 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @printy3d/sdk (TypeScript / JavaScript)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Official client for the [Printy3D](https://printy3d.ai) mesh-preparation API: upload a 3D model,
|
|
4
|
+
inspect it, repair it for printing, run tools (cut, measure, convert, structural analysis,
|
|
5
|
+
...), download the verified outputs and export to other formats.
|
|
6
|
+
|
|
7
|
+
- ESM, ships `.d.ts`; strict TypeScript.
|
|
8
|
+
- **No runtime dependencies**: the global `fetch` and `crypto` only (Node 20+ and modern browsers).
|
|
9
|
+
Path-based helpers (upload from a path, download to a file) load `node:` built-ins lazily
|
|
10
|
+
and work in Node only; bytes and `Blob` sources work everywhere.
|
|
11
|
+
- Licence: Apache-2.0.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @printy3d/sdk
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
You need an API key from the [Printy3D console](https://printy3d.ai/console). The client talks to
|
|
20
|
+
`https://api.printy3d.ai` unless you pass `baseUrl` or set `PRINTY3D_API_URL`. Full guide:
|
|
21
|
+
[printy3d.ai/docs/sdk/typescript](https://printy3d.ai/docs/sdk/typescript).
|
|
22
|
+
|
|
23
|
+
### Install from a local checkout (internal use)
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
(cd typescript && npm install && npm run build) # dev tools only: typescript, @types/node
|
|
27
|
+
npm install ./typescript # from your project; any path to the folder works
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Use
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import { Printy3D } from "@printy3d/sdk";
|
|
34
|
+
|
|
35
|
+
const client = new Printy3D(); // PRINTY3D_API_KEY and PRINTY3D_API_URL in Node
|
|
36
|
+
|
|
37
|
+
const inspected = await client.inspect("model.stl"); // upload, inspect, wait
|
|
38
|
+
console.log(inspected.analysis?.dimensions_mm, inspected.analysis?.is_watertight);
|
|
39
|
+
|
|
40
|
+
const repaired = await client.repair("model.stl", { profile: "character", params: { printer: "mimaki" } });
|
|
41
|
+
await client.downloadArtifacts(repaired.id, "out/repair");
|
|
42
|
+
|
|
43
|
+
const glb = await client.export(repaired.id, "glb"); // converts on the fleet when needed
|
|
44
|
+
await client.download(glb.artifact!, "out/");
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
In a browser, pass the key and a `File`/`Blob` (never ship a live secret key to a browser):
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
const client = new Printy3D({ apiKey, baseUrl });
|
|
51
|
+
const job = await client.inspect(fileInput.files[0]); // a File carries its own name
|
|
52
|
+
const report = await client.artifacts.read((await client.artifacts.list(job.id))[0]!);
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Every `/v1` operation is available directly: `client.org`, `client.formats`,
|
|
56
|
+
`client.profiles`, `client.apiKeys`, `client.files`, `client.jobs`, `client.artifacts`,
|
|
57
|
+
`client.exports`, `client.balance`. Wire objects keep the API's snake_case field names;
|
|
58
|
+
SDK options are camelCase.
|
|
59
|
+
|
|
60
|
+
Errors are one class, `Printy3DError`, with `status`, `code`, `title`, `detail`,
|
|
61
|
+
`requestId`, `retryAfter` and the problem body's extra fields (`required`, `available`,
|
|
62
|
+
`requiredScope`, `reason`, ...).
|
|
63
|
+
|
|
64
|
+
## Guides
|
|
65
|
+
|
|
66
|
+
The guides on the website show curl, Python and TypeScript side by side:
|
|
67
|
+
[quickstart](https://printy3d.ai/docs/quickstart),
|
|
68
|
+
[authentication and API keys](https://printy3d.ai/docs/authentication),
|
|
69
|
+
[uploads](https://printy3d.ai/docs/uploads), [jobs](https://printy3d.ai/docs/jobs),
|
|
70
|
+
[artifacts and exports](https://printy3d.ai/docs/artifacts),
|
|
71
|
+
[errors](https://printy3d.ai/docs/errors), [rate limits](https://printy3d.ai/docs/limits),
|
|
72
|
+
[billing](https://printy3d.ai/docs/billing), [Exact Check](https://printy3d.ai/docs/exact-check),
|
|
73
|
+
[webhooks](https://printy3d.ai/docs/webhooks).
|
|
74
|
+
|
|
75
|
+
Every step has a worked example in the
|
|
76
|
+
[TypeScript SDK guide](https://printy3d.ai/docs/sdk/typescript): inspect, repair with a profile,
|
|
77
|
+
cut with a plane, export to GLB, manage keys.
|
|
78
|
+
|
|
79
|
+
## Development
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
npm install
|
|
83
|
+
npm run typecheck # src + tests, strict
|
|
84
|
+
npm run build
|
|
85
|
+
npm test # node:test against a local mock server, never the real API
|
|
86
|
+
npm run check:examples # after build
|
|
87
|
+
```
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The two files a `cad_check` job stores, `cad_report` and `cad_digest`, and the facts about the
|
|
3
|
+
* preview GLB's thickness field. Read them with `client.artifacts.read` and `JSON.parse`.
|
|
4
|
+
*
|
|
5
|
+
* A schema 3 file carries every field. A file of schema 1 or 2 lacks the schema 3 fields (marked
|
|
6
|
+
* optional below), so it still types. The Rolling Ball fields (`walls_ball`, `min_wall_ball_mm`,
|
|
7
|
+
* ...) exist only when `methods` lists `"ball"`. Lengths are millimetres. A point inside a part is
|
|
8
|
+
* in the shape's own frame (it applies to every placed copy); a point of a pair is in the frame
|
|
9
|
+
* of the whole assembly.
|
|
10
|
+
*/
|
|
11
|
+
/** A thickness method the checker measured. */
|
|
12
|
+
export type CadMethod = "ray" | "ball";
|
|
13
|
+
export type CadPartStatus = "closed" | "open" | "sheet";
|
|
14
|
+
export type CadPairKind = "apart" | "touching" | "overlap";
|
|
15
|
+
/** `[x, y, z]` in millimetres. */
|
|
16
|
+
export type CadPoint = [number, number, number];
|
|
17
|
+
/** One wall or gap region of a part. */
|
|
18
|
+
export interface CadRegion {
|
|
19
|
+
min_mm: number;
|
|
20
|
+
median_mm: number;
|
|
21
|
+
area_mm2: number;
|
|
22
|
+
centroid: CadPoint;
|
|
23
|
+
bbox_min: CadPoint;
|
|
24
|
+
bbox_max: CadPoint;
|
|
25
|
+
/** Schema 3: the sample point of the region's smallest reading. */
|
|
26
|
+
min_at?: CadPoint | null;
|
|
27
|
+
/** Schema 3: the point that reading reached (in a Rolling Ball list, the far end of the diameter). */
|
|
28
|
+
min_to?: CadPoint | null;
|
|
29
|
+
}
|
|
30
|
+
/** One placed copy of a part (schema 2 and 3). */
|
|
31
|
+
export interface CadReportCopy {
|
|
32
|
+
/** `{part id}#{n}`. */
|
|
33
|
+
copy: string;
|
|
34
|
+
path: string[];
|
|
35
|
+
}
|
|
36
|
+
export interface CadReportPart {
|
|
37
|
+
id: string;
|
|
38
|
+
name: string;
|
|
39
|
+
paths: string[][];
|
|
40
|
+
/** Schema 2 and 3. */
|
|
41
|
+
copies?: CadReportCopy[] | null;
|
|
42
|
+
quantity: number;
|
|
43
|
+
status: CadPartStatus;
|
|
44
|
+
solids: number;
|
|
45
|
+
size_mm: CadPoint;
|
|
46
|
+
/** `null` unless every shape of the part is closed. */
|
|
47
|
+
volume_mm3: number | null;
|
|
48
|
+
area_mm2: number;
|
|
49
|
+
walls: CadRegion[];
|
|
50
|
+
gaps_inside: CadRegion[];
|
|
51
|
+
/** Rolling Ball regions: present only when the report's `methods` lists `"ball"`. */
|
|
52
|
+
walls_ball?: CadRegion[] | null;
|
|
53
|
+
gaps_inside_ball?: CadRegion[] | null;
|
|
54
|
+
/** Schema 3: mesh edges where two surfaces of the solid meet with no material between them. */
|
|
55
|
+
self_touch_edges?: number | null;
|
|
56
|
+
/** Schema 3: the midpoint of the first such edge; set exactly when the count is above 0. */
|
|
57
|
+
self_touch_at?: CadPoint | null;
|
|
58
|
+
}
|
|
59
|
+
export interface CadReportPairEnd {
|
|
60
|
+
part: string;
|
|
61
|
+
path: string[];
|
|
62
|
+
/** Schema 2 and 3. */
|
|
63
|
+
copy?: string | null;
|
|
64
|
+
}
|
|
65
|
+
export interface CadReportPair {
|
|
66
|
+
a: CadReportPairEnd;
|
|
67
|
+
b: CadReportPairEnd;
|
|
68
|
+
same_part: boolean;
|
|
69
|
+
kind: CadPairKind;
|
|
70
|
+
distance_mm: number | null;
|
|
71
|
+
overlap_depth_mm: number | null;
|
|
72
|
+
/** In the frame of the whole assembly. */
|
|
73
|
+
location: CadPoint;
|
|
74
|
+
}
|
|
75
|
+
/** `cad_report.json`: every part, wall and gap region, and part pair. */
|
|
76
|
+
export interface CadReport {
|
|
77
|
+
schema_version: 1 | 2 | 3;
|
|
78
|
+
units: string;
|
|
79
|
+
measure: {
|
|
80
|
+
chord_mm: number;
|
|
81
|
+
accuracy_mm: number;
|
|
82
|
+
wall_cap_mm: number;
|
|
83
|
+
gap_cap_mm: number;
|
|
84
|
+
sample_limit_per_shape: number;
|
|
85
|
+
/** Schema 3. */
|
|
86
|
+
methods?: CadMethod[] | null;
|
|
87
|
+
};
|
|
88
|
+
source: {
|
|
89
|
+
files: string[];
|
|
90
|
+
seconds: number;
|
|
91
|
+
triangles: number;
|
|
92
|
+
solids: number;
|
|
93
|
+
/** `null` or absent from a checker that did not count unread placements. */
|
|
94
|
+
unsupported_placements?: number | null;
|
|
95
|
+
};
|
|
96
|
+
parts: CadReportPart[];
|
|
97
|
+
pairs: CadReportPair[];
|
|
98
|
+
truncated: {
|
|
99
|
+
pairs: boolean;
|
|
100
|
+
regions: boolean;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
export interface CadDigestPart {
|
|
104
|
+
id: string;
|
|
105
|
+
name: string;
|
|
106
|
+
quantity: number;
|
|
107
|
+
status: CadPartStatus;
|
|
108
|
+
longest_mm: number;
|
|
109
|
+
min_wall_mm: number | null;
|
|
110
|
+
/** From schema 3 the thinnest point; `null` exactly when `min_wall_mm` is. */
|
|
111
|
+
wall_location: CadPoint | null;
|
|
112
|
+
/** Schema 3: where the wall reading reached. */
|
|
113
|
+
wall_to?: CadPoint | null;
|
|
114
|
+
min_gap_inside_mm: number | null;
|
|
115
|
+
gap_location: CadPoint | null;
|
|
116
|
+
/** Schema 3: where the gap reading reached. */
|
|
117
|
+
gap_to?: CadPoint | null;
|
|
118
|
+
/** Schema 3. */
|
|
119
|
+
self_touch_edges?: number | null;
|
|
120
|
+
self_touch_location?: CadPoint | null;
|
|
121
|
+
/** Rolling Ball readings: present only when the digest's `methods` lists `"ball"`. */
|
|
122
|
+
min_wall_ball_mm?: number | null;
|
|
123
|
+
wall_ball_location?: CadPoint | null;
|
|
124
|
+
wall_ball_to?: CadPoint | null;
|
|
125
|
+
min_gap_inside_ball_mm?: number | null;
|
|
126
|
+
gap_ball_location?: CadPoint | null;
|
|
127
|
+
gap_ball_to?: CadPoint | null;
|
|
128
|
+
}
|
|
129
|
+
export interface CadDigestPair {
|
|
130
|
+
a_name: string;
|
|
131
|
+
b_name: string;
|
|
132
|
+
/** Schema 2 and 3. */
|
|
133
|
+
a_copy?: string | null;
|
|
134
|
+
b_copy?: string | null;
|
|
135
|
+
same_part: boolean;
|
|
136
|
+
kind: CadPairKind;
|
|
137
|
+
distance_mm: number | null;
|
|
138
|
+
/** In the frame of the whole assembly. */
|
|
139
|
+
location: CadPoint;
|
|
140
|
+
}
|
|
141
|
+
/** `cad_digest.json`: the small part of a check the evaluation reads. */
|
|
142
|
+
export interface CadDigest {
|
|
143
|
+
schema_version: 1 | 2 | 3;
|
|
144
|
+
accuracy_mm: number;
|
|
145
|
+
/** Schema 3: a reading equal to its cap is "no reading". */
|
|
146
|
+
wall_cap_mm?: number | null;
|
|
147
|
+
gap_cap_mm?: number | null;
|
|
148
|
+
methods?: CadMethod[] | null;
|
|
149
|
+
sample_limit_per_shape: number;
|
|
150
|
+
truncated: boolean;
|
|
151
|
+
parts: CadDigestPart[];
|
|
152
|
+
pairs: CadDigestPair[];
|
|
153
|
+
/** `null` or absent from a checker that did not count unread placements. */
|
|
154
|
+
unsupported_placements?: number | null;
|
|
155
|
+
}
|
|
156
|
+
/** What the preview GLB's `asset.extras.stepcheck.field` says about its thickness attributes. */
|
|
157
|
+
export interface PreviewFieldInfo {
|
|
158
|
+
methods: CadMethod[];
|
|
159
|
+
wall_cap_mm: number;
|
|
160
|
+
gap_cap_mm: number;
|
|
161
|
+
accuracy_mm: number;
|
|
162
|
+
}
|
|
163
|
+
/** Per-vertex attribute holding the wall thickness, in millimetres. */
|
|
164
|
+
export declare const WALL_ATTRIBUTE = "_WALL_MM";
|
|
165
|
+
/** Per-vertex attribute holding the inside-gap width, in millimetres. */
|
|
166
|
+
export declare const GAP_ATTRIBUTE = "_GAP_MM";
|
|
167
|
+
/** A field value is a reading when it is below its cap by more than this. */
|
|
168
|
+
export declare const FIELD_VALID_MARGIN_MM = 0.0001;
|
|
169
|
+
//# sourceMappingURL=cad-documents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cad-documents.d.ts","sourceRoot":"","sources":["../src/cad-documents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,+CAA+C;AAC/C,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,MAAM,CAAC;AACvC,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AACxD,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAAC;AAC3D,kCAAkC;AAClC,MAAM,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAEhD,wCAAwC;AACxC,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,Q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D,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,OAAO,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;IAC7B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,4EAA4E;IAC5E,sBAAsB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxC;AAED,iGAAiG;AACjG,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,uEAAuE;AACvE,eAAO,MAAM,cAAc,aAAa,CAAC;AACzC,yEAAyE;AACzE,eAAO,MAAM,aAAa,YAAY,CAAC;AACvC,6EAA6E;AAC7E,eAAO,MAAM,qBAAqB,SAAS,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The two files a `cad_check` job stores, `cad_report` and `cad_digest`, and the facts about the
|
|
3
|
+
* preview GLB's thickness field. Read them with `client.artifacts.read` and `JSON.parse`.
|
|
4
|
+
*
|
|
5
|
+
* A schema 3 file carries every field. A file of schema 1 or 2 lacks the schema 3 fields (marked
|
|
6
|
+
* optional below), so it still types. The Rolling Ball fields (`walls_ball`, `min_wall_ball_mm`,
|
|
7
|
+
* ...) exist only when `methods` lists `"ball"`. Lengths are millimetres. A point inside a part is
|
|
8
|
+
* in the shape's own frame (it applies to every placed copy); a point of a pair is in the frame
|
|
9
|
+
* of the whole assembly.
|
|
10
|
+
*/
|
|
11
|
+
/** Per-vertex attribute holding the wall thickness, in millimetres. */
|
|
12
|
+
export const WALL_ATTRIBUTE = "_WALL_MM";
|
|
13
|
+
/** Per-vertex attribute holding the inside-gap width, in millimetres. */
|
|
14
|
+
export const GAP_ATTRIBUTE = "_GAP_MM";
|
|
15
|
+
/** A field value is a reading when it is below its cap by more than this. */
|
|
16
|
+
export const FIELD_VALID_MARGIN_MM = 0.0001;
|
|
17
|
+
//# sourceMappingURL=cad-documents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cad-documents.js","sourceRoot":"","sources":["../src/cad-documents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAkKH,uEAAuE;AACvE,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC;AACzC,yEAAyE;AACzE,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC;AACvC,6EAA6E;AAC7E,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC"}
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/** The `Printy3D` client: configuration, resource groups and the high-level helpers. */
|
|
2
|
+
import { type FetchLike } from "./http.js";
|
|
3
|
+
import { ApiKeys, Artifacts, BalanceResource, Exports, Files, Formats, Jobs, Org, Profiles, Technologies, WebhookEndpoints, type CallOptions, type IdempotentOptions, type JobWaitOptions, type UploadOptions, type WaitOptions } from "./resources.js";
|
|
4
|
+
import { verifyWebhook } from "./webhooks.js";
|
|
5
|
+
import type { UploadSource } from "./sources.js";
|
|
6
|
+
import type { Artifact, Export, ExportFormat, File, Job, ProfileId, Recipe, RepairParams, ToolName, ToolParamsMap } from "./types.js";
|
|
7
|
+
/** The Printy3D API (beta). */
|
|
8
|
+
export declare const DEFAULT_BASE_URL = "https://api.printy3d.ai";
|
|
9
|
+
export interface ClientOptions {
|
|
10
|
+
/** A `p3d_live_...` or `p3d_test_...` key. Defaults to `PRINTY3D_API_KEY` (Node). */
|
|
11
|
+
apiKey?: string;
|
|
12
|
+
/** Defaults to `PRINTY3D_API_URL` (Node), else `DEFAULT_BASE_URL`. */
|
|
13
|
+
baseUrl?: string;
|
|
14
|
+
/** Whole-request timeout for API calls (default 150 s). */
|
|
15
|
+
timeoutMs?: number;
|
|
16
|
+
/** Storage transfers: whole-PUT timeout, idle timeout for downloads (default 120 s). */
|
|
17
|
+
transferTimeoutMs?: number;
|
|
18
|
+
/** Retries of an idempotent request (default 4). */
|
|
19
|
+
maxRetries?: number;
|
|
20
|
+
/** The longest `Retry-After` slept through (default 60 s); longer ones throw at once. */
|
|
21
|
+
maxRetryDelayMs?: number;
|
|
22
|
+
/** Appended to the SDK's `User-Agent` (Node only; browsers never send one). */
|
|
23
|
+
userAgent?: string;
|
|
24
|
+
/** A custom `fetch` (proxies, instrumentation); defaults to the global one. */
|
|
25
|
+
fetch?: FetchLike;
|
|
26
|
+
/** Test hook: replaces the timer used for backoff and polling. */
|
|
27
|
+
sleep?: (ms: number) => Promise<void>;
|
|
28
|
+
/** Test hook: the jitter source, `[0, 1)`. */
|
|
29
|
+
random?: () => number;
|
|
30
|
+
}
|
|
31
|
+
/** What the run helpers accept: a path / bytes / Blob, an uploaded `File`, or a `file_...` id. */
|
|
32
|
+
export type JobSource = UploadSource | File;
|
|
33
|
+
export interface RunOptions extends JobWaitOptions, IdempotentOptions {
|
|
34
|
+
/** Default true: wait for a terminal status. */
|
|
35
|
+
wait?: boolean;
|
|
36
|
+
/** Options for the upload when `source` is not uploaded yet. */
|
|
37
|
+
upload?: UploadOptions;
|
|
38
|
+
}
|
|
39
|
+
export interface ExportOptions extends WaitOptions {
|
|
40
|
+
/** Default true: poll until `ready`. */
|
|
41
|
+
wait?: boolean;
|
|
42
|
+
}
|
|
43
|
+
export interface DownloadedArtifact {
|
|
44
|
+
artifact: Artifact;
|
|
45
|
+
path: string;
|
|
46
|
+
}
|
|
47
|
+
/** Client for the Printy3D `/v1` API. */
|
|
48
|
+
export declare class Printy3D {
|
|
49
|
+
readonly baseUrl: string;
|
|
50
|
+
readonly org: Org;
|
|
51
|
+
readonly formats: Formats;
|
|
52
|
+
readonly profiles: Profiles;
|
|
53
|
+
readonly apiKeys: ApiKeys;
|
|
54
|
+
readonly files: Files;
|
|
55
|
+
readonly jobs: Jobs;
|
|
56
|
+
readonly artifacts: Artifacts;
|
|
57
|
+
readonly exports: Exports;
|
|
58
|
+
readonly balance: BalanceResource;
|
|
59
|
+
readonly technologies: Technologies;
|
|
60
|
+
readonly webhookEndpoints: WebhookEndpoints;
|
|
61
|
+
/** Receiver helpers: `webhooks.verify(rawBody, header, secret)`. */
|
|
62
|
+
readonly webhooks: {
|
|
63
|
+
verify: typeof verifyWebhook;
|
|
64
|
+
};
|
|
65
|
+
private readonly transport;
|
|
66
|
+
constructor(options?: ClientOptions);
|
|
67
|
+
toJSON(): {
|
|
68
|
+
baseUrl: string;
|
|
69
|
+
};
|
|
70
|
+
/** Upload and return the file `ready`. See `Files.upload`. */
|
|
71
|
+
upload(source: UploadSource, options?: UploadOptions): Promise<File>;
|
|
72
|
+
private fileId;
|
|
73
|
+
/**
|
|
74
|
+
* Upload `source` when needed, create a job and wait for it. `source` is a path (Node),
|
|
75
|
+
* bytes, a Blob, an uploaded `File` or a `file_...` id.
|
|
76
|
+
*/
|
|
77
|
+
run(source: JobSource, body: {
|
|
78
|
+
recipe?: Recipe;
|
|
79
|
+
tool?: ToolName;
|
|
80
|
+
params?: unknown;
|
|
81
|
+
notify?: {
|
|
82
|
+
webhook_endpoint: string;
|
|
83
|
+
} | null;
|
|
84
|
+
}, options?: RunOptions): Promise<Job>;
|
|
85
|
+
/**
|
|
86
|
+
* Analysis of the mesh: `job.analysis` (dimensions, volume, watertightness, recommended
|
|
87
|
+
* repair params) plus thumbnails, preview and report artifacts.
|
|
88
|
+
*/
|
|
89
|
+
inspect(source: JobSource, options?: RunOptions): Promise<Job>;
|
|
90
|
+
/**
|
|
91
|
+
* Repair for print. `profile` chooses where unset params come from (`recommended` by
|
|
92
|
+
* default); every field of `params` overrides that field.
|
|
93
|
+
*/
|
|
94
|
+
repair(source: JobSource, options?: RunOptions & {
|
|
95
|
+
profile?: ProfileId;
|
|
96
|
+
params?: RepairParams;
|
|
97
|
+
}): Promise<Job>;
|
|
98
|
+
/** Run one tool (`cut`, `measure`, `convert`, ...) with its params. */
|
|
99
|
+
tool<T extends ToolName>(source: JobSource, tool: T, params?: ToolParamsMap[T], options?: RunOptions): Promise<Job>;
|
|
100
|
+
/** Save one artifact, verified (Node). `dest` is a file path or a directory. */
|
|
101
|
+
download(artifact: Artifact, dest?: string, options?: CallOptions): Promise<string>;
|
|
102
|
+
/**
|
|
103
|
+
* Save every artifact of a succeeded job (or only `labels`) into `destDir` as
|
|
104
|
+
* `<label><ext>`, each verified against its size and SHA-256 (Node).
|
|
105
|
+
*/
|
|
106
|
+
downloadArtifacts(jobId: string, destDir: string, options?: CallOptions & {
|
|
107
|
+
labels?: string[];
|
|
108
|
+
}): Promise<DownloadedArtifact[]>;
|
|
109
|
+
/**
|
|
110
|
+
* Ask for the job's output in `format`; by default poll until `ready`. A format the job
|
|
111
|
+
* did not generate starts one conversion job on the GPU fleet, held and charged like any
|
|
112
|
+
* `convert` job (test keys: `501`). Download with `client.download(export.artifact!, dir)`.
|
|
113
|
+
*/
|
|
114
|
+
export(jobId: string, format: ExportFormat, options?: ExportOptions): Promise<Export>;
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,wFAAwF;AAGxF,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EACL,OAAO,EACP,SAAS,EACT,eAAe,EACf,OAAO,EACP,KAAK,EACL,OAAO,EACP,IAAI,EACJ,GAAG,EACH,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAGhB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,WAAW,EACjB,MAAM,gBAAgB,CAA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