@artisan-commerce/analytics-rn 0.2.0-canary.16 → 0.2.0-canary.18
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 +18 -0
- package/build/analytics-rn/src/lib/initAnalytics/initAnalytics.types.d.ts +11 -0
- package/build/analytics-rn/src/lib/providers/Segment/Segment.types.d.ts +16 -0
- package/build/analytics-rn/src/lib/providers/Segment/events/auth/signIn/signIn.types.d.ts +2 -0
- package/build/analytics-rn/src/lib/providers/Segment/events/auth/signOut/signOut.types.d.ts +2 -0
- package/build/analytics-rn/src/lib/providers/Segment/events/auth/signUp/signUp.types.d.ts +4 -0
- package/build/analytics-rn/src/lib/providers/Segment/events/category/viewCategory/viewCategory.types.d.ts +3 -0
- package/build/analytics-rn/src/lib/providers/Segment/events/checkout/initiateCheckout/initiateCheckout.types.d.ts +0 -2
- package/build/analytics-rn/src/lib/providers/Segment/events/order/cancelOrder/cancelOrder.types.d.ts +5 -0
- package/build/analytics-rn/src/lib/providers/Segment/events/order/rateOrder/rateOrder.types.d.ts +0 -2
- package/build/analytics-rn/src/lib/providers/Segment/events/order/requestRefund/requestRefund.types.d.ts +3 -0
- package/build/analytics-rn/src/lib/providers/Segment/events/product/customizeProduct/customizeProduct.types.d.ts +0 -2
- package/build/analytics-rn/src/lib/providers/Segment/events/product/filterProducts/filterProducts.types.d.ts +0 -2
- package/build/analytics-rn/src/lib/providers/Segment/events/product/productImpression/productImpression.types.d.ts +0 -2
- package/build/analytics-rn/src/lib/providers/Segment/events/product/searchProductAttempt/searchProductAttempt.types.d.ts +0 -2
- package/build/analytics-rn/src/lib/providers/Segment/events/product/searchProductNotFound/searchProductNotFound.types.d.ts +0 -2
- package/build/analytics-rn/src/lib/providers/Segment/events/product/searchProductSuccess/searchProductSuccess.types.d.ts +0 -2
- package/build/analytics-rn/src/lib/providers/Segment/events/product/selectProduct/selectProduct.types.d.ts +0 -2
- package/build/analytics-rn/src/lib/providers/Segment/events/product/sortProducts/sortProducts.types.d.ts +0 -2
- package/build/analytics-rn/src/lib/providers/Segment/events/product/viewProductDetails/viewProductDetails.types.d.ts +0 -2
- package/build/analytics-rn/src/lib/providers/Segment/events/purchase/purchaseAttempt/purchaseAttempt.types.d.ts +0 -2
- package/build/analytics-rn/src/lib/providers/Segment/events/purchase/purchaseFail/purchaseFail.types.d.ts +0 -2
- package/build/analytics-rn/src/lib/providers/Segment/events/purchase/purchaseSuccess/purchaseSuccess.types.d.ts +0 -2
- package/build/analytics-rn/src/lib/providers/Segment/events/shoppingCart/addProductToCart/addProductToCart.types.d.ts +0 -2
- package/build/analytics-rn/src/lib/providers/Segment/events/shoppingCart/addProductToWishlist/addProductToWishlist.types.d.ts +0 -2
- package/build/analytics-rn/src/lib/providers/Segment/events/shoppingCart/clearCart/clearCart.types.d.ts +0 -2
- package/build/analytics-rn/src/lib/providers/Segment/events/shoppingCart/removeProductFromCart/removeProductFromCart.types.d.ts +0 -2
- package/build/analytics-rn/src/lib/providers/Segment/events/shoppingCart/removeProductFromWishlist/removeProductFromWishlist.types.d.ts +0 -2
- package/build/analytics-rn/src/lib/providers/Segment/events/shoppingCart/updateProductInCart/updateProductInCart.types.d.ts +0 -2
- package/build/analytics-rn/src/lib/providers/Segment/events/shoppingCart/updateProductInWishlist/updateProductInWishlist.types.d.ts +0 -2
- package/build/analytics-rn/src/lib/providers/Segment/events/shoppingCart/viewCart/viewCart.types.d.ts +3 -2
- package/build/analytics-rn/src/utils/events.utils.d.ts +17 -0
- package/build/main.bundle.js +9 -9
- package/build/report.json +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.2.0-canary.18](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/analytics-rn@0.2.0-canary.17...@artisan-commerce/analytics-rn@0.2.0-canary.18) (2021-05-28)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **analytics-web:** add analytics scripts to the document's head ([243ec79](https://bitbucket.org/tradesystem/artisan_monorepo/commit/243ec790ae0d995e14498b5fb042af0251913267))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## [0.2.0-canary.17](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/analytics-rn@0.2.0-canary.16...@artisan-commerce/analytics-rn@0.2.0-canary.17) (2021-05-28)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* **analytics-rn:** finish events mapping ([eb2f04b](https://bitbucket.org/tradesystem/artisan_monorepo/commit/eb2f04b796bbf827a1c351dd834e5f0e0fbc49e0))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
6
24
|
## [0.2.0-canary.16](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/analytics-rn@0.2.0-canary.15...@artisan-commerce/analytics-rn@0.2.0-canary.16) (2021-05-14)
|
|
7
25
|
|
|
8
26
|
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import { Vendor } from "@artisan-commerce/types";
|
|
2
2
|
import { AnalyticsMeta } from "../../types/common.types";
|
|
3
3
|
import AnalyticsProvider from "../providers/AnalyticsProvider/AnalyticsProvider";
|
|
4
|
+
/**
|
|
5
|
+
* Initial configuration that can be passed to initAnalytics method.
|
|
6
|
+
*
|
|
7
|
+
* @interface InitAnalyticsConfig
|
|
8
|
+
* @since 0.5.14
|
|
9
|
+
* @property {AnalyticsProviderTypes[]} providers Analytics providers instances that can be targeted to emit events
|
|
10
|
+
* @property {number} activeVendor The vendor that will emit the events
|
|
11
|
+
* @property {number[]|undefined} vendors List of vendors that can emit events if active
|
|
12
|
+
* @property {boolean} debug Debug mode
|
|
13
|
+
* @property {InitAnalyticsConfigMeta} meta Commerce's metadata
|
|
14
|
+
*/
|
|
4
15
|
export interface InitAnalyticsConfig {
|
|
5
16
|
providers: AnalyticsProvider[];
|
|
6
17
|
activeVendor?: Vendor["id"];
|
|
@@ -40,3 +40,19 @@ export interface SegmentCommonEventParams extends EventCommonParams {
|
|
|
40
40
|
export interface SegmentCustomEventParams {
|
|
41
41
|
[key: string]: any;
|
|
42
42
|
}
|
|
43
|
+
export declare namespace Segment {
|
|
44
|
+
interface Product {
|
|
45
|
+
product_id: string;
|
|
46
|
+
sku?: string;
|
|
47
|
+
category?: string;
|
|
48
|
+
name?: string;
|
|
49
|
+
brand?: string;
|
|
50
|
+
variant?: string;
|
|
51
|
+
price?: number;
|
|
52
|
+
quantity?: number;
|
|
53
|
+
coupon?: string;
|
|
54
|
+
position?: number;
|
|
55
|
+
url?: string;
|
|
56
|
+
image_url?: string;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -9,6 +9,8 @@ import { SegmentCustomEventParams } from "../../../Segment.types";
|
|
|
9
9
|
* @extends SegmentCommonEventParams
|
|
10
10
|
* @extends SegmentCustomEventParams
|
|
11
11
|
* @extends SignInCommonParams
|
|
12
|
+
* @property {string} name The user's name
|
|
12
13
|
*/
|
|
13
14
|
export interface SignInParams extends SegmentCommonEventParams, SegmentCustomEventParams, SignInCommonParams {
|
|
15
|
+
name: string;
|
|
14
16
|
}
|
|
@@ -9,6 +9,8 @@ import { SegmentCustomEventParams } from "../../../Segment.types";
|
|
|
9
9
|
* @extends SegmentCommonEventParams
|
|
10
10
|
* @extends SegmentCustomEventParams
|
|
11
11
|
* @extends SignOutCommonParams
|
|
12
|
+
* @property {string} name The user's name
|
|
12
13
|
*/
|
|
13
14
|
export interface SignOutParams extends SegmentCommonEventParams, SegmentCustomEventParams, SignOutCommonParams {
|
|
15
|
+
name: string;
|
|
14
16
|
}
|
|
@@ -9,6 +9,10 @@ import { SegmentCustomEventParams } from "../../../Segment.types";
|
|
|
9
9
|
* @extends SegmentCommonEventParams
|
|
10
10
|
* @extends SegmentCustomEventParams
|
|
11
11
|
* @extends SignUpCommonParams
|
|
12
|
+
* @property {string} name The user's name
|
|
13
|
+
* @property {string} email The user's email
|
|
12
14
|
*/
|
|
13
15
|
export interface SignUpParams extends SegmentCommonEventParams, SegmentCustomEventParams, SignUpCommonParams {
|
|
16
|
+
name: string;
|
|
17
|
+
email: string;
|
|
14
18
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Product } from "@artisan-commerce/types";
|
|
1
2
|
import { ViewCategoryCommonParams } from "../../../../../events/category/viewCategory/viewCategory.types";
|
|
2
3
|
import { SegmentCommonEventParams } from "../../../Segment.types";
|
|
3
4
|
import { SegmentCustomEventParams } from "../../../Segment.types";
|
|
@@ -9,6 +10,8 @@ import { SegmentCustomEventParams } from "../../../Segment.types";
|
|
|
9
10
|
* @extends SegmentCommonEventParams
|
|
10
11
|
* @extends SegmentCustomEventParams
|
|
11
12
|
* @extends ViewCategoryCommonParams
|
|
13
|
+
* @property {Product[]} products The products in the order
|
|
12
14
|
*/
|
|
13
15
|
export interface ViewCategoryParams extends SegmentCommonEventParams, SegmentCustomEventParams, ViewCategoryCommonParams {
|
|
16
|
+
products: Product[];
|
|
14
17
|
}
|
|
@@ -9,8 +9,6 @@ import { SegmentCustomEventParams } from "../../../Segment.types";
|
|
|
9
9
|
* @extends SegmentCommonEventParams
|
|
10
10
|
* @extends SegmentCustomEventParams
|
|
11
11
|
* @extends InitiateCheckoutCommonParams
|
|
12
|
-
* @property {string} contentType The type of products being sold (e.g. food)
|
|
13
12
|
*/
|
|
14
13
|
export interface InitiateCheckoutParams extends SegmentCommonEventParams, SegmentCustomEventParams, InitiateCheckoutCommonParams {
|
|
15
|
-
contentType?: string;
|
|
16
14
|
}
|
package/build/analytics-rn/src/lib/providers/Segment/events/order/cancelOrder/cancelOrder.types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Product } from "@artisan-commerce/types";
|
|
1
2
|
import { CancelOrderCommonParams } from "../../../../../events/order/cancelOrder/cancelOrder.types";
|
|
2
3
|
import { SegmentCommonEventParams } from "../../../Segment.types";
|
|
3
4
|
import { SegmentCustomEventParams } from "../../../Segment.types";
|
|
@@ -9,6 +10,10 @@ import { SegmentCustomEventParams } from "../../../Segment.types";
|
|
|
9
10
|
* @extends SegmentCommonEventParams
|
|
10
11
|
* @extends SegmentCustomEventParams
|
|
11
12
|
* @extends CancelOrderCommonParams
|
|
13
|
+
* @property {number} orderTotal The total cost of the order
|
|
14
|
+
* @property {Product[]} products The products in the order
|
|
12
15
|
*/
|
|
13
16
|
export interface CancelOrderParams extends SegmentCommonEventParams, SegmentCustomEventParams, CancelOrderCommonParams {
|
|
17
|
+
orderTotal: number;
|
|
18
|
+
products: Product[];
|
|
14
19
|
}
|
package/build/analytics-rn/src/lib/providers/Segment/events/order/rateOrder/rateOrder.types.d.ts
CHANGED
|
@@ -9,8 +9,6 @@ import { SegmentCustomEventParams } from "../../../Segment.types";
|
|
|
9
9
|
* @extends SegmentCommonEventParams
|
|
10
10
|
* @extends SegmentCustomEventParams
|
|
11
11
|
* @extends RateOrderCommonParams
|
|
12
|
-
* @property {string} contentType The type of products being sold (e.g. food)
|
|
13
12
|
*/
|
|
14
13
|
export interface RateOrderParams extends SegmentCommonEventParams, SegmentCustomEventParams, RateOrderCommonParams {
|
|
15
|
-
contentType?: string;
|
|
16
14
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Product } from "@artisan-commerce/types";
|
|
1
2
|
import { RequestRefundCommonParams } from "../../../../../events/order/requestRefund/requestRefund.types";
|
|
2
3
|
import { SegmentCommonEventParams } from "../../../Segment.types";
|
|
3
4
|
import { SegmentCustomEventParams } from "../../../Segment.types";
|
|
@@ -9,6 +10,8 @@ import { SegmentCustomEventParams } from "../../../Segment.types";
|
|
|
9
10
|
* @extends SegmentCommonEventParams
|
|
10
11
|
* @extends SegmentCustomEventParams
|
|
11
12
|
* @extends RequestRefundCommonParams
|
|
13
|
+
* @property {Product[]} products The products in the order
|
|
12
14
|
*/
|
|
13
15
|
export interface RequestRefundParams extends SegmentCommonEventParams, SegmentCustomEventParams, RequestRefundCommonParams {
|
|
16
|
+
products: Product[];
|
|
14
17
|
}
|
|
@@ -8,8 +8,6 @@ import { SegmentCustomEventParams } from "../../../Segment.types";
|
|
|
8
8
|
* @since 0.5.14
|
|
9
9
|
* @extends SegmentCommonEventParams
|
|
10
10
|
* @extends SegmentCustomEventParams
|
|
11
|
-
* @property {string} contentType The type of products being sold (e.g. food)
|
|
12
11
|
*/
|
|
13
12
|
export interface CustomizeProductParams extends SegmentCommonEventParams, SegmentCustomEventParams, CustomizeProductCommonParams {
|
|
14
|
-
contentType?: string;
|
|
15
13
|
}
|
|
@@ -9,8 +9,6 @@ import { SegmentCustomEventParams } from "../../../Segment.types";
|
|
|
9
9
|
* @extends SegmentCommonEventParams
|
|
10
10
|
* @extends SegmentCustomEventParams
|
|
11
11
|
* @extends FilterProductsCommonParams
|
|
12
|
-
* @property {string} contentType The type of products being sold (e.g. food)
|
|
13
12
|
*/
|
|
14
13
|
export interface FilterProductsParams extends SegmentCommonEventParams, SegmentCustomEventParams, FilterProductsCommonParams {
|
|
15
|
-
contentType?: string;
|
|
16
14
|
}
|
|
@@ -8,8 +8,6 @@ import { SegmentCustomEventParams } from "../../../Segment.types";
|
|
|
8
8
|
* @since 0.5.14
|
|
9
9
|
* @extends SegmentCommonEventParams
|
|
10
10
|
* @extends SegmentCustomEventParams
|
|
11
|
-
* @property {string} contentType The type of product the user had an impression on (e.g. food)
|
|
12
11
|
*/
|
|
13
12
|
export interface ProductImpressionParams extends SegmentCommonEventParams, SegmentCustomEventParams, ProductImpressionCommonParams {
|
|
14
|
-
contentType?: string;
|
|
15
13
|
}
|
|
@@ -9,8 +9,6 @@ import { SegmentCustomEventParams } from "../../../Segment.types";
|
|
|
9
9
|
* @extends SegmentCommonEventParams
|
|
10
10
|
* @extends SegmentCustomEventParams
|
|
11
11
|
* @extends SearchProductAttemptCommonParams
|
|
12
|
-
* @property {string} contentType The type of products being sold (e.g. food)
|
|
13
12
|
*/
|
|
14
13
|
export interface SearchProductAttemptParams extends SegmentCommonEventParams, SegmentCustomEventParams, SearchProductAttemptCommonParams {
|
|
15
|
-
contentType?: string;
|
|
16
14
|
}
|
|
@@ -9,8 +9,6 @@ import { SegmentCustomEventParams } from "../../../Segment.types";
|
|
|
9
9
|
* @extends SegmentCommonEventParams
|
|
10
10
|
* @extends SegmentCustomEventParams
|
|
11
11
|
* @extends SearchProductNotFoundCommonParams
|
|
12
|
-
* @property {string} contentType The type of products being sold (e.g. food)
|
|
13
12
|
*/
|
|
14
13
|
export interface SearchProductNotFoundParams extends SegmentCommonEventParams, SegmentCustomEventParams, SearchProductNotFoundCommonParams {
|
|
15
|
-
contentType?: string;
|
|
16
14
|
}
|
|
@@ -9,8 +9,6 @@ import { SegmentCustomEventParams } from "../../../Segment.types";
|
|
|
9
9
|
* @extends SegmentCommonEventParams
|
|
10
10
|
* @extends SegmentCustomEventParams
|
|
11
11
|
* @extends SearchProductSuccessCommonParams
|
|
12
|
-
* @property {string} contentType The type of products being sold (e.g. food)
|
|
13
12
|
*/
|
|
14
13
|
export interface SearchProductSuccessParams extends SegmentCommonEventParams, SegmentCustomEventParams, SearchProductSuccessCommonParams {
|
|
15
|
-
contentType?: string;
|
|
16
14
|
}
|
|
@@ -8,8 +8,6 @@ import { SegmentCustomEventParams } from "../../../Segment.types";
|
|
|
8
8
|
* @since 0.5.14
|
|
9
9
|
* @extends SegmentCommonEventParams
|
|
10
10
|
* @extends SegmentCustomEventParams
|
|
11
|
-
* @property {string} contentType The type of products being sold (e.g. food)
|
|
12
11
|
*/
|
|
13
12
|
export interface SelectProductParams extends SegmentCommonEventParams, SegmentCustomEventParams, SelectProductCommonParams {
|
|
14
|
-
contentType?: string;
|
|
15
13
|
}
|
|
@@ -9,8 +9,6 @@ import { SegmentCustomEventParams } from "../../../Segment.types";
|
|
|
9
9
|
* @extends SegmentCommonEventParams
|
|
10
10
|
* @extends SegmentCustomEventParams
|
|
11
11
|
* @extends SortProductsCommonParams
|
|
12
|
-
* @property {string} contentType The type of products being sold (e.g. food)
|
|
13
12
|
*/
|
|
14
13
|
export interface SortProductsParams extends SegmentCommonEventParams, SegmentCustomEventParams, SortProductsCommonParams {
|
|
15
|
-
contentType?: string;
|
|
16
14
|
}
|
|
@@ -8,8 +8,6 @@ import { SegmentCustomEventParams } from "../../../Segment.types";
|
|
|
8
8
|
* @since 0.5.14
|
|
9
9
|
* @extends SegmentCommonEventParams
|
|
10
10
|
* @extends SegmentCustomEventParams
|
|
11
|
-
* @property {string} contentType The type of products being sold (e.g. food)
|
|
12
11
|
*/
|
|
13
12
|
export interface ViewProductDetailsParams extends SegmentCommonEventParams, SegmentCustomEventParams, ViewProductDetailsCommonParams {
|
|
14
|
-
contentType?: string;
|
|
15
13
|
}
|
|
@@ -9,8 +9,6 @@ import { SegmentCustomEventParams } from "../../../Segment.types";
|
|
|
9
9
|
* @extends SegmentCommonEventParams
|
|
10
10
|
* @extends SegmentCustomEventParams
|
|
11
11
|
* @extends PurchaseAttemptCommonParams
|
|
12
|
-
* @property {string} contentType The type of products being sold (e.g. food)
|
|
13
12
|
*/
|
|
14
13
|
export interface PurchaseAttemptParams extends SegmentCommonEventParams, SegmentCustomEventParams, PurchaseAttemptCommonParams {
|
|
15
|
-
contentType?: string;
|
|
16
14
|
}
|
|
@@ -9,8 +9,6 @@ import { SegmentCustomEventParams } from "../../../Segment.types";
|
|
|
9
9
|
* @extends SegmentCommonEventParams
|
|
10
10
|
* @extends SegmentCustomEventParams
|
|
11
11
|
* @extends PurchaseFailCommonParams
|
|
12
|
-
* @property {string} contentType The type of products being sold (e.g. food)
|
|
13
12
|
*/
|
|
14
13
|
export interface PurchaseFailParams extends SegmentCommonEventParams, SegmentCustomEventParams, PurchaseFailCommonParams {
|
|
15
|
-
contentType?: string;
|
|
16
14
|
}
|
|
@@ -9,8 +9,6 @@ import { SegmentCustomEventParams } from "../../../Segment.types";
|
|
|
9
9
|
* @extends SegmentCommonEventParams
|
|
10
10
|
* @extends SegmentCustomEventParams
|
|
11
11
|
* @extends PurchaseSuccessCommonParams
|
|
12
|
-
* @property {string} contentType The type of products being sold (e.g. food)
|
|
13
12
|
*/
|
|
14
13
|
export interface PurchaseSuccessParams extends SegmentCommonEventParams, SegmentCustomEventParams, PurchaseSuccessCommonParams {
|
|
15
|
-
contentType?: string;
|
|
16
14
|
}
|
|
@@ -9,8 +9,6 @@ import { SegmentCustomEventParams } from "../../../Segment.types";
|
|
|
9
9
|
* @extends SegmentCommonEventParams
|
|
10
10
|
* @extends SegmentCustomEventParams
|
|
11
11
|
* @extends AddProductToCartCommonParams
|
|
12
|
-
* @property {string} contentType The type of products being sold (e.g. food)
|
|
13
12
|
*/
|
|
14
13
|
export interface AddProductToCartParams extends SegmentCommonEventParams, SegmentCustomEventParams, AddProductToCartCommonParams {
|
|
15
|
-
contentType?: string;
|
|
16
14
|
}
|
|
@@ -9,8 +9,6 @@ import { SegmentCustomEventParams } from "../../../Segment.types";
|
|
|
9
9
|
* @extends SegmentCommonEventParams
|
|
10
10
|
* @extends SegmentCustomEventParams
|
|
11
11
|
* @extends AddProductToWishlistCommonParams
|
|
12
|
-
* @property {string} contentType The type of products being sold (e.g. food)
|
|
13
12
|
*/
|
|
14
13
|
export interface AddProductToWishlistParams extends SegmentCommonEventParams, SegmentCustomEventParams, AddProductToWishlistCommonParams {
|
|
15
|
-
contentType?: string;
|
|
16
14
|
}
|
|
@@ -9,8 +9,6 @@ import { SegmentCustomEventParams } from "../../../Segment.types";
|
|
|
9
9
|
* @extends SegmentCommonEventParams
|
|
10
10
|
* @extends SegmentCustomEventParams
|
|
11
11
|
* @extends ClearCartCommonParams
|
|
12
|
-
* @property {string} contentType The type of products being sold (e.g. food)
|
|
13
12
|
*/
|
|
14
13
|
export interface ClearCartParams extends SegmentCommonEventParams, SegmentCustomEventParams, ClearCartCommonParams {
|
|
15
|
-
contentType?: string;
|
|
16
14
|
}
|
|
@@ -9,8 +9,6 @@ import { SegmentCustomEventParams } from "../../../Segment.types";
|
|
|
9
9
|
* @extends SegmentCommonEventParams
|
|
10
10
|
* @extends SegmentCustomEventParams
|
|
11
11
|
* @extends RemoveProductFromCartCommonParams
|
|
12
|
-
* @property {string} contentType The type of products being sold (e.g. food)
|
|
13
12
|
*/
|
|
14
13
|
export interface RemoveProductFromCartParams extends SegmentCommonEventParams, SegmentCustomEventParams, RemoveProductFromCartCommonParams {
|
|
15
|
-
contentType?: string;
|
|
16
14
|
}
|
|
@@ -9,8 +9,6 @@ import { SegmentCustomEventParams } from "../../../Segment.types";
|
|
|
9
9
|
* @extends SegmentCommonEventParams
|
|
10
10
|
* @extends SegmentCustomEventParams
|
|
11
11
|
* @extends RemoveProductFromWishlistCommonParams
|
|
12
|
-
* @property {string} contentType The type of products being sold (e.g. food)
|
|
13
12
|
*/
|
|
14
13
|
export interface RemoveProductFromWishlistParams extends SegmentCommonEventParams, SegmentCustomEventParams, RemoveProductFromWishlistCommonParams {
|
|
15
|
-
contentType?: string;
|
|
16
14
|
}
|
|
@@ -9,8 +9,6 @@ import { SegmentCustomEventParams } from "../../../Segment.types";
|
|
|
9
9
|
* @extends SegmentCommonEventParams
|
|
10
10
|
* @extends SegmentCustomEventParams
|
|
11
11
|
* @extends UpdateProductInCartCommonParams
|
|
12
|
-
* @property {string} contentType The type of products being sold (e.g. food)
|
|
13
12
|
*/
|
|
14
13
|
export interface UpdateProductInCartParams extends SegmentCommonEventParams, SegmentCustomEventParams, UpdateProductInCartCommonParams {
|
|
15
|
-
contentType?: string;
|
|
16
14
|
}
|
|
@@ -9,8 +9,6 @@ import { SegmentCustomEventParams } from "../../../Segment.types";
|
|
|
9
9
|
* @extends SegmentCommonEventParams
|
|
10
10
|
* @extends SegmentCustomEventParams
|
|
11
11
|
* @extends UpdateProductInWishlistCommonParams
|
|
12
|
-
* @property {string} contentType The type of products being sold (e.g. food)
|
|
13
12
|
*/
|
|
14
13
|
export interface UpdateProductInWishlistParams extends SegmentCommonEventParams, SegmentCustomEventParams, UpdateProductInWishlistCommonParams {
|
|
15
|
-
contentType?: string;
|
|
16
14
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Product } from "@artisan-commerce/types";
|
|
1
2
|
import { ViewCartCommonParams } from "../../../../../events/shoppingCart/viewCart/viewCart.types";
|
|
2
3
|
import { SegmentCommonEventParams } from "../../../Segment.types";
|
|
3
4
|
import { SegmentCustomEventParams } from "../../../Segment.types";
|
|
@@ -9,8 +10,8 @@ import { SegmentCustomEventParams } from "../../../Segment.types";
|
|
|
9
10
|
* @extends SegmentCommonEventParams
|
|
10
11
|
* @extends SegmentCustomEventParams
|
|
11
12
|
* @extends ViewCartCommonParams
|
|
12
|
-
* @property {
|
|
13
|
+
* @property {Product[]} products The products in the cart
|
|
13
14
|
*/
|
|
14
15
|
export interface ViewCartParams extends SegmentCommonEventParams, SegmentCustomEventParams, ViewCartCommonParams {
|
|
15
|
-
|
|
16
|
+
products: Product[];
|
|
16
17
|
}
|
|
@@ -2,6 +2,7 @@ import { CartProduct, CurrencyCodes, Product } from "@artisan-commerce/types";
|
|
|
2
2
|
import { ShoppingCart } from "@artisan-commerce/types";
|
|
3
3
|
import { ProvidersHandlers } from "../types/event.types";
|
|
4
4
|
import { Gtag } from "../lib/providers/GoogleAnalytics/GoogleAnalytics.types";
|
|
5
|
+
import { Segment } from "../lib/providers/Segment/Segment.types";
|
|
5
6
|
/**
|
|
6
7
|
* Triage event to each provider handler.
|
|
7
8
|
*
|
|
@@ -61,3 +62,19 @@ export declare const mapProductToGoogleItem: (product: CartProduct, currency?: C
|
|
|
61
62
|
* @returns {string} The accepted parameter type
|
|
62
63
|
*/
|
|
63
64
|
export declare const transformArrayParam: (param: unknown[]) => string;
|
|
65
|
+
/**
|
|
66
|
+
* Maps a product into a segment product.
|
|
67
|
+
*
|
|
68
|
+
* @since 0.5.14
|
|
69
|
+
* @param {Product} product The wanted product's data
|
|
70
|
+
* @returns {Segment.Product} An object with Item data
|
|
71
|
+
*/
|
|
72
|
+
export declare const mapProductToSegmentProduct: (product: Product) => Segment.Product;
|
|
73
|
+
/**
|
|
74
|
+
* Maps the order products into segment products.
|
|
75
|
+
*
|
|
76
|
+
* @since 0.5.14
|
|
77
|
+
* @param {Product[]} products The order product's data
|
|
78
|
+
* @returns {Segment.Product[]} An array of objects with google items data
|
|
79
|
+
*/
|
|
80
|
+
export declare const mapProductsToSegmentProducts: (products: Product[]) => Segment.Product[];
|