@artisan-commerce/analytics-web 0.1.0-canary.18 → 0.1.0-canary.2

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 (132) hide show
  1. package/CHANGELOG.md +0 -133
  2. package/build/main.bundle.js +11 -11
  3. package/build/report.json +1 -1
  4. package/build/src/index.d.ts +0 -1
  5. package/build/src/lib/events/auth/changePasswordAttempt/changePasswordAttempt.d.ts +1 -1
  6. package/build/src/lib/events/auth/changePasswordFail/changePasswordFail.d.ts +1 -1
  7. package/build/src/lib/events/auth/changePasswordSuccess/changePasswordSuccess.d.ts +1 -1
  8. package/build/src/lib/events/auth/signIn/signIn.d.ts +1 -1
  9. package/build/src/lib/events/auth/signOut/signOut.d.ts +1 -1
  10. package/build/src/lib/events/auth/signUp/signUp.d.ts +1 -1
  11. package/build/src/lib/events/auth/signUpAttempt/signUpAttempt.d.ts +1 -2
  12. package/build/src/lib/events/banner/bannerImpression/bannerImpression.d.ts +1 -1
  13. package/build/src/lib/events/banner/bannerImpression/bannerImpression.types.d.ts +1 -1
  14. package/build/src/lib/events/banner/selectBanner/selectBanner.d.ts +1 -1
  15. package/build/src/lib/events/banner/selectBanner/selectBanner.types.d.ts +4 -4
  16. package/build/src/lib/events/billing/addBillingInfo/addBillingInfo.d.ts +1 -1
  17. package/build/src/lib/events/billing/addBillingInfo/addBillingInfo.types.d.ts +1 -1
  18. package/build/src/lib/events/billing/selectBillingInfo/selectBillingInfo.d.ts +1 -1
  19. package/build/src/lib/events/billing/selectBillingInfo/selectBillingInfo.types.d.ts +2 -2
  20. package/build/src/lib/events/billing/updateBillingInfo/updateBillingInfo.d.ts +1 -1
  21. package/build/src/lib/events/billing/updateBillingInfo/updateBillingInfo.types.d.ts +2 -2
  22. package/build/src/lib/events/booking/bookAppointment/bookAppointment.d.ts +1 -1
  23. package/build/src/lib/events/category/categoryImpression/categoryImpression.d.ts +1 -1
  24. package/build/src/lib/events/category/searchCategoryAttempt/searchCategoryAttempt.d.ts +1 -1
  25. package/build/src/lib/events/category/selectCategory/selectCategory.d.ts +1 -2
  26. package/build/src/lib/events/category/viewCategory/viewCategory.d.ts +1 -2
  27. package/build/src/lib/events/checkout/checkoutAction/checkoutAction.d.ts +1 -1
  28. package/build/src/lib/events/checkout/checkoutAction/checkoutAction.types.d.ts +1 -1
  29. package/build/src/lib/events/checkout/initiateCheckout/initiateCheckout.d.ts +1 -1
  30. package/build/src/lib/events/coupon/applyBenefit/applyBenefit.d.ts +1 -1
  31. package/build/src/lib/events/coupon/couponCodeError/couponCodeError.d.ts +1 -1
  32. package/build/src/lib/events/coupon/redeemCouponCode/redeemCouponCode.d.ts +1 -1
  33. package/build/src/lib/events/coupon/removeBenefit/removeBenefit.d.ts +1 -1
  34. package/build/src/lib/events/coupon/viewBenefitDetails/viewBenefitDetails.d.ts +1 -1
  35. package/build/src/lib/events/coupon/viewBenefitsWallet/viewBenefitsWallet.d.ts +1 -1
  36. package/build/src/lib/events/coupon/viewQRStoreCoupon/viewQRStoreCoupon.d.ts +1 -2
  37. package/build/src/lib/events/credit/addCredits/addCredits.d.ts +1 -1
  38. package/build/src/lib/events/credit/spendCredits/spendCredits.d.ts +1 -1
  39. package/build/src/lib/events/credit/viewCredits/viewCredits.d.ts +1 -1
  40. package/build/src/lib/events/customEvent/customEvent.d.ts +2 -2
  41. package/build/src/lib/events/events.d.ts +5 -5
  42. package/build/src/lib/events/events.types.d.ts +1 -1
  43. package/build/src/lib/events/fulfillment/viewFulfillmentStep/viewFulfillmentStep.d.ts +1 -1
  44. package/build/src/lib/events/fulfillment/viewTracking/viewTracking.d.ts +1 -1
  45. package/build/src/lib/events/fulfillment/viewTracking/viewTracking.types.d.ts +1 -1
  46. package/build/src/lib/events/geo/changeLocation/changeLocation.d.ts +2 -2
  47. package/build/src/lib/events/geo/changeLocation/changeLocation.types.d.ts +4 -4
  48. package/build/src/lib/events/geo/findLocation/findLocation.d.ts +2 -2
  49. package/build/src/lib/events/geo/findLocation/findLocation.types.d.ts +2 -2
  50. package/build/src/lib/events/geo/index.d.ts +4 -4
  51. package/build/src/lib/events/geo/outOfCoverage/outOfCoverage.d.ts +2 -2
  52. package/build/src/lib/events/geo/outOfCoverage/outOfCoverage.types.d.ts +2 -2
  53. package/build/src/lib/events/geo/setLocation/setLocation.d.ts +2 -2
  54. package/build/src/lib/events/geo/setLocation/setLocation.types.d.ts +2 -2
  55. package/build/src/lib/events/help/requestAssistance/requestAssistance.d.ts +1 -2
  56. package/build/src/lib/events/loyalty/earnPoints/earnPoints.d.ts +1 -1
  57. package/build/src/lib/events/loyalty/sharePoints/sharePoints.d.ts +1 -1
  58. package/build/src/lib/events/loyalty/spendPoints/spendPoints.d.ts +1 -1
  59. package/build/src/lib/events/loyalty/viewLoyaltyLevel/viewLoyaltyLevel.d.ts +1 -1
  60. package/build/src/lib/events/order/cancelOrder/cancelOrder.d.ts +1 -1
  61. package/build/src/lib/events/order/rateOrder/rateOrder.d.ts +1 -1
  62. package/build/src/lib/events/order/requestRefund/requestRefund.d.ts +1 -1
  63. package/build/src/lib/events/order/requestRefund/requestRefund.types.d.ts +0 -1
  64. package/build/src/lib/events/other/generateLead/generateLead.d.ts +1 -1
  65. package/build/src/lib/events/other/pageView/pageView.d.ts +1 -2
  66. package/build/src/lib/events/other/pageView/pageView.types.d.ts +2 -2
  67. package/build/src/lib/events/other/searchPageContent/searchPageContent.d.ts +1 -1
  68. package/build/src/lib/events/other/searchPageContent/searchPageContent.types.d.ts +1 -1
  69. package/build/src/lib/events/payment/changePaymentType/changePaymentType.d.ts +1 -1
  70. package/build/src/lib/events/payment/changePaymentType/changePaymentType.types.d.ts +2 -6
  71. package/build/src/lib/events/payment/selectPaymentType/selectPaymentType.d.ts +1 -1
  72. package/build/src/lib/events/payment/selectPaymentType/selectPaymentType.types.d.ts +2 -2
  73. package/build/src/lib/events/payment/setPaymentInfo/setPaymentInfo.d.ts +1 -1
  74. package/build/src/lib/events/payment/setPaymentInfo/setPaymentInfo.types.d.ts +3 -3
  75. package/build/src/lib/events/product/customizeProduct/customizeProduct.d.ts +1 -1
  76. package/build/src/lib/events/product/filterProducts/filterProducts.d.ts +1 -1
  77. package/build/src/lib/events/product/filterProducts/filterProducts.types.d.ts +1 -1
  78. package/build/src/lib/events/product/productImpression/productImpression.d.ts +1 -1
  79. package/build/src/lib/events/product/searchProductAttempt/searchProductAttempt.d.ts +1 -1
  80. package/build/src/lib/events/product/searchProductNotFound/searchProductNotFound.d.ts +1 -1
  81. package/build/src/lib/events/product/searchProductSuccess/searchProductSuccess.d.ts +1 -1
  82. package/build/src/lib/events/product/selectProduct/selectProduct.d.ts +1 -2
  83. package/build/src/lib/events/product/sortProducts/sortProducts.d.ts +1 -1
  84. package/build/src/lib/events/product/sortProducts/sortProducts.types.d.ts +2 -2
  85. package/build/src/lib/events/product/viewProductDetails/viewProductDetails.d.ts +1 -2
  86. package/build/src/lib/events/product/viewProductDetails/viewProductDetails.types.d.ts +1 -1
  87. package/build/src/lib/events/purchase/purchaseAttempt/purchaseAttempt.d.ts +1 -1
  88. package/build/src/lib/events/purchase/purchaseAttempt/purchaseAttempt.types.d.ts +1 -1
  89. package/build/src/lib/events/purchase/purchaseFail/purchaseFail.d.ts +1 -1
  90. package/build/src/lib/events/purchase/purchaseSuccess/purchaseSuccess.d.ts +1 -1
  91. package/build/src/lib/events/settings/viewSettings/viewSettings.d.ts +1 -1
  92. package/build/src/lib/events/shipping/addShippingAddress/addShippingAddress.d.ts +1 -1
  93. package/build/src/lib/events/shipping/addShippingAddress/addShippingAddress.types.d.ts +1 -1
  94. package/build/src/lib/events/shipping/selectShippingAddress/selectShippingAddress.d.ts +1 -1
  95. package/build/src/lib/events/shipping/selectShippingAddress/selectShippingAddress.types.d.ts +1 -1
  96. package/build/src/lib/events/shipping/updateShippingAddress/updateShippingAddress.d.ts +1 -1
  97. package/build/src/lib/events/shipping/updateShippingAddress/updateShippingAddress.types.d.ts +1 -1
  98. package/build/src/lib/events/shoppingCart/addProductToCart/addProductToCart.d.ts +1 -1
  99. package/build/src/lib/events/shoppingCart/addProductToWishlist/addProductToWishlist.d.ts +1 -1
  100. package/build/src/lib/events/shoppingCart/clearCart/clearCart.d.ts +1 -1
  101. package/build/src/lib/events/shoppingCart/removeProductFromCart/removeProductFromCart.d.ts +1 -1
  102. package/build/src/lib/events/shoppingCart/removeProductFromCart/removeProductFromCart.types.d.ts +1 -1
  103. package/build/src/lib/events/shoppingCart/removeProductFromWishlist/removeProductFromWishlist.d.ts +1 -1
  104. package/build/src/lib/events/shoppingCart/removeProductFromWishlist/removeProductFromWishlist.types.d.ts +1 -1
  105. package/build/src/lib/events/shoppingCart/updateProductInCart/updateProductInCart.d.ts +1 -2
  106. package/build/src/lib/events/shoppingCart/updateProductInCart/updateProductInCart.types.d.ts +1 -1
  107. package/build/src/lib/events/shoppingCart/updateProductInWishlist/updateProductInWishlist.d.ts +1 -2
  108. package/build/src/lib/events/shoppingCart/updateProductInWishlist/updateProductInWishlist.types.d.ts +1 -1
  109. package/build/src/lib/events/shoppingCart/viewCart/viewCart.d.ts +1 -1
  110. package/build/src/lib/events/social/share/share.d.ts +1 -1
  111. package/build/src/lib/events/social/share/share.types.d.ts +3 -3
  112. package/build/src/lib/events/store/changeStore/changeStore.d.ts +1 -1
  113. package/build/src/lib/events/store/setStore/setStore.d.ts +1 -1
  114. package/build/src/lib/events/user/setUserInfo/setUserInfo.d.ts +1 -2
  115. package/build/src/lib/events/user/updateUserInfo/updateUserInfo.d.ts +2 -3
  116. package/build/src/lib/events/vendor/changeVendor/changeVendor.d.ts +1 -1
  117. package/build/src/lib/events/vendor/setVendor/setVendor.d.ts +1 -1
  118. package/build/src/lib/events/workflow/selectWorkflow/selectWorkflow.d.ts +1 -1
  119. package/build/src/lib/events/workflow/updateWorkflow/updateWorkflow.d.ts +1 -1
  120. package/build/src/lib/initAnalytics/initAnalytics.helpers.d.ts +1 -1
  121. package/build/src/lib/initAnalytics/initAnalytics.types.d.ts +1 -13
  122. package/build/src/lib/providers/AnalyticsProvider/AnalyticsProvider.d.ts +1 -1
  123. package/build/src/lib/providers/AnalyticsProvider/AnalyticsProvider.types.d.ts +2 -2
  124. package/build/src/lib/providers/FacebookPixel/FacebookPixel.types.d.ts +1 -0
  125. package/build/src/lib/providers/FacebookPixel/events/order/rateOrder/rateOrder.types.d.ts +0 -1
  126. package/build/src/lib/providers/FacebookPixel/events/product/productImpression/productImpression.types.d.ts +1 -1
  127. package/build/src/lib/providers/GlobalProvider/GlobalProvider.d.ts +1 -1
  128. package/build/src/lib/providers/GoogleAnalytics/GoogleAnalytics.types.d.ts +2 -8
  129. package/build/src/types/event.types.d.ts +1 -0
  130. package/build/src/utils/logs.utils.d.ts +1 -1
  131. package/build/src/utils/state.utils.d.ts +0 -8
  132. package/package.json +7 -6
