nextjs-cms 0.5.69 → 0.5.71

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.
@@ -108,6 +108,12 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
108
108
  list: import("@trpc/server").TRPCQueryProcedure<{
109
109
  input: void;
110
110
  output: {
111
+ error: {
112
+ message: string;
113
+ };
114
+ admins?: undefined;
115
+ privileges?: undefined;
116
+ } | {
111
117
  admins: {
112
118
  id: string;
113
119
  username: string;
@@ -124,6 +130,7 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
124
130
  sectionType: string;
125
131
  sectionName: string;
126
132
  }[];
133
+ error?: undefined;
127
134
  };
128
135
  meta: object;
129
136
  }>;
@@ -299,13 +306,6 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
299
306
  sectionItemId: string | number;
300
307
  };
301
308
  output: {
302
- error: {
303
- message: string;
304
- };
305
- section?: undefined;
306
- inputGroups?: undefined;
307
- gallery?: undefined;
308
- } | {
309
309
  section: {
310
310
  name: string;
311
311
  title: {
@@ -351,6 +351,13 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
351
351
  meta: any;
352
352
  }[];
353
353
  error?: undefined;
354
+ } | {
355
+ error: {
356
+ message: any;
357
+ };
358
+ section?: undefined;
359
+ inputGroups?: undefined;
360
+ gallery?: undefined;
354
361
  };
355
362
  meta: object;
356
363
  }>;
@@ -467,6 +474,12 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
467
474
  sectionName: string;
468
475
  };
469
476
  output: {
477
+ error: {
478
+ message: string;
479
+ };
480
+ section?: undefined;
481
+ data?: undefined;
482
+ } | {
470
483
  section: {
471
484
  tableName: string;
472
485
  sectionName: string;
@@ -494,6 +507,7 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
494
507
  sectionName: string;
495
508
  allowRecursiveDelete: boolean | undefined;
496
509
  };
510
+ error?: undefined;
497
511
  };
498
512
  meta: object;
499
513
  }>;
@@ -718,47 +732,6 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
718
732
  meta: object;
719
733
  }>;
720
734
  }>>;
