@visulima/storage 1.0.8 → 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 +14 -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-C8dxa9A7.js → GCSMetaStorage-Bf4qDFB1.js} +1 -1
- package/dist/packem_shared/{GCStorage-DE-XFSBe.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-DpkPEXso.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,4 +1,4 @@
|
|
|
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-DIav_lF1.js";
|
|
2
2
|
import 'node:stream';
|
|
3
3
|
import { RetryConfig } from 'gaxios';
|
|
4
4
|
import { GoogleAuthOptions, GoogleAuth } from 'google-auth-library';
|
|
@@ -25,31 +25,31 @@ interface ClientError extends Error {
|
|
|
25
25
|
}
|
|
26
26
|
interface GCStorageOptions extends BaseStorageOptions, Omit<GoogleAuthOptions, "authClient" | "projectId">, StorageSettings {
|
|
27
27
|
/**
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
* Google Cloud Storage bucket
|
|
29
|
+
*/
|
|
30
30
|
bucket?: string;
|
|
31
31
|
/**
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
* Force compatible client upload directly to GCS
|
|
33
|
+
*/
|
|
34
34
|
clientDirectUpload?: boolean;
|
|
35
35
|
/**
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
36
|
+
* Configure metafiles storage
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* Using local metafiles
|
|
40
|
+
* const storage = new GCStorage({
|
|
41
|
+
* bucket: 'upload',
|
|
42
|
+
* metaStorageConfig: { directory: '/tmp/upload-metafiles' }
|
|
43
|
+
* })
|
|
44
|
+
* ```
|
|
45
|
+
* Using a separate bucket for metafiles
|
|
46
|
+
* ```ts
|
|
47
|
+
* const storage = new GCStorage({
|
|
48
|
+
* bucket: 'upload',
|
|
49
|
+
* metaStorageConfig: { bucket: 'upload-metafiles' }
|
|
50
|
+
* })
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
53
|
metaStorageConfig?: GCSMetaStorageOptions | LocalMetaStorageOptions;
|
|
54
54
|
}
|
|
55
55
|
interface GCSMetaStorageOptions extends MetaStorageOptions, Omit<GoogleAuthOptions, "authClient" | "projectId">, StorageSettings {
|
|
@@ -71,36 +71,36 @@ declare class GCSMetaStorage<T extends File = File> extends MetaStorage<T> {
|
|
|
71
71
|
override touch(id: string, file: T): Promise<T>;
|
|
72
72
|
private accessCheck;
|
|
73
73
|
/**
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
* Returns metafile URL path for the given upload ID.
|
|
75
|
+
* @param id Upload ID to get metafile path for
|
|
76
|
+
* @returns Full URL path to the metafile in GCS
|
|
77
|
+
*/
|
|
78
78
|
private getMetaPath;
|
|
79
79
|
private makeRequest;
|
|
80
80
|
}
|
|
81
81
|
/**
|
|
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
|
-
*/
|
|
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
|
+
*/
|
|
104
104
|
declare class GCStorage extends BaseStorage<GCSFile> {
|
|
105
105
|
static override readonly name: string;
|
|
106
106
|
override checksumTypes: string[];
|
|
@@ -120,58 +120,52 @@ declare class GCStorage extends BaseStorage<GCSFile> {
|
|
|
120
120
|
create(config: FileInit, options?: OperationOptions): Promise<GCSFile>;
|
|
121
121
|
write(part: FilePart | FileQuery | GCSFile, options?: OperationOptions): Promise<GCSFile>;
|
|
122
122
|
/**
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
delete({
|
|
130
|
-
id
|
|
131
|
-
}: FileQuery, options?: OperationOptions): Promise<GCSFile>;
|
|
123
|
+
* Deletes an upload and its metadata.
|
|
124
|
+
* @param query File query containing the file ID to delete.
|
|
125
|
+
* @param query.id File ID to delete.
|
|
126
|
+
* @returns Promise resolving to the deleted file object with status: "deleted".
|
|
127
|
+
* @throws {UploadError} If the file metadata cannot be found.
|
|
128
|
+
*/
|
|
129
|
+
delete({ id }: FileQuery, options?: OperationOptions): Promise<GCSFile>;
|
|
132
130
|
/**
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
131
|
+
* Copies an upload file to a new location.
|
|
132
|
+
* @param name Source file name/ID.
|
|
133
|
+
* @param destination Destination file name/ID.
|
|
134
|
+
* @returns Promise resolving to the copied file object.
|
|
135
|
+
* @throws {UploadError} If the source file cannot be found.
|
|
136
|
+
*/
|
|
139
137
|
copy(name: string, destination: string, options?: OperationOptions & {
|
|
140
138
|
storageClass?: string;
|
|
141
139
|
}): Promise<GCSFile>;
|
|
142
140
|
/**
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
141
|
+
* Moves an upload file to a new location.
|
|
142
|
+
* @param name Source file name/ID.
|
|
143
|
+
* @param destination Destination file name/ID.
|
|
144
|
+
* @returns Promise resolving to the moved file object.
|
|
145
|
+
* @throws {UploadError} If the source file cannot be found.
|
|
146
|
+
*/
|
|
149
147
|
move(name: string, destination: string, options?: OperationOptions): Promise<GCSFile>;
|
|
150
148
|
/**
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
get({
|
|
158
|
-
id
|
|
159
|
-
}: FileQuery, options?: OperationOptions): Promise<FileReturn>;
|
|
149
|
+
* Gets an uploaded file by ID with content buffer.
|
|
150
|
+
* @param query File query object containing the file ID.
|
|
151
|
+
* @param query.id Unique identifier of the file to retrieve.
|
|
152
|
+
* @returns Promise resolving to file object with content buffer.
|
|
153
|
+
* @throws {UploadError} If the file cannot be found (ERRORS.FILE_NOT_FOUND) or has expired (ERRORS.GONE).
|
|
154
|
+
*/
|
|
155
|
+
get({ id }: FileQuery, options?: OperationOptions): Promise<FileReturn>;
|
|
160
156
|
/**
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
override exists({
|
|
167
|
-
id
|
|
168
|
-
}: FileQuery, options?: OperationOptions): Promise<boolean>;
|
|
157
|
+
* Checks if a file exists by verifying both metadata and the actual GCS object.
|
|
158
|
+
* Returns true only if both the metadata and the GCS object exist.
|
|
159
|
+
* @param query File query containing the file ID to check.
|
|
160
|
+
* @returns Promise resolving to true if both metadata and GCS object exist, false otherwise.
|
|
161
|
+
*/
|
|
162
|
+
override exists({ id }: FileQuery, options?: OperationOptions): Promise<boolean>;
|
|
169
163
|
override list(limit?: number, options?: OperationOptions): Promise<GCSFile[]>;
|
|
170
164
|
/**
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
165
|
+
* Directory-style listing via the GCS JSON API's native `delimiter`/`prefix` — the API returns
|
|
166
|
+
* the direct child objects in `items` and the common prefixes ("subdirectories") in `prefixes`,
|
|
167
|
+
* so the subtree is never fully walked. Pages until exhausted or `limit` files are collected.
|
|
168
|
+
*/
|
|
175
169
|
override listDirectory(options?: OperationOptions & {
|
|
176
170
|
delimiter: string;
|
|
177
171
|
limit?: number;
|
|
@@ -183,11 +177,11 @@ declare class GCStorage extends BaseStorage<GCSFile> {
|
|
|
183
177
|
protected internalWrite(part: GCSFile & Partial<FilePart>, callOptions?: OperationOptions): Promise<number>;
|
|
184
178
|
private internalOnComplete;
|
|
185
179
|
/**
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
180
|
+
* Merge a body-level abort signal with the caller's per-operation
|
|
181
|
+
* `options.signal` so gaxios cancels the in-flight request on either.
|
|
182
|
+
* `options.timeout` is handed to gaxios' native `timeout` instead of a
|
|
183
|
+
* second `AbortSignal.timeout` to avoid two competing deadlines.
|
|
184
|
+
*/
|
|
191
185
|
private static buildCallSignal;
|
|
192
186
|
private makeRequest;
|
|
193
187
|
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-DQGu_cHq.js";import{default as l}from"../../packem_shared/GCStorage-ChqEpgqR.js";export{a as GCSConfig,t as GCSFile,C as GCSMetaStorage,l as GCStorage};
|
|
@@ -1,6 +1,6 @@
|
|
|
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-DIav_lF1.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-DuTEzyii.js";
|
|
4
4
|
import { drive_v3 } from '@googleapis/drive';
|
|
5
5
|
import 'node:crypto';
|
|
6
6
|
import 'node:http';
|
|
@@ -15,98 +15,98 @@ declare class GoogleDriveMetaStorage extends LocalMetaStorage<GoogleDriveFile> {
|
|
|
15
15
|
}
|
|
16
16
|
interface GoogleDriveStorageOptions extends BaseStorageOptions {
|
|
17
17
|
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
* Pre-built `@googleapis/drive` v3 client. Escape hatch for callers that
|
|
19
|
+
* have already wired auth (workload identity, ADC, etc.). When set, the
|
|
20
|
+
* adapter uses it directly and `getUploadUrl()` will throw because there's
|
|
21
|
+
* no stable way to recover the underlying auth handle.
|
|
22
|
+
*/
|
|
23
23
|
client?: drive_v3.Drive;
|
|
24
24
|
/**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
* Inline service-account credentials. Mints a `JWT` auth client with
|
|
26
|
+
* `https://www.googleapis.com/auth/drive` scope. Mutually exclusive with
|
|
27
|
+
* the other auth shapes.
|
|
28
|
+
*/
|
|
29
29
|
credentials?: {
|
|
30
30
|
client_email: string;
|
|
31
31
|
private_key: string;
|
|
32
32
|
};
|
|
33
33
|
/**
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
* Shared Drive id. **Strongly recommended for service-account auth** —
|
|
35
|
+
* service accounts have a 15 GB personal quota; production workloads
|
|
36
|
+
* should target a Shared Drive with the service account added as a member.
|
|
37
|
+
*/
|
|
38
38
|
driveId?: string;
|
|
39
39
|
/**
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
* LRU capacity for the in-memory virtual-key → fileId cache. Drive has
|
|
41
|
+
* no native key field; every read after the first round-trips a
|
|
42
|
+
* `files.list` to resolve the id, which the cache amortizes. Defaults to
|
|
43
|
+
* 1024.
|
|
44
|
+
*/
|
|
45
45
|
fileIdCacheSize?: number;
|
|
46
46
|
/**
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
* Path to a service-account JSON file. Mutually exclusive with the other
|
|
48
|
+
* auth shapes.
|
|
49
|
+
*/
|
|
50
50
|
keyFilename?: string;
|
|
51
51
|
/**
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
* Configure metafiles storage. Defaults to local tmp directory.
|
|
53
|
+
*/
|
|
54
54
|
metaStorageConfig?: LocalMetaStorageOptions;
|
|
55
55
|
/**
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
* OAuth refresh token (3-legged OAuth, end-user Drive). The adapter mints
|
|
57
|
+
* fresh access tokens against `clientId`/`clientSecret`. Mutually
|
|
58
|
+
* exclusive with the other auth shapes.
|
|
59
|
+
*/
|
|
60
60
|
oauth?: {
|
|
61
61
|
clientId: string;
|
|
62
62
|
clientSecret: string;
|
|
63
63
|
refreshToken: string;
|
|
64
64
|
};
|
|
65
65
|
/**
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
* When `true`, `write()` also creates an "anyone with link, reader"
|
|
67
|
+
* permission and `getReadUrl()` returns the Drive public download URL.
|
|
68
|
+
* When `false` (default), `getReadUrl()` throws — Drive has no signed-URL
|
|
69
|
+
* primitive.
|
|
70
|
+
*/
|
|
71
71
|
publicByDefault?: boolean;
|
|
72
72
|
/**
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
* Logical "bucket root" — virtual keys live under this folder. Defaults
|
|
74
|
+
* to `"root"` (My Drive root) or, when `driveId` is set, the Shared
|
|
75
|
+
* Drive root id should be used here.
|
|
76
|
+
*/
|
|
77
77
|
rootFolderId?: string;
|
|
78
78
|
/**
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
* Domain-wide delegation subject (the user to impersonate). Only honored
|
|
80
|
+
* with `credentials` or `keyFilename`.
|
|
81
|
+
*/
|
|
82
82
|
subject?: string;
|
|
83
83
|
}
|
|
84
84
|
/**
|
|
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
|
-
*/
|
|
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
|
+
*/
|
|
110
110
|
declare class GoogleDriveStorage extends BaseStorage<GoogleDriveFile> {
|
|
111
111
|
static override readonly name: string;
|
|
112
112
|
override checksumTypes: string[];
|
|
@@ -121,12 +121,8 @@ declare class GoogleDriveStorage extends BaseStorage<GoogleDriveFile> {
|
|
|
121
121
|
override get raw(): drive_v3.Drive;
|
|
122
122
|
create(config: FileInit, _options?: OperationOptions): Promise<GoogleDriveFile>;
|
|
123
123
|
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>;
|
|
124
|
+
delete({ id }: FileQuery, options?: OperationOptions): Promise<GoogleDriveFile>;
|
|
125
|
+
get({ id }: FileQuery, options?: OperationOptions): Promise<FileReturn>;
|
|
130
126
|
copy(name: string, destination: string, options?: OperationOptions & {
|
|
131
127
|
storageClass?: string;
|
|
132
128
|
}): 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-xlHfKwmR.js";import{default as f}from"../../packem_shared/GoogleDriveStorage-v1glykjd.js";export{r as GoogleDriveFile,t as GoogleDriveMetaStorage,f as GoogleDriveStorage};
|
|
@@ -1,6 +1,6 @@
|
|
|
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-CQucFacO.js";
|
|
2
|
+
export { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-DuTEzyii.js";
|
|
3
|
+
export type { L as LocalMetaStorageOptions } from "../../packem_shared/storage.d-DIav_lF1.js";
|
|
4
4
|
import 'node:stream';
|
|
5
5
|
import 'node:crypto';
|
|
6
6
|
import 'node:http';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as e}from"../../packem_shared/disk-storage-
|
|
1
|
+
import{F as e}from"../../packem_shared/disk-storage-BwPk2IRa.js";import{default as t}from"../../packem_shared/DiskStorageWithChecksum-UnCtyEvs.js";import{y as f}from"../../packem_shared/local-meta-storage-DJDcuxf1.js";export{e as DiskStorage,t as DiskStorageWithChecksum,f as LocalMetaStorage};
|
|
@@ -1,6 +1,6 @@
|
|
|
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-BRdTiY8y.js";
|
|
2
2
|
import 'node:stream';
|
|
3
|
-
import "../../packem_shared/storage.d-
|
|
3
|
+
import "../../packem_shared/storage.d-DIav_lF1.js";
|
|
4
4
|
import 'node:crypto';
|
|
5
5
|
import 'node:http';
|
|
6
6
|
import 'lru-cache';
|