@contentful/optimization-node 2.1.1 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -12
- package/THIRD_PARTY_NOTICES.txt +101 -6
- package/dist/constants.cjs +1 -1
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/constants.mjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<p align="center">
|
|
2
2
|
<a href="https://www.contentful.com/developers/docs/personalization/">
|
|
3
|
-
<img alt="Contentful Logo" title="Contentful" src="https://raw.githubusercontent.com/contentful/optimization/optimization-node-v2.
|
|
3
|
+
<img alt="Contentful Logo" title="Contentful" src="https://raw.githubusercontent.com/contentful/optimization/optimization-node-v2.2.1/contentful-icon.png" width="150">
|
|
4
4
|
</a>
|
|
5
5
|
</p>
|
|
6
6
|
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
<div align="center">
|
|
12
12
|
|
|
13
13
|
[Guides](https://contentful.github.io/optimization/documents/Documentation.Guides.html) ·
|
|
14
|
-
[Reference](https://contentful.github.io/optimization) · [Contributing](https://github.com/contentful/optimization/blob/optimization-node-v2.
|
|
14
|
+
[Reference](https://contentful.github.io/optimization) · [Contributing](https://github.com/contentful/optimization/blob/optimization-node-v2.2.1/CONTRIBUTING.md)
|
|
15
15
|
|
|
16
16
|
</div>
|
|
17
17
|
|
|
18
18
|
The Optimization Node SDK implements stateless server-side optimization behavior on top of the
|
|
19
|
-
[Optimization Core SDK](https://github.com/contentful/optimization/blob/optimization-node-v2.
|
|
19
|
+
[Optimization Core SDK](https://github.com/contentful/optimization/blob/optimization-node-v2.2.1/packages/universal/core-sdk/README.md). Use it for server rendering, server
|
|
20
20
|
functions, and Node services that need request-scoped profile evaluation or event emission.
|
|
21
21
|
|
|
22
22
|
If you are integrating a Node application, start with [Getting Started](#getting-started), then use
|
|
@@ -90,7 +90,7 @@ async function renderRequest(
|
|
|
90
90
|
},
|
|
91
91
|
locale: appLocale,
|
|
92
92
|
eventContext: { locale: appLocale },
|
|
93
|
-
|
|
93
|
+
profileId,
|
|
94
94
|
})
|
|
95
95
|
|
|
96
96
|
const { accepted, data } = await requestOptimization.page()
|
|
@@ -110,7 +110,7 @@ are part of the same application.
|
|
|
110
110
|
|
|
111
111
|
The Node SDK is stateless. It does not maintain consent, profile, or browser persistence state
|
|
112
112
|
between requests. For cross-SDK consent guidance, see
|
|
113
|
-
[Consent management in the Optimization SDK Suite](https://github.com/contentful/optimization/blob/optimization-node-v2.
|
|
113
|
+
[Consent management in the Optimization SDK Suite](https://github.com/contentful/optimization/blob/optimization-node-v2.2.1/documentation/concepts/consent-management-in-the-optimization-sdk-suite.md).
|
|
114
114
|
|
|
115
115
|
| Option | Required? | Default | Description |
|
|
116
116
|
| ------------------- | --------- | ---------------------- | ------------------------------------------------------------------------------- |
|
|
@@ -215,7 +215,7 @@ app.get('/products/:slug', async (req, res) => {
|
|
|
215
215
|
eventContext: {
|
|
216
216
|
locale: appLocale,
|
|
217
217
|
},
|
|
218
|
-
|
|
218
|
+
profileId: req.cookies.profileId,
|
|
219
219
|
})
|
|
220
220
|
const { accepted, data: optimizationData } = await requestOptimization.page({
|
|
221
221
|
properties: { path: req.path },
|
|
@@ -246,9 +246,30 @@ Node SDK event calls fail closed except for the default pre-consent allowlist, `
|
|
|
246
246
|
event consent is not granted. Pass `allowedEventTypes: []` to require strict opt-in for all
|
|
247
247
|
stateless event methods.
|
|
248
248
|
|
|
249
|
-
In stateless runtimes,
|
|
250
|
-
|
|
251
|
-
|
|
249
|
+
In stateless runtimes, non-sticky `trackView`, `trackClick`, `trackHover`, and `trackFlagView`
|
|
250
|
+
require a full `Profile` supplied through `forRequest({ profile })` or returned by an Experience
|
|
251
|
+
call on the same request client. Use `profileId` for Experience API continuity.
|
|
252
|
+
|
|
253
|
+
For custom integrations that need an event payload before submission, use the request client's
|
|
254
|
+
`eventBuilder`. It exposes `buildIdentify`, `buildPageView`, `buildScreenView`, and `buildTrack`
|
|
255
|
+
with request event context and locale defaults. In this example, `appConsent`, `appLocale`,
|
|
256
|
+
`appUserAgent`, and `appUserId` come from your application's request and identity handling:
|
|
257
|
+
|
|
258
|
+
```ts
|
|
259
|
+
const requestOptimization = optimization.forRequest({
|
|
260
|
+
consent: appConsent,
|
|
261
|
+
locale: appLocale,
|
|
262
|
+
eventContext: { userAgent: appUserAgent },
|
|
263
|
+
})
|
|
264
|
+
const identifyEvent = requestOptimization.eventBuilder.buildIdentify({ userId: appUserId })
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
Construction does not send the event, check request consent, invoke interceptors, or update the
|
|
268
|
+
request profile or selections. Built events use the shared builder's `context.gdpr.isConsentGiven`,
|
|
269
|
+
which is `false` in the Node SDK, even when request consent is granted. Sending `identifyEvent` through a
|
|
270
|
+
low-level API does not automatically apply request consent or SDK submission processing. For normal
|
|
271
|
+
submission, use request-bound `identify()`, `page()`, `screen()`, or `track()`. The singleton's
|
|
272
|
+
`optimization.eventBuilder` remains unbound to any request.
|
|
252
273
|
|
|
253
274
|
### Content resolution
|
|
254
275
|
|
|
@@ -345,9 +366,9 @@ package directory.
|
|
|
345
366
|
step-by-step server-side integration guide
|
|
346
367
|
- [Node SDK generated reference](https://contentful.github.io/optimization/modules/_contentful_optimization-node.html) -
|
|
347
368
|
exported API reference
|
|
348
|
-
- [Node reference implementation](https://github.com/contentful/optimization/blob/optimization-node-v2.
|
|
369
|
+
- [Node reference implementation](https://github.com/contentful/optimization/blob/optimization-node-v2.2.1/implementations/node-sdk/README.md) - server-rendered
|
|
349
370
|
implementation using request-scoped SDK calls
|
|
350
|
-
- [Node + Web reference implementation](https://github.com/contentful/optimization/blob/optimization-node-v2.
|
|
371
|
+
- [Node + Web reference implementation](https://github.com/contentful/optimization/blob/optimization-node-v2.2.1/implementations/node-sdk+web-sdk/README.md) -
|
|
351
372
|
hybrid SSR and browser implementation
|
|
352
|
-
- [Optimization Web SDK](https://github.com/contentful/optimization/blob/optimization-node-v2.
|
|
373
|
+
- [Optimization Web SDK](https://github.com/contentful/optimization/blob/optimization-node-v2.2.1/packages/web/web-sdk/README.md) - browser SDK used when the same application
|
|
353
374
|
also needs client-side consent, persistence, tracking, or live updates
|
package/THIRD_PARTY_NOTICES.txt
CHANGED
|
@@ -216,6 +216,30 @@ SOFTWARE.
|
|
|
216
216
|
|
|
217
217
|
---
|
|
218
218
|
|
|
219
|
+
The following software may be included in this product: @rollup/rollup-linux-x64-gnu (4.60.1)
|
|
220
|
+
This software contains the following license and notice below:
|
|
221
|
+
|
|
222
|
+
MIT License
|
|
223
|
+
|
|
224
|
+
Copyright (c) Lukas Taegert-Atkinson
|
|
225
|
+
|
|
226
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
|
227
|
+
associated documentation files (the "Software"), to deal in the Software without restriction, including
|
|
228
|
+
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
229
|
+
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
|
|
230
|
+
following conditions:
|
|
231
|
+
|
|
232
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
233
|
+
portions of the Software.
|
|
234
|
+
|
|
235
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
|
236
|
+
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
|
|
237
|
+
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
238
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
239
|
+
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
219
243
|
The following software may be included in this product: agent-base (6.0.2)
|
|
220
244
|
This software contains the following license and notice below:
|
|
221
245
|
|
|
@@ -625,16 +649,57 @@ SOFTWARE.
|
|
|
625
649
|
|
|
626
650
|
---
|
|
627
651
|
|
|
628
|
-
The following software may be included in this product: es-toolkit (1.
|
|
652
|
+
The following software may be included in this product: es-toolkit (1.53.0)
|
|
629
653
|
This software contains the following license and notice below:
|
|
630
654
|
|
|
631
|
-
|
|
655
|
+
NOTICE:
|
|
656
|
+
|
|
657
|
+
es-toolkit
|
|
658
|
+
|
|
659
|
+
Parts of the test suite and compatibility layer in es-toolkit/compat are
|
|
660
|
+
derived from Lodash (https://github.com/lodash/lodash).
|
|
661
|
+
|
|
662
|
+
Lodash copyright notice and MIT permission notice:
|
|
663
|
+
|
|
664
|
+
Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
665
|
+
|
|
666
|
+
Based on Underscore.js, copyright Jeremy Ashkenas,
|
|
667
|
+
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
|
668
|
+
|
|
669
|
+
This software consists of voluntary contributions made by many
|
|
670
|
+
individuals. For exact contribution history, see the revision history
|
|
671
|
+
available at https://github.com/lodash/lodash
|
|
672
|
+
|
|
673
|
+
The following license applies to all parts of this software except as
|
|
674
|
+
documented below:
|
|
675
|
+
|
|
676
|
+
====
|
|
677
|
+
|
|
678
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
679
|
+
a copy of this software and associated documentation files (the
|
|
680
|
+
"Software"), to deal in the Software without restriction, including
|
|
681
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
682
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
683
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
684
|
+
the following conditions:
|
|
685
|
+
|
|
686
|
+
The above copyright notice and this permission notice shall be
|
|
687
|
+
included in all copies or substantial portions of the Software.
|
|
688
|
+
|
|
689
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
690
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
691
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
692
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
693
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
694
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
695
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
696
|
+
|
|
697
|
+
LICENSE:
|
|
632
698
|
|
|
633
|
-
Copyright (c) 2024 Viva Republica, Inc
|
|
634
699
|
|
|
635
|
-
|
|
700
|
+
MIT License
|
|
636
701
|
|
|
637
|
-
|
|
702
|
+
Copyright (c) 2024 Viva Republica, Inc.
|
|
638
703
|
|
|
639
704
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
640
705
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -868,6 +933,21 @@ SOFTWARE.
|
|
|
868
933
|
|
|
869
934
|
---
|
|
870
935
|
|
|
936
|
+
The following software may be included in this product: has-flag (4.0.0)
|
|
937
|
+
This software contains the following license and notice below:
|
|
938
|
+
|
|
939
|
+
MIT License
|
|
940
|
+
|
|
941
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
|
942
|
+
|
|
943
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
944
|
+
|
|
945
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
946
|
+
|
|
947
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
948
|
+
|
|
949
|
+
---
|
|
950
|
+
|
|
871
951
|
The following software may be included in this product: has-symbols (1.1.0)
|
|
872
952
|
This software contains the following license and notice below:
|
|
873
953
|
|
|
@@ -1424,7 +1504,22 @@ SOFTWARE.
|
|
|
1424
1504
|
|
|
1425
1505
|
---
|
|
1426
1506
|
|
|
1427
|
-
The following software may be included in this product:
|
|
1507
|
+
The following software may be included in this product: supports-color (8.1.1)
|
|
1508
|
+
This software contains the following license and notice below:
|
|
1509
|
+
|
|
1510
|
+
MIT License
|
|
1511
|
+
|
|
1512
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
1513
|
+
|
|
1514
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
1515
|
+
|
|
1516
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
1517
|
+
|
|
1518
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1519
|
+
|
|
1520
|
+
---
|
|
1521
|
+
|
|
1522
|
+
The following software may be included in this product: zod (4.6.7)
|
|
1428
1523
|
This software contains the following license and notice below:
|
|
1429
1524
|
|
|
1430
1525
|
MIT License
|
package/dist/constants.cjs
CHANGED
|
@@ -34,7 +34,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
34
34
|
OPTIMIZATION_NODE_SDK_VERSION: ()=>OPTIMIZATION_NODE_SDK_VERSION
|
|
35
35
|
});
|
|
36
36
|
const constants_namespaceObject = require("@contentful/optimization-core/constants");
|
|
37
|
-
const OPTIMIZATION_NODE_SDK_VERSION = "2.
|
|
37
|
+
const OPTIMIZATION_NODE_SDK_VERSION = "2.2.1";
|
|
38
38
|
const OPTIMIZATION_NODE_SDK_NAME = "@contentful/optimization-node";
|
|
39
39
|
exports.ANONYMOUS_ID_COOKIE = __webpack_exports__.ANONYMOUS_ID_COOKIE;
|
|
40
40
|
exports.ANONYMOUS_ID_KEY = __webpack_exports__.ANONYMOUS_ID_KEY;
|
package/dist/constants.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.cjs","sources":["webpack://webpack/runtime/define_property_getters","webpack://webpack/runtime/has_own_property","webpack://webpack/runtime/make_namespace_object","../src/constants.ts"],"sourcesContent":["__webpack_require__.d = (exports, getters, values) => {\n\tvar define = (defs, kind) => {\n\t\tfor(var key in defs) {\n\t\t\tif(__webpack_require__.o(defs, key) && !__webpack_require__.o(exports, key)) {\n\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, [kind]: defs[key] });\n\t\t\t}\n\t\t}\n\t};\n\tdefine(getters, \"get\");\n\tdefine(values, \"value\");\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// eslint-disable-next-line @typescript-eslint/naming-convention -- Replaced at build-time\ndeclare const __OPTIMIZATION_VERSION__: string | undefined\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Replaced at build-time\ndeclare const __OPTIMIZATION_PACKAGE_NAME__: string | undefined\n\n/**\n * The current version of the Optimization Node SDK, injected at build-time.\n *\n * @defaultValue `'0.0.0'` when the build-time replacement is unavailable.\n *\n * @public\n */\nexport const OPTIMIZATION_NODE_SDK_VERSION =\n typeof __OPTIMIZATION_VERSION__ === 'string' ? __OPTIMIZATION_VERSION__ : '0.0.0'\n\n/**\n * The package name of the Optimization Node SDK, injected at build-time.\n *\n * @defaultValue `'@contentful/optimization-node'` when the build-time replacement is unavailable.\n *\n * @public\n */\nexport const OPTIMIZATION_NODE_SDK_NAME =\n typeof __OPTIMIZATION_PACKAGE_NAME__ === 'string'\n ? __OPTIMIZATION_PACKAGE_NAME__\n : '@contentful/optimization-node'\n\n/**\n * Re-exports of anonymous identifier constants used by the Optimization Core.\n *\n * @remarks\n * This constant is surfaced here to provide a stable import path for Node SDK\n * consumers. It represents the cookie key used by the Optimization Framework\n * to persist an anonymous identifier for
|
|
1
|
+
{"version":3,"file":"constants.cjs","sources":["webpack://webpack/runtime/define_property_getters","webpack://webpack/runtime/has_own_property","webpack://webpack/runtime/make_namespace_object","../src/constants.ts"],"sourcesContent":["__webpack_require__.d = (exports, getters, values) => {\n\tvar define = (defs, kind) => {\n\t\tfor(var key in defs) {\n\t\t\tif(__webpack_require__.o(defs, key) && !__webpack_require__.o(exports, key)) {\n\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, [kind]: defs[key] });\n\t\t\t}\n\t\t}\n\t};\n\tdefine(getters, \"get\");\n\tdefine(values, \"value\");\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// eslint-disable-next-line @typescript-eslint/naming-convention -- Replaced at build-time\ndeclare const __OPTIMIZATION_VERSION__: string | undefined\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Replaced at build-time\ndeclare const __OPTIMIZATION_PACKAGE_NAME__: string | undefined\n\n/**\n * The current version of the Optimization Node SDK, injected at build-time.\n *\n * @defaultValue `'0.0.0'` when the build-time replacement is unavailable.\n *\n * @public\n */\nexport const OPTIMIZATION_NODE_SDK_VERSION =\n typeof __OPTIMIZATION_VERSION__ === 'string' ? __OPTIMIZATION_VERSION__ : '0.0.0'\n\n/**\n * The package name of the Optimization Node SDK, injected at build-time.\n *\n * @defaultValue `'@contentful/optimization-node'` when the build-time replacement is unavailable.\n *\n * @public\n */\nexport const OPTIMIZATION_NODE_SDK_NAME =\n typeof __OPTIMIZATION_PACKAGE_NAME__ === 'string'\n ? __OPTIMIZATION_PACKAGE_NAME__\n : '@contentful/optimization-node'\n\n/**\n * Re-exports of anonymous identifier constants used by the Optimization Core.\n *\n * @remarks\n * This constant is surfaced here to provide a stable import path for Node SDK\n * consumers. It represents the cookie key used by the Optimization Framework\n * to persist an anonymous identifier for Experience API continuity when no\n * complete profile is known. Insights events require a complete profile snapshot.\n *\n * @example\n * ```ts\n * import { ANONYMOUS_ID_COOKIE, ANONYMOUS_ID_KEY } from '@contentful/optimization-node/constants'\n * const cookieId = request.cookies[ANONYMOUS_ID_COOKIE]\n * const storageId = localStorage.getItem(ANONYMOUS_ID_KEY)\n * ```\n *\n * @see {@link ANONYMOUS_ID_COOKIE} and {@link ANONYMOUS_ID_KEY} in\n * `@contentful/optimization-core` for the\n * authoritative definition and documentation.\n *\n * @public\n */\nexport { ANONYMOUS_ID_COOKIE, ANONYMOUS_ID_KEY } from '@contentful/optimization-core/constants'\n"],"names":["__webpack_require__","getters","values","define","defs","kind","key","Object","obj","prop","Symbol","OPTIMIZATION_NODE_SDK_VERSION","__OPTIMIZATION_VERSION__","OPTIMIZATION_NODE_SDK_NAME","__OPTIMIZATION_PACKAGE_NAME__"],"mappings":";;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC,SAASC;QAC1C,IAAIC,SAAS,CAACC,MAAMC;YACnB,IAAI,IAAIC,OAAOF,KACd,IAAGJ,oBAAoB,CAAC,CAACI,MAAME,QAAQ,CAACN,oBAAoB,CAAC,CAAC,UAASM,MACtEC,OAAO,cAAc,CAAC,UAASD,KAAK;gBAAE,YAAY;gBAAM,CAACD,KAAK,EAAED,IAAI,CAACE,IAAI;YAAC;QAG7E;QACAH,OAAOF,SAAS;QAChBE,OAAOD,QAAQ;IAChB;;;ICVAF,oBAAoB,CAAC,GAAG,CAACQ,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFT,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,MAAlB,OAAOU,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D;;;;;;;;;;;ACMO,MAAMI,gCACoCC;AAS1C,MAAMC,6BAEPC"}
|
package/dist/constants.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const OPTIMIZATION_NODE_SDK_VERSION = "2.
|
|
1
|
+
const OPTIMIZATION_NODE_SDK_VERSION = "2.2.1";
|
|
2
2
|
const OPTIMIZATION_NODE_SDK_NAME = "@contentful/optimization-node";
|
|
3
3
|
export { ANONYMOUS_ID_COOKIE, ANONYMOUS_ID_KEY } from "@contentful/optimization-core/constants";
|
|
4
4
|
export { OPTIMIZATION_NODE_SDK_NAME, OPTIMIZATION_NODE_SDK_VERSION };
|
package/dist/constants.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.mjs","sources":["../src/constants.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/naming-convention -- Replaced at build-time\ndeclare const __OPTIMIZATION_VERSION__: string | undefined\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Replaced at build-time\ndeclare const __OPTIMIZATION_PACKAGE_NAME__: string | undefined\n\n/**\n * The current version of the Optimization Node SDK, injected at build-time.\n *\n * @defaultValue `'0.0.0'` when the build-time replacement is unavailable.\n *\n * @public\n */\nexport const OPTIMIZATION_NODE_SDK_VERSION =\n typeof __OPTIMIZATION_VERSION__ === 'string' ? __OPTIMIZATION_VERSION__ : '0.0.0'\n\n/**\n * The package name of the Optimization Node SDK, injected at build-time.\n *\n * @defaultValue `'@contentful/optimization-node'` when the build-time replacement is unavailable.\n *\n * @public\n */\nexport const OPTIMIZATION_NODE_SDK_NAME =\n typeof __OPTIMIZATION_PACKAGE_NAME__ === 'string'\n ? __OPTIMIZATION_PACKAGE_NAME__\n : '@contentful/optimization-node'\n\n/**\n * Re-exports of anonymous identifier constants used by the Optimization Core.\n *\n * @remarks\n * This constant is surfaced here to provide a stable import path for Node SDK\n * consumers. It represents the cookie key used by the Optimization Framework\n * to persist an anonymous identifier for
|
|
1
|
+
{"version":3,"file":"constants.mjs","sources":["../src/constants.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/naming-convention -- Replaced at build-time\ndeclare const __OPTIMIZATION_VERSION__: string | undefined\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Replaced at build-time\ndeclare const __OPTIMIZATION_PACKAGE_NAME__: string | undefined\n\n/**\n * The current version of the Optimization Node SDK, injected at build-time.\n *\n * @defaultValue `'0.0.0'` when the build-time replacement is unavailable.\n *\n * @public\n */\nexport const OPTIMIZATION_NODE_SDK_VERSION =\n typeof __OPTIMIZATION_VERSION__ === 'string' ? __OPTIMIZATION_VERSION__ : '0.0.0'\n\n/**\n * The package name of the Optimization Node SDK, injected at build-time.\n *\n * @defaultValue `'@contentful/optimization-node'` when the build-time replacement is unavailable.\n *\n * @public\n */\nexport const OPTIMIZATION_NODE_SDK_NAME =\n typeof __OPTIMIZATION_PACKAGE_NAME__ === 'string'\n ? __OPTIMIZATION_PACKAGE_NAME__\n : '@contentful/optimization-node'\n\n/**\n * Re-exports of anonymous identifier constants used by the Optimization Core.\n *\n * @remarks\n * This constant is surfaced here to provide a stable import path for Node SDK\n * consumers. It represents the cookie key used by the Optimization Framework\n * to persist an anonymous identifier for Experience API continuity when no\n * complete profile is known. Insights events require a complete profile snapshot.\n *\n * @example\n * ```ts\n * import { ANONYMOUS_ID_COOKIE, ANONYMOUS_ID_KEY } from '@contentful/optimization-node/constants'\n * const cookieId = request.cookies[ANONYMOUS_ID_COOKIE]\n * const storageId = localStorage.getItem(ANONYMOUS_ID_KEY)\n * ```\n *\n * @see {@link ANONYMOUS_ID_COOKIE} and {@link ANONYMOUS_ID_KEY} in\n * `@contentful/optimization-core` for the\n * authoritative definition and documentation.\n *\n * @public\n */\nexport { ANONYMOUS_ID_COOKIE, ANONYMOUS_ID_KEY } from '@contentful/optimization-core/constants'\n"],"names":["OPTIMIZATION_NODE_SDK_VERSION","__OPTIMIZATION_VERSION__","OPTIMIZATION_NODE_SDK_NAME","__OPTIMIZATION_PACKAGE_NAME__"],"mappings":"AAYO,MAAMA,gCACoCC;AAS1C,MAAMC,6BAEPC"}
|
package/dist/index.cjs
CHANGED
|
@@ -6,7 +6,7 @@ var __webpack_modules__ = {
|
|
|
6
6
|
OPTIMIZATION_NODE_SDK_VERSION: ()=>OPTIMIZATION_NODE_SDK_VERSION
|
|
7
7
|
});
|
|
8
8
|
require("@contentful/optimization-core/constants");
|
|
9
|
-
const OPTIMIZATION_NODE_SDK_VERSION = "2.
|
|
9
|
+
const OPTIMIZATION_NODE_SDK_VERSION = "2.2.1";
|
|
10
10
|
const OPTIMIZATION_NODE_SDK_NAME = "@contentful/optimization-node";
|
|
11
11
|
}
|
|
12
12
|
};
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../src/constants.ts","webpack://webpack/runtime/define_property_getters","webpack://webpack/runtime/has_own_property","webpack://webpack/runtime/make_namespace_object","../src/ContentfulOptimization.ts","../src/handoff.ts","../src/index.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/naming-convention -- Replaced at build-time\ndeclare const __OPTIMIZATION_VERSION__: string | undefined\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Replaced at build-time\ndeclare const __OPTIMIZATION_PACKAGE_NAME__: string | undefined\n\n/**\n * The current version of the Optimization Node SDK, injected at build-time.\n *\n * @defaultValue `'0.0.0'` when the build-time replacement is unavailable.\n *\n * @public\n */\nexport const OPTIMIZATION_NODE_SDK_VERSION =\n typeof __OPTIMIZATION_VERSION__ === 'string' ? __OPTIMIZATION_VERSION__ : '0.0.0'\n\n/**\n * The package name of the Optimization Node SDK, injected at build-time.\n *\n * @defaultValue `'@contentful/optimization-node'` when the build-time replacement is unavailable.\n *\n * @public\n */\nexport const OPTIMIZATION_NODE_SDK_NAME =\n typeof __OPTIMIZATION_PACKAGE_NAME__ === 'string'\n ? __OPTIMIZATION_PACKAGE_NAME__\n : '@contentful/optimization-node'\n\n/**\n * Re-exports of anonymous identifier constants used by the Optimization Core.\n *\n * @remarks\n * This constant is surfaced here to provide a stable import path for Node SDK\n * consumers. It represents the cookie key used by the Optimization Framework\n * to persist an anonymous identifier for tracking optimization and insights\n * events when no explicit profile is known.\n *\n * @example\n * ```ts\n * import { ANONYMOUS_ID_COOKIE, ANONYMOUS_ID_KEY } from '@contentful/optimization-node/constants'\n * const cookieId = request.cookies[ANONYMOUS_ID_COOKIE]\n * const storageId = localStorage.getItem(ANONYMOUS_ID_KEY)\n * ```\n *\n * @see {@link ANONYMOUS_ID_COOKIE} and {@link ANONYMOUS_ID_KEY} in\n * `@contentful/optimization-core` for the\n * authoritative definition and documentation.\n *\n * @public\n */\nexport { ANONYMOUS_ID_COOKIE, ANONYMOUS_ID_KEY } from '@contentful/optimization-core/constants'\n","__webpack_require__.d = (exports, getters, values) => {\n\tvar define = (defs, kind) => {\n\t\tfor(var key in defs) {\n\t\t\tif(__webpack_require__.o(defs, key) && !__webpack_require__.o(exports, key)) {\n\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, [kind]: defs[key] });\n\t\t\t}\n\t\t}\n\t};\n\tdefine(getters, \"get\");\n\tdefine(values, \"value\");\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import {\n CoreStateless,\n type CoreStatelessConfig,\n type EventType,\n} from '@contentful/optimization-core'\nimport type { App } from '@contentful/optimization-core/api-schemas'\nimport { OPTIMIZATION_NODE_SDK_NAME, OPTIMIZATION_NODE_SDK_VERSION } from './constants'\n\nconst DEFAULT_NODE_ALLOWED_EVENT_TYPES: EventType[] = ['identify', 'page']\n\n/**\n * Public Node event-builder overrides accepted by {@link OptimizationNodeConfig.eventBuilder}.\n *\n * @remarks\n * Request-scoped consent is bound with {@link ContentfulOptimization.forRequest}, so `getConsent`\n * is intentionally omitted from singleton SDK configuration.\n *\n * @public\n */\nexport type PublicNodeEventBuilderConfig = Partial<\n Omit<NonNullable<CoreStatelessConfig['eventBuilder']>, 'app' | 'getConsent'>\n>\n\n/**\n * Configuration for the Node-specific ContentfulOptimization SDK.\n *\n * @remarks\n * This configuration extends {@link CoreStatelessConfig} but allows partial\n * overrides of the event-builder configuration. SDKs commonly inject their own\n * library metadata or channel definitions.\n *\n * @see {@link CoreStatelessConfig}\n *\n * @public\n */\nexport interface OptimizationNodeConfig extends Omit<CoreStatelessConfig, 'eventBuilder'> {\n /**\n * The application definition used to attribute events to a specific consumer app.\n *\n * @remarks\n * When not provided, events will not contain app metadata in their context.\n */\n app?: App\n\n /**\n * Partial overrides for the event builder configuration.\n *\n * @remarks\n * Any provided fields are merged with the default Node SDK metadata.\n * Request-scoped consent should be bound with `forRequest()`, not configured\n * on the SDK singleton.\n *\n * This differs from {@link CoreStatelessConfig} eventBuilder, which expects\n * a full configuration object.\n */\n eventBuilder?: PublicNodeEventBuilderConfig\n}\n\n/**\n * Node-specific ContentfulOptimization SDK built on {@link CoreStateless}.\n *\n * @remarks\n * This class adapts the stateless ContentfulOptimization Core for Node runtimes by\n * applying environment-appropriate defaults (e.g., server channel, Node SDK\n * library metadata). No core runtime behavior is modified; only configuration\n * defaults differ.\n *\n * @example\n * ```ts\n * import ContentfulOptimization from '@contentful/optimization-node'\n *\n * const sdk = new ContentfulOptimization({\n * spaceId: 'abc-123',\n * environment: 'master',\n * logLevel: 'info',\n * })\n *\n * const requestOptimization = sdk.forRequest({\n * consent: true,\n * locale: 'fr-CA',\n * profile: { id: 'profile-id' },\n * })\n *\n * const { accepted, data } = await requestOptimization.page()\n * ```\n *\n * @see {@link CoreStateless}\n *\n * @public\n */\nclass ContentfulOptimization extends CoreStateless {\n /**\n * Create an instance of the Node SDK with merged defaults.\n *\n * @param config - Partial Node-specific configuration. Any eventBuilder\n * fields provided are merged with Node's defaults.\n *\n * @example\n * ```ts\n * import ContentfulOptimization from '@contentful/optimization-node'\n *\n * const optimization = new ContentfulOptimization({ spaceId: 'my-space-id' })\n * ```\n */\n constructor({ app, allowedEventTypes, eventBuilder, ...config }: OptimizationNodeConfig) {\n const { library, ...eventBuilderConfig } = eventBuilder ?? {}\n\n super({\n ...config,\n allowedEventTypes: allowedEventTypes ?? DEFAULT_NODE_ALLOWED_EVENT_TYPES,\n eventBuilder: {\n app,\n channel: 'server',\n ...eventBuilderConfig,\n library: {\n name: OPTIMIZATION_NODE_SDK_NAME,\n version: OPTIMIZATION_NODE_SDK_VERSION,\n ...library,\n },\n getConsent: () => false,\n },\n })\n }\n}\n\nexport default ContentfulOptimization\n","import {\n assertOptimizationCacheSafety,\n type ManagedEntryHandoff,\n type OptimizationCacheMetadata,\n type OptimizationData,\n type OptimizationHandoff,\n type PrivateRequestOptimizationCacheMetadata,\n} from '@contentful/optimization-core'\n\nfunction assertRequestHandoffCacheMetadata(\n cache: OptimizationCacheMetadata,\n): asserts cache is PrivateRequestOptimizationCacheMetadata {\n if (cache.scope === 'private-request') return\n\n throw new TypeError(\n 'Request handoffs must use private-request cache scope. Use public permutation handoffs for public cache scopes, or a non-request handoff for static output.',\n )\n}\n\n/**\n * Create a framework-neutral handoff from completed Node request optimization data.\n *\n * @remarks\n * This helper serializes data that a caller already received from a request-bound Experience call.\n * It does not emit page or analytics events.\n *\n * @public\n */\nexport function createRequestHandoffFromData(input: {\n readonly data?: OptimizationData\n readonly entries?: readonly ManagedEntryHandoff[]\n readonly cache?: PrivateRequestOptimizationCacheMetadata\n}): OptimizationHandoff {\n const cache: PrivateRequestOptimizationCacheMetadata = input.cache ?? { scope: 'private-request' }\n assertRequestHandoffCacheMetadata(cache)\n\n const handoff: OptimizationHandoff = {\n cache,\n ...(input.entries === undefined ? {} : { entries: input.entries }),\n ...(input.data === undefined\n ? {}\n : {\n state: {\n selectedOptimizations: input.data.selectedOptimizations,\n changes: input.data.changes,\n profile: input.data.profile,\n },\n }),\n }\n\n assertOptimizationCacheSafety(handoff)\n\n return handoff\n}\n","/**\n * Contentful ContentfulOptimization Node SDK.\n *\n * @remarks\n * Adds Node-specific defaults via the {@link ContentfulOptimization} class.\n * Core and transitive API exports are available from dedicated entrypoints:\n * `@contentful/optimization-node/core-sdk`,\n * `@contentful/optimization-node/api-client`,\n * and `@contentful/optimization-node/api-schemas`.\n *\n * @packageDocumentation\n */\n\nimport ContentfulOptimization from './ContentfulOptimization'\n\nexport { OPTIMIZATION_NODE_SDK_NAME, OPTIMIZATION_NODE_SDK_VERSION } from './constants'\nexport * from './ContentfulOptimization'\nexport * from './handoff'\n\nexport default ContentfulOptimization\n"],"names":["OPTIMIZATION_NODE_SDK_VERSION","__OPTIMIZATION_VERSION__","OPTIMIZATION_NODE_SDK_NAME","__OPTIMIZATION_PACKAGE_NAME__","__webpack_require__","getters","values","define","defs","kind","key","Object","obj","prop","Symbol","DEFAULT_NODE_ALLOWED_EVENT_TYPES","ContentfulOptimization","CoreStateless","app","allowedEventTypes","eventBuilder","config","library","eventBuilderConfig","assertRequestHandoffCacheMetadata","cache","TypeError","createRequestHandoffFromData","input","handoff","undefined","assertOptimizationCacheSafety"],"mappings":";;;;;;;;QAYO,MAAMA,gCACoCC;QAS1C,MAAMC,6BAEPC;;;;;;;;;;;;;;ICxBNC,oBAAoB,CAAC,GAAG,CAAC,UAASC,SAASC;QAC1C,IAAIC,SAAS,CAACC,MAAMC;YACnB,IAAI,IAAIC,OAAOF,KACd,IAAGJ,oBAAoB,CAAC,CAACI,MAAME,QAAQ,CAACN,oBAAoB,CAAC,CAAC,UAASM,MACtEC,OAAO,cAAc,CAAC,UAASD,KAAK;gBAAE,YAAY;gBAAM,CAACD,KAAK,EAAED,IAAI,CAACE,IAAI;YAAC;QAG7E;QACAH,OAAOF,SAAS;QAChBE,OAAOD,QAAQ;IAChB;;;ICVAF,oBAAoB,CAAC,GAAG,CAACQ,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFT,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,MAAlB,OAAOU,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D;;;;;;;;;;;;;ICEA,MAAMI,mCAAgD;QAAC;QAAY;KAAO;IAkF1E,MAAMC,+BAA+BC,kCAAAA,aAAaA;QAchD,YAAY,EAAEC,GAAG,EAAEC,iBAAiB,EAAEC,YAAY,EAAE,GAAGC,QAAgC,CAAE;YACvF,MAAM,EAAEC,OAAO,EAAE,GAAGC,oBAAoB,GAAGH,gBAAgB,CAAC;YAE5D,KAAK,CAAC;gBACJ,GAAGC,MAAM;gBACT,mBAAmBF,qBAAqBJ;gBACxC,cAAc;oBACZG;oBACA,SAAS;oBACT,GAAGK,kBAAkB;oBACrB,SAAS;wBACP,MAAMrB,UAAAA,0BAA0BA;wBAChC,SAASF,UAAAA,6BAA6BA;wBACtC,GAAGsB,OAAO;oBACZ;oBACA,YAAY,IAAM;gBACpB;YACF;QACF;IACF;IAEA,mCAAeN;ICpHf,SAASQ,kCACPC,KAAgC;QAEhC,IAAIA,AAAgB,sBAAhBA,MAAM,KAAK,EAAwB;QAEvC,MAAM,IAAIC,UACR;IAEJ;IAWO,SAASC,6BAA6BC,KAI5C;QACC,MAAMH,QAAiDG,MAAM,KAAK,IAAI;YAAE,OAAO;QAAkB;QACjGJ,kCAAkCC;QAElC,MAAMI,UAA+B;YACnCJ;YACA,GAAIG,AAAkBE,WAAlBF,MAAM,OAAO,GAAiB,CAAC,IAAI;gBAAE,SAASA,MAAM,OAAO;YAAC,CAAC;YACjE,GAAIA,AAAeE,WAAfF,MAAM,IAAI,GACV,CAAC,IACD;gBACE,OAAO;oBACL,uBAAuBA,MAAM,IAAI,CAAC,qBAAqB;oBACvD,SAASA,MAAM,IAAI,CAAC,OAAO;oBAC3B,SAASA,MAAM,IAAI,CAAC,OAAO;gBAC7B;YACF,CAAC;QACP;QAEAG,IAAAA,kCAAAA,6BAAAA,AAAAA,EAA8BF;QAE9B,OAAOA;IACT;IClCA,YAAeb"}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/constants.ts","webpack://webpack/runtime/define_property_getters","webpack://webpack/runtime/has_own_property","webpack://webpack/runtime/make_namespace_object","../src/ContentfulOptimization.ts","../src/handoff.ts","../src/index.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/naming-convention -- Replaced at build-time\ndeclare const __OPTIMIZATION_VERSION__: string | undefined\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Replaced at build-time\ndeclare const __OPTIMIZATION_PACKAGE_NAME__: string | undefined\n\n/**\n * The current version of the Optimization Node SDK, injected at build-time.\n *\n * @defaultValue `'0.0.0'` when the build-time replacement is unavailable.\n *\n * @public\n */\nexport const OPTIMIZATION_NODE_SDK_VERSION =\n typeof __OPTIMIZATION_VERSION__ === 'string' ? __OPTIMIZATION_VERSION__ : '0.0.0'\n\n/**\n * The package name of the Optimization Node SDK, injected at build-time.\n *\n * @defaultValue `'@contentful/optimization-node'` when the build-time replacement is unavailable.\n *\n * @public\n */\nexport const OPTIMIZATION_NODE_SDK_NAME =\n typeof __OPTIMIZATION_PACKAGE_NAME__ === 'string'\n ? __OPTIMIZATION_PACKAGE_NAME__\n : '@contentful/optimization-node'\n\n/**\n * Re-exports of anonymous identifier constants used by the Optimization Core.\n *\n * @remarks\n * This constant is surfaced here to provide a stable import path for Node SDK\n * consumers. It represents the cookie key used by the Optimization Framework\n * to persist an anonymous identifier for Experience API continuity when no\n * complete profile is known. Insights events require a complete profile snapshot.\n *\n * @example\n * ```ts\n * import { ANONYMOUS_ID_COOKIE, ANONYMOUS_ID_KEY } from '@contentful/optimization-node/constants'\n * const cookieId = request.cookies[ANONYMOUS_ID_COOKIE]\n * const storageId = localStorage.getItem(ANONYMOUS_ID_KEY)\n * ```\n *\n * @see {@link ANONYMOUS_ID_COOKIE} and {@link ANONYMOUS_ID_KEY} in\n * `@contentful/optimization-core` for the\n * authoritative definition and documentation.\n *\n * @public\n */\nexport { ANONYMOUS_ID_COOKIE, ANONYMOUS_ID_KEY } from '@contentful/optimization-core/constants'\n","__webpack_require__.d = (exports, getters, values) => {\n\tvar define = (defs, kind) => {\n\t\tfor(var key in defs) {\n\t\t\tif(__webpack_require__.o(defs, key) && !__webpack_require__.o(exports, key)) {\n\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, [kind]: defs[key] });\n\t\t\t}\n\t\t}\n\t};\n\tdefine(getters, \"get\");\n\tdefine(values, \"value\");\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import {\n CoreStateless,\n type CoreStatelessConfig,\n type EventType,\n} from '@contentful/optimization-core'\nimport type { App } from '@contentful/optimization-core/api-schemas'\nimport { OPTIMIZATION_NODE_SDK_NAME, OPTIMIZATION_NODE_SDK_VERSION } from './constants'\n\nconst DEFAULT_NODE_ALLOWED_EVENT_TYPES: EventType[] = ['identify', 'page']\n\n/**\n * Public Node event-builder overrides accepted by {@link OptimizationNodeConfig.eventBuilder}.\n *\n * @remarks\n * Request-scoped consent is bound with {@link ContentfulOptimization.forRequest}, so `getConsent`\n * is intentionally omitted from singleton SDK configuration.\n *\n * @public\n */\nexport type PublicNodeEventBuilderConfig = Partial<\n Omit<NonNullable<CoreStatelessConfig['eventBuilder']>, 'app' | 'getConsent'>\n>\n\n/**\n * Configuration for the Node-specific ContentfulOptimization SDK.\n *\n * @remarks\n * This configuration extends {@link CoreStatelessConfig} but allows partial\n * overrides of the event-builder configuration. SDKs commonly inject their own\n * library metadata or channel definitions.\n *\n * @see {@link CoreStatelessConfig}\n *\n * @public\n */\nexport interface OptimizationNodeConfig extends Omit<CoreStatelessConfig, 'eventBuilder'> {\n /**\n * The application definition used to attribute events to a specific consumer app.\n *\n * @remarks\n * When not provided, events will not contain app metadata in their context.\n */\n app?: App\n\n /**\n * Partial overrides for the event builder configuration.\n *\n * @remarks\n * Any provided fields are merged with the default Node SDK metadata.\n * Request-scoped consent should be bound with `forRequest()`, not configured\n * on the SDK singleton.\n *\n * This differs from {@link CoreStatelessConfig} eventBuilder, which expects\n * a full configuration object.\n */\n eventBuilder?: PublicNodeEventBuilderConfig\n}\n\n/**\n * Node-specific ContentfulOptimization SDK built on {@link CoreStateless}.\n *\n * @remarks\n * This class adapts the stateless ContentfulOptimization Core for Node runtimes by\n * applying environment-appropriate defaults (e.g., server channel, Node SDK\n * library metadata). No core runtime behavior is modified; only configuration\n * defaults differ.\n *\n * @example\n * ```ts\n * import ContentfulOptimization from '@contentful/optimization-node'\n *\n * const sdk = new ContentfulOptimization({\n * spaceId: 'abc-123',\n * environment: 'master',\n * logLevel: 'info',\n * })\n *\n * const requestOptimization = sdk.forRequest({\n * consent: true,\n * locale: 'fr-CA',\n * profileId: 'profile-id',\n * })\n *\n * const { accepted, data } = await requestOptimization.page()\n * ```\n *\n * @see {@link CoreStateless}\n *\n * @public\n */\nclass ContentfulOptimization extends CoreStateless {\n /**\n * Create an instance of the Node SDK with merged defaults.\n *\n * @param config - Partial Node-specific configuration. Any eventBuilder\n * fields provided are merged with Node's defaults.\n *\n * @example\n * ```ts\n * import ContentfulOptimization from '@contentful/optimization-node'\n *\n * const optimization = new ContentfulOptimization({ spaceId: 'my-space-id' })\n * ```\n */\n constructor({ app, allowedEventTypes, eventBuilder, ...config }: OptimizationNodeConfig) {\n const { library, ...eventBuilderConfig } = eventBuilder ?? {}\n\n super({\n ...config,\n allowedEventTypes: allowedEventTypes ?? DEFAULT_NODE_ALLOWED_EVENT_TYPES,\n eventBuilder: {\n app,\n channel: 'server',\n ...eventBuilderConfig,\n library: {\n name: OPTIMIZATION_NODE_SDK_NAME,\n version: OPTIMIZATION_NODE_SDK_VERSION,\n ...library,\n },\n getConsent: () => false,\n },\n })\n }\n}\n\nexport default ContentfulOptimization\n","import {\n assertOptimizationCacheSafety,\n type ManagedEntryHandoff,\n type OptimizationCacheMetadata,\n type OptimizationData,\n type OptimizationHandoff,\n type PrivateRequestOptimizationCacheMetadata,\n} from '@contentful/optimization-core'\n\nfunction assertRequestHandoffCacheMetadata(\n cache: OptimizationCacheMetadata,\n): asserts cache is PrivateRequestOptimizationCacheMetadata {\n if (cache.scope === 'private-request') return\n\n throw new TypeError(\n 'Request handoffs must use private-request cache scope. Use public permutation handoffs for public cache scopes, or a non-request handoff for static output.',\n )\n}\n\n/**\n * Create a framework-neutral handoff from completed Node request optimization data.\n *\n * @remarks\n * This helper serializes data that a caller already received from a request-bound Experience call.\n * It does not emit page or analytics events.\n *\n * @public\n */\nexport function createRequestHandoffFromData(input: {\n readonly data?: OptimizationData\n readonly entries?: readonly ManagedEntryHandoff[]\n readonly cache?: PrivateRequestOptimizationCacheMetadata\n}): OptimizationHandoff {\n const cache: PrivateRequestOptimizationCacheMetadata = input.cache ?? { scope: 'private-request' }\n assertRequestHandoffCacheMetadata(cache)\n\n const handoff: OptimizationHandoff = {\n cache,\n ...(input.entries === undefined ? {} : { entries: input.entries }),\n ...(input.data === undefined\n ? {}\n : {\n state: {\n selectedOptimizations: input.data.selectedOptimizations,\n changes: input.data.changes,\n profile: input.data.profile,\n },\n }),\n }\n\n assertOptimizationCacheSafety(handoff)\n\n return handoff\n}\n","/**\n * Contentful ContentfulOptimization Node SDK.\n *\n * @remarks\n * Adds Node-specific defaults via the {@link ContentfulOptimization} class.\n * Core and transitive API exports are available from dedicated entrypoints:\n * `@contentful/optimization-node/core-sdk`,\n * `@contentful/optimization-node/api-client`,\n * and `@contentful/optimization-node/api-schemas`.\n *\n * @packageDocumentation\n */\n\nimport ContentfulOptimization from './ContentfulOptimization'\n\nexport { OPTIMIZATION_NODE_SDK_NAME, OPTIMIZATION_NODE_SDK_VERSION } from './constants'\nexport * from './ContentfulOptimization'\nexport * from './handoff'\n\nexport default ContentfulOptimization\n"],"names":["OPTIMIZATION_NODE_SDK_VERSION","__OPTIMIZATION_VERSION__","OPTIMIZATION_NODE_SDK_NAME","__OPTIMIZATION_PACKAGE_NAME__","__webpack_require__","getters","values","define","defs","kind","key","Object","obj","prop","Symbol","DEFAULT_NODE_ALLOWED_EVENT_TYPES","ContentfulOptimization","CoreStateless","app","allowedEventTypes","eventBuilder","config","library","eventBuilderConfig","assertRequestHandoffCacheMetadata","cache","TypeError","createRequestHandoffFromData","input","handoff","undefined","assertOptimizationCacheSafety"],"mappings":";;;;;;;;QAYO,MAAMA,gCACoCC;QAS1C,MAAMC,6BAEPC;;;;;;;;;;;;;;ICxBNC,oBAAoB,CAAC,GAAG,CAAC,UAASC,SAASC;QAC1C,IAAIC,SAAS,CAACC,MAAMC;YACnB,IAAI,IAAIC,OAAOF,KACd,IAAGJ,oBAAoB,CAAC,CAACI,MAAME,QAAQ,CAACN,oBAAoB,CAAC,CAAC,UAASM,MACtEC,OAAO,cAAc,CAAC,UAASD,KAAK;gBAAE,YAAY;gBAAM,CAACD,KAAK,EAAED,IAAI,CAACE,IAAI;YAAC;QAG7E;QACAH,OAAOF,SAAS;QAChBE,OAAOD,QAAQ;IAChB;;;ICVAF,oBAAoB,CAAC,GAAG,CAACQ,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFT,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,MAAlB,OAAOU,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D;;;;;;;;;;;;;ICEA,MAAMI,mCAAgD;QAAC;QAAY;KAAO;IAkF1E,MAAMC,+BAA+BC,kCAAAA,aAAaA;QAchD,YAAY,EAAEC,GAAG,EAAEC,iBAAiB,EAAEC,YAAY,EAAE,GAAGC,QAAgC,CAAE;YACvF,MAAM,EAAEC,OAAO,EAAE,GAAGC,oBAAoB,GAAGH,gBAAgB,CAAC;YAE5D,KAAK,CAAC;gBACJ,GAAGC,MAAM;gBACT,mBAAmBF,qBAAqBJ;gBACxC,cAAc;oBACZG;oBACA,SAAS;oBACT,GAAGK,kBAAkB;oBACrB,SAAS;wBACP,MAAMrB,UAAAA,0BAA0BA;wBAChC,SAASF,UAAAA,6BAA6BA;wBACtC,GAAGsB,OAAO;oBACZ;oBACA,YAAY,IAAM;gBACpB;YACF;QACF;IACF;IAEA,mCAAeN;ICpHf,SAASQ,kCACPC,KAAgC;QAEhC,IAAIA,AAAgB,sBAAhBA,MAAM,KAAK,EAAwB;QAEvC,MAAM,IAAIC,UACR;IAEJ;IAWO,SAASC,6BAA6BC,KAI5C;QACC,MAAMH,QAAiDG,MAAM,KAAK,IAAI;YAAE,OAAO;QAAkB;QACjGJ,kCAAkCC;QAElC,MAAMI,UAA+B;YACnCJ;YACA,GAAIG,AAAkBE,WAAlBF,MAAM,OAAO,GAAiB,CAAC,IAAI;gBAAE,SAASA,MAAM,OAAO;YAAC,CAAC;YACjE,GAAIA,AAAeE,WAAfF,MAAM,IAAI,GACV,CAAC,IACD;gBACE,OAAO;oBACL,uBAAuBA,MAAM,IAAI,CAAC,qBAAqB;oBACvD,SAASA,MAAM,IAAI,CAAC,OAAO;oBAC3B,SAASA,MAAM,IAAI,CAAC,OAAO;gBAC7B;YACF,CAAC;QACP;QAEAG,IAAAA,kCAAAA,6BAAAA,AAAAA,EAA8BF;QAE9B,OAAOA;IACT;IClCA,YAAeb"}
|
package/dist/index.d.cts
CHANGED
|
@@ -41,7 +41,7 @@ import { PrivateRequestOptimizationCacheMetadata } from '@contentful/optimizatio
|
|
|
41
41
|
* const requestOptimization = sdk.forRequest({
|
|
42
42
|
* consent: true,
|
|
43
43
|
* locale: 'fr-CA',
|
|
44
|
-
*
|
|
44
|
+
* profileId: 'profile-id',
|
|
45
45
|
* })
|
|
46
46
|
*
|
|
47
47
|
* const { accepted, data } = await requestOptimization.page()
|
package/dist/index.d.mts
CHANGED
|
@@ -41,7 +41,7 @@ import { PrivateRequestOptimizationCacheMetadata } from '@contentful/optimizatio
|
|
|
41
41
|
* const requestOptimization = sdk.forRequest({
|
|
42
42
|
* consent: true,
|
|
43
43
|
* locale: 'fr-CA',
|
|
44
|
-
*
|
|
44
|
+
* profileId: 'profile-id',
|
|
45
45
|
* })
|
|
46
46
|
*
|
|
47
47
|
* const { accepted, data } = await requestOptimization.page()
|
package/dist/index.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ import { PrivateRequestOptimizationCacheMetadata } from '@contentful/optimizatio
|
|
|
41
41
|
* const requestOptimization = sdk.forRequest({
|
|
42
42
|
* consent: true,
|
|
43
43
|
* locale: 'fr-CA',
|
|
44
|
-
*
|
|
44
|
+
* profileId: 'profile-id',
|
|
45
45
|
* })
|
|
46
46
|
*
|
|
47
47
|
* const { accepted, data } = await requestOptimization.page()
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../src/ContentfulOptimization.ts","../src/handoff.ts","../src/index.ts"],"sourcesContent":["import {\n CoreStateless,\n type CoreStatelessConfig,\n type EventType,\n} from '@contentful/optimization-core'\nimport type { App } from '@contentful/optimization-core/api-schemas'\nimport { OPTIMIZATION_NODE_SDK_NAME, OPTIMIZATION_NODE_SDK_VERSION } from './constants'\n\nconst DEFAULT_NODE_ALLOWED_EVENT_TYPES: EventType[] = ['identify', 'page']\n\n/**\n * Public Node event-builder overrides accepted by {@link OptimizationNodeConfig.eventBuilder}.\n *\n * @remarks\n * Request-scoped consent is bound with {@link ContentfulOptimization.forRequest}, so `getConsent`\n * is intentionally omitted from singleton SDK configuration.\n *\n * @public\n */\nexport type PublicNodeEventBuilderConfig = Partial<\n Omit<NonNullable<CoreStatelessConfig['eventBuilder']>, 'app' | 'getConsent'>\n>\n\n/**\n * Configuration for the Node-specific ContentfulOptimization SDK.\n *\n * @remarks\n * This configuration extends {@link CoreStatelessConfig} but allows partial\n * overrides of the event-builder configuration. SDKs commonly inject their own\n * library metadata or channel definitions.\n *\n * @see {@link CoreStatelessConfig}\n *\n * @public\n */\nexport interface OptimizationNodeConfig extends Omit<CoreStatelessConfig, 'eventBuilder'> {\n /**\n * The application definition used to attribute events to a specific consumer app.\n *\n * @remarks\n * When not provided, events will not contain app metadata in their context.\n */\n app?: App\n\n /**\n * Partial overrides for the event builder configuration.\n *\n * @remarks\n * Any provided fields are merged with the default Node SDK metadata.\n * Request-scoped consent should be bound with `forRequest()`, not configured\n * on the SDK singleton.\n *\n * This differs from {@link CoreStatelessConfig} eventBuilder, which expects\n * a full configuration object.\n */\n eventBuilder?: PublicNodeEventBuilderConfig\n}\n\n/**\n * Node-specific ContentfulOptimization SDK built on {@link CoreStateless}.\n *\n * @remarks\n * This class adapts the stateless ContentfulOptimization Core for Node runtimes by\n * applying environment-appropriate defaults (e.g., server channel, Node SDK\n * library metadata). No core runtime behavior is modified; only configuration\n * defaults differ.\n *\n * @example\n * ```ts\n * import ContentfulOptimization from '@contentful/optimization-node'\n *\n * const sdk = new ContentfulOptimization({\n * spaceId: 'abc-123',\n * environment: 'master',\n * logLevel: 'info',\n * })\n *\n * const requestOptimization = sdk.forRequest({\n * consent: true,\n * locale: 'fr-CA',\n *
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../src/ContentfulOptimization.ts","../src/handoff.ts","../src/index.ts"],"sourcesContent":["import {\n CoreStateless,\n type CoreStatelessConfig,\n type EventType,\n} from '@contentful/optimization-core'\nimport type { App } from '@contentful/optimization-core/api-schemas'\nimport { OPTIMIZATION_NODE_SDK_NAME, OPTIMIZATION_NODE_SDK_VERSION } from './constants'\n\nconst DEFAULT_NODE_ALLOWED_EVENT_TYPES: EventType[] = ['identify', 'page']\n\n/**\n * Public Node event-builder overrides accepted by {@link OptimizationNodeConfig.eventBuilder}.\n *\n * @remarks\n * Request-scoped consent is bound with {@link ContentfulOptimization.forRequest}, so `getConsent`\n * is intentionally omitted from singleton SDK configuration.\n *\n * @public\n */\nexport type PublicNodeEventBuilderConfig = Partial<\n Omit<NonNullable<CoreStatelessConfig['eventBuilder']>, 'app' | 'getConsent'>\n>\n\n/**\n * Configuration for the Node-specific ContentfulOptimization SDK.\n *\n * @remarks\n * This configuration extends {@link CoreStatelessConfig} but allows partial\n * overrides of the event-builder configuration. SDKs commonly inject their own\n * library metadata or channel definitions.\n *\n * @see {@link CoreStatelessConfig}\n *\n * @public\n */\nexport interface OptimizationNodeConfig extends Omit<CoreStatelessConfig, 'eventBuilder'> {\n /**\n * The application definition used to attribute events to a specific consumer app.\n *\n * @remarks\n * When not provided, events will not contain app metadata in their context.\n */\n app?: App\n\n /**\n * Partial overrides for the event builder configuration.\n *\n * @remarks\n * Any provided fields are merged with the default Node SDK metadata.\n * Request-scoped consent should be bound with `forRequest()`, not configured\n * on the SDK singleton.\n *\n * This differs from {@link CoreStatelessConfig} eventBuilder, which expects\n * a full configuration object.\n */\n eventBuilder?: PublicNodeEventBuilderConfig\n}\n\n/**\n * Node-specific ContentfulOptimization SDK built on {@link CoreStateless}.\n *\n * @remarks\n * This class adapts the stateless ContentfulOptimization Core for Node runtimes by\n * applying environment-appropriate defaults (e.g., server channel, Node SDK\n * library metadata). No core runtime behavior is modified; only configuration\n * defaults differ.\n *\n * @example\n * ```ts\n * import ContentfulOptimization from '@contentful/optimization-node'\n *\n * const sdk = new ContentfulOptimization({\n * spaceId: 'abc-123',\n * environment: 'master',\n * logLevel: 'info',\n * })\n *\n * const requestOptimization = sdk.forRequest({\n * consent: true,\n * locale: 'fr-CA',\n * profileId: 'profile-id',\n * })\n *\n * const { accepted, data } = await requestOptimization.page()\n * ```\n *\n * @see {@link CoreStateless}\n *\n * @public\n */\nclass ContentfulOptimization extends CoreStateless {\n /**\n * Create an instance of the Node SDK with merged defaults.\n *\n * @param config - Partial Node-specific configuration. Any eventBuilder\n * fields provided are merged with Node's defaults.\n *\n * @example\n * ```ts\n * import ContentfulOptimization from '@contentful/optimization-node'\n *\n * const optimization = new ContentfulOptimization({ spaceId: 'my-space-id' })\n * ```\n */\n constructor({ app, allowedEventTypes, eventBuilder, ...config }: OptimizationNodeConfig) {\n const { library, ...eventBuilderConfig } = eventBuilder ?? {}\n\n super({\n ...config,\n allowedEventTypes: allowedEventTypes ?? DEFAULT_NODE_ALLOWED_EVENT_TYPES,\n eventBuilder: {\n app,\n channel: 'server',\n ...eventBuilderConfig,\n library: {\n name: OPTIMIZATION_NODE_SDK_NAME,\n version: OPTIMIZATION_NODE_SDK_VERSION,\n ...library,\n },\n getConsent: () => false,\n },\n })\n }\n}\n\nexport default ContentfulOptimization\n","import {\n assertOptimizationCacheSafety,\n type ManagedEntryHandoff,\n type OptimizationCacheMetadata,\n type OptimizationData,\n type OptimizationHandoff,\n type PrivateRequestOptimizationCacheMetadata,\n} from '@contentful/optimization-core'\n\nfunction assertRequestHandoffCacheMetadata(\n cache: OptimizationCacheMetadata,\n): asserts cache is PrivateRequestOptimizationCacheMetadata {\n if (cache.scope === 'private-request') return\n\n throw new TypeError(\n 'Request handoffs must use private-request cache scope. Use public permutation handoffs for public cache scopes, or a non-request handoff for static output.',\n )\n}\n\n/**\n * Create a framework-neutral handoff from completed Node request optimization data.\n *\n * @remarks\n * This helper serializes data that a caller already received from a request-bound Experience call.\n * It does not emit page or analytics events.\n *\n * @public\n */\nexport function createRequestHandoffFromData(input: {\n readonly data?: OptimizationData\n readonly entries?: readonly ManagedEntryHandoff[]\n readonly cache?: PrivateRequestOptimizationCacheMetadata\n}): OptimizationHandoff {\n const cache: PrivateRequestOptimizationCacheMetadata = input.cache ?? { scope: 'private-request' }\n assertRequestHandoffCacheMetadata(cache)\n\n const handoff: OptimizationHandoff = {\n cache,\n ...(input.entries === undefined ? {} : { entries: input.entries }),\n ...(input.data === undefined\n ? {}\n : {\n state: {\n selectedOptimizations: input.data.selectedOptimizations,\n changes: input.data.changes,\n profile: input.data.profile,\n },\n }),\n }\n\n assertOptimizationCacheSafety(handoff)\n\n return handoff\n}\n","/**\n * Contentful ContentfulOptimization Node SDK.\n *\n * @remarks\n * Adds Node-specific defaults via the {@link ContentfulOptimization} class.\n * Core and transitive API exports are available from dedicated entrypoints:\n * `@contentful/optimization-node/core-sdk`,\n * `@contentful/optimization-node/api-client`,\n * and `@contentful/optimization-node/api-schemas`.\n *\n * @packageDocumentation\n */\n\nimport ContentfulOptimization from './ContentfulOptimization'\n\nexport { OPTIMIZATION_NODE_SDK_NAME, OPTIMIZATION_NODE_SDK_VERSION } from './constants'\nexport * from './ContentfulOptimization'\nexport * from './handoff'\n\nexport default ContentfulOptimization\n"],"names":["DEFAULT_NODE_ALLOWED_EVENT_TYPES","ContentfulOptimization","CoreStateless","app","allowedEventTypes","eventBuilder","config","library","eventBuilderConfig","OPTIMIZATION_NODE_SDK_NAME","OPTIMIZATION_NODE_SDK_VERSION","assertRequestHandoffCacheMetadata","cache","TypeError","createRequestHandoffFromData","input","handoff","undefined","assertOptimizationCacheSafety"],"mappings":";;AAQA,MAAMA,mCAAgD;IAAC;IAAY;CAAO;AAkF1E,MAAMC,+BAA+BC;IAcnC,YAAY,EAAEC,GAAG,EAAEC,iBAAiB,EAAEC,YAAY,EAAE,GAAGC,QAAgC,CAAE;QACvF,MAAM,EAAEC,OAAO,EAAE,GAAGC,oBAAoB,GAAGH,gBAAgB,CAAC;QAE5D,KAAK,CAAC;YACJ,GAAGC,MAAM;YACT,mBAAmBF,qBAAqBJ;YACxC,cAAc;gBACZG;gBACA,SAAS;gBACT,GAAGK,kBAAkB;gBACrB,SAAS;oBACP,MAAMC;oBACN,SAASC;oBACT,GAAGH,OAAO;gBACZ;gBACA,YAAY,IAAM;YACpB;QACF;IACF;AACF;AAEA,mCAAeN;ACpHf,SAASU,kCACPC,KAAgC;IAEhC,IAAIA,AAAgB,sBAAhBA,MAAM,KAAK,EAAwB;IAEvC,MAAM,IAAIC,UACR;AAEJ;AAWO,SAASC,6BAA6BC,KAI5C;IACC,MAAMH,QAAiDG,MAAM,KAAK,IAAI;QAAE,OAAO;IAAkB;IACjGJ,kCAAkCC;IAElC,MAAMI,UAA+B;QACnCJ;QACA,GAAIG,AAAkBE,WAAlBF,MAAM,OAAO,GAAiB,CAAC,IAAI;YAAE,SAASA,MAAM,OAAO;QAAC,CAAC;QACjE,GAAIA,AAAeE,WAAfF,MAAM,IAAI,GACV,CAAC,IACD;YACE,OAAO;gBACL,uBAAuBA,MAAM,IAAI,CAAC,qBAAqB;gBACvD,SAASA,MAAM,IAAI,CAAC,OAAO;gBAC3B,SAASA,MAAM,IAAI,CAAC,OAAO;YAC7B;QACF,CAAC;IACP;IAEAG,8BAA8BF;IAE9B,OAAOA;AACT;AClCA,YAAef"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/optimization-node",
|
|
3
3
|
"description": "Node.js SDK for Contentful Optimization",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.2.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
}
|
|
89
89
|
},
|
|
90
90
|
"dependencies": {
|
|
91
|
-
"@contentful/optimization-core": "2.
|
|
91
|
+
"@contentful/optimization-core": "2.2.1"
|
|
92
92
|
},
|
|
93
93
|
"devDependencies": {
|
|
94
94
|
"@contentful/rich-text-html-renderer": "^17.1.6",
|