@@ -2,7 +2,7 @@ import { ChangeVendorParams } from "./changeVendor.types";
2
2
  /**
3
3
  * Emits a changeVendor event to every configured provider.
4
4
  *
5
- * Log this event when the vendor has change.
5
+ * Record this event when
6
6
  *
7
7
  * @since 0.5.14
8
8
  * @property {ChangeVendorParams} params ChangeVendor event parameters
@@ -2,7 +2,7 @@ import { SetVendorParams } from "./setVendor.types";
2
2
  /**
3
3
  * Emits a setVendor event to every configured provider.
4
4
  *
5
- * Log this event when users set the vendor for the first time.
5
+ * Record this event when
6
6
  *
7
7
  * @since 0.5.14
8
8
  * @property {SetVendorParams} params SetVendor event parameters
@@ -2,7 +2,7 @@ import { SelectWorkflowParams } from "./selectWorkflow.types";
2
2
  /**
3
3
  * Emits a SelectWorkflow event to every configured provider.
4
4
  *
5
- * Log this event when users set the workflow for the first time.
5
+ * Record this event when
6
6
  *
7
7
  * @since 0.5.14
8
8
  * @property {SelectWorkflowParams} params SelectWorkflow event parameters
@@ -2,7 +2,7 @@ import { UpdateWorkflowParams } from "./updateWorkflow.types";
2
2
  /**
3
3
  * Emits a UpdateWorkflow event to every configured provider.
4
4
  *
5
- * Log this event when the workflow has changed.
5
+ * Record this event when
6
6
  *
7
7
  * @since 0.5.14
8
8
  * @property {UpdateWorkflowParams} params UpdateWorkflow event parameters
@@ -11,7 +11,7 @@ export declare const checkUniqueProviderNames: (providers: AnalyticsProviderType
11
11
  * Check if the given providers tracker ids are unique.
12
12
  *
13
13
  * @since 0.5.14
14
- * @param {AnalyticsProviderTypes[]} providers Providers list
14
+ * @param {AnalytcsProvider[]} providers Providers list
15
15
  * @returns {boolean} true if no provider trackerId clashes with another
16
16
  */
