@ainsleydev/payload-helper 0.0.3 → 0.0.5

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.
Files changed (55) hide show
  1. package/bin.js +7 -0
  2. package/dist/cli/bin.d.ts +2 -0
  3. package/dist/cli/bin.js +17 -0
  4. package/dist/cli/bin.js.map +1 -0
  5. package/dist/cli/types.d.ts +4 -0
  6. package/dist/cli/types.js +34 -0
  7. package/dist/cli/types.js.map +1 -0
  8. package/dist/collections/Media.js +150 -0
  9. package/dist/collections/Media.js.map +1 -0
  10. package/dist/collections/Redirects.js +72 -0
  11. package/dist/collections/Redirects.js.map +1 -0
  12. package/dist/common/SEO.js +45 -0
  13. package/dist/common/SEO.js.map +1 -0
  14. package/dist/endpoints/slug.js +39 -0
  15. package/dist/endpoints/slug.js.map +1 -0
  16. package/dist/globals/Navigation.js +138 -0
  17. package/dist/globals/Navigation.js.map +1 -0
  18. package/dist/globals/Settings.js +346 -0
  19. package/dist/globals/Settings.js.map +1 -0
  20. package/dist/globals/countries.js +198 -0
  21. package/dist/globals/countries.js.map +1 -0
  22. package/dist/globals/locales.js +2664 -0
  23. package/dist/globals/locales.js.map +1 -0
  24. package/dist/index.js +22 -0
  25. package/dist/index.js.map +1 -0
  26. package/dist/jest.config.js +27 -0
  27. package/dist/jest.config.js.map +1 -0
  28. package/dist/plugin/schema.js +239 -0
  29. package/dist/plugin/schema.js.map +1 -0
  30. package/dist/util/env.js +75 -0
  31. package/dist/util/env.js.map +1 -0
  32. package/dist/util/fields.js +12 -0
  33. package/dist/util/fields.js.map +1 -0
  34. package/dist/util/lexical.js +53 -0
  35. package/dist/util/lexical.js.map +1 -0
  36. package/dist/util/lexical.test.js +21 -0
  37. package/dist/util/lexical.test.js.map +1 -0
  38. package/dist/util/validation.js +23 -0
  39. package/dist/util/validation.js.map +1 -0
  40. package/package.json +42 -10
  41. package/eslint.config.mjs +0 -4
  42. package/src/collections/Media.ts +0 -154
  43. package/src/collections/Redirects.ts +0 -56
  44. package/src/common/SEO.ts +0 -45
  45. package/src/endpoints/slug.ts +0 -32
  46. package/src/gen/schema.ts +0 -584
  47. package/src/globals/Navigation.ts +0 -165
  48. package/src/globals/Settings.ts +0 -356
  49. package/src/globals/countries.ts +0 -196
  50. package/src/globals/locales.ts +0 -2668
  51. package/src/scripts/.gitkeep +0 -0
  52. package/src/seed/.gitkeep +0 -0
  53. package/src/util/env.ts +0 -96
  54. package/src/util/validation.ts +0 -22
  55. package/tsconfig.json +0 -19
