@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,303 +1,303 @@
1
- import { U as UploadFile, m as UploadResponse } from "../../../packem_shared/storage.d-CEM1upWM.js";
1
+ import { U as UploadFile, m as UploadResponse } from "../../../packem_shared/storage.d-DIav_lF1.js";
2
2
  import 'node:stream';
3
- import { H as Handlers, R as ResponseFile, a as ResponseList, U as UploadOptions } from "../../../packem_shared/types.d-CggTCgXr.js";
4
- export type { A as AsyncHandler, B as BaseHandler, M as MethodHandler, b as RequestEvent, c as UploadErrorEvent, d as UploadEvent } from "../../../packem_shared/types.d-CggTCgXr.js";
5
- import { B as BaseHandlerCore } from "../../../packem_shared/tus-base.d-DLzKE54M.js";
6
- export { T as TUS_RESUMABLE, a as TUS_VERSION } from "../../../packem_shared/tus-base.d-DLzKE54M.js";
3
+ import { H as Handlers, R as ResponseFile, a as ResponseList, U as UploadOptions } from "../../../packem_shared/types.d-jAs_Rp_v.js";
4
+ export type { A as AsyncHandler, B as BaseHandler, M as MethodHandler, b as RequestEvent, c as UploadErrorEvent, d as UploadEvent } from "../../../packem_shared/types.d-jAs_Rp_v.js";
5
+ import { B as BaseHandlerCore } from "../../../packem_shared/tus-base.d-BiEg5t4t.js";
6
+ export { T as TUS_RESUMABLE, a as TUS_VERSION } from "../../../packem_shared/tus-base.d-BiEg5t4t.js";
7
7
  import 'node:crypto';
8
8
  import 'node:http';
9
9
  import 'lru-cache';
10
10
  import 'node:events';
11
11
  import '@visulima/pagination';
