@velastack/patterns 0.0.1 → 0.0.2
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/dist/chunks/{collections-BRabBN4M.js → collections-BCHbdy1Q.js} +3 -3
- package/dist/chunks/{collections-BRabBN4M.js.map → collections-BCHbdy1Q.js.map} +1 -1
- package/dist/chunks/{env.runtime-_7lT2q35.js → env.runtime-arRRKYvH.js} +2 -2
- package/dist/chunks/{env.runtime-_7lT2q35.js.map → env.runtime-arRRKYvH.js.map} +1 -1
- package/dist/chunks/{generate.runtime-BR_qnQ-6.js → generate.runtime-BXbRs6o2.js} +3 -3
- package/dist/chunks/{generate.runtime-BR_qnQ-6.js.map → generate.runtime-BXbRs6o2.js.map} +1 -1
- package/dist/chunks/{index-D5FMXkZu.js → index-8rNhWMFD.js} +394 -384
- package/dist/chunks/{index-D5FMXkZu.js.map → index-8rNhWMFD.js.map} +1 -1
- package/dist/chunks/{pocketbase-D612ARa5.js → pocketbase-CNlQBo9r.js} +2 -2
- package/dist/chunks/{pocketbase-D612ARa5.js.map → pocketbase-CNlQBo9r.js.map} +1 -1
- package/dist/index.d.ts +15 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -12,21 +12,21 @@ function ct(t) {
|
|
|
12
12
|
for (var e = 1; e < arguments.length; e++) {
|
|
13
13
|
var n = arguments[e] != null ? arguments[e] : {};
|
|
14
14
|
e % 2 ? lt(Object(n), !0).forEach(function(r) {
|
|
15
|
-
|
|
15
|
+
re(t, r, n[r]);
|
|
16
16
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : lt(Object(n)).forEach(function(r) {
|
|
17
17
|
Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
return t;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
return e =
|
|
22
|
+
function re(t, e, n) {
|
|
23
|
+
return e = ae(e), e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
var e =
|
|
25
|
+
function ae(t) {
|
|
26
|
+
var e = oe(t, "string");
|
|
27
27
|
return typeof e == "symbol" ? e : String(e);
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function oe(t, e) {
|
|
30
30
|
if (typeof t != "object" || t === null) return t;
|
|
31
31
|
var n = t[Symbol.toPrimitive];
|
|
32
32
|
if (n !== void 0) {
|
|
@@ -36,9 +36,9 @@ function ae(t, e) {
|
|
|
36
36
|
}
|
|
37
37
|
return (e === "string" ? String : Number)(t);
|
|
38
38
|
}
|
|
39
|
-
const p =
|
|
40
|
-
function
|
|
41
|
-
return e.withOptions = (n) =>
|
|
39
|
+
const p = Tt({});
|
|
40
|
+
function Tt(t) {
|
|
41
|
+
return e.withOptions = (n) => Tt(ct(ct({}, t), n)), e;
|
|
42
42
|
function e(n, ...r) {
|
|
43
43
|
const a = typeof n == "string" ? [n] : n.raw, {
|
|
44
44
|
alignValues: s = !1,
|
|
@@ -49,7 +49,7 @@ function It(t) {
|
|
|
49
49
|
for (let f = 0; f < a.length; f++) {
|
|
50
50
|
let g = a[f];
|
|
51
51
|
if (i && (g = g.replace(/\\\n[ \t]*/g, "").replace(/\\`/g, "`").replace(/\\\$/g, "$").replace(/\\\{/g, "{")), c += g, f < r.length) {
|
|
52
|
-
const x = s ?
|
|
52
|
+
const x = s ? se(r[f], c) : r[f];
|
|
53
53
|
c += x;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
@@ -80,7 +80,7 @@ function It(t) {
|
|
|
80
80
|
)), c;
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function se(t, e) {
|
|
84
84
|
if (typeof t != "string" || !t.includes(`
|
|
85
85
|
`))
|
|
86
86
|
return t;
|
|
@@ -93,7 +93,7 @@ ${a}`);
|
|
|
93
93
|
}
|
|
94
94
|
return t;
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function zt(t, e) {
|
|
97
97
|
return t.startsWith(e) ? t.slice(e.length) : t.replace(/^\.\//, "");
|
|
98
98
|
}
|
|
99
99
|
function B(t) {
|
|
@@ -112,7 +112,7 @@ function mt(t) {
|
|
|
112
112
|
}
|
|
113
113
|
);
|
|
114
114
|
}
|
|
115
|
-
const
|
|
115
|
+
const ie = {
|
|
116
116
|
text: ["form", "input"],
|
|
117
117
|
number: ["form", "input"],
|
|
118
118
|
email: ["form", "input"],
|
|
@@ -127,7 +127,7 @@ const se = {
|
|
|
127
127
|
url: ["form", "input"],
|
|
128
128
|
editor: ["form", "textarea"],
|
|
129
129
|
autodate: ["form", "input"]
|
|
130
|
-
},
|
|
130
|
+
}, le = {
|
|
131
131
|
form: ['import * as Form from "$lib/components/ui/form";'],
|
|
132
132
|
"file-form": ['import * as FileForm from "$lib/components/ui/file-form";'],
|
|
133
133
|
multiselect: [
|
|
@@ -169,7 +169,7 @@ function T(t, e) {
|
|
|
169
169
|
</Form.Field>
|
|
170
170
|
`;
|
|
171
171
|
}
|
|
172
|
-
function
|
|
172
|
+
function ce(t) {
|
|
173
173
|
const e = t.required ? " required" : "";
|
|
174
174
|
return p`
|
|
175
175
|
<Form.Field {form} name="${t.name}" class="col-span-2">
|
|
@@ -183,7 +183,7 @@ function le(t) {
|
|
|
183
183
|
</Form.Field>
|
|
184
184
|
`;
|
|
185
185
|
}
|
|
186
|
-
function
|
|
186
|
+
function me(t) {
|
|
187
187
|
const e = t.required ? " required" : "";
|
|
188
188
|
return p`
|
|
189
189
|
<Form.Field {form} name="${t.name}" class="col-span-1 flex items-start space-x-2">
|
|
@@ -197,7 +197,7 @@ function ce(t) {
|
|
|
197
197
|
</Form.Field>
|
|
198
198
|
`;
|
|
199
199
|
}
|
|
200
|
-
function
|
|
200
|
+
function ue(t) {
|
|
201
201
|
return p`
|
|
202
202
|
<Form.Field {form} name="${t.name}" class="col-span-1">
|
|
203
203
|
<Form.Control>
|
|
@@ -210,7 +210,7 @@ function me(t) {
|
|
|
210
210
|
</Form.Field>
|
|
211
211
|
`;
|
|
212
212
|
}
|
|
213
|
-
function
|
|
213
|
+
function pe(t) {
|
|
214
214
|
const e = t.required ? " required" : "", n = t.maxSelect > 1 ? "Multiple" : "Single";
|
|
215
215
|
return p`
|
|
216
216
|
<FileForm.Field {form} name="${t.name}" class="col-span-1">
|
|
@@ -237,7 +237,7 @@ function ue(t) {
|
|
|
237
237
|
</FileForm.Field>
|
|
238
238
|
`;
|
|
239
239
|
}
|
|
240
|
-
function
|
|
240
|
+
function de(t) {
|
|
241
241
|
const e = t.maxSelect > 1 ? "multiple" : "single", n = t.required ? " required" : "", r = t.maxSelect > 1 ? "Select options" : "Select an option", a = t.options.map(
|
|
242
242
|
(s) => `<MultiSelect.Item value=${JSON.stringify(s.value)} label={${t.name}Labels[${JSON.stringify(s.value)}].label} />`
|
|
243
243
|
).join(`
|
|
@@ -275,7 +275,7 @@ function pe(t) {
|
|
|
275
275
|
</MultiSelect.Field>
|
|
276
276
|
`;
|
|
277
277
|
}
|
|
278
|
-
function
|
|
278
|
+
function fe(t) {
|
|
279
279
|
const e = t.maxSelect > 1 ? "multiple" : "single", n = t.maxSelect > 1 ? `Select ${t.relatedModel.pluralDisplayName.toLowerCase()}` : `Select ${t.relatedModel.displayName.toLowerCase()}`, r = `Search ${t.relatedModel.pluralDisplayName.toLowerCase()}...`, a = `No ${t.relatedModel.pluralDisplayName.toLowerCase()} found`, s = t.relatedModel.name, i = t.relatedModel.pluralName;
|
|
280
280
|
return p`
|
|
281
281
|
<MultiSelect.Field {form} type="${e}" name="${t.name}" class="col-span-1">
|
|
@@ -313,7 +313,7 @@ function de(t) {
|
|
|
313
313
|
</MultiSelect.Field>
|
|
314
314
|
`;
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function he(t) {
|
|
317
317
|
return p`
|
|
318
318
|
<Form.Field {form} name="${t.name}" class="col-span-1">
|
|
319
319
|
<Form.Control>
|
|
@@ -341,25 +341,25 @@ function tt(t) {
|
|
|
341
341
|
case "url":
|
|
342
342
|
return T(t, "url");
|
|
343
343
|
case "autodate":
|
|
344
|
-
return
|
|
344
|
+
return he(t);
|
|
345
345
|
case "editor":
|
|
346
346
|
case "json":
|
|
347
|
-
return le(t);
|
|
348
|
-
case "bool":
|
|
349
347
|
return ce(t);
|
|
350
|
-
case "
|
|
348
|
+
case "bool":
|
|
351
349
|
return me(t);
|
|
352
|
-
case "
|
|
350
|
+
case "geoPoint":
|
|
353
351
|
return ue(t);
|
|
354
|
-
case "
|
|
352
|
+
case "file":
|
|
355
353
|
return pe(t);
|
|
356
|
-
case "
|
|
354
|
+
case "select":
|
|
357
355
|
return de(t);
|
|
356
|
+
case "relation":
|
|
357
|
+
return fe(t);
|
|
358
358
|
default:
|
|
359
359
|
return t;
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function Dt(t) {
|
|
363
363
|
const e = t.options.map(
|
|
364
364
|
(n) => p`
|
|
365
365
|
${JSON.stringify(n.value)}: {
|
|
@@ -376,11 +376,11 @@ function zt(t) {
|
|
|
376
376
|
`;
|
|
377
377
|
}
|
|
378
378
|
function L(t) {
|
|
379
|
-
const e = t.flatMap((n) =>
|
|
379
|
+
const e = t.flatMap((n) => ie[n.type]);
|
|
380
380
|
return [...new Set(e)];
|
|
381
381
|
}
|
|
382
382
|
function et(t) {
|
|
383
|
-
return [...new Set(t.flatMap((e) =>
|
|
383
|
+
return [...new Set(t.flatMap((e) => le[e]))];
|
|
384
384
|
}
|
|
385
385
|
function k(t, e) {
|
|
386
386
|
return `data.${t.name}.${e.name}`;
|
|
@@ -393,7 +393,7 @@ function Y(t, e, n) {
|
|
|
393
393
|
</div>
|
|
394
394
|
`;
|
|
395
395
|
}
|
|
396
|
-
function
|
|
396
|
+
function ge(t, e) {
|
|
397
397
|
const n = k(t, e), r = `<p class="text-muted-foreground">{new Date(${n}).toLocaleDateString()}</p>`, a = e.required ? r : p`
|
|
398
398
|
{#if ${n}}
|
|
399
399
|
${r}
|
|
@@ -406,7 +406,7 @@ function he(t, e) {
|
|
|
406
406
|
</div>
|
|
407
407
|
`;
|
|
408
408
|
}
|
|
409
|
-
function
|
|
409
|
+
function be(t, e) {
|
|
410
410
|
const n = k(t, e), r = p`
|
|
411
411
|
<a href={${n}} target="_blank" rel="noopener noreferrer">
|
|
412
412
|
{${n}}
|
|
@@ -425,7 +425,7 @@ function ge(t, e) {
|
|
|
425
425
|
</div>
|
|
426
426
|
`;
|
|
427
427
|
}
|
|
428
|
-
function
|
|
428
|
+
function ve(t, e) {
|
|
429
429
|
const n = k(t, e);
|
|
430
430
|
if (e.maxSelect > 1)
|
|
431
431
|
return p`
|
|
@@ -448,7 +448,7 @@ function be(t, e) {
|
|
|
448
448
|
</div>
|
|
449
449
|
`;
|
|
450
450
|
}
|
|
451
|
-
function
|
|
451
|
+
function we(t, e) {
|
|
452
452
|
const n = k(t, e);
|
|
453
453
|
return e.maxSelect > 1 ? p`
|
|
454
454
|
<div class="space-y-2">
|
|
@@ -494,11 +494,11 @@ function ve(t, e) {
|
|
|
494
494
|
</div>
|
|
495
495
|
`;
|
|
496
496
|
}
|
|
497
|
-
function
|
|
497
|
+
function ye(t) {
|
|
498
498
|
return `/${t.relatedModel.routeSegment}`;
|
|
499
499
|
}
|
|
500
|
-
function
|
|
501
|
-
const n = `data.${t.name}.expand?.${e.name}`, r =
|
|
500
|
+
function xe(t, e) {
|
|
501
|
+
const n = `data.${t.name}.expand?.${e.name}`, r = ye(e);
|
|
502
502
|
return e.maxSelect > 1 ? p`
|
|
503
503
|
<div class="space-y-2">
|
|
504
504
|
<h3 class="font-medium leading-none">${e.title}</h3>
|
|
@@ -525,7 +525,7 @@ function ye(t, e) {
|
|
|
525
525
|
</div>
|
|
526
526
|
`;
|
|
527
527
|
}
|
|
528
|
-
function
|
|
528
|
+
function $e(t, e) {
|
|
529
529
|
const n = k(t, e), r = p`
|
|
530
530
|
{#await import("$lib/components/ui/leaflet/leaflet.svelte")}
|
|
531
531
|
<div class="h-56.25 w-full bg-input rounded-md"></div>
|
|
@@ -547,7 +547,7 @@ function xe(t, e) {
|
|
|
547
547
|
</div>
|
|
548
548
|
`;
|
|
549
549
|
}
|
|
550
|
-
function
|
|
550
|
+
function Fe(t, e) {
|
|
551
551
|
switch (e.type) {
|
|
552
552
|
case "text":
|
|
553
553
|
case "number":
|
|
@@ -571,27 +571,27 @@ function $e(t, e) {
|
|
|
571
571
|
);
|
|
572
572
|
case "date":
|
|
573
573
|
case "autodate":
|
|
574
|
-
return he(t, e);
|
|
575
|
-
case "url":
|
|
576
574
|
return ge(t, e);
|
|
577
|
-
case "
|
|
575
|
+
case "url":
|
|
578
576
|
return be(t, e);
|
|
579
|
-
case "
|
|
577
|
+
case "select":
|
|
580
578
|
return ve(t, e);
|
|
579
|
+
case "file":
|
|
580
|
+
return we(t, e);
|
|
581
581
|
case "json":
|
|
582
582
|
return Y(t, e, `{JSON.stringify(${k(t, e)})}`);
|
|
583
583
|
case "geoPoint":
|
|
584
|
-
return
|
|
584
|
+
return $e(t, e);
|
|
585
585
|
case "relation":
|
|
586
|
-
return
|
|
586
|
+
return xe(t, e);
|
|
587
587
|
default:
|
|
588
588
|
return e;
|
|
589
589
|
}
|
|
590
590
|
}
|
|
591
|
-
const
|
|
592
|
-
function
|
|
591
|
+
const Ce = new RegExp("([\\p{Ll}\\d])(\\p{Lu})", "gu"), _e = new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])", "gu"), Se = new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d", "u"), ke = /[^\p{L}\d]+/giu, ut = "$1\0$2", pt = "";
|
|
592
|
+
function At(t) {
|
|
593
593
|
let e = t.trim();
|
|
594
|
-
e = e.replace(
|
|
594
|
+
e = e.replace(Ce, ut).replace(_e, ut), e = e.replace(ke, "\0");
|
|
595
595
|
let n = 0, r = e.length;
|
|
596
596
|
for (; e.charAt(n) === "\0"; )
|
|
597
597
|
n++;
|
|
@@ -601,10 +601,10 @@ function Dt(t) {
|
|
|
601
601
|
r--;
|
|
602
602
|
return e.slice(n, r).split(/\0/g);
|
|
603
603
|
}
|
|
604
|
-
function
|
|
605
|
-
const e =
|
|
604
|
+
function Me(t) {
|
|
605
|
+
const e = At(t);
|
|
606
606
|
for (let n = 0; n < e.length; n++) {
|
|
607
|
-
const r = e[n], a =
|
|
607
|
+
const r = e[n], a = Se.exec(r);
|
|
608
608
|
if (a) {
|
|
609
609
|
const s = a.index + (a[1] ?? a[2]).length;
|
|
610
610
|
e.splice(n, 1, r.slice(0, s), r.slice(s));
|
|
@@ -612,27 +612,27 @@ function ke(t) {
|
|
|
612
612
|
}
|
|
613
613
|
return e;
|
|
614
614
|
}
|
|
615
|
-
function
|
|
615
|
+
function Nt(t, e) {
|
|
616
616
|
const [n, r, a] = H(t, e);
|
|
617
617
|
return n + r.map(V(e == null ? void 0 : e.locale)).join((e == null ? void 0 : e.delimiter) ?? " ") + a;
|
|
618
618
|
}
|
|
619
619
|
function A(t, e) {
|
|
620
|
-
const [n, r, a] = H(t, e), s = V(e == null ? void 0 : e.locale), i = rt(e == null ? void 0 : e.locale), o =
|
|
620
|
+
const [n, r, a] = H(t, e), s = V(e == null ? void 0 : e.locale), i = rt(e == null ? void 0 : e.locale), o = Bt(s, i);
|
|
621
621
|
return n + r.map((c, m) => m === 0 ? s(c) : o(c, m)).join("") + a;
|
|
622
622
|
}
|
|
623
|
-
function
|
|
624
|
-
const [n, r, a] = H(t, e), s = V(e == null ? void 0 : e.locale), i = rt(e == null ? void 0 : e.locale), o =
|
|
623
|
+
function Pe(t, e) {
|
|
624
|
+
const [n, r, a] = H(t, e), s = V(e == null ? void 0 : e.locale), i = rt(e == null ? void 0 : e.locale), o = Bt(s, i);
|
|
625
625
|
return n + r.map(o).join("") + a;
|
|
626
626
|
}
|
|
627
627
|
function nt(t, e) {
|
|
628
628
|
const [n, r, a] = H(t, e), s = V(e == null ? void 0 : e.locale), i = rt(e == null ? void 0 : e.locale);
|
|
629
|
-
return n + r.map(
|
|
630
|
-
}
|
|
631
|
-
function Pe(t, e) {
|
|
632
|
-
return At(t, { delimiter: "-", ...e });
|
|
629
|
+
return n + r.map(Ie(s, i)).join(" ") + a;
|
|
633
630
|
}
|
|
634
631
|
function Re(t, e) {
|
|
635
|
-
return
|
|
632
|
+
return Nt(t, { delimiter: "-", ...e });
|
|
633
|
+
}
|
|
634
|
+
function Ee(t, e) {
|
|
635
|
+
return Nt(t, { delimiter: "_", ...e });
|
|
636
636
|
}
|
|
637
637
|
function V(t) {
|
|
638
638
|
return t === !1 ? (e) => e.toLowerCase() : (e) => e.toLocaleLowerCase(t);
|
|
@@ -640,17 +640,17 @@ function V(t) {
|
|
|
640
640
|
function rt(t) {
|
|
641
641
|
return (e) => e.toLocaleUpperCase(t);
|
|
642
642
|
}
|
|
643
|
-
function
|
|
643
|
+
function Ie(t, e) {
|
|
644
644
|
return (n) => `${e(n[0])}${t(n.slice(1))}`;
|
|
645
645
|
}
|
|
646
|
-
function
|
|
646
|
+
function Bt(t, e) {
|
|
647
647
|
return (n, r) => {
|
|
648
648
|
const a = n[0];
|
|
649
649
|
return (r > 0 && a >= "0" && a <= "9" ? "_" + a : e(a)) + t(n.slice(1));
|
|
650
650
|
};
|
|
651
651
|
}
|
|
652
652
|
function H(t, e = {}) {
|
|
653
|
-
const n = e.split ?? (e.separateNumbers ?
|
|
653
|
+
const n = e.split ?? (e.separateNumbers ? Me : At), r = e.prefixCharacters ?? pt, a = e.suffixCharacters ?? pt;
|
|
654
654
|
let s = 0, i = t.length;
|
|
655
655
|
for (; s < t.length; ) {
|
|
656
656
|
const o = t.charAt(s);
|
|
@@ -670,18 +670,18 @@ function H(t, e = {}) {
|
|
|
670
670
|
t.slice(i)
|
|
671
671
|
];
|
|
672
672
|
}
|
|
673
|
-
function
|
|
673
|
+
function Te(t) {
|
|
674
674
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
675
675
|
}
|
|
676
|
-
function
|
|
676
|
+
function ze(t) {
|
|
677
677
|
throw new Error('Could not dynamically require "' + t + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
678
678
|
}
|
|
679
|
-
var U = { exports: {} },
|
|
680
|
-
function
|
|
679
|
+
var U = { exports: {} }, De = U.exports, dt;
|
|
680
|
+
function Ae() {
|
|
681
681
|
return dt || (dt = 1, (function(t, e) {
|
|
682
682
|
(function(n, r) {
|
|
683
|
-
typeof
|
|
684
|
-
})(
|
|
683
|
+
typeof ze == "function" ? t.exports = r() : n.pluralize = r();
|
|
684
|
+
})(De, function() {
|
|
685
685
|
var n = [], r = [], a = {}, s = {}, i = {};
|
|
686
686
|
function o(l) {
|
|
687
687
|
return typeof l == "string" ? new RegExp("^" + l + "$", "i") : l;
|
|
@@ -976,8 +976,8 @@ function De() {
|
|
|
976
976
|
});
|
|
977
977
|
})(U)), U.exports;
|
|
978
978
|
}
|
|
979
|
-
var
|
|
980
|
-
const S = /* @__PURE__ */
|
|
979
|
+
var Ne = Ae();
|
|
980
|
+
const S = /* @__PURE__ */ Te(Ne), ha = "data", ga = "migrations", Be = "(app)", je = /* @__PURE__ */ new Set([
|
|
981
981
|
"break",
|
|
982
982
|
"case",
|
|
983
983
|
"catch",
|
|
@@ -1029,7 +1029,7 @@ const S = /* @__PURE__ */ Ie(Ae), fa = "data", ha = "migrations", Ne = "(app)",
|
|
|
1029
1029
|
"async",
|
|
1030
1030
|
"arguments",
|
|
1031
1031
|
"constructor"
|
|
1032
|
-
]),
|
|
1032
|
+
]), Le = {
|
|
1033
1033
|
function: "fn",
|
|
1034
1034
|
interface: "iface",
|
|
1035
1035
|
type: "type_",
|
|
@@ -1079,7 +1079,7 @@ const S = /* @__PURE__ */ Ie(Ae), fa = "data", ha = "migrations", Ne = "(app)",
|
|
|
1079
1079
|
constructor: "ctor"
|
|
1080
1080
|
};
|
|
1081
1081
|
function J(t) {
|
|
1082
|
-
return
|
|
1082
|
+
return je.has(t) ? Le[t] ?? `${t}_` : t;
|
|
1083
1083
|
}
|
|
1084
1084
|
function G(t) {
|
|
1085
1085
|
if (!/^[a-zA-Z][a-zA-Z0-9-_/]*$/.test(t))
|
|
@@ -1087,24 +1087,24 @@ function G(t) {
|
|
|
1087
1087
|
"Model path must start with a letter and contain only alphanumeric characters, dash, slash, or underscore"
|
|
1088
1088
|
);
|
|
1089
1089
|
}
|
|
1090
|
-
function
|
|
1091
|
-
return t.features.auth ? `src/routes/${
|
|
1090
|
+
function Oe(t) {
|
|
1091
|
+
return t.features.auth ? `src/routes/${Be}` : "src/routes";
|
|
1092
1092
|
}
|
|
1093
1093
|
function R(t, e) {
|
|
1094
|
-
const n = t.split("/"), r = n[n.length - 1], a = n.slice(0, -1), s = S.singular(nt(r)), i = S.plural(s), o = A(s), c =
|
|
1094
|
+
const n = t.split("/"), r = n[n.length - 1], a = n.slice(0, -1), s = S.singular(nt(r)), i = S.plural(s), o = A(s), c = Re(i), m = [...a, c].join("/");
|
|
1095
1095
|
return {
|
|
1096
1096
|
name: J(o),
|
|
1097
1097
|
pluralName: J(A(i)),
|
|
1098
|
-
typeName:
|
|
1099
|
-
tableName:
|
|
1098
|
+
typeName: Pe(s),
|
|
1099
|
+
tableName: Ee(i),
|
|
1100
1100
|
displayName: s,
|
|
1101
1101
|
pluralDisplayName: i,
|
|
1102
1102
|
schemaName: `${J(o)}Schema`,
|
|
1103
1103
|
routeSegment: m,
|
|
1104
|
-
routesDir:
|
|
1104
|
+
routesDir: Oe(e)
|
|
1105
1105
|
};
|
|
1106
1106
|
}
|
|
1107
|
-
function
|
|
1107
|
+
function jt(t) {
|
|
1108
1108
|
const e = `${t.routesDir}/${t.routeSegment}`;
|
|
1109
1109
|
return {
|
|
1110
1110
|
list: e,
|
|
@@ -1113,7 +1113,7 @@ function Bt(t) {
|
|
|
1113
1113
|
edit: `${e}/[id]/edit`
|
|
1114
1114
|
};
|
|
1115
1115
|
}
|
|
1116
|
-
function
|
|
1116
|
+
function Lt(t) {
|
|
1117
1117
|
const e = `/${t.routeSegment}`;
|
|
1118
1118
|
return {
|
|
1119
1119
|
list: e,
|
|
@@ -1122,7 +1122,7 @@ function jt(t) {
|
|
|
1122
1122
|
edit: `${e}/[id]/edit`
|
|
1123
1123
|
};
|
|
1124
1124
|
}
|
|
1125
|
-
const
|
|
1125
|
+
const qe = [
|
|
1126
1126
|
"title",
|
|
1127
1127
|
"name",
|
|
1128
1128
|
"label",
|
|
@@ -1156,24 +1156,24 @@ const Oe = [
|
|
|
1156
1156
|
"url",
|
|
1157
1157
|
"id"
|
|
1158
1158
|
];
|
|
1159
|
-
function
|
|
1160
|
-
for (const e of
|
|
1159
|
+
function Ue(t) {
|
|
1160
|
+
for (const e of qe)
|
|
1161
1161
|
if (t.some((n) => n.name === e))
|
|
1162
1162
|
return e;
|
|
1163
1163
|
return "id";
|
|
1164
1164
|
}
|
|
1165
|
-
function
|
|
1165
|
+
function Ve(t) {
|
|
1166
1166
|
return t.map((e) => e.name).filter((e) => !e.startsWith("_"));
|
|
1167
1167
|
}
|
|
1168
|
-
function
|
|
1168
|
+
function He(t) {
|
|
1169
1169
|
return Object.fromEntries(t.map((e) => [e.name, e.id]));
|
|
1170
1170
|
}
|
|
1171
|
-
function
|
|
1171
|
+
function Ot(t) {
|
|
1172
1172
|
return Object.fromEntries(
|
|
1173
|
-
t.map((e) => [e.name,
|
|
1173
|
+
t.map((e) => [e.name, Ue(e.fields)])
|
|
1174
1174
|
);
|
|
1175
1175
|
}
|
|
1176
|
-
const
|
|
1176
|
+
const Ge = [
|
|
1177
1177
|
"user",
|
|
1178
1178
|
"owner",
|
|
1179
1179
|
"created_by",
|
|
@@ -1193,9 +1193,9 @@ function ft(t) {
|
|
|
1193
1193
|
operator: "="
|
|
1194
1194
|
};
|
|
1195
1195
|
}
|
|
1196
|
-
function
|
|
1196
|
+
function Ke(t, e, n = {}) {
|
|
1197
1197
|
const r = new Set((n.authCollections ?? ["users"]).map(z)), a = new Set(
|
|
1198
|
-
(n.userFieldHints ??
|
|
1198
|
+
(n.userFieldHints ?? Ge).map(z)
|
|
1199
1199
|
), s = n.maxDepth ?? 8, i = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
|
|
1200
1200
|
for (const b of t)
|
|
1201
1201
|
i.set(b.name, b), o.set(b.id, b);
|
|
@@ -1239,8 +1239,8 @@ function Ge(t, e, n = {}) {
|
|
|
1239
1239
|
return h(b[b.length - 1].to);
|
|
1240
1240
|
}
|
|
1241
1241
|
function g(b) {
|
|
1242
|
-
const v = b[b.length - 1], C = v.isMulti ? 1 : 0, y = b.every((X) => !X.isMulti) ? 1 : 0, I = b.reduce((X,
|
|
1243
|
-
return 100 * b.length + 50 * C - 40 *
|
|
1242
|
+
const v = b[b.length - 1], C = v.isMulti ? 1 : 0, y = b.every((X) => !X.isMulti) ? 1 : 0, I = b.reduce((X, ne) => X + ne.hintScore, 0), ee = z(v.fieldName) === "user" ? 1 : 0;
|
|
1243
|
+
return 100 * b.length + 50 * C - 40 * ee - 15 * y - I;
|
|
1244
1244
|
}
|
|
1245
1245
|
function x(b) {
|
|
1246
1246
|
return b.map((v) => `${v.from}.${v.fieldName}->${v.to}`).join("|");
|
|
@@ -1262,15 +1262,15 @@ function Ge(t, e, n = {}) {
|
|
|
1262
1262
|
const C = g(b) - g(v);
|
|
1263
1263
|
return C !== 0 ? C : x(b).localeCompare(x(v));
|
|
1264
1264
|
});
|
|
1265
|
-
const w = u[0], $ = w.map((b) => b.fieldName), F = [e, ...w.map((b) => b.to)], it = w[w.length - 1].isMulti ? "?=" : "=",
|
|
1265
|
+
const w = u[0], $ = w.map((b) => b.fieldName), F = [e, ...w.map((b) => b.to)], it = w[w.length - 1].isMulti ? "?=" : "=", Qt = $.join("."), te = n.includeRootPrefix ? (n.rootPrefix ?? e) + "." : "";
|
|
1266
1266
|
return {
|
|
1267
|
-
rule: `@request.auth.id ${it} ${
|
|
1267
|
+
rule: `@request.auth.id ${it} ${te}${Qt}.id`,
|
|
1268
1268
|
ownershipChainCollections: F,
|
|
1269
1269
|
ownershipChainFields: $,
|
|
1270
1270
|
operator: it
|
|
1271
1271
|
};
|
|
1272
1272
|
}
|
|
1273
|
-
function
|
|
1273
|
+
function We(t) {
|
|
1274
1274
|
let e = null, n = !1, r = 0;
|
|
1275
1275
|
for (let a = 0; a < t.length; a++) {
|
|
1276
1276
|
const s = t[a];
|
|
@@ -1335,7 +1335,7 @@ function gt(t) {
|
|
|
1335
1335
|
let a, s;
|
|
1336
1336
|
return e >= 0 ? (a = t.slice(0, e).trim(), s = t.slice(e + 1).trim()) : (a = t.trim(), s = a), { label: ht(s), value: ht(a) };
|
|
1337
1337
|
}
|
|
1338
|
-
function
|
|
1338
|
+
function Xe(t) {
|
|
1339
1339
|
const e = [];
|
|
1340
1340
|
let n = "", r = null, a = !1;
|
|
1341
1341
|
for (let i = 0; i < t.length; i++) {
|
|
@@ -1383,12 +1383,12 @@ const bt = {
|
|
|
1383
1383
|
datetime: "date",
|
|
1384
1384
|
timestamp: "date"
|
|
1385
1385
|
};
|
|
1386
|
-
function
|
|
1386
|
+
function Ye(t) {
|
|
1387
1387
|
const e = t.endsWith("!");
|
|
1388
1388
|
let n = e ? t.slice(0, -1) : t, r = [];
|
|
1389
1389
|
if (n.startsWith("select(") && n.endsWith(")")) {
|
|
1390
1390
|
const a = n.slice(7, -1);
|
|
1391
|
-
r =
|
|
1391
|
+
r = Xe(a), n = "select";
|
|
1392
1392
|
}
|
|
1393
1393
|
return n === "files" ? { type: "file", required: e, selectOptions: r } : (n in bt && (n = bt[n]), { type: n, required: e, selectOptions: r });
|
|
1394
1394
|
}
|
|
@@ -1411,8 +1411,8 @@ function O(t, e, n, r, a, s) {
|
|
|
1411
1411
|
maxSelect: t === c ? 999 : 1
|
|
1412
1412
|
};
|
|
1413
1413
|
}
|
|
1414
|
-
function
|
|
1415
|
-
const s = nt(t), { type: i, required: o, selectOptions: c } = e, m =
|
|
1414
|
+
function Je(t, e, n, r, a) {
|
|
1415
|
+
const s = nt(t), { type: i, required: o, selectOptions: c } = e, m = Ve(r), h = He(r), f = Ot(r), g = m.map((u) => S.singular(u));
|
|
1416
1416
|
if (a.features.auth && i === "current_user" && h.users) {
|
|
1417
1417
|
const u = O(
|
|
1418
1418
|
t,
|
|
@@ -1565,10 +1565,10 @@ function Ye(t, e, n, r, a) {
|
|
|
1565
1565
|
);
|
|
1566
1566
|
return { type: i, name: t, title: s, required: o };
|
|
1567
1567
|
}
|
|
1568
|
-
function
|
|
1568
|
+
function Ze(t, e, n, r) {
|
|
1569
1569
|
const a = [];
|
|
1570
1570
|
for (const i of t) {
|
|
1571
|
-
const [o, c] =
|
|
1571
|
+
const [o, c] = We(i);
|
|
1572
1572
|
if (!o || !c)
|
|
1573
1573
|
throw new Error(
|
|
1574
1574
|
`Invalid field format: ${i}. Expected format: name:type or name:type!`
|
|
@@ -1577,10 +1577,10 @@ function Je(t, e, n, r) {
|
|
|
1577
1577
|
throw new Error(
|
|
1578
1578
|
`Invalid field name: ${o}. Must start with a letter and contain only alphanumeric characters`
|
|
1579
1579
|
);
|
|
1580
|
-
const m =
|
|
1581
|
-
a.push(
|
|
1580
|
+
const m = Ye(c);
|
|
1581
|
+
a.push(Je(o, m, e, n, r));
|
|
1582
1582
|
}
|
|
1583
|
-
const s = r.features.auth ?
|
|
1583
|
+
const s = r.features.auth ? Ke(
|
|
1584
1584
|
[
|
|
1585
1585
|
...n,
|
|
1586
1586
|
{
|
|
@@ -1602,15 +1602,15 @@ function Je(t, e, n, r) {
|
|
|
1602
1602
|
async function K(t, e, n) {
|
|
1603
1603
|
let r;
|
|
1604
1604
|
if (n.env === "runtime") {
|
|
1605
|
-
const { getCollections: a } = await import("./env.runtime-
|
|
1605
|
+
const { getCollections: a } = await import("./env.runtime-arRRKYvH.js");
|
|
1606
1606
|
r = await a();
|
|
1607
1607
|
} else {
|
|
1608
1608
|
const { getPreviewCollections: a } = await import("./env.preview-HlXZOEL4.js");
|
|
1609
1609
|
r = a(n);
|
|
1610
1610
|
}
|
|
1611
|
-
return
|
|
1611
|
+
return Ze(t, e, r, n);
|
|
1612
1612
|
}
|
|
1613
|
-
const
|
|
1613
|
+
const Qe = "2024-01-01T00:00:00.000Z";
|
|
1614
1614
|
class N {
|
|
1615
1615
|
constructor(e) {
|
|
1616
1616
|
this.expression = e;
|
|
@@ -1624,7 +1624,7 @@ function Z(t) {
|
|
|
1624
1624
|
([n, r]) => `${JSON.stringify(n)}: ${Q(r)}`
|
|
1625
1625
|
).join(", ")} }`;
|
|
1626
1626
|
}
|
|
1627
|
-
function
|
|
1627
|
+
function tn(t) {
|
|
1628
1628
|
switch (t) {
|
|
1629
1629
|
case "text":
|
|
1630
1630
|
case "number":
|
|
@@ -1663,7 +1663,7 @@ function Qe(t) {
|
|
|
1663
1663
|
function D(t, e) {
|
|
1664
1664
|
return t.replace("[id]", `\${${e}}`);
|
|
1665
1665
|
}
|
|
1666
|
-
function
|
|
1666
|
+
function qt(t, e, n) {
|
|
1667
1667
|
var r, a, s;
|
|
1668
1668
|
switch (t.type) {
|
|
1669
1669
|
case "text":
|
|
@@ -1674,7 +1674,7 @@ function Ot(t, e, n) {
|
|
|
1674
1674
|
case "bool":
|
|
1675
1675
|
return !0;
|
|
1676
1676
|
case "date":
|
|
1677
|
-
return
|
|
1677
|
+
return Qe;
|
|
1678
1678
|
case "email":
|
|
1679
1679
|
return `test-${t.name}@example.com`;
|
|
1680
1680
|
case "password":
|
|
@@ -1711,18 +1711,18 @@ function wt(t, e, n) {
|
|
|
1711
1711
|
n.forForm || (r[a.name] = new N("context.user.id"));
|
|
1712
1712
|
continue;
|
|
1713
1713
|
}
|
|
1714
|
-
const s =
|
|
1714
|
+
const s = qt(a, e, n);
|
|
1715
1715
|
s !== void 0 && (r[a.name] = s);
|
|
1716
1716
|
}
|
|
1717
1717
|
return r;
|
|
1718
1718
|
}
|
|
1719
|
-
function
|
|
1719
|
+
function en(t, e, n) {
|
|
1720
1720
|
var a;
|
|
1721
1721
|
const r = {};
|
|
1722
1722
|
for (const s of t) {
|
|
1723
1723
|
if (s.system || s.name === "id")
|
|
1724
1724
|
continue;
|
|
1725
|
-
const i =
|
|
1725
|
+
const i = tn(s.type);
|
|
1726
1726
|
if (!i || i === "file" || i === "autodate" || i === "relation" && !s.collectionId)
|
|
1727
1727
|
continue;
|
|
1728
1728
|
let o;
|
|
@@ -1734,7 +1734,7 @@ function tn(t, e, n) {
|
|
|
1734
1734
|
const c = ((a = s.values) == null ? void 0 : a[0]) ?? "default";
|
|
1735
1735
|
o = (s.maxSelect ?? 1) > 1 ? [c] : c;
|
|
1736
1736
|
} else
|
|
1737
|
-
o =
|
|
1737
|
+
o = qt(
|
|
1738
1738
|
{ name: s.name, type: i },
|
|
1739
1739
|
e,
|
|
1740
1740
|
{ forForm: !1, authEnabled: n.features.auth }
|
|
@@ -1743,12 +1743,12 @@ function tn(t, e, n) {
|
|
|
1743
1743
|
}
|
|
1744
1744
|
return r;
|
|
1745
1745
|
}
|
|
1746
|
-
function
|
|
1746
|
+
function nn(t) {
|
|
1747
1747
|
t.email = new N(
|
|
1748
1748
|
"`test-${Math.random().toString(36).slice(2)}@example.com`"
|
|
1749
1749
|
), t.password = "password", t.passwordConfirm = "password";
|
|
1750
1750
|
}
|
|
1751
|
-
function
|
|
1751
|
+
function rn(t, e) {
|
|
1752
1752
|
if (!t)
|
|
1753
1753
|
return [];
|
|
1754
1754
|
const n = new Map(e.map((o) => [o.id, o])), r = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), s = [], i = (o) => {
|
|
@@ -1766,7 +1766,7 @@ function nn(t, e) {
|
|
|
1766
1766
|
o.type !== "relation" || !o.collectionId || i(o.collectionId);
|
|
1767
1767
|
return s;
|
|
1768
1768
|
}
|
|
1769
|
-
function
|
|
1769
|
+
function an(t, e) {
|
|
1770
1770
|
if (!e.has(t))
|
|
1771
1771
|
return e.add(t), t;
|
|
1772
1772
|
let n = 2;
|
|
@@ -1775,7 +1775,7 @@ function rn(t, e) {
|
|
|
1775
1775
|
const r = `${t}${n}`;
|
|
1776
1776
|
return e.add(r), r;
|
|
1777
1777
|
}
|
|
1778
|
-
function
|
|
1778
|
+
function on(t, e) {
|
|
1779
1779
|
return {
|
|
1780
1780
|
id: `generated-${t.tableName}`,
|
|
1781
1781
|
name: t.tableName,
|
|
@@ -1797,24 +1797,24 @@ function an(t, e) {
|
|
|
1797
1797
|
} : { name: n.name, type: n.type })
|
|
1798
1798
|
};
|
|
1799
1799
|
}
|
|
1800
|
-
function
|
|
1801
|
-
const a = r.find((l) => l.name === t.tableName) ??
|
|
1800
|
+
function Ut(t, e, n, r) {
|
|
1801
|
+
const a = r.find((l) => l.name === t.tableName) ?? on(t, e), s = rn(a, r).filter(
|
|
1802
1802
|
(l) => !(n.features.auth && l.name === "users")
|
|
1803
1803
|
), i = {}, o = [], c = /* @__PURE__ */ new Set();
|
|
1804
1804
|
for (const l of s) {
|
|
1805
|
-
const d =
|
|
1805
|
+
const d = an(R(l.name, n).name, c);
|
|
1806
1806
|
o.push({ varName: d, collection: l }), i[l.id] = `${d}.id`;
|
|
1807
1807
|
}
|
|
1808
1808
|
const m = o.length ? `${o.map((l) => `let ${l.varName}: { id: string };`).join(`
|
|
1809
1809
|
`)}
|
|
1810
1810
|
|
|
1811
1811
|
` : "", h = o.map(({ varName: l, collection: d }) => {
|
|
1812
|
-
const w =
|
|
1812
|
+
const w = en(
|
|
1813
1813
|
d.fields,
|
|
1814
1814
|
i,
|
|
1815
1815
|
n
|
|
1816
1816
|
);
|
|
1817
|
-
return d.type === "auth" &&
|
|
1817
|
+
return d.type === "auth" && nn(w), `${l} = await context.admin.collection("${d.name}").create(${Z(w)});`;
|
|
1818
1818
|
}), f = o.slice().reverse().map(
|
|
1819
1819
|
({ varName: l, collection: d }) => `await context.admin.collection("${d.name}").delete(${l}.id);`
|
|
1820
1820
|
), g = n.features.auth ? "context.agent" : "context.request", x = n.features.auth ? `await context.agent.authenticateUser();
|
|
@@ -1850,8 +1850,8 @@ function qt(t, e, n, r) {
|
|
|
1850
1850
|
)
|
|
1851
1851
|
};
|
|
1852
1852
|
}
|
|
1853
|
-
function
|
|
1854
|
-
const { declarations: s, setupSection: i, requestAgent: o, modelDbData: c, modelFormData: m } =
|
|
1853
|
+
function sn(t, e, n, r, a) {
|
|
1854
|
+
const { declarations: s, setupSection: i, requestAgent: o, modelDbData: c, modelFormData: m } = Ut(t, n, r, a);
|
|
1855
1855
|
return p`
|
|
1856
1856
|
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
1857
1857
|
|
|
@@ -1928,8 +1928,8 @@ function on(t, e, n, r, a) {
|
|
|
1928
1928
|
});
|
|
1929
1929
|
`;
|
|
1930
1930
|
}
|
|
1931
|
-
function
|
|
1932
|
-
const { declarations: s, setupSection: i, requestAgent: o, modelFormData: c } =
|
|
1931
|
+
function ln(t, e, n, r, a) {
|
|
1932
|
+
const { declarations: s, setupSection: i, requestAgent: o, modelFormData: c } = Ut(t, n, r, a);
|
|
1933
1933
|
return p`
|
|
1934
1934
|
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
1935
1935
|
|
|
@@ -1952,9 +1952,9 @@ function sn(t, e, n, r, a) {
|
|
|
1952
1952
|
});
|
|
1953
1953
|
`;
|
|
1954
1954
|
}
|
|
1955
|
-
var yt = Object.freeze,
|
|
1956
|
-
const $t = 2,
|
|
1957
|
-
function
|
|
1955
|
+
var yt = Object.freeze, cn = Object.defineProperty, mn = (t, e) => yt(cn(t, "raw", { value: yt(t.slice()) })), xt;
|
|
1956
|
+
const $t = 2, un = 3;
|
|
1957
|
+
function pn(t) {
|
|
1958
1958
|
if (t.length <= $t)
|
|
1959
1959
|
throw new Error(
|
|
1960
1960
|
"Invalid command arguments. Expected: generate form <model> <fields...>"
|
|
@@ -1964,15 +1964,15 @@ function un(t) {
|
|
|
1964
1964
|
throw new Error(
|
|
1965
1965
|
`Invalid command "${t.join(" ")}". Expected to start with "generate form".`
|
|
1966
1966
|
);
|
|
1967
|
-
const r = t[$t], a = t.slice(
|
|
1967
|
+
const r = t[$t], a = t.slice(un);
|
|
1968
1968
|
if (a.length === 0)
|
|
1969
1969
|
throw new Error("At least one field definition is required.");
|
|
1970
1970
|
return { modelPath: r, fields: a };
|
|
1971
1971
|
}
|
|
1972
|
-
function
|
|
1972
|
+
function Vt(t) {
|
|
1973
1973
|
return t.some((e) => e.type === "file");
|
|
1974
1974
|
}
|
|
1975
|
-
function
|
|
1975
|
+
function dn(t) {
|
|
1976
1976
|
return /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(t) ? t : `'${t}'`;
|
|
1977
1977
|
}
|
|
1978
1978
|
function Ft(t) {
|
|
@@ -2031,7 +2031,7 @@ function Ft(t) {
|
|
|
2031
2031
|
}
|
|
2032
2032
|
return ["text"].includes(t.type) ? t.required ? `${n}.nonempty()` : `${n}.optional()` : t.required || t.type === "geoPoint" ? n : t.type === "file" && t.maxSelect <= 1 ? `${n}.optional().default("")` : `${n}.optional()`;
|
|
2033
2033
|
}
|
|
2034
|
-
function
|
|
2034
|
+
function fn(t) {
|
|
2035
2035
|
const e = [];
|
|
2036
2036
|
for (const n of t) {
|
|
2037
2037
|
if (n.type === "file" && n.maxSelect > 1) {
|
|
@@ -2051,8 +2051,8 @@ function dn(t) {
|
|
|
2051
2051
|
}
|
|
2052
2052
|
return e;
|
|
2053
2053
|
}
|
|
2054
|
-
function
|
|
2055
|
-
const n =
|
|
2054
|
+
function hn(t, e) {
|
|
2055
|
+
const n = fn(e).map((r) => `${dn(r.name)}: ${r.schema}`).join(`,
|
|
2056
2056
|
`);
|
|
2057
2057
|
return p`
|
|
2058
2058
|
import { z } from "zod/v3";
|
|
@@ -2062,7 +2062,7 @@ function fn(t, e) {
|
|
|
2062
2062
|
});
|
|
2063
2063
|
`;
|
|
2064
2064
|
}
|
|
2065
|
-
function
|
|
2065
|
+
function gn(t, e) {
|
|
2066
2066
|
const n = L(e), r = [
|
|
2067
2067
|
'import { untrack } from "svelte";',
|
|
2068
2068
|
'import { superForm } from "sveltekit-superforms";',
|
|
@@ -2072,10 +2072,10 @@ function hn(t, e) {
|
|
|
2072
2072
|
];
|
|
2073
2073
|
return [...new Set(r)];
|
|
2074
2074
|
}
|
|
2075
|
-
function
|
|
2075
|
+
function bn(t, e) {
|
|
2076
2076
|
const r = e.filter(
|
|
2077
2077
|
(a) => a.type === "select"
|
|
2078
|
-
).map((a) =>
|
|
2078
|
+
).map((a) => Dt(a)).join(`
|
|
2079
2079
|
|
|
2080
2080
|
`);
|
|
2081
2081
|
return p`
|
|
@@ -2088,11 +2088,11 @@ function gn(t, e) {
|
|
|
2088
2088
|
const { form: formData } = form;
|
|
2089
2089
|
`;
|
|
2090
2090
|
}
|
|
2091
|
-
function
|
|
2092
|
-
const n =
|
|
2093
|
-
`), r =
|
|
2094
|
-
`), s =
|
|
2095
|
-
return p(xt || (xt =
|
|
2091
|
+
function vn(t, e) {
|
|
2092
|
+
const n = gn(t, e).join(`
|
|
2093
|
+
`), r = bn(t, e), a = e.map((i) => tt(i)).join(`
|
|
2094
|
+
`), s = Vt(e) ? ' enctype="multipart/form-data"' : "";
|
|
2095
|
+
return p(xt || (xt = mn([`
|
|
2096
2096
|
<script lang="ts">
|
|
2097
2097
|
`, `
|
|
2098
2098
|
|
|
@@ -2117,8 +2117,8 @@ function bn(t, e) {
|
|
|
2117
2117
|
</section>
|
|
2118
2118
|
`])), n, r, t.displayName, s, a);
|
|
2119
2119
|
}
|
|
2120
|
-
function
|
|
2121
|
-
const n =
|
|
2120
|
+
function wn(t, e) {
|
|
2121
|
+
const n = Vt(e), r = p`
|
|
2122
2122
|
import { fail, superValidate${n ? ", withFiles" : ""} } from "sveltekit-superforms";
|
|
2123
2123
|
import { zod } from "sveltekit-superforms/adapters";
|
|
2124
2124
|
import { ${t.schemaName} } from "$lib/schemas/${t.name}";
|
|
@@ -2154,17 +2154,17 @@ function q(t, e) {
|
|
|
2154
2154
|
content: e
|
|
2155
2155
|
};
|
|
2156
2156
|
}
|
|
2157
|
-
async function
|
|
2158
|
-
const { modelPath: e, fields: n } =
|
|
2157
|
+
async function yn(t) {
|
|
2158
|
+
const { modelPath: e, fields: n } = pn(t.argv);
|
|
2159
2159
|
G(e);
|
|
2160
|
-
const r = R(e, t), s = (await K(n, r, t)).fields, i =
|
|
2161
|
-
q(`${i.new}/+page.svelte`,
|
|
2162
|
-
q(`${i.new}/+page.server.ts`,
|
|
2160
|
+
const r = R(e, t), s = (await K(n, r, t)).fields, i = jt(r), o = Lt(r), c = t.env === "runtime" ? await (await import("./env.runtime-arRRKYvH.js")).getCollections() : (await import("./env.preview-HlXZOEL4.js")).getPreviewCollections(t), m = [
|
|
2161
|
+
q(`${i.new}/+page.svelte`, vn(r, s)),
|
|
2162
|
+
q(`${i.new}/+page.server.ts`, wn(r, s)),
|
|
2163
2163
|
q(
|
|
2164
2164
|
`${i.new}/server.test.ts`,
|
|
2165
|
-
|
|
2165
|
+
ln(r, o.new, s, t, c)
|
|
2166
2166
|
),
|
|
2167
|
-
q(`src/lib/schemas/${r.name}.ts`,
|
|
2167
|
+
q(`src/lib/schemas/${r.name}.ts`, hn(r, s))
|
|
2168
2168
|
], h = L(s);
|
|
2169
2169
|
return {
|
|
2170
2170
|
creates: m,
|
|
@@ -2175,14 +2175,14 @@ async function wn(t) {
|
|
|
2175
2175
|
collections: []
|
|
2176
2176
|
};
|
|
2177
2177
|
}
|
|
2178
|
-
async function
|
|
2179
|
-
const e = await
|
|
2178
|
+
async function xn(t) {
|
|
2179
|
+
const e = await yn(t);
|
|
2180
2180
|
if (t.env !== "runtime")
|
|
2181
2181
|
return e;
|
|
2182
2182
|
const { writeResult: n } = await import("./write-result-DG5OAbe1.js");
|
|
2183
2183
|
return n(e, t);
|
|
2184
2184
|
}
|
|
2185
|
-
const
|
|
2185
|
+
const $n = {
|
|
2186
2186
|
slug: "generate-form",
|
|
2187
2187
|
title: "Generate a form",
|
|
2188
2188
|
summary: "Generates a form.",
|
|
@@ -2200,8 +2200,8 @@ const xn = {
|
|
|
2200
2200
|
]
|
|
2201
2201
|
},
|
|
2202
2202
|
baseline: "velastack",
|
|
2203
|
-
generate:
|
|
2204
|
-
},
|
|
2203
|
+
generate: xn
|
|
2204
|
+
}, Fn = ["text"], Cn = {
|
|
2205
2205
|
string: "text",
|
|
2206
2206
|
boolean: "bool",
|
|
2207
2207
|
geopoint: "geoPoint",
|
|
@@ -2228,10 +2228,10 @@ const xn = {
|
|
|
2228
2228
|
geoPoint: "geoPoint",
|
|
2229
2229
|
relation: "relation"
|
|
2230
2230
|
};
|
|
2231
|
-
function
|
|
2231
|
+
function _n(t) {
|
|
2232
2232
|
return /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(t) ? t : `'${t}'`;
|
|
2233
2233
|
}
|
|
2234
|
-
function
|
|
2234
|
+
function Sn(t, e) {
|
|
2235
2235
|
const n = t.type === "select" ? `[${(t.options ?? []).map((a) => JSON.stringify(a.value)).join(", ")}]` : "";
|
|
2236
2236
|
let r;
|
|
2237
2237
|
switch (t.type) {
|
|
@@ -2290,7 +2290,7 @@ function _n(t, e) {
|
|
|
2290
2290
|
default:
|
|
2291
2291
|
return t.type;
|
|
2292
2292
|
}
|
|
2293
|
-
return
|
|
2293
|
+
return Fn.includes(t.type) ? t.required ? `${r}.nonempty()` : `${r}.optional()` : t.required || t.type === "geoPoint" ? r : t.type === "file" && (t.maxSelect ?? 1) <= 1 ? `${r}.optional().default("")` : `${r}.optional()`;
|
|
2294
2294
|
}
|
|
2295
2295
|
function at(t, e, n) {
|
|
2296
2296
|
const r = [];
|
|
@@ -2302,7 +2302,7 @@ function at(t, e, n) {
|
|
|
2302
2302
|
}
|
|
2303
2303
|
r.push(o);
|
|
2304
2304
|
}
|
|
2305
|
-
const a = r.map((o) => `${
|
|
2305
|
+
const a = r.map((o) => `${_n(o.name)}: ${Sn(o, n)}`).join(`,
|
|
2306
2306
|
`), s = n.includeModelFields ? `
|
|
2307
2307
|
import type { Schemas } from "pocketbase-svelte";` : "", i = n.includeModelFields ? ` satisfies Schemas["${t.tableName}"]` : "";
|
|
2308
2308
|
return p`
|
|
@@ -2313,8 +2313,8 @@ import type { Schemas } from "pocketbase-svelte";` : "", i = n.includeModelField
|
|
|
2313
2313
|
})${i};
|
|
2314
2314
|
`;
|
|
2315
2315
|
}
|
|
2316
|
-
function
|
|
2317
|
-
const e =
|
|
2316
|
+
function kn(t) {
|
|
2317
|
+
const e = Cn[t];
|
|
2318
2318
|
if (!e)
|
|
2319
2319
|
throw new Error(`Unsupported collection field type "${t}" when generating from collection`);
|
|
2320
2320
|
return e;
|
|
@@ -2323,11 +2323,11 @@ function ot(t, e, n) {
|
|
|
2323
2323
|
const r = e.find((o) => o.name === t.tableName);
|
|
2324
2324
|
if (!r)
|
|
2325
2325
|
throw new Error(`Collection "${t.tableName}" not found`);
|
|
2326
|
-
const a =
|
|
2326
|
+
const a = Ot(e), s = new Map(e.map((o) => [o.id, o])), i = [];
|
|
2327
2327
|
for (const o of r.fields) {
|
|
2328
2328
|
if (o.name === "id" || o.system)
|
|
2329
2329
|
continue;
|
|
2330
|
-
const c =
|
|
2330
|
+
const c = kn(o.type), m = !!o.required, h = nt(o.name);
|
|
2331
2331
|
if (c === "relation") {
|
|
2332
2332
|
const f = o.collectionId ? s.get(o.collectionId) : void 0;
|
|
2333
2333
|
if (!f)
|
|
@@ -2393,17 +2393,17 @@ function ot(t, e, n) {
|
|
|
2393
2393
|
}
|
|
2394
2394
|
return i.filter((o) => o.name !== "id");
|
|
2395
2395
|
}
|
|
2396
|
-
function
|
|
2396
|
+
function Ht(t) {
|
|
2397
2397
|
const e = t.filter((n) => n.type === "relation").map((n) => n.name);
|
|
2398
2398
|
return e.length > 0 ? e.join(",") : void 0;
|
|
2399
2399
|
}
|
|
2400
|
-
function
|
|
2400
|
+
function Gt(t) {
|
|
2401
2401
|
const e = /* @__PURE__ */ new Set(), n = [];
|
|
2402
2402
|
for (const r of t)
|
|
2403
2403
|
r.type === "relation" && (e.has(r.relatedModel.tableName) || (e.add(r.relatedModel.tableName), n.push(r.relatedModel)));
|
|
2404
2404
|
return n;
|
|
2405
2405
|
}
|
|
2406
|
-
function
|
|
2406
|
+
function Mn(t) {
|
|
2407
2407
|
const e = {
|
|
2408
2408
|
name: t.name,
|
|
2409
2409
|
type: t.type,
|
|
@@ -2426,7 +2426,7 @@ function kn(t) {
|
|
|
2426
2426
|
onUpdate: t.onUpdate
|
|
2427
2427
|
} : e;
|
|
2428
2428
|
}
|
|
2429
|
-
function
|
|
2429
|
+
function Kt(t, e, n) {
|
|
2430
2430
|
const r = n ? {
|
|
2431
2431
|
listRule: n.rule,
|
|
2432
2432
|
viewRule: n.rule,
|
|
@@ -2438,11 +2438,11 @@ function Gt(t, e, n) {
|
|
|
2438
2438
|
name: t.tableName,
|
|
2439
2439
|
type: "base",
|
|
2440
2440
|
...r,
|
|
2441
|
-
fields: e.map(
|
|
2441
|
+
fields: e.map(Mn)
|
|
2442
2442
|
};
|
|
2443
2443
|
}
|
|
2444
|
-
const Ct = 2,
|
|
2445
|
-
function
|
|
2444
|
+
const Ct = 2, Pn = 3;
|
|
2445
|
+
function Rn(t) {
|
|
2446
2446
|
if (t.length <= Ct)
|
|
2447
2447
|
throw new Error(
|
|
2448
2448
|
"Invalid command arguments. Expected: generate resource <model> [fields...]"
|
|
@@ -2452,28 +2452,28 @@ function Pn(t) {
|
|
|
2452
2452
|
throw new Error(
|
|
2453
2453
|
`Invalid command "${t.join(" ")}". Expected to start with "generate resource".`
|
|
2454
2454
|
);
|
|
2455
|
-
const r = t[Ct], a = t.slice(
|
|
2455
|
+
const r = t[Ct], a = t.slice(Pn);
|
|
2456
2456
|
return { modelPath: r, fields: a };
|
|
2457
2457
|
}
|
|
2458
|
-
function
|
|
2458
|
+
function En(t, e) {
|
|
2459
2459
|
return {
|
|
2460
2460
|
path: t,
|
|
2461
2461
|
language: B(t),
|
|
2462
2462
|
content: e
|
|
2463
2463
|
};
|
|
2464
2464
|
}
|
|
2465
|
-
async function
|
|
2465
|
+
async function In(t, e, n) {
|
|
2466
2466
|
G(e);
|
|
2467
2467
|
const r = R(e, t);
|
|
2468
2468
|
if (n.length > 0) {
|
|
2469
2469
|
const i = await K(n, r, t);
|
|
2470
2470
|
return { model: r, fields: i.fields, auth: i.auth, shouldCreateCollection: !0 };
|
|
2471
2471
|
}
|
|
2472
|
-
const a = t.env === "runtime" ? await (await import("./env.runtime-
|
|
2472
|
+
const a = t.env === "runtime" ? await (await import("./env.runtime-arRRKYvH.js")).getCollections() : (await import("./env.preview-HlXZOEL4.js")).getPreviewCollections(t), s = ot(r, a, t);
|
|
2473
2473
|
return { model: r, fields: s, auth: void 0, shouldCreateCollection: !1 };
|
|
2474
2474
|
}
|
|
2475
|
-
async function
|
|
2476
|
-
const { modelPath: e, fields: n } =
|
|
2475
|
+
async function Tn(t) {
|
|
2476
|
+
const { modelPath: e, fields: n } = Rn(t.argv), { model: r, fields: a, auth: s, shouldCreateCollection: i } = await In(
|
|
2477
2477
|
t,
|
|
2478
2478
|
e,
|
|
2479
2479
|
n
|
|
@@ -2482,25 +2482,25 @@ async function In(t) {
|
|
|
2482
2482
|
forForm: !0
|
|
2483
2483
|
});
|
|
2484
2484
|
return {
|
|
2485
|
-
creates: [
|
|
2485
|
+
creates: [En(o, c)],
|
|
2486
2486
|
modifies: [],
|
|
2487
2487
|
deletes: [],
|
|
2488
2488
|
components: [],
|
|
2489
2489
|
packages: [],
|
|
2490
|
-
collections: i ? [
|
|
2490
|
+
collections: i ? [Kt(r, a, s)] : []
|
|
2491
2491
|
};
|
|
2492
2492
|
}
|
|
2493
|
-
async function
|
|
2494
|
-
const e = await
|
|
2493
|
+
async function zn(t) {
|
|
2494
|
+
const e = await Tn(t);
|
|
2495
2495
|
if (t.env !== "runtime")
|
|
2496
2496
|
return e;
|
|
2497
|
-
const { createCollections: n } = await import("./collections-
|
|
2497
|
+
const { createCollections: n } = await import("./collections-BCHbdy1Q.js"), r = await n(e.collections, t), a = {
|
|
2498
2498
|
...e,
|
|
2499
2499
|
creates: [...e.creates, ...r]
|
|
2500
2500
|
}, { writeResult: s } = await import("./write-result-DG5OAbe1.js");
|
|
2501
2501
|
return s(a, t);
|
|
2502
2502
|
}
|
|
2503
|
-
const
|
|
2503
|
+
const Dn = {
|
|
2504
2504
|
slug: "generate-resource",
|
|
2505
2505
|
title: "Generate a resource",
|
|
2506
2506
|
summary: "Generates model schema resources.",
|
|
@@ -2511,11 +2511,11 @@ const zn = {
|
|
|
2511
2511
|
argv: ["generate", "resource", "contact", "name:text", "email:email"]
|
|
2512
2512
|
},
|
|
2513
2513
|
baseline: "velastack",
|
|
2514
|
-
generate:
|
|
2514
|
+
generate: zn
|
|
2515
2515
|
};
|
|
2516
|
-
var _t = Object.freeze,
|
|
2517
|
-
const Rt = 2,
|
|
2518
|
-
function
|
|
2516
|
+
var _t = Object.freeze, An = Object.defineProperty, W = (t, e) => _t(An(t, "raw", { value: _t(e || t.slice()) })), St, kt, Mt, Pt;
|
|
2517
|
+
const Rt = 2, Nn = 3;
|
|
2518
|
+
function Bn(t) {
|
|
2519
2519
|
if (t.length <= Rt)
|
|
2520
2520
|
throw new Error(
|
|
2521
2521
|
"Invalid command arguments. Expected: generate scaffold <model> [fields...]"
|
|
@@ -2525,7 +2525,7 @@ function Nn(t) {
|
|
|
2525
2525
|
throw new Error(
|
|
2526
2526
|
`Invalid command "${t.join(" ")}". Expected to start with "generate scaffold".`
|
|
2527
2527
|
);
|
|
2528
|
-
const r = t[Rt], a = t.slice(
|
|
2528
|
+
const r = t[Rt], a = t.slice(Nn);
|
|
2529
2529
|
return { modelPath: r, fields: a };
|
|
2530
2530
|
}
|
|
2531
2531
|
function _(t, e) {
|
|
@@ -2535,32 +2535,32 @@ function _(t, e) {
|
|
|
2535
2535
|
content: e
|
|
2536
2536
|
};
|
|
2537
2537
|
}
|
|
2538
|
-
function
|
|
2538
|
+
function Wt(t) {
|
|
2539
2539
|
return t.some((e) => e.type === "file");
|
|
2540
2540
|
}
|
|
2541
|
-
function
|
|
2541
|
+
function Xt(t) {
|
|
2542
2542
|
return [...new Set(t.filter(Boolean))];
|
|
2543
2543
|
}
|
|
2544
2544
|
function st(t) {
|
|
2545
2545
|
return t.filter(
|
|
2546
2546
|
(e) => e.type === "select"
|
|
2547
|
-
).map((e) =>
|
|
2547
|
+
).map((e) => Dt(e)).join(`
|
|
2548
2548
|
|
|
2549
2549
|
`);
|
|
2550
2550
|
}
|
|
2551
|
-
function
|
|
2552
|
-
return
|
|
2551
|
+
function Yt(t, e) {
|
|
2552
|
+
return Gt(t).map(
|
|
2553
2553
|
(n) => `const ${n.pluralName} = await ${e}.collection("${n.tableName}").getFullList();`
|
|
2554
2554
|
).join(`
|
|
2555
2555
|
`);
|
|
2556
2556
|
}
|
|
2557
|
-
function
|
|
2558
|
-
return
|
|
2557
|
+
function Jt(t) {
|
|
2558
|
+
return Gt(t).map((e) => e.pluralName).join(", ");
|
|
2559
2559
|
}
|
|
2560
|
-
function
|
|
2560
|
+
function jn(t) {
|
|
2561
2561
|
return t.features.auth ? "locals.pb" : "locals.admin";
|
|
2562
2562
|
}
|
|
2563
|
-
function
|
|
2563
|
+
function Zt(t, e, n = !1) {
|
|
2564
2564
|
const r = st(e);
|
|
2565
2565
|
return p`
|
|
2566
2566
|
${r}
|
|
@@ -2573,8 +2573,8 @@ function Jt(t, e, n = !1) {
|
|
|
2573
2573
|
const { form: formData } = form;
|
|
2574
2574
|
`;
|
|
2575
2575
|
}
|
|
2576
|
-
function
|
|
2577
|
-
const r = n.some((o) => o.type === "select"), a =
|
|
2576
|
+
function Ln(t, e, n) {
|
|
2577
|
+
const r = n.some((o) => o.type === "select"), a = Xt([
|
|
2578
2578
|
'import { untrack } from "svelte";',
|
|
2579
2579
|
'import { superForm } from "sveltekit-superforms";',
|
|
2580
2580
|
'import { zodClient } from "sveltekit-superforms/adapters";',
|
|
@@ -2586,7 +2586,7 @@ function jn(t, e, n) {
|
|
|
2586
2586
|
r ? 'import type { Models } from "pocketbase-svelte";' : ""
|
|
2587
2587
|
]).join(`
|
|
2588
2588
|
`), s = n.map((o) => tt(o)).join(`
|
|
2589
|
-
`), i =
|
|
2589
|
+
`), i = Wt(n) ? ' enctype="multipart/form-data"' : "";
|
|
2590
2590
|
return p(St || (St = W([`
|
|
2591
2591
|
<script lang="ts">
|
|
2592
2592
|
`, `
|
|
@@ -2614,10 +2614,10 @@ function jn(t, e, n) {
|
|
|
2614
2614
|
</form>
|
|
2615
2615
|
</div>
|
|
2616
2616
|
</section>
|
|
2617
|
-
`])), a,
|
|
2617
|
+
`])), a, Zt(t, n), t.displayName.toLowerCase(), e.list, i, s, e.list);
|
|
2618
2618
|
}
|
|
2619
|
-
function
|
|
2620
|
-
const r = n.some((o) => o.type === "select"), a =
|
|
2619
|
+
function On(t, e, n) {
|
|
2620
|
+
const r = n.some((o) => o.type === "select"), a = Xt([
|
|
2621
2621
|
'import { untrack } from "svelte";',
|
|
2622
2622
|
'import { superForm } from "sveltekit-superforms";',
|
|
2623
2623
|
'import { zodClient } from "sveltekit-superforms/adapters";',
|
|
@@ -2629,7 +2629,7 @@ function Ln(t, e, n) {
|
|
|
2629
2629
|
r ? 'import type { Models } from "pocketbase-svelte";' : ""
|
|
2630
2630
|
]).join(`
|
|
2631
2631
|
`), s = n.map((o) => tt(o)).join(`
|
|
2632
|
-
`), i =
|
|
2632
|
+
`), i = Wt(n) ? ' enctype="multipart/form-data"' : "";
|
|
2633
2633
|
return p(kt || (kt = W([`
|
|
2634
2634
|
<script lang="ts">
|
|
2635
2635
|
`, `
|
|
@@ -2684,9 +2684,9 @@ function Ln(t, e, n) {
|
|
|
2684
2684
|
</form>
|
|
2685
2685
|
</div>
|
|
2686
2686
|
</section>
|
|
2687
|
-
`])), a,
|
|
2687
|
+
`])), a, Zt(t, n, !0), t.displayName.toLowerCase(), e.list, i, s, e.list);
|
|
2688
2688
|
}
|
|
2689
|
-
function
|
|
2689
|
+
function qn(t, e, n) {
|
|
2690
2690
|
const r = n.some((o) => o.type === "select"), a = r ? `${st(n)}` : "", s = n.map((o) => {
|
|
2691
2691
|
let c = "{ getValue }", m = "{ value: getValue() }";
|
|
2692
2692
|
return o.type === "relation" && (c = "{ getValue, row }", m = `{ value: getValue(), expanded: row.original.expand?.${o.name}, displayField: "${o.displayField}" }`), o.type === "select" && (m = `{ value: getValue(), options: ${o.name}Labels }`), o.type === "file" && (c = "{ getValue, row }", m = "{ value: getValue(), collectionId: row.original.collectionId, id: row.original.id }"), p`
|
|
@@ -3076,8 +3076,8 @@ function On(t, e, n) {
|
|
|
3076
3076
|
</section>
|
|
3077
3077
|
`])), r ? 'import { FacetedFilter } from "$lib/components/ui/faceted-filter";' : "", a, t.tableName, s, n.length > 0 ? "," : "", e.list, e.list, e.list, t.pluralName, t.pluralDisplayName, e.new, t.displayName.toLowerCase(), t.pluralDisplayName.toLowerCase(), i, e.new, t.displayName.toLowerCase());
|
|
3078
3078
|
}
|
|
3079
|
-
function
|
|
3080
|
-
const r =
|
|
3079
|
+
function Un(t, e, n) {
|
|
3080
|
+
const r = Ht(e), a = r ? `{ expand: "${r}" }` : "";
|
|
3081
3081
|
return p`
|
|
3082
3082
|
export const load = async ({ locals }) => {
|
|
3083
3083
|
const ${t.pluralName} = await ${n}.collection("${t.tableName}").getFullList(${a});
|
|
@@ -3085,8 +3085,8 @@ function qn(t, e, n) {
|
|
|
3085
3085
|
};
|
|
3086
3086
|
`;
|
|
3087
3087
|
}
|
|
3088
|
-
function
|
|
3089
|
-
const s =
|
|
3088
|
+
function Vn(t, e, n, r, a) {
|
|
3089
|
+
const s = Yt(n, r), i = Jt(n), o = i ? `, ${i}` : "", c = n.find(
|
|
3090
3090
|
(h) => h.type === "relation" && h.isCurrentUser
|
|
3091
3091
|
), m = a && c ? p`
|
|
3092
3092
|
{
|
|
@@ -3127,8 +3127,8 @@ function Un(t, e, n, r, a) {
|
|
|
3127
3127
|
};
|
|
3128
3128
|
`;
|
|
3129
3129
|
}
|
|
3130
|
-
function
|
|
3131
|
-
const a =
|
|
3130
|
+
function Hn(t, e, n, r) {
|
|
3131
|
+
const a = Ht(n), s = a ? `, { expand: "${a}" }` : "";
|
|
3132
3132
|
return p`
|
|
3133
3133
|
import { error, redirect } from "@sveltejs/kit";
|
|
3134
3134
|
|
|
@@ -3149,7 +3149,7 @@ function Vn(t, e, n, r) {
|
|
|
3149
3149
|
};
|
|
3150
3150
|
`;
|
|
3151
3151
|
}
|
|
3152
|
-
function
|
|
3152
|
+
function Gn(t, e, n) {
|
|
3153
3153
|
const r = n.some((m) => m.type === "select"), a = n.some((m) => m.type === "relation"), s = n.some((m) => m.type === "file"), i = [
|
|
3154
3154
|
'import { Button } from "$lib/components/ui/button";',
|
|
3155
3155
|
'import ArrowLeftIcon from "@lucide/svelte/icons/arrow-left";',
|
|
@@ -3157,7 +3157,7 @@ function Hn(t, e, n) {
|
|
|
3157
3157
|
a ? 'import CircleArrowRightIcon from "@lucide/svelte/icons/circle-arrow-right";' : "",
|
|
3158
3158
|
s ? 'import FileIcon from "@lucide/svelte/icons/file";' : ""
|
|
3159
3159
|
].filter(Boolean).join(`
|
|
3160
|
-
`), o = st(n), c = n.map((m) =>
|
|
3160
|
+
`), o = st(n), c = n.map((m) => Fe(t, m)).join(`
|
|
3161
3161
|
`);
|
|
3162
3162
|
return p(Pt || (Pt = W([`
|
|
3163
3163
|
<script lang="ts">
|
|
@@ -3193,8 +3193,8 @@ function Hn(t, e, n) {
|
|
|
3193
3193
|
</section>
|
|
3194
3194
|
`])), i, o, t.displayName, e.list, c, e.list, t.name);
|
|
3195
3195
|
}
|
|
3196
|
-
function
|
|
3197
|
-
const a =
|
|
3196
|
+
function Kn(t, e, n, r) {
|
|
3197
|
+
const a = Yt(n, r), s = Jt(n), i = s ? `, ${s}` : "";
|
|
3198
3198
|
return p`
|
|
3199
3199
|
import { error, fail, redirect } from "@sveltejs/kit";
|
|
3200
3200
|
import { setPocketbaseErrors, setDefaultData } from "@velastack/pocketbase";
|
|
@@ -3235,9 +3235,9 @@ function Gn(t, e, n, r) {
|
|
|
3235
3235
|
};
|
|
3236
3236
|
`;
|
|
3237
3237
|
}
|
|
3238
|
-
async function
|
|
3238
|
+
async function Wn(t, e, n) {
|
|
3239
3239
|
G(e);
|
|
3240
|
-
const r = R(e, t), a = t.env === "runtime" ? await (await import("./env.runtime-
|
|
3240
|
+
const r = R(e, t), a = t.env === "runtime" ? await (await import("./env.runtime-arRRKYvH.js")).getCollections() : (await import("./env.preview-HlXZOEL4.js")).getPreviewCollections(t);
|
|
3241
3241
|
if (n.length > 0) {
|
|
3242
3242
|
const i = await K(n, r, t);
|
|
3243
3243
|
return {
|
|
@@ -3257,8 +3257,8 @@ async function Kn(t, e, n) {
|
|
|
3257
3257
|
collections: a
|
|
3258
3258
|
};
|
|
3259
3259
|
}
|
|
3260
|
-
async function
|
|
3261
|
-
const { modelPath: e, fields: n } =
|
|
3260
|
+
async function Xn(t) {
|
|
3261
|
+
const { modelPath: e, fields: n } = Bn(t.argv), { model: r, fields: a, auth: s, shouldCreateCollection: i, collections: o } = await Wn(t, e, n), c = jt(r), m = Lt(r), h = jn(t), f = a.filter(
|
|
3262
3262
|
(u) => !(u.type === "relation" && u.isCurrentUser)
|
|
3263
3263
|
), g = [
|
|
3264
3264
|
_(
|
|
@@ -3270,36 +3270,36 @@ async function Wn(t) {
|
|
|
3270
3270
|
),
|
|
3271
3271
|
_(
|
|
3272
3272
|
`${c.list}/+page.server.ts`,
|
|
3273
|
-
|
|
3273
|
+
Un(r, f, h)
|
|
3274
3274
|
),
|
|
3275
3275
|
_(
|
|
3276
3276
|
`${c.list}/+page.svelte`,
|
|
3277
|
-
|
|
3277
|
+
qn(r, m, f)
|
|
3278
3278
|
),
|
|
3279
3279
|
_(
|
|
3280
3280
|
`${c.new}/+page.server.ts`,
|
|
3281
|
-
|
|
3281
|
+
Vn(r, m, f, h, t.features.auth)
|
|
3282
3282
|
),
|
|
3283
|
-
_(`${c.new}/+page.svelte`,
|
|
3283
|
+
_(`${c.new}/+page.svelte`, Ln(r, m, f)),
|
|
3284
3284
|
_(
|
|
3285
3285
|
`${c.show}/+page.server.ts`,
|
|
3286
|
-
|
|
3286
|
+
Hn(r, m, f, h)
|
|
3287
3287
|
),
|
|
3288
3288
|
_(
|
|
3289
3289
|
`${c.show}/+page.svelte`,
|
|
3290
|
-
|
|
3290
|
+
Gn(r, m, f)
|
|
3291
3291
|
),
|
|
3292
3292
|
_(
|
|
3293
3293
|
`${c.edit}/+page.server.ts`,
|
|
3294
|
-
|
|
3294
|
+
Kn(r, m, f, h)
|
|
3295
3295
|
),
|
|
3296
3296
|
_(
|
|
3297
3297
|
`${c.edit}/+page.svelte`,
|
|
3298
|
-
|
|
3298
|
+
On(r, m, f)
|
|
3299
3299
|
),
|
|
3300
3300
|
_(
|
|
3301
3301
|
`${c.list}/server.test.ts`,
|
|
3302
|
-
|
|
3302
|
+
sn(r, m, a, t, o)
|
|
3303
3303
|
)
|
|
3304
3304
|
], x = [
|
|
3305
3305
|
...L(f),
|
|
@@ -3325,20 +3325,20 @@ async function Wn(t) {
|
|
|
3325
3325
|
deletes: [],
|
|
3326
3326
|
components: [...new Set(x)],
|
|
3327
3327
|
packages: [],
|
|
3328
|
-
collections: i ? [
|
|
3328
|
+
collections: i ? [Kt(r, a, s)] : []
|
|
3329
3329
|
};
|
|
3330
3330
|
}
|
|
3331
|
-
async function
|
|
3332
|
-
const e = await
|
|
3331
|
+
async function Yn(t) {
|
|
3332
|
+
const e = await Xn(t);
|
|
3333
3333
|
if (t.env !== "runtime")
|
|
3334
3334
|
return e;
|
|
3335
|
-
const { createCollections: n } = await import("./collections-
|
|
3335
|
+
const { createCollections: n } = await import("./collections-BCHbdy1Q.js"), r = await n(e.collections, t), a = {
|
|
3336
3336
|
...e,
|
|
3337
3337
|
creates: [...e.creates, ...r]
|
|
3338
3338
|
}, { writeResult: s } = await import("./write-result-DG5OAbe1.js");
|
|
3339
3339
|
return s(a, t);
|
|
3340
3340
|
}
|
|
3341
|
-
const
|
|
3341
|
+
const Jn = {
|
|
3342
3342
|
slug: "generate-scaffold",
|
|
3343
3343
|
title: "Generate a scaffold",
|
|
3344
3344
|
summary: "Generates CRUD routes and schema.",
|
|
@@ -3349,9 +3349,9 @@ const Yn = {
|
|
|
3349
3349
|
argv: ["generate", "scaffold", "contact", "name:text", "email:email"]
|
|
3350
3350
|
},
|
|
3351
3351
|
baseline: "velastack",
|
|
3352
|
-
generate:
|
|
3353
|
-
}, Et = 2,
|
|
3354
|
-
function
|
|
3352
|
+
generate: Yn
|
|
3353
|
+
}, Et = 2, Zn = 3;
|
|
3354
|
+
function Qn(t) {
|
|
3355
3355
|
if (t.length <= Et)
|
|
3356
3356
|
throw new Error(
|
|
3357
3357
|
"Invalid command arguments. Expected: generate schema <model> [fields...]"
|
|
@@ -3361,28 +3361,28 @@ function Zn(t) {
|
|
|
3361
3361
|
throw new Error(
|
|
3362
3362
|
`Invalid command "${t.join(" ")}". Expected to start with "generate schema".`
|
|
3363
3363
|
);
|
|
3364
|
-
const r = t[Et], a = t.slice(
|
|
3364
|
+
const r = t[Et], a = t.slice(Zn);
|
|
3365
3365
|
return { modelPath: r, fields: a };
|
|
3366
3366
|
}
|
|
3367
|
-
function
|
|
3367
|
+
function tr(t, e) {
|
|
3368
3368
|
return {
|
|
3369
3369
|
path: t,
|
|
3370
3370
|
language: B(t),
|
|
3371
3371
|
content: e
|
|
3372
3372
|
};
|
|
3373
3373
|
}
|
|
3374
|
-
async function
|
|
3374
|
+
async function er(t, e, n) {
|
|
3375
3375
|
G(e);
|
|
3376
3376
|
const r = R(e, t);
|
|
3377
3377
|
if (n.length > 0) {
|
|
3378
3378
|
const i = await K(n, r, t);
|
|
3379
3379
|
return { model: r, fields: i.fields, includeModelFields: !1 };
|
|
3380
3380
|
}
|
|
3381
|
-
const a = t.env === "runtime" ? await (await import("./env.runtime-
|
|
3381
|
+
const a = t.env === "runtime" ? await (await import("./env.runtime-arRRKYvH.js")).getCollections() : (await import("./env.preview-HlXZOEL4.js")).getPreviewCollections(t), s = ot(r, a, t);
|
|
3382
3382
|
return { model: r, fields: s, includeModelFields: !0 };
|
|
3383
3383
|
}
|
|
3384
|
-
async function
|
|
3385
|
-
const { modelPath: e, fields: n } =
|
|
3384
|
+
async function nr(t) {
|
|
3385
|
+
const { modelPath: e, fields: n } = Qn(t.argv), { model: r, fields: a, includeModelFields: s } = await er(
|
|
3386
3386
|
t,
|
|
3387
3387
|
e,
|
|
3388
3388
|
n
|
|
@@ -3391,7 +3391,7 @@ async function er(t) {
|
|
|
3391
3391
|
forForm: !0
|
|
3392
3392
|
});
|
|
3393
3393
|
return {
|
|
3394
|
-
creates: [
|
|
3394
|
+
creates: [tr(i, o)],
|
|
3395
3395
|
modifies: [],
|
|
3396
3396
|
deletes: [],
|
|
3397
3397
|
components: [],
|
|
@@ -3399,14 +3399,14 @@ async function er(t) {
|
|
|
3399
3399
|
collections: []
|
|
3400
3400
|
};
|
|
3401
3401
|
}
|
|
3402
|
-
async function
|
|
3403
|
-
const e = await
|
|
3402
|
+
async function rr(t) {
|
|
3403
|
+
const e = await nr(t);
|
|
3404
3404
|
if (t.env !== "runtime")
|
|
3405
3405
|
return e;
|
|
3406
3406
|
const { writeResult: n } = await import("./write-result-DG5OAbe1.js");
|
|
3407
3407
|
return n(e, t);
|
|
3408
3408
|
}
|
|
3409
|
-
const
|
|
3409
|
+
const ar = {
|
|
3410
3410
|
slug: "generate-schema",
|
|
3411
3411
|
title: "Generate a schema",
|
|
3412
3412
|
summary: "Generates a zod schema.",
|
|
@@ -3417,8 +3417,8 @@ const rr = {
|
|
|
3417
3417
|
argv: ["generate", "schema", "contact", "name:text", "email:email"]
|
|
3418
3418
|
},
|
|
3419
3419
|
baseline: "velastack",
|
|
3420
|
-
generate:
|
|
3421
|
-
},
|
|
3420
|
+
generate: rr
|
|
3421
|
+
}, or = `<script lang="ts" module>
|
|
3422
3422
|
import HomeIcon from '@lucide/svelte/icons/home';
|
|
3423
3423
|
|
|
3424
3424
|
let data = {
|
|
@@ -3474,7 +3474,7 @@ const rr = {
|
|
|
3474
3474
|
<NavUser {user} />
|
|
3475
3475
|
</Sidebar.Footer>
|
|
3476
3476
|
</Sidebar.Root>
|
|
3477
|
-
`,
|
|
3477
|
+
`, sr = `<script lang="ts">
|
|
3478
3478
|
import type { Component } from 'svelte';
|
|
3479
3479
|
import * as Sidebar from '$lib/components/ui/sidebar';
|
|
3480
3480
|
import { page } from '$app/state';
|
|
@@ -3514,7 +3514,7 @@ const rr = {
|
|
|
3514
3514
|
{/each}
|
|
3515
3515
|
</Sidebar.Menu>
|
|
3516
3516
|
</Sidebar.Group>
|
|
3517
|
-
`,
|
|
3517
|
+
`, ir = `<script lang="ts" module>
|
|
3518
3518
|
import Settings2Icon from '@lucide/svelte/icons/settings-2';
|
|
3519
3519
|
|
|
3520
3520
|
let data = {
|
|
@@ -3633,7 +3633,7 @@ const rr = {
|
|
|
3633
3633
|
</DropdownMenu.Root>
|
|
3634
3634
|
</Sidebar.MenuItem>
|
|
3635
3635
|
</Sidebar.Menu>
|
|
3636
|
-
`,
|
|
3636
|
+
`, lr = `<script lang="ts">
|
|
3637
3637
|
import { cn } from '$lib/utils';
|
|
3638
3638
|
import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
|
|
3639
3639
|
import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
|
|
@@ -3661,7 +3661,7 @@ const rr = {
|
|
|
3661
3661
|
{@render children?.()}
|
|
3662
3662
|
</div>
|
|
3663
3663
|
{/if}
|
|
3664
|
-
`,
|
|
3664
|
+
`, cr = `<script lang="ts">
|
|
3665
3665
|
import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
|
|
3666
3666
|
import { getContext } from 'svelte';
|
|
3667
3667
|
import { AUTH_MENU_CONTEXT_KEY, type AuthMenuContext } from './context.js';
|
|
@@ -3677,7 +3677,7 @@ const rr = {
|
|
|
3677
3677
|
{:else}
|
|
3678
3678
|
{@render children?.()}
|
|
3679
3679
|
{/if}
|
|
3680
|
-
`,
|
|
3680
|
+
`, mr = `<script lang="ts">
|
|
3681
3681
|
import { goto } from '$app/navigation';
|
|
3682
3682
|
import * as DropdownMenu from '$lib/components/ui/dropdown-menu';
|
|
3683
3683
|
import { Button } from '$lib/components/ui/button';
|
|
@@ -3713,7 +3713,7 @@ const rr = {
|
|
|
3713
3713
|
{@render children?.()}
|
|
3714
3714
|
</Button>
|
|
3715
3715
|
{/if}
|
|
3716
|
-
`,
|
|
3716
|
+
`, ur = `<script lang="ts">
|
|
3717
3717
|
import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
|
|
3718
3718
|
import { getContext } from 'svelte';
|
|
3719
3719
|
import { AUTH_MENU_CONTEXT_KEY, type AuthMenuContext } from './context.js';
|
|
@@ -3727,7 +3727,7 @@ const rr = {
|
|
|
3727
3727
|
{@render children?.()}
|
|
3728
3728
|
</DropdownMenu.Label>
|
|
3729
3729
|
{/if}
|
|
3730
|
-
`,
|
|
3730
|
+
`, pr = `<script lang="ts">
|
|
3731
3731
|
import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
|
|
3732
3732
|
import { getContext } from 'svelte';
|
|
3733
3733
|
import { AUTH_MENU_CONTEXT_KEY, type AuthMenuContext } from './context.js';
|
|
@@ -3739,7 +3739,7 @@ const rr = {
|
|
|
3739
3739
|
{#if isDesktop}
|
|
3740
3740
|
<DropdownMenu.Separator {...restProps} />
|
|
3741
3741
|
{/if}
|
|
3742
|
-
`,
|
|
3742
|
+
`, dr = `<script lang="ts">
|
|
3743
3743
|
import { cn } from '$lib/utils';
|
|
3744
3744
|
import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
|
|
3745
3745
|
import { getContext } from 'svelte';
|
|
@@ -3753,7 +3753,7 @@ const rr = {
|
|
|
3753
3753
|
{#if isDesktop}
|
|
3754
3754
|
<DropdownMenu.Trigger class={cn('inline-flex', className)} {...restProps} />
|
|
3755
3755
|
{/if}
|
|
3756
|
-
`,
|
|
3756
|
+
`, fr = `<script lang="ts">
|
|
3757
3757
|
import { page } from '$app/state';
|
|
3758
3758
|
import { browser } from '$app/environment';
|
|
3759
3759
|
import { onMount, setContext } from 'svelte';
|
|
@@ -3799,12 +3799,12 @@ const rr = {
|
|
|
3799
3799
|
{:else}
|
|
3800
3800
|
{@render guest?.()}
|
|
3801
3801
|
{/if}
|
|
3802
|
-
`,
|
|
3802
|
+
`, hr = `export type AuthMenuContext = {
|
|
3803
3803
|
isDesktop: boolean;
|
|
3804
3804
|
};
|
|
3805
3805
|
|
|
3806
3806
|
export const AUTH_MENU_CONTEXT_KEY = Symbol('auth-menu-context');
|
|
3807
|
-
`,
|
|
3807
|
+
`, gr = `import Root from './auth-menu.svelte';
|
|
3808
3808
|
import Content from './auth-menu-content.svelte';
|
|
3809
3809
|
import Trigger from './auth-menu-trigger.svelte';
|
|
3810
3810
|
import Group from './auth-menu-group.svelte';
|
|
@@ -3813,12 +3813,12 @@ import Separator from './auth-menu-separator.svelte';
|
|
|
3813
3813
|
import Item from './auth-menu-item.svelte';
|
|
3814
3814
|
|
|
3815
3815
|
export { Root, Content, Trigger, Group, Label, Separator, Item };
|
|
3816
|
-
`,
|
|
3816
|
+
`, br = `import { z } from 'zod/v3';
|
|
3817
3817
|
|
|
3818
3818
|
export const changeEmailSchema = z.object({
|
|
3819
3819
|
email: z.string().email()
|
|
3820
3820
|
});
|
|
3821
|
-
`,
|
|
3821
|
+
`, vr = `import { z } from 'zod/v3';
|
|
3822
3822
|
|
|
3823
3823
|
export const changePasswordSchema = z
|
|
3824
3824
|
.object({
|
|
@@ -3829,16 +3829,16 @@ export const changePasswordSchema = z
|
|
|
3829
3829
|
message: "Passwords don't match",
|
|
3830
3830
|
path: ['passwordConfirm']
|
|
3831
3831
|
});
|
|
3832
|
-
`,
|
|
3832
|
+
`, wr = `import { z } from 'zod/v3';
|
|
3833
3833
|
export const confirmEmailChangeSchema = z.object({
|
|
3834
3834
|
password: z.string()
|
|
3835
3835
|
});
|
|
3836
|
-
`,
|
|
3836
|
+
`, yr = `import { z } from 'zod/v3';
|
|
3837
3837
|
export const confirmResetSchema = z.object({
|
|
3838
3838
|
password: z.string(),
|
|
3839
3839
|
passwordConfirm: z.string()
|
|
3840
3840
|
});
|
|
3841
|
-
`,
|
|
3841
|
+
`, xr = `import { z } from 'zod/v3';
|
|
3842
3842
|
|
|
3843
3843
|
const otpSchema = z.object({
|
|
3844
3844
|
type: z.literal('otp'),
|
|
@@ -3857,35 +3857,35 @@ const oAuth2Schema = z.object({
|
|
|
3857
3857
|
});
|
|
3858
3858
|
|
|
3859
3859
|
export const loginSchema = z.discriminatedUnion('type', [otpSchema, passwordSchema, oAuth2Schema]);
|
|
3860
|
-
`,
|
|
3860
|
+
`, $r = `import { z } from 'zod/v3';
|
|
3861
3861
|
export const otpSchema = z.object({
|
|
3862
3862
|
otp: z.string()
|
|
3863
3863
|
});
|
|
3864
|
-
`,
|
|
3864
|
+
`, Fr = `import { z } from 'zod/v3';
|
|
3865
3865
|
|
|
3866
3866
|
export const profileSchema = z.object({
|
|
3867
3867
|
name: z.string().optional(),
|
|
3868
3868
|
avatar: z.union([z.instanceof(File), z.string()]).optional(),
|
|
3869
3869
|
emailVisibility: z.boolean().optional()
|
|
3870
3870
|
});
|
|
3871
|
-
`,
|
|
3871
|
+
`, Cr = `import { z } from 'zod/v3';
|
|
3872
3872
|
export const resetSchema = z.object({
|
|
3873
3873
|
email: z.string().email()
|
|
3874
3874
|
});
|
|
3875
|
-
`,
|
|
3875
|
+
`, _r = `import { z } from 'zod/v3';
|
|
3876
3876
|
|
|
3877
3877
|
export const signupSchema = z.object({
|
|
3878
3878
|
email: z.string().email(),
|
|
3879
3879
|
password: z.string(),
|
|
3880
3880
|
passwordConfirm: z.string()
|
|
3881
3881
|
});
|
|
3882
|
-
`,
|
|
3882
|
+
`, Sr = `export const load = ({ locals }) => {
|
|
3883
3883
|
const user = locals.pb.authStore.record!;
|
|
3884
3884
|
const breadcrumbs = [{ title: 'Home', url: '/dashboard' }];
|
|
3885
3885
|
|
|
3886
3886
|
return { user, breadcrumbs };
|
|
3887
3887
|
};
|
|
3888
|
-
`,
|
|
3888
|
+
`, kr = `<script lang="ts">
|
|
3889
3889
|
import * as Sidebar from '$lib/components/ui/sidebar';
|
|
3890
3890
|
import { Separator } from '$lib/components/ui/separator';
|
|
3891
3891
|
import AppSidebar from '$lib/components/app-sidebar.svelte';
|
|
@@ -3935,7 +3935,7 @@ export const signupSchema = z.object({
|
|
|
3935
3935
|
background-color: var(--color-sidebar);
|
|
3936
3936
|
}
|
|
3937
3937
|
</style>
|
|
3938
|
-
`,
|
|
3938
|
+
`, Mr = "", Pr = `import { describe, it, expect } from 'vitest';
|
|
3939
3939
|
import type { Match } from '@velastack/pocketbase';
|
|
3940
3940
|
import type { RouteId } from './$types';
|
|
3941
3941
|
|
|
@@ -3952,14 +3952,14 @@ describe('dashboard', () => {
|
|
|
3952
3952
|
expect(response.status).toBe(200);
|
|
3953
3953
|
});
|
|
3954
3954
|
});
|
|
3955
|
-
`,
|
|
3955
|
+
`, Rr = `export const load = async ({ parent }) => {
|
|
3956
3956
|
const { breadcrumbs } = await parent();
|
|
3957
3957
|
|
|
3958
3958
|
return {
|
|
3959
3959
|
breadcrumbs: [...breadcrumbs, { title: 'Settings', url: '/settings' }]
|
|
3960
3960
|
};
|
|
3961
3961
|
};
|
|
3962
|
-
`,
|
|
3962
|
+
`, Er = `import { superValidate, fail, withFiles } from 'sveltekit-superforms';
|
|
3963
3963
|
import { zod } from 'sveltekit-superforms/adapters';
|
|
3964
3964
|
import { setFlash } from 'sveltekit-flash-message/server';
|
|
3965
3965
|
import { profileSchema } from '$lib/schemas/profile';
|
|
@@ -4028,7 +4028,7 @@ export const actions = {
|
|
|
4028
4028
|
return {};
|
|
4029
4029
|
}
|
|
4030
4030
|
};
|
|
4031
|
-
`,
|
|
4031
|
+
`, Ir = `<script lang="ts">
|
|
4032
4032
|
import { untrack } from 'svelte';
|
|
4033
4033
|
import { superForm } from 'sveltekit-superforms';
|
|
4034
4034
|
import { zodClient } from 'sveltekit-superforms/adapters';
|
|
@@ -4306,7 +4306,7 @@ export const actions = {
|
|
|
4306
4306
|
</form>
|
|
4307
4307
|
</div>
|
|
4308
4308
|
</div>
|
|
4309
|
-
`,
|
|
4309
|
+
`, Tr = `import { fail, superValidate } from 'sveltekit-superforms';
|
|
4310
4310
|
import { zod } from 'sveltekit-superforms/adapters';
|
|
4311
4311
|
import { confirmEmailChangeSchema } from '$lib/schemas/confirmEmailChange';
|
|
4312
4312
|
import { redirect } from '@sveltejs/kit';
|
|
@@ -4333,7 +4333,7 @@ export const actions = {
|
|
|
4333
4333
|
return redirect(303, '/login');
|
|
4334
4334
|
}
|
|
4335
4335
|
};
|
|
4336
|
-
`,
|
|
4336
|
+
`, zr = `<script lang="ts">
|
|
4337
4337
|
import { untrack } from 'svelte';
|
|
4338
4338
|
import { Button } from '$lib/components/ui/button';
|
|
4339
4339
|
import * as Card from '$lib/components/ui/card';
|
|
@@ -4401,7 +4401,7 @@ export const actions = {
|
|
|
4401
4401
|
</div>
|
|
4402
4402
|
</div>
|
|
4403
4403
|
</div>
|
|
4404
|
-
`,
|
|
4404
|
+
`, Dr = `import { describe, it, expect } from 'vitest';
|
|
4405
4405
|
import type { Match } from '@velastack/pocketbase';
|
|
4406
4406
|
import type { RouteId } from './$types';
|
|
4407
4407
|
|
|
@@ -4413,7 +4413,7 @@ describe('GET /confirm-email-change/[token]', () => {
|
|
|
4413
4413
|
expect(response.status).toBe(200);
|
|
4414
4414
|
});
|
|
4415
4415
|
});
|
|
4416
|
-
`,
|
|
4416
|
+
`, Ar = `import { fail, superValidate } from 'sveltekit-superforms';
|
|
4417
4417
|
import { zod } from 'sveltekit-superforms/adapters';
|
|
4418
4418
|
import { confirmResetSchema } from '$lib/schemas/confirmReset';
|
|
4419
4419
|
import { redirect } from '@sveltejs/kit';
|
|
@@ -4442,7 +4442,7 @@ export const actions = {
|
|
|
4442
4442
|
return redirect(303, '/login');
|
|
4443
4443
|
}
|
|
4444
4444
|
};
|
|
4445
|
-
`,
|
|
4445
|
+
`, Nr = `<script lang="ts">
|
|
4446
4446
|
import { untrack } from 'svelte';
|
|
4447
4447
|
import { Button } from '$lib/components/ui/button';
|
|
4448
4448
|
import * as Card from '$lib/components/ui/card';
|
|
@@ -4526,7 +4526,7 @@ export const actions = {
|
|
|
4526
4526
|
</div>
|
|
4527
4527
|
</div>
|
|
4528
4528
|
</div>
|
|
4529
|
-
`,
|
|
4529
|
+
`, Br = `import { describe, it, expect } from 'vitest';
|
|
4530
4530
|
import type { Match } from '@velastack/pocketbase';
|
|
4531
4531
|
import type { RouteId } from './$types';
|
|
4532
4532
|
|
|
@@ -4536,7 +4536,7 @@ describe('GET /confirm-reset/[token]', () => {
|
|
|
4536
4536
|
expect(response.status).toBe(200);
|
|
4537
4537
|
});
|
|
4538
4538
|
});
|
|
4539
|
-
`,
|
|
4539
|
+
`, jr = `import { redirect } from '@sveltejs/kit';
|
|
4540
4540
|
import { setFlash } from 'sveltekit-flash-message/server';
|
|
4541
4541
|
|
|
4542
4542
|
export const GET = async ({ params, locals, cookies }) => {
|
|
@@ -4555,7 +4555,7 @@ export const GET = async ({ params, locals, cookies }) => {
|
|
|
4555
4555
|
setFlash({ type: 'toast', message }, cookies);
|
|
4556
4556
|
redirect(303, redirectPath);
|
|
4557
4557
|
};
|
|
4558
|
-
`,
|
|
4558
|
+
`, Lr = `import { describe, it, expect } from 'vitest';
|
|
4559
4559
|
import type { Match } from '@velastack/pocketbase';
|
|
4560
4560
|
import type { RouteId } from './$types';
|
|
4561
4561
|
|
|
@@ -4568,7 +4568,7 @@ describe('GET /confirm-verification/[token]', () => {
|
|
|
4568
4568
|
expect(response.headers['location']).toBe('/login');
|
|
4569
4569
|
});
|
|
4570
4570
|
});
|
|
4571
|
-
`,
|
|
4571
|
+
`, Or = `import { fail, superValidate, message } from 'sveltekit-superforms';
|
|
4572
4572
|
import { zod } from 'sveltekit-superforms/adapters';
|
|
4573
4573
|
import { loginSchema } from '$lib/schemas/login';
|
|
4574
4574
|
import { redirect } from '@sveltejs/kit';
|
|
@@ -4629,7 +4629,7 @@ export const actions = {
|
|
|
4629
4629
|
redirect(303, redirectUrl);
|
|
4630
4630
|
}
|
|
4631
4631
|
};
|
|
4632
|
-
`,
|
|
4632
|
+
`, qr = `<script lang="ts">
|
|
4633
4633
|
import { untrack } from 'svelte';
|
|
4634
4634
|
import { Button } from '$lib/components/ui/button';
|
|
4635
4635
|
import * as Card from '$lib/components/ui/card';
|
|
@@ -4812,7 +4812,7 @@ export const actions = {
|
|
|
4812
4812
|
</div>
|
|
4813
4813
|
</div>
|
|
4814
4814
|
</div>
|
|
4815
|
-
`,
|
|
4815
|
+
`, Ur = `import { describe, it, expect } from 'vitest';
|
|
4816
4816
|
import * as devalue from 'devalue';
|
|
4817
4817
|
import type { Match } from '@velastack/pocketbase';
|
|
4818
4818
|
import type { RouteId } from './$types';
|
|
@@ -4859,14 +4859,14 @@ describe('POST /login', () => {
|
|
|
4859
4859
|
expect(data.form.message.text).toBe('Failed to authenticate.');
|
|
4860
4860
|
});
|
|
4861
4861
|
});
|
|
4862
|
-
`,
|
|
4862
|
+
`, Vr = `import { redirect } from '@sveltejs/kit';
|
|
4863
4863
|
|
|
4864
4864
|
export const POST = ({ cookies, locals }) => {
|
|
4865
4865
|
locals.pb.authStore.clear();
|
|
4866
4866
|
locals.pb.authStore.clearCookie(cookies);
|
|
4867
4867
|
throw redirect(303, '/');
|
|
4868
4868
|
};
|
|
4869
|
-
`,
|
|
4869
|
+
`, Hr = `import { describe, it, expect } from 'vitest';
|
|
4870
4870
|
import type { Match } from '@velastack/pocketbase';
|
|
4871
4871
|
import type { RouteId } from './$types';
|
|
4872
4872
|
|
|
@@ -4878,7 +4878,7 @@ describe('POST /logout', () => {
|
|
|
4878
4878
|
expect(response.headers.location).toBe('/');
|
|
4879
4879
|
});
|
|
4880
4880
|
});
|
|
4881
|
-
`,
|
|
4881
|
+
`, Gr = `import { fail, message, superValidate } from 'sveltekit-superforms';
|
|
4882
4882
|
import { zod } from 'sveltekit-superforms/adapters';
|
|
4883
4883
|
import { otpSchema } from '$lib/schemas/otp';
|
|
4884
4884
|
import { redirect } from '@sveltejs/kit';
|
|
@@ -4919,7 +4919,7 @@ export const actions = {
|
|
|
4919
4919
|
redirect(303, redirectUrl);
|
|
4920
4920
|
}
|
|
4921
4921
|
};
|
|
4922
|
-
`,
|
|
4922
|
+
`, Kr = `<script lang="ts">
|
|
4923
4923
|
import { untrack } from 'svelte';
|
|
4924
4924
|
import { Button } from '$lib/components/ui/button';
|
|
4925
4925
|
import * as Card from '$lib/components/ui/card';
|
|
@@ -4985,7 +4985,7 @@ export const actions = {
|
|
|
4985
4985
|
</div>
|
|
4986
4986
|
</div>
|
|
4987
4987
|
</div>
|
|
4988
|
-
`,
|
|
4988
|
+
`, Wr = `import { describe, it, expect } from 'vitest';
|
|
4989
4989
|
import type { Match } from '@velastack/pocketbase';
|
|
4990
4990
|
import type { RouteId } from './$types';
|
|
4991
4991
|
|
|
@@ -5005,7 +5005,7 @@ describe('POST /otp/[token]', () => {
|
|
|
5005
5005
|
expect(response.body.status).toBe(400);
|
|
5006
5006
|
});
|
|
5007
5007
|
});
|
|
5008
|
-
`,
|
|
5008
|
+
`, Xr = `import { fail, superValidate } from 'sveltekit-superforms';
|
|
5009
5009
|
import { zod } from 'sveltekit-superforms/adapters';
|
|
5010
5010
|
import { resetSchema } from '$lib/schemas/reset';
|
|
5011
5011
|
import { redirect } from '@sveltejs/kit';
|
|
@@ -5033,7 +5033,7 @@ export const actions = {
|
|
|
5033
5033
|
return { form };
|
|
5034
5034
|
}
|
|
5035
5035
|
};
|
|
5036
|
-
`,
|
|
5036
|
+
`, Yr = `<script lang="ts">
|
|
5037
5037
|
import { untrack } from 'svelte';
|
|
5038
5038
|
import { Button } from '$lib/components/ui/button';
|
|
5039
5039
|
import * as Card from '$lib/components/ui/card';
|
|
@@ -5100,7 +5100,7 @@ export const actions = {
|
|
|
5100
5100
|
</div>
|
|
5101
5101
|
</div>
|
|
5102
5102
|
</div>
|
|
5103
|
-
`,
|
|
5103
|
+
`, Jr = `import { describe, it, expect } from 'vitest';
|
|
5104
5104
|
import type { Match } from '@velastack/pocketbase';
|
|
5105
5105
|
import type { RouteId } from './$types';
|
|
5106
5106
|
|
|
@@ -5120,7 +5120,7 @@ describe('POST /reset', () => {
|
|
|
5120
5120
|
expect(response.body.status).toBe(200);
|
|
5121
5121
|
});
|
|
5122
5122
|
});
|
|
5123
|
-
`,
|
|
5123
|
+
`, Zr = `import { redirect } from '@sveltejs/kit';
|
|
5124
5124
|
import { fail, superValidate } from 'sveltekit-superforms';
|
|
5125
5125
|
import { zod } from 'sveltekit-superforms/adapters';
|
|
5126
5126
|
import { setFlash } from 'sveltekit-flash-message/server';
|
|
@@ -5176,7 +5176,7 @@ export const actions = {
|
|
|
5176
5176
|
return redirect(303, redirectUrl);
|
|
5177
5177
|
}
|
|
5178
5178
|
};
|
|
5179
|
-
`,
|
|
5179
|
+
`, Qr = `<script lang="ts">
|
|
5180
5180
|
import { untrack } from 'svelte';
|
|
5181
5181
|
import { Button } from '$lib/components/ui/button';
|
|
5182
5182
|
import * as Card from '$lib/components/ui/card';
|
|
@@ -5343,7 +5343,7 @@ export const actions = {
|
|
|
5343
5343
|
</div>
|
|
5344
5344
|
</div>
|
|
5345
5345
|
</div>
|
|
5346
|
-
`,
|
|
5346
|
+
`, ta = `import { describe, it, expect } from 'vitest';
|
|
5347
5347
|
import type { Match } from '@velastack/pocketbase';
|
|
5348
5348
|
import * as devalue from 'devalue';
|
|
5349
5349
|
import type { RouteId } from './$types';
|
|
@@ -5399,61 +5399,61 @@ describe('POST /signup', () => {
|
|
|
5399
5399
|
expect(data.form.errors.email[0]).toBe('Value must be unique.');
|
|
5400
5400
|
});
|
|
5401
5401
|
});
|
|
5402
|
-
`,
|
|
5403
|
-
"./creates/src/lib/components/app-sidebar.svelte":
|
|
5404
|
-
"./creates/src/lib/components/nav-main.svelte":
|
|
5405
|
-
"./creates/src/lib/components/nav-user.svelte":
|
|
5406
|
-
"./creates/src/lib/components/ui/auth-menu/auth-menu-content.svelte":
|
|
5407
|
-
"./creates/src/lib/components/ui/auth-menu/auth-menu-group.svelte":
|
|
5408
|
-
"./creates/src/lib/components/ui/auth-menu/auth-menu-item.svelte":
|
|
5409
|
-
"./creates/src/lib/components/ui/auth-menu/auth-menu-label.svelte":
|
|
5410
|
-
"./creates/src/lib/components/ui/auth-menu/auth-menu-separator.svelte":
|
|
5411
|
-
"./creates/src/lib/components/ui/auth-menu/auth-menu-trigger.svelte":
|
|
5412
|
-
"./creates/src/lib/components/ui/auth-menu/auth-menu.svelte":
|
|
5413
|
-
"./creates/src/lib/components/ui/auth-menu/context.ts":
|
|
5414
|
-
"./creates/src/lib/components/ui/auth-menu/index.ts":
|
|
5415
|
-
"./creates/src/lib/schemas/changeEmail.ts":
|
|
5416
|
-
"./creates/src/lib/schemas/changePassword.ts":
|
|
5417
|
-
"./creates/src/lib/schemas/confirmEmailChange.ts":
|
|
5418
|
-
"./creates/src/lib/schemas/confirmReset.ts":
|
|
5419
|
-
"./creates/src/lib/schemas/login.ts":
|
|
5420
|
-
"./creates/src/lib/schemas/otp.ts":
|
|
5421
|
-
"./creates/src/lib/schemas/profile.ts":
|
|
5422
|
-
"./creates/src/lib/schemas/reset.ts":
|
|
5423
|
-
"./creates/src/lib/schemas/signup.ts":
|
|
5424
|
-
"./creates/src/routes/(app)/+layout.server.ts":
|
|
5425
|
-
"./creates/src/routes/(app)/+layout.svelte":
|
|
5426
|
-
"./creates/src/routes/(app)/dashboard/+page.svelte":
|
|
5427
|
-
"./creates/src/routes/(app)/dashboard/server.test.ts":
|
|
5428
|
-
"./creates/src/routes/(app)/settings/+layout.server.ts":
|
|
5429
|
-
"./creates/src/routes/(app)/settings/+page.server.ts":
|
|
5430
|
-
"./creates/src/routes/(app)/settings/+page.svelte":
|
|
5431
|
-
"./creates/src/routes/(public)/confirm-email-change/[token]/+page.server.ts":
|
|
5432
|
-
"./creates/src/routes/(public)/confirm-email-change/[token]/+page.svelte":
|
|
5433
|
-
"./creates/src/routes/(public)/confirm-email-change/[token]/server.test.ts":
|
|
5434
|
-
"./creates/src/routes/(public)/confirm-reset/[token]/+page.server.ts":
|
|
5435
|
-
"./creates/src/routes/(public)/confirm-reset/[token]/+page.svelte":
|
|
5436
|
-
"./creates/src/routes/(public)/confirm-reset/[token]/server.test.ts":
|
|
5437
|
-
"./creates/src/routes/(public)/confirm-verification/[token]/+server.ts":
|
|
5438
|
-
"./creates/src/routes/(public)/confirm-verification/[token]/server.test.ts":
|
|
5439
|
-
"./creates/src/routes/(public)/login/+page.server.ts":
|
|
5440
|
-
"./creates/src/routes/(public)/login/+page.svelte":
|
|
5441
|
-
"./creates/src/routes/(public)/login/server.test.ts":
|
|
5442
|
-
"./creates/src/routes/(public)/logout/+server.ts":
|
|
5443
|
-
"./creates/src/routes/(public)/logout/server.test.ts":
|
|
5444
|
-
"./creates/src/routes/(public)/otp/[token]/+page.server.ts":
|
|
5445
|
-
"./creates/src/routes/(public)/otp/[token]/+page.svelte":
|
|
5446
|
-
"./creates/src/routes/(public)/otp/[token]/server.test.ts":
|
|
5447
|
-
"./creates/src/routes/(public)/reset/+page.server.ts":
|
|
5448
|
-
"./creates/src/routes/(public)/reset/+page.svelte":
|
|
5449
|
-
"./creates/src/routes/(public)/reset/server.test.ts":
|
|
5450
|
-
"./creates/src/routes/(public)/signup/+page.server.ts":
|
|
5451
|
-
"./creates/src/routes/(public)/signup/+page.svelte":
|
|
5452
|
-
"./creates/src/routes/(public)/signup/server.test.ts":
|
|
5453
|
-
}),
|
|
5454
|
-
async function
|
|
5455
|
-
const e = Object.entries(
|
|
5456
|
-
const s =
|
|
5402
|
+
`, ea = /* @__PURE__ */ Object.assign({
|
|
5403
|
+
"./creates/src/lib/components/app-sidebar.svelte": or,
|
|
5404
|
+
"./creates/src/lib/components/nav-main.svelte": sr,
|
|
5405
|
+
"./creates/src/lib/components/nav-user.svelte": ir,
|
|
5406
|
+
"./creates/src/lib/components/ui/auth-menu/auth-menu-content.svelte": lr,
|
|
5407
|
+
"./creates/src/lib/components/ui/auth-menu/auth-menu-group.svelte": cr,
|
|
5408
|
+
"./creates/src/lib/components/ui/auth-menu/auth-menu-item.svelte": mr,
|
|
5409
|
+
"./creates/src/lib/components/ui/auth-menu/auth-menu-label.svelte": ur,
|
|
5410
|
+
"./creates/src/lib/components/ui/auth-menu/auth-menu-separator.svelte": pr,
|
|
5411
|
+
"./creates/src/lib/components/ui/auth-menu/auth-menu-trigger.svelte": dr,
|
|
5412
|
+
"./creates/src/lib/components/ui/auth-menu/auth-menu.svelte": fr,
|
|
5413
|
+
"./creates/src/lib/components/ui/auth-menu/context.ts": hr,
|
|
5414
|
+
"./creates/src/lib/components/ui/auth-menu/index.ts": gr,
|
|
5415
|
+
"./creates/src/lib/schemas/changeEmail.ts": br,
|
|
5416
|
+
"./creates/src/lib/schemas/changePassword.ts": vr,
|
|
5417
|
+
"./creates/src/lib/schemas/confirmEmailChange.ts": wr,
|
|
5418
|
+
"./creates/src/lib/schemas/confirmReset.ts": yr,
|
|
5419
|
+
"./creates/src/lib/schemas/login.ts": xr,
|
|
5420
|
+
"./creates/src/lib/schemas/otp.ts": $r,
|
|
5421
|
+
"./creates/src/lib/schemas/profile.ts": Fr,
|
|
5422
|
+
"./creates/src/lib/schemas/reset.ts": Cr,
|
|
5423
|
+
"./creates/src/lib/schemas/signup.ts": _r,
|
|
5424
|
+
"./creates/src/routes/(app)/+layout.server.ts": Sr,
|
|
5425
|
+
"./creates/src/routes/(app)/+layout.svelte": kr,
|
|
5426
|
+
"./creates/src/routes/(app)/dashboard/+page.svelte": Mr,
|
|
5427
|
+
"./creates/src/routes/(app)/dashboard/server.test.ts": Pr,
|
|
5428
|
+
"./creates/src/routes/(app)/settings/+layout.server.ts": Rr,
|
|
5429
|
+
"./creates/src/routes/(app)/settings/+page.server.ts": Er,
|
|
5430
|
+
"./creates/src/routes/(app)/settings/+page.svelte": Ir,
|
|
5431
|
+
"./creates/src/routes/(public)/confirm-email-change/[token]/+page.server.ts": Tr,
|
|
5432
|
+
"./creates/src/routes/(public)/confirm-email-change/[token]/+page.svelte": zr,
|
|
5433
|
+
"./creates/src/routes/(public)/confirm-email-change/[token]/server.test.ts": Dr,
|
|
5434
|
+
"./creates/src/routes/(public)/confirm-reset/[token]/+page.server.ts": Ar,
|
|
5435
|
+
"./creates/src/routes/(public)/confirm-reset/[token]/+page.svelte": Nr,
|
|
5436
|
+
"./creates/src/routes/(public)/confirm-reset/[token]/server.test.ts": Br,
|
|
5437
|
+
"./creates/src/routes/(public)/confirm-verification/[token]/+server.ts": jr,
|
|
5438
|
+
"./creates/src/routes/(public)/confirm-verification/[token]/server.test.ts": Lr,
|
|
5439
|
+
"./creates/src/routes/(public)/login/+page.server.ts": Or,
|
|
5440
|
+
"./creates/src/routes/(public)/login/+page.svelte": qr,
|
|
5441
|
+
"./creates/src/routes/(public)/login/server.test.ts": Ur,
|
|
5442
|
+
"./creates/src/routes/(public)/logout/+server.ts": Vr,
|
|
5443
|
+
"./creates/src/routes/(public)/logout/server.test.ts": Hr,
|
|
5444
|
+
"./creates/src/routes/(public)/otp/[token]/+page.server.ts": Gr,
|
|
5445
|
+
"./creates/src/routes/(public)/otp/[token]/+page.svelte": Kr,
|
|
5446
|
+
"./creates/src/routes/(public)/otp/[token]/server.test.ts": Wr,
|
|
5447
|
+
"./creates/src/routes/(public)/reset/+page.server.ts": Xr,
|
|
5448
|
+
"./creates/src/routes/(public)/reset/+page.svelte": Yr,
|
|
5449
|
+
"./creates/src/routes/(public)/reset/server.test.ts": Jr,
|
|
5450
|
+
"./creates/src/routes/(public)/signup/+page.server.ts": Zr,
|
|
5451
|
+
"./creates/src/routes/(public)/signup/+page.svelte": Qr,
|
|
5452
|
+
"./creates/src/routes/(public)/signup/server.test.ts": ta
|
|
5453
|
+
}), na = "./creates/";
|
|
5454
|
+
async function ra(t) {
|
|
5455
|
+
const e = Object.entries(ea).map(([r, a]) => {
|
|
5456
|
+
const s = zt(r, na);
|
|
5457
5457
|
return {
|
|
5458
5458
|
path: s,
|
|
5459
5459
|
language: B(s),
|
|
@@ -5486,7 +5486,7 @@ async function na(t) {
|
|
|
5486
5486
|
collections: []
|
|
5487
5487
|
};
|
|
5488
5488
|
}
|
|
5489
|
-
const
|
|
5489
|
+
const aa = `/// <reference path="../pb_data/types.d.ts" />
|
|
5490
5490
|
migrate(
|
|
5491
5491
|
(app) => {
|
|
5492
5492
|
const collection = new Collection({
|
|
@@ -5672,7 +5672,7 @@ migrate(
|
|
|
5672
5672
|
return app.delete(collection);
|
|
5673
5673
|
}
|
|
5674
5674
|
);
|
|
5675
|
-
`,
|
|
5675
|
+
`, oa = `/// <reference path="../pb_data/types.d.ts" />
|
|
5676
5676
|
migrate(
|
|
5677
5677
|
(app) => {
|
|
5678
5678
|
const collection = app.findCollectionByNameOrId('_pb_users_auth_');
|
|
@@ -5727,7 +5727,7 @@ migrate(
|
|
|
5727
5727
|
return app.save(collection);
|
|
5728
5728
|
}
|
|
5729
5729
|
);
|
|
5730
|
-
`,
|
|
5730
|
+
`, sa = `import {
|
|
5731
5731
|
POCKETBASE_URL,
|
|
5732
5732
|
POCKETBASE_SUPERUSER_EMAIL,
|
|
5733
5733
|
POCKETBASE_SUPERUSER_PASSWORD
|
|
@@ -5740,7 +5740,7 @@ export const handle = handlePocketbase({
|
|
|
5740
5740
|
superuserPassword: POCKETBASE_SUPERUSER_PASSWORD,
|
|
5741
5741
|
auth: { protectedRoutes: ['/(app)'] }
|
|
5742
5742
|
});
|
|
5743
|
-
`,
|
|
5743
|
+
`, ia = `<script lang="ts">
|
|
5744
5744
|
import { toggleMode } from 'mode-watcher';
|
|
5745
5745
|
import * as Navbar from '$lib/components/ui/navbar';
|
|
5746
5746
|
import { Button } from '$lib/components/ui/button';
|
|
@@ -5842,23 +5842,23 @@ export const handle = handlePocketbase({
|
|
|
5842
5842
|
@apply container mx-auto max-w-7xl px-4 py-8 w-full;
|
|
5843
5843
|
}
|
|
5844
5844
|
</style>
|
|
5845
|
-
`,
|
|
5845
|
+
`, la = `import { loadFlash } from "sveltekit-flash-message/server";
|
|
5846
5846
|
|
|
5847
5847
|
export const load = loadFlash(async ({ locals }) => {
|
|
5848
5848
|
return {
|
|
5849
5849
|
user: locals.pb.authStore.record,
|
|
5850
5850
|
};
|
|
5851
5851
|
});
|
|
5852
|
-
`,
|
|
5853
|
-
"./preview-modifies/migrations/1776099881_created_oauth_accounts.js":
|
|
5854
|
-
"./preview-modifies/migrations/1776099881_updated_users.js":
|
|
5855
|
-
"./preview-modifies/src/hooks.server.ts":
|
|
5856
|
-
"./preview-modifies/src/routes/(public)/root-layout.svelte":
|
|
5857
|
-
"./preview-modifies/src/routes/+layout.server.ts":
|
|
5858
|
-
}),
|
|
5859
|
-
async function
|
|
5860
|
-
const e = Object.entries(
|
|
5861
|
-
const a =
|
|
5852
|
+
`, ca = /* @__PURE__ */ Object.assign({
|
|
5853
|
+
"./preview-modifies/migrations/1776099881_created_oauth_accounts.js": aa,
|
|
5854
|
+
"./preview-modifies/migrations/1776099881_updated_users.js": oa,
|
|
5855
|
+
"./preview-modifies/src/hooks.server.ts": sa,
|
|
5856
|
+
"./preview-modifies/src/routes/(public)/root-layout.svelte": ia,
|
|
5857
|
+
"./preview-modifies/src/routes/+layout.server.ts": la
|
|
5858
|
+
}), ma = "./preview-modifies/";
|
|
5859
|
+
async function ua(t) {
|
|
5860
|
+
const e = Object.entries(ca).map(([n, r]) => {
|
|
5861
|
+
const a = zt(n, ma);
|
|
5862
5862
|
return {
|
|
5863
5863
|
path: a,
|
|
5864
5864
|
language: B(a),
|
|
@@ -5874,16 +5874,16 @@ async function ma(t) {
|
|
|
5874
5874
|
collections: []
|
|
5875
5875
|
};
|
|
5876
5876
|
}
|
|
5877
|
-
async function
|
|
5878
|
-
const e = await
|
|
5877
|
+
async function pa(t) {
|
|
5878
|
+
const e = await ra(t);
|
|
5879
5879
|
if (t.env === "preview") {
|
|
5880
|
-
const s = await
|
|
5880
|
+
const s = await ua();
|
|
5881
5881
|
return mt([e, s]);
|
|
5882
5882
|
}
|
|
5883
|
-
const { generate: n } = await import("./generate.runtime-
|
|
5883
|
+
const { generate: n } = await import("./generate.runtime-BXbRs6o2.js"), r = await n(t), { writeResult: a } = await import("./write-result-DG5OAbe1.js");
|
|
5884
5884
|
return a(mt([e, r]), t);
|
|
5885
5885
|
}
|
|
5886
|
-
const
|
|
5886
|
+
const da = {
|
|
5887
5887
|
slug: "enable-auth",
|
|
5888
5888
|
title: "Enable authentication",
|
|
5889
5889
|
summary: "Enables authentication.",
|
|
@@ -5901,16 +5901,26 @@ const pa = {
|
|
|
5901
5901
|
argv: ["enable", "auth"]
|
|
5902
5902
|
},
|
|
5903
5903
|
baseline: "velastack",
|
|
5904
|
-
generate:
|
|
5905
|
-
},
|
|
5904
|
+
generate: pa
|
|
5905
|
+
}, It = [
|
|
5906
|
+
$n,
|
|
5907
|
+
ar,
|
|
5908
|
+
Dn,
|
|
5909
|
+
Jn,
|
|
5910
|
+
da
|
|
5911
|
+
], ba = {
|
|
5906
5912
|
version: "0.1.0",
|
|
5907
|
-
patterns:
|
|
5913
|
+
patterns: It,
|
|
5914
|
+
bySlug: It.reduce(
|
|
5915
|
+
(t, e) => (t[e.slug] = e, t),
|
|
5916
|
+
{}
|
|
5917
|
+
)
|
|
5908
5918
|
};
|
|
5909
5919
|
export {
|
|
5910
|
-
|
|
5911
|
-
|
|
5920
|
+
ha as D,
|
|
5921
|
+
ga as M,
|
|
5912
5922
|
p as d,
|
|
5913
|
-
|
|
5923
|
+
ba as i,
|
|
5914
5924
|
B as l
|
|
5915
5925
|
};
|
|
5916
|
-
//# sourceMappingURL=index-
|
|
5926
|
+
//# sourceMappingURL=index-8rNhWMFD.js.map
|