@ebitex/content-sdk 0.20.90 → 0.20.91
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/cli/codegen.d.ts +5 -6
- package/dist/cli/codegen.d.ts.map +1 -1
- package/dist/cli/codegen.js.map +1 -1
- package/dist/cli/emitTypes.d.ts +8 -10
- package/dist/cli/emitTypes.d.ts.map +1 -1
- package/dist/cli/emitTypes.js +15 -19
- package/dist/cli/emitTypes.js.map +1 -1
- package/dist/content/addressing.d.ts +9 -9
- package/dist/content/addressing.d.ts.map +1 -1
- package/dist/content/addressing.js +1 -1
- package/dist/content/addressing.js.map +1 -1
- package/dist/content/cache.d.ts +16 -16
- package/dist/content/cache.js +11 -11
- package/dist/content/client.d.ts +47 -52
- package/dist/content/client.d.ts.map +1 -1
- package/dist/content/client.js +68 -78
- package/dist/content/client.js.map +1 -1
- package/dist/content/locale.d.ts +4 -4
- package/dist/content/locale.js +4 -4
- package/dist/content/navigation.d.ts +3 -3
- package/dist/content/overlay.d.ts +8 -10
- package/dist/content/overlay.d.ts.map +1 -1
- package/dist/content/overlay.js +8 -10
- package/dist/content/overlay.js.map +1 -1
- package/dist/content/paths.d.ts +5 -6
- package/dist/content/paths.d.ts.map +1 -1
- package/dist/content/paths.js +5 -6
- package/dist/content/paths.js.map +1 -1
- package/dist/content/persistence.d.ts +16 -18
- package/dist/content/persistence.d.ts.map +1 -1
- package/dist/content/persistence.js +8 -9
- package/dist/content/persistence.js.map +1 -1
- package/dist/content/shared.d.ts +1 -1
- package/dist/content/shared.d.ts.map +1 -1
- package/dist/content/shared.js +12 -13
- package/dist/content/shared.js.map +1 -1
- package/dist/content/site.d.ts +7 -7
- package/dist/content/site.js +7 -7
- package/dist/content/strategy.d.ts +10 -13
- package/dist/content/strategy.d.ts.map +1 -1
- package/dist/content/strategy.js +2 -2
- package/dist/content/strategy.js.map +1 -1
- package/dist/content/walk.d.ts +9 -9
- package/dist/content/walk.js +9 -9
- package/dist/delivery/client.d.ts +43 -44
- package/dist/delivery/client.d.ts.map +1 -1
- package/dist/delivery/client.js +1 -1
- package/dist/delivery/client.js.map +1 -1
- package/dist/errors.d.ts +6 -6
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +4 -4
- package/dist/guards.d.ts +15 -14
- package/dist/guards.d.ts.map +1 -1
- package/dist/guards.js +15 -14
- package/dist/guards.js.map +1 -1
- package/dist/marker.d.ts +9 -11
- package/dist/marker.d.ts.map +1 -1
- package/dist/marker.js +9 -11
- package/dist/marker.js.map +1 -1
- package/dist/preview/index.d.ts +3 -3
- package/dist/preview/index.js +3 -3
- package/dist/preview/protocol.d.ts +15 -19
- package/dist/preview/protocol.d.ts.map +1 -1
- package/dist/preview/protocol.js +4 -5
- package/dist/preview/protocol.js.map +1 -1
- package/dist/react/ContentProvider.d.ts +1 -1
- package/dist/react/ContentProvider.d.ts.map +1 -1
- package/dist/react/EditorEntryCta.d.ts +7 -12
- package/dist/react/EditorEntryCta.d.ts.map +1 -1
- package/dist/react/EditorEntryCta.js +7 -12
- package/dist/react/EditorEntryCta.js.map +1 -1
- package/dist/react/Experience.d.ts +8 -8
- package/dist/react/Experience.js +1 -1
- package/dist/react/Experience.js.map +1 -1
- package/dist/react/PresentationList.d.ts +1 -1
- package/dist/react/PresentationList.d.ts.map +1 -1
- package/dist/react/PreviewBridge.d.ts +11 -12
- package/dist/react/PreviewBridge.d.ts.map +1 -1
- package/dist/react/PreviewBridge.js +6 -6
- package/dist/react/PreviewBridge.js.map +1 -1
- package/dist/react/PreviewOverlay.d.ts +4 -4
- package/dist/react/PreviewOverlay.js +5 -5
- package/dist/react/PreviewOverlay.js.map +1 -1
- package/dist/react/RenderPresentation.d.ts +5 -5
- package/dist/react/RenderPresentation.js +5 -5
- package/dist/react/Resolve.d.ts +9 -10
- package/dist/react/Resolve.d.ts.map +1 -1
- package/dist/react/Resolve.js +9 -10
- package/dist/react/Resolve.js.map +1 -1
- package/dist/react/RichText.d.ts +4 -4
- package/dist/react/RichText.js +4 -4
- package/dist/react/StandaloneComponent.d.ts +8 -9
- package/dist/react/StandaloneComponent.d.ts.map +1 -1
- package/dist/react/StandaloneComponent.js +8 -9
- package/dist/react/StandaloneComponent.js.map +1 -1
- package/dist/react/ownerContext.d.ts +8 -8
- package/dist/react/ownerContext.js +8 -8
- package/dist/react/panels.d.ts +2 -2
- package/dist/react/panels.d.ts.map +1 -1
- package/dist/react/previewContext.d.ts +17 -18
- package/dist/react/previewContext.d.ts.map +1 -1
- package/dist/react/previewContext.js +3 -3
- package/dist/react/previewContext.js.map +1 -1
- package/dist/react/useNavigation.d.ts +4 -5
- package/dist/react/useNavigation.d.ts.map +1 -1
- package/dist/react/useNavigation.js +4 -5
- package/dist/react/useNavigation.js.map +1 -1
- package/dist/sitemap/documents.d.ts +4 -4
- package/dist/sitemap/documents.js +0 -0
- package/dist/sitemap/documents.js.map +1 -1
- package/dist/sitemap/index.d.ts +7 -9
- package/dist/sitemap/index.d.ts.map +1 -1
- package/dist/sitemap/index.js +7 -9
- package/dist/sitemap/index.js.map +1 -1
- package/dist/sitemap/xml.d.ts +12 -13
- package/dist/sitemap/xml.d.ts.map +1 -1
- package/dist/sitemap/xml.js +6 -8
- package/dist/sitemap/xml.js.map +1 -1
- package/dist/types.d.ts +88 -95
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -2
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Persistent stale-while-revalidate storage
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Persistent stale-while-revalidate storage — an opt-in `localStorage`-backed layer behind
|
|
3
|
+
* `createContentClient`'s `persist` cache option. Self-contained and dependency-free: no import
|
|
4
|
+
* here ever reaches the network or React. Every operation is guarded so a private window, a
|
|
5
5
|
* throwing accessor, or quota exhaustion degrades silently to "nothing persisted" — the layer never
|
|
6
6
|
* throws into a caller.
|
|
7
7
|
*
|
|
8
8
|
* Namespace: `ebitex-content:v1:` + the in-memory `RequestCache` key string verbatim, so an
|
|
9
|
-
* in-memory hit and a persisted hit can never disagree about identity
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* so it does not bump — orphaning every stored entry to add something the type already allows to be
|
|
9
|
+
* in-memory hit and a persisted hit can never disagree about identity. `v1` is the *payload schema
|
|
10
|
+
* version* — bumped whenever a persisted result's shape changes **incompatibly**, meaning an entry
|
|
11
|
+
* written by an older build can no longer be read as the current type; a mismatched/foreign entry
|
|
12
|
+
* then reads as absent, never migrated. An additive *optional* member is not such a change, so it
|
|
13
|
+
* does not bump — orphaning every stored entry to add something the type already allows to be
|
|
15
14
|
* absent costs every returning visitor a cold paint and buys nothing.
|
|
16
15
|
*/
|
|
17
16
|
import type { SiteAddressing } from '../types.js';
|
|
@@ -20,18 +19,17 @@ export interface PersistedIdentity {
|
|
|
20
19
|
locale: string;
|
|
21
20
|
ctx: string;
|
|
22
21
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* not a replacement for it — see that option's own remarks).
|
|
22
|
+
* The delivery environment id a previous session's live `/sites` response revealed — optional (an
|
|
23
|
+
* older record, or one from a session that never got far enough to learn it, simply omits it) and
|
|
24
|
+
* read back at `createContentClient` construction, alongside the build-time `env` option
|
|
25
|
+
* (belt-and-suspenders, not a replacement for it — see that option's own remarks).
|
|
28
26
|
*/
|
|
29
27
|
deliveryEnvironmentId?: string;
|
|
30
28
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
29
|
+
* The recorded site's locale addressing strategy, written **only** for a site that has one, so an
|
|
30
|
+
* `invariant` site's identity record stays byte-identical to one written without it.
|
|
31
|
+
* `peekLocation` needs it to rebuild a key synchronously, since under such a site the key is the
|
|
32
|
+
* address rather than a locale.
|
|
35
33
|
*/
|
|
36
34
|
addressing?: SiteAddressing;
|
|
37
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persistence.d.ts","sourceRoot":"","sources":["../../src/content/persistence.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"persistence.d.ts","sourceRoot":"","sources":["../../src/content/persistence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAMjD,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,EAAE,MAAM,CAAA;IACX;;;;;OAKG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,cAAc,CAAA;CAC5B;AAYD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAkBD,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqB;IAC7C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;IACjC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAQ;gBAEvB,OAAO,GAAE,kBAAuB;IAM5C,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED,6JAA6J;IAC7J,IAAI,CAAC,CAAC,EAAE,eAAe,EAAE,MAAM,GAAG;QAAE,MAAM,EAAE,CAAC,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS;IAiB7E,wKAAwK;IACxK,KAAK,CAAC,CAAC,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,IAAI;IAiBlD,aAAa,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI;IAOhD,YAAY,IAAI,iBAAiB,GAAG,SAAS;IAe7C,oFAAoF;IACpF,KAAK,IAAI,IAAI;IAcb,OAAO,CAAC,QAAQ;IAUhB,OAAO,CAAC,SAAS;IAYjB,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,iBAAiB;IASzB,yLAAyL;IACzL,OAAO,CAAC,WAAW;CAepB"}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Persistent stale-while-revalidate storage
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Persistent stale-while-revalidate storage — an opt-in `localStorage`-backed layer behind
|
|
3
|
+
* `createContentClient`'s `persist` cache option. Self-contained and dependency-free: no import
|
|
4
|
+
* here ever reaches the network or React. Every operation is guarded so a private window, a
|
|
5
5
|
* throwing accessor, or quota exhaustion degrades silently to "nothing persisted" — the layer never
|
|
6
6
|
* throws into a caller.
|
|
7
7
|
*
|
|
8
8
|
* Namespace: `ebitex-content:v1:` + the in-memory `RequestCache` key string verbatim, so an
|
|
9
|
-
* in-memory hit and a persisted hit can never disagree about identity
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* so it does not bump — orphaning every stored entry to add something the type already allows to be
|
|
9
|
+
* in-memory hit and a persisted hit can never disagree about identity. `v1` is the *payload schema
|
|
10
|
+
* version* — bumped whenever a persisted result's shape changes **incompatibly**, meaning an entry
|
|
11
|
+
* written by an older build can no longer be read as the current type; a mismatched/foreign entry
|
|
12
|
+
* then reads as absent, never migrated. An additive *optional* member is not such a change, so it
|
|
13
|
+
* does not bump — orphaning every stored entry to add something the type already allows to be
|
|
15
14
|
* absent costs every returning visitor a cold paint and buys nothing.
|
|
16
15
|
*/
|
|
17
16
|
const NAMESPACE = 'ebitex-content:v1:';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persistence.js","sourceRoot":"","sources":["../../src/content/persistence.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"persistence.js","sourceRoot":"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E,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;QAC3E,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAA;QACvC,KAAK,MAAM,CAAC,GAAG,CAAC,IAAI,OAAO,EAAE,CAAC;YAC5B,IAAI,CAAC;gBACH,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;YAC9B,CAAC;YAAC,MAAM,CAAC;gBACP,uBAAuB;YACzB,CAAC;YACD,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;QAC3B,CAAC;QACD,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;IACxB,CAAC;CACF;AAED,SAAS,QAAQ,CAAC,eAAuB;IACvC,OAAO,GAAG,SAAS,GAAG,eAAe,EAAE,CAAA;AACzC,CAAC;AAED,SAAS,aAAa,CAAC,KAAc;IACnC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;IAC9B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAA;IAClB,CAAC;AACH,CAAC"}
|
package/dist/content/shared.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export interface SharedContentClientOptions {
|
|
|
33
33
|
* database client in a framework app makes, and it is the point rather than a side effect.
|
|
34
34
|
* - **It is not a cache of configuration.** If the factory closes over something that varies per
|
|
35
35
|
* request, the first request's value is the one every later request gets. Per-request values —
|
|
36
|
-
* a context bag above all — belong on the call, not on the client
|
|
36
|
+
* a context bag above all — belong on the call, not on the client.
|
|
37
37
|
*
|
|
38
38
|
* Safe in a browser, where it is simply a memo: a tab has one module graph, so this changes
|
|
39
39
|
* nothing there.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/content/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/content/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAwChD,MAAM,WAAW,0BAA0B;IACzC;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,aAAa,GAAG,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAE,0BAA+B,GAAG,CAAC,CAMhI;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,IAAI,IAAI,CAEhD"}
|
package/dist/content/shared.js
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* `createContentClient` returns a new client every call, and a client carries the in-memory cache
|
|
3
|
+
* every request shares — so a server wants exactly one of them. The obvious way to get one is a
|
|
4
|
+
* module-level `const`, and on the most common server-side stack for React that does not give you
|
|
5
|
+
* one.
|
|
6
6
|
*
|
|
7
7
|
* Next.js evaluates a server component's module graph and a route handler's module graph
|
|
8
8
|
* separately, so a module exporting `const content = createContentClient(...)` is instantiated
|
|
9
|
-
* **twice** and each copy gets its own `RequestCache
|
|
10
|
-
*
|
|
11
|
-
* page and `zu4ajc` from a route handler in the same running server.
|
|
9
|
+
* **twice** and each copy gets its own `RequestCache` — a random id exported beside the client reads
|
|
10
|
+
* differently from a page and from a route handler in the same running server.
|
|
12
11
|
*
|
|
13
|
-
* That matters because of what the second copy is usually for. The cache has no TTL
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
12
|
+
* That matters because of what the second copy is usually for. The cache has no TTL, so the answer
|
|
13
|
+
* to freshness is `client.invalidate()` on a signal — and the natural place to put that signal is a
|
|
14
|
+
* route handler, since a revalidation webhook is a route. So the remedy is applied to a cache no page
|
|
15
|
+
* is using, and the route returns success. It fails silently and reports that it worked, with no
|
|
16
|
+
* expiry to wait out.
|
|
18
17
|
*
|
|
19
18
|
* The fix is to key the instance on something that outlives a module graph, which is what this is.
|
|
20
19
|
*/
|
|
@@ -59,7 +58,7 @@ function registry() {
|
|
|
59
58
|
* database client in a framework app makes, and it is the point rather than a side effect.
|
|
60
59
|
* - **It is not a cache of configuration.** If the factory closes over something that varies per
|
|
61
60
|
* request, the first request's value is the one every later request gets. Per-request values —
|
|
62
|
-
* a context bag above all — belong on the call, not on the client
|
|
61
|
+
* a context bag above all — belong on the call, not on the client.
|
|
63
62
|
*
|
|
64
63
|
* Safe in a browser, where it is simply a memo: a tab has one module graph, so this changes
|
|
65
64
|
* nothing there.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/content/shared.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/content/shared.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;;;GAIG;AACH,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAA;AAIhE,SAAS,QAAQ;IACf,MAAM,SAAS,GAAG,UAA2D,CAAA;IAC7E,MAAM,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAA;IACpC,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAA;IAC7B,MAAM,OAAO,GAAa,IAAI,GAAG,EAAE,CAAA;IACnC,SAAS,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAA;IAC7B,OAAO,OAAO,CAAA;AAChB,CAAC;AAWD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,UAAU,mBAAmB,CAAiC,MAAe,EAAE,UAAsC,EAAE;IAC3H,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,SAAS,CAAA;IACpC,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAA;IACxB,kFAAkF;IAClF,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC;QAAE,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,CAAC,CAAA;IAC7C,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAM,CAAA;AAC5B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,yBAAyB;IACvC,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAA;AACpB,CAAC"}
|
package/dist/content/site.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { SiteSummary } from '../types.js';
|
|
2
2
|
/**
|
|
3
|
-
* Site resolution
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* Site resolution. `GET /path` can infer the site from the request's `Host` only when the request
|
|
4
|
+
* arrives on the site's own hostname — never true for a browser calling the API's host — so the
|
|
5
|
+
* SDK picks the site itself from `GET /sites`.
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
8
|
* Exactly one published site → that site (no host mapping needed; the local-development and
|
|
@@ -13,10 +13,10 @@ export declare function matchSite(sites: readonly SiteSummary[], hostname: strin
|
|
|
13
13
|
/** `window.location.hostname` in a browser; `undefined` in Node. */
|
|
14
14
|
export declare function currentHostname(): string | undefined;
|
|
15
15
|
/**
|
|
16
|
-
* `window.location`'s pathname and hostname in a browser; `undefined` in Node.
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
16
|
+
* `window.location`'s pathname and hostname in a browser; `undefined` in Node. The address a
|
|
17
|
+
* location-less call (`resolveReference`, a node-id `getNavigation`) takes its locale from under a
|
|
18
|
+
* site with a locale addressing strategy. A server has no such thing, which is why the server-side
|
|
19
|
+
* calls take a location explicitly.
|
|
20
20
|
*/
|
|
21
21
|
export declare function currentLocation(): {
|
|
22
22
|
pathname: string;
|
package/dist/content/site.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Site resolution
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Site resolution. `GET /path` can infer the site from the request's `Host` only when the request
|
|
3
|
+
* arrives on the site's own hostname — never true for a browser calling the API's host — so the
|
|
4
|
+
* SDK picks the site itself from `GET /sites`.
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
7
|
* Exactly one published site → that site (no host mapping needed; the local-development and
|
|
@@ -24,10 +24,10 @@ export function currentHostname() {
|
|
|
24
24
|
return typeof loc?.hostname === 'string' && loc.hostname ? loc.hostname : undefined;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
|
-
* `window.location`'s pathname and hostname in a browser; `undefined` in Node.
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
27
|
+
* `window.location`'s pathname and hostname in a browser; `undefined` in Node. The address a
|
|
28
|
+
* location-less call (`resolveReference`, a node-id `getNavigation`) takes its locale from under a
|
|
29
|
+
* site with a locale addressing strategy. A server has no such thing, which is why the server-side
|
|
30
|
+
* calls take a location explicitly.
|
|
31
31
|
*/
|
|
32
32
|
export function currentLocation() {
|
|
33
33
|
const loc = globalThis.location;
|
|
@@ -1,24 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* How deep a response is expanded
|
|
3
|
-
* documented consumption modes plus an SDK-only adaptive default).
|
|
2
|
+
* How deep a response is expanded.
|
|
4
3
|
*
|
|
5
4
|
* - `full` — one request, the server expands references `depth` levels (default **10**, the
|
|
6
5
|
* server's own cap, so the default means "as deep as the document goes"). SSR- and CDN-friendly;
|
|
7
6
|
* the only strategy that reaches every Adapter-bearing binding in one request.
|
|
8
7
|
* - `normalized` — the incremental, cache-friendly traversal unit: an entity with its own outgoing
|
|
9
|
-
* edges resolved one hop (default depth **1
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* compatibility but is no longer part of the documented strategy surface (spec 394's Decision
|
|
14
|
-
* Log) — `{ strategy: 'normalized', depth: 0 }` still works, it's just undocumented.
|
|
8
|
+
* edges resolved one hop (default depth **1** — depth 1 is what lets the server apply an edge's
|
|
9
|
+
* Adapter, so the React crawl never meets `adapter_requires_server_resolve`). The React crawl
|
|
10
|
+
* resolves each further reference on demand via `resolveReference`. `depth` is still accepted
|
|
11
|
+
* (`{ strategy: 'normalized', depth: 0 }` works) but is not part of the documented surface.
|
|
15
12
|
* - `adaptive` (SDK-only, never sent on the wire — always resolved to a concrete `full`/`normalized`
|
|
16
13
|
* before any request or cache key) — `full` for the first **location** a client instance resolves
|
|
17
14
|
* (and for every later resolve of that same location), `normalized` for any other. The SDK's
|
|
18
|
-
* default strategy
|
|
15
|
+
* default strategy.
|
|
19
16
|
*
|
|
20
|
-
* Per *location*, not per call
|
|
21
|
-
*
|
|
17
|
+
* Per *location*, not per call: the resolved strategy is part of the cache key, so a per-call
|
|
18
|
+
* decision would make two callers resolving the same location disagree — which is exactly what a
|
|
22
19
|
* page does when a loading indicator calls `useExperience` beside its own `<Experience path>`,
|
|
23
20
|
* costing two real requests for one page.
|
|
24
21
|
*/
|
|
@@ -33,12 +30,12 @@ export type ResolveStrategy = {
|
|
|
33
30
|
};
|
|
34
31
|
/** The server's `MaxResolveDepth`. */
|
|
35
32
|
export declare const MAX_RESOLVE_DEPTH = 10;
|
|
36
|
-
/** `normalized`'s
|
|
33
|
+
/** `normalized`'s default traversal unit. */
|
|
37
34
|
export declare const NORMALIZED_DEFAULT_DEPTH = 1;
|
|
38
35
|
export declare const DEFAULT_STRATEGY: ResolveStrategy;
|
|
39
36
|
/** Throws for `adaptive` — callers must resolve it to a concrete strategy first (`content/client.ts`'s `concreteStrategy`). */
|
|
40
37
|
export declare function depthFor(strategy: ResolveStrategy): number;
|
|
41
38
|
export declare function isNormalized(strategy: ResolveStrategy): boolean;
|
|
42
|
-
/** Throws for `adaptive` — a cache key must always be built from a concrete strategy so an adaptive-resolved `full`/`normalized` result is fungible with an explicitly-requested one
|
|
39
|
+
/** Throws for `adaptive` — a cache key must always be built from a concrete strategy so an adaptive-resolved `full`/`normalized` result is fungible with an explicitly-requested one. */
|
|
43
40
|
export declare function strategyKey(strategy: ResolveStrategy): string;
|
|
44
41
|
//# sourceMappingURL=strategy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strategy.d.ts","sourceRoot":"","sources":["../../src/content/strategy.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"strategy.d.ts","sourceRoot":"","sources":["../../src/content/strategy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,eAAe,GACvB;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GACpC;IAAE,QAAQ,EAAE,YAAY,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAC1C;IAAE,QAAQ,EAAE,UAAU,CAAA;CAAE,CAAA;AAE5B,sCAAsC;AACtC,eAAO,MAAM,iBAAiB,KAAK,CAAA;AAEnC,6CAA6C;AAC7C,eAAO,MAAM,wBAAwB,IAAI,CAAA;AAEzC,eAAO,MAAM,gBAAgB,EAAE,eAA0C,CAAA;AAEzE,+HAA+H;AAC/H,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,CAQ1D;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,eAAe,GAAG,OAAO,CAE/D;AAED,yLAAyL;AACzL,wBAAgB,WAAW,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,CAM7D"}
|
package/dist/content/strategy.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** The server's `MaxResolveDepth`. */
|
|
2
2
|
export const MAX_RESOLVE_DEPTH = 10;
|
|
3
|
-
/** `normalized`'s
|
|
3
|
+
/** `normalized`'s default traversal unit. */
|
|
4
4
|
export const NORMALIZED_DEFAULT_DEPTH = 1;
|
|
5
5
|
export const DEFAULT_STRATEGY = { strategy: 'adaptive' };
|
|
6
6
|
/** Throws for `adaptive` — callers must resolve it to a concrete strategy first (`content/client.ts`'s `concreteStrategy`). */
|
|
@@ -15,7 +15,7 @@ export function depthFor(strategy) {
|
|
|
15
15
|
export function isNormalized(strategy) {
|
|
16
16
|
return strategy.strategy === 'normalized';
|
|
17
17
|
}
|
|
18
|
-
/** Throws for `adaptive` — a cache key must always be built from a concrete strategy so an adaptive-resolved `full`/`normalized` result is fungible with an explicitly-requested one
|
|
18
|
+
/** Throws for `adaptive` — a cache key must always be built from a concrete strategy so an adaptive-resolved `full`/`normalized` result is fungible with an explicitly-requested one. */
|
|
19
19
|
export function strategyKey(strategy) {
|
|
20
20
|
if (strategy.strategy === 'adaptive') {
|
|
21
21
|
throw new Error("strategyKey: 'adaptive' must be resolved to a concrete strategy before it is used as a cache key.");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strategy.js","sourceRoot":"","sources":["../../src/content/strategy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"strategy.js","sourceRoot":"","sources":["../../src/content/strategy.ts"],"names":[],"mappings":"AA0BA,sCAAsC;AACtC,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,CAAA;AAEnC,6CAA6C;AAC7C,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAA;AAEzC,MAAM,CAAC,MAAM,gBAAgB,GAAoB,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAA;AAEzE,+HAA+H;AAC/H,MAAM,UAAU,QAAQ,CAAC,QAAyB;IAChD,IAAI,QAAQ,CAAC,QAAQ,KAAK,UAAU,EAAE,CAAC;QACrC,MAAM,IAAI,KAAK,CAAC,yFAAyF,CAAC,CAAA;IAC5G,CAAC;IAED,MAAM,QAAQ,GAAG,QAAQ,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,wBAAwB,CAAA;IAC5F,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,IAAI,QAAQ,CAAA;IACxC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,iBAAiB,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AACpE,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,QAAyB;IACpD,OAAO,QAAQ,CAAC,QAAQ,KAAK,YAAY,CAAA;AAC3C,CAAC;AAED,yLAAyL;AACzL,MAAM,UAAU,WAAW,CAAC,QAAyB;IACnD,IAAI,QAAQ,CAAC,QAAQ,KAAK,UAAU,EAAE,CAAC;QACrC,MAAM,IAAI,KAAK,CAAC,mGAAmG,CAAC,CAAA;IACtH,CAAC;IAED,OAAO,GAAG,QAAQ,CAAC,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAA;AACrD,CAAC"}
|
package/dist/content/walk.d.ts
CHANGED
|
@@ -2,16 +2,16 @@ import type { ComponentValue } from '../types.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* Walks an already-resolved document (a page's `presentation`, a Component's `content`, any nested
|
|
4
4
|
* field value) and yields every `ComponentValue` found anywhere in it — expanded or not, reference
|
|
5
|
-
* or inline. Shared by two
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
5
|
+
* or inline. Shared by two call sites with different needs: cache seeding (which wants every
|
|
6
|
+
* *expanded reference* it finds) and owner-edge extraction (which wants the first candidate
|
|
7
|
+
* matching one specific descriptor's identity). Structural, not Contract-driven — this SDK never
|
|
8
|
+
* knows which field type a value came from, so it recognizes shapes, not field names, and recurses
|
|
9
|
+
* into everything: object values, array elements, a Presentation envelope's
|
|
10
|
+
* `component`/`settings`, a RichText fragment's `presentation`/`reference`/`personalized` arms, and
|
|
11
|
+
* a resolved value's own `content`/`contextualValues`.
|
|
12
12
|
*
|
|
13
|
-
* Markdown fragment `embeds`
|
|
14
|
-
*
|
|
13
|
+
* Markdown fragment `embeds` are not walked — this SDK does not model them, so an embed's own
|
|
14
|
+
* edges are opaque to it.
|
|
15
15
|
*/
|
|
16
16
|
export declare function walkComponentValues(value: unknown): Generator<ComponentValue>;
|
|
17
17
|
//# sourceMappingURL=walk.d.ts.map
|
package/dist/content/walk.js
CHANGED
|
@@ -2,16 +2,16 @@ import { isComponentValue, isPresentationEnvelope, isReference, isResolved, isRi
|
|
|
2
2
|
/**
|
|
3
3
|
* Walks an already-resolved document (a page's `presentation`, a Component's `content`, any nested
|
|
4
4
|
* field value) and yields every `ComponentValue` found anywhere in it — expanded or not, reference
|
|
5
|
-
* or inline. Shared by two
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
5
|
+
* or inline. Shared by two call sites with different needs: cache seeding (which wants every
|
|
6
|
+
* *expanded reference* it finds) and owner-edge extraction (which wants the first candidate
|
|
7
|
+
* matching one specific descriptor's identity). Structural, not Contract-driven — this SDK never
|
|
8
|
+
* knows which field type a value came from, so it recognizes shapes, not field names, and recurses
|
|
9
|
+
* into everything: object values, array elements, a Presentation envelope's
|
|
10
|
+
* `component`/`settings`, a RichText fragment's `presentation`/`reference`/`personalized` arms, and
|
|
11
|
+
* a resolved value's own `content`/`contextualValues`.
|
|
12
12
|
*
|
|
13
|
-
* Markdown fragment `embeds`
|
|
14
|
-
*
|
|
13
|
+
* Markdown fragment `embeds` are not walked — this SDK does not model them, so an embed's own
|
|
14
|
+
* edges are opaque to it.
|
|
15
15
|
*/
|
|
16
16
|
export function* walkComponentValues(value) {
|
|
17
17
|
if (Array.isArray(value)) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { ComponentPage, ContextBag, ExpandedReference, LocaleTreeNode, NavigationInclude, NavigationResult, SitemapResult, PathResult, SchemaBundle, SiteSummary, StreamFacetResult, StreamPage } from '../types.js';
|
|
2
2
|
export interface DeliveryClientOptions {
|
|
3
3
|
/**
|
|
4
|
-
* A Content **delivery** key
|
|
5
|
-
* allowed-IP-ranges restriction is *browser-safe* and may ship in a bundle; a
|
|
6
|
-
* is a **server-side key** and must never reach a browser — it works from any
|
|
7
|
-
* address. The SDK cannot tell the two apart; only the Delivery page can
|
|
8
|
-
*
|
|
4
|
+
* A Content **delivery** key, created on the Content app's Delivery page. A key with an
|
|
5
|
+
* allowed-origins or allowed-IP-ranges restriction is *browser-safe* and may ship in a bundle; a
|
|
6
|
+
* key with neither is a **server-side key** and must never reach a browser — it works from any
|
|
7
|
+
* origin and any address. The SDK cannot tell the two apart; only the Delivery page can, so decide
|
|
8
|
+
* where this client runs before choosing a key.
|
|
9
9
|
*/
|
|
10
10
|
apiKey: string;
|
|
11
11
|
/** Defaults to ebitex's production API. Override for a self-hosted or local deployment. */
|
|
@@ -17,15 +17,14 @@ export interface RequestOptions {
|
|
|
17
17
|
signal?: AbortSignal;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* existed (`private, no-store`, origin-resolved on every request).
|
|
20
|
+
* `env=` on `/sites`/`/locales` — the authenticated key's own resolved delivery environment,
|
|
21
|
+
* echoed back so the edge cache can decide cache-eligibility without reaching origin. Omitted,
|
|
22
|
+
* both endpoints answer `private, no-store` and are resolved at origin on every request.
|
|
24
23
|
*/
|
|
25
24
|
export interface SitesAndLocalesOptions extends RequestOptions {
|
|
26
25
|
env?: string;
|
|
27
26
|
}
|
|
28
|
-
/** Options shared by the two content-reading endpoints
|
|
27
|
+
/** Options shared by the two content-reading endpoints. */
|
|
29
28
|
export interface ReadOptions extends RequestOptions {
|
|
30
29
|
/** One locale code. The server resolves its fallback chain; the high-level client picks the code. */
|
|
31
30
|
locale?: string;
|
|
@@ -39,11 +38,11 @@ export interface ReadOptions extends RequestOptions {
|
|
|
39
38
|
*/
|
|
40
39
|
ctx?: ContextBag;
|
|
41
40
|
/**
|
|
42
|
-
* Attach every reference descriptor's own published address(es) — wire `include=referencePaths
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
41
|
+
* Attach every reference descriptor's own published address(es) — wire `include=referencePaths`.
|
|
42
|
+
* The `paths` member is the same one `listComponents({ paths: true })` puts on an *item*, with the
|
|
43
|
+
* same rules, but on the references *inside* a document: a post's series, a parent article, a
|
|
44
|
+
* related-reading list. `[]` means the target is bound at no live node; the member being absent
|
|
45
|
+
* means this option was not sent.
|
|
47
46
|
*
|
|
48
47
|
* Present at any depth and whether or not the descriptor was expanded, so a `resolve: 0` read is
|
|
49
48
|
* enough to build navigation. Pick one with `pathForSite`.
|
|
@@ -51,10 +50,10 @@ export interface ReadOptions extends RequestOptions {
|
|
|
51
50
|
referencePaths?: boolean;
|
|
52
51
|
}
|
|
53
52
|
/**
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
53
|
+
* The caller's own site, on an endpoint whose request has no address of its own. It never selects
|
|
54
|
+
* content — it only decides which `paths` entries are *cross-site* and so carry an absolute `url`
|
|
55
|
+
* (`include=paths`, `include=referencePaths`, stream item paths). Omitted, the server has no
|
|
56
|
+
* "current site" and marks none.
|
|
58
57
|
*/
|
|
59
58
|
export interface CurrentSiteOption {
|
|
60
59
|
site?: string;
|
|
@@ -62,8 +61,8 @@ export interface CurrentSiteOption {
|
|
|
62
61
|
export interface GetComponentOptions extends ReadOptions, CurrentSiteOption {
|
|
63
62
|
/**
|
|
64
63
|
* Attach this component's **own** published address(es) — wire `include=paths`, the same value
|
|
65
|
-
* `listComponents({ paths: true })` reports for the same key
|
|
66
|
-
*
|
|
64
|
+
* `listComponents({ paths: true })` reports for the same key. Distinct from `referencePaths`,
|
|
65
|
+
* which is about the pages this component's document *names*.
|
|
67
66
|
*/
|
|
68
67
|
paths?: boolean;
|
|
69
68
|
}
|
|
@@ -71,18 +70,18 @@ export interface PathOptions extends ReadOptions {
|
|
|
71
70
|
/** A site's `rootNodeId` (from `listSites`). Required from a browser — the server's `Host` inference can only fire for a request arriving on the site's own hostname. */
|
|
72
71
|
site?: string;
|
|
73
72
|
/**
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
73
|
+
* The hostname (no port) the page is served under — for a `localeHost` site, where the host *is*
|
|
74
|
+
* the locale. The server turns it into the site and the locale in one lookup, so send it
|
|
75
|
+
* **instead of** `site` and `locale`. A query parameter rather than the `Host` header, because
|
|
76
|
+
* every request to the API arrives with the API's own host.
|
|
78
77
|
*/
|
|
79
78
|
host?: string;
|
|
80
79
|
}
|
|
81
80
|
/**
|
|
82
|
-
* Options for `queryStream
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
81
|
+
* Options for `queryStream`. The public surface is deliberately small — the stream's own
|
|
82
|
+
* definition carries the source set, order, exclusions, projection, and expansion depth; a caller
|
|
83
|
+
* supplies only paging, locale/ctx, and values for the filters the stream *declares* (an
|
|
84
|
+
* undeclared key is `400 validation_failed`).
|
|
86
85
|
*/
|
|
87
86
|
export interface QueryStreamOptions extends RequestOptions, CurrentSiteOption {
|
|
88
87
|
/** BCP-47 code — locale resolution plus the paths locale slot, the `listComponents` semantics. */
|
|
@@ -99,10 +98,10 @@ export interface QueryStreamOptions extends RequestOptions, CurrentSiteOption {
|
|
|
99
98
|
referencePaths?: boolean;
|
|
100
99
|
}
|
|
101
100
|
/**
|
|
102
|
-
* Options for `getStreamFacet
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
101
|
+
* Options for `getStreamFacet`. Deliberately no `ctx` — a context bag only ever affects content
|
|
102
|
+
* resolution, never row membership, so it cannot change a facet count. `filters` should carry every
|
|
103
|
+
* OTHER currently active filter — the target field's own value, if present, is silently excluded
|
|
104
|
+
* server-side (a facet never narrows itself).
|
|
106
105
|
*/
|
|
107
106
|
export interface StreamFacetOptions extends RequestOptions {
|
|
108
107
|
locale?: string;
|
|
@@ -132,7 +131,7 @@ export interface ListComponentsOptions extends ReadOptions, CurrentSiteOption {
|
|
|
132
131
|
* `{siteRootNodeId, path}` per live published node whose root Presentation payload binds the
|
|
133
132
|
* component (one level; a component referenced only inside another component's fields gets
|
|
134
133
|
* `[]`). Paths are relative and read live per request; `locale` selects the path's locale
|
|
135
|
-
* slot. Composes with `content` or works alone
|
|
134
|
+
* slot. Composes with `content` or works alone.
|
|
136
135
|
*/
|
|
137
136
|
paths?: boolean;
|
|
138
137
|
/**
|
|
@@ -146,7 +145,7 @@ export interface ListComponentsOptions extends ReadOptions, CurrentSiteOption {
|
|
|
146
145
|
direction?: 'asc' | 'desc';
|
|
147
146
|
}
|
|
148
147
|
/**
|
|
149
|
-
*
|
|
148
|
+
* `GET /sitemap`.
|
|
150
149
|
*
|
|
151
150
|
* Pass **both** `site` and `env` for an edge-cacheable response: without an explicit `site` the
|
|
152
151
|
* server's answer depends on the request `Host` as well as the URL, so it deliberately declines to
|
|
@@ -160,8 +159,8 @@ export interface SitemapOptions extends RequestOptions {
|
|
|
160
159
|
env?: string;
|
|
161
160
|
}
|
|
162
161
|
/**
|
|
163
|
-
*
|
|
164
|
-
*
|
|
162
|
+
* `GET /nodes`. Every option is optional: with none of them, the request is the whole tree of the
|
|
163
|
+
* site the request `Host` maps to.
|
|
165
164
|
*/
|
|
166
165
|
export interface ListNodesOptions extends RequestOptions {
|
|
167
166
|
/** Site root node id, from `listSites`. Omitted, the server infers it from the request Host. */
|
|
@@ -174,10 +173,10 @@ export interface ListNodesOptions extends RequestOptions {
|
|
|
174
173
|
maxDepth?: number;
|
|
175
174
|
/**
|
|
176
175
|
* Refused when `from` is a path under a site with a locale addressing strategy
|
|
177
|
-
* (`400 locale_not_addressable
|
|
176
|
+
* (`400 locale_not_addressable`) — the path's own prefix or host says the locale.
|
|
178
177
|
*/
|
|
179
178
|
locale?: string;
|
|
180
|
-
/**
|
|
179
|
+
/** The hostname a `localeHost` site serves, for a path-shaped `from` — see `PathOptions.host`. */
|
|
181
180
|
host?: string;
|
|
182
181
|
}
|
|
183
182
|
/** One method per endpoint of `/content/delivery/v1`, nothing opinionated — see `createContentClient` for the layer above. */
|
|
@@ -186,18 +185,18 @@ export interface DeliveryClient {
|
|
|
186
185
|
listSites(options?: SitesAndLocalesOptions): Promise<SiteSummary[]>;
|
|
187
186
|
listLocales(options?: SitesAndLocalesOptions): Promise<LocaleTreeNode[]>;
|
|
188
187
|
resolvePath(path: string, options?: PathOptions): Promise<PathResult>;
|
|
189
|
-
/** The published Experience tree, for navigation — `GET /nodes
|
|
188
|
+
/** The published Experience tree, for navigation — `GET /nodes`. */
|
|
190
189
|
listNodes(options?: ListNodesOptions): Promise<NavigationResult>;
|
|
191
190
|
/**
|
|
192
|
-
* The data a sitemap is built from — `GET /sitemap
|
|
193
|
-
*
|
|
191
|
+
* The data a sitemap is built from — `GET /sitemap`. Pair it with `buildSitemapXml` from
|
|
192
|
+
* `@ebitex/content-sdk/sitemap`; serving the result at a URL is yours.
|
|
194
193
|
*/
|
|
195
194
|
getSitemap(options?: SitemapOptions): Promise<SitemapResult>;
|
|
196
195
|
getComponent(provider: string, key: string, options?: GetComponentOptions): Promise<ExpandedReference>;
|
|
197
196
|
listComponents(options: ListComponentsOptions): Promise<ComponentPage>;
|
|
198
|
-
/** One page of an authored stream — `GET /streams/{stream}
|
|
197
|
+
/** One page of an authored stream — `GET /streams/{stream}`; `stream` is the external id (or Guid). */
|
|
199
198
|
queryStream(stream: string, options?: QueryStreamOptions): Promise<StreamPage>;
|
|
200
|
-
/** `{value, label, count}` triples for one of the stream's own declared filters — `GET /streams/{stream}/facets
|
|
199
|
+
/** `{value, label, count}` triples for one of the stream's own declared filters — `GET /streams/{stream}/facets`. Every declared filter kind except `fullText` is facetable. */
|
|
201
200
|
getStreamFacet(stream: string, field: string, options?: StreamFacetOptions): Promise<StreamFacetResult>;
|
|
202
201
|
/** Every Contract's delivered-shape JSON Schema, self-contained — see `cli/codegen.ts` for the typed-consumer story built on this. */
|
|
203
202
|
getSchemaBundle(options?: RequestOptions): Promise<SchemaBundle>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/delivery/client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,UAAU,EACX,MAAM,aAAa,CAAA;AAGpB,MAAM,WAAW,qBAAqB;IACpC;;;;;;OAMG;IACH,MAAM,EAAE,MAAM,CAAA;IAEd,2FAA2F;IAC3F,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB,uEAAuE;IACvE,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAA;CAChC;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB;AAED
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/delivery/client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,UAAU,EACX,MAAM,aAAa,CAAA;AAGpB,MAAM,WAAW,qBAAqB;IACpC;;;;;;OAMG;IACH,MAAM,EAAE,MAAM,CAAA;IAEd,2FAA2F;IAC3F,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB,uEAAuE;IACvE,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAA;CAChC;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,WAAW,C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F"}
|
package/dist/delivery/client.js
CHANGED
|
@@ -145,7 +145,7 @@ async function readBody(response) {
|
|
|
145
145
|
return null;
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
/** The request's reference
|
|
148
|
+
/** The request's reference: the `X-Request-Id` header first; an unhandled `500` also carries `requestId` in its body. */
|
|
149
149
|
function readRequestId(response, body) {
|
|
150
150
|
const header = response.headers.get('X-Request-Id');
|
|
151
151
|
if (header) {
|