@cloudflare/workers-types 4.20260331.1 → 4.20260402.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.
package/latest/index.d.ts CHANGED
@@ -3782,12 +3782,43 @@ interface Container {
3782
3782
  setInactivityTimeout(durationMs: number | bigint): Promise<void>;
3783
3783
  interceptOutboundHttp(addr: string, binding: Fetcher): Promise<void>;
3784
3784
  interceptAllOutboundHttp(binding: Fetcher): Promise<void>;
3785
+ snapshotDirectory(
3786
+ options: ContainerDirectorySnapshotOptions,
3787
+ ): Promise<ContainerDirectorySnapshot>;
3788
+ snapshotContainer(
3789
+ options: ContainerSnapshotOptions,
3790
+ ): Promise<ContainerSnapshot>;
3791
+ interceptOutboundHttps(addr: string, binding: Fetcher): Promise<void>;
3792
+ }
3793
+ interface ContainerDirectorySnapshot {
3794
+ id: string;
3795
+ size: number;
3796
+ dir: string;
3797
+ name?: string;
3798
+ }
3799
+ interface ContainerDirectorySnapshotOptions {
3800
+ dir: string;
3801
+ name?: string;
3802
+ }
3803
+ interface ContainerDirectorySnapshotRestoreParams {
3804
+ snapshot: ContainerDirectorySnapshot;
3805
+ mountPoint?: string;
3806
+ }
3807
+ interface ContainerSnapshot {
3808
+ id: string;
3809
+ size: number;
3810
+ name?: string;
3811
+ }
3812
+ interface ContainerSnapshotOptions {
3813
+ name?: string;
3785
3814
  }
3786
3815
  interface ContainerStartupOptions {
3787
3816
  entrypoint?: string[];
3788
3817
  enableInternet: boolean;
3789
3818
  env?: Record<string, string>;
3790
3819
  labels?: Record<string, string>;
3820
+ directorySnapshots?: ContainerDirectorySnapshotRestoreParams[];
3821
+ containerSnapshot?: ContainerSnapshot;
3791
3822
  }
3792
3823
  /**
3793
3824
  * The **`MessagePort`** interface of the Channel Messaging API represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other.
@@ -12199,19 +12230,37 @@ interface ImageList {
12199
12230
  cursor?: string;
12200
12231
  listComplete: boolean;
12201
12232
  }
12202
- interface HostedImagesBinding {
12233
+ interface ImageHandle {
12203
12234
  /**
12204
- * Get detailed metadata for a hosted image
12205
- * @param imageId The ID of the image (UUID or custom ID)
12235
+ * Get metadata for a hosted image
12206
12236
  * @returns Image metadata, or null if not found
12207
12237
  */
12208
- details(imageId: string): Promise<ImageMetadata | null>;
12238
+ details(): Promise<ImageMetadata | null>;
12209
12239
  /**
12210
12240
  * Get the raw image data for a hosted image
12211
- * @param imageId The ID of the image (UUID or custom ID)
12212
12241
  * @returns ReadableStream of image bytes, or null if not found
12213
12242
  */
