@namiml/web-sdk 1.3.2 → 1.5.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.
Files changed (86) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/components/ContextConsumer.d.ts +1 -1
  3. package/dist/components/ContextProvider.d.ts +7 -7
  4. package/dist/components/Paywall.d.ts +5 -4
  5. package/dist/components/TemplateComponent.d.ts +1 -1
  6. package/dist/components/containers/BackgroundContainer.d.ts +2 -1
  7. package/dist/components/containers/CarouselContainer.d.ts +9 -0
  8. package/dist/components/containers/CollapseContainer.d.ts +1 -1
  9. package/dist/components/containers/Container.d.ts +6 -2
  10. package/dist/components/containers/Content.d.ts +1 -1
  11. package/dist/components/containers/Footer.d.ts +1 -1
  12. package/dist/components/containers/Header.d.ts +1 -1
  13. package/dist/components/containers/ProductContainer.d.ts +1 -1
  14. package/dist/components/containers/ResponsiveGrid.d.ts +17 -0
  15. package/dist/components/elements/Button.d.ts +4 -1
  16. package/dist/components/elements/Image.d.ts +1 -1
  17. package/dist/components/elements/PlayPauseButton.d.ts +15 -0
  18. package/dist/components/elements/SegmentPicker.d.ts +1 -1
  19. package/dist/components/elements/SegmentPickerItem.d.ts +1 -1
  20. package/dist/components/elements/Spacer.d.ts +1 -1
  21. package/dist/components/elements/Text.d.ts +1 -1
  22. package/dist/components/elements/Video.d.ts +2 -1
  23. package/dist/components/elements/VolumeButton.d.ts +15 -0
  24. package/dist/components/index.d.ts +9 -1
  25. package/dist/components/productDetails.d.ts +2 -2
  26. package/dist/components/utils/actionTap.d.ts +2 -2
  27. package/dist/components/utils/dateTIme.d.ts +3 -0
  28. package/dist/components/utils/eventConst.d.ts +1 -1
  29. package/dist/components/utils/helpers.d.ts +9 -6
  30. package/dist/components/utils/impression.d.ts +2 -2
  31. package/dist/components/utils/products.d.ts +4 -3
  32. package/dist/components/utils/state.d.ts +6 -6
  33. package/dist/components/utils/styles.d.ts +5 -3
  34. package/dist/nami/api.d.ts +4 -3
  35. package/dist/nami/campaign.d.ts +36 -10
  36. package/dist/nami/customer.d.ts +58 -14
  37. package/dist/nami/emitter.d.ts +1 -0
  38. package/dist/nami/entitlement.d.ts +22 -5
  39. package/dist/nami/index.d.ts +7 -1
  40. package/dist/nami/namiRefs.d.ts +1 -1
  41. package/dist/nami/paywalls.d.ts +49 -18
  42. package/dist/nami/purchase.d.ts +5 -1
  43. package/dist/nami/utils/campaign.d.ts +2 -2
  44. package/dist/nami/utils/entitlement.d.ts +4 -4
  45. package/dist/nami/utils/paywall.d.ts +1 -1
  46. package/dist/nami/utils/purchase.d.ts +2 -2
  47. package/dist/nami-web.cjs +22 -15
  48. package/dist/nami-web.d.ts +8 -880
  49. package/dist/nami-web.js +22 -15
  50. package/dist/nami-web.mjs +22 -15
  51. package/dist/nami-web.umd.js +22 -15
  52. package/dist/repositories/campaignRule.repository.d.ts +3 -3
  53. package/dist/repositories/config.repository.d.ts +1 -1
  54. package/dist/repositories/customerJourney.repository.d.ts +5 -0
  55. package/dist/repositories/device.repository.d.ts +1 -1
  56. package/dist/repositories/entitlement.repository.d.ts +1 -1
  57. package/dist/repositories/paywall.repository.d.ts +1 -1
  58. package/dist/repositories/products.repository.d.ts +1 -1
  59. package/dist/services/logger.service.d.ts +1 -1
  60. package/dist/services/storage.service.d.ts +7 -1
  61. package/dist/services/video.service.d.ts +17 -0
  62. package/dist/types/components/containers.d.ts +35 -4
  63. package/dist/types/components/elements.d.ts +1 -0
  64. package/dist/types/components/index.d.ts +4 -2
  65. package/dist/types/config.d.ts +2 -2
  66. package/dist/types/customer.d.ts +2 -0
  67. package/dist/types/entitlements.d.ts +2 -0
  68. package/dist/types/externals/campaign.d.ts +9 -1
  69. package/dist/types/externals/config.d.ts +27 -1
  70. package/dist/types/externals/customer.d.ts +18 -0
  71. package/dist/types/externals/entitlement.d.ts +27 -0
  72. package/dist/types/externals/index.d.ts +3 -0
  73. package/dist/types/externals/languages.d.ts +197 -1
  74. package/dist/types/{loglevel.d.ts → externals/loglevel.d.ts} +3 -0
  75. package/dist/types/externals/paywall.d.ts +32 -0
  76. package/dist/types/externals/product.d.ts +4 -0
  77. package/dist/types/externals/purchase.d.ts +24 -0
  78. package/dist/types/externals/sku.d.ts +14 -0
  79. package/dist/types/paywall.d.ts +4 -3
  80. package/dist/types/profile.d.ts +2 -1
  81. package/dist/utils/config.d.ts +2 -1
  82. package/dist/utils/const.d.ts +1 -1
  83. package/dist/utils/device.d.ts +1 -1
  84. package/dist/utils/fonts.d.ts +1 -1
  85. package/package.json +6 -4
  86. /package/dist/types/{errors.d.ts → externals/errors.d.ts} +0 -0