12
- import "../../../packem_shared/media-transformer.d-Quf4ai47.js";
13
- import "../../../packem_shared/types.d-CrUWY4On.js";
12
+ import "../../../packem_shared/media-transformer.d-CvMFjINm.js";
13
+ import "../../../packem_shared/types.d-CAAzKiI6.js";
14
14
  /**
15
- * Base handler for Web API Fetch platform (Request/Response).
16
- * Extends BaseHandlerCore with Fetch-specific request/response handling.
17
- * @template TFile The file type used by this handler.
18
- */
15
+ * Base handler for Web API Fetch platform (Request/Response).
16
+ * Extends BaseHandlerCore with Fetch-specific request/response handling.
17
+ * @template TFile The file type used by this handler.
18
+ */
19
19
  declare abstract class BaseHandlerFetch<TFile extends UploadFile> extends BaseHandlerCore<TFile> {
20
20
  /**
21
- * Limiting enabled HTTP method handler.
22
- */
21
+ * Limiting enabled HTTP method handler.
22
+ */
23
23
  static readonly methods: Handlers[];
24
24
  /**
25
- * Map of registered HTTP method handlers.
26
- */
25
+ * Map of registered HTTP method handlers.
26
+ */
27
27
  protected registeredHandlers: Map<string, (request: Request) => Promise<ResponseFile<TFile> | ResponseList<TFile>>>;
28
28
  constructor(options: UploadOptions<TFile>);
29
29
  /**
30
- * Gets the registered handlers map.
31
- * @returns Map of registered handlers.
32
- */
30
+ * Gets the registered handlers map.
31
+ * @returns Map of registered handlers.
32
+ */
33
33
  get handlers(): Map<string, (request: Request) => Promise<ResponseFile<TFile> | ResponseList<TFile>>>;
34
34
  /**
35
- * Handles Web API Fetch requests (for Hono, Cloudflare Workers, etc.).
36
- * @param request Web API Request object.
37
- * @returns Promise resolving to Web API Response.
38
- */
35
+ * Handles Web API Fetch requests (for Hono, Cloudflare Workers, etc.).
36
+ * @param request Web API Request object.
37
+ * @returns Promise resolving to Web API Response.
38
+ */
39
39
  fetch(request: Request): Promise<globalThis.Response>;
40
40
  /**
41
- * Compose and register HTTP method handlers.
42
- * Subclasses should override this to register their specific handlers.
43
- */
41
+ * Compose and register HTTP method handlers.
42
+ * Subclasses should override this to register their specific handlers.
43
+ */
44
44
  protected abstract compose(): void;
45
45
  /**
46
- * Handle the response from handlers for fetch requests and convert to Web API Response.
47
- * @param request Web API Request object
48
- * @param file Response file or list from handler
49
- * @returns Promise resolving to Web API Response object
50
- */
46
+ * Handle the response from handlers for fetch requests and convert to Web API Response.
47
+ * @param request Web API Request object
48
+ * @param file Response file or list from handler
49
+ * @returns Promise resolving to Web API Response object
50
+ */
51
51
  protected handleFetchResponse(request: Request, file: ResponseFile<TFile> | ResponseList<TFile>): Promise<globalThis.Response>;
52
52
  /**
53
- * Convert headers to Web API Headers format by flattening arrays and converting to strings.
54
- * @param headers Headers object with potentially array values
55
- * @returns Headers object with all values as strings
56
- */
53
+ * Convert headers to Web API Headers format by flattening arrays and converting to strings.
54
+ * @param headers Headers object with potentially array values
55
+ * @returns Headers object with all values as strings
56
+ */
57
57
  protected convertHeaders(headers: Record<string, number | string | string[]>): Record<string, string>;
58
58
  /**
59
- * Create Web API Response from UploadResponse object.
60
- * @param uploadResponse Upload response containing body, headers, and status code
61
- * @returns Web API Response object
62
- */
59
+ * Create Web API Response from UploadResponse object.
60
+ * @param uploadResponse Upload response containing body, headers, and status code
61
+ * @returns Web API Response object
62
+ */
63
63
  protected createResponse(uploadResponse: UploadResponse): globalThis.Response;
64
64
  /**
65
- * Create error Response from Error object with appropriate status code and message.
66
- * @param error Error object to convert to HTTP error response
67
- * @returns Web API Response object with error details
68
- */
65
+ * Create error Response from Error object with appropriate status code and message.
66
+ * @param error Error object to convert to HTTP error response
67
+ * @returns Web API Response object with error details
68
+ */
69
69
  protected createErrorResponse(error: Error): Promise<globalThis.Response>;
70
70
  /**
71
- * Build file URL from request and file data.
72
- * @param request Web API Request object
73
- * @param file File object containing ID and content type
74
- * @returns Constructed file URL with extension based on content type
75
- */
71
+ * Build file URL from request and file data.
72
+ * @param request Web API Request object
73
+ * @param file File object containing ID and content type
74
+ * @returns Constructed file URL with extension based on content type
75
+ */
76
76
  protected buildFileUrl(request: Request, file: TFile): string;
77
77
  /**
78
- * Negotiates content type based on Accept header and supported formats.
79
- * @param request Web API Request object containing Accept header.
80
- * @param supportedTypes Array of supported MIME types to match against.
81
- * @returns Best matching content type or undefined if no match found.
82
- */
78
+ * Negotiates content type based on Accept header and supported formats.
79
+ * @param request Web API Request object containing Accept header.
80
+ * @param supportedTypes Array of supported MIME types to match against.
81
+ * @returns Best matching content type or undefined if no match found.
82
+ */
83
83
  negotiateContentType(request: Request, supportedTypes: string[]): string | undefined;
84
84
  }
