@wxn0brp/vql-client 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/vql-client.cjs +1 -1
- package/dist/vql-client.min.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
package/dist/vql-client.cjs
CHANGED
|
@@ -49,7 +49,7 @@ async function fetchVQL(query, hookContext = {}) {
|
|
|
49
49
|
if (res.result !== void 0) return res.result;
|
|
50
50
|
return res;
|
|
51
51
|
} catch (e) {
|
|
52
|
-
(_d = hooks.onError) == null ? void 0 : _d.call(hooks, query, e);
|
|
52
|
+
(_d = hooks.onError) == null ? void 0 : _d.call(hooks, query, e, null, hookContext);
|
|
53
53
|
throw e;
|
|
54
54
|
}
|
|
55
55
|
}
|
package/dist/vql-client.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var VQLClient=(()=>{var
|
|
1
|
+
var VQLClient=(()=>{var i=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var R=(r,t)=>{for(var a in t)i(r,a,{get:t[a],enumerable:!0})},q=(r,t,a,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of T(t))!h.call(r,o)&&o!==a&&i(r,o,{get:()=>t[o],enumerable:!(s=L(t,o))||s.enumerable});return r};var m=r=>q(i({},"__esModule",{value:!0}),r);var x={};R(x,{defaultFetchTransport:()=>u,fetchVQL:()=>V,initVQLClient:()=>Q,resetVQLClient:()=>f});var l=u,e={},w="/VQL";function Q(r){r.transport&&(l=r.transport),r.hooks&&(e=r.hooks),r.defaultFetchUrl&&(w=r.defaultFetchUrl)}async function V(r,t={}){var s,o,y,p;let a=Date.now();try{(s=e.onStart)==null||s.call(e,r,t);let n=await l(r),c=Date.now()-a;if((o=e.onEnd)==null||o.call(e,r,c,n,t),n!=null&&n.err){let d=new Error(n.err);throw(y=e.onError)==null||y.call(e,r,d,n,t),d}return n.result!==void 0?n.result:n}catch(n){throw(p=e.onError)==null||p.call(e,r,n,null,t),n}}function f(){l=u,e={}}async function u(r){let t=await fetch(w,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:r})});if(!t.ok)throw new Error(`VQL request failed: ${t.status}`);return await t.json()}typeof window!="undefined"&&(window.VQLClient={fetchVQL:V,initVQLClient:Q,resetVQLClient:f,defaultFetchTransport:u});return m(x);})();
|