@artisan-commerce/analytics-rn 0.2.0-canary.1 → 0.2.0-canary.11

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 CHANGED
@@ -3,6 +3,91 @@
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.11](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/analytics-rn@0.2.0-canary.10...@artisan-commerce/analytics-rn@0.2.0-canary.11) (2021-05-05)
7
+
8
+ **Note:** Version bump only for package @artisan-commerce/analytics-rn
9
+
10
+
11
+
12
+
13
+
14
+ ## [0.2.0-canary.10](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/analytics-rn@0.2.0-canary.9...@artisan-commerce/analytics-rn@0.2.0-canary.10) (2021-05-05)
15
+
16
+ **Note:** Version bump only for package @artisan-commerce/analytics-rn
17
+
18
+
19
+
20
+
21
+
22
+ ## [0.2.0-canary.9](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/analytics-rn@0.2.0-canary.8...@artisan-commerce/analytics-rn@0.2.0-canary.9) (2021-04-27)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * **global:** fix updateActiveVendor utility function and state lib ([e5d9c52](https://bitbucket.org/tradesystem/artisan_monorepo/commit/e5d9c52455929782ada1762b03abb3363efe88cf))
28
+
29
+
30
+
31
+ ## [0.2.0-canary.8](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/analytics-rn@0.2.0-canary.7...@artisan-commerce/analytics-rn@0.2.0-canary.8) (2021-04-23)
32
+
33
+
34
+ ### Bug Fixes
35
+
36
+ * **analytics-rn:** expose util function to update active vendor ([4247982](https://bitbucket.org/tradesystem/artisan_monorepo/commit/4247982bfd6bec52db7dc28f32cd06821b724909))
37
+
38
+
39
+
40
+ ## [0.2.0-canary.7](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/analytics-rn@0.2.0-canary.6...@artisan-commerce/analytics-rn@0.2.0-canary.7) (2021-04-22)
41
+
42
+ **Note:** Version bump only for package @artisan-commerce/analytics-rn
43
+
44
+
45
+
46
+
47
+
48
+ ## [0.2.0-canary.6](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/analytics-rn@0.2.0-canary.5...@artisan-commerce/analytics-rn@0.2.0-canary.6) (2021-04-21)
49
+
50
+ **Note:** Version bump only for package @artisan-commerce/analytics-rn
51
+
52
+
53
+
54
+
55
+
56
+ ## [0.2.0-canary.5](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/analytics-rn@0.2.0-canary.4...@artisan-commerce/analytics-rn@0.2.0-canary.5) (2021-04-20)
57
+
58
+
59
+ ### Bug Fixes
60
+
61
+ * **analytics-rn:** remove unused event parameter for google events ([2d76e14](https://bitbucket.org/tradesystem/artisan_monorepo/commit/2d76e1498ac4a86fe4b4172a3f5f35b39a69542f))
62
+
63
+
64
+
65
+ ## [0.2.0-canary.4](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/analytics-rn@0.2.0-canary.3...@artisan-commerce/analytics-rn@0.2.0-canary.4) (2021-04-19)
66
+
67
+ **Note:** Version bump only for package @artisan-commerce/analytics-rn
68
+
69
+
70
+
71
+
72
+
73
+ ## [0.2.0-canary.3](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/analytics-rn@0.2.0-canary.2...@artisan-commerce/analytics-rn@0.2.0-canary.3) (2021-04-16)
74
+
75
+
76
+ ### Bug Fixes
77
+
78
+ * **analytics-rn:** fix purchaseAttempt and purchaseFail events parameters ([a2ab693](https://bitbucket.org/tradesystem/artisan_monorepo/commit/a2ab693622c284ca4712fa8bd80e133636efb34a))
79
+
80
+
81
+
82
+ ## [0.2.0-canary.2](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/analytics-rn@0.2.0-canary.1...@artisan-commerce/analytics-rn@0.2.0-canary.2) (2021-04-16)
83
+
84
+
85
+ ### Bug Fixes
86
+
87
+ * **global:** fix spendPoints google name event and update husky ([42adffb](https://bitbucket.org/tradesystem/artisan_monorepo/commit/42adffb8594780f9dc56c475ac2fe29ca5f9270a))
88
+
89
+
90
+
6
91
  ## [0.2.0-canary.1](https://bitbucket.org/tradesystem/artisan_monorepo/compare/@artisan-commerce/analytics-rn@0.2.0-canary.0...@artisan-commerce/analytics-rn@0.2.0-canary.1) (2021-04-16)
7
92
 
8
93
  **Note:** Version bump only for package @artisan-commerce/analytics-rn
@@ -6,3 +6,4 @@ export * from "./lib/providers/FacebookPixel/FacebookPixel.types";
6
6
  export * from "./lib/providers/GoogleAnalytics/GoogleAnalytics.types";
7
7
  export { default as events } from "./lib/events/events";
8
8
  export * from "./types/common.types";
9
+ export { updateActiveVendor } from "./utils/state.utils";
@@ -7,7 +7,7 @@ import { CustomEventParams as FacebookCustomEventParams } from "../../providers/
7
7
  * @since 0.5.14
8
8
  */
9
9
  export interface CustomEventCommonParams {
10
- [key: string]: string | number | boolean;
10
+ [key: string]: string | number;
11
11
  }
12
12
  /**
13
13
  * customEvent event params.
@@ -2,8 +2,7 @@ import { ScreenViewParams } from "./screenView.types";
2
2
  /**
3
3
  * Emits a screenView event to every configured provider.
4
4
  *
5
- * Log this event when you need to add custom page view that the default page
6
- * view event does not log.
5
+ * Log this event when for each visited screen.
7
6
  *
8
7
  * @since 0.5.14
9
8
  * @param {ScreenViewParams} params ScreenView event parameters
@@ -1,9 +1,10 @@
1
1
  import { Vendor } from "@artisan-commerce/types";
2
2
  import { AnalyticsMeta } from "../../types/common.types";
3
+ import AnalyticsProvider from "../providers/AnalyticsProvider/AnalyticsProvider";
3
4
  export interface InitAnalyticsConfig {
4
- providers: any[];
5
+ providers: AnalyticsProvider[];
5
6
  activeVendor?: Vendor["id"];
6
- vendors: Vendor["id"][];
7
+ vendors: Vendor["id"][] | undefined;
7
8
  debug?: boolean;
8
9
  meta: InitAnalyticsConfigMeta;
9
10
  }
@@ -24,7 +24,7 @@ declare abstract class AnalyticsProvider implements IAnaliticsProvider {
24
24
  * @since 0.5.14
25
25
  * @returns Analytics Provider vendors, if not specified it fallsback to the global vendors
26
26
  */
27
- get vendors(): number[];
27
+ get vendors(): number[] | undefined;
28
28
  /**
29
29
  * Updates the provider instance config for the next events.
30
30
  *
@@ -20,9 +20,9 @@ export interface AnalyticsProviderConstructor {
20
20
  * @interface IAnaliticsProvider
21
21
  * @since 0.5.14
22
22
  * @property {Function} updateConfig Updates the initial config of the provider
23
- * @property {Function} getVendors Return the provider selected vendors
23
+ * @property {number[]} vendors The provider selected vendors ids
24
24
  */
25
25
  export interface IAnaliticsProvider {
26
26
  updateConfig: (config: Partial<unknown>) => void;
27
- vendors: Vendor["id"][];
27
+ vendors: Vendor["id"][] | undefined;
28
28
  }
@@ -40,19 +40,3 @@ export interface FacebookPixelCommonEventParams extends EventCommonParams {
40
40
  export interface FacebookPixelCustomEventParams {
41
41
  [key: string]: any;
42
42
  }
43
- export declare namespace Fbq {
44
- interface Fbq {
45
- (command: "trackSingle", targetId: string, eventName: EventNames, eventParams?: ControlParams | EventParams | CustomParams): void;
46
- (command: "trackSingleCustom", targetId: string, eventName: string, eventParams?: ControlParams | EventParams | CustomParams): void;
47
- }
48
- interface CustomParams {
49
- [key: string]: any;
50
- }
51
- interface ControlParams {
52
- }
53
- type EventNames = "ScreenView" | "CompleteRegistration" | "FindLocation" | "Search" | "CustomizeProduct" | "InitiateCheckout" | "AddPaymentInfo" | "Schedule" | "Purchase" | "Lead" | "AddToCart" | "AddToWishlist" | "Contact";
54
- interface EventParams {
55
- currency?: string;
56
- value?: number;
57
- }
58
- }
@@ -33,10 +33,8 @@ export interface GoogleAnalyticsProviderConfig {
33
33
  * @interface GoogleAnalyticsCommonEventParams
34
34
  * @since 0.5.14
35
35
  * @extends EventCommonParams
36
- * @property {Function} callback Fired when event is resolved
37
36
  */
38
37
  export interface GoogleAnalyticsCommonEventParams extends EventCommonParams {
39
- callback?: () => void;
40
38
  }
41
39
  /**
42
40
  * Google Analytics custom event shared parameters.
@@ -48,44 +46,6 @@ export interface GoogleAnalyticsCustomEventParams {
48
46
  [key: string]: any;
49
47
  }
50
48
  export declare namespace Gtag {
51
- interface Gtag {
52
- (command: "config", targetId: string, config?: ControlParams | EventParams | CustomParams): void;
53
- (command: "get", targetId: string, fieldName: string, callback: (field: unknown) => void): void;
54
- (command: "set", targetId: string, config: CustomParams): void;
55
- (command: "event", eventName: EventNames | string, eventParams?: ControlParams | EventParams | CustomParams): void;
56
- }
57
- interface CustomParams {
58
- [key: string]: any;
59
- }
60
- interface ControlParams {
61
- groups?: string | string[];
62
- send_to: string | string[];
63
- event_callback?: () => void;
64
- event_timeout?: number;
65
- }
66
- type EventNames = "add_payment_info" | "add_to_cart" | "add_to_wishlist" | "begin_checkout" | "earn_virtual_currency" | "exception" | "generate_lead" | "login" | "page_view" | "purchase" | "refund" | "remove_from_cart" | "screen_view" | "search" | "select_content" | "set_checkout_option" | "share" | "sign_up" | "timing_complete" | "view_item" | "view_item_list" | "view_promotion" | "view_search_results";
67
- interface EventParams {
68
- checkout_option?: string;
69
- checkout_step?: number;
70
- content_id?: string;
71
- content_type?: string;
72
- coupon?: string;
73
- currency?: string;
74
- description?: string;
75
- fatal?: boolean;
76
- items?: Item[];
77
- method?: string;
78
- number?: string;
79
- promotions?: Promotion[];
80
- screen_name?: string;
81
- search_term?: string;
82
- shipping?: Currency;
83
- tax?: Currency;
84
- transaction_id?: string;
85
- value?: number;
86
- event_label?: string;
87
- event_category?: string;
88
- }
89
49
  type Currency = string | number;
90
50
  interface Item {
91
51
  brand?: string;
@@ -105,10 +65,4 @@ export declare namespace Gtag {
105
65
  price?: Currency;
106
66
  quantity?: number;
107
67
  }
108
- interface Promotion {
109
- creative_name?: string;
110
- creative_slot?: string;
111
- id?: string;
112
- name?: string;
113
- }
114
68
  }
@@ -0,0 +1 @@
1
+ export {};
@@ -199,7 +199,6 @@ export interface ProvidersHandlers<T> {
199
199
  * Shared params across every event.
200
200
  *
201
201
  * @interface EventCommonParams
202
- * @author Luis Eduardo Andrade
203
202
  * @since 0.5.14
204
203
  * @property {string} userId The unique identifier of a user across platforms
205
204
  * @property {boolean} isAnonymous Whether the user is registered or not
@@ -1,4 +1,12 @@
1
1
  import { GlobalState } from "../types/state.types";
2
+ import { Vendor } from "@artisan-commerce/types";
2
3
  export declare const setInitialState: () => void;
3
4
  export declare const getState: () => GlobalState;
4
5
  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;