721
- cmsSettings: import("@trpc/server").TRPCBuiltRouter<{
722
- ctx: {
723
- headers: Headers;
724
- db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
725
- $client: import("mysql2/promise").Pool;
726
- };
727
- session: import("../index.js").Session | null;
728
- };
729
- meta: object;
730
- errorShape: {
731
- data: {
732
- zodError: import("zod").ZodFlattenedError<unknown, string> | null;
733
- code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
734
- httpStatus: number;
735
- path?: string;
736
- stack?: string;
737
- };
738
- message: string;
739
- code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
740
- };
741
- transformer: true;
742
- }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
743
- get: import("@trpc/server").TRPCQueryProcedure<{
744
- input: void;
745
- output: {
746
- googleTagId: string;
747
- googlePropertyId: string;
748
- googleServiceAccountCredentials: string;
749
- };
750
- meta: object;
751
- }>;
752
- save: import("@trpc/server").TRPCMutationProcedure<{
753
- input: {
754
- googleTagId: string;
755
- googlePropertyId: string;
756
- googleServiceAccountCredentials: string;
757
- };
758
- output: boolean;
759
- meta: object;
760
- }>;
761
- }>>;
762
735
  plugins: import("@trpc/server").TRPCBuiltRouter<{
763
736
  ctx: {
764
737
  headers: Headers;
@@ -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,uBAAuB,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAC5E,OAAO,EAEH,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EAC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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,uBAAuB,EAAE,YAAY,EAAE,CAAA;AAC5F,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,gBAAgB,EAAE,eAAe,EAAE,CAAA;AACrE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,CAAA;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA"}
@@ -94,13 +94,6 @@ export declare const deleteSectionItem: (session: Session, sectionName: string,
94
94
  };
95
95
  }>;
96
96
  export declare const createEditPage: (session: Session, sectionName: string, sectionItemId: string | number) => Promise<{
97
- error: {
98
- message: string;
99
- };
100
- section?: undefined;
101
- inputGroups?: undefined;
102
- gallery?: undefined;
103
- } | {
104
97
  section: {
105
98
  name: string;
106
99
  title: {
@@ -146,6 +139,13 @@ export declare const createEditPage: (session: Session, sectionName: string, sec
146
139
  meta: any;
147
140
  }[];
148
141
  error?: undefined;
142
+ } | {
143
+ error: {
144
+ message: any;
145
+ };
146
+ section?: undefined;
147
+ inputGroups?: undefined;
148
+ gallery?: undefined;
149
149
  }>;
150
150
  export declare const createNewPage: (session: Session, sectionName: string) => Promise<{
151
151
  error: {
@@ -222,6 +222,12 @@ export declare const getCategorySectionChildren: ({ session, id, sectionName, le
222
222
  error?: undefined;
223
223
  }>;
224
224
  export declare const getCategorySection: (session: Session, sectionName: string) => Promise<{
225
+ error: {
226
+ message: string;
227
+ };
228
+ section?: undefined;
229
+ data?: undefined;
230
+ } | {
225
231
  section: {
226
232
  tableName: string;
227
233
  sectionName: string;
@@ -249,6 +255,7 @@ export declare const getCategorySection: (session: Session, sectionName: string)
249
255
  sectionName: string;
250
256
  allowRecursiveDelete: boolean | undefined;
251
257
  };
258
+ error?: undefined;
252
259
  }>;
253
260
  export declare const getBrowsePage: (session: Session, sectionName: string, page?: number, q?: string) => Promise<{
254
261
  error: {
@@ -1 +1 @@
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;AASlD,eAAO,MAAM,eAAe,GAAU,gCAInC;IACC,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,CAAA;IACtB,MAAM,EAAE,MAAM,CAAA;CACjB,qBAmBA,CAAA;AACD,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;A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MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAkDjF,MAAM;eACZ,MAAM;cACP,GAAG;;;;;;;;;;EAgDpB,CAAA;AAED,eAAO,MAAM,aAAa,GAAU,SAAS,OAAO,EAAE,aAAa,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsExE,CAAA;AAED,eAAO,MAAM,0BAA0B,GAAU,sCAK9C;IACC,OAAO,EAAE,OAAO,CAAA;IAChB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;CAChB;;;;;;;;;;;;;;;;;;;;EA2DA,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAU,SAAS,OAAO,EAAE,aAAa,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAgD/C,MAAM,GAAG,MAAM,GAAG,SAAS;;;;;;;EAgBzD,CAAA;AAED,eAAO,MAAM,aAAa,GAAU,SAAS,OAAO,EAAE,aAAa,MAAM,EAAE,OAAM,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;;;;;;;;;;;;;;;;;;;;;EA+DhD,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"}
@@ -575,10 +575,11 @@ export const createEditPage = async (session, sectionName, sectionItemId) => {
575
575
  catch (error) {
576
576
  const errorMessage = error?.errorMessage || (error instanceof Error ? error.message : 'Unknown error occurred');
577
577
  console.error('Error creating edit page', error);
578
- throw new TRPCError({
579
- code: 'BAD_REQUEST',
580
- message: errorMessage,
581
- });
578
+ return {
579
+ error: {
580
+ message: errorMessage,
581
+ },
582
+ };
582
583
  }
583
584
  };
584
585
  export const createNewPage = async (session, sectionName) => {
@@ -645,7 +646,7 @@ export const createNewPage = async (session, sectionName) => {
645
646
  console.error('Error creating new page', err);
646
647
  return {
647
648
  error: {
648
- message: `Failed to create new page: ${errorMessage}`,
649
+ message: errorMessage,
649
650
  },
650
651
  };
651
652
  }
@@ -712,10 +713,11 @@ export const getCategorySection = async (session, sectionName) => {
712
713
  },
713
714
  }));
714
715
  if (!section) {
715
- throw new TRPCError({
716
- code: 'NOT_FOUND',
717
- message: 'Section not found or you do not have access to this operation',
718
- });
716
+ return {
717
+ error: {
718
+ message: 'Section not found or you do not have access to this operation',
719
+ },
720
+ };
719
721
  }
720
722
  const tableName = section.db.table;
721
723
  /**
@@ -99,6 +99,12 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
99
99
  list: import("@trpc/server").TRPCQueryProcedure<{
100
100
  input: void;
101
101
  output: {
102
+ error: {
103
+ message: string;
104
+ };
105
+ admins?: undefined;
106
+ privileges?: undefined;
107
+ } | {
102
108
  admins: {
103
109
  id: string;
104
110
  username: string;
@@ -115,6 +121,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
115
121
  sectionType: string;
116
122
  sectionName: string;
117
123
  }[];
124
+ error?: undefined;
118
125
  };
119
126
  meta: object;
120
127
  }>;
@@ -290,13 +297,6 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
290
297
  sectionItemId: string | number;
291
298
  };
292
299
  output: {
293
- error: {
294
- message: string;
295
- };
296
- section?: undefined;
297
- inputGroups?: undefined;
298
- gallery?: undefined;
299
- } | {
300
300
  section: {
301
301
  name: string;
302
302
  title: {
@@ -342,6 +342,13 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
342
342
  meta: any;
343
343
  }[];
344
344
  error?: undefined;
345
+ } | {
346
+ error: {
347
+ message: any;
348
+ };
349
+ section?: undefined;
350
+ inputGroups?: undefined;
351
+ gallery?: undefined;
345
352
  };
346
353
  meta: object;
347
354
  }>;
@@ -458,6 +465,12 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
458
465
  sectionName: string;
459
466
  };
460
467
  output: {
468
+ error: {
469
+ message: string;
470
+ };
471
+ section?: undefined;
472
+ data?: undefined;
473
+ } | {
461
474
  section: {
462
475
  tableName: string;
463
476
  sectionName: string;
@@ -485,6 +498,7 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
485
498
  sectionName: string;
486
499
  allowRecursiveDelete: boolean | undefined;
487
500
  };
501
+ error?: undefined;
488
502
  };
489
503
  meta: object;
490
504
  }>;
@@ -709,47 +723,6 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
709
723
  meta: object;
710
724
  }>;
711
725
  }>>;
712
- cmsSettings: import("@trpc/server").TRPCBuiltRouter<{
713
- ctx: {
714
- headers: Headers;
715
- db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
716
- $client: import("mysql2/promise").Pool;
717
- };
718
- session: import("../index.js").Session | null;
719
- };
720
- meta: object;
721
- errorShape: {
722
- data: {
723
- zodError: z.core.$ZodFlattenedError<unknown, string> | null;
724
- code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
725
- httpStatus: number;
726
- path?: string;
727
- stack?: string;
728
- };
729
- message: string;
730
- code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
731
- };
732
- transformer: true;
733
- }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
734
- get: import("@trpc/server").TRPCQueryProcedure<{
735
- input: void;
736
- output: {
737
- googleTagId: string;
738
- googlePropertyId: string;
739
- googleServiceAccountCredentials: string;
740
- };
741
- meta: object;
742
- }>;
743
- save: import("@trpc/server").TRPCMutationProcedure<{
744
- input: {
745
- googleTagId: string;
746
- googlePropertyId: string;
747
- googleServiceAccountCredentials: string;
748
- };
749
- output: boolean;
750
- meta: object;
751
- }>;
752
- }>>;
753
726
  plugins: import("@trpc/server").TRPCBuiltRouter<{
754
727
  ctx: {
755
728
  headers: Headers;
@@ -904,6 +877,12 @@ export declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
904
877
  list: import("@trpc/server").TRPCQueryProcedure<{
905
878
  input: void;
906
879
  output: {
880
+ error: {
881
+ message: string;
882
+ };
883
+ admins?: undefined;
884
+ privileges?: undefined;
885
+ } | {
907
886
  admins: {
908
887
  id: string;
909
888
  username: string;
@@ -920,6 +899,7 @@ export declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
920
899
  sectionType: string;
921
900
  sectionName: string;
922
901
  }[];
902
+ error?: undefined;
923
903
  };
924
904
  meta: object;
925
905
  }>;
@@ -1095,13 +1075,6 @@ export declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
1095
1075
  sectionItemId: string | number;
1096
1076
  };
1097
1077
  output: {
1098
- error: {
1099
- message: string;
1100
- };
1101
- section?: undefined;
1102
- inputGroups?: undefined;
1103
- gallery?: undefined;
1104
- } | {
1105
1078
  section: {
1106
1079
  name: string;
1107
1080
  title: {
@@ -1147,6 +1120,13 @@ export declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
1147
1120
  meta: any;
1148
1121
  }[];
1149
1122
  error?: undefined;
1123
+ } | {
1124
+ error: {
1125
+ message: any;
1126
+ };
1127
+ section?: undefined;
1128
+ inputGroups?: undefined;
1129
+ gallery?: undefined;
1150
1130
  };
1151
1131
  meta: object;
1152
1132
  }>;
@@ -1263,6 +1243,12 @@ export declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
1263
1243
  sectionName: string;
1264
1244
  };
1265
1245
  output: {
1246
+ error: {
1247
+ message: string;
1248
+ };
1249
+ section?: undefined;
1250
+ data?: undefined;
1251
+ } | {
1266
1252
  section: {
1267
1253
  tableName: string;
1268
1254
  sectionName: string;
@@ -1290,6 +1276,7 @@ export declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
1290
1276
  sectionName: string;
1291
1277
  allowRecursiveDelete: boolean | undefined;
1292
1278
  };
1279
+ error?: undefined;
1293
1280
  };
1294
1281
  meta: object;
1295
1282
  }>;
@@ -1514,47 +1501,6 @@ export declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
1514
1501
  meta: object;
1515
1502
  }>;
1516
1503
  }>>;
1517
- cmsSettings: import("@trpc/server").TRPCBuiltRouter<{
1518
- ctx: {
1519
- headers: Headers;
1520
- db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../db/schema.js")> & {
1521
- $client: import("mysql2/promise").Pool;
1522
- };
1523
- session: import("../index.js").Session | null;
1524
- };
1525
- meta: object;
1526
- errorShape: {
1527
- data: {
1528
- zodError: z.core.$ZodFlattenedError<unknown, string> | null;
1529
- code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
1530
- httpStatus: number;
1531
- path?: string;
1532
- stack?: string;
1533
- };
1534
- message: string;
1535
- code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
1536
- };
1537
- transformer: true;
1538
- }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
1539
- get: import("@trpc/server").TRPCQueryProcedure<{
1540
- input: void;
1541
- output: {
1542
- googleTagId: string;
1543
- googlePropertyId: string;
1544
- googleServiceAccountCredentials: string;
1545
- };
1546
- meta: object;
1547
- }>;
1548
- save: import("@trpc/server").TRPCMutationProcedure<{
1549
- input: {
1550
- googleTagId: string;
1551
- googlePropertyId: string;
1552
- googleServiceAccountCredentials: string;
1553
- };
1554
- output: boolean;
1555
- meta: object;
1556
- }>;
1557
- }>>;
1558
1504
  plugins: import("@trpc/server").TRPCBuiltRouter<{
1559
1505
  ctx: {
1560
1506
  headers: Headers;
@@ -1 +1 @@
1
- {"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../../src/api/root.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,W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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAiC,CAAA"}
package/dist/api/root.js CHANGED
@@ -7,7 +7,6 @@ import { navRouter } from './routers/navigation.js';
7
7
  import { simpleSectionRouter } from './routers/simpleSection.js';
8
8
  import { categorySectionRouter } from './routers/categorySection.js';
9
9
  import { accountSettings } from './routers/accountSettings.js';
10
- import { cmsSettings } from './routers/cmsSettings.js';
11
10
  import { galleryRouter } from './routers/gallery.js';
12
11
  import { getConfigImportVersion } from '../core/config/index.js';
13
12
  import { getPluginRoutes, loadPlugins } from '../plugins/loader.js';
@@ -48,7 +47,6 @@ const coreRouters = {
48
47
  gallery: galleryRouter,
49
48
  navigation: navRouter,
50
49
  accountSettings: accountSettings,
51
- cmsSettings: cmsSettings,
52
50
  plugins: pluginsRouter,
53
51
  };
54
52
  // Lazy router creation - cache the result
@@ -24,6 +24,12 @@ export declare const adminsRouter: import("@trpc/server").TRPCBuiltRouter<{
24
24
  list: import("@trpc/server").TRPCQueryProcedure<{
25
25
  input: void;
26
26
  output: {
27
+ error: {
28
+ message: string;
29
+ };
30
+ admins?: undefined;
31
+ privileges?: undefined;
32
+ } | {
27
33
  admins: {
28
34
  id: string;
29
35
  username: string;
@@ -40,6 +46,7 @@ export declare const adminsRouter: import("@trpc/server").TRPCBuiltRouter<{
40
46
  sectionType: string;
41
47
  sectionName: string;
42
48
  }[];
49
+ error?: undefined;
43
50
  };
44
51
  meta: object;
45
52
  }>;
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiSvB,CAAA"}
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmSvB,CAAA"}
@@ -18,10 +18,11 @@ export const adminsRouter = router({
18
18
  userId: ctx.session.user.id,
19
19
  });
20
20
  if (!accessAllowed) {
21
- throw new TRPCError({
22
- code: 'NOT_FOUND',
23
- message: 'Section not found or you do not have access to this operation',
24
- });
21
+ return {
22
+ error: {
23
+ message: 'Section not found or you do not have access to this operation',
24
+ },
25
+ };
25
26
  }
26
27
  const data = await Promise.all([getAdminsList(), getAllPrivileges()]);
27
28
  const adminList = data[0];
@@ -26,6 +26,12 @@ export declare const categorySectionRouter: import("@trpc/server").TRPCBuiltRout
26
26
  sectionName: string;
27
27
  };
28
28
  output: {
29
+ error: {
30
+ message: string;
31
+ };
32
+ section?: undefined;
33
+ data?: undefined;
34
+ } | {
29
35
  section: {
30
36
  tableName: string;
31
37
  sectionName: string;
@@ -53,6 +59,7 @@ export declare const categorySectionRouter: import("@trpc/server").TRPCBuiltRout
53
59
  sectionName: string;
54
60
  allowRecursiveDelete: boolean | undefined;
55
61
  };
62
+ error?: undefined;
56
63
  };
57
64
  meta: object;
58
65
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"categorySection.d.ts","sourceRoot":"","sources":["../../../src/api/routers/categorySection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAGxB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0ChC,CAAA"}
1
+ {"version":3,"file":"categorySection.d.ts","sourceRoot":"","sources":["../../../src/api/routers/categorySection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAGxB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0ChC,CAAA"}
@@ -113,13 +113,6 @@ export declare const hasItemsSectionRouter: import("@trpc/server").TRPCBuiltRout
113
113
  sectionItemId: string | number;
114
114
  };
115
115
  output: {
116
- error: {
117
- message: string;
118
- };
119
- section?: undefined;
120
- inputGroups?: undefined;
121
- gallery?: undefined;
122
- } | {
123
116
  section: {
124
117
  name: string;
125
118
  title: {
@@ -165,6 +158,13 @@ export declare const hasItemsSectionRouter: import("@trpc/server").TRPCBuiltRout
165
158
  meta: any;
166
159
  }[];
167
160
  error?: undefined;
161
+ } | {
162
+ error: {
163
+ message: any;
164
+ };
165
+ section?: undefined;
166
+ inputGroups?: undefined;
167
+ gallery?: undefined;
168
168
  };
169
169
  meta: object;
170
170
  }>;
@@ -212,7 +212,7 @@ const defaultConfig = {
212
212
  ui: {
213
213
  title: 'nextjs-cms',
214
214
  defaultTheme: 'dark',
215
- logo: '/logo.svg',
215
+ logo: '/nextjscms.webp',
216
216
  },
217
217
  debug: false,
218
218
  sections: {
@@ -368,84 +368,6 @@ export declare const AccessTokensTable: import("drizzle-orm/mysql-core").MySqlTa
368
368
  };
369
369
  dialect: "mysql";
370
370
  }>;
371
- /**
372
- * This table is used to store the settings of the CMS
373
- */
374
- export declare const CmsSettingsTable: import("drizzle-orm/mysql-core").MySqlTableWithColumns<{
375
- name: "cms_settings";
376
- schema: undefined;
377
- columns: {
378
- id: import("drizzle-orm/mysql-core").MySqlColumn<{
379
- name: "id";
380
- tableName: "cms_settings";
381
- dataType: "number";
382
- columnType: "MySqlInt";
383
- data: number;
384
- driverParam: string | number;
385
- notNull: true;
386
- hasDefault: true;
387
- isPrimaryKey: true;
388
- isAutoincrement: false;
389
- hasRuntimeDefault: false;
390
- enumValues: undefined;
391
- baseColumn: never;
392
- identity: undefined;
393
- generated: undefined;
394
- }, {}, {}>;
395
- googleTagId: import("drizzle-orm/mysql-core").MySqlColumn<{
396
- name: "google_tag_id";
397
- tableName: "cms_settings";
398
- dataType: "string";
399
- columnType: "MySqlVarChar";
400
- data: string;
401
- driverParam: string | number;
402
- notNull: false;
403
- hasDefault: false;
404
- isPrimaryKey: false;
405
- isAutoincrement: false;
406
- hasRuntimeDefault: false;
407
- enumValues: [string, ...string[]];
408
- baseColumn: never;
409
- identity: undefined;
410
- generated: undefined;
411
- }, {}, {}>;
412
- googlePropertyId: import("drizzle-orm/mysql-core").MySqlColumn<{
413
- name: "google_property_id";
414
- tableName: "cms_settings";
415
- dataType: "string";
416
- columnType: "MySqlText";
417
- data: string;
418
- driverParam: string;
419
- notNull: false;
420
- hasDefault: false;
421
- isPrimaryKey: false;
422
- isAutoincrement: false;
423
- hasRuntimeDefault: false;
424
- enumValues: [string, ...string[]];
425
- baseColumn: never;
426
- identity: undefined;
427
- generated: undefined;
428
- }, {}, {}>;
429
- googleServiceAccountCredentials: import("drizzle-orm/mysql-core").MySqlColumn<{
430
- name: "google_service_account_credentials";
431
- tableName: "cms_settings";
432
- dataType: "string";
433
- columnType: "MySqlText";
434
- data: string;
435
- driverParam: string;
436
- notNull: false;
437
- hasDefault: false;
438
- isPrimaryKey: false;
439
- isAutoincrement: false;
440
- hasRuntimeDefault: false;
441
- enumValues: [string, ...string[]];
442
- baseColumn: never;
443
- identity: undefined;
444
- generated: undefined;
445
- }, {}, {}>;
446
- };
447
- dialect: "mysql";
448
- }>;
449
371
  /**
450
372
  * This table is used to store information about the created tables
451
373
  */
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/db/schema.ts"],"names":[],"mappings":"AAYA;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYtB,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAchC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAa7B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQ5B,CAAA"}
package/dist/db/schema.js CHANGED
@@ -42,15 +42,6 @@ export const AccessTokensTable = mysqlTable('access_tokens', {
42
42
  .references(() => AdminsTable.id),
43
43
  expiration: timestamp('expiration').notNull(),
44
44
  }, (table) => [index('adminIdIndex').on(table.adminId), index('refreshTokenIndex').on(table.refreshToken)]);
45
- /**
46
- * This table is used to store the settings of the CMS
47
- */
48
- export const CmsSettingsTable = mysqlTable('cms_settings', {
49
- id: int('id').primaryKey().default(1),
50
- googleTagId: varchar('google_tag_id', { length: 100 }),
51
- googlePropertyId: longtext('google_property_id'),
52
- googleServiceAccountCredentials: longtext('google_service_account_credentials'),
53
- });
54
45
  /**
55
46
  * This table is used to store information about the created tables
56
47
  */
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This is a blank plugin server component.
3
+ * It is used as a workaround to avoid importing error if no plugins are installed.
4
+ */
5
+ export declare function Blank(): Promise<null>;
6
+ //# sourceMappingURL=blank.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blank.d.ts","sourceRoot":"","sources":["../../src/plugins/blank.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAsB,KAAK,kBAE1B"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This is a blank plugin server component.
3
+ * It is used as a workaround to avoid importing error if no plugins are installed.
4
+ */
5
+ export async function Blank() {
6
+ return null;
7
+ }
@@ -1,5 +1,4 @@
1
1
  import type { PluginConfigEntry } from '../core/config/config-loader.js';
2
- import type { ReactNode } from 'react';
3
2
  export interface CMSPlugin {
4
3
  /**
5
4
  * The human facing title of the plugin.
@@ -12,6 +11,7 @@ export interface CMSPlugin {
12
11
  * @example 'plugin_cpanel_emails'
13
12
  */
14
13
  name: string;
14
+ registryName: string;
15
15
  version?: string;
16
16
  router?: any;
17
17
  routes?: PluginRoute[];
@@ -46,6 +46,7 @@ export type PluginRouteWithComponent = PluginRoute & {
46
46
  export interface LoadedPluginRoute extends PluginRoute {
47
47
  pluginId: string;
48
48
  pluginName: string;
49
+ pluginRegistryName: string;
49
50
  pluginTitle: string;
50
51
  }
51
52
  type CMSPluginBase = Omit<CMSPlugin, 'routes'>;
@@ -61,11 +62,5 @@ export declare const loadPluginModule: (pluginPackage: string) => Promise<unknow
61
62
  export declare function loadPlugins(): Promise<LoadedPlugin[]>;
62
63
  export declare function getPluginRoutes(): Promise<LoadedPluginRoute[]>;
63
64
  export declare function findPluginRouteByPath(path: string): Promise<LoadedPluginRoute | null>;
64
- type PluginServerComponent = (props?: Record<string, unknown>) => ReactNode | Promise<ReactNode>;
65
- type PluginServerModule = {
66
- default?: PluginServerComponent;
67
- [key: string]: unknown;
68
- };
69
- export declare const pluginServerLoaders: Record<string, () => Promise<PluginServerModule>>;
70
65
  export {};
71
66
  //# sourceMappingURL=loader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/plugins/loader.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAGxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,MAAM,WAAW,SAAS;IACtB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,GAAG,CAAA;IACZ,MAAM,CAAC,EAAE,WAAW,EAAE,CAAA;IACtB,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;CAC1D;AAED,MAAM,WAAW,iBAAiB;IAC9B,MAAM,EAAE,iBAAiB,CAAA;CAC5B;AAED,MAAM,WAAW,YA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;AAED,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG;IAC9C,MAAM,EAAE,CAAC,wBAAwB,EAAE,wBAAwB,EAAE,GAAG,wBAAwB,EAAE,CAAC,CAAA;CAC9F,CAAA;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,oBAAoB,GAAG,oBAAoB,CAAA;AAChF,wBAAgB,YAAY,CAAC,MAAM,EAAE,mBAAmB,GAAG,mBAAmB,CAAA;AA2C9E,eAAO,MAAM,gBAAgB,GAAU,eAAe,MAAM,KAAG,OAAO,CAAC,OAAO,CAwB7E,CAAA;AA8BD,wBAAsB,WAAW,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC,CAyE3D;AAED,wBAAsB,eAAe,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC,CA8BpE;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAI3F"}
@@ -80,6 +80,7 @@ function resolvePluginInstance(registration, mod) {
80
80
  return {
81
81
  title: candidate.title,
82
82
  name: candidate.name,
83
+ registryName: candidate.registryName,
83
84
  version: candidate.version,
84
85
  router: candidate.router,
85
86
  routes: candidate.routes ?? [],
@@ -166,6 +167,7 @@ export async function getPluginRoutes() {
166
167
  ...route,
167
168
  pluginId: entry.config.package,
168
169
  pluginName: entry.plugin.name,
170
+ pluginRegistryName: entry.plugin.registryName,
169
171
  pluginTitle: entry.plugin.title,
170
172
  };
171
173
  });
@@ -176,12 +178,3 @@ export async function findPluginRouteByPath(path) {
176
178
  const routes = await getPluginRoutes();
177
179
  return routes.find((route) => route.path === normalized) ?? null;
178
180
  }
179
- // Keep this list in sync with cms.config.ts and apps/cms/package.json.
180
- export const pluginServerLoaders = {
181
- // @ts-ignore - The package should be in dependencies if you want to use it
182
- '@nextjs-cms-plugins/cpanel-dashboard': () => import('@nextjs-cms-plugins/cpanel-dashboard/server'),
183
- // @ts-ignore - The package should be in dependencies if you want to use it
184
- '@nextjs-cms-plugins/cpanel-emails': () => import('@nextjs-cms-plugins/cpanel-emails/server'),
185
- // @ts-ignore - The package should be in dependencies if you want to use it
186
- '@nextjs-cms-plugins/google-analytics': () => import('@nextjs-cms-plugins/google-analytics/server'),
187
- };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nextjs-cms",
3
- "version": "0.5.69",
3
+ "version": "0.5.71",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "type": "module",
@@ -117,6 +117,10 @@
117
117
  "./plugins/server": {
118
118
  "types": "./dist/plugins/server.d.ts",
119
119
  "default": "./dist/plugins/server.js"
120
+ },
121
+ "./plugins/blank-component": {
122
+ "types": "./dist/plugins/blank.d.ts",
123
+ "default": "./dist/plugins/blank.js"
120
124
  }
121
125
  },
122
126
  "files": [
@@ -166,9 +170,9 @@
166
170
  "prettier": "^3.3.3",
167
171
  "tsx": "^4.20.6",
168
172
  "typescript": "^5.9.2",
169
- "@lzcms/prettier-config": "0.1.0",
173
+ "@lzcms/eslint-config": "0.3.0",
170
174
  "@lzcms/tsconfig": "0.1.0",
171
- "@lzcms/eslint-config": "0.3.0"
175
+ "@lzcms/prettier-config": "0.1.0"
172
176
  },
173
177
  "license": "MIT",
174
178
  "keywords": [
@@ -1,47 +0,0 @@
1
- import * as z from 'zod';
2
- export declare const cmsSettings: import("@trpc/server").TRPCBuiltRouter<{
3
- ctx: {
4
- headers: Headers;
5
- db: import("drizzle-orm/mysql2").MySql2Database<typeof import("../../db/schema.js")> & {
6
- $client: import("mysql2/promise").Pool;
7
- };
8
- session: import("../../index.js").Session | null;
9
- };
10
- meta: object;
11
- errorShape: {
12
- data: {
13
- zodError: z.core.$ZodFlattenedError<unknown, string> | null;
14
- code: import("@trpc/server").TRPC_ERROR_CODE_KEY;
15
- httpStatus: number;
16
- path?: string;
17
- stack?: string;
18
- };
19
- message: string;
20
- code: import("@trpc/server").TRPC_ERROR_CODE_NUMBER;
21
- };
22
- transformer: true;
23
- }, import("@trpc/server").TRPCDecorateCreateRouterOptions<{
24
- get: import("@trpc/server").TRPCQueryProcedure<{
25
- input: void;
26
- output: {
27
- googleTagId: string;
28
- googlePropertyId: string;
29
- googleServiceAccountCredentials: string;
30
- };
31
- meta: object;
32
- }>;
33
- /**
34
- * No avatar for now, if you want to include it, you have to use the api route,
35
- * because trpc doesn't support file uploads.
36
- */
37
- save: import("@trpc/server").TRPCMutationProcedure<{
38
- input: {
39
- googleTagId: string;
40
- googlePropertyId: string;
41
- googleServiceAccountCredentials: string;
42
- };
43
- output: boolean;
44
- meta: object;
45
- }>;
46
- }>>;
47
- //# sourceMappingURL=cmsSettings.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cmsSettings.d.ts","sourceRoot":"","sources":["../../../src/api/routers/cmsSettings.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAmBpB;;;OAGG;;;;;;;;;;GA2BL,CAAA"}
@@ -1,51 +0,0 @@
1
- import { privateProcedure, router } from '../trpc.js';
2
- import { db } from '../../db/client.js';
3
- import { CmsSettingsTable } from '../../db/schema.js';
4
- import { eq } from 'drizzle-orm';
5
- import * as z from 'zod';
6
- export const cmsSettings = router({
7
- get: privateProcedure.query(async ({ ctx }) => {
8
- const settings = await db
9
- .select({
10
- googleTagId: CmsSettingsTable.googleTagId,
11
- googlePropertyId: CmsSettingsTable.googlePropertyId,
12
- googleServiceAccountCredentials: CmsSettingsTable.googleServiceAccountCredentials,
13
- })
14
- .from(CmsSettingsTable)
15
- .where(eq(CmsSettingsTable.id, 1))
16
- .limit(1);
17
- return {
18
- googleTagId: settings[0]?.googleTagId ?? '',
19
- googlePropertyId: settings[0]?.googlePropertyId ?? '',
20
- googleServiceAccountCredentials: settings[0]?.googleServiceAccountCredentials ?? '',
21
- };
22
- }),
23
- /**
24
- * No avatar for now, if you want to include it, you have to use the api route,
25
- * because trpc doesn't support file uploads.
26
- */
27
- save: privateProcedure
28
- .input(z.object({
29
- googleTagId: z.string(),
30
- googlePropertyId: z.string(),
31
- googleServiceAccountCredentials: z.string(),
32
- }))
33
- .mutation(async ({ ctx, input }) => {
34
- await db
35
- .insert(CmsSettingsTable)
36
- .values({
37
- id: 1,
38
- googleTagId: input.googleTagId,
39
- googlePropertyId: input.googlePropertyId,
40
- googleServiceAccountCredentials: input.googleServiceAccountCredentials,
41
- })
42
- .onDuplicateKeyUpdate({
43
- set: {
44
- googleTagId: input.googleTagId,
45
- googlePropertyId: input.googlePropertyId,
46
- googleServiceAccountCredentials: input.googleServiceAccountCredentials,
47
- },
48
- });
49
- return true;
50
- }),
51
- });