lean-s3 0.9.2 → 0.9.4
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/index.mjs +9 -2
- package/package.json +10 -10
package/dist/index.mjs
CHANGED
|
@@ -320,7 +320,7 @@ const kSignedRequest = Symbol("kSignedRequest");
|
|
|
320
320
|
const kGetEffectiveParams = Symbol("kGetEffectiveParams");
|
|
321
321
|
const xmlParser = new XMLParser({
|
|
322
322
|
ignoreAttributes: true,
|
|
323
|
-
isArray: (_, jPath) => jPath === "ListMultipartUploadsResult.Upload" || jPath === "ListBucketResult.Contents" || jPath === "ListPartsResult.Part" || jPath === "DeleteResult.Deleted" || jPath === "DeleteResult.Error"
|
|
323
|
+
isArray: (_, jPath) => jPath === "ListMultipartUploadsResult.Upload" || jPath === "ListBucketResult.Contents" || jPath === "ListPartsResult.Part" || jPath === "DeleteResult.Deleted" || jPath === "DeleteResult.Error" || jPath === "CORSConfiguration.CORSRule" || jPath === "CORSConfiguration.CORSRule.AllowedMethod" || jPath === "CORSConfiguration.CORSRule.AllowedOrigin" || jPath === "CORSConfiguration.CORSRule.AllowedHeader" || jPath === "CORSConfiguration.CORSRule.ExposeHeader"
|
|
324
324
|
});
|
|
325
325
|
const xmlBuilder = new XMLBuilder({
|
|
326
326
|
attributeNamePrefix: "$",
|
|
@@ -802,7 +802,14 @@ var S3Client = class {
|
|
|
802
802
|
response.body.dump();
|
|
803
803
|
throw fromStatusCode(response.statusCode, "");
|
|
804
804
|
}
|
|
805
|
-
|
|
805
|
+
return { rules: ((ensureParsedXml(await response.body.text()).CORSConfiguration ?? {}).CORSRule ?? []).filter(Boolean).map((r) => ({
|
|
806
|
+
allowedMethods: r.AllowedMethod ?? [],
|
|
807
|
+
allowedOrigins: r.AllowedOrigin ?? [],
|
|
808
|
+
allowedHeaders: r.AllowedHeader ? r.AllowedHeader : void 0,
|
|
809
|
+
exposeHeaders: r.ExposeHeader ? r.ExposeHeader : void 0,
|
|
810
|
+
id: r.ID ?? void 0,
|
|
811
|
+
maxAgeSeconds: typeof r.MaxAgeSeconds !== "undefined" && r.MaxAgeSeconds !== null ? Number(r.MaxAgeSeconds) : void 0
|
|
812
|
+
})) };
|
|
806
813
|
}
|
|
807
814
|
/**
|
|
808
815
|
* @remarks Uses [`DeleteBucketCors`](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketCors.html).
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "lean-s3",
|
|
3
3
|
"author": "Niklas Mollenhauer",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "0.9.
|
|
5
|
+
"version": "0.9.4",
|
|
6
6
|
"description": "A server-side S3 API for the regular user.",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"s3",
|
|
@@ -47,18 +47,18 @@
|
|
|
47
47
|
"undici": "^7.16.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@biomejs/biome": "2.3.
|
|
51
|
-
"@testcontainers/localstack": "^11.
|
|
52
|
-
"@testcontainers/minio": "^11.
|
|
53
|
-
"@testcontainers/s3mock": "^11.
|
|
50
|
+
"@biomejs/biome": "2.3.8",
|
|
51
|
+
"@testcontainers/localstack": "^11.9.0",
|
|
52
|
+
"@testcontainers/minio": "^11.9.0",
|
|
53
|
+
"@testcontainers/s3mock": "^11.9.0",
|
|
54
54
|
"@types/node": "^24.10.1",
|
|
55
|
-
"@typescript/native-preview": "^7.0.0-dev.
|
|
55
|
+
"@typescript/native-preview": "^7.0.0-dev.20251201.1",
|
|
56
56
|
"expect": "^30.2.0",
|
|
57
57
|
"lefthook": "^2.0.4",
|
|
58
|
-
"testcontainers": "^11.
|
|
59
|
-
"tsdown": "^0.16.
|
|
60
|
-
"tsx": "^4.
|
|
61
|
-
"typedoc": "^0.28.
|
|
58
|
+
"testcontainers": "^11.9.0",
|
|
59
|
+
"tsdown": "^0.16.8",
|
|
60
|
+
"tsx": "^4.21.0",
|
|
61
|
+
"typedoc": "^0.28.15"
|
|
62
62
|
},
|
|
63
63
|
"engines": {
|
|
64
64
|
"node": "^20.19.5 || ^22.21.1 || ^24.11.0 || ^25.1.0"
|