@contentful/optimization-node 1.2.1 → 2.0.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 +30 -24
- package/THIRD_PARTY_NOTICES.txt +28 -55
- package/dist/api-client.cjs +9 -5
- package/dist/api-client.cjs.map +1 -1
- package/dist/api-client.mjs +0 -1
- package/dist/api-schemas.cjs +9 -5
- package/dist/api-schemas.cjs.map +1 -1
- package/dist/api-schemas.mjs +0 -1
- package/dist/constants.cjs +11 -7
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.mjs +6 -1
- package/dist/constants.mjs.map +1 -0
- package/dist/core-sdk.cjs +12 -8
- package/dist/core-sdk.cjs.map +1 -1
- package/dist/core-sdk.mjs +0 -1
- package/dist/index.cjs +12 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/dist/logger.cjs +12 -8
- package/dist/logger.cjs.map +1 -1
- package/dist/logger.mjs +1 -3
- package/package.json +34 -2
- package/dist/260.mjs +0 -6
- package/dist/260.mjs.map +0 -1
- package/dist/987.mjs +0 -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-
|
|
3
|
+
<img alt="Contentful Logo" title="Contentful" src="https://raw.githubusercontent.com/contentful/optimization/optimization-node-v2.0.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-
|
|
14
|
+
[Reference](https://contentful.github.io/optimization) · [Contributing](https://github.com/contentful/optimization/blob/optimization-node-v2.0.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-
|
|
19
|
+
[Optimization Core SDK](https://github.com/contentful/optimization/blob/optimization-node-v2.0.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
|
|
@@ -25,6 +25,12 @@ for the step-by-step flow. This README keeps the package orientation and common
|
|
|
25
25
|
at hand; generated [reference documentation](https://contentful.github.io/optimization) remains the
|
|
26
26
|
source of truth for exported API signatures.
|
|
27
27
|
|
|
28
|
+
> [!IMPORTANT]
|
|
29
|
+
>
|
|
30
|
+
> Upgrading from v1? Follow the
|
|
31
|
+
> [v1-to-v2 migration guide](https://contentful.github.io/optimization/documents/Documentation.Guides.migrating-optimization-sdk-packages-from-v1-to-v2.html)
|
|
32
|
+
> before changing package versions.
|
|
33
|
+
|
|
28
34
|
<details>
|
|
29
35
|
<summary>Table of Contents</summary>
|
|
30
36
|
<!-- mtoc-start -->
|
|
@@ -63,8 +69,8 @@ Create the SDK once per module or process, then bind consent and request context
|
|
|
63
69
|
|
|
64
70
|
```ts
|
|
65
71
|
const optimization = new ContentfulOptimization({
|
|
66
|
-
|
|
67
|
-
environment: '
|
|
72
|
+
spaceId: 'your-space-id',
|
|
73
|
+
environment: 'master',
|
|
68
74
|
locale: 'en-US',
|
|
69
75
|
})
|
|
70
76
|
|
|
@@ -104,20 +110,20 @@ are part of the same application.
|
|
|
104
110
|
|
|
105
111
|
The Node SDK is stateless. It does not maintain consent, profile, or browser persistence state
|
|
106
112
|
between requests. For cross-SDK consent guidance, see
|
|
107
|
-
[Consent management in the Optimization SDK Suite](https://github.com/contentful/optimization/blob/optimization-node-
|
|
108
|
-
|
|
109
|
-
| Option | Required? | Default | Description
|
|
110
|
-
| ------------------- | --------- | ---------------------- |
|
|
111
|
-
| `
|
|
112
|
-
| `environment` | No | `'
|
|
113
|
-
| `api` | No | See API options below | Experience API and Insights API endpoint options
|
|
114
|
-
| `app` | No | `undefined` | Application metadata attached to outgoing event context
|
|
115
|
-
| `contentful` | No | `undefined` | App-owned `contentful.js` client, default query, and cache
|
|
116
|
-
| `locale` | No | `undefined` | Default SDK Experience API and event locale
|
|
117
|
-
| `fetchOptions` | No | SDK defaults | Fetch timeout and retry behavior
|
|
118
|
-
| `allowedEventTypes` | No | `['identify', 'page']` | Event types allowed before request event consent is granted
|
|
119
|
-
| `eventBuilder` | No | Node SDK defaults | Event metadata overrides for SDK-layer authors
|
|
120
|
-
| `logLevel` | No | `'error'` | Minimum log level for the default console sink
|
|
113
|
+
[Consent management in the Optimization SDK Suite](https://github.com/contentful/optimization/blob/optimization-node-v2.0.1/documentation/concepts/consent-management-in-the-optimization-sdk-suite.md).
|
|
114
|
+
|
|
115
|
+
| Option | Required? | Default | Description |
|
|
116
|
+
| ------------------- | --------- | ---------------------- | ------------------------------------------------------------------------------- |
|
|
117
|
+
| `spaceId` | Yes | N/A | Contentful Space identifier used for Experience and Insights API requests |
|
|
118
|
+
| `environment` | No | `'master'` | Contentful environment identifier used for Experience and Insights API requests |
|
|
119
|
+
| `api` | No | See API options below | Experience API and Insights API endpoint options |
|
|
120
|
+
| `app` | No | `undefined` | Application metadata attached to outgoing event context |
|
|
121
|
+
| `contentful` | No | `undefined` | App-owned `contentful.js` client, default query, and cache |
|
|
122
|
+
| `locale` | No | `undefined` | Default SDK Experience API and event locale |
|
|
123
|
+
| `fetchOptions` | No | SDK defaults | Fetch timeout and retry behavior |
|
|
124
|
+
| `allowedEventTypes` | No | `['identify', 'page']` | Event types allowed before request event consent is granted |
|
|
125
|
+
| `eventBuilder` | No | Node SDK defaults | Event metadata overrides for SDK-layer authors |
|
|
126
|
+
| `logLevel` | No | `'error'` | Minimum log level for the default console sink |
|
|
121
127
|
|
|
122
128
|
Common `api` options:
|
|
123
129
|
|
|
@@ -229,9 +235,9 @@ when omitted; singleton calls require explicit `selectedOptimizations`.
|
|
|
229
235
|
|
|
230
236
|
```ts
|
|
231
237
|
const optimization = new ContentfulOptimization({
|
|
232
|
-
|
|
238
|
+
spaceId: 'space-id',
|
|
233
239
|
contentful: { client: contentfulClient },
|
|
234
|
-
environment: '
|
|
240
|
+
environment: 'master',
|
|
235
241
|
locale: appLocale,
|
|
236
242
|
})
|
|
237
243
|
|
|
@@ -315,9 +321,9 @@ package directory.
|
|
|
315
321
|
step-by-step server-side integration guide
|
|
316
322
|
- [Node SDK generated reference](https://contentful.github.io/optimization/modules/_contentful_optimization-node.html) -
|
|
317
323
|
exported API reference
|
|
318
|
-
- [Node reference implementation](https://github.com/contentful/optimization/blob/optimization-node-
|
|
324
|
+
- [Node reference implementation](https://github.com/contentful/optimization/blob/optimization-node-v2.0.1/implementations/node-sdk/README.md) - server-rendered
|
|
319
325
|
implementation using request-scoped SDK calls
|
|
320
|
-
- [Node + Web reference implementation](https://github.com/contentful/optimization/blob/optimization-node-
|
|
326
|
+
- [Node + Web reference implementation](https://github.com/contentful/optimization/blob/optimization-node-v2.0.1/implementations/node-sdk+web-sdk/README.md) -
|
|
321
327
|
hybrid SSR and browser implementation
|
|
322
|
-
- [Optimization Web SDK](https://github.com/contentful/optimization/blob/optimization-node-
|
|
328
|
+
- [Optimization Web SDK](https://github.com/contentful/optimization/blob/optimization-node-v2.0.1/packages/web/web-sdk/README.md) - browser SDK used when the same application
|
|
323
329
|
also needs client-side consent, persistence, tracking, or live updates
|
package/THIRD_PARTY_NOTICES.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
THE FOLLOWING SETS FORTH ATTRIBUTION NOTICES FOR THIRD PARTY SOFTWARE THAT MAY BE CONTAINED IN PORTIONS OF THIS PRODUCT
|
|
2
2
|
|
|
3
|
-
The following software may be included in this product: @babel/runtime (7.
|
|
3
|
+
The following software may be included in this product: @babel/runtime (7.29.2)
|
|
4
4
|
This software contains the following license and notice below:
|
|
5
5
|
|
|
6
6
|
MIT License
|
|
@@ -216,30 +216,6 @@ 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
|
-
|
|
243
219
|
The following software may be included in this product: agent-base (6.0.2)
|
|
244
220
|
This software contains the following license and notice below:
|
|
245
221
|
|
|
@@ -291,7 +267,7 @@ SOFTWARE.
|
|
|
291
267
|
|
|
292
268
|
---
|
|
293
269
|
|
|
294
|
-
The following software may be included in this product: axios (1.
|
|
270
|
+
The following software may be included in this product: axios (1.20.0)
|
|
295
271
|
This software contains the following license and notice below:
|
|
296
272
|
|
|
297
273
|
# Copyright (c) 2014-present Matt Zabriskie & Collaborators
|
|
@@ -761,7 +737,7 @@ OTHER DEALINGS IN THE SOFTWARE.
|
|
|
761
737
|
|
|
762
738
|
---
|
|
763
739
|
|
|
764
|
-
The following software may be included in this product: form-data (4.0.
|
|
740
|
+
The following software may be included in this product: form-data (4.0.6)
|
|
765
741
|
This software contains the following license and notice below:
|
|
766
742
|
|
|
767
743
|
Copyright (c) 2012 Felix Geisendörfer (felix@debuggable.com) and contributors
|
|
@@ -892,27 +868,39 @@ SOFTWARE.
|
|
|
892
868
|
|
|
893
869
|
---
|
|
894
870
|
|
|
895
|
-
The following software may be included in this product: has-
|
|
871
|
+
The following software may be included in this product: has-symbols (1.1.0)
|
|
896
872
|
This software contains the following license and notice below:
|
|
897
873
|
|
|
898
874
|
MIT License
|
|
899
875
|
|
|
900
|
-
Copyright (c)
|
|
876
|
+
Copyright (c) 2016 Jordan Harband
|
|
901
877
|
|
|
902
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
878
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
879
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
880
|
+
in the Software without restriction, including without limitation the rights
|
|
881
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
882
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
883
|
+
furnished to do so, subject to the following conditions:
|
|
903
884
|
|
|
904
|
-
The above copyright notice and this permission notice shall be included in all
|
|
885
|
+
The above copyright notice and this permission notice shall be included in all
|
|
886
|
+
copies or substantial portions of the Software.
|
|
905
887
|
|
|
906
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
888
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
889
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
890
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
891
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
892
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
893
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
894
|
+
SOFTWARE.
|
|
907
895
|
|
|
908
896
|
---
|
|
909
897
|
|
|
910
|
-
The following software may be included in this product: has-
|
|
898
|
+
The following software may be included in this product: has-tostringtag (1.0.2)
|
|
911
899
|
This software contains the following license and notice below:
|
|
912
900
|
|
|
913
901
|
MIT License
|
|
914
902
|
|
|
915
|
-
Copyright (c)
|
|
903
|
+
Copyright (c) 2021 Inspect JS
|
|
916
904
|
|
|
917
905
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
918
906
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -934,12 +922,12 @@ SOFTWARE.
|
|
|
934
922
|
|
|
935
923
|
---
|
|
936
924
|
|
|
937
|
-
The following software may be included in this product:
|
|
925
|
+
The following software may be included in this product: hasown (2.0.2)
|
|
938
926
|
This software contains the following license and notice below:
|
|
939
927
|
|
|
940
928
|
MIT License
|
|
941
929
|
|
|
942
|
-
Copyright (c)
|
|
930
|
+
Copyright (c) Jordan Harband and contributors
|
|
943
931
|
|
|
944
932
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
945
933
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -961,7 +949,7 @@ SOFTWARE.
|
|
|
961
949
|
|
|
962
950
|
---
|
|
963
951
|
|
|
964
|
-
The following software may be included in this product: hasown (2.0.
|
|
952
|
+
The following software may be included in this product: hasown (2.0.4)
|
|
965
953
|
This software contains the following license and notice below:
|
|
966
954
|
|
|
967
955
|
MIT License
|
|
@@ -1328,7 +1316,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
1328
1316
|
|
|
1329
1317
|
---
|
|
1330
1318
|
|
|
1331
|
-
The following software may be included in this product: side-channel (1.1.
|
|
1319
|
+
The following software may be included in this product: side-channel (1.1.1)
|
|
1332
1320
|
This software contains the following license and notice below:
|
|
1333
1321
|
|
|
1334
1322
|
MIT License
|
|
@@ -1355,7 +1343,7 @@ SOFTWARE.
|
|
|
1355
1343
|
|
|
1356
1344
|
---
|
|
1357
1345
|
|
|
1358
|
-
The following software may be included in this product: side-channel-list (1.0.
|
|
1346
|
+
The following software may be included in this product: side-channel-list (1.0.1)
|
|
1359
1347
|
This software contains the following license and notice below:
|
|
1360
1348
|
|
|
1361
1349
|
MIT License
|
|
@@ -1436,21 +1424,6 @@ SOFTWARE.
|
|
|
1436
1424
|
|
|
1437
1425
|
---
|
|
1438
1426
|
|
|
1439
|
-
The following software may be included in this product: supports-color (8.1.1)
|
|
1440
|
-
This software contains the following license and notice below:
|
|
1441
|
-
|
|
1442
|
-
MIT License
|
|
1443
|
-
|
|
1444
|
-
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
1445
|
-
|
|
1446
|
-
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:
|
|
1447
|
-
|
|
1448
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
1449
|
-
|
|
1450
|
-
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.
|
|
1451
|
-
|
|
1452
|
-
---
|
|
1453
|
-
|
|
1454
1427
|
The following software may be included in this product: zod (4.3.6)
|
|
1455
1428
|
This software contains the following license and notice below:
|
|
1456
1429
|
|
|
@@ -1922,7 +1895,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
1922
1895
|
|
|
1923
1896
|
---
|
|
1924
1897
|
|
|
1925
|
-
The following software may be included in this product: qs (6.
|
|
1898
|
+
The following software may be included in this product: qs (6.16.0)
|
|
1926
1899
|
This software contains the following license and notice below:
|
|
1927
1900
|
|
|
1928
1901
|
BSD 3-Clause License
|
package/dist/api-client.cjs
CHANGED
|
@@ -24,11 +24,15 @@ function __webpack_require__(moduleId) {
|
|
|
24
24
|
};
|
|
25
25
|
})();
|
|
26
26
|
(()=>{
|
|
27
|
-
__webpack_require__.d = (exports1,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
28
|
+
var define = (defs, kind)=>{
|
|
29
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
[kind]: defs[key]
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
define(getters, "get");
|
|
35
|
+
define(values, "value");
|
|
32
36
|
};
|
|
33
37
|
})();
|
|
34
38
|
(()=>{
|
package/dist/api-client.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-client.cjs","sources":["webpack/runtime/compat_get_default_export","webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object"],"sourcesContent":["// getDefaultExport function for compatibility with non-ESM modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};\n","__webpack_require__.d = (exports,
|
|
1
|
+
{"version":3,"file":"api-client.cjs","sources":["webpack://webpack/runtime/compat_get_default_export","webpack://webpack/runtime/define_property_getters","webpack://webpack/runtime/has_own_property","webpack://webpack/runtime/make_namespace_object"],"sourcesContent":["// getDefaultExport function for compatibility with non-ESM modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};\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};"],"names":["__webpack_require__","module","getter","getters","values","define","defs","kind","key","Object","obj","prop","Symbol"],"mappings":";;;;;;;;;;;;;;;;;IACAA,oBAAoB,CAAC,GAAG,CAACC;QACxB,IAAIC,SAASD,UAAUA,OAAO,UAAU,GACvC,IAAOA,MAAM,CAAC,UAAU,GACxB,IAAOA;QACRD,oBAAoB,CAAC,CAACE,QAAQ;YAAE,GAAGA;QAAO;QAC1C,OAAOA;IACR;;;ICPAF,oBAAoB,CAAC,GAAG,CAAC,UAASG,SAASC;QAC1C,IAAIC,SAAS,CAACC,MAAMC;YACnB,IAAI,IAAIC,OAAOF,KACd,IAAGN,oBAAoB,CAAC,CAACM,MAAME,QAAQ,CAACR,oBAAoB,CAAC,CAAC,UAASQ,MACtEC,OAAO,cAAc,CAAC,UAASD,KAAK;gBAAE,YAAY;gBAAM,CAACD,KAAK,EAAED,IAAI,CAACE,IAAI;YAAC;QAG7E;QACAH,OAAOF,SAAS;QAChBE,OAAOD,QAAQ;IAChB;;;ICVAJ,oBAAoB,CAAC,GAAG,CAACU,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFX,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,MAAlB,OAAOY,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D"}
|
package/dist/api-client.mjs
CHANGED
package/dist/api-schemas.cjs
CHANGED
|
@@ -24,11 +24,15 @@ function __webpack_require__(moduleId) {
|
|
|
24
24
|
};
|
|
25
25
|
})();
|
|
26
26
|
(()=>{
|
|
27
|
-
__webpack_require__.d = (exports1,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
28
|
+
var define = (defs, kind)=>{
|
|
29
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
[kind]: defs[key]
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
define(getters, "get");
|
|
35
|
+
define(values, "value");
|
|
32
36
|
};
|
|
33
37
|
})();
|
|
34
38
|
(()=>{
|
package/dist/api-schemas.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-schemas.cjs","sources":["webpack/runtime/compat_get_default_export","webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object"],"sourcesContent":["// getDefaultExport function for compatibility with non-ESM modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};\n","__webpack_require__.d = (exports,
|
|
1
|
+
{"version":3,"file":"api-schemas.cjs","sources":["webpack://webpack/runtime/compat_get_default_export","webpack://webpack/runtime/define_property_getters","webpack://webpack/runtime/has_own_property","webpack://webpack/runtime/make_namespace_object"],"sourcesContent":["// getDefaultExport function for compatibility with non-ESM modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};\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};"],"names":["__webpack_require__","module","getter","getters","values","define","defs","kind","key","Object","obj","prop","Symbol"],"mappings":";;;;;;;;;;;;;;;;;IACAA,oBAAoB,CAAC,GAAG,CAACC;QACxB,IAAIC,SAASD,UAAUA,OAAO,UAAU,GACvC,IAAOA,MAAM,CAAC,UAAU,GACxB,IAAOA;QACRD,oBAAoB,CAAC,CAACE,QAAQ;YAAE,GAAGA;QAAO;QAC1C,OAAOA;IACR;;;ICPAF,oBAAoB,CAAC,GAAG,CAAC,UAASG,SAASC;QAC1C,IAAIC,SAAS,CAACC,MAAMC;YACnB,IAAI,IAAIC,OAAOF,KACd,IAAGN,oBAAoB,CAAC,CAACM,MAAME,QAAQ,CAACR,oBAAoB,CAAC,CAAC,UAASQ,MACtEC,OAAO,cAAc,CAAC,UAASD,KAAK;gBAAE,YAAY;gBAAM,CAACD,KAAK,EAAED,IAAI,CAACE,IAAI;YAAC;QAG7E;QACAH,OAAOF,SAAS;QAChBE,OAAOD,QAAQ;IAChB;;;ICVAJ,oBAAoB,CAAC,GAAG,CAACU,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFX,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,MAAlB,OAAOY,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D"}
|
package/dist/api-schemas.mjs
CHANGED
package/dist/constants.cjs
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_require__ = {};
|
|
3
3
|
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
9
13
|
};
|
|
10
14
|
})();
|
|
11
15
|
(()=>{
|
|
@@ -25,12 +29,12 @@ var __webpack_exports__ = {};
|
|
|
25
29
|
__webpack_require__.r(__webpack_exports__);
|
|
26
30
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
31
|
ANONYMOUS_ID_COOKIE: ()=>constants_namespaceObject.ANONYMOUS_ID_COOKIE,
|
|
28
|
-
OPTIMIZATION_NODE_SDK_NAME: ()=>OPTIMIZATION_NODE_SDK_NAME,
|
|
29
32
|
ANONYMOUS_ID_KEY: ()=>constants_namespaceObject.ANONYMOUS_ID_KEY,
|
|
33
|
+
OPTIMIZATION_NODE_SDK_NAME: ()=>OPTIMIZATION_NODE_SDK_NAME,
|
|
30
34
|
OPTIMIZATION_NODE_SDK_VERSION: ()=>OPTIMIZATION_NODE_SDK_VERSION
|
|
31
35
|
});
|
|
32
36
|
const constants_namespaceObject = require("@contentful/optimization-core/constants");
|
|
33
|
-
const OPTIMIZATION_NODE_SDK_VERSION = "
|
|
37
|
+
const OPTIMIZATION_NODE_SDK_VERSION = "2.0.1";
|
|
34
38
|
const OPTIMIZATION_NODE_SDK_NAME = "@contentful/optimization-node";
|
|
35
39
|
exports.ANONYMOUS_ID_COOKIE = __webpack_exports__.ANONYMOUS_ID_COOKIE;
|
|
36
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/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../src/constants.ts"],"sourcesContent":["__webpack_require__.d = (exports,
|
|
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 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"],"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 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const OPTIMIZATION_NODE_SDK_VERSION = "2.0.1";
|
|
2
|
+
const OPTIMIZATION_NODE_SDK_NAME = "@contentful/optimization-node";
|
|
3
|
+
export { ANONYMOUS_ID_COOKIE, ANONYMOUS_ID_KEY } from "@contentful/optimization-core/constants";
|
|
4
|
+
export { OPTIMIZATION_NODE_SDK_NAME, OPTIMIZATION_NODE_SDK_VERSION };
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=constants.mjs.map
|
|
@@ -0,0 +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 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"],"names":["OPTIMIZATION_NODE_SDK_VERSION","__OPTIMIZATION_VERSION__","OPTIMIZATION_NODE_SDK_NAME","__OPTIMIZATION_PACKAGE_NAME__"],"mappings":"AAYO,MAAMA,gCACoCC;AAS1C,MAAMC,6BAEPC"}
|
package/dist/core-sdk.cjs
CHANGED
|
@@ -27,11 +27,15 @@ function __webpack_require__(moduleId) {
|
|
|
27
27
|
};
|
|
28
28
|
})();
|
|
29
29
|
(()=>{
|
|
30
|
-
__webpack_require__.d = (exports1,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
31
|
+
var define = (defs, kind)=>{
|
|
32
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
[kind]: defs[key]
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
define(getters, "get");
|
|
38
|
+
define(values, "value");
|
|
35
39
|
};
|
|
36
40
|
})();
|
|
37
41
|
(()=>{
|
|
@@ -50,9 +54,6 @@ function __webpack_require__(moduleId) {
|
|
|
50
54
|
var __webpack_exports__ = {};
|
|
51
55
|
(()=>{
|
|
52
56
|
__webpack_require__.r(__webpack_exports__);
|
|
53
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
54
|
-
prefetchManagedEntries: ()=>_contentful_optimization_core_entry_source__rspack_import_1.prefetchManagedEntries
|
|
55
|
-
});
|
|
56
57
|
var _contentful_optimization_core__rspack_import_0 = __webpack_require__("@contentful/optimization-core");
|
|
57
58
|
var __rspack_reexport = {};
|
|
58
59
|
for(const __rspack_import_key in _contentful_optimization_core__rspack_import_0)if ([
|
|
@@ -61,6 +62,9 @@ var __webpack_exports__ = {};
|
|
|
61
62
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_contentful_optimization_core__rspack_import_0[__rspack_import_key];
|
|
62
63
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
63
64
|
var _contentful_optimization_core_entry_source__rspack_import_1 = __webpack_require__("@contentful/optimization-core/entry-source");
|
|
65
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
66
|
+
prefetchManagedEntries: ()=>_contentful_optimization_core_entry_source__rspack_import_1.prefetchManagedEntries
|
|
67
|
+
});
|
|
64
68
|
})();
|
|
65
69
|
exports.prefetchManagedEntries = __webpack_exports__.prefetchManagedEntries;
|
|
66
70
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
package/dist/core-sdk.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-sdk.cjs","sources":["webpack/runtime/compat_get_default_export","webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object"],"sourcesContent":["// getDefaultExport function for compatibility with non-ESM modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};\n","__webpack_require__.d = (exports,
|
|
1
|
+
{"version":3,"file":"core-sdk.cjs","sources":["webpack://webpack/runtime/compat_get_default_export","webpack://webpack/runtime/define_property_getters","webpack://webpack/runtime/has_own_property","webpack://webpack/runtime/make_namespace_object"],"sourcesContent":["// getDefaultExport function for compatibility with non-ESM modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};\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};"],"names":["__webpack_require__","module","getter","getters","values","define","defs","kind","key","Object","obj","prop","Symbol"],"mappings":";;;;;;;;;;;;;;;;;;;;IACAA,oBAAoB,CAAC,GAAG,CAACC;QACxB,IAAIC,SAASD,UAAUA,OAAO,UAAU,GACvC,IAAOA,MAAM,CAAC,UAAU,GACxB,IAAOA;QACRD,oBAAoB,CAAC,CAACE,QAAQ;YAAE,GAAGA;QAAO;QAC1C,OAAOA;IACR;;;ICPAF,oBAAoB,CAAC,GAAG,CAAC,UAASG,SAASC;QAC1C,IAAIC,SAAS,CAACC,MAAMC;YACnB,IAAI,IAAIC,OAAOF,KACd,IAAGN,oBAAoB,CAAC,CAACM,MAAME,QAAQ,CAACR,oBAAoB,CAAC,CAAC,UAASQ,MACtEC,OAAO,cAAc,CAAC,UAASD,KAAK;gBAAE,YAAY;gBAAM,CAACD,KAAK,EAAED,IAAI,CAACE,IAAI;YAAC;QAG7E;QACAH,OAAOF,SAAS;QAChBE,OAAOD,QAAQ;IAChB;;;ICVAJ,oBAAoB,CAAC,GAAG,CAACU,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFX,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,MAAlB,OAAOY,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D"}
|
package/dist/core-sdk.mjs
CHANGED
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 = "
|
|
9
|
+
const OPTIMIZATION_NODE_SDK_VERSION = "2.0.1";
|
|
10
10
|
const OPTIMIZATION_NODE_SDK_NAME = "@contentful/optimization-node";
|
|
11
11
|
}
|
|
12
12
|
};
|
|
@@ -21,11 +21,15 @@ function __webpack_require__(moduleId) {
|
|
|
21
21
|
return module.exports;
|
|
22
22
|
}
|
|
23
23
|
(()=>{
|
|
24
|
-
__webpack_require__.d = (exports1,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
25
|
+
var define = (defs, kind)=>{
|
|
26
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
[kind]: defs[key]
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
define(getters, "get");
|
|
32
|
+
define(values, "value");
|
|
29
33
|
};
|
|
30
34
|
})();
|
|
31
35
|
(()=>{
|
|
@@ -46,9 +50,9 @@ var __webpack_exports__ = {};
|
|
|
46
50
|
__webpack_require__.r(__webpack_exports__);
|
|
47
51
|
__webpack_require__.d(__webpack_exports__, {
|
|
48
52
|
OPTIMIZATION_NODE_SDK_NAME: ()=>constants.OPTIMIZATION_NODE_SDK_NAME,
|
|
49
|
-
default: ()=>src,
|
|
50
53
|
OPTIMIZATION_NODE_SDK_VERSION: ()=>constants.OPTIMIZATION_NODE_SDK_VERSION,
|
|
51
|
-
createRequestHandoffFromData: ()=>createRequestHandoffFromData
|
|
54
|
+
createRequestHandoffFromData: ()=>createRequestHandoffFromData,
|
|
55
|
+
default: ()=>src
|
|
52
56
|
});
|
|
53
57
|
const optimization_core_namespaceObject = require("@contentful/optimization-core");
|
|
54
58
|
var constants = __webpack_require__("./src/constants.ts");
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../src/constants.ts","webpack/runtime/define_property_getters","webpack/runtime/has_own_property","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, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\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 * clientId: 'abc-123',\n * environment: 'main',\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({ clientId: 'my-client-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__","definition","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;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGD,oBAAoB,CAAC,CAACC,YAAYC,QAAQ,CAACF,oBAAoB,CAAC,CAAC,UAASE,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAF,oBAAoB,CAAC,GAAG,CAACI,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFL,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,MAAlB,OAAOM,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,MAAMjB,UAAAA,0BAA0BA;wBAChC,SAASF,UAAAA,6BAA6BA;wBACtC,GAAGkB,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 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"}
|
package/dist/index.d.cts
CHANGED
|
@@ -33,8 +33,8 @@ import { PrivateRequestOptimizationCacheMetadata } from '@contentful/optimizatio
|
|
|
33
33
|
* import ContentfulOptimization from '@contentful/optimization-node'
|
|
34
34
|
*
|
|
35
35
|
* const sdk = new ContentfulOptimization({
|
|
36
|
-
*
|
|
37
|
-
* environment: '
|
|
36
|
+
* spaceId: 'abc-123',
|
|
37
|
+
* environment: 'master',
|
|
38
38
|
* logLevel: 'info',
|
|
39
39
|
* })
|
|
40
40
|
*
|
|
@@ -62,7 +62,7 @@ declare class ContentfulOptimization extends CoreStateless {
|
|
|
62
62
|
* ```ts
|
|
63
63
|
* import ContentfulOptimization from '@contentful/optimization-node'
|
|
64
64
|
*
|
|
65
|
-
* const optimization = new ContentfulOptimization({
|
|
65
|
+
* const optimization = new ContentfulOptimization({ spaceId: 'my-space-id' })
|
|
66
66
|
* ```
|
|
67
67
|
*/
|
|
68
68
|
constructor({ app, allowedEventTypes, eventBuilder, ...config }: OptimizationNodeConfig);
|
package/dist/index.d.mts
CHANGED
|
@@ -33,8 +33,8 @@ import { PrivateRequestOptimizationCacheMetadata } from '@contentful/optimizatio
|
|
|
33
33
|
* import ContentfulOptimization from '@contentful/optimization-node'
|
|
34
34
|
*
|
|
35
35
|
* const sdk = new ContentfulOptimization({
|
|
36
|
-
*
|
|
37
|
-
* environment: '
|
|
36
|
+
* spaceId: 'abc-123',
|
|
37
|
+
* environment: 'master',
|
|
38
38
|
* logLevel: 'info',
|
|
39
39
|
* })
|
|
40
40
|
*
|
|
@@ -62,7 +62,7 @@ declare class ContentfulOptimization extends CoreStateless {
|
|
|
62
62
|
* ```ts
|
|
63
63
|
* import ContentfulOptimization from '@contentful/optimization-node'
|
|
64
64
|
*
|
|
65
|
-
* const optimization = new ContentfulOptimization({
|
|
65
|
+
* const optimization = new ContentfulOptimization({ spaceId: 'my-space-id' })
|
|
66
66
|
* ```
|
|
67
67
|
*/
|
|
68
68
|
constructor({ app, allowedEventTypes, eventBuilder, ...config }: OptimizationNodeConfig);
|
package/dist/index.d.ts
CHANGED
|
@@ -33,8 +33,8 @@ import { PrivateRequestOptimizationCacheMetadata } from '@contentful/optimizatio
|
|
|
33
33
|
* import ContentfulOptimization from '@contentful/optimization-node'
|
|
34
34
|
*
|
|
35
35
|
* const sdk = new ContentfulOptimization({
|
|
36
|
-
*
|
|
37
|
-
* environment: '
|
|
36
|
+
* spaceId: 'abc-123',
|
|
37
|
+
* environment: 'master',
|
|
38
38
|
* logLevel: 'info',
|
|
39
39
|
* })
|
|
40
40
|
*
|
|
@@ -62,7 +62,7 @@ declare class ContentfulOptimization extends CoreStateless {
|
|
|
62
62
|
* ```ts
|
|
63
63
|
* import ContentfulOptimization from '@contentful/optimization-node'
|
|
64
64
|
*
|
|
65
|
-
* const optimization = new ContentfulOptimization({
|
|
65
|
+
* const optimization = new ContentfulOptimization({ spaceId: 'my-space-id' })
|
|
66
66
|
* ```
|
|
67
67
|
*/
|
|
68
68
|
constructor({ app, allowedEventTypes, eventBuilder, ...config }: OptimizationNodeConfig);
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { OPTIMIZATION_NODE_SDK_NAME, OPTIMIZATION_NODE_SDK_VERSION } from "./
|
|
1
|
+
import { CoreStateless, assertOptimizationCacheSafety } from "@contentful/optimization-core";
|
|
2
|
+
import { OPTIMIZATION_NODE_SDK_NAME, OPTIMIZATION_NODE_SDK_VERSION } from "./constants.mjs";
|
|
3
3
|
const DEFAULT_NODE_ALLOWED_EVENT_TYPES = [
|
|
4
4
|
'identify',
|
|
5
5
|
'page'
|
|
6
6
|
];
|
|
7
|
-
class ContentfulOptimization extends
|
|
7
|
+
class ContentfulOptimization extends CoreStateless {
|
|
8
8
|
constructor({ app, allowedEventTypes, eventBuilder, ...config }){
|
|
9
9
|
const { library, ...eventBuilderConfig } = eventBuilder ?? {};
|
|
10
10
|
super({
|
|
@@ -47,11 +47,11 @@ function createRequestHandoffFromData(input) {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
|
-
|
|
50
|
+
assertOptimizationCacheSafety(handoff);
|
|
51
51
|
return handoff;
|
|
52
52
|
}
|
|
53
53
|
const src = src_ContentfulOptimization;
|
|
54
|
-
export { OPTIMIZATION_NODE_SDK_NAME, OPTIMIZATION_NODE_SDK_VERSION } from "./
|
|
54
|
+
export { OPTIMIZATION_NODE_SDK_NAME, OPTIMIZATION_NODE_SDK_VERSION } from "./constants.mjs";
|
|
55
55
|
export default src;
|
|
56
56
|
export { createRequestHandoffFromData };
|
|
57
57
|
|
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 *
|
|
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 * 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":["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/dist/logger.cjs
CHANGED
|
@@ -24,11 +24,15 @@ function __webpack_require__(moduleId) {
|
|
|
24
24
|
};
|
|
25
25
|
})();
|
|
26
26
|
(()=>{
|
|
27
|
-
__webpack_require__.d = (exports1,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
28
|
+
var define = (defs, kind)=>{
|
|
29
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
[kind]: defs[key]
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
define(getters, "get");
|
|
35
|
+
define(values, "value");
|
|
32
36
|
};
|
|
33
37
|
})();
|
|
34
38
|
(()=>{
|
|
@@ -47,14 +51,14 @@ function __webpack_require__(moduleId) {
|
|
|
47
51
|
var __webpack_exports__ = {};
|
|
48
52
|
(()=>{
|
|
49
53
|
__webpack_require__.r(__webpack_exports__);
|
|
50
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
51
|
-
default: ()=>_contentful_optimization_core_logger__rspack_import_0_default.a
|
|
52
|
-
});
|
|
53
54
|
var _contentful_optimization_core_logger__rspack_import_0 = __webpack_require__("@contentful/optimization-core/logger");
|
|
54
55
|
var _contentful_optimization_core_logger__rspack_import_0_default = /*#__PURE__*/ __webpack_require__.n(_contentful_optimization_core_logger__rspack_import_0);
|
|
55
56
|
var __rspack_reexport = {};
|
|
56
57
|
for(const __rspack_import_key in _contentful_optimization_core_logger__rspack_import_0)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_contentful_optimization_core_logger__rspack_import_0[__rspack_import_key];
|
|
57
58
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
59
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
60
|
+
default: ()=>_contentful_optimization_core_logger__rspack_import_0_default.a
|
|
61
|
+
});
|
|
58
62
|
})();
|
|
59
63
|
exports["default"] = __webpack_exports__["default"];
|
|
60
64
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
package/dist/logger.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.cjs","sources":["webpack/runtime/compat_get_default_export","webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object"],"sourcesContent":["// getDefaultExport function for compatibility with non-ESM modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};\n","__webpack_require__.d = (exports,
|
|
1
|
+
{"version":3,"file":"logger.cjs","sources":["webpack://webpack/runtime/compat_get_default_export","webpack://webpack/runtime/define_property_getters","webpack://webpack/runtime/has_own_property","webpack://webpack/runtime/make_namespace_object"],"sourcesContent":["// getDefaultExport function for compatibility with non-ESM modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};\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};"],"names":["__webpack_require__","module","getter","getters","values","define","defs","kind","key","Object","obj","prop","Symbol"],"mappings":";;;;;;;;;;;;;;;;;IACAA,oBAAoB,CAAC,GAAG,CAACC;QACxB,IAAIC,SAASD,UAAUA,OAAO,UAAU,GACvC,IAAOA,MAAM,CAAC,UAAU,GACxB,IAAOA;QACRD,oBAAoB,CAAC,CAACE,QAAQ;YAAE,GAAGA;QAAO;QAC1C,OAAOA;IACR;;;ICPAF,oBAAoB,CAAC,GAAG,CAAC,UAASG,SAASC;QAC1C,IAAIC,SAAS,CAACC,MAAMC;YACnB,IAAI,IAAIC,OAAOF,KACd,IAAGN,oBAAoB,CAAC,CAACM,MAAME,QAAQ,CAACR,oBAAoB,CAAC,CAAC,UAASQ,MACtEC,OAAO,cAAc,CAAC,UAASD,KAAK;gBAAE,YAAY;gBAAM,CAACD,KAAK,EAAED,IAAI,CAACE,IAAI;YAAC;QAG7E;QACAH,OAAOF,SAAS;QAChBE,OAAOD,QAAQ;IAChB;;;ICVAJ,oBAAoB,CAAC,GAAG,CAACU,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFX,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,MAAlB,OAAOY,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D"}
|
package/dist/logger.mjs
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import * as __rspack_external__contentful_optimization_core_logger_01eb57e0 from "@contentful/optimization-core/logger";
|
|
2
|
-
var default_0 = __rspack_external__contentful_optimization_core_logger_01eb57e0["default"];
|
|
3
1
|
export * from "@contentful/optimization-core/logger";
|
|
4
|
-
export default
|
|
2
|
+
export { default } from "@contentful/optimization-core/logger";
|
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": "
|
|
4
|
+
"version": "2.0.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -88,6 +88,38 @@
|
|
|
88
88
|
}
|
|
89
89
|
},
|
|
90
90
|
"dependencies": {
|
|
91
|
-
"@contentful/optimization-core": "
|
|
91
|
+
"@contentful/optimization-core": "2.0.1"
|
|
92
|
+
},
|
|
93
|
+
"devDependencies": {
|
|
94
|
+
"@contentful/rich-text-html-renderer": "^17.1.6",
|
|
95
|
+
"@contentful/rich-text-types": "^17.2.5",
|
|
96
|
+
"@microsoft/api-extractor": "^7.59.1",
|
|
97
|
+
"@rsdoctor/cli": "^1.6.4",
|
|
98
|
+
"@rslib/core": "^1.0.1",
|
|
99
|
+
"@types/express": "^5.0.6",
|
|
100
|
+
"@types/node": "^24.0.13",
|
|
101
|
+
"@rstest/core": "^0.12.0",
|
|
102
|
+
"@rstest/coverage-istanbul": "^0.12.0",
|
|
103
|
+
"build-tools": "0.0.0",
|
|
104
|
+
"contentful": "^11.10.5",
|
|
105
|
+
"ejs": "^6.0.1",
|
|
106
|
+
"express": "^5.2.1",
|
|
107
|
+
"express-rate-limit": "^8.7.0",
|
|
108
|
+
"rimraf": "^6.1.3",
|
|
109
|
+
"tslib": "^2.8.1",
|
|
110
|
+
"tsx": "^4.21.0",
|
|
111
|
+
"typescript": "^5.8.3"
|
|
112
|
+
},
|
|
113
|
+
"scripts": {
|
|
114
|
+
"build": "pnpm clean; pnpm build:dist",
|
|
115
|
+
"build:ci": "pnpm build:dist",
|
|
116
|
+
"build:dist": "rslib build && build-tools emit-dual-dts ./dist",
|
|
117
|
+
"build:rsdoctor": "RSDOCTOR=true rslib build && build-tools emit-dual-dts ./dist",
|
|
118
|
+
"clean": "rimraf ./.rsdoctor ./.rslib ./.rstack ./dist ./coverage .tsbuildinfo ./node_modules/.cache/rspack",
|
|
119
|
+
"dev": "tsx watch --env-file=.env ./dev/server.ts",
|
|
120
|
+
"size:check": "pnpm build:dist && build-tools bundle-size",
|
|
121
|
+
"size:report": "build-tools bundle-size --report-only",
|
|
122
|
+
"test:unit": "rstest run --coverage",
|
|
123
|
+
"typecheck": "tsc --noEmit"
|
|
92
124
|
}
|
|
93
125
|
}
|
package/dist/260.mjs
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
const OPTIMIZATION_NODE_SDK_VERSION = "1.2.1";
|
|
2
|
-
const OPTIMIZATION_NODE_SDK_NAME = "@contentful/optimization-node";
|
|
3
|
-
export { ANONYMOUS_ID_COOKIE, ANONYMOUS_ID_KEY } from "@contentful/optimization-core/constants";
|
|
4
|
-
export { OPTIMIZATION_NODE_SDK_NAME, OPTIMIZATION_NODE_SDK_VERSION };
|
|
5
|
-
|
|
6
|
-
//# sourceMappingURL=260.mjs.map
|
package/dist/260.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"260.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 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"],"names":["OPTIMIZATION_NODE_SDK_VERSION","__OPTIMIZATION_VERSION__","OPTIMIZATION_NODE_SDK_NAME","__OPTIMIZATION_PACKAGE_NAME__"],"mappings":"AAYO,MAAMA,gCACoCC;AAS1C,MAAMC,6BAEPC"}
|
package/dist/987.mjs
DELETED