nextjs-cms 0.5.67 → 0.5.69
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 +9 -99
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +5 -4
- package/dist/api/lib/serverActions.d.ts +6 -0
- package/dist/api/lib/serverActions.d.ts.map +1 -1
- package/dist/api/lib/serverActions.js +73 -20
- package/dist/api/root.d.ts +56 -213
- package/dist/api/root.d.ts.map +1 -1
- package/dist/api/root.js +88 -8
- package/dist/api/routers/admins.d.ts.map +1 -1
- package/dist/api/routers/admins.js +53 -3
- package/dist/api/routers/categorySection.js +1 -1
- package/dist/api/routers/gallery.d.ts.map +1 -1
- package/dist/api/routers/gallery.js +1 -0
- package/dist/api/routers/hasItemsSection.js +1 -1
- package/dist/api/trpc/client.d.ts +4 -0
- package/dist/api/trpc/client.d.ts.map +1 -0
- package/dist/api/trpc/client.js +3 -0
- package/dist/api/trpc/server.d.ts.map +1 -1
- package/dist/api/trpc/server.js +41 -3
- package/dist/api/trpc.d.ts +15 -0
- package/dist/api/trpc.d.ts.map +1 -1
- package/dist/api/trpc.js +24 -0
- package/dist/core/config/config-loader.d.ts +8 -0
- package/dist/core/config/config-loader.d.ts.map +1 -1
- package/dist/core/config/config-loader.js +17 -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 -1
- package/dist/core/factories/SectionFactory.d.ts +1 -1
- package/dist/core/factories/SectionFactory.d.ts.map +1 -1
- package/dist/core/factories/SectionFactory.js +1 -1
- package/dist/core/factories/section-factory-with-esbuild.d.ts +0 -4
- package/dist/core/factories/section-factory-with-esbuild.d.ts.map +1 -1
- package/dist/core/factories/section-factory-with-esbuild.js +1 -5
- package/dist/core/factories/section-factory-with-jiti.d.ts +0 -4
- package/dist/core/factories/section-factory-with-jiti.d.ts.map +1 -1
- package/dist/core/factories/section-factory-with-jiti.js +1 -5
- package/dist/core/submit/ItemEditSubmit.d.ts.map +1 -1
- package/dist/plugins/index.d.ts +3 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +1 -0
- package/dist/plugins/loader.d.ts +71 -0
- package/dist/plugins/loader.d.ts.map +1 -0
- package/dist/plugins/loader.js +187 -0
- package/dist/plugins/server.d.ts +2 -0
- package/dist/plugins/server.d.ts.map +1 -0
- package/dist/plugins/server.js +1 -0
- package/dist/translations/index.js +2 -2
- package/package.json +19 -3
- package/dist/api/routers/googleAnalytics.d.ts +0 -29
- package/dist/api/routers/googleAnalytics.d.ts.map +0 -1
- package/dist/api/routers/googleAnalytics.js +0 -7
package/dist/api/root.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { TRPCContext } from './trpc.js';
|
|
2
|
+
import { z } from 'zod';
|
|
1
3
|
export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
2
4
|
ctx: {
|
|
3
5
|
headers: Headers;
|
|
@@ -9,7 +11,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
9
11
|
meta: object;
|
|
10
12
|
errorShape: {
|
|
11
13
|
data: {
|
|
12
|
-
zodError:
|
|
14
|
+
zodError: z.core.$ZodFlattenedError<unknown, string> | null;
|
|
13
15
|
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
14
16
|
httpStatus: number;
|
|
15
17
|
path?: string;
|
|
@@ -31,7 +33,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
31
33
|
meta: object;
|
|
32
34
|
errorShape: {
|
|
33
35
|
data: {
|
|
34
|
-
zodError:
|
|
36
|
+
zodError: z.core.$ZodFlattenedError<unknown, string> | null;
|
|
35
37
|
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
36
38
|
httpStatus: number;
|
|
37
39
|
path?: string;
|
|
@@ -83,7 +85,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
83
85
|
meta: object;
|
|
84
86
|
errorShape: {
|
|
85
87
|
data: {
|
|
86
|
-
zodError:
|
|
88
|
+
zodError: z.core.$ZodFlattenedError<unknown, string> | null;
|
|
87
89
|
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
88
90
|
httpStatus: number;
|
|
89
91
|
path?: string;
|
|
@@ -185,7 +187,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
185
187
|
meta: object;
|
|
186
188
|
errorShape: {
|
|
187
189
|
data: {
|
|
188
|
-
zodError:
|
|
190
|
+
zodError: z.core.$ZodFlattenedError<unknown, string> | null;
|
|
189
191
|
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
190
192
|
httpStatus: number;
|
|
191
193
|
path?: string;
|
|
@@ -367,7 +369,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
367
369
|
meta: object;
|
|
368
370
|
errorShape: {
|
|
369
371
|
data: {
|
|
370
|
-
zodError:
|
|
372
|
+
zodError: z.core.$ZodFlattenedError<unknown, string> | null;
|
|
371
373
|
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
372
374
|
httpStatus: number;
|
|
373
375
|
path?: string;
|
|
@@ -440,7 +442,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
440
442
|
meta: object;
|
|
441
443
|
errorShape: {
|
|
442
444
|
data: {
|
|
443
|
-
zodError:
|
|
445
|
+
zodError: z.core.$ZodFlattenedError<unknown, string> | null;
|
|
444
446
|
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
445
447
|
httpStatus: number;
|
|
446
448
|
path?: string;
|
|
@@ -540,7 +542,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
540
542
|
meta: object;
|
|
541
543
|
errorShape: {
|
|
542
544
|
data: {
|
|
543
|
-
zodError:
|
|
545
|
+
zodError: z.core.$ZodFlattenedError<unknown, string> | null;
|
|
544
546
|
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
545
547
|
httpStatus: number;
|
|
546
548
|
path?: string;
|
|
@@ -584,7 +586,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
584
586
|
meta: object;
|
|
585
587
|
errorShape: {
|
|
586
588
|
data: {
|
|
587
|
-
zodError:
|
|
589
|
+
zodError: z.core.$ZodFlattenedError<unknown, string> | null;
|
|
588
590
|
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
589
591
|
httpStatus: number;
|
|
590
592
|
path?: string;
|
|
@@ -616,7 +618,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
616
618
|
meta: object;
|
|
617
619
|
errorShape: {
|
|
618
620
|
data: {
|
|
619
|
-
zodError:
|
|
621
|
+
zodError: z.core.$ZodFlattenedError<unknown, string> | null;
|
|
620
622
|
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
621
623
|
httpStatus: number;
|
|
622
624
|
path?: string;
|
|
@@ -665,7 +667,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
665
667
|
meta: object;
|
|
666
668
|
errorShape: {
|
|
667
669
|
data: {
|
|
668
|
-
zodError:
|
|
670
|
+
zodError: z.core.$ZodFlattenedError<unknown, string> | null;
|
|
669
671
|
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
670
672
|
httpStatus: number;
|
|
671
673
|
path?: string;
|
|
@@ -718,7 +720,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
718
720
|
meta: object;
|
|
719
721
|
errorShape: {
|
|
720
722
|
data: {
|
|
721
|
-
zodError:
|
|
723
|
+
zodError: z.core.$ZodFlattenedError<unknown, string> | null;
|
|
722
724
|
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
723
725
|
httpStatus: number;
|
|
724
726
|
path?: string;
|
|
@@ -748,7 +750,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
748
750
|
meta: object;
|
|
749
751
|
}>;
|
|
750
752
|
}>>;
|
|
751
|
-
|
|
753
|
+
plugins: import("@trpc/server").TRPCBuiltRouter<{
|
|
752
754
|
ctx: {
|
|
753
755
|
headers: Headers;
|
|
754
756
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
@@ -759,7 +761,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
759
761
|
meta: object;
|
|
760
762
|
errorShape: {
|
|
761
763
|
data: {
|
|
762
|
-
zodError:
|
|
764
|
+
zodError: z.core.$ZodFlattenedError<unknown, string> | null;
|
|
763
765
|
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
764
766
|
httpStatus: number;
|
|
765
767
|
path?: string;
|
|
@@ -770,106 +772,38 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
770
772
|
};
|
|
771
773
|
transformer: true;
|
|
772
774
|
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
773
|
-
|
|
774
|
-
input: void;
|
|
775
|
-
output: {
|
|
776
|
-
dbsLimit: number;
|
|
777
|
-
dbsCount: number;
|
|
778
|
-
bandwidthUsage: number;
|
|
779
|
-
bandwidthLimit: number;
|
|
780
|
-
diskSpaceUsage: number;
|
|
781
|
-
diskSpaceLimit: number;
|
|
782
|
-
emailsUsage: number;
|
|
783
|
-
emailsLimit: number;
|
|
784
|
-
dbInfo: any;
|
|
785
|
-
dbsList: any;
|
|
786
|
-
phpVersion: any;
|
|
787
|
-
passengerAppList: never[];
|
|
788
|
-
documentRoot: any;
|
|
789
|
-
};
|
|
790
|
-
meta: object;
|
|
791
|
-
}>;
|
|
792
|
-
getEmails: import("@trpc/server").TRPCQueryProcedure<{
|
|
793
|
-
input: void;
|
|
794
|
-
output: {
|
|
795
|
-
emails: any;
|
|
796
|
-
};
|
|
797
|
-
meta: object;
|
|
798
|
-
}>;
|
|
799
|
-
createEmail: import("@trpc/server").TRPCMutationProcedure<{
|
|
800
|
-
input: {
|
|
801
|
-
email: string;
|
|
802
|
-
password: string;
|
|
803
|
-
quota: string;
|
|
804
|
-
};
|
|
805
|
-
output: any;
|
|
806
|
-
meta: object;
|
|
807
|
-
}>;
|
|
808
|
-
quotaChange: import("@trpc/server").TRPCMutationProcedure<{
|
|
809
|
-
input: {
|
|
810
|
-
email: string;
|
|
811
|
-
quota: string;
|
|
812
|
-
};
|
|
813
|
-
output: any;
|
|
814
|
-
meta: object;
|
|
815
|
-
}>;
|
|
816
|
-
passwordChange: import("@trpc/server").TRPCMutationProcedure<{
|
|
775
|
+
checkRoute: import("@trpc/server").TRPCQueryProcedure<{
|
|
817
776
|
input: {
|
|
818
|
-
|
|
819
|
-
password: string;
|
|
820
|
-
passwordConfirm: string;
|
|
777
|
+
path: string;
|
|
821
778
|
};
|
|
822
|
-
output:
|
|
823
|
-
meta: object;
|
|
824
|
-
}>;
|
|
825
|
-
deleteEmail: import("@trpc/server").TRPCMutationProcedure<{
|
|
826
|
-
input: string;
|
|
827
|
-
output: any;
|
|
779
|
+
output: import("../plugins/loader.js").LoadedPluginRoute | null;
|
|
828
780
|
meta: object;
|
|
829
781
|
}>;
|
|
830
782
|
}>>;
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
session: import("../index.js").Session | null;
|
|
838
|
-
};
|
|
839
|
-
meta: object;
|
|
840
|
-
errorShape: {
|
|
841
|
-
data: {
|
|
842
|
-
zodError: import("zod").ZodFlattenedError<unknown, string> | null;
|
|
843
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
844
|
-
httpStatus: number;
|
|
845
|
-
path?: string;
|
|
846
|
-
stack?: string;
|
|
847
|
-
};
|
|
848
|
-
message: string;
|
|
849
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
783
|
+
}>>;
|
|
784
|
+
export declare function getAppRouter(): Promise<import("@trpc/server").TRPCBuiltRouter<{
|
|
785
|
+
ctx: {
|
|
786
|
+
headers: Headers;
|
|
787
|
+
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
788
|
+
$client: import("mysql2/promise").Pool;
|
|
850
789
|
};
|
|
851
|
-
|
|
852
|
-
}
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
output: {
|
|
862
|
-
headers: Headers;
|
|
863
|
-
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
864
|
-
$client: import("mysql2/promise").Pool;
|
|
865
|
-
};
|
|
866
|
-
session: {
|
|
867
|
-
user: import("../index.js").User;
|
|
868
|
-
};
|
|
790
|
+
session: import("../index.js").Session | null;
|
|
791
|
+
};
|
|
792
|
+
meta: object;
|
|
793
|
+
errorShape: {
|
|
794
|
+
data: {
|
|
795
|
+
zodError: z.core.$ZodFlattenedError<unknown, string> | null;
|
|
796
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
797
|
+
httpStatus: number;
|
|
798
|
+
path?: string;
|
|
799
|
+
stack?: string;
|
|
869
800
|
};
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
}
|
|
801
|
+
message: string;
|
|
802
|
+
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
803
|
+
};
|
|
804
|
+
transformer: true;
|
|
805
|
+
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<import("@trpc/server").TRPCCreateRouterOptions>>>;
|
|
806
|
+
export declare function createCallerWithPlugins(ctx: TRPCContext): Promise<import("@trpc/server/unstable-core-do-not-import").DecorateRouterRecord<import("@trpc/server").TRPCDecorateCreateRouterOptions<import("@trpc/server").TRPCCreateRouterOptions>>>;
|
|
873
807
|
export type AppRouter = typeof appRouter;
|
|
874
808
|
export declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
875
809
|
ctx: {
|
|
@@ -882,7 +816,7 @@ export declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
882
816
|
meta: object;
|
|
883
817
|
errorShape: {
|
|
884
818
|
data: {
|
|
885
|
-
zodError:
|
|
819
|
+
zodError: z.core.$ZodFlattenedError<unknown, string> | null;
|
|
886
820
|
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
887
821
|
httpStatus: number;
|
|
888
822
|
path?: string;
|
|
@@ -904,7 +838,7 @@ export declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
904
838
|
meta: object;
|
|
905
839
|
errorShape: {
|
|
906
840
|
data: {
|
|
907
|
-
zodError:
|
|
841
|
+
zodError: z.core.$ZodFlattenedError<unknown, string> | null;
|
|
908
842
|
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
909
843
|
httpStatus: number;
|
|
910
844
|
path?: string;
|
|
@@ -956,7 +890,7 @@ export declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
956
890
|
meta: object;
|
|
957
891
|
errorShape: {
|
|
958
892
|
data: {
|
|
959
|
-
zodError:
|
|
893
|
+
zodError: z.core.$ZodFlattenedError<unknown, string> | null;
|
|
960
894
|
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
961
895
|
httpStatus: number;
|
|
962
896
|
path?: string;
|
|
@@ -1058,7 +992,7 @@ export declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
1058
992
|
meta: object;
|
|
1059
993
|
errorShape: {
|
|
1060
994
|
data: {
|
|
1061
|
-
zodError:
|
|
995
|
+
zodError: z.core.$ZodFlattenedError<unknown, string> | null;
|
|
1062
996
|
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
1063
997
|
httpStatus: number;
|
|
1064
998
|
path?: string;
|
|
@@ -1240,7 +1174,7 @@ export declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
1240
1174
|
meta: object;
|
|
1241
1175
|
errorShape: {
|
|
1242
1176
|
data: {
|
|
1243
|
-
zodError:
|
|
1177
|
+
zodError: z.core.$ZodFlattenedError<unknown, string> | null;
|
|
1244
1178
|
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
1245
1179
|
httpStatus: number;
|
|
1246
1180
|
path?: string;
|
|
@@ -1313,7 +1247,7 @@ export declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
1313
1247
|
meta: object;
|
|
1314
1248
|
errorShape: {
|
|
1315
1249
|
data: {
|
|
1316
|
-
zodError:
|
|
1250
|
+
zodError: z.core.$ZodFlattenedError<unknown, string> | null;
|
|
1317
1251
|
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
1318
1252
|
httpStatus: number;
|
|
1319
1253
|
path?: string;
|
|
@@ -1413,7 +1347,7 @@ export declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
1413
1347
|
meta: object;
|
|
1414
1348
|
errorShape: {
|
|
1415
1349
|
data: {
|
|
1416
|
-
zodError:
|
|
1350
|
+
zodError: z.core.$ZodFlattenedError<unknown, string> | null;
|
|
1417
1351
|
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
1418
1352
|
httpStatus: number;
|
|
1419
1353
|
path?: string;
|
|
@@ -1457,7 +1391,7 @@ export declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
1457
1391
|
meta: object;
|
|
1458
1392
|
errorShape: {
|
|
1459
1393
|
data: {
|
|
1460
|
-
zodError:
|
|
1394
|
+
zodError: z.core.$ZodFlattenedError<unknown, string> | null;
|
|
1461
1395
|
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
1462
1396
|
httpStatus: number;
|
|
1463
1397
|
path?: string;
|
|
@@ -1489,7 +1423,7 @@ export declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
1489
1423
|
meta: object;
|
|
1490
1424
|
errorShape: {
|
|
1491
1425
|
data: {
|
|
1492
|
-
zodError:
|
|
1426
|
+
zodError: z.core.$ZodFlattenedError<unknown, string> | null;
|
|
1493
1427
|
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
1494
1428
|
httpStatus: number;
|
|
1495
1429
|
path?: string;
|
|
@@ -1538,7 +1472,7 @@ export declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
1538
1472
|
meta: object;
|
|
1539
1473
|
errorShape: {
|
|
1540
1474
|
data: {
|
|
1541
|
-
zodError:
|
|
1475
|
+
zodError: z.core.$ZodFlattenedError<unknown, string> | null;
|
|
1542
1476
|
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
1543
1477
|
httpStatus: number;
|
|
1544
1478
|
path?: string;
|
|
@@ -1591,7 +1525,7 @@ export declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
1591
1525
|
meta: object;
|
|
1592
1526
|
errorShape: {
|
|
1593
1527
|
data: {
|
|
1594
|
-
zodError:
|
|
1528
|
+
zodError: z.core.$ZodFlattenedError<unknown, string> | null;
|
|
1595
1529
|
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
1596
1530
|
httpStatus: number;
|
|
1597
1531
|
path?: string;
|
|
@@ -1621,7 +1555,7 @@ export declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
1621
1555
|
meta: object;
|
|
1622
1556
|
}>;
|
|
1623
1557
|
}>>;
|
|
1624
|
-
|
|
1558
|
+
plugins: import("@trpc/server").TRPCBuiltRouter<{
|
|
1625
1559
|
ctx: {
|
|
1626
1560
|
headers: Headers;
|
|
1627
1561
|
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
@@ -1632,7 +1566,7 @@ export declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
1632
1566
|
meta: object;
|
|
1633
1567
|
errorShape: {
|
|
1634
1568
|
data: {
|
|
1635
|
-
zodError:
|
|
1569
|
+
zodError: z.core.$ZodFlattenedError<unknown, string> | null;
|
|
1636
1570
|
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
1637
1571
|
httpStatus: number;
|
|
1638
1572
|
path?: string;
|
|
@@ -1643,104 +1577,13 @@ export declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
|
|
|
1643
1577
|
};
|
|
1644
1578
|
transformer: true;
|
|
1645
1579
|
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
1646
|
-
|
|
1647
|
-
input: void;
|
|
1648
|
-
output: {
|
|
1649
|
-
dbsLimit: number;
|
|
1650
|
-
dbsCount: number;
|
|
1651
|
-
bandwidthUsage: number;
|
|
1652
|
-
bandwidthLimit: number;
|
|
1653
|
-
diskSpaceUsage: number;
|
|
1654
|
-
diskSpaceLimit: number;
|
|
1655
|
-
emailsUsage: number;
|
|
1656
|
-
emailsLimit: number;
|
|
1657
|
-
dbInfo: any;
|
|
1658
|
-
dbsList: any;
|
|
1659
|
-
phpVersion: any;
|
|
1660
|
-
passengerAppList: never[];
|
|
1661
|
-
documentRoot: any;
|
|
1662
|
-
};
|
|
1663
|
-
meta: object;
|
|
1664
|
-
}>;
|
|
1665
|
-
getEmails: import("@trpc/server").TRPCQueryProcedure<{
|
|
1666
|
-
input: void;
|
|
1667
|
-
output: {
|
|
1668
|
-
emails: any;
|
|
1669
|
-
};
|
|
1670
|
-
meta: object;
|
|
1671
|
-
}>;
|
|
1672
|
-
createEmail: import("@trpc/server").TRPCMutationProcedure<{
|
|
1673
|
-
input: {
|
|
1674
|
-
email: string;
|
|
1675
|
-
password: string;
|
|
1676
|
-
quota: string;
|
|
1677
|
-
};
|
|
1678
|
-
output: any;
|
|
1679
|
-
meta: object;
|
|
1680
|
-
}>;
|
|
1681
|
-
quotaChange: import("@trpc/server").TRPCMutationProcedure<{
|
|
1682
|
-
input: {
|
|
1683
|
-
email: string;
|
|
1684
|
-
quota: string;
|
|
1685
|
-
};
|
|
1686
|
-
output: any;
|
|
1687
|
-
meta: object;
|
|
1688
|
-
}>;
|
|
1689
|
-
passwordChange: import("@trpc/server").TRPCMutationProcedure<{
|
|
1580
|
+
checkRoute: import("@trpc/server").TRPCQueryProcedure<{
|
|
1690
1581
|
input: {
|
|
1691
|
-
|
|
1692
|
-
password: string;
|
|
1693
|
-
passwordConfirm: string;
|
|
1582
|
+
path: string;
|
|
1694
1583
|
};
|
|
1695
|
-
output:
|
|
1696
|
-
meta: object;
|
|
1697
|
-
}>;
|
|
1698
|
-
deleteEmail: import("@trpc/server").TRPCMutationProcedure<{
|
|
1699
|
-
input: string;
|
|
1700
|
-
output: any;
|
|
1584
|
+
output: import("../plugins/loader.js").LoadedPluginRoute | null;
|
|
1701
1585
|
meta: object;
|
|
1702
1586
|
}>;
|
|
1703
1587
|
}>>;
|
|
1704
|
-
googleAnalytics: import("@trpc/server").TRPCBuiltRouter<{
|
|
1705
|
-
ctx: {
|
|
1706
|
-
headers: Headers;
|
|
1707
|
-
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
1708
|
-
$client: import("mysql2/promise").Pool;
|
|
1709
|
-
};
|
|
1710
|
-
session: import("../index.js").Session | null;
|
|
1711
|
-
};
|
|
1712
|
-
meta: object;
|
|
1713
|
-
errorShape: {
|
|
1714
|
-
data: {
|
|
1715
|
-
zodError: import("zod").ZodFlattenedError<unknown, string> | null;
|
|
1716
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
|
|
1717
|
-
httpStatus: number;
|
|
1718
|
-
path?: string;
|
|
1719
|
-
stack?: string;
|
|
1720
|
-
};
|
|
1721
|
-
message: string;
|
|
1722
|
-
code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
|
|
1723
|
-
};
|
|
1724
|
-
transformer: true;
|
|
1725
|
-
}, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
|
|
1726
|
-
test: import("@trpc/server").TRPCQueryProcedure<{
|
|
1727
|
-
input: void;
|
|
1728
|
-
output: boolean;
|
|
1729
|
-
meta: object;
|
|
1730
|
-
}>;
|
|
1731
|
-
}>>;
|
|
1732
|
-
getHello1: import("@trpc/server").TRPCQueryProcedure<{
|
|
1733
|
-
input: void;
|
|
1734
|
-
output: {
|
|
1735
|
-
headers: Headers;
|
|
1736
|
-
db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
|
|
1737
|
-
$client: import("mysql2/promise").Pool;
|
|
1738
|
-
};
|
|
1739
|
-
session: {
|
|
1740
|
-
user: import("../index.js").User;
|
|
1741
|
-
};
|
|
1742
|
-
};
|
|
1743
|
-
meta: object;
|
|
1744
|
-
}>;
|
|
1745
1588
|
}>>;
|
|
1746
1589
|
//# sourceMappingURL=root.d.ts.map
|
package/dist/api/root.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../../src/api/root.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../../src/api/root.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAc5C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AA4FvB,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAsB,CAAA;AAU5C,wBAAsB,YAAY;;;;;;;;;;;;;;;;;;;;;4GAEjC;AAED,wBAAsB,uBAAuB,CAAC,GAAG,EAAE,WAAW,4LAG7D;AAGD,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAA;AAGxC,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAiC,CAAA"}
|
package/dist/api/root.js
CHANGED
|
@@ -9,9 +9,36 @@ import { categorySectionRouter } from './routers/categorySection.js';
|
|
|
9
9
|
import { accountSettings } from './routers/accountSettings.js';
|
|
10
10
|
import { cmsSettings } from './routers/cmsSettings.js';
|
|
11
11
|
import { galleryRouter } from './routers/gallery.js';
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
12
|
+
import { getConfigImportVersion } from '../core/config/index.js';
|
|
13
|
+
import { getPluginRoutes, loadPlugins } from '../plugins/loader.js';
|
|
14
|
+
import { z } from 'zod';
|
|
15
|
+
import { getAdminPrivileges } from './lib/serverActions.js';
|
|
16
|
+
async function getPluginRouters() {
|
|
17
|
+
const loadedPlugins = await loadPlugins();
|
|
18
|
+
return loadedPlugins.reduce((acc, current) => {
|
|
19
|
+
if (current.plugin.router) {
|
|
20
|
+
acc[current.routerKey] = current.plugin.router;
|
|
21
|
+
}
|
|
22
|
+
return acc;
|
|
23
|
+
}, {});
|
|
24
|
+
}
|
|
25
|
+
const pluginsRouter = router({
|
|
26
|
+
checkRoute: privateProcedure
|
|
27
|
+
.input(z.object({
|
|
28
|
+
path: z.string(),
|
|
29
|
+
}))
|
|
30
|
+
.query(async ({ ctx, input }) => {
|
|
31
|
+
const routes = await getPluginRoutes();
|
|
32
|
+
const privilegeSet = await getAdminPrivileges(ctx.session.user.id);
|
|
33
|
+
const filteredRoutes = routes.filter(({ pluginName }) => privilegeSet.has(pluginName));
|
|
34
|
+
const plugin = filteredRoutes.find(({ path }) => path === input.path);
|
|
35
|
+
if (!plugin) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
return plugin;
|
|
39
|
+
}),
|
|
40
|
+
});
|
|
41
|
+
const coreRouters = {
|
|
15
42
|
auth: authRouter,
|
|
16
43
|
admins: adminsRouter,
|
|
17
44
|
hasItemsSections: hasItemsSectionRouter,
|
|
@@ -22,10 +49,63 @@ export const appRouter = router({
|
|
|
22
49
|
navigation: navRouter,
|
|
23
50
|
accountSettings: accountSettings,
|
|
24
51
|
cmsSettings: cmsSettings,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
52
|
+
plugins: pluginsRouter,
|
|
53
|
+
};
|
|
54
|
+
// Lazy router creation - cache the result
|
|
55
|
+
let _appRouter = null;
|
|
56
|
+
let routerInitPromise = null;
|
|
57
|
+
let appRouterConfigVersion = -1;
|
|
58
|
+
async function createAppRouterWithPlugins() {
|
|
59
|
+
const currentVersion = getConfigImportVersion();
|
|
60
|
+
if (appRouterConfigVersion !== currentVersion) {
|
|
61
|
+
_appRouter = null;
|
|
62
|
+
routerInitPromise = null;
|
|
63
|
+
}
|
|
64
|
+
if (_appRouter) {
|
|
65
|
+
return _appRouter;
|
|
66
|
+
}
|
|
67
|
+
if (routerInitPromise) {
|
|
68
|
+
return routerInitPromise;
|
|
69
|
+
}
|
|
70
|
+
routerInitPromise = (async () => {
|
|
71
|
+
const pluginRouters = await getPluginRouters();
|
|
72
|
+
const safePluginRouters = Object.entries(pluginRouters).reduce((acc, [key, pluginRouter]) => {
|
|
73
|
+
if (key in coreRouters) {
|
|
74
|
+
console.error(`[plugins] Router key "${key}" conflicts with a core router. Skipping.`);
|
|
75
|
+
return acc;
|
|
76
|
+
}
|
|
77
|
+
acc[key] = pluginRouter;
|
|
78
|
+
return acc;
|
|
79
|
+
}, {});
|
|
80
|
+
const routerInstance = router({
|
|
81
|
+
...coreRouters,
|
|
82
|
+
...safePluginRouters,
|
|
83
|
+
});
|
|
84
|
+
_appRouter = routerInstance;
|
|
85
|
+
appRouterConfigVersion = currentVersion;
|
|
86
|
+
return routerInstance;
|
|
87
|
+
})();
|
|
88
|
+
return routerInitPromise;
|
|
89
|
+
}
|
|
90
|
+
// Create router synchronously with core routes only
|
|
91
|
+
// This allows the module to load without top-level await
|
|
92
|
+
// NOTE: Plugin routes will not be available until plugins are loaded
|
|
93
|
+
// For now, we export the core router. Plugin routes should be added
|
|
94
|
+
// via the plugins router's list/routes procedures
|
|
95
|
+
export const appRouter = router(coreRouters);
|
|
96
|
+
// Start loading plugins in the background (non-blocking)
|
|
97
|
+
// Plugin routes can be accessed through the plugins.list/routes procedures
|
|
98
|
+
createAppRouterWithPlugins().catch((error) => {
|
|
99
|
+
console.error('Failed to load plugins for router:', error);
|
|
30
100
|
});
|
|
101
|
+
// Export a function to get the full router with plugins
|
|
102
|
+
// This should be used in server contexts where async is allowed
|
|
103
|
+
export async function getAppRouter() {
|
|
104
|
+
return createAppRouterWithPlugins();
|
|
105
|
+
}
|
|
106
|
+
export async function createCallerWithPlugins(ctx) {
|
|
107
|
+
const routerWithPlugins = await getAppRouter();
|
|
108
|
+
return routerWithPlugins.createCaller(ctx);
|
|
109
|
+
}
|
|
110
|
+
// createCaller factory
|
|
31
111
|
export const createCaller = createCallerFactory(appRouter);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admins.d.ts","sourceRoot":"","sources":["../../../src/api/routers/admins.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAaxB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"admins.d.ts","sourceRoot":"","sources":["../../../src/api/routers/admins.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAaxB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiSvB,CAAA"}
|