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