@artisan-commerce/analytics-web 0.1.0-canary.10 → 0.1.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.
@@ -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";
@@ -4,7 +4,7 @@ import { AnalyticsProviderTypes } from "../../types/event.types";
4
4
  export interface InitAnalyticsConfig {
5
5
  providers: AnalyticsProviderTypes[];
6
6
  activeVendor?: Vendor["id"];
7
- vendors: Vendor["id"][];
7
+ vendors: Vendor["id"][] | undefined;
8
8
  debug?: boolean;
9
9
  shareArtisanAnalytics?: boolean;
10
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[];
29
+ get vendors(): number[] | undefined;
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 {Function} getVendors Return the provider selected vendors
26
+ * @property {number[]} vendors The provider selected vendors ids
27
27
  */
28
28
  export interface IAnaliticsProvider {
29
29
  init: () => void;
30
30
  updateConfig: (config: Partial<unknown>) => void;
31
- vendors: Vendor["id"][];
31
+ vendors: Vendor["id"][] | undefined;
32
32
  }
@@ -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[];
44
+ get vendors(): number[] | undefined;
45
45
  setVendors(vendors: Config["vendors"]): void;
46
46
  /**
47
47
  * @override
@@ -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"]) => 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.10",
4
+ "version": "0.1.0-canary.11",
5
5
  "main": "./build/main.bundle.js",
6
6
  "types": "./build/src/index.d.ts",
7
7
  "files": [
@@ -30,12 +30,12 @@
30
30
  "author": "Luis Eduardo Andrade",
31
31
  "license": "MIT",
32
32
  "dependencies": {
33
- "@artisan-commerce/state": "0.2.2-canary.3",
33
+ "@artisan-commerce/state": "0.2.2-canary.4",
34
34
  "snake-case": "^3.0.4"
35
35
  },
36
36
  "devDependencies": {
37
- "@artisan-commerce/products": "0.8.2-canary.11",
38
- "@artisan-commerce/shopping-cart": "0.11.0-canary.11",
37
+ "@artisan-commerce/products": "0.8.2-canary.12",
38
+ "@artisan-commerce/shopping-cart": "0.11.0-canary.12",
39
39
  "@artisan-commerce/types": "0.13.0-canary.7",
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": "f2ed3cab4228e2deb025c24104872d55283c4ef6"
86
+ "gitHead": "5e25b79fe0ee1023e87be7d5e9c83d4144f1867f"
87
87
  }