Skip to content

Commit 4614a25

Browse files
zoo-github-actions-auth[bot]github-actions[bot]maxammann
authored
Update api spec (#335)
* YOYO NEW API SPEC! * fix * get_api_call_metrics has been removed. it is empty now * fix * Generated new lib * 2.0.41 --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Max Ammann <[email protected]>
1 parent 3a02556 commit 4614a25

11 files changed

+1276
-500
lines changed

__tests__/gen/api-calls-get_api_call_metrics.test.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ async function example() {
99

1010
describe('Testing api_calls.get_api_call_metrics', () => {
1111
it('should be truthy or throw', async () => {
12-
const examplePromise = example();
13-
const timeoutPromise = new Promise((r) =>
14-
setTimeout(() => r('timeout'), 450),
15-
);
16-
expect(await Promise.any([examplePromise, timeoutPromise])).toBe('timeout');
12+
expect(await example()).toBeTruthy();
1713
});
1814
});
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { file } from '../../src/index.js';
2+
3+
async function example() {
4+
const response = await file.create_file_conversion_options({
5+
files: [
6+
{
7+
name: 'thing.kcl',
8+
data: new Blob(['thing = 1'], { type: 'text/plain' }),
9+
},
10+
],
11+
body: {
12+
output_format: {
13+
created: 'Timestamp override.',
14+
storage: 'ascii',
15+
type: 'fbx',
16+
},
17+
src_format: { type: 'fbx' },
18+
},
19+
});
20+
if ('error_code' in response) throw response;
21+
22+
return response;
23+
}
24+
25+
describe('Testing file.create_file_conversion_options', () => {
26+
it('should be truthy or throw', async () => {
27+
expect(await example()).toBeTruthy();
28+
});
29+
});

__tests__/gen/users-get_user_onboarding_self.test.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

kittycad.ts.patch.json

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@
3131
"libDocsLink": ""
3232
}
3333
},
34+
{
35+
"op": "add",
36+
"path": "/paths/~1users~1{id}~1payment~1subscriptions/put/x-typescript",
37+
"value": {
38+
"example": "import { users } from '@kittycad/lib'\n\nasync function example() {\n const response = await users.update_subscription_for_user({\n id: '31337',\n body: { modeling_app: 'free', pay_annually: true },\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
39+
"libDocsLink": ""
40+
}
41+
},
3442
{
3543
"op": "add",
3644
"path": "/paths/~1users~1{id}~1payment~1balance/put/x-typescript",
@@ -279,14 +287,6 @@
279287
"libDocsLink": ""
280288
}
281289
},
282-
{
283-
"op": "add",
284-
"path": "/paths/~1user~1onboarding/get/x-typescript",
285-
"value": {
286-
"example": "import { users } from '@kittycad/lib'\n\nasync function example() {\n const response = await users.get_user_onboarding_self()\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
287-
"libDocsLink": ""
288-
}
289-
},
290290
{
291291
"op": "add",
292292
"path": "/paths/~1user~1oauth2~1providers/get/x-typescript",
@@ -1007,6 +1007,14 @@
10071007
"libDocsLink": ""
10081008
}
10091009
},
1010+
{
1011+
"op": "add",
1012+
"path": "/paths/~1file~1conversion/post/x-typescript",
1013+
"value": {
1014+
"example": "import { file } from '@kittycad/lib'\n\nasync function example() {\n const response = await file.create_file_conversion_options({\n files: [\n {\n name: 'thing.kcl',\n data: new Blob(['thing = 1'], { type: 'text/plain' }),\n },\n ],\n body: {\n output_format: {\n created: 'Timestamp override.',\n storage: 'ascii',\n type: 'fbx',\n },\n src_format: { type: 'fbx' },\n },\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
1015+
"libDocsLink": ""
1016+
}
1017+
},
10101018
{
10111019
"op": "add",
10121020
"path": "/paths/~1file~1center-of-mass/post/x-typescript",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kittycad/lib",
3-
"version": "2.0.40",
3+
"version": "2.0.41",
44
"description": "Javascript library for KittyCAD API",
55
"type": "module",
66
"keywords": [

0 commit comments

Comments
 (0)