@namiml/sdk-core 3.4.12-dev.202609281859 → 3.4.12-dev.202609290126

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/index.cjs CHANGED
@@ -106,7 +106,7 @@ const {
106
106
  // version — stamped by scripts/version.sh
107
107
  NAMI_SDK_VERSION: exports.NAMI_SDK_VERSION = "3.4.12",
108
108
  // full package version including dev suffix — stamped by scripts/version.sh
109
- NAMI_SDK_PACKAGE_VERSION: exports.NAMI_SDK_PACKAGE_VERSION = "3.4.12-dev.202609281859",
109
+ NAMI_SDK_PACKAGE_VERSION: exports.NAMI_SDK_PACKAGE_VERSION = "3.4.12-dev.202609290126",
110
110
  // environments
111
111
  PRODUCTION: exports.PRODUCTION = "production", DEVELOPMENT: exports.DEVELOPMENT = "development",
112
112
  // error messages
@@ -57086,7 +57086,16 @@ const selectSegment = (segments, splitPosition) => {
57086
57086
  const mapAnonymousCampaigns = (campaigns, splitPosition, formFactor) => {
57087
57087
  if (!campaigns)
57088
57088
  return [];
57089
+ // A rule without a `segments` array is not in the anonymous shape — the backend serves the
57090
+ // legacy resolved shape (a flat `segment`) when a request carries no usable sdk_version. Skip
57091
+ // it rather than throw: throwing here escapes configure() and stops startup (NAM-4653).
57092
+ const unsegmented = campaigns.filter((campaign) => !Array.isArray(campaign.segments)).length;
57093
+ if (unsegmented > 0) {
57094
+ logger.warn(`Skipping ${unsegmented} of ${campaigns.length} campaign rules with no segments array`);
57095
+ }
57089
57096
  return campaigns.flatMap((campaign) => {
57097
+ if (!Array.isArray(campaign.segments))
57098
+ return [];
57090
57099
  let segments;
57091
57100
  if (typeof formFactor === 'string') {
57092
57101
  segments = campaign.segments.filter(seg => seg.form_factors.some(f => f.form_factor === formFactor));
package/dist/index.mjs CHANGED
@@ -104,7 +104,7 @@ const {
104
104
  // version — stamped by scripts/version.sh
105
105
  NAMI_SDK_VERSION = "3.4.12",
106
106
  // full package version including dev suffix — stamped by scripts/version.sh
107
- NAMI_SDK_PACKAGE_VERSION = "3.4.12-dev.202609281859",
107
+ NAMI_SDK_PACKAGE_VERSION = "3.4.12-dev.202609290126",
108
108
  // environments
109
109
  PRODUCTION = "production", DEVELOPMENT = "development",
110
110
  // error messages
@@ -57084,7 +57084,16 @@ const selectSegment = (segments, splitPosition) => {
57084
57084
  const mapAnonymousCampaigns = (campaigns, splitPosition, formFactor) => {
57085
57085
  if (!campaigns)
57086
57086
  return [];
57087
+ // A rule without a `segments` array is not in the anonymous shape — the backend serves the
57088
+ // legacy resolved shape (a flat `segment`) when a request carries no usable sdk_version. Skip
57089
+ // it rather than throw: throwing here escapes configure() and stops startup (NAM-4653).
57090
+ const unsegmented = campaigns.filter((campaign) => !Array.isArray(campaign.segments)).length;
57091
+ if (unsegmented > 0) {
57092
+ logger.warn(`Skipping ${unsegmented} of ${campaigns.length} campaign rules with no segments array`);
57093
+ }
57087
57094
  return campaigns.flatMap((campaign) => {
57095
+ if (!Array.isArray(campaign.segments))
57096
+ return [];
57088
57097
  let segments;
57089
57098
  if (typeof formFactor === 'string') {
57090
57099
  segments = campaign.segments.filter(seg => seg.form_factors.some(f => f.form_factor === formFactor));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@namiml/sdk-core",
3
- "version": "3.4.12-dev.202609281859",
3
+ "version": "3.4.12-dev.202609290126",
4
4
  "description": "Platform-agnostic core for the Nami SDK — business logic, API, types, and state management",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",