@artisan-commerce/analytics-web 0.2.0-canary.11 → 0.2.0-canary.13

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.
@@ -9,3 +9,4 @@ export { default as events } from "./lib/events/events";
9
9
  export * from "./types/common.types";
10
10
  export { updateActiveVendor } from "./utils/state.utils";
11
11
  export { identifyUser } from "./utils/segment.utils";
12
+ export { checkInit } from "./utils/common.utils";
@@ -2,12 +2,20 @@ import { InitAnalyticsConfig } from "../lib/initAnalytics/initAnalytics.types";
2
2
  import { AnalyticsMeta } from "./common.types";
3
3
  declare type StrictInitAnalyticsConfig = Required<InitAnalyticsConfig>;
4
4
  export interface GlobalState {
5
+ /** Analytics providers instances that can be targeted to emit events */
5
6
  providers: StrictInitAnalyticsConfig["providers"];
7
+ /** The vendor that will emit the events */
6
8
  activeVendor?: StrictInitAnalyticsConfig["activeVendor"];
9
+ /** List of vendors that can emit events if active */
7
10
  vendors: StrictInitAnalyticsConfig["vendors"];
11
+ /** Debug mode */
8
12
  debug: StrictInitAnalyticsConfig["debug"];
13
+ /** Share e-commerce analytics with Trade */
9
14
  shareArtisnAnalytics: StrictInitAnalyticsConfig["shareArtisnAnalytics"];
15
+ /** Static commerce metadata */
10
16
  meta: GlobalStateMeta;
17
+ /** Indicates whether or not web analytics has been initialized */
18
+ initialized: boolean;
11
19
  }
12
20
  export interface GlobalStateMeta extends Omit<AnalyticsMeta, "accountId" | "vendorId" | "vendorName" | "storeId" | "storeName" | "catalogueId" | "catalogueName" | "appName" | "versionApp"> {
13
21
  accountId: AnalyticsMeta["accountId"] | undefined;
@@ -1,8 +1,15 @@
1
1
  /**
2
- * Update the event prameters keys to be in snake case.
2
+ * Update the event parameters keys to be in snake case.
3
3
  *
4
4
  * @since 0.5.14
5
5
  * @param {T} params Event parameters to be transformed
6
6
  * @returns {T} Event parameters with its keys in snake case
7
7
  */
8
8
  export declare const eventParamsToSnakeCase: <T>(params: T) => T;
9
+ /**
10
+ * Checks if the web analytics package has been initialized.
11
+ *
12
+ * @returns {boolean} The attribute that indicates whether or not web analytics
13
+ * has been initialized
14
+ */
15
+ export declare const checkInit: () => boolean;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@artisan-commerce/analytics-web",
3
3
  "description": "Artisn commerce analytics web library",
4
- "version": "0.2.0-canary.11",
4
+ "version": "0.2.0-canary.13",
5
5
  "main": "./build/main.bundle.js",
6
6
  "types": "./build/src/index.d.ts",
7
7
  "files": [
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "devDependencies": {
37
37
  "@artisan-commerce/products": "0.9.0-canary.11",
38
- "@artisan-commerce/shopping-cart": "0.12.0-canary.11",
38
+ "@artisan-commerce/shopping-cart": "0.12.0-canary.13",
39
39
  "@artisan-commerce/types": "0.14.0-canary.8",
40
40
  "@babel/core": "^7.10.5",
41
41
  "@babel/preset-env": "^7.10.4",
@@ -83,5 +83,5 @@
83
83
  "@artisan-commerce/products": "*",
84
84
  "@artisan-commerce/shopping-cart": "*"
85
85
  },
86
- "gitHead": "c03104ee022b256bf78a742def88ca58bfba2acd"
86
+ "gitHead": "192a4e6cf0af857ed26ab4ba0ce8b59fea81f708"
87
87
  }