@namiml/web-sdk 3.4.0-dev.202604010118 → 3.4.0-dev.202604170506

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.
Files changed (135) hide show
  1. package/dist/adapters/index.d.ts +1 -0
  2. package/dist/adapters/web-device.adapter.d.ts +14 -0
  3. package/dist/adapters/web-storage.adapter.d.ts +8 -0
  4. package/dist/adapters/web-ui.adapter.d.ts +9 -0
  5. package/dist/components/ContextConsumer.d.ts +1 -1
  6. package/dist/components/ContextProvider.d.ts +32 -87
  7. package/dist/components/NamiElement.d.ts +1 -1
  8. package/dist/components/Paywall.d.ts +1 -5
  9. package/dist/components/PaywallScreen.d.ts +2 -4
  10. package/dist/components/TemplateComponent.d.ts +2 -2
  11. package/dist/components/containers/BackgroundContainer.d.ts +1 -2
  12. package/dist/components/containers/CarouselContainer.d.ts +3 -3
  13. package/dist/components/containers/CollapseContainer.d.ts +3 -3
  14. package/dist/components/containers/Container.d.ts +3 -3
  15. package/dist/components/containers/Content.d.ts +1 -2
  16. package/dist/components/containers/Footer.d.ts +2 -2
  17. package/dist/components/containers/Header.d.ts +2 -2
  18. package/dist/components/containers/ProductContainer.d.ts +2 -2
  19. package/dist/components/containers/RepeatingGrid.d.ts +1 -2
  20. package/dist/components/containers/ResponsiveGrid.d.ts +2 -2
  21. package/dist/components/elements/Button.d.ts +3 -3
  22. package/dist/components/elements/CountdownTimerText.d.ts +2 -3
  23. package/dist/components/elements/Image.d.ts +1 -1
  24. package/dist/components/elements/PlayPauseButton.d.ts +2 -2
  25. package/dist/components/elements/ProgressBar.d.ts +2 -2
  26. package/dist/components/elements/ProgressIndicator.d.ts +2 -2
  27. package/dist/components/elements/QRCode.d.ts +2 -2
  28. package/dist/components/elements/RadioButton.d.ts +2 -2
  29. package/dist/components/elements/SegmentPicker.d.ts +3 -3
  30. package/dist/components/elements/SegmentPickerItem.d.ts +2 -2
  31. package/dist/components/elements/Spacer.d.ts +2 -2
  32. package/dist/components/elements/Stack.d.ts +2 -2
  33. package/dist/components/elements/Text.d.ts +2 -2
  34. package/dist/components/elements/ToggleButton.d.ts +2 -2
  35. package/dist/components/elements/ToggleSwitch.d.ts +2 -2
  36. package/dist/components/elements/Video.d.ts +1 -1
  37. package/dist/components/elements/VolumeButton.d.ts +2 -2
  38. package/dist/components/productDetails.d.ts +1 -1
  39. package/dist/components/utils/actionTap.d.ts +1 -1
  40. package/dist/components/utils/helpers.d.ts +5 -5
  41. package/dist/components/utils/impression.d.ts +2 -2
  42. package/dist/components/utils/products.d.ts +1 -2
  43. package/dist/components/utils/state.d.ts +4 -4
  44. package/dist/components/utils/styles.d.ts +12 -4
  45. package/dist/legacy-support.cjs +213 -25528
  46. package/dist/legacy-support.d.ts +48 -1
  47. package/dist/legacy-support.mjs +213 -25528
  48. package/dist/nami-web.cjs +26 -26
  49. package/dist/nami-web.d.ts +606 -10
  50. package/dist/nami-web.mjs +26 -26
  51. package/dist/nami-web.umd.js +91 -91
  52. package/dist/polyfills.cjs +50 -25519
  53. package/dist/polyfills.js +50 -25519
  54. package/dist/translations/translate.d.ts +1 -6
  55. package/dist/types/externals/campaign.d.ts +2 -62
  56. package/dist/types/externals/config.d.ts +1 -41
  57. package/dist/types/externals/customer.d.ts +1 -18
  58. package/dist/types/externals/entitlement.d.ts +1 -38
  59. package/dist/types/externals/errors.d.ts +1 -12
  60. package/dist/types/externals/flow.d.ts +2 -51
  61. package/dist/types/externals/languages.d.ts +1 -197
  62. package/dist/types/externals/loglevel.d.ts +2 -10
  63. package/dist/types/externals/paywall.d.ts +2 -109
  64. package/dist/types/externals/product.d.ts +1 -32
  65. package/dist/types/externals/purchase.d.ts +1 -42
  66. package/dist/types/externals/sku.d.ts +1 -31
  67. package/dist/utils/animations.d.ts +1 -1
  68. package/dist/utils/fonts.d.ts +1 -1
  69. package/package.json +35 -51
  70. package/dist/core/errors.d.ts +0 -55
  71. package/dist/core/withRetry.d.ts +0 -2
  72. package/dist/decorators/index.d.ts +0 -2
  73. package/dist/nami/api.d.ts +0 -20
  74. package/dist/nami/campaign.d.ts +0 -87
  75. package/dist/nami/customer.d.ts +0 -136
  76. package/dist/nami/emitter.d.ts +0 -13
  77. package/dist/nami/entitlement.d.ts +0 -46
  78. package/dist/nami/flow/NamiFlow.d.ts +0 -77
  79. package/dist/nami/flow/NamiFlowManager.d.ts +0 -77
  80. package/dist/nami/index.d.ts +0 -19
  81. package/dist/nami/namiRefs.d.ts +0 -17
  82. package/dist/nami/paywalls.d.ts +0 -77
  83. package/dist/nami/profile.d.ts +0 -12
  84. package/dist/nami/purchase.d.ts +0 -9
  85. package/dist/nami/utils/campaign.d.ts +0 -29
  86. package/dist/nami/utils/entitlement.d.ts +0 -55
  87. package/dist/nami/utils/index.d.ts +0 -1
  88. package/dist/nami/utils/paywall.d.ts +0 -21
  89. package/dist/nami/utils/purchase.d.ts +0 -4
  90. package/dist/nami/utils/resolvers/BaseNamespaceResolver.d.ts +0 -7
  91. package/dist/nami/utils/resolvers/ConditionalEvaluator.d.ts +0 -19
  92. package/dist/nami/utils/resolvers/DeviceResolver.d.ts +0 -10
  93. package/dist/nami/utils/resolvers/FlowLiquidResolver.d.ts +0 -19
  94. package/dist/nami/utils/resolvers/FormStateResolver.d.ts +0 -7
  95. package/dist/nami/utils/resolvers/LaunchContextResolver.d.ts +0 -8
  96. package/dist/nami/utils/resolvers/PlacementLabelResolver.d.ts +0 -8
  97. package/dist/nami/utils/resolvers/URLParamsResolver.d.ts +0 -7
  98. package/dist/repositories/campaignRule.repository.d.ts +0 -21
  99. package/dist/repositories/config.repository.d.ts +0 -5
  100. package/dist/repositories/customerJourney.repository.d.ts +0 -5
  101. package/dist/repositories/device.repository.d.ts +0 -16
  102. package/dist/repositories/entitlement.repository.d.ts +0 -11
  103. package/dist/repositories/paywall.repository.d.ts +0 -10
  104. package/dist/repositories/products.repository.d.ts +0 -6
  105. package/dist/services/logger.service.d.ts +0 -13
  106. package/dist/services/session.service.d.ts +0 -4
  107. package/dist/services/storage.service.d.ts +0 -90
  108. package/dist/types/api.d.ts +0 -30
  109. package/dist/types/campaign.d.ts +0 -16
  110. package/dist/types/components/animation.d.ts +0 -40
  111. package/dist/types/components/containers.d.ts +0 -182
  112. package/dist/types/components/elements.d.ts +0 -188
  113. package/dist/types/components/index.d.ts +0 -137
  114. package/dist/types/conditions.d.ts +0 -26
  115. package/dist/types/config.d.ts +0 -38
  116. package/dist/types/customer.d.ts +0 -2
  117. package/dist/types/device.d.ts +0 -36
  118. package/dist/types/entitlements.d.ts +0 -21
  119. package/dist/types/flow.d.ts +0 -108
  120. package/dist/types/paywall.d.ts +0 -201
  121. package/dist/types/products.d.ts +0 -6
  122. package/dist/types/profile.d.ts +0 -21
  123. package/dist/types/purchase.d.ts +0 -32
  124. package/dist/types/sku.d.ts +0 -26
  125. package/dist/types/utils.d.ts +0 -1
  126. package/dist/utils/anonymousMode.d.ts +0 -25
  127. package/dist/utils/config.d.ts +0 -10
  128. package/dist/utils/const.d.ts +0 -1
  129. package/dist/utils/device.d.ts +0 -10
  130. package/dist/utils/events.d.ts +0 -30
  131. package/dist/utils/feature-flags.d.ts +0 -1
  132. package/dist/utils/helpers.d.ts +0 -1
  133. package/dist/utils/parsers.d.ts +0 -26
  134. package/dist/utils/simple-event-target.d.ts +0 -7
  135. package/dist/utils/url-params.d.ts +0 -11
