@artisan-commerce/analytics-rn 0.2.0-canary.27 → 0.2.0-canary.28

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,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.28](https://bitbucket.org/tradesystem/artisan_sdk/compare/@artisan-commerce/analytics-rn@0.2.0-canary.27...@artisan-commerce/analytics-rn@0.2.0-canary.28) (2021-06-23)
7
+
8
+
9
+ ### Features
10
+
11
+ * **analytics:** add identify functionality for segment ([9497750](https://bitbucket.org/tradesystem/artisan_sdk/commit/9497750a67c19165bfdc13f602cdc9c3ad4bbc37))
12
+
13
+
14
+
6
15
  ## [0.2.0-canary.27](https://bitbucket.org/tradesystem/artisan_sdk/compare/@artisan-commerce/analytics-rn@0.2.0-canary.26...@artisan-commerce/analytics-rn@0.2.0-canary.27) (2021-06-18)
7
16
 
8
17
  **Note:** Version bump only for package @artisan-commerce/analytics-rn
@@ -7,3 +7,4 @@ 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
9
  export { updateActiveVendor } from "./utils/state.utils";
10
+ export { identifyUser } from "./utils/segment.utils";
@@ -19,6 +19,18 @@ export interface InitAnalyticsConfig {
19
19
  debug?: boolean;
20
20
  meta: InitAnalyticsConfigMeta;
21
21
  }
22
+ /**
23
+ * Commerce's metadata
24
+ *
25
+ * @interface InitAnalyticsConfigMeta
26
+ * @since 0.5.14
27
+ * @extends AnalyticsMeta
28
+ * @property {string} vendorName The name of the active vendor
29
+ * @property {number} storeId The id of the active store
30
+ * @property {string} storeName The name of the active store
31
+ * @property {number} catalogueId The id of the active catalogue
32
+ * @property {string} catalogueName The name of the active catalogue
33
+ */
22
34
  export interface InitAnalyticsConfigMeta extends Omit<AnalyticsMeta, "vendorId" | "versionSDK" | "platform" | "vendorName" | "storeId" | "storeName" | "catalogueId" | "catalogueName"> {
23
35
  vendorName?: AnalyticsMeta["vendorName"] | undefined;
24
36
  storeId?: AnalyticsMeta["storeId"] | undefined;
@@ -55,4 +55,40 @@ export declare namespace Segment {
55
55
  url?: string;
56
56
  image_url?: string;
57
57
  }
58
+ interface Address {
59
+ city?: string;
60
+ country?: string;
61
+ postalCode?: string;
62
+ state?: string;
63
+ street?: string;
64
+ [key: string]: any;
65
+ }
66
+ interface Company {
67
+ name?: string;
68
+ id?: string | number;
69
+ industry?: string;
70
+ employee_count?: number;
71
+ plan?: string;
72
+ [key: string]: any;
73
+ }
74
+ interface Traits {
75
+ id: string;
76
+ address?: Address;
77
+ age?: number;
78
+ avatar?: string;
79
+ bithday?: string;
80
+ company?: Company;
81
+ createdAt?: string;
82
+ description?: string;
83
+ email?: string;
84
+ firstName?: string;
85
+ gender?: string;
86
+ lastName?: string;
87
+ name?: string;
88
+ phone?: string;
89
+ title?: string;
90
+ username?: string;
91
+ website?: string;
92
+ [key: string]: any;
93
+ }
58
94
  }
@@ -1,5 +1,5 @@
1
1
  import { SignInCommonParams } from "../../../../../events/auth/signIn/signIn.types";
2
- import { SegmentCommonEventParams } from "../../../Segment.types";
2
+ import { Segment, SegmentCommonEventParams } from "../../../Segment.types";
3
3
  import { SegmentCustomEventParams } from "../../../Segment.types";
4
4
  /**
5
5
  * Event allowed parameters.
@@ -10,7 +10,9 @@ import { SegmentCustomEventParams } from "../../../Segment.types";
10
10
  * @extends SegmentCustomEventParams
11
11
  * @extends SignInCommonParams
12
12
  * @property {string} name The user's name
13
+ * @property {Segment.Traits} identify Pieces of information you know about a user that are included in an identify call
13
14
  */
14
15
  export interface SignInParams extends SegmentCommonEventParams, SegmentCustomEventParams, SignInCommonParams {
15
16
  name: string;
17
+ identify?: Segment.Traits;
16
18
  }
@@ -1,5 +1,5 @@
1
1
  import { SignUpCommonParams } from "../../../../../events/auth/signUp/signUp.types";
2
- import { SegmentCommonEventParams } from "../../../Segment.types";
2
+ import { Segment, SegmentCommonEventParams } from "../../../Segment.types";
3
3
  import { SegmentCustomEventParams } from "../../../Segment.types";
4
4
  /**
5
5
  * Event allowed parameters.
@@ -11,8 +11,10 @@ import { SegmentCustomEventParams } from "../../../Segment.types";
11
11
  * @extends SignUpCommonParams
12
12
  * @property {string} name The user's name
13
13
  * @property {string} email The user's email
14
+ * @property {Segment.Traits} identify Pieces of information you know about a user that are included in an identify call
14
15
  */
15
16
  export interface SignUpParams extends SegmentCommonEventParams, SegmentCustomEventParams, SignUpCommonParams {
16
17
  name: string;
17
18
  email: string;
19
+ identify?: Segment.Traits;
18
20
  }
@@ -1,5 +1,5 @@
1
1
  import { AddShippingAddressCommonParams } from "../../../../../events/shipping/addShippingAddress/addShippingAddress.types";
2
- import { SegmentCommonEventParams } from "../../../Segment.types";
2
+ import { Segment, SegmentCommonEventParams } from "../../../Segment.types";
3
3
  import { SegmentCustomEventParams } from "../../../Segment.types";
4
4
  /**
5
5
  * Event allowed parameters.
@@ -9,6 +9,8 @@ import { SegmentCustomEventParams } from "../../../Segment.types";
9
9
  * @extends SegmentCommonEventParams
10
10
  * @extends SegmentCustomEventParams
11
11
  * @extends AddShippingAddressCommonParams
12
+ * @property {Segment.Traits} identify Pieces of information you know about a user that are included in an identify call
12
13
  */
13
14
  export interface AddShippingAddressParams extends SegmentCommonEventParams, SegmentCustomEventParams, AddShippingAddressCommonParams {
15
+ identify?: Segment.Traits;
14
16
  }
@@ -1,5 +1,5 @@
1
1
  import { SelectShippingAddressCommonParams } from "../../../../../events/shipping/selectShippingAddress/selectShippingAddress.types";
2
- import { SegmentCommonEventParams } from "../../../Segment.types";
2
+ import { Segment, SegmentCommonEventParams } from "../../../Segment.types";
3
3
  import { SegmentCustomEventParams } from "../../../Segment.types";
4
4
  /**
5
5
  * Event allowed parameters.
@@ -9,6 +9,8 @@ import { SegmentCustomEventParams } from "../../../Segment.types";
9
9
  * @extends SegmentCommonEventParams
10
10
  * @extends SegmentCustomEventParams
11
11
  * @extends SelectShippingAddressCommonParams
12
+ * @property {Segment.Traits} identify Pieces of information you know about a user that are included in an identify call
12
13
  */
13
14
  export interface SelectShippingAddressParams extends SegmentCommonEventParams, SegmentCustomEventParams, SelectShippingAddressCommonParams {
15
+ identify?: Segment.Traits;
14
16
  }
@@ -1,5 +1,5 @@
1
1
  import { UpdateShippingAddressCommonParams } from "../../../../../events/shipping/updateShippingAddress/updateShippingAddress.types";
2
- import { SegmentCommonEventParams } from "../../../Segment.types";
2
+ import { Segment, SegmentCommonEventParams } from "../../../Segment.types";
3
3
  import { SegmentCustomEventParams } from "../../../Segment.types";
4
4
  /**
5
5
  * Event allowed parameters.
@@ -9,6 +9,8 @@ import { SegmentCustomEventParams } from "../../../Segment.types";
9
9
  * @extends SegmentCommonEventParams
10
10
  * @extends SegmentCustomEventParams
11
11
  * @extends UpdateShippingAddressCommonParams
12
+ * @property {Segment.Traits} identify Pieces of information you know about a user that are included in an identify call
12
13
  */
13
14
  export interface UpdateShippingAddressParams extends SegmentCommonEventParams, SegmentCustomEventParams, UpdateShippingAddressCommonParams {
15
+ identify?: Segment.Traits;
14
16
  }
@@ -1,5 +1,5 @@
1
1
  import { SetUserInfoCommonParams } from "../../../../../events/user/setUserInfo/setUserInfo.types";
2
- import { SegmentCommonEventParams } from "../../../Segment.types";
2
+ import { Segment, SegmentCommonEventParams } from "../../../Segment.types";
3
3
  import { SegmentCustomEventParams } from "../../../Segment.types";
4
4
  /**
5
5
  * Event allowed parameters.
@@ -9,6 +9,8 @@ import { SegmentCustomEventParams } from "../../../Segment.types";
9
9
  * @extends SegmentCommonEventParams
10
10
  * @extends SegmentCustomEventParams
11
11
  * @extends SetUserInfoCommonParams
12
+ * @property {Segment.Traits} identify Pieces of information you know about a user that are included in an identify call
12
13
  */
13
14
  export interface SetUserInfoParams extends SegmentCommonEventParams, SegmentCustomEventParams, SetUserInfoCommonParams {
15
+ identify?: Segment.Traits;
14
16
  }
@@ -1,5 +1,5 @@
1
1
  import { UpdateUserInfoCommonParams } from "../../../../../events/user/updateUserInfo/updateUserInfo.types";
2
- import { SegmentCommonEventParams } from "../../../Segment.types";
2
+ import { Segment, SegmentCommonEventParams } from "../../../Segment.types";
3
3
  import { SegmentCustomEventParams } from "../../../Segment.types";
4
4
  /**
5
5
  * Event allowed parameters.
@@ -9,6 +9,8 @@ import { SegmentCustomEventParams } from "../../../Segment.types";
9
9
  * @extends SegmentCommonEventParams
10
10
  * @extends SegmentCustomEventParams
11
11
  * @extends UpdateUserInfoCommonParams
12
+ * @property {Segment.Traits} identify Pieces of information you know about a user that are included in an identify call
12
13
  */
13
14
  export interface UpdateUserInfoParams extends SegmentCommonEventParams, SegmentCustomEventParams, UpdateUserInfoCommonParams {
15
+ identify?: Segment.Traits;
14
16
  }
@@ -0,0 +1,8 @@
1
+ import { Segment } from "../lib/providers/Segment/Segment.types";
2
+ /**
3
+ * Utility function to identify a user across Segment destinations.
4
+ *
5
+ * @since 0.5.14
6
+ * @param {Segment.Traits} identify Pieces of information you know about a user that are included in an identify call
7
+ */
8
+ export declare const identifyUser: (identify: Segment.Traits) => void;