@blinkk/root-cms 2.5.3 → 2.5.4

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-HFAYSWLP.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";
@@ -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.4",
5
5
  author: "s@blinkk.com",
6
6
  license: "MIT",
7
7
  engines: {
@@ -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.4",
170
170
  "firebase-admin": ">=11",
171
171
  "firebase-functions": ">=4",
172
172
  preact: ">=10",
@@ -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"');
package/dist/cli.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-KDXHFMIH.js";
4
4
  import {
5
5
  getCmsPlugin
6
- } from "./chunk-XMR3KFP5.js";
6
+ } from "./chunk-UEJ2UTTJ.js";
7
7
  import "./chunk-MLKGABMK.js";
8
8
 
9
9
  // cli/cli.ts
@@ -836,6 +836,10 @@ declare class RootCMSClient {
836
836
  * Verifies user exists in the ACL list.
837
837
  */
838
838
  userExistsInAcl(email: string): Promise<boolean>;
839
+ /**
840
+ * Lists action logs from the database.
841
+ */
842
+ listActions(options?: ListActionsOptions): Promise<Action[]>;
839
843
  logAction(action: string, options?: {
840
844
  by?: string;
841
845
  metadata?: any;
package/dist/client.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import '@blinkk/root';
2
2
  import 'firebase-admin/app';
3
3
  import 'firebase-admin/firestore';
4
- export { A as Action, q as ArrayObject, C as BatchRequest, B as BatchRequestOptions, x as BatchRequestQuery, y as BatchRequestQueryOptions, E as BatchResponse, c as DataSource, d as DataSourceData, e as DataSourceMode, b as Doc, D as DocMode, i as GetCountOptions, G as GetDocOptions, H as HttpMethod, l as ListActionsOptions, h as ListDocsOptions, L as LoadTranslationsOptions, a as LocaleTranslations, k as Release, R as RootCMSClient, f as SaveDraftOptions, S as SetDocOptions, j as Translation, z as TranslationsDoc, T as TranslationsMap, g as UpdateDraftOptions, U as UserRole, n as getCmsPlugin, m as isRichTextData, r as marshalArray, o as marshalData, p as normalizeData, w as parseDocId, t as toArrayObject, v as translationsForLocale, s as unmarshalArray, u as unmarshalData } from './client-C1pZQL7M.js';
4
+ export { A as Action, q as ArrayObject, C as BatchRequest, B as BatchRequestOptions, x as BatchRequestQuery, y as BatchRequestQueryOptions, E as BatchResponse, c as DataSource, d as DataSourceData, e as DataSourceMode, b as Doc, D as DocMode, i as GetCountOptions, G as GetDocOptions, H as HttpMethod, l as ListActionsOptions, h as ListDocsOptions, L as LoadTranslationsOptions, a as LocaleTranslations, k as Release, R as RootCMSClient, f as SaveDraftOptions, S as SetDocOptions, j as Translation, z as TranslationsDoc, T as TranslationsMap, g as UpdateDraftOptions, U as UserRole, n as getCmsPlugin, m as isRichTextData, r as marshalArray, o as marshalData, p as normalizeData, w as parseDocId, t as toArrayObject, v as translationsForLocale, s as unmarshalArray, u as unmarshalData } from './client-C5l3dj98.js';
5
5
  import './schema-BKfPP_s9.js';
package/dist/client.js CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  translationsForLocale,
13
13
  unmarshalArray,
14
14
  unmarshalData
15
- } from "./chunk-XMR3KFP5.js";
15
+ } from "./chunk-UEJ2UTTJ.js";
16
16
  import "./chunk-MLKGABMK.js";
17
17
  export {
18
18
  BatchRequest,
package/dist/core.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { R as RootCMSClient, D as DocMode, L as LoadTranslationsOptions, T as TranslationsMap, a as LocaleTranslations } from './client-C1pZQL7M.js';
2
- export { A as Action, q as ArrayObject, C as BatchRequest, B as BatchRequestOptions, x as BatchRequestQuery, y as BatchRequestQueryOptions, E as BatchResponse, c as DataSource, d as DataSourceData, e as DataSourceMode, b as Doc, i as GetCountOptions, G as GetDocOptions, H as HttpMethod, l as ListActionsOptions, h as ListDocsOptions, F as Locale, O as MultiLocaleTranslationsMap, k as Release, f as SaveDraftOptions, S as SetDocOptions, P as SingleLocaleTranslationsMap, I as SourceString, J as TranslatedString, j as Translation, z as TranslationsDoc, K as TranslationsDocMode, N as TranslationsLocaleDocEntry, M as TranslationsLocaleDocHashMap, Q as TranslationsManager, g as UpdateDraftOptions, U as UserRole, V as buildTranslationsDbPath, W as buildTranslationsLocaleDocDbPath, n as getCmsPlugin, m as isRichTextData, r as marshalArray, o as marshalData, p as normalizeData, w as parseDocId, t as toArrayObject, v as translationsForLocale, s as unmarshalArray, u as unmarshalData } from './client-C1pZQL7M.js';
1
+ import { R as RootCMSClient, D as DocMode, L as LoadTranslationsOptions, T as TranslationsMap, a as LocaleTranslations } from './client-C5l3dj98.js';
2
+ export { A as Action, q as ArrayObject, C as BatchRequest, B as BatchRequestOptions, x as BatchRequestQuery, y as BatchRequestQueryOptions, E as BatchResponse, c as DataSource, d as DataSourceData, e as DataSourceMode, b as Doc, i as GetCountOptions, G as GetDocOptions, H as HttpMethod, l as ListActionsOptions, h as ListDocsOptions, F as Locale, O as MultiLocaleTranslationsMap, k as Release, f as SaveDraftOptions, S as SetDocOptions, P as SingleLocaleTranslationsMap, I as SourceString, J as TranslatedString, j as Translation, z as TranslationsDoc, K as TranslationsDocMode, N as TranslationsLocaleDocEntry, M as TranslationsLocaleDocHashMap, Q as TranslationsManager, g as UpdateDraftOptions, U as UserRole, V as buildTranslationsDbPath, W as buildTranslationsLocaleDocDbPath, n as getCmsPlugin, m as isRichTextData, r as marshalArray, o as marshalData, p as normalizeData, w as parseDocId, t as toArrayObject, v as translationsForLocale, s as unmarshalArray, u as unmarshalData } from './client-C5l3dj98.js';
3
3
  import { Request, RootConfig, Response, RouteParams, GetStaticProps, GetStaticPaths } from '@blinkk/root';
4
4
  import { Query } from 'firebase-admin/firestore';
5
5
  export { s as schema } from './schema-BKfPP_s9.js';
package/dist/core.js CHANGED
@@ -16,7 +16,7 @@ import {
16
16
  translationsForLocale,
17
17
  unmarshalArray,
18
18
  unmarshalData
19
- } from "./chunk-XMR3KFP5.js";
19
+ } from "./chunk-UEJ2UTTJ.js";
20
20
  import {
21
21
  __export
22
22
  } from "./chunk-MLKGABMK.js";
package/dist/functions.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  runCronJobs
3
- } from "./chunk-YAQCD6SS.js";
4
- import "./chunk-XMR3KFP5.js";
3
+ } from "./chunk-4XSWQVCI.js";
4
+ import "./chunk-UEJ2UTTJ.js";
5
5
  import "./chunk-MLKGABMK.js";
