@namiml/web-sdk 1.6.0 → 1.6.2
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 +20 -0
- package/dist/components/ContextProvider.d.ts +1 -1
- package/dist/components/Paywall.d.ts +1 -1
- package/dist/components/elements/QRCode.d.ts +9 -0
- package/dist/components/index.d.ts +3 -1
- package/dist/components/utils/actionTap.d.ts +1 -0
- package/dist/components/utils/state.d.ts +1 -1
- package/dist/components/utils/styles.d.ts +1 -1
- package/dist/core/errors.d.ts +10 -4
- package/dist/nami/api.d.ts +2 -2
- package/dist/nami/customer.d.ts +1 -0
- package/dist/nami/flow/NamiFlow.d.ts +12 -7
- package/dist/nami/flow/NamiFlowManager.d.ts +6 -4
- package/dist/nami/index.d.ts +1 -0
- package/dist/nami/utils/campaign.d.ts +4 -1
- package/dist/nami/utils/resolvers/ConditionalEvaluator.d.ts +1 -1
- package/dist/nami/utils/resolvers/FlowLiquidResolver.d.ts +1 -1
- package/dist/nami/utils/resolvers/LaunchContextResolver.d.ts +1 -1
- package/dist/nami-web.cjs +18 -18
- package/dist/nami-web.js +13 -13
- package/dist/nami-web.mjs +13 -13
- package/dist/nami-web.umd.js +18 -18
- package/dist/repositories/campaignRule.repository.d.ts +1 -0
- package/dist/repositories/customerJourney.repository.d.ts +1 -1
- package/dist/repositories/device.repository.d.ts +2 -0
- package/dist/services/storage.service.d.ts +3 -0
- package/dist/services/video.service.d.ts +1 -1
- package/dist/types/components/elements.d.ts +11 -0
- package/dist/types/components/index.d.ts +2 -2
- package/dist/types/config.d.ts +6 -2
- package/dist/types/device.d.ts +1 -0
- package/dist/types/externals/campaign.d.ts +25 -0
- package/dist/types/externals/config.d.ts +2 -11
- package/dist/types/externals/flow.d.ts +12 -0
- package/dist/types/flow.d.ts +1 -1
- package/dist/types/paywall.d.ts +1 -1
- package/dist/types/sku.d.ts +4 -0
- package/dist/utils/config.d.ts +3 -1
- package/dist/utils/const.d.ts +1 -1
- package/dist/utils/device.d.ts +2 -0
- package/package.json +7 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.6.2 (July 28, 2025)
|
|
4
|
+
|
|
5
|
+
### New Features
|
|
6
|
+
- **Nami.sdkVersion** - Method to get the internal SDK version
|
|
7
|
+
- Added support for QR Code components
|
|
8
|
+
- On Device Segment Selection for A/B testing
|
|
9
|
+
- Support Base64, Gzipped Initial Configurations
|
|
10
|
+
- Support Fully Uppercase Text Components
|
|
11
|
+
|
|
12
|
+
### Enhancements
|
|
13
|
+
- Paywall actions will now trigger if no flow action for a button is defined
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
- Dynamic widths on Responsive Grid components
|
|
17
|
+
|
|
18
|
+
## 1.6.1 (July 13, 2025)
|
|
19
|
+
|
|
20
|
+
### Improvements
|
|
21
|
+
- Fix type exports in declaration files
|
|
22
|
+
|
|
3
23
|
## 1.6.0 (July 10, 2025)
|
|
4
24
|
|
|
5
25
|
### New Features
|
|
@@ -5,7 +5,7 @@ import { NamiSKU } from '../types/externals/sku';
|
|
|
5
5
|
import { NamiCampaign } from '../types/externals/campaign';
|
|
6
6
|
import { TDevice } from '../types/device';
|
|
7
7
|
import { Callback } from '../types/components/containers';
|
|
8
|
-
import type { NamiFlow } from '
|
|
8
|
+
import type { NamiFlow } from '../nami/flow/NamiFlow';
|
|
9
9
|
export declare const initialState: TPaywallContext;
|
|
10
10
|
declare class ContextProvider extends EventTarget implements ReactiveController {
|
|
11
11
|
host: ReactiveControllerHost | null;
|
|
@@ -3,7 +3,7 @@ import { NamiElement } from './NamiElement';
|
|
|
3
3
|
import { PropertyValues, TemplateResult } from 'lit';
|
|
4
4
|
import { NamiCampaign } from '../types/externals/campaign';
|
|
5
5
|
import { NamiPaywallEvent } from '../types/externals/paywall';
|
|
6
|
-
import type { NamiFlow } from '
|
|
6
|
+
import type { NamiFlow } from '../nami/flow/NamiFlow';
|
|
7
7
|
declare class PaywallComponent extends NamiElement {
|
|
8
8
|
campaign: NamiCampaign | undefined;
|
|
9
9
|
paywall: IPaywall | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NamiElement } from "../NamiElement";
|
|
2
|
+
import { TQRCodeComponent } from "../../types/components/elements";
|
|
3
|
+
export declare class NamiQRCode extends NamiElement {
|
|
4
|
+
component: TQRCodeComponent;
|
|
5
|
+
protected styles(): import("lit").CSSResult;
|
|
6
|
+
private renderQr;
|
|
7
|
+
firstUpdated(): void;
|
|
8
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
9
|
+
}
|
|
@@ -17,6 +17,7 @@ import { NamiCarouselContainer } from "./containers/CarouselContainer";
|
|
|
17
17
|
import { NamiVolumeButton } from "./elements/VolumeButton";
|
|
18
18
|
import { NamiPlayPauseButton } from "./elements/PlayPauseButton";
|
|
19
19
|
import { NamiStack } from "./elements/Stack";
|
|
20
|
+
import { NamiQRCode } from "./elements/QRCode";
|
|
20
21
|
declare global {
|
|
21
22
|
interface HTMLElementTagNameMap {
|
|
22
23
|
"nami-spacer": NamiSpacer;
|
|
@@ -39,6 +40,7 @@ declare global {
|
|
|
39
40
|
"nami-volume-button": NamiVolumeButton;
|
|
40
41
|
"nami-play-pause-button": NamiPlayPauseButton;
|
|
41
42
|
"nami-stack": NamiStack;
|
|
43
|
+
"nami-qr-code": NamiQRCode;
|
|
42
44
|
}
|
|
43
45
|
}
|
|
44
|
-
export { NamiSpacer, NamiButton, NamiHeader, NamiFooter, NamiText, NamiSegmentPicker, NamiSegmentPickerItem, NamiContainer, NamiProductContainer, NamiImage, NamiBackgroundContainer, NamiContentContainer, NamiSymbol, NamiVideo, NamiCollapseContainer, NamiResponsiveGrid, NamiCarouselContainer, NamiPlayPauseButton, NamiVolumeButton, NamiStack };
|
|
46
|
+
export { NamiSpacer, NamiButton, NamiHeader, NamiFooter, NamiText, NamiSegmentPicker, NamiSegmentPickerItem, NamiContainer, NamiProductContainer, NamiImage, NamiBackgroundContainer, NamiContentContainer, NamiSymbol, NamiVideo, NamiCollapseContainer, NamiResponsiveGrid, NamiCarouselContainer, NamiPlayPauseButton, NamiVolumeButton, NamiStack, NamiQRCode, };
|
|
@@ -15,3 +15,4 @@ export declare const setState: () => {
|
|
|
15
15
|
export declare const selectSKU: (sku: NamiSKU) => void;
|
|
16
16
|
export declare const purchaseSelectedSKU: (sku: NamiSKU) => void;
|
|
17
17
|
export declare const reloadProducts: () => void;
|
|
18
|
+
export declare function shouldHoist(onTap?: UserAction): boolean;
|
|
@@ -2,7 +2,7 @@ import { ISkuMenu, TInitialState } from "../../types/paywall";
|
|
|
2
2
|
import { NamiProductDetails } from "../../types/externals/product";
|
|
3
3
|
import { PaywallSKU } from "../../types/sku";
|
|
4
4
|
import { NamiPaywallLaunchContext } from "../../nami-web";
|
|
5
|
-
import { TCarouselSlide } from "
|
|
5
|
+
import { TCarouselSlide } from "../../types/components/containers";
|
|
6
6
|
export declare function currentSku(productDetails: NamiProductDetails[], initialState: TInitialState, skuMenus: ISkuMenu[], skus: PaywallSKU[]): {
|
|
7
7
|
[key: string]: any;
|
|
8
8
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TCarouselContainer } from "
|
|
1
|
+
import { TCarouselContainer } from "../../types/components/containers";
|
|
2
2
|
import { TBaseComponent, TContainerPosition } from "../../types/components";
|
|
3
3
|
import { TSegmentPickerItem, TTextLikeComponent } from "../../types/components/elements";
|
|
4
4
|
export declare function parseSize(value: string | number, scaleFactor: number): string;
|
package/dist/core/errors.d.ts
CHANGED
|
@@ -3,6 +3,12 @@ export declare class RetryLimitExceededError extends Error {
|
|
|
3
3
|
status: number;
|
|
4
4
|
constructor(statusCode: number, message: string);
|
|
5
5
|
}
|
|
6
|
+
export declare class APIError extends Error {
|
|
7
|
+
}
|
|
8
|
+
export declare class ConflictError extends APIError {
|
|
9
|
+
status: number;
|
|
10
|
+
constructor();
|
|
11
|
+
}
|
|
6
12
|
export declare class SDKNotInitializedError extends Error {
|
|
7
13
|
constructor();
|
|
8
14
|
}
|
|
@@ -33,17 +39,17 @@ export declare class AnonymousLoginError extends Error {
|
|
|
33
39
|
export declare class AnonymousCDPError extends Error {
|
|
34
40
|
constructor();
|
|
35
41
|
}
|
|
36
|
-
export declare class BadRequestError extends
|
|
42
|
+
export declare class BadRequestError extends APIError {
|
|
37
43
|
constructor(message: string);
|
|
38
44
|
}
|
|
39
|
-
export declare class NotFoundError extends
|
|
45
|
+
export declare class NotFoundError extends APIError {
|
|
40
46
|
constructor(message: string);
|
|
41
47
|
}
|
|
42
|
-
export declare class ClientError extends
|
|
48
|
+
export declare class ClientError extends APIError {
|
|
43
49
|
statusCode: number;
|
|
44
50
|
constructor(statusCode: number, message: string);
|
|
45
51
|
}
|
|
46
|
-
export declare class InternalServerError extends
|
|
52
|
+
export declare class InternalServerError extends APIError {
|
|
47
53
|
constructor(message: string);
|
|
48
54
|
}
|
|
49
55
|
export declare const handleErrors: (status: number, path: string) => void;
|
package/dist/nami/api.d.ts
CHANGED
|
@@ -15,6 +15,6 @@ export declare class NamiAPI {
|
|
|
15
15
|
postImpression(options: Impression): Promise<void>;
|
|
16
16
|
postConversion(options: TransactionRequest): Promise<void>;
|
|
17
17
|
purchaseValidation(options: PurchaseValidationRequest): Promise<void>;
|
|
18
|
-
fetchAPI<T>(path: string): Promise<T>;
|
|
19
|
-
requestBodyAPI<T, U>(path: string, bodyData: T, method?: string, keepalive?: boolean, timeout?: number): Promise<U>;
|
|
18
|
+
fetchAPI<T>(path: string, timeout?: number, retries?: number): Promise<T>;
|
|
19
|
+
requestBodyAPI<T, U>(path: string, bodyData: T, method?: string, keepalive?: boolean, timeout?: number, retries?: number): Promise<U>;
|
|
20
20
|
}
|
package/dist/nami/customer.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { NamiFlowObjectDTO, NamiFlowStep } from "
|
|
2
|
-
import type { NamiCampaign, NamiFlowCampaign } from '
|
|
3
|
-
import type { NamiPaywallLaunchContext } from '
|
|
4
|
-
import type { PaywallComponent } from "
|
|
1
|
+
import type { NamiFlowObjectDTO, NamiFlowOn, NamiFlowStep } from "../../types/flow";
|
|
2
|
+
import type { NamiCampaign, NamiFlowCampaign } from '../../types/externals/campaign';
|
|
3
|
+
import type { NamiPaywallLaunchContext } from '../../types/externals/paywall';
|
|
4
|
+
import type { PaywallComponent } from "../../components/Paywall";
|
|
5
5
|
import type { NamiFlowManager } from "./NamiFlowManager";
|
|
6
|
-
import type { NamiButton } from "
|
|
6
|
+
import type { NamiButton } from "../../components";
|
|
7
7
|
export declare class BasicNamiFlow implements NamiFlowObjectDTO {
|
|
8
8
|
id: string;
|
|
9
9
|
name: string;
|
|
@@ -28,7 +28,7 @@ export declare class NamiFlow extends BasicNamiFlow {
|
|
|
28
28
|
manager: NamiFlowManager;
|
|
29
29
|
currentButton?: NamiButton;
|
|
30
30
|
constructor(campaign: NamiFlowCampaign, paywall: PaywallComponent, manager: NamiFlowManager, context?: NamiPaywallLaunchContext);
|
|
31
|
-
|
|
31
|
+
private registerResolvers;
|
|
32
32
|
get currentFlowStep(): NamiFlowStep | undefined;
|
|
33
33
|
get nextStepAvailable(): boolean;
|
|
34
34
|
get previousStepAvailable(): boolean;
|
|
@@ -41,7 +41,12 @@ export declare class NamiFlow extends BasicNamiFlow {
|
|
|
41
41
|
private backToPreviousScreenStep;
|
|
42
42
|
forward(stepId: string): void;
|
|
43
43
|
executeLifecycle(step: NamiFlowStep, key: string): void;
|
|
44
|
-
|
|
44
|
+
private lifecycles;
|
|
45
|
+
triggerActions(actionId: string, component?: NamiButton): void;
|
|
46
|
+
executeFullLifecycles(lifecycles: NamiFlowOn[]): void;
|
|
47
|
+
triggerBeforeActions(actionId: string, component?: NamiButton): void;
|
|
48
|
+
triggerAfterActions(actionId: string, component?: NamiButton): void;
|
|
49
|
+
currentStepHasHoistedPrimaryActions(actionId: string): boolean;
|
|
45
50
|
private shouldRun;
|
|
46
51
|
private performAction;
|
|
47
52
|
private nextStep;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { NamiFlowEventHandler, NamiFlowHandoffStepHandler } from "
|
|
1
|
+
import type { NamiFlowEventHandler, NamiFlowHandoffStepHandler } from "../../types/flow";
|
|
2
2
|
import { NamiFlow } from "./NamiFlow";
|
|
3
|
-
import type { NamiFlowCampaign } from '
|
|
4
|
-
import { NamiPaywallLaunchContext } from '
|
|
5
|
-
import { PaywallComponent } from "
|
|
3
|
+
import type { NamiFlowCampaign } from '../../types/externals/campaign';
|
|
4
|
+
import { NamiPaywallLaunchContext } from '../../types/externals/paywall';
|
|
5
|
+
import { PaywallComponent } from "../../components/Paywall";
|
|
6
6
|
export declare class NamiFlowManager {
|
|
7
7
|
private static _instance;
|
|
8
8
|
static get instance(): NamiFlowManager;
|
|
@@ -15,4 +15,6 @@ export declare class NamiFlowManager {
|
|
|
15
15
|
static registerEventHandler(eventHandler: NamiFlowEventHandler): void;
|
|
16
16
|
static resume(): void;
|
|
17
17
|
presentFlow(campaign: NamiFlowCampaign, paywall: PaywallComponent, context?: NamiPaywallLaunchContext): NamiFlow;
|
|
18
|
+
static finish(): void;
|
|
19
|
+
static isFlowOpen(): boolean;
|
|
18
20
|
}
|
package/dist/nami/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { NamiCampaign } from "../../types/externals/campaign";
|
|
1
|
+
import { NamiAnonymousCampaign, NamiCampaign, NamiCampaignSegment } from "../../types/externals/campaign";
|
|
2
2
|
import { IPaywall } from "../../types/paywall";
|
|
3
|
+
import type { TDevice } from '../../types/device';
|
|
3
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[];
|
|
4
7
|
export declare const allCampaigns: () => NamiCampaign[];
|
|
5
8
|
export declare const getPaywallDataFromLabel: (value: string, type?: string) => {
|
|
6
9
|
campaign: NamiCampaign | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NamiFlowManager } from "
|
|
1
|
+
import type { NamiFlowManager } from "../../../nami/flow/NamiFlowManager";
|
|
2
2
|
/**
|
|
3
3
|
* Resolver for liquid-style flow variables, without requiring namespace prefixes.
|
|
4
4
|
* We drop BaseNamespaceResolver since we don't need namespace registration or stripping.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NamiPaywallLaunchContext } from "
|
|
1
|
+
import { NamiPaywallLaunchContext } from "../../../nami-web";
|
|
2
2
|
import { BaseNamespaceResolver } from "./BaseNameSpaceResolver";
|
|
3
3
|
export declare class LaunchContextResolver extends BaseNamespaceResolver {
|
|
4
4
|
protected readonly namespace = "LaunchContext";
|