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