@easy-cms/storage-s3 0.48.0 → 0.60.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 CHANGED
@@ -22,7 +22,7 @@ export default defineConfig({
22
22
  ```
23
23
 
24
24
  Credentials default to `AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY`. Files are served through the
25
- CMS API (private bucket) unless you set `publicUrl`.
25
+ CMS API (private bucket) unless you set `publicURL`.
26
26
 
27
27
  ## Links
28
28
 
package/dist/index.d.ts CHANGED
@@ -25,7 +25,7 @@ interface S3StorageOptions {
25
25
  * When set, media URLs point there. When not set, files are served through the REST API
26
26
  * (`<api>/media/file/<key>`), which works with private buckets.
27
27
  */
28
- readonly publicUrl?: string;
28
+ readonly publicURL?: string;
29
29
  /**
30
30
  * Address the bucket as `<endpoint>/<bucket>/<key>` instead of `<bucket>.<endpoint>/<key>`.
31
31
  * Default: `true` when `endpoint` is set (MinIO needs it, R2 accepts it), otherwise `false`.
package/dist/index.js CHANGED
@@ -1,6 +1,8 @@
1
1
  // src/index.ts
2
+ import { checkRenamedOptions } from "@easy-cms/core/internal";
2
3
  import { AwsClient } from "aws4fetch";
3
4
  function s3Storage(options) {
5
+ checkRenamedOptions("s3Storage", options, { publicUrl: "publicURL" });
4
6
  const prefix = normalizePrefix(options.prefix);
5
7
  let client;
6
8
  let objectURL = () => {
@@ -13,6 +15,7 @@ function s3Storage(options) {
13
15
  };
14
16
  return {
15
17
  name: "s3",
18
+ apiVersion: 1,
16
19
  init() {
17
20
  const env = process.env;
18
21
  const accessKeyId = options.accessKeyId ?? env.AWS_ACCESS_KEY_ID;
@@ -84,8 +87,8 @@ function s3Storage(options) {
84
87
  if (!response.ok && response.status !== 404) throw await s3Error("DELETE", key, response);
85
88
  },
86
89
  url(key) {
87
- if (!options.publicUrl) return void 0;
88
- return `${options.publicUrl.replace(/\/+$/, "")}/${encodeKey(prefix + key)}`;
90
+ if (!options.publicURL) return void 0;
91
+ return `${options.publicURL.replace(/\/+$/, "")}/${encodeKey(prefix + key)}`;
89
92
  }
90
93
  };
91
94
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easy-cms/storage-s3",
3
- "version": "0.48.0",
3
+ "version": "0.60.0",
4
4
  "description": "S3-compatible upload storage for Easy CMS: AWS S3, Cloudflare R2, MinIO",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -19,12 +19,12 @@
19
19
  "aws4fetch": "^1.0.20"
20
20
  },
21
21
  "peerDependencies": {
22
- "@easy-cms/core": "^0.48.0"
22
+ "@easy-cms/core": "^0.60.0"
23
23
  },
24
24
  "devDependencies": {
25
25
  "sharp": "^0.35.5",
26
- "@easy-cms/core": "^0.48.0",
27
- "@easy-cms/db-sqlite": "^0.48.0"
26
+ "@easy-cms/core": "^0.60.0",
27
+ "@easy-cms/db-sqlite": "^0.60.0"
28
28
  },
29
29
  "engines": {
30
30
  "node": ">=22.12"