@visulima/storage 1.0.0-alpha.25 → 1.0.0-alpha.27
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 +32 -0
- package/LICENSE.md +0 -1104
- package/README.md +79 -466
- package/dist/adapter/nuxt/module.d.ts +4 -4
- package/dist/adapter/nuxt/node_modules/.bin/nuxi +22 -0
- package/dist/adapter/nuxt/node_modules/.bin/nuxt +22 -0
- package/dist/ai/ai-sdk/index.d.ts +113 -0
- package/dist/ai/ai-sdk/index.js +1 -0
- package/dist/ai/claude/index.d.ts +177 -0
- package/dist/ai/claude/index.js +1 -0
- package/dist/ai/openai/index.d.ts +205 -0
- package/dist/ai/openai/index.js +1 -0
- package/dist/ai/tanstack/index.d.ts +115 -0
- package/dist/ai/tanstack/index.js +1 -0
- package/dist/handler/http/fetch/index.d.ts +13 -7
- package/dist/handler/http/fetch/index.js +1 -1
- package/dist/handler/http/hono/index.d.ts +5 -1412
- package/dist/handler/http/hono/index.js +1 -1
- package/dist/handler/http/nextjs/index.d.ts +4 -4
- package/dist/handler/http/nextjs/index.js +1 -1
- package/dist/handler/http/node/index.d.ts +7 -7
- package/dist/handler/http/node/index.js +1 -1
- package/dist/handler/http/solid-start/index.d.ts +4 -4
- package/dist/handler/http/solid-start/index.js +1 -1
- package/dist/index.d.ts +6 -324
- package/dist/index.js +1 -1
- package/dist/packem_shared/{AwsLightFile-BTLiRxXj.js → AwsLightFile-BSqjc_rD.js} +1 -1
- package/dist/packem_shared/{AwsLightStorage-CA9cdfJ6.js → AwsLightStorage-SH7j-myh.js} +1 -1
- package/dist/packem_shared/{AzureFile-BKHru1zB.js → AzureFile-Dgj2Tef4.js} +1 -1
- package/dist/packem_shared/{AzureSMetaStorage-BqA4jUDJ.js → AzureSMetaStorage-DV2tNjKh.js} +1 -1
- package/dist/packem_shared/AzureStorage-BVYMFEBP.js +1 -0
- package/dist/packem_shared/BaseTransformer-Fpcuz4kj.js +1 -0
- package/dist/packem_shared/BoxFile-Be0S4N1L.js +1 -0
- package/dist/packem_shared/BoxMetaStorage-BUe5Qmqe.js +1 -0
- package/dist/packem_shared/BoxStorage-CgC81_So.js +1 -0
- package/dist/packem_shared/BunnyFile-Dotl-lO9.js +1 -0
- package/dist/packem_shared/BunnyMetaStorage-D0mT6veJ.js +1 -0
- package/dist/packem_shared/BunnyStorage-Bl4usdVT.js +1 -0
- package/dist/packem_shared/DiskStorage-B5uIDVXr.js +1 -0
- package/dist/packem_shared/DiskStorageWithChecksum-CbXWpSOr.js +1 -0
- package/dist/packem_shared/DropboxFile-BGVG2kXM.js +1 -0
- package/dist/packem_shared/DropboxMetaStorage-CICuUZ1n.js +1 -0
- package/dist/packem_shared/DropboxStorage-CPjhDN5B.js +1 -0
- package/dist/packem_shared/ERRORS-CyOuSMLY.js +1 -0
- package/dist/packem_shared/File-BhfUgJjs.js +1 -0
- package/dist/packem_shared/Files-B7hlJcB4.js +1 -0
- package/dist/packem_shared/{GCSFile-CHjX_fJk.js → GCSFile-CDQ6IWAz.js} +1 -1
- package/dist/packem_shared/{GCSMetaStorage-BQkYQUDn.js → GCSMetaStorage-CqP9ifYB.js} +1 -1
- package/dist/packem_shared/GCStorage-XSBKVx90.js +1 -0
- package/dist/packem_shared/GoogleDriveFile-D0aGfGbL.js +1 -0
- package/dist/packem_shared/GoogleDriveMetaStorage-rghGy3Fa.js +1 -0
- package/dist/packem_shared/GoogleDriveStorage-DuB6glUk.js +1 -0
- package/dist/packem_shared/LocalMetaStorage-B5uh1snG.js +1 -0
- package/dist/packem_shared/MediaTransformer-D-1c9Q_k.js +1 -0
- package/dist/packem_shared/Multipart-7FSSy2n1.js +1 -0
- package/dist/packem_shared/Multipart-DACQFsrn.js +1 -0
- package/dist/packem_shared/{NetlifyBlobFile-CpzkMKng.js → NetlifyBlobFile-PMZLJ8AC.js} +1 -1
- package/dist/packem_shared/NetlifyBlobMetaStorage-BcRFPky8.js +1 -0
- package/dist/packem_shared/NetlifyBlobStorage-C4qkJv1R.js +1 -0
- package/dist/packem_shared/OneDriveFile-XbVVKIJh.js +1 -0
- package/dist/packem_shared/OneDriveMetaStorage-B_BkGLzW.js +1 -0
- package/dist/packem_shared/OneDriveStorage-Cu0cGcrh.js +1 -0
- package/dist/packem_shared/Rest-5NwM1xYj.js +1 -0
- package/dist/packem_shared/{Rest-CYEBbtCD.js → Rest-y8Vz2Rt0.js} +1 -1
- package/dist/packem_shared/{S3File-Du6wP0Sz.js → S3File-BfmCOET4.js} +1 -1
- package/dist/packem_shared/S3Storage-D8dopWoO.js +1 -0
- package/dist/packem_shared/SupabaseFile-DZ1iv9gM.js +1 -0
- package/dist/packem_shared/SupabaseMetaStorage-BR1UGqnj.js +1 -0
- package/dist/packem_shared/SupabaseStorage-CCtMTiN5.js +1 -0
- package/dist/packem_shared/{Tus-CUBCkuPE.js → Tus-BCVAbJIi.js} +1 -1
- package/dist/packem_shared/Tus-CJMcygk7.js +1 -0
- package/dist/packem_shared/UploadThingFile-BpG9mE8K.js +1 -0
- package/dist/packem_shared/UploadThingMetaStorage-DyGNyaAq.js +1 -0
- package/dist/packem_shared/UploadThingStorage-B_fNzNFO.js +1 -0
- package/dist/packem_shared/{VercelBlobFile-CL9MjKcY.js → VercelBlobFile-Cni_1qwD.js} +1 -1
- package/dist/packem_shared/{VercelBlobMetaStorage-BsOTx-Su.js → VercelBlobMetaStorage-Do9ZoKrl.js} +1 -1
- package/dist/packem_shared/VercelBlobStorage-D5zy4PPQ.js +1 -0
- package/dist/packem_shared/agentsListFiles-R-CnGKc4.js +1 -0
- package/dist/packem_shared/akamai-BYS9pP8S.js +1 -0
- package/dist/packem_shared/approval-BBeX3o4E.js +1 -0
- package/dist/packem_shared/approval.d-CMAYH9GF.d.ts +75 -0
- package/dist/packem_shared/backblaze-CvdtCvJL.js +1 -0
- package/dist/packem_shared/base-handler-core-BfwZ1RS1.js +1 -0
- package/dist/packem_shared/base-handler-fetch-CLxqXTQf.js +1 -0
- package/dist/packem_shared/base-handler-node-DBZjcqsp.js +1 -0
- package/dist/packem_shared/claudeListFiles-DAezbKEi.js +1 -0
- package/dist/packem_shared/cloudflare-Bm_Pg6yx.js +1 -0
- package/dist/packem_shared/createResponsesFileTools-BCep-qdO.js +1 -0
- package/dist/packem_shared/defaultCloudStorageFileNameValidation-6URTv-Mp.js +1 -0
- package/dist/packem_shared/detect-file-type-5JhzC9RU.js +1 -0
- package/dist/packem_shared/digitalOcean-Lj1NfDzc.js +1 -0
- package/dist/packem_shared/disk-storage-CbSSPnOf.js +5 -0
- package/dist/packem_shared/{disk-storage-with-checksum.d-B5D9I_CA.d.ts → disk-storage-with-checksum.d-BQMXA4Wl.d.ts} +6 -4
- package/dist/packem_shared/executors-DG6hGtvm.js +1 -0
- package/dist/packem_shared/executors.d-UtkeCbk1.d.ts +65 -0
- package/dist/packem_shared/{gcs-meta-storage-CNiEWerS.js → gcs-meta-storage-XB-UPJn6.js} +1 -1
- package/dist/packem_shared/hetzner-DDxE7Gy7.js +1 -0
- package/dist/packem_shared/index.d-DotjipuX.d.ts +89 -0
- package/dist/packem_shared/isRetryableError-B6ZS_-5I.js +1 -0
- package/dist/packem_shared/listFiles-B6VF05d-.js +1 -0
- package/dist/packem_shared/listFiles-BtP6VnUp.js +1 -0
- package/dist/packem_shared/{local-meta-storage-Bkwqi_gi.js → local-meta-storage-CT1audnK.js} +1 -1
- package/dist/packem_shared/{local-meta-storage.d-rO44cnQ5.d.ts → local-meta-storage.d-B5R1nswK.d.ts} +2 -1
- package/dist/packem_shared/{media-transformer.d-BXjTN5Qv.d.ts → media-transformer.d-DK7NJncf.d.ts} +2 -2
- package/dist/packem_shared/minio-T_Z3iEy7.js +1 -0
- package/dist/packem_shared/multipart-base-BxckfvQf.js +1 -0
- package/dist/packem_shared/oauth-refresh-Dg2ybc6_.js +1 -0
- package/dist/packem_shared/part-match-B5fLLmFw.js +1 -0
- package/dist/packem_shared/rest-base-CCv78k7h.js +1 -0
- package/dist/packem_shared/s3-base-storage-f_EyFAAt.js +1 -0
- package/dist/packem_shared/{s3-base-storage.d-Ccatb1dO.d.ts → s3-base-storage.d-BROGYJ4F.d.ts} +1 -1
- package/dist/packem_shared/storage-CoyB2O-Y.js +1 -0
- package/dist/packem_shared/{storage.d-sc8gn16g.d.ts → storage.d-Cr6f2lac.d.ts} +118 -17
- package/dist/packem_shared/storj-CVA9mM-7.js +1 -0
- package/dist/packem_shared/tigris-wmhjfsH2.js +1 -0
- package/dist/packem_shared/{tus-base.d-BX3mSWL6.d.ts → tus-base.d-4-ZfDQwl.d.ts} +3 -3
- package/dist/packem_shared/{types.d-Cor8FV54.d.ts → types.d-BgCmSE94.d.ts} +2 -2
- package/dist/packem_shared/{types.d-b0WcdT0x.d.ts → types.d-C8eSxqX9.d.ts} +14 -2
- package/dist/packem_shared/wasabi-JQzxdrFy.js +1 -0
- package/dist/storage/aws/clients/index.d.ts +90 -15
- package/dist/storage/aws/clients/index.js +1 -1
- package/dist/storage/aws/index.d.ts +16 -15
- package/dist/storage/aws/index.js +1 -1
- package/dist/storage/aws-light/index.d.ts +5 -3
- package/dist/storage/aws-light/index.js +1 -1
- package/dist/storage/azure/index.d.ts +4 -10277
- package/dist/storage/azure/index.js +1 -1
- package/dist/storage/box/index.d.ts +186 -0
- package/dist/storage/box/index.js +1 -0
- package/dist/storage/bunny/index.d.ts +116 -0
- package/dist/storage/bunny/index.js +1 -0
- package/dist/storage/dropbox/index.d.ts +129 -0
- package/dist/storage/dropbox/index.js +1 -0
- package/dist/storage/gcs/index.d.ts +6 -3941
- package/dist/storage/gcs/index.js +1 -1
- package/dist/storage/google-drive/index.d.ts +145 -0
- package/dist/storage/google-drive/index.js +1 -0
- package/dist/storage/local/index.d.ts +3 -3
- package/dist/storage/local/index.js +1 -1
- package/dist/storage/netlify-blob/index.d.ts +4 -2
- package/dist/storage/netlify-blob/index.js +1 -1
- package/dist/storage/onedrive/index.d.ts +192 -0
- package/dist/storage/onedrive/index.js +1 -0
- package/dist/storage/supabase/index.d.ts +111 -0
- package/dist/storage/supabase/index.js +1 -0
- package/dist/storage/uploadthing/index.d.ts +91 -0
- package/dist/storage/uploadthing/index.js +1 -0
- package/dist/storage/vercel-blob/index.d.ts +17 -2
- package/dist/storage/vercel-blob/index.js +1 -1
- package/dist/transformer/audio-transformer.d.ts +2 -2
- package/dist/transformer/audio-transformer.js +1 -1
- package/dist/transformer/image-transformer.d.ts +6 -2
- package/dist/transformer/image-transformer.js +1 -1
- package/dist/transformer/index.d.ts +3 -3
- package/dist/transformer/index.js +1 -1
- package/dist/transformer/video-transformer.d.ts +2 -2
- package/dist/transformer/video-transformer.js +1 -1
- package/package.json +99 -3
- package/dist/packem_shared/AzureStorage-BKUjCymW.js +0 -1
- package/dist/packem_shared/BaseTransformer-D68eLyz1.js +0 -1
- package/dist/packem_shared/DiskStorage-DNjpDMX9.js +0 -1
- package/dist/packem_shared/DiskStorageWithChecksum-Bb6JX_tC.js +0 -1
- package/dist/packem_shared/ERRORS-B9jkvKwx.js +0 -1
- package/dist/packem_shared/File-alcSNpLq.js +0 -1
- package/dist/packem_shared/GCStorage-C8hxSNLM.js +0 -1
- package/dist/packem_shared/LocalMetaStorage-BWuFvWn4.js +0 -1
- package/dist/packem_shared/MediaTransformer-2C8MJeAg.js +0 -1
- package/dist/packem_shared/Multipart-Bd9YFFn0.js +0 -1
- package/dist/packem_shared/Multipart-D5bcEvga.js +0 -1
- package/dist/packem_shared/NetlifyBlobMetaStorage-dD0oBLom.js +0 -1
- package/dist/packem_shared/NetlifyBlobStorage-ByTwCN-h.js +0 -1
- package/dist/packem_shared/Rest-DoonVU7B.js +0 -1
- package/dist/packem_shared/S3Client.d-CZ62Jztg.d.ts +0 -20357
- package/dist/packem_shared/S3Storage-Fx6-OSc-.js +0 -1
- package/dist/packem_shared/Tus-Bd_2Ki2G.js +0 -1
- package/dist/packem_shared/VercelBlobStorage-kNkk5Cn4.js +0 -1
- package/dist/packem_shared/backblaze-DEflv87m.js +0 -1
- package/dist/packem_shared/base-handler-core-DaggCVsq.js +0 -1
- package/dist/packem_shared/base-handler-fetch-DnarP64X.js +0 -1
- package/dist/packem_shared/base-handler-node-BTes6sql.js +0 -1
- package/dist/packem_shared/cloudflare-DLAeQvgD.js +0 -1
- package/dist/packem_shared/defaultCloudStorageFileNameValidation-yiM9GxHr.js +0 -1
- package/dist/packem_shared/digitalOcean-nhZUds87.js +0 -1
- package/dist/packem_shared/disk-storage-BvdK4bqF.js +0 -5
- package/dist/packem_shared/isRetryableError-DQNSZiBc.js +0 -1
- package/dist/packem_shared/minio-BWwgGXeE.js +0 -1
- package/dist/packem_shared/multipart-base-C6OjBwMS.js +0 -1
- package/dist/packem_shared/part-match-DqD5U7An.js +0 -1
- package/dist/packem_shared/rest-base-B2Dv7esY.js +0 -1
- package/dist/packem_shared/s3-base-storage-xHZNtsGe.js +0 -1
- package/dist/packem_shared/storage-m_Cxgiih.js +0 -1
- package/dist/packem_shared/tigris-DZoyrMNd.js +0 -1
- package/dist/packem_shared/validator-DK41xp8N.js +0 -1
- package/dist/packem_shared/wasabi-Dmce4x9s.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as a}from"../../packem_shared/AzureFile-
|
|
1
|
+
import{default as a}from"../../packem_shared/AzureFile-Dgj2Tef4.js";import{default as o}from"../../packem_shared/AzureSMetaStorage-DV2tNjKh.js";import{default as u}from"../../packem_shared/AzureStorage-BVYMFEBP.js";export{a as AzureFile,o as AzureSMetaStorage,u as AzureStorage};
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { F as File, L as LocalMetaStorageOptions, l as BaseStorageOptions, M as MetaStorage, e as FileInit, f as FilePart, g as FileQuery, a as FileReturn, B as BaseStorage } from "../../packem_shared/storage.d-Cr6f2lac.js";
|
|
2
|
+
import 'node:stream';
|
|
3
|
+
import { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-B5R1nswK.js";
|
|
4
|
+
import { BoxClient } from 'box-typescript-sdk-gen';
|
|
5
|
+
import 'node:crypto';
|
|
6
|
+
import 'node:http';
|
|
7
|
+
import 'lru-cache';
|
|
8
|
+
declare class BoxFile extends File {
|
|
9
|
+
boxFileId?: string;
|
|
10
|
+
eTag?: string;
|
|
11
|
+
publicUrl?: string;
|
|
12
|
+
}
|
|
13
|
+
declare class BoxMetaStorage extends LocalMetaStorage<BoxFile> {
|
|
14
|
+
constructor(config?: LocalMetaStorageOptions);
|
|
15
|
+
}
|
|
16
|
+
interface BoxOAuthOptions {
|
|
17
|
+
/**
|
|
18
|
+
* Box application client ID.
|
|
19
|
+
*/
|
|
20
|
+
clientId: string;
|
|
21
|
+
/**
|
|
22
|
+
* Box application client secret.
|
|
23
|
+
*/
|
|
24
|
+
clientSecret: string;
|
|
25
|
+
/**
|
|
26
|
+
* Long-lived refresh token previously obtained via Box's authorization
|
|
27
|
+
* code flow. The adapter seeds the SDK's in-memory token storage with
|
|
28
|
+
* this value; the SDK exchanges it for a fresh access token on first
|
|
29
|
+
* use and re-refreshes when the access token expires.
|
|
30
|
+
*/
|
|
31
|
+
refreshToken: string;
|
|
32
|
+
}
|
|
33
|
+
interface BoxCcgOptions {
|
|
34
|
+
/**
|
|
35
|
+
* Box application client ID.
|
|
36
|
+
*/
|
|
37
|
+
clientId: string;
|
|
38
|
+
/**
|
|
39
|
+
* Box application client secret.
|
|
40
|
+
*/
|
|
41
|
+
clientSecret: string;
|
|
42
|
+
/**
|
|
43
|
+
* Pass `enterpriseId` to authenticate as the service account, or `userId`
|
|
44
|
+
* to authenticate as a managed/app user. At least one is required.
|
|
45
|
+
*/
|
|
46
|
+
enterpriseId?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Pass `userId` to authenticate as a managed/app user.
|
|
49
|
+
*/
|
|
50
|
+
userId?: string;
|
|
51
|
+
}
|
|
52
|
+
type BoxJwtOptions = {
|
|
53
|
+
configFilePath: string;
|
|
54
|
+
} | {
|
|
55
|
+
configJsonString: string;
|
|
56
|
+
};
|
|
57
|
+
interface BoxStorageOptions extends BaseStorageOptions {
|
|
58
|
+
/**
|
|
59
|
+
* Server-side Client Credentials Grant. Mutually exclusive with
|
|
60
|
+
* `developerToken`, `oauth`, and `jwt`.
|
|
61
|
+
*/
|
|
62
|
+
ccg?: BoxCcgOptions;
|
|
63
|
+
/**
|
|
64
|
+
* Pre-built `BoxClient`. Escape hatch for callers that already wire
|
|
65
|
+
* auth themselves (e.g. with a custom `NetworkSession`, proxy config,
|
|
66
|
+
* or downscoped tokens).
|
|
67
|
+
*/
|
|
68
|
+
client?: BoxClient;
|
|
69
|
+
/**
|
|
70
|
+
* Default expiry, in seconds, advertised to callers of `getReadUrl()`.
|
|
71
|
+
* Box does not document a hard maximum for download URLs (they are
|
|
72
|
+
* short-lived by API design); this value is forwarded as documentation
|
|
73
|
+
* only — the actual lifetime is decided by Box. Defaults to 3600.
|
|
74
|
+
*/
|
|
75
|
+
defaultUrlExpiresIn?: number;
|
|
76
|
+
/**
|
|
77
|
+
* Static developer token from the Box developer console. Useful for
|
|
78
|
+
* scripts and trying the adapter; production apps should use OAuth,
|
|
79
|
+
* CCG, or JWT instead. Mutually exclusive with `oauth`, `ccg`, `jwt`.
|
|
80
|
+
*/
|
|
81
|
+
developerToken?: string;
|
|
82
|
+
/**
|
|
83
|
+
* JWT Server Authentication, configured via the JSON blob from Box's
|
|
84
|
+
* developer console. Mutually exclusive with the other auth modes.
|
|
85
|
+
*/
|
|
86
|
+
jwt?: BoxJwtOptions;
|
|
87
|
+
/**
|
|
88
|
+
* Configure metafiles storage. Defaults to local tmp directory.
|
|
89
|
+
*/
|
|
90
|
+
metaStorageConfig?: LocalMetaStorageOptions;
|
|
91
|
+
/**
|
|
92
|
+
* OAuth2 user-app flow seeded with a refresh token. Mutually exclusive
|
|
93
|
+
* with `developerToken`, `ccg`, and `jwt`.
|
|
94
|
+
*/
|
|
95
|
+
oauth?: BoxOAuthOptions;
|
|
96
|
+
/**
|
|
97
|
+
* When `true`, `getReadUrl` creates (or reuses) an `open`-access shared
|
|
98
|
+
* link instead of a short-lived signed download URL. Public shared links
|
|
99
|
+
* may be restricted on Box Business or Enterprise plans; the adapter
|
|
100
|
+
* surfaces Box's `access_denied_insufficient_permissions` error
|
|
101
|
+
* unmodified in that case.
|
|
102
|
+
*/
|
|
103
|
+
publicByDefault?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Logical "bucket root" — virtual keys live under this Box folder ID.
|
|
106
|
+
* Use `"0"` (the default) to anchor at the user's root folder. The
|
|
107
|
+
* folder must already exist; intermediate subfolders are auto-created
|
|
108
|
+
* on upload.
|
|
109
|
+
*/
|
|
110
|
+
rootFolderId?: string;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Box storage backend.
|
|
114
|
+
*
|
|
115
|
+
* Routes virtual keys onto Box folder/file IDs under `rootFolderId`. Uploads
|
|
116
|
+
* use `uploads.uploadFile` / `uploads.uploadFileVersion` up to 50 MB and
|
|
117
|
+
* switch to the chunked-upload session API above that threshold. Subfolders
|
|
118
|
+
* along a key's path are auto-created on first write.
|
|
119
|
+
*
|
|
120
|
+
* **Auth precedence**:
|
|
121
|
+
* 1. `client` (pre-built `BoxClient`)
|
|
122
|
+
* 2. `developerToken` (static, from Box developer console)
|
|
123
|
+
* 3. `oauth` (refresh-token seeded — `clientId` + `clientSecret` + `refreshToken`)
|
|
124
|
+
* 4. `ccg` (Client Credentials Grant — `clientId` + `clientSecret` + `enterpriseId` or `userId`)
|
|
125
|
+
* 5. `jwt` (JWT Server Auth — `configJsonString` or `configFilePath`)
|
|
126
|
+
* 6. Env fallback: `BOX_DEVELOPER_TOKEN`
|
|
127
|
+
*
|
|
128
|
+
* **Limitations**:
|
|
129
|
+
* - `metadata` is not supported on the unified API — Box exposes file metadata
|
|
130
|
+
* via classifications and metadata templates. Use `storage.raw.fileMetadata.*`
|
|
131
|
+
* directly if you need them.
|
|
132
|
+
* - `cacheControl` is not supported (Box does not expose HTTP cache headers
|
|
133
|
+
* on file content).
|
|
134
|
+
* - `getUploadUrl` is not supported — Box uploads require a multipart `POST`
|
|
135
|
+
* with both an `attributes` JSON part and the file bytes part, which doesn't
|
|
136
|
+
* fit the PUT-with-raw-body presigned-URL contract.
|
|
137
|
+
* - `responseContentDisposition` is not supported on signed download URLs.
|
|
138
|
+
* - `write()` buffers the full part body in memory before choosing between
|
|
139
|
+
* the simple-upload and chunked-upload paths. Each request handler runs
|
|
140
|
+
* independently, so concurrent multi-GB writes are bounded by the host's
|
|
141
|
+
* available memory.
|
|
142
|
+
*/
|
|
143
|
+
declare class BoxStorage extends BaseStorage<BoxFile> {
|
|
144
|
+
static override readonly name: string;
|
|
145
|
+
override checksumTypes: string[];
|
|
146
|
+
protected meta: MetaStorage<BoxFile>;
|
|
147
|
+
private readonly authHandle;
|
|
148
|
+
private readonly client;
|
|
149
|
+
private readonly fileIdCache;
|
|
150
|
+
private readonly folderIdCache;
|
|
151
|
+
private readonly publicByDefault;
|
|
152
|
+
private readonly rootFolderId;
|
|
153
|
+
constructor(config: BoxStorageOptions);
|
|
154
|
+
override get raw(): BoxClient;
|
|
155
|
+
create(config: FileInit): Promise<BoxFile>;
|
|
156
|
+
write(part: FilePart | FileQuery | BoxFile): Promise<BoxFile>;
|
|
157
|
+
delete({
|
|
158
|
+
id
|
|
159
|
+
}: FileQuery): Promise<BoxFile>;
|
|
160
|
+
get({
|
|
161
|
+
id
|
|
162
|
+
}: FileQuery): Promise<FileReturn>;
|
|
163
|
+
copy(name: string, destination: string): Promise<BoxFile>;
|
|
164
|
+
move(name: string, destination: string): Promise<BoxFile>;
|
|
165
|
+
override list(limit?: number): Promise<BoxFile[]>;
|
|
166
|
+
override getReadUrl(key: string, options?: {
|
|
167
|
+
expiresIn?: number;
|
|
168
|
+
responseContentDisposition?: string;
|
|
169
|
+
responseContentType?: string;
|
|
170
|
+
}): Promise<string>;
|
|
171
|
+
override getUploadUrl(_key: string, _options?: {
|
|
172
|
+
contentLength?: number;
|
|
173
|
+
contentType?: string;
|
|
174
|
+
expiresIn?: number;
|
|
175
|
+
}): Promise<string>;
|
|
176
|
+
private findChildByName;
|
|
177
|
+
private folderCacheKey;
|
|
178
|
+
private resolveFolderId;
|
|
179
|
+
private resolveFileId;
|
|
180
|
+
private resolveExistingFileForUpload;
|
|
181
|
+
private performUpload;
|
|
182
|
+
private ensureSharedLink;
|
|
183
|
+
private fetchSharedLinkUrl;
|
|
184
|
+
private internalOnComplete;
|
|
185
|
+
}
|
|
186
|
+
export { type BoxCcgOptions, BoxFile, type BoxJwtOptions, BoxMetaStorage, type BoxOAuthOptions, BoxStorage, type BoxStorageOptions };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{default as a}from"../../packem_shared/BoxFile-Be0S4N1L.js";import{default as r}from"../../packem_shared/BoxMetaStorage-BUe5Qmqe.js";import{default as x}from"../../packem_shared/BoxStorage-CgC81_So.js";export{a as BoxFile,r as BoxMetaStorage,x as BoxStorage};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { F as File, L as LocalMetaStorageOptions, l as BaseStorageOptions, M as MetaStorage, e as FileInit, f as FilePart, g as FileQuery, a as FileReturn, B as BaseStorage } from "../../packem_shared/storage.d-Cr6f2lac.js";
|
|
2
|
+
import 'node:stream';
|
|
3
|
+
import { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-B5R1nswK.js";
|
|
4
|
+
import * as BunnyStorageSDK from '@bunny.net/storage-sdk';
|
|
5
|
+
import 'node:crypto';
|
|
6
|
+
import 'node:http';
|
|
7
|
+
import 'lru-cache';
|
|
8
|
+
declare class BunnyFile extends File {
|
|
9
|
+
/**
|
|
10
|
+
* SHA-256 checksum reported by Bunny Storage (when present on the
|
|
11
|
+
* stored object).
|
|
12
|
+
*/
|
|
13
|
+
bunnyChecksum?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Server-side path within the Storage Zone (always prefixed with `/`).
|
|
16
|
+
*/
|
|
17
|
+
bunnyPath?: string;
|
|
18
|
+
}
|
|
19
|
+
declare class BunnyMetaStorage extends LocalMetaStorage<BunnyFile> {
|
|
20
|
+
constructor(config?: LocalMetaStorageOptions);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Bunny Storage region code. Mirrors the SDK's `StorageRegion` enum values
|
|
24
|
+
* (e.g. `"de"`, `"ny"`, `"syd"`).
|
|
25
|
+
*/
|
|
26
|
+
type BunnyStorageRegion = `${BunnyStorageSDK.regions.StorageRegion}`;
|
|
27
|
+
/**
|
|
28
|
+
* A connected Bunny Storage zone produced by
|
|
29
|
+
* `BunnyStorageSDK.zone.connect_with_accesskey(...)`.
|
|
30
|
+
*/
|
|
31
|
+
type BunnyStorageClient = ReturnType<typeof BunnyStorageSDK.zone.connect_with_accesskey>;
|
|
32
|
+
interface BunnyStorageOptions extends BaseStorageOptions {
|
|
33
|
+
/**
|
|
34
|
+
* Bunny Storage zone password / API access key. Falls back to
|
|
35
|
+
* `BUNNY_STORAGE_ACCESS_KEY`, then `BUNNY_ACCESS_KEY`, then the
|
|
36
|
+
* SDK-documented `STORAGE_ACCESS_KEY`. Ignored when `client` is supplied.
|
|
37
|
+
*/
|
|
38
|
+
accessKey?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Pre-built `StorageZone` instance. Use this to share an instance across
|
|
41
|
+
* adapters or inject test stubs. Mutually exclusive with `zone` /
|
|
42
|
+
* `accessKey` / `region`.
|
|
43
|
+
*/
|
|
44
|
+
client?: BunnyStorageClient;
|
|
45
|
+
/**
|
|
46
|
+
* Configure metafiles storage for resumable-upload bookkeeping.
|
|
47
|
+
*/
|
|
48
|
+
metaStorageConfig?: LocalMetaStorageOptions;
|
|
49
|
+
/**
|
|
50
|
+
* Origin used to build URLs from `getReadUrl`, typically a Bunny Pull
|
|
51
|
+
* Zone or custom CDN hostname in front of the Storage Zone. When unset,
|
|
52
|
+
* `getReadUrl` throws because the Storage API requires an `AccessKey`
|
|
53
|
+
* header and has no signed-read URL primitive.
|
|
54
|
+
*/
|
|
55
|
+
publicBaseUrl?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Primary Bunny Storage region. Pass one of
|
|
58
|
+
* `BunnyStorageSDK.regions.StorageRegion.*`, e.g. `"de"`, `"ny"`, `"syd"`.
|
|
59
|
+
* Falls back to `BUNNY_STORAGE_REGION`, then `STORAGE_REGION`. Ignored
|
|
60
|
+
* when `client` is supplied.
|
|
61
|
+
*/
|
|
62
|
+
region?: BunnyStorageRegion;
|
|
63
|
+
/**
|
|
64
|
+
* Bunny Storage zone name. Falls back to `BUNNY_STORAGE_ZONE`, then the
|
|
65
|
+
* SDK-documented `STORAGE_ZONE`. Ignored when `client` is supplied.
|
|
66
|
+
*/
|
|
67
|
+
zone?: string;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Bunny Storage backend.
|
|
71
|
+
*
|
|
72
|
+
* Uses `@bunny.net/storage-sdk`. Writes go through the Storage API with an `AccessKey` header; reads either go through `data()` (server-side fetch) or, when a public Pull Zone is configured, through `publicBaseUrl`.
|
|
73
|
+
*
|
|
74
|
+
* **Limitations** (mirroring files-sdk PR #21):
|
|
75
|
+
*
|
|
76
|
+
* - No native server-side `copy` — implemented as download + re-upload.
|
|
77
|
+
* - No `signedUploadUrl` / presigned PUT — Bunny has no such primitive.
|
|
78
|
+
* - `getReadUrl` requires `publicBaseUrl` (Pull Zone / CDN hostname) and returns an unsigned URL — Bunny has no signed-read URL primitive, so `expiresIn` is accepted for parity with other adapters but ignored.
|
|
79
|
+
* - `getReadUrl` rejects `responseContentDisposition` — no override exists on Bunny Storage / Pull Zone URLs.
|
|
80
|
+
* - `list` is non-recursive: `BunnyStorageSDK.file.list(client, "/")` returns only the immediate children of the zone root. Directory entries are filtered out client-side; the adapter does not descend.
|
|
81
|
+
*/
|
|
82
|
+
declare class BunnyStorage extends BaseStorage<BunnyFile> {
|
|
83
|
+
static override readonly name: string;
|
|
84
|
+
override checksumTypes: string[];
|
|
85
|
+
protected meta: MetaStorage<BunnyFile>;
|
|
86
|
+
private readonly client;
|
|
87
|
+
private readonly publicBaseUrl;
|
|
88
|
+
private readonly zoneName;
|
|
89
|
+
constructor(config: BunnyStorageOptions);
|
|
90
|
+
override get raw(): BunnyStorageClient;
|
|
91
|
+
/** Name of the connected Bunny Storage zone. */
|
|
92
|
+
get zone(): string;
|
|
93
|
+
create(config: FileInit): Promise<BunnyFile>;
|
|
94
|
+
write(part: FilePart | FileQuery | BunnyFile): Promise<BunnyFile>;
|
|
95
|
+
delete({
|
|
96
|
+
id
|
|
97
|
+
}: FileQuery): Promise<BunnyFile>;
|
|
98
|
+
get({
|
|
99
|
+
id
|
|
100
|
+
}: FileQuery): Promise<FileReturn>;
|
|
101
|
+
copy(name: string, destination: string): Promise<BunnyFile>;
|
|
102
|
+
move(name: string, destination: string): Promise<BunnyFile>;
|
|
103
|
+
override list(limit?: number): Promise<BunnyFile[]>;
|
|
104
|
+
override getReadUrl(key: string, options?: {
|
|
105
|
+
expiresIn?: number;
|
|
106
|
+
responseContentDisposition?: string;
|
|
107
|
+
responseContentType?: string;
|
|
108
|
+
}): Promise<string>;
|
|
109
|
+
override getUploadUrl(_key: string, _options?: {
|
|
110
|
+
contentLength?: number;
|
|
111
|
+
contentType?: string;
|
|
112
|
+
expiresIn?: number;
|
|
113
|
+
}): Promise<string>;
|
|
114
|
+
private internalOnComplete;
|
|
115
|
+
}
|
|
116
|
+
export { BunnyFile, BunnyMetaStorage, BunnyStorage, type BunnyStorageClient, type BunnyStorageOptions, type BunnyStorageRegion };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{default as t}from"../../packem_shared/BunnyFile-Dotl-lO9.js";import{default as r}from"../../packem_shared/BunnyMetaStorage-D0mT6veJ.js";import{default as n}from"../../packem_shared/BunnyStorage-Bl4usdVT.js";export{t as BunnyFile,r as BunnyMetaStorage,n as BunnyStorage};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { F as File, L as LocalMetaStorageOptions, l as BaseStorageOptions, M as MetaStorage, e as FileInit, f as FilePart, g as FileQuery, a as FileReturn, B as BaseStorage } from "../../packem_shared/storage.d-Cr6f2lac.js";
|
|
2
|
+
import 'node:stream';
|
|
3
|
+
import { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-B5R1nswK.js";
|
|
4
|
+
import { Dropbox } from 'dropbox';
|
|
5
|
+
import 'node:crypto';
|
|
6
|
+
import 'node:http';
|
|
7
|
+
import 'lru-cache';
|
|
8
|
+
declare class DropboxFile extends File {
|
|
9
|
+
path?: string;
|
|
10
|
+
publicUrl?: string;
|
|
11
|
+
rev?: string;
|
|
12
|
+
}
|
|
13
|
+
declare class DropboxMetaStorage extends LocalMetaStorage<DropboxFile> {
|
|
14
|
+
constructor(config?: LocalMetaStorageOptions);
|
|
15
|
+
}
|
|
16
|
+
interface DropboxStorageOptions extends BaseStorageOptions {
|
|
17
|
+
/**
|
|
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
|
+
accessToken?: string | (() => string | Promise<string>);
|
|
24
|
+
/**
|
|
25
|
+
* Dropbox app key (client_id). Required when `refreshToken` is set.
|
|
26
|
+
*/
|
|
27
|
+
appKey?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Dropbox app secret (client_secret). Required for confidential clients.
|
|
30
|
+
*/
|
|
31
|
+
appSecret?: string;
|
|
32
|
+
/**
|
|
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
|
+
client?: Dropbox;
|
|
38
|
+
/**
|
|
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
|
+
defaultUrlExpiresIn?: number;
|
|
44
|
+
/**
|
|
45
|
+
* Configure metafiles storage. Defaults to local tmp directory.
|
|
46
|
+
*/
|
|
47
|
+
metaStorageConfig?: LocalMetaStorageOptions;
|
|
48
|
+
/**
|
|
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
|
+
publicByDefault?: boolean;
|
|
54
|
+
/**
|
|
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
|
+
refreshToken?: string;
|
|
61
|
+
/**
|
|
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
|
+
rootFolderPath?: string;
|
|
68
|
+
}
|
|
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** (same model as files-sdk's Dropbox adapter):
|
|
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
|
+
*/
|
|
90
|
+
declare class DropboxStorage extends BaseStorage<DropboxFile> {
|
|
91
|
+
static override readonly name: string;
|
|
92
|
+
override checksumTypes: string[];
|
|
93
|
+
protected meta: MetaStorage<DropboxFile>;
|
|
94
|
+
private readonly authHandle;
|
|
95
|
+
private readonly client;
|
|
96
|
+
private readonly defaultUrlExpiresIn;
|
|
97
|
+
private readonly publicByDefault;
|
|
98
|
+
private readonly rootFolderPath;
|
|
99
|
+
constructor(config: DropboxStorageOptions);
|
|
100
|
+
override get raw(): Dropbox;
|
|
101
|
+
create(config: FileInit): Promise<DropboxFile>;
|
|
102
|
+
write(part: FilePart | FileQuery | DropboxFile): Promise<DropboxFile>;
|
|
103
|
+
delete({
|
|
104
|
+
id
|
|
105
|
+
}: FileQuery): Promise<DropboxFile>;
|
|
106
|
+
get({
|
|
107
|
+
id
|
|
108
|
+
}: FileQuery): Promise<FileReturn>;
|
|
109
|
+
copy(name: string, destination: string): Promise<DropboxFile>;
|
|
110
|
+
move(name: string, destination: string): Promise<DropboxFile>;
|
|
111
|
+
override list(limit?: number): Promise<DropboxFile[]>;
|
|
112
|
+
override getReadUrl(key: string, options?: {
|
|
113
|
+
expiresIn?: number;
|
|
114
|
+
responseContentDisposition?: string;
|
|
115
|
+
responseContentType?: string;
|
|
116
|
+
}): Promise<string>;
|
|
117
|
+
override getUploadUrl(_key: string, _options?: {
|
|
118
|
+
contentLength?: number;
|
|
119
|
+
contentType?: string;
|
|
120
|
+
expiresIn?: number;
|
|
121
|
+
}): Promise<string>;
|
|
122
|
+
private keyToPath;
|
|
123
|
+
private pathToKey;
|
|
124
|
+
private uploadSimple;
|
|
125
|
+
private uploadSession;
|
|
126
|
+
private createPublicSharedLink;
|
|
127
|
+
private internalOnComplete;
|
|
128
|
+
}
|
|
129
|
+
export { DropboxFile, DropboxMetaStorage, DropboxStorage, type DropboxStorageOptions };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{default as e}from"../../packem_shared/DropboxFile-BGVG2kXM.js";import{default as t}from"../../packem_shared/DropboxMetaStorage-CICuUZ1n.js";import{default as p}from"../../packem_shared/DropboxStorage-CPjhDN5B.js";export{e as DropboxFile,t as DropboxMetaStorage,p as DropboxStorage};
|