updating spec (#113)
* YOYO NEW API SPEC! * updating gen files * handle enums for examples * fix tests * allow hidden endpoints * Generated new lib --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
23
__tests__/gen/ai-create_image_to_3d.test.ts
Normal file
23
__tests__/gen/ai-create_image_to_3d.test.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import fsp from 'fs/promises';
|
||||
import { ai } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await ai.create_image_to_3d({
|
||||
input_format: 'jpg',
|
||||
output_format: 'stl',
|
||||
body: await fsp.readFile('./example', 'base64'),
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing ai.create_image_to_3d', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
try {
|
||||
await example();
|
||||
} catch (err) {
|
||||
expect(err).toBeTruthy(); // eslint-disable-line jest/no-conditional-expect
|
||||
}
|
||||
});
|
||||
});
|
21
__tests__/gen/ai-create_text_to_3d.test.ts
Normal file
21
__tests__/gen/ai-create_text_to_3d.test.ts
Normal file
@ -0,0 +1,21 @@
|
||||
import { ai } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await ai.create_text_to_3d({
|
||||
output_format: 'stl',
|
||||
prompt: 'string',
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing ai.create_text_to_3d', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
const examplePromise = example();
|
||||
const timeoutPromise = new Promise((r) =>
|
||||
setTimeout(() => r('timeout'), 450),
|
||||
);
|
||||
expect(await Promise.any([examplePromise, timeoutPromise])).toBe('timeout');
|
||||
});
|
||||
});
|
18
__tests__/gen/api-calls-get_api_call.test.ts
Normal file
18
__tests__/gen/api-calls-get_api_call.test.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import { api_calls } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await api_calls.get_api_call({ id: 'string' });
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing api_calls.get_api_call', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
try {
|
||||
await example();
|
||||
} catch (err) {
|
||||
expect(err).toBeTruthy(); // eslint-disable-line jest/no-conditional-expect
|
||||
}
|
||||
});
|
||||
});
|
14
__tests__/gen/api-calls-get_api_call_metrics.test.ts
Normal file
14
__tests__/gen/api-calls-get_api_call_metrics.test.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import { api_calls } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await api_calls.get_api_call_metrics({ group_by: 'email' });
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing api_calls.get_api_call_metrics', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
18
__tests__/gen/api-calls-list_api_calls.test.ts
Normal file
18
__tests__/gen/api-calls-list_api_calls.test.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import { api_calls } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await api_calls.list_api_calls({
|
||||
limit: 7,
|
||||
page_token: 'string',
|
||||
sort_by: 'created-at-ascending',
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing api_calls.list_api_calls', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
19
__tests__/gen/api-calls-list_api_calls_for_user.test.ts
Normal file
19
__tests__/gen/api-calls-list_api_calls_for_user.test.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import { api_calls } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await api_calls.list_api_calls_for_user({
|
||||
id: 'string',
|
||||
limit: 7,
|
||||
page_token: 'string',
|
||||
sort_by: 'created-at-ascending',
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing api_calls.list_api_calls_for_user', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
19
__tests__/gen/api-calls-list_async_operations.test.ts
Normal file
19
__tests__/gen/api-calls-list_async_operations.test.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import { api_calls } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await api_calls.list_async_operations({
|
||||
limit: 7,
|
||||
page_token: 'string',
|
||||
sort_by: 'created-at-ascending',
|
||||
status: 'Queued',
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing api_calls.list_async_operations', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
@ -4,7 +4,7 @@ async function example() {
|
||||
const response = await api_calls.user_list_api_calls({
|
||||
limit: 7,
|
||||
page_token: 'string',
|
||||
sort_by: 'created-at-descending',
|
||||
sort_by: 'created-at-ascending',
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
|
@ -9,10 +9,6 @@ async function example() {
|
||||
|
||||
describe('Testing api_tokens.create_api_token_for_user', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
try {
|
||||
await example();
|
||||
} catch (err) {
|
||||
expect(err).toBeTruthy(); // eslint-disable-line jest/no-conditional-expect
|
||||
}
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
@ -4,7 +4,7 @@ async function example() {
|
||||
const response = await api_tokens.list_api_tokens_for_user({
|
||||
limit: 7,
|
||||
page_token: 'string',
|
||||
sort_by: 'created-at-descending',
|
||||
sort_by: 'created-at-ascending',
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
import { sessions } from '../../src/index.js';
|
||||
import { apps } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await sessions.get_session_for_user({ token: 'string' });
|
||||
const response = await apps.apps_github_callback();
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing sessions.get_session_for_user', () => {
|
||||
describe('Testing apps.apps_github_callback', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
14
__tests__/gen/apps-apps_github_consent.test.ts
Normal file
14
__tests__/gen/apps-apps_github_consent.test.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import { apps } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await apps.apps_github_consent();
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing apps.apps_github_consent', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
21
__tests__/gen/apps-apps_github_webhook.test.ts
Normal file
21
__tests__/gen/apps-apps_github_webhook.test.ts
Normal file
@ -0,0 +1,21 @@
|
||||
import fsp from 'fs/promises';
|
||||
import { apps } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await apps.apps_github_webhook({
|
||||
body: await fsp.readFile('./example', 'base64'),
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing apps.apps_github_webhook', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
try {
|
||||
await example();
|
||||
} catch (err) {
|
||||
expect(err).toBeTruthy(); // eslint-disable-line jest/no-conditional-expect
|
||||
}
|
||||
});
|
||||
});
|
14
__tests__/gen/constant-get_physics_constant.test.ts
Normal file
14
__tests__/gen/constant-get_physics_constant.test.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import { constant } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await constant.get_physics_constant({ constant: 'pi' });
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing constant.get_physics_constant', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
14
__tests__/gen/executor-create_executor_term.test.ts
Normal file
14
__tests__/gen/executor-create_executor_term.test.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import { executor } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await executor.create_executor_term();
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing executor.create_executor_term', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
19
__tests__/gen/executor-create_file_execution.test.ts
Normal file
19
__tests__/gen/executor-create_file_execution.test.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import fsp from 'fs/promises';
|
||||
import { executor } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await executor.create_file_execution({
|
||||
lang: 'go',
|
||||
output: 'string',
|
||||
body: await fsp.readFile('./example', 'base64'),
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing executor.create_file_execution', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
@ -1,19 +0,0 @@
|
||||
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();
|
||||
});
|
||||
});
|
@ -3,7 +3,7 @@ import { file } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await file.create_file_conversion({
|
||||
output_format: 'dae',
|
||||
output_format: 'stl',
|
||||
src_format: 'obj',
|
||||
body: await fsp.readFile('./example.obj', 'base64'),
|
||||
});
|
||||
|
14
__tests__/gen/meta-get_ai_plugin_manifest.test.ts
Normal file
14
__tests__/gen/meta-get_ai_plugin_manifest.test.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import { meta } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await meta.get_ai_plugin_manifest();
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing meta.get_ai_plugin_manifest', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
14
__tests__/gen/meta-get_metadata.test.ts
Normal file
14
__tests__/gen/meta-get_metadata.test.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import { meta } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await meta.get_metadata();
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing meta.get_metadata', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
14
__tests__/gen/meta-get_openai_schema.test.ts
Normal file
14
__tests__/gen/meta-get_openai_schema.test.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import { meta } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await meta.get_openai_schema();
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing meta.get_openai_schema', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
14
__tests__/gen/modeling-cmd.test.ts
Normal file
14
__tests__/gen/modeling-cmd.test.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import { modeling } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await modeling.cmd();
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing modeling.cmd', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
14
__tests__/gen/modeling-cmd_batch.test.ts
Normal file
14
__tests__/gen/modeling-cmd_batch.test.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import { modeling } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await modeling.cmd_batch();
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing modeling.cmd_batch', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
14
__tests__/gen/modeling-modeling_commands_ws.test.ts
Normal file
14
__tests__/gen/modeling-modeling_commands_ws.test.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import { modeling } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await modeling.modeling_commands_ws();
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing modeling.modeling_commands_ws', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
14
__tests__/gen/oauth2-device_access_token.test.ts
Normal file
14
__tests__/gen/oauth2-device_access_token.test.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import { oauth2 } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await oauth2.device_access_token();
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing oauth2.device_access_token', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
14
__tests__/gen/oauth2-device_auth_confirm.test.ts
Normal file
14
__tests__/gen/oauth2-device_auth_confirm.test.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import { oauth2 } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await oauth2.device_auth_confirm();
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing oauth2.device_auth_confirm', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
14
__tests__/gen/oauth2-device_auth_request.test.ts
Normal file
14
__tests__/gen/oauth2-device_auth_request.test.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import { oauth2 } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await oauth2.device_auth_request();
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing oauth2.device_auth_request', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
18
__tests__/gen/oauth2-device_auth_verify.test.ts
Normal file
18
__tests__/gen/oauth2-device_auth_verify.test.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import { oauth2 } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await oauth2.device_auth_verify({ user_code: 'string' });
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing oauth2.device_auth_verify', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
try {
|
||||
await example();
|
||||
} catch (err) {
|
||||
expect(err).toBeTruthy(); // eslint-disable-line jest/no-conditional-expect
|
||||
}
|
||||
});
|
||||
});
|
22
__tests__/gen/oauth2-oauth2_provider_callback.test.ts
Normal file
22
__tests__/gen/oauth2-oauth2_provider_callback.test.ts
Normal file
@ -0,0 +1,22 @@
|
||||
import { oauth2 } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await oauth2.oauth2_provider_callback({
|
||||
provider: 'google',
|
||||
code: 'string',
|
||||
state: 'string',
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing oauth2.oauth2_provider_callback', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
try {
|
||||
await example();
|
||||
} catch (err) {
|
||||
expect(err).toBeTruthy(); // eslint-disable-line jest/no-conditional-expect
|
||||
}
|
||||
});
|
||||
});
|
17
__tests__/gen/oauth2-oauth2_provider_consent.test.ts
Normal file
17
__tests__/gen/oauth2-oauth2_provider_consent.test.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import { oauth2 } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await oauth2.oauth2_provider_consent({
|
||||
provider: 'google',
|
||||
callback_url: 'string',
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing oauth2.oauth2_provider_consent', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
@ -0,0 +1,14 @@
|
||||
import { payments } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await payments.create_payment_intent_for_user();
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing payments.create_payment_intent_for_user', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
@ -0,0 +1,20 @@
|
||||
import { payments } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await payments.delete_payment_method_for_user({
|
||||
id: 'string',
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing payments.delete_payment_method_for_user', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
try {
|
||||
await example();
|
||||
} catch (err) {
|
||||
expect(err).toBeTruthy(); // eslint-disable-line jest/no-conditional-expect
|
||||
}
|
||||
});
|
||||
});
|
@ -0,0 +1,18 @@
|
||||
import { payments } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await payments.validate_customer_tax_information_for_user();
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing payments.validate_customer_tax_information_for_user', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
try {
|
||||
await example();
|
||||
} catch (err) {
|
||||
expect(err).toBeTruthy(); // eslint-disable-line jest/no-conditional-expect
|
||||
}
|
||||
});
|
||||
});
|
@ -1,18 +0,0 @@
|
||||
import { unit } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await unit.get_acceleration_unit_conversion({
|
||||
output_format: 'meters_per_second_squared',
|
||||
src_format: 'feet_per_second_squared',
|
||||
value: 7,
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing unit.get_acceleration_unit_conversion', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
@ -2,8 +2,8 @@ import { unit } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await unit.get_angle_unit_conversion({
|
||||
output_format: 'radian',
|
||||
src_format: 'degree',
|
||||
input_unit: 'degrees',
|
||||
output_unit: 'radians',
|
||||
value: 7,
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
@ -1,18 +0,0 @@
|
||||
import { unit } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await unit.get_angular_velocity_unit_conversion({
|
||||
output_format: 'radians_per_second',
|
||||
src_format: 'degrees_per_second',
|
||||
value: 7,
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing unit.get_angular_velocity_unit_conversion', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
@ -2,8 +2,8 @@ import { unit } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await unit.get_area_unit_conversion({
|
||||
output_format: 'square_meter',
|
||||
src_format: 'square_foot',
|
||||
input_unit: 'acres',
|
||||
output_unit: 'hectares',
|
||||
value: 7,
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
@ -1,18 +0,0 @@
|
||||
import { unit } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await unit.get_concentration_unit_conversion({
|
||||
output_format: 'parts_per_million',
|
||||
src_format: 'parts_per_billion',
|
||||
value: 7,
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing unit.get_concentration_unit_conversion', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
@ -1,9 +1,9 @@
|
||||
import { unit } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await unit.get_radiation_unit_conversion({
|
||||
output_format: 'gray',
|
||||
src_format: 'sievert',
|
||||
const response = await unit.get_current_unit_conversion({
|
||||
input_unit: 'amperes',
|
||||
output_unit: 'microamperes',
|
||||
value: 7,
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
@ -11,7 +11,7 @@ async function example() {
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing unit.get_radiation_unit_conversion', () => {
|
||||
describe('Testing unit.get_current_unit_conversion', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
@ -1,18 +0,0 @@
|
||||
import { unit } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await unit.get_data_transfer_rate_unit_conversion({
|
||||
output_format: 'bytes_per_second',
|
||||
src_format: 'exabytes_per_second',
|
||||
value: 7,
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing unit.get_data_transfer_rate_unit_conversion', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
@ -1,18 +0,0 @@
|
||||
import { unit } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await unit.get_density_unit_conversion({
|
||||
output_format: 'kilograms_per_cubic_meter',
|
||||
src_format: 'grams_per_milliliter',
|
||||
value: 7,
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing unit.get_density_unit_conversion', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
@ -2,8 +2,8 @@ import { unit } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await unit.get_energy_unit_conversion({
|
||||
output_format: 'joule',
|
||||
src_format: 'calorie',
|
||||
input_unit: 'btu',
|
||||
output_unit: 'electronvolts',
|
||||
value: 7,
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
@ -2,8 +2,8 @@ import { unit } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await unit.get_force_unit_conversion({
|
||||
output_format: 'newton',
|
||||
src_format: 'pound',
|
||||
input_unit: 'dynes',
|
||||
output_unit: 'kiloponds',
|
||||
value: 7,
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { unit } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await unit.get_charge_unit_conversion({
|
||||
output_format: 'coulomb',
|
||||
src_format: 'ampere_hour',
|
||||
const response = await unit.get_frequency_unit_conversion({
|
||||
input_unit: 'gigahertz',
|
||||
output_unit: 'hertz',
|
||||
value: 7,
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
@ -11,7 +11,7 @@ async function example() {
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing unit.get_charge_unit_conversion', () => {
|
||||
describe('Testing unit.get_frequency_unit_conversion', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
@ -1,18 +0,0 @@
|
||||
import { unit } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await unit.get_illuminance_unit_conversion({
|
||||
output_format: 'lux',
|
||||
src_format: 'footcandle',
|
||||
value: 7,
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing unit.get_illuminance_unit_conversion', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
@ -2,8 +2,8 @@ import { unit } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await unit.get_length_unit_conversion({
|
||||
output_format: 'meter',
|
||||
src_format: 'millimeter',
|
||||
input_unit: 'centimetres',
|
||||
output_unit: 'decimetres',
|
||||
value: 7,
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
@ -1,18 +0,0 @@
|
||||
import { unit } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await unit.get_magnetic_field_strength_unit_conversion({
|
||||
output_format: 'tesla',
|
||||
src_format: 'gauss',
|
||||
value: 7,
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing unit.get_magnetic_field_strength_unit_conversion', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
@ -1,18 +0,0 @@
|
||||
import { unit } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await unit.get_magnetic_flux_unit_conversion({
|
||||
output_format: 'weber',
|
||||
src_format: 'maxwell',
|
||||
value: 7,
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing unit.get_magnetic_flux_unit_conversion', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
@ -2,8 +2,8 @@ import { unit } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await unit.get_mass_unit_conversion({
|
||||
output_format: 'gram',
|
||||
src_format: 'kilogram',
|
||||
input_unit: 'carats',
|
||||
output_unit: 'grains',
|
||||
value: 7,
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
@ -1,18 +0,0 @@
|
||||
import { unit } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await unit.get_metric_power_cubed_unit_conversion({
|
||||
output_format: 'atto',
|
||||
src_format: 'femto',
|
||||
value: 7,
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing unit.get_metric_power_cubed_unit_conversion', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
@ -1,18 +0,0 @@
|
||||
import { unit } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await unit.get_metric_power_squared_unit_conversion({
|
||||
output_format: 'atto',
|
||||
src_format: 'femto',
|
||||
value: 7,
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing unit.get_metric_power_squared_unit_conversion', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
@ -1,18 +0,0 @@
|
||||
import { unit } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await unit.get_metric_power_unit_conversion({
|
||||
output_format: 'atto',
|
||||
src_format: 'femto',
|
||||
value: 7,
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing unit.get_metric_power_unit_conversion', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
@ -2,8 +2,8 @@ import { unit } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await unit.get_power_unit_conversion({
|
||||
output_format: 'watt',
|
||||
src_format: 'horsepower',
|
||||
input_unit: 'btu_per_minute',
|
||||
output_unit: 'horsepower',
|
||||
value: 7,
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
@ -2,8 +2,8 @@ import { unit } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await unit.get_pressure_unit_conversion({
|
||||
output_format: 'pascal',
|
||||
src_format: 'bar',
|
||||
input_unit: 'atmospheres',
|
||||
output_unit: 'bars',
|
||||
value: 7,
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
@ -1,18 +0,0 @@
|
||||
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();
|
||||
});
|
||||
});
|
@ -1,18 +0,0 @@
|
||||
import { unit } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await unit.get_solid_angle_unit_conversion({
|
||||
output_format: 'steradian',
|
||||
src_format: 'degree_squared',
|
||||
value: 7,
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing unit.get_solid_angle_unit_conversion', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
@ -2,8 +2,8 @@ import { unit } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await unit.get_temperature_unit_conversion({
|
||||
output_format: 'kelvin',
|
||||
src_format: 'celsius',
|
||||
input_unit: 'celsius',
|
||||
output_unit: 'fahrenheit',
|
||||
value: 7,
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
@ -1,18 +0,0 @@
|
||||
import { unit } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await unit.get_time_unit_conversion({
|
||||
output_format: 'second',
|
||||
src_format: 'minute',
|
||||
value: 7,
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing unit.get_time_unit_conversion', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
@ -1,9 +1,9 @@
|
||||
import { unit } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await unit.get_data_unit_conversion({
|
||||
output_format: 'byte',
|
||||
src_format: 'exabyte',
|
||||
const response = await unit.get_torque_unit_conversion({
|
||||
input_unit: 'newton_metres',
|
||||
output_unit: 'pound_foot',
|
||||
value: 7,
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
@ -11,7 +11,7 @@ async function example() {
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing unit.get_data_unit_conversion', () => {
|
||||
describe('Testing unit.get_torque_unit_conversion', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
@ -1,18 +0,0 @@
|
||||
import { unit } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await unit.get_velocity_unit_conversion({
|
||||
output_format: 'meters_per_second',
|
||||
src_format: 'feet_per_second',
|
||||
value: 7,
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing unit.get_velocity_unit_conversion', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
@ -1,18 +0,0 @@
|
||||
import { unit } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await unit.get_voltage_unit_conversion({
|
||||
output_format: 'volt',
|
||||
src_format: 'statvolt',
|
||||
value: 7,
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing unit.get_voltage_unit_conversion', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
@ -2,8 +2,8 @@ import { unit } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await unit.get_volume_unit_conversion({
|
||||
output_format: 'cubic_meter',
|
||||
src_format: 'cubic_centimeter',
|
||||
input_unit: 'cubic_centimetres',
|
||||
output_unit: 'cubic_feet',
|
||||
value: 7,
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
14
__tests__/gen/users-get_session_for_user.test.ts
Normal file
14
__tests__/gen/users-get_session_for_user.test.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import { users } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await users.get_session_for_user({ token: 'string' });
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing users.get_session_for_user', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
18
__tests__/gen/users-get_user.test.ts
Normal file
18
__tests__/gen/users-get_user.test.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import { users } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await users.get_user({ id: 'string' });
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing users.get_user', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
try {
|
||||
await example();
|
||||
} catch (err) {
|
||||
expect(err).toBeTruthy(); // eslint-disable-line jest/no-conditional-expect
|
||||
}
|
||||
});
|
||||
});
|
18
__tests__/gen/users-get_user_extended.test.ts
Normal file
18
__tests__/gen/users-get_user_extended.test.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import { users } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await users.get_user_extended({ id: 'string' });
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing users.get_user_extended', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
try {
|
||||
await example();
|
||||
} catch (err) {
|
||||
expect(err).toBeTruthy(); // eslint-disable-line jest/no-conditional-expect
|
||||
}
|
||||
});
|
||||
});
|
18
__tests__/gen/users-get_user_front_hash_self.test.ts
Normal file
18
__tests__/gen/users-get_user_front_hash_self.test.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import { users } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await users.get_user_front_hash_self();
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing users.get_user_front_hash_self', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
try {
|
||||
await example();
|
||||
} catch (err) {
|
||||
expect(err).toBeTruthy(); // eslint-disable-line jest/no-conditional-expect
|
||||
}
|
||||
});
|
||||
});
|
14
__tests__/gen/users-get_user_onboarding_self.test.ts
Normal file
14
__tests__/gen/users-get_user_onboarding_self.test.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import { users } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await users.get_user_onboarding_self();
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing users.get_user_onboarding_self', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
18
__tests__/gen/users-list_users.test.ts
Normal file
18
__tests__/gen/users-list_users.test.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import { users } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await users.list_users({
|
||||
limit: 7,
|
||||
page_token: 'string',
|
||||
sort_by: 'created-at-ascending',
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing users.list_users', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
18
__tests__/gen/users-list_users_extended.test.ts
Normal file
18
__tests__/gen/users-list_users_extended.test.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import { users } from '../../src/index.js';
|
||||
|
||||
async function example() {
|
||||
const response = await users.list_users_extended({
|
||||
limit: 7,
|
||||
page_token: 'string',
|
||||
sort_by: 'created-at-ascending',
|
||||
});
|
||||
if ('error_code' in response) throw response;
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
describe('Testing users.list_users_extended', () => {
|
||||
it('should be truthy or throw', async () => {
|
||||
expect(await example()).toBeTruthy();
|
||||
});
|
||||
});
|
@ -1,9 +1,81 @@
|
||||
[
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1ws~1modeling~1commands/get/x-typescript",
|
||||
"value": {
|
||||
"example": "import { modeling } from '@kittycad/lib'\n\nasync function example() {\n const response = await modeling.modeling_commands_ws()\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1ws~1executor~1term/get/x-typescript",
|
||||
"value": {
|
||||
"example": "import { executor } from '@kittycad/lib'\n\nasync function example() {\n const response = await executor.create_executor_term()\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1users~1{id}~1api-calls/get/x-typescript",
|
||||
"value": {
|
||||
"example": "import { api_calls } from '@kittycad/lib'\n\nasync function example() {\n const response = await api_calls.list_api_calls_for_user({\n id: 'string',\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",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1users~1{id}/get/x-typescript",
|
||||
"value": {
|
||||
"example": "import { users } from '@kittycad/lib'\n\nasync function example() {\n const response = await users.get_user({ id: 'string' })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1users-extended~1{id}/get/x-typescript",
|
||||
"value": {
|
||||
"example": "import { users } from '@kittycad/lib'\n\nasync function example() {\n const response = await users.get_user_extended({ id: 'string' })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1users-extended/get/x-typescript",
|
||||
"value": {
|
||||
"example": "import { users } from '@kittycad/lib'\n\nasync function example() {\n const response = await users.list_users_extended({\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",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1users/get/x-typescript",
|
||||
"value": {
|
||||
"example": "import { users } from '@kittycad/lib'\n\nasync function example() {\n const response = await users.list_users({\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",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1user~1session~1{token}/get/x-typescript",
|
||||
"value": {
|
||||
"example": "import { sessions } from '@kittycad/lib'\n\nasync function example() {\n const response = await sessions.get_session_for_user({ token: 'string' })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
|
||||
"example": "import { users } from '@kittycad/lib'\n\nasync function example() {\n const response = await users.get_session_for_user({ token: 'string' })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1user~1payment~1tax/get/x-typescript",
|
||||
"value": {
|
||||
"example": "import { payments } from '@kittycad/lib'\n\nasync function example() {\n const response = await payments.validate_customer_tax_information_for_user()\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1user~1payment~1methods~1{id}/delete/x-typescript",
|
||||
"value": {
|
||||
"example": "import { payments } from '@kittycad/lib'\n\nasync function example() {\n const response = await payments.delete_payment_method_for_user({\n id: 'string',\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
@ -23,6 +95,14 @@
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1user~1payment~1intent/post/x-typescript",
|
||||
"value": {
|
||||
"example": "import { payments } from '@kittycad/lib'\n\nasync function example() {\n const response = await payments.create_payment_intent_for_user()\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1user~1payment~1balance/get/x-typescript",
|
||||
@ -63,6 +143,22 @@
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1user~1onboarding/get/x-typescript",
|
||||
"value": {
|
||||
"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",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1user~1front-hash/get/x-typescript",
|
||||
"value": {
|
||||
"example": "import { users } from '@kittycad/lib'\n\nasync function example() {\n const response = await users.get_user_front_hash_self()\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1user~1extended/get/x-typescript",
|
||||
@ -99,7 +195,7 @@
|
||||
"op": "add",
|
||||
"path": "/paths/~1user~1api-tokens/get/x-typescript",
|
||||
"value": {
|
||||
"example": "import { api_tokens } from '@kittycad/lib'\n\nasync function example() {\n const response = await api_tokens.list_api_tokens_for_user({\n limit: 7,\n page_token: 'string',\n sort_by: 'created-at-descending',\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
|
||||
"example": "import { api_tokens } from '@kittycad/lib'\n\nasync function example() {\n const response = await api_tokens.list_api_tokens_for_user({\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",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
@ -115,7 +211,7 @@
|
||||
"op": "add",
|
||||
"path": "/paths/~1user~1api-calls/get/x-typescript",
|
||||
"value": {
|
||||
"example": "import { api_calls } from '@kittycad/lib'\n\nasync function example() {\n const response = await api_calls.user_list_api_calls({\n limit: 7,\n page_token: 'string',\n sort_by: 'created-at-descending',\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
|
||||
"example": "import { api_calls } from '@kittycad/lib'\n\nasync function example() {\n const response = await api_calls.user_list_api_calls({\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",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
@ -145,233 +241,105 @@
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1unit~1conversion~1volume~1{src_format}~1{output_format}/get/x-typescript",
|
||||
"path": "/paths/~1unit~1conversion~1volume~1{input_unit}~1{output_unit}/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_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",
|
||||
"example": "import { unit } from '@kittycad/lib'\n\nasync function example() {\n const response = await unit.get_volume_unit_conversion({\n input_unit: 'cubic_centimetres',\n output_unit: 'cubic_feet',\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~1voltage~1{src_format}~1{output_format}/get/x-typescript",
|
||||
"path": "/paths/~1unit~1conversion~1torque~1{input_unit}~1{output_unit}/get/x-typescript",
|
||||
"value": {
|
||||
"example": "import { unit } from '@kittycad/lib'\n\nasync function example() {\n const response = await unit.get_voltage_unit_conversion({\n output_format: 'volt',\n src_format: 'statvolt',\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_torque_unit_conversion({\n input_unit: 'newton_metres',\n output_unit: 'pound_foot',\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~1velocity~1{src_format}~1{output_format}/get/x-typescript",
|
||||
"path": "/paths/~1unit~1conversion~1temperature~1{input_unit}~1{output_unit}/get/x-typescript",
|
||||
"value": {
|
||||
"example": "import { unit } from '@kittycad/lib'\n\nasync function example() {\n const response = await unit.get_velocity_unit_conversion({\n output_format: 'meters_per_second',\n src_format: 'feet_per_second',\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_temperature_unit_conversion({\n input_unit: 'celsius',\n output_unit: 'fahrenheit',\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~1time~1{src_format}~1{output_format}/get/x-typescript",
|
||||
"path": "/paths/~1unit~1conversion~1pressure~1{input_unit}~1{output_unit}/get/x-typescript",
|
||||
"value": {
|
||||
"example": "import { unit } from '@kittycad/lib'\n\nasync function example() {\n const response = await unit.get_time_unit_conversion({\n output_format: 'second',\n src_format: 'minute',\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_pressure_unit_conversion({\n input_unit: 'atmospheres',\n output_unit: 'bars',\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~1temperature~1{src_format}~1{output_format}/get/x-typescript",
|
||||
"path": "/paths/~1unit~1conversion~1power~1{input_unit}~1{output_unit}/get/x-typescript",
|
||||
"value": {
|
||||
"example": "import { unit } from '@kittycad/lib'\n\nasync function example() {\n const response = await unit.get_temperature_unit_conversion({\n output_format: 'kelvin',\n src_format: 'celsius',\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_power_unit_conversion({\n input_unit: 'btu_per_minute',\n output_unit: 'horsepower',\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~1solid-angle~1{src_format}~1{output_format}/get/x-typescript",
|
||||
"path": "/paths/~1unit~1conversion~1mass~1{input_unit}~1{output_unit}/get/x-typescript",
|
||||
"value": {
|
||||
"example": "import { unit } from '@kittycad/lib'\n\nasync function example() {\n const response = await unit.get_solid_angle_unit_conversion({\n output_format: 'steradian',\n src_format: 'degree_squared',\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_mass_unit_conversion({\n input_unit: 'carats',\n output_unit: 'grains',\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~1radioactivity~1{src_format}~1{output_format}/get/x-typescript",
|
||||
"path": "/paths/~1unit~1conversion~1length~1{input_unit}~1{output_unit}/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",
|
||||
"example": "import { unit } from '@kittycad/lib'\n\nasync function example() {\n const response = await unit.get_length_unit_conversion({\n input_unit: 'centimetres',\n output_unit: 'decimetres',\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",
|
||||
"path": "/paths/~1unit~1conversion~1frequency~1{input_unit}~1{output_unit}/get/x-typescript",
|
||||
"value": {
|
||||
"example": "import { unit } from '@kittycad/lib'\n\nasync function example() {\n const response = await unit.get_radiation_unit_conversion({\n output_format: 'gray',\n src_format: 'sievert',\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_frequency_unit_conversion({\n input_unit: 'gigahertz',\n output_unit: 'hertz',\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~1pressure~1{src_format}~1{output_format}/get/x-typescript",
|
||||
"path": "/paths/~1unit~1conversion~1force~1{input_unit}~1{output_unit}/get/x-typescript",
|
||||
"value": {
|
||||
"example": "import { unit } from '@kittycad/lib'\n\nasync function example() {\n const response = await unit.get_pressure_unit_conversion({\n output_format: 'pascal',\n src_format: 'bar',\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_force_unit_conversion({\n input_unit: 'dynes',\n output_unit: 'kiloponds',\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~1power~1{src_format}~1{output_format}/get/x-typescript",
|
||||
"path": "/paths/~1unit~1conversion~1energy~1{input_unit}~1{output_unit}/get/x-typescript",
|
||||
"value": {
|
||||
"example": "import { unit } from '@kittycad/lib'\n\nasync function example() {\n const response = await unit.get_power_unit_conversion({\n output_format: 'watt',\n src_format: 'horsepower',\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_energy_unit_conversion({\n input_unit: 'btu',\n output_unit: 'electronvolts',\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~1metric~1squared~1{src_format}~1{output_format}/get/x-typescript",
|
||||
"path": "/paths/~1unit~1conversion~1current~1{input_unit}~1{output_unit}/get/x-typescript",
|
||||
"value": {
|
||||
"example": "import { unit } from '@kittycad/lib'\n\nasync function example() {\n const response = await unit.get_metric_power_squared_unit_conversion({\n output_format: 'atto',\n src_format: 'femto',\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_current_unit_conversion({\n input_unit: 'amperes',\n output_unit: 'microamperes',\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~1metric~1power~1{src_format}~1{output_format}/get/x-typescript",
|
||||
"path": "/paths/~1unit~1conversion~1area~1{input_unit}~1{output_unit}/get/x-typescript",
|
||||
"value": {
|
||||
"example": "import { unit } from '@kittycad/lib'\n\nasync function example() {\n const response = await unit.get_metric_power_unit_conversion({\n output_format: 'atto',\n src_format: 'femto',\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_area_unit_conversion({\n input_unit: 'acres',\n output_unit: 'hectares',\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~1metric~1cubed~1{src_format}~1{output_format}/get/x-typescript",
|
||||
"path": "/paths/~1unit~1conversion~1angle~1{input_unit}~1{output_unit}/get/x-typescript",
|
||||
"value": {
|
||||
"example": "import { unit } from '@kittycad/lib'\n\nasync function example() {\n const response = await unit.get_metric_power_cubed_unit_conversion({\n output_format: 'atto',\n src_format: 'femto',\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~1mass~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_mass_unit_conversion({\n output_format: 'gram',\n src_format: 'kilogram',\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~1magnetic-flux~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_magnetic_flux_unit_conversion({\n output_format: 'weber',\n src_format: 'maxwell',\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~1magnetic-field-strength~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_magnetic_field_strength_unit_conversion({\n output_format: 'tesla',\n src_format: 'gauss',\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~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: '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": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1unit~1conversion~1illuminance~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_illuminance_unit_conversion({\n output_format: 'lux',\n src_format: 'footcandle',\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~1force~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_force_unit_conversion({\n output_format: 'newton',\n src_format: 'pound',\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~1energy~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_energy_unit_conversion({\n output_format: 'joule',\n src_format: 'calorie',\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~1density~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_density_unit_conversion({\n output_format: 'kilograms_per_cubic_meter',\n src_format: 'grams_per_milliliter',\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~1data~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_data_unit_conversion({\n output_format: 'byte',\n src_format: 'exabyte',\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~1data-transfer-rate~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_data_transfer_rate_unit_conversion({\n output_format: 'bytes_per_second',\n src_format: 'exabytes_per_second',\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~1concentration~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_concentration_unit_conversion({\n output_format: 'parts_per_million',\n src_format: 'parts_per_billion',\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~1charge~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_charge_unit_conversion({\n output_format: 'coulomb',\n src_format: 'ampere_hour',\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~1area~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_area_unit_conversion({\n output_format: 'square_meter',\n src_format: 'square_foot',\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~1angular-velocity~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_angular_velocity_unit_conversion({\n output_format: 'radians_per_second',\n src_format: 'degrees_per_second',\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~1angle~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_angle_unit_conversion({\n output_format: 'radian',\n src_format: 'degree',\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~1acceleration~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_acceleration_unit_conversion({\n output_format: 'meters_per_second_squared',\n src_format: 'feet_per_second_squared',\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_angle_unit_conversion({\n input_unit: 'degrees',\n output_unit: 'radians',\n value: 7,\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
@ -383,6 +351,78 @@
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1openai~1openapi.json/get/x-typescript",
|
||||
"value": {
|
||||
"example": "import { meta } from '@kittycad/lib'\n\nasync function example() {\n const response = await meta.get_openai_schema()\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1oauth2~1provider~1{provider}~1consent/get/x-typescript",
|
||||
"value": {
|
||||
"example": "import { oauth2 } from '@kittycad/lib'\n\nasync function example() {\n const response = await oauth2.oauth2_provider_consent({\n provider: 'google',\n callback_url: 'string',\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1oauth2~1provider~1{provider}~1callback/get/x-typescript",
|
||||
"value": {
|
||||
"example": "import { oauth2 } from '@kittycad/lib'\n\nasync function example() {\n const response = await oauth2.oauth2_provider_callback({\n provider: 'google',\n code: 'string',\n state: 'string',\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1oauth2~1device~1verify/get/x-typescript",
|
||||
"value": {
|
||||
"example": "import { oauth2 } from '@kittycad/lib'\n\nasync function example() {\n const response = await oauth2.device_auth_verify({ user_code: 'string' })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1oauth2~1device~1token/post/x-typescript",
|
||||
"value": {
|
||||
"example": "import { oauth2 } from '@kittycad/lib'\n\nasync function example() {\n const response = await oauth2.device_access_token()\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1oauth2~1device~1confirm/post/x-typescript",
|
||||
"value": {
|
||||
"example": "import { oauth2 } from '@kittycad/lib'\n\nasync function example() {\n const response = await oauth2.device_auth_confirm()\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1oauth2~1device~1auth/post/x-typescript",
|
||||
"value": {
|
||||
"example": "import { oauth2 } from '@kittycad/lib'\n\nasync function example() {\n const response = await oauth2.device_auth_request()\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1modeling~1cmd_batch/post/x-typescript",
|
||||
"value": {
|
||||
"example": "import { modeling } from '@kittycad/lib'\n\nasync function example() {\n const response = await modeling.cmd_batch()\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1modeling~1cmd/post/x-typescript",
|
||||
"value": {
|
||||
"example": "import { modeling } from '@kittycad/lib'\n\nasync function example() {\n const response = await modeling.cmd()\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1file~1volume/post/x-typescript",
|
||||
@ -407,6 +447,14 @@
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1file~1execute~1{lang}/post/x-typescript",
|
||||
"value": {
|
||||
"example": "import fsp from 'fs/promises'\nimport { executor } from '@kittycad/lib'\n\nasync function example() {\n const response = await executor.create_file_execution({\n lang: 'go',\n output: 'string',\n body: await fsp.readFile('./example', '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~1density/post/x-typescript",
|
||||
@ -419,7 +467,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: '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",
|
||||
"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",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
@ -433,9 +481,9 @@
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1file~12d~1vector~1conversion~1{src_format}~1{output_format}/post/x-typescript",
|
||||
"path": "/paths/~1constant~1physics~1{constant}/get/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",
|
||||
"example": "import { constant } from '@kittycad/lib'\n\nasync function example() {\n const response = await constant.get_physics_constant({ constant: 'pi' })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
@ -447,6 +495,94 @@
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1async~1operations/get/x-typescript",
|
||||
"value": {
|
||||
"example": "import { api_calls } from '@kittycad/lib'\n\nasync function example() {\n const response = await api_calls.list_async_operations({\n limit: 7,\n page_token: 'string',\n sort_by: 'created-at-ascending',\n status: 'Queued',\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1apps~1github~1webhook/post/x-typescript",
|
||||
"value": {
|
||||
"example": "import fsp from 'fs/promises'\nimport { apps } from '@kittycad/lib'\n\nasync function example() {\n const response = await apps.apps_github_webhook({\n body: await fsp.readFile('./example', '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/~1apps~1github~1consent/get/x-typescript",
|
||||
"value": {
|
||||
"example": "import { apps } from '@kittycad/lib'\n\nasync function example() {\n const response = await apps.apps_github_consent()\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1apps~1github~1callback/get/x-typescript",
|
||||
"value": {
|
||||
"example": "import { apps } from '@kittycad/lib'\n\nasync function example() {\n const response = await apps.apps_github_callback()\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1api-calls~1{id}/get/x-typescript",
|
||||
"value": {
|
||||
"example": "import { api_calls } from '@kittycad/lib'\n\nasync function example() {\n const response = await api_calls.get_api_call({ id: 'string' })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1api-calls/get/x-typescript",
|
||||
"value": {
|
||||
"example": "import { api_calls } from '@kittycad/lib'\n\nasync function example() {\n const response = await api_calls.list_api_calls({\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",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1api-call-metrics/get/x-typescript",
|
||||
"value": {
|
||||
"example": "import { api_calls } from '@kittycad/lib'\n\nasync function example() {\n const response = await api_calls.get_api_call_metrics({ group_by: 'email' })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1ai~1text-to-3d~1{output_format}/post/x-typescript",
|
||||
"value": {
|
||||
"example": "import { ai } from '@kittycad/lib'\n\nasync function example() {\n const response = await ai.create_text_to_3d({\n output_format: 'stl',\n prompt: 'string',\n })\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1ai~1image-to-3d~1{input_format}~1{output_format}/post/x-typescript",
|
||||
"value": {
|
||||
"example": "import fsp from 'fs/promises'\nimport { ai } from '@kittycad/lib'\n\nasync function example() {\n const response = await ai.create_image_to_3d({\n input_format: 'jpg',\n output_format: 'stl',\n body: await fsp.readFile('./example', '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/~1_meta~1info/get/x-typescript",
|
||||
"value": {
|
||||
"example": "import { meta } from '@kittycad/lib'\n\nasync function example() {\n const response = await meta.get_metadata()\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1.well-known~1ai-plugin.json/get/x-typescript",
|
||||
"value": {
|
||||
"example": "import { meta } from '@kittycad/lib'\n\nasync function example() {\n const response = await meta.get_ai_plugin_manifest()\n if ('error_code' in response) throw response\n console.log(JSON.stringify(response, null, 2))\n}\n",
|
||||
"libDocsLink": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"op": "add",
|
||||
"path": "/paths/~1/get/x-typescript",
|
||||
|
@ -66,7 +66,7 @@
|
||||
"build:js": "rollup -c",
|
||||
"build:types": "tsc --emitDeclarationOnly",
|
||||
"build": "rimraf dist && npm run build:types && npm run build:js",
|
||||
"gen": "ts-node ./src/modelsGen.ts && prettier --config .prettierrc --write ./src && prettier --config .prettierrc --write ./__tests__ && prettier --config .prettierrc --write ./kittycad.ts.patch.json",
|
||||
"gen": "ts-node ./src/modelsGen.ts && prettier --config .prettierrc --write './src' './__tests__' './kittycad.ts.patch.json'",
|
||||
"test": "jest",
|
||||
"tsc": "tsc"
|
||||
},
|
||||
|
42
src/api/ai/create_image_to_3d.ts
Normal file
42
src/api/ai/create_image_to_3d.ts
Normal file
@ -0,0 +1,42 @@
|
||||
import fetch from 'node-fetch';
|
||||
import {
|
||||
Mesh_type,
|
||||
Error_type,
|
||||
ImageType_type,
|
||||
FileExportFormat_type,
|
||||
} from '../../models.js';
|
||||
import { Client } from '../../client.js';
|
||||
|
||||
interface Create_image_to_3d_params {
|
||||
client?: Client;
|
||||
input_format: ImageType_type;
|
||||
output_format: FileExportFormat_type;
|
||||
body: string;
|
||||
}
|
||||
|
||||
type Create_image_to_3d_return = Mesh_type | Error_type;
|
||||
|
||||
export default async function create_image_to_3d({
|
||||
client,
|
||||
input_format,
|
||||
output_format,
|
||||
body,
|
||||
}: Create_image_to_3d_params): Promise<Create_image_to_3d_return> {
|
||||
const url = `/ai/image-to-3d/${input_format}/${output_format}`;
|
||||
const urlBase = process?.env?.BASE_URL || 'https://api.kittycad.io';
|
||||
const fullUrl = urlBase + 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_image_to_3d_return;
|
||||
return result;
|
||||
}
|
34
src/api/ai/create_text_to_3d.ts
Normal file
34
src/api/ai/create_text_to_3d.ts
Normal file
@ -0,0 +1,34 @@
|
||||
import fetch from 'node-fetch';
|
||||
import { Mesh_type, Error_type, FileExportFormat_type } from '../../models.js';
|
||||
import { Client } from '../../client.js';
|
||||
|
||||
interface Create_text_to_3d_params {
|
||||
client?: Client;
|
||||
output_format: FileExportFormat_type;
|
||||
prompt: string;
|
||||
}
|
||||
|
||||
type Create_text_to_3d_return = Mesh_type | Error_type;
|
||||
|
||||
export default async function create_text_to_3d({
|
||||
client,
|
||||
output_format,
|
||||
prompt,
|
||||
}: Create_text_to_3d_params): Promise<Create_text_to_3d_return> {
|
||||
const url = `/ai/text-to-3d/${output_format}?prompt=${prompt}`;
|
||||
const urlBase = process?.env?.BASE_URL || 'https://api.kittycad.io';
|
||||
const fullUrl = urlBase + url;
|
||||
const kittycadToken = client
|
||||
? client.token
|
||||
: process.env.KITTYCAD_TOKEN || '';
|
||||
const headers = {
|
||||
Authorization: `Bearer ${kittycadToken}`,
|
||||
};
|
||||
const fetchOptions = {
|
||||
method: 'POST',
|
||||
headers,
|
||||
};
|
||||
const response = await fetch(fullUrl, fetchOptions);
|
||||
const result = (await response.json()) as Create_text_to_3d_return;
|
||||
return result;
|
||||
}
|
32
src/api/api-calls/get_api_call.ts
Normal file
32
src/api/api-calls/get_api_call.ts
Normal file
@ -0,0 +1,32 @@
|
||||
import fetch from 'node-fetch';
|
||||
import { ApiCallWithPrice_type, Error_type } from '../../models.js';
|
||||
import { Client } from '../../client.js';
|
||||
|
||||
interface Get_api_call_params {
|
||||
client?: Client;
|
||||
id: string;
|
||||
}
|
||||
|
||||
type Get_api_call_return = ApiCallWithPrice_type | Error_type;
|
||||
|
||||
export default async function get_api_call({
|
||||
client,
|
||||
id,
|
||||
}: Get_api_call_params): Promise<Get_api_call_return> {
|
||||
const url = `/api-calls/${id}`;
|
||||
const urlBase = process?.env?.BASE_URL || 'https://api.kittycad.io';
|
||||
const fullUrl = urlBase + 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_api_call_return;
|
||||
return result;
|
||||
}
|
36
src/api/api-calls/get_api_call_metrics.ts
Normal file
36
src/api/api-calls/get_api_call_metrics.ts
Normal file
@ -0,0 +1,36 @@
|
||||
import fetch from 'node-fetch';
|
||||
import {
|
||||
ApiCallQueryGroup_type,
|
||||
Error_type,
|
||||
ApiCallQueryGroupBy_type,
|
||||
} from '../../models.js';
|
||||
import { Client } from '../../client.js';
|
||||
|
||||
interface Get_api_call_metrics_params {
|
||||
client?: Client;
|
||||
group_by: ApiCallQueryGroupBy_type;
|
||||
}
|
||||
|
||||
type Get_api_call_metrics_return = ApiCallQueryGroup_type[] | Error_type;
|
||||
|
||||
export default async function get_api_call_metrics({
|
||||
client,
|
||||
group_by,
|
||||
}: Get_api_call_metrics_params): Promise<Get_api_call_metrics_return> {
|
||||
const url = `/api-call-metrics?group_by=${group_by}`;
|
||||
const urlBase = process?.env?.BASE_URL || 'https://api.kittycad.io';
|
||||
const fullUrl = urlBase + 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_api_call_metrics_return;
|
||||
return result;
|
||||
}
|
40
src/api/api-calls/list_api_calls.ts
Normal file
40
src/api/api-calls/list_api_calls.ts
Normal file
@ -0,0 +1,40 @@
|
||||
import fetch from 'node-fetch';
|
||||
import {
|
||||
ApiCallWithPriceResultsPage_type,
|
||||
Error_type,
|
||||
CreatedAtSortMode_type,
|
||||
} from '../../models.js';
|
||||
import { Client } from '../../client.js';
|
||||
|
||||
interface List_api_calls_params {
|
||||
client?: Client;
|
||||
limit: number;
|
||||
page_token: string;
|
||||
sort_by: CreatedAtSortMode_type;
|
||||
}
|
||||
|
||||
type List_api_calls_return = ApiCallWithPriceResultsPage_type | Error_type;
|
||||
|
||||
export default async function list_api_calls({
|
||||
client,
|
||||
limit,
|
||||
page_token,
|
||||
sort_by,
|
||||
}: List_api_calls_params): Promise<List_api_calls_return> {
|
||||
const url = `/api-calls?limit=${limit}&page_token=${page_token}&sort_by=${sort_by}`;
|
||||
const urlBase = process?.env?.BASE_URL || 'https://api.kittycad.io';
|
||||
const fullUrl = urlBase + 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 List_api_calls_return;
|
||||
return result;
|
||||
}
|
44
src/api/api-calls/list_api_calls_for_user.ts
Normal file
44
src/api/api-calls/list_api_calls_for_user.ts
Normal file
@ -0,0 +1,44 @@
|
||||
import fetch from 'node-fetch';
|
||||
import {
|
||||
ApiCallWithPriceResultsPage_type,
|
||||
Error_type,
|
||||
CreatedAtSortMode_type,
|
||||
} from '../../models.js';
|
||||
import { Client } from '../../client.js';
|
||||
|
||||
interface List_api_calls_for_user_params {
|
||||
client?: Client;
|
||||
id: string;
|
||||
limit: number;
|
||||
page_token: string;
|
||||
sort_by: CreatedAtSortMode_type;
|
||||
}
|
||||
|
||||
type List_api_calls_for_user_return =
|
||||
| ApiCallWithPriceResultsPage_type
|
||||
| Error_type;
|
||||
|
||||
export default async function list_api_calls_for_user({
|
||||
client,
|
||||
id,
|
||||
limit,
|
||||
page_token,
|
||||
sort_by,
|
||||
}: List_api_calls_for_user_params): Promise<List_api_calls_for_user_return> {
|
||||
const url = `/users/${id}/api-calls?limit=${limit}&page_token=${page_token}&sort_by=${sort_by}`;
|
||||
const urlBase = process?.env?.BASE_URL || 'https://api.kittycad.io';
|
||||
const fullUrl = urlBase + 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 List_api_calls_for_user_return;
|
||||
return result;
|
||||
}
|
43
src/api/api-calls/list_async_operations.ts
Normal file
43
src/api/api-calls/list_async_operations.ts
Normal file
@ -0,0 +1,43 @@
|
||||
import fetch from 'node-fetch';
|
||||
import {
|
||||
AsyncApiCallResultsPage_type,
|
||||
Error_type,
|
||||
CreatedAtSortMode_type,
|
||||
ApiCallStatus_type,
|
||||
} from '../../models.js';
|
||||
import { Client } from '../../client.js';
|
||||
|
||||
interface List_async_operations_params {
|
||||
client?: Client;
|
||||
limit: number;
|
||||
page_token: string;
|
||||
sort_by: CreatedAtSortMode_type;
|
||||
status: ApiCallStatus_type;
|
||||
}
|
||||
|
||||
type List_async_operations_return = AsyncApiCallResultsPage_type | Error_type;
|
||||
|
||||
export default async function list_async_operations({
|
||||
client,
|
||||
limit,
|
||||
page_token,
|
||||
sort_by,
|
||||
status,
|
||||
}: List_async_operations_params): Promise<List_async_operations_return> {
|
||||
const url = `/async/operations?limit=${limit}&page_token=${page_token}&sort_by=${sort_by}&status=${status}`;
|
||||
const urlBase = process?.env?.BASE_URL || 'https://api.kittycad.io';
|
||||
const fullUrl = urlBase + 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 List_async_operations_return;
|
||||
return result;
|
||||
}
|
30
src/api/apps/apps_github_callback.ts
Normal file
30
src/api/apps/apps_github_callback.ts
Normal file
@ -0,0 +1,30 @@
|
||||
import fetch from 'node-fetch';
|
||||
import { Error_type } from '../../models.js';
|
||||
import { Client } from '../../client.js';
|
||||
|
||||
interface Apps_github_callback_params {
|
||||
client?: Client;
|
||||
}
|
||||
|
||||
type Apps_github_callback_return = Error_type;
|
||||
|
||||
export default async function apps_github_callback({
|
||||
client,
|
||||
}: Apps_github_callback_params = {}): Promise<Apps_github_callback_return> {
|
||||
const url = `/apps/github/callback`;
|
||||
const urlBase = process?.env?.BASE_URL || 'https://api.kittycad.io';
|
||||
const fullUrl = urlBase + 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 Apps_github_callback_return;
|
||||
return result;
|
||||
}
|
30
src/api/apps/apps_github_consent.ts
Normal file
30
src/api/apps/apps_github_consent.ts
Normal file
@ -0,0 +1,30 @@
|
||||
import fetch from 'node-fetch';
|
||||
import { AppClientInfo_type, Error_type } from '../../models.js';
|
||||
import { Client } from '../../client.js';
|
||||
|
||||
interface Apps_github_consent_params {
|
||||
client?: Client;
|
||||
}
|
||||
|
||||
type Apps_github_consent_return = AppClientInfo_type | Error_type;
|
||||
|
||||
export default async function apps_github_consent({
|
||||
client,
|
||||
}: Apps_github_consent_params = {}): Promise<Apps_github_consent_return> {
|
||||
const url = `/apps/github/consent`;
|
||||
const urlBase = process?.env?.BASE_URL || 'https://api.kittycad.io';
|
||||
const fullUrl = urlBase + 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 Apps_github_consent_return;
|
||||
return result;
|
||||
}
|
33
src/api/apps/apps_github_webhook.ts
Normal file
33
src/api/apps/apps_github_webhook.ts
Normal file
@ -0,0 +1,33 @@
|
||||
import fetch from 'node-fetch';
|
||||
import { Error_type } from '../../models.js';
|
||||
import { Client } from '../../client.js';
|
||||
|
||||
interface Apps_github_webhook_params {
|
||||
client?: Client;
|
||||
body: string;
|
||||
}
|
||||
|
||||
type Apps_github_webhook_return = Error_type;
|
||||
|
||||
export default async function apps_github_webhook({
|
||||
client,
|
||||
body,
|
||||
}: Apps_github_webhook_params): Promise<Apps_github_webhook_return> {
|
||||
const url = `/apps/github/webhook`;
|
||||
const urlBase = process?.env?.BASE_URL || 'https://api.kittycad.io';
|
||||
const fullUrl = urlBase + 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 Apps_github_webhook_return;
|
||||
return result;
|
||||
}
|
36
src/api/constant/get_physics_constant.ts
Normal file
36
src/api/constant/get_physics_constant.ts
Normal file
@ -0,0 +1,36 @@
|
||||
import fetch from 'node-fetch';
|
||||
import {
|
||||
PhysicsConstant_type,
|
||||
Error_type,
|
||||
PhysicsConstantName_type,
|
||||
} from '../../models.js';
|
||||
import { Client } from '../../client.js';
|
||||
|
||||
interface Get_physics_constant_params {
|
||||
client?: Client;
|
||||
constant: PhysicsConstantName_type;
|
||||
}
|
||||
|
||||
type Get_physics_constant_return = PhysicsConstant_type | Error_type;
|
||||
|
||||
export default async function get_physics_constant({
|
||||
client,
|
||||
constant,
|
||||
}: Get_physics_constant_params): Promise<Get_physics_constant_return> {
|
||||
const url = `/constant/physics/${constant}`;
|
||||
const urlBase = process?.env?.BASE_URL || 'https://api.kittycad.io';
|
||||
const fullUrl = urlBase + 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_physics_constant_return;
|
||||
return result;
|
||||
}
|
30
src/api/executor/create_executor_term.ts
Normal file
30
src/api/executor/create_executor_term.ts
Normal file
@ -0,0 +1,30 @@
|
||||
import fetch from 'node-fetch';
|
||||
import {} from '../../models.js';
|
||||
import { Client } from '../../client.js';
|
||||
|
||||
interface Create_executor_term_params {
|
||||
client?: Client;
|
||||
}
|
||||
|
||||
type Create_executor_term_return = any;
|
||||
|
||||
export default async function create_executor_term({
|
||||
client,
|
||||
}: Create_executor_term_params = {}): Promise<Create_executor_term_return> {
|
||||
const url = `/ws/executor/term`;
|
||||
const urlBase = process?.env?.BASE_URL || 'https://api.kittycad.io';
|
||||
const fullUrl = urlBase + 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 Create_executor_term_return;
|
||||
return result;
|
||||
}
|
41
src/api/executor/create_file_execution.ts
Normal file
41
src/api/executor/create_file_execution.ts
Normal file
@ -0,0 +1,41 @@
|
||||
import fetch from 'node-fetch';
|
||||
import {
|
||||
CodeOutput_type,
|
||||
Error_type,
|
||||
CodeLanguage_type,
|
||||
} from '../../models.js';
|
||||
import { Client } from '../../client.js';
|
||||
|
||||
interface Create_file_execution_params {
|
||||
client?: Client;
|
||||
lang: CodeLanguage_type;
|
||||
output: string;
|
||||
body: string;
|
||||
}
|
||||
|
||||
type Create_file_execution_return = CodeOutput_type | Error_type;
|
||||
|
||||
export default async function create_file_execution({
|
||||
client,
|
||||
lang,
|
||||
output,
|
||||
body,
|
||||
}: Create_file_execution_params): Promise<Create_file_execution_return> {
|
||||
const url = `/file/execute/${lang}?output=${output}`;
|
||||
const urlBase = process?.env?.BASE_URL || 'https://api.kittycad.io';
|
||||
const fullUrl = urlBase + 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_execution_return;
|
||||
return result;
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
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 urlBase = process?.env?.BASE_URL || 'https://api.kittycad.io';
|
||||
const fullUrl = urlBase + 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;
|
||||
}
|
@ -2,13 +2,13 @@ import fetch from 'node-fetch';
|
||||
import {
|
||||
FileCenterOfMass_type,
|
||||
Error_type,
|
||||
File3DImportFormat_type,
|
||||
FileImportFormat_type,
|
||||
} from '../../models.js';
|
||||
import { Client } from '../../client.js';
|
||||
|
||||
interface Create_file_center_of_mass_params {
|
||||
client?: Client;
|
||||
src_format: File3DImportFormat_type;
|
||||
src_format: FileImportFormat_type;
|
||||
body: string;
|
||||
}
|
||||
|
||||
|
@ -2,14 +2,14 @@ import fetch from 'node-fetch';
|
||||
import {
|
||||
FileDensity_type,
|
||||
Error_type,
|
||||
File3DImportFormat_type,
|
||||
FileImportFormat_type,
|
||||
} from '../../models.js';
|
||||
import { Client } from '../../client.js';
|
||||
|
||||
interface Create_file_density_params {
|
||||
client?: Client;
|
||||
material_mass: number;
|
||||
src_format: File3DImportFormat_type;
|
||||
src_format: FileImportFormat_type;
|
||||
body: string;
|
||||
}
|
||||
|
||||
|
@ -2,14 +2,14 @@ import fetch from 'node-fetch';
|
||||
import {
|
||||
FileMass_type,
|
||||
Error_type,
|
||||
File3DImportFormat_type,
|
||||
FileImportFormat_type,
|
||||
} from '../../models.js';
|
||||
import { Client } from '../../client.js';
|
||||
|
||||
interface Create_file_mass_params {
|
||||
client?: Client;
|
||||
material_density: number;
|
||||
src_format: File3DImportFormat_type;
|
||||
src_format: FileImportFormat_type;
|
||||
body: string;
|
||||
}
|
||||
|
||||
|
@ -2,13 +2,13 @@ import fetch from 'node-fetch';
|
||||
import {
|
||||
FileSurfaceArea_type,
|
||||
Error_type,
|
||||
File3DImportFormat_type,
|
||||
FileImportFormat_type,
|
||||
} from '../../models.js';
|
||||
import { Client } from '../../client.js';
|
||||
|
||||
interface Create_file_surface_area_params {
|
||||
client?: Client;
|
||||
src_format: File3DImportFormat_type;
|
||||
src_format: FileImportFormat_type;
|
||||
body: string;
|
||||
}
|
||||
|
||||
|
@ -2,13 +2,13 @@ import fetch from 'node-fetch';
|
||||
import {
|
||||
FileVolume_type,
|
||||
Error_type,
|
||||
File3DImportFormat_type,
|
||||
FileImportFormat_type,
|
||||
} from '../../models.js';
|
||||
import { Client } from '../../client.js';
|
||||
|
||||
interface Create_file_volume_params {
|
||||
client?: Client;
|
||||
src_format: File3DImportFormat_type;
|
||||
src_format: FileImportFormat_type;
|
||||
body: string;
|
||||
}
|
||||
|
||||
|
30
src/api/meta/get_ai_plugin_manifest.ts
Normal file
30
src/api/meta/get_ai_plugin_manifest.ts
Normal file
@ -0,0 +1,30 @@
|
||||
import fetch from 'node-fetch';
|
||||
import { AiPluginManifest_type, Error_type } from '../../models.js';
|
||||
import { Client } from '../../client.js';
|
||||
|
||||
interface Get_ai_plugin_manifest_params {
|
||||
client?: Client;
|
||||
}
|
||||
|
||||
type Get_ai_plugin_manifest_return = AiPluginManifest_type | Error_type;
|
||||
|
||||
export default async function get_ai_plugin_manifest({
|
||||
client,
|
||||
}: Get_ai_plugin_manifest_params = {}): Promise<Get_ai_plugin_manifest_return> {
|
||||
const url = `/.well-known/ai-plugin.json`;
|
||||
const urlBase = process?.env?.BASE_URL || 'https://api.kittycad.io';
|
||||
const fullUrl = urlBase + 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_ai_plugin_manifest_return;
|
||||
return result;
|
||||
}
|
30
src/api/meta/get_metadata.ts
Normal file
30
src/api/meta/get_metadata.ts
Normal file
@ -0,0 +1,30 @@
|
||||
import fetch from 'node-fetch';
|
||||
import { Metadata_type, Error_type } from '../../models.js';
|
||||
import { Client } from '../../client.js';
|
||||
|
||||
interface Get_metadata_params {
|
||||
client?: Client;
|
||||
}
|
||||
|
||||
type Get_metadata_return = Metadata_type | Error_type;
|
||||
|
||||
export default async function get_metadata({
|
||||
client,
|
||||
}: Get_metadata_params = {}): Promise<Get_metadata_return> {
|
||||
const url = `/_meta/info`;
|
||||
const urlBase = process?.env?.BASE_URL || 'https://api.kittycad.io';
|
||||
const fullUrl = urlBase + 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_metadata_return;
|
||||
return result;
|
||||
}
|
30
src/api/meta/get_openai_schema.ts
Normal file
30
src/api/meta/get_openai_schema.ts
Normal file
@ -0,0 +1,30 @@
|
||||
import fetch from 'node-fetch';
|
||||
import { Error_type } from '../../models.js';
|
||||
import { Client } from '../../client.js';
|
||||
|
||||
interface Get_openai_schema_params {
|
||||
client?: Client;
|
||||
}
|
||||
|
||||
type Get_openai_schema_return = Error_type;
|
||||
|
||||
export default async function get_openai_schema({
|
||||
client,
|
||||
}: Get_openai_schema_params = {}): Promise<Get_openai_schema_return> {
|
||||
const url = `/openai/openapi.json`;
|
||||
const urlBase = process?.env?.BASE_URL || 'https://api.kittycad.io';
|
||||
const fullUrl = urlBase + 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_openai_schema_return;
|
||||
return result;
|
||||
}
|
30
src/api/modeling/cmd.ts
Normal file
30
src/api/modeling/cmd.ts
Normal file
@ -0,0 +1,30 @@
|
||||
import fetch from 'node-fetch';
|
||||
import { Error_type } from '../../models.js';
|
||||
import { Client } from '../../client.js';
|
||||
|
||||
interface Cmd_params {
|
||||
client?: Client;
|
||||
}
|
||||
|
||||
type Cmd_return = Error_type;
|
||||
|
||||
export default async function cmd({
|
||||
client,
|
||||
}: Cmd_params = {}): Promise<Cmd_return> {
|
||||
const url = `/modeling/cmd`;
|
||||
const urlBase = process?.env?.BASE_URL || 'https://api.kittycad.io';
|
||||
const fullUrl = urlBase + url;
|
||||
const kittycadToken = client
|
||||
? client.token
|
||||
: process.env.KITTYCAD_TOKEN || '';
|
||||
const headers = {
|
||||
Authorization: `Bearer ${kittycadToken}`,
|
||||
};
|
||||
const fetchOptions = {
|
||||
method: 'POST',
|
||||
headers,
|
||||
};
|
||||
const response = await fetch(fullUrl, fetchOptions);
|
||||
const result = (await response.json()) as Cmd_return;
|
||||
return result;
|
||||
}
|
30
src/api/modeling/cmd_batch.ts
Normal file
30
src/api/modeling/cmd_batch.ts
Normal file
@ -0,0 +1,30 @@
|
||||
import fetch from 'node-fetch';
|
||||
import { ModelingOutcomes_type, Error_type } from '../../models.js';
|
||||
import { Client } from '../../client.js';
|
||||
|
||||
interface Cmd_batch_params {
|
||||
client?: Client;
|
||||
}
|
||||
|
||||
type Cmd_batch_return = ModelingOutcomes_type | Error_type;
|
||||
|
||||
export default async function cmd_batch({
|
||||
client,
|
||||
}: Cmd_batch_params = {}): Promise<Cmd_batch_return> {
|
||||
const url = `/modeling/cmd_batch`;
|
||||
const urlBase = process?.env?.BASE_URL || 'https://api.kittycad.io';
|
||||
const fullUrl = urlBase + url;
|
||||
const kittycadToken = client
|
||||
? client.token
|
||||
: process.env.KITTYCAD_TOKEN || '';
|
||||
const headers = {
|
||||
Authorization: `Bearer ${kittycadToken}`,
|
||||
};
|
||||
const fetchOptions = {
|
||||
method: 'POST',
|
||||
headers,
|
||||
};
|
||||
const response = await fetch(fullUrl, fetchOptions);
|
||||
const result = (await response.json()) as Cmd_batch_return;
|
||||
return result;
|
||||
}
|
30
src/api/modeling/modeling_commands_ws.ts
Normal file
30
src/api/modeling/modeling_commands_ws.ts
Normal file
@ -0,0 +1,30 @@
|
||||
import fetch from 'node-fetch';
|
||||
import {} from '../../models.js';
|
||||
import { Client } from '../../client.js';
|
||||
|
||||
interface Modeling_commands_ws_params {
|
||||
client?: Client;
|
||||
}
|
||||
|
||||
type Modeling_commands_ws_return = any;
|
||||
|
||||
export default async function modeling_commands_ws({
|
||||
client,
|
||||
}: Modeling_commands_ws_params = {}): Promise<Modeling_commands_ws_return> {
|
||||
const url = `/ws/modeling/commands`;
|
||||
const urlBase = process?.env?.BASE_URL || 'https://api.kittycad.io';
|
||||
const fullUrl = urlBase + 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 Modeling_commands_ws_return;
|
||||
return result;
|
||||
}
|
30
src/api/oauth2/device_access_token.ts
Normal file
30
src/api/oauth2/device_access_token.ts
Normal file
@ -0,0 +1,30 @@
|
||||
import fetch from 'node-fetch';
|
||||
import {} from '../../models.js';
|
||||
import { Client } from '../../client.js';
|
||||
|
||||
interface Device_access_token_params {
|
||||
client?: Client;
|
||||
}
|
||||
|
||||
type Device_access_token_return = any;
|
||||
|
||||
export default async function device_access_token({
|
||||
client,
|
||||
}: Device_access_token_params = {}): Promise<Device_access_token_return> {
|
||||
const url = `/oauth2/device/token`;
|
||||
const urlBase = process?.env?.BASE_URL || 'https://api.kittycad.io';
|
||||
const fullUrl = urlBase + url;
|
||||
const kittycadToken = client
|
||||
? client.token
|
||||
: process.env.KITTYCAD_TOKEN || '';
|
||||
const headers = {
|
||||
Authorization: `Bearer ${kittycadToken}`,
|
||||
};
|
||||
const fetchOptions = {
|
||||
method: 'POST',
|
||||
headers,
|
||||
};
|
||||
const response = await fetch(fullUrl, fetchOptions);
|
||||
const result = (await response.json()) as Device_access_token_return;
|
||||
return result;
|
||||
}
|
30
src/api/oauth2/device_auth_confirm.ts
Normal file
30
src/api/oauth2/device_auth_confirm.ts
Normal file
@ -0,0 +1,30 @@
|
||||
import fetch from 'node-fetch';
|
||||
import { Error_type } from '../../models.js';
|
||||
import { Client } from '../../client.js';
|
||||
|
||||
interface Device_auth_confirm_params {
|
||||
client?: Client;
|
||||
}
|
||||
|
||||
type Device_auth_confirm_return = Error_type;
|
||||
|
||||
export default async function device_auth_confirm({
|
||||
client,
|
||||
}: Device_auth_confirm_params = {}): Promise<Device_auth_confirm_return> {
|
||||
const url = `/oauth2/device/confirm`;
|
||||
const urlBase = process?.env?.BASE_URL || 'https://api.kittycad.io';
|
||||
const fullUrl = urlBase + url;
|
||||
const kittycadToken = client
|
||||
? client.token
|
||||
: process.env.KITTYCAD_TOKEN || '';
|
||||
const headers = {
|
||||
Authorization: `Bearer ${kittycadToken}`,
|
||||
};
|
||||
const fetchOptions = {
|
||||
method: 'POST',
|
||||
headers,
|
||||
};
|
||||
const response = await fetch(fullUrl, fetchOptions);
|
||||
const result = (await response.json()) as Device_auth_confirm_return;
|
||||
return result;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user