@cloudflare/workers-types 5.20261123.1 → 5.20261124.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.
@@ -3624,12 +3624,16 @@ interface SqlStorage {
3624
3624
  }
3625
3625
  declare abstract class SqlStorageStatement {}
3626
3626
  type SqlStorageValue = ArrayBuffer | string | number | null;
3627
+ interface SqlStorageCursor<
3628
+ T extends Record<string, SqlStorageValue>,
3629
+ > extends Disposable {}
3627
3630
  declare abstract class SqlStorageCursor<
3628
3631
  T extends Record<string, SqlStorageValue>,
3629
3632
  > {
3630
3633
  next(): IteratorResult<T, undefined>;
3631
3634
  toArray(): T[];
3632
3635
  one(): T;
3636
+ close(): void;
3633
3637
  raw<U extends SqlStorageValue[]>(): IterableIterator<U>;
3634
3638
  columnNames: string[];
3635
3639
  get rowsRead(): number;
@@ -13018,16 +13022,49 @@ type BrowserRunLinksOptions = BrowserRunCommonOptions & {
13018
13022
  excludeExternalLinks?: boolean;
13019
13023
  };
13020
13024
  type BrowserRunSnapshotFormat =
13021
- "content" | "screenshot" | "markdown" | "accessibilityTree";
13022
- type BrowserRunSnapshotOptions = BrowserRunCommonOptions & {
13023
- /** Which representations of the page to return. At least two distinct formats
13024
- * are required; request a single format from its dedicated action instead.
13025
- * @default ["content","screenshot"]
13026
- */
13027
- formats?: BrowserRunSnapshotFormat[];
13028
- /** @see https://pptr.dev/api/puppeteer.screenshotoptions */
13029
- screenshotOptions?: Omit<BrowserRunPuppeteerScreenshotOptions, "encoding">;
13030
- };
13025
+ | "content"
13026
+ | "screenshot"
13027
+ | "markdown"
13028
+ | "accessibilityTree"
13029
+ | "pdf"
13030
+ | "links"
13031
+ | "scrape"
13032
+ | "json";
13033
+ type BrowserRunSnapshotOptions = BrowserRunCommonOptions &
13034
+ BrowserRunJsonBaseOptions & {
13035
+ /** Which representations of the page to return. At least two distinct formats
13036
+ * are required; request a single format from its dedicated action instead.
13037
+ * @default ["content","screenshot"]
13038
+ */
13039
+ formats?: BrowserRunSnapshotFormat[];
13040
+ /** @see https://pptr.dev/api/puppeteer.screenshotoptions */
13041
+ screenshotOptions?: Omit<BrowserRunPuppeteerScreenshotOptions, "encoding">;
13042
+ /** CSS selectors to scrape. Required when `formats` includes `scrape`. */
13043
+ elements?: BrowserRunScrapeOptions["elements"];
13044
+ /** @see https://pptr.dev/api/puppeteer.pdfoptions */
13045
+ pdfOptions?: BrowserRunPDFOptions["pdfOptions"];
13046
+ /** When true, only return links that are visible on the page. @default false */
13047
+ visibleLinksOnly?: BrowserRunLinksOptions["visibleLinksOnly"];
13048
+ /** When true, exclude links pointing to external domains. @default false */
13049
+ excludeExternalLinks?: BrowserRunLinksOptions["excludeExternalLinks"];
13050
+ /** When true, prune accessibility nodes that carry no semantic meaning.
13051
+ * @default true
13052
+ */
13053
+ interestingOnly?: BrowserRunAccessibilityTreeOptions["interestingOnly"];
13054
+ /** CSS selector limiting the accessibility tree to the matching element's
13055
+ * subtree.
13056
+ */
13057
+ root?: BrowserRunAccessibilityTreeOptions["root"];
13058
+ /** Natural-language prompt describing what data to extract. Required when
13059
+ * `formats` includes `json`, unless `response_format` is set.
13060
+ */
13061
+ prompt?: string;
13062
+ /** Structured output schema for the AI model. Required when `formats`
13063
+ * includes `json`, unless `prompt` is set.
13064
+ * @see https://developers.cloudflare.com/workers-ai/json-mode/
13065
+ */
13066
+ response_format?: AiTextGenerationResponseFormat;
13067
+ };
13031
13068
  /** Options for the `accessibilityTree` quick action. */
13032
13069
  type BrowserRunAccessibilityTreeOptions = BrowserRunCommonOptions & {
13033
13070
  /** When true, prune nodes that carry no semantic meaning, such as generic
@@ -13205,6 +13242,14 @@ type BrowserRunSnapshotSuccessResponse = {
13205
13242
  markdown?: string;
13206
13243
  /** Root of the page's accessibility tree. */
13207
13244
  accessibilityTree?: BrowserRunSerializedAXNode;
13245
+ /** Base64-encoded PDF. */
13246
+ pdf?: string;
13247
+ /** Links found on the page. */
13248
+ links?: string[];
13249
+ /** Elements matched by the requested selectors. */
13250
+ scrape?: BrowserRunScrapeSuccessResponse["result"];
13251
+ /** JSON data extracted from the page using an AI model. */
13252
+ json?: Record<string, unknown> | unknown[] | null;
13208
13253
  };
13209
13254
  meta: BrowserRunResponseMeta;
13210
13255
  };
