@cloudflare/workers-types 5.20260825.1 → 5.20260826.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.
@@ -1596,10 +1596,16 @@ interface CryptoKeyArbitraryKeyAlgorithm {
1596
1596
  declare class DigestStream extends WritableStream<
1597
1597
  ArrayBuffer | ArrayBufferView
1598
1598
  > {
1599
- constructor(algorithm: string | SubtleCryptoHashAlgorithm);
1599
+ constructor(
1600
+ algorithm: string | SubtleCryptoHashAlgorithm,
1601
+ options?: DigestStreamOptions,
1602
+ );
1600
1603
  readonly digest: Promise<ArrayBuffer>;
1601
1604
  get bytesWritten(): number | bigint;
1602
1605
  }
1606
+ interface DigestStreamOptions {
1607
+ toWellFormed?: boolean;
1608
+ }
1603
1609
  /**
1604
1610
  * The **`TextDecoder`** interface represents a decoder for a specific text encoding, such as UTF-8, ISO-8859-2, or GBK. A decoder takes an array of bytes as input and returns a JavaScript string.
1605
1611
  *
@@ -12786,11 +12792,25 @@ type BrowserRunJsonOptions = BrowserRunCommonOptions &
12786
12792
  );
12787
12793
  type BrowserRunContentOptions = BrowserRunCommonOptions;
12788
12794
  type BrowserRunMarkdownOptions = BrowserRunCommonOptions;
12795
+ type BrowserRunRedirectHop = {
12796
+ /** URL that returned the redirect. */
12797
+ url: string;
12798
+ /** HTTP status of the redirect. */
12799
+ status: number;
12800
+ /** Redirect response headers, including `location`. */
12801
+ headers: Record<string, string>;
12802
+ };
12789
12803
  type BrowserRunResponseMeta = {
12790
12804
  /** HTTP status code of the rendered page */
12791
12805
  status: number;
12792
12806
  /** Page title */
12793
12807
  title: string;
12808
+ /** Origin response headers, lowercased. Repeated headers are joined with a newline. Credential and transport-only headers that do not survive rendering are omitted. */
12809
+ headers?: Record<string, string>;
12810
+ /** URL that served the response, after any redirects the browser followed. */
12811
+ finalUrl?: string;
12812
+ /** HTTP redirects followed to reach `finalUrl`, oldest first. Omitted for direct navigation and for client-side redirects such as meta refresh. An empty array means redirects occurred but their intermediate responses could not be read. */
12813
+ redirectChain?: BrowserRunRedirectHop[];
12794
12814
  };
12795
12815
  /**
12796
12816
  * A node in the page's accessibility tree, as exposed to assistive technology.
@@ -12856,6 +12876,7 @@ type BrowserRunLinksSuccessResponse = {
12856
12876
  success: true;
12857
12877
  /** Extracted links */
12858
12878
  result: string[];
12879
+ meta: BrowserRunResponseMeta;
12859
12880
  };
12860
12881
  /** Success response for `scrape` action. */
12861
12882
  type BrowserRunScrapeSuccessResponse = {
@@ -12886,6 +12907,7 @@ type BrowserRunScrapeSuccessResponse = {
12886
12907
  }>;
12887
12908
  }>;
12888
12909
  }>;
12910
+ meta: BrowserRunResponseMeta;
12889
12911
  };
12890
12912
  /** Success response for `snapshot` action. Each field is present only when the
12891
12913
  * corresponding entry was requested in `formats`.
@@ -12920,12 +12942,14 @@ type BrowserRunJsonSuccessResponse = {
12920
12942
  success: true;
12921
12943
  /** JSON data extracted from the page using an AI model */
12922
12944
  result: Record<string, unknown>;
12945
+ meta: BrowserRunResponseMeta;
12923
12946
  };
12924
12947
  /** Success response for `markdown` action. */
12925
12948
  type BrowserRunMarkdownSuccessResponse = {
12926
12949
  success: true;
12927
12950
  /** Extracted markdown content */
12928
12951
  result: string;
12952
+ meta: BrowserRunResponseMeta;
12929
12953
  };
12930
12954
  /** Error response for BrowserRun actions. */
