@hunt-labs/bytekit-sdk 0.3.0 → 0.5.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.
@@ -155,6 +155,9 @@ export interface paths {
155
155
  * Capture a screenshot
156
156
  * @description Sync by default (holds up to 28s). Pass `?async=true` to return 202 immediately.
157
157
  * Poll via GET /v1/screenshots/{id}.
158
+ *
159
+ * **Limits:** request bodies are capped at 512 KB. An oversized body
160
+ * returns a `400` with error code `request_too_large`.
158
161
  */
159
162
  post: operations["createScreenshot"];
160
163
  delete?: never;
@@ -277,6 +280,9 @@ export interface paths {
277
280
  /**
278
281
  * Fetch a URL (POST)
279
282
  * @description Same as GET /v1/fetch but with a JSON request body.
283
+ *
284
+ * **Limits:** request bodies are capped at 512 KB. An oversized body
285
+ * returns a `400` with error code `request_too_large`.
280
286
  */
281
287
  post: operations["postFetch"];
282
288
  delete?: never;
@@ -298,6 +304,17 @@ export interface paths {
298
304
  * Bulk fetch URLs
299
305
  * @description Enqueues multiple URLs for HTTP fetching. Results delivered via webhook.
300
306
  * Does not support options that require page rendering (cookies, wait_for_selector, etc.).
307
+ *
308
+ * **Limits:** request bodies are guarded in a two-tier shape. A streamed body
309
+ * with no `Content-Length` header is capped at 2 MB before your API key
310
+ * is checked; a body that declares `Content-Length` is instead bounded
311
+ * there by a 20 MB fail-safe (not the real limit — see below), since
312
+ * that branch reads nothing until your key is verified. Once your key
313
+ * is verified, a second check re-gates the body against your account's
314
+ * own `max_bulk_size` (at this endpoint's per-item override budget),
315
+ * which reaches 16.8 MB for the largest documented account. A
316
+ * standard-plan account's effective ceiling is 2 MB; either tier's
317
+ * overrun returns a `400` with error code `request_too_large`.
301
318
  */
302
319
  post: operations["createFetchBulk"];
303
320
  delete?: never;
@@ -343,6 +360,17 @@ export interface paths {
343
360
  * Provide `urls` (simple list) or `items` (per-item config), not both.
344
361
  * Webhook deliveries include `X-ByteKit-Event: bulk.completed` so
345
362
  * receivers can dispatch on the header without parsing the body shape.
363
+ *
364
+ * **Limits:** request bodies are guarded in a two-tier shape. A streamed body
365
+ * with no `Content-Length` header is capped at 4 MB before your API key
366
+ * is checked; a body that declares `Content-Length` is instead bounded
367
+ * there by a 32 MB fail-safe (not the real limit — see below), since
368
+ * that branch reads nothing until your key is verified. Once your key
369
+ * is verified, a second check re-gates the body against your account's
370
+ * own `max_bulk_size` (at this endpoint's richer per-item override
371
+ * budget), which reaches 28.7 MB for the largest documented account. A
372
+ * standard-plan account's effective ceiling is 4 MB; either tier's
373
+ * overrun returns a `400` with error code `request_too_large`.
346
374
  */
347
375
  post: operations["createBulk"];
348
376
  delete?: never;
@@ -402,6 +430,9 @@ export interface paths {
402
430
  /**
403
431
  * Create a change-detection monitor
404
432
  * @description Creates a recurring change-detection monitor for a URL, delivering results via webhook.
433
+ *
434
+ * **Limits:** request bodies are capped at 512 KB. An oversized body
435
+ * returns a `400` with error code `request_too_large`.
405
436
  */
406
437
  post: operations["createMonitor"];
407
438
  delete?: never;
@@ -462,6 +493,9 @@ export interface paths {
462
493
  * Webhook deliveries include `X-ByteKit-Event: sitemap.completed` or
463
494
  * `X-ByteKit-Event: sitemap.failed` so receivers can dispatch on the
464
495
  * header without parsing the body shape.
496
+ *
497
+ * **Limits:** request bodies are capped at 512 KB. An oversized body
498
+ * returns a `400` with error code `request_too_large`.
465
499
  */
466
500
  post: operations["createSitemap"];
467
501
  delete?: never;
@@ -917,6 +951,12 @@ export interface paths {
917
951
  /**
918
952
  * Stripe webhook receiver
919
953
  * @description Receives Stripe webhook events. Verified via signature.
954
+ *
955
+ * **Limits:** request bodies are capped at 256 KB — real Stripe event
956
+ * payloads stay in the tens of KB. An oversized body returns a `400`
957
+ * with a bespoke `{ error }` body (this route predates issue #699's
958
+ * unified REST envelope and answers Stripe's own webhook contract, not
959
+ * the public API's error shape).
920
960
  */
921
961
  post: operations["stripeWebhook"];
922
962
  delete?: never;
@@ -954,6 +994,10 @@ export interface paths {
954
994
  /**
955
995
  * Retry a webhook delivery
956
996
  * @description Requeues a failed or exhausted webhook delivery for another attempt.
997
+ *
998
+ * **Limits:** this endpoint takes no request body; any body sent is
999
+ * capped at 64 KB. An oversized body returns a `400` with error code
1000
+ * `request_too_large`.
957
1001
  */
958
1002
  post: operations["retryWebhookDelivery"];
959
1003
  delete?: never;
@@ -1236,6 +1280,12 @@ export interface paths {
1236
1280
  * Clerk webhook receiver
1237
1281
  * @description Receives Clerk events (user.created, user.updated, user.deleted, etc.).
1238
1282
  * Authentication is via Svix signature verification — no bearer token required.
1283
+ *
1284
+ * **Limits:** request bodies are capped at 256 KB — real Clerk event
1285
+ * payloads (user/membership/invitation objects) stay well under this.
1286
+ * An oversized body returns a `400` with error code `request_too_large`
1287
+ * (bespoke `{ error }` slug shape, matching this route's existing
1288
+ * error convention, not the unified REST envelope).
1239
1289
  */
1240
1290
  post: operations["clerkWebhook"];
1241
1291
  delete?: never;
@@ -2021,9 +2071,13 @@ export interface components {
2021
2071
  [key: string]: string;
2022
2072
  };
2023
2073
  /** @description Screenshot monitor options (device, viewport, format, etc.). */
2024
- options?: Record<string, never>;
2074
+ options?: {
2075
+ [key: string]: unknown;
2076
+ };
2025
2077
  /** @description Scrape monitor options (formats, country, headers, etc.). Only for type=scrape. */
2026
- scrape_options?: Record<string, never>;
2078
+ scrape_options?: {
2079
+ [key: string]: unknown;
2080
+ };
2027
2081
  metadata?: components["schemas"]["Metadata"];
2028
2082
  };
2029
2083
  MonitorUpdateRequest: {
@@ -2046,8 +2100,12 @@ export interface components {
2046
2100
  };
2047
2101
  /** @enum {string} */
2048
2102
  status?: "active" | "paused";
2049
- options?: Record<string, never>;
2050
- scrape_options?: Record<string, never>;
2103
+ options?: {
2104
+ [key: string]: unknown;
2105
+ };
2106
+ scrape_options?: {
2107
+ [key: string]: unknown;
2108
+ };
2051
2109
  metadata?: components["schemas"]["Metadata"];
2052
2110
  };
2053
2111
  MonitorResponse: {
@@ -2136,7 +2194,9 @@ export interface components {
2136
2194
  /** @default null */
2137
2195
  process: {
2138
2196
  action?: string;
2139
- options?: Record<string, never>;
2197
+ options?: {
2198
+ [key: string]: unknown;
2199
+ };
2140
2200
  } | null;
2141
2201
  /**
2142
2202
  * Format: uri
@@ -2595,6 +2655,15 @@ export interface operations {
2595
2655
  "application/json": components["schemas"]["AccountBearerResponse"] | components["schemas"]["AccountSessionResponse"];
2596
2656
  };
2597
2657
  };
2658
+ /** @description Rate limit exceeded (`rate_limited`). Only reachable when authenticated via Clerk session (the 60-request/60-second per-user window) — the bearer and in-process auth branches are not rate-limited at this endpoint. Carries a `Retry-After` header derived from the same clock as the window reset. */
2659
+ 429: {
2660
+ headers: {
2661
+ [name: string]: unknown;
2662
+ };
2663
+ content: {
2664
+ "application/json": components["schemas"]["Error"];
2665
+ };
2666
+ };
2598
2667
  };
2599
2668
  };
2600
2669
  deleteAccount: {
@@ -2680,6 +2749,15 @@ export interface operations {
2680
2749
  "application/json": components["schemas"]["Error"];
2681
2750
  };
2682
2751
  };
2752
+ /** @description Rate limit exceeded (`rate_limited`) — the Clerk-session 60-request/60-second per-user window. Carries a `Retry-After` header derived from the same clock as the window reset. */
2753
+ 429: {
2754
+ headers: {
2755
+ [name: string]: unknown;
2756
+ };
2757
+ content: {
2758
+ "application/json": components["schemas"]["Error"];
2759
+ };
2760
+ };
2683
2761
  };
2684
2762
  };
2685
2763
  listApiKeys: {
@@ -2906,7 +2984,7 @@ export interface operations {
2906
2984
  "application/json": components["schemas"]["Error"];
2907
2985
  };
2908
2986
  };
2909
- /** @description Rate limit exceeded. */
2987
+ /** @description Reveal rate limit exceeded (per-account anti-harvest cap, distinct from the per-second API rate limit). Carries a `Retry-After` header. */
2910
2988
  429: {
2911
2989
  headers: {
2912
2990
  [name: string]: unknown;
@@ -3044,6 +3122,15 @@ export interface operations {
3044
3122
  "application/json": components["schemas"]["Error"];
3045
3123
  };
3046
3124
  };
3125
+ /** @description Rate limit (`rate_limited`) or concurrency limit (`concurrency_limit`) exceeded. Carries a `Retry-After` header — seconds derived from the same clock as `X-RateLimit-Reset` for the rate-limit variant, a fixed small back-off for the concurrency variant. */
3126
+ 429: {
3127
+ headers: {
3128
+ [name: string]: unknown;
3129
+ };
3130
+ content: {
3131
+ "application/json": components["schemas"]["Error"];
3132
+ };
3133
+ };
3047
3134
  };
3048
3135
  };
3049
3136
  getScreenshot: {
@@ -3236,7 +3323,7 @@ export interface operations {
3236
3323
  "application/json": components["schemas"]["Error"];
3237
3324
  };
3238
3325
  };
3239
- /** @description Rate limit exceeded. */
3326
+ /** @description Rate limit (`rate_limited`) or concurrency limit (`concurrency_limit`) exceeded. Carries a `Retry-After` header — seconds derived from the same clock as `X-RateLimit-Reset` for the rate-limit variant, a fixed small back-off for the concurrency variant. */
3240
3327
  429: {
3241
3328
  headers: {
3242
3329
  [name: string]: unknown;
@@ -3343,7 +3430,7 @@ export interface operations {
3343
3430
  };
3344
3431
  delay_ms?: number;
3345
3432
  timeout_ms?: number;
3346
- metadata?: Record<string, never>;
3433
+ metadata?: components["schemas"]["Metadata"];
3347
3434
  /**
3348
3435
  * @description Per-item override for LLM markdown cleaning. When
3349
3436
  * `true` and `markdown` is in `formats`, the converted
@@ -3436,8 +3523,9 @@ export interface operations {
3436
3523
  created_at: string;
3437
3524
  /** Format: date-time */
3438
3525
  completed_at: string | null;
3439
- total_credits_charged: number;
3440
- /** @description Estimated credits at submission time. Null in GET responses. */
3526
+ /** @description Always null on the create response — the job has not been billed yet (routes/scrape-bulk.ts builds the 202 body from a partial job row). Fractional when populated (credits are NUMERIC(10,2)); the numeric branch is unreachable on this path and exists only so the 202 and 200 bodies share one shape. */
3527
+ total_credits_charged: number | null;
3528
+ /** @description Estimated credits at submission time. Null in GET responses. Fractional — markdown/html formats weigh 0.5 credits each (scrape-shared/src/credits.ts), so a one-item markdown job is 1.5. */
3441
3529
  estimated_credits: number | null;
3442
3530
  /** @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported) */
3443
3531
  webhook_url: string;
@@ -3513,7 +3601,8 @@ export interface operations {
3513
3601
  created_at: string;
3514
3602
  /** Format: date-time */
3515
3603
  completed_at: string | null;
3516
- total_credits_charged: number;
3604
+ /** @description Total credits billed for the job. Null until the job is billed. Fractional — credits are NUMERIC(10,2). */
3605
+ total_credits_charged: number | null;
3517
3606
  /** @description Null in GET responses (computed at submission time only). */
3518
3607
  estimated_credits: number | null;
3519
3608
  /** @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported) */
@@ -3600,6 +3689,15 @@ export interface operations {
3600
3689
  "application/json": components["schemas"]["Error"];
3601
3690
  };
3602
3691
  };
3692
+ /** @description Rate limit (`rate_limited`) or concurrency limit (`concurrency_limit`) exceeded. Carries a `Retry-After` header — seconds derived from the same clock as `X-RateLimit-Reset` for the rate-limit variant, a fixed small back-off for the concurrency variant. */
3693
+ 429: {
3694
+ headers: {
3695
+ [name: string]: unknown;
3696
+ };
3697
+ content: {
3698
+ "application/json": components["schemas"]["Error"];
3699
+ };
3700
+ };
3603
3701
  /**
3604
3702
  * @description Fetch service unavailable, content transform failed, or a non-2xx upstream
3605
3703
  * response relayed as the unified Error envelope. On an upstream relay the HTTP
@@ -3689,6 +3787,15 @@ export interface operations {
3689
3787
  "application/json": components["schemas"]["Error"];
3690
3788
  };
3691
3789
  };
3790
+ /** @description Rate limit (`rate_limited`) or concurrency limit (`concurrency_limit`) exceeded. Carries a `Retry-After` header — seconds derived from the same clock as `X-RateLimit-Reset` for the rate-limit variant, a fixed small back-off for the concurrency variant. */
3791
+ 429: {
3792
+ headers: {
3793
+ [name: string]: unknown;
3794
+ };
3795
+ content: {
3796
+ "application/json": components["schemas"]["Error"];
3797
+ };
3798
+ };
3692
3799
  /**
3693
3800
  * @description Fetch service unavailable, content transform failed, or a non-2xx upstream
3694
3801
  * response relayed as the unified Error envelope. On an upstream relay the HTTP
@@ -3737,7 +3844,7 @@ export interface operations {
3737
3844
  */
3738
3845
  webhook_url: string;
3739
3846
  webhook_secret?: string;
3740
- metadata?: Record<string, never>;
3847
+ metadata?: components["schemas"]["Metadata"];
3741
3848
  };
3742
3849
  };
3743
3850
  };
@@ -3748,7 +3855,25 @@ export interface operations {
3748
3855
  [name: string]: unknown;
3749
3856
  };
3750
3857
  content: {
3751
- "application/json": Record<string, never>;
3858
+ "application/json": {
3859
+ /** @example bulk_01j9abc123 */
3860
+ id: string;
3861
+ /** @enum {string} */
3862
+ status: "processing" | "completed" | "failed";
3863
+ total: number;
3864
+ completed: number;
3865
+ failed: number;
3866
+ /** Format: date-time */
3867
+ created_at: string;
3868
+ /** Format: date-time */
3869
+ completed_at: string | null;
3870
+ /** @description Always null on the create response — the job has not been billed yet (routes/fetch-bulk.ts builds the 202 body from a partial job row). Fractional when populated (credits are NUMERIC(10,2)); the numeric branch is unreachable on this path and exists only so the 202 and 200 bodies share one shape. */
3871
+ total_credits_charged: number | null;
3872
+ /** @description Estimated credits at submission time. Null in GET responses. Fractional — markdown/html formats weigh 0.5 credits each (scrape-shared/src/credits.ts), so a one-item markdown job is 1.5. */
3873
+ estimated_credits: number | null;
3874
+ /** @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported) */
3875
+ webhook_url: string;
3876
+ };
3752
3877
  };
3753
3878
  };
3754
3879
  /**
@@ -3802,7 +3927,45 @@ export interface operations {
3802
3927
  [name: string]: unknown;
3803
3928
  };
3804
3929
  content: {
3805
- "application/json": Record<string, never>;
3930
+ "application/json": {
3931
+ /** @example bulk_01j9abc123 */
3932
+ id: string;
3933
+ /** @enum {string} */
3934
+ status: "processing" | "completed" | "failed";
3935
+ total: number;
3936
+ completed: number;
3937
+ failed: number;
3938
+ /** Format: date-time */
3939
+ created_at: string;
3940
+ /** Format: date-time */
3941
+ completed_at: string | null;
3942
+ /** @description Total credits billed for the job. Null until the job is billed. Fractional — credits are NUMERIC(10,2). */
3943
+ total_credits_charged: number | null;
3944
+ /** @description Null in GET responses (computed at submission time only). */
3945
+ estimated_credits: number | null;
3946
+ /** @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported) */
3947
+ webhook_url: string;
3948
+ /** @description Per-URL fetch items, oldest first, capped at 500 (listBulkFetchItemsWithLatestAttempt). */
3949
+ items: {
3950
+ /** @example sc_01j9abc123 */
3951
+ id: string;
3952
+ /** Format: uri */
3953
+ url: string;
3954
+ /** @enum {string} */
3955
+ status: "pending" | "processing" | "completed" | "failed" | "cancelled";
3956
+ content_type: string | null;
3957
+ content_length: number | null;
3958
+ content_url: string | null;
3959
+ waf_vendor: string | null;
3960
+ cache_hit: boolean;
3961
+ error_code: string | null;
3962
+ error_message: string | null;
3963
+ /** Format: date-time */
3964
+ created_at: string;
3965
+ /** Format: date-time */
3966
+ completed_at: string | null;
3967
+ }[];
3968
+ };
3806
3969
  };
3807
3970
  };
3808
3971
  /** @description Resource not found. */
@@ -3845,7 +4008,8 @@ export interface operations {
3845
4008
  created_at: string;
3846
4009
  /** Format: date-time */
3847
4010
  completed_at: string | null;
3848
- total_credits_charged: number;
4011
+ /** @description Total credits billed for the job. Null until the job is billed. Fractional — credits are NUMERIC(10,2). */
4012
+ total_credits_charged: number | null;
3849
4013
  /** @description Null in GET responses (computed at submission time only). */
3850
4014
  estimated_credits: number | null;
3851
4015
  /** @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported) */
@@ -3928,7 +4092,7 @@ export interface operations {
3928
4092
  /** Format: uri */
3929
4093
  url: string;
3930
4094
  /**
3931
- * @default screenshot
4095
+ * @description Capture kind for this entry. If omitted, inherits `defaults.type`; if that is also omitted, falls back to `screenshot`.
3932
4096
  * @enum {string}
3933
4097
  */
3934
4098
  type?: "screenshot" | "scrape";
@@ -4050,8 +4214,9 @@ export interface operations {
4050
4214
  created_at: string;
4051
4215
  /** Format: date-time */
4052
4216
  completed_at: string | null;
4053
- total_credits_charged: number;
4054
- /** @description Estimated credits at submission time. Null in GET responses. */
4217
+ /** @description Always null on the create response — the job has not been billed yet (routes/bulk.ts builds the 202 body from a partial job row). Fractional when populated (credits are NUMERIC(10,2)); the numeric branch is unreachable on this path and exists only so the 202 and 200 bodies share one shape. */
4218
+ total_credits_charged: number | null;
4219
+ /** @description Estimated credits at submission time. Null in GET responses. Fractional — markdown/html formats weigh 0.5 credits each (scrape-shared/src/credits.ts), so a one-item markdown job is 1.5. */
4055
4220
  estimated_credits: number | null;
4056
4221
  /** @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported) */
4057
4222
  webhook_url: string;
@@ -4080,7 +4245,17 @@ export interface operations {
4080
4245
  /**
4081
4246
  * @description Validation error. `bulk_too_large` is returned when the item count
4082
4247
  * exceeds the account plan's `max_bulk_size` cap (also surfaced as
4083
- * `max_bulk_size` on `GET /v1/account`).
4248
+ * `max_bulk_size` on `GET /v1/account`). `validation_error` is
4249
+ * returned when the request body contains an unrecognized key
4250
+ * anywhere in the top-level object, an `items[]` entry, or
4251
+ * `defaults` — all three reject unknown keys with a 422
4252
+ * `validation_error` whose `details` message names the offending
4253
+ * key, instead of silently discarding it. The two nested objects
4254
+ * do not accept the same field set: `device_scale_factor` is
4255
+ * `defaults`-only (rejected per item), and `duration`/`scenario`
4256
+ * are `items[]`-only (rejected under `defaults`). `metadata` is
4257
+ * valid both at the top level of the body and per item, but is
4258
+ * rejected with this same 422 if placed under `defaults`.
4084
4259
  */
4085
4260
  422: {
4086
4261
  headers: {
@@ -4121,7 +4296,8 @@ export interface operations {
4121
4296
  created_at: string;
4122
4297
  /** Format: date-time */
4123
4298
  completed_at: string | null;
4124
- total_credits_charged: number;
4299
+ /** @description Total credits billed for the job. Null until the job is billed. Fractional — credits are NUMERIC(10,2). */
4300
+ total_credits_charged: number | null;
4125
4301
  /** @description Null in GET responses (computed at submission time only). */
4126
4302
  estimated_credits: number | null;
4127
4303
  /** @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported) */
@@ -4169,7 +4345,8 @@ export interface operations {
4169
4345
  created_at: string;
4170
4346
  /** Format: date-time */
4171
4347
  completed_at: string | null;
4172
- total_credits_charged: number;
4348
+ /** @description Total credits billed for the job. Null until the job is billed. Fractional — credits are NUMERIC(10,2). */
4349
+ total_credits_charged: number | null;
4173
4350
  /** @description Null in cancel responses (computed at submission time only). */
4174
4351
  estimated_credits: number | null;
4175
4352
  /** @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported) */
@@ -4205,7 +4382,48 @@ export interface operations {
4205
4382
  [name: string]: unknown;
4206
4383
  };
4207
4384
  content: {
4208
- "application/json": Record<string, never>;
4385
+ "application/json": {
4386
+ /** @example bulk_01j9abc123 */
4387
+ bulk_id: string;
4388
+ /** @description Number of items in `items` (page size, not the job total). */
4389
+ total: number;
4390
+ /** @description Heterogeneous capture items discriminated by `type`. Fields outside the common set are present only for the matching `type`. */
4391
+ items: {
4392
+ /** @enum {string} */
4393
+ type: "screenshot" | "recording" | "scrape";
4394
+ /** @description Prefixed id — `ss_` / `rec_` / `sc_` per `type`. */
4395
+ id: string;
4396
+ /** @enum {string} */
4397
+ status: "pending" | "processing" | "completed" | "failed" | "cancelled";
4398
+ /** Format: uri */
4399
+ url: string;
4400
+ credits_charged: number | null;
4401
+ error_code: string | null;
4402
+ error_message: string | null;
4403
+ /** Format: date-time */
4404
+ created_at: string;
4405
+ /** Format: date-time */
4406
+ completed_at: string | null;
4407
+ /** @description `type: screenshot` only. Presigned for completed rows with a storage key; raw image_url otherwise. */
4408
+ image_url?: string | null;
4409
+ /** @description `type: screenshot` and `type: scrape` only. */
4410
+ page_title?: string | null;
4411
+ /** @description `type: recording` only. */
4412
+ format?: string;
4413
+ /** @description `type: recording` only. */
4414
+ video_url?: string | null;
4415
+ /** @description `type: scrape` only. */
4416
+ content_url?: string | null;
4417
+ /** @description `type: scrape` only. */
4418
+ content_type?: string | null;
4419
+ /** @description `type: scrape` only. */
4420
+ content_length?: number | null;
4421
+ /** @description `type: scrape` only. Always null in bulk listings — fetch the body via `markdown_url`. */
4422
+ markdown?: string | null;
4423
+ /** @description `type: scrape` only. */
4424
+ markdown_url?: string | null;
4425
+ }[];
4426
+ };
4209
4427
  };
4210
4428
  };
4211
4429
  };
@@ -4514,6 +4732,15 @@ export interface operations {
4514
4732
  "application/json": components["schemas"]["Error"];
4515
4733
  };
4516
4734
  };
4735
+ /** @description Rate limit (`rate_limited`) or concurrency limit (`concurrency_limit`) exceeded. Carries a `Retry-After` header — seconds derived from the same clock as `X-RateLimit-Reset` for the rate-limit variant, a fixed small back-off for the concurrency variant. */
4736
+ 429: {
4737
+ headers: {
4738
+ [name: string]: unknown;
4739
+ };
4740
+ content: {
4741
+ "application/json": components["schemas"]["Error"];
4742
+ };
4743
+ };
4517
4744
  };
4518
4745
  };
4519
4746
  getSitemap: {
@@ -4553,6 +4780,15 @@ export interface operations {
4553
4780
  "application/json": components["schemas"]["Error"];
4554
4781
  };
4555
4782
  };
4783
+ /** @description The id path segment is not a well-formed sitemap job id (genuinely malformed — a well-formed-but-absent id returns 404, not 422; see the Inverse case in issue */
4784
+ 422: {
4785
+ headers: {
4786
+ [name: string]: unknown;
4787
+ };
4788
+ content: {
4789
+ "application/json": components["schemas"]["Error"];
4790
+ };
4791
+ };
4556
4792
  };
4557
4793
  };
4558
4794
  createSearch: {
@@ -4646,7 +4882,7 @@ export interface operations {
4646
4882
  /** Format: uri */
4647
4883
  url: string;
4648
4884
  /** @description Short text excerpt for the result. Present for `web` and `news` results; omitted for `images` results. */
4649
- snippet: string;
4885
+ snippet?: string;
4650
4886
  /** @description Published date of the result. For `web` and `news` results the key is always present but is `null` when the provider reports no date; omitted entirely for `images` results. */
4651
4887
  date?: string | null;
4652
4888
  /** @description Publisher / source name. Present for `news` and `images` results, when the provider reports one. */
@@ -4700,7 +4936,7 @@ export interface operations {
4700
4936
  "application/json": components["schemas"]["Error"];
4701
4937
  };
4702
4938
  };
4703
- /** @description Rate limit exceeded. */
4939
+ /** @description Rate limit exceeded (`rate_limited`). Carries the `X-RateLimit-Limit`/`X-RateLimit-Remaining`/`X-RateLimit-Reset` triplet and a `Retry-After` header. The window is per-second for a bearer API key, or the 60-request/60-second Clerk session window when authenticated via `resolveDualAuth` — `Retry-After` reflects whichever window applies to the request. */
4704
4940
  429: {
4705
4941
  headers: {
4706
4942
  [name: string]: unknown;
@@ -5866,6 +6102,21 @@ export interface operations {
5866
6102
  };
5867
6103
  content?: never;
5868
6104
  };
6105
+ /**
6106
+ * @description Bad request. Returned when the request body exceeds this
6107
+ * endpoint's 256 KB size limit (bespoke `{ error }` body, not the
6108
+ * unified envelope — see the endpoint description).
6109
+ */
6110
+ 400: {
6111
+ headers: {
6112
+ [name: string]: unknown;
6113
+ };
6114
+ content: {
6115
+ "application/json": {
6116
+ error?: string;
6117
+ };
6118
+ };
6119
+ };
5869
6120
  };
5870
6121
  };
5871
6122
  listWebhookDeliveries: {
@@ -5919,6 +6170,18 @@ export interface operations {
5919
6170
  "application/json": components["schemas"]["WebhookDeliveryResponse"];
5920
6171
  };
5921
6172
  };
6173
+ /**
6174
+ * @description Bad request. Returned when the request body exceeds this
6175
+ * endpoint's size limit; the error code is `request_too_large`.
6176
+ */
6177
+ 400: {
6178
+ headers: {
6179
+ [name: string]: unknown;
6180
+ };
6181
+ content: {
6182
+ "application/json": components["schemas"]["Error"];
6183
+ };
6184
+ };
5922
6185
  /** @description Delivery not found or not in a retryable state. */
5923
6186
  404: {
5924
6187
  headers: {
@@ -6135,6 +6398,15 @@ export interface operations {
6135
6398
  "application/json": components["schemas"]["Error"];
6136
6399
  };
6137
6400
  };
6401
+ /** @description Rate limit exceeded (`rate_limited`) — the Clerk-session 60-request/60-second per-user window. Carries a `Retry-After` header derived from the same clock as the window reset. */
6402
+ 429: {
6403
+ headers: {
6404
+ [name: string]: unknown;
6405
+ };
6406
+ content: {
6407
+ "application/json": components["schemas"]["Error"];
6408
+ };
6409
+ };
6138
6410
  };
6139
6411
  };
6140
6412
  updateMe: {
@@ -6171,6 +6443,15 @@ export interface operations {
6171
6443
  "application/json": components["schemas"]["Error"];
6172
6444
  };
6173
6445
  };
6446
+ /** @description Rate limit exceeded (`rate_limited`) — the Clerk-session 60-request/60-second per-user window. Carries a `Retry-After` header derived from the same clock as the window reset. */
6447
+ 429: {
6448
+ headers: {
6449
+ [name: string]: unknown;
6450
+ };
6451
+ content: {
6452
+ "application/json": components["schemas"]["Error"];
6453
+ };
6454
+ };
6174
6455
  };
