nextjs-cms 0.9.35 → 0.9.37

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.
Files changed (114) hide show
  1. package/dist/api/actions/pages.d.ts +3 -3
  2. package/dist/api/trpc/root.d.ts +3 -3
  3. package/dist/api/trpc/routers/navigation.d.ts +3 -3
  4. package/dist/api/trpc/server.d.ts +9 -9
  5. package/dist/cli/lib/update-sections.d.ts.map +1 -1
  6. package/dist/cli/lib/update-sections.js +43 -10
  7. package/dist/core/config/config-loader.d.ts +2 -2
  8. package/dist/core/fields/date-range.d.ts +4 -4
  9. package/dist/core/fields/slug.d.ts +55 -3
  10. package/dist/core/fields/slug.d.ts.map +1 -1
  11. package/dist/core/fields/slug.js +56 -2
  12. package/dist/core/sections/category.d.ts +4 -4
  13. package/dist/core/sections/hasItems.d.ts +4 -4
  14. package/dist/core/sections/section.d.ts +3 -3
  15. package/dist/core/sections/simple.d.ts +4 -4
  16. package/dist/core/submit/ItemEditSubmit.js +5 -5
  17. package/dist/translations/base/en.d.ts +3 -0
  18. package/dist/translations/base/en.d.ts.map +1 -1
  19. package/dist/translations/base/en.js +3 -0
  20. package/dist/translations/client.d.ts +40 -4
  21. package/dist/translations/client.d.ts.map +1 -1
  22. package/dist/translations/server.d.ts +40 -4
  23. package/dist/translations/server.d.ts.map +1 -1
  24. package/package.json +6 -3
  25. package/dist/api/axios/axiosInstance.d.ts +0 -2
  26. package/dist/api/axios/axiosInstance.d.ts.map +0 -1
  27. package/dist/api/axios/axiosInstance.js +0 -8
  28. package/dist/api/client.d.ts +0 -30
  29. package/dist/api/client.d.ts.map +0 -1
  30. package/dist/api/client.js +0 -82
  31. package/dist/api/index.d.ts +0 -2
  32. package/dist/api/index.d.ts.map +0 -1
  33. package/dist/api/index.js +0 -0
  34. package/dist/api/lib/serverActions.d.ts +0 -338
  35. package/dist/api/lib/serverActions.d.ts.map +0 -1
  36. package/dist/api/lib/serverActions.js +0 -1517
  37. package/dist/api/root.d.ts +0 -19
  38. package/dist/api/root.d.ts.map +0 -1
  39. package/dist/api/root.js +0 -50
  40. package/dist/api/routers/accountSettings.d.ts +0 -66
  41. package/dist/api/routers/accountSettings.d.ts.map +0 -1
  42. package/dist/api/routers/accountSettings.js +0 -202
  43. package/dist/api/routers/admins.d.ts +0 -112
  44. package/dist/api/routers/admins.d.ts.map +0 -1
  45. package/dist/api/routers/admins.js +0 -323
  46. package/dist/api/routers/auth.d.ts +0 -54
  47. package/dist/api/routers/auth.d.ts.map +0 -1
  48. package/dist/api/routers/auth.js +0 -50
  49. package/dist/api/routers/categorySection.d.ts +0 -105
  50. package/dist/api/routers/categorySection.d.ts.map +0 -1
  51. package/dist/api/routers/categorySection.js +0 -49
  52. package/dist/api/routers/config.d.ts +0 -48
  53. package/dist/api/routers/config.d.ts.map +0 -1
  54. package/dist/api/routers/config.js +0 -18
  55. package/dist/api/routers/cpanel.d.ts +0 -82
  56. package/dist/api/routers/cpanel.d.ts.map +0 -1
  57. package/dist/api/routers/cpanel.js +0 -216
  58. package/dist/api/routers/fields.d.ts +0 -35
  59. package/dist/api/routers/fields.d.ts.map +0 -1
  60. package/dist/api/routers/fields.js +0 -81
  61. package/dist/api/routers/files.d.ts +0 -34
  62. package/dist/api/routers/files.d.ts.map +0 -1
  63. package/dist/api/routers/files.js +0 -14
  64. package/dist/api/routers/gallery.d.ts +0 -35
  65. package/dist/api/routers/gallery.d.ts.map +0 -1
  66. package/dist/api/routers/gallery.js +0 -92
  67. package/dist/api/routers/hasItemsSection.d.ts +0 -194
  68. package/dist/api/routers/hasItemsSection.d.ts.map +0 -1
  69. package/dist/api/routers/hasItemsSection.js +0 -86
  70. package/dist/api/routers/logs.d.ts +0 -59
  71. package/dist/api/routers/logs.d.ts.map +0 -1
  72. package/dist/api/routers/logs.js +0 -76
  73. package/dist/api/routers/navigation.d.ts +0 -50
  74. package/dist/api/routers/navigation.d.ts.map +0 -1
  75. package/dist/api/routers/navigation.js +0 -11
  76. package/dist/api/routers/simpleSection.d.ts +0 -93
  77. package/dist/api/routers/simpleSection.d.ts.map +0 -1
  78. package/dist/api/routers/simpleSection.js +0 -54
  79. package/dist/api/server.d.ts +0 -2748
  80. package/dist/api/server.d.ts.map +0 -1
  81. package/dist/api/server.js +0 -100
  82. package/dist/api/trpc/error-logging.d.ts +0 -14
  83. package/dist/api/trpc/error-logging.d.ts.map +0 -1
  84. package/dist/api/trpc/error-logging.js +0 -75
  85. package/dist/api/trpc.d.ts +0 -111
  86. package/dist/api/trpc.d.ts.map +0 -1
  87. package/dist/api/trpc.js +0 -99
  88. package/dist/api/utils/async-caller-proxy.d.ts +0 -2
  89. package/dist/api/utils/async-caller-proxy.d.ts.map +0 -1
  90. package/dist/api/utils/async-caller-proxy.js +0 -36
  91. package/dist/api/utils/lazy-caller-proxy.d.ts +0 -2
  92. package/dist/api/utils/lazy-caller-proxy.d.ts.map +0 -1
  93. package/dist/api/utils/lazy-caller-proxy.js +0 -36
  94. package/dist/api/utils/router-types.d.ts +0 -7
  95. package/dist/api/utils/router-types.d.ts.map +0 -1
  96. package/dist/api/utils/router-types.js +0 -0
  97. package/dist/auth/axios/axiosInstance.d.ts +0 -2
  98. package/dist/auth/axios/axiosInstance.d.ts.map +0 -1
  99. package/dist/auth/axios/axiosInstance.js +0 -8
  100. package/dist/auth/hooks/useAxiosPrivate.d.ts +0 -5
  101. package/dist/auth/hooks/useAxiosPrivate.d.ts.map +0 -1
  102. package/dist/auth/hooks/useAxiosPrivate.js +0 -74
  103. package/dist/auth/trpc.d.ts +0 -6
  104. package/dist/auth/trpc.d.ts.map +0 -1
  105. package/dist/auth/trpc.js +0 -81
  106. package/dist/plugins/manifest.d.ts +0 -28
  107. package/dist/plugins/manifest.d.ts.map +0 -1
  108. package/dist/plugins/manifest.js +0 -83
  109. package/dist/plugins/registry.d.ts +0 -22
  110. package/dist/plugins/registry.d.ts.map +0 -1
  111. package/dist/plugins/registry.js +0 -25
  112. package/dist/utils/log.d.ts +0 -18
  113. package/dist/utils/log.d.ts.map +0 -1
  114. package/dist/utils/log.js +0 -28