6
6
 
7
7
  // core/functions.ts
package/dist/plugin.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import '@blinkk/root';
2
2
  import 'firebase-admin/app';
3
3
  import 'firebase-admin/firestore';
4
- export { Z as CMSAIConfig, X as CMSBuiltInSidebarTool, a0 as CMSPlugin, $ as CMSPluginOptions, _ as CMSSidebarTool, Y as CMSUser, a1 as cmsPlugin } from './client-C1pZQL7M.js';
4
+ export { Z as CMSAIConfig, X as CMSBuiltInSidebarTool, a0 as CMSPlugin, $ as CMSPluginOptions, _ as CMSSidebarTool, Y as CMSUser, a1 as cmsPlugin } from './client-C5l3dj98.js';
5
5
  import './schema-BKfPP_s9.js';
package/dist/plugin.js CHANGED
@@ -4,15 +4,15 @@ import {
4
4
  } from "./chunk-T5UK2H24.js";
5
5
  import {
6
6
  getServerVersion
7
- } from "./chunk-WVOTD7EW.js";
7
+ } from "./chunk-HFAYSWLP.js";
8
8
  import {
9
9
  runCronJobs
10
- } from "./chunk-YAQCD6SS.js";
10
+ } from "./chunk-4XSWQVCI.js";
11
11
  import {
12
12
  RootCMSClient,
13
13
  parseDocId,
14
14
  unmarshalData
15
- } from "./chunk-XMR3KFP5.js";
15
+ } from "./chunk-UEJ2UTTJ.js";
16
16
  import "./chunk-MLKGABMK.js";
17
17
 
18
18
  // core/plugin.ts
