@decocms/nextjs 8.6.0 → 8.7.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/README.md +2 -2
- package/dist/DraftPreviewIndicator.d.ts.map +1 -1
- package/dist/DraftPreviewIndicator.js +4 -3
- package/dist/DraftPreviewIndicator.js.map +1 -1
- package/dist/draft.d.ts +29 -5
- package/dist/draft.d.ts.map +1 -1
- package/dist/draft.js +31 -7
- package/dist/draft.js.map +1 -1
- package/dist/drafts.d.ts +11 -1
- package/dist/drafts.d.ts.map +1 -1
- package/dist/drafts.js +23 -3
- package/dist/drafts.js.map +1 -1
- package/dist/proxy/index.d.ts +51 -15
- package/dist/proxy/index.d.ts.map +1 -1
- package/dist/proxy/index.js +92 -23
- package/dist/proxy/index.js.map +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +19 -5
- package/dist/server/index.js.map +1 -1
- package/dist/server/slot.d.ts +6 -0
- package/dist/server/slot.d.ts.map +1 -1
- package/dist/server/slot.js +11 -1
- package/dist/server/slot.js.map +1 -1
- package/package.json +2 -2
- package/src/DraftPreviewIndicator.tsx +4 -3
- package/src/config/index.cjs +1 -1
- package/src/draft.ts +36 -7
- package/src/drafts.ts +35 -2
- package/src/proxy/index.ts +127 -28
- package/src/server/index.ts +27 -6
- package/src/server/slot.ts +16 -1
package/dist/proxy/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/proxy/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/proxy/index.ts"],"names":[],"mappings":"AAqDA,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAgB,MAAM,6BAA6B,CAAC;AAC1F,OAAO,EAAoB,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EACL,kBAAkB,EAClB,oBAAoB,E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has none: it reads the proxy's `x-deco-version`). */
|
|
36
36
|
searchParams?: SearchParams;
|
|
37
37
|
}
|
|
38
|
-
type BindCMS = Pick<CMS, "readVersion" | "forRelease">;
|
|
38
|
+
type BindCMS = Pick<CMS, "readVersion" | "forRelease" | "checkRelease">;
|
|
39
39
|
/**
|
|
40
40
|
* Binds what the request reads: the version, if any (the page's own
|
|
41
41
|
* `?__draft=` first, `off` leaving preview, then the version the proxy
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAiB,GAAG,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAiB,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAiBlE,OAAO,EAAE,kBAAkB,EAAa,MAAM,WAAW,CAAC;AAE1D,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,KAAK,eAAe,EACpB,uBAAuB,GACxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAE9B,6CAA6C;AAC7C,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC;AAEzE,MAAM,WAAW,gBAAgB;IAC/B,gGAAgG;IAChG,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B;AAED,KAAK,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,aAAa,GAAG,YAAY,GAAG,cAAc,CAAC,CAAC;AAOxE;;;;;;;;;GASG;AACH,wBAAsB,SAAS,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,GAAE,gBAAqB,GAAG,OAAO,CAAC,OAAO,CAAC,CAQ9F;AAkED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,MAAM,CAU9D;AAWD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,cAAc,CAClC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,QAAQ,GAAG,YAAY,CAAC,EACvC,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAKxB"}
|
package/dist/server/index.js
CHANGED
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
import { parseVisitor } from "@decocms/blocks/experiments";
|
|
28
28
|
import { headers } from "next/headers.js";
|
|
29
29
|
import { ASSIGNMENTS_HEADER, parseAssignmentsSegment, withoutDarkTests, } from "../assignments.js";
|
|
30
|
-
import { DRAFT_PARAM, VERSION_HEADER } from "../draft.js";
|
|
31
|
-
import { allowedDraft, requestLike } from "../drafts.js";
|
|
30
|
+
import { DRAFT_PARAM, DRAFT_UNAVAILABLE_HEADER, RELEASE_CHECK_HEADER, VERSION_HEADER, } from "../draft.js";
|
|
31
|
+
import { allowedDraft, draftReleaseCheck, requestLike } from "../drafts.js";
|
|
32
32
|
import { VISITOR_HEADER } from "../visitor.js";
|
|
33
33
|
import { activeDraftPointer, draftSlot } from "./slot.js";
|
|
34
34
|
export { ASSIGNMENTS_ROUTE_PREFIX, assignmentsSegment, parseAssignmentsSegment, } from "../assignments.js";
|
|
@@ -97,13 +97,25 @@ async function bindVersion(cms, options) {
|
|
|
97
97
|
if (param === "off")
|
|
98
98
|
return false;
|
|
99
99
|
const requestHeaders = await headers();
|
|
100
|
+
// The proxy read the link's draft and it's gone: the release, with the notice.
|
|
101
|
+
if (requestHeaders.get(DRAFT_UNAVAILABLE_HEADER) === "1") {
|
|
102
|
+
draftSlot().unavailable = true;
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
100
105
|
const forwarded = param ?? requestHeaders.get(VERSION_HEADER);
|
|
101
106
|
const query = forwarded ? `?${DRAFT_PARAM}=${encodeURIComponent(forwarded)}` : "";
|
|
102
107
|
const request = requestLike(requestHeaders, `/${query}`);
|
|
103
|
-
|
|
108
|
+
if (request === null)
|
|
109
|
+
return false;
|
|
110
|
+
// The proxy's release check for this request (`x-deco-release-check`), or one of its own:
|
|
111
|
+
// the host check here and the page's draft reads share it.
|
|
112
|
+
const releaseCheck = await draftReleaseCheck(cms, request, requestHeaders.get(RELEASE_CHECK_HEADER));
|
|
113
|
+
const version = await allowedDraft(cms, request, releaseCheck);
|
|
104
114
|
if (version === null)
|
|
105
115
|
return false;
|
|
106
|
-
draftSlot()
|
|
116
|
+
const slot = draftSlot();
|
|
117
|
+
slot.version = version;
|
|
118
|
+
slot.releaseCheck = releaseCheck ?? null;
|
|
107
119
|
return true;
|
|
108
120
|
}
|
|
109
121
|
/**
|
|
@@ -114,8 +126,10 @@ async function bindVersion(cms, options) {
|
|
|
114
126
|
* and campaigns decide instead. Create one per request.
|
|
115
127
|
*/
|
|
116
128
|
export function contentClient(cms) {
|
|
117
|
-
const { version, visitor, assignments } = draftSlot();
|
|
129
|
+
const { version, visitor, assignments, releaseCheck } = draftSlot();
|
|
118
130
|
const options = { visitor, version: version?.version ?? null };
|
|
131
|
+
if (version !== null && releaseCheck !== null)
|
|
132
|
+
options.releaseCheck = releaseCheck;
|
|
119
133
|
if (version?.date !== undefined)
|
|
120
134
|
options.date = version.date;
|
|
121
135
|
const experiments = over(version?.experiments, assignments?.experiments);
|
package/dist/server/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,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AG,SAAS,CAAC;IAC3D,OAAO,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAC7B,CAAC;AAED,gFAAgF;AAChF,SAAS,IAAI,CACX,OAAsD,EACtD,OAAsD;IAEtD,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACrE,OAAO,EAAE,GAAG,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC;AACpC,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,GAAuC,EACvC,OAAe;IAEf,MAAM,MAAM,GAAG,uBAAuB,CAAC,OAAO,CAAC,CAAC;IAChD,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACjC,MAAM,WAAW,GAAoB,MAAM,gBAAgB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACzE,OAAO,GAAG,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,WAAW,CAAC,WAAW,EAAE,SAAS,EAAE,WAAW,CAAC,SAAS,EAAE,CAAC,CAAC;AAChG,CAAC"}
|
package/dist/server/slot.d.ts
CHANGED
|
@@ -13,9 +13,15 @@ interface DraftSlot {
|
|
|
13
13
|
version: RequestVersion | null;
|
|
14
14
|
visitor: Visitor | null;
|
|
15
15
|
assignments: PathAssignments | null;
|
|
16
|
+
/** The link named a draft that can't be read anymore: the page renders the release. */
|
|
17
|
+
unavailable: boolean;
|
|
18
|
+
/** The request's release check (`cms.checkRelease()`), which its draft reads wait for. */
|
|
19
|
+
releaseCheck: string | null;
|
|
16
20
|
}
|
|
17
21
|
export declare const draftSlot: () => DraftSlot;
|
|
18
22
|
/** The version bound to this request (`bindDraft`), or `null` when it renders the current release. */
|
|
19
23
|
export declare function activeDraftPointer(): string | null;
|
|
24
|
+
/** Whether the request's link named a draft that can't be read anymore (`bindDraft`). */
|
|
25
|
+
export declare function draftUnavailable(): boolean;
|
|
20
26
|
export {};
|
|
21
27
|
//# sourceMappingURL=slot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slot.d.ts","sourceRoot":"","sources":["../../src/server/slot.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAE3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,UAAU,SAAS;IACjB,OAAO,EAAE,cAAc,GAAG,IAAI,CAAC;IAC/B,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IACxB,WAAW,EAAE,eAAe,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"slot.d.ts","sourceRoot":"","sources":["../../src/server/slot.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAE3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,UAAU,SAAS;IACjB,OAAO,EAAE,cAAc,GAAG,IAAI,CAAC;IAC/B,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IACxB,WAAW,EAAE,eAAe,GAAG,IAAI,CAAC;IACpC,uFAAuF;IACvF,WAAW,EAAE,OAAO,CAAC;IACrB,0FAA0F;IAC1F,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,eAAO,MAAM,SAAS,QAChB,SAOL,CAAC;AAEF,sGAAsG;AACtG,wBAAgB,kBAAkB,IAAI,MAAM,GAAG,IAAI,CAElD;AAED,yFAAyF;AACzF,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C"}
|
package/dist/server/slot.js
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import { cache } from "react";
|
|
2
|
-
export const draftSlot = cache(() => ({
|
|
2
|
+
export const draftSlot = cache(() => ({
|
|
3
|
+
version: null,
|
|
4
|
+
visitor: null,
|
|
5
|
+
assignments: null,
|
|
6
|
+
unavailable: false,
|
|
7
|
+
releaseCheck: null,
|
|
8
|
+
}));
|
|
3
9
|
/** The version bound to this request (`bindDraft`), or `null` when it renders the current release. */
|
|
4
10
|
export function activeDraftPointer() {
|
|
5
11
|
return draftSlot().version?.version ?? null;
|
|
6
12
|
}
|
|
13
|
+
/** Whether the request's link named a draft that can't be read anymore (`bindDraft`). */
|
|
14
|
+
export function draftUnavailable() {
|
|
15
|
+
return draftSlot().unavailable;
|
|
16
|
+
}
|
|
7
17
|
//# sourceMappingURL=slot.js.map
|
package/dist/server/slot.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slot.js","sourceRoot":"","sources":["../../src/server/slot.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"slot.js","sourceRoot":"","sources":["../../src/server/slot.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAa9B,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,CAC5B,GAAc,EAAE,CAAC,CAAC;IAChB,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,IAAI;IACb,WAAW,EAAE,IAAI;IACjB,WAAW,EAAE,KAAK;IAClB,YAAY,EAAE,IAAI;CACnB,CAAC,CACH,CAAC;AAEF,sGAAsG;AACtG,MAAM,UAAU,kBAAkB;IAChC,OAAO,SAAS,EAAE,CAAC,OAAO,EAAE,OAAO,IAAI,IAAI,CAAC;AAC9C,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,gBAAgB;IAC9B,OAAO,SAAS,EAAE,CAAC,WAAW,CAAC;AACjC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decocms/nextjs",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.7.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=24"
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@decocms/blocks": "8.
|
|
70
|
+
"@decocms/blocks": "8.7.0",
|
|
71
71
|
"@opentelemetry/api": "^1.9.1",
|
|
72
72
|
"@types/react": "^19.0.0",
|
|
73
73
|
"@types/react-dom": "^19.0.0",
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The "Preview mode" badge for the request's draft: a Server Component that
|
|
3
3
|
* renders `DraftBadge` (`@decocms/blocks/preview`) only when `bindDraft`
|
|
4
|
-
* bound a draft, so a published page emits nothing
|
|
4
|
+
* bound a draft, so a published page emits nothing; when the link named a
|
|
5
|
+
* draft that can't be read anymore, the badge's calm notice instead.
|
|
5
6
|
*
|
|
6
7
|
* Render it inside the page, after `bindDraft` was awaited, never from a
|
|
7
8
|
* layout: a layout renders alongside the page that fills it, so it may run
|
|
@@ -9,7 +10,7 @@
|
|
|
9
10
|
*/
|
|
10
11
|
import { DraftBadge } from "@decocms/blocks/preview";
|
|
11
12
|
import type { ReactNode } from "react";
|
|
12
|
-
import { activeDraftPointer } from "./server/slot.ts";
|
|
13
|
+
import { activeDraftPointer, draftUnavailable } from "./server/slot.ts";
|
|
13
14
|
|
|
14
15
|
export interface DraftPreviewIndicatorProps {
|
|
15
16
|
/** Where "Exit preview" goes; default: the current URL with `?__draft=off`. */
|
|
@@ -18,6 +19,6 @@ export interface DraftPreviewIndicatorProps {
|
|
|
18
19
|
|
|
19
20
|
export function DraftPreviewIndicator({ exitHref }: DraftPreviewIndicatorProps = {}): ReactNode {
|
|
20
21
|
const pointer = activeDraftPointer();
|
|
21
|
-
if (!pointer) return null;
|
|
22
|
+
if (!pointer) return draftUnavailable() ? <DraftBadge pointer={null} unavailable /> : null;
|
|
22
23
|
return <DraftBadge pointer={pointer} exitHref={exitHref} />;
|
|
23
24
|
}
|
package/src/config/index.cjs
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
/** `draftResponseHeaders(pointer)` (`src/draft.ts`), as `next.config` header entries. */
|
|
27
27
|
const DRAFT_NO_STORE_HEADERS = [
|
|
28
|
-
{ key: "Cache-Control", value: "no-
|
|
28
|
+
{ key: "Cache-Control", value: "max-age=0, no-cache, must-revalidate" },
|
|
29
29
|
{ key: "Vary", value: "Cookie" },
|
|
30
30
|
{ key: "X-Robots-Tag", value: "noindex, nofollow" },
|
|
31
31
|
];
|
package/src/draft.ts
CHANGED
|
@@ -31,19 +31,48 @@ export const DRAFT_COOKIE = "__deco_draft";
|
|
|
31
31
|
*/
|
|
32
32
|
export const VERSION_HEADER = "x-deco-version";
|
|
33
33
|
|
|
34
|
+
/**
|
|
35
|
+
* The request header the proxy sets on a draft request it hands the pages:
|
|
36
|
+
* the id of the release check it made for it (`cms.checkRelease()`), so
|
|
37
|
+
* `bindDraft`'s host check and the page's draft reads wait for that check
|
|
38
|
+
* instead of making their own (one `latest.json` read per preview request).
|
|
39
|
+
* The proxy removes any copy that arrives from outside; an id the CMS didn't
|
|
40
|
+
* make (a proxy in another process) is a check of its own anyway.
|
|
41
|
+
*/
|
|
42
|
+
export const RELEASE_CHECK_HEADER = "x-deco-release-check";
|
|
43
|
+
|
|
34
44
|
/** The URL prefix a drafted request is rewritten onto (`app/%5Fdraft/[[...path]]`). */
|
|
35
45
|
export const DRAFT_ROUTE_PREFIX = "/_draft";
|
|
36
46
|
|
|
37
47
|
/**
|
|
38
|
-
* The
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
48
|
+
* The request header the proxy sets when the link named a draft that can't be
|
|
49
|
+
* read anymore (deleted, say): the pages render the release and
|
|
50
|
+
* `DraftPreviewIndicator` says so calmly. The proxy removes any copy that
|
|
51
|
+
* arrives from outside.
|
|
52
|
+
*/
|
|
53
|
+
export const DRAFT_UNAVAILABLE_HEADER = "x-deco-draft-unavailable";
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The `Cache-Control` of every response to a preview request (a request with
|
|
57
|
+
* `?__draft=`, whatever its value, or the draft cookie): always revalidated,
|
|
58
|
+
* never answered from a cache (PO 2026-10-23).
|
|
59
|
+
*/
|
|
60
|
+
export const DRAFT_CACHE_CONTROL = "max-age=0, no-cache, must-revalidate";
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The response headers of a preview: never answered from a browser's or a
|
|
64
|
+
* CDN's cache (`Cache-Control: max-age=0, no-cache, must-revalidate`, `Vary:
|
|
65
|
+
* Cookie`) and never indexed (`X-Robots-Tag: noindex, nofollow`). `{}` when
|
|
66
|
+
* `preview` is `null`, `false` or empty, so the result of the draft decision
|
|
67
|
+
* applies as is: pass the version, or whether the request carries a draft
|
|
68
|
+
* signal at all (`?__draft=off` and a refused or unavailable draft too).
|
|
42
69
|
*/
|
|
43
|
-
export function draftResponseHeaders(
|
|
44
|
-
|
|
70
|
+
export function draftResponseHeaders(
|
|
71
|
+
preview: string | boolean | null | undefined,
|
|
72
|
+
): Record<string, string> {
|
|
73
|
+
if (!preview) return {};
|
|
45
74
|
return {
|
|
46
|
-
"Cache-Control":
|
|
75
|
+
"Cache-Control": DRAFT_CACHE_CONTROL,
|
|
47
76
|
Vary: "Cookie",
|
|
48
77
|
"X-Robots-Tag": "noindex, nofollow",
|
|
49
78
|
};
|
package/src/drafts.ts
CHANGED
|
@@ -21,7 +21,13 @@
|
|
|
21
21
|
*
|
|
22
22
|
* No React, no Next.js and no module state: the proxy and the pages share it.
|
|
23
23
|
*/
|
|
24
|
-
import {
|
|
24
|
+
import {
|
|
25
|
+
type CMS,
|
|
26
|
+
parseDraftPointer,
|
|
27
|
+
parseVersion,
|
|
28
|
+
type RequestLike,
|
|
29
|
+
type RequestVersion,
|
|
30
|
+
} from "@decocms/blocks";
|
|
25
31
|
import { DRAFT_COOKIE, DRAFT_PARAM } from "./draft.ts";
|
|
26
32
|
|
|
27
33
|
const DRAFT_OFF = "off";
|
|
@@ -103,10 +109,37 @@ export function requestLike(
|
|
|
103
109
|
export async function allowedDraft(
|
|
104
110
|
cms: Pick<CMS, "readVersion">,
|
|
105
111
|
request: RequestLike,
|
|
112
|
+
releaseCheck?: string | null,
|
|
106
113
|
): Promise<RequestVersion | null> {
|
|
107
114
|
const read = readDraftVersion(request);
|
|
108
115
|
if (read === null) return null;
|
|
109
|
-
return (await cms.readVersion(request)) === null ? null : read;
|
|
116
|
+
return (await cms.readVersion(request, { releaseCheck })) === null ? null : read;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** A draft pointer's version that names no draft: the release, nothing fetched. */
|
|
120
|
+
const LOCAL_VERSION = "local";
|
|
121
|
+
|
|
122
|
+
/** Whether a version names a saved draft (a pointer, not a release's SHA and not `local`). */
|
|
123
|
+
export function namesDraft(version: string): boolean {
|
|
124
|
+
const parsed = parseDraftPointer(version);
|
|
125
|
+
return parsed !== null && parsed.version !== LOCAL_VERSION;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* The release check of a request whose link names a draft
|
|
130
|
+
* (`cms.checkRelease()`), so its host check, its draft reads and its render
|
|
131
|
+
* share one read of `latest.json`: the one `forwarded` names when the CMS
|
|
132
|
+
* made it (the proxy's, for the same request), else a new one. `undefined`
|
|
133
|
+
* for any other request: the release, a release's SHA, no link.
|
|
134
|
+
*/
|
|
135
|
+
export async function draftReleaseCheck(
|
|
136
|
+
cms: Pick<CMS, "checkRelease">,
|
|
137
|
+
request: RequestLike,
|
|
138
|
+
forwarded?: string | null,
|
|
139
|
+
): Promise<string | undefined> {
|
|
140
|
+
const read = readDraftVersion(request);
|
|
141
|
+
if (read === null || !namesDraft(read.version)) return undefined;
|
|
142
|
+
return cms.checkRelease(forwarded);
|
|
110
143
|
}
|
|
111
144
|
|
|
112
145
|
/**
|
package/src/proxy/index.ts
CHANGED
|
@@ -30,8 +30,11 @@
|
|
|
30
30
|
* (`contentClient`), deciding nothing again. It sends the visitor's cookie on
|
|
31
31
|
* a first visit only, never from a preview.
|
|
32
32
|
*
|
|
33
|
-
* Cached (ISR) pages can't read a request, so a
|
|
34
|
-
*
|
|
33
|
+
* Cached (ISR) pages can't read a request, so a preview request (any draft
|
|
34
|
+
* signal: `?__draft=` with any value, `off` included, or the draft cookie) is
|
|
35
|
+
* rewritten onto a dynamic draft route, never cached, and answers
|
|
36
|
+
* `Cache-Control: max-age=0, no-cache, must-revalidate`; a drafted request
|
|
37
|
+
* is rewritten onto it (`/_draft/<path>`, mounted as
|
|
35
38
|
* `app/%5Fdraft/...`: a literal `_draft` folder is private in Next and never
|
|
36
39
|
* routes), and a published one onto the assignments route
|
|
37
40
|
* (`/_assignments/<assignments>/<path>`, `rewriteToAssignmentsRoute`), where
|
|
@@ -58,11 +61,18 @@ import {
|
|
|
58
61
|
type RequestAssignments,
|
|
59
62
|
readAssignmentsAndScope,
|
|
60
63
|
} from "../assignments.ts";
|
|
61
|
-
import {
|
|
64
|
+
import {
|
|
65
|
+
DRAFT_ROUTE_PREFIX,
|
|
66
|
+
DRAFT_UNAVAILABLE_HEADER,
|
|
67
|
+
draftResponseHeaders,
|
|
68
|
+
RELEASE_CHECK_HEADER,
|
|
69
|
+
VERSION_HEADER,
|
|
70
|
+
} from "../draft.ts";
|
|
62
71
|
import {
|
|
63
72
|
allowedDraft,
|
|
64
73
|
draftCookie,
|
|
65
74
|
draftLinkValue,
|
|
75
|
+
draftReleaseCheck,
|
|
66
76
|
endsPreview,
|
|
67
77
|
hasDraftSignal,
|
|
68
78
|
requestLike,
|
|
@@ -71,8 +81,11 @@ import { VISITOR_HEADER } from "../visitor.ts";
|
|
|
71
81
|
|
|
72
82
|
export { requestLike } from "../drafts.ts";
|
|
73
83
|
|
|
74
|
-
/**
|
|
75
|
-
|
|
84
|
+
/**
|
|
85
|
+
* What the draft decision needs from the CMS: its preview host check, the
|
|
86
|
+
* release, and the draft a link names (read once before the page renders).
|
|
87
|
+
*/
|
|
88
|
+
export type CMSHandle = Pick<CMS, "readVersion" | "forRelease" | "forDraft" | "checkRelease">;
|
|
76
89
|
|
|
77
90
|
/** What the proxy does with a request's draft state. */
|
|
78
91
|
export interface DraftDecision {
|
|
@@ -85,6 +98,25 @@ export interface DraftDecision {
|
|
|
85
98
|
version: RequestVersion | null;
|
|
86
99
|
/** The `Set-Cookie` the response carries: storing a link's version, or ending a preview. */
|
|
87
100
|
setCookie: string | null;
|
|
101
|
+
/**
|
|
102
|
+
* The request carries a draft signal at all (`?__draft=` with any value, or
|
|
103
|
+
* the draft cookie): it renders on the draft route, never from a cache,
|
|
104
|
+
* and answers `draftResponseHeaders`, whatever `version` is.
|
|
105
|
+
*/
|
|
106
|
+
preview?: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* The link named a draft that can't be read (deleted, or its host
|
|
109
|
+
* failing): the release renders, the cookie is expired when the draft is
|
|
110
|
+
* gone (a failure that may pass leaves it), and the pages show
|
|
111
|
+
* the calm notice (`x-deco-draft-unavailable`), never an error page.
|
|
112
|
+
*/
|
|
113
|
+
unavailable?: true;
|
|
114
|
+
/**
|
|
115
|
+
* The release check made for this draft request (`cms.checkRelease()`),
|
|
116
|
+
* forwarded on `x-deco-release-check`: the host check, the draft read here
|
|
117
|
+
* and the page's all wait for it, so the request reads `latest.json` once.
|
|
118
|
+
*/
|
|
119
|
+
releaseCheck?: string;
|
|
88
120
|
}
|
|
89
121
|
|
|
90
122
|
export {
|
|
@@ -102,11 +134,21 @@ export {
|
|
|
102
134
|
export { DRAFT_ROUTE_PREFIX, VERSION_HEADER } from "../draft.ts";
|
|
103
135
|
|
|
104
136
|
const INERT: DraftDecision = Object.freeze({ version: null, setCookie: null });
|
|
137
|
+
/** A preview that renders the release (`off`, a refused host, a value that doesn't parse). */
|
|
138
|
+
const RELEASE_PREVIEW: DraftDecision = Object.freeze({
|
|
139
|
+
version: null,
|
|
140
|
+
setCookie: null,
|
|
141
|
+
preview: true,
|
|
142
|
+
});
|
|
105
143
|
|
|
106
144
|
/**
|
|
107
145
|
* The version a request renders and the cookie its response sets, on a host
|
|
108
146
|
* the CMS allows (as the pages' `bindDraft` checks again). A request with
|
|
109
|
-
* no `?__draft=` and no draft cookie never reaches the CMS.
|
|
147
|
+
* no `?__draft=` and no draft cookie never reaches the CMS. A draft request
|
|
148
|
+
* checks for the latest release once (`cms.checkRelease()`), shared by the
|
|
149
|
+
* host check, the read below and the page. A draft pointer
|
|
150
|
+
* is read once here (`forDraft(...).revision()`, the read the page makes
|
|
151
|
+
* again): a draft that can't be read gives the release and `unavailable`.
|
|
110
152
|
*/
|
|
111
153
|
export async function decideDraft(
|
|
112
154
|
cms: CMSHandle,
|
|
@@ -116,15 +158,55 @@ export async function decideDraft(
|
|
|
116
158
|
const like = requestLike(request.headers, url.pathname + url.search, url.host);
|
|
117
159
|
if (like === null || !hasDraftSignal(like)) return INERT;
|
|
118
160
|
// Ending a preview is allowed on any host, so a cookie set earlier always goes.
|
|
119
|
-
if (endsPreview(like)) return {
|
|
120
|
-
|
|
121
|
-
|
|
161
|
+
if (endsPreview(like)) return { ...RELEASE_PREVIEW, setCookie: expiredCookie() };
|
|
162
|
+
// One release check per draft request, shared below and by the page.
|
|
163
|
+
const releaseCheck = await draftReleaseCheck(cms, like);
|
|
164
|
+
const version = await allowedDraft(cms, like, releaseCheck);
|
|
165
|
+
if (version === null) return RELEASE_PREVIEW;
|
|
166
|
+
if (releaseCheck !== undefined) {
|
|
167
|
+
try {
|
|
168
|
+
await cms.forDraft(version.version, { releaseCheck }).revision();
|
|
169
|
+
} catch (error) {
|
|
170
|
+
// Gone (deleted): the preview ends. Any other failure (the drafts' host
|
|
171
|
+
// down, a timeout) leaves the cookie alone, so the next request tries again.
|
|
172
|
+
const setCookie = isDraftGone(error) ? expiredCookie() : null;
|
|
173
|
+
return { ...RELEASE_PREVIEW, setCookie, unavailable: true };
|
|
174
|
+
}
|
|
175
|
+
}
|
|
122
176
|
const link = draftLinkValue(like);
|
|
123
|
-
return {
|
|
177
|
+
return {
|
|
178
|
+
version,
|
|
179
|
+
setCookie: link ? draftCookie(encodeURIComponent(link)) : null,
|
|
180
|
+
preview: true,
|
|
181
|
+
...(releaseCheck === undefined ? {} : { releaseCheck }),
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Whether a draft read failed because the drafts' host no longer has the
|
|
187
|
+
* draft (`404`/`410`), as opposed to a failure that may pass (a `5xx`, a
|
|
188
|
+
* timeout, a network error). Reads the error and its causes.
|
|
189
|
+
*/
|
|
190
|
+
function isDraftGone(error: unknown): boolean {
|
|
191
|
+
for (let e = error, depth = 0; e instanceof Error && depth < 5; e = e.cause, depth++) {
|
|
192
|
+
if (/draft changes: HTTP (404|410)\b/.test(e.message)) return true;
|
|
193
|
+
}
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/** The `Set-Cookie` that ends a preview. */
|
|
198
|
+
function expiredCookie(): string {
|
|
199
|
+
return draftCookie("", ["Max-Age=0"]);
|
|
124
200
|
}
|
|
125
201
|
|
|
126
202
|
/** The headers the proxy writes for the pages: never taken from outside. */
|
|
127
|
-
const OWN_HEADERS = [
|
|
203
|
+
const OWN_HEADERS = [
|
|
204
|
+
VERSION_HEADER,
|
|
205
|
+
VISITOR_HEADER,
|
|
206
|
+
ASSIGNMENTS_HEADER,
|
|
207
|
+
DRAFT_UNAVAILABLE_HEADER,
|
|
208
|
+
RELEASE_CHECK_HEADER,
|
|
209
|
+
];
|
|
128
210
|
|
|
129
211
|
/**
|
|
130
212
|
* The request headers to forward: the accepted version on `x-deco-version`,
|
|
@@ -141,6 +223,10 @@ export function draftRequestHeaders(
|
|
|
141
223
|
const headers = new Headers(request.headers);
|
|
142
224
|
for (const name of OWN_HEADERS) headers.delete(name);
|
|
143
225
|
if (decision.version) headers.set(VERSION_HEADER, decision.version.version);
|
|
226
|
+
if (decision.version && decision.releaseCheck) {
|
|
227
|
+
headers.set(RELEASE_CHECK_HEADER, decision.releaseCheck);
|
|
228
|
+
}
|
|
229
|
+
if (decision.unavailable) headers.set(DRAFT_UNAVAILABLE_HEADER, "1");
|
|
144
230
|
return headers;
|
|
145
231
|
}
|
|
146
232
|
|
|
@@ -196,8 +282,9 @@ export function applyVisitor<R extends Response>(response: R, decision: VisitorD
|
|
|
196
282
|
|
|
197
283
|
/**
|
|
198
284
|
* Each test and campaign on or off for this request, decided once:
|
|
199
|
-
* `cms.client({ visitor, ...version })` (the visitor,
|
|
200
|
-
* version, moment and switched tests and campaigns
|
|
285
|
+
* `cms.client({ visitor, ...version, releaseCheck })` (the visitor, the Studio
|
|
286
|
+
* link's version, moment and switched tests and campaigns, and the request's
|
|
287
|
+
* release check) resolving the saved
|
|
201
288
|
* `experiments` and `campaigns` blocks. Missing blocks, or content that
|
|
202
289
|
* doesn't load, give none, never an error.
|
|
203
290
|
*/
|
|
@@ -206,9 +293,13 @@ export function decideAssignments(
|
|
|
206
293
|
draft: DraftDecision,
|
|
207
294
|
visitor: VisitorDecision,
|
|
208
295
|
): Promise<RequestAssignments> {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
296
|
+
// A draft's read shares the request's release check (`decideDraft`), never one of its own.
|
|
297
|
+
const releaseCheck = draft.version ? draft.releaseCheck : undefined;
|
|
298
|
+
return readAssignmentsAndScope(cms, {
|
|
299
|
+
visitor: visitor.visitor,
|
|
300
|
+
...draft.version,
|
|
301
|
+
...(releaseCheck ? { releaseCheck } : {}),
|
|
302
|
+
}).then((read) => read.assignments);
|
|
212
303
|
}
|
|
213
304
|
|
|
214
305
|
/**
|
|
@@ -244,10 +335,12 @@ export function isDraftRoutePath(pathname: string): boolean {
|
|
|
244
335
|
}
|
|
245
336
|
|
|
246
337
|
/**
|
|
247
|
-
* The rewrite of a
|
|
248
|
-
*
|
|
249
|
-
*
|
|
250
|
-
*
|
|
338
|
+
* The rewrite of a preview request (a drafted one, or any other with a draft
|
|
339
|
+
* signal: `off`, a refused host, a draft that can't be read) onto the draft
|
|
340
|
+
* route, which is dynamic and never cached, keeping its path and forwarding
|
|
341
|
+
* the version and, when given, the visitor (`decideVisitor`) and the
|
|
342
|
+
* assignments (`decideAssignments`); `null` when the request isn't a preview
|
|
343
|
+
* or is already on the draft route.
|
|
251
344
|
*/
|
|
252
345
|
export function rewriteToDraftRoute(
|
|
253
346
|
request: NextRequest,
|
|
@@ -255,7 +348,7 @@ export function rewriteToDraftRoute(
|
|
|
255
348
|
visitor?: VisitorDecision,
|
|
256
349
|
assignments?: RequestAssignments,
|
|
257
350
|
): NextResponse | null {
|
|
258
|
-
if (!decision.version) return null;
|
|
351
|
+
if (!decision.version && !decision.preview) return null;
|
|
259
352
|
const url = request.nextUrl.clone();
|
|
260
353
|
if (isDraftRoutePath(url.pathname)) return null;
|
|
261
354
|
url.pathname = `${DRAFT_ROUTE_PREFIX}${url.pathname}`;
|
|
@@ -282,7 +375,7 @@ const ASSIGNED_CACHE_CONTROL = "private, no-cache";
|
|
|
282
375
|
* minutes stale (the first request after that still gets it while Next
|
|
283
376
|
* renders it again), a banner switching on late, which is accepted.
|
|
284
377
|
*
|
|
285
|
-
* `null` for a
|
|
378
|
+
* `null` for a preview request (it renders on the draft route, never cached)
|
|
286
379
|
* and for a path already on the draft or assignments route. When the content
|
|
287
380
|
* saves tests or campaigns, the response is marked `Cache-Control: private,
|
|
288
381
|
* no-cache`: Next keeps one cached page per set of assignments, but the URL
|
|
@@ -297,7 +390,7 @@ export async function rewriteToAssignmentsRoute(
|
|
|
297
390
|
draft: DraftDecision,
|
|
298
391
|
visitor: VisitorDecision,
|
|
299
392
|
): Promise<NextResponse | null> {
|
|
300
|
-
if (draft.version) return null;
|
|
393
|
+
if (draft.version || draft.preview) return null;
|
|
301
394
|
const url = request.nextUrl.clone();
|
|
302
395
|
if (isDraftRoutePath(url.pathname) || isAssignmentsRoutePath(url.pathname)) return null;
|
|
303
396
|
const { assignments, varies } = await readAssignmentsAndScope(cms, { visitor: visitor.visitor });
|
|
@@ -312,15 +405,20 @@ export async function rewriteToAssignmentsRoute(
|
|
|
312
405
|
}
|
|
313
406
|
|
|
314
407
|
/**
|
|
315
|
-
* The cookie and the response headers of a
|
|
316
|
-
*
|
|
408
|
+
* The cookie and the response headers of a preview: `Set-Cookie`, and for
|
|
409
|
+
* any request with a draft signal (`preview`, or a version)
|
|
410
|
+
* `Cache-Control: max-age=0, no-cache, must-revalidate`, `Vary: Cookie` and
|
|
317
411
|
* `X-Robots-Tag: noindex, nofollow` (`draftResponseHeaders`). With the
|
|
318
412
|
* version in a cookie a draft shares its URL with the published page, so a
|
|
319
|
-
* cache keyed on the URL alone would serve it to visitors.
|
|
413
|
+
* cache keyed on the URL alone would serve it to visitors. The proxy answers
|
|
414
|
+
* before the page renders, so it can't hold the cookie back from a failed
|
|
415
|
+
* render; `decideDraft` reads the draft first instead, and a draft that
|
|
416
|
+
* can't be read expires the cookie.
|
|
320
417
|
*/
|
|
321
418
|
export function applyDraft<R extends Response>(response: R, decision: DraftDecision): R {
|
|
322
419
|
if (decision.setCookie) response.headers.append("set-cookie", decision.setCookie);
|
|
323
|
-
|
|
420
|
+
const preview = decision.preview === true || decision.version !== null;
|
|
421
|
+
for (const [name, value] of Object.entries(draftResponseHeaders(preview))) {
|
|
324
422
|
response.headers.set(name, value);
|
|
325
423
|
}
|
|
326
424
|
return response;
|
|
@@ -359,7 +457,8 @@ export function draftProxy(
|
|
|
359
457
|
}
|
|
360
458
|
const decision = await decideDraft(cms, request);
|
|
361
459
|
const visitor = decideVisitor(request, decision);
|
|
362
|
-
const onAssignmentsRoute =
|
|
460
|
+
const onAssignmentsRoute =
|
|
461
|
+
decision.version === null && decision.preview !== true && assignments?.(request) === true;
|
|
363
462
|
const rewritten = onAssignmentsRoute
|
|
364
463
|
? await rewriteToAssignmentsRoute(cms, request, decision, visitor)
|
|
365
464
|
: null;
|