nextjs-cms 0.5.56 → 0.5.59
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 +82 -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 +953 -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 +1 -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/react.js +1 -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 +8 -0
- package/dist/core/config/loader-with-esbuild.d.ts.map +1 -0
- package/dist/core/config/loader-with-esbuild.js +195 -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 +113 -0
- package/dist/core/factories/section-factory-with-esbuild.d.ts.map +1 -0
- package/dist/core/factories/section-factory-with-esbuild.js +545 -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: {
|
|
@@ -89,13 +85,11 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
89
85
|
}>>;
|
|
90
86
|
admins: import("@trpc/server").TRPCBuiltRouter<{
|
|
91
87
|
ctx: {
|
|
88
|
+
headers: Headers;
|
|
92
89
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
93
90
|
$client: import("mysql2/promise").Pool;
|
|
94
91
|
};
|
|
95
92
|
session: import("../index.js").Session | null;
|
|
96
|
-
opts: {
|
|
97
|
-
headers: Headers;
|
|
98
|
-
};
|
|
99
93
|
};
|
|
100
94
|
meta: object;
|
|
101
95
|
errorShape: {
|
|
@@ -193,13 +187,11 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
193
187
|
}>>;
|
|
194
188
|
hasItemsSections: import("@trpc/server").TRPCBuiltRouter<{
|
|
195
189
|
ctx: {
|
|
190
|
+
headers: Headers;
|
|
196
191
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
197
192
|
$client: import("mysql2/promise").Pool;
|
|
198
193
|
};
|
|
199
194
|
session: import("../index.js").Session | null;
|
|
200
|
-
opts: {
|
|
201
|
-
headers: Headers;
|
|
202
|
-
};
|
|
203
195
|
};
|
|
204
196
|
meta: object;
|
|
205
197
|
errorShape: {
|
|
@@ -258,7 +250,30 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
258
250
|
section?: undefined;
|
|
259
251
|
inputGroups?: undefined;
|
|
260
252
|
} | {
|
|
261
|
-
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
|
+
};
|
|
262
277
|
inputGroups: {
|
|
263
278
|
groupId: number;
|
|
264
279
|
groupTitle: string;
|
|
@@ -291,7 +306,30 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
291
306
|
inputGroups?: undefined;
|
|
292
307
|
gallery?: undefined;
|
|
293
308
|
} | {
|
|
294
|
-
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
|
+
};
|
|
295
333
|
inputGroups: {
|
|
296
334
|
groupId: number;
|
|
297
335
|
groupTitle: string;
|
|
@@ -331,13 +369,11 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
331
369
|
}>>;
|
|
332
370
|
simpleSections: import("@trpc/server").TRPCBuiltRouter<{
|
|
333
371
|
ctx: {
|
|
372
|
+
headers: Headers;
|
|
334
373
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
335
374
|
$client: import("mysql2/promise").Pool;
|
|
336
375
|
};
|
|
337
376
|
session: import("../index.js").Session | null;
|
|
338
|
-
opts: {
|
|
339
|
-
headers: Headers;
|
|
340
|
-
};
|
|
341
377
|
};
|
|
342
378
|
meta: object;
|
|
343
379
|
errorShape: {
|
|
@@ -364,7 +400,26 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
364
400
|
section?: undefined;
|
|
365
401
|
inputGroups?: undefined;
|
|
366
402
|
} | {
|
|
367
|
-
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
|
+
};
|
|
368
423
|
inputGroups: {
|
|
369
424
|
groupId: number;
|
|
370
425
|
groupTitle: string;
|
|
@@ -387,13 +442,11 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
387
442
|
}>>;
|
|
388
443
|
categorySections: import("@trpc/server").TRPCBuiltRouter<{
|
|
389
444
|
ctx: {
|
|
445
|
+
headers: Headers;
|
|
390
446
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
391
447
|
$client: import("mysql2/promise").Pool;
|
|
392
448
|
};
|
|
393
449
|
session: import("../index.js").Session | null;
|
|
394
|
-
opts: {
|
|
395
|
-
headers: Headers;
|
|
396
|
-
};
|
|
397
450
|
};
|
|
398
451
|
meta: object;
|
|
399
452
|
errorShape: {
|
|
@@ -489,13 +542,11 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
489
542
|
}>>;
|
|
490
543
|
files: import("@trpc/server").TRPCBuiltRouter<{
|
|
491
544
|
ctx: {
|
|
545
|
+
headers: Headers;
|
|
492
546
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
493
547
|
$client: import("mysql2/promise").Pool;
|
|
494
548
|
};
|
|
495
549
|
session: import("../index.js").Session | null;
|
|
496
|
-
opts: {
|
|
497
|
-
headers: Headers;
|
|
498
|
-
};
|
|
499
550
|
};
|
|
500
551
|
meta: object;
|
|
501
552
|
errorShape: {
|
|
@@ -535,13 +586,11 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
535
586
|
}>>;
|
|
536
587
|
gallery: import("@trpc/server").TRPCBuiltRouter<{
|
|
537
588
|
ctx: {
|
|
589
|
+
headers: Headers;
|
|
538
590
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
539
591
|
$client: import("mysql2/promise").Pool;
|
|
540
592
|
};
|
|
541
593
|
session: import("../index.js").Session | null;
|
|
542
|
-
opts: {
|
|
543
|
-
headers: Headers;
|
|
544
|
-
};
|
|
545
594
|
};
|
|
546
595
|
meta: object;
|
|
547
596
|
errorShape: {
|
|
@@ -569,13 +618,11 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
569
618
|
}>>;
|
|
570
619
|
navigation: import("@trpc/server").TRPCBuiltRouter<{
|
|
571
620
|
ctx: {
|
|
621
|
+
headers: Headers;
|
|
572
622
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
573
623
|
$client: import("mysql2/promise").Pool;
|
|
574
624
|
};
|
|
575
625
|
session: import("../index.js").Session | null;
|
|
576
|
-
opts: {
|
|
577
|
-
headers: Headers;
|
|
578
|
-
};
|
|
579
626
|
};
|
|
580
627
|
meta: object;
|
|
581
628
|
errorShape: {
|
|
@@ -620,13 +667,11 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
620
667
|
}>>;
|
|
621
668
|
accountSettings: import("@trpc/server").TRPCBuiltRouter<{
|
|
622
669
|
ctx: {
|
|
670
|
+
headers: Headers;
|
|
623
671
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
624
672
|
$client: import("mysql2/promise").Pool;
|
|
625
673
|
};
|
|
626
674
|
session: import("../index.js").Session | null;
|
|
627
|
-
opts: {
|
|
628
|
-
headers: Headers;
|
|
629
|
-
};
|
|
630
675
|
};
|
|
631
676
|
meta: object;
|
|
632
677
|
errorShape: {
|
|
@@ -675,13 +720,11 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
675
720
|
}>>;
|
|
676
721
|
cmsSettings: import("@trpc/server").TRPCBuiltRouter<{
|
|
677
722
|
ctx: {
|
|
723
|
+
headers: Headers;
|
|
678
724
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
679
725
|
$client: import("mysql2/promise").Pool;
|
|
680
726
|
};
|
|
681
727
|
session: import("../index.js").Session | null;
|
|
682
|
-
opts: {
|
|
683
|
-
headers: Headers;
|
|
684
|
-
};
|
|
685
728
|
};
|
|
686
729
|
meta: object;
|
|
687
730
|
errorShape: {
|
|
@@ -718,13 +761,11 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
718
761
|
}>>;
|
|
719
762
|
cpanel: import("@trpc/server").TRPCBuiltRouter<{
|
|
720
763
|
ctx: {
|
|
764
|
+
headers: Headers;
|
|
721
765
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
722
766
|
$client: import("mysql2/promise").Pool;
|
|
723
767
|
};
|
|
724
768
|
session: import("../index.js").Session | null;
|
|
725
|
-
opts: {
|
|
726
|
-
headers: Headers;
|
|
727
|
-
};
|
|
728
769
|
};
|
|
729
770
|
meta: object;
|
|
730
771
|
errorShape: {
|
|
@@ -800,13 +841,11 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
800
841
|
}>>;
|
|
801
842
|
googleAnalytics: import("@trpc/server").TRPCBuiltRouter<{
|
|
802
843
|
ctx: {
|
|
844
|
+
headers: Headers;
|
|
803
845
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
804
846
|
$client: import("mysql2/promise").Pool;
|
|
805
847
|
};
|
|
806
848
|
session: import("../index.js").Session | null;
|
|
807
|
-
opts: {
|
|
808
|
-
headers: Headers;
|
|
809
|
-
};
|
|
810
849
|
};
|
|
811
850
|
meta: object;
|
|
812
851
|
errorShape: {
|
|
@@ -831,15 +870,13 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
831
870
|
getHello1: import("@trpc/server").TRPCQueryProcedure<{
|
|
832
871
|
input: void;
|
|
833
872
|
output: {
|
|
873
|
+
headers: Headers;
|
|
834
874
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
835
875
|
$client: import("mysql2/promise").Pool;
|
|
836
876
|
};
|
|
837
877
|
session: {
|
|
838
878
|
user: import("../index.js").User;
|
|
839
879
|
};
|
|
840
|
-
opts: {
|
|
841
|
-
headers: Headers;
|
|
842
|
-
};
|
|
843
880
|
};
|
|
844
881
|
meta: object;
|
|
845
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
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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":"AAgBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAQlD,eAAO,MAAM,WAAW,GACpB,SAAS,OAAO,EAChB,OAAO;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE;;;EAqGlE,CAAA;AA8BD,eAAO,MAAM,QAAQ,GAAU,OAAO;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,oBAgDxF,CAAA;AAED,wBAAsB,WAAW,CAAC,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,wDAyB3F;AAED,eAAO,MAAM,QAAQ,GAAU,OAAO;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,mBAE7F,CAAA;AAED,eAAO,MAAM,gBAAgB;WAKd,MAAM;WACN,MAAM;iBACA,MAAM;iBACN,MAAM;IAoB1B,CAAA;AAED,eAAO,MAAM,aAAa;QAcd,MAAM;cACA,MAAM;YACR,MA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MAAU,EAAE,IAAI,MAAM;;;;;;;;;;;;;;YA6EnF,MAAM,GAAG,MAAM;sBACL,MAAM;oBACR,MAAM,GAAG,IAAI;mBACd,MAAM;mBACN,MAAM;oBACL,MAAM;;;;EAKjC,CAAA;AAED,eAAO,MAAM,UAAU,GAAU,SAAS,OAAO;;;;;;;;;;;;;;;;;;;;;EAkDhD,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GACnB,MAAM,MAAM,EACZ,UAAU;IACN,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,MAAM,CAAA;CACf,KACF,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAcpC,CAAA"}
|
|
@@ -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
|
}
|