@@ -1,77 +0,0 @@
1
- import { type NamiFlowEventHandler, type NamiFlowHandoffStepHandler } from "../../types/flow";
2
- import { NamiFlow } from "./NamiFlow";
3
- import type { NamiFlowCampaign } from '../../types/externals/campaign';
4
- import { NamiPaywallLaunchContext } from '../../types/externals/paywall';
5
- import { PaywallComponent } from "../../components/Paywall";
6
- export declare class NamiFlowManager {
7
- private static _instance;
8
- static get instance(): NamiFlowManager;
9
- currentFlow?: NamiFlow;
10
- flowOpen: boolean;
11
- private lastAnimatedFlowProgress;
12
- private navGraphCache;
13
- private constructor();
14
- handoffStepHandler?: NamiFlowHandoffStepHandler;
15
- static registerStepHandoff(handoffStepHandler?: NamiFlowHandoffStepHandler): void;
16
- eventHandler?: NamiFlowEventHandler;
17
- static registerEventHandler(eventHandler: NamiFlowEventHandler): void;
18
- static resume(): void;
19
- resume(): void;
20
- static finish(): void;
21
- static pause(): void;
22
- static isFlowOpen(): boolean;
23
- presentFlow(campaign: NamiFlowCampaign, paywall: PaywallComponent, context?: NamiPaywallLaunchContext): NamiFlow;
24
- finishFlow(): void;
25
- /**
26
- * Gets the last animated progress for a component by ID
27
- * @param key Component ID
28
- * @returns Last animated progress value (0-1), or 0 if not found
29
- */
30
- getLastAnimatedFlowProgress(key: string): number;
31
- /**
32
- * Sets the last animated progress for a component by ID
33
- * Only stores if there's an active flow
34
- * @param key Component ID
35
- * @param value Progress value (0-1)
36
- */
37
- setLastAnimatedFlowProgress(key: string, value: number): void;
38
- /**
39
- * Gets the current flow progress based on screen steps
40
- * @param key Component ID (for compatibility)
41
- * @returns Progress as a percentage (0-1)
42
- */
43
- getCurrentFlowProgress(key?: string): number;
44
- /**
45
- * Find the first screen that has branching (multiple forward navigation targets)
46
- */
47
- private findBranchPoint;
48
- /**
49
- * Calculate progress for flows with branching (supports 2+ branches)
50
- */
51
- private calculateBranchingProgress;
52
- /**
53
- * Count how many screens are forward-reachable from the current step
54
- * Only counts screens with higher indices (true forward navigation)
55
- */
56
- private countForwardScreens;
57
- /**
58
- * Checks if a screen has branching navigation (2 or more forward targets)
59
- * Supports any number of branches: 2, 3, 4, etc.
60
- */
61
- private hasBranching;
62
- /**
63
- * Build navigation graph from flow steps
64
- * Maps each step ID to its possible navigation targets
65
- */
66
- private buildNavGraph;
67
- static getLastAnimatedFlowProgress(key: string): number;
68
- static setLastAnimatedFlowProgress(key: string, value: number): void;
69
- static getCurrentFlowProgress(key?: string): number;
70
- /**
71
- * Gets the current flow step's auto-advance delay (in seconds)
72
- * Parses __appear__ actions to find flowNav/flowNext with a delay parameter
73
- * @returns Delay in seconds, or null if not auto-advancing
74
- */
75
- getCurrentFlowStepAutoAdvanceDelay(): number | null;
76
- static getCurrentFlowStepAutoAdvanceDelay(): number | null;
77
- }
@@ -1,19 +0,0 @@
1
- import { NamiConfigurationState } from "../types/config";
2
- import { NamiConfiguration } from "../types/externals/config";
3
- export declare class Nami {
4
- #private;
5
- static instance: Nami;
6
- maxLogging: boolean;
7
- get isInitialized(): boolean;
8
- static sdkVersion(): string;
9
- static sdkPackageVersion(): string;
10
- /**
11
- * Configures and initializes the SDK.
12
- * This method must be called as the first thing before interacting with the SDK.
13
- * @param with A [NamiConfiguration] object with required values
14
- * @returns {Promise<NamiConfigurationState>}
15
- */
16
- static configure(options: NamiConfiguration): Promise<NamiConfigurationState>;
17
- private static setInitialConfig;
18
- private initializeSDK;
19
- }
@@ -1,17 +0,0 @@
1
- import { NamiConfiguration } from "../types/externals/config";
2
- import { NamiCampaign } from "../types/externals/campaign";
3
- export declare class NamiRefs {
4
- static instance: NamiRefs;
5
- private inMemoryAnonymousMode;
6
- constructor();
7
- setInMemoryAnonymousMode(enabled: boolean): void;
8
- isInMemoryAnonymousMode(): boolean;
9
- isAnonymousMode(): boolean;
10
- init(config: NamiConfiguration): Promise<void>;
11
- private setInitialValues;
12
- private initAnonymousDevice;
13
- private initIdentifiedDevice;
14
- private initAndFetchRequiredData;
15
- fetchCampaignsAndPaywalls(): Promise<NamiCampaign[]>;
16
- private reRenderPaywall;
17
- }
@@ -1,77 +0,0 @@
1
- import { IPaywall } from "../types/paywall";
2
- import { NamiProductDetails } from "../types/externals/product";
3
- import { NamiEventEmitter } from "./emitter";
4
- import { Callback, CloseHandler, DeepLinkUrlHandler, SKUActionHandler } from "../types/components/containers";
5
- import { NamiPurchaseDetails } from "../types/externals/purchase";
6
- /**
7
- * @class NamiPaywallManager
8
- * Provides methods for managing all aspects of a paywall in the Nami SDK.
9
- */
10
- export declare class NamiPaywallManager {
11
- static instance: NamiPaywallManager;
12
- static emitter: NamiEventEmitter;
13
- private emitter;
14
- productDetails: NamiProductDetails[];
15
- /**
16
- * @returns {IPaywall[]} a list of Paywall
17
- */
18
- static allPaywalls(): IPaywall[];
19
- /**
20
- * Used to set product details when store products are unavailable. For advanced use cases only.
21
- */
22
- static setProductDetails(productDetails: NamiProductDetails[]): void;
23
- /**
24
- * Register a callback which would be invoked when user will sign-in
25
- */
26
- static registerSignInHandler(handler: Callback): Callback;
27
- /**
28
- * Register a callback which would be invoked when user close a paywall raised by Nami system
29
- */
30
- static registerCloseHandler(handler: CloseHandler): Callback;
31
- /**
32
- * Register a callback which would be invoked when user will take action on deeplink
33
- */
34
- static registerDeeplinkActionHandler(handler: DeepLinkUrlHandler): Callback;
35
- /**
36
- * Register a [NamiBuySkuHandler] which would be invoked when a user triggers
37
- * a buy sku action on a paywall.
38
- *
39
- * Only available for plans where Nami is not handling subscription & IAP management.
40
- */
41
- static registerBuySkuHandler(handler: SKUActionHandler): Callback;
42
- /**
43
- * Register a callback which would be invoked when user restore a product
44
- */
45
- static registerRestoreHandler(handler: Callback): Callback;
46
- /**
47
- * Notify the NamiPaywallManager that a purchase initiated from the
48
- * [NamiBuySkuHandler] is complete.
49
- *
50
- * Only available for plans where Nami is not handling subscription & IAP management.
51
- *
52
- * @returns {Promise<void>} A Promise that resolves when buying SKU will be complete.
53
- */
54
- static buySkuComplete(purchase: NamiPurchaseDetails): Promise<void>;
55
- /**
56
- * Notify the NamiPaywallManager that purchase flow handled by you is cancelled.
57
- * Used to disable product purchase-in-progress loading indicators
58
- */
59
- static buySkuCancel(): void;
60
- /**
61
- * Set the video details for the app supplied video
62
- * @param url The URL of the video
63
- * @param name The name of the video
64
- */
65
- static setAppSuppliedVideoDetails(url: string, name?: string): void;
66
- /**
67
- * Enables or disables user interaction on Nami paywalls.
68
- *
69
- * @param {boolean} allowed - Whether user interaction should be allowed.
70
- * @returns {void}
71
- */
72
- static allowUserInteraction(allowed: boolean): void;
73
- /**
74
- * Private Instance Methods
75
- */
76
- private get sdkInitialized();
77
- }
@@ -1,12 +0,0 @@
1
- export declare class NamiProfileManager {
2
- static instance: NamiProfileManager;
3
- private externalId?;
4
- constructor();
5
- setExternalId(externalId: string | undefined): NamiProfileManager;
6
- getExternalId(): string | undefined;
7
- isLoggedIn(): boolean;
8
- private save;
9
- private load;
10
- login(externalId: string): Promise<void>;
11
- logout(): Promise<void>;
12
- }
@@ -1,9 +0,0 @@
1
- import { NamiPurchase } from "../types/externals/purchase";
2
- /**
3
- * @class NamiPurchaseManager
4
- * Provides methods for managing all aspects of a purchase in the Nami SDK.
5
- */
6
- export declare class NamiPurchaseManager {
7
- static instance: NamiPurchaseManager;
8
- static allPurchases(): NamiPurchase[];
9
- }
@@ -1,29 +0,0 @@
1
- import { NamiAnonymousCampaign, NamiCampaign, NamiCampaignSegment } from "../../types/externals/campaign";
2
- import { IPaywall } from "../../types/paywall";
3
- import type { TDevice } from '../../types/device';
4
- export declare const isValidUrl: (label: string) => boolean;
5
- export declare const selectSegment: (segments: NamiCampaignSegment[], splitPosition: number) => NamiCampaignSegment;
6
- export declare const mapAnonymousCampaigns: (campaigns: NamiAnonymousCampaign[], splitPosition: number, formFactor?: TDevice) => NamiCampaign[];
7
- /**
8
- *
9
- * @returns A combined list of unique campaigns based on both API and Initial, filtered by form factor.
10
- * This is used to get all campaigns that are applicable to the current device.
11
- *
12
- * Note: Since this function returns a unique list of campaigns, and API campaigns take precedence,
13
- * there may be times when API campaigns are returned that do not yet have paywalls but initial campaigns would.
14
- */
15
- export declare const allCampaigns: () => NamiCampaign[];
16
- export declare const getInitialCampaigns: () => NamiCampaign[];
17
- export declare const getApiCampaigns: () => NamiCampaign[];
18
- /**
19
- * Get paywall data from label. This function continues to search for both the campaign and paywall
20
- * based on the provided label and type. It first checks API data, then falls back to initial data.
21
- *
22
- * @param value Campaign label to search for
23
- * @param type Campaign type to filter by
24
- * @returns An object containing the currently available campaign and paywall data
25
- */
26
- export declare const getPaywallDataFromLabel: (value: string, type?: string) => {
27
- campaign: NamiCampaign | undefined;
28
- paywall: IPaywall | undefined;
29
- };
@@ -1,55 +0,0 @@
1
- import { IEntitlements, NamiEntitlement } from "../../types/entitlements";
2
- import { NamiPurchase } from "../../types/externals/purchase";
3
- import { PaywallSKU, SKU } from "../../types/sku";
4
- import { NamiSKU } from "../../types/externals/sku";
5
- export declare class EntitlementUtils {
6
- static instance: EntitlementUtils;
7
- refIdToPurchasedSKUs: {
8
- [key: string]: NamiSKU[];
9
- };
10
- refIdToRelatedSKUs: {
11
- [key: string]: NamiSKU[];
12
- };
13
- refIdToActivePurchases: {
14
- [key: string]: NamiPurchase[];
15
- };
16
- }
17
- export declare const toNamiEntitlements: (entitlement: IEntitlements) => NamiEntitlement;
18
- export declare const setActiveNamiEntitlements: (entitlements: NamiEntitlement[]) => void;
19
- export declare const activeEntitlements: () => NamiEntitlement[];
20
- export declare const invokeHandler: () => void;
21
- export declare const getEntitlementRefIdsForSku: (purchasedSkuId: string) => string[];
22
- /**
23
- * Populate a list of [NamiEntitlement] from the entitlements that have been provided by the
24
- * app config. Also clears any previous list of [NamiEntitlement] from cache
25
- */
26
- export declare const createNamiEntitlements: (entitlements?: IEntitlements[]) => NamiEntitlement[];
27
- /**
28
- * For namiPurchase instance, it will have a purchasedSKU that will back the activation of
29
- * the entitlement.
30
- *
31
- * The purchaseSku (pSKU) can then be used to retrieve all entitlements activated by that pSKU
32
- *
33
- * The entitlement will then be inspected to see if pSKU has yet to be tracked by that
34
- * entitlement. If it has not, then it will be added.
35
- *
36
- * The entitlement will then be inspected to see if there any active purchases that match
37
- * the NamiSKU. If there isn't any, then the NamiPurchase is then added to the
38
- * entitlement's list of active purchases
39
- */
40
- export declare const applyEntitlementActivation: (namiPurchase: NamiPurchase) => string[];
41
- /**
42
- * Using the Nami Purchase object, look up the corresponding NamiSKU
43
- * and set the NamiEntitlement associated to NamiSKU as an active entitlement
44
- *
45
- * @return List of strings where each string is a reference Id of an entitlement
46
- * that was just successfully activated
47
- */
48
- export declare const activateEntitlementByPurchase: (purchase: NamiPurchase) => string[];
49
- export declare const skuMapFromEntitlements: (entitlements?: IEntitlements[]) => {
50
- [key: string]: NamiSKU[];
51
- };
52
- export declare const updateRelatedSKUsForNamiEntitlement: (entitlementRefId: string, entitlementRefIdToNamiSkus: {
53
- [key: string]: NamiSKU[];
54
- }) => void;
55
- export declare function toNamiSKU(sku: PaywallSKU | SKU): NamiSKU;
@@ -1 +0,0 @@
1
- export declare function isEqual(objA: any, objB: any): boolean;
@@ -1,21 +0,0 @@
1
- import { IPaywall } from "../../types/paywall";
2
- /**
3
- * Get initial paywalls from storage service.
4
- * @returns An array of initial paywalls from storage service.
5
- */
6
- export declare const getInitialPaywalls: () => IPaywall[];
7
- /**
8
- * Get all API paywalls from storage service.
9
- * @returns An array of API paywalls from storage service.
10
- */
11
- export declare const getApiPaywalls: () => IPaywall[];
12
- /**
13
- * Get all paywalls from both API and Initial sources, ensuring uniqueness.
14
- * This function combines paywalls from both sources and filters out duplicates.
15
- * API Data takes precedence over Initial Data.
16
- *
17
- * @returns A combined list of unique paywalls based on both API and Initial data.
18
- */
19
- export declare const allPaywalls: () => IPaywall[];
20
- export declare const getPaywall: (paywallId: string) => IPaywall | undefined;
21
- export declare const hasAllPaywalls: (paywallIds: string[]) => boolean;
@@ -1,4 +0,0 @@
1
- import { NamiPurchaseCompleteResult } from "../../types/purchase";
2
- import { NamiPurchaseDetails, NamiPurchase } from "../../types/externals/purchase";
3
- export declare function toNamiPurchase(purchase: NamiPurchaseDetails): NamiPurchase;
4
- export declare function namiBuySKU(skuRefId: string): NamiPurchaseCompleteResult | undefined;
@@ -1,7 +0,0 @@
1
- export declare abstract class BaseNamespaceResolver {
2
- protected abstract readonly namespace: string;
3
- protected abstract resolveValue(path: string): any;
4
- constructor();
5
- protected register(): void;
6
- protected resolveKeyPath(keyPath: string, target: any): any;
7
- }
@@ -1,19 +0,0 @@
1
- import { NamiConditions } from "../../../types/conditions";
2
- type Resolver = (identifier: string) => any;
3
- export declare class NamiConditionEvaluator {
4
- private static instance;
5
- private resolvers;
6
- private namespaceResolvers;
7
- private constructor();
8
- static get shared(): NamiConditionEvaluator;
9
- registerNamespaceResolver(namespace: string, resolver: Resolver): void;
10
- resetResolvers(): void;
11
- evaluate(conditions: NamiConditions): boolean;
12
- evaluateOrdered(conditions?: NamiConditions): boolean;
13
- private evaluateFilter;
14
- private resolve;
15
- private resolveRaw;
16
- private extractProperty;
17
- private log;
18
- }
19
- export {};
@@ -1,10 +0,0 @@
1
- import { BaseNamespaceResolver } from "./BaseNamespaceResolver";
2
- export declare class DeviceResolver extends BaseNamespaceResolver {
3
- protected readonly namespace = "Device";
4
- private readonly context;
5
- constructor();
6
- private screenSizeTier;
7
- private tvQuality;
8
- private tvResolution;
9
- protected resolveValue(keyPath: string): any;
10
- }
@@ -1,19 +0,0 @@
1
- import type { NamiFlowManager } from "../../../nami/flow/NamiFlowManager";
2
- /**
3
- * Resolver for liquid-style flow variables, without requiring namespace prefixes.
4
- * We drop BaseNamespaceResolver since we don't need namespace registration or stripping.
5
- */
6
- export declare class FlowLiquidResolver {
7
- flowManager: NamiFlowManager;
8
- urlParams: Record<string, string>;
9
- constructor(flowManager: NamiFlowManager);
10
- resolve(key: string): string | undefined;
11
- /**
12
- * Replaces {{key}} in a string using FlowLiquidResolver.
13
- */
14
- private interpolateLiquidVariables;
15
- /**
16
- * Deeply interpolates strings in objects/arrays without any namespace logic.
17
- */
18
- interpolateDeep(input: any): any;
19
- }
@@ -1,7 +0,0 @@
1
- import { BaseNamespaceResolver } from "./BaseNamespaceResolver";
2
- export declare class FormStateResolver extends BaseNamespaceResolver {
3
- protected readonly namespace = "state";
4
- private getContextProvider;
5
- constructor();
6
- protected resolveValue(keyPath: string): any;
7
- }
@@ -1,8 +0,0 @@
1
- import { NamiPaywallLaunchContext } from "../../../nami-web";
2
- import { BaseNamespaceResolver } from "./BaseNamespaceResolver";
3
- export declare class LaunchContextResolver extends BaseNamespaceResolver {
4
- protected readonly namespace = "LaunchContext";
5
- private context;
6
- constructor(context: NamiPaywallLaunchContext);
7
- protected resolveValue(keyPath: string): any;
8
- }
@@ -1,8 +0,0 @@
1
- import { BaseNamespaceResolver } from "./BaseNamespaceResolver";
2
- import type { NamiCampaign } from "../../../types/externals/campaign";
3
- export declare class PlacementLabelResolver extends BaseNamespaceResolver {
4
- protected readonly namespace = "Placement";
5
- private campaign?;
6
- constructor(campaign?: NamiCampaign);
7
- protected resolveValue(keyPath: string): any;
8
- }
@@ -1,7 +0,0 @@
1
- import { BaseNamespaceResolver } from "./BaseNamespaceResolver";
2
- export declare class URLParamsResolver extends BaseNamespaceResolver {
3
- protected readonly namespace = "urlParams";
4
- private readonly context;
5
- constructor();
6
- protected resolveValue(keyPath: string): any;
7
- }
@@ -1,21 +0,0 @@
1
- import { IPaywall } from "../types/paywall";
2
- import { TDevice } from "../types/device";
3
- import { NamiCampaign } from "../types/externals/campaign";
4
- export declare class CampaignRuleRepository {
5
- currentFormFactor: TDevice;
6
- splitPosition: number;
7
- disableCampaignUpdates: boolean;
8
- useLegacyPaywallFetch: boolean;
9
- static instance: CampaignRuleRepository;
10
- constructor();
11
- configure(formFactor: TDevice, splitPosition: number, namiCommands?: string[]): void;
12
- fetchCampaignRules(paywalls: IPaywall[]): Promise<NamiCampaign[]>;
13
- static extractPaywallUrls(campaigns: NamiCampaign[]): string[];
14
- static hasPaywallUrls(campaigns: NamiCampaign[]): boolean;
15
- fetchCampaignRulesRaw(): Promise<NamiCampaign[]>;
16
- finalizeCampaignRules(campaignRules: NamiCampaign[], paywalls: IPaywall[]): NamiCampaign[];
17
- invokeAvailableCampaignsResponseHandler(): void;
18
- private getAnonymousCampaigns;
19
- private getCampaigns;
20
- private fallbackData;
21
- }
@@ -1,5 +0,0 @@
1
- import { IConfig } from "../types/config";
2
- export declare class ConfigRepository {
3
- static instance: ConfigRepository;
4
- fetchConfig(): Promise<IConfig | null>;
5
- }
@@ -1,5 +0,0 @@
1
- import { CustomerJourneyState } from "../types/externals/customer";
2
- export declare class CustomerJourneyRepository {
3
- static instance: CustomerJourneyRepository;
4
- fetchCustomerJourneyState(): Promise<CustomerJourneyState | null>;
5
- }
@@ -1,16 +0,0 @@
1
- import { Device, DevicePayload } from "../types/device";
2
- import { INamiRefsInstance } from "../utils/anonymousMode";
3
- export declare class DeviceRepository {
4
- static instance: DeviceRepository;
5
- createOrUpdateDevice(deviceData: DevicePayload, splitPositionUUID?: string, namiRefs?: INamiRefsInstance): {
6
- id: string;
7
- device: Promise<Device | null> | null;
8
- };
9
- createDevice(deviceData: DevicePayload, namiRefs?: INamiRefsInstance): Promise<Device | null>;
10
- updateDevice(currentDeviceId: string, deviceData: DevicePayload): Promise<Device | null>;
11
- updateDeviceField<T>(key: string, value: T): Promise<Device | null>;
12
- private requestAPIData;
13
- private isEqualDevices;
14
- getOrCreateAnonymousUUID(): string;
15
- private getAnonymousUUID;
16
- }
@@ -1,11 +0,0 @@
1
- import { IEntitlements } from "../types/entitlements";
2
- export declare class EntitlementRepository {
3
- static instance: EntitlementRepository;
4
- constructor();
5
- /**
6
- * Just fetch [ActiveEntitlement] from API and save it in localstorage.
7
- */
8
- fetchActiveEntitlements(): Promise<IEntitlements[] | null>;
9
- private getAPIEntitlements;
10
- private invokeActiveEntitlementsHandler;
11
- }
@@ -1,10 +0,0 @@
1
- import { IPaywall } from "../types/paywall";
2
- export declare class PaywallRepository {
3
- static instance: PaywallRepository;
4
- fetchPaywalls(): Promise<IPaywall[]>;
5
- private getAnonymousPaywalls;
6
- private getPaywalls;
7
- fetchPaywallByUrl(url: string): Promise<IPaywall>;
8
- fetchPaywallsByUrls(urls: string[]): Promise<IPaywall[]>;
9
- private fallbackData;
10
- }
@@ -1,6 +0,0 @@
1
- import { SKU } from "../types/sku";
2
- export declare class ProductRepository {
3
- static instance: ProductRepository;
4
- fetchProducts(): Promise<SKU[]>;
5
- private fallbackData;
6
- }
@@ -1,13 +0,0 @@
1
- import { NamiLogLevel } from "../types/externals/loglevel";
2
- declare class Logger {
3
- private currentLogLevel;
4
- setLogger: (level?: NamiLogLevel) => void;
5
- debug<T>(message: T, ...args: unknown[]): void;
6
- info<T>(message: T, ...args: unknown[]): void;
7
- warn<T>(message: T, ...args: unknown[]): void;
8
- error<T>(message: T, ...args: unknown[]): void;
9
- private shouldLog;
10
- private formatMessage;
11
- }
12
- export declare const logger: Logger;
13
- export {};
@@ -1,4 +0,0 @@
1
- export declare class SessionService {
2
- static instance: SessionService;
3
- startSession(): Promise<void>;
4
- }
@@ -1,90 +0,0 @@
1
- import { Device } from "../types/device";
2
- import { IConfig } from "../types/config";
3
- import { NamiConfiguration } from "../types/externals/config";
4
- import { IPaywall } from "../types/paywall";
5
- import { NamiCampaign } from "../types/externals/campaign";
6
- import { NamiProfile } from "../types/profile";
7
- import { IEntitlements, NamiEntitlement } from "../types/entitlements";
8
- import { SKU } from "../types/sku";
9
- import { CustomerJourneyState } from "../types/externals/customer";
10
- export declare class StorageService {
11
- private memoryStore;
12
- setDevice(device: Device): void;
13
- getDevice(): Device | null;
14
- resetDevice(): void;
15
- getAnonymousMode(): boolean;
16
- setAnonymousMode(mode: boolean): void;
17
- clearAnonymousMode(): void;
18
- setAppConfig(key: string, config: IConfig): void;
19
- getAppConfig(key: string): IConfig | null;
20
- setLanguageCode(code?: string): void;
21
- getLanguageCode(): string;
22
- setCampaignRules(key: string, campaignRules: NamiCampaign[]): void;
23
- getCampaignRules(key: string): NamiCampaign[] | null;
24
- setPaywalls(key: string, paywalls: IPaywall[]): void;
25
- getPaywalls(key: string): IPaywall[] | null;
26
- setActiveEntitlements(key: string, entitlements: IEntitlements[]): void;
27
- getActiveEntitlements(key: string): IEntitlements[];
28
- setNamiEntitlements(key: string, entitlements: NamiEntitlement[]): void;
29
- getNamiEntitlements(key: string): NamiEntitlement[];
30
- setProducts(key: string, products: SKU[]): void;
31
- getProducts(key: string): SKU[] | null;
32
- getCachedProducts(): SKU[] | null;
33
- setNamiConfig(config: Omit<NamiConfiguration, "initialConfig">): void;
34
- getNamiConfig(): Omit<NamiConfiguration, "initialConfig"> | null;
35
- setCustomerAttribute<T>(attribute: string, value: T): void;
36
- getCustomerAttribute<T>(attribute: string): T | null;
37
- getAllCustomerAttributes(): string[];
38
- getAllCustomerAttributesKeys(): string[];
39
- clearCustomerAttribute(attribute: string): boolean;
40
- clearAllCustomerAttributes(): void;
41
- setNamiProfile(profileData: NamiProfile): void;
42
- getNamiProfile(): NamiProfile | null;
43
- removeNamiProfile(): void;
44
- setCustomerJourneyState(state: CustomerJourneyState): void;
45
- getCustomerJourneyState(): CustomerJourneyState | null;
46
- setSessionCounter(): void;
47
- getSessionCounter(): number;
48
- setLastImpressionId(id: string): void;
49
- getLastImpressionId(): string;
50
- setPurchaseImpression(): void;
51
- getPurchaseImpression(): string;
52
- setSessionId(id?: string): void;
53
- getSessionId(): string;
54
- clearSessionId(): void;
55
- setLaunchId(id?: string): void;
56
- getLaunchId(): string;
57
- clearLaunchId(): void;
58
- setPurchaseChannel(channel?: string): void;
59
- getPurchaseChannel(): string | null;
60
- getAnonymousUUID(): string | null;
61
- setAnonymousUUID(uuid: string): void;
62
- clearAnonymousUUID(): void;
63
- setApiCampaignSessionTimestamp(): void;
64
- getApiCampaignSessionTimestamp(): number | null;
65
- purgeApiCampaignCache(): void;
66
- private getCampaignCacheTtl;
67
- private isLegacyTimestampedCache;
68
- /**
69
- * Set an item in localStorage.
70
- * @param {string} key - The key under which to store the data.
71
- * @param {T} value - The data to store.
72
- */
73
- private setItem;
74
- /**
75
- * Get an item from localStorage.
76
- * @param {string} key - The key of the item to retrieve.
77
- * @returns {T | null} The stored data, or null if not found.
78
- */
79
- private getItem;
80
- /**
81
- * Remove an item from localStorage.
82
- * @param {string} key - The key of the item to remove.
83
- */
84
- private resetItem;
85
- /**
86
- * Clear all items from localStorage.
87
- */
88
- clear(): void;
89
- }
90
- export declare const storageService: StorageService;