@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,6 +1,6 @@
|
|
|
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-DIav_lF1.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-Cg7m4FuH.js";
|
|
4
4
|
import { S3ClientConfig, ObjectCannedACL, S3Client } from '@aws-sdk/client-s3';
|
|
5
5
|
import { ResponseMetadata } from '@aws-sdk/types';
|
|
6
6
|
import 'node:crypto';
|
|
@@ -19,53 +19,53 @@ type S3MetaStorageOptions = MetaStorageOptions & S3ClientConfig & {
|
|
|
19
19
|
};
|
|
20
20
|
type S3StorageOptions = BaseStorageOptions & S3ClientConfig & {
|
|
21
21
|
/**
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
* Specifying access rules for uploaded files.
|
|
23
|
+
*/
|
|
24
24
|
acl?: ObjectCannedACL;
|
|
25
25
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
* S3 bucket name.
|
|
27
|
+
* @default 'node-Upload'
|
|
28
|
+
*/
|
|
29
29
|
bucket?: string;
|
|
30
30
|
/**
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
* Force compatible client upload directly to S3 storage
|
|
32
|
+
*/
|
|
33
33
|
clientDirectUpload?: boolean;
|
|
34
34
|
/**
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
* @deprecated Use standard auth providers
|
|
36
|
+
*/
|
|
37
37
|
keyFile?: string;
|
|
38
38
|
/**
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
39
|
+
* Configure metafiles storage
|
|
40
|
+
* @example
|
|
41
|
+
* Using local metafiles
|
|
42
|
+
* ```ts
|
|
43
|
+
* const storage = new S3Storage({
|
|
44
|
+
* bucket: 'upload',
|
|
45
|
+
* region: 'eu-west-3',
|
|
46
|
+
* metaStorageConfig: { directory: '/tmp/upload-metafiles' }
|
|
47
|
+
* })
|
|
48
|
+
* ```
|
|
49
|
+
* Using a separate bucket for metafiles
|
|
50
|
+
* ```ts
|
|
51
|
+
* const storage = new S3Storage({
|
|
52
|
+
* bucket: 'upload',
|
|
53
|
+
* region: 'eu-west-3',
|
|
54
|
+
* metaStorageConfig: { bucket: 'upload-metafiles' }
|
|
55
|
+
* })
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
58
|
metaStorageConfig?: LocalMetaStorageOptions | S3MetaStorageOptions;
|
|
59
59
|
/**
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
* The parts size that the client should use for presigned multipart unloading.
|
|
61
|
+
* @default '16MB'
|
|
62
|
+
*/
|
|
63
63
|
partSize?: number | string;
|
|
64
64
|
};
|
|
65
65
|
/**
|
|
66
|
-
* SDK V3
|
|
67
|
-
* A structure containing information about a service or networking error.
|
|
68
|
-
*/
|
|
66
|
+
* SDK V3
|
|
67
|
+
* A structure containing information about a service or networking error.
|
|
68
|
+
*/
|
|
69
69
|
interface AwsError extends Error {
|
|
70
70
|
$fault?: "client" | "server";
|
|
71
71
|
$metadata: ResponseMetadata;
|
|
@@ -74,53 +74,53 @@ interface AwsError extends Error {
|
|
|
74
74
|
Type?: string;
|
|
75
75
|
}
|
|
76
76
|
/**
|
|
77
|
-
* SDK V2
|
|
78
|
-
* A structure containing information about a service or networking error.
|
|
79
|
-
*/
|
|
77
|
+
* SDK V2
|
|
78
|
+
* A structure containing information about a service or networking error.
|
|
79
|
+
*/
|
|
80
80
|
interface AWSErrorV2 extends Error {
|
|
81
81
|
/**
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
* CloudFront request ID associated with the response.
|
|
83
|
+
*/
|
|
84
84
|
cfId: string;
|
|
85
85
|
/**
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
* A unique short code representing the error that was emitted.
|
|
87
|
+
*/
|
|
88
88
|
code: string;
|
|
89
89
|
/**
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
* Second request ID associated with the response from S3.
|
|
91
|
+
*/
|
|
92
92
|
extendedRequestId: string;
|
|
93
93
|
/**
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
* Set when a networking error occurs to easily identify the endpoint of the request.
|
|
95
|
+
*/
|
|
96
96
|
hostname: string;
|
|
97
97
|
/**
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
* A longer human readable error message.
|
|
99
|
+
*/
|
|
100
100
|
message: string;
|
|
101
101
|
/**
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
* Set when a networking error occurs to easily identify the region of the request.
|
|
103
|
+
*/
|
|
104
104
|
region: string;
|
|
105
105
|
/**
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
* The unique request ID associated with the response.
|
|
107
|
+
*/
|
|
108
108
|
requestId: string;
|
|
109
109
|
/**
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
* Whether the error message is retryable.
|
|
111
|
+
*/
|
|
112
112
|
retryable: boolean;
|
|
113
113
|
/**
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
* Amount of time (in seconds) that the request waited before being resent.
|
|
115
|
+
*/
|
|
116
116
|
retryDelay: number;
|
|
117
117
|
/**
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
* In the case of a request that reached the service, this value contains the response status code.
|
|
119
|
+
*/
|
|
120
120
|
statusCode: number;
|
|
121
121
|
/**
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
* The date time object when the error occurred.
|
|
123
|
+
*/
|
|
124
124
|
time: Date;
|
|
125
125
|
}
|
|
126
126
|
declare class S3MetaStorage<T extends File = File> extends MetaStorage<T> {
|
|
@@ -136,8 +136,8 @@ declare class S3MetaStorage<T extends File = File> extends MetaStorage<T> {
|
|
|
136
136
|
}
|
|
137
137
|
type ReadableStream = globalThis.ReadableStream;
|
|
138
138
|
/**
|
|
139
|
-
* Adapter that wraps AWS SDK S3Client to implement S3ApiOperations interface.
|
|
140
|
-
*/
|
|
139
|
+
* Adapter that wraps AWS SDK S3Client to implement S3ApiOperations interface.
|
|
140
|
+
*/
|
|
141
141
|
declare class S3ClientAdapter implements S3ApiOperations {
|
|
142
142
|
private readonly client;
|
|
143
143
|
constructor(client: S3Client, _bucket: string);
|
|
@@ -247,63 +247,59 @@ declare class S3ClientAdapter implements S3ApiOperations {
|
|
|
247
247
|
}): Promise<void>;
|
|
248
248
|
}
|
|
249
249
|
/**
|
|
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
|
-
*/
|
|
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
|
+
*/
|
|
292
292
|
declare class S3Storage extends S3BaseStorage {
|
|
293
293
|
static override readonly name: string;
|
|
294
294
|
private s3Api;
|
|
295
295
|
private rawClient;
|
|
296
296
|
constructor(config: S3StorageOptions);
|
|
297
297
|
/**
|
|
298
|
-
|
|
299
|
-
|
|
298
|
+
* Normalizes AWS S3 errors with S3-specific context.
|
|
299
|
+
*/
|
|
300
300
|
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 & {
|
|
301
|
+
override update({ id }: FileQuery, metadata: Partial<S3File>): Promise<S3File>;
|
|
302
|
+
override getStream({ id }: FileQuery, options?: OperationOptions & {
|
|
307
303
|
range?: {
|
|
308
304
|
end?: number;
|
|
309
305
|
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-BiI2k6d1.js";export{t as S3File,r as S3MetaStorage,S as S3Storage};
|
|
@@ -1,5 +1,5 @@
|
|
|
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-Cg7m4FuH.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-DIav_lF1.js";
|
|
3
3
|
import { Readable } from 'node:stream';
|
|
4
4
|
import { AwsClient } from 'aws4fetch';
|
|
5
5
|
import 'node:crypto';
|
|
@@ -25,21 +25,21 @@ type AwsLightMetaStorageOptions = AwsLightClientConfig & MetaStorageOptions & {
|
|
|
25
25
|
};
|
|
26
26
|
type AwsLightStorageOptions = AwsLightClientConfig & BaseStorageOptions & {
|
|
27
27
|
/**
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
* S3 bucket name.
|
|
29
|
+
*/
|
|
30
30
|
bucket?: string;
|
|
31
31
|
/**
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
* Force compatible client upload directly to S3 storage
|
|
33
|
+
*/
|
|
34
34
|
clientDirectUpload?: boolean;
|
|
35
35
|
/**
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
* Configure metafiles storage
|
|
37
|
+
*/
|
|
38
38
|
metaStorageConfig?: AwsLightMetaStorageOptions;
|
|
39
39
|
/**
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
* The parts size that the client should use for presigned multipart unloading.
|
|
41
|
+
* @default '16MB'
|
|
42
|
+
*/
|
|
43
43
|
partSize?: number | string;
|
|
44
44
|
};
|
|
45
45
|
interface AwsLightError extends Error {
|
|
@@ -48,10 +48,10 @@ interface AwsLightError extends Error {
|
|
|
48
48
|
statusCode?: number;
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
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
|
-
*/
|
|
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
|
+
*/
|
|
55
55
|
declare class AwsLightMetaStorage<T extends File = File> extends MetaStorage<T> {
|
|
56
56
|
config: AwsLightMetaStorageOptions;
|
|
57
57
|
private readonly adapter;
|
|
@@ -63,8 +63,8 @@ declare class AwsLightMetaStorage<T extends File = File> extends MetaStorage<T>
|
|
|
63
63
|
override save(id: string, file: T): Promise<T>;
|
|
64
64
|
}
|
|
65
65
|
/**
|
|
66
|
-
* Adapter that uses aws4fetch to implement S3ApiOperations interface.
|
|
67
|
-
*/
|
|
66
|
+
* Adapter that uses aws4fetch to implement S3ApiOperations interface.
|
|
67
|
+
*/
|
|
68
68
|
declare class AwsLightApiAdapter implements S3ApiOperations {
|
|
69
69
|
aws: AwsClient;
|
|
70
70
|
private readonly bucket;
|
|
@@ -185,67 +185,63 @@ declare class AwsLightApiAdapter implements S3ApiOperations {
|
|
|
185
185
|
Bucket: string;
|
|
186
186
|
}): Promise<void>;
|
|
187
187
|
/**
|
|
188
|
-
|
|
189
|
-
|
|
188
|
+
* Builds S3 API URL.
|
|
189
|
+
*/
|
|
190
190
|
private buildUrl;
|
|
191
191
|
/**
|
|
192
|
-
|
|
193
|
-
|
|
192
|
+
* Converts ReadableStream to Readable for Node.js compatibility.
|
|
193
|
+
*/
|
|
194
194
|
private streamToReadable;
|
|
195
195
|
}
|
|
196
196
|
/**
|
|
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
|
-
*/
|
|
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
|
+
*/
|
|
235
235
|
declare class AwsLightStorage extends S3BaseStorage {
|
|
236
236
|
static override readonly name: string;
|
|
237
237
|
private s3Api;
|
|
238
238
|
constructor(config: AwsLightStorageOptions);
|
|
239
239
|
/**
|
|
240
|
-
|
|
241
|
-
|
|
240
|
+
* Normalizes AWS S3 errors with S3-specific context.
|
|
241
|
+
*/
|
|
242
242
|
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<{
|
|
243
|
+
override update({ id }: FileQuery, metadata: Partial<AwsLightFile>): Promise<AwsLightFile>;
|
|
244
|
+
override getStream({ id }: FileQuery, options?: OperationOptions): Promise<{
|
|
249
245
|
headers?: Record<string, string>;
|
|
250
246
|
size?: number;
|
|
251
247
|
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-EsqkAtU5.js";export{a as AwsLightFile,r as AwsLightMetaStorage,f as AwsLightStorage};
|