@@ -1 +1 @@
1
- {"version":3,"file":"update-sections.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/update-sections.ts"],"names":[],"mappings":"AAklFA,wBAAsB,cAAc,CAAC,SAAS,UAAQ,iBAoBrD"}
1
+ {"version":3,"file":"update-sections.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/update-sections.ts"],"names":[],"mappings":"AAumFA,wBAAsB,cAAc,CAAC,SAAS,UAAQ,iBAoBrD"}
@@ -1186,38 +1186,63 @@ const main = async (spinnerObject) => {
1186
1186
  fields: getLocalizedAssetFields(s.fieldConfigs),
1187
1187
  });
1188
1188
  if (s.db.table.endsWith(RESERVED_TABLE_SUFFIX)) {
1189
- configurationErrors.push(`Section '${s.name}': table name '${s.db.table}' ends with reserved suffix '${RESERVED_TABLE_SUFFIX}'.`);
1189
+ configurationErrors.push({
1190
+ kind: 'reservedLocalizationName',
1191
+ message: `Section '${s.name}': table name '${s.db.table}' ends with reserved suffix '${RESERVED_TABLE_SUFFIX}'.`,
1192
+ });
1190
1193
  }
1191
1194
  for (const field of s.fields) {
1192
1195
  if (field.name === RESERVED_COLUMN_NAME) {
1193
- configurationErrors.push(`Section '${s.name}', field '${field.name}': field name '${RESERVED_COLUMN_NAME}' is reserved.`);
1196
+ configurationErrors.push({
1197
+ kind: 'reservedLocalizationName',
1198
+ message: `Section '${s.name}', field '${field.name}': field name '${RESERVED_COLUMN_NAME}' is reserved.`,
1199
+ });
1194
1200
  }
1195
1201
  if (field.destinationDb) {
1196
1202
  if (field.destinationDb.table.endsWith(RESERVED_TABLE_SUFFIX)) {
1197
- configurationErrors.push(`Section '${s.name}', field '${field.name}': destinationDb.table '${field.destinationDb.table}' ends with reserved suffix '${RESERVED_TABLE_SUFFIX}'.`);
1203
+ configurationErrors.push({
1204
+ kind: 'reservedLocalizationName',
1205
+ message: `Section '${s.name}', field '${field.name}': destinationDb.table '${field.destinationDb.table}' ends with reserved suffix '${RESERVED_TABLE_SUFFIX}'.`,
1206
+ });
1198
1207
  }
1199
1208
  if (field.destinationDb.itemIdentifier === RESERVED_COLUMN_NAME ||
1200
1209
  field.destinationDb.selectIdentifier === RESERVED_COLUMN_NAME) {
1201
- configurationErrors.push(`Section '${s.name}', field '${field.name}': destinationDb identifier column name '${RESERVED_COLUMN_NAME}' is reserved.`);
1210
+ configurationErrors.push({
1211
+ kind: 'reservedLocalizationName',
1212
+ message: `Section '${s.name}', field '${field.name}': destinationDb identifier column name '${RESERVED_COLUMN_NAME}' is reserved.`,
1213
+ });
1202
1214
  }
1203
1215
  }
1204
1216
  if (isExternalSelectDbField(field)) {
1205
1217
  const ownerSectionName = managedSectionTables.get(field.db.table);
1206
1218
  if (ownerSectionName) {
1207
- configurationErrors.push(`Section '${s.name}', field '${field.name}': db.table '${field.db.table}' belongs to managed section '${ownerSectionName}'. Use the 'section' prop instead of 'db' so update-sections does not treat the section table as an external lookup table.`);
1219
+ configurationErrors.push({
1220
+ kind: 'managedSectionTable',
1221
+ message: `Section '${s.name}', field '${field.name}': db.table '${field.db.table}' belongs to managed section '${ownerSectionName}'. Use the 'section' prop instead of 'db' so update-sections does not treat the section table as an external lookup table.`,
1222
+ });
1223
+ continue;
1208
1224
  }
1209
1225
  if (field.db.table.endsWith(RESERVED_TABLE_SUFFIX)) {
1210
- configurationErrors.push(`Section '${s.name}', field '${field.name}': db.table '${field.db.table}' ends with reserved suffix '${RESERVED_TABLE_SUFFIX}'.`);
1226
+ configurationErrors.push({
1227
+ kind: 'reservedLocalizationName',
1228
+ message: `Section '${s.name}', field '${field.name}': db.table '${field.db.table}' ends with reserved suffix '${RESERVED_TABLE_SUFFIX}'.`,
1229
+ });
1211
1230
  }
1212
1231
  const reservedColumns = [field.db.identifier, field.db.label, field.db.orderBy].filter((column) => column === RESERVED_COLUMN_NAME);
1213
1232
  if (reservedColumns.length > 0) {
1214
- configurationErrors.push(`Section '${s.name}', field '${field.name}': db column name '${RESERVED_COLUMN_NAME}' is reserved.`);
1233
+ configurationErrors.push({
1234
+ kind: 'reservedLocalizationName',
1235
+ message: `Section '${s.name}', field '${field.name}': db column name '${RESERVED_COLUMN_NAME}' is reserved.`,
1236
+ });
1215
1237
  }
1216
1238
  }
1217
1239
  }
