@contentful/optimization-node 0.1.0-alpha9 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/260.mjs CHANGED
@@ -1,4 +1,4 @@
1
- const OPTIMIZATION_NODE_SDK_VERSION = "0.1.0-alpha9";
1
+ const OPTIMIZATION_NODE_SDK_VERSION = "1.0.0";
2
2
  const OPTIMIZATION_NODE_SDK_NAME = "@contentful/optimization-node";
3
3
  export { ANONYMOUS_ID_COOKIE, ANONYMOUS_ID_KEY } from "@contentful/optimization-core/constants";
4
4
  export { OPTIMIZATION_NODE_SDK_NAME, OPTIMIZATION_NODE_SDK_VERSION };
package/dist/260.mjs.map CHANGED
@@ -1 +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"}
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"}
@@ -30,7 +30,7 @@ __webpack_require__.d(__webpack_exports__, {
30
30
  OPTIMIZATION_NODE_SDK_VERSION: ()=>OPTIMIZATION_NODE_SDK_VERSION
31
31
  });
32
32
  const constants_namespaceObject = require("@contentful/optimization-core/constants");
33
- const OPTIMIZATION_NODE_SDK_VERSION = "0.1.0-alpha9";
33
+ const OPTIMIZATION_NODE_SDK_VERSION = "1.0.0";
34
34
  const OPTIMIZATION_NODE_SDK_NAME = "@contentful/optimization-node";
35
35
  exports.ANONYMOUS_ID_COOKIE = __webpack_exports__.ANONYMOUS_ID_COOKIE;
36
36
  exports.ANONYMOUS_ID_KEY = __webpack_exports__.ANONYMOUS_ID_KEY;
@@ -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, 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"}
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 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__","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"}
package/dist/core-sdk.cjs CHANGED
@@ -2,6 +2,9 @@
2
2
  var __webpack_modules__ = {
3
3
  "@contentful/optimization-core" (module) {
4
4
  module.exports = require("@contentful/optimization-core");
5
+ },
6
+ "@contentful/optimization-core/entry-source" (module) {
7
+ module.exports = require("@contentful/optimization-core/entry-source");
5
8
  }
6
9
  };
7
10
  var __webpack_module_cache__ = {};