85
85
  /**
86
- * Multipart/form-data upload handler (Web API Fetch version).
87
- * @example
88
- * ```ts
89
- * const multipart = new MultipartFetch({
90
- * storage,
91
- * maxFileSize: 100 * 1024 * 1024, // 100MB
92
- * });
93
- *
94
- * // Use with Hono, Cloudflare Workers, etc.
95
- * app.all('/files/*', async (c) => {
96
- * return multipart.fetch(c.req.raw);
97
- * });
98
- * ```
99
- */
86
+ * Multipart/form-data upload handler (Web API Fetch version).
87
+ * @example
88
+ * ```ts
89
+ * const multipart = new MultipartFetch({
90
+ * storage,
91
+ * maxFileSize: 100 * 1024 * 1024, // 100MB
92
+ * });
93
+ *
94
+ * // Use with Hono, Cloudflare Workers, etc.
95
+ * app.all('/files/*', async (c) => {
96
+ * return multipart.fetch(c.req.raw);
97
+ * });
98
+ * ```
99
+ */
100
100
  declare class Multipart<TFile extends UploadFile> extends BaseHandlerFetch<TFile> {
101
101
  /**
102
- * Limiting enabled http method handler
103
- */
102
+ * Limiting enabled http method handler
103
+ */
104
104
  static override readonly methods: Handlers[];
105
105
  private readonly multipartBase;
106
106
  /**
107
- * Maximum file size allowed for multipart uploads
108
- */
107
+ * Maximum file size allowed for multipart uploads
108
+ */
109
109
  private maxFileSize;
110
110
  /**
111
- * Maximum header size allowed for multipart parser
112
- */
111
+ * Maximum header size allowed for multipart parser
112
+ */
113
113
  private maxHeaderSize;
114
114
  constructor(options: UploadOptions<TFile>);
115
115
  /**
116
- * Handles multipart/form-data POST requests for file uploads.
117
- * @param request Web API Request containing multipart data.
118
- * @returns Promise resolving to ResponseFile with upload result.
119
- */
116
+ * Handles multipart/form-data POST requests for file uploads.
117
+ * @param request Web API Request containing multipart data.
118
+ * @returns Promise resolving to ResponseFile with upload result.
119
+ */
120
120
  post(request: Request): Promise<ResponseFile<TFile>>;
121
121
  /**
122
- * Delete an uploaded file.
123
- * @param request Web API Request with file ID
124
- * @returns Promise resolving to ResponseFile with deletion result
125
- */
122
+ * Delete an uploaded file.
123
+ * @param request Web API Request with file ID
124
+ * @returns Promise resolving to ResponseFile with deletion result
125
+ */
126
126
  delete(request: Request): Promise<ResponseFile<TFile>>;
127
127
  /**
128
- * Handle OPTIONS requests with CORS headers.
129
- * @param _request Web API Request (unused)
130
- * @returns Promise resolving to ResponseFile with CORS headers
131
- */
128
+ * Handle OPTIONS requests with CORS headers.
129
+ * @param _request Web API Request (unused)
130
+ * @returns Promise resolving to ResponseFile with CORS headers
131
+ */
132
132
  options(_request: Request): Promise<ResponseFile<TFile>>;
133
133
  /**
134
- * Retrieves a file or list of files based on the request path.
135
- * Delegates to BaseHandlerFetch.fetch() method.
136
- * @param _request Web API Request
137
- * @returns Promise resolving to Web API Response
138
- */
134
+ * Retrieves a file or list of files based on the request path.
135
+ * Delegates to BaseHandlerFetch.fetch() method.
136
+ * @param _request Web API Request
137
+ * @returns Promise resolving to Web API Response
138
+ */
139
139
  get(_request: Request): Promise<ResponseFile<TFile>>;
140
140
  /**
141
- * Compose and register HTTP method handlers.
142
- */
141
+ * Compose and register HTTP method handlers.
142
+ */
143
143
  protected compose(): void;
144
144
  }
