@momentumcms/server-express 0.1.9 → 0.2.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ ## 0.2.0 (2026-02-17)
2
+
3
+ This was a version bump only for server-express to align it with other projects, there were no code changes.
4
+
5
+ ## 0.1.10 (2026-02-17)
6
+
7
+ ### 🩹 Fixes
8
+
9
+ - **create-momentum-app:** add shell option to execFileSync for Windows ([#28](https://github.com/DonaldMurillo/momentum-cms/pull/28))
10
+
11
+ ### ❤️ Thank You
12
+
13
+ - Claude Opus 4.6
14
+ - Donald Murillo @DonaldMurillo
15
+
1
16
  ## 0.1.9 (2026-02-16)
2
17
 
3
18
  This was a version bump only for server-express to align it with other projects, there were no code changes.
package/index.cjs CHANGED
@@ -319,12 +319,26 @@ var ReferentialIntegrityError = class extends Error {
319
319
  this.constraint = constraint;
320
320
  }
321
321
  };
322
+ function isNamedTab(tab) {
323
+ return typeof tab.name === "string" && tab.name.length > 0;
324
+ }
322
325
  function flattenDataFields(fields) {
323
326
  const result = [];
324
327
  for (const field of fields) {
325
328
  if (field.type === "tabs") {
326
329
  for (const tab of field.tabs) {
327
- result.push(...flattenDataFields(tab.fields));
330
+ if (isNamedTab(tab)) {
331
+ const syntheticGroup = {
332
+ name: tab.name,
333
+ type: "group",
334
+ label: tab.label,
335
+ description: tab.description,
336
+ fields: tab.fields
337
+ };
338
+ result.push(syntheticGroup);
339
+ } else {
340
+ result.push(...flattenDataFields(tab.fields));
341
+ }
328
342
  }
329
343
  } else if (field.type === "collapsible" || field.type === "row") {
330
344
  result.push(...flattenDataFields(field.fields));
@@ -813,7 +827,20 @@ async function runFieldHooks(hookType, fields, data, req, operation) {
813
827
  for (const field of fields) {
814
828
  if (field.type === "tabs") {
815
829
  for (const tab of field.tabs) {
816
- processedData = await runFieldHooks(hookType, tab.fields, processedData, req, operation);
830
+ if (isNamedTab(tab)) {
831
+ const nested = processedData[tab.name];
832
+ if (nested && typeof nested === "object" && !Array.isArray(nested)) {
833
+ processedData[tab.name] = await runFieldHooks(
834
+ hookType,
835
+ tab.fields,
836
+ nested,
837
+ req,
838
+ operation
839
+ );
840
+ }
841
+ } else {
842
+ processedData = await runFieldHooks(hookType, tab.fields, processedData, req, operation);
843
+ }
817
844
  }
818
845
  continue;
819
846
  }
@@ -5999,6 +6026,14 @@ function createOpenAPIMiddleware(docsConfig) {
5999
6026
  var import_express2 = require("express");
6000
6027
  var import_node = require("better-auth/node");
6001
6028
 
6029
+ // libs/auth/src/lib/auth-core.ts
6030
+ var AUTH_ROLES = [
6031
+ { label: "Admin", value: "admin" },
6032
+ { label: "Editor", value: "editor" },
6033
+ { label: "User", value: "user" },
6034
+ { label: "Viewer", value: "viewer" }
6035
+ ];
6036
+
6002
6037
  // libs/auth/src/lib/auth.ts
6003
6038
  var import_better_auth = require("better-auth");
6004
6039
  var import_plugins = require("better-auth/plugins");
@@ -6023,12 +6058,6 @@ function getEnabledOAuthProviders(config) {
6023
6058
  }
6024
6059
 
6025
6060
  // libs/auth/src/lib/auth-collections.ts
6026
- var AUTH_ROLES = [
6027
- { label: "Admin", value: "admin" },
6028
- { label: "Editor", value: "editor" },
6029
- { label: "User", value: "user" },
6030
- { label: "Viewer", value: "viewer" }
6031
- ];
6032
6061
  var AuthUserCollection = defineCollection({
6033
6062
  slug: "auth-user",
6034
6063
  dbName: "user",
package/index.js CHANGED
@@ -271,12 +271,26 @@ var ReferentialIntegrityError = class extends Error {
271
271
  this.constraint = constraint;
272
272
  }
273
273
  };
274
+ function isNamedTab(tab) {
275
+ return typeof tab.name === "string" && tab.name.length > 0;
276
+ }
274
277
  function flattenDataFields(fields) {
275
278
  const result = [];
276
279
  for (const field of fields) {
277
280
  if (field.type === "tabs") {
278
281
  for (const tab of field.tabs) {
279
- result.push(...flattenDataFields(tab.fields));
282
+ if (isNamedTab(tab)) {
283
+ const syntheticGroup = {
284
+ name: tab.name,
285
+ type: "group",
286
+ label: tab.label,
287
+ description: tab.description,
288
+ fields: tab.fields
289
+ };
290
+ result.push(syntheticGroup);
291
+ } else {
292
+ result.push(...flattenDataFields(tab.fields));
293
+ }
280
294
  }
281
295
  } else if (field.type === "collapsible" || field.type === "row") {
282
296
  result.push(...flattenDataFields(field.fields));
@@ -765,7 +779,20 @@ async function runFieldHooks(hookType, fields, data, req, operation) {
765
779
  for (const field of fields) {
766
780
  if (field.type === "tabs") {
767
781
  for (const tab of field.tabs) {
768
- processedData = await runFieldHooks(hookType, tab.fields, processedData, req, operation);
782
+ if (isNamedTab(tab)) {
783
+ const nested = processedData[tab.name];
784
+ if (nested && typeof nested === "object" && !Array.isArray(nested)) {
785
+ processedData[tab.name] = await runFieldHooks(
786
+ hookType,
787
+ tab.fields,
788
+ nested,
789
+ req,
790
+ operation
791
+ );
792
+ }
793
+ } else {
794
+ processedData = await runFieldHooks(hookType, tab.fields, processedData, req, operation);
795
+ }
769
796
  }
770
797
  continue;
771
798
  }
@@ -5964,6 +5991,14 @@ function createOpenAPIMiddleware(docsConfig) {
5964
5991
  import { Router as createRouter } from "express";
5965
5992
  import { toNodeHandler } from "better-auth/node";
5966
5993
 
5994
+ // libs/auth/src/lib/auth-core.ts
5995
+ var AUTH_ROLES = [
5996
+ { label: "Admin", value: "admin" },
5997
+ { label: "Editor", value: "editor" },
5998
+ { label: "User", value: "user" },
5999
+ { label: "Viewer", value: "viewer" }
6000
+ ];
6001
+
5967
6002
  // libs/auth/src/lib/auth.ts
5968
6003
  import { betterAuth } from "better-auth";
5969
6004
  import { twoFactor } from "better-auth/plugins";
@@ -5988,12 +6023,6 @@ function getEnabledOAuthProviders(config) {
5988
6023
  }
5989
6024
 
5990
6025
  // libs/auth/src/lib/auth-collections.ts
5991
- var AUTH_ROLES = [
5992
- { label: "Admin", value: "admin" },
5993
- { label: "Editor", value: "editor" },
5994
- { label: "User", value: "user" },
5995
- { label: "Viewer", value: "viewer" }
5996
- ];
5997
6026
  var AuthUserCollection = defineCollection({
5998
6027
  slug: "auth-user",
5999
6028
  dbName: "user",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momentumcms/server-express",
3
- "version": "0.1.9",
3
+ "version": "0.2.0",
4
4
  "description": "Express adapter for Momentum CMS with Angular SSR support",
5
5
  "license": "MIT",
6
6
  "author": "Momentum CMS Contributors",