@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 Hamidreza
3
+ Copyright (c) 2026 dimah
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,4 +1,4 @@
1
- import type { DimahS3 } from "../dimah-s3";
1
+ import type { DimahS3 } from "../dimah-s3.d.ts";
2
2
  /** Minimal surface adapters need from a dimah-s3 instance. */
3
3
  export type DimahS3HandlerSource = Pick<DimahS3, "handler">;
4
4
  //# sourceMappingURL=types.d.ts.map
@@ -1,4 +1,4 @@
1
- import { type Endpoint } from "better-call";
1
+ import type { Endpoint } from "better-call";
2
2
  import type { S3EndpointContext } from "./context";
3
3
  /**
4
4
  * Wrap better-call endpoints so `s3.api.upload({ body, headers })` injects
@@ -1 +1 @@
1
- {"version":3,"file":"bind-endpoints.d.ts","sourceRoot":"","sources":["../../src/api/bind-endpoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAGnD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,EAC9D,SAAS,EAAE,CAAC,EACZ,OAAO,EAAE,IAAI,CAAC,iBAAiB,EAAE,QAAQ,CAAC,GACzC,CAAC,CAsBH"}
1
+ {"version":3,"file":"bind-endpoints.d.ts","sourceRoot":"","sources":["../../src/api/bind-endpoints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAGnD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,EAC9D,SAAS,EAAE,CAAC,EACZ,OAAO,EAAE,IAAI,CAAC,iBAAiB,EAAE,QAAQ,CAAC,GACzC,CAAC,CAsBH"}
@@ -1,4 +1,4 @@
1
- import type { ResolvedDimahS3Config } from "../types";
1
+ import type { ResolvedDimahS3Config } from "../types/index.d.ts";
2
2
  /**
3
3
  * Injected on every {@link createS3Endpoint} via better-call `routerContext`
4
4
  * (HTTP) and {@link bindEndpoints} (direct `s3.api` calls).
package/dist/api/index.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("/").filter((part) => part.length > 0).at(-1);
266
+ const leaf = sanitized.split("/").findLast((part) => part.length > 0);
267
267
  if (!leaf || leaf === "." || leaf === "..") return "file";
268
268
  return leaf;
269
269
  }
@@ -467,7 +467,7 @@ async function finalizeConfirmedObject(client, bucket, key, input) {
467
467
  ...stored,
468
468
  contentType: head.ContentType,
469
469
  contentLength,
470
- eTag: head.ETag?.replace(/"/g, ""),
470
+ eTag: head.ETag?.replaceAll('"', ""),
471
471
  metadata,
472
472
  acl,
473
473
  fileName,
@@ -778,7 +778,7 @@ async function handleFile(config, input, request) {
778
778
  new GetObjectCommand({
779
779
  Bucket: bucket,
780
780
  Key: key,
781
- ResponseContentDisposition: fileName ? buildContentDisposition(fileName, disposition) : `${disposition}`
781
+ ResponseContentDisposition: fileName ? buildContentDisposition(fileName, disposition) : disposition
782
782
  })
783
783
  )
784
784
  );
@@ -789,7 +789,7 @@ async function handleFile(config, input, request) {
789
789
  headers.set("Content-Type", result.ContentType ?? "application/octet-stream");
790
790
  headers.set(
791
791
  "Content-Disposition",
792
- fileName ? buildContentDisposition(fileName, disposition) : `${disposition}`
792
+ fileName ? buildContentDisposition(fileName, disposition) : disposition
793
793
  );
794
794
  if (typeof result.ContentLength === "number") {
795
795
  headers.set("Content-Length", String(result.ContentLength));
@@ -1042,7 +1042,7 @@ async function handleListParts(config, input, request) {
1042
1042
  {
1043
1043
  partNumber: p.PartNumber,
1044
1044
  size: p.Size ?? 0,
1045
- eTag: (p.ETag ?? "").replace(/"/g, "")
1045
+ eTag: (p.ETag ?? "").replaceAll('"', "")
1046
1046
  }
1047
1047
  ];
1048
1048
  });