@visulima/storage 1.0.0-alpha.11 → 1.0.0-alpha.12
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 +28 -0
- package/dist/handler/http/fetch/index.js +3 -3
- package/dist/handler/http/hono/index.js +3 -3
- package/dist/handler/http/nextjs/index.d.ts +1 -1
- package/dist/handler/http/nextjs/index.js +3 -3
- package/dist/handler/http/node/index.js +3 -3
- package/dist/handler/http/solid-start/index.d.ts +1 -1
- package/dist/handler/http/solid-start/index.js +3 -3
- package/dist/handler/utils/upload-handlers.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/openapi/index.js +5 -5
- package/dist/packem_shared/{AwsLightFile-tTneXZgG.js → AwsLightFile-C-Nd5rtl.js} +1 -1
- package/dist/packem_shared/{AwsLightMetaStorage-D9qWQt6q.js → AwsLightMetaStorage-BIDb5EPg.js} +1 -1
- package/dist/packem_shared/{AwsLightStorage-CEJTYBVv.js → AwsLightStorage-C893xyaW.js} +4 -4
- package/dist/packem_shared/{AzureFile-CesgFzps.js → AzureFile-C0kug4w4.js} +1 -1
- package/dist/packem_shared/{AzureStorage-CH6nvQx8.js → AzureStorage-CpvzFT4y.js} +5 -3
- package/dist/packem_shared/{DiskStorage-DziI2mwX.js → DiskStorage-BF10kayx.js} +3 -3
- package/dist/packem_shared/{DiskStorageWithChecksum-B_XY8_cO.js → DiskStorageWithChecksum-pu9u6IF7.js} +17 -8
- package/dist/packem_shared/{File-Bb3P23dr.js → File-CPUhj3DI.js} +1 -1
- package/dist/packem_shared/{GCSFile-BIEunhAN.js → GCSFile-DaDiCKE2.js} +1 -1
- package/dist/packem_shared/{GCSMetaStorage-FypK8Tn1.js → GCSMetaStorage-BH6j7TM2.js} +1 -1
- package/dist/packem_shared/{GCStorage-CasTo9rF.js → GCStorage-BBHFEg7F.js} +6 -4
- package/dist/packem_shared/{MediaTransformer-BErvw2vE.js → MediaTransformer-BRRqYA0E.js} +9 -3
- package/dist/packem_shared/{Multipart-vxBL2VXm.js → Multipart-BzzvNxt4.js} +2 -2
- package/dist/packem_shared/{Multipart-CDDlDOs7.js → Multipart-DLtFLQ8s.js} +1 -1
- package/dist/packem_shared/{NetlifyBlobFile-CXzyjqrD.js → NetlifyBlobFile-CfyJtGWN.js} +1 -1
- package/dist/packem_shared/{NetlifyBlobStorage-DEpx_4q-.js → NetlifyBlobStorage-pZX0_VdO.js} +2 -2
- package/dist/packem_shared/{Rest-D14vM7aJ.js → Rest-DEa7IA9R.js} +3 -3
- package/dist/packem_shared/{Rest-CEj3EhMj.js → Rest-qhMbCn5a.js} +3 -3
- package/dist/packem_shared/{S3File-DZiyk9Qt.js → S3File-BXCuJaQZ.js} +1 -1
- package/dist/packem_shared/{S3Storage-B0scgwPa.js → S3Storage-2ZiheyWz.js} +2 -2
- package/dist/packem_shared/{Tus-WOVg-YnB.js → Tus-Ck0Hdle5.js} +3 -3
- package/dist/packem_shared/{Tus-Cjz87bpz.js → Tus-_0vCdHyB.js} +1 -1
- package/dist/packem_shared/{VercelBlobFile-BCg4aTEq.js → VercelBlobFile-DkFIIb9Q.js} +1 -1
- package/dist/packem_shared/{VercelBlobStorage-wOYxv8F7.js → VercelBlobStorage-CwgI91cP.js} +2 -2
- package/dist/packem_shared/{aws-light-meta-storage-Ba2b_h-o.js → aws-light-meta-storage-BGZEiY3y.js} +2 -2
- package/dist/packem_shared/{base-handler-core-BoAqTyz7.js → base-handler-core-lVB-D59L.js} +6 -3
- package/dist/packem_shared/{base-handler-fetch-CinvR65S.js → base-handler-fetch-CitgN-Aw.js} +1 -1
- package/dist/packem_shared/{base-handler-node-c02H0AxN.js → base-handler-node-BiO2DF87.js} +3 -3
- package/dist/packem_shared/{disk-storage-DeivH-J5.js → disk-storage-CC6-FUG9.js} +19 -10
- package/dist/packem_shared/{gcs-meta-storage-B0Baj0Xr.js → gcs-meta-storage-MsUrkgP6.js} +2 -2
- package/dist/packem_shared/{part-match-BMNqHDYD.js → part-match-Dt738Ddb.js} +3 -3
- package/dist/packem_shared/{rest-base-D9URIFkc.js → rest-base-k1ory8uB.js} +2 -2
- package/dist/packem_shared/{restOpenApiSpec-D1zbmid7.js → restOpenApiSpec-BBJ_SiPE.js} +1 -1
- package/dist/packem_shared/{s3-base-storage-CG21uusd.js → s3-base-storage-DSMObtht.js} +2 -5
- package/dist/packem_shared/{sharedGet-DAyJfjhl.js → sharedGet-CkSLSnMd.js} +6 -2
- package/dist/packem_shared/{transformOpenApiSpec-BC0r6PzI.js → transformOpenApiSpec-BodFhFls.js} +1 -1
- package/dist/packem_shared/{tusOpenApiSpec-BLIjKf0s.js → tusOpenApiSpec-DzppyJTW.js} +1 -1
- package/dist/packem_shared/{xhrOpenApiSpec-kItrSAsc.js → xhrOpenApiSpec-CXz7BC5J.js} +1 -1
- package/dist/storage/aws/index.js +2 -2
- package/dist/storage/aws/s3-base-storage.d.ts +1 -1
- package/dist/storage/aws/s3-storage.d.ts +1 -1
- package/dist/storage/aws/types.d.ts +1 -2
- package/dist/storage/aws-light/aws-light-storage.d.ts +3 -2
- package/dist/storage/aws-light/index.js +3 -3
- package/dist/storage/aws-light/types.d.ts +1 -2
- package/dist/storage/azure/azure-storage.d.ts +2 -2
- package/dist/storage/azure/index.js +2 -2
- package/dist/storage/azure/types.d.ts +1 -2
- package/dist/storage/gcs/gcs-storage.d.ts +2 -2
- package/dist/storage/gcs/index.js +3 -3
- package/dist/storage/gcs/types.d.ts +1 -2
- package/dist/storage/local/disk-storage.d.ts +1 -1
- package/dist/storage/local/index.js +2 -2
- package/dist/storage/local/local-meta-storage.d.ts +2 -7
- package/dist/storage/meta-storage-options.d.ts +11 -0
- package/dist/storage/meta-storage.d.ts +1 -1
- package/dist/storage/netlify-blob/index.js +2 -2
- package/dist/storage/netlify-blob/netlify-blob-meta-storage.d.ts +1 -2
- package/dist/storage/netlify-blob/netlify-blob-storage.d.ts +2 -2
- package/dist/storage/netlify-blob/types.d.ts +1 -2
- package/dist/storage/types.d.ts +2 -6
- package/dist/storage/vercel-blob/index.js +2 -2
- package/dist/storage/vercel-blob/types.d.ts +1 -2
- package/dist/storage/vercel-blob/vercel-blob-meta-storage.d.ts +1 -2
- package/dist/storage/vercel-blob/vercel-blob-storage.d.ts +2 -2
- package/dist/transformer/base-transformer.d.ts +1 -1
- package/dist/transformer/index.js +1 -1
- package/dist/transformer/transformer-config.d.ts +16 -0
- package/dist/transformer/types.d.ts +2 -15
- package/dist/utils/types.d.ts +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
## @visulima/storage [1.0.0-alpha.12](https://github.com/visulima/visulima/compare/@visulima/storage@1.0.0-alpha.11...@visulima/storage@1.0.0-alpha.12) (2026-04-21)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* **storage:** parameterize BaseStorage with subclass file type for gcs/netlify/vercel ([4d26390](https://github.com/visulima/visulima/commit/4d26390c75023edba40dc38d1291808e0722fdeb))
|
|
6
|
+
* **storage:** pass concrete file types as BaseStorage generics ([6a4e8f7](https://github.com/visulima/visulima/commit/6a4e8f7bba252be24cf8f9763abb0f63f6d25832))
|
|
7
|
+
* **storage:** resolve eslint and formatting issues ([31e5078](https://github.com/visulima/visulima/commit/31e5078beb640bfca419c144ca22fbfef56926cd))
|
|
8
|
+
* **tui:** inline component and hook barrel exports in ink entry ([1cf8dd2](https://github.com/visulima/visulima/commit/1cf8dd25c91a2001268fb9d964d95df649bf7832))
|
|
9
|
+
|
|
10
|
+
### Miscellaneous Chores
|
|
11
|
+
|
|
12
|
+
* bump engines.node to ^22.14.0 || >=24.10.0 ([c3d0931](https://github.com/visulima/visulima/commit/c3d0931d1504e4f21ebf50ea680cfa7ce4ba15ce))
|
|
13
|
+
* fixed jsr.json ([5d85e51](https://github.com/visulima/visulima/commit/5d85e5179de38e284ec433b14d77c71a1619c8d6))
|
|
14
|
+
* **storage:** apply formatter and lint fixes ([093d35e](https://github.com/visulima/visulima/commit/093d35edc53ed4e8f48c86b48a74e4062a7e539e))
|
|
15
|
+
* **storage:** apply pending changes ([89a3f64](https://github.com/visulima/visulima/commit/89a3f647d2836a0c48b224d28658ac912e9e1af2))
|
|
16
|
+
* **storage:** enforce curly braces and apply lint fixes ([2093253](https://github.com/visulima/visulima/commit/20932531885ae51604907008f730b9edbc06b962))
|
|
17
|
+
|
|
18
|
+
### Code Refactoring
|
|
19
|
+
|
|
20
|
+
* **crud:** break handler <-> types circular imports ([#613](https://github.com/visulima/visulima/issues/613)) ([a3c7692](https://github.com/visulima/visulima/commit/a3c7692a5c47cb6ce2284cef7507f4fb992ad3a3))
|
|
21
|
+
* replace inline import() types with top-level imports ([4569a4c](https://github.com/visulima/visulima/commit/4569a4ca04723da069f985855dcfab292f7347e1))
|
|
22
|
+
* **storage:** format code with prettier ([21477ce](https://github.com/visulima/visulima/commit/21477ce4354f83f68fbcbd11e07621e3329357e2))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Dependencies
|
|
26
|
+
|
|
27
|
+
* **@visulima/fs:** upgraded to 5.0.0-alpha.9
|
|
28
|
+
|
|
1
29
|
## @visulima/storage [1.0.0-alpha.11](https://github.com/visulima/visulima/compare/@visulima/storage@1.0.0-alpha.10...@visulima/storage@1.0.0-alpha.11) (2026-04-08)
|
|
2
30
|
|
|
3
31
|
### Bug Fixes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { default as Multipart } from '../../../packem_shared/Multipart-
|
|
2
|
-
export { default as Rest } from '../../../packem_shared/Rest-
|
|
3
|
-
export { Tus } from '../../../packem_shared/Tus-
|
|
1
|
+
export { default as Multipart } from '../../../packem_shared/Multipart-DLtFLQ8s.js';
|
|
2
|
+
export { default as Rest } from '../../../packem_shared/Rest-DEa7IA9R.js';
|
|
3
|
+
export { Tus } from '../../../packem_shared/Tus-_0vCdHyB.js';
|
|
4
4
|
export { TUS_RESUMABLE, TUS_VERSION } from '../../../packem_shared/TUS_RESUMABLE-Dtfsffnj.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import Multipart from '../../../packem_shared/Multipart-
|
|
2
|
-
import RestFetch from '../../../packem_shared/Rest-
|
|
3
|
-
import { Tus } from '../../../packem_shared/Tus-
|
|
1
|
+
import Multipart from '../../../packem_shared/Multipart-DLtFLQ8s.js';
|
|
2
|
+
import RestFetch from '../../../packem_shared/Rest-DEa7IA9R.js';
|
|
3
|
+
import { Tus } from '../../../packem_shared/Tus-_0vCdHyB.js';
|
|
4
4
|
|
|
5
5
|
const createHandlerFunction = (handler) => async (c) => {
|
|
6
6
|
try {
|
|
@@ -58,4 +58,4 @@ export interface NextjsHandlerConfig<TFile extends UploadFile> extends UploadOpt
|
|
|
58
58
|
* export const OPTIONS = handler;
|
|
59
59
|
* ```
|
|
60
60
|
*/
|
|
61
|
-
export declare const createHandler: <TFile extends UploadFile>(config: NextjsHandlerConfig<TFile>) => (
|
|
61
|
+
export declare const createHandler: <TFile extends UploadFile>(config: NextjsHandlerConfig<TFile>) => (request: NextRequest) => Promise<NextResponse>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NextResponse } from 'next/server.js';
|
|
2
|
-
import Multipart from '../../../packem_shared/Multipart-
|
|
3
|
-
import RestFetch from '../../../packem_shared/Rest-
|
|
4
|
-
import { Tus } from '../../../packem_shared/Tus-
|
|
2
|
+
import Multipart from '../../../packem_shared/Multipart-DLtFLQ8s.js';
|
|
3
|
+
import RestFetch from '../../../packem_shared/Rest-DEa7IA9R.js';
|
|
4
|
+
import { Tus } from '../../../packem_shared/Tus-_0vCdHyB.js';
|
|
5
5
|
|
|
6
6
|
const createHandler = (config) => {
|
|
7
7
|
let handler;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import Multipart from '../../../packem_shared/Multipart-
|
|
2
|
-
import Rest from '../../../packem_shared/Rest-
|
|
3
|
-
import { Tus } from '../../../packem_shared/Tus-
|
|
1
|
+
import Multipart from '../../../packem_shared/Multipart-BzzvNxt4.js';
|
|
2
|
+
import Rest from '../../../packem_shared/Rest-qhMbCn5a.js';
|
|
3
|
+
import { Tus } from '../../../packem_shared/Tus-Ck0Hdle5.js';
|
|
4
4
|
export { TUS_RESUMABLE, TUS_VERSION } from '../../../packem_shared/TUS_RESUMABLE-Dtfsffnj.js';
|
|
5
5
|
|
|
6
6
|
|
|
@@ -57,4 +57,4 @@ export interface SolidStartHandlerConfig<TFile extends UploadFile> extends Uploa
|
|
|
57
57
|
* export const OPTIONS = handler;
|
|
58
58
|
* ```
|
|
59
59
|
*/
|
|
60
|
-
export declare const createSolidStartHandler: <TFile extends UploadFile>(config: SolidStartHandlerConfig<TFile>) => (
|
|
60
|
+
export declare const createSolidStartHandler: <TFile extends UploadFile>(config: SolidStartHandlerConfig<TFile>) => (event: APIEvent) => Promise<Response>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import Multipart from '../../../packem_shared/Multipart-
|
|
2
|
-
import RestFetch from '../../../packem_shared/Rest-
|
|
3
|
-
import { Tus } from '../../../packem_shared/Tus-
|
|
1
|
+
import Multipart from '../../../packem_shared/Multipart-DLtFLQ8s.js';
|
|
2
|
+
import RestFetch from '../../../packem_shared/Rest-DEa7IA9R.js';
|
|
3
|
+
import { Tus } from '../../../packem_shared/Tus-_0vCdHyB.js';
|
|
4
4
|
|
|
5
5
|
const createSolidStartHandler = (config) => {
|
|
6
6
|
let handler;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
2
2
|
import type { Readable } from "node:stream";
|
|
3
3
|
import type { UploadFile } from "../../storage/utils/index.d.ts";
|
|
4
|
-
import type {
|
|
4
|
+
import type { UploadResponse } from "../../utils/types.d.ts";
|
|
5
5
|
import type { ResponseFile, ResponseList } from "../types.d.ts";
|
|
6
6
|
/**
|
|
7
7
|
* Handles HEAD/OPTIONS requests.
|
|
@@ -22,7 +22,7 @@ export declare const handleHeadOptionsRequest: <TFile extends UploadFile, NodeRe
|
|
|
22
22
|
* @param sendStream Function to send stream response
|
|
23
23
|
* @param parseRangeHeader Function to parse range header
|
|
24
24
|
*/
|
|
25
|
-
export declare const handleGetRequest: <TFile extends UploadFile, NodeResponse extends ServerResponse>(file: ResponseFile<TFile> | ResponseList<TFile>, request: IncomingMessage, response: NodeResponse, next: (() => void) | undefined, send: (response: NodeResponse, data: UploadResponse
|
|
25
|
+
export declare const handleGetRequest: <TFile extends UploadFile, NodeResponse extends ServerResponse>(file: ResponseFile<TFile> | ResponseList<TFile>, request: IncomingMessage, response: NodeResponse, next: (() => void) | undefined, send: (response: NodeResponse, data: UploadResponse) => void, sendStream: (response: NodeResponse, stream: Readable, options: {
|
|
26
26
|
headers: Record<string, string | number>;
|
|
27
27
|
range?: {
|
|
28
28
|
end: number;
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export { waitForStorage } from './packem_shared/waitForStorage-Cscw85sx.js';
|
|
2
|
-
export { D as DiskStorage } from './packem_shared/disk-storage-
|
|
3
|
-
export { default as DiskStorageWithChecksum } from './packem_shared/DiskStorageWithChecksum-
|
|
2
|
+
export { D as DiskStorage } from './packem_shared/disk-storage-CC6-FUG9.js';
|
|
3
|
+
export { default as DiskStorageWithChecksum } from './packem_shared/DiskStorageWithChecksum-pu9u6IF7.js';
|
|
4
4
|
export { L as LocalMetaStorage } from './packem_shared/local-meta-storage-BlOk6m7F.js';
|
|
5
5
|
export { default as MetaStorage } from './packem_shared/MetaStorage-pECeFOad.js';
|
|
6
6
|
export { B as AbstractBaseStorage, d as defaultCloudStorageFileNameValidation, a as defaultFilesystemFileNameValidation } from './packem_shared/storage-CpJpqLdn.js';
|
|
7
7
|
export { ERRORS, ErrorMap, UploadError, isUploadError, throwErrorCode } from './packem_shared/ERRORS-D0apMqnc.js';
|
|
8
8
|
export { createRetryWrapper, isRetryableError, retry } from './packem_shared/isRetryableError-Dycp7127.js';
|
|
9
9
|
export { fileTypeFromBlob, fileTypeFromBuffer, fileTypeFromTokenizer, supportedExtensions, supportedMimeTypes } from 'file-type';
|
|
10
|
-
export { default as File } from './packem_shared/File-
|
|
10
|
+
export { default as File } from './packem_shared/File-CPUhj3DI.js';
|
|
11
11
|
export { default as NoOpMetrics } from './packem_shared/NoOpMetrics-DhAk5rXc.js';
|
|
12
12
|
export { default as OpenTelemetryMetrics } from './packem_shared/OpenTelemetryMetrics-BnxhqIaH.js';
|
|
13
13
|
export { Metadata } from './packem_shared/Metadata-DRLXeJ0F.js';
|
package/dist/openapi/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { default as restOpenApiSpec } from '../packem_shared/restOpenApiSpec-
|
|
2
|
-
export { sharedErrorSchemaObject, sharedFileMetaExampleObject, sharedFileMetaSchemaObject, sharedGet, sharedGetList } from '../packem_shared/sharedGet-
|
|
3
|
-
export { default as transformOpenApiSpec } from '../packem_shared/transformOpenApiSpec-
|
|
4
|
-
export { default as tusOpenApiSpec } from '../packem_shared/tusOpenApiSpec-
|
|
5
|
-
export { default as xhrOpenApiSpec } from '../packem_shared/xhrOpenApiSpec-
|
|
1
|
+
export { default as restOpenApiSpec } from '../packem_shared/restOpenApiSpec-BBJ_SiPE.js';
|
|
2
|
+
export { sharedErrorSchemaObject, sharedFileMetaExampleObject, sharedFileMetaSchemaObject, sharedGet, sharedGetList } from '../packem_shared/sharedGet-CkSLSnMd.js';
|
|
3
|
+
export { default as transformOpenApiSpec } from '../packem_shared/transformOpenApiSpec-BodFhFls.js';
|
|
4
|
+
export { default as tusOpenApiSpec } from '../packem_shared/tusOpenApiSpec-DzppyJTW.js';
|
|
5
|
+
export { default as xhrOpenApiSpec } from '../packem_shared/xhrOpenApiSpec-CXz7BC5J.js';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Readable } from 'node:stream';
|
|
2
|
-
import { S as S3BaseStorage } from './s3-base-storage-
|
|
3
|
-
import { a as AwsLightApiAdapter, A as AwsLightMetaStorage } from './aws-light-meta-storage-
|
|
4
|
-
import AwsLightFile from './AwsLightFile-
|
|
2
|
+
import { S as S3BaseStorage } from './s3-base-storage-DSMObtht.js';
|
|
3
|
+
import { a as AwsLightApiAdapter, A as AwsLightMetaStorage } from './aws-light-meta-storage-BGZEiY3y.js';
|
|
4
|
+
import AwsLightFile from './AwsLightFile-C-Nd5rtl.js';
|
|
5
5
|
|
|
6
6
|
class AwsLightStorage extends S3BaseStorage {
|
|
7
7
|
static name = "aws-light";
|
|
8
8
|
s3Api;
|
|
9
9
|
constructor(config) {
|
|
10
|
-
const { bucket = process.env.S3_BUCKET || process.env.AWS_S3_BUCKET, region
|
|
10
|
+
const { bucket = process.env.S3_BUCKET || process.env.AWS_S3_BUCKET, region } = config;
|
|
11
11
|
if (!bucket) {
|
|
12
12
|
throw new Error("S3 bucket is not defined");
|
|
13
13
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { BlobServiceClient, StorageSharedKeyCredential } from '@azure/storage-blob';
|
|
2
|
-
import { p as partMatch, d as detectFileTypeFromStream, g as getFileStatus } from './part-match-
|
|
2
|
+
import { p as partMatch, d as detectFileTypeFromStream, g as getFileStatus } from './part-match-Dt738Ddb.js';
|
|
3
3
|
import { throwErrorCode, ERRORS } from './ERRORS-D0apMqnc.js';
|
|
4
4
|
import { B as BaseStorage, t as toMilliseconds } from './storage-CpJpqLdn.js';
|
|
5
5
|
import { createRetryWrapper } from './isRetryableError-Dycp7127.js';
|
|
6
6
|
import { L as LocalMetaStorage } from './local-meta-storage-BlOk6m7F.js';
|
|
7
|
-
import AzureFile from './AzureFile-
|
|
7
|
+
import AzureFile from './AzureFile-C0kug4w4.js';
|
|
8
8
|
import AzureMetaStorage from './AzureSMetaStorage-BEbXX9Uk.js';
|
|
9
9
|
import { n as normalize } from './path-aV9lMdcn-DMU5H1-h.js';
|
|
10
10
|
import { h as hasContent } from './has-content-CY66ehMK.js';
|
|
@@ -198,7 +198,9 @@ class AzureStorage extends BaseStorage {
|
|
|
198
198
|
}
|
|
199
199
|
const blobClient = this.containerClient.getBlockBlobClient(this.getFullPath(file.name));
|
|
200
200
|
const abortController = new AbortController();
|
|
201
|
-
part.body.on("error", () =>
|
|
201
|
+
part.body.on("error", () => {
|
|
202
|
+
abortController.abort();
|
|
203
|
+
});
|
|
202
204
|
const response = await this.retry(
|
|
203
205
|
() => blobClient.uploadStream(part.body, void 0, void 0, {
|
|
204
206
|
abortSignal: abortController.signal,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import 'node:fs';
|
|
2
2
|
import 'node:fs/promises';
|
|
3
3
|
import 'node:stream';
|
|
4
|
-
export { D as default } from './disk-storage-
|
|
5
|
-
import './part-match-
|
|
4
|
+
export { D as default } from './disk-storage-CC6-FUG9.js';
|
|
5
|
+
import './part-match-Dt738Ddb.js';
|
|
6
6
|
import './ERRORS-D0apMqnc.js';
|
|
7
7
|
import './storage-CpJpqLdn.js';
|
|
8
8
|
import './local-meta-storage-BlOk6m7F.js';
|
|
9
|
-
import './File-
|
|
9
|
+
import './File-CPUhj3DI.js';
|
|
10
10
|
import './update-size-CCGm6i1J.js';
|
|
11
11
|
import './has-content-CY66ehMK.js';
|
|
12
12
|
import './path-aV9lMdcn-DMU5H1-h.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createReadStream, createWriteStream } from 'node:fs';
|
|
2
2
|
import { truncate } from 'node:fs/promises';
|
|
3
3
|
import { Transform, pipeline } from 'node:stream';
|
|
4
|
-
import { p as partMatch, d as detectFileTypeFromStream, g as getFileStatus } from './part-match-
|
|
4
|
+
import { p as partMatch, d as detectFileTypeFromStream, g as getFileStatus } from './part-match-Dt738Ddb.js';
|
|
5
5
|
import { throwErrorCode, ERRORS } from './ERRORS-D0apMqnc.js';
|
|
6
|
-
import { D as DiskStorage, e as ensureFile, S as StreamLength, s as streamChecksum } from './disk-storage-
|
|
6
|
+
import { D as DiskStorage, e as ensureFile, S as StreamLength, s as streamChecksum } from './disk-storage-CC6-FUG9.js';
|
|
7
7
|
import { LRUCache } from 'lru-cache';
|
|
8
8
|
import { createHash } from 'node:crypto';
|
|
9
9
|
import { r as remove } from './local-meta-storage-BlOk6m7F.js';
|
|
@@ -115,7 +115,9 @@ class RangeHasher extends LRUCache {
|
|
|
115
115
|
if (initial !== void 0) {
|
|
116
116
|
digester.hash = initial;
|
|
117
117
|
}
|
|
118
|
-
createReadStream(path, { start }).on("error", reject).on("end", () =>
|
|
118
|
+
createReadStream(path, { start }).on("error", reject).on("end", () => {
|
|
119
|
+
resolve(digester.hash);
|
|
120
|
+
}).pipe(digester).resume();
|
|
119
121
|
});
|
|
120
122
|
}
|
|
121
123
|
}
|
|
@@ -223,15 +225,22 @@ class DiskStorageWithChecksum extends DiskStorage {
|
|
|
223
225
|
destination.close();
|
|
224
226
|
resolve([Number.NaN, code]);
|
|
225
227
|
};
|
|
226
|
-
lengthChecker.on("error", () =>
|
|
227
|
-
|
|
228
|
-
|
|
228
|
+
lengthChecker.on("error", () => {
|
|
229
|
+
failWithCode(ERRORS.FILE_CONFLICT);
|
|
230
|
+
});
|
|
231
|
+
checksumChecker.on("error", () => {
|
|
232
|
+
failWithCode(ERRORS.CHECKSUM_MISMATCH);
|
|
233
|
+
});
|
|
234
|
+
part.body.on("aborted", () => {
|
|
235
|
+
failWithCode(keepPartial ? void 0 : ERRORS.REQUEST_ABORTED);
|
|
236
|
+
});
|
|
229
237
|
pipeline(part.body, lengthChecker, checksumChecker, digester, destination, (error) => {
|
|
230
238
|
if (error) {
|
|
231
239
|
digester.reset();
|
|
232
|
-
|
|
240
|
+
reject(error);
|
|
241
|
+
return;
|
|
233
242
|
}
|
|
234
|
-
|
|
243
|
+
resolve([part.start + destination.bytesWritten]);
|
|
235
244
|
});
|
|
236
245
|
});
|
|
237
246
|
}
|
|
@@ -49,7 +49,7 @@ class File {
|
|
|
49
49
|
hash;
|
|
50
50
|
content;
|
|
51
51
|
ETag;
|
|
52
|
-
constructor({ contentType, expiredAt, metadata
|
|
52
|
+
constructor({ contentType, expiredAt, metadata, originalName, size }) {
|
|
53
53
|
this.metadata = metadata;
|
|
54
54
|
this.originalName = originalName || extractOriginalName(metadata) || (this.id = nanoid());
|
|
55
55
|
this.contentType = contentType || extractMimeType(metadata) || "application/octet-stream";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import 'node:crypto';
|
|
2
2
|
import 'gaxios';
|
|
3
3
|
import 'google-auth-library';
|
|
4
|
-
export { G as default } from './gcs-meta-storage-
|
|
4
|
+
export { G as default } from './gcs-meta-storage-MsUrkgP6.js';
|
|
5
5
|
import './MetaStorage-pECeFOad.js';
|
|
6
6
|
import './Metadata-DRLXeJ0F.js';
|
|
7
7
|
import './GCSConfig-vPP22kN6.js';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { randomUUID } from 'node:crypto';
|
|
2
2
|
import { request } from 'gaxios';
|
|
3
3
|
import { GoogleAuth } from 'google-auth-library';
|
|
4
|
-
import { r as retryOptions, G as GCSMetaStorage, g as getRangeEnd, p as package_, b as buildContentRange } from './gcs-meta-storage-
|
|
5
|
-
import { p as partMatch, d as detectFileTypeFromStream, g as getFileStatus } from './part-match-
|
|
4
|
+
import { r as retryOptions, G as GCSMetaStorage, g as getRangeEnd, p as package_, b as buildContentRange } from './gcs-meta-storage-MsUrkgP6.js';
|
|
5
|
+
import { p as partMatch, d as detectFileTypeFromStream, g as getFileStatus } from './part-match-Dt738Ddb.js';
|
|
6
6
|
import { throwErrorCode, ERRORS } from './ERRORS-D0apMqnc.js';
|
|
7
7
|
import { B as BaseStorage, t as toMilliseconds } from './storage-CpJpqLdn.js';
|
|
8
8
|
import { L as LocalMetaStorage } from './local-meta-storage-BlOk6m7F.js';
|
|
9
9
|
import GCSConfig from './GCSConfig-vPP22kN6.js';
|
|
10
|
-
import GCSFile from './GCSFile-
|
|
10
|
+
import GCSFile from './GCSFile-DaDiCKE2.js';
|
|
11
11
|
import { h as hasContent } from './has-content-CY66ehMK.js';
|
|
12
12
|
|
|
13
13
|
class FetchError extends Error {
|
|
@@ -350,7 +350,9 @@ class GCStorage extends BaseStorage {
|
|
|
350
350
|
const options = { method: "PUT" };
|
|
351
351
|
if (body?.on) {
|
|
352
352
|
const abortController = new AbortController();
|
|
353
|
-
body.on("aborted", () =>
|
|
353
|
+
body.on("aborted", () => {
|
|
354
|
+
abortController.abort();
|
|
355
|
+
});
|
|
354
356
|
options.body = body;
|
|
355
357
|
options.signal = abortController.signal;
|
|
356
358
|
}
|
|
@@ -209,9 +209,15 @@ class MediaTransformer {
|
|
|
209
209
|
image: this.imageTransformer?.getCacheStats(),
|
|
210
210
|
video: this.videoTransformer?.getCacheStats()
|
|
211
211
|
};
|
|
212
|
-
if (stats.image === void 0)
|
|
213
|
-
|
|
214
|
-
|
|
212
|
+
if (stats.image === void 0) {
|
|
213
|
+
delete stats.image;
|
|
214
|
+
}
|
|
215
|
+
if (stats.video === void 0) {
|
|
216
|
+
delete stats.video;
|
|
217
|
+
}
|
|
218
|
+
if (stats.audio === void 0) {
|
|
219
|
+
delete stats.audio;
|
|
220
|
+
}
|
|
215
221
|
return stats;
|
|
216
222
|
}
|
|
217
223
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Readable } from 'node:stream';
|
|
2
2
|
import { parseMultipartRequest, MaxFileSizeExceededError, MultipartParseError } from '@remix-run/multipart-parser/node';
|
|
3
3
|
import { c as createHttpError } from './headers-YLRp1dLo.js';
|
|
4
|
-
import { g as getIdFromRequest } from './base-handler-core-
|
|
4
|
+
import { g as getIdFromRequest } from './base-handler-core-lVB-D59L.js';
|
|
5
5
|
import { V as ValidationError } from './validator-DuO17wFF.js';
|
|
6
|
-
import { B as BaseHandlerNode } from './base-handler-node-
|
|
6
|
+
import { B as BaseHandlerNode } from './base-handler-node-BiO2DF87.js';
|
|
7
7
|
import { M as MultipartBase } from './multipart-base-C994naBi.js';
|
|
8
8
|
|
|
9
9
|
const RE_MIME = /^multipart\/.+|application\/x-www-form-urlencoded$/i;
|
|
@@ -2,7 +2,7 @@ import { Readable } from 'node:stream';
|
|
|
2
2
|
import { parseMultipartRequest, MaxFileSizeExceededError, MultipartParseError } from '@remix-run/multipart-parser';
|
|
3
3
|
import { c as createHttpError } from './headers-YLRp1dLo.js';
|
|
4
4
|
import { V as ValidationError } from './validator-DuO17wFF.js';
|
|
5
|
-
import { B as BaseHandlerFetch } from './base-handler-fetch-
|
|
5
|
+
import { B as BaseHandlerFetch } from './base-handler-fetch-CitgN-Aw.js';
|
|
6
6
|
import { M as MultipartBase } from './multipart-base-C994naBi.js';
|
|
7
7
|
|
|
8
8
|
const RE_MIME = /^multipart\/.+|application\/x-www-form-urlencoded$/i;
|
package/dist/packem_shared/{NetlifyBlobStorage-DEpx_4q-.js → NetlifyBlobStorage-pZX0_VdO.js}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { getStore } from '@netlify/blobs';
|
|
2
|
-
import { g as getFileStatus, p as partMatch, a as detectFileTypeFromBuffer } from './part-match-
|
|
2
|
+
import { g as getFileStatus, p as partMatch, a as detectFileTypeFromBuffer } from './part-match-Dt738Ddb.js';
|
|
3
3
|
import { B as BaseStorage, t as toMilliseconds, u as updateMetadata } from './storage-CpJpqLdn.js';
|
|
4
4
|
import { createRetryWrapper } from './isRetryableError-Dycp7127.js';
|
|
5
5
|
import { L as LocalMetaStorage } from './local-meta-storage-BlOk6m7F.js';
|
|
6
|
-
import NetlifyBlobFile from './NetlifyBlobFile-
|
|
6
|
+
import NetlifyBlobFile from './NetlifyBlobFile-CfyJtGWN.js';
|
|
7
7
|
import { u as updateSize } from './update-size-CCGm6i1J.js';
|
|
8
8
|
import { h as hasContent } from './has-content-CY66ehMK.js';
|
|
9
9
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { c as createHttpError } from './headers-YLRp1dLo.js';
|
|
2
2
|
import { ERRORS } from './ERRORS-D0apMqnc.js';
|
|
3
|
-
import { b as getRequestStream } from './base-handler-core-
|
|
4
|
-
import { B as BaseHandlerFetch } from './base-handler-fetch-
|
|
5
|
-
import { R as RestBase, c as parseContentDispositionValue } from './rest-base-
|
|
3
|
+
import { b as getRequestStream } from './base-handler-core-lVB-D59L.js';
|
|
4
|
+
import { B as BaseHandlerFetch } from './base-handler-fetch-CitgN-Aw.js';
|
|
5
|
+
import { R as RestBase, c as parseContentDispositionValue } from './rest-base-k1ory8uB.js';
|
|
6
6
|
|
|
7
7
|
class RestFetch extends BaseHandlerFetch {
|
|
8
8
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { c as createHttpError } from './headers-YLRp1dLo.js';
|
|
2
2
|
import { hasBody } from 'type-is';
|
|
3
|
-
import { a as getHeader, b as getRequestStream, g as getIdFromRequest, r as readBody } from './base-handler-core-
|
|
4
|
-
import { B as BaseHandlerNode } from './base-handler-node-
|
|
5
|
-
import { R as RestBase, v as validateRequestBody, a as validateContentLength, e as extractFileInit, p as parseContentDisposition, b as parseChunkHeaders } from './rest-base-
|
|
3
|
+
import { a as getHeader, b as getRequestStream, g as getIdFromRequest, r as readBody } from './base-handler-core-lVB-D59L.js';
|
|
4
|
+
import { B as BaseHandlerNode } from './base-handler-node-BiO2DF87.js';
|
|
5
|
+
import { R as RestBase, v as validateRequestBody, a as validateContentLength, e as extractFileInit, p as parseContentDisposition, b as parseChunkHeaders } from './rest-base-k1ory8uB.js';
|
|
6
6
|
|
|
7
7
|
class Rest extends BaseHandlerNode {
|
|
8
8
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Readable } from 'node:stream';
|
|
2
2
|
import { CreateMultipartUploadCommand, UploadPartCommand, CompleteMultipartUploadCommand, AbortMultipartUploadCommand, ListPartsCommand, GetObjectCommand, HeadObjectCommand, DeleteObjectCommand, CopyObjectCommand, ListObjectsV2Command, waitUntilBucketExists, S3Client } from '@aws-sdk/client-s3';
|
|
3
3
|
import { fromIni } from '@aws-sdk/credential-providers';
|
|
4
|
-
import { S as S3BaseStorage } from './s3-base-storage-
|
|
4
|
+
import { S as S3BaseStorage } from './s3-base-storage-DSMObtht.js';
|
|
5
5
|
import { ReadableStream } from 'node:stream/web';
|
|
6
6
|
import { getSignedUrl } from '@aws-sdk/s3-request-presigner';
|
|
7
|
-
import S3File from './S3File-
|
|
7
|
+
import S3File from './S3File-BXCuJaQZ.js';
|
|
8
8
|
import S3MetaStorage from './S3MetaStorage-yT4CznlV.js';
|
|
9
9
|
|
|
10
10
|
class S3ClientAdapter {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { format } from 'node:url';
|
|
2
2
|
import { c as createHttpError } from './headers-YLRp1dLo.js';
|
|
3
|
-
import { a as getHeader, b as getRequestStream, g as getIdFromRequest, c as getBaseUrl } from './base-handler-core-
|
|
4
|
-
import { B as BaseHandlerNode } from './base-handler-node-
|
|
3
|
+
import { a as getHeader, b as getRequestStream, g as getIdFromRequest, c as getBaseUrl } from './base-handler-core-lVB-D59L.js';
|
|
4
|
+
import { B as BaseHandlerNode } from './base-handler-node-BiO2DF87.js';
|
|
5
5
|
import { TusBase } from './TUS_RESUMABLE-Dtfsffnj.js';
|
|
6
6
|
export { TUS_RESUMABLE, TUS_VERSION } from './TUS_RESUMABLE-Dtfsffnj.js';
|
|
7
7
|
|
|
@@ -188,7 +188,7 @@ class Tus extends BaseHandlerNode {
|
|
|
188
188
|
const { pathname } = url;
|
|
189
189
|
const query = Object.fromEntries(url.searchParams.entries());
|
|
190
190
|
const relative = format({ pathname: `${pathname}/${file.id}`, query });
|
|
191
|
-
return
|
|
191
|
+
return this.storage.config.useRelativeLocation ? relative : getBaseUrl({ }) + relative;
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as createHttpError } from './headers-YLRp1dLo.js';
|
|
2
|
-
import { B as BaseHandlerFetch } from './base-handler-fetch-
|
|
2
|
+
import { B as BaseHandlerFetch } from './base-handler-fetch-CitgN-Aw.js';
|
|
3
3
|
import { TusBase } from './TUS_RESUMABLE-Dtfsffnj.js';
|
|
4
4
|
export { TUS_RESUMABLE, TUS_VERSION } from './TUS_RESUMABLE-Dtfsffnj.js';
|
|
5
5
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { put, del, copy, list } from '@vercel/blob';
|
|
2
|
-
import { g as getFileStatus, p as partMatch, a as detectFileTypeFromBuffer } from './part-match-
|
|
2
|
+
import { g as getFileStatus, p as partMatch, a as detectFileTypeFromBuffer } from './part-match-Dt738Ddb.js';
|
|
3
3
|
import { B as BaseStorage, t as toMilliseconds } from './storage-CpJpqLdn.js';
|
|
4
4
|
import { L as LocalMetaStorage } from './local-meta-storage-BlOk6m7F.js';
|
|
5
|
-
import VercelBlobFile from './VercelBlobFile-
|
|
5
|
+
import VercelBlobFile from './VercelBlobFile-DkFIIb9Q.js';
|
|
6
6
|
import { u as updateSize } from './update-size-CCGm6i1J.js';
|
|
7
7
|
import { h as hasContent } from './has-content-CY66ehMK.js';
|
|
8
8
|
|
package/dist/packem_shared/{aws-light-meta-storage-Ba2b_h-o.js → aws-light-meta-storage-BGZEiY3y.js}
RENAMED
|
@@ -11,7 +11,7 @@ const parseXml = (text) => {
|
|
|
11
11
|
const matches = [...cleanText.matchAll(tagRegex)];
|
|
12
12
|
for (const match of matches) {
|
|
13
13
|
const [, tagName, content] = match;
|
|
14
|
-
if (tagName && content
|
|
14
|
+
if (tagName && content?.trim()) {
|
|
15
15
|
if (result[tagName]) {
|
|
16
16
|
if (!Array.isArray(result[tagName])) {
|
|
17
17
|
result[tagName] = [result[tagName]];
|
|
@@ -26,7 +26,7 @@ const parseXml = (text) => {
|
|
|
26
26
|
let nestedMatch;
|
|
27
27
|
while ((nestedMatch = nestedRegex.exec(cleanText)) !== null) {
|
|
28
28
|
const [, tagName, innerContent] = nestedMatch;
|
|
29
|
-
if (tagName && innerContent
|
|
29
|
+
if (tagName && innerContent?.includes("<")) {
|
|
30
30
|
const nested = parseXml(innerContent);
|
|
31
31
|
if (Object.keys(nested).length > 0) {
|
|
32
32
|
result[tagName] = nested;
|
|
@@ -31,11 +31,14 @@ const readBody = (request, encoding = "utf8", limit) => new Promise((resolve, re
|
|
|
31
31
|
request.setEncoding(encoding);
|
|
32
32
|
request.on("data", (chunk) => {
|
|
33
33
|
if (body.length + chunk.length > limit) {
|
|
34
|
-
|
|
34
|
+
reject(new Error("Request body length limit exceeded"));
|
|
35
|
+
return;
|
|
35
36
|
}
|
|
36
37
|
body += chunk;
|
|
37
38
|
});
|
|
38
|
-
request.once("end", () =>
|
|
39
|
+
request.once("end", () => {
|
|
40
|
+
resolve(body);
|
|
41
|
+
});
|
|
39
42
|
});
|
|
40
43
|
const getHeader = (request, name, all = false) => {
|
|
41
44
|
const raw = request.headers?.[name.toLowerCase()];
|
|
@@ -223,7 +226,7 @@ class BaseHandlerCore extends EventEmitter {
|
|
|
223
226
|
*/
|
|
224
227
|
// eslint-disable-next-line class-methods-use-this
|
|
225
228
|
parseRangeHeader(rangeHeader, fileSize) {
|
|
226
|
-
if (!rangeHeader
|
|
229
|
+
if (!rangeHeader?.startsWith("bytes=")) {
|
|
227
230
|
return void 0;
|
|
228
231
|
}
|
|
229
232
|
const ranges = rangeHeader.slice(6).split(",");
|
package/dist/packem_shared/{base-handler-fetch-CinvR65S.js → base-handler-fetch-CitgN-Aw.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { H as HeaderUtilities, h as httpErrorsExports } from './headers-YLRp1dLo.js';
|
|
2
2
|
import { ERRORS, isUploadError } from './ERRORS-D0apMqnc.js';
|
|
3
|
-
import { B as BaseHandlerCore, p as pick } from './base-handler-core-
|
|
3
|
+
import { B as BaseHandlerCore, p as pick } from './base-handler-core-lVB-D59L.js';
|
|
4
4
|
import { i as isValidationError } from './validator-DuO17wFF.js';
|
|
5
5
|
import { waitForStorage } from './waitForStorage-Cscw85sx.js';
|
|
6
6
|
|
|
@@ -3,7 +3,7 @@ import { H as HeaderUtilities, h as httpErrorsExports, c as createHttpError } fr
|
|
|
3
3
|
import mime from 'mime';
|
|
4
4
|
import { ERRORS, isUploadError } from './ERRORS-D0apMqnc.js';
|
|
5
5
|
import { match } from 'path-to-regexp';
|
|
6
|
-
import { p as pick, B as BaseHandlerCore, s as setHeaders, d as getRealPath, u as uuidRegex } from './base-handler-core-
|
|
6
|
+
import { p as pick, B as BaseHandlerCore, s as setHeaders, d as getRealPath, u as uuidRegex } from './base-handler-core-lVB-D59L.js';
|
|
7
7
|
import { i as isValidationError } from './validator-DuO17wFF.js';
|
|
8
8
|
import { waitForStorage } from './waitForStorage-Cscw85sx.js';
|
|
9
9
|
import { PassThrough } from 'node:stream';
|
|
@@ -523,7 +523,7 @@ class BaseHandlerNode extends BaseHandlerCore {
|
|
|
523
523
|
// eslint-disable-next-line sonarjs/cognitive-complexity
|
|
524
524
|
async get(request, _response) {
|
|
525
525
|
const pathMatch = filePathUrlMatcher(getRealPath(request));
|
|
526
|
-
if (pathMatch
|
|
526
|
+
if (pathMatch?.params.uuid) {
|
|
527
527
|
const { ext, metadata, uuid: rawUuid } = pathMatch.params;
|
|
528
528
|
const uuid = ext ? rawUuid.replace(new RegExp(String.raw`\.${ext}$`), "") : rawUuid;
|
|
529
529
|
if (metadata === "metadata" && getRealPath(request).endsWith("/metadata")) {
|
|
@@ -676,7 +676,7 @@ class BaseHandlerNode extends BaseHandlerCore {
|
|
|
676
676
|
*/
|
|
677
677
|
async download(request, response) {
|
|
678
678
|
const pathMatch = filePathUrlMatcher(getRealPath(request));
|
|
679
|
-
if (!pathMatch
|
|
679
|
+
if (!pathMatch?.params.uuid || !uuidRegex.test(pathMatch.params.uuid)) {
|
|
680
680
|
throw createHttpError(404, "File not found");
|
|
681
681
|
}
|
|
682
682
|
const { ext, uuid } = pathMatch.params;
|