@blinkk/root-cms 2.5.3 → 2.5.5

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/app.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getServerVersion
3
- } from "./chunk-WVOTD7EW.js";
3
+ } from "./chunk-WNWP376I.js";
4
4
  import {
5
5
  getCollectionSchema,
6
6
  getProjectSchemas
@@ -80,6 +80,15 @@ function App(props) {
80
80
  ] })
81
81
  ] });
82
82
  }
83
+ function getCmsTitle(projectName, minimalBranding) {
84
+ if (!projectName) {
85
+ return "Root CMS";
86
+ }
87
+ if (minimalBranding) {
88
+ return projectName;
89
+ }
90
+ return `${projectName} \u2013 Root CMS`;
91
+ }
83
92
  async function renderApp(req, res, options) {
84
93
  const collections = {};
85
94
  Object.entries(await getCollections()).forEach(
@@ -116,7 +125,7 @@ async function renderApp(req, res, options) {
116
125
  }
117
126
  };
118
127
  const projectName = cmsConfig.name || cmsConfig.id || "";
119
- const title = projectName ? `${projectName} \u2013 Root CMS` : "Root CMS";
128
+ const title = getCmsTitle(projectName, cmsConfig.minimalBranding);
120
129
  const mainHtml = renderToString(
121
130
  /* @__PURE__ */ jsx(App, { title, ctx, favicon: cmsConfig.favicon })
122
131
  );
@@ -200,6 +209,15 @@ async function renderSignIn(req, res, options) {
200
209
  name: options.cmsConfig.name || options.cmsConfig.id || "",
201
210
  firebaseConfig: options.cmsConfig.firebaseConfig
202
211
  };
212
+ if (!options.rootConfig.server?.sessionCookieSecret) {
213
+ const warning = "Dev warning: `server.sessionCookieSecret` is missing in `root.config.ts`. Configure this secret in production to secure CMS sessions.";
214
+ console.warn(warning);
215
+ if (process.env.NODE_ENV === "development") {
216
+ ctx.warning = warning;
217
+ } else {
218
+ ctx.warning = "Dev warning: Server may be misconfigured. See logs for more information.";
219
+ }
220
+ }
203
221
  const mainHtml = renderToString(
204
222
  /* @__PURE__ */ jsx(SignIn, { title: "Sign in", ctx, favicon: options.cmsConfig.favicon })
205
223
  );
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  RootCMSClient,
3
3
  getCmsPlugin
4
- } from "./chunk-XMR3KFP5.js";
4
+ } from "./chunk-UEJ2UTTJ.js";
5
5
 
6
6
  // core/versions.ts
7
7
  import path from "path";
@@ -1211,6 +1211,9 @@ ${errorMessages}`);
1211
1211
  },
1212
1212
  tags: versionTags
1213
1213
  };
1214
+ if (data.scheduledPublishMessage) {
1215
+ versionData.publishMessage = data.scheduledPublishMessage;
1216
+ }
1214
1217
  batch.set(versionRef, versionData);
1215
1218
  batchCount += 1;
1216
1219
  batch.delete(scheduledRef);
@@ -1647,6 +1650,23 @@ ${errorMessages}`);
1647
1650
  }
1648
1651
  return false;
1649
1652
  }
1653
+ /**
1654
+ * Lists action logs from the database.
1655
+ */
1656
+ async listActions(options) {
1657
+ const colPath = `Projects/${this.projectId}/ActionLogs`;
1658
+ let queryRef = this.db.collection(colPath).orderBy("timestamp", "desc");
1659
+ if (options?.action) {
1660
+ queryRef = queryRef.where("action", "==", options.action);
1661
+ }
1662
+ if (options?.by) {
1663
+ queryRef = queryRef.where("by", "==", options.by);
1664
+ }
1665
+ const limit = options?.limit ?? 100;
1666
+ queryRef = queryRef.limit(limit);
1667
+ const snapshot = await queryRef.get();
1668
+ return snapshot.docs.map((doc) => doc.data());
1669
+ }
1650
1670
  async logAction(action, options) {
1651
1671
  if (!action) {
1652
1672
  throw new Error('missing required: "action"');
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var package_default = {
3
3
  name: "@blinkk/root-cms",
4
- version: "2.5.3",
4
+ version: "2.5.5",
5
5
  author: "s@blinkk.com",
6
6
  license: "MIT",
7
7
  engines: {
@@ -89,7 +89,6 @@ var package_default = {
89
89
  genkit: "1.26.0",
90
90
  jsonwebtoken: "9.0.2",
91
91
  kleur: "4.1.5",
92
- "react-easy-crop": "5.5.6",
93
92
  sirv: "2.0.3",
94
93
  "tiny-glob": "0.2.9"
95
94
  },
@@ -154,10 +153,11 @@ var package_default = {
154
153
  "micromark-extension-gfm": "3.0.0",
155
154
  playwright: "1.56.1",
156
155
  preact: "10.27.1",
156
+ "preact-iso": "2.11.1",
157
157
  "preact-render-to-string": "6.6.1",
158
- "preact-router": "4.1.2",
159
158
  react: "npm:@preact/compat@18.3.1",
160
159
  "react-dom": "npm:@preact/compat@18.3.1",
160
+ "react-easy-crop": "5.5.6",
161
161
  "react-json-view-compare": "2.0.2",
162
162
  tsup: "8.5.0",
163
163
  typescript: "5.9.2",
@@ -166,7 +166,7 @@ var package_default = {
166
166
  yjs: "13.6.27"
167
167
  },
168
168
  peerDependencies: {
169
- "@blinkk/root": "2.5.3",
169
+ "@blinkk/root": "2.5.5",
170
170
  "firebase-admin": ">=11",
171
171
  "firebase-functions": ">=4",
172
172
  preact: ">=10",