@contentful/optimization-core 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.
Files changed (147) hide show
  1. package/README.md +221 -31
  2. package/dist/260.mjs +14 -0
  3. package/dist/260.mjs.map +1 -0
  4. package/dist/499.mjs +4 -0
  5. package/dist/632.mjs +5 -0
  6. package/dist/632.mjs.map +1 -0
  7. package/dist/808.mjs +2 -0
  8. package/dist/942.mjs +2 -0
  9. package/dist/api-client.cjs +60 -0
  10. package/dist/api-client.cjs.map +1 -0
  11. package/dist/api-client.d.cts +4 -0
  12. package/dist/api-client.d.mts +4 -0
  13. package/dist/api-client.d.ts +4 -0
  14. package/dist/api-client.mjs +2 -0
  15. package/dist/api-schemas.cjs +60 -0
  16. package/dist/api-schemas.cjs.map +1 -0
  17. package/dist/api-schemas.d.cts +4 -0
  18. package/dist/api-schemas.d.mts +4 -0
  19. package/dist/api-schemas.d.ts +4 -0
  20. package/dist/api-schemas.mjs +2 -0
  21. package/dist/constants.cjs +78 -0
  22. package/dist/constants.cjs.map +1 -0
  23. package/dist/{global-constants.d.ts → constants.d.cts} +88 -67
  24. package/dist/{global-constants.js → constants.d.mts} +88 -69
  25. package/dist/constants.d.ts +88 -0
  26. package/dist/constants.mjs +1 -0
  27. package/dist/index.cjs +1833 -1706
  28. package/dist/index.cjs.map +1 -1
  29. package/dist/index.d.cts +2432 -0
  30. package/dist/index.d.mts +2432 -0
  31. package/dist/index.d.ts +2432 -15
  32. package/dist/index.mjs +617 -341
  33. package/dist/index.mjs.map +1 -1
  34. package/dist/logger.cjs +67 -0
  35. package/dist/logger.cjs.map +1 -0
  36. package/dist/logger.d.cts +8 -0
  37. package/dist/logger.d.mts +8 -0
  38. package/dist/logger.d.ts +8 -0
  39. package/dist/logger.mjs +2 -0
  40. package/dist/symbols.cjs +42 -0
  41. package/dist/symbols.cjs.map +1 -0
  42. package/dist/symbols.d.cts +10 -0
  43. package/dist/symbols.d.mts +10 -0
  44. package/dist/symbols.d.ts +10 -0
  45. package/dist/symbols.mjs +1 -0
  46. package/package.json +65 -12
  47. package/dist/Consent.d.ts +0 -44
  48. package/dist/Consent.d.ts.map +0 -1
  49. package/dist/Consent.js +0 -2
  50. package/dist/Consent.js.map +0 -1
  51. package/dist/CoreBase.d.ts +0 -161
  52. package/dist/CoreBase.d.ts.map +0 -1
  53. package/dist/CoreBase.js +0 -151
  54. package/dist/CoreBase.js.map +0 -1
  55. package/dist/CoreStateful.d.ts +0 -144
  56. package/dist/CoreStateful.d.ts.map +0 -1
  57. package/dist/CoreStateful.js +0 -141
  58. package/dist/CoreStateful.js.map +0 -1
  59. package/dist/CoreStateless.d.ts +0 -53
  60. package/dist/CoreStateless.d.ts.map +0 -1
  61. package/dist/CoreStateless.js +0 -43
  62. package/dist/CoreStateless.js.map +0 -1
  63. package/dist/ProductBase.d.ts +0 -83
  64. package/dist/ProductBase.d.ts.map +0 -1
  65. package/dist/ProductBase.js +0 -50
  66. package/dist/ProductBase.js.map +0 -1
  67. package/dist/analytics/AnalyticsBase.d.ts +0 -35
  68. package/dist/analytics/AnalyticsBase.d.ts.map +0 -1
  69. package/dist/analytics/AnalyticsBase.js +0 -13
  70. package/dist/analytics/AnalyticsBase.js.map +0 -1
  71. package/dist/analytics/AnalyticsStateful.d.ts +0 -138
  72. package/dist/analytics/AnalyticsStateful.d.ts.map +0 -1
  73. package/dist/analytics/AnalyticsStateful.js +0 -179
  74. package/dist/analytics/AnalyticsStateful.js.map +0 -1
  75. package/dist/analytics/AnalyticsStateless.d.ts +0 -48
  76. package/dist/analytics/AnalyticsStateless.d.ts.map +0 -1
  77. package/dist/analytics/AnalyticsStateless.js +0 -61
  78. package/dist/analytics/AnalyticsStateless.js.map +0 -1
  79. package/dist/analytics/index.d.ts +0 -5
  80. package/dist/analytics/index.d.ts.map +0 -1
  81. package/dist/analytics/index.js +0 -5
  82. package/dist/analytics/index.js.map +0 -1
  83. package/dist/global-constants.d.ts.map +0 -1
  84. package/dist/global-constants.js.map +0 -1
  85. package/dist/index.d.ts.map +0 -1
  86. package/dist/index.js +0 -15
  87. package/dist/index.js.map +0 -1
  88. package/dist/lib/decorators/guardedBy.d.ts +0 -113
  89. package/dist/lib/decorators/guardedBy.d.ts.map +0 -1
  90. package/dist/lib/decorators/guardedBy.js +0 -143
  91. package/dist/lib/decorators/guardedBy.js.map +0 -1
  92. package/dist/lib/decorators/index.d.ts +0 -2
  93. package/dist/lib/decorators/index.d.ts.map +0 -1
  94. package/dist/lib/decorators/index.js +0 -2
  95. package/dist/lib/decorators/index.js.map +0 -1
  96. package/dist/lib/interceptor/InterceptorManager.d.ts +0 -127
  97. package/dist/lib/interceptor/InterceptorManager.d.ts.map +0 -1
  98. package/dist/lib/interceptor/InterceptorManager.js +0 -125
  99. package/dist/lib/interceptor/InterceptorManager.js.map +0 -1
  100. package/dist/lib/interceptor/index.d.ts +0 -2
  101. package/dist/lib/interceptor/index.d.ts.map +0 -1
  102. package/dist/lib/interceptor/index.js +0 -2
  103. package/dist/lib/interceptor/index.js.map +0 -1
  104. package/dist/lib/value-presence/ValuePresence.d.ts +0 -123
  105. package/dist/lib/value-presence/ValuePresence.d.ts.map +0 -1
  106. package/dist/lib/value-presence/ValuePresence.js +0 -141
  107. package/dist/lib/value-presence/ValuePresence.js.map +0 -1
  108. package/dist/lib/value-presence/index.d.ts +0 -2
  109. package/dist/lib/value-presence/index.d.ts.map +0 -1
  110. package/dist/lib/value-presence/index.js +0 -2
  111. package/dist/lib/value-presence/index.js.map +0 -1
  112. package/dist/personalization/PersonalizationBase.d.ts +0 -184
  113. package/dist/personalization/PersonalizationBase.d.ts.map +0 -1
  114. package/dist/personalization/PersonalizationBase.js +0 -76
  115. package/dist/personalization/PersonalizationBase.js.map +0 -1
  116. package/dist/personalization/PersonalizationStateful.d.ts +0 -226
  117. package/dist/personalization/PersonalizationStateful.d.ts.map +0 -1
  118. package/dist/personalization/PersonalizationStateful.js +0 -297
  119. package/dist/personalization/PersonalizationStateful.js.map +0 -1
  120. package/dist/personalization/PersonalizationStateless.d.ts +0 -74
  121. package/dist/personalization/PersonalizationStateless.d.ts.map +0 -1
  122. package/dist/personalization/PersonalizationStateless.js +0 -98
  123. package/dist/personalization/PersonalizationStateless.js.map +0 -1
  124. package/dist/personalization/index.d.ts +0 -6
  125. package/dist/personalization/index.d.ts.map +0 -1
  126. package/dist/personalization/index.js +0 -6
  127. package/dist/personalization/index.js.map +0 -1
  128. package/dist/personalization/resolvers/FlagsResolver.d.ts +0 -35
  129. package/dist/personalization/resolvers/FlagsResolver.d.ts.map +0 -1
  130. package/dist/personalization/resolvers/FlagsResolver.js +0 -47
  131. package/dist/personalization/resolvers/FlagsResolver.js.map +0 -1
  132. package/dist/personalization/resolvers/MergeTagValueResolver.d.ts +0 -74
  133. package/dist/personalization/resolvers/MergeTagValueResolver.d.ts.map +0 -1
  134. package/dist/personalization/resolvers/MergeTagValueResolver.js +0 -109
  135. package/dist/personalization/resolvers/MergeTagValueResolver.js.map +0 -1
  136. package/dist/personalization/resolvers/PersonalizedEntryResolver.d.ts +0 -142
  137. package/dist/personalization/resolvers/PersonalizedEntryResolver.d.ts.map +0 -1
  138. package/dist/personalization/resolvers/PersonalizedEntryResolver.js +0 -196
  139. package/dist/personalization/resolvers/PersonalizedEntryResolver.js.map +0 -1
  140. package/dist/personalization/resolvers/index.d.ts +0 -7
  141. package/dist/personalization/resolvers/index.d.ts.map +0 -1
  142. package/dist/personalization/resolvers/index.js +0 -7
  143. package/dist/personalization/resolvers/index.js.map +0 -1
  144. package/dist/signals.d.ts +0 -42
  145. package/dist/signals.d.ts.map +0 -1
  146. package/dist/signals.js +0 -36
  147. package/dist/signals.js.map +0 -1