12931
12955
  type BrowserRunErrorResponse = {
@@ -1600,10 +1600,16 @@ export interface CryptoKeyArbitraryKeyAlgorithm {
1600
1600
  export declare class DigestStream extends WritableStream<
1601
1601
  ArrayBuffer | ArrayBufferView
1602
1602
  > {
1603
- constructor(algorithm: string | SubtleCryptoHashAlgorithm);
1603
+ constructor(
1604
+ algorithm: string | SubtleCryptoHashAlgorithm,
1605
+ options?: DigestStreamOptions,
1606
+ );
1604
1607
  readonly digest: Promise<ArrayBuffer>;
1605
1608
  get bytesWritten(): number | bigint;
1606
1609
  }
1610
+ export interface DigestStreamOptions {
1611
+ toWellFormed?: boolean;
1612
+ }
1607
1613
  /**
1608
1614
  * The **`TextDecoder`** interface represents a decoder for a specific text encoding, such as UTF-8, ISO-8859-2, or GBK. A decoder takes an array of bytes as input and returns a JavaScript string.
1609
1615
  *
@@ -12800,11 +12806,25 @@ export type BrowserRunJsonOptions = BrowserRunCommonOptions &
12800
12806
  );
12801
12807
  export type BrowserRunContentOptions = BrowserRunCommonOptions;
12802
12808
  export type BrowserRunMarkdownOptions = BrowserRunCommonOptions;
12809
+ export type BrowserRunRedirectHop = {
12810
+ /** URL that returned the redirect. */
12811
+ url: string;
12812
+ /** HTTP status of the redirect. */
12813
+ status: number;
12814
+ /** Redirect response headers, including `location`. */
12815
+ headers: Record<string, string>;
12816
+ };
12803
12817
  export type BrowserRunResponseMeta = {
12804
12818
  /** HTTP status code of the rendered page */
12805
12819
  status: number;
12806
12820
  /** Page title */
12807
12821
  title: string;
12822
+ /** Origin response headers, lowercased. Repeated headers are joined with a newline. Credential and transport-only headers that do not survive rendering are omitted. */
12823
+ headers?: Record<string, string>;
12824
+ /** URL that served the response, after any redirects the browser followed. */
12825
+ finalUrl?: string;
12826
+ /** HTTP redirects followed to reach `finalUrl`, oldest first. Omitted for direct navigation and for client-side redirects such as meta refresh. An empty array means redirects occurred but their intermediate responses could not be read. */
12827
+ redirectChain?: BrowserRunRedirectHop[];
12808
12828
  };
12809
12829
  /**
12810
12830
  * A node in the page's accessibility tree, as exposed to assistive technology.
@@ -12870,6 +12890,7 @@ export type BrowserRunLinksSuccessResponse = {
12870
12890
  success: true;
12871
12891
  /** Extracted links */
12872
12892
  result: string[];
12893
+ meta: BrowserRunResponseMeta;
12873
12894
  };
12874
12895
  /** Success response for `scrape` action. */
12875
12896
  export type BrowserRunScrapeSuccessResponse = {
@@ -12900,6 +12921,7 @@ export type BrowserRunScrapeSuccessResponse = {
12900
12921
  }>;
12901
12922
  }>;
12902
12923
  }>;
12924
+ meta: BrowserRunResponseMeta;
12903
12925
  };
12904
12926
  /** Success response for `snapshot` action. Each field is present only when the
12905
12927
  * corresponding entry was requested in `formats`.
@@ -12934,12 +12956,14 @@ export type BrowserRunJsonSuccessResponse = {
12934
12956
  success: true;
12935
12957
  /** JSON data extracted from the page using an AI model */
12936
12958
  result: Record<string, unknown>;
12959
+ meta: BrowserRunResponseMeta;
12937
12960
  };
12938
12961
  /** Success response for `markdown` action. */
12939
12962
  export type BrowserRunMarkdownSuccessResponse = {
12940
12963
  success: true;
12941
12964
  /** Extracted markdown content */
12942
12965
  result: string;
12966
+ meta: BrowserRunResponseMeta;
12943
12967
  };
12944
12968
  /** Error response for BrowserRun actions. */
