shared-ritm 1.0.37 → 1.0.38
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
|
@@ -9563,6 +9563,11 @@ class U1 extends sn {
|
|
|
9563
9563
|
repairs_ids: [t]
|
|
9564
9564
|
});
|
|
9565
9565
|
}
|
|
9566
|
+
restoreRepair(t) {
|
|
9567
|
+
return this.post("/restore_repair", {
|
|
9568
|
+
repairs_ids: [t]
|
|
9569
|
+
});
|
|
9570
|
+
}
|
|
9566
9571
|
updateRepair(t, n) {
|
|
9567
9572
|
return this.put(`/repairs/${n}`, t);
|
|
9568
9573
|
}
|
package/dist/shared-ritm.umd.js
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...o){const r=new this(t);return o.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[Ci]=this[Ci]={accessors:{}}).accessors,i=this.prototype;function l(a){const s=Ot(a);r[s]||($d(i,a),r[s]=!0)}return C.isArray(t)?t.forEach(l):l(t),this}}Ce.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),C.reduceDescriptors(Ce.prototype,({value:e},t)=>{let o=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[o]=r}}}),C.freezeMethods(Ce);function ko(e,t){const o=this||At,r=t||o,i=Ce.from(r.headers);let l=r.data;return C.forEach(e,function(s){l=s.call(o,l,i.normalize(),t?t.status:void 0)}),i.normalize(),l}function Si(e){return!!(e&&e.__CANCEL__)}function ht(e,t,o){Y.call(this,e??"canceled",Y.ERR_CANCELED,t,o),this.name="CanceledError"}C.inherits(ht,Y,{__CANCEL__:!0});function xi(e,t,o){const r=o.config.validateStatus;!o.status||!r||r(o.status)?e(o):t(new Y("Request failed with status code "+o.status,[Y.ERR_BAD_REQUEST,Y.ERR_BAD_RESPONSE][Math.floor(o.status/100)-4],o.config,o.request,o))}function Ld(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Rd(e,t){e=e||10;const o=new Array(e),r=new Array(e);let i=0,l=0,a;return t=t!==void 0?t:1e3,function(d){const c=Date.now(),u=r[l];a||(a=c),o[i]=d,r[i]=c;let f=l,w=0;for(;f!==i;)w+=o[f++],f=f%e;if(i=(i+1)%e,i===l&&(l=(l+1)%e),c-a<t)return;const g=u&&c-u;return g?Math.round(w*1e3/g):void 0}}function Ad(e,t){let o=0,r=1e3/t,i,l;const a=(c,u=Date.now())=>{o=u,i=null,l&&(clearTimeout(l),l=null),e.apply(null,c)};return[(...c)=>{const u=Date.now(),f=u-o;f>=r?a(c,u):(i=c,l||(l=setTimeout(()=>{l=null,a(i)},r-f)))},()=>i&&a(i)]}const bn=(e,t,o=3)=>{let r=0;const i=Rd(50,250);return Ad(l=>{const a=l.loaded,s=l.lengthComputable?l.total:void 0,d=a-r,c=i(d),u=a<=s;r=a;const f={loaded:a,total:s,progress:s?a/s:void 0,bytes:d,rate:c||void 0,estimated:c&&s&&u?(s-a)/c:void 0,event:l,lengthComputable:s!=null,[t?"download":"upload"]:!0};e(f)},o)},Bi=(e,t)=>{const o=e!=null;return[r=>t[0]({lengthComputable:o,total:e,loaded:r}),t[1]]},Ei=e=>(...t)=>C.asap(()=>e(...t)),Od=_e.hasStandardBrowserEnv?function(){const t=_e.navigator&&/(msie|trident)/i.test(_e.navigator.userAgent),o=document.createElement("a");let r;function i(l){let a=l;return t&&(o.setAttribute("href",a),a=o.href),o.setAttribute("href",a),{href:o.href,protocol:o.protocol?o.protocol.replace(/:$/,""):"",host:o.host,search:o.search?o.search.replace(/^\?/,""):"",hash:o.hash?o.hash.replace(/^#/,""):"",hostname:o.hostname,port:o.port,pathname:o.pathname.charAt(0)==="/"?o.pathname:"/"+o.pathname}}return r=i(window.location.href),function(a){const s=C.isString(a)?i(a):a;return s.protocol===r.protocol&&s.host===r.host}}():function(){return function(){return!0}}(),Pd=_e.hasStandardBrowserEnv?{write(e,t,o,r,i,l){const a=[e+"="+encodeURIComponent(t)];C.isNumber(o)&&a.push("expires="+new Date(o).toGMTString()),C.isString(r)&&a.push("path="+r),C.isString(i)&&a.push("domain="+i),l===!0&&a.push("secure"),document.cookie=a.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 Id(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function jd(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function qi(e,t){return e&&!Id(t)?jd(e,t):t}const Vi=e=>e instanceof Ce?{...e}:e;function nt(e,t){t=t||{};const o={};function r(c,u,f){return C.isPlainObject(c)&&C.isPlainObject(u)?C.merge.call({caseless:f},c,u):C.isPlainObject(u)?C.merge({},u):C.isArray(u)?u.slice():u}function i(c,u,f){if(C.isUndefined(u)){if(!C.isUndefined(c))return r(void 0,c,f)}else return r(c,u,f)}function l(c,u){if(!C.isUndefined(u))return r(void 0,u)}function a(c,u){if(C.isUndefined(u)){if(!C.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function s(c,u,f){if(f in t)return r(c,u);if(f in e)return r(void 0,c)}const d={url:l,method:l,data:l,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(c,u)=>i(Vi(c),Vi(u),!0)};return C.forEach(Object.keys(Object.assign({},e,t)),function(u){const f=d[u]||i,w=f(e[u],t[u],u);C.isUndefined(w)&&f!==s||(o[u]=w)}),o}const Ti=e=>{const t=nt({},e);let{data:o,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:l,headers:a,auth:s}=t;t.headers=a=Ce.from(a),t.url=ki(qi(t.baseURL,t.url),e.params,e.paramsSerializer),s&&a.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):"")));let d;if(C.isFormData(o)){if(_e.hasStandardBrowserEnv||_e.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((d=a.getContentType())!==!1){const[c,...u]=d?d.split(";").map(f=>f.trim()).filter(Boolean):[];a.setContentType([c||"multipart/form-data",...u].join("; "))}}if(_e.hasStandardBrowserEnv&&(r&&C.isFunction(r)&&(r=r(t)),r||r!==!1&&Od(t.url))){const c=i&&l&&Pd.read(l);c&&a.set(i,c)}return t},Nd=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(o,r){const i=Ti(e);let l=i.data;const a=Ce.from(i.headers).normalize();let{responseType:s,onUploadProgress:d,onDownloadProgress:c}=i,u,f,w,g,m;function v(){g&&g(),m&&m(),i.cancelToken&&i.cancelToken.unsubscribe(u),i.signal&&i.signal.removeEventListener("abort",u)}let p=new XMLHttpRequest;p.open(i.method.toUpperCase(),i.url,!0),p.timeout=i.timeout;function x(){if(!p)return;const B=Ce.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),q={data:!s||s==="text"||s==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:B,config:e,request:p};xi(function($){o($),v()},function($){r($),v()},q),p=null}"onloadend"in p?p.onloadend=x:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(x)},p.onabort=function(){p&&(r(new Y("Request aborted",Y.ECONNABORTED,e,p)),p=null)},p.onerror=function(){r(new Y("Network Error",Y.ERR_NETWORK,e,p)),p=null},p.ontimeout=function(){let T=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const q=i.transitional||bi;i.timeoutErrorMessage&&(T=i.timeoutErrorMessage),r(new Y(T,q.clarifyTimeoutError?Y.ETIMEDOUT:Y.ECONNABORTED,e,p)),p=null},l===void 0&&a.setContentType(null),"setRequestHeader"in p&&C.forEach(a.toJSON(),function(T,q){p.setRequestHeader(q,T)}),C.isUndefined(i.withCredentials)||(p.withCredentials=!!i.withCredentials),s&&s!=="json"&&(p.responseType=i.responseType),c&&([w,m]=bn(c,!0),p.addEventListener("progress",w)),d&&p.upload&&([f,g]=bn(d),p.upload.addEventListener("progress",f),p.upload.addEventListener("loadend",g)),(i.cancelToken||i.signal)&&(u=B=>{p&&(r(!B||B.type?new ht(null,e,p):B),p.abort(),p=null)},i.cancelToken&&i.cancelToken.subscribe(u),i.signal&&(i.signal.aborted?u():i.signal.addEventListener("abort",u)));const y=Ld(i.url);if(y&&_e.protocols.indexOf(y)===-1){r(new Y("Unsupported protocol "+y+":",Y.ERR_BAD_REQUEST,e));return}p.send(l||null)})},zd=(e,t)=>{const{length:o}=e=e?e.filter(Boolean):[];if(t||o){let r=new AbortController,i;const l=function(c){if(!i){i=!0,s();const u=c instanceof Error?c:this.reason;r.abort(u instanceof Y?u:new ht(u instanceof Error?u.message:u))}};let a=t&&setTimeout(()=>{a=null,l(new Y(`timeout ${t} of ms exceeded`,Y.ETIMEDOUT))},t);const s=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(l):c.removeEventListener("abort",l)}),e=null)};e.forEach(c=>c.addEventListener("abort",l));const{signal:d}=r;return d.unsubscribe=()=>C.asap(s),d}},Fd=function*(e,t){let o=e.byteLength;if(o<t){yield e;return}let r=0,i;for(;r<o;)i=r+t,yield e.slice(r,i),r=i},Hd=async function*(e,t){for await(const o of Dd(e))yield*Fd(o,t)},Dd=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:o,value:r}=await t.read();if(o)break;yield r}}finally{await t.cancel()}},Mi=(e,t,o,r)=>{const i=Hd(e,t);let l=0,a,s=d=>{a||(a=!0,r&&r(d))};return new ReadableStream({async pull(d){try{const{done:c,value:u}=await i.next();if(c){s(),d.close();return}let f=u.byteLength;if(o){let w=l+=f;o(w)}d.enqueue(new Uint8Array(u))}catch(c){throw s(c),c}},cancel(d){return s(d),i.return()}},{highWaterMark:2})},_n=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",$i=_n&&typeof ReadableStream=="function",Ud=_n&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Li=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Wd=$i&&Li(()=>{let e=!1;const t=new Request(_e.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Ri=64*1024,yo=$i&&Li(()=>C.isReadableStream(new Response("").body)),Cn={stream:yo&&(e=>e.body)};_n&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Cn[t]&&(Cn[t]=C.isFunction(e[t])?o=>o[t]():(o,r)=>{throw new Y(`Response type '${t}' is not supported`,Y.ERR_NOT_SUPPORT,r)})})})(new Response);const Kd=async e=>{if(e==null)return 0;if(C.isBlob(e))return e.size;if(C.isSpecCompliantForm(e))return(await new Request(_e.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(C.isArrayBufferView(e)||C.isArrayBuffer(e))return e.byteLength;if(C.isURLSearchParams(e)&&(e=e+""),C.isString(e))return(await Ud(e)).byteLength},Qd=async(e,t)=>{const o=C.toFiniteNumber(e.getContentLength());return o??Kd(t)},bo={http:pd,xhr:Nd,fetch:_n&&(async e=>{let{url:t,method:o,data:r,signal:i,cancelToken:l,timeout:a,onDownloadProgress:s,onUploadProgress:d,responseType:c,headers:u,withCredentials:f="same-origin",fetchOptions:w}=Ti(e);c=c?(c+"").toLowerCase():"text";let g=zd([i,l&&l.toAbortSignal()],a),m;const v=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let p;try{if(d&&Wd&&o!=="get"&&o!=="head"&&(p=await Qd(u,r))!==0){let q=new Request(t,{method:"POST",body:r,duplex:"half"}),M;if(C.isFormData(r)&&(M=q.headers.get("content-type"))&&u.setContentType(M),q.body){const[$,z]=Bi(p,bn(Ei(d)));r=Mi(q.body,Ri,$,z)}}C.isString(f)||(f=f?"include":"omit");const x="credentials"in Request.prototype;m=new Request(t,{...w,signal:g,method:o.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:x?f:void 0});let y=await fetch(m);const B=yo&&(c==="stream"||c==="response");if(yo&&(s||B&&v)){const q={};["status","statusText","headers"].forEach(S=>{q[S]=y[S]});const M=C.toFiniteNumber(y.headers.get("content-length")),[$,z]=s&&Bi(M,bn(Ei(s),!0))||[];y=new Response(Mi(y.body,Ri,$,()=>{z&&z(),v&&v()}),q)}c=c||"text";let T=await Cn[C.findKey(Cn,c)||"text"](y,e);return!B&&v&&v(),await new Promise((q,M)=>{xi(q,M,{data:T,headers:Ce.from(y.headers),status:y.status,statusText:y.statusText,config:e,request:m})})}catch(x){throw v&&v(),x&&x.name==="TypeError"&&/fetch/i.test(x.message)?Object.assign(new Y("Network Error",Y.ERR_NETWORK,e,m),{cause:x.cause||x}):Y.from(x,x&&x.code,e,m)}})};C.forEach(bo,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Ai=e=>`- ${e}`,Zd=e=>C.isFunction(e)||e===null||e===!1,Oi={getAdapter:e=>{e=C.isArray(e)?e:[e];const{length:t}=e;let o,r;const i={};for(let l=0;l<t;l++){o=e[l];let a;if(r=o,!Zd(o)&&(r=bo[(a=String(o)).toLowerCase()],r===void 0))throw new Y(`Unknown adapter '${a}'`);if(r)break;i[a||"#"+l]=r}if(!r){const l=Object.entries(i).map(([s,d])=>`adapter ${s} `+(d===!1?"is not supported by the environment":"is not available in the build"));let a=t?l.length>1?`since :
|
|
5
5
|
`+l.map(Ai).join(`
|
|
6
6
|
`):" "+Ai(l[0]):"as no adapter specified";throw new Y("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:bo};function _o(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ht(null,e)}function Pi(e){return _o(e),e.headers=Ce.from(e.headers),e.data=ko.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Oi.getAdapter(e.adapter||At.adapter)(e).then(function(r){return _o(e),r.data=ko.call(e,e.transformResponse,r),r.headers=Ce.from(r.headers),r},function(r){return Si(r)||(_o(e),r&&r.response&&(r.response.data=ko.call(e,e.transformResponse,r.response),r.response.headers=Ce.from(r.response.headers))),Promise.reject(r)})}const Ii="1.7.7",Co={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Co[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const ji={};Co.transitional=function(t,o,r){function i(l,a){return"[Axios v"+Ii+"] Transitional option '"+l+"'"+a+(r?". "+r:"")}return(l,a,s)=>{if(t===!1)throw new Y(i(a," has been removed"+(o?" in "+o:"")),Y.ERR_DEPRECATED);return o&&!ji[a]&&(ji[a]=!0,console.warn(i(a," has been deprecated since v"+o+" and will be removed in the near future"))),t?t(l,a,s):!0}};function Xd(e,t,o){if(typeof e!="object")throw new Y("options must be an object",Y.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const l=r[i],a=t[l];if(a){const s=e[l],d=s===void 0||a(s,l,e);if(d!==!0)throw new Y("option "+l+" must be "+d,Y.ERR_BAD_OPTION_VALUE);continue}if(o!==!0)throw new Y("Unknown option "+l,Y.ERR_BAD_OPTION)}}const So={assertOptions:Xd,validators:Co},He=So.validators;class ot{constructor(t){this.defaults=t,this.interceptors={request:new yi,response:new yi}}async request(t,o){try{return await this._request(t,o)}catch(r){if(r instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const l=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?l&&!String(r.stack).endsWith(l.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
7
|
-
`+l):r.stack=l}catch{}}throw r}}_request(t,o){typeof t=="string"?(o=o||{},o.url=t):o=t||{},o=nt(this.defaults,o);const{transitional:r,paramsSerializer:i,headers:l}=o;r!==void 0&&So.assertOptions(r,{silentJSONParsing:He.transitional(He.boolean),forcedJSONParsing:He.transitional(He.boolean),clarifyTimeoutError:He.transitional(He.boolean)},!1),i!=null&&(C.isFunction(i)?o.paramsSerializer={serialize:i}:So.assertOptions(i,{encode:He.function,serialize:He.function},!0)),o.method=(o.method||this.defaults.method||"get").toLowerCase();let a=l&&C.merge(l.common,l[o.method]);l&&C.forEach(["delete","get","head","post","put","patch","common"],m=>{delete l[m]}),o.headers=Ce.concat(a,l);const s=[];let d=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(o)===!1||(d=d&&v.synchronous,s.unshift(v.fulfilled,v.rejected))});const c=[];this.interceptors.response.forEach(function(v){c.push(v.fulfilled,v.rejected)});let u,f=0,w;if(!d){const m=[Pi.bind(this),void 0];for(m.unshift.apply(m,s),m.push.apply(m,c),w=m.length,u=Promise.resolve(o);f<w;)u=u.then(m[f++],m[f++]);return u}w=s.length;let g=o;for(f=0;f<w;){const m=s[f++],v=s[f++];try{g=m(g)}catch(p){v.call(this,p);break}}try{u=Pi.call(this,g)}catch(m){return Promise.reject(m)}for(f=0,w=c.length;f<w;)u=u.then(c[f++],c[f++]);return u}getUri(t){t=nt(this.defaults,t);const o=qi(t.baseURL,t.url);return ki(o,t.params,t.paramsSerializer)}}C.forEach(["delete","get","head","options"],function(t){ot.prototype[t]=function(o,r){return this.request(nt(r||{},{method:t,url:o,data:(r||{}).data}))}}),C.forEach(["post","put","patch"],function(t){function o(r){return function(l,a,s){return this.request(nt(s||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:l,data:a}))}}ot.prototype[t]=o(),ot.prototype[t+"Form"]=o(!0)});class xo{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let o;this.promise=new Promise(function(l){o=l});const r=this;this.promise.then(i=>{if(!r._listeners)return;let l=r._listeners.length;for(;l-- >0;)r._listeners[l](i);r._listeners=null}),this.promise.then=i=>{let l;const a=new Promise(s=>{r.subscribe(s),l=s}).then(i);return a.cancel=function(){r.unsubscribe(l)},a},t(function(l,a,s){r.reason||(r.reason=new ht(l,a,s),o(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 o=this._listeners.indexOf(t);o!==-1&&this._listeners.splice(o,1)}toAbortSignal(){const t=new AbortController,o=r=>{t.abort(r)};return this.subscribe(o),t.signal.unsubscribe=()=>this.unsubscribe(o),t.signal}static source(){let t;return{token:new xo(function(i){t=i}),cancel:t}}}function Gd(e){return function(o){return e.apply(null,o)}}function Yd(e){return C.isObject(e)&&e.isAxiosError===!0}const Bo={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(Bo).forEach(([e,t])=>{Bo[t]=e});function Ni(e){const t=new ot(e),o=oi(ot.prototype.request,t);return C.extend(o,ot.prototype,t,{allOwnKeys:!0}),C.extend(o,t,null,{allOwnKeys:!0}),o.create=function(i){return Ni(nt(e,i))},o}const de=Ni(At);de.Axios=ot,de.CanceledError=ht,de.CancelToken=xo,de.isCancel=Si,de.VERSION=Ii,de.toFormData=kn,de.AxiosError=Y,de.Cancel=de.CanceledError,de.all=function(t){return Promise.all(t)},de.spread=Gd,de.isAxiosError=Yd,de.mergeConfig=nt,de.AxiosHeaders=Ce,de.formToJSON=e=>_i(C.isHTMLForm(e)?new FormData(e):e),de.getAdapter=Oi.getAdapter,de.HttpStatusCode=Bo,de.default=de;class Pt{constructor(){el(this,"axiosInstance");this.axiosInstance=de.create({baseURL:process.env.VUE_APP_BACKEND,headers:{"Content-Type":"application/json"}}),this.axiosInstance.interceptors.request.use(t=>{const o=this.getToken();return o&&t.headers&&(t.headers.Authorization=`Bearer ${o}`),t},t=>Promise.reject(t)),this.axiosInstance.interceptors.response.use(t=>t.data,t=>{var o,r;return(((o=t.response)==null?void 0:o.status)===401||((r=t.response)==null?void 0:r.status)===403)&&this.logout(),Promise.reject(t)})}getToken(){return localStorage.getItem("token")}removeToken(){localStorage.removeItem("token")}logout(){this.removeToken(),window.location.href="/sign-in"}handleError(t){t.response?console.error("API Error:",t.response.status,t.response.data):t.request?console.error("No response received:",t.request):console.error("Error during request setup:",t.message)}async get(t,o){try{const r=await this.axiosInstance.get(t,o);return(r==null?void 0:r.data)??r}catch(r){const i=r;throw this.handleError(i),r}}async delete(t,o){try{return await this.axiosInstance.delete(t,o)}catch(r){const i=r;throw this.handleError(i),r}}async post(t,o,r){try{return(await this.axiosInstance.post(t,o,r)).data}catch(i){const l=i;throw this.handleError(l),i}}async put(t,o,r){try{return(await this.axiosInstance.put(t,o,r)).data}catch(i){const l=i;throw this.handleError(l),i}}}class Jd extends Pt{async fetchCriticalPathTasks(t){return await this.get(`gantt/get_list_task_on_critical_path?${t}`)}async fetchGanttList(t){return await this.get(`/gantt/tasks?${t}`)}}let Eo;function ef(){return Eo||(Eo=new Jd),Eo}class tf extends Pt{async fetchPieProjects(t){return await this.get("repairs/pie/projects?"+t)}async fetchPieTasks(t){return await this.get("repairs/pie/tasks?"+t)}async fetchPiePersonnel(t){return await this.get("repairs/metrics/get_list_position?"+t)}async fetchPiePersonnelInfo(t){return await this.get(`repairs/metrics/get_list_user_by_position?${t}`)}async fetchPieWorkZone(t){return await this.get("repairs/metrics/get_list_work_zone_instrument?"+t)}async fetchPieCriticalPath(t){return await this.get("repairs/metrics/get_critical_path_group_by_status?"+t)}async fetchPieCriticalPathInfo(t){return await this.get(`repairs/metrics/get_list_task_critical_path_by_status?${t}`)}async fetchPieTmc(t){return await this.get("repairs/metrics/get_list_instrument_type?"+t)}async fetchPieTmcInfo(t){return await this.get(`repairs/metrics/get_list_warehouse_by_instrument_type?${t}`)}async fetchPieUntimelyClosedTask(t){return await this.get("repairs/metrics/get_list_comment_type?"+t)}async fetchPieUntimelyClosedTaskInfo(t){return await this.get(`repairs/metrics/get_list_task_by_comment_type?${t}`)}async fetchPieAdditionalTasks(t){return await this.get("repairs/metrics/get_list_task_after_plan_fixate_group_by_status?"+t)}async fetchPieAdditionalTasksInfo(t){return await this.get(`repairs/metrics/get_list_task_after_plan_fixate_by_status?${t}`)}async fetchPersonnel(t){return await this.get("repairs/statistic/personnel?"+t)}async fetchPieExpired(t){return await this.get("repairs/metrics/get_list_task_expired_group_by_status?"+t)}async fetchPieExpiredInfo(t){return await this.get(`repairs/metrics/get_list_task_expired?${t}`)}}let qo;function nf(){return qo||(qo=new tf),qo}class of extends Pt{async fetchProjectById(t){return await this.get(`/projects/${t}`)}}let Vo;function rf(){return Vo||(Vo=new of),Vo}class lf extends Pt{fetchFilters(t){return this.get(`repairs?smart=1&${t}`)}fetchRepairs(t,o,r,i,l){return this.get("get_list_repair"+(t?`${o}&per_page=100000${l?"&"+l:""}&${r?"":i}`:`?per_page=100000${l?"&"+l:""}&${i}`))}fetchEquipment(){return this.get("repairs/equipment/list?per_page=100000")}createRepair(t){return this.post("/repairs/equipments",t)}startRepair(t){return this.post(`/repairs/${t}/start`,null)}finishRepair(t){return this.post(`/repairs/${t}/finish`,null)}finishPreparationProject(t){return this.post(`/repairs/${t}/finish_preparation`,null)}moveRepairToCurrent(t){return this.post("/repairs/transfer_repair_plan_to_current",{repairs:[t]})}moveArchiveToCurrent(t){return this.post("/repairs/transfer_repair_archive_to_current",{repairs_ids:[t]})}moveRepairToApr(t){return this.post("/repairs/transfer_repair_current_to_plan",{repairs:[t]})}moveRepairToArchive(t){return this.post("/repairs/transfer_repair_current_to_archive",{repairs_ids:[t]})}updateRepair(t,o){return this.put(`/repairs/${o}`,t)}deleteRepair(t){return this.delete(`/repairs/${t}`)}}let To;function af(){return To||(To=new lf),To}class sf extends Pt{async fetchTaskById(t){return await this.get(`/tasks/${t}`)}}let Mo;function uf(){return Mo||(Mo=new sf),Mo}ne.AppButton=gr,ne.AppInput=ga,ne.AppInputSearch=pa,ne.AppLayout=Ta,ne.AppLayoutHeader=qc,ne.AppLoader=Vc,ne.AppSelect=Qa,ne.AppSidebar=xc,ne.AppToggle=Ca,ne.AppWrapper=Ya,ne.useGanttService=ef,ne.useMetricsService=nf,ne.useProjectsService=rf,ne.useRepairsService=af,ne.useTasksService=uf,Object.defineProperty(ne,Symbol.toStringTag,{value:"Module"})});
|
|
7
|
+
`+l):r.stack=l}catch{}}throw r}}_request(t,o){typeof t=="string"?(o=o||{},o.url=t):o=t||{},o=nt(this.defaults,o);const{transitional:r,paramsSerializer:i,headers:l}=o;r!==void 0&&So.assertOptions(r,{silentJSONParsing:He.transitional(He.boolean),forcedJSONParsing:He.transitional(He.boolean),clarifyTimeoutError:He.transitional(He.boolean)},!1),i!=null&&(C.isFunction(i)?o.paramsSerializer={serialize:i}:So.assertOptions(i,{encode:He.function,serialize:He.function},!0)),o.method=(o.method||this.defaults.method||"get").toLowerCase();let a=l&&C.merge(l.common,l[o.method]);l&&C.forEach(["delete","get","head","post","put","patch","common"],m=>{delete l[m]}),o.headers=Ce.concat(a,l);const s=[];let d=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(o)===!1||(d=d&&v.synchronous,s.unshift(v.fulfilled,v.rejected))});const c=[];this.interceptors.response.forEach(function(v){c.push(v.fulfilled,v.rejected)});let u,f=0,w;if(!d){const m=[Pi.bind(this),void 0];for(m.unshift.apply(m,s),m.push.apply(m,c),w=m.length,u=Promise.resolve(o);f<w;)u=u.then(m[f++],m[f++]);return u}w=s.length;let g=o;for(f=0;f<w;){const m=s[f++],v=s[f++];try{g=m(g)}catch(p){v.call(this,p);break}}try{u=Pi.call(this,g)}catch(m){return Promise.reject(m)}for(f=0,w=c.length;f<w;)u=u.then(c[f++],c[f++]);return u}getUri(t){t=nt(this.defaults,t);const o=qi(t.baseURL,t.url);return ki(o,t.params,t.paramsSerializer)}}C.forEach(["delete","get","head","options"],function(t){ot.prototype[t]=function(o,r){return this.request(nt(r||{},{method:t,url:o,data:(r||{}).data}))}}),C.forEach(["post","put","patch"],function(t){function o(r){return function(l,a,s){return this.request(nt(s||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:l,data:a}))}}ot.prototype[t]=o(),ot.prototype[t+"Form"]=o(!0)});class xo{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let o;this.promise=new Promise(function(l){o=l});const r=this;this.promise.then(i=>{if(!r._listeners)return;let l=r._listeners.length;for(;l-- >0;)r._listeners[l](i);r._listeners=null}),this.promise.then=i=>{let l;const a=new Promise(s=>{r.subscribe(s),l=s}).then(i);return a.cancel=function(){r.unsubscribe(l)},a},t(function(l,a,s){r.reason||(r.reason=new ht(l,a,s),o(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 o=this._listeners.indexOf(t);o!==-1&&this._listeners.splice(o,1)}toAbortSignal(){const t=new AbortController,o=r=>{t.abort(r)};return this.subscribe(o),t.signal.unsubscribe=()=>this.unsubscribe(o),t.signal}static source(){let t;return{token:new xo(function(i){t=i}),cancel:t}}}function Gd(e){return function(o){return e.apply(null,o)}}function Yd(e){return C.isObject(e)&&e.isAxiosError===!0}const Bo={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(Bo).forEach(([e,t])=>{Bo[t]=e});function Ni(e){const t=new ot(e),o=oi(ot.prototype.request,t);return C.extend(o,ot.prototype,t,{allOwnKeys:!0}),C.extend(o,t,null,{allOwnKeys:!0}),o.create=function(i){return Ni(nt(e,i))},o}const de=Ni(At);de.Axios=ot,de.CanceledError=ht,de.CancelToken=xo,de.isCancel=Si,de.VERSION=Ii,de.toFormData=kn,de.AxiosError=Y,de.Cancel=de.CanceledError,de.all=function(t){return Promise.all(t)},de.spread=Gd,de.isAxiosError=Yd,de.mergeConfig=nt,de.AxiosHeaders=Ce,de.formToJSON=e=>_i(C.isHTMLForm(e)?new FormData(e):e),de.getAdapter=Oi.getAdapter,de.HttpStatusCode=Bo,de.default=de;class Pt{constructor(){el(this,"axiosInstance");this.axiosInstance=de.create({baseURL:process.env.VUE_APP_BACKEND,headers:{"Content-Type":"application/json"}}),this.axiosInstance.interceptors.request.use(t=>{const o=this.getToken();return o&&t.headers&&(t.headers.Authorization=`Bearer ${o}`),t},t=>Promise.reject(t)),this.axiosInstance.interceptors.response.use(t=>t.data,t=>{var o,r;return(((o=t.response)==null?void 0:o.status)===401||((r=t.response)==null?void 0:r.status)===403)&&this.logout(),Promise.reject(t)})}getToken(){return localStorage.getItem("token")}removeToken(){localStorage.removeItem("token")}logout(){this.removeToken(),window.location.href="/sign-in"}handleError(t){t.response?console.error("API Error:",t.response.status,t.response.data):t.request?console.error("No response received:",t.request):console.error("Error during request setup:",t.message)}async get(t,o){try{const r=await this.axiosInstance.get(t,o);return(r==null?void 0:r.data)??r}catch(r){const i=r;throw this.handleError(i),r}}async delete(t,o){try{return await this.axiosInstance.delete(t,o)}catch(r){const i=r;throw this.handleError(i),r}}async post(t,o,r){try{return(await this.axiosInstance.post(t,o,r)).data}catch(i){const l=i;throw this.handleError(l),i}}async put(t,o,r){try{return(await this.axiosInstance.put(t,o,r)).data}catch(i){const l=i;throw this.handleError(l),i}}}class Jd extends Pt{async fetchCriticalPathTasks(t){return await this.get(`gantt/get_list_task_on_critical_path?${t}`)}async fetchGanttList(t){return await this.get(`/gantt/tasks?${t}`)}}let Eo;function ef(){return Eo||(Eo=new Jd),Eo}class tf extends Pt{async fetchPieProjects(t){return await this.get("repairs/pie/projects?"+t)}async fetchPieTasks(t){return await this.get("repairs/pie/tasks?"+t)}async fetchPiePersonnel(t){return await this.get("repairs/metrics/get_list_position?"+t)}async fetchPiePersonnelInfo(t){return await this.get(`repairs/metrics/get_list_user_by_position?${t}`)}async fetchPieWorkZone(t){return await this.get("repairs/metrics/get_list_work_zone_instrument?"+t)}async fetchPieCriticalPath(t){return await this.get("repairs/metrics/get_critical_path_group_by_status?"+t)}async fetchPieCriticalPathInfo(t){return await this.get(`repairs/metrics/get_list_task_critical_path_by_status?${t}`)}async fetchPieTmc(t){return await this.get("repairs/metrics/get_list_instrument_type?"+t)}async fetchPieTmcInfo(t){return await this.get(`repairs/metrics/get_list_warehouse_by_instrument_type?${t}`)}async fetchPieUntimelyClosedTask(t){return await this.get("repairs/metrics/get_list_comment_type?"+t)}async fetchPieUntimelyClosedTaskInfo(t){return await this.get(`repairs/metrics/get_list_task_by_comment_type?${t}`)}async fetchPieAdditionalTasks(t){return await this.get("repairs/metrics/get_list_task_after_plan_fixate_group_by_status?"+t)}async fetchPieAdditionalTasksInfo(t){return await this.get(`repairs/metrics/get_list_task_after_plan_fixate_by_status?${t}`)}async fetchPersonnel(t){return await this.get("repairs/statistic/personnel?"+t)}async fetchPieExpired(t){return await this.get("repairs/metrics/get_list_task_expired_group_by_status?"+t)}async fetchPieExpiredInfo(t){return await this.get(`repairs/metrics/get_list_task_expired?${t}`)}}let qo;function nf(){return qo||(qo=new tf),qo}class of extends Pt{async fetchProjectById(t){return await this.get(`/projects/${t}`)}}let Vo;function rf(){return Vo||(Vo=new of),Vo}class lf extends Pt{fetchFilters(t){return this.get(`repairs?smart=1&${t}`)}fetchRepairs(t,o,r,i,l){return this.get("get_list_repair"+(t?`${o}&per_page=100000${l?"&"+l:""}&${r?"":i}`:`?per_page=100000${l?"&"+l:""}&${i}`))}fetchEquipment(){return this.get("repairs/equipment/list?per_page=100000")}createRepair(t){return this.post("/repairs/equipments",t)}startRepair(t){return this.post(`/repairs/${t}/start`,null)}finishRepair(t){return this.post(`/repairs/${t}/finish`,null)}finishPreparationProject(t){return this.post(`/repairs/${t}/finish_preparation`,null)}moveRepairToCurrent(t){return this.post("/repairs/transfer_repair_plan_to_current",{repairs:[t]})}moveArchiveToCurrent(t){return this.post("/repairs/transfer_repair_archive_to_current",{repairs_ids:[t]})}moveRepairToApr(t){return this.post("/repairs/transfer_repair_current_to_plan",{repairs:[t]})}moveRepairToArchive(t){return this.post("/repairs/transfer_repair_current_to_archive",{repairs_ids:[t]})}restoreRepair(t){return this.post("/restore_repair",{repairs_ids:[t]})}updateRepair(t,o){return this.put(`/repairs/${o}`,t)}deleteRepair(t){return this.delete(`/repairs/${t}`)}}let To;function af(){return To||(To=new lf),To}class sf extends Pt{async fetchTaskById(t){return await this.get(`/tasks/${t}`)}}let Mo;function uf(){return Mo||(Mo=new sf),Mo}ne.AppButton=gr,ne.AppInput=ga,ne.AppInputSearch=pa,ne.AppLayout=Ta,ne.AppLayoutHeader=qc,ne.AppLoader=Vc,ne.AppSelect=Qa,ne.AppSidebar=xc,ne.AppToggle=Ca,ne.AppWrapper=Ya,ne.useGanttService=ef,ne.useMetricsService=nf,ne.useProjectsService=rf,ne.useRepairsService=af,ne.useTasksService=uf,Object.defineProperty(ne,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -12,6 +12,7 @@ declare class RepairsService extends ApiService {
|
|
|
12
12
|
moveArchiveToCurrent(id: string): Promise<void>;
|
|
13
13
|
moveRepairToApr(id: string): Promise<void>;
|
|
14
14
|
moveRepairToArchive(id: string): Promise<void>;
|
|
15
|
+
restoreRepair(id: string): Promise<void>;
|
|
15
16
|
updateRepair(payload: Api_Update_Repair, id: string): Promise<void>;
|
|
16
17
|
deleteRepair(id: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
17
18
|
}
|
package/package.json
CHANGED
|
@@ -40,6 +40,7 @@ class RepairsService extends ApiService {
|
|
|
40
40
|
public finishPreparationProject(id: string) {
|
|
41
41
|
return this.post<null, void>(`/repairs/${id}/finish_preparation`, null)
|
|
42
42
|
}
|
|
43
|
+
|
|
43
44
|
public moveRepairToCurrent(id: string) {
|
|
44
45
|
return this.post<any, void>(`/repairs/transfer_repair_plan_to_current`, {
|
|
45
46
|
repairs: [id],
|
|
@@ -60,6 +61,11 @@ class RepairsService extends ApiService {
|
|
|
60
61
|
repairs_ids: [id],
|
|
61
62
|
})
|
|
62
63
|
}
|
|
64
|
+
public restoreRepair(id: string) {
|
|
65
|
+
return this.post<any, void>(`/restore_repair`, {
|
|
66
|
+
repairs_ids: [id],
|
|
67
|
+
})
|
|
68
|
+
}
|
|
63
69
|
public updateRepair(payload: Api_Update_Repair, id: string) {
|
|
64
70
|
return this.put<Api_Update_Repair, void>(`/repairs/${id}`, payload)
|
|
65
71
|
}
|