analytica.click 0.0.433 → 0.0.434
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/dist/helpers/errorTrack.js +1 -0
- package/dist/index.d.ts +146 -2
- package/package.json +1 -1
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";var h=Object.defineProperty;var ie=Object.getOwnPropertyDescriptor;var ae=Object.getOwnPropertyNames;var se=Object.prototype.hasOwnProperty;var ue=(e,r)=>{for(var t in r)h(e,t,{get:r[t],enumerable:!0})},ce=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of ae(r))!se.call(e,n)&&n!==t&&h(e,n,{get:()=>r[n],enumerable:!(o=ie(r,n))||o.enumerable});return e};var pe=e=>ce(h({},"__esModule",{value:!0}),e);var Ve={};ue(Ve,{errorTrack:()=>Ge});module.exports=pe(Ve);var y=require("ag-common/dist/common/helpers/log"),R=require("ag-common/dist/ui/helpers/callOpenApi");var le="https://api.analytica.click".replace(/\/+$/,""),de=e=>typeof Blob<"u"&&e instanceof Blob,f=class{constructor(r=new S){this.configuration=r;this.fetchApi=async(r,t)=>{let o={url:r,init:t};for(let a of this.middleware)a.pre&&(o=await a.pre({fetch:this.fetchApi,...o})||o);let n=await(this.configuration.fetchApi||fetch)(o.url,o.init);for(let a of this.middleware)a.post&&(n=await a.post({fetch:this.fetchApi,url:o.url,init:o.init,response:n.clone()})||n);return n};this.middleware=r.middleware||[]}withMiddleware(...r){let t=this.clone();return t.middleware=t.middleware.concat(...r),t}withPreMiddleware(...r){let t=r.map(o=>({pre:o}));return this.withMiddleware(...t)}withPostMiddleware(...r){let t=r.map(o=>({post:o}));return this.withMiddleware(...t)}async request(r,t){let{url:o,init:n}=this.createFetchParams(r,t),a=await this.fetchApi(o,n);if(a.status>=200&&a.status<300)return a;throw a}createFetchParams(r,t){let o=this.configuration.basePath+r.path;r.query!==void 0&&Object.keys(r.query).length!==0&&(o+="?"+(this.configuration.queryParamsStringify||x)(r.query));let n=typeof FormData<"u"&&r.body instanceof FormData||r.body instanceof URLSearchParams||de(r.body)?r.body:JSON.stringify(r.body),a=Object.assign({},this.configuration.headers,r.headers),u={method:r.method,headers:a,body:n,credentials:this.configuration.credentials,...t};return{url:o,init:u}}clone(){let r=this.constructor,t=new r(this.configuration);return t.middleware=this.middleware.slice(),t}},s=class extends Error{constructor(t,o){super(o);this.field=t;this.name="RequiredError"}};var S=class{constructor(r={}){this.configuration=r}get basePath(){return this.configuration.basePath!=null?this.configuration.basePath:le}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||x}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let r=this.configuration.apiKey;if(r)return typeof r=="function"?r:()=>r}get accessToken(){let r=this.configuration.accessToken;if(r)return typeof r=="function"?r:async()=>r}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}};function i(e,r){let t=e[r];return t!=null}function x(e,r=""){return Object.keys(e).map(t=>{let o=r+(r.length?`[${t}]`:t),n=e[t];if(n instanceof Array){let a=n.map(u=>encodeURIComponent(String(u))).join(`&${encodeURIComponent(o)}=`);return`${encodeURIComponent(o)}=${a}`}return n instanceof Date?`${encodeURIComponent(o)}=${encodeURIComponent(n.toISOString())}`:n instanceof Object?x(n,o):`${encodeURIComponent(o)}=${encodeURIComponent(String(n))}`}).filter(t=>t.length>0).join("&")}var l=class{constructor(r,t=o=>o){this.raw=r;this.transformer=t}async value(){return this.transformer(await this.raw.json())}},c=class{constructor(r){this.raw=r}async value(){}};function J(e){if(e!==void 0)return e===null?null:{PKsB64:e.PKsB64}}function E(e){if(e!==void 0)return e===null?null:{key:e.key,account:e.account}}function b(e){return me(e,!1)}function me(e,r){return e==null?e:{account:i(e,"account")?e.account:void 0,datetime:e.datetime,site:e.site,browser:e.browser,count:e.count,category:e.category}}function D(e){if(e!==void 0)return e===null?null:{site:e.site}}function F(e){return ge(e,!1)}function ge(e,r){return e==null?e:{account:i(e,"account")?e.account:void 0,site:e.site,eventName:e.eventName,datetime:e.datetime,count:e.count,category:e.category}}function m(e){return ye(e,!1)}function ye(e,r){return e==null?e:{site:e.site,account:e.account,apiKey:e.apiKey,adminApiKey:e.adminApiKey,favicon:i(e,"favicon")?e.favicon:void 0}}function q(e){return Re(e,!1)}function Re(e,r){return e==null?e:{accounts:e.accounts.map(m),googleEmail:i(e,"googleEmail")?e.googleEmail:void 0,googleKey:i(e,"googleKey")?e.googleKey:void 0,bingKey:i(e,"bingKey")?e.bingKey:void 0,bingAccount:i(e,"bingAccount")?e.bingAccount:void 0}}function k(e){if(e!==void 0)return e===null?null:{email:e.email,key:e.key,account:e.account}}function I(e){return he(e,!1)}function he(e,r){return e==null?e:{account:i(e,"account")?e.account:void 0,datetime:e.datetime,site:e.site,language:e.language,count:e.count,category:e.category}}function L(e){return Se(e,!1)}function Se(e,r){return e==null?e:{account:i(e,"account")?e.account:void 0,datetime:e.datetime,site:e.site,countryRegion:e.countryRegion,category:e.category,count:e.count}}function K(e){return xe(e,!1)}function xe(e,r){return e==null?e:{PK:e.PK,messageHash:i(e,"messageHash")?e.messageHash:void 0,site:e.site,account:e.account,message:i(e,"message")?e.message:void 0,name:i(e,"name")?e.name:void 0,stack:i(e,"stack")?e.stack:void 0,href:e.href,filename:i(e,"filename")?e.filename:void 0,datetime:e.datetime,archived:i(e,"archived")?e.archived:void 0,count:e.count,category:e.category}}function B(e){if(e!==void 0)return e===null?null:{site:e.site}}function G(e){if(e!==void 0)return e===null?null:{key:e.key,data:V(e.data)}}function V(e){if(e!==void 0)return e===null?null:{message:e.message,name:e.name,stack:e.stack,href:e.href,filename:e.filename}}function H(e){if(e!==void 0)return e===null?null:{key:e.key,data:Q(e.data)}}function Q(e){if(e!==void 0)return e===null?null:{eventName:e.eventName,pageLocation:e.pageLocation,pageReferrer:e.pageReferrer,pageTitle:e.pageTitle,browserResolution:e.browserResolution,browserLanguage:e.browserLanguage}}function C(e){return we(e,!1)}function we(e,r){return e==null?e:{account:i(e,"account")?e.account:void 0,datetime:e.datetime,site:e.site,pathName:e.pathName,search:i(e,"search")?e.search:void 0,hash:i(e,"hash")?e.hash:void 0,count:e.count,category:e.category}}function M(e){return Ae(e,!1)}function Ae(e,r){return e==null?e:{account:i(e,"account")?e.account:void 0,datetime:e.datetime,site:e.site,referrer:e.referrer,count:e.count,category:e.category}}function z(e){return Oe(e,!1)}function Oe(e,r){return e==null?e:{account:i(e,"account")?e.account:void 0,datetime:e.datetime,site:e.site,resolution:e.resolution,count:e.count,category:e.category}}function $(e){return Ne(e,!1)}function Ne(e,r){return e==null?e:{account:e.account,site:e.site,datetime:e.datetime,category:e.category,topReferrers:i(e,"topReferrers")?e.topReferrers.map(v):void 0,topResolutions:i(e,"topResolutions")?e.topResolutions.map(j):void 0,topQueries:i(e,"topQueries")?e.topQueries.map(Z):void 0,topLocations:i(e,"topLocations")?e.topLocations.map(Y):void 0,topBrowsers:i(e,"topBrowsers")?e.topBrowsers.map(U):void 0,topEvents:i(e,"topEvents")?e.topEvents.map(W):void 0,topLanguages:i(e,"topLanguages")?e.topLanguages.map(X):void 0,topErrors:i(e,"topErrors")?e.topErrors.map(_):void 0}}function U(e){return Pe(e,!1)}function Pe(e,r){return e==null?e:{browser:e.browser,count:e.count}}function _(e){return Je(e,!1)}function Je(e,r){return e==null?e:{href:e.href,count:e.count}}function W(e){return Ee(e,!1)}function Ee(e,r){return e==null?e:{eventName:e.eventName,count:e.count}}function X(e){return be(e,!1)}function be(e,r){return e==null?e:{language:e.language,count:e.count}}function Y(e){return De(e,!1)}function De(e,r){return e==null?e:{countryRegion:e.countryRegion,count:e.count}}function Z(e){return Fe(e,!1)}function Fe(e,r){return e==null?e:{pathName:e.pathName,count:e.count}}function v(e){return qe(e,!1)}function qe(e,r){return e==null?e:{referrer:e.referrer,count:e.count}}function j(e){return ke(e,!1)}function ke(e,r){return e==null?e:{resolution:e.resolution,count:e.count}}function A(e){return Ie(e,!1)}function Ie(e,r){return e==null?e:{account:e.account,email:e.email,site:e.site,datetime:e.datetime,category:e.category,totals:w(e.totals),queries:e.queries.map(w)}}function w(e){return Le(e,!1)}function Le(e,r){return e==null?e:{clicks:e.clicks,impressions:e.impressions,position:e.position,query:e.query}}function O(e){return Ke(e,!1)}function Ke(e,r){return e==null?e:{details:i(e,"details")?m(e.details):void 0,browsers:i(e,"browsers")?e.browsers.map(b):void 0,events:i(e,"events")?e.events.map(F):void 0,locations:i(e,"locations")?e.locations.map(L):void 0,queries:i(e,"queries")?e.queries.map(C):void 0,referrers:i(e,"referrers")?e.referrers.map(M):void 0,resolutions:i(e,"resolutions")?e.resolutions.map(z):void 0,languages:i(e,"languages")?e.languages.map(I):void 0,rollups:i(e,"rollups")?e.rollups.map($):void 0,errors:i(e,"errors")?e.errors.map(K):void 0,google:i(e,"google")?e.google.map(A):void 0,bing:i(e,"bing")?e.bing.map(A):void 0}}var g=class extends f{async accountGetRaw(r){let t={},o={};this.configuration&&this.configuration.apiKey&&(o.authorization=this.configuration.apiKey("authorization"));let n=await this.request({path:"/account",method:"GET",headers:o,query:t},r);return new l(n,a=>q(a))}async accountGet(r){return await(await this.accountGetRaw(r)).value()}async archiveErrorRaw(r,t){if(r.id===null||r.id===void 0)throw new s("id","Required parameter requestParameters.id was null or undefined when calling archiveError.");let o={},n={};this.configuration&&this.configuration.apiKey&&(n.authorization=this.configuration.apiKey("authorization"));let a=await this.request({path:"/errors/{id}".replace("{id}",encodeURIComponent(String(r.id))),method:"DELETE",headers:n,query:o},t);return new c(a)}async archiveError(r,t){await this.archiveErrorRaw(r,t)}async archiveErrorsRaw(r,t){if(r.archiveErrors===null||r.archiveErrors===void 0)throw new s("archiveErrors","Required parameter requestParameters.archiveErrors was null or undefined when calling archiveErrors.");let o={},n={};n["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(n.authorization=this.configuration.apiKey("authorization"));let a=await this.request({path:"/errors",method:"DELETE",headers:n,query:o,body:J(r.archiveErrors)},t);return new c(a)}async archiveErrors(r,t){await this.archiveErrorsRaw(r,t)}async bingIntegrationPostRaw(r,t){if(r.bingIntegration===null||r.bingIntegration===void 0)throw new s("bingIntegration","Required parameter requestParameters.bingIntegration was null or undefined when calling bingIntegrationPost.");let o={},n={};n["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(n.authorization=this.configuration.apiKey("authorization"));let a=await this.request({path:"/account/integrations/bing",method:"POST",headers:n,query:o,body:E(r.bingIntegration)},t);return new c(a)}async bingIntegrationPost(r,t){await this.bingIntegrationPostRaw(r,t)}async getTrackingAllSitesRaw(r,t){if(r.minDate===null||r.minDate===void 0)throw new s("minDate","Required parameter requestParameters.minDate was null or undefined when calling getTrackingAllSites.");if(r.maxDate===null||r.maxDate===void 0)throw new s("maxDate","Required parameter requestParameters.maxDate was null or undefined when calling getTrackingAllSites.");let o={};r.minDate!==void 0&&(o.minDate=r.minDate),r.maxDate!==void 0&&(o.maxDate=r.maxDate);let n={};this.configuration&&this.configuration.apiKey&&(n.authorization=this.configuration.apiKey("authorization"));let a=await this.request({path:"/site/tracking",method:"GET",headers:n,query:o},t);return new l(a,u=>u.map(O))}async getTrackingAllSites(r,t){return await(await this.getTrackingAllSitesRaw(r,t)).value()}async getTrackingSiteRaw(r,t){if(r.id===null||r.id===void 0)throw new s("id","Required parameter requestParameters.id was null or undefined when calling getTrackingSite.");if(r.minDate===null||r.minDate===void 0)throw new s("minDate","Required parameter requestParameters.minDate was null or undefined when calling getTrackingSite.");if(r.maxDate===null||r.maxDate===void 0)throw new s("maxDate","Required parameter requestParameters.maxDate was null or undefined when calling getTrackingSite.");let o={};r.minDate!==void 0&&(o.minDate=r.minDate),r.maxDate!==void 0&&(o.maxDate=r.maxDate);let n={};this.configuration&&this.configuration.apiKey&&(n.authorization=this.configuration.apiKey("authorization"));let a=await this.request({path:"/site/tracking/{id}".replace("{id}",encodeURIComponent(String(r.id))),method:"GET",headers:n,query:o},t);return new l(a,u=>O(u))}async getTrackingSite(r,t){return await(await this.getTrackingSiteRaw(r,t)).value()}async googleIntegrationPostRaw(r,t){if(r.googleIntegration===null||r.googleIntegration===void 0)throw new s("googleIntegration","Required parameter requestParameters.googleIntegration was null or undefined when calling googleIntegrationPost.");let o={},n={};n["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(n.authorization=this.configuration.apiKey("authorization"));let a=await this.request({path:"/account/integrations/google",method:"POST",headers:n,query:o,body:k(r.googleIntegration)},t);return new c(a)}async googleIntegrationPost(r,t){await this.googleIntegrationPostRaw(r,t)}async postErrorsRaw(r,t){if(r.postError===null||r.postError===void 0)throw new s("postError","Required parameter requestParameters.postError was null or undefined when calling postErrors.");let o={},n={};n["Content-Type"]="application/json";let a=await this.request({path:"/errors",method:"POST",headers:n,query:o,body:r.postError.map(G)},t);return new c(a)}async postErrors(r,t){await this.postErrorsRaw(r,t)}async postPageTrackRaw(r,t){if(r.postSiteTrack===null||r.postSiteTrack===void 0)throw new s("postSiteTrack","Required parameter requestParameters.postSiteTrack was null or undefined when calling postPageTrack.");let o={},n={};n["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(n.authorization=this.configuration.apiKey("authorization"));let a=await this.request({path:"/site",method:"POST",headers:n,query:o,body:H(r.postSiteTrack)},t);return new c(a)}async postPageTrack(r,t){await this.postPageTrackRaw(r,t)}async siteDeleteRaw(r,t){if(r.deleteAccount===null||r.deleteAccount===void 0)throw new s("deleteAccount","Required parameter requestParameters.deleteAccount was null or undefined when calling siteDelete.");let o={},n={};n["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(n.authorization=this.configuration.apiKey("authorization"));let a=await this.request({path:"/account/site",method:"DELETE",headers:n,query:o,body:D(r.deleteAccount)},t);return new c(a)}async siteDelete(r,t){await this.siteDeleteRaw(r,t)}async sitePostRaw(r,t){if(r.postAccount===null||r.postAccount===void 0)throw new s("postAccount","Required parameter requestParameters.postAccount was null or undefined when calling sitePost.");let o={},n={};n["Content-Type"]="application/json",this.configuration&&this.configuration.apiKey&&(n.authorization=this.configuration.apiKey("authorization"));let a=await this.request({path:"/account/site",method:"POST",headers:n,query:o,body:B(r.postAccount)},t);return new c(a)}async sitePost(r,t){await this.sitePostRaw(r,t)}};var N=require("ag-common/dist/common/helpers/hashCode"),d=require("ag-common/dist/common/helpers/log");function ee(e){return e?e.match(/^"?[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}"?$/)?((0,d.info)("ignoring react devtools message"),!1):e===JSON.stringify([{}])?((0,d.info)("empty message payload?"),!1):!0:((0,d.info)("no message?"),!1)}var re=(e="")=>{let r="";try{let t=JSON.parse(e);Array.isArray(t)&&t[0]?.match(/^\[?[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}\]?$/)?((0,d.info)("removing date from hash"),t[0]="(date)",r=(0,N.hashCode)(JSON.stringify(t))):r=t.message??t.name??t.description??void 0}catch{}return r||(r=(0,N.hashCode)(e)?.toString()??""),r};var te=(e,r)=>{let t=[],o={},n=0;return Object.entries(e).forEach(([a,u])=>{n<r?t.push(u):o[a]=u,n+=1}),{part:t,rest:o}};function ne(e){return(0,R.callOpenApi)({...e,func:r=>(0,R.apiResponseToAxiosResponse)(()=>e.func(r)),newDefaultApi:r=>new g(r),logout:()=>window.location.reload(),refreshToken:async()=>{}})}var Be=typeof window<"u"&&window?.location?.hostname==="localhost",p={},T,P,oe=async()=>{try{if(Object.keys(p).length>100){let o=Object.keys(p)[0],n=p[o],a=await ne({headers:{authorization:""},apiUrl:P,func:u=>u.postErrorsRaw({postError:[{key:n.key,data:{...n.data,message:`error overload!: ${n.data.message??"?"}`}}]})});if(p={},a.error)throw a.error;return{}}let{part:e,rest:r}=te(p,10);p=r;let t=await ne({headers:{authorization:""},apiUrl:P,func:o=>o.postErrorsRaw({postError:e})});if(t.error)throw t.error}catch(e){let r=e,t=r;return{error:r?.error?.message??t.message}}finally{p.length?T=setTimeout(oe,1e3):T=void 0}},Ge=async({data:e,overrideBaseUrl:r="https://api.analytica.click",ignoreBrowserErrors:t})=>{if(t&&t.length>0){let n=t.find(a=>e.data.message.includes(a));if(n){(0,y.debug)("ignoring error, contains=",n);return}}if(Be)return(0,y.debug)(`local error tracking ignored:${e.data.message} ${JSON.stringify(e)}, to ${r}`),{};if(!ee(e?.data?.message))return{};(0,y.debug)("error track",e.data.message,JSON.stringify(e));let o=re(e.data.message);return p[o]=e,P=r,T||(T=setTimeout(oe,500)),{}};0&&(module.exports={errorTrack});
|
package/dist/index.d.ts
CHANGED
@@ -1,6 +1,150 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
declare module 'analytica.click/components/AnalyticaClickProvider/index' {
|
2
|
+
import type { IAnalyticaConfig } from 'common-ui/src/types/widgets';
|
3
|
+
import React from 'react';
|
4
|
+
export const AnalyticaConfigContext: React.Context<IAnalyticaConfig>;
|
5
|
+
export const AnalyticaClickProvider: ({ children, values, }: {
|
6
|
+
children: React.ReactNode;
|
7
|
+
values: IAnalyticaConfig;
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
3
9
|
|
10
|
+
}
|
11
|
+
declare module 'analytica.click/components/ErrorBoundary/Comp' {
|
12
|
+
import type { TErrorMessage } from 'common-ui/src/types/widgets';
|
13
|
+
import React, { Component } from 'react';
|
14
|
+
export interface IErrorBoundaryProps {
|
15
|
+
notify?: TErrorMessage;
|
16
|
+
children?: React.ReactNode;
|
17
|
+
}
|
18
|
+
export class ErrorBoundary extends Component<IErrorBoundaryProps, {
|
19
|
+
hasError: ErrorEvent | undefined;
|
20
|
+
}> {
|
21
|
+
seenError: boolean;
|
22
|
+
constructor(props: any);
|
23
|
+
static getDerivedStateFromError(errorV: any): {
|
24
|
+
hasError: any;
|
25
|
+
};
|
26
|
+
render(): string | number | boolean | Iterable<React.ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
27
|
+
}
|
28
|
+
|
29
|
+
}
|
30
|
+
declare module 'analytica.click/components/ErrorBoundary/index' {
|
31
|
+
import React from 'react';
|
32
|
+
export const ErrorBoundary: ({ children, }: {
|
33
|
+
children?: React.ReactNode;
|
34
|
+
}) => JSX.Element;
|
35
|
+
|
36
|
+
}
|
37
|
+
declare module 'analytica.click/components/index' {
|
38
|
+
export * from 'analytica.click/components/AnalyticaClickProvider/index';
|
39
|
+
|
40
|
+
}
|
41
|
+
declare module 'analytica.click/helpers/browser' {
|
42
|
+
import type { IAnalyticaConfig } from 'common-ui/src/types';
|
43
|
+
export function onBrowserError({ ev: { error: { message, stack }, filename, }, values, }: {
|
44
|
+
ev: ErrorEvent;
|
45
|
+
values: IAnalyticaConfig;
|
46
|
+
}): Promise<void>;
|
47
|
+
export function OverloadBrowser(values: IAnalyticaConfig): void;
|
48
|
+
|
49
|
+
}
|
50
|
+
declare module 'analytica.click/helpers/console' {
|
51
|
+
import type { IAnalyticaConfig } from 'common-ui/src/types';
|
52
|
+
export function OverloadConsole(values: IAnalyticaConfig): void;
|
53
|
+
|
54
|
+
}
|
55
|
+
declare module 'analytica.click/helpers/errorTrack' {
|
56
|
+
import type { PostError } from 'common-ui/src/types/api';
|
57
|
+
export const errorTrack: ({ data, overrideBaseUrl, ignoreBrowserErrors, }: {
|
58
|
+
data: PostError;
|
59
|
+
overrideBaseUrl?: string | undefined;
|
60
|
+
/** will ignore any errors that contain these strings */
|
61
|
+
ignoreBrowserErrors?: string[] | undefined;
|
62
|
+
}) => Promise<{} | undefined>;
|
63
|
+
|
64
|
+
}
|
65
|
+
declare module 'analytica.click/helpers/index' {
|
66
|
+
export * from 'analytica.click/helpers/errorTrack';
|
67
|
+
export * from 'analytica.click/helpers/log';
|
68
|
+
export * from 'analytica.click/helpers/track';
|
69
|
+
export * from 'analytica.click/helpers/trackServer';
|
70
|
+
|
71
|
+
}
|
72
|
+
declare module 'analytica.click/helpers/log' {
|
73
|
+
export const tokenMissing: (comp: string) => string;
|
74
|
+
|
75
|
+
}
|
76
|
+
declare module 'analytica.click/helpers/object' {
|
77
|
+
export const takeObject: <T>(ob: Record<string, T>, num: number) => {
|
78
|
+
part: T[];
|
79
|
+
rest: Record<string, T>;
|
80
|
+
};
|
81
|
+
|
82
|
+
}
|
83
|
+
declare module 'analytica.click/helpers/track' {
|
84
|
+
import type { ITrack } from 'common-ui/src/types/widgets';
|
85
|
+
import { page, track } from 'analytica.click/helpers/trackServer';
|
86
|
+
export const useTrack: () => {
|
87
|
+
page: (d: Omit<ITrack, 'eventName' | 'analyticaToken' | 'overrideBaseUrl'>) => void;
|
88
|
+
track: (d: Omit<ITrack, 'analyticaToken' | 'overrideBaseUrl'>) => void;
|
89
|
+
};
|
90
|
+
|
91
|
+
}
|
92
|
+
declare module 'analytica.click/helpers/trackServer' {
|
93
|
+
import type { TTrack, TTrackNoEvent } from 'common-ui/src/types/widgets';
|
94
|
+
export const track: TTrack;
|
95
|
+
export const page: TTrackNoEvent;
|
96
|
+
|
97
|
+
}
|
98
|
+
declare module 'analytica.click/index' {
|
99
|
+
export * from 'analytica.click/components/index';
|
100
|
+
export * from 'analytica.click/helpers/index';
|
101
|
+
|
102
|
+
}
|
103
|
+
declare module 'analytica.click/common-ui/src/types/api' {
|
104
|
+
export interface PostError {
|
105
|
+
key: string;
|
106
|
+
data: PostErrorData;
|
107
|
+
}
|
108
|
+
export interface PostErrorData {
|
109
|
+
message: string;
|
110
|
+
name?: string;
|
111
|
+
stack?: string;
|
112
|
+
href: string;
|
113
|
+
filename?: string;
|
114
|
+
}
|
115
|
+
|
116
|
+
}
|
117
|
+
declare module 'analytica.click/common-ui/src/types/index' {
|
118
|
+
export * from 'analytica.click/common-ui/src/types/api';
|
119
|
+
export * from 'analytica.click/common-ui/src/types/widgets';
|
120
|
+
|
121
|
+
}
|
122
|
+
declare module 'analytica.click/common-ui/src/types/widgets' {
|
123
|
+
export type TTrackNoEvent = (p: Omit<ITrack, 'eventName'>) => Promise<{
|
124
|
+
error?: string;
|
125
|
+
}>;
|
126
|
+
export type TTrack = (p: ITrack) => Promise<{
|
127
|
+
error?: string;
|
128
|
+
}>;
|
129
|
+
export interface ITrack {
|
130
|
+
analyticaToken: string;
|
131
|
+
overrideBaseUrl?: string;
|
132
|
+
eventName: string;
|
133
|
+
}
|
134
|
+
export type TErrorMessage = (m: ErrorEvent) => Promise<void>;
|
135
|
+
export interface IAnalyticaConfig {
|
136
|
+
analyticaToken?: string;
|
137
|
+
overrideBaseUrl?: string;
|
138
|
+
devMode?: boolean;
|
139
|
+
/** ignore any browser errors that include these words */
|
140
|
+
ignoreBrowserErrors?: string[];
|
141
|
+
}
|
142
|
+
|
143
|
+
}
|
144
|
+
declare module 'analytica.click' {
|
145
|
+
import main = require('analytica.click/types');
|
146
|
+
export = main;
|
147
|
+
}
|
4
148
|
declare module 'analytica.click/types' {
|
5
149
|
export * from 'analytica.click/common-ui/src/types/index';
|
6
150
|
export * from 'analytica.click/common/src/types/index';
|