@namiml/web-sdk 1.3.2 → 1.4.0
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 +19 -0
- package/dist/components/ContextConsumer.d.ts +1 -1
- package/dist/components/ContextProvider.d.ts +7 -7
- package/dist/components/Paywall.d.ts +4 -4
- package/dist/components/TemplateComponent.d.ts +1 -1
- package/dist/components/containers/BackgroundContainer.d.ts +2 -1
- package/dist/components/containers/CollapseContainer.d.ts +1 -1
- package/dist/components/containers/Container.d.ts +6 -2
- package/dist/components/containers/Content.d.ts +1 -1
- package/dist/components/containers/Footer.d.ts +1 -1
- package/dist/components/containers/Header.d.ts +1 -1
- package/dist/components/containers/ProductContainer.d.ts +1 -1
- package/dist/components/containers/ResponsiveGrid.d.ts +9 -0
- package/dist/components/elements/Button.d.ts +4 -1
- package/dist/components/elements/Image.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/Spacer.d.ts +1 -1
- package/dist/components/elements/Text.d.ts +1 -1
- package/dist/components/elements/Video.d.ts +2 -1
- package/dist/components/index.d.ts +3 -1
- package/dist/components/productDetails.d.ts +2 -2
- package/dist/components/utils/actionTap.d.ts +2 -2
- package/dist/components/utils/dateTIme.d.ts +3 -0
- package/dist/components/utils/helpers.d.ts +6 -5
- package/dist/components/utils/impression.d.ts +2 -2
- package/dist/components/utils/products.d.ts +4 -3
- package/dist/components/utils/state.d.ts +6 -6
- package/dist/components/utils/styles.d.ts +4 -3
- package/dist/nami/api.d.ts +4 -3
- package/dist/nami/campaign.d.ts +36 -10
- package/dist/nami/customer.d.ts +58 -14
- package/dist/nami/entitlement.d.ts +22 -5
- package/dist/nami/index.d.ts +7 -1
- package/dist/nami/namiRefs.d.ts +1 -1
- package/dist/nami/paywalls.d.ts +49 -18
- package/dist/nami/purchase.d.ts +5 -1
- package/dist/nami/utils/campaign.d.ts +2 -2
- package/dist/nami/utils/entitlement.d.ts +4 -4
- package/dist/nami/utils/paywall.d.ts +1 -1
- package/dist/nami/utils/purchase.d.ts +2 -2
- package/dist/nami-web.cjs +14 -15
- package/dist/nami-web.d.ts +8 -880
- package/dist/nami-web.js +14 -15
- package/dist/nami-web.mjs +14 -15
- package/dist/nami-web.umd.js +14 -15
- package/dist/repositories/campaignRule.repository.d.ts +3 -3
- package/dist/repositories/config.repository.d.ts +1 -1
- package/dist/repositories/customerJourney.repository.d.ts +5 -0
- package/dist/repositories/device.repository.d.ts +1 -1
- package/dist/repositories/entitlement.repository.d.ts +1 -1
- package/dist/repositories/paywall.repository.d.ts +1 -1
- package/dist/repositories/products.repository.d.ts +1 -1
- package/dist/services/logger.service.d.ts +1 -1
- package/dist/services/storage.service.d.ts +7 -1
- package/dist/types/components/containers.d.ts +11 -2
- package/dist/types/components/elements.d.ts +1 -0
- package/dist/types/components/index.d.ts +2 -2
- package/dist/types/config.d.ts +2 -2
- package/dist/types/customer.d.ts +2 -0
- package/dist/types/entitlements.d.ts +2 -0
- package/dist/types/externals/campaign.d.ts +9 -1
- package/dist/types/externals/config.d.ts +27 -1
- package/dist/types/externals/customer.d.ts +18 -0
- package/dist/types/externals/entitlement.d.ts +27 -0
- package/dist/types/externals/index.d.ts +3 -0
- package/dist/types/externals/languages.d.ts +197 -1
- package/dist/types/{loglevel.d.ts → externals/loglevel.d.ts} +3 -0
- package/dist/types/externals/paywall.d.ts +31 -0
- package/dist/types/externals/product.d.ts +4 -0
- package/dist/types/externals/purchase.d.ts +24 -0
- package/dist/types/externals/sku.d.ts +14 -0
- package/dist/types/paywall.d.ts +2 -2
- package/dist/types/profile.d.ts +2 -1
- package/dist/utils/config.d.ts +2 -1
- package/dist/utils/const.d.ts +1 -1
- package/dist/utils/device.d.ts +1 -1
- package/dist/utils/fonts.d.ts +1 -1
- package/package.json +4 -3
- /package/dist/types/{errors.d.ts → externals/errors.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.4.0 (September 5, 2024)
|
|
4
|
+
|
|
5
|
+
## New Features
|
|
6
|
+
- Support for HLS in Video component
|
|
7
|
+
- Support for Responsive Grid component
|
|
8
|
+
- Add `NamiCustomerManager.deviceId`
|
|
9
|
+
- Add `NamiCustomerManager.registerJourneyStateHandler`, `journeyState` (subscription management-only)
|
|
10
|
+
- Add `NamiEntitlementManager.clearProvisionalEntitlementGrants` (subscription management-only)
|
|
11
|
+
|
|
12
|
+
## Enhancements
|
|
13
|
+
- Allow passing product groups to paywall via campaign launch
|
|
14
|
+
|
|
15
|
+
## Bug Fixes
|
|
16
|
+
- Find product by id rather than name
|
|
17
|
+
- Fix text component spacing issue
|
|
18
|
+
|
|
19
|
+
## Improvements
|
|
20
|
+
- Modify type definitions for `NamiPaywallManager.registerSignInHandler`, `NamiPaywallManager.registerCloseHandler`, `NamiPaywallManager.registerBuySkuHandler`, `NamiPaywallManager.registerDeeplinkActionHandler`, `NamiCustomerManager.registerAccountStateHandler`, `NamiCampaignManager.launch` handlers to match Nami React Native SDK
|
|
21
|
+
|
|
3
22
|
## 1.3.2 (August 14, 2024)
|
|
4
23
|
|
|
5
24
|
### Bug Fixes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
-
import { TPaywallContext } from '
|
|
2
|
+
import { TPaywallContext } from '../types/paywall';
|
|
3
3
|
declare class ContextConsumer implements ReactiveController {
|
|
4
4
|
host: ReactiveControllerHost;
|
|
5
5
|
state: TPaywallContext;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
-
import { IPaywall, NamiAppSuppliedVideoDetails, TPaywallContext, TPaywallLaunchContext, TPaywallMedia } from '
|
|
3
|
-
import { NamiProductDetails } from '
|
|
4
|
-
import { NamiSKU } from '
|
|
5
|
-
import { NamiCampaign } from '
|
|
6
|
-
import { TDevice } from '
|
|
2
|
+
import { IPaywall, NamiAppSuppliedVideoDetails, TPaywallContext, TPaywallLaunchContext, TPaywallMedia } from '../types/paywall';
|
|
3
|
+
import { NamiProductDetails } from '../types/externals/product';
|
|
4
|
+
import { NamiSKU } from '../types/externals/sku';
|
|
5
|
+
import { NamiCampaign } from '../types/externals/campaign';
|
|
6
|
+
import { TDevice } from '../types/device';
|
|
7
|
+
import { Callback } from '../types/components/containers';
|
|
7
8
|
export declare const initialState: TPaywallContext;
|
|
8
|
-
type Callback = () => void;
|
|
9
9
|
declare class ContextProvider implements ReactiveController {
|
|
10
10
|
host: ReactiveControllerHost | null;
|
|
11
11
|
state: TPaywallContext;
|
|
@@ -20,7 +20,7 @@ declare class ContextProvider implements ReactiveController {
|
|
|
20
20
|
setProductDetails(details: NamiProductDetails[]): void;
|
|
21
21
|
getProductDetails(): NamiProductDetails[];
|
|
22
22
|
setCurrentGroupId(currentGroupId: string): void;
|
|
23
|
-
|
|
23
|
+
getCurrentGroupId(): string;
|
|
24
24
|
setSelectedProdcuts(products: {
|
|
25
25
|
[currentGroupId: string]: string;
|
|
26
26
|
}): void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { IPaywall, TPaywallLaunchContext } from '
|
|
2
|
-
import { TDevice } from '
|
|
1
|
+
import { IPaywall, TPaywallLaunchContext } from '../types/paywall';
|
|
2
|
+
import { TDevice } from '../types/device';
|
|
3
3
|
import { NamiElement } from './NamiElement';
|
|
4
4
|
import { TemplateResult } from 'lit';
|
|
5
|
-
import { NamiCampaign } from '
|
|
6
|
-
import { NamiPaywallEvent } from '
|
|
5
|
+
import { NamiCampaign } from '../types/externals/campaign';
|
|
6
|
+
import { NamiPaywallEvent } from '../types/externals/paywall';
|
|
7
7
|
declare class PaywallComponent extends NamiElement {
|
|
8
8
|
formFactor: TDevice;
|
|
9
9
|
campaign: NamiCampaign;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { TComponent } from "
|
|
1
|
+
import { TComponent } from "../types/components";
|
|
2
2
|
export declare function TemplateComponent(component: TComponent, inFocusedState?: boolean): any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TContainer } from "
|
|
1
|
+
import { TContainer } from "../../types/components";
|
|
2
2
|
import { NamiElement } from "../NamiElement";
|
|
3
3
|
import { CSSResult } from "lit";
|
|
4
4
|
export declare class NamiBackgroundContainer extends NamiElement {
|
|
@@ -6,5 +6,6 @@ export declare class NamiBackgroundContainer extends NamiElement {
|
|
|
6
6
|
fullscreen: boolean;
|
|
7
7
|
inFocusedState: boolean;
|
|
8
8
|
protected styles(): CSSResult;
|
|
9
|
+
protected updated(): void;
|
|
9
10
|
render(): any[];
|
|
10
11
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CSSResult } from 'lit';
|
|
2
2
|
import { NamiElement } from '../NamiElement';
|
|
3
|
-
import { TCollapseContainer } from '
|
|
3
|
+
import { TCollapseContainer } from '../../types/components/containers';
|
|
4
4
|
export declare class NamiCollapseContainer extends NamiElement {
|
|
5
5
|
component: TCollapseContainer;
|
|
6
6
|
inFocusedState: boolean;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { CSSResult } from 'lit';
|
|
2
|
-
import { TContainer } from '
|
|
2
|
+
import { TContainer } from '../../types/components';
|
|
3
3
|
import { NamiElement } from '../NamiElement';
|
|
4
|
-
import { TProductContainer } from '
|
|
4
|
+
import { TProductContainer } from '../../types/components/containers';
|
|
5
5
|
export declare class NamiContainer extends NamiElement {
|
|
6
6
|
component: TContainer | TProductContainer;
|
|
7
7
|
inFocusedState: boolean;
|
|
8
|
+
constructor();
|
|
9
|
+
private _handleFocusChanged;
|
|
10
|
+
private _handleFocus;
|
|
11
|
+
private _handleBlur;
|
|
8
12
|
protected styles(): CSSResult;
|
|
9
13
|
render(): any[];
|
|
10
14
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CSSResult } from "lit";
|
|
2
2
|
import { NamiElement } from "../NamiElement";
|
|
3
|
-
import { TContainer } from "
|
|
3
|
+
import { TContainer } from "../../types/components";
|
|
4
4
|
export declare class NamiContentContainer extends NamiElement {
|
|
5
5
|
component: TContainer;
|
|
6
6
|
zIndex: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CSSResult } from 'lit';
|
|
2
2
|
import { NamiElement } from '../NamiElement';
|
|
3
|
-
import { THeaderFooter } from '
|
|
3
|
+
import { THeaderFooter } from '../../types/components/containers';
|
|
4
4
|
export declare class NamiFooter extends NamiElement {
|
|
5
5
|
components: THeaderFooter;
|
|
6
6
|
zIndex: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CSSResult } from 'lit';
|
|
2
2
|
import { NamiElement } from '../NamiElement';
|
|
3
|
-
import { THeaderFooter } from '
|
|
3
|
+
import { THeaderFooter } from '../../types/components/containers';
|
|
4
4
|
export declare class NamiHeader extends NamiElement {
|
|
5
5
|
components: THeaderFooter;
|
|
6
6
|
zIndex: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CSSResult } from 'lit';
|
|
2
2
|
import { NamiElement } from '../NamiElement';
|
|
3
|
-
import { TProductContainer } from '
|
|
3
|
+
import { TProductContainer } from '../../types/components/containers';
|
|
4
4
|
export declare class NamiProductContainer extends NamiElement {
|
|
5
5
|
component: TProductContainer;
|
|
6
6
|
inFocusedState: boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CSSResult } from 'lit';
|
|
2
|
+
import { NamiElement } from '../NamiElement';
|
|
3
|
+
import { TResponsiveGrid } from '../../types/components/containers';
|
|
4
|
+
export declare class NamiResponsiveGrid extends NamiElement {
|
|
5
|
+
component: TResponsiveGrid;
|
|
6
|
+
inFocusedState: boolean;
|
|
7
|
+
protected styles(): CSSResult;
|
|
8
|
+
render(): any[][];
|
|
9
|
+
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { CSSResult } from 'lit';
|
|
2
|
-
import { TButtonContainer } from '
|
|
2
|
+
import { TButtonContainer } from '../../types/components/containers';
|
|
3
3
|
import { NamiElement } from '../NamiElement';
|
|
4
4
|
export declare class NamiButton extends NamiElement {
|
|
5
5
|
component: TButtonContainer;
|
|
6
6
|
inFocusedState: boolean;
|
|
7
7
|
constructor();
|
|
8
|
+
updated(): void;
|
|
9
|
+
private _handleFocus;
|
|
10
|
+
private _handleBlur;
|
|
8
11
|
private _handleClick;
|
|
9
12
|
protected styles(): CSSResult;
|
|
10
13
|
render(): any[] | import("lit-html").TemplateResult<1>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TImageComponent } from "
|
|
1
|
+
import { TImageComponent } from "../../types/components/elements";
|
|
2
2
|
import { NamiElement } from "../NamiElement";
|
|
3
3
|
import { CSSResult, TemplateResult } from "lit";
|
|
4
4
|
export declare class NamiImage extends NamiElement {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CSSResult } from 'lit';
|
|
2
|
-
import { TSegmentPicker } from '
|
|
2
|
+
import { TSegmentPicker } from '../../types/components/elements';
|
|
3
3
|
import { NamiElement } from '../NamiElement';
|
|
4
4
|
export declare class NamiSegmentPicker extends NamiElement {
|
|
5
5
|
component: TSegmentPicker;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CSSResult } from 'lit';
|
|
2
|
-
import { TSegmentPickerItem } from '
|
|
2
|
+
import { TSegmentPickerItem } from '../../types/components/elements';
|
|
3
3
|
import { NamiElement } from '../NamiElement';
|
|
4
4
|
export declare class NamiSegmentPickerItem extends NamiElement {
|
|
5
5
|
component: TSegmentPickerItem;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CSSResult, TemplateResult } from 'lit';
|
|
2
2
|
import { NamiElement } from '../NamiElement';
|
|
3
|
-
import { TSpacerComponent } from '
|
|
3
|
+
import { TSpacerComponent } from '../../types/components/elements';
|
|
4
4
|
export declare class NamiSpacer extends NamiElement {
|
|
5
5
|
component: TSpacerComponent;
|
|
6
6
|
inFocusedState: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TemplateResult, CSSResult } from 'lit';
|
|
2
|
-
import { TSymbolComponent, TTextComponent, TTextListComponent } from '
|
|
2
|
+
import { TSymbolComponent, TTextComponent, TTextListComponent } from '../../types/components/elements';
|
|
3
3
|
import { NamiElement } from '../NamiElement';
|
|
4
4
|
export declare class NamiText extends NamiElement {
|
|
5
5
|
component: TTextComponent;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { TVideoComponent } from "
|
|
1
|
+
import { TVideoComponent } from "../../types/components/elements";
|
|
2
2
|
import { NamiElement } from "../NamiElement";
|
|
3
3
|
import { CSSResult, TemplateResult } from "lit";
|
|
4
4
|
export declare class NamiVideo extends NamiElement {
|
|
5
5
|
component: TVideoComponent;
|
|
6
6
|
inFocusedState: boolean;
|
|
7
7
|
protected styles(): CSSResult;
|
|
8
|
+
loadMediaSrc(video: HTMLVideoElement): void;
|
|
8
9
|
updated(): void;
|
|
9
10
|
protected render(): TemplateResult;
|
|
10
11
|
}
|
|
@@ -12,6 +12,7 @@ import { NamiSegmentPicker } from "./elements/SegmentPicker";
|
|
|
12
12
|
import { NamiSegmentPickerItem } from "./elements/SegmentPickerItem";
|
|
13
13
|
import { NamiVideo } from "./elements/Video";
|
|
14
14
|
import { NamiCollapseContainer } from "./containers/CollapseContainer";
|
|
15
|
+
import { NamiResponsiveGrid } from "./containers/ResponsiveGrid";
|
|
15
16
|
declare global {
|
|
16
17
|
interface HTMLElementTagNameMap {
|
|
17
18
|
"nami-spacer": NamiSpacer;
|
|
@@ -29,6 +30,7 @@ declare global {
|
|
|
29
30
|
"nami-symbol": NamiSymbol;
|
|
30
31
|
"nami-video": NamiVideo;
|
|
31
32
|
"nami-collapse-container": NamiCollapseContainer;
|
|
33
|
+
"nami-responsive-grid": NamiResponsiveGrid;
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
|
-
export { NamiSpacer, NamiButton, NamiHeader, NamiFooter, NamiText, NamiSegmentPicker, NamiSegmentPickerItem, NamiContainer, NamiProductContainer, NamiImage, NamiBackgroundContainer, NamiContentContainer, NamiSymbol, NamiVideo, NamiCollapseContainer };
|
|
36
|
+
export { NamiSpacer, NamiButton, NamiHeader, NamiFooter, NamiText, NamiSegmentPicker, NamiSegmentPickerItem, NamiContainer, NamiProductContainer, NamiImage, NamiBackgroundContainer, NamiContentContainer, NamiSymbol, NamiVideo, NamiCollapseContainer, NamiResponsiveGrid };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { NamiProductDetails } from "
|
|
2
|
-
import { PaywallSKU } from "
|
|
1
|
+
import { NamiProductDetails } from "../types/externals/product";
|
|
2
|
+
import { PaywallSKU } from "../types/sku";
|
|
3
3
|
export declare const getProductDetail: (variableName: string, product?: NamiProductDetails | null, referenceId?: string, skus?: PaywallSKU[]) => unknown;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { UserAction } from "
|
|
2
|
-
import { NamiSKU } from "
|
|
1
|
+
import { UserAction } from "../../types/components/containers";
|
|
2
|
+
import { NamiSKU } from "../../types/externals/sku";
|
|
3
3
|
export declare const handleAction: (onTap?: UserAction, sku?: NamiSKU) => void;
|
|
4
4
|
export declare const closePaywallHandler: () => void;
|
|
5
5
|
export declare const restorePurchase: () => void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { TBaseComponent, TComponent } from "
|
|
2
|
-
import { TButtonContainer, TProductContainer } from "
|
|
3
|
-
import { TConditionalComponent } from "
|
|
4
|
-
import { TPaywallMedia } from "
|
|
5
|
-
import { PaywallSKU } from "
|
|
1
|
+
import { TBaseComponent, TComponent } from "../../types/components";
|
|
2
|
+
import { TButtonContainer, TProductContainer, TResponsiveGrid } from "../../types/components/containers";
|
|
3
|
+
import { TConditionalComponent } from "../../types/components/elements";
|
|
4
|
+
import { TPaywallMedia } from "../../types/paywall";
|
|
5
|
+
import { PaywallSKU } from "../../types/sku";
|
|
6
6
|
type ReplacementsType = {
|
|
7
7
|
[type: string]: any extends Array<any> ? never : any;
|
|
8
8
|
};
|
|
@@ -11,6 +11,7 @@ export declare function getInterpolatedButtonComponents(component: TButtonContai
|
|
|
11
11
|
export declare function getSkuButtonComponents(items: PaywallSKU[], component: TProductContainer, mediaList?: {
|
|
12
12
|
[mediaName: string]: Pick<TPaywallMedia, 'content'>;
|
|
13
13
|
}, additionalVariableStates?: object): [boolean, TComponent[]][];
|
|
14
|
+
export declare function getRepeatingListComponents(component: TResponsiveGrid): TComponent[][];
|
|
14
15
|
export declare function conditionComponentMatches(condition: TConditionalComponent): boolean;
|
|
15
16
|
export declare function withOverrides<T extends TBaseComponent>({ conditionAttributes, ...component }: T): T;
|
|
16
17
|
export declare function valueFromSmartText<T>(value: T, sku?: PaywallSKU): T;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Impression } from "
|
|
2
|
-
import { TransactionRequest } from "
|
|
1
|
+
import { Impression } from "../../types/api";
|
|
2
|
+
import { TransactionRequest } from "../../types/purchase";
|
|
3
3
|
export declare const postImpression: (options: Impression) => Promise<void>;
|
|
4
4
|
export declare const postConversion: (transactionInfo: TransactionRequest) => Promise<void>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { NamiProductDetails, NamiProductOffer, NamiSubscriptionPeriod } from "
|
|
2
|
-
import { PricingPhase } from "
|
|
3
|
-
import { PaywallSKU } from "
|
|
1
|
+
import { NamiProductDetails, NamiProductOffer, NamiSubscriptionPeriod } from "../../types/externals/product";
|
|
2
|
+
import { PricingPhase } from "../../types/products";
|
|
3
|
+
import { PaywallSKU } from "../../types/sku";
|
|
4
|
+
export declare const isSubscription: (productType?: string) => productType is "subscription";
|
|
4
5
|
export declare function getStandardBillingPeriod(product: NamiProductDetails): string | undefined;
|
|
5
6
|
export declare function getFreeTrialPeriod(product: NamiProductDetails): string | undefined;
|
|
6
7
|
export declare function getFreeTrialOffer(product: NamiProductDetails): NamiProductOffer | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { InitiateStateGroup, ISkuMenu, TInitialState } from "
|
|
2
|
-
import { NamiProductDetails } from "
|
|
3
|
-
import { PaywallSKU } from "
|
|
4
|
-
import { NamiPaywallLaunchContext } from "
|
|
1
|
+
import { InitiateStateGroup, ISkuMenu, TInitialState } from "../../types/paywall";
|
|
2
|
+
import { NamiProductDetails } from "../../types/externals/product";
|
|
3
|
+
import { PaywallSKU } from "../../types/sku";
|
|
4
|
+
import { NamiPaywallLaunchContext } from "../../nami-web";
|
|
5
5
|
export declare function currentSku(productDetails: NamiProductDetails[], initialState: TInitialState, skuMenus: ISkuMenu[], skus: PaywallSKU[]): {
|
|
6
6
|
[key: string]: any;
|
|
7
7
|
};
|
|
@@ -11,5 +11,5 @@ export declare function getSkuSmartTextValue(productDetail?: NamiProductDetails
|
|
|
11
11
|
};
|
|
12
12
|
export declare function checkAnySkuHasTrialOffer(productDetails: NamiProductDetails[], skuMenus: ISkuMenu[], productGroups: string[]): boolean;
|
|
13
13
|
export declare function checkAnySkuHasPromoOffer(productDetails: NamiProductDetails[], skuMenus: ISkuMenu[], productGroups: string[]): boolean;
|
|
14
|
-
export declare function productDetail(details: NamiProductDetails[] | undefined,
|
|
15
|
-
export declare function launchContext(groups: InitiateStateGroup[],
|
|
14
|
+
export declare function productDetail(details: NamiProductDetails[] | undefined, refId: string): NamiProductDetails | null;
|
|
15
|
+
export declare function launchContext(groups: InitiateStateGroup[], context?: NamiPaywallLaunchContext): NamiPaywallLaunchContext;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TBaseComponent, TContainerPosition } from "
|
|
2
|
-
import { TSegmentPickerItem, TTextLikeComponent } from "
|
|
1
|
+
import { TBaseComponent, TContainerPosition } from "../../types/components";
|
|
2
|
+
import { TSegmentPickerItem, TTextLikeComponent } from "../../types/components/elements";
|
|
3
3
|
export declare function parseSize(value: string | number): string;
|
|
4
4
|
export declare function backgroundColor(value: string): string;
|
|
5
5
|
export declare function pickAndApplyBackgroundColor(component: TBaseComponent, inFocusedState?: boolean): string;
|
|
@@ -18,8 +18,9 @@ export declare function dropShadow(component: TBaseComponent): string;
|
|
|
18
18
|
export declare function textStrikethrough(value: boolean | undefined): string;
|
|
19
19
|
export declare function font({ fontName }: TTextLikeComponent): string;
|
|
20
20
|
export declare function applyStyles(component: TBaseComponent, inFocusedState?: boolean): string;
|
|
21
|
+
export declare function applyGridStyles(component: TBaseComponent, inFocusedState?: boolean): string;
|
|
21
22
|
export declare function parsePosition(position?: TContainerPosition): string;
|
|
22
23
|
export declare function getComponentStyles(prefix: string, component: TSegmentPickerItem): TSegmentPickerItem;
|
|
23
24
|
export declare function formatKey(key: string, prefix: string): string;
|
|
24
25
|
export declare function applySegmentStyles(styles: any, inFocusedState: boolean): string;
|
|
25
|
-
export declare function
|
|
26
|
+
export declare function applySegmentFontStyles(styles: any): string;
|
package/dist/nami/api.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { NamiConfiguration } from "
|
|
2
|
-
import { Impression, LoginResponse } from "
|
|
3
|
-
import { PurchaseValidationRequest, TransactionRequest } from "
|
|
1
|
+
import { NamiConfiguration } from "../types/config";
|
|
2
|
+
import { Impression, LoginResponse } from "../types/api";
|
|
3
|
+
import { PurchaseValidationRequest, TransactionRequest } from "../types/purchase";
|
|
4
4
|
export declare class NamiAPI {
|
|
5
5
|
static instance: NamiAPI;
|
|
6
6
|
private baseURL;
|
|
7
7
|
private platformID;
|
|
8
8
|
private get deviceID();
|
|
9
|
+
constructor();
|
|
9
10
|
static configure(config: NamiConfiguration): void;
|
|
10
11
|
protected configure(config: NamiConfiguration): void;
|
|
11
12
|
login(externalId: string): Promise<LoginResponse>;
|
package/dist/nami/campaign.d.ts
CHANGED
|
@@ -1,38 +1,64 @@
|
|
|
1
|
-
import { AvailableCampaignsResponseHandler } from "
|
|
2
|
-
import { TPaywallLaunchContext, PaywallResultHandler } from "
|
|
3
|
-
import { PaywallComponent } from "
|
|
4
|
-
import { Callback } from "
|
|
5
|
-
import { NamiPaywallActionHandler } from "
|
|
6
|
-
import { NamiCampaign } from "
|
|
1
|
+
import { AvailableCampaignsResponseHandler } from "../types/campaign";
|
|
2
|
+
import { TPaywallLaunchContext, PaywallResultHandler } from "../types/paywall";
|
|
3
|
+
import { PaywallComponent } from "../components/Paywall";
|
|
4
|
+
import { Callback } from "../types/components/containers";
|
|
5
|
+
import { NamiPaywallActionHandler } from "../types/externals/paywall";
|
|
6
|
+
import { NamiCampaign } from "../types/externals/campaign";
|
|
7
|
+
/**
|
|
8
|
+
* @class NamiCampaignManager
|
|
9
|
+
* Provides methods for managing all aspects of a campaign.
|
|
10
|
+
*/
|
|
7
11
|
export declare class NamiCampaignManager {
|
|
8
12
|
static instance: NamiCampaignManager;
|
|
9
13
|
private emitter;
|
|
14
|
+
/**
|
|
15
|
+
* @returns {NamiCampaign[]} A list of NamiCampaign
|
|
16
|
+
*/
|
|
10
17
|
static allCampaigns(): NamiCampaign[];
|
|
11
18
|
/**
|
|
12
19
|
* Checks if a campaign is available for a given argument.
|
|
13
20
|
* The argument can be a label string, or a deeplink URL.
|
|
14
21
|
*
|
|
15
22
|
* @param label - The argument to check. Can be a label string, or a deeplink URL.
|
|
16
|
-
* @returns True if the campaign is available,
|
|
23
|
+
* @returns {boolean} True if the campaign is available, False otherwise.
|
|
17
24
|
*/
|
|
18
25
|
static isCampaignAvailable(label: string): boolean;
|
|
19
26
|
/**
|
|
20
|
-
*
|
|
27
|
+
* Fetches the latest active campaigns for the current device.
|
|
21
28
|
*
|
|
22
|
-
* @returns list of campaigns
|
|
29
|
+
* @returns {Promise<NamiCampaign[]>} A promise that resolves to a list of active campaigns.
|
|
23
30
|
*/
|
|
24
31
|
static refresh(): Promise<NamiCampaign[]>;
|
|
32
|
+
/**
|
|
33
|
+
* Registers a handler that will be called whenever there is an update
|
|
34
|
+
* in the list of active campaigns. The Nami SDK will trigger this callback
|
|
35
|
+
* with the updated list of active campaigns.
|
|
36
|
+
*
|
|
37
|
+
* The handler will receive an array of `NamiCampaign` objects representing
|
|
38
|
+
* the current active campaigns.
|
|
39
|
+
*
|
|
40
|
+
* @param {AvailableCampaignsResponseHandler} handler - The callback function that will be invoked when the campaign list is updated.
|
|
41
|
+
* @returns {Callback} A function that can be called to unregister the handler.
|
|
42
|
+
*/
|
|
25
43
|
static registerAvailableCampaignsHandler(handler: AvailableCampaignsResponseHandler): Callback;
|
|
26
44
|
/**
|
|
27
45
|
* Launches a campaign with a given label.
|
|
28
46
|
* @param label - The label of the campaign to launch.
|
|
29
47
|
* @param withUrl - The deeplink URL of the campaign to launch.
|
|
30
48
|
* @param actionCallback - Optional handler for paywall actions.
|
|
31
|
-
* @returns
|
|
49
|
+
* @returns {PaywallComponent | void} The launched paywall web component.
|
|
32
50
|
*/
|
|
33
51
|
static launch(label?: string, withUrl?: string, context?: TPaywallLaunchContext, resultCallback?: PaywallResultHandler, actionCallback?: NamiPaywallActionHandler): PaywallComponent | void;
|
|
52
|
+
/**
|
|
53
|
+
* Provide the list of product groups supported by the provided placement label or URL.
|
|
54
|
+
* @param label Campaign placement label defined in Nami Control Center for launching a specific campaign.
|
|
55
|
+
* @param uri Campaign placement URI defined in Nami Control Center for launching a specific campaign.
|
|
56
|
+
* @return List of product groups associated with the specified campaign placement.
|
|
57
|
+
*/
|
|
58
|
+
static getProductGroups(label?: string, withUrl?: string): string[];
|
|
34
59
|
/**
|
|
35
60
|
* Private Instance Methods
|
|
36
61
|
*/
|
|
37
62
|
private get sdkInitialized();
|
|
63
|
+
private campaignTypeAndLabel;
|
|
38
64
|
}
|
package/dist/nami/customer.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { Callback } from "
|
|
2
|
-
import { AccountStateAction } from "
|
|
1
|
+
import { Callback } from "../types/components/containers";
|
|
2
|
+
import { AccountStateAction } from "../types/profile";
|
|
3
|
+
import { NamiCustomerJourneyStateHandler } from "../types/customer";
|
|
4
|
+
import { CustomerJourneyState } from "../types/externals/customer";
|
|
3
5
|
type AccountStateHandler = (action: AccountStateAction, success: boolean, error?: Error) => void;
|
|
4
6
|
/**
|
|
5
|
-
* NamiCustomerManager
|
|
7
|
+
* @class NamiCustomerManager
|
|
8
|
+
* Provides methods for managing customer-related functionality.
|
|
6
9
|
*/
|
|
7
10
|
export declare class NamiCustomerManager {
|
|
8
11
|
static instance: NamiCustomerManager;
|
|
@@ -16,35 +19,53 @@ export declare class NamiCustomerManager {
|
|
|
16
19
|
/**
|
|
17
20
|
* Returns the external ID of the currently logged in user.
|
|
18
21
|
*
|
|
19
|
-
* @returns The external ID of the logged in user.
|
|
22
|
+
* @returns {string | undefined} The external ID of the logged in user.
|
|
20
23
|
*/
|
|
21
24
|
static loggedInId(): string | undefined;
|
|
22
25
|
/**
|
|
23
26
|
* Logs in a customer with the specified ID.
|
|
24
27
|
*
|
|
25
28
|
* @param id - The ID of the customer to log in. Must be a SHA256 hash or UUID.
|
|
26
|
-
* @returns A Promise that resolves when the login is successful.
|
|
29
|
+
* @returns {Promise<void>} A Promise that resolves when the login is successful.
|
|
27
30
|
*/
|
|
28
31
|
static login(externalId: string): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* This method detaches the whole platform account from the signed in user
|
|
34
|
+
* @returns {Promise<void>} A Promise that resolves when the logout is successful.
|
|
35
|
+
*/
|
|
29
36
|
static logout(): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* This method for connecting the device to a Customer Data Platform identifier
|
|
39
|
+
*
|
|
40
|
+
* Advanced use case. Make sure you have user consent.
|
|
41
|
+
*
|
|
42
|
+
* @param id a value supplied from your CDP platform
|
|
43
|
+
* @returns {Promise<void>} A Promise that resolves when CustomerDataPlatformId will be set.
|
|
44
|
+
*/
|
|
30
45
|
static setCustomerDataPlatformId(id: string): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* This method for clearing the Customer Data Platform identifier linked to this device
|
|
48
|
+
*
|
|
49
|
+
* Advanced use case.
|
|
50
|
+
* @returns {Promise<void>} A Promise that resolves when CustomerDataPlatformId will be cleared.
|
|
51
|
+
*/
|
|
31
52
|
static clearCustomerDataPlatformId(): Promise<void>;
|
|
32
53
|
/**
|
|
33
54
|
* Registers a callback function to handle changes in the account state.
|
|
34
55
|
*
|
|
35
56
|
* @param callback - The callback function to be registered.
|
|
36
|
-
* @returns A function that can be used to unregister the original callback.
|
|
57
|
+
* @returns {Callback} A function that can be used to unregister the original callback.
|
|
37
58
|
*/
|
|
38
|
-
static registerAccountStateHandler(
|
|
59
|
+
static registerAccountStateHandler(handler: AccountStateHandler): Callback;
|
|
39
60
|
/**
|
|
40
61
|
* Sets the anonymous mode for the customer.
|
|
41
62
|
*
|
|
42
63
|
* @param enabled - A boolean value indicating whether the anonymous mode should be enabled or disabled.
|
|
43
|
-
* @returns A Promise that resolves when the anonymous mode is set.
|
|
64
|
+
* @returns {Promise<void>} A Promise that resolves when the anonymous mode is set.
|
|
44
65
|
*/
|
|
45
66
|
static setAnonymousMode(enabled: boolean): Promise<void>;
|
|
46
67
|
/**
|
|
47
|
-
*
|
|
68
|
+
* @returns {boolean} whether or not the SDK is currently operating in anonymous mode
|
|
48
69
|
*/
|
|
49
70
|
static inAnonymousMode(): boolean;
|
|
50
71
|
/**
|
|
@@ -58,9 +79,15 @@ export declare class NamiCustomerManager {
|
|
|
58
79
|
* Retrieves the value for a given key in the on-device customer attribute key/value store.
|
|
59
80
|
*
|
|
60
81
|
* @param key - The name of the attribute. For example: `firstName`
|
|
61
|
-
* @returns The value of the customer attribute.
|
|
82
|
+
* @returns {string | null} The value of the customer attribute.
|
|
62
83
|
*/
|
|
63
84
|
static getCustomerAttribute(key: string): string | null;
|
|
85
|
+
/**
|
|
86
|
+
* Retrieves all the customer attribute key/value store.
|
|
87
|
+
*
|
|
88
|
+
* @returns {string | null} The value of the customer attribute.
|
|
89
|
+
*/
|
|
90
|
+
static getAllCustomerAttributes(): string[];
|
|
64
91
|
/**
|
|
65
92
|
* Clears a value of the given key in the on-device key/value store.
|
|
66
93
|
*
|
|
@@ -69,9 +96,26 @@ export declare class NamiCustomerManager {
|
|
|
69
96
|
static clearCustomerAttribute(key: string): void;
|
|
70
97
|
/**
|
|
71
98
|
* Clear all customer attributes from the on-device key/value store.
|
|
72
|
-
*
|
|
73
99
|
*/
|
|
74
100
|
static clearAllCustomerAttributes(): void;
|
|
101
|
+
/**
|
|
102
|
+
* @return current customer's journey state.
|
|
103
|
+
*/
|
|
104
|
+
static journeyState(): CustomerJourneyState | null;
|
|
105
|
+
/**
|
|
106
|
+
* @return the unique identifier Nami users to identify this device. Please note
|
|
107
|
+
* you should not depend on the device identifier persisting across app re-installs.
|
|
108
|
+
*/
|
|
109
|
+
static deviceId(): string;
|
|
110
|
+
/**
|
|
111
|
+
* When there has been an update received to the active entitlements,
|
|
112
|
+
* the Nami SDK will provide notification of that event through
|
|
113
|
+
* this callback with list of active [NamiEntitlement]
|
|
114
|
+
*
|
|
115
|
+
* @param {NamiCustomerJourneyStateHandler} handler - The callback function that will be invoked when the campaign list is updated.
|
|
116
|
+
* @returns {Callback} A function that can be called to unregister the handler.
|
|
117
|
+
*/
|
|
118
|
+
static registerJourneyStateHandler(handler: NamiCustomerJourneyStateHandler): Callback | undefined;
|
|
75
119
|
/**
|
|
76
120
|
* Private Static Methods
|
|
77
121
|
*/
|
|
@@ -82,9 +126,9 @@ export declare class NamiCustomerManager {
|
|
|
82
126
|
private get isSDKInitialized();
|
|
83
127
|
private static updateCustomerDataPlatformId;
|
|
84
128
|
/**
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
129
|
+
* @returns whether or not the configured app platform id belongs to an anonymous mode
|
|
130
|
+
* capable Nami account.
|
|
131
|
+
*/
|
|
88
132
|
private static anonymousModeCapability;
|
|
89
133
|
private static refetchConfig;
|
|
90
134
|
}
|