@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.
- package/CHANGELOG.md +7 -0
- package/dist/adapter/nuxt/module.d.ts +8 -8
- package/dist/ai/ai-sdk/index.d.ts +51 -59
- package/dist/ai/claude/index.d.ts +104 -119
- package/dist/ai/openai/index.d.ts +86 -99
- package/dist/ai/tanstack/index.d.ts +53 -61
- package/dist/handler/http/fetch/index.d.ts +201 -201
- package/dist/handler/http/hono/index.d.ts +59 -59
- package/dist/handler/http/nextjs/index.d.ts +54 -54
- package/dist/handler/http/node/index.d.ts +233 -246
- package/dist/handler/http/solid-start/index.d.ts +54 -54
- package/dist/index.d.ts +70 -70
- package/dist/index.js +1 -1
- package/dist/packem_shared/{AwsLightStorage-BK-WPL0h.js → AwsLightStorage-EsqkAtU5.js} +1 -1
- package/dist/packem_shared/{AzureStorage-1UvDIQZd.js → AzureStorage-DL-U7qFG.js} +1 -1
- package/dist/packem_shared/BoxMetaStorage-CHWrhgg2.js +1 -0
- package/dist/packem_shared/{BoxStorage-DbGqBLux.js → BoxStorage-B8_oCz27.js} +1 -1
- package/dist/packem_shared/BunS3MetaStorage-CHWrhgg2.js +1 -0
- package/dist/packem_shared/{BunS3Storage-DNvimm9e.js → BunS3Storage-_PVXu_na.js} +1 -1
- package/dist/packem_shared/BunnyMetaStorage-CHWrhgg2.js +1 -0
- package/dist/packem_shared/{BunnyStorage-C7d0opLL.js → BunnyStorage-BsoWjScH.js} +1 -1
- package/dist/packem_shared/CloudinaryMetaStorage-BI9YXcwU.js +1 -0
- package/dist/packem_shared/{CloudinaryStorage-Dc3XA2lP.js → CloudinaryStorage-BNwiLF9V.js} +1 -1
- package/dist/packem_shared/{DiskStorage-CI07TVNu.js → DiskStorage-D-NtQDms.js} +1 -1
- package/dist/packem_shared/{DiskStorageWithChecksum-vFCubS6K.js → DiskStorageWithChecksum-UnCtyEvs.js} +1 -1
- package/dist/packem_shared/DropboxMetaStorage-CHWrhgg2.js +1 -0
- package/dist/packem_shared/{DropboxStorage-CY9Ggu3m.js → DropboxStorage-BS9kj0nH.js} +1 -1
- package/dist/packem_shared/FirebaseMetaStorage-BI9YXcwU.js +1 -0
- package/dist/packem_shared/{FirebaseStorage-D6O9CJXN.js → FirebaseStorage-DNquii2p.js} +1 -1
- package/dist/packem_shared/FtpMetaStorage-CHWrhgg2.js +1 -0
- package/dist/packem_shared/{FtpStorage-DbEjbq8z.js → FtpStorage-Bd004--s.js} +1 -1
- package/dist/packem_shared/{GCSMetaStorage-DT8K6zdm.js → GCSMetaStorage-Bf4qDFB1.js} +1 -1
- package/dist/packem_shared/{GCStorage-6BHkFlEs.js → GCStorage-ChqEpgqR.js} +1 -1
- package/dist/packem_shared/GoogleDriveMetaStorage-xlHfKwmR.js +1 -0
- package/dist/packem_shared/{GoogleDriveStorage-Bklsz7Bh.js → GoogleDriveStorage-v1glykjd.js} +1 -1
- package/dist/packem_shared/{LocalMetaStorage-BhicZnNl.js → LocalMetaStorage-YWPBYEe7.js} +1 -1
- package/dist/packem_shared/NetlifyBlobMetaStorage-BI9YXcwU.js +1 -0
- package/dist/packem_shared/{NetlifyBlobStorage-CkpCCoN1.js → NetlifyBlobStorage-BPyEWSnx.js} +1 -1
- package/dist/packem_shared/OneDriveMetaStorage-xlHfKwmR.js +1 -0
- package/dist/packem_shared/{OneDriveStorage-CP6MvGAa.js → OneDriveStorage-BJ3Kzxc5.js} +1 -1
- package/dist/packem_shared/PocketBaseMetaStorage-DnrxOQhO.js +1 -0
- package/dist/packem_shared/{PocketBaseStorage-2qhbI2PW.js → PocketBaseStorage-DqKHbbvn.js} +1 -1
- package/dist/packem_shared/{S3Storage-YGeNk3Tt.js → S3Storage-BiI2k6d1.js} +1 -1
- package/dist/packem_shared/SftpMetaStorage-CHWrhgg2.js +1 -0
- package/dist/packem_shared/{SftpStorage-2Hz396Xr.js → SftpStorage-w8XdtZtw.js} +1 -1
- package/dist/packem_shared/SharePointMetaStorage-CHWrhgg2.js +1 -0
- package/dist/packem_shared/{SharePointStorage-CrX2Pk6C.js → SharePointStorage-DpDpI7Ln.js} +1 -1
- package/dist/packem_shared/SupabaseMetaStorage-xlHfKwmR.js +1 -0
- package/dist/packem_shared/{SupabaseStorage-Dc_DBX29.js → SupabaseStorage-B_ugUCs7.js} +1 -1
- package/dist/packem_shared/UploadThingMetaStorage-BI9YXcwU.js +1 -0
- package/dist/packem_shared/{UploadThingStorage-BChykYSe.js → UploadThingStorage-_H45IVqX.js} +1 -1
- package/dist/packem_shared/VercelBlobMetaStorage-CHWrhgg2.js +1 -0
- package/dist/packem_shared/{VercelBlobStorage-CsRyPfw3.js → VercelBlobStorage-U1YMKeHs.js} +1 -1
- package/dist/packem_shared/{approval.d-CMAYH9GF.d.ts → approval.d-C-d-t94D.d.ts} +6 -6
- package/dist/packem_shared/disk-storage-BwPk2IRa.js +1 -0
- package/dist/packem_shared/disk-storage-with-checksum.d-CQucFacO.d.ts +146 -0
- package/dist/packem_shared/{executors.d-BZP2rWo3.d.ts → executors.d-DeDH3Ilt.d.ts} +2 -2
- package/dist/packem_shared/files.d-D8H_ge9Y.d.ts +655 -0
- package/dist/packem_shared/{gcs-meta-storage-B7BnctnV.js → gcs-meta-storage-DQGu_cHq.js} +1 -1
- package/dist/packem_shared/local-meta-storage-DJDcuxf1.js +11 -0
- package/dist/packem_shared/{local-meta-storage.d-D9PBfkn6.d.ts → local-meta-storage.d-DuTEzyii.d.ts} +7 -7
- package/dist/packem_shared/media-transformer.d-CvMFjINm.d.ts +331 -0
- package/dist/packem_shared/{memory-storage.d-4EU1cMt1.d.ts → memory-storage.d-BRdTiY8y.d.ts} +32 -40
- package/dist/packem_shared/{s3-base-storage-BoTyhuzO.js → s3-base-storage-CMUui93V.js} +1 -1
- package/dist/packem_shared/{s3-base-storage.d-BQgP5B-t.d.ts → s3-base-storage.d-Cg7m4FuH.d.ts} +64 -70
- package/dist/packem_shared/storage.d-DIav_lF1.d.ts +1163 -0
- package/dist/packem_shared/tus-base.d-BiEg5t4t.d.ts +102 -0
- package/dist/packem_shared/{types.d-CrUWY4On.d.ts → types.d-CAAzKiI6.d.ts} +134 -134
- package/dist/packem_shared/types.d-DgHhkCAl.d.ts +104 -0
- package/dist/packem_shared/{types.d-CggTCgXr.d.ts → types.d-jAs_Rp_v.d.ts} +3 -3
- package/dist/storage/aws/clients/index.d.ts +388 -388
- package/dist/storage/aws/index.d.ts +109 -113
- package/dist/storage/aws/index.js +1 -1
- package/dist/storage/aws-light/index.d.ts +63 -67
- package/dist/storage/aws-light/index.js +1 -1
- package/dist/storage/azure/index.d.ts +133 -139
- package/dist/storage/azure/index.js +1 -1
- package/dist/storage/box/index.d.ts +88 -92
- package/dist/storage/box/index.js +1 -1
- package/dist/storage/bun-s3/index.d.ts +70 -76
- package/dist/storage/bun-s3/index.js +1 -1
- package/dist/storage/bunny/index.d.ts +51 -55
- package/dist/storage/bunny/index.js +1 -1
- package/dist/storage/cloudinary/index.d.ts +53 -59
- package/dist/storage/cloudinary/index.js +1 -1
- package/dist/storage/dropbox/index.d.ts +58 -62
- package/dist/storage/dropbox/index.js +1 -1
- package/dist/storage/firebase/index.d.ts +73 -79
- package/dist/storage/firebase/index.js +1 -1
- package/dist/storage/ftp/index.d.ts +37 -43
- package/dist/storage/ftp/index.js +1 -1
- package/dist/storage/gcs/index.d.ts +89 -95
- package/dist/storage/gcs/index.js +1 -1
- package/dist/storage/google-drive/index.d.ts +68 -72
- package/dist/storage/google-drive/index.js +1 -1
- package/dist/storage/local/index.d.ts +3 -3
- package/dist/storage/local/index.js +1 -1
- package/dist/storage/memory/index.d.ts +2 -2
- package/dist/storage/netlify-blob/index.d.ts +85 -93
- package/dist/storage/netlify-blob/index.js +1 -1
- package/dist/storage/onedrive/index.d.ts +43 -53
- package/dist/storage/onedrive/index.js +1 -1
- package/dist/storage/pocketbase/index.d.ts +66 -72
- package/dist/storage/pocketbase/index.js +1 -1
- package/dist/storage/sftp/index.d.ts +39 -45
- package/dist/storage/sftp/index.js +1 -1
- package/dist/storage/sharepoint/index.d.ts +95 -95
- package/dist/storage/sharepoint/index.js +1 -1
- package/dist/storage/supabase/index.d.ts +49 -55
- package/dist/storage/supabase/index.js +1 -1
- package/dist/storage/uploadthing/index.d.ts +33 -37
- package/dist/storage/uploadthing/index.js +1 -1
- package/dist/storage/vercel-blob/index.d.ts +109 -115
- package/dist/storage/vercel-blob/index.js +1 -1
- package/dist/transformer/audio-transformer.d.ts +96 -96
- package/dist/transformer/image-transformer.d.ts +422 -422
- package/dist/transformer/index.d.ts +34 -34
- package/dist/transformer/video-transformer.d.ts +111 -111
- package/package.json +1 -1
- package/dist/packem_shared/BoxMetaStorage-BSn6Qfnf.js +0 -1
- package/dist/packem_shared/BunS3MetaStorage-BSn6Qfnf.js +0 -1
- package/dist/packem_shared/BunnyMetaStorage-BSn6Qfnf.js +0 -1
- package/dist/packem_shared/CloudinaryMetaStorage-DPVnmNe5.js +0 -1
- package/dist/packem_shared/DropboxMetaStorage-BSn6Qfnf.js +0 -1
- package/dist/packem_shared/FirebaseMetaStorage-DPVnmNe5.js +0 -1
- package/dist/packem_shared/FtpMetaStorage-BSn6Qfnf.js +0 -1
- package/dist/packem_shared/GoogleDriveMetaStorage-Cbwa1CHV.js +0 -1
- package/dist/packem_shared/NetlifyBlobMetaStorage-DPVnmNe5.js +0 -1
- package/dist/packem_shared/OneDriveMetaStorage-Cbwa1CHV.js +0 -1
- package/dist/packem_shared/PocketBaseMetaStorage-DOTLwVE7.js +0 -1
- package/dist/packem_shared/SftpMetaStorage-BSn6Qfnf.js +0 -1
- package/dist/packem_shared/SharePointMetaStorage-BSn6Qfnf.js +0 -1
- package/dist/packem_shared/SupabaseMetaStorage-Cbwa1CHV.js +0 -1
- package/dist/packem_shared/UploadThingMetaStorage-DPVnmNe5.js +0 -1
- package/dist/packem_shared/VercelBlobMetaStorage-BSn6Qfnf.js +0 -1
- package/dist/packem_shared/disk-storage-CsQcYW3s.js +0 -1
- package/dist/packem_shared/disk-storage-with-checksum.d-B-VGEsfl.d.ts +0 -156
- package/dist/packem_shared/files.d-CH0iLBNC.d.ts +0 -655
- package/dist/packem_shared/local-meta-storage-iuJnu90B.js +0 -11
- package/dist/packem_shared/media-transformer.d-Quf4ai47.d.ts +0 -331
- package/dist/packem_shared/storage.d-CEM1upWM.d.ts +0 -1176
- package/dist/packem_shared/tus-base.d-DLzKE54M.d.ts +0 -106
- package/dist/packem_shared/types.d-Bon9GVVe.d.ts +0 -104
|
@@ -1,69 +1,69 @@
|
|
|
1
1
|
import { NextRequest, NextResponse } from 'next/server.js';
|
|
2
|
-
import { U as UploadFile } from "../../../packem_shared/storage.d-
|
|
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-
|
|
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-
|
|
11
|
-
import "../../../packem_shared/types.d-
|
|
10
|
+
import "../../../packem_shared/media-transformer.d-CvMFjINm.js";
|
|
11
|
+
import "../../../packem_shared/types.d-CAAzKiI6.js";
|
|
12
12
|
/**
|
|
13
|
-
* Configuration for Next.js handler.
|
|
14
|
-
*/
|
|
13
|
+
* Configuration for Next.js handler.
|
|
14
|
+
*/
|
|
15
15
|
interface NextjsHandlerConfig<TFile extends UploadFile> extends UploadOptions<TFile> {
|
|
16
16
|
/** Handler type to use */
|
|
17
17
|
type: "multipart" | "rest" | "tus";
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
* Next.js route handler that automatically exports the correct HTTP methods for each handler type.
|
|
21
|
-
* @example
|
|
22
|
-
* ```ts
|
|
23
|
-
* // app/api/upload/multipart/route.ts
|
|
24
|
-
* import { DiskStorage } from "@visulima/storage";
|
|
25
|
-
* import { createHandler } from "@visulima/storage/handler/http/nextjs";
|
|
26
|
-
*
|
|
27
|
-
* const storage = new DiskStorage({ directory: "./uploads" });
|
|
28
|
-
* const handler = createHandler({ storage, type: "multipart" });
|
|
29
|
-
*
|
|
30
|
-
* export const POST = handler;
|
|
31
|
-
* export const DELETE = handler;
|
|
32
|
-
* export const GET = handler;
|
|
33
|
-
* export const OPTIONS = handler;
|
|
34
|
-
* ```
|
|
35
|
-
* @example
|
|
36
|
-
* ```ts
|
|
37
|
-
* // app/api/upload/rest/route.ts
|
|
38
|
-
* import { DiskStorage } from "@visulima/storage";
|
|
39
|
-
* import { createHandler } from "@visulima/storage/handler/http/nextjs";
|
|
40
|
-
*
|
|
41
|
-
* const storage = new DiskStorage({ directory: "./uploads" });
|
|
42
|
-
* const handler = createHandler({ storage, type: "rest" });
|
|
43
|
-
*
|
|
44
|
-
* export const POST = handler;
|
|
45
|
-
* export const PUT = handler;
|
|
46
|
-
* export const PATCH = handler;
|
|
47
|
-
* export const GET = handler;
|
|
48
|
-
* export const HEAD = handler;
|
|
49
|
-
* export const DELETE = handler;
|
|
50
|
-
* export const OPTIONS = handler;
|
|
51
|
-
* ```
|
|
52
|
-
* @example
|
|
53
|
-
* ```ts
|
|
54
|
-
* // app/api/upload/tus/route.ts
|
|
55
|
-
* import { DiskStorage } from "@visulima/storage";
|
|
56
|
-
* import { createHandler } from "@visulima/storage/handler/http/nextjs";
|
|
57
|
-
*
|
|
58
|
-
* const storage = new DiskStorage({ directory: "./uploads" });
|
|
59
|
-
* const handler = createHandler({ storage, type: "tus" });
|
|
60
|
-
*
|
|
61
|
-
* export const POST = handler;
|
|
62
|
-
* export const PATCH = handler;
|
|
63
|
-
* export const HEAD = handler;
|
|
64
|
-
* export const DELETE = handler;
|
|
65
|
-
* export const OPTIONS = handler;
|
|
66
|
-
* ```
|
|
67
|
-
*/
|
|
20
|
+
* Next.js route handler that automatically exports the correct HTTP methods for each handler type.
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* // app/api/upload/multipart/route.ts
|
|
24
|
+
* import { DiskStorage } from "@visulima/storage";
|
|
25
|
+
* import { createHandler } from "@visulima/storage/handler/http/nextjs";
|
|
26
|
+
*
|
|
27
|
+
* const storage = new DiskStorage({ directory: "./uploads" });
|
|
28
|
+
* const handler = createHandler({ storage, type: "multipart" });
|
|
29
|
+
*
|
|
30
|
+
* export const POST = handler;
|
|
31
|
+
* export const DELETE = handler;
|
|
32
|
+
* export const GET = handler;
|
|
33
|
+
* export const OPTIONS = handler;
|
|
34
|
+
* ```
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* // app/api/upload/rest/route.ts
|
|
38
|
+
* import { DiskStorage } from "@visulima/storage";
|
|
39
|
+
* import { createHandler } from "@visulima/storage/handler/http/nextjs";
|
|
40
|
+
*
|
|
41
|
+
* const storage = new DiskStorage({ directory: "./uploads" });
|
|
42
|
+
* const handler = createHandler({ storage, type: "rest" });
|
|
43
|
+
*
|
|
44
|
+
* export const POST = handler;
|
|
45
|
+
* export const PUT = handler;
|
|
46
|
+
* export const PATCH = handler;
|
|
47
|
+
* export const GET = handler;
|
|
48
|
+
* export const HEAD = handler;
|
|
49
|
+
* export const DELETE = handler;
|
|
50
|
+
* export const OPTIONS = handler;
|
|
51
|
+
* ```
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* // app/api/upload/tus/route.ts
|
|
55
|
+
* import { DiskStorage } from "@visulima/storage";
|
|
56
|
+
* import { createHandler } from "@visulima/storage/handler/http/nextjs";
|
|
57
|
+
*
|
|
58
|
+
* const storage = new DiskStorage({ directory: "./uploads" });
|
|
59
|
+
* const handler = createHandler({ storage, type: "tus" });
|
|
60
|
+
*
|
|
61
|
+
* export const POST = handler;
|
|
62
|
+
* export const PATCH = handler;
|
|
63
|
+
* export const HEAD = handler;
|
|
64
|
+
* export const DELETE = handler;
|
|
65
|
+
* export const OPTIONS = handler;
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
68
|
declare const createHandler: <TFile extends UploadFile>(config: NextjsHandlerConfig<TFile>) => ((request: NextRequest) => Promise<NextResponse>);
|
|
69
69
|
export { NextjsHandlerConfig, createHandler };
|