@sveltia/cms 0.144.5 → 0.145.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/types/public.d.ts CHANGED
@@ -14,7 +14,7 @@ export type FieldKeyPath = string;
14
14
  /**
15
15
  * Cloud media storage name.
16
16
  */
17
- export type CloudMediaLibraryName = "cloudinary" | "uploadcare";
17
+ export type CloudMediaLibraryName = "cloudinary" | "uploadcare" | "aws_s3" | "cloudflare_r2" | "digitalocean_spaces";
18
18
  /**
19
19
  * Supported media storage name.
20
20
  */
@@ -205,6 +205,53 @@ export type UploadcareMediaLibrary = {
205
205
  */
206
206
  settings?: UploadcareMediaLibrarySettings;
207
207
  };
208
+ /**
209
+ * Options for S3-compatible media libraries (Amazon S3, Cloudflare R2, DigitalOcean Spaces).
210
+ */
211
+ export type S3MediaLibrary = {
212
+ /**
213
+ * Media library name (used when configuring via legacy `media_library`).
214
+ */
215
+ name?: string;
216
+ /**
217
+ * AWS access key ID or equivalent (safe to store in config).
218
+ */
219
+ access_key_id: string;
220
+ /**
221
+ * Bucket name.
222
+ */
223
+ bucket: string;
224
+ /**
225
+ * AWS region (e.g., 'us-east-1'). Required for Amazon S3 and
226
+ * DigitalOcean Spaces.
227
+ */
228
+ region?: string;
229
+ /**
230
+ * Cloudflare account ID. Required for Cloudflare R2.
231
+ */
232
+ account_id?: string;
233
+ /**
234
+ * Custom endpoint URL for S3-compatible services.
235
+ */
236
+ endpoint?: string;
237
+ /**
238
+ * Path prefix within bucket.
239
+ */
240
+ prefix?: string;
241
+ /**
242
+ * Use path-style URLs instead of virtual-hosted-style.
243
+ */
244
+ force_path_style?: boolean;
245
+ /**
246
+ * Base URL for public asset access. When set, asset preview and
247
+ * download URLs are constructed as `{public_url}/{key}` instead of the S3 API endpoint URL.
248
+ * Required for Cloudflare R2 (S3 API endpoint always requires authentication); set to the `r2.dev`
249
+ * development URL (e.g. `https://pub-abcd1234.r2.dev`) or a custom domain. Optional for Amazon S3
250
+ * and DigitalOcean Spaces — use when serving assets through a CDN or custom domain (e.g. CloudFront
251
+ * or Route 53 for S3, CDN endpoint for Spaces).
252
+ */
253
+ public_url?: string;
254
+ };
208
255
  /**
209
256
  * Name of supported stock photo/video provider.
210
257
  */
@@ -223,7 +270,7 @@ export type StockAssetMediaLibrary = {
223
270
  /**
224
271
  * Supported [media storage](https://sveltiacms.app/en/docs/media).
225
272
  */
226
- export type MediaLibrary = DefaultMediaLibrary | CloudinaryMediaLibrary | UploadcareMediaLibrary | StockAssetMediaLibrary;
273
+ export type MediaLibrary = DefaultMediaLibrary | CloudinaryMediaLibrary | UploadcareMediaLibrary | S3MediaLibrary | StockAssetMediaLibrary;
227
274
  /**
228
275
  * Unified media storage option that supports multiple storage providers. See the
229
276
  * [documentation](https://sveltiacms.app/en/docs/media#configuration) for details.
@@ -241,6 +288,19 @@ export type MediaLibraries = {
241
288
  * Options for the Uploadcare media storage.
242
289
  */
243
290
  uploadcare?: UploadcareMediaLibrary;
291
+ /**
292
+ * Options for the Amazon S3 media storage.
293
+ */
294
+ aws_s3?: S3MediaLibrary;
295
+ /**
296
+ * Options for the Cloudflare R2 media storage.
297
+ */
298
+ cloudflare_r2?: S3MediaLibrary;
299
+ /**
300
+ * Options for the DigitalOcean Spaces media
301
+ * storage.
302
+ */
303
+ digitalocean_spaces?: S3MediaLibrary;
244
304
  /**
245
305
  * Options for the unified stock photo/video media
246
306
  * library.