@bygghammar/cms-platform 0.92.0 → 0.92.1
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 +10 -0
- package/package.json +1 -1
- package/src/server/pages-core.ts +13 -9
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,16 @@ matches `package.json` exactly. See
|
|
|
8
8
|
Versions 0.1.0 through 0.78.0 predate this repository and were reconstructed
|
|
9
9
|
from the published npm tarballs.
|
|
10
10
|
|
|
11
|
+
## 0.92.1
|
|
12
|
+
|
|
13
|
+
- Fix the page-builder save and publish RPC call by removing the unsupported
|
|
14
|
+
`_source_page_id` argument. The database supplies the source page internally,
|
|
15
|
+
preserving self-reveal protection. No migration is added or changed, and
|
|
16
|
+
platform contract v3 is unchanged.
|
|
17
|
+
- Clarify publication RPC errors so an argument mismatch is not presented as
|
|
18
|
+
proof that migrations must be replayed. Include only a recognized diagnostic
|
|
19
|
+
code and request a schema comparison before applying changes.
|
|
20
|
+
|
|
11
21
|
## 0.92.0
|
|
12
22
|
|
|
13
23
|
**Breaking: platform contract v3.** A site pinned to this package must call
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bygghammar/cms-platform",
|
|
3
|
-
"version": "0.92.
|
|
3
|
+
"version": "0.92.1",
|
|
4
4
|
"description": "Shared CMS platform: blocks, block types, i18n core, UI primitives and design-token contract used by every Bygghammar/Voyara site.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
package/src/server/pages-core.ts
CHANGED
|
@@ -377,9 +377,9 @@ export async function getPageForEditCore({ context }: PagesDeps, key: string) {
|
|
|
377
377
|
}
|
|
378
378
|
|
|
379
379
|
/**
|
|
380
|
-
* Codes and wording that mean "this installation has
|
|
381
|
-
*
|
|
382
|
-
* from PostgreSQL itself.
|
|
380
|
+
* Codes and wording that mean "this installation has no such function, or none
|
|
381
|
+
* that takes these arguments". `PGRST202`/`PGRST203` come from PostgREST, which
|
|
382
|
+
* answers the same way for both; `42883`/`42P01` from PostgreSQL itself.
|
|
383
383
|
*/
|
|
384
384
|
const FUNCTION_MISSING = new Set(["PGRST202", "PGRST203", "42883", "42P01"]);
|
|
385
385
|
|
|
@@ -423,10 +423,14 @@ async function publicationRpc(
|
|
|
423
423
|
) {
|
|
424
424
|
// A slice of the generated migration manifest rather than a second copy of
|
|
425
425
|
// the names: an operator sent after a file this package has stopped
|
|
426
|
-
// shipping is worse off than one told nothing.
|
|
426
|
+
// shipping is worse off than one told nothing. Only a code from the set
|
|
427
|
+
// above is repeated; the backend's own message is not.
|
|
427
428
|
throw new Error(
|
|
428
|
-
`${whenFailed}:
|
|
429
|
-
`${
|
|
429
|
+
`${whenFailed}: the database has no ${fn} that accepts this call` +
|
|
430
|
+
`${FUNCTION_MISSING.has(code) ? ` (${code})` : ""}. Either the migrations ` +
|
|
431
|
+
`${installedBy.join(" and ")} shipped with this package are not installed, ` +
|
|
432
|
+
`or the installed ${fn} takes different arguments than this package sends. ` +
|
|
433
|
+
`Compare the database's schema with this package before applying anything.`,
|
|
430
434
|
);
|
|
431
435
|
}
|
|
432
436
|
throw new Error(message || whenFailed);
|
|
@@ -474,10 +478,10 @@ export async function savePageVersionCore(
|
|
|
474
478
|
_note: input.note ?? null,
|
|
475
479
|
_publish: Boolean(input.publish),
|
|
476
480
|
_actor_email: actorEmail(context),
|
|
481
|
+
// No `_source_page_id`: the function takes none, and names `_page_id` as
|
|
482
|
+
// the source of every reveal itself, so a countdown pointing at the page
|
|
483
|
+
// being published is still refused rather than hiding it.
|
|
477
484
|
_reveals: reveals,
|
|
478
|
-
// Named so a countdown pointing at the page being published is refused
|
|
479
|
-
// rather than hiding it until its own deadline.
|
|
480
|
-
_source_page_id: input.pageId,
|
|
481
485
|
_audit: input.publish
|
|
482
486
|
? {
|
|
483
487
|
description:
|