@@ -0,0 +1,78 @@
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: ()=>ANONYMOUS_ID_COOKIE,
28
+ ANONYMOUS_ID_COOKIE_LEGACY: ()=>ANONYMOUS_ID_COOKIE_LEGACY,
29
+ ANONYMOUS_ID_KEY: ()=>ANONYMOUS_ID_KEY,
30
+ ANONYMOUS_ID_KEY_LEGACY: ()=>ANONYMOUS_ID_KEY_LEGACY,
31
+ CHANGES_CACHE_KEY: ()=>CHANGES_CACHE_KEY,
32
+ CONSENT_KEY: ()=>CONSENT_KEY,
33
+ DEBUG_FLAG_KEY: ()=>DEBUG_FLAG_KEY,
34
+ OPTIMIZATION_CORE_SDK_NAME: ()=>OPTIMIZATION_CORE_SDK_NAME,
35
+ OPTIMIZATION_CORE_SDK_VERSION: ()=>OPTIMIZATION_CORE_SDK_VERSION,
36
+ PERSONALIZATIONS_CACHE_KEY: ()=>PERSONALIZATIONS_CACHE_KEY,
37
+ PROFILE_CACHE_KEY: ()=>PROFILE_CACHE_KEY
38
+ });
39
+ const OPTIMIZATION_CORE_SDK_VERSION = "0.1.0-alpha9";
40
+ const OPTIMIZATION_CORE_SDK_NAME = "@contentful/optimization-core";
41
+ const ANONYMOUS_ID_COOKIE = 'ctfl-opt-aid';
42
+ const ANONYMOUS_ID_KEY = '__ctfl_opt_anonymous_id__';
43
+ const CONSENT_KEY = '__ctfl_opt_consent__';
44
+ const CHANGES_CACHE_KEY = '__ctfl_opt_changes__';
45
+ const DEBUG_FLAG_KEY = '__ctfl_opt_debug__';
46
+ const PROFILE_CACHE_KEY = '__ctfl_opt_profile__';
47
+ const PERSONALIZATIONS_CACHE_KEY = '__ctfl_opt_personalizations__';
48
+ const ANONYMOUS_ID_COOKIE_LEGACY = 'ntaid';
49
+ const ANONYMOUS_ID_KEY_LEGACY = '__nt_anonymous_id__';
50
+ exports.ANONYMOUS_ID_COOKIE = __webpack_exports__.ANONYMOUS_ID_COOKIE;
51
+ exports.ANONYMOUS_ID_COOKIE_LEGACY = __webpack_exports__.ANONYMOUS_ID_COOKIE_LEGACY;
52
+ exports.ANONYMOUS_ID_KEY = __webpack_exports__.ANONYMOUS_ID_KEY;
53
+ exports.ANONYMOUS_ID_KEY_LEGACY = __webpack_exports__.ANONYMOUS_ID_KEY_LEGACY;
54
+ exports.CHANGES_CACHE_KEY = __webpack_exports__.CHANGES_CACHE_KEY;
55
+ exports.CONSENT_KEY = __webpack_exports__.CONSENT_KEY;
56
+ exports.DEBUG_FLAG_KEY = __webpack_exports__.DEBUG_FLAG_KEY;
57
+ exports.OPTIMIZATION_CORE_SDK_NAME = __webpack_exports__.OPTIMIZATION_CORE_SDK_NAME;
58
+ exports.OPTIMIZATION_CORE_SDK_VERSION = __webpack_exports__.OPTIMIZATION_CORE_SDK_VERSION;
59
+ exports.PERSONALIZATIONS_CACHE_KEY = __webpack_exports__.PERSONALIZATIONS_CACHE_KEY;
60
+ exports.PROFILE_CACHE_KEY = __webpack_exports__.PROFILE_CACHE_KEY;
61
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
62
+ "ANONYMOUS_ID_COOKIE",
63
+ "ANONYMOUS_ID_COOKIE_LEGACY",
64
+ "ANONYMOUS_ID_KEY",
65
+ "ANONYMOUS_ID_KEY_LEGACY",
66
+ "CHANGES_CACHE_KEY",
67
+ "CONSENT_KEY",
68
+ "DEBUG_FLAG_KEY",
69
+ "OPTIMIZATION_CORE_SDK_NAME",
70
+ "OPTIMIZATION_CORE_SDK_VERSION",
71
+ "PERSONALIZATIONS_CACHE_KEY",
72
+ "PROFILE_CACHE_KEY"
73
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
74
+ Object.defineProperty(exports, '__esModule', {
75
+ value: true
76
+ });
77
+
78
+ //# 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 Core SDK, injected at build time.\n *\n * @public\n */\nexport const OPTIMIZATION_CORE_SDK_VERSION =\n typeof __OPTIMIZATION_VERSION__ === 'string' ? __OPTIMIZATION_VERSION__ : '0.0.0'\n/**\n * The package name of the Optimization Core SDK, injected at build time.\n *\n * @public\n */\nexport const OPTIMIZATION_CORE_SDK_NAME =\n typeof __OPTIMIZATION_PACKAGE_NAME__ === 'string'\n ? __OPTIMIZATION_PACKAGE_NAME__\n : '@contentful/optimization-core'\n\n/**\n * Anonymous-ID cookie name used by the Optimization Core.\n *\n * @public\n * @remarks\n * This constant 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 } from '@contentful/optimization-core/constants'\n * const profileId = request.cookies[ANONYMOUS_ID_COOKIE]\n * ```\n */\nexport const ANONYMOUS_ID_COOKIE = 'ctfl-opt-aid'\n\n/**\n * Storage key for the anonymous identifier.\n *\n * @internal\n */\nexport const ANONYMOUS_ID_KEY = '__ctfl_opt_anonymous_id__'\n\n/**\n * Storage key for the persisted consent status.\n *\n * @internal\n */\nexport const CONSENT_KEY = '__ctfl_opt_consent__'\n\n/**\n * Storage key for cached Custom Flags.\n *\n * @internal\n */\nexport const CHANGES_CACHE_KEY = '__ctfl_opt_changes__'\n\n/**\n * Storage key for the debug flag toggle.\n *\n * @internal\n */\nexport const DEBUG_FLAG_KEY = '__ctfl_opt_debug__'\n\n/**\n * Storage key for cached profile data.\n *\n * @internal\n */\nexport const PROFILE_CACHE_KEY = '__ctfl_opt_profile__'\n\n/**\n * Storage key for cached selected personalizations.\n *\n * @internal\n */\nexport const PERSONALIZATIONS_CACHE_KEY = '__ctfl_opt_personalizations__'\n\n/**\n * Legacy anoynmous ID cookie key for migration from experience.js\n *\n * @internal\n */\nexport const ANONYMOUS_ID_COOKIE_LEGACY = 'ntaid'\n\n/**\n * Legacy anoynmous ID storage key for migration from experience.js\n *\n * @internal\n */\nexport const ANONYMOUS_ID_KEY_LEGACY = '__nt_anonymous_id__'\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","OPTIMIZATION_CORE_SDK_VERSION","__OPTIMIZATION_VERSION__","OPTIMIZATION_CORE_SDK_NAME","__OPTIMIZATION_PACKAGE_NAME__","ANONYMOUS_ID_COOKIE","ANONYMOUS_ID_KEY","CONSENT_KEY","CHANGES_CACHE_KEY","DEBUG_FLAG_KEY","PROFILE_CACHE_KEY","PERSONALIZATIONS_CACHE_KEY","ANONYMOUS_ID_COOKIE_LEGACY","ANONYMOUS_ID_KEY_LEGACY"],"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;;;;;;;;;;;;;;;;;ACIO,MAAMI,gCACoCC;AAM1C,MAAMC,6BAEPC;AAkBC,MAAMC,sBAAsB;AAO5B,MAAMC,mBAAmB;AAOzB,MAAMC,cAAc;AAOpB,MAAMC,oBAAoB;AAO1B,MAAMC,iBAAiB;AAOvB,MAAMC,oBAAoB;AAO1B,MAAMC,6BAA6B;AAOnC,MAAMC,6BAA6B;AAOnC,MAAMC,0BAA0B"}
@@ -1,67 +1,88 @@
1
- export declare const OPTIMIZATION_CORE_SDK_VERSION: string;
2
- export declare const OPTIMIZATION_CORE_SDK_NAME: string;
3
- /**
4
- * Anonymous-ID cookie name used by the Optimization Core.
5
- *
6
- * @public
7
- * @remarks
8
- * This constant represents the cookie key used by the Optimization Framework
9
- * to persist an anonymous identifier for tracking personalization and analytics
10
- * events when no explicit profile is known.
11
- *
12
- * @example
13
- * ```ts
14
- * import { ANONYMOUS_ID_COOKIE } from '@contentful/optimization-core'
15
- * const profileId = request.cookies[ANONYMOUS_ID_COOKIE]
16
- * ```
17
- */
18
- export declare const ANONYMOUS_ID_COOKIE = "ctfl-opt-aid";
19
- /**
20
- * Storage key for the anonymous identifier.
21
- *
22
- * @internal
23
- */
24
- export declare const ANONYMOUS_ID_KEY = "__ctfl_opt_anonymous_id__";
25
- /**
26
- * Storage key for the persisted consent status.
27
- *
28
- * @internal
29
- */
30
- export declare const CONSENT_KEY = "__ctfl_opt_consent__";
31
- /**
32
- * Storage key for cached Custom Flags.
33
- *
34
- * @internal
35
- */
36
- export declare const CHANGES_CACHE_KEY = "__ctfl_opt_changes__";
37
- /**
38
- * Storage key for the debug flag toggle.
39
- *
40
- * @internal
41
- */
42
- export declare const DEBUG_FLAG_KEY = "__ctfl_opt_debug__";
43
- /**
44
- * Storage key for cached profile data.
45
- *
46
- * @internal
47
- */
48
- export declare const PROFILE_CACHE_KEY = "__ctfl_opt_profile__";
49
- /**
50
- * Storage key for cached selected personalizations.
51
- *
52
- * @internal
53
- */
54
- export declare const PERSONALIZATIONS_CACHE_KEY = "__ctfl_opt_personalizations__";
55
- /**
56
- * Legacy anoynmous ID cookie key for migration from experience.js
57
- *
58
- * @internal
59
- */
60
- export declare const ANONYMOUS_ID_COOKIE_LEGACY = "ntaid";
61
- /**
62
- * Legacy anoynmous ID storage key for migration from experience.js
63
- *
64
- * @internal
65
- */
66
- export declare const ANONYMOUS_ID_KEY_LEGACY = "__nt_anonymous_id__";
67
- //# sourceMappingURL=global-constants.d.ts.map
1
+ /**
2
+ * Anonymous-ID cookie name used by the Optimization Core.
3
+ *
4
+ * @public
5
+ * @remarks
6
+ * This constant represents the cookie key used by the Optimization Framework
7
+ * to persist an anonymous identifier for tracking personalization and analytics
8
+ * events when no explicit profile is known.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * import { ANONYMOUS_ID_COOKIE } from '@contentful/optimization-core/constants'
13
+ * const profileId = request.cookies[ANONYMOUS_ID_COOKIE]
14
+ * ```
15
+ */
16
+ export declare const ANONYMOUS_ID_COOKIE = "ctfl-opt-aid";
17
+
18
+ /**
19
+ * Legacy anoynmous ID cookie key for migration from experience.js
20
+ *
21
+ * @internal
22
+ */
23
+ export declare const ANONYMOUS_ID_COOKIE_LEGACY = "ntaid";
24
+
25
+ /**
26
+ * Storage key for the anonymous identifier.
27
+ *
28
+ * @internal
29
+ */
30
+ export declare const ANONYMOUS_ID_KEY = "__ctfl_opt_anonymous_id__";
31
+
32
+ /**
33
+ * Legacy anoynmous ID storage key for migration from experience.js
34
+ *
35
+ * @internal
36
+ */
37
+ export declare const ANONYMOUS_ID_KEY_LEGACY = "__nt_anonymous_id__";
38
+
39
+ /**
40
+ * Storage key for cached Custom Flags.
41
+ *
42
+ * @internal
43
+ */
44
+ export declare const CHANGES_CACHE_KEY = "__ctfl_opt_changes__";
45
+
46
+ /**
47
+ * Storage key for the persisted consent status.
48
+ *
49
+ * @internal
50
+ */
51
+ export declare const CONSENT_KEY = "__ctfl_opt_consent__";
52
+
53
+ /**
54
+ * Storage key for the debug flag toggle.
55
+ *
56
+ * @internal
57
+ */
58
+ export declare const DEBUG_FLAG_KEY = "__ctfl_opt_debug__";
59
+
60
+ /**
61
+ * The package name of the Optimization Core SDK, injected at build time.
62
+ *
63
+ * @public
64
+ */
65
+ export declare const OPTIMIZATION_CORE_SDK_NAME: string;
66
+
67
+ /**
68
+ * The current version of the Optimization Core SDK, injected at build time.
69
+ *
70
+ * @public
71
+ */
72
+ export declare const OPTIMIZATION_CORE_SDK_VERSION: string;
73
+
74
+ /**
75
+ * Storage key for cached selected personalizations.
76
+ *
77
+ * @internal
78
+ */
79
+ export declare const PERSONALIZATIONS_CACHE_KEY = "__ctfl_opt_personalizations__";
80
+
81
+ /**
82
+ * Storage key for cached profile data.
83
+ *
84
+ * @internal
85
+ */
86
+ export declare const PROFILE_CACHE_KEY = "__ctfl_opt_profile__";
87
+
88
+ export { }
@@ -1,69 +1,88 @@
1
- export const OPTIMIZATION_CORE_SDK_VERSION = typeof __OPTIMIZATION_VERSION__ === 'string' ? __OPTIMIZATION_VERSION__ : '0.0.0';
2
- export const OPTIMIZATION_CORE_SDK_NAME = typeof __OPTIMIZATION_PACKAGE_NAME__ === 'string'
3
- ? __OPTIMIZATION_PACKAGE_NAME__
4
- : '@contentful/optimization-core';
5
- /**
6
- * Anonymous-ID cookie name used by the Optimization Core.
7
- *
8
- * @public
9
- * @remarks
10
- * This constant represents the cookie key used by the Optimization Framework
11
- * to persist an anonymous identifier for tracking personalization and analytics
12
- * events when no explicit profile is known.
13
- *
14
- * @example
15
- * ```ts
16
- * import { ANONYMOUS_ID_COOKIE } from '@contentful/optimization-core'
17
- * const profileId = request.cookies[ANONYMOUS_ID_COOKIE]
18
- * ```
19
- */
20
- export const ANONYMOUS_ID_COOKIE = 'ctfl-opt-aid';
21
- /**
22
- * Storage key for the anonymous identifier.
23
- *
24
- * @internal
25
- */
26
- export const ANONYMOUS_ID_KEY = '__ctfl_opt_anonymous_id__';
27
- /**
28
- * Storage key for the persisted consent status.
29
- *
30
- * @internal
31
- */
32
- export const CONSENT_KEY = '__ctfl_opt_consent__';
33
- /**
34
- * Storage key for cached Custom Flags.
35
- *
36
- * @internal
37
- */
38
- export const CHANGES_CACHE_KEY = '__ctfl_opt_changes__';
39
- /**
40
- * Storage key for the debug flag toggle.
41
- *
42
- * @internal
43
- */
44
- export const DEBUG_FLAG_KEY = '__ctfl_opt_debug__';
45
- /**
46
- * Storage key for cached profile data.
47
- *
48
- * @internal
49
- */
50
- export const PROFILE_CACHE_KEY = '__ctfl_opt_profile__';
51
- /**
52
- * Storage key for cached selected personalizations.
53
- *
54
- * @internal
55
- */
56
- export const PERSONALIZATIONS_CACHE_KEY = '__ctfl_opt_personalizations__';
57
- /**
58
- * Legacy anoynmous ID cookie key for migration from experience.js
59
- *
60
- * @internal
61
- */
62
- export const ANONYMOUS_ID_COOKIE_LEGACY = 'ntaid';
63
- /**
64
- * Legacy anoynmous ID storage key for migration from experience.js
65
- *
66
- * @internal
67
- */
68
- export const ANONYMOUS_ID_KEY_LEGACY = '__nt_anonymous_id__';
69
- //# sourceMappingURL=global-constants.js.map
1
+ /**
2
+ * Anonymous-ID cookie name used by the Optimization Core.
3
+ *
4
+ * @public
5
+ * @remarks
6
+ * This constant represents the cookie key used by the Optimization Framework
7
+ * to persist an anonymous identifier for tracking personalization and analytics
8
+ * events when no explicit profile is known.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * import { ANONYMOUS_ID_COOKIE } from '@contentful/optimization-core/constants'
13
+ * const profileId = request.cookies[ANONYMOUS_ID_COOKIE]
14
+ * ```
15
+ */
16
+ export declare const ANONYMOUS_ID_COOKIE = "ctfl-opt-aid";
17
+
18
+ /**
19
+ * Legacy anoynmous ID cookie key for migration from experience.js
20
+ *
21
+ * @internal
22
+ */
23
+ export declare const ANONYMOUS_ID_COOKIE_LEGACY = "ntaid";
24
+
25
+ /**
26
+ * Storage key for the anonymous identifier.
27
+ *
28
+ * @internal
29
+ */
30
+ export declare const ANONYMOUS_ID_KEY = "__ctfl_opt_anonymous_id__";
31
+
32
+ /**
33
+ * Legacy anoynmous ID storage key for migration from experience.js
34
+ *
35
+ * @internal
36
+ */
37
+ export declare const ANONYMOUS_ID_KEY_LEGACY = "__nt_anonymous_id__";
38
+
39
+ /**
40
+ * Storage key for cached Custom Flags.
41
+ *
42
+ * @internal
43
+ */
44
+ export declare const CHANGES_CACHE_KEY = "__ctfl_opt_changes__";
45
+
46
+ /**
47
+ * Storage key for the persisted consent status.
48
+ *
49
+ * @internal
50
+ */
51
+ export declare const CONSENT_KEY = "__ctfl_opt_consent__";
52
+
53
+ /**
54
+ * Storage key for the debug flag toggle.
55
+ *
56
+ * @internal
57
+ */
58
+ export declare const DEBUG_FLAG_KEY = "__ctfl_opt_debug__";
59
+
60
+ /**
61
+ * The package name of the Optimization Core SDK, injected at build time.
62
+ *
63
+ * @public
64
+ */
65
+ export declare const OPTIMIZATION_CORE_SDK_NAME: string;
66
+
67
+ /**
68
+ * The current version of the Optimization Core SDK, injected at build time.
69
+ *
70
+ * @public
71
+ */
72
+ export declare const OPTIMIZATION_CORE_SDK_VERSION: string;
73
+
74
+ /**
75
+ * Storage key for cached selected personalizations.
76
+ *
77
+ * @internal
78
+ */
79
+ export declare const PERSONALIZATIONS_CACHE_KEY = "__ctfl_opt_personalizations__";
80
+
81
+ /**
82
+ * Storage key for cached profile data.
83
+ *
84
+ * @internal
85
+ */
86
+ export declare const PROFILE_CACHE_KEY = "__ctfl_opt_profile__";
87
+
88
+ export { }
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Anonymous-ID cookie name used by the Optimization Core.
3
+ *
4
+ * @public
5
+ * @remarks
6
+ * This constant represents the cookie key used by the Optimization Framework
7
+ * to persist an anonymous identifier for tracking personalization and analytics
8
+ * events when no explicit profile is known.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * import { ANONYMOUS_ID_COOKIE } from '@contentful/optimization-core/constants'
13
+ * const profileId = request.cookies[ANONYMOUS_ID_COOKIE]
14
+ * ```
15
+ */
16
+ export declare const ANONYMOUS_ID_COOKIE = "ctfl-opt-aid";
17
+
18
+ /**
19
+ * Legacy anoynmous ID cookie key for migration from experience.js
20
+ *
21
+ * @internal
22
+ */
23
+ export declare const ANONYMOUS_ID_COOKIE_LEGACY = "ntaid";
24
+
25
+ /**
26
+ * Storage key for the anonymous identifier.
27
+ *
28
+ * @internal
29
+ */
30
+ export declare const ANONYMOUS_ID_KEY = "__ctfl_opt_anonymous_id__";
31
+
32
+ /**
33
+ * Legacy anoynmous ID storage key for migration from experience.js
34
+ *
35
+ * @internal
36
+ */
37
+ export declare const ANONYMOUS_ID_KEY_LEGACY = "__nt_anonymous_id__";
38
+
39
+ /**
40
+ * Storage key for cached Custom Flags.
41
+ *
42
+ * @internal
43
+ */
44
+ export declare const CHANGES_CACHE_KEY = "__ctfl_opt_changes__";
45
+
46
+ /**
47
+ * Storage key for the persisted consent status.
48
+ *
49
+ * @internal
50
+ */
51
+ export declare const CONSENT_KEY = "__ctfl_opt_consent__";
52
+
53
+ /**
54
+ * Storage key for the debug flag toggle.
55
+ *
56
+ * @internal
57
+ */
58
+ export declare const DEBUG_FLAG_KEY = "__ctfl_opt_debug__";
59
+
60
+ /**
61
+ * The package name of the Optimization Core SDK, injected at build time.
62
+ *
63
+ * @public
64
+ */
65
+ export declare const OPTIMIZATION_CORE_SDK_NAME: string;
66
+
67
+ /**
68
+ * The current version of the Optimization Core SDK, injected at build time.
69
+ *
70
+ * @public
71
+ */
72
+ export declare const OPTIMIZATION_CORE_SDK_VERSION: string;
73
+
74
+ /**
75
+ * Storage key for cached selected personalizations.
76
+ *
77
+ * @internal
78
+ */
79
+ export declare const PERSONALIZATIONS_CACHE_KEY = "__ctfl_opt_personalizations__";
80
+
81
+ /**
82
+ * Storage key for cached profile data.
83
+ *
84
+ * @internal
85
+ */
86
+ export declare const PROFILE_CACHE_KEY = "__ctfl_opt_profile__";
87
+
88
+ export { }
@@ -0,0 +1 @@
1
+ export { ANONYMOUS_ID_COOKIE, ANONYMOUS_ID_COOKIE_LEGACY, ANONYMOUS_ID_KEY, ANONYMOUS_ID_KEY_LEGACY, CHANGES_CACHE_KEY, CONSENT_KEY, DEBUG_FLAG_KEY, OPTIMIZATION_CORE_SDK_NAME, OPTIMIZATION_CORE_SDK_VERSION, PERSONALIZATIONS_CACHE_KEY, PROFILE_CACHE_KEY } from "./260.mjs";