@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.
package/index.d.ts CHANGED
@@ -3460,12 +3460,16 @@ interface SqlStorage {
3460
3460
  }
3461
3461
  declare abstract class SqlStorageStatement {}
3462
3462
  type SqlStorageValue = ArrayBuffer | string | number | null;
3463
+ interface SqlStorageCursor<
3464
+ T extends Record<string, SqlStorageValue>,
3465
+ > extends Disposable {}
3463
3466
  declare abstract class SqlStorageCursor<
3464
3467
  T extends Record<string, SqlStorageValue>,
3465
3468
  > {
3466
3469
  next(): IteratorResult<T, undefined>;
3467
3470
  toArray(): T[];
3468
3471
  one(): T;
3472
+ close(): void;
3469
3473
  raw<U extends SqlStorageValue[]>(): IterableIterator<U>;
3470
3474
  columnNames: string[];
3471
3475
  get rowsRead(): number;
@@ -12650,16 +12654,49 @@ type BrowserRunLinksOptions = BrowserRunCommonOptions & {
12650
12654
  excludeExternalLinks?: boolean;
12651
12655
  };
12652
12656
  type BrowserRunSnapshotFormat =
12653
- "content" | "screenshot" | "markdown" | "accessibilityTree";
12654
- type BrowserRunSnapshotOptions = BrowserRunCommonOptions & {
12655
- /** Which representations of the page to return. At least two distinct formats
12656
- * are required; request a single format from its dedicated action instead.
12657
- * @default ["content","screenshot"]
12658
- */
12659
- formats?: BrowserRunSnapshotFormat[];
12660
- /** @see https://pptr.dev/api/puppeteer.screenshotoptions */
12661
- screenshotOptions?: Omit<BrowserRunPuppeteerScreenshotOptions, "encoding">;
12662
- };
12657
+ | "content"
12658
+ | "screenshot"
12659
+ | "markdown"
12660
+ | "accessibilityTree"
12661
+ | "pdf"
12662
+ | "links"
12663
+ | "scrape"
12664
+ | "json";
12665
+ type BrowserRunSnapshotOptions = BrowserRunCommonOptions &
12666
+ BrowserRunJsonBaseOptions & {
12667
+ /** Which representations of the page to return. At least two distinct formats
12668
+ * are required; request a single format from its dedicated action instead.
12669
+ * @default ["content","screenshot"]
12670
+ */
12671
+ formats?: BrowserRunSnapshotFormat[];
12672
+ /** @see https://pptr.dev/api/puppeteer.screenshotoptions */
12673
+ screenshotOptions?: Omit<BrowserRunPuppeteerScreenshotOptions, "encoding">;
12674
+ /** CSS selectors to scrape. Required when `formats` includes `scrape`. */
12675
+ elements?: BrowserRunScrapeOptions["elements"];
12676
+ /** @see https://pptr.dev/api/puppeteer.pdfoptions */
12677
+ pdfOptions?: BrowserRunPDFOptions["pdfOptions"];
12678
+ /** When true, only return links that are visible on the page. @default false */
12679
+ visibleLinksOnly?: BrowserRunLinksOptions["visibleLinksOnly"];
12680
+ /** When true, exclude links pointing to external domains. @default false */
12681
+ excludeExternalLinks?: BrowserRunLinksOptions["excludeExternalLinks"];
12682
+ /** When true, prune accessibility nodes that carry no semantic meaning.
12683
+ * @default true
12684
+ */
12685
+ interestingOnly?: BrowserRunAccessibilityTreeOptions["interestingOnly"];
12686
+ /** CSS selector limiting the accessibility tree to the matching element's
12687
+ * subtree.
12688
+ */
12689
+ root?: BrowserRunAccessibilityTreeOptions["root"];
12690
+ /** Natural-language prompt describing what data to extract. Required when
12691
+ * `formats` includes `json`, unless `response_format` is set.
12692
+ */
12693
+ prompt?: string;
12694
+ /** Structured output schema for the AI model. Required when `formats`
12695
+ * includes `json`, unless `prompt` is set.
12696
+ * @see https://developers.cloudflare.com/workers-ai/json-mode/
12697
+ */
12698
+ response_format?: AiTextGenerationResponseFormat;
12699
+ };
12663
12700
  /** Options for the `accessibilityTree` quick action. */
12664
12701
  type BrowserRunAccessibilityTreeOptions = BrowserRunCommonOptions & {
12665
12702
  /** When true, prune nodes that carry no semantic meaning, such as generic
@@ -12837,6 +12874,14 @@ type BrowserRunSnapshotSuccessResponse = {
12837
12874
  markdown?: string;
12838
12875
  /** Root of the page's accessibility tree. */
12839
12876
  accessibilityTree?: BrowserRunSerializedAXNode;
12877
+ /** Base64-encoded PDF. */
12878
+ pdf?: string;
12879
+ /** Links found on the page. */
12880
+ links?: string[];
12881
+ /** Elements matched by the requested selectors. */
12882
+ scrape?: BrowserRunScrapeSuccessResponse["result"];
12883
+ /** JSON data extracted from the page using an AI model. */
12884
+ json?: Record<string, unknown> | unknown[] | null;
12840
12885
  };
12841
12886
  meta: BrowserRunResponseMeta;
12842
12887
  };
