@kyro-cms/core 0.9.0 → 0.9.1

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 (248) hide show
  1. package/README.md +57 -589
  2. package/dist/{WebhookService-118ZTFis.d.ts → WebhookService-CUTb9XOy.d.ts} +1 -1
  3. package/dist/{WebhookService-AefJfqX0.d.cts → WebhookService-Yg2UEOB4.d.cts} +1 -1
  4. package/dist/api-handler-graphql.cjs +44 -0
  5. package/dist/api-handler-graphql.cjs.map +1 -0
  6. package/dist/api-handler-graphql.d.cts +6 -0
  7. package/dist/api-handler-graphql.d.ts +6 -0
  8. package/dist/api-handler-graphql.js +41 -0
  9. package/dist/api-handler-graphql.js.map +1 -0
  10. package/dist/api-handler-trpc.cjs +38 -0
  11. package/dist/api-handler-trpc.cjs.map +1 -0
  12. package/dist/api-handler-trpc.d.cts +5 -0
  13. package/dist/api-handler-trpc.d.ts +5 -0
  14. package/dist/api-handler-trpc.js +36 -0
  15. package/dist/api-handler-trpc.js.map +1 -0
  16. package/dist/api-handler.cjs +31 -97
  17. package/dist/api-handler.cjs.map +1 -1
  18. package/dist/api-handler.d.cts +2 -1
  19. package/dist/api-handler.d.ts +2 -1
  20. package/dist/api-handler.js +19 -95
  21. package/dist/api-handler.js.map +1 -1
  22. package/dist/{tenant-B1YB0Jy8.d.ts → base-B71y_EAF.d.cts} +6 -12
  23. package/dist/{tenant-Cpeveji6.d.cts → base-DaqY2GhA.d.ts} +6 -12
  24. package/dist/bootstrap-5NLASFOG.cjs +32 -0
  25. package/dist/{bootstrap-AKAUP6F6.cjs.map → bootstrap-5NLASFOG.cjs.map} +1 -1
  26. package/dist/bootstrap-T5BK77LD.js +7 -0
  27. package/dist/{bootstrap-JCML6NFO.js.map → bootstrap-T5BK77LD.js.map} +1 -1
  28. package/dist/{chunk-35U3FROB.js → chunk-22M4O4ZJ.js} +607 -63
  29. package/dist/chunk-22M4O4ZJ.js.map +1 -0
  30. package/dist/chunk-2HZRBATX.cjs +253 -0
  31. package/dist/chunk-2HZRBATX.cjs.map +1 -0
  32. package/dist/{chunk-VJT6P4N6.cjs → chunk-3HR772HI.cjs} +199 -32
  33. package/dist/chunk-3HR772HI.cjs.map +1 -0
  34. package/dist/chunk-3KTWGODI.cjs +178 -0
  35. package/dist/chunk-3KTWGODI.cjs.map +1 -0
  36. package/dist/{chunk-QXIQWPAP.js → chunk-3UK5XBVJ.js} +4 -134
  37. package/dist/chunk-3UK5XBVJ.js.map +1 -0
  38. package/dist/{chunk-FXYP2HA6.js → chunk-4AO3A3JM.js} +48 -4
  39. package/dist/chunk-4AO3A3JM.js.map +1 -0
  40. package/dist/chunk-4M7X5HAB.cjs +173 -0
  41. package/dist/chunk-4M7X5HAB.cjs.map +1 -0
  42. package/dist/chunk-5EPFQUQD.js +3243 -0
  43. package/dist/chunk-5EPFQUQD.js.map +1 -0
  44. package/dist/{chunk-Y3N7UUDO.js → chunk-7OGPN7MP.js} +5 -2
  45. package/dist/chunk-7OGPN7MP.js.map +1 -0
  46. package/dist/{chunk-WOWUL7ZY.js → chunk-AL5KX63J.js} +4 -3
  47. package/dist/chunk-AL5KX63J.js.map +1 -0
  48. package/dist/{chunk-2OL4O2TH.cjs → chunk-C36TMDTY.cjs} +66 -61
  49. package/dist/chunk-C36TMDTY.cjs.map +1 -0
  50. package/dist/{chunk-ES5HNFFT.js → chunk-CF7OL6HR.js} +4 -2
  51. package/dist/chunk-CF7OL6HR.js.map +1 -0
  52. package/dist/chunk-CJONKRHJ.js +162 -0
  53. package/dist/chunk-CJONKRHJ.js.map +1 -0
  54. package/dist/{chunk-2KVHZE6O.cjs → chunk-COIASRDK.cjs} +202 -46
  55. package/dist/chunk-COIASRDK.cjs.map +1 -0
  56. package/dist/chunk-DEVFAKCQ.cjs +3291 -0
  57. package/dist/chunk-DEVFAKCQ.cjs.map +1 -0
  58. package/dist/{chunk-3ZFYL34R.js → chunk-DYTZ6FQ7.js} +12 -185
  59. package/dist/chunk-DYTZ6FQ7.js.map +1 -0
  60. package/dist/{chunk-QPPDLRNR.js → chunk-EJN2PAOE.js} +197 -41
  61. package/dist/chunk-EJN2PAOE.js.map +1 -0
  62. package/dist/chunk-FAXU7BMP.js +220 -0
  63. package/dist/chunk-FAXU7BMP.js.map +1 -0
  64. package/dist/{chunk-OHVB4AJ7.js → chunk-FOPGUM27.js} +22 -17
  65. package/dist/chunk-FOPGUM27.js.map +1 -0
  66. package/dist/chunk-GAOXD3XT.js +175 -0
  67. package/dist/chunk-GAOXD3XT.js.map +1 -0
  68. package/dist/{chunk-4DA7QPLA.cjs → chunk-GXFOGU7N.cjs} +5 -2
  69. package/dist/chunk-GXFOGU7N.cjs.map +1 -0
  70. package/dist/{chunk-I7HHI6QV.cjs → chunk-IDVRRRAK.cjs} +17 -9
  71. package/dist/chunk-IDVRRRAK.cjs.map +1 -0
  72. package/dist/{chunk-WQBRWOQT.cjs → chunk-JOPVMWTM.cjs} +3 -2
  73. package/dist/chunk-JOPVMWTM.cjs.map +1 -0
  74. package/dist/chunk-KC2GDBLS.cjs +84 -0
  75. package/dist/chunk-KC2GDBLS.cjs.map +1 -0
  76. package/dist/{chunk-K7JPTH3G.cjs → chunk-KNRSROWB.cjs} +132 -74
  77. package/dist/chunk-KNRSROWB.cjs.map +1 -0
  78. package/dist/{chunk-3AJE4SEG.js → chunk-KPA4AN4R.js} +125 -67
  79. package/dist/chunk-KPA4AN4R.js.map +1 -0
  80. package/dist/{chunk-QUW2RZTM.cjs → chunk-L46ROHUS.cjs} +51 -7
  81. package/dist/chunk-L46ROHUS.cjs.map +1 -0
  82. package/dist/chunk-L4EZKIEX.js +185 -0
  83. package/dist/chunk-L4EZKIEX.js.map +1 -0
  84. package/dist/{chunk-REK7AYOC.js → chunk-L5UKKZQN.js} +199 -32
  85. package/dist/chunk-L5UKKZQN.js.map +1 -0
  86. package/dist/chunk-NKPKR5BW.cjs +188 -0
  87. package/dist/chunk-NKPKR5BW.cjs.map +1 -0
  88. package/dist/{chunk-Y3QQN7PN.js → chunk-P2HKJ7P5.js} +13 -4
  89. package/dist/chunk-P2HKJ7P5.js.map +1 -0
  90. package/dist/{chunk-SA7NSSIQ.cjs → chunk-PI73NNOK.cjs} +13 -187
  91. package/dist/chunk-PI73NNOK.cjs.map +1 -0
  92. package/dist/{chunk-HXRD4B37.js → chunk-PU2Z5VWF.js} +1279 -556
  93. package/dist/chunk-PU2Z5VWF.js.map +1 -0
  94. package/dist/{chunk-H727JIG7.js → chunk-Q72BOAPK.js} +16 -8
  95. package/dist/chunk-Q72BOAPK.js.map +1 -0
  96. package/dist/{chunk-IBG6V56E.cjs → chunk-QFLB4EIJ.cjs} +2 -139
  97. package/dist/chunk-QFLB4EIJ.cjs.map +1 -0
  98. package/dist/{chunk-YVUJBEXE.cjs → chunk-RAMGUDJN.cjs} +16 -7
  99. package/dist/chunk-RAMGUDJN.cjs.map +1 -0
  100. package/dist/{chunk-LINKCEG4.cjs → chunk-ROJHKAQ4.cjs} +617 -73
  101. package/dist/chunk-ROJHKAQ4.cjs.map +1 -0
  102. package/dist/{chunk-5KVM3WEY.cjs → chunk-RSF3UU7H.cjs} +1330 -602
  103. package/dist/chunk-RSF3UU7H.cjs.map +1 -0
  104. package/dist/{chunk-V3LKPM3O.cjs → chunk-SHTTJMLT.cjs} +4 -2
  105. package/dist/chunk-SHTTJMLT.cjs.map +1 -0
  106. package/dist/chunk-SPBTLUN6.js +92 -0
  107. package/dist/chunk-SPBTLUN6.js.map +1 -0
  108. package/dist/{chunk-57P6MJKC.js → chunk-TXSZFA4G.js} +3 -3
  109. package/dist/chunk-TXSZFA4G.js.map +1 -0
  110. package/dist/chunk-UERVXYVK.cjs +99 -0
  111. package/dist/chunk-UERVXYVK.cjs.map +1 -0
  112. package/dist/{chunk-PDYFVNUX.cjs → chunk-V2TVSCV5.cjs} +16 -23
  113. package/dist/chunk-V2TVSCV5.cjs.map +1 -0
  114. package/dist/{chunk-DXHRBMGB.js → chunk-VO35MNPH.js} +12 -19
  115. package/dist/chunk-VO35MNPH.js.map +1 -0
  116. package/dist/{chunk-IA6AU5PI.cjs → chunk-WNCYAKF3.cjs} +3 -3
  117. package/dist/chunk-WNCYAKF3.cjs.map +1 -0
  118. package/dist/chunk-XEB7PH2E.js +81 -0
  119. package/dist/chunk-XEB7PH2E.js.map +1 -0
  120. package/dist/cli/index.cjs +5 -5
  121. package/dist/cli/index.cjs.map +1 -1
  122. package/dist/cli/index.js +5 -5
  123. package/dist/cli/index.js.map +1 -1
  124. package/dist/client.cjs +3 -3
  125. package/dist/client.d.cts +3 -3
  126. package/dist/client.d.ts +3 -3
  127. package/dist/client.js +1 -1
  128. package/dist/drizzle/index.cjs +14 -13
  129. package/dist/drizzle/index.d.cts +9 -7
  130. package/dist/drizzle/index.d.ts +9 -7
  131. package/dist/drizzle/index.js +5 -4
  132. package/dist/fields/index.cjs +21 -37
  133. package/dist/fields/index.d.cts +2 -22
  134. package/dist/fields/index.d.ts +2 -22
  135. package/dist/fields/index.js +1 -1
  136. package/dist/graphql/index.cjs +5 -4
  137. package/dist/graphql/index.d.cts +5 -3
  138. package/dist/graphql/index.d.ts +5 -3
  139. package/dist/graphql/index.js +3 -2
  140. package/dist/index-CJXPB_ot.d.ts +276 -0
  141. package/dist/index-CaTNnLGd.d.cts +276 -0
  142. package/dist/index.cjs +304 -162
  143. package/dist/index.cjs.map +1 -1
  144. package/dist/index.d.cts +129 -205
  145. package/dist/index.d.ts +129 -205
  146. package/dist/index.js +172 -33
  147. package/dist/index.js.map +1 -1
  148. package/dist/integration.cjs +2 -2
  149. package/dist/integration.js +1 -1
  150. package/dist/mongo-auth-adapter-ISOM7FSS.cjs +17 -0
  151. package/dist/{mongo-auth-adapter-NHHUJHVH.cjs.map → mongo-auth-adapter-ISOM7FSS.cjs.map} +1 -1
  152. package/dist/mongo-auth-adapter-MO6STCV3.js +4 -0
  153. package/dist/{mongo-auth-adapter-NJQUUCTP.js.map → mongo-auth-adapter-MO6STCV3.js.map} +1 -1
  154. package/dist/mongodb/index.cjs +8 -7
  155. package/dist/mongodb/index.d.cts +5 -7
  156. package/dist/mongodb/index.d.ts +5 -7
  157. package/dist/mongodb/index.js +4 -3
  158. package/dist/postgres-auth-adapter-DWDR7P5G.js +5 -0
  159. package/dist/{postgres-auth-adapter-3T2NKTSE.js.map → postgres-auth-adapter-DWDR7P5G.js.map} +1 -1
  160. package/dist/postgres-auth-adapter-WRWSJD4E.cjs +14 -0
  161. package/dist/{postgres-auth-adapter-7IEENCKQ.cjs.map → postgres-auth-adapter-WRWSJD4E.cjs.map} +1 -1
  162. package/dist/redis-adapter-HGTPWIGV.js +4 -0
  163. package/dist/{redis-adapter-VQXD7ESY.js.map → redis-adapter-HGTPWIGV.js.map} +1 -1
  164. package/dist/redis-adapter-KJ3YOOT6.cjs +13 -0
  165. package/dist/{redis-adapter-D2E2S3GB.cjs.map → redis-adapter-KJ3YOOT6.cjs.map} +1 -1
  166. package/dist/rest/index.cjs +15 -14
  167. package/dist/rest/index.d.cts +4 -4
  168. package/dist/rest/index.d.ts +4 -4
  169. package/dist/rest/index.js +13 -12
  170. package/dist/{schema-5PHL5IVB.js → schema-6I5OFR4Z.js} +3 -3
  171. package/dist/{schema-5PHL5IVB.js.map → schema-6I5OFR4Z.js.map} +1 -1
  172. package/dist/{schema-37SE2F4B.cjs → schema-TTFE4467.cjs} +14 -14
  173. package/dist/{schema-37SE2F4B.cjs.map → schema-TTFE4467.cjs.map} +1 -1
  174. package/dist/sqlite-adapter-6GEUSVXQ.js +4 -0
  175. package/dist/{sqlite-adapter-TR3U3W6Q.js.map → sqlite-adapter-6GEUSVXQ.js.map} +1 -1
  176. package/dist/sqlite-adapter-CSIZE5SX.cjs +13 -0
  177. package/dist/{sqlite-adapter-LVK5PS4T.cjs.map → sqlite-adapter-CSIZE5SX.cjs.map} +1 -1
  178. package/dist/templates/index.cjs +133 -31
  179. package/dist/templates/index.d.cts +52 -9
  180. package/dist/templates/index.d.ts +52 -9
  181. package/dist/templates/index.js +3 -1
  182. package/dist/trpc/index.cjs +13 -12
  183. package/dist/trpc/index.d.cts +55 -49
  184. package/dist/trpc/index.d.ts +55 -49
  185. package/dist/trpc/index.js +4 -3
  186. package/dist/{types-D6ZLRGbH.d.cts → types-CpjuXbe7.d.cts} +2 -0
  187. package/dist/{types-D6ZLRGbH.d.ts → types-CpjuXbe7.d.ts} +2 -0
  188. package/dist/{types-Bs1up4yP.d.ts → types-CyCQ6SAI.d.ts} +28 -2
  189. package/dist/{types-J3R9nVsZ.d.cts → types-DJxD9394.d.cts} +28 -2
  190. package/dist/{types-VtjUxIMp.d.cts → types-Z6FBiqa2.d.cts} +35 -14
  191. package/dist/{types-VtjUxIMp.d.ts → types-Z6FBiqa2.d.ts} +35 -14
  192. package/package.json +22 -4
  193. package/dist/bootstrap-AKAUP6F6.cjs +0 -32
  194. package/dist/bootstrap-JCML6NFO.js +0 -7
  195. package/dist/chunk-2KVHZE6O.cjs.map +0 -1
  196. package/dist/chunk-2OL4O2TH.cjs.map +0 -1
  197. package/dist/chunk-35U3FROB.js.map +0 -1
  198. package/dist/chunk-3AJE4SEG.js.map +0 -1
  199. package/dist/chunk-3J4MFTI3.js +0 -3872
  200. package/dist/chunk-3J4MFTI3.js.map +0 -1
  201. package/dist/chunk-3ZFYL34R.js.map +0 -1
  202. package/dist/chunk-4DA7QPLA.cjs.map +0 -1
  203. package/dist/chunk-57P6MJKC.js.map +0 -1
  204. package/dist/chunk-5KVM3WEY.cjs.map +0 -1
  205. package/dist/chunk-6IMPH6WV.cjs +0 -3897
  206. package/dist/chunk-6IMPH6WV.cjs.map +0 -1
  207. package/dist/chunk-ATBOUGQP.cjs +0 -513
  208. package/dist/chunk-ATBOUGQP.cjs.map +0 -1
  209. package/dist/chunk-DXHRBMGB.js.map +0 -1
  210. package/dist/chunk-ES5HNFFT.js.map +0 -1
  211. package/dist/chunk-FXYP2HA6.js.map +0 -1
  212. package/dist/chunk-H727JIG7.js.map +0 -1
  213. package/dist/chunk-HXRD4B37.js.map +0 -1
  214. package/dist/chunk-I7HHI6QV.cjs.map +0 -1
  215. package/dist/chunk-IA6AU5PI.cjs.map +0 -1
  216. package/dist/chunk-IBG6V56E.cjs.map +0 -1
  217. package/dist/chunk-K7JPTH3G.cjs.map +0 -1
  218. package/dist/chunk-LINKCEG4.cjs.map +0 -1
  219. package/dist/chunk-OHVB4AJ7.js.map +0 -1
  220. package/dist/chunk-PDYFVNUX.cjs.map +0 -1
  221. package/dist/chunk-Q23JB3KL.js +0 -488
  222. package/dist/chunk-Q23JB3KL.js.map +0 -1
  223. package/dist/chunk-QPPDLRNR.js.map +0 -1
  224. package/dist/chunk-QUW2RZTM.cjs.map +0 -1
  225. package/dist/chunk-QXIQWPAP.js.map +0 -1
  226. package/dist/chunk-R3XIBBAW.cjs +0 -34
  227. package/dist/chunk-R3XIBBAW.cjs.map +0 -1
  228. package/dist/chunk-REK7AYOC.js.map +0 -1
  229. package/dist/chunk-SA7NSSIQ.cjs.map +0 -1
  230. package/dist/chunk-SDMNUYVU.js +0 -30
  231. package/dist/chunk-SDMNUYVU.js.map +0 -1
  232. package/dist/chunk-V3LKPM3O.cjs.map +0 -1
  233. package/dist/chunk-VJT6P4N6.cjs.map +0 -1
  234. package/dist/chunk-WOWUL7ZY.js.map +0 -1
  235. package/dist/chunk-WQBRWOQT.cjs.map +0 -1
  236. package/dist/chunk-Y3N7UUDO.js.map +0 -1
  237. package/dist/chunk-Y3QQN7PN.js.map +0 -1
  238. package/dist/chunk-YVUJBEXE.cjs.map +0 -1
  239. package/dist/index-CLp-DRKA.d.ts +0 -64
  240. package/dist/index-DfO7G4kN.d.cts +0 -64
  241. package/dist/mongo-auth-adapter-NHHUJHVH.cjs +0 -17
  242. package/dist/mongo-auth-adapter-NJQUUCTP.js +0 -4
  243. package/dist/postgres-auth-adapter-3T2NKTSE.js +0 -5
  244. package/dist/postgres-auth-adapter-7IEENCKQ.cjs +0 -14
  245. package/dist/redis-adapter-D2E2S3GB.cjs +0 -13
  246. package/dist/redis-adapter-VQXD7ESY.js +0 -4
  247. package/dist/sqlite-adapter-LVK5PS4T.cjs +0 -13
  248. package/dist/sqlite-adapter-TR3U3W6Q.js +0 -4
