Skip to content

Commit b29bd11

Browse files
Update api spec (#330)
* YOYO NEW API SPEC! * Generated new lib * 2.0.39 --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 24e89ff commit b29bd11

14 files changed

+1813
-695
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { users } from '../../src/index.js';
2+
3+
async function example() {
4+
const response = await users.patch_user_crm({
5+
body: {
6+
cad_industry: 'The industry of the user.',
7+
cad_user_count: 'The user count of the user.',
8+
cad_user_type: 'The user type.',
9+
},
10+
});
11+
if ('error_code' in response) throw response;
12+
13+
return response;
14+
}
15+
16+
describe('Testing users.patch_user_crm', () => {
17+
it('should be truthy or throw', async () => {
18+
expect(await example()).toBeTruthy();
19+
});
20+
});
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { users } from '../../src/index.js';
2+
3+
async function example() {
4+
const response = await users.put_public_form({
5+
body: {
6+
company: 'The company name.',
7+
email: 'The email address of the user.',
8+
first_name: 'The first name of the user.',
9+
industry: 'The industry of the user.',
10+
inquiry_type: 'general_inquiry',
11+
last_name: 'The last name of the user.',
12+
message: 'The message content.',
13+
phone: 'The phone number of the user.',
14+
},
15+
});
16+
if ('error_code' in response) throw response;
17+
18+
return response;
19+
}
20+
21+
describe('Testing users.put_public_form', () => {
22+
it('should be truthy or throw', async () => {
23+
expect(await example()).toBeTruthy();
24+
});
25+
});
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { users } from '../../src/index.js';
2+
3+
async function example() {
4+
const response = await users.put_public_subscribe({
5+
body: { email: 'The email' },
6+
});
7+
if ('error_code' in response) throw response;
8+
9+
return response;
10+
}
11+
12+
describe('Testing users.put_public_subscribe', () => {
13+
it('should be truthy or throw', async () => {
14+
expect(await example()).toBeTruthy();
15+
});
16+
});
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { users } from '../../src/index.js';
2+
3+
async function example() {
4+
const response = await users.put_user_form_self({
5+
body: {
6+
company: 'The company name.',
7+
email: 'The email address of the user.',
8+
first_name: 'The first name of the user.',
9+
industry: 'The industry of the user.',
10+
inquiry_type: 'general_inquiry',
11+
last_name: 'The last name of the user.',
12+
message: 'The message content.',
13+
phone: 'The phone number of the user.',
14+
},
15+
});
16+
if ('error_code' in response) throw response;
17+
18+
return response;
19+
}
20+
21+
describe('Testing users.put_user_form_self', () => {
22+
it('should be truthy or throw', async () => {
23+
expect(await example()).toBeTruthy();
24+
});
25+
});

__tests__/gen/users-update_user_self.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ async function example() {
99
github: "The user's GitHub handle.",
1010
image:
1111
"The image URL for the user. NOTE: If the user uses an OAuth2 provider, this will be overwritten by the provider's image URL when the user logs in next.",
12+
is_onboarded: true,
1213
last_name: "The user's last name.",
1314
phone: "The user's phone number.",
1415
},

kittycad.ts.patch.json

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,22 @@
1515
"libDocsLink": ""
1616
}
1717
},
18+
{
19+
"op": "add",
20+
"path": "/paths/~1website~1subscribe/put/x-typescript",
21+
"value": {
22+
"example": "import { users } from '@kittycad/lib'\n\nasync function example() {\n const response = await users.put_public_subscribe({\n body: { email: 'The email' },\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
23+
"libDocsLink": ""
24+
}
25+
},
26+
{
27+
"op": "add",
28+
"path": "/paths/~1website~1form/put/x-typescript",
29+
"value": {
30+
"example": "import { users } from '@kittycad/lib'\n\nasync function example() {\n const response = await users.put_public_form({\n body: {\n company: 'The company name.',\n email: 'The email address of the user.',\n first_name: 'The first name of the user.',\n industry: 'The industry of the user.',\n inquiry_type: 'general_inquiry',\n last_name: 'The last name of the user.',\n message: 'The message content.',\n phone: 'The phone number of the user.',\n },\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
31+
"libDocsLink": ""
32+
}
33+
},
1834
{
1935
"op": "add",
2036
"path": "/paths/~1users~1{id}~1payment~1balance/put/x-typescript",
@@ -279,6 +295,14 @@
279295
"libDocsLink": ""
280296
}
281297
},
298+
{
299+
"op": "add",
300+
"path": "/paths/~1user~1form/put/x-typescript",
301+
"value": {
302+
"example": "import { users } from '@kittycad/lib'\n\nasync function example() {\n const response = await users.put_user_form_self({\n body: {\n company: 'The company name.',\n email: 'The email address of the user.',\n first_name: 'The first name of the user.',\n industry: 'The industry of the user.',\n inquiry_type: 'general_inquiry',\n last_name: 'The last name of the user.',\n message: 'The message content.',\n phone: 'The phone number of the user.',\n },\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
303+
"libDocsLink": ""
304+
}
305+
},
282306
{
283307
"op": "add",
284308
"path": "/paths/~1user~1extended/get/x-typescript",
@@ -287,6 +311,14 @@
287311
"libDocsLink": ""
288312
}
289313
},
314+
{
315+
"op": "add",
316+
"path": "/paths/~1user~1crm/patch/x-typescript",
317+
"value": {
318+
"example": "import { users } from '@kittycad/lib'\n\nasync function example() {\n const response = await users.patch_user_crm({\n body: {\n cad_industry: 'The industry of the user.',\n cad_user_count: 'The user count of the user.',\n cad_user_type: 'The user type.',\n },\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
319+
"libDocsLink": ""
320+
}
321+
},
290322
{
291323
"op": "add",
292324
"path": "/paths/~1user~1api-tokens~1{token}/delete/x-typescript",
@@ -347,7 +379,7 @@
347379
"op": "add",
348380
"path": "/paths/~1user/put/x-typescript",
349381
"value": {
350-
"example": "import { users } from '@kittycad/lib'\n\nasync function example() {\n const response = await users.update_user_self({\n body: {\n company: \"The user's company.\",\n discord: \"The user's Discord handle.\",\n first_name: \"The user's first name.\",\n github: \"The user's GitHub handle.\",\n image: \"The image URL for the user. NOTE: If the user uses an OAuth2 provider, this will be overwritten by the provider's image URL when the user logs in next.\",\n last_name: \"The user's last name.\",\n phone: \"The user's phone number.\",\n },\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
382+
"example": "import { users } from '@kittycad/lib'\n\nasync function example() {\n const response = await users.update_user_self({\n body: {\n company: \"The user's company.\",\n discord: \"The user's Discord handle.\",\n first_name: \"The user's first name.\",\n github: \"The user's GitHub handle.\",\n image: \"The image URL for the user. NOTE: If the user uses an OAuth2 provider, this will be overwritten by the provider's image URL when the user logs in next.\",\n is_onboarded: true,\n last_name: \"The user's last name.\",\n phone: \"The user's phone number.\",\n },\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
351383
"libDocsLink": ""
352384
}
353385
},

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.38",
3+
"version": "2.0.39",
44
"description": "Javascript library for KittyCAD API",
55
"type": "module",
66
"keywords": [

0 commit comments

Comments
 (0)