@@ -47,12 +50,22 @@ function __webpack_require__(moduleId) {
47
50
  var __webpack_exports__ = {};
48
51
  (()=>{
49
52
  __webpack_require__.r(__webpack_exports__);
53
+ __webpack_require__.d(__webpack_exports__, {
54
+ prefetchManagedEntries: ()=>_contentful_optimization_core_entry_source__rspack_import_1.prefetchManagedEntries
55
+ });
50
56
  var _contentful_optimization_core__rspack_import_0 = __webpack_require__("@contentful/optimization-core");
51
57
  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];
58
+ for(const __rspack_import_key in _contentful_optimization_core__rspack_import_0)if ([
59
+ "prefetchManagedEntries",
60
+ "default"
61
+ ].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_contentful_optimization_core__rspack_import_0[__rspack_import_key];
53
62
  __webpack_require__.d(__webpack_exports__, __rspack_reexport);
63
+ var _contentful_optimization_core_entry_source__rspack_import_1 = __webpack_require__("@contentful/optimization-core/entry-source");
54
64
  })();
55
- for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
65
+ exports.prefetchManagedEntries = __webpack_exports__.prefetchManagedEntries;
66
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
67
+ "prefetchManagedEntries"
68
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
56
69
  Object.defineProperty(exports, '__esModule', {
57
70
  value: true
58
71
  });
@@ -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, 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"}
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"}
@@ -1,3 +1,16 @@
1
+ import { ManagedEntryDescriptor } from '@contentful/optimization-core/entry-source';
2
+ import { ManagedEntryHandoff } from '@contentful/optimization-core/entry-source';
3
+ import { ManagedEntryPrefetchRuntime } from '@contentful/optimization-core/entry-source';
4
+ import { prefetchManagedEntries } from '@contentful/optimization-core/entry-source';
5
+
6
+ export { ManagedEntryDescriptor }
7
+
8
+ export { ManagedEntryHandoff }
9
+
10
+ export { ManagedEntryPrefetchRuntime }
11
+
12
+ export { prefetchManagedEntries }
13
+
1
14
 
2
15
  export * from "@contentful/optimization-core";
3
16
 
@@ -1,3 +1,16 @@
1
+ import { ManagedEntryDescriptor } from '@contentful/optimization-core/entry-source';
2
+ import { ManagedEntryHandoff } from '@contentful/optimization-core/entry-source';
3
+ import { ManagedEntryPrefetchRuntime } from '@contentful/optimization-core/entry-source';
4
+ import { prefetchManagedEntries } from '@contentful/optimization-core/entry-source';
5
+
6
+ export { ManagedEntryDescriptor }
7
+
8
+ export { ManagedEntryHandoff }
9
+
10
+ export { ManagedEntryPrefetchRuntime }
11
+
12
+ export { prefetchManagedEntries }
13
+
1
14
 
2
15
  export * from "@contentful/optimization-core";
3
16
 
@@ -1,3 +1,16 @@
1
+ import { ManagedEntryDescriptor } from '@contentful/optimization-core/entry-source';
2
+ import { ManagedEntryHandoff } from '@contentful/optimization-core/entry-source';
3
+ import { ManagedEntryPrefetchRuntime } from '@contentful/optimization-core/entry-source';
4
+ import { prefetchManagedEntries } from '@contentful/optimization-core/entry-source';
5
+
6
+ export { ManagedEntryDescriptor }
7
+
8
+ export { ManagedEntryHandoff }
9
+
10
+ export { ManagedEntryPrefetchRuntime }
11
+
12
+ export { prefetchManagedEntries }
13
+
1
14
 
2
15
  export * from "@contentful/optimization-core";
3
16
 
package/dist/core-sdk.mjs CHANGED
@@ -1,2 +1,3 @@
1
1
  import "./987.mjs";
2
2
  export * from "@contentful/optimization-core";
3
+ export { prefetchManagedEntries } from "@contentful/optimization-core/entry-source";
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 = "0.1.0-alpha9";
9
+ const OPTIMIZATION_NODE_SDK_VERSION = "1.0.0";
10
10
  const OPTIMIZATION_NODE_SDK_NAME = "@contentful/optimization-node";
11
11
  }
12
12
  };
@@ -50,30 +50,33 @@ var __webpack_exports__ = {};
50
50
  default: ()=>src
51
51
  });
52
52
  const optimization_core_namespaceObject = require("@contentful/optimization-core");
53
- const external_es_toolkit_namespaceObject = require("es-toolkit");
54
53
  var constants = __webpack_require__("./src/constants.ts");