145
145
  /**
146
- * REST API handler for direct binary file uploads (Web API Fetch version).
147
- *
148
- * This handler provides a clean REST interface for file operations using Web API Request/Response:
149
- * - POST: Create a new file with raw binary data or initialize chunked upload
150
- * - PUT: Create or update a file (requires ID in URL)
151
- * - PATCH: Upload chunks for chunked uploads (requires ID in URL)
152
- * - GET: Retrieve a file or list files
153
- * - DELETE: Delete a file (single) or multiple files (via ?ids=id1,id2 or JSON body)
154
- * - HEAD: Get file metadata and upload progress
155
- * - OPTIONS: CORS preflight
156
- * @example
157
- * ```ts
158
- * const rest = new RestFetch({
159
- * storage,
160
- * });
161
- *
162
- * // Use with Hono, Cloudflare Workers, etc.
163
- * app.all('/files/*', async (c) => {
164
- * return rest.fetch(c.req.raw);
165
- * });
166
- * ```
167
- */
146
+ * REST API handler for direct binary file uploads (Web API Fetch version).
147
+ *
148
+ * This handler provides a clean REST interface for file operations using Web API Request/Response:
149
+ * - POST: Create a new file with raw binary data or initialize chunked upload
150
+ * - PUT: Create or update a file (requires ID in URL)
151
+ * - PATCH: Upload chunks for chunked uploads (requires ID in URL)
152
+ * - GET: Retrieve a file or list files
153
+ * - DELETE: Delete a file (single) or multiple files (via ?ids=id1,id2 or JSON body)
154
+ * - HEAD: Get file metadata and upload progress
155
+ * - OPTIONS: CORS preflight
156
+ * @example
157
+ * ```ts
158
+ * const rest = new RestFetch({
159
+ * storage,
160
+ * });
161
+ *
162
+ * // Use with Hono, Cloudflare Workers, etc.
163
+ * app.all('/files/*', async (c) => {
164
+ * return rest.fetch(c.req.raw);
165
+ * });
166
+ * ```
167
+ */
168
168
  declare class RestFetch<TFile extends UploadFile> extends BaseHandlerFetch<TFile> {
169
169
  /**
170
- * Limiting enabled http method handler
171
- */
170
+ * Limiting enabled http method handler
171
+ */
172
172
  static override readonly methods: Handlers[];
173
173
  private readonly restBase;
174
174
  constructor(options: UploadOptions<TFile>);
175
175
  /**
176
- * Compose and register HTTP method handlers.
177
- */
176
+ * Compose and register HTTP method handlers.
177
+ */
178
178
  protected compose(): void;
179
179
  /**
180
- * Creates a new file via POST request with raw binary data.
181
- * Supports both full file uploads and chunked upload initialization.
182
- * @param request Web API Request with file data.
183
- * @returns Promise resolving to ResponseFile with upload result.
184
- */
180
+ * Creates a new file via POST request with raw binary data.
181
+ * Supports both full file uploads and chunked upload initialization.
182
+ * @param request Web API Request with file data.
183
+ * @returns Promise resolving to ResponseFile with upload result.
184
+ */
185
185
  post(request: Request): Promise<ResponseFile<TFile>>;
186
186
  /**
187
- * Create or update a file via PUT request.
188
- * Requires file ID in the URL path.
189
- * @param request Web API Request with file ID and data
190
- * @returns Promise resolving to ResponseFile with upload result
191
- */
187
+ * Create or update a file via PUT request.
188
+ * Requires file ID in the URL path.
189
+ * @param request Web API Request with file ID and data
190
+ * @returns Promise resolving to ResponseFile with upload result
191
+ */
192
192
  put(request: Request): Promise<ResponseFile<TFile>>;
193
193
  /**
194
- * Delete an uploaded file or multiple files.
195
- * Supports single file (ID in URL) or batch delete (via ?ids=id1,id2 or JSON body).
196
- * @param request Web API Request with file ID(s)
197
- * @returns Promise resolving to ResponseFile (single) or ResponseList (batch) with deletion result
198
- */
194
+ * Delete an uploaded file or multiple files.
195
+ * Supports single file (ID in URL) or batch delete (via ?ids=id1,id2 or JSON body).
196
+ * @param request Web API Request with file ID(s)
197
+ * @returns Promise resolving to ResponseFile (single) or ResponseList (batch) with deletion result
198
+ */
199
199
  delete(request: Request): Promise<ResponseFile<TFile> | ResponseList<TFile>>;
200
200
  /**
201
- * Uploads a chunk via PATCH request for chunked uploads.
202
- * Headers required: X-Chunk-Offset (byte offset), Content-Length (chunk size).
203
- * Optional: X-Chunk-Checksum (SHA256 checksum for validation).
204
- * @param request Web API Request with chunk data.
205
- * @returns Promise resolving to ResponseFile with upload progress.
206
- */
201
+ * Uploads a chunk via PATCH request for chunked uploads.
202
+ * Headers required: X-Chunk-Offset (byte offset), Content-Length (chunk size).
203
+ * Optional: X-Chunk-Checksum (SHA256 checksum for validation).
204
+ * @param request Web API Request with chunk data.
205
+ * @returns Promise resolving to ResponseFile with upload progress.
206
+ */
207
207
  patch(request: Request): Promise<ResponseFile<TFile>>;
208
208
  /**
209
- * Get file metadata via HEAD request.
210
- * For chunked uploads, also returns upload progress information.
211
- * @param request Web API Request with file ID
212
- * @returns Promise resolving to ResponseFile with metadata headers
213
- */
209
+ * Get file metadata via HEAD request.
210
+ * For chunked uploads, also returns upload progress information.
211
+ * @param request Web API Request with file ID
212
+ * @returns Promise resolving to ResponseFile with metadata headers
213
+ */
214
214
  head(request: Request): Promise<ResponseFile<TFile>>;
215
215
  /**
216
- * Handle OPTIONS requests with REST API capabilities.
217
- * @param _request Web API Request
218
- * @returns Promise resolving to ResponseFile with CORS headers
219
- */
216
+ * Handle OPTIONS requests with REST API capabilities.
217
+ * @param _request Web API Request
218
+ * @returns Promise resolving to ResponseFile with CORS headers
219
+ */
220
220
  options(_request: Request): Promise<ResponseFile<TFile>>;
221
221
  /**
222
- * Retrieves a file or list of files based on the request path.
223
- * Delegates to BaseHandlerFetch.fetch() method.
224
- * @param _request Web API Request
225
- * @returns Promise resolving to Web API Response
226
- */
222
+ * Retrieves a file or list of files based on the request path.
223
+ * Delegates to BaseHandlerFetch.fetch() method.
224
+ * @param _request Web API Request
225
+ * @returns Promise resolving to Web API Response
226
+ */
227
227
  get(_request: Request): Promise<ResponseFile<TFile> | ResponseList<TFile>>;
228
228
  }
