@brightsideoy/kama 0.1.0-alpha.99 → 1.0.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +169 -0
- package/bin/cli.js +738 -261
- package/content/definitions/blocks/button.yaml +34 -0
- package/content/definitions/blocks/header.yaml +13 -0
- package/content/definitions/blocks/header_image.yaml +21 -0
- package/content/definitions/blocks/hero.yaml +28 -0
- package/content/definitions/blocks/html.yaml +13 -0
- package/content/definitions/blocks/image_card.yaml +56 -0
- package/content/definitions/blocks/node-list.yaml +61 -0
- package/content/definitions/blocks/single_image.yaml +27 -0
- package/content/definitions/blocks/text.yaml +15 -0
- package/content/definitions/channels/ecommerce.yaml +28 -0
- package/content/definitions/channels/website.yaml +41 -0
- package/{defaults → content}/definitions/field-sets/access.yaml +3 -5
- package/content/definitions/field-sets/channel-base.yaml +57 -0
- package/{defaults/definitions/field-sets/page-meta.yaml → content/definitions/field-sets/channel-seo.yaml} +3 -11
- package/content/definitions/field-sets/content-block.yaml +41 -0
- package/content/definitions/field-sets/page-base.yaml +44 -0
- package/content/definitions/field-sets/page-seo.yaml +34 -0
- package/{defaults → content}/definitions/field-sets/page-social.yaml +6 -8
- package/content/definitions/field-sets/schema-type.yaml +43 -0
- package/content/definitions/field-sets/tree-base.yaml +31 -0
- package/content/definitions/node-layouts/content.yml +12 -0
- package/{defaults → content}/definitions/node-layouts/landing-page.yml +8 -3
- package/{defaults → content}/definitions/node-layouts/single-column.yml +10 -5
- package/{defaults → content}/definitions/node-layouts/two-column.yml +14 -6
- package/content/definitions/nodes/address.yaml +40 -0
- package/content/definitions/nodes/article.yaml +65 -0
- package/content/definitions/nodes/event.yaml +55 -0
- package/content/definitions/nodes/external-link.yaml +29 -0
- package/content/definitions/nodes/page-skeleton.yaml +48 -0
- package/{defaults → content}/definitions/nodes/page.yaml +9 -20
- package/content/definitions/nodes/person.yaml +37 -0
- package/content/definitions/nodes/product.yaml +89 -0
- package/content/definitions/taxonomies/categories.yaml +15 -0
- package/content/definitions/taxonomies/tags.yaml +12 -0
- package/content/definitions/trees/navigation.yaml +24 -0
- package/definitions/editor/default.ts +1 -0
- package/dist/assets/index-BVkEzCNs.js +164 -0
- package/dist/assets/index-CGLx9oqF.css +1 -0
- package/dist/build-seed.js +486 -0
- package/dist/dist-kIJlDMvm.js +27162 -0
- package/dist/index.html +4 -2
- package/dist/index.js +26186 -8576
- package/dist/schema-compiler.js +48 -0
- package/documentation/SCHEMAS.md +182 -0
- package/package.json +24 -25
- package/schema.sql +67 -23
- package/templates/astro-starter/astro.config.mjs +27 -0
- package/templates/astro-starter/package.json.template +20 -0
- package/templates/astro-starter/public/robots.txt +23 -0
- package/templates/astro-starter/src/components/blocks/BlockRenderer.astro +143 -0
- package/templates/astro-starter/src/components/blocks/ColumnLayout.astro +67 -0
- package/templates/astro-starter/src/components/blocks/HeaderImage.astro +126 -0
- package/templates/astro-starter/src/components/blocks/Hero.astro +218 -0
- package/templates/astro-starter/src/components/blocks/HtmlBlock.astro +25 -0
- package/templates/astro-starter/src/components/blocks/ImageBlock.astro +91 -0
- package/templates/astro-starter/src/components/blocks/NodeList.astro +278 -0
- package/templates/astro-starter/src/components/blocks/TextBlock.astro +15 -0
- package/templates/astro-starter/src/components/global/Breadcrumb.astro +108 -0
- package/templates/astro-starter/src/components/global/Footer.astro +50 -0
- package/templates/astro-starter/src/components/global/Header.astro +171 -0
- package/templates/astro-starter/src/components/global/MetaHead.astro +266 -0
- package/templates/astro-starter/src/components/global/NavigationMenu.astro +413 -0
- package/templates/astro-starter/src/components/ui/KamaImage.astro +180 -0
- package/templates/astro-starter/src/layouts/SkeletonLayout.astro +56 -0
- package/templates/astro-starter/src/layouts/StandardLayout.astro +63 -0
- package/templates/astro-starter/src/lib/cms.ts +219 -0
- package/templates/astro-starter/src/lib/media/kama-image-service.ts +67 -0
- package/templates/astro-starter/src/lib/media/media-proxy.ts +148 -0
- package/templates/astro-starter/src/lib/media/media-url.ts +112 -0
- package/templates/astro-starter/src/middleware.ts +508 -0
- package/templates/astro-starter/src/pages/404.astro +46 -0
- package/templates/astro-starter/src/pages/[...slug].astro +318 -0
- package/templates/astro-starter/src/pages/api/load-nodes.ts +40 -0
- package/templates/astro-starter/src/pages/llms-full.txt.ts +171 -0
- package/templates/astro-starter/src/pages/llms.txt.ts +113 -0
- package/templates/astro-starter/src/pages/media/[...path].ts +14 -0
- package/templates/astro-starter/src/pages/partials/footer.astro +69 -0
- package/templates/astro-starter/src/pages/partials/nav.astro +141 -0
- package/templates/astro-starter/src/styles/standard-theme.css +157 -0
- package/templates/astro-starter/src/utils/tiptap.ts +113 -0
- package/templates/astro-starter/tsconfig.json +0 -0
- package/templates/kama-worker/index.js +19 -0
- package/templates/kama-worker/server.js +104 -0
- package/wrangler.json +22 -0
- package/defaults/definitions/blocks/button.yaml +0 -15
- package/defaults/definitions/blocks/header.yaml +0 -15
- package/defaults/definitions/blocks/header_image.yaml +0 -22
- package/defaults/definitions/blocks/hero.yaml +0 -27
- package/defaults/definitions/blocks/image_card.yaml +0 -57
- package/defaults/definitions/blocks/single_image.yaml +0 -28
- package/defaults/definitions/blocks/text.yaml +0 -16
- package/defaults/definitions/channels/ecommerce.yaml +0 -24
- package/defaults/definitions/channels/website.yaml +0 -32
- package/defaults/definitions/field-sets/channel-base.yaml +0 -31
- package/defaults/definitions/field-sets/content-block.yaml +0 -46
- package/defaults/definitions/field-sets/page-base.yaml +0 -49
- package/defaults/definitions/field-sets/tree-base.yaml +0 -31
- package/defaults/definitions/node-layouts/three-column.yml +0 -41
- package/defaults/definitions/nodes/address.yaml +0 -32
- package/defaults/definitions/nodes/article.yaml +0 -43
- package/defaults/definitions/nodes/event.yaml +0 -49
- package/defaults/definitions/nodes/external-link.yaml +0 -26
- package/defaults/definitions/nodes/person.yaml +0 -37
- package/defaults/definitions/nodes/product.yaml +0 -86
- package/defaults/definitions/trees/navigation.yaml +0 -29
- package/defaults/definitions/trees/social-links.yaml +0 -9
- package/definitions/_page.yaml +0 -52
- package/dist/assets/index-D6qQsWOj.js +0 -1392
- package/dist/assets/index-TdW5F0pX.css +0 -1
- package/dist/media/kama/2026/08/17a098c92bc54ea4b4441e531a34575b.jpg +0 -0
- package/dist/media/kama/2026/08/3e9ae457dd23461680cc699f42d07cf0.jpg +0 -0
- package/dist/media/kama/2026/08/8e5b3a2fd194459f9b962f8e12928bf0.jpg +0 -0
- package/dist/media/kama/2026/08/8ea5c21026cd4944bdf78c99fe2544a9.jpg +0 -0
- package/scripts/bundle-definitions.js +0 -176
- /package/{defaults → content}/definitions/block-layouts/three-column.yaml +0 -0
- /package/{defaults → content}/definitions/block-layouts/two-column.yaml +0 -0
- /package/{defaults → content}/definitions/field-sets/comments.yaml +0 -0
- /package/{defaults → content}/definitions/field-sets/visibility.yaml +0 -0
|
@@ -0,0 +1,486 @@
|
|
|
1
|
+
import e from "node:fs";
|
|
2
|
+
import t from "node:path";
|
|
3
|
+
//#region scripts/build-seed.ts
|
|
4
|
+
var n = [
|
|
5
|
+
{
|
|
6
|
+
city: "Tallinn",
|
|
7
|
+
area: "Harju County",
|
|
8
|
+
country: "Estonia",
|
|
9
|
+
zip: "10111",
|
|
10
|
+
lat: 59.437,
|
|
11
|
+
lng: 24.7535,
|
|
12
|
+
tz: "Europe/Tallinn"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
city: "London",
|
|
16
|
+
area: "Greater London",
|
|
17
|
+
country: "United Kingdom",
|
|
18
|
+
zip: "EC1A 1BB",
|
|
19
|
+
lat: 51.5074,
|
|
20
|
+
lng: -.1278,
|
|
21
|
+
tz: "Europe/London"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
city: "New York",
|
|
25
|
+
area: "NY",
|
|
26
|
+
country: "United States",
|
|
27
|
+
zip: "10001",
|
|
28
|
+
lat: 40.7128,
|
|
29
|
+
lng: -74.006,
|
|
30
|
+
tz: "America/New_York"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
city: "Berlin",
|
|
34
|
+
area: "Berlin State",
|
|
35
|
+
country: "Germany",
|
|
36
|
+
zip: "10115",
|
|
37
|
+
lat: 52.52,
|
|
38
|
+
lng: 13.405,
|
|
39
|
+
tz: "Europe/Berlin"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
city: "Tokyo",
|
|
43
|
+
area: "Kanto",
|
|
44
|
+
country: "Japan",
|
|
45
|
+
zip: "100-0001",
|
|
46
|
+
lat: 35.6762,
|
|
47
|
+
lng: 139.6503,
|
|
48
|
+
tz: "Asia/Tokyo"
|
|
49
|
+
}
|
|
50
|
+
], r = [
|
|
51
|
+
"Main St",
|
|
52
|
+
"Oak Ave",
|
|
53
|
+
"Narva mnt",
|
|
54
|
+
"Broadway",
|
|
55
|
+
"High St",
|
|
56
|
+
"Pärnu mnt",
|
|
57
|
+
"Sunset Blvd",
|
|
58
|
+
"Park Ave"
|
|
59
|
+
], i = [
|
|
60
|
+
"Emma",
|
|
61
|
+
"Liam",
|
|
62
|
+
"Olivia",
|
|
63
|
+
"Noah",
|
|
64
|
+
"Ava",
|
|
65
|
+
"Oliver",
|
|
66
|
+
"Isabella",
|
|
67
|
+
"Elijah",
|
|
68
|
+
"Sophia",
|
|
69
|
+
"William",
|
|
70
|
+
"Mia",
|
|
71
|
+
"James",
|
|
72
|
+
"Charlotte",
|
|
73
|
+
"Benjamin",
|
|
74
|
+
"Amelia",
|
|
75
|
+
"Lucas",
|
|
76
|
+
"Harper",
|
|
77
|
+
"Henry",
|
|
78
|
+
"Evelyn",
|
|
79
|
+
"Alexander"
|
|
80
|
+
], a = [
|
|
81
|
+
"Smith",
|
|
82
|
+
"Johnson",
|
|
83
|
+
"Williams",
|
|
84
|
+
"Brown",
|
|
85
|
+
"Jones",
|
|
86
|
+
"Garcia",
|
|
87
|
+
"Miller",
|
|
88
|
+
"Davis",
|
|
89
|
+
"Rodriguez",
|
|
90
|
+
"Martinez",
|
|
91
|
+
"Hernandez",
|
|
92
|
+
"Lopez",
|
|
93
|
+
"Gonzalez",
|
|
94
|
+
"Wilson",
|
|
95
|
+
"Anderson",
|
|
96
|
+
"Thomas",
|
|
97
|
+
"Taylor",
|
|
98
|
+
"Moore",
|
|
99
|
+
"Jackson",
|
|
100
|
+
"Martin"
|
|
101
|
+
], o = [
|
|
102
|
+
"Senior Engineer",
|
|
103
|
+
"Product Manager",
|
|
104
|
+
"Lead Designer",
|
|
105
|
+
"Content Strategist",
|
|
106
|
+
"DevOps Specialist",
|
|
107
|
+
"Marketing Director",
|
|
108
|
+
"Data Scientist",
|
|
109
|
+
"System Architect"
|
|
110
|
+
], s = [
|
|
111
|
+
"Corporate Tech Summit",
|
|
112
|
+
"Developer Conference",
|
|
113
|
+
"Design System Workshop",
|
|
114
|
+
"API Masterclass",
|
|
115
|
+
"AI & Edge Computing Expo",
|
|
116
|
+
"Product Design Forum",
|
|
117
|
+
"Vue & TypeScript Meetup"
|
|
118
|
+
], c = [
|
|
119
|
+
"Future of Web Development",
|
|
120
|
+
"Mastering Vue 3 and TypeScript",
|
|
121
|
+
"SQLite Performance Strategies",
|
|
122
|
+
"Design Systems at Scale",
|
|
123
|
+
"Building Scalable Architecture",
|
|
124
|
+
"Optimizing CMS Workflows",
|
|
125
|
+
"Tailwind CSS Tricks",
|
|
126
|
+
"Modern API Security Patterns",
|
|
127
|
+
"Edge Computing Explained",
|
|
128
|
+
"Micro-Frontends in 2026",
|
|
129
|
+
"State Management Patterns",
|
|
130
|
+
"Headless CMS Tradeoffs"
|
|
131
|
+
], l = [
|
|
132
|
+
"Comprehensive Guide to",
|
|
133
|
+
"Deep Dive into",
|
|
134
|
+
"Secrets of",
|
|
135
|
+
"Practical Intro to",
|
|
136
|
+
"Advanced Tips for",
|
|
137
|
+
"The Complete Handbook of",
|
|
138
|
+
"Understanding",
|
|
139
|
+
"Future Outlook of"
|
|
140
|
+
], u = [
|
|
141
|
+
{
|
|
142
|
+
id: 1,
|
|
143
|
+
title: "Home",
|
|
144
|
+
slug: "home",
|
|
145
|
+
parentId: "NULL"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
id: 2,
|
|
149
|
+
title: "About Us",
|
|
150
|
+
slug: "about-us",
|
|
151
|
+
parentId: 1
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
id: 3,
|
|
155
|
+
title: "Leadership & Team",
|
|
156
|
+
slug: "leadership",
|
|
157
|
+
parentId: 2
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
id: 4,
|
|
161
|
+
title: "Our Mission & Values",
|
|
162
|
+
slug: "mission",
|
|
163
|
+
parentId: 2
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
id: 5,
|
|
167
|
+
title: "Services",
|
|
168
|
+
slug: "services",
|
|
169
|
+
parentId: 1
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
id: 6,
|
|
173
|
+
title: "Enterprise Consulting",
|
|
174
|
+
slug: "enterprise-consulting",
|
|
175
|
+
parentId: 5
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
id: 7,
|
|
179
|
+
title: "Cloud Architecture",
|
|
180
|
+
slug: "cloud-architecture",
|
|
181
|
+
parentId: 5
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
id: 8,
|
|
185
|
+
title: "Solutions",
|
|
186
|
+
slug: "solutions",
|
|
187
|
+
parentId: 1
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
id: 9,
|
|
191
|
+
title: "Digital Transformation",
|
|
192
|
+
slug: "digital-transformation",
|
|
193
|
+
parentId: 8
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
id: 10,
|
|
197
|
+
title: "Careers",
|
|
198
|
+
slug: "careers",
|
|
199
|
+
parentId: 1
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
id: 11,
|
|
203
|
+
title: "Open Positions",
|
|
204
|
+
slug: "open-positions",
|
|
205
|
+
parentId: 10
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
id: 12,
|
|
209
|
+
title: "News & Press",
|
|
210
|
+
slug: "news",
|
|
211
|
+
parentId: 1
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
id: 13,
|
|
215
|
+
title: "Investor Relations",
|
|
216
|
+
slug: "investors",
|
|
217
|
+
parentId: 1
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
id: 14,
|
|
221
|
+
title: "Contact",
|
|
222
|
+
slug: "contact",
|
|
223
|
+
parentId: 1
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
id: 15,
|
|
227
|
+
title: "Global Offices",
|
|
228
|
+
slug: "offices",
|
|
229
|
+
parentId: 1
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
id: 16,
|
|
233
|
+
title: "Sustainability",
|
|
234
|
+
slug: "sustainability",
|
|
235
|
+
parentId: 2
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
id: 17,
|
|
239
|
+
title: "Partners",
|
|
240
|
+
slug: "partners",
|
|
241
|
+
parentId: 1
|
|
242
|
+
}
|
|
243
|
+
], d = [
|
|
244
|
+
{
|
|
245
|
+
id: 20,
|
|
246
|
+
title: "Store Home",
|
|
247
|
+
slug: "home",
|
|
248
|
+
parentId: "NULL"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
id: 21,
|
|
252
|
+
title: "Product Catalog",
|
|
253
|
+
slug: "catalog",
|
|
254
|
+
parentId: 20
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
id: 22,
|
|
258
|
+
title: "Bulk Ordering",
|
|
259
|
+
slug: "bulk-orders",
|
|
260
|
+
parentId: 20
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
id: 23,
|
|
264
|
+
title: "My Account",
|
|
265
|
+
slug: "account",
|
|
266
|
+
parentId: 20
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
id: 24,
|
|
270
|
+
title: "Support & Docs",
|
|
271
|
+
slug: "support",
|
|
272
|
+
parentId: 20
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
id: 25,
|
|
276
|
+
title: "API Documentation",
|
|
277
|
+
slug: "api",
|
|
278
|
+
parentId: 24
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
id: 26,
|
|
282
|
+
title: "Pricing",
|
|
283
|
+
slug: "pricing",
|
|
284
|
+
parentId: 20
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
id: 27,
|
|
288
|
+
title: "Enterprise Licensing",
|
|
289
|
+
slug: "enterprise-licensing",
|
|
290
|
+
parentId: 26
|
|
291
|
+
}
|
|
292
|
+
], f = [
|
|
293
|
+
{
|
|
294
|
+
id: 30,
|
|
295
|
+
title: "Privacy Policy",
|
|
296
|
+
slug: "privacy-policy",
|
|
297
|
+
parentId: "NULL"
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
id: 31,
|
|
301
|
+
title: "Terms of Service",
|
|
302
|
+
slug: "terms-of-service",
|
|
303
|
+
parentId: "NULL"
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
id: 32,
|
|
307
|
+
title: "Cookie Policy",
|
|
308
|
+
slug: "cookie-policy",
|
|
309
|
+
parentId: "NULL"
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
id: 33,
|
|
313
|
+
title: "Refund Policy",
|
|
314
|
+
slug: "refund-policy",
|
|
315
|
+
parentId: "NULL"
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
id: 34,
|
|
319
|
+
title: "Security Hub",
|
|
320
|
+
slug: "security",
|
|
321
|
+
parentId: "NULL"
|
|
322
|
+
}
|
|
323
|
+
];
|
|
324
|
+
function p(e) {
|
|
325
|
+
return `${l[e % l.length]} ${c[e * 7 % c.length]} #${e}`;
|
|
326
|
+
}
|
|
327
|
+
function m(e = 2024) {
|
|
328
|
+
let t = new Date(e, 0, 1).getTime(), n = t + Math.random() * (Date.now() - t);
|
|
329
|
+
return new Date(n).toISOString();
|
|
330
|
+
}
|
|
331
|
+
function h(e = 2024, t = 2026) {
|
|
332
|
+
let n = new Date(e, 0, 1).getTime(), r = new Date(t, 11, 31, 23, 59, 59).getTime(), i = n + Math.random() * (r - n);
|
|
333
|
+
return new Date(i).toISOString();
|
|
334
|
+
}
|
|
335
|
+
function g(e) {
|
|
336
|
+
return e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "");
|
|
337
|
+
}
|
|
338
|
+
function _(e) {
|
|
339
|
+
return e.replace(/\\/g, "\\\\").replace(/'/g, "''");
|
|
340
|
+
}
|
|
341
|
+
function v(e, t, n, r, i = 100) {
|
|
342
|
+
for (let a = 0; a < r.length; a += i) {
|
|
343
|
+
let o = r.slice(a, a + i);
|
|
344
|
+
e.push(`INSERT INTO ${t} (${n.join(", ")}) VALUES\n ${o.join(",\n ")};`);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
function y() {
|
|
348
|
+
console.log("⚡ Generating Massive Cloudflare D1-optimized seed.sql file...");
|
|
349
|
+
let c = [];
|
|
350
|
+
c.push("PRAGMA foreign_keys = OFF;"), [
|
|
351
|
+
"sessions",
|
|
352
|
+
"user_accounts",
|
|
353
|
+
"node_revisions",
|
|
354
|
+
"content_blocks",
|
|
355
|
+
"tree_nodes",
|
|
356
|
+
"node_channels",
|
|
357
|
+
"node_relations",
|
|
358
|
+
"channel_trees",
|
|
359
|
+
"content_nodes",
|
|
360
|
+
"trees",
|
|
361
|
+
"channels",
|
|
362
|
+
"users"
|
|
363
|
+
].forEach((e) => c.push(`DELETE FROM ${e};`));
|
|
364
|
+
let l = "usr_admin_01";
|
|
365
|
+
c.push(`INSERT INTO users (id, email, name, globalRole) VALUES ('${l}', 'admin@example.com', 'Superadmin User', 'superadmin');`), c.push(`INSERT INTO user_accounts (id, userId, provider, providerAccountId, passwordHash) VALUES ('acc_admin_01', '${l}', 'credentials', 'admin@example.com', '\$2a\$10\$w82H/kG7k8bW8Vq5i4.D/.7n0s8s2h2X3f0j1k2l3m4n5o6p7q8r9');`), c.push(`INSERT INTO channels (id, key, label, channelType, defaultLanguage, isHidden, createdById) VALUES (1, 'corporate', 'Corporate Website', 'website', 'en', 0, '${l}');`), c.push(`INSERT INTO channels (id, key, label, channelType, defaultLanguage, isHidden, createdById) VALUES (2, 'campaigns', 'Campaigns', 'website', 'en', 0, '${l}');`), c.push(`INSERT INTO channels (id, key, label, channelType, defaultLanguage, isHidden, createdById) VALUES (3, 'store', 'Storefront', 'ecommerce', 'en', 0, '${l}');`), c.push(`INSERT INTO trees (id, key, label, treeType, channelId, createdById) VALUES (1, 'main-nav', 'Corporate Nav', 'navigation', 1, '${l}');`), c.push(`INSERT INTO trees (id, key, label, treeType, channelId, createdById) VALUES (2, 'legal-nav', 'Legal Nav', 'navigation', 1, '${l}');`), c.push(`INSERT INTO trees (id, key, label, treeType, channelId, createdById) VALUES (3, 'b2b-nav', 'Store Nav', 'navigation', 3, '${l}');`), c.push("INSERT INTO channel_trees (channelId, treeId, key) VALUES (1, 1, 'main');"), c.push("INSERT INTO channel_trees (channelId, treeId, key) VALUES (1, 2, 'footer');"), c.push("INSERT INTO channel_trees (channelId, treeId, key) VALUES (3, 3, 'main');");
|
|
366
|
+
let y = [], b = [], x = [], S = [], C = [];
|
|
367
|
+
function w(e, t) {
|
|
368
|
+
let n = `<h1>${t}</h1><p>Detailed overview regarding ${t}. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>`, r = _(JSON.stringify({
|
|
369
|
+
content: n,
|
|
370
|
+
html: n,
|
|
371
|
+
body: n,
|
|
372
|
+
text: n
|
|
373
|
+
}));
|
|
374
|
+
S.push(`(${e}, 'content', 'text', '${r}', 0, 1)`), S.push(`(${e}, 'content', 'text', '${r}', 0, 0)`);
|
|
375
|
+
}
|
|
376
|
+
[
|
|
377
|
+
...u.map((e) => ({
|
|
378
|
+
...e,
|
|
379
|
+
cId: 1,
|
|
380
|
+
tId: 1
|
|
381
|
+
})),
|
|
382
|
+
...d.map((e) => ({
|
|
383
|
+
...e,
|
|
384
|
+
cId: 3,
|
|
385
|
+
tId: 3
|
|
386
|
+
})),
|
|
387
|
+
...f.map((e) => ({
|
|
388
|
+
...e,
|
|
389
|
+
cId: 1,
|
|
390
|
+
tId: 2
|
|
391
|
+
}))
|
|
392
|
+
].forEach((e, t) => {
|
|
393
|
+
let n = m(2024), r = e.parentId === "NULL", i = JSON.stringify({
|
|
394
|
+
channelId: e.cId,
|
|
395
|
+
channels: [e.cId],
|
|
396
|
+
menuTitle: e.title,
|
|
397
|
+
layoutId: r ? "single-column" : "inherit"
|
|
398
|
+
});
|
|
399
|
+
y.push(`(${e.id}, 'page', '${_(e.title)}', '${e.slug}', 0, 'published', '{}', '${_(i)}', '${_(i)}', '${_(i)}', '${n}', '${l}', '${l}', '${n}', '${n}')`), b.push(`(${e.id}, ${e.cId})`), x.push(`(${e.tId}, ${e.id}, ${e.parentId}, ${t + 1})`), w(e.id, e.title);
|
|
400
|
+
});
|
|
401
|
+
let T = 100, E = [];
|
|
402
|
+
console.log("Generating 500 People...");
|
|
403
|
+
for (let e = 1; e <= 500; e++) {
|
|
404
|
+
let t = i[e % i.length], n = a[e % a.length], r = o[e % o.length], s = `${t} ${n}`, c = g(s) + `-${e}`, u = m(2024), d = JSON.stringify({
|
|
405
|
+
firstName: t,
|
|
406
|
+
lastName: n,
|
|
407
|
+
position: r,
|
|
408
|
+
channels: [1]
|
|
409
|
+
});
|
|
410
|
+
y.push(`(${T}, 'person', '${_(s)}', '${c}', 0, 'published', '{}', '${_(d)}', '${_(d)}', '${_(d)}', '${u}', '${l}', '${l}', '${u}', '${u}')`), b.push(`(${T}, 1)`), E.push(T), T++;
|
|
411
|
+
}
|
|
412
|
+
console.log("Generating 500 Addresses...");
|
|
413
|
+
for (let e = 1; e <= 500; e++) {
|
|
414
|
+
let t = n[e % n.length], i = `${e * 12 % 199 + 1} ${r[e % r.length]}`, a = `${t.city} Hub #${e}`, o = `address-${t.city.toLowerCase()}-${e}`, s = m(2024), c = JSON.stringify({
|
|
415
|
+
street: i,
|
|
416
|
+
city: t.city,
|
|
417
|
+
country: t.country,
|
|
418
|
+
zip: t.zip,
|
|
419
|
+
channels: [1]
|
|
420
|
+
});
|
|
421
|
+
y.push(`(${T}, 'address', '${_(a)}', '${o}', 0, 'published', '{}', '${_(c)}', '${_(c)}', '${_(c)}', '${s}', '${l}', '${l}', '${s}', '${s}')`), b.push(`(${T}, 1)`), T++;
|
|
422
|
+
}
|
|
423
|
+
console.log("Generating 4,000 Events...");
|
|
424
|
+
for (let e = 1; e <= 4e3; e++) {
|
|
425
|
+
let t = s[e % s.length], n = `${t} 2026 #${e}`, r = `event-${g(t)}-${e}`, i = m(2024), a = h(2024, 2027), o = JSON.stringify({
|
|
426
|
+
startTime: a,
|
|
427
|
+
channels: [1],
|
|
428
|
+
layoutId: "single-column"
|
|
429
|
+
});
|
|
430
|
+
y.push(`(${T}, 'event', '${_(n)}', '${r}', 0, 'published', '{}', '${_(o)}', '${_(o)}', '${_(o)}', '${i}', '${l}', '${l}', '${i}', '${i}')`), b.push(`(${T}, 1)`), w(T, n), T++;
|
|
431
|
+
}
|
|
432
|
+
console.log("Generating 4,000 Articles (and linking relations)...");
|
|
433
|
+
for (let e = 1; e <= 4e3; e++) {
|
|
434
|
+
let t = p(e), n = `${g(t)}-${e}`, r = m(2024), i = r.split("T")[0], a = e % 2 + 1, o = [];
|
|
435
|
+
for (let t = 0; t < a; t++) {
|
|
436
|
+
let n = E[(e + t * 7) % E.length];
|
|
437
|
+
C.push(`(${T}, ${n}, 'authors', ${t})`), o.push(n);
|
|
438
|
+
}
|
|
439
|
+
let s = JSON.stringify({
|
|
440
|
+
articleDate: i,
|
|
441
|
+
authors: o,
|
|
442
|
+
channels: [1],
|
|
443
|
+
layoutId: "single-column"
|
|
444
|
+
});
|
|
445
|
+
y.push(`(${T}, 'article', '${_(t)}', '${n}', 0, 'published', '{}', '${_(s)}', '${_(s)}', '${_(s)}', '${r}', '${l}', '${l}', '${r}', '${r}')`), b.push(`(${T}, 1)`), w(T, t), T++;
|
|
446
|
+
}
|
|
447
|
+
console.log("Writing Batches..."), v(c, "content_nodes", [
|
|
448
|
+
"id",
|
|
449
|
+
"contentType",
|
|
450
|
+
"title",
|
|
451
|
+
"slug",
|
|
452
|
+
"isHidden",
|
|
453
|
+
"status",
|
|
454
|
+
"disabledRegionsJson",
|
|
455
|
+
"dataJson",
|
|
456
|
+
"draftDataJson",
|
|
457
|
+
"publishedDataJson",
|
|
458
|
+
"publishedAt",
|
|
459
|
+
"createdById",
|
|
460
|
+
"updatedById",
|
|
461
|
+
"createdAt",
|
|
462
|
+
"updatedAt"
|
|
463
|
+
], y, 100), v(c, "node_channels", ["nodeId", "channelId"], b, 200), v(c, "tree_nodes", [
|
|
464
|
+
"treeId",
|
|
465
|
+
"contentId",
|
|
466
|
+
"parentId",
|
|
467
|
+
"sortOrder"
|
|
468
|
+
], x, 50), v(c, "content_blocks", [
|
|
469
|
+
"contentId",
|
|
470
|
+
"region",
|
|
471
|
+
"elementType",
|
|
472
|
+
"dataJson",
|
|
473
|
+
"sortOrder",
|
|
474
|
+
"isDraft"
|
|
475
|
+
], S, 200), v(c, "node_relations", [
|
|
476
|
+
"sourceNodeId",
|
|
477
|
+
"targetNodeId",
|
|
478
|
+
"fieldKey",
|
|
479
|
+
"sortOrder"
|
|
480
|
+
], C, 200), c.push("PRAGMA foreign_keys = ON;");
|
|
481
|
+
let D = t.resolve(process.cwd(), "./seed.sql");
|
|
482
|
+
e.writeFileSync(D, c.join("\n"), "utf-8"), console.log(`✅ Success! Scaled Seed SQL generated to ${D}.`);
|
|
483
|
+
}
|
|
484
|
+
y();
|
|
485
|
+
//#endregion
|
|
486
|
+
export { y as generateSqlFile };
|