@dimah-s3/server 1.5.9 → 1.5.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/types.d.ts +1 -1
- package/dist/api/bind-endpoints.d.ts +4 -0
- package/dist/api/bind-endpoints.d.ts.map +1 -1
- package/dist/api/context.d.ts +1 -1
- package/dist/api/create-s3-endpoint.d.ts +3 -2
- package/dist/api/create-s3-endpoint.d.ts.map +1 -1
- package/dist/api/index.js +5 -1
- package/dist/api/index.js.map +1 -1
- package/dist/api/router.d.ts +1 -1
- package/dist/api/routes/catalog.d.ts +1 -1
- package/dist/errors.d.ts +1 -1
- package/dist/helpers/constraints.d.ts +1 -1
- package/dist/helpers/features.d.ts +1 -1
- package/dist/helpers/finalize-confirmed.d.ts +1 -1
- package/dist/helpers/hooks.d.ts +1 -1
- package/dist/helpers/logger.d.ts +1 -1
- package/dist/helpers/object-s3.d.ts +1 -1
- package/dist/helpers/request.d.ts +14 -1
- package/dist/helpers/request.d.ts.map +1 -1
- package/dist/helpers/resolve-route.d.ts +2 -2
- package/dist/helpers/resolve-target.d.ts +1 -1
- package/dist/index.js +57 -5
- package/dist/index.js.map +1 -1
- package/dist/plugin/apply-plugins.d.ts +1 -1
- package/dist/plugin/types.d.ts +1 -1
- package/dist/plugins.js +5 -1
- package/dist/plugins.js.map +1 -1
- package/dist/put.d.ts +1 -1
- package/dist/route.d.ts +1 -1
- package/dist/types/config.d.ts +1 -1
- package/package.json +10 -10
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DimahS3Config } from "../types/index.
|
|
1
|
+
import type { DimahS3Config } from "../types/index.js";
|
|
2
2
|
import { type AppliedPlugins, type DimahS3Plugin, type PluginContextMap } from "./types";
|
|
3
3
|
/**
|
|
4
4
|
* Validate plugins, build context map, collect endpoints, validate routes,
|
package/dist/plugin/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Endpoint } from "better-call";
|
|
2
|
-
import type { DeleteConfig, DownloadConfig, MultipartConfig, UploadConfig, DimahS3Config, ResolvedDimahS3Config } from "../types/config.
|
|
2
|
+
import type { DeleteConfig, DownloadConfig, MultipartConfig, UploadConfig, DimahS3Config, ResolvedDimahS3Config } from "../types/config.js";
|
|
3
3
|
import type { FeatureHookKeyMap, MultipartHookKey } from "./hook-registry";
|
|
4
4
|
type HookFields<T, K extends keyof T> = Pick<T, K>;
|
|
5
5
|
/**
|
package/dist/plugins.js
CHANGED
|
@@ -443,8 +443,9 @@ function assertDistinctKeyPrefixes(routes) {
|
|
|
443
443
|
}
|
|
444
444
|
|
|
445
445
|
// src/helpers/request.ts
|
|
446
|
+
var SYNTHETIC_ORIGIN = "http://dimah-s3.local";
|
|
446
447
|
function requestFromHeaders(headers) {
|
|
447
|
-
return new Request(
|
|
448
|
+
return new Request(SYNTHETIC_ORIGIN, { headers });
|
|
448
449
|
}
|
|
449
450
|
function assertWithinMaxFileSize(maxFileSize, size) {
|
|
450
451
|
if (typeof maxFileSize === "number" && size > maxFileSize) {
|
|
@@ -662,6 +663,9 @@ function withS3Validation(options) {
|
|
|
662
663
|
...options,
|
|
663
664
|
...options.body !== void 0 ? { body: compileIfZod(options.body) } : {},
|
|
664
665
|
...options.query !== void 0 ? { query: compileIfZod(options.query) } : {},
|
|
666
|
+
// better-call reads the body before hooks. Clone first so
|
|
667
|
+
// `request.clone().json()` in guard / resolveScope still works.
|
|
668
|
+
...options.body !== void 0 && options.cloneRequest === void 0 ? { cloneRequest: true } : {},
|
|
665
669
|
onValidationError: options.onValidationError ?? (({ message }) => {
|
|
666
670
|
throw errors.validationError(message);
|
|
667
671
|
})
|