payload 3.0.0-beta.78 → 3.0.0-beta.79
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/bin.js +33 -10
- package/dist/admin/RichText.d.ts +20 -17
- package/dist/admin/RichText.d.ts.map +1 -1
- package/dist/admin/RichText.js.map +1 -1
- package/dist/admin/elements/Cell.d.ts +11 -26
- package/dist/admin/elements/Cell.d.ts.map +1 -1
- package/dist/admin/elements/Cell.js.map +1 -1
- package/dist/admin/elements/Tab.d.ts +16 -15
- package/dist/admin/elements/Tab.d.ts.map +1 -1
- package/dist/admin/elements/Tab.js.map +1 -1
- package/dist/admin/fields/Array.d.ts +6 -13
- package/dist/admin/fields/Array.d.ts.map +1 -1
- package/dist/admin/fields/Array.js.map +1 -1
- package/dist/admin/fields/Blocks.d.ts +8 -25
- package/dist/admin/fields/Blocks.d.ts.map +1 -1
- package/dist/admin/fields/Blocks.js.map +1 -1
- package/dist/admin/fields/Checkbox.d.ts +9 -9
- package/dist/admin/fields/Checkbox.d.ts.map +1 -1
- package/dist/admin/fields/Checkbox.js.map +1 -1
- package/dist/admin/fields/Code.d.ts +5 -7
- package/dist/admin/fields/Code.d.ts.map +1 -1
- package/dist/admin/fields/Code.js.map +1 -1
- package/dist/admin/fields/Collapsible.d.ts +3 -4
- package/dist/admin/fields/Collapsible.d.ts.map +1 -1
- package/dist/admin/fields/Collapsible.js.map +1 -1
- package/dist/admin/fields/Date.d.ts +4 -7
- package/dist/admin/fields/Date.d.ts.map +1 -1
- package/dist/admin/fields/Date.js.map +1 -1
- package/dist/admin/fields/Email.d.ts +5 -7
- package/dist/admin/fields/Email.d.ts.map +1 -1
- package/dist/admin/fields/Email.js.map +1 -1
- package/dist/admin/fields/Group.d.ts +3 -6
- package/dist/admin/fields/Group.d.ts.map +1 -1
- package/dist/admin/fields/Group.js.map +1 -1
- package/dist/admin/fields/Hidden.d.ts +7 -5
- package/dist/admin/fields/Hidden.d.ts.map +1 -1
- package/dist/admin/fields/Hidden.js.map +1 -1
- package/dist/admin/fields/JSON.d.ts +4 -7
- package/dist/admin/fields/JSON.d.ts.map +1 -1
- package/dist/admin/fields/JSON.js.map +1 -1
- package/dist/admin/fields/Number.d.ts +5 -12
- package/dist/admin/fields/Number.d.ts.map +1 -1
- package/dist/admin/fields/Number.js.map +1 -1
- package/dist/admin/fields/Point.d.ts +4 -6
- package/dist/admin/fields/Point.d.ts.map +1 -1
- package/dist/admin/fields/Point.js.map +1 -1
- package/dist/admin/fields/Radio.d.ts +6 -9
- package/dist/admin/fields/Radio.d.ts.map +1 -1
- package/dist/admin/fields/Radio.js.map +1 -1
- package/dist/admin/fields/Relationship.d.ts +4 -9
- package/dist/admin/fields/Relationship.d.ts.map +1 -1
- package/dist/admin/fields/Relationship.js.map +1 -1
- package/dist/admin/fields/RichText.d.ts +5 -6
- package/dist/admin/fields/RichText.d.ts.map +1 -1
- package/dist/admin/fields/RichText.js.map +1 -1
- package/dist/admin/fields/Row.d.ts +3 -4
- package/dist/admin/fields/Row.d.ts.map +1 -1
- package/dist/admin/fields/Row.js.map +1 -1
- package/dist/admin/fields/Select.d.ts +6 -11
- package/dist/admin/fields/Select.d.ts.map +1 -1
- package/dist/admin/fields/Select.js.map +1 -1
- package/dist/admin/fields/Tabs.d.ts +8 -12
- package/dist/admin/fields/Tabs.d.ts.map +1 -1
- package/dist/admin/fields/Tabs.js.map +1 -1
- package/dist/admin/fields/Text.d.ts +7 -13
- package/dist/admin/fields/Text.d.ts.map +1 -1
- package/dist/admin/fields/Text.js.map +1 -1
- package/dist/admin/fields/Textarea.d.ts +7 -9
- package/dist/admin/fields/Textarea.d.ts.map +1 -1
- package/dist/admin/fields/Textarea.js.map +1 -1
- package/dist/admin/fields/Upload.d.ts +6 -7
- package/dist/admin/fields/Upload.d.ts.map +1 -1
- package/dist/admin/fields/Upload.js.map +1 -1
- package/dist/admin/forms/Error.d.ts +10 -10
- package/dist/admin/forms/Error.d.ts.map +1 -1
- package/dist/admin/forms/Error.js.map +1 -1
- package/dist/admin/forms/Field.d.ts +17 -24
- package/dist/admin/forms/Field.d.ts.map +1 -1
- package/dist/admin/forms/Field.js +1 -0
- package/dist/admin/forms/Field.js.map +1 -1
- package/dist/admin/forms/FieldDescription.d.ts +10 -9
- package/dist/admin/forms/FieldDescription.d.ts.map +1 -1
- package/dist/admin/forms/FieldDescription.js.map +1 -1
- package/dist/admin/forms/Label.d.ts +14 -15
- package/dist/admin/forms/Label.d.ts.map +1 -1
- package/dist/admin/forms/Label.js.map +1 -1
- package/dist/admin/types.d.ts +30 -11
- package/dist/admin/types.d.ts.map +1 -1
- package/dist/admin/types.js.map +1 -1
- package/dist/admin/views/types.d.ts +21 -13
- package/dist/admin/views/types.d.ts.map +1 -1
- package/dist/admin/views/types.js.map +1 -1
- package/dist/auth/baseFields/apiKey.js +2 -2
- package/dist/auth/baseFields/apiKey.js.map +1 -1
- package/dist/auth/baseFields/email.js +1 -1
- package/dist/auth/baseFields/email.js.map +1 -1
- package/dist/auth/baseFields/username.js +1 -1
- package/dist/auth/baseFields/username.js.map +1 -1
- package/dist/auth/baseFields/verification.js +1 -1
- package/dist/auth/baseFields/verification.js.map +1 -1
- package/dist/bin/generateImportMap/index.d.ts +47 -0
- package/dist/bin/generateImportMap/index.d.ts.map +1 -0
- package/dist/bin/generateImportMap/index.js +129 -0
- package/dist/bin/generateImportMap/index.js.map +1 -0
- package/dist/bin/generateImportMap/iterateCollections.d.ts +12 -0
- package/dist/bin/generateImportMap/iterateCollections.d.ts.map +1 -0
- package/dist/bin/generateImportMap/iterateCollections.js +41 -0
- package/dist/bin/generateImportMap/iterateCollections.js.map +1 -0
- package/dist/bin/generateImportMap/iterateConfig.d.ts +10 -0
- package/dist/bin/generateImportMap/iterateConfig.d.ts.map +1 -0
- package/dist/bin/generateImportMap/iterateConfig.js +75 -0
- package/dist/bin/generateImportMap/iterateConfig.js.map +1 -0
- package/dist/bin/generateImportMap/iterateFields.d.ts +12 -0
- package/dist/bin/generateImportMap/iterateFields.d.ts.map +1 -0
- package/dist/bin/generateImportMap/iterateFields.js +56 -0
- package/dist/bin/generateImportMap/iterateFields.js.map +1 -0
- package/dist/bin/generateImportMap/iterateGlobals.d.ts +12 -0
- package/dist/bin/generateImportMap/iterateGlobals.d.ts.map +1 -0
- package/dist/bin/generateImportMap/iterateGlobals.js +34 -0
- package/dist/bin/generateImportMap/iterateGlobals.js.map +1 -0
- package/dist/bin/generateImportMap/parsePayloadComponent.d.ts +6 -0
- package/dist/bin/generateImportMap/parsePayloadComponent.d.ts.map +1 -0
- package/dist/bin/generateImportMap/parsePayloadComponent.js +19 -0
- package/dist/bin/generateImportMap/parsePayloadComponent.js.map +1 -0
- package/dist/bin/index.d.ts.map +1 -1
- package/dist/bin/index.js +35 -4
- package/dist/bin/index.js.map +1 -1
- package/dist/collections/config/client.d.ts +32 -308
- package/dist/collections/config/client.d.ts.map +1 -1
- package/dist/collections/config/client.js +1 -82
- package/dist/collections/config/client.js.map +1 -1
- package/dist/collections/config/types.d.ts +9 -9
- package/dist/collections/config/types.d.ts.map +1 -1
- package/dist/collections/config/types.js.map +1 -1
- package/dist/config/client.d.ts +12 -6
- package/dist/config/client.d.ts.map +1 -1
- package/dist/config/client.js +1 -49
- package/dist/config/client.js.map +1 -1
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +4 -0
- package/dist/config/defaults.js.map +1 -1
- package/dist/config/types.d.ts +111 -52
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/types.js.map +1 -1
- package/dist/exports/node.d.ts +0 -1
- package/dist/exports/node.d.ts.map +1 -1
- package/dist/exports/node.js +0 -1
- package/dist/exports/node.js.map +1 -1
- package/dist/exports/shared.d.ts +2 -1
- package/dist/exports/shared.d.ts.map +1 -1
- package/dist/exports/shared.js +2 -1
- package/dist/exports/shared.js.map +1 -1
- package/dist/fields/config/client.d.ts +3 -1642
- package/dist/fields/config/client.d.ts.map +1 -1
- package/dist/fields/config/client.js +1 -81
- package/dist/fields/config/client.js.map +1 -1
- package/dist/fields/config/sanitize.d.ts.map +1 -1
- package/dist/fields/config/sanitize.js +23 -22
- package/dist/fields/config/sanitize.js.map +1 -1
- package/dist/fields/config/types.d.ts +385 -56
- package/dist/fields/config/types.d.ts.map +1 -1
- package/dist/fields/config/types.js +3 -0
- package/dist/fields/config/types.js.map +1 -1
- package/dist/globals/config/client.d.ts +26 -14
- package/dist/globals/config/client.d.ts.map +1 -1
- package/dist/globals/config/client.js +1 -47
- package/dist/globals/config/client.js.map +1 -1
- package/dist/globals/config/types.d.ts +3 -3
- package/dist/globals/config/types.js.map +1 -1
- package/dist/index.d.ts +15 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/uploads/getBaseFields.d.ts.map +1 -1
- package/dist/uploads/getBaseFields.js +5 -2
- package/dist/uploads/getBaseFields.js.map +1 -1
- package/dist/uploads/types.d.ts +4 -0
- package/dist/uploads/types.d.ts.map +1 -1
- package/dist/uploads/types.js.map +1 -1
- package/dist/utilities/fieldSchemaToJSON.d.ts +4 -4
- package/dist/utilities/fieldSchemaToJSON.d.ts.map +1 -1
- package/dist/utilities/fieldSchemaToJSON.js +0 -10
- package/dist/utilities/fieldSchemaToJSON.js.map +1 -1
- package/dist/utilities/flattenTopLevelFields.d.ts +4 -3
- package/dist/utilities/flattenTopLevelFields.d.ts.map +1 -1
- package/dist/utilities/flattenTopLevelFields.js +12 -7
- package/dist/utilities/flattenTopLevelFields.js.map +1 -1
- package/dist/utilities/getEntityPolicies.d.ts.map +1 -1
- package/dist/utilities/getEntityPolicies.js +5 -5
- package/dist/utilities/getEntityPolicies.js.map +1 -1
- package/dist/utilities/telemetry/conf/index.js.map +1 -1
- package/dist/versions/baseFields.js +1 -1
- package/dist/versions/baseFields.js.map +1 -1
- package/package.json +3 -10
- package/dist/admin/fields/index.d.ts +0 -65
- package/dist/admin/fields/index.d.ts.map +0 -1
- package/dist/admin/fields/index.js +0 -3
- package/dist/admin/fields/index.js.map +0 -1
- package/dist/admin/forms/FieldMap.d.ts +0 -23
- package/dist/admin/forms/FieldMap.d.ts.map +0 -1
- package/dist/admin/forms/FieldMap.js +0 -3
- package/dist/admin/forms/FieldMap.js.map +0 -1
- package/dist/admin/forms/FieldTypes.d.ts +0 -27
- package/dist/admin/forms/FieldTypes.d.ts.map +0 -1
- package/dist/admin/forms/FieldTypes.js +0 -3
- package/dist/admin/forms/FieldTypes.js.map +0 -1
- package/dist/bin/loader/clientExtensions.d.ts +0 -2
- package/dist/bin/loader/clientExtensions.d.ts.map +0 -1
- package/dist/bin/loader/clientExtensions.js +0 -13
- package/dist/bin/loader/clientExtensions.js.map +0 -1
- package/dist/bin/loader/compile.d.ts +0 -5
- package/dist/bin/loader/compile.d.ts.map +0 -1
- package/dist/bin/loader/compile.js +0 -27
- package/dist/bin/loader/compile.js.map +0 -1
- package/dist/bin/loader/ignores.d.ts +0 -2
- package/dist/bin/loader/ignores.d.ts.map +0 -1
- package/dist/bin/loader/ignores.js +0 -5
- package/dist/bin/loader/ignores.js.map +0 -1
- package/dist/bin/loader/index.d.ts +0 -34
- package/dist/bin/loader/index.d.ts.map +0 -1
- package/dist/bin/loader/index.js +0 -116
- package/dist/bin/loader/index.js.map +0 -1
- package/dist/bin/loader/read-default-tsconfig.d.ts +0 -29
- package/dist/bin/loader/read-default-tsconfig.d.ts.map +0 -1
- package/dist/bin/loader/read-default-tsconfig.js +0 -116
- package/dist/bin/loader/read-default-tsconfig.js.map +0 -1
- package/dist/bin/loader/resolveOriginalPath.d.ts +0 -10
- package/dist/bin/loader/resolveOriginalPath.d.ts.map +0 -1
- package/dist/bin/loader/resolveOriginalPath.js +0 -36
- package/dist/bin/loader/resolveOriginalPath.js.map +0 -1
- package/dist/utilities/importWithoutClientFiles.d.ts +0 -7
- package/dist/utilities/importWithoutClientFiles.d.ts.map +0 -1
- package/dist/utilities/importWithoutClientFiles.js +0 -47
- package/dist/utilities/importWithoutClientFiles.js.map +0 -1
package/dist/bin/index.js
CHANGED
|
@@ -1,16 +1,44 @@
|
|
|
1
|
-
|
|
1
|
+
import minimist from 'minimist';
|
|
2
|
+
import path from 'path';
|
|
2
3
|
import { findConfig } from '../config/find.js';
|
|
4
|
+
import { generateImportMap } from './generateImportMap/index.js';
|
|
3
5
|
import { generateTypes } from './generateTypes.js';
|
|
4
6
|
import { loadEnv } from './loadEnv.js';
|
|
5
7
|
import { migrate } from './migrate.js';
|
|
6
8
|
export const bin = async ()=>{
|
|
7
9
|
loadEnv();
|
|
10
|
+
const args = minimist(process.argv.slice(2));
|
|
11
|
+
const script = (typeof args._[0] === 'string' ? args._[0] : '').toLowerCase();
|
|
12
|
+
if (script === 'run') {
|
|
13
|
+
const scriptPath = args._[1];
|
|
14
|
+
if (!scriptPath) {
|
|
15
|
+
console.error('Please provide a script path to run.');
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
const absoluteScriptPath = path.resolve(process.cwd(), scriptPath);
|
|
19
|
+
// Modify process.argv to remove 'run' and the script path
|
|
20
|
+
const originalArgv = process.argv;
|
|
21
|
+
process.argv = [
|
|
22
|
+
process.argv[0],
|
|
23
|
+
process.argv[1],
|
|
24
|
+
...args._.slice(2)
|
|
25
|
+
];
|
|
26
|
+
try {
|
|
27
|
+
await import(absoluteScriptPath);
|
|
28
|
+
} catch (error) {
|
|
29
|
+
console.error(`Error running script: ${absoluteScriptPath}`);
|
|
30
|
+
console.error(error);
|
|
31
|
+
process.exit(1);
|
|
32
|
+
} finally{
|
|
33
|
+
// Restore original process.argv
|
|
34
|
+
process.argv = originalArgv;
|
|
35
|
+
}
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
8
38
|
const configPath = findConfig();
|
|
9
39
|
const configPromise = await import(configPath);
|
|
10
40
|
let config = await configPromise;
|
|
11
41
|
if (config.default) config = await config.default;
|
|
12
|
-
const args = minimist(process.argv.slice(2));
|
|
13
|
-
const script = (typeof args._[0] === 'string' ? args._[0] : '').toLowerCase();
|
|
14
42
|
const userBinScript = Array.isArray(config.bin) ? config.bin.find(({ key })=>key === script) : false;
|
|
15
43
|
if (userBinScript) {
|
|
16
44
|
try {
|
|
@@ -31,7 +59,10 @@ export const bin = async ()=>{
|
|
|
31
59
|
if (script === 'generate:types') {
|
|
32
60
|
return generateTypes(config);
|
|
33
61
|
}
|
|
34
|
-
|
|
62
|
+
if (script === 'generate:importmap') {
|
|
63
|
+
return generateImportMap(config);
|
|
64
|
+
}
|
|
65
|
+
console.error(`Unknown script: "${script}".`);
|
|
35
66
|
process.exit(1);
|
|
36
67
|
};
|
|
37
68
|
|
package/dist/bin/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/bin/index.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../../src/bin/index.ts"],"sourcesContent":["import minimist from 'minimist'\nimport path from 'path'\n\nimport type { BinScript } from '../config/types.js'\n\nimport { findConfig } from '../config/find.js'\nimport { generateImportMap } from './generateImportMap/index.js'\nimport { generateTypes } from './generateTypes.js'\nimport { loadEnv } from './loadEnv.js'\nimport { migrate } from './migrate.js'\n\nexport const bin = async () => {\n loadEnv()\n\n const args = minimist(process.argv.slice(2))\n const script = (typeof args._[0] === 'string' ? args._[0] : '').toLowerCase()\n\n if (script === 'run') {\n const scriptPath = args._[1]\n if (!scriptPath) {\n console.error('Please provide a script path to run.')\n process.exit(1)\n }\n\n const absoluteScriptPath = path.resolve(process.cwd(), scriptPath)\n\n // Modify process.argv to remove 'run' and the script path\n const originalArgv = process.argv\n process.argv = [process.argv[0], process.argv[1], ...args._.slice(2)]\n\n try {\n await import(absoluteScriptPath)\n } catch (error) {\n console.error(`Error running script: ${absoluteScriptPath}`)\n console.error(error)\n process.exit(1)\n } finally {\n // Restore original process.argv\n process.argv = originalArgv\n }\n return\n }\n\n const configPath = findConfig()\n const configPromise = await import(configPath)\n let config = await configPromise\n if (config.default) config = await config.default\n\n const userBinScript = Array.isArray(config.bin)\n ? config.bin.find(({ key }) => key === script)\n : false\n\n if (userBinScript) {\n try {\n const script: BinScript = await import(userBinScript.scriptPath)\n await script(config)\n } catch (err) {\n console.log(`Could not find associated bin script for the ${userBinScript.key} command`)\n console.error(err)\n }\n\n return\n }\n\n if (script.startsWith('migrate')) {\n return migrate({ config, parsedArgs: args }).then(() => process.exit(0))\n }\n\n if (script === 'generate:types') {\n return generateTypes(config)\n }\n\n if (script === 'generate:importmap') {\n return generateImportMap(config)\n }\n\n console.error(`Unknown script: \"${script}\".`)\n process.exit(1)\n}\n"],"names":["minimist","path","findConfig","generateImportMap","generateTypes","loadEnv","migrate","bin","args","process","argv","slice","script","_","toLowerCase","scriptPath","console","error","exit","absoluteScriptPath","resolve","cwd","originalArgv","configPath","configPromise","config","default","userBinScript","Array","isArray","find","key","err","log","startsWith","parsedArgs","then"],"mappings":"AAAA,OAAOA,cAAc,WAAU;AAC/B,OAAOC,UAAU,OAAM;AAIvB,SAASC,UAAU,QAAQ,oBAAmB;AAC9C,SAASC,iBAAiB,QAAQ,+BAA8B;AAChE,SAASC,aAAa,QAAQ,qBAAoB;AAClD,SAASC,OAAO,QAAQ,eAAc;AACtC,SAASC,OAAO,QAAQ,eAAc;AAEtC,OAAO,MAAMC,MAAM;IACjBF;IAEA,MAAMG,OAAOR,SAASS,QAAQC,IAAI,CAACC,KAAK,CAAC;IACzC,MAAMC,SAAS,AAAC,CAAA,OAAOJ,KAAKK,CAAC,CAAC,EAAE,KAAK,WAAWL,KAAKK,CAAC,CAAC,EAAE,GAAG,EAAC,EAAGC,WAAW;IAE3E,IAAIF,WAAW,OAAO;QACpB,MAAMG,aAAaP,KAAKK,CAAC,CAAC,EAAE;QAC5B,IAAI,CAACE,YAAY;YACfC,QAAQC,KAAK,CAAC;YACdR,QAAQS,IAAI,CAAC;QACf;QAEA,MAAMC,qBAAqBlB,KAAKmB,OAAO,CAACX,QAAQY,GAAG,IAAIN;QAEvD,0DAA0D;QAC1D,MAAMO,eAAeb,QAAQC,IAAI;QACjCD,QAAQC,IAAI,GAAG;YAACD,QAAQC,IAAI,CAAC,EAAE;YAAED,QAAQC,IAAI,CAAC,EAAE;eAAKF,KAAKK,CAAC,CAACF,KAAK,CAAC;SAAG;QAErE,IAAI;YACF,MAAM,MAAM,CAACQ;QACf,EAAE,OAAOF,OAAO;YACdD,QAAQC,KAAK,CAAC,CAAC,sBAAsB,EAAEE,mBAAmB,CAAC;YAC3DH,QAAQC,KAAK,CAACA;YACdR,QAAQS,IAAI,CAAC;QACf,SAAU;YACR,gCAAgC;YAChCT,QAAQC,IAAI,GAAGY;QACjB;QACA;IACF;IAEA,MAAMC,aAAarB;IACnB,MAAMsB,gBAAgB,MAAM,MAAM,CAACD;IACnC,IAAIE,SAAS,MAAMD;IACnB,IAAIC,OAAOC,OAAO,EAAED,SAAS,MAAMA,OAAOC,OAAO;IAEjD,MAAMC,gBAAgBC,MAAMC,OAAO,CAACJ,OAAOlB,GAAG,IAC1CkB,OAAOlB,GAAG,CAACuB,IAAI,CAAC,CAAC,EAAEC,GAAG,EAAE,GAAKA,QAAQnB,UACrC;IAEJ,IAAIe,eAAe;QACjB,IAAI;YACF,MAAMf,SAAoB,MAAM,MAAM,CAACe,cAAcZ,UAAU;YAC/D,MAAMH,OAAOa;QACf,EAAE,OAAOO,KAAK;YACZhB,QAAQiB,GAAG,CAAC,CAAC,6CAA6C,EAAEN,cAAcI,GAAG,CAAC,QAAQ,CAAC;YACvFf,QAAQC,KAAK,CAACe;QAChB;QAEA;IACF;IAEA,IAAIpB,OAAOsB,UAAU,CAAC,YAAY;QAChC,OAAO5B,QAAQ;YAAEmB;YAAQU,YAAY3B;QAAK,GAAG4B,IAAI,CAAC,IAAM3B,QAAQS,IAAI,CAAC;IACvE;IAEA,IAAIN,WAAW,kBAAkB;QAC/B,OAAOR,cAAcqB;IACvB;IAEA,IAAIb,WAAW,sBAAsB;QACnC,OAAOT,kBAAkBsB;IAC3B;IAEAT,QAAQC,KAAK,CAAC,CAAC,iBAAiB,EAAEL,OAAO,EAAE,CAAC;IAC5CH,QAAQS,IAAI,CAAC;AACf,EAAC"}
|
|
@@ -1,321 +1,45 @@
|
|
|
1
|
+
import type { MappedComponent } from '../../admin/types.js';
|
|
2
|
+
import type { MappedView } from '../../admin/views/types.js';
|
|
1
3
|
import type { LivePreviewConfig, ServerOnlyLivePreviewProperties } from '../../config/types.js';
|
|
4
|
+
import type { ClientField } from '../../fields/config/client.js';
|
|
5
|
+
import type { SanitizedCollectionConfig } from './types.js';
|
|
2
6
|
export type ServerOnlyCollectionProperties = keyof Pick<SanitizedCollectionConfig, 'access' | 'custom' | 'endpoints' | 'hooks'>;
|
|
3
|
-
export type ServerOnlyCollectionAdminProperties = keyof Pick<SanitizedCollectionConfig['admin'], '
|
|
7
|
+
export type ServerOnlyCollectionAdminProperties = keyof Pick<SanitizedCollectionConfig['admin'], 'hidden' | 'preview'>;
|
|
4
8
|
export type ClientCollectionConfig = {
|
|
5
|
-
|
|
6
|
-
livePreview?: Omit<LivePreviewConfig, ServerOnlyLivePreviewProperties>;
|
|
7
|
-
} & Omit<SanitizedCollectionConfig['admin'], 'fields' | 'livePreview' | ServerOnlyCollectionAdminProperties>;
|
|
8
|
-
fields: ClientFieldConfig[];
|
|
9
|
-
} & Omit<SanitizedCollectionConfig, 'admin' | 'fields' | ServerOnlyCollectionProperties>;
|
|
10
|
-
import type { TFunction } from '@payloadcms/translations';
|
|
11
|
-
import type { ClientFieldConfig } from '../../fields/config/client.js';
|
|
12
|
-
import type { SanitizedCollectionConfig } from './types.js';
|
|
13
|
-
export declare const createClientCollectionConfig: ({ collection, t, }: {
|
|
14
|
-
collection: SanitizedCollectionConfig;
|
|
15
|
-
t: TFunction;
|
|
16
|
-
}) => {
|
|
17
|
-
auth: import("../../index.js").Auth;
|
|
18
|
-
endpoints: import("../../config/types.js").Endpoint[] | false;
|
|
19
|
-
fields: import("../../index.js").Field[];
|
|
20
|
-
upload: import("../../index.js").SanitizedUploadConfig;
|
|
21
|
-
versions: import("../../versions/types.js").SanitizedCollectionVersions;
|
|
22
|
-
access: {
|
|
23
|
-
admin: ({ req }: {
|
|
24
|
-
req: import("../../index.js").PayloadRequest;
|
|
25
|
-
}) => Promise<boolean> | boolean;
|
|
26
|
-
create: import("../../config/types.js").Access;
|
|
27
|
-
delete: import("../../config/types.js").Access;
|
|
28
|
-
read: import("../../config/types.js").Access;
|
|
29
|
-
readVersions: import("../../config/types.js").Access;
|
|
30
|
-
unlock: import("../../config/types.js").Access;
|
|
31
|
-
update: import("../../config/types.js").Access;
|
|
32
|
-
};
|
|
9
|
+
_isPreviewEnabled?: true;
|
|
33
10
|
admin: {
|
|
34
11
|
components: {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
12
|
+
Description: MappedComponent;
|
|
13
|
+
afterList: MappedComponent[];
|
|
14
|
+
afterListTable: MappedComponent[];
|
|
15
|
+
beforeList: MappedComponent[];
|
|
16
|
+
beforeListTable: MappedComponent[];
|
|
39
17
|
edit: {
|
|
40
|
-
Description:
|
|
41
|
-
PreviewButton:
|
|
42
|
-
PublishButton:
|
|
43
|
-
SaveButton:
|
|
44
|
-
SaveDraftButton:
|
|
45
|
-
Upload:
|
|
18
|
+
Description: MappedComponent;
|
|
19
|
+
PreviewButton: MappedComponent;
|
|
20
|
+
PublishButton: MappedComponent;
|
|
21
|
+
SaveButton: MappedComponent;
|
|
22
|
+
SaveDraftButton: MappedComponent;
|
|
23
|
+
Upload: MappedComponent;
|
|
46
24
|
};
|
|
47
25
|
views: {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
collection: SanitizedCollectionConfig;
|
|
56
|
-
global: import("../../index.js").SanitizedGlobalConfig;
|
|
57
|
-
id?: string;
|
|
58
|
-
routes: import("../../config/types.js").SanitizedConfig["routes"];
|
|
59
|
-
}) => string) | string;
|
|
60
|
-
isActive: ((args: {
|
|
61
|
-
href: string;
|
|
62
|
-
}) => boolean) | boolean;
|
|
63
|
-
label: ((args: {
|
|
64
|
-
t: (key: string) => string;
|
|
65
|
-
}) => string) | string;
|
|
66
|
-
newTab: boolean;
|
|
67
|
-
};
|
|
68
|
-
path: string;
|
|
69
|
-
} | {
|
|
70
|
-
Component: import("../../config/types.js").EditViewComponent;
|
|
71
|
-
path: string;
|
|
72
|
-
} | {
|
|
73
|
-
actions: import("../../config/types.js").CustomComponent[];
|
|
74
|
-
};
|
|
75
|
-
Default: import("../../config/types.js").EditViewComponent | {
|
|
76
|
-
Tab: import("../../index.js").DocumentTabComponent | {
|
|
77
|
-
Pill: React.ComponentType;
|
|
78
|
-
condition: import("../../index.js").DocumentTabCondition;
|
|
79
|
-
href: ((args: {
|
|
80
|
-
apiURL: string;
|
|
81
|
-
collection: SanitizedCollectionConfig;
|
|
82
|
-
global: import("../../index.js").SanitizedGlobalConfig;
|
|
83
|
-
id?: string;
|
|
84
|
-
routes: import("../../config/types.js").SanitizedConfig["routes"];
|
|
85
|
-
}) => string) | string;
|
|
86
|
-
isActive: ((args: {
|
|
87
|
-
href: string;
|
|
88
|
-
}) => boolean) | boolean;
|
|
89
|
-
label: ((args: {
|
|
90
|
-
t: (key: string) => string;
|
|
91
|
-
}) => string) | string;
|
|
92
|
-
newTab: boolean;
|
|
93
|
-
};
|
|
94
|
-
path: string;
|
|
95
|
-
} | {
|
|
96
|
-
Component: import("../../config/types.js").EditViewComponent;
|
|
97
|
-
path: string;
|
|
98
|
-
} | {
|
|
99
|
-
actions: import("../../config/types.js").CustomComponent[];
|
|
100
|
-
};
|
|
101
|
-
LivePreview: import("../../config/types.js").EditViewComponent | {
|
|
102
|
-
Tab: import("../../index.js").DocumentTabComponent | {
|
|
103
|
-
Pill: React.ComponentType;
|
|
104
|
-
condition: import("../../index.js").DocumentTabCondition;
|
|
105
|
-
href: ((args: {
|
|
106
|
-
apiURL: string;
|
|
107
|
-
collection: SanitizedCollectionConfig;
|
|
108
|
-
global: import("../../index.js").SanitizedGlobalConfig;
|
|
109
|
-
id?: string;
|
|
110
|
-
routes: import("../../config/types.js").SanitizedConfig["routes"];
|
|
111
|
-
}) => string) | string;
|
|
112
|
-
isActive: ((args: {
|
|
113
|
-
href: string;
|
|
114
|
-
}) => boolean) | boolean;
|
|
115
|
-
label: ((args: {
|
|
116
|
-
t: (key: string) => string;
|
|
117
|
-
}) => string) | string;
|
|
118
|
-
newTab: boolean;
|
|
119
|
-
};
|
|
120
|
-
path: string;
|
|
121
|
-
} | {
|
|
122
|
-
Component: import("../../config/types.js").EditViewComponent;
|
|
123
|
-
path: string;
|
|
124
|
-
} | {
|
|
125
|
-
actions: import("../../config/types.js").CustomComponent[];
|
|
126
|
-
};
|
|
127
|
-
Version: import("../../config/types.js").EditViewComponent | {
|
|
128
|
-
Tab: import("../../index.js").DocumentTabComponent | {
|
|
129
|
-
Pill: React.ComponentType;
|
|
130
|
-
condition: import("../../index.js").DocumentTabCondition;
|
|
131
|
-
href: ((args: {
|
|
132
|
-
apiURL: string;
|
|
133
|
-
collection: SanitizedCollectionConfig;
|
|
134
|
-
global: import("../../index.js").SanitizedGlobalConfig;
|
|
135
|
-
id?: string;
|
|
136
|
-
routes: import("../../config/types.js").SanitizedConfig["routes"];
|
|
137
|
-
}) => string) | string;
|
|
138
|
-
isActive: ((args: {
|
|
139
|
-
href: string;
|
|
140
|
-
}) => boolean) | boolean;
|
|
141
|
-
label: ((args: {
|
|
142
|
-
t: (key: string) => string;
|
|
143
|
-
}) => string) | string;
|
|
144
|
-
newTab: boolean;
|
|
145
|
-
};
|
|
146
|
-
path: string;
|
|
147
|
-
} | {
|
|
148
|
-
Component: import("../../config/types.js").EditViewComponent;
|
|
149
|
-
path: string;
|
|
150
|
-
} | {
|
|
151
|
-
actions: import("../../config/types.js").CustomComponent[];
|
|
152
|
-
};
|
|
153
|
-
Versions: import("../../config/types.js").EditViewComponent | {
|
|
154
|
-
Tab: import("../../index.js").DocumentTabComponent | {
|
|
155
|
-
Pill: React.ComponentType;
|
|
156
|
-
condition: import("../../index.js").DocumentTabCondition;
|
|
157
|
-
href: ((args: {
|
|
158
|
-
apiURL: string;
|
|
159
|
-
collection: SanitizedCollectionConfig;
|
|
160
|
-
global: import("../../index.js").SanitizedGlobalConfig;
|
|
161
|
-
id?: string;
|
|
162
|
-
routes: import("../../config/types.js").SanitizedConfig["routes"];
|
|
163
|
-
}) => string) | string;
|
|
164
|
-
isActive: ((args: {
|
|
165
|
-
href: string;
|
|
166
|
-
}) => boolean) | boolean;
|
|
167
|
-
label: ((args: {
|
|
168
|
-
t: (key: string) => string;
|
|
169
|
-
}) => string) | string;
|
|
170
|
-
newTab: boolean;
|
|
171
|
-
};
|
|
172
|
-
path: string;
|
|
173
|
-
} | {
|
|
174
|
-
Component: import("../../config/types.js").EditViewComponent;
|
|
175
|
-
path: string;
|
|
176
|
-
} | {
|
|
177
|
-
actions: import("../../config/types.js").CustomComponent[];
|
|
178
|
-
};
|
|
179
|
-
} | {
|
|
180
|
-
[x: string]: {
|
|
181
|
-
Tab: import("../../index.js").DocumentTabComponent | {
|
|
182
|
-
Pill: React.ComponentType;
|
|
183
|
-
condition: import("../../index.js").DocumentTabCondition;
|
|
184
|
-
href: ((args: {
|
|
185
|
-
apiURL: string;
|
|
186
|
-
collection: SanitizedCollectionConfig;
|
|
187
|
-
global: import("../../index.js").SanitizedGlobalConfig;
|
|
188
|
-
id?: string;
|
|
189
|
-
routes: import("../../config/types.js").SanitizedConfig["routes"];
|
|
190
|
-
}) => string) | string;
|
|
191
|
-
isActive: ((args: {
|
|
192
|
-
href: string;
|
|
193
|
-
}) => boolean) | boolean;
|
|
194
|
-
label: ((args: {
|
|
195
|
-
t: (key: string) => string;
|
|
196
|
-
}) => string) | string;
|
|
197
|
-
newTab: boolean;
|
|
198
|
-
};
|
|
199
|
-
path: string;
|
|
200
|
-
} | {
|
|
201
|
-
Component: import("../../config/types.js").EditViewComponent;
|
|
202
|
-
path: string;
|
|
203
|
-
} | {
|
|
204
|
-
actions: import("../../config/types.js").CustomComponent[];
|
|
205
|
-
};
|
|
26
|
+
edit: {
|
|
27
|
+
[key: string]: MappedView;
|
|
28
|
+
api: MappedView;
|
|
29
|
+
default: MappedView;
|
|
30
|
+
livePreview: MappedView;
|
|
31
|
+
version: MappedView;
|
|
32
|
+
versions: MappedView;
|
|
206
33
|
};
|
|
207
|
-
|
|
208
|
-
Component:
|
|
209
|
-
actions:
|
|
34
|
+
list: {
|
|
35
|
+
Component: MappedComponent;
|
|
36
|
+
actions: MappedComponent[];
|
|
210
37
|
};
|
|
211
38
|
};
|
|
212
39
|
};
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
[x: string]: string;
|
|
219
|
-
};
|
|
220
|
-
enableRichTextLink: boolean;
|
|
221
|
-
enableRichTextRelationship: boolean;
|
|
222
|
-
group: string | {
|
|
223
|
-
[x: string]: string;
|
|
224
|
-
};
|
|
225
|
-
hidden: ((args: {
|
|
226
|
-
user: import("../../index.js").ClientUser;
|
|
227
|
-
}) => boolean) | boolean;
|
|
228
|
-
hideAPIURL: boolean;
|
|
229
|
-
listSearchableFields: string[];
|
|
230
|
-
livePreview: {
|
|
231
|
-
breakpoints: {
|
|
232
|
-
height: number | string;
|
|
233
|
-
label: string;
|
|
234
|
-
name: string;
|
|
235
|
-
width: number | string;
|
|
236
|
-
}[];
|
|
237
|
-
url: ((args: {
|
|
238
|
-
collectionConfig?: SanitizedCollectionConfig;
|
|
239
|
-
data: Record<string, any>;
|
|
240
|
-
globalConfig?: import("../../index.js").SanitizedGlobalConfig;
|
|
241
|
-
locale: import("../../config/types.js").Locale;
|
|
242
|
-
payload: import("../../index.js").Payload;
|
|
243
|
-
}) => Promise<string> | string) | string;
|
|
244
|
-
};
|
|
245
|
-
meta: {
|
|
246
|
-
description: string;
|
|
247
|
-
openGraph: {
|
|
248
|
-
description: string;
|
|
249
|
-
images: {
|
|
250
|
-
alt: string;
|
|
251
|
-
height: number | string;
|
|
252
|
-
type: string;
|
|
253
|
-
url: string;
|
|
254
|
-
width: number | string;
|
|
255
|
-
} | {
|
|
256
|
-
alt: string;
|
|
257
|
-
height: number | string;
|
|
258
|
-
type: string;
|
|
259
|
-
url: string;
|
|
260
|
-
width: number | string;
|
|
261
|
-
}[];
|
|
262
|
-
siteName: string;
|
|
263
|
-
title: string;
|
|
264
|
-
};
|
|
265
|
-
};
|
|
266
|
-
pagination: {
|
|
267
|
-
defaultLimit: number;
|
|
268
|
-
limits: number[];
|
|
269
|
-
};
|
|
270
|
-
preview: import("../../config/types.js").GeneratePreviewURL;
|
|
271
|
-
useAsTitle: string;
|
|
272
|
-
};
|
|
273
|
-
custom: {
|
|
274
|
-
[x: string]: any;
|
|
275
|
-
};
|
|
276
|
-
dbName: import("../../index.js").DBIdentifierName;
|
|
277
|
-
defaultSort: string;
|
|
278
|
-
disableDuplicate: boolean;
|
|
279
|
-
graphQL: false | {
|
|
280
|
-
pluralName: string;
|
|
281
|
-
singularName: string;
|
|
282
|
-
};
|
|
283
|
-
hooks: {
|
|
284
|
-
afterChange: import("./types.js").AfterChangeHook[];
|
|
285
|
-
afterDelete: import("./types.js").AfterDeleteHook[];
|
|
286
|
-
afterError: import("./types.js").AfterErrorHook;
|
|
287
|
-
afterForgotPassword: import("./types.js").AfterForgotPasswordHook[];
|
|
288
|
-
afterLogin: import("./types.js").AfterLoginHook[];
|
|
289
|
-
afterLogout: import("./types.js").AfterLogoutHook[];
|
|
290
|
-
afterMe: import("./types.js").AfterMeHook[];
|
|
291
|
-
afterOperation: import("./types.js").AfterOperationHook<any>[];
|
|
292
|
-
afterRead: import("./types.js").AfterReadHook[];
|
|
293
|
-
afterRefresh: import("./types.js").AfterRefreshHook[];
|
|
294
|
-
beforeChange: import("./types.js").BeforeChangeHook[];
|
|
295
|
-
beforeDelete: import("./types.js").BeforeDeleteHook[];
|
|
296
|
-
beforeLogin: import("./types.js").BeforeLoginHook[];
|
|
297
|
-
beforeOperation: import("./types.js").BeforeOperationHook[];
|
|
298
|
-
beforeRead: import("./types.js").BeforeReadHook[];
|
|
299
|
-
beforeValidate: import("./types.js").BeforeValidateHook[];
|
|
300
|
-
me: import("./types.js").MeHook[];
|
|
301
|
-
refresh: import("./types.js").RefreshHook[];
|
|
302
|
-
};
|
|
303
|
-
labels: {
|
|
304
|
-
plural: string | import("../../config/types.js").LabelFunction | {
|
|
305
|
-
[x: string]: string;
|
|
306
|
-
};
|
|
307
|
-
singular: string | import("../../config/types.js").LabelFunction | {
|
|
308
|
-
[x: string]: string;
|
|
309
|
-
};
|
|
310
|
-
};
|
|
311
|
-
slug: string;
|
|
312
|
-
timestamps: boolean;
|
|
313
|
-
typescript: {
|
|
314
|
-
interface: string;
|
|
315
|
-
};
|
|
316
|
-
};
|
|
317
|
-
export declare const createClientCollectionConfigs: ({ collections, t, }: {
|
|
318
|
-
collections: SanitizedCollectionConfig[];
|
|
319
|
-
t: TFunction;
|
|
320
|
-
}) => ClientCollectionConfig[];
|
|
40
|
+
description?: Record<string, string> | string;
|
|
41
|
+
livePreview?: Omit<LivePreviewConfig, ServerOnlyLivePreviewProperties>;
|
|
42
|
+
} & Omit<SanitizedCollectionConfig['admin'], 'components' | 'description' | 'livePreview' | ServerOnlyCollectionAdminProperties>;
|
|
43
|
+
fields: ClientField[];
|
|
44
|
+
} & Omit<SanitizedCollectionConfig, 'admin' | 'fields' | ServerOnlyCollectionProperties>;
|
|
321
45
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/collections/config/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/collections/config/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAA;AAC/F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAChE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAA;AAE3D,MAAM,MAAM,8BAA8B,GAAG,MAAM,IAAI,CACrD,yBAAyB,EACzB,QAAQ,GAAG,QAAQ,GAAG,WAAW,GAAG,OAAO,CAC5C,CAAA;AAED,MAAM,MAAM,mCAAmC,GAAG,MAAM,IAAI,CAC1D,yBAAyB,CAAC,OAAO,CAAC,EAClC,QAAQ,GAAG,SAAS,CACrB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,iBAAiB,CAAC,EAAE,IAAI,CAAA;IACxB,KAAK,EAAE;QACL,UAAU,EAAE;YACV,WAAW,EAAE,eAAe,CAAA;YAC5B,SAAS,EAAE,eAAe,EAAE,CAAA;YAC5B,cAAc,EAAE,eAAe,EAAE,CAAA;YACjC,UAAU,EAAE,eAAe,EAAE,CAAA;YAC7B,eAAe,EAAE,eAAe,EAAE,CAAA;YAClC,IAAI,EAAE;gBACJ,WAAW,EAAE,eAAe,CAAA;gBAC5B,aAAa,EAAE,eAAe,CAAA;gBAC9B,aAAa,EAAE,eAAe,CAAA;gBAC9B,UAAU,EAAE,eAAe,CAAA;gBAC3B,eAAe,EAAE,eAAe,CAAA;gBAChC,MAAM,EAAE,eAAe,CAAA;aACxB,CAAA;YACD,KAAK,EAAE;gBACL,IAAI,EAAE;oBACJ,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;oBACzB,GAAG,EAAE,UAAU,CAAA;oBACf,OAAO,EAAE,UAAU,CAAA;oBACnB,WAAW,EAAE,UAAU,CAAA;oBACvB,OAAO,EAAE,UAAU,CAAA;oBACnB,QAAQ,EAAE,UAAU,CAAA;iBACrB,CAAA;gBACD,IAAI,EAAE;oBACJ,SAAS,EAAE,eAAe,CAAA;oBAC1B,OAAO,EAAE,eAAe,EAAE,CAAA;iBAC3B,CAAA;aACF,CAAA;SACF,CAAA;QACD,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAA;QAC7C,WAAW,CAAC,EAAE,IAAI,CAAC,iBAAiB,EAAE,+BAA+B,CAAC,CAAA;KACvE,GAAG,IAAI,CACN,yBAAyB,CAAC,OAAO,CAAC,EAClC,YAAY,GAAG,aAAa,GAAG,aAAa,GAAG,mCAAmC,CACnF,CAAA;IACD,MAAM,EAAE,WAAW,EAAE,CAAA;CACtB,GAAG,IAAI,CAAC,yBAAyB,EAAE,OAAO,GAAG,QAAQ,GAAG,8BAA8B,CAAC,CAAA"}
|
|
@@ -1,84 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export const createClientCollectionConfig = ({ collection, t })=>{
|
|
3
|
-
const sanitized = {
|
|
4
|
-
...collection
|
|
5
|
-
};
|
|
6
|
-
sanitized.fields = createClientFieldConfigs({
|
|
7
|
-
fields: sanitized.fields,
|
|
8
|
-
t
|
|
9
|
-
});
|
|
10
|
-
const serverOnlyCollectionProperties = [
|
|
11
|
-
'hooks',
|
|
12
|
-
'access',
|
|
13
|
-
'endpoints',
|
|
14
|
-
'custom'
|
|
15
|
-
];
|
|
16
|
-
serverOnlyCollectionProperties.forEach((key)=>{
|
|
17
|
-
if (key in sanitized) {
|
|
18
|
-
delete sanitized[key];
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
if ('upload' in sanitized && typeof sanitized.upload === 'object') {
|
|
22
|
-
sanitized.upload = {
|
|
23
|
-
...sanitized.upload
|
|
24
|
-
};
|
|
25
|
-
delete sanitized.upload.handlers;
|
|
26
|
-
delete sanitized.upload.adminThumbnail;
|
|
27
|
-
delete sanitized.upload.externalFileHeaderFilter;
|
|
28
|
-
delete sanitized.upload.withMetadata;
|
|
29
|
-
if ('imageSizes' in sanitized.upload && sanitized.upload.imageSizes.length) {
|
|
30
|
-
sanitized.upload.imageSizes = sanitized.upload.imageSizes.map((size)=>{
|
|
31
|
-
const sanitizedSize = {
|
|
32
|
-
...size
|
|
33
|
-
};
|
|
34
|
-
if ('generateImageName' in sanitizedSize) delete sanitizedSize.generateImageName;
|
|
35
|
-
return sanitizedSize;
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
if ('auth' in sanitized && typeof sanitized.auth === 'object') {
|
|
40
|
-
sanitized.auth = {
|
|
41
|
-
...sanitized.auth
|
|
42
|
-
};
|
|
43
|
-
delete sanitized.auth.strategies;
|
|
44
|
-
delete sanitized.auth.forgotPassword;
|
|
45
|
-
delete sanitized.auth.verify;
|
|
46
|
-
}
|
|
47
|
-
if (sanitized.labels) {
|
|
48
|
-
Object.entries(sanitized.labels).forEach(([labelType, collectionLabel])=>{
|
|
49
|
-
if (typeof collectionLabel === 'function') {
|
|
50
|
-
sanitized.labels[labelType] = collectionLabel({
|
|
51
|
-
t
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
if ('admin' in sanitized) {
|
|
57
|
-
sanitized.admin = {
|
|
58
|
-
...sanitized.admin
|
|
59
|
-
};
|
|
60
|
-
const serverOnlyCollectionAdminProperties = [
|
|
61
|
-
'components',
|
|
62
|
-
'hidden',
|
|
63
|
-
'preview'
|
|
64
|
-
];
|
|
65
|
-
serverOnlyCollectionAdminProperties.forEach((key)=>{
|
|
66
|
-
if (key in sanitized.admin) {
|
|
67
|
-
delete sanitized.admin[key];
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
if ('livePreview' in sanitized.admin) {
|
|
71
|
-
sanitized.admin.livePreview = {
|
|
72
|
-
...sanitized.admin.livePreview
|
|
73
|
-
};
|
|
74
|
-
delete sanitized.admin.livePreview.url;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
return sanitized;
|
|
78
|
-
};
|
|
79
|
-
export const createClientCollectionConfigs = ({ collections, t })=>collections.map((collection)=>createClientCollectionConfig({
|
|
80
|
-
collection,
|
|
81
|
-
t
|
|
82
|
-
}));
|
|
1
|
+
export { };
|
|
83
2
|
|
|
84
3
|
//# sourceMappingURL=client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/collections/config/client.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"sources":["../../../src/collections/config/client.ts"],"sourcesContent":["import type { MappedComponent } from '../../admin/types.js'\nimport type { MappedView } from '../../admin/views/types.js'\nimport type { LivePreviewConfig, ServerOnlyLivePreviewProperties } from '../../config/types.js'\nimport type { ClientField } from '../../fields/config/client.js'\nimport type { SanitizedCollectionConfig } from './types.js'\n\nexport type ServerOnlyCollectionProperties = keyof Pick<\n SanitizedCollectionConfig,\n 'access' | 'custom' | 'endpoints' | 'hooks'\n>\n\nexport type ServerOnlyCollectionAdminProperties = keyof Pick<\n SanitizedCollectionConfig['admin'],\n 'hidden' | 'preview'\n>\n\nexport type ClientCollectionConfig = {\n _isPreviewEnabled?: true\n admin: {\n components: {\n Description: MappedComponent\n afterList: MappedComponent[]\n afterListTable: MappedComponent[]\n beforeList: MappedComponent[]\n beforeListTable: MappedComponent[]\n edit: {\n Description: MappedComponent\n PreviewButton: MappedComponent\n PublishButton: MappedComponent\n SaveButton: MappedComponent\n SaveDraftButton: MappedComponent\n Upload: MappedComponent\n }\n views: {\n edit: {\n [key: string]: MappedView\n api: MappedView\n default: MappedView\n livePreview: MappedView\n version: MappedView\n versions: MappedView\n }\n list: {\n Component: MappedComponent\n actions: MappedComponent[]\n }\n }\n }\n description?: Record<string, string> | string\n livePreview?: Omit<LivePreviewConfig, ServerOnlyLivePreviewProperties>\n } & Omit<\n SanitizedCollectionConfig['admin'],\n 'components' | 'description' | 'livePreview' | ServerOnlyCollectionAdminProperties\n >\n fields: ClientField[]\n} & Omit<SanitizedCollectionConfig, 'admin' | 'fields' | ServerOnlyCollectionProperties>\n"],"names":[],"mappings":"AAgBA,WAuCwF"}
|
|
@@ -4,7 +4,7 @@ import type { CustomPreviewButton, CustomPublishButton, CustomSaveButton, Custom
|
|
|
4
4
|
import type { Arguments as MeArguments } from '../../auth/operations/me.js';
|
|
5
5
|
import type { Arguments as RefreshArguments, Result as RefreshResult } from '../../auth/operations/refresh.js';
|
|
6
6
|
import type { Auth, ClientUser, IncomingAuthType } from '../../auth/types.js';
|
|
7
|
-
import type { Access, CustomComponent, EditConfig, Endpoint, EntityDescription, EntityDescriptionComponent, GeneratePreviewURL, LabelFunction,
|
|
7
|
+
import type { Access, CustomComponent, EditConfig, Endpoint, EntityDescription, EntityDescriptionComponent, GeneratePreviewURL, LabelFunction, LivePreviewConfig, OpenGraphConfig, PayloadComponent, StaticLabel } from '../../config/types.js';
|
|
8
8
|
import type { DBIdentifierName } from '../../database/types.js';
|
|
9
9
|
import type { Field } from '../../fields/config/types.js';
|
|
10
10
|
import type { CollectionSlug, JsonObject, TypedAuthOperations, TypedCollection } from '../../index.js';
|
|
@@ -216,14 +216,14 @@ export type CollectionAdminOptions = {
|
|
|
216
216
|
};
|
|
217
217
|
views?: {
|
|
218
218
|
/**
|
|
219
|
-
* Set to a React component to replace the entire
|
|
219
|
+
* Set to a React component to replace the entire Edit View, including all nested routes.
|
|
220
220
|
* Set to an object to replace or modify individual nested routes, or to add new ones.
|
|
221
221
|
*/
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
Component?:
|
|
222
|
+
edit?: EditConfig;
|
|
223
|
+
list?: {
|
|
224
|
+
Component?: PayloadComponent;
|
|
225
225
|
actions?: CustomComponent[];
|
|
226
|
-
}
|
|
226
|
+
};
|
|
227
227
|
};
|
|
228
228
|
};
|
|
229
229
|
/** Extension point to add your custom data. Available in server and client. */
|
|
@@ -273,7 +273,7 @@ export type CollectionAdminOptions = {
|
|
|
273
273
|
*/
|
|
274
274
|
preview?: GeneratePreviewURL;
|
|
275
275
|
/**
|
|
276
|
-
* Field to use as title in Edit
|
|
276
|
+
* Field to use as title in Edit View and first column in List view
|
|
277
277
|
*/
|
|
278
278
|
useAsTitle?: string;
|
|
279
279
|
};
|
|
@@ -368,8 +368,8 @@ export type CollectionConfig<TSlug extends CollectionSlug = any> = {
|
|
|
368
368
|
* Label configuration
|
|
369
369
|
*/
|
|
370
370
|
labels?: {
|
|
371
|
-
plural?: LabelFunction |
|
|
372
|
-
singular?: LabelFunction |
|
|
371
|
+
plural?: LabelFunction | StaticLabel;
|
|
372
|
+
singular?: LabelFunction | StaticLabel;
|
|
373
373
|
};
|
|
374
374
|
slug: string;
|
|
375
375
|
/**
|