analytica.click 0.0.517 → 0.0.519

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.
@@ -1,5 +1,5 @@
1
1
  import 'cross-fetch/polyfill';
2
- import type { PostError } from 'analytica.click';
2
+ import type { PostError, PostErrorData } from '@ui/src/server/schema';
3
3
  export declare const errorTrack: ({ data, overrideBaseUrl, ignoreBrowserErrors, devMode, }: {
4
4
  data: PostError;
5
5
  overrideBaseUrl?: string;
@@ -7,3 +7,4 @@ export declare const errorTrack: ({ data, overrideBaseUrl, ignoreBrowserErrors,
7
7
  ignoreBrowserErrors?: string[];
8
8
  devMode?: boolean;
9
9
  }) => Promise<{} | undefined>;
10
+ export declare const getErrorKey: (p: PostErrorData) => string;
@@ -1 +1 @@
1
- "use strict";var d=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var J=(e,r)=>{for(var o in r)d(e,o,{get:r[o],enumerable:!0})},N=(e,r,o,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of j(r))!x.call(e,s)&&s!==o&&d(e,s,{get:()=>r[s],enumerable:!(n=P(r,s))||n.enumerable});return e};var R=e=>N(d({},"__esModule",{value:!0}),e);var C={};J(C,{errorTrack:()=>H});module.exports=R(C);var I=require("cross-fetch/polyfill"),f=require("ag-common/dist/common/helpers/log"),S=require("ag-common/dist/common/helpers/string/contains");var p=require("ag-common/dist/common/helpers/hashCode"),g=require("ag-common/dist/common/helpers/log"),k=require("ag-common/dist/common/helpers/object");function T(e){return e?e.match(/^"?[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}"?$/)?((0,g.info)("ignoring react devtools message"),!1):e===JSON.stringify([{}])?((0,g.info)("empty message payload?"),!1):!0:((0,g.info)("no message?"),!1)}var b=e=>{try{let r=/^\[?[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}\]?$/gim,o=/(at \S+?) \(\S+\)\s/gim,n=/^((%[cs])+\s*)+$/gim,s=/^color:/gim,t=[],a=e.message;(0,k.isJson)(a)?t=JSON.parse(a):t=[a];let l=t.findIndex(i=>i.match(n)),m=t.findIndex(i=>i.match(s));l>=0&&m>=0&&m===l+1&&(t=t.filter((i,$)=>![l,m].includes($))),t=t.map(i=>i.includes(".js:")||i.includes("node_modules")?i.replace(o,"$1 (stacktrace)"):i.replace(r,"[date]")),a=JSON.stringify(t);let h=(0,p.hashCode)(a).toString();return(0,g.debug)("got errorKey=",a,h),h}catch{return(0,p.hashCode)(e.message).toString()}};var w=(e,r)=>{let o=[],n={},s=0;return Object.entries(e).forEach(([t,a])=>{s<r?o.push(a):n[t]=a,s+=1}),{part:o,rest:n}};var O=typeof window<"u"&&window.location.hostname==="localhost",c={},u,y,E=async()=>{try{if(Object.keys(c).length>100){let n=Object.keys(c)[0],s=c[n],t=await fetch(`${y}/errors`,{method:"POST",headers:{"Content-Type":"application/json",authorization:""},body:JSON.stringify([{key:s.key,data:{...s.data,message:`error overload!: ${s.data.message||"?"}`}}])});if(c={},!t.ok)throw new Error(`HTTP error! status: ${t.status}`);return{}}let{part:e,rest:r}=w(c,10);c=r;let o=await fetch(`${y}/errors`,{method:"POST",headers:{"Content-Type":"application/json",authorization:""},body:JSON.stringify(e)});if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`)}catch(e){let r=e;return{error:r?.message??r.message}}finally{Object.keys(c).length>0?u=setTimeout(E,1e3):u=void 0}},H=async({data:e,overrideBaseUrl:r="https://analytica.click/api",ignoreBrowserErrors:o=["will be removed","performing full reload","tracking error","fetch RSC payload","perform a full reload","warnings#debug_enabled"],devMode:n})=>{if(r||(r="https://analytica.click/api"),r.startsWith("/")&&typeof window>"u"&&(r="https://analytica.click/api"),o.length>0){let t=(0,S.containsInsensitive)(e.data.message,...o);if(t){(0,f.debug)("ignoring error, contains=",t);return}}if(O&&n)(0,f.debug)("allowing local error tracking due to devmode=true");else if(O)return(0,f.debug)(`local error tracking ignored:${e.data.message} ${JSON.stringify(e)}, to ${r}`),{};if(!T(e.data.message))return{};(0,f.debug)("error track",e.data.message,JSON.stringify(e));let s=b(e.data);return c[s]=e,y=r,u??=setTimeout(E,500),{}};0&&(module.exports={errorTrack});
1
+ "use strict";var m=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var j=(e,r)=>{for(var s in r)m(e,s,{get:r[s],enumerable:!0})},J=(e,r,s,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of E(r))!P.call(e,o)&&o!==s&&m(e,o,{get:()=>r[o],enumerable:!(n=$(r,o))||n.enumerable});return e};var x=e=>J(m({},"__esModule",{value:!0}),e);var H={};j(H,{errorTrack:()=>N,getErrorKey:()=>S});module.exports=x(H);var I=require("cross-fetch/polyfill"),d=require("ag-common/dist/common/helpers/hashCode"),a=require("ag-common/dist/common/helpers/log"),T=require("ag-common/dist/common/helpers/object"),w=require("ag-common/dist/common/helpers/string/contains");var h=(e,r)=>{let s=[],n={},o=0;return Object.entries(e).forEach(([t,i])=>{o<r?s.push(i):n[t]=i,o+=1}),{part:s,rest:n}};var k=typeof window<"u"&&window.location.hostname==="localhost",g={},u,p,O=async()=>{try{if(Object.keys(g).length>100){let n=Object.keys(g)[0],o=g[n],t=await fetch(`${p}/errors`,{method:"POST",headers:{"Content-Type":"application/json",authorization:""},body:JSON.stringify([{key:o.key,data:{...o.data,message:`error overload!: ${o.data.message||"?"}`}}])});if(g={},!t.ok)throw new Error(`HTTP error! status: ${t.status}`);return{}}let{part:e,rest:r}=h(g,10);g=r;let s=await fetch(`${p}/errors`,{method:"POST",headers:{"Content-Type":"application/json",authorization:""},body:JSON.stringify(e)});if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`)}catch(e){let r=e;return{error:r?.message??r.message}}finally{Object.keys(g).length>0?u=setTimeout(O,1e3):u=void 0}},N=async({data:e,overrideBaseUrl:r="https://analytica.click/api",ignoreBrowserErrors:s=["will be removed","performing full reload","tracking error","fetch RSC payload","perform a full reload","warnings#debug_enabled"],devMode:n})=>{if(r||(r="https://analytica.click/api"),r.startsWith("/")&&typeof window>"u"&&(r="https://analytica.click/api"),s.length>0){let t=(0,w.containsInsensitive)(e.data.message,...s);if(t){(0,a.debug)("ignoring error, contains=",t);return}}if(k&&n)(0,a.debug)("allowing local error tracking due to devmode=true");else if(k)return(0,a.debug)(`local error tracking ignored:${e.data.message} ${JSON.stringify(e)}, to ${r}`),{};if(!R(e.data.message))return{};(0,a.debug)("error track",e.data.message,JSON.stringify(e));let o=S({...e.data,name:e.data.name??"unknown"});return g[o]=e,p=r,u??=setTimeout(O,500),{}};function R(e){return e?e.match(/^"?[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}"?$/)?((0,a.info)("ignoring react devtools message"),!1):e===JSON.stringify([{}])?((0,a.info)("empty message payload?"),!1):!0:((0,a.info)("no message?"),!1)}var S=e=>{try{let r=/^\[?[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}\]?$/gim,s=/(at \S+?) \(\S+\)\s/gim,n=/^((%[cs])+\s*)+$/gim,o=/^color:/gim,t=[],i=e.message;(0,T.isJson)(i)?t=JSON.parse(i):t=[i];let f=t.findIndex(c=>c.match(n)),l=t.findIndex(c=>c.match(o));f>=0&&l>=0&&l===f+1&&(t=t.filter((c,b)=>![f,l].includes(b))),t=t.map(c=>c.includes(".js:")||c.includes("node_modules")?c.replace(s,"$1 (stacktrace)"):c.replace(r,"[date]")),i=JSON.stringify(t);let y=(0,d.hashCode)(i).toString();return(0,a.debug)("got errorKey=",i,y),y}catch{return(0,d.hashCode)(e.message).toString()}};0&&(module.exports={errorTrack,getErrorKey});
@@ -1,5 +1,5 @@
1
1
  import 'cross-fetch/polyfill';
2
- import type { TEvent, TPage } from 'analytica.click';
2
+ import type { TEvent, TPage } from '../types';
3
3
  /** used for tracking arbitrary events */
4
4
  export declare const event: TEvent;
5
5
  /** used for tracking visits to a page */