@@ -13210,8 +13255,9 @@ declare abstract class BrowserRun {
13210
13255
  /**
13211
13256
  * Get several representations of a web page in one request.
13212
13257
  * @param action - Must be `'snapshot'`.
13213
- * @param options - Snapshot options including the `formats` to return and
13214
- * screenshot settings (encoding is always base64).
13258
+ * @param options - Snapshot options: the `formats` to return, plus the
13259
+ * per-format options for screenshots, PDFs, scraped elements, links, the
13260
+ * accessibility tree, and JSON extraction.
13215
13261
  * @returns A `Response` containing one of:
13216
13262
  *
13217
13263
  * **Success (HTTP 200):**
@@ -14789,15 +14835,15 @@ interface EmailMessage {
14789
14835
  * Envelope To attribute of the email message.
14790
14836
  */
14791
14837
  readonly to: string;
14838
+ /**
14839
+ * Stream of the email message content.
14840
+ */
14841
+ readonly raw: ReadableStream<Uint8Array>;
14792
14842
  }
14793
14843
  /**
14794
14844
  * An email message that is sent to a consumer Worker and can be rejected/forwarded.
14795
14845
  */
14796
14846
  interface ForwardableEmailMessage extends EmailMessage {
14797
- /**
14798
- * Stream of the email message content.
14799
- */
14800
- readonly raw: ReadableStream<Uint8Array>;
14801
14847
  /**
14802
14848
  * An [Headers object](https://developer.mozilla.org/en-US/docs/Web/API/Headers).
14803
14849
  */
@@ -15847,6 +15893,19 @@ declare module "cloudflare:node" {
15847
15893
  ctx?: ExecutionContext,
15848
15894
  ): Promise<void>;
15849
15895
  }
15896
+ /**
15897
+ * An `oidc_token` binding: issues OpenID Connect tokens for the Worker's own
15898
+ * identity, to exchange for cloud credentials or send to an API as a bearer
15899
+ * token. Each binding has one audience, set in its config.
15900
+ */
15901
+ interface OidcTokenBinding {
15902
+ /**
15903
+ * Returns a newly signed JWT for the configured audience, valid for 5
15904
+ * minutes. Each call gets a new `jti`. Call it when you need a token; don't
15905
+ * store the token across requests.
15906
+ */
15907
+ getToken(): Promise<string>;
15908
+ }
15850
15909
  type Params<P extends string = any> = Record<P, string | string[]>;
