@vgs/collect-js
Advanced tools
Comparing version 0.3.0 to 0.4.0
@@ -0,1 +1,2 @@ | ||
import { IConfig } from '../utils/IConfig'; | ||
declare const MAIN_SCRIPT_DOMAIN = "https://js.verygoodvault.com"; | ||
@@ -2,0 +3,0 @@ declare const BACKUP_SCRIPT_DOMAIN = "https://js.verygoodvault.com"; |
@@ -0,2 +1,3 @@ | ||
import { IConfig } from './utils/IConfig'; | ||
declare const loadVGSCollect: (config?: IConfig) => Promise<unknown>; | ||
export { loadVGSCollect }; |
@@ -0,3 +1,4 @@ | ||
import { IConfig } from './IConfig'; | ||
declare const setConfig: (params: IConfig) => void; | ||
declare const getConfig: () => IConfig; | ||
export { setConfig, getConfig }; |
@@ -0,3 +1,4 @@ | ||
import { IConfig } from './IConfig'; | ||
declare const registerScriptLoading: (params: IConfig) => void; | ||
declare const trackEvent: (event: any) => void; | ||
export { trackEvent, registerScriptLoading }; |
{ | ||
"name": "@vgs/collect-js", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "VGS Collect.js script loading module", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
import { v4 as uuidv4 } from 'uuid'; | ||
import { IConfig } from '../utils/IConfig'; | ||
@@ -3,0 +4,0 @@ const MAIN_SCRIPT_DOMAIN = `https://js.verygoodvault.com`; |
@@ -10,2 +10,3 @@ import { loadScript } from './utils/loadScript'; | ||
import { preConnect } from './sideEffects/preConnect'; | ||
import { IConfig } from './utils/IConfig'; | ||
@@ -12,0 +13,0 @@ // side effects |
import { DEFAULT_CONFIG } from '../constants/index'; | ||
import { IConfig } from './IConfig'; | ||
@@ -3,0 +4,0 @@ let config = DEFAULT_CONFIG; |
@@ -0,1 +1,5 @@ | ||
interface IStateCallback { | ||
(state?: object): void; | ||
} | ||
const initCollect = (vaultId: string, environment: string): void => { | ||
@@ -2,0 +6,0 @@ window.VGSCollect.init = (callback: IStateCallback = () => {}) => { |
@@ -8,2 +8,3 @@ import axios from 'axios'; | ||
import { setConfig, getConfig } from './config'; | ||
import { IConfig } from './IConfig'; | ||
import { validateConfig } from './validation'; | ||
@@ -10,0 +11,0 @@ |
import { ERROR_MESSAGE } from '../constants'; | ||
type IConfigSchema = Record<string, (value: string) => boolean>; | ||
const configSchema: IConfigSchema = { | ||
@@ -4,0 +6,0 @@ vaultId: value => typeof value === 'string' && /^tnt.{8}$/.test(value), |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
86671
31
899