@dimah-s3/server 1.5.6 → 1.5.8
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/LICENSE +1 -1
- package/dist/adapters/types.d.ts +1 -1
- package/dist/api/bind-endpoints.d.ts +1 -1
- package/dist/api/bind-endpoints.d.ts.map +1 -1
- package/dist/api/context.d.ts +1 -1
- package/dist/api/index.js +5 -5
- 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/api/routes/file.d.ts.map +1 -1
- package/dist/dimah-s3.d.ts +2 -2
- package/dist/dimah-s3.d.ts.map +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/resolve-route.d.ts +2 -2
- package/dist/helpers/resolve-target.d.ts +1 -1
- package/dist/helpers/resolve-target.d.ts.map +1 -1
- package/dist/index.js +6 -6
- 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 +6 -6
- 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 +20 -20
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DimahS3Config } from "../types";
|
|
1
|
+
import type { DimahS3Config } from "../types/index.d.ts";
|
|
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.d.ts";
|
|
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
|
@@ -263,7 +263,7 @@ function assertStoredKey(key, keyPrefix) {
|
|
|
263
263
|
}
|
|
264
264
|
function objectKeyFileName(fileName) {
|
|
265
265
|
const sanitized = sanitizeFileName(fileName);
|
|
266
|
-
const leaf = sanitized.split("/").
|
|
266
|
+
const leaf = sanitized.split("/").findLast((part) => part.length > 0);
|
|
267
267
|
if (!leaf || leaf === "." || leaf === "..") return "file";
|
|
268
268
|
return leaf;
|
|
269
269
|
}
|
|
@@ -352,7 +352,7 @@ function skippedPluginIds(plugins) {
|
|
|
352
352
|
const ids = /* @__PURE__ */ new Set();
|
|
353
353
|
if (!plugins) return ids;
|
|
354
354
|
for (const [id, enabled] of Object.entries(plugins)) {
|
|
355
|
-
if (enabled
|
|
355
|
+
if (!enabled) ids.add(id);
|
|
356
356
|
}
|
|
357
357
|
return ids;
|
|
358
358
|
}
|
|
@@ -595,7 +595,7 @@ async function finalizeConfirmedObject(client, bucket, key, input) {
|
|
|
595
595
|
...stored,
|
|
596
596
|
contentType: head.ContentType,
|
|
597
597
|
contentLength,
|
|
598
|
-
eTag: head.ETag?.
|
|
598
|
+
eTag: head.ETag?.replaceAll('"', ""),
|
|
599
599
|
metadata,
|
|
600
600
|
acl,
|
|
601
601
|
fileName,
|
|
@@ -906,7 +906,7 @@ async function handleFile(config, input, request) {
|
|
|
906
906
|
new GetObjectCommand({
|
|
907
907
|
Bucket: bucket,
|
|
908
908
|
Key: key,
|
|
909
|
-
ResponseContentDisposition: fileName ? buildContentDisposition(fileName, disposition) :
|
|
909
|
+
ResponseContentDisposition: fileName ? buildContentDisposition(fileName, disposition) : disposition
|
|
910
910
|
})
|
|
911
911
|
)
|
|
912
912
|
);
|
|
@@ -917,7 +917,7 @@ async function handleFile(config, input, request) {
|
|
|
917
917
|
headers.set("Content-Type", result.ContentType ?? "application/octet-stream");
|
|
918
918
|
headers.set(
|
|
919
919
|
"Content-Disposition",
|
|
920
|
-
fileName ? buildContentDisposition(fileName, disposition) :
|
|
920
|
+
fileName ? buildContentDisposition(fileName, disposition) : disposition
|
|
921
921
|
);
|
|
922
922
|
if (typeof result.ContentLength === "number") {
|
|
923
923
|
headers.set("Content-Length", String(result.ContentLength));
|
|
@@ -1170,7 +1170,7 @@ async function handleListParts(config, input, request) {
|
|
|
1170
1170
|
{
|
|
1171
1171
|
partNumber: p.PartNumber,
|
|
1172
1172
|
size: p.Size ?? 0,
|
|
1173
|
-
eTag: (p.ETag ?? "").
|
|
1173
|
+
eTag: (p.ETag ?? "").replaceAll('"', "")
|
|
1174
1174
|
}
|
|
1175
1175
|
];
|
|
1176
1176
|
});
|