@namiml/sdk-core 3.5.0-dev.202610162125 → 3.5.0-dev.202610190348
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 +103 -8
- package/dist/index.d.ts +4 -2
- package/dist/index.mjs +104 -9
- package/package.json +1 -1
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.5.0",
|
|
108
108
|
// full package version including dev suffix — stamped by scripts/version.sh
|
|
109
|
-
NAMI_SDK_PACKAGE_VERSION: exports.NAMI_SDK_PACKAGE_VERSION = "3.5.0-dev.
|
|
109
|
+
NAMI_SDK_PACKAGE_VERSION: exports.NAMI_SDK_PACKAGE_VERSION = "3.5.0-dev.202610190348",
|
|
110
110
|
// environments
|
|
111
111
|
PRODUCTION: exports.PRODUCTION = "production", DEVELOPMENT: exports.DEVELOPMENT = "development",
|
|
112
112
|
// error messages
|
|
@@ -130,7 +130,9 @@ CAMPAIGN_CACHE_TTL_PREFIX: exports.CAMPAIGN_CACHE_TTL_PREFIX = "campaignCacheTTL
|
|
|
130
130
|
// and the builder preview can evaluate time conditions at any moment (NAM-4635).
|
|
131
131
|
TIME_OVERRIDE_PREFIX: exports.TIME_OVERRIDE_PREFIX = "timeOverride=",
|
|
132
132
|
// Page condition values that resolve against the per-presentation time snapshot (NAM-4635).
|
|
133
|
-
SYSTEM_TIME_TOKEN_PREFIX: exports.SYSTEM_TIME_TOKEN_PREFIX = "${system.time.",
|
|
133
|
+
SYSTEM_TIME_TOKEN_PREFIX: exports.SYSTEM_TIME_TOKEN_PREFIX = "${system.time.",
|
|
134
|
+
// Flow branch-condition identifiers that the condition evaluator handles itself, read live (NAM-5226).
|
|
135
|
+
SYSTEM_TIME_FILTER_PREFIX: exports.SYSTEM_TIME_FILTER_PREFIX = "System.time.", EXTENDED_PLATFORM: exports.EXTENDED_PLATFORM = "extended-platform", EXTENDED_PLATFORM_VERSION: exports.EXTENDED_PLATFORM_VERSION = "extended-platform-version", API_MAX_CALLS_LIMIT: exports.API_MAX_CALLS_LIMIT = 2, API_RETRY_DELAY_SEC: exports.API_RETRY_DELAY_SEC = 2, API_TIMEOUT_LIMIT: exports.API_TIMEOUT_LIMIT = 20000, DEVICE_API_TIMEOUT_LIMIT: exports.DEVICE_API_TIMEOUT_LIMIT = 2000,
|
|
134
136
|
// Platform-config attempts when no initial config was supplied (Android's
|
|
135
137
|
// CONFIG_MAX_ATTEMPTS; Apple's retry(maxAttempts: 3)).
|
|
136
138
|
CONFIG_MAX_ATTEMPTS: exports.CONFIG_MAX_ATTEMPTS = 3,
|
|
@@ -61329,6 +61331,10 @@ const isSystemTimeAssertion = (assertion) => typeof assertion.value === "string"
|
|
|
61329
61331
|
const parseInstant = (value) => {
|
|
61330
61332
|
if (typeof value !== "string" || !INSTANT.test(value))
|
|
61331
61333
|
return null;
|
|
61334
|
+
// `Date` rolls an impossible day over (2026-02-30 → March 2) instead of rejecting it.
|
|
61335
|
+
const [year, month, day] = value.slice(0, 10).split("-").map(Number);
|
|
61336
|
+
if (day > new Date(Date.UTC(year, month, 0)).getUTCDate())
|
|
61337
|
+
return null;
|
|
61332
61338
|
const date = new Date(value);
|
|
61333
61339
|
return Number.isNaN(date.getTime()) ? null : date;
|
|
61334
61340
|
};
|
|
@@ -61429,11 +61435,84 @@ const evaluateSystemTimeAssertion = (assertion, now) => {
|
|
|
61429
61435
|
return false;
|
|
61430
61436
|
}
|
|
61431
61437
|
};
|
|
61438
|
+
// Flow branch conditions use the engine's operator names; they compare the same way as Pages'.
|
|
61439
|
+
const FLOW_ORDERING = {
|
|
61440
|
+
equals: ORDERING.equals,
|
|
61441
|
+
greater_than: ORDERING.gt,
|
|
61442
|
+
greater_than_or_equal_to: ORDERING.gte,
|
|
61443
|
+
less_than: ORDERING.lt,
|
|
61444
|
+
less_than_or_equal_to: ORDERING.lte,
|
|
61445
|
+
};
|
|
61446
|
+
const flowComparison = (operator) => Object.prototype.hasOwnProperty.call(FLOW_ORDERING, operator) ? FLOW_ORDERING[operator] : null;
|
|
61447
|
+
/** True when a Flow filter identifier is `System.time.<leaf>` (any leaf; unknown leaves evaluate `false`). */
|
|
61448
|
+
const isSystemTimeFilter = (identifier) => typeof identifier === "string" && identifier.startsWith(exports.SYSTEM_TIME_FILTER_PREFIX);
|
|
61449
|
+
/** Every element parsed by `parse`, or `null` when `values` is empty or any element is invalid. */
|
|
61450
|
+
const parseAll = (values, parse) => {
|
|
61451
|
+
if (!Array.isArray(values) || values.length === 0)
|
|
61452
|
+
return null;
|
|
61453
|
+
const parsed = [];
|
|
61454
|
+
for (const value of values) {
|
|
61455
|
+
const item = typeof value === "string" ? parse(value) : null;
|
|
61456
|
+
if (item === null)
|
|
61457
|
+
return null;
|
|
61458
|
+
parsed.push(item);
|
|
61459
|
+
}
|
|
61460
|
+
return parsed;
|
|
61461
|
+
};
|
|
61462
|
+
const parseZonedTime = (value) => {
|
|
61463
|
+
const zoned = splitZoned(value);
|
|
61464
|
+
const match = zoned && TIME_OF_DAY.exec(zoned.value);
|
|
61465
|
+
return zoned && match ? { minutes: Number(match[1]) * 60 + Number(match[2]), zone: zoned.zone } : null;
|
|
61466
|
+
};
|
|
61467
|
+
/**
|
|
61468
|
+
* Evaluates a Flow branch filter on `System.time.*` (the "Flow branch conditions" section of
|
|
61469
|
+
* `shared/time_conditions/README.md`, verified against `flow_vectors.json`). Every value is
|
|
61470
|
+
* validated before anything is compared, so an invalid value is `false` for every operator,
|
|
61471
|
+
* `not_equals` included. Several values match when any one does; `not_equals` when none does.
|
|
61472
|
+
*/
|
|
61473
|
+
const evaluateSystemTimeFilter = (filter, now) => {
|
|
61474
|
+
if (!isSystemTimeFilter(filter.identifier) || Number.isNaN(now.getTime()))
|
|
61475
|
+
return false;
|
|
61476
|
+
switch (filter.identifier.slice(exports.SYSTEM_TIME_FILTER_PREFIX.length)) {
|
|
61477
|
+
case "dayOfWeek": {
|
|
61478
|
+
if (filter.operator !== "equals" && filter.operator !== "not_equals")
|
|
61479
|
+
return false;
|
|
61480
|
+
const days = parseAll(filter.values, parseDay);
|
|
61481
|
+
if (!days)
|
|
61482
|
+
return false;
|
|
61483
|
+
const projected = days.map(({ zone }) => projectInZone(now, zone));
|
|
61484
|
+
if (projected.some((p) => p === null))
|
|
61485
|
+
return false;
|
|
61486
|
+
const matched = days.some(({ day }, i) => projected[i].dayOfWeek === day);
|
|
61487
|
+
return filter.operator === "equals" ? matched : !matched;
|
|
61488
|
+
}
|
|
61489
|
+
case "timeOfDay": {
|
|
61490
|
+
const compare = flowComparison(filter.operator);
|
|
61491
|
+
const times = compare ? parseAll(filter.values, parseZonedTime) : null;
|
|
61492
|
+
if (!compare || !times)
|
|
61493
|
+
return false;
|
|
61494
|
+
const projected = times.map(({ zone }) => projectInZone(now, zone));
|
|
61495
|
+
if (projected.some((p) => p === null))
|
|
61496
|
+
return false;
|
|
61497
|
+
return times.some(({ minutes }, i) => compare(projected[i].minutes, minutes));
|
|
61498
|
+
}
|
|
61499
|
+
case "now": {
|
|
61500
|
+
const compare = flowComparison(filter.operator);
|
|
61501
|
+
const instants = compare ? parseAll(filter.values, parseInstant) : null;
|
|
61502
|
+
if (!compare || !instants)
|
|
61503
|
+
return false;
|
|
61504
|
+
return instants.some((instant) => compare(now.getTime(), instant.getTime()));
|
|
61505
|
+
}
|
|
61506
|
+
default:
|
|
61507
|
+
return false;
|
|
61508
|
+
}
|
|
61509
|
+
};
|
|
61432
61510
|
/** Parses a `timeOverride=<ISO-8601 with offset>` namiCommand; `null` when it is not a valid one. */
|
|
61433
61511
|
const parseTimeOverride = (command) => command.startsWith(exports.TIME_OVERRIDE_PREFIX) ? parseInstant(command.slice(exports.TIME_OVERRIDE_PREFIX.length)) : null;
|
|
61434
61512
|
/**
|
|
61435
61513
|
* The instant to snapshot for a Page or flow-screen presentation: the `timeOverride=` namiCommand
|
|
61436
|
-
* when present and valid, otherwise the device clock. Call it once per presentation.
|
|
61514
|
+
* when present and valid, otherwise the device clock. Call it once per presentation. Flow branch
|
|
61515
|
+
* conditions call it once per condition block instead, so they see the time live.
|
|
61437
61516
|
*/
|
|
61438
61517
|
const getSystemTimeNow = () => {
|
|
61439
61518
|
const command = storageService
|
|
@@ -63129,6 +63208,15 @@ function toComparableNumber(value) {
|
|
|
63129
63208
|
}
|
|
63130
63209
|
return null;
|
|
63131
63210
|
}
|
|
63211
|
+
/**
|
|
63212
|
+
* The instant for one condition block: read on first use, then shared by every filter in the
|
|
63213
|
+
* block, so ANDed `System.time` filters see the same moment. Each block reads the clock afresh —
|
|
63214
|
+
* Flow branch conditions are live, never a snapshot from flow start (NAM-5226).
|
|
63215
|
+
*/
|
|
63216
|
+
function blockClock() {
|
|
63217
|
+
let now;
|
|
63218
|
+
return () => (now ??= getSystemTimeNow());
|
|
63219
|
+
}
|
|
63132
63220
|
class NamiConditionEvaluator {
|
|
63133
63221
|
constructor() {
|
|
63134
63222
|
this.resolvers = new Map();
|
|
@@ -63151,7 +63239,8 @@ class NamiConditionEvaluator {
|
|
|
63151
63239
|
if (filters.length === 0) {
|
|
63152
63240
|
return true;
|
|
63153
63241
|
}
|
|
63154
|
-
const
|
|
63242
|
+
const now = blockClock();
|
|
63243
|
+
const results = filters.map(filter => this.evaluateFilter(filter, now));
|
|
63155
63244
|
switch (conditions.operator) {
|
|
63156
63245
|
case LogicalOperator.AND:
|
|
63157
63246
|
return results.every(result => result);
|
|
@@ -63170,17 +63259,18 @@ class NamiConditionEvaluator {
|
|
|
63170
63259
|
if (filters.length === 0) {
|
|
63171
63260
|
return true;
|
|
63172
63261
|
}
|
|
63262
|
+
const now = blockClock();
|
|
63173
63263
|
switch (conditions.operator) {
|
|
63174
63264
|
case LogicalOperator.AND:
|
|
63175
63265
|
for (const filter of filters) {
|
|
63176
|
-
if (!this.evaluateFilter(filter)) {
|
|
63266
|
+
if (!this.evaluateFilter(filter, now)) {
|
|
63177
63267
|
return false;
|
|
63178
63268
|
}
|
|
63179
63269
|
}
|
|
63180
63270
|
return true;
|
|
63181
63271
|
case LogicalOperator.OR:
|
|
63182
63272
|
for (const filter of filters) {
|
|
63183
|
-
if (this.evaluateFilter(filter)) {
|
|
63273
|
+
if (this.evaluateFilter(filter, now)) {
|
|
63184
63274
|
return true;
|
|
63185
63275
|
}
|
|
63186
63276
|
}
|
|
@@ -63188,14 +63278,19 @@ class NamiConditionEvaluator {
|
|
|
63188
63278
|
case LogicalOperator.NONE:
|
|
63189
63279
|
default:
|
|
63190
63280
|
for (const filter of filters) {
|
|
63191
|
-
if (!this.evaluateFilter(filter)) {
|
|
63281
|
+
if (!this.evaluateFilter(filter, now)) {
|
|
63192
63282
|
return false;
|
|
63193
63283
|
}
|
|
63194
63284
|
}
|
|
63195
63285
|
return true;
|
|
63196
63286
|
}
|
|
63197
63287
|
}
|
|
63198
|
-
evaluateFilter(filter) {
|
|
63288
|
+
evaluateFilter(filter, now = blockClock()) {
|
|
63289
|
+
// System.time.* is evaluated here, ahead of the resolvers and the unresolved-value rule below,
|
|
63290
|
+
// which would otherwise make not_equals true for a field no resolver knows.
|
|
63291
|
+
if (isSystemTimeFilter(filter.identifier)) {
|
|
63292
|
+
return evaluateSystemTimeFilter(filter, now());
|
|
63293
|
+
}
|
|
63199
63294
|
const resolvedValue = this.resolve(filter.identifier);
|
|
63200
63295
|
if (Nami.instance.maxLogging) {
|
|
63201
63296
|
logger.debug(`[NamiConditionEvaluator] resolve(${filter.identifier}) → ${JSON.stringify(resolvedValue)} (type: ${typeof resolvedValue})`);
|
package/dist/index.d.ts
CHANGED
|
@@ -3263,6 +3263,7 @@ declare const SIMULATE_PAYWALL_FETCH_FAILURE: string;
|
|
|
3263
3263
|
declare const CAMPAIGN_CACHE_TTL_PREFIX: string;
|
|
3264
3264
|
declare const TIME_OVERRIDE_PREFIX: string;
|
|
3265
3265
|
declare const SYSTEM_TIME_TOKEN_PREFIX: string;
|
|
3266
|
+
declare const SYSTEM_TIME_FILTER_PREFIX: string;
|
|
3266
3267
|
declare const EXTENDED_PLATFORM: string;
|
|
3267
3268
|
declare const EXTENDED_PLATFORM_VERSION: string;
|
|
3268
3269
|
declare const API_MAX_CALLS_LIMIT: number;
|
|
@@ -3366,7 +3367,8 @@ declare const evaluateSystemTimeAssertion: (assertion: TTestObject, now: Date) =
|
|
|
3366
3367
|
declare const parseTimeOverride: (command: string) => Date | null;
|
|
3367
3368
|
/**
|
|
3368
3369
|
* The instant to snapshot for a Page or flow-screen presentation: the `timeOverride=` namiCommand
|
|
3369
|
-
* when present and valid, otherwise the device clock. Call it once per presentation.
|
|
3370
|
+
* when present and valid, otherwise the device clock. Call it once per presentation. Flow branch
|
|
3371
|
+
* conditions call it once per condition block instead, so they see the time live.
|
|
3370
3372
|
*/
|
|
3371
3373
|
declare const getSystemTimeNow: () => Date;
|
|
3372
3374
|
/**
|
|
@@ -4428,5 +4430,5 @@ declare namespace internal {
|
|
|
4428
4430
|
};
|
|
4429
4431
|
}
|
|
4430
4432
|
|
|
4431
|
-
export { ALREADY_CONFIGURED, ANONYMOUS_MODE, ANONYMOUS_MODE_ALREADY_OFF, ANONYMOUS_MODE_ALREADY_ON, ANONYMOUS_MODE_LOGIN_NOT_ALLOWED, ANONYMOUS_UUID, APIError, API_ACTIVE_ENTITLEMENTS, API_CAMPAIGN_RULES, API_CAMPAIGN_SESSION_TIMESTAMP, API_CONFIG, API_MAX_CALLS_LIMIT, API_PAYWALLS, API_PRODUCTS, API_RETRY_DELAY_SEC, API_TIMEOUT_LIMIT, API_TRAFFIC_OBSERVER, API_VERSION, AUTH_DEVICE, AVAILABLE_ACTIVE_ENTITLEMENTS_CHANGED, AVAILABLE_CAMPAIGNS_CHANGED, AccountStateAction, AnonymousCDPError, AnonymousLoginError, AnonymousModeAlreadyOffError, AnonymousModeAlreadyOnError, BASE_STAGING_URL, BASE_URL, BASE_URL_PATH, BadRequestError, BasicNamiFlow, BorderMap, BorderSideMap, CAMPAIGN_CACHE_TTL_PREFIX, CAMPAIGN_NOT_AVAILABLE, CONFIG_API_TIMEOUT_LIMIT, CONFIG_MAX_ATTEMPTS, CUSTOMER_ATTRIBUTES_KEY_PREFIX, CUSTOMER_JOURNEY_STATE_CHANGED, CUSTOM_HOST_PREFIX, CampaignNotAvailableError, CampaignRuleConversionEventType, CampaignRuleRepository, Capabilities, ClientError, ConfigRepository, ConflictError, CustomerJourneyRepository, DEFAULT_JOURNEY_SETTINGS, DEVELOPMENT, DEVICE_API_TIMEOUT_LIMIT, DEVICE_ID_NOT_SET, DEVICE_ID_REQUIRED, DISABLE_ASYNC_LOGIN_LOGOUT, DeviceIDRequiredError, DeviceRepository, EXTENDED_CLIENT_INFO_DELIMITER, EXTENDED_CLIENT_INFO_PREFIX, EXTENDED_PLATFORM, EXTENDED_PLATFORM_VERSION, EXTERNAL_ID_REQUIRED, EntitlementRepository, EntitlementUtils, ExternalIDRequiredError, FLOW_SCREENS_NOT_AVAILABLE, FlowScreensNotAvailableError, HTML_REGEX, INITIAL_APP_CONFIG, INITIAL_CAMPAIGN_RULES, INITIAL_PAYWALLS, INITIAL_PRODUCTS, INITIAL_SESSION_COUNTER_VALUE, INITIAL_SUCCESS, InternalServerError, KEY_SESSION_COUNTER, LIQUID_VARIABLE_REGEX, LOCAL_NAMI_ENTITLEMENTS, LOG_HTTP_REQUESTS, LOG_HTTP_TRAFFIC, LaunchCampaignError, LaunchContextResolver, LogLevel, NAMI_CONFIGURATION, NAMI_CUSTOMER_JOURNEY_STATE, NAMI_LANGUAGE_CODE, NAMI_LAST_IMPRESSION_ID, NAMI_LAUNCH_ID, NAMI_PROFILE, NAMI_PURCHASE_CHANNEL, NAMI_PURCHASE_IMPRESSION_ID, NAMI_SDK_PACKAGE_VERSION, NAMI_SDK_VERSION, NAMI_SESSION_ID, NAMI_STORAGE_KEYS, Nami, NamiAPI, NamiAnimationType, NamiCampaignManager$2 as NamiCampaignManager, NamiCampaignRuleType, NamiConditionEvaluator, NamiCustomerManager$2 as NamiCustomerManager, NamiEntitlementManager$2 as NamiEntitlementManager, NamiEventEmitter, NamiFlow, NamiFlowActionFunction, NamiFlowManager$1 as NamiFlowManager, NamiFlowStepType, NamiHandoffTag, NamiPaywallAction, NamiPaywallManager$2 as NamiPaywallManager, PaywallManagerEvents as NamiPaywallManagerEvents, NamiPermissionOutcome, NamiPurchaseManager$2 as NamiPurchaseManager, NamiRefs, NamiReservedActions, NotFoundError, PAYWALL_ACTION_EVENT, PLATFORM_ID_REQUIRED, PRODUCTION, PaywallManagerEvents, PaywallRepository, PaywallState, PlacementLabelResolver, PlatformIDRequiredError, ProductRepository, RECONFIG_SUCCESS, RESUME_THROTTLE_MS, RetryLimitExceededError, SDKNotInitializedError, SDK_NOT_INITIALIZED, SERVER_NAMI_ENTITLEMENTS, SESSION_REQUIRED, SHOULD_SHOW_LOADING_INDICATOR, SIMULATE_CONFIG_FETCH_FAILURE, SIMULATE_PAYWALL_FETCH_FAILURE, SKU_TEXT_REGEX, SMART_TEXT_PATTERN, STARTUP_TELEMETRY, STATUS_BAD_REQUEST, STATUS_CONFLICT, STATUS_INTERNAL_SERVER_ERROR, STATUS_NOT_FOUND, STATUS_SUCCESS, SYSTEM_TIME_TOKEN_PREFIX, SessionService, SimpleEventTarget, StorageService, TIME_OVERRIDE_PREFIX, TRANSPORT_FAILURE_STATUS, UNABLE_TO_UPDATE_CDP_ID, USE_STAGING_API, VALIDATE_PRODUCT_GROUPS, VAR_REGEX, NamiProfileManager$1 as _NamiProfileManager, internal as _internal, activateEntitlementByPurchase, activeEntitlements, aggregateScreenreaderText, allCampaigns, allPaywalls, applyEntitlementActivation, audienceSplitPosition, bestUrlCampaignMatch, bigintToUuid, checkAnySkuHasPromoOffer, checkAnySkuHasTrialOffer, convertISO8601PeriodToText, convertLocale, convertOfferToPricingPhase, createNamiEntitlements, currentSku, didReceiveResponse, empty, evaluateSystemTimeAssertion, evaluateSystemTimeCondition, extractStandardPricingPhases, formatDate, formattedPrice, generateUUID, getApiCampaigns, getApiPaywalls, getBaseUrl, getBillingPeriodNumber, getCurrencyFormat, getDeviceData, getDeviceFormFactor, getDeviceScaleFactor, getEffectiveWebStyle, getEntitlementRefIdsForSku, getExtendedClientInfo, getFreeTrialPeriod, getInitialCampaigns, getInitialPaywalls, getJourneySettings, getPaywall, getPaywallDataFromLabel, getPercentagePriceDifference, getPeriodNumberInDays, getPeriodNumberInWeeks, getPlatformAdapters, getPriceDifference, getPricePerMonth, getProductDetail, getPurchaseAdapter, getReferenceSku, getSkuProductDetailKeys, getSkuSmartTextValue, getSlideSmartTextValue, getStandardBillingPeriod, getSystemTimeNow, getTranslate, getUrlParams, handleErrors, hasAllPaywalls, hasCapability, hasPurchaseManagement, initialState, invokeHandler, isAnonymousMode, isInitialConfigCompressed, isNamiFlowCampaign, isSubscription, isSystemTimeAssertion, isValidISODate, isValidUrl, logger, mapAnonymousCampaigns, namiBuySKU, normalizeLaunchContext, parseTimeOverride, parseToSemver, postConversion, productDetail, registerAPITrafficObserver, registerPlatformAdapters, registerPurchaseAdapter, resolveLoopSource, selectSegment, setActiveNamiEntitlements, shouldValidateProductGroups, skuItems, skuMapFromEntitlements, storageService, toDouble, toNamiEntitlements, toNamiSKU, tryParseB64Gzip, tryParseJson, updateRelatedSKUsForNamiEntitlement, uuidFromSplitPosition, validateForm, validateMinSDKVersion, validateTextInput };
|
|
4433
|
+
export { ALREADY_CONFIGURED, ANONYMOUS_MODE, ANONYMOUS_MODE_ALREADY_OFF, ANONYMOUS_MODE_ALREADY_ON, ANONYMOUS_MODE_LOGIN_NOT_ALLOWED, ANONYMOUS_UUID, APIError, API_ACTIVE_ENTITLEMENTS, API_CAMPAIGN_RULES, API_CAMPAIGN_SESSION_TIMESTAMP, API_CONFIG, API_MAX_CALLS_LIMIT, API_PAYWALLS, API_PRODUCTS, API_RETRY_DELAY_SEC, API_TIMEOUT_LIMIT, API_TRAFFIC_OBSERVER, API_VERSION, AUTH_DEVICE, AVAILABLE_ACTIVE_ENTITLEMENTS_CHANGED, AVAILABLE_CAMPAIGNS_CHANGED, AccountStateAction, AnonymousCDPError, AnonymousLoginError, AnonymousModeAlreadyOffError, AnonymousModeAlreadyOnError, BASE_STAGING_URL, BASE_URL, BASE_URL_PATH, BadRequestError, BasicNamiFlow, BorderMap, BorderSideMap, CAMPAIGN_CACHE_TTL_PREFIX, CAMPAIGN_NOT_AVAILABLE, CONFIG_API_TIMEOUT_LIMIT, CONFIG_MAX_ATTEMPTS, CUSTOMER_ATTRIBUTES_KEY_PREFIX, CUSTOMER_JOURNEY_STATE_CHANGED, CUSTOM_HOST_PREFIX, CampaignNotAvailableError, CampaignRuleConversionEventType, CampaignRuleRepository, Capabilities, ClientError, ConfigRepository, ConflictError, CustomerJourneyRepository, DEFAULT_JOURNEY_SETTINGS, DEVELOPMENT, DEVICE_API_TIMEOUT_LIMIT, DEVICE_ID_NOT_SET, DEVICE_ID_REQUIRED, DISABLE_ASYNC_LOGIN_LOGOUT, DeviceIDRequiredError, DeviceRepository, EXTENDED_CLIENT_INFO_DELIMITER, EXTENDED_CLIENT_INFO_PREFIX, EXTENDED_PLATFORM, EXTENDED_PLATFORM_VERSION, EXTERNAL_ID_REQUIRED, EntitlementRepository, EntitlementUtils, ExternalIDRequiredError, FLOW_SCREENS_NOT_AVAILABLE, FlowScreensNotAvailableError, HTML_REGEX, INITIAL_APP_CONFIG, INITIAL_CAMPAIGN_RULES, INITIAL_PAYWALLS, INITIAL_PRODUCTS, INITIAL_SESSION_COUNTER_VALUE, INITIAL_SUCCESS, InternalServerError, KEY_SESSION_COUNTER, LIQUID_VARIABLE_REGEX, LOCAL_NAMI_ENTITLEMENTS, LOG_HTTP_REQUESTS, LOG_HTTP_TRAFFIC, LaunchCampaignError, LaunchContextResolver, LogLevel, NAMI_CONFIGURATION, NAMI_CUSTOMER_JOURNEY_STATE, NAMI_LANGUAGE_CODE, NAMI_LAST_IMPRESSION_ID, NAMI_LAUNCH_ID, NAMI_PROFILE, NAMI_PURCHASE_CHANNEL, NAMI_PURCHASE_IMPRESSION_ID, NAMI_SDK_PACKAGE_VERSION, NAMI_SDK_VERSION, NAMI_SESSION_ID, NAMI_STORAGE_KEYS, Nami, NamiAPI, NamiAnimationType, NamiCampaignManager$2 as NamiCampaignManager, NamiCampaignRuleType, NamiConditionEvaluator, NamiCustomerManager$2 as NamiCustomerManager, NamiEntitlementManager$2 as NamiEntitlementManager, NamiEventEmitter, NamiFlow, NamiFlowActionFunction, NamiFlowManager$1 as NamiFlowManager, NamiFlowStepType, NamiHandoffTag, NamiPaywallAction, NamiPaywallManager$2 as NamiPaywallManager, PaywallManagerEvents as NamiPaywallManagerEvents, NamiPermissionOutcome, NamiPurchaseManager$2 as NamiPurchaseManager, NamiRefs, NamiReservedActions, NotFoundError, PAYWALL_ACTION_EVENT, PLATFORM_ID_REQUIRED, PRODUCTION, PaywallManagerEvents, PaywallRepository, PaywallState, PlacementLabelResolver, PlatformIDRequiredError, ProductRepository, RECONFIG_SUCCESS, RESUME_THROTTLE_MS, RetryLimitExceededError, SDKNotInitializedError, SDK_NOT_INITIALIZED, SERVER_NAMI_ENTITLEMENTS, SESSION_REQUIRED, SHOULD_SHOW_LOADING_INDICATOR, SIMULATE_CONFIG_FETCH_FAILURE, SIMULATE_PAYWALL_FETCH_FAILURE, SKU_TEXT_REGEX, SMART_TEXT_PATTERN, STARTUP_TELEMETRY, STATUS_BAD_REQUEST, STATUS_CONFLICT, STATUS_INTERNAL_SERVER_ERROR, STATUS_NOT_FOUND, STATUS_SUCCESS, SYSTEM_TIME_FILTER_PREFIX, SYSTEM_TIME_TOKEN_PREFIX, SessionService, SimpleEventTarget, StorageService, TIME_OVERRIDE_PREFIX, TRANSPORT_FAILURE_STATUS, UNABLE_TO_UPDATE_CDP_ID, USE_STAGING_API, VALIDATE_PRODUCT_GROUPS, VAR_REGEX, NamiProfileManager$1 as _NamiProfileManager, internal as _internal, activateEntitlementByPurchase, activeEntitlements, aggregateScreenreaderText, allCampaigns, allPaywalls, applyEntitlementActivation, audienceSplitPosition, bestUrlCampaignMatch, bigintToUuid, checkAnySkuHasPromoOffer, checkAnySkuHasTrialOffer, convertISO8601PeriodToText, convertLocale, convertOfferToPricingPhase, createNamiEntitlements, currentSku, didReceiveResponse, empty, evaluateSystemTimeAssertion, evaluateSystemTimeCondition, extractStandardPricingPhases, formatDate, formattedPrice, generateUUID, getApiCampaigns, getApiPaywalls, getBaseUrl, getBillingPeriodNumber, getCurrencyFormat, getDeviceData, getDeviceFormFactor, getDeviceScaleFactor, getEffectiveWebStyle, getEntitlementRefIdsForSku, getExtendedClientInfo, getFreeTrialPeriod, getInitialCampaigns, getInitialPaywalls, getJourneySettings, getPaywall, getPaywallDataFromLabel, getPercentagePriceDifference, getPeriodNumberInDays, getPeriodNumberInWeeks, getPlatformAdapters, getPriceDifference, getPricePerMonth, getProductDetail, getPurchaseAdapter, getReferenceSku, getSkuProductDetailKeys, getSkuSmartTextValue, getSlideSmartTextValue, getStandardBillingPeriod, getSystemTimeNow, getTranslate, getUrlParams, handleErrors, hasAllPaywalls, hasCapability, hasPurchaseManagement, initialState, invokeHandler, isAnonymousMode, isInitialConfigCompressed, isNamiFlowCampaign, isSubscription, isSystemTimeAssertion, isValidISODate, isValidUrl, logger, mapAnonymousCampaigns, namiBuySKU, normalizeLaunchContext, parseTimeOverride, parseToSemver, postConversion, productDetail, registerAPITrafficObserver, registerPlatformAdapters, registerPurchaseAdapter, resolveLoopSource, selectSegment, setActiveNamiEntitlements, shouldValidateProductGroups, skuItems, skuMapFromEntitlements, storageService, toDouble, toNamiEntitlements, toNamiSKU, tryParseB64Gzip, tryParseJson, updateRelatedSKUsForNamiEntitlement, uuidFromSplitPosition, validateForm, validateMinSDKVersion, validateTextInput };
|
|
4432
4434
|
export type { AccountStateHandler$1 as AccountStateHandler, AlignmentType, AmazonProduct, ApiResponse, AppleProduct, AvailableCampaignsResponseHandler, BorderLocationType, BorderSideType, Callback$1 as Callback, CloseHandler, CustomerJourneyState, DeepLinkUrlHandler, Device, DevicePayload, DeviceProfile, DirectionType, ExtendedPlatformInfo, FlexDirectionObject, FlowNavigationOptions, FontCollection, FontDetails, FormFactor, FormFieldValidator, GoogleProduct, IConfig, IDeviceAdapter, IEntitlements$1 as IEntitlements, IPaywall, IPlatformAdapters, IProductsWithComponents, IPurchaseAdapter, ISkuMenu, IStorageAdapter, IUIAdapter, Impression, InitialConfig, InitialConfigCompressed, InitiateStateGroup, JourneySettings, LoginResponse, NamiAPITrafficKind, NamiAPITrafficObserver, NamiAPITrafficRecord, NamiAnimation, NamiAnimationObjectSpec, NamiAnimationSpec, NamiAnonymousCampaign, NamiAppSuppliedVideoDetails, NamiCampaign, NamiCampaignManagerStatic, NamiCampaignSegment, NamiCompletionResult, NamiConfiguration, NamiConfigurationState, NamiCustomAttributeValue, NamiCustomerManagerStatic, NamiEntitlement$1 as NamiEntitlement, NamiEntitlementManagerStatic, NamiFlowAction, NamiFlowAnimation, NamiFlowCampaign, NamiFlowCompletionCondition, NamiFlowDTO, NamiFlowEventHandler, NamiFlowHandoffStepHandler, NamiFlowManagerStatic, NamiFlowObjectDTO, NamiFlowOn, NamiFlowStep, NamiFlowTransition, NamiFlowTransitionDirection, NamiFlowWithObject, NamiHandoffAttributeValue, NamiHandoffComplete, NamiHandoffOutcome, NamiHandoffTagValue, NamiInitialConfig, NamiKnownHandoffTag, NamiLanguageCodes, NamiLogLevel, NamiLoginSuccess, NamiPaywallActionHandler, NamiPaywallComponentChange, NamiPaywallEvent, NamiPaywallEventVideoMetadata, NamiPaywallLaunchContext, NamiPaywallManagerStatic, NamiPresentationStyle, NamiProductDetails, NamiProductOffer, NamiProfile, NamiPurchase, NamiPurchaseCompleteResult, NamiPurchaseDetails, NamiPurchaseManagerStatic, NamiPurchaseSuccess, NamiPurchasesState, NamiSKU, NamiSKUType, NamiSubscriptionInterval, NamiSubscriptionPeriod, NamiUserDataEnvelope, None, NoneSpec, PaywallActionEvent, PaywallHandle, PaywallResultHandler, PaywallSKU, PricingPhase, ProductGroup, Pulse, PulseSpec, PurchaseContext, PurchaseResult, PurchaseValidationRequest, SKU, SKUActionHandler, ScreenInfo, Session, TBaseComponent, TButtonContainer, TCarouselContainer, TCarouselSlide, TCarouselSlidesState, TCollapseContainer, TComponent, TConditionalAttributes, TConditionalComponent, TContainer, TContainerPosition, TCountdownTimerTextComponent, TDevice, TDisabledButton, TField, TFieldSettings, TFlexProductContainer, THeaderFooter, TImageComponent, TInitialState, TMediaTypes, TOffer, TPages, TPaywallContext, TPaywallLaunchContext, TPaywallMedia, TPaywallTemplate, TPlayPauseButton, TProductContainer, TProductGroup, TProgressBarComponent, TProgressIndicatorComponent, TQRCodeComponent, TRadioButton, TRepeatingGrid, TResponsiveGrid, TSegmentPicker, TSegmentPickerItem, TSemverObj, TSlot, TSlotGroupSelector, TSpacerComponent, TStack, TSvgImageComponent, TSymbolComponent, TTestObject, TTextComponent, TTextInputComponent, TTextInputType, TTextLikeComponent, TTextListComponent, TTimelineRail, TToggleButtonComponent, TToggleSwitch, TVariablePattern, TVideoComponent, TVolumeButton, TimerState, TransactionRequest, UserAction, UserActionParameters, Wave, WaveSpec };
|
package/dist/index.mjs
CHANGED
|
@@ -104,7 +104,7 @@ const {
|
|
|
104
104
|
// version — stamped by scripts/version.sh
|
|
105
105
|
NAMI_SDK_VERSION = "3.5.0",
|
|
106
106
|
// full package version including dev suffix — stamped by scripts/version.sh
|
|
107
|
-
NAMI_SDK_PACKAGE_VERSION = "3.5.0-dev.
|
|
107
|
+
NAMI_SDK_PACKAGE_VERSION = "3.5.0-dev.202610190348",
|
|
108
108
|
// environments
|
|
109
109
|
PRODUCTION = "production", DEVELOPMENT = "development",
|
|
110
110
|
// error messages
|
|
@@ -128,7 +128,9 @@ CAMPAIGN_CACHE_TTL_PREFIX = "campaignCacheTTL=",
|
|
|
128
128
|
// and the builder preview can evaluate time conditions at any moment (NAM-4635).
|
|
129
129
|
TIME_OVERRIDE_PREFIX = "timeOverride=",
|
|
130
130
|
// Page condition values that resolve against the per-presentation time snapshot (NAM-4635).
|
|
131
|
-
SYSTEM_TIME_TOKEN_PREFIX = "${system.time.",
|
|
131
|
+
SYSTEM_TIME_TOKEN_PREFIX = "${system.time.",
|
|
132
|
+
// Flow branch-condition identifiers that the condition evaluator handles itself, read live (NAM-5226).
|
|
133
|
+
SYSTEM_TIME_FILTER_PREFIX = "System.time.", EXTENDED_PLATFORM = "extended-platform", EXTENDED_PLATFORM_VERSION = "extended-platform-version", API_MAX_CALLS_LIMIT = 2, API_RETRY_DELAY_SEC = 2, API_TIMEOUT_LIMIT = 20000, DEVICE_API_TIMEOUT_LIMIT = 2000,
|
|
132
134
|
// Platform-config attempts when no initial config was supplied (Android's
|
|
133
135
|
// CONFIG_MAX_ATTEMPTS; Apple's retry(maxAttempts: 3)).
|
|
134
136
|
CONFIG_MAX_ATTEMPTS = 3,
|
|
@@ -61327,6 +61329,10 @@ const isSystemTimeAssertion = (assertion) => typeof assertion.value === "string"
|
|
|
61327
61329
|
const parseInstant = (value) => {
|
|
61328
61330
|
if (typeof value !== "string" || !INSTANT.test(value))
|
|
61329
61331
|
return null;
|
|
61332
|
+
// `Date` rolls an impossible day over (2026-02-30 → March 2) instead of rejecting it.
|
|
61333
|
+
const [year, month, day] = value.slice(0, 10).split("-").map(Number);
|
|
61334
|
+
if (day > new Date(Date.UTC(year, month, 0)).getUTCDate())
|
|
61335
|
+
return null;
|
|
61330
61336
|
const date = new Date(value);
|
|
61331
61337
|
return Number.isNaN(date.getTime()) ? null : date;
|
|
61332
61338
|
};
|
|
@@ -61427,11 +61433,84 @@ const evaluateSystemTimeAssertion = (assertion, now) => {
|
|
|
61427
61433
|
return false;
|
|
61428
61434
|
}
|
|
61429
61435
|
};
|
|
61436
|
+
// Flow branch conditions use the engine's operator names; they compare the same way as Pages'.
|
|
61437
|
+
const FLOW_ORDERING = {
|
|
61438
|
+
equals: ORDERING.equals,
|
|
61439
|
+
greater_than: ORDERING.gt,
|
|
61440
|
+
greater_than_or_equal_to: ORDERING.gte,
|
|
61441
|
+
less_than: ORDERING.lt,
|
|
61442
|
+
less_than_or_equal_to: ORDERING.lte,
|
|
61443
|
+
};
|
|
61444
|
+
const flowComparison = (operator) => Object.prototype.hasOwnProperty.call(FLOW_ORDERING, operator) ? FLOW_ORDERING[operator] : null;
|
|
61445
|
+
/** True when a Flow filter identifier is `System.time.<leaf>` (any leaf; unknown leaves evaluate `false`). */
|
|
61446
|
+
const isSystemTimeFilter = (identifier) => typeof identifier === "string" && identifier.startsWith(SYSTEM_TIME_FILTER_PREFIX);
|
|
61447
|
+
/** Every element parsed by `parse`, or `null` when `values` is empty or any element is invalid. */
|
|
61448
|
+
const parseAll = (values, parse) => {
|
|
61449
|
+
if (!Array.isArray(values) || values.length === 0)
|
|
61450
|
+
return null;
|
|
61451
|
+
const parsed = [];
|
|
61452
|
+
for (const value of values) {
|
|
61453
|
+
const item = typeof value === "string" ? parse(value) : null;
|
|
61454
|
+
if (item === null)
|
|
61455
|
+
return null;
|
|
61456
|
+
parsed.push(item);
|
|
61457
|
+
}
|
|
61458
|
+
return parsed;
|
|
61459
|
+
};
|
|
61460
|
+
const parseZonedTime = (value) => {
|
|
61461
|
+
const zoned = splitZoned(value);
|
|
61462
|
+
const match = zoned && TIME_OF_DAY.exec(zoned.value);
|
|
61463
|
+
return zoned && match ? { minutes: Number(match[1]) * 60 + Number(match[2]), zone: zoned.zone } : null;
|
|
61464
|
+
};
|
|
61465
|
+
/**
|
|
61466
|
+
* Evaluates a Flow branch filter on `System.time.*` (the "Flow branch conditions" section of
|
|
61467
|
+
* `shared/time_conditions/README.md`, verified against `flow_vectors.json`). Every value is
|
|
61468
|
+
* validated before anything is compared, so an invalid value is `false` for every operator,
|
|
61469
|
+
* `not_equals` included. Several values match when any one does; `not_equals` when none does.
|
|
61470
|
+
*/
|
|
61471
|
+
const evaluateSystemTimeFilter = (filter, now) => {
|
|
61472
|
+
if (!isSystemTimeFilter(filter.identifier) || Number.isNaN(now.getTime()))
|
|
61473
|
+
return false;
|
|
61474
|
+
switch (filter.identifier.slice(SYSTEM_TIME_FILTER_PREFIX.length)) {
|
|
61475
|
+
case "dayOfWeek": {
|
|
61476
|
+
if (filter.operator !== "equals" && filter.operator !== "not_equals")
|
|
61477
|
+
return false;
|
|
61478
|
+
const days = parseAll(filter.values, parseDay);
|
|
61479
|
+
if (!days)
|
|
61480
|
+
return false;
|
|
61481
|
+
const projected = days.map(({ zone }) => projectInZone(now, zone));
|
|
61482
|
+
if (projected.some((p) => p === null))
|
|
61483
|
+
return false;
|
|
61484
|
+
const matched = days.some(({ day }, i) => projected[i].dayOfWeek === day);
|
|
61485
|
+
return filter.operator === "equals" ? matched : !matched;
|
|
61486
|
+
}
|
|
61487
|
+
case "timeOfDay": {
|
|
61488
|
+
const compare = flowComparison(filter.operator);
|
|
61489
|
+
const times = compare ? parseAll(filter.values, parseZonedTime) : null;
|
|
61490
|
+
if (!compare || !times)
|
|
61491
|
+
return false;
|
|
61492
|
+
const projected = times.map(({ zone }) => projectInZone(now, zone));
|
|
61493
|
+
if (projected.some((p) => p === null))
|
|
61494
|
+
return false;
|
|
61495
|
+
return times.some(({ minutes }, i) => compare(projected[i].minutes, minutes));
|
|
61496
|
+
}
|
|
61497
|
+
case "now": {
|
|
61498
|
+
const compare = flowComparison(filter.operator);
|
|
61499
|
+
const instants = compare ? parseAll(filter.values, parseInstant) : null;
|
|
61500
|
+
if (!compare || !instants)
|
|
61501
|
+
return false;
|
|
61502
|
+
return instants.some((instant) => compare(now.getTime(), instant.getTime()));
|
|
61503
|
+
}
|
|
61504
|
+
default:
|
|
61505
|
+
return false;
|
|
61506
|
+
}
|
|
61507
|
+
};
|
|
61430
61508
|
/** Parses a `timeOverride=<ISO-8601 with offset>` namiCommand; `null` when it is not a valid one. */
|
|
61431
61509
|
const parseTimeOverride = (command) => command.startsWith(TIME_OVERRIDE_PREFIX) ? parseInstant(command.slice(TIME_OVERRIDE_PREFIX.length)) : null;
|
|
61432
61510
|
/**
|
|
61433
61511
|
* The instant to snapshot for a Page or flow-screen presentation: the `timeOverride=` namiCommand
|
|
61434
|
-
* when present and valid, otherwise the device clock. Call it once per presentation.
|
|
61512
|
+
* when present and valid, otherwise the device clock. Call it once per presentation. Flow branch
|
|
61513
|
+
* conditions call it once per condition block instead, so they see the time live.
|
|
61435
61514
|
*/
|
|
61436
61515
|
const getSystemTimeNow = () => {
|
|
61437
61516
|
const command = storageService
|
|
@@ -63127,6 +63206,15 @@ function toComparableNumber(value) {
|
|
|
63127
63206
|
}
|
|
63128
63207
|
return null;
|
|
63129
63208
|
}
|
|
63209
|
+
/**
|
|
63210
|
+
* The instant for one condition block: read on first use, then shared by every filter in the
|
|
63211
|
+
* block, so ANDed `System.time` filters see the same moment. Each block reads the clock afresh —
|
|
63212
|
+
* Flow branch conditions are live, never a snapshot from flow start (NAM-5226).
|
|
63213
|
+
*/
|
|
63214
|
+
function blockClock() {
|
|
63215
|
+
let now;
|
|
63216
|
+
return () => (now ??= getSystemTimeNow());
|
|
63217
|
+
}
|
|
63130
63218
|
class NamiConditionEvaluator {
|
|
63131
63219
|
constructor() {
|
|
63132
63220
|
this.resolvers = new Map();
|
|
@@ -63149,7 +63237,8 @@ class NamiConditionEvaluator {
|
|
|
63149
63237
|
if (filters.length === 0) {
|
|
63150
63238
|
return true;
|
|
63151
63239
|
}
|
|
63152
|
-
const
|
|
63240
|
+
const now = blockClock();
|
|
63241
|
+
const results = filters.map(filter => this.evaluateFilter(filter, now));
|
|
63153
63242
|
switch (conditions.operator) {
|
|
63154
63243
|
case LogicalOperator.AND:
|
|
63155
63244
|
return results.every(result => result);
|
|
@@ -63168,17 +63257,18 @@ class NamiConditionEvaluator {
|
|
|
63168
63257
|
if (filters.length === 0) {
|
|
63169
63258
|
return true;
|
|
63170
63259
|
}
|
|
63260
|
+
const now = blockClock();
|
|
63171
63261
|
switch (conditions.operator) {
|
|
63172
63262
|
case LogicalOperator.AND:
|
|
63173
63263
|
for (const filter of filters) {
|
|
63174
|
-
if (!this.evaluateFilter(filter)) {
|
|
63264
|
+
if (!this.evaluateFilter(filter, now)) {
|
|
63175
63265
|
return false;
|
|
63176
63266
|
}
|
|
63177
63267
|
}
|
|
63178
63268
|
return true;
|
|
63179
63269
|
case LogicalOperator.OR:
|
|
63180
63270
|
for (const filter of filters) {
|
|
63181
|
-
if (this.evaluateFilter(filter)) {
|
|
63271
|
+
if (this.evaluateFilter(filter, now)) {
|
|
63182
63272
|
return true;
|
|
63183
63273
|
}
|
|
63184
63274
|
}
|
|
@@ -63186,14 +63276,19 @@ class NamiConditionEvaluator {
|
|
|
63186
63276
|
case LogicalOperator.NONE:
|
|
63187
63277
|
default:
|
|
63188
63278
|
for (const filter of filters) {
|
|
63189
|
-
if (!this.evaluateFilter(filter)) {
|
|
63279
|
+
if (!this.evaluateFilter(filter, now)) {
|
|
63190
63280
|
return false;
|
|
63191
63281
|
}
|
|
63192
63282
|
}
|
|
63193
63283
|
return true;
|
|
63194
63284
|
}
|
|
63195
63285
|
}
|
|
63196
|
-
evaluateFilter(filter) {
|
|
63286
|
+
evaluateFilter(filter, now = blockClock()) {
|
|
63287
|
+
// System.time.* is evaluated here, ahead of the resolvers and the unresolved-value rule below,
|
|
63288
|
+
// which would otherwise make not_equals true for a field no resolver knows.
|
|
63289
|
+
if (isSystemTimeFilter(filter.identifier)) {
|
|
63290
|
+
return evaluateSystemTimeFilter(filter, now());
|
|
63291
|
+
}
|
|
63197
63292
|
const resolvedValue = this.resolve(filter.identifier);
|
|
63198
63293
|
if (Nami.instance.maxLogging) {
|
|
63199
63294
|
logger.debug(`[NamiConditionEvaluator] resolve(${filter.identifier}) → ${JSON.stringify(resolvedValue)} (type: ${typeof resolvedValue})`);
|
|
@@ -66901,4 +66996,4 @@ var internal = /*#__PURE__*/Object.freeze({
|
|
|
66901
66996
|
NamiPurchaseManager: NamiPurchaseManager
|
|
66902
66997
|
});
|
|
66903
66998
|
|
|
66904
|
-
export { ALREADY_CONFIGURED, ANONYMOUS_MODE, ANONYMOUS_MODE_ALREADY_OFF, ANONYMOUS_MODE_ALREADY_ON, ANONYMOUS_MODE_LOGIN_NOT_ALLOWED, ANONYMOUS_UUID, APIError, API_ACTIVE_ENTITLEMENTS, API_CAMPAIGN_RULES, API_CAMPAIGN_SESSION_TIMESTAMP, API_CONFIG, API_MAX_CALLS_LIMIT, API_PAYWALLS, API_PRODUCTS, API_RETRY_DELAY_SEC, API_TIMEOUT_LIMIT, API_TRAFFIC_OBSERVER, API_VERSION, AUTH_DEVICE, AVAILABLE_ACTIVE_ENTITLEMENTS_CHANGED, AVAILABLE_CAMPAIGNS_CHANGED, AccountStateAction, AnonymousCDPError, AnonymousLoginError, AnonymousModeAlreadyOffError, AnonymousModeAlreadyOnError, BASE_STAGING_URL, BASE_URL, BASE_URL_PATH, BadRequestError, BasicNamiFlow, BorderMap, BorderSideMap, CAMPAIGN_CACHE_TTL_PREFIX, CAMPAIGN_NOT_AVAILABLE, CONFIG_API_TIMEOUT_LIMIT, CONFIG_MAX_ATTEMPTS, CUSTOMER_ATTRIBUTES_KEY_PREFIX, CUSTOMER_JOURNEY_STATE_CHANGED, CUSTOM_HOST_PREFIX, CampaignNotAvailableError, CampaignRuleConversionEventType, CampaignRuleRepository, Capabilities, ClientError, ConfigRepository, ConflictError, CustomerJourneyRepository, DEFAULT_JOURNEY_SETTINGS, DEVELOPMENT, DEVICE_API_TIMEOUT_LIMIT, DEVICE_ID_NOT_SET, DEVICE_ID_REQUIRED, DISABLE_ASYNC_LOGIN_LOGOUT, DeviceIDRequiredError, DeviceRepository, EXTENDED_CLIENT_INFO_DELIMITER, EXTENDED_CLIENT_INFO_PREFIX, EXTENDED_PLATFORM, EXTENDED_PLATFORM_VERSION, EXTERNAL_ID_REQUIRED, EntitlementRepository, EntitlementUtils, ExternalIDRequiredError, FLOW_SCREENS_NOT_AVAILABLE, FlowScreensNotAvailableError, HTML_REGEX, INITIAL_APP_CONFIG, INITIAL_CAMPAIGN_RULES, INITIAL_PAYWALLS, INITIAL_PRODUCTS, INITIAL_SESSION_COUNTER_VALUE, INITIAL_SUCCESS, InternalServerError, KEY_SESSION_COUNTER, LIQUID_VARIABLE_REGEX, LOCAL_NAMI_ENTITLEMENTS, LOG_HTTP_REQUESTS, LOG_HTTP_TRAFFIC, LaunchCampaignError, LaunchContextResolver, LogLevel, NAMI_CONFIGURATION, NAMI_CUSTOMER_JOURNEY_STATE, NAMI_LANGUAGE_CODE, NAMI_LAST_IMPRESSION_ID, NAMI_LAUNCH_ID, NAMI_PROFILE, NAMI_PURCHASE_CHANNEL, NAMI_PURCHASE_IMPRESSION_ID, NAMI_SDK_PACKAGE_VERSION, NAMI_SDK_VERSION, NAMI_SESSION_ID, NAMI_STORAGE_KEYS, Nami, NamiAPI, NamiAnimationType, NamiCampaignManager$1 as NamiCampaignManager, NamiCampaignRuleType, NamiConditionEvaluator, NamiCustomerManager$1 as NamiCustomerManager, NamiEntitlementManager$1 as NamiEntitlementManager, NamiEventEmitter, NamiFlow, NamiFlowActionFunction, NamiFlowManager$1 as NamiFlowManager, NamiFlowStepType, NamiHandoffTag, NamiPaywallAction, NamiPaywallManager$1 as NamiPaywallManager, PaywallManagerEvents as NamiPaywallManagerEvents, NamiPermissionOutcome, NamiPurchaseManager$1 as NamiPurchaseManager, NamiRefs, NamiReservedActions, NotFoundError, PAYWALL_ACTION_EVENT, PLATFORM_ID_REQUIRED, PRODUCTION, PaywallManagerEvents, PaywallRepository, PaywallState, PlacementLabelResolver, PlatformIDRequiredError, ProductRepository, RECONFIG_SUCCESS, RESUME_THROTTLE_MS, RetryLimitExceededError, SDKNotInitializedError, SDK_NOT_INITIALIZED, SERVER_NAMI_ENTITLEMENTS, SESSION_REQUIRED, SHOULD_SHOW_LOADING_INDICATOR, SIMULATE_CONFIG_FETCH_FAILURE, SIMULATE_PAYWALL_FETCH_FAILURE, SKU_TEXT_REGEX, SMART_TEXT_PATTERN, STARTUP_TELEMETRY, STATUS_BAD_REQUEST, STATUS_CONFLICT, STATUS_INTERNAL_SERVER_ERROR, STATUS_NOT_FOUND, STATUS_SUCCESS, SYSTEM_TIME_TOKEN_PREFIX, SessionService, SimpleEventTarget, StorageService, TIME_OVERRIDE_PREFIX, TRANSPORT_FAILURE_STATUS, UNABLE_TO_UPDATE_CDP_ID, USE_STAGING_API, VALIDATE_PRODUCT_GROUPS, VAR_REGEX, NamiProfileManager$1 as _NamiProfileManager, internal as _internal, activateEntitlementByPurchase, activeEntitlements, aggregateScreenreaderText, allCampaigns, allPaywalls, applyEntitlementActivation, audienceSplitPosition, bestUrlCampaignMatch, bigintToUuid, checkAnySkuHasPromoOffer, checkAnySkuHasTrialOffer, convertISO8601PeriodToText, convertLocale, convertOfferToPricingPhase, createNamiEntitlements, currentSku, didReceiveResponse, empty, evaluateSystemTimeAssertion, evaluateSystemTimeCondition, extractStandardPricingPhases, formatDate, formattedPrice, generateUUID, getApiCampaigns, getApiPaywalls, getBaseUrl, getBillingPeriodNumber, getCurrencyFormat, getDeviceData, getDeviceFormFactor, getDeviceScaleFactor, getEffectiveWebStyle, getEntitlementRefIdsForSku, getExtendedClientInfo, getFreeTrialPeriod, getInitialCampaigns, getInitialPaywalls, getJourneySettings, getPaywall, getPaywallDataFromLabel, getPercentagePriceDifference, getPeriodNumberInDays, getPeriodNumberInWeeks, getPlatformAdapters, getPriceDifference, getPricePerMonth, getProductDetail, getPurchaseAdapter, getReferenceSku, getSkuProductDetailKeys, getSkuSmartTextValue, getSlideSmartTextValue, getStandardBillingPeriod, getSystemTimeNow, getTranslate, getUrlParams, handleErrors, hasAllPaywalls, hasCapability, hasPurchaseManagement, initialState, invokeHandler, isAnonymousMode, isInitialConfigCompressed, isNamiFlowCampaign, isSubscription, isSystemTimeAssertion, isValidISODate, isValidUrl, logger, mapAnonymousCampaigns, namiBuySKU, normalizeLaunchContext, parseTimeOverride, parseToSemver, postConversion, productDetail, registerAPITrafficObserver, registerPlatformAdapters, registerPurchaseAdapter, resolveLoopSource, selectSegment, setActiveNamiEntitlements, shouldValidateProductGroups, skuItems, skuMapFromEntitlements, storageService, toDouble, toNamiEntitlements, toNamiSKU, tryParseB64Gzip, tryParseJson, updateRelatedSKUsForNamiEntitlement, uuidFromSplitPosition, validateForm, validateMinSDKVersion, validateTextInput };
|
|
66999
|
+
export { ALREADY_CONFIGURED, ANONYMOUS_MODE, ANONYMOUS_MODE_ALREADY_OFF, ANONYMOUS_MODE_ALREADY_ON, ANONYMOUS_MODE_LOGIN_NOT_ALLOWED, ANONYMOUS_UUID, APIError, API_ACTIVE_ENTITLEMENTS, API_CAMPAIGN_RULES, API_CAMPAIGN_SESSION_TIMESTAMP, API_CONFIG, API_MAX_CALLS_LIMIT, API_PAYWALLS, API_PRODUCTS, API_RETRY_DELAY_SEC, API_TIMEOUT_LIMIT, API_TRAFFIC_OBSERVER, API_VERSION, AUTH_DEVICE, AVAILABLE_ACTIVE_ENTITLEMENTS_CHANGED, AVAILABLE_CAMPAIGNS_CHANGED, AccountStateAction, AnonymousCDPError, AnonymousLoginError, AnonymousModeAlreadyOffError, AnonymousModeAlreadyOnError, BASE_STAGING_URL, BASE_URL, BASE_URL_PATH, BadRequestError, BasicNamiFlow, BorderMap, BorderSideMap, CAMPAIGN_CACHE_TTL_PREFIX, CAMPAIGN_NOT_AVAILABLE, CONFIG_API_TIMEOUT_LIMIT, CONFIG_MAX_ATTEMPTS, CUSTOMER_ATTRIBUTES_KEY_PREFIX, CUSTOMER_JOURNEY_STATE_CHANGED, CUSTOM_HOST_PREFIX, CampaignNotAvailableError, CampaignRuleConversionEventType, CampaignRuleRepository, Capabilities, ClientError, ConfigRepository, ConflictError, CustomerJourneyRepository, DEFAULT_JOURNEY_SETTINGS, DEVELOPMENT, DEVICE_API_TIMEOUT_LIMIT, DEVICE_ID_NOT_SET, DEVICE_ID_REQUIRED, DISABLE_ASYNC_LOGIN_LOGOUT, DeviceIDRequiredError, DeviceRepository, EXTENDED_CLIENT_INFO_DELIMITER, EXTENDED_CLIENT_INFO_PREFIX, EXTENDED_PLATFORM, EXTENDED_PLATFORM_VERSION, EXTERNAL_ID_REQUIRED, EntitlementRepository, EntitlementUtils, ExternalIDRequiredError, FLOW_SCREENS_NOT_AVAILABLE, FlowScreensNotAvailableError, HTML_REGEX, INITIAL_APP_CONFIG, INITIAL_CAMPAIGN_RULES, INITIAL_PAYWALLS, INITIAL_PRODUCTS, INITIAL_SESSION_COUNTER_VALUE, INITIAL_SUCCESS, InternalServerError, KEY_SESSION_COUNTER, LIQUID_VARIABLE_REGEX, LOCAL_NAMI_ENTITLEMENTS, LOG_HTTP_REQUESTS, LOG_HTTP_TRAFFIC, LaunchCampaignError, LaunchContextResolver, LogLevel, NAMI_CONFIGURATION, NAMI_CUSTOMER_JOURNEY_STATE, NAMI_LANGUAGE_CODE, NAMI_LAST_IMPRESSION_ID, NAMI_LAUNCH_ID, NAMI_PROFILE, NAMI_PURCHASE_CHANNEL, NAMI_PURCHASE_IMPRESSION_ID, NAMI_SDK_PACKAGE_VERSION, NAMI_SDK_VERSION, NAMI_SESSION_ID, NAMI_STORAGE_KEYS, Nami, NamiAPI, NamiAnimationType, NamiCampaignManager$1 as NamiCampaignManager, NamiCampaignRuleType, NamiConditionEvaluator, NamiCustomerManager$1 as NamiCustomerManager, NamiEntitlementManager$1 as NamiEntitlementManager, NamiEventEmitter, NamiFlow, NamiFlowActionFunction, NamiFlowManager$1 as NamiFlowManager, NamiFlowStepType, NamiHandoffTag, NamiPaywallAction, NamiPaywallManager$1 as NamiPaywallManager, PaywallManagerEvents as NamiPaywallManagerEvents, NamiPermissionOutcome, NamiPurchaseManager$1 as NamiPurchaseManager, NamiRefs, NamiReservedActions, NotFoundError, PAYWALL_ACTION_EVENT, PLATFORM_ID_REQUIRED, PRODUCTION, PaywallManagerEvents, PaywallRepository, PaywallState, PlacementLabelResolver, PlatformIDRequiredError, ProductRepository, RECONFIG_SUCCESS, RESUME_THROTTLE_MS, RetryLimitExceededError, SDKNotInitializedError, SDK_NOT_INITIALIZED, SERVER_NAMI_ENTITLEMENTS, SESSION_REQUIRED, SHOULD_SHOW_LOADING_INDICATOR, SIMULATE_CONFIG_FETCH_FAILURE, SIMULATE_PAYWALL_FETCH_FAILURE, SKU_TEXT_REGEX, SMART_TEXT_PATTERN, STARTUP_TELEMETRY, STATUS_BAD_REQUEST, STATUS_CONFLICT, STATUS_INTERNAL_SERVER_ERROR, STATUS_NOT_FOUND, STATUS_SUCCESS, SYSTEM_TIME_FILTER_PREFIX, SYSTEM_TIME_TOKEN_PREFIX, SessionService, SimpleEventTarget, StorageService, TIME_OVERRIDE_PREFIX, TRANSPORT_FAILURE_STATUS, UNABLE_TO_UPDATE_CDP_ID, USE_STAGING_API, VALIDATE_PRODUCT_GROUPS, VAR_REGEX, NamiProfileManager$1 as _NamiProfileManager, internal as _internal, activateEntitlementByPurchase, activeEntitlements, aggregateScreenreaderText, allCampaigns, allPaywalls, applyEntitlementActivation, audienceSplitPosition, bestUrlCampaignMatch, bigintToUuid, checkAnySkuHasPromoOffer, checkAnySkuHasTrialOffer, convertISO8601PeriodToText, convertLocale, convertOfferToPricingPhase, createNamiEntitlements, currentSku, didReceiveResponse, empty, evaluateSystemTimeAssertion, evaluateSystemTimeCondition, extractStandardPricingPhases, formatDate, formattedPrice, generateUUID, getApiCampaigns, getApiPaywalls, getBaseUrl, getBillingPeriodNumber, getCurrencyFormat, getDeviceData, getDeviceFormFactor, getDeviceScaleFactor, getEffectiveWebStyle, getEntitlementRefIdsForSku, getExtendedClientInfo, getFreeTrialPeriod, getInitialCampaigns, getInitialPaywalls, getJourneySettings, getPaywall, getPaywallDataFromLabel, getPercentagePriceDifference, getPeriodNumberInDays, getPeriodNumberInWeeks, getPlatformAdapters, getPriceDifference, getPricePerMonth, getProductDetail, getPurchaseAdapter, getReferenceSku, getSkuProductDetailKeys, getSkuSmartTextValue, getSlideSmartTextValue, getStandardBillingPeriod, getSystemTimeNow, getTranslate, getUrlParams, handleErrors, hasAllPaywalls, hasCapability, hasPurchaseManagement, initialState, invokeHandler, isAnonymousMode, isInitialConfigCompressed, isNamiFlowCampaign, isSubscription, isSystemTimeAssertion, isValidISODate, isValidUrl, logger, mapAnonymousCampaigns, namiBuySKU, normalizeLaunchContext, parseTimeOverride, parseToSemver, postConversion, productDetail, registerAPITrafficObserver, registerPlatformAdapters, registerPurchaseAdapter, resolveLoopSource, selectSegment, setActiveNamiEntitlements, shouldValidateProductGroups, skuItems, skuMapFromEntitlements, storageService, toDouble, toNamiEntitlements, toNamiSKU, tryParseB64Gzip, tryParseJson, updateRelatedSKUsForNamiEntitlement, uuidFromSplitPosition, validateForm, validateMinSDKVersion, validateTextInput };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@namiml/sdk-core",
|
|
3
|
-
"version": "3.5.0-dev.
|
|
3
|
+
"version": "3.5.0-dev.202610190348",
|
|
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",
|