@dropgate/core 2.2.0-beta.2 → 2.2.0

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/dist/index.d.cts CHANGED
@@ -71,6 +71,8 @@ interface UploadCapabilities {
71
71
  maxSizeMB?: number;
72
72
  /** Maximum file lifetime in hours (0 = unlimited). */
73
73
  maxLifetimeHours?: number;
74
+ /** Maximum downloads before file is deleted (0 = unlimited). */
75
+ maxFileDownloads?: number;
74
76
  /** Whether end-to-end encryption is supported. */
75
77
  e2ee?: boolean;
76
78
  }
@@ -286,6 +288,8 @@ interface UploadOptions extends ServerTarget {
286
288
  onProgress?: (evt: UploadProgressEvent) => void;
287
289
  /** Callback when upload is cancelled by user. */
288
290
  onCancel?: () => void;
291
+ /** Max downloads before file is deleted (0 = unlimited). */
292
+ maxDownloads?: number;
289
293
  /** AbortSignal to cancel the upload. */
290
294
  signal?: AbortSignal;
291
295
  /** Timeout settings for various upload phases. */
package/dist/index.d.ts CHANGED
@@ -71,6 +71,8 @@ interface UploadCapabilities {
71
71
  maxSizeMB?: number;
72
72
  /** Maximum file lifetime in hours (0 = unlimited). */
73
73
  maxLifetimeHours?: number;
74
+ /** Maximum downloads before file is deleted (0 = unlimited). */
75
+ maxFileDownloads?: number;
74
76
  /** Whether end-to-end encryption is supported. */
75
77
  e2ee?: boolean;
76
78
  }
@@ -286,6 +288,8 @@ interface UploadOptions extends ServerTarget {
286
288
  onProgress?: (evt: UploadProgressEvent) => void;
287
289
  /** Callback when upload is cancelled by user. */
288
290
  onCancel?: () => void;
291
+ /** Max downloads before file is deleted (0 = unlimited). */
292
+ maxDownloads?: number;
289
293
  /** AbortSignal to cancel the upload. */
290
294
  signal?: AbortSignal;
291
295
  /** Timeout settings for various upload phases. */
package/dist/index.js CHANGED
@@ -529,6 +529,7 @@ var DropgateClient = class {
529
529
  file,
530
530
  lifetimeMs,
531
531
  encrypt,
532
+ maxDownloads,
532
533
  filenameOverride,
533
534
  onProgress,
534
535
  onCancel,
@@ -607,7 +608,8 @@ var DropgateClient = class {
607
608
  lifetime: lifetimeMs,
608
609
  isEncrypted: effectiveEncrypt,
609
610
  totalSize: totalUploadSize,
610
- totalChunks
611
+ totalChunks,
612
+ ...maxDownloads !== void 0 ? { maxDownloads } : {}
611
613
  };
612
614
  const initRes = await fetchJson(this.fetchFn, `${baseUrl}/upload/init`, {
613
615
  method: "POST",