Skip to content

Commit da43ddf

Browse files
jessfrazgithub-actions[bot]Irev-Dev
authored
Update api spec (#198)
* YOYO NEW API SPEC! * skip failing test * Generated new lib * bump v --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <[email protected]>
1 parent 159fe31 commit da43ddf

12 files changed

+922
-12
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { ai } from '../../src/index.js';
2+
3+
async function example() {
4+
const response = await ai.get_ai_prompt({ id: 'string' });
5+
if ('error_code' in response) throw response;
6+
7+
return response;
8+
}
9+
10+
describe('Testing ai.get_ai_prompt', () => {
11+
it('should be truthy or throw', async () => {
12+
expect(await example()).toBeTruthy();
13+
});
14+
});
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { ai } from '../../src/index.js';
2+
3+
async function example() {
4+
const response = await ai.list_ai_prompts({
5+
limit: 7,
6+
page_token: 'string',
7+
sort_by: 'created_at_ascending',
8+
});
9+
if ('error_code' in response) throw response;
10+
11+
return response;
12+
}
13+
14+
describe('Testing ai.list_ai_prompts', () => {
15+
it('should be truthy or throw', async () => {
16+
expect(await example()).toBeTruthy();
17+
});
18+
});
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { meta } from '../../src/index.js';
2+
3+
async function example() {
4+
const response = await meta.internal_get_api_token_for_discord_user({
5+
discord_id: 'string',
6+
});
7+
if ('error_code' in response) throw response;
8+
9+
return response;
10+
}
11+
12+
describe('Testing meta.internal_get_api_token_for_discord_user', () => {
13+
it('should be truthy or throw', async () => {
14+
try {
15+
await example();
16+
} catch (err) {
17+
expect(err).toBeTruthy(); // eslint-disable-line jest/no-conditional-expect
18+
}
19+
});
20+
});

kittycad.ts.patch.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,14 @@
431431
"libDocsLink": ""
432432
}
433433
},
434+
{
435+
"op": "add",
436+
"path": "/paths/~1internal~1discord~1api-token~1{discord_id}/get/x-typescript",
437+
"value": {
438+
"example": "import { meta } from '@kittycad/lib'\n\nasync function example() {\n const response = await meta.internal_get_api_token_for_discord_user({\n discord_id: 'string',\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
439+
"libDocsLink": ""
440+
}
441+
},
434442
{
435443
"op": "add",
436444
"path": "/paths/~1file~1volume/post/x-typescript",
@@ -559,6 +567,22 @@
559567
"libDocsLink": ""
560568
}
561569
},
570+
{
571+
"op": "add",
572+
"path": "/paths/~1ai-prompts~1{id}/get/x-typescript",
573+
"value": {
574+
"example": "import { ai } from '@kittycad/lib'\n\nasync function example() {\n const response = await ai.get_ai_prompt({ id: 'string' })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
575+
"libDocsLink": ""
576+
}
577+
},
578+
{
579+
"op": "add",
580+
"path": "/paths/~1ai-prompts/get/x-typescript",
581+
"value": {
582+
"example": "import { ai } from '@kittycad/lib'\n\nasync function example() {\n const response = await ai.list_ai_prompts({\n limit: 7,\n page_token: 'string',\n sort_by: 'created_at_ascending',\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
583+
"libDocsLink": ""
584+
}
585+
},
562586
{
563587
"op": "add",
564588
"path": "/paths/~1_meta~1info/get/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": "0.0.45",
3+
"version": "0.0.46",
44
"description": "Javascript library for KittyCAD API",
55
"type": "module",
66
"keywords": [

0 commit comments

Comments
 (0)