@visulima/storage 1.0.9 → 1.0.10

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 (143) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/adapter/nuxt/module.d.ts +8 -8
  3. package/dist/ai/ai-sdk/index.d.ts +51 -59
  4. package/dist/ai/claude/index.d.ts +104 -119
  5. package/dist/ai/openai/index.d.ts +86 -99
  6. package/dist/ai/tanstack/index.d.ts +53 -61
  7. package/dist/handler/http/fetch/index.d.ts +201 -201
  8. package/dist/handler/http/hono/index.d.ts +59 -59
  9. package/dist/handler/http/nextjs/index.d.ts +54 -54
  10. package/dist/handler/http/node/index.d.ts +233 -246
  11. package/dist/handler/http/solid-start/index.d.ts +54 -54
  12. package/dist/index.d.ts +70 -70
  13. package/dist/index.js +1 -1
  14. package/dist/packem_shared/{AwsLightStorage-BK-WPL0h.js → AwsLightStorage-EsqkAtU5.js} +1 -1
  15. package/dist/packem_shared/{AzureStorage-1UvDIQZd.js → AzureStorage-DL-U7qFG.js} +1 -1
  16. package/dist/packem_shared/BoxMetaStorage-CHWrhgg2.js +1 -0
  17. package/dist/packem_shared/{BoxStorage-DbGqBLux.js → BoxStorage-B8_oCz27.js} +1 -1
  18. package/dist/packem_shared/BunS3MetaStorage-CHWrhgg2.js +1 -0
  19. package/dist/packem_shared/{BunS3Storage-DNvimm9e.js → BunS3Storage-_PVXu_na.js} +1 -1
  20. package/dist/packem_shared/BunnyMetaStorage-CHWrhgg2.js +1 -0
  21. package/dist/packem_shared/{BunnyStorage-C7d0opLL.js → BunnyStorage-BsoWjScH.js} +1 -1
  22. package/dist/packem_shared/CloudinaryMetaStorage-BI9YXcwU.js +1 -0
  23. package/dist/packem_shared/{CloudinaryStorage-Dc3XA2lP.js → CloudinaryStorage-BNwiLF9V.js} +1 -1
  24. package/dist/packem_shared/{DiskStorage-CI07TVNu.js → DiskStorage-D-NtQDms.js} +1 -1
  25. package/dist/packem_shared/{DiskStorageWithChecksum-vFCubS6K.js → DiskStorageWithChecksum-UnCtyEvs.js} +1 -1
  26. package/dist/packem_shared/DropboxMetaStorage-CHWrhgg2.js +1 -0
  27. package/dist/packem_shared/{DropboxStorage-CY9Ggu3m.js → DropboxStorage-BS9kj0nH.js} +1 -1
  28. package/dist/packem_shared/FirebaseMetaStorage-BI9YXcwU.js +1 -0
  29. package/dist/packem_shared/{FirebaseStorage-D6O9CJXN.js → FirebaseStorage-DNquii2p.js} +1 -1
  30. package/dist/packem_shared/FtpMetaStorage-CHWrhgg2.js +1 -0
  31. package/dist/packem_shared/{FtpStorage-DbEjbq8z.js → FtpStorage-Bd004--s.js} +1 -1
  32. package/dist/packem_shared/{GCSMetaStorage-DT8K6zdm.js → GCSMetaStorage-Bf4qDFB1.js} +1 -1
  33. package/dist/packem_shared/{GCStorage-6BHkFlEs.js → GCStorage-ChqEpgqR.js} +1 -1
  34. package/dist/packem_shared/GoogleDriveMetaStorage-xlHfKwmR.js +1 -0
  35. package/dist/packem_shared/{GoogleDriveStorage-Bklsz7Bh.js → GoogleDriveStorage-v1glykjd.js} +1 -1
  36. package/dist/packem_shared/{LocalMetaStorage-BhicZnNl.js → LocalMetaStorage-YWPBYEe7.js} +1 -1
  37. package/dist/packem_shared/NetlifyBlobMetaStorage-BI9YXcwU.js +1 -0
  38. package/dist/packem_shared/{NetlifyBlobStorage-CkpCCoN1.js → NetlifyBlobStorage-BPyEWSnx.js} +1 -1
  39. package/dist/packem_shared/OneDriveMetaStorage-xlHfKwmR.js +1 -0
  40. package/dist/packem_shared/{OneDriveStorage-CP6MvGAa.js → OneDriveStorage-BJ3Kzxc5.js} +1 -1
  41. package/dist/packem_shared/PocketBaseMetaStorage-DnrxOQhO.js +1 -0
  42. package/dist/packem_shared/{PocketBaseStorage-2qhbI2PW.js → PocketBaseStorage-DqKHbbvn.js} +1 -1
  43. package/dist/packem_shared/{S3Storage-YGeNk3Tt.js → S3Storage-BiI2k6d1.js} +1 -1
  44. package/dist/packem_shared/SftpMetaStorage-CHWrhgg2.js +1 -0
  45. package/dist/packem_shared/{SftpStorage-2Hz396Xr.js → SftpStorage-w8XdtZtw.js} +1 -1
  46. package/dist/packem_shared/SharePointMetaStorage-CHWrhgg2.js +1 -0
  47. package/dist/packem_shared/{SharePointStorage-CrX2Pk6C.js → SharePointStorage-DpDpI7Ln.js} +1 -1
  48. package/dist/packem_shared/SupabaseMetaStorage-xlHfKwmR.js +1 -0
  49. package/dist/packem_shared/{SupabaseStorage-Dc_DBX29.js → SupabaseStorage-B_ugUCs7.js} +1 -1
  50. package/dist/packem_shared/UploadThingMetaStorage-BI9YXcwU.js +1 -0
  51. package/dist/packem_shared/{UploadThingStorage-BChykYSe.js → UploadThingStorage-_H45IVqX.js} +1 -1
  52. package/dist/packem_shared/VercelBlobMetaStorage-CHWrhgg2.js +1 -0
  53. package/dist/packem_shared/{VercelBlobStorage-CsRyPfw3.js → VercelBlobStorage-U1YMKeHs.js} +1 -1
  54. package/dist/packem_shared/{approval.d-CMAYH9GF.d.ts → approval.d-C-d-t94D.d.ts} +6 -6
  55. package/dist/packem_shared/disk-storage-BwPk2IRa.js +1 -0
  56. package/dist/packem_shared/disk-storage-with-checksum.d-CQucFacO.d.ts +146 -0
  57. package/dist/packem_shared/{executors.d-BZP2rWo3.d.ts → executors.d-DeDH3Ilt.d.ts} +2 -2
  58. package/dist/packem_shared/files.d-D8H_ge9Y.d.ts +655 -0
  59. package/dist/packem_shared/{gcs-meta-storage-B7BnctnV.js → gcs-meta-storage-DQGu_cHq.js} +1 -1
  60. package/dist/packem_shared/local-meta-storage-DJDcuxf1.js +11 -0
  61. package/dist/packem_shared/{local-meta-storage.d-D9PBfkn6.d.ts → local-meta-storage.d-DuTEzyii.d.ts} +7 -7
  62. package/dist/packem_shared/media-transformer.d-CvMFjINm.d.ts +331 -0
  63. package/dist/packem_shared/{memory-storage.d-4EU1cMt1.d.ts → memory-storage.d-BRdTiY8y.d.ts} +32 -40
  64. package/dist/packem_shared/{s3-base-storage-BoTyhuzO.js → s3-base-storage-CMUui93V.js} +1 -1
  65. package/dist/packem_shared/{s3-base-storage.d-BQgP5B-t.d.ts → s3-base-storage.d-Cg7m4FuH.d.ts} +64 -70
  66. package/dist/packem_shared/storage.d-DIav_lF1.d.ts +1163 -0
  67. package/dist/packem_shared/tus-base.d-BiEg5t4t.d.ts +102 -0
  68. package/dist/packem_shared/{types.d-CrUWY4On.d.ts → types.d-CAAzKiI6.d.ts} +134 -134
  69. package/dist/packem_shared/types.d-DgHhkCAl.d.ts +104 -0
  70. package/dist/packem_shared/{types.d-CggTCgXr.d.ts → types.d-jAs_Rp_v.d.ts} +3 -3
  71. package/dist/storage/aws/clients/index.d.ts +388 -388
  72. package/dist/storage/aws/index.d.ts +109 -113
  73. package/dist/storage/aws/index.js +1 -1
  74. package/dist/storage/aws-light/index.d.ts +63 -67
  75. package/dist/storage/aws-light/index.js +1 -1
  76. package/dist/storage/azure/index.d.ts +133 -139
  77. package/dist/storage/azure/index.js +1 -1
  78. package/dist/storage/box/index.d.ts +88 -92
  79. package/dist/storage/box/index.js +1 -1
  80. package/dist/storage/bun-s3/index.d.ts +70 -76
  81. package/dist/storage/bun-s3/index.js +1 -1
  82. package/dist/storage/bunny/index.d.ts +51 -55
  83. package/dist/storage/bunny/index.js +1 -1
  84. package/dist/storage/cloudinary/index.d.ts +53 -59
  85. package/dist/storage/cloudinary/index.js +1 -1
  86. package/dist/storage/dropbox/index.d.ts +58 -62
  87. package/dist/storage/dropbox/index.js +1 -1
  88. package/dist/storage/firebase/index.d.ts +73 -79
  89. package/dist/storage/firebase/index.js +1 -1
  90. package/dist/storage/ftp/index.d.ts +37 -43
  91. package/dist/storage/ftp/index.js +1 -1
  92. package/dist/storage/gcs/index.d.ts +89 -95
  93. package/dist/storage/gcs/index.js +1 -1
  94. package/dist/storage/google-drive/index.d.ts +68 -72
  95. package/dist/storage/google-drive/index.js +1 -1
  96. package/dist/storage/local/index.d.ts +3 -3
  97. package/dist/storage/local/index.js +1 -1
  98. package/dist/storage/memory/index.d.ts +2 -2
  99. package/dist/storage/netlify-blob/index.d.ts +85 -93
  100. package/dist/storage/netlify-blob/index.js +1 -1
  101. package/dist/storage/onedrive/index.d.ts +43 -53
  102. package/dist/storage/onedrive/index.js +1 -1
  103. package/dist/storage/pocketbase/index.d.ts +66 -72
  104. package/dist/storage/pocketbase/index.js +1 -1
  105. package/dist/storage/sftp/index.d.ts +39 -45
  106. package/dist/storage/sftp/index.js +1 -1
  107. package/dist/storage/sharepoint/index.d.ts +95 -95
  108. package/dist/storage/sharepoint/index.js +1 -1
  109. package/dist/storage/supabase/index.d.ts +49 -55
  110. package/dist/storage/supabase/index.js +1 -1
  111. package/dist/storage/uploadthing/index.d.ts +33 -37
  112. package/dist/storage/uploadthing/index.js +1 -1
  113. package/dist/storage/vercel-blob/index.d.ts +109 -115
  114. package/dist/storage/vercel-blob/index.js +1 -1
  115. package/dist/transformer/audio-transformer.d.ts +96 -96
  116. package/dist/transformer/image-transformer.d.ts +422 -422
  117. package/dist/transformer/index.d.ts +34 -34
  118. package/dist/transformer/video-transformer.d.ts +111 -111
  119. package/package.json +1 -1
  120. package/dist/packem_shared/BoxMetaStorage-BSn6Qfnf.js +0 -1
  121. package/dist/packem_shared/BunS3MetaStorage-BSn6Qfnf.js +0 -1
  122. package/dist/packem_shared/BunnyMetaStorage-BSn6Qfnf.js +0 -1
  123. package/dist/packem_shared/CloudinaryMetaStorage-DPVnmNe5.js +0 -1
  124. package/dist/packem_shared/DropboxMetaStorage-BSn6Qfnf.js +0 -1
  125. package/dist/packem_shared/FirebaseMetaStorage-DPVnmNe5.js +0 -1
  126. package/dist/packem_shared/FtpMetaStorage-BSn6Qfnf.js +0 -1
  127. package/dist/packem_shared/GoogleDriveMetaStorage-Cbwa1CHV.js +0 -1
  128. package/dist/packem_shared/NetlifyBlobMetaStorage-DPVnmNe5.js +0 -1
  129. package/dist/packem_shared/OneDriveMetaStorage-Cbwa1CHV.js +0 -1
  130. package/dist/packem_shared/PocketBaseMetaStorage-DOTLwVE7.js +0 -1
  131. package/dist/packem_shared/SftpMetaStorage-BSn6Qfnf.js +0 -1
  132. package/dist/packem_shared/SharePointMetaStorage-BSn6Qfnf.js +0 -1
  133. package/dist/packem_shared/SupabaseMetaStorage-Cbwa1CHV.js +0 -1
  134. package/dist/packem_shared/UploadThingMetaStorage-DPVnmNe5.js +0 -1
  135. package/dist/packem_shared/VercelBlobMetaStorage-BSn6Qfnf.js +0 -1
  136. package/dist/packem_shared/disk-storage-CsQcYW3s.js +0 -1
  137. package/dist/packem_shared/disk-storage-with-checksum.d-B-VGEsfl.d.ts +0 -156
  138. package/dist/packem_shared/files.d-CH0iLBNC.d.ts +0 -655
  139. package/dist/packem_shared/local-meta-storage-iuJnu90B.js +0 -11
  140. package/dist/packem_shared/media-transformer.d-Quf4ai47.d.ts +0 -331
  141. package/dist/packem_shared/storage.d-CEM1upWM.d.ts +0 -1176
  142. package/dist/packem_shared/tus-base.d-DLzKE54M.d.ts +0 -106
  143. package/dist/packem_shared/types.d-Bon9GVVe.d.ts +0 -104
