@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,7 +1,8 @@
|
|
|
1
|
-
import { F as File, k as MetaStorageOptions, L as LocalMetaStorageOptions, l as BaseStorageOptions, M as MetaStorage, H as HttpError, d as FileInit, O as OperationOptions, e as FilePart, f as FileQuery, g as FileReturn, B as BaseStorage } from "../../packem_shared/storage.d-
|
|
1
|
+
import { F as File, k as MetaStorageOptions, L as LocalMetaStorageOptions, l as BaseStorageOptions, M as MetaStorage, H as HttpError, d as FileInit, O as OperationOptions, e as FilePart, f as FileQuery, g as FileReturn, B as BaseStorage } from "../../packem_shared/storage.d-DwdJrArF.js";
|
|
2
2
|
import 'node:stream';
|
|
3
3
|
import { RetryConfig } from 'gaxios';
|
|
4
4
|
import { GoogleAuthOptions, GoogleAuth } from 'google-auth-library';
|
|
5
|
+
import 'node:timers';
|
|
5
6
|
import 'node:crypto';
|
|
6
7
|
import 'node:http';
|
|
7
8
|
import 'lru-cache';
|
|
@@ -25,31 +26,31 @@ interface ClientError extends Error {
|
|
|
25
26
|
}
|
|
26
27
|
interface GCStorageOptions extends BaseStorageOptions, Omit<GoogleAuthOptions, "authClient" | "projectId">, StorageSettings {
|
|
27
28
|
/**
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
* Google Cloud Storage bucket
|
|
30
|
+
*/
|
|
30
31
|
bucket?: string;
|
|
31
32
|
/**
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
* Force compatible client upload directly to GCS
|
|
34
|
+
*/
|
|
34
35
|
clientDirectUpload?: boolean;
|
|
35
36
|
/**
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
37
|
+
* Configure metafiles storage
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* Using local metafiles
|
|
41
|
+
* const storage = new GCStorage({
|
|
42
|
+
* bucket: 'upload',
|
|
43
|
+
* metaStorageConfig: { directory: '/tmp/upload-metafiles' }
|
|
44
|
+
* })
|
|
45
|
+
* ```
|
|
46
|
+
* Using a separate bucket for metafiles
|
|
47
|
+
* ```ts
|
|
48
|
+
* const storage = new GCStorage({
|
|
49
|
+
* bucket: 'upload',
|
|
50
|
+
* metaStorageConfig: { bucket: 'upload-metafiles' }
|
|
51
|
+
* })
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
53
54
|
metaStorageConfig?: GCSMetaStorageOptions | LocalMetaStorageOptions;
|
|
54
55
|
}
|
|
55
56
|
interface GCSMetaStorageOptions extends MetaStorageOptions, Omit<GoogleAuthOptions, "authClient" | "projectId">, StorageSettings {
|
|
@@ -71,36 +72,36 @@ declare class GCSMetaStorage<T extends File = File> extends MetaStorage<T> {
|
|
|
71
72
|
override touch(id: string, file: T): Promise<T>;
|
|
72
73
|
private accessCheck;
|
|
73
74
|
/**
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
* Returns metafile URL path for the given upload ID.
|
|
76
|
+
* @param id Upload ID to get metafile path for
|
|
77
|
+
* @returns Full URL path to the metafile in GCS
|
|
78
|
+
*/
|
|
78
79
|
private getMetaPath;
|
|
79
80
|
private makeRequest;
|
|
80
81
|
}
|
|
81
82
|
/**
|
|
82
|
-
* Google cloud storage based backend.
|
|
83
|
-
* @example
|
|
84
|
-
* ```ts
|
|
85
|
-
* const storage = new GCStorage({
|
|
86
|
-
* bucket: <YOUR_BUCKET>,
|
|
87
|
-
* keyFile: <PATH_TO_KEY_FILE>,
|
|
88
|
-
* metaStorage: new MetaStorage(),
|
|
89
|
-
* clientDirectUpload: true,
|
|
90
|
-
* maxUploadSize: '15GB',
|
|
91
|
-
* allowMIME: ['video/*', 'image/*'],
|
|
92
|
-
* filename: file => file.originalName
|
|
93
|
-
* });
|
|
94
|
-
* ```
|
|
95
|
-
* @remarks
|
|
96
|
-
* ## Supported Operations
|
|
97
|
-
* - ✅ create, write, delete, get, list, update, copy, move
|
|
98
|
-
* - ✅ Batch operations: deleteBatch, copyBatch, moveBatch (inherited from BaseStorage)
|
|
99
|
-
* - ✅ exists: Implemented (checks metadata and GCS object)
|
|
100
|
-
* - ❌ getStream: Not implemented (use get() for file retrieval)
|
|
101
|
-
* - ❌ getUrl: Not implemented (GCS public URLs not supported)
|
|
102
|
-
* - ❌ getUploadUrl: Not implemented (resumable upload URLs handled internally)
|
|
103
|
-
*/
|
|
83
|
+
* Google cloud storage based backend.
|
|
84
|
+
* @example
|
|
85
|
+
* ```ts
|
|
86
|
+
* const storage = new GCStorage({
|
|
87
|
+
* bucket: <YOUR_BUCKET>,
|
|
88
|
+
* keyFile: <PATH_TO_KEY_FILE>,
|
|
89
|
+
* metaStorage: new MetaStorage(),
|
|
90
|
+
* clientDirectUpload: true,
|
|
91
|
+
* maxUploadSize: '15GB',
|
|
92
|
+
* allowMIME: ['video/*', 'image/*'],
|
|
93
|
+
* filename: file => file.originalName
|
|
94
|
+
* });
|
|
95
|
+
* ```
|
|
96
|
+
* @remarks
|
|
97
|
+
* ## Supported Operations
|
|
98
|
+
* - ✅ create, write, delete, get, list, update, copy, move
|
|
99
|
+
* - ✅ Batch operations: deleteBatch, copyBatch, moveBatch (inherited from BaseStorage)
|
|
100
|
+
* - ✅ exists: Implemented (checks metadata and GCS object)
|
|
101
|
+
* - ❌ getStream: Not implemented (use get() for file retrieval)
|
|
102
|
+
* - ❌ getUrl: Not implemented (GCS public URLs not supported)
|
|
103
|
+
* - ❌ getUploadUrl: Not implemented (resumable upload URLs handled internally)
|
|
104
|
+
*/
|
|
104
105
|
declare class GCStorage extends BaseStorage<GCSFile> {
|
|
105
106
|
static override readonly name: string;
|
|
106
107
|
override checksumTypes: string[];
|
|
@@ -120,58 +121,52 @@ declare class GCStorage extends BaseStorage<GCSFile> {
|
|
|
120
121
|
create(config: FileInit, options?: OperationOptions): Promise<GCSFile>;
|
|
121
122
|
write(part: FilePart | FileQuery | GCSFile, options?: OperationOptions): Promise<GCSFile>;
|
|
122
123
|
/**
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
delete({
|
|
130
|
-
id
|
|
131
|
-
}: FileQuery, options?: OperationOptions): Promise<GCSFile>;
|
|
124
|
+
* Deletes an upload and its metadata.
|
|
125
|
+
* @param query File query containing the file ID to delete.
|
|
126
|
+
* @param query.id File ID to delete.
|
|
127
|
+
* @returns Promise resolving to the deleted file object with status: "deleted".
|
|
128
|
+
* @throws {UploadError} If the file metadata cannot be found.
|
|
129
|
+
*/
|
|
130
|
+
delete({ id }: FileQuery, options?: OperationOptions): Promise<GCSFile>;
|
|
132
131
|
/**
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
132
|
+
* Copies an upload file to a new location.
|
|
133
|
+
* @param name Source file name/ID.
|
|
134
|
+
* @param destination Destination file name/ID.
|
|
135
|
+
* @returns Promise resolving to the copied file object.
|
|
136
|
+
* @throws {UploadError} If the source file cannot be found.
|
|
137
|
+
*/
|
|
139
138
|
copy(name: string, destination: string, options?: OperationOptions & {
|
|
140
139
|
storageClass?: string;
|
|
141
140
|
}): Promise<GCSFile>;
|
|
142
141
|
/**
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
142
|
+
* Moves an upload file to a new location.
|
|
143
|
+
* @param name Source file name/ID.
|
|
144
|
+
* @param destination Destination file name/ID.
|
|
145
|
+
* @returns Promise resolving to the moved file object.
|
|
146
|
+
* @throws {UploadError} If the source file cannot be found.
|
|
147
|
+
*/
|
|
149
148
|
move(name: string, destination: string, options?: OperationOptions): Promise<GCSFile>;
|
|
150
149
|
/**
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
get({
|
|
158
|
-
id
|
|
159
|
-
}: FileQuery, options?: OperationOptions): Promise<FileReturn>;
|
|
150
|
+
* Gets an uploaded file by ID with content buffer.
|
|
151
|
+
* @param query File query object containing the file ID.
|
|
152
|
+
* @param query.id Unique identifier of the file to retrieve.
|
|
153
|
+
* @returns Promise resolving to file object with content buffer.
|
|
154
|
+
* @throws {UploadError} If the file cannot be found (ERRORS.FILE_NOT_FOUND) or has expired (ERRORS.GONE).
|
|
155
|
+
*/
|
|
156
|
+
get({ id }: FileQuery, options?: OperationOptions): Promise<FileReturn>;
|
|
160
157
|
/**
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
override exists({
|
|
167
|
-
id
|
|
168
|
-
}: FileQuery, options?: OperationOptions): Promise<boolean>;
|
|
158
|
+
* Checks if a file exists by verifying both metadata and the actual GCS object.
|
|
159
|
+
* Returns true only if both the metadata and the GCS object exist.
|
|
160
|
+
* @param query File query containing the file ID to check.
|
|
161
|
+
* @returns Promise resolving to true if both metadata and GCS object exist, false otherwise.
|
|
162
|
+
*/
|
|
163
|
+
override exists({ id }: FileQuery, options?: OperationOptions): Promise<boolean>;
|
|
169
164
|
override list(limit?: number, options?: OperationOptions): Promise<GCSFile[]>;
|
|
170
165
|
/**
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
166
|
+
* Directory-style listing via the GCS JSON API's native `delimiter`/`prefix` — the API returns
|
|
167
|
+
* the direct child objects in `items` and the common prefixes ("subdirectories") in `prefixes`,
|
|
168
|
+
* so the subtree is never fully walked. Pages until exhausted or `limit` files are collected.
|
|
169
|
+
*/
|
|
175
170
|
override listDirectory(options?: OperationOptions & {
|
|
176
171
|
delimiter: string;
|
|
177
172
|
limit?: number;
|
|
@@ -183,11 +178,11 @@ declare class GCStorage extends BaseStorage<GCSFile> {
|
|
|
183
178
|
protected internalWrite(part: GCSFile & Partial<FilePart>, callOptions?: OperationOptions): Promise<number>;
|
|
184
179
|
private internalOnComplete;
|
|
185
180
|
/**
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
181
|
+
* Merge a body-level abort signal with the caller's per-operation
|
|
182
|
+
* `options.signal` so gaxios cancels the in-flight request on either.
|
|
183
|
+
* `options.timeout` is handed to gaxios' native `timeout` instead of a
|
|
184
|
+
* second `AbortSignal.timeout` to avoid two competing deadlines.
|
|
185
|
+
*/
|
|
191
186
|
private static buildCallSignal;
|
|
192
187
|
private makeRequest;
|
|
193
188
|
private accessCheck;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as a}from"../../packem_shared/GCSConfig-BQ0OpVhe.js";import{default as t}from"../../packem_shared/GCSFile-Cero7qZN.js";import{v as C}from"../../packem_shared/gcs-meta-storage-
|
|
1
|
+
import{default as a}from"../../packem_shared/GCSConfig-BQ0OpVhe.js";import{default as t}from"../../packem_shared/GCSFile-Cero7qZN.js";import{v as C}from"../../packem_shared/gcs-meta-storage-C9F78Sqq.js";import{default as l}from"../../packem_shared/GCStorage-CRd5vjok.js";export{a as GCSConfig,t as GCSFile,C as GCSMetaStorage,l as GCStorage};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { F as File, L as LocalMetaStorageOptions, l as BaseStorageOptions, M as MetaStorage, d as FileInit, O as OperationOptions, e as FilePart, f as FileQuery, g as FileReturn, B as BaseStorage } from "../../packem_shared/storage.d-
|
|
1
|
+
import { F as File, L as LocalMetaStorageOptions, l as BaseStorageOptions, M as MetaStorage, d as FileInit, O as OperationOptions, e as FilePart, f as FileQuery, g as FileReturn, B as BaseStorage } from "../../packem_shared/storage.d-DwdJrArF.js";
|
|
2
2
|
import 'node:stream';
|
|
3
|
-
import { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-
|
|
3
|
+
import { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-cRTXr1kb.js";
|
|
4
4
|
import { drive_v3 } from '@googleapis/drive';
|
|
5
|
+
import 'node:timers';
|
|
5
6
|
import 'node:crypto';
|
|
6
7
|
import 'node:http';
|
|
7
8
|
import 'lru-cache';
|
|
@@ -15,98 +16,98 @@ declare class GoogleDriveMetaStorage extends LocalMetaStorage<GoogleDriveFile> {
|
|
|
15
16
|
}
|
|
16
17
|
interface GoogleDriveStorageOptions extends BaseStorageOptions {
|
|
17
18
|
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
* Pre-built `@googleapis/drive` v3 client. Escape hatch for callers that
|
|
20
|
+
* have already wired auth (workload identity, ADC, etc.). When set, the
|
|
21
|
+
* adapter uses it directly and `getUploadUrl()` will throw because there's
|
|
22
|
+
* no stable way to recover the underlying auth handle.
|
|
23
|
+
*/
|
|
23
24
|
client?: drive_v3.Drive;
|
|
24
25
|
/**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
* Inline service-account credentials. Mints a `JWT` auth client with
|
|
27
|
+
* `https://www.googleapis.com/auth/drive` scope. Mutually exclusive with
|
|
28
|
+
* the other auth shapes.
|
|
29
|
+
*/
|
|
29
30
|
credentials?: {
|
|
30
31
|
client_email: string;
|
|
31
32
|
private_key: string;
|
|
32
33
|
};
|
|
33
34
|
/**
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
* Shared Drive id. **Strongly recommended for service-account auth** —
|
|
36
|
+
* service accounts have a 15 GB personal quota; production workloads
|
|
37
|
+
* should target a Shared Drive with the service account added as a member.
|
|
38
|
+
*/
|
|
38
39
|
driveId?: string;
|
|
39
40
|
/**
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
* LRU capacity for the in-memory virtual-key → fileId cache. Drive has
|
|
42
|
+
* no native key field; every read after the first round-trips a
|
|
43
|
+
* `files.list` to resolve the id, which the cache amortizes. Defaults to
|
|
44
|
+
* 1024.
|
|
45
|
+
*/
|
|
45
46
|
fileIdCacheSize?: number;
|
|
46
47
|
/**
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
* Path to a service-account JSON file. Mutually exclusive with the other
|
|
49
|
+
* auth shapes.
|
|
50
|
+
*/
|
|
50
51
|
keyFilename?: string;
|
|
51
52
|
/**
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
* Configure metafiles storage. Defaults to local tmp directory.
|
|
54
|
+
*/
|
|
54
55
|
metaStorageConfig?: LocalMetaStorageOptions;
|
|
55
56
|
/**
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
* OAuth refresh token (3-legged OAuth, end-user Drive). The adapter mints
|
|
58
|
+
* fresh access tokens against `clientId`/`clientSecret`. Mutually
|
|
59
|
+
* exclusive with the other auth shapes.
|
|
60
|
+
*/
|
|
60
61
|
oauth?: {
|
|
61
62
|
clientId: string;
|
|
62
63
|
clientSecret: string;
|
|
63
64
|
refreshToken: string;
|
|
64
65
|
};
|
|
65
66
|
/**
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
* When `true`, `write()` also creates an "anyone with link, reader"
|
|
68
|
+
* permission and `getReadUrl()` returns the Drive public download URL.
|
|
69
|
+
* When `false` (default), `getReadUrl()` throws — Drive has no signed-URL
|
|
70
|
+
* primitive.
|
|
71
|
+
*/
|
|
71
72
|
publicByDefault?: boolean;
|
|
72
73
|
/**
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
* Logical "bucket root" — virtual keys live under this folder. Defaults
|
|
75
|
+
* to `"root"` (My Drive root) or, when `driveId` is set, the Shared
|
|
76
|
+
* Drive root id should be used here.
|
|
77
|
+
*/
|
|
77
78
|
rootFolderId?: string;
|
|
78
79
|
/**
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
* Domain-wide delegation subject (the user to impersonate). Only honored
|
|
81
|
+
* with `credentials` or `keyFilename`.
|
|
82
|
+
*/
|
|
82
83
|
subject?: string;
|
|
83
84
|
}
|
|
84
85
|
/**
|
|
85
|
-
* Google Drive storage backend.
|
|
86
|
-
*
|
|
87
|
-
* Drive is **not** a key-value store — it organizes files by `fileId`, and a
|
|
88
|
-
* single virtual key (e.g. `"docs/report.pdf"`) can map to multiple Drive
|
|
89
|
-
* files. The adapter routes by `appProperties.fsdkKey`, which it sets on
|
|
90
|
-
* every upload and resolves via `files.list` on every read. An LRU cache
|
|
91
|
-
* amortizes the resolve cost.
|
|
92
|
-
*
|
|
93
|
-
* **Auth precedence**:
|
|
94
|
-
* 1. `client` (pre-built `drive_v3.Drive`)
|
|
95
|
-
* 2. `credentials` (inline service account)
|
|
96
|
-
* 3. `keyFilename` (service-account JSON path)
|
|
97
|
-
* 4. `oauth` (refresh token + clientId/clientSecret)
|
|
98
|
-
* 5. Env fallback: `GOOGLE_DRIVE_CLIENT_EMAIL` + `GOOGLE_DRIVE_PRIVATE_KEY`, or
|
|
99
|
-
* `GOOGLE_DRIVE_KEY_FILE` (optional: `GOOGLE_DRIVE_SUBJECT` for DWD).
|
|
100
|
-
*
|
|
101
|
-
* **Limitations**:
|
|
102
|
-
* - `getReadUrl()` only works with `publicByDefault: true` — Drive has no
|
|
103
|
-
* signed-URL primitive.
|
|
104
|
-
* - `responseContentDisposition` is not supported.
|
|
105
|
-
* - `getUploadUrl()` requires explicit `credentials`/`keyFilename`/`oauth`
|
|
106
|
-
* (not a pre-built `client`) so we can mint access tokens for the
|
|
107
|
-
* resumable session.
|
|
108
|
-
* - ⚠️ Per-operation `signal`/`timeout` are best-effort: the underlying SDK does not support request cancellation, so an in-flight call may complete server-side even after abort. `retries` is honored.
|
|
109
|
-
*/
|
|
86
|
+
* Google Drive storage backend.
|
|
87
|
+
*
|
|
88
|
+
* Drive is **not** a key-value store — it organizes files by `fileId`, and a
|
|
89
|
+
* single virtual key (e.g. `"docs/report.pdf"`) can map to multiple Drive
|
|
90
|
+
* files. The adapter routes by `appProperties.fsdkKey`, which it sets on
|
|
91
|
+
* every upload and resolves via `files.list` on every read. An LRU cache
|
|
92
|
+
* amortizes the resolve cost.
|
|
93
|
+
*
|
|
94
|
+
* **Auth precedence**:
|
|
95
|
+
* 1. `client` (pre-built `drive_v3.Drive`)
|
|
96
|
+
* 2. `credentials` (inline service account)
|
|
97
|
+
* 3. `keyFilename` (service-account JSON path)
|
|
98
|
+
* 4. `oauth` (refresh token + clientId/clientSecret)
|
|
99
|
+
* 5. Env fallback: `GOOGLE_DRIVE_CLIENT_EMAIL` + `GOOGLE_DRIVE_PRIVATE_KEY`, or
|
|
100
|
+
* `GOOGLE_DRIVE_KEY_FILE` (optional: `GOOGLE_DRIVE_SUBJECT` for DWD).
|
|
101
|
+
*
|
|
102
|
+
* **Limitations**:
|
|
103
|
+
* - `getReadUrl()` only works with `publicByDefault: true` — Drive has no
|
|
104
|
+
* signed-URL primitive.
|
|
105
|
+
* - `responseContentDisposition` is not supported.
|
|
106
|
+
* - `getUploadUrl()` requires explicit `credentials`/`keyFilename`/`oauth`
|
|
107
|
+
* (not a pre-built `client`) so we can mint access tokens for the
|
|
108
|
+
* resumable session.
|
|
109
|
+
* - ⚠️ Per-operation `signal`/`timeout` are best-effort: the underlying SDK does not support request cancellation, so an in-flight call may complete server-side even after abort. `retries` is honored.
|
|
110
|
+
*/
|
|
110
111
|
declare class GoogleDriveStorage extends BaseStorage<GoogleDriveFile> {
|
|
111
112
|
static override readonly name: string;
|
|
112
113
|
override checksumTypes: string[];
|
|
@@ -121,12 +122,8 @@ declare class GoogleDriveStorage extends BaseStorage<GoogleDriveFile> {
|
|
|
121
122
|
override get raw(): drive_v3.Drive;
|
|
122
123
|
create(config: FileInit, _options?: OperationOptions): Promise<GoogleDriveFile>;
|
|
123
124
|
write(part: FilePart | FileQuery | GoogleDriveFile, options?: OperationOptions): Promise<GoogleDriveFile>;
|
|
124
|
-
delete({
|
|
125
|
-
|
|
126
|
-
}: FileQuery, options?: OperationOptions): Promise<GoogleDriveFile>;
|
|
127
|
-
get({
|
|
128
|
-
id
|
|
129
|
-
}: FileQuery, options?: OperationOptions): Promise<FileReturn>;
|
|
125
|
+
delete({ id }: FileQuery, options?: OperationOptions): Promise<GoogleDriveFile>;
|
|
126
|
+
get({ id }: FileQuery, options?: OperationOptions): Promise<FileReturn>;
|
|
130
127
|
copy(name: string, destination: string, options?: OperationOptions & {
|
|
131
128
|
storageClass?: string;
|
|
132
129
|
}): Promise<GoogleDriveFile>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as r}from"../../packem_shared/GoogleDriveFile-DHpLhzg9.js";import{default as t}from"../../packem_shared/GoogleDriveMetaStorage-
|
|
1
|
+
import{default as r}from"../../packem_shared/GoogleDriveFile-DHpLhzg9.js";import{default as t}from"../../packem_shared/GoogleDriveMetaStorage-B0gLF7Io.js";import{default as f}from"../../packem_shared/GoogleDriveStorage-Du7uBhSm.js";export{r as GoogleDriveFile,t as GoogleDriveMetaStorage,f as GoogleDriveStorage};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export { D as DiskStorage, a as DiskStorageWithChecksum } from "../../packem_shared/disk-storage-with-checksum.d-
|
|
2
|
-
export { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-
|
|
3
|
-
export type { L as LocalMetaStorageOptions } from "../../packem_shared/storage.d-
|
|
1
|
+
export { D as DiskStorage, a as DiskStorageWithChecksum } from "../../packem_shared/disk-storage-with-checksum.d-Dgwyza8a.js";
|
|
2
|
+
export { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-cRTXr1kb.js";
|
|
3
|
+
export type { L as LocalMetaStorageOptions } from "../../packem_shared/storage.d-DwdJrArF.js";
|
|
4
4
|
import 'node:stream';
|
|
5
|
+
import 'node:timers';
|
|
5
6
|
import 'node:crypto';
|
|
6
7
|
import 'node:http';
|
|
7
8
|
import 'lru-cache';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{w as e}from"../../packem_shared/disk-storage-DqnnFQAQ.js";import{default as t}from"../../packem_shared/DiskStorageWithChecksum-MZkDEyts.js";import{y as f}from"../../packem_shared/local-meta-storage-BELb1YwO.js";export{e as DiskStorage,t as DiskStorageWithChecksum,f as LocalMetaStorage};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { M as MemoryMetaStorage, a as MemoryStorage, type b as MemoryStorageOptions, a as default } from "../../packem_shared/memory-storage.d-
|
|
1
|
+
export { M as MemoryMetaStorage, a as MemoryStorage, type b as MemoryStorageOptions, a as default } from "../../packem_shared/memory-storage.d-BNZvDG1b.js";
|
|
2
2
|
import 'node:stream';
|
|
3
|
-
import "../../packem_shared/storage.d-
|
|
3
|
+
import "../../packem_shared/storage.d-DwdJrArF.js";
|
|
4
|
+
import 'node:timers';
|
|
4
5
|
import 'node:crypto';
|
|
5
6
|
import 'node:http';
|
|
6
7
|
import 'lru-cache';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as o}from"../../packem_shared/MemoryMetaStorage-Ksgh9pe7.js";import{default as t,default as f}from"../../packem_shared/MemoryStorage-
|
|
1
|
+
import{default as o}from"../../packem_shared/MemoryMetaStorage-Ksgh9pe7.js";import{default as t,default as f}from"../../packem_shared/MemoryStorage-ChKyI6OY.js";export{o as MemoryMetaStorage,t as MemoryStorage,f as default};
|