@ebitex/content-sdk 0.20.90 → 0.20.92
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 -0
- 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 +2 -2
package/README.md
CHANGED
|
@@ -59,6 +59,8 @@ A Template with no renderer, an unpublished reference, a binding that needs serv
|
|
|
59
59
|
resolution — each renders a panel naming the reason and the fix, so a missing piece is visible,
|
|
60
60
|
never silent.
|
|
61
61
|
|
|
62
|
+
Full guide and reference: [developers.ebitex.io](https://developers.ebitex.io/getting-started/static-site/).
|
|
63
|
+
|
|
62
64
|
Worked examples: the [ebitex samples](https://github.com/ebitex-io/samples) repository has two
|
|
63
65
|
complete Northwind Coffee sites built on this package, one static and one server-rendered, each
|
|
64
66
|
with the content model it expects.
|
package/dist/cli/codegen.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `content-sdk codegen` —
|
|
3
|
-
* `
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* consumer's file to commit or gitignore, this CLI never watches or caches anything itself.
|
|
2
|
+
* `content-sdk codegen` — the build-time consumer of `GET /content/delivery/v1/schemas`.
|
|
3
|
+
* `bin/content-sdk-codegen.js` is the published entry point; this module holds the logic. Fetches
|
|
4
|
+
* the bundle for one delivery key/environment and writes one `.d.ts` module — run it manually or
|
|
5
|
+
* from your own `pre*` npm script. The output is your file to commit or gitignore; the CLI never
|
|
6
|
+
* watches or caches anything itself.
|
|
8
7
|
*/
|
|
9
8
|
export interface CodegenOptions {
|
|
10
9
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codegen.d.ts","sourceRoot":"","sources":["../../src/cli/codegen.ts"],"names":[],"mappings":"AAKA
|
|
1
|
+
{"version":3,"file":"codegen.d.ts","sourceRoot":"","sources":["../../src/cli/codegen.ts"],"names":[],"mappings":"AAKA;;;;;;GAMG;AAEH,MAAM,WAAW,cAAc;IAC7B;;;;;OAKG;IACH,GAAG,EAAE,MAAM,CAAA;IACX,mFAAmF;IACnF,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,iDAAiD;IACjD,GAAG,EAAE,MAAM,CAAA;IACX,8BAA8B;IAC9B,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAA;CAChC;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAQvE;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,cAAc,CAmCjE;AAED,uJAAuJ;AACvJ,qBAAa,gBAAiB,SAAQ,KAAK;gBAC7B,OAAO,EAAE,MAAM;CAI5B"}
|
package/dist/cli/codegen.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codegen.js","sourceRoot":"","sources":["../../src/cli/codegen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAA;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"codegen.js","sourceRoot":"","sources":["../../src/cli/codegen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAA;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AA0B1C,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,OAAuB;IACtD,MAAM,MAAM,GAAG,oBAAoB,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAA;IAC5G,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,eAAe,EAAE,CAAA;IAC7C,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,CAAA;IAEhC,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IACxC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IAChD,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;AACxC,CAAC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OAAO,gBAAiB,SAAQ,KAAK;IACzC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAA;IAChC,CAAC;CACF"}
|
package/dist/cli/emitTypes.d.ts
CHANGED
|
@@ -2,19 +2,17 @@ import type { SchemaBundle } from '../types.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* Translates a `SchemaBundle` (from `GET /content/delivery/v1/schemas`) into one TypeScript module
|
|
4
4
|
* source string — one `export interface` per Contract, `$ref`s resolved to local interface
|
|
5
|
-
* references within this same file (
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* `
|
|
9
|
-
*
|
|
10
|
-
* defined translation here.
|
|
5
|
+
* references within this same file (one file, not one per Contract). Not a general
|
|
6
|
+
* JSON-Schema-to-TypeScript translator — it recognizes exactly the shapes the Delivery API's schema
|
|
7
|
+
* compiler produces (`type`/`properties`/`required`, `items`, `oneOf`, `$ref`, `const`, and a
|
|
8
|
+
* `type` array for a nullable primitive) and falls back to `unknown` for anything else, since a
|
|
9
|
+
* hand-authored or future schema shape outside that set has no defined translation here.
|
|
11
10
|
*
|
|
12
11
|
* Where the server says which **named SDK type** a field delivers (`x-deliveredType`), that name is
|
|
13
12
|
* emitted in place of the structure, and the names used are collected into one `import type` at the
|
|
14
|
-
* top.
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* SDK's own React components without a cast at every seam.
|
|
13
|
+
* top. A structural approximation such as `{ provider; key; content?: T } | { contract; content: T }`
|
|
14
|
+
* is not assignable to `ComponentValue<T>`, so emitting the SDK's own type is what lets generated
|
|
15
|
+
* types be handed to the SDK's React components without a cast at every seam.
|
|
18
16
|
*/
|
|
19
17
|
export declare function emitTypes(bundle: SchemaBundle): string;
|
|
20
18
|
//# sourceMappingURL=emitTypes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emitTypes.d.ts","sourceRoot":"","sources":["../../src/cli/emitTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,YAAY,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"emitTypes.d.ts","sourceRoot":"","sources":["../../src/cli/emitTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkB,YAAY,EAAE,MAAM,aAAa,CAAA;AA2B/D;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CA4CtD"}
|
package/dist/cli/emitTypes.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The `@ebitex/content-sdk` types a field's delivered value may *be*, named by the server's
|
|
3
|
-
* `x-deliveredType` annotation
|
|
3
|
+
* `x-deliveredType` annotation.
|
|
4
4
|
*
|
|
5
5
|
* A closed set, on purpose. Emitting whatever name the server sent, unchecked, would produce an
|
|
6
6
|
* import that does not resolve the first time a newer server learns a shape this SDK version has no
|
|
7
|
-
* type for. Not recognizing a name instead falls through to the structural description
|
|
8
|
-
*
|
|
9
|
-
* against a newer server degrades to yesterday's output rather than to a broken file.
|
|
7
|
+
* type for. Not recognizing a name instead falls through to the structural description, so an older
|
|
8
|
+
* SDK against a newer server degrades to a structural type rather than to a broken file.
|
|
10
9
|
*
|
|
11
10
|
* `generic` is whether the type takes a content type argument (`ComponentValue<Image>`), so that a
|
|
12
11
|
* bare name is emitted when the server reports no content targets rather than `ComponentValue<>` or
|
|
@@ -25,19 +24,17 @@ const SDK_PACKAGE = '@ebitex/content-sdk';
|
|
|
25
24
|
/**
|
|
26
25
|
* Translates a `SchemaBundle` (from `GET /content/delivery/v1/schemas`) into one TypeScript module
|
|
27
26
|
* source string — one `export interface` per Contract, `$ref`s resolved to local interface
|
|
28
|
-
* references within this same file (
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* `
|
|
32
|
-
*
|
|
33
|
-
* defined translation here.
|
|
27
|
+
* references within this same file (one file, not one per Contract). Not a general
|
|
28
|
+
* JSON-Schema-to-TypeScript translator — it recognizes exactly the shapes the Delivery API's schema
|
|
29
|
+
* compiler produces (`type`/`properties`/`required`, `items`, `oneOf`, `$ref`, `const`, and a
|
|
30
|
+
* `type` array for a nullable primitive) and falls back to `unknown` for anything else, since a
|
|
31
|
+
* hand-authored or future schema shape outside that set has no defined translation here.
|
|
34
32
|
*
|
|
35
33
|
* Where the server says which **named SDK type** a field delivers (`x-deliveredType`), that name is
|
|
36
34
|
* emitted in place of the structure, and the names used are collected into one `import type` at the
|
|
37
|
-
* top.
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* SDK's own React components without a cast at every seam.
|
|
35
|
+
* top. A structural approximation such as `{ provider; key; content?: T } | { contract; content: T }`
|
|
36
|
+
* is not assignable to `ComponentValue<T>`, so emitting the SDK's own type is what lets generated
|
|
37
|
+
* types be handed to the SDK's React components without a cast at every seam.
|
|
41
38
|
*/
|
|
42
39
|
export function emitTypes(bundle) {
|
|
43
40
|
const nameByKey = buildNameMap(bundle);
|
|
@@ -86,8 +83,7 @@ const GENERATED_HEADER = '// Generated by `content-sdk codegen` — do not edit
|
|
|
86
83
|
* (`raw=true` does the same for locale envelopes). A consumer generating types and then calling in
|
|
87
84
|
* one of those modes gets an object where the type promises a value, with no discriminator to
|
|
88
85
|
* notice — so the assumption is stated in the file rather than left to be discovered against a live
|
|
89
|
-
* response
|
|
90
|
-
* the bundle.
|
|
86
|
+
* response. Fields that actually differ carry `x-personalizable`/`x-localizable` in the bundle.
|
|
91
87
|
*
|
|
92
88
|
* Older servers send no `x-deliveryMode`; the note is simply omitted rather than guessed at.
|
|
93
89
|
*/
|
|
@@ -110,7 +106,7 @@ function generatedHeader(bundle) {
|
|
|
110
106
|
* either way rather than silently overwriting one interface with another of the same name.
|
|
111
107
|
*
|
|
112
108
|
* Disambiguation is first-wins, so the iteration order decides *which* entry keeps the bare name —
|
|
113
|
-
* which is why it is `orderedForNaming`'s deterministic order and not the bundle's own
|
|
109
|
+
* which is why it is `orderedForNaming`'s deterministic order and not the bundle's own.
|
|
114
110
|
*/
|
|
115
111
|
function buildNameMap(bundle) {
|
|
116
112
|
const claimedBy = new Map();
|
|
@@ -135,7 +131,7 @@ function buildNameMap(bundle) {
|
|
|
135
131
|
}
|
|
136
132
|
/**
|
|
137
133
|
* The order `buildNameMap` assigns names in — deliberately a different question from the order
|
|
138
|
-
* types are emitted in, and so a different sort
|
|
134
|
+
* types are emitted in, and so a different sort.
|
|
139
135
|
*
|
|
140
136
|
* `(base name, version DESCENDING, key)`. Version descending is the load-bearing part: name
|
|
141
137
|
* disambiguation is first-wins, so this is what makes the bare `Coffee` always the **latest**
|
|
@@ -248,7 +244,7 @@ function schemaToType(schema, nameByKey, imported) {
|
|
|
248
244
|
return 'unknown';
|
|
249
245
|
}
|
|
250
246
|
/**
|
|
251
|
-
* Reads
|
|
247
|
+
* Reads the `x-deliveredType`/`x-contentRefs` pair, if present and recognized.
|
|
252
248
|
*
|
|
253
249
|
* `x-contentRefs` names the `$defs` keys this value's `content` resolves to — one for an unambiguous
|
|
254
250
|
* binding, several for a field whose real published usages spread across Contracts (an Adapter, or a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emitTypes.js","sourceRoot":"","sources":["../../src/cli/emitTypes.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"emitTypes.js","sourceRoot":"","sources":["../../src/cli/emitTypes.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAA+B;IAChE,CAAC,gBAAgB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IACrC,CAAC,aAAa,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAClC,CAAC,sBAAsB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3C,CAAC,eAAe,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAA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O,GAAG,IAAI;SACjB,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;SACxE,MAAM,CAAC,CAAC,IAAI,EAAkB,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC,CAAA;IAEvD,OAAO;QACL,IAAI,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ;QAC3E,UAAU,EAAE,QAAQ;KACrB,CAAA;AACH,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { LocaleTreeNode, SiteAddressing } from '../types.js';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* the
|
|
5
|
-
*
|
|
3
|
+
* The pure half of how the SDK addresses a site whose locale lives in the address. No I/O here:
|
|
4
|
+
* the client supplies the site's `addressing` (from `GET /sites`) and the locale tree (from
|
|
5
|
+
* `GET /locales`), and these decide.
|
|
6
6
|
*
|
|
7
|
-
* The rule
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
7
|
+
* The rule this rests on: **if a node's address varies by locale, the locale is determined by the
|
|
8
|
+
* address.** So under a non-`invariant` site the SDK never *chooses* a locale for `/path` — the
|
|
9
|
+
* path's prefix or the page's host already says it, and the server refuses a `locale=` beside it.
|
|
10
|
+
* The client still needs to *know* that locale, for the calls that have no address to carry one (a
|
|
11
|
+
* component, a list, a stream) and for its own cache keys; that is what these functions derive.
|
|
12
12
|
*/
|
|
13
13
|
/** A strategy the SDK acts on. `invariant` is never one: an absent member and an explicit `invariant` are the same thing. */
|
|
14
14
|
export type ActiveAddressing = Exclude<SiteAddressing, {
|
|
@@ -23,7 +23,7 @@ export type ActiveAddressing = Exclude<SiteAddressing, {
|
|
|
23
23
|
export declare function activeAddressing(site: {
|
|
24
24
|
addressing?: unknown;
|
|
25
25
|
} | undefined): ActiveAddressing | undefined;
|
|
26
|
-
/** The organization's root locale — `GET /locales`' own root, the locale the `default` slot speaks for
|
|
26
|
+
/** The organization's root locale — `GET /locales`' own root, the locale the `default` slot speaks for. */
|
|
27
27
|
export declare function rootLocale(tree: readonly LocaleTreeNode[]): string | undefined;
|
|
28
28
|
/**
|
|
29
29
|
* `pathPrefix`: the leading segment when it names a locale in the tree (case-insensitive, returned
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addressing.d.ts","sourceRoot":"","sources":["../../src/content/addressing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjE;;;;;;;;;;GAUG;AAEH,6HAA6H;AAC7H,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,cAAc,EAAE;IAAE,QAAQ,EAAE,WAAW,CAAA;CAAE,CAAC,CAAA;AAEjF;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,GAAG,gBAAgB,GAAG,SAAS,CAuBzG;AAED,
|
|
1
|
+
{"version":3,"file":"addressing.d.ts","sourceRoot":"","sources":["../../src/content/addressing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjE;;;;;;;;;;GAUG;AAEH,6HAA6H;AAC7H,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,cAAc,EAAE;IAAE,QAAQ,EAAE,WAAW,CAAA;CAAE,CAAC,CAAA;AAEjF;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,GAAG,gBAAgB,GAAG,SAAS,CAuBzG;AAED,2GAA2G;AAC3G,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,cAAc,EAAE,GAAG,MAAM,GAAG,SAAS,CAE9E;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,cAAc,EAAE,GAAG,MAAM,GAAG,SAAS,CAWtG;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,UAAU,EAAE,OAAO,CAAC,gBAAgB,EAAE;IAAE,QAAQ,EAAE,YAAY,CAAA;CAAE,CAAC,EACjE,QAAQ,EAAE,MAAM,GAAG,SAAS,GAC3B,MAAM,GAAG,SAAS,CAOpB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,UAAU,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAMzG"}
|
|
@@ -22,7 +22,7 @@ export function activeAddressing(site) {
|
|
|
22
22
|
}
|
|
23
23
|
return undefined;
|
|
24
24
|
}
|
|
25
|
-
/** The organization's root locale — `GET /locales`' own root, the locale the `default` slot speaks for
|
|
25
|
+
/** The organization's root locale — `GET /locales`' own root, the locale the `default` slot speaks for. */
|
|
26
26
|
export function rootLocale(tree) {
|
|
27
27
|
return tree.find((node) => node.parentCode === null)?.code;
|
|
28
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addressing.js","sourceRoot":"","sources":["../../src/content/addressing.ts"],"names":[],"mappings":"AAiBA;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAA0C;IACzE,MAAM,UAAU,GAAG,IAAI,EAAE,UAAU,CAAA;IACnC,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;QAC1D,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,MAAM,SAAS,GAAG,UAAqC,CA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W,EAAE,KAAK,MAAM,CAAC,CAAA;QACrE,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO,KAAK,CAAC,IAAI,CAAA;QACnB,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAC,IAAI,CAAC,CAAA;AACzB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAC3B,UAAiE,EACjE,QAA4B;IAE5B,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,MAAM,MAAM,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAA;IACrC,OAAO,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC,EAAE,MAAM,CAAA;AACtF,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,UAAU,CAAC,UAA4B,EAAE,QAA4B;IACnF,IAAI,UAAU,CAAC,QAAQ,KAAK,YAAY,EAAE,CAAC;QACzC,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,OAAO,QAAQ,CAAC,CAAC,CAAC,SAAS,QAAQ,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;AACjE,CAAC"}
|
package/dist/content/cache.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A keyed in-memory cache with in-flight de-duplication and per-subscriber cancellation
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
2
|
+
* A keyed in-memory cache with in-flight de-duplication and per-subscriber cancellation. One entry
|
|
3
|
+
* per full request identity; concurrent callers for one key share one underlying request. Each
|
|
4
|
+
* caller may pass its own `AbortSignal`: aborting it rejects *that caller's* promise immediately,
|
|
5
|
+
* and the shared request is aborted only once every subscriber has gone — so a navigation
|
|
6
|
+
* superseded mid-flight never populates the cache, while a second component still waiting on the
|
|
7
|
+
* same key isn't cancelled by the first one leaving.
|
|
8
8
|
*/
|
|
9
9
|
export interface CacheOptions {
|
|
10
10
|
maxEntries?: number;
|
|
11
11
|
/**
|
|
12
|
-
* Opt-in persistent stale-while-revalidate layer
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
12
|
+
* Opt-in persistent stale-while-revalidate layer: a successful `presentation`/reference resolve is
|
|
13
|
+
* written to `localStorage`, and `peekLocation`/`peekReference` read it back synchronously so a
|
|
14
|
+
* repeat visit's first paint is real content instead of a loading state. Off by default — an
|
|
15
|
+
* unconfigured client's behavior (including in Node) is unchanged. `true` uses the defaults
|
|
16
|
+
* (`maxAgeMs`: 24h, `maxEntries`: 20); an object overrides either.
|
|
17
17
|
*/
|
|
18
18
|
persist?: boolean | {
|
|
19
19
|
maxAgeMs?: number;
|
|
@@ -27,11 +27,11 @@ export declare class RequestCache {
|
|
|
27
27
|
/** Resolves `key` via `factory` (given the shared signal) unless already cached or in flight. */
|
|
28
28
|
getOrCreate<T>(key: string, factory: (signal: AbortSignal) => Promise<T>, signal?: AbortSignal): Promise<T>;
|
|
29
29
|
/**
|
|
30
|
-
* Inserts an already-settled entry (
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
30
|
+
* Inserts an already-settled entry (cache seeding) — a response that already contains an expanded
|
|
31
|
+
* child primes that child's own cache entry, so a later `resolveReference`/traversal for it is a
|
|
32
|
+
* hit with no network request. Participates in LRU like any fetched entry. Overwrites whatever was
|
|
33
|
+
* there (an in-flight entry's own already-issued promises are unaffected — they hold their own
|
|
34
|
+
* reference — only future lookups for the key see the seeded value).
|
|
35
35
|
*/
|
|
36
36
|
seed(key: string, value: unknown): void;
|
|
37
37
|
/** Drops one key, or everything. */
|
package/dist/content/cache.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A keyed in-memory cache with in-flight de-duplication and per-subscriber cancellation
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
2
|
+
* A keyed in-memory cache with in-flight de-duplication and per-subscriber cancellation. One entry
|
|
3
|
+
* per full request identity; concurrent callers for one key share one underlying request. Each
|
|
4
|
+
* caller may pass its own `AbortSignal`: aborting it rejects *that caller's* promise immediately,
|
|
5
|
+
* and the shared request is aborted only once every subscriber has gone — so a navigation
|
|
6
|
+
* superseded mid-flight never populates the cache, while a second component still waiting on the
|
|
7
|
+
* same key isn't cancelled by the first one leaving.
|
|
8
8
|
*/
|
|
9
9
|
export class RequestCache {
|
|
10
10
|
entries = new Map();
|
|
@@ -42,11 +42,11 @@ export class RequestCache {
|
|
|
42
42
|
return this.subscribe(entry, key, signal);
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
|
-
* Inserts an already-settled entry (
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
45
|
+
* Inserts an already-settled entry (cache seeding) — a response that already contains an expanded
|
|
46
|
+
* child primes that child's own cache entry, so a later `resolveReference`/traversal for it is a
|
|
47
|
+
* hit with no network request. Participates in LRU like any fetched entry. Overwrites whatever was
|
|
48
|
+
* there (an in-flight entry's own already-issued promises are unaffected — they hold their own
|
|
49
|
+
* reference — only future lookups for the key see the seeded value).
|
|
50
50
|
*/
|
|
51
51
|
seed(key, value) {
|
|
52
52
|
const entry = { controller: new AbortController(), subscribers: 0, settled: true, promise: Promise.resolve(value) };
|
package/dist/content/client.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { ComponentValue, ContentDocument, ContextBag, ExpandedReference, Lo
|
|
|
3
3
|
import { type CacheOptions } from './cache.js';
|
|
4
4
|
import { type NavigationTree } from './navigation.js';
|
|
5
5
|
import { type ResolveStrategy } from './strategy.js';
|
|
6
|
-
/**
|
|
6
|
+
/** What a navigation query asks for, relative to its anchor. */
|
|
7
7
|
export interface NavigationOptions {
|
|
8
8
|
/** Defaults to the whole subtree (`['self', 'descendants']`, the server's own default). */
|
|
9
9
|
include?: readonly NavigationInclude[];
|
|
@@ -13,11 +13,11 @@ export interface NavigationOptions {
|
|
|
13
13
|
fresh?: boolean;
|
|
14
14
|
signal?: AbortSignal;
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
16
|
+
* The page this navigation is for, under a site with a locale addressing strategy. It supplies the
|
|
17
|
+
* host a `localeHost` site needs for a path anchor, and the locale a node-id (or absent) anchor is
|
|
18
|
+
* asked in. Defaults to the browser's own location, so a browser never needs it; a server must pass
|
|
19
|
+
* the request's URL, since the SDK never reads a forwarded host (which proxy header can be trusted
|
|
20
|
+
* is a fact about your deployment). Ignored for an `invariant` site.
|
|
21
21
|
*/
|
|
22
22
|
location?: LocationLike;
|
|
23
23
|
}
|
|
@@ -38,33 +38,29 @@ export interface ContentClientOptions extends DeliveryClientOptions {
|
|
|
38
38
|
context?: ContextBag | (() => ContextBag | Promise<ContextBag>);
|
|
39
39
|
/**
|
|
40
40
|
* Default `{ strategy: 'adaptive' }` — `full` for the first *location* this client instance
|
|
41
|
-
* resolves (and every later resolve of it), `normalized` (depth 1) for any other
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* every path for the life of the process.
|
|
41
|
+
* resolves (and every later resolve of it), `normalized` (depth 1) for any other. **In Node,
|
|
42
|
+
* always `full`**: `normalized` trades depth for on-demand fetches that only a browser can make,
|
|
43
|
+
* and one server-side client instance serves every path for the life of the process.
|
|
45
44
|
*/
|
|
46
45
|
resolve?: ResolveStrategy;
|
|
47
46
|
/** In-memory cache of resolved results (default 50 entries, LRU); `false` disables it. */
|
|
48
47
|
cache?: CacheOptions | false;
|
|
49
48
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* edge-cache-eligible from a session's first request rather than only its second.
|
|
49
|
+
* The delivery environment id, known ahead of time (e.g. a build-time constant) — sent as `env=` on
|
|
50
|
+
* the very first `/sites`/`/locales` request of the session, not only on requests made after a
|
|
51
|
+
* live `/sites` response has revealed it. Doesn't suppress either call (both still fire on every
|
|
52
|
+
* load) — it only lets them carry `env=` sooner, which is what makes them edge-cache-eligible from
|
|
53
|
+
* a session's first request rather than only its second.
|
|
56
54
|
*/
|
|
57
55
|
env?: string;
|
|
58
56
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* option existed, down to its persisted cache keys.
|
|
57
|
+
* Ask every read to attach each reference descriptor's own published address(es) (`paths`), so a
|
|
58
|
+
* document that references another *page* can link to it with no second query. Off by default;
|
|
59
|
+
* with it off, responses and persisted cache keys are unaffected.
|
|
63
60
|
*
|
|
64
61
|
* Deliberately a **client-level** option rather than a per-call one: the resolved shape is part
|
|
65
62
|
* of the cache key, so a per-call flag would split two callers resolving the same location into
|
|
66
|
-
* two requests
|
|
67
|
-
* does not.
|
|
63
|
+
* two requests. A site either wants linkable references or does not.
|
|
68
64
|
*/
|
|
69
65
|
referencePaths?: boolean;
|
|
70
66
|
}
|
|
@@ -82,7 +78,7 @@ export interface ResolvedSite {
|
|
|
82
78
|
rootNodeId: string;
|
|
83
79
|
name?: string;
|
|
84
80
|
hosts?: string[];
|
|
85
|
-
/**
|
|
81
|
+
/** Present when the site was looked up from `GET /sites` and has a locale addressing strategy. */
|
|
86
82
|
addressing?: SiteAddressing;
|
|
87
83
|
}
|
|
88
84
|
export interface PresentationExperience {
|
|
@@ -90,17 +86,17 @@ export interface PresentationExperience {
|
|
|
90
86
|
nodeId: string;
|
|
91
87
|
path: string;
|
|
92
88
|
/**
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
* {@link ContentClient.peekLocation}
|
|
89
|
+
* The title the CMS computed for this address, carried straight through from the delivery
|
|
90
|
+
* response. See {@link PresentationPathResult.title}; the same absences apply here, plus one of
|
|
91
|
+
* this layer's own: an entry persisted by an older SDK and read back through
|
|
92
|
+
* {@link ContentClient.peekLocation} may lack it.
|
|
97
93
|
*/
|
|
98
94
|
title?: string;
|
|
99
95
|
titleSource?: 'content' | 'name';
|
|
100
96
|
/**
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
97
|
+
* The locale slot the path was found in, carried through from the delivery response. Present only
|
|
98
|
+
* for a site with a locale addressing strategy, and `default` when the locale's own slot is not
|
|
99
|
+
* materialized yet.
|
|
104
100
|
*/
|
|
105
101
|
localeSlot?: string;
|
|
106
102
|
presentation: PresentationEnvelope;
|
|
@@ -108,8 +104,8 @@ export interface PresentationExperience {
|
|
|
108
104
|
/**
|
|
109
105
|
* The locale this page was resolved in. For an `invariant` site, the one the client chose (the
|
|
110
106
|
* `locale` option, else the browser's languages) and sent. For a site with a locale addressing
|
|
111
|
-
* strategy
|
|
112
|
-
*
|
|
107
|
+
* strategy, the one the **address** names — its prefix or its host — as the server reports it:
|
|
108
|
+
* set `<html lang>` from this. `undefined` only when nothing names one.
|
|
113
109
|
*/
|
|
114
110
|
locale: string | undefined;
|
|
115
111
|
strategy: ResolveStrategy;
|
|
@@ -127,14 +123,14 @@ export interface NotFoundExperience {
|
|
|
127
123
|
export type ExperienceResult = PresentationExperience | RedirectExperience | NotFoundExperience;
|
|
128
124
|
/**
|
|
129
125
|
* A path, a full URL, a `URL`, or any `{ pathname }` — a react-router location, `window.location`.
|
|
130
|
-
* `hostname` is read, when present, only for a `localeHost` site
|
|
131
|
-
*
|
|
126
|
+
* `hostname` is read, when present, only for a `localeHost` site, where the host is the locale; a
|
|
127
|
+
* bare path then falls back to the browser's own hostname.
|
|
132
128
|
*/
|
|
133
129
|
export type LocationLike = string | URL | {
|
|
134
130
|
pathname: string;
|
|
135
131
|
hostname?: string;
|
|
136
132
|
};
|
|
137
|
-
/** A persisted `resolveLocation` result
|
|
133
|
+
/** A persisted `resolveLocation` result — only ever a `presentation`; a redirect or not-found result is never persisted. */
|
|
138
134
|
export interface PersistedExperience {
|
|
139
135
|
result: PresentationExperience;
|
|
140
136
|
/** When it was written, epoch ms. */
|
|
@@ -142,8 +138,8 @@ export interface PersistedExperience {
|
|
|
142
138
|
}
|
|
143
139
|
/**
|
|
144
140
|
* A persisted `resolveReference` result. Generic over the target's content for the same reason
|
|
145
|
-
* `peekReference` is
|
|
146
|
-
*
|
|
141
|
+
* `peekReference` is: discarding the parameter at the wrapper would put the cast back one level
|
|
142
|
+
* in, for exactly the consumers who use the fetch and the peek together.
|
|
147
143
|
*/
|
|
148
144
|
export interface PersistedReference<TContent = ContentDocument> {
|
|
149
145
|
result: ExpandedReference<TContent>;
|
|
@@ -157,10 +153,10 @@ export type ReferenceLike = {
|
|
|
157
153
|
};
|
|
158
154
|
/**
|
|
159
155
|
* Identifies the fetch that produced the value a `resolveReference` caller is walking — an Adapter
|
|
160
|
-
* is edge data
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
156
|
+
* is edge data, so only a resolve of the document *containing* the edge can apply it. `location`:
|
|
157
|
+
* a page, resolved via `resolveLocation`. `component`: an already-resolved Component, re-resolved
|
|
158
|
+
* via `getComponent` — the shape a nested field, or a standalone fetch outside any page (e.g. a
|
|
159
|
+
* header/footer Component fetched by external id), both produce.
|
|
164
160
|
*/
|
|
165
161
|
export type OwnerRef = {
|
|
166
162
|
kind: 'location';
|
|
@@ -179,20 +175,19 @@ export interface ContentClient {
|
|
|
179
175
|
/**
|
|
180
176
|
* Resolves one unexpanded reference (the normalized strategy), applying the descriptor's own
|
|
181
177
|
* contextual overlay. An already-resolved value is returned as-is. `owner` identifies the fetch
|
|
182
|
-
* that produced this descriptor
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
* case.
|
|
178
|
+
* that produced this descriptor — required to resolve an Adapter-bearing descriptor, since only a
|
|
179
|
+
* resolve of the *owning* document can apply the edge's Adapter; omitted, an adapted descriptor
|
|
180
|
+
* throws `adapter_requires_server_resolve` (the low-level, owner-less contract). With an owner, the
|
|
181
|
+
* SDK resolves it at depth 1 first, escalating to `full` once (bounded, cached) if the edge is still
|
|
182
|
+
* unreached there — the case of a relayed Presentation nested one hop deeper.
|
|
188
183
|
*/
|
|
189
184
|
resolveReference<TContent = ContentDocument>(descriptor: ComponentValue, overrides?: ResolveOverrides, owner?: OwnerRef): Promise<ExpandedReference<TContent>>;
|
|
190
185
|
resolveSite(): Promise<ResolvedSite>;
|
|
191
186
|
resolveLocale(): Promise<string | undefined>;
|
|
192
187
|
/**
|
|
193
|
-
* The published Experience tree, for navigation
|
|
194
|
-
*
|
|
195
|
-
*
|
|
188
|
+
* The published Experience tree, for navigation — site and locale come from this client, so a
|
|
189
|
+
* consumer names only the anchor and what it wants relative to it. Cached, deduped, and persisted
|
|
190
|
+
* like every other resolve.
|
|
196
191
|
*
|
|
197
192
|
* `anchor` is a node Guid or a published path; omitted, the site root. Each named use case is one
|
|
198
193
|
* call: `['ancestors', 'self']` a breadcrumb, `['children']` a nav menu, `['siblings']` a pager.
|
|
@@ -206,8 +201,8 @@ export interface ContentClient {
|
|
|
206
201
|
readonly strategy: ResolveStrategy;
|
|
207
202
|
/**
|
|
208
203
|
* The persisted result of the last successful `resolveLocation` for this location, if any —
|
|
209
|
-
* synchronous, no request
|
|
210
|
-
*
|
|
204
|
+
* synchronous, no request. `undefined` when persistence is off, storage is unavailable, there is
|
|
205
|
+
* no entry, it has expired, or preview is activated.
|
|
211
206
|
*/
|
|
212
207
|
peekLocation(location: LocationLike): PersistedExperience | undefined;
|
|
213
208
|
/** The persisted result of the last successful `resolveReference` for this descriptor, if any — synchronous, no request. Same absence rules as `peekLocation`. `TContent` asserts, exactly as it does on `resolveReference`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/content/client.ts"],"names":[],"mappings":"AAAA,OA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