package/bin.js ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ const start = async () => {
3
+ const { bin } = await import('./dist/cli/bin.js');
4
+ await bin();
5
+ };
6
+
7
+ void start();
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export declare const bin: () => Promise<void>;
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+ import { Command } from 'commander';
3
+ import { generateTypes } from './types.js';
4
+ import chalk from 'chalk';
5
+ const program = new Command();
6
+ program.command('generate-types').description('Generate JSON schema types for Payload CMS').action(async ()=>{
7
+ try {
8
+ await generateTypes('');
9
+ } catch (error) {
10
+ console.log(chalk.red(error));
11
+ }
12
+ });
13
+ export const bin = async ()=>{
14
+ await program.parseAsync(process.argv);
15
+ };
16
+
17
+ //# sourceMappingURL=bin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/cli/bin.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Command } from 'commander';\nimport { generateTypes } from './types.js';\nimport chalk from 'chalk';\n\nconst program = new Command();\n\nprogram\n\t.command('generate-types')\n\t.description('Generate JSON schema types for Payload CMS')\n\t.action(async () => {\n\t\ttry {\n\t\t\tawait generateTypes('');\n\t\t} catch (error) {\n\t\t\tconsole.log(chalk.red(error));\n\t\t}\n\t});\n\nexport const bin = async () => {\n\tawait program.parseAsync(process.argv);\n};\n"],"names":["Command","generateTypes","chalk","program","command","description","action","error","console","log","red","bin","parseAsync","process","argv"],"mappings":";AACA,SAASA,OAAO,QAAQ,YAAY;AACpC,SAASC,aAAa,QAAQ,aAAa;AAC3C,OAAOC,WAAW,QAAQ;AAE1B,MAAMC,UAAU,IAAIH;AAEpBG,QACEC,OAAO,CAAC,kBACRC,WAAW,CAAC,8CACZC,MAAM,CAAC;IACP,IAAI;QACH,MAAML,cAAc;IACrB,EAAE,OAAOM,OAAO;QACfC,QAAQC,GAAG,CAACP,MAAMQ,GAAG,CAACH;IACvB;AACD;AAED,OAAO,MAAMI,MAAM;IAClB,MAAMR,QAAQS,UAAU,CAACC,QAAQC,IAAI;AACtC,EAAE"}
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Creates JSON schema types of Payloads Collections & Globals
3
+ */
4
+ export declare function generateTypes(outFile: string): Promise<void>;
@@ -0,0 +1,34 @@
1
+ import * as fs from 'node:fs';
2
+ import { configToJSONSchema, getPayload } from 'payload';
3
+ import { findConfig, importConfig } from 'payload/node';
4
+ /**
5
+ * Creates JSON schema types of Payloads Collections & Globals
6
+ */ export async function generateTypes(outFile) {
7
+ console.log('Compiling JSON types for Collections and Globals...');
8
+ let configPath = '';
9
+ try {
10
+ configPath = findConfig();
11
+ } catch (e) {
12
+ console.log(`Error finding config: ${e}`);
13
+ return;
14
+ }
15
+ // Set the environment variable to generate Golang types.
16
+ process.env.GEN_GOLANG = 'true';
17
+ const config = await importConfig(configPath);
18
+ const outputFile = (process.env.PAYLOAD_TS_OUTPUT_PATH || config.typescript.outputFile).replace('.ts', '.json');
19
+ const payload = await getPayload({
20
+ config,
21
+ disableDBConnect: true,
22
+ disableOnInit: true,
23
+ // @ts-ignore
24
+ local: true,
25
+ secret: '--unused--'
26
+ });
27
+ const jsonSchema = configToJSONSchema(payload.config, payload.db.defaultIDType);
28
+ const prettyJSON = JSON.stringify(jsonSchema, null, 4);
29
+ fs.writeFileSync(outputFile, prettyJSON);
30
+ console.log(`JSON types written to: ${outputFile}`);
31
+ delete process.env.GEN_GOLANG;
32
+ }
33
+
34
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/cli/types.ts"],"sourcesContent":["import * as fs from 'node:fs';\nimport { configToJSONSchema, getPayload } from 'payload';\nimport { findConfig, importConfig } from 'payload/node';\n\n/**\n * Creates JSON schema types of Payloads Collections & Globals\n */\nexport async function generateTypes(outFile: string): Promise<void> {\n\tconsole.log('Compiling JSON types for Collections and Globals...');\n\n\tlet configPath = '';\n\ttry {\n\t\tconfigPath = findConfig();\n\t} catch (e) {\n\t\tconsole.log(`Error finding config: ${e}`);\n\t\treturn;\n\t}\n\n\t// Set the environment variable to generate Golang types.\n\tprocess.env.GEN_GOLANG = 'true';\n\n\tconst config = await importConfig(configPath);\n\tconst outputFile = (process.env.PAYLOAD_TS_OUTPUT_PATH || config.typescript.outputFile).replace(\n\t\t'.ts',\n\t\t'.json',\n\t);\n\n\tconst payload = await getPayload({\n\t\tconfig,\n\t\tdisableDBConnect: true,\n\t\tdisableOnInit: true,\n\t\t// @ts-ignore\n\t\tlocal: true,\n\t\tsecret: '--unused--',\n\t});\n\n\tconst jsonSchema = configToJSONSchema(payload.config, payload.db.defaultIDType);\n\tconst prettyJSON = JSON.stringify(jsonSchema, null, 4);\n\n\tfs.writeFileSync(outputFile, prettyJSON);\n\n\tconsole.log(`JSON types written to: ${outputFile}`);\n\n\tdelete process.env.GEN_GOLANG;\n}\n"],"names":["fs","configToJSONSchema","getPayload","findConfig","importConfig","generateTypes","outFile","console","log","configPath","e","process","env","GEN_GOLANG","config","outputFile","PAYLOAD_TS_OUTPUT_PATH","typescript","replace","payload","disableDBConnect","disableOnInit","local","secret","jsonSchema","db","defaultIDType","prettyJSON","JSON","stringify","writeFileSync"],"mappings":"AAAA,YAAYA,QAAQ,UAAU;AAC9B,SAASC,kBAAkB,EAAEC,UAAU,QAAQ,UAAU;AACzD,SAASC,UAAU,EAAEC,YAAY,QAAQ,eAAe;AAExD;;CAEC,GACD,OAAO,eAAeC,cAAcC,OAAe;IAClDC,QAAQC,GAAG,CAAC;IAEZ,IAAIC,aAAa;IACjB,IAAI;QACHA,aAAaN;IACd,EAAE,OAAOO,GAAG;QACXH,QAAQC,GAAG,CAAC,CAAC,sBAAsB,EAAEE,EAAE,CAAC;QACxC;IACD;IAEA,yDAAyD;IACzDC,QAAQC,GAAG,CAACC,UAAU,GAAG;IAEzB,MAAMC,SAAS,MAAMV,aAAaK;IAClC,MAAMM,aAAa,AAACJ,CAAAA,QAAQC,GAAG,CAACI,sBAAsB,IAAIF,OAAOG,UAAU,CAACF,UAAU,AAAD,EAAGG,OAAO,CAC9F,OACA;IAGD,MAAMC,UAAU,MAAMjB,WAAW;QAChCY;QACAM,kBAAkB;QAClBC,eAAe;QACf,aAAa;QACbC,OAAO;QACPC,QAAQ;IACT;IAEA,MAAMC,aAAavB,mBAAmBkB,QAAQL,MAAM,EAAEK,QAAQM,EAAE,CAACC,aAAa;IAC9E,MAAMC,aAAaC,KAAKC,SAAS,CAACL,YAAY,MAAM;IAEpDxB,GAAG8B,aAAa,CAACf,YAAYY;IAE7BpB,QAAQC,GAAG,CAAC,CAAC,uBAAuB,EAAEO,WAAW,CAAC;IAElD,OAAOJ,QAAQC,GAAG,CAACC,UAAU;AAC9B"}
@@ -0,0 +1,150 @@
1
+ // import type {
2
+ // LexicalRichTextAdapterProvider,
3
+ // LexicalEditorProps,
4
+ // } from '@payloadcms/richtext-lexical';
5
+ /**
6
+ * Media Collection Configuration
7
+ * Additional fields will be appended to the media collection.
8
+ *
9
+ * @constructor
10
+ * @param editor
11
+ * @param additionalFields
12
+ */ export const Media = (//editor?: (props?: LexicalEditorProps) => LexicalRichTextAdapterProvider,
13
+ additionalFields)=>{
14
+ return {
15
+ slug: 'media',
16
+ access: {
17
+ read: ()=>true
18
+ },
19
+ fields: [
20
+ {
21
+ name: 'alt',
22
+ type: 'text',
23
+ required: true
24
+ },
25
+ {
26
+ name: 'caption',
27
+ type: 'richText',
28
+ required: false
29
+ },
30
+ ...additionalFields ? additionalFields : []
31
+ ],
32
+ upload: {
33
+ staticDir: 'media',
34
+ imageSizes: [
35
+ // Original Size (for WebP & Avif)
36
+ {
37
+ name: 'webp',
38
+ width: undefined,
39
+ height: undefined,
40
+ formatOptions: {
41
+ format: 'webp',
42
+ options: {
43
+ quality: 80
44
+ }
45
+ }
46
+ },
47
+ {
48
+ name: 'avif',
49
+ width: undefined,
50
+ height: undefined,
51
+ formatOptions: {
52
+ format: 'avif',
53
+ options: {
54
+ quality: 80
55
+ }
56
+ }
57
+ },
58
+ // Thumbnail Sizes
59
+ {
60
+ name: 'thumbnail',
61
+ width: 400,
62
+ height: 300,
63
+ position: 'centre'
64
+ },
65
+ {
66
+ name: 'thumbnail_webp',
67
+ width: 400,
68
+ height: 300,
69
+ position: 'centre',
70
+ formatOptions: {
71
+ format: 'webp',
72
+ options: {
73
+ quality: 80
74
+ }
75
+ }
76
+ },
77
+ {
78
+ name: 'thumbnail_avif',
79
+ width: 400,
80
+ height: 300,
81
+ position: 'centre',
82
+ formatOptions: {
83
+ format: 'avif',
84
+ options: {
85
+ quality: 80
86
+ }
87
+ }
88
+ },
89
+ // Mobile Sizes
90
+ {
91
+ name: 'mobile',
92
+ width: 768,
93
+ height: undefined
94
+ },
95
+ {
96
+ name: 'mobile_webp',
97
+ width: 768,
98
+ height: undefined,
99
+ formatOptions: {
100
+ format: 'webp',
101
+ options: {
102
+ quality: 80
103
+ }
104
+ }
105
+ },
106
+ {
107
+ name: 'mobile_avif',
108
+ width: 768,
109
+ height: undefined,
110
+ formatOptions: {
111
+ format: 'avif',
112
+ options: {
113
+ quality: 80
114
+ }
115
+ }
116
+ },
117
+ // Tablet Sizes
118
+ {
119
+ name: 'tablet',
120
+ width: 1024,
121
+ height: undefined
122
+ },
123
+ {
124
+ name: 'tablet_webp',
125
+ width: 1024,
126
+ height: undefined,
127
+ formatOptions: {
128
+ format: 'webp',
129
+ options: {
130
+ quality: 80
131
+ }
132
+ }
133
+ },
134
+ {
135
+ name: 'tablet_avif',
136
+ width: 1024,
137
+ height: undefined,
138
+ formatOptions: {
139
+ format: 'avif',
140
+ options: {
141
+ quality: 80
142
+ }
143
+ }
144
+ }
145
+ ]
146
+ }
147
+ };
148
+ };
149
+
150
+ //# sourceMappingURL=Media.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/collections/Media.ts"],"sourcesContent":["import type { CollectionConfig, Field } from 'payload';\n// import type {\n// \tLexicalRichTextAdapterProvider,\n// \tLexicalEditorProps,\n// } from '@payloadcms/richtext-lexical';\n\n/**\n * Media Collection Configuration\n * Additional fields will be appended to the media collection.\n *\n * @constructor\n * @param editor\n * @param additionalFields\n */\nexport const Media = (\n\t//editor?: (props?: LexicalEditorProps) => LexicalRichTextAdapterProvider,\n\tadditionalFields?: Field[],\n): CollectionConfig => {\n\treturn {\n\t\tslug: 'media',\n\t\taccess: {\n\t\t\tread: () => true,\n\t\t},\n\t\tfields: [\n\t\t\t{\n\t\t\t\tname: 'alt',\n\t\t\t\ttype: 'text',\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'caption',\n\t\t\t\ttype: 'richText',\n\t\t\t\trequired: false,\n\t\t\t\t// editor: editor({\n\t\t\t\t// \t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t\t\t// \t// @ts-ignore\n\t\t\t\t// \tfeatures: ({ defaultFeatures }) => {\n\t\t\t\t// \t\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t\t\t\t// \t\t// @ts-ignore\n\t\t\t\t// \t\treturn defaultFeatures.filter((feature) => {\n\t\t\t\t// \t\t\treturn feature.key === 'paragraph' || feature.key === 'link';\n\t\t\t\t// \t\t});\n\t\t\t\t// \t},\n\t\t\t\t// }),\n\t\t\t},\n\t\t\t...(additionalFields ? additionalFields : []),\n\t\t],\n\t\tupload: {\n\t\t\tstaticDir: 'media',\n\t\t\timageSizes: [\n\t\t\t\t// Original Size (for WebP & Avif)\n\t\t\t\t{\n\t\t\t\t\tname: 'webp',\n\t\t\t\t\twidth: undefined,\n\t\t\t\t\theight: undefined,\n\t\t\t\t\tformatOptions: {\n\t\t\t\t\t\tformat: 'webp',\n\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\tquality: 80,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'avif',\n\t\t\t\t\twidth: undefined,\n\t\t\t\t\theight: undefined,\n\t\t\t\t\tformatOptions: {\n\t\t\t\t\t\tformat: 'avif',\n\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\tquality: 80,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t// Thumbnail Sizes\n\t\t\t\t{\n\t\t\t\t\tname: 'thumbnail',\n\t\t\t\t\twidth: 400,\n\t\t\t\t\theight: 300,\n\t\t\t\t\tposition: 'centre',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'thumbnail_webp',\n\t\t\t\t\twidth: 400,\n\t\t\t\t\theight: 300,\n\t\t\t\t\tposition: 'centre',\n\t\t\t\t\tformatOptions: {\n\t\t\t\t\t\tformat: 'webp',\n\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\tquality: 80,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'thumbnail_avif',\n\t\t\t\t\twidth: 400,\n\t\t\t\t\theight: 300,\n\t\t\t\t\tposition: 'centre',\n\t\t\t\t\tformatOptions: {\n\t\t\t\t\t\tformat: 'avif',\n\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\tquality: 80,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t// Mobile Sizes\n\t\t\t\t{\n\t\t\t\t\tname: 'mobile',\n\t\t\t\t\twidth: 768,\n\t\t\t\t\theight: undefined,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'mobile_webp',\n\t\t\t\t\twidth: 768,\n\t\t\t\t\theight: undefined,\n\t\t\t\t\tformatOptions: {\n\t\t\t\t\t\tformat: 'webp',\n\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\tquality: 80,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'mobile_avif',\n\t\t\t\t\twidth: 768,\n\t\t\t\t\theight: undefined,\n\t\t\t\t\tformatOptions: {\n\t\t\t\t\t\tformat: 'avif',\n\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\tquality: 80,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t// Tablet Sizes\n\t\t\t\t{\n\t\t\t\t\tname: 'tablet',\n\t\t\t\t\twidth: 1024,\n\t\t\t\t\theight: undefined,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'tablet_webp',\n\t\t\t\t\twidth: 1024,\n\t\t\t\t\theight: undefined,\n\t\t\t\t\tformatOptions: {\n\t\t\t\t\t\tformat: 'webp',\n\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\tquality: 80,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'tablet_avif',\n\t\t\t\t\twidth: 1024,\n\t\t\t\t\theight: undefined,\n\t\t\t\t\tformatOptions: {\n\t\t\t\t\t\tformat: 'avif',\n\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\tquality: 80,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t};\n};\n"],"names":["Media","additionalFields","slug","access","read","fields","name","type","required","upload","staticDir","imageSizes","width","undefined","height","formatOptions","format","options","quality","position"],"mappings":"AACA,gBAAgB;AAChB,mCAAmC;AACnC,uBAAuB;AACvB,yCAAyC;AAEzC;;;;;;;CAOC,GACD,OAAO,MAAMA,QAAQ,CACpB,0EAA0E;AAC1EC;IAEA,OAAO;QACNC,MAAM;QACNC,QAAQ;YACPC,MAAM,IAAM;QACb;QACAC,QAAQ;YACP;gBACCC,MAAM;gBACNC,MAAM;gBACNC,UAAU;YACX;YACA;gBACCF,MAAM;gBACNC,MAAM;gBACNC,UAAU;YAYX;eACIP,mBAAmBA,mBAAmB,EAAE;SAC5C;QACDQ,QAAQ;YACPC,WAAW;YACXC,YAAY;gBACX,kCAAkC;gBAClC;oBACCL,MAAM;oBACNM,OAAOC;oBACPC,QAAQD;oBACRE,eAAe;wBACdC,QAAQ;wBACRC,SAAS;4BACRC,SAAS;wBACV;oBACD;gBACD;gBACA;oBACCZ,MAAM;oBACNM,OAAOC;oBACPC,QAAQD;oBACRE,eAAe;wBACdC,QAAQ;wBACRC,SAAS;4BACRC,SAAS;wBACV;oBACD;gBACD;gBACA,kBAAkB;gBAClB;oBACCZ,MAAM;oBACNM,OAAO;oBACPE,QAAQ;oBACRK,UAAU;gBACX;gBACA;oBACCb,MAAM;oBACNM,OAAO;oBACPE,QAAQ;oBACRK,UAAU;oBACVJ,eAAe;wBACdC,QAAQ;wBACRC,SAAS;4BACRC,SAAS;wBACV;oBACD;gBACD;gBACA;oBACCZ,MAAM;oBACNM,OAAO;oBACPE,QAAQ;oBACRK,UAAU;oBACVJ,eAAe;wBACdC,QAAQ;wBACRC,SAAS;4BACRC,SAAS;wBACV;oBACD;gBACD;gBACA,eAAe;gBACf;oBACCZ,MAAM;oBACNM,OAAO;oBACPE,QAAQD;gBACT;gBACA;oBACCP,MAAM;oBACNM,OAAO;oBACPE,QAAQD;oBACRE,eAAe;wBACdC,QAAQ;wBACRC,SAAS;4BACRC,SAAS;wBACV;oBACD;gBACD;gBACA;oBACCZ,MAAM;oBACNM,OAAO;oBACPE,QAAQD;oBACRE,eAAe;wBACdC,QAAQ;wBACRC,SAAS;4BACRC,SAAS;wBACV;oBACD;gBACD;gBACA,eAAe;gBACf;oBACCZ,MAAM;oBACNM,OAAO;oBACPE,QAAQD;gBACT;gBACA;oBACCP,MAAM;oBACNM,OAAO;oBACPE,QAAQD;oBACRE,eAAe;wBACdC,QAAQ;wBACRC,SAAS;4BACRC,SAAS;wBACV;oBACD;gBACD;gBACA;oBACCZ,MAAM;oBACNM,OAAO;oBACPE,QAAQD;oBACRE,eAAe;wBACdC,QAAQ;wBACRC,SAAS;4BACRC,SAAS;wBACV;oBACD;gBACD;aACA;QACF;IACD;AACD,EAAE"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Redirects Collection Configuration
3
+ * In favour of the native plugin for more granular control.
4
+ *
5
+ * TODO: Potential to add regex redirects here, i.e product-category/(.*)$ => /category/$1
6
+ *
7
+ * @constructor
8
+ */ export const Redirects = (overrides)=>{
9
+ return {
10
+ slug: 'redirects',
11
+ admin: {
12
+ useAsTitle: 'from'
13
+ },
14
+ fields: [
15
+ {
16
+ name: 'from',
17
+ type: 'text',
18
+ label: 'From URL',
19
+ required: true,
20
+ index: true,
21
+ admin: {
22
+ description: 'The URL you want to redirect from, ensure it starts with a /'
23
+ }
24
+ },
25
+ {
26
+ name: 'to',
27
+ type: 'text',
28
+ label: 'Destination URL',
29
+ required: true,
30
+ admin: {
31
+ description: 'The URL you want to redirect to, can be a relative or absolute URL'
32
+ }
33
+ },
34
+ {
35
+ name: 'code',
36
+ type: 'select',
37
+ label: 'Redirect Code',
38
+ required: true,
39
+ defaultValue: '301',
40
+ options: [
41
+ {
42
+ label: '301 - Permanent',
43
+ value: '301'
44
+ },
45
+ {
46
+ label: '302 - Temporary',
47
+ value: '302'
48
+ },
49
+ {
50
+ label: '307 - Temporary Redirect',
51
+ value: '307'
52
+ },
53
+ {
54
+ label: '308 - Permanent Redirect',
55
+ value: '308'
56
+ },
57
+ {
58
+ label: '410 - Content Deleted',
59
+ value: '410'
60
+ },
61
+ {
62
+ label: '451 - Unavailable For Legal Reasons',
63
+ value: '451'
64
+ }
65
+ ]
66
+ }
67
+ ],
68
+ ...overrides ? overrides : {}
69
+ };
70
+ };
71
+
72
+ //# sourceMappingURL=Redirects.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/collections/Redirects.ts"],"sourcesContent":["import type { CollectionConfig } from 'payload';\n\n/**\n * Redirects Collection Configuration\n * In favour of the native plugin for more granular control.\n *\n * TODO: Potential to add regex redirects here, i.e product-category/(.*)$ => /category/$1\n *\n * @constructor\n */\nexport const Redirects = (overrides?: Partial<CollectionConfig>): CollectionConfig => {\n\treturn {\n\t\tslug: 'redirects',\n\t\tadmin: {\n\t\t\tuseAsTitle: 'from',\n\t\t},\n\t\tfields: [\n\t\t\t{\n\t\t\t\tname: 'from',\n\t\t\t\ttype: 'text',\n\t\t\t\tlabel: 'From URL',\n\t\t\t\trequired: true,\n\t\t\t\tindex: true,\n\t\t\t\tadmin: {\n\t\t\t\t\tdescription: 'The URL you want to redirect from, ensure it starts with a /',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'to',\n\t\t\t\ttype: 'text',\n\t\t\t\tlabel: 'Destination URL',\n\t\t\t\trequired: true,\n\t\t\t\tadmin: {\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'The URL you want to redirect to, can be a relative or absolute URL',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'code',\n\t\t\t\ttype: 'select',\n\t\t\t\tlabel: 'Redirect Code',\n\t\t\t\trequired: true,\n\t\t\t\tdefaultValue: '301',\n\t\t\t\toptions: [\n\t\t\t\t\t{ label: '301 - Permanent', value: '301' },\n\t\t\t\t\t{ label: '302 - Temporary', value: '302' },\n\t\t\t\t\t{ label: '307 - Temporary Redirect', value: '307' },\n\t\t\t\t\t{ label: '308 - Permanent Redirect', value: '308' },\n\t\t\t\t\t{ label: '410 - Content Deleted', value: '410' },\n\t\t\t\t\t{ label: '451 - Unavailable For Legal Reasons', value: '451' },\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t\t...(overrides ? overrides : {}),\n\t};\n};\n"],"names":["Redirects","overrides","slug","admin","useAsTitle","fields","name","type","label","required","index","description","defaultValue","options","value"],"mappings":"AAEA;;;;;;;CAOC,GACD,OAAO,MAAMA,YAAY,CAACC;IACzB,OAAO;QACNC,MAAM;QACNC,OAAO;YACNC,YAAY;QACb;QACAC,QAAQ;YACP;gBACCC,MAAM;gBACNC,MAAM;gBACNC,OAAO;gBACPC,UAAU;gBACVC,OAAO;gBACPP,OAAO;oBACNQ,aAAa;gBACd;YACD;YACA;gBACCL,MAAM;gBACNC,MAAM;gBACNC,OAAO;gBACPC,UAAU;gBACVN,OAAO;oBACNQ,aACC;gBACF;YACD;YACA;gBACCL,MAAM;gBACNC,MAAM;gBACNC,OAAO;gBACPC,UAAU;gBACVG,cAAc;gBACdC,SAAS;oBACR;wBAAEL,OAAO;wBAAmBM,OAAO;oBAAM;oBACzC;wBAAEN,OAAO;wBAAmBM,OAAO;oBAAM;oBACzC;wBAAEN,OAAO;wBAA4BM,OAAO;oBAAM;oBAClD;wBAAEN,OAAO;wBAA4BM,OAAO;oBAAM;oBAClD;wBAAEN,OAAO;wBAAyBM,OAAO;oBAAM;oBAC/C;wBAAEN,OAAO;wBAAuCM,OAAO;oBAAM;iBAC7D;YACF;SACA;QACD,GAAIb,YAAYA,YAAY,CAAC,CAAC;IAC/B;AACD,EAAE"}
@@ -0,0 +1,45 @@
1
+ // @ts-ignore
2
+ import { validateURL } from '../util/validation';
3
+ /**
4
+ * SEO Fields define the additional fields that appear
5
+ * within the Payload SEO plugin.
6
+ */ export const SEOFields = [
7
+ {
8
+ type: 'row',
9
+ fields: [
10
+ {
11
+ name: 'private',
12
+ type: 'checkbox',
13
+ label: 'Private',
14
+ defaultValue: false,
15
+ admin: {
16
+ width: '50%',
17
+ description: 'Enable private mode to prevent robots from crawling the page or website. When enabled it will output <meta name="robots" content="noindex" /> on the frontend.'
18
+ }
19
+ },
20
+ {
21
+ name: 'canonicalURL',
22
+ type: 'text',
23
+ label: 'Canonical',
24
+ admin: {
25
+ width: '50%',
26
+ description: 'A canonical URL is the version of a webpage chosen by search engines like Google as the main version when there are duplicates.'
27
+ },
28
+ validate: validateURL
29
+ }
30
+ ]
31
+ },
32
+ {
33
+ name: 'structuredData',
34
+ type: 'json',
35
+ label: 'Structured Data',
36
+ // typescriptSchema: [
37
+ // () => ({...addGoJSONSchema('[]byte', false)}),
38
+ // ],
39
+ admin: {
40
+ description: 'Structured data is a standardized format for providing information about a page and classifying the page content. The site Schema.org contains a standardised list of markup that the major search engines — Google, Bing, Yahoo and Yandex — have collectively agreed to support.'
41
+ }
42
+ }
43
+ ];
44
+
45
+ //# sourceMappingURL=SEO.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/common/SEO.ts"],"sourcesContent":["import { Field } from 'payload';\n// @ts-ignore\nimport { validateURL } from '../util/validation';\n\n/**\n * SEO Fields define the additional fields that appear\n * within the Payload SEO plugin.\n */\nexport const SEOFields: Field[] = [\n\t{\n\t\ttype: 'row',\n\t\tfields: [\n\t\t\t{\n\t\t\t\tname: 'private',\n\t\t\t\ttype: 'checkbox',\n\t\t\t\tlabel: 'Private',\n\t\t\t\tdefaultValue: false,\n\t\t\t\tadmin: {\n\t\t\t\t\twidth: '50%',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Enable private mode to prevent robots from crawling the page or website. When enabled it will output <meta name=\"robots\" content=\"noindex\" /> on the frontend.',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'canonicalURL',\n\t\t\t\ttype: 'text',\n\t\t\t\tlabel: 'Canonical',\n\t\t\t\tadmin: {\n\t\t\t\t\twidth: '50%',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'A canonical URL is the version of a webpage chosen by search engines like Google as the main version when there are duplicates.',\n\t\t\t\t},\n\t\t\t\tvalidate: validateURL,\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tname: 'structuredData',\n\t\ttype: 'json',\n\t\tlabel: 'Structured Data',\n\t\t// typescriptSchema: [\n\t\t// \t() => ({...addGoJSONSchema('[]byte', false)}),\n\t\t// ],\n\t\tadmin: {\n\t\t\tdescription:\n\t\t\t\t'Structured data is a standardized format for providing information about a page and classifying the page content. The site Schema.org contains a standardised list of markup that the major search engines — Google, Bing, Yahoo and Yandex — have collectively agreed to support.',\n\t\t},\n\t},\n];\n"],"names":["validateURL","SEOFields","type","fields","name","label","defaultValue","admin","width","description","validate"],"mappings":"AACA,aAAa;AACb,SAASA,WAAW,QAAQ,qBAAqB;AAEjD;;;CAGC,GACD,OAAO,MAAMC,YAAqB;IACjC;QACCC,MAAM;QACNC,QAAQ;YACP;gBACCC,MAAM;gBACNF,MAAM;gBACNG,OAAO;gBACPC,cAAc;gBACdC,OAAO;oBACNC,OAAO;oBACPC,aACC;gBACF;YACD;YACA;gBACCL,MAAM;gBACNF,MAAM;gBACNG,OAAO;gBACPE,OAAO;oBACNC,OAAO;oBACPC,aACC;gBACF;gBACAC,UAAUV;YACX;SACA;IACF;IACA;QACCI,MAAM;QACNF,MAAM;QACNG,OAAO;QACP,sBAAsB;QACtB,kDAAkD;QAClD,KAAK;QACLE,OAAO;YACNE,aACC;QACF;IACD;CACA,CAAC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Find a document in the given collection by its slug.
3
+ *
4
+ * @param collection
5
+ */ export const findBySlug = (collection)=>{
6
+ return async (req)=>{
7
+ try {
8
+ const data = await req.payload.find({
9
+ collection,
10
+ where: {
11
+ slug: {
12
+ equals: req?.routeParams?.slug ?? ''
13
+ }
14
+ },
15
+ limit: 1
16
+ });
17
+ if (data.docs.length === 0) {
18
+ return new Response(JSON.stringify({
19
+ error: 'not found'
20
+ }), {
21
+ status: 404
22
+ });
23
+ } else {
24
+ return new Response(JSON.stringify(data.docs[0]), {
25
+ status: 200
26
+ });
27
+ }
28
+ } catch (error) {
29
+ console.error('Error occurred while fetching document:', error);
30
+ return new Response(JSON.stringify({
31
+ error: 'Internal server error'
32
+ }), {
33
+ status: 500
34
+ });
35
+ }
36
+ };
37
+ };
38
+
39
+ //# sourceMappingURL=slug.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/endpoints/slug.ts"],"sourcesContent":["import { PayloadHandler, PayloadRequest } from 'payload';\n\n/**\n * Find a document in the given collection by its slug.\n *\n * @param collection\n */\nexport const findBySlug = (collection: string): PayloadHandler => {\n\treturn async (req: PayloadRequest): Promise<Response> => {\n\t\ttry {\n\t\t\tconst data = await req.payload.find({\n\t\t\t\tcollection,\n\t\t\t\twhere: {\n\t\t\t\t\tslug: {\n\t\t\t\t\t\tequals: req?.routeParams?.slug ?? '',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tlimit: 1,\n\t\t\t});\n\t\t\tif (data.docs.length === 0) {\n\t\t\t\treturn new Response(JSON.stringify({ error: 'not found' }), { status: 404 });\n\t\t\t} else {\n\t\t\t\treturn new Response(JSON.stringify(data.docs[0]), { status: 200 });\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconsole.error('Error occurred while fetching document:', error);\n\t\t\treturn new Response(JSON.stringify({ error: 'Internal server error' }), {\n\t\t\t\tstatus: 500,\n\t\t\t});\n\t\t}\n\t};\n};\n"],"names":["findBySlug","collection","req","data","payload","find","where","slug","equals","routeParams","limit","docs","length","Response","JSON","stringify","error","status","console"],"mappings":"AAEA;;;;CAIC,GACD,OAAO,MAAMA,aAAa,CAACC;IAC1B,OAAO,OAAOC;QACb,IAAI;YACH,MAAMC,OAAO,MAAMD,IAAIE,OAAO,CAACC,IAAI,CAAC;gBACnCJ;gBACAK,OAAO;oBACNC,MAAM;wBACLC,QAAQN,KAAKO,aAAaF,QAAQ;oBACnC;gBACD;gBACAG,OAAO;YACR;YACA,IAAIP,KAAKQ,IAAI,CAACC,MAAM,KAAK,GAAG;gBAC3B,OAAO,IAAIC,SAASC,KAAKC,SAAS,CAAC;oBAAEC,OAAO;gBAAY,IAAI;oBAAEC,QAAQ;gBAAI;YAC3E,OAAO;gBACN,OAAO,IAAIJ,SAASC,KAAKC,SAAS,CAACZ,KAAKQ,IAAI,CAAC,EAAE,GAAG;oBAAEM,QAAQ;gBAAI;YACjE;QACD,EAAE,OAAOD,OAAO;YACfE,QAAQF,KAAK,CAAC,2CAA2CA;YACzD,OAAO,IAAIH,SAASC,KAAKC,SAAS,CAAC;gBAAEC,OAAO;YAAwB,IAAI;gBACvEC,QAAQ;YACT;QACD;IACD;AACD,EAAE"}
@@ -0,0 +1,138 @@
1
+ /**
2
+ * Function to generate children structure recursively.
3
+ *
4
+ * @param depth Current depth
5
+ * @param maxDepth Maximum depth to generate children
6
+ * @param fields Fields to include at each level
7
+ */ const generateChildren = (depth, maxDepth, fields)=>{
8
+ if (depth >= maxDepth) {
9
+ return [];
10
+ }
11
+ // Only generate children if depth is less than maxDepth
12
+ if (depth < maxDepth - 1) {
13
+ return [
14
+ {
15
+ name: 'children',
16
+ type: 'array',
17
+ label: `Children Level ${depth + 1}`,
18
+ fields: [
19
+ ...fields,
20
+ ...generateChildren(depth + 1, maxDepth, fields)
21
+ ]
22
+ }
23
+ ];
24
+ }
25
+ return [];
26
+ };
27
+ /**
28
+ * The default navigation field links.
29
+ */ const navFields = [
30
+ {
31
+ type: 'row',
32
+ fields: [
33
+ {
34
+ name: 'title',
35
+ type: 'text',
36
+ label: 'Title',
37
+ required: true,
38
+ admin: {
39
+ width: '50%'
40
+ }
41
+ },
42
+ {
43
+ name: 'url',
44
+ type: 'text',
45
+ label: 'URL',
46
+ required: true,
47
+ admin: {
48
+ width: '50%'
49
+ }
50
+ }
51
+ ]
52
+ }
53
+ ];
54
+ /**
55
+ * Navigation Global Configuration
56
+ * Additional fields will be appended to each navigation item.
57
+ *
58
+ * @constructor
59
+ * @param config
60
+ */ export const Navigation = (config)=>{
61
+ const tabs = [
62
+ {
63
+ label: 'Header',
64
+ fields: [
65
+ {
66
+ name: 'header',
67
+ type: 'array',
68
+ label: 'Items',
69
+ interfaceName: 'NavigationHeaderLinks',
70
+ maxRows: 8,
71
+ labels: {
72
+ singular: 'Link',
73
+ plural: 'Links'
74
+ },
75
+ admin: {
76
+ initCollapsed: true,
77
+ isSortable: true
78
+ },
79
+ fields: [
80
+ ...navFields,
81
+ ...config?.header?.maxDepth ? generateChildren(0, config.header.maxDepth, navFields) : [],
82
+ ...config?.header?.additionalFields ? config.header.additionalFields : []
83
+ ]
84
+ }
85
+ ]
86
+ }
87
+ ];
88
+ if (config?.includeFooter) {
89
+ tabs.push({
90
+ label: 'Footer',
91
+ fields: [
92
+ {
93
+ name: 'footer',
94
+ type: 'array',
95
+ label: 'Items',
96
+ interfaceName: 'NavigationFooterLinks',
97
+ maxRows: 8,
98
+ labels: {
99
+ singular: 'Link',
100
+ plural: 'Links'
101
+ },
102
+ admin: {
103
+ initCollapsed: true,
104
+ isSortable: true
105
+ },
106
+ fields: [
107
+ ...navFields,
108
+ ...config?.footer?.maxDepth ? generateChildren(0, config.footer.maxDepth, navFields) : [],
109
+ ...config?.footer?.additionalFields ? config.footer.additionalFields : []
110
+ ]
111
+ }
112
+ ]
113
+ });
114
+ }
115
+ return {
116
+ slug: 'navigation',
117
+ typescript: {
118
+ interface: 'Navigation'
119
+ },
120
+ graphQL: {
121
+ name: 'Navigation'
122
+ },
123
+ access: {
124
+ read: ()=>true
125
+ },
126
+ fields: [
127
+ {
128
+ type: 'tabs',
129
+ tabs: [
130
+ ...tabs,
131
+ ...config?.additionalTabs ? config.additionalTabs : []
132
+ ]
133
+ }
134
+ ]
135
+ };
136
+ };
137
+
138
+ //# sourceMappingURL=Navigation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/globals/Navigation.ts"],"sourcesContent":["import type { GlobalConfig, Tab, Field, ArrayField } from 'payload';\n\n/**\n * Navigation Configuration for the header and footer\n * nav links.\n */\ninterface NavigationConfig {\n\tincludeFooter?: boolean;\n\theader?: NavigationMenuConfig;\n\tfooter?: NavigationMenuConfig;\n\tadditionalTabs?: Tab[];\n}\n\n/**\n * Navigation Menu Configuration defines the config for an\n * individual navigation menu, i.e Header or Footer.\n */\ninterface NavigationMenuConfig {\n\tmaxDepth?: number;\n\tadditionalFields?: Field[];\n}\n\n/**\n * Function to generate children structure recursively.\n *\n * @param depth Current depth\n * @param maxDepth Maximum depth to generate children\n * @param fields Fields to include at each level\n */\nconst generateChildren = (depth: number, maxDepth: number, fields: Field[]): Field[] => {\n\tif (depth >= maxDepth) {\n\t\treturn [];\n\t}\n\n\t// Only generate children if depth is less than maxDepth\n\tif (depth < maxDepth - 1) {\n\t\treturn [\n\t\t\t{\n\t\t\t\tname: 'children',\n\t\t\t\ttype: 'array',\n\t\t\t\tlabel: `Children Level ${depth + 1}`,\n\t\t\t\tfields: [...fields, ...generateChildren(depth + 1, maxDepth, fields)],\n\t\t\t},\n\t\t];\n\t}\n\n\treturn [];\n};\n\n/**\n * The default navigation field links.\n */\nconst navFields: Field[] = [\n\t{\n\t\ttype: 'row',\n\t\tfields: [\n\t\t\t{\n\t\t\t\tname: 'title',\n\t\t\t\ttype: 'text',\n\t\t\t\tlabel: 'Title',\n\t\t\t\trequired: true,\n\t\t\t\tadmin: {\n\t\t\t\t\twidth: '50%',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'url',\n\t\t\t\ttype: 'text',\n\t\t\t\tlabel: 'URL',\n\t\t\t\trequired: true,\n\t\t\t\tadmin: {\n\t\t\t\t\twidth: '50%',\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n];\n\n/**\n * Navigation Global Configuration\n * Additional fields will be appended to each navigation item.\n *\n * @constructor\n * @param config\n */\nexport const Navigation = (config?: NavigationConfig): GlobalConfig => {\n\tconst tabs: Tab[] = [\n\t\t{\n\t\t\tlabel: 'Header',\n\t\t\tfields: [\n\t\t\t\t{\n\t\t\t\t\tname: 'header',\n\t\t\t\t\ttype: 'array',\n\t\t\t\t\tlabel: 'Items',\n\t\t\t\t\tinterfaceName: 'NavigationHeaderLinks',\n\t\t\t\t\tmaxRows: 8,\n\t\t\t\t\tlabels: {\n\t\t\t\t\t\tsingular: 'Link',\n\t\t\t\t\t\tplural: 'Links',\n\t\t\t\t\t},\n\t\t\t\t\tadmin: {\n\t\t\t\t\t\tinitCollapsed: true,\n\t\t\t\t\t\tisSortable: true,\n\t\t\t\t\t},\n\t\t\t\t\tfields: [\n\t\t\t\t\t\t...navFields,\n\t\t\t\t\t\t...(config?.header?.maxDepth\n\t\t\t\t\t\t\t? generateChildren(0, config.header.maxDepth, navFields)\n\t\t\t\t\t\t\t: []),\n\t\t\t\t\t\t...(config?.header?.additionalFields ? config.header.additionalFields : []),\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t],\n\t\t} as ArrayField,\n\t];\n\n\tif (config?.includeFooter) {\n\t\ttabs.push({\n\t\t\tlabel: 'Footer',\n\t\t\tfields: [\n\t\t\t\t{\n\t\t\t\t\tname: 'footer',\n\t\t\t\t\ttype: 'array',\n\t\t\t\t\tlabel: 'Items',\n\t\t\t\t\tinterfaceName: 'NavigationFooterLinks',\n\t\t\t\t\tmaxRows: 8,\n\t\t\t\t\tlabels: {\n\t\t\t\t\t\tsingular: 'Link',\n\t\t\t\t\t\tplural: 'Links',\n\t\t\t\t\t},\n\t\t\t\t\tadmin: {\n\t\t\t\t\t\tinitCollapsed: true,\n\t\t\t\t\t\tisSortable: true,\n\t\t\t\t\t},\n\t\t\t\t\tfields: [\n\t\t\t\t\t\t...navFields,\n\t\t\t\t\t\t...(config?.footer?.maxDepth\n\t\t\t\t\t\t\t? generateChildren(0, config.footer.maxDepth, navFields)\n\t\t\t\t\t\t\t: []),\n\t\t\t\t\t\t...(config?.footer?.additionalFields ? config.footer.additionalFields : []),\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t],\n\t\t} as ArrayField);\n\t}\n\n\treturn {\n\t\tslug: 'navigation',\n\t\ttypescript: {\n\t\t\tinterface: 'Navigation',\n\t\t},\n\t\tgraphQL: {\n\t\t\tname: 'Navigation',\n\t\t},\n\t\taccess: {\n\t\t\tread: () => true,\n\t\t},\n\t\tfields: [\n\t\t\t{\n\t\t\t\ttype: 'tabs',\n\t\t\t\ttabs: [...tabs, ...(config?.additionalTabs ? config.additionalTabs : [])],\n\t\t\t},\n\t\t],\n\t};\n};\n"],"names":["generateChildren","depth","maxDepth","fields","name","type","label","navFields","required","admin","width","Navigation","config","tabs","interfaceName","maxRows","labels","singular","plural","initCollapsed","isSortable","header","additionalFields","includeFooter","push","footer","slug","typescript","interface","graphQL","access","read","additionalTabs"],"mappings":"AAsBA;;;;;;CAMC,GACD,MAAMA,mBAAmB,CAACC,OAAeC,UAAkBC;IAC1D,IAAIF,SAASC,UAAU;QACtB,OAAO,EAAE;IACV;IAEA,wDAAwD;IACxD,IAAID,QAAQC,WAAW,GAAG;QACzB,OAAO;YACN;gBACCE,MAAM;gBACNC,MAAM;gBACNC,OAAO,CAAC,eAAe,EAAEL,QAAQ,EAAE,CAAC;gBACpCE,QAAQ;uBAAIA;uBAAWH,iBAAiBC,QAAQ,GAAGC,UAAUC;iBAAQ;YACtE;SACA;IACF;IAEA,OAAO,EAAE;AACV;AAEA;;CAEC,GACD,MAAMI,YAAqB;IAC1B;QACCF,MAAM;QACNF,QAAQ;YACP;gBACCC,MAAM;gBACNC,MAAM;gBACNC,OAAO;gBACPE,UAAU;gBACVC,OAAO;oBACNC,OAAO;gBACR;YACD;YACA;gBACCN,MAAM;gBACNC,MAAM;gBACNC,OAAO;gBACPE,UAAU;gBACVC,OAAO;oBACNC,OAAO;gBACR;YACD;SACA;IACF;CACA;AAED;;;;;;CAMC,GACD,OAAO,MAAMC,aAAa,CAACC;IAC1B,MAAMC,OAAc;QACnB;YACCP,OAAO;YACPH,QAAQ;gBACP;oBACCC,MAAM;oBACNC,MAAM;oBACNC,OAAO;oBACPQ,eAAe;oBACfC,SAAS;oBACTC,QAAQ;wBACPC,UAAU;wBACVC,QAAQ;oBACT;oBACAT,OAAO;wBACNU,eAAe;wBACfC,YAAY;oBACb;oBACAjB,QAAQ;2BACJI;2BACCK,QAAQS,QAAQnB,WACjBF,iBAAiB,GAAGY,OAAOS,MAAM,CAACnB,QAAQ,EAAEK,aAC5C,EAAE;2BACDK,QAAQS,QAAQC,mBAAmBV,OAAOS,MAAM,CAACC,gBAAgB,GAAG,EAAE;qBAC1E;gBACF;aACA;QACF;KACA;IAED,IAAIV,QAAQW,eAAe;QAC1BV,KAAKW,IAAI,CAAC;YACTlB,OAAO;YACPH,QAAQ;gBACP;oBACCC,MAAM;oBACNC,MAAM;oBACNC,OAAO;oBACPQ,eAAe;oBACfC,SAAS;oBACTC,QAAQ;wBACPC,UAAU;wBACVC,QAAQ;oBACT;oBACAT,OAAO;wBACNU,eAAe;wBACfC,YAAY;oBACb;oBACAjB,QAAQ;2BACJI;2BACCK,QAAQa,QAAQvB,WACjBF,iBAAiB,GAAGY,OAAOa,MAAM,CAACvB,QAAQ,EAAEK,aAC5C,EAAE;2BACDK,QAAQa,QAAQH,mBAAmBV,OAAOa,MAAM,CAACH,gBAAgB,GAAG,EAAE;qBAC1E;gBACF;aACA;QACF;IACD;IAEA,OAAO;QACNI,MAAM;QACNC,YAAY;YACXC,WAAW;QACZ;QACAC,SAAS;YACRzB,MAAM;QACP;QACA0B,QAAQ;YACPC,MAAM,IAAM;QACb;QACA5B,QAAQ;YACP;gBACCE,MAAM;gBACNQ,MAAM;uBAAIA;uBAAUD,QAAQoB,iBAAiBpB,OAAOoB,cAAc,GAAG,EAAE;iBAAE;YAC1E;SACA;IACF;AACD,EAAE"}