@fuul/sdk 1.1.5 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -44
- package/dist/ConversionService.d.ts +12 -0
- package/dist/ConversionService.d.ts.map +1 -0
- package/dist/EventService.d.ts +18 -0
- package/dist/EventService.d.ts.map +1 -0
- package/dist/{infrastructure/http/HttpClient.d.ts → HttpClient.d.ts} +2 -2
- package/dist/HttpClient.d.ts.map +1 -0
- package/dist/core.d.ts +58 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/index.d.ts +4 -49
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +488 -498
- package/dist/index.umd.js +3 -3
- package/dist/tracking.d.ts +8 -0
- package/dist/tracking.d.ts.map +1 -0
- package/dist/{infrastructure/conversions/dtos.d.ts → types/api.d.ts} +49 -27
- package/dist/types/api.d.ts.map +1 -0
- package/dist/types/sdk.d.ts +15 -0
- package/dist/types/sdk.d.ts.map +1 -0
- package/package.json +4 -4
- package/dist/constants.d.ts +0 -13
- package/dist/constants.d.ts.map +0 -1
- package/dist/infrastructure/conversions/conversionService.d.ts +0 -8
- package/dist/infrastructure/conversions/conversionService.d.ts.map +0 -1
- package/dist/infrastructure/conversions/dtos.d.ts.map +0 -1
- package/dist/infrastructure/http/HttpClient.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -42
- package/dist/types/index.d.ts.map +0 -1
- package/dist/utils/events.d.ts +0 -4
- package/dist/utils/events.d.ts.map +0 -1
- package/dist/utils/localStorage.d.ts +0 -14
- package/dist/utils/localStorage.d.ts.map +0 -1
- package/dist/utils/queryParams.d.ts +0 -2
- package/dist/utils/queryParams.d.ts.map +0 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(g,S){typeof exports=="object"&&typeof module<"u"?module.exports=S():typeof define=="function"&&define.amd?define(S):(g=typeof globalThis<"u"?globalThis:g||self,g.Fuul=S())})(this,function(){"use strict";var _n=Object.defineProperty;var Pn=(g,S,P)=>S in g?_n(g,S,{enumerable:!0,configurable:!0,writable:!0,value:P}):g[S]=P;var _=(g,S,P)=>(Pn(g,typeof S!="symbol"?S+"":S,P),P);class g{constructor(t){_(this,"httpClient");this.httpClient=t}async getAll(){const{data:t}=await this.httpClient.get("conversions");return t}}function S(e,t){return function(){return e.apply(t,arguments)}}const{toString:P}=Object.prototype,{getPrototypeOf:X}=Object,Q=(e=>t=>{const n=P.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),A=e=>(e=e.toLowerCase(),t=>Q(t)===e),q=e=>t=>typeof t===e,{isArray:x}=Array,U=q("undefined");function Ve(e){return e!==null&&!U(e)&&e.constructor!==null&&!U(e.constructor)&&N(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const de=A("ArrayBuffer");function We(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&de(e.buffer),t}const Ye=q("string"),N=q("function"),he=q("number"),Z=e=>e!==null&&typeof e=="object",Ge=e=>e===!0||e===!1,H=e=>{if(Q(e)!=="object")return!1;const t=X(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Xe=A("Date"),Qe=A("File"),Ze=A("Blob"),et=A("FileList"),tt=e=>Z(e)&&N(e.pipe),nt=e=>{const t="[object FormData]";return e&&(typeof FormData=="function"&&e instanceof FormData||P.call(e)===t||N(e.toString)&&e.toString()===t)},rt=A("URLSearchParams"),st=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function D(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),x(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let u;for(r=0;r<i;r++)u=o[r],t.call(null,e[u],u,e)}}function pe(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const me=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),ye=e=>!U(e)&&e!==me;function ee(){const{caseless:e}=ye(this)&&this||{},t={},n=(r,s)=>{const o=e&&pe(t,s)||s;H(t[o])&&H(r)?t[o]=ee(t[o],r):H(r)?t[o]=ee({},r):x(r)?t[o]=r.slice():t[o]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&D(arguments[r],n);return t}const ot=(e,t,n,{allOwnKeys:r}={})=>(D(t,(s,o)=>{n&&N(s)?e[o]=S(s,n):e[o]=s},{allOwnKeys:r}),e),it=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),at=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},ct=(e,t,n,r)=>{let s,o,i;const u={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!u[i]&&(t[i]=e[i],u[i]=!0);e=n!==!1&&X(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},ut=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},lt=e=>{if(!e)return null;if(x(e))return e;let t=e.length;if(!he(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},ft=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&X(Uint8Array)),dt=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},ht=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},pt=A("HTMLFormElement"),mt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Ee=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),yt=A("RegExp"),we=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};D(n,(s,o)=>{t(s,o,e)!==!1&&(r[o]=s)}),Object.defineProperties(e,r)},Et=e=>{we(e,(t,n)=>{if(N(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(N(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},wt=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return x(e)?r(e):r(String(e).split(t)),n},St=()=>{},gt=(e,t)=>(e=+e,Number.isFinite(e)?e:t),te="abcdefghijklmnopqrstuvwxyz",Se="0123456789",ge={DIGIT:Se,ALPHA:te,ALPHA_DIGIT:te+te.toUpperCase()+Se},Rt=(e=16,t=ge.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function bt(e){return!!(e&&N(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const a={isArray:x,isArrayBuffer:de,isBuffer:Ve,isFormData:nt,isArrayBufferView:We,isString:Ye,isNumber:he,isBoolean:Ge,isObject:Z,isPlainObject:H,isUndefined:U,isDate:Xe,isFile:Qe,isBlob:Ze,isRegExp:yt,isFunction:N,isStream:tt,isURLSearchParams:rt,isTypedArray:ft,isFileList:et,forEach:D,merge:ee,extend:ot,trim:st,stripBOM:it,inherits:at,toFlatObject:ct,kindOf:Q,kindOfTest:A,endsWith:ut,toArray:lt,forEachEntry:dt,matchAll:ht,isHTMLForm:pt,hasOwnProperty:Ee,hasOwnProp:Ee,reduceDescriptors:we,freezeMethods:Et,toObjectSet:wt,toCamelCase:mt,noop:St,toFiniteNumber:gt,findKey:pe,global:me,isContextDefined:ye,ALPHABET:ge,generateString:Rt,isSpecCompliantForm:bt,toJSONObject:e=>{const t=new Array(10),n=(r,s)=>{if(Z(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const o=x(r)?[]:{};return D(r,(i,u)=>{const d=n(i,s+1);!U(d)&&(o[u]=d)}),t[s]=void 0,o}}return r};return n(e,0)}};function m(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s)}a.inherits(m,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Re=m.prototype,be={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{be[e]={value:e}}),Object.defineProperties(m,be),Object.defineProperty(Re,"isAxiosError",{value:!0}),m.from=(e,t,n,r,s,o)=>{const i=Object.create(Re);return a.toFlatObject(e,i,function(d){return d!==Error.prototype},u=>u!=="isAxiosError"),m.call(i,e.message,t,n,r,s),i.cause=e,i.name=e.name,o&&Object.assign(i,o),i};const At=null;function ne(e){return a.isPlainObject(e)||a.isArray(e)}function Ae(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Oe(e,t,n){return e?e.concat(t).map(function(s,o){return s=Ae(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function Ot(e){return a.isArray(e)&&!e.some(ne)}const Tt=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function M(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(p,T){return!a.isUndefined(T[p])});const r=n.metaTokens,s=n.visitor||l,o=n.dots,i=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function c(f){if(f===null)return"";if(a.isDate(f))return f.toISOString();if(!d&&a.isBlob(f))throw new m("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(f)||a.isTypedArray(f)?d&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function l(f,p,T){let R=f;if(f&&!T&&typeof f=="object"){if(a.endsWith(p,"{}"))p=r?p:p.slice(0,-2),f=JSON.stringify(f);else if(a.isArray(f)&&Ot(f)||(a.isFileList(f)||a.endsWith(p,"[]"))&&(R=a.toArray(f)))return p=Ae(p),R.forEach(function(G,Tn){!(a.isUndefined(G)||G===null)&&t.append(i===!0?Oe([p],Tn,o):i===null?p:p+"[]",c(G))}),!1}return ne(f)?!0:(t.append(Oe(T,p,o),c(f)),!1)}const h=[],E=Object.assign(Tt,{defaultVisitor:l,convertValue:c,isVisitable:ne});function y(f,p){if(!a.isUndefined(f)){if(h.indexOf(f)!==-1)throw Error("Circular reference detected in "+p.join("."));h.push(f),a.forEach(f,function(R,F){(!(a.isUndefined(R)||R===null)&&s.call(t,R,a.isString(F)?F.trim():F,p,E))===!0&&y(R,p?p.concat(F):[F])}),h.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return y(e),t}function Te(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function re(e,t){this._pairs=[],e&&M(e,this,t)}const _e=re.prototype;_e.append=function(t,n){this._pairs.push([t,n])},_e.toString=function(t){const n=t?function(r){return t.call(this,r,Te)}:Te;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function _t(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Pe(e,t,n){if(!t)return e;const r=n&&n.encode||_t,s=n&&n.serialize;let o;if(s?o=s(t,n):o=a.isURLSearchParams(t)?t.toString():new re(t,n).toString(r),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Pt{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Ne=Pt,Ce={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Nt=typeof URLSearchParams<"u"?URLSearchParams:re,Ct=typeof FormData<"u"?FormData:null,xt=typeof Blob<"u"?Blob:null,It=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),Ft=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),b={isBrowser:!0,classes:{URLSearchParams:Nt,FormData:Ct,Blob:xt},isStandardBrowserEnv:It,isStandardBrowserWebWorkerEnv:Ft,protocols:["http","https","file","blob","url","data"]};function Ut(e,t){return M(e,new b.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,o){return b.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function Dt(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Lt(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}function xe(e){function t(n,r,s,o){let i=n[o++];const u=Number.isFinite(+i),d=o>=n.length;return i=!i&&a.isArray(s)?s.length:i,d?(a.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!u):((!s[i]||!a.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&a.isArray(s[i])&&(s[i]=Lt(s[i])),!u)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(Dt(r),s,n,0)}),n}return null}const Bt={"Content-Type":void 0};function kt(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const K={transitional:Ce,adapter:["xhr","http"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=a.isObject(t);if(o&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s&&s?JSON.stringify(xe(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Ut(t,this.formSerializer).toString();if((u=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return M(u?{"files[]":t}:t,d&&new d,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),kt(t)):t}],transformResponse:[function(t){const n=this.transitional||K.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(t&&a.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(u){if(i)throw u.name==="SyntaxError"?m.from(u,m.ERR_BAD_RESPONSE,this,null,this.response):u}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:b.classes.FormData,Blob:b.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};a.forEach(["delete","get","head"],function(t){K.headers[t]={}}),a.forEach(["post","put","patch"],function(t){K.headers[t]=a.merge(Bt)});const se=K,jt=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),qt=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
2
|
-
`).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&
|
|
3
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[Ie]=this[Ie]={accessors:{}}).accessors,s=this.prototype;function o(i){const u=L(i);r[u]||(vt(s,i),r[u]=!0)}return a.isArray(t)?t.forEach(o):o(t),this}}$.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.freezeMethods($.prototype),a.freezeMethods($);const O=$;function ie(e,t){const n=this||se,r=t||n,s=O.from(r.headers);let o=r.data;return a.forEach(e,function(u){o=u.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function Fe(e){return!!(e&&e.__CANCEL__)}function B(e,t,n){m.call(this,e??"canceled",m.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(B,m,{__CANCEL__:!0});function $t(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new m("Request failed with status code "+n.status,[m.ERR_BAD_REQUEST,m.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const zt=b.isStandardBrowserEnv?function(){return{write:function(n,r,s,o,i,u){const d=[];d.push(n+"="+encodeURIComponent(r)),a.isNumber(s)&&d.push("expires="+new Date(s).toGMTString()),a.isString(o)&&d.push("path="+o),a.isString(i)&&d.push("domain="+i),u===!0&&d.push("secure"),document.cookie=d.join("; ")},read:function(n){const r=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function Jt(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Vt(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function Ue(e,t){return e&&!Jt(t)?Vt(e,t):t}const Wt=b.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function s(o){let i=o;return t&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=s(window.location.href),function(i){const u=a.isString(i)?s(i):i;return u.protocol===r.protocol&&u.host===r.host}}():function(){return function(){return!0}}();function Yt(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Gt(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(d){const c=Date.now(),l=r[o];i||(i=c),n[s]=d,r[s]=c;let h=o,E=0;for(;h!==s;)E+=n[h++],h=h%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),c-i<t)return;const y=l&&c-l;return y?Math.round(E*1e3/y):void 0}}function De(e,t){let n=0;const r=Gt(50,250);return s=>{const o=s.loaded,i=s.lengthComputable?s.total:void 0,u=o-n,d=r(u),c=o<=i;n=o;const l={loaded:o,total:i,progress:i?o/i:void 0,bytes:u,rate:d||void 0,estimated:d&&i&&c?(i-o)/d:void 0,event:s};l[t?"download":"upload"]=!0,e(l)}}const z={http:At,xhr:typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){let s=e.data;const o=O.from(e.headers).normalize(),i=e.responseType;let u;function d(){e.cancelToken&&e.cancelToken.unsubscribe(u),e.signal&&e.signal.removeEventListener("abort",u)}a.isFormData(s)&&(b.isStandardBrowserEnv||b.isStandardBrowserWebWorkerEnv)&&o.setContentType(!1);let c=new XMLHttpRequest;if(e.auth){const y=e.auth.username||"",f=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(y+":"+f))}const l=Ue(e.baseURL,e.url);c.open(e.method.toUpperCase(),Pe(l,e.params,e.paramsSerializer),!0),c.timeout=e.timeout;function h(){if(!c)return;const y=O.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders()),p={data:!i||i==="text"||i==="json"?c.responseText:c.response,status:c.status,statusText:c.statusText,headers:y,config:e,request:c};$t(function(R){n(R),d()},function(R){r(R),d()},p),c=null}if("onloadend"in c?c.onloadend=h:c.onreadystatechange=function(){!c||c.readyState!==4||c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)||setTimeout(h)},c.onabort=function(){c&&(r(new m("Request aborted",m.ECONNABORTED,e,c)),c=null)},c.onerror=function(){r(new m("Network Error",m.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let f=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const p=e.transitional||Ce;e.timeoutErrorMessage&&(f=e.timeoutErrorMessage),r(new m(f,p.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,e,c)),c=null},b.isStandardBrowserEnv){const y=(e.withCredentials||Wt(l))&&e.xsrfCookieName&&zt.read(e.xsrfCookieName);y&&o.set(e.xsrfHeaderName,y)}s===void 0&&o.setContentType(null),"setRequestHeader"in c&&a.forEach(o.toJSON(),function(f,p){c.setRequestHeader(p,f)}),a.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),i&&i!=="json"&&(c.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&c.addEventListener("progress",De(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&c.upload&&c.upload.addEventListener("progress",De(e.onUploadProgress)),(e.cancelToken||e.signal)&&(u=y=>{c&&(r(!y||y.type?new B(null,e,c):y),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(u),e.signal&&(e.signal.aborted?u():e.signal.addEventListener("abort",u)));const E=Yt(l);if(E&&b.protocols.indexOf(E)===-1){r(new m("Unsupported protocol "+E+":",m.ERR_BAD_REQUEST,e));return}c.send(s||null)})}};a.forEach(z,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Xt={getAdapter:e=>{e=a.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let s=0;s<t&&(n=e[s],!(r=a.isString(n)?z[n.toLowerCase()]:n));s++);if(!r)throw r===!1?new m(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(a.hasOwnProp(z,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`);if(!a.isFunction(r))throw new TypeError("adapter is not a function");return r},adapters:z};function ae(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new B(null,e)}function Le(e){return ae(e),e.headers=O.from(e.headers),e.data=ie.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Xt.getAdapter(e.adapter||se.adapter)(e).then(function(r){return ae(e),r.data=ie.call(e,e.transformResponse,r),r.headers=O.from(r.headers),r},function(r){return Fe(r)||(ae(e),r&&r.response&&(r.response.data=ie.call(e,e.transformResponse,r.response),r.response.headers=O.from(r.response.headers))),Promise.reject(r)})}const Be=e=>e instanceof O?e.toJSON():e;function I(e,t){t=t||{};const n={};function r(c,l,h){return a.isPlainObject(c)&&a.isPlainObject(l)?a.merge.call({caseless:h},c,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function s(c,l,h){if(a.isUndefined(l)){if(!a.isUndefined(c))return r(void 0,c,h)}else return r(c,l,h)}function o(c,l){if(!a.isUndefined(l))return r(void 0,l)}function i(c,l){if(a.isUndefined(l)){if(!a.isUndefined(c))return r(void 0,c)}else return r(void 0,l)}function u(c,l,h){if(h in t)return r(c,l);if(h in e)return r(void 0,c)}const d={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:u,headers:(c,l)=>s(Be(c),Be(l),!0)};return a.forEach(Object.keys(e).concat(Object.keys(t)),function(l){const h=d[l]||s,E=h(e[l],t[l],l);a.isUndefined(E)&&h!==u||(n[l]=E)}),n}const ke="1.3.4",ce={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ce[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const je={};ce.transitional=function(t,n,r){function s(o,i){return"[Axios v"+ke+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,u)=>{if(t===!1)throw new m(s(i," has been removed"+(n?" in "+n:"")),m.ERR_DEPRECATED);return n&&!je[i]&&(je[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,u):!0}};function Qt(e,t,n){if(typeof e!="object")throw new m("options must be an object",m.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const u=e[o],d=u===void 0||i(u,o,e);if(d!==!0)throw new m("option "+o+" must be "+d,m.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new m("Unknown option "+o,m.ERR_BAD_OPTION)}}const ue={assertOptions:Qt,validators:ce},C=ue.validators;class J{constructor(t){this.defaults=t,this.interceptors={request:new Ne,response:new Ne}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=I(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&ue.assertOptions(r,{silentJSONParsing:C.transitional(C.boolean),forcedJSONParsing:C.transitional(C.boolean),clarifyTimeoutError:C.transitional(C.boolean)},!1),s!==void 0&&ue.assertOptions(s,{encode:C.function,serialize:C.function},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i;i=o&&a.merge(o.common,o[n.method]),i&&a.forEach(["delete","get","head","post","put","patch","common"],f=>{delete o[f]}),n.headers=O.concat(i,o);const u=[];let d=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(n)===!1||(d=d&&p.synchronous,u.unshift(p.fulfilled,p.rejected))});const c=[];this.interceptors.response.forEach(function(p){c.push(p.fulfilled,p.rejected)});let l,h=0,E;if(!d){const f=[Le.bind(this),void 0];for(f.unshift.apply(f,u),f.push.apply(f,c),E=f.length,l=Promise.resolve(n);h<E;)l=l.then(f[h++],f[h++]);return l}E=u.length;let y=n;for(h=0;h<E;){const f=u[h++],p=u[h++];try{y=f(y)}catch(T){p.call(this,T);break}}try{l=Le.call(this,y)}catch(f){return Promise.reject(f)}for(h=0,E=c.length;h<E;)l=l.then(c[h++],c[h++]);return l}getUri(t){t=I(this.defaults,t);const n=Ue(t.baseURL,t.url);return Pe(n,t.params,t.paramsSerializer)}}a.forEach(["delete","get","head","options"],function(t){J.prototype[t]=function(n,r){return this.request(I(r||{},{method:t,url:n,data:(r||{}).data}))}}),a.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,u){return this.request(I(u||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}J.prototype[t]=n(),J.prototype[t+"Form"]=n(!0)});const V=J;class le{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(u=>{r.subscribe(u),o=u}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,u){r.reason||(r.reason=new B(o,i,u),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new le(function(s){t=s}),cancel:t}}}const Zt=le;function en(e){return function(n){return e.apply(null,n)}}function tn(e){return a.isObject(e)&&e.isAxiosError===!0}const fe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(fe).forEach(([e,t])=>{fe[t]=e});const nn=fe;function qe(e){const t=new V(e),n=S(V.prototype.request,t);return a.extend(n,V.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return qe(I(e,s))},n}const w=qe(se);w.Axios=V,w.CanceledError=B,w.CancelToken=Zt,w.isCancel=Fe,w.VERSION=ke,w.toFormData=M,w.AxiosError=m,w.Cancel=w.CanceledError,w.all=function(t){return Promise.all(t)},w.spread=en,w.isAxiosError=tn,w.mergeConfig=I,w.AxiosHeaders=O,w.formToJSON=e=>xe(a.isHTMLForm(e)?new FormData(e):e),w.HttpStatusCode=nn,w.default=w;const rn=w,sn=e=>{let t="";return Object.keys(e).forEach(n=>{t=t===""?t+`?${n}=${e[n]}`:t+`&${n}=${e[n]}`}),t};class on{constructor(t){_(this,"client");_(this,"queryParams");this.client=rn.create({...t,headers:t.apiKey?this._getHeaders(t.apiKey):{}}),this.queryParams=t.queryParams?sn(t.queryParams):""}async get(t,n){return this.client.get(t+this.queryParams,{params:n})}async post(t,n){return this.client.post(t+this.queryParams,n)}async put(t,n){return this.client.put(t+this.queryParams,n)}async delete(t){return this.client.delete(t+this.queryParams)}_getHeaders(t){const n={};return n.Authorization=`Bearer ${t}`,n}}const He="fuul.session_id",Me="fuul.tracking_id",Ke="fuul.referrer_id",k="fuul.traffic_source",W="fuul.traffic_category",Y="fuul.traffic_title",ve="fuul.traffic_tag",an="fuul.traffic_origin_url",$e="fuul.sent",cn=6e4,un=["google.com","bing.com","yahoo.com"],ln=(e,t)=>{const n=Date.now(),r=`${$e}_${e}`,s={...t,timestamp:n};localStorage.setItem(r,JSON.stringify(s))},fn=(e,t)=>{const n=`${$e}_${e}`,r=localStorage.getItem(n);if(!r)return!0;const s=JSON.parse(r);if(Date.now()-s.timestamp>cn)return!0;if(t.metadata){const{tracking_id:d,project_id:c,referrer:l,source:h,category:E,title:y,tag:f}=t.metadata;return!(s.metadata.tracking_id===d&&s.metadata.project_id===c&&s.metadata.referrer===l&&s.metadata.source===h&&s.metadata.category===E&&s.metadata.title===y&&s.metadata.tag===f&&s.user_address===t.user_address)}return!0};let dn=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");const hn=()=>localStorage.getItem(He),ze=()=>localStorage.getItem(Me),pn=()=>localStorage.getItem(Ke),mn=()=>localStorage.getItem(k),yn=()=>localStorage.getItem(W),En=()=>localStorage.getItem(Y),wn=()=>localStorage.getItem(ve),j=typeof window>"u"||typeof document>"u",Je=()=>dn(),Sn=()=>{j||localStorage.setItem(He,Je())},gn=()=>{j||ze()||localStorage.setItem(Me,Je())},Rn=()=>{if(j)return;const e=new URLSearchParams(window.location.search);localStorage.setItem(Ke,e.get("referrer")??""),localStorage.setItem(k,e.get("source")??""),localStorage.setItem(W,e.get("category")??""),localStorage.setItem(Y,e.get("title")??""),localStorage.setItem(ve,e.get("tag")??""),localStorage.setItem(an,document.referrer??""),bn()},bn=()=>{const e=new URLSearchParams(window.location.search),t=e.get("source"),n=e.get("referrer");if(!t)if(n)localStorage.setItem(k,"affiliate"),localStorage.setItem(W,"affiliate"),localStorage.setItem(Y,"affiliate");else{const r=document.referrer;localStorage.setItem(W,r),localStorage.setItem(Y,r),un.includes(r)?localStorage.setItem(k,"organic"):localStorage.setItem(k,"direct")}},An=(e,t)=>`p=${t}&source=fuul&referrer=${e}`;class On{constructor(t,n={}){_(this,"apiKey");_(this,"BASE_API_URL","https://api.fuul.xyz/api/v1/");_(this,"httpClient");_(this,"settings");_(this,"conversionService");this.apiKey=t,this.settings=n,this.checkApiKey(),Sn(),gn(),Rn(),this.httpClient=new on({baseURL:n.baseApiUrl||this.BASE_API_URL,timeout:1e4,apiKey:this.apiKey,...this.settings.defaultQueryParams&&{queryParams:this.settings.defaultQueryParams}}),this.conversionService=new g(this.httpClient),this.init()}async init(){j||await this.sendEvent("pageview")}checkApiKey(){if(!this.apiKey)throw new Error("Fuul API key is required")}async sendEvent(t,n={},r={}){const s=hn(),o=ze(),i=pn(),u=mn(),d=yn(),c=En(),l=wn(),{userAddress:h,signature:E,signatureMessage:y}=r;if(!o)return;const f={name:t,event_args:n,metadata:{...i&&{referrer:i},session_id:s,tracking_id:o,source:u,category:d,title:c,tag:l},...h&&{user_address:h},...E&&{signature:E},...y&&{signature_message:y}};if(fn(t,f))try{await this.httpClient.post("events",f),ln(t,f)}catch(p){return p}}async sendConnectWalletEvent(t){await this.sendEvent("connect_wallet",{},t)}verifyConnection(){if(j)throw new Error('Fuul SDK is not supported in this environment. Please use "typeof window !== undefined" to check if you are in the browser environment.');window.alert("You are successfully connected to Fuul SDK! ✅")}generateTrackingLink({address:t,projectId:n,baseUrl:r}){return`${r??window.location.href}?${An(t,n)}`}async getAllConversions(){return this.conversionService.getAll()}}return On});
|
|
1
|
+
(function(S,g){typeof exports=="object"&&typeof module<"u"?g(exports):typeof define=="function"&&define.amd?define(["exports"],g):(S=typeof globalThis<"u"?globalThis:S||self,g(S.Fuul={}))})(this,function(S){"use strict";var jn=Object.defineProperty;var kn=(S,g,_)=>g in S?jn(S,g,{enumerable:!0,configurable:!0,writable:!0,value:_}):S[g]=_;var U=(S,g,_)=>(kn(S,typeof g!="symbol"?g+"":g,_),_);class g{constructor(t){U(this,"httpClient");this.httpClient=t.httpClient}async getAll(){const{data:t}=await this.httpClient.get("conversions");return t}}const _="fuul.sent",We=60;class Ye{constructor(t){U(this,"debug");U(this,"httpClient");this.httpClient=t.httpClient,this.debug=!!t.debug}async sendEvent(t){if(this.isDuplicate(t)){this.debug&&console.debug("Fuul SDK: Event is considered duplicate and will not be sent");return}await this.httpClient.post("events",t),this.debug&&console.debug(`Fuul SDK: Sent '${t.name}' event`),this.saveSentEvent(t)}isDuplicate(t){const n=`${_}_${t.name}`,r=localStorage.getItem(n);if(!r)return!1;const s=JSON.parse(r);if(this.getCurrentTimestamp()-s.timestamp>We)return!1;let d=!1;t.metadata&&(d=s.metadata.tracking_id===t.metadata.tracking_id&&s.metadata.project_id===t.metadata.project_id&&s.metadata.referrer===t.metadata.referrer&&s.metadata.source===t.metadata.source&&s.metadata.category===t.metadata.category&&s.metadata.title===t.metadata.title&&s.metadata.tag===t.metadata.tag&&s.user_address===t.user_address&&s.signature===t.signature&&s.signature_message===t.signature_message);let c=!1;return t.args&&s.args&&(c=s.args.page===t.args.page),c&&d}getCurrentTimestamp(){return Date.now()/1e3}saveSentEvent(t){const n=`${_}_${t.name}`,r=this.getCurrentTimestamp(),s={...t,timestamp:r};localStorage.setItem(n,JSON.stringify(s))}}function me(e,t){return function(){return e.apply(t,arguments)}}const{toString:ye}=Object.prototype,{getPrototypeOf:G}=Object,X=(e=>t=>{const n=ye.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),O=e=>(e=e.toLowerCase(),t=>X(t)===e),q=e=>t=>typeof t===e,{isArray:x}=Array,L=q("undefined");function Ge(e){return e!==null&&!L(e)&&e.constructor!==null&&!L(e.constructor)&&C(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Ee=O("ArrayBuffer");function Xe(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Ee(e.buffer),t}const Qe=q("string"),C=q("function"),we=q("number"),Q=e=>e!==null&&typeof e=="object",Ze=e=>e===!0||e===!1,H=e=>{if(X(e)!=="object")return!1;const t=G(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},et=O("Date"),tt=O("File"),nt=O("Blob"),rt=O("FileList"),st=e=>Q(e)&&C(e.pipe),ot=e=>{const t="[object FormData]";return e&&(typeof FormData=="function"&&e instanceof FormData||ye.call(e)===t||C(e.toString)&&e.toString()===t)},it=O("URLSearchParams"),at=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function B(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),x(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let u;for(r=0;r<i;r++)u=o[r],t.call(null,e[u],u,e)}}function ge(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const Se=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),be=e=>!L(e)&&e!==Se;function Z(){const{caseless:e}=be(this)&&this||{},t={},n=(r,s)=>{const o=e&&ge(t,s)||s;H(t[o])&&H(r)?t[o]=Z(t[o],r):H(r)?t[o]=Z({},r):x(r)?t[o]=r.slice():t[o]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&B(arguments[r],n);return t}const ct=(e,t,n,{allOwnKeys:r}={})=>(B(t,(s,o)=>{n&&C(s)?e[o]=me(s,n):e[o]=s},{allOwnKeys:r}),e),ut=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),lt=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},ft=(e,t,n,r)=>{let s,o,i;const u={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!u[i]&&(t[i]=e[i],u[i]=!0);e=n!==!1&&G(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},dt=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},pt=e=>{if(!e)return null;if(x(e))return e;let t=e.length;if(!we(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},ht=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&G(Uint8Array)),mt=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},yt=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Et=O("HTMLFormElement"),wt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Re=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),gt=O("RegExp"),Oe=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};B(n,(s,o)=>{t(s,o,e)!==!1&&(r[o]=s)}),Object.defineProperties(e,r)},St=e=>{Oe(e,(t,n)=>{if(C(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(C(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},bt=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return x(e)?r(e):r(String(e).split(t)),n},Rt=()=>{},Ot=(e,t)=>(e=+e,Number.isFinite(e)?e:t),ee="abcdefghijklmnopqrstuvwxyz",Ae="0123456789",Te={DIGIT:Ae,ALPHA:ee,ALPHA_DIGIT:ee+ee.toUpperCase()+Ae},At=(e=16,t=Te.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function Tt(e){return!!(e&&C(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const a={isArray:x,isArrayBuffer:Ee,isBuffer:Ge,isFormData:ot,isArrayBufferView:Xe,isString:Qe,isNumber:we,isBoolean:Ze,isObject:Q,isPlainObject:H,isUndefined:L,isDate:et,isFile:tt,isBlob:nt,isRegExp:gt,isFunction:C,isStream:st,isURLSearchParams:it,isTypedArray:ht,isFileList:rt,forEach:B,merge:Z,extend:ct,trim:at,stripBOM:ut,inherits:lt,toFlatObject:ft,kindOf:X,kindOfTest:O,endsWith:dt,toArray:pt,forEachEntry:mt,matchAll:yt,isHTMLForm:Et,hasOwnProperty:Re,hasOwnProp:Re,reduceDescriptors:Oe,freezeMethods:St,toObjectSet:bt,toCamelCase:wt,noop:Rt,toFiniteNumber:Ot,findKey:ge,global:Se,isContextDefined:be,ALPHABET:Te,generateString:At,isSpecCompliantForm:Tt,toJSONObject:e=>{const t=new Array(10),n=(r,s)=>{if(Q(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const o=x(r)?[]:{};return B(r,(i,u)=>{const d=n(i,s+1);!L(d)&&(o[u]=d)}),t[s]=void 0,o}}return r};return n(e,0)}};function m(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s)}a.inherits(m,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const _e=m.prototype,Ce={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Ce[e]={value:e}}),Object.defineProperties(m,Ce),Object.defineProperty(_e,"isAxiosError",{value:!0}),m.from=(e,t,n,r,s,o)=>{const i=Object.create(_e);return a.toFlatObject(e,i,function(d){return d!==Error.prototype},u=>u!=="isAxiosError"),m.call(i,e.message,t,n,r,s),i.cause=e,i.name=e.name,o&&Object.assign(i,o),i};const _t=null;function te(e){return a.isPlainObject(e)||a.isArray(e)}function Pe(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Ne(e,t,n){return e?e.concat(t).map(function(s,o){return s=Pe(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function Ct(e){return a.isArray(e)&&!e.some(te)}const Pt=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function K(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,T){return!a.isUndefined(T[h])});const r=n.metaTokens,s=n.visitor||l,o=n.dots,i=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function c(f){if(f===null)return"";if(a.isDate(f))return f.toISOString();if(!d&&a.isBlob(f))throw new m("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(f)||a.isTypedArray(f)?d&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function l(f,h,T){let b=f;if(f&&!T&&typeof f=="object"){if(a.endsWith(h,"{}"))h=r?h:h.slice(0,-2),f=JSON.stringify(f);else if(a.isArray(f)&&Ct(f)||(a.isFileList(f)||a.endsWith(h,"[]"))&&(b=a.toArray(f)))return h=Pe(h),b.forEach(function(Y,In){!(a.isUndefined(Y)||Y===null)&&t.append(i===!0?Ne([h],In,o):i===null?h:h+"[]",c(Y))}),!1}return te(f)?!0:(t.append(Ne(T,h,o),c(f)),!1)}const p=[],w=Object.assign(Pt,{defaultVisitor:l,convertValue:c,isVisitable:te});function y(f,h){if(!a.isUndefined(f)){if(p.indexOf(f)!==-1)throw Error("Circular reference detected in "+h.join("."));p.push(f),a.forEach(f,function(b,D){(!(a.isUndefined(b)||b===null)&&s.call(t,b,a.isString(D)?D.trim():D,h,w))===!0&&y(b,h?h.concat(D):[D])}),p.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return y(e),t}function xe(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function ne(e,t){this._pairs=[],e&&K(e,this,t)}const Fe=ne.prototype;Fe.append=function(t,n){this._pairs.push([t,n])},Fe.toString=function(t){const n=t?function(r){return t.call(this,r,xe)}:xe;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Nt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function De(e,t,n){if(!t)return e;const r=n&&n.encode||Nt,s=n&&n.serialize;let o;if(s?o=s(t,n):o=a.isURLSearchParams(t)?t.toString():new ne(t,n).toString(r),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class xt{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Ue=xt,Le={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ft=typeof URLSearchParams<"u"?URLSearchParams:ne,Dt=typeof FormData<"u"?FormData:null,Ut=typeof Blob<"u"?Blob:null,Lt=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),Bt=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),R={isBrowser:!0,classes:{URLSearchParams:Ft,FormData:Dt,Blob:Ut},isStandardBrowserEnv:Lt,isStandardBrowserWebWorkerEnv:Bt,protocols:["http","https","file","blob","url","data"]};function It(e,t){return K(e,new R.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,o){return R.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function jt(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function kt(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}function Be(e){function t(n,r,s,o){let i=n[o++];const u=Number.isFinite(+i),d=o>=n.length;return i=!i&&a.isArray(s)?s.length:i,d?(a.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!u):((!s[i]||!a.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&a.isArray(s[i])&&(s[i]=kt(s[i])),!u)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(jt(r),s,n,0)}),n}return null}const qt={"Content-Type":void 0};function Ht(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const z={transitional:Le,adapter:["xhr","http"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=a.isObject(t);if(o&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s&&s?JSON.stringify(Be(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return It(t,this.formSerializer).toString();if((u=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return K(u?{"files[]":t}:t,d&&new d,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),Ht(t)):t}],transformResponse:[function(t){const n=this.transitional||z.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(t&&a.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(u){if(i)throw u.name==="SyntaxError"?m.from(u,m.ERR_BAD_RESPONSE,this,null,this.response):u}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:R.classes.FormData,Blob:R.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};a.forEach(["delete","get","head"],function(t){z.headers[t]={}}),a.forEach(["post","put","patch"],function(t){z.headers[t]=a.merge(qt)});const re=z,Kt=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),zt=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
2
|
+
`).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&Kt[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Ie=Symbol("internals");function I(e){return e&&String(e).trim().toLowerCase()}function $(e){return e===!1||e==null?e:a.isArray(e)?e.map($):String(e)}function $t(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}function Jt(e){return/^[-_a-zA-Z]+$/.test(e.trim())}function se(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function Vt(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Mt(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,i){return this[r].call(this,t,s,o,i)},configurable:!0})})}class J{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(u,d,c){const l=I(d);if(!l)throw new Error("header name must be a non-empty string");const p=a.findKey(s,l);(!p||s[p]===void 0||c===!0||c===void 0&&s[p]!==!1)&&(s[p||d]=$(u))}const i=(u,d)=>a.forEach(u,(c,l)=>o(c,l,d));return a.isPlainObject(t)||t instanceof this.constructor?i(t,n):a.isString(t)&&(t=t.trim())&&!Jt(t)?i(zt(t),n):t!=null&&o(n,t,r),this}get(t,n){if(t=I(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return $t(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=I(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||se(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(i){if(i=I(i),i){const u=a.findKey(r,i);u&&(!n||se(r,r[u],u,n))&&(delete r[u],s=!0)}}return a.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||se(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,o)=>{const i=a.findKey(r,o);if(i){n[i]=$(s),delete n[o];return}const u=t?Vt(o):String(o).trim();u!==o&&delete n[o],n[u]=$(s),r[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
3
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[Ie]=this[Ie]={accessors:{}}).accessors,s=this.prototype;function o(i){const u=I(i);r[u]||(Mt(s,i),r[u]=!0)}return a.isArray(t)?t.forEach(o):o(t),this}}J.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.freezeMethods(J.prototype),a.freezeMethods(J);const A=J;function oe(e,t){const n=this||re,r=t||n,s=A.from(r.headers);let o=r.data;return a.forEach(e,function(u){o=u.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function je(e){return!!(e&&e.__CANCEL__)}function j(e,t,n){m.call(this,e??"canceled",m.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(j,m,{__CANCEL__:!0});function vt(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new m("Request failed with status code "+n.status,[m.ERR_BAD_REQUEST,m.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const Wt=R.isStandardBrowserEnv?function(){return{write:function(n,r,s,o,i,u){const d=[];d.push(n+"="+encodeURIComponent(r)),a.isNumber(s)&&d.push("expires="+new Date(s).toGMTString()),a.isString(o)&&d.push("path="+o),a.isString(i)&&d.push("domain="+i),u===!0&&d.push("secure"),document.cookie=d.join("; ")},read:function(n){const r=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function Yt(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Gt(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function ke(e,t){return e&&!Yt(t)?Gt(e,t):t}const Xt=R.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function s(o){let i=o;return t&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=s(window.location.href),function(i){const u=a.isString(i)?s(i):i;return u.protocol===r.protocol&&u.host===r.host}}():function(){return function(){return!0}}();function Qt(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Zt(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(d){const c=Date.now(),l=r[o];i||(i=c),n[s]=d,r[s]=c;let p=o,w=0;for(;p!==s;)w+=n[p++],p=p%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),c-i<t)return;const y=l&&c-l;return y?Math.round(w*1e3/y):void 0}}function qe(e,t){let n=0;const r=Zt(50,250);return s=>{const o=s.loaded,i=s.lengthComputable?s.total:void 0,u=o-n,d=r(u),c=o<=i;n=o;const l={loaded:o,total:i,progress:i?o/i:void 0,bytes:u,rate:d||void 0,estimated:d&&i&&c?(i-o)/d:void 0,event:s};l[t?"download":"upload"]=!0,e(l)}}const V={http:_t,xhr:typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){let s=e.data;const o=A.from(e.headers).normalize(),i=e.responseType;let u;function d(){e.cancelToken&&e.cancelToken.unsubscribe(u),e.signal&&e.signal.removeEventListener("abort",u)}a.isFormData(s)&&(R.isStandardBrowserEnv||R.isStandardBrowserWebWorkerEnv)&&o.setContentType(!1);let c=new XMLHttpRequest;if(e.auth){const y=e.auth.username||"",f=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(y+":"+f))}const l=ke(e.baseURL,e.url);c.open(e.method.toUpperCase(),De(l,e.params,e.paramsSerializer),!0),c.timeout=e.timeout;function p(){if(!c)return;const y=A.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders()),h={data:!i||i==="text"||i==="json"?c.responseText:c.response,status:c.status,statusText:c.statusText,headers:y,config:e,request:c};vt(function(b){n(b),d()},function(b){r(b),d()},h),c=null}if("onloadend"in c?c.onloadend=p:c.onreadystatechange=function(){!c||c.readyState!==4||c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)||setTimeout(p)},c.onabort=function(){c&&(r(new m("Request aborted",m.ECONNABORTED,e,c)),c=null)},c.onerror=function(){r(new m("Network Error",m.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let f=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const h=e.transitional||Le;e.timeoutErrorMessage&&(f=e.timeoutErrorMessage),r(new m(f,h.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,e,c)),c=null},R.isStandardBrowserEnv){const y=(e.withCredentials||Xt(l))&&e.xsrfCookieName&&Wt.read(e.xsrfCookieName);y&&o.set(e.xsrfHeaderName,y)}s===void 0&&o.setContentType(null),"setRequestHeader"in c&&a.forEach(o.toJSON(),function(f,h){c.setRequestHeader(h,f)}),a.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),i&&i!=="json"&&(c.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&c.addEventListener("progress",qe(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&c.upload&&c.upload.addEventListener("progress",qe(e.onUploadProgress)),(e.cancelToken||e.signal)&&(u=y=>{c&&(r(!y||y.type?new j(null,e,c):y),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(u),e.signal&&(e.signal.aborted?u():e.signal.addEventListener("abort",u)));const w=Qt(l);if(w&&R.protocols.indexOf(w)===-1){r(new m("Unsupported protocol "+w+":",m.ERR_BAD_REQUEST,e));return}c.send(s||null)})}};a.forEach(V,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const en={getAdapter:e=>{e=a.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let s=0;s<t&&(n=e[s],!(r=a.isString(n)?V[n.toLowerCase()]:n));s++);if(!r)throw r===!1?new m(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(a.hasOwnProp(V,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`);if(!a.isFunction(r))throw new TypeError("adapter is not a function");return r},adapters:V};function ie(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new j(null,e)}function He(e){return ie(e),e.headers=A.from(e.headers),e.data=oe.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),en.getAdapter(e.adapter||re.adapter)(e).then(function(r){return ie(e),r.data=oe.call(e,e.transformResponse,r),r.headers=A.from(r.headers),r},function(r){return je(r)||(ie(e),r&&r.response&&(r.response.data=oe.call(e,e.transformResponse,r.response),r.response.headers=A.from(r.response.headers))),Promise.reject(r)})}const Ke=e=>e instanceof A?e.toJSON():e;function F(e,t){t=t||{};const n={};function r(c,l,p){return a.isPlainObject(c)&&a.isPlainObject(l)?a.merge.call({caseless:p},c,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function s(c,l,p){if(a.isUndefined(l)){if(!a.isUndefined(c))return r(void 0,c,p)}else return r(c,l,p)}function o(c,l){if(!a.isUndefined(l))return r(void 0,l)}function i(c,l){if(a.isUndefined(l)){if(!a.isUndefined(c))return r(void 0,c)}else return r(void 0,l)}function u(c,l,p){if(p in t)return r(c,l);if(p in e)return r(void 0,c)}const d={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:u,headers:(c,l)=>s(Ke(c),Ke(l),!0)};return a.forEach(Object.keys(e).concat(Object.keys(t)),function(l){const p=d[l]||s,w=p(e[l],t[l],l);a.isUndefined(w)&&p!==u||(n[l]=w)}),n}const ze="1.3.4",ae={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ae[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const $e={};ae.transitional=function(t,n,r){function s(o,i){return"[Axios v"+ze+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,u)=>{if(t===!1)throw new m(s(i," has been removed"+(n?" in "+n:"")),m.ERR_DEPRECATED);return n&&!$e[i]&&($e[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,u):!0}};function tn(e,t,n){if(typeof e!="object")throw new m("options must be an object",m.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const u=e[o],d=u===void 0||i(u,o,e);if(d!==!0)throw new m("option "+o+" must be "+d,m.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new m("Unknown option "+o,m.ERR_BAD_OPTION)}}const ce={assertOptions:tn,validators:ae},P=ce.validators;class M{constructor(t){this.defaults=t,this.interceptors={request:new Ue,response:new Ue}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=F(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&ce.assertOptions(r,{silentJSONParsing:P.transitional(P.boolean),forcedJSONParsing:P.transitional(P.boolean),clarifyTimeoutError:P.transitional(P.boolean)},!1),s!==void 0&&ce.assertOptions(s,{encode:P.function,serialize:P.function},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i;i=o&&a.merge(o.common,o[n.method]),i&&a.forEach(["delete","get","head","post","put","patch","common"],f=>{delete o[f]}),n.headers=A.concat(i,o);const u=[];let d=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(n)===!1||(d=d&&h.synchronous,u.unshift(h.fulfilled,h.rejected))});const c=[];this.interceptors.response.forEach(function(h){c.push(h.fulfilled,h.rejected)});let l,p=0,w;if(!d){const f=[He.bind(this),void 0];for(f.unshift.apply(f,u),f.push.apply(f,c),w=f.length,l=Promise.resolve(n);p<w;)l=l.then(f[p++],f[p++]);return l}w=u.length;let y=n;for(p=0;p<w;){const f=u[p++],h=u[p++];try{y=f(y)}catch(T){h.call(this,T);break}}try{l=He.call(this,y)}catch(f){return Promise.reject(f)}for(p=0,w=c.length;p<w;)l=l.then(c[p++],c[p++]);return l}getUri(t){t=F(this.defaults,t);const n=ke(t.baseURL,t.url);return De(n,t.params,t.paramsSerializer)}}a.forEach(["delete","get","head","options"],function(t){M.prototype[t]=function(n,r){return this.request(F(r||{},{method:t,url:n,data:(r||{}).data}))}}),a.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,u){return this.request(F(u||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}M.prototype[t]=n(),M.prototype[t+"Form"]=n(!0)});const v=M;class ue{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(u=>{r.subscribe(u),o=u}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,u){r.reason||(r.reason=new j(o,i,u),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new ue(function(s){t=s}),cancel:t}}}const nn=ue;function rn(e){return function(n){return e.apply(null,n)}}function sn(e){return a.isObject(e)&&e.isAxiosError===!0}const le={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(le).forEach(([e,t])=>{le[t]=e});const on=le;function Je(e){const t=new v(e),n=me(v.prototype.request,t);return a.extend(n,v.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return Je(F(e,s))},n}const E=Je(re);E.Axios=v,E.CanceledError=j,E.CancelToken=nn,E.isCancel=je,E.VERSION=ze,E.toFormData=K,E.AxiosError=m,E.Cancel=E.CanceledError,E.all=function(t){return Promise.all(t)},E.spread=rn,E.isAxiosError=sn,E.mergeConfig=F,E.AxiosHeaders=A,E.formToJSON=e=>Be(a.isHTMLForm(e)?new FormData(e):e),E.HttpStatusCode=on,E.default=E;const an=E;class cn{constructor(t){U(this,"client");U(this,"queryParams");this.client=an.create({...t,headers:{Authorization:`Bearer ${t.apiKey}`}}),this.queryParams=t.queryParams?this.buildQueryParams(t.queryParams):""}buildQueryParams(t){let n="";return Object.keys(t).forEach(r=>{n=n===""?n+`?${r}=${t[r]}`:n+`&${r}=${t[r]}`}),n}async get(t,n){return this.client.get(t+this.queryParams,{params:n})}async post(t,n){return this.client.post(t+this.queryParams,n)}async put(t,n){return this.client.put(t+this.queryParams,n)}async delete(t){return this.client.delete(t+this.queryParams)}}let un=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");const ln="fuul.tracking_id",fn="fuul.affiliate_id",dn="fuul.traffic_source",pn="fuul.traffic_category",hn="fuul.traffic_title",mn="fuul.traffic_tag",yn=["google.com","bing.com","yahoo.com"],En=()=>An(ln,()=>un()),wn=()=>k(()=>N("af")||N("referrer"),fn),gn=()=>document.referrer,Sn=()=>k(()=>Tn(),dn),bn=()=>k(()=>N("category"),pn),Rn=()=>k(()=>N("title"),hn),On=()=>k(()=>N("tag"),mn);function An(e,t){const n=localStorage.getItem(e);if(n)return n;{const r=t();return r?localStorage.setItem(e,r):localStorage.removeItem(e),r}}function k(e,t){const n=e();return n?(localStorage.setItem(t,n),n):localStorage.getItem(t)}function N(e){return new URLSearchParams(window.location.search).get(e)}function Tn(){const e=N("source"),t=N("af")||N("referrer");if(e)return e;if(t)return"affiliate";const n=document.referrer;return yn.includes(n)?"organic":"direct"}const _n="https://api.fuul.xyz/api/v1/";let W=!1,fe=!1,de,pe,Ve,Me;function Cn(e){W=!!e.debug,!fe&&(de=e.apiKey,Un(),pe=Ln(e.baseApiUrl??_n,e.defaultQueryParams??{}),Ve=new g({httpClient:pe,debug:W}),Me=new Ye({httpClient:pe,debug:W}),fe=!0,W&&console.debug("Fuul SDK: init() complete"))}function ve(){if(!fe)throw new Error("Fuul SDK: You need to call init() to initialize the library before using any methods")}async function he(e,t,n){ve(),Dn();const r=En(),s=wn(),o=Sn(),i=bn(),u=Rn(),d=On(),c=gn(),l={name:e,args:t||{},metadata:{tracking_id:r??""}};n!=null&&n.address&&(l.user_address=n.address),n!=null&&n.signature&&(l.signature=n==null?void 0:n.signature,l.signature_message=n==null?void 0:n.message),s&&(l.metadata.referrer=s,l.metadata.affiliate_id=s),c&&(l.metadata.referrer_url=c),o&&(l.metadata.source=o),i&&(l.metadata.category=i),u&&(l.metadata.title=u),d&&(l.metadata.tag=d),Me.sendEvent(l)}async function Pn(e){await he("pageview",{page:e??document.location.pathname,locationOrigin:document.location.origin})}async function Nn(e){await he("connect_wallet",{},e)}function xn(e,t,n){return`${e}?p=${n}&source=fuul&referrer=${t}`}async function Fn(){return ve(),Ve.getAll()}function Dn(){if(typeof window>"u"||typeof document>"u")throw new Error("Fuul SDK: Browser context required")}function Un(){if(!de)throw new Error("Fuul SDK: Invalid API key")}function Ln(e,t){return new cn({baseURL:e,timeout:1e4,apiKey:de,queryParams:t})}const Bn={init:Cn,sendEvent:he,sendPageview:Pn,sendConnectWallet:Nn,generateTrackingLink:xn,getConversions:Fn};S.Fuul=Bn,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const getTrackingId: () => string | null;
|
|
2
|
+
export declare const getAffiliateId: () => string | null;
|
|
3
|
+
export declare const getReferrerUrl: () => string;
|
|
4
|
+
export declare const getTrafficSource: () => string | null;
|
|
5
|
+
export declare const getTrafficCategory: () => string | null;
|
|
6
|
+
export declare const getTrafficTitle: () => string | null;
|
|
7
|
+
export declare const getTrafficTag: () => string | null;
|
|
8
|
+
//# sourceMappingURL=tracking.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracking.d.ts","sourceRoot":"","sources":["../../src/tracking.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,aAAa,qBAA4D,CAAC;AACvF,eAAO,MAAM,cAAc,qBACmE,CAAC;AAC/F,eAAO,MAAM,cAAc,cAA0B,CAAC;AACtD,eAAO,MAAM,gBAAgB,qBAAqE,CAAC;AACnG,eAAO,MAAM,kBAAkB,qBAAkF,CAAC;AAClH,eAAO,MAAM,eAAe,qBAA4E,CAAC;AACzG,eAAO,MAAM,aAAa,qBAAwE,CAAC"}
|
|
@@ -1,4 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
export type FuulEventArgs = {
|
|
2
|
+
[key: string]: unknown;
|
|
3
|
+
};
|
|
4
|
+
export type FuulEventMetadata = {
|
|
5
|
+
tracking_id: string;
|
|
6
|
+
referrer?: string;
|
|
7
|
+
affiliate_id?: string;
|
|
8
|
+
referrer_url?: string;
|
|
9
|
+
project_id?: string;
|
|
10
|
+
source?: string;
|
|
11
|
+
category?: string;
|
|
12
|
+
title?: string;
|
|
13
|
+
tag?: string;
|
|
14
|
+
};
|
|
15
|
+
export type FuulEvent = {
|
|
16
|
+
name: string;
|
|
17
|
+
user_address?: string;
|
|
18
|
+
signature?: string;
|
|
19
|
+
signature_message?: string;
|
|
20
|
+
args?: FuulEventArgs;
|
|
21
|
+
metadata: FuulEventMetadata;
|
|
22
|
+
};
|
|
23
|
+
type ConversionPaymentActionArgs = {
|
|
2
24
|
payment_type: string;
|
|
3
25
|
payment_currency: string;
|
|
4
26
|
referral_amount?: string;
|
|
@@ -6,8 +28,8 @@ interface ConversionPaymentActionArgs {
|
|
|
6
28
|
referrer_amount_percentage?: number;
|
|
7
29
|
referral_amount_percentage?: number;
|
|
8
30
|
payment_argument?: string;
|
|
9
|
-
}
|
|
10
|
-
export
|
|
31
|
+
};
|
|
32
|
+
export type Contract = {
|
|
11
33
|
address: string;
|
|
12
34
|
createdAt: string;
|
|
13
35
|
deletedAt: null;
|
|
@@ -15,13 +37,13 @@ export interface ContractDTO {
|
|
|
15
37
|
network: string;
|
|
16
38
|
sentinelId: null;
|
|
17
39
|
updatedAt: string;
|
|
18
|
-
}
|
|
19
|
-
export
|
|
40
|
+
};
|
|
41
|
+
export type AbiInput = {
|
|
20
42
|
name: string;
|
|
21
43
|
type: string;
|
|
22
44
|
internalType: string;
|
|
23
|
-
}
|
|
24
|
-
export
|
|
45
|
+
};
|
|
46
|
+
export type Trigger = {
|
|
25
47
|
id: string;
|
|
26
48
|
projectId: string;
|
|
27
49
|
name: string;
|
|
@@ -32,52 +54,52 @@ export interface TriggerDTO {
|
|
|
32
54
|
ref: string;
|
|
33
55
|
contractAddress: string;
|
|
34
56
|
contract_address: string;
|
|
35
|
-
contracts?:
|
|
57
|
+
contracts?: Contract[];
|
|
36
58
|
createdAt: string;
|
|
37
59
|
updatedAt: string;
|
|
38
60
|
deletedAt?: string;
|
|
39
61
|
arguments?: AbiInput[];
|
|
40
62
|
condition_expression?: string;
|
|
41
|
-
}
|
|
63
|
+
};
|
|
42
64
|
declare enum ProjectIntegrationType {
|
|
43
65
|
FUUL_HOSTED = "FUUL_HOSTED",
|
|
44
66
|
HYBRID = "HYBRID",
|
|
45
67
|
PROJECT_HOSTED = "PROJECT_HOSTED"
|
|
46
68
|
}
|
|
47
|
-
|
|
69
|
+
type ProjectSettings = {
|
|
48
70
|
validateEventSignature?: boolean;
|
|
49
71
|
integrationType?: ProjectIntegrationType;
|
|
50
72
|
userLandingPageUrl?: string;
|
|
51
73
|
partnerLandingPageUrl?: string;
|
|
52
74
|
userOnboardingPageUrl?: string;
|
|
53
|
-
}
|
|
54
|
-
|
|
75
|
+
};
|
|
76
|
+
type ApiKey = {
|
|
55
77
|
id: string;
|
|
56
78
|
token: string;
|
|
57
|
-
}
|
|
58
|
-
|
|
79
|
+
};
|
|
80
|
+
type ProjectTeamMember = {
|
|
59
81
|
id: string;
|
|
60
82
|
address: string;
|
|
61
83
|
role: string;
|
|
62
84
|
enabled: boolean;
|
|
63
|
-
}
|
|
64
|
-
export
|
|
85
|
+
};
|
|
86
|
+
export type Project = {
|
|
65
87
|
category: string;
|
|
66
|
-
conversions:
|
|
88
|
+
conversions: Conversion[] | [];
|
|
67
89
|
description: string;
|
|
68
90
|
slug: string;
|
|
69
91
|
id: string;
|
|
70
92
|
name: string;
|
|
71
93
|
thumbnail_url: string;
|
|
72
|
-
triggers:
|
|
94
|
+
triggers: Trigger[] | [];
|
|
73
95
|
twitter_handle: string;
|
|
74
96
|
website_url: string;
|
|
75
|
-
settings:
|
|
97
|
+
settings: ProjectSettings;
|
|
76
98
|
contract_address: string;
|
|
77
|
-
api_keys:
|
|
78
|
-
team_members:
|
|
79
|
-
}
|
|
80
|
-
export
|
|
99
|
+
api_keys: ApiKey[] | [];
|
|
100
|
+
team_members: ProjectTeamMember[] | [];
|
|
101
|
+
};
|
|
102
|
+
export type Conversion = {
|
|
81
103
|
action_args?: ConversionPaymentActionArgs;
|
|
82
104
|
action_type?: string;
|
|
83
105
|
attribution_type: string;
|
|
@@ -85,19 +107,19 @@ export interface ConversionDTO {
|
|
|
85
107
|
created_at: string;
|
|
86
108
|
id: string;
|
|
87
109
|
name: string;
|
|
88
|
-
project:
|
|
110
|
+
project: Project;
|
|
89
111
|
rule: {
|
|
90
112
|
expression: string;
|
|
91
113
|
prettified_expression: string;
|
|
92
114
|
timeframe_seconds: number;
|
|
93
115
|
};
|
|
94
|
-
triggers:
|
|
116
|
+
triggers: Trigger[];
|
|
95
117
|
total_converted?: number;
|
|
96
118
|
conversion_rate?: number;
|
|
97
119
|
payout?: {
|
|
98
120
|
amount: number;
|
|
99
121
|
currency: string;
|
|
100
122
|
};
|
|
101
|
-
}
|
|
123
|
+
};
|
|
102
124
|
export {};
|
|
103
|
-
//# sourceMappingURL=
|
|
125
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/types/api.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,WAAW,EAAE,MA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Params?: Record<string, string>;
|
|
6
|
+
};
|
|
7
|
+
export type UserMetadata = {
|
|
8
|
+
address: string;
|
|
9
|
+
signature?: string;
|
|
10
|
+
message?: string;
|
|
11
|
+
};
|
|
12
|
+
export type EventArgs = {
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=sdk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../../src/types/sdk.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fuul/sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Fuul SDK",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Fuul",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"lint:fix": "eslint --fix 'src/**/*.{js,json,ts}'",
|
|
15
15
|
"format": "prettier --write 'src/**/*.{js,json,ts}' --config ./.prettierrc",
|
|
16
16
|
"semantic-release": "semantic-release",
|
|
17
|
-
"test": "jest --coverage
|
|
17
|
+
"test": "jest --coverage",
|
|
18
18
|
"test:ci": "jest --ci --passWithNoTests"
|
|
19
19
|
},
|
|
20
20
|
"husky": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@semantic-release/git": "^10.0.1",
|
|
38
38
|
"@semantic-release/npm": "^9.0.2",
|
|
39
|
-
"@types/jest": "^29.5.
|
|
39
|
+
"@types/jest": "^29.5.4",
|
|
40
40
|
"@types/node": "^18.11.18",
|
|
41
41
|
"@typescript-eslint/eslint-plugin": "^5.58.0",
|
|
42
42
|
"@typescript-eslint/parser": "^5.58.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"eslint-plugin-prettier": "^4.2.1",
|
|
46
46
|
"eslint-plugin-simple-import-sort": "^10.0.0",
|
|
47
47
|
"husky": "^8.0.3",
|
|
48
|
-
"jest": "^29.6.
|
|
48
|
+
"jest": "^29.6.4",
|
|
49
49
|
"jest-environment-jsdom": "^29.6.2",
|
|
50
50
|
"jest-localstorage-mock": "^2.4.26",
|
|
51
51
|
"prettier": "^2.8.7",
|
package/dist/constants.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare const SESSION_ID_KEY = "fuul.session_id";
|
|
2
|
-
export declare const TRACKING_ID_KEY = "fuul.tracking_id";
|
|
3
|
-
export declare const PROJECT_ID_KEY = "fuul.project_id";
|
|
4
|
-
export declare const REFERRER_ID_KEY = "fuul.referrer_id";
|
|
5
|
-
export declare const TRAFFIC_SOURCE_KEY = "fuul.traffic_source";
|
|
6
|
-
export declare const TRAFFIC_CATEGORY_KEY = "fuul.traffic_category";
|
|
7
|
-
export declare const TRAFFIC_TITLE_KEY = "fuul.traffic_title";
|
|
8
|
-
export declare const TRAFFIC_TAG_KEY = "fuul.traffic_tag";
|
|
9
|
-
export declare const TRAFFIC_ORIGIN_URL = "fuul.traffic_origin_url";
|
|
10
|
-
export declare const SENT_EVENT_ID_KEY = "fuul.sent";
|
|
11
|
-
export declare const SENT_EVENT_VALIDITY_PERIOD_MS = 60000;
|
|
12
|
-
export declare const SEARCH_ENGINE_URLS: string[];
|
|
13
|
-
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,oBAAoB,CAAC;AAChD,eAAO,MAAM,eAAe,qBAAqB,CAAC;AAClD,eAAO,MAAM,cAAc,oBAAoB,CAAC;AAChD,eAAO,MAAM,eAAe,qBAAqB,CAAC;AAClD,eAAO,MAAM,kBAAkB,wBAAwB,CAAC;AACxD,eAAO,MAAM,oBAAoB,0BAA0B,CAAC;AAC5D,eAAO,MAAM,iBAAiB,uBAAuB,CAAC;AACtD,eAAO,MAAM,eAAe,qBAAqB,CAAC;AAClD,eAAO,MAAM,kBAAkB,4BAA4B,CAAC;AAC5D,eAAO,MAAM,iBAAiB,cAAc,CAAC;AAC7C,eAAO,MAAM,6BAA6B,QAAQ,CAAC;AAEnD,eAAO,MAAM,kBAAkB,UAA0C,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { HttpClient } from '../http/HttpClient';
|
|
2
|
-
import { ConversionDTO } from './dtos';
|
|
3
|
-
export declare class ConversionService {
|
|
4
|
-
private httpClient;
|
|
5
|
-
constructor(httpClient: HttpClient);
|
|
6
|
-
getAll(): Promise<ConversionDTO[]>;
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=conversionService.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"conversionService.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/conversions/conversionService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AAEtC,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,UAAU,CAAY;gBAElB,UAAU,EAAE,U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I,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAI7D,IAAI,CAAC,CAAC,EACV,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE;QACJ,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KACnB,GACA,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAItB,GAAG,CAAC,CAAC,EACT,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE;QACJ,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KACnB,GACA,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAItB,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAIxD,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,sBAAsB;CAOpD"}
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export interface SendEventMetadataRequest {
|
|
2
|
-
referrer?: string;
|
|
3
|
-
project_id?: string;
|
|
4
|
-
tracking_id: string;
|
|
5
|
-
session_id: string;
|
|
6
|
-
user_address?: string;
|
|
7
|
-
source?: string;
|
|
8
|
-
category?: string;
|
|
9
|
-
title?: string;
|
|
10
|
-
tag?: string;
|
|
11
|
-
}
|
|
12
|
-
export interface SendEventRequest {
|
|
13
|
-
name: string;
|
|
14
|
-
event_args?: EventArgs;
|
|
15
|
-
metadata?: SendEventMetadataRequest;
|
|
16
|
-
user_address?: string;
|
|
17
|
-
signature?: string;
|
|
18
|
-
signatureMessage?: string;
|
|
19
|
-
}
|
|
20
|
-
export interface EventMetadata {
|
|
21
|
-
userAddress?: string;
|
|
22
|
-
signature?: string;
|
|
23
|
-
signatureMessage?: string;
|
|
24
|
-
}
|
|
25
|
-
export interface UserMetadata {
|
|
26
|
-
userAddress: string;
|
|
27
|
-
signature?: string;
|
|
28
|
-
signatureMessage?: string;
|
|
29
|
-
}
|
|
30
|
-
export type EventArgs = {
|
|
31
|
-
[key: string]: unknown;
|
|
32
|
-
};
|
|
33
|
-
export type FuulSettings = {
|
|
34
|
-
baseApiUrl?: string;
|
|
35
|
-
defaultQueryParams?: Record<string, string>;
|
|
36
|
-
};
|
|
37
|
-
export interface IGenerateTrackingLink {
|
|
38
|
-
address: string;
|
|
39
|
-
projectId: string;
|
|
40
|
-
baseUrl?: string;
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,CAAC,EAAE,SAAS,CAAA;IACtB,QAAQ,CAAC,EAAE,wBAAwB,CAAA;IACnC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B;AAED,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC5C,CAAA;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB"}
|
package/dist/utils/events.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { SendEventRequest } from '../types';
|
|
2
|
-
export declare const saveSentEvent: (eventName: string, params: SendEventRequest) => void;
|
|
3
|
-
export declare const shouldSendEvent: (eventName: string, reqBody: SendEventRequest) => boolean;
|
|
4
|
-
//# sourceMappingURL=events.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/utils/events.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAE3C,eAAO,MAAM,aAAa,cAAe,MAAM,UAAU,gBAAgB,KAAG,IAO3E,CAAA;AAED,eAAO,MAAM,eAAe,cAAe,MAAM,WAAW,gBAAgB,KAAG,OAmC9E,CAAA"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare const getSessionId: () => string | null;
|
|
2
|
-
export declare const getTrackingId: () => string | null;
|
|
3
|
-
export declare const getProjectId: () => string | null;
|
|
4
|
-
export declare const getReferrerId: () => string | null;
|
|
5
|
-
export declare const getTrafficSource: () => string | null;
|
|
6
|
-
export declare const getTrafficCategory: () => string | null;
|
|
7
|
-
export declare const getTrafficTitle: () => string | null;
|
|
8
|
-
export declare const getTrafficTag: () => string | null;
|
|
9
|
-
export declare const isBrowserUndefined: boolean;
|
|
10
|
-
export declare const saveSessionId: () => void;
|
|
11
|
-
export declare const saveTrackingId: () => void;
|
|
12
|
-
export declare const saveUrlParams: () => void;
|
|
13
|
-
export declare const saveTrafficSource: () => void;
|
|
14
|
-
//# sourceMappingURL=localStorage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"localStorage.d.ts","sourceRoot":"","sources":["../../../src/utils/localStorage.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,YAAY,qBAA6C,CAAA;AACtE,eAAO,MAAM,aAAa,qBAA8C,CAAA;AACxE,eAAO,MAAM,YAAY,qBAA6C,CAAA;AACtE,eAAO,MAAM,aAAa,qBAA8C,CAAA;AACxE,eAAO,MAAM,gBAAgB,qBAAiD,CAAA;AAC9E,eAAO,MAAM,kBAAkB,qBAAmD,CAAA;AAClF,eAAO,MAAM,eAAe,qBAAgD,CAAA;AAC5E,eAAO,MAAM,aAAa,qBAA8C,CAAA;AAExE,eAAO,MAAM,kBAAkB,SAAmE,CAAA;AAIlG,eAAO,MAAM,aAAa,QAAO,IAMhC,CAAA;AAED,eAAO,MAAM,cAAc,QAAO,IAQjC,CAAA;AAED,eAAO,MAAM,aAAa,QAAO,IAehC,CAAA;AAED,eAAO,MAAM,iBAAiB,QAAO,IA4BpC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"queryParams.d.ts","sourceRoot":"","sources":["../../../src/utils/queryParams.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,SAAU,OAAO,MAAM,EAAE,MAAM,CAAC,WAW5D,CAAC"}
|