@workers-community/workers-types 4.20260331.1 → 4.20260401.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.
Files changed (3) hide show
  1. package/index.d.ts +34 -7
  2. package/index.ts +34 -7
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -3769,12 +3769,42 @@ interface Container {
3769
3769
  setInactivityTimeout(durationMs: number | bigint): Promise<void>;
3770
3770
  interceptOutboundHttp(addr: string, binding: Fetcher): Promise<void>;
3771
3771
  interceptAllOutboundHttp(binding: Fetcher): Promise<void>;
3772
+ snapshotDirectory(
3773
+ options: ContainerDirectorySnapshotOptions,
3774
+ ): Promise<ContainerDirectorySnapshot>;
3775
+ snapshotContainer(
3776
+ options: ContainerSnapshotOptions,
3777
+ ): Promise<ContainerSnapshot>;
3778
+ }
3779
+ interface ContainerDirectorySnapshot {
3780
+ id: string;
3781
+ size: number;
3782
+ dir: string;
3783
+ name?: string;
3784
+ }
3785
+ interface ContainerDirectorySnapshotOptions {
3786
+ dir: string;
3787
+ name?: string;
3788
+ }
3789
+ interface ContainerDirectorySnapshotRestoreParams {
3790
+ snapshot: ContainerDirectorySnapshot;
3791
+ mountPoint?: string;
3792
+ }
3793
+ interface ContainerSnapshot {
3794
+ id: string;
3795
+ size: number;
3796
+ name?: string;
3797
+ }
3798
+ interface ContainerSnapshotOptions {
3799
+ name?: string;
3772
3800
  }
3773
3801
  interface ContainerStartupOptions {
3774
3802
  entrypoint?: string[];
3775
3803
  enableInternet: boolean;
3776
3804
  env?: Record<string, string>;
3777
3805
  labels?: Record<string, string>;
3806
+ directorySnapshots?: ContainerDirectorySnapshotRestoreParams[];
3807
+ containerSnapshot?: ContainerSnapshot;
3778
3808
  }
3779
3809
  /**
3780
3810
  * 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.
@@ -13279,14 +13309,13 @@ interface StreamScopedCaptions {
13279
13309
  * Uploads the caption or subtitle file to the endpoint for a specific BCP47 language.
13280
13310
  * One caption or subtitle file per language is allowed.
13281
13311
  * @param language The BCP 47 language tag for the caption or subtitle.
13282
- * @param file The caption or subtitle file to upload.
13312
+ * @param input The caption or subtitle stream to upload.
13283
13313
  * @returns The created caption entry.
13284
13314
  * @throws {NotFoundError} if the video is not found
13285
13315
  * @throws {BadRequestError} if the language or file is invalid
13286
- * @throws {MaxFileSizeError} if the file size is too large
13287
13316
  * @throws {InternalError} if an unexpected error occurs
13288
13317
  */
13289
- upload(language: string, file: File): Promise<StreamCaption>;
13318
+ upload(language: string, input: ReadableStream): Promise<StreamCaption>;
13290
13319
  /**
13291
13320
  * Generate captions or subtitles for the provided language via AI.
13292
13321
  * @param language The BCP 47 language tag to generate.
@@ -13362,17 +13391,16 @@ interface StreamVideos {
13362
13391
  interface StreamWatermarks {
13363
13392
  /**
13364
13393
  * Generate a new watermark profile
13365
- * @param file The image file to upload
13394
+ * @param input The image stream to upload
13366
13395
  * @param params The watermark creation parameters.
13367
13396
  * @returns The created watermark profile.
13368
13397
  * @throws {BadRequestError} if the parameters are invalid
13369
13398
  * @throws {InvalidURLError} if the URL is invalid
13370
- * @throws {MaxFileSizeError} if the file size is too large
13371
13399
  * @throws {TooManyWatermarksError} if the number of allowed watermarks is reached
13372
13400
  * @throws {InternalError} if an unexpected error occurs
13373
13401
  */
13374
13402
  generate(
13375
- file: File,
13403
+ input: ReadableStream,
13376
13404
  params: StreamWatermarkCreateParams,
13377
13405
  ): Promise<StreamWatermark>;
13378
13406
  /**
@@ -13382,7 +13410,6 @@ interface StreamWatermarks {
13382
13410
  * @returns The created watermark profile.
13383
13411
  * @throws {BadRequestError} if the parameters are invalid
13384
13412
  * @throws {InvalidURLError} if the URL is invalid
13385
- * @throws {MaxFileSizeError} if the file size is too large
13386
13413
  * @throws {TooManyWatermarksError} if the number of allowed watermarks is reached
13387
13414
  * @throws {InternalError} if an unexpected error occurs
13388
13415
  */
