shared-ritm 1.0.91 → 1.0.92
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/shared-ritm.es.js
CHANGED
|
@@ -11633,6 +11633,9 @@ class kh extends Cn {
|
|
|
11633
11633
|
logout() {
|
|
11634
11634
|
return this.post("/logout", null);
|
|
11635
11635
|
}
|
|
11636
|
+
userInfo() {
|
|
11637
|
+
return this.get("/users/auth");
|
|
11638
|
+
}
|
|
11636
11639
|
configs() {
|
|
11637
11640
|
return this.get("/configs");
|
|
11638
11641
|
}
|
package/dist/shared-ritm.umd.js
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(B){return B instanceof this?B:new this(B)}static concat(B,...Q){const C=new this(B);return Q.forEach(w=>C.set(w)),C}static accessor(B){const C=(this[RE]=this[RE]={accessors:{}}).accessors,w=this.prototype;function E(I){const D=cg(I);C[D]||(ec(w,I),C[D]=!0)}return r.isArray(B)?B.forEach(E):E(B),this}}yA.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),r.reduceDescriptors(yA.prototype,({value:A},B)=>{let Q=B[0].toUpperCase()+B.slice(1);return{get:()=>A,set(C){this[Q]=C}}}),r.freezeMethods(yA);function MC(A,B){const Q=this||og,C=B||Q,w=yA.from(C.headers);let E=C.data;return r.forEach(A,function(D){E=D.call(Q,E,w.normalize(),B?B.status:void 0)}),w.normalize(),E}function mE(A){return!!(A&&A.__CANCEL__)}function OB(A,B,Q){wA.call(this,A??"canceled",wA.ERR_CANCELED,B,Q),this.name="CanceledError"}r.inherits(OB,wA,{__CANCEL__:!0});function TE(A,B,Q){const C=Q.config.validateStatus;!Q.status||!C||C(Q.status)?A(Q):B(new wA("Request failed with status code "+Q.status,[wA.ERR_BAD_REQUEST,wA.ERR_BAD_RESPONSE][Math.floor(Q.status/100)-4],Q.config,Q.request,Q))}function oc(A){const B=/^([-+\w]{1,25})(:?\/\/|:)/.exec(A);return B&&B[1]||""}function cc(A,B){A=A||10;const Q=new Array(A),C=new Array(A);let w=0,E=0,I;return B=B!==void 0?B:1e3,function(Y){const e=Date.now(),M=C[E];I||(I=e),Q[w]=Y,C[w]=e;let o=E,s=0;for(;o!==w;)s+=Q[o++],o=o%A;if(w=(w+1)%A,w===E&&(E=(E+1)%A),e-I<B)return;const t=M&&e-M;return t?Math.round(s*1e3/t):void 0}}function Fc(A,B){let Q=0,C=1e3/B,w,E;const I=(e,M=Date.now())=>{Q=M,w=null,E&&(clearTimeout(E),E=null),A.apply(null,e)};return[(...e)=>{const M=Date.now(),o=M-Q;o>=C?I(e,M):(w=e,E||(E=setTimeout(()=>{E=null,I(w)},C-o)))},()=>w&&I(w)]}const gQ=(A,B,Q=3)=>{let C=0;const w=cc(50,250);return Fc(E=>{const I=E.loaded,D=E.lengthComputable?E.total:void 0,Y=I-C,e=w(Y),M=I<=D;C=I;const o={loaded:I,total:D,progress:D?I/D:void 0,bytes:Y,rate:e||void 0,estimated:e&&D&&M?(D-I)/e:void 0,event:E,lengthComputable:D!=null,[B?"download":"upload"]:!0};A(o)},Q)},jE=(A,B)=>{const Q=A!=null;return[C=>B[0]({lengthComputable:Q,total:A,loaded:C}),B[1]]},WE=A=>(...B)=>r.asap(()=>A(...B)),ic=WA.hasStandardBrowserEnv?function(){const B=WA.navigator&&/(msie|trident)/i.test(WA.navigator.userAgent),Q=document.createElement("a");let C;function w(E){let I=E;return B&&(Q.setAttribute("href",I),I=Q.href),Q.setAttribute("href",I),{href:Q.href,protocol:Q.protocol?Q.protocol.replace(/:$/,""):"",host:Q.host,search:Q.search?Q.search.replace(/^\?/,""):"",hash:Q.hash?Q.hash.replace(/^#/,""):"",hostname:Q.hostname,port:Q.port,pathname:Q.pathname.charAt(0)==="/"?Q.pathname:"/"+Q.pathname}}return C=w(window.location.href),function(I){const D=r.isString(I)?w(I):I;return D.protocol===C.protocol&&D.host===C.host}}():function(){return function(){return!0}}(),tc=WA.hasStandardBrowserEnv?{write(A,B,Q,C,w,E){const I=[A+"="+encodeURIComponent(B)];r.isNumber(Q)&&I.push("expires="+new Date(Q).toGMTString()),r.isString(C)&&I.push("path="+C),r.isString(w)&&I.push("domain="+w),E===!0&&I.push("secure"),document.cookie=I.join("; ")},read(A){const B=document.cookie.match(new RegExp("(^|;\\s*)("+A+")=([^;]*)"));return B?decodeURIComponent(B[3]):null},remove(A){this.write(A,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function nc(A){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(A)}function Uc(A,B){return B?A.replace(/\/?\/$/,"")+"/"+B.replace(/^\/+/,""):A}function yE(A,B){return A&&!nc(B)?Uc(A,B):B}const KE=A=>A instanceof yA?{...A}:A;function zB(A,B){B=B||{};const Q={};function C(e,M,o){return r.isPlainObject(e)&&r.isPlainObject(M)?r.merge.call({caseless:o},e,M):r.isPlainObject(M)?r.merge({},M):r.isArray(M)?M.slice():M}function w(e,M,o){if(r.isUndefined(M)){if(!r.isUndefined(e))return C(void 0,e,o)}else return C(e,M,o)}function E(e,M){if(!r.isUndefined(M))return C(void 0,M)}function I(e,M){if(r.isUndefined(M)){if(!r.isUndefined(e))return C(void 0,e)}else return C(void 0,M)}function D(e,M,o){if(o in B)return C(e,M);if(o in A)return C(void 0,e)}const Y={url:E,method:E,data:E,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:D,headers:(e,M)=>w(KE(e),KE(M),!0)};return r.forEach(Object.keys(Object.assign({},A,B)),function(M){const o=Y[M]||w,s=o(A[M],B[M],M);r.isUndefined(s)&&o!==D||(Q[M]=s)}),Q}const SE=A=>{const B=zB({},A);let{data:Q,withXSRFToken:C,xsrfHeaderName:w,xsrfCookieName:E,headers:I,auth:D}=B;B.headers=I=yA.from(I),B.url=zE(yE(B.baseURL,B.url),A.params,A.paramsSerializer),D&&I.set("Authorization","Basic "+btoa((D.username||"")+":"+(D.password?unescape(encodeURIComponent(D.password)):"")));let Y;if(r.isFormData(Q)){if(WA.hasStandardBrowserEnv||WA.hasStandardBrowserWebWorkerEnv)I.setContentType(void 0);else if((Y=I.getContentType())!==!1){const[e,...M]=Y?Y.split(";").map(o=>o.trim()).filter(Boolean):[];I.setContentType([e||"multipart/form-data",...M].join("; "))}}if(WA.hasStandardBrowserEnv&&(C&&r.isFunction(C)&&(C=C(B)),C||C!==!1&&ic(B.url))){const e=w&&E&&tc.read(E);e&&I.set(w,e)}return B},sc=typeof XMLHttpRequest<"u"&&function(A){return new Promise(function(Q,C){const w=SE(A);let E=w.data;const I=yA.from(w.headers).normalize();let{responseType:D,onUploadProgress:Y,onDownloadProgress:e}=w,M,o,s,t,F;function U(){t&&t(),F&&F(),w.cancelToken&&w.cancelToken.unsubscribe(M),w.signal&&w.signal.removeEventListener("abort",M)}let i=new XMLHttpRequest;i.open(w.method.toUpperCase(),w.url,!0),i.timeout=w.timeout;function d(){if(!i)return;const N=yA.from("getAllResponseHeaders"in i&&i.getAllResponseHeaders()),u={data:!D||D==="text"||D==="json"?i.responseText:i.response,status:i.status,statusText:i.statusText,headers:N,config:A,request:i};TE(function(R){Q(R),U()},function(R){C(R),U()},u),i=null}"onloadend"in i?i.onloadend=d:i.onreadystatechange=function(){!i||i.readyState!==4||i.status===0&&!(i.responseURL&&i.responseURL.indexOf("file:")===0)||setTimeout(d)},i.onabort=function(){i&&(C(new wA("Request aborted",wA.ECONNABORTED,A,i)),i=null)},i.onerror=function(){C(new wA("Network Error",wA.ERR_NETWORK,A,i)),i=null},i.ontimeout=function(){let a=w.timeout?"timeout of "+w.timeout+"ms exceeded":"timeout exceeded";const u=w.transitional||kE;w.timeoutErrorMessage&&(a=w.timeoutErrorMessage),C(new wA(a,u.clarifyTimeoutError?wA.ETIMEDOUT:wA.ECONNABORTED,A,i)),i=null},E===void 0&&I.setContentType(null),"setRequestHeader"in i&&r.forEach(I.toJSON(),function(a,u){i.setRequestHeader(u,a)}),r.isUndefined(w.withCredentials)||(i.withCredentials=!!w.withCredentials),D&&D!=="json"&&(i.responseType=w.responseType),e&&([s,F]=gQ(e,!0),i.addEventListener("progress",s)),Y&&i.upload&&([o,t]=gQ(Y),i.upload.addEventListener("progress",o),i.upload.addEventListener("loadend",t)),(w.cancelToken||w.signal)&&(M=N=>{i&&(C(!N||N.type?new OB(null,A,i):N),i.abort(),i=null)},w.cancelToken&&w.cancelToken.subscribe(M),w.signal&&(w.signal.aborted?M():w.signal.addEventListener("abort",M)));const P=oc(w.url);if(P&&WA.protocols.indexOf(P)===-1){C(new wA("Unsupported protocol "+P+":",wA.ERR_BAD_REQUEST,A));return}i.send(E||null)})},Gc=(A,B)=>{const{length:Q}=A=A?A.filter(Boolean):[];if(B||Q){let C=new AbortController,w;const E=function(e){if(!w){w=!0,D();const M=e instanceof Error?e:this.reason;C.abort(M instanceof wA?M:new OB(M instanceof Error?M.message:M))}};let I=B&&setTimeout(()=>{I=null,E(new wA(`timeout ${B} of ms exceeded`,wA.ETIMEDOUT))},B);const D=()=>{A&&(I&&clearTimeout(I),I=null,A.forEach(e=>{e.unsubscribe?e.unsubscribe(E):e.removeEventListener("abort",E)}),A=null)};A.forEach(e=>e.addEventListener("abort",E));const{signal:Y}=C;return Y.unsubscribe=()=>r.asap(D),Y}},hc=function*(A,B){let Q=A.byteLength;if(Q<B){yield A;return}let C=0,w;for(;C<Q;)w=C+B,yield A.slice(C,w),C=w},Pc=async function*(A,B){for await(const Q of ac(A))yield*hc(Q,B)},ac=async function*(A){if(A[Symbol.asyncIterator]){yield*A;return}const B=A.getReader();try{for(;;){const{done:Q,value:C}=await B.read();if(Q)break;yield C}}finally{await B.cancel()}},xE=(A,B,Q,C)=>{const w=Pc(A,B);let E=0,I,D=Y=>{I||(I=!0,C&&C(Y))};return new ReadableStream({async pull(Y){try{const{done:e,value:M}=await w.next();if(e){D(),Y.close();return}let o=M.byteLength;if(Q){let s=E+=o;Q(s)}Y.enqueue(new Uint8Array(M))}catch(e){throw D(e),e}},cancel(Y){return D(Y),w.return()}},{highWaterMark:2})},QQ=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",VE=QQ&&typeof ReadableStream=="function",Hc=QQ&&(typeof TextEncoder=="function"?(A=>B=>A.encode(B))(new TextEncoder):async A=>new Uint8Array(await new Response(A).arrayBuffer())),bE=(A,...B)=>{try{return!!A(...B)}catch{return!1}},lc=VE&&bE(()=>{let A=!1;const B=new Request(WA.origin,{body:new ReadableStream,method:"POST",get duplex(){return A=!0,"half"}}).headers.has("Content-Type");return A&&!B}),OE=64*1024,YC=VE&&bE(()=>r.isReadableStream(new Response("").body)),CQ={stream:YC&&(A=>A.body)};QQ&&(A=>{["text","arrayBuffer","blob","formData","stream"].forEach(B=>{!CQ[B]&&(CQ[B]=r.isFunction(A[B])?Q=>Q[B]():(Q,C)=>{throw new wA(`Response type '${B}' is not supported`,wA.ERR_NOT_SUPPORT,C)})})})(new Response);const rc=async A=>{if(A==null)return 0;if(r.isBlob(A))return A.size;if(r.isSpecCompliantForm(A))return(await new Request(WA.origin,{method:"POST",body:A}).arrayBuffer()).byteLength;if(r.isArrayBufferView(A)||r.isArrayBuffer(A))return A.byteLength;if(r.isURLSearchParams(A)&&(A=A+""),r.isString(A))return(await Hc(A)).byteLength},fc=async(A,B)=>{const Q=r.toFiniteNumber(A.getContentLength());return Q??rc(B)},eC={http:po,xhr:sc,fetch:QQ&&(async A=>{let{url:B,method:Q,data:C,signal:w,cancelToken:E,timeout:I,onDownloadProgress:D,onUploadProgress:Y,responseType:e,headers:M,withCredentials:o="same-origin",fetchOptions:s}=SE(A);e=e?(e+"").toLowerCase():"text";let t=Gc([w,E&&E.toAbortSignal()],I),F;const U=t&&t.unsubscribe&&(()=>{t.unsubscribe()});let i;try{if(Y&&lc&&Q!=="get"&&Q!=="head"&&(i=await fc(M,C))!==0){let u=new Request(B,{method:"POST",body:C,duplex:"half"}),L;if(r.isFormData(C)&&(L=u.headers.get("content-type"))&&M.setContentType(L),u.body){const[R,b]=jE(i,gQ(WE(Y)));C=xE(u.body,OE,R,b)}}r.isString(o)||(o=o?"include":"omit");const d="credentials"in Request.prototype;F=new Request(B,{...s,signal:t,method:Q.toUpperCase(),headers:M.normalize().toJSON(),body:C,duplex:"half",credentials:d?o:void 0});let P=await fetch(F);const N=YC&&(e==="stream"||e==="response");if(YC&&(D||N&&U)){const u={};["status","statusText","headers"].forEach(J=>{u[J]=P[J]});const L=r.toFiniteNumber(P.headers.get("content-length")),[R,b]=D&&jE(L,gQ(WE(D),!0))||[];P=new Response(xE(P.body,OE,R,()=>{b&&b(),U&&U()}),u)}e=e||"text";let a=await CQ[r.findKey(CQ,e)||"text"](P,A);return!N&&U&&U(),await new Promise((u,L)=>{TE(u,L,{data:a,headers:yA.from(P.headers),status:P.status,statusText:P.statusText,config:A,request:F})})}catch(d){throw U&&U(),d&&d.name==="TypeError"&&/fetch/i.test(d.message)?Object.assign(new wA("Network Error",wA.ERR_NETWORK,A,F),{cause:d.cause||d}):wA.from(d,d&&d.code,A,F)}})};r.forEach(eC,(A,B)=>{if(A){try{Object.defineProperty(A,"name",{value:B})}catch{}Object.defineProperty(A,"adapterName",{value:B})}});const pE=A=>`- ${A}`,uc=A=>r.isFunction(A)||A===null||A===!1,XE={getAdapter:A=>{A=r.isArray(A)?A:[A];const{length:B}=A;let Q,C;const w={};for(let E=0;E<B;E++){Q=A[E];let I;if(C=Q,!uc(Q)&&(C=eC[(I=String(Q)).toLowerCase()],C===void 0))throw new wA(`Unknown adapter '${I}'`);if(C)break;w[I||"#"+E]=C}if(!C){const E=Object.entries(w).map(([D,Y])=>`adapter ${D} `+(Y===!1?"is not supported by the environment":"is not available in the build"));let I=B?E.length>1?`since :
|
|
5
5
|
`+E.map(pE).join(`
|
|
6
6
|
`):" "+pE(E[0]):"as no adapter specified";throw new wA("There is no suitable adapter to dispatch the request "+I,"ERR_NOT_SUPPORT")}return C},adapters:eC};function oC(A){if(A.cancelToken&&A.cancelToken.throwIfRequested(),A.signal&&A.signal.aborted)throw new OB(null,A)}function ZE(A){return oC(A),A.headers=yA.from(A.headers),A.data=MC.call(A,A.transformRequest),["post","put","patch"].indexOf(A.method)!==-1&&A.headers.setContentType("application/x-www-form-urlencoded",!1),XE.getAdapter(A.adapter||og.adapter)(A).then(function(C){return oC(A),C.data=MC.call(A,A.transformResponse,C),C.headers=yA.from(C.headers),C},function(C){return mE(C)||(oC(A),C&&C.response&&(C.response.data=MC.call(A,A.transformResponse,C.response),C.response.headers=yA.from(C.response.headers))),Promise.reject(C)})}const qE="1.7.7",cC={};["object","boolean","number","function","string","symbol"].forEach((A,B)=>{cC[A]=function(C){return typeof C===A||"a"+(B<1?"n ":" ")+A}});const _E={};cC.transitional=function(B,Q,C){function w(E,I){return"[Axios v"+qE+"] Transitional option '"+E+"'"+I+(C?". "+C:"")}return(E,I,D)=>{if(B===!1)throw new wA(w(I," has been removed"+(Q?" in "+Q:"")),wA.ERR_DEPRECATED);return Q&&!_E[I]&&(_E[I]=!0,console.warn(w(I," has been deprecated since v"+Q+" and will be removed in the near future"))),B?B(E,I,D):!0}};function Jc(A,B,Q){if(typeof A!="object")throw new wA("options must be an object",wA.ERR_BAD_OPTION_VALUE);const C=Object.keys(A);let w=C.length;for(;w-- >0;){const E=C[w],I=B[E];if(I){const D=A[E],Y=D===void 0||I(D,E,A);if(Y!==!0)throw new wA("option "+E+" must be "+Y,wA.ERR_BAD_OPTION_VALUE);continue}if(Q!==!0)throw new wA("Unknown option "+E,wA.ERR_BAD_OPTION)}}const FC={assertOptions:Jc,validators:cC},UB=FC.validators;class vB{constructor(B){this.defaults=B,this.interceptors={request:new vE,response:new vE}}async request(B,Q){try{return await this._request(B,Q)}catch(C){if(C instanceof Error){let w;Error.captureStackTrace?Error.captureStackTrace(w={}):w=new Error;const E=w.stack?w.stack.replace(/^.+\n/,""):"";try{C.stack?E&&!String(C.stack).endsWith(E.replace(/^.+\n.+\n/,""))&&(C.stack+=`
|
|
7
|
-
`+E):C.stack=E}catch{}}throw C}}_request(B,Q){typeof B=="string"?(Q=Q||{},Q.url=B):Q=B||{},Q=zB(this.defaults,Q);const{transitional:C,paramsSerializer:w,headers:E}=Q;C!==void 0&&FC.assertOptions(C,{silentJSONParsing:UB.transitional(UB.boolean),forcedJSONParsing:UB.transitional(UB.boolean),clarifyTimeoutError:UB.transitional(UB.boolean)},!1),w!=null&&(r.isFunction(w)?Q.paramsSerializer={serialize:w}:FC.assertOptions(w,{encode:UB.function,serialize:UB.function},!0)),Q.method=(Q.method||this.defaults.method||"get").toLowerCase();let I=E&&r.merge(E.common,E[Q.method]);E&&r.forEach(["delete","get","head","post","put","patch","common"],F=>{delete E[F]}),Q.headers=yA.concat(I,E);const D=[];let Y=!0;this.interceptors.request.forEach(function(U){typeof U.runWhen=="function"&&U.runWhen(Q)===!1||(Y=Y&&U.synchronous,D.unshift(U.fulfilled,U.rejected))});const e=[];this.interceptors.response.forEach(function(U){e.push(U.fulfilled,U.rejected)});let M,o=0,s;if(!Y){const F=[ZE.bind(this),void 0];for(F.unshift.apply(F,D),F.push.apply(F,e),s=F.length,M=Promise.resolve(Q);o<s;)M=M.then(F[o++],F[o++]);return M}s=D.length;let t=Q;for(o=0;o<s;){const F=D[o++],U=D[o++];try{t=F(t)}catch(i){U.call(this,i);break}}try{M=ZE.call(this,t)}catch(F){return Promise.reject(F)}for(o=0,s=e.length;o<s;)M=M.then(e[o++],e[o++]);return M}getUri(B){B=zB(this.defaults,B);const Q=yE(B.baseURL,B.url);return zE(Q,B.params,B.paramsSerializer)}}r.forEach(["delete","get","head","options"],function(B){vB.prototype[B]=function(Q,C){return this.request(zB(C||{},{method:B,url:Q,data:(C||{}).data}))}}),r.forEach(["post","put","patch"],function(B){function Q(C){return function(E,I,D){return this.request(zB(D||{},{method:B,headers:C?{"Content-Type":"multipart/form-data"}:{},url:E,data:I}))}}vB.prototype[B]=Q(),vB.prototype[B+"Form"]=Q(!0)});class iC{constructor(B){if(typeof B!="function")throw new TypeError("executor must be a function.");let Q;this.promise=new Promise(function(E){Q=E});const C=this;this.promise.then(w=>{if(!C._listeners)return;let E=C._listeners.length;for(;E-- >0;)C._listeners[E](w);C._listeners=null}),this.promise.then=w=>{let E;const I=new Promise(D=>{C.subscribe(D),E=D}).then(w);return I.cancel=function(){C.unsubscribe(E)},I},B(function(E,I,D){C.reason||(C.reason=new OB(E,I,D),Q(C.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(B){if(this.reason){B(this.reason);return}this._listeners?this._listeners.push(B):this._listeners=[B]}unsubscribe(B){if(!this._listeners)return;const Q=this._listeners.indexOf(B);Q!==-1&&this._listeners.splice(Q,1)}toAbortSignal(){const B=new AbortController,Q=C=>{B.abort(C)};return this.subscribe(Q),B.signal.unsubscribe=()=>this.unsubscribe(Q),B.signal}static source(){let B;return{token:new iC(function(w){B=w}),cancel:B}}}function Nc(A){return function(Q){return A.apply(null,Q)}}function dc(A){return r.isObject(A)&&A.isAxiosError===!0}const tC={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(tC).forEach(([A,B])=>{tC[B]=A});function $E(A){const B=new vB(A),Q=tE(vB.prototype.request,B);return r.extend(Q,vB.prototype,B,{allOwnKeys:!0}),r.extend(Q,B,null,{allOwnKeys:!0}),Q.create=function(w){return $E(zB(A,w))},Q}const HA=$E(og);HA.Axios=vB,HA.CanceledError=OB,HA.CancelToken=iC,HA.isCancel=mE,HA.VERSION=qE,HA.toFormData=AQ,HA.AxiosError=wA,HA.Cancel=HA.CanceledError,HA.all=function(B){return Promise.all(B)},HA.spread=Nc,HA.isAxiosError=dc,HA.mergeConfig=zB,HA.AxiosHeaders=yA,HA.formToJSON=A=>LE(r.isHTMLForm(A)?new FormData(A):A),HA.getAdapter=XE.getAdapter,HA.HttpStatusCode=tC,HA.default=HA;class kB{constructor(){CI(this,"axiosInstance");this.axiosInstance=HA.create({baseURL:process.env.VUE_APP_BACKEND,headers:{"Content-Type":"application/json"}}),this.axiosInstance.interceptors.request.use(B=>{const Q=this.getToken();return Q&&B.headers&&(B.headers.Authorization=`Bearer ${Q}`),B},B=>Promise.reject(B)),this.axiosInstance.interceptors.response.use(B=>B.data,B=>{var Q,C;return(((Q=B.response)==null?void 0:Q.status)===401||((C=B.response)==null?void 0:C.status)===403)&&this.logout(),Promise.reject(B)})}getToken(){return localStorage.getItem("token")}removeToken(){localStorage.removeItem("token")}logout(){this.removeToken(),window.location.href="/sign-in"}handleError(B){B.response?console.error("API Error:",B.response.status,B.response.data):B.request?console.error("No response received:",B.request):console.error("Error during request setup:",B.message)}async get(B,Q){try{const C=await this.axiosInstance.get(B,Q);return(C==null?void 0:C.data)??C}catch(C){const w=C;throw this.handleError(w),C}}async delete(B,Q){try{return await this.axiosInstance.delete(B,Q)}catch(C){const w=C;throw this.handleError(w),C}}async post(B,Q,C){try{return(await this.axiosInstance.post(B,Q,C)).data}catch(w){const E=w;throw this.handleError(E),w}}async put(B,Q,C){try{return(await this.axiosInstance.put(B,Q,C)).data}catch(w){const E=w;throw this.handleError(E),w}}}class zc extends kB{async fetchCriticalPathTasks(B){return await this.get(`gantt/get_list_task_on_critical_path?${B}`)}async fetchGanttList(B){return await this.get(`/gantt/tasks?${B}`)}}let nC;function vc(){return nC||(nC=new zc),nC}class kc extends kB{async fetchPieProjects(B){return await this.get("repairs/pie/projects?"+B)}async fetchPieTasks(B){return await this.get("repairs/pie/tasks?"+B)}async fetchPiePersonnel(B){return await this.get("repairs/metrics/get_list_position?"+B)}async fetchPersonnelData(B){return await this.get("repairs/metrics/list_position_intersection_group_by_status?"+B)}async fetchPersonnelInfo(B){return await this.get(`repairs/metrics/list_position_intersection_details?${B}`)}async fetchPiePersonnelInfo(B){return await this.get(`repairs/metrics/get_list_user_by_position?${B}`)}async fetchPieCriticalPath(B){return await this.get("repairs/metrics/get_critical_path_group_by_status?"+B)}async fetchPieCriticalPathInfo(B){return await this.get(`repairs/metrics/get_list_task_critical_path_by_status?${B}`)}async fetchPieTmc(B){return await this.get("repairs/metrics/get_list_instrument_type?"+B)}async fetchPieTmcInfo(B){return await this.get(`repairs/metrics/get_list_warehouse_by_instrument_type?${B}`)}async fetchPieUntimelyClosedTask(B){return await this.get("repairs/metrics/get_list_comment_type?"+B)}async fetchPieUntimelyClosedTaskInfo(B){return await this.get(`repairs/metrics/get_list_task_by_comment_type?${B}`)}async fetchPieAdditionalTasks(B){return await this.get("repairs/metrics/get_list_task_after_plan_fixate_group_by_status?"+B)}async fetchPieAdditionalTasksInfo(B){return await this.get(`repairs/metrics/get_list_task_after_plan_fixate_by_status?${B}`)}async fetchPersonnel(B){return await this.get("repairs/statistic/personnel?"+B)}async fetchPieExpired(B){return await this.get("repairs/metrics/get_list_task_expired_group_by_status?"+B)}async fetchPieExpiredInfo(B){return await this.get(`repairs/metrics/get_list_task_expired?${B}`)}async fetchEconomicsPerformance(B){return await this.get(`repairs/metrics/get_economic_performance?${B}`)}async fetchEconomicsInfo(B){return await this.get(`repairs/metrics/get_list_task_economic_performance?${B}`)}async fetchQualityMetrics(B){return await this.get(`repairs/metrics/get_quality_metrics?${B}`)}async fetchQualityInfo(B){return await this.get(`repairs/metrics/get_list_task_by_quality?${B}`)}async fetchPieWorkZone(B){return await this.get("repairs/metrics/get_list_work_zone_instrument?"+B)}async fetchWorkZoneInfo(B){return await this.get("repairs/metrics/get_list_work_zone_instrument_by_status?"+B)}}let UC;function Lc(){return UC||(UC=new kc),UC}class Rc extends kB{async fetchProjectById(B){return this.get(`/projects/${B}`)}createProject(B){return this.post("/projects",B)}editProject(B,Q){return this.put(`/projects/${B}`,Q)}fetchProjects(B){return this.get("/get_list_project",{params:B})}cloneProject(B){return this.post(`projects/${B.id}/clone`,B)}archiveProject(B,Q){return this.put(`/projects/${B}`,Q)}unArchiveProject(B,Q){return this.put(`/projects/${B}`,Q)}moveAprProject(B){return this.post("repairs/move_plan_to_real",{repairs:[B]})}restoreProject(B){return this.post("/restore_project",{projects_ids:[B]})}importTasks(B){return this.post("tasks/import",B)}fetchProjectTeamList(B){return this.put(`/projects/${B}`,null)}}let sC;function mc(){return sC||(sC=new Rc),sC}class Tc extends kB{fetchFilters(B){return this.get(`get_list_repair?smart=1&${B}`)}fetchRepairs(B,Q,C,w,E){return this.get("get_list_repair"+(B?`${Q}&per_page=100000${E?"&"+E:""}&${C?"":w}`:`?per_page=100000${E?"&"+E:""}&${w}`))}fetchEquipment(){return this.get("repairs/equipment/list?per_page=100000")}createRepair(B){return this.post("/repairs/equipments",B)}startRepair(B){return this.post(`/repairs/${B}/start`,null)}finishRepair(B){return this.post(`/repairs/${B}/finish`,null)}finishPreparationProject(B){return this.post(`/repairs/${B}/finish_preparation`,null)}moveRepairToCurrent(B){return this.post("/repairs/transfer_repair_plan_to_current",{repairs:[B]})}moveArchiveToCurrent(B){return this.post("/repairs/transfer_repair_archive_to_current",{repairs_ids:[B]})}moveRepairToApr(B){return this.post("/repairs/transfer_repair_current_to_plan",{repairs:[B]})}moveRepairToArchive(B){return this.post("/repairs/transfer_repair_current_to_archive",{repairs_ids:[B]})}restoreRepair(B){return this.post("/restore_repair",{repairs_ids:[B]})}updateRepair(B,Q){return this.put(`/repairs/${Q}`,B)}deleteRepair(B){return this.delete(`/repairs/${B}`)}}let GC;function jc(){return GC||(GC=new Tc),GC}class Wc extends kB{async fetchTaskById(B){return await this.get(`/tasks/${B}`)}async fetchTasksList(B){return await this.get("/list/tasks/search",{params:B})}async fetchSubtasksList(B){return await this.get(`/task/${B}/subtasks/list`)}async fetchTaskBranch(B){return await this.get(`/get_list_task_branch?task_id=${B}`)}}let hC;function yc(){return hC||(hC=new Wc),hC}class Kc extends kB{login(B,Q){return this.post("/login",{email:B,password:Q})}logout(){return this.post("/logout",null)}configs(){return this.get("/configs")}}let PC;function Sc(){return PC||(PC=new Kc),PC}MA.ApiService=kB,MA.AppButton=JQ,MA.AppCheckbox=wD,MA.AppDatePicker=kD,MA.AppInput=_D,MA.AppInputSearch=$D,MA.AppLayout=EM,MA.AppLayoutHeader=MM,MA.AppLoader=CE,MA.AppSelect=UM,MA.AppSheet=uM,MA.AppSidebar=Bo,MA.AppToggle=Qo,MA.AppWrapper=Io,MA.useAuthService=Sc,MA.useGanttService=vc,MA.useMetricsService=Lc,MA.useProjectsService=mc,MA.useRepairsService=jc,MA.useTasksService=yc,Object.defineProperty(MA,Symbol.toStringTag,{value:"Module"})});
|
|
7
|
+
`+E):C.stack=E}catch{}}throw C}}_request(B,Q){typeof B=="string"?(Q=Q||{},Q.url=B):Q=B||{},Q=zB(this.defaults,Q);const{transitional:C,paramsSerializer:w,headers:E}=Q;C!==void 0&&FC.assertOptions(C,{silentJSONParsing:UB.transitional(UB.boolean),forcedJSONParsing:UB.transitional(UB.boolean),clarifyTimeoutError:UB.transitional(UB.boolean)},!1),w!=null&&(r.isFunction(w)?Q.paramsSerializer={serialize:w}:FC.assertOptions(w,{encode:UB.function,serialize:UB.function},!0)),Q.method=(Q.method||this.defaults.method||"get").toLowerCase();let I=E&&r.merge(E.common,E[Q.method]);E&&r.forEach(["delete","get","head","post","put","patch","common"],F=>{delete E[F]}),Q.headers=yA.concat(I,E);const D=[];let Y=!0;this.interceptors.request.forEach(function(U){typeof U.runWhen=="function"&&U.runWhen(Q)===!1||(Y=Y&&U.synchronous,D.unshift(U.fulfilled,U.rejected))});const e=[];this.interceptors.response.forEach(function(U){e.push(U.fulfilled,U.rejected)});let M,o=0,s;if(!Y){const F=[ZE.bind(this),void 0];for(F.unshift.apply(F,D),F.push.apply(F,e),s=F.length,M=Promise.resolve(Q);o<s;)M=M.then(F[o++],F[o++]);return M}s=D.length;let t=Q;for(o=0;o<s;){const F=D[o++],U=D[o++];try{t=F(t)}catch(i){U.call(this,i);break}}try{M=ZE.call(this,t)}catch(F){return Promise.reject(F)}for(o=0,s=e.length;o<s;)M=M.then(e[o++],e[o++]);return M}getUri(B){B=zB(this.defaults,B);const Q=yE(B.baseURL,B.url);return zE(Q,B.params,B.paramsSerializer)}}r.forEach(["delete","get","head","options"],function(B){vB.prototype[B]=function(Q,C){return this.request(zB(C||{},{method:B,url:Q,data:(C||{}).data}))}}),r.forEach(["post","put","patch"],function(B){function Q(C){return function(E,I,D){return this.request(zB(D||{},{method:B,headers:C?{"Content-Type":"multipart/form-data"}:{},url:E,data:I}))}}vB.prototype[B]=Q(),vB.prototype[B+"Form"]=Q(!0)});class iC{constructor(B){if(typeof B!="function")throw new TypeError("executor must be a function.");let Q;this.promise=new Promise(function(E){Q=E});const C=this;this.promise.then(w=>{if(!C._listeners)return;let E=C._listeners.length;for(;E-- >0;)C._listeners[E](w);C._listeners=null}),this.promise.then=w=>{let E;const I=new Promise(D=>{C.subscribe(D),E=D}).then(w);return I.cancel=function(){C.unsubscribe(E)},I},B(function(E,I,D){C.reason||(C.reason=new OB(E,I,D),Q(C.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(B){if(this.reason){B(this.reason);return}this._listeners?this._listeners.push(B):this._listeners=[B]}unsubscribe(B){if(!this._listeners)return;const Q=this._listeners.indexOf(B);Q!==-1&&this._listeners.splice(Q,1)}toAbortSignal(){const B=new AbortController,Q=C=>{B.abort(C)};return this.subscribe(Q),B.signal.unsubscribe=()=>this.unsubscribe(Q),B.signal}static source(){let B;return{token:new iC(function(w){B=w}),cancel:B}}}function Nc(A){return function(Q){return A.apply(null,Q)}}function dc(A){return r.isObject(A)&&A.isAxiosError===!0}const tC={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(tC).forEach(([A,B])=>{tC[B]=A});function $E(A){const B=new vB(A),Q=tE(vB.prototype.request,B);return r.extend(Q,vB.prototype,B,{allOwnKeys:!0}),r.extend(Q,B,null,{allOwnKeys:!0}),Q.create=function(w){return $E(zB(A,w))},Q}const HA=$E(og);HA.Axios=vB,HA.CanceledError=OB,HA.CancelToken=iC,HA.isCancel=mE,HA.VERSION=qE,HA.toFormData=AQ,HA.AxiosError=wA,HA.Cancel=HA.CanceledError,HA.all=function(B){return Promise.all(B)},HA.spread=Nc,HA.isAxiosError=dc,HA.mergeConfig=zB,HA.AxiosHeaders=yA,HA.formToJSON=A=>LE(r.isHTMLForm(A)?new FormData(A):A),HA.getAdapter=XE.getAdapter,HA.HttpStatusCode=tC,HA.default=HA;class kB{constructor(){CI(this,"axiosInstance");this.axiosInstance=HA.create({baseURL:process.env.VUE_APP_BACKEND,headers:{"Content-Type":"application/json"}}),this.axiosInstance.interceptors.request.use(B=>{const Q=this.getToken();return Q&&B.headers&&(B.headers.Authorization=`Bearer ${Q}`),B},B=>Promise.reject(B)),this.axiosInstance.interceptors.response.use(B=>B.data,B=>{var Q,C;return(((Q=B.response)==null?void 0:Q.status)===401||((C=B.response)==null?void 0:C.status)===403)&&this.logout(),Promise.reject(B)})}getToken(){return localStorage.getItem("token")}removeToken(){localStorage.removeItem("token")}logout(){this.removeToken(),window.location.href="/sign-in"}handleError(B){B.response?console.error("API Error:",B.response.status,B.response.data):B.request?console.error("No response received:",B.request):console.error("Error during request setup:",B.message)}async get(B,Q){try{const C=await this.axiosInstance.get(B,Q);return(C==null?void 0:C.data)??C}catch(C){const w=C;throw this.handleError(w),C}}async delete(B,Q){try{return await this.axiosInstance.delete(B,Q)}catch(C){const w=C;throw this.handleError(w),C}}async post(B,Q,C){try{return(await this.axiosInstance.post(B,Q,C)).data}catch(w){const E=w;throw this.handleError(E),w}}async put(B,Q,C){try{return(await this.axiosInstance.put(B,Q,C)).data}catch(w){const E=w;throw this.handleError(E),w}}}class zc extends kB{async fetchCriticalPathTasks(B){return await this.get(`gantt/get_list_task_on_critical_path?${B}`)}async fetchGanttList(B){return await this.get(`/gantt/tasks?${B}`)}}let nC;function vc(){return nC||(nC=new zc),nC}class kc extends kB{async fetchPieProjects(B){return await this.get("repairs/pie/projects?"+B)}async fetchPieTasks(B){return await this.get("repairs/pie/tasks?"+B)}async fetchPiePersonnel(B){return await this.get("repairs/metrics/get_list_position?"+B)}async fetchPersonnelData(B){return await this.get("repairs/metrics/list_position_intersection_group_by_status?"+B)}async fetchPersonnelInfo(B){return await this.get(`repairs/metrics/list_position_intersection_details?${B}`)}async fetchPiePersonnelInfo(B){return await this.get(`repairs/metrics/get_list_user_by_position?${B}`)}async fetchPieCriticalPath(B){return await this.get("repairs/metrics/get_critical_path_group_by_status?"+B)}async fetchPieCriticalPathInfo(B){return await this.get(`repairs/metrics/get_list_task_critical_path_by_status?${B}`)}async fetchPieTmc(B){return await this.get("repairs/metrics/get_list_instrument_type?"+B)}async fetchPieTmcInfo(B){return await this.get(`repairs/metrics/get_list_warehouse_by_instrument_type?${B}`)}async fetchPieUntimelyClosedTask(B){return await this.get("repairs/metrics/get_list_comment_type?"+B)}async fetchPieUntimelyClosedTaskInfo(B){return await this.get(`repairs/metrics/get_list_task_by_comment_type?${B}`)}async fetchPieAdditionalTasks(B){return await this.get("repairs/metrics/get_list_task_after_plan_fixate_group_by_status?"+B)}async fetchPieAdditionalTasksInfo(B){return await this.get(`repairs/metrics/get_list_task_after_plan_fixate_by_status?${B}`)}async fetchPersonnel(B){return await this.get("repairs/statistic/personnel?"+B)}async fetchPieExpired(B){return await this.get("repairs/metrics/get_list_task_expired_group_by_status?"+B)}async fetchPieExpiredInfo(B){return await this.get(`repairs/metrics/get_list_task_expired?${B}`)}async fetchEconomicsPerformance(B){return await this.get(`repairs/metrics/get_economic_performance?${B}`)}async fetchEconomicsInfo(B){return await this.get(`repairs/metrics/get_list_task_economic_performance?${B}`)}async fetchQualityMetrics(B){return await this.get(`repairs/metrics/get_quality_metrics?${B}`)}async fetchQualityInfo(B){return await this.get(`repairs/metrics/get_list_task_by_quality?${B}`)}async fetchPieWorkZone(B){return await this.get("repairs/metrics/get_list_work_zone_instrument?"+B)}async fetchWorkZoneInfo(B){return await this.get("repairs/metrics/get_list_work_zone_instrument_by_status?"+B)}}let UC;function Lc(){return UC||(UC=new kc),UC}class Rc extends kB{async fetchProjectById(B){return this.get(`/projects/${B}`)}createProject(B){return this.post("/projects",B)}editProject(B,Q){return this.put(`/projects/${B}`,Q)}fetchProjects(B){return this.get("/get_list_project",{params:B})}cloneProject(B){return this.post(`projects/${B.id}/clone`,B)}archiveProject(B,Q){return this.put(`/projects/${B}`,Q)}unArchiveProject(B,Q){return this.put(`/projects/${B}`,Q)}moveAprProject(B){return this.post("repairs/move_plan_to_real",{repairs:[B]})}restoreProject(B){return this.post("/restore_project",{projects_ids:[B]})}importTasks(B){return this.post("tasks/import",B)}fetchProjectTeamList(B){return this.put(`/projects/${B}`,null)}}let sC;function mc(){return sC||(sC=new Rc),sC}class Tc extends kB{fetchFilters(B){return this.get(`get_list_repair?smart=1&${B}`)}fetchRepairs(B,Q,C,w,E){return this.get("get_list_repair"+(B?`${Q}&per_page=100000${E?"&"+E:""}&${C?"":w}`:`?per_page=100000${E?"&"+E:""}&${w}`))}fetchEquipment(){return this.get("repairs/equipment/list?per_page=100000")}createRepair(B){return this.post("/repairs/equipments",B)}startRepair(B){return this.post(`/repairs/${B}/start`,null)}finishRepair(B){return this.post(`/repairs/${B}/finish`,null)}finishPreparationProject(B){return this.post(`/repairs/${B}/finish_preparation`,null)}moveRepairToCurrent(B){return this.post("/repairs/transfer_repair_plan_to_current",{repairs:[B]})}moveArchiveToCurrent(B){return this.post("/repairs/transfer_repair_archive_to_current",{repairs_ids:[B]})}moveRepairToApr(B){return this.post("/repairs/transfer_repair_current_to_plan",{repairs:[B]})}moveRepairToArchive(B){return this.post("/repairs/transfer_repair_current_to_archive",{repairs_ids:[B]})}restoreRepair(B){return this.post("/restore_repair",{repairs_ids:[B]})}updateRepair(B,Q){return this.put(`/repairs/${Q}`,B)}deleteRepair(B){return this.delete(`/repairs/${B}`)}}let GC;function jc(){return GC||(GC=new Tc),GC}class Wc extends kB{async fetchTaskById(B){return await this.get(`/tasks/${B}`)}async fetchTasksList(B){return await this.get("/list/tasks/search",{params:B})}async fetchSubtasksList(B){return await this.get(`/task/${B}/subtasks/list`)}async fetchTaskBranch(B){return await this.get(`/get_list_task_branch?task_id=${B}`)}}let hC;function yc(){return hC||(hC=new Wc),hC}class Kc extends kB{login(B,Q){return this.post("/login",{email:B,password:Q})}logout(){return this.post("/logout",null)}userInfo(){return this.get("/users/auth")}configs(){return this.get("/configs")}}let PC;function Sc(){return PC||(PC=new Kc),PC}MA.ApiService=kB,MA.AppButton=JQ,MA.AppCheckbox=wD,MA.AppDatePicker=kD,MA.AppInput=_D,MA.AppInputSearch=$D,MA.AppLayout=EM,MA.AppLayoutHeader=MM,MA.AppLoader=CE,MA.AppSelect=UM,MA.AppSheet=uM,MA.AppSidebar=Bo,MA.AppToggle=Qo,MA.AppWrapper=Io,MA.useAuthService=Sc,MA.useGanttService=vc,MA.useMetricsService=Lc,MA.useProjectsService=mc,MA.useRepairsService=jc,MA.useTasksService=yc,Object.defineProperty(MA,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -6,6 +6,7 @@ type LoginResponse = {
|
|
|
6
6
|
declare class AuthService extends ApiService {
|
|
7
7
|
login(email: string, password: string): Promise<LoginResponse>;
|
|
8
8
|
logout(): Promise<LoginResponse>;
|
|
9
|
+
userInfo(): Promise<any>;
|
|
9
10
|
configs(): Promise<any>;
|
|
10
11
|
}
|
|
11
12
|
export default function useAuthService(): AuthService;
|
package/package.json
CHANGED