Update api spec (#12)

* YOYO NEW API SPEC!

* update apiGen

* update mass test

* Generated new lib

* 2d conversion update

* Generated new lib

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch>
This commit is contained in:
Jess Frazelle
2022-12-11 16:09:58 -08:00
committed by GitHub
parent 0602a80eb1
commit fb661b7500
22 changed files with 1594 additions and 119 deletions

View File

@ -0,0 +1,19 @@
import fsp from 'fs/promises';
import { file } from '../../src/index.js';
async function example() {
const response = await file.create_file_2d_vector_conversion({
output_format: 'dxf',
src_format: 'svg',
body: await fsp.readFile('./example.svg', 'base64'),
});
if ('error_code' in response) throw response;
return response;
}
describe('Testing file.create_file_2d_vector_conversion', () => {
it('should be truthy or throw', async () => {
expect(await example()).toBeTruthy();
});
});

View File

@ -0,0 +1,19 @@
import fsp from 'fs/promises';
import { file } from '../../src/index.js';
async function example() {
const response = await file.create_file_3d_conversion({
output_format: 'dae',
src_format: 'obj',
body: await fsp.readFile('./example.obj', 'base64'),
});
if ('error_code' in response) throw response;
return response;
}
describe('Testing file.create_file_3d_conversion', () => {
it('should be truthy or throw', async () => {
expect(await example()).toBeTruthy();
});
});

View File

@ -3,7 +3,7 @@ import { file } from '../../src/index.js';
async function example() {
const response = await file.create_file_conversion({
output_format: 'stl',
output_format: 'dae',
src_format: 'obj',
body: await fsp.readFile('./example.obj', 'base64'),
});

View File

@ -2,8 +2,8 @@ import { unit } from '../../src/index.js';
async function example() {
const response = await unit.get_length_unit_conversion({
output_format: 'millimeter',
src_format: 'centimeter',
output_format: 'meter',
src_format: 'millimeter',
value: 7,
});
if ('error_code' in response) throw response;

View File

@ -0,0 +1,18 @@
import { unit } from '../../src/index.js';
async function example() {
const response = await unit.get_radioactivity_unit_conversion({
output_format: 'becquerel',
src_format: 'curie',
value: 7,
});
if ('error_code' in response) throw response;
return response;
}
describe('Testing unit.get_radioactivity_unit_conversion', () => {
it('should be truthy or throw', async () => {
expect(await example()).toBeTruthy();
});
});

View File

@ -2,7 +2,7 @@ import { unit } from '../../src/index.js';
async function example() {
const response = await unit.get_volume_unit_conversion({
output_format: 'cubic_millimeter',
output_format: 'cubic_meter',
src_format: 'cubic_centimeter',
value: 7,
});

View File

@ -13,7 +13,7 @@ describe('Testing create_file_mass', () => {
if ('error_code' in response) throw 'error';
const { status, mass } = response;
expect(mass).toBe(0.7063786);
expect(mass).toBe(0.10375396);
expect(status).toBe('Completed');
});
it("shouldn't throw when using a client", async () => {
@ -26,7 +26,7 @@ describe('Testing create_file_mass', () => {
if ('error_code' in response) throw 'error';
const { status, mass } = response;
expect(mass).toBe(0.7063786);
expect(mass).toBe(0.10375396);
expect(status).toBe('Completed');
});
});

3
example.svg Normal file
View File

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M6 13.5V3.75m0 9.75a1.5 1.5 0 010 3m0-3a1.5 1.5 0 000 3m0 3.75V16.5m12-3V3.75m0 9.75a1.5 1.5 0 010 3m0-3a1.5 1.5 0 000 3m0 3.75V16.5m-6-9V3.75m0 3.75a1.5 1.5 0 010 3m0-3a1.5 1.5 0 000 3m0 9.75V10.5" />
</svg>

After

Width:  |  Height:  |  Size: 397 B

View File

@ -155,7 +155,7 @@
"op": "add",
"path": "/paths/~1unit~1conversion~1volume~1{src_format}~1{output_format}/get/x-typescript",
"value": {
"example": "import { unit } from '@kittycad/lib'\n\nasync function example() {\n const response = await unit.get_volume_unit_conversion({\n output_format: 'cubic_millimeter',\n src_format: 'cubic_centimeter',\n value: 7,\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
"example": "import { unit } from '@kittycad/lib'\n\nasync function example() {\n const response = await unit.get_volume_unit_conversion({\n output_format: 'cubic_meter',\n src_format: 'cubic_centimeter',\n value: 7,\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
"libDocsLink": ""
}
},
@ -199,6 +199,14 @@
"libDocsLink": ""
}
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1radioactivity~1{src_format}~1{output_format}/get/x-typescript",
"value": {
"example": "import { unit } from '@kittycad/lib'\n\nasync function example() {\n const response = await unit.get_radioactivity_unit_conversion({\n output_format: 'becquerel',\n src_format: 'curie',\n value: 7,\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
"libDocsLink": ""
}
},
{
"op": "add",
"path": "/paths/~1unit~1conversion~1radiation~1{src_format}~1{output_format}/get/x-typescript",
@ -275,7 +283,7 @@
"op": "add",
"path": "/paths/~1unit~1conversion~1length~1{src_format}~1{output_format}/get/x-typescript",
"value": {
"example": "import { unit } from '@kittycad/lib'\n\nasync function example() {\n const response = await unit.get_length_unit_conversion({\n output_format: 'millimeter',\n src_format: 'centimeter',\n value: 7,\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
"example": "import { unit } from '@kittycad/lib'\n\nasync function example() {\n const response = await unit.get_length_unit_conversion({\n output_format: 'meter',\n src_format: 'millimeter',\n value: 7,\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
"libDocsLink": ""
}
},
@ -427,7 +435,7 @@
"op": "add",
"path": "/paths/~1file~1conversion~1{src_format}~1{output_format}/post/x-typescript",
"value": {
"example": "import fsp from 'fs/promises'\nimport { file } from '@kittycad/lib'\n\nasync function example() {\n const response = await file.create_file_conversion({\n output_format: 'stl',\n src_format: 'obj',\n body: await fsp.readFile('./example.obj', 'base64'),\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
"example": "import fsp from 'fs/promises'\nimport { file } from '@kittycad/lib'\n\nasync function example() {\n const response = await file.create_file_conversion({\n output_format: 'dae',\n src_format: 'obj',\n body: await fsp.readFile('./example.obj', 'base64'),\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
"libDocsLink": ""
}
},
@ -439,6 +447,22 @@
"libDocsLink": ""
}
},
{
"op": "add",
"path": "/paths/~1file~13d~1conversion~1{src_format}~1{output_format}/post/x-typescript",
"value": {
"example": "import fsp from 'fs/promises'\nimport { file } from '@kittycad/lib'\n\nasync function example() {\n const response = await file.create_file_3d_conversion({\n output_format: 'dae',\n src_format: 'obj',\n body: await fsp.readFile('./example.obj', 'base64'),\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
"libDocsLink": ""
}
},
{
"op": "add",
"path": "/paths/~1file~12d~1vector~1conversion~1{src_format}~1{output_format}/post/x-typescript",
"value": {
"example": "import fsp from 'fs/promises'\nimport { file } from '@kittycad/lib'\n\nasync function example() {\n const response = await file.create_file_2d_vector_conversion({\n output_format: 'dxf',\n src_format: 'svg',\n body: await fsp.readFile('./example.svg', 'base64'),\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
"libDocsLink": ""
}
},
{
"op": "add",
"path": "/paths/~1constant~1physics~1{constant}/get/x-typescript",

1098
spec.json

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,44 @@
import fetch from 'node-fetch';
import {
File2DVectorConversion_type,
Error_type,
File2DVectorExportFormat_type,
File2DVectorImportFormat_type,
} from '../../models.js';
import { Client } from '../../client.js';
interface Create_file_2d_vector_conversion_params {
client?: Client;
output_format: File2DVectorExportFormat_type;
src_format: File2DVectorImportFormat_type;
body: string;
}
type Create_file_2d_vector_conversion_return =
| File2DVectorConversion_type
| Error_type;
export default async function create_file_2d_vector_conversion({
client,
output_format,
src_format,
body,
}: Create_file_2d_vector_conversion_params): Promise<Create_file_2d_vector_conversion_return> {
const url = `/file/2d/vector/conversion/${src_format}/${output_format}`;
const fullUrl = 'https://api.kittycad.io' + url;
const kittycadToken = client
? client.token
: process.env.KITTYCAD_TOKEN || '';
const headers = {
Authorization: `Bearer ${kittycadToken}`,
};
const fetchOptions = {
method: 'POST',
headers,
body,
};
const response = await fetch(fullUrl, fetchOptions);
const result =
(await response.json()) as Create_file_2d_vector_conversion_return;
return result;
}

View File

@ -0,0 +1,41 @@
import fetch from 'node-fetch';
import {
File3DConversion_type,
Error_type,
File3DExportFormat_type,
File3DImportFormat_type,
} from '../../models.js';
import { Client } from '../../client.js';
interface Create_file_3d_conversion_params {
client?: Client;
output_format: File3DExportFormat_type;
src_format: File3DImportFormat_type;
body: string;
}
type Create_file_3d_conversion_return = File3DConversion_type | Error_type;
export default async function create_file_3d_conversion({
client,
output_format,
src_format,
body,
}: Create_file_3d_conversion_params): Promise<Create_file_3d_conversion_return> {
const url = `/file/3d/conversion/${src_format}/${output_format}`;
const fullUrl = 'https://api.kittycad.io' + url;
const kittycadToken = client
? client.token
: process.env.KITTYCAD_TOKEN || '';
const headers = {
Authorization: `Bearer ${kittycadToken}`,
};
const fetchOptions = {
method: 'POST',
headers,
body,
};
const response = await fetch(fullUrl, fetchOptions);
const result = (await response.json()) as Create_file_3d_conversion_return;
return result;
}

View File

@ -2,14 +2,14 @@ import fetch from 'node-fetch';
import {
FileCenterOfMass_type,
Error_type,
FileSourceFormat_type,
File3DImportFormat_type,
} from '../../models.js';
import { Client } from '../../client.js';
interface Create_file_center_of_mass_params {
client?: Client;
material_density: number;
src_format: FileSourceFormat_type;
src_format: File3DImportFormat_type;
body: string;
}

View File

@ -2,15 +2,15 @@ import fetch from 'node-fetch';
import {
FileConversion_type,
Error_type,
FileOutputFormat_type,
FileSourceFormat_type,
FileExportFormat_type,
FileImportFormat_type,
} from '../../models.js';
import { Client } from '../../client.js';
interface Create_file_conversion_params {
client?: Client;
output_format: FileOutputFormat_type;
src_format: FileSourceFormat_type;
output_format: FileExportFormat_type;
src_format: FileImportFormat_type;
body: string;
}

View File

@ -2,14 +2,14 @@ import fetch from 'node-fetch';
import {
FileDensity_type,
Error_type,
FileSourceFormat_type,
File3DImportFormat_type,
} from '../../models.js';
import { Client } from '../../client.js';
interface Create_file_density_params {
client?: Client;
material_mass: number;
src_format: FileSourceFormat_type;
src_format: File3DImportFormat_type;
body: string;
}

View File

@ -2,14 +2,14 @@ import fetch from 'node-fetch';
import {
FileMass_type,
Error_type,
FileSourceFormat_type,
File3DImportFormat_type,
} from '../../models.js';
import { Client } from '../../client.js';
interface Create_file_mass_params {
client?: Client;
material_density: number;
src_format: FileSourceFormat_type;
src_format: File3DImportFormat_type;
body: string;
}

View File

@ -2,13 +2,13 @@ import fetch from 'node-fetch';
import {
FileSurfaceArea_type,
Error_type,
FileSourceFormat_type,
File3DImportFormat_type,
} from '../../models.js';
import { Client } from '../../client.js';
interface Create_file_surface_area_params {
client?: Client;
src_format: FileSourceFormat_type;
src_format: File3DImportFormat_type;
body: string;
}

View File

@ -2,13 +2,13 @@ import fetch from 'node-fetch';
import {
FileVolume_type,
Error_type,
FileSourceFormat_type,
File3DImportFormat_type,
} from '../../models.js';
import { Client } from '../../client.js';
interface Create_file_volume_params {
client?: Client;
src_format: FileSourceFormat_type;
src_format: File3DImportFormat_type;
body: string;
}

View File

@ -0,0 +1,42 @@
import fetch from 'node-fetch';
import {
UnitRadioactivityConversion_type,
Error_type,
UnitRadioactivityFormat_type,
} from '../../models.js';
import { Client } from '../../client.js';
interface Get_radioactivity_unit_conversion_params {
client?: Client;
output_format: UnitRadioactivityFormat_type;
src_format: UnitRadioactivityFormat_type;
value: number;
}
type Get_radioactivity_unit_conversion_return =
| UnitRadioactivityConversion_type
| Error_type;
export default async function get_radioactivity_unit_conversion({
client,
output_format,
src_format,
value,
}: Get_radioactivity_unit_conversion_params): Promise<Get_radioactivity_unit_conversion_return> {
const url = `/unit/conversion/radioactivity/${src_format}/${output_format}?value=${value}`;
const fullUrl = 'https://api.kittycad.io' + url;
const kittycadToken = client
? client.token
: process.env.KITTYCAD_TOKEN || '';
const headers = {
Authorization: `Bearer ${kittycadToken}`,
};
const fetchOptions = {
method: 'GET',
headers,
};
const response = await fetch(fullUrl, fetchOptions);
const result =
(await response.json()) as Get_radioactivity_unit_conversion_return;
return result;
}

View File

@ -90,8 +90,11 @@ export default async function apiGen(lookup: any) {
throw 'bad';
}
if (reffedSchema.type === 'string' && reffedSchema.enum) {
if (operationId.includes('file') && name === 'input_format') {
inputParamsExamples.push(`${name}: 'obj'`);
if (operationId.includes('file') && name === 'src_format') {
const input =
reffedSchema.enum.find((fmt) => fmt === 'obj') ||
reffedSchema.enum.find((fmt) => fmt === 'svg');
inputParamsExamples.push(`${name}: '${input}'`);
} else if (name === 'output_format') {
inputParamsExamples.push(`${name}: '${reffedSchema.enum[0]}'`);
} else {
@ -141,8 +144,13 @@ export default async function apiGen(lookup: any) {
}
inputTypes.push('body: string');
inputParams.push('body');
const exampleFile = inputParamsExamples
.find((str) => str.startsWith('src_format:'))
.includes('obj')
? 'example.obj'
: 'example.svg';
inputParamsExamples.push(
"body: await fsp.readFile('./example.obj', 'base64')",
`body: await fsp.readFile('./${exampleFile}', 'base64')`,
);
exampleTemplate = `import fsp from 'fs/promises';` + exampleTemplate;
template = template.replaceAll("body: 'BODY'", 'body');

View File

@ -21,6 +21,8 @@ export const api_tokens = {
import get_physics_constant from './api/constant/get_physics_constant.js';
export const constant = { get_physics_constant };
import create_file_2d_vector_conversion from './api/file/create_file_2d_vector_conversion.js';
import create_file_3d_conversion from './api/file/create_file_3d_conversion.js';
import create_file_center_of_mass from './api/file/create_file_center_of_mass.js';
import create_file_conversion from './api/file/create_file_conversion.js';
import create_file_density from './api/file/create_file_density.js';
@ -30,6 +32,8 @@ import create_file_volume from './api/file/create_file_volume.js';
import get_file_conversion from './api/file/get_file_conversion.js';
import get_file_conversion_for_user from './api/file/get_file_conversion_for_user.js';
export const file = {
create_file_2d_vector_conversion,
create_file_3d_conversion,
create_file_center_of_mass,
create_file_conversion,
create_file_density,
@ -86,6 +90,7 @@ import get_metric_power_unit_conversion from './api/unit/get_metric_power_unit_c
import get_power_unit_conversion from './api/unit/get_power_unit_conversion.js';
import get_pressure_unit_conversion from './api/unit/get_pressure_unit_conversion.js';
import get_radiation_unit_conversion from './api/unit/get_radiation_unit_conversion.js';
import get_radioactivity_unit_conversion from './api/unit/get_radioactivity_unit_conversion.js';
import get_solid_angle_unit_conversion from './api/unit/get_solid_angle_unit_conversion.js';
import get_temperature_unit_conversion from './api/unit/get_temperature_unit_conversion.js';
import get_time_unit_conversion from './api/unit/get_time_unit_conversion.js';
@ -115,6 +120,7 @@ export const unit = {
get_power_unit_conversion,
get_pressure_unit_conversion,
get_radiation_unit_conversion,
get_radioactivity_unit_conversion,
get_solid_angle_unit_conversion,
get_temperature_unit_conversion,
get_time_unit_conversion,

View File

@ -190,8 +190,8 @@ This is the same as the API call ID. */
"description": "The converted file, if completed, base64 encoded."
}*/
output?: string;
output_format: FileOutputFormat_type /* The output format of the file conversion. */;
src_format: FileSourceFormat_type /* The source format of the file conversion. */;
output_format: FileExportFormat_type /* The output format of the file conversion. */;
src_format: FileImportFormat_type /* The source format of the file conversion. */;
/*{
"format": "date-time",
"nullable": true,
@ -207,6 +207,82 @@ This is the same as the API call ID. */
}
| {
/*{
"format": "date-time",
"nullable": true,
"title": "DateTime",
"description": "The time and date the API call was completed."
}*/
completed_at?: string;
/* format:date-time, title:DateTime, description:The time and date the API call was created. */
created_at: string;
/* nullable:true, description:The error the function returned, if any. */
error?: string;
/* The unique identifier of the API call.
This is the same as the API call ID. */
id: Uuid_type;
/*{
"format": "byte",
"nullable": true,
"title": "String",
"description": "The converted file, if completed, base64 encoded."
}*/
output?: string;
output_format: File2DVectorExportFormat_type /* The output format of the file conversion. */;
src_format: File2DVectorImportFormat_type /* The source format of the file conversion. */;
/*{
"format": "date-time",
"nullable": true,
"title": "DateTime",
"description": "The time and date the API call was started."
}*/
started_at?: string;
status: ApiCallStatus_type /* The status of the API call. */;
type: 'File2DVectorConversion';
/* format:date-time, title:DateTime, description:The time and date the API call was last updated. */
updated_at: string;
user_id: string /* The user ID of the user who created the API call. */;
}
| {
/*{
"format": "date-time",
"nullable": true,
"title": "DateTime",
"description": "The time and date the API call was completed."
}*/
completed_at?: string;
/* format:date-time, title:DateTime, description:The time and date the API call was created. */
created_at: string;
/* nullable:true, description:The error the function returned, if any. */
error?: string;
/* The unique identifier of the API call.
This is the same as the API call ID. */
id: Uuid_type;
/*{
"format": "byte",
"nullable": true,
"title": "String",
"description": "The converted file, if completed, base64 encoded."
}*/
output?: string;
output_format: File3DExportFormat_type /* The output format of the file conversion. */;
src_format: File3DImportFormat_type /* The source format of the file conversion. */;
/*{
"format": "date-time",
"nullable": true,
"title": "DateTime",
"description": "The time and date the API call was started."
}*/
started_at?: string;
status: ApiCallStatus_type /* The status of the API call. */;
type: 'File3DConversion';
/* format:date-time, title:DateTime, description:The time and date the API call was last updated. */
updated_at: string;
user_id: string /* The user ID of the user who created the API call. */;
}
| {
/*{
"format": "double"
}*/
center_of_mass: number[];
@ -227,7 +303,7 @@ This is the same as the API call ID. */
id: Uuid_type;
/* default:0, format:float, description:The material density as denoted by the user. */
material_density: number;
src_format: FileSourceFormat_type /* The source format of the file. */;
src_format: File3DImportFormat_type /* The source format of the file. */;
/*{
"format": "date-time",
"nullable": true,
@ -261,7 +337,7 @@ This is the same as the API call ID. */
mass?: number;
/* default:0, format:float, description:The material density as denoted by the user. */
material_density: number;
src_format: FileSourceFormat_type /* The source format of the file. */;
src_format: File3DImportFormat_type /* The source format of the file. */;
/*{
"format": "date-time",
"nullable": true,
@ -291,7 +367,7 @@ This is the same as the API call ID. */
This is the same as the API call ID. */
id: Uuid_type;
src_format: FileSourceFormat_type /* The source format of the file. */;
src_format: File3DImportFormat_type /* The source format of the file. */;
/*{
"format": "date-time",
"nullable": true,
@ -327,7 +403,7 @@ This is the same as the API call ID. */
id: Uuid_type;
/* default:0, format:float, description:The material mass as denoted by the user. */
material_mass: number;
src_format: FileSourceFormat_type /* The source format of the file. */;
src_format: File3DImportFormat_type /* The source format of the file. */;
/*{
"format": "date-time",
"nullable": true,
@ -357,7 +433,7 @@ This is the same as the API call ID. */
This is the same as the API call ID. */
id: Uuid_type;
src_format: FileSourceFormat_type /* The source format of the file. */;
src_format: File3DImportFormat_type /* The source format of the file. */;
/*{
"format": "date-time",
"nullable": true,
@ -386,6 +462,8 @@ export interface AsyncApiCallResultsPage_type {
export type AsyncApiCallType_type =
/* The type of async API call. */
| 'FileConversion'
| 'File2DVectorConversion'
| 'File3DConversion'
| 'FileVolume'
| 'FileCenterOfMass'
| 'FileMass'
@ -438,7 +516,7 @@ Can be `credit`, `debit`, `prepaid`, or `unknown`. */
}
export interface Cluster_type {
/* format:ip, nullable:true, description:The IP address of the cluster. */
/* nullable:true, description:The IP address of the cluster. */
addr?: string;
/* default:0, format:int64, description:The auth timeout of the cluster. */
auth_timeout: number;
@ -1106,6 +1184,11 @@ export interface ExtendedUser_type {
}*/
email_verified?: string;
first_name: string /* The user's first name. */;
/*{
"nullable": true,
"description": "The user's Front ID. This is mostly used for internal mapping."
}*/
front_id?: string;
github: string /* The user's GitHub handle. */;
id: string /* The unique identifier for the user. */;
/* format:uri, title:String, description:The image avatar for the user. This is a URL. */
@ -1147,6 +1230,98 @@ export interface ExtendedUserResultsPage_type {
next_page?: string;
}
export interface File2DVectorConversion_type {
/*{
"format": "date-time",
"nullable": true,
"title": "DateTime",
"description": "The time and date the API call was completed."
}*/
completed_at?: string;
/* format:date-time, title:DateTime, description:The time and date the API call was created. */
created_at: string;
/* nullable:true, description:The error the function returned, if any. */
error?: string;
/* The unique identifier of the API call.
This is the same as the API call ID. */
id: Uuid_type;
/*{
"format": "byte",
"nullable": true,
"title": "String",
"description": "The converted file, if completed, base64 encoded."
}*/
output?: string;
output_format: File2DVectorExportFormat_type /* The output format of the file conversion. */;
src_format: File2DVectorImportFormat_type /* The source format of the file conversion. */;
/*{
"format": "date-time",
"nullable": true,
"title": "DateTime",
"description": "The time and date the API call was started."
}*/
started_at?: string;
status: ApiCallStatus_type /* The status of the API call. */;
/* format:date-time, title:DateTime, description:The time and date the API call was last updated. */
updated_at: string;
user_id: string /* The user ID of the user who created the API call. */;
}
export type File2DVectorExportFormat_type =
/* The valid types of Vector output file formats. */
'dxf' | 'json' | 'svg';
export type File2DVectorImportFormat_type =
/* The valid types of Vector source file formats. */
'dxf' | 'svg';
export interface File3DConversion_type {
/*{
"format": "date-time",
"nullable": true,
"title": "DateTime",
"description": "The time and date the API call was completed."
}*/
completed_at?: string;
/* format:date-time, title:DateTime, description:The time and date the API call was created. */
created_at: string;
/* nullable:true, description:The error the function returned, if any. */
error?: string;
/* The unique identifier of the API call.
This is the same as the API call ID. */
id: Uuid_type;
/*{
"format": "byte",
"nullable": true,
"title": "String",
"description": "The converted file, if completed, base64 encoded."
}*/
output?: string;
output_format: File3DExportFormat_type /* The output format of the file conversion. */;
src_format: File3DImportFormat_type /* The source format of the file conversion. */;
/*{
"format": "date-time",
"nullable": true,
"title": "DateTime",
"description": "The time and date the API call was started."
}*/
started_at?: string;
status: ApiCallStatus_type /* The status of the API call. */;
/* format:date-time, title:DateTime, description:The time and date the API call was last updated. */
updated_at: string;
user_id: string /* The user ID of the user who created the API call. */;
}
export type File3DExportFormat_type =
/* The valid types of 3d output file formats. */
'dae' | 'fbx' | 'fbxb' | 'obj' | 'obj_nomtl' | 'step' | 'stl';
export type File3DImportFormat_type =
/* The valid types of 3d source file formats. */
'dae' | 'dxf' | 'fbx' | 'obj' | 'obj_nomtl' | 'step' | 'stl';
export interface FileCenterOfMass_type {
/*{
"format": "double"
@ -1169,7 +1344,7 @@ This is the same as the API call ID. */
id: Uuid_type;
/* default:0, format:float, description:The material density as denoted by the user. */
material_density: number;
src_format: FileSourceFormat_type /* The source format of the file. */;
src_format: File3DImportFormat_type /* The source format of the file. */;
/*{
"format": "date-time",
"nullable": true,
@ -1206,8 +1381,8 @@ This is the same as the API call ID. */
"description": "The converted file, if completed, base64 encoded."
}*/
output?: string;
output_format: FileOutputFormat_type /* The output format of the file conversion. */;
src_format: FileSourceFormat_type /* The source format of the file conversion. */;
output_format: FileExportFormat_type /* The output format of the file conversion. */;
src_format: FileImportFormat_type /* The source format of the file conversion. */;
/*{
"format": "date-time",
"nullable": true,
@ -1241,7 +1416,7 @@ This is the same as the API call ID. */
id: Uuid_type;
/* default:0, format:float, description:The material mass as denoted by the user. */
material_mass: number;
src_format: FileSourceFormat_type /* The source format of the file. */;
src_format: File3DImportFormat_type /* The source format of the file. */;
/*{
"format": "date-time",
"nullable": true,
@ -1255,6 +1430,23 @@ This is the same as the API call ID. */
user_id: string /* The user ID of the user who created the API call. */;
}
export type FileExportFormat_type =
/* The valid types of output file formats. */
| 'dae'
| 'dxf'
| 'fbx'
| 'fbxb'
| 'json'
| 'obj'
| 'obj_nomtl'
| 'step'
| 'stl'
| 'svg';
export type FileImportFormat_type =
/* The valid types of source file formats. */
'dae' | 'dxf' | 'fbx' | 'obj' | 'obj_nomtl' | 'step' | 'stl' | 'svg';
export interface FileMass_type {
/*{
"format": "date-time",
@ -1275,7 +1467,7 @@ This is the same as the API call ID. */
mass?: number;
/* default:0, format:float, description:The material density as denoted by the user. */
material_density: number;
src_format: FileSourceFormat_type /* The source format of the file. */;
src_format: File3DImportFormat_type /* The source format of the file. */;
/*{
"format": "date-time",
"nullable": true,
@ -1289,14 +1481,6 @@ This is the same as the API call ID. */
user_id: string /* The user ID of the user who created the API call. */;
}
export type FileOutputFormat_type =
/* The valid types of output file formats. */
'stl' | 'obj' | 'dae' | 'step' | 'fbx' | 'fbxb';
export type FileSourceFormat_type =
/* The valid types of source file formats. */
'stl' | 'obj' | 'dae' | 'step' | 'fbx';
export interface FileSurfaceArea_type {
/*{
"format": "date-time",
@ -1313,7 +1497,7 @@ export interface FileSurfaceArea_type {
This is the same as the API call ID. */
id: Uuid_type;
src_format: FileSourceFormat_type /* The source format of the file. */;
src_format: File3DImportFormat_type /* The source format of the file. */;
/*{
"format": "date-time",
"nullable": true,
@ -1349,7 +1533,7 @@ export interface FileVolume_type {
This is the same as the API call ID. */
id: Uuid_type;
src_format: FileSourceFormat_type /* The source format of the file. */;
src_format: File3DImportFormat_type /* The source format of the file. */;
/*{
"format": "date-time",
"nullable": true,
@ -1624,6 +1808,12 @@ export interface OAuth2ClientInfo_type {
export type OAuth2GrantType_type =
'urn:ietf:params:oauth:grant-type:device_code'; /* An OAuth 2.0 Grant Type. These are documented here: <https://oauth.net/2/grant-types/>. */
export interface Onboarding_type {
first_call_from_their_machine_date: string /* When the user first called an endpoint from their machine (i.e. not a litterbox execution) */;
first_litterbox_execute_date: string /* When the user first used the litterbox */;
first_token_date: string /* When the user created their first token */;
}
export interface OutputFile_type {
/*{
"nullable": true,
@ -1699,9 +1889,9 @@ export type PhysicsConstantName_type =
| 'c'
| 'speed_of_light'
| 'G'
| 'newtonian_graviation'
| 'newtonian_gravitation'
| 'h'
| 'plank_const'
| 'planck_const'
| 'mu_0'
| 'vacuum_permeability'
| 'E_0'
@ -1826,7 +2016,7 @@ This is the same as the API call ID. */
}
export type UnitAccelerationFormat_type =
/* The valid types of metric unit formats. */
/* The valid types of acceleration unit formats. */
'meters_per_second_squared' | 'feet_per_second_squared' | 'standard_gravity';
export interface UnitAngleConversion_type {
@ -2207,9 +2397,12 @@ export type UnitEnergyFormat_type =
/* The valid types of energy unit formats. */
| 'joule'
| 'calorie'
| 'kilowatt_hour'
| 'watt_hour'
| 'british_thermal_unit'
| 'british_thermal_unit_iso'
| 'british_thermal_unit59'
| 'therm'
| 'foot_pound';
export interface UnitForceConversion_type {
@ -2249,7 +2442,7 @@ This is the same as the API call ID. */
export type UnitForceFormat_type =
/* The valid types of force unit formats. */
'newton' | 'pound' | 'dyne' | 'kilopound' | 'poundal';
'newton' | 'pound' | 'dyne' | 'kilopond' | 'poundal';
export interface UnitIlluminanceConversion_type {
/*{
@ -2327,15 +2520,19 @@ This is the same as the API call ID. */
export type UnitLengthFormat_type =
/* The valid types of length unit formats. */
| 'meter'
| 'millimeter'
| 'centimeter'
| 'meter'
| 'kilomter'
| 'kilometer'
| 'foot'
| 'mil'
| 'inch'
| 'mile'
| 'nautical_mile'
| 'astronomical_unit'
| 'lightyear'
| 'parsec'
| 'angstrom'
| 'cubit'
| 'fathom'
| 'chain'
@ -2481,7 +2678,7 @@ export type UnitMetricPower_type =
| 'milli'
| 'centi'
| 'deci'
| 'metric_unit'
| 'unit'
| 'deca'
| 'hecto'
| 'kilo'
@ -2710,9 +2907,48 @@ This is the same as the API call ID. */
}
export type UnitRadiationFormat_type =
/* The valid types of radiation unit formats. */
/* The valid types of radiation unit formats. These describe the radiation energy absorbed by a mass or material and/or how it affects the relative damage to the human body. */
'gray' | 'sievert' | 'rad';
export interface UnitRadioactivityConversion_type {
/*{
"format": "date-time",
"nullable": true,
"title": "DateTime",
"description": "The time and date the API call was completed."
}*/
completed_at?: string;
/* format:date-time, title:DateTime, description:The time and date the API call was created. */
created_at: string;
/* nullable:true, description:The error the function returned, if any. */
error?: string;
/* The unique identifier of the API call.
This is the same as the API call ID. */
id: Uuid_type;
/* default:0, format:float, description:The input value. */
input: number;
/* format:double, nullable:true, description:The resulting value. */
output?: number;
output_format: UnitRadioactivityFormat_type /* The output format of the unit conversion. */;
src_format: UnitRadioactivityFormat_type /* The source format of the unit conversion. */;
/*{
"format": "date-time",
"nullable": true,
"title": "DateTime",
"description": "The time and date the API call was started."
}*/
started_at?: string;
status: ApiCallStatus_type /* The status of the API call. */;
/* format:date-time, title:DateTime, description:The time and date the API call was last updated. */
updated_at: string;
user_id: string /* The user ID of the user who created the API call. */;
}
export type UnitRadioactivityFormat_type =
/* The valid types of radioactivity unit formats. These describe the amount of radiation emitted by a radioactive material. */
'becquerel' | 'curie' | 'rutherford';
export interface UnitSolidAngleConversion_type {
/*{
"format": "date-time",
@ -2956,14 +3192,36 @@ This is the same as the API call ID. */
export type UnitVolumeFormat_type =
/* The valid types of volume unit formats. */
| 'cubic_millimeter'
| 'cubic_centimeter'
| 'cubic_meter'
| 'cubic_centimeter'
| 'cubic_millimeter'
| 'cubic_kilometer'
| 'liter'
| 'cubic_inch'
| 'cubic_foot'
| 'cubic_yard'
| 'cubic_mile';
| 'cubic_mile'
| 'gallon'
| 'quart'
| 'pint'
| 'cup'
| 'fluid_ounce'
| 'barrel'
| 'bushel'
| 'cord'
| 'cubic_fathom'
| 'tablespoon'
| 'teaspoon'
| 'pinch'
| 'dash'
| 'drop'
| 'fifth'
| 'dram'
| 'gill'
| 'peck'
| 'sack'
| 'shot'
| 'strike';
export interface UpdateUser_type {
company: string /* The user's company. */;
@ -3084,12 +3342,18 @@ export interface Models {
ExecutorMetadata_type: ExecutorMetadata_type;
ExtendedUser_type: ExtendedUser_type;
ExtendedUserResultsPage_type: ExtendedUserResultsPage_type;
File2DVectorConversion_type: File2DVectorConversion_type;
File2DVectorExportFormat_type: File2DVectorExportFormat_type;
File2DVectorImportFormat_type: File2DVectorImportFormat_type;
File3DConversion_type: File3DConversion_type;
File3DExportFormat_type: File3DExportFormat_type;
File3DImportFormat_type: File3DImportFormat_type;
FileCenterOfMass_type: FileCenterOfMass_type;
FileConversion_type: FileConversion_type;
FileDensity_type: FileDensity_type;
FileExportFormat_type: FileExportFormat_type;
FileImportFormat_type: FileImportFormat_type;
FileMass_type: FileMass_type;
FileOutputFormat_type: FileOutputFormat_type;
FileSourceFormat_type: FileSourceFormat_type;
FileSurfaceArea_type: FileSurfaceArea_type;
FileSystemMetadata_type: FileSystemMetadata_type;
FileVolume_type: FileVolume_type;
@ -3109,6 +3373,7 @@ export interface Models {
NewAddress_type: NewAddress_type;
OAuth2ClientInfo_type: OAuth2ClientInfo_type;
OAuth2GrantType_type: OAuth2GrantType_type;
Onboarding_type: Onboarding_type;
OutputFile_type: OutputFile_type;
PaymentIntent_type: PaymentIntent_type;
PaymentMethod_type: PaymentMethod_type;
@ -3167,6 +3432,8 @@ export interface Models {
UnitPressureFormat_type: UnitPressureFormat_type;
UnitRadiationConversion_type: UnitRadiationConversion_type;
UnitRadiationFormat_type: UnitRadiationFormat_type;
UnitRadioactivityConversion_type: UnitRadioactivityConversion_type;
UnitRadioactivityFormat_type: UnitRadioactivityFormat_type;
UnitSolidAngleConversion_type: UnitSolidAngleConversion_type;
UnitSolidAngleFormat_type: UnitSolidAngleFormat_type;
UnitTemperatureConversion_type: UnitTemperatureConversion_type;