1218
1240
  const galleryForValidation = await s.getGallery();
1219
1241
  if (galleryForValidation?.db.tableName && galleryForValidation.db.tableName.endsWith(RESERVED_TABLE_SUFFIX)) {
1220
- configurationErrors.push(`Section '${s.name}': gallery table '${galleryForValidation.db.tableName}' ends with reserved suffix '${RESERVED_TABLE_SUFFIX}'.`);
1242
+ configurationErrors.push({
1243
+ kind: 'reservedLocalizationName',
1244
+ message: `Section '${s.name}': gallery table '${galleryForValidation.db.tableName}' ends with reserved suffix '${RESERVED_TABLE_SUFFIX}'.`,
1245
+ });
1221
1246
  }
1222
1247
  /**
1223
1248
  * Generate the Drizzle schema for the table
@@ -1539,9 +1564,17 @@ const main = async (spinnerObject) => {
1539
1564
  * Reject the run before schema writes if any section configuration is unsafe.
1540
1565
  */
1541
1566
  if (configurationErrors.length > 0) {
1567
+ const guidance = [];
1568
+ if (configurationErrors.some((error) => error.kind === 'reservedLocalizationName')) {
1569
+ guidance.push(`The suffix '${RESERVED_TABLE_SUFFIX}' and the column name '${RESERVED_COLUMN_NAME}' are reserved for the localization system.`);
1570
+ }
1571
+ if (configurationErrors.some((error) => error.kind === 'managedSectionTable')) {
1572
+ guidance.push(`Section-managed tables must be referenced with the 'section' prop.`);
1573
+ }
1574
+ guidance.push('Please update cms.config.ts and re-run.');
1542
1575
  spinnerObject.stop(`update-sections aborted: ${configurationErrors.length} configuration conflict(s) detected.\n` +
1543
- configurationErrors.map((e) => ` - ${e}`).join('\n') +
1544
- `\n\nThe suffix '${RESERVED_TABLE_SUFFIX}' and the column name '${RESERVED_COLUMN_NAME}' are reserved for the localization system. Section-managed tables must be referenced with the 'section' prop. Please update cms.config.ts and re-run.`);
1576
+ configurationErrors.map((error) => ` - ${error.message}`).join('\n') +
1577
+ `\n\n${guidance.join(' ')}`);
1545
1578
  throw new Error('update-sections: configuration conflicts detected');
1546
1579
  }
1547
1580
  /**