@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
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IPaywall } from "
|
|
2
|
-
import { TDevice } from "
|
|
3
|
-
import { NamiCampaign } from "
|
|
1
|
+
import { IPaywall } from "../types/paywall";
|
|
2
|
+
import { TDevice } from "../types/device";
|
|
3
|
+
import { NamiCampaign } from "../types/externals/campaign";
|
|
4
4
|
export declare class CampaignRuleRepository {
|
|
5
5
|
currentFormFactor: TDevice;
|
|
6
6
|
static instance: CampaignRuleRepository;
|
|
@@ -3,8 +3,9 @@ import { IConfig, NamiConfiguration } from "src/types/config";
|
|
|
3
3
|
import { IPaywall } from "src/types/paywall";
|
|
4
4
|
import { NamiCampaign } from "src/types/externals/campaign";
|
|
5
5
|
import { NamiProfile } from "src/types/profile";
|
|
6
|
-
import { IEntitlements, NamiEntitlement } from "
|
|
6
|
+
import { IEntitlements, NamiEntitlement } from "../types/entitlements";
|
|
7
7
|
import { SKU } from "src/types/sku";
|
|
8
|
+
import { CustomerJourneyState } from "src/types/externals/customer";
|
|
8
9
|
declare class StorageService {
|
|
9
10
|
setDevice(device: Device): void;
|
|
10
11
|
getDevice(): Device | null;
|
|
@@ -14,6 +15,8 @@ declare class StorageService {
|
|
|
14
15
|
clearAnonymousMode(): void;
|
|
15
16
|
setAppConfig(key: string, config: IConfig): void;
|
|
16
17
|
getAppConfig(key: string): IConfig | null;
|
|
18
|
+
setLanguageCode(code?: string): void;
|
|
19
|
+
getLanguageCode(): string;
|
|
17
20
|
setCampaignRules(key: string, campaignRules: NamiCampaign[]): void;
|
|
18
21
|
getCampaignRules(key: string): NamiCampaign[] | null;
|
|
19
22
|
setPaywalls(key: string, paywalls: IPaywall[]): void;
|
|
@@ -29,11 +32,14 @@ declare class StorageService {
|
|
|
29
32
|
setCustomerAttribute<T>(attribute: string, value: T): void;
|
|
30
33
|
getCustomerAttribute<T>(attribute: string): T | null;
|
|
31
34
|
getAllCustomerAttributes(): string[];
|
|
35
|
+
getAllCustomerAttributesKeys(): string[];
|
|
32
36
|
clearCustomerAttribute(attribute: string): boolean;
|
|
33
37
|
clearAllCustomerAttributes(): void;
|
|
34
38
|
setNamiProfile(profileData: NamiProfile): void;
|
|
35
39
|
getNamiProfile(): NamiProfile | null;
|
|
36
40
|
removeNamiProfile(): void;
|
|
41
|
+
setCustomerJourneyState(state: CustomerJourneyState): void;
|
|
42
|
+
getCustomerJourneyState(): CustomerJourneyState | null;
|
|
37
43
|
setSessionCounter(): void;
|
|
38
44
|
setLastImpressionId(id: string): void;
|
|
39
45
|
getLastImpressionId(): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NamiSKU } from "
|
|
1
|
+
import { NamiSKU } from "../../types/externals/sku";
|
|
2
2
|
import { TBaseComponent, TComponent, TContainer, TTestObject } from ".";
|
|
3
3
|
import { TImageComponent, TSpacerComponent, TTextComponent, TTextListComponent } from "./elements";
|
|
4
4
|
export type THeaderFooter = (TContainer | TButtonContainer | TSpacerComponent | TTextComponent)[];
|
|
@@ -21,7 +21,10 @@ export type UserActionParameters = {
|
|
|
21
21
|
confirmationMessage?: string;
|
|
22
22
|
confirmBeforePurchase?: TTestObject[];
|
|
23
23
|
};
|
|
24
|
-
export type
|
|
24
|
+
export type SKUActionHandler = (sku: NamiSKU) => void;
|
|
25
|
+
export type DeepLinkUrlHandler = (url: string) => void;
|
|
26
|
+
export type CloseHandler = (body?: any) => void;
|
|
27
|
+
export type Callback = () => void;
|
|
25
28
|
export type TCarouselContainer = Omit<TContainer, "component"> & {
|
|
26
29
|
component: "carouselContainer";
|
|
27
30
|
indicatorColor: string;
|
|
@@ -69,3 +72,9 @@ export type TCollapseContainer = TBaseComponent & {
|
|
|
69
72
|
components: TComponent[];
|
|
70
73
|
open: "collapse" | "open";
|
|
71
74
|
};
|
|
75
|
+
export type TResponsiveGrid = TBaseComponent & {
|
|
76
|
+
component: "responsiveGrid";
|
|
77
|
+
components: any;
|
|
78
|
+
loopVariable?: string;
|
|
79
|
+
loopSource?: any[];
|
|
80
|
+
};
|
|
@@ -56,6 +56,7 @@ export type TTextComponent = TBaseComponent & {
|
|
|
56
56
|
text: string;
|
|
57
57
|
strikethrough?: boolean | string;
|
|
58
58
|
linkColor?: string;
|
|
59
|
+
dateTimeFormat?: string;
|
|
59
60
|
};
|
|
60
61
|
export type TTextLikeComponent = TTextComponent | TTextListComponent | TSymbolComponent;
|
|
61
62
|
export type TTextListComponent = Omit<TTextComponent, "component" | "text"> & {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TButtonContainer, TCarouselContainer, TCarouselSlide, TCollapseContainer, TFlexProductContainer, TProductContainer, TStack, UserAction } from "./containers";
|
|
1
|
+
import { TButtonContainer, TCarouselContainer, TCarouselSlide, TCollapseContainer, TFlexProductContainer, TProductContainer, TResponsiveGrid, TStack, UserAction } from "./containers";
|
|
2
2
|
import { TConditionalComponent, TImageComponent, TSegmentPicker, TSegmentPickerItem, TSpacerComponent, TSvgImageComponent, TSymbolComponent, TTextComponent, TTextListComponent, TVideoComponent } from "./elements";
|
|
3
3
|
export interface TBaseComponent {
|
|
4
4
|
id?: string;
|
|
@@ -64,7 +64,7 @@ export interface TBaseComponent {
|
|
|
64
64
|
fixedWidth?: number | "fitContent";
|
|
65
65
|
hidden?: boolean;
|
|
66
66
|
}
|
|
67
|
-
export type TComponent = TButtonContainer | TContainer | TTextListComponent | TTextComponent | TSpacerComponent | TImageComponent | TSvgImageComponent | TSymbolComponent | TCarouselContainer | TProductContainer | TFlexProductContainer | TStack | TConditionalComponent | TSegmentPicker | TSegmentPickerItem | TVideoComponent | TCollapseContainer;
|
|
67
|
+
export type TComponent = TButtonContainer | TContainer | TTextListComponent | TTextComponent | TSpacerComponent | TImageComponent | TSvgImageComponent | TSymbolComponent | TCarouselContainer | TProductContainer | TFlexProductContainer | TStack | TConditionalComponent | TSegmentPicker | TSegmentPickerItem | TVideoComponent | TCollapseContainer | TResponsiveGrid;
|
|
68
68
|
export type DirectionType = "vertical" | "horizontal";
|
|
69
69
|
export type AlignmentType = "center" | "right" | "left" | "top" | "bottom";
|
|
70
70
|
export type BorderLocationType = "upperLeft" | "upperRight" | "lowerLeft" | "lowerRight";
|
package/dist/types/config.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { NamiCampaign } from "
|
|
1
|
+
import { NamiCampaign } from "../types/externals/campaign";
|
|
2
2
|
import { TDevice } from "./device";
|
|
3
3
|
import { NamiLanguageCodes } from "./externals/languages";
|
|
4
|
-
import { NamiLogLevel } from "./loglevel";
|
|
4
|
+
import { NamiLogLevel } from "./externals/loglevel";
|
|
5
5
|
import { IPaywall } from "./paywall";
|
|
6
6
|
import { PaywallSKU } from "./sku";
|
|
7
7
|
export interface IConfig {
|
|
@@ -6,6 +6,7 @@ export type IEntitlements = {
|
|
|
6
6
|
name: string;
|
|
7
7
|
description: string | null;
|
|
8
8
|
type: string;
|
|
9
|
+
expires?: string;
|
|
9
10
|
};
|
|
10
11
|
export type NamiEntitlement = {
|
|
11
12
|
activePurchases: NamiPurchase[];
|
|
@@ -15,5 +16,6 @@ export type NamiEntitlement = {
|
|
|
15
16
|
purchasedSkus: NamiSKU[];
|
|
16
17
|
referenceId: string;
|
|
17
18
|
relatedSkus: NamiSKU[];
|
|
19
|
+
expires?: number;
|
|
18
20
|
};
|
|
19
21
|
export type NamiActiveEntitlementsHandler = (entitlement: NamiEntitlement[]) => void;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { CampaignRuleConversionEventType, FormFactor } from "../campaign";
|
|
2
|
+
/**
|
|
3
|
+
* @type NamiCampaign
|
|
4
|
+
* Represents the campaign in Nami.
|
|
5
|
+
*/
|
|
2
6
|
export interface NamiCampaign {
|
|
3
7
|
rule: string;
|
|
4
8
|
name: string;
|
|
@@ -7,10 +11,14 @@ export interface NamiCampaign {
|
|
|
7
11
|
type: string | NamiCampaignRuleType;
|
|
8
12
|
value?: string | null;
|
|
9
13
|
form_factors: FormFactor[];
|
|
10
|
-
|
|
14
|
+
external_segment: string | null;
|
|
11
15
|
conversion_event_type?: CampaignRuleConversionEventType;
|
|
12
16
|
conversion_event_url?: string;
|
|
13
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* @enum NamiCampaignRuleType
|
|
20
|
+
* Types of Nami campaigns
|
|
21
|
+
*/
|
|
14
22
|
export declare enum NamiCampaignRuleType {
|
|
15
23
|
DEFAULT = "default",
|
|
16
24
|
LABEL = "label",
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { IConfig } from "../config";
|
|
2
2
|
import { TDevice } from "../device";
|
|
3
3
|
import { NamiLanguageCodes } from "./languages";
|
|
4
|
-
import { NamiLogLevel } from "
|
|
4
|
+
import { NamiLogLevel } from "./loglevel";
|
|
5
5
|
import { IPaywall } from "../paywall";
|
|
6
6
|
import { PaywallSKU } from "../sku";
|
|
7
7
|
import { NamiCampaign } from "./campaign";
|
|
8
|
+
/**
|
|
9
|
+
* @type NamiInitialConfig
|
|
10
|
+
*
|
|
11
|
+
* Defines the structure of the initial configuration that can be provided
|
|
12
|
+
* when setting up the Nami SDK.
|
|
13
|
+
*/
|
|
8
14
|
export type NamiInitialConfig = {
|
|
9
15
|
appConfig?: IConfig;
|
|
10
16
|
platform_config?: IConfig;
|
|
@@ -12,6 +18,26 @@ export type NamiInitialConfig = {
|
|
|
12
18
|
paywalls?: IPaywall[];
|
|
13
19
|
campaign_rules?: NamiCampaign[];
|
|
14
20
|
};
|
|
21
|
+
/**
|
|
22
|
+
* @type NamiConfiguration
|
|
23
|
+
* This is needed to configure and initialize the SDK via [Nami.configure]
|
|
24
|
+
* method
|
|
25
|
+
*
|
|
26
|
+
* @param appPlatformID A UUID for the app. You can find the Nami App Platform ID in the App
|
|
27
|
+
* Settings screen on the Platforms tab in the Nami Control Center.
|
|
28
|
+
* @param logLevel Optional preferable [NamiLogLevel] to set within SDK to get appropriate
|
|
29
|
+
* logging information. Make sure to either not set this param in release build, or set
|
|
30
|
+
* to [NamiLogLevel.ERROR] if you would like Nami error logs to be shown in your release/production
|
|
31
|
+
* app build. Default is set to [NamiLogLevel.WARN]
|
|
32
|
+
* @param namiCommands provides set of external commands useful for SDK.
|
|
33
|
+
* @param initialConfig contains initial configuration, useful in offline mode.
|
|
34
|
+
* @param namiLanguageCode sets the language to be used for paywalls on the device. Select from
|
|
35
|
+
* [NamiLanguageCode]
|
|
36
|
+
* <p>
|
|
37
|
+
* Default is set to `false`. Note that this should be set to `true` only from `debug` or
|
|
38
|
+
* `non-production` version of the app. Setting this to `true` in a `production` build can
|
|
39
|
+
* potentially have unwanted consequences.
|
|
40
|
+
*/
|
|
15
41
|
export type NamiConfiguration = {
|
|
16
42
|
appPlatformID: string;
|
|
17
43
|
logLevel: NamiLogLevel;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This data class represents a customer's subscription journey state
|
|
3
|
+
*/
|
|
4
|
+
export type CustomerJourneyState = {
|
|
5
|
+
former_subscriber: boolean;
|
|
6
|
+
in_grace_period: boolean;
|
|
7
|
+
in_trial_period: boolean;
|
|
8
|
+
in_intro_offer_period: boolean;
|
|
9
|
+
is_cancelled: boolean;
|
|
10
|
+
in_pause: boolean;
|
|
11
|
+
in_account_hold: boolean;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* This data class represents a device's profile
|
|
15
|
+
*/
|
|
16
|
+
export type DeviceProfile = {
|
|
17
|
+
customer_journey_state: CustomerJourneyState;
|
|
18
|
+
};
|
|
@@ -1,11 +1,38 @@
|
|
|
1
1
|
import { NamiPurchase } from "./purchase";
|
|
2
2
|
import { NamiSKU } from "./sku";
|
|
3
|
+
/**
|
|
4
|
+
* @type NamiEntitlement
|
|
5
|
+
* Represents what features a device has access to in an app.
|
|
6
|
+
*/
|
|
3
7
|
export type NamiEntitlement = {
|
|
8
|
+
/**
|
|
9
|
+
* The last known Purchase that unlocked this entitlement. There must be a corresponding
|
|
10
|
+
* NamiSKU associated to this NamiPurchase. That NamiSKU must reside in purchasedSKUs.
|
|
11
|
+
*/
|
|
4
12
|
activePurchases: NamiPurchase[];
|
|
13
|
+
/**
|
|
14
|
+
* Description of entitlement
|
|
15
|
+
*/
|
|
5
16
|
desc: string;
|
|
17
|
+
/**
|
|
18
|
+
* Friendly name of entitlement
|
|
19
|
+
*/
|
|
6
20
|
name: string;
|
|
21
|
+
/**
|
|
22
|
+
* Internal ID for use by the Nami SDK
|
|
23
|
+
*/
|
|
7
24
|
namiId: string;
|
|
25
|
+
/**
|
|
26
|
+
* NamiSKUs purchased by the user that actually unlock this entitlement
|
|
27
|
+
*/
|
|
8
28
|
purchasedSkus: NamiSKU[];
|
|
29
|
+
/**
|
|
30
|
+
* The unique ID of the entitlement defined in the Nami Control Center, use this to refer
|
|
31
|
+
* to the system when referencing an entitlement.
|
|
32
|
+
*/
|
|
9
33
|
referenceId: string;
|
|
34
|
+
/**
|
|
35
|
+
* The list of possible NamiSKU objects that would unlock this entitlement
|
|
36
|
+
*/
|
|
10
37
|
relatedSkus: NamiSKU[];
|
|
11
38
|
};
|
|
@@ -1 +1,197 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @type NamiLanguageCodes
|
|
3
|
+
* Languages supported by Nami paywalls
|
|
4
|
+
*/
|
|
5
|
+
export type NamiLanguageCodes =
|
|
6
|
+
/** Language Afrikaans **/
|
|
7
|
+
"af"
|
|
8
|
+
/** Language Arabic **/
|
|
9
|
+
| "ar"
|
|
10
|
+
/** Language Algerian **/
|
|
11
|
+
| "ar-dz"
|
|
12
|
+
/** Language Asturian **/
|
|
13
|
+
| "ast"
|
|
14
|
+
/** Language Azerbaijani **/
|
|
15
|
+
| "az"
|
|
16
|
+
/** Language Bulgarian **/
|
|
17
|
+
| "bg"
|
|
18
|
+
/** Language Belarusian **/
|
|
19
|
+
| "be"
|
|
20
|
+
/** Language Bengali **/
|
|
21
|
+
| "bn"
|
|
22
|
+
/** Language Breton **/
|
|
23
|
+
| "br"
|
|
24
|
+
/** Language Bosnian **/
|
|
25
|
+
| "bs"
|
|
26
|
+
/** Language Catalan **/
|
|
27
|
+
| "ca"
|
|
28
|
+
/** Language Czech **/
|
|
29
|
+
| "cs"
|
|
30
|
+
/** Language Welsh **/
|
|
31
|
+
| "cy"
|
|
32
|
+
/** Language Danish **/
|
|
33
|
+
| "da"
|
|
34
|
+
/** Language German **/
|
|
35
|
+
| "de"
|
|
36
|
+
/** Language Lower Sorbian **/
|
|
37
|
+
| "dsb"
|
|
38
|
+
/** Language Greek **/
|
|
39
|
+
| "el"
|
|
40
|
+
/** Language English **/
|
|
41
|
+
| "en"
|
|
42
|
+
/** Language Australian English **/
|
|
43
|
+
| "en-au"
|
|
44
|
+
/** Language British English **/
|
|
45
|
+
| "en-gb"
|
|
46
|
+
/** Language Esperanto **/
|
|
47
|
+
| "eo"
|
|
48
|
+
/** Language Spanish **/
|
|
49
|
+
| "es"
|
|
50
|
+
/** Language Argentinian Spanish **/
|
|
51
|
+
| "es-ar"
|
|
52
|
+
/** Language Colombian Spanish **/
|
|
53
|
+
| "es-co"
|
|
54
|
+
/** Language Mexican Spanish **/
|
|
55
|
+
| "es-mx"
|
|
56
|
+
/** Language Nicaraguan Spanish **/
|
|
57
|
+
| "es-ni"
|
|
58
|
+
/** Language Venezuelan Spanish **/
|
|
59
|
+
| "es-ve"
|
|
60
|
+
/** Language Estonian **/
|
|
61
|
+
| "et"
|
|
62
|
+
/** Language Basque **/
|
|
63
|
+
| "eu"
|
|
64
|
+
/** Language Persian **/
|
|
65
|
+
| "fa"
|
|
66
|
+
/** Language Finnish **/
|
|
67
|
+
| "fi"
|
|
68
|
+
/** Language French **/
|
|
69
|
+
| "fr"
|
|
70
|
+
/** Language Frisian **/
|
|
71
|
+
| "fy"
|
|
72
|
+
/** Language Irish **/
|
|
73
|
+
| "ga"
|
|
74
|
+
/** Language Scottish Gaelic **/
|
|
75
|
+
| "gd"
|
|
76
|
+
/** Language Galician **/
|
|
77
|
+
| "gl"
|
|
78
|
+
/** Language Hebrew **/
|
|
79
|
+
| "he"
|
|
80
|
+
/** Language Hindi **/
|
|
81
|
+
| "hi"
|
|
82
|
+
/** Language Croatian **/
|
|
83
|
+
| "hr"
|
|
84
|
+
/** Language Upper Sorbian **/
|
|
85
|
+
| "hsb"
|
|
86
|
+
/** Language Hungarian **/
|
|
87
|
+
| "hu"
|
|
88
|
+
/** Language Armenian **/
|
|
89
|
+
| "hy"
|
|
90
|
+
/** Language Interlingua **/
|
|
91
|
+
| "ia"
|
|
92
|
+
/** Language Indonesian **/
|
|
93
|
+
| "id"
|
|
94
|
+
/** Language Igbo **/
|
|
95
|
+
| "ig"
|
|
96
|
+
/** Language Ido **/
|
|
97
|
+
| "io"
|
|
98
|
+
/** Language Icelandic **/
|
|
99
|
+
| "is"
|
|
100
|
+
/** Language Italian **/
|
|
101
|
+
| "it"
|
|
102
|
+
/** Language Japanese **/
|
|
103
|
+
| "ja"
|
|
104
|
+
/** Language Georgian **/
|
|
105
|
+
| "ka"
|
|
106
|
+
/** Language Kabyle **/
|
|
107
|
+
| "kab"
|
|
108
|
+
/** Language Kazakh **/
|
|
109
|
+
| "kk"
|
|
110
|
+
/** Language Khmer **/
|
|
111
|
+
| "km"
|
|
112
|
+
/** Language Kannada **/
|
|
113
|
+
| "kn"
|
|
114
|
+
/** Language Korean **/
|
|
115
|
+
| "ko"
|
|
116
|
+
/** Language Kyrgyz **/
|
|
117
|
+
| "ky"
|
|
118
|
+
/** Language Luxembourgish **/
|
|
119
|
+
| "lb"
|
|
120
|
+
/** Language Lithuanian **/
|
|
121
|
+
| "lt"
|
|
122
|
+
/** Language Latvian **/
|
|
123
|
+
| "lv"
|
|
124
|
+
/** Language Macedonian **/
|
|
125
|
+
| "mk"
|
|
126
|
+
/** Language Malayalam **/
|
|
127
|
+
| "ml"
|
|
128
|
+
/** Language Mongolian **/
|
|
129
|
+
| "mn"
|
|
130
|
+
/** Language Marathi **/
|
|
131
|
+
| "mr"
|
|
132
|
+
/** Language Burmese **/
|
|
133
|
+
| "my"
|
|
134
|
+
/** Language Norwegian Bokmål **/
|
|
135
|
+
| "nb"
|
|
136
|
+
/** Language Nepali **/
|
|
137
|
+
| "ne"
|
|
138
|
+
/** Language Dutch **/
|
|
139
|
+
| "nl"
|
|
140
|
+
/** Language Norwegian Nynorsk **/
|
|
141
|
+
| "nn"
|
|
142
|
+
/** Language Ossetic **/
|
|
143
|
+
| "os"
|
|
144
|
+
/** Language Punjabi **/
|
|
145
|
+
| "pa"
|
|
146
|
+
/** Language Polish **/
|
|
147
|
+
| "pl"
|
|
148
|
+
/** Language Portuguese **/
|
|
149
|
+
| "pt"
|
|
150
|
+
/** Language Brazilian Portuguese **/
|
|
151
|
+
| "pt-br"
|
|
152
|
+
/** Language Romanian **/
|
|
153
|
+
| "ro"
|
|
154
|
+
/** Language Russian **/
|
|
155
|
+
| "ru"
|
|
156
|
+
/** Language Slovak **/
|
|
157
|
+
| "sk"
|
|
158
|
+
/** Language Slovenian **/
|
|
159
|
+
| "sl"
|
|
160
|
+
/** Language Albanian **/
|
|
161
|
+
| "sq"
|
|
162
|
+
/** Language Serbian **/
|
|
163
|
+
| "sr"
|
|
164
|
+
/** Language Serbian Latin **/
|
|
165
|
+
| "sr-latn"
|
|
166
|
+
/** Language Swedish **/
|
|
167
|
+
| "sv"
|
|
168
|
+
/** Language Swahili **/
|
|
169
|
+
| "sw"
|
|
170
|
+
/** Language Tamil **/
|
|
171
|
+
| "ta"
|
|
172
|
+
/** Language Telugu **/
|
|
173
|
+
| "te"
|
|
174
|
+
/** Language Tajik **/
|
|
175
|
+
| "tg"
|
|
176
|
+
/** Language Thai **/
|
|
177
|
+
| "th"
|
|
178
|
+
/** Language Turkmen **/
|
|
179
|
+
| "tk"
|
|
180
|
+
/** Language Turkish **/
|
|
181
|
+
| "tr"
|
|
182
|
+
/** Language Tatar **/
|
|
183
|
+
| "tt"
|
|
184
|
+
/** Language Udmurt **/
|
|
185
|
+
| "udm"
|
|
186
|
+
/** Language Ukrainian **/
|
|
187
|
+
| "uk"
|
|
188
|
+
/** Language Urdu **/
|
|
189
|
+
| "ur"
|
|
190
|
+
/** Language Uzbek **/
|
|
191
|
+
| "uz"
|
|
192
|
+
/** Language Vietnamese **/
|
|
193
|
+
| "vi"
|
|
194
|
+
/** Language Simplified Chinese **/
|
|
195
|
+
| "zh-hans"
|
|
196
|
+
/** Language Traditional Chinese **/
|
|
197
|
+
| "zh-hant";
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { NamiPurchase } from "./purchase";
|
|
2
2
|
import { NamiSKU } from "./sku";
|
|
3
|
+
/**
|
|
4
|
+
* @enum NamiPaywallAction
|
|
5
|
+
* Types of actions paywall will have
|
|
6
|
+
*/
|
|
3
7
|
export declare enum NamiPaywallAction {
|
|
4
8
|
BUY_SKU = "BUY_SKU",
|
|
5
9
|
SELECT_SKU = "SELECT_SKU",
|
|
@@ -29,7 +33,14 @@ export declare enum NamiPaywallAction {
|
|
|
29
33
|
VIDEO_UNMUTED = "VIDEO_UNMUTED",
|
|
30
34
|
UNKNOWN = "UNKNOWN"
|
|
31
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* @type NamiPaywallEvent
|
|
38
|
+
* Represents the events(actions) triggered by rendered paywall
|
|
39
|
+
*/
|
|
32
40
|
export type NamiPaywallEvent = {
|
|
41
|
+
/**
|
|
42
|
+
* Any action from [NamiPaywallAction]
|
|
43
|
+
*/
|
|
33
44
|
action: NamiPaywallAction;
|
|
34
45
|
sku?: NamiSKU;
|
|
35
46
|
campaignId?: string;
|
|
@@ -40,14 +51,28 @@ export type NamiPaywallEvent = {
|
|
|
40
51
|
paywallId?: string;
|
|
41
52
|
paywallName?: string;
|
|
42
53
|
componentChange?: NamiPaywallComponentChange;
|
|
54
|
+
/**
|
|
55
|
+
* segment from [NamiCampaign]
|
|
56
|
+
*/
|
|
43
57
|
segmentId?: string;
|
|
58
|
+
/**
|
|
59
|
+
* external_segment from [NamiCampaign]
|
|
60
|
+
*/
|
|
44
61
|
externalSegmentId: string | null;
|
|
45
62
|
deeplinkUrl?: string;
|
|
46
63
|
purchaseError?: string;
|
|
47
64
|
purchases?: NamiPurchase[];
|
|
65
|
+
/**
|
|
66
|
+
* Total time user has spent on paywall page,
|
|
67
|
+
* From rendering paywall to clicking on close button of paywall
|
|
68
|
+
*/
|
|
48
69
|
timeSpentOnPaywall?: number;
|
|
49
70
|
};
|
|
50
71
|
export type NamiPaywallActionHandler = (event: NamiPaywallEvent) => void;
|
|
72
|
+
/**
|
|
73
|
+
* @type NamiPaywallLaunchContext
|
|
74
|
+
* Will be used to pass custom context while launching paywall
|
|
75
|
+
*/
|
|
51
76
|
export type NamiPaywallLaunchContext = {
|
|
52
77
|
productGroups?: string[];
|
|
53
78
|
customAttributes: {
|
|
@@ -57,10 +82,16 @@ export type NamiPaywallLaunchContext = {
|
|
|
57
82
|
[key: string]: any;
|
|
58
83
|
};
|
|
59
84
|
};
|
|
85
|
+
/**
|
|
86
|
+
* @type NamiPaywallComponentChange
|
|
87
|
+
*/
|
|
60
88
|
export type NamiPaywallComponentChange = {
|
|
61
89
|
id?: string;
|
|
62
90
|
name?: string;
|
|
63
91
|
};
|
|
92
|
+
/**
|
|
93
|
+
* @type NamiPaywallEventVideoMetadata
|
|
94
|
+
*/
|
|
64
95
|
export type NamiPaywallEventVideoMetadata = {
|
|
65
96
|
id?: string;
|
|
66
97
|
name?: string;
|
|
@@ -1,12 +1,36 @@
|
|
|
1
1
|
import { NamiPurchaseSource } from "../purchase";
|
|
2
2
|
import { NamiSKU } from "./sku";
|
|
3
|
+
/**
|
|
4
|
+
* @type NamiPurchase
|
|
5
|
+
* This object represents a completed purchase in the SDK. A device purchases a NamiSKU and that
|
|
6
|
+
* purchase makes available a set of NamiEntitlements
|
|
7
|
+
*/
|
|
3
8
|
export type NamiPurchase = {
|
|
4
9
|
sku?: NamiSKU;
|
|
10
|
+
/**
|
|
11
|
+
* The store sku reference identifier for this NamiPurchase
|
|
12
|
+
*/
|
|
5
13
|
skuId: string;
|
|
14
|
+
/**
|
|
15
|
+
* The purchase order ID record or receipt ID associated to this purchase
|
|
16
|
+
*/
|
|
6
17
|
transactionIdentifier?: string;
|
|
18
|
+
/**
|
|
19
|
+
* For bypass store purchases only, indicates when this purchase will cease to back
|
|
20
|
+
* an entitlement rendering it as inactive.
|
|
21
|
+
*/
|
|
7
22
|
expires?: Date;
|
|
23
|
+
/**
|
|
24
|
+
* The source a purchase comes from - either on Google Play (marketplace), through a paywall (campaign).
|
|
25
|
+
*/
|
|
8
26
|
purchaseToken?: string;
|
|
27
|
+
/**
|
|
28
|
+
* The date and time when the purchase was initiated
|
|
29
|
+
*/
|
|
9
30
|
purchaseInitiatedTimestamp?: Date;
|
|
31
|
+
/**
|
|
32
|
+
* The source a purchase comes from - either on Google Play (marketplace), through a paywall (campaign).
|
|
33
|
+
*/
|
|
10
34
|
purchaseSource?: NamiPurchaseSource;
|
|
11
35
|
};
|
|
12
36
|
export type NamiPurchasesState = 'pending' | 'purchased' | 'consumed' | 'resubscribed' | 'unsubscribed' | 'deferred' | 'failed' | 'cancelled' | 'unknown';
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { IEntitlements } from "../paywall";
|
|
2
2
|
import { AmazonProduct, AppleProduct, GoogleProduct } from "../sku";
|
|
3
3
|
import { NamiProductDetails } from "./product";
|
|
4
|
+
/**
|
|
5
|
+
* @type NamiSKU
|
|
6
|
+
* This object represents a specific in-app purchase SKU available on a specific platform.
|
|
7
|
+
*
|
|
8
|
+
* It contains some general meta-data about specific SKU and associated [ProductDetails] object from
|
|
9
|
+
* Google Play Billing.
|
|
10
|
+
*
|
|
11
|
+
* Note that in certain cases, depending on cached state of the SDK, [ProductDetails] might not
|
|
12
|
+
* be fully complete object (potentially generated temporarily with minimum required information)
|
|
13
|
+
*/
|
|
4
14
|
export type NamiSKU = {
|
|
5
15
|
id: string;
|
|
6
16
|
name?: string;
|
|
@@ -14,4 +24,8 @@ export type NamiSKU = {
|
|
|
14
24
|
productDetails?: NamiProductDetails | null;
|
|
15
25
|
entitlements: IEntitlements[];
|
|
16
26
|
};
|
|
27
|
+
/**
|
|
28
|
+
* @type NamiSKUType
|
|
29
|
+
* Types of products from Nami
|
|
30
|
+
*/
|
|
17
31
|
export type NamiSKUType = 'unknown' | 'one_time_purchase' | 'subscription';
|