Skip to content

Commit cd8b791

Browse files
zoo-github-actions-auth[bot]github-actions[bot]Irev-Dev
authored
Update api spec (#218)
* YOYO NEW API SPEC! * fix * update test ignore list * Generated new lib * bump v --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Kurt Hutten Irev-Dev <[email protected]>
1 parent e39fc8b commit cd8b791

File tree

58 files changed

+7633
-1874
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+7633
-1874
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { ai } from '../../src/index.js';
2+
3+
async function example() {
4+
const response = await ai.create_kcl_code_completions({
5+
body: {
6+
extra: {
7+
language: 'The language of the code.',
8+
next_indent: 7,
9+
prompt_tokens: 7,
10+
suffix_tokens: 7,
11+
trim_by_indentation: true,
12+
},
13+
max_tokens: 7,
14+
n: 7,
15+
nwo: 'For GitHub copilot this is the `{org}/{repo}`. This does not do anything yet. But we wanted the same API as GitHub Copilot. It might be used in the future.',
16+
prompt: 'The prompt for the model.',
17+
stop: ['string'],
18+
stream: true,
19+
suffix: 'The suffix for the model.',
20+
temperature: 7,
21+
top_p: 7,
22+
},
23+
});
24+
if ('error_code' in response) throw response;
25+
26+
return response;
27+
}
28+
29+
describe('Testing ai.create_kcl_code_completions', () => {
30+
it('should be truthy or throw', async () => {
31+
expect(await example()).toBeTruthy();
32+
});
33+
});
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { meta } from '../../src/index.js';
2+
3+
async function example() {
4+
const response = await meta.create_event();
5+
if ('error_code' in response) throw response;
6+
7+
return response;
8+
}
9+
10+
describe('Testing meta.create_event', () => {
11+
it('should be truthy or throw', async () => {
12+
expect(await example()).toBeTruthy();
13+
});
14+
});
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { meta } from '../../src/index.js';
2+
3+
async function example() {
4+
const response = await meta.get_pricing_subscriptions();
5+
if ('error_code' in response) throw response;
6+
7+
return response;
8+
}
9+
10+
describe('Testing meta.get_pricing_subscriptions', () => {
11+
it('should be truthy or throw', async () => {
12+
expect(await example()).toBeTruthy();
13+
});
14+
});
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { orgs } from '../../src/index.js';
2+
3+
async function example() {
4+
const response = await orgs.get_any_org({
5+
id: '00000000-0000-0000-0000-000000000000',
6+
});
7+
if ('error_code' in response) throw response;
8+
9+
return response;
10+
}
11+
12+
describe('Testing orgs.get_any_org', () => {
13+
it('should be truthy or throw', async () => {
14+
try {
15+
await example();
16+
} catch (err) {
17+
expect(err).toBeTruthy(); // eslint-disable-line jest/no-conditional-expect
18+
}
19+
});
20+
});
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { orgs } from '../../src/index.js';
2+
3+
async function example() {
4+
const response = await orgs.get_org_privacy_settings();
5+
if ('error_code' in response) throw response;
6+
7+
return response;
8+
}
9+
10+
describe('Testing orgs.get_org_privacy_settings', () => {
11+
it('should be truthy or throw', async () => {
12+
try {
13+
await example();
14+
} catch (err) {
15+
expect(err).toBeTruthy(); // eslint-disable-line jest/no-conditional-expect
16+
}
17+
});
18+
});

__tests__/gen/orgs-list_orgs.test.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { orgs } from '../../src/index.js';
2+
3+
async function example() {
4+
const response = await orgs.list_orgs({
5+
limit: 7,
6+
page_token: 'string',
7+
sort_by: 'created_at_ascending',
8+
});
9+
if ('error_code' in response) throw response;
10+
11+
return response;
12+
}
13+
14+
describe('Testing orgs.list_orgs', () => {
15+
it('should be truthy or throw', async () => {
16+
expect(await example()).toBeTruthy();
17+
});
18+
});
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { orgs } from '../../src/index.js';
2+
3+
async function example() {
4+
const response = await orgs.update_enterprise_pricing_for_org({
5+
id: '00000000-0000-0000-0000-000000000000',
6+
body: { interval: 'day', price: 7, type: 'flat' },
7+
});
8+
if ('error_code' in response) throw response;
9+
10+
return response;
11+
}
12+
13+
describe('Testing orgs.update_enterprise_pricing_for_org', () => {
14+
it('should be truthy or throw', async () => {
15+
expect(await example()).toBeTruthy();
16+
});
17+
});
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { orgs } from '../../src/index.js';
2+
3+
async function example() {
4+
const response = await orgs.update_org_privacy_settings({
5+
body: { can_train_on_data: true },
6+
});
7+
if ('error_code' in response) throw response;
8+
9+
return response;
10+
}
11+
12+
describe('Testing orgs.update_org_privacy_settings', () => {
13+
it('should be truthy or throw', async () => {
14+
expect(await example()).toBeTruthy();
15+
});
16+
});
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { payments } from '../../src/index.js';
2+
3+
async function example() {
4+
const response = await payments.create_org_subscription({
5+
body: { modeling_app: 'team' },
6+
});
7+
if ('error_code' in response) throw response;
8+
9+
return response;
10+
}
11+
12+
describe('Testing payments.create_org_subscription', () => {
13+
it('should be truthy or throw', async () => {
14+
expect(await example()).toBeTruthy();
15+
});
16+
});
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { payments } from '../../src/index.js';
2+
3+
async function example() {
4+
const response = await payments.create_user_subscription({
5+
body: { modeling_app: 'free' },
6+
});
7+
if ('error_code' in response) throw response;
8+
9+
return response;
10+
}
11+
12+
describe('Testing payments.create_user_subscription', () => {
13+
it('should be truthy or throw', async () => {
14+
expect(await example()).toBeTruthy();
15+
});
16+
});

0 commit comments

Comments
 (0)