Jess Frazelle fb661b7500 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>
2022-12-12 11:09:58 +11:00
2022-12-12 11:09:58 +11:00
2022-12-12 11:09:58 +11:00
2022-08-01 20:06:14 +10:00
2022-08-01 14:27:11 +10:00
2022-08-01 14:27:11 +10:00
2022-08-01 20:06:14 +10:00
2022-08-01 14:27:11 +10:00
2022-08-01 14:27:11 +10:00
2022-12-12 11:09:58 +11:00
2022-08-01 14:27:11 +10:00
2022-08-02 12:53:40 +10:00
2022-12-12 11:09:58 +11:00
2022-08-01 14:27:11 +10:00
2022-08-15 08:50:42 +10:00
2022-08-15 08:49:14 +10:00
2022-08-01 20:06:14 +10:00
2022-12-12 11:09:58 +11:00
2022-08-01 20:06:14 +10:00
2022-08-12 19:25:16 +10:00

image

KittyCAD JS/TS API library

Socials:: - blogtwitterlinkedininstagramyoutubediscord

Fully typed js library, compatible with js and ts.

Full documentation here

Simple example below.

Install

npm install @kittycad/lib
# or
yarn add @kittycad/lib

## set your token
export KITTYCAD_TOKEN=<your token>

Basic example

import { file } from '@kittycad/lib';
import fsp from 'fs/promises';

async function main() {
    // kittycad.io/docs/api/get-cad-file-mass?lang=typescript
    const response = await file.create_file_mass({
        src_format: 'obj',
        material_density: '0.007',
        body: await fsp.readFile('./example.obj', 'base64'),
    })
    if ('error_code' in response) throw response
    const { status, mass } = response
    console.log(status, mass);
}

main();
Description
The TypeScript API client for Zoo.
Readme MIT 2.3 MiB
Languages
TypeScript 99.3%
Go 0.2%
Nix 0.2%
JavaScript 0.2%
Shell 0.1%