@michaelthielemann/kestrel-blobstore-s3 5.6.0 → 5.8.0
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/README.md +7 -1
- package/dist/impl.js +0 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -8,8 +8,14 @@ the SDK's retry limit including the first try). `put` stores the `contentType` h
|
|
|
8
8
|
`Content-Type`, so a bucket served directly answers with the right type; `get` returns bytes only
|
|
9
9
|
and `list` reports key and size. The store never wrote sidecar files.
|
|
10
10
|
|
|
11
|
+
`move` copies through `CopyObject`, whose `CopySource` is a path: the segments are percent-encoded,
|
|
12
|
+
the slashes separating them are not.
|
|
13
|
+
|
|
11
14
|
`pnpm test:s3` runs the `blobstore@1` contract test against a real MinIO instance in Podman
|
|
12
|
-
(starts it, creates the bucket, runs `minio.test.ts`, always stops the container).
|
|
15
|
+
(starts it, creates the bucket, runs `minio.test.ts`, always stops the container). Only a real
|
|
16
|
+
S3-compatible target exercises the `CopySource` encoding and the `NoSuchKey`/404 detection on
|
|
17
|
+
`CopyObject`, which a fake says nothing about. `@aws-sdk/client-s3` is a dependency of this package
|
|
18
|
+
alone and not of the workspace root, so the script resolves it from here.
|
|
13
19
|
|
|
14
20
|
## Errors
|
|
15
21
|
|
package/dist/impl.js
CHANGED
|
@@ -26,7 +26,6 @@ export function createClient(config) {
|
|
|
26
26
|
}
|
|
27
27
|
const TRANSIENT_NAMES = new Set(["TimeoutError", "NetworkingError", "AbortError"]);
|
|
28
28
|
const TRANSIENT_CODES = new Set(["ECONNRESET", "ECONNREFUSED", "ETIMEDOUT", "EPIPE", "EAI_AGAIN"]);
|
|
29
|
-
/** After the SDK's own `maxAttempts` are spent, this is the only line separating "retry the caller" from "the operation is broken". */
|
|
30
29
|
function isTransient(cause) {
|
|
31
30
|
const e = boundaryCast(cause, "host");
|
|
32
31
|
const status = e.$metadata?.httpStatusCode;
|
|
@@ -90,7 +89,6 @@ export function createBlobstoreS3(config, client = createClient(config)) {
|
|
|
90
89
|
},
|
|
91
90
|
async move(from, to) {
|
|
92
91
|
const source = fullKey(from);
|
|
93
|
-
// CopySource is a path: the segments are percent-encoded, the slashes separating them are not
|
|
94
92
|
const copySource = `${config.bucket}/${source.split("/").map(encodeURIComponent).join("/")}`;
|
|
95
93
|
try {
|
|
96
94
|
await client.send(new CopyObjectCommand({ Bucket: config.bucket, Key: fullKey(to), CopySource: copySource, MetadataDirective: "COPY" }));
|