@@ -13578,8 +13623,9 @@ declare abstract class BrowserRun {
13578
13623
  /**
13579
13624
  * Get several representations of a web page in one request.
13580
13625
  * @param action - Must be `'snapshot'`.
13581
- * @param options - Snapshot options including the `formats` to return and
13582
- * screenshot settings (encoding is always base64).
13626
+ * @param options - Snapshot options: the `formats` to return, plus the
13627
+ * per-format options for screenshots, PDFs, scraped elements, links, the
13628
+ * accessibility tree, and JSON extraction.
13583
13629
  * @returns A `Response` containing one of:
13584
13630
  *
13585
13631
  * **Success (HTTP 200):**
@@ -15157,15 +15203,15 @@ interface EmailMessage {
15157
15203
  * Envelope To attribute of the email message.
15158
15204
  */
15159
15205
  readonly to: string;
15206
+ /**
15207
+ * Stream of the email message content.
15208
+ */
15209
+ readonly raw: ReadableStream<Uint8Array>;
15160
15210
  }
15161
15211
  /**
15162
15212
  * An email message that is sent to a consumer Worker and can be rejected/forwarded.
15163
15213
  */
15164
15214
  interface ForwardableEmailMessage extends EmailMessage {
15165
- /**
15166
- * Stream of the email message content.
15167
- */
15168
- readonly raw: ReadableStream<Uint8Array>;
15169
15215
  /**
15170
15216
  * An [Headers object](https://developer.mozilla.org/en-US/docs/Web/API/Headers).
15171
15217
  */
@@ -16215,6 +16261,19 @@ declare module "cloudflare:node" {
16215
16261
  ctx?: ExecutionContext,
16216
16262
  ): Promise<void>;
16217
16263
  }
16264
+ /**
16265
+ * An `oidc_token` binding: issues OpenID Connect tokens for the Worker's own
16266
+ * identity, to exchange for cloud credentials or send to an API as a bearer
16267
+ * token. Each binding has one audience, set in its config.
16268
+ */
16269
+ interface OidcTokenBinding {
16270
+ /**
16271
+ * Returns a newly signed JWT for the configured audience, valid for 5
16272
+ * minutes. Each call gets a new `jti`. Call it when you need a token; don't
16273
+ * store the token across requests.
16274
+ */
16275
+ getToken(): Promise<string>;
16276
+ }
16218
16277
  type Params<P extends string = any> = Record<P, string | string[]>;