@@ -1,104 +1,104 @@
1
- import { L as LocalMetaStorageOptions, l as BaseStorageOptions, F as File, M as MetaStorage, d as FileInit, O as OperationOptions, e as FilePart, f as FileQuery, g as FileReturn, B as BaseStorage } from "../../packem_shared/storage.d-CEM1upWM.js";
1
+ import { L as LocalMetaStorageOptions, l as BaseStorageOptions, F as File, M as MetaStorage, d as FileInit, O as OperationOptions, e as FilePart, f as FileQuery, g as FileReturn, B as BaseStorage } from "../../packem_shared/storage.d-DIav_lF1.js";
2
2
  import 'node:stream';
3
- import { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-D9PBfkn6.js";
3
+ import { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-DuTEzyii.js";
4
4
  import { copy, del, list, put } from '@vercel/blob';
5
5
  import 'node:crypto';
6
6
  import 'node:http';
7
7
  import 'lru-cache';
8
8
  interface VercelBlobStorageOptions extends BaseStorageOptions {
9
9
  /**
10
- * Visibility for uploaded blobs. Vercel Blob currently exposes only
11
- * `"public"` in its SDK, but this option is here so callers can pass
12
- * through any future value without forking. Defaults to `"public"`.
13
- */
10
+ * Visibility for uploaded blobs. Vercel Blob currently exposes only
11
+ * `"public"` in its SDK, but this option is here so callers can pass
12
+ * through any future value without forking. Defaults to `"public"`.
13
+ */
14
14
  access?: "public";
15
15
  /**
16
- * Configure metafiles storage
17
- * @example
18
- * Using local metafiles
19
- * ```ts
20
- * const storage = new VercelBlobStorage({
21
- * token: process.env.BLOB_READ_WRITE_TOKEN,
22
- * metaStorageConfig: { directory: '/tmp/upload-metafiles' }
23
- * })
24
- * ```
25
- */
16
+ * Configure metafiles storage
17
+ * @example
18
+ * Using local metafiles
19
+ * ```ts
20
+ * const storage = new VercelBlobStorage({
21
+ * token: process.env.BLOB_READ_WRITE_TOKEN,
22
+ * metaStorageConfig: { directory: '/tmp/upload-metafiles' }
23
+ * })
24
+ * ```
25
+ */
26
26
  metaStorageConfig?: LocalMetaStorageOptions;
27
27
  /**
28
- * Enable multipart uploads for large files
29
- * Can be a boolean to always use multipart, or a number (in bytes) as threshold
30
- * @default false
31
- * @example
32
- * // Always use multipart uploads
33
- * multipart: true
34
- * // Use multipart for files larger than 100MB
35
- * multipart: 100 * 1024 * 1024
36
- */
28
+ * Enable multipart uploads for large files
29
+ * Can be a boolean to always use multipart, or a number (in bytes) as threshold
30
+ * @default false
31
+ * @example
32
+ * // Always use multipart uploads
33
+ * multipart: true
34
+ * // Use multipart for files larger than 100MB
35
+ * multipart: 100 * 1024 * 1024
36
+ */
37
37
  multipart?: boolean | number;
38
38
  /**
39
- * Vercel OIDC token (`VERCEL_OIDC_TOKEN`). Short-lived, auto-rotated, and the
40
- * recommended auth path for projects running on Vercel. Must be paired with
41
- * {@link VercelBlobStorageOptions.storeId} (or `BLOB_STORE_ID` env). Provide
42
- * explicitly for runtimes that don't expose `process.env` (e.g. Vite).
43
- * @see https://vercel.com/docs/vercel-blob/using-blob-sdk#oidc-tokens-recommended
44
- */
39
+ * Vercel OIDC token (`VERCEL_OIDC_TOKEN`). Short-lived, auto-rotated, and the
40
+ * recommended auth path for projects running on Vercel. Must be paired with
41
+ * {@link VercelBlobStorageOptions.storeId} (or `BLOB_STORE_ID` env). Provide
42
+ * explicitly for runtimes that don't expose `process.env` (e.g. Vite).
43
+ * @see https://vercel.com/docs/vercel-blob/using-blob-sdk#oidc-tokens-recommended
44
+ */
45
45
  oidcToken?: string;
46
46
  /**
47
- * Vercel Blob store ID (`BLOB_STORE_ID`). Accepted in either `store_{id}`
48
- * or `{id}` form — the `store_` prefix is stripped automatically. Required
49
- * when authenticating via {@link VercelBlobStorageOptions.oidcToken}.
50
- */
47
+ * Vercel Blob store ID (`BLOB_STORE_ID`). Accepted in either `store_{id}`
48
+ * or `{id}` form — the `store_` prefix is stripped automatically. Required
49
+ * when authenticating via {@link VercelBlobStorageOptions.oidcToken}.
50
+ */
51
51
  storeId?: string;
52
52
  /**
53
- * Vercel Blob read-write token (`BLOB_READ_WRITE_TOKEN`). Long-lived; prefer
54
- * {@link VercelBlobStorageOptions.oidcToken} on Vercel. Always wins over OIDC
55
- * when both are supplied.
56
- */
53
+ * Vercel Blob read-write token (`BLOB_READ_WRITE_TOKEN`). Long-lived; prefer
54
+ * {@link VercelBlobStorageOptions.oidcToken} on Vercel. Always wins over OIDC
55
+ * when both are supplied.
56
+ */
57
57
  token?: string;
58
58
  }
59
59
  declare class VercelBlobFile extends File {
60
60
  /**
61
- * The blob's public URL
62
- */
61
+ * The blob's public URL
62
+ */
63
63
  url?: string;
64
64
  /**
65
- * The blob's download URL (may be different from url for private blobs)
66
- */
65
+ * The blob's download URL (may be different from url for private blobs)
66
+ */
67
67
  downloadUrl?: string;
68
68
  /**
69
- * The blob's pathname within the store
70
- */
69
+ * The blob's pathname within the store
70
+ */
71
71
  pathname?: string;
72
72
  }
73
73
  declare class VercelBlobMetaStorage extends LocalMetaStorage {
74
74
  constructor(config?: LocalMetaStorageOptions);
75
75
  }
76
76
  /**
77
- * Vercel Blob storage based backend.
78
- * @example
79
- * ```ts
80
- * const storage = new VercelBlobStorage({
81
- * token: process.env.BLOB_READ_WRITE_TOKEN,
82
- * metaStorageConfig: { directory: '/tmp/upload-metafiles' }
83
- * });
84
- * ```
85
- * @remarks
86
- * ## Supported Operations
87
- * - ✅ create, write, delete, get, copy, move
88
- * - ✅ Batch operations: deleteBatch, copyBatch, moveBatch (inherited from BaseStorage)
89
- * - ✅ exists: Implemented (checks metadata and Vercel Blob)
90
- * - ❌ getStream: Not implemented (use get() for file retrieval)
91
- * - ❌ list: Not implemented (Vercel Blob API doesn't support listing)
92
- * - ❌ update: Not implemented (Vercel Blob API doesn't support metadata updates)
93
- * - ❌ getUrl: Not implemented (Vercel Blob URLs available via Vercel Blob API)
94
- * - ❌ getUploadUrl: Not implemented (Vercel Blob upload URLs handled internally)
95
- * - ⚠️ Per-operation `signal`/`timeout` are best-effort: the underlying SDK does not support request cancellation, so an in-flight call may complete server-side even after abort. `retries` is honored.
96
- */
77
+ * Vercel Blob storage based backend.
78
+ * @example
79
+ * ```ts
80
+ * const storage = new VercelBlobStorage({
81
+ * token: process.env.BLOB_READ_WRITE_TOKEN,
82
+ * metaStorageConfig: { directory: '/tmp/upload-metafiles' }
83
+ * });
84
+ * ```
85
+ * @remarks
86
+ * ## Supported Operations
87
+ * - ✅ create, write, delete, get, copy, move
88
+ * - ✅ Batch operations: deleteBatch, copyBatch, moveBatch (inherited from BaseStorage)
89
+ * - ✅ exists: Implemented (checks metadata and Vercel Blob)
90
+ * - ❌ getStream: Not implemented (use get() for file retrieval)
91
+ * - ❌ list: Not implemented (Vercel Blob API doesn't support listing)
92
+ * - ❌ update: Not implemented (Vercel Blob API doesn't support metadata updates)
93
+ * - ❌ getUrl: Not implemented (Vercel Blob URLs available via Vercel Blob API)
94
+ * - ❌ getUploadUrl: Not implemented (Vercel Blob upload URLs handled internally)
95
+ * - ⚠️ Per-operation `signal`/`timeout` are best-effort: the underlying SDK does not support request cancellation, so an in-flight call may complete server-side even after abort. `retries` is honored.
96
+ */
97
97
  /**
98
- * Auth credentials resolved at construction and forwarded verbatim to every
99
- * `@vercel/blob` SDK call. Mirrors the SDK's `BlobCommandOptions` shape so
100
- * env-based auto-pickup is never required.
101
- */
98
+ * Auth credentials resolved at construction and forwarded verbatim to every
99
+ * `@vercel/blob` SDK call. Mirrors the SDK's `BlobCommandOptions` shape so
100
+ * env-based auto-pickup is never required.
101
+ */
102
102
  type VercelBlobCredentials = {
103
103
  oidcToken: string;
104
104
  storeId: string;
@@ -124,66 +124,60 @@ declare class VercelBlobStorage extends BaseStorage<VercelBlobFile> {
124
124
  private readonly access;
125
125
  constructor(config: VercelBlobStorageOptions);
126
126
  /**
127
- * Resolves auth credentials in the same precedence as `@vercel/blob`:
128
- *
129
- * 1. Explicit `token` (RW or client token) — always wins.
130
- * 2. OIDC pair (`oidcToken` + `storeId`), from options or env.
131
- * 3. `BLOB_READ_WRITE_TOKEN` / `VERCEL_BLOB_TOKEN` env.
132
- *
133
- * Throws if no credentials are found, or if OIDC config is partial (one of
134
- * the two values present without the other) so callers fail loudly instead
135
- * of silently dropping to anonymous calls that 401 at runtime.
136
- */
127
+ * Resolves auth credentials in the same precedence as `@vercel/blob`:
128
+ *
129
+ * 1. Explicit `token` (RW or client token) — always wins.
130
+ * 2. OIDC pair (`oidcToken` + `storeId`), from options or env.
131
+ * 3. `BLOB_READ_WRITE_TOKEN` / `VERCEL_BLOB_TOKEN` env.
132
+ *
133
+ * Throws if no credentials are found, or if OIDC config is partial (one of
134
+ * the two values present without the other) so callers fail loudly instead
135
+ * of silently dropping to anonymous calls that 401 at runtime.
136
+ */
137
137
  private static resolveCredentials;
138
138
  create(config: FileInit, _options?: OperationOptions): Promise<VercelBlobFile>;
139
139
  write(part: FilePart | FileQuery | VercelBlobFile, options?: OperationOptions): Promise<VercelBlobFile>;
140
140
  /**
141
- * Deletes an upload and its metadata.
142
- * @param query File query containing the file ID to delete.
143
- * @param query.id File ID to delete.
144
- * @returns Promise resolving to the deleted file object with status: "deleted".
145
- * @throws {UploadError} If the file metadata cannot be found.
146
- */
147
- delete({
148
- id
149
- }: FileQuery, options?: OperationOptions): Promise<VercelBlobFile>;
141
+ * Deletes an upload and its metadata.
142
+ * @param query File query containing the file ID to delete.
143
+ * @param query.id File ID to delete.
144
+ * @returns Promise resolving to the deleted file object with status: "deleted".
145
+ * @throws {UploadError} If the file metadata cannot be found.
146
+ */
147
+ delete({ id }: FileQuery, options?: OperationOptions): Promise<VercelBlobFile>;
150
148
  /**
151
- * Checks if a file exists by verifying both metadata and the actual Vercel Blob.
152
- * Returns true only if both the metadata and the blob exist.
153
- * @param query File query containing the file ID to check.
154
- * @returns Promise resolving to true if both metadata and blob exist, false otherwise.
155
- */
156
- override exists({
157
- id
158
- }: FileQuery, options?: OperationOptions): Promise<boolean>;
159
- get({
160
- id
161
- }: FileQuery, options?: OperationOptions): Promise<FileReturn>;
149
+ * Checks if a file exists by verifying both metadata and the actual Vercel Blob.
150
+ * Returns true only if both the metadata and the blob exist.
151
+ * @param query File query containing the file ID to check.
152
+ * @returns Promise resolving to true if both metadata and blob exist, false otherwise.
153
+ */
154
+ override exists({ id }: FileQuery, options?: OperationOptions): Promise<boolean>;
155
+ get({ id }: FileQuery, options?: OperationOptions): Promise<FileReturn>;
162
156
  /**
163
- * Copies an upload file to a new location.
164
- * @param name Source file name/ID.
165
- * @param destination Destination file name/ID.
166
- * @returns Promise resolving to the copied file object.
167
- * @throws {UploadError} If the source file cannot be found.
168
- */
157
+ * Copies an upload file to a new location.
158
+ * @param name Source file name/ID.
159
+ * @param destination Destination file name/ID.
160
+ * @returns Promise resolving to the copied file object.
161
+ * @throws {UploadError} If the source file cannot be found.
162
+ */
169
163
  copy(name: string, destination: string, options?: OperationOptions & {
170
164
  storageClass?: string;
171
165
  }): Promise<VercelBlobFile>;
172
166
  /**
173
- * Moves an upload file to a new location.
174
- * @param name Source file name/ID.
175
- * @param destination Destination file name/ID.
176
- * @returns Promise resolving to the moved file object.
177
- * @throws {UploadError} If the source file cannot be found.
178
- */
167
+ * Moves an upload file to a new location.
168
+ * @param name Source file name/ID.
169
+ * @param destination Destination file name/ID.
170
+ * @returns Promise resolving to the moved file object.
171
+ * @throws {UploadError} If the source file cannot be found.
172
+ */
179
173
  move(name: string, destination: string, options?: OperationOptions): Promise<VercelBlobFile>;
180
174
  override list(limit?: number, options?: OperationOptions): Promise<VercelBlobFile[]>;
181
175
  private internalOnComplete;
182
176
  /**
183
- * Determines if multipart upload should be used for the given file.
184
- * @param file File object to check.
185
- * @returns True if multipart upload should be used, false otherwise.
186
- */
177
+ * Determines if multipart upload should be used for the given file.
178
+ * @param file File object to check.
179
+ * @returns True if multipart upload should be used, false otherwise.
180
+ */
187
181
  private shouldUseMultipart;
188
182
  }
189
183
  export { VercelBlobFile, VercelBlobMetaStorage, VercelBlobStorage, type VercelBlobStorageOptions };
@@ -1 +1 @@
1
- import{default as r}from"../../packem_shared/VercelBlobFile-CVQwKlZk.js";import{default as a}from"../../packem_shared/VercelBlobMetaStorage-BSn6Qfnf.js";import{default as f}from"../../packem_shared/VercelBlobStorage-CsRyPfw3.js";export{r as VercelBlobFile,a as VercelBlobMetaStorage,f as VercelBlobStorage};
1
+ import{default as r}from"../../packem_shared/VercelBlobFile-CVQwKlZk.js";import{default as a}from"../../packem_shared/VercelBlobMetaStorage-CHWrhgg2.js";import{default as f}from"../../packem_shared/VercelBlobStorage-U1YMKeHs.js";export{r as VercelBlobFile,a as VercelBlobMetaStorage,f as VercelBlobStorage};
@@ -1,130 +1,130 @@
1
- import { F as File, g as FileReturn, B as BaseStorage } from "../packem_shared/storage.d-CEM1upWM.js";
2
- import { A as AudioTransformerConfig, b as AudioTransformResult, c as AudioResampleOptions, d as AudioChannelMixOptions, e as AudioTransformOptions, f as AudioTransformationStep, B as BaseTransformer } from "../packem_shared/types.d-CrUWY4On.js";
1
+ import { F as File, g as FileReturn, B as BaseStorage } from "../packem_shared/storage.d-DIav_lF1.js";
2
+ import { A as AudioTransformerConfig, b as AudioTransformResult, c as AudioResampleOptions, d as AudioChannelMixOptions, e as AudioTransformOptions, f as AudioTransformationStep, B as BaseTransformer } from "../packem_shared/types.d-CAAzKiI6.js";
3
3
  import 'node:stream';
4
4
  import 'node:crypto';
5
5
  import 'node:http';
6
6
  import 'lru-cache';
7
7
  /**
8
- * Audio transformer that uses storage backends and Mediabunny to retrieve and transform audio files
9
- *
10
- * Supports audio transformations with query parameters for on-demand audio processing.
11
- * @example
12
- * ```ts
13
- * const transformer = new AudioTransformer(storage, {
14
- * maxAudioSize: 50 * 1024 * 1024, // 50MB
15
- * cache: new Map()
16
- * });
17
- *
18
- * // Programmatic usage - resample audio
19
- * const result = await transformer.resample('audio-id', {
20
- * sampleRate: 44100
21
- * });
22
- *
23
- * // URL-based transformations
24
- * // GET /files/audio-id?sampleRate=48000&codec=aac&bitrate=128000
25
- * // GET /files/audio-id?numberOfChannels=1&format=mp3
26
- * ```
27
- *
28
- * ## Supported Query Parameters
29
- *
30
- * - `sampleRate`: Sample rate in Hz (Number)
31
- * - `numberOfChannels`: Number of channels (Number)
32
- * - `codec`: Audio codec - aac/opus/mp3/vorbis/flac
33
- * - `bitrate`: Audio bitrate in bits per second (Number)
34
- * - `format`: Output format - mp3/wav/ogg/aac/flac
35
- */
8
+ * Audio transformer that uses storage backends and Mediabunny to retrieve and transform audio files
9
+ *
10
+ * Supports audio transformations with query parameters for on-demand audio processing.
11
+ * @example
12
+ * ```ts
13
+ * const transformer = new AudioTransformer(storage, {
14
+ * maxAudioSize: 50 * 1024 * 1024, // 50MB
15
+ * cache: new Map()
16
+ * });
17
+ *
18
+ * // Programmatic usage - resample audio
19
+ * const result = await transformer.resample('audio-id', {
20
+ * sampleRate: 44100
21
+ * });
22
+ *
23
+ * // URL-based transformations
24
+ * // GET /files/audio-id?sampleRate=48000&codec=aac&bitrate=128000
25
+ * // GET /files/audio-id?numberOfChannels=1&format=mp3
26
+ * ```
27
+ *
28
+ * ## Supported Query Parameters
29
+ *
30
+ * - `sampleRate`: Sample rate in Hz (Number)
31
+ * - `numberOfChannels`: Number of channels (Number)
32
+ * - `codec`: Audio codec - aac/opus/mp3/vorbis/flac
33
+ * - `bitrate`: Audio bitrate in bits per second (Number)
34
+ * - `format`: Output format - mp3/wav/ogg/aac/flac
35
+ */
36
36
  declare class AudioTransformer<TFile extends File = File, TFileReturn extends FileReturn = FileReturn> extends BaseTransformer<AudioTransformerConfig, AudioTransformResult<TFileReturn>, TFile, TFileReturn> {
37
37
  /**
38
- * Creates a new AudioTransformer instance.
39
- * @param storage The storage backend for retrieving and storing audio files.
40
- * @param config Configuration options for audio transformation including cache settings, codec defaults, and size limits.
41
- */
38
+ * Creates a new AudioTransformer instance.
39
+ * @param storage The storage backend for retrieving and storing audio files.
40
+ * @param config Configuration options for audio transformation including cache settings, codec defaults, and size limits.
41
+ */
42
42
  constructor(storage: BaseStorage<TFile, TFileReturn>, config?: AudioTransformerConfig);
43
43
  /**
44
- * Resamples audio to different sample rate.
45
- * @param fileId Unique identifier of the audio file to resample.
46
- * @param options Resample options including target sample rate.
47
- * @returns Promise resolving to transformed audio result.
48
- */
44
+ * Resamples audio to different sample rate.
45
+ * @param fileId Unique identifier of the audio file to resample.
46
+ * @param options Resample options including target sample rate.
47
+ * @returns Promise resolving to transformed audio result.
48
+ */
49
49
  resample(fileId: string, options: AudioResampleOptions): Promise<AudioTransformResult<TFileReturn>>;
50
50
  /**
51
- * Changes number of channels (up/downmixing).
52
- * @param fileId Unique identifier of the audio file to process.
53
- * @param options Channel mix options including target number of channels.
54
- * @returns Promise resolving to transformed audio result.
55
- */
51
+ * Changes number of channels (up/downmixing).
52
+ * @param fileId Unique identifier of the audio file to process.
53
+ * @param options Channel mix options including target number of channels.
54
+ * @returns Promise resolving to transformed audio result.
55
+ */
56
56
  mixChannels(fileId: string, options: AudioChannelMixOptions): Promise<AudioTransformResult<TFileReturn>>;
57
57
  /**
58
- * Converts audio format or codec.
59
- * @param fileId Unique identifier of the audio file to convert.
60
- * @param format Target audio format (e.g., "mp3", "wav", "ogg").
61
- * @param options Additional transform options.
62
- * @returns Promise resolving to transformed audio result.
63
- */
58
+ * Converts audio format or codec.
59
+ * @param fileId Unique identifier of the audio file to convert.
60
+ * @param format Target audio format (e.g., "mp3", "wav", "ogg").
61
+ * @param options Additional transform options.
62
+ * @returns Promise resolving to transformed audio result.
63
+ */
64
64
  convertFormat(fileId: string, format: string, options?: AudioTransformOptions): Promise<AudioTransformResult<TFileReturn>>;
65
65
  /**
66
- * Transcodes audio to different codec.
67
- * @param fileId Unique identifier of the audio file to transcode.
68
- * @param codec Target audio codec (e.g., "aac", "opus", "mp3").
69
- * @param options Additional transform options.
70
- * @returns Promise resolving to transformed audio result.
71
- */
66
+ * Transcodes audio to different codec.
67
+ * @param fileId Unique identifier of the audio file to transcode.
68
+ * @param codec Target audio codec (e.g., "aac", "opus", "mp3").
69
+ * @param options Additional transform options.
70
+ * @returns Promise resolving to transformed audio result.
71
+ */
72
72
  transcode(fileId: string, codec: AudioTransformOptions["codec"], options?: Omit<AudioTransformOptions, "codec">): Promise<AudioTransformResult<TFileReturn>>;
73
73
  /**
74
- * Applies a custom transformation pipeline to an audio file.
75
- * @param fileId Unique identifier of the audio file to transform.
76
- * @param steps Array of transformation steps to apply in sequence.
77
- * @returns Promise resolving to transformed audio result.
78
- */
74
+ * Applies a custom transformation pipeline to an audio file.
75
+ * @param fileId Unique identifier of the audio file to transform.
76
+ * @param steps Array of transformation steps to apply in sequence.
77
+ * @returns Promise resolving to transformed audio result.
78
+ */
79
79
  transform(fileId: string, steps: AudioTransformationStep[]): Promise<AudioTransformResult<TFileReturn>>;
80
80
  /**
81
- * Apply multiple transformations in sequence using Mediabunny
82
- */
81
+ * Apply multiple transformations in sequence using Mediabunny
82
+ */
83
83
  private applyTransformations;
84
84
  /**
85
- * Convert transformation steps to Mediabunny audio options
86
- * @param steps Array of audio transformation steps to convert
87
- * @returns Mediabunny audio options object for conversion
88
- * @private
89
- */
85
+ * Convert transformation steps to Mediabunny audio options
86
+ * @param steps Array of audio transformation steps to convert
87
+ * @returns Mediabunny audio options object for conversion
88
+ * @private
89
+ */
90
90
  private stepsToAudioOptions;
91
91
  /**
92
- * Determine output format based on transformation steps
93
- * @param steps Array of audio transformation steps
94
- * @returns Mediabunny output format instance (defaults to MP3)
95
- * @private
96
- */
92
+ * Determine output format based on transformation steps
93
+ * @param steps Array of audio transformation steps
94
+ * @returns Mediabunny output format instance (defaults to MP3)
95
+ * @private
96
+ */
97
97
  private determineOutputFormat;
98
98
  /**
99
- * Convert format string to Mediabunny output format
100
- * @param format Audio format string (aac, flac, mp3, ogg, wav)
101
- * @returns Mediabunny output format instance
102
- * @private
103
- */
99
+ * Convert format string to Mediabunny output format
100
+ * @param format Audio format string (aac, flac, mp3, ogg, wav)
101
+ * @returns Mediabunny output format instance
102
+ * @private
103
+ */
104
104
  private formatStringToOutputFormat;
105
105
  /**
106
- * Validate that the file is a supported audio file
107
- * @param file The file to validate
108
- * @returns Promise that resolves if validation passes
109
- * @throws Error if file size exceeds limits, wrong content type, unsupported format, or invalid audio
110
- * @private
111
- */
106
+ * Validate that the file is a supported audio file
107
+ * @param file The file to validate
108
+ * @returns Promise that resolves if validation passes
109
+ * @throws Error if file size exceeds limits, wrong content type, unsupported format, or invalid audio
110
+ * @private
111
+ */
112
112
  private validateAudio;
113
113
  /**
114
- * Create transformation result with metadata
115
- * @param buffer The transformed audio buffer
116
- * @param originalFile The original file information
117
- * @returns Audio transformation result with metadata
118
- * @private
119
- */
114
+ * Create transformation result with metadata
115
+ * @param buffer The transformed audio buffer
116
+ * @param originalFile The original file information
117
+ * @returns Audio transformation result with metadata
118
+ * @private
119
+ */
120
120
  private createTransformResult;
121
121
  /**
122
- * Generate cache key for transformation
123
- * @param fileId The file identifier
124
- * @param steps Array of transformation steps
125
- * @returns Unique cache key string
126
- * @private
127
- */
122
+ * Generate cache key for transformation
123
+ * @param fileId The file identifier
124
+ * @param steps Array of transformation steps
125
+ * @returns Unique cache key string
126
+ * @private
127
+ */
128
128
  private generateCacheKey;
129
129
  }
130
130
  export { AudioTransformer as default };