@artisan-commerce/analytics-rn 0.2.0-canary.16 → 0.2.0-canary.17

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 (34) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/build/analytics-rn/src/lib/providers/Segment/Segment.types.d.ts +16 -0
  3. package/build/analytics-rn/src/lib/providers/Segment/events/auth/signIn/signIn.types.d.ts +2 -0
  4. package/build/analytics-rn/src/lib/providers/Segment/events/auth/signOut/signOut.types.d.ts +2 -0
  5. package/build/analytics-rn/src/lib/providers/Segment/events/auth/signUp/signUp.types.d.ts +4 -0
  6. package/build/analytics-rn/src/lib/providers/Segment/events/category/viewCategory/viewCategory.types.d.ts +3 -0
  7. package/build/analytics-rn/src/lib/providers/Segment/events/checkout/initiateCheckout/initiateCheckout.types.d.ts +0 -2
  8. package/build/analytics-rn/src/lib/providers/Segment/events/order/cancelOrder/cancelOrder.types.d.ts +5 -0
  9. package/build/analytics-rn/src/lib/providers/Segment/events/order/rateOrder/rateOrder.types.d.ts +0 -2
  10. package/build/analytics-rn/src/lib/providers/Segment/events/order/requestRefund/requestRefund.types.d.ts +3 -0
  11. package/build/analytics-rn/src/lib/providers/Segment/events/product/customizeProduct/customizeProduct.types.d.ts +0 -2
  12. package/build/analytics-rn/src/lib/providers/Segment/events/product/filterProducts/filterProducts.types.d.ts +0 -2
  13. package/build/analytics-rn/src/lib/providers/Segment/events/product/productImpression/productImpression.types.d.ts +0 -2
  14. package/build/analytics-rn/src/lib/providers/Segment/events/product/searchProductAttempt/searchProductAttempt.types.d.ts +0 -2
  15. package/build/analytics-rn/src/lib/providers/Segment/events/product/searchProductNotFound/searchProductNotFound.types.d.ts +0 -2
  16. package/build/analytics-rn/src/lib/providers/Segment/events/product/searchProductSuccess/searchProductSuccess.types.d.ts +0 -2
  17. package/build/analytics-rn/src/lib/providers/Segment/events/product/selectProduct/selectProduct.types.d.ts +0 -2
  18. package/build/analytics-rn/src/lib/providers/Segment/events/product/sortProducts/sortProducts.types.d.ts +0 -2
  19. package/build/analytics-rn/src/lib/providers/Segment/events/product/viewProductDetails/viewProductDetails.types.d.ts +0 -2
  20. package/build/analytics-rn/src/lib/providers/Segment/events/purchase/purchaseAttempt/purchaseAttempt.types.d.ts +0 -2
  21. package/build/analytics-rn/src/lib/providers/Segment/events/purchase/purchaseFail/purchaseFail.types.d.ts +0 -2
  22. package/build/analytics-rn/src/lib/providers/Segment/events/purchase/purchaseSuccess/purchaseSuccess.types.d.ts +0 -2
  23. package/build/analytics-rn/src/lib/providers/Segment/events/shoppingCart/addProductToCart/addProductToCart.types.d.ts +0 -2
  24. package/build/analytics-rn/src/lib/providers/Segment/events/shoppingCart/addProductToWishlist/addProductToWishlist.types.d.ts +0 -2
  25. package/build/analytics-rn/src/lib/providers/Segment/events/shoppingCart/clearCart/clearCart.types.d.ts +0 -2
  26. package/build/analytics-rn/src/lib/providers/Segment/events/shoppingCart/removeProductFromCart/removeProductFromCart.types.d.ts +0 -2
  27. package/build/analytics-rn/src/lib/providers/Segment/events/shoppingCart/removeProductFromWishlist/removeProductFromWishlist.types.d.ts +0 -2
  28. package/build/analytics-rn/src/lib/providers/Segment/events/shoppingCart/updateProductInCart/updateProductInCart.types.d.ts +0 -2
  29. package/build/analytics-rn/src/lib/providers/Segment/events/shoppingCart/updateProductInWishlist/updateProductInWishlist.types.d.ts +0 -2
  30. package/build/analytics-rn/src/lib/providers/Segment/events/shoppingCart/viewCart/viewCart.types.d.ts +3 -2
  31. package/build/analytics-rn/src/utils/events.utils.d.ts +17 -0
  32. package/build/main.bundle.js +9 -9
  33. package/build/report.json +1 -1
  34. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -3,6 +3,15 @@
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.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)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **analytics-rn:** finish events mapping ([eb2f04b](https://bitbucket.org/tradesystem/artisan_monorepo/commit/eb2f04b796bbf827a1c351dd834e5f0e0fbc49e0))
12
+
13
+
14
+
6
15
  ## [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
16
 
8
17
 
@@ -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
  }
@@ -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
  }
@@ -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 {string} contentType The type of products being sold (e.g. food)
13
+ * @property {Product[]} products The products in the cart
13
14
  */
14
15
  export interface ViewCartParams extends SegmentCommonEventParams, SegmentCustomEventParams, ViewCartCommonParams {
15
- contentType?: string;
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[];