@namiml/web-sdk 1.7.4-beta.1 → 1.7.5
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/CHANGELOG.md +21 -0
- package/README.md +15 -25
- package/dist/components/NamiElement.d.ts +9 -3
- package/dist/components/PaywallScreen.d.ts +1 -1
- package/dist/components/containers/CarouselContainer.d.ts +1 -1
- package/dist/components/containers/CollapseContainer.d.ts +1 -1
- package/dist/components/containers/Container.d.ts +5 -0
- package/dist/components/elements/Button.d.ts +1 -1
- package/dist/components/elements/ProgressIndicator.d.ts +19 -0
- package/dist/components/elements/QRCode.d.ts +1 -1
- package/dist/components/elements/RadioButton.d.ts +1 -1
- package/dist/components/elements/SegmentPicker.d.ts +1 -1
- package/dist/components/elements/SegmentPickerItem.d.ts +1 -1
- package/dist/components/elements/ToggleSwitch.d.ts +1 -1
- package/dist/components/index.d.ts +3 -1
- package/dist/legacy-support.cjs +28196 -0
- package/dist/legacy-support.d.ts +2 -0
- package/dist/legacy-support.mjs +28194 -0
- package/dist/nami/flow/NamiFlowManager.d.ts +23 -0
- package/dist/nami/namiRefs.d.ts +5 -0
- package/dist/nami-web.cjs +31 -21
- package/dist/nami-web.mjs +31 -21
- package/dist/nami-web.umd.js +47 -37
- package/dist/polyfills.cjs +688 -159
- package/dist/polyfills.js +688 -159
- package/dist/repositories/device.repository.d.ts +3 -2
- package/dist/types/components/elements.d.ts +13 -0
- package/dist/types/components/index.d.ts +2 -2
- package/dist/types/device.d.ts +1 -1
- package/dist/utils/anonymousMode.d.ts +19 -0
- package/dist/utils/const.d.ts +1 -1
- package/dist/utils/parsers.d.ts +17 -0
- package/package.json +11 -7
- package/dist/nami-web-legacy.d.ts +0 -10
- package/dist/nami-web.legacy.cjs +0 -236
- package/dist/nami-web.legacy.mjs +0 -236
- package/dist/nami-web.legacy.umd.js +0 -236
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Device, DevicePayload } from "../types/device";
|
|
2
|
+
import { INamiRefsInstance } from "../utils/anonymousMode";
|
|
2
3
|
export declare class DeviceRepository {
|
|
3
4
|
static instance: DeviceRepository;
|
|
4
|
-
createOrUpdateDevice(deviceData: DevicePayload, splitPositionUUID?: string): {
|
|
5
|
+
createOrUpdateDevice(deviceData: DevicePayload, splitPositionUUID?: string, namiRefs?: INamiRefsInstance): {
|
|
5
6
|
id: string;
|
|
6
7
|
device: Promise<Device | null>;
|
|
7
8
|
};
|
|
8
|
-
createDevice(deviceData: DevicePayload): Promise<Device | null>;
|
|
9
|
+
createDevice(deviceData: DevicePayload, namiRefs?: INamiRefsInstance): Promise<Device | null>;
|
|
9
10
|
updateDevice(currentDeviceId: string, deviceData: DevicePayload): Promise<Device | null>;
|
|
10
11
|
updateDeviceField<T>(key: string, value: T): Promise<Device | null>;
|
|
11
12
|
private requestAPIData;
|
|
@@ -96,3 +96,16 @@ export type TQRCodeComponent = TBaseComponent & {
|
|
|
96
96
|
borderWidth?: number;
|
|
97
97
|
borderColor?: string;
|
|
98
98
|
};
|
|
99
|
+
export type TProgressIndicatorComponent = TBaseComponent & {
|
|
100
|
+
component: "progressIndicator";
|
|
101
|
+
activeBorderRadius?: number;
|
|
102
|
+
activeFillColor?: string;
|
|
103
|
+
activeFillColorFallback?: string;
|
|
104
|
+
inactiveBorderRadius?: number;
|
|
105
|
+
inactiveFillColor?: string;
|
|
106
|
+
inactiveFillColorFallback?: string;
|
|
107
|
+
percentage?: "auto" | number;
|
|
108
|
+
innerPadding?: number;
|
|
109
|
+
activeDropShadow?: string;
|
|
110
|
+
inactiveDropShadow?: string;
|
|
111
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NamiAnimationSpec } from "./animation";
|
|
2
2
|
import { TButtonContainer, TCarouselContainer, TCarouselSlide, TCollapseContainer, TFlexProductContainer, TPlayPauseButton, TProductContainer, TRadioButton, TResponsiveGrid, TStack, TToggleSwitch, TVolumeButton, UserAction } from "./containers";
|
|
3
|
-
import { TConditionalComponent, TImageComponent, TQRCodeComponent, TSegmentPicker, TSegmentPickerItem, TSpacerComponent, TSvgImageComponent, TSymbolComponent, TTextComponent, TTextListComponent, TVideoComponent } from "./elements";
|
|
3
|
+
import { TConditionalComponent, TImageComponent, TProgressIndicatorComponent, TQRCodeComponent, TSegmentPicker, TSegmentPickerItem, TSpacerComponent, TSvgImageComponent, TSymbolComponent, TTextComponent, TTextListComponent, TVideoComponent } from "./elements";
|
|
4
4
|
export interface TBaseComponent {
|
|
5
5
|
id?: string;
|
|
6
6
|
title?: string;
|
|
@@ -71,7 +71,7 @@ export interface TBaseComponent {
|
|
|
71
71
|
hidden?: boolean;
|
|
72
72
|
animation?: NamiAnimationSpec;
|
|
73
73
|
}
|
|
74
|
-
export type TComponent = TButtonContainer | TContainer | TTextListComponent | TTextComponent | TSpacerComponent | TImageComponent | TSvgImageComponent | TSymbolComponent | TCarouselContainer | TProductContainer | TFlexProductContainer | TStack | TConditionalComponent | TSegmentPicker | TSegmentPickerItem | TVideoComponent | TCollapseContainer | TResponsiveGrid | TVolumeButton | TPlayPauseButton | TQRCodeComponent | TToggleSwitch | TRadioButton;
|
|
74
|
+
export type TComponent = TButtonContainer | TContainer | TTextListComponent | TTextComponent | TSpacerComponent | TImageComponent | TSvgImageComponent | TSymbolComponent | TCarouselContainer | TProductContainer | TFlexProductContainer | TStack | TConditionalComponent | TSegmentPicker | TSegmentPickerItem | TVideoComponent | TCollapseContainer | TResponsiveGrid | TVolumeButton | TPlayPauseButton | TQRCodeComponent | TToggleSwitch | TRadioButton | TProgressIndicatorComponent;
|
|
75
75
|
export type DirectionType = "vertical" | "horizontal";
|
|
76
76
|
export type AlignmentType = "center" | "right" | "left" | "top" | "bottom";
|
|
77
77
|
export type BorderLocationType = "upperLeft" | "upperRight" | "lowerLeft" | "lowerRight";
|
package/dist/types/device.d.ts
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface for NamiRefs instance to maintain type safety
|
|
3
|
+
* Only includes methods needed by utilities that depend on NamiRefs
|
|
4
|
+
*/
|
|
5
|
+
export interface INamiRefsInstance {
|
|
6
|
+
isInMemoryAnonymousMode(): boolean;
|
|
7
|
+
setInMemoryAnonymousMode(enabled: boolean): void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Set the NamiRefs instance to avoid circular dependency issues
|
|
11
|
+
* Called from namiRefs.ts during initialization
|
|
12
|
+
*/
|
|
13
|
+
export declare function setNamiRefsInstance(instance: INamiRefsInstance): void;
|
|
14
|
+
/**
|
|
15
|
+
* Utility function to check anonymous mode status
|
|
16
|
+
* Checks both persistent (storage) and in-memory flags
|
|
17
|
+
* @returns true if device is in anonymous mode (either persistent or temporary)
|
|
18
|
+
*/
|
|
19
|
+
export declare function isAnonymousMode(): boolean;
|
package/dist/utils/const.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const NAMI_SDK_VERSION: string, PRODUCTION: string, DEVELOPMENT: string, PLATFORM_ID_REQUIRED: string, DEVICE_ID_REQUIRED: string, EXTERNAL_ID_REQUIRED: string, SDK_NOT_INITIALIZED: string, CAMPAIGN_NOT_AVAILABLE: string, FLOW_SCREENS_NOT_AVAILABLE: string, UNABLE_TO_UPDATE_CDP_ID: string, ANONYMOUS_MODE_ALREADY_ON: string, ANONYMOUS_MODE_ALREADY_OFF: string, ANONYMOUS_MODE_LOGIN_NOT_ALLOWED: string, SESSION_REQUIRED: string, DEVICE_ID_NOT_SET: string, AUTH_DEVICE: string, NAMI_CONFIGURATION: string, NAMI_PROFILE: string, API_CONFIG: string, API_CAMPAIGN_RULES: string, API_PAYWALLS: string, API_PRODUCTS: string, API_ACTIVE_ENTITLEMENTS: string, SERVER_NAMI_ENTITLEMENTS: string, INITIAL_APP_CONFIG: string, INITIAL_CAMPAIGN_RULES: string, INITIAL_PAYWALLS: string, INITIAL_PRODUCTS: string, LOCAL_NAMI_ENTITLEMENTS: string, CUSTOMER_ATTRIBUTES_KEY_PREFIX: string, NAMI_CUSTOMER_JOURNEY_STATE: string, ANONYMOUS_MODE: string, ANONYMOUS_UUID: string, KEY_SESSION_COUNTER: string, INITIAL_SESSION_COUNTER_VALUE: number, NAMI_LAST_IMPRESSION_ID: string, NAMI_PURCHASE_IMPRESSION_ID: string, NAMI_LAUNCH_ID: string, NAMI_SESSION_ID: string, NAMI_LANGUAGE_CODE: string, NAMI_PURCHASE_CHANNEL: string, API_VERSION:
|
|
1
|
+
export declare const NAMI_SDK_VERSION: string, PRODUCTION: string, DEVELOPMENT: string, PLATFORM_ID_REQUIRED: string, DEVICE_ID_REQUIRED: string, EXTERNAL_ID_REQUIRED: string, SDK_NOT_INITIALIZED: string, CAMPAIGN_NOT_AVAILABLE: string, FLOW_SCREENS_NOT_AVAILABLE: string, UNABLE_TO_UPDATE_CDP_ID: string, ANONYMOUS_MODE_ALREADY_ON: string, ANONYMOUS_MODE_ALREADY_OFF: string, ANONYMOUS_MODE_LOGIN_NOT_ALLOWED: string, SESSION_REQUIRED: string, DEVICE_ID_NOT_SET: string, AUTH_DEVICE: string, NAMI_CONFIGURATION: string, NAMI_PROFILE: string, API_CONFIG: string, API_CAMPAIGN_RULES: string, API_PAYWALLS: string, API_PRODUCTS: string, API_ACTIVE_ENTITLEMENTS: string, SERVER_NAMI_ENTITLEMENTS: string, INITIAL_APP_CONFIG: string, INITIAL_CAMPAIGN_RULES: string, INITIAL_PAYWALLS: string, INITIAL_PRODUCTS: string, LOCAL_NAMI_ENTITLEMENTS: string, CUSTOMER_ATTRIBUTES_KEY_PREFIX: string, NAMI_CUSTOMER_JOURNEY_STATE: string, ANONYMOUS_MODE: string, ANONYMOUS_UUID: string, KEY_SESSION_COUNTER: string, INITIAL_SESSION_COUNTER_VALUE: number, NAMI_LAST_IMPRESSION_ID: string, NAMI_PURCHASE_IMPRESSION_ID: string, NAMI_LAUNCH_ID: string, NAMI_SESSION_ID: string, NAMI_LANGUAGE_CODE: string, NAMI_PURCHASE_CHANNEL: string, API_VERSION: any, BASE_URL_PATH: string, BASE_URL: string, BASE_STAGING_URL: string, CUSTOM_HOST_PREFIX: string, USE_STAGING_API: string, EXTENDED_CLIENT_INFO_PREFIX: string, EXTENDED_CLIENT_INFO_DELIMITER: string, VALIDATE_PRODUCT_GROUPS: string, EXTENDED_PLATFORM: string, EXTENDED_PLATFORM_VERSION: string, API_MAX_CALLS_LIMIT: number, API_RETRY_DELAY_SEC: number, API_TIMEOUT_LIMIT: number, DEVICE_API_TIMEOUT_LIMIT: number, STATUS_SUCCESS: number, STATUS_BAD_REQUEST: number, STATUS_NOT_FOUND: number, STATUS_CONFLICT: number, STATUS_INTERNAL_SERVER_ERROR: number, INITIAL_SUCCESS: string, RECONFIG_SUCCESS: string, ALREADY_CONFIGURED: string, AVAILABLE_CAMPAIGNS_CHANGED: string, PAYWALL_ACTION_EVENT: string, AVAILABLE_ACTIVE_ENTITLEMENTS_CHANGED: string, CUSTOMER_JOURNEY_STATE_CHANGED: string, SKU_TEXT_REGEX: RegExp, VAR_REGEX: RegExp, HTML_REGEX: RegExp, SMART_TEXT_PATTERN: string;
|
package/dist/utils/parsers.d.ts
CHANGED
|
@@ -7,3 +7,20 @@ export type TSemverObj = {
|
|
|
7
7
|
buildmetadata: string;
|
|
8
8
|
};
|
|
9
9
|
export declare function parseToSemver(versionString: string): TSemverObj;
|
|
10
|
+
/**
|
|
11
|
+
* Compares two semantic versions
|
|
12
|
+
* @returns 1 if current > minimum, 0 if equal, -1 if current < minimum
|
|
13
|
+
*/
|
|
14
|
+
export declare function compareSemver(current: TSemverObj, minimum: TSemverObj): number;
|
|
15
|
+
/**
|
|
16
|
+
* Checks if current SDK version meets minimum requirement
|
|
17
|
+
* @returns true if current version >= minimum version
|
|
18
|
+
*/
|
|
19
|
+
export declare function isVersionSupported(current: TSemverObj, minimum: TSemverObj): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Validates if the current SDK version meets the minimum required version for a component
|
|
22
|
+
* Logs a warning if the SDK version is insufficient
|
|
23
|
+
* @param minSDKVersion - The minimum SDK version required for the component
|
|
24
|
+
* @param componentName - The name of the component
|
|
25
|
+
*/
|
|
26
|
+
export declare function validateMinSDKVersion(minSDKVersion: TSemverObj | undefined, componentName: string): void;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@namiml/web-sdk",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.7.
|
|
4
|
+
"version": "1.7.5",
|
|
5
5
|
"source": "src/nami-web.ts",
|
|
6
6
|
"description": "Nami Web SDK makes subscriptions & in-app purchases easy, with powerful built-in paywalls and A/B testing",
|
|
7
7
|
"scripts": {
|
|
@@ -34,12 +34,11 @@
|
|
|
34
34
|
"umd": "./dist/nami-web.umd.js",
|
|
35
35
|
"default": "./dist/nami-web.mjs"
|
|
36
36
|
},
|
|
37
|
-
"./legacy": {
|
|
38
|
-
"types": "./dist/
|
|
39
|
-
"import": "./dist/
|
|
40
|
-
"require": "./dist/
|
|
41
|
-
"
|
|
42
|
-
"default": "./dist/nami-web.legacy.mjs"
|
|
37
|
+
"./legacy-support": {
|
|
38
|
+
"types": "./dist/legacy-support.d.ts",
|
|
39
|
+
"import": "./dist/legacy-support.mjs",
|
|
40
|
+
"require": "./dist/legacy-support.cjs",
|
|
41
|
+
"default": "./dist/legacy-support.mjs"
|
|
43
42
|
},
|
|
44
43
|
"./polyfills": {
|
|
45
44
|
"import": "./dist/polyfills.js",
|
|
@@ -135,6 +134,11 @@
|
|
|
135
134
|
"type": "git",
|
|
136
135
|
"url": "https://github.com/namiml/nami-web-sdk.git"
|
|
137
136
|
},
|
|
137
|
+
"sideEffects": [
|
|
138
|
+
"dist/polyfills.js",
|
|
139
|
+
"dist/legacy-support.mjs",
|
|
140
|
+
"dist/legacy-support.cjs"
|
|
141
|
+
],
|
|
138
142
|
"resolutions": {
|
|
139
143
|
"@esm-bundle/chai": "4.3.4-fix.0"
|
|
140
144
|
},
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import "./polyfills";
|
|
2
|
-
import "./shims/globalThis";
|
|
3
|
-
import "./shims/getAttributeNames";
|
|
4
|
-
export { Nami } from "./nami";
|
|
5
|
-
export { NamiCampaignManager } from "./nami/campaign";
|
|
6
|
-
export { NamiCustomerManager } from "./nami/customer";
|
|
7
|
-
export { NamiPaywallManager } from "./nami/paywalls";
|
|
8
|
-
export { NamiEntitlementManager } from "./nami/entitlement";
|
|
9
|
-
export * from "./types/externals";
|
|
10
|
-
import "./components";
|