12214
- image(imageId: string): Promise<ReadableStream<Uint8Array> | null>;
12243
+ bytes(): Promise<ReadableStream<Uint8Array> | null>;
12244
+ /**
12245
+ * Update hosted image metadata
12246
+ * @param options Properties to update
12247
+ * @returns Updated image metadata
12248
+ * @throws {@link ImagesError} if update fails
12249
+ */
12250
+ update(options: ImageUpdateOptions): Promise<ImageMetadata>;
12251
+ /**
12252
+ * Delete a hosted image
12253
+ * @returns True if deleted, false if not found
12254
+ */
12255
+ delete(): Promise<boolean>;
12256
+ }
12257
+ interface HostedImagesBinding {
12258
+ /**
12259
+ * Get a handle for a hosted image
12260
+ * @param imageId The ID of the image (UUID or custom ID)
12261
+ * @returns A handle for per-image operations
12262
+ */
12263
+ image(imageId: string): ImageHandle;
12215
12264
  /**
12216
12265
  * Upload a new hosted image
12217
12266
  * @param image The image file to upload
@@ -12223,20 +12272,6 @@ interface HostedImagesBinding {
12223
12272
  image: ReadableStream<Uint8Array> | ArrayBuffer,
12224
12273
  options?: ImageUploadOptions,
12225
12274
  ): Promise<ImageMetadata>;
12226
- /**
12227
- * Update hosted image metadata
12228
- * @param imageId The ID of the image
12229
- * @param options Properties to update
12230
- * @returns Updated image metadata
12231
- * @throws {@link ImagesError} if update fails
12232
- */
12233
- update(imageId: string, options: ImageUpdateOptions): Promise<ImageMetadata>;
12234
- /**
12235
- * Delete a hosted image
12236
- * @param imageId The ID of the image
12237
- * @returns True if deleted, false if not found
12238
- */
12239
- delete(imageId: string): Promise<boolean>;
12240
12275
  /**
12241
12276
  * List hosted images with pagination
12242
12277
  * @param options List configuration
@@ -13312,14 +13347,13 @@ interface StreamScopedCaptions {
13312
13347
  * Uploads the caption or subtitle file to the endpoint for a specific BCP47 language.
13313
13348
  * One caption or subtitle file per language is allowed.
13314
13349
  * @param language The BCP 47 language tag for the caption or subtitle.
13315
- * @param file The caption or subtitle file to upload.
13350
+ * @param input The caption or subtitle stream to upload.
13316
13351
  * @returns The created caption entry.
13317
13352
  * @throws {NotFoundError} if the video is not found
13318
13353
  * @throws {BadRequestError} if the language or file is invalid
13319
- * @throws {MaxFileSizeError} if the file size is too large
13320
13354
  * @throws {InternalError} if an unexpected error occurs
13321
13355
  */
13322
- upload(language: string, file: File): Promise<StreamCaption>;
13356
+ upload(language: string, input: ReadableStream): Promise<StreamCaption>;
13323
13357
  /**
13324
13358
  * Generate captions or subtitles for the provided language via AI.
13325
13359
  * @param language The BCP 47 language tag to generate.
@@ -13395,17 +13429,16 @@ interface StreamVideos {
13395
13429
  interface StreamWatermarks {
13396
13430
  /**
13397
13431
  * Generate a new watermark profile
13398
- * @param file The image file to upload
13432
+ * @param input The image stream to upload
13399
13433
  * @param params The watermark creation parameters.
13400
13434
  * @returns The created watermark profile.
13401
13435
  * @throws {BadRequestError} if the parameters are invalid
13402
13436
  * @throws {InvalidURLError} if the URL is invalid
13403
- * @throws {MaxFileSizeError} if the file size is too large
13404
13437
  * @throws {TooManyWatermarksError} if the number of allowed watermarks is reached
13405
13438
  * @throws {InternalError} if an unexpected error occurs
13406
13439
  */
13407
13440
  generate(
13408
- file: File,
13441
+ input: ReadableStream,
13409
13442
  params: StreamWatermarkCreateParams,
13410
13443
  ): Promise<StreamWatermark>;
13411
13444
  /**
@@ -13415,7 +13448,6 @@ interface StreamWatermarks {
13415
13448
  * @returns The created watermark profile.
13416
13449
  * @throws {BadRequestError} if the parameters are invalid
13417
13450
  * @throws {InvalidURLError} if the URL is invalid
13418
- * @throws {MaxFileSizeError} if the file size is too large
13419
13451
  * @throws {TooManyWatermarksError} if the number of allowed watermarks is reached
13420
13452
  * @throws {InternalError} if an unexpected error occurs
13421
13453
  */
package/latest/index.ts CHANGED
@@ -3788,12 +3788,43 @@ export interface Container {
3788
3788
  setInactivityTimeout(durationMs: number | bigint): Promise<void>;
3789
3789
  interceptOutboundHttp(addr: string, binding: Fetcher): Promise<void>;
3790
3790
  interceptAllOutboundHttp(binding: Fetcher): Promise<void>;
3791
+ snapshotDirectory(
3792
+ options: ContainerDirectorySnapshotOptions,
3793
+ ): Promise<ContainerDirectorySnapshot>;
3794
+ snapshotContainer(
3795
+ options: ContainerSnapshotOptions,
3796
+ ): Promise<ContainerSnapshot>;
3797
+ interceptOutboundHttps(addr: string, binding: Fetcher): Promise<void>;
3798
+ }
3799
+ export interface ContainerDirectorySnapshot {
3800
+ id: string;
3801
+ size: number;
3802
+ dir: string;
3803
+ name?: string;
3804
+ }
3805
+ export interface ContainerDirectorySnapshotOptions {
3806
+ dir: string;
3807
+ name?: string;
3808
+ }
3809
+ export interface ContainerDirectorySnapshotRestoreParams {
3810
+ snapshot: ContainerDirectorySnapshot;
3811
+ mountPoint?: string;
3812
+ }
3813
+ export interface ContainerSnapshot {
3814
+ id: string;
3815
+ size: number;
3816
+ name?: string;
3817
+ }
3818
+ export interface ContainerSnapshotOptions {
3819
+ name?: string;
3791
3820
  }
3792
3821
  export interface ContainerStartupOptions {
3793
3822
  entrypoint?: string[];
3794
3823
  enableInternet: boolean;
3795
3824
  env?: Record<string, string>;
3796
3825
  labels?: Record<string, string>;
3826
+ directorySnapshots?: ContainerDirectorySnapshotRestoreParams[];
3827
+ containerSnapshot?: ContainerSnapshot;
3797
3828
  }
3798
3829
  /**
3799
3830
  * The **`MessagePort`** interface of the Channel Messaging API represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other.
@@ -12215,19 +12246,37 @@ export interface ImageList {
12215
12246
  cursor?: string;
12216
12247
  listComplete: boolean;
12217
12248
  }
12218
- export interface HostedImagesBinding {
12249
+ export interface ImageHandle {
12219
12250
  /**
12220
- * Get detailed metadata for a hosted image
12221
- * @param imageId The ID of the image (UUID or custom ID)
12251
+ * Get metadata for a hosted image
12222
12252
  * @returns Image metadata, or null if not found
12223
12253
  */
12224
- details(imageId: string): Promise<ImageMetadata | null>;
12254
+ details(): Promise<ImageMetadata | null>;
12225
12255
  /**
12226
12256
  * Get the raw image data for a hosted image
12227
- * @param imageId The ID of the image (UUID or custom ID)
12228
12257
  * @returns ReadableStream of image bytes, or null if not found
12229
12258
  */
12230
- image(imageId: string): Promise<ReadableStream<Uint8Array> | null>;
12259
+ bytes(): Promise<ReadableStream<Uint8Array> | null>;
12260
+ /**
12261
+ * Update hosted image metadata
12262
+ * @param options Properties to update
12263
+ * @returns Updated image metadata
12264
+ * @throws {@link ImagesError} if update fails
12265
+ */
12266
+ update(options: ImageUpdateOptions): Promise<ImageMetadata>;
12267
+ /**
12268
+ * Delete a hosted image
12269
+ * @returns True if deleted, false if not found
12270
+ */
12271
+ delete(): Promise<boolean>;
12272
+ }
12273
+ export interface HostedImagesBinding {
12274
+ /**
12275
+ * Get a handle for a hosted image
12276
+ * @param imageId The ID of the image (UUID or custom ID)
12277
+ * @returns A handle for per-image operations
12278
+ */
12279
+ image(imageId: string): ImageHandle;
12231
12280
  /**
12232
12281
  * Upload a new hosted image
12233
12282
  * @param image The image file to upload
@@ -12239,20 +12288,6 @@ export interface HostedImagesBinding {
12239
12288
  image: ReadableStream<Uint8Array> | ArrayBuffer,
12240
12289
  options?: ImageUploadOptions,
12241
12290
  ): Promise<ImageMetadata>;
12242
- /**
12243
- * Update hosted image metadata
12244
- * @param imageId The ID of the image
12245
- * @param options Properties to update
12246
- * @returns Updated image metadata
12247
- * @throws {@link ImagesError} if update fails
12248
- */
12249
- update(imageId: string, options: ImageUpdateOptions): Promise<ImageMetadata>;
12250
- /**
12251
- * Delete a hosted image
12252
- * @param imageId The ID of the image
12253
- * @returns True if deleted, false if not found
12254
- */
12255
- delete(imageId: string): Promise<boolean>;
12256
12291
  /**
12257
12292
  * List hosted images with pagination
12258
12293
  * @param options List configuration
@@ -13269,14 +13304,13 @@ export interface StreamScopedCaptions {
13269
13304
  * Uploads the caption or subtitle file to the endpoint for a specific BCP47 language.
13270
13305
  * One caption or subtitle file per language is allowed.
13271
13306
  * @param language The BCP 47 language tag for the caption or subtitle.
13272
- * @param file The caption or subtitle file to upload.
13307
+ * @param input The caption or subtitle stream to upload.
13273
13308
  * @returns The created caption entry.
13274
13309
  * @throws {NotFoundError} if the video is not found
13275
13310
  * @throws {BadRequestError} if the language or file is invalid
13276
- * @throws {MaxFileSizeError} if the file size is too large
13277
13311
  * @throws {InternalError} if an unexpected error occurs
13278
13312
  */
13279
- upload(language: string, file: File): Promise<StreamCaption>;
13313
+ upload(language: string, input: ReadableStream): Promise<StreamCaption>;
13280
13314
  /**
13281
13315
  * Generate captions or subtitles for the provided language via AI.
13282
13316
  * @param language The BCP 47 language tag to generate.
@@ -13352,17 +13386,16 @@ export interface StreamVideos {
13352
13386
  export interface StreamWatermarks {
13353
13387
  /**
13354
13388
  * Generate a new watermark profile
13355
- * @param file The image file to upload
13389
+ * @param input The image stream to upload
13356
13390
  * @param params The watermark creation parameters.
13357
13391
  * @returns The created watermark profile.
13358
13392
  * @throws {BadRequestError} if the parameters are invalid
13359
13393
  * @throws {InvalidURLError} if the URL is invalid
13360
- * @throws {MaxFileSizeError} if the file size is too large
13361
13394
  * @throws {TooManyWatermarksError} if the number of allowed watermarks is reached
13362
13395
  * @throws {InternalError} if an unexpected error occurs
13363
13396
  */
13364
13397
  generate(
13365
- file: File,
13398
+ input: ReadableStream,
13366
13399
  params: StreamWatermarkCreateParams,
13367
13400
  ): Promise<StreamWatermark>;
13368
13401
  /**
@@ -13372,7 +13405,6 @@ export interface StreamWatermarks {
13372
13405
  * @returns The created watermark profile.
13373
13406
  * @throws {BadRequestError} if the parameters are invalid
13374
13407
  * @throws {InvalidURLError} if the URL is invalid
13375
- * @throws {MaxFileSizeError} if the file size is too large
13376
13408
  * @throws {TooManyWatermarksError} if the number of allowed watermarks is reached
13377
13409
  * @throws {InternalError} if an unexpected error occurs
13378
13410
  */
package/oldest/index.d.ts CHANGED
@@ -3662,12 +3662,43 @@ interface Container {
3662
3662
  setInactivityTimeout(durationMs: number | bigint): Promise<void>;
3663
3663
  interceptOutboundHttp(addr: string, binding: Fetcher): Promise<void>;
3664
3664
  interceptAllOutboundHttp(binding: Fetcher): Promise<void>;
3665
+ snapshotDirectory(
3666
+ options: ContainerDirectorySnapshotOptions,
3667
+ ): Promise<ContainerDirectorySnapshot>;
3668
+ snapshotContainer(
3669
+ options: ContainerSnapshotOptions,
3670
+ ): Promise<ContainerSnapshot>;
3671
+ interceptOutboundHttps(addr: string, binding: Fetcher): Promise<void>;
3672
+ }
3673
+ interface ContainerDirectorySnapshot {
3674
+ id: string;
3675
+ size: number;
3676
+ dir: string;
3677
+ name?: string;
3678
+ }
3679
+ interface ContainerDirectorySnapshotOptions {
3680
+ dir: string;
3681
+ name?: string;
3682
+ }
3683
+ interface ContainerDirectorySnapshotRestoreParams {
3684
+ snapshot: ContainerDirectorySnapshot;
3685
+ mountPoint?: string;
3686
+ }
3687
+ interface ContainerSnapshot {
3688
+ id: string;
3689
+ size: number;
3690
+ name?: string;
3691
+ }
3692
+ interface ContainerSnapshotOptions {
3693
+ name?: string;
3665
3694
  }
3666
3695
  interface ContainerStartupOptions {
3667
3696
  entrypoint?: string[];
3668
3697
  enableInternet: boolean;
3669
3698
  env?: Record<string, string>;
3670
3699
  labels?: Record<string, string>;
3700
+ directorySnapshots?: ContainerDirectorySnapshotRestoreParams[];
3701
+ containerSnapshot?: ContainerSnapshot;
3671
3702
  }
3672
3703
  /**
3673
3704
  * The **`MessagePort`** interface of the Channel Messaging API represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other.
@@ -12059,19 +12090,37 @@ interface ImageList {
12059
12090
  cursor?: string;
12060
12091
  listComplete: boolean;
12061
12092
  }
12062
- interface HostedImagesBinding {
12093
+ interface ImageHandle {
12063
12094
  /**
12064
- * Get detailed metadata for a hosted image
12065
- * @param imageId The ID of the image (UUID or custom ID)
12095
+ * Get metadata for a hosted image
12066
12096
  * @returns Image metadata, or null if not found
12067
12097
  */
12068
- details(imageId: string): Promise<ImageMetadata | null>;
12098
+ details(): Promise<ImageMetadata | null>;
12069
12099
  /**
12070
12100
  * Get the raw image data for a hosted image
12071
- * @param imageId The ID of the image (UUID or custom ID)
12072
12101
  * @returns ReadableStream of image bytes, or null if not found
12073
12102
  */
12074
- image(imageId: string): Promise<ReadableStream<Uint8Array> | null>;
12103
+ bytes(): Promise<ReadableStream<Uint8Array> | null>;
12104
+ /**
12105
+ * Update hosted image metadata
12106
+ * @param options Properties to update
12107
+ * @returns Updated image metadata
12108
+ * @throws {@link ImagesError} if update fails
12109
+ */
12110
+ update(options: ImageUpdateOptions): Promise<ImageMetadata>;
12111
+ /**
12112
+ * Delete a hosted image
12113
+ * @returns True if deleted, false if not found
12114
+ */
12115
+ delete(): Promise<boolean>;
12116
+ }
12117
+ interface HostedImagesBinding {
12118
+ /**
12119
+ * Get a handle for a hosted image
12120
+ * @param imageId The ID of the image (UUID or custom ID)
12121
+ * @returns A handle for per-image operations
12122
+ */
12123
+ image(imageId: string): ImageHandle;
12075
12124
  /**
12076
12125
  * Upload a new hosted image
12077
12126
  * @param image The image file to upload
@@ -12083,20 +12132,6 @@ interface HostedImagesBinding {
12083
12132
  image: ReadableStream<Uint8Array> | ArrayBuffer,
12084
12133
  options?: ImageUploadOptions,
12085
12134
  ): Promise<ImageMetadata>;
12086
- /**
12087
- * Update hosted image metadata
12088
- * @param imageId The ID of the image
12089
- * @param options Properties to update
12090
- * @returns Updated image metadata
12091
- * @throws {@link ImagesError} if update fails
12092
- */
12093
- update(imageId: string, options: ImageUpdateOptions): Promise<ImageMetadata>;
12094
- /**
12095
- * Delete a hosted image
12096
- * @param imageId The ID of the image
12097
- * @returns True if deleted, false if not found
12098
- */
12099
- delete(imageId: string): Promise<boolean>;
12100
12135
  /**
12101
12136
  * List hosted images with pagination
12102
12137
  * @param options List configuration
@@ -13172,14 +13207,13 @@ interface StreamScopedCaptions {
13172
13207
  * Uploads the caption or subtitle file to the endpoint for a specific BCP47 language.
13173
13208
  * One caption or subtitle file per language is allowed.
13174
13209
  * @param language The BCP 47 language tag for the caption or subtitle.
13175
- * @param file The caption or subtitle file to upload.
13210
+ * @param input The caption or subtitle stream to upload.
13176
13211
  * @returns The created caption entry.
13177
13212
  * @throws {NotFoundError} if the video is not found
13178
13213
  * @throws {BadRequestError} if the language or file is invalid
13179
- * @throws {MaxFileSizeError} if the file size is too large
13180
13214
  * @throws {InternalError} if an unexpected error occurs
13181
13215
  */
13182
- upload(language: string, file: File): Promise<StreamCaption>;
13216
+ upload(language: string, input: ReadableStream): Promise<StreamCaption>;
13183
13217
  /**
13184
13218
  * Generate captions or subtitles for the provided language via AI.
13185
13219
  * @param language The BCP 47 language tag to generate.
@@ -13255,17 +13289,16 @@ interface StreamVideos {
13255
13289
  interface StreamWatermarks {
13256
13290
  /**
13257
13291
  * Generate a new watermark profile
13258
- * @param file The image file to upload
13292
+ * @param input The image stream to upload
13259
13293
  * @param params The watermark creation parameters.
13260
13294
  * @returns The created watermark profile.
13261
13295
  * @throws {BadRequestError} if the parameters are invalid
13262
13296
  * @throws {InvalidURLError} if the URL is invalid
13263
- * @throws {MaxFileSizeError} if the file size is too large
13264
13297
  * @throws {TooManyWatermarksError} if the number of allowed watermarks is reached
13265
13298
  * @throws {InternalError} if an unexpected error occurs
13266
13299
  */
13267
13300
  generate(
13268
- file: File,
13301
+ input: ReadableStream,
13269
13302
  params: StreamWatermarkCreateParams,
13270
13303
  ): Promise<StreamWatermark>;
13271
13304
  /**
@@ -13275,7 +13308,6 @@ interface StreamWatermarks {
13275
13308
  * @returns The created watermark profile.
13276
13309
  * @throws {BadRequestError} if the parameters are invalid
13277
13310
  * @throws {InvalidURLError} if the URL is invalid
13278
- * @throws {MaxFileSizeError} if the file size is too large
13279
13311
  * @throws {TooManyWatermarksError} if the number of allowed watermarks is reached
13280
13312
  * @throws {InternalError} if an unexpected error occurs
13281
13313
  */
package/oldest/index.ts CHANGED
@@ -3668,12 +3668,43 @@ export interface Container {
3668
3668
  setInactivityTimeout(durationMs: number | bigint): Promise<void>;
3669
3669
  interceptOutboundHttp(addr: string, binding: Fetcher): Promise<void>;
3670
3670
  interceptAllOutboundHttp(binding: Fetcher): Promise<void>;
3671
+ snapshotDirectory(
3672
+ options: ContainerDirectorySnapshotOptions,
3673
+ ): Promise<ContainerDirectorySnapshot>;
3674
+ snapshotContainer(
3675
+ options: ContainerSnapshotOptions,
3676
+ ): Promise<ContainerSnapshot>;
3677
+ interceptOutboundHttps(addr: string, binding: Fetcher): Promise<void>;
3678
+ }
3679
+ export interface ContainerDirectorySnapshot {
3680
+ id: string;
3681
+ size: number;
3682
+ dir: string;
3683
+ name?: string;
3684
+ }
3685
+ export interface ContainerDirectorySnapshotOptions {
3686
+ dir: string;
3687
+ name?: string;
3688
+ }
3689
+ export interface ContainerDirectorySnapshotRestoreParams {
3690
+ snapshot: ContainerDirectorySnapshot;
3691
+ mountPoint?: string;
3692
+ }
3693
+ export interface ContainerSnapshot {
3694
+ id: string;
3695
+ size: number;
3696
+ name?: string;
3697
+ }
3698
+ export interface ContainerSnapshotOptions {
3699
+ name?: string;
3671
3700
  }
3672
3701
  export interface ContainerStartupOptions {
3673
3702
  entrypoint?: string[];
3674
3703
  enableInternet: boolean;
3675
3704
  env?: Record<string, string>;
3676
3705
  labels?: Record<string, string>;
3706
+ directorySnapshots?: ContainerDirectorySnapshotRestoreParams[];
3707
+ containerSnapshot?: ContainerSnapshot;
3677
3708
  }
3678
3709
  /**
3679
3710
  * The **`MessagePort`** interface of the Channel Messaging API represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other.
@@ -12075,19 +12106,37 @@ export interface ImageList {
12075
12106
  cursor?: string;
12076
12107
  listComplete: boolean;
12077
12108
  }
12078
- export interface HostedImagesBinding {
12109
+ export interface ImageHandle {
12079
12110
  /**
12080
- * Get detailed metadata for a hosted image
12081
- * @param imageId The ID of the image (UUID or custom ID)
12111
+ * Get metadata for a hosted image
12082
12112
  * @returns Image metadata, or null if not found
12083
12113
  */
12084
- details(imageId: string): Promise<ImageMetadata | null>;
12114
+ details(): Promise<ImageMetadata | null>;
12085
12115
  /**
12086
12116
  * Get the raw image data for a hosted image
12087
- * @param imageId The ID of the image (UUID or custom ID)
12088
12117
  * @returns ReadableStream of image bytes, or null if not found
12089
12118
  */
12090
- image(imageId: string): Promise<ReadableStream<Uint8Array> | null>;
12119
+ bytes(): Promise<ReadableStream<Uint8Array> | null>;
12120
+ /**
12121
+ * Update hosted image metadata
12122
+ * @param options Properties to update
12123
+ * @returns Updated image metadata
12124
+ * @throws {@link ImagesError} if update fails
12125
+ */
12126
+ update(options: ImageUpdateOptions): Promise<ImageMetadata>;
12127
+ /**
12128
+ * Delete a hosted image
12129
+ * @returns True if deleted, false if not found
12130
+ */
12131
+ delete(): Promise<boolean>;
12132
+ }
12133
+ export interface HostedImagesBinding {
12134
+ /**
12135
+ * Get a handle for a hosted image
12136
+ * @param imageId The ID of the image (UUID or custom ID)
12137
+ * @returns A handle for per-image operations
12138
+ */
12139
+ image(imageId: string): ImageHandle;
12091
12140
  /**
12092
12141
  * Upload a new hosted image
12093
12142
  * @param image The image file to upload
@@ -12099,20 +12148,6 @@ export interface HostedImagesBinding {
12099
12148
  image: ReadableStream<Uint8Array> | ArrayBuffer,
12100
12149
  options?: ImageUploadOptions,
12101
12150
  ): Promise<ImageMetadata>;
12102
- /**
12103
- * Update hosted image metadata
12104
- * @param imageId The ID of the image
12105
- * @param options Properties to update
12106
- * @returns Updated image metadata
12107
- * @throws {@link ImagesError} if update fails
12108
- */
12109
- update(imageId: string, options: ImageUpdateOptions): Promise<ImageMetadata>;
12110
- /**
12111
- * Delete a hosted image
12112
- * @param imageId The ID of the image
12113
- * @returns True if deleted, false if not found
12114
- */
12115
- delete(imageId: string): Promise<boolean>;
12116
12151
  /**
12117
12152
  * List hosted images with pagination
12118
12153
  * @param options List configuration
@@ -13129,14 +13164,13 @@ export interface StreamScopedCaptions {
13129
13164
  * Uploads the caption or subtitle file to the endpoint for a specific BCP47 language.
13130
13165
  * One caption or subtitle file per language is allowed.
13131
13166
  * @param language The BCP 47 language tag for the caption or subtitle.
13132
- * @param file The caption or subtitle file to upload.
13167
+ * @param input The caption or subtitle stream to upload.
13133
13168
  * @returns The created caption entry.
13134
13169
  * @throws {NotFoundError} if the video is not found
13135
13170
  * @throws {BadRequestError} if the language or file is invalid
13136
- * @throws {MaxFileSizeError} if the file size is too large
13137
13171
  * @throws {InternalError} if an unexpected error occurs
13138
13172
  */
13139
- upload(language: string, file: File): Promise<StreamCaption>;
13173
+ upload(language: string, input: ReadableStream): Promise<StreamCaption>;
13140
13174
  /**
13141
13175
  * Generate captions or subtitles for the provided language via AI.
13142
13176
  * @param language The BCP 47 language tag to generate.
@@ -13212,17 +13246,16 @@ export interface StreamVideos {
13212
13246
  export interface StreamWatermarks {
13213
13247
  /**
13214
13248
  * Generate a new watermark profile
13215
- * @param file The image file to upload
13249
+ * @param input The image stream to upload
13216
13250
  * @param params The watermark creation parameters.
13217
13251
  * @returns The created watermark profile.
13218
13252
  * @throws {BadRequestError} if the parameters are invalid
13219
13253
  * @throws {InvalidURLError} if the URL is invalid
13220
- * @throws {MaxFileSizeError} if the file size is too large
13221
13254
  * @throws {TooManyWatermarksError} if the number of allowed watermarks is reached
13222
13255
  * @throws {InternalError} if an unexpected error occurs
13223
13256
  */
13224
13257
  generate(
13225
- file: File,
13258
+ input: ReadableStream,
13226
13259
  params: StreamWatermarkCreateParams,
13227
13260
  ): Promise<StreamWatermark>;
13228
13261
  /**
@@ -13232,7 +13265,6 @@ export interface StreamWatermarks {
13232
13265
  * @returns The created watermark profile.
13233
13266
  * @throws {BadRequestError} if the parameters are invalid
13234
13267
  * @throws {InvalidURLError} if the URL is invalid
13235
- * @throws {MaxFileSizeError} if the file size is too large
13236
13268
  * @throws {TooManyWatermarksError} if the number of allowed watermarks is reached
13237
13269
  * @throws {InternalError} if an unexpected error occurs
13238
13270
  */
package/package.json CHANGED
@@ -7,5 +7,5 @@
7
7
  },
8
8
  "author": "Cloudflare Workers DevProd Team <workers-devprod@cloudflare.com> (https://workers.cloudflare.com)",
9
9
  "license": "MIT OR Apache-2.0",
10
- "version": "4.20260331.1"
10
+ "version": "4.20260402.1"
11
11
  }