@cloudflare/workers-types 4.20260310.1 → 4.20260313.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.
@@ -3536,7 +3536,7 @@ export declare var WebSocket: {
3536
3536
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
3537
3537
  */
3538
3538
  export interface WebSocket extends EventTarget<WebSocketEventMap> {
3539
- accept(): void;
3539
+ accept(options?: WebSocketAcceptOptions): void;
3540
3540
  /**
3541
3541
  * The **`WebSocket.send()`** method enqueues the specified data to be transmitted to the server over the WebSocket connection, increasing the value of `bufferedAmount` by the number of bytes needed to contain the data.
3542
3542
  *
@@ -3582,6 +3582,16 @@ export interface WebSocket extends EventTarget<WebSocketEventMap> {
3582
3582
  */
3583
3583
  binaryType: "blob" | "arraybuffer";
3584
3584
  }
3585
+ export interface WebSocketAcceptOptions {
3586
+ /**
3587
+ * When set to `true`, receiving a server-initiated WebSocket Close frame will not
3588
+ * automatically send a reciprocal Close frame, leaving the connection in a half-open
3589
+ * state. This is useful for proxying scenarios where you need to coordinate closing
3590
+ * both sides independently. Defaults to `false` when the
3591
+ * `no_web_socket_half_open_by_default` compatibility flag is enabled.
3592
+ */
3593
+ allowHalfOpen?: boolean;
3594
+ }
3585
3595
  export declare const WebSocketPair: {
3586
3596
  new (): {
3587
3597
  0: WebSocket;
@@ -11973,6 +11983,767 @@ export interface SecretsStoreSecret {
11973
11983
  */
11974
11984
  get(): Promise<string>;
11975
11985
  }
11986
+ /**
11987
+ * Binding entrypoint for Cloudflare Stream.
11988
+ *
11989
+ * Usage:
11990
+ * - Binding-level operations:
11991
+ * `await env.STREAM.videos.upload`
11992
+ * `await env.STREAM.videos.createDirectUpload`
11993
+ * `await env.STREAM.videos.*`
11994
+ * `await env.STREAM.watermarks.*`
11995
+ * - Per-video operations:
11996
+ * `await env.STREAM.video(id).downloads.*`
11997
+ * `await env.STREAM.video(id).captions.*`
11998
+ *
11999
+ * Example usage:
12000
+ * ```ts
12001
+ * await env.STREAM.video(id).downloads.generate();
12002
+ *
12003
+ * const video = env.STREAM.video(id)
12004
+ * const captions = video.captions.list();
12005
+ * const videoDetails = video.details()
12006
+ * ```
12007
+ */
12008
+ export interface StreamBinding {
12009
+ /**
12010
+ * Returns a handle scoped to a single video for per-video operations.
12011
+ * @param id The unique identifier for the video.
12012
+ * @returns A handle for per-video operations.
12013
+ */
12014
+ video(id: string): StreamVideoHandle;
12015
+ /**
12016
+ * Uploads a new video from a File.
12017
+ * @param file The video file to upload.
12018
+ * @returns The uploaded video details.
12019
+ * @throws {BadRequestError} if the upload parameter is invalid
12020
+ * @throws {QuotaReachedError} if the account storage capacity is exceeded
12021
+ * @throws {MaxFileSizeError} if the file size is too large
12022
+ * @throws {RateLimitedError} if the server received too many requests
12023
+ * @throws {InternalError} if an unexpected error occurs
12024
+ */
12025
+ upload(file: File): Promise<StreamVideo>;
12026
+ /**
12027
+ * Uploads a new video from a provided URL.
12028
+ * @param url The URL to upload from.
12029
+ * @param params Optional upload parameters.
12030
+ * @returns The uploaded video details.
12031
+ * @throws {BadRequestError} if the upload parameter is invalid or the URL is invalid
12032
+ * @throws {QuotaReachedError} if the account storage capacity is exceeded
12033
+ * @throws {MaxFileSizeError} if the file size is too large
12034
+ * @throws {RateLimitedError} if the server received too many requests
12035
+ * @throws {AlreadyUploadedError} if a video was already uploaded to this URL
12036
+ * @throws {InternalError} if an unexpected error occurs
12037
+ */
12038
+ upload(url: string, params?: StreamUrlUploadParams): Promise<StreamVideo>;
12039
+ /**
12040
+ * Creates a direct upload that allows video uploads without an API key.
12041
+ * @param params Parameters for the direct upload
12042
+ * @returns The direct upload details.
12043
+ * @throws {BadRequestError} if the parameters are invalid
12044
+ * @throws {RateLimitedError} if the server received too many requests
12045
+ * @throws {InternalError} if an unexpected error occurs
12046
+ */
12047
+ createDirectUpload(
12048
+ params: StreamDirectUploadCreateParams,
12049
+ ): Promise<StreamDirectUpload>;
12050
+ videos: StreamVideos;
12051
+ watermarks: StreamWatermarks;
12052
+ }
12053
+ /**
12054
+ * Handle for operations scoped to a single Stream video.
12055
+ */
12056
+ export interface StreamVideoHandle {
12057
+ /**
12058
+ * The unique identifier for the video.
12059
+ */
12060
+ id: string;
12061
+ /**
12062
+ * Get a full videos details
12063
+ * @returns The full video details.
12064
+ * @throws {NotFoundError} if the video is not found
12065
+ * @throws {InternalError} if an unexpected error occurs
12066
+ */
12067
+ details(): Promise<StreamVideo>;
12068
+ /**
12069
+ * Update details for a single video.
12070
+ * @param params The fields to update for the video.
12071
+ * @returns The updated video details.
12072
+ * @throws {NotFoundError} if the video is not found
12073
+ * @throws {BadRequestError} if the parameters are invalid
12074
+ * @throws {InternalError} if an unexpected error occurs
12075
+ */
12076
+ update(params: StreamUpdateVideoParams): Promise<StreamVideo>;
12077
+ /**
12078
+ * Deletes a video and its copies from Cloudflare Stream.
12079
+ * @returns A promise that resolves when deletion completes.
12080
+ * @throws {NotFoundError} if the video is not found
12081
+ * @throws {InternalError} if an unexpected error occurs
12082
+ */
12083
+ delete(): Promise<void>;
12084
+ /**
12085
+ * Creates a signed URL token for a video.
12086
+ * @returns The signed token that was created.
12087
+ * @throws {InternalError} if the signing key cannot be retrieved or the token cannot be signed
12088
+ */
12089
+ generateToken(): Promise<string>;
12090
+ downloads: StreamScopedDownloads;
12091
+ captions: StreamScopedCaptions;
12092
+ }
12093
+ export interface StreamVideo {
12094
+ /**
12095
+ * The unique identifier for the video.
12096
+ */
12097
+ id: string;
12098
+ /**
12099
+ * A user-defined identifier for the media creator.
12100
+ */
12101
+ creator: string | null;
12102
+ /**
12103
+ * The thumbnail URL for the video.
12104
+ */
12105
+ thumbnail: string;
12106
+ /**
12107
+ * The thumbnail timestamp percentage.
12108
+ */
12109
+ thumbnailTimestampPct: number;
12110
+ /**
12111
+ * Indicates whether the video is ready to stream.
12112
+ */
12113
+ readyToStream: boolean;
12114
+ /**
12115
+ * The date and time the video became ready to stream.
12116
+ */
12117
+ readyToStreamAt: string | null;
12118
+ /**
12119
+ * Processing status information.
12120
+ */
12121
+ status: StreamVideoStatus;
12122
+ /**
12123
+ * A user modifiable key-value store.
12124
+ */
12125
+ meta: Record<string, string>;
12126
+ /**
12127
+ * The date and time the video was created.
12128
+ */
12129
+ created: string;
12130
+ /**
12131
+ * The date and time the video was last modified.
12132
+ */
12133
+ modified: string;
12134
+ /**
12135
+ * The date and time at which the video will be deleted.
12136
+ */
12137
+ scheduledDeletion: string | null;
12138
+ /**
12139
+ * The size of the video in bytes.
12140
+ */
12141
+ size: number;
12142
+ /**
12143
+ * The preview URL for the video.
12144
+ */
12145
+ preview?: string;
12146
+ /**
12147
+ * Origins allowed to display the video.
12148
+ */
12149
+ allowedOrigins: Array<string>;
12150
+ /**
12151
+ * Indicates whether signed URLs are required.
12152
+ */
12153
+ requireSignedURLs: boolean | null;
12154
+ /**
12155
+ * The date and time the video was uploaded.
12156
+ */
12157
+ uploaded: string | null;
12158
+ /**
12159
+ * The date and time when the upload URL expires.
12160
+ */
12161
+ uploadExpiry: string | null;
12162
+ /**
12163
+ * The maximum size in bytes for direct uploads.
12164
+ */
12165
+ maxSizeBytes: number | null;
12166
+ /**
12167
+ * The maximum duration in seconds for direct uploads.
12168
+ */
12169
+ maxDurationSeconds: number | null;
12170
+ /**
12171
+ * The video duration in seconds. -1 indicates unknown.
12172
+ */
12173
+ duration: number;
12174
+ /**
12175
+ * Input metadata for the original upload.
12176
+ */
12177
+ input: StreamVideoInput;
12178
+ /**
12179
+ * Playback URLs for the video.
12180
+ */
12181
+ hlsPlaybackUrl: string;
12182
+ dashPlaybackUrl: string;
12183
+ /**
12184
+ * The watermark applied to the video, if any.
12185
+ */
12186
+ watermark: StreamWatermark | null;
12187
+ /**
12188
+ * The live input id associated with the video, if any.
12189
+ */
12190
+ liveInputId?: string | null;
12191
+ /**
12192
+ * The source video id if this is a clip.
12193
+ */
12194
+ clippedFromId: string | null;
12195
+ /**
12196
+ * Public details associated with the video.
12197
+ */
12198
+ publicDetails: StreamPublicDetails | null;
12199
+ }
12200
+ export type StreamVideoStatus = {
12201
+ /**
12202
+ * The current processing state.
12203
+ */
12204
+ state: string;
12205
+ /**
12206
+ * The current processing step.
12207
+ */
12208
+ step?: string;
12209
+ /**
12210
+ * The percent complete as a string.
12211
+ */
12212
+ pctComplete?: string;
12213
+ /**
12214
+ * An error reason code, if applicable.
12215
+ */
12216
+ errorReasonCode: string;
12217
+ /**
12218
+ * An error reason text, if applicable.
12219
+ */
12220
+ errorReasonText: string;
12221
+ };
12222
+ export type StreamVideoInput = {
12223
+ /**
12224
+ * The input width in pixels.
12225
+ */
12226
+ width: number;
12227
+ /**
12228
+ * The input height in pixels.
12229
+ */
12230
+ height: number;
12231
+ };
12232
+ export type StreamPublicDetails = {
12233
+ /**
12234
+ * The public title for the video.
12235
+ */
12236
+ title: string | null;
12237
+ /**
12238
+ * The public share link.
12239
+ */
12240
+ share_link: string | null;
12241
+ /**
12242
+ * The public channel link.
12243
+ */
12244
+ channel_link: string | null;
12245
+ /**
12246
+ * The public logo URL.
12247
+ */
12248
+ logo: string | null;
12249
+ };
12250
+ export type StreamDirectUpload = {
12251
+ /**
12252
+ * The URL an unauthenticated upload can use for a single multipart request.
12253
+ */
12254
+ uploadURL: string;
12255
+ /**
12256
+ * A Cloudflare-generated unique identifier for a media item.
12257
+ */
12258
+ id: string;
12259
+ /**
12260
+ * The watermark profile applied to the upload.
12261
+ */
12262
+ watermark: StreamWatermark | null;
12263
+ /**
12264
+ * The scheduled deletion time, if any.
12265
+ */
12266
+ scheduledDeletion: string | null;
12267
+ };
12268
+ export type StreamDirectUploadCreateParams = {
12269
+ /**
12270
+ * The maximum duration in seconds for a video upload.
12271
+ */
12272
+ maxDurationSeconds: number;
12273
+ /**
12274
+ * The date and time after upload when videos will not be accepted.
12275
+ */
12276
+ expiry?: string;
12277
+ /**
12278
+ * A user-defined identifier for the media creator.
12279
+ */
12280
+ creator?: string;
12281
+ /**
12282
+ * A user modifiable key-value store used to reference other systems of record for
12283
+ * managing videos.
12284
+ */
12285
+ meta?: Record<string, string>;
12286
+ /**
12287
+ * Lists the origins allowed to display the video.
12288
+ */
12289
+ allowedOrigins?: Array<string>;
12290
+ /**
12291
+ * Indicates whether the video can be accessed using the id. When set to `true`,
12292
+ * a signed token must be generated with a signing key to view the video.
12293
+ */
12294
+ requireSignedURLs?: boolean;
12295
+ /**
12296
+ * The thumbnail timestamp percentage.
12297
+ */
12298
+ thumbnailTimestampPct?: number;
12299
+ /**
12300
+ * The date and time at which the video will be deleted. Include `null` to remove
12301
+ * a scheduled deletion.
12302
+ */
12303
+ scheduledDeletion?: string | null;
12304
+ /**
12305
+ * The watermark profile to apply.
12306
+ */
12307
+ watermark?: StreamDirectUploadWatermark;
12308
+ };
12309
+ export type StreamDirectUploadWatermark = {
12310
+ /**
12311
+ * The unique identifier for the watermark profile.
12312
+ */
12313
+ id: string;
12314
+ };
12315
+ export type StreamUrlUploadParams = {
12316
+ /**
12317
+ * Lists the origins allowed to display the video. Enter allowed origin
12318
+ * domains in an array and use `*` for wildcard subdomains. Empty arrays allow the
12319
+ * video to be viewed on any origin.
12320
+ */
12321
+ allowedOrigins?: Array<string>;
12322
+ /**
12323
+ * A user-defined identifier for the media creator.
12324
+ */
12325
+ creator?: string;
12326
+ /**
12327
+ * A user modifiable key-value store used to reference other systems of
12328
+ * record for managing videos.
12329
+ */
12330
+ meta?: Record<string, string>;
12331
+ /**
12332
+ * Indicates whether the video can be a accessed using the id. When
12333
+ * set to `true`, a signed token must be generated with a signing key to view the
12334
+ * video.
12335
+ */
12336
+ requireSignedURLs?: boolean;
12337
+ /**
12338
+ * Indicates the date and time at which the video will be deleted. Omit
12339
+ * the field to indicate no change, or include with a `null` value to remove an
12340
+ * existing scheduled deletion. If specified, must be at least 30 days from upload
12341
+ * time.
12342
+ */
12343
+ scheduledDeletion?: string | null;
12344
+ /**
12345
+ * The timestamp for a thumbnail image calculated as a percentage value
12346
+ * of the video's duration. To convert from a second-wise timestamp to a
12347
+ * percentage, divide the desired timestamp by the total duration of the video. If
12348
+ * this value is not set, the default thumbnail image is taken from 0s of the
12349
+ * video.
12350
+ */
12351
+ thumbnailTimestampPct?: number;
12352
+ /**
12353
+ * The identifier for the watermark profile
12354
+ */
12355
+ watermarkId?: string;
12356
+ };
12357
+ export interface StreamScopedCaptions {
12358
+ /**
12359
+ * Uploads the caption or subtitle file to the endpoint for a specific BCP47 language.
12360
+ * One caption or subtitle file per language is allowed.
12361
+ * @param language The BCP 47 language tag for the caption or subtitle.
12362
+ * @param file The caption or subtitle file to upload.
12363
+ * @returns The created caption entry.
12364
+ * @throws {NotFoundError} if the video is not found
12365
+ * @throws {BadRequestError} if the language or file is invalid
12366
+ * @throws {MaxFileSizeError} if the file size is too large
12367
+ * @throws {InternalError} if an unexpected error occurs
12368
+ */
12369
+ upload(language: string, file: File): Promise<StreamCaption>;
12370
+ /**
12371
+ * Generate captions or subtitles for the provided language via AI.
12372
+ * @param language The BCP 47 language tag to generate.
12373
+ * @returns The generated caption entry.
12374
+ * @throws {NotFoundError} if the video is not found
12375
+ * @throws {BadRequestError} if the language is invalid
12376
+ * @throws {StreamError} if a generated caption already exists
12377
+ * @throws {StreamError} if the video duration is too long
12378
+ * @throws {StreamError} if the video is missing audio
12379
+ * @throws {StreamError} if the requested language is not supported
12380
+ * @throws {InternalError} if an unexpected error occurs
12381
+ */
12382
+ generate(language: string): Promise<StreamCaption>;
12383
+ /**
12384
+ * Lists the captions or subtitles.
12385
+ * Use the language parameter to filter by a specific language.
12386
+ * @param language The optional BCP 47 language tag to filter by.
12387
+ * @returns The list of captions or subtitles.
12388
+ * @throws {NotFoundError} if the video or caption is not found
12389
+ * @throws {InternalError} if an unexpected error occurs
12390
+ */
12391
+ list(language?: string): Promise<StreamCaption[]>;
12392
+ /**
12393
+ * Removes the captions or subtitles from a video.
12394
+ * @param language The BCP 47 language tag to remove.
12395
+ * @returns A promise that resolves when deletion completes.
12396
+ * @throws {NotFoundError} if the video or caption is not found
12397
+ * @throws {InternalError} if an unexpected error occurs
12398
+ */
12399
+ delete(language: string): Promise<void>;
12400
+ }
12401
+ export interface StreamScopedDownloads {
12402
+ /**
12403
+ * Generates a download for a video when a video is ready to view. Available
12404
+ * types are `default` and `audio`. Defaults to `default` when omitted.
12405
+ * @param downloadType The download type to create.
12406
+ * @returns The current downloads for the video.
12407
+ * @throws {NotFoundError} if the video is not found
12408
+ * @throws {BadRequestError} if the download type is invalid
12409
+ * @throws {StreamError} if the video duration is too long to generate a download
12410
+ * @throws {StreamError} if the video is not ready to stream
12411
+ * @throws {InternalError} if an unexpected error occurs
12412
+ */
12413
+ generate(
12414
+ downloadType?: StreamDownloadType,
12415
+ ): Promise<StreamDownloadGetResponse>;
12416
+ /**
12417
+ * Lists the downloads created for a video.
12418
+ * @returns The current downloads for the video.
12419
+ * @throws {NotFoundError} if the video or downloads are not found
12420
+ * @throws {InternalError} if an unexpected error occurs
12421
+ */
12422
+ get(): Promise<StreamDownloadGetResponse>;
12423
+ /**
12424
+ * Delete the downloads for a video. Available types are `default` and `audio`.
12425
+ * Defaults to `default` when omitted.
12426
+ * @param downloadType The download type to delete.
12427
+ * @returns A promise that resolves when deletion completes.
12428
+ * @throws {NotFoundError} if the video or downloads are not found
12429
+ * @throws {InternalError} if an unexpected error occurs
12430
+ */
12431
+ delete(downloadType?: StreamDownloadType): Promise<void>;
12432
+ }
12433
+ export interface StreamVideos {
12434
+ /**
12435
+ * Lists all videos in a users account.
12436
+ * @returns The list of videos.
12437
+ * @throws {BadRequestError} if the parameters are invalid
12438
+ * @throws {InternalError} if an unexpected error occurs
12439
+ */
12440
+ list(params?: StreamVideosListParams): Promise<StreamVideo[]>;
12441
+ }
12442
+ export interface StreamWatermarks {
12443
+ /**
12444
+ * Generate a new watermark profile
12445
+ * @param file The image file to upload
12446
+ * @param params The watermark creation parameters.
12447
+ * @returns The created watermark profile.
12448
+ * @throws {BadRequestError} if the parameters are invalid
12449
+ * @throws {InvalidURLError} if the URL is invalid
12450
+ * @throws {MaxFileSizeError} if the file size is too large
12451
+ * @throws {TooManyWatermarksError} if the number of allowed watermarks is reached
12452
+ * @throws {InternalError} if an unexpected error occurs
12453
+ */
12454
+ generate(
12455
+ file: File,
12456
+ params: StreamWatermarkCreateParams,
12457
+ ): Promise<StreamWatermark>;
12458
+ /**
12459
+ * Generate a new watermark profile
12460
+ * @param url The image url to upload
12461
+ * @param params The watermark creation parameters.
12462
+ * @returns The created watermark profile.
12463
+ * @throws {BadRequestError} if the parameters are invalid
12464
+ * @throws {InvalidURLError} if the URL is invalid
12465
+ * @throws {MaxFileSizeError} if the file size is too large
12466
+ * @throws {TooManyWatermarksError} if the number of allowed watermarks is reached
12467
+ * @throws {InternalError} if an unexpected error occurs
12468
+ */
12469
+ generate(
12470
+ url: string,
12471
+ params: StreamWatermarkCreateParams,
12472
+ ): Promise<StreamWatermark>;
12473
+ /**
12474
+ * Lists all watermark profiles for an account.
12475
+ * @returns The list of watermark profiles.
12476
+ * @throws {InternalError} if an unexpected error occurs
12477
+ */
12478
+ list(): Promise<StreamWatermark[]>;
12479
+ /**
12480
+ * Retrieves details for a single watermark profile.
12481
+ * @param watermarkId The watermark profile identifier.
12482
+ * @returns The watermark profile details.
12483
+ * @throws {NotFoundError} if the watermark is not found
12484
+ * @throws {InternalError} if an unexpected error occurs
12485
+ */
12486
+ get(watermarkId: string): Promise<StreamWatermark>;
12487
+ /**
12488
+ * Deletes a watermark profile.
12489
+ * @param watermarkId The watermark profile identifier.
12490
+ * @returns A promise that resolves when deletion completes.
12491
+ * @throws {NotFoundError} if the watermark is not found
12492
+ * @throws {InternalError} if an unexpected error occurs
12493
+ */
12494
+ delete(watermarkId: string): Promise<void>;
12495
+ }
12496
+ export type StreamUpdateVideoParams = {
12497
+ /**
12498
+ * Lists the origins allowed to display the video. Enter allowed origin
12499
+ * domains in an array and use `*` for wildcard subdomains. Empty arrays allow the
12500
+ * video to be viewed on any origin.
12501
+ */
12502
+ allowedOrigins?: Array<string>;
12503
+ /**
12504
+ * A user-defined identifier for the media creator.
12505
+ */
12506
+ creator?: string;
12507
+ /**
12508
+ * The maximum duration in seconds for a video upload. Can be set for a
12509
+ * video that is not yet uploaded to limit its duration. Uploads that exceed the
12510
+ * specified duration will fail during processing. A value of `-1` means the value
12511
+ * is unknown.
12512
+ */
12513
+ maxDurationSeconds?: number;
12514
+ /**
12515
+ * A user modifiable key-value store used to reference other systems of
12516
+ * record for managing videos.
12517
+ */
12518
+ meta?: Record<string, string>;
12519
+ /**
12520
+ * Indicates whether the video can be a accessed using the id. When
12521
+ * set to `true`, a signed token must be generated with a signing key to view the
12522
+ * video.
12523
+ */
12524
+ requireSignedURLs?: boolean;
12525
+ /**
12526
+ * Indicates the date and time at which the video will be deleted. Omit
12527
+ * the field to indicate no change, or include with a `null` value to remove an
12528
+ * existing scheduled deletion. If specified, must be at least 30 days from upload
12529
+ * time.
12530
+ */
12531
+ scheduledDeletion?: string | null;
12532
+ /**
12533
+ * The timestamp for a thumbnail image calculated as a percentage value
12534
+ * of the video's duration. To convert from a second-wise timestamp to a
12535
+ * percentage, divide the desired timestamp by the total duration of the video. If
12536
+ * this value is not set, the default thumbnail image is taken from 0s of the
12537
+ * video.
12538
+ */
12539
+ thumbnailTimestampPct?: number;
12540
+ };
12541
+ export type StreamCaption = {
12542
+ /**
12543
+ * Whether the caption was generated via AI.
12544
+ */
12545
+ generated?: boolean;
12546
+ /**
12547
+ * The language label displayed in the native language to users.
12548
+ */
12549
+ label: string;
12550
+ /**
12551
+ * The language tag in BCP 47 format.
12552
+ */
12553
+ language: string;
12554
+ /**
12555
+ * The status of a generated caption.
12556
+ */
12557
+ status?: "ready" | "inprogress" | "error";
12558
+ };
12559
+ export type StreamDownloadStatus = "ready" | "inprogress" | "error";
12560
+ export type StreamDownloadType = "default" | "audio";
12561
+ export type StreamDownload = {
12562
+ /**
12563
+ * Indicates the progress as a percentage between 0 and 100.
12564
+ */
12565
+ percentComplete: number;
12566
+ /**
12567
+ * The status of a generated download.
12568
+ */
12569
+ status: StreamDownloadStatus;
12570
+ /**
12571
+ * The URL to access the generated download.
12572
+ */
12573
+ url?: string;
12574
+ };
12575
+ /**
12576
+ * An object with download type keys. Each key is optional and only present if that
12577
+ * download type has been created.
12578
+ */
12579
+ export type StreamDownloadGetResponse = {
12580
+ /**
12581
+ * The audio-only download. Only present if this download type has been created.
12582
+ */
12583
+ audio?: StreamDownload;
12584
+ /**
12585
+ * The default video download. Only present if this download type has been created.
12586
+ */
12587
+ default?: StreamDownload;
12588
+ };
12589
+ export type StreamWatermarkPosition =
12590
+ | "upperRight"
12591
+ | "upperLeft"
12592
+ | "lowerLeft"
12593
+ | "lowerRight"
12594
+ | "center";
12595
+ export type StreamWatermark = {
12596
+ /**
12597
+ * The unique identifier for a watermark profile.
12598
+ */
12599
+ id: string;
12600
+ /**
12601
+ * The size of the image in bytes.
12602
+ */
12603
+ size: number;
12604
+ /**
12605
+ * The height of the image in pixels.
12606
+ */
12607
+ height: number;
12608
+ /**
12609
+ * The width of the image in pixels.
12610
+ */
12611
+ width: number;
12612
+ /**
12613
+ * The date and a time a watermark profile was created.
12614
+ */
12615
+ created: string;
12616
+ /**
12617
+ * The source URL for a downloaded image. If the watermark profile was created via
12618
+ * direct upload, this field is null.
12619
+ */
12620
+ downloadedFrom: string | null;
12621
+ /**
12622
+ * A short description of the watermark profile.
12623
+ */
12624
+ name: string;
12625
+ /**
12626
+ * The translucency of the image. A value of `0.0` makes the image completely
12627
+ * transparent, and `1.0` makes the image completely opaque. Note that if the image
12628
+ * is already semi-transparent, setting this to `1.0` will not make the image
12629
+ * completely opaque.
12630
+ */
12631
+ opacity: number;
12632
+ /**
12633
+ * The whitespace between the adjacent edges (determined by position) of the video
12634
+ * and the image. `0.0` indicates no padding, and `1.0` indicates a fully padded
12635
+ * video width or length, as determined by the algorithm.
12636
+ */
12637
+ padding: number;
12638
+ /**
12639
+ * The size of the image relative to the overall size of the video. This parameter
12640
+ * will adapt to horizontal and vertical videos automatically. `0.0` indicates no
12641
+ * scaling (use the size of the image as-is), and `1.0 `fills the entire video.
12642
+ */
12643
+ scale: number;
12644
+ /**
12645
+ * The location of the image. Valid positions are: `upperRight`, `upperLeft`,
12646
+ * `lowerLeft`, `lowerRight`, and `center`. Note that `center` ignores the
12647
+ * `padding` parameter.
12648
+ */
12649
+ position: StreamWatermarkPosition;
12650
+ };
12651
+ export type StreamWatermarkCreateParams = {
12652
+ /**
12653
+ * A short description of the watermark profile.
12654
+ */
12655
+ name?: string;
12656
+ /**
12657
+ * The translucency of the image. A value of `0.0` makes the image completely
12658
+ * transparent, and `1.0` makes the image completely opaque. Note that if the
12659
+ * image is already semi-transparent, setting this to `1.0` will not make the
12660
+ * image completely opaque.
12661
+ */
12662
+ opacity?: number;
12663
+ /**
12664
+ * The whitespace between the adjacent edges (determined by position) of the
12665
+ * video and the image. `0.0` indicates no padding, and `1.0` indicates a fully
12666
+ * padded video width or length, as determined by the algorithm.
12667
+ */
12668
+ padding?: number;
12669
+ /**
12670
+ * The size of the image relative to the overall size of the video. This
12671
+ * parameter will adapt to horizontal and vertical videos automatically. `0.0`
12672
+ * indicates no scaling (use the size of the image as-is), and `1.0 `fills the
12673
+ * entire video.
12674
+ */
12675
+ scale?: number;
12676
+ /**
12677
+ * The location of the image.
12678
+ */
12679
+ position?: StreamWatermarkPosition;
12680
+ };
12681
+ export type StreamVideosListParams = {
12682
+ /**
12683
+ * The maximum number of videos to return.
12684
+ */
12685
+ limit?: number;
12686
+ /**
12687
+ * Return videos created before this timestamp.
12688
+ * (RFC3339/RFC3339Nano)
12689
+ */
12690
+ before?: string;
12691
+ /**
12692
+ * Comparison operator for the `before` field.
12693
+ * @default 'lt'
12694
+ */
12695
+ beforeComp?: StreamPaginationComparison;
12696
+ /**
12697
+ * Return videos created after this timestamp.
12698
+ * (RFC3339/RFC3339Nano)
12699
+ */
12700
+ after?: string;
12701
+ /**
12702
+ * Comparison operator for the `after` field.
12703
+ * @default 'gte'
12704
+ */
12705
+ afterComp?: StreamPaginationComparison;
12706
+ };
12707
+ export type StreamPaginationComparison = "eq" | "gt" | "gte" | "lt" | "lte";
12708
+ /**
12709
+ * Error object for Stream binding operations.
12710
+ */
12711
+ export interface StreamError extends Error {
12712
+ readonly code: number;
12713
+ readonly statusCode: number;
12714
+ readonly message: string;
12715
+ readonly stack?: string;
12716
+ }
12717
+ export interface InternalError extends StreamError {
12718
+ name: "InternalError";
12719
+ }
12720
+ export interface BadRequestError extends StreamError {
12721
+ name: "BadRequestError";
12722
+ }
12723
+ export interface NotFoundError extends StreamError {
12724
+ name: "NotFoundError";
12725
+ }
12726
+ export interface ForbiddenError extends StreamError {
12727
+ name: "ForbiddenError";
12728
+ }
12729
+ export interface RateLimitedError extends StreamError {
12730
+ name: "RateLimitedError";
12731
+ }
12732
+ export interface QuotaReachedError extends StreamError {
12733
+ name: "QuotaReachedError";
12734
+ }
12735
+ export interface MaxFileSizeError extends StreamError {
12736
+ name: "MaxFileSizeError";
12737
+ }
12738
+ export interface InvalidURLError extends StreamError {
12739
+ name: "InvalidURLError";
12740
+ }
12741
+ export interface AlreadyUploadedError extends StreamError {
12742
+ name: "AlreadyUploadedError";
12743
+ }
12744
+ export interface TooManyWatermarksError extends StreamError {
12745
+ name: "TooManyWatermarksError";
12746
+ }
11976
12747
  export type MarkdownDocument = {
11977
12748
  name: string;
11978
12749
  blob: Blob;