12945
12969
  export type BrowserRunErrorResponse = {
package/index.d.ts CHANGED
@@ -1571,10 +1571,16 @@ interface CryptoKeyArbitraryKeyAlgorithm {
1571
1571
  declare class DigestStream extends WritableStream<
1572
1572
  ArrayBuffer | ArrayBufferView
1573
1573
  > {
1574
- constructor(algorithm: string | SubtleCryptoHashAlgorithm);
1574
+ constructor(
1575
+ algorithm: string | SubtleCryptoHashAlgorithm,
1576
+ options?: DigestStreamOptions,
1577
+ );
1575
1578
  readonly digest: Promise<ArrayBuffer>;
1576
1579
  get bytesWritten(): number | bigint;
1577
1580
  }
1581
+ interface DigestStreamOptions {
1582
+ toWellFormed?: boolean;
1583
+ }
1578
1584
  /**
1579
1585
  * The **`TextDecoder`** interface represents a decoder for a specific text encoding, such as UTF-8, ISO-8859-2, or GBK. A decoder takes an array of bytes as input and returns a JavaScript string.
1580
1586
  *
@@ -12511,11 +12517,25 @@ type BrowserRunJsonOptions = BrowserRunCommonOptions &
12511
12517
  );
12512
12518
  type BrowserRunContentOptions = BrowserRunCommonOptions;
12513
12519
  type BrowserRunMarkdownOptions = BrowserRunCommonOptions;
12520
+ type BrowserRunRedirectHop = {
12521
+ /** URL that returned the redirect. */
12522
+ url: string;
12523
+ /** HTTP status of the redirect. */
12524
+ status: number;
12525
+ /** Redirect response headers, including `location`. */
12526
+ headers: Record<string, string>;
12527
+ };
12514
12528
  type BrowserRunResponseMeta = {
12515
12529
  /** HTTP status code of the rendered page */
12516
12530
  status: number;
12517
12531
  /** Page title */
12518
12532
  title: string;
12533
+ /** Origin response headers, lowercased. Repeated headers are joined with a newline. Credential and transport-only headers that do not survive rendering are omitted. */
12534
+ headers?: Record<string, string>;
12535
+ /** URL that served the response, after any redirects the browser followed. */
12536
+ finalUrl?: string;
12537
+ /** HTTP redirects followed to reach `finalUrl`, oldest first. Omitted for direct navigation and for client-side redirects such as meta refresh. An empty array means redirects occurred but their intermediate responses could not be read. */
12538
+ redirectChain?: BrowserRunRedirectHop[];
12519
12539
  };
12520
12540
  /**
12521
12541
  * A node in the page's accessibility tree, as exposed to assistive technology.
@@ -12581,6 +12601,7 @@ type BrowserRunLinksSuccessResponse = {
12581
12601
  success: true;
12582
12602
  /** Extracted links */
12583
12603
  result: string[];
12604
+ meta: BrowserRunResponseMeta;
12584
12605
  };
12585
12606
  /** Success response for `scrape` action. */
12586
12607
  type BrowserRunScrapeSuccessResponse = {
@@ -12611,6 +12632,7 @@ type BrowserRunScrapeSuccessResponse = {
12611
12632
  }>;
12612
12633
  }>;
12613
12634
  }>;
12635
+ meta: BrowserRunResponseMeta;
12614
12636
  };
12615
12637
  /** Success response for `snapshot` action. Each field is present only when the
12616
12638
  * corresponding entry was requested in `formats`.
@@ -12645,12 +12667,14 @@ type BrowserRunJsonSuccessResponse = {
12645
12667
  success: true;
12646
12668
  /** JSON data extracted from the page using an AI model */
12647
12669
  result: Record<string, unknown>;
12670
+ meta: BrowserRunResponseMeta;
12648
12671
  };
12649
12672
  /** Success response for `markdown` action. */
12650
12673
  type BrowserRunMarkdownSuccessResponse = {
12651
12674
  success: true;
12652
12675
  /** Extracted markdown content */
12653
12676
  result: string;
12677
+ meta: BrowserRunResponseMeta;
12654
12678
  };
12655
12679
  /** Error response for BrowserRun actions. */