15851
15910
  type EventContext<Env, P extends string, Data> = {
15852
15911
  request: Request<unknown, IncomingRequestCfProperties<unknown>>;
@@ -15982,6 +16041,381 @@ interface RateLimit {
15982
16041
  */
15983
16042
  limit(options: RateLimitOptions): Promise<RateLimitOutcome>;
15984
16043
  }
16044
+ /** Main interface for creating meetings in the app configured for your binding. */
16045
+ interface RealtimeKitBinding {
16046
+ /**
16047
+ * Creates a meeting and returns its details along with a method for adding
16048
+ * participants.
16049
+ */
16050
+ createMeeting(
16051
+ options?: RealtimeKitCreateMeetingOptions,
16052
+ ): Promise<RealtimeKitMeeting>;
16053
+ }
16054
+ /** Settings for creating a meeting. */
16055
+ interface RealtimeKitCreateMeetingOptions {
16056
+ /** Human-readable meeting title. */
16057
+ title?: string | null;
16058
+ /**
16059
+ * Start recording when a participant joins.
16060
+ * @default false
16061
+ */
16062
+ record_on_start?: boolean | null;
16063
+ /**
16064
+ * Start livestreaming when the meeting starts.
16065
+ * @default false
16066
+ */
16067
+ live_stream_on_start?: boolean | null;
16068
+ /** Meeting recording settings, which take precedence over app settings. */
16069
+ recording_config?: RealtimeKitRecordingConfig;
16070
+ /** Transcription and summarization settings. */
16071
+ ai_config?: RealtimeKitAIConfig;
16072
+ /**
16073
+ * Retain meeting chat for a week.
16074
+ * @default false
16075
+ */
16076
+ persist_chat?: boolean;
16077
+ /**
16078
+ * Generate a meeting summary; requires transcription.
16079
+ * @default false
16080
+ */
16081
+ summarize_on_end?: boolean;
16082
+ /**
16083
+ * Generate a transcript when the meeting ends.
16084
+ * @default false
16085
+ */
16086
+ transcribe_on_end?: boolean;
16087
+ /**
16088
+ * Seconds a session stays active after its last participant leaves.
16089
+ * Between 60 and 600.
16090
+ * @default 60
16091
+ */
16092
+ session_keep_alive_time_in_secs?: number;
16093
+ }
16094
+ /** Details of the participant to add to a meeting. */
16095
+ interface RealtimeKitAddParticipantOptions {
16096
+ /** Your unique identifier for the participant, such as a user ID or email. */
16097
+ custom_participant_id: string;
16098
+ /** Name of an existing preset to apply, such as group_call_host. */
16099
+ preset_name: string;
16100
+ /** Participant display name. */
16101
+ name?: string | null;
16102
+ /** URL of the participant's profile picture. */
16103
+ picture?: string | null;
16104
+ /** Validity window for the participant authentication token. */
16105
+ token?: RealtimeKitParticipantTokenValidity;
16106
+ }
16107
+ /**
16108
+ * Controls when a participant's join token can be used.
16109
+ * The token is valid from not_before up to, but not including, expires_on.
16110
+ * The validity period cannot exceed 100 days and defaults to 100 days from now.
16111
+ */
16112
+ interface RealtimeKitParticipantTokenValidity {
16113
+ /** RFC 3339 timestamp with a timezone; defaults to now and may be in the past. */
16114
+ not_before?: string;
16115
+ /**
16116
+ * RFC 3339 timestamp with a timezone; must be in the future when issued.
16117
+ * Defaults to not_before plus 100 days.
16118
+ */
16119
+ expires_on?: string;
16120
+ }
16121
+ /** Participant details and the authentication token needed to join the meeting. */
16122
+ interface RealtimeKitParticipant {
16123
+ /** Participant UUID. */
16124
+ id: string;
16125
+ /** The unique participant identifier you provided when adding the participant. */
16126
+ custom_participant_id: string;
16127
+ /** Preset applied to the participant. */
16128
+ preset_name: string;
16129
+ /** Supplied participant display name. */
16130
+ name?: string | null;
16131
+ /** URL of the participant's profile picture. */
16132
+ picture?: string | null;
16133
+ /** When the participant was created, as an ISO date-time string. */
16134
+ created_at: string;
16135
+ /** When the participant was last updated, as an ISO date-time string. */
16136
+ updated_at: string;
16137
+ /** Sensitive authentication token used to join the meeting. Do not log it. */
16138
+ token: string;
16139
+ /** Time from which the token is valid, as a UTC date-time string. */
16140
+ not_before?: string;
16141
+ /** Time at which the token expires, as a UTC date-time string. */
16142
+ expires_on?: string;
16143
+ }
16144
+ /**
16145
+ * Meeting details captured when the meeting was created.
16146
+ * Use addParticipant() to add participants to this meeting.
16147
+ * Use `using` to release the meeting handle when finished.
16148
+ */
16149
+ interface RealtimeKitMeeting extends Disposable {
16150
+ /** Unique identifier of the meeting. */
16151
+ readonly id: string;
16152
+ /** Human-readable meeting title. */
16153
+ title?: string;
16154
+ /** When the meeting was created, as an ISO date-time string. */
16155
+ readonly created_at: string;
16156
+ /** When the meeting was last updated, as an ISO date-time string. */
16157
+ readonly updated_at: string;
16158
+ /** Whether recording starts when a participant joins. */
16159
+ record_on_start?: boolean;
16160
+ /** Whether livestreaming starts when the meeting starts. */
16161
+ live_stream_on_start?: boolean;
16162
+ /** Whether meeting chat persists for a week. */
16163
+ persist_chat?: boolean;
16164
+ /** Whether a meeting summary is generated using transcripts. */
16165
+ summarize_on_end?: boolean;
16166
+ /** Whether a transcript is generated when the meeting ends. */
16167
+ transcribe_on_end?: boolean;
16168
+ /** Recording settings for the meeting. Storage credentials are not included. */
16169
+ recording_config?: RealtimeKitRecordingConfigResponse;
16170
+ /** Transcription and summarization settings. */
16171
+ ai_config?: RealtimeKitAIConfig;
16172
+ /** Participants cannot join an INACTIVE meeting. */
16173
+ status?: "ACTIVE" | "INACTIVE";
16174
+ /**
16175
+ * Session keep-alive duration, 60 to 600 seconds.
16176
+ * @default 60
16177
+ */
16178
+ session_keep_alive_time_in_secs?: number;
16179
+ /**
16180
+ * Adds a participant to this meeting and returns their details and join token.
16181
+ */
16182
+ addParticipant(
16183
+ options: RealtimeKitAddParticipantOptions,
16184
+ ): Promise<RealtimeKitParticipant>;
16185
+ }
16186
+ /** Meeting-level recording settings, overriding the app's recording settings. */
16187
+ interface RealtimeKitRecordingConfig {
16188
+ /** Maximum recording duration in seconds, between 60 and 86400. */
16189
+ max_seconds?: number;
16190
+ /** Prefix added to the recording file name. */
16191
+ file_name_prefix?: string;
16192
+ /** Recorded video encoding, dimensions, and watermark settings. */
16193
+ video_config?: RealtimeKitVideoConfig;
16194
+ /** Recorded audio encoding and channel settings. */
16195
+ audio_config?: RealtimeKitAudioConfig;
16196
+ /** Storage destination and credentials for uploading recordings. */
16197
+ storage_config?: RealtimeKitStorageConfig;
16198
+ /** Whether recordings are uploaded to RealtimeKit's bucket. */
16199
+ realtimekit_bucket_config?: RealtimeKitBucketConfig;
16200
+ /** Destination for live-streaming the recording. */
16201
+ live_streaming_config?: RealtimeKitLivestreamingConfig;
16202
+ }
16203
+ /** Recording settings for a meeting, with storage credentials omitted. */
16204
+ interface RealtimeKitRecordingConfigResponse extends Omit<
16205
+ RealtimeKitRecordingConfig,
16206
+ "storage_config"
16207
+ > {
16208
+ /** Destination storage with access keys, secrets, passwords, and keys omitted. */
16209
+ storage_config?: RealtimeKitStorageConfigResponse;
16210
+ }
16211
+ /** Video settings for meeting recordings. */
16212
+ interface RealtimeKitVideoConfig {
16213
+ /**
16214
+ * Video codec.
16215
+ * @default 'H264'
16216
+ */
16217
+ codec?: "H264" | "VP8" | "VP9";
16218
+ /**
16219
+ * Video width in pixels, between 1 and 1920.
16220
+ * @default 1280
16221
+ */
16222
+ width?: number;
16223
+ /**
16224
+ * Video height in pixels, between 1 and 1920.
16225
+ * @default 720
16226
+ */
16227
+ height?: number;
16228
+ /** Watermark image, dimensions, and placement. */
16229
+ watermark?: {
16230
+ /** URL of the watermark image. */
16231
+ url?: string;
16232
+ /** Watermark dimensions in pixels. */
16233
+ size?: {
16234
+ /** Watermark width; minimum 1 pixel. */
16235
+ width?: number;
16236
+ /** Watermark height; minimum 1 pixel. */
16237
+ height?: number;
16238
+ };
16239
+ /**
16240
+ * Watermark placement.
16241
+ * @default 'left top'
16242
+ */
16243
+ position?: "left top" | "right top" | "left bottom" | "right bottom";
16244
+ };
16245
+ /**
16246
+ * Export a separate video file.
16247
+ * @default true
16248
+ */
16249
+ export_file?: boolean;
16250
+ }
16251
+ /** Audio settings for meeting recordings. */
16252
+ interface RealtimeKitAudioConfig {
16253
+ /**
16254
+ * Audio codec. VP8/VP9 video automatically uses Vorbis audio, and the audio
16255
+ * codec cannot be changed.
16256
+ * @default 'AAC'
16257
+ */
16258
+ codec?: "MP3" | "AAC";
16259
+ /**
16260
+ * Audio channel layout.
16261
+ * @default 'stereo'
16262
+ */
16263
+ channel?: "mono" | "stereo";
16264
+ /**
16265
+ * Export a separate audio file.
16266
+ * @default true
16267
+ */
16268
+ export_file?: boolean;
16269
+ }
16270
+ /** Destination and authentication settings for external recording storage. */
16271
+ interface RealtimeKitStorageConfigBase {
16272
+ /** Destination bucket name. */
16273
+ bucket: string;
16274
+ /**
16275
+ * Storage access key; required and nonempty except for Google Cloud Storage.
16276
+ * Not included in returned storage details.
16277
+ */
16278
+ access_key?: string;
16279
+ /** Secret key for the storage provider. Not included in returned details. */
16280
+ secret?: string;
16281
+ /** Storage region; required and nonempty except for Google Cloud Storage. */
16282
+ region?: string;
16283
+ /** Recording path relative to the bucket root. */
16284
+ path?: string;
16285
+ /** Authentication method for SFTP storage. */
16286
+ auth_method?: "KEY" | "PASSWORD";
16287
+ /** Destination SSH username for SFTP. */
16288
+ username?: string;
16289
+ /**
16290
+ * SFTP login password, or SSH private-key passphrase when using KEY.
16291
+ * Not included in returned storage details.
16292
+ */
16293
+ password?: string;
16294
+ /** Destination SSH hostname for SFTP. */
16295
+ host?: string;
16296
+ /** Destination SSH port for SFTP. */
16297
+ port?: number;
16298
+ /** SSH private key for SFTP key authentication. Not included in returned details. */
16299
+ private_key?: string;
16300
+ }
16301
+ /** Recording destination in Google Cloud Storage, AWS, Azure, DigitalOcean, or SFTP. */
16302
+ type RealtimeKitStorageConfig =
16303
+ | (RealtimeKitStorageConfigBase &
16304
+ (
16305
+ | {
16306
+ type: "gcs";
16307
+ }
16308
+ | {
16309
+ type: "aws" | "azure" | "digitalocean";
16310
+ access_key: string;
16311
+ region: string;
16312
+ }
16313
+ | ({
16314
+ type: "sftp";
16315
+ access_key: string;
16316
+ region: string;
16317
+ username: string;
16318
+ host: string;
16319
+ port: number;
16320
+ } & (
16321
+ | {
16322
+ auth_method: "KEY";
16323
+ private_key: string;
16324
+ }
16325
+ | {
16326
+ auth_method: "PASSWORD";
16327
+ password: string;
16328
+ }
16329
+ ))
16330
+ ))
16331
+ | null;
16332
+ /** Recording destination details, without access keys, secrets, passwords, or private keys. */
16333
+ type RealtimeKitStorageConfigResponse =
16334
+ | (Omit<
16335
+ RealtimeKitStorageConfigBase,
16336
+ "access_key" | "secret" | "password" | "private_key"
16337
+ > &
16338
+ (
16339
+ | {
16340
+ type: "gcs";
16341
+ }
16342
+ | {
16343
+ type: "aws" | "azure" | "digitalocean";
16344
+ region: string;
16345
+ }
16346
+ | {
16347
+ type: "sftp";
16348
+ region: string;
16349
+ auth_method: "KEY" | "PASSWORD";
16350
+ username: string;
16351
+ host: string;
16352
+ port: number;
16353
+ }
16354
+ ))
16355
+ | null;
16356
+ /** Controls uploading recordings to RealtimeKit's managed bucket. */
16357
+ interface RealtimeKitBucketConfig {
16358
+ /**
16359
+ * Enable managed-bucket uploads. If false, recording download URLs and
16360
+ * their expiry are not generated.
16361
+ */
16362
+ enabled: boolean;
16363
+ }
16364
+ /** Live-streaming destination for a recording. */
16365
+ interface RealtimeKitLivestreamingConfig {
16366
+ /** RTMP destination URL. */
16367
+ rtmp_url?: string;
16368
+ }
16369
+ /** Transcription and summary customization for a meeting. */
16370
+ interface RealtimeKitAIConfig {
16371
+ /** Transcription options. */
16372
+ transcription?: RealtimeKitTranscriptionConfig;
16373
+ /** Summary options. */
16374
+ summarization?: RealtimeKitSummarizationConfig;
16375
+ }
16376
+ /** Meeting transcription settings. */
16377
+ interface RealtimeKitTranscriptionConfig {
16378
+ /** Terms to recognize more accurately during transcription. */
16379
+ keywords?: string[];
16380
+ /**
16381
+ * Language used for transcription. If omitted, post-meeting transcription
16382
+ * detects the language automatically.
16383
+ */
16384
+ language?:
16385
+ "en-US" | "en-IN" | "de" | "hi" | "sv" | "ru" | "pl" | "el" | "fr" | "nl";
16386
+ /**
16387
+ * Filter offensive language in transcripts.
16388
+ * @default false
16389
+ */
16390
+ profanity_filter?: boolean;
16391
+ }
16392
+ /** Meeting summarization settings. */
16393
+ interface RealtimeKitSummarizationConfig {
16394
+ /**
16395
+ * Maximum words in the summary, between 150 and 1000.
16396
+ * @default 500
16397
+ */
16398
+ word_limit?: number;
16399
+ /**
16400
+ * Summary text format.
16401
+ * @default 'markdown'
16402
+ */
16403
+ text_format?: "plain_text" | "markdown";
16404
+ /**
16405
+ * Summary style.
16406
+ * @default 'general'
16407
+ */
16408
+ summary_type?:
16409
+ | "general"
16410
+ | "team_meeting"
16411
+ | "sales_call"
16412
+ | "client_check_in"
16413
+ | "interview"
16414
+ | "daily_standup"
16415
+ | "one_on_one_meeting"
16416
+ | "lecture"
16417
+ | "code_review";
16418
+ }
15985
16419
  // Namespace for RPC utility types. Unfortunately, we can't use a `module` here as these types need
15986
16420
  // to referenced by `Fetcher`. This is included in the "importable" version of the types which
15987
16421
  // strips all `module` blocks.