@contentful/experiences-client 0.2.0 → 0.3.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/CHANGELOG.md CHANGED
@@ -1,3 +1,100 @@
1
+ ## 0.3.0 (2026-08-07)
2
+
3
+ ### 🩹 Fixes
4
+
5
+ - ⚠️ bump @contentful/experience-delivery to 1.0.0-dev.6 + migrate to renamed API [AIS-339] ([#120](https://github.com/contentful/experiences/pull/120))
6
+
7
+ ### ⚠️ Breaking Changes
8
+
9
+ - bump @contentful/experience-delivery to 1.0.0-dev.6 + migrate to renamed API [AIS-339] ([#120](https://github.com/contentful/experiences/pull/120))
10
+ the public API uses the component / experienceTemplate vocabulary.
11
+ - `registration.componentTypeId` -> `registration.componentId`
12
+ - `plan.template` -> `plan.experienceTemplate`
13
+ - `PortableTemplate` -> `PortableExperienceTemplate` (`templateId` ->
14
+ `experienceTemplateId`)
15
+ - `Config.templates` -> `Config.experienceTemplates`; `Templates` ->
16
+ `ExperienceTemplates`
17
+ - `defineTemplate` -> `defineExperienceTemplate`; `TemplateConfig` ->
18
+ `ExperienceTemplateConfig`; `TemplateRegistration` ->
19
+ `ExperienceTemplateRegistration`; `normalizeTemplateRegistration` ->
20
+ `normalizeExperienceTemplateRegistration`
21
+ - `useContentfulTemplate()` / `getContentfulTemplate()` ->
22
+ `useContentfulExperienceTemplate()` / `getContentfulExperienceTemplate()`;
23
+ `ContentfulTemplate` -> `ContentfulExperienceTemplate`
24
+ - `MissingComponentProps.componentTypeId` -> `componentId`
25
+ - Core payload types: `ComponentTypeNode`/`ComponentTypeRef` ->
26
+ `ComponentNode`/`ComponentRef`; `TemplateNode`/`TemplateRef` ->
27
+ `ExperienceTemplateNode`/`ExperienceTemplateRef`
28
+ `packages/core` stays zero-dep, so its payload types are hand-mirrored from the
29
+ delivery package rather than imported; each carries a doc comment naming its
30
+ upstream counterpart, and `client:typecheck` catches drift when the delivery SDK
31
+ regenerates. Documented in AGENTS.md.
32
+ `examples/scripts/` is intentionally unchanged: it targets the management SDK
33
+ (`contentful-management`), which has its own entity-type surface, and adopting it
34
+ would require changing that dependency. The seed script therefore still
35
+ provisions the shapes that SDK produces.
36
+ Verified: build, typecheck, and 157 tests pass across all five packages.
37
+ Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
38
+ * docs: describe current state only in comments and docs
39
+ Drop ticket ids, tracker links, and before/after narrative from doc comments and
40
+ prose so they explain what the code does now rather than how it got here.
41
+ - `alpha-feature.ts`: state what the header selects and why it is required,
42
+ without the two-shapes-in-transition framing or the removal timeline.
43
+ - `core/src/types.ts`: keep each type's upstream counterpart in
44
+ `@contentful/experience-delivery` (load-bearing for maintenance) but drop the
45
+ "formerly known as" and old-link-type asides.
46
+ - README: replace the rename migration table with a description of the
47
+ alpha-feature header and when a caller needs to send it.
48
+ - AGENTS.md: reframe the rationale entries that opened on prior designs to state
49
+ the current design and its reason.
50
+ - Drop stale option-shape asides ("was nested under ...") and a test name that
51
+ described superseded behaviour.
52
+ Generated CHANGELOG.md files are untouched — they are release history.
53
+ Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
54
+ * feat!: migrate bootstrap fixture script to component/experienceTemplate entities
55
+ contentful-management@12.14.0 exposes the renamed ExO entities (Component,
56
+ ExperienceTemplate) alongside the deprecated ComponentType/Template ones. Adopt
57
+ the renamed shapes throughout examples/scripts so a freshly bootstrapped demo
58
+ Experience uses the same entity vocabulary the delivery-consuming packages now
59
+ read.
60
+ - Bump contentful-management to ^12.14.0 (existing dependency, version only —
61
+ no new packages).
62
+ - fixture/component-types.ts -> fixture/components.ts: ComponentTypeFixture ->
63
+ ComponentFixture.
64
+ - fixture/templates.ts -> fixture/experience-templates.ts:
65
+ TemplateFixture -> ExperienceTemplateFixture, TemplateTreeNode ->
66
+ ExperienceTemplateTreeNode.
67
+ - fixture/types.ts, fixture/experience.ts: ExperienceFixture.templateId ->
68
+ experienceTemplateId; node nodeType 'InlineFragment' ->
69
+ 'InlineExperienceFragment' with componentTypeId -> componentId, matching
70
+ contentful-management's InlineExperienceFragmentNode.
71
+ - fixture/data-assemblies.ts: dataAssemblyComponentTypeLinks ->
72
+ dataAssemblyComponentLinks (componentTypeId -> componentId).
73
+ - bootstrap-example.ts: cma.componentType -> cma.component,
74
+ cma.template -> cma.experienceTemplate; sys.type 'ComponentType' ->
75
+ 'Component', 'Template' -> 'ExperienceTemplate'; resource-link types
76
+ Contentful:ComponentType -> Contentful:Component and Contentful:Template ->
77
+ Contentful:ExperienceTemplate; URN segments components/ and
78
+ experienceTemplates/; seedComponentType -> seedComponent, seedTemplate ->
79
+ seedExperienceTemplate, linkDataAssembliesToComponentTypes ->
80
+ linkDataAssembliesToComponents.
81
+ The metadata.annotations.Template composed/coded-implementation marker is
82
+ unrelated to this rename (identical shape in 12.10.0 and 12.14.0) and is left
83
+ untouched.
84
+ Verified: examples/scripts typechecks clean; the main workspace's build,
85
+ typecheck, and 157 tests are unaffected.
86
+ Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
87
+
88
+ ### 🧱 Updated Dependencies
89
+
90
+ - Updated core to 0.7.0
91
+
92
+ ## 0.2.1 (2026-08-06)
93
+
94
+ ### 🧱 Updated Dependencies
95
+
96
+ - Updated core to 0.6.1
97
+
1
98
  ## 0.2.0 (2026-08-05)
2
99
 
3
100
  ### 🚀 Features
@@ -0,0 +1,6 @@
1
+ declare const ALPHA_FEATURE_HEADER = "x-contentful-enable-alpha-feature";
2
+ declare const NEW_EXO_ENTITY_TYPES = "new-exo-entity-types";
3
+ /** Ready-to-spread header bag selecting the ExO entity shapes this SDK reads. */
4
+ declare const NEW_EXO_ENTITY_TYPES_HEADERS: Record<string, string>;
5
+
6
+ export { ALPHA_FEATURE_HEADER, NEW_EXO_ENTITY_TYPES, NEW_EXO_ENTITY_TYPES_HEADERS };
@@ -0,0 +1,11 @@
1
+ const ALPHA_FEATURE_HEADER = "x-contentful-enable-alpha-feature";
2
+ const NEW_EXO_ENTITY_TYPES = "new-exo-entity-types";
3
+ const NEW_EXO_ENTITY_TYPES_HEADERS = {
4
+ [ALPHA_FEATURE_HEADER]: NEW_EXO_ENTITY_TYPES
5
+ };
6
+ export {
7
+ ALPHA_FEATURE_HEADER,
8
+ NEW_EXO_ENTITY_TYPES,
9
+ NEW_EXO_ENTITY_TYPES_HEADERS
10
+ };
11
+ //# sourceMappingURL=alpha-feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/alpha-feature.ts"],"sourcesContent":["/*\n * The Experience Delivery API gates the ExO entity shapes this SDK reads —\n * nodes linking `component` / `experienceTemplate`, and `sys.experienceTemplate`\n * for the page-level reference — behind an alpha-feature header. A request\n * without the header gets a different shape, which this SDK does not parse.\n *\n * The header is therefore required, not optional, and is sent from two places:\n * `createClient` sets it as a client default, and `fetchExperience` sends it\n * per request so a caller-supplied client is covered too.\n *\n * It also makes the response type unambiguous: the delivery client types\n * `GetExperienceResponse` as a union of the shapes the endpoint can return,\n * because it cannot know which header the caller sent. Sending the header is\n * what lets `fetch-experience.ts` narrow to `HydratedExperienceView`.\n */\n\nexport const ALPHA_FEATURE_HEADER = 'x-contentful-enable-alpha-feature';\n\nexport const NEW_EXO_ENTITY_TYPES = 'new-exo-entity-types';\n\n/** Ready-to-spread header bag selecting the ExO entity shapes this SDK reads. */\nexport const NEW_EXO_ENTITY_TYPES_HEADERS: Record<string, string> = {\n [ALPHA_FEATURE_HEADER]: NEW_EXO_ENTITY_TYPES,\n};\n"],"mappings":"AAgBO,MAAM,uBAAuB;AAE7B,MAAM,uBAAuB;AAG7B,MAAM,+BAAuD;AAAA,EAClE,CAAC,oBAAoB,GAAG;AAC1B;","names":[]}
@@ -1,10 +1,17 @@
1
1
  import { ContentfulViewDeliveryClient } from "@contentful/experience-delivery";
2
+ import { ALPHA_FEATURE_HEADER, NEW_EXO_ENTITY_TYPES } from "./alpha-feature.js";
2
3
  function createClient(options) {
3
- const { accessToken, host, ...rest } = options;
4
+ const { accessToken, host, headers, ...rest } = options;
4
5
  return new ContentfulViewDeliveryClient({
5
6
  ...rest,
6
7
  token: accessToken,
7
- baseUrl: host
8
+ baseUrl: host,
9
+ // Selects the ExO entity shapes this SDK reads (`component` /
10
+ // `experienceTemplate` links). Set as a client default so direct
11
+ // `client.experience.get(...)` calls get them too, not just
12
+ // `fetchExperience`. A caller-supplied `headers` entry for the same key
13
+ // wins, so a caller can pin a different alpha-feature set if they need to.
14
+ headers: { [ALPHA_FEATURE_HEADER]: NEW_EXO_ENTITY_TYPES, ...headers }
8
15
  });
9
16
  }
10
17
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/create-client.ts"],"sourcesContent":["import { ContentfulViewDeliveryClient } from '@contentful/experience-delivery';\n\nexport type CreateClientOptions = {\n accessToken: string;\n /**\n * Base URL for the delivery client. Defaults to `DELIVERY_HOST` when omitted.\n * Pass `PREVIEW_HOST` for preview mode, or any custom URL (staging, proxy,\n * per-region). Both constants are exported from this package.\n */\n host?: string;\n} & Omit<ContentfulViewDeliveryClient.Options, 'token' | 'baseUrl'>;\n\nexport function createClient(options: CreateClientOptions): ContentfulViewDeliveryClient {\n const { accessToken, host, ...rest } = options;\n return new ContentfulViewDeliveryClient({\n ...rest,\n token: accessToken,\n baseUrl: host,\n });\n}\n"],"mappings":"AAAA,SAAS,oCAAoC;AAYtC,SAAS,aAAa,SAA4D;AACvF,QAAM,EAAE,aAAa,MAAM,GAAG,KAAK,IAAI;AACvC,SAAO,IAAI,6BAA6B;AAAA,IACtC,GAAG;AAAA,IACH,OAAO;AAAA,IACP,SAAS;AAAA,EACX,CAAC;AACH;","names":[]}
1
+ {"version":3,"sources":["../src/create-client.ts"],"sourcesContent":["import { ContentfulViewDeliveryClient } from '@contentful/experience-delivery';\n\nimport { ALPHA_FEATURE_HEADER, NEW_EXO_ENTITY_TYPES } from './alpha-feature.js';\n\nexport type CreateClientOptions = {\n accessToken: string;\n /**\n * Base URL for the delivery client. Defaults to `DELIVERY_HOST` when omitted.\n * Pass `PREVIEW_HOST` for preview mode, or any custom URL (staging, proxy,\n * per-region). Both constants are exported from this package.\n */\n host?: string;\n} & Omit<ContentfulViewDeliveryClient.Options, 'token' | 'baseUrl'>;\n\nexport function createClient(options: CreateClientOptions): ContentfulViewDeliveryClient {\n const { accessToken, host, headers, ...rest } = options;\n return new ContentfulViewDeliveryClient({\n ...rest,\n token: accessToken,\n baseUrl: host,\n // Selects the ExO entity shapes this SDK reads (`component` /\n // `experienceTemplate` links). Set as a client default so direct\n // `client.experience.get(...)` calls get them too, not just\n // `fetchExperience`. A caller-supplied `headers` entry for the same key\n // wins, so a caller can pin a different alpha-feature set if they need to.\n headers: { [ALPHA_FEATURE_HEADER]: NEW_EXO_ENTITY_TYPES, ...headers },\n });\n}\n"],"mappings":"AAAA,SAAS,oCAAoC;AAE7C,SAAS,sBAAsB,4BAA4B;AAYpD,SAAS,aAAa,SAA4D;AACvF,QAAM,EAAE,aAAa,MAAM,SAAS,GAAG,KAAK,IAAI;AAChD,SAAO,IAAI,6BAA6B;AAAA,IACtC,GAAG;AAAA,IACH,OAAO;AAAA,IACP,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMT,SAAS,EAAE,CAAC,oBAAoB,GAAG,sBAAsB,GAAG,QAAQ;AAAA,EACtE,CAAC;AACH;","names":[]}
@@ -35,8 +35,7 @@ type ResolveOptions = {
35
35
  /**
36
36
  * Arbitrary per-render metadata exposed to every resolver as
37
37
  * `ctx.experience.metadata` and readable at render time via the framework
38
- * adapter's `useExperience()` / `getExperience()`. Flattened to a top-level
39
- * option (previously nested under `context.metadata`).
38
+ * adapter's `useExperience()` / `getExperience()`.
40
39
  */
41
40
  metadata?: Record<string, unknown>;
42
41
  /**
@@ -1,4 +1,5 @@
1
1
  import { createDebugLogger, resolveExperience } from "@contentful/experiences-sdk-core";
2
+ import { NEW_EXO_ENTITY_TYPES_HEADERS } from "./alpha-feature.js";
2
3
  import { createClient } from "./create-client.js";
3
4
  import { PREVIEW_HOST } from "./hosts.js";
4
5
  async function fetchExperience(experienceOptions, clientOptions, resolveOptions) {
@@ -24,9 +25,14 @@ async function fetchExperience(experienceOptions, clientOptions, resolveOptions)
24
25
  log.log("created delivery client", { preview: Boolean(preview), host: resolvedHost });
25
26
  }
26
27
  log.log("fetching experience", { spaceId, environmentId, experienceId, locale });
27
- const payload = await client.view.getExperience(spaceId, environmentId, experienceId, {
28
- locale
29
- });
28
+ const response = await client.experience.get(
29
+ spaceId,
30
+ environmentId,
31
+ experienceId,
32
+ { locale },
33
+ { headers: NEW_EXO_ENTITY_TYPES_HEADERS }
34
+ );
35
+ const payload = response;
30
36
  log.lazy("received raw payload", () => payload);
31
37
  return resolveExperience(payload, config, { metadata, debug });
32
38
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/fetch-experience.ts"],"sourcesContent":["import type { ContentfulViewDeliveryClient } from '@contentful/experience-delivery';\nimport { createDebugLogger, resolveExperience } from '@contentful/experiences-sdk-core';\nimport type {\n ExperiencePayload,\n PortableRenderPlan,\n ResolverConfig,\n} from '@contentful/experiences-sdk-core';\nimport { createClient } from './create-client.js';\nimport { PREVIEW_HOST } from './hosts.js';\n\nexport type ExperienceOptions = {\n spaceId: string;\n environmentId: string;\n experienceId: string;\n locale?: string;\n};\n\nexport type ClientOptions =\n | {\n accessToken: string;\n /**\n * Preview access token. Required when calling with `preview: true`.\n */\n previewToken?: string;\n /**\n * Flip between delivery (default) and preview at request time. When\n * `true`, `fetchExperience` uses `previewToken` and the preview host;\n * when `false` or unset, it uses `accessToken` and the delivery host.\n * Ignored when a pre-made `client` is passed instead of inline creds.\n */\n preview?: boolean;\n /**\n * Custom base URL for the delivery client (staging, proxy, per-region).\n * Wins over the `preview`-derived default host — combine `host` with\n * `preview: true` to point preview mode at a non-prod endpoint.\n * Omit for the standard delivery / preview hosts.\n */\n host?: string;\n }\n | { client: ContentfulViewDeliveryClient };\n\nexport type ResolveOptions = {\n config: ResolverConfig;\n /**\n * Arbitrary per-render metadata exposed to every resolver as\n * `ctx.experience.metadata` and readable at render time via the framework\n * adapter's `useExperience()` / `getExperience()`. Flattened to a top-level\n * option (previously nested under `context.metadata`).\n */\n metadata?: Record<string, unknown>;\n /**\n * Observability switch. When on: logs the fetch (host, ids) and the raw\n * payload here, and threads through to `resolveExperience` (resolution steps\n * + `resolveData` timings) and the renderer (visible missing-component box,\n * debug fallback). A single boolean across fetch + resolve + render.\n */\n debug?: boolean;\n};\n\nexport async function fetchExperience(\n experienceOptions: ExperienceOptions,\n clientOptions: ClientOptions,\n resolveOptions: ResolveOptions\n): Promise<PortableRenderPlan> {\n const { spaceId, environmentId, experienceId, locale } = experienceOptions;\n const { config, metadata, debug } = resolveOptions;\n const log = createDebugLogger(debug, 'client');\n\n let client: ContentfulViewDeliveryClient;\n if ('client' in clientOptions) {\n client = clientOptions.client;\n log.log('using caller-supplied delivery client');\n } else {\n const { accessToken, previewToken, preview, host } = clientOptions;\n if (preview && !previewToken) {\n throw new Error(\n 'fetchExperience() called with preview: true but no previewToken was provided'\n );\n }\n const resolvedHost = host ?? (preview ? PREVIEW_HOST : undefined);\n client = createClient({\n accessToken: preview ? (previewToken as string) : accessToken,\n host: resolvedHost,\n });\n log.log('created delivery client', { preview: Boolean(preview), host: resolvedHost });\n }\n\n log.log('fetching experience', { spaceId, environmentId, experienceId, locale });\n\n // Response from the experience delivery client is structurally compatible with ExperiencePayload (superset)\n const payload = (await client.view.getExperience(spaceId, environmentId, experienceId, {\n locale,\n })) as unknown as ExperiencePayload;\n\n log.lazy('received raw payload', () => payload);\n\n return resolveExperience(payload, config, { metadata, debug });\n}\n"],"mappings":"AACA,SAAS,mBAAmB,yBAAyB;AAMrD,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAmD7B,eAAsB,gBACpB,mBACA,eACA,gBAC6B;AAC7B,QAAM,EAAE,SAAS,eAAe,cAAc,OAAO,IAAI;AACzD,QAAM,EAAE,QAAQ,UAAU,MAAM,IAAI;AACpC,QAAM,MAAM,kBAAkB,OAAO,QAAQ;AAE7C,MAAI;AACJ,MAAI,YAAY,eAAe;AAC7B,aAAS,cAAc;AACvB,QAAI,IAAI,uCAAuC;AAAA,EACjD,OAAO;AACL,UAAM,EAAE,aAAa,cAAc,SAAS,KAAK,IAAI;AACrD,QAAI,WAAW,CAAC,cAAc;AAC5B,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AACA,UAAM,eAAe,SAAS,UAAU,eAAe;AACvD,aAAS,aAAa;AAAA,MACpB,aAAa,UAAW,eAA0B;AAAA,MAClD,MAAM;AAAA,IACR,CAAC;AACD,QAAI,IAAI,2BAA2B,EAAE,SAAS,QAAQ,OAAO,GAAG,MAAM,aAAa,CAAC;AAAA,EACtF;AAEA,MAAI,IAAI,uBAAuB,EAAE,SAAS,eAAe,cAAc,OAAO,CAAC;AAG/E,QAAM,UAAW,MAAM,OAAO,KAAK,cAAc,SAAS,eAAe,cAAc;AAAA,IACrF;AAAA,EACF,CAAC;AAED,MAAI,KAAK,wBAAwB,MAAM,OAAO;AAE9C,SAAO,kBAAkB,SAAS,QAAQ,EAAE,UAAU,MAAM,CAAC;AAC/D;","names":[]}
1
+ {"version":3,"sources":["../src/fetch-experience.ts"],"sourcesContent":["import type {\n ContentfulViewDelivery,\n ContentfulViewDeliveryClient,\n} from '@contentful/experience-delivery';\nimport { createDebugLogger, resolveExperience } from '@contentful/experiences-sdk-core';\nimport type {\n ExperiencePayload,\n PortableRenderPlan,\n ResolverConfig,\n} from '@contentful/experiences-sdk-core';\nimport { NEW_EXO_ENTITY_TYPES_HEADERS } from './alpha-feature.js';\nimport { createClient } from './create-client.js';\nimport { PREVIEW_HOST } from './hosts.js';\n\nexport type ExperienceOptions = {\n spaceId: string;\n environmentId: string;\n experienceId: string;\n locale?: string;\n};\n\nexport type ClientOptions =\n | {\n accessToken: string;\n /**\n * Preview access token. Required when calling with `preview: true`.\n */\n previewToken?: string;\n /**\n * Flip between delivery (default) and preview at request time. When\n * `true`, `fetchExperience` uses `previewToken` and the preview host;\n * when `false` or unset, it uses `accessToken` and the delivery host.\n * Ignored when a pre-made `client` is passed instead of inline creds.\n */\n preview?: boolean;\n /**\n * Custom base URL for the delivery client (staging, proxy, per-region).\n * Wins over the `preview`-derived default host — combine `host` with\n * `preview: true` to point preview mode at a non-prod endpoint.\n * Omit for the standard delivery / preview hosts.\n */\n host?: string;\n }\n | { client: ContentfulViewDeliveryClient };\n\nexport type ResolveOptions = {\n config: ResolverConfig;\n /**\n * Arbitrary per-render metadata exposed to every resolver as\n * `ctx.experience.metadata` and readable at render time via the framework\n * adapter's `useExperience()` / `getExperience()`.\n */\n metadata?: Record<string, unknown>;\n /**\n * Observability switch. When on: logs the fetch (host, ids) and the raw\n * payload here, and threads through to `resolveExperience` (resolution steps\n * + `resolveData` timings) and the renderer (visible missing-component box,\n * debug fallback). A single boolean across fetch + resolve + render.\n */\n debug?: boolean;\n};\n\nexport async function fetchExperience(\n experienceOptions: ExperienceOptions,\n clientOptions: ClientOptions,\n resolveOptions: ResolveOptions\n): Promise<PortableRenderPlan> {\n const { spaceId, environmentId, experienceId, locale } = experienceOptions;\n const { config, metadata, debug } = resolveOptions;\n const log = createDebugLogger(debug, 'client');\n\n let client: ContentfulViewDeliveryClient;\n if ('client' in clientOptions) {\n client = clientOptions.client;\n log.log('using caller-supplied delivery client');\n } else {\n const { accessToken, previewToken, preview, host } = clientOptions;\n if (preview && !previewToken) {\n throw new Error(\n 'fetchExperience() called with preview: true but no previewToken was provided'\n );\n }\n const resolvedHost = host ?? (preview ? PREVIEW_HOST : undefined);\n client = createClient({\n accessToken: preview ? (previewToken as string) : accessToken,\n host: resolvedHost,\n });\n log.log('created delivery client', { preview: Boolean(preview), host: resolvedHost });\n }\n\n log.log('fetching experience', { spaceId, environmentId, experienceId, locale });\n\n // The alpha-feature header goes on the request as well as on clients built by\n // `createClient`, so a caller-supplied `{ client }` also gets the ExO entity\n // shapes this SDK reads.\n const response = await client.experience.get(\n spaceId,\n environmentId,\n experienceId,\n { locale },\n { headers: NEW_EXO_ENTITY_TYPES_HEADERS }\n );\n\n // `GetExperienceResponse` is a union of the shapes the endpoint can return;\n // the header above pins it to `HydratedExperienceView`, which is a structural\n // superset of `ExperiencePayload`.\n const payload = response as ContentfulViewDelivery.HydratedExperienceView as ExperiencePayload;\n\n log.lazy('received raw payload', () => payload);\n\n return resolveExperience(payload, config, { metadata, debug });\n}\n"],"mappings":"AAIA,SAAS,mBAAmB,yBAAyB;AAMrD,SAAS,oCAAoC;AAC7C,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAkD7B,eAAsB,gBACpB,mBACA,eACA,gBAC6B;AAC7B,QAAM,EAAE,SAAS,eAAe,cAAc,OAAO,IAAI;AACzD,QAAM,EAAE,QAAQ,UAAU,MAAM,IAAI;AACpC,QAAM,MAAM,kBAAkB,OAAO,QAAQ;AAE7C,MAAI;AACJ,MAAI,YAAY,eAAe;AAC7B,aAAS,cAAc;AACvB,QAAI,IAAI,uCAAuC;AAAA,EACjD,OAAO;AACL,UAAM,EAAE,aAAa,cAAc,SAAS,KAAK,IAAI;AACrD,QAAI,WAAW,CAAC,cAAc;AAC5B,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AACA,UAAM,eAAe,SAAS,UAAU,eAAe;AACvD,aAAS,aAAa;AAAA,MACpB,aAAa,UAAW,eAA0B;AAAA,MAClD,MAAM;AAAA,IACR,CAAC;AACD,QAAI,IAAI,2BAA2B,EAAE,SAAS,QAAQ,OAAO,GAAG,MAAM,aAAa,CAAC;AAAA,EACtF;AAEA,MAAI,IAAI,uBAAuB,EAAE,SAAS,eAAe,cAAc,OAAO,CAAC;AAK/E,QAAM,WAAW,MAAM,OAAO,WAAW;AAAA,IACvC;AAAA,IACA;AAAA,IACA;AAAA,IACA,EAAE,OAAO;AAAA,IACT,EAAE,SAAS,6BAA6B;AAAA,EAC1C;AAKA,QAAM,UAAU;AAEhB,MAAI,KAAK,wBAAwB,MAAM,OAAO;AAE9C,SAAO,kBAAkB,SAAS,QAAQ,EAAE,UAAU,MAAM,CAAC;AAC/D;","names":[]}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { ContentfulViewDelivery } from '@contentful/experience-delivery';
2
2
  export { ContentfulViewDelivery, ContentfulViewDeliveryClient } from '@contentful/experience-delivery';
3
3
  export { CreateClientOptions, createClient } from './create-client.js';
4
+ export { ALPHA_FEATURE_HEADER, NEW_EXO_ENTITY_TYPES, NEW_EXO_ENTITY_TYPES_HEADERS } from './alpha-feature.js';
4
5
  export { ClientOptions, ExperienceOptions, ResolveOptions, fetchExperience } from './fetch-experience.js';
5
6
  export { DELIVERY_HOST, PREVIEW_HOST } from './hosts.js';
6
7
  import '@contentful/experiences-sdk-core';
package/dist/index.js CHANGED
@@ -5,12 +5,20 @@ import {
5
5
  } from "@contentful/experience-delivery";
6
6
  const NotFoundError = ContentfulViewDelivery.NotFoundError;
7
7
  import { createClient } from "./create-client.js";
8
+ import {
9
+ ALPHA_FEATURE_HEADER,
10
+ NEW_EXO_ENTITY_TYPES,
11
+ NEW_EXO_ENTITY_TYPES_HEADERS
12
+ } from "./alpha-feature.js";
8
13
  import { fetchExperience } from "./fetch-experience.js";
9
14
  import { DELIVERY_HOST, PREVIEW_HOST } from "./hosts.js";
10
15
  export {
16
+ ALPHA_FEATURE_HEADER,
11
17
  ContentfulViewDelivery2 as ContentfulViewDelivery,
12
18
  ContentfulViewDeliveryClient,
13
19
  DELIVERY_HOST,
20
+ NEW_EXO_ENTITY_TYPES,
21
+ NEW_EXO_ENTITY_TYPES_HEADERS,
14
22
  NotFoundError,
15
23
  PREVIEW_HOST,
16
24
  createClient,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { ContentfulViewDelivery } from '@contentful/experience-delivery';\n\nexport {\n ContentfulViewDelivery,\n ContentfulViewDeliveryClient,\n} from '@contentful/experience-delivery';\nexport const NotFoundError = ContentfulViewDelivery.NotFoundError;\nexport type NotFoundError = InstanceType<typeof ContentfulViewDelivery.NotFoundError>;\nexport { createClient } from './create-client.js';\nexport type { CreateClientOptions } from './create-client.js';\nexport { fetchExperience } from './fetch-experience.js';\nexport type { ExperienceOptions, ClientOptions, ResolveOptions } from './fetch-experience.js';\nexport { DELIVERY_HOST, PREVIEW_HOST } from './hosts.js';\n"],"mappings":"AAAA,SAAS,8BAA8B;AAEvC;AAAA,EACE,0BAAAA;AAAA,EACA;AAAA,OACK;AACA,MAAM,gBAAgB,uBAAuB;AAEpD,SAAS,oBAAoB;AAE7B,SAAS,uBAAuB;AAEhC,SAAS,eAAe,oBAAoB;","names":["ContentfulViewDelivery"]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { ContentfulViewDelivery } from '@contentful/experience-delivery';\n\nexport {\n ContentfulViewDelivery,\n ContentfulViewDeliveryClient,\n} from '@contentful/experience-delivery';\nexport const NotFoundError = ContentfulViewDelivery.NotFoundError;\nexport type NotFoundError = InstanceType<typeof ContentfulViewDelivery.NotFoundError>;\nexport { createClient } from './create-client.js';\nexport type { CreateClientOptions } from './create-client.js';\n// Exported so customers who drive `ContentfulViewDeliveryClient` themselves and\n// call `resolveExperience` on the raw payload can select the same ExO entity\n// shapes this SDK expects. `createClient` / `fetchExperience` send it for you.\nexport {\n ALPHA_FEATURE_HEADER,\n NEW_EXO_ENTITY_TYPES,\n NEW_EXO_ENTITY_TYPES_HEADERS,\n} from './alpha-feature.js';\nexport { fetchExperience } from './fetch-experience.js';\nexport type { ExperienceOptions, ClientOptions, ResolveOptions } from './fetch-experience.js';\nexport { DELIVERY_HOST, PREVIEW_HOST } from './hosts.js';\n"],"mappings":"AAAA,SAAS,8BAA8B;AAEvC;AAAA,EACE,0BAAAA;AAAA,EACA;AAAA,OACK;AACA,MAAM,gBAAgB,uBAAuB;AAEpD,SAAS,oBAAoB;AAK7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,uBAAuB;AAEhC,SAAS,eAAe,oBAAoB;","names":["ContentfulViewDelivery"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experiences-client",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Delivery client + fetchExperience for Contentful Experiences",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -30,7 +30,7 @@
30
30
  "directory": "packages/client"
31
31
  },
32
32
  "dependencies": {
33
- "@contentful/experience-delivery": "1.0.0-dev.3",
34
- "@contentful/experiences-sdk-core": "0.6.0"
33
+ "@contentful/experience-delivery": "1.0.0-dev.6",
34
+ "@contentful/experiences-sdk-core": "0.7.0"
35
35
  }
36
36
  }