@@ -1,6 +1,6 @@
1
- import { IPaywall } from "src/types/paywall";
2
- import { TDevice } from "src/types/device";
3
- import { NamiCampaign } from "src/types/externals/campaign";
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;
@@ -1,4 +1,4 @@
1
- import { IConfig } from "src/types/config";
1
+ import { IConfig } from "../types/config";
2
2
  export declare class ConfigRepository {
3
3
  static instance: ConfigRepository;
4
4
  fetchConfig(): Promise<IConfig | null>;
@@ -0,0 +1,5 @@
1
+ import { CustomerJourneyState } from "src/types/externals/customer";
2
+ export declare class CustomerJourneyRepository {
3
+ static instance: CustomerJourneyRepository;
4
+ fetchCustomerJourneyState(): Promise<CustomerJourneyState | null>;
5
+ }
@@ -1,4 +1,4 @@
1
- import { Device, DevicePayload } from "src/types/device";
1
+ import { Device, DevicePayload } from "../types/device";
2
2
  export declare class DeviceRepository {
3
3
  static instance: DeviceRepository;
4
4
  createOrUpdateDevice(deviceData: DevicePayload): Promise<Device | null>;
@@ -1,4 +1,4 @@
1
- import { IEntitlements } from "src/types/entitlements";
1
+ import { IEntitlements } from "../types/entitlements";
2
2
  export declare class EntitlementRepository {
3
3
  static instance: EntitlementRepository;
4
4
  constructor();
@@ -1,4 +1,4 @@
1
- import { IPaywall } from "src/types/paywall";
1
+ import { IPaywall } from "../types/paywall";
2
2
  export declare class PaywallRepository {
3
3
  static instance: PaywallRepository;
4
4
  fetchPaywalls(): Promise<IPaywall[]>;
@@ -1,4 +1,4 @@
1
- import { SKU } from "src/types/sku";
1
+ import { SKU } from "../types/sku";
2
2
  export declare class ProductRepository {
3
3
  static instance: ProductRepository;
4
4
  fetchProducts(): Promise<SKU[]>;
@@ -1,4 +1,4 @@
1
- import { NamiLogLevel } from "src/types/loglevel";
1
+ import { NamiLogLevel } from "../types/externals/loglevel";
2
2
  declare class Logger {
3
3
  private currentLogLevel;
4
4
  setLogger: (level?: NamiLogLevel) => void;
@@ -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 "src/types/entitlements";
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;
@@ -0,0 +1,17 @@
1
+ import { NamiPaywallAction } from "src/types/externals/paywall";
2
+ export declare class VideoService {
3
+ video: HTMLVideoElement;
4
+ playing: boolean;
5
+ muted: boolean;
6
+ muteByDefault: boolean;
7
+ loopVideo: boolean;
8
+ autoplayVideo: boolean;
9
+ videoComponentName: string;
10
+ videoComponentId: string;
11
+ static instance: VideoService;
12
+ constructor(video: HTMLVideoElement, muteByDefault: boolean, loopVideo: boolean, autoplayVideo: boolean, name?: string, id?: string);
13
+ togglePlayVideo(): void;
14
+ toggleMuteVideo(): void;
15
+ videoPlayingAction(): NamiPaywallAction.VIDEO_STARTED | NamiPaywallAction.VIDEO_PAUSED | NamiPaywallAction.VIDEO_RESUMED | NamiPaywallAction.VIDEO_ENDED | NamiPaywallAction.UNKNOWN;
16
+ handlePlayerAnalytics(action?: NamiPaywallAction): void;
17
+ }
@@ -1,14 +1,30 @@
1
- import { NamiSKU } from "src/types/externals/sku";
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)[];
5
- export type TButtonContainer = TBaseComponent & {
5
+ type Button = TBaseComponent & {
6
6
  id?: string;
7
- component: "button";
8
7
  sku?: NamiSKU;
9
8
  components: Array<TTextComponent | TTextListComponent | TSpacerComponent | TImageComponent>;
10
9
  screenreaderText?: string;
11
10
  };
11
+ export type TButtonContainer = Button & {
12
+ component: "button";
13
+ };
14
+ export type TPlayPauseButton = Button & {
15
+ component: "playPauseButton";
16
+ pausedOnTap: UserAction;
17
+ playingOnTap: UserAction;
18
+ pausedComponents: TComponent[];
19
+ playingComponents: TComponent[];
20
+ };
21
+ export type TVolumeButton = Button & {
22
+ component: "volumeButton";
23
+ mutedComponents: TComponent[];
24
+ volumeComponents: TComponent[];
25
+ mutedOnTap: UserAction;
26
+ volumeOnTap: UserAction;
27
+ };
12
28
  export type UserAction = {
13
29
  function: string;
14
30
  parameters?: UserActionParameters;
@@ -21,13 +37,20 @@ export type UserActionParameters = {
21
37
  confirmationMessage?: string;
22
38
  confirmBeforePurchase?: TTestObject[];
23
39
  };
24
- export type Callback = (sku?: NamiSKU) => void;
40
+ export type SKUActionHandler = (sku: NamiSKU) => void;
41
+ export type DeepLinkUrlHandler = (url: string) => void;
42
+ export type CloseHandler = (body?: any) => void;
43
+ export type Callback = () => void;
25
44
  export type TCarouselContainer = Omit<TContainer, "component"> & {
26
45
  component: "carouselContainer";
27
46
  indicatorColor: string;
28
47
  activeIndicatorColor: string;
29
48
  autoplay: boolean;
30
49
  autoplaySeconds: number;
50
+ loopSource?: any[];
51
+ loopVariable?: string;
52
+ loopSourceConditions: TTestObject[];
53
+ showIndicators?: boolean;
31
54
  };
32
55
  export type TCarouselSlidesState = {
33
56
  [groupId: string]: {
@@ -69,3 +92,11 @@ export type TCollapseContainer = TBaseComponent & {
69
92
  components: TComponent[];
70
93
  open: "collapse" | "open";
71
94
  };
95
+ export type TResponsiveGrid = TBaseComponent & {
96
+ component: "responsiveGrid";
97
+ components: any;
98
+ loopVariable?: string;
99
+ loopSource?: any[];
100
+ loopSourceConditions: TTestObject[];
101
+ };
102
+ export {};
@@ -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, TPlayPauseButton, TProductContainer, TResponsiveGrid, TStack, TVolumeButton, 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;
@@ -15,6 +15,8 @@ export interface TBaseComponent {
15
15
  direction?: DirectionType;
16
16
  spacing?: number;
17
17
  alignment?: AlignmentType;
18
+ horizontalAlignment?: AlignmentType;
19
+ verticalAlignment?: AlignmentType;
18
20
  leftPadding?: number;
19
21
  rightPadding?: number;
20
22
  topPadding?: number;
@@ -64,7 +66,7 @@ export interface TBaseComponent {
64
66
  fixedWidth?: number | "fitContent";
65
67
  hidden?: boolean;
66
68
  }
67
- export type TComponent = TButtonContainer | TContainer | TTextListComponent | TTextComponent | TSpacerComponent | TImageComponent | TSvgImageComponent | TSymbolComponent | TCarouselContainer | TProductContainer | TFlexProductContainer | TStack | TConditionalComponent | TSegmentPicker | TSegmentPickerItem | TVideoComponent | TCollapseContainer;
69
+ export type TComponent = TButtonContainer | TContainer | TTextListComponent | TTextComponent | TSpacerComponent | TImageComponent | TSvgImageComponent | TSymbolComponent | TCarouselContainer | TProductContainer | TFlexProductContainer | TStack | TConditionalComponent | TSegmentPicker | TSegmentPickerItem | TVideoComponent | TCollapseContainer | TResponsiveGrid | TVolumeButton | TPlayPauseButton;
68
70
  export type DirectionType = "vertical" | "horizontal";
69
71
  export type AlignmentType = "center" | "right" | "left" | "top" | "bottom";
70
72
  export type BorderLocationType = "upperLeft" | "upperRight" | "lowerLeft" | "lowerRight";
@@ -1,7 +1,7 @@
1
- import { NamiCampaign } from "src/types/externals/campaign";
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 {
@@ -0,0 +1,2 @@
1
+ import { CustomerJourneyState } from "./externals";
2
+ export type NamiCustomerJourneyStateHandler = (customerJourneyState: CustomerJourneyState) => void;
@@ -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
- external_segment_id: string | null;
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 "../loglevel";
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
  };
@@ -6,3 +6,6 @@ export * from "./product";
6
6
  export * from "./purchase";
7
7
  export * from "./languages";
8
8
  export * from "./entitlement";
9
+ export * from "./errors";
10
+ export * from "./customer";
11
+ export * from "./loglevel";
@@ -1 +1,197 @@
1
- export type NamiLanguageCodes = "af" | "ar" | "ar-dz" | "ast" | "az" | "bg" | "be" | "bn" | "br" | "bs" | "ca" | "cs" | "cy" | "da" | "de" | "dsb" | "el" | "en" | "en-au" | "en-gb" | "eo" | "es" | "es-ar" | "es-co" | "es-mx" | "es-ni" | "es-ve" | "et" | "eu" | "fa" | "fi" | "fr" | "fy" | "ga" | "gd" | "gl" | "he" | "hi" | "hr" | "hsb" | "hu" | "hy" | "ia" | "id" | "ig" | "io" | "is" | "it" | "ja" | "ka" | "kab" | "kk" | "km" | "kn" | "ko" | "ky" | "lb" | "lt" | "lv" | "mk" | "ml" | "mn" | "mr" | "my" | "nb" | "ne" | "nl" | "nn" | "os" | "pa" | "pl" | "pt" | "pt-br" | "ro" | "ru" | "sk" | "sl" | "sq" | "sr" | "sr-latn" | "sv" | "sw" | "ta" | "te" | "tg" | "th" | "tk" | "tr" | "tt" | "udm" | "uk" | "ur" | "uz" | "vi" | "zh-hans" | "zh-hant";
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,3 +1,6 @@
1
+ /**
2
+ * Set the level of logs to print while running the SDK
3
+ */
1
4
  export type NamiLogLevel = "error" | "warn" | "info" | "debug";
2
5
  export declare enum LogLevel {
3
6
  DEBUG = 1,
@@ -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,29 @@ 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;
70
+ videoMetaData?: NamiPaywallEventVideoMetadata;
49
71
  };
50
72
  export type NamiPaywallActionHandler = (event: NamiPaywallEvent) => void;
73
+ /**
74
+ * @type NamiPaywallLaunchContext
75
+ * Will be used to pass custom context while launching paywall
76
+ */
51
77
  export type NamiPaywallLaunchContext = {
52
78
  productGroups?: string[];
53
79
  customAttributes: {
@@ -57,10 +83,16 @@ export type NamiPaywallLaunchContext = {
57
83
  [key: string]: any;
58
84
  };
59
85
  };
86
+ /**
87
+ * @type NamiPaywallComponentChange
88
+ */
60
89
  export type NamiPaywallComponentChange = {
61
90
  id?: string;
62
91
  name?: string;
63
92
  };
93
+ /**
94
+ * @type NamiPaywallEventVideoMetadata
95
+ */
64
96
  export type NamiPaywallEventVideoMetadata = {
65
97
  id?: string;
66
98
  name?: string;
@@ -1,4 +1,8 @@
1
1
  import { NamiSKUType } from "../externals/sku";
2
+ /**
3
+ * @type NamiProductDetails
4
+ * minimal required product details formed from actual product details
5
+ */
2
6
  export interface NamiProductDetails {
3
7
  name?: string;
4
8
  description?: string;