@contentful/optimization-node 0.1.0-alpha7 → 0.1.0-alpha9
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 +51 -17
- package/dist/260.mjs +6 -0
- package/dist/260.mjs.map +1 -0
- package/dist/987.mjs +2 -0
- package/dist/api-client.cjs +60 -0
- package/dist/api-client.cjs.map +1 -0
- package/dist/api-client.d.cts +4 -0
- package/dist/api-client.d.mts +4 -0
- package/dist/api-client.d.ts +4 -0
- package/dist/api-client.mjs +2 -0
- package/dist/api-schemas.cjs +60 -0
- package/dist/api-schemas.cjs.map +1 -0
- package/dist/api-schemas.d.cts +4 -0
- package/dist/api-schemas.d.mts +4 -0
- package/dist/api-schemas.d.ts +4 -0
- package/dist/api-schemas.mjs +2 -0
- package/dist/constants.cjs +49 -0
- package/dist/constants.cjs.map +1 -0
- package/dist/constants.d.cts +26 -0
- package/dist/constants.d.mts +26 -0
- package/dist/constants.d.ts +26 -0
- package/dist/constants.mjs +1 -0
- package/dist/core-sdk.cjs +60 -0
- package/dist/core-sdk.cjs.map +1 -0
- package/dist/core-sdk.d.cts +4 -0
- package/dist/core-sdk.d.mts +4 -0
- package/dist/core-sdk.d.ts +4 -0
- package/dist/core-sdk.mjs +2 -0
- package/dist/index.cjs +35 -64
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +111 -0
- package/dist/index.d.mts +111 -0
- package/dist/index.d.ts +50 -15
- package/dist/index.mjs +5 -6
- package/dist/index.mjs.map +1 -1
- package/dist/logger.cjs +67 -0
- package/dist/logger.cjs.map +1 -0
- package/dist/logger.d.cts +8 -0
- package/dist/logger.d.mts +8 -0
- package/dist/logger.d.ts +8 -0
- package/dist/logger.mjs +4 -0
- package/package.json +63 -8
package/README.md
CHANGED
|
@@ -11,17 +11,17 @@
|
|
|
11
11
|
<div align="center">
|
|
12
12
|
|
|
13
13
|
[Readme](./README.md) · [Reference](https://contentful.github.io/optimization) ·
|
|
14
|
-
[Contributing](
|
|
14
|
+
[Contributing](../../../CONTRIBUTING.md)
|
|
15
15
|
|
|
16
16
|
</div>
|
|
17
17
|
|
|
18
18
|
> [!WARNING]
|
|
19
19
|
>
|
|
20
|
-
> The Optimization SDK Suite is
|
|
20
|
+
> The Optimization SDK Suite is pre-release (alpha). Breaking changes may be published at any time.
|
|
21
21
|
|
|
22
22
|
The Optimization Node SDK implements functionality specific to Node environments, based on the
|
|
23
|
-
[Optimization Core Library](
|
|
24
|
-
[Contentful Optimization SDK Suite](
|
|
23
|
+
[Optimization Core Library](../../../universal/core/README.md). This SDK is part of the
|
|
24
|
+
[Contentful Optimization SDK Suite](../../../README.md).
|
|
25
25
|
|
|
26
26
|
<details>
|
|
27
27
|
<summary>Table of Contents</summary>
|
|
@@ -43,8 +43,10 @@ The Optimization Node SDK implements functionality specific to Node environments
|
|
|
43
43
|
- [Personalization and Analytics Event Methods](#personalization-and-analytics-event-methods)
|
|
44
44
|
- [`identify`](#identify)
|
|
45
45
|
- [`page`](#page)
|
|
46
|
+
- [`screen`](#screen)
|
|
46
47
|
- [`track`](#track)
|
|
47
48
|
- [`trackComponentView`](#trackcomponentview)
|
|
49
|
+
- [`trackComponentClick`](#trackcomponentclick)
|
|
48
50
|
- [`trackFlagView`](#trackflagview)
|
|
49
51
|
- [Interceptors](#interceptors)
|
|
50
52
|
- [Life-cycle Interceptors](#life-cycle-interceptors)
|
|
@@ -77,11 +79,11 @@ const optimization = new Optimization({ clientId: 'abc123' })
|
|
|
77
79
|
Reference implementations illustrate how the SDK may be used under common scenarios, as well as
|
|
78
80
|
select less-common scenarios, with the most basic example solution possible.
|
|
79
81
|
|
|
80
|
-
- [Node SSR Only](
|
|
81
|
-
SDK to render a personalized Web page
|
|
82
|
-
- [Node SSR + Web Vanilla](
|
|
83
|
-
demonstrating simple profile synchronization between the Node and
|
|
84
|
-
cookie
|
|
82
|
+
- [Node SSR Only](../../../implementations/node-ssr-only/README.md): Example application that uses
|
|
83
|
+
the Node SDK to render a personalized Web page
|
|
84
|
+
- [Node SSR + Web Vanilla](../../../implementations/node-ssr-web-vanilla/README.md): Example
|
|
85
|
+
application demonstrating simple profile synchronization between the Node and
|
|
86
|
+
[Web](../web/README.md) SDKs via cookie
|
|
85
87
|
|
|
86
88
|
## Configuration
|
|
87
89
|
|
|
@@ -91,11 +93,11 @@ select less-common scenarios, with the most basic example solution possible.
|
|
|
91
93
|
| ----------------- | --------- | ----------------------------- | ------------------------------------------------------------------------------ |
|
|
92
94
|
| `analytics` | No | See "Analytics Options" | Configuration specific to the Analytics/Insights API |
|
|
93
95
|
| `app` | No | `undefined` | The application definition used to attribute events to a specific consumer app |
|
|
94
|
-
| `clientId` | Yes | N/A | The
|
|
95
|
-
| `environment` | No | `'main'` | The
|
|
96
|
+
| `clientId` | Yes | N/A | The Optimization API key |
|
|
97
|
+
| `environment` | No | `'main'` | The environment identifier |
|
|
96
98
|
| `eventBuilder` | No | See "Event Builder Options" | Event builder configuration (channel/library metadata, etc.) |
|
|
97
99
|
| `fetchOptions` | No | See "Fetch Options" | Configuration for Fetch timeout and retry functionality |
|
|
98
|
-
| `logLevel` | No | `'error'` | Minimum log level for the default console
|
|
100
|
+
| `logLevel` | No | `'error'` | Minimum log level for the default console sink |
|
|
99
101
|
| `personalization` | No | See "Personalization Options" | Configuration specific to the Personalization/Experience API |
|
|
100
102
|
|
|
101
103
|
### Analytics Options
|
|
@@ -211,7 +213,16 @@ Arguments:
|
|
|
211
213
|
|
|
212
214
|
### Personalization and Analytics Event Methods
|
|
213
215
|
|
|
214
|
-
|
|
216
|
+
Only the following methods may return an `OptimizationData` object:
|
|
217
|
+
|
|
218
|
+
- `identify`
|
|
219
|
+
- `page`
|
|
220
|
+
- `screen`
|
|
221
|
+
- `track`
|
|
222
|
+
- `trackComponentView` (when `payload.sticky` is `true`)
|
|
223
|
+
|
|
224
|
+
`trackComponentClick` and `trackFlagView` return no data. When returned, `OptimizationData`
|
|
225
|
+
contains:
|
|
215
226
|
|
|
216
227
|
- `changes`: Currently used for Custom Flags
|
|
217
228
|
- `personalizations`: Selected personalizations for the profile
|
|
@@ -235,6 +246,15 @@ Arguments:
|
|
|
235
246
|
- `payload`\*: Page view event builder arguments object, including an optional `profile` property
|
|
236
247
|
with a `PartialProfile` value that requires only an `id`
|
|
237
248
|
|
|
249
|
+
#### `screen`
|
|
250
|
+
|
|
251
|
+
Record a personalization screen view.
|
|
252
|
+
|
|
253
|
+
Arguments:
|
|
254
|
+
|
|
255
|
+
- `payload`\*: Screen view event builder arguments object, including an optional `profile` property
|
|
256
|
+
with a `PartialProfile` value that requires only an `id`
|
|
257
|
+
|
|
238
258
|
#### `track`
|
|
239
259
|
|
|
240
260
|
Record a personalization custom track event.
|
|
@@ -255,15 +275,30 @@ Arguments:
|
|
|
255
275
|
- `payload`\*: Component view event builder arguments object, including an optional `profile`
|
|
256
276
|
property with a `PartialProfile` value that requires only an `id`
|
|
257
277
|
|
|
278
|
+
#### `trackComponentClick`
|
|
279
|
+
|
|
280
|
+
Record an analytics component click event.
|
|
281
|
+
|
|
282
|
+
Returns:
|
|
283
|
+
|
|
284
|
+
- `void`
|
|
285
|
+
|
|
286
|
+
Arguments:
|
|
287
|
+
|
|
288
|
+
- `payload`\*: Component click event builder arguments object
|
|
289
|
+
|
|
258
290
|
#### `trackFlagView`
|
|
259
291
|
|
|
260
292
|
Track a feature flag view via analytics. This is functionally the same as a non-sticky component
|
|
261
293
|
view event.
|
|
262
294
|
|
|
295
|
+
Returns:
|
|
296
|
+
|
|
297
|
+
- `void`
|
|
298
|
+
|
|
263
299
|
Arguments:
|
|
264
300
|
|
|
265
|
-
- `payload`\*: Component view event builder arguments object
|
|
266
|
-
property with a `PartialProfile` value that requires only an `id`
|
|
301
|
+
- `payload`\*: Component view event builder arguments object
|
|
267
302
|
|
|
268
303
|
## Interceptors
|
|
269
304
|
|
|
@@ -285,5 +320,4 @@ optimization.interceptors.event((event) => {
|
|
|
285
320
|
|
|
286
321
|
> [!WARNING]
|
|
287
322
|
>
|
|
288
|
-
> Interceptors are intended to enable low-level interoperability
|
|
289
|
-
> Optimization SDK events, use the `states` observables.
|
|
323
|
+
> Interceptors are intended to enable low-level interoperability and should be used with care.
|
package/dist/260.mjs
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
const OPTIMIZATION_NODE_SDK_VERSION = "0.1.0-alpha9";
|
|
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
ADDED
|
@@ -0,0 +1 @@
|
|
|
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 personalization and analytics\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
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_modules__ = {
|
|
3
|
+
"@contentful/optimization-core/api-client" (module) {
|
|
4
|
+
module.exports = require("@contentful/optimization-core/api-client");
|
|
5
|
+
}
|
|
6
|
+
};
|
|
7
|
+
var __webpack_module_cache__ = {};
|
|
8
|
+
function __webpack_require__(moduleId) {
|
|
9
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
10
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
11
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
12
|
+
exports: {}
|
|
13
|
+
};
|
|
14
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
15
|
+
return module.exports;
|
|
16
|
+
}
|
|
17
|
+
(()=>{
|
|
18
|
+
__webpack_require__.n = (module)=>{
|
|
19
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
20
|
+
__webpack_require__.d(getter, {
|
|
21
|
+
a: getter
|
|
22
|
+
});
|
|
23
|
+
return getter;
|
|
24
|
+
};
|
|
25
|
+
})();
|
|
26
|
+
(()=>{
|
|
27
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
28
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: definition[key]
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
})();
|
|
34
|
+
(()=>{
|
|
35
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
36
|
+
})();
|
|
37
|
+
(()=>{
|
|
38
|
+
__webpack_require__.r = (exports1)=>{
|
|
39
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
40
|
+
value: 'Module'
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
43
|
+
value: true
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
})();
|
|
47
|
+
var __webpack_exports__ = {};
|
|
48
|
+
(()=>{
|
|
49
|
+
__webpack_require__.r(__webpack_exports__);
|
|
50
|
+
var _contentful_optimization_core_api_client__rspack_import_0 = __webpack_require__("@contentful/optimization-core/api-client");
|
|
51
|
+
var __rspack_reexport = {};
|
|
52
|
+
for(const __rspack_import_key in _contentful_optimization_core_api_client__rspack_import_0)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_contentful_optimization_core_api_client__rspack_import_0[__rspack_import_key];
|
|
53
|
+
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
54
|
+
})();
|
|
55
|
+
for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
56
|
+
Object.defineProperty(exports, '__esModule', {
|
|
57
|
+
value: true
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
//# sourceMappingURL=api-client.cjs.map
|
|
@@ -0,0 +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, 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};"],"names":["__webpack_require__","module","getter","definition","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;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGH,oBAAoB,CAAC,CAACG,YAAYC,QAAQ,CAACJ,oBAAoB,CAAC,CAAC,UAASI,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAJ,oBAAoB,CAAC,GAAG,CAACM,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFP,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,MAAlB,OAAOQ,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_modules__ = {
|
|
3
|
+
"@contentful/optimization-core/api-schemas" (module) {
|
|
4
|
+
module.exports = require("@contentful/optimization-core/api-schemas");
|
|
5
|
+
}
|
|
6
|
+
};
|
|
7
|
+
var __webpack_module_cache__ = {};
|
|
8
|
+
function __webpack_require__(moduleId) {
|
|
9
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
10
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
11
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
12
|
+
exports: {}
|
|
13
|
+
};
|
|
14
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
15
|
+
return module.exports;
|
|
16
|
+
}
|
|
17
|
+
(()=>{
|
|
18
|
+
__webpack_require__.n = (module)=>{
|
|
19
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
20
|
+
__webpack_require__.d(getter, {
|
|
21
|
+
a: getter
|
|
22
|
+
});
|
|
23
|
+
return getter;
|
|
24
|
+
};
|
|
25
|
+
})();
|
|
26
|
+
(()=>{
|
|
27
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
28
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: definition[key]
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
})();
|
|
34
|
+
(()=>{
|
|
35
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
36
|
+
})();
|
|
37
|
+
(()=>{
|
|
38
|
+
__webpack_require__.r = (exports1)=>{
|
|
39
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
40
|
+
value: 'Module'
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
43
|
+
value: true
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
})();
|
|
47
|
+
var __webpack_exports__ = {};
|
|
48
|
+
(()=>{
|
|
49
|
+
__webpack_require__.r(__webpack_exports__);
|
|
50
|
+
var _contentful_optimization_core_api_schemas__rspack_import_0 = __webpack_require__("@contentful/optimization-core/api-schemas");
|
|
51
|
+
var __rspack_reexport = {};
|
|
52
|
+
for(const __rspack_import_key in _contentful_optimization_core_api_schemas__rspack_import_0)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_contentful_optimization_core_api_schemas__rspack_import_0[__rspack_import_key];
|
|
53
|
+
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
54
|
+
})();
|
|
55
|
+
for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
56
|
+
Object.defineProperty(exports, '__esModule', {
|
|
57
|
+
value: true
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
//# sourceMappingURL=api-schemas.cjs.map
|
|
@@ -0,0 +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, 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};"],"names":["__webpack_require__","module","getter","definition","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;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGH,oBAAoB,CAAC,CAACG,YAAYC,QAAQ,CAACJ,oBAAoB,CAAC,CAAC,UAASI,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAJ,oBAAoB,CAAC,GAAG,CAACM,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFP,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,MAAlB,OAAOQ,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
ANONYMOUS_ID_COOKIE: ()=>constants_namespaceObject.ANONYMOUS_ID_COOKIE,
|
|
28
|
+
OPTIMIZATION_NODE_SDK_NAME: ()=>OPTIMIZATION_NODE_SDK_NAME,
|
|
29
|
+
ANONYMOUS_ID_KEY: ()=>constants_namespaceObject.ANONYMOUS_ID_KEY,
|
|
30
|
+
OPTIMIZATION_NODE_SDK_VERSION: ()=>OPTIMIZATION_NODE_SDK_VERSION
|
|
31
|
+
});
|
|
32
|
+
const constants_namespaceObject = require("@contentful/optimization-core/constants");
|
|
33
|
+
const OPTIMIZATION_NODE_SDK_VERSION = "0.1.0-alpha9";
|
|
34
|
+
const OPTIMIZATION_NODE_SDK_NAME = "@contentful/optimization-node";
|
|
35
|
+
exports.ANONYMOUS_ID_COOKIE = __webpack_exports__.ANONYMOUS_ID_COOKIE;
|
|
36
|
+
exports.ANONYMOUS_ID_KEY = __webpack_exports__.ANONYMOUS_ID_KEY;
|
|
37
|
+
exports.OPTIMIZATION_NODE_SDK_NAME = __webpack_exports__.OPTIMIZATION_NODE_SDK_NAME;
|
|
38
|
+
exports.OPTIMIZATION_NODE_SDK_VERSION = __webpack_exports__.OPTIMIZATION_NODE_SDK_VERSION;
|
|
39
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
40
|
+
"ANONYMOUS_ID_COOKIE",
|
|
41
|
+
"ANONYMOUS_ID_KEY",
|
|
42
|
+
"OPTIMIZATION_NODE_SDK_NAME",
|
|
43
|
+
"OPTIMIZATION_NODE_SDK_VERSION"
|
|
44
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
45
|
+
Object.defineProperty(exports, '__esModule', {
|
|
46
|
+
value: true
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=constants.cjs.map
|
|
@@ -0,0 +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, 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};","// 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 personalization and analytics\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__","definition","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;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;;;;;;;;;;;ACMO,MAAMI,gCACoCC;AAS1C,MAAMC,6BAEPC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ANONYMOUS_ID_COOKIE } from '@contentful/optimization-core/constants';
|
|
2
|
+
import { ANONYMOUS_ID_KEY } from '@contentful/optimization-core/constants';
|
|
3
|
+
|
|
4
|
+
export { ANONYMOUS_ID_COOKIE }
|
|
5
|
+
|
|
6
|
+
export { ANONYMOUS_ID_KEY }
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The package name of the Optimization Node SDK, injected at build-time.
|
|
10
|
+
*
|
|
11
|
+
* @defaultValue `'@contentful/optimization-node'` when the build-time replacement is unavailable.
|
|
12
|
+
*
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export declare const OPTIMIZATION_NODE_SDK_NAME: string;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The current version of the Optimization Node SDK, injected at build-time.
|
|
19
|
+
*
|
|
20
|
+
* @defaultValue `'0.0.0'` when the build-time replacement is unavailable.
|
|
21
|
+
*
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
export declare const OPTIMIZATION_NODE_SDK_VERSION: string;
|
|
25
|
+
|
|
26
|
+
export { }
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ANONYMOUS_ID_COOKIE } from '@contentful/optimization-core/constants';
|
|
2
|
+
import { ANONYMOUS_ID_KEY } from '@contentful/optimization-core/constants';
|
|
3
|
+
|
|
4
|
+
export { ANONYMOUS_ID_COOKIE }
|
|
5
|
+
|
|
6
|
+
export { ANONYMOUS_ID_KEY }
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The package name of the Optimization Node SDK, injected at build-time.
|
|
10
|
+
*
|
|
11
|
+
* @defaultValue `'@contentful/optimization-node'` when the build-time replacement is unavailable.
|
|
12
|
+
*
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export declare const OPTIMIZATION_NODE_SDK_NAME: string;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The current version of the Optimization Node SDK, injected at build-time.
|
|
19
|
+
*
|
|
20
|
+
* @defaultValue `'0.0.0'` when the build-time replacement is unavailable.
|
|
21
|
+
*
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
export declare const OPTIMIZATION_NODE_SDK_VERSION: string;
|
|
25
|
+
|
|
26
|
+
export { }
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ANONYMOUS_ID_COOKIE } from '@contentful/optimization-core/constants';
|
|
2
|
+
import { ANONYMOUS_ID_KEY } from '@contentful/optimization-core/constants';
|
|
3
|
+
|
|
4
|
+
export { ANONYMOUS_ID_COOKIE }
|
|
5
|
+
|
|
6
|
+
export { ANONYMOUS_ID_KEY }
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The package name of the Optimization Node SDK, injected at build-time.
|
|
10
|
+
*
|
|
11
|
+
* @defaultValue `'@contentful/optimization-node'` when the build-time replacement is unavailable.
|
|
12
|
+
*
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export declare const OPTIMIZATION_NODE_SDK_NAME: string;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The current version of the Optimization Node SDK, injected at build-time.
|
|
19
|
+
*
|
|
20
|
+
* @defaultValue `'0.0.0'` when the build-time replacement is unavailable.
|
|
21
|
+
*
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
export declare const OPTIMIZATION_NODE_SDK_VERSION: string;
|
|
25
|
+
|
|
26
|
+
export { }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ANONYMOUS_ID_COOKIE, ANONYMOUS_ID_KEY, OPTIMIZATION_NODE_SDK_NAME, OPTIMIZATION_NODE_SDK_VERSION } from "./260.mjs";
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_modules__ = {
|
|
3
|
+
"@contentful/optimization-core" (module) {
|
|
4
|
+
module.exports = require("@contentful/optimization-core");
|
|
5
|
+
}
|
|
6
|
+
};
|
|
7
|
+
var __webpack_module_cache__ = {};
|
|
8
|
+
function __webpack_require__(moduleId) {
|
|
9
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
10
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
11
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
12
|
+
exports: {}
|
|
13
|
+
};
|
|
14
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
15
|
+
return module.exports;
|
|
16
|
+
}
|
|
17
|
+
(()=>{
|
|
18
|
+
__webpack_require__.n = (module)=>{
|
|
19
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
20
|
+
__webpack_require__.d(getter, {
|
|
21
|
+
a: getter
|
|
22
|
+
});
|
|
23
|
+
return getter;
|
|
24
|
+
};
|
|
25
|
+
})();
|
|
26
|
+
(()=>{
|
|
27
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
28
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: definition[key]
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
})();
|
|
34
|
+
(()=>{
|
|
35
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
36
|
+
})();
|
|
37
|
+
(()=>{
|
|
38
|
+
__webpack_require__.r = (exports1)=>{
|
|
39
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
40
|
+
value: 'Module'
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
43
|
+
value: true
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
})();
|
|
47
|
+
var __webpack_exports__ = {};
|
|
48
|
+
(()=>{
|
|
49
|
+
__webpack_require__.r(__webpack_exports__);
|
|
50
|
+
var _contentful_optimization_core__rspack_import_0 = __webpack_require__("@contentful/optimization-core");
|
|
51
|
+
var __rspack_reexport = {};
|
|
52
|
+
for(const __rspack_import_key in _contentful_optimization_core__rspack_import_0)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_contentful_optimization_core__rspack_import_0[__rspack_import_key];
|
|
53
|
+
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
54
|
+
})();
|
|
55
|
+
for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
56
|
+
Object.defineProperty(exports, '__esModule', {
|
|
57
|
+
value: true
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
//# sourceMappingURL=core-sdk.cjs.map
|
|
@@ -0,0 +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, 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};"],"names":["__webpack_require__","module","getter","definition","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;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGH,oBAAoB,CAAC,CAACG,YAAYC,QAAQ,CAACJ,oBAAoB,CAAC,CAAC,UAASI,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAJ,oBAAoB,CAAC,GAAG,CAACM,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFP,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,MAAlB,OAAOQ,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D"}
|