@wxn0brp/vql-client 0.0.5 → 0.0.6
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.d.ts +4 -2
- package/dist/vql-client.min.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { VQLR } from "./vql.js";
|
|
2
|
-
export type VQLQuery = string |
|
|
1
|
+
import { VQLR, VQLRef } from "./vql.js";
|
|
2
|
+
export type VQLQuery = VQLR | string | {
|
|
3
|
+
query: string;
|
|
4
|
+
} & VQLRef;
|
|
3
5
|
export type VQLResult<T = any> = Promise<T>;
|
|
4
6
|
export type VQLTransport = (query: VQLQuery) => VQLResult;
|
|
5
7
|
export type VQLHooks = {
|
package/dist/vql-client.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var VQLClient=(()=>{var Q=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var x=(t,r)=>{for(var a in r)Q(t,a,{get:r[a],enumerable:!0})},m=(t,r,a,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of T(r))!h.call(t,o)&&o!==a&&Q(t,o,{get:()=>r[o],enumerable:!(i=w(r,o))||i.enumerable});return t};var E=t=>m(Q({},"__esModule",{value:!0}),t);var
|
|
1
|
+
var VQLClient=(()=>{var Q=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var x=(t,r)=>{for(var a in r)Q(t,a,{get:r[a],enumerable:!0})},m=(t,r,a,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of T(r))!h.call(t,o)&&o!==a&&Q(t,o,{get:()=>r[o],enumerable:!(i=w(r,o))||i.enumerable});return t};var E=t=>m(Q({},"__esModule",{value:!0}),t);var R={};x(R,{defaultFetchTransport:()=>s,fetchVQL:()=>d,initVQLClient:()=>l,resetVQLClient:()=>f});var u=s,e={},y="/VQL";function l(t){t.transport&&(u=t.transport),t.hooks&&(e=t.hooks),t.defaultFetchUrl&&(y=t.defaultFetchUrl)}async function d(t){var a,i,o,p,L;let r=Date.now();try{(a=e.onStart)==null||a.call(e,t);let n=await u(t),c=Date.now()-r;if((i=e.onEnd)==null||i.call(e,t,c,n),n!=null&&n.err){let V=new Error(n.err);throw(o=e.onError)==null||o.call(e,t,V),V}return(p=n==null?void 0:n.result)!=null?p:n}catch(n){throw(L=e.onError)==null||L.call(e,t,n),n}}function f(){u=s,e={}}async function s(t){let r=await fetch(y,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:t})});if(!r.ok)throw new Error(`VQL request failed: ${r.status}`);return await r.json()}typeof window!="undefined"&&(window.VQLClient={fetchVQL:d,initVQLClient:l,resetVQLClient:f,defaultFetchTransport:s});return E(R);})();
|