anchorbrowser 0.8.0 → 0.8.1
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 +8 -0
- package/README.md +22 -20
- package/package.json +1 -1
- package/src/version.ts +1 -1
- package/version.d.mts +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,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.8.1 (2025-10-27)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.8.0...v0.8.1](https://github.com/anchorbrowser/AnchorBrowser-SDK-Typescript/compare/v0.8.0...v0.8.1)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** manual updates ([39f7d39](https://github.com/anchorbrowser/AnchorBrowser-SDK-Typescript/commit/39f7d3984bab0e9c35a1d844ea53d69432714f54))
|
|
10
|
+
|
|
3
11
|
## 0.8.0 (2025-10-21)
|
|
4
12
|
|
|
5
13
|
Full Changelog: [v0.7.0...v0.8.0](https://github.com/anchorbrowser/AnchorBrowser-SDK-Typescript/compare/v0.7.0...v0.8.0)
|
package/README.md
CHANGED
|
@@ -26,9 +26,9 @@ const client = new Anchorbrowser({
|
|
|
26
26
|
apiKey: process.env['ANCHORBROWSER_API_KEY'], // This is the default and can be omitted
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
-
const
|
|
29
|
+
const session = await client.sessions.create({ session: { recording: { active: false } } });
|
|
30
30
|
|
|
31
|
-
console.log(
|
|
31
|
+
console.log(session.data);
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
### Request & Response types
|
|
@@ -43,8 +43,8 @@ const client = new Anchorbrowser({
|
|
|
43
43
|
apiKey: process.env['ANCHORBROWSER_API_KEY'], // This is the default and can be omitted
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
-
const params: Anchorbrowser.
|
|
47
|
-
const
|
|
46
|
+
const params: Anchorbrowser.SessionCreateParams = { session: { recording: { active: false } } };
|
|
47
|
+
const session: Anchorbrowser.SessionCreateResponse = await client.sessions.create(params);
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
|
|
@@ -96,15 +96,17 @@ a subclass of `APIError` will be thrown:
|
|
|
96
96
|
|
|
97
97
|
<!-- prettier-ignore -->
|
|
98
98
|
```ts
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
99
|
+
const session = await client.sessions
|
|
100
|
+
.create({ session: { recording: { active: false } } })
|
|
101
|
+
.catch(async (err) => {
|
|
102
|
+
if (err instanceof Anchorbrowser.APIError) {
|
|
103
|
+
console.log(err.status); // 400
|
|
104
|
+
console.log(err.name); // BadRequestError
|
|
105
|
+
console.log(err.headers); // {server: 'nginx', ...}
|
|
106
|
+
} else {
|
|
107
|
+
throw err;
|
|
108
|
+
}
|
|
109
|
+
});
|
|
108
110
|
```
|
|
109
111
|
|
|
110
112
|
Error codes are as follows:
|
|
@@ -136,7 +138,7 @@ const client = new Anchorbrowser({
|
|
|
136
138
|
});
|
|
137
139
|
|
|
138
140
|
// Or, configure per-request:
|
|
139
|
-
await client.
|
|
141
|
+
await client.sessions.create({ session: { recording: { active: false } } }, {
|
|
140
142
|
maxRetries: 5,
|
|
141
143
|
});
|
|
142
144
|
```
|
|
@@ -153,7 +155,7 @@ const client = new Anchorbrowser({
|
|
|
153
155
|
});
|
|
154
156
|
|
|
155
157
|
// Override per-request:
|
|
156
|
-
await client.
|
|
158
|
+
await client.sessions.create({ session: { recording: { active: false } } }, {
|
|
157
159
|
timeout: 5 * 1000,
|
|
158
160
|
});
|
|
159
161
|
```
|
|
@@ -176,15 +178,15 @@ Unlike `.asResponse()` this method consumes the body, returning once it is parse
|
|
|
176
178
|
```ts
|
|
177
179
|
const client = new Anchorbrowser();
|
|
178
180
|
|
|
179
|
-
const response = await client.
|
|
181
|
+
const response = await client.sessions.create({ session: { recording: { active: false } } }).asResponse();
|
|
180
182
|
console.log(response.headers.get('X-My-Header'));
|
|
181
183
|
console.log(response.statusText); // access the underlying Response object
|
|
182
184
|
|
|
183
|
-
const { data:
|
|
184
|
-
.create({
|
|
185
|
+
const { data: session, response: raw } = await client.sessions
|
|
186
|
+
.create({ session: { recording: { active: false } } })
|
|
185
187
|
.withResponse();
|
|
186
188
|
console.log(raw.headers.get('X-My-Header'));
|
|
187
|
-
console.log(
|
|
189
|
+
console.log(session.data);
|
|
188
190
|
```
|
|
189
191
|
|
|
190
192
|
### Logging
|
|
@@ -264,7 +266,7 @@ parameter. This library doesn't validate at runtime that the request matches the
|
|
|
264
266
|
send will be sent as-is.
|
|
265
267
|
|
|
266
268
|
```ts
|
|
267
|
-
client.
|
|
269
|
+
client.sessions.create({
|
|
268
270
|
// ...
|
|
269
271
|
// @ts-expect-error baz is not yet public
|
|
270
272
|
baz: 'undocumented option',
|
package/package.json
CHANGED
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.8.
|
|
1
|
+
export const VERSION = '0.8.1'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.8.
|
|
1
|
+
export declare const VERSION = "0.8.1";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.8.
|
|
1
|
+
export declare const VERSION = "0.8.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.8.
|
|
1
|
+
export const VERSION = '0.8.1'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|