@namiml/sdk-core 3.4.0-dev.202604031805 → 3.4.0-dev.202604101712
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 +35 -40
- package/dist/index.d.ts +29 -2
- package/dist/index.mjs +34 -41
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,23 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
let _adapters = null;
|
|
4
|
-
const __coreAdaptersInstanceId = Math.random().toString(16).slice(2);
|
|
5
4
|
function registerPlatformAdapters(adapters) {
|
|
6
5
|
_adapters = adapters;
|
|
7
|
-
try {
|
|
8
|
-
globalThis.__NAMI_CORE_LAST_REGISTER_INSTANCE_ID = __coreAdaptersInstanceId;
|
|
9
|
-
globalThis.__NAMI_CORE_LAST_REGISTERED_AT = Date.now();
|
|
10
|
-
}
|
|
11
|
-
catch {
|
|
12
|
-
// ignore
|
|
13
|
-
}
|
|
14
|
-
// Vega/Metro debugging: confirms which core module instance is registering adapters.
|
|
15
|
-
console.warn('[NamiCore] registerPlatformAdapters', {
|
|
16
|
-
instanceId: __coreAdaptersInstanceId,
|
|
17
|
-
hasDeviceAdapter: Boolean(adapters?.device),
|
|
18
|
-
hasStorageAdapter: Boolean(adapters?.storage),
|
|
19
|
-
hasUIAdapter: Boolean(adapters?.ui),
|
|
20
|
-
});
|
|
21
6
|
}
|
|
22
7
|
const _fallback = {
|
|
23
8
|
storage: {
|
|
@@ -42,25 +27,15 @@ const _fallback = {
|
|
|
42
27
|
},
|
|
43
28
|
};
|
|
44
29
|
function getPlatformAdapters() {
|
|
45
|
-
let lastRegisterInstanceId;
|
|
46
|
-
let lastRegisteredAt;
|
|
47
|
-
try {
|
|
48
|
-
lastRegisterInstanceId = globalThis.__NAMI_CORE_LAST_REGISTER_INSTANCE_ID;
|
|
49
|
-
lastRegisteredAt = globalThis.__NAMI_CORE_LAST_REGISTERED_AT;
|
|
50
|
-
}
|
|
51
|
-
catch {
|
|
52
|
-
// ignore
|
|
53
|
-
}
|
|
54
|
-
// Vega/Metro debugging: if you see different instanceIds across calls, core is loaded twice (CJS+ESM).
|
|
55
|
-
console.warn('[NamiCore] getPlatformAdapters', {
|
|
56
|
-
instanceId: __coreAdaptersInstanceId,
|
|
57
|
-
lastRegisterInstanceId,
|
|
58
|
-
lastRegisteredAt,
|
|
59
|
-
hasAdapters: Boolean(_adapters),
|
|
60
|
-
usingFallback: !_adapters,
|
|
61
|
-
});
|
|
62
30
|
return _adapters ?? _fallback;
|
|
63
31
|
}
|
|
32
|
+
let _purchaseAdapter = null;
|
|
33
|
+
function registerPurchaseAdapter(adapter) {
|
|
34
|
+
_purchaseAdapter = adapter;
|
|
35
|
+
}
|
|
36
|
+
function getPurchaseAdapter() {
|
|
37
|
+
return _purchaseAdapter;
|
|
38
|
+
}
|
|
64
39
|
|
|
65
40
|
/******************************************************************************
|
|
66
41
|
Copyright (c) Microsoft Corporation.
|
|
@@ -123,7 +98,7 @@ const {
|
|
|
123
98
|
// version — stamped by scripts/version.sh
|
|
124
99
|
NAMI_SDK_VERSION: exports.NAMI_SDK_VERSION = "3.4.0",
|
|
125
100
|
// full package version including dev suffix — stamped by scripts/version.sh
|
|
126
|
-
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.202604101712",
|
|
127
102
|
// environments
|
|
128
103
|
PRODUCTION: exports.PRODUCTION = "production", DEVELOPMENT: exports.DEVELOPMENT = "development",
|
|
129
104
|
// error messages
|
|
@@ -7049,10 +7024,7 @@ const hasGetRandomValues = typeof cryptoObj?.getRandomValues === 'function';
|
|
|
7049
7024
|
const FALLBACK_BASE = 16;
|
|
7050
7025
|
const FALLBACK_BASE_RECIPROCAL = 1 / FALLBACK_BASE;
|
|
7051
7026
|
const getDeviceData = (namiCommands) => {
|
|
7052
|
-
|
|
7053
|
-
const data = getPlatformAdapters().device.getDeviceData(namiCommands);
|
|
7054
|
-
console.log('[NamiCore] getDeviceData data', data);
|
|
7055
|
-
return data;
|
|
7027
|
+
return getPlatformAdapters().device.getDeviceData(namiCommands);
|
|
7056
7028
|
};
|
|
7057
7029
|
const getDeviceFormFactor = () => {
|
|
7058
7030
|
const config = storageService.getNamiConfig();
|
|
@@ -7976,7 +7948,7 @@ class CampaignRuleRepository {
|
|
|
7976
7948
|
}
|
|
7977
7949
|
// get campaign rules according to device's form_factor
|
|
7978
7950
|
campaignRules = campaignRules?.filter((cRule) => (cRule.paywall && cRule.form_factors.some((f) => f.form_factor === this.currentFormFactor)) ||
|
|
7979
|
-
(cRule.flow && cRule.
|
|
7951
|
+
(cRule.flow && cRule.form_factors?.some((f) => f.form_factor === this.currentFormFactor)));
|
|
7980
7952
|
// Keep only those campaign rules whose corresponding paywall is available
|
|
7981
7953
|
campaignRules = campaignRules?.filter((cRule) => {
|
|
7982
7954
|
if (cRule.paywall) {
|
|
@@ -8003,11 +7975,14 @@ class CampaignRuleRepository {
|
|
|
8003
7975
|
if (campaign.page_urls) {
|
|
8004
7976
|
urls.push(...Object.values(campaign.page_urls));
|
|
8005
7977
|
}
|
|
7978
|
+
if (campaign.flow?.page_urls) {
|
|
7979
|
+
urls.push(...Object.values(campaign.flow.page_urls));
|
|
7980
|
+
}
|
|
8006
7981
|
}
|
|
8007
7982
|
return urls;
|
|
8008
7983
|
}
|
|
8009
7984
|
static hasPaywallUrls(campaigns) {
|
|
8010
|
-
return campaigns.some((c) => c.paywall_url || c.page_urls);
|
|
7985
|
+
return campaigns.some((c) => c.paywall_url || c.page_urls || c.flow?.page_urls);
|
|
8011
7986
|
}
|
|
8012
7987
|
async fetchCampaignRulesRaw() {
|
|
8013
7988
|
const authDevice = storageService.getDevice();
|
|
@@ -8023,7 +7998,7 @@ class CampaignRuleRepository {
|
|
|
8023
7998
|
campaignRules = await this.getCampaigns(authDevice.id);
|
|
8024
7999
|
}
|
|
8025
8000
|
campaignRules = campaignRules?.filter((cRule) => (cRule.paywall && cRule.form_factors.some((f) => f.form_factor === this.currentFormFactor)) ||
|
|
8026
|
-
(cRule.flow && cRule.
|
|
8001
|
+
(cRule.flow && cRule.form_factors?.some((f) => f.form_factor === this.currentFormFactor)));
|
|
8027
8002
|
return campaignRules;
|
|
8028
8003
|
}
|
|
8029
8004
|
finalizeCampaignRules(campaignRules, paywalls) {
|
|
@@ -11701,6 +11676,24 @@ class NamiRefs {
|
|
|
11701
11676
|
const campaignRulesStartTime = Date.now();
|
|
11702
11677
|
const rawCampaigns = await campaignRepo.fetchCampaignRulesRaw();
|
|
11703
11678
|
const campaignRulesDuration = Date.now() - campaignRulesStartTime;
|
|
11679
|
+
// Hydrate flow objects: fetch flow JSON from flow.url for campaigns that
|
|
11680
|
+
// use the new URL-based format (3.4.0+) instead of inline flow.object
|
|
11681
|
+
await Promise.all(rawCampaigns
|
|
11682
|
+
.filter((c) => c.flow?.url && !c.flow.object)
|
|
11683
|
+
.map(async (c) => {
|
|
11684
|
+
try {
|
|
11685
|
+
const res = await fetch(c.flow.url, { cache: 'no-cache' });
|
|
11686
|
+
if (res.ok) {
|
|
11687
|
+
c.flow.object = await res.json();
|
|
11688
|
+
}
|
|
11689
|
+
else {
|
|
11690
|
+
logger.warn(`Failed to fetch flow object from ${c.flow.url}: ${res.status}`);
|
|
11691
|
+
}
|
|
11692
|
+
}
|
|
11693
|
+
catch (err) {
|
|
11694
|
+
logger.warn(`Error fetching flow object from ${c.flow.url}: ${err}`);
|
|
11695
|
+
}
|
|
11696
|
+
}));
|
|
11704
11697
|
const useIndividual = !campaignRepo.useLegacyPaywallFetch &&
|
|
11705
11698
|
CampaignRuleRepository.hasPaywallUrls(rawCampaigns);
|
|
11706
11699
|
let paywalls;
|
|
@@ -63866,6 +63859,7 @@ exports.getPlatformAdapters = getPlatformAdapters;
|
|
|
63866
63859
|
exports.getPriceDifference = getPriceDifference;
|
|
63867
63860
|
exports.getPricePerMonth = getPricePerMonth;
|
|
63868
63861
|
exports.getProductDetail = getProductDetail;
|
|
63862
|
+
exports.getPurchaseAdapter = getPurchaseAdapter;
|
|
63869
63863
|
exports.getReferenceSku = getReferenceSku;
|
|
63870
63864
|
exports.getSkuProductDetailKeys = getSkuProductDetailKeys;
|
|
63871
63865
|
exports.getSkuSmartTextValue = getSkuSmartTextValue;
|
|
@@ -63893,6 +63887,7 @@ exports.parseToSemver = parseToSemver;
|
|
|
63893
63887
|
exports.postConversion = postConversion;
|
|
63894
63888
|
exports.productDetail = productDetail;
|
|
63895
63889
|
exports.registerPlatformAdapters = registerPlatformAdapters;
|
|
63890
|
+
exports.registerPurchaseAdapter = registerPurchaseAdapter;
|
|
63896
63891
|
exports.selectSegment = selectSegment;
|
|
63897
63892
|
exports.setActiveNamiEntitlements = setActiveNamiEntitlements;
|
|
63898
63893
|
exports.shouldValidateProductGroups = shouldValidateProductGroups;
|
package/dist/index.d.ts
CHANGED
|
@@ -138,6 +138,8 @@ interface NamiFlowDTO {
|
|
|
138
138
|
flow_id?: string;
|
|
139
139
|
object_id?: string;
|
|
140
140
|
object?: NamiFlowObjectDTO;
|
|
141
|
+
url?: string;
|
|
142
|
+
page_urls?: Record<string, string>;
|
|
141
143
|
}
|
|
142
144
|
type NamiFlowWithObject = Omit<NamiFlowDTO, 'object'> & {
|
|
143
145
|
object: NamiFlowObjectDTO;
|
|
@@ -1785,6 +1787,29 @@ interface IUIAdapter {
|
|
|
1785
1787
|
postConfigure?(): void;
|
|
1786
1788
|
}
|
|
1787
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
|
+
|
|
1788
1813
|
interface IPlatformAdapters {
|
|
1789
1814
|
storage: IStorageAdapter;
|
|
1790
1815
|
device: IDeviceAdapter;
|
|
@@ -1792,6 +1817,8 @@ interface IPlatformAdapters {
|
|
|
1792
1817
|
}
|
|
1793
1818
|
declare function registerPlatformAdapters(adapters: IPlatformAdapters): void;
|
|
1794
1819
|
declare function getPlatformAdapters(): IPlatformAdapters;
|
|
1820
|
+
declare function registerPurchaseAdapter(adapter: IPurchaseAdapter): void;
|
|
1821
|
+
declare function getPurchaseAdapter(): IPurchaseAdapter | null;
|
|
1795
1822
|
|
|
1796
1823
|
declare class Nami {
|
|
1797
1824
|
#private;
|
|
@@ -2936,5 +2963,5 @@ declare const getBillingPeriodNumber: (billingPeriod: string) => number;
|
|
|
2936
2963
|
declare const formattedPrice: (price: number) => number;
|
|
2937
2964
|
declare function toDouble(num: number): number;
|
|
2938
2965
|
|
|
2939
|
-
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 };
|
|
2940
|
-
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 };
|
|
2966
|
+
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, 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 };
|
|
2967
|
+
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
|
@@ -1,21 +1,6 @@
|
|
|
1
1
|
let _adapters = null;
|
|
2
|
-
const __coreAdaptersInstanceId = Math.random().toString(16).slice(2);
|
|
3
2
|
function registerPlatformAdapters(adapters) {
|
|
4
3
|
_adapters = adapters;
|
|
5
|
-
try {
|
|
6
|
-
globalThis.__NAMI_CORE_LAST_REGISTER_INSTANCE_ID = __coreAdaptersInstanceId;
|
|
7
|
-
globalThis.__NAMI_CORE_LAST_REGISTERED_AT = Date.now();
|
|
8
|
-
}
|
|
9
|
-
catch {
|
|
10
|
-
// ignore
|
|
11
|
-
}
|
|
12
|
-
// Vega/Metro debugging: confirms which core module instance is registering adapters.
|
|
13
|
-
console.warn('[NamiCore] registerPlatformAdapters', {
|
|
14
|
-
instanceId: __coreAdaptersInstanceId,
|
|
15
|
-
hasDeviceAdapter: Boolean(adapters?.device),
|
|
16
|
-
hasStorageAdapter: Boolean(adapters?.storage),
|
|
17
|
-
hasUIAdapter: Boolean(adapters?.ui),
|
|
18
|
-
});
|
|
19
4
|
}
|
|
20
5
|
const _fallback = {
|
|
21
6
|
storage: {
|
|
@@ -40,25 +25,15 @@ const _fallback = {
|
|
|
40
25
|
},
|
|
41
26
|
};
|
|
42
27
|
function getPlatformAdapters() {
|
|
43
|
-
let lastRegisterInstanceId;
|
|
44
|
-
let lastRegisteredAt;
|
|
45
|
-
try {
|
|
46
|
-
lastRegisterInstanceId = globalThis.__NAMI_CORE_LAST_REGISTER_INSTANCE_ID;
|
|
47
|
-
lastRegisteredAt = globalThis.__NAMI_CORE_LAST_REGISTERED_AT;
|
|
48
|
-
}
|
|
49
|
-
catch {
|
|
50
|
-
// ignore
|
|
51
|
-
}
|
|
52
|
-
// Vega/Metro debugging: if you see different instanceIds across calls, core is loaded twice (CJS+ESM).
|
|
53
|
-
console.warn('[NamiCore] getPlatformAdapters', {
|
|
54
|
-
instanceId: __coreAdaptersInstanceId,
|
|
55
|
-
lastRegisterInstanceId,
|
|
56
|
-
lastRegisteredAt,
|
|
57
|
-
hasAdapters: Boolean(_adapters),
|
|
58
|
-
usingFallback: !_adapters,
|
|
59
|
-
});
|
|
60
28
|
return _adapters ?? _fallback;
|
|
61
29
|
}
|
|
30
|
+
let _purchaseAdapter = null;
|
|
31
|
+
function registerPurchaseAdapter(adapter) {
|
|
32
|
+
_purchaseAdapter = adapter;
|
|
33
|
+
}
|
|
34
|
+
function getPurchaseAdapter() {
|
|
35
|
+
return _purchaseAdapter;
|
|
36
|
+
}
|
|
62
37
|
|
|
63
38
|
/******************************************************************************
|
|
64
39
|
Copyright (c) Microsoft Corporation.
|
|
@@ -121,7 +96,7 @@ const {
|
|
|
121
96
|
// version — stamped by scripts/version.sh
|
|
122
97
|
NAMI_SDK_VERSION = "3.4.0",
|
|
123
98
|
// full package version including dev suffix — stamped by scripts/version.sh
|
|
124
|
-
NAMI_SDK_PACKAGE_VERSION = "3.4.0-dev.
|
|
99
|
+
NAMI_SDK_PACKAGE_VERSION = "3.4.0-dev.202604101712",
|
|
125
100
|
// environments
|
|
126
101
|
PRODUCTION = "production", DEVELOPMENT = "development",
|
|
127
102
|
// error messages
|
|
@@ -7047,10 +7022,7 @@ const hasGetRandomValues = typeof cryptoObj?.getRandomValues === 'function';
|
|
|
7047
7022
|
const FALLBACK_BASE = 16;
|
|
7048
7023
|
const FALLBACK_BASE_RECIPROCAL = 1 / FALLBACK_BASE;
|
|
7049
7024
|
const getDeviceData = (namiCommands) => {
|
|
7050
|
-
|
|
7051
|
-
const data = getPlatformAdapters().device.getDeviceData(namiCommands);
|
|
7052
|
-
console.log('[NamiCore] getDeviceData data', data);
|
|
7053
|
-
return data;
|
|
7025
|
+
return getPlatformAdapters().device.getDeviceData(namiCommands);
|
|
7054
7026
|
};
|
|
7055
7027
|
const getDeviceFormFactor = () => {
|
|
7056
7028
|
const config = storageService.getNamiConfig();
|
|
@@ -7974,7 +7946,7 @@ class CampaignRuleRepository {
|
|
|
7974
7946
|
}
|
|
7975
7947
|
// get campaign rules according to device's form_factor
|
|
7976
7948
|
campaignRules = campaignRules?.filter((cRule) => (cRule.paywall && cRule.form_factors.some((f) => f.form_factor === this.currentFormFactor)) ||
|
|
7977
|
-
(cRule.flow && cRule.
|
|
7949
|
+
(cRule.flow && cRule.form_factors?.some((f) => f.form_factor === this.currentFormFactor)));
|
|
7978
7950
|
// Keep only those campaign rules whose corresponding paywall is available
|
|
7979
7951
|
campaignRules = campaignRules?.filter((cRule) => {
|
|
7980
7952
|
if (cRule.paywall) {
|
|
@@ -8001,11 +7973,14 @@ class CampaignRuleRepository {
|
|
|
8001
7973
|
if (campaign.page_urls) {
|
|
8002
7974
|
urls.push(...Object.values(campaign.page_urls));
|
|
8003
7975
|
}
|
|
7976
|
+
if (campaign.flow?.page_urls) {
|
|
7977
|
+
urls.push(...Object.values(campaign.flow.page_urls));
|
|
7978
|
+
}
|
|
8004
7979
|
}
|
|
8005
7980
|
return urls;
|
|
8006
7981
|
}
|
|
8007
7982
|
static hasPaywallUrls(campaigns) {
|
|
8008
|
-
return campaigns.some((c) => c.paywall_url || c.page_urls);
|
|
7983
|
+
return campaigns.some((c) => c.paywall_url || c.page_urls || c.flow?.page_urls);
|
|
8009
7984
|
}
|
|
8010
7985
|
async fetchCampaignRulesRaw() {
|
|
8011
7986
|
const authDevice = storageService.getDevice();
|
|
@@ -8021,7 +7996,7 @@ class CampaignRuleRepository {
|
|
|
8021
7996
|
campaignRules = await this.getCampaigns(authDevice.id);
|
|
8022
7997
|
}
|
|
8023
7998
|
campaignRules = campaignRules?.filter((cRule) => (cRule.paywall && cRule.form_factors.some((f) => f.form_factor === this.currentFormFactor)) ||
|
|
8024
|
-
(cRule.flow && cRule.
|
|
7999
|
+
(cRule.flow && cRule.form_factors?.some((f) => f.form_factor === this.currentFormFactor)));
|
|
8025
8000
|
return campaignRules;
|
|
8026
8001
|
}
|
|
8027
8002
|
finalizeCampaignRules(campaignRules, paywalls) {
|
|
@@ -11699,6 +11674,24 @@ class NamiRefs {
|
|
|
11699
11674
|
const campaignRulesStartTime = Date.now();
|
|
11700
11675
|
const rawCampaigns = await campaignRepo.fetchCampaignRulesRaw();
|
|
11701
11676
|
const campaignRulesDuration = Date.now() - campaignRulesStartTime;
|
|
11677
|
+
// Hydrate flow objects: fetch flow JSON from flow.url for campaigns that
|
|
11678
|
+
// use the new URL-based format (3.4.0+) instead of inline flow.object
|
|
11679
|
+
await Promise.all(rawCampaigns
|
|
11680
|
+
.filter((c) => c.flow?.url && !c.flow.object)
|
|
11681
|
+
.map(async (c) => {
|
|
11682
|
+
try {
|
|
11683
|
+
const res = await fetch(c.flow.url, { cache: 'no-cache' });
|
|
11684
|
+
if (res.ok) {
|
|
11685
|
+
c.flow.object = await res.json();
|
|
11686
|
+
}
|
|
11687
|
+
else {
|
|
11688
|
+
logger.warn(`Failed to fetch flow object from ${c.flow.url}: ${res.status}`);
|
|
11689
|
+
}
|
|
11690
|
+
}
|
|
11691
|
+
catch (err) {
|
|
11692
|
+
logger.warn(`Error fetching flow object from ${c.flow.url}: ${err}`);
|
|
11693
|
+
}
|
|
11694
|
+
}));
|
|
11702
11695
|
const useIndividual = !campaignRepo.useLegacyPaywallFetch &&
|
|
11703
11696
|
CampaignRuleRepository.hasPaywallUrls(rawCampaigns);
|
|
11704
11697
|
let paywalls;
|
|
@@ -63769,4 +63762,4 @@ function namiBuySKU(skuRefId) {
|
|
|
63769
63762
|
return result;
|
|
63770
63763
|
}
|
|
63771
63764
|
|
|
63772
|
-
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 };
|
|
63765
|
+
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, 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.202604101712",
|
|
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",
|