@toolpath/api 0.1.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 +21 -0
- package/README.md +29 -0
- package/dist/client.d.ts +14 -0
- package/dist/client.js +15 -0
- package/dist/generated/apis/FeaturesApi.d.ts +50 -0
- package/dist/generated/apis/FeaturesApi.js +102 -0
- package/dist/generated/apis/JobsApi.d.ts +79 -0
- package/dist/generated/apis/JobsApi.js +165 -0
- package/dist/generated/apis/KeysApi.d.ts +32 -0
- package/dist/generated/apis/KeysApi.js +58 -0
- package/dist/generated/apis/PartsApi.d.ts +76 -0
- package/dist/generated/apis/PartsApi.js +157 -0
- package/dist/generated/apis/ServiceApi.d.ts +43 -0
- package/dist/generated/apis/ServiceApi.js +79 -0
- package/dist/generated/apis/index.d.ts +5 -0
- package/dist/generated/apis/index.js +7 -0
- package/dist/generated/index.d.ts +3 -0
- package/dist/generated/index.js +5 -0
- package/dist/generated/models/AnalyzeJobResponse.d.ts +51 -0
- package/dist/generated/models/AnalyzeJobResponse.js +59 -0
- package/dist/generated/models/ComputeFeatureDatasheetsRequest.d.ts +32 -0
- package/dist/generated/models/ComputeFeatureDatasheetsRequest.js +43 -0
- package/dist/generated/models/ComputeFeatureDatasheetsResponse.d.ts +51 -0
- package/dist/generated/models/ComputeFeatureDatasheetsResponse.js +59 -0
- package/dist/generated/models/CreatePartResponse.d.ts +50 -0
- package/dist/generated/models/CreatePartResponse.js +55 -0
- package/dist/generated/models/DirectionZBounds.d.ts +45 -0
- package/dist/generated/models/DirectionZBounds.js +52 -0
- package/dist/generated/models/FeatureDatasheetEntry.d.ts +52 -0
- package/dist/generated/models/FeatureDatasheetEntry.js +53 -0
- package/dist/generated/models/FeatureDatasheetsResponse.d.ts +39 -0
- package/dist/generated/models/FeatureDatasheetsResponse.js +48 -0
- package/dist/generated/models/HealthResponse.d.ts +54 -0
- package/dist/generated/models/HealthResponse.js +61 -0
- package/dist/generated/models/JobDetail.d.ts +84 -0
- package/dist/generated/models/JobDetail.js +80 -0
- package/dist/generated/models/JobSummary.d.ts +72 -0
- package/dist/generated/models/JobSummary.js +72 -0
- package/dist/generated/models/KeyValidationResponse.d.ts +48 -0
- package/dist/generated/models/KeyValidationResponse.js +56 -0
- package/dist/generated/models/ListJobsResponse.d.ts +51 -0
- package/dist/generated/models/ListJobsResponse.js +56 -0
- package/dist/generated/models/OpenApiDocument.d.ts +33 -0
- package/dist/generated/models/OpenApiDocument.js +45 -0
- package/dist/generated/models/PartFeature.d.ts +64 -0
- package/dist/generated/models/PartFeature.js +65 -0
- package/dist/generated/models/PartFeatureAxis.d.ts +44 -0
- package/dist/generated/models/PartFeatureAxis.js +51 -0
- package/dist/generated/models/PartReportResponse.d.ts +139 -0
- package/dist/generated/models/PartReportResponse.js +120 -0
- package/dist/generated/models/ProblemDetails.d.ts +62 -0
- package/dist/generated/models/ProblemDetails.js +59 -0
- package/dist/generated/models/Region.d.ts +56 -0
- package/dist/generated/models/Region.js +59 -0
- package/dist/generated/models/ReportUnits.d.ts +52 -0
- package/dist/generated/models/ReportUnits.js +63 -0
- package/dist/generated/models/Vec3.d.ts +44 -0
- package/dist/generated/models/Vec3.js +51 -0
- package/dist/generated/models/index.d.ts +20 -0
- package/dist/generated/models/index.js +22 -0
- package/dist/generated/runtime.d.ts +185 -0
- package/dist/generated/runtime.js +351 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/upload.d.ts +5 -0
- package/dist/upload.js +13 -0
- package/package.json +48 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Toolpath
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Toolpath TypeScript SDK
|
|
2
|
+
|
|
3
|
+
`@toolpath/api` provides TypeScript bindings and an upload helper for the Toolpath Engine API.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @toolpath/api
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Create an API key in the [Toolpath portal](https://portal.toolpath.com/api-keys), then create a client:
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { createToolpathClient, uploadToPresignedUrl } from '@toolpath/api'
|
|
15
|
+
|
|
16
|
+
const client = createToolpathClient({ apiKey: process.env.TOOLPATH_API_KEY! })
|
|
17
|
+
const part = await client.parts.createPart({ filename: 'bracket.step' })
|
|
18
|
+
|
|
19
|
+
await uploadToPresignedUrl(part.uploadUrl, stepFileBytes)
|
|
20
|
+
const analysis = await client.parts.analyzePart({ id: part.partId })
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The SDK exports generated request, response, and API types from the Toolpath OpenAPI contract. See the
|
|
24
|
+
[TypeScript example](../../examples/typescript) and [API documentation](https://developers.toolpath.com)
|
|
25
|
+
for a complete analysis flow.
|
|
26
|
+
|
|
27
|
+
## License
|
|
28
|
+
|
|
29
|
+
MIT
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FeaturesApi, JobsApi, KeysApi, PartsApi, ServiceApi } from './generated/index.js';
|
|
2
|
+
export interface ToolpathClientOptions {
|
|
3
|
+
apiKey: string;
|
|
4
|
+
baseUrl?: string;
|
|
5
|
+
fetch?: typeof globalThis.fetch;
|
|
6
|
+
}
|
|
7
|
+
export interface ToolpathClient {
|
|
8
|
+
features: FeaturesApi;
|
|
9
|
+
jobs: JobsApi;
|
|
10
|
+
keys: KeysApi;
|
|
11
|
+
parts: PartsApi;
|
|
12
|
+
service: ServiceApi;
|
|
13
|
+
}
|
|
14
|
+
export declare const createToolpathClient: ({ apiKey, baseUrl, fetch, }: ToolpathClientOptions) => ToolpathClient;
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Configuration, FeaturesApi, JobsApi, KeysApi, PartsApi, ServiceApi, } from './generated/index.js';
|
|
2
|
+
export const createToolpathClient = ({ apiKey, baseUrl = 'https://api.toolpath.com', fetch, }) => {
|
|
3
|
+
const configuration = new Configuration({
|
|
4
|
+
basePath: baseUrl,
|
|
5
|
+
accessToken: apiKey,
|
|
6
|
+
fetchApi: fetch,
|
|
7
|
+
});
|
|
8
|
+
return {
|
|
9
|
+
features: new FeaturesApi(configuration),
|
|
10
|
+
jobs: new JobsApi(configuration),
|
|
11
|
+
keys: new KeysApi(configuration),
|
|
12
|
+
parts: new PartsApi(configuration),
|
|
13
|
+
service: new ServiceApi(configuration),
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Toolpath Engine API
|
|
3
|
+
* Public REST API for Toolpath engine operations. **Units.** All dimensional values — in reports and in feature datasheets — are in millimetres; all angles are in degrees. Each report also states this in its `units` field. **Browser use.** CORS is per API key: a request only receives an `Access-Control-Allow-Origin` header when its `Origin` is in the allowlist configured on the key used (set when creating or editing the key in the portal). A key with no allowed origins is server-to-server only. A Bearer API key placed in client-side JavaScript is readable by anyone — restrict its origins, prefer a `read_only` key (read_only keys may call GET operations only; writes are rejected with 403), or proxy requests through your own server.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import * as runtime from '../runtime.js';
|
|
13
|
+
import { type ComputeFeatureDatasheetsRequest } from '../models/ComputeFeatureDatasheetsRequest.js';
|
|
14
|
+
import { type ComputeFeatureDatasheetsResponse } from '../models/ComputeFeatureDatasheetsResponse.js';
|
|
15
|
+
import { type FeatureDatasheetsResponse } from '../models/FeatureDatasheetsResponse.js';
|
|
16
|
+
export interface ComputeFeatureDatasheetsOperationRequest {
|
|
17
|
+
computeFeatureDatasheetsRequest?: ComputeFeatureDatasheetsRequest;
|
|
18
|
+
}
|
|
19
|
+
export interface GetFeatureDatasheetsRequest {
|
|
20
|
+
ids: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
export declare class FeaturesApi extends runtime.BaseAPI {
|
|
26
|
+
/**
|
|
27
|
+
* Creates request options for computeFeatureDatasheets without sending the request
|
|
28
|
+
*/
|
|
29
|
+
computeFeatureDatasheetsRequestOpts(requestParameters: ComputeFeatureDatasheetsOperationRequest): Promise<runtime.RequestOpts>;
|
|
30
|
+
/**
|
|
31
|
+
* Queue datasheet computation for a list of features
|
|
32
|
+
*/
|
|
33
|
+
computeFeatureDatasheetsRaw(requestParameters: ComputeFeatureDatasheetsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ComputeFeatureDatasheetsResponse>>;
|
|
34
|
+
/**
|
|
35
|
+
* Queue datasheet computation for a list of features
|
|
36
|
+
*/
|
|
37
|
+
computeFeatureDatasheets(requestParameters?: ComputeFeatureDatasheetsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ComputeFeatureDatasheetsResponse>;
|
|
38
|
+
/**
|
|
39
|
+
* Creates request options for getFeatureDatasheets without sending the request
|
|
40
|
+
*/
|
|
41
|
+
getFeatureDatasheetsRequestOpts(requestParameters: GetFeatureDatasheetsRequest): Promise<runtime.RequestOpts>;
|
|
42
|
+
/**
|
|
43
|
+
* Get datasheets for a list of features
|
|
44
|
+
*/
|
|
45
|
+
getFeatureDatasheetsRaw(requestParameters: GetFeatureDatasheetsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FeatureDatasheetsResponse>>;
|
|
46
|
+
/**
|
|
47
|
+
* Get datasheets for a list of features
|
|
48
|
+
*/
|
|
49
|
+
getFeatureDatasheets(requestParameters: GetFeatureDatasheetsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FeatureDatasheetsResponse>;
|
|
50
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Toolpath Engine API
|
|
5
|
+
* Public REST API for Toolpath engine operations. **Units.** All dimensional values — in reports and in feature datasheets — are in millimetres; all angles are in degrees. Each report also states this in its `units` field. **Browser use.** CORS is per API key: a request only receives an `Access-Control-Allow-Origin` header when its `Origin` is in the allowlist configured on the key used (set when creating or editing the key in the portal). A key with no allowed origins is server-to-server only. A Bearer API key placed in client-side JavaScript is readable by anyone — restrict its origins, prefer a `read_only` key (read_only keys may call GET operations only; writes are rejected with 403), or proxy requests through your own server.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
import * as runtime from '../runtime.js';
|
|
15
|
+
import { ComputeFeatureDatasheetsRequestToJSON, } from '../models/ComputeFeatureDatasheetsRequest.js';
|
|
16
|
+
import { ComputeFeatureDatasheetsResponseFromJSON, } from '../models/ComputeFeatureDatasheetsResponse.js';
|
|
17
|
+
import { FeatureDatasheetsResponseFromJSON, } from '../models/FeatureDatasheetsResponse.js';
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
export class FeaturesApi extends runtime.BaseAPI {
|
|
22
|
+
/**
|
|
23
|
+
* Creates request options for computeFeatureDatasheets without sending the request
|
|
24
|
+
*/
|
|
25
|
+
async computeFeatureDatasheetsRequestOpts(requestParameters) {
|
|
26
|
+
const queryParameters = {};
|
|
27
|
+
const headerParameters = {};
|
|
28
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
29
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
30
|
+
const token = this.configuration.accessToken;
|
|
31
|
+
const tokenString = await token('ApiKeyAuth', []);
|
|
32
|
+
if (tokenString) {
|
|
33
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
let urlPath = `/v1/features/datasheets`;
|
|
37
|
+
return {
|
|
38
|
+
path: urlPath,
|
|
39
|
+
method: 'POST',
|
|
40
|
+
headers: headerParameters,
|
|
41
|
+
query: queryParameters,
|
|
42
|
+
body: ComputeFeatureDatasheetsRequestToJSON(requestParameters['computeFeatureDatasheetsRequest']),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Queue datasheet computation for a list of features
|
|
47
|
+
*/
|
|
48
|
+
async computeFeatureDatasheetsRaw(requestParameters, initOverrides) {
|
|
49
|
+
const requestOptions = await this.computeFeatureDatasheetsRequestOpts(requestParameters);
|
|
50
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
51
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ComputeFeatureDatasheetsResponseFromJSON(jsonValue));
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Queue datasheet computation for a list of features
|
|
55
|
+
*/
|
|
56
|
+
async computeFeatureDatasheets(requestParameters = {}, initOverrides) {
|
|
57
|
+
const response = await this.computeFeatureDatasheetsRaw(requestParameters, initOverrides);
|
|
58
|
+
return await response.value();
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Creates request options for getFeatureDatasheets without sending the request
|
|
62
|
+
*/
|
|
63
|
+
async getFeatureDatasheetsRequestOpts(requestParameters) {
|
|
64
|
+
if (requestParameters['ids'] == null) {
|
|
65
|
+
throw new runtime.RequiredError('ids', 'Required parameter "ids" was null or undefined when calling getFeatureDatasheets().');
|
|
66
|
+
}
|
|
67
|
+
const queryParameters = {};
|
|
68
|
+
if (requestParameters['ids'] != null) {
|
|
69
|
+
queryParameters['ids'] = requestParameters['ids'];
|
|
70
|
+
}
|
|
71
|
+
const headerParameters = {};
|
|
72
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
73
|
+
const token = this.configuration.accessToken;
|
|
74
|
+
const tokenString = await token('ApiKeyAuth', []);
|
|
75
|
+
if (tokenString) {
|
|
76
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
let urlPath = `/v1/features/datasheets`;
|
|
80
|
+
return {
|
|
81
|
+
path: urlPath,
|
|
82
|
+
method: 'GET',
|
|
83
|
+
headers: headerParameters,
|
|
84
|
+
query: queryParameters,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Get datasheets for a list of features
|
|
89
|
+
*/
|
|
90
|
+
async getFeatureDatasheetsRaw(requestParameters, initOverrides) {
|
|
91
|
+
const requestOptions = await this.getFeatureDatasheetsRequestOpts(requestParameters);
|
|
92
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
93
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => FeatureDatasheetsResponseFromJSON(jsonValue));
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Get datasheets for a list of features
|
|
97
|
+
*/
|
|
98
|
+
async getFeatureDatasheets(requestParameters, initOverrides) {
|
|
99
|
+
const response = await this.getFeatureDatasheetsRaw(requestParameters, initOverrides);
|
|
100
|
+
return await response.value();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Toolpath Engine API
|
|
3
|
+
* Public REST API for Toolpath engine operations. **Units.** All dimensional values — in reports and in feature datasheets — are in millimetres; all angles are in degrees. Each report also states this in its `units` field. **Browser use.** CORS is per API key: a request only receives an `Access-Control-Allow-Origin` header when its `Origin` is in the allowlist configured on the key used (set when creating or editing the key in the portal). A key with no allowed origins is server-to-server only. A Bearer API key placed in client-side JavaScript is readable by anyone — restrict its origins, prefer a `read_only` key (read_only keys may call GET operations only; writes are rejected with 403), or proxy requests through your own server.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import * as runtime from '../runtime.js';
|
|
13
|
+
import { type JobDetail } from '../models/JobDetail.js';
|
|
14
|
+
import { type ListJobsResponse } from '../models/ListJobsResponse.js';
|
|
15
|
+
export interface GetJobRequest {
|
|
16
|
+
id: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ListJobsRequest {
|
|
19
|
+
page?: number;
|
|
20
|
+
pageSize?: number;
|
|
21
|
+
partId?: string;
|
|
22
|
+
status?: ListJobsStatusEnum;
|
|
23
|
+
}
|
|
24
|
+
export interface StreamJobEventsRequest {
|
|
25
|
+
id: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
export declare class JobsApi extends runtime.BaseAPI {
|
|
31
|
+
/**
|
|
32
|
+
* Creates request options for getJob without sending the request
|
|
33
|
+
*/
|
|
34
|
+
getJobRequestOpts(requestParameters: GetJobRequest): Promise<runtime.RequestOpts>;
|
|
35
|
+
/**
|
|
36
|
+
* Get a job
|
|
37
|
+
*/
|
|
38
|
+
getJobRaw(requestParameters: GetJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<JobDetail>>;
|
|
39
|
+
/**
|
|
40
|
+
* Get a job
|
|
41
|
+
*/
|
|
42
|
+
getJob(requestParameters: GetJobRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JobDetail>;
|
|
43
|
+
/**
|
|
44
|
+
* Creates request options for listJobs without sending the request
|
|
45
|
+
*/
|
|
46
|
+
listJobsRequestOpts(requestParameters: ListJobsRequest): Promise<runtime.RequestOpts>;
|
|
47
|
+
/**
|
|
48
|
+
* List jobs
|
|
49
|
+
*/
|
|
50
|
+
listJobsRaw(requestParameters: ListJobsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListJobsResponse>>;
|
|
51
|
+
/**
|
|
52
|
+
* List jobs
|
|
53
|
+
*/
|
|
54
|
+
listJobs(requestParameters?: ListJobsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListJobsResponse>;
|
|
55
|
+
/**
|
|
56
|
+
* Creates request options for streamJobEvents without sending the request
|
|
57
|
+
*/
|
|
58
|
+
streamJobEventsRequestOpts(requestParameters: StreamJobEventsRequest): Promise<runtime.RequestOpts>;
|
|
59
|
+
/**
|
|
60
|
+
* Sends the current job immediately, then sends every subsequent persisted status, progress, or error change as a `job` server-sent event while the connection remains open. If the connection closes, reconnect to receive the latest job snapshot before continuing with future updates.
|
|
61
|
+
* Stream job updates
|
|
62
|
+
*/
|
|
63
|
+
streamJobEventsRaw(requestParameters: StreamJobEventsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>>;
|
|
64
|
+
/**
|
|
65
|
+
* Sends the current job immediately, then sends every subsequent persisted status, progress, or error change as a `job` server-sent event while the connection remains open. If the connection closes, reconnect to receive the latest job snapshot before continuing with future updates.
|
|
66
|
+
* Stream job updates
|
|
67
|
+
*/
|
|
68
|
+
streamJobEvents(requestParameters: StreamJobEventsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string>;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* @export
|
|
72
|
+
*/
|
|
73
|
+
export declare const ListJobsStatusEnum: {
|
|
74
|
+
readonly Queued: "queued";
|
|
75
|
+
readonly Running: "running";
|
|
76
|
+
readonly Succeeded: "succeeded";
|
|
77
|
+
readonly Failed: "failed";
|
|
78
|
+
};
|
|
79
|
+
export type ListJobsStatusEnum = (typeof ListJobsStatusEnum)[keyof typeof ListJobsStatusEnum];
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Toolpath Engine API
|
|
5
|
+
* Public REST API for Toolpath engine operations. **Units.** All dimensional values — in reports and in feature datasheets — are in millimetres; all angles are in degrees. Each report also states this in its `units` field. **Browser use.** CORS is per API key: a request only receives an `Access-Control-Allow-Origin` header when its `Origin` is in the allowlist configured on the key used (set when creating or editing the key in the portal). A key with no allowed origins is server-to-server only. A Bearer API key placed in client-side JavaScript is readable by anyone — restrict its origins, prefer a `read_only` key (read_only keys may call GET operations only; writes are rejected with 403), or proxy requests through your own server.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
import * as runtime from '../runtime.js';
|
|
15
|
+
import { JobDetailFromJSON } from '../models/JobDetail.js';
|
|
16
|
+
import { ListJobsResponseFromJSON, } from '../models/ListJobsResponse.js';
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
export class JobsApi extends runtime.BaseAPI {
|
|
21
|
+
/**
|
|
22
|
+
* Creates request options for getJob without sending the request
|
|
23
|
+
*/
|
|
24
|
+
async getJobRequestOpts(requestParameters) {
|
|
25
|
+
if (requestParameters['id'] == null) {
|
|
26
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getJob().');
|
|
27
|
+
}
|
|
28
|
+
const queryParameters = {};
|
|
29
|
+
const headerParameters = {};
|
|
30
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
31
|
+
const token = this.configuration.accessToken;
|
|
32
|
+
const tokenString = await token('ApiKeyAuth', []);
|
|
33
|
+
if (tokenString) {
|
|
34
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
let urlPath = `/v1/jobs/{id}`;
|
|
38
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
39
|
+
return {
|
|
40
|
+
path: urlPath,
|
|
41
|
+
method: 'GET',
|
|
42
|
+
headers: headerParameters,
|
|
43
|
+
query: queryParameters,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Get a job
|
|
48
|
+
*/
|
|
49
|
+
async getJobRaw(requestParameters, initOverrides) {
|
|
50
|
+
const requestOptions = await this.getJobRequestOpts(requestParameters);
|
|
51
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
52
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => JobDetailFromJSON(jsonValue));
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Get a job
|
|
56
|
+
*/
|
|
57
|
+
async getJob(requestParameters, initOverrides) {
|
|
58
|
+
const response = await this.getJobRaw(requestParameters, initOverrides);
|
|
59
|
+
return await response.value();
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Creates request options for listJobs without sending the request
|
|
63
|
+
*/
|
|
64
|
+
async listJobsRequestOpts(requestParameters) {
|
|
65
|
+
const queryParameters = {};
|
|
66
|
+
if (requestParameters['page'] != null) {
|
|
67
|
+
queryParameters['page'] = requestParameters['page'];
|
|
68
|
+
}
|
|
69
|
+
if (requestParameters['pageSize'] != null) {
|
|
70
|
+
queryParameters['pageSize'] = requestParameters['pageSize'];
|
|
71
|
+
}
|
|
72
|
+
if (requestParameters['partId'] != null) {
|
|
73
|
+
queryParameters['partId'] = requestParameters['partId'];
|
|
74
|
+
}
|
|
75
|
+
if (requestParameters['status'] != null) {
|
|
76
|
+
queryParameters['status'] = requestParameters['status'];
|
|
77
|
+
}
|
|
78
|
+
const headerParameters = {};
|
|
79
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
80
|
+
const token = this.configuration.accessToken;
|
|
81
|
+
const tokenString = await token('ApiKeyAuth', []);
|
|
82
|
+
if (tokenString) {
|
|
83
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
let urlPath = `/v1/jobs`;
|
|
87
|
+
return {
|
|
88
|
+
path: urlPath,
|
|
89
|
+
method: 'GET',
|
|
90
|
+
headers: headerParameters,
|
|
91
|
+
query: queryParameters,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* List jobs
|
|
96
|
+
*/
|
|
97
|
+
async listJobsRaw(requestParameters, initOverrides) {
|
|
98
|
+
const requestOptions = await this.listJobsRequestOpts(requestParameters);
|
|
99
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
100
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ListJobsResponseFromJSON(jsonValue));
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* List jobs
|
|
104
|
+
*/
|
|
105
|
+
async listJobs(requestParameters = {}, initOverrides) {
|
|
106
|
+
const response = await this.listJobsRaw(requestParameters, initOverrides);
|
|
107
|
+
return await response.value();
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Creates request options for streamJobEvents without sending the request
|
|
111
|
+
*/
|
|
112
|
+
async streamJobEventsRequestOpts(requestParameters) {
|
|
113
|
+
if (requestParameters['id'] == null) {
|
|
114
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling streamJobEvents().');
|
|
115
|
+
}
|
|
116
|
+
const queryParameters = {};
|
|
117
|
+
const headerParameters = {};
|
|
118
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
119
|
+
const token = this.configuration.accessToken;
|
|
120
|
+
const tokenString = await token('ApiKeyAuth', []);
|
|
121
|
+
if (tokenString) {
|
|
122
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
let urlPath = `/v1/jobs/{id}/events`;
|
|
126
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
127
|
+
return {
|
|
128
|
+
path: urlPath,
|
|
129
|
+
method: 'GET',
|
|
130
|
+
headers: headerParameters,
|
|
131
|
+
query: queryParameters,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Sends the current job immediately, then sends every subsequent persisted status, progress, or error change as a `job` server-sent event while the connection remains open. If the connection closes, reconnect to receive the latest job snapshot before continuing with future updates.
|
|
136
|
+
* Stream job updates
|
|
137
|
+
*/
|
|
138
|
+
async streamJobEventsRaw(requestParameters, initOverrides) {
|
|
139
|
+
const requestOptions = await this.streamJobEventsRequestOpts(requestParameters);
|
|
140
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
141
|
+
if (this.isJsonMime(response.headers.get('content-type'))) {
|
|
142
|
+
return new runtime.JSONApiResponse(response);
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
return new runtime.TextApiResponse(response);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Sends the current job immediately, then sends every subsequent persisted status, progress, or error change as a `job` server-sent event while the connection remains open. If the connection closes, reconnect to receive the latest job snapshot before continuing with future updates.
|
|
150
|
+
* Stream job updates
|
|
151
|
+
*/
|
|
152
|
+
async streamJobEvents(requestParameters, initOverrides) {
|
|
153
|
+
const response = await this.streamJobEventsRaw(requestParameters, initOverrides);
|
|
154
|
+
return await response.value();
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* @export
|
|
159
|
+
*/
|
|
160
|
+
export const ListJobsStatusEnum = {
|
|
161
|
+
Queued: 'queued',
|
|
162
|
+
Running: 'running',
|
|
163
|
+
Succeeded: 'succeeded',
|
|
164
|
+
Failed: 'failed',
|
|
165
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Toolpath Engine API
|
|
3
|
+
* Public REST API for Toolpath engine operations. **Units.** All dimensional values — in reports and in feature datasheets — are in millimetres; all angles are in degrees. Each report also states this in its `units` field. **Browser use.** CORS is per API key: a request only receives an `Access-Control-Allow-Origin` header when its `Origin` is in the allowlist configured on the key used (set when creating or editing the key in the portal). A key with no allowed origins is server-to-server only. A Bearer API key placed in client-side JavaScript is readable by anyone — restrict its origins, prefer a `read_only` key (read_only keys may call GET operations only; writes are rejected with 403), or proxy requests through your own server.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import * as runtime from '../runtime.js';
|
|
13
|
+
import { type KeyValidationResponse } from '../models/KeyValidationResponse.js';
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
export declare class KeysApi extends runtime.BaseAPI {
|
|
18
|
+
/**
|
|
19
|
+
* Creates request options for validateKey without sending the request
|
|
20
|
+
*/
|
|
21
|
+
validateKeyRequestOpts(): Promise<runtime.RequestOpts>;
|
|
22
|
+
/**
|
|
23
|
+
* Reports the status of the API key supplied in the Authorization header. A usable key returns 200; a missing, revoked, expired, or unknown key returns 401 — both with the same status body (never problem+json) — so bring-your-own-key integrations can confirm a key and show why it failed.
|
|
24
|
+
* Validate an API key
|
|
25
|
+
*/
|
|
26
|
+
validateKeyRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<KeyValidationResponse>>;
|
|
27
|
+
/**
|
|
28
|
+
* Reports the status of the API key supplied in the Authorization header. A usable key returns 200; a missing, revoked, expired, or unknown key returns 401 — both with the same status body (never problem+json) — so bring-your-own-key integrations can confirm a key and show why it failed.
|
|
29
|
+
* Validate an API key
|
|
30
|
+
*/
|
|
31
|
+
validateKey(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<KeyValidationResponse>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Toolpath Engine API
|
|
5
|
+
* Public REST API for Toolpath engine operations. **Units.** All dimensional values — in reports and in feature datasheets — are in millimetres; all angles are in degrees. Each report also states this in its `units` field. **Browser use.** CORS is per API key: a request only receives an `Access-Control-Allow-Origin` header when its `Origin` is in the allowlist configured on the key used (set when creating or editing the key in the portal). A key with no allowed origins is server-to-server only. A Bearer API key placed in client-side JavaScript is readable by anyone — restrict its origins, prefer a `read_only` key (read_only keys may call GET operations only; writes are rejected with 403), or proxy requests through your own server.
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
import * as runtime from '../runtime.js';
|
|
15
|
+
import { KeyValidationResponseFromJSON, } from '../models/KeyValidationResponse.js';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
export class KeysApi extends runtime.BaseAPI {
|
|
20
|
+
/**
|
|
21
|
+
* Creates request options for validateKey without sending the request
|
|
22
|
+
*/
|
|
23
|
+
async validateKeyRequestOpts() {
|
|
24
|
+
const queryParameters = {};
|
|
25
|
+
const headerParameters = {};
|
|
26
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
27
|
+
const token = this.configuration.accessToken;
|
|
28
|
+
const tokenString = await token('ApiKeyAuth', []);
|
|
29
|
+
if (tokenString) {
|
|
30
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
let urlPath = `/v1/keys/validate`;
|
|
34
|
+
return {
|
|
35
|
+
path: urlPath,
|
|
36
|
+
method: 'POST',
|
|
37
|
+
headers: headerParameters,
|
|
38
|
+
query: queryParameters,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Reports the status of the API key supplied in the Authorization header. A usable key returns 200; a missing, revoked, expired, or unknown key returns 401 — both with the same status body (never problem+json) — so bring-your-own-key integrations can confirm a key and show why it failed.
|
|
43
|
+
* Validate an API key
|
|
44
|
+
*/
|
|
45
|
+
async validateKeyRaw(initOverrides) {
|
|
46
|
+
const requestOptions = await this.validateKeyRequestOpts();
|
|
47
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
48
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => KeyValidationResponseFromJSON(jsonValue));
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Reports the status of the API key supplied in the Authorization header. A usable key returns 200; a missing, revoked, expired, or unknown key returns 401 — both with the same status body (never problem+json) — so bring-your-own-key integrations can confirm a key and show why it failed.
|
|
52
|
+
* Validate an API key
|
|
53
|
+
*/
|
|
54
|
+
async validateKey(initOverrides) {
|
|
55
|
+
const response = await this.validateKeyRaw(initOverrides);
|
|
56
|
+
return await response.value();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Toolpath Engine API
|
|
3
|
+
* Public REST API for Toolpath engine operations. **Units.** All dimensional values — in reports and in feature datasheets — are in millimetres; all angles are in degrees. Each report also states this in its `units` field. **Browser use.** CORS is per API key: a request only receives an `Access-Control-Allow-Origin` header when its `Origin` is in the allowlist configured on the key used (set when creating or editing the key in the portal). A key with no allowed origins is server-to-server only. A Bearer API key placed in client-side JavaScript is readable by anyone — restrict its origins, prefer a `read_only` key (read_only keys may call GET operations only; writes are rejected with 403), or proxy requests through your own server.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import * as runtime from '../runtime.js';
|
|
13
|
+
import { type AnalyzeJobResponse } from '../models/AnalyzeJobResponse.js';
|
|
14
|
+
import { type CreatePartResponse } from '../models/CreatePartResponse.js';
|
|
15
|
+
import { type PartReportResponse } from '../models/PartReportResponse.js';
|
|
16
|
+
export interface AnalyzePartRequest {
|
|
17
|
+
id: string;
|
|
18
|
+
featureDetails?: AnalyzePartFeatureDetailsEnum;
|
|
19
|
+
idempotencyKey?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface CreatePartRequest {
|
|
22
|
+
filename?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface GetPartReportRequest {
|
|
25
|
+
id: string;
|
|
26
|
+
jobId?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
export declare class PartsApi extends runtime.BaseAPI {
|
|
32
|
+
/**
|
|
33
|
+
* Creates request options for analyzePart without sending the request
|
|
34
|
+
*/
|
|
35
|
+
analyzePartRequestOpts(requestParameters: AnalyzePartRequest): Promise<runtime.RequestOpts>;
|
|
36
|
+
/**
|
|
37
|
+
* Start part analysis
|
|
38
|
+
*/
|
|
39
|
+
analyzePartRaw(requestParameters: AnalyzePartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AnalyzeJobResponse>>;
|
|
40
|
+
/**
|
|
41
|
+
* Start part analysis
|
|
42
|
+
*/
|
|
43
|
+
analyzePart(requestParameters: AnalyzePartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AnalyzeJobResponse>;
|
|
44
|
+
/**
|
|
45
|
+
* Creates request options for createPart without sending the request
|
|
46
|
+
*/
|
|
47
|
+
createPartRequestOpts(requestParameters: CreatePartRequest): Promise<runtime.RequestOpts>;
|
|
48
|
+
/**
|
|
49
|
+
* Create a part upload
|
|
50
|
+
*/
|
|
51
|
+
createPartRaw(requestParameters: CreatePartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CreatePartResponse>>;
|
|
52
|
+
/**
|
|
53
|
+
* Create a part upload
|
|
54
|
+
*/
|
|
55
|
+
createPart(requestParameters?: CreatePartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreatePartResponse>;
|
|
56
|
+
/**
|
|
57
|
+
* Creates request options for getPartReport without sending the request
|
|
58
|
+
*/
|
|
59
|
+
getPartReportRequestOpts(requestParameters: GetPartReportRequest): Promise<runtime.RequestOpts>;
|
|
60
|
+
/**
|
|
61
|
+
* Get the latest part report
|
|
62
|
+
*/
|
|
63
|
+
getPartReportRaw(requestParameters: GetPartReportRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PartReportResponse>>;
|
|
64
|
+
/**
|
|
65
|
+
* Get the latest part report
|
|
66
|
+
*/
|
|
67
|
+
getPartReport(requestParameters: GetPartReportRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PartReportResponse>;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* @export
|
|
71
|
+
*/
|
|
72
|
+
export declare const AnalyzePartFeatureDetailsEnum: {
|
|
73
|
+
readonly True: "true";
|
|
74
|
+
readonly False: "false";
|
|
75
|
+
};
|
|
76
|
+
export type AnalyzePartFeatureDetailsEnum = (typeof AnalyzePartFeatureDetailsEnum)[keyof typeof AnalyzePartFeatureDetailsEnum];
|