@@ -1,3872 +0,0 @@
1
- // src/templates/minimal.ts
2
- var minimalCollections = {
3
- posts: {
4
- slug: "posts",
5
- label: "Posts",
6
- labelPlural: "Posts",
7
- singularLabel: "Post",
8
- admin: {
9
- useAsTitle: "title",
10
- defaultColumns: ["title", "createdAt", "updatedAt"],
11
- description: "Blog posts"
12
- },
13
- fields: [
14
- { name: "title", type: "text", required: true, label: "Title" },
15
- { name: "content", type: "richtext", label: "Content" }
16
- ],
17
- timestamps: true
18
- }
19
- };
20
-
21
- // src/templates/starter.ts
22
- var starterCollections = {
23
- pages: {
24
- slug: "pages",
25
- label: "Pages",
26
- labelPlural: "Pages",
27
- singularLabel: "Page",
28
- admin: {
29
- useAsTitle: "title",
30
- defaultColumns: ["title", "slug", "status", "updatedAt"],
31
- description: "Static pages"
32
- },
33
- fields: [
34
- {
35
- name: "mainTabs",
36
- type: "tabs",
37
- tabs: [
38
- {
39
- label: "Content",
40
- fields: [
41
- {
42
- name: "title",
43
- type: "text",
44
- required: true,
45
- label: "Title",
46
- admin: {
47
- description: "The main title of the page as it will appear publicly."
48
- }
49
- },
50
- {
51
- name: "content",
52
- type: "richtext",
53
- label: "Content"
54
- }
55
- ]
56
- },
57
- {
58
- label: "Meta",
59
- fields: []
60
- },
61
- {
62
- label: "SEO",
63
- fields: [
64
- {
65
- name: "metaTitle",
66
- type: "text",
67
- label: "Meta Title",
68
- admin: { autoGenerate: "title" }
69
- },
70
- {
71
- name: "metaDescription",
72
- type: "textarea",
73
- label: "Meta Description",
74
- admin: { autoGenerate: "content" }
75
- },
76
- {
77
- name: "ogImage",
78
- type: "upload",
79
- label: "OG Image",
80
- relationTo: "media"
81
- }
82
- ]
83
- }
84
- ]
85
- },
86
- {
87
- name: "slug",
88
- type: "text",
89
- required: true,
90
- label: "Slug",
91
- admin: { position: "sidebar", autoGenerate: "title" }
92
- },
93
- {
94
- name: "status",
95
- type: "select",
96
- label: "Status",
97
- options: [
98
- { label: "Draft", value: "draft" },
99
- { label: "Published", value: "published" }
100
- ],
101
- defaultValue: "draft",
102
- admin: { position: "sidebar" }
103
- },
104
- {
105
- name: "featuredImage",
106
- type: "upload",
107
- label: "Featured Image",
108
- relationTo: "media",
109
- admin: { position: "sidebar" }
110
- }
111
- ],
112
- timestamps: true
113
- },
114
- posts: {
115
- slug: "posts",
116
- label: "Posts",
117
- labelPlural: "Posts",
118
- singularLabel: "Post",
119
- admin: {
120
- useAsTitle: "title",
121
- defaultColumns: ["title", "slug", "status", "createdAt", "updatedAt"],
122
- description: "Blog posts and articles"
123
- },
124
- fields: [
125
- {
126
- name: "mainTabs",
127
- type: "tabs",
128
- tabs: [
129
- {
130
- label: "Content",
131
- fields: [
132
- {
133
- name: "title",
134
- type: "text",
135
- required: true,
136
- label: "Title",
137
- admin: {
138
- description: "The main title of the post as it will appear publicly."
139
- }
140
- },
141
- {
142
- name: "content",
143
- type: "richtext",
144
- label: "Content"
145
- }
146
- ]
147
- },
148
- {
149
- label: "Meta",
150
- fields: [
151
- {
152
- name: "category",
153
- type: "relationship",
154
- label: "Category",
155
- relationTo: "categories",
156
- admin: {
157
- description: "Select the primary category this post belongs to."
158
- }
159
- },
160
- {
161
- name: "relatedPosts",
162
- type: "array",
163
- label: "Related Posts",
164
- fields: [
165
- {
166
- name: "post",
167
- type: "relationship",
168
- relationTo: "posts",
169
- label: "Post"
170
- }
171
- ],
172
- admin: { description: "Select posts related to this one." }
173
- }
174
- ]
175
- },
176
- {
177
- label: "SEO",
178
- fields: [
179
- {
180
- name: "metaTitle",
181
- type: "text",
182
- label: "Meta Title",
183
- admin: {
184
- autoGenerate: "title",
185
- description: "The title used for SEO and social sharing (recommended < 60 chars)."
186
- }
187
- },
188
- {
189
- name: "metaDescription",
190
- type: "textarea",
191
- label: "Meta Description",
192
- admin: {
193
- autoGenerate: "content",
194
- description: "A brief summary for search engines (recommended < 160 chars)."
195
- }
196
- },
197
- {
198
- name: "ogImage",
199
- type: "upload",
200
- label: "OG Image",
201
- relationTo: "media",
202
- admin: {
203
- description: "The image shown when the post is shared on social media."
204
- }
205
- }
206
- ]
207
- }
208
- ]
209
- },
210
- {
211
- name: "slug",
212
- type: "text",
213
- required: true,
214
- label: "Slug",
215
- admin: {
216
- description: "The URL-friendly identifier for the post.",
217
- position: "sidebar",
218
- autoGenerate: "title"
219
- }
220
- },
221
- {
222
- name: "authors",
223
- type: "array",
224
- label: "Authors",
225
- fields: [
226
- {
227
- name: "user",
228
- type: "relationship",
229
- label: "User",
230
- relationTo: "users"
231
- }
232
- ],
233
- admin: {
234
- description: "Select one or more authors for this post.",
235
- position: "sidebar"
236
- }
237
- },
238
- {
239
- name: "featuredImage",
240
- type: "upload",
241
- label: "Featured Image",
242
- relationTo: "media",
243
- admin: {
244
- description: "The primary visual used to represent this post.",
245
- position: "sidebar"
246
- }
247
- },
248
- {
249
- name: "status",
250
- type: "select",
251
- label: "Status",
252
- options: [
253
- { label: "Draft", value: "draft" },
254
- { label: "Published", value: "published" }
255
- ],
256
- defaultValue: "draft",
257
- admin: { position: "sidebar" }
258
- }
259
- ],
260
- timestamps: true
261
- },
262
- categories: {
263
- slug: "categories",
264
- label: "Categories",
265
- labelPlural: "Categories",
266
- singularLabel: "Category",
267
- admin: {
268
- useAsTitle: "name",
269
- defaultColumns: ["name", "slug"],
270
- description: "Post categories",
271
- layout: "split"
272
- },
273
- fields: [
274
- { name: "name", type: "text", required: true, label: "Name" },
275
- {
276
- name: "description",
277
- type: "textarea",
278
- label: "Description"
279
- },
280
- {
281
- name: "slug",
282
- type: "text",
283
- required: true,
284
- label: "Slug",
285
- admin: { position: "sidebar", autoGenerate: "name" }
286
- },
287
- {
288
- name: "icon",
289
- type: "upload",
290
- label: "Icon",
291
- relationTo: "media",
292
- admin: { position: "sidebar" }
293
- },
294
- {
295
- name: "parent",
296
- type: "relationship",
297
- label: "Parent Category",
298
- relationTo: "categories",
299
- admin: { position: "sidebar" }
300
- },
301
- {
302
- name: "order",
303
- type: "number",
304
- label: "Order",
305
- defaultValue: 0,
306
- admin: { position: "sidebar" }
307
- }
308
- ],
309
- timestamps: true
310
- },
311
- menu: {
312
- slug: "menu",
313
- label: "Menu",
314
- labelPlural: "Menu",
315
- singularLabel: "Menu Item",
316
- admin: {
317
- useAsTitle: "label",
318
- defaultColumns: ["label", "location", "order"],
319
- description: "Navigation menus",
320
- layout: "split"
321
- },
322
- fields: [
323
- { name: "label", type: "text", required: true, label: "Label" },
324
- { name: "url", type: "text", label: "URL" },
325
- {
326
- name: "linkTo",
327
- type: "relationship",
328
- label: "Link To",
329
- relationTo: ["pages", "posts"]
330
- },
331
- {
332
- name: "parent",
333
- type: "relationship",
334
- label: "Parent Item",
335
- relationTo: "menu",
336
- admin: {
337
- condition: (data) => !!data?.location,
338
- position: "sidebar"
339
- }
340
- },
341
- {
342
- name: "icon",
343
- type: "upload",
344
- label: "Icon",
345
- relationTo: "media",
346
- admin: { position: "sidebar" }
347
- },
348
- {
349
- name: "linkType",
350
- type: "select",
351
- label: "Link Type",
352
- options: [
353
- { label: "Page", value: "page" },
354
- { label: "Post", value: "post" },
355
- { label: "Category", value: "category" }
356
- ],
357
- defaultValue: ""
358
- },
359
- {
360
- name: "page",
361
- type: "relationship",
362
- label: "Page",
363
- relationTo: "pages",
364
- admin: {
365
- condition: (_, current) => current?.linkType === "page"
366
- }
367
- },
368
- {
369
- name: "post",
370
- type: "relationship",
371
- label: "Post",
372
- relationTo: "posts",
373
- admin: {
374
- condition: (_, current) => current?.linkType === "post"
375
- }
376
- },
377
- {
378
- name: "category",
379
- type: "relationship",
380
- label: "Category",
381
- relationTo: "categories",
382
- admin: {
383
- condition: (_, current) => current?.linkType === "category"
384
- }
385
- },
386
- {
387
- name: "location",
388
- type: "select",
389
- label: "Location",
390
- options: [
391
- { label: "Primary", value: "primary" },
392
- { label: "Secondary", value: "secondary" },
393
- { label: "Tertiary", value: "tertiary" },
394
- { label: "Footer", value: "footer" },
395
- { label: "Mobile", value: "mobile" }
396
- ],
397
- defaultValue: "primary",
398
- admin: { position: "sidebar" }
399
- },
400
- {
401
- name: "order",
402
- type: "number",
403
- label: "Order",
404
- defaultValue: 0,
405
- admin: { position: "sidebar" }
406
- }
407
- ],
408
- timestamps: true
409
- }
410
- };
411
-
412
- // src/templates/blog.ts
413
- var blogCollections = {
414
- pages: {
415
- slug: "pages",
416
- label: "Pages",
417
- labelPlural: "Pages",
418
- singularLabel: "Page",
419
- admin: {
420
- useAsTitle: "title",
421
- defaultColumns: ["title", "slug", "status", "updatedAt"],
422
- description: "Static pages"
423
- },
424
- fields: [
425
- {
426
- name: "mainTabs",
427
- type: "tabs",
428
- tabs: [
429
- {
430
- label: "Content",
431
- fields: [
432
- {
433
- name: "title",
434
- type: "text",
435
- required: true,
436
- label: "Title",
437
- admin: {
438
- description: "The main title of the page as it will appear publicly."
439
- }
440
- },
441
- {
442
- name: "content",
443
- type: "richtext",
444
- label: "Content"
445
- }
446
- ]
447
- },
448
- {
449
- label: "Meta",
450
- fields: []
451
- },
452
- {
453
- label: "SEO",
454
- fields: [
455
- {
456
- name: "metaTitle",
457
- type: "text",
458
- label: "Meta Title",
459
- admin: { autoGenerate: "title" }
460
- },
461
- {
462
- name: "metaDescription",
463
- type: "textarea",
464
- label: "Meta Description",
465
- admin: { autoGenerate: "content" }
466
- },
467
- {
468
- name: "ogImage",
469
- type: "upload",
470
- label: "OG Image",
471
- relationTo: "media"
472
- }
473
- ]
474
- }
475
- ]
476
- },
477
- {
478
- name: "slug",
479
- type: "text",
480
- required: true,
481
- label: "Slug",
482
- admin: { position: "sidebar", autoGenerate: "title" }
483
- },
484
- {
485
- name: "status",
486
- type: "select",
487
- label: "Status",
488
- options: [
489
- { label: "Draft", value: "draft" },
490
- { label: "Published", value: "published" }
491
- ],
492
- defaultValue: "draft",
493
- admin: { position: "sidebar" }
494
- },
495
- {
496
- name: "featuredImage",
497
- type: "upload",
498
- label: "Featured Image",
499
- relationTo: "media",
500
- admin: { position: "sidebar" }
501
- }
502
- ],
503
- timestamps: true
504
- },
505
- posts: {
506
- slug: "posts",
507
- label: "Posts",
508
- labelPlural: "Posts",
509
- singularLabel: "Post",
510
- admin: {
511
- useAsTitle: "title",
512
- defaultColumns: ["title", "slug", "status", "createdAt", "updatedAt"],
513
- description: "Blog posts and articles"
514
- },
515
- fields: [
516
- {
517
- name: "mainTabs",
518
- type: "tabs",
519
- tabs: [
520
- {
521
- label: "Content",
522
- fields: [
523
- {
524
- name: "title",
525
- type: "text",
526
- required: true,
527
- label: "Title",
528
- admin: {
529
- description: "The main title of the post as it will appear publicly."
530
- }
531
- },
532
- {
533
- name: "content",
534
- type: "richtext",
535
- label: "Content",
536
- admin: {
537
- description: "The comprehensive body content of the blog post."
538
- }
539
- }
540
- ]
541
- },
542
- {
543
- label: "Meta",
544
- fields: [
545
- {
546
- name: "category",
547
- type: "relationship-block",
548
- label: "Category",
549
- relationTo: "categories",
550
- admin: {
551
- description: "Select the primary category this post belongs to."
552
- }
553
- },
554
- {
555
- name: "relatedPosts",
556
- type: "relationship-block",
557
- label: "Related Posts",
558
- relationTo: "posts",
559
- hasMany: true,
560
- admin: { description: "Select posts related to this one." }
561
- }
562
- ]
563
- },
564
- {
565
- label: "SEO",
566
- fields: [
567
- {
568
- name: "metaTitle",
569
- type: "text",
570
- label: "Meta Title",
571
- admin: {
572
- autoGenerate: "title",
573
- description: "The title used for SEO and social sharing (recommended < 60 chars)."
574
- }
575
- },
576
- {
577
- name: "metaDescription",
578
- type: "textarea",
579
- label: "Meta Description",
580
- defaultValue: "",
581
- admin: {
582
- autoGenerate: "content",
583
- description: "A brief summary for search engines (recommended < 160 chars)."
584
- }
585
- },
586
- {
587
- name: "ogImage",
588
- type: "upload",
589
- label: "OG Image",
590
- relationTo: "media",
591
- admin: {
592
- description: "The image shown when the post is shared on social media."
593
- }
594
- }
595
- ]
596
- }
597
- ]
598
- },
599
- {
600
- name: "slug",
601
- type: "text",
602
- required: true,
603
- label: "Slug",
604
- admin: {
605
- description: "The URL-friendly identifier for the post.",
606
- position: "sidebar",
607
- autoGenerate: "title"
608
- }
609
- },
610
- {
611
- name: "authors",
612
- type: "relationship-block",
613
- label: "Authors",
614
- relationTo: "users",
615
- hasMany: true,
616
- admin: {
617
- description: "Select one or more authors for this post.",
618
- position: "sidebar"
619
- }
620
- },
621
- {
622
- name: "featuredImage",
623
- type: "upload",
624
- label: "Featured Image",
625
- relationTo: "media",
626
- admin: {
627
- description: "The primary visual used to represent this post.",
628
- position: "sidebar"
629
- }
630
- },
631
- {
632
- name: "tags",
633
- type: "list",
634
- label: "Tags",
635
- admin: {
636
- description: "Add keywords to help categorize your post.",
637
- position: "sidebar"
638
- }
639
- },
640
- {
641
- name: "status",
642
- type: "select",
643
- label: "Status",
644
- options: [
645
- { label: "Draft", value: "draft" },
646
- { label: "Published", value: "published" }
647
- ],
648
- defaultValue: "draft",
649
- admin: { position: "sidebar" }
650
- }
651
- ],
652
- timestamps: true
653
- },
654
- categories: {
655
- slug: "categories",
656
- label: "Categories",
657
- labelPlural: "Categories",
658
- singularLabel: "Category",
659
- admin: {
660
- useAsTitle: "name",
661
- defaultColumns: ["name", "slug"],
662
- description: "Post categories",
663
- layout: "split"
664
- },
665
- fields: [
666
- { name: "name", type: "text", required: true, label: "Name" },
667
- {
668
- name: "description",
669
- type: "textarea",
670
- label: "Description"
671
- },
672
- {
673
- name: "slug",
674
- type: "text",
675
- required: true,
676
- label: "Slug",
677
- admin: { position: "sidebar", autoGenerate: "name" }
678
- },
679
- {
680
- name: "icon",
681
- type: "upload",
682
- label: "Icon",
683
- relationTo: "media",
684
- admin: { position: "sidebar" }
685
- },
686
- {
687
- name: "parent",
688
- type: "relationship",
689
- label: "Parent Category",
690
- relationTo: "categories",
691
- admin: { position: "sidebar" }
692
- },
693
- {
694
- name: "order",
695
- type: "number",
696
- label: "Order",
697
- defaultValue: 0,
698
- admin: { position: "sidebar" }
699
- }
700
- ],
701
- timestamps: true
702
- },
703
- menu: {
704
- slug: "menu",
705
- label: "Menu",
706
- labelPlural: "Menu",
707
- singularLabel: "Menu",
708
- admin: {
709
- useAsTitle: "label",
710
- defaultColumns: ["label", "location", "order"],
711
- description: "Menu menus",
712
- layout: "split"
713
- },
714
- fields: [
715
- { name: "label", type: "text", required: true, label: "Label" },
716
- { name: "url", type: "text", label: "URL" },
717
- {
718
- name: "linkTo",
719
- type: "relationship",
720
- label: "Link To",
721
- relationTo: ["pages", "posts"]
722
- },
723
- {
724
- name: "parent",
725
- type: "relationship",
726
- label: "Parent Item",
727
- relationTo: "menu",
728
- admin: { position: "sidebar" }
729
- },
730
- {
731
- name: "icon",
732
- type: "upload",
733
- label: "Icon",
734
- relationTo: "media",
735
- admin: { position: "sidebar" }
736
- },
737
- {
738
- name: "location",
739
- type: "select",
740
- label: "Location",
741
- options: [
742
- { label: "Primary", value: "primary" },
743
- { label: "Secondary", value: "secondary" },
744
- { label: "Tertiary", value: "tertiary" },
745
- { label: "Footer", value: "footer" },
746
- { label: "Mobile", value: "mobile" }
747
- ],
748
- defaultValue: "primary",
749
- admin: { position: "sidebar" }
750
- },
751
- {
752
- name: "order",
753
- type: "number",
754
- label: "Order",
755
- defaultValue: 0,
756
- admin: { position: "sidebar" }
757
- }
758
- ],
759
- timestamps: true
760
- }
761
- };
762
- var blogGlobals = [];
763
-
764
- // src/templates/ecommerce.ts
765
- var ecommerceCollections = {
766
- pages: {
767
- slug: "pages",
768
- label: "Pages",
769
- labelPlural: "Pages",
770
- singularLabel: "Page",
771
- admin: {
772
- useAsTitle: "title",
773
- defaultColumns: ["title", "slug", "status", "updatedAt"],
774
- description: "Static pages"
775
- },
776
- fields: [
777
- {
778
- name: "mainTabs",
779
- type: "tabs",
780
- tabs: [
781
- {
782
- label: "Content",
783
- fields: [
784
- { name: "title", type: "text", required: true, label: "Title" },
785
- {
786
- name: "content",
787
- type: "blocks",
788
- label: "Content",
789
- blocks: [
790
- {
791
- slug: "hero",
792
- label: "Hero Section",
793
- fields: [
794
- { name: "heading", type: "text", label: "Heading" },
795
- {
796
- name: "subheading",
797
- type: "richtext",
798
- label: "Subheading"
799
- },
800
- {
801
- name: "ctaText",
802
- type: "text",
803
- label: "CTA Button Text"
804
- },
805
- { name: "ctaUrl", type: "text", label: "CTA Button URL" }
806
- ]
807
- },
808
- {
809
- slug: "text",
810
- label: "Text Block",
811
- fields: [
812
- { name: "content", type: "richtext", label: "Content" }
813
- ]
814
- },
815
- {
816
- slug: "image",
817
- label: "Image",
818
- fields: [
819
- {
820
- name: "image",
821
- type: "upload",
822
- label: "Image",
823
- relationTo: "media"
824
- },
825
- { name: "caption", type: "text", label: "Caption" },
826
- { name: "alt", type: "text", label: "Alt Text" }
827
- ]
828
- },
829
- {
830
- slug: "cta",
831
- label: "Call to Action",
832
- fields: [
833
- { name: "heading", type: "text", label: "Heading" },
834
- {
835
- name: "description",
836
- type: "richtext",
837
- label: "Description"
838
- },
839
- {
840
- name: "buttonText",
841
- type: "text",
842
- label: "Button Text"
843
- },
844
- { name: "buttonUrl", type: "text", label: "Button URL" }
845
- ]
846
- },
847
- {
848
- slug: "section",
849
- label: "Section",
850
- fields: [
851
- {
852
- name: "blocks",
853
- type: "blocks",
854
- label: "Section Blocks",
855
- blocks: [
856
- {
857
- slug: "text",
858
- label: "Text",
859
- fields: [
860
- {
861
- name: "content",
862
- type: "richtext",
863
- label: "Content"
864
- }
865
- ]
866
- },
867
- {
868
- slug: "image",
869
- label: "Image",
870
- fields: [
871
- {
872
- name: "image",
873
- type: "upload",
874
- label: "Image",
875
- relationTo: "media"
876
- },
877
- {
878
- name: "caption",
879
- type: "text",
880
- label: "Caption"
881
- }
882
- ]
883
- }
884
- ]
885
- }
886
- ]
887
- }
888
- ]
889
- }
890
- ]
891
- },
892
- {
893
- label: "Meta",
894
- fields: []
895
- },
896
- {
897
- label: "SEO",
898
- fields: [
899
- {
900
- name: "metaTitle",
901
- type: "text",
902
- label: "Meta Title",
903
- admin: { autoGenerate: "title" }
904
- },
905
- {
906
- name: "metaDescription",
907
- type: "textarea",
908
- label: "Meta Description",
909
- admin: { autoGenerate: "content" }
910
- },
911
- {
912
- name: "ogImage",
913
- type: "upload",
914
- label: "OG Image",
915
- relationTo: "media"
916
- }
917
- ]
918
- }
919
- ]
920
- },
921
- {
922
- name: "slug",
923
- type: "text",
924
- required: true,
925
- label: "Slug",
926
- admin: { position: "sidebar", autoGenerate: "title" }
927
- },
928
- {
929
- name: "status",
930
- type: "select",
931
- label: "Status",
932
- options: [
933
- { label: "Draft", value: "draft" },
934
- { label: "Published", value: "published" }
935
- ],
936
- defaultValue: "draft",
937
- admin: { position: "sidebar" }
938
- },
939
- {
940
- name: "featuredImage",
941
- type: "upload",
942
- label: "Featured Image",
943
- relationTo: "media",
944
- admin: { position: "sidebar" }
945
- }
946
- ],
947
- timestamps: true
948
- },
949
- posts: {
950
- slug: "posts",
951
- label: "Posts",
952
- labelPlural: "Posts",
953
- singularLabel: "Post",
954
- admin: {
955
- useAsTitle: "title",
956
- defaultColumns: ["title", "slug", "status", "createdAt", "updatedAt"],
957
- description: "Blog posts and articles"
958
- },
959
- fields: [
960
- {
961
- name: "mainTabs",
962
- type: "tabs",
963
- tabs: [
964
- {
965
- label: "Content",
966
- fields: [
967
- {
968
- name: "title",
969
- type: "text",
970
- required: true,
971
- label: "Title",
972
- admin: {
973
- description: "The main title of the post as it will appear publicly."
974
- }
975
- },
976
- {
977
- name: "content",
978
- type: "blocks",
979
- label: "Content",
980
- admin: {
981
- description: "The comprehensive body content of the blog post."
982
- },
983
- blocks: [
984
- {
985
- slug: "hero",
986
- label: "Hero Section",
987
- fields: [
988
- { name: "heading", type: "text", label: "Heading" },
989
- {
990
- name: "subheading",
991
- type: "richtext",
992
- label: "Subheading"
993
- },
994
- {
995
- name: "ctaText",
996
- type: "text",
997
- label: "CTA Button Text"
998
- },
999
- { name: "ctaUrl", type: "text", label: "CTA Button URL" }
1000
- ]
1001
- },
1002
- {
1003
- slug: "text",
1004
- label: "Text Block",
1005
- fields: [
1006
- { name: "content", type: "richtext", label: "Content" }
1007
- ]
1008
- },
1009
- {
1010
- slug: "image",
1011
- label: "Image",
1012
- fields: [
1013
- {
1014
- name: "image",
1015
- type: "upload",
1016
- label: "Image",
1017
- relationTo: "media"
1018
- },
1019
- { name: "caption", type: "text", label: "Caption" },
1020
- { name: "alt", type: "text", label: "Alt Text" }
1021
- ]
1022
- },
1023
- {
1024
- slug: "cta",
1025
- label: "Call to Action",
1026
- fields: [
1027
- { name: "heading", type: "text", label: "Heading" },
1028
- {
1029
- name: "description",
1030
- type: "richtext",
1031
- label: "Description"
1032
- },
1033
- {
1034
- name: "buttonText",
1035
- type: "text",
1036
- label: "Button Text"
1037
- },
1038
- { name: "buttonUrl", type: "text", label: "Button URL" }
1039
- ]
1040
- },
1041
- {
1042
- slug: "section",
1043
- label: "Section",
1044
- fields: [
1045
- {
1046
- name: "blocks",
1047
- type: "blocks",
1048
- label: "Section Blocks",
1049
- blocks: [
1050
- {
1051
- slug: "text",
1052
- label: "Text",
1053
- fields: [
1054
- {
1055
- name: "content",
1056
- type: "richtext",
1057
- label: "Content"
1058
- }
1059
- ]
1060
- },
1061
- {
1062
- slug: "image",
1063
- label: "Image",
1064
- fields: [
1065
- {
1066
- name: "image",
1067
- type: "upload",
1068
- label: "Image",
1069
- relationTo: "media"
1070
- },
1071
- {
1072
- name: "caption",
1073
- type: "text",
1074
- label: "Caption"
1075
- }
1076
- ]
1077
- },
1078
- {
1079
- slug: "group",
1080
- label: "Collapsible Group",
1081
- fields: [
1082
- {
1083
- name: "details",
1084
- type: "collapsible",
1085
- label: "Details",
1086
- fields: [
1087
- {
1088
- name: "content",
1089
- type: "richtext",
1090
- label: "Content"
1091
- },
1092
- {
1093
- name: "image",
1094
- type: "upload",
1095
- label: "Image",
1096
- relationTo: "media"
1097
- }
1098
- ]
1099
- }
1100
- ]
1101
- },
1102
- {
1103
- slug: "split",
1104
- label: "Two Columns",
1105
- fields: [
1106
- {
1107
- name: "left",
1108
- type: "row",
1109
- fields: [
1110
- {
1111
- name: "leftContent",
1112
- type: "richtext",
1113
- label: "Left Content"
1114
- }
1115
- ]
1116
- },
1117
- {
1118
- name: "right",
1119
- type: "row",
1120
- fields: [
1121
- {
1122
- name: "rightContent",
1123
- type: "richtext",
1124
- label: "Right Content"
1125
- }
1126
- ]
1127
- }
1128
- ]
1129
- },
1130
- {
1131
- slug: "tabs",
1132
- label: "Tabbed Section",
1133
- fields: [
1134
- {
1135
- name: "sections",
1136
- type: "tabs",
1137
- tabs: [
1138
- {
1139
- label: "Tab 1",
1140
- name: "tab1",
1141
- fields: [
1142
- {
1143
- name: "content",
1144
- type: "richtext",
1145
- label: "Content"
1146
- }
1147
- ]
1148
- },
1149
- {
1150
- label: "Tab 2",
1151
- name: "tab2",
1152
- fields: [
1153
- {
1154
- name: "content",
1155
- type: "richtext",
1156
- label: "Content"
1157
- }
1158
- ]
1159
- },
1160
- {
1161
- label: "Tab 3",
1162
- name: "tab3",
1163
- fields: [
1164
- {
1165
- name: "content",
1166
- type: "richtext",
1167
- label: "Content"
1168
- }
1169
- ]
1170
- }
1171
- ]
1172
- }
1173
- ]
1174
- }
1175
- ]
1176
- }
1177
- ]
1178
- }
1179
- ]
1180
- }
1181
- ]
1182
- },
1183
- {
1184
- label: "Meta",
1185
- fields: [
1186
- {
1187
- name: "category",
1188
- type: "relationship",
1189
- label: "Category",
1190
- relationTo: "categories",
1191
- admin: {
1192
- description: "Select the primary category this post belongs to."
1193
- }
1194
- },
1195
- {
1196
- name: "relatedPosts",
1197
- type: "array",
1198
- label: "Related Posts",
1199
- fields: [
1200
- {
1201
- name: "post",
1202
- type: "relationship",
1203
- relationTo: "posts",
1204
- label: "Post"
1205
- }
1206
- ],
1207
- admin: { description: "Select posts related to this one." }
1208
- }
1209
- ]
1210
- },
1211
- {
1212
- label: "SEO",
1213
- fields: [
1214
- {
1215
- name: "metaTitle",
1216
- type: "text",
1217
- label: "Meta Title",
1218
- admin: {
1219
- autoGenerate: "title",
1220
- description: "The title used for SEO and social sharing (recommended < 60 chars)."
1221
- }
1222
- },
1223
- {
1224
- name: "metaDescription",
1225
- type: "textarea",
1226
- label: "Meta Description",
1227
- admin: {
1228
- autoGenerate: "content",
1229
- description: "A brief summary for search engines (recommended < 160 chars)."
1230
- }
1231
- },
1232
- {
1233
- name: "ogImage",
1234
- type: "upload",
1235
- label: "OG Image",
1236
- relationTo: "media",
1237
- admin: {
1238
- description: "The image shown when the post is shared on social media."
1239
- }
1240
- }
1241
- ]
1242
- }
1243
- ]
1244
- },
1245
- {
1246
- name: "slug",
1247
- type: "text",
1248
- required: true,
1249
- label: "Slug",
1250
- admin: {
1251
- description: "The URL-friendly identifier for the post.",
1252
- position: "sidebar",
1253
- autoGenerate: "title"
1254
- }
1255
- },
1256
- {
1257
- name: "authors",
1258
- type: "array",
1259
- label: "Authors",
1260
- fields: [
1261
- {
1262
- name: "user",
1263
- type: "relationship",
1264
- label: "User",
1265
- relationTo: "users"
1266
- }
1267
- ],
1268
- admin: {
1269
- description: "Select one or more authors for this post.",
1270
- position: "sidebar"
1271
- }
1272
- },
1273
- {
1274
- name: "featuredImage",
1275
- type: "upload",
1276
- label: "Featured Image",
1277
- relationTo: "media",
1278
- admin: {
1279
- description: "The primary visual used to represent this post.",
1280
- position: "sidebar"
1281
- }
1282
- },
1283
- {
1284
- name: "status",
1285
- type: "select",
1286
- label: "Status",
1287
- options: [
1288
- { label: "Draft", value: "draft" },
1289
- { label: "Published", value: "published" }
1290
- ],
1291
- defaultValue: "draft",
1292
- admin: { position: "sidebar" }
1293
- }
1294
- ],
1295
- timestamps: true
1296
- },
1297
- products: {
1298
- slug: "products",
1299
- label: "Products",
1300
- labelPlural: "Products",
1301
- singularLabel: "Product",
1302
- admin: {
1303
- useAsTitle: "title",
1304
- defaultColumns: ["title", "slug", "price", "status", "inventory", "updatedAt"],
1305
- description: "Product catalog"
1306
- },
1307
- fields: [
1308
- { name: "title", type: "text", required: true, label: "Title" },
1309
- {
1310
- name: "slug",
1311
- type: "text",
1312
- required: true,
1313
- label: "Slug",
1314
- admin: { position: "sidebar", autoGenerate: "title" }
1315
- },
1316
- { name: "description", type: "richtext", label: "Description" },
1317
- { name: "price", type: "number", required: true, label: "Price" },
1318
- {
1319
- name: "compareAtPrice",
1320
- type: "number",
1321
- label: "Compare at Price",
1322
- admin: { description: "Original price for sale display" }
1323
- },
1324
- {
1325
- name: "costPrice",
1326
- type: "number",
1327
- label: "Cost Price",
1328
- admin: { description: "For profit calculation" }
1329
- },
1330
- { name: "sku", type: "text", required: true, label: "SKU" },
1331
- { name: "barcode", type: "text", label: "Barcode" },
1332
- {
1333
- name: "status",
1334
- type: "select",
1335
- label: "Status",
1336
- options: [
1337
- { label: "Draft", value: "draft" },
1338
- { label: "Active", value: "active" },
1339
- { label: "Archived", value: "archived" }
1340
- ],
1341
- defaultValue: "draft"
1342
- },
1343
- {
1344
- name: "images",
1345
- type: "array",
1346
- label: "Images",
1347
- fields: [
1348
- { name: "url", type: "text", label: "URL" },
1349
- { name: "alt", type: "text", label: "Alt Text" }
1350
- ]
1351
- },
1352
- {
1353
- name: "category",
1354
- type: "relationship",
1355
- label: "Category",
1356
- relationTo: "categories"
1357
- },
1358
- {
1359
- name: "inventory",
1360
- type: "number",
1361
- label: "Inventory",
1362
- defaultValue: 0
1363
- }
1364
- ],
1365
- timestamps: true
1366
- },
1367
- categories: {
1368
- slug: "categories",
1369
- label: "Categories",
1370
- labelPlural: "Categories",
1371
- singularLabel: "Category",
1372
- admin: {
1373
- useAsTitle: "name",
1374
- defaultColumns: ["name", "slug"],
1375
- description: "Product categories"
1376
- },
1377
- fields: [
1378
- { name: "name", type: "text", required: true, label: "Name" },
1379
- {
1380
- name: "slug",
1381
- type: "text",
1382
- required: true,
1383
- label: "Slug",
1384
- admin: { position: "sidebar", autoGenerate: "name" }
1385
- },
1386
- { name: "description", type: "textarea", label: "Description" },
1387
- { name: "image", type: "text", label: "Image URL" },
1388
- {
1389
- name: "parent",
1390
- type: "relationship",
1391
- label: "Parent Category",
1392
- relationTo: "categories"
1393
- }
1394
- ],
1395
- timestamps: true
1396
- },
1397
- customers: {
1398
- slug: "customers",
1399
- label: "Customers",
1400
- labelPlural: "Customers",
1401
- singularLabel: "Customer",
1402
- admin: {
1403
- useAsTitle: "email",
1404
- defaultColumns: [
1405
- "email",
1406
- "firstName",
1407
- "lastName",
1408
- "createdAt",
1409
- "updatedAt"
1410
- ],
1411
- description: "Customer accounts"
1412
- },
1413
- fields: [
1414
- { name: "email", type: "email", required: true, label: "Email" },
1415
- { name: "firstName", type: "text", label: "First Name" },
1416
- { name: "lastName", type: "text", label: "Last Name" },
1417
- { name: "phone", type: "text", label: "Phone" },
1418
- {
1419
- name: "addresses",
1420
- type: "array",
1421
- label: "Addresses",
1422
- fields: [
1423
- { name: "type", type: "text", label: "Type" },
1424
- { name: "line1", type: "text", label: "Address Line 1" },
1425
- { name: "line2", type: "text", label: "Address Line 2" },
1426
- { name: "city", type: "text", label: "City" },
1427
- { name: "state", type: "text", label: "State" },
1428
- { name: "postalCode", type: "text", label: "Postal Code" },
1429
- { name: "country", type: "text", label: "Country" }
1430
- ]
1431
- },
1432
- {
1433
- name: "status",
1434
- type: "select",
1435
- label: "Status",
1436
- options: [
1437
- { label: "Active", value: "active" },
1438
- { label: "Inactive", value: "inactive" },
1439
- { label: "Banned", value: "banned" }
1440
- ],
1441
- defaultValue: "active"
1442
- },
1443
- {
1444
- name: "slug",
1445
- type: "text",
1446
- required: true,
1447
- label: "Slug",
1448
- admin: { position: "sidebar", autoGenerate: "email" }
1449
- }
1450
- ],
1451
- timestamps: true
1452
- },
1453
- orders: {
1454
- slug: "orders",
1455
- label: "Orders",
1456
- labelPlural: "Orders",
1457
- singularLabel: "Order",
1458
- admin: {
1459
- useAsTitle: "orderNumber",
1460
- defaultColumns: [
1461
- "orderNumber",
1462
- "customer",
1463
- "status",
1464
- "total",
1465
- "createdAt",
1466
- "updatedAt"
1467
- ],
1468
- description: "Customer orders"
1469
- },
1470
- fields: [
1471
- {
1472
- name: "orderNumber",
1473
- type: "text",
1474
- required: true,
1475
- label: "Order Number"
1476
- },
1477
- {
1478
- name: "customer",
1479
- type: "relationship",
1480
- required: true,
1481
- label: "Customer",
1482
- relationTo: "customers"
1483
- },
1484
- {
1485
- name: "status",
1486
- type: "select",
1487
- label: "Status",
1488
- options: [
1489
- { label: "Pending", value: "pending" },
1490
- { label: "Confirmed", value: "confirmed" },
1491
- { label: "Processing", value: "processing" },
1492
- { label: "Shipped", value: "shipped" },
1493
- { label: "Delivered", value: "delivered" },
1494
- { label: "Cancelled", value: "cancelled" },
1495
- { label: "Refunded", value: "refunded" }
1496
- ],
1497
- defaultValue: "pending"
1498
- },
1499
- {
1500
- name: "paymentStatus",
1501
- type: "select",
1502
- label: "Payment Status",
1503
- options: [
1504
- { label: "Pending", value: "pending" },
1505
- { label: "Paid", value: "paid" },
1506
- { label: "Failed", value: "failed" },
1507
- { label: "Refunded", value: "refunded" }
1508
- ],
1509
- defaultValue: "pending"
1510
- },
1511
- {
1512
- name: "items",
1513
- type: "array",
1514
- label: "Items",
1515
- fields: [
1516
- { name: "product", type: "text", label: "Product" },
1517
- { name: "quantity", type: "number", label: "Quantity" },
1518
- { name: "unitPrice", type: "number", label: "Unit Price" },
1519
- { name: "total", type: "number", label: "Total" }
1520
- ]
1521
- },
1522
- { name: "subtotal", type: "number", required: true, label: "Subtotal" },
1523
- { name: "tax", type: "number", label: "Tax" },
1524
- { name: "shipping", type: "number", label: "Shipping" },
1525
- { name: "discount", type: "number", label: "Discount" },
1526
- { name: "total", type: "number", required: true, label: "Total" },
1527
- { name: "notes", type: "richtext", label: "Notes" },
1528
- {
1529
- name: "slug",
1530
- type: "text",
1531
- required: true,
1532
- label: "Slug",
1533
- admin: { position: "sidebar", autoGenerate: "orderNumber" }
1534
- }
1535
- ],
1536
- timestamps: true
1537
- },
1538
- coupons: {
1539
- slug: "coupons",
1540
- label: "Coupons",
1541
- labelPlural: "Coupons",
1542
- singularLabel: "Coupon",
1543
- admin: {
1544
- useAsTitle: "code",
1545
- defaultColumns: ["code", "type", "value", "active", "expiresAt"],
1546
- description: "Discount codes and promotions"
1547
- },
1548
- fields: [
1549
- { name: "code", type: "text", required: true, label: "Code" },
1550
- {
1551
- name: "type",
1552
- type: "select",
1553
- required: true,
1554
- label: "Type",
1555
- options: [
1556
- { label: "Percentage", value: "percentage" },
1557
- { label: "Fixed Amount", value: "fixed" },
1558
- { label: "Free Shipping", value: "freeShipping" }
1559
- ]
1560
- },
1561
- { name: "value", type: "number", label: "Value" },
1562
- { name: "minPurchase", type: "number", label: "Minimum Purchase" },
1563
- { name: "maxDiscount", type: "number", label: "Max Discount" },
1564
- { name: "usageLimit", type: "number", label: "Usage Limit" },
1565
- {
1566
- name: "usedCount",
1567
- type: "number",
1568
- defaultValue: 0,
1569
- label: "Used Count"
1570
- },
1571
- { name: "startsAt", type: "date", label: "Starts At" },
1572
- { name: "expiresAt", type: "date", label: "Expires At" },
1573
- { name: "active", type: "checkbox", defaultValue: true, label: "Active" }
1574
- ],
1575
- timestamps: true
1576
- },
1577
- menu: {
1578
- slug: "menu",
1579
- label: "Menu",
1580
- labelPlural: "Menu",
1581
- singularLabel: "Menu Item",
1582
- admin: {
1583
- useAsTitle: "label",
1584
- defaultColumns: ["label", "location", "order"],
1585
- description: "Navigation Menu"
1586
- },
1587
- fields: [
1588
- { name: "label", type: "text", required: true, label: "Label" },
1589
- { name: "url", type: "text", label: "URL" },
1590
- {
1591
- name: "linkTo",
1592
- type: "relationship",
1593
- label: "Link To",
1594
- relationTo: ["pages", "posts"]
1595
- },
1596
- {
1597
- name: "icon",
1598
- type: "upload",
1599
- label: "Icon",
1600
- relationTo: "media",
1601
- admin: { position: "sidebar" }
1602
- },
1603
- {
1604
- name: "linkType",
1605
- type: "select",
1606
- label: "Link Type",
1607
- options: [
1608
- { label: "Page", value: "page" },
1609
- { label: "Product", value: "product" },
1610
- { label: "Category", value: "category" }
1611
- ],
1612
- defaultValue: "",
1613
- admin: { position: "sidebar" }
1614
- },
1615
- {
1616
- name: "page",
1617
- type: "relationship",
1618
- label: "Page",
1619
- relationTo: "pages",
1620
- admin: {
1621
- condition: (_, current) => current?.linkType === "page",
1622
- position: "sidebar"
1623
- }
1624
- },
1625
- {
1626
- name: "product",
1627
- type: "relationship",
1628
- label: "Product",
1629
- relationTo: "products",
1630
- admin: {
1631
- condition: (_, current) => current?.linkType === "product",
1632
- position: "sidebar"
1633
- }
1634
- },
1635
- {
1636
- name: "category",
1637
- type: "relationship",
1638
- label: "Category",
1639
- relationTo: "categories",
1640
- admin: {
1641
- condition: (_, current) => current?.linkType === "category",
1642
- position: "sidebar"
1643
- }
1644
- },
1645
- {
1646
- name: "location",
1647
- type: "text",
1648
- label: "Location",
1649
- admin: { position: "sidebar" }
1650
- },
1651
- {
1652
- name: "target",
1653
- type: "select",
1654
- label: "Target",
1655
- options: [
1656
- { label: "Same tab", value: "_self" },
1657
- { label: "New tab", value: "_blank" }
1658
- ],
1659
- defaultValue: "_self",
1660
- admin: { position: "sidebar" }
1661
- },
1662
- { name: "order", type: "number", label: "Order" }
1663
- ],
1664
- timestamps: true
1665
- }
1666
- };
1667
- var ecommerceGlobals = [];
1668
-
1669
- // src/templates/kitchen-sink.ts
1670
- var kitchenSinkCollections = {
1671
- pages: {
1672
- slug: "pages",
1673
- label: "Pages",
1674
- labelPlural: "Pages",
1675
- singularLabel: "Page",
1676
- admin: {
1677
- useAsTitle: "title",
1678
- defaultColumns: ["title", "slug", "status", "updatedAt"],
1679
- description: "Static pages with custom layouts"
1680
- },
1681
- fields: [
1682
- {
1683
- name: "title",
1684
- type: "text",
1685
- required: true,
1686
- label: "Title"
1687
- },
1688
- {
1689
- name: "slug",
1690
- type: "text",
1691
- required: true,
1692
- label: "Slug",
1693
- admin: { position: "sidebar", autoGenerate: "title", description: "URL-friendly identifier" }
1694
- },
1695
- {
1696
- name: "content",
1697
- type: "blocks",
1698
- label: "Content",
1699
- blocks: [
1700
- {
1701
- slug: "hero",
1702
- label: "Hero Section",
1703
- fields: [
1704
- { name: "heading", type: "text", label: "Heading" },
1705
- { name: "subheading", type: "richtext", label: "Subheading" },
1706
- { name: "ctaText", type: "text", label: "CTA Button Text" },
1707
- { name: "ctaUrl", type: "text", label: "CTA Button URL" }
1708
- ]
1709
- },
1710
- {
1711
- slug: "text",
1712
- label: "Text Block",
1713
- fields: [{ name: "content", type: "richtext", label: "Content" }]
1714
- },
1715
- {
1716
- slug: "image",
1717
- label: "Image",
1718
- fields: [
1719
- {
1720
- name: "image",
1721
- type: "upload",
1722
- label: "Image",
1723
- relationTo: "media"
1724
- },
1725
- { name: "caption", type: "text", label: "Caption" },
1726
- { name: "alt", type: "text", label: "Alt Text" }
1727
- ]
1728
- },
1729
- {
1730
- slug: "cta",
1731
- label: "Call to Action",
1732
- fields: [
1733
- { name: "heading", type: "text", label: "Heading" },
1734
- { name: "description", type: "richtext", label: "Description" },
1735
- { name: "buttonText", type: "text", label: "Button Text" },
1736
- { name: "buttonUrl", type: "text", label: "Button URL" }
1737
- ]
1738
- }
1739
- ]
1740
- },
1741
- {
1742
- name: "status",
1743
- type: "select",
1744
- label: "Status",
1745
- options: [
1746
- { label: "Draft", value: "draft" },
1747
- { label: "Published", value: "published" }
1748
- ],
1749
- defaultValue: "draft"
1750
- }
1751
- ],
1752
- timestamps: true
1753
- },
1754
- menu: {
1755
- slug: "menu",
1756
- label: "Menu",
1757
- labelPlural: "Menu",
1758
- singularLabel: "Menu Item",
1759
- admin: {
1760
- useAsTitle: "label",
1761
- defaultColumns: ["label", "url", "location"],
1762
- description: "Site Menu"
1763
- },
1764
- fields: [
1765
- { name: "label", type: "text", required: true, label: "Label" },
1766
- { name: "url", type: "text", label: "URL" },
1767
- {
1768
- name: "linkTo",
1769
- type: "relationship",
1770
- label: "Link To",
1771
- relationTo: ["pages", "posts"]
1772
- },
1773
- {
1774
- name: "icon",
1775
- type: "upload",
1776
- label: "Icon",
1777
- relationTo: "media",
1778
- admin: { position: "sidebar" }
1779
- },
1780
- {
1781
- name: "linkType",
1782
- type: "select",
1783
- label: "Link Type",
1784
- options: [
1785
- { label: "Page", value: "page" },
1786
- { label: "Post", value: "post" },
1787
- { label: "Product", value: "product" },
1788
- { label: "Category", value: "category" }
1789
- ],
1790
- defaultValue: "",
1791
- admin: { position: "sidebar" }
1792
- },
1793
- {
1794
- name: "page",
1795
- type: "relationship",
1796
- label: "Page",
1797
- relationTo: "pages",
1798
- admin: {
1799
- condition: (_, current) => current?.linkType === "page",
1800
- position: "sidebar"
1801
- }
1802
- },
1803
- {
1804
- name: "post",
1805
- type: "relationship",
1806
- label: "Post",
1807
- relationTo: "posts",
1808
- admin: {
1809
- condition: (_, current) => current?.linkType === "post",
1810
- position: "sidebar"
1811
- }
1812
- },
1813
- {
1814
- name: "product",
1815
- type: "relationship",
1816
- label: "Product",
1817
- relationTo: "products",
1818
- admin: {
1819
- condition: (_, current) => current?.linkType === "product",
1820
- position: "sidebar"
1821
- }
1822
- },
1823
- {
1824
- name: "category",
1825
- type: "relationship",
1826
- label: "Category",
1827
- relationTo: "categories",
1828
- admin: {
1829
- condition: (_, current) => current?.linkType === "category",
1830
- position: "sidebar"
1831
- }
1832
- },
1833
- {
1834
- name: "location",
1835
- type: "select",
1836
- label: "Location",
1837
- options: [
1838
- { label: "Header", value: "header" },
1839
- { label: "Footer", value: "footer" },
1840
- { label: "Mobile", value: "mobile" }
1841
- ],
1842
- admin: { position: "sidebar" }
1843
- },
1844
- { name: "order", type: "number", label: "Sort Order", defaultValue: 0 },
1845
- {
1846
- name: "parent",
1847
- type: "relationship",
1848
- label: "Parent Item",
1849
- relationTo: "menu",
1850
- admin: { position: "sidebar" }
1851
- },
1852
- {
1853
- name: "newTab",
1854
- type: "checkbox",
1855
- label: "Open in New Tab",
1856
- defaultValue: false
1857
- }
1858
- ],
1859
- timestamps: true
1860
- }
1861
- };
1862
-
1863
- // src/templates/auth.ts
1864
- var usersCollection = {
1865
- slug: "users",
1866
- label: "Users",
1867
- fields: [
1868
- { name: "name", type: "text", label: "Name" },
1869
- { name: "email", type: "email", required: true },
1870
- {
1871
- name: "passwordHash",
1872
- type: "text",
1873
- label: "Password Hash",
1874
- admin: { hidden: true }
1875
- },
1876
- {
1877
- name: "role",
1878
- type: "select",
1879
- options: [
1880
- { label: "Super Admin", value: "super_admin" },
1881
- { label: "Admin", value: "admin" },
1882
- { label: "Editor", value: "editor" },
1883
- { label: "Author", value: "author" },
1884
- { label: "Customer", value: "customer" },
1885
- { label: "Guest", value: "guest" }
1886
- ],
1887
- required: true
1888
- },
1889
- { name: "tenantId", type: "text", label: "Tenant" },
1890
- { name: "emailVerified", type: "checkbox", label: "Email Verified" },
1891
- { name: "locked", type: "checkbox" },
1892
- {
1893
- name: "lastLogin",
1894
- type: "date",
1895
- time: true,
1896
- label: "Last Login",
1897
- admin: { readOnly: true }
1898
- },
1899
- {
1900
- name: "failedLoginAttempts",
1901
- type: "number",
1902
- label: "Failed Login Attempts",
1903
- admin: { readOnly: true }
1904
- }
1905
- ],
1906
- timestamps: true,
1907
- admin: {
1908
- useAsTitle: "email",
1909
- defaultColumns: ["email", "role", "tenantId", "lastLogin"]
1910
- }
1911
- };
1912
- var auditLogsCollection = {
1913
- slug: "audit_logs",
1914
- label: "Audit Logs",
1915
- fields: [
1916
- { name: "action", type: "text", required: true },
1917
- { name: "userId", type: "text", label: "User ID" },
1918
- { name: "userEmail", type: "email", label: "User Email" },
1919
- { name: "role", type: "text" },
1920
- { name: "resource", type: "text", label: "Resource" },
1921
- { name: "ipAddress", type: "text", label: "IP Address" },
1922
- { name: "success", type: "checkbox" },
1923
- {
1924
- name: "timestamp",
1925
- type: "date",
1926
- time: true,
1927
- required: true,
1928
- admin: { readOnly: true }
1929
- }
1930
- ],
1931
- admin: {
1932
- defaultColumns: ["action", "userEmail", "resource", "success", "timestamp"]
1933
- }
1934
- };
1935
- var authCollections = {
1936
- users: usersCollection,
1937
- audit_logs: auditLogsCollection
1938
- };
1939
-
1940
- // src/templates/media.ts
1941
- var mediaCollection = {
1942
- slug: "media",
1943
- label: "Media Library",
1944
- admin: {
1945
- useAsTitle: "title",
1946
- defaultColumns: ["thumbnailUrl", "title", "type", "fileSize", "createdAt"],
1947
- group: "content"
1948
- },
1949
- access: {
1950
- read: () => true,
1951
- create: () => true,
1952
- update: () => true,
1953
- delete: () => true
1954
- },
1955
- fields: [
1956
- {
1957
- name: "title",
1958
- type: "text",
1959
- label: "Title",
1960
- required: true,
1961
- admin: {
1962
- description: "Descriptive title for the file"
1963
- }
1964
- },
1965
- {
1966
- name: "filename",
1967
- type: "text",
1968
- label: "Filename",
1969
- required: true,
1970
- admin: {
1971
- readOnly: true,
1972
- description: "System filename (auto-generated)"
1973
- }
1974
- },
1975
- {
1976
- name: "originalName",
1977
- type: "text",
1978
- label: "Original Name",
1979
- admin: {
1980
- readOnly: true
1981
- }
1982
- },
1983
- {
1984
- name: "alt",
1985
- type: "text",
1986
- label: "Alt Text",
1987
- admin: {
1988
- description: "Alternative text for images (accessibility)"
1989
- }
1990
- },
1991
- {
1992
- name: "caption",
1993
- type: "richtext",
1994
- label: "Caption",
1995
- admin: {
1996
- description: "Optional caption or description"
1997
- }
1998
- },
1999
- {
2000
- name: "type",
2001
- type: "select",
2002
- label: "File Type",
2003
- required: true,
2004
- defaultValue: "document",
2005
- options: [
2006
- { label: "Image", value: "image" },
2007
- { label: "Video", value: "video" },
2008
- { label: "Audio", value: "audio" },
2009
- { label: "Document", value: "document" },
2010
- { label: "Archive", value: "archive" },
2011
- { label: "Other", value: "other" }
2012
- ],
2013
- admin: {
2014
- readOnly: true
2015
- }
2016
- },
2017
- {
2018
- name: "mimeType",
2019
- type: "text",
2020
- label: "MIME Type",
2021
- admin: {
2022
- readOnly: true
2023
- }
2024
- },
2025
- {
2026
- name: "url",
2027
- type: "text",
2028
- label: "URL",
2029
- required: true,
2030
- admin: {
2031
- readOnly: true,
2032
- description: "Public URL of the file"
2033
- }
2034
- },
2035
- {
2036
- name: "thumbnailUrl",
2037
- type: "text",
2038
- label: "Thumbnail URL",
2039
- admin: {
2040
- readOnly: true
2041
- }
2042
- },
2043
- {
2044
- name: "width",
2045
- type: "number",
2046
- label: "Width",
2047
- admin: {
2048
- readOnly: true,
2049
- description: "Width in pixels (for images/videos)"
2050
- }
2051
- },
2052
- {
2053
- name: "height",
2054
- type: "number",
2055
- label: "Height",
2056
- admin: {
2057
- readOnly: true,
2058
- description: "Height in pixels (for images/videos)"
2059
- }
2060
- },
2061
- {
2062
- name: "fileSize",
2063
- type: "number",
2064
- label: "File Size",
2065
- admin: {
2066
- readOnly: true,
2067
- description: "Size in bytes"
2068
- }
2069
- },
2070
- {
2071
- name: "folder",
2072
- type: "text",
2073
- label: "Folder",
2074
- admin: {
2075
- description: "Folder path for organization (e.g., /products, /blog)"
2076
- }
2077
- },
2078
- {
2079
- name: "tags",
2080
- type: "array",
2081
- label: "Tags",
2082
- fields: [
2083
- {
2084
- name: "tag",
2085
- type: "text",
2086
- label: "Tag"
2087
- }
2088
- ]
2089
- },
2090
- {
2091
- name: "focalPoint",
2092
- type: "group",
2093
- label: "Focal Point",
2094
- admin: {
2095
- description: "Point of interest for cropping"
2096
- },
2097
- fields: [
2098
- {
2099
- name: "x",
2100
- type: "number",
2101
- label: "X",
2102
- defaultValue: 50
2103
- },
2104
- {
2105
- name: "y",
2106
- type: "number",
2107
- label: "Y",
2108
- defaultValue: 50
2109
- }
2110
- ]
2111
- },
2112
- {
2113
- name: "metadata",
2114
- type: "json",
2115
- label: "Metadata",
2116
- admin: {
2117
- readOnly: true,
2118
- description: "Additional file metadata (EXIF, etc.)"
2119
- }
2120
- },
2121
- {
2122
- name: "provider",
2123
- type: "select",
2124
- label: "Storage Provider",
2125
- defaultValue: "local",
2126
- options: [
2127
- { label: "Local", value: "local" },
2128
- { label: "AWS S3", value: "s3" },
2129
- { label: "Cloudinary", value: "cloudinary" },
2130
- { label: "Imgix", value: "imgix" }
2131
- ],
2132
- admin: {
2133
- readOnly: true
2134
- }
2135
- },
2136
- {
2137
- name: "status",
2138
- type: "select",
2139
- label: "Status",
2140
- defaultValue: "active",
2141
- options: [
2142
- { label: "Active", value: "active" },
2143
- { label: "Archived", value: "archived" }
2144
- ]
2145
- },
2146
- {
2147
- name: "createdAt",
2148
- type: "date",
2149
- label: "Created",
2150
- admin: {
2151
- readOnly: true
2152
- }
2153
- },
2154
- {
2155
- name: "updatedAt",
2156
- type: "date",
2157
- label: "Last Modified",
2158
- admin: {
2159
- readOnly: true
2160
- }
2161
- }
2162
- ]
2163
- };
2164
- var mediaCollections = [mediaCollection];
2165
-
2166
- // src/templates/settings/site.ts
2167
- var siteSettingsGlobal = {
2168
- slug: "site-settings",
2169
- label: "Site Settings",
2170
- admin: {
2171
- group: "settings"
2172
- },
2173
- access: {
2174
- read: () => true,
2175
- update: () => true
2176
- },
2177
- fields: [
2178
- {
2179
- name: "siteName",
2180
- type: "text",
2181
- label: "Site Name",
2182
- required: true,
2183
- admin: {}
2184
- },
2185
- {
2186
- name: "siteDescription",
2187
- type: "textarea",
2188
- label: "Site Description",
2189
- admin: {
2190
- placeholder: "Enter a brief description of your site for SEO and search results."
2191
- }
2192
- },
2193
- {
2194
- name: "siteLogo",
2195
- type: "upload",
2196
- label: "Site Logo",
2197
- relationTo: "media"
2198
- },
2199
- {
2200
- name: "siteFavicon",
2201
- type: "upload",
2202
- label: "Favicon",
2203
- relationTo: "media"
2204
- },
2205
- {
2206
- name: "siteOgImage",
2207
- type: "upload",
2208
- label: "Default OG Image",
2209
- relationTo: "media"
2210
- },
2211
- {
2212
- name: "siteUrl",
2213
- type: "text",
2214
- label: "Site URL",
2215
- admin: {}
2216
- },
2217
- {
2218
- name: "maintenanceEnabled",
2219
- type: "checkbox",
2220
- label: "Enable Maintenance Mode",
2221
- defaultValue: false,
2222
- admin: {
2223
- description: "When enabled, the public site will show a maintenance page."
2224
- }
2225
- },
2226
- {
2227
- name: "maintenance",
2228
- type: "group",
2229
- label: "Maintenance Configuration",
2230
- admin: {
2231
- condition: (data) => data.maintenanceEnabled === true
2232
- },
2233
- fields: [
2234
- {
2235
- name: "message",
2236
- type: "textarea",
2237
- label: "Maintenance Message",
2238
- admin: {
2239
- placeholder: "We'll be back soon! We're performing scheduled maintenance."
2240
- }
2241
- },
2242
- {
2243
- name: "bypassToken",
2244
- type: "text",
2245
- label: "Bypass Token",
2246
- admin: {
2247
- description: "Append ?bypass=YOUR_TOKEN to URL to view the site while in maintenance mode."
2248
- }
2249
- }
2250
- ]
2251
- },
2252
- {
2253
- name: "enableI18n",
2254
- type: "checkbox",
2255
- label: "Enable Internationalization (i18n)",
2256
- defaultValue: false,
2257
- admin: {
2258
- description: "Enable support for multiple languages."
2259
- }
2260
- },
2261
- {
2262
- name: "i18n",
2263
- type: "group",
2264
- label: "Localization",
2265
- admin: {
2266
- condition: (data) => data.enableI18n === true
2267
- },
2268
- fields: [
2269
- {
2270
- name: "language",
2271
- type: "select",
2272
- label: "Default Language",
2273
- defaultValue: "en",
2274
- options: [
2275
- { label: "English", value: "en" },
2276
- { label: "Spanish", value: "es" },
2277
- { label: "French", value: "fr" },
2278
- { label: "German", value: "de" },
2279
- { label: "Portuguese", value: "pt" },
2280
- { label: "Italian", value: "it" },
2281
- { label: "Dutch", value: "nl" },
2282
- { label: "Russian", value: "ru" },
2283
- { label: "Japanese", value: "ja" },
2284
- { label: "Chinese", value: "zh" },
2285
- { label: "Korean", value: "ko" },
2286
- { label: "Arabic", value: "ar" }
2287
- ]
2288
- },
2289
- {
2290
- name: "timezone",
2291
- type: "text",
2292
- label: "Timezone",
2293
- defaultValue: "UTC"
2294
- }
2295
- ]
2296
- },
2297
- {
2298
- name: "logo",
2299
- type: "group",
2300
- label: "Logo Display Settings",
2301
- fields: [
2302
- {
2303
- name: "width",
2304
- type: "number",
2305
- label: "Max Width (px)"
2306
- },
2307
- {
2308
- name: "height",
2309
- type: "number",
2310
- label: "Max Height (px)"
2311
- },
2312
- {
2313
- name: "altText",
2314
- type: "text",
2315
- label: "Alt Text"
2316
- }
2317
- ]
2318
- },
2319
- {
2320
- name: "analyticsEnabled",
2321
- type: "checkbox",
2322
- label: "Enable Analytics & Tracking",
2323
- defaultValue: false
2324
- },
2325
- {
2326
- name: "analytics",
2327
- type: "group",
2328
- label: "Tracking Configurations",
2329
- admin: {
2330
- condition: (data) => data.analyticsEnabled === true
2331
- },
2332
- fields: [
2333
- {
2334
- name: "googleAnalyticsId",
2335
- type: "text",
2336
- label: "Google Analytics ID"
2337
- },
2338
- {
2339
- name: "googleTagManagerId",
2340
- type: "text",
2341
- label: "Google Tag Manager ID"
2342
- },
2343
- {
2344
- name: "plausibleDomain",
2345
- type: "text",
2346
- label: "Plausible Domain"
2347
- },
2348
- {
2349
- name: "mixpanelToken",
2350
- type: "password",
2351
- label: "Mixpanel Token"
2352
- }
2353
- ]
2354
- }
2355
- ]
2356
- };
2357
-
2358
- // src/templates/settings/seo.ts
2359
- var seoSettingsGlobal = {
2360
- slug: "seo-settings",
2361
- label: "SEO Settings",
2362
- admin: {
2363
- group: "settings"
2364
- },
2365
- access: {
2366
- read: () => true,
2367
- update: () => true
2368
- },
2369
- fields: [
2370
- {
2371
- name: "seoMode",
2372
- type: "select",
2373
- label: "Visibility Mode",
2374
- defaultValue: "simple",
2375
- options: [
2376
- { label: "Simple (Basic Meta)", value: "simple" },
2377
- { label: "Advanced (Full Technical SEO)", value: "advanced" }
2378
- ],
2379
- admin: {
2380
- description: "Switch to advanced mode to control robots.txt, canonical URLs, and deep metadata."
2381
- }
2382
- },
2383
- {
2384
- name: "defaultTitle",
2385
- type: "text",
2386
- label: "Default Title",
2387
- admin: {}
2388
- },
2389
- {
2390
- name: "defaultDescription",
2391
- type: "textarea",
2392
- label: "Default Description",
2393
- admin: {}
2394
- },
2395
- {
2396
- name: "titleTemplate",
2397
- type: "text",
2398
- label: "Title Template",
2399
- defaultValue: "{{title}} | {{siteName}}",
2400
- admin: {}
2401
- },
2402
- {
2403
- name: "siteNameInTitle",
2404
- type: "checkbox",
2405
- label: "Include Site Name in Title",
2406
- defaultValue: true
2407
- },
2408
- {
2409
- name: "separator",
2410
- type: "text",
2411
- label: "Title Separator",
2412
- defaultValue: " | ",
2413
- admin: {}
2414
- },
2415
- {
2416
- name: "meta",
2417
- type: "group",
2418
- label: "Technical Meta Settings",
2419
- admin: {
2420
- condition: (data) => data.seoMode === "advanced"
2421
- },
2422
- fields: [
2423
- {
2424
- name: "robots",
2425
- type: "text",
2426
- label: "Robots Meta",
2427
- defaultValue: "index, follow"
2428
- },
2429
- {
2430
- name: "canonicalUrl",
2431
- type: "text",
2432
- label: "Canonical URL"
2433
- },
2434
- {
2435
- name: "ogType",
2436
- type: "select",
2437
- label: "Default OG Type",
2438
- defaultValue: "website",
2439
- options: [
2440
- { label: "Website", value: "website" },
2441
- { label: "Article", value: "article" },
2442
- { label: "Product", value: "product" },
2443
- { label: "Book", value: "book" },
2444
- { label: "Music", value: "music" },
2445
- { label: "Video", value: "video" }
2446
- ]
2447
- }
2448
- ]
2449
- },
2450
- {
2451
- name: "enableSitemap",
2452
- type: "checkbox",
2453
- label: "Enable XML Sitemap",
2454
- defaultValue: true
2455
- },
2456
- {
2457
- name: "sitemap",
2458
- type: "group",
2459
- label: "Sitemap Configuration",
2460
- admin: {
2461
- condition: (data) => data.enableSitemap === true && data.seoMode === "advanced"
2462
- },
2463
- fields: [
2464
- {
2465
- name: "sitemapUrls",
2466
- type: "number",
2467
- label: "Sitemap URL Limit",
2468
- defaultValue: 5e4
2469
- }
2470
- ]
2471
- },
2472
- {
2473
- name: "robotsTxt",
2474
- type: "textarea",
2475
- label: "Custom robots.txt",
2476
- admin: {
2477
- condition: (data) => data.seoMode === "advanced"
2478
- }
2479
- },
2480
- {
2481
- name: "social",
2482
- type: "group",
2483
- label: "Social Media",
2484
- fields: [
2485
- {
2486
- name: "twitterHandle",
2487
- type: "text",
2488
- label: "Twitter/X Handle",
2489
- admin: {}
2490
- },
2491
- {
2492
- name: "twitterCardType",
2493
- type: "select",
2494
- label: "Twitter Card Type",
2495
- defaultValue: "summary_large_image",
2496
- options: [
2497
- { label: "Summary", value: "summary" },
2498
- { label: "Summary with Large Image", value: "summary_large_image" },
2499
- { label: "App", value: "app" },
2500
- { label: "Player", value: "player" }
2501
- ]
2502
- },
2503
- {
2504
- name: "fbAppId",
2505
- type: "text",
2506
- label: "Facebook App ID"
2507
- }
2508
- ]
2509
- },
2510
- {
2511
- name: "advanced",
2512
- type: "group",
2513
- label: "Advanced",
2514
- fields: [
2515
- {
2516
- name: "jsonLdEnabled",
2517
- type: "checkbox",
2518
- label: "Enable JSON-LD",
2519
- defaultValue: true,
2520
- admin: {}
2521
- },
2522
- {
2523
- name: "breadcrumbsEnabled",
2524
- type: "checkbox",
2525
- label: "Enable Breadcrumbs",
2526
- defaultValue: true
2527
- },
2528
- {
2529
- name: "paginationSize",
2530
- type: "number",
2531
- label: "Default Pagination Size",
2532
- defaultValue: 10
2533
- }
2534
- ]
2535
- }
2536
- ]
2537
- };
2538
-
2539
- // src/templates/settings/social.ts
2540
- var socialSettingsGlobal = {
2541
- slug: "social-settings",
2542
- label: "Social Media",
2543
- admin: {
2544
- group: "settings"
2545
- },
2546
- access: {
2547
- read: () => true,
2548
- update: () => true
2549
- },
2550
- fields: [
2551
- {
2552
- name: "showAll",
2553
- type: "checkbox",
2554
- label: "Show All Platforms",
2555
- defaultValue: false,
2556
- admin: {
2557
- description: "Toggle to show niche or secondary social platforms."
2558
- }
2559
- },
2560
- {
2561
- name: "facebook",
2562
- type: "text",
2563
- label: "Facebook"
2564
- },
2565
- {
2566
- name: "twitter",
2567
- type: "text",
2568
- label: "Twitter/X"
2569
- },
2570
- {
2571
- name: "instagram",
2572
- type: "text",
2573
- label: "Instagram"
2574
- },
2575
- {
2576
- name: "linkedin",
2577
- type: "text",
2578
- label: "LinkedIn"
2579
- },
2580
- {
2581
- name: "youtube",
2582
- type: "text",
2583
- label: "YouTube"
2584
- },
2585
- {
2586
- name: "tiktok",
2587
- type: "text",
2588
- label: "TikTok",
2589
- admin: {
2590
- condition: (data) => data.showAll === true
2591
- }
2592
- },
2593
- {
2594
- name: "pinterest",
2595
- type: "text",
2596
- label: "Pinterest",
2597
- admin: {
2598
- condition: (data) => data.showAll === true
2599
- }
2600
- },
2601
- {
2602
- name: "discord",
2603
- type: "text",
2604
- label: "Discord",
2605
- admin: {
2606
- condition: (data) => data.showAll === true
2607
- }
2608
- },
2609
- {
2610
- name: "twitch",
2611
- type: "text",
2612
- label: "Twitch",
2613
- admin: {
2614
- condition: (data) => data.showAll === true
2615
- }
2616
- },
2617
- {
2618
- name: "github",
2619
- type: "text",
2620
- label: "GitHub",
2621
- admin: {
2622
- condition: (data) => data.showAll === true
2623
- }
2624
- },
2625
- {
2626
- name: "mastodon",
2627
- type: "text",
2628
- label: "Mastodon",
2629
- admin: {
2630
- condition: (data) => data.showAll === true
2631
- }
2632
- }
2633
- ]
2634
- };
2635
-
2636
- // src/templates/settings/email.ts
2637
- var emailSettingsGlobal = {
2638
- slug: "email-settings",
2639
- label: "Email Settings",
2640
- admin: {
2641
- group: "settings"
2642
- },
2643
- access: {
2644
- read: () => true,
2645
- update: () => true
2646
- },
2647
- fields: [
2648
- {
2649
- name: "fromName",
2650
- type: "text",
2651
- label: "From Name",
2652
- admin: {}
2653
- },
2654
- {
2655
- name: "fromEmail",
2656
- type: "email",
2657
- label: "From Email",
2658
- required: true,
2659
- admin: {}
2660
- },
2661
- {
2662
- name: "replyTo",
2663
- type: "email",
2664
- label: "Reply-To Email",
2665
- admin: {}
2666
- },
2667
- {
2668
- name: "provider",
2669
- type: "select",
2670
- label: "Email Provider",
2671
- defaultValue: "smtp",
2672
- options: [
2673
- { label: "SMTP (Standard)", value: "smtp" },
2674
- { label: "Resend", value: "resend" },
2675
- { label: "SendGrid", value: "sendgrid" },
2676
- { label: "Mailgun", value: "mailgun" },
2677
- { label: "AWS SES", value: "ses" }
2678
- ]
2679
- },
2680
- {
2681
- name: "smtp",
2682
- type: "group",
2683
- label: "SMTP Settings",
2684
- admin: {
2685
- condition: (data) => data.provider === "smtp"
2686
- },
2687
- fields: [
2688
- {
2689
- name: "smtpService",
2690
- type: "select",
2691
- label: "SMTP Service",
2692
- defaultValue: "custom",
2693
- options: [
2694
- { label: "Custom SMTP", value: "custom" },
2695
- { label: "Gmail", value: "gmail" },
2696
- { label: "Outlook / Office 365", value: "outlook" },
2697
- { label: "Brevo (Sendinblue)", value: "brevo" },
2698
- { label: "Mailgun (SMTP)", value: "mailgun-smtp" },
2699
- { label: "SendGrid (SMTP)", value: "sendgrid-smtp" },
2700
- { label: "Mandrill / Mailchimp", value: "mandrill" }
2701
- ],
2702
- admin: {
2703
- description: "Selecting a known service will pre-configure host and port settings."
2704
- }
2705
- },
2706
- {
2707
- name: "host",
2708
- type: "text",
2709
- label: "Host",
2710
- admin: {
2711
- condition: (data, siblingData) => siblingData.smtpService === "custom",
2712
- placeholder: "smtp.example.com"
2713
- }
2714
- },
2715
- {
2716
- name: "port",
2717
- type: "number",
2718
- label: "Port",
2719
- defaultValue: 587,
2720
- admin: {
2721
- condition: (data, siblingData) => siblingData.smtpService === "custom"
2722
- }
2723
- },
2724
- {
2725
- name: "username",
2726
- type: "text",
2727
- label: "Username"
2728
- },
2729
- {
2730
- name: "password",
2731
- type: "password",
2732
- label: "Password"
2733
- },
2734
- {
2735
- name: "secure",
2736
- type: "checkbox",
2737
- label: "Use TLS/SSL",
2738
- defaultValue: true
2739
- }
2740
- ]
2741
- },
2742
- {
2743
- name: "resend",
2744
- type: "group",
2745
- label: "Resend Settings",
2746
- admin: {
2747
- condition: (data) => data.provider === "resend"
2748
- },
2749
- fields: [
2750
- {
2751
- name: "apiKey",
2752
- type: "password",
2753
- label: "API Key",
2754
- required: true
2755
- }
2756
- ]
2757
- },
2758
- {
2759
- name: "sendgrid",
2760
- type: "group",
2761
- label: "SendGrid Settings",
2762
- admin: {
2763
- condition: (data) => data.provider === "sendgrid"
2764
- },
2765
- fields: [
2766
- {
2767
- name: "apiKey",
2768
- type: "password",
2769
- label: "API Key",
2770
- required: true
2771
- }
2772
- ]
2773
- },
2774
- {
2775
- name: "mailgun",
2776
- type: "group",
2777
- label: "Mailgun Settings",
2778
- admin: {
2779
- condition: (data) => data.provider === "mailgun"
2780
- },
2781
- fields: [
2782
- {
2783
- name: "apiKey",
2784
- type: "password",
2785
- label: "API Key",
2786
- required: true
2787
- },
2788
- {
2789
- name: "domain",
2790
- type: "text",
2791
- label: "Domain",
2792
- required: true
2793
- },
2794
- {
2795
- name: "region",
2796
- type: "select",
2797
- label: "Region",
2798
- defaultValue: "us",
2799
- options: [
2800
- { label: "US (United States)", value: "us" },
2801
- { label: "EU (Europe)", value: "eu" }
2802
- ]
2803
- }
2804
- ]
2805
- },
2806
- {
2807
- name: "ses",
2808
- type: "group",
2809
- label: "AWS SES Settings",
2810
- admin: {
2811
- condition: (data) => data.provider === "ses"
2812
- },
2813
- fields: [
2814
- {
2815
- name: "accessKeyId",
2816
- type: "text",
2817
- label: "Access Key ID",
2818
- required: true
2819
- },
2820
- {
2821
- name: "secretAccessKey",
2822
- type: "password",
2823
- label: "Secret Access Key",
2824
- required: true
2825
- },
2826
- {
2827
- name: "region",
2828
- type: "text",
2829
- label: "Region",
2830
- defaultValue: "us-east-1",
2831
- admin: { placeholder: "us-east-1" }
2832
- }
2833
- ]
2834
- },
2835
- {
2836
- name: "testEmailSection",
2837
- type: "row",
2838
- label: "Test Email",
2839
- admin: {
2840
- description: "Enter an email address to send a test email."
2841
- },
2842
- fields: [
2843
- {
2844
- name: "testEmail",
2845
- type: "email",
2846
- label: "Email",
2847
- admin: {
2848
- width: "300px"
2849
- }
2850
- },
2851
- {
2852
- name: "sendTestEmail",
2853
- type: "button",
2854
- label: "Send Test Email",
2855
- admin: {
2856
- action: "/api/globals/email-settings/test",
2857
- method: "POST"
2858
- }
2859
- }
2860
- ]
2861
- }
2862
- ]
2863
- };
2864
-
2865
- // src/templates/settings/storage.ts
2866
- var storageSettingsGlobal = {
2867
- slug: "storage-settings",
2868
- label: "Storage Settings",
2869
- admin: {
2870
- group: "settings"
2871
- },
2872
- access: {
2873
- read: () => true,
2874
- update: () => true
2875
- },
2876
- fields: [
2877
- {
2878
- name: "provider",
2879
- type: "select",
2880
- label: "Storage Provider",
2881
- defaultValue: "local",
2882
- options: [
2883
- { label: "Local Server", value: "local" },
2884
- { label: "S3 Compatible (AWS, Backblaze, Wasabi, etc.)", value: "aws" },
2885
- { label: "Cloudflare R2", value: "r2" },
2886
- { label: "Cloudinary", value: "cloudinary" },
2887
- { label: "FTP", value: "ftp" }
2888
- ]
2889
- },
2890
- {
2891
- name: "local",
2892
- type: "group",
2893
- label: "Local Storage",
2894
- admin: {
2895
- condition: (data) => data.provider === "local"
2896
- },
2897
- fields: [
2898
- {
2899
- name: "uploadDir",
2900
- type: "text",
2901
- label: "Upload Directory",
2902
- defaultValue: "./public/uploads"
2903
- },
2904
- {
2905
- name: "baseUrl",
2906
- type: "text",
2907
- label: "Base URL",
2908
- defaultValue: "/uploads"
2909
- }
2910
- ]
2911
- },
2912
- {
2913
- name: "aws",
2914
- type: "group",
2915
- label: "AWS S3 Settings",
2916
- admin: {
2917
- condition: (data) => data.provider === "aws"
2918
- },
2919
- fields: [
2920
- {
2921
- name: "bucket",
2922
- type: "text",
2923
- label: "Bucket Name",
2924
- required: true
2925
- },
2926
- {
2927
- name: "region",
2928
- type: "text",
2929
- label: "Region",
2930
- defaultValue: "us-east-1",
2931
- admin: {
2932
- placeholder: "us-east-1"
2933
- }
2934
- },
2935
- {
2936
- name: "accessKeyId",
2937
- type: "text",
2938
- label: "Access Key ID",
2939
- required: true
2940
- },
2941
- {
2942
- name: "secretAccessKey",
2943
- type: "password",
2944
- label: "Secret Access Key",
2945
- required: true
2946
- },
2947
- {
2948
- name: "cdnUrl",
2949
- type: "text",
2950
- label: "CDN URL",
2951
- admin: {
2952
- placeholder: "https://cdn.example.com"
2953
- }
2954
- },
2955
- {
2956
- name: "prefix",
2957
- type: "text",
2958
- label: "Path Prefix",
2959
- admin: {
2960
- placeholder: "uploads"
2961
- }
2962
- }
2963
- ]
2964
- },
2965
- {
2966
- name: "r2",
2967
- type: "group",
2968
- label: "Cloudflare R2 Settings",
2969
- admin: {
2970
- condition: (data) => data.provider === "r2"
2971
- },
2972
- fields: [
2973
- {
2974
- name: "accountId",
2975
- type: "text",
2976
- label: "Account ID",
2977
- required: true,
2978
- admin: {
2979
- placeholder: "Your Cloudflare Account ID"
2980
- }
2981
- },
2982
- {
2983
- name: "accessKeyId",
2984
- type: "text",
2985
- label: "Access Key ID",
2986
- required: true
2987
- },
2988
- {
2989
- name: "secretAccessKey",
2990
- type: "password",
2991
- label: "Secret Access Key",
2992
- required: true
2993
- },
2994
- {
2995
- name: "bucket",
2996
- type: "text",
2997
- label: "Bucket Name",
2998
- required: true
2999
- },
3000
- {
3001
- name: "publicDevUrl",
3002
- type: "text",
3003
- label: "Public Dev URL ID",
3004
- admin: {
3005
- placeholder: "pub-xxxxxxxxxxxxxxxx",
3006
- description: "Enter ONLY the ID (e.g., pub-b8d8c4cc8bcf4d868ddd95efc1b305aa). Do NOT include https:// or the full URL. Found in R2 Dashboard \u2192 Public Dev URL."
3007
- }
3008
- },
3009
- {
3010
- name: "cdnUrl",
3011
- type: "text",
3012
- label: "Custom CDN URL",
3013
- admin: {
3014
- placeholder: "https://assets.example.com (optional)"
3015
- }
3016
- },
3017
- {
3018
- name: "prefix",
3019
- type: "text",
3020
- label: "Path Prefix",
3021
- admin: {
3022
- placeholder: "uploads (optional)",
3023
- description: "Optional prefix for all object keys. Do not use '/' as prefix."
3024
- }
3025
- }
3026
- ]
3027
- },
3028
- {
3029
- name: "cloudinary",
3030
- type: "group",
3031
- label: "Cloudinary Settings",
3032
- admin: {
3033
- condition: (data) => data.provider === "cloudinary"
3034
- },
3035
- fields: [
3036
- {
3037
- name: "cloudName",
3038
- type: "text",
3039
- label: "Cloud Name",
3040
- required: true
3041
- },
3042
- {
3043
- name: "apiKey",
3044
- type: "text",
3045
- label: "API Key",
3046
- required: true
3047
- },
3048
- {
3049
- name: "apiSecret",
3050
- type: "password",
3051
- label: "API Secret",
3052
- required: true
3053
- },
3054
- {
3055
- name: "folder",
3056
- type: "text",
3057
- label: "Folder",
3058
- admin: {
3059
- placeholder: "Optional folder path"
3060
- }
3061
- },
3062
- {
3063
- name: "uploadPreset",
3064
- type: "text",
3065
- label: "Upload Preset (optional)",
3066
- admin: {
3067
- placeholder: "Leave empty for signed uploads",
3068
- description: "If not set, uploads will be signed with API Secret"
3069
- }
3070
- }
3071
- ]
3072
- },
3073
- {
3074
- name: "ftp",
3075
- type: "group",
3076
- label: "FTP Settings",
3077
- admin: {
3078
- condition: (data) => data.provider === "ftp"
3079
- },
3080
- fields: [
3081
- {
3082
- name: "host",
3083
- type: "text",
3084
- label: "Host",
3085
- required: true,
3086
- admin: {
3087
- placeholder: "ftp.example.com"
3088
- }
3089
- },
3090
- {
3091
- name: "port",
3092
- type: "number",
3093
- label: "Port",
3094
- defaultValue: 21,
3095
- admin: {
3096
- placeholder: "21 for FTP"
3097
- }
3098
- },
3099
- {
3100
- name: "user",
3101
- type: "text",
3102
- label: "Username",
3103
- required: true
3104
- },
3105
- {
3106
- name: "password",
3107
- type: "password",
3108
- label: "Password",
3109
- required: true
3110
- },
3111
- {
3112
- name: "secure",
3113
- type: "checkbox",
3114
- label: "Use TLS/SSL",
3115
- defaultValue: false,
3116
- admin: {
3117
- description: "Enable TLS/SSL for secure connections (FTP only)"
3118
- }
3119
- },
3120
- {
3121
- name: "baseUrl",
3122
- type: "text",
3123
- label: "Base URL",
3124
- required: true,
3125
- admin: {
3126
- placeholder: "https://files.example.com"
3127
- }
3128
- },
3129
- {
3130
- name: "prefix",
3131
- type: "text",
3132
- label: "Path Prefix",
3133
- admin: {
3134
- placeholder: "uploads"
3135
- }
3136
- }
3137
- ]
3138
- },
3139
- {
3140
- name: "limits",
3141
- type: "group",
3142
- label: "Upload Limits",
3143
- fields: [
3144
- {
3145
- name: "maxFileSize",
3146
- type: "number",
3147
- label: "Max File Size (bytes)",
3148
- defaultValue: 10485760
3149
- },
3150
- {
3151
- name: "allowedTypes",
3152
- type: "json",
3153
- label: "Allowed MIME Types",
3154
- defaultValue: ["image/*", "video/*", "audio/*", "application/pdf"]
3155
- },
3156
- {
3157
- name: "maxFilesPerUpload",
3158
- type: "number",
3159
- label: "Max Files per Upload",
3160
- defaultValue: 10
3161
- }
3162
- ]
3163
- }
3164
- ]
3165
- };
3166
-
3167
- // src/templates/settings/access.ts
3168
- var accessSettingsGlobal = {
3169
- slug: "access-settings",
3170
- label: "Access Control",
3171
- admin: {
3172
- group: "settings"
3173
- },
3174
- access: {
3175
- read: () => true,
3176
- update: () => true
3177
- },
3178
- fields: [
3179
- {
3180
- name: "enablePublicAccess",
3181
- type: "checkbox",
3182
- label: "Enable Public Access",
3183
- defaultValue: true,
3184
- admin: {}
3185
- },
3186
- {
3187
- name: "defaultCollectionAccess",
3188
- type: "select",
3189
- label: "Default Collection Access",
3190
- defaultValue: "read",
3191
- options: [
3192
- { label: "Read Only", value: "read" },
3193
- { label: "Read & Create", value: "create" },
3194
- { label: "Read & Create & Update", value: "update" },
3195
- { label: "Full Access", value: "admin" },
3196
- { label: "No Access", value: "none" }
3197
- ],
3198
- admin: {}
3199
- },
3200
- {
3201
- name: "apiAccess",
3202
- type: "group",
3203
- label: "API Access",
3204
- fields: [
3205
- {
3206
- name: "restEnabled",
3207
- type: "checkbox",
3208
- label: "Enable REST API",
3209
- defaultValue: true
3210
- },
3211
- {
3212
- name: "graphqlEnabled",
3213
- type: "checkbox",
3214
- label: "Enable GraphQL",
3215
- defaultValue: false
3216
- },
3217
- {
3218
- name: "trpcEnabled",
3219
- type: "checkbox",
3220
- label: "Enable tRPC",
3221
- defaultValue: false
3222
- },
3223
- {
3224
- name: "wsEnabled",
3225
- type: "checkbox",
3226
- label: "Enable WebSocket",
3227
- defaultValue: false
3228
- },
3229
- {
3230
- name: "requireAuth",
3231
- type: "checkbox",
3232
- label: "Require Authentication",
3233
- defaultValue: false
3234
- },
3235
- {
3236
- name: "cors",
3237
- type: "group",
3238
- label: "CORS Settings",
3239
- admin: {
3240
- condition: (data) => data.apiAccess?.restEnabled === true || data.apiAccess?.graphqlEnabled === true
3241
- },
3242
- fields: [
3243
- {
3244
- name: "allowedOrigins",
3245
- type: "textarea",
3246
- label: "Allowed Origins (one per line)",
3247
- admin: {
3248
- placeholder: "https://example.com\nhttps://app.example.com"
3249
- }
3250
- }
3251
- ]
3252
- }
3253
- ]
3254
- },
3255
- {
3256
- name: "rateLimiting",
3257
- type: "group",
3258
- label: "Rate Limiting Configuration",
3259
- admin: {
3260
- condition: (data) => data.rateLimiting?.enabled === true
3261
- },
3262
- fields: [
3263
- {
3264
- name: "enabled",
3265
- type: "checkbox",
3266
- label: "Enable Global Rate Limiting",
3267
- defaultValue: true
3268
- },
3269
- {
3270
- name: "maxRequests",
3271
- type: "number",
3272
- label: "Max Requests",
3273
- defaultValue: 100,
3274
- admin: {
3275
- condition: (data, siblingData) => siblingData.enabled === true
3276
- }
3277
- },
3278
- {
3279
- name: "windowMs",
3280
- type: "number",
3281
- label: "Window (ms)",
3282
- defaultValue: 6e4,
3283
- admin: {
3284
- condition: (data, siblingData) => siblingData.enabled === true
3285
- }
3286
- }
3287
- ]
3288
- }
3289
- ]
3290
- };
3291
-
3292
- // src/templates/settings/store.ts
3293
- var countryOptions = [
3294
- { label: "United States", value: "US" },
3295
- { label: "United Kingdom", value: "GB" },
3296
- { label: "Canada", value: "CA" },
3297
- { label: "Australia", value: "AU" },
3298
- { label: "Germany", value: "DE" },
3299
- { label: "France", value: "FR" },
3300
- { label: "Netherlands", value: "NL" },
3301
- { label: "Belgium", value: "BE" },
3302
- { label: "Spain", value: "ES" },
3303
- { label: "Italy", value: "IT" },
3304
- { label: "Portugal", value: "PT" },
3305
- { label: "Sweden", value: "SE" },
3306
- { label: "Norway", value: "NO" },
3307
- { label: "Denmark", value: "DK" },
3308
- { label: "Finland", value: "FI" },
3309
- { label: "Austria", value: "AT" },
3310
- { label: "Switzerland", value: "CH" },
3311
- { label: "Japan", value: "JP" },
3312
- { label: "South Korea", value: "KR" },
3313
- { label: "China", value: "CN" },
3314
- { label: "India", value: "IN" },
3315
- { label: "Brazil", value: "BR" },
3316
- { label: "Mexico", value: "MX" }
3317
- ];
3318
- var storeSettingsGlobal = {
3319
- slug: "store-settings",
3320
- label: "Store Settings",
3321
- admin: {
3322
- group: "settings"
3323
- },
3324
- access: {
3325
- read: () => true,
3326
- update: () => true
3327
- },
3328
- fields: [
3329
- {
3330
- name: "storeName",
3331
- type: "text",
3332
- label: "Store Name",
3333
- required: true
3334
- },
3335
- {
3336
- name: "storeEmail",
3337
- type: "email",
3338
- label: "Contact Email",
3339
- required: true
3340
- },
3341
- {
3342
- name: "storePhone",
3343
- type: "text",
3344
- label: "Phone Number"
3345
- },
3346
- {
3347
- name: "address",
3348
- type: "group",
3349
- label: "Store Address",
3350
- fields: [
3351
- {
3352
- name: "street",
3353
- type: "text",
3354
- label: "Street Address"
3355
- },
3356
- {
3357
- name: "city",
3358
- type: "text",
3359
- label: "City"
3360
- },
3361
- {
3362
- name: "state",
3363
- type: "text",
3364
- label: "State/Province"
3365
- },
3366
- {
3367
- name: "postalCode",
3368
- type: "text",
3369
- label: "Postal Code"
3370
- },
3371
- {
3372
- name: "country",
3373
- type: "select",
3374
- label: "Country",
3375
- options: countryOptions
3376
- }
3377
- ]
3378
- },
3379
- {
3380
- name: "currency",
3381
- type: "group",
3382
- label: "Currency",
3383
- fields: [
3384
- {
3385
- name: "code",
3386
- type: "select",
3387
- label: "Currency Code",
3388
- defaultValue: "USD",
3389
- options: [
3390
- { label: "USD - US Dollar", value: "USD" },
3391
- { label: "EUR - Euro", value: "EUR" },
3392
- { label: "GBP - British Pound", value: "GBP" },
3393
- { label: "CAD - Canadian Dollar", value: "CAD" },
3394
- { label: "AUD - Australian Dollar", value: "AUD" },
3395
- { label: "JPY - Japanese Yen", value: "JPY" },
3396
- { label: "CNY - Chinese Yuan", value: "CNY" },
3397
- { label: "INR - Indian Rupee", value: "INR" },
3398
- { label: "BRL - Brazilian Real", value: "BRL" },
3399
- { label: "MXN - Mexican Peso", value: "MXN" }
3400
- ]
3401
- },
3402
- {
3403
- name: "symbol",
3404
- type: "text",
3405
- label: "Symbol",
3406
- defaultValue: "$"
3407
- },
3408
- {
3409
- name: "position",
3410
- type: "select",
3411
- label: "Symbol Position",
3412
- defaultValue: "before",
3413
- options: [
3414
- { label: "Before amount", value: "before" },
3415
- { label: "After amount", value: "after" }
3416
- ]
3417
- },
3418
- {
3419
- name: "decimals",
3420
- type: "number",
3421
- label: "Decimal Places",
3422
- defaultValue: 2
3423
- }
3424
- ]
3425
- },
3426
- {
3427
- name: "tax",
3428
- type: "group",
3429
- label: "Tax Logistics",
3430
- admin: {
3431
- condition: (data) => data.tax?.enabled === true
3432
- },
3433
- fields: [
3434
- {
3435
- name: "enabled",
3436
- type: "checkbox",
3437
- label: "Enable Tax",
3438
- defaultValue: true
3439
- },
3440
- {
3441
- name: "rate",
3442
- type: "number",
3443
- label: "Tax Rate (%)",
3444
- admin: {
3445
- placeholder: "10",
3446
- condition: (data, siblingData) => siblingData.enabled === true
3447
- }
3448
- },
3449
- {
3450
- name: "includedInPrice",
3451
- type: "checkbox",
3452
- label: "Tax Included in Prices",
3453
- admin: {
3454
- condition: (data, siblingData) => siblingData.enabled === true
3455
- }
3456
- },
3457
- {
3458
- name: "taxId",
3459
- type: "text",
3460
- label: "Tax ID / VAT Number",
3461
- admin: {
3462
- condition: (data, siblingData) => siblingData.enabled === true
3463
- }
3464
- }
3465
- ]
3466
- },
3467
- {
3468
- name: "shipping",
3469
- type: "group",
3470
- label: "Shipping Logic",
3471
- admin: {
3472
- condition: (data) => data.shipping?.enableLocalPickup === true || data.shipping?.flatRate > 0
3473
- },
3474
- fields: [
3475
- {
3476
- name: "enableLocalPickup",
3477
- type: "checkbox",
3478
- label: "Enable Local Pickup",
3479
- defaultValue: true
3480
- },
3481
- {
3482
- name: "flatRate",
3483
- type: "number",
3484
- label: "Flat Rate Shipping Fee",
3485
- admin: {}
3486
- },
3487
- {
3488
- name: "freeShippingThreshold",
3489
- type: "number",
3490
- label: "Free Shipping Minimum",
3491
- admin: {
3492
- condition: (data, siblingData) => siblingData.flatRate > 0
3493
- }
3494
- }
3495
- ]
3496
- },
3497
- {
3498
- name: "orders",
3499
- type: "group",
3500
- label: "Orders",
3501
- fields: [
3502
- {
3503
- name: "orderNumberPrefix",
3504
- type: "text",
3505
- label: "Order Number Prefix",
3506
- defaultValue: "ORD",
3507
- admin: {}
3508
- },
3509
- {
3510
- name: "allowGuestCheckout",
3511
- type: "checkbox",
3512
- label: "Allow Guest Checkout",
3513
- defaultValue: true
3514
- },
3515
- {
3516
- name: "requirePhone",
3517
- type: "checkbox",
3518
- label: "Require Phone Number",
3519
- defaultValue: true
3520
- }
3521
- ]
3522
- }
3523
- ]
3524
- };
3525
-
3526
- // src/templates/settings/payments.ts
3527
- var paymentSettingsGlobal = {
3528
- slug: "payment-settings",
3529
- label: "Payment Settings",
3530
- admin: {
3531
- group: "settings"
3532
- },
3533
- access: {
3534
- read: () => true,
3535
- update: () => true
3536
- },
3537
- fields: [
3538
- {
3539
- name: "testMode",
3540
- type: "checkbox",
3541
- label: "Test Mode",
3542
- defaultValue: true,
3543
- admin: {}
3544
- },
3545
- {
3546
- name: "provider",
3547
- type: "select",
3548
- label: "Primary Payment Provider",
3549
- defaultValue: "stripe",
3550
- options: [
3551
- { label: "Stripe", value: "stripe" },
3552
- { label: "PayPal", value: "paypal" },
3553
- { label: "Square", value: "square" },
3554
- { label: "Manual Methods Only", value: "manual" }
3555
- ]
3556
- },
3557
- {
3558
- name: "stripe",
3559
- type: "group",
3560
- label: "Stripe",
3561
- admin: {
3562
- condition: (data) => data.provider === "stripe"
3563
- },
3564
- fields: [
3565
- {
3566
- name: "enabled",
3567
- type: "checkbox",
3568
- label: "Enable Stripe",
3569
- defaultValue: false
3570
- },
3571
- {
3572
- name: "publishableKey",
3573
- type: "text",
3574
- label: "Publishable Key",
3575
- admin: {
3576
- placeholder: "pk_live_..."
3577
- }
3578
- },
3579
- {
3580
- name: "secretKey",
3581
- type: "password",
3582
- label: "Secret Key"
3583
- },
3584
- {
3585
- name: "webhookSecret",
3586
- type: "password",
3587
- label: "Webhook Secret",
3588
- admin: {}
3589
- }
3590
- ]
3591
- },
3592
- {
3593
- name: "paypal",
3594
- type: "group",
3595
- label: "PayPal",
3596
- admin: {
3597
- condition: (data) => data.provider === "paypal"
3598
- },
3599
- fields: [
3600
- {
3601
- name: "enabled",
3602
- type: "checkbox",
3603
- label: "Enable PayPal",
3604
- defaultValue: false
3605
- },
3606
- {
3607
- name: "clientId",
3608
- type: "text",
3609
- label: "Client ID"
3610
- },
3611
- {
3612
- name: "clientSecret",
3613
- type: "password",
3614
- label: "Client Secret"
3615
- },
3616
- {
3617
- name: "mode",
3618
- type: "select",
3619
- label: "Mode",
3620
- defaultValue: "sandbox",
3621
- options: [
3622
- { label: "Sandbox (Test)", value: "sandbox" },
3623
- { label: "Live", value: "live" }
3624
- ]
3625
- }
3626
- ]
3627
- },
3628
- {
3629
- name: "square",
3630
- type: "group",
3631
- label: "Square",
3632
- admin: {
3633
- condition: (data) => data.provider === "square"
3634
- },
3635
- fields: [
3636
- {
3637
- name: "enabled",
3638
- type: "checkbox",
3639
- label: "Enable Square",
3640
- defaultValue: false
3641
- },
3642
- {
3643
- name: "applicationId",
3644
- type: "text",
3645
- label: "Application ID"
3646
- },
3647
- {
3648
- name: "accessToken",
3649
- type: "password",
3650
- label: "Access Token"
3651
- },
3652
- {
3653
- name: "locationId",
3654
- type: "text",
3655
- label: "Location ID"
3656
- }
3657
- ]
3658
- },
3659
- {
3660
- name: "methods",
3661
- type: "group",
3662
- label: "Manual Payment Methods",
3663
- fields: [
3664
- {
3665
- name: "cod",
3666
- type: "checkbox",
3667
- label: "Cash on Delivery",
3668
- defaultValue: true
3669
- },
3670
- {
3671
- name: "bankTransfer",
3672
- type: "checkbox",
3673
- label: "Bank Transfer",
3674
- defaultValue: true
3675
- },
3676
- {
3677
- name: "cash",
3678
- type: "checkbox",
3679
- label: "Cash (Local Pickup)",
3680
- defaultValue: true
3681
- },
3682
- {
3683
- name: "check",
3684
- type: "checkbox",
3685
- label: "Check",
3686
- defaultValue: false
3687
- }
3688
- ]
3689
- },
3690
- {
3691
- name: "bankTransfer",
3692
- type: "group",
3693
- label: "Bank Transfer Details",
3694
- admin: {},
3695
- fields: [
3696
- {
3697
- name: "bankName",
3698
- type: "text",
3699
- label: "Bank Name"
3700
- },
3701
- {
3702
- name: "accountName",
3703
- type: "text",
3704
- label: "Account Name"
3705
- },
3706
- {
3707
- name: "accountNumber",
3708
- type: "text",
3709
- label: "Account Number"
3710
- },
3711
- {
3712
- name: "routingNumber",
3713
- type: "text",
3714
- label: "Routing/Sort Code"
3715
- },
3716
- {
3717
- name: "iban",
3718
- type: "text",
3719
- label: "IBAN"
3720
- },
3721
- {
3722
- name: "swift",
3723
- type: "text",
3724
- label: "SWIFT/BIC"
3725
- }
3726
- ]
3727
- }
3728
- ]
3729
- };
3730
-
3731
- // src/templates/settings/system.ts
3732
- var systemSettingsGlobal = {
3733
- slug: "system",
3734
- label: "System",
3735
- admin: {
3736
- group: "settings",
3737
- description: "Core system configuration and secrets"
3738
- },
3739
- access: {
3740
- read: () => true,
3741
- update: () => true
3742
- },
3743
- fields: [
3744
- {
3745
- name: "appSecret",
3746
- type: "text",
3747
- label: "App Secret",
3748
- required: false,
3749
- admin: {
3750
- description: "Master secret for JWT signing and encryption. Change with caution - invalidates all sessions."
3751
- }
3752
- },
3753
- {
3754
- name: "encryptionKey",
3755
- type: "text",
3756
- label: "Encryption Key",
3757
- required: false,
3758
- admin: {
3759
- description: "Auto-generated key for data encryption at rest.",
3760
- readOnly: true
3761
- }
3762
- },
3763
- {
3764
- name: "sessionMaxAge",
3765
- type: "number",
3766
- label: "Session Max Age (days)",
3767
- required: false,
3768
- defaultValue: 7,
3769
- admin: {
3770
- description: "Maximum session duration in days"
3771
- }
3772
- },
3773
- {
3774
- name: "maxSessionsPerUser",
3775
- type: "number",
3776
- label: "Max Sessions Per User",
3777
- required: false,
3778
- defaultValue: 3,
3779
- admin: {
3780
- description: "Maximum concurrent sessions allowed per user"
3781
- }
3782
- }
3783
- ]
3784
- };
3785
-
3786
- // src/templates/settings/index.ts
3787
- var allSettingsGlobals = [
3788
- siteSettingsGlobal,
3789
- seoSettingsGlobal,
3790
- socialSettingsGlobal,
3791
- emailSettingsGlobal,
3792
- storageSettingsGlobal,
3793
- accessSettingsGlobal,
3794
- storeSettingsGlobal,
3795
- paymentSettingsGlobal,
3796
- systemSettingsGlobal
3797
- ];
3798
- var coreSettingsGlobals = [
3799
- siteSettingsGlobal,
3800
- seoSettingsGlobal,
3801
- socialSettingsGlobal,
3802
- emailSettingsGlobal,
3803
- storageSettingsGlobal,
3804
- accessSettingsGlobal
3805
- ];
3806
- var settingsBySlug = {
3807
- [siteSettingsGlobal.slug]: siteSettingsGlobal,
3808
- [seoSettingsGlobal.slug]: seoSettingsGlobal,
3809
- [socialSettingsGlobal.slug]: socialSettingsGlobal,
3810
- [emailSettingsGlobal.slug]: emailSettingsGlobal,
3811
- [storageSettingsGlobal.slug]: storageSettingsGlobal,
3812
- [accessSettingsGlobal.slug]: accessSettingsGlobal,
3813
- [storeSettingsGlobal.slug]: storeSettingsGlobal,
3814
- [paymentSettingsGlobal.slug]: paymentSettingsGlobal,
3815
- [systemSettingsGlobal.slug]: systemSettingsGlobal
3816
- };
3817
- function getSettingsForTemplate(template) {
3818
- switch (template) {
3819
- case "minimal":
3820
- return [siteSettingsGlobal, seoSettingsGlobal];
3821
- case "starter":
3822
- case "blog":
3823
- return coreSettingsGlobals;
3824
- case "ecommerce":
3825
- case "kitchen-sink":
3826
- return allSettingsGlobals;
3827
- default:
3828
- return coreSettingsGlobals;
3829
- }
3830
- }
3831
-
3832
- // src/templates/index.ts
3833
- function createTemplateConfig(options) {
3834
- const collections = options.collections ? [...options.collections] : [];
3835
- const globals = options.globals ? [...options.globals] : [];
3836
- if (options.includeMedia !== false) {
3837
- collections.push(...mediaCollections);
3838
- }
3839
- const templateSettings = options.template ? getSettingsForTemplate(options.template) : coreSettingsGlobals;
3840
- if (options.includeSettings) {
3841
- if (options.includeSettings === "all") {
3842
- globals.push(...allSettingsGlobals);
3843
- } else if (options.includeSettings === "core") {
3844
- globals.push(...coreSettingsGlobals);
3845
- } else if (Array.isArray(options.includeSettings)) {
3846
- for (const setting of options.includeSettings) {
3847
- const global = settingsBySlug[setting];
3848
- if (global) {
3849
- globals.push(global);
3850
- }
3851
- }
3852
- }
3853
- } else if (!options.globals || options.globals.length === 0) {
3854
- globals.push(...templateSettings);
3855
- }
3856
- if (options.excludeSettings && options.excludeSettings.length > 0) {
3857
- const excludeSet = new Set(options.excludeSettings);
3858
- const filtered = globals.filter(
3859
- (g) => !excludeSet.has(g.slug) && !excludeSet.has(g.label?.toLowerCase().replace(/\s+/g, "-") || "")
3860
- );
3861
- globals.length = 0;
3862
- globals.push(...filtered);
3863
- }
3864
- return {
3865
- collections: collections.length > 0 ? collections : void 0,
3866
- globals: globals.length > 0 ? globals : void 0
3867
- };
3868
- }
3869
-
3870
- export { accessSettingsGlobal, allSettingsGlobals, authCollections, blogCollections, blogGlobals, coreSettingsGlobals, createTemplateConfig, ecommerceCollections, ecommerceGlobals, emailSettingsGlobal, getSettingsForTemplate, kitchenSinkCollections, mediaCollection, mediaCollections, minimalCollections, paymentSettingsGlobal, seoSettingsGlobal, settingsBySlug, siteSettingsGlobal, socialSettingsGlobal, starterCollections, storageSettingsGlobal, storeSettingsGlobal, systemSettingsGlobal };
3871
- //# sourceMappingURL=chunk-3J4MFTI3.js.map
3872
- //# sourceMappingURL=chunk-3J4MFTI3.js.map