17
17
  export declare const checkUniqueProviderTrackerIds: (providers: AnalyticsProviderTypes[]) => boolean;
@@ -1,22 +1,10 @@
1
1
  import { Vendor } from "@artisan-commerce/types";
2
2
  import { AnalyticsMeta } from "../../types/common.types";
3
3
  import { AnalyticsProviderTypes } from "../../types/event.types";
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 {boolean} shareArtisanAnalytics Share e-commerce analytics with Trade
14
- * @property {InitAnalyticsConfigMeta} meta Commerce's metadata
15
- */
16
4
  export interface InitAnalyticsConfig {
17
5
  providers: AnalyticsProviderTypes[];
18
6
  activeVendor?: Vendor["id"];
19
- vendors: Vendor["id"][] | undefined;
7
+ vendors: Vendor["id"][];
20
8
  debug?: boolean;
21
9
  shareArtisanAnalytics?: boolean;
22
10
  meta: InitAnalyticsConfigMeta;
@@ -26,7 +26,7 @@ declare abstract class AnalyticsProvider implements IAnaliticsProvider {
26
26
  * @since 0.5.14
27
27
  * @returns Analytics Provider vendors, if not specified it fallsback to the global vendors
28
28
  */
29
- get vendors(): number[] | undefined;
29
+ get vendors(): number[];
30
30
  /**
31
31
  * Inserts the initialization script to the body of the document.
32
32
  *
@@ -23,10 +23,10 @@ export interface AnalyticsProviderConstructor {
23
23
  * @since 0.5.14
24
24
  * @property {Function} init Initializes the provider connection
25
25
  * @property {Function} updateConfig Updates the initial config of the provider
26
- * @property {number[]} vendors The provider selected vendors ids
26
+ * @property {Function} getVendors Return the provider selected vendors
27
27
  */
28
28
  export interface IAnaliticsProvider {
29
29
  init: () => void;
30
30
  updateConfig: (config: Partial<unknown>) => void;
31
- vendors: Vendor["id"][] | undefined;
31
+ vendors: Vendor["id"][];
32
32
  }
@@ -17,6 +17,7 @@ export interface FacebookPixelProvider extends Omit<AnalyticsProviderConstructor
17
17
  *
18
18
  * @interface FacebookPixelProvider
19
19
  * @since 0.5.14
20
+ * @property {string} userId the users unique identifier between devices
20
21
  * @property {CurrencyCodes} currency user's country monetary code
21
22
  */
22
23
  export interface FacebookPixelProviderConfig {
@@ -9,7 +9,6 @@ import { FacebookPixelCustomEventParams } from "../../../FacebookPixel.types";
9
9
  * @extends FacebookPixelCommonEventParams
10
10
  * @extends FacebookPixelCustomEventParams
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 FacebookPixelCommonEventParams, FacebookPixelCustomEventParams, RateOrderCommonParams {
15
14
  contentType?: string;
@@ -8,7 +8,7 @@ import { FacebookPixelCustomEventParams } from "../../../FacebookPixel.types";
8
8
  * @since 0.5.14
9
9
  * @extends FacebookPixelCommonEventParams
10
10
  * @extends FacebookPixelCustomEventParams
11
- * @property {string} contentType The type of product the user had an impression on (e.g. food)
11
+ * @property {string} contentType The type of products being sold (e.g. food)
12
12
  */
13
13
  export interface ProductImpressionParams extends FacebookPixelCommonEventParams, FacebookPixelCustomEventParams, ProductImpressionCommonParams {
14
14
  contentType?: string;
@@ -41,7 +41,7 @@ declare class GlobalProvider {
41
41
  * @since 0.5.14
42
42
  * @returns Analytics Provider vendors, if not specified it fallsback to the global vendors
43
43
  */
44
- get vendors(): number[] | undefined;
44
+ get vendors(): number[];
45
45
  setVendors(vendors: Config["vendors"]): void;
46
46
  /**
47
47
  * @override
@@ -92,18 +92,12 @@ export declare namespace Gtag {
92
92
  category?: string;
93
93
  creative_name?: string;
94
94
  creative_slot?: string;
95
- currency?: string;
96
- index?: number;
97
- item_brand?: string;
98
- item_category?: string;
99
95
  item_id?: string;
100
- item_list_id?: string;
101
- item_list_name?: string;
102
- item_name?: string;
103
- item_variant?: string;
104
96
  location_id?: string;
97
+ item_name?: string;
105
98
  price?: Currency;
106
99
  quantity?: number;
100
+ currency?: string;
107
101
  }
108
102
  interface Promotion {
109
103
  creative_name?: string;
@@ -208,6 +208,7 @@ export interface ProvidersHandlers<T> {
208
208
  * Shared params across every event.
209
209
  *
210
210
  * @interface EventCommonParams
211
+ * @author Luis Eduardo Andrade
211
212
  * @since 0.5.14
212
213
  * @property {string} userId The unique identifier of a user across platforms
213
214
  * @property {boolean} isAnonymous Whether the user is registered or not
@@ -22,7 +22,7 @@ export declare const noActiveVendor: () => void;
22
22
  *
23
23
  * @since 0.5.14
24
24
  * @param {string} eventName The name of the event
25
- * @param {AnalyticsProviderTypes} provider the provider that will emit the event
25
+ * @param {string} provider the provider that will emit the event
26
26
  */
27
27
  export declare const vendorNotIncluded: (eventName: string, provider: AnalyticsProviderTypes) => void;
28
28
  /**
@@ -1,12 +1,4 @@
1
1
  import { GlobalState } from "../types/state.types";
2
- import { Vendor } from "@artisan-commerce/types";
3
2
  export declare const setInitialState: () => void;
4
3
  export declare const getState: () => GlobalState;
5
4
  export declare const setState: (state: Partial<GlobalState>) => void;
6
- /**
7
- * Utility function to update the active vendor.
8
- *
9
- * @since 0.5.14
10
- * @param {Vendor|number} vendor New active vendor
11
- */
12
- export declare const updateActiveVendor: (vendor: Vendor | Vendor["id"] | undefined) => void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@artisan-commerce/analytics-web",
3
3
  "description": "Artisan commerce analytics web library",
4
- "version": "0.1.0-canary.18",
4
+ "version": "0.1.0-canary.2",
5
5
  "main": "./build/main.bundle.js",
6
6
  "types": "./build/src/index.d.ts",
7
7
  "files": [
@@ -30,13 +30,13 @@
30
30
  "author": "Luis Eduardo Andrade",
31
31
  "license": "MIT",
32
32
  "dependencies": {
33
- "@artisan-commerce/state": "0.2.2-canary.4",
33
+ "@artisan-commerce/state": "0.2.2-canary.2",
34
34
  "snake-case": "^3.0.4"
35
35
  },
36
36
  "devDependencies": {
37
- "@artisan-commerce/products": "0.8.2-canary.15",
38
- "@artisan-commerce/shopping-cart": "0.11.0-canary.15",
39
- "@artisan-commerce/types": "0.13.0-canary.7",
37
+ "@artisan-commerce/products": "0.8.2-canary.8",
38
+ "@artisan-commerce/shopping-cart": "0.11.0-canary.8",
39
+ "@artisan-commerce/types": "0.13.0-canary.4",
40
40
  "@babel/core": "^7.10.5",
41
41
  "@babel/preset-env": "^7.10.4",
42
42
  "@babel/preset-react": "^7.10.4",
@@ -49,6 +49,7 @@
49
49
  "avn": "^0.2.4",
50
50
  "avn-nvm": "^0.2.2",
51
51
  "clean-webpack-plugin": "^3.0.0",
52
+ "cross-env": "^7.0.2",
52
53
  "dotenv-webpack": "^2.0.0",
53
54
  "env-cmd": "^10.1.0",
54
55
  "eslint": "^7.5.0",
@@ -83,5 +84,5 @@
83
84
  "@artisan-commerce/products": "*",
84
85
  "@artisan-commerce/shopping-cart": "*"
85
86
  },
86
- "gitHead": "cd7c64e53d23872f23eb3285d3031cced1475188"
87
+ "gitHead": "0164bdce85dc4dc2fce585bb788ae3adb1850fac"
87
88
  }