Skip to content

Commit d57f23e

Browse files
feat(api): api update
1 parent 90c9185 commit d57f23e

File tree

9 files changed

+56
-62
lines changed

9 files changed

+56
-62
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 18
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-86464130af6afb678b92cd7a412035fa95d0f806eb35d5cfc1902c0d417c44ca.yml
3-
openapi_spec_hash: 9df21af9ca1497c2a481936ba585290d
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-3d350e6cd04452a1654fdb7a93fa7e8dbbf7706273ae7c21818efce9dcf9bbfe.yml
3+
openapi_spec_hash: 25beffd2761e5414d0cb32f74a969a38
44
config_hash: b3ca4ec5b02e5333af51ebc2e9fdef1b

tests/api-resources/contexts.test.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const client = new Browserbase({
1010

1111
describe('resource contexts', () => {
1212
test('create: only required params', async () => {
13-
const responsePromise = client.contexts.create({ projectId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' });
13+
const responsePromise = client.contexts.create({ projectId: 'projectId' });
1414
const rawResponse = await responsePromise.asResponse();
1515
expect(rawResponse).toBeInstanceOf(Response);
1616
const response = await responsePromise;
@@ -21,11 +21,11 @@ describe('resource contexts', () => {
2121
});
2222

2323
test('create: required and optional params', async () => {
24-
const response = await client.contexts.create({ projectId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' });
24+
const response = await client.contexts.create({ projectId: 'projectId' });
2525
});
2626

2727
test('retrieve', async () => {
28-
const responsePromise = client.contexts.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
28+
const responsePromise = client.contexts.retrieve('id');
2929
const rawResponse = await responsePromise.asResponse();
3030
expect(rawResponse).toBeInstanceOf(Response);
3131
const response = await responsePromise;
@@ -37,13 +37,13 @@ describe('resource contexts', () => {
3737

3838
test('retrieve: request options instead of params are passed correctly', async () => {
3939
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
40-
await expect(
41-
client.contexts.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { path: '/_stainless_unknown_path' }),
42-
).rejects.toThrow(Browserbase.NotFoundError);
40+
await expect(client.contexts.retrieve('id', { path: '/_stainless_unknown_path' })).rejects.toThrow(
41+
Browserbase.NotFoundError,
42+
);
4343
});
4444

4545
test('update', async () => {
46-
const responsePromise = client.contexts.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
46+
const responsePromise = client.contexts.update('id');
4747
const rawResponse = await responsePromise.asResponse();
4848
expect(rawResponse).toBeInstanceOf(Response);
4949
const response = await responsePromise;
@@ -55,8 +55,8 @@ describe('resource contexts', () => {
5555

5656
test('update: request options instead of params are passed correctly', async () => {
5757
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
58-
await expect(
59-
client.contexts.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { path: '/_stainless_unknown_path' }),
60-
).rejects.toThrow(Browserbase.NotFoundError);
58+
await expect(client.contexts.update('id', { path: '/_stainless_unknown_path' })).rejects.toThrow(
59+
Browserbase.NotFoundError,
60+
);
6161
});
6262
});

tests/api-resources/extensions.test.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe('resource extensions', () => {
2929
});
3030

3131
test('retrieve', async () => {
32-
const responsePromise = client.extensions.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
32+
const responsePromise = client.extensions.retrieve('id');
3333
const rawResponse = await responsePromise.asResponse();
3434
expect(rawResponse).toBeInstanceOf(Response);
3535
const response = await responsePromise;
@@ -41,15 +41,13 @@ describe('resource extensions', () => {
4141

4242
test('retrieve: request options instead of params are passed correctly', async () => {
4343
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
44-
await expect(
45-
client.extensions.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
46-
path: '/_stainless_unknown_path',
47-
}),
48-
).rejects.toThrow(Browserbase.NotFoundError);
44+
await expect(client.extensions.retrieve('id', { path: '/_stainless_unknown_path' })).rejects.toThrow(
45+
Browserbase.NotFoundError,
46+
);
4947
});
5048

5149
test('delete', async () => {
52-
const responsePromise = client.extensions.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
50+
const responsePromise = client.extensions.delete('id');
5351
const rawResponse = await responsePromise.asResponse();
5452
expect(rawResponse).toBeInstanceOf(Response);
5553
const response = await responsePromise;
@@ -61,8 +59,8 @@ describe('resource extensions', () => {
6159

6260
test('delete: request options instead of params are passed correctly', async () => {
6361
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
64-
await expect(
65-
client.extensions.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { path: '/_stainless_unknown_path' }),
66-
).rejects.toThrow(Browserbase.NotFoundError);
62+
await expect(client.extensions.delete('id', { path: '/_stainless_unknown_path' })).rejects.toThrow(
63+
Browserbase.NotFoundError,
64+
);
6765
});
6866
});

tests/api-resources/projects.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const client = new Browserbase({
1010

1111
describe('resource projects', () => {
1212
test('retrieve', async () => {
13-
const responsePromise = client.projects.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
13+
const responsePromise = client.projects.retrieve('id');
1414
const rawResponse = await responsePromise.asResponse();
1515
expect(rawResponse).toBeInstanceOf(Response);
1616
const response = await responsePromise;
@@ -22,9 +22,9 @@ describe('resource projects', () => {
2222

2323
test('retrieve: request options instead of params are passed correctly', async () => {
2424
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
25-
await expect(
26-
client.projects.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { path: '/_stainless_unknown_path' }),
27-
).rejects.toThrow(Browserbase.NotFoundError);
25+
await expect(client.projects.retrieve('id', { path: '/_stainless_unknown_path' })).rejects.toThrow(
26+
Browserbase.NotFoundError,
27+
);
2828
});
2929

3030
test('list', async () => {
@@ -46,7 +46,7 @@ describe('resource projects', () => {
4646
});
4747

4848
test('usage', async () => {
49-
const responsePromise = client.projects.usage('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
49+
const responsePromise = client.projects.usage('id');
5050
const rawResponse = await responsePromise.asResponse();
5151
expect(rawResponse).toBeInstanceOf(Response);
5252
const response = await responsePromise;
@@ -58,8 +58,8 @@ describe('resource projects', () => {
5858

5959
test('usage: request options instead of params are passed correctly', async () => {
6060
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
61-
await expect(
62-
client.projects.usage('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { path: '/_stainless_unknown_path' }),
63-
).rejects.toThrow(Browserbase.NotFoundError);
61+
await expect(client.projects.usage('id', { path: '/_stainless_unknown_path' })).rejects.toThrow(
62+
Browserbase.NotFoundError,
63+
);
6464
});
6565
});

tests/api-resources/sessions/downloads.test.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ const client = new Browserbase({
1010
describe('resource downloads', () => {
1111
test('list: request options instead of params are passed correctly', async () => {
1212
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
13-
await expect(
14-
client.sessions.downloads.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
15-
path: '/_stainless_unknown_path',
16-
}),
17-
).rejects.toThrow(Browserbase.NotFoundError);
13+
await expect(client.sessions.downloads.list('id', { path: '/_stainless_unknown_path' })).rejects.toThrow(
14+
Browserbase.NotFoundError,
15+
);
1816
});
1917
});

tests/api-resources/sessions/logs.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const client = new Browserbase({
1010

1111
describe('resource logs', () => {
1212
test('list', async () => {
13-
const responsePromise = client.sessions.logs.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
13+
const responsePromise = client.sessions.logs.list('id');
1414
const rawResponse = await responsePromise.asResponse();
1515
expect(rawResponse).toBeInstanceOf(Response);
1616
const response = await responsePromise;
@@ -22,8 +22,8 @@ describe('resource logs', () => {
2222

2323
test('list: request options instead of params are passed correctly', async () => {
2424
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
25-
await expect(
26-
client.sessions.logs.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { path: '/_stainless_unknown_path' }),
27-
).rejects.toThrow(Browserbase.NotFoundError);
25+
await expect(client.sessions.logs.list('id', { path: '/_stainless_unknown_path' })).rejects.toThrow(
26+
Browserbase.NotFoundError,
27+
);
2828
});
2929
});

tests/api-resources/sessions/recording.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const client = new Browserbase({
1010

1111
describe('resource recording', () => {
1212
test('retrieve', async () => {
13-
const responsePromise = client.sessions.recording.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
13+
const responsePromise = client.sessions.recording.retrieve('id');
1414
const rawResponse = await responsePromise.asResponse();
1515
expect(rawResponse).toBeInstanceOf(Response);
1616
const response = await responsePromise;
@@ -23,9 +23,7 @@ describe('resource recording', () => {
2323
test('retrieve: request options instead of params are passed correctly', async () => {
2424
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
2525
await expect(
26-
client.sessions.recording.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
27-
path: '/_stainless_unknown_path',
28-
}),
26+
client.sessions.recording.retrieve('id', { path: '/_stainless_unknown_path' }),
2927
).rejects.toThrow(Browserbase.NotFoundError);
3028
});
3129
});

tests/api-resources/sessions/sessions.test.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const client = new Browserbase({
1010

1111
describe('resource sessions', () => {
1212
test('create: only required params', async () => {
13-
const responsePromise = client.sessions.create({ projectId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' });
13+
const responsePromise = client.sessions.create({ projectId: 'projectId' });
1414
const rawResponse = await responsePromise.asResponse();
1515
expect(rawResponse).toBeInstanceOf(Response);
1616
const response = await responsePromise;
@@ -22,14 +22,14 @@ describe('resource sessions', () => {
2222

2323
test('create: required and optional params', async () => {
2424
const response = await client.sessions.create({
25-
projectId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
25+
projectId: 'projectId',
2626
browserSettings: {
2727
advancedStealth: true,
2828
blockAds: true,
2929
captchaImageSelector: 'captchaImageSelector',
3030
captchaInputSelector: 'captchaInputSelector',
31-
context: { id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', persist: true },
32-
extensionId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
31+
context: { id: 'id', persist: true },
32+
extensionId: 'extensionId',
3333
fingerprint: {
3434
browsers: ['chrome'],
3535
devices: ['desktop'],
@@ -43,7 +43,7 @@ describe('resource sessions', () => {
4343
solveCaptchas: true,
4444
viewport: { height: 0, width: 0 },
4545
},
46-
extensionId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
46+
extensionId: 'extensionId',
4747
keepAlive: true,
4848
proxies: [
4949
{
@@ -59,7 +59,7 @@ describe('resource sessions', () => {
5959
});
6060

6161
test('retrieve', async () => {
62-
const responsePromise = client.sessions.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
62+
const responsePromise = client.sessions.retrieve('id');
6363
const rawResponse = await responsePromise.asResponse();
6464
expect(rawResponse).toBeInstanceOf(Response);
6565
const response = await responsePromise;
@@ -71,14 +71,14 @@ describe('resource sessions', () => {
7171

7272
test('retrieve: request options instead of params are passed correctly', async () => {
7373
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
74-
await expect(
75-
client.sessions.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { path: '/_stainless_unknown_path' }),
76-
).rejects.toThrow(Browserbase.NotFoundError);
74+
await expect(client.sessions.retrieve('id', { path: '/_stainless_unknown_path' })).rejects.toThrow(
75+
Browserbase.NotFoundError,
76+
);
7777
});
7878

7979
test('update: only required params', async () => {
80-
const responsePromise = client.sessions.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
81-
projectId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
80+
const responsePromise = client.sessions.update('id', {
81+
projectId: 'projectId',
8282
status: 'REQUEST_RELEASE',
8383
});
8484
const rawResponse = await responsePromise.asResponse();
@@ -91,8 +91,8 @@ describe('resource sessions', () => {
9191
});
9292

9393
test('update: required and optional params', async () => {
94-
const response = await client.sessions.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
95-
projectId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
94+
const response = await client.sessions.update('id', {
95+
projectId: 'projectId',
9696
status: 'REQUEST_RELEASE',
9797
});
9898
});
@@ -123,7 +123,7 @@ describe('resource sessions', () => {
123123
});
124124

125125
test('debug', async () => {
126-
const responsePromise = client.sessions.debug('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
126+
const responsePromise = client.sessions.debug('id');
127127
const rawResponse = await responsePromise.asResponse();
128128
expect(rawResponse).toBeInstanceOf(Response);
129129
const response = await responsePromise;
@@ -135,8 +135,8 @@ describe('resource sessions', () => {
135135

136136
test('debug: request options instead of params are passed correctly', async () => {
137137
// ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error
138-
await expect(
139-
client.sessions.debug('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { path: '/_stainless_unknown_path' }),
140-
).rejects.toThrow(Browserbase.NotFoundError);
138+
await expect(client.sessions.debug('id', { path: '/_stainless_unknown_path' })).rejects.toThrow(
139+
Browserbase.NotFoundError,
140+
);
141141
});
142142
});

tests/api-resources/sessions/uploads.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const client = new Browserbase({
1010

1111
describe('resource uploads', () => {
1212
test('create: only required params', async () => {
13-
const responsePromise = client.sessions.uploads.create('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
13+
const responsePromise = client.sessions.uploads.create('id', {
1414
file: await toFile(Buffer.from('# my file contents'), 'README.md'),
1515
});
1616
const rawResponse = await responsePromise.asResponse();
@@ -23,7 +23,7 @@ describe('resource uploads', () => {
2323
});
2424

2525
test('create: required and optional params', async () => {
26-
const response = await client.sessions.uploads.create('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
26+
const response = await client.sessions.uploads.create('id', {
2727
file: await toFile(Buffer.from('# my file contents'), 'README.md'),
2828
});
2929
});

0 commit comments

Comments
 (0)