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