@namiml/sdk-core 3.4.0-dev.202605190929 → 3.4.0-dev.202605191719
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 +101 -14
- package/dist/index.d.ts +22 -1
- package/dist/index.mjs +101 -15
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -98,7 +98,7 @@ const {
|
|
|
98
98
|
// version — stamped by scripts/version.sh
|
|
99
99
|
NAMI_SDK_VERSION: exports.NAMI_SDK_VERSION = "3.4.0",
|
|
100
100
|
// full package version including dev suffix — stamped by scripts/version.sh
|
|
101
|
-
NAMI_SDK_PACKAGE_VERSION: exports.NAMI_SDK_PACKAGE_VERSION = "3.4.0-dev.
|
|
101
|
+
NAMI_SDK_PACKAGE_VERSION: exports.NAMI_SDK_PACKAGE_VERSION = "3.4.0-dev.202605191719",
|
|
102
102
|
// environments
|
|
103
103
|
PRODUCTION: exports.PRODUCTION = "production", DEVELOPMENT: exports.DEVELOPMENT = "development",
|
|
104
104
|
// error messages
|
|
@@ -12995,21 +12995,46 @@ class NamiProfileManager {
|
|
|
12995
12995
|
}
|
|
12996
12996
|
PaywallState.setIsLoggedIn(!!this.externalId);
|
|
12997
12997
|
}
|
|
12998
|
-
|
|
12998
|
+
/**
|
|
12999
|
+
* Update local profile state for login: persist the external id and flip the
|
|
13000
|
+
* logged-in flag in PaywallState. No network I/O — pair with `loginRemote`
|
|
13001
|
+
* to perform the actual API call. Used by the async login/logout fast path.
|
|
13002
|
+
*/
|
|
13003
|
+
loginLocal(externalId) {
|
|
13004
|
+
this.setExternalId(externalId).save();
|
|
13005
|
+
PaywallState.setIsLoggedIn(true);
|
|
13006
|
+
}
|
|
13007
|
+
/**
|
|
13008
|
+
* Perform the login network call only. If the server returns a different
|
|
13009
|
+
* `external_id` than the locally stored value, reconcile it into local state.
|
|
13010
|
+
*/
|
|
13011
|
+
async loginRemote(externalId) {
|
|
12999
13012
|
const loginData = await NamiAPI.instance.login(externalId);
|
|
13000
|
-
if (loginData.external_id) {
|
|
13001
|
-
|
|
13013
|
+
if (loginData.external_id && loginData.external_id !== this.externalId) {
|
|
13014
|
+
this.setExternalId(loginData.external_id).save();
|
|
13002
13015
|
}
|
|
13003
|
-
this
|
|
13004
|
-
.setExternalId(loginData.external_id)
|
|
13005
|
-
.save();
|
|
13006
13016
|
}
|
|
13007
|
-
|
|
13008
|
-
|
|
13017
|
+
/**
|
|
13018
|
+
* Update local profile state for logout: clear the external id, persist,
|
|
13019
|
+
* and flip the logged-in flag in PaywallState. Used by the async fast path.
|
|
13020
|
+
*/
|
|
13021
|
+
logoutLocal() {
|
|
13022
|
+
this.setExternalId(undefined).save();
|
|
13009
13023
|
PaywallState.setIsLoggedIn(false);
|
|
13010
|
-
|
|
13011
|
-
|
|
13012
|
-
|
|
13024
|
+
}
|
|
13025
|
+
/**
|
|
13026
|
+
* Perform the logout network call only.
|
|
13027
|
+
*/
|
|
13028
|
+
async logoutRemote() {
|
|
13029
|
+
await NamiAPI.instance.logout();
|
|
13030
|
+
}
|
|
13031
|
+
async login(externalId) {
|
|
13032
|
+
this.loginLocal(externalId);
|
|
13033
|
+
await this.loginRemote(externalId);
|
|
13034
|
+
}
|
|
13035
|
+
async logout() {
|
|
13036
|
+
this.logoutLocal();
|
|
13037
|
+
await this.logoutRemote();
|
|
13013
13038
|
}
|
|
13014
13039
|
}
|
|
13015
13040
|
NamiProfileManager.instance = new NamiProfileManager();
|
|
@@ -13329,6 +13354,21 @@ class NamiFlowManager {
|
|
|
13329
13354
|
}
|
|
13330
13355
|
}
|
|
13331
13356
|
|
|
13357
|
+
const SHOULD_SHOW_LOADING_INDICATOR = false;
|
|
13358
|
+
const DISABLE_ASYNC_LOGIN_LOGOUT = "disableAsyncLoginLogout";
|
|
13359
|
+
/**
|
|
13360
|
+
* Returns true when `disableAsyncLoginLogout` appears in the active `namiCommands` list,
|
|
13361
|
+
* meaning login/logout should await the underlying API call before notifying handlers.
|
|
13362
|
+
*
|
|
13363
|
+
* Default behavior (flag absent) is the async/fast path: update local state and notify
|
|
13364
|
+
* handlers immediately while dispatching the API call as fire-and-forget.
|
|
13365
|
+
*
|
|
13366
|
+
* Internal feature flag — opt-out via `Nami.configure({ namiCommands: [...] })`.
|
|
13367
|
+
*/
|
|
13368
|
+
const isAsyncLoginLogoutDisabled = () => {
|
|
13369
|
+
return storageService.getNamiConfig()?.namiCommands?.includes(DISABLE_ASYNC_LOGIN_LOGOUT) ?? false;
|
|
13370
|
+
};
|
|
13371
|
+
|
|
13332
13372
|
/**
|
|
13333
13373
|
* @class NamiCustomerManager
|
|
13334
13374
|
* Provides methods for managing customer-related functionality.
|
|
@@ -13390,6 +13430,30 @@ class NamiCustomerManager {
|
|
|
13390
13430
|
this.invokeStateHandler(exports.AccountStateAction.LOGIN, false, error);
|
|
13391
13431
|
throw error;
|
|
13392
13432
|
}
|
|
13433
|
+
if (!isAsyncLoginLogoutDisabled()) {
|
|
13434
|
+
// Default sync/fast path: update local state, notify handlers, and fire
|
|
13435
|
+
// lifecycle immediately. Dispatch the underlying API call and entitlement
|
|
13436
|
+
// refresh fire-and-forget — failures are logged but do not surface.
|
|
13437
|
+
NamiProfileManager.instance.loginLocal(externalId);
|
|
13438
|
+
this.invokeStateHandler(exports.AccountStateAction.LOGIN, true);
|
|
13439
|
+
if (NamiFlowManager.instance.flowOpen) {
|
|
13440
|
+
const currentFlow = NamiFlowManager.instance.currentFlow;
|
|
13441
|
+
const currentStep = currentFlow?.currentFlowStep;
|
|
13442
|
+
if (currentStep) {
|
|
13443
|
+
if (Nami.instance.maxLogging) {
|
|
13444
|
+
logger.debug(`[NamiCustomerManager] async login success — triggering __login_success__ on step ${currentStep.id}`);
|
|
13445
|
+
}
|
|
13446
|
+
currentFlow.executeLifecycle(currentStep, NamiReservedActions.LOGIN_SUCCESS);
|
|
13447
|
+
}
|
|
13448
|
+
}
|
|
13449
|
+
void NamiProfileManager.instance.loginRemote(externalId).catch((err) => {
|
|
13450
|
+
logger.error('[NamiCustomerManager] async login API failed', err);
|
|
13451
|
+
});
|
|
13452
|
+
void EntitlementRepository.instance.fetchActiveEntitlements().catch((err) => {
|
|
13453
|
+
logger.error('[NamiCustomerManager] async login entitlement refresh failed', err);
|
|
13454
|
+
});
|
|
13455
|
+
return;
|
|
13456
|
+
}
|
|
13393
13457
|
try {
|
|
13394
13458
|
await NamiProfileManager.instance.login(externalId);
|
|
13395
13459
|
await EntitlementRepository.instance.fetchActiveEntitlements();
|
|
@@ -13435,6 +13499,30 @@ class NamiCustomerManager {
|
|
|
13435
13499
|
this.invokeStateHandler(exports.AccountStateAction.LOGOUT, false, error);
|
|
13436
13500
|
throw error;
|
|
13437
13501
|
}
|
|
13502
|
+
if (!isAsyncLoginLogoutDisabled()) {
|
|
13503
|
+
// Default sync/fast path: clear local state, notify handlers, and fire
|
|
13504
|
+
// lifecycle immediately. Dispatch the underlying API call and entitlement
|
|
13505
|
+
// refresh fire-and-forget — failures are logged but do not surface.
|
|
13506
|
+
NamiProfileManager.instance.logoutLocal();
|
|
13507
|
+
this.invokeStateHandler(exports.AccountStateAction.LOGOUT, true);
|
|
13508
|
+
if (NamiFlowManager.instance.flowOpen) {
|
|
13509
|
+
const currentFlow = NamiFlowManager.instance.currentFlow;
|
|
13510
|
+
const currentStep = currentFlow?.currentFlowStep;
|
|
13511
|
+
if (currentStep) {
|
|
13512
|
+
if (Nami.instance.maxLogging) {
|
|
13513
|
+
logger.debug(`[NamiCustomerManager] async logout success — triggering __logout_success__ on step ${currentStep.id}`);
|
|
13514
|
+
}
|
|
13515
|
+
currentFlow.executeLifecycle(currentStep, NamiReservedActions.LOGOUT_SUCCESS);
|
|
13516
|
+
}
|
|
13517
|
+
}
|
|
13518
|
+
void NamiProfileManager.instance.logoutRemote().catch((err) => {
|
|
13519
|
+
logger.error('[NamiCustomerManager] async logout API failed', err);
|
|
13520
|
+
});
|
|
13521
|
+
void EntitlementRepository.instance.fetchActiveEntitlements().catch((err) => {
|
|
13522
|
+
logger.error('[NamiCustomerManager] async logout entitlement refresh failed', err);
|
|
13523
|
+
});
|
|
13524
|
+
return;
|
|
13525
|
+
}
|
|
13438
13526
|
try {
|
|
13439
13527
|
await NamiProfileManager.instance.logout();
|
|
13440
13528
|
await EntitlementRepository.instance.fetchActiveEntitlements();
|
|
@@ -14869,8 +14957,6 @@ exports.CampaignRuleConversionEventType = void 0;
|
|
|
14869
14957
|
CampaignRuleConversionEventType["IN_APP"] = "in_app";
|
|
14870
14958
|
})(exports.CampaignRuleConversionEventType || (exports.CampaignRuleConversionEventType = {}));
|
|
14871
14959
|
|
|
14872
|
-
const SHOULD_SHOW_LOADING_INDICATOR = false;
|
|
14873
|
-
|
|
14874
14960
|
function parseToSemver(versionString) {
|
|
14875
14961
|
const [semVer, major, minor, patch, prerelease, buildmetadata] = versionString.match(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/) ?? [];
|
|
14876
14962
|
return {
|
|
@@ -64345,6 +64431,7 @@ exports.ClientError = ClientError;
|
|
|
64345
64431
|
exports.ConfigRepository = ConfigRepository;
|
|
64346
64432
|
exports.ConflictError = ConflictError;
|
|
64347
64433
|
exports.CustomerJourneyRepository = CustomerJourneyRepository;
|
|
64434
|
+
exports.DISABLE_ASYNC_LOGIN_LOGOUT = DISABLE_ASYNC_LOGIN_LOGOUT;
|
|
64348
64435
|
exports.DeviceIDRequiredError = DeviceIDRequiredError;
|
|
64349
64436
|
exports.DeviceRepository = DeviceRepository;
|
|
64350
64437
|
exports.EntitlementRepository = EntitlementRepository;
|
package/dist/index.d.ts
CHANGED
|
@@ -2133,6 +2133,26 @@ declare class NamiProfileManager {
|
|
|
2133
2133
|
isLoggedIn(): boolean;
|
|
2134
2134
|
private save;
|
|
2135
2135
|
private load;
|
|
2136
|
+
/**
|
|
2137
|
+
* Update local profile state for login: persist the external id and flip the
|
|
2138
|
+
* logged-in flag in PaywallState. No network I/O — pair with `loginRemote`
|
|
2139
|
+
* to perform the actual API call. Used by the async login/logout fast path.
|
|
2140
|
+
*/
|
|
2141
|
+
loginLocal(externalId: string): void;
|
|
2142
|
+
/**
|
|
2143
|
+
* Perform the login network call only. If the server returns a different
|
|
2144
|
+
* `external_id` than the locally stored value, reconcile it into local state.
|
|
2145
|
+
*/
|
|
2146
|
+
loginRemote(externalId: string): Promise<void>;
|
|
2147
|
+
/**
|
|
2148
|
+
* Update local profile state for logout: clear the external id, persist,
|
|
2149
|
+
* and flip the logged-in flag in PaywallState. Used by the async fast path.
|
|
2150
|
+
*/
|
|
2151
|
+
logoutLocal(): void;
|
|
2152
|
+
/**
|
|
2153
|
+
* Perform the logout network call only.
|
|
2154
|
+
*/
|
|
2155
|
+
logoutRemote(): Promise<void>;
|
|
2136
2156
|
login(externalId: string): Promise<void>;
|
|
2137
2157
|
logout(): Promise<void>;
|
|
2138
2158
|
}
|
|
@@ -2607,6 +2627,7 @@ declare const LIQUID_VARIABLE_REGEX: RegExp;
|
|
|
2607
2627
|
declare const NAMI_STORAGE_KEYS: readonly string[];
|
|
2608
2628
|
|
|
2609
2629
|
declare const SHOULD_SHOW_LOADING_INDICATOR = false;
|
|
2630
|
+
declare const DISABLE_ASYNC_LOGIN_LOGOUT = "disableAsyncLoginLogout";
|
|
2610
2631
|
|
|
2611
2632
|
declare const getBaseUrl: (namiCommands?: string[]) => string;
|
|
2612
2633
|
declare const getExtendedClientInfo: (namiCommands: string[]) => ExtendedPlatformInfo;
|
|
@@ -3082,5 +3103,5 @@ declare const getBillingPeriodNumber: (billingPeriod: string) => number;
|
|
|
3082
3103
|
declare const formattedPrice: (price: number) => number;
|
|
3083
3104
|
declare function toDouble(num: number): number;
|
|
3084
3105
|
|
|
3085
|
-
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_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_NOT_AVAILABLE, CUSTOMER_ATTRIBUTES_KEY_PREFIX, CUSTOMER_JOURNEY_STATE_CHANGED, CUSTOM_HOST_PREFIX, CampaignNotAvailableError, CampaignRuleConversionEventType, CampaignRuleRepository, Capabilities, ClientError, ConfigRepository, ConflictError, CustomerJourneyRepository, DEVELOPMENT, DEVICE_API_TIMEOUT_LIMIT, DEVICE_ID_NOT_SET, DEVICE_ID_REQUIRED, 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, NamiCampaignRuleType, NamiConditionEvaluator, NamiCustomerManager, NamiEntitlementManager, NamiEventEmitter, NamiFlow, NamiFlowActionFunction, NamiFlowManager, NamiFlowStepType, NamiPaywallAction, NamiPaywallManager, PaywallManagerEvents as NamiPaywallManagerEvents, NamiProfileManager, NamiPurchaseManager, NamiRefs, NamiReservedActions, NotFoundError, PAYWALL_ACTION_EVENT, PLATFORM_ID_REQUIRED, PRODUCTION, PaywallManagerEvents, PaywallRepository, PaywallState, PlacementLabelResolver, PlatformIDRequiredError, ProductRepository, RECONFIG_SUCCESS, RetryLimitExceededError, SDKNotInitializedError, SDK_NOT_INITIALIZED, SERVER_NAMI_ENTITLEMENTS, SESSION_REQUIRED, SHOULD_SHOW_LOADING_INDICATOR, SKU_TEXT_REGEX, SMART_TEXT_PATTERN, STATUS_BAD_REQUEST, STATUS_CONFLICT, STATUS_INTERNAL_SERVER_ERROR, STATUS_NOT_FOUND, STATUS_SUCCESS, SessionService, SimpleEventTarget, StorageService, UNABLE_TO_UPDATE_CDP_ID, USE_STAGING_API, VALIDATE_PRODUCT_GROUPS, VAR_REGEX, activateEntitlementByPurchase, activeEntitlements, aggregateScreenreaderText, allCampaigns, allPaywalls, applyEntitlementActivation, audienceSplitPosition, bestUrlCampaignMatch, bigintToUuid, checkAnySkuHasPromoOffer, checkAnySkuHasTrialOffer, convertISO8601PeriodToText, convertLocale, convertOfferToPricingPhase, createNamiEntitlements, currentSku, empty, extractStandardPricingPhases, formatDate, formattedPrice, generateUUID, getApiCampaigns, getApiPaywalls, getBaseUrl, getBillingPeriodNumber, getCurrencyFormat, getDeviceData, getDeviceFormFactor, getDeviceScaleFactor, getEffectiveWebStyle, getEntitlementRefIdsForSku, getExtendedClientInfo, getFreeTrialPeriod, getInitialCampaigns, getInitialPaywalls, getPaywall, getPaywallDataFromLabel, getPercentagePriceDifference, getPeriodNumberInDays, getPeriodNumberInWeeks, getPlatformAdapters, getPriceDifference, getPricePerMonth, getProductDetail, getPurchaseAdapter, getReferenceSku, getSkuProductDetailKeys, getSkuSmartTextValue, getSlideSmartTextValue, getStandardBillingPeriod, getTranslate, getUrlParams, handleErrors, hasAllPaywalls, hasCapability, hasPurchaseManagement, initialState, invokeHandler, isAnonymousMode, isInitialConfigCompressed, isNamiFlowCampaign, isSubscription, isValidISODate, isValidUrl, logger, mapAnonymousCampaigns, namiBuySKU, normalizeLaunchContext, parseToSemver, postConversion, productDetail, registerPlatformAdapters, registerPurchaseAdapter, selectSegment, setActiveNamiEntitlements, shouldValidateProductGroups, skuItems, skuMapFromEntitlements, storageService, toDouble, toNamiEntitlements, toNamiSKU, tryParseB64Gzip, tryParseJson, updateRelatedSKUsForNamiEntitlement, uuidFromSplitPosition, validateMinSDKVersion };
|
|
3106
|
+
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_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_NOT_AVAILABLE, CUSTOMER_ATTRIBUTES_KEY_PREFIX, CUSTOMER_JOURNEY_STATE_CHANGED, CUSTOM_HOST_PREFIX, CampaignNotAvailableError, CampaignRuleConversionEventType, CampaignRuleRepository, Capabilities, ClientError, ConfigRepository, ConflictError, CustomerJourneyRepository, 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, NamiCampaignRuleType, NamiConditionEvaluator, NamiCustomerManager, NamiEntitlementManager, NamiEventEmitter, NamiFlow, NamiFlowActionFunction, NamiFlowManager, NamiFlowStepType, NamiPaywallAction, NamiPaywallManager, PaywallManagerEvents as NamiPaywallManagerEvents, NamiProfileManager, NamiPurchaseManager, NamiRefs, NamiReservedActions, NotFoundError, PAYWALL_ACTION_EVENT, PLATFORM_ID_REQUIRED, PRODUCTION, PaywallManagerEvents, PaywallRepository, PaywallState, PlacementLabelResolver, PlatformIDRequiredError, ProductRepository, RECONFIG_SUCCESS, RetryLimitExceededError, SDKNotInitializedError, SDK_NOT_INITIALIZED, SERVER_NAMI_ENTITLEMENTS, SESSION_REQUIRED, SHOULD_SHOW_LOADING_INDICATOR, SKU_TEXT_REGEX, SMART_TEXT_PATTERN, STATUS_BAD_REQUEST, STATUS_CONFLICT, STATUS_INTERNAL_SERVER_ERROR, STATUS_NOT_FOUND, STATUS_SUCCESS, SessionService, SimpleEventTarget, StorageService, UNABLE_TO_UPDATE_CDP_ID, USE_STAGING_API, VALIDATE_PRODUCT_GROUPS, VAR_REGEX, activateEntitlementByPurchase, activeEntitlements, aggregateScreenreaderText, allCampaigns, allPaywalls, applyEntitlementActivation, audienceSplitPosition, bestUrlCampaignMatch, bigintToUuid, checkAnySkuHasPromoOffer, checkAnySkuHasTrialOffer, convertISO8601PeriodToText, convertLocale, convertOfferToPricingPhase, createNamiEntitlements, currentSku, empty, extractStandardPricingPhases, formatDate, formattedPrice, generateUUID, getApiCampaigns, getApiPaywalls, getBaseUrl, getBillingPeriodNumber, getCurrencyFormat, getDeviceData, getDeviceFormFactor, getDeviceScaleFactor, getEffectiveWebStyle, getEntitlementRefIdsForSku, getExtendedClientInfo, getFreeTrialPeriod, getInitialCampaigns, getInitialPaywalls, getPaywall, getPaywallDataFromLabel, getPercentagePriceDifference, getPeriodNumberInDays, getPeriodNumberInWeeks, getPlatformAdapters, getPriceDifference, getPricePerMonth, getProductDetail, getPurchaseAdapter, getReferenceSku, getSkuProductDetailKeys, getSkuSmartTextValue, getSlideSmartTextValue, getStandardBillingPeriod, getTranslate, getUrlParams, handleErrors, hasAllPaywalls, hasCapability, hasPurchaseManagement, initialState, invokeHandler, isAnonymousMode, isInitialConfigCompressed, isNamiFlowCampaign, isSubscription, isValidISODate, isValidUrl, logger, mapAnonymousCampaigns, namiBuySKU, normalizeLaunchContext, parseToSemver, postConversion, productDetail, registerPlatformAdapters, registerPurchaseAdapter, selectSegment, setActiveNamiEntitlements, shouldValidateProductGroups, skuItems, skuMapFromEntitlements, storageService, toDouble, toNamiEntitlements, toNamiSKU, tryParseB64Gzip, tryParseJson, updateRelatedSKUsForNamiEntitlement, uuidFromSplitPosition, validateMinSDKVersion };
|
|
3086
3107
|
export type { AlignmentType, AmazonProduct, ApiResponse, AppleProduct, AvailableCampaignsResponseHandler, BorderLocationType, BorderSideType, Callback$1 as Callback, CloseHandler, CustomerJourneyState, DeepLinkUrlHandler, Device, DevicePayload, DeviceProfile, DirectionType, ExtendedPlatformInfo, FlexDirectionObject, FlowNavigationOptions, FontCollection, FontDetails, FormFactor, GoogleProduct, IConfig, IDeviceAdapter, IEntitlements$1 as IEntitlements, IPaywall, IPlatformAdapters, IProductsWithComponents, IPurchaseAdapter, ISkuMenu, IStorageAdapter, IUIAdapter, Impression, InitialConfig, InitialConfigCompressed, InitiateStateGroup, LoginResponse, NamiAnimation, NamiAnimationObjectSpec, NamiAnimationSpec, NamiAnonymousCampaign, NamiAppSuppliedVideoDetails, NamiCampaign, NamiCampaignSegment, NamiConfiguration, NamiConfigurationState, NamiEntitlement$1 as NamiEntitlement, NamiFlowAction, NamiFlowAnimation, NamiFlowCampaign, NamiFlowDTO, NamiFlowEventHandler, NamiFlowHandoffStepHandler, NamiFlowObjectDTO, NamiFlowOn, NamiFlowStep, NamiFlowTransition, NamiFlowTransitionDirection, NamiFlowWithObject, NamiInitialConfig, NamiLanguageCodes, NamiLogLevel, NamiPaywallActionHandler, NamiPaywallComponentChange, NamiPaywallEvent, NamiPaywallEventVideoMetadata, NamiPaywallLaunchContext, NamiPresentationStyle, NamiProductDetails, NamiProductOffer, NamiProfile, NamiPurchase, NamiPurchaseCompleteResult, NamiPurchaseDetails, NamiPurchasesState, NamiSKU, NamiSKUType, NamiSubscriptionInterval, NamiSubscriptionPeriod, 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, TSpacerComponent, TStack, TSvgImageComponent, TSymbolComponent, TTestObject, TTextComponent, TTextLikeComponent, TTextListComponent, TToggleButtonComponent, TToggleSwitch, TVariablePattern, TVideoComponent, TVolumeButton, TimerState, TransactionRequest, UserAction, UserActionParameters, Wave, WaveSpec };
|
package/dist/index.mjs
CHANGED
|
@@ -96,7 +96,7 @@ const {
|
|
|
96
96
|
// version — stamped by scripts/version.sh
|
|
97
97
|
NAMI_SDK_VERSION = "3.4.0",
|
|
98
98
|
// full package version including dev suffix — stamped by scripts/version.sh
|
|
99
|
-
NAMI_SDK_PACKAGE_VERSION = "3.4.0-dev.
|
|
99
|
+
NAMI_SDK_PACKAGE_VERSION = "3.4.0-dev.202605191719",
|
|
100
100
|
// environments
|
|
101
101
|
PRODUCTION = "production", DEVELOPMENT = "development",
|
|
102
102
|
// error messages
|
|
@@ -12993,21 +12993,46 @@ class NamiProfileManager {
|
|
|
12993
12993
|
}
|
|
12994
12994
|
PaywallState.setIsLoggedIn(!!this.externalId);
|
|
12995
12995
|
}
|
|
12996
|
-
|
|
12996
|
+
/**
|
|
12997
|
+
* Update local profile state for login: persist the external id and flip the
|
|
12998
|
+
* logged-in flag in PaywallState. No network I/O — pair with `loginRemote`
|
|
12999
|
+
* to perform the actual API call. Used by the async login/logout fast path.
|
|
13000
|
+
*/
|
|
13001
|
+
loginLocal(externalId) {
|
|
13002
|
+
this.setExternalId(externalId).save();
|
|
13003
|
+
PaywallState.setIsLoggedIn(true);
|
|
13004
|
+
}
|
|
13005
|
+
/**
|
|
13006
|
+
* Perform the login network call only. If the server returns a different
|
|
13007
|
+
* `external_id` than the locally stored value, reconcile it into local state.
|
|
13008
|
+
*/
|
|
13009
|
+
async loginRemote(externalId) {
|
|
12997
13010
|
const loginData = await NamiAPI.instance.login(externalId);
|
|
12998
|
-
if (loginData.external_id) {
|
|
12999
|
-
|
|
13011
|
+
if (loginData.external_id && loginData.external_id !== this.externalId) {
|
|
13012
|
+
this.setExternalId(loginData.external_id).save();
|
|
13000
13013
|
}
|
|
13001
|
-
this
|
|
13002
|
-
.setExternalId(loginData.external_id)
|
|
13003
|
-
.save();
|
|
13004
13014
|
}
|
|
13005
|
-
|
|
13006
|
-
|
|
13015
|
+
/**
|
|
13016
|
+
* Update local profile state for logout: clear the external id, persist,
|
|
13017
|
+
* and flip the logged-in flag in PaywallState. Used by the async fast path.
|
|
13018
|
+
*/
|
|
13019
|
+
logoutLocal() {
|
|
13020
|
+
this.setExternalId(undefined).save();
|
|
13007
13021
|
PaywallState.setIsLoggedIn(false);
|
|
13008
|
-
|
|
13009
|
-
|
|
13010
|
-
|
|
13022
|
+
}
|
|
13023
|
+
/**
|
|
13024
|
+
* Perform the logout network call only.
|
|
13025
|
+
*/
|
|
13026
|
+
async logoutRemote() {
|
|
13027
|
+
await NamiAPI.instance.logout();
|
|
13028
|
+
}
|
|
13029
|
+
async login(externalId) {
|
|
13030
|
+
this.loginLocal(externalId);
|
|
13031
|
+
await this.loginRemote(externalId);
|
|
13032
|
+
}
|
|
13033
|
+
async logout() {
|
|
13034
|
+
this.logoutLocal();
|
|
13035
|
+
await this.logoutRemote();
|
|
13011
13036
|
}
|
|
13012
13037
|
}
|
|
13013
13038
|
NamiProfileManager.instance = new NamiProfileManager();
|
|
@@ -13327,6 +13352,21 @@ class NamiFlowManager {
|
|
|
13327
13352
|
}
|
|
13328
13353
|
}
|
|
13329
13354
|
|
|
13355
|
+
const SHOULD_SHOW_LOADING_INDICATOR = false;
|
|
13356
|
+
const DISABLE_ASYNC_LOGIN_LOGOUT = "disableAsyncLoginLogout";
|
|
13357
|
+
/**
|
|
13358
|
+
* Returns true when `disableAsyncLoginLogout` appears in the active `namiCommands` list,
|
|
13359
|
+
* meaning login/logout should await the underlying API call before notifying handlers.
|
|
13360
|
+
*
|
|
13361
|
+
* Default behavior (flag absent) is the async/fast path: update local state and notify
|
|
13362
|
+
* handlers immediately while dispatching the API call as fire-and-forget.
|
|
13363
|
+
*
|
|
13364
|
+
* Internal feature flag — opt-out via `Nami.configure({ namiCommands: [...] })`.
|
|
13365
|
+
*/
|
|
13366
|
+
const isAsyncLoginLogoutDisabled = () => {
|
|
13367
|
+
return storageService.getNamiConfig()?.namiCommands?.includes(DISABLE_ASYNC_LOGIN_LOGOUT) ?? false;
|
|
13368
|
+
};
|
|
13369
|
+
|
|
13330
13370
|
/**
|
|
13331
13371
|
* @class NamiCustomerManager
|
|
13332
13372
|
* Provides methods for managing customer-related functionality.
|
|
@@ -13388,6 +13428,30 @@ class NamiCustomerManager {
|
|
|
13388
13428
|
this.invokeStateHandler(AccountStateAction.LOGIN, false, error);
|
|
13389
13429
|
throw error;
|
|
13390
13430
|
}
|
|
13431
|
+
if (!isAsyncLoginLogoutDisabled()) {
|
|
13432
|
+
// Default sync/fast path: update local state, notify handlers, and fire
|
|
13433
|
+
// lifecycle immediately. Dispatch the underlying API call and entitlement
|
|
13434
|
+
// refresh fire-and-forget — failures are logged but do not surface.
|
|
13435
|
+
NamiProfileManager.instance.loginLocal(externalId);
|
|
13436
|
+
this.invokeStateHandler(AccountStateAction.LOGIN, true);
|
|
13437
|
+
if (NamiFlowManager.instance.flowOpen) {
|
|
13438
|
+
const currentFlow = NamiFlowManager.instance.currentFlow;
|
|
13439
|
+
const currentStep = currentFlow?.currentFlowStep;
|
|
13440
|
+
if (currentStep) {
|
|
13441
|
+
if (Nami.instance.maxLogging) {
|
|
13442
|
+
logger.debug(`[NamiCustomerManager] async login success — triggering __login_success__ on step ${currentStep.id}`);
|
|
13443
|
+
}
|
|
13444
|
+
currentFlow.executeLifecycle(currentStep, NamiReservedActions.LOGIN_SUCCESS);
|
|
13445
|
+
}
|
|
13446
|
+
}
|
|
13447
|
+
void NamiProfileManager.instance.loginRemote(externalId).catch((err) => {
|
|
13448
|
+
logger.error('[NamiCustomerManager] async login API failed', err);
|
|
13449
|
+
});
|
|
13450
|
+
void EntitlementRepository.instance.fetchActiveEntitlements().catch((err) => {
|
|
13451
|
+
logger.error('[NamiCustomerManager] async login entitlement refresh failed', err);
|
|
13452
|
+
});
|
|
13453
|
+
return;
|
|
13454
|
+
}
|
|
13391
13455
|
try {
|
|
13392
13456
|
await NamiProfileManager.instance.login(externalId);
|
|
13393
13457
|
await EntitlementRepository.instance.fetchActiveEntitlements();
|
|
@@ -13433,6 +13497,30 @@ class NamiCustomerManager {
|
|
|
13433
13497
|
this.invokeStateHandler(AccountStateAction.LOGOUT, false, error);
|
|
13434
13498
|
throw error;
|
|
13435
13499
|
}
|
|
13500
|
+
if (!isAsyncLoginLogoutDisabled()) {
|
|
13501
|
+
// Default sync/fast path: clear local state, notify handlers, and fire
|
|
13502
|
+
// lifecycle immediately. Dispatch the underlying API call and entitlement
|
|
13503
|
+
// refresh fire-and-forget — failures are logged but do not surface.
|
|
13504
|
+
NamiProfileManager.instance.logoutLocal();
|
|
13505
|
+
this.invokeStateHandler(AccountStateAction.LOGOUT, true);
|
|
13506
|
+
if (NamiFlowManager.instance.flowOpen) {
|
|
13507
|
+
const currentFlow = NamiFlowManager.instance.currentFlow;
|
|
13508
|
+
const currentStep = currentFlow?.currentFlowStep;
|
|
13509
|
+
if (currentStep) {
|
|
13510
|
+
if (Nami.instance.maxLogging) {
|
|
13511
|
+
logger.debug(`[NamiCustomerManager] async logout success — triggering __logout_success__ on step ${currentStep.id}`);
|
|
13512
|
+
}
|
|
13513
|
+
currentFlow.executeLifecycle(currentStep, NamiReservedActions.LOGOUT_SUCCESS);
|
|
13514
|
+
}
|
|
13515
|
+
}
|
|
13516
|
+
void NamiProfileManager.instance.logoutRemote().catch((err) => {
|
|
13517
|
+
logger.error('[NamiCustomerManager] async logout API failed', err);
|
|
13518
|
+
});
|
|
13519
|
+
void EntitlementRepository.instance.fetchActiveEntitlements().catch((err) => {
|
|
13520
|
+
logger.error('[NamiCustomerManager] async logout entitlement refresh failed', err);
|
|
13521
|
+
});
|
|
13522
|
+
return;
|
|
13523
|
+
}
|
|
13436
13524
|
try {
|
|
13437
13525
|
await NamiProfileManager.instance.logout();
|
|
13438
13526
|
await EntitlementRepository.instance.fetchActiveEntitlements();
|
|
@@ -14867,8 +14955,6 @@ var CampaignRuleConversionEventType;
|
|
|
14867
14955
|
CampaignRuleConversionEventType["IN_APP"] = "in_app";
|
|
14868
14956
|
})(CampaignRuleConversionEventType || (CampaignRuleConversionEventType = {}));
|
|
14869
14957
|
|
|
14870
|
-
const SHOULD_SHOW_LOADING_INDICATOR = false;
|
|
14871
|
-
|
|
14872
14958
|
function parseToSemver(versionString) {
|
|
14873
14959
|
const [semVer, major, minor, patch, prerelease, buildmetadata] = versionString.match(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/) ?? [];
|
|
14874
14960
|
return {
|
|
@@ -64328,4 +64414,4 @@ function namiBuySKU(skuRefId) {
|
|
|
64328
64414
|
return result;
|
|
64329
64415
|
}
|
|
64330
64416
|
|
|
64331
|
-
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_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_NOT_AVAILABLE, CUSTOMER_ATTRIBUTES_KEY_PREFIX, CUSTOMER_JOURNEY_STATE_CHANGED, CUSTOM_HOST_PREFIX, CampaignNotAvailableError, CampaignRuleConversionEventType, CampaignRuleRepository, Capabilities, ClientError, ConfigRepository, ConflictError, CustomerJourneyRepository, DEVELOPMENT, DEVICE_API_TIMEOUT_LIMIT, DEVICE_ID_NOT_SET, DEVICE_ID_REQUIRED, 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, NamiCampaignRuleType, NamiConditionEvaluator, NamiCustomerManager, NamiEntitlementManager, NamiEventEmitter, NamiFlow, NamiFlowActionFunction, NamiFlowManager, NamiFlowStepType, NamiPaywallAction, NamiPaywallManager, PaywallManagerEvents as NamiPaywallManagerEvents, NamiProfileManager, NamiPurchaseManager, NamiRefs, NamiReservedActions, NotFoundError, PAYWALL_ACTION_EVENT, PLATFORM_ID_REQUIRED, PRODUCTION, PaywallManagerEvents, PaywallRepository, PaywallState, PlacementLabelResolver, PlatformIDRequiredError, ProductRepository, RECONFIG_SUCCESS, RetryLimitExceededError, SDKNotInitializedError, SDK_NOT_INITIALIZED, SERVER_NAMI_ENTITLEMENTS, SESSION_REQUIRED, SHOULD_SHOW_LOADING_INDICATOR, SKU_TEXT_REGEX, SMART_TEXT_PATTERN, STATUS_BAD_REQUEST, STATUS_CONFLICT, STATUS_INTERNAL_SERVER_ERROR, STATUS_NOT_FOUND, STATUS_SUCCESS, SessionService, SimpleEventTarget, StorageService, UNABLE_TO_UPDATE_CDP_ID, USE_STAGING_API, VALIDATE_PRODUCT_GROUPS, VAR_REGEX, activateEntitlementByPurchase, activeEntitlements, aggregateScreenreaderText, allCampaigns, allPaywalls, applyEntitlementActivation, audienceSplitPosition, bestUrlCampaignMatch, bigintToUuid, checkAnySkuHasPromoOffer, checkAnySkuHasTrialOffer, convertISO8601PeriodToText, convertLocale, convertOfferToPricingPhase, createNamiEntitlements, currentSku, empty, extractStandardPricingPhases, formatDate, formattedPrice, generateUUID, getApiCampaigns, getApiPaywalls, getBaseUrl, getBillingPeriodNumber, getCurrencyFormat, getDeviceData, getDeviceFormFactor, getDeviceScaleFactor, getEffectiveWebStyle, getEntitlementRefIdsForSku, getExtendedClientInfo, getFreeTrialPeriod, getInitialCampaigns, getInitialPaywalls, getPaywall, getPaywallDataFromLabel, getPercentagePriceDifference, getPeriodNumberInDays, getPeriodNumberInWeeks, getPlatformAdapters, getPriceDifference, getPricePerMonth, getProductDetail, getPurchaseAdapter, getReferenceSku, getSkuProductDetailKeys, getSkuSmartTextValue, getSlideSmartTextValue, getStandardBillingPeriod, getTranslate, getUrlParams, handleErrors, hasAllPaywalls, hasCapability, hasPurchaseManagement, initialState, invokeHandler, isAnonymousMode, isInitialConfigCompressed, isNamiFlowCampaign, isSubscription, isValidISODate, isValidUrl, logger, mapAnonymousCampaigns, namiBuySKU, normalizeLaunchContext, parseToSemver, postConversion, productDetail, registerPlatformAdapters, registerPurchaseAdapter, selectSegment, setActiveNamiEntitlements, shouldValidateProductGroups, skuItems, skuMapFromEntitlements, storageService, toDouble, toNamiEntitlements, toNamiSKU, tryParseB64Gzip, tryParseJson, updateRelatedSKUsForNamiEntitlement, uuidFromSplitPosition, validateMinSDKVersion };
|
|
64417
|
+
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_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_NOT_AVAILABLE, CUSTOMER_ATTRIBUTES_KEY_PREFIX, CUSTOMER_JOURNEY_STATE_CHANGED, CUSTOM_HOST_PREFIX, CampaignNotAvailableError, CampaignRuleConversionEventType, CampaignRuleRepository, Capabilities, ClientError, ConfigRepository, ConflictError, CustomerJourneyRepository, 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, NamiCampaignRuleType, NamiConditionEvaluator, NamiCustomerManager, NamiEntitlementManager, NamiEventEmitter, NamiFlow, NamiFlowActionFunction, NamiFlowManager, NamiFlowStepType, NamiPaywallAction, NamiPaywallManager, PaywallManagerEvents as NamiPaywallManagerEvents, NamiProfileManager, NamiPurchaseManager, NamiRefs, NamiReservedActions, NotFoundError, PAYWALL_ACTION_EVENT, PLATFORM_ID_REQUIRED, PRODUCTION, PaywallManagerEvents, PaywallRepository, PaywallState, PlacementLabelResolver, PlatformIDRequiredError, ProductRepository, RECONFIG_SUCCESS, RetryLimitExceededError, SDKNotInitializedError, SDK_NOT_INITIALIZED, SERVER_NAMI_ENTITLEMENTS, SESSION_REQUIRED, SHOULD_SHOW_LOADING_INDICATOR, SKU_TEXT_REGEX, SMART_TEXT_PATTERN, STATUS_BAD_REQUEST, STATUS_CONFLICT, STATUS_INTERNAL_SERVER_ERROR, STATUS_NOT_FOUND, STATUS_SUCCESS, SessionService, SimpleEventTarget, StorageService, UNABLE_TO_UPDATE_CDP_ID, USE_STAGING_API, VALIDATE_PRODUCT_GROUPS, VAR_REGEX, activateEntitlementByPurchase, activeEntitlements, aggregateScreenreaderText, allCampaigns, allPaywalls, applyEntitlementActivation, audienceSplitPosition, bestUrlCampaignMatch, bigintToUuid, checkAnySkuHasPromoOffer, checkAnySkuHasTrialOffer, convertISO8601PeriodToText, convertLocale, convertOfferToPricingPhase, createNamiEntitlements, currentSku, empty, extractStandardPricingPhases, formatDate, formattedPrice, generateUUID, getApiCampaigns, getApiPaywalls, getBaseUrl, getBillingPeriodNumber, getCurrencyFormat, getDeviceData, getDeviceFormFactor, getDeviceScaleFactor, getEffectiveWebStyle, getEntitlementRefIdsForSku, getExtendedClientInfo, getFreeTrialPeriod, getInitialCampaigns, getInitialPaywalls, getPaywall, getPaywallDataFromLabel, getPercentagePriceDifference, getPeriodNumberInDays, getPeriodNumberInWeeks, getPlatformAdapters, getPriceDifference, getPricePerMonth, getProductDetail, getPurchaseAdapter, getReferenceSku, getSkuProductDetailKeys, getSkuSmartTextValue, getSlideSmartTextValue, getStandardBillingPeriod, getTranslate, getUrlParams, handleErrors, hasAllPaywalls, hasCapability, hasPurchaseManagement, initialState, invokeHandler, isAnonymousMode, isInitialConfigCompressed, isNamiFlowCampaign, isSubscription, isValidISODate, isValidUrl, logger, mapAnonymousCampaigns, namiBuySKU, normalizeLaunchContext, parseToSemver, postConversion, productDetail, registerPlatformAdapters, registerPurchaseAdapter, selectSegment, setActiveNamiEntitlements, shouldValidateProductGroups, skuItems, skuMapFromEntitlements, storageService, toDouble, toNamiEntitlements, toNamiSKU, tryParseB64Gzip, tryParseJson, updateRelatedSKUsForNamiEntitlement, uuidFromSplitPosition, validateMinSDKVersion };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@namiml/sdk-core",
|
|
3
|
-
"version": "3.4.0-dev.
|
|
3
|
+
"version": "3.4.0-dev.202605191719",
|
|
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",
|