nextjs-cms 0.5.74 → 0.5.75

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.
@@ -233,14 +233,14 @@ declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
233
233
  name: string;
234
234
  title: string;
235
235
  };
236
- items: {
236
+ items: (Record<string, any> | {
237
237
  id: string | number;
238
238
  headingTitle: string;
239
239
  coverPhoto: string | null;
240
240
  createdAt: string;
241
241
  createdBy: string;
242
242
  permission: number;
243
- }[];
243
+ })[];
244
244
  totalCount: any;
245
245
  error?: undefined;
246
246
  };
@@ -270,14 +270,14 @@ export declare const getBrowsePage: (session: Session, sectionName: string, page
270
270
  name: string;
271
271
  title: string;
272
272
  };
273
- items: {
273
+ items: (Record<string, any> | {
274
274
  id: string | number;
275
275
  headingTitle: string;
276
276
  coverPhoto: string | null;
277
277
  createdAt: string;
278
278
  createdBy: string;
279
279
  permission: number;
280
- }[];
280
+ })[];
281
281
  totalCount: any;
282
282
  error?: undefined;
283
283
  }>;
@@ -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,M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EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,MAAM,CAAA;CACf,KACF,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAcpC,CAAA"}
@@ -823,6 +823,27 @@ export const getBrowsePage = async (session, sectionName, page = 1, q) => {
823
823
  title: section.title.section,
824
824
  },
825
825
  items: rows.map((row) => {
826
+ // Custom browse page implementation: if browse.fields is configured,
827
+ // return the specified fields plus default fields (id, headingTitle, coverPhoto, createdAt, createdBy, permission).
828
+ // NOTE: This is for custom browse page implementations only.
829
+ // The default CMS browse page component uses the fallback fields below.
830
+ if (section.browse?.fields && section.browse.fields.length > 0) {
831
+ const item = {
832
+ // Always include default fields
833
+ id: row[section.db.identifier.name],
834
+ headingTitle: row[section.headingField.name],
835
+ coverPhoto: section.coverPhotoField ? row[section.coverPhotoField?.name] : null,
836
+ createdAt: row['created_at'],
837
+ createdBy: row['created_by'],
838
+ permission: row.permission,
839
+ };
840
+ // Add configured browse fields
841
+ for (const field of section.browse.fields) {
842
+ item[field.name] = row[field.name] ?? null;
843
+ }
844
+ return item;
845
+ }
846
+ // Default browse page fields (used by the standard CMS browse page)
826
847
  return {
827
848
  id: row[section.db.identifier.name],
828
849
  headingTitle: row[section.headingField.name],
@@ -224,14 +224,14 @@ export declare const appRouter: import("@trpc/server").TRPCBuiltRouter<{
224
224
  name: string;
225
225
  title: string;
226
226
  };
227
- items: {
227
+ items: (Record<string, any> | {
228
228
  id: string | number;
229
229
  headingTitle: string;
230
230
  coverPhoto: string | null;
231
231
  createdAt: string;
232
232
  createdBy: string;
233
233
  permission: number;
234
- }[];
234
+ })[];
235
235
  totalCount: any;
236
236
  error?: undefined;
237
237
  };
@@ -1002,14 +1002,14 @@ export declare const createCaller: import("@trpc/server").TRPCRouterCaller<{
1002
1002
  name: string;
1003
1003
  title: string;
1004
1004
  };
1005
- items: {
1005
+ items: (Record<string, any> | {
1006
1006
  id: string | number;
1007
1007
  headingTitle: string;
1008
1008
  coverPhoto: string | null;
1009
1009
  createdAt: string;
1010
1010
  createdBy: string;
1011
1011
  permission: number;
1012
- }[];
1012
+ })[];
1013
1013
  totalCount: any;
1014
1014
  error?: undefined;
1015
1015
  };
@@ -40,14 +40,14 @@ export declare const hasItemsSectionRouter: import("@trpc/server").TRPCBuiltRout
40
40
  name: string;
41
41
  title: string;
42
42
  };
43
- items: {
43
+ items: (Record<string, any> | {
44
44
  id: string | number;
45
45
  headingTitle: string;
46
46
  coverPhoto: string | null;
47
47
  createdAt: string;
48
48
  createdBy: string;
49
49
  permission: number;
50
- }[];
50
+ })[];
51
51
  totalCount: any;
52
52
  error?: undefined;
53
53
  };
