@visulima/storage 1.0.9 → 1.0.11
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 +17 -0
- package/dist/adapter/nuxt/module.d.ts +9 -8
- package/dist/ai/ai-sdk/index.d.ts +52 -59
- package/dist/ai/claude/index.d.ts +105 -119
- package/dist/ai/openai/index.d.ts +87 -99
- package/dist/ai/tanstack/index.d.ts +54 -61
- package/dist/handler/http/fetch/index.d.ts +202 -201
- package/dist/handler/http/fetch/index.js +1 -1
- package/dist/handler/http/hono/index.d.ts +60 -59
- package/dist/handler/http/hono/index.js +1 -1
- package/dist/handler/http/nextjs/index.d.ts +55 -54
- package/dist/handler/http/nextjs/index.js +1 -1
- package/dist/handler/http/node/index.d.ts +234 -246
- package/dist/handler/http/node/index.js +1 -1
- package/dist/handler/http/solid-start/index.d.ts +55 -54
- package/dist/handler/http/solid-start/index.js +1 -1
- package/dist/index.d.ts +71 -70
- package/dist/index.js +1 -1
- package/dist/packem_shared/{AbstractBaseStorage-CiPEMcuo.js → AbstractBaseStorage-CLsYmMZg.js} +1 -1
- package/dist/packem_shared/AwsLightStorage-DGSPFUqr.js +1 -0
- package/dist/packem_shared/AzureStorage-DvKk_hhz.js +1 -0
- package/dist/packem_shared/BoxMetaStorage-CJsyeQ63.js +1 -0
- package/dist/packem_shared/{BoxStorage-DbGqBLux.js → BoxStorage-CmM95wi2.js} +1 -1
- package/dist/packem_shared/BunS3MetaStorage-CJsyeQ63.js +1 -0
- package/dist/packem_shared/{BunS3Storage-DNvimm9e.js → BunS3Storage-B_roVJ29.js} +1 -1
- package/dist/packem_shared/BunnyMetaStorage-CJsyeQ63.js +1 -0
- package/dist/packem_shared/{BunnyStorage-C7d0opLL.js → BunnyStorage-eZ1QDVaY.js} +1 -1
- package/dist/packem_shared/CloudinaryMetaStorage-Bv_YCZ0Q.js +1 -0
- package/dist/packem_shared/{CloudinaryStorage-Dc3XA2lP.js → CloudinaryStorage-CpH2f0Fv.js} +1 -1
- package/dist/packem_shared/DiskStorage-DzjjqCzo.js +1 -0
- package/dist/packem_shared/{DiskStorageWithChecksum-vFCubS6K.js → DiskStorageWithChecksum-MZkDEyts.js} +1 -1
- package/dist/packem_shared/DropboxMetaStorage-CJsyeQ63.js +1 -0
- package/dist/packem_shared/{DropboxStorage-CY9Ggu3m.js → DropboxStorage-BB9NoWK2.js} +1 -1
- package/dist/packem_shared/{Files-CpIcMjP0.js → Files-DyMJ9FPN.js} +1 -1
- package/dist/packem_shared/FirebaseMetaStorage-Bv_YCZ0Q.js +1 -0
- package/dist/packem_shared/{FirebaseStorage-D6O9CJXN.js → FirebaseStorage-BgbxzYNC.js} +1 -1
- package/dist/packem_shared/FtpMetaStorage-CJsyeQ63.js +1 -0
- package/dist/packem_shared/{FtpStorage-DbEjbq8z.js → FtpStorage-CNqXDz7P.js} +1 -1
- package/dist/packem_shared/{GCSMetaStorage-DT8K6zdm.js → GCSMetaStorage-gEhWlpfS.js} +1 -1
- package/dist/packem_shared/{GCStorage-6BHkFlEs.js → GCStorage-CRd5vjok.js} +1 -1
- package/dist/packem_shared/GoogleDriveMetaStorage-B0gLF7Io.js +1 -0
- package/dist/packem_shared/{GoogleDriveStorage-Bklsz7Bh.js → GoogleDriveStorage-Du7uBhSm.js} +1 -1
- package/dist/packem_shared/{LocalMetaStorage-BhicZnNl.js → LocalMetaStorage-CcGfFG39.js} +1 -1
- package/dist/packem_shared/{MemoryStorage-9gbWd09l.js → MemoryStorage-ChKyI6OY.js} +1 -1
- package/dist/packem_shared/{Multipart-D0ok6BBy.js → Multipart-C35TR2qL.js} +1 -1
- package/dist/packem_shared/{Multipart-CQjYqU--.js → Multipart-V64Bg5dt.js} +1 -1
- package/dist/packem_shared/NetlifyBlobMetaStorage-Bv_YCZ0Q.js +1 -0
- package/dist/packem_shared/NetlifyBlobStorage-CZsr_0DF.js +1 -0
- package/dist/packem_shared/OneDriveMetaStorage-B0gLF7Io.js +1 -0
- package/dist/packem_shared/{OneDriveStorage-CP6MvGAa.js → OneDriveStorage-B8qFgMq1.js} +1 -1
- package/dist/packem_shared/PocketBaseMetaStorage-Cm3v8g1-.js +1 -0
- package/dist/packem_shared/{PocketBaseStorage-2qhbI2PW.js → PocketBaseStorage-D2vMN-oY.js} +1 -1
- package/dist/packem_shared/{Rest-CI_BiZPv.js → Rest-B7g1sgkq.js} +1 -1
- package/dist/packem_shared/{Rest-DvfN4-kf.js → Rest-BrEMYgxZ.js} +1 -1
- package/dist/packem_shared/{S3Storage-YGeNk3Tt.js → S3Storage-CTe_BMDl.js} +1 -1
- package/dist/packem_shared/SftpMetaStorage-CJsyeQ63.js +1 -0
- package/dist/packem_shared/{SftpStorage-2Hz396Xr.js → SftpStorage-BKeAzuej.js} +1 -1
- package/dist/packem_shared/SharePointMetaStorage-CJsyeQ63.js +1 -0
- package/dist/packem_shared/{SharePointStorage-CrX2Pk6C.js → SharePointStorage-Dtnt5-wk.js} +1 -1
- package/dist/packem_shared/SupabaseMetaStorage-B0gLF7Io.js +1 -0
- package/dist/packem_shared/{SupabaseStorage-Dc_DBX29.js → SupabaseStorage-CmGQjqXf.js} +1 -1
- package/dist/packem_shared/{Tus-BlBZykIL.js → Tus-CJBgnJrn.js} +1 -1
- package/dist/packem_shared/{Tus-BBVt2ky3.js → Tus-D9c7KDnl.js} +1 -1
- package/dist/packem_shared/UploadThingMetaStorage-Bv_YCZ0Q.js +1 -0
- package/dist/packem_shared/{UploadThingStorage-BChykYSe.js → UploadThingStorage-DZ4zNvDH.js} +1 -1
- package/dist/packem_shared/VercelBlobMetaStorage-CJsyeQ63.js +1 -0
- package/dist/packem_shared/{VercelBlobStorage-CsRyPfw3.js → VercelBlobStorage-DDNEofR3.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/{base-handler-core-D-9Ku1h-.js → base-handler-core-BJP9jHCE.js} +1 -1
- package/dist/packem_shared/{base-handler-fetch-CfkNakv8.js → base-handler-fetch-yrYrukwL.js} +1 -1
- package/dist/packem_shared/base-handler-node-C8P9rkaH.js +1 -0
- package/dist/packem_shared/{createRetryWrapper-CxgiV_hH.js → createRetryWrapper-DgmeHPNF.js} +1 -1
- package/dist/packem_shared/disk-storage-DqnnFQAQ.js +1 -0
- package/dist/packem_shared/disk-storage-with-checksum.d-Dgwyza8a.d.ts +146 -0
- package/dist/packem_shared/{executors.d-BZP2rWo3.d.ts → executors.d-B9dIy3NT.d.ts} +3 -2
- package/dist/packem_shared/files.d-CmSZi3M0.d.ts +655 -0
- package/dist/packem_shared/gcs-meta-storage-C9F78Sqq.js +1 -0
- package/dist/packem_shared/local-meta-storage-BELb1YwO.js +11 -0
- package/dist/packem_shared/{local-meta-storage.d-D9PBfkn6.d.ts → local-meta-storage.d-cRTXr1kb.d.ts} +7 -7
- package/dist/packem_shared/media-transformer.d-C8tn4J2Z.d.ts +331 -0
- package/dist/packem_shared/{memory-storage.d-4EU1cMt1.d.ts → memory-storage.d-BNZvDG1b.d.ts} +32 -40
- package/dist/packem_shared/path-C-OWflAo-_mqb5p5d.js +1 -0
- package/dist/packem_shared/{rest-base-e0reNDE_.js → rest-base-BQ_dhWyV.js} +1 -1
- package/dist/packem_shared/s3-base-storage-CX94H-Za.js +1 -0
- package/dist/packem_shared/{s3-base-storage.d-BQgP5B-t.d.ts → s3-base-storage.d-ks99NSs-.d.ts} +64 -70
- package/dist/packem_shared/storage-DR7qdwBN.js +1 -0
- package/dist/packem_shared/storage.d-DwdJrArF.d.ts +1186 -0
- package/dist/packem_shared/tus-base.d-BKBoJVy0.d.ts +103 -0
- package/dist/packem_shared/types.d-B1_xZIhu.d.ts +104 -0
- package/dist/packem_shared/{types.d-CrUWY4On.d.ts → types.d-BEUv414z.d.ts} +134 -134
- package/dist/packem_shared/{types.d-CggTCgXr.d.ts → types.d-D7Zlz5RE.d.ts} +3 -3
- package/dist/storage/aws/clients/index.d.ts +388 -388
- package/dist/storage/aws/index.d.ts +110 -113
- package/dist/storage/aws/index.js +1 -1
- package/dist/storage/aws-light/index.d.ts +64 -67
- package/dist/storage/aws-light/index.js +1 -1
- package/dist/storage/azure/index.d.ts +134 -139
- package/dist/storage/azure/index.js +1 -1
- package/dist/storage/box/index.d.ts +89 -92
- package/dist/storage/box/index.js +1 -1
- package/dist/storage/bun-s3/index.d.ts +71 -76
- package/dist/storage/bun-s3/index.js +1 -1
- package/dist/storage/bunny/index.d.ts +52 -55
- package/dist/storage/bunny/index.js +1 -1
- package/dist/storage/cloudinary/index.d.ts +54 -59
- package/dist/storage/cloudinary/index.js +1 -1
- package/dist/storage/dropbox/index.d.ts +59 -62
- package/dist/storage/dropbox/index.js +1 -1
- package/dist/storage/firebase/index.d.ts +74 -79
- package/dist/storage/firebase/index.js +1 -1
- package/dist/storage/ftp/index.d.ts +38 -43
- package/dist/storage/ftp/index.js +1 -1
- package/dist/storage/gcs/index.d.ts +90 -95
- package/dist/storage/gcs/index.js +1 -1
- package/dist/storage/google-drive/index.d.ts +69 -72
- package/dist/storage/google-drive/index.js +1 -1
- package/dist/storage/local/index.d.ts +4 -3
- package/dist/storage/local/index.js +1 -1
- package/dist/storage/memory/index.d.ts +3 -2
- package/dist/storage/memory/index.js +1 -1
- package/dist/storage/netlify-blob/index.d.ts +86 -93
- package/dist/storage/netlify-blob/index.js +1 -1
- package/dist/storage/onedrive/index.d.ts +44 -53
- package/dist/storage/onedrive/index.js +1 -1
- package/dist/storage/pocketbase/index.d.ts +67 -72
- package/dist/storage/pocketbase/index.js +1 -1
- package/dist/storage/sftp/index.d.ts +40 -45
- package/dist/storage/sftp/index.js +1 -1
- package/dist/storage/sharepoint/index.d.ts +96 -95
- package/dist/storage/sharepoint/index.js +1 -1
- package/dist/storage/supabase/index.d.ts +50 -55
- package/dist/storage/supabase/index.js +1 -1
- package/dist/storage/uploadthing/index.d.ts +34 -37
- package/dist/storage/uploadthing/index.js +1 -1
- package/dist/storage/vercel-blob/index.d.ts +110 -115
- package/dist/storage/vercel-blob/index.js +1 -1
- package/dist/transformer/audio-transformer.d.ts +97 -96
- package/dist/transformer/image-transformer.d.ts +423 -422
- package/dist/transformer/index.d.ts +35 -34
- package/dist/transformer/video-transformer.d.ts +112 -111
- package/package.json +2 -2
- package/dist/packem_shared/AwsLightStorage-BK-WPL0h.js +0 -1
- package/dist/packem_shared/AzureStorage-1UvDIQZd.js +0 -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/DiskStorage-CI07TVNu.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/NetlifyBlobStorage-CkpCCoN1.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/base-handler-node-BF1v1qDa.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/gcs-meta-storage-B7BnctnV.js +0 -1
- 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/path-0oTTdkvl-DvWvbDbh.js +0 -1
- package/dist/packem_shared/s3-base-storage-BoTyhuzO.js +0 -1
- package/dist/packem_shared/storage-0j5nCAUp.js +0 -1
- 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,8 +1,9 @@
|
|
|
1
|
-
import { F as File, k as MetaStorageOptions, l as BaseStorageOptions, L as LocalMetaStorageOptions, M as MetaStorage, H as HttpError, f as FileQuery, O as OperationOptions, d as FileInit } from "../../packem_shared/storage.d-
|
|
1
|
+
import { F as File, k as MetaStorageOptions, l as BaseStorageOptions, L as LocalMetaStorageOptions, M as MetaStorage, H as HttpError, f as FileQuery, O as OperationOptions, d as FileInit } from "../../packem_shared/storage.d-DwdJrArF.js";
|
|
2
2
|
import { Readable } from 'node:stream';
|
|
3
|
-
import { P as Part, S as S3CallOptions, a as S3ApiOperations, b as S3BaseStorage } from "../../packem_shared/s3-base-storage.d-
|
|
3
|
+
import { P as Part, S as S3CallOptions, a as S3ApiOperations, b as S3BaseStorage } from "../../packem_shared/s3-base-storage.d-ks99NSs-.js";
|
|
4
4
|
import { S3ClientConfig, ObjectCannedACL, S3Client } from '@aws-sdk/client-s3';
|
|
5
5
|
import { ResponseMetadata } from '@aws-sdk/types';
|
|
6
|
+
import 'node:timers';
|
|
6
7
|
import 'node:crypto';
|
|
7
8
|
import 'node:http';
|
|
8
9
|
import 'lru-cache';
|
|
@@ -19,53 +20,53 @@ type S3MetaStorageOptions = MetaStorageOptions & S3ClientConfig & {
|
|
|
19
20
|
};
|
|
20
21
|
type S3StorageOptions = BaseStorageOptions & S3ClientConfig & {
|
|
21
22
|
/**
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
* Specifying access rules for uploaded files.
|
|
24
|
+
*/
|
|
24
25
|
acl?: ObjectCannedACL;
|
|
25
26
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
* S3 bucket name.
|
|
28
|
+
* @default 'node-Upload'
|
|
29
|
+
*/
|
|
29
30
|
bucket?: string;
|
|
30
31
|
/**
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
* Force compatible client upload directly to S3 storage
|
|
33
|
+
*/
|
|
33
34
|
clientDirectUpload?: boolean;
|
|
34
35
|
/**
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
* @deprecated Use standard auth providers
|
|
37
|
+
*/
|
|
37
38
|
keyFile?: string;
|
|
38
39
|
/**
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
40
|
+
* Configure metafiles storage
|
|
41
|
+
* @example
|
|
42
|
+
* Using local metafiles
|
|
43
|
+
* ```ts
|
|
44
|
+
* const storage = new S3Storage({
|
|
45
|
+
* bucket: 'upload',
|
|
46
|
+
* region: 'eu-west-3',
|
|
47
|
+
* metaStorageConfig: { directory: '/tmp/upload-metafiles' }
|
|
48
|
+
* })
|
|
49
|
+
* ```
|
|
50
|
+
* Using a separate bucket for metafiles
|
|
51
|
+
* ```ts
|
|
52
|
+
* const storage = new S3Storage({
|
|
53
|
+
* bucket: 'upload',
|
|
54
|
+
* region: 'eu-west-3',
|
|
55
|
+
* metaStorageConfig: { bucket: 'upload-metafiles' }
|
|
56
|
+
* })
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
58
59
|
metaStorageConfig?: LocalMetaStorageOptions | S3MetaStorageOptions;
|
|
59
60
|
/**
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
* The parts size that the client should use for presigned multipart unloading.
|
|
62
|
+
* @default '16MB'
|
|
63
|
+
*/
|
|
63
64
|
partSize?: number | string;
|
|
64
65
|
};
|
|
65
66
|
/**
|
|
66
|
-
* SDK V3
|
|
67
|
-
* A structure containing information about a service or networking error.
|
|
68
|
-
*/
|
|
67
|
+
* SDK V3
|
|
68
|
+
* A structure containing information about a service or networking error.
|
|
69
|
+
*/
|
|
69
70
|
interface AwsError extends Error {
|
|
70
71
|
$fault?: "client" | "server";
|
|
71
72
|
$metadata: ResponseMetadata;
|
|
@@ -74,53 +75,53 @@ interface AwsError extends Error {
|
|
|
74
75
|
Type?: string;
|
|
75
76
|
}
|
|
76
77
|
/**
|
|
77
|
-
* SDK V2
|
|
78
|
-
* A structure containing information about a service or networking error.
|
|
79
|
-
*/
|
|
78
|
+
* SDK V2
|
|
79
|
+
* A structure containing information about a service or networking error.
|
|
80
|
+
*/
|
|
80
81
|
interface AWSErrorV2 extends Error {
|
|
81
82
|
/**
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
* CloudFront request ID associated with the response.
|
|
84
|
+
*/
|
|
84
85
|
cfId: string;
|
|
85
86
|
/**
|
|
86
|
-
|
|
87
|
-
|
|
87
|
+
* A unique short code representing the error that was emitted.
|
|
88
|
+
*/
|
|
88
89
|
code: string;
|
|
89
90
|
/**
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
* Second request ID associated with the response from S3.
|
|
92
|
+
*/
|
|
92
93
|
extendedRequestId: string;
|
|
93
94
|
/**
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
* Set when a networking error occurs to easily identify the endpoint of the request.
|
|
96
|
+
*/
|
|
96
97
|
hostname: string;
|
|
97
98
|
/**
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
* A longer human readable error message.
|
|
100
|
+
*/
|
|
100
101
|
message: string;
|
|
101
102
|
/**
|
|
102
|
-
|
|
103
|
-
|
|
103
|
+
* Set when a networking error occurs to easily identify the region of the request.
|
|
104
|
+
*/
|
|
104
105
|
region: string;
|
|
105
106
|
/**
|
|
106
|
-
|
|
107
|
-
|
|
107
|
+
* The unique request ID associated with the response.
|
|
108
|
+
*/
|
|
108
109
|
requestId: string;
|
|
109
110
|
/**
|
|
110
|
-
|
|
111
|
-
|
|
111
|
+
* Whether the error message is retryable.
|
|
112
|
+
*/
|
|
112
113
|
retryable: boolean;
|
|
113
114
|
/**
|
|
114
|
-
|
|
115
|
-
|
|
115
|
+
* Amount of time (in seconds) that the request waited before being resent.
|
|
116
|
+
*/
|
|
116
117
|
retryDelay: number;
|
|
117
118
|
/**
|
|
118
|
-
|
|
119
|
-
|
|
119
|
+
* In the case of a request that reached the service, this value contains the response status code.
|
|
120
|
+
*/
|
|
120
121
|
statusCode: number;
|
|
121
122
|
/**
|
|
122
|
-
|
|
123
|
-
|
|
123
|
+
* The date time object when the error occurred.
|
|
124
|
+
*/
|
|
124
125
|
time: Date;
|
|
125
126
|
}
|
|
126
127
|
declare class S3MetaStorage<T extends File = File> extends MetaStorage<T> {
|
|
@@ -136,8 +137,8 @@ declare class S3MetaStorage<T extends File = File> extends MetaStorage<T> {
|
|
|
136
137
|
}
|
|
137
138
|
type ReadableStream = globalThis.ReadableStream;
|
|
138
139
|
/**
|
|
139
|
-
* Adapter that wraps AWS SDK S3Client to implement S3ApiOperations interface.
|
|
140
|
-
*/
|
|
140
|
+
* Adapter that wraps AWS SDK S3Client to implement S3ApiOperations interface.
|
|
141
|
+
*/
|
|
141
142
|
declare class S3ClientAdapter implements S3ApiOperations {
|
|
142
143
|
private readonly client;
|
|
143
144
|
constructor(client: S3Client, _bucket: string);
|
|
@@ -247,63 +248,59 @@ declare class S3ClientAdapter implements S3ApiOperations {
|
|
|
247
248
|
}): Promise<void>;
|
|
248
249
|
}
|
|
249
250
|
/**
|
|
250
|
-
* Amazon S3 storage implementation.
|
|
251
|
-
* @example
|
|
252
|
-
* ```ts
|
|
253
|
-
* const storage = new S3Storage({
|
|
254
|
-
* bucket: <YOUR_BUCKET>,
|
|
255
|
-
* endpoint: <YOUR_ENDPOINT>,
|
|
256
|
-
* region: <YOUR_REGION>,
|
|
257
|
-
* credentials: {
|
|
258
|
-
* accessKeyId: <YOUR_ACCESS_KEY_ID>,
|
|
259
|
-
* secretAccessKey: <YOUR_SECRET_ACCESS_KEY>
|
|
260
|
-
* },
|
|
261
|
-
* metaStorageConfig: { directory: '/tmp/upload-metafiles' }
|
|
262
|
-
* });
|
|
263
|
-
* ```
|
|
264
|
-
* @remarks
|
|
265
|
-
* ## Error Handling
|
|
266
|
-
* - S3 API errors are normalized with AWS-specific context
|
|
267
|
-
* - Errors include S3 error codes and metadata for debugging
|
|
268
|
-
* - Batch operations handle individual failures gracefully
|
|
269
|
-
*
|
|
270
|
-
* ## Retry Behavior
|
|
271
|
-
* - All S3 API calls are wrapped with configurable retry logic via `retryConfig` option
|
|
272
|
-
* - Default retryable status codes: 408 (Request Timeout), 429 (Too Many Requests),
|
|
273
|
-
* 500 (Internal Server Error), 502 (Bad Gateway), 503 (Service Unavailable), 504 (Gateway Timeout)
|
|
274
|
-
* - Retries server-side faults ($fault === "server") automatically
|
|
275
|
-
* - Custom `shouldRetry` function can be provided for advanced retry logic
|
|
276
|
-
* - Default retry configuration: maxRetries: 3, initialDelay: 1000ms, maxDelay: 30000ms, backoffMultiplier: 2 (exponential backoff)
|
|
277
|
-
* - Retry wrapper handles transient network errors and rate limiting
|
|
278
|
-
*
|
|
279
|
-
* ## Multipart Uploads
|
|
280
|
-
* - Large files are automatically split into multipart uploads
|
|
281
|
-
* - Maximum 10,000 parts per upload (S3 limitation)
|
|
282
|
-
* - Part size is configurable (default: 16MB, minimum: 5MB)
|
|
283
|
-
* - Failed multipart uploads are automatically aborted
|
|
284
|
-
*
|
|
285
|
-
* ## Supported Operations
|
|
286
|
-
* - ✅ create, write, delete, get, getStream, list, update, copy, move
|
|
287
|
-
* - ✅ Batch operations: deleteBatch, copyBatch, moveBatch (inherited from BaseStorage)
|
|
288
|
-
* - ✅ exists: Implemented (checks metadata and S3 object)
|
|
289
|
-
* - ❌ getUrl: Not implemented (presigned URLs available via buildPresigned for clientDirectUpload)
|
|
290
|
-
* - ❌ getUploadUrl: Not implemented (presigned URLs available via buildPresigned for clientDirectUpload)
|
|
291
|
-
*/
|
|
251
|
+
* Amazon S3 storage implementation.
|
|
252
|
+
* @example
|
|
253
|
+
* ```ts
|
|
254
|
+
* const storage = new S3Storage({
|
|
255
|
+
* bucket: <YOUR_BUCKET>,
|
|
256
|
+
* endpoint: <YOUR_ENDPOINT>,
|
|
257
|
+
* region: <YOUR_REGION>,
|
|
258
|
+
* credentials: {
|
|
259
|
+
* accessKeyId: <YOUR_ACCESS_KEY_ID>,
|
|
260
|
+
* secretAccessKey: <YOUR_SECRET_ACCESS_KEY>
|
|
261
|
+
* },
|
|
262
|
+
* metaStorageConfig: { directory: '/tmp/upload-metafiles' }
|
|
263
|
+
* });
|
|
264
|
+
* ```
|
|
265
|
+
* @remarks
|
|
266
|
+
* ## Error Handling
|
|
267
|
+
* - S3 API errors are normalized with AWS-specific context
|
|
268
|
+
* - Errors include S3 error codes and metadata for debugging
|
|
269
|
+
* - Batch operations handle individual failures gracefully
|
|
270
|
+
*
|
|
271
|
+
* ## Retry Behavior
|
|
272
|
+
* - All S3 API calls are wrapped with configurable retry logic via `retryConfig` option
|
|
273
|
+
* - Default retryable status codes: 408 (Request Timeout), 429 (Too Many Requests),
|
|
274
|
+
* 500 (Internal Server Error), 502 (Bad Gateway), 503 (Service Unavailable), 504 (Gateway Timeout)
|
|
275
|
+
* - Retries server-side faults ($fault === "server") automatically
|
|
276
|
+
* - Custom `shouldRetry` function can be provided for advanced retry logic
|
|
277
|
+
* - Default retry configuration: maxRetries: 3, initialDelay: 1000ms, maxDelay: 30000ms, backoffMultiplier: 2 (exponential backoff)
|
|
278
|
+
* - Retry wrapper handles transient network errors and rate limiting
|
|
279
|
+
*
|
|
280
|
+
* ## Multipart Uploads
|
|
281
|
+
* - Large files are automatically split into multipart uploads
|
|
282
|
+
* - Maximum 10,000 parts per upload (S3 limitation)
|
|
283
|
+
* - Part size is configurable (default: 16MB, minimum: 5MB)
|
|
284
|
+
* - Failed multipart uploads are automatically aborted
|
|
285
|
+
*
|
|
286
|
+
* ## Supported Operations
|
|
287
|
+
* - ✅ create, write, delete, get, getStream, list, update, copy, move
|
|
288
|
+
* - ✅ Batch operations: deleteBatch, copyBatch, moveBatch (inherited from BaseStorage)
|
|
289
|
+
* - ✅ exists: Implemented (checks metadata and S3 object)
|
|
290
|
+
* - ❌ getUrl: Not implemented (presigned URLs available via buildPresigned for clientDirectUpload)
|
|
291
|
+
* - ❌ getUploadUrl: Not implemented (presigned URLs available via buildPresigned for clientDirectUpload)
|
|
292
|
+
*/
|
|
292
293
|
declare class S3Storage extends S3BaseStorage {
|
|
293
294
|
static override readonly name: string;
|
|
294
295
|
private s3Api;
|
|
295
296
|
private rawClient;
|
|
296
297
|
constructor(config: S3StorageOptions);
|
|
297
298
|
/**
|
|
298
|
-
|
|
299
|
-
|
|
299
|
+
* Normalizes AWS S3 errors with S3-specific context.
|
|
300
|
+
*/
|
|
300
301
|
override normalizeError(error: AwsError): HttpError;
|
|
301
|
-
override update({
|
|
302
|
-
|
|
303
|
-
}: FileQuery, metadata: Partial<S3File>): Promise<S3File>;
|
|
304
|
-
override getStream({
|
|
305
|
-
id
|
|
306
|
-
}: FileQuery, options?: OperationOptions & {
|
|
302
|
+
override update({ id }: FileQuery, metadata: Partial<S3File>): Promise<S3File>;
|
|
303
|
+
override getStream({ id }: FileQuery, options?: OperationOptions & {
|
|
307
304
|
range?: {
|
|
308
305
|
end?: number;
|
|
309
306
|
start: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as t}from"../../packem_shared/S3File-CpZrubaV.js";import{default as r}from"../../packem_shared/S3MetaStorage-CMonflzp.js";import{default as S}from"../../packem_shared/S3Storage-
|
|
1
|
+
import{default as t}from"../../packem_shared/S3File-CpZrubaV.js";import{default as r}from"../../packem_shared/S3MetaStorage-CMonflzp.js";import{default as S}from"../../packem_shared/S3Storage-CTe_BMDl.js";export{t as S3File,r as S3MetaStorage,S as S3Storage};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { P as Part, S as S3CallOptions, a as S3ApiOperations, b as S3BaseStorage } from "../../packem_shared/s3-base-storage.d-
|
|
2
|
-
import { F as File, k as MetaStorageOptions, l as BaseStorageOptions, M as MetaStorage, H as HttpError, f as FileQuery, O as OperationOptions, d as FileInit } from "../../packem_shared/storage.d-
|
|
1
|
+
import { P as Part, S as S3CallOptions, a as S3ApiOperations, b as S3BaseStorage } from "../../packem_shared/s3-base-storage.d-ks99NSs-.js";
|
|
2
|
+
import { F as File, k as MetaStorageOptions, l as BaseStorageOptions, M as MetaStorage, H as HttpError, f as FileQuery, O as OperationOptions, d as FileInit } from "../../packem_shared/storage.d-DwdJrArF.js";
|
|
3
3
|
import { Readable } from 'node:stream';
|
|
4
4
|
import { AwsClient } from 'aws4fetch';
|
|
5
|
+
import 'node:timers';
|
|
5
6
|
import 'node:crypto';
|
|
6
7
|
import 'node:http';
|
|
7
8
|
import 'lru-cache';
|
|
@@ -25,21 +26,21 @@ type AwsLightMetaStorageOptions = AwsLightClientConfig & MetaStorageOptions & {
|
|
|
25
26
|
};
|
|
26
27
|
type AwsLightStorageOptions = AwsLightClientConfig & BaseStorageOptions & {
|
|
27
28
|
/**
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
* S3 bucket name.
|
|
30
|
+
*/
|
|
30
31
|
bucket?: string;
|
|
31
32
|
/**
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
* Force compatible client upload directly to S3 storage
|
|
34
|
+
*/
|
|
34
35
|
clientDirectUpload?: boolean;
|
|
35
36
|
/**
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
* Configure metafiles storage
|
|
38
|
+
*/
|
|
38
39
|
metaStorageConfig?: AwsLightMetaStorageOptions;
|
|
39
40
|
/**
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
* The parts size that the client should use for presigned multipart unloading.
|
|
42
|
+
* @default '16MB'
|
|
43
|
+
*/
|
|
43
44
|
partSize?: number | string;
|
|
44
45
|
};
|
|
45
46
|
interface AwsLightError extends Error {
|
|
@@ -48,10 +49,10 @@ interface AwsLightError extends Error {
|
|
|
48
49
|
statusCode?: number;
|
|
49
50
|
}
|
|
50
51
|
/**
|
|
51
|
-
* AWS Light meta storage implementation using aws4fetch.
|
|
52
|
-
* Stores metadata in S3 object metadata headers (x-amz-meta-*).
|
|
53
|
-
* Optimized for worker environments (Cloudflare Workers, Web Workers, etc.).
|
|
54
|
-
*/
|
|
52
|
+
* AWS Light meta storage implementation using aws4fetch.
|
|
53
|
+
* Stores metadata in S3 object metadata headers (x-amz-meta-*).
|
|
54
|
+
* Optimized for worker environments (Cloudflare Workers, Web Workers, etc.).
|
|
55
|
+
*/
|
|
55
56
|
declare class AwsLightMetaStorage<T extends File = File> extends MetaStorage<T> {
|
|
56
57
|
config: AwsLightMetaStorageOptions;
|
|
57
58
|
private readonly adapter;
|
|
@@ -63,8 +64,8 @@ declare class AwsLightMetaStorage<T extends File = File> extends MetaStorage<T>
|
|
|
63
64
|
override save(id: string, file: T): Promise<T>;
|
|
64
65
|
}
|
|
65
66
|
/**
|
|
66
|
-
* Adapter that uses aws4fetch to implement S3ApiOperations interface.
|
|
67
|
-
*/
|
|
67
|
+
* Adapter that uses aws4fetch to implement S3ApiOperations interface.
|
|
68
|
+
*/
|
|
68
69
|
declare class AwsLightApiAdapter implements S3ApiOperations {
|
|
69
70
|
aws: AwsClient;
|
|
70
71
|
private readonly bucket;
|
|
@@ -185,67 +186,63 @@ declare class AwsLightApiAdapter implements S3ApiOperations {
|
|
|
185
186
|
Bucket: string;
|
|
186
187
|
}): Promise<void>;
|
|
187
188
|
/**
|
|
188
|
-
|
|
189
|
-
|
|
189
|
+
* Builds S3 API URL.
|
|
190
|
+
*/
|
|
190
191
|
private buildUrl;
|
|
191
192
|
/**
|
|
192
|
-
|
|
193
|
-
|
|
193
|
+
* Converts ReadableStream to Readable for Node.js compatibility.
|
|
194
|
+
*/
|
|
194
195
|
private streamToReadable;
|
|
195
196
|
}
|
|
196
197
|
/**
|
|
197
|
-
* AWS Light storage implementation using aws4fetch.
|
|
198
|
-
* Optimized for worker environments (Cloudflare Workers, Web Workers, etc.).
|
|
199
|
-
* @example
|
|
200
|
-
* ```ts
|
|
201
|
-
* const storage = new AwsLightStorage({
|
|
202
|
-
* bucket: <YOUR_BUCKET>,
|
|
203
|
-
* region: <YOUR_REGION>,
|
|
204
|
-
* accessKeyId: <YOUR_ACCESS_KEY_ID>,
|
|
205
|
-
* secretAccessKey: <YOUR_SECRET_ACCESS_KEY>
|
|
206
|
-
* });
|
|
207
|
-
* ```
|
|
208
|
-
* @remarks
|
|
209
|
-
* ## Worker Compatibility
|
|
210
|
-
* - Uses aws4fetch for AWS request signing (works in workers)
|
|
211
|
-
* - No Node.js-specific dependencies
|
|
212
|
-
* - Compatible with Cloudflare Workers, Web Workers, and edge runtimes
|
|
213
|
-
*
|
|
214
|
-
* ## Error Handling
|
|
215
|
-
* - S3 API errors are normalized with AWS-specific context
|
|
216
|
-
* - Errors include S3 error codes and status codes for debugging
|
|
217
|
-
*
|
|
218
|
-
* ## Retry Behavior
|
|
219
|
-
* - All S3 API calls are wrapped with configurable retry logic via `retryConfig` option
|
|
220
|
-
* - Default retryable status codes: 408, 429, 500, 502, 503, 504
|
|
221
|
-
* - Custom `shouldRetry` function can be provided for advanced retry logic
|
|
222
|
-
*
|
|
223
|
-
* ## Multipart Uploads
|
|
224
|
-
* - Large files are automatically split into multipart uploads
|
|
225
|
-
* - Maximum 10,000 parts per upload (S3 limitation)
|
|
226
|
-
* - Part size is configurable (default: 16MB, minimum: 5MB)
|
|
227
|
-
* - Failed multipart uploads are automatically aborted
|
|
228
|
-
*
|
|
229
|
-
* ## Supported Operations
|
|
230
|
-
* - ✅ create, write, delete, get, getStream, list, update, copy, move
|
|
231
|
-
* - ✅ Batch operations: deleteBatch, copyBatch, moveBatch (inherited from BaseStorage)
|
|
232
|
-
* - ✅ exists: Implemented (checks metadata and S3 object)
|
|
233
|
-
* - ⚠️ getUrl/getUploadUrl: Limited presigned URL support (uses aws4fetch signing)
|
|
234
|
-
*/
|
|
198
|
+
* AWS Light storage implementation using aws4fetch.
|
|
199
|
+
* Optimized for worker environments (Cloudflare Workers, Web Workers, etc.).
|
|
200
|
+
* @example
|
|
201
|
+
* ```ts
|
|
202
|
+
* const storage = new AwsLightStorage({
|
|
203
|
+
* bucket: <YOUR_BUCKET>,
|
|
204
|
+
* region: <YOUR_REGION>,
|
|
205
|
+
* accessKeyId: <YOUR_ACCESS_KEY_ID>,
|
|
206
|
+
* secretAccessKey: <YOUR_SECRET_ACCESS_KEY>
|
|
207
|
+
* });
|
|
208
|
+
* ```
|
|
209
|
+
* @remarks
|
|
210
|
+
* ## Worker Compatibility
|
|
211
|
+
* - Uses aws4fetch for AWS request signing (works in workers)
|
|
212
|
+
* - No Node.js-specific dependencies
|
|
213
|
+
* - Compatible with Cloudflare Workers, Web Workers, and edge runtimes
|
|
214
|
+
*
|
|
215
|
+
* ## Error Handling
|
|
216
|
+
* - S3 API errors are normalized with AWS-specific context
|
|
217
|
+
* - Errors include S3 error codes and status codes for debugging
|
|
218
|
+
*
|
|
219
|
+
* ## Retry Behavior
|
|
220
|
+
* - All S3 API calls are wrapped with configurable retry logic via `retryConfig` option
|
|
221
|
+
* - Default retryable status codes: 408, 429, 500, 502, 503, 504
|
|
222
|
+
* - Custom `shouldRetry` function can be provided for advanced retry logic
|
|
223
|
+
*
|
|
224
|
+
* ## Multipart Uploads
|
|
225
|
+
* - Large files are automatically split into multipart uploads
|
|
226
|
+
* - Maximum 10,000 parts per upload (S3 limitation)
|
|
227
|
+
* - Part size is configurable (default: 16MB, minimum: 5MB)
|
|
228
|
+
* - Failed multipart uploads are automatically aborted
|
|
229
|
+
*
|
|
230
|
+
* ## Supported Operations
|
|
231
|
+
* - ✅ create, write, delete, get, getStream, list, update, copy, move
|
|
232
|
+
* - ✅ Batch operations: deleteBatch, copyBatch, moveBatch (inherited from BaseStorage)
|
|
233
|
+
* - ✅ exists: Implemented (checks metadata and S3 object)
|
|
234
|
+
* - ⚠️ getUrl/getUploadUrl: Limited presigned URL support (uses aws4fetch signing)
|
|
235
|
+
*/
|
|
235
236
|
declare class AwsLightStorage extends S3BaseStorage {
|
|
236
237
|
static override readonly name: string;
|
|
237
238
|
private s3Api;
|
|
238
239
|
constructor(config: AwsLightStorageOptions);
|
|
239
240
|
/**
|
|
240
|
-
|
|
241
|
-
|
|
241
|
+
* Normalizes AWS S3 errors with S3-specific context.
|
|
242
|
+
*/
|
|
242
243
|
override normalizeError(error: AwsLightError | Error): HttpError;
|
|
243
|
-
override update({
|
|
244
|
-
|
|
245
|
-
}: FileQuery, metadata: Partial<AwsLightFile>): Promise<AwsLightFile>;
|
|
246
|
-
override getStream({
|
|
247
|
-
id
|
|
248
|
-
}: FileQuery, options?: OperationOptions): Promise<{
|
|
244
|
+
override update({ id }: FileQuery, metadata: Partial<AwsLightFile>): Promise<AwsLightFile>;
|
|
245
|
+
override getStream({ id }: FileQuery, options?: OperationOptions): Promise<{
|
|
249
246
|
headers?: Record<string, string>;
|
|
250
247
|
size?: number;
|
|
251
248
|
stream: Readable;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as a}from"../../packem_shared/AwsLightFile-CpZrubaV.js";import{p as r}from"../../packem_shared/aws-light-meta-storage-DGrn72VJ.js";import{default as f}from"../../packem_shared/AwsLightStorage-
|
|
1
|
+
import{default as a}from"../../packem_shared/AwsLightFile-CpZrubaV.js";import{p as r}from"../../packem_shared/aws-light-meta-storage-DGrn72VJ.js";import{default as f}from"../../packem_shared/AwsLightStorage-DGSPFUqr.js";export{a as AwsLightFile,r as AwsLightMetaStorage,f as AwsLightStorage};
|