@namiml/sdk-core 3.4.0-dev.202604032229 → 3.4.0-dev.202604101801

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
@@ -16,7 +16,7 @@ const _fallback = {
16
16
  getDeviceData: () => ({ os_version: '', os_name: '', browser_name: '', browser_version: '', sdk_client: '', sdk_version: '', language: 'en' }),
17
17
  getDeviceFormFactor: () => 'desktop',
18
18
  getDeviceScaleFactor: () => 1,
19
- generateUUID: () => Math.random().toString(36).substring(2),
19
+ generateUUID: () => { throw new Error('No platform adapter registered — call registerPlatformAdapters() before Nami.configure()'); },
20
20
  getScreenInfo: () => ({ width: 0, height: 0, scale: 1 }),
21
21
  getLanguage: () => 'en',
22
22
  },
@@ -29,6 +29,13 @@ const _fallback = {
29
29
  function getPlatformAdapters() {
30
30
  return _adapters ?? _fallback;
31
31
  }
32
+ let _purchaseAdapter = null;
33
+ function registerPurchaseAdapter(adapter) {
34
+ _purchaseAdapter = adapter;
35
+ }
36
+ function getPurchaseAdapter() {
37
+ return _purchaseAdapter;
38
+ }
32
39
 
33
40
  /******************************************************************************
34
41
  Copyright (c) Microsoft Corporation.
@@ -91,7 +98,7 @@ const {
91
98
  // version — stamped by scripts/version.sh
92
99
  NAMI_SDK_VERSION: exports.NAMI_SDK_VERSION = "3.4.0",
93
100
  // full package version including dev suffix — stamped by scripts/version.sh
94
- NAMI_SDK_PACKAGE_VERSION: exports.NAMI_SDK_PACKAGE_VERSION = "3.4.0-dev.202604032229",
101
+ NAMI_SDK_PACKAGE_VERSION: exports.NAMI_SDK_PACKAGE_VERSION = "3.4.0-dev.202604101801",
95
102
  // environments
96
103
  PRODUCTION: exports.PRODUCTION = "production", DEVELOPMENT: exports.DEVELOPMENT = "development",
97
104
  // error messages
@@ -101,7 +108,7 @@ AUTH_DEVICE: exports.AUTH_DEVICE = "nami_auth_device", NAMI_CONFIGURATION: expor
101
108
  // API settings
102
109
  API_VERSION: exports.API_VERSION = "v3", BASE_URL_PATH: exports.BASE_URL_PATH = `sdk/${exports.API_VERSION}/platform`, BASE_URL: exports.BASE_URL = "https://app.namiml.com", BASE_STAGING_URL: exports.BASE_STAGING_URL = "https://app-staging.namiml.com", CUSTOM_HOST_PREFIX: exports.CUSTOM_HOST_PREFIX = "namiAPIHost=", USE_STAGING_API: exports.USE_STAGING_API = "useStagingAPI",
103
110
  // // extended client info
104
- EXTENDED_CLIENT_INFO_PREFIX: exports.EXTENDED_CLIENT_INFO_PREFIX = "extendedClientInfo", EXTENDED_CLIENT_INFO_DELIMITER: exports.EXTENDED_CLIENT_INFO_DELIMITER = ":", VALIDATE_PRODUCT_GROUPS: exports.VALIDATE_PRODUCT_GROUPS = "validateProductGroups", 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,
111
+ EXTENDED_CLIENT_INFO_PREFIX: exports.EXTENDED_CLIENT_INFO_PREFIX = "extendedClientInfo", EXTENDED_CLIENT_INFO_DELIMITER: exports.EXTENDED_CLIENT_INFO_DELIMITER = ":", VALIDATE_PRODUCT_GROUPS: exports.VALIDATE_PRODUCT_GROUPS = "validateProductGroups", LOG_HTTP_REQUESTS: exports.LOG_HTTP_REQUESTS = "logHTTPRequests", LOG_HTTP_TRAFFIC: exports.LOG_HTTP_TRAFFIC = "logHTTPTraffic", 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,
105
112
  // status codes
106
113
  STATUS_SUCCESS: exports.STATUS_SUCCESS = 200, STATUS_BAD_REQUEST: exports.STATUS_BAD_REQUEST = 400, STATUS_NOT_FOUND: exports.STATUS_NOT_FOUND = 404, STATUS_CONFLICT: exports.STATUS_CONFLICT = 409, STATUS_INTERNAL_SERVER_ERROR: exports.STATUS_INTERNAL_SERVER_ERROR = 500,
107
114
  // configuration states
@@ -3466,40 +3473,6 @@ const handleErrors = (status, path) => {
3466
3473
  }
3467
3474
  };
3468
3475
 
3469
- async function withRetry(url, options, timeout = exports.API_TIMEOUT_LIMIT, retries = exports.API_MAX_CALLS_LIMIT) {
3470
- let retryCount = 0;
3471
- const fetchWithRetry = async () => {
3472
- const response = await timeoutRequest(url, options, timeout);
3473
- if (!response.ok) {
3474
- if (response.status == exports.STATUS_CONFLICT) {
3475
- throw new ConflictError();
3476
- }
3477
- retryCount++;
3478
- // Retry for retries times
3479
- if (retryCount <= retries) {
3480
- // Delay by 2 seconds per retryCount
3481
- const delay = (retryCount + exports.API_RETRY_DELAY_SEC) * 1000;
3482
- await new Promise((resolve) => setTimeout(resolve, delay));
3483
- return fetchWithRetry();
3484
- }
3485
- else {
3486
- throw new RetryLimitExceededError(response.status, `Request failed after ${retries} retries`);
3487
- }
3488
- }
3489
- return response;
3490
- };
3491
- const response = await fetchWithRetry();
3492
- return response.json();
3493
- }
3494
- async function timeoutRequest(url, options = {}, timeout) {
3495
- const controller = new AbortController();
3496
- const timeoutId = setTimeout(() => controller.abort(), timeout);
3497
- options["signal"] = controller.signal;
3498
- const response = await fetch(url, options);
3499
- clearTimeout(timeoutId);
3500
- return response;
3501
- }
3502
-
3503
3476
  /*============================================================================*/
3504
3477
 
3505
3478
 
@@ -6796,6 +6769,14 @@ const shouldValidateProductGroups = () => {
6796
6769
  const namiCommands = storageService.getNamiConfig()?.namiCommands;
6797
6770
  return namiCommands?.includes(exports.VALIDATE_PRODUCT_GROUPS) ?? false;
6798
6771
  };
6772
+ const shouldLogHTTPRequests = () => {
6773
+ const namiCommands = storageService.getNamiConfig()?.namiCommands;
6774
+ return namiCommands?.includes(exports.LOG_HTTP_REQUESTS) ?? false;
6775
+ };
6776
+ const shouldLogHTTPTraffic = () => {
6777
+ const namiCommands = storageService.getNamiConfig()?.namiCommands;
6778
+ return namiCommands?.includes(exports.LOG_HTTP_TRAFFIC) ?? false;
6779
+ };
6799
6780
  function tryParseJson(str) {
6800
6781
  const trimmed = str.trim();
6801
6782
  if (!trimmed.startsWith("{") && !trimmed.startsWith("["))
@@ -6830,6 +6811,57 @@ function base64ToUint8(b64) {
6830
6811
  return bytes;
6831
6812
  }
6832
6813
 
6814
+ async function withRetry(url, options, timeout = exports.API_TIMEOUT_LIMIT, retries = exports.API_MAX_CALLS_LIMIT) {
6815
+ let retryCount = 0;
6816
+ const logRequests = shouldLogHTTPRequests();
6817
+ const logTraffic = shouldLogHTTPTraffic();
6818
+ const method = options?.method ?? "GET";
6819
+ const fetchWithRetry = async () => {
6820
+ if (logRequests || logTraffic) {
6821
+ logger.debug(`[HTTP] ${method} ${url}`);
6822
+ }
6823
+ if (logTraffic && options?.body) {
6824
+ logger.debug(`[HTTP] Request body: ${options.body}`);
6825
+ }
6826
+ const response = await timeoutRequest(url, options, timeout);
6827
+ if (!response.ok) {
6828
+ if (logTraffic) {
6829
+ const errorBody = await response.clone().text();
6830
+ logger.debug(`[HTTP] Response ${response.status}: ${errorBody}`);
6831
+ }
6832
+ if (response.status == exports.STATUS_CONFLICT) {
6833
+ throw new ConflictError();
6834
+ }
6835
+ retryCount++;
6836
+ // Retry for retries times
6837
+ if (retryCount <= retries) {
6838
+ // Delay by 2 seconds per retryCount
6839
+ const delay = (retryCount + exports.API_RETRY_DELAY_SEC) * 1000;
6840
+ await new Promise((resolve) => setTimeout(resolve, delay));
6841
+ return fetchWithRetry();
6842
+ }
6843
+ else {
6844
+ throw new RetryLimitExceededError(response.status, `Request failed after ${retries} retries`);
6845
+ }
6846
+ }
6847
+ if (logTraffic) {
6848
+ const responseBody = await response.clone().text();
6849
+ logger.debug(`[HTTP] Response ${response.status}: ${responseBody}`);
6850
+ }
6851
+ return response;
6852
+ };
6853
+ const response = await fetchWithRetry();
6854
+ return response.json();
6855
+ }
6856
+ async function timeoutRequest(url, options = {}, timeout) {
6857
+ const controller = new AbortController();
6858
+ const timeoutId = setTimeout(() => controller.abort(), timeout);
6859
+ options["signal"] = controller.signal;
6860
+ const response = await fetch(url, options);
6861
+ clearTimeout(timeoutId);
6862
+ return response;
6863
+ }
6864
+
6833
6865
  function requirePlatformID(target, propertyKey, descriptor) {
6834
6866
  const originalMethod = descriptor.value;
6835
6867
  descriptor.value = function (...args) {
@@ -63852,6 +63884,7 @@ exports.getPlatformAdapters = getPlatformAdapters;
63852
63884
  exports.getPriceDifference = getPriceDifference;
63853
63885
  exports.getPricePerMonth = getPricePerMonth;
63854
63886
  exports.getProductDetail = getProductDetail;
63887
+ exports.getPurchaseAdapter = getPurchaseAdapter;
63855
63888
  exports.getReferenceSku = getReferenceSku;
63856
63889
  exports.getSkuProductDetailKeys = getSkuProductDetailKeys;
63857
63890
  exports.getSkuSmartTextValue = getSkuSmartTextValue;
@@ -63879,6 +63912,7 @@ exports.parseToSemver = parseToSemver;
63879
63912
  exports.postConversion = postConversion;
63880
63913
  exports.productDetail = productDetail;
63881
63914
  exports.registerPlatformAdapters = registerPlatformAdapters;
63915
+ exports.registerPurchaseAdapter = registerPurchaseAdapter;
63882
63916
  exports.selectSegment = selectSegment;
63883
63917
  exports.setActiveNamiEntitlements = setActiveNamiEntitlements;
63884
63918
  exports.shouldValidateProductGroups = shouldValidateProductGroups;
package/dist/index.d.ts CHANGED
@@ -1787,6 +1787,29 @@ interface IUIAdapter {
1787
1787
  postConfigure?(): void;
1788
1788
  }
1789
1789
 
1790
+ interface PurchaseContext {
1791
+ promoId?: string;
1792
+ offerId?: string;
1793
+ }
1794
+ interface PurchaseResult {
1795
+ success: boolean;
1796
+ transactionId?: string;
1797
+ receipt?: string;
1798
+ skuId: string;
1799
+ message?: string;
1800
+ }
1801
+ /**
1802
+ * Platform-agnostic purchase interface.
1803
+ * Expo: backed by react-native-iap (App Store + Google Play)
1804
+ * Vega: backed by @amazon-devices/keplerscript-appstore-iap-lib
1805
+ * Web: backed by Stripe, Recurly, or other billing provider (separate packages)
1806
+ */
1807
+ interface IPurchaseAdapter {
1808
+ getProducts(skuIds: string[]): Promise<NamiProductDetails[]>;
1809
+ purchase(skuId: string, context?: PurchaseContext): Promise<PurchaseResult>;
1810
+ restorePurchases(): Promise<PurchaseResult[]>;
1811
+ }
1812
+
1790
1813
  interface IPlatformAdapters {
1791
1814
  storage: IStorageAdapter;
1792
1815
  device: IDeviceAdapter;
@@ -1794,6 +1817,8 @@ interface IPlatformAdapters {
1794
1817
  }
1795
1818
  declare function registerPlatformAdapters(adapters: IPlatformAdapters): void;
1796
1819
  declare function getPlatformAdapters(): IPlatformAdapters;
1820
+ declare function registerPurchaseAdapter(adapter: IPurchaseAdapter): void;
1821
+ declare function getPurchaseAdapter(): IPurchaseAdapter | null;
1797
1822
 
1798
1823
  declare class Nami {
1799
1824
  #private;
@@ -2495,6 +2520,8 @@ declare const USE_STAGING_API: string;
2495
2520
  declare const EXTENDED_CLIENT_INFO_PREFIX: string;
2496
2521
  declare const EXTENDED_CLIENT_INFO_DELIMITER: string;
2497
2522
  declare const VALIDATE_PRODUCT_GROUPS: string;
2523
+ declare const LOG_HTTP_REQUESTS: string;
2524
+ declare const LOG_HTTP_TRAFFIC: string;
2498
2525
  declare const EXTENDED_PLATFORM: string;
2499
2526
  declare const EXTENDED_PLATFORM_VERSION: string;
2500
2527
  declare const API_MAX_CALLS_LIMIT: number;
@@ -2938,5 +2965,5 @@ declare const getBillingPeriodNumber: (billingPeriod: string) => number;
2938
2965
  declare const formattedPrice: (price: number) => number;
2939
2966
  declare function toDouble(num: number): number;
2940
2967
 
2941
- 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, 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, 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, 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, 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, selectSegment, setActiveNamiEntitlements, shouldValidateProductGroups, skuItems, skuMapFromEntitlements, storageService, toDouble, toNamiEntitlements, toNamiSKU, tryParseB64Gzip, tryParseJson, updateRelatedSKUsForNamiEntitlement, uuidFromSplitPosition, validateMinSDKVersion };
2942
- 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, 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, 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 };
2968
+ 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, 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, 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 };
2969
+ 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
@@ -14,7 +14,7 @@ const _fallback = {
14
14
  getDeviceData: () => ({ os_version: '', os_name: '', browser_name: '', browser_version: '', sdk_client: '', sdk_version: '', language: 'en' }),
15
15
  getDeviceFormFactor: () => 'desktop',
16
16
  getDeviceScaleFactor: () => 1,
17
- generateUUID: () => Math.random().toString(36).substring(2),
17
+ generateUUID: () => { throw new Error('No platform adapter registered — call registerPlatformAdapters() before Nami.configure()'); },
18
18
  getScreenInfo: () => ({ width: 0, height: 0, scale: 1 }),
19
19
  getLanguage: () => 'en',
20
20
  },
@@ -27,6 +27,13 @@ const _fallback = {
27
27
  function getPlatformAdapters() {
28
28
  return _adapters ?? _fallback;
29
29
  }
30
+ let _purchaseAdapter = null;
31
+ function registerPurchaseAdapter(adapter) {
32
+ _purchaseAdapter = adapter;
33
+ }
34
+ function getPurchaseAdapter() {
35
+ return _purchaseAdapter;
36
+ }
30
37
 
31
38
  /******************************************************************************
32
39
  Copyright (c) Microsoft Corporation.
@@ -89,7 +96,7 @@ const {
89
96
  // version — stamped by scripts/version.sh
90
97
  NAMI_SDK_VERSION = "3.4.0",
91
98
  // full package version including dev suffix — stamped by scripts/version.sh
92
- NAMI_SDK_PACKAGE_VERSION = "3.4.0-dev.202604032229",
99
+ NAMI_SDK_PACKAGE_VERSION = "3.4.0-dev.202604101801",
93
100
  // environments
94
101
  PRODUCTION = "production", DEVELOPMENT = "development",
95
102
  // error messages
@@ -99,7 +106,7 @@ AUTH_DEVICE = "nami_auth_device", NAMI_CONFIGURATION = "nami_configuration", NAM
99
106
  // API settings
100
107
  API_VERSION = "v3", BASE_URL_PATH = `sdk/${API_VERSION}/platform`, BASE_URL = "https://app.namiml.com", BASE_STAGING_URL = "https://app-staging.namiml.com", CUSTOM_HOST_PREFIX = "namiAPIHost=", USE_STAGING_API = "useStagingAPI",
101
108
  // // extended client info
102
- EXTENDED_CLIENT_INFO_PREFIX = "extendedClientInfo", EXTENDED_CLIENT_INFO_DELIMITER = ":", VALIDATE_PRODUCT_GROUPS = "validateProductGroups", 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,
109
+ EXTENDED_CLIENT_INFO_PREFIX = "extendedClientInfo", EXTENDED_CLIENT_INFO_DELIMITER = ":", VALIDATE_PRODUCT_GROUPS = "validateProductGroups", LOG_HTTP_REQUESTS = "logHTTPRequests", LOG_HTTP_TRAFFIC = "logHTTPTraffic", 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,
103
110
  // status codes
104
111
  STATUS_SUCCESS = 200, STATUS_BAD_REQUEST = 400, STATUS_NOT_FOUND = 404, STATUS_CONFLICT = 409, STATUS_INTERNAL_SERVER_ERROR = 500,
105
112
  // configuration states
@@ -3464,40 +3471,6 @@ const handleErrors = (status, path) => {
3464
3471
  }
3465
3472
  };
3466
3473
 
3467
- async function withRetry(url, options, timeout = API_TIMEOUT_LIMIT, retries = API_MAX_CALLS_LIMIT) {
3468
- let retryCount = 0;
3469
- const fetchWithRetry = async () => {
3470
- const response = await timeoutRequest(url, options, timeout);
3471
- if (!response.ok) {
3472
- if (response.status == STATUS_CONFLICT) {
3473
- throw new ConflictError();
3474
- }
3475
- retryCount++;
3476
- // Retry for retries times
3477
- if (retryCount <= retries) {
3478
- // Delay by 2 seconds per retryCount
3479
- const delay = (retryCount + API_RETRY_DELAY_SEC) * 1000;
3480
- await new Promise((resolve) => setTimeout(resolve, delay));
3481
- return fetchWithRetry();
3482
- }
3483
- else {
3484
- throw new RetryLimitExceededError(response.status, `Request failed after ${retries} retries`);
3485
- }
3486
- }
3487
- return response;
3488
- };
3489
- const response = await fetchWithRetry();
3490
- return response.json();
3491
- }
3492
- async function timeoutRequest(url, options = {}, timeout) {
3493
- const controller = new AbortController();
3494
- const timeoutId = setTimeout(() => controller.abort(), timeout);
3495
- options["signal"] = controller.signal;
3496
- const response = await fetch(url, options);
3497
- clearTimeout(timeoutId);
3498
- return response;
3499
- }
3500
-
3501
3474
  /*============================================================================*/
3502
3475
 
3503
3476
 
@@ -6794,6 +6767,14 @@ const shouldValidateProductGroups = () => {
6794
6767
  const namiCommands = storageService.getNamiConfig()?.namiCommands;
6795
6768
  return namiCommands?.includes(VALIDATE_PRODUCT_GROUPS) ?? false;
6796
6769
  };
6770
+ const shouldLogHTTPRequests = () => {
6771
+ const namiCommands = storageService.getNamiConfig()?.namiCommands;
6772
+ return namiCommands?.includes(LOG_HTTP_REQUESTS) ?? false;
6773
+ };
6774
+ const shouldLogHTTPTraffic = () => {
6775
+ const namiCommands = storageService.getNamiConfig()?.namiCommands;
6776
+ return namiCommands?.includes(LOG_HTTP_TRAFFIC) ?? false;
6777
+ };
6797
6778
  function tryParseJson(str) {
6798
6779
  const trimmed = str.trim();
6799
6780
  if (!trimmed.startsWith("{") && !trimmed.startsWith("["))
@@ -6828,6 +6809,57 @@ function base64ToUint8(b64) {
6828
6809
  return bytes;
6829
6810
  }
6830
6811
 
6812
+ async function withRetry(url, options, timeout = API_TIMEOUT_LIMIT, retries = API_MAX_CALLS_LIMIT) {
6813
+ let retryCount = 0;
6814
+ const logRequests = shouldLogHTTPRequests();
6815
+ const logTraffic = shouldLogHTTPTraffic();
6816
+ const method = options?.method ?? "GET";
6817
+ const fetchWithRetry = async () => {
6818
+ if (logRequests || logTraffic) {
6819
+ logger.debug(`[HTTP] ${method} ${url}`);
6820
+ }
6821
+ if (logTraffic && options?.body) {
6822
+ logger.debug(`[HTTP] Request body: ${options.body}`);
6823
+ }
6824
+ const response = await timeoutRequest(url, options, timeout);
6825
+ if (!response.ok) {
6826
+ if (logTraffic) {
6827
+ const errorBody = await response.clone().text();
6828
+ logger.debug(`[HTTP] Response ${response.status}: ${errorBody}`);
6829
+ }
6830
+ if (response.status == STATUS_CONFLICT) {
6831
+ throw new ConflictError();
6832
+ }
6833
+ retryCount++;
6834
+ // Retry for retries times
6835
+ if (retryCount <= retries) {
6836
+ // Delay by 2 seconds per retryCount
6837
+ const delay = (retryCount + API_RETRY_DELAY_SEC) * 1000;
6838
+ await new Promise((resolve) => setTimeout(resolve, delay));
6839
+ return fetchWithRetry();
6840
+ }
6841
+ else {
6842
+ throw new RetryLimitExceededError(response.status, `Request failed after ${retries} retries`);
6843
+ }
6844
+ }
6845
+ if (logTraffic) {
6846
+ const responseBody = await response.clone().text();
6847
+ logger.debug(`[HTTP] Response ${response.status}: ${responseBody}`);
6848
+ }
6849
+ return response;
6850
+ };
6851
+ const response = await fetchWithRetry();
6852
+ return response.json();
6853
+ }
6854
+ async function timeoutRequest(url, options = {}, timeout) {
6855
+ const controller = new AbortController();
6856
+ const timeoutId = setTimeout(() => controller.abort(), timeout);
6857
+ options["signal"] = controller.signal;
6858
+ const response = await fetch(url, options);
6859
+ clearTimeout(timeoutId);
6860
+ return response;
6861
+ }
6862
+
6831
6863
  function requirePlatformID(target, propertyKey, descriptor) {
6832
6864
  const originalMethod = descriptor.value;
6833
6865
  descriptor.value = function (...args) {
@@ -63755,4 +63787,4 @@ function namiBuySKU(skuRefId) {
63755
63787
  return result;
63756
63788
  }
63757
63789
 
63758
- 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, 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, 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, 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, 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, selectSegment, setActiveNamiEntitlements, shouldValidateProductGroups, skuItems, skuMapFromEntitlements, storageService, toDouble, toNamiEntitlements, toNamiSKU, tryParseB64Gzip, tryParseJson, updateRelatedSKUsForNamiEntitlement, uuidFromSplitPosition, validateMinSDKVersion };
63790
+ 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, 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, 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.202604032229",
3
+ "version": "3.4.0-dev.202604101801",
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",