package/index.ts CHANGED
@@ -3775,12 +3775,42 @@ export interface Container {
3775
3775
  setInactivityTimeout(durationMs: number | bigint): Promise<void>;
3776
3776
  interceptOutboundHttp(addr: string, binding: Fetcher): Promise<void>;
3777
3777
  interceptAllOutboundHttp(binding: Fetcher): Promise<void>;
3778
+ snapshotDirectory(
3779
+ options: ContainerDirectorySnapshotOptions,
3780
+ ): Promise<ContainerDirectorySnapshot>;
3781
+ snapshotContainer(
3782
+ options: ContainerSnapshotOptions,
3783
+ ): Promise<ContainerSnapshot>;
3784
+ }
3785
+ export interface ContainerDirectorySnapshot {
3786
+ id: string;
3787
+ size: number;
3788
+ dir: string;
3789
+ name?: string;
3790
+ }
3791
+ export interface ContainerDirectorySnapshotOptions {
3792
+ dir: string;
3793
+ name?: string;
3794
+ }
3795
+ export interface ContainerDirectorySnapshotRestoreParams {
3796
+ snapshot: ContainerDirectorySnapshot;
3797
+ mountPoint?: string;
3798
+ }
3799
+ export interface ContainerSnapshot {
3800
+ id: string;
3801
+ size: number;
3802
+ name?: string;
3803
+ }
3804
+ export interface ContainerSnapshotOptions {
3805
+ name?: string;
3778
3806
  }
3779
3807
  export interface ContainerStartupOptions {
3780
3808
  entrypoint?: string[];
3781
3809
  enableInternet: boolean;
3782
3810
  env?: Record<string, string>;
3783
3811
  labels?: Record<string, string>;
3812
+ directorySnapshots?: ContainerDirectorySnapshotRestoreParams[];
3813
+ containerSnapshot?: ContainerSnapshot;
3784
3814
  }
3785
3815
  /**
3786
3816
  * 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.
@@ -13236,14 +13266,13 @@ export interface StreamScopedCaptions {
13236
13266
  * Uploads the caption or subtitle file to the endpoint for a specific BCP47 language.
13237
13267
  * One caption or subtitle file per language is allowed.
13238
13268
  * @param language The BCP 47 language tag for the caption or subtitle.
13239
- * @param file The caption or subtitle file to upload.
13269
+ * @param input The caption or subtitle stream to upload.
13240
13270
  * @returns The created caption entry.
13241
13271
  * @throws {NotFoundError} if the video is not found
13242
13272
  * @throws {BadRequestError} if the language or file is invalid
13243
- * @throws {MaxFileSizeError} if the file size is too large
13244
13273
  * @throws {InternalError} if an unexpected error occurs
13245
13274
  */
13246
- upload(language: string, file: File): Promise<StreamCaption>;
13275
+ upload(language: string, input: ReadableStream): Promise<StreamCaption>;
13247
13276
  /**
13248
13277
  * Generate captions or subtitles for the provided language via AI.
13249
13278
  * @param language The BCP 47 language tag to generate.
@@ -13319,17 +13348,16 @@ export interface StreamVideos {
13319
13348
  export interface StreamWatermarks {
13320
13349
  /**
13321
13350
  * Generate a new watermark profile
13322
- * @param file The image file to upload
13351
+ * @param input The image stream to upload
13323
13352
  * @param params The watermark creation parameters.
13324
13353
  * @returns The created watermark profile.
13325
13354
  * @throws {BadRequestError} if the parameters are invalid
13326
13355
  * @throws {InvalidURLError} if the URL is invalid
13327
- * @throws {MaxFileSizeError} if the file size is too large
13328
13356
  * @throws {TooManyWatermarksError} if the number of allowed watermarks is reached
13329
13357
  * @throws {InternalError} if an unexpected error occurs
13330
13358
  */
13331
13359
  generate(
13332
- file: File,
13360
+ input: ReadableStream,
13333
13361
  params: StreamWatermarkCreateParams,
13334
13362
  ): Promise<StreamWatermark>;
13335
13363
  /**
@@ -13339,7 +13367,6 @@ export interface StreamWatermarks {
13339
13367
  * @returns The created watermark profile.
13340
13368
  * @throws {BadRequestError} if the parameters are invalid
13341
13369
  * @throws {InvalidURLError} if the URL is invalid
13342
- * @throws {MaxFileSizeError} if the file size is too large
13343
13370
  * @throws {TooManyWatermarksError} if the number of allowed watermarks is reached
13344
13371
  * @throws {InternalError} if an unexpected error occurs
13345
13372
  */
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "author": "Workers Community",
9
9
  "license": "MIT OR Apache-2.0",
10
- "version": "4.20260331.1",
10
+ "version": "4.20260401.1",
11
11
  "exports": {
12
12
  ".": {
13
13
  "types": "./index.d.ts",