@hunt-labs/bytekit-sdk 0.11.10 → 0.11.12
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 +35 -0
- package/dist/generated/api.d.ts +43 -23
- package/dist/index.d.ts +1 -1
- package/dist/resources/scrape.d.ts +5 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,41 @@ today, see [README.md](./README.md), which remains the authoritative usage guide
|
|
|
10
10
|
|
|
11
11
|
## [Unreleased]
|
|
12
12
|
|
|
13
|
+
## [0.11.12] - 2026-10-20
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- **`ScrapeJsonFormat` is now exported from the package entry (#5455).** The type of the
|
|
18
|
+
`{ type: 'json', schema, model?, prompt? }` entry in `ScrapeOpts['formats']`, which the
|
|
19
|
+
`scrape.create` reference already names, was module-private; it now imports from
|
|
20
|
+
`@hunt-labs/bytekit-sdk`. Type-only; no runtime or method signature moves.
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- **`artifact_warnings` on a `/v1/bulk/{id}/screenshots` scrape item now documents the extraction
|
|
25
|
+
warnings (#5458).** The field also carries the `json` extraction's own warning codes
|
|
26
|
+
(whether or not the output validated), after any `artifact_unavailable` entry; its description said it reported
|
|
27
|
+
artifact reference failures only. Regenerated `src/generated/api.d.ts`; description text only,
|
|
28
|
+
no SDK method signature moves.
|
|
29
|
+
|
|
30
|
+
## [0.11.11] - 2026-10-14
|
|
31
|
+
|
|
32
|
+
### Changed
|
|
33
|
+
|
|
34
|
+
- **`scrape.create` takes the `json` format (#5133).** `ScrapeOpts.formats` now accepts one
|
|
35
|
+
`{ type: 'json', schema, model?, prompt? }` entry beside the string formats; before, the option
|
|
36
|
+
type rejected it at compile time. The generated bulk create types (`scrape.bulk.create`,
|
|
37
|
+
`bulk.create`) take the same entry in `defaults.formats` and `items[].formats`, and
|
|
38
|
+
`ScrapeRequestJsonFormat` is now usable as written: `schema` is a free-form object (it generated
|
|
39
|
+
as `Record<string, never>`, which no schema could satisfy) and `model` is optional (the spec's
|
|
40
|
+
`default` keyword typed it as required; the default is now stated in its description). Regenerated
|
|
41
|
+
`src/generated/api.d.ts`; a request with string formats only is unchanged.
|
|
42
|
+
|
|
43
|
+
- **`POST /v1/account/bootstrap` types describe the joined-invite outcome (#5093).** The internal
|
|
44
|
+
operation's description and `201` response said only "account created"; since #5058 a `201`
|
|
45
|
+
also means the caller joined the newest pending invite's account. Regenerated
|
|
46
|
+
`src/generated/api.d.ts`; description text only, no SDK method signature moves.
|
|
47
|
+
|
|
13
48
|
## [0.11.10] - 2026-10-02
|
|
14
49
|
|
|
15
50
|
### Changed
|
package/dist/generated/api.d.ts
CHANGED
|
@@ -1207,8 +1207,11 @@ export interface paths {
|
|
|
1207
1207
|
put?: never;
|
|
1208
1208
|
/**
|
|
1209
1209
|
* Bootstrap account
|
|
1210
|
-
* @description First-time
|
|
1211
|
-
*
|
|
1210
|
+
* @description First-time bootstrap for a Clerk-authenticated user: the caller joins the
|
|
1211
|
+
* account of the newest pending invite for the session email (on a live
|
|
1212
|
+
* account), or, with no such invite, a new account is created.
|
|
1213
|
+
* Idempotent — returns 200 if the account already exists, 201 on the first
|
|
1214
|
+
* successful bootstrap (either outcome).
|
|
1212
1215
|
* Does not require an existing membership (allowNoMembership=true).
|
|
1213
1216
|
*/
|
|
1214
1217
|
post: operations["bootstrapAccount"];
|
|
@@ -1578,6 +1581,10 @@ export interface components {
|
|
|
1578
1581
|
formats?: {
|
|
1579
1582
|
raw?: string | null;
|
|
1580
1583
|
markdown?: string | null;
|
|
1584
|
+
/** @description The item's `formats.json` result (`data`, `validated`, `model`), present only when the job requested a `json` format and the serialized result fits the 8,192-character bound; `null` when the item has no result. */
|
|
1585
|
+
json?: {
|
|
1586
|
+
[key: string]: unknown;
|
|
1587
|
+
} | null;
|
|
1581
1588
|
links?: null | (string | components["schemas"]["ScrapeScoredLink"])[];
|
|
1582
1589
|
images?: null | (string | components["schemas"]["ScrapeScoredImage"])[];
|
|
1583
1590
|
};
|
|
@@ -1770,10 +1777,10 @@ export interface components {
|
|
|
1770
1777
|
* or `images`) or a `json` object entry that extracts structured data from the page.
|
|
1771
1778
|
* The string `"json"` is not a format value; the `json` entry is an object, described
|
|
1772
1779
|
* by `ScrapeRequestJsonFormat`. A list may hold at most one `json` entry, and a list
|
|
1773
|
-
* holding only the `json` entry still captures `raw`. The `json` entry
|
|
1774
|
-
* `POST /v1/scrape`
|
|
1775
|
-
* formats alone. Its result is `formats.json` on the
|
|
1776
|
-
* described on `ScrapeRequestJsonFormat`.
|
|
1780
|
+
* holding only the `json` entry still captures `raw`. The `json` entry is accepted on
|
|
1781
|
+
* `POST /v1/scrape`, `POST /v1/scrape/bulk` and `POST /v1/bulk` (scrape entries);
|
|
1782
|
+
* monitor `formats` accept the string formats alone. Its result is `formats.json` on the
|
|
1783
|
+
* response, and its charge is described on `ScrapeRequestJsonFormat`.
|
|
1777
1784
|
* @default [
|
|
1778
1785
|
* "raw"
|
|
1779
1786
|
* ]
|
|
@@ -1903,11 +1910,17 @@ export interface components {
|
|
|
1903
1910
|
* @description The `json` entry of `ScrapeRequest.formats`: structured extraction over the scraped
|
|
1904
1911
|
* page, using the same extractor as `POST /v1/schema`.
|
|
1905
1912
|
*
|
|
1906
|
-
* **
|
|
1907
|
-
*
|
|
1908
|
-
*
|
|
1909
|
-
* admission in every billing mode and released again when the extraction does
|
|
1910
|
-
* validate.
|
|
1913
|
+
* **Charge.** Each `json` entry carries a flat per-extraction credit charge, on top of the
|
|
1914
|
+
* scrape's own bandwidth charge and never scaled by the scrape's factors. It is charged
|
|
1915
|
+
* only when the extraction validates (`formats.json.validated` is `true`). The credits are
|
|
1916
|
+
* reserved at admission in every billing mode and released again when the extraction does
|
|
1917
|
+
* not validate.
|
|
1918
|
+
*
|
|
1919
|
+
* **Where it applies.** The entry is accepted in `formats` on `POST /v1/scrape`, in
|
|
1920
|
+
* `defaults.formats` and each `items[].formats` of `POST /v1/scrape/bulk`, and in the same
|
|
1921
|
+
* fields of scrape entries on `POST /v1/bulk`. A list holds at most one `json` entry. On
|
|
1922
|
+
* the bulk endpoints each scrape item carries its own `formats.json` result; an item's own
|
|
1923
|
+
* `json` entry replaces the one in `defaults`.
|
|
1911
1924
|
*
|
|
1912
1925
|
* **Errors.** A `schema` the extractor cannot take is refused with
|
|
1913
1926
|
* `422 schema_incompatible`, and a deployment with no extraction provider refuses the
|
|
@@ -1925,13 +1938,14 @@ export interface components {
|
|
|
1925
1938
|
* most 8, it must compile under Ajv, and it must be normalizable into the extractor's
|
|
1926
1939
|
* strict subset (root `type: object`, and only the keyword allowlist given there).
|
|
1927
1940
|
*/
|
|
1928
|
-
schema:
|
|
1941
|
+
schema: {
|
|
1942
|
+
[key: string]: unknown;
|
|
1943
|
+
};
|
|
1929
1944
|
/**
|
|
1930
|
-
* @description Extraction model.
|
|
1931
|
-
* @default openai/gpt-oss-20b
|
|
1945
|
+
* @description Extraction model. Defaults to `openai/gpt-oss-20b` when omitted.
|
|
1932
1946
|
* @enum {string}
|
|
1933
1947
|
*/
|
|
1934
|
-
model
|
|
1948
|
+
model?: "openai/gpt-oss-20b" | "openai/gpt-oss-120b";
|
|
1935
1949
|
/** @description Optional natural-language extraction hint. */
|
|
1936
1950
|
prompt?: string;
|
|
1937
1951
|
};
|
|
@@ -1995,7 +2009,9 @@ export interface components {
|
|
|
1995
2009
|
*/
|
|
1996
2010
|
json?: {
|
|
1997
2011
|
/** @description The extracted object, or `null` whenever `validated` is `false`. */
|
|
1998
|
-
data:
|
|
2012
|
+
data: {
|
|
2013
|
+
[key: string]: unknown;
|
|
2014
|
+
} | null;
|
|
1999
2015
|
/** @description Whether the extraction produced output matching the schema. The `json` credits are charged only when `true`. */
|
|
2000
2016
|
validated: boolean;
|
|
2001
2017
|
/** @description The extraction model that ran. */
|
|
@@ -4192,7 +4208,7 @@ export interface operations {
|
|
|
4192
4208
|
items?: {
|
|
4193
4209
|
/** Format: uri */
|
|
4194
4210
|
url: string;
|
|
4195
|
-
formats?: ("raw" | "markdown" | "links" | "images")[];
|
|
4211
|
+
formats?: (("raw" | "markdown" | "links" | "images") | components["schemas"]["ScrapeRequestJsonFormat"])[];
|
|
4196
4212
|
country?: string;
|
|
4197
4213
|
delay_ms?: number;
|
|
4198
4214
|
timeout_ms?: number;
|
|
@@ -4225,7 +4241,7 @@ export interface operations {
|
|
|
4225
4241
|
* "raw"
|
|
4226
4242
|
* ]
|
|
4227
4243
|
*/
|
|
4228
|
-
formats?: ("raw" | "markdown" | "links" | "images")[];
|
|
4244
|
+
formats?: (("raw" | "markdown" | "links" | "images") | components["schemas"]["ScrapeRequestJsonFormat"])[];
|
|
4229
4245
|
/** @default US */
|
|
4230
4246
|
country?: string;
|
|
4231
4247
|
/** @default 0 */
|
|
@@ -5273,7 +5289,7 @@ export interface operations {
|
|
|
5273
5289
|
language?: string | null;
|
|
5274
5290
|
dark_mode?: boolean;
|
|
5275
5291
|
/** @description Scrape output formats (scrape entries). */
|
|
5276
|
-
formats?: ("raw" | "markdown" | "links" | "images")[];
|
|
5292
|
+
formats?: (("raw" | "markdown" | "links" | "images") | components["schemas"]["ScrapeRequestJsonFormat"])[];
|
|
5277
5293
|
/** @enum {string} */
|
|
5278
5294
|
wait_until?: "load" | "domcontentloaded" | "networkidle";
|
|
5279
5295
|
wait_for_selector?: string | null;
|
|
@@ -5326,7 +5342,7 @@ export interface operations {
|
|
|
5326
5342
|
language?: string | null;
|
|
5327
5343
|
/** @default false */
|
|
5328
5344
|
dark_mode?: boolean;
|
|
5329
|
-
formats?: ("raw" | "markdown" | "links" | "images")[];
|
|
5345
|
+
formats?: (("raw" | "markdown" | "links" | "images") | components["schemas"]["ScrapeRequestJsonFormat"])[];
|
|
5330
5346
|
/**
|
|
5331
5347
|
* @default load
|
|
5332
5348
|
* @enum {string}
|
|
@@ -5700,14 +5716,18 @@ export interface operations {
|
|
|
5700
5716
|
markdown?: string | null;
|
|
5701
5717
|
/** @description `type: scrape` only. Pre-signed download URL for the markdown rendering of the page, valid for 600 seconds (10 minutes) from the moment this response was generated — the same signing TTL as `content_url` and `image_url` above. A new signature is minted on every poll for a completed item with a markdown key. For every other item the stored value is returned unchanged — `null` while no markdown has been stored, and otherwise a private, unsigned storage URL that returns 401 on download. No `artifact_warnings` entry is raised for this field; unlike `GET /v1/fetch/bulk/{id}`, this endpoint reports no `artifact_unavailable` when signing fails. */
|
|
5702
5718
|
markdown_url?: string | null;
|
|
5703
|
-
/** @description `type: scrape` only. Exact requested artifact values or signed references.
|
|
5719
|
+
/** @description `type: scrape` only. Exact requested artifact values or signed references. `raw`, `markdown`, `links` and `images` are always present; unrequested or unavailable values are null, with nonfatal warnings in `artifact_warnings`. `json` is present only on an item that requested a `json` format. */
|
|
5704
5720
|
artifacts?: {
|
|
5705
5721
|
raw: string | null;
|
|
5706
5722
|
markdown: string | null;
|
|
5723
|
+
/** @description The item's `json` format result (`data`, `validated`, `model`); `null` while the item has stored none. */
|
|
5724
|
+
json?: {
|
|
5725
|
+
[key: string]: unknown;
|
|
5726
|
+
} | null;
|
|
5707
5727
|
links: null | (string | components["schemas"]["ScrapeScoredLink"])[];
|
|
5708
5728
|
images: null | (string | components["schemas"]["ScrapeScoredImage"])[];
|
|
5709
5729
|
};
|
|
5710
|
-
/** @description Nonfatal
|
|
5730
|
+
/** @description Nonfatal warnings for this scrape item. An `artifact_unavailable` entry reports a requested artifact whose reference failed, and comes first. For a `json` format, the extraction's own warning codes follow, with `element: null`, whether or not the output validated (`content_truncated` can accompany a validated result); `artifacts.json` is still returned as stored. */
|
|
5711
5731
|
artifact_warnings?: components["schemas"]["ScrapeWarning"][];
|
|
5712
5732
|
} | {
|
|
5713
5733
|
/** @description Prefixed id — `ss_` / `rec_` / `sc_` per `type`. The same stable identity the ordinary item carries. */
|
|
@@ -7752,7 +7772,7 @@ export interface operations {
|
|
|
7752
7772
|
"application/json": components["schemas"]["Account"];
|
|
7753
7773
|
};
|
|
7754
7774
|
};
|
|
7755
|
-
/** @description
|
|
7775
|
+
/** @description First successful bootstrap: the caller joined a pending invite's account, or a new account was created. */
|
|
7756
7776
|
201: {
|
|
7757
7777
|
headers: {
|
|
7758
7778
|
[name: string]: unknown;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export type { ByteKitOptions, RequestOptions, ApiResponse, ConnectionErrorCode,
|
|
|
3
3
|
export { V01_METHODS } from './allowlist.js';
|
|
4
4
|
export type { V01Method } from './allowlist.js';
|
|
5
5
|
export type { ScrapeId, ScreenshotId, BulkId, MonitorId, SitemapId, ApiKeyId, WebhookDeliveryId, SearchType, SearchDateRange, SearchOpts, SearchResult, SearchResultImage, SearchResponse, } from './types.js';
|
|
6
|
-
export type { ScrapeOpts, MarkdownMode, MarkdownLinks, MarkdownImages, TokenEncoding, ScrapeCreateResponse, ScrapeGetResponse, ScrapeBulkCreateRequest, ScrapeBulkCreateResponse, ScrapeBulkGetResponse, } from './resources/scrape.js';
|
|
6
|
+
export type { ScrapeOpts, MarkdownMode, MarkdownLinks, MarkdownImages, TokenEncoding, ScrapeJsonFormat, ScrapeCreateResponse, ScrapeGetResponse, ScrapeBulkCreateRequest, ScrapeBulkCreateResponse, ScrapeBulkGetResponse, } from './resources/scrape.js';
|
|
7
7
|
export type { ScreenshotCreateRequest, ScreenshotCreateResponse, ScreenshotGetResponse, } from './resources/screenshots.js';
|
|
8
8
|
export type { FetchOpts, FetchGetOpts, FetchResult, FetchCacheStatus, FetchBulkCreateRequest, FetchBulkCreateResponse, FetchBulkGetResponse, } from './resources/fetch.js';
|
|
9
9
|
export type { MonitorCreateRequest, MonitorCreateResponse, ListMonitorsParams, MonitorStatus, ListMonitorsResponse, MonitorResponse, MonitorUpdateRequest, UpdateMonitorResponse, ListMonitorCapturesResponse, } from './resources/monitors.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ByteKit, RequestOptions } from '../client.js';
|
|
2
|
-
import type { operations } from '../generated/api.js';
|
|
2
|
+
import type { components, operations } from '../generated/api.js';
|
|
3
3
|
import type { ScrapeId, BulkId } from '../types.js';
|
|
4
4
|
/**
|
|
5
5
|
* Response of POST /v1/scrape — the WIRE union: a 200 terminal envelope or a 202
|
|
@@ -48,10 +48,13 @@ export type MarkdownLinks = 'inline' | 'references' | 'none' | 'text';
|
|
|
48
48
|
export type MarkdownImages = 'inline' | 'references' | 'none' | 'text';
|
|
49
49
|
/** Tokenizer encoding hint for `token_budget`. */
|
|
50
50
|
export type TokenEncoding = 'cl100k_base' | 'o200k_base';
|
|
51
|
+
/** The `{ type: 'json', schema }` entry of `formats`, typed from the spec. */
|
|
52
|
+
export type ScrapeJsonFormat = components['schemas']['ScrapeRequestJsonFormat'];
|
|
51
53
|
/** Options for POST /v1/scrape. */
|
|
52
54
|
export interface ScrapeOpts {
|
|
53
55
|
url: string;
|
|
54
|
-
formats
|
|
56
|
+
/** String formats, plus at most one `{ type: 'json', schema }` entry for structured extraction (the entry's result is `formats.json`). */
|
|
57
|
+
formats?: Array<'raw' | 'markdown' | 'links' | 'images' | ScrapeJsonFormat>;
|
|
55
58
|
country?: string;
|
|
56
59
|
delay_ms?: number;
|
|
57
60
|
/** SERVER-side scrape budget in ms — how long the server may spend on the scrape itself. For the CLIENT-side abort budget (when this SDK gives up on the wire), see `RequestOptions.requestTimeoutMs`. */
|
package/dist/version.d.ts
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* outbound request carries — see the emit site in `client.ts`. The header name is spelled
|
|
6
6
|
* only there, so issue #2905's pre-merge gate 1 counts exactly one occurrence in `src/`.
|
|
7
7
|
*/
|
|
8
|
-
export declare const SDK_VERSION = "0.11.
|
|
8
|
+
export declare const SDK_VERSION = "0.11.12";
|
package/dist/version.js
CHANGED