@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, 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 { Dropbox } from 'dropbox';
|
|
5
5
|
import 'node:crypto';
|
|
6
6
|
import 'node:http';
|
|
@@ -15,79 +15,79 @@ declare class DropboxMetaStorage extends LocalMetaStorage<DropboxFile> {
|
|
|
15
15
|
}
|
|
16
16
|
interface DropboxStorageOptions extends BaseStorageOptions {
|
|
17
17
|
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
* Static or dynamic access token. Pass a string for a one-shot token, or
|
|
19
|
+
* a function returning a fresh token on each call. The adapter does not
|
|
20
|
+
* cache the result of a callable — your callable is responsible for
|
|
21
|
+
* caching/refresh.
|
|
22
|
+
*/
|
|
23
23
|
accessToken?: string | (() => string | Promise<string>);
|
|
24
24
|
/**
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
* Dropbox app key (client_id). Required when `refreshToken` is set.
|
|
26
|
+
*/
|
|
27
27
|
appKey?: string;
|
|
28
28
|
/**
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
* Dropbox app secret (client_secret). Required for confidential clients.
|
|
30
|
+
*/
|
|
31
31
|
appSecret?: string;
|
|
32
32
|
/**
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
* Pre-built `Dropbox` client. Escape hatch for callers that already wire
|
|
34
|
+
* auth themselves (e.g. with team-space `pathRoot`, custom headers, or a
|
|
35
|
+
* shared `DropboxAuth`).
|
|
36
|
+
*/
|
|
37
37
|
client?: Dropbox;
|
|
38
38
|
/**
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
* Default expiry, in seconds, for temporary download links from
|
|
40
|
+
* `getReadUrl()`. Capped at 14400 (4 hours, the Dropbox maximum).
|
|
41
|
+
* Defaults to 3600 (1 hour).
|
|
42
|
+
*/
|
|
43
43
|
defaultUrlExpiresIn?: number;
|
|
44
44
|
/**
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
* Configure metafiles storage. Defaults to local tmp directory.
|
|
46
|
+
*/
|
|
47
47
|
metaStorageConfig?: LocalMetaStorageOptions;
|
|
48
48
|
/**
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
* When `true`, `getReadUrl` creates a public shared link instead of a
|
|
50
|
+
* temporary 4-hour link. The link is rewritten to `?dl=1` so it serves
|
|
51
|
+
* raw bytes directly.
|
|
52
|
+
*/
|
|
53
53
|
publicByDefault?: boolean;
|
|
54
54
|
/**
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
* OAuth2 refresh token. When set, the adapter exchanges it for fresh
|
|
56
|
+
* access tokens at `https://api.dropboxapi.com/oauth2/token` and caches
|
|
57
|
+
* them until ~60s before expiry. Requires `appKey` (PKCE) or `appKey` +
|
|
58
|
+
* `appSecret` (confidential client).
|
|
59
|
+
*/
|
|
60
60
|
refreshToken?: string;
|
|
61
61
|
/**
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
* Logical "bucket root" — virtual keys live under this folder path. Must
|
|
63
|
+
* already exist; the adapter does not create folders. Path is normalized:
|
|
64
|
+
* leading slash is added, trailing slashes stripped. Defaults to account
|
|
65
|
+
* root.
|
|
66
|
+
*/
|
|
67
67
|
rootFolderPath?: string;
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
70
|
-
* Dropbox storage backend.
|
|
71
|
-
*
|
|
72
|
-
* Routes virtual keys onto Dropbox paths under `rootFolderPath`. Uploads use
|
|
73
|
-
* the simple `filesUpload` endpoint up to 150 MB and switch to chunked
|
|
74
|
-
* upload sessions above that threshold.
|
|
75
|
-
*
|
|
76
|
-
* **Auth precedence**:
|
|
77
|
-
* 1. `client` (pre-built `Dropbox`)
|
|
78
|
-
* 2. `accessToken` (string or `() => string | Promise<string>`)
|
|
79
|
-
* 3. `refreshToken` + `appKey` (+ optional `appSecret`)
|
|
80
|
-
* 4. Env fallback: `DROPBOX_ACCESS_TOKEN`, or `DROPBOX_REFRESH_TOKEN` +
|
|
81
|
-
* `DROPBOX_APP_KEY` (+ optional `DROPBOX_APP_SECRET`)
|
|
82
|
-
*
|
|
83
|
-
* **Limitations**:
|
|
84
|
-
* - `metadata` and `cacheControl` are not supported (Dropbox files have no
|
|
85
|
-
* native arbitrary-metadata field, and no HTTP cache-header overrides).
|
|
86
|
-
* - `getUploadUrl` is not supported — Dropbox's `files/get_temporary_upload_link`
|
|
87
|
-
* requires a `POST` with raw body, which doesn't fit a presigned-PUT contract.
|
|
88
|
-
* - `responseContentDisposition` is not supported on signed URLs.
|
|
89
|
-
* - ⚠️ 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.
|
|
90
|
-
*/
|
|
70
|
+
* Dropbox storage backend.
|
|
71
|
+
*
|
|
72
|
+
* Routes virtual keys onto Dropbox paths under `rootFolderPath`. Uploads use
|
|
73
|
+
* the simple `filesUpload` endpoint up to 150 MB and switch to chunked
|
|
74
|
+
* upload sessions above that threshold.
|
|
75
|
+
*
|
|
76
|
+
* **Auth precedence**:
|
|
77
|
+
* 1. `client` (pre-built `Dropbox`)
|
|
78
|
+
* 2. `accessToken` (string or `() => string | Promise<string>`)
|
|
79
|
+
* 3. `refreshToken` + `appKey` (+ optional `appSecret`)
|
|
80
|
+
* 4. Env fallback: `DROPBOX_ACCESS_TOKEN`, or `DROPBOX_REFRESH_TOKEN` +
|
|
81
|
+
* `DROPBOX_APP_KEY` (+ optional `DROPBOX_APP_SECRET`)
|
|
82
|
+
*
|
|
83
|
+
* **Limitations**:
|
|
84
|
+
* - `metadata` and `cacheControl` are not supported (Dropbox files have no
|
|
85
|
+
* native arbitrary-metadata field, and no HTTP cache-header overrides).
|
|
86
|
+
* - `getUploadUrl` is not supported — Dropbox's `files/get_temporary_upload_link`
|
|
87
|
+
* requires a `POST` with raw body, which doesn't fit a presigned-PUT contract.
|
|
88
|
+
* - `responseContentDisposition` is not supported on signed URLs.
|
|
89
|
+
* - ⚠️ 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.
|
|
90
|
+
*/
|
|
91
91
|
declare class DropboxStorage extends BaseStorage<DropboxFile> {
|
|
92
92
|
static override readonly name: string;
|
|
93
93
|
override checksumTypes: string[];
|
|
@@ -101,12 +101,8 @@ declare class DropboxStorage extends BaseStorage<DropboxFile> {
|
|
|
101
101
|
override get raw(): Dropbox;
|
|
102
102
|
create(config: FileInit, _options?: OperationOptions): Promise<DropboxFile>;
|
|
103
103
|
write(part: FilePart | FileQuery | DropboxFile, options?: OperationOptions): Promise<DropboxFile>;
|
|
104
|
-
delete({
|
|
105
|
-
|
|
106
|
-
}: FileQuery, options?: OperationOptions): Promise<DropboxFile>;
|
|
107
|
-
get({
|
|
108
|
-
id
|
|
109
|
-
}: FileQuery, options?: OperationOptions): Promise<FileReturn>;
|
|
104
|
+
delete({ id }: FileQuery, options?: OperationOptions): Promise<DropboxFile>;
|
|
105
|
+
get({ id }: FileQuery, options?: OperationOptions): Promise<FileReturn>;
|
|
110
106
|
copy(name: string, destination: string, options?: OperationOptions & {
|
|
111
107
|
storageClass?: string;
|
|
112
108
|
}): Promise<DropboxFile>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as e}from"../../packem_shared/DropboxFile-BFb7eOzy.js";import{default as t}from"../../packem_shared/DropboxMetaStorage-
|
|
1
|
+
import{default as e}from"../../packem_shared/DropboxFile-BFb7eOzy.js";import{default as t}from"../../packem_shared/DropboxMetaStorage-CHWrhgg2.js";import{default as p}from"../../packem_shared/DropboxStorage-BS9kj0nH.js";export{e as DropboxFile,t as DropboxMetaStorage,p as DropboxStorage};
|
|
@@ -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 'node:crypto';
|
|
5
5
|
import 'node:http';
|
|
6
6
|
import 'lru-cache';
|
|
@@ -13,11 +13,11 @@ declare class FirebaseMetaStorage extends LocalMetaStorage<FirebaseFile> {
|
|
|
13
13
|
constructor(config?: LocalMetaStorageOptions);
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
* Minimal structural type for a `@google-cloud/storage` `File` as returned by
|
|
17
|
-
* `firebase-admin`'s `getStorage(app).bucket().file()`. Declared locally so the
|
|
18
|
-
* adapter type-checks without `firebase-admin` / `@google-cloud/storage`
|
|
19
|
-
* installed (optional peer dependency).
|
|
20
|
-
*/
|
|
16
|
+
* Minimal structural type for a `@google-cloud/storage` `File` as returned by
|
|
17
|
+
* `firebase-admin`'s `getStorage(app).bucket().file()`. Declared locally so the
|
|
18
|
+
* adapter type-checks without `firebase-admin` / `@google-cloud/storage`
|
|
19
|
+
* installed (optional peer dependency).
|
|
20
|
+
*/
|
|
21
21
|
interface FirebaseGcsFile {
|
|
22
22
|
copy: (destination: FirebaseGcsFile | string) => Promise<unknown>;
|
|
23
23
|
delete: (options?: {
|
|
@@ -50,9 +50,9 @@ interface FirebaseSignedUrlOptions {
|
|
|
50
50
|
version?: "v2" | "v4";
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
|
-
* Minimal structural type for a `@google-cloud/storage` `Bucket` as returned by
|
|
54
|
-
* `firebase-admin`'s `getStorage(app).bucket()`.
|
|
55
|
-
*/
|
|
53
|
+
* Minimal structural type for a `@google-cloud/storage` `Bucket` as returned by
|
|
54
|
+
* `firebase-admin`'s `getStorage(app).bucket()`.
|
|
55
|
+
*/
|
|
56
56
|
interface FirebaseBucket {
|
|
57
57
|
file: (key: string) => FirebaseGcsFile;
|
|
58
58
|
getFiles: (options?: {
|
|
@@ -62,93 +62,93 @@ interface FirebaseBucket {
|
|
|
62
62
|
name?: string;
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
|
-
* Structural type for a `firebase-admin` `App`. Only the shape needed by
|
|
66
|
-
* `getStorage()` is declared.
|
|
67
|
-
*/
|
|
65
|
+
* Structural type for a `firebase-admin` `App`. Only the shape needed by
|
|
66
|
+
* `getStorage()` is declared.
|
|
67
|
+
*/
|
|
68
68
|
interface FirebaseApp {
|
|
69
69
|
name: string;
|
|
70
70
|
}
|
|
71
71
|
interface FirebaseStorageOptions extends BaseStorageOptions {
|
|
72
72
|
/**
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
73
|
+
* Pre-built `firebase-admin` {@link FirebaseApp} or an already-built
|
|
74
|
+
* `@google-cloud/storage` `Bucket`. When a Bucket is supplied (detected by
|
|
75
|
+
* the presence of `.file()` and `.getFiles()`), it is used directly and no
|
|
76
|
+
* Firebase app is initialized. Use this to share an instance, run tests, or
|
|
77
|
+
* customize the underlying GCS client.
|
|
78
|
+
*/
|
|
79
79
|
app?: FirebaseApp | FirebaseBucket;
|
|
80
80
|
/**
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
* Named `firebase-admin` app to reuse/create. Defaults to the SDK default
|
|
82
|
+
* app. Ignored when `app` is supplied.
|
|
83
|
+
*/
|
|
84
84
|
appName?: string;
|
|
85
85
|
/**
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
86
|
+
* Storage bucket name (e.g. `my-project.appspot.com`). Falls back to
|
|
87
|
+
* `FIREBASE_STORAGE_BUCKET`. Required unless a pre-built Bucket is passed
|
|
88
|
+
* via `app`.
|
|
89
|
+
*/
|
|
90
90
|
bucket?: string;
|
|
91
91
|
/**
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
* Service-account credentials. Ignored when `app` is supplied or
|
|
93
|
+
* `serviceAccountPath` is used. Falls back to `FIREBASE_CLIENT_EMAIL` /
|
|
94
|
+
* `FIREBASE_PRIVATE_KEY`.
|
|
95
|
+
*/
|
|
96
96
|
credentials?: {
|
|
97
97
|
clientEmail: string;
|
|
98
98
|
privateKey: string;
|
|
99
99
|
};
|
|
100
100
|
/**
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
* Default expiry, in seconds, for `getReadUrl` / `getUploadUrl` signed
|
|
102
|
+
* URLs. Defaults to 3600 (1 hour).
|
|
103
|
+
*/
|
|
104
104
|
defaultUrlExpiresIn?: number;
|
|
105
105
|
/**
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
106
|
+
* Configure metafiles storage. Used for TUS-style resumable upload
|
|
107
|
+
* bookkeeping. Defaults to {@link LocalMetaStorage} under the OS tmp
|
|
108
|
+
* directory.
|
|
109
|
+
*/
|
|
110
110
|
metaStorageConfig?: LocalMetaStorageOptions;
|
|
111
111
|
/**
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
112
|
+
* Google Cloud project id. Falls back to `FIREBASE_PROJECT_ID`,
|
|
113
|
+
* `GOOGLE_CLOUD_PROJECT`, or `GCLOUD_PROJECT`.
|
|
114
|
+
*/
|
|
115
115
|
projectId?: string;
|
|
116
116
|
/**
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
* When set, `getReadUrl` returns `${publicBaseUrl}/${key}` instead of a
|
|
118
|
+
* signed URL. Use for objects served through a public bucket or CDN.
|
|
119
|
+
*/
|
|
120
120
|
publicBaseUrl?: string;
|
|
121
121
|
/**
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
122
|
+
* Path to a service-account JSON key file. Ignored when `app` or
|
|
123
|
+
* `credentials` is supplied. Falls back to
|
|
124
|
+
* `GOOGLE_APPLICATION_CREDENTIALS`.
|
|
125
|
+
*/
|
|
126
126
|
serviceAccountPath?: string;
|
|
127
127
|
}
|
|
128
128
|
/**
|
|
129
|
-
* Firebase Storage backend.
|
|
130
|
-
*
|
|
131
|
-
* Firebase Storage is a Google Cloud Storage bucket under the hood; this
|
|
132
|
-
* adapter resolves a `firebase-admin` app, obtains its `@google-cloud/storage`
|
|
133
|
-
* `Bucket`, and drives single-shot uploads through it. The part stream is
|
|
134
|
-
* buffered and uploaded in one `file.save()` call. Use `getUploadUrl` for
|
|
135
|
-
* direct-from-client large transfers.
|
|
136
|
-
* @example
|
|
137
|
-
* ```ts
|
|
138
|
-
* import { FirebaseStorage } from "@visulima/storage/provider/firebase";
|
|
139
|
-
*
|
|
140
|
-
* const storage = new FirebaseStorage({
|
|
141
|
-
* bucket: "my-project.appspot.com",
|
|
142
|
-
* projectId: process.env.FIREBASE_PROJECT_ID,
|
|
143
|
-
* credentials: {
|
|
144
|
-
* clientEmail: process.env.FIREBASE_CLIENT_EMAIL,
|
|
145
|
-
* privateKey: process.env.FIREBASE_PRIVATE_KEY,
|
|
146
|
-
* },
|
|
147
|
-
* });
|
|
148
|
-
* ```
|
|
149
|
-
* @remarks
|
|
150
|
-
* - ⚠️ 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.
|
|
151
|
-
*/
|
|
129
|
+
* Firebase Storage backend.
|
|
130
|
+
*
|
|
131
|
+
* Firebase Storage is a Google Cloud Storage bucket under the hood; this
|
|
132
|
+
* adapter resolves a `firebase-admin` app, obtains its `@google-cloud/storage`
|
|
133
|
+
* `Bucket`, and drives single-shot uploads through it. The part stream is
|
|
134
|
+
* buffered and uploaded in one `file.save()` call. Use `getUploadUrl` for
|
|
135
|
+
* direct-from-client large transfers.
|
|
136
|
+
* @example
|
|
137
|
+
* ```ts
|
|
138
|
+
* import { FirebaseStorage } from "@visulima/storage/provider/firebase";
|
|
139
|
+
*
|
|
140
|
+
* const storage = new FirebaseStorage({
|
|
141
|
+
* bucket: "my-project.appspot.com",
|
|
142
|
+
* projectId: process.env.FIREBASE_PROJECT_ID,
|
|
143
|
+
* credentials: {
|
|
144
|
+
* clientEmail: process.env.FIREBASE_CLIENT_EMAIL,
|
|
145
|
+
* privateKey: process.env.FIREBASE_PRIVATE_KEY,
|
|
146
|
+
* },
|
|
147
|
+
* });
|
|
148
|
+
* ```
|
|
149
|
+
* @remarks
|
|
150
|
+
* - ⚠️ 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.
|
|
151
|
+
*/
|
|
152
152
|
declare class FirebaseStorage extends BaseStorage<FirebaseFile> {
|
|
153
153
|
static override readonly name: string;
|
|
154
154
|
override checksumTypes: string[];
|
|
@@ -161,15 +161,9 @@ declare class FirebaseStorage extends BaseStorage<FirebaseFile> {
|
|
|
161
161
|
override get raw(): FirebaseBucket;
|
|
162
162
|
create(config: FileInit, _options?: OperationOptions): Promise<FirebaseFile>;
|
|
163
163
|
write(part: FilePart | FileQuery | FirebaseFile, options?: OperationOptions): Promise<FirebaseFile>;
|
|
164
|
-
delete({
|
|
165
|
-
|
|
166
|
-
}: FileQuery, options?: OperationOptions): Promise<
|
|
167
|
-
override exists({
|
|
168
|
-
id
|
|
169
|
-
}: FileQuery, options?: OperationOptions): Promise<boolean>;
|
|
170
|
-
get({
|
|
171
|
-
id
|
|
172
|
-
}: FileQuery, options?: OperationOptions): Promise<FileReturn>;
|
|
164
|
+
delete({ id }: FileQuery, options?: OperationOptions): Promise<FirebaseFile>;
|
|
165
|
+
override exists({ id }: FileQuery, options?: OperationOptions): Promise<boolean>;
|
|
166
|
+
get({ id }: FileQuery, options?: OperationOptions): Promise<FileReturn>;
|
|
173
167
|
copy(name: string, destination: string, options?: OperationOptions & {
|
|
174
168
|
storageClass?: string;
|
|
175
169
|
}): Promise<FirebaseFile>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as r}from"../../packem_shared/FirebaseFile-BLaBxa2A.js";import{default as o}from"../../packem_shared/FirebaseMetaStorage-
|
|
1
|
+
import{default as r}from"../../packem_shared/FirebaseFile-BLaBxa2A.js";import{default as o}from"../../packem_shared/FirebaseMetaStorage-BI9YXcwU.js";import{default as s}from"../../packem_shared/FirebaseStorage-DNquii2p.js";export{r as FirebaseFile,o as FirebaseMetaStorage,s as FirebaseStorage};
|
|
@@ -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 { AccessOptions } from 'basic-ftp';
|
|
5
5
|
import 'node:crypto';
|
|
6
6
|
import 'node:http';
|
|
@@ -13,40 +13,40 @@ declare class FtpMetaStorage extends LocalMetaStorage<FtpFile> {
|
|
|
13
13
|
}
|
|
14
14
|
interface FtpStorageOptions extends BaseStorageOptions {
|
|
15
15
|
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
* `basic-ftp` access options (`host`, `port`, `user`, `password`,
|
|
17
|
+
* `secure` for FTPS, …). A fresh connection is opened and closed around
|
|
18
|
+
* every storage operation — an FTP control connection is single-session,
|
|
19
|
+
* so the adapter does not pool connections.
|
|
20
|
+
*/
|
|
21
21
|
connection: AccessOptions;
|
|
22
22
|
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
* Configure metafile storage. FTP has no native arbitrary-metadata
|
|
24
|
+
* field, so upload metadata is stored as sidecar JSON on the local
|
|
25
|
+
* disk (defaults to the OS temp directory).
|
|
26
|
+
*/
|
|
27
27
|
metaStorageConfig?: LocalMetaStorageOptions;
|
|
28
28
|
/**
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
* Logical "bucket root" — virtual keys live under this remote directory.
|
|
30
|
+
* The adapter creates intermediate directories on write. Leading/trailing
|
|
31
|
+
* slashes are normalized. Defaults to the connection's working directory.
|
|
32
|
+
*/
|
|
33
33
|
rootFolderPath?: string;
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
|
-
* FTP / FTPS storage backend (built on `basic-ftp`).
|
|
37
|
-
*
|
|
38
|
-
* Routes virtual keys onto remote paths under `rootFolderPath`. FTP has no
|
|
39
|
-
* native metadata store, so upload metadata is kept as sidecar JSON on the
|
|
40
|
-
* local disk (see `FtpMetaStorage`).
|
|
41
|
-
*
|
|
42
|
-
* A fresh FTP connection is opened and closed around every operation: an FTP
|
|
43
|
-
* control connection is single-session, so the adapter does not pool
|
|
44
|
-
* connections.
|
|
45
|
-
*
|
|
46
|
-
* **Limitations**:
|
|
47
|
-
* - `write()` buffers the full part in memory before uploading (no remote append), so chunked uploads overwrite rather than append.
|
|
48
|
-
* - `getReadUrl` / `getUploadUrl` are not supported — FTP has no signed-URL concept.
|
|
49
|
-
*/
|
|
36
|
+
* FTP / FTPS storage backend (built on `basic-ftp`).
|
|
37
|
+
*
|
|
38
|
+
* Routes virtual keys onto remote paths under `rootFolderPath`. FTP has no
|
|
39
|
+
* native metadata store, so upload metadata is kept as sidecar JSON on the
|
|
40
|
+
* local disk (see `FtpMetaStorage`).
|
|
41
|
+
*
|
|
42
|
+
* A fresh FTP connection is opened and closed around every operation: an FTP
|
|
43
|
+
* control connection is single-session, so the adapter does not pool
|
|
44
|
+
* connections.
|
|
45
|
+
*
|
|
46
|
+
* **Limitations**:
|
|
47
|
+
* - `write()` buffers the full part in memory before uploading (no remote append), so chunked uploads overwrite rather than append.
|
|
48
|
+
* - `getReadUrl` / `getUploadUrl` are not supported — FTP has no signed-URL concept.
|
|
49
|
+
*/
|
|
50
50
|
declare class FtpStorage extends BaseStorage<FtpFile> {
|
|
51
51
|
static override readonly name: string;
|
|
52
52
|
override checksumTypes: string[];
|
|
@@ -57,32 +57,26 @@ declare class FtpStorage extends BaseStorage<FtpFile> {
|
|
|
57
57
|
constructor(config: FtpStorageOptions);
|
|
58
58
|
create(config: FileInit, _options?: OperationOptions): Promise<FtpFile>;
|
|
59
59
|
write(part: FilePart | FileQuery | FtpFile, options?: OperationOptions): Promise<FtpFile>;
|
|
60
|
-
get({
|
|
61
|
-
id
|
|
62
|
-
}: FileQuery, options?: OperationOptions & {
|
|
60
|
+
get({ id }: FileQuery, options?: OperationOptions & {
|
|
63
61
|
range?: {
|
|
64
62
|
end?: number;
|
|
65
63
|
start: number;
|
|
66
64
|
};
|
|
67
65
|
}): Promise<FileReturn>;
|
|
68
|
-
delete({
|
|
69
|
-
id
|
|
70
|
-
}: FileQuery, options?: OperationOptions): Promise<FtpFile>;
|
|
66
|
+
delete({ id }: FileQuery, options?: OperationOptions): Promise<FtpFile>;
|
|
71
67
|
copy(name: string, destination: string, options?: OperationOptions & {
|
|
72
68
|
storageClass?: string;
|
|
73
69
|
}): Promise<FtpFile>;
|
|
74
70
|
move(name: string, destination: string, options?: OperationOptions): Promise<FtpFile>;
|
|
75
71
|
override list(_limit?: number, options?: OperationOptions): Promise<FtpFile[]>;
|
|
76
|
-
override exists({
|
|
77
|
-
id
|
|
78
|
-
}: FileQuery, options?: OperationOptions): Promise<boolean>;
|
|
72
|
+
override exists({ id }: FileQuery, options?: OperationOptions): Promise<boolean>;
|
|
79
73
|
private walkList;
|
|
80
74
|
/**
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
75
|
+
* Opens a fresh single-session FTP connection for one operation. `basic-ftp`
|
|
76
|
+
* has no `AbortSignal` hook, so cancellation is best-effort: an abort
|
|
77
|
+
* destroys the control/data connection via `client.close()`, which rejects
|
|
78
|
+
* any in-flight transfer. The rejection is normalized to an `AbortError`.
|
|
79
|
+
*/
|
|
86
80
|
private run;
|
|
87
81
|
private ensureRemoteDirectory;
|
|
88
82
|
private keyToPath;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as a}from"../../packem_shared/FtpFile-ClWDYnt2.js";import{default as r}from"../../packem_shared/FtpMetaStorage-
|
|
1
|
+
import{default as a}from"../../packem_shared/FtpFile-ClWDYnt2.js";import{default as r}from"../../packem_shared/FtpMetaStorage-CHWrhgg2.js";import{default as p}from"../../packem_shared/FtpStorage-Bd004--s.js";export{a as FtpFile,r as FtpMetaStorage,p as FtpStorage};
|