@basedigital/base-cms-payload-core 0.1.41 → 0.1.42
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { S3StorageParams } from '../fields/file-storage/storage/apply-file-transition.js';
|
|
2
2
|
import type { Plugin } from 'payload';
|
|
3
|
-
export declare function createStorageConfig({ bucket, s3ClientConfig }: S3StorageParams): Plugin
|
|
3
|
+
export declare function createStorageConfig({ bucket, s3ClientConfig }: S3StorageParams): Plugin;
|
|
4
4
|
//# sourceMappingURL=payload-storage.config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payload-storage.config.d.ts","sourceRoot":"","sources":["../../../src/cms/config/payload-storage.config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6DAA6D,CAAC;AAInG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"payload-storage.config.d.ts","sourceRoot":"","sources":["../../../src/cms/config/payload-storage.config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6DAA6D,CAAC;AAInG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAItC,wBAAgB,mBAAmB,CAAC,EAAE,MAAM,EAAE,cAAc,EAAE,EAAE,eAAe,GAAG,MAAM,CAiCvF"}
|
|
@@ -3,12 +3,14 @@ import { getStorageAcl, isS3Storage } from './storage-driver.config.js';
|
|
|
3
3
|
import { buildFileURL } from '../fields/file-storage/storage/build-file-url.js';
|
|
4
4
|
import { buildMediaURL } from '../fields/file-storage/storage/build-media-url.js';
|
|
5
5
|
import { s3Storage } from '@payloadcms/storage-s3';
|
|
6
|
+
// O plugin é sempre registrado: em LOCAL fica desabilitado, mas alwaysInsertFields mantém os
|
|
7
|
+
// campos de storage (prefix) no schema, então as migrations independem do STORAGE_DRIVER.
|
|
6
8
|
export function createStorageConfig({ bucket, s3ClientConfig }) {
|
|
7
|
-
|
|
8
|
-
return undefined;
|
|
9
|
-
}
|
|
9
|
+
const enabled = isS3Storage();
|
|
10
10
|
const acl = getStorageAcl();
|
|
11
11
|
const mediaStorage = s3Storage({
|
|
12
|
+
enabled,
|
|
13
|
+
alwaysInsertFields: true,
|
|
12
14
|
collections: {
|
|
13
15
|
media: {
|
|
14
16
|
disablePayloadAccessControl: true,
|
|
@@ -21,6 +23,8 @@ export function createStorageConfig({ bucket, s3ClientConfig }) {
|
|
|
21
23
|
...(acl ? { acl } : {}),
|
|
22
24
|
});
|
|
23
25
|
const filesStorage = s3Storage({
|
|
26
|
+
enabled,
|
|
27
|
+
alwaysInsertFields: true,
|
|
24
28
|
collections: {
|
|
25
29
|
files: {
|
|
26
30
|
prefix: getFilesPrivatePrefix(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payload-storage.config.js","sourceRoot":"","sources":["../../../src/cms/config/payload-storage.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;AACtG,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAEpF,OAAO,EAAE,YAAY,EAAE,MAAM,sDAAsD,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,uDAAuD,CAAC;AACtF,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD,MAAM,UAAU,mBAAmB,CAAC,EAAE,MAAM,EAAE,cAAc,EAAmB;IAC7E,
|
|
1
|
+
{"version":3,"file":"payload-storage.config.js","sourceRoot":"","sources":["../../../src/cms/config/payload-storage.config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;AACtG,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAA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