@@ -346,8 +346,8 @@ declare const selectFieldConfigSchema: z.ZodIntersection<z.ZodUnion<readonly [z.
346
346
  }, z.core.$strict>]>, z.ZodObject<{
347
347
  type: z.ZodLiteral<"select">;
348
348
  optionsType: z.ZodEnum<{
349
- db: "db";
350
349
  section: "section";
350
+ db: "db";
351
351
  static: "static";
352
352
  }>;
353
353
  build: z.ZodFunction<z.core.$ZodFunctionArgs, z.ZodCustom<SelectField, SelectField>>;
@@ -117,10 +117,7 @@ declare const optionsSchema: z.ZodObject<{
117
117
  */
118
118
  allowRecursiveDelete: z.ZodOptional<z.ZodBoolean>;
119
119
  fields: z.ZodUnion<[z.ZodArray<z.ZodCustom<FieldConfig, FieldConfig>>, z.ZodArray<z.ZodCustom<FieldGroupConfig, FieldGroupConfig>>]>;
120
- readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
121
- variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
122
120
  name: z.ZodString;
123
- order: z.ZodNumber;
124
121
  db: z.ZodObject<{
125
122
  table: z.ZodString;
126
123
  identifier: z.ZodOptional<z.ZodCustom<FieldConfig, FieldConfig>>;
@@ -144,6 +141,9 @@ declare const optionsSchema: z.ZodObject<{
144
141
  name: z.ZodOptional<z.ZodString>;
145
142
  }, z.core.$strict>>>;
146
143
  }, z.core.$strict>;
144
+ variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
145
+ order: z.ZodNumber;
146
+ readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
147
147
  icon: z.ZodOptional<z.ZodString>;
148
148
  gallery: z.ZodOptional<z.ZodObject<{
149
149
  db: z.ZodObject<{
@@ -214,10 +214,7 @@ export declare const categorySectionConfigSchema: z.ZodObject<{
214
214
  * @default false
215
215
  */
216
216
  allowRecursiveDelete: z.ZodOptional<z.ZodBoolean>;
217
- readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
218
- variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
219
217
  name: z.ZodString;
220
- order: z.ZodNumber;
221
218
  db: z.ZodObject<{
222
219
  table: z.ZodString;
223
220
  identifier: z.ZodOptional<z.ZodCustom<FieldConfig, FieldConfig>>;
@@ -241,6 +238,9 @@ export declare const categorySectionConfigSchema: z.ZodObject<{
241
238
  name: z.ZodOptional<z.ZodString>;
242
239
  }, z.core.$strict>>>;
243
240
  }, z.core.$strict>;
241
+ variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
242
+ order: z.ZodNumber;
243
+ readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
244
244
  icon: z.ZodOptional<z.ZodString>;
245
245
  gallery: z.ZodOptional<z.ZodObject<{
246
246
  db: z.ZodObject<{
@@ -110,6 +110,9 @@ declare const configSchema: z.ZodObject<{
110
110
  search: z.ZodOptional<z.ZodObject<{
111
111
  searchFields: z.ZodReadonly<z.ZodArray<z.ZodCustom<FieldConfig, FieldConfig>>>;
112
112
  }, z.core.$strict>>;
113
+ browse: z.ZodOptional<z.ZodObject<{
114
+ fields: z.ZodReadonly<z.ZodArray<z.ZodCustom<FieldConfig, FieldConfig>>>;
115
+ }, z.core.$strict>>;
113
116
  coverPhotoField: z.ZodOptional<z.ZodCustom<{
114
117
  type: "photo";
115
118
  build: z.core.$InferOuterFunctionType<z.core.$ZodFunctionArgs, z.ZodCustom<import("../index.js").PhotoField, import("../index.js").PhotoField>>;
@@ -185,6 +188,13 @@ export declare class HasItemsSection extends Section<Config> {
185
188
  search?: {
186
189
  readonly searchFields: readonly FieldConfig[];
187
190
  } | undefined;
191
+ /**
192
+ * Browse configuration - for custom browse page implementations only.
193
+ * The default CMS browse page ignores this and uses its standard fields.
194
+ */
195
+ browse?: {
196
+ readonly fields: readonly FieldConfig[];
197
+ } | undefined;
188
198
  coverPhotoField?: PhotoFieldConfigType;
189
199
  generateQR?: boolean | undefined;
190
200
  constructor(config: BaseSectionOptions<Config>);
@@ -294,6 +304,9 @@ declare const optionsSchema: z.ZodObject<{
294
304
  search: z.ZodOptional<z.ZodObject<{
295
305
  searchFields: z.ZodReadonly<z.ZodArray<z.ZodCustom<FieldConfig, FieldConfig>>>;
296
306
  }, z.core.$strict>>;
307
+ browse: z.ZodOptional<z.ZodObject<{
308
+ fields: z.ZodReadonly<z.ZodArray<z.ZodCustom<FieldConfig, FieldConfig>>>;
309
+ }, z.core.$strict>>;
297
310
  coverPhotoField: z.ZodOptional<z.ZodCustom<{
298
311
  type: "photo";
299
312
  build: z.core.$InferOuterFunctionType<z.core.$ZodFunctionArgs, z.ZodCustom<import("../index.js").PhotoField, import("../index.js").PhotoField>>;
@@ -355,10 +368,7 @@ declare const optionsSchema: z.ZodObject<{
355
368
  }>>;
356
369
  generateQR: z.ZodOptional<z.ZodBoolean>;
357
370
  fields: z.ZodUnion<[z.ZodArray<z.ZodCustom<FieldConfig, FieldConfig>>, z.ZodArray<z.ZodCustom<FieldGroupConfig, FieldGroupConfig>>]>;
358
- readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
359
- variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
360
371
  name: z.ZodString;
361
- order: z.ZodNumber;
362
372
  db: z.ZodObject<{
363
373
  table: z.ZodString;
364
374
  identifier: z.ZodOptional<z.ZodCustom<FieldConfig, FieldConfig>>;
@@ -382,6 +392,9 @@ declare const optionsSchema: z.ZodObject<{
382
392
  name: z.ZodOptional<z.ZodString>;
383
393
  }, z.core.$strict>>>;
384
394
  }, z.core.$strict>;
395
+ variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
396
+ order: z.ZodNumber;
397
+ readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
385
398
  icon: z.ZodOptional<z.ZodString>;
386
399
  gallery: z.ZodOptional<z.ZodObject<{
387
400
  db: z.ZodObject<{
@@ -509,6 +522,9 @@ declare const hasItemsSectionConfigSchema: z.ZodObject<{
509
522
  search: z.ZodOptional<z.ZodObject<{
510
523
  searchFields: z.ZodReadonly<z.ZodArray<z.ZodCustom<FieldConfig, FieldConfig>>>;
511
524
  }, z.core.$strict>>;
525
+ browse: z.ZodOptional<z.ZodObject<{
526
+ fields: z.ZodReadonly<z.ZodArray<z.ZodCustom<FieldConfig, FieldConfig>>>;
527
+ }, z.core.$strict>>;
512
528
  coverPhotoField: z.ZodOptional<z.ZodCustom<{
513
529
  type: "photo";
514
530
  build: z.core.$InferOuterFunctionType<z.core.$ZodFunctionArgs, z.ZodCustom<import("../index.js").PhotoField, import("../index.js").PhotoField>>;
@@ -569,10 +585,7 @@ declare const hasItemsSectionConfigSchema: z.ZodObject<{
569
585
  adminGenerated?: boolean | "readonly" | undefined;
570
586
  }>>;
571
587
  generateQR: z.ZodOptional<z.ZodBoolean>;
572
- readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
573
- variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
574
588
  name: z.ZodString;
575
- order: z.ZodNumber;
576
589
  db: z.ZodObject<{
577
590
  table: z.ZodString;
578
591
  identifier: z.ZodOptional<z.ZodCustom<FieldConfig, FieldConfig>>;
@@ -596,6 +609,9 @@ declare const hasItemsSectionConfigSchema: z.ZodObject<{
596
609
  name: z.ZodOptional<z.ZodString>;
597
610
  }, z.core.$strict>>>;
598
611
  }, z.core.$strict>;
612
+ variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
613
+ order: z.ZodNumber;
614
+ readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
599
615
  icon: z.ZodOptional<z.ZodString>;
600
616
  gallery: z.ZodOptional<z.ZodObject<{
601
617
  db: z.ZodObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"hasItems.d.ts","sourceRoot":"","sources":["../../../src/core/sections/hasItems.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,KAAK,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACtG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,EAAE,OAAO,EAA8E,MAAM,cAAc,CAAA;AAClH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAGrD,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA0BhB,CAAA;AAEF,KAAK,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAA;AAE1C,qBAAa,eAAgB,SAAQ,OAAO,CAAC,M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AAG,qBAAqB,CAmEtF"}
@@ -24,6 +24,17 @@ const configSchema = z.strictObject({
24
24
  })
25
25
  .optional()
26
26
  .describe('Search configuration'),
27
+ browse: z
28
+ .strictObject({
29
+ fields: z
30
+ .array(z.custom())
31
+ .readonly()
32
+ .describe('Custom browse fields - only use when creating a custom browse page implementation. ' +
33
+ 'Fields must be configs - will be resolved during instantiation. '),
34
+ })
35
+ .optional()
36
+ .describe('Browse configuration - for custom browse page implementations only. ' +
37
+ 'The default CMS browse page ignores this and uses its standard fields.'),
27
38
  coverPhotoField: z
28
39
  .custom()
29
40
  .optional()
@@ -37,6 +48,11 @@ export class HasItemsSection extends Section {
37
48
  title;
38
49
  requirePublishPermission;
39
50
  search;
51
+ /**
52
+ * Browse configuration - for custom browse page implementations only.
53
+ * The default CMS browse page ignores this and uses its standard fields.
54
+ */
55
+ browse;
40
56
  coverPhotoField;
41
57
  generateQR;
42
58
  // override variants?: Variant[] | undefined
@@ -46,6 +62,7 @@ export class HasItemsSection extends Section {
46
62
  this.title = config.title;
47
63
  this.requirePublishPermission = config.requirePublishPermission ?? false;
48
64
  this.search = config.search;
65
+ this.browse = config.browse;
49
66
  this.coverPhotoField = config.coverPhotoField;
50
67
  this.generateQR = config.generateQR;
51
68
  }
@@ -62,10 +62,7 @@ export declare const baseSectionOptionsSchema: z.ZodObject<{
62
62
  */
63
63
  export declare const baseHelperFunctionOptionsSchema: z.ZodObject<{
64
64
  fields: z.ZodUnion<[z.ZodArray<z.ZodCustom<FieldConfig, FieldConfig>>, z.ZodArray<z.ZodCustom<FieldGroupConfig, FieldGroupConfig>>]>;
65
- readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
66
- variants: z.ZodOptional<z.ZodArray<z.ZodCustom<Variant, Variant>>>;
67
65
  name: z.ZodString;
68
- order: z.ZodNumber;
69
66
  db: z.ZodObject<{
70
67
  table: z.ZodString;
71
68
  identifier: z.ZodOptional<z.ZodCustom<FieldConfig, FieldConfig>>;
@@ -89,6 +86,9 @@ export declare const baseHelperFunctionOptionsSchema: z.ZodObject<{
89
86
  name: z.ZodOptional<z.ZodString>;
90
87
  }, z.core.$strict>>>;
91
88
  }, z.core.$strict>;
89
+ variants: z.ZodOptional<z.ZodArray<z.ZodCustom<Variant, Variant>>>;
90
+ order: z.ZodNumber;
91
+ readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
92
92
  icon: z.ZodOptional<z.ZodString>;
93
93
  gallery: z.ZodOptional<z.ZodObject<{
94
94
  db: z.ZodObject<{
@@ -22,10 +22,10 @@ declare const optionsSchema: z.ZodObject<{
22
22
  table: z.ZodString;
23
23
  }, z.core.$strict>;
24
24
  fields: z.ZodUnion<[z.ZodArray<z.ZodCustom<FieldConfig, FieldConfig>>, z.ZodArray<z.ZodCustom<FieldGroupConfig, FieldGroupConfig>>]>;
25
- readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
26
- variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
27
25
  name: z.ZodString;
26
+ variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
28
27
  order: z.ZodNumber;
28
+ readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
29
29
  icon: z.ZodOptional<z.ZodString>;
30
30
  gallery: z.ZodOptional<z.ZodObject<{
31
31
  db: z.ZodObject<{
@@ -53,10 +53,10 @@ declare const simpleSectionConfigSchema: z.ZodObject<{
53
53
  db: z.ZodObject<{
54
54
  table: z.ZodString;
55
55
  }, z.core.$strict>;
56
- readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
57
- variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
58
56
  name: z.ZodString;
57
+ variants: z.ZodOptional<z.ZodArray<z.ZodCustom<import("../types/index.js").Variant, import("../types/index.js").Variant>>>;
59
58
  order: z.ZodNumber;
59
+ readonly: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
60
60
  icon: z.ZodOptional<z.ZodString>;
61
61
  gallery: z.ZodOptional<z.ZodObject<{
62
62
  db: z.ZodObject<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nextjs-cms",
3
- "version": "0.5.74",
3
+ "version": "0.5.75",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "type": "module",
@@ -171,8 +171,8 @@
171
171
  "tsx": "^4.20.6",
172
172
  "typescript": "^5.9.2",
173
173
  "@lzcms/eslint-config": "0.3.0",
174
- "@lzcms/tsconfig": "0.1.0",
175
- "@lzcms/prettier-config": "0.1.0"
174
+ "@lzcms/prettier-config": "0.1.0",
175
+ "@lzcms/tsconfig": "0.1.0"
176
176
  },
177
177
  "license": "MIT",
178
178
  "keywords": [