55
- function mergeConfig(config) {
56
- const { app, ...restConfig } = config;
57
- const defaultConfig = {
58
- eventBuilder: {
59
- app,
60
- channel: 'server',
61
- library: {
62
- name: constants.OPTIMIZATION_NODE_SDK_NAME,
63
- version: constants.OPTIMIZATION_NODE_SDK_VERSION
54
+ const DEFAULT_NODE_ALLOWED_EVENT_TYPES = [
55
+ 'identify',
56
+ 'page'
57
+ ];
58
+ class ContentfulOptimization extends optimization_core_namespaceObject.CoreStateless {
59
+ constructor({ app, allowedEventTypes, eventBuilder, ...config }){
60
+ const { library, ...eventBuilderConfig } = eventBuilder ?? {};
61
+ super({
62
+ ...config,
63
+ allowedEventTypes: allowedEventTypes ?? DEFAULT_NODE_ALLOWED_EVENT_TYPES,
64
+ eventBuilder: {
65
+ app,
66
+ channel: 'server',
67
+ ...eventBuilderConfig,
68
+ library: {
69
+ name: constants.OPTIMIZATION_NODE_SDK_NAME,
70
+ version: constants.OPTIMIZATION_NODE_SDK_VERSION,
71
+ ...library
72
+ },
73
+ getConsent: ()=>false
64
74
  }
65
- }
66
- };
67
- return (0, external_es_toolkit_namespaceObject.merge)(defaultConfig, restConfig);
68
- }
69
- class Optimization extends optimization_core_namespaceObject.CoreStateless {
70
- constructor(config){
71
- const mergedConfig = mergeConfig(config);
72
- super(mergedConfig);
75
+ });
73
76
  }
74
77
  }
75
- const src_Optimization = Optimization;
76
- const src = src_Optimization;
78
+ const src_ContentfulOptimization = ContentfulOptimization;
79
+ const src = src_ContentfulOptimization;
77
80
  })();
78
81
  exports.OPTIMIZATION_NODE_SDK_NAME = __webpack_exports__.OPTIMIZATION_NODE_SDK_NAME;
79
82
  exports.OPTIMIZATION_NODE_SDK_VERSION = __webpack_exports__.OPTIMIZATION_NODE_SDK_VERSION;
@@ -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/Optimization.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 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","__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 { type CoreStatelessConfig, CoreStateless } from '@contentful/optimization-core'\nimport type { App } from '@contentful/optimization-core/api-schemas'\nimport { merge } from 'es-toolkit'\nimport { OPTIMIZATION_NODE_SDK_NAME, OPTIMIZATION_NODE_SDK_VERSION } from './constants'\n\n/**\n * Configuration for the Node-specific Optimization 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 * This differs from {@link CoreStatelessConfig} eventBuilder, which expects\n * a full configuration object.\n */\n eventBuilder?: Partial<Omit<CoreStatelessConfig['eventBuilder'], 'app'>>\n}\n\n/**\n * Merge user-supplied configuration with defaults for the Node SDK.\n *\n * @param config - The input configuration supplied by the caller.\n * @returns A fully composed {@link CoreStatelessConfig} object suitable for\n * constructing the core runtime.\n *\n * @remarks\n * Ensures that the Node SDK always identifies itself via a `server` channel\n * and a `library` metadata block unless explicitly overridden.\n *\n * @internal\n */\nfunction mergeConfig(config: OptimizationNodeConfig): CoreStatelessConfig {\n const { app, ...restConfig } = config\n\n const defaultConfig: Partial<CoreStatelessConfig> = {\n eventBuilder: {\n app,\n channel: 'server',\n library: { name: OPTIMIZATION_NODE_SDK_NAME, version: OPTIMIZATION_NODE_SDK_VERSION },\n },\n }\n return merge(defaultConfig, restConfig)\n}\n\n/**\n * Node-specific Optimization SDK built on {@link CoreStateless}.\n *\n * @remarks\n * This class adapts the stateless Optimization Core for Node runtimes by\n * applying environment-appropriate defaults (e.g., server channel, Node SDK\n * library metadata). No analytics or personalization behavior is modified—\n * only configuration defaults differ.\n *\n * @example\n * ```ts\n * import Optimization from '@contentful/optimization-node'\n *\n * const sdk = new Optimization({\n * clientId: 'abc-123',\n * environment: 'main',\n * logLevel: 'info',\n * })\n *\n * await sdk.track({ event: 'server_event', properties: { id: 1 } })\n * ```\n *\n * @see {@link CoreStateless}\n *\n * @public\n */\nclass Optimization 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 Optimization from '@contentful/optimization-node'\n *\n * const optimization = new Optimization({ clientId: 'my-client-id' })\n * ```\n */\n constructor(config: OptimizationNodeConfig) {\n const mergedConfig: CoreStatelessConfig = mergeConfig(config)\n\n super(mergedConfig)\n }\n}\n\nexport default Optimization\n","/**\n * Contentful Optimization Node SDK.\n *\n * @remarks\n * Adds Node-specific defaults via the {@link Optimization} 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 Optimization from './Optimization'\n\nexport { OPTIMIZATION_NODE_SDK_NAME, OPTIMIZATION_NODE_SDK_VERSION } from './constants'\nexport * from './Optimization'\n\nexport default Optimization\n"],"names":["OPTIMIZATION_NODE_SDK_VERSION","__OPTIMIZATION_VERSION__","OPTIMIZATION_NODE_SDK_NAME","__OPTIMIZATION_PACKAGE_NAME__","__webpack_require__","definition","key","Object","obj","prop","Symbol","mergeConfig","config","app","restConfig","defaultConfig","merge","Optimization","CoreStateless","mergedConfig"],"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;;;;;;;;;;;;;IC4CA,SAASI,YAAYC,MAA8B;QACjD,MAAM,EAAEC,GAAG,EAAE,GAAGC,YAAY,GAAGF;QAE/B,MAAMG,gBAA8C;YAClD,cAAc;gBACZF;gBACA,SAAS;gBACT,SAAS;oBAAE,MAAMX,UAAAA,0BAA0BA;oBAAE,SAASF,UAAAA,6BAA6BA;gBAAC;YACtF;QACF;QACA,OAAOgB,AAAAA,IAAAA,oCAAAA,KAAAA,AAAAA,EAAMD,eAAeD;IAC9B;IA4BA,MAAMG,qBAAqBC,kCAAAA,aAAaA;QActC,YAAYN,MAA8B,CAAE;YAC1C,MAAMO,eAAoCR,YAAYC;YAEtD,KAAK,CAACO;QACR;IACF;IAEA,yBAAeF;IC5Ff,YAAeA"}
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/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","/**\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'\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"],"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;IC3Gf,YAAeA"}
package/dist/index.d.cts CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Contentful Optimization Node SDK.
2
+ * Contentful ContentfulOptimization Node SDK.
3
3
  *
4
4
  * @remarks
5
- * Adds Node-specific defaults via the {@link Optimization} class.
5
+ * Adds Node-specific defaults via the {@link ContentfulOptimization} class.
6
6
  * Core and transitive API exports are available from dedicated entrypoints:
7
7
  * `@contentful/optimization-node/core-sdk`,
8
8
  * `@contentful/optimization-node/api-client`,
@@ -16,32 +16,38 @@ import { CoreStateless } from '@contentful/optimization-core';
16
16
  import { CoreStatelessConfig } from '@contentful/optimization-core';
17
17
 
18
18
  /**
19
- * Node-specific Optimization SDK built on {@link CoreStateless}.
19
+ * Node-specific ContentfulOptimization SDK built on {@link CoreStateless}.
20
20
  *
21
21
  * @remarks
22
- * This class adapts the stateless Optimization Core for Node runtimes by
22
+ * This class adapts the stateless ContentfulOptimization Core for Node runtimes by
23
23
  * applying environment-appropriate defaults (e.g., server channel, Node SDK
24
- * library metadata). No analytics or personalization behavior is modified—
25
- * only configuration defaults differ.
24
+ * library metadata). No core runtime behavior is modified; only configuration
25
+ * defaults differ.
26
26
  *
27
27
  * @example
28
28
  * ```ts
