@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.
- package/CHANGELOG.md +38 -0
- package/dist/components/ContextConsumer.d.ts +1 -1
- package/dist/components/ContextProvider.d.ts +7 -7
- package/dist/components/Paywall.d.ts +5 -4
- package/dist/components/TemplateComponent.d.ts +1 -1
- package/dist/components/containers/BackgroundContainer.d.ts +2 -1
- package/dist/components/containers/CarouselContainer.d.ts +9 -0
- 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 +17 -0
- package/dist/components/elements/Button.d.ts +4 -1
- package/dist/components/elements/Image.d.ts +1 -1
- package/dist/components/elements/PlayPauseButton.d.ts +15 -0
- 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/elements/VolumeButton.d.ts +15 -0
- package/dist/components/index.d.ts +9 -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/eventConst.d.ts +1 -1
- package/dist/components/utils/helpers.d.ts +9 -6
- 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 +5 -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/emitter.d.ts +1 -0
- 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 +22 -15
- package/dist/nami-web.d.ts +8 -880
- package/dist/nami-web.js +22 -15
- package/dist/nami-web.mjs +22 -15
- package/dist/nami-web.umd.js +22 -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/services/video.service.d.ts +17 -0
- package/dist/types/components/containers.d.ts +35 -4
- package/dist/types/components/elements.d.ts +1 -0
- package/dist/types/components/index.d.ts +4 -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 +32 -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 +4 -3
- 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 +6 -4
- /package/dist/types/{errors.d.ts → externals/errors.d.ts} +0 -0
|
@@ -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';
|
package/dist/types/paywall.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NamiCampaign } from "
|
|
1
|
+
import { NamiCampaign } from "../types/externals/campaign";
|
|
2
2
|
import { TComponent, TContainer } from "./components";
|
|
3
3
|
import { TButtonContainer, TCarouselSlidesState } from "./components/containers";
|
|
4
4
|
import { TSpacerComponent, TTextComponent } from "./components/elements";
|
|
@@ -6,8 +6,8 @@ import { TDeviceOrientation } from "./device";
|
|
|
6
6
|
import { PaywallSKU } from "./sku";
|
|
7
7
|
import { NamiPurchase } from "./externals/purchase";
|
|
8
8
|
import { Optional } from "./utils";
|
|
9
|
-
import { LaunchCampaignError } from "./errors";
|
|
10
|
-
import { NamiPaywallAction, NamiPaywallComponentChange, NamiPaywallLaunchContext } from "./externals/paywall";
|
|
9
|
+
import { LaunchCampaignError } from "./externals/errors";
|
|
10
|
+
import { NamiPaywallAction, NamiPaywallComponentChange, NamiPaywallEventVideoMetadata, NamiPaywallLaunchContext } from "./externals/paywall";
|
|
11
11
|
import { NamiSKU } from "./externals/sku";
|
|
12
12
|
export type TPaywallContext = TInitialState & {
|
|
13
13
|
paywallId: string;
|
|
@@ -173,6 +173,7 @@ export declare enum PaywallManagerEvents {
|
|
|
173
173
|
export type PaywallActionEvent = {
|
|
174
174
|
action: NamiPaywallAction;
|
|
175
175
|
sku?: NamiSKU;
|
|
176
|
+
videoMetaData: NamiPaywallEventVideoMetadata;
|
|
176
177
|
timeSpentOnPaywall?: number;
|
|
177
178
|
componentChange?: NamiPaywallComponentChange;
|
|
178
179
|
purchaseError?: string;
|
package/dist/types/profile.d.ts
CHANGED
|
@@ -2,7 +2,8 @@ export type NamiProfile = {
|
|
|
2
2
|
externalId: string;
|
|
3
3
|
};
|
|
4
4
|
/**
|
|
5
|
-
* Represents the possible actions that can be
|
|
5
|
+
* Represents the possible account actions states that can be returned by callback registered from
|
|
6
|
+
* [NamiCustomerManager.registerAccountStateHandler]
|
|
6
7
|
*/
|
|
7
8
|
export declare enum AccountStateAction {
|
|
8
9
|
LOGIN = "login",
|
package/dist/utils/config.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ExtendedPlatformInfo } from "
|
|
1
|
+
import { ExtendedPlatformInfo } from "../types/config";
|
|
2
2
|
export declare const getBaseUrl: (namiCommands?: string[]) => string;
|
|
3
3
|
export declare const getExtendedClientInfo: (namiCommands: string[]) => ExtendedPlatformInfo;
|
|
4
4
|
export declare const hasCapability: (capability: string) => boolean;
|
|
5
5
|
export declare const hasPurchaseManagement: (messagePrefix?: string) => boolean;
|
|
6
|
+
export declare const shouldValidateProductGroups: () => boolean;
|
package/dist/utils/const.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const NAMI_SDK_VERSION: string, PRODUCTION: string, DEVELOPMENT: string, PLATFORM_ID_REQUIRED: string, DEVICE_ID_REQUIRED: string, EXTERNAL_ID_REQUIRED: string, SDK_NOT_INITIALIZED: string, CAMPAIGN_NOT_AVAILABLE: string, UNABLE_TO_UPDATE_CDP_ID: string, ANONYMOUS_MODE_ALREADY_ON: string, ANONYMOUS_MODE_ALREADY_OFF: string, ANONYMOUS_MODE_LOGIN_NOT_ALLOWED: string, SESSION_REQUIRED: string, AUTH_DEVICE: string, NAMI_CONFIGURATION: string, NAMI_PROFILE: string, API_CONFIG: string, API_CAMPAIGN_RULES: string, API_PAYWALLS: string, API_PRODUCTS: string, API_ACTIVE_ENTITLEMENTS: string, SERVER_NAMI_ENTITLEMENTS: string, INITIAL_APP_CONFIG: string, INITIAL_CAMPAIGN_RULES: string, INITIAL_PAYWALLS: string, INITIAL_PRODUCTS: string, LOCAL_NAMI_ENTITLEMENTS: string, CUSTOMER_ATTRIBUTES_KEY_PREFIX: string, ANONYMOUS_MODE: string, KEY_SESSION_COUNTER: string, INITIAL_SESSION_COUNTER_VALUE: number, NAMI_LAST_IMPRESSION_ID: string, NAMI_PURCHASE_IMPRESSION_ID: string, NAMI_SESSION_ID: string, API_VERSION: any, BASE_URL_PATH: string, BASE_URL: string, BASE_STAGING_URL: string, CUSTOM_HOST_PREFIX: string, USE_STAGING_API: string, EXTENDED_CLIENT_INFO_PREFIX: string, EXTENDED_CLIENT_INFO_DELIMITER: string, EXTENDED_PLATFORM: string, EXTENDED_PLATFORM_VERSION: string, API_MAX_CALLS_LIMIT: number, API_RETRY_DELAY_SEC: number, API_TIMEOUT_LIMIT: number, DEVICE_API_TIMEOUT_LIMIT: number, STATUS_SUCCESS: number, STATUS_BAD_REQUEST: number, STATUS_NOT_FOUND: number, STATUS_INTERNAL_SERVER_ERROR: number, INITIAL_SUCCESS: string, RECONFIG_SUCCESS: string, ALREADY_CONFIGURED: string, AVAILABLE_CAMPAIGNS_CHANGED: string, PAYWALL_ACTION_EVENT: string, AVAILABLE_ACTIVE_ENTITLEMENTS_CHANGED: string, SKU_TEXT_REGEX: RegExp, VAR_REGEX: RegExp, CORS_PROXY_URL: string, CORS_PROXY_URL_LOCAL: string;
|
|
1
|
+
export declare const NAMI_SDK_VERSION: string, PRODUCTION: string, DEVELOPMENT: string, PLATFORM_ID_REQUIRED: string, DEVICE_ID_REQUIRED: string, EXTERNAL_ID_REQUIRED: string, SDK_NOT_INITIALIZED: string, CAMPAIGN_NOT_AVAILABLE: string, UNABLE_TO_UPDATE_CDP_ID: string, ANONYMOUS_MODE_ALREADY_ON: string, ANONYMOUS_MODE_ALREADY_OFF: string, ANONYMOUS_MODE_LOGIN_NOT_ALLOWED: string, SESSION_REQUIRED: string, DEVICE_ID_NOT_SET: string, AUTH_DEVICE: string, NAMI_CONFIGURATION: string, NAMI_PROFILE: string, API_CONFIG: string, API_CAMPAIGN_RULES: string, API_PAYWALLS: string, API_PRODUCTS: string, API_ACTIVE_ENTITLEMENTS: string, SERVER_NAMI_ENTITLEMENTS: string, INITIAL_APP_CONFIG: string, INITIAL_CAMPAIGN_RULES: string, INITIAL_PAYWALLS: string, INITIAL_PRODUCTS: string, LOCAL_NAMI_ENTITLEMENTS: string, CUSTOMER_ATTRIBUTES_KEY_PREFIX: string, NAMI_CUSTOMER_JOURNEY_STATE: string, ANONYMOUS_MODE: string, KEY_SESSION_COUNTER: string, INITIAL_SESSION_COUNTER_VALUE: number, NAMI_LAST_IMPRESSION_ID: string, NAMI_PURCHASE_IMPRESSION_ID: string, NAMI_SESSION_ID: string, NAMI_LANGUAGE_CODE: string, API_VERSION: any, BASE_URL_PATH: string, BASE_URL: string, BASE_STAGING_URL: string, CUSTOM_HOST_PREFIX: string, USE_STAGING_API: string, EXTENDED_CLIENT_INFO_PREFIX: string, EXTENDED_CLIENT_INFO_DELIMITER: string, VALIDATE_PRODUCT_GROUPS: string, EXTENDED_PLATFORM: string, EXTENDED_PLATFORM_VERSION: string, API_MAX_CALLS_LIMIT: number, API_RETRY_DELAY_SEC: number, API_TIMEOUT_LIMIT: number, DEVICE_API_TIMEOUT_LIMIT: number, STATUS_SUCCESS: number, STATUS_BAD_REQUEST: number, STATUS_NOT_FOUND: number, STATUS_INTERNAL_SERVER_ERROR: number, INITIAL_SUCCESS: string, RECONFIG_SUCCESS: string, ALREADY_CONFIGURED: string, AVAILABLE_CAMPAIGNS_CHANGED: string, PAYWALL_ACTION_EVENT: string, AVAILABLE_ACTIVE_ENTITLEMENTS_CHANGED: string, CUSTOMER_JOURNEY_STATE_CHANGED: string, SKU_TEXT_REGEX: RegExp, VAR_REGEX: RegExp, HTML_REGEX: RegExp, SMART_TEXT_PATTERN: string, CORS_PROXY_URL: string, CORS_PROXY_URL_LOCAL: string;
|
package/dist/utils/device.d.ts
CHANGED
package/dist/utils/fonts.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@namiml/web-sdk",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.5.0",
|
|
5
5
|
"source": "src/nami-web.ts",
|
|
6
6
|
"description": "Nami Web SDK makes subscriptions & in-app purchases easy, with powerful built-in paywalls and A/B testing",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"clear-test-cache": "jest --clearCache",
|
|
9
|
-
"test": "yarn clear-test-cache && jest --coverage -i --forceExit",
|
|
9
|
+
"test": "yarn clear-test-cache && TZ=UTC jest --coverage -i --forceExit",
|
|
10
10
|
"build-sdk": "rm -rf dist && rollup -c",
|
|
11
11
|
"watch": "microbundle --tsconfig tsconfig.dev.json --output ./dist/nami-web.mjs --watch --no-compress --format modern --define NAMI_SDK_ENV='development'",
|
|
12
12
|
"build:dev": "yarn build-sdk --environment NAMI_SDK_ENV:development",
|
|
@@ -71,7 +71,6 @@
|
|
|
71
71
|
"prettier": "3.2.5",
|
|
72
72
|
"rollup": "^4.18.0",
|
|
73
73
|
"rollup-plugin-dts": "^6.1.1",
|
|
74
|
-
"rollup-plugin-ts": "^3.4.5",
|
|
75
74
|
"ts-jest": "^29.1.2",
|
|
76
75
|
"ts-node": "^10.9.2",
|
|
77
76
|
"tslib": "^2.6.3",
|
|
@@ -82,9 +81,12 @@
|
|
|
82
81
|
"dependencies": {
|
|
83
82
|
"@lit-labs/ssr-dom-shim": "^1.2.0",
|
|
84
83
|
"bowser": "^2.11.0",
|
|
84
|
+
"date-fns-tz": "^3.1.3",
|
|
85
|
+
"hls.js": "^1.5.15",
|
|
85
86
|
"lit": "^3.1.3",
|
|
86
87
|
"lodash-es": "^4.17.21",
|
|
87
|
-
"marked": "^12.0.2"
|
|
88
|
+
"marked": "^12.0.2",
|
|
89
|
+
"swiper": "^11.1.12"
|
|
88
90
|
},
|
|
89
91
|
"homepage": "https://www.namiml.com",
|
|
90
92
|
"bugs": {
|
|
File without changes
|