Skip to content

Commit 2ad71d8

Browse files
author
Stainless Bot
committed
feat(api): api update (#42)
1 parent 97dddaa commit 2ad71d8

File tree

9 files changed

+28
-27
lines changed

9 files changed

+28
-27
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ yarn-error.log
44
codegen.log
55
Brewfile.lock.json
66
dist
7-
/deno
7+
dist-deno
88
/*.tgz
99
.idea/
1010

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 18
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-d8e42f141c0955e8100ca3ce041ce8dedf5dcf68b04e554a5704e4c2003c2fd4.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fbrowserbase-7f88912695bab2b98cb73137e6f36125d02fdfaf8eed4532ee1c82385609a259.yml

scripts/build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ node scripts/utils/postprocess-files.cjs
5050
(cd dist && node -e 'require("@browserbasehq/sdk")')
5151
(cd dist && node -e 'import("@browserbasehq/sdk")' --input-type=module)
5252

53-
if command -v deno &> /dev/null && [ -e ./scripts/build-deno ]
53+
if [ -e ./scripts/build-deno ]
5454
then
5555
./scripts/build-deno
5656
fi

src/core.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ export abstract class APIClient {
396396
error: Object | undefined,
397397
message: string | undefined,
398398
headers: Headers | undefined,
399-
) {
399+
): APIError {
400400
return APIError.generate(status, error, message, headers);
401401
}
402402

@@ -668,17 +668,17 @@ export abstract class AbstractPage<Item> implements AsyncIterable<Item> {
668668
return await this.#client.requestAPIList(this.constructor as any, nextOptions);
669669
}
670670

671-
async *iterPages() {
671+
async *iterPages(): AsyncGenerator<this> {
672672
// eslint-disable-next-line @typescript-eslint/no-this-alias
673-
let page: AbstractPage<Item> = this;
673+
let page: this = this;
674674
yield page;
675675
while (page.hasNextPage()) {
676676
page = await page.getNextPage();
677677
yield page;
678678
}
679679
}
680680

681-
async *[Symbol.asyncIterator]() {
681+
async *[Symbol.asyncIterator](): AsyncGenerator<Item> {
682682
for await (const page of this.iterPages()) {
683683
for (const item of page.getPaginatedItems()) {
684684
yield item;
@@ -721,7 +721,7 @@ export class PagePromise<
721721
* console.log(item)
722722
* }
723723
*/
724-
async *[Symbol.asyncIterator]() {
724+
async *[Symbol.asyncIterator](): AsyncGenerator<Item> {
725725
const page = await this;
726726
for await (const item of page) {
727727
yield item;

src/error.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export class APIError extends BrowserbaseError {
4747
errorResponse: Object | undefined,
4848
message: string | undefined,
4949
headers: Headers | undefined,
50-
) {
50+
): APIError {
5151
if (!status) {
5252
return new APIConnectionError({ message, cause: castToError(errorResponse) });
5353
}

src/index.ts

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -179,19 +179,21 @@ export class Browserbase extends Core.APIClient {
179179
static fileFromPath = Uploads.fileFromPath;
180180
}
181181

182-
export const BrowserbaseError = Errors.BrowserbaseError;
183-
export const APIError = Errors.APIError;
184-
export const APIConnectionError = Errors.APIConnectionError;
185-
export const APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
186-
export const APIUserAbortError = Errors.APIUserAbortError;
187-
export const NotFoundError = Errors.NotFoundError;
188-
export const ConflictError = Errors.ConflictError;
189-
export const RateLimitError = Errors.RateLimitError;
190-
export const BadRequestError = Errors.BadRequestError;
191-
export const AuthenticationError = Errors.AuthenticationError;
192-
export const InternalServerError = Errors.InternalServerError;
193-
export const PermissionDeniedError = Errors.PermissionDeniedError;
194-
export const UnprocessableEntityError = Errors.UnprocessableEntityError;
182+
export {
183+
BrowserbaseError,
184+
APIError,
185+
APIConnectionError,
186+
APIConnectionTimeoutError,
187+
APIUserAbortError,
188+
NotFoundError,
189+
ConflictError,
190+
RateLimitError,
191+
BadRequestError,
192+
AuthenticationError,
193+
InternalServerError,
194+
PermissionDeniedError,
195+
UnprocessableEntityError,
196+
} from './error';
195197

196198
export import toFile = Uploads.toFile;
197199
export import fileFromPath = Uploads.fileFromPath;

src/resources/sessions/recording.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ export class Recording extends APIResource {
1313
}
1414

1515
export interface SessionRecording {
16-
id: string;
17-
1816
/**
1917
* See
2018
* [rrweb documentation](https://github.com/rrweb-io/rrweb/blob/master/docs/recipes/dive-into-event.md).

tsconfig.deno.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"extends": "./tsconfig.json",
3-
"include": ["deno"],
3+
"include": ["dist-deno"],
44
"exclude": [],
55
"compilerOptions": {
6-
"rootDir": "./deno",
6+
"rootDir": "./dist-deno",
77
"lib": ["es2020", "DOM"],
88
"paths": {
99
"@browserbasehq/sdk/_shims/auto/*": ["deno/_shims/auto/*-deno"],
@@ -13,7 +13,7 @@
1313
"noEmit": true,
1414
"declaration": true,
1515
"declarationMap": true,
16-
"outDir": "deno",
16+
"outDir": "dist-deno",
1717
"pretty": true,
1818
"sourceMap": true
1919
}

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"noUncheckedIndexedAccess": true,
3333
"noImplicitOverride": true,
3434
"noPropertyAccessFromIndexSignature": true,
35+
"isolatedModules": false,
3536

3637
"skipLibCheck": true
3738
}

0 commit comments

Comments
 (0)