@iankibetsh/vue-streamline 1.0.8-beta → 1.0.8-beta-1

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.
@@ -1697,7 +1697,9 @@ const Un = (e, ...t) => {
1697
1697
  r.value = !1;
1698
1698
  }
1699
1699
  }, u = (f) => {
1700
- c.methods = f.methods, c.properties = f.properties, Object.assign(c, f.properties);
1700
+ c.methods = f.methods, c.properties = f.properties, Object.entries(f.properties).forEach(([b, h]) => {
1701
+ c[b] = h;
1702
+ });
1701
1703
  const E = f.methods;
1702
1704
  for (const b of E)
1703
1705
  c[b] = async (...h) => {
@@ -3,4 +3,4 @@
3
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[je]=this[je]={accessors:{}}).accessors,s=this.prototype;function o(i){const c=z(i);r[c]||(rn(s,i),r[c]=!0)}return a.isArray(t)?t.forEach(o):o(t),this}}O.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors(O.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),a.freezeMethods(O);function ie(e,t){const n=this||I,r=t||n,s=O.from(r.headers);let o=r.data;return a.forEach(e,function(c){o=c.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function ke(e){return!!(e&&e.__CANCEL__)}function q(e,t,n){m.call(this,e??"canceled",m.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(q,m,{__CANCEL__:!0});function qe(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))}function sn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function on(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 u=Date.now(),l=r[o];i||(i=u),n[s]=d,r[s]=u;let f=o,b=0;for(;f!==s;)b+=n[f++],f=f%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),u-i<t)return;const E=l&&u-l;return E?Math.round(b*1e3/E):void 0}}function an(e,t){let n=0,r=1e3/t,s,o;const i=(u,l=Date.now())=>{n=l,s=null,o&&(clearTimeout(o),o=null),e.apply(null,u)};return[(...u)=>{const l=Date.now(),f=l-n;f>=r?i(u,l):(s=u,o||(o=setTimeout(()=>{o=null,i(s)},r-f)))},()=>s&&i(s)]}const X=(e,t,n=3)=>{let r=0;const s=on(50,250);return an(o=>{const i=o.loaded,c=o.lengthComputable?o.total:void 0,d=i-r,u=s(d),l=i<=c;r=i;const f={loaded:i,total:c,progress:c?i/c:void 0,bytes:d,rate:u||void 0,estimated:u&&c&&l?(c-i)/u:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(f)},n)},Me=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},He=e=>(...t)=>a.asap(()=>e(...t)),cn=x.hasStandardBrowserEnv?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 c=a.isString(i)?s(i):i;return c.protocol===r.protocol&&c.host===r.host}}():function(){return function(){return!0}}(),un=x.hasStandardBrowserEnv?{write(e,t,n,r,s,o){const i=[e+"="+encodeURIComponent(t)];a.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),a.isString(r)&&i.push("path="+r),a.isString(s)&&i.push("domain="+s),o===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function ln(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function fn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Ie(e,t){return e&&!ln(t)?fn(e,t):t}const ze=e=>e instanceof O?{...e}:e;function D(e,t){t=t||{};const n={};function r(u,l,f){return a.isPlainObject(u)&&a.isPlainObject(l)?a.merge.call({caseless:f},u,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function s(u,l,f){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u,f)}else return r(u,l,f)}function o(u,l){if(!a.isUndefined(l))return r(void 0,l)}function i(u,l){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u)}else return r(void 0,l)}function c(u,l,f){if(f in t)return r(u,l);if(f in e)return r(void 0,u)}const d={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken: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:c,headers:(u,l)=>s(ze(u),ze(l),!0)};return a.forEach(Object.keys(Object.assign({},e,t)),function(l){const f=d[l]||s,b=f(e[l],t[l],l);a.isUndefined(b)&&f!==c||(n[l]=b)}),n}const $e=e=>{const t=D({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:c}=t;t.headers=i=O.from(i),t.url=_e(Ie(t.baseURL,t.url),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let d;if(a.isFormData(n)){if(x.hasStandardBrowserEnv||x.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((d=i.getContentType())!==!1){const[u,...l]=d?d.split(";").map(f=>f.trim()).filter(Boolean):[];i.setContentType([u||"multipart/form-data",...l].join("; "))}}if(x.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&cn(t.url))){const u=s&&o&&un.read(o);u&&i.set(s,u)}return t},dn=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const s=$e(e);let o=s.data;const i=O.from(s.headers).normalize();let{responseType:c,onUploadProgress:d,onDownloadProgress:u}=s,l,f,b,E,h;function y(){E&&E(),h&&h(),s.cancelToken&&s.cancelToken.unsubscribe(l),s.signal&&s.signal.removeEventListener("abort",l)}let p=new XMLHttpRequest;p.open(s.method.toUpperCase(),s.url,!0),p.timeout=s.timeout;function R(){if(!p)return;const w=O.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),j={data:!c||c==="text"||c==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:w,config:e,request:p};qe(function(F){n(F),y()},function(F){r(F),y()},j),p=null}"onloadend"in p?p.onloadend=R:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(R)},p.onabort=function(){p&&(r(new m("Request aborted",m.ECONNABORTED,e,p)),p=null)},p.onerror=function(){r(new m("Network Error",m.ERR_NETWORK,e,p)),p=null},p.ontimeout=function(){let P=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const j=s.transitional||De;s.timeoutErrorMessage&&(P=s.timeoutErrorMessage),r(new m(P,j.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,e,p)),p=null},o===void 0&&i.setContentType(null),"setRequestHeader"in p&&a.forEach(i.toJSON(),function(P,j){p.setRequestHeader(j,P)}),a.isUndefined(s.withCredentials)||(p.withCredentials=!!s.withCredentials),c&&c!=="json"&&(p.responseType=s.responseType),u&&([b,h]=X(u,!0),p.addEventListener("progress",b)),d&&p.upload&&([f,E]=X(d),p.upload.addEventListener("progress",f),p.upload.addEventListener("loadend",E)),(s.cancelToken||s.signal)&&(l=w=>{p&&(r(!w||w.type?new q(null,e,p):w),p.abort(),p=null)},s.cancelToken&&s.cancelToken.subscribe(l),s.signal&&(s.signal.aborted?l():s.signal.addEventListener("abort",l)));const S=sn(s.url);if(S&&x.protocols.indexOf(S)===-1){r(new m("Unsupported protocol "+S+":",m.ERR_BAD_REQUEST,e));return}p.send(o||null)})},pn=(e,t)=>{let n=new AbortController,r;const s=function(d){if(!r){r=!0,i();const u=d instanceof Error?d:this.reason;n.abort(u instanceof m?u:new q(u instanceof Error?u.message:u))}};let o=t&&setTimeout(()=>{s(new m(`timeout ${t} of ms exceeded`,m.ETIMEDOUT))},t);const i=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(d=>{d&&(d.removeEventListener?d.removeEventListener("abort",s):d.unsubscribe(s))}),e=null)};e.forEach(d=>d&&d.addEventListener&&d.addEventListener("abort",s));const{signal:c}=n;return c.unsubscribe=i,[c,()=>{o&&clearTimeout(o),o=null}]},hn=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},mn=async function*(e,t,n){for await(const r of e)yield*hn(ArrayBuffer.isView(r)?r:await n(String(r)),t)},Je=(e,t,n,r,s)=>{const o=mn(e,t,s);let i=0,c,d=u=>{c||(c=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:l,value:f}=await o.next();if(l){d(),u.close();return}let b=f.byteLength;if(n){let E=i+=b;n(E)}u.enqueue(new Uint8Array(f))}catch(l){throw d(l),l}},cancel(u){return d(u),o.return()}},{highWaterMark:2})},G=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ve=G&&typeof ReadableStream=="function",ae=G&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Ve=(e,...t)=>{try{return!!e(...t)}catch{return!1}},yn=ve&&Ve(()=>{let e=!1;const t=new Request(x.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),We=64*1024,ce=ve&&Ve(()=>a.isReadableStream(new Response("").body)),Q={stream:ce&&(e=>e.body)};G&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Q[t]&&(Q[t]=a.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new m(`Response type '${t}' is not supported`,m.ERR_NOT_SUPPORT,r)})})})(new Response);const wn=async e=>{if(e==null)return 0;if(a.isBlob(e))return e.size;if(a.isSpecCompliantForm(e))return(await new Request(e).arrayBuffer()).byteLength;if(a.isArrayBufferView(e)||a.isArrayBuffer(e))return e.byteLength;if(a.isURLSearchParams(e)&&(e=e+""),a.isString(e))return(await ae(e)).byteLength},bn=async(e,t)=>{const n=a.toFiniteNumber(e.getContentLength());return n??wn(t)},ue={http:Ht,xhr:dn,fetch:G&&(async e=>{let{url:t,method:n,data:r,signal:s,cancelToken:o,timeout:i,onDownloadProgress:c,onUploadProgress:d,responseType:u,headers:l,withCredentials:f="same-origin",fetchOptions:b}=$e(e);u=u?(u+"").toLowerCase():"text";let[E,h]=s||o||i?pn([s,o],i):[],y,p;const R=()=>{!y&&setTimeout(()=>{E&&E.unsubscribe()}),y=!0};let S;try{if(d&&yn&&n!=="get"&&n!=="head"&&(S=await bn(l,r))!==0){let N=new Request(t,{method:"POST",body:r,duplex:"half"}),F;if(a.isFormData(r)&&(F=N.headers.get("content-type"))&&l.setContentType(F),N.body){const[me,Z]=Me(S,X(He(d)));r=Je(N.body,We,me,Z,ae)}}a.isString(f)||(f=f?"include":"omit"),p=new Request(t,{...b,signal:E,method:n.toUpperCase(),headers:l.normalize().toJSON(),body:r,duplex:"half",credentials:f});let w=await fetch(p);const P=ce&&(u==="stream"||u==="response");if(ce&&(c||P)){const N={};["status","statusText","headers"].forEach(et=>{N[et]=w[et]});const F=a.toFiniteNumber(w.headers.get("content-length")),[me,Z]=c&&Me(F,X(He(c),!0))||[];w=new Response(Je(w.body,We,me,()=>{Z&&Z(),P&&R()},ae),N)}u=u||"text";let j=await Q[a.findKey(Q,u)||"text"](w,e);return!P&&R(),h&&h(),await new Promise((N,F)=>{qe(N,F,{data:j,headers:O.from(w.headers),status:w.status,statusText:w.statusText,config:e,request:p})})}catch(w){throw R(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new m("Network Error",m.ERR_NETWORK,e,p),{cause:w.cause||w}):m.from(w,w&&w.code,e,p)}})};a.forEach(ue,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Ke=e=>`- ${e}`,En=e=>a.isFunction(e)||e===null||e===!1,Xe={getAdapter:e=>{e=a.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let o=0;o<t;o++){n=e[o];let i;if(r=n,!En(n)&&(r=ue[(i=String(n)).toLowerCase()],r===void 0))throw new m(`Unknown adapter '${i}'`);if(r)break;s[i||"#"+o]=r}if(!r){const o=Object.entries(s).map(([c,d])=>`adapter ${c} `+(d===!1?"is not supported by the environment":"is not available in the build"));let i=t?o.length>1?`since :
4
4
  `+o.map(Ke).join(`
5
5
  `):" "+Ke(o[0]):"as no adapter specified";throw new m("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:ue};function le(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new q(null,e)}function Ge(e){return le(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),Xe.getAdapter(e.adapter||I.adapter)(e).then(function(r){return le(e),r.data=ie.call(e,e.transformResponse,r),r.headers=O.from(r.headers),r},function(r){return ke(r)||(le(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 Qe="1.7.4",fe={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{fe[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Ze={};fe.transitional=function(t,n,r){function s(o,i){return"[Axios v"+Qe+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,c)=>{if(t===!1)throw new m(s(i," has been removed"+(n?" in "+n:"")),m.ERR_DEPRECATED);return n&&!Ze[i]&&(Ze[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,c):!0}};function Sn(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 c=e[o],d=c===void 0||i(c,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 de={assertOptions:Sn,validators:fe},_=de.validators;class B{constructor(t){this.defaults=t,this.interceptors={request:new Ue,response:new Ue}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s;Error.captureStackTrace?Error.captureStackTrace(s={}):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
6
- `+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=D(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&de.assertOptions(r,{silentJSONParsing:_.transitional(_.boolean),forcedJSONParsing:_.transitional(_.boolean),clarifyTimeoutError:_.transitional(_.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:de.assertOptions(s,{encode:_.function,serialize:_.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[n.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),n.headers=O.concat(i,o);const c=[];let d=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(n)===!1||(d=d&&y.synchronous,c.unshift(y.fulfilled,y.rejected))});const u=[];this.interceptors.response.forEach(function(y){u.push(y.fulfilled,y.rejected)});let l,f=0,b;if(!d){const h=[Ge.bind(this),void 0];for(h.unshift.apply(h,c),h.push.apply(h,u),b=h.length,l=Promise.resolve(n);f<b;)l=l.then(h[f++],h[f++]);return l}b=c.length;let E=n;for(f=0;f<b;){const h=c[f++],y=c[f++];try{E=h(E)}catch(p){y.call(this,p);break}}try{l=Ge.call(this,E)}catch(h){return Promise.reject(h)}for(f=0,b=u.length;f<b;)l=l.then(u[f++],u[f++]);return l}getUri(t){t=D(this.defaults,t);const n=Ie(t.baseURL,t.url);return _e(n,t.params,t.paramsSerializer)}}a.forEach(["delete","get","head","options"],function(t){B.prototype[t]=function(n,r){return this.request(D(r||{},{method:t,url:n,data:(r||{}).data}))}}),a.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,c){return this.request(D(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}B.prototype[t]=n(),B.prototype[t+"Form"]=n(!0)});class pe{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(c=>{r.subscribe(c),o=c}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,c){r.reason||(r.reason=new q(o,i,c),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 pe(function(s){t=s}),cancel:t}}}function gn(e){return function(n){return e.apply(null,n)}}function Rn(e){return a.isObject(e)&&e.isAxiosError===!0}const he={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(he).forEach(([e,t])=>{he[t]=e});function Ye(e){const t=new B(e),n=ye(B.prototype.request,t);return a.extend(n,B.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return Ye(D(e,s))},n}const g=Ye(I);g.Axios=B,g.CanceledError=q,g.CancelToken=pe,g.isCancel=ke,g.VERSION=Qe,g.toFormData=W,g.AxiosError=m,g.Cancel=g.CanceledError,g.all=function(t){return Promise.all(t)},g.spread=gn,g.isAxiosError=Rn,g.mergeConfig=D,g.AxiosHeaders=O,g.formToJSON=e=>Be(a.isHTMLForm(e)?new FormData(e):e),g.getAdapter=Xe.getAdapter,g.HttpStatusCode=he,g.default=g;const On=(e,...t)=>{let n={};const r=C.ref(!1),s=C.inject("streamlineUrl"),o=C.inject("streamlineHeaders"),i=g.create({headers:{...o}}),c=C.reactive({methods:[],properties:{}}),d=async()=>{try{r.value=!0;const f=await i.post(s,{action:"onMounted",stream:e,params:t});u(f.data)}catch(f){throw console.error(`Error fetching properties for stream ${e}`,f),f}finally{r.value=!1}},u=f=>{c.methods=f.methods,c.properties=f.properties,Object.assign(c,f.properties);const b=f.methods;for(const E of b)c[E]=async(...h)=>{try{return(await i.post(s,{action:E,stream:e,...n,params:h})).data}catch(y){throw console.error(`Error calling ${E} on stream ${e}`,y),y}}},l=new Proxy(c,{get(f,b){return b in f?f[b]:(...E)=>{if(["setFormData","setData"].includes(b))return n=E[0],l;if(["getMethods","getActions","getFunctions","getServiceMethods"].includes(b))return Object.keys(l).filter(S=>{if(typeof l[S]=="function")return S});const p={action:b,stream:e,...n};if(["getUrl","getFullUrl","getActionUrl"].includes(b)){p.action=E[0];const S=E.slice(1);return S.length>0&&(p.params=S),s+"?"+new URLSearchParams(p).toString()}return p.params=E,i.post(s,p).then(S=>S.data).catch(S=>{throw console.error(`Error calling ${b} on stream ${e}`,S),S})}}});return C.onMounted(()=>{d()}),{...C.toRefs(c),service:l,loading:r}},Tn={install(e,t){e.provide("streamlineUrl",t.streamlineUrl),e.provide("streamlineHeaders",t.streamlineHeaders)}};L.streamline=Tn,L.useStreamline=On,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})});
6
+ `+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=D(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&de.assertOptions(r,{silentJSONParsing:_.transitional(_.boolean),forcedJSONParsing:_.transitional(_.boolean),clarifyTimeoutError:_.transitional(_.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:de.assertOptions(s,{encode:_.function,serialize:_.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[n.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),n.headers=O.concat(i,o);const c=[];let d=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(n)===!1||(d=d&&y.synchronous,c.unshift(y.fulfilled,y.rejected))});const u=[];this.interceptors.response.forEach(function(y){u.push(y.fulfilled,y.rejected)});let l,f=0,b;if(!d){const h=[Ge.bind(this),void 0];for(h.unshift.apply(h,c),h.push.apply(h,u),b=h.length,l=Promise.resolve(n);f<b;)l=l.then(h[f++],h[f++]);return l}b=c.length;let E=n;for(f=0;f<b;){const h=c[f++],y=c[f++];try{E=h(E)}catch(p){y.call(this,p);break}}try{l=Ge.call(this,E)}catch(h){return Promise.reject(h)}for(f=0,b=u.length;f<b;)l=l.then(u[f++],u[f++]);return l}getUri(t){t=D(this.defaults,t);const n=Ie(t.baseURL,t.url);return _e(n,t.params,t.paramsSerializer)}}a.forEach(["delete","get","head","options"],function(t){B.prototype[t]=function(n,r){return this.request(D(r||{},{method:t,url:n,data:(r||{}).data}))}}),a.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,c){return this.request(D(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}B.prototype[t]=n(),B.prototype[t+"Form"]=n(!0)});class pe{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(c=>{r.subscribe(c),o=c}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,c){r.reason||(r.reason=new q(o,i,c),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 pe(function(s){t=s}),cancel:t}}}function gn(e){return function(n){return e.apply(null,n)}}function Rn(e){return a.isObject(e)&&e.isAxiosError===!0}const he={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(he).forEach(([e,t])=>{he[t]=e});function Ye(e){const t=new B(e),n=ye(B.prototype.request,t);return a.extend(n,B.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return Ye(D(e,s))},n}const g=Ye(I);g.Axios=B,g.CanceledError=q,g.CancelToken=pe,g.isCancel=ke,g.VERSION=Qe,g.toFormData=W,g.AxiosError=m,g.Cancel=g.CanceledError,g.all=function(t){return Promise.all(t)},g.spread=gn,g.isAxiosError=Rn,g.mergeConfig=D,g.AxiosHeaders=O,g.formToJSON=e=>Be(a.isHTMLForm(e)?new FormData(e):e),g.getAdapter=Xe.getAdapter,g.HttpStatusCode=he,g.default=g;const On=(e,...t)=>{let n={};const r=C.ref(!1),s=C.inject("streamlineUrl"),o=C.inject("streamlineHeaders"),i=g.create({headers:{...o}}),c=C.reactive({methods:[],properties:{}}),d=async()=>{try{r.value=!0;const f=await i.post(s,{action:"onMounted",stream:e,params:t});u(f.data)}catch(f){throw console.error(`Error fetching properties for stream ${e}`,f),f}finally{r.value=!1}},u=f=>{c.methods=f.methods,c.properties=f.properties,Object.entries(f.properties).forEach(([E,h])=>{c[E]=h});const b=f.methods;for(const E of b)c[E]=async(...h)=>{try{return(await i.post(s,{action:E,stream:e,...n,params:h})).data}catch(y){throw console.error(`Error calling ${E} on stream ${e}`,y),y}}},l=new Proxy(c,{get(f,b){return b in f?f[b]:(...E)=>{if(["setFormData","setData"].includes(b))return n=E[0],l;if(["getMethods","getActions","getFunctions","getServiceMethods"].includes(b))return Object.keys(l).filter(S=>{if(typeof l[S]=="function")return S});const p={action:b,stream:e,...n};if(["getUrl","getFullUrl","getActionUrl"].includes(b)){p.action=E[0];const S=E.slice(1);return S.length>0&&(p.params=S),s+"?"+new URLSearchParams(p).toString()}return p.params=E,i.post(s,p).then(S=>S.data).catch(S=>{throw console.error(`Error calling ${b} on stream ${e}`,S),S})}}});return C.onMounted(()=>{d()}),{...C.toRefs(c),service:l,loading:r}},Tn={install(e,t){e.provide("streamlineUrl",t.streamlineUrl),e.provide("streamlineHeaders",t.streamlineHeaders)}};L.streamline=Tn,L.useStreamline=On,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iankibetsh/vue-streamline",
3
- "version": "1.0.8-beta",
3
+ "version": "1.0.8-beta-1",
4
4
  "description": "Vue library for streamlining laravel backend services with @iankibet/streamline composer package",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -42,7 +42,10 @@ const useStreamline = (stream, ...initialArgs) => {
42
42
  const assignPropertiesAndMethods = (data) => {
43
43
  service.methods = data.methods
44
44
  service.properties = data.properties
45
- Object.assign(service, data.properties) // Assign the properties to the reactive service object
45
+ // Object.assign(service, data.properties) // Assign the properties to the reactive service object
46
+ Object.entries(data.properties).forEach(([key, value]) => {
47
+ service[key] = value;
48
+ });
46
49
  const methods = data.methods
47
50
  for (const method of methods) {
48
51
  service[method] = async (...args) => {