229
229
  /**
230
- * TUS resumable upload protocol handler (Web API Fetch version).
231
- *
232
- * [tus resumable upload protocol](https://github.com/tus/tus-resumable-upload-protocol/blob/master/protocol.md)
233
- * @example
234
- * ```ts
235
- * const tus = new TusFetch({storage});
236
- *
237
- * // Use with Hono, Cloudflare Workers, etc.
238
- * app.all('/files/*', async (c) => {
239
- * return tus.fetch(c.req.raw);
240
- * });
241
- * ```
242
- */
230
+ * TUS resumable upload protocol handler (Web API Fetch version).
231
+ *
232
+ * [tus resumable upload protocol](https://github.com/tus/tus-resumable-upload-protocol/blob/master/protocol.md)
233
+ * @example
234
+ * ```ts
235
+ * const tus = new TusFetch({storage});
236
+ *
237
+ * // Use with Hono, Cloudflare Workers, etc.
238
+ * app.all('/files/*', async (c) => {
239
+ * return tus.fetch(c.req.raw);
240
+ * });
241
+ * ```
242
+ */
243
243
  declare class Tus<TFile extends UploadFile> extends BaseHandlerFetch<TFile> {
244
244
  /**
245
- * Limiting enabled http method handler
246
- */
245
+ * Limiting enabled http method handler
246
+ */
247
247
  static override readonly methods: Handlers[];
248
248
  private readonly tusBase;
249
249
  constructor(options: UploadOptions<TFile>);
250
250
  /**
251
- * Web API fetch entrypoint. Wraps the base implementation to ensure every TUS
252
- * response — success and error alike — carries the `Tus-Resumable` header,
253
- * which the protocol requires on all responses.
254
- */
251
+ * Web API fetch entrypoint. Wraps the base implementation to ensure every TUS
252
+ * response — success and error alike — carries the `Tus-Resumable` header,
253
+ * which the protocol requires on all responses.
254
+ */
255
255
  override fetch(request: Request): Promise<globalThis.Response>;
256
256
  /**
257
- * Handle OPTIONS requests with TUS protocol capabilities.
258
- * @returns Promise resolving to ResponseFile with TUS headers
259
- */
257
+ * Handle OPTIONS requests with TUS protocol capabilities.
258
+ * @returns Promise resolving to ResponseFile with TUS headers
259
+ */
260
260
  options(): Promise<ResponseFile<TFile>>;
261
261
  /**
262
- * Creates a new TUS upload and optionally starts uploading data.
263
- * @param request Web API Request with TUS headers.
264
- * @returns Promise resolving to ResponseFile with upload location and offset.
265
- */
262
+ * Creates a new TUS upload and optionally starts uploading data.
263
+ * @param request Web API Request with TUS headers.
264
+ * @returns Promise resolving to ResponseFile with upload location and offset.
265
+ */
266
266
  post(request: Request): Promise<ResponseFile<TFile>>;
267
267
  /**
268
- * Write a chunk of data to an existing TUS upload.
269
- * @param request Web API Request with chunk data and TUS headers
270
- * @returns Promise resolving to ResponseFile with updated offset
271
- */
268
+ * Write a chunk of data to an existing TUS upload.
269
+ * @param request Web API Request with chunk data and TUS headers
270
+ * @returns Promise resolving to ResponseFile with updated offset
271
+ */
272
272
  patch(request: Request): Promise<ResponseFile<TFile>>;
273
273
  /**
274
- * Get current upload offset and metadata for TUS resumable uploads.
275
- * @param request Web API Request with upload ID
276
- * @returns Promise resolving to ResponseFile with upload-offset and metadata headers
277
- */
274
+ * Get current upload offset and metadata for TUS resumable uploads.
275
+ * @param request Web API Request with upload ID
276
+ * @returns Promise resolving to ResponseFile with upload-offset and metadata headers
277
+ */
278
278
  head(request: Request): Promise<ResponseFile<TFile>>;
279
279
  /**
280
- * Get TUS upload metadata and current status.
281
- * @param request Web API Request with upload ID
282
- * @returns Promise resolving to ResponseFile with file metadata as JSON
283
- */
280
+ * Get TUS upload metadata and current status.
281
+ * @param request Web API Request with upload ID
282
+ * @returns Promise resolving to ResponseFile with file metadata as JSON
283
+ */
284
284
  get(request: Request): Promise<ResponseFile<TFile>>;
285
285
  /**
286
- * Delete a TUS upload and its associated data.
287
- * @param request Web API Request with upload ID
288
- * @returns Promise resolving to ResponseFile with deletion confirmation
289
- */
286
+ * Delete a TUS upload and its associated data.
287
+ * @param request Web API Request with upload ID
288
+ * @returns Promise resolving to ResponseFile with deletion confirmation
289
+ */
290
290
  delete(request: Request): Promise<ResponseFile<TFile>>;
291
291
  /**
292
- * Compose and register HTTP method handlers.
293
- */
292
+ * Compose and register HTTP method handlers.
293
+ */
294
294
  protected compose(): void;
295
295
  /**
296
- * Build file URL for TUS uploads (without file extension).
297
- * @param requestUrl Request URL string
298
- * @param file File object containing ID
299
- * @returns Constructed file URL for TUS protocol
300
- */
296
+ * Build file URL for TUS uploads (without file extension).
297
+ * @param requestUrl Request URL string
298
+ * @param file File object containing ID
299
+ * @returns Constructed file URL for TUS protocol
300
+ */
301
301
  protected buildFileUrlForTus(requestUrl: string, file: TFile): string;
302
302
  }
303
303
  export { type Handlers, Multipart, RestFetch as Rest, Tus, type UploadOptions };
@@ -1,72 +1,72 @@
1
1
  import { Hono } from 'hono';
2
- import { U as UploadFile } from "../../../packem_shared/storage.d-CEM1upWM.js";
2
+ import { U as UploadFile } from "../../../packem_shared/storage.d-DIav_lF1.js";
3
3
  import 'node:stream';
4
- import { U as UploadOptions } from "../../../packem_shared/types.d-CggTCgXr.js";
4
+ import { U as UploadOptions } from "../../../packem_shared/types.d-jAs_Rp_v.js";
5
5
  import 'node:crypto';
6
6
  import 'node:http';
7
7
  import 'lru-cache';
8
8
  import 'node:events';
9
9
  import '@visulima/pagination';
10
- import "../../../packem_shared/media-transformer.d-Quf4ai47.js";
11
- import "../../../packem_shared/types.d-CrUWY4On.js";
10
+ import "../../../packem_shared/media-transformer.d-CvMFjINm.js";
11
+ import "../../../packem_shared/types.d-CAAzKiI6.js";
12
12
  /**
13
- * Registers upload handler routes on a Hono app instance.
14
- * Automatically registers all required HTTP methods for the specified handler type.
15
- * @param app Hono app instance to register routes on
16
- * @param config Handler configuration including storage, type, and path
17
- * @example
18
- * ```ts
19
- * import { Hono } from "hono";
20
- * import { DiskStorage } from "@visulima/storage";
21
- * import { createHonoHandler } from "@visulima/storage/handler/http/hono";
22
- *
23
- * const app = new Hono();
24
- * const storage = new DiskStorage({ directory: "./uploads" });
25
- *
26
- * // Multipart handler - automatically registers POST, GET, DELETE, OPTIONS
27
- * createHonoHandler(app, {
28
- * path: "/files",
29
- * storage,
30
- * type: "multipart"
31
- * });
32
- * ```
33
- * @example
34
- * ```ts
35
- * import { Hono } from "hono";
36
- * import { DiskStorage } from "@visulima/storage";
37
- * import { createHonoHandler } from "@visulima/storage/handler/http/hono";
38
- *
39
- * const app = new Hono();
40
- * const storage = new DiskStorage({ directory: "./uploads" });
41
- *
42
- * // REST handler - automatically registers POST, PUT, PATCH, GET, HEAD, DELETE, OPTIONS
43
- * createHonoHandler(app, {
44
- * path: "/files-rest",
45
- * storage,
46
- * type: "rest"
47
- * });
48
- * ```
49
- * @example
50
- * ```ts
51
- * import { Hono } from "hono";
52
- * import { DiskStorage } from "@visulima/storage";
53
- * import { createHonoHandler } from "@visulima/storage/handler/http/hono";
54
- *
55
- * const app = new Hono();
56
- * const storage = new DiskStorage({ directory: "./uploads" });
57
- *
58
- * // TUS handler - automatically registers POST, PATCH, HEAD, GET, DELETE, OPTIONS
59
- * createHonoHandler(app, {
60
- * path: "/files-tus",
61
- * storage,
62
- * type: "tus"
63
- * });
64
- * ```
65
- */
13
+ * Registers upload handler routes on a Hono app instance.
14
+ * Automatically registers all required HTTP methods for the specified handler type.
15
+ * @param app Hono app instance to register routes on
16
+ * @param config Handler configuration including storage, type, and path
17
+ * @example
18
+ * ```ts
19
+ * import { Hono } from "hono";
20
+ * import { DiskStorage } from "@visulima/storage";
21
+ * import { createHonoHandler } from "@visulima/storage/handler/http/hono";
22
+ *
23
+ * const app = new Hono();
24
+ * const storage = new DiskStorage({ directory: "./uploads" });
25
+ *
26
+ * // Multipart handler - automatically registers POST, GET, DELETE, OPTIONS
27
+ * createHonoHandler(app, {
28
+ * path: "/files",
29
+ * storage,
30
+ * type: "multipart"
31
+ * });
32
+ * ```
33
+ * @example
34
+ * ```ts
35
+ * import { Hono } from "hono";
36
+ * import { DiskStorage } from "@visulima/storage";
37
+ * import { createHonoHandler } from "@visulima/storage/handler/http/hono";
38
+ *
39
+ * const app = new Hono();
40
+ * const storage = new DiskStorage({ directory: "./uploads" });
41
+ *
42
+ * // REST handler - automatically registers POST, PUT, PATCH, GET, HEAD, DELETE, OPTIONS
43
+ * createHonoHandler(app, {
44
+ * path: "/files-rest",
45
+ * storage,
46
+ * type: "rest"
47
+ * });
48
+ * ```
49
+ * @example
50
+ * ```ts
51
+ * import { Hono } from "hono";
52
+ * import { DiskStorage } from "@visulima/storage";
53
+ * import { createHonoHandler } from "@visulima/storage/handler/http/hono";
54
+ *
55
+ * const app = new Hono();
56
+ * const storage = new DiskStorage({ directory: "./uploads" });
57
+ *
58
+ * // TUS handler - automatically registers POST, PATCH, HEAD, GET, DELETE, OPTIONS
59
+ * createHonoHandler(app, {
60
+ * path: "/files-tus",
61
+ * storage,
62
+ * type: "tus"
63
+ * });
64
+ * ```
65
+ */
66
66
  declare const createStorageHandler: <TFile extends UploadFile>(app: Hono, config: HonoHandlerConfig<TFile>) => void;
67
67
  /**
68
- * Configuration for Hono handler.
69
- */
68
+ * Configuration for Hono handler.
69
+ */
70
70
  interface HonoHandlerConfig<TFile extends UploadFile> extends UploadOptions<TFile> {
71
71
  /** Base path for the routes (e.g., "/files" or "/api/upload") */
72
72
  path: string;