nextjs-cms 0.5.55 → 0.5.58
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/api/index.d.ts +90 -45
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/lib/serverActions.d.ts +68 -5
- package/dist/api/lib/serverActions.d.ts.map +1 -1
- package/dist/api/lib/serverActions.js +33 -8
- package/dist/api/root.d.ts +961 -44
- package/dist/api/root.d.ts.map +1 -1
- package/dist/api/root.js +2 -1
- package/dist/api/routers/accountSettings.d.ts +1 -3
- package/dist/api/routers/accountSettings.d.ts.map +1 -1
- package/dist/api/routers/admins.d.ts +1 -3
- package/dist/api/routers/admins.d.ts.map +1 -1
- package/dist/api/routers/admins.js +1 -1
- package/dist/api/routers/auth.d.ts +9 -3
- package/dist/api/routers/auth.d.ts.map +1 -1
- package/dist/api/routers/categorySection.d.ts +1 -3
- package/dist/api/routers/categorySection.d.ts.map +1 -1
- package/dist/api/routers/cmsSettings.d.ts +1 -3
- package/dist/api/routers/cmsSettings.d.ts.map +1 -1
- package/dist/api/routers/cpanel.d.ts +1 -3
- package/dist/api/routers/cpanel.d.ts.map +1 -1
- package/dist/api/routers/files.d.ts +1 -3
- package/dist/api/routers/files.d.ts.map +1 -1
- package/dist/api/routers/gallery.d.ts +1 -3
- package/dist/api/routers/gallery.d.ts.map +1 -1
- package/dist/api/routers/gallery.js +7 -6
- package/dist/api/routers/googleAnalytics.d.ts +1 -3
- package/dist/api/routers/googleAnalytics.d.ts.map +1 -1
- package/dist/api/routers/hasItemsSection.d.ts +49 -5
- package/dist/api/routers/hasItemsSection.d.ts.map +1 -1
- package/dist/api/routers/navigation.d.ts +1 -3
- package/dist/api/routers/navigation.d.ts.map +1 -1
- package/dist/api/routers/simpleSection.d.ts +21 -4
- package/dist/api/routers/simpleSection.d.ts.map +1 -1
- package/dist/api/trpc/query-client.d.ts +3 -0
- package/dist/api/trpc/query-client.d.ts.map +1 -0
- package/dist/api/trpc/query-client.js +23 -0
- package/dist/api/trpc/server.d.ts +8 -0
- package/dist/api/trpc/server.d.ts.map +1 -0
- package/dist/api/trpc/server.js +23 -0
- package/dist/api/trpc.d.ts +6 -17
- package/dist/api/trpc.d.ts.map +1 -1
- package/dist/api/trpc.js +6 -9
- package/dist/auth/hooks/useRefreshToken.d.ts.map +1 -1
- package/dist/auth/hooks/useRefreshToken.js +11 -9
- package/dist/auth/lib/actions.d.ts +10 -0
- package/dist/auth/lib/actions.d.ts.map +1 -1
- package/dist/auth/lib/actions.js +50 -20
- package/dist/auth/react.d.ts +7 -1
- package/dist/auth/react.d.ts.map +1 -1
- package/dist/auth/react.js +51 -29
- package/dist/auth/trpc.d.ts.map +1 -1
- package/dist/auth/trpc.js +2 -1
- package/dist/core/config/config-loader.d.ts +1 -1
- package/dist/core/config/config-loader.d.ts.map +1 -1
- package/dist/core/config/config-loader.js +9 -6
- package/dist/core/config/index.d.ts +1 -0
- package/dist/core/config/index.d.ts.map +1 -1
- package/dist/core/config/index.js +1 -0
- package/dist/core/config/loader-with-esbuild.d.ts +7 -0
- package/dist/core/config/loader-with-esbuild.d.ts.map +1 -0
- package/dist/core/config/loader-with-esbuild.js +98 -0
- package/dist/core/config/loader-with-jiti.d.ts +13 -0
- package/dist/core/config/loader-with-jiti.d.ts.map +1 -0
- package/dist/core/config/loader-with-jiti.js +162 -0
- package/dist/core/config/loader.d.ts +1 -1
- package/dist/core/config/loader.d.ts.map +1 -1
- package/dist/core/config/loader.js +1 -75
- package/dist/core/factories/SectionFactory.d.ts +1 -109
- package/dist/core/factories/SectionFactory.d.ts.map +1 -1
- package/dist/core/factories/SectionFactory.js +1 -452
- package/dist/core/factories/section-factory-with-esbuild.d.ts +110 -0
- package/dist/core/factories/section-factory-with-esbuild.d.ts.map +1 -0
- package/dist/core/factories/section-factory-with-esbuild.js +509 -0
- package/dist/core/factories/section-factory-with-jiti.d.ts +113 -0
- package/dist/core/factories/section-factory-with-jiti.d.ts.map +1 -0
- package/dist/core/factories/section-factory-with-jiti.js +556 -0
- package/dist/core/fields/document.d.ts +0 -1
- package/dist/core/fields/document.d.ts.map +1 -1
- package/dist/core/fields/document.js +5 -4
- package/dist/core/fields/photo.d.ts +10 -7
- package/dist/core/fields/photo.d.ts.map +1 -1
- package/dist/core/fields/photo.js +44 -17
- package/dist/core/fields/richText.d.ts +0 -1
- package/dist/core/fields/richText.d.ts.map +1 -1
- package/dist/core/fields/richText.js +5 -4
- package/dist/core/fields/video.d.ts +0 -1
- package/dist/core/fields/video.d.ts.map +1 -1
- package/dist/core/fields/video.js +5 -4
- package/dist/core/sections/section.d.ts +17 -15
- package/dist/core/sections/section.d.ts.map +1 -1
- package/dist/core/sections/section.js +28 -5
- package/dist/core/submit/submit.d.ts.map +1 -1
- package/dist/core/submit/submit.js +13 -12
- package/dist/translations/dictionaries/ar.json +1 -0
- package/dist/translations/dictionaries/en.json +1 -0
- package/dist/translations/index.d.ts.map +1 -1
- package/dist/translations/index.js +1 -3
- package/package.json +16 -7
package/dist/api/index.d.ts
CHANGED
|
@@ -11,13 +11,11 @@ import { createTRPCContext } from './trpc.js';
|
|
|
11
11
|
*/
|
|
12
12
|
declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
13
13
|
ctx: {
|
|
14
|
+
headers: Headers;
|
|
14
15
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
15
16
|
$client: import("mysql2/promise").Pool;
|
|
16
17
|
};
|
|
17
18
|
session: import("../index.js").Session | null;
|
|
18
|
-
opts: {
|
|
19
|
-
headers: Headers;
|
|
20
|
-
};
|
|
21
19
|
};
|
|
22
20
|
meta: object;
|
|
23
21
|
errorShape: {
|
|
@@ -35,13 +33,11 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
35
33
|
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
36
34
|
auth: import("@trpc/server").TRPCBuiltRouter<{
|
|
37
35
|
ctx: {
|
|
36
|
+
headers: Headers;
|
|
38
37
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
39
38
|
$client: import("mysql2/promise").Pool;
|
|
40
39
|
};
|
|
41
40
|
session: import("../index.js").Session | null;
|
|
42
|
-
opts: {
|
|
43
|
-
headers: Headers;
|
|
44
|
-
};
|
|
45
41
|
};
|
|
46
42
|
meta: object;
|
|
47
43
|
errorShape: {
|
|
@@ -63,6 +59,14 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
63
59
|
password: string;
|
|
64
60
|
};
|
|
65
61
|
output: {
|
|
62
|
+
status: number;
|
|
63
|
+
session: {
|
|
64
|
+
user: {
|
|
65
|
+
id: string;
|
|
66
|
+
name: string;
|
|
67
|
+
locale: string | null;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
66
70
|
user: {
|
|
67
71
|
id: string;
|
|
68
72
|
username: string;
|
|
@@ -81,13 +85,11 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
81
85
|
}>>;
|
|
82
86
|
admins: import("@trpc/server").TRPCBuiltRouter<{
|
|
83
87
|
ctx: {
|
|
88
|
+
headers: Headers;
|
|
84
89
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
85
90
|
$client: import("mysql2/promise").Pool;
|
|
86
91
|
};
|
|
87
92
|
session: import("../index.js").Session | null;
|
|
88
|
-
opts: {
|
|
89
|
-
headers: Headers;
|
|
90
|
-
};
|
|
91
93
|
};
|
|
92
94
|
meta: object;
|
|
93
95
|
errorShape: {
|
|
@@ -185,13 +187,11 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
185
187
|
}>>;
|
|
186
188
|
hasItemsSections: import("@trpc/server").TRPCBuiltRouter<{
|
|
187
189
|
ctx: {
|
|
190
|
+
headers: Headers;
|
|
188
191
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
189
192
|
$client: import("mysql2/promise").Pool;
|
|
190
193
|
};
|
|
191
194
|
session: import("../index.js").Session | null;
|
|
192
|
-
opts: {
|
|
193
|
-
headers: Headers;
|
|
194
|
-
};
|
|
195
195
|
};
|
|
196
196
|
meta: object;
|
|
197
197
|
errorShape: {
|
|
@@ -250,7 +250,30 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
250
250
|
section?: undefined;
|
|
251
251
|
inputGroups?: undefined;
|
|
252
252
|
} | {
|
|
253
|
-
section:
|
|
253
|
+
section: {
|
|
254
|
+
name: string;
|
|
255
|
+
title: {
|
|
256
|
+
section: string;
|
|
257
|
+
singular: string;
|
|
258
|
+
plural: string;
|
|
259
|
+
};
|
|
260
|
+
gallery: {
|
|
261
|
+
db: {
|
|
262
|
+
tableName: string;
|
|
263
|
+
referenceIdentifierField: string;
|
|
264
|
+
photoNameField: string;
|
|
265
|
+
metaField: string;
|
|
266
|
+
};
|
|
267
|
+
watermark?: boolean;
|
|
268
|
+
thumbnail?: {
|
|
269
|
+
width: number;
|
|
270
|
+
height: number;
|
|
271
|
+
crop: boolean;
|
|
272
|
+
quality: number;
|
|
273
|
+
};
|
|
274
|
+
} | undefined;
|
|
275
|
+
variants: import("../core/types/index.js").Variant[] | undefined;
|
|
276
|
+
};
|
|
254
277
|
inputGroups: {
|
|
255
278
|
groupId: number;
|
|
256
279
|
groupTitle: string;
|
|
@@ -283,7 +306,30 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
283
306
|
inputGroups?: undefined;
|
|
284
307
|
gallery?: undefined;
|
|
285
308
|
} | {
|
|
286
|
-
section:
|
|
309
|
+
section: {
|
|
310
|
+
name: string;
|
|
311
|
+
title: {
|
|
312
|
+
section: string;
|
|
313
|
+
singular: string;
|
|
314
|
+
plural: string;
|
|
315
|
+
};
|
|
316
|
+
gallery: {
|
|
317
|
+
db: {
|
|
318
|
+
tableName: string;
|
|
319
|
+
referenceIdentifierField: string;
|
|
320
|
+
photoNameField: string;
|
|
321
|
+
metaField: string;
|
|
322
|
+
};
|
|
323
|
+
watermark?: boolean;
|
|
324
|
+
thumbnail?: {
|
|
325
|
+
width: number;
|
|
326
|
+
height: number;
|
|
327
|
+
crop: boolean;
|
|
328
|
+
quality: number;
|
|
329
|
+
};
|
|
330
|
+
} | undefined;
|
|
331
|
+
variants: import("../core/types/index.js").Variant[] | undefined;
|
|
332
|
+
};
|
|
287
333
|
inputGroups: {
|
|
288
334
|
groupId: number;
|
|
289
335
|
groupTitle: string;
|
|
@@ -323,13 +369,11 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
323
369
|
}>>;
|
|
324
370
|
simpleSections: import("@trpc/server").TRPCBuiltRouter<{
|
|
325
371
|
ctx: {
|
|
372
|
+
headers: Headers;
|
|
326
373
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
327
374
|
$client: import("mysql2/promise").Pool;
|
|
328
375
|
};
|
|
329
376
|
session: import("../index.js").Session | null;
|
|
330
|
-
opts: {
|
|
331
|
-
headers: Headers;
|
|
332
|
-
};
|
|
333
377
|
};
|
|
334
378
|
meta: object;
|
|
335
379
|
errorShape: {
|
|
@@ -356,7 +400,26 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
356
400
|
section?: undefined;
|
|
357
401
|
inputGroups?: undefined;
|
|
358
402
|
} | {
|
|
359
|
-
section:
|
|
403
|
+
section: {
|
|
404
|
+
name: string;
|
|
405
|
+
title: string;
|
|
406
|
+
gallery: {
|
|
407
|
+
db: {
|
|
408
|
+
tableName: string;
|
|
409
|
+
referenceIdentifierField: string;
|
|
410
|
+
photoNameField: string;
|
|
411
|
+
metaField: string;
|
|
412
|
+
};
|
|
413
|
+
watermark?: boolean;
|
|
414
|
+
thumbnail?: {
|
|
415
|
+
width: number;
|
|
416
|
+
height: number;
|
|
417
|
+
crop: boolean;
|
|
418
|
+
quality: number;
|
|
419
|
+
};
|
|
420
|
+
} | undefined;
|
|
421
|
+
variants: import("../core/types/index.js").Variant[] | undefined;
|
|
422
|
+
};
|
|
360
423
|
inputGroups: {
|
|
361
424
|
groupId: number;
|
|
362
425
|
groupTitle: string;
|
|
@@ -379,13 +442,11 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
379
442
|
}>>;
|
|
380
443
|
categorySections: import("@trpc/server").TRPCBuiltRouter<{
|
|
381
444
|
ctx: {
|
|
445
|
+
headers: Headers;
|
|
382
446
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
383
447
|
$client: import("mysql2/promise").Pool;
|
|
384
448
|
};
|
|
385
449
|
session: import("../index.js").Session | null;
|
|
386
|
-
opts: {
|
|
387
|
-
headers: Headers;
|
|
388
|
-
};
|
|
389
450
|
};
|
|
390
451
|
meta: object;
|
|
391
452
|
errorShape: {
|
|
@@ -481,13 +542,11 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
481
542
|
}>>;
|
|
482
543
|
files: import("@trpc/server").TRPCBuiltRouter<{
|
|
483
544
|
ctx: {
|
|
545
|
+
headers: Headers;
|
|
484
546
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
485
547
|
$client: import("mysql2/promise").Pool;
|
|
486
548
|
};
|
|
487
549
|
session: import("../index.js").Session | null;
|
|
488
|
-
opts: {
|
|
489
|
-
headers: Headers;
|
|
490
|
-
};
|
|
491
550
|
};
|
|
492
551
|
meta: object;
|
|
493
552
|
errorShape: {
|
|
@@ -527,13 +586,11 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
527
586
|
}>>;
|
|
528
587
|
gallery: import("@trpc/server").TRPCBuiltRouter<{
|
|
529
588
|
ctx: {
|
|
589
|
+
headers: Headers;
|
|
530
590
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
531
591
|
$client: import("mysql2/promise").Pool;
|
|
532
592
|
};
|
|
533
593
|
session: import("../index.js").Session | null;
|
|
534
|
-
opts: {
|
|
535
|
-
headers: Headers;
|
|
536
|
-
};
|
|
537
594
|
};
|
|
538
595
|
meta: object;
|
|
539
596
|
errorShape: {
|
|
@@ -561,13 +618,11 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
561
618
|
}>>;
|
|
562
619
|
navigation: import("@trpc/server").TRPCBuiltRouter<{
|
|
563
620
|
ctx: {
|
|
621
|
+
headers: Headers;
|
|
564
622
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
565
623
|
$client: import("mysql2/promise").Pool;
|
|
566
624
|
};
|
|
567
625
|
session: import("../index.js").Session | null;
|
|
568
|
-
opts: {
|
|
569
|
-
headers: Headers;
|
|
570
|
-
};
|
|
571
626
|
};
|
|
572
627
|
meta: object;
|
|
573
628
|
errorShape: {
|
|
@@ -612,13 +667,11 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
612
667
|
}>>;
|
|
613
668
|
accountSettings: import("@trpc/server").TRPCBuiltRouter<{
|
|
614
669
|
ctx: {
|
|
670
|
+
headers: Headers;
|
|
615
671
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
616
672
|
$client: import("mysql2/promise").Pool;
|
|
617
673
|
};
|
|
618
674
|
session: import("../index.js").Session | null;
|
|
619
|
-
opts: {
|
|
620
|
-
headers: Headers;
|
|
621
|
-
};
|
|
622
675
|
};
|
|
623
676
|
meta: object;
|
|
624
677
|
errorShape: {
|
|
@@ -667,13 +720,11 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
667
720
|
}>>;
|
|
668
721
|
cmsSettings: import("@trpc/server").TRPCBuiltRouter<{
|
|
669
722
|
ctx: {
|
|
723
|
+
headers: Headers;
|
|
670
724
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
671
725
|
$client: import("mysql2/promise").Pool;
|
|
672
726
|
};
|
|
673
727
|
session: import("../index.js").Session | null;
|
|
674
|
-
opts: {
|
|
675
|
-
headers: Headers;
|
|
676
|
-
};
|
|
677
728
|
};
|
|
678
729
|
meta: object;
|
|
679
730
|
errorShape: {
|
|
@@ -710,13 +761,11 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
710
761
|
}>>;
|
|
711
762
|
cpanel: import("@trpc/server").TRPCBuiltRouter<{
|
|
712
763
|
ctx: {
|
|
764
|
+
headers: Headers;
|
|
713
765
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
714
766
|
$client: import("mysql2/promise").Pool;
|
|
715
767
|
};
|
|
716
768
|
session: import("../index.js").Session | null;
|
|
717
|
-
opts: {
|
|
718
|
-
headers: Headers;
|
|
719
|
-
};
|
|
720
769
|
};
|
|
721
770
|
meta: object;
|
|
722
771
|
errorShape: {
|
|
@@ -792,13 +841,11 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
792
841
|
}>>;
|
|
793
842
|
googleAnalytics: import("@trpc/server").TRPCBuiltRouter<{
|
|
794
843
|
ctx: {
|
|
844
|
+
headers: Headers;
|
|
795
845
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
796
846
|
$client: import("mysql2/promise").Pool;
|
|
797
847
|
};
|
|
798
848
|
session: import("../index.js").Session | null;
|
|
799
|
-
opts: {
|
|
800
|
-
headers: Headers;
|
|
801
|
-
};
|
|
802
849
|
};
|
|
803
850
|
meta: object;
|
|
804
851
|
errorShape: {
|
|
@@ -823,15 +870,13 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
823
870
|
getHello1: import("@trpc/server").TRPCQueryProcedure<{
|
|
824
871
|
input: void;
|
|
825
872
|
output: {
|
|
873
|
+
headers: Headers;
|
|
826
874
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
827
875
|
$client: import("mysql2/promise").Pool;
|
|
828
876
|
};
|
|
829
877
|
session: {
|
|
830
878
|
user: import("../index.js").User;
|
|
831
879
|
};
|
|
832
|
-
opts: {
|
|
833
|
-
headers: Headers;
|
|
834
|
-
};
|
|
835
880
|
};
|
|
836
881
|
meta: object;
|
|
837
882
|
}>;
|
package/dist/api/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAEzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,EAAuB,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAElE;;;;;;GAMG;AACH,QAAA,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAEzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,EAAuB,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAElE;;;;;;GAMG;AACH,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAiC,CAAA;AAEnD;;;;;IAKI;AACJ,KAAK,YAAY,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAA;AAEhD;;;;;IAKI;AACJ,KAAK,aAAa,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAA;AAElD,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA;AACrD,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,CAAA;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { HasItemsSection } from '../../core/sections/index.js';
|
|
2
|
-
import type { SimpleSection } from '../../core/sections/index.js';
|
|
3
1
|
import type { Session } from '../../auth/index.js';
|
|
4
2
|
export declare const getDocument: (session: Session, input: {
|
|
5
3
|
name: string;
|
|
@@ -47,7 +45,26 @@ export declare const createSimpleSectionPage: (session: Session, sectionName: st
|
|
|
47
45
|
section?: undefined;
|
|
48
46
|
inputGroups?: undefined;
|
|
49
47
|
} | {
|
|
50
|
-
section:
|
|
48
|
+
section: {
|
|
49
|
+
name: string;
|
|
50
|
+
title: string;
|
|
51
|
+
gallery: {
|
|
52
|
+
db: {
|
|
53
|
+
tableName: string;
|
|
54
|
+
referenceIdentifierField: string;
|
|
55
|
+
photoNameField: string;
|
|
56
|
+
metaField: string;
|
|
57
|
+
};
|
|
58
|
+
watermark?: boolean;
|
|
59
|
+
thumbnail?: {
|
|
60
|
+
width: number;
|
|
61
|
+
height: number;
|
|
62
|
+
crop: boolean;
|
|
63
|
+
quality: number;
|
|
64
|
+
};
|
|
65
|
+
} | undefined;
|
|
66
|
+
variants: import("../../core/types/index.js").Variant[] | undefined;
|
|
67
|
+
};
|
|
51
68
|
inputGroups: {
|
|
52
69
|
groupId: number;
|
|
53
70
|
groupTitle: string;
|
|
@@ -78,7 +95,30 @@ export declare const createEditPage: (session: Session, sectionName: string, sec
|
|
|
78
95
|
inputGroups?: undefined;
|
|
79
96
|
gallery?: undefined;
|
|
80
97
|
} | {
|
|
81
|
-
section:
|
|
98
|
+
section: {
|
|
99
|
+
name: string;
|
|
100
|
+
title: {
|
|
101
|
+
section: string;
|
|
102
|
+
singular: string;
|
|
103
|
+
plural: string;
|
|
104
|
+
};
|
|
105
|
+
gallery: {
|
|
106
|
+
db: {
|
|
107
|
+
tableName: string;
|
|
108
|
+
referenceIdentifierField: string;
|
|
109
|
+
photoNameField: string;
|
|
110
|
+
metaField: string;
|
|
111
|
+
};
|
|
112
|
+
watermark?: boolean;
|
|
113
|
+
thumbnail?: {
|
|
114
|
+
width: number;
|
|
115
|
+
height: number;
|
|
116
|
+
crop: boolean;
|
|
117
|
+
quality: number;
|
|
118
|
+
};
|
|
119
|
+
} | undefined;
|
|
120
|
+
variants: import("../../core/types/index.js").Variant[] | undefined;
|
|
121
|
+
};
|
|
82
122
|
inputGroups: {
|
|
83
123
|
groupId: number;
|
|
84
124
|
groupTitle: string;
|
|
@@ -108,7 +148,30 @@ export declare const createNewPage: (session: Session, sectionName: string) => P
|
|
|
108
148
|
section?: undefined;
|
|
109
149
|
inputGroups?: undefined;
|
|
110
150
|
} | {
|
|
111
|
-
section:
|
|
151
|
+
section: {
|
|
152
|
+
name: string;
|
|
153
|
+
title: {
|
|
154
|
+
section: string;
|
|
155
|
+
singular: string;
|
|
156
|
+
plural: string;
|
|
157
|
+
};
|
|
158
|
+
gallery: {
|
|
159
|
+
db: {
|
|
160
|
+
tableName: string;
|
|
161
|
+
referenceIdentifierField: string;
|
|
162
|
+
photoNameField: string;
|
|
163
|
+
metaField: string;
|
|
164
|
+
};
|
|
165
|
+
watermark?: boolean;
|
|
166
|
+
thumbnail?: {
|
|
167
|
+
width: number;
|
|
168
|
+
height: number;
|
|
169
|
+
crop: boolean;
|
|
170
|
+
quality: number;
|
|
171
|
+
};
|
|
172
|
+
} | undefined;
|
|
173
|
+
variants: import("../../core/types/index.js").Variant[] | undefined;
|
|
174
|
+
};
|
|
112
175
|
inputGroups: {
|
|
113
176
|
groupId: number;
|
|
114
177
|
groupTitle: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serverActions.d.ts","sourceRoot":"","sources":["../../../src/api/lib/serverActions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"serverActions.d.ts","sourceRoot":"","sources":["../../../src/api/lib/serverActions.ts"],"names":[],"mappings":"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"}
|
|
@@ -14,7 +14,6 @@ import { readChunk } from 'read-chunk';
|
|
|
14
14
|
import { fileTypeFromBuffer } from 'file-type';
|
|
15
15
|
import { getCMSConfig } from '../../core/config/index.js';
|
|
16
16
|
import through2 from 'through2';
|
|
17
|
-
const uploadsFolder = getCMSConfig().media.upload.path;
|
|
18
17
|
export const getDocument = async (session, input) => {
|
|
19
18
|
const { name, sectionName, fieldName } = input;
|
|
20
19
|
// Sanitize the inputs
|
|
@@ -51,6 +50,7 @@ export const getDocument = async (session, input) => {
|
|
|
51
50
|
/**
|
|
52
51
|
* Split the allowed extensions into an array
|
|
53
52
|
*/
|
|
53
|
+
const uploadsFolder = (await getCMSConfig()).media.upload.path;
|
|
54
54
|
const documentAllowedExtensions = field.extensions;
|
|
55
55
|
const dir = '.documents';
|
|
56
56
|
const pathToFile = path.join(uploadsFolder, dir, sanitizedFolder, sanitizedName);
|
|
@@ -147,6 +147,7 @@ export const getPhoto = async (input) => {
|
|
|
147
147
|
if (sectionQuery.length === 0) {
|
|
148
148
|
throw new Error('Invalid folder name')
|
|
149
149
|
}*/
|
|
150
|
+
const uploadsFolder = (await getCMSConfig()).media.upload.path;
|
|
150
151
|
const dir = isThumb ? '.thumbs' : '.photos';
|
|
151
152
|
const pathToFile = path.join(uploadsFolder, dir, sanitizedFolder, sanitizedName);
|
|
152
153
|
/**
|
|
@@ -178,6 +179,7 @@ export async function streamPhoto(input) {
|
|
|
178
179
|
const sanitizedFolder = sanitizeFolderOrFileName(folder);
|
|
179
180
|
const sanitizedName = sanitizeFileName(name);
|
|
180
181
|
const dir = isThumb ? '.thumbs' : '.photos';
|
|
182
|
+
const uploadsFolder = (await getCMSConfig()).media.upload.path;
|
|
181
183
|
const pathToFile = path.join(uploadsFolder, dir, sanitizedFolder, sanitizedName);
|
|
182
184
|
/**
|
|
183
185
|
* Disable caching for the image to avoid unlink issues when removing the image
|
|
@@ -275,8 +277,15 @@ export const createSimpleSectionPage = async (session, sectionName) => {
|
|
|
275
277
|
const variantInfo = variant.info
|
|
276
278
|
})
|
|
277
279
|
}*/
|
|
280
|
+
const sectionInfo = fieldsFactory.sectionInfo;
|
|
281
|
+
const gallery = await sectionInfo.getGallery();
|
|
278
282
|
return {
|
|
279
|
-
section:
|
|
283
|
+
section: {
|
|
284
|
+
name: sectionInfo.name,
|
|
285
|
+
title: sectionInfo.title,
|
|
286
|
+
gallery: gallery,
|
|
287
|
+
variants: sectionInfo.variants,
|
|
288
|
+
},
|
|
280
289
|
inputGroups: fieldsFactory.getGroupedFields(),
|
|
281
290
|
};
|
|
282
291
|
}
|
|
@@ -335,6 +344,7 @@ export const deleteSectionItem = async (session, sectionName, sectionItemId, rec
|
|
|
335
344
|
* Grab the file fields to delete the files
|
|
336
345
|
*/
|
|
337
346
|
const fileFieldConfigs = section.fieldConfigs.filter((fieldConfig) => fieldConfig.type === 'document' || fieldConfig.type === 'photo' || fieldConfig.type === 'video');
|
|
347
|
+
const uploadsFolder = (await getCMSConfig()).media.upload.path;
|
|
338
348
|
for (const field of fileFieldConfigs) {
|
|
339
349
|
// @ts-ignore
|
|
340
350
|
const value = sectionItemRow[field.name];
|
|
@@ -371,8 +381,9 @@ export const deleteSectionItem = async (session, sectionName, sectionItemId, rec
|
|
|
371
381
|
/**
|
|
372
382
|
* Also delete the gallery photos if they exist
|
|
373
383
|
*/
|
|
374
|
-
|
|
375
|
-
|
|
384
|
+
const gallery = await section.getGallery();
|
|
385
|
+
if (gallery) {
|
|
386
|
+
const { tableName, referenceIdentifierField, photoNameField, metaField } = gallery.db;
|
|
376
387
|
const columns = await MysqlTableChecker.getColumns(tableName);
|
|
377
388
|
if (columns.includes(photoNameField) &&
|
|
378
389
|
columns.includes(referenceIdentifierField) &&
|
|
@@ -488,8 +499,9 @@ export const createEditPage = async (session, sectionName, sectionItemId) => {
|
|
|
488
499
|
* TODO: This is a temp implementation, will be removed once converting the gallery into a field
|
|
489
500
|
*/
|
|
490
501
|
let galleryItems = [];
|
|
491
|
-
|
|
492
|
-
|
|
502
|
+
const gallery = await fieldsFactory.sectionInfo?.getGallery();
|
|
503
|
+
if (gallery) {
|
|
504
|
+
const { tableName, referenceIdentifierField, photoNameField, metaField } = gallery.db;
|
|
493
505
|
const columns = await MysqlTableChecker.getColumns(tableName);
|
|
494
506
|
if (columns.includes(photoNameField) &&
|
|
495
507
|
columns.includes(referenceIdentifierField) &&
|
|
@@ -505,8 +517,14 @@ export const createEditPage = async (session, sectionName, sectionItemId) => {
|
|
|
505
517
|
});
|
|
506
518
|
}
|
|
507
519
|
}
|
|
520
|
+
const sectionInfo = fieldsFactory.sectionInfo;
|
|
508
521
|
return {
|
|
509
|
-
section:
|
|
522
|
+
section: {
|
|
523
|
+
name: sectionInfo.name,
|
|
524
|
+
title: sectionInfo.title,
|
|
525
|
+
gallery: gallery,
|
|
526
|
+
variants: sectionInfo.variants,
|
|
527
|
+
},
|
|
510
528
|
inputGroups: fieldsFactory.getGroupedFields(),
|
|
511
529
|
gallery: galleryItems,
|
|
512
530
|
};
|
|
@@ -567,8 +585,15 @@ export const createNewPage = async (session, sectionName) => {
|
|
|
567
585
|
const variantInfo = variant.info
|
|
568
586
|
})
|
|
569
587
|
}*/
|
|
588
|
+
const sectionInfo = fieldsFactory.sectionInfo;
|
|
589
|
+
const gallery = await sectionInfo.getGallery();
|
|
570
590
|
return {
|
|
571
|
-
section:
|
|
591
|
+
section: {
|
|
592
|
+
name: sectionInfo.name,
|
|
593
|
+
title: sectionInfo.title,
|
|
594
|
+
gallery: gallery,
|
|
595
|
+
variants: sectionInfo.variants,
|
|
596
|
+
},
|
|
572
597
|
inputGroups: fieldsFactory.getGroupedFields(),
|
|
573
598
|
};
|
|
574
599
|
}
|