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