16219
16278
  type EventContext<Env, P extends string, Data> = {
16220
16279
  request: Request<unknown, IncomingRequestCfProperties<unknown>>;
@@ -16350,6 +16409,381 @@ interface RateLimit {
16350
16409
  */
16351
16410
  limit(options: RateLimitOptions): Promise<RateLimitOutcome>;
16352
16411
  }
16412
+ /** Main interface for creating meetings in the app configured for your binding. */
16413
+ interface RealtimeKitBinding {
16414
+ /**
16415
+ * Creates a meeting and returns its details along with a method for adding
16416
+ * participants.
16417
+ */
16418
+ createMeeting(
16419
+ options?: RealtimeKitCreateMeetingOptions,
16420
+ ): Promise<RealtimeKitMeeting>;
16421
+ }
16422
+ /** Settings for creating a meeting. */
16423
+ interface RealtimeKitCreateMeetingOptions {
16424
+ /** Human-readable meeting title. */
16425
+ title?: string | null;
16426
+ /**
16427
+ * Start recording when a participant joins.
16428
+ * @default false
16429
+ */
16430
+ record_on_start?: boolean | null;
16431
+ /**
16432
+ * Start livestreaming when the meeting starts.
16433
+ * @default false
16434
+ */
16435
+ live_stream_on_start?: boolean | null;
16436
+ /** Meeting recording settings, which take precedence over app settings. */
16437
+ recording_config?: RealtimeKitRecordingConfig;
16438
+ /** Transcription and summarization settings. */
16439
+ ai_config?: RealtimeKitAIConfig;
16440
+ /**
16441
+ * Retain meeting chat for a week.
16442
+ * @default false
16443
+ */
16444
+ persist_chat?: boolean;
16445
+ /**
16446
+ * Generate a meeting summary; requires transcription.
16447
+ * @default false
16448
+ */
16449
+ summarize_on_end?: boolean;
16450
+ /**
16451
+ * Generate a transcript when the meeting ends.
16452
+ * @default false
16453
+ */
16454
+ transcribe_on_end?: boolean;
16455
+ /**
16456
+ * Seconds a session stays active after its last participant leaves.
16457
+ * Between 60 and 600.
16458
+ * @default 60
16459
+ */
16460
+ session_keep_alive_time_in_secs?: number;
16461
+ }
16462
+ /** Details of the participant to add to a meeting. */
16463
+ interface RealtimeKitAddParticipantOptions {
16464
+ /** Your unique identifier for the participant, such as a user ID or email. */
16465
+ custom_participant_id: string;
16466
+ /** Name of an existing preset to apply, such as group_call_host. */
16467
+ preset_name: string;
16468
+ /** Participant display name. */
16469
+ name?: string | null;
16470
+ /** URL of the participant's profile picture. */
16471
+ picture?: string | null;
16472
+ /** Validity window for the participant authentication token. */
16473
+ token?: RealtimeKitParticipantTokenValidity;
16474
+ }
16475
+ /**
16476
+ * Controls when a participant's join token can be used.
16477
+ * The token is valid from not_before up to, but not including, expires_on.
16478
+ * The validity period cannot exceed 100 days and defaults to 100 days from now.
16479
+ */
16480
+ interface RealtimeKitParticipantTokenValidity {
16481
+ /** RFC 3339 timestamp with a timezone; defaults to now and may be in the past. */
16482
+ not_before?: string;
16483
+ /**
16484
+ * RFC 3339 timestamp with a timezone; must be in the future when issued.
16485
+ * Defaults to not_before plus 100 days.
16486
+ */
16487
+ expires_on?: string;
16488
+ }
16489
+ /** Participant details and the authentication token needed to join the meeting. */
16490
+ interface RealtimeKitParticipant {
16491
+ /** Participant UUID. */
16492
+ id: string;
16493
+ /** The unique participant identifier you provided when adding the participant. */
16494
+ custom_participant_id: string;
16495
+ /** Preset applied to the participant. */
16496
+ preset_name: string;
16497
+ /** Supplied participant display name. */
16498
+ name?: string | null;
16499
+ /** URL of the participant's profile picture. */
16500
+ picture?: string | null;
16501
+ /** When the participant was created, as an ISO date-time string. */
16502
+ created_at: string;
16503
+ /** When the participant was last updated, as an ISO date-time string. */
16504
+ updated_at: string;
16505
+ /** Sensitive authentication token used to join the meeting. Do not log it. */
16506
+ token: string;
16507
+ /** Time from which the token is valid, as a UTC date-time string. */
16508
+ not_before?: string;
16509
+ /** Time at which the token expires, as a UTC date-time string. */
16510
+ expires_on?: string;
16511
+ }
16512
+ /**
16513
+ * Meeting details captured when the meeting was created.
16514
+ * Use addParticipant() to add participants to this meeting.
16515
+ * Use `using` to release the meeting handle when finished.
16516
+ */
16517
+ interface RealtimeKitMeeting extends Disposable {
16518
+ /** Unique identifier of the meeting. */
16519
+ readonly id: string;
16520
+ /** Human-readable meeting title. */
16521
+ title?: string;
16522
+ /** When the meeting was created, as an ISO date-time string. */
16523
+ readonly created_at: string;
16524
+ /** When the meeting was last updated, as an ISO date-time string. */
16525
+ readonly updated_at: string;
16526
+ /** Whether recording starts when a participant joins. */
16527
+ record_on_start?: boolean;
16528
+ /** Whether livestreaming starts when the meeting starts. */
16529
+ live_stream_on_start?: boolean;
16530
+ /** Whether meeting chat persists for a week. */
16531
+ persist_chat?: boolean;
16532
+ /** Whether a meeting summary is generated using transcripts. */
16533
+ summarize_on_end?: boolean;
16534
+ /** Whether a transcript is generated when the meeting ends. */
16535
+ transcribe_on_end?: boolean;
16536
+ /** Recording settings for the meeting. Storage credentials are not included. */
16537
+ recording_config?: RealtimeKitRecordingConfigResponse;
16538
+ /** Transcription and summarization settings. */
16539
+ ai_config?: RealtimeKitAIConfig;
16540
+ /** Participants cannot join an INACTIVE meeting. */
16541
+ status?: "ACTIVE" | "INACTIVE";
16542
+ /**
16543
+ * Session keep-alive duration, 60 to 600 seconds.
16544
+ * @default 60
16545
+ */
16546
+ session_keep_alive_time_in_secs?: number;
16547
+ /**
16548
+ * Adds a participant to this meeting and returns their details and join token.
16549
+ */
16550
+ addParticipant(
16551
+ options: RealtimeKitAddParticipantOptions,
16552
+ ): Promise<RealtimeKitParticipant>;
16553
+ }
16554
+ /** Meeting-level recording settings, overriding the app's recording settings. */
16555
+ interface RealtimeKitRecordingConfig {
16556
+ /** Maximum recording duration in seconds, between 60 and 86400. */
16557
+ max_seconds?: number;
16558
+ /** Prefix added to the recording file name. */
16559
+ file_name_prefix?: string;
16560
+ /** Recorded video encoding, dimensions, and watermark settings. */
16561
+ video_config?: RealtimeKitVideoConfig;
16562
+ /** Recorded audio encoding and channel settings. */
16563
+ audio_config?: RealtimeKitAudioConfig;
16564
+ /** Storage destination and credentials for uploading recordings. */
16565
+ storage_config?: RealtimeKitStorageConfig;
16566
+ /** Whether recordings are uploaded to RealtimeKit's bucket. */
16567
+ realtimekit_bucket_config?: RealtimeKitBucketConfig;
16568
+ /** Destination for live-streaming the recording. */
16569
+ live_streaming_config?: RealtimeKitLivestreamingConfig;
16570
+ }
16571
+ /** Recording settings for a meeting, with storage credentials omitted. */
16572
+ interface RealtimeKitRecordingConfigResponse extends Omit<
16573
+ RealtimeKitRecordingConfig,
16574
+ "storage_config"
16575
+ > {
16576
+ /** Destination storage with access keys, secrets, passwords, and keys omitted. */
16577
+ storage_config?: RealtimeKitStorageConfigResponse;
16578
+ }
16579
+ /** Video settings for meeting recordings. */
16580
+ interface RealtimeKitVideoConfig {
16581
+ /**
16582
+ * Video codec.
16583
+ * @default 'H264'
16584
+ */
16585
+ codec?: "H264" | "VP8" | "VP9";
16586
+ /**
16587
+ * Video width in pixels, between 1 and 1920.
16588
+ * @default 1280
16589
+ */
16590
+ width?: number;
16591
+ /**
16592
+ * Video height in pixels, between 1 and 1920.
16593
+ * @default 720
16594
+ */
16595
+ height?: number;
16596
+ /** Watermark image, dimensions, and placement. */
16597
+ watermark?: {
16598
+ /** URL of the watermark image. */
16599
+ url?: string;
16600
+ /** Watermark dimensions in pixels. */
16601
+ size?: {
16602
+ /** Watermark width; minimum 1 pixel. */
16603
+ width?: number;
16604
+ /** Watermark height; minimum 1 pixel. */
16605
+ height?: number;
16606
+ };
16607
+ /**
16608
+ * Watermark placement.
16609
+ * @default 'left top'
16610
+ */
16611
+ position?: "left top" | "right top" | "left bottom" | "right bottom";
16612
+ };
16613
+ /**
16614
+ * Export a separate video file.
16615
+ * @default true
16616
+ */
16617
+ export_file?: boolean;
16618
+ }
16619
+ /** Audio settings for meeting recordings. */
16620
+ interface RealtimeKitAudioConfig {
16621
+ /**
16622
+ * Audio codec. VP8/VP9 video automatically uses Vorbis audio, and the audio
16623
+ * codec cannot be changed.
16624
+ * @default 'AAC'
16625
+ */
16626
+ codec?: "MP3" | "AAC";
16627
+ /**
16628
+ * Audio channel layout.
16629
+ * @default 'stereo'
16630
+ */
16631
+ channel?: "mono" | "stereo";
16632
+ /**
16633
+ * Export a separate audio file.
16634
+ * @default true
16635
+ */
16636
+ export_file?: boolean;
16637
+ }
16638
+ /** Destination and authentication settings for external recording storage. */
16639
+ interface RealtimeKitStorageConfigBase {
16640
+ /** Destination bucket name. */
16641
+ bucket: string;
16642
+ /**
16643
+ * Storage access key; required and nonempty except for Google Cloud Storage.
16644
+ * Not included in returned storage details.
16645
+ */
16646
+ access_key?: string;
16647
+ /** Secret key for the storage provider. Not included in returned details. */
16648
+ secret?: string;
16649
+ /** Storage region; required and nonempty except for Google Cloud Storage. */
16650
+ region?: string;
16651
+ /** Recording path relative to the bucket root. */
16652
+ path?: string;
16653
+ /** Authentication method for SFTP storage. */
16654
+ auth_method?: "KEY" | "PASSWORD";
16655
+ /** Destination SSH username for SFTP. */
16656
+ username?: string;
16657
+ /**
16658
+ * SFTP login password, or SSH private-key passphrase when using KEY.
16659
+ * Not included in returned storage details.
16660
+ */
16661
+ password?: string;
16662
+ /** Destination SSH hostname for SFTP. */
16663
+ host?: string;
16664
+ /** Destination SSH port for SFTP. */
16665
+ port?: number;
16666
+ /** SSH private key for SFTP key authentication. Not included in returned details. */
16667
+ private_key?: string;
16668
+ }
16669
+ /** Recording destination in Google Cloud Storage, AWS, Azure, DigitalOcean, or SFTP. */
16670
+ type RealtimeKitStorageConfig =
16671
+ | (RealtimeKitStorageConfigBase &
16672
+ (
16673
+ | {
16674
+ type: "gcs";
16675
+ }
16676
+ | {
16677
+ type: "aws" | "azure" | "digitalocean";
16678
+ access_key: string;
16679
+ region: string;
16680
+ }
16681
+ | ({
16682
+ type: "sftp";
16683
+ access_key: string;
16684
+ region: string;
16685
+ username: string;
16686
+ host: string;
16687
+ port: number;
16688
+ } & (
16689
+ | {
16690
+ auth_method: "KEY";
16691
+ private_key: string;
16692
+ }
16693
+ | {
16694
+ auth_method: "PASSWORD";
16695
+ password: string;
16696
+ }
16697
+ ))
16698
+ ))
16699
+ | null;
16700
+ /** Recording destination details, without access keys, secrets, passwords, or private keys. */
16701
+ type RealtimeKitStorageConfigResponse =
16702
+ | (Omit<
16703
+ RealtimeKitStorageConfigBase,
16704
+ "access_key" | "secret" | "password" | "private_key"
16705
+ > &
16706
+ (
16707
+ | {
16708
+ type: "gcs";
16709
+ }
16710
+ | {
16711
+ type: "aws" | "azure" | "digitalocean";
16712
+ region: string;
16713
+ }
16714
+ | {
16715
+ type: "sftp";
16716
+ region: string;
16717
+ auth_method: "KEY" | "PASSWORD";
16718
+ username: string;
16719
+ host: string;
16720
+ port: number;
16721
+ }
16722
+ ))
16723
+ | null;
16724
+ /** Controls uploading recordings to RealtimeKit's managed bucket. */
16725
+ interface RealtimeKitBucketConfig {
16726
+ /**
16727
+ * Enable managed-bucket uploads. If false, recording download URLs and
16728
+ * their expiry are not generated.
16729
+ */
16730
+ enabled: boolean;
16731
+ }
16732
+ /** Live-streaming destination for a recording. */
16733
+ interface RealtimeKitLivestreamingConfig {
16734
+ /** RTMP destination URL. */
16735
+ rtmp_url?: string;
16736
+ }
16737
+ /** Transcription and summary customization for a meeting. */
16738
+ interface RealtimeKitAIConfig {
16739
+ /** Transcription options. */
16740
+ transcription?: RealtimeKitTranscriptionConfig;
16741
+ /** Summary options. */
16742
+ summarization?: RealtimeKitSummarizationConfig;
16743
+ }
16744
+ /** Meeting transcription settings. */
16745
+ interface RealtimeKitTranscriptionConfig {
16746
+ /** Terms to recognize more accurately during transcription. */
16747
+ keywords?: string[];
16748
+ /**
16749
+ * Language used for transcription. If omitted, post-meeting transcription
16750
+ * detects the language automatically.
16751
+ */
16752
+ language?:
16753
+ "en-US" | "en-IN" | "de" | "hi" | "sv" | "ru" | "pl" | "el" | "fr" | "nl";
16754
+ /**
16755
+ * Filter offensive language in transcripts.
16756
+ * @default false
16757
+ */
16758
+ profanity_filter?: boolean;
16759
+ }
16760
+ /** Meeting summarization settings. */
16761
+ interface RealtimeKitSummarizationConfig {
16762
+ /**
16763
+ * Maximum words in the summary, between 150 and 1000.
16764
+ * @default 500
16765
+ */
16766
+ word_limit?: number;
16767
+ /**
16768
+ * Summary text format.
16769
+ * @default 'markdown'
16770
+ */
16771
+ text_format?: "plain_text" | "markdown";
16772
+ /**
16773
+ * Summary style.
16774
+ * @default 'general'
16775
+ */
16776
+ summary_type?:
16777
+ | "general"
16778
+ | "team_meeting"
16779
+ | "sales_call"
16780
+ | "client_check_in"
16781
+ | "interview"
16782
+ | "daily_standup"
16783
+ | "one_on_one_meeting"
16784
+ | "lecture"
16785
+ | "code_review";
16786
+ }
16353
16787
  // Namespace for RPC utility types. Unfortunately, we can't use a `module` here as these types need
16354
16788
  // to referenced by `Fetcher`. This is included in the "importable" version of the types which
16355
16789
  // strips all `module` blocks.