@cloudflare/workers-types 5.20260828.1 → 5.20260829.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.
@@ -12805,6 +12805,15 @@ interface BrowserRunBaseOptions {
12805
12805
  */
12806
12806
  cacheTTL?: number;
12807
12807
  }
12808
+ /**
12809
+ * Backend selection, mixed into the options of the quick actions that support it.
12810
+ * Deliberately not part of `BrowserRunBaseOptions`: `scrape`, `links` and `snapshot`
12811
+ * reject an alternate backend, so they must not accept the field.
12812
+ */
12813
+ interface BrowserRunAlternateBackendOptions {
12814
+ /** Render with an alternate browser backend instead of the default one. */
12815
+ browser?: "kitesurf";
12816
+ }
12808
12817
  /** Common options shared by all quick actions. Exactly one of `url` or `html` must be provided.*/
12809
12818
  type BrowserRunCommonOptions =
12810
12819
  | (BrowserRunBaseOptions & {
@@ -12841,7 +12850,7 @@ type BrowserRunScreenshotOptions = BrowserRunCommonOptions & {
12841
12850
  scrollPage?: boolean;
12842
12851
  /** @see https://pptr.dev/api/puppeteer.screenshotoptions */
12843
12852
  screenshotOptions?: BrowserRunPuppeteerScreenshotOptions;
12844
- };
12853
+ } & BrowserRunAlternateBackendOptions;
12845
12854
  type BrowserRunPDFOptions = BrowserRunCommonOptions & {
12846
12855
  /** @see https://pptr.dev/api/puppeteer.pdfoptions */
12847
12856
  pdfOptions?: {
@@ -12888,7 +12897,7 @@ type BrowserRunPDFOptions = BrowserRunCommonOptions & {
12888
12897
  /** @default 30000 */
12889
12898
  timeout?: number;
12890
12899
  };
12891
- };
12900
+ } & BrowserRunAlternateBackendOptions;
12892
12901
  type BrowserRunScrapeOptions = BrowserRunCommonOptions & {
12893
12902
  /** CSS selectors to scrape. At least one element is required. */
12894
12903
  elements: Array<{
@@ -12924,7 +12933,7 @@ type BrowserRunAccessibilityTreeOptions = BrowserRunCommonOptions & {
12924
12933
  * HTTP 200; a malformed selector is an error.
12925
12934
  */
12926
12935
  root?: string;
12927
- };
12936
+ } & BrowserRunAlternateBackendOptions;
12928
12937
  interface BrowserRunJsonBaseOptions {
12929
12938
  /** Custom AI models to try in order. Max 3. Falls back to next on error. */
12930
12939
  custom_ai?: Array<{
@@ -12939,6 +12948,7 @@ interface BrowserRunJsonBaseOptions {
12939
12948
  * At least one of `prompt` or `response_format` must be provided.
12940
12949
  */
12941
12950
  type BrowserRunJsonOptions = BrowserRunCommonOptions &
12951
+ BrowserRunAlternateBackendOptions &
12942
12952
  BrowserRunJsonBaseOptions &
12943
12953
  (
12944
12954
  | {
@@ -12954,8 +12964,10 @@ type BrowserRunJsonOptions = BrowserRunCommonOptions &
12954
12964
  response_format: AiTextGenerationResponseFormat;
12955
12965
  }
12956
12966
  );
12957
- type BrowserRunContentOptions = BrowserRunCommonOptions;
12958
- type BrowserRunMarkdownOptions = BrowserRunCommonOptions;
12967
+ type BrowserRunContentOptions = BrowserRunCommonOptions &
12968
+ BrowserRunAlternateBackendOptions;
12969
+ type BrowserRunMarkdownOptions = BrowserRunCommonOptions &
12970
+ BrowserRunAlternateBackendOptions;
12959
12971
  type BrowserRunRedirectHop = {
12960
12972
  /** URL that returned the redirect. */
12961
12973
  url: string;
@@ -14976,6 +14988,78 @@ interface Hyperdrive {
14976
14988
  */
14977
14989
  readonly database: string;
14978
14990
  }
14991
+ /**
14992
+ * A handle to a dynamically-provisioned Hyperdrive connection, returned by
14993
+ * `HyperdriveApi.get()`.
14994
+ */
14995
+ interface HyperdriveDynamic extends Disposable {
14996
+ /**
14997
+ * The database name to use when connecting through this Hyperdrive.
14998
+ */
14999
+ readonly database: Promise<string>;
15000
+ /*
15001
+ * The randomly generated user to use when authenticating to your
15002
+ * database via Hyperdrive.
15003
+ */
15004
+ readonly user: Promise<string>;
15005
+ /*
15006
+ * The randomly generated password to use when authenticating to your
15007
+ * database via Hyperdrive.
15008
+ */
15009
+ readonly password: Promise<string>;
15010
+ /**
15011
+ * Open a TCP socket to the target database through this Hyperdrive.
15012
+ *
15013
+ */
15014
+ connect(): Promise<Socket>;
15015
+ }
15016
+ /**
15017
+ * Binding that provisions Hyperdrive connections at request time, rather than
15018
+ * from static configuration.
15019
+ */
15020
+ interface HyperdriveDynamicApi {
15021
+ /**
15022
+ * Provision a connection for the database described by `args`.
15023
+ *
15024
+ */
15025
+ get(args: HyperdriveDynamicConfig): Promise<HyperdriveDynamic>;
15026
+ /**
15027
+ * Get a pre-generated connection string used for connecting to dynamic Hyperdrive.
15028
+ */
15029
+ getHyperdriveConnectionString(connectionString: string): Promise<string>;
15030
+ }
15031
+ /**
15032
+ * Parameters identifying the database that a dynamically-provisioned
15033
+ * Hyperdrive connection should target.
15034
+ */
15035
+ interface HyperdriveDynamicConfig {
15036
+ /**
15037
+ * Generated connection string to pass into the dynamic worker.
15038
+ *
15039
+ */
15040
+ dynamicHyperdriveConnectionString: string;
15041
+ /**
15042
+ * Connection string for the origin database Hyperdrive should connect to.
15043
+ * Contains credentials, so treat it as a secret.
15044
+ *
15045
+ * The scheme selects the database engine. PostgreSQL origins are supported.
15046
+ */
15047
+ connectionString: string;
15048
+ /**
15049
+ * Region in which to place the connection pool. See the Hyperdrive
15050
+ * documentation for the set of supported regions.
15051
+ */
15052
+ targetRegion: string;
15053
+ /**
15054
+ * Whether Hyperdrive should cache query results for this connection.
15055
+ */
15056
+ cachingEnabled?: boolean;
15057
+ /**
15058
+ * Maximum number of connections the pool may open to the origin database.
15059
+ * Defaults to 60.
15060
+ */
15061
+ maxConnections?: number;
15062
+ }
14979
15063
  // Copyright (c) 2024 Cloudflare, Inc.
14980
15064
  // Licensed under the Apache 2.0 license found in the LICENSE file or at:
14981
15065
  // https://opensource.org/licenses/Apache-2.0
@@ -12819,6 +12819,15 @@ export interface BrowserRunBaseOptions {
12819
12819
  */
12820
12820
  cacheTTL?: number;
12821
12821
  }
12822
+ /**
12823
+ * Backend selection, mixed into the options of the quick actions that support it.
12824
+ * Deliberately not part of `BrowserRunBaseOptions`: `scrape`, `links` and `snapshot`
12825
+ * reject an alternate backend, so they must not accept the field.
12826
+ */
12827
+ export interface BrowserRunAlternateBackendOptions {
12828
+ /** Render with an alternate browser backend instead of the default one. */
12829
+ browser?: "kitesurf";
12830
+ }
12822
12831
  /** Common options shared by all quick actions. Exactly one of `url` or `html` must be provided.*/
12823
12832
  export type BrowserRunCommonOptions =
12824
12833
  | (BrowserRunBaseOptions & {
@@ -12855,7 +12864,7 @@ export type BrowserRunScreenshotOptions = BrowserRunCommonOptions & {
12855
12864
  scrollPage?: boolean;
12856
12865
  /** @see https://pptr.dev/api/puppeteer.screenshotoptions */
12857
12866
  screenshotOptions?: BrowserRunPuppeteerScreenshotOptions;
12858
- };
12867
+ } & BrowserRunAlternateBackendOptions;
12859
12868
  export type BrowserRunPDFOptions = BrowserRunCommonOptions & {
12860
12869
  /** @see https://pptr.dev/api/puppeteer.pdfoptions */
12861
12870
  pdfOptions?: {
@@ -12902,7 +12911,7 @@ export type BrowserRunPDFOptions = BrowserRunCommonOptions & {
12902
12911
  /** @default 30000 */
12903
12912
  timeout?: number;
12904
12913
  };
12905
- };
12914
+ } & BrowserRunAlternateBackendOptions;
12906
12915
  export type BrowserRunScrapeOptions = BrowserRunCommonOptions & {
12907
12916
  /** CSS selectors to scrape. At least one element is required. */
12908
12917
  elements: Array<{
@@ -12938,7 +12947,7 @@ export type BrowserRunAccessibilityTreeOptions = BrowserRunCommonOptions & {
12938
12947
  * HTTP 200; a malformed selector is an error.
12939
12948
  */
12940
12949
  root?: string;
12941
- };
12950
+ } & BrowserRunAlternateBackendOptions;
12942
12951
  export interface BrowserRunJsonBaseOptions {
12943
12952
  /** Custom AI models to try in order. Max 3. Falls back to next on error. */
12944
12953
  custom_ai?: Array<{
@@ -12953,6 +12962,7 @@ export interface BrowserRunJsonBaseOptions {
12953
12962
  * At least one of `prompt` or `response_format` must be provided.
12954
12963
  */
12955
12964
  export type BrowserRunJsonOptions = BrowserRunCommonOptions &
12965
+ BrowserRunAlternateBackendOptions &
12956
12966
  BrowserRunJsonBaseOptions &
12957
12967
  (
12958
12968
  | {
@@ -12968,8 +12978,10 @@ export type BrowserRunJsonOptions = BrowserRunCommonOptions &
12968
12978
  response_format: AiTextGenerationResponseFormat;
12969
12979
  }
12970
12980
  );
12971
- export type BrowserRunContentOptions = BrowserRunCommonOptions;
12972
- export type BrowserRunMarkdownOptions = BrowserRunCommonOptions;
12981
+ export type BrowserRunContentOptions = BrowserRunCommonOptions &
12982
+ BrowserRunAlternateBackendOptions;
12983
+ export type BrowserRunMarkdownOptions = BrowserRunCommonOptions &
12984
+ BrowserRunAlternateBackendOptions;
12973
12985
  export type BrowserRunRedirectHop = {
12974
12986
  /** URL that returned the redirect. */
12975
12987
  url: string;
@@ -14993,6 +15005,78 @@ export interface Hyperdrive {
14993
15005
  */
14994
15006
  readonly database: string;
14995
15007
  }
15008
+ /**
15009
+ * A handle to a dynamically-provisioned Hyperdrive connection, returned by
15010
+ * `HyperdriveApi.get()`.
15011
+ */
15012
+ export interface HyperdriveDynamic extends Disposable {
15013
+ /**
15014
+ * The database name to use when connecting through this Hyperdrive.
15015
+ */
15016
+ readonly database: Promise<string>;
15017
+ /*
15018
+ * The randomly generated user to use when authenticating to your
15019
+ * database via Hyperdrive.
15020
+ */
15021
+ readonly user: Promise<string>;
15022
+ /*
15023
+ * The randomly generated password to use when authenticating to your
15024
+ * database via Hyperdrive.
15025
+ */
15026
+ readonly password: Promise<string>;
15027
+ /**
15028
+ * Open a TCP socket to the target database through this Hyperdrive.
15029
+ *
15030
+ */
15031
+ connect(): Promise<Socket>;
15032
+ }
15033
+ /**
15034
+ * Binding that provisions Hyperdrive connections at request time, rather than
15035
+ * from static configuration.
15036
+ */
15037
+ export interface HyperdriveDynamicApi {
15038
+ /**
15039
+ * Provision a connection for the database described by `args`.
15040
+ *
15041
+ */
15042
+ get(args: HyperdriveDynamicConfig): Promise<HyperdriveDynamic>;
15043
+ /**
15044
+ * Get a pre-generated connection string used for connecting to dynamic Hyperdrive.
15045
+ */
15046
+ getHyperdriveConnectionString(connectionString: string): Promise<string>;
15047
+ }
15048
+ /**
15049
+ * Parameters identifying the database that a dynamically-provisioned
15050
+ * Hyperdrive connection should target.
15051
+ */
15052
+ export interface HyperdriveDynamicConfig {
15053
+ /**
15054
+ * Generated connection string to pass into the dynamic worker.
15055
+ *
15056
+ */
15057
+ dynamicHyperdriveConnectionString: string;
15058
+ /**
15059
+ * Connection string for the origin database Hyperdrive should connect to.
15060
+ * Contains credentials, so treat it as a secret.
15061
+ *
15062
+ * The scheme selects the database engine. PostgreSQL origins are supported.
15063
+ */
15064
+ connectionString: string;
15065
+ /**
15066
+ * Region in which to place the connection pool. See the Hyperdrive
15067
+ * documentation for the set of supported regions.
15068
+ */
15069
+ targetRegion: string;
15070
+ /**
15071
+ * Whether Hyperdrive should cache query results for this connection.
15072
+ */
15073
+ cachingEnabled?: boolean;
15074
+ /**
15075
+ * Maximum number of connections the pool may open to the origin database.
15076
+ * Defaults to 60.
15077
+ */
15078
+ maxConnections?: number;
15079
+ }
14996
15080
  // Copyright (c) 2024 Cloudflare, Inc.
14997
15081
  // Licensed under the Apache 2.0 license found in the LICENSE file or at:
14998
15082
  // https://opensource.org/licenses/Apache-2.0
package/index.d.ts CHANGED
@@ -12530,6 +12530,15 @@ interface BrowserRunBaseOptions {
12530
12530
  */
12531
12531
  cacheTTL?: number;
12532
12532
  }
12533
+ /**
12534
+ * Backend selection, mixed into the options of the quick actions that support it.
12535
+ * Deliberately not part of `BrowserRunBaseOptions`: `scrape`, `links` and `snapshot`
12536
+ * reject an alternate backend, so they must not accept the field.
12537
+ */
12538
+ interface BrowserRunAlternateBackendOptions {
12539
+ /** Render with an alternate browser backend instead of the default one. */
12540
+ browser?: "kitesurf";
12541
+ }
12533
12542
  /** Common options shared by all quick actions. Exactly one of `url` or `html` must be provided.*/
12534
12543
  type BrowserRunCommonOptions =
12535
12544
  | (BrowserRunBaseOptions & {
@@ -12566,7 +12575,7 @@ type BrowserRunScreenshotOptions = BrowserRunCommonOptions & {
12566
12575
  scrollPage?: boolean;
12567
12576
  /** @see https://pptr.dev/api/puppeteer.screenshotoptions */
12568
12577
  screenshotOptions?: BrowserRunPuppeteerScreenshotOptions;
12569
- };
12578
+ } & BrowserRunAlternateBackendOptions;
12570
12579
  type BrowserRunPDFOptions = BrowserRunCommonOptions & {
12571
12580
  /** @see https://pptr.dev/api/puppeteer.pdfoptions */
12572
12581
  pdfOptions?: {
@@ -12613,7 +12622,7 @@ type BrowserRunPDFOptions = BrowserRunCommonOptions & {
12613
12622
  /** @default 30000 */
12614
12623
  timeout?: number;
12615
12624
  };
12616
- };
12625
+ } & BrowserRunAlternateBackendOptions;
12617
12626
  type BrowserRunScrapeOptions = BrowserRunCommonOptions & {
12618
12627
  /** CSS selectors to scrape. At least one element is required. */
12619
12628
  elements: Array<{
@@ -12649,7 +12658,7 @@ type BrowserRunAccessibilityTreeOptions = BrowserRunCommonOptions & {
12649
12658
  * HTTP 200; a malformed selector is an error.
12650
12659
  */
12651
12660
  root?: string;
12652
- };
12661
+ } & BrowserRunAlternateBackendOptions;
12653
12662
  interface BrowserRunJsonBaseOptions {
12654
12663
  /** Custom AI models to try in order. Max 3. Falls back to next on error. */
12655
12664
  custom_ai?: Array<{
@@ -12664,6 +12673,7 @@ interface BrowserRunJsonBaseOptions {
12664
12673
  * At least one of `prompt` or `response_format` must be provided.
12665
12674
  */
12666
12675
  type BrowserRunJsonOptions = BrowserRunCommonOptions &
12676
+ BrowserRunAlternateBackendOptions &
12667
12677
  BrowserRunJsonBaseOptions &
12668
12678
  (
12669
12679
  | {
@@ -12679,8 +12689,10 @@ type BrowserRunJsonOptions = BrowserRunCommonOptions &
12679
12689
  response_format: AiTextGenerationResponseFormat;
12680
12690
  }
12681
12691
  );
12682
- type BrowserRunContentOptions = BrowserRunCommonOptions;
12683
- type BrowserRunMarkdownOptions = BrowserRunCommonOptions;
12692
+ type BrowserRunContentOptions = BrowserRunCommonOptions &
12693
+ BrowserRunAlternateBackendOptions;
12694
+ type BrowserRunMarkdownOptions = BrowserRunCommonOptions &
12695
+ BrowserRunAlternateBackendOptions;
12684
12696
  type BrowserRunRedirectHop = {
12685
12697
  /** URL that returned the redirect. */
12686
12698
  url: string;
@@ -14701,6 +14713,78 @@ interface Hyperdrive {
14701
14713
  */
14702
14714
  readonly database: string;
14703
14715
  }
14716
+ /**
14717
+ * A handle to a dynamically-provisioned Hyperdrive connection, returned by
14718
+ * `HyperdriveApi.get()`.
14719
+ */
14720
+ interface HyperdriveDynamic extends Disposable {
14721
+ /**
14722
+ * The database name to use when connecting through this Hyperdrive.
14723
+ */
14724
+ readonly database: Promise<string>;
14725
+ /*
14726
+ * The randomly generated user to use when authenticating to your
14727
+ * database via Hyperdrive.
14728
+ */
14729
+ readonly user: Promise<string>;
14730
+ /*
14731
+ * The randomly generated password to use when authenticating to your
14732
+ * database via Hyperdrive.
14733
+ */
14734
+ readonly password: Promise<string>;
14735
+ /**
14736
+ * Open a TCP socket to the target database through this Hyperdrive.
14737
+ *
14738
+ */
14739
+ connect(): Promise<Socket>;
14740
+ }
14741
+ /**
14742
+ * Binding that provisions Hyperdrive connections at request time, rather than
14743
+ * from static configuration.
14744
+ */
14745
+ interface HyperdriveDynamicApi {
14746
+ /**
14747
+ * Provision a connection for the database described by `args`.
14748
+ *
14749
+ */
14750
+ get(args: HyperdriveDynamicConfig): Promise<HyperdriveDynamic>;
14751
+ /**
14752
+ * Get a pre-generated connection string used for connecting to dynamic Hyperdrive.
14753
+ */
14754
+ getHyperdriveConnectionString(connectionString: string): Promise<string>;
14755
+ }
14756
+ /**
14757
+ * Parameters identifying the database that a dynamically-provisioned
14758
+ * Hyperdrive connection should target.
14759
+ */
14760
+ interface HyperdriveDynamicConfig {
14761
+ /**
14762
+ * Generated connection string to pass into the dynamic worker.
14763
+ *
14764
+ */
14765
+ dynamicHyperdriveConnectionString: string;
14766
+ /**
14767
+ * Connection string for the origin database Hyperdrive should connect to.
14768
+ * Contains credentials, so treat it as a secret.
14769
+ *
14770
+ * The scheme selects the database engine. PostgreSQL origins are supported.
14771
+ */
14772
+ connectionString: string;
14773
+ /**
14774
+ * Region in which to place the connection pool. See the Hyperdrive
14775
+ * documentation for the set of supported regions.
14776
+ */
14777
+ targetRegion: string;
14778
+ /**
14779
+ * Whether Hyperdrive should cache query results for this connection.
14780
+ */
14781
+ cachingEnabled?: boolean;
14782
+ /**
14783
+ * Maximum number of connections the pool may open to the origin database.
14784
+ * Defaults to 60.
14785
+ */
14786
+ maxConnections?: number;
14787
+ }
14704
14788
  // Copyright (c) 2024 Cloudflare, Inc.
14705
14789
  // Licensed under the Apache 2.0 license found in the LICENSE file or at:
14706
14790
  // https://opensource.org/licenses/Apache-2.0
package/index.ts CHANGED
@@ -12544,6 +12544,15 @@ export interface BrowserRunBaseOptions {
12544
12544
  */
12545
12545
  cacheTTL?: number;
12546
12546
  }
12547
+ /**
12548
+ * Backend selection, mixed into the options of the quick actions that support it.
12549
+ * Deliberately not part of `BrowserRunBaseOptions`: `scrape`, `links` and `snapshot`
12550
+ * reject an alternate backend, so they must not accept the field.
12551
+ */
12552
+ export interface BrowserRunAlternateBackendOptions {
12553
+ /** Render with an alternate browser backend instead of the default one. */
12554
+ browser?: "kitesurf";
12555
+ }
12547
12556
  /** Common options shared by all quick actions. Exactly one of `url` or `html` must be provided.*/
12548
12557
  export type BrowserRunCommonOptions =
12549
12558
  | (BrowserRunBaseOptions & {
@@ -12580,7 +12589,7 @@ export type BrowserRunScreenshotOptions = BrowserRunCommonOptions & {
12580
12589
  scrollPage?: boolean;
12581
12590
  /** @see https://pptr.dev/api/puppeteer.screenshotoptions */
12582
12591
  screenshotOptions?: BrowserRunPuppeteerScreenshotOptions;
12583
- };
12592
+ } & BrowserRunAlternateBackendOptions;
12584
12593
  export type BrowserRunPDFOptions = BrowserRunCommonOptions & {
12585
12594
  /** @see https://pptr.dev/api/puppeteer.pdfoptions */
12586
12595
  pdfOptions?: {
@@ -12627,7 +12636,7 @@ export type BrowserRunPDFOptions = BrowserRunCommonOptions & {
12627
12636
  /** @default 30000 */
12628
12637
  timeout?: number;
12629
12638
  };
12630
- };
12639
+ } & BrowserRunAlternateBackendOptions;
12631
12640
  export type BrowserRunScrapeOptions = BrowserRunCommonOptions & {
12632
12641
  /** CSS selectors to scrape. At least one element is required. */
12633
12642
  elements: Array<{
@@ -12663,7 +12672,7 @@ export type BrowserRunAccessibilityTreeOptions = BrowserRunCommonOptions & {
12663
12672
  * HTTP 200; a malformed selector is an error.
12664
12673
  */
12665
12674
  root?: string;
12666
- };
12675
+ } & BrowserRunAlternateBackendOptions;
12667
12676
  export interface BrowserRunJsonBaseOptions {
12668
12677
  /** Custom AI models to try in order. Max 3. Falls back to next on error. */
12669
12678
  custom_ai?: Array<{
@@ -12678,6 +12687,7 @@ export interface BrowserRunJsonBaseOptions {
12678
12687
  * At least one of `prompt` or `response_format` must be provided.
12679
12688
  */
12680
12689
  export type BrowserRunJsonOptions = BrowserRunCommonOptions &
12690
+ BrowserRunAlternateBackendOptions &
12681
12691
  BrowserRunJsonBaseOptions &
12682
12692
  (
12683
12693
  | {
@@ -12693,8 +12703,10 @@ export type BrowserRunJsonOptions = BrowserRunCommonOptions &
12693
12703
  response_format: AiTextGenerationResponseFormat;
12694
12704
  }
12695
12705
  );
12696
- export type BrowserRunContentOptions = BrowserRunCommonOptions;
12697
- export type BrowserRunMarkdownOptions = BrowserRunCommonOptions;
12706
+ export type BrowserRunContentOptions = BrowserRunCommonOptions &
12707
+ BrowserRunAlternateBackendOptions;
12708
+ export type BrowserRunMarkdownOptions = BrowserRunCommonOptions &
12709
+ BrowserRunAlternateBackendOptions;
12698
12710
  export type BrowserRunRedirectHop = {
12699
12711
  /** URL that returned the redirect. */
12700
12712
  url: string;
@@ -14718,6 +14730,78 @@ export interface Hyperdrive {
14718
14730
  */
14719
14731
  readonly database: string;
14720
14732
  }
14733
+ /**
14734
+ * A handle to a dynamically-provisioned Hyperdrive connection, returned by
14735
+ * `HyperdriveApi.get()`.
14736
+ */
14737
+ export interface HyperdriveDynamic extends Disposable {
14738
+ /**
14739
+ * The database name to use when connecting through this Hyperdrive.
14740
+ */
14741
+ readonly database: Promise<string>;
14742
+ /*
14743
+ * The randomly generated user to use when authenticating to your
14744
+ * database via Hyperdrive.
14745
+ */
14746
+ readonly user: Promise<string>;
14747
+ /*
14748
+ * The randomly generated password to use when authenticating to your
14749
+ * database via Hyperdrive.
14750
+ */
14751
+ readonly password: Promise<string>;
14752
+ /**
14753
+ * Open a TCP socket to the target database through this Hyperdrive.
14754
+ *
14755
+ */
14756
+ connect(): Promise<Socket>;
14757
+ }
14758
+ /**
14759
+ * Binding that provisions Hyperdrive connections at request time, rather than
14760
+ * from static configuration.
14761
+ */
14762
+ export interface HyperdriveDynamicApi {
14763
+ /**
14764
+ * Provision a connection for the database described by `args`.
14765
+ *
14766
+ */
14767
+ get(args: HyperdriveDynamicConfig): Promise<HyperdriveDynamic>;
14768
+ /**
14769
+ * Get a pre-generated connection string used for connecting to dynamic Hyperdrive.
14770
+ */
14771
+ getHyperdriveConnectionString(connectionString: string): Promise<string>;
14772
+ }
14773
+ /**
14774
+ * Parameters identifying the database that a dynamically-provisioned
14775
+ * Hyperdrive connection should target.
14776
+ */
14777
+ export interface HyperdriveDynamicConfig {
14778
+ /**
14779
+ * Generated connection string to pass into the dynamic worker.
14780
+ *
14781
+ */
14782
+ dynamicHyperdriveConnectionString: string;
14783
+ /**
14784
+ * Connection string for the origin database Hyperdrive should connect to.
14785
+ * Contains credentials, so treat it as a secret.
14786
+ *
14787
+ * The scheme selects the database engine. PostgreSQL origins are supported.
14788
+ */
14789
+ connectionString: string;
14790
+ /**
14791
+ * Region in which to place the connection pool. See the Hyperdrive
14792
+ * documentation for the set of supported regions.
14793
+ */
14794
+ targetRegion: string;
14795
+ /**
14796
+ * Whether Hyperdrive should cache query results for this connection.
14797
+ */
14798
+ cachingEnabled?: boolean;
14799
+ /**
14800
+ * Maximum number of connections the pool may open to the origin database.
14801
+ * Defaults to 60.
14802
+ */
14803
+ maxConnections?: number;
14804
+ }
14721
14805
  // Copyright (c) 2024 Cloudflare, Inc.
14722
14806
  // Licensed under the Apache 2.0 license found in the LICENSE file or at:
14723
14807
  // https://opensource.org/licenses/Apache-2.0
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.20260828.1"
10
+ "version": "5.20260829.1"
11
11
  }