29
- * import Optimization from '@contentful/optimization-node'
29
+ * import ContentfulOptimization from '@contentful/optimization-node'
30
30
  *
31
- * const sdk = new Optimization({
31
+ * const sdk = new ContentfulOptimization({
32
32
  * clientId: 'abc-123',
33
33
  * environment: 'main',
34
34
  * logLevel: 'info',
35
35
  * })
36
36
  *
37
- * await sdk.track({ event: 'server_event', properties: { id: 1 } })
37
+ * const requestOptimization = sdk.forRequest({
38
+ * consent: true,
39
+ * locale: 'fr-CA',
40
+ * profile: { id: 'profile-id' },
41
+ * })
42
+ *
43
+ * const { accepted, data } = await requestOptimization.page()
38
44
  * ```
39
45
  *
40
46
  * @see {@link CoreStateless}
41
47
  *
42
48
  * @public
43
49
  */
44
- declare class Optimization extends CoreStateless {
50
+ declare class ContentfulOptimization extends CoreStateless {
45
51
  /**
46
52
  * Create an instance of the Node SDK with merged defaults.
47
53
  *
@@ -50,14 +56,14 @@ declare class Optimization extends CoreStateless {
50
56
  *
51
57
  * @example
52
58
  * ```ts
53
- * import Optimization from '@contentful/optimization-node'
59
+ * import ContentfulOptimization from '@contentful/optimization-node'
54
60
  *
55
- * const optimization = new Optimization({ clientId: 'my-client-id' })
61
+ * const optimization = new ContentfulOptimization({ clientId: 'my-client-id' })
56
62
  * ```
57
63
  */
58
- constructor(config: OptimizationNodeConfig);
64
+ constructor({ app, allowedEventTypes, eventBuilder, ...config }: OptimizationNodeConfig);
59
65
  }
60
- export default Optimization;
66
+ export default ContentfulOptimization;
61
67
 
62
68
  /**
63
69
  * The package name of the Optimization Node SDK, injected at build-time.
@@ -78,7 +84,7 @@ export declare const OPTIMIZATION_NODE_SDK_NAME: string;
78
84
  export declare const OPTIMIZATION_NODE_SDK_VERSION: string;
79
85
 
80
86
  /**
81
- * Configuration for the Node-specific Optimization SDK.
87
+ * Configuration for the Node-specific ContentfulOptimization SDK.
82
88
  *
83
89
  * @remarks
84
90
  * This configuration extends {@link CoreStatelessConfig} but allows partial
@@ -102,10 +108,24 @@ export declare interface OptimizationNodeConfig extends Omit<CoreStatelessConfig
102
108
  *
103
109
  * @remarks
104
110
  * Any provided fields are merged with the default Node SDK metadata.
111
+ * Request-scoped consent should be bound with `forRequest()`, not configured
112
+ * on the SDK singleton.
113
+ *
105
114
  * This differs from {@link CoreStatelessConfig} eventBuilder, which expects
106
115
  * a full configuration object.
107
116
  */
108
- eventBuilder?: Partial<Omit<CoreStatelessConfig['eventBuilder'], 'app'>>;
117
+ eventBuilder?: PublicNodeEventBuilderConfig;
109
118
  }
110
119
 
120
+ /**
121
+ * Public Node event-builder overrides accepted by {@link OptimizationNodeConfig.eventBuilder}.
122
+ *
123
+ * @remarks
124
+ * Request-scoped consent is bound with {@link ContentfulOptimization.forRequest}, so `getConsent`
125
+ * is intentionally omitted from singleton SDK configuration.
126
+ *
127
+ * @public
128
+ */
129
+ export declare type PublicNodeEventBuilderConfig = Partial<Omit<NonNullable<CoreStatelessConfig['eventBuilder']>, 'app' | 'getConsent'>>;
130
+
111
131
  export { }
package/dist/index.d.mts CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Contentful Optimization Node SDK.
2
+ * Contentful ContentfulOptimization Node SDK.
3
3
  *
4
4
  * @remarks
5
- * Adds Node-specific defaults via the {@link Optimization} class.
5
+ * Adds Node-specific defaults via the {@link ContentfulOptimization} class.
6
6
  * Core and transitive API exports are available from dedicated entrypoints:
7
7
  * `@contentful/optimization-node/core-sdk`,
8
8
  * `@contentful/optimization-node/api-client`,
@@ -16,32 +16,38 @@ import { CoreStateless } from '@contentful/optimization-core';
16
16
  import { CoreStatelessConfig } from '@contentful/optimization-core';
17
17
 
18
18
  /**
19
- * Node-specific Optimization SDK built on {@link CoreStateless}.
19
+ * Node-specific ContentfulOptimization SDK built on {@link CoreStateless}.
20
20
  *
21
21
  * @remarks
22
- * This class adapts the stateless Optimization Core for Node runtimes by
22
+ * This class adapts the stateless ContentfulOptimization Core for Node runtimes by
23
23
  * applying environment-appropriate defaults (e.g., server channel, Node SDK
24
- * library metadata). No analytics or personalization behavior is modified—
25
- * only configuration defaults differ.
24
+ * library metadata). No core runtime behavior is modified; only configuration
25
+ * defaults differ.
26
26
  *
27
27
  * @example
28
28
  * ```ts
29
- * import Optimization from '@contentful/optimization-node'
29
+ * import ContentfulOptimization from '@contentful/optimization-node'
30
30
  *
31
- * const sdk = new Optimization({
31
+ * const sdk = new ContentfulOptimization({
32
32
  * clientId: 'abc-123',
33
33
  * environment: 'main',
34
34
  * logLevel: 'info',
35
35
  * })
36
36
  *
37
- * await sdk.track({ event: 'server_event', properties: { id: 1 } })
37
+ * const requestOptimization = sdk.forRequest({
38
+ * consent: true,
39
+ * locale: 'fr-CA',
40
+ * profile: { id: 'profile-id' },
41
+ * })
42
+ *
43
+ * const { accepted, data } = await requestOptimization.page()
38
44
  * ```
39
45
  *
40
46
  * @see {@link CoreStateless}
41
47
  *
42
48
  * @public
43
49
  */
44
- declare class Optimization extends CoreStateless {
50
+ declare class ContentfulOptimization extends CoreStateless {
45
51
  /**
46
52
  * Create an instance of the Node SDK with merged defaults.
47
53
  *
@@ -50,14 +56,14 @@ declare class Optimization extends CoreStateless {
50
56
  *
51
57
  * @example
52
58
  * ```ts
53
- * import Optimization from '@contentful/optimization-node'
59
+ * import ContentfulOptimization from '@contentful/optimization-node'
54
60
  *
55
- * const optimization = new Optimization({ clientId: 'my-client-id' })
61
+ * const optimization = new ContentfulOptimization({ clientId: 'my-client-id' })
56
62
  * ```
57
63
  */
58
- constructor(config: OptimizationNodeConfig);
64
+ constructor({ app, allowedEventTypes, eventBuilder, ...config }: OptimizationNodeConfig);
59
65
  }
60
- export default Optimization;
66
+ export default ContentfulOptimization;
61
67
 
62
68
  /**
63
69
  * The package name of the Optimization Node SDK, injected at build-time.
@@ -78,7 +84,7 @@ export declare const OPTIMIZATION_NODE_SDK_NAME: string;
78
84
  export declare const OPTIMIZATION_NODE_SDK_VERSION: string;
79
85
 
80
86
  /**
81
- * Configuration for the Node-specific Optimization SDK.
87
+ * Configuration for the Node-specific ContentfulOptimization SDK.
82
88
  *
83
89
  * @remarks
84
90
  * This configuration extends {@link CoreStatelessConfig} but allows partial
@@ -102,10 +108,24 @@ export declare interface OptimizationNodeConfig extends Omit<CoreStatelessConfig
102
108
  *
103
109
  * @remarks
104
110
  * Any provided fields are merged with the default Node SDK metadata.
111
+ * Request-scoped consent should be bound with `forRequest()`, not configured
112
+ * on the SDK singleton.
113
+ *
105
114
  * This differs from {@link CoreStatelessConfig} eventBuilder, which expects
106
115
  * a full configuration object.
107
116
  */
108
- eventBuilder?: Partial<Omit<CoreStatelessConfig['eventBuilder'], 'app'>>;
117
+ eventBuilder?: PublicNodeEventBuilderConfig;
109
118
  }
110
119
 
120
+ /**
121
+ * Public Node event-builder overrides accepted by {@link OptimizationNodeConfig.eventBuilder}.
122
+ *
123
+ * @remarks
124
+ * Request-scoped consent is bound with {@link ContentfulOptimization.forRequest}, so `getConsent`
125
+ * is intentionally omitted from singleton SDK configuration.
126
+ *
127
+ * @public
128
+ */
129
+ export declare type PublicNodeEventBuilderConfig = Partial<Omit<NonNullable<CoreStatelessConfig['eventBuilder']>, 'app' | 'getConsent'>>;
130
+
111
131
  export { }
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Contentful Optimization Node SDK.
2
+ * Contentful ContentfulOptimization Node SDK.
3
3
  *
4
4
  * @remarks
5
- * Adds Node-specific defaults via the {@link Optimization} class.
5
+ * Adds Node-specific defaults via the {@link ContentfulOptimization} class.
6
6
  * Core and transitive API exports are available from dedicated entrypoints:
7
7
  * `@contentful/optimization-node/core-sdk`,
8
8
  * `@contentful/optimization-node/api-client`,
@@ -16,32 +16,38 @@ import { CoreStateless } from '@contentful/optimization-core';
16
16
  import { CoreStatelessConfig } from '@contentful/optimization-core';
17
17
 
18
18
  /**
19
- * Node-specific Optimization SDK built on {@link CoreStateless}.
19
+ * Node-specific ContentfulOptimization SDK built on {@link CoreStateless}.
20
20
  *
21
21
  * @remarks
22
- * This class adapts the stateless Optimization Core for Node runtimes by
22
+ * This class adapts the stateless ContentfulOptimization Core for Node runtimes by
23
23
  * applying environment-appropriate defaults (e.g., server channel, Node SDK
24
- * library metadata). No analytics or personalization behavior is modified—
25
- * only configuration defaults differ.
24
+ * library metadata). No core runtime behavior is modified; only configuration
25
+ * defaults differ.
26
26
  *
27
27
  * @example
28
28
  * ```ts
29
- * import Optimization from '@contentful/optimization-node'
29
+ * import ContentfulOptimization from '@contentful/optimization-node'
30
30
  *
31
- * const sdk = new Optimization({
31
+ * const sdk = new ContentfulOptimization({
32
32
  * clientId: 'abc-123',
33
33
  * environment: 'main',
34
34
  * logLevel: 'info',
35
35
  * })
36
36
  *
37
- * await sdk.track({ event: 'server_event', properties: { id: 1 } })
37
+ * const requestOptimization = sdk.forRequest({
38
+ * consent: true,
39
+ * locale: 'fr-CA',
40
+ * profile: { id: 'profile-id' },
41
+ * })
42
+ *
43
+ * const { accepted, data } = await requestOptimization.page()
38
44
  * ```
39
45
  *
40
46
  * @see {@link CoreStateless}
41
47
  *
42
48
  * @public
43
49
  */
44
- declare class Optimization extends CoreStateless {
50
+ declare class ContentfulOptimization extends CoreStateless {
45
51
  /**
46
52
  * Create an instance of the Node SDK with merged defaults.
47
53
  *
@@ -50,14 +56,14 @@ declare class Optimization extends CoreStateless {
50
56
  *
51
57
  * @example
52
58
  * ```ts
53
- * import Optimization from '@contentful/optimization-node'
59
+ * import ContentfulOptimization from '@contentful/optimization-node'
54
60
  *
55
- * const optimization = new Optimization({ clientId: 'my-client-id' })
61
+ * const optimization = new ContentfulOptimization({ clientId: 'my-client-id' })
56
62
  * ```
57
63
  */
58
- constructor(config: OptimizationNodeConfig);
64
+ constructor({ app, allowedEventTypes, eventBuilder, ...config }: OptimizationNodeConfig);
59
65
  }
60
- export default Optimization;
66
+ export default ContentfulOptimization;
61
67
 
62
68
  /**
63
69
  * The package name of the Optimization Node SDK, injected at build-time.
@@ -78,7 +84,7 @@ export declare const OPTIMIZATION_NODE_SDK_NAME: string;
78
84
  export declare const OPTIMIZATION_NODE_SDK_VERSION: string;
79
85
 
80
86
  /**
81
- * Configuration for the Node-specific Optimization SDK.
87
+ * Configuration for the Node-specific ContentfulOptimization SDK.
82
88
  *
83
89
  * @remarks
84
90
  * This configuration extends {@link CoreStatelessConfig} but allows partial
@@ -102,10 +108,24 @@ export declare interface OptimizationNodeConfig extends Omit<CoreStatelessConfig
102
108
  *
103
109
  * @remarks
104
110
  * Any provided fields are merged with the default Node SDK metadata.
111
+ * Request-scoped consent should be bound with `forRequest()`, not configured
112
+ * on the SDK singleton.
113
+ *
105
114
  * This differs from {@link CoreStatelessConfig} eventBuilder, which expects
106
115
  * a full configuration object.
107
116
  */
108
- eventBuilder?: Partial<Omit<CoreStatelessConfig['eventBuilder'], 'app'>>;
117
+ eventBuilder?: PublicNodeEventBuilderConfig;
109
118
  }
110
119
 
120
+ /**
121
+ * Public Node event-builder overrides accepted by {@link OptimizationNodeConfig.eventBuilder}.
122
+ *
123
+ * @remarks
124
+ * Request-scoped consent is bound with {@link ContentfulOptimization.forRequest}, so `getConsent`
125
+ * is intentionally omitted from singleton SDK configuration.
126
+ *
127
+ * @public
128
+ */
129
+ export declare type PublicNodeEventBuilderConfig = Partial<Omit<NonNullable<CoreStatelessConfig['eventBuilder']>, 'app' | 'getConsent'>>;
130
+
111
131
  export { }