@siteline/core 1.0.2 → 1.0.3

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,6 +1,6 @@
1
1
  export declare const DEFAULT_ENDPOINT = "https://api.gptrends.io/v1/intake/pageview";
2
2
  export declare const DEFAULT_SDK_NAME = "@siteline/core";
3
- export declare const DEFAULT_SDK_VERSION = "1.0.1";
3
+ export declare const DEFAULT_SDK_VERSION = "1.0.3";
4
4
  export declare const DEFAULT_INTEGRATION_TYPE = "custom";
5
5
  export declare const WEBSITEKEY_PATTERN: RegExp;
6
6
  export declare const LIMITS: {
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,+CAA+C,CAAC;AAC7E,eAAO,MAAM,gBAAgB,mBAAmB,CAAC;AACjD,eAAO,MAAM,mBAAmB,UAAU,CAAC;AAC3C,eAAO,MAAM,wBAAwB,WAAW,CAAC;AAEjD,eAAO,MAAM,kBAAkB,QAAqD,CAAC;AAErF,eAAO,MAAM,MAAM;;;;;;;;;;;;;CAaT,CAAC;AAEX,eAAO,MAAM,UAAU,OAAO,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,+CAA+C,CAAC;AAC7E,eAAO,MAAM,gBAAgB,mBAAmB,CAAC;AACjD,eAAO,MAAM,mBAAmB,UAAU,CAAC;AAC3C,eAAO,MAAM,wBAAwB,WAAW,CAAC;AAEjD,eAAO,MAAM,kBAAkB,QAAwC,CAAC;AAExE,eAAO,MAAM,MAAM;;;;;;;;;;;;;CAaT,CAAC;AAEX,eAAO,MAAM,UAAU,OAAO,CAAC"}
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";class e extends Error{constructor(e){super(e),this.name="SitelineError"}}class t extends e{constructor(e){super(e),this.name="SitelineValidationError"}}const s=/^(siteline_secret|gptrends_secret)_[a-f0-9]{32}$/;exports.Siteline=class{constructor(e){if(!e.websiteKey?.match(s))throw new t("Invalid websiteKey format. Expected: siteline_secret_<32 hex chars>");if(this.key=e.websiteKey,this.endpoint=e.endpoint||"https://api.gptrends.io/v1/intake/pageview",this.debug=e.debug||!1,this.sdk=e.sdk||"@siteline/core",this.sdkVersion=e.sdkVersion||"1.0.1",this.integrationType=e.integrationType||"custom",!this.endpoint.startsWith("https://"))throw new t("Endpoint must use HTTPS");this.debug&&console.log("[Siteline] Siteline initialized")}track(e){const t=this.sanitize(e);this.send(t).catch(e=>{this.debug&&console.error("[Siteline] Track failed:",e.message)})}sanitize(e){return{websiteKey:this.key,url:(e.url+"").slice(0,2048),method:(e.method+"").toUpperCase().slice(0,10),status:Math.max(0,Math.min(999,Number(e.status)||0)),duration:Math.max(0,Math.min(3e5,Number(e.duration)||0)),userAgent:e.userAgent?(e.userAgent+"").slice(0,512):null,ref:e.ref?(e.ref+"").slice(0,2048):null,ip:e.ip?(e.ip+"").slice(0,45):null,integration_type:this.integrationType.slice(0,50),sdk:this.sdk.slice(0,50),sdk_version:this.sdkVersion.slice(0,20)}}async send(e){const t=new AbortController,s=setTimeout(()=>t.abort(),5e3);try{const s=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":`${this.sdk}/${this.sdkVersion}`},body:JSON.stringify(e),signal:t.signal});this.debug&&(s.ok?console.log("[Siteline] Tracked:",e.url):console.error("[Siteline] HTTP error:",s.status))}catch(e){this.debug&&console.error("[Siteline] Network error:",e.message)}finally{clearTimeout(s)}}},exports.SitelineError=e,exports.SitelineTransportError=class extends e{constructor(e){super(e),this.name="SitelineTransportError"}},exports.SitelineValidationError=t;
1
+ "use strict";class e extends Error{constructor(e){super(e),this.name="SitelineError"}}class t extends e{constructor(e){super(e),this.name="SitelineValidationError"}}const s=/^(siteline_secret|gptrends_secret)_/;exports.Siteline=class{constructor(e){if(!e.websiteKey?.match(s))throw new t("Invalid websiteKey format. Expected: siteline_secret_<32 hex chars>");this.key=e.websiteKey,this.endpoint=e.endpoint||"https://api.gptrends.io/v1/intake/pageview",this.debug=e.debug||!1,this.sdk=e.sdk||"@siteline/core",this.sdkVersion=e.sdkVersion||"1.0.3",this.integrationType=e.integrationType||"custom",this.debug&&console.log("[Siteline] Siteline initialized")}track(e){const t=this.sanitize(e);this.send(t).catch(e=>{this.debug&&console.error("[Siteline] Track failed:",e.message)})}sanitize(e){return{websiteKey:this.key,url:(e.url+"").slice(0,2048),method:(e.method+"").toUpperCase().slice(0,10),status:Math.max(0,Math.min(999,Number(e.status)||0)),duration:Math.max(0,Math.min(3e5,Number(e.duration)||0)),userAgent:e.userAgent?(e.userAgent+"").slice(0,512):null,ref:e.ref?(e.ref+"").slice(0,2048):null,ip:e.ip?(e.ip+"").slice(0,45):null,integration_type:this.integrationType.slice(0,50),sdk:this.sdk.slice(0,50),sdk_version:this.sdkVersion.slice(0,20)}}async send(e){const t=new AbortController,s=setTimeout(()=>t.abort(),5e3);try{const s=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":`${this.sdk}/${this.sdkVersion}`},body:JSON.stringify(e),signal:t.signal});this.debug&&(s.ok?console.log("[Siteline] Tracked:",e.url):console.error("[Siteline] HTTP error:",s.status))}catch(e){this.debug&&console.error("[Siteline] Network error:",e.message)}finally{clearTimeout(s)}}},exports.SitelineError=e,exports.SitelineTransportError=class extends e{constructor(e){super(e),this.name="SitelineTransportError"}},exports.SitelineValidationError=t;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/errors.ts","../src/constants.ts","../src/siteline.ts"],"sourcesContent":[null,null,null],"names":["SitelineError","Error","constructor","message","super","this","name","SitelineValidationError","WEBSITEKEY_PATTERN","config","websiteKey","match","key","endpoint","debug","sdk","sdkVersion","integrationType","startsWith","console","log","track","data","sanitized","sanitize","send","catch","err","error","url","String","slice","method","toUpperCase","status","Math","max","min","Number","duration","userAgent","ref","ip","integration_type","sdk_version","controller","AbortController","timeout","setTimeout","abort","res","fetch","headers","body","JSON","stringify","signal","ok","clearTimeout"],"mappings":"aAAM,MAAOA,UAAsBC,MACjC,WAAAC,CAAYC,GACVC,MAAMD,GACNE,KAAKC,KAAO,eACd,EAGI,MAAOC,UAAgCP,EAC3C,WAAAE,CAAYC,GACVC,MAAMD,GACNE,KAAKC,KAAO,yBACd,ECXK,MAKME,EAAqB,0ECehC,WAAAN,CAAYO,GACV,IAAKA,EAAOC,YAAYC,MAAMH,GAC5B,MAAM,IAAID,EACR,uEAWJ,GAPAF,KAAKO,IAAMH,EAAOC,WAClBL,KAAKQ,SAAWJ,EAAOI,UD5BK,6CC6B5BR,KAAKS,MAAQL,EAAOK,QAAS,EAC7BT,KAAKU,IAAMN,EAAOM,KD7BU,iBC8B5BV,KAAKW,WAAaP,EAAOO,YD7BM,QC8B/BX,KAAKY,gBAAkBR,EAAOQ,iBD7BM,UC+B/BZ,KAAKQ,SAASK,WAAW,YAC5B,MAAM,IAAIX,EAAwB,2BAGhCF,KAAKS,OACPK,QAAQC,IAAI,kCAEhB,CAEA,KAAAC,CAAMC,GACJ,MAAMC,EAAYlB,KAAKmB,SAASF,GAE3BjB,KAAKoB,KAAKF,GAAWG,MAAOC,IAC3BtB,KAAKS,OACPK,QAAQS,MAAM,2BAA4BD,EAAIxB,UAGpD,CAEQ,QAAAqB,CAASF,GACf,MAAO,CACLZ,WAAYL,KAAKO,IACjBiB,KAAYP,EAAKO,IAAZC,IAAiBC,MAAM,EDhDhB,MCiDZC,QAAeV,EAAKU,OAAZF,IAAoBG,cAAcF,MAAM,EDhDjC,ICiDfG,OAAQC,KAAKC,ID1CL,EC0C4BD,KAAKE,IDzCjC,ICyCwDC,OAAOhB,EAAKY,SAAW,IACvFK,SAAUJ,KAAKC,IDzCL,ECyC8BD,KAAKE,IDxCnC,ICwC4DC,OAAOhB,EAAKiB,WAAa,IAC/FC,UAAWlB,EAAKkB,WAAmBlB,EAAKkB,UAAZV,IAAuBC,MAAM,EDlDtC,KCkDyE,KAC5FU,IAAKnB,EAAKmB,KAAanB,EAAKmB,IAAZX,IAAiBC,MAAM,EDlD3B,MCkDuD,KACnEW,GAAIpB,EAAKoB,IAAYpB,EAAKoB,GAAZZ,IAAgBC,MAAM,EDlDzB,ICkDoD,KAC/DY,iBAAkBtC,KAAKY,gBAAgBc,MAAM,EDlDpB,ICmDzBhB,IAAKV,KAAKU,IAAIgB,MAAM,EDlDR,ICmDZa,YAAavC,KAAKW,WAAWe,MAAM,EDlDf,ICoDxB,CAEQ,UAAMN,CAAKH,GACjB,MAAMuB,EAAa,IAAIC,gBACjBC,EAAUC,WAAW,IAAMH,EAAWI,QDjDtB,KCmDtB,IACE,MAAMC,QAAYC,MAAM9C,KAAKQ,SAAU,CACrCmB,OAAQ,OACRoB,QAAS,CACP,eAAgB,mBAChB,aAAc,GAAG/C,KAAKU,OAAOV,KAAKW,cAEpCqC,KAAMC,KAAKC,UAAUjC,GACrBkC,OAAQX,EAAWW,SAGjBnD,KAAKS,QACHoC,EAAIO,GACNtC,QAAQC,IAAI,sBAAuBE,EAAKO,KAExCV,QAAQS,MAAM,yBAA0BsB,EAAIhB,QAGlD,CAAE,MAAOP,GACHtB,KAAKS,OAEPK,QAAQS,MAAM,4BADAD,EACmCxB,QAErD,SACEuD,aAAaX,EACf,CACF,0DFrFI,cAAsC/C,EAC1C,WAAAE,CAAYC,GACVC,MAAMD,GACNE,KAAKC,KAAO,wBACd"}
1
+ {"version":3,"file":"index.cjs","sources":["../src/errors.ts","../src/constants.ts","../src/siteline.ts"],"sourcesContent":[null,null,null],"names":["SitelineError","Error","constructor","message","super","this","name","SitelineValidationError","WEBSITEKEY_PATTERN","config","websiteKey","match","key","endpoint","debug","sdk","sdkVersion","integrationType","console","log","track","data","sanitized","sanitize","send","catch","err","error","url","String","slice","method","toUpperCase","status","Math","max","min","Number","duration","userAgent","ref","ip","integration_type","sdk_version","controller","AbortController","timeout","setTimeout","abort","res","fetch","headers","body","JSON","stringify","signal","ok","clearTimeout"],"mappings":"aAAM,MAAOA,UAAsBC,MACjC,WAAAC,CAAYC,GACVC,MAAMD,GACNE,KAAKC,KAAO,eACd,EAGI,MAAOC,UAAgCP,EAC3C,WAAAE,CAAYC,GACVC,MAAMD,GACNE,KAAKC,KAAO,yBACd,ECXK,MAKME,EAAqB,6DCehC,WAAAN,CAAYO,GACV,IAAKA,EAAOC,YAAYC,MAAMH,GAC5B,MAAM,IAAID,EACR,uEAIJF,KAAKO,IAAMH,EAAOC,WAClBL,KAAKQ,SAAWJ,EAAOI,UD5BK,6CC6B5BR,KAAKS,MAAQL,EAAOK,QAAS,EAC7BT,KAAKU,IAAMN,EAAOM,KD7BU,iBC8B5BV,KAAKW,WAAaP,EAAOO,YD7BM,QC8B/BX,KAAKY,gBAAkBR,EAAOQ,iBD7BM,SC+BhCZ,KAAKS,OACPI,QAAQC,IAAI,kCAEhB,CAEA,KAAAC,CAAMC,GACJ,MAAMC,EAAYjB,KAAKkB,SAASF,GAE3BhB,KAAKmB,KAAKF,GAAWG,MAAOC,IAC3BrB,KAAKS,OACPI,QAAQS,MAAM,2BAA4BD,EAAIvB,UAGpD,CAEQ,QAAAoB,CAASF,GACf,MAAO,CACLX,WAAYL,KAAKO,IACjBgB,KAAYP,EAAKO,IAAZC,IAAiBC,MAAM,ED5ChB,MC6CZC,QAAeV,EAAKU,OAAZF,IAAoBG,cAAcF,MAAM,ED5CjC,IC6CfG,OAAQC,KAAKC,IDtCL,ECsC4BD,KAAKE,IDrCjC,ICqCwDC,OAAOhB,EAAKY,SAAW,IACvFK,SAAUJ,KAAKC,IDrCL,ECqC8BD,KAAKE,IDpCnC,ICoC4DC,OAAOhB,EAAKiB,WAAa,IAC/FC,UAAWlB,EAAKkB,WAAmBlB,EAAKkB,UAAZV,IAAuBC,MAAM,ED9CtC,KC8CyE,KAC5FU,IAAKnB,EAAKmB,KAAanB,EAAKmB,IAAZX,IAAiBC,MAAM,ED9C3B,MC8CuD,KACnEW,GAAIpB,EAAKoB,IAAYpB,EAAKoB,GAAZZ,IAAgBC,MAAM,ED9CzB,IC8CoD,KAC/DY,iBAAkBrC,KAAKY,gBAAgBa,MAAM,ED9CpB,IC+CzBf,IAAKV,KAAKU,IAAIe,MAAM,ED9CR,IC+CZa,YAAatC,KAAKW,WAAWc,MAAM,ED9Cf,ICgDxB,CAEQ,UAAMN,CAAKH,GACjB,MAAMuB,EAAa,IAAIC,gBACjBC,EAAUC,WAAW,IAAMH,EAAWI,QD7CtB,KC+CtB,IACE,MAAMC,QAAYC,MAAM7C,KAAKQ,SAAU,CACrCkB,OAAQ,OACRoB,QAAS,CACP,eAAgB,mBAChB,aAAc,GAAG9C,KAAKU,OAAOV,KAAKW,cAEpCoC,KAAMC,KAAKC,UAAUjC,GACrBkC,OAAQX,EAAWW,SAGjBlD,KAAKS,QACHmC,EAAIO,GACNtC,QAAQC,IAAI,sBAAuBE,EAAKO,KAExCV,QAAQS,MAAM,yBAA0BsB,EAAIhB,QAGlD,CAAE,MAAOP,GACHrB,KAAKS,OAEPI,QAAQS,MAAM,4BADAD,EACmCvB,QAErD,SACEsD,aAAaX,EACf,CACF,0DFjFI,cAAsC9C,EAC1C,WAAAE,CAAYC,GACVC,MAAMD,GACNE,KAAKC,KAAO,wBACd"}
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- class e extends Error{constructor(e){super(e),this.name="SitelineError"}}class t extends e{constructor(e){super(e),this.name="SitelineValidationError"}}class s extends e{constructor(e){super(e),this.name="SitelineTransportError"}}const i=/^(siteline_secret|gptrends_secret)_[a-f0-9]{32}$/;class n{constructor(e){if(!e.websiteKey?.match(i))throw new t("Invalid websiteKey format. Expected: siteline_secret_<32 hex chars>");if(this.key=e.websiteKey,this.endpoint=e.endpoint||"https://api.gptrends.io/v1/intake/pageview",this.debug=e.debug||!1,this.sdk=e.sdk||"@siteline/core",this.sdkVersion=e.sdkVersion||"1.0.1",this.integrationType=e.integrationType||"custom",!this.endpoint.startsWith("https://"))throw new t("Endpoint must use HTTPS");this.debug&&console.log("[Siteline] Siteline initialized")}track(e){const t=this.sanitize(e);this.send(t).catch(e=>{this.debug&&console.error("[Siteline] Track failed:",e.message)})}sanitize(e){return{websiteKey:this.key,url:(e.url+"").slice(0,2048),method:(e.method+"").toUpperCase().slice(0,10),status:Math.max(0,Math.min(999,Number(e.status)||0)),duration:Math.max(0,Math.min(3e5,Number(e.duration)||0)),userAgent:e.userAgent?(e.userAgent+"").slice(0,512):null,ref:e.ref?(e.ref+"").slice(0,2048):null,ip:e.ip?(e.ip+"").slice(0,45):null,integration_type:this.integrationType.slice(0,50),sdk:this.sdk.slice(0,50),sdk_version:this.sdkVersion.slice(0,20)}}async send(e){const t=new AbortController,s=setTimeout(()=>t.abort(),5e3);try{const s=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":`${this.sdk}/${this.sdkVersion}`},body:JSON.stringify(e),signal:t.signal});this.debug&&(s.ok?console.log("[Siteline] Tracked:",e.url):console.error("[Siteline] HTTP error:",s.status))}catch(e){this.debug&&console.error("[Siteline] Network error:",e.message)}finally{clearTimeout(s)}}}export{n as Siteline,e as SitelineError,s as SitelineTransportError,t as SitelineValidationError};
1
+ class e extends Error{constructor(e){super(e),this.name="SitelineError"}}class t extends e{constructor(e){super(e),this.name="SitelineValidationError"}}class s extends e{constructor(e){super(e),this.name="SitelineTransportError"}}const i=/^(siteline_secret|gptrends_secret)_/;class r{constructor(e){if(!e.websiteKey?.match(i))throw new t("Invalid websiteKey format. Expected: siteline_secret_<32 hex chars>");this.key=e.websiteKey,this.endpoint=e.endpoint||"https://api.gptrends.io/v1/intake/pageview",this.debug=e.debug||!1,this.sdk=e.sdk||"@siteline/core",this.sdkVersion=e.sdkVersion||"1.0.3",this.integrationType=e.integrationType||"custom",this.debug&&console.log("[Siteline] Siteline initialized")}track(e){const t=this.sanitize(e);this.send(t).catch(e=>{this.debug&&console.error("[Siteline] Track failed:",e.message)})}sanitize(e){return{websiteKey:this.key,url:(e.url+"").slice(0,2048),method:(e.method+"").toUpperCase().slice(0,10),status:Math.max(0,Math.min(999,Number(e.status)||0)),duration:Math.max(0,Math.min(3e5,Number(e.duration)||0)),userAgent:e.userAgent?(e.userAgent+"").slice(0,512):null,ref:e.ref?(e.ref+"").slice(0,2048):null,ip:e.ip?(e.ip+"").slice(0,45):null,integration_type:this.integrationType.slice(0,50),sdk:this.sdk.slice(0,50),sdk_version:this.sdkVersion.slice(0,20)}}async send(e){const t=new AbortController,s=setTimeout(()=>t.abort(),5e3);try{const s=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":`${this.sdk}/${this.sdkVersion}`},body:JSON.stringify(e),signal:t.signal});this.debug&&(s.ok?console.log("[Siteline] Tracked:",e.url):console.error("[Siteline] HTTP error:",s.status))}catch(e){this.debug&&console.error("[Siteline] Network error:",e.message)}finally{clearTimeout(s)}}}export{r as Siteline,e as SitelineError,s as SitelineTransportError,t as SitelineValidationError};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../src/errors.ts","../src/constants.ts","../src/siteline.ts"],"sourcesContent":[null,null,null],"names":["SitelineError","Error","constructor","message","super","this","name","SitelineValidationError","SitelineTransportError","WEBSITEKEY_PATTERN","Siteline","config","websiteKey","match","key","endpoint","debug","sdk","sdkVersion","integrationType","startsWith","console","log","track","data","sanitized","sanitize","send","catch","err","error","url","String","slice","method","toUpperCase","status","Math","max","min","Number","duration","userAgent","ref","ip","integration_type","sdk_version","controller","AbortController","timeout","setTimeout","abort","res","fetch","headers","body","JSON","stringify","signal","ok","clearTimeout"],"mappings":"AAAM,MAAOA,UAAsBC,MACjC,WAAAC,CAAYC,GACVC,MAAMD,GACNE,KAAKC,KAAO,eACd,EAGI,MAAOC,UAAgCP,EAC3C,WAAAE,CAAYC,GACVC,MAAMD,GACNE,KAAKC,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pB,EAAKoB,GAAZZ,IAAgBC,MAAM,EDlDzB,ICkDoD,KAC/DY,iBAAkBxC,KAAKc,gBAAgBc,MAAM,EDlDpB,ICmDzBhB,IAAKZ,KAAKY,IAAIgB,MAAM,EDlDR,ICmDZa,YAAazC,KAAKa,WAAWe,MAAM,EDlDf,ICoDxB,CAEQ,UAAMN,CAAKH,GACjB,MAAMuB,EAAa,IAAIC,gBACjBC,EAAUC,WAAW,IAAMH,EAAWI,QDjDtB,KCmDtB,IACE,MAAMC,QAAYC,MAAMhD,KAAKU,SAAU,CACrCmB,OAAQ,OACRoB,QAAS,CACP,eAAgB,mBAChB,aAAc,GAAGjD,KAAKY,OAAOZ,KAAKa,cAEpCqC,KAAMC,KAAKC,UAAUjC,GACrBkC,OAAQX,EAAWW,SAGjBrD,KAAKW,QACHoC,EAAIO,GACNtC,QAAQC,IAAI,sBAAuBE,EAAKO,KAExCV,QAAQS,MAAM,yBAA0BsB,EAAIhB,QAGlD,CAAE,MAAOP,GACHxB,KAAKW,OAEPK,QAAQS,MAAM,4BADAD,EACmC1B,QAErD,SACEyD,aAAaX,EACf,CACF"}
1
+ {"version":3,"file":"index.mjs","sources":["../src/errors.ts","../src/constants.ts","../src/siteline.ts"],"sourcesContent":[null,null,null],"names":["SitelineError","Error","constructor","message","super","this","name","SitelineValidationError","SitelineTransportError","WEBSITEKEY_PATTERN","Siteline","config","websiteKey","match","key","endpoint","debug","sdk","sdkVersion","integrationType","console","log","track","data","sanitized","sanitize","send","catch","err","error","url","String","slice","method","toUpperCase","status","Math","max","min","Number","duration","userAgent","ref","ip","integration_type","sdk_version","controller","AbortController","timeout","setTimeout","abort","res","fetch","headers","body","JSON","stringify","signal","ok","clearTimeout"],"mappings":"AAAM,MAAOA,UAAsBC,MACjC,WAAAC,CAAYC,GACVC,MAAMD,GACNE,KAAKC,KAAO,eACd,EAGI,MAAOC,UAAgCP,EAC3C,WAAAE,CAAYC,GACVC,MAAMD,GACNE,KAAKC,KAAO,yBACd,EA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AAgBa,MAAM,ED9CpB,IC+CzBf,IAAKZ,KAAKY,IAAIe,MAAM,ED9CR,IC+CZa,YAAaxC,KAAKa,WAAWc,MAAM,ED9Cf,ICgDxB,CAEQ,UAAMN,CAAKH,GACjB,MAAMuB,EAAa,IAAIC,gBACjBC,EAAUC,WAAW,IAAMH,EAAWI,QD7CtB,KC+CtB,IACE,MAAMC,QAAYC,MAAM/C,KAAKU,SAAU,CACrCkB,OAAQ,OACRoB,QAAS,CACP,eAAgB,mBAChB,aAAc,GAAGhD,KAAKY,OAAOZ,KAAKa,cAEpCoC,KAAMC,KAAKC,UAAUjC,GACrBkC,OAAQX,EAAWW,SAGjBpD,KAAKW,QACHmC,EAAIO,GACNtC,QAAQC,IAAI,sBAAuBE,EAAKO,KAExCV,QAAQS,MAAM,yBAA0BsB,EAAIhB,QAGlD,CAAE,MAAOP,GACHvB,KAAKW,OAEPI,QAAQS,MAAM,4BADAD,EACmCzB,QAErD,SACEwD,aAAaX,EACf,CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"siteline.d.ts","sourceRoot":"","sources":["../src/siteline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAY5D,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAU;IAChC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;gBAE7B,MAAM,EAAE,cAAc;IAuBlC,KAAK,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI;IAU/B,OAAO,CAAC,QAAQ;YAgBF,IAAI;CA+BnB"}
1
+ {"version":3,"file":"siteline.d.ts","sourceRoot":"","sources":["../src/siteline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAY5D,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAU;IAChC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;gBAE7B,MAAM,EAAE,cAAc;IAmBlC,KAAK,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI;IAU/B,OAAO,CAAC,QAAQ;YAgBF,IAAI;CA+BnB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@siteline/core",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Core tracking SDK for Siteline - Agent Analytics platform for tracking AI agents, bots, and crawlers",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",