@@ -1 +1 @@
1
- :root{--font-family-default: "Inter", sans-serif;--font-family-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;--color-text-default: #333333;--color-border: #EFEFEF;--button-background-hover: #F5F5F5;--button-background-active: #E5E5E5}html{box-sizing:border-box;overflow-x:hidden;font-size:16px;line-height:1.5}*,*:before,*:after{box-sizing:inherit}html,body{font-family:var(--font-family-default);color:var(--color-text-default);height:100%;margin:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;scroll-behavior:smooth}img,picture,figure,video,canvas,svg,iframe{display:block;max-width:100%;height:auto;margin:0}a{color:inherit}select{color-scheme:light}h1,h2,h3,h4,h5,p{margin:0}body.menu\:open{overflow:hidden}#root{margin:0 auto;min-height:100vh;position:relative}.bootstrap{font-size:48px;font-weight:900;width:100%;height:100vh;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;padding:40px;gap:36px;position:relative}.bootstrap-error{font-size:14px;font-weight:400;line-height:20px;position:absolute;bottom:100px;left:0;right:0;text-align:center;animation:.5s forwards bootstrap-loading-error;animation-delay:1s;opacity:0;padding:0 24px}@keyframes bootstrap-loading-error{0%{opacity:0}to{opacity:1}}.signin{font-family:Google Sans,arial,sans-serif;text-align:center;padding:48px 20px;color:#3c4043}.signin__headline{margin-bottom:40px}.signin__headline__title{font-size:36px;line-height:1.3;font-weight:500;margin-bottom:20px}.signin__headline__body{font-size:18px;line-height:1.5;font-weight:500}.signin__button{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:inline-flex;align-items:center;text-align:center;gap:12px;background:#fff;border:1px solid #dadce0;border-radius:4px;cursor:pointer;font-family:inherit;padding:0 12px;height:40px;box-sizing:border-box;transition:all .218s ease}.signin__button:hover{border-color:#d2e3fc;background-color:#4285f40a}.signin__button__icon{width:18px;height:18px;background-color:#fff}.signin__button__label{font-size:14px;line-height:1;letter-spacing:.25px;font-weight:500;color:#3c4043}.signin__error{color:red;font-weight:700;text-align:center;max-width:60ch;margin:20px auto 0}
1
+ :root{--font-family-default: "Inter", sans-serif;--font-family-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;--color-text-default: #333333;--color-border: #EFEFEF;--button-background-hover: #F5F5F5;--button-background-active: #E5E5E5}html{box-sizing:border-box;overflow-x:hidden;font-size:16px;line-height:1.5}*,*:before,*:after{box-sizing:inherit}html,body{font-family:var(--font-family-default);color:var(--color-text-default);height:100%;margin:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;scroll-behavior:smooth}img,picture,figure,video,canvas,svg,iframe{display:block;max-width:100%;height:auto;margin:0}a{color:inherit}select{color-scheme:light}h1,h2,h3,h4,h5,p{margin:0}body.menu\:open{overflow:hidden}#root{margin:0 auto;min-height:100vh;position:relative}.bootstrap{font-size:48px;font-weight:900;width:100%;height:100vh;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;padding:40px;gap:36px;position:relative}.bootstrap-error{font-size:14px;font-weight:400;line-height:20px;position:absolute;bottom:100px;left:0;right:0;text-align:center;animation:.5s forwards bootstrap-loading-error;animation-delay:1s;opacity:0;padding:0 24px}@keyframes bootstrap-loading-error{0%{opacity:0}to{opacity:1}}.signin{font-family:Google Sans,arial,sans-serif;text-align:center;padding:48px 20px;color:#3c4043}.signin__headline{margin-bottom:40px}.signin__headline__title{font-size:36px;line-height:1.3;font-weight:500;margin-bottom:20px}.signin__headline__body{font-size:18px;line-height:1.5;font-weight:500}.signin__button{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:inline-flex;align-items:center;text-align:center;gap:12px;background:#fff;border:1px solid #dadce0;border-radius:4px;cursor:pointer;font-family:inherit;padding:0 12px;height:40px;box-sizing:border-box;transition:all .218s ease}.signin__warning{max-width:520px;margin:0 auto 40px;padding:12px;border:1px solid #fbbc04;border-radius:8px;background:#fff9db;color:#5f370e;font-size:14px;line-height:1.5}.signin__button:hover{border-color:#d2e3fc;background-color:#4285f40a}.signin__button__icon{width:18px;height:18px;background-color:#fff}.signin__button__label{font-size:14px;line-height:1;letter-spacing:.25px;font-weight:500;color:#3c4043}.signin__error{color:red;font-weight:700;text-align:center;max-width:60ch;margin:20px auto 0}