@browserbasehq/sdk 2.19.1 → 2.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/index.d.mts +3 -0
- package/index.d.ts +3 -0
- package/index.d.ts.map +1 -1
- package/index.js +3 -0
- package/index.js.map +1 -1
- package/index.mjs +3 -0
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/index.d.ts +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/webhooks.d.ts +147 -0
- package/resources/webhooks.d.ts.map +1 -0
- package/resources/webhooks.js +57 -0
- package/resources/webhooks.js.map +1 -0
- package/resources/webhooks.mjs +53 -0
- package/resources/webhooks.mjs.map +1 -0
- package/src/index.ts +25 -0
- package/src/resources/index.ts +11 -0
- package/src/resources/webhooks.ts +241 -0
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.20.0](https://github.com/browserbase/sdk-node/compare/v2.19.1...v2.20.0) (2026-09-09)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **api:** declare the webhooks resource ([d57781b](https://github.com/browserbase/sdk-node/commit/d57781b1fdbff5415c5f49223395e651c571eac2))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Chores
|
|
12
|
+
|
|
13
|
+
* **api:** reset webhooks before release re-land ([bf7ad1e](https://github.com/browserbase/sdk-node/commit/bf7ad1ee100ac2bdd493f11e77f10cc41c7e84f8))
|
|
14
|
+
|
|
3
15
|
## [2.19.1](https://github.com/browserbase/sdk-node/compare/v2.19.0...v2.19.1) (2026-09-03)
|
|
4
16
|
|
|
5
17
|
|
package/index.d.mts
CHANGED
|
@@ -9,6 +9,7 @@ import { Extension, ExtensionCreateParams, Extensions } from "./resources/extens
|
|
|
9
9
|
import { FetchAPI, FetchAPICreateParams, FetchAPICreateResponse } from "./resources/fetch-api.js";
|
|
10
10
|
import { Project, ProjectListResponse, ProjectUsage, Projects } from "./resources/projects.js";
|
|
11
11
|
import { Search, SearchWebParams, SearchWebResponse } from "./resources/search.js";
|
|
12
|
+
import { Webhook, WebhookCreateParams, WebhookCreateResponse, WebhookListParams, WebhookListResponse, WebhookRotateSecretParams, WebhookRotateSecretResponse, WebhookUpdateParams, Webhooks } from "./resources/webhooks.js";
|
|
12
13
|
import { AgentCreateParams, AgentCreateResponse, AgentListParams, AgentListResponse, AgentRetrieveResponse, AgentUpdateParams, AgentUpdateResponse, Agents } from "./resources/agents/agents.js";
|
|
13
14
|
import { Session, SessionCreateParams, SessionCreateResponse, SessionDebugParams, SessionListParams, SessionListResponse, SessionLiveURLs, SessionRetrieveResponse, SessionUpdateParams, Sessions } from "./resources/sessions/sessions.js";
|
|
14
15
|
export interface ClientOptions {
|
|
@@ -98,6 +99,7 @@ export declare class Browserbase extends Core.APIClient {
|
|
|
98
99
|
search: API.Search;
|
|
99
100
|
sessions: API.Sessions;
|
|
100
101
|
agents: API.Agents;
|
|
102
|
+
webhooks: API.Webhooks;
|
|
101
103
|
protected defaultQuery(): Core.DefaultQuery | undefined;
|
|
102
104
|
protected defaultHeaders(opts: Core.FinalRequestOptions): Core.Headers;
|
|
103
105
|
protected authHeaders(opts: Core.FinalRequestOptions): Core.Headers;
|
|
@@ -129,6 +131,7 @@ export declare namespace Browserbase {
|
|
|
129
131
|
export { Search as Search, type SearchWebResponse as SearchWebResponse, type SearchWebParams as SearchWebParams, };
|
|
130
132
|
export { Sessions as Sessions, type Session as Session, type SessionLiveURLs as SessionLiveURLs, type SessionCreateResponse as SessionCreateResponse, type SessionRetrieveResponse as SessionRetrieveResponse, type SessionListResponse as SessionListResponse, type SessionCreateParams as SessionCreateParams, type SessionUpdateParams as SessionUpdateParams, type SessionListParams as SessionListParams, type SessionDebugParams as SessionDebugParams, };
|
|
131
133
|
export { Agents as Agents, type AgentCreateResponse as AgentCreateResponse, type AgentRetrieveResponse as AgentRetrieveResponse, type AgentUpdateResponse as AgentUpdateResponse, type AgentListResponse as AgentListResponse, type AgentCreateParams as AgentCreateParams, type AgentUpdateParams as AgentUpdateParams, type AgentListParams as AgentListParams, };
|
|
134
|
+
export { Webhooks as Webhooks, type Webhook as Webhook, type WebhookCreateResponse as WebhookCreateResponse, type WebhookListResponse as WebhookListResponse, type WebhookRotateSecretResponse as WebhookRotateSecretResponse, type WebhookCreateParams as WebhookCreateParams, type WebhookUpdateParams as WebhookUpdateParams, type WebhookListParams as WebhookListParams, type WebhookRotateSecretParams as WebhookRotateSecretParams, };
|
|
132
135
|
}
|
|
133
136
|
export { toFile, fileFromPath } from "./uploads.js";
|
|
134
137
|
export { BrowserbaseError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./error.js";
|
package/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { Extension, ExtensionCreateParams, Extensions } from "./resources/extens
|
|
|
9
9
|
import { FetchAPI, FetchAPICreateParams, FetchAPICreateResponse } from "./resources/fetch-api.js";
|
|
10
10
|
import { Project, ProjectListResponse, ProjectUsage, Projects } from "./resources/projects.js";
|
|
11
11
|
import { Search, SearchWebParams, SearchWebResponse } from "./resources/search.js";
|
|
12
|
+
import { Webhook, WebhookCreateParams, WebhookCreateResponse, WebhookListParams, WebhookListResponse, WebhookRotateSecretParams, WebhookRotateSecretResponse, WebhookUpdateParams, Webhooks } from "./resources/webhooks.js";
|
|
12
13
|
import { AgentCreateParams, AgentCreateResponse, AgentListParams, AgentListResponse, AgentRetrieveResponse, AgentUpdateParams, AgentUpdateResponse, Agents } from "./resources/agents/agents.js";
|
|
13
14
|
import { Session, SessionCreateParams, SessionCreateResponse, SessionDebugParams, SessionListParams, SessionListResponse, SessionLiveURLs, SessionRetrieveResponse, SessionUpdateParams, Sessions } from "./resources/sessions/sessions.js";
|
|
14
15
|
export interface ClientOptions {
|
|
@@ -98,6 +99,7 @@ export declare class Browserbase extends Core.APIClient {
|
|
|
98
99
|
search: API.Search;
|
|
99
100
|
sessions: API.Sessions;
|
|
100
101
|
agents: API.Agents;
|
|
102
|
+
webhooks: API.Webhooks;
|
|
101
103
|
protected defaultQuery(): Core.DefaultQuery | undefined;
|
|
102
104
|
protected defaultHeaders(opts: Core.FinalRequestOptions): Core.Headers;
|
|
103
105
|
protected authHeaders(opts: Core.FinalRequestOptions): Core.Headers;
|
|
@@ -129,6 +131,7 @@ export declare namespace Browserbase {
|
|
|
129
131
|
export { Search as Search, type SearchWebResponse as SearchWebResponse, type SearchWebParams as SearchWebParams, };
|
|
130
132
|
export { Sessions as Sessions, type Session as Session, type SessionLiveURLs as SessionLiveURLs, type SessionCreateResponse as SessionCreateResponse, type SessionRetrieveResponse as SessionRetrieveResponse, type SessionListResponse as SessionListResponse, type SessionCreateParams as SessionCreateParams, type SessionUpdateParams as SessionUpdateParams, type SessionListParams as SessionListParams, type SessionDebugParams as SessionDebugParams, };
|
|
131
133
|
export { Agents as Agents, type AgentCreateResponse as AgentCreateResponse, type AgentRetrieveResponse as AgentRetrieveResponse, type AgentUpdateResponse as AgentUpdateResponse, type AgentListResponse as AgentListResponse, type AgentCreateParams as AgentCreateParams, type AgentUpdateParams as AgentUpdateParams, type AgentListParams as AgentListParams, };
|
|
134
|
+
export { Webhooks as Webhooks, type Webhook as Webhook, type WebhookCreateResponse as WebhookCreateResponse, type WebhookListResponse as WebhookListResponse, type WebhookRotateSecretResponse as WebhookRotateSecretResponse, type WebhookCreateParams as WebhookCreateParams, type WebhookUpdateParams as WebhookUpdateParams, type WebhookListParams as WebhookListParams, type WebhookRotateSecretParams as WebhookRotateSecretParams, };
|
|
132
135
|
}
|
|
133
136
|
export { toFile, fileFromPath } from "./uploads.js";
|
|
134
137
|
export { BrowserbaseError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./error.js";
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,SAAS,CAAC;AAClC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAC;AACzC,OAAO,EACL,WAAW,EACX,uBAAuB,EACvB,uBAAuB,EACvB,YAAY,EACb,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,OAAO,EACP,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,QAAQ,EACT,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/F,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC5F,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACnB,MAAM,EACP,MAAM,2BAA2B,CAAC;AACnC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C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,eAAe,IAAI,eAAe,GACxC,CAAC;IAEF,OAAO,EACL,QAAQ,IAAI,QAAQ,EACpB,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,yBAAyB,IAAI,yBAAyB,GAC5D,CAAC;CACH;AAED,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EACL,gBAAgB,EAChB,QAAQ,EACR,kBAAkB,EAClB,yBAAyB,EACzB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,SAAS,CAAC;AAEjB,eAAe,WAAW,CAAC"}
|
package/index.js
CHANGED
|
@@ -46,6 +46,7 @@ const extensions_1 = require("./resources/extensions.js");
|
|
|
46
46
|
const fetch_api_1 = require("./resources/fetch-api.js");
|
|
47
47
|
const projects_1 = require("./resources/projects.js");
|
|
48
48
|
const search_1 = require("./resources/search.js");
|
|
49
|
+
const webhooks_1 = require("./resources/webhooks.js");
|
|
49
50
|
const agents_1 = require("./resources/agents/agents.js");
|
|
50
51
|
const sessions_1 = require("./resources/sessions/sessions.js");
|
|
51
52
|
/**
|
|
@@ -90,6 +91,7 @@ class Browserbase extends Core.APIClient {
|
|
|
90
91
|
this.search = new API.Search(this);
|
|
91
92
|
this.sessions = new API.Sessions(this);
|
|
92
93
|
this.agents = new API.Agents(this);
|
|
94
|
+
this.webhooks = new API.Webhooks(this);
|
|
93
95
|
const customHeadersEnv = Core.readEnv('BROWSERBASE_CUSTOM_HEADERS');
|
|
94
96
|
if (customHeadersEnv) {
|
|
95
97
|
const parsed = {};
|
|
@@ -146,6 +148,7 @@ Browserbase.Projects = projects_1.Projects;
|
|
|
146
148
|
Browserbase.Search = search_1.Search;
|
|
147
149
|
Browserbase.Sessions = sessions_1.Sessions;
|
|
148
150
|
Browserbase.Agents = agents_1.Agents;
|
|
151
|
+
Browserbase.Webhooks = webhooks_1.Webhooks;
|
|
149
152
|
var uploads_1 = require("./uploads.js");
|
|
150
153
|
Object.defineProperty(exports, "toFile", { enumerable: true, get: function () { return uploads_1.toFile; } });
|
|
151
154
|
Object.defineProperty(exports, "fileFromPath", { enumerable: true, get: function () { return uploads_1.fileFromPath; } });
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGtF,gDAA+B;AAC/B,mDAAkC;AAClC,sDAAqC;AACrC,0DAAyC;AACzC,8DAKkC;AAClC,sDAM8B;AAC9B,0DAAsF;AACtF,wDAA+F;AAC/F,sDAA4F;AAC5F,kDAAgF;AAChF,yDASmC;AACnC,+DAWuC;AAqEvC;;GAEG;AACH,MAAa,WAAY,SAAQ,IAAI,CAAC,SAAS;IAK7C;;;;;;;;;;;OAWG;IACH,YAAY,EACV,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,EAC9C,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,EAC5C,GAAG,IAAI,KACU,EAAE;QACnB,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,MAAM,IAAI,MAAM,CAAC,gBAAgB,CAC/B,mMAAmM,CACpM,CAAC;QACJ,CAAC;QAED,MAAM,OAAO,GAAkB;YAC7B,MAAM;YACN,GAAG,IAAI;YACP,OAAO,EAAE,OAAO,IAAI,6BAA6B;SACl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AAG,eAAM,CAAC;AAC5B,WAAW,CAAC,QAAQ,GAAG,mBAAQ,CAAC;AAChC,WAAW,CAAC,MAAM,GAAG,eAAM,CAAC;AAC5B,WAAW,CAAC,QAAQ,GAAG,mBAAQ,CAAC;AAkFhC,wCAAiD;AAAxC,iGAAA,MAAM,OAAA;AAAE,uGAAA,YAAY,OAAA;AAC7B,oCAciB;AAbf,yGAAA,gBAAgB,OAAA;AAChB,iGAAA,QAAQ,OAAA;AACR,2GAAA,kBAAkB,OAAA;AAClB,kHAAA,yBAAyB,OAAA;AACzB,0GAAA,iBAAiB,OAAA;AACjB,sGAAA,aAAa,OAAA;AACb,sGAAA,aAAa,OAAA;AACb,uGAAA,cAAc,OAAA;AACd,wGAAA,eAAe,OAAA;AACf,4GAAA,mBAAmB,OAAA;AACnB,4GAAA,mBAAmB,OAAA;AACnB,8GAAA,qBAAqB,OAAA;AACrB,iHAAA,wBAAwB,OAAA;AAG1B,kBAAe,WAAW,CAAC"}
|
package/index.mjs
CHANGED
|
@@ -10,6 +10,7 @@ import { Extensions } from "./resources/extensions.mjs";
|
|
|
10
10
|
import { FetchAPI } from "./resources/fetch-api.mjs";
|
|
11
11
|
import { Projects } from "./resources/projects.mjs";
|
|
12
12
|
import { Search } from "./resources/search.mjs";
|
|
13
|
+
import { Webhooks, } from "./resources/webhooks.mjs";
|
|
13
14
|
import { Agents, } from "./resources/agents/agents.mjs";
|
|
14
15
|
import { Sessions, } from "./resources/sessions/sessions.mjs";
|
|
15
16
|
/**
|
|
@@ -54,6 +55,7 @@ export class Browserbase extends Core.APIClient {
|
|
|
54
55
|
this.search = new API.Search(this);
|
|
55
56
|
this.sessions = new API.Sessions(this);
|
|
56
57
|
this.agents = new API.Agents(this);
|
|
58
|
+
this.webhooks = new API.Webhooks(this);
|
|
57
59
|
const customHeadersEnv = Core.readEnv('BROWSERBASE_CUSTOM_HEADERS');
|
|
58
60
|
if (customHeadersEnv) {
|
|
59
61
|
const parsed = {};
|
|
@@ -109,6 +111,7 @@ Browserbase.Projects = Projects;
|
|
|
109
111
|
Browserbase.Search = Search;
|
|
110
112
|
Browserbase.Sessions = Sessions;
|
|
111
113
|
Browserbase.Agents = Agents;
|
|
114
|
+
Browserbase.Webhooks = Webhooks;
|
|
112
115
|
export { toFile, fileFromPath } from "./uploads.mjs";
|
|
113
116
|
export { BrowserbaseError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./error.mjs";
|
|
114
117
|
export default Browserbase;
|
package/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;;OAG/E,KAAK,IAAI;OACT,KAAK,MAAM;OACX,KAAK,OAAO;OACZ,KAAK,GAAG;OACR,EAIL,YAAY,GACb;OACM,EAKL,QAAQ,GACT;OACM,EAAoC,UAAU,EAAE;OAChD,EAAE,QAAQ,EAAgD;OAC1D,EAA8C,QAAQ,EAAE;OACxD,EAAE,MAAM,EAAsC;OAC9C,EAQL,MAAM,GACP;OACM,EAUL,QAAQ,GACT;AAqED;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,IAAI,CAAC,SAAS;IAK7C;;;;;;;;;;;OAWG;IACH,YAAY,EACV,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,EAC9C,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,EAC5C,GAAG,IAAI,KACU,EAAE;QACnB,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,MAAM,IAAI,MAAM,CAAC,gBAAgB,CAC/B,mMAAmM,CACpM,CAAC;QACJ,CAAC;QAED,MAAM,OAAO,GAAkB;YAC7B,MAAM;YACN,GAAG,IAAI;YACP,OAAO,EAAE,OAAO,IAAI,6BAA6B;SAClD,CAAC;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AC;AAChC,WAAW,CAAC,MAAM,GAAG,MAAM,CAAC;AAC5B,WAAW,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAChC,WAAW,CAAC,MAAM,GAAG,MAAM,CAAC;AAC5B,WAAW,CAAC,QAAQ,GAAG,QAAQ,CAAC;OAkFzB,EAAE,MAAM,EAAE,YAAY,EAAE;OACxB,EACL,gBAAgB,EAChB,QAAQ,EACR,kBAAkB,EAClB,yBAAyB,EACzB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,GACzB;AAED,eAAe,WAAW,CAAC"}
|
package/package.json
CHANGED
package/resources/index.d.ts
CHANGED
|
@@ -6,4 +6,5 @@ export { FetchAPI, type FetchAPICreateResponse, type FetchAPICreateParams } from
|
|
|
6
6
|
export { Projects, type Project, type ProjectUsage, type ProjectListResponse } from "./projects.js";
|
|
7
7
|
export { Search, type SearchWebResponse, type SearchWebParams } from "./search.js";
|
|
8
8
|
export { Sessions, type Session, type SessionLiveURLs, type SessionCreateResponse, type SessionRetrieveResponse, type SessionListResponse, type SessionCreateParams, type SessionUpdateParams, type SessionListParams, type SessionDebugParams, } from "./sessions/sessions.js";
|
|
9
|
+
export { Webhooks, type Webhook, type WebhookCreateResponse, type WebhookListResponse, type WebhookRotateSecretResponse, type WebhookCreateParams, type WebhookUpdateParams, type WebhookListParams, type WebhookRotateSecretParams, } from "./webhooks.js";
|
|
9
10
|
//# sourceMappingURL=index.d.ts.map
|
package/resources/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,MAAM,EACN,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACt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,GAC7B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,QAAQ,EACR,KAAK,OAAO,EACZ,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,GACzB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACtF,OAAO,EAAE,QAAQ,EAAE,KAAK,sBAAsB,EAAE,KAAK,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAC/F,OAAO,EAAE,QAAQ,EAAE,KAAK,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjG,OAAO,EAAE,MAAM,EAAE,KAAK,iBAAiB,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAChF,OAAO,EACL,QAAQ,EACR,KAAK,OAAO,EACZ,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,GACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,QAAQ,EACR,KAAK,OAAO,EACZ,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAChC,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,GAC/B,MAAM,YAAY,CAAC"}
|
package/resources/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Sessions = exports.Search = exports.Projects = exports.FetchAPI = exports.Extensions = exports.Contexts = exports.Certificates = exports.Agents = void 0;
|
|
4
|
+
exports.Webhooks = exports.Sessions = exports.Search = exports.Projects = exports.FetchAPI = exports.Extensions = exports.Contexts = exports.Certificates = exports.Agents = void 0;
|
|
5
5
|
var agents_1 = require("./agents/agents.js");
|
|
6
6
|
Object.defineProperty(exports, "Agents", { enumerable: true, get: function () { return agents_1.Agents; } });
|
|
7
7
|
var certificates_1 = require("./certificates.js");
|
|
@@ -18,4 +18,6 @@ var search_1 = require("./search.js");
|
|
|
18
18
|
Object.defineProperty(exports, "Search", { enumerable: true, get: function () { return search_1.Search; } });
|
|
19
19
|
var sessions_1 = require("./sessions/sessions.js");
|
|
20
20
|
Object.defineProperty(exports, "Sessions", { enumerable: true, get: function () { return sessions_1.Sessions; } });
|
|
21
|
+
var webhooks_1 = require("./webhooks.js");
|
|
22
|
+
Object.defineProperty(exports, "Webhooks", { enumerable: true, get: function () { return webhooks_1.Webhooks; } });
|
|
21
23
|
//# sourceMappingURL=index.js.map
|
package/resources/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CASyB;AARvB,gGAAA,MAAM,OAAA;AASR,kDAKwB;AAJtB,4GAAA,YAAY,OAAA;AAKd,0CAMoB;AALlB,oGAAA,QAAQ,OAAA;AAMV,8CAAsF;AAA7E,wGAAA,UAAU,OAAA;AACnB,4CAA+F;AAAtF,qGAAA,QAAQ,OAAA;AACjB,0CAAiG;AAAxF,oGAAA,QAAQ,OAAA;AACjB,sCAAgF;AAAvE,gGAAA,MAAM,OAAA;AACf,mDAW6B;AAV3B,oGAAA,QAAQ,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CASyB;AARvB,gGAAA,MAAM,OAAA;AASR,kDAKwB;AAJtB,4GAAA,YAAY,OAAA;AAKd,0CAMoB;AALlB,oGAAA,QAAQ,OAAA;AAMV,8CAAsF;AAA7E,wGAAA,UAAU,OAAA;AACnB,4CAA+F;AAAtF,qGAAA,QAAQ,OAAA;AACjB,0CAAiG;AAAxF,oGAAA,QAAQ,OAAA;AACjB,sCAAgF;AAAvE,gGAAA,MAAM,OAAA;AACf,mDAW6B;AAV3B,oGAAA,QAAQ,OAAA;AAWV,0CAUoB;AATlB,oGAAA,QAAQ,OAAA"}
|
package/resources/index.mjs
CHANGED
package/resources/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,MAAM,GAQP;OACM,EACL,YAAY,GAIb;OACM,EACL,QAAQ,GAKT;OACM,EAAE,UAAU,EAA8C;OAC1D,EAAE,QAAQ,EAA0D;OACpE,EAAE,QAAQ,EAA6D;OACvE,EAAE,MAAM,EAAgD;OACxD,EACL,QAAQ,GAUT"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,MAAM,GAQP;OACM,EACL,YAAY,GAIb;OACM,EACL,QAAQ,GAKT;OACM,EAAE,UAAU,EAA8C;OAC1D,EAAE,QAAQ,EAA0D;OACpE,EAAE,QAAQ,EAA6D;OACvE,EAAE,MAAM,EAAgD;OACxD,EACL,QAAQ,GAUT;OACM,EACL,QAAQ,GAST"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { APIResource } from "../resource.js";
|
|
2
|
+
import * as Core from "../core.js";
|
|
3
|
+
export declare class Webhooks extends APIResource {
|
|
4
|
+
/**
|
|
5
|
+
* Register an HTTPS endpoint to receive events for this project. The response
|
|
6
|
+
* includes the signing secret, which is shown only here and when the secret is
|
|
7
|
+
* rotated. Store it before discarding the response. An endpoint may only be
|
|
8
|
+
* registered once per project.
|
|
9
|
+
*/
|
|
10
|
+
create(body: WebhookCreateParams, options?: Core.RequestOptions): Core.APIPromise<WebhookCreateResponse>;
|
|
11
|
+
/**
|
|
12
|
+
* Retrieve a single webhook by ID. The signing secret is not included; it is only
|
|
13
|
+
* ever returned on create and rotate.
|
|
14
|
+
*/
|
|
15
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<Webhook>;
|
|
16
|
+
/**
|
|
17
|
+
* Update a webhook's endpoint URL, its subscribed event types, or both. Omitted
|
|
18
|
+
* fields are left unchanged. `eventTypes` replaces the existing subscription
|
|
19
|
+
* rather than adding to it. The signing secret is unaffected.
|
|
20
|
+
*/
|
|
21
|
+
update(id: string, body: WebhookUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Webhook>;
|
|
22
|
+
/**
|
|
23
|
+
* List the project's webhooks, newest first. Signing secrets are not included.
|
|
24
|
+
* Page by passing the previous response's `nextCursor` as `cursor`; a null
|
|
25
|
+
* `nextCursor` means there are no further pages.
|
|
26
|
+
*/
|
|
27
|
+
list(query?: WebhookListParams, options?: Core.RequestOptions): Core.APIPromise<WebhookListResponse>;
|
|
28
|
+
list(options?: Core.RequestOptions): Core.APIPromise<WebhookListResponse>;
|
|
29
|
+
/**
|
|
30
|
+
* Delete a webhook. Deliveries stop immediately and the signing secret is retired.
|
|
31
|
+
* Events that occurred before the delete are not replayed if the endpoint is
|
|
32
|
+
* registered again.
|
|
33
|
+
*/
|
|
34
|
+
delete(id: string, options?: Core.RequestOptions): Core.APIPromise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Issue a new signing secret for a webhook. By default the previous secret keeps
|
|
37
|
+
* verifying for 24 hours so a receiver can be updated without dropping deliveries;
|
|
38
|
+
* pass `revokeImmediately` to end that window at once. The new secret is returned
|
|
39
|
+
* only here.
|
|
40
|
+
*/
|
|
41
|
+
rotateSecret(id: string, body?: WebhookRotateSecretParams, options?: Core.RequestOptions): Core.APIPromise<WebhookRotateSecretResponse>;
|
|
42
|
+
rotateSecret(id: string, options?: Core.RequestOptions): Core.APIPromise<WebhookRotateSecretResponse>;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* A delivery endpoint for a project. Browserbase POSTs a signed event to it
|
|
46
|
+
* whenever one of its subscribed event types occurs. The signing secret is
|
|
47
|
+
* returned only when it is created or rotated.
|
|
48
|
+
*/
|
|
49
|
+
export interface Webhook {
|
|
50
|
+
/**
|
|
51
|
+
* Unique identifier for the webhook.
|
|
52
|
+
*/
|
|
53
|
+
id: string;
|
|
54
|
+
createdAt: string;
|
|
55
|
+
/**
|
|
56
|
+
* HTTPS URL that event deliveries are POSTed to. Must be publicly reachable.
|
|
57
|
+
*/
|
|
58
|
+
endpoint: string;
|
|
59
|
+
/**
|
|
60
|
+
* Event types this webhook subscribes to. Unknown types are rejected.
|
|
61
|
+
*/
|
|
62
|
+
eventTypes: Array<'functions.builds.running' | 'functions.builds.completed' | 'functions.builds.failed' | 'functions.invocations.pending' | 'functions.invocations.running' | 'functions.invocations.completed' | 'functions.invocations.failed'>;
|
|
63
|
+
/**
|
|
64
|
+
* The project the webhook belongs to.
|
|
65
|
+
*/
|
|
66
|
+
projectId: string;
|
|
67
|
+
updatedAt: string;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* The created webhook, including its signing secret.
|
|
71
|
+
*/
|
|
72
|
+
export interface WebhookCreateResponse extends Webhook {
|
|
73
|
+
/**
|
|
74
|
+
* HMAC-SHA256 signing secret, prefixed `whsec_`. Shown once here; store it now.
|
|
75
|
+
* Use it to verify the signature on every delivery.
|
|
76
|
+
*/
|
|
77
|
+
secret: string;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* A page of webhooks. Signing secrets are not included.
|
|
81
|
+
*/
|
|
82
|
+
export interface WebhookListResponse {
|
|
83
|
+
/**
|
|
84
|
+
* The page of webhooks, newest first.
|
|
85
|
+
*/
|
|
86
|
+
data: Array<Webhook>;
|
|
87
|
+
/**
|
|
88
|
+
* The maximum number of results returned in this page.
|
|
89
|
+
*/
|
|
90
|
+
limit: number;
|
|
91
|
+
/**
|
|
92
|
+
* Cursor for the next page. Pass it back as `cursor` to continue paging. null when
|
|
93
|
+
* there are no more results.
|
|
94
|
+
*/
|
|
95
|
+
nextCursor: string | null;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* The new signing secret. Shown once; store it now.
|
|
99
|
+
*/
|
|
100
|
+
export interface WebhookRotateSecretResponse {
|
|
101
|
+
/**
|
|
102
|
+
* The new signing secret, prefixed `whsec_`.
|
|
103
|
+
*/
|
|
104
|
+
secret: string;
|
|
105
|
+
}
|
|
106
|
+
export interface WebhookCreateParams {
|
|
107
|
+
/**
|
|
108
|
+
* HTTPS URL that event deliveries are POSTed to. Must be publicly reachable.
|
|
109
|
+
*/
|
|
110
|
+
endpoint: string;
|
|
111
|
+
/**
|
|
112
|
+
* Event types this webhook subscribes to. Unknown types are rejected.
|
|
113
|
+
*/
|
|
114
|
+
eventTypes: Array<'functions.builds.running' | 'functions.builds.completed' | 'functions.builds.failed' | 'functions.invocations.pending' | 'functions.invocations.running' | 'functions.invocations.completed' | 'functions.invocations.failed'>;
|
|
115
|
+
}
|
|
116
|
+
export interface WebhookUpdateParams {
|
|
117
|
+
/**
|
|
118
|
+
* HTTPS URL that event deliveries are POSTed to. Must be publicly reachable.
|
|
119
|
+
*/
|
|
120
|
+
endpoint?: string;
|
|
121
|
+
/**
|
|
122
|
+
* Event types this webhook subscribes to. Unknown types are rejected.
|
|
123
|
+
*/
|
|
124
|
+
eventTypes?: Array<'functions.builds.running' | 'functions.builds.completed' | 'functions.builds.failed' | 'functions.invocations.pending' | 'functions.invocations.running' | 'functions.invocations.completed' | 'functions.invocations.failed'>;
|
|
125
|
+
}
|
|
126
|
+
export interface WebhookListParams {
|
|
127
|
+
/**
|
|
128
|
+
* Cursor from a previous response's `nextCursor`. Omit for the first page.
|
|
129
|
+
*/
|
|
130
|
+
cursor?: string;
|
|
131
|
+
/**
|
|
132
|
+
* Maximum number of results to return.
|
|
133
|
+
*/
|
|
134
|
+
limit?: number;
|
|
135
|
+
}
|
|
136
|
+
export interface WebhookRotateSecretParams {
|
|
137
|
+
/**
|
|
138
|
+
* Expire the old secret at once instead of honouring it for 24 hours. Use when
|
|
139
|
+
* responding to a leak; deliveries signed with the old secret stop verifying
|
|
140
|
+
* immediately.
|
|
141
|
+
*/
|
|
142
|
+
revokeImmediately?: boolean;
|
|
143
|
+
}
|
|
144
|
+
export declare namespace Webhooks {
|
|
145
|
+
export { type Webhook as Webhook, type WebhookCreateResponse as WebhookCreateResponse, type WebhookListResponse as WebhookListResponse, type WebhookRotateSecretResponse as WebhookRotateSecretResponse, type WebhookCreateParams as WebhookCreateParams, type WebhookUpdateParams as WebhookUpdateParams, type WebhookListParams as WebhookListParams, type WebhookRotateSecretParams as WebhookRotateSecretParams, };
|
|
146
|
+
}
|
|
147
|
+
//# sourceMappingURL=webhooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../src/resources/webhooks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAEhC,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;OAKG;IACH,MAAM,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,qBAAqB,CAAC;IAIxG;;;OAGG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;IAI7E;;;;OAIG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,C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,yBAAyB,GAC5D,CAAC;CACH"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Webhooks = void 0;
|
|
5
|
+
const resource_1 = require("../resource.js");
|
|
6
|
+
const core_1 = require("../core.js");
|
|
7
|
+
class Webhooks extends resource_1.APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Register an HTTPS endpoint to receive events for this project. The response
|
|
10
|
+
* includes the signing secret, which is shown only here and when the secret is
|
|
11
|
+
* rotated. Store it before discarding the response. An endpoint may only be
|
|
12
|
+
* registered once per project.
|
|
13
|
+
*/
|
|
14
|
+
create(body, options) {
|
|
15
|
+
return this._client.post('/v1/webhooks', { body, ...options });
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Retrieve a single webhook by ID. The signing secret is not included; it is only
|
|
19
|
+
* ever returned on create and rotate.
|
|
20
|
+
*/
|
|
21
|
+
retrieve(id, options) {
|
|
22
|
+
return this._client.get(`/v1/webhooks/${id}`, options);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Update a webhook's endpoint URL, its subscribed event types, or both. Omitted
|
|
26
|
+
* fields are left unchanged. `eventTypes` replaces the existing subscription
|
|
27
|
+
* rather than adding to it. The signing secret is unaffected.
|
|
28
|
+
*/
|
|
29
|
+
update(id, body, options) {
|
|
30
|
+
return this._client.patch(`/v1/webhooks/${id}`, { body, ...options });
|
|
31
|
+
}
|
|
32
|
+
list(query = {}, options) {
|
|
33
|
+
if ((0, core_1.isRequestOptions)(query)) {
|
|
34
|
+
return this.list({}, query);
|
|
35
|
+
}
|
|
36
|
+
return this._client.get('/v1/webhooks', { query, ...options });
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Delete a webhook. Deliveries stop immediately and the signing secret is retired.
|
|
40
|
+
* Events that occurred before the delete are not replayed if the endpoint is
|
|
41
|
+
* registered again.
|
|
42
|
+
*/
|
|
43
|
+
delete(id, options) {
|
|
44
|
+
return this._client.delete(`/v1/webhooks/${id}`, {
|
|
45
|
+
...options,
|
|
46
|
+
headers: { Accept: '*/*', ...options?.headers },
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
rotateSecret(id, body = {}, options) {
|
|
50
|
+
if ((0, core_1.isRequestOptions)(body)) {
|
|
51
|
+
return this.rotateSecret(id, {}, body);
|
|
52
|
+
}
|
|
53
|
+
return this._client.post(`/v1/webhooks/${id}/secret`, { body, ...options });
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.Webhooks = Webhooks;
|
|
57
|
+
//# sourceMappingURL=webhooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../src/resources/webhooks.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;AAC1C,qCAA2C;AAG3C,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;;OAKG;IACH,MAAM,CAAC,IAAyB,EAAE,OAA6B;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;IAED;;;OAGG;IACH,QAAQ,CAAC,EAAU,EAAE,OAA6B;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,EAAU,EAAE,IAAyB,EAAE,OAA6B;QACzE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,gBAAgB,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC;IASD,IAAI,CACF,QAAiD,EAAE,EACnD,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,KAAK,CAAC,EAAE,CAAC;YAC5B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QAC9B,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,EAAU,EAAE,OAA6B;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,EAAE,EAAE;YAC/C,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;IAcD,YAAY,CACV,EAAU,EACV,OAAwD,EAAE,EAC1D,OAA6B;QAE7B,IAAI,IAAA,uBAAgB,EAAC,IAAI,CAAC,EAAE,CAAC;YAC3B,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;QACzC,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9E,CAAC;CACF;AA/ED,4BA+EC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../resource.mjs";
|
|
3
|
+
import { isRequestOptions } from "../core.mjs";
|
|
4
|
+
export class Webhooks extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Register an HTTPS endpoint to receive events for this project. The response
|
|
7
|
+
* includes the signing secret, which is shown only here and when the secret is
|
|
8
|
+
* rotated. Store it before discarding the response. An endpoint may only be
|
|
9
|
+
* registered once per project.
|
|
10
|
+
*/
|
|
11
|
+
create(body, options) {
|
|
12
|
+
return this._client.post('/v1/webhooks', { body, ...options });
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Retrieve a single webhook by ID. The signing secret is not included; it is only
|
|
16
|
+
* ever returned on create and rotate.
|
|
17
|
+
*/
|
|
18
|
+
retrieve(id, options) {
|
|
19
|
+
return this._client.get(`/v1/webhooks/${id}`, options);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Update a webhook's endpoint URL, its subscribed event types, or both. Omitted
|
|
23
|
+
* fields are left unchanged. `eventTypes` replaces the existing subscription
|
|
24
|
+
* rather than adding to it. The signing secret is unaffected.
|
|
25
|
+
*/
|
|
26
|
+
update(id, body, options) {
|
|
27
|
+
return this._client.patch(`/v1/webhooks/${id}`, { body, ...options });
|
|
28
|
+
}
|
|
29
|
+
list(query = {}, options) {
|
|
30
|
+
if (isRequestOptions(query)) {
|
|
31
|
+
return this.list({}, query);
|
|
32
|
+
}
|
|
33
|
+
return this._client.get('/v1/webhooks', { query, ...options });
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Delete a webhook. Deliveries stop immediately and the signing secret is retired.
|
|
37
|
+
* Events that occurred before the delete are not replayed if the endpoint is
|
|
38
|
+
* registered again.
|
|
39
|
+
*/
|
|
40
|
+
delete(id, options) {
|
|
41
|
+
return this._client.delete(`/v1/webhooks/${id}`, {
|
|
42
|
+
...options,
|
|
43
|
+
headers: { Accept: '*/*', ...options?.headers },
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
rotateSecret(id, body = {}, options) {
|
|
47
|
+
if (isRequestOptions(body)) {
|
|
48
|
+
return this.rotateSecret(id, {}, body);
|
|
49
|
+
}
|
|
50
|
+
return this._client.post(`/v1/webhooks/${id}/secret`, { body, ...options });
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=webhooks.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhooks.mjs","source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,CACV,EAAU,EACV,OAAwD,EAAE,EAC1D,OAA6B;QAE7B,IAAI,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3B,OAAO,IAAI,CAAC,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;QACzC,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9E,CAAC;CACF"}
|
package/src/index.ts
CHANGED
|
@@ -22,6 +22,17 @@ import { Extension, ExtensionCreateParams, Extensions } from './resources/extens
|
|
|
22
22
|
import { FetchAPI, FetchAPICreateParams, FetchAPICreateResponse } from './resources/fetch-api';
|
|
23
23
|
import { Project, ProjectListResponse, ProjectUsage, Projects } from './resources/projects';
|
|
24
24
|
import { Search, SearchWebParams, SearchWebResponse } from './resources/search';
|
|
25
|
+
import {
|
|
26
|
+
Webhook,
|
|
27
|
+
WebhookCreateParams,
|
|
28
|
+
WebhookCreateResponse,
|
|
29
|
+
WebhookListParams,
|
|
30
|
+
WebhookListResponse,
|
|
31
|
+
WebhookRotateSecretParams,
|
|
32
|
+
WebhookRotateSecretResponse,
|
|
33
|
+
WebhookUpdateParams,
|
|
34
|
+
Webhooks,
|
|
35
|
+
} from './resources/webhooks';
|
|
25
36
|
import {
|
|
26
37
|
AgentCreateParams,
|
|
27
38
|
AgentCreateResponse,
|
|
@@ -183,6 +194,7 @@ export class Browserbase extends Core.APIClient {
|
|
|
183
194
|
search: API.Search = new API.Search(this);
|
|
184
195
|
sessions: API.Sessions = new API.Sessions(this);
|
|
185
196
|
agents: API.Agents = new API.Agents(this);
|
|
197
|
+
webhooks: API.Webhooks = new API.Webhooks(this);
|
|
186
198
|
|
|
187
199
|
/**
|
|
188
200
|
* Check whether the base URL is set to its default.
|
|
@@ -235,6 +247,7 @@ Browserbase.Projects = Projects;
|
|
|
235
247
|
Browserbase.Search = Search;
|
|
236
248
|
Browserbase.Sessions = Sessions;
|
|
237
249
|
Browserbase.Agents = Agents;
|
|
250
|
+
Browserbase.Webhooks = Webhooks;
|
|
238
251
|
|
|
239
252
|
export declare namespace Browserbase {
|
|
240
253
|
export type RequestOptions = Core.RequestOptions;
|
|
@@ -302,6 +315,18 @@ export declare namespace Browserbase {
|
|
|
302
315
|
type AgentUpdateParams as AgentUpdateParams,
|
|
303
316
|
type AgentListParams as AgentListParams,
|
|
304
317
|
};
|
|
318
|
+
|
|
319
|
+
export {
|
|
320
|
+
Webhooks as Webhooks,
|
|
321
|
+
type Webhook as Webhook,
|
|
322
|
+
type WebhookCreateResponse as WebhookCreateResponse,
|
|
323
|
+
type WebhookListResponse as WebhookListResponse,
|
|
324
|
+
type WebhookRotateSecretResponse as WebhookRotateSecretResponse,
|
|
325
|
+
type WebhookCreateParams as WebhookCreateParams,
|
|
326
|
+
type WebhookUpdateParams as WebhookUpdateParams,
|
|
327
|
+
type WebhookListParams as WebhookListParams,
|
|
328
|
+
type WebhookRotateSecretParams as WebhookRotateSecretParams,
|
|
329
|
+
};
|
|
305
330
|
}
|
|
306
331
|
|
|
307
332
|
export { toFile, fileFromPath } from './uploads';
|
package/src/resources/index.ts
CHANGED
|
@@ -39,3 +39,14 @@ export {
|
|
|
39
39
|
type SessionListParams,
|
|
40
40
|
type SessionDebugParams,
|
|
41
41
|
} from './sessions/sessions';
|
|
42
|
+
export {
|
|
43
|
+
Webhooks,
|
|
44
|
+
type Webhook,
|
|
45
|
+
type WebhookCreateResponse,
|
|
46
|
+
type WebhookListResponse,
|
|
47
|
+
type WebhookRotateSecretResponse,
|
|
48
|
+
type WebhookCreateParams,
|
|
49
|
+
type WebhookUpdateParams,
|
|
50
|
+
type WebhookListParams,
|
|
51
|
+
type WebhookRotateSecretParams,
|
|
52
|
+
} from './webhooks';
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../resource';
|
|
4
|
+
import { isRequestOptions } from '../core';
|
|
5
|
+
import * as Core from '../core';
|
|
6
|
+
|
|
7
|
+
export class Webhooks extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Register an HTTPS endpoint to receive events for this project. The response
|
|
10
|
+
* includes the signing secret, which is shown only here and when the secret is
|
|
11
|
+
* rotated. Store it before discarding the response. An endpoint may only be
|
|
12
|
+
* registered once per project.
|
|
13
|
+
*/
|
|
14
|
+
create(body: WebhookCreateParams, options?: Core.RequestOptions): Core.APIPromise<WebhookCreateResponse> {
|
|
15
|
+
return this._client.post('/v1/webhooks', { body, ...options });
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Retrieve a single webhook by ID. The signing secret is not included; it is only
|
|
20
|
+
* ever returned on create and rotate.
|
|
21
|
+
*/
|
|
22
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<Webhook> {
|
|
23
|
+
return this._client.get(`/v1/webhooks/${id}`, options);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Update a webhook's endpoint URL, its subscribed event types, or both. Omitted
|
|
28
|
+
* fields are left unchanged. `eventTypes` replaces the existing subscription
|
|
29
|
+
* rather than adding to it. The signing secret is unaffected.
|
|
30
|
+
*/
|
|
31
|
+
update(id: string, body: WebhookUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Webhook> {
|
|
32
|
+
return this._client.patch(`/v1/webhooks/${id}`, { body, ...options });
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* List the project's webhooks, newest first. Signing secrets are not included.
|
|
37
|
+
* Page by passing the previous response's `nextCursor` as `cursor`; a null
|
|
38
|
+
* `nextCursor` means there are no further pages.
|
|
39
|
+
*/
|
|
40
|
+
list(query?: WebhookListParams, options?: Core.RequestOptions): Core.APIPromise<WebhookListResponse>;
|
|
41
|
+
list(options?: Core.RequestOptions): Core.APIPromise<WebhookListResponse>;
|
|
42
|
+
list(
|
|
43
|
+
query: WebhookListParams | Core.RequestOptions = {},
|
|
44
|
+
options?: Core.RequestOptions,
|
|
45
|
+
): Core.APIPromise<WebhookListResponse> {
|
|
46
|
+
if (isRequestOptions(query)) {
|
|
47
|
+
return this.list({}, query);
|
|
48
|
+
}
|
|
49
|
+
return this._client.get('/v1/webhooks', { query, ...options });
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Delete a webhook. Deliveries stop immediately and the signing secret is retired.
|
|
54
|
+
* Events that occurred before the delete are not replayed if the endpoint is
|
|
55
|
+
* registered again.
|
|
56
|
+
*/
|
|
57
|
+
delete(id: string, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
58
|
+
return this._client.delete(`/v1/webhooks/${id}`, {
|
|
59
|
+
...options,
|
|
60
|
+
headers: { Accept: '*/*', ...options?.headers },
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Issue a new signing secret for a webhook. By default the previous secret keeps
|
|
66
|
+
* verifying for 24 hours so a receiver can be updated without dropping deliveries;
|
|
67
|
+
* pass `revokeImmediately` to end that window at once. The new secret is returned
|
|
68
|
+
* only here.
|
|
69
|
+
*/
|
|
70
|
+
rotateSecret(
|
|
71
|
+
id: string,
|
|
72
|
+
body?: WebhookRotateSecretParams,
|
|
73
|
+
options?: Core.RequestOptions,
|
|
74
|
+
): Core.APIPromise<WebhookRotateSecretResponse>;
|
|
75
|
+
rotateSecret(id: string, options?: Core.RequestOptions): Core.APIPromise<WebhookRotateSecretResponse>;
|
|
76
|
+
rotateSecret(
|
|
77
|
+
id: string,
|
|
78
|
+
body: WebhookRotateSecretParams | Core.RequestOptions = {},
|
|
79
|
+
options?: Core.RequestOptions,
|
|
80
|
+
): Core.APIPromise<WebhookRotateSecretResponse> {
|
|
81
|
+
if (isRequestOptions(body)) {
|
|
82
|
+
return this.rotateSecret(id, {}, body);
|
|
83
|
+
}
|
|
84
|
+
return this._client.post(`/v1/webhooks/${id}/secret`, { body, ...options });
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* A delivery endpoint for a project. Browserbase POSTs a signed event to it
|
|
90
|
+
* whenever one of its subscribed event types occurs. The signing secret is
|
|
91
|
+
* returned only when it is created or rotated.
|
|
92
|
+
*/
|
|
93
|
+
export interface Webhook {
|
|
94
|
+
/**
|
|
95
|
+
* Unique identifier for the webhook.
|
|
96
|
+
*/
|
|
97
|
+
id: string;
|
|
98
|
+
|
|
99
|
+
createdAt: string;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* HTTPS URL that event deliveries are POSTed to. Must be publicly reachable.
|
|
103
|
+
*/
|
|
104
|
+
endpoint: string;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Event types this webhook subscribes to. Unknown types are rejected.
|
|
108
|
+
*/
|
|
109
|
+
eventTypes: Array<
|
|
110
|
+
| 'functions.builds.running'
|
|
111
|
+
| 'functions.builds.completed'
|
|
112
|
+
| 'functions.builds.failed'
|
|
113
|
+
| 'functions.invocations.pending'
|
|
114
|
+
| 'functions.invocations.running'
|
|
115
|
+
| 'functions.invocations.completed'
|
|
116
|
+
| 'functions.invocations.failed'
|
|
117
|
+
>;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* The project the webhook belongs to.
|
|
121
|
+
*/
|
|
122
|
+
projectId: string;
|
|
123
|
+
|
|
124
|
+
updatedAt: string;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* The created webhook, including its signing secret.
|
|
129
|
+
*/
|
|
130
|
+
export interface WebhookCreateResponse extends Webhook {
|
|
131
|
+
/**
|
|
132
|
+
* HMAC-SHA256 signing secret, prefixed `whsec_`. Shown once here; store it now.
|
|
133
|
+
* Use it to verify the signature on every delivery.
|
|
134
|
+
*/
|
|
135
|
+
secret: string;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* A page of webhooks. Signing secrets are not included.
|
|
140
|
+
*/
|
|
141
|
+
export interface WebhookListResponse {
|
|
142
|
+
/**
|
|
143
|
+
* The page of webhooks, newest first.
|
|
144
|
+
*/
|
|
145
|
+
data: Array<Webhook>;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* The maximum number of results returned in this page.
|
|
149
|
+
*/
|
|
150
|
+
limit: number;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Cursor for the next page. Pass it back as `cursor` to continue paging. null when
|
|
154
|
+
* there are no more results.
|
|
155
|
+
*/
|
|
156
|
+
nextCursor: string | null;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* The new signing secret. Shown once; store it now.
|
|
161
|
+
*/
|
|
162
|
+
export interface WebhookRotateSecretResponse {
|
|
163
|
+
/**
|
|
164
|
+
* The new signing secret, prefixed `whsec_`.
|
|
165
|
+
*/
|
|
166
|
+
secret: string;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export interface WebhookCreateParams {
|
|
170
|
+
/**
|
|
171
|
+
* HTTPS URL that event deliveries are POSTed to. Must be publicly reachable.
|
|
172
|
+
*/
|
|
173
|
+
endpoint: string;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Event types this webhook subscribes to. Unknown types are rejected.
|
|
177
|
+
*/
|
|
178
|
+
eventTypes: Array<
|
|
179
|
+
| 'functions.builds.running'
|
|
180
|
+
| 'functions.builds.completed'
|
|
181
|
+
| 'functions.builds.failed'
|
|
182
|
+
| 'functions.invocations.pending'
|
|
183
|
+
| 'functions.invocations.running'
|
|
184
|
+
| 'functions.invocations.completed'
|
|
185
|
+
| 'functions.invocations.failed'
|
|
186
|
+
>;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export interface WebhookUpdateParams {
|
|
190
|
+
/**
|
|
191
|
+
* HTTPS URL that event deliveries are POSTed to. Must be publicly reachable.
|
|
192
|
+
*/
|
|
193
|
+
endpoint?: string;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Event types this webhook subscribes to. Unknown types are rejected.
|
|
197
|
+
*/
|
|
198
|
+
eventTypes?: Array<
|
|
199
|
+
| 'functions.builds.running'
|
|
200
|
+
| 'functions.builds.completed'
|
|
201
|
+
| 'functions.builds.failed'
|
|
202
|
+
| 'functions.invocations.pending'
|
|
203
|
+
| 'functions.invocations.running'
|
|
204
|
+
| 'functions.invocations.completed'
|
|
205
|
+
| 'functions.invocations.failed'
|
|
206
|
+
>;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export interface WebhookListParams {
|
|
210
|
+
/**
|
|
211
|
+
* Cursor from a previous response's `nextCursor`. Omit for the first page.
|
|
212
|
+
*/
|
|
213
|
+
cursor?: string;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Maximum number of results to return.
|
|
217
|
+
*/
|
|
218
|
+
limit?: number;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export interface WebhookRotateSecretParams {
|
|
222
|
+
/**
|
|
223
|
+
* Expire the old secret at once instead of honouring it for 24 hours. Use when
|
|
224
|
+
* responding to a leak; deliveries signed with the old secret stop verifying
|
|
225
|
+
* immediately.
|
|
226
|
+
*/
|
|
227
|
+
revokeImmediately?: boolean;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export declare namespace Webhooks {
|
|
231
|
+
export {
|
|
232
|
+
type Webhook as Webhook,
|
|
233
|
+
type WebhookCreateResponse as WebhookCreateResponse,
|
|
234
|
+
type WebhookListResponse as WebhookListResponse,
|
|
235
|
+
type WebhookRotateSecretResponse as WebhookRotateSecretResponse,
|
|
236
|
+
type WebhookCreateParams as WebhookCreateParams,
|
|
237
|
+
type WebhookUpdateParams as WebhookUpdateParams,
|
|
238
|
+
type WebhookListParams as WebhookListParams,
|
|
239
|
+
type WebhookRotateSecretParams as WebhookRotateSecretParams,
|
|
240
|
+
};
|
|
241
|
+
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '2.
|
|
1
|
+
export const VERSION = '2.20.0'; // x-release-please-version
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "2.
|
|
1
|
+
export declare const VERSION = "2.20.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '2.
|
|
1
|
+
export const VERSION = '2.20.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|