12656
12680
  type BrowserRunErrorResponse = {
package/index.ts CHANGED
@@ -1575,10 +1575,16 @@ export interface CryptoKeyArbitraryKeyAlgorithm {
1575
1575
  export declare class DigestStream extends WritableStream<
1576
1576
  ArrayBuffer | ArrayBufferView
1577
1577
  > {
1578
- constructor(algorithm: string | SubtleCryptoHashAlgorithm);
1578
+ constructor(
1579
+ algorithm: string | SubtleCryptoHashAlgorithm,
1580
+ options?: DigestStreamOptions,
1581
+ );
1579
1582
  readonly digest: Promise<ArrayBuffer>;
1580
1583
  get bytesWritten(): number | bigint;
1581
1584
  }
1585
+ export interface DigestStreamOptions {
1586
+ toWellFormed?: boolean;
1587
+ }
1582
1588
  /**
1583
1589
  * The **`TextDecoder`** interface represents a decoder for a specific text encoding, such as UTF-8, ISO-8859-2, or GBK. A decoder takes an array of bytes as input and returns a JavaScript string.
1584
1590
  *
@@ -12525,11 +12531,25 @@ export type BrowserRunJsonOptions = BrowserRunCommonOptions &
12525
12531
  );
12526
12532
  export type BrowserRunContentOptions = BrowserRunCommonOptions;
12527
12533
  export type BrowserRunMarkdownOptions = BrowserRunCommonOptions;
12534
+ export type BrowserRunRedirectHop = {
12535
+ /** URL that returned the redirect. */
12536
+ url: string;
12537
+ /** HTTP status of the redirect. */
12538
+ status: number;
12539
+ /** Redirect response headers, including `location`. */
12540
+ headers: Record<string, string>;
12541
+ };
12528
12542
  export type BrowserRunResponseMeta = {
12529
12543
  /** HTTP status code of the rendered page */
12530
12544
  status: number;
12531
12545
  /** Page title */
12532
12546
  title: string;
12547
+ /** Origin response headers, lowercased. Repeated headers are joined with a newline. Credential and transport-only headers that do not survive rendering are omitted. */
12548
+ headers?: Record<string, string>;
12549
+ /** URL that served the response, after any redirects the browser followed. */
12550
+ finalUrl?: string;
12551
+ /** HTTP redirects followed to reach `finalUrl`, oldest first. Omitted for direct navigation and for client-side redirects such as meta refresh. An empty array means redirects occurred but their intermediate responses could not be read. */
12552
+ redirectChain?: BrowserRunRedirectHop[];
12533
12553
  };
12534
12554
  /**
12535
12555
  * A node in the page's accessibility tree, as exposed to assistive technology.
@@ -12595,6 +12615,7 @@ export type BrowserRunLinksSuccessResponse = {
12595
12615
  success: true;
12596
12616
  /** Extracted links */
12597
12617
  result: string[];
12618
+ meta: BrowserRunResponseMeta;
12598
12619
  };
12599
12620
  /** Success response for `scrape` action. */
12600
12621
  export type BrowserRunScrapeSuccessResponse = {
@@ -12625,6 +12646,7 @@ export type BrowserRunScrapeSuccessResponse = {
12625
12646
  }>;
12626
12647
  }>;
12627
12648
  }>;
12649
+ meta: BrowserRunResponseMeta;
12628
12650
  };
12629
12651
  /** Success response for `snapshot` action. Each field is present only when the
12630
12652
  * corresponding entry was requested in `formats`.
@@ -12659,12 +12681,14 @@ export type BrowserRunJsonSuccessResponse = {
12659
12681
  success: true;
12660
12682
  /** JSON data extracted from the page using an AI model */
12661
12683
  result: Record<string, unknown>;
12684
+ meta: BrowserRunResponseMeta;
12662
12685
  };
12663
12686
  /** Success response for `markdown` action. */
12664
12687
  export type BrowserRunMarkdownSuccessResponse = {
12665
12688
  success: true;
12666
12689
  /** Extracted markdown content */
12667
12690
  result: string;
12691
+ meta: BrowserRunResponseMeta;
12668
12692
  };
12669
12693
  /** Error response for BrowserRun actions. */
12670
12694
  export type BrowserRunErrorResponse = {
package/package.json CHANGED
@@ -7,5 +7,5 @@
7
7
  },
8
8
  "author": "Cloudflare Workers DevProd Team <workers-devprod@cloudflare.com> (https://workers.cloudflare.com)",
9
9
  "license": "MIT OR Apache-2.0",
10
- "version": "5.20260825.1"
10
+ "version": "5.20260826.1"
11
11
  }