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