@@ -1 +1 @@
1
- "use strict";var g=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var w=(t,r)=>{for(var a in r)g(t,a,{get:r[a],enumerable:!0})},u=(t,r,a,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let e of f(r))!d.call(t,e)&&e!==a&&g(t,e,{get:()=>r[e],enumerable:!(s=p(r,e))||s.enumerable});return t};var y=t=>u(g({},"__esModule",{value:!0}),t);var m={};w(m,{event:()=>h,page:()=>l});module.exports=y(m);var T=require("cross-fetch/polyfill"),n=require("ag-common/dist/common/helpers/log"),h=async({analyticaToken:t,overrideBaseUrl:r="https://analytica.click/api",eventName:a,devMode:s,valueOverrides:e})=>{let i={eventName:a,browserFingerprint:e?.browserFingerprint};if(!s&&typeof window<"u"&&window.location.hostname==="localhost")return(0,n.debug)(`local page ignored: ${JSON.stringify(i)}, to ${r}`),{};try{let o=await fetch(`${r}/site/event`,{method:"POST",headers:{"Content-Type":"application/json",authorization:""},body:JSON.stringify({key:t,data:i})});if(!o.ok){let c=await o.text();return(0,n.warn)("tracking error:"+c),{error:c}}}catch(o){let c=o instanceof Error?o.message:"Unknown error";return(0,n.warn)("tracking error:"+c),{error:c}}return{}},l=async({analyticaToken:t,overrideBaseUrl:r="https://analytica.click/api",devMode:a,valueOverrides:s})=>{let e={pageLocation:"",browserFingerprint:s?.browserFingerprint};if(typeof window<"u"&&(e={...e,pageLocation:window.location.href,browserResolution:`${window.screen.width}:${window.screen.height}`}),typeof document<"u"&&(e={...e,pageReferrer:document.referrer,pageTitle:document.title}),typeof navigator<"u"&&(e={...e,browserLanguage:navigator.language}),!a&&typeof window<"u"&&window.location.hostname==="localhost")return(0,n.debug)(`local page ignored: ${JSON.stringify(e)}, to ${r}`),{};if(!e.pageLocation)return(0,n.warn)("no pageLocation"),{};try{let i=await fetch(`${r}/site/tracking`,{method:"POST",headers:{"Content-Type":"application/json",authorization:""},body:JSON.stringify({key:t,data:e})});if(!i.ok){let o=await i.text();return(0,n.warn)("tracking error:"+o),{error:o}}}catch(i){let o=i instanceof Error?i.message:"Unknown error";return(0,n.warn)("tracking error:"+o),{error:o}}return{}};0&&(module.exports={event,page});
1
+ "use strict";var g=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var f=(t,r)=>{for(var a in r)g(t,a,{get:r[a],enumerable:!0})},u=(t,r,a,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let e of w(r))!d.call(t,e)&&e!==a&&g(t,e,{get:()=>r[e],enumerable:!(s=p(r,e))||s.enumerable});return t};var h=t=>u(g({},"__esModule",{value:!0}),t);var m={};f(m,{event:()=>y,page:()=>l});module.exports=h(m);var T=require("cross-fetch/polyfill"),i=require("ag-common/dist/common/helpers/log"),y=async({analyticaToken:t,overrideBaseUrl:r="https://analytica.click/api",eventName:a,devMode:s,valueOverrides:e})=>{let n={eventName:a,browserFingerprint:e?.browserFingerprint,pageLocation:""};if(typeof window<"u"&&(n={...n,pageLocation:window.location.href,browserResolution:`${window.screen.width}:${window.screen.height}`}),!s&&typeof window<"u"&&window.location.hostname==="localhost")return(0,i.debug)(`local page ignored: ${JSON.stringify(n)}, to ${r}`),{};try{let o=await fetch(`${r}/site/event`,{method:"POST",headers:{"Content-Type":"application/json",authorization:""},body:JSON.stringify({key:t,data:n})});if(!o.ok){let c=await o.text();return(0,i.warn)("tracking error:"+c),{error:c}}}catch(o){let c=o instanceof Error?o.message:"Unknown error";return(0,i.warn)("tracking error:"+c),{error:c}}return{}},l=async({analyticaToken:t,overrideBaseUrl:r="https://analytica.click/api",devMode:a,valueOverrides:s})=>{let e={pageLocation:"",browserFingerprint:s?.browserFingerprint};if(typeof window<"u"&&(e={...e,pageLocation:window.location.href,browserResolution:`${window.screen.width}:${window.screen.height}`}),typeof document<"u"&&(e={...e,pageReferrer:document.referrer,pageTitle:document.title}),typeof navigator<"u"&&(e={...e,browserLanguage:navigator.language}),!a&&typeof window<"u"&&window.location.hostname==="localhost")return(0,i.debug)(`local page ignored: ${JSON.stringify(e)}, to ${r}`),{};if(!e.pageLocation)return(0,i.warn)("no pageLocation"),{};try{let n=await fetch(`${r}/site/tracking`,{method:"POST",headers:{"Content-Type":"application/json",authorization:""},body:JSON.stringify({key:t,data:e})});if(!n.ok){let o=await n.text();return(0,i.warn)("tracking error:"+o),{error:o}}}catch(n){let o=n instanceof Error?n.message:"Unknown error";return(0,i.warn)("tracking error:"+o),{error:o}}return{}};0&&(module.exports={event,page});
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  declare module 'analytica.click/dist/components/AnalyticaClickProvider/index' {
2
- import type { IAnalyticaConfig } from 'analytica.click/dist/common-ui/src/types/widgets';
3
2
  import React from 'react';
3
+ import type { IAnalyticaConfig } from 'analytica.click/dist/types';
4
4
  export const AnalyticaConfigContext: React.Context<IAnalyticaConfig>;
5
5
  export const AnalyticaClickProvider: ({ children, values, }: {
6
6
  children: React.ReactNode;
@@ -9,8 +9,8 @@ declare module 'analytica.click/dist/components/AnalyticaClickProvider/index' {
9
9
 
10
10
  }
11
11
  declare module 'analytica.click/dist/components/ErrorBoundary/Comp' {
12
- import type { TErrorMessage } from 'analytica.click/dist/common-ui/src/types/widgets';
13
12
  import React, { Component } from 'react';
13
+ import type { TErrorMessage } from 'analytica.click/dist/types';
14
14
  export interface IErrorBoundaryProps {
15
15
  notify?: TErrorMessage;
16
16
  children?: React.ReactNode;
@@ -34,13 +34,24 @@ declare module 'analytica.click/dist/components/ErrorBoundary/index' {
34
34
  children?: React.ReactNode;
35
35
  }) => JSX.Element;
36
36
 
37
+ }
38
+ declare module 'analytica.click/dist/components/Modal/index' {
39
+ import React from 'react';
40
+ export interface ModalProps {
41
+ open: boolean;
42
+ setOpen: (open: boolean) => void;
43
+ children: React.ReactNode;
44
+ }
45
+ export const Modal: React.FC<ModalProps>;
46
+
37
47
  }
38
48
  declare module 'analytica.click/dist/components/index' {
39
49
  export * from 'analytica.click/dist/components/AnalyticaClickProvider/index';
50
+ export * from 'analytica.click/dist/components/Modal/index';
40
51
 
41
52
  }
42
53
  declare module 'analytica.click/dist/helpers/browser' {
43
- import type { IAnalyticaConfig } from 'analytica.click/dist/common-ui/src/types/index';
54
+ import type { IAnalyticaConfig } from 'analytica.click/dist/types';
44
55
  export function onBrowserError({ ev, values, }: {
45
56
  ev: ErrorEvent;
46
57
  values: IAnalyticaConfig;
@@ -49,13 +60,13 @@ declare module 'analytica.click/dist/helpers/browser' {
49
60
 
50
61
  }
51
62
  declare module 'analytica.click/dist/helpers/console' {
52
- import type { IAnalyticaConfig } from 'analytica.click/dist/common-ui/src/types/index';
63
+ import type { IAnalyticaConfig } from 'analytica.click/dist/types';
53
64
  export function OverloadConsole(values: IAnalyticaConfig): void;
54
65
 
55
66
  }
56
67
  declare module 'analytica.click/dist/helpers/errorTrack' {
57
68
  import 'cross-fetch/polyfill';
58
- import type { PostError } from 'analytica.click/dist/common-ui/src/types/api';
69
+ import type { PostError, PostErrorData } from '@ui/src/server/schema';
59
70
  export const errorTrack: ({ data, overrideBaseUrl, ignoreBrowserErrors, devMode, }: {
60
71
  data: PostError;
61
72
  overrideBaseUrl?: string;
@@ -63,6 +74,7 @@ declare module 'analytica.click/dist/helpers/errorTrack' {
63
74
  ignoreBrowserErrors?: string[];
64
75
  devMode?: boolean;
65
76
  }) => Promise<{} | undefined>;
77
+ export const getErrorKey: (p: PostErrorData) => string;
66
78
 
67
79
  }
68
80
  declare module 'analytica.click/dist/helpers/index' {
@@ -77,7 +89,7 @@ declare module 'analytica.click/dist/helpers/log' {
77
89
 
78
90
  }
79
91
  declare module 'analytica.click/dist/helpers/node' {
80
- import type { IAnalyticaConfig } from 'analytica.click/dist/common-ui/src/types/index';
92
+ import type { IAnalyticaConfig } from 'analytica.click/dist/types';
81
93
  export function OverloadNode(values: IAnalyticaConfig): void;
82
94
 
83
95
  }
@@ -90,7 +102,7 @@ declare module 'analytica.click/dist/helpers/object' {
90
102
  }
91
103
  declare module 'analytica.click/dist/helpers/server' {
92
104
  import 'cross-fetch/polyfill';
93
- import type { TEvent, TPage } from 'analytica.click/dist/common-ui/src/types/index';
105
+ import type { TEvent, TPage } from 'analytica.click/dist/types';
94
106
  /** used for tracking arbitrary events */
95
107
  export const event: TEvent;
96
108
  /** used for tracking visits to a page */
@@ -98,7 +110,7 @@ declare module 'analytica.click/dist/helpers/server' {
98
110
 
99
111
  }
100
112
  declare module 'analytica.click/dist/helpers/useAnalytica' {
101
- import type { IEvent, IPage } from 'analytica.click/dist/common-ui/src/types/index';
113
+ import type { IEvent, IPage } from 'analytica.click/dist/types';
102
114
  export const useAnalytica: () => {
103
115
  event: (d: Omit<IEvent, "analyticaToken" | "overrideBaseUrl">) => void;
104
116
  page: (d: Omit<IPage, "analyticaToken" | "overrideBaseUrl">) => void;
@@ -106,32 +118,12 @@ declare module 'analytica.click/dist/helpers/useAnalytica' {
106
118
 
107
119
  }
108
120
  declare module 'analytica.click/dist/index' {
109
- export * from 'analytica.click/dist/common-ui/src/types/index';
110
121
 
111
122
  export * from 'analytica.click/dist/components/index';
112
123
  export * from 'analytica.click/dist/helpers/index';
113
124
 
114
125
  }
115
- declare module 'analytica.click/dist/common-ui/src/types/api' {
116
- export interface PostError {
117
- key: string;
118
- data: PostErrorData;
119
- }
120
- export interface PostErrorData {
121
- message: string;
122
- name?: string;
123
- stack?: string;
124
- href: string;
125
- filename?: string;
126
- }
127
-
128
- }
129
- declare module 'analytica.click/dist/common-ui/src/types/index' {
130
- export type * from 'analytica.click/dist/common-ui/src/types/api';
131
- export type * from 'analytica.click/dist/common-ui/src/types/widgets';
132
-
133
- }
134
- declare module 'analytica.click/dist/common-ui/src/types/widgets' {
126
+ declare module 'analytica.click/dist/types' {
135
127
  export type TEvent = (p: IEvent) => Promise<{
136
128
  error?: string;
137
129
  }>;
@@ -172,6 +164,544 @@ declare module 'analytica.click/dist/common-ui/src/types/widgets' {
172
164
  };
173
165
  }
174
166
 
167
+ }
168
+ declare module 'analytica.click/dist/ui/src/server/schema/index' {
169
+ import { z } from 'zod';
170
+ export const createSiteSchema: z.ZodObject<{
171
+ site: z.ZodString;
172
+ }, z.core.$strip>;
173
+ export const deleteSiteSchema: z.ZodObject<{
174
+ site: z.ZodString;
175
+ }, z.core.$strip>;
176
+ export const createGoogleIntegrationSchema: z.ZodObject<{
177
+ email: z.ZodString;
178
+ key: z.ZodString;
179
+ }, z.core.$strip>;
180
+ export const createBingIntegrationSchema: z.ZodObject<{
181
+ key: z.ZodString;
182
+ }, z.core.$strip>;
183
+ export const successResponseSchema: z.ZodObject<{
184
+ success: z.ZodBoolean;
185
+ }, z.core.$strip>;
186
+ export const errorResponseSchema: z.ZodObject<{
187
+ error: z.ZodString;
188
+ }, z.core.$strip>;
189
+ export const SeoResultValuesSchema: z.ZodObject<{
190
+ clicks: z.ZodNumber;
191
+ impressions: z.ZodNumber;
192
+ position: z.ZodNumber;
193
+ query: z.ZodString;
194
+ }, z.core.$strip>;
195
+ export const SeoResultSchema: z.ZodObject<{
196
+ account: z.ZodString;
197
+ email: z.ZodString;
198
+ site: z.ZodString;
199
+ datetime: z.ZodNumber;
200
+ category: z.ZodString;
201
+ totals: z.ZodObject<{
202
+ clicks: z.ZodNumber;
203
+ impressions: z.ZodNumber;
204
+ position: z.ZodNumber;
205
+ query: z.ZodString;
206
+ }, z.core.$strip>;
207
+ queries: z.ZodArray<z.ZodObject<{
208
+ clicks: z.ZodNumber;
209
+ impressions: z.ZodNumber;
210
+ position: z.ZodNumber;
211
+ query: z.ZodString;
212
+ }, z.core.$strip>>;
213
+ }, z.core.$strip>;
214
+ export const GetAccountSchema: z.ZodObject<{
215
+ site: z.ZodString;
216
+ account: z.ZodString;
217
+ apiKey: z.ZodString;
218
+ adminApiKey: z.ZodString;
219
+ }, z.core.$strip>;
220
+ export const GetAccountsSchema: z.ZodObject<{
221
+ accounts: z.ZodArray<z.ZodObject<{
222
+ site: z.ZodString;
223
+ account: z.ZodString;
224
+ apiKey: z.ZodString;
225
+ adminApiKey: z.ZodString;
226
+ }, z.core.$strip>>;
227
+ googleEmail: z.ZodOptional<z.ZodString>;
228
+ googleKey: z.ZodOptional<z.ZodString>;
229
+ bingKey: z.ZodOptional<z.ZodString>;
230
+ bingAccount: z.ZodOptional<z.ZodString>;
231
+ }, z.core.$strip>;
232
+ export const GoogleIntegrationSchema: z.ZodObject<{
233
+ email: z.ZodString;
234
+ key: z.ZodString;
235
+ account: z.ZodString;
236
+ }, z.core.$strip>;
237
+ export const BingIntegrationSchema: z.ZodObject<{
238
+ key: z.ZodString;
239
+ account: z.ZodString;
240
+ }, z.core.$strip>;
241
+ export const ApiKeySchema: z.ZodObject<{
242
+ key: z.ZodString;
243
+ adminKey: z.ZodString;
244
+ account: z.ZodString;
245
+ site: z.ZodString;
246
+ }, z.core.$strip>;
247
+ export const QuerySchema: z.ZodObject<{
248
+ account: z.ZodOptional<z.ZodString>;
249
+ datetime: z.ZodNumber;
250
+ site: z.ZodString;
251
+ pathName: z.ZodString;
252
+ search: z.ZodOptional<z.ZodString>;
253
+ hash: z.ZodOptional<z.ZodString>;
254
+ count: z.ZodNumber;
255
+ category: z.ZodString;
256
+ }, z.core.$strip>;
257
+ export const BrowserSchema: z.ZodObject<{
258
+ account: z.ZodOptional<z.ZodString>;
259
+ datetime: z.ZodNumber;
260
+ site: z.ZodString;
261
+ browser: z.ZodString;
262
+ count: z.ZodNumber;
263
+ category: z.ZodString;
264
+ }, z.core.$strip>;
265
+ export const ResolutionSchema: z.ZodObject<{
266
+ account: z.ZodOptional<z.ZodString>;
267
+ datetime: z.ZodNumber;
268
+ site: z.ZodString;
269
+ resolution: z.ZodString;
270
+ count: z.ZodNumber;
271
+ category: z.ZodString;
272
+ }, z.core.$strip>;
273
+ export const ReferrerSchema: z.ZodObject<{
274
+ account: z.ZodOptional<z.ZodString>;
275
+ datetime: z.ZodNumber;
276
+ site: z.ZodString;
277
+ referrer: z.ZodString;
278
+ count: z.ZodNumber;
279
+ category: z.ZodString;
280
+ }, z.core.$strip>;
281
+ export const LocationSchema: z.ZodObject<{
282
+ account: z.ZodOptional<z.ZodString>;
283
+ datetime: z.ZodNumber;
284
+ site: z.ZodString;
285
+ countryRegion: z.ZodString;
286
+ category: z.ZodString;
287
+ count: z.ZodNumber;
288
+ }, z.core.$strip>;
289
+ export const LanguageSchema: z.ZodObject<{
290
+ account: z.ZodOptional<z.ZodString>;
291
+ datetime: z.ZodNumber;
292
+ site: z.ZodString;
293
+ language: z.ZodString;
294
+ count: z.ZodNumber;
295
+ category: z.ZodString;
296
+ }, z.core.$strip>;
297
+ export const FingerprintSchema: z.ZodObject<{
298
+ account: z.ZodOptional<z.ZodString>;
299
+ datetime: z.ZodNumber;
300
+ site: z.ZodString;
301
+ fingerprint: z.ZodString;
302
+ count: z.ZodNumber;
303
+ category: z.ZodString;
304
+ }, z.core.$strip>;
305
+ export const EventSchema: z.ZodObject<{
306
+ account: z.ZodOptional<z.ZodString>;
307
+ site: z.ZodString;
308
+ eventName: z.ZodString;
309
+ datetime: z.ZodNumber;
310
+ count: z.ZodNumber;
311
+ category: z.ZodString;
312
+ }, z.core.$strip>;
313
+ export const HealthSchema: z.ZodObject<{
314
+ account: z.ZodOptional<z.ZodString>;
315
+ datetime: z.ZodNumber;
316
+ site: z.ZodString;
317
+ responseTimeMs: z.ZodNumber;
318
+ success: z.ZodBoolean;
319
+ }, z.core.$strip>;
320
+ export const ModelErrorSchema: z.ZodObject<{
321
+ PK: z.ZodString;
322
+ messageHash: z.ZodOptional<z.ZodString>;
323
+ site: z.ZodString;
324
+ account: z.ZodString;
325
+ message: z.ZodOptional<z.ZodString>;
326
+ name: z.ZodOptional<z.ZodString>;
327
+ stack: z.ZodOptional<z.ZodString>;
328
+ href: z.ZodString;
329
+ filename: z.ZodOptional<z.ZodString>;
330
+ datetime: z.ZodNumber;
331
+ archived: z.ZodOptional<z.ZodBoolean>;
332
+ count: z.ZodNumber;
333
+ category: z.ZodString;
334
+ }, z.core.$strip>;
335
+ export const RollupTopReferrersSchema: z.ZodObject<{
336
+ referrer: z.ZodString;
337
+ count: z.ZodNumber;
338
+ }, z.core.$strip>;
339
+ export const RollupTopResolutionsSchema: z.ZodObject<{
340
+ resolution: z.ZodString;
341
+ count: z.ZodNumber;
342
+ }, z.core.$strip>;
343
+ export const RollupTopFingerprintsSchema: z.ZodObject<{
344
+ fingerprint: z.ZodString;
345
+ count: z.ZodNumber;
346
+ }, z.core.$strip>;
347
+ export const RollupTopQueriesSchema: z.ZodObject<{
348
+ pathName: z.ZodString;
349
+ count: z.ZodNumber;
350
+ }, z.core.$strip>;
351
+ export const RollupTopLocationsSchema: z.ZodObject<{
352
+ countryRegion: z.ZodString;
353
+ count: z.ZodNumber;
354
+ }, z.core.$strip>;
355
+ export const RollupTopBrowsersSchema: z.ZodObject<{
356
+ browser: z.ZodString;
357
+ count: z.ZodNumber;
358
+ }, z.core.$strip>;
359
+ export const RollupTopEventsSchema: z.ZodObject<{
360
+ eventName: z.ZodString;
361
+ count: z.ZodNumber;
362
+ }, z.core.$strip>;
363
+ export const RollupTopLanguagesSchema: z.ZodObject<{
364
+ language: z.ZodString;
365
+ count: z.ZodNumber;
366
+ }, z.core.$strip>;
367
+ export const RollupTopErrorsSchema: z.ZodObject<{
368
+ href: z.ZodString;
369
+ count: z.ZodNumber;
370
+ }, z.core.$strip>;
371
+ export const RollupSchema: z.ZodObject<{
372
+ account: z.ZodString;
373
+ site: z.ZodString;
374
+ datetime: z.ZodNumber;
375
+ category: z.ZodString;
376
+ topReferrers: z.ZodOptional<z.ZodArray<z.ZodObject<{
377
+ referrer: z.ZodString;
378
+ count: z.ZodNumber;
379
+ }, z.core.$strip>>>;
380
+ topResolutions: z.ZodOptional<z.ZodArray<z.ZodObject<{
381
+ resolution: z.ZodString;
382
+ count: z.ZodNumber;
383
+ }, z.core.$strip>>>;
384
+ topFingerprints: z.ZodOptional<z.ZodArray<z.ZodObject<{
385
+ fingerprint: z.ZodString;
386
+ count: z.ZodNumber;
387
+ }, z.core.$strip>>>;
388
+ topQueries: z.ZodOptional<z.ZodArray<z.ZodObject<{
389
+ pathName: z.ZodString;
390
+ count: z.ZodNumber;
391
+ }, z.core.$strip>>>;
392
+ topLocations: z.ZodOptional<z.ZodArray<z.ZodObject<{
393
+ countryRegion: z.ZodString;
394
+ count: z.ZodNumber;
395
+ }, z.core.$strip>>>;
396
+ topBrowsers: z.ZodOptional<z.ZodArray<z.ZodObject<{
397
+ browser: z.ZodString;
398
+ count: z.ZodNumber;
399
+ }, z.core.$strip>>>;
400
+ topEvents: z.ZodOptional<z.ZodArray<z.ZodObject<{
401
+ eventName: z.ZodString;
402
+ count: z.ZodNumber;
403
+ }, z.core.$strip>>>;
404
+ topLanguages: z.ZodOptional<z.ZodArray<z.ZodObject<{
405
+ language: z.ZodString;
406
+ count: z.ZodNumber;
407
+ }, z.core.$strip>>>;
408
+ topErrors: z.ZodOptional<z.ZodArray<z.ZodObject<{
409
+ href: z.ZodString;
410
+ count: z.ZodNumber;
411
+ }, z.core.$strip>>>;
412
+ averageResponseTimeMs: z.ZodOptional<z.ZodNumber>;
413
+ }, z.core.$strip>;
414
+ export const PostEventDataSchema: z.ZodObject<{
415
+ eventName: z.ZodString;
416
+ pageReferrer: z.ZodOptional<z.ZodString>;
417
+ pageTitle: z.ZodOptional<z.ZodString>;
418
+ browserResolution: z.ZodOptional<z.ZodString>;
419
+ browserLanguage: z.ZodOptional<z.ZodString>;
420
+ browserFingerprint: z.ZodOptional<z.ZodString>;
421
+ pageLocation: z.ZodString;
422
+ }, z.core.$strip>;
423
+ export const PostEventSchema: z.ZodObject<{
424
+ key: z.ZodString;
425
+ data: z.ZodObject<{
426
+ eventName: z.ZodString;
427
+ pageReferrer: z.ZodOptional<z.ZodString>;
428
+ pageTitle: z.ZodOptional<z.ZodString>;
429
+ browserResolution: z.ZodOptional<z.ZodString>;
430
+ browserLanguage: z.ZodOptional<z.ZodString>;
431
+ browserFingerprint: z.ZodOptional<z.ZodString>;
432
+ pageLocation: z.ZodString;
433
+ }, z.core.$strip>;
434
+ }, z.core.$strip>;
435
+ export const PostSiteTrackDataSchema: z.ZodObject<{
436
+ pageReferrer: z.ZodOptional<z.ZodString>;
437
+ pageTitle: z.ZodOptional<z.ZodString>;
438
+ browserResolution: z.ZodOptional<z.ZodString>;
439
+ browserLanguage: z.ZodOptional<z.ZodString>;
440
+ browserFingerprint: z.ZodOptional<z.ZodString>;
441
+ pageLocation: z.ZodString;
442
+ }, z.core.$strip>;
443
+ export const PostSiteTrackSchema: z.ZodObject<{
444
+ key: z.ZodString;
445
+ data: z.ZodObject<{
446
+ pageReferrer: z.ZodOptional<z.ZodString>;
447
+ pageTitle: z.ZodOptional<z.ZodString>;
448
+ browserResolution: z.ZodOptional<z.ZodString>;
449
+ browserLanguage: z.ZodOptional<z.ZodString>;
450
+ browserFingerprint: z.ZodOptional<z.ZodString>;
451
+ pageLocation: z.ZodString;
452
+ }, z.core.$strip>;
453
+ }, z.core.$strip>;
454
+ export const PostErrorDataSchema: z.ZodObject<{
455
+ message: z.ZodString;
456
+ name: z.ZodOptional<z.ZodString>;
457
+ stack: z.ZodOptional<z.ZodString>;
458
+ href: z.ZodString;
459
+ filename: z.ZodOptional<z.ZodString>;
460
+ }, z.core.$strip>;
461
+ export const PostErrorSchema: z.ZodObject<{
462
+ data: z.ZodObject<{
463
+ message: z.ZodString;
464
+ name: z.ZodOptional<z.ZodString>;
465
+ stack: z.ZodOptional<z.ZodString>;
466
+ href: z.ZodString;
467
+ filename: z.ZodOptional<z.ZodString>;
468
+ }, z.core.$strip>;
469
+ key: z.ZodString;
470
+ }, z.core.$strip>;
471
+ export const SiteDetailsSchema: z.ZodObject<{
472
+ site: z.ZodString;
473
+ account: z.ZodString;
474
+ title: z.ZodOptional<z.ZodString>;
475
+ description: z.ZodOptional<z.ZodString>;
476
+ keywords: z.ZodOptional<z.ZodString>;
477
+ author: z.ZodOptional<z.ZodString>;
478
+ language: z.ZodOptional<z.ZodString>;
479
+ canonical: z.ZodOptional<z.ZodString>;
480
+ robots: z.ZodOptional<z.ZodString>;
481
+ viewport: z.ZodOptional<z.ZodString>;
482
+ charset: z.ZodOptional<z.ZodString>;
483
+ generator: z.ZodOptional<z.ZodString>;
484
+ category: z.ZodString;
485
+ datetime: z.ZodNumber;
486
+ }, z.core.$strip>;
487
+ export const SiteDataSchema: z.ZodObject<{
488
+ accountDetails: z.ZodOptional<z.ZodObject<{
489
+ site: z.ZodString;
490
+ account: z.ZodString;
491
+ apiKey: z.ZodString;
492
+ adminApiKey: z.ZodString;
493
+ }, z.core.$strip>>;
494
+ browsers: z.ZodOptional<z.ZodArray<z.ZodObject<{
495
+ account: z.ZodOptional<z.ZodString>;
496
+ datetime: z.ZodNumber;
497
+ site: z.ZodString;
498
+ browser: z.ZodString;
499
+ count: z.ZodNumber;
500
+ category: z.ZodString;
501
+ }, z.core.$strip>>>;
502
+ events: z.ZodOptional<z.ZodArray<z.ZodObject<{
503
+ account: z.ZodOptional<z.ZodString>;
504
+ site: z.ZodString;
505
+ eventName: z.ZodString;
506
+ datetime: z.ZodNumber;
507
+ count: z.ZodNumber;
508
+ category: z.ZodString;
509
+ }, z.core.$strip>>>;
510
+ locations: z.ZodOptional<z.ZodArray<z.ZodObject<{
511
+ account: z.ZodOptional<z.ZodString>;
512
+ datetime: z.ZodNumber;
513
+ site: z.ZodString;
514
+ countryRegion: z.ZodString;
515
+ category: z.ZodString;
516
+ count: z.ZodNumber;
517
+ }, z.core.$strip>>>;
518
+ queries: z.ZodOptional<z.ZodArray<z.ZodObject<{
519
+ account: z.ZodOptional<z.ZodString>;
520
+ datetime: z.ZodNumber;
521
+ site: z.ZodString;
522
+ pathName: z.ZodString;
523
+ search: z.ZodOptional<z.ZodString>;
524
+ hash: z.ZodOptional<z.ZodString>;
525
+ count: z.ZodNumber;
526
+ category: z.ZodString;
527
+ }, z.core.$strip>>>;
528
+ referrers: z.ZodOptional<z.ZodArray<z.ZodObject<{
529
+ account: z.ZodOptional<z.ZodString>;
530
+ datetime: z.ZodNumber;
531
+ site: z.ZodString;
532
+ referrer: z.ZodString;
533
+ count: z.ZodNumber;
534
+ category: z.ZodString;
535
+ }, z.core.$strip>>>;
536
+ resolutions: z.ZodOptional<z.ZodArray<z.ZodObject<{
537
+ account: z.ZodOptional<z.ZodString>;
538
+ datetime: z.ZodNumber;
539
+ site: z.ZodString;
540
+ resolution: z.ZodString;
541
+ count: z.ZodNumber;
542
+ category: z.ZodString;
543
+ }, z.core.$strip>>>;
544
+ fingerprints: z.ZodOptional<z.ZodArray<z.ZodObject<{
545
+ account: z.ZodOptional<z.ZodString>;
546
+ datetime: z.ZodNumber;
547
+ site: z.ZodString;
548
+ fingerprint: z.ZodString;
549
+ count: z.ZodNumber;
550
+ category: z.ZodString;
551
+ }, z.core.$strip>>>;
552
+ health: z.ZodOptional<z.ZodArray<z.ZodObject<{
553
+ account: z.ZodOptional<z.ZodString>;
554
+ datetime: z.ZodNumber;
555
+ site: z.ZodString;
556
+ responseTimeMs: z.ZodNumber;
557
+ success: z.ZodBoolean;
558
+ }, z.core.$strip>>>;
559
+ languages: z.ZodOptional<z.ZodArray<z.ZodObject<{
560
+ account: z.ZodOptional<z.ZodString>;
561
+ datetime: z.ZodNumber;
562
+ site: z.ZodString;
563
+ language: z.ZodString;
564
+ count: z.ZodNumber;
565
+ category: z.ZodString;
566
+ }, z.core.$strip>>>;
567
+ rollups: z.ZodOptional<z.ZodArray<z.ZodObject<{
568
+ account: z.ZodString;
569
+ site: z.ZodString;
570
+ datetime: z.ZodNumber;
571
+ category: z.ZodString;
572
+ topReferrers: z.ZodOptional<z.ZodArray<z.ZodObject<{
573
+ referrer: z.ZodString;
574
+ count: z.ZodNumber;
575
+ }, z.core.$strip>>>;
576
+ topResolutions: z.ZodOptional<z.ZodArray<z.ZodObject<{
577
+ resolution: z.ZodString;
578
+ count: z.ZodNumber;
579
+ }, z.core.$strip>>>;
580
+ topFingerprints: z.ZodOptional<z.ZodArray<z.ZodObject<{
581
+ fingerprint: z.ZodString;
582
+ count: z.ZodNumber;
583
+ }, z.core.$strip>>>;
584
+ topQueries: z.ZodOptional<z.ZodArray<z.ZodObject<{
585
+ pathName: z.ZodString;
586
+ count: z.ZodNumber;
587
+ }, z.core.$strip>>>;
588
+ topLocations: z.ZodOptional<z.ZodArray<z.ZodObject<{
589
+ countryRegion: z.ZodString;
590
+ count: z.ZodNumber;
591
+ }, z.core.$strip>>>;
592
+ topBrowsers: z.ZodOptional<z.ZodArray<z.ZodObject<{
593
+ browser: z.ZodString;
594
+ count: z.ZodNumber;
595
+ }, z.core.$strip>>>;
596
+ topEvents: z.ZodOptional<z.ZodArray<z.ZodObject<{
597
+ eventName: z.ZodString;
598
+ count: z.ZodNumber;
599
+ }, z.core.$strip>>>;
600
+ topLanguages: z.ZodOptional<z.ZodArray<z.ZodObject<{
601
+ language: z.ZodString;
602
+ count: z.ZodNumber;
603
+ }, z.core.$strip>>>;
604
+ topErrors: z.ZodOptional<z.ZodArray<z.ZodObject<{
605
+ href: z.ZodString;
606
+ count: z.ZodNumber;
607
+ }, z.core.$strip>>>;
608
+ averageResponseTimeMs: z.ZodOptional<z.ZodNumber>;
609
+ }, z.core.$strip>>>;
610
+ errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
611
+ PK: z.ZodString;
612
+ messageHash: z.ZodOptional<z.ZodString>;
613
+ site: z.ZodString;
614
+ account: z.ZodString;
615
+ message: z.ZodOptional<z.ZodString>;
616
+ name: z.ZodOptional<z.ZodString>;
617
+ stack: z.ZodOptional<z.ZodString>;
618
+ href: z.ZodString;
619
+ filename: z.ZodOptional<z.ZodString>;
620
+ datetime: z.ZodNumber;
621
+ archived: z.ZodOptional<z.ZodBoolean>;
622
+ count: z.ZodNumber;
623
+ category: z.ZodString;
624
+ }, z.core.$strip>>>;
625
+ google: z.ZodOptional<z.ZodArray<z.ZodObject<{
626
+ account: z.ZodString;
627
+ email: z.ZodString;
628
+ site: z.ZodString;
629
+ datetime: z.ZodNumber;
630
+ category: z.ZodString;
631
+ totals: z.ZodObject<{
632
+ clicks: z.ZodNumber;
633
+ impressions: z.ZodNumber;
634
+ position: z.ZodNumber;
635
+ query: z.ZodString;
636
+ }, z.core.$strip>;
637
+ queries: z.ZodArray<z.ZodObject<{
638
+ clicks: z.ZodNumber;
639
+ impressions: z.ZodNumber;
640
+ position: z.ZodNumber;
641
+ query: z.ZodString;
642
+ }, z.core.$strip>>;
643
+ }, z.core.$strip>>>;
644
+ bing: z.ZodOptional<z.ZodArray<z.ZodObject<{
645
+ account: z.ZodString;
646
+ email: z.ZodString;
647
+ site: z.ZodString;
648
+ datetime: z.ZodNumber;
649
+ category: z.ZodString;
650
+ totals: z.ZodObject<{
651
+ clicks: z.ZodNumber;
652
+ impressions: z.ZodNumber;
653
+ position: z.ZodNumber;
654
+ query: z.ZodString;
655
+ }, z.core.$strip>;
656
+ queries: z.ZodArray<z.ZodObject<{
657
+ clicks: z.ZodNumber;
658
+ impressions: z.ZodNumber;
659
+ position: z.ZodNumber;
660
+ query: z.ZodString;
661
+ }, z.core.$strip>>;
662
+ }, z.core.$strip>>>;
663
+ }, z.core.$strip>;
664
+ export const PostAccountSchema: z.ZodObject<{
665
+ site: z.ZodString;
666
+ account: z.ZodString;
667
+ }, z.core.$strip>;
668
+ export const DeleteAccountSchema: z.ZodObject<{
669
+ site: z.ZodString;
670
+ account: z.ZodString;
671
+ }, z.core.$strip>;
672
+ export const ArchiveErrorsSchema: z.ZodObject<{
673
+ PKs: z.ZodArray<z.ZodString>;
674
+ }, z.core.$strip>;
675
+ export type SeoResultValues = z.infer<typeof SeoResultValuesSchema>;
676
+ export type SeoResult = z.infer<typeof SeoResultSchema>;
677
+ export type GetAccount = z.infer<typeof GetAccountSchema>;
678
+ export type GetAccounts = z.infer<typeof GetAccountsSchema>;
679
+ export type GoogleIntegration = z.infer<typeof GoogleIntegrationSchema>;
680
+ export type BingIntegration = z.infer<typeof BingIntegrationSchema>;
681
+ export type ApiKey = z.infer<typeof ApiKeySchema>;
682
+ export type Query = z.infer<typeof QuerySchema>;
683
+ export type Browser = z.infer<typeof BrowserSchema>;
684
+ export type Resolution = z.infer<typeof ResolutionSchema>;
685
+ export type Referrer = z.infer<typeof ReferrerSchema>;
686
+ export type Location = z.infer<typeof LocationSchema>;
687
+ export type Language = z.infer<typeof LanguageSchema>;
688
+ export type Fingerprint = z.infer<typeof FingerprintSchema>;
689
+ export type Event = z.infer<typeof EventSchema>;
690
+ export type Health = z.infer<typeof HealthSchema>;
691
+ export type ModelError = z.infer<typeof ModelErrorSchema>;
692
+ export type Rollup = z.infer<typeof RollupSchema>;
693
+ export type SiteData = z.infer<typeof SiteDataSchema>;
694
+ export type SiteDetails = z.infer<typeof SiteDetailsSchema>;
695
+ export type PostEventData = z.infer<typeof PostEventDataSchema>;
696
+ export type PostEvent = z.infer<typeof PostEventSchema>;
697
+ export type PostSiteTrackData = z.infer<typeof PostSiteTrackDataSchema>;
698
+ export type PostSiteTrack = z.infer<typeof PostSiteTrackSchema>;
699
+ export type PostErrorData = z.infer<typeof PostErrorDataSchema>;
700
+ export type PostError = z.infer<typeof PostErrorSchema>;
701
+ export type PostAccount = z.infer<typeof PostAccountSchema>;
702
+ export type DeleteAccount = z.infer<typeof DeleteAccountSchema>;
703
+ export type ArchiveErrors = z.infer<typeof ArchiveErrorsSchema>;
704
+
175
705
  }
176
706
  declare module 'analytica.click' {
177
707
  import main = require('analytica.click/dist/index');
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- 'use client';"use strict";var Z=Object.create;var w=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var rr=Object.getPrototypeOf,er=Object.prototype.hasOwnProperty;var or=(r,e)=>{for(var o in e)w(r,o,{get:e[o],enumerable:!0})},A=(r,e,o,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of V(e))!er.call(r,n)&&n!==o&&w(r,n,{get:()=>e[n],enumerable:!(t=U(e,n))||t.enumerable});return r};var tr=(r,e,o)=>(o=r!=null?Z(rr(r)):{},A(e||!r||!r.__esModule?w(o,"default",{value:r,enumerable:!0}):o,r)),nr=r=>A(w({},"__esModule",{value:!0}),r);var cr={};or(cr,{AnalyticaClickProvider:()=>ir,AnalyticaConfigContext:()=>p,errorTrack:()=>f,event:()=>S,page:()=>I,tokenMissing:()=>y,useAnalytica:()=>sr});module.exports=nr(cr);var q=require("react");var k=require("ag-common/dist/common/helpers/log"),E=tr(require("react"));var F=require("react");var lr=require("cross-fetch/polyfill"),g=require("ag-common/dist/common/helpers/log"),D=require("ag-common/dist/common/helpers/string/contains");var v=require("ag-common/dist/common/helpers/hashCode"),l=require("ag-common/dist/common/helpers/log"),N=require("ag-common/dist/common/helpers/object");function R(r){return r?r.match(/^"?[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}"?$/)?((0,l.info)("ignoring react devtools message"),!1):r===JSON.stringify([{}])?((0,l.info)("empty message payload?"),!1):!0:((0,l.info)("no message?"),!1)}var J=r=>{try{let e=/^\[?[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}\]?$/gim,o=/(at \S+?) \(\S+\)\s/gim,t=/^((%[cs])+\s*)+$/gim,n=/^color:/gim,a=[],i=r.message;(0,N.isJson)(i)?a=JSON.parse(i):a=[i];let s=a.findIndex(c=>c.match(t)),T=a.findIndex(c=>c.match(n));s>=0&&T>=0&&T===s+1&&(a=a.filter((c,Y)=>![s,T].includes(Y))),a=a.map(c=>c.includes(".js:")||c.includes("node_modules")?c.replace(o,"$1 (stacktrace)"):c.replace(e,"[date]")),i=JSON.stringify(a);let $=(0,v.hashCode)(i).toString();return(0,l.debug)("got errorKey=",i,$),$}catch{return(0,v.hashCode)(r.message).toString()}};var M=(r,e)=>{let o=[],t={},n=0;return Object.entries(r).forEach(([a,i])=>{n<e?o.push(i):t[a]=i,n+=1}),{part:o,rest:t}};var B=typeof window<"u"&&window.location.hostname==="localhost",d={},x,C,L=async()=>{try{if(Object.keys(d).length>100){let t=Object.keys(d)[0],n=d[t],a=await fetch(`${C}/errors`,{method:"POST",headers:{"Content-Type":"application/json",authorization:""},body:JSON.stringify([{key:n.key,data:{...n.data,message:`error overload!: ${n.data.message||"?"}`}}])});if(d={},!a.ok)throw new Error(`HTTP error! status: ${a.status}`);return{}}let{part:r,rest:e}=M(d,10);d=e;let o=await fetch(`${C}/errors`,{method:"POST",headers:{"Content-Type":"application/json",authorization:""},body:JSON.stringify(r)});if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`)}catch(r){let e=r;return{error:e?.message??e.message}}finally{Object.keys(d).length>0?x=setTimeout(L,1e3):x=void 0}},f=async({data:r,overrideBaseUrl:e="https://analytica.click/api",ignoreBrowserErrors:o=["will be removed","performing full reload","tracking error","fetch RSC payload","perform a full reload","warnings#debug_enabled"],devMode:t})=>{if(e||(e="https://analytica.click/api"),e.startsWith("/")&&typeof window>"u"&&(e="https://analytica.click/api"),o.length>0){let a=(0,D.containsInsensitive)(r.data.message,...o);if(a){(0,g.debug)("ignoring error, contains=",a);return}}if(B&&t)(0,g.debug)("allowing local error tracking due to devmode=true");else if(B)return(0,g.debug)(`local error tracking ignored:${r.data.message} ${JSON.stringify(r)}, to ${e}`),{};if(!R(r.data.message))return{};(0,g.debug)("error track",r.data.message,JSON.stringify(r));let n=J(r.data);return d[n]=r,C=e,x??=setTimeout(L,500),{}};async function b({ev:r,values:e}){if(!e.analyticaToken)return;let o={message:r.message,href:window.location.href,filename:r.filename,name:"",stack:r.error.stack};await f({...e,data:{key:e.analyticaToken,data:o}})}function z(r){(0,F.useEffect)(()=>{let e=o=>b({ev:o,values:r});if(r.analyticaToken)return window.addEventListener("error",e),()=>{try{window.removeEventListener("error",e)}catch{}}},[])}var H=require("react");function j(r){(0,H.useEffect)(()=>{if(window.consoleset||!r.analyticaToken)return;window.consoleset=!0;let e=window.console.error;window.console.error=(...t)=>{f({...r,data:{data:{href:window.location.href,message:JSON.stringify(t)},key:r.analyticaToken}}),e(...t)};let o=window.console.warn;window.console.warn=(...t)=>{f({...r,data:{data:{href:window.location.href,message:JSON.stringify(t)},key:r.analyticaToken}}),o(...t)}},[])}var y=r=>`[Analytica.${r}] Please load analytica token in AnalyticaClickProvider to use this component`;function K(r){if(global.nodeset||typeof window<"u"||!r.analyticaToken)return;global.nodeset=!0;let e=global.console.error;global.console.error=(...t)=>{f({...r,data:{data:{href:"server",message:JSON.stringify(t)},key:r.analyticaToken}}),e(...t)};let o=global.console.warn;global.console.warn=(...t)=>{f({...r,data:{data:{href:"server",message:JSON.stringify(t)},key:r.analyticaToken}}),o(...t)}}var W=require("ag-common/dist/ui/components/Modal"),_=require("react"),u=require("react/jsx-runtime"),ar={fontSize:"2rem"},h=class extends _.Component{constructor(e){super(e),this.state={hasError:void 0},this.seenError=!1}static getDerivedStateFromError(e){let o=typeof window<"u"&&window.location.href;return{hasError:{...e,message:e?.message??e,...e?.stack&&{error:{stack:e?.stack}},...o&&{href:o}}}}render(){let{hasError:e}=this.state,{children:o,notify:t}=this.props;return e?(t&&t(e),(0,u.jsx)(W.Modal,{open:!0,setOpen:()=>{},children:(0,u.jsxs)("div",{style:ar,children:["A fatal error has occurred - the admin has been notified.",(0,u.jsx)("button",{type:"button",onClick:()=>window.location.reload(),children:"Press here to restart app"})]})})):o}};var O=require("react/jsx-runtime"),X=({children:r})=>{let e=(0,E.useContext)(p);return j(e),z(e),K(e),(0,k.debug)("installed analytica.click error handlers"),e.analyticaToken?(0,O.jsx)(h,{notify:o=>b({ev:o,values:e}),children:r}):((0,k.warn)(y("ErrorBoundary")),(0,O.jsx)(E.default.Fragment,{children:r}))};var P=require("react/jsx-runtime"),p=(0,q.createContext)(void 0),ir=({children:r,values:e})=>(0,P.jsx)(p.Provider,{value:e,children:(0,P.jsx)(X,{children:r})});var Dr=require("cross-fetch/polyfill"),m=require("ag-common/dist/common/helpers/log"),S=async({analyticaToken:r,overrideBaseUrl:e="https://analytica.click/api",eventName:o,devMode:t,valueOverrides:n})=>{let a={eventName:o,browserFingerprint:n?.browserFingerprint};if(!t&&typeof window<"u"&&window.location.hostname==="localhost")return(0,m.debug)(`local page ignored: ${JSON.stringify(a)}, to ${e}`),{};try{let i=await fetch(`${e}/site/event`,{method:"POST",headers:{"Content-Type":"application/json",authorization:""},body:JSON.stringify({key:r,data:a})});if(!i.ok){let s=await i.text();return(0,m.warn)("tracking error:"+s),{error:s}}}catch(i){let s=i instanceof Error?i.message:"Unknown error";return(0,m.warn)("tracking error:"+s),{error:s}}return{}},I=async({analyticaToken:r,overrideBaseUrl:e="https://analytica.click/api",devMode:o,valueOverrides:t})=>{let n={pageLocation:"",browserFingerprint:t?.browserFingerprint};if(typeof window<"u"&&(n={...n,pageLocation:window.location.href,browserResolution:`${window.screen.width}:${window.screen.height}`}),typeof document<"u"&&(n={...n,pageReferrer:document.referrer,pageTitle:document.title}),typeof navigator<"u"&&(n={...n,browserLanguage:navigator.language}),!o&&typeof window<"u"&&window.location.hostname==="localhost")return(0,m.debug)(`local page ignored: ${JSON.stringify(n)}, to ${e}`),{};if(!n.pageLocation)return(0,m.warn)("no pageLocation"),{};try{let a=await fetch(`${e}/site/tracking`,{method:"POST",headers:{"Content-Type":"application/json",authorization:""},body:JSON.stringify({key:r,data:n})});if(!a.ok){let i=await a.text();return(0,m.warn)("tracking error:"+i),{error:i}}}catch(a){let i=a instanceof Error?a.message:"Unknown error";return(0,m.warn)("tracking error:"+i),{error:i}}return{}};var G=require("ag-common/dist/common/helpers/log"),Q=require("react");var sr=()=>{let r=(0,Q.useContext)(p);if(!r.analyticaToken){(0,G.warn)(y("useAnalytica"));let e=async()=>({error:"no token"});return{event:e,page:e}}return{event:e=>S({...e,...r}),page:e=>I({...e,...r})}};0&&(module.exports={AnalyticaClickProvider,AnalyticaConfigContext,errorTrack,event,page,tokenMissing,useAnalytica});
1
+ 'use client';"use strict";var Y=Object.create;var u=Object.defineProperty;var Z=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var V=Object.getPrototypeOf,ee=Object.prototype.hasOwnProperty;var re=(e,r)=>{for(var o in r)u(e,o,{get:r[o],enumerable:!0})},N=(e,r,o,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of U(r))!ee.call(e,n)&&n!==o&&u(e,n,{get:()=>r[n],enumerable:!(t=Z(r,n))||t.enumerable});return e};var oe=(e,r,o)=>(o=e!=null?Y(V(e)):{},N(r||!e||!e.__esModule?u(o,"default",{value:e,enumerable:!0}):o,e)),te=e=>N(u({},"__esModule",{value:!0}),e);var ce={};re(ce,{AnalyticaClickProvider:()=>ie,AnalyticaConfigContext:()=>m,Modal:()=>C,errorTrack:()=>d,event:()=>I,getErrorKey:()=>D,page:()=>R,tokenMissing:()=>g,useAnalytica:()=>se});module.exports=te(ce);var X=require("react");var h=require("ag-common/dist/common/helpers/log"),k=oe(require("react"));var F=require("react");var le=require("cross-fetch/polyfill"),T=require("ag-common/dist/common/helpers/hashCode"),s=require("ag-common/dist/common/helpers/log"),M=require("ag-common/dist/common/helpers/object"),L=require("ag-common/dist/common/helpers/string/contains");var A=(e,r)=>{let o=[],t={},n=0;return Object.entries(e).forEach(([a,i])=>{n<r?o.push(i):t[a]=i,n+=1}),{part:o,rest:t}};var J=typeof window<"u"&&window.location.hostname==="localhost",p={},v,x,B=async()=>{try{if(Object.keys(p).length>100){let t=Object.keys(p)[0],n=p[t],a=await fetch(`${x}/errors`,{method:"POST",headers:{"Content-Type":"application/json",authorization:""},body:JSON.stringify([{key:n.key,data:{...n.data,message:`error overload!: ${n.data.message||"?"}`}}])});if(p={},!a.ok)throw new Error(`HTTP error! status: ${a.status}`);return{}}let{part:e,rest:r}=A(p,10);p=r;let o=await fetch(`${x}/errors`,{method:"POST",headers:{"Content-Type":"application/json",authorization:""},body:JSON.stringify(e)});if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`)}catch(e){let r=e;return{error:r?.message??r.message}}finally{Object.keys(p).length>0?v=setTimeout(B,1e3):v=void 0}},d=async({data:e,overrideBaseUrl:r="https://analytica.click/api",ignoreBrowserErrors:o=["will be removed","performing full reload","tracking error","fetch RSC payload","perform a full reload","warnings#debug_enabled"],devMode:t})=>{if(r||(r="https://analytica.click/api"),r.startsWith("/")&&typeof window>"u"&&(r="https://analytica.click/api"),o.length>0){let a=(0,L.containsInsensitive)(e.data.message,...o);if(a){(0,s.debug)("ignoring error, contains=",a);return}}if(J&&t)(0,s.debug)("allowing local error tracking due to devmode=true");else if(J)return(0,s.debug)(`local error tracking ignored:${e.data.message} ${JSON.stringify(e)}, to ${r}`),{};if(!ne(e.data.message))return{};(0,s.debug)("error track",e.data.message,JSON.stringify(e));let n=D({...e.data,name:e.data.name??"unknown"});return p[n]=e,x=r,v??=setTimeout(B,500),{}};function ne(e){return e?e.match(/^"?[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}"?$/)?((0,s.info)("ignoring react devtools message"),!1):e===JSON.stringify([{}])?((0,s.info)("empty message payload?"),!1):!0:((0,s.info)("no message?"),!1)}var D=e=>{try{let r=/^\[?[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}\]?$/gim,o=/(at \S+?) \(\S+\)\s/gim,t=/^((%[cs])+\s*)+$/gim,n=/^color:/gim,a=[],i=e.message;(0,M.isJson)(i)?a=JSON.parse(i):a=[i];let c=a.findIndex(f=>f.match(t)),E=a.findIndex(f=>f.match(n));c>=0&&E>=0&&E===c+1&&(a=a.filter((f,Q)=>![c,E].includes(Q))),a=a.map(f=>f.includes(".js:")||f.includes("node_modules")?f.replace(o,"$1 (stacktrace)"):f.replace(r,"[date]")),i=JSON.stringify(a);let $=(0,T.hashCode)(i).toString();return(0,s.debug)("got errorKey=",i,$),$}catch{return(0,T.hashCode)(e.message).toString()}};async function b({ev:e,values:r}){if(!r.analyticaToken)return;let o={message:e.message,href:window.location.href,filename:e.filename,name:"",stack:e.error.stack};await d({...r,data:{key:r.analyticaToken,data:o}})}function z(e){(0,F.useEffect)(()=>{let r=o=>b({ev:o,values:e});if(e.analyticaToken)return window.addEventListener("error",r),()=>{try{window.removeEventListener("error",r)}catch{}}},[])}var H=require("react");function j(e){(0,H.useEffect)(()=>{if(window.consoleset||!e.analyticaToken)return;window.consoleset=!0;let r=window.console.error;window.console.error=(...t)=>{d({...e,data:{data:{href:window.location.href,message:JSON.stringify(t)},key:e.analyticaToken}}),r(...t)};let o=window.console.warn;window.console.warn=(...t)=>{d({...e,data:{data:{href:window.location.href,message:JSON.stringify(t)},key:e.analyticaToken}}),o(...t)}},[])}var g=e=>`[Analytica.${e}] Please load analytica token in AnalyticaClickProvider to use this component`;function W(e){if(global.nodeset||typeof window<"u"||!e.analyticaToken)return;global.nodeset=!0;let r=global.console.error;global.console.error=(...t)=>{d({...e,data:{data:{href:"server",message:JSON.stringify(t)},key:e.analyticaToken}}),r(...t)};let o=global.console.warn;global.console.warn=(...t)=>{d({...e,data:{data:{href:"server",message:JSON.stringify(t)},key:e.analyticaToken}}),o(...t)}}var K=require("react");var y=require("react/jsx-runtime"),ae={fontSize:"2rem"},w=class extends K.Component{constructor(r){super(r),this.state={hasError:void 0},this.seenError=!1}static getDerivedStateFromError(r){let o=typeof window<"u"&&window.location.href;return{hasError:{...r,message:r?.message??r,...r?.stack&&{error:{stack:r?.stack}},...o&&{href:o}}}}render(){let{hasError:r}=this.state,{children:o,notify:t}=this.props;return r?(t&&t(r),(0,y.jsx)(C,{open:!0,setOpen:()=>{},children:(0,y.jsxs)("div",{style:ae,children:["A fatal error has occurred - the admin has been notified.",(0,y.jsx)("button",{type:"button",onClick:()=>window.location.reload(),children:"Press here to restart app"})]})})):o}};var P=require("react/jsx-runtime"),_=({children:e})=>{let r=(0,k.useContext)(m);return j(r),z(r),W(r),(0,h.debug)("installed analytica.click error handlers"),r.analyticaToken?(0,P.jsx)(w,{notify:o=>b({ev:o,values:r}),children:e}):((0,h.warn)(g("ErrorBoundary")),(0,P.jsx)(k.default.Fragment,{children:e}))};var O=require("react/jsx-runtime"),m=(0,X.createContext)(void 0),ie=({children:e,values:r})=>(0,O.jsx)(m.Provider,{value:r,children:(0,O.jsx)(_,{children:e})});var S=require("react/jsx-runtime"),C=({open:e,setOpen:r,children:o})=>e?(0,S.jsx)("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},onClick:()=>r(!1),children:(0,S.jsx)("div",{style:{backgroundColor:"white",padding:"2rem",borderRadius:"8px",maxWidth:"500px",maxHeight:"80vh",overflow:"auto",position:"relative",boxShadow:"0 10px 25px rgba(0, 0, 0, 0.2)"},onClick:t=>t.stopPropagation(),children:o})}):null;var De=require("cross-fetch/polyfill"),l=require("ag-common/dist/common/helpers/log"),I=async({analyticaToken:e,overrideBaseUrl:r="https://analytica.click/api",eventName:o,devMode:t,valueOverrides:n})=>{let a={eventName:o,browserFingerprint:n?.browserFingerprint,pageLocation:""};if(typeof window<"u"&&(a={...a,pageLocation:window.location.href,browserResolution:`${window.screen.width}:${window.screen.height}`}),!t&&typeof window<"u"&&window.location.hostname==="localhost")return(0,l.debug)(`local page ignored: ${JSON.stringify(a)}, to ${r}`),{};try{let i=await fetch(`${r}/site/event`,{method:"POST",headers:{"Content-Type":"application/json",authorization:""},body:JSON.stringify({key:e,data:a})});if(!i.ok){let c=await i.text();return(0,l.warn)("tracking error:"+c),{error:c}}}catch(i){let c=i instanceof Error?i.message:"Unknown error";return(0,l.warn)("tracking error:"+c),{error:c}}return{}},R=async({analyticaToken:e,overrideBaseUrl:r="https://analytica.click/api",devMode:o,valueOverrides:t})=>{let n={pageLocation:"",browserFingerprint:t?.browserFingerprint};if(typeof window<"u"&&(n={...n,pageLocation:window.location.href,browserResolution:`${window.screen.width}:${window.screen.height}`}),typeof document<"u"&&(n={...n,pageReferrer:document.referrer,pageTitle:document.title}),typeof navigator<"u"&&(n={...n,browserLanguage:navigator.language}),!o&&typeof window<"u"&&window.location.hostname==="localhost")return(0,l.debug)(`local page ignored: ${JSON.stringify(n)}, to ${r}`),{};if(!n.pageLocation)return(0,l.warn)("no pageLocation"),{};try{let a=await fetch(`${r}/site/tracking`,{method:"POST",headers:{"Content-Type":"application/json",authorization:""},body:JSON.stringify({key:e,data:n})});if(!a.ok){let i=await a.text();return(0,l.warn)("tracking error:"+i),{error:i}}}catch(a){let i=a instanceof Error?a.message:"Unknown error";return(0,l.warn)("tracking error:"+i),{error:i}}return{}};var q=require("ag-common/dist/common/helpers/log"),G=require("react");var se=()=>{let e=(0,G.useContext)(m);if(!e.analyticaToken){(0,q.warn)(g("useAnalytica"));let r=async()=>({error:"no token"});return{event:r,page:r}}return{event:r=>I({...r,...e}),page:r=>R({...r,...e})}};0&&(module.exports={AnalyticaClickProvider,AnalyticaConfigContext,Modal,errorTrack,event,getErrorKey,page,tokenMissing,useAnalytica});
@@ -0,0 +1,535 @@
1
+ import { z } from 'zod';
2
+ export declare const createSiteSchema: z.ZodObject<{
3
+ site: z.ZodString;
4
+ }, z.core.$strip>;
5
+ export declare const deleteSiteSchema: z.ZodObject<{
6
+ site: z.ZodString;
7
+ }, z.core.$strip>;
8
+ export declare const createGoogleIntegrationSchema: z.ZodObject<{
9
+ email: z.ZodString;
10
+ key: z.ZodString;
11
+ }, z.core.$strip>;
12
+ export declare const createBingIntegrationSchema: z.ZodObject<{
13
+ key: z.ZodString;
14
+ }, z.core.$strip>;
15
+ export declare const successResponseSchema: z.ZodObject<{
16
+ success: z.ZodBoolean;
17
+ }, z.core.$strip>;
18
+ export declare const errorResponseSchema: z.ZodObject<{
19
+ error: z.ZodString;
20
+ }, z.core.$strip>;
21
+ export declare const SeoResultValuesSchema: z.ZodObject<{
22
+ clicks: z.ZodNumber;
23
+ impressions: z.ZodNumber;
24
+ position: z.ZodNumber;
25
+ query: z.ZodString;
26
+ }, z.core.$strip>;
27
+ export declare const SeoResultSchema: z.ZodObject<{
28
+ account: z.ZodString;
29
+ email: z.ZodString;
30
+ site: z.ZodString;
31
+ datetime: z.ZodNumber;
32
+ category: z.ZodString;
33
+ totals: z.ZodObject<{
34
+ clicks: z.ZodNumber;
35
+ impressions: z.ZodNumber;
36
+ position: z.ZodNumber;
37
+ query: z.ZodString;
38
+ }, z.core.$strip>;
39
+ queries: z.ZodArray<z.ZodObject<{
40
+ clicks: z.ZodNumber;
41
+ impressions: z.ZodNumber;
42
+ position: z.ZodNumber;
43
+ query: z.ZodString;
44
+ }, z.core.$strip>>;
45
+ }, z.core.$strip>;
46
+ export declare const GetAccountSchema: z.ZodObject<{
47
+ site: z.ZodString;
48
+ account: z.ZodString;
49
+ apiKey: z.ZodString;
50
+ adminApiKey: z.ZodString;
51
+ }, z.core.$strip>;
52
+ export declare const GetAccountsSchema: z.ZodObject<{
53
+ accounts: z.ZodArray<z.ZodObject<{
54
+ site: z.ZodString;
55
+ account: z.ZodString;
56
+ apiKey: z.ZodString;
57
+ adminApiKey: z.ZodString;
58
+ }, z.core.$strip>>;
59
+ googleEmail: z.ZodOptional<z.ZodString>;
60
+ googleKey: z.ZodOptional<z.ZodString>;
61
+ bingKey: z.ZodOptional<z.ZodString>;
62
+ bingAccount: z.ZodOptional<z.ZodString>;
63
+ }, z.core.$strip>;
64
+ export declare const GoogleIntegrationSchema: z.ZodObject<{
65
+ email: z.ZodString;
66
+ key: z.ZodString;
67
+ account: z.ZodString;
68
+ }, z.core.$strip>;
69
+ export declare const BingIntegrationSchema: z.ZodObject<{
70
+ key: z.ZodString;
71
+ account: z.ZodString;
72
+ }, z.core.$strip>;
73
+ export declare const ApiKeySchema: z.ZodObject<{
74
+ key: z.ZodString;
75
+ adminKey: z.ZodString;
76
+ account: z.ZodString;
77
+ site: z.ZodString;
78
+ }, z.core.$strip>;
79
+ export declare const QuerySchema: z.ZodObject<{
80
+ account: z.ZodOptional<z.ZodString>;
81
+ datetime: z.ZodNumber;
82
+ site: z.ZodString;
83
+ pathName: z.ZodString;
84
+ search: z.ZodOptional<z.ZodString>;
85
+ hash: z.ZodOptional<z.ZodString>;
86
+ count: z.ZodNumber;
87
+ category: z.ZodString;
88
+ }, z.core.$strip>;
89
+ export declare const BrowserSchema: z.ZodObject<{
90
+ account: z.ZodOptional<z.ZodString>;
91
+ datetime: z.ZodNumber;
92
+ site: z.ZodString;
93
+ browser: z.ZodString;
94
+ count: z.ZodNumber;
95
+ category: z.ZodString;
96
+ }, z.core.$strip>;
97
+ export declare const ResolutionSchema: z.ZodObject<{
98
+ account: z.ZodOptional<z.ZodString>;
99
+ datetime: z.ZodNumber;
100
+ site: z.ZodString;
101
+ resolution: z.ZodString;
102
+ count: z.ZodNumber;
103
+ category: z.ZodString;
104
+ }, z.core.$strip>;
105
+ export declare const ReferrerSchema: z.ZodObject<{
106
+ account: z.ZodOptional<z.ZodString>;
107
+ datetime: z.ZodNumber;
108
+ site: z.ZodString;
109
+ referrer: z.ZodString;
110
+ count: z.ZodNumber;
111
+ category: z.ZodString;
112
+ }, z.core.$strip>;
113
+ export declare const LocationSchema: z.ZodObject<{
114
+ account: z.ZodOptional<z.ZodString>;
115
+ datetime: z.ZodNumber;
116
+ site: z.ZodString;
117
+ countryRegion: z.ZodString;
118
+ category: z.ZodString;
119
+ count: z.ZodNumber;
120
+ }, z.core.$strip>;
121
+ export declare const LanguageSchema: z.ZodObject<{
122
+ account: z.ZodOptional<z.ZodString>;
123
+ datetime: z.ZodNumber;
124
+ site: z.ZodString;
125
+ language: z.ZodString;
126
+ count: z.ZodNumber;
127
+ category: z.ZodString;
128
+ }, z.core.$strip>;
129
+ export declare const FingerprintSchema: z.ZodObject<{
130
+ account: z.ZodOptional<z.ZodString>;
131
+ datetime: z.ZodNumber;
132
+ site: z.ZodString;
133
+ fingerprint: z.ZodString;
134
+ count: z.ZodNumber;
135
+ category: z.ZodString;
136
+ }, z.core.$strip>;
137
+ export declare const EventSchema: z.ZodObject<{
138
+ account: z.ZodOptional<z.ZodString>;
139
+ site: z.ZodString;
140
+ eventName: z.ZodString;
141
+ datetime: z.ZodNumber;
142
+ count: z.ZodNumber;
143
+ category: z.ZodString;
144
+ }, z.core.$strip>;
145
+ export declare const HealthSchema: z.ZodObject<{
146
+ account: z.ZodOptional<z.ZodString>;
147
+ datetime: z.ZodNumber;
148
+ site: z.ZodString;
149
+ responseTimeMs: z.ZodNumber;
150
+ success: z.ZodBoolean;
151
+ }, z.core.$strip>;
152
+ export declare const ModelErrorSchema: z.ZodObject<{
153
+ PK: z.ZodString;
154
+ messageHash: z.ZodOptional<z.ZodString>;
155
+ site: z.ZodString;
156
+ account: z.ZodString;
157
+ message: z.ZodOptional<z.ZodString>;
158
+ name: z.ZodOptional<z.ZodString>;
159
+ stack: z.ZodOptional<z.ZodString>;
160
+ href: z.ZodString;
161
+ filename: z.ZodOptional<z.ZodString>;
162
+ datetime: z.ZodNumber;
163
+ archived: z.ZodOptional<z.ZodBoolean>;
164
+ count: z.ZodNumber;
165
+ category: z.ZodString;
166
+ }, z.core.$strip>;
167
+ export declare const RollupTopReferrersSchema: z.ZodObject<{
168
+ referrer: z.ZodString;
169
+ count: z.ZodNumber;
170
+ }, z.core.$strip>;
171
+ export declare const RollupTopResolutionsSchema: z.ZodObject<{
172
+ resolution: z.ZodString;
173
+ count: z.ZodNumber;
174
+ }, z.core.$strip>;
175
+ export declare const RollupTopFingerprintsSchema: z.ZodObject<{
176
+ fingerprint: z.ZodString;
177
+ count: z.ZodNumber;
178
+ }, z.core.$strip>;
179
+ export declare const RollupTopQueriesSchema: z.ZodObject<{
180
+ pathName: z.ZodString;
181
+ count: z.ZodNumber;
182
+ }, z.core.$strip>;
183
+ export declare const RollupTopLocationsSchema: z.ZodObject<{
184
+ countryRegion: z.ZodString;
185
+ count: z.ZodNumber;
186
+ }, z.core.$strip>;
187
+ export declare const RollupTopBrowsersSchema: z.ZodObject<{
188
+ browser: z.ZodString;
189
+ count: z.ZodNumber;
190
+ }, z.core.$strip>;
191
+ export declare const RollupTopEventsSchema: z.ZodObject<{
192
+ eventName: z.ZodString;
193
+ count: z.ZodNumber;
194
+ }, z.core.$strip>;
195
+ export declare const RollupTopLanguagesSchema: z.ZodObject<{
196
+ language: z.ZodString;
197
+ count: z.ZodNumber;
198
+ }, z.core.$strip>;
199
+ export declare const RollupTopErrorsSchema: z.ZodObject<{
200
+ href: z.ZodString;
201
+ count: z.ZodNumber;
202
+ }, z.core.$strip>;
203
+ export declare const RollupSchema: z.ZodObject<{
204
+ account: z.ZodString;
205
+ site: z.ZodString;
206
+ datetime: z.ZodNumber;
207
+ category: z.ZodString;
208
+ topReferrers: z.ZodOptional<z.ZodArray<z.ZodObject<{
209
+ referrer: z.ZodString;
210
+ count: z.ZodNumber;
211
+ }, z.core.$strip>>>;
212
+ topResolutions: z.ZodOptional<z.ZodArray<z.ZodObject<{
213
+ resolution: z.ZodString;
214
+ count: z.ZodNumber;
215
+ }, z.core.$strip>>>;
216
+ topFingerprints: z.ZodOptional<z.ZodArray<z.ZodObject<{
217
+ fingerprint: z.ZodString;
218
+ count: z.ZodNumber;
219
+ }, z.core.$strip>>>;
220
+ topQueries: z.ZodOptional<z.ZodArray<z.ZodObject<{
221
+ pathName: z.ZodString;
222
+ count: z.ZodNumber;
223
+ }, z.core.$strip>>>;
224
+ topLocations: z.ZodOptional<z.ZodArray<z.ZodObject<{
225
+ countryRegion: z.ZodString;
226
+ count: z.ZodNumber;
227
+ }, z.core.$strip>>>;
228
+ topBrowsers: z.ZodOptional<z.ZodArray<z.ZodObject<{
229
+ browser: z.ZodString;
230
+ count: z.ZodNumber;
231
+ }, z.core.$strip>>>;
232
+ topEvents: z.ZodOptional<z.ZodArray<z.ZodObject<{
233
+ eventName: z.ZodString;
234
+ count: z.ZodNumber;
235
+ }, z.core.$strip>>>;
236
+ topLanguages: z.ZodOptional<z.ZodArray<z.ZodObject<{
237
+ language: z.ZodString;
238
+ count: z.ZodNumber;
239
+ }, z.core.$strip>>>;
240
+ topErrors: z.ZodOptional<z.ZodArray<z.ZodObject<{
241
+ href: z.ZodString;
242
+ count: z.ZodNumber;
243
+ }, z.core.$strip>>>;
244
+ averageResponseTimeMs: z.ZodOptional<z.ZodNumber>;
245
+ }, z.core.$strip>;
246
+ export declare const PostEventDataSchema: z.ZodObject<{
247
+ eventName: z.ZodString;
248
+ pageReferrer: z.ZodOptional<z.ZodString>;
249
+ pageTitle: z.ZodOptional<z.ZodString>;
250
+ browserResolution: z.ZodOptional<z.ZodString>;
251
+ browserLanguage: z.ZodOptional<z.ZodString>;
252
+ browserFingerprint: z.ZodOptional<z.ZodString>;
253
+ pageLocation: z.ZodString;
254
+ }, z.core.$strip>;
255
+ export declare const PostEventSchema: z.ZodObject<{
256
+ key: z.ZodString;
257
+ data: z.ZodObject<{
258
+ eventName: z.ZodString;
259
+ pageReferrer: z.ZodOptional<z.ZodString>;
260
+ pageTitle: z.ZodOptional<z.ZodString>;
261
+ browserResolution: z.ZodOptional<z.ZodString>;
262
+ browserLanguage: z.ZodOptional<z.ZodString>;
263
+ browserFingerprint: z.ZodOptional<z.ZodString>;
264
+ pageLocation: z.ZodString;
265
+ }, z.core.$strip>;
266
+ }, z.core.$strip>;
267
+ export declare const PostSiteTrackDataSchema: z.ZodObject<{
268
+ pageReferrer: z.ZodOptional<z.ZodString>;
269
+ pageTitle: z.ZodOptional<z.ZodString>;
270
+ browserResolution: z.ZodOptional<z.ZodString>;
271
+ browserLanguage: z.ZodOptional<z.ZodString>;
272
+ browserFingerprint: z.ZodOptional<z.ZodString>;
273
+ pageLocation: z.ZodString;
274
+ }, z.core.$strip>;
275
+ export declare const PostSiteTrackSchema: z.ZodObject<{
276
+ key: z.ZodString;
277
+ data: z.ZodObject<{
278
+ pageReferrer: z.ZodOptional<z.ZodString>;
279
+ pageTitle: z.ZodOptional<z.ZodString>;
280
+ browserResolution: z.ZodOptional<z.ZodString>;
281
+ browserLanguage: z.ZodOptional<z.ZodString>;
282
+ browserFingerprint: z.ZodOptional<z.ZodString>;
283
+ pageLocation: z.ZodString;
284
+ }, z.core.$strip>;
285
+ }, z.core.$strip>;
286
+ export declare const PostErrorDataSchema: z.ZodObject<{
287
+ message: z.ZodString;
288
+ name: z.ZodOptional<z.ZodString>;
289
+ stack: z.ZodOptional<z.ZodString>;
290
+ href: z.ZodString;
291
+ filename: z.ZodOptional<z.ZodString>;
292
+ }, z.core.$strip>;
293
+ export declare const PostErrorSchema: z.ZodObject<{
294
+ data: z.ZodObject<{
295
+ message: z.ZodString;
296
+ name: z.ZodOptional<z.ZodString>;
297
+ stack: z.ZodOptional<z.ZodString>;
298
+ href: z.ZodString;
299
+ filename: z.ZodOptional<z.ZodString>;
300
+ }, z.core.$strip>;
301
+ key: z.ZodString;
302
+ }, z.core.$strip>;
303
+ export declare const SiteDetailsSchema: z.ZodObject<{
304
+ site: z.ZodString;
305
+ account: z.ZodString;
306
+ title: z.ZodOptional<z.ZodString>;
307
+ description: z.ZodOptional<z.ZodString>;
308
+ keywords: z.ZodOptional<z.ZodString>;
309
+ author: z.ZodOptional<z.ZodString>;
310
+ language: z.ZodOptional<z.ZodString>;
311
+ canonical: z.ZodOptional<z.ZodString>;
312
+ robots: z.ZodOptional<z.ZodString>;
313
+ viewport: z.ZodOptional<z.ZodString>;
314
+ charset: z.ZodOptional<z.ZodString>;
315
+ generator: z.ZodOptional<z.ZodString>;
316
+ category: z.ZodString;
317
+ datetime: z.ZodNumber;
318
+ }, z.core.$strip>;
319
+ export declare const SiteDataSchema: z.ZodObject<{
320
+ accountDetails: z.ZodOptional<z.ZodObject<{
321
+ site: z.ZodString;
322
+ account: z.ZodString;
323
+ apiKey: z.ZodString;
324
+ adminApiKey: z.ZodString;
325
+ }, z.core.$strip>>;
326
+ browsers: z.ZodOptional<z.ZodArray<z.ZodObject<{
327
+ account: z.ZodOptional<z.ZodString>;
328
+ datetime: z.ZodNumber;
329
+ site: z.ZodString;
330
+ browser: z.ZodString;
331
+ count: z.ZodNumber;
332
+ category: z.ZodString;
333
+ }, z.core.$strip>>>;
334
+ events: z.ZodOptional<z.ZodArray<z.ZodObject<{
335
+ account: z.ZodOptional<z.ZodString>;
336
+ site: z.ZodString;
337
+ eventName: z.ZodString;
338
+ datetime: z.ZodNumber;
339
+ count: z.ZodNumber;
340
+ category: z.ZodString;
341
+ }, z.core.$strip>>>;
342
+ locations: z.ZodOptional<z.ZodArray<z.ZodObject<{
343
+ account: z.ZodOptional<z.ZodString>;
344
+ datetime: z.ZodNumber;
345
+ site: z.ZodString;
346
+ countryRegion: z.ZodString;
347
+ category: z.ZodString;
348
+ count: z.ZodNumber;
349
+ }, z.core.$strip>>>;
350
+ queries: z.ZodOptional<z.ZodArray<z.ZodObject<{
351
+ account: z.ZodOptional<z.ZodString>;
352
+ datetime: z.ZodNumber;
353
+ site: z.ZodString;
354
+ pathName: z.ZodString;
355
+ search: z.ZodOptional<z.ZodString>;
356
+ hash: z.ZodOptional<z.ZodString>;
357
+ count: z.ZodNumber;
358
+ category: z.ZodString;
359
+ }, z.core.$strip>>>;
360
+ referrers: z.ZodOptional<z.ZodArray<z.ZodObject<{
361
+ account: z.ZodOptional<z.ZodString>;
362
+ datetime: z.ZodNumber;
363
+ site: z.ZodString;
364
+ referrer: z.ZodString;
365
+ count: z.ZodNumber;
366
+ category: z.ZodString;
367
+ }, z.core.$strip>>>;
368
+ resolutions: z.ZodOptional<z.ZodArray<z.ZodObject<{
369
+ account: z.ZodOptional<z.ZodString>;
370
+ datetime: z.ZodNumber;
371
+ site: z.ZodString;
372
+ resolution: z.ZodString;
373
+ count: z.ZodNumber;
374
+ category: z.ZodString;
375
+ }, z.core.$strip>>>;
376
+ fingerprints: z.ZodOptional<z.ZodArray<z.ZodObject<{
377
+ account: z.ZodOptional<z.ZodString>;
378
+ datetime: z.ZodNumber;
379
+ site: z.ZodString;
380
+ fingerprint: z.ZodString;
381
+ count: z.ZodNumber;
382
+ category: z.ZodString;
383
+ }, z.core.$strip>>>;
384
+ health: z.ZodOptional<z.ZodArray<z.ZodObject<{
385
+ account: z.ZodOptional<z.ZodString>;
386
+ datetime: z.ZodNumber;
387
+ site: z.ZodString;
388
+ responseTimeMs: z.ZodNumber;
389
+ success: z.ZodBoolean;
390
+ }, z.core.$strip>>>;
391
+ languages: z.ZodOptional<z.ZodArray<z.ZodObject<{
392
+ account: z.ZodOptional<z.ZodString>;
393
+ datetime: z.ZodNumber;
394
+ site: z.ZodString;
395
+ language: z.ZodString;
396
+ count: z.ZodNumber;
397
+ category: z.ZodString;
398
+ }, z.core.$strip>>>;
399
+ rollups: z.ZodOptional<z.ZodArray<z.ZodObject<{
400
+ account: z.ZodString;
401
+ site: z.ZodString;
402
+ datetime: z.ZodNumber;
403
+ category: z.ZodString;
404
+ topReferrers: z.ZodOptional<z.ZodArray<z.ZodObject<{
405
+ referrer: z.ZodString;
406
+ count: z.ZodNumber;
407
+ }, z.core.$strip>>>;
408
+ topResolutions: z.ZodOptional<z.ZodArray<z.ZodObject<{
409
+ resolution: z.ZodString;
410
+ count: z.ZodNumber;
411
+ }, z.core.$strip>>>;
412
+ topFingerprints: z.ZodOptional<z.ZodArray<z.ZodObject<{
413
+ fingerprint: z.ZodString;
414
+ count: z.ZodNumber;
415
+ }, z.core.$strip>>>;
416
+ topQueries: z.ZodOptional<z.ZodArray<z.ZodObject<{
417
+ pathName: z.ZodString;
418
+ count: z.ZodNumber;
419
+ }, z.core.$strip>>>;
420
+ topLocations: z.ZodOptional<z.ZodArray<z.ZodObject<{
421
+ countryRegion: z.ZodString;
422
+ count: z.ZodNumber;
423
+ }, z.core.$strip>>>;
424
+ topBrowsers: z.ZodOptional<z.ZodArray<z.ZodObject<{
425
+ browser: z.ZodString;
426
+ count: z.ZodNumber;
427
+ }, z.core.$strip>>>;
428
+ topEvents: z.ZodOptional<z.ZodArray<z.ZodObject<{
429
+ eventName: z.ZodString;
430
+ count: z.ZodNumber;
431
+ }, z.core.$strip>>>;
432
+ topLanguages: z.ZodOptional<z.ZodArray<z.ZodObject<{
433
+ language: z.ZodString;
434
+ count: z.ZodNumber;
435
+ }, z.core.$strip>>>;
436
+ topErrors: z.ZodOptional<z.ZodArray<z.ZodObject<{
437
+ href: z.ZodString;
438
+ count: z.ZodNumber;
439
+ }, z.core.$strip>>>;
440
+ averageResponseTimeMs: z.ZodOptional<z.ZodNumber>;
441
+ }, z.core.$strip>>>;
442
+ errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
443
+ PK: z.ZodString;
444
+ messageHash: z.ZodOptional<z.ZodString>;
445
+ site: z.ZodString;
446
+ account: z.ZodString;
447
+ message: z.ZodOptional<z.ZodString>;
448
+ name: z.ZodOptional<z.ZodString>;
449
+ stack: z.ZodOptional<z.ZodString>;
450
+ href: z.ZodString;
451
+ filename: z.ZodOptional<z.ZodString>;
452
+ datetime: z.ZodNumber;
453
+ archived: z.ZodOptional<z.ZodBoolean>;
454
+ count: z.ZodNumber;
455
+ category: z.ZodString;
456
+ }, z.core.$strip>>>;
457
+ google: z.ZodOptional<z.ZodArray<z.ZodObject<{
458
+ account: z.ZodString;
459
+ email: z.ZodString;
460
+ site: z.ZodString;
461
+ datetime: z.ZodNumber;
462
+ category: z.ZodString;
463
+ totals: z.ZodObject<{
464
+ clicks: z.ZodNumber;
465
+ impressions: z.ZodNumber;
466
+ position: z.ZodNumber;
467
+ query: z.ZodString;
468
+ }, z.core.$strip>;
469
+ queries: z.ZodArray<z.ZodObject<{
470
+ clicks: z.ZodNumber;
471
+ impressions: z.ZodNumber;
472
+ position: z.ZodNumber;
473
+ query: z.ZodString;
474
+ }, z.core.$strip>>;
475
+ }, z.core.$strip>>>;
476
+ bing: z.ZodOptional<z.ZodArray<z.ZodObject<{
477
+ account: z.ZodString;
478
+ email: z.ZodString;
479
+ site: z.ZodString;
480
+ datetime: z.ZodNumber;
481
+ category: z.ZodString;
482
+ totals: z.ZodObject<{
483
+ clicks: z.ZodNumber;
484
+ impressions: z.ZodNumber;
485
+ position: z.ZodNumber;
486
+ query: z.ZodString;
487
+ }, z.core.$strip>;
488
+ queries: z.ZodArray<z.ZodObject<{
489
+ clicks: z.ZodNumber;
490
+ impressions: z.ZodNumber;
491
+ position: z.ZodNumber;
492
+ query: z.ZodString;
493
+ }, z.core.$strip>>;
494
+ }, z.core.$strip>>>;
495
+ }, z.core.$strip>;
496
+ export declare const PostAccountSchema: z.ZodObject<{
497
+ site: z.ZodString;
498
+ account: z.ZodString;
499
+ }, z.core.$strip>;
500
+ export declare const DeleteAccountSchema: z.ZodObject<{
501
+ site: z.ZodString;
502
+ account: z.ZodString;
503
+ }, z.core.$strip>;
504
+ export declare const ArchiveErrorsSchema: z.ZodObject<{
505
+ PKs: z.ZodArray<z.ZodString>;
506
+ }, z.core.$strip>;
507
+ export type SeoResultValues = z.infer<typeof SeoResultValuesSchema>;
508
+ export type SeoResult = z.infer<typeof SeoResultSchema>;
509
+ export type GetAccount = z.infer<typeof GetAccountSchema>;
510
+ export type GetAccounts = z.infer<typeof GetAccountsSchema>;
511
+ export type GoogleIntegration = z.infer<typeof GoogleIntegrationSchema>;
512
+ export type BingIntegration = z.infer<typeof BingIntegrationSchema>;
513
+ export type ApiKey = z.infer<typeof ApiKeySchema>;
514
+ export type Query = z.infer<typeof QuerySchema>;
515
+ export type Browser = z.infer<typeof BrowserSchema>;
516
+ export type Resolution = z.infer<typeof ResolutionSchema>;
517
+ export type Referrer = z.infer<typeof ReferrerSchema>;
518
+ export type Location = z.infer<typeof LocationSchema>;
519
+ export type Language = z.infer<typeof LanguageSchema>;
520
+ export type Fingerprint = z.infer<typeof FingerprintSchema>;
521
+ export type Event = z.infer<typeof EventSchema>;
522
+ export type Health = z.infer<typeof HealthSchema>;
523
+ export type ModelError = z.infer<typeof ModelErrorSchema>;
524
+ export type Rollup = z.infer<typeof RollupSchema>;
525
+ export type SiteData = z.infer<typeof SiteDataSchema>;
526
+ export type SiteDetails = z.infer<typeof SiteDetailsSchema>;
527
+ export type PostEventData = z.infer<typeof PostEventDataSchema>;
528
+ export type PostEvent = z.infer<typeof PostEventSchema>;
529
+ export type PostSiteTrackData = z.infer<typeof PostSiteTrackDataSchema>;
530
+ export type PostSiteTrack = z.infer<typeof PostSiteTrackSchema>;
531
+ export type PostErrorData = z.infer<typeof PostErrorDataSchema>;
532
+ export type PostError = z.infer<typeof PostErrorSchema>;
533
+ export type PostAccount = z.infer<typeof PostAccountSchema>;
534
+ export type DeleteAccount = z.infer<typeof DeleteAccountSchema>;
535
+ export type ArchiveErrors = z.infer<typeof ArchiveErrorsSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "analytica.click",
3
- "version": "0.0.517",
3
+ "version": "0.0.519",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -8,7 +8,7 @@
8
8
  "license": "ISC",
9
9
  "dependencies": {
10
10
  "@types/react": "^19.0.0",
11
- "ag-common": "0.0.747",
11
+ "ag-common": "0.0.752",
12
12
  "cross-env": "^7",
13
13
  "cross-fetch": "^4.0.0",
14
14
  "nodemon": "^3",
@@ -17,16 +17,14 @@
17
17
  "typescript": "^5"
18
18
  },
19
19
  "devDependencies": {
20
- "@types/node": "24.0.8",
21
- "esbuild": "0.25.5",
20
+ "@types/node": "24.2.1",
21
+ "esbuild": "0.25.8",
22
22
  "esbuild-node-externals": "1.18.0",
23
23
  "esbuild-plugin-d.ts": "1.1.0",
24
24
  "eslint": "8.57.1",
25
25
  "glob": "11.0.3",
26
26
  "npm-dts": "1.3.13",
27
- "rimraf": "6.0.1",
28
- "common": "0.0.2",
29
- "common-ui": "0.0.2"
27
+ "rimraf": "6.0.1"
30
28
  },
31
29
  "files": [
32
30
  "dist"