6175
6456
  };
6176
6457
  requestEmailChange: {
@@ -6234,6 +6515,15 @@ export interface operations {
6234
6515
  "application/json": components["schemas"]["Error"];
6235
6516
  };
6236
6517
  };
6518
+ /** @description Rate limit exceeded (`rate_limited`) — the Clerk-session 60-request/60-second per-user window. Carries a `Retry-After` header derived from the same clock as the window reset. */
6519
+ 429: {
6520
+ headers: {
6521
+ [name: string]: unknown;
6522
+ };
6523
+ content: {
6524
+ "application/json": components["schemas"]["Error"];
6525
+ };
6526
+ };
6237
6527
  };
6238
6528
  };
6239
6529
  removeMember: {
@@ -6377,6 +6667,15 @@ export interface operations {
6377
6667
  "application/json": components["schemas"]["Error"];
6378
6668
  };
6379
6669
  };
6670
+ /** @description Rate limit exceeded (`rate_limited`) — the Clerk-session 60-request/60-second per-user window. Carries a `Retry-After` header derived from the same clock as the window reset. */
6671
+ 429: {
6672
+ headers: {
6673
+ [name: string]: unknown;
6674
+ };
6675
+ content: {
6676
+ "application/json": components["schemas"]["Error"];
6677
+ };
6678
+ };
6380
6679
  };
6381
6680
  };
6382
6681
  createInvite: {
@@ -6433,6 +6732,15 @@ export interface operations {
6433
6732
  "application/json": components["schemas"]["Error"];
6434
6733
  };
6435
6734
  };
6735
+ /** @description Rate limit exceeded (`rate_limited`) — the Clerk-session 60-request/60-second per-user window. Carries a `Retry-After` header derived from the same clock as the window reset. */
6736
+ 429: {
6737
+ headers: {
6738
+ [name: string]: unknown;
6739
+ };
6740
+ content: {
6741
+ "application/json": components["schemas"]["Error"];
6742
+ };
6743
+ };
6436
6744
  };
6437
6745
  };
6438
6746
  acceptInvite: {
package/dist/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  export { ByteKit, ByteKitError, ByteKitConnectionError } from './client.js';
2
- export type { ByteKitOptions, RequestOptions, ConnectionErrorCode } from './client.js';
2
+ export type { ByteKitOptions, RequestOptions, ApiResponse, ConnectionErrorCode } from './client.js';
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 { ScrapeCreateResponse, ScrapeGetResponse, ScrapeBulkCreateRequest, ScrapeBulkCreateResponse, ScrapeBulkGetResponse, } from './resources/scrape.js';
6
+ export type { ScrapeCookie, ScrapeOpts, MarkdownMode, MarkdownLinks, MarkdownImages, TokenEncoding, 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
- export type { MonitorCreateRequest, MonitorCreateResponse, ListMonitorsParams, ListMonitorsResponse, MonitorResponse, MonitorUpdateRequest, UpdateMonitorResponse, ListMonitorCapturesResponse, } from './resources/monitors.js';
9
+ export type { MonitorCreateRequest, MonitorCreateResponse, ListMonitorsParams, MonitorStatus, ListMonitorsResponse, MonitorResponse, MonitorUpdateRequest, UpdateMonitorResponse, ListMonitorCapturesResponse, } from './resources/monitors.js';
10
10
  export type { SitemapCreateRequest, SitemapCreateResponse, SitemapGetResponse, } from './resources/sitemap.js';
11
11
  export type { BulkCreateRequest, BulkCreateResponse, BulkGetResponse, BulkCancelResponse, ListBulkScreenshotsResponse, } from './resources/bulk.js';
12
12
  export type { GetAccountResponse, ListApiKeysResponse, CreateApiKeyRequest, CreateApiKeyResponse, GetApiKeyResponse, UpdateApiKeyRequest, UpdateApiKeyResponse, RevealApiKeyResponse, } from './resources/account.js';