nb-js-client 0.0.33 → 0.0.35

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.
@@ -1 +1 @@
1
- "use strict";const e="/login",t=`${e}/ldap`,s=`${e}/update`;class i{constructor(e){this.client=e}info(){return this.client.rest.get(e)}login(t){return this.client.rest.post(e,JSON.stringify(t))}ldapLogin(e){return this.client.rest.post(t,JSON.stringify(e))}updateToken(e){const t=e.path?`${e.path}/${s}`:s;return e.path&&delete e.path,this.client.rest.post(t,JSON.stringify(e))}logout(){return this.client.rest.post("/logout")}}var r;exports.AccessRights=void 0,(r=exports.AccessRights||(exports.AccessRights={})).LicenseRead="license_read",r.LicenseManage="license_edit",r.UsersRead="users_read",r.UsersCreate="users_create",r.UsersActivate="users_activate",r.GroupsRead="groups_read",r.GroupsCreate="groups_create",r.RolesRead="roles_read",r.RolesCreate="roles_create",r.Share="share",r.Divide="divide",r.ExtensionsRead="extensions_read",r.ExtensionsManage="extensions_write",r.RestrictionShareRead="restriction_share_read",r.RestrictionShareWrite="restriction_share_write",r.RestrictionDivideRead="restriction_divide_read",r.RestrictionDivideWrite="restriction_divide_write",r.ReadUserLogs="read_user_logs",r.ReadSystemLogs="read_system_logs",r.ConnectionsRead="connections_read",r.ConnectionsDividing="connections_dividing",r.ConnectionsYandexDisk="connections_yandex_disk",r.ConnectionsSsh="connections_ssh",r.ConnectionsMail="connections_mail",r.ConnectionsS3="connections_s3",r.ConnectionsDiscord="connections_discord",r.ConnectionsWebdav="connections_webdav",r.ConnectionsNextcloud="connections_nextcloud",r.ConnectionsNextbox="connections_nextbox",r.ConnectionsHttpProxy="connections_http_proxy",r.SystemInfoServiceList="system_info_service_list",r.SettingsRead="settings_read",r.SettingsWrite="settings_write";const n=[exports.AccessRights.ConnectionsYandexDisk,exports.AccessRights.ConnectionsSsh,exports.AccessRights.ConnectionsMail,exports.AccessRights.ConnectionsS3,exports.AccessRights.ConnectionsS3,exports.AccessRights.ConnectionsDiscord,exports.AccessRights.ConnectionsWebdav,exports.AccessRights.ConnectionsNextcloud,exports.AccessRights.ConnectionsNextbox,exports.AccessRights.ConnectionsHttpProxy];var o,c,a,l,p,d,h,u,g,x,v,S,_,f,y,$,m,k,w,A,R,O,T,b,N,C,E,U,D,J;exports.OrderDirection=void 0,(o=exports.OrderDirection||(exports.OrderDirection={})).DEFAULT="",o.ASC="asc",o.DESC="desc",exports.EngineType=void 0,(c=exports.EngineType||(exports.EngineType={})).WebSocket="websocket",c.PostMessage="postmessage",c.Empty="",exports.ConnectionGroup=void 0,(a=exports.ConnectionGroup||(exports.ConnectionGroup={})).Storages="storages_connections_group",a.Webhooks="webhooks_connections_group",a.Unknown="unknown_connections_group",a.Proxy="proxy_connections_group",exports.ConnectionType=void 0,(l=exports.ConnectionType||(exports.ConnectionType={})).SSH="ssh_connection",l.YandexDisk="yandex_disk",l.Mail="mail",l.Discord="discord",l.Webdav="webdav_connection",l.Nextcloud="nextcloud_connection",l.NextBox="nextbox_connection",l.HttpProxy="http_proxy_connection",l.S3="s3_connection",exports.ExtensionType=void 0,(p=exports.ExtensionType||(exports.ExtensionType={})).App="app",p.File="file",p.WorkDir="work_dir",exports.ExtensionFileMode=void 0,(d=exports.ExtensionFileMode||(exports.ExtensionFileMode={})).Read="read",d.ReadAndWrite="read_and_write",d.Write="write",exports.DivideScope=void 0,(h=exports.DivideScope||(exports.DivideScope={})).Storage="/storage/element",h.Connection="/connections",exports.PermissionType=void 0,(u=exports.PermissionType||(exports.PermissionType={})).CLOSE="",u.READ="r",u.WRITE="rw",exports.RestrictionStatus=void 0,(g=exports.RestrictionStatus||(exports.RestrictionStatus={})).WAITING="waiting",g.APPROVED="approved",g.REJECTED="rejected",exports.RestrictionBooleanStatus=void 0,(x=exports.RestrictionBooleanStatus||(exports.RestrictionBooleanStatus={})).TRUE="true",x.FALSE="false",exports.DivideMode=void 0,(v=exports.DivideMode||(exports.DivideMode={})).User="to_user_id",v.Group="to_user_group_id",exports.RestrictionModeKey=void 0,(S=exports.RestrictionModeKey||(exports.RestrictionModeKey={})).Divide="divide",S.Share="share",exports.Tariff=void 0,(_=exports.Tariff||(exports.Tariff={})).Free="free",_.Business="business",_.Enterprise="enterprise",exports.LicenseError=void 0,(f=exports.LicenseError||(exports.LicenseError={})).NotActivated="License not activated",f.Blocked="License blocked",f.Expired="License has been expired",f.NotValid="License not valid",f.NotFound="license file not found",exports.NotificationEntityType=void 0,(y=exports.NotificationEntityType||(exports.NotificationEntityType={})).Dir="dir",y.File="file",y.User="user",y.Other="other",y.WorkDir="work_dir",y.License="license",y.Extension="extension",y.Connection="connection",exports.NotificationAction=void 0,($=exports.NotificationAction||(exports.NotificationAction={})).OpenSharing="open_sharing",$.ChangeSharing="change_sharing",$.CancelSharing="cancel_sharing",$.DivideDirAddFileToOwner="divide_dir_add_file_to_owner",$.DivideDirAddDirToOwner="divide_dir_add_dir_to_owner",$.DivideDirAddWorkDirToOwner="divide_dir_add_work_dir_to_owner",$.DivideConnectionAddFileToOwner="divide_connection_add_file_to_owner",$.DivideConnectionAddDirToOwner="divide_connection_add_dir_to_owner",$.CancelDivideDir="cancel_divide_dir",$.CancelDivideFile="cancel_divide_file",$.CancelDivideWorkDir="cancel_divide_work_dir",$.CancelDivideConnection="cancel_divide_connection",$.DeleteExtension="delete_extension",$.NewVersionExtension="new_version_extension",$.TransferData="transfer_data",$.AllowInternalAccessUser="allow_internal_access_to_user",$.BlockInternalAccessUser="block_internal_access_to_user",$.WaitInternalAccessUser="wait_internal_access_to_user",$.WaitInternalAccessUserCreate="wait_internal_access_to_user_create",$.AllowInternalAccessGroup="allow_internal_access_to_group",$.BlockInternalAccessGroup="block_internal_access_to_group",$.WaitInternalAccessGroup="wait_internal_access_to_group",$.WaitInternalAccessGroupCreate="wait_internal_access_to_group_create",$.AllowSharing="allow_sharing",$.BlockSharing="block_sharing",$.WaitSharing="wait_sharing",$.WaitSharingCreate="wait_sharing_create",$.Other="other",exports.NotificationRowAction=void 0,(m=exports.NotificationRowAction||(exports.NotificationRowAction={})).Read="read",m.Unread="unread",m.Delete="delete",exports.NotificationStyle=void 0,(k=exports.NotificationStyle||(exports.NotificationStyle={})).Plain="plain",k.Success="success",k.Info="info",k.Warning="warning",k.Error="error",exports.ResponseType=void 0,(w=exports.ResponseType||(exports.ResponseType={})).ArrayBuffer="arraybuffer",w.Blob="blob",w.Json="json",w.Text="text",exports.RequestMethod=void 0,(A=exports.RequestMethod||(exports.RequestMethod={})).GET="GET",A.POST="POST",A.PUT="PUT",A.PATCH="PATCH",A.DELETE="DELETE",exports.RequestObserve=void 0,(R=exports.RequestObserve||(exports.RequestObserve={})).Body="body",R.Response="response",exports.RestrictionSharing=void 0,(O=exports.RestrictionSharing||(exports.RestrictionSharing={})).NONE="none",O.SOFT="soft",O.HARD="hard",exports.UserAuthType=void 0,(T=exports.UserAuthType||(exports.UserAuthType={})).Native="native",T.Ldap="ldap",T.Vk="vk",exports.UserStatus=void 0,(b=exports.UserStatus||(exports.UserStatus={})).Registering="registering",b.Activated="activated",b.Blocked="blocked",b.BlockedByLicense="blocked_by_license",exports.UserType=void 0,(N=exports.UserType||(exports.UserType={})).User="user",N.Guest="guest",N.Emperor="emperor",N.Anonymous="anonymous",exports.SettingControlType=void 0,(C=exports.SettingControlType||(exports.SettingControlType={})).Text="text",C.String="string",C.Number="number",C.CheckBox="checkbox",C.Select="select",C.RadioList="radio_list",C.ConnectionChoose="connection_choose",C.MultiConnectionChoose="multi_connection_choose",exports.StorageElementType=void 0,(E=exports.StorageElementType||(exports.StorageElementType={})).Dir="dir",E.File="file",E.WorkDir="work_dir",exports.StorageElementContentType=void 0,(U=exports.StorageElementContentType||(exports.StorageElementContentType={})).Any="any",U.Dir="dir",U.Code="code",U.Image="image",U.Audio="audio",U.Video="video",U.Text="text",U.Doc="doc",U.Xls="xls",U.Ppt="ppt",exports.StorageRoot=void 0,(D=exports.StorageRoot||(exports.StorageRoot={})).my="my",D.fca="fca",D.divide="divide",D.share="share",D.favorite="favorite",exports.StorageElementHistoryAction=void 0,(J=exports.StorageElementHistoryAction||(exports.StorageElementHistoryAction={})).Create="create",J.Update="update",J.Move="move";const P="/connections",I=`${P}/dashboard`;class L{constructor(e){this.client=e}list(e){return this.client.rest.get(P,e)}get(e){return this.client.rest.get(`${P}/${e}`)}update(e,t){return this.client.rest.put(`${P}/${e}`,JSON.stringify(t))}delete(e){return this.client.rest.delete(`${P}/${e}`)}create(e){const t={[exports.ConnectionType.SSH]:"/disk/ssh",[exports.ConnectionType.Webdav]:"/disk/webdav",[exports.ConnectionType.Nextcloud]:"/disk/nextcloud",[exports.ConnectionType.NextBox]:"/disk/nextbox",[exports.ConnectionType.Discord]:"/webhooks/discord",[exports.ConnectionType.Mail]:"/webhooks/mail",[exports.ConnectionType.HttpProxy]:"/http_proxy",[exports.ConnectionType.S3]:"/disk/s3"};return this.client.rest.post(t[e.type]||P,JSON.stringify(e))}dashboard(e){return this.client.rest.get(I,e)}}class q{constructor(e){this.client=e}discovery(e){return this.client.rest.get("/discovery",e)}}const j="/divide",M=`${j}/restrictions`;class F{constructor(e){this.client=e}divideDelete(e,t){return this.client.rest.delete(`${e}/${j}/${t}`)}divideDeleteAll(e,t,s,i){return this.client.rest.delete(`${e}/${j}`,Object.assign(Object.assign({},this.makeParam(e,t)),{is_to_user_group:i,access_mode:s}))}divideChange(e,t,s){return this.client.rest.put(`${e}/divide/${t}`,JSON.stringify({access_mode:s}))}divideCreate(e,t,s,i,r){const n=Object.assign(Object.assign({},this.makeParam(e,t)),{[r]:s,access_mode:i});return this.client.rest.post(`${e}/${j}`,JSON.stringify(n))}divideUsers(e,t,s){return this.client.rest.get(`${e}/${j}/users`,Object.assign(Object.assign({},this.makeParam(e,t)),s))}getRestriction(e){return this.client.rest.get(`${M}/${e}`)}restrictionSize(e,t){return this.client.rest.get(`/${t}/restrictions/${e}/size`)}restrictions(e){return this.client.rest.get(`${M}`,e)}restrictionsChange(e,t){return this.client.rest.put(`${M}/${e}`,JSON.stringify(t))}makeParam(e,t){const s={};return e===exports.DivideScope.Connection?s.connection_id=t:s.path=t,s}}function H(e,t,s,i){return new(s||(s=Promise))((function(r,n){function o(e){try{a(i.next(e))}catch(e){n(e)}}function c(e){try{a(i.throw(e))}catch(e){n(e)}}function a(e){var t;e.done?r(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,c)}a((i=i.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class W extends Error{}function B(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return function(e){return decodeURIComponent(atob(e).replace(/(.)/g,((e,t)=>{let s=t.charCodeAt(0).toString(16).toUpperCase();return s.length<2&&(s="0"+s),"%"+s})))}(t)}catch(e){return atob(t)}}function G(e,t){if("string"!=typeof e)throw new W("Invalid token specified: must be a string");t||(t={});const s=!0===t.header?0:1,i=e.split(".")[s];if("string"!=typeof i)throw new W(`Invalid token specified: missing part #${s+1}`);let r;try{r=B(i)}catch(e){throw new W(`Invalid token specified: invalid base64 for part #${s+1} (${e.message})`)}try{return JSON.parse(r)}catch(e){throw new W(`Invalid token specified: invalid json for part #${s+1} (${e.message})`)}}W.prototype.name="InvalidTokenError";const V=(e,t)=>H(void 0,void 0,void 0,(function*(){let s=t;for(const t of e)try{s=yield t.fulfilled(s)}catch(e){if(!t.rejected)throw e;s=yield t.rejected(e)}return s}));function z(e){var t;return null!==(t=Object.fromEntries(document.cookie.split(";").map((e=>e.split("="))).map((([e,t])=>[e.trim(),decodeURIComponent(t||"")])))[e])&&void 0!==t?t:null}const K=e=>{const t=new URLSearchParams;return Object.keys(e).forEach((s=>{Array.isArray(e[s])?e[s].forEach((e=>{t.append(s,e)})):t.append(s,e[s])})),t};function X(e){return e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):e}const Y="/api/v1",Q="/api/v2",Z=`${window.location.protocol}//${window.location.host}`;class ee{constructor(e,t){this.client=e,this.tokenUpdate=t}get state(){return this.client.state}get(e,t,s){return this.request(exports.RequestMethod.GET,e,Object.assign({params:t,cache:"no-cache"},s))}post(e,t,s){return this.request(exports.RequestMethod.POST,e,Object.assign({body:t},s))}put(e,t,s){return this.request(exports.RequestMethod.PUT,e,Object.assign({body:t,cache:"no-cache"},s))}patch(e,t,s){return this.request(exports.RequestMethod.PATCH,e,Object.assign({body:t},s))}delete(e,t,s){return this.request(exports.RequestMethod.DELETE,e,Object.assign({params:t},s))}upload(e,t,s){const i=new AbortController,r=i.signal;return{promise:this.request(exports.RequestMethod.POST,e,Object.assign({body:t,signal:r},s)),abort:()=>i.abort()}}request(e,t,s){return H(this,void 0,void 0,(function*(){return new Promise(((i,r)=>H(this,void 0,void 0,(function*(){var n,o;const c=null!==(n=this.state.skipInterceptors)&&void 0!==n&&n;this.state.skipInterceptors=!1;let a=Object.assign({method:e},s);if((null==s?void 0:s.signal)&&(a.signal=s.signal),c||(s=yield V(this.client.requestInterceptors,a)),this.state.authToken)for(const[e,i]of this.state.authToken.entries()){const r=G(i.access_token);if(r&&r.is_remember&&this.tokenUpdate.isTokenExpire(r.exp)&&!t.includes("/login")&&!t.includes("/assets")){const t=yield this.tokenUpdate.refreshToken(i);t&&(this.state.authToken.set(e,t),s=yield V(this.client.requestInterceptors,a))}}const l=new XMLHttpRequest;(null==s?void 0:s.params)&&0!==Object.keys(s.params).length&&(t+="?"+K(s.params));const p=`${this.state.clientParams.host}${this.state.clientParams.version}${t}`;if(l.open(e,p,!0),null==s?void 0:s.headers){const e=X(s.headers);for(const[t,s]of Object.entries(e))(this.state.clientParams.host===Z||"content-type"!==t.toLowerCase())&&l.setRequestHeader(t,s)}(null==s?void 0:s.responseType)&&(l.responseType=s.responseType),(null==s?void 0:s.signal)&&s.signal.addEventListener("abort",(()=>{l.abort(),r(new Error("Upload aborted"))})),l.upload&&[exports.RequestMethod.POST,exports.RequestMethod.PUT,exports.RequestMethod.PATCH].includes(e)&&(l.upload.onprogress=e=>{e.lengthComputable&&(null==s?void 0:s.onUploadProgress)&&s.onUploadProgress(e)}),l.onload=()=>H(this,void 0,void 0,(function*(){if((null==s?void 0:s.signal)&&s.signal.aborted)return;let e;switch(null==s?void 0:s.responseType){case exports.ResponseType.Text:e=l.responseText;break;case exports.ResponseType.Blob:case exports.ResponseType.ArrayBuffer:e=l.response;break;default:try{e=JSON.parse(l.responseText)}catch(t){e=l.responseText}}const t=new Headers;l.getAllResponseHeaders().split("\r\n").forEach((e=>{const[s,i]=e.split(": ");s&&i&&t.append(s,i)}));let n={status:l.status,statusText:l.statusText,headers:t,url:l.responseURL};l.status>=200&&l.status<300?(null==s?void 0:s.observe)===exports.RequestObserve.Response?i(Object.assign(Object.assign({},n),{body:e})):i(e):r(Object.assign(Object.assign({},n),{error:e})),n=yield V(this.client.responseInterceptors,n)})),l.onerror=()=>{r({status:l.status,statusText:l.statusText,url:l.responseURL,error:"Network error"})},l.send(null!==(o=null==s?void 0:s.body)&&void 0!==o?o:null)}))))}))}changeBaseUrlVersion(e,t){return H(this,void 0,void 0,(function*(){const s=this.state.clientParams.version;this.state.clientParams.version=e;try{return yield t()}finally{this.state.clientParams.version=s}}))}changeHost(e,t){return H(this,void 0,void 0,(function*(){this.state.clientParams.host=e,this.state.requestParams.headers={};try{return yield t()}finally{this.state.clientParams.host=Z}}))}}class te{constructor(e){this.authApiService=e,this.isUpdating=!1,this.tokenUpdateResolve=null}isTokenExpire(e){if(!e)return!1;return 1e3*e<=(new Date).getTime()+3e3}refreshToken(e){return H(this,void 0,void 0,(function*(){const{access_token:t,refresh_token:s}=e;return t&&s?this.isUpdating?this.waitForTokenUpdate():(this.isUpdating=!0,new Promise(((e,i)=>{const r=new XMLHttpRequest,n=`${Z}${Y}/login/update`;r.open("POST",n,!0),r.setRequestHeader("Content-Type","application/json"),r.send(JSON.stringify({access_token:t,refresh_token:s})),r.onload=()=>{if(r.status>=200&&r.status<300)try{const t=JSON.parse(r.responseText);if(t&&t.access_token&&t.refresh_token){const s={access_token:t.access_token,refresh_token:t.refresh_token};z("access_token")===s.access_token&&localStorage.setItem("refresh-token",s.refresh_token),this.tokenUpdateResolve&&(this.tokenUpdateResolve(s),this.tokenUpdateResolve=null),e(s)}else e(null)}catch(e){i(new Error("Failed to parse response JSON."))}else i(new Error(`Request failed with status: ${r.status}`))},r.onerror=()=>{i(new Error("Network error occurred"))},r.onloadend=()=>{this.isUpdating=!1}}))):null}))}waitForTokenUpdate(){return H(this,void 0,void 0,(function*(){return new Promise((e=>{const t=setInterval((()=>{this.isUpdating||(clearInterval(t),e())}),100)}))}))}}const se="/static/extensions",ie="/extensions/defaults";class re{constructor(e){this.client=e}getSetting(e){return this.client.rest.get(`${se}/${e}/settings`)}setSetting(e,t){return this.client.rest.post(`${se}/${e}/settings`,JSON.stringify(t))}deleteSetting(e){return this.client.rest.delete(`${se}/${e}/settings`)}get(e){return this.client.rest.get(`${se}/${e}`)}getByKey(e){return this.client.rest.get(`${se}/${e}`)}getDefault(e=[]){return this.client.rest.get(ie,{ext_code:e})}setDefault(e,t){return this.client.rest.post(ie,JSON.stringify({ext_code:e,ext_uniq_key:t}))}checkUpdates(){return this.client.rest.post(`${se}/check_updates`)}updateVersion(e,t){return this.client.rest.put(`${se}/${e}`,JSON.stringify({version:t}))}list(e){return this.client.rest.get(se,e)}delete(e,t){return this.client.rest.delete(`${se}/${e}`)}upload(e,t){const s=new FormData;s.set("file",t);const{promise:i,abort:r}=this.client.rest.upload(se,s,{onUploadProgress:t=>{e(t)}});return{promise:this.client.rest.changeBaseUrlVersion(Q,(()=>i)),abort:r}}install(e,t){return this.client.rest.changeBaseUrlVersion(Q,(()=>this.client.rest.post(`${se}/site`,JSON.stringify({uniq_key:e,version:t}))))}}const ne="/anons_ext/extensions";class oe{constructor(e){this.client=e}listExtensionsSite(e){return this.client.rest.changeHost("https://next-box.ru",(()=>this.client.rest.get(ne,e)))}extensionDetailSite(e){return this.client.rest.changeHost("https://next-box.ru",(()=>this.client.rest.get(`${ne}/${e}`)))}extensionMarkdown(e,t){return this.client.rest.changeHost("https://next-box.ru",(()=>this.client.rest.get(`${ne}/${e}/readme`,{},t)))}}const ce="/disk",ae=`${ce}/check`;class le{constructor(e){this.client=e}info(e,t){return this.client.rest.get(`${ce}/${e}/element`,{path:t})}list(e,t){return this.client.rest.get(`${ce}/${e}`,t)}create(e,t){return this.client.rest.post(`${ce}/${e}/element`,JSON.stringify(t))}replace(e,t,s){return this.client.rest.put(`${ce}/${e}/files?path=${t}`,s)}read(e,t){return this.client.rest.get(`${ce}/${e}/files?path=${t}`)}upload(e,t,s,i=""){const r=new FormData;r.set("path",i),r.set("file",s);const{promise:n,abort:o}=this.client.rest.upload(`${ce}/${t}/files`,r,{onUploadProgress:t=>{e(t)}});return{promise:n,abort:o}}uploadNet(e,t){return this.client.rest.post(`${ce}/${e}/files/net`,JSON.stringify(t))}delete(e,t){return this.client.rest.delete(`${ce}/${e}/trash/element`,{path:t})}check(e){return this.client.rest.post(ae,JSON.stringify(e))}}const pe="/settings";class de{constructor(e){this.client=e}settings(){return this.client.rest.get(pe)}changeSettings(e){return this.client.rest.post(pe,JSON.stringify(e))}queryInit(){return this.client.rest.get("/query/init")}}const he="/groups";class ue{constructor(e){this.client=e}list(e){return this.client.rest.get(he,e)}listUsers(e){return this.client.rest.get(`${he}/${e}/users`)}create(e){return this.client.rest.post(he,JSON.stringify(e))}update(e,t){return this.client.rest.put(`${he}/${e}`,JSON.stringify(t))}delete(e){return this.client.rest.delete(`${he}/${e}`)}}const ge="/license",xe=`${ge}/manual-check`,ve=`${ge}/hardware/hash`;class Se{constructor(e){this.client=e}info(){return this.client.rest.get(ge)}create(e){return this.client.rest.post(ge,JSON.stringify(e))}check(){return this.client.rest.post(xe)}delete(){return this.client.rest.delete(ge)}getHash(){return this.client.rest.get(ve)}}const _e="/links";class fe{constructor(e){this.client=e}createShortLink(e){return this.client.rest.post(_e,JSON.stringify(e))}updateShortLink(e){return this.client.rest.put(_e,JSON.stringify(e))}}const ye="/logs";class $e{constructor(e){this.client=e}getUsersLogs(e){return this.client.rest.get(`${ye}/users`,e)}getSystemLogs(e,t,s){return this.client.rest.get(`${ye}/${e}`,{},{observe:exports.RequestObserve.Response,responseType:exports.ResponseType.Text,headers:{Range:`bytes=${t}-${s}`}})}}const me="/notifications",ke=`${me}/all`,we=`${me}/subscription`,Ae=`${me}/permission`;class Re{constructor(e){this.client=e}list(e){return this.client.rest.get(me,e)}toggleStatus(e,t){return this.client.rest.put(me,JSON.stringify({ids:e,to_status:t}))}toggleAllStatus(e){return this.client.rest.put(ke,JSON.stringify({to_status:e}))}delete(e){return this.client.rest.delete(me,{id:e})}deleteAll(){return this.client.rest.delete(ke)}getPermission(){return this.client.rest.get(Ae)}setPermission(e){return this.client.rest.post(Ae,JSON.stringify({enabled:e}))}getSubscription(){return this.client.rest.get(we)}setSubscription(e){const t={action_groups:Object.assign({},e)};return this.client.rest.post(we,JSON.stringify(t))}}const Oe="/roles",Te=`${Oe}/default`,be="/permissions";class Ne{constructor(e){this.client=e}list(e){return this.client.rest.get(Oe,e)}get(e){return this.client.rest.get(`${Oe}/${e}`)}getDefault(){return this.client.rest.get(`${Te}`)}create(e){return this.client.rest.post(Oe,JSON.stringify(e))}update(e,t){return this.client.rest.put(`${Oe}/${e}`,JSON.stringify(t))}delete(e){return this.client.rest.delete(`${Oe}/${e}`)}permissionList(){return this.client.rest.get(be)}addPermission(e,t){return this.client.rest.put(`${Oe}/${e}/permissions`,JSON.stringify({ids:t}))}deletePermission(e,t){return this.client.rest.delete(`${Oe}/${e}/${be}`,{ids:t})}}const Ce="/share",Ee=`${Ce}/restrictions`;class Ue{constructor(e){this.client=e}info(e,t){const s=new URLSearchParams({path:e,share_token:t});return this.client.rest.get(`${Ce}?${s.toString()}`)}checkPassword(e,t){const s=encodeURIComponent(e);return this.client.rest.get(`${Ce}/password?share_token=${t}&share_pass=${s}`)}checkToken(e){return this.client.rest.get(`${Ce}?share_token=${e}`)}getRestriction(e){return this.client.rest.get(`${Ee}/${e}`)}restrictions(e){return this.client.rest.get(Ee,e)}restrictionsChange(e,t){return this.client.rest.put(`${Ee}/${e}`,JSON.stringify(t))}}const De="/storage",Je=`${De}/element`,Pe=`${Je}/move`,Ie=`${Je}/copy`,Le=`${Je}/content_type_size`,qe="/disk";class je{constructor(e,t){this.client=e,this.fcaApiService=t}list(e){return this.client.rest.get(De,e)}info(e){var t;return parseInt((null===(t=e.divide_id)||void 0===t?void 0:t.toString())||"")||delete e.divide_id,e.file_version_id||delete e.file_version_id,this.client.rest.get(Je,e)}combineInfo({root:e,rootId:t,path:s,file_version_id:i}){return e===exports.StorageRoot.fca&&t?this.fcaApiService.info(t,s):this.info({path:s,divide_id:t,file_version_id:i})}size(e){return this.client.rest.post(`${Je}/size`,JSON.stringify(e))}move(e,t,s){const{from_divide_id:i,to_divide_id:r}=e;let n=Object.assign(Object.assign({},e),{from_divide_id:null,to_divide_id:null});return t===exports.StorageRoot.fca&&s===exports.StorageRoot.fca?this.client.rest.post(`${qe}/${i}/files/move${qe}/${r}`,JSON.stringify(n)):t===exports.StorageRoot.fca?(i&&(n.from_divide_id=i),this.client.rest.put(`${qe}/${r}/files/from/box`,JSON.stringify(n))):s===exports.StorageRoot.fca?(r&&(n.to_divide_id=r),this.client.rest.put(`${qe}/${i}/files/to/box`,JSON.stringify(n))):this.client.rest.post(Pe,JSON.stringify(e))}copy(e,t,s){const{from_divide_id:i,to_divide_id:r}=e;let n=Object.assign(Object.assign({},e),{from_divide_id:null,to_divide_id:null});return s===exports.StorageRoot.fca&&t===exports.StorageRoot.fca?this.client.rest.post(`${qe}/${i}/files/copy${qe}/${r}`,JSON.stringify(n)):s===exports.StorageRoot.fca?(i&&(n.from_divide_id=i),this.client.rest.post(`${qe}/${r}/files/from/box`,JSON.stringify(n))):t===exports.StorageRoot.fca?(r&&(n.to_divide_id=r),this.client.rest.post(`${qe}/${i}/files/to/box`,JSON.stringify(n))):this.client.rest.post(Ie,JSON.stringify(e))}pasteFromShared(e,t,s){const i={from_sharing_token:e,from_sharing_password:s,paths:t};return this.client.rest.post(`${Je}/copy`,JSON.stringify(i))}create(e){return this.client.rest.post(Je,JSON.stringify(e))}delete(e,t){const s={path:e};return t&&(s.divide_id=t),this.client.rest.delete(Je,s)}favorite(e){return this.client.rest.put(`${Je}?path=${encodeURIComponent(e)}`,JSON.stringify({is_favorite:!0}))}removeFavorite(e){return this.client.rest.put(`${Je}?path=${encodeURIComponent(e)}`,JSON.stringify({is_favorite:!1}))}createItem(e){return this.client.rest.post(Je,JSON.stringify(e))}createWorkDir(e){return this.client.rest.post(Je,JSON.stringify(e))}sizeWithSection(e){return this.client.rest.get(Le,e)}}const Me="/storage/files",Fe=`${Me}/net`;class He{constructor(e){this.client=e}read(e,t){return t.path=e,this.client.rest.get(Me,t)}replace(e,t){const s=new URLSearchParams;return Object.keys(e).forEach((t=>{e[t]&&s.append(t,e[t])})),this.client.rest.put(`${Me}?${s.toString()}`,t)}upload(e,t,s,i){const r=new FormData;r.set("path",s),i&&r.set("divide_id",i.toString()),r.set("file",t);const{promise:n,abort:o}=this.client.rest.upload(Me,r,{onUploadProgress:t=>{e(t)}});return{promise:n,abort:o}}uploadNet(e){return this.client.rest.post(Fe,JSON.stringify(e))}}class We{constructor(e){this.client=e}instance(){return this.client.rest.get("/storage/instance")}}const Be="/storage/element/share";class Ge{constructor(e){this.client=e}info(e){return this.client.rest.get(Be,{path:e})}create(e,t){const s={path:e,permissions_type:t};return this.client.rest.post(Be,JSON.stringify(s))}change(e){return this.client.rest.put(`${Be}/${e.token}`,JSON.stringify(e))}delete(e){return this.client.rest.delete(Be,{path:e})}refresh(e){return this.client.rest.put(`${Be}/${e}/refresh`)}}const Ve="/storage/trash",ze=`${Ve}/element`,Ke=`${ze}/all`;class Xe{constructor(e){this.client=e}list(e){return this.client.rest.get(Ve,e)}clear(e){return this.client.rest.delete(ze,e)}clearAll(){return this.client.rest.delete(Ke)}restore(e){return this.client.rest.patch(ze,JSON.stringify({del_groups:e}))}}const Ye="/users",Qe=`${Ye}/me`,Ze=`${Qe}/avatars`,et=`${Qe}/sessions`,tt=`${Qe}/tokens`,st=`${Qe}/change-password`;class it{constructor(e){this.client=e}list(e){return this.client.rest.get(Ye,e)}get(e){return this.client.rest.get(Ye+`/${e}`)}create(e){return this.client.rest.post(Ye,JSON.stringify(e))}update(e,t){return this.client.rest.put(Ye+`/${e}`,JSON.stringify(t))}delete(e,t){return this.client.rest.delete(`${Ye}/${e}`,t)}restore(e){return this.client.rest.post(`${Ye}/${e}/restore`)}me(){return this.client.rest.get(Qe)}updateMe(e){return this.client.rest.put(Qe,JSON.stringify(e))}createToken(e){return this.client.rest.post(tt,JSON.stringify(e))}listToken(e){return this.client.rest.get(tt,e)}deleteToken(e){return this.client.rest.delete(`${tt}/${e}`)}changeMyPassword(e){return this.client.rest.put(st,JSON.stringify(e))}changeUsersPassword(e,t){return this.client.rest.put(`${Ye}/${e}/change-password`,JSON.stringify(t))}meUploadAvatar(e,t){const s=new FormData;return s.append("file",e,t),this.client.rest.post(Ze,s)}meDeleteAvatar(){return this.client.rest.delete(Ze)}meListSession(e){return this.client.rest.get(et,e)}meDeleteSession(e){let t=et;return e&&(t+=`/${e}`),this.client.rest.delete(t)}setRole(e,t=null){return this.client.rest.put(`${Ye}/${e}/roles`,JSON.stringify({role_id:t}))}}const rt="/storage/element",nt=`${rt}/history`,ot=`${rt}/version`,ct=`${ot}/current`,at=`${ot}/size`;class lt{constructor(e){this.client=e}history(e){return this.client.rest.get(nt,e)}versions(e){return this.client.rest.get(ot,e)}create(e){return this.client.rest.post(ot,JSON.stringify(e))}edit(e){return this.client.rest.put(ot,JSON.stringify(e))}delete(e){return this.client.rest.delete(ot,e)}size(e){return this.client.rest.get(at,e)}makeCurrent(e){return this.client.rest.post(ct,JSON.stringify(e))}}exports.AuthApiService=i,exports.BASE_URL_V1=Y,exports.BASE_URL_V2=Q,exports.CONNECTIONS_PERMISSION=n,exports.Client=class{constructor(e){this.AuthApiService=new i(this),this.ConnectionsApiService=new L(this),this.DiscoveryApiService=new q(this),this.DivideApiService=new F(this),this.ExtensionsApiService=new re(this),this.ExtensionsExternalApiService=new oe(this),this.FcaApiService=new le(this),this.GatewayApiService=new de(this),this.GroupApiService=new ue(this),this.LicenseApiService=new Se(this),this.LinksApiService=new fe(this),this.LogstashApiService=new $e(this),this.NotificationApiService=new Re(this),this.RoleApiService=new Ne(this),this.ShareApiService=new Ue(this),this.StorageElementApiService=new je(this,this.FcaApiService),this.StorageFilesApiService=new He(this),this.StorageInstanceApiService=new We(this),this.StorageShareApiService=new Ge(this),this.StorageTrashApiService=new Xe(this),this.UserApiService=new it(this),this.VersionApiService=new lt(this),this.tokenUpdate=new te(this.AuthApiService),this.rest=new ee(this,this.tokenUpdate),this.requestInterceptors=[],this.responseInterceptors=[],this.request={use:(e,t)=>{this.requestInterceptors.push({fulfilled:e,rejected:t})}},this.response={use:(e,t)=>{this.responseInterceptors.push({fulfilled:e,rejected:t})}},this.state={clientParams:{host:(null==e?void 0:e.host)||`${window.location.protocol}//${window.location.host}`,version:(null==e?void 0:e.version)||"/api/v1"},requestParams:{path:"",headers:{},query:{},body:null,cache:"no-cache"},authToken:null,skipInterceptors:!1}}},exports.ConnectionsApiService=L,exports.DiscoveryApiService=q,exports.DivideApiService=F,exports.ExtensionsApiService=re,exports.ExtensionsExternalApiService=oe,exports.FcaApiService=le,exports.GatewayApiService=de,exports.GroupApiService=ue,exports.HOST=Z,exports.LicenseApiService=Se,exports.LinksApiService=fe,exports.LogstashApiService=$e,exports.NotificationApiService=Re,exports.Rest=ee,exports.RoleApiService=Ne,exports.ShareApiService=Ue,exports.StorageElementApiService=je,exports.StorageFilesApiService=He,exports.StorageInstanceApiService=We,exports.StorageShareApiService=Ge,exports.StorageTrashApiService=Xe,exports.TokenUpdate=te,exports.UserApiService=it,exports.VersionApiService=lt,exports.applyInterceptors=V,exports.getCookieValue=z,exports.makeUrlParams=K,exports.normalizeHeaders=X;
1
+ "use strict";const e="/login",t=`${e}/ldap`,s=`${e}/update`;class i{constructor(e){this.client=e}info(){return this.client.rest.get(e)}login(t){return this.client.rest.post(e,JSON.stringify(t))}ldapLogin(e){return this.client.rest.post(t,JSON.stringify(e))}updateToken(e){const t=e.path?`${e.path}/${s}`:s;return e.path&&delete e.path,this.client.rest.post(t,JSON.stringify(e))}logout(){return this.client.rest.post("/logout")}}var r;exports.AccessRights=void 0,(r=exports.AccessRights||(exports.AccessRights={})).LicenseRead="license_read",r.LicenseManage="license_edit",r.UsersRead="users_read",r.UsersCreate="users_create",r.UsersActivate="users_activate",r.GroupsRead="groups_read",r.GroupsCreate="groups_create",r.RolesRead="roles_read",r.RolesCreate="roles_create",r.Share="share",r.Divide="divide",r.ExtensionsRead="extensions_read",r.ExtensionsManage="extensions_write",r.RestrictionShareRead="restriction_share_read",r.RestrictionShareWrite="restriction_share_write",r.RestrictionDivideRead="restriction_divide_read",r.RestrictionDivideWrite="restriction_divide_write",r.ReadUserLogs="read_user_logs",r.ReadSystemLogs="read_system_logs",r.ConnectionsRead="connections_read",r.ConnectionsDividing="connections_dividing",r.ConnectionsYandexDisk="connections_yandex_disk",r.ConnectionsSsh="connections_ssh",r.ConnectionsMail="connections_mail",r.ConnectionsS3="connections_s3",r.ConnectionsDiscord="connections_discord",r.ConnectionsWebdav="connections_webdav",r.ConnectionsNextcloud="connections_nextcloud",r.ConnectionsNextbox="connections_nextbox",r.ConnectionsHttpProxy="connections_http_proxy",r.SystemInfoServiceList="system_info_service_list",r.SettingsRead="settings_read",r.SettingsWrite="settings_write";const n=[exports.AccessRights.ConnectionsYandexDisk,exports.AccessRights.ConnectionsSsh,exports.AccessRights.ConnectionsMail,exports.AccessRights.ConnectionsS3,exports.AccessRights.ConnectionsS3,exports.AccessRights.ConnectionsDiscord,exports.AccessRights.ConnectionsWebdav,exports.AccessRights.ConnectionsNextcloud,exports.AccessRights.ConnectionsNextbox,exports.AccessRights.ConnectionsHttpProxy];var o,c,a,l,p,d,h,u,g,x,v,S,_,f,y,$,m,k,w,A,R,O,T,b,C,N,E,U,D,P,J;exports.OrderDirection=void 0,(o=exports.OrderDirection||(exports.OrderDirection={})).DEFAULT="",o.ASC="asc",o.DESC="desc",exports.EngineType=void 0,(c=exports.EngineType||(exports.EngineType={})).WebSocket="websocket",c.PostMessage="postmessage",c.Empty="",exports.ConnectionGroup=void 0,(a=exports.ConnectionGroup||(exports.ConnectionGroup={})).Storages="storages_connections_group",a.Webhooks="webhooks_connections_group",a.Unknown="unknown_connections_group",a.Proxy="proxy_connections_group",exports.ConnectionType=void 0,(l=exports.ConnectionType||(exports.ConnectionType={})).SSH="ssh_connection",l.YandexDisk="yandex_disk",l.Mail="mail",l.Discord="discord",l.Webdav="webdav_connection",l.Nextcloud="nextcloud_connection",l.NextBox="nextbox_connection",l.HttpProxy="http_proxy_connection",l.S3="s3_connection",exports.ExtensionType=void 0,(p=exports.ExtensionType||(exports.ExtensionType={})).App="app",p.File="file",p.WorkDir="work_dir",exports.ExtensionFileMode=void 0,(d=exports.ExtensionFileMode||(exports.ExtensionFileMode={})).Read="read",d.ReadAndWrite="read_and_write",d.Write="write",exports.DivideScope=void 0,(h=exports.DivideScope||(exports.DivideScope={})).Storage="/storage/element",h.Connection="/connections",exports.PermissionType=void 0,(u=exports.PermissionType||(exports.PermissionType={})).CLOSE="",u.READ="r",u.WRITE="rw",exports.RestrictionStatus=void 0,(g=exports.RestrictionStatus||(exports.RestrictionStatus={})).WAITING="waiting",g.APPROVED="approved",g.REJECTED="rejected",exports.RestrictionBooleanStatus=void 0,(x=exports.RestrictionBooleanStatus||(exports.RestrictionBooleanStatus={})).TRUE="true",x.FALSE="false",exports.DivideMode=void 0,(v=exports.DivideMode||(exports.DivideMode={})).User="to_user_id",v.Group="to_user_group_id",exports.RestrictionModeKey=void 0,(S=exports.RestrictionModeKey||(exports.RestrictionModeKey={})).Divide="divide",S.Share="share",exports.Tariff=void 0,(_=exports.Tariff||(exports.Tariff={})).Free="free",_.Business="business",_.Enterprise="enterprise",exports.LicenseError=void 0,(f=exports.LicenseError||(exports.LicenseError={})).NotActivated="License not activated",f.Blocked="License blocked",f.Expired="License has been expired",f.NotValid="License not valid",f.NotFound="license file not found",exports.NotificationEntityType=void 0,(y=exports.NotificationEntityType||(exports.NotificationEntityType={})).Dir="dir",y.File="file",y.User="user",y.Other="other",y.WorkDir="work_dir",y.License="license",y.Extension="extension",y.Connection="connection",exports.NotificationAction=void 0,($=exports.NotificationAction||(exports.NotificationAction={})).OpenSharing="open_sharing",$.ChangeSharing="change_sharing",$.CancelSharing="cancel_sharing",$.DivideDirAddFileToOwner="divide_dir_add_file_to_owner",$.DivideDirAddDirToOwner="divide_dir_add_dir_to_owner",$.DivideDirAddWorkDirToOwner="divide_dir_add_work_dir_to_owner",$.DivideConnectionAddFileToOwner="divide_connection_add_file_to_owner",$.DivideConnectionAddDirToOwner="divide_connection_add_dir_to_owner",$.CancelDivideDir="cancel_divide_dir",$.CancelDivideFile="cancel_divide_file",$.CancelDivideWorkDir="cancel_divide_work_dir",$.CancelDivideConnection="cancel_divide_connection",$.DeleteExtension="delete_extension",$.NewVersionExtension="new_version_extension",$.TransferData="transfer_data",$.AllowInternalAccessUser="allow_internal_access_to_user",$.BlockInternalAccessUser="block_internal_access_to_user",$.WaitInternalAccessUser="wait_internal_access_to_user",$.WaitInternalAccessUserCreate="wait_internal_access_to_user_create",$.AllowInternalAccessGroup="allow_internal_access_to_group",$.BlockInternalAccessGroup="block_internal_access_to_group",$.WaitInternalAccessGroup="wait_internal_access_to_group",$.WaitInternalAccessGroupCreate="wait_internal_access_to_group_create",$.AllowSharing="allow_sharing",$.BlockSharing="block_sharing",$.WaitSharing="wait_sharing",$.WaitSharingCreate="wait_sharing_create",$.Other="other",exports.NotificationRowAction=void 0,(m=exports.NotificationRowAction||(exports.NotificationRowAction={})).Read="read",m.Unread="unread",m.Delete="delete",exports.NotificationStyle=void 0,(k=exports.NotificationStyle||(exports.NotificationStyle={})).Plain="plain",k.Success="success",k.Info="info",k.Warning="warning",k.Error="error",exports.ResponseType=void 0,(w=exports.ResponseType||(exports.ResponseType={})).ArrayBuffer="arraybuffer",w.Blob="blob",w.Json="json",w.Text="text",exports.RequestMethod=void 0,(A=exports.RequestMethod||(exports.RequestMethod={})).GET="GET",A.POST="POST",A.PUT="PUT",A.PATCH="PATCH",A.DELETE="DELETE",exports.RequestObserve=void 0,(R=exports.RequestObserve||(exports.RequestObserve={})).Body="body",R.Response="response",exports.RestrictionSharing=void 0,(O=exports.RestrictionSharing||(exports.RestrictionSharing={})).NONE="none",O.SOFT="soft",O.HARD="hard",exports.UserAuthType=void 0,(T=exports.UserAuthType||(exports.UserAuthType={})).Native="native",T.Ldap="ldap",T.Vk="vk",exports.UserStatus=void 0,(b=exports.UserStatus||(exports.UserStatus={})).Registering="registering",b.Activated="activated",b.Blocked="blocked",b.BlockedByLicense="blocked_by_license",exports.UserType=void 0,(C=exports.UserType||(exports.UserType={})).User="user",C.Guest="guest",C.Emperor="emperor",C.Anonymous="anonymous",exports.SettingControlType=void 0,(N=exports.SettingControlType||(exports.SettingControlType={})).Text="text",N.String="string",N.Number="number",N.CheckBox="checkbox",N.Select="select",N.RadioList="radio_list",N.ConnectionChoose="connection_choose",N.MultiConnectionChoose="multi_connection_choose",exports.StorageElementType=void 0,(E=exports.StorageElementType||(exports.StorageElementType={})).Dir="dir",E.File="file",E.WorkDir="work_dir",exports.StorageElementContentType=void 0,(U=exports.StorageElementContentType||(exports.StorageElementContentType={})).Any="any",U.Dir="dir",U.Code="code",U.Image="image",U.Audio="audio",U.Video="video",U.Text="text",U.Doc="doc",U.Xls="xls",U.Ppt="ppt",exports.StorageRoot=void 0,(D=exports.StorageRoot||(exports.StorageRoot={})).my="my",D.fca="fca",D.divide="divide",D.share="share",D.favorite="favorite",exports.StorageElementHistoryAction=void 0,(P=exports.StorageElementHistoryAction||(exports.StorageElementHistoryAction={})).Create="create",P.Update="update",P.Move="move",exports.StorageElementCheckStatus=void 0,(J=exports.StorageElementCheckStatus||(exports.StorageElementCheckStatus={}))[J.CheckNull=0]="CheckNull",J[J.CheckInProgress=1]="CheckInProgress",J[J.CheckPositive=2]="CheckPositive",J[J.CheckNegative=3]="CheckNegative";const I="/connections",L=`${I}/dashboard`;class q{constructor(e){this.client=e}list(e){return this.client.rest.get(I,e)}get(e){return this.client.rest.get(`${I}/${e}`)}update(e,t){return this.client.rest.put(`${I}/${e}`,JSON.stringify(t))}delete(e){return this.client.rest.delete(`${I}/${e}`)}create(e){const t={[exports.ConnectionType.SSH]:"/disk/ssh",[exports.ConnectionType.Webdav]:"/disk/webdav",[exports.ConnectionType.Nextcloud]:"/disk/nextcloud",[exports.ConnectionType.NextBox]:"/disk/nextbox",[exports.ConnectionType.Discord]:"/webhooks/discord",[exports.ConnectionType.Mail]:"/webhooks/mail",[exports.ConnectionType.HttpProxy]:"/http_proxy",[exports.ConnectionType.S3]:"/disk/s3"};return this.client.rest.post(t[e.type]||I,JSON.stringify(e))}dashboard(e){return this.client.rest.get(L,e)}}class j{constructor(e){this.client=e}discovery(e){return this.client.rest.get("/discovery",e)}}const M="/divide",F=`${M}/restrictions`;class H{constructor(e){this.client=e}divideDelete(e,t){return this.client.rest.delete(`${e}/${M}/${t}`)}divideDeleteAll(e,t,s,i){return this.client.rest.delete(`${e}/${M}`,Object.assign(Object.assign({},this.makeParam(e,t)),{is_to_user_group:i,access_mode:s}))}divideChange(e,t,s){return this.client.rest.put(`${e}/divide/${t}`,JSON.stringify({access_mode:s}))}divideCreate(e,t,s,i,r){const n=Object.assign(Object.assign({},this.makeParam(e,t)),{[r]:s,access_mode:i});return this.client.rest.post(`${e}/${M}`,JSON.stringify(n))}divideUsers(e,t,s){return this.client.rest.get(`${e}/${M}/users`,Object.assign(Object.assign({},this.makeParam(e,t)),s))}getRestriction(e){return this.client.rest.get(`${F}/${e}`)}restrictionSize(e,t){return this.client.rest.get(`/${t}/restrictions/${e}/size`)}restrictions(e){return this.client.rest.get(`${F}`,e)}restrictionsChange(e,t){return this.client.rest.put(`${F}/${e}`,JSON.stringify(t))}makeParam(e,t){const s={};return e===exports.DivideScope.Connection?s.connection_id=t:s.path=t,s}}function W(e,t,s,i){return new(s||(s=Promise))((function(r,n){function o(e){try{a(i.next(e))}catch(e){n(e)}}function c(e){try{a(i.throw(e))}catch(e){n(e)}}function a(e){var t;e.done?r(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,c)}a((i=i.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class B extends Error{}function G(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return function(e){return decodeURIComponent(atob(e).replace(/(.)/g,((e,t)=>{let s=t.charCodeAt(0).toString(16).toUpperCase();return s.length<2&&(s="0"+s),"%"+s})))}(t)}catch(e){return atob(t)}}function V(e,t){if("string"!=typeof e)throw new B("Invalid token specified: must be a string");t||(t={});const s=!0===t.header?0:1,i=e.split(".")[s];if("string"!=typeof i)throw new B(`Invalid token specified: missing part #${s+1}`);let r;try{r=G(i)}catch(e){throw new B(`Invalid token specified: invalid base64 for part #${s+1} (${e.message})`)}try{return JSON.parse(r)}catch(e){throw new B(`Invalid token specified: invalid json for part #${s+1} (${e.message})`)}}B.prototype.name="InvalidTokenError";const z=(e,t)=>W(void 0,void 0,void 0,(function*(){let s=t;for(const t of e)try{s=yield t.fulfilled(s)}catch(e){if(!t.rejected)throw e;s=yield t.rejected(e)}return s}));function K(e){var t;return null!==(t=Object.fromEntries(document.cookie.split(";").map((e=>e.split("="))).map((([e,t])=>[e.trim(),decodeURIComponent(t||"")])))[e])&&void 0!==t?t:null}const X=e=>{const t=new URLSearchParams;return Object.keys(e).forEach((s=>{Array.isArray(e[s])?e[s].forEach((e=>{t.append(s,e)})):t.append(s,e[s])})),t};function Y(e){return e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):e}const Q="/api/v1",Z="/api/v2",ee=`${window.location.protocol}//${window.location.host}`;class te{constructor(e,t){this.client=e,this.tokenUpdate=t}get state(){return this.client.state}get(e,t,s){return this.request(exports.RequestMethod.GET,e,Object.assign({params:t,cache:"no-cache"},s))}post(e,t,s){return this.request(exports.RequestMethod.POST,e,Object.assign({body:t},s))}put(e,t,s){return this.request(exports.RequestMethod.PUT,e,Object.assign({body:t,cache:"no-cache"},s))}patch(e,t,s){return this.request(exports.RequestMethod.PATCH,e,Object.assign({body:t},s))}delete(e,t,s){return this.request(exports.RequestMethod.DELETE,e,Object.assign({params:t},s))}upload(e,t,s){const i=new AbortController,r=i.signal;return{promise:this.request(exports.RequestMethod.POST,e,Object.assign({body:t,signal:r},s)),abort:()=>i.abort()}}request(e,t,s){return W(this,void 0,void 0,(function*(){return new Promise(((i,r)=>W(this,void 0,void 0,(function*(){var n,o;const c=null!==(n=this.state.skipInterceptors)&&void 0!==n&&n;this.state.skipInterceptors=!1;let a=Object.assign({method:e},s);if((null==s?void 0:s.signal)&&(a.signal=s.signal),c||(s=yield z(this.client.requestInterceptors,a)),this.state.authToken)for(const[e,i]of this.state.authToken.entries()){const r=V(i.access_token);if(r&&r.is_remember&&this.tokenUpdate.isTokenExpire(r.exp)&&!t.includes("/login")&&!t.includes("/assets")){const t=yield this.tokenUpdate.refreshToken(i);t&&(this.state.authToken.set(e,t),s=yield z(this.client.requestInterceptors,a))}}const l=new XMLHttpRequest;(null==s?void 0:s.params)&&0!==Object.keys(s.params).length&&(t+="?"+X(s.params));const p=`${this.state.clientParams.host}${this.state.clientParams.version}${t}`;if(l.open(e,p,!0),null==s?void 0:s.headers){const e=Y(s.headers);for(const[t,s]of Object.entries(e))(this.state.clientParams.host===ee||"content-type"!==t.toLowerCase())&&l.setRequestHeader(t,s)}(null==s?void 0:s.responseType)&&(l.responseType=s.responseType),(null==s?void 0:s.signal)&&s.signal.addEventListener("abort",(()=>{l.abort(),r(new Error("Upload aborted"))})),l.upload&&[exports.RequestMethod.POST,exports.RequestMethod.PUT,exports.RequestMethod.PATCH].includes(e)&&(l.upload.onprogress=e=>{e.lengthComputable&&(null==s?void 0:s.onUploadProgress)&&s.onUploadProgress(e)}),l.onload=()=>W(this,void 0,void 0,(function*(){if((null==s?void 0:s.signal)&&s.signal.aborted)return;let e;switch(null==s?void 0:s.responseType){case exports.ResponseType.Text:e=l.responseText;break;case exports.ResponseType.Blob:case exports.ResponseType.ArrayBuffer:e=l.response;break;default:try{e=JSON.parse(l.responseText)}catch(t){e=l.responseText}}const t=new Headers;l.getAllResponseHeaders().split("\r\n").forEach((e=>{const[s,i]=e.split(": ");s&&i&&t.append(s,i)}));let n={status:l.status,statusText:l.statusText,headers:t,url:l.responseURL};l.status>=200&&l.status<300?(null==s?void 0:s.observe)===exports.RequestObserve.Response?i(Object.assign(Object.assign({},n),{body:e})):i(e):r(Object.assign(Object.assign({},n),{error:e})),n=yield z(this.client.responseInterceptors,n)})),l.onerror=()=>{r({status:l.status,statusText:l.statusText,url:l.responseURL,error:"Network error"})},l.send(null!==(o=null==s?void 0:s.body)&&void 0!==o?o:null)}))))}))}changeBaseUrlVersion(e,t){return W(this,void 0,void 0,(function*(){const s=this.state.clientParams.version;this.state.clientParams.version=e;try{return yield t()}finally{this.state.clientParams.version=s}}))}changeHost(e,t){return W(this,void 0,void 0,(function*(){this.state.clientParams.host=e,this.state.requestParams.headers={};try{return yield t()}finally{this.state.clientParams.host=ee}}))}}class se{constructor(e){this.authApiService=e,this.isUpdating=!1,this.tokenUpdateResolve=null}isTokenExpire(e){if(!e)return!1;return 1e3*e<=(new Date).getTime()+3e3}refreshToken(e){return W(this,void 0,void 0,(function*(){const{access_token:t,refresh_token:s}=e;return t&&s?this.isUpdating?this.waitForTokenUpdate():(this.isUpdating=!0,new Promise(((e,i)=>{const r=new XMLHttpRequest,n=`${ee}${Q}/login/update`;r.open("POST",n,!0),r.setRequestHeader("Content-Type","application/json"),r.send(JSON.stringify({access_token:t,refresh_token:s})),r.onload=()=>{if(r.status>=200&&r.status<300)try{const t=JSON.parse(r.responseText);if(t&&t.access_token&&t.refresh_token){const s={access_token:t.access_token,refresh_token:t.refresh_token};K("access_token")===s.access_token&&localStorage.setItem("refresh-token",s.refresh_token),this.tokenUpdateResolve&&(this.tokenUpdateResolve(s),this.tokenUpdateResolve=null),e(s)}else e(null)}catch(e){i(new Error("Failed to parse response JSON."))}else i(new Error(`Request failed with status: ${r.status}`))},r.onerror=()=>{i(new Error("Network error occurred"))},r.onloadend=()=>{this.isUpdating=!1}}))):null}))}waitForTokenUpdate(){return W(this,void 0,void 0,(function*(){return new Promise((e=>{const t=setInterval((()=>{this.isUpdating||(clearInterval(t),e())}),100)}))}))}}const ie="/static/extensions",re="/extensions/defaults";class ne{constructor(e){this.client=e}getSetting(e){return this.client.rest.get(`${ie}/${e}/settings`)}setSetting(e,t){return this.client.rest.post(`${ie}/${e}/settings`,JSON.stringify(t))}deleteSetting(e){return this.client.rest.delete(`${ie}/${e}/settings`)}get(e){return this.client.rest.get(`${ie}/${e}`)}getByKey(e){return this.client.rest.get(`${ie}/${e}`)}getDefault(e=[]){return this.client.rest.get(re,{ext_code:e})}setDefault(e,t){return this.client.rest.post(re,JSON.stringify({ext_code:e,ext_uniq_key:t}))}checkUpdates(){return this.client.rest.post(`${ie}/check_updates`)}updateVersion(e,t){return this.client.rest.put(`${ie}/${e}`,JSON.stringify({version:t}))}list(e){return this.client.rest.get(ie,e)}delete(e,t){return this.client.rest.delete(`${ie}/${e}`)}upload(e,t){const s=new FormData;s.set("file",t);const{promise:i,abort:r}=this.client.rest.upload(ie,s,{onUploadProgress:t=>{e(t)}});return{promise:this.client.rest.changeBaseUrlVersion(Z,(()=>i)),abort:r}}install(e,t){return this.client.rest.changeBaseUrlVersion(Z,(()=>this.client.rest.post(`${ie}/site`,JSON.stringify({uniq_key:e,version:t}))))}}const oe="/anons_ext/extensions";class ce{constructor(e){this.client=e}listExtensionsSite(e){return this.client.rest.changeHost("https://next-box.ru",(()=>this.client.rest.get(oe,e)))}extensionDetailSite(e){return this.client.rest.changeHost("https://next-box.ru",(()=>this.client.rest.get(`${oe}/${e}`)))}extensionMarkdown(e,t){return this.client.rest.changeHost("https://next-box.ru",(()=>this.client.rest.get(`${oe}/${e}/readme`,{},t)))}}const ae="/disk",le=`${ae}/check`;class pe{constructor(e){this.client=e}info(e,t){return this.client.rest.get(`${ae}/${e}/element`,{path:t})}list(e,t){return this.client.rest.get(`${ae}/${e}`,t)}create(e,t){return this.client.rest.post(`${ae}/${e}/element`,JSON.stringify(t))}replace(e,t,s){return this.client.rest.put(`${ae}/${e}/files?path=${t}`,s)}read(e,t){return this.client.rest.get(`${ae}/${e}/files?path=${t}`)}upload(e,t,s,i=""){const r=new FormData;r.set("path",i),r.set("file",s);const{promise:n,abort:o}=this.client.rest.upload(`${ae}/${t}/files`,r,{onUploadProgress:t=>{e(t)}});return{promise:n,abort:o}}uploadNet(e,t){return this.client.rest.post(`${ae}/${e}/files/net`,JSON.stringify(t))}delete(e,t){return this.client.rest.delete(`${ae}/${e}/trash/element`,{path:t})}check(e){return this.client.rest.post(le,JSON.stringify(e))}}const de="/settings";class he{constructor(e){this.client=e}settings(){return this.client.rest.get(de)}changeSettings(e){return this.client.rest.post(de,JSON.stringify(e))}queryInit(){return this.client.rest.get("/query/init")}}const ue="/groups";class ge{constructor(e){this.client=e}list(e){return this.client.rest.get(ue,e)}listUsers(e){return this.client.rest.get(`${ue}/${e}/users`)}create(e){return this.client.rest.post(ue,JSON.stringify(e))}update(e,t){return this.client.rest.put(`${ue}/${e}`,JSON.stringify(t))}delete(e){return this.client.rest.delete(`${ue}/${e}`)}}const xe="/license",ve=`${xe}/manual-check`,Se=`${xe}/hardware/hash`;class _e{constructor(e){this.client=e}info(){return this.client.rest.get(xe)}create(e){return this.client.rest.post(xe,JSON.stringify(e))}check(){return this.client.rest.post(ve)}delete(){return this.client.rest.delete(xe)}getHash(){return this.client.rest.get(Se)}}const fe="/links";class ye{constructor(e){this.client=e}createShortLink(e){return this.client.rest.post(fe,JSON.stringify(e))}updateShortLink(e){return this.client.rest.put(fe,JSON.stringify(e))}}const $e="/logs";class me{constructor(e){this.client=e}getUsersLogs(e){return this.client.rest.get(`${$e}/users`,e)}getSystemLogs(e,t,s){return this.client.rest.get(`${$e}/${e}`,{},{observe:exports.RequestObserve.Response,responseType:exports.ResponseType.Text,headers:{Range:`bytes=${t}-${s}`}})}}const ke="/notifications",we=`${ke}/all`,Ae=`${ke}/subscription`,Re=`${ke}/permission`;class Oe{constructor(e){this.client=e}list(e){return this.client.rest.get(ke,e)}toggleStatus(e,t){return this.client.rest.put(ke,JSON.stringify({ids:e,to_status:t}))}toggleAllStatus(e){return this.client.rest.put(we,JSON.stringify({to_status:e}))}delete(e){return this.client.rest.delete(ke,{id:e})}deleteAll(){return this.client.rest.delete(we)}getPermission(){return this.client.rest.get(Re)}setPermission(e){return this.client.rest.post(Re,JSON.stringify({enabled:e}))}getSubscription(){return this.client.rest.get(Ae)}setSubscription(e){const t={action_groups:Object.assign({},e)};return this.client.rest.post(Ae,JSON.stringify(t))}}const Te="/roles",be=`${Te}/default`,Ce="/permissions";class Ne{constructor(e){this.client=e}list(e){return this.client.rest.get(Te,e)}get(e){return this.client.rest.get(`${Te}/${e}`)}getDefault(){return this.client.rest.get(`${be}`)}create(e){return this.client.rest.post(Te,JSON.stringify(e))}update(e,t){return this.client.rest.put(`${Te}/${e}`,JSON.stringify(t))}delete(e){return this.client.rest.delete(`${Te}/${e}`)}permissionList(){return this.client.rest.get(Ce)}addPermission(e,t){return this.client.rest.put(`${Te}/${e}/permissions`,JSON.stringify({ids:t}))}deletePermission(e,t){return this.client.rest.delete(`${Te}/${e}/${Ce}`,{ids:t})}}const Ee="/share",Ue=`${Ee}/restrictions`;class De{constructor(e){this.client=e}info(e,t){const s=new URLSearchParams({path:e,share_token:t});return this.client.rest.get(`${Ee}?${s.toString()}`)}checkPassword(e,t){const s=encodeURIComponent(e);return this.client.rest.get(`${Ee}/password?share_token=${t}&share_pass=${s}`)}checkToken(e){return this.client.rest.get(`${Ee}?share_token=${e}`)}getRestriction(e){return this.client.rest.get(`${Ue}/${e}`)}restrictions(e){return this.client.rest.get(Ue,e)}restrictionsChange(e,t){return this.client.rest.put(`${Ue}/${e}`,JSON.stringify(t))}}const Pe="/storage",Je=`${Pe}/element`,Ie=`${Je}/move`,Le=`${Je}/copy`,qe=`${Je}/content_type_size`,je="/disk";class Me{constructor(e,t){this.client=e,this.fcaApiService=t}list(e){return this.client.rest.get(Pe,e)}info(e){var t;return parseInt((null===(t=e.divide_id)||void 0===t?void 0:t.toString())||"")||delete e.divide_id,e.file_version_id||delete e.file_version_id,this.client.rest.get(Je,e)}combineInfo({root:e,rootId:t,path:s,file_version_id:i}){return e===exports.StorageRoot.fca&&t?this.fcaApiService.info(t,s):this.info({path:s,divide_id:t,file_version_id:i})}size(e){return this.client.rest.post(`${Je}/size`,JSON.stringify(e))}move(e,t,s){const{from_divide_id:i,to_divide_id:r}=e;let n=Object.assign(Object.assign({},e),{from_divide_id:null,to_divide_id:null});return t===exports.StorageRoot.fca&&s===exports.StorageRoot.fca?this.client.rest.post(`${je}/${i}/files/move${je}/${r}`,JSON.stringify(n)):t===exports.StorageRoot.fca?(i&&(n.from_divide_id=i),this.client.rest.put(`${je}/${r}/files/from/box`,JSON.stringify(n))):s===exports.StorageRoot.fca?(r&&(n.to_divide_id=r),this.client.rest.put(`${je}/${i}/files/to/box`,JSON.stringify(n))):this.client.rest.post(Ie,JSON.stringify(e))}copy(e,t,s){const{from_divide_id:i,to_divide_id:r}=e;let n=Object.assign(Object.assign({},e),{from_divide_id:null,to_divide_id:null});return s===exports.StorageRoot.fca&&t===exports.StorageRoot.fca?this.client.rest.post(`${je}/${i}/files/copy${je}/${r}`,JSON.stringify(n)):s===exports.StorageRoot.fca?(i&&(n.from_divide_id=i),this.client.rest.post(`${je}/${r}/files/from/box`,JSON.stringify(n))):t===exports.StorageRoot.fca?(r&&(n.to_divide_id=r),this.client.rest.post(`${je}/${i}/files/to/box`,JSON.stringify(n))):this.client.rest.post(Le,JSON.stringify(e))}pasteFromShared(e,t,s){const i={from_sharing_token:e,from_sharing_password:s,paths:t};return this.client.rest.post(`${Je}/copy`,JSON.stringify(i))}create(e){return this.client.rest.post(Je,JSON.stringify(e))}delete(e,t){const s={path:e};return t&&(s.divide_id=t),this.client.rest.delete(Je,s)}favorite(e){return this.client.rest.put(`${Je}?path=${encodeURIComponent(e)}`,JSON.stringify({is_favorite:!0}))}removeFavorite(e){return this.client.rest.put(`${Je}?path=${encodeURIComponent(e)}`,JSON.stringify({is_favorite:!1}))}createItem(e){return this.client.rest.post(Je,JSON.stringify(e))}createWorkDir(e){return this.client.rest.post(Je,JSON.stringify(e))}sizeWithSection(e){return this.client.rest.get(qe,e)}}const Fe="/storage/files",He=`${Fe}/net`;class We{constructor(e){this.client=e}read(e,t){return t.path=e,this.client.rest.get(Fe,t)}replace(e,t){const s=new URLSearchParams;return Object.keys(e).forEach((t=>{e[t]&&s.append(t,e[t])})),this.client.rest.put(`${Fe}?${s.toString()}`,t)}upload(e,t,s,i){const r=new FormData;r.set("path",s),i&&r.set("divide_id",i.toString()),r.set("file",t);const{promise:n,abort:o}=this.client.rest.upload(Fe,r,{onUploadProgress:t=>{e(t)}});return{promise:n,abort:o}}uploadNet(e){return this.client.rest.post(He,JSON.stringify(e))}}class Be{constructor(e){this.client=e}instance(){return this.client.rest.get("/storage/instance")}}const Ge="/storage/element/share";class Ve{constructor(e){this.client=e}info(e){return this.client.rest.get(Ge,{path:e})}create(e,t){const s={path:e,permissions_type:t};return this.client.rest.post(Ge,JSON.stringify(s))}change(e){return this.client.rest.put(`${Ge}/${e.token}`,JSON.stringify(e))}delete(e){return this.client.rest.delete(Ge,{path:e})}refresh(e){return this.client.rest.put(`${Ge}/${e}/refresh`)}}const ze="/storage/trash",Ke=`${ze}/element`,Xe=`${Ke}/all`;class Ye{constructor(e){this.client=e}list(e){return this.client.rest.get(ze,e)}clear(e){return this.client.rest.delete(Ke,e)}clearAll(){return this.client.rest.delete(Xe)}restore(e){return this.client.rest.patch(Ke,JSON.stringify({del_groups:e}))}}const Qe="/users",Ze=`${Qe}/me`,et=`${Ze}/avatars`,tt=`${Ze}/sessions`,st=`${Ze}/tokens`,it=`${Ze}/change-password`;class rt{constructor(e){this.client=e}list(e){return this.client.rest.get(Qe,e)}get(e){return this.client.rest.get(Qe+`/${e}`)}create(e){return this.client.rest.post(Qe,JSON.stringify(e))}update(e,t){return this.client.rest.put(Qe+`/${e}`,JSON.stringify(t))}delete(e,t){return this.client.rest.delete(`${Qe}/${e}`,t)}restore(e){return this.client.rest.post(`${Qe}/${e}/restore`)}me(){return this.client.rest.get(Ze)}updateMe(e){return this.client.rest.put(Ze,JSON.stringify(e))}createToken(e){return this.client.rest.post(st,JSON.stringify(e))}listToken(e){return this.client.rest.get(st,e)}deleteToken(e){return this.client.rest.delete(`${st}/${e}`)}changeMyPassword(e){return this.client.rest.put(it,JSON.stringify(e))}changeUsersPassword(e,t){return this.client.rest.put(`${Qe}/${e}/change-password`,JSON.stringify(t))}meUploadAvatar(e,t){const s=new FormData;return s.append("file",e,t),this.client.rest.post(et,s)}meDeleteAvatar(){return this.client.rest.delete(et)}meListSession(e){return this.client.rest.get(tt,e)}meDeleteSession(e){let t=tt;return e&&(t+=`/${e}`),this.client.rest.delete(t)}setRole(e,t=null){return this.client.rest.put(`${Qe}/${e}/roles`,JSON.stringify({role_id:t}))}}const nt="/storage/element",ot=`${nt}/history`,ct=`${nt}/version`,at=`${ct}/current`,lt=`${ct}/size`;class pt{constructor(e){this.client=e}history(e){return this.client.rest.get(ot,e)}versions(e){return this.client.rest.get(ct,e)}create(e){return this.client.rest.post(ct,JSON.stringify(e))}edit(e){return this.client.rest.put(ct,JSON.stringify(e))}delete(e){return this.client.rest.delete(ct,e)}size(e){return this.client.rest.get(lt,e)}makeCurrent(e){return this.client.rest.post(at,JSON.stringify(e))}}exports.AuthApiService=i,exports.BASE_URL_V1=Q,exports.BASE_URL_V2=Z,exports.CONNECTIONS_PERMISSION=n,exports.Client=class{constructor(e){this.AuthApiService=new i(this),this.ConnectionsApiService=new q(this),this.DiscoveryApiService=new j(this),this.DivideApiService=new H(this),this.ExtensionsApiService=new ne(this),this.ExtensionsExternalApiService=new ce(this),this.FcaApiService=new pe(this),this.GatewayApiService=new he(this),this.GroupApiService=new ge(this),this.LicenseApiService=new _e(this),this.LinksApiService=new ye(this),this.LogstashApiService=new me(this),this.NotificationApiService=new Oe(this),this.RoleApiService=new Ne(this),this.ShareApiService=new De(this),this.StorageElementApiService=new Me(this,this.FcaApiService),this.StorageFilesApiService=new We(this),this.StorageInstanceApiService=new Be(this),this.StorageShareApiService=new Ve(this),this.StorageTrashApiService=new Ye(this),this.UserApiService=new rt(this),this.VersionApiService=new pt(this),this.tokenUpdate=new se(this.AuthApiService),this.rest=new te(this,this.tokenUpdate),this.requestInterceptors=[],this.responseInterceptors=[],this.request={use:(e,t)=>{this.requestInterceptors.push({fulfilled:e,rejected:t})}},this.response={use:(e,t)=>{this.responseInterceptors.push({fulfilled:e,rejected:t})}},this.state={clientParams:{host:(null==e?void 0:e.host)||`${window.location.protocol}//${window.location.host}`,version:(null==e?void 0:e.version)||"/api/v1"},requestParams:{path:"",headers:{},query:{},body:null,cache:"no-cache"},authToken:null,skipInterceptors:!1}}},exports.ConnectionsApiService=q,exports.DiscoveryApiService=j,exports.DivideApiService=H,exports.ExtensionsApiService=ne,exports.ExtensionsExternalApiService=ce,exports.FcaApiService=pe,exports.GatewayApiService=he,exports.GroupApiService=ge,exports.HOST=ee,exports.LicenseApiService=_e,exports.LinksApiService=ye,exports.LogstashApiService=me,exports.NotificationApiService=Oe,exports.Rest=te,exports.RoleApiService=Ne,exports.ShareApiService=De,exports.StorageElementApiService=Me,exports.StorageFilesApiService=We,exports.StorageInstanceApiService=Be,exports.StorageShareApiService=Ve,exports.StorageTrashApiService=Ye,exports.TokenUpdate=se,exports.UserApiService=rt,exports.VersionApiService=pt,exports.applyInterceptors=z,exports.getCookieValue=K,exports.makeUrlParams=X,exports.normalizeHeaders=Y;
@@ -1 +1 @@
1
- const e="/login",t=`${e}/ldap`,s=`${e}/update`;class i{constructor(e){this.client=e}info(){return this.client.rest.get(e)}login(t){return this.client.rest.post(e,JSON.stringify(t))}ldapLogin(e){return this.client.rest.post(t,JSON.stringify(e))}updateToken(e){const t=e.path?`${e.path}/${s}`:s;return e.path&&delete e.path,this.client.rest.post(t,JSON.stringify(e))}logout(){return this.client.rest.post("/logout")}}var n;!function(e){e.LicenseRead="license_read",e.LicenseManage="license_edit",e.UsersRead="users_read",e.UsersCreate="users_create",e.UsersActivate="users_activate",e.GroupsRead="groups_read",e.GroupsCreate="groups_create",e.RolesRead="roles_read",e.RolesCreate="roles_create",e.Share="share",e.Divide="divide",e.ExtensionsRead="extensions_read",e.ExtensionsManage="extensions_write",e.RestrictionShareRead="restriction_share_read",e.RestrictionShareWrite="restriction_share_write",e.RestrictionDivideRead="restriction_divide_read",e.RestrictionDivideWrite="restriction_divide_write",e.ReadUserLogs="read_user_logs",e.ReadSystemLogs="read_system_logs",e.ConnectionsRead="connections_read",e.ConnectionsDividing="connections_dividing",e.ConnectionsYandexDisk="connections_yandex_disk",e.ConnectionsSsh="connections_ssh",e.ConnectionsMail="connections_mail",e.ConnectionsS3="connections_s3",e.ConnectionsDiscord="connections_discord",e.ConnectionsWebdav="connections_webdav",e.ConnectionsNextcloud="connections_nextcloud",e.ConnectionsNextbox="connections_nextbox",e.ConnectionsHttpProxy="connections_http_proxy",e.SystemInfoServiceList="system_info_service_list",e.SettingsRead="settings_read",e.SettingsWrite="settings_write"}(n||(n={}));const r=[n.ConnectionsYandexDisk,n.ConnectionsSsh,n.ConnectionsMail,n.ConnectionsS3,n.ConnectionsS3,n.ConnectionsDiscord,n.ConnectionsWebdav,n.ConnectionsNextcloud,n.ConnectionsNextbox,n.ConnectionsHttpProxy];var o,c,a,l,d,h,u,p,g,f,_,v,$,S,y,m,k,w,b,O,x,N,A,C,T,J,D,U,E,P;!function(e){e.DEFAULT="",e.ASC="asc",e.DESC="desc"}(o||(o={})),function(e){e.WebSocket="websocket",e.PostMessage="postmessage",e.Empty=""}(c||(c={})),function(e){e.Storages="storages_connections_group",e.Webhooks="webhooks_connections_group",e.Unknown="unknown_connections_group",e.Proxy="proxy_connections_group"}(a||(a={})),function(e){e.SSH="ssh_connection",e.YandexDisk="yandex_disk",e.Mail="mail",e.Discord="discord",e.Webdav="webdav_connection",e.Nextcloud="nextcloud_connection",e.NextBox="nextbox_connection",e.HttpProxy="http_proxy_connection",e.S3="s3_connection"}(l||(l={})),function(e){e.App="app",e.File="file",e.WorkDir="work_dir"}(d||(d={})),function(e){e.Read="read",e.ReadAndWrite="read_and_write",e.Write="write"}(h||(h={})),function(e){e.Storage="/storage/element",e.Connection="/connections"}(u||(u={})),function(e){e.CLOSE="",e.READ="r",e.WRITE="rw"}(p||(p={})),function(e){e.WAITING="waiting",e.APPROVED="approved",e.REJECTED="rejected"}(g||(g={})),function(e){e.TRUE="true",e.FALSE="false"}(f||(f={})),function(e){e.User="to_user_id",e.Group="to_user_group_id"}(_||(_={})),function(e){e.Divide="divide",e.Share="share"}(v||(v={})),function(e){e.Free="free",e.Business="business",e.Enterprise="enterprise"}($||($={})),function(e){e.NotActivated="License not activated",e.Blocked="License blocked",e.Expired="License has been expired",e.NotValid="License not valid",e.NotFound="license file not found"}(S||(S={})),function(e){e.Dir="dir",e.File="file",e.User="user",e.Other="other",e.WorkDir="work_dir",e.License="license",e.Extension="extension",e.Connection="connection"}(y||(y={})),function(e){e.OpenSharing="open_sharing",e.ChangeSharing="change_sharing",e.CancelSharing="cancel_sharing",e.DivideDirAddFileToOwner="divide_dir_add_file_to_owner",e.DivideDirAddDirToOwner="divide_dir_add_dir_to_owner",e.DivideDirAddWorkDirToOwner="divide_dir_add_work_dir_to_owner",e.DivideConnectionAddFileToOwner="divide_connection_add_file_to_owner",e.DivideConnectionAddDirToOwner="divide_connection_add_dir_to_owner",e.CancelDivideDir="cancel_divide_dir",e.CancelDivideFile="cancel_divide_file",e.CancelDivideWorkDir="cancel_divide_work_dir",e.CancelDivideConnection="cancel_divide_connection",e.DeleteExtension="delete_extension",e.NewVersionExtension="new_version_extension",e.TransferData="transfer_data",e.AllowInternalAccessUser="allow_internal_access_to_user",e.BlockInternalAccessUser="block_internal_access_to_user",e.WaitInternalAccessUser="wait_internal_access_to_user",e.WaitInternalAccessUserCreate="wait_internal_access_to_user_create",e.AllowInternalAccessGroup="allow_internal_access_to_group",e.BlockInternalAccessGroup="block_internal_access_to_group",e.WaitInternalAccessGroup="wait_internal_access_to_group",e.WaitInternalAccessGroupCreate="wait_internal_access_to_group_create",e.AllowSharing="allow_sharing",e.BlockSharing="block_sharing",e.WaitSharing="wait_sharing",e.WaitSharingCreate="wait_sharing_create",e.Other="other"}(m||(m={})),function(e){e.Read="read",e.Unread="unread",e.Delete="delete"}(k||(k={})),function(e){e.Plain="plain",e.Success="success",e.Info="info",e.Warning="warning",e.Error="error"}(w||(w={})),function(e){e.ArrayBuffer="arraybuffer",e.Blob="blob",e.Json="json",e.Text="text"}(b||(b={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.PATCH="PATCH",e.DELETE="DELETE"}(O||(O={})),function(e){e.Body="body",e.Response="response"}(x||(x={})),function(e){e.NONE="none",e.SOFT="soft",e.HARD="hard"}(N||(N={})),function(e){e.Native="native",e.Ldap="ldap",e.Vk="vk"}(A||(A={})),function(e){e.Registering="registering",e.Activated="activated",e.Blocked="blocked",e.BlockedByLicense="blocked_by_license"}(C||(C={})),function(e){e.User="user",e.Guest="guest",e.Emperor="emperor",e.Anonymous="anonymous"}(T||(T={})),function(e){e.Text="text",e.String="string",e.Number="number",e.CheckBox="checkbox",e.Select="select",e.RadioList="radio_list",e.ConnectionChoose="connection_choose",e.MultiConnectionChoose="multi_connection_choose"}(J||(J={})),function(e){e.Dir="dir",e.File="file",e.WorkDir="work_dir"}(D||(D={})),function(e){e.Any="any",e.Dir="dir",e.Code="code",e.Image="image",e.Audio="audio",e.Video="video",e.Text="text",e.Doc="doc",e.Xls="xls",e.Ppt="ppt"}(U||(U={})),function(e){e.my="my",e.fca="fca",e.divide="divide",e.share="share",e.favorite="favorite"}(E||(E={})),function(e){e.Create="create",e.Update="update",e.Move="move"}(P||(P={}));const R="/connections",I=`${R}/dashboard`;class L{constructor(e){this.client=e}list(e){return this.client.rest.get(R,e)}get(e){return this.client.rest.get(`${R}/${e}`)}update(e,t){return this.client.rest.put(`${R}/${e}`,JSON.stringify(t))}delete(e){return this.client.rest.delete(`${R}/${e}`)}create(e){const t={[l.SSH]:"/disk/ssh",[l.Webdav]:"/disk/webdav",[l.Nextcloud]:"/disk/nextcloud",[l.NextBox]:"/disk/nextbox",[l.Discord]:"/webhooks/discord",[l.Mail]:"/webhooks/mail",[l.HttpProxy]:"/http_proxy",[l.S3]:"/disk/s3"};return this.client.rest.post(t[e.type]||R,JSON.stringify(e))}dashboard(e){return this.client.rest.get(I,e)}}class j{constructor(e){this.client=e}discovery(e){return this.client.rest.get("/discovery",e)}}const W="/divide",q=`${W}/restrictions`;class F{constructor(e){this.client=e}divideDelete(e,t){return this.client.rest.delete(`${e}/${W}/${t}`)}divideDeleteAll(e,t,s,i){return this.client.rest.delete(`${e}/${W}`,Object.assign(Object.assign({},this.makeParam(e,t)),{is_to_user_group:i,access_mode:s}))}divideChange(e,t,s){return this.client.rest.put(`${e}/divide/${t}`,JSON.stringify({access_mode:s}))}divideCreate(e,t,s,i,n){const r=Object.assign(Object.assign({},this.makeParam(e,t)),{[n]:s,access_mode:i});return this.client.rest.post(`${e}/${W}`,JSON.stringify(r))}divideUsers(e,t,s){return this.client.rest.get(`${e}/${W}/users`,Object.assign(Object.assign({},this.makeParam(e,t)),s))}getRestriction(e){return this.client.rest.get(`${q}/${e}`)}restrictionSize(e,t){return this.client.rest.get(`/${t}/restrictions/${e}/size`)}restrictions(e){return this.client.rest.get(`${q}`,e)}restrictionsChange(e,t){return this.client.rest.put(`${q}/${e}`,JSON.stringify(t))}makeParam(e,t){const s={};return e===u.Connection?s.connection_id=t:s.path=t,s}}function H(e,t,s,i){return new(s||(s=Promise))((function(n,r){function o(e){try{a(i.next(e))}catch(e){r(e)}}function c(e){try{a(i.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?n(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,c)}a((i=i.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class B extends Error{}function G(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return function(e){return decodeURIComponent(atob(e).replace(/(.)/g,((e,t)=>{let s=t.charCodeAt(0).toString(16).toUpperCase();return s.length<2&&(s="0"+s),"%"+s})))}(t)}catch(e){return atob(t)}}function M(e,t){if("string"!=typeof e)throw new B("Invalid token specified: must be a string");t||(t={});const s=!0===t.header?0:1,i=e.split(".")[s];if("string"!=typeof i)throw new B(`Invalid token specified: missing part #${s+1}`);let n;try{n=G(i)}catch(e){throw new B(`Invalid token specified: invalid base64 for part #${s+1} (${e.message})`)}try{return JSON.parse(n)}catch(e){throw new B(`Invalid token specified: invalid json for part #${s+1} (${e.message})`)}}B.prototype.name="InvalidTokenError";const V=(e,t)=>H(void 0,void 0,void 0,(function*(){let s=t;for(const t of e)try{s=yield t.fulfilled(s)}catch(e){if(!t.rejected)throw e;s=yield t.rejected(e)}return s}));function z(e){var t;return null!==(t=Object.fromEntries(document.cookie.split(";").map((e=>e.split("="))).map((([e,t])=>[e.trim(),decodeURIComponent(t||"")])))[e])&&void 0!==t?t:null}const X=e=>{const t=new URLSearchParams;return Object.keys(e).forEach((s=>{Array.isArray(e[s])?e[s].forEach((e=>{t.append(s,e)})):t.append(s,e[s])})),t};function Y(e){return e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):e}const K="/api/v1",Q="/api/v2",Z=`${window.location.protocol}//${window.location.host}`;class ee{constructor(e,t){this.client=e,this.tokenUpdate=t}get state(){return this.client.state}get(e,t,s){return this.request(O.GET,e,Object.assign({params:t,cache:"no-cache"},s))}post(e,t,s){return this.request(O.POST,e,Object.assign({body:t},s))}put(e,t,s){return this.request(O.PUT,e,Object.assign({body:t,cache:"no-cache"},s))}patch(e,t,s){return this.request(O.PATCH,e,Object.assign({body:t},s))}delete(e,t,s){return this.request(O.DELETE,e,Object.assign({params:t},s))}upload(e,t,s){const i=new AbortController,n=i.signal;return{promise:this.request(O.POST,e,Object.assign({body:t,signal:n},s)),abort:()=>i.abort()}}request(e,t,s){return H(this,void 0,void 0,(function*(){return new Promise(((i,n)=>H(this,void 0,void 0,(function*(){var r,o;const c=null!==(r=this.state.skipInterceptors)&&void 0!==r&&r;this.state.skipInterceptors=!1;let a=Object.assign({method:e},s);if((null==s?void 0:s.signal)&&(a.signal=s.signal),c||(s=yield V(this.client.requestInterceptors,a)),this.state.authToken)for(const[e,i]of this.state.authToken.entries()){const n=M(i.access_token);if(n&&n.is_remember&&this.tokenUpdate.isTokenExpire(n.exp)&&!t.includes("/login")&&!t.includes("/assets")){const t=yield this.tokenUpdate.refreshToken(i);t&&(this.state.authToken.set(e,t),s=yield V(this.client.requestInterceptors,a))}}const l=new XMLHttpRequest;(null==s?void 0:s.params)&&0!==Object.keys(s.params).length&&(t+="?"+X(s.params));const d=`${this.state.clientParams.host}${this.state.clientParams.version}${t}`;if(l.open(e,d,!0),null==s?void 0:s.headers){const e=Y(s.headers);for(const[t,s]of Object.entries(e))(this.state.clientParams.host===Z||"content-type"!==t.toLowerCase())&&l.setRequestHeader(t,s)}(null==s?void 0:s.responseType)&&(l.responseType=s.responseType),(null==s?void 0:s.signal)&&s.signal.addEventListener("abort",(()=>{l.abort(),n(new Error("Upload aborted"))})),l.upload&&[O.POST,O.PUT,O.PATCH].includes(e)&&(l.upload.onprogress=e=>{e.lengthComputable&&(null==s?void 0:s.onUploadProgress)&&s.onUploadProgress(e)}),l.onload=()=>H(this,void 0,void 0,(function*(){if((null==s?void 0:s.signal)&&s.signal.aborted)return;let e;switch(null==s?void 0:s.responseType){case b.Text:e=l.responseText;break;case b.Blob:case b.ArrayBuffer:e=l.response;break;default:try{e=JSON.parse(l.responseText)}catch(t){e=l.responseText}}const t=new Headers;l.getAllResponseHeaders().split("\r\n").forEach((e=>{const[s,i]=e.split(": ");s&&i&&t.append(s,i)}));let r={status:l.status,statusText:l.statusText,headers:t,url:l.responseURL};l.status>=200&&l.status<300?(null==s?void 0:s.observe)===x.Response?i(Object.assign(Object.assign({},r),{body:e})):i(e):n(Object.assign(Object.assign({},r),{error:e})),r=yield V(this.client.responseInterceptors,r)})),l.onerror=()=>{n({status:l.status,statusText:l.statusText,url:l.responseURL,error:"Network error"})},l.send(null!==(o=null==s?void 0:s.body)&&void 0!==o?o:null)}))))}))}changeBaseUrlVersion(e,t){return H(this,void 0,void 0,(function*(){const s=this.state.clientParams.version;this.state.clientParams.version=e;try{return yield t()}finally{this.state.clientParams.version=s}}))}changeHost(e,t){return H(this,void 0,void 0,(function*(){this.state.clientParams.host=e,this.state.requestParams.headers={};try{return yield t()}finally{this.state.clientParams.host=Z}}))}}class te{constructor(e){this.authApiService=e,this.isUpdating=!1,this.tokenUpdateResolve=null}isTokenExpire(e){if(!e)return!1;return 1e3*e<=(new Date).getTime()+3e3}refreshToken(e){return H(this,void 0,void 0,(function*(){const{access_token:t,refresh_token:s}=e;return t&&s?this.isUpdating?this.waitForTokenUpdate():(this.isUpdating=!0,new Promise(((e,i)=>{const n=new XMLHttpRequest,r=`${Z}${K}/login/update`;n.open("POST",r,!0),n.setRequestHeader("Content-Type","application/json"),n.send(JSON.stringify({access_token:t,refresh_token:s})),n.onload=()=>{if(n.status>=200&&n.status<300)try{const t=JSON.parse(n.responseText);if(t&&t.access_token&&t.refresh_token){const s={access_token:t.access_token,refresh_token:t.refresh_token};z("access_token")===s.access_token&&localStorage.setItem("refresh-token",s.refresh_token),this.tokenUpdateResolve&&(this.tokenUpdateResolve(s),this.tokenUpdateResolve=null),e(s)}else e(null)}catch(e){i(new Error("Failed to parse response JSON."))}else i(new Error(`Request failed with status: ${n.status}`))},n.onerror=()=>{i(new Error("Network error occurred"))},n.onloadend=()=>{this.isUpdating=!1}}))):null}))}waitForTokenUpdate(){return H(this,void 0,void 0,(function*(){return new Promise((e=>{const t=setInterval((()=>{this.isUpdating||(clearInterval(t),e())}),100)}))}))}}class se{constructor(e){this.AuthApiService=new i(this),this.ConnectionsApiService=new L(this),this.DiscoveryApiService=new j(this),this.DivideApiService=new F(this),this.ExtensionsApiService=new re(this),this.ExtensionsExternalApiService=new ce(this),this.FcaApiService=new de(this),this.GatewayApiService=new ue(this),this.GroupApiService=new ge(this),this.LicenseApiService=new $e(this),this.LinksApiService=new ye(this),this.LogstashApiService=new ke(this),this.NotificationApiService=new Ne(this),this.RoleApiService=new Je(this),this.ShareApiService=new Ee(this),this.StorageElementApiService=new qe(this,this.FcaApiService),this.StorageFilesApiService=new Be(this),this.StorageInstanceApiService=new Ge(this),this.StorageShareApiService=new Ve(this),this.StorageTrashApiService=new Ke(this),this.UserApiService=new nt(this),this.VersionApiService=new dt(this),this.tokenUpdate=new te(this.AuthApiService),this.rest=new ee(this,this.tokenUpdate),this.requestInterceptors=[],this.responseInterceptors=[],this.request={use:(e,t)=>{this.requestInterceptors.push({fulfilled:e,rejected:t})}},this.response={use:(e,t)=>{this.responseInterceptors.push({fulfilled:e,rejected:t})}},this.state={clientParams:{host:(null==e?void 0:e.host)||`${window.location.protocol}//${window.location.host}`,version:(null==e?void 0:e.version)||"/api/v1"},requestParams:{path:"",headers:{},query:{},body:null,cache:"no-cache"},authToken:null,skipInterceptors:!1}}}const ie="/static/extensions",ne="/extensions/defaults";class re{constructor(e){this.client=e}getSetting(e){return this.client.rest.get(`${ie}/${e}/settings`)}setSetting(e,t){return this.client.rest.post(`${ie}/${e}/settings`,JSON.stringify(t))}deleteSetting(e){return this.client.rest.delete(`${ie}/${e}/settings`)}get(e){return this.client.rest.get(`${ie}/${e}`)}getByKey(e){return this.client.rest.get(`${ie}/${e}`)}getDefault(e=[]){return this.client.rest.get(ne,{ext_code:e})}setDefault(e,t){return this.client.rest.post(ne,JSON.stringify({ext_code:e,ext_uniq_key:t}))}checkUpdates(){return this.client.rest.post(`${ie}/check_updates`)}updateVersion(e,t){return this.client.rest.put(`${ie}/${e}`,JSON.stringify({version:t}))}list(e){return this.client.rest.get(ie,e)}delete(e,t){return this.client.rest.delete(`${ie}/${e}`)}upload(e,t){const s=new FormData;s.set("file",t);const{promise:i,abort:n}=this.client.rest.upload(ie,s,{onUploadProgress:t=>{e(t)}});return{promise:this.client.rest.changeBaseUrlVersion(Q,(()=>i)),abort:n}}install(e,t){return this.client.rest.changeBaseUrlVersion(Q,(()=>this.client.rest.post(`${ie}/site`,JSON.stringify({uniq_key:e,version:t}))))}}const oe="/anons_ext/extensions";class ce{constructor(e){this.client=e}listExtensionsSite(e){return this.client.rest.changeHost("https://next-box.ru",(()=>this.client.rest.get(oe,e)))}extensionDetailSite(e){return this.client.rest.changeHost("https://next-box.ru",(()=>this.client.rest.get(`${oe}/${e}`)))}extensionMarkdown(e,t){return this.client.rest.changeHost("https://next-box.ru",(()=>this.client.rest.get(`${oe}/${e}/readme`,{},t)))}}const ae="/disk",le=`${ae}/check`;class de{constructor(e){this.client=e}info(e,t){return this.client.rest.get(`${ae}/${e}/element`,{path:t})}list(e,t){return this.client.rest.get(`${ae}/${e}`,t)}create(e,t){return this.client.rest.post(`${ae}/${e}/element`,JSON.stringify(t))}replace(e,t,s){return this.client.rest.put(`${ae}/${e}/files?path=${t}`,s)}read(e,t){return this.client.rest.get(`${ae}/${e}/files?path=${t}`)}upload(e,t,s,i=""){const n=new FormData;n.set("path",i),n.set("file",s);const{promise:r,abort:o}=this.client.rest.upload(`${ae}/${t}/files`,n,{onUploadProgress:t=>{e(t)}});return{promise:r,abort:o}}uploadNet(e,t){return this.client.rest.post(`${ae}/${e}/files/net`,JSON.stringify(t))}delete(e,t){return this.client.rest.delete(`${ae}/${e}/trash/element`,{path:t})}check(e){return this.client.rest.post(le,JSON.stringify(e))}}const he="/settings";class ue{constructor(e){this.client=e}settings(){return this.client.rest.get(he)}changeSettings(e){return this.client.rest.post(he,JSON.stringify(e))}queryInit(){return this.client.rest.get("/query/init")}}const pe="/groups";class ge{constructor(e){this.client=e}list(e){return this.client.rest.get(pe,e)}listUsers(e){return this.client.rest.get(`${pe}/${e}/users`)}create(e){return this.client.rest.post(pe,JSON.stringify(e))}update(e,t){return this.client.rest.put(`${pe}/${e}`,JSON.stringify(t))}delete(e){return this.client.rest.delete(`${pe}/${e}`)}}const fe="/license",_e=`${fe}/manual-check`,ve=`${fe}/hardware/hash`;class $e{constructor(e){this.client=e}info(){return this.client.rest.get(fe)}create(e){return this.client.rest.post(fe,JSON.stringify(e))}check(){return this.client.rest.post(_e)}delete(){return this.client.rest.delete(fe)}getHash(){return this.client.rest.get(ve)}}const Se="/links";class ye{constructor(e){this.client=e}createShortLink(e){return this.client.rest.post(Se,JSON.stringify(e))}updateShortLink(e){return this.client.rest.put(Se,JSON.stringify(e))}}const me="/logs";class ke{constructor(e){this.client=e}getUsersLogs(e){return this.client.rest.get(`${me}/users`,e)}getSystemLogs(e,t,s){return this.client.rest.get(`${me}/${e}`,{},{observe:x.Response,responseType:b.Text,headers:{Range:`bytes=${t}-${s}`}})}}const we="/notifications",be=`${we}/all`,Oe=`${we}/subscription`,xe=`${we}/permission`;class Ne{constructor(e){this.client=e}list(e){return this.client.rest.get(we,e)}toggleStatus(e,t){return this.client.rest.put(we,JSON.stringify({ids:e,to_status:t}))}toggleAllStatus(e){return this.client.rest.put(be,JSON.stringify({to_status:e}))}delete(e){return this.client.rest.delete(we,{id:e})}deleteAll(){return this.client.rest.delete(be)}getPermission(){return this.client.rest.get(xe)}setPermission(e){return this.client.rest.post(xe,JSON.stringify({enabled:e}))}getSubscription(){return this.client.rest.get(Oe)}setSubscription(e){const t={action_groups:Object.assign({},e)};return this.client.rest.post(Oe,JSON.stringify(t))}}const Ae="/roles",Ce=`${Ae}/default`,Te="/permissions";class Je{constructor(e){this.client=e}list(e){return this.client.rest.get(Ae,e)}get(e){return this.client.rest.get(`${Ae}/${e}`)}getDefault(){return this.client.rest.get(`${Ce}`)}create(e){return this.client.rest.post(Ae,JSON.stringify(e))}update(e,t){return this.client.rest.put(`${Ae}/${e}`,JSON.stringify(t))}delete(e){return this.client.rest.delete(`${Ae}/${e}`)}permissionList(){return this.client.rest.get(Te)}addPermission(e,t){return this.client.rest.put(`${Ae}/${e}/permissions`,JSON.stringify({ids:t}))}deletePermission(e,t){return this.client.rest.delete(`${Ae}/${e}/${Te}`,{ids:t})}}const De="/share",Ue=`${De}/restrictions`;class Ee{constructor(e){this.client=e}info(e,t){const s=new URLSearchParams({path:e,share_token:t});return this.client.rest.get(`${De}?${s.toString()}`)}checkPassword(e,t){const s=encodeURIComponent(e);return this.client.rest.get(`${De}/password?share_token=${t}&share_pass=${s}`)}checkToken(e){return this.client.rest.get(`${De}?share_token=${e}`)}getRestriction(e){return this.client.rest.get(`${Ue}/${e}`)}restrictions(e){return this.client.rest.get(Ue,e)}restrictionsChange(e,t){return this.client.rest.put(`${Ue}/${e}`,JSON.stringify(t))}}const Pe="/storage",Re=`${Pe}/element`,Ie=`${Re}/move`,Le=`${Re}/copy`,je=`${Re}/content_type_size`,We="/disk";class qe{constructor(e,t){this.client=e,this.fcaApiService=t}list(e){return this.client.rest.get(Pe,e)}info(e){var t;return parseInt((null===(t=e.divide_id)||void 0===t?void 0:t.toString())||"")||delete e.divide_id,e.file_version_id||delete e.file_version_id,this.client.rest.get(Re,e)}combineInfo({root:e,rootId:t,path:s,file_version_id:i}){return e===E.fca&&t?this.fcaApiService.info(t,s):this.info({path:s,divide_id:t,file_version_id:i})}size(e){return this.client.rest.post(`${Re}/size`,JSON.stringify(e))}move(e,t,s){const{from_divide_id:i,to_divide_id:n}=e;let r=Object.assign(Object.assign({},e),{from_divide_id:null,to_divide_id:null});return t===E.fca&&s===E.fca?this.client.rest.post(`${We}/${i}/files/move${We}/${n}`,JSON.stringify(r)):t===E.fca?(i&&(r.from_divide_id=i),this.client.rest.put(`${We}/${n}/files/from/box`,JSON.stringify(r))):s===E.fca?(n&&(r.to_divide_id=n),this.client.rest.put(`${We}/${i}/files/to/box`,JSON.stringify(r))):this.client.rest.post(Ie,JSON.stringify(e))}copy(e,t,s){const{from_divide_id:i,to_divide_id:n}=e;let r=Object.assign(Object.assign({},e),{from_divide_id:null,to_divide_id:null});return s===E.fca&&t===E.fca?this.client.rest.post(`${We}/${i}/files/copy${We}/${n}`,JSON.stringify(r)):s===E.fca?(i&&(r.from_divide_id=i),this.client.rest.post(`${We}/${n}/files/from/box`,JSON.stringify(r))):t===E.fca?(n&&(r.to_divide_id=n),this.client.rest.post(`${We}/${i}/files/to/box`,JSON.stringify(r))):this.client.rest.post(Le,JSON.stringify(e))}pasteFromShared(e,t,s){const i={from_sharing_token:e,from_sharing_password:s,paths:t};return this.client.rest.post(`${Re}/copy`,JSON.stringify(i))}create(e){return this.client.rest.post(Re,JSON.stringify(e))}delete(e,t){const s={path:e};return t&&(s.divide_id=t),this.client.rest.delete(Re,s)}favorite(e){return this.client.rest.put(`${Re}?path=${encodeURIComponent(e)}`,JSON.stringify({is_favorite:!0}))}removeFavorite(e){return this.client.rest.put(`${Re}?path=${encodeURIComponent(e)}`,JSON.stringify({is_favorite:!1}))}createItem(e){return this.client.rest.post(Re,JSON.stringify(e))}createWorkDir(e){return this.client.rest.post(Re,JSON.stringify(e))}sizeWithSection(e){return this.client.rest.get(je,e)}}const Fe="/storage/files",He=`${Fe}/net`;class Be{constructor(e){this.client=e}read(e,t){return t.path=e,this.client.rest.get(Fe,t)}replace(e,t){const s=new URLSearchParams;return Object.keys(e).forEach((t=>{e[t]&&s.append(t,e[t])})),this.client.rest.put(`${Fe}?${s.toString()}`,t)}upload(e,t,s,i){const n=new FormData;n.set("path",s),i&&n.set("divide_id",i.toString()),n.set("file",t);const{promise:r,abort:o}=this.client.rest.upload(Fe,n,{onUploadProgress:t=>{e(t)}});return{promise:r,abort:o}}uploadNet(e){return this.client.rest.post(He,JSON.stringify(e))}}class Ge{constructor(e){this.client=e}instance(){return this.client.rest.get("/storage/instance")}}const Me="/storage/element/share";class Ve{constructor(e){this.client=e}info(e){return this.client.rest.get(Me,{path:e})}create(e,t){const s={path:e,permissions_type:t};return this.client.rest.post(Me,JSON.stringify(s))}change(e){return this.client.rest.put(`${Me}/${e.token}`,JSON.stringify(e))}delete(e){return this.client.rest.delete(Me,{path:e})}refresh(e){return this.client.rest.put(`${Me}/${e}/refresh`)}}const ze="/storage/trash",Xe=`${ze}/element`,Ye=`${Xe}/all`;class Ke{constructor(e){this.client=e}list(e){return this.client.rest.get(ze,e)}clear(e){return this.client.rest.delete(Xe,e)}clearAll(){return this.client.rest.delete(Ye)}restore(e){return this.client.rest.patch(Xe,JSON.stringify({del_groups:e}))}}const Qe="/users",Ze=`${Qe}/me`,et=`${Ze}/avatars`,tt=`${Ze}/sessions`,st=`${Ze}/tokens`,it=`${Ze}/change-password`;class nt{constructor(e){this.client=e}list(e){return this.client.rest.get(Qe,e)}get(e){return this.client.rest.get(Qe+`/${e}`)}create(e){return this.client.rest.post(Qe,JSON.stringify(e))}update(e,t){return this.client.rest.put(Qe+`/${e}`,JSON.stringify(t))}delete(e,t){return this.client.rest.delete(`${Qe}/${e}`,t)}restore(e){return this.client.rest.post(`${Qe}/${e}/restore`)}me(){return this.client.rest.get(Ze)}updateMe(e){return this.client.rest.put(Ze,JSON.stringify(e))}createToken(e){return this.client.rest.post(st,JSON.stringify(e))}listToken(e){return this.client.rest.get(st,e)}deleteToken(e){return this.client.rest.delete(`${st}/${e}`)}changeMyPassword(e){return this.client.rest.put(it,JSON.stringify(e))}changeUsersPassword(e,t){return this.client.rest.put(`${Qe}/${e}/change-password`,JSON.stringify(t))}meUploadAvatar(e,t){const s=new FormData;return s.append("file",e,t),this.client.rest.post(et,s)}meDeleteAvatar(){return this.client.rest.delete(et)}meListSession(e){return this.client.rest.get(tt,e)}meDeleteSession(e){let t=tt;return e&&(t+=`/${e}`),this.client.rest.delete(t)}setRole(e,t=null){return this.client.rest.put(`${Qe}/${e}/roles`,JSON.stringify({role_id:t}))}}const rt="/storage/element",ot=`${rt}/history`,ct=`${rt}/version`,at=`${ct}/current`,lt=`${ct}/size`;class dt{constructor(e){this.client=e}history(e){return this.client.rest.get(ot,e)}versions(e){return this.client.rest.get(ct,e)}create(e){return this.client.rest.post(ct,JSON.stringify(e))}edit(e){return this.client.rest.put(ct,JSON.stringify(e))}delete(e){return this.client.rest.delete(ct,e)}size(e){return this.client.rest.get(lt,e)}makeCurrent(e){return this.client.rest.post(at,JSON.stringify(e))}}export{n as AccessRights,i as AuthApiService,K as BASE_URL_V1,Q as BASE_URL_V2,r as CONNECTIONS_PERMISSION,se as Client,a as ConnectionGroup,l as ConnectionType,L as ConnectionsApiService,j as DiscoveryApiService,F as DivideApiService,_ as DivideMode,u as DivideScope,c as EngineType,h as ExtensionFileMode,d as ExtensionType,re as ExtensionsApiService,ce as ExtensionsExternalApiService,de as FcaApiService,ue as GatewayApiService,ge as GroupApiService,Z as HOST,$e as LicenseApiService,S as LicenseError,ye as LinksApiService,ke as LogstashApiService,m as NotificationAction,Ne as NotificationApiService,y as NotificationEntityType,k as NotificationRowAction,w as NotificationStyle,o as OrderDirection,p as PermissionType,O as RequestMethod,x as RequestObserve,b as ResponseType,ee as Rest,f as RestrictionBooleanStatus,v as RestrictionModeKey,N as RestrictionSharing,g as RestrictionStatus,Je as RoleApiService,J as SettingControlType,Ee as ShareApiService,qe as StorageElementApiService,U as StorageElementContentType,P as StorageElementHistoryAction,D as StorageElementType,Be as StorageFilesApiService,Ge as StorageInstanceApiService,E as StorageRoot,Ve as StorageShareApiService,Ke as StorageTrashApiService,$ as Tariff,te as TokenUpdate,nt as UserApiService,A as UserAuthType,C as UserStatus,T as UserType,dt as VersionApiService,V as applyInterceptors,z as getCookieValue,X as makeUrlParams,Y as normalizeHeaders};
1
+ const e="/login",t=`${e}/ldap`,s=`${e}/update`;class i{constructor(e){this.client=e}info(){return this.client.rest.get(e)}login(t){return this.client.rest.post(e,JSON.stringify(t))}ldapLogin(e){return this.client.rest.post(t,JSON.stringify(e))}updateToken(e){const t=e.path?`${e.path}/${s}`:s;return e.path&&delete e.path,this.client.rest.post(t,JSON.stringify(e))}logout(){return this.client.rest.post("/logout")}}var n;!function(e){e.LicenseRead="license_read",e.LicenseManage="license_edit",e.UsersRead="users_read",e.UsersCreate="users_create",e.UsersActivate="users_activate",e.GroupsRead="groups_read",e.GroupsCreate="groups_create",e.RolesRead="roles_read",e.RolesCreate="roles_create",e.Share="share",e.Divide="divide",e.ExtensionsRead="extensions_read",e.ExtensionsManage="extensions_write",e.RestrictionShareRead="restriction_share_read",e.RestrictionShareWrite="restriction_share_write",e.RestrictionDivideRead="restriction_divide_read",e.RestrictionDivideWrite="restriction_divide_write",e.ReadUserLogs="read_user_logs",e.ReadSystemLogs="read_system_logs",e.ConnectionsRead="connections_read",e.ConnectionsDividing="connections_dividing",e.ConnectionsYandexDisk="connections_yandex_disk",e.ConnectionsSsh="connections_ssh",e.ConnectionsMail="connections_mail",e.ConnectionsS3="connections_s3",e.ConnectionsDiscord="connections_discord",e.ConnectionsWebdav="connections_webdav",e.ConnectionsNextcloud="connections_nextcloud",e.ConnectionsNextbox="connections_nextbox",e.ConnectionsHttpProxy="connections_http_proxy",e.SystemInfoServiceList="system_info_service_list",e.SettingsRead="settings_read",e.SettingsWrite="settings_write"}(n||(n={}));const r=[n.ConnectionsYandexDisk,n.ConnectionsSsh,n.ConnectionsMail,n.ConnectionsS3,n.ConnectionsS3,n.ConnectionsDiscord,n.ConnectionsWebdav,n.ConnectionsNextcloud,n.ConnectionsNextbox,n.ConnectionsHttpProxy];var o,c,a,l,d,h,u,p,g,f,_,v,$,S,y,k,m,w,b,O,x,N,A,C,T,J,D,U,P,E,R;!function(e){e.DEFAULT="",e.ASC="asc",e.DESC="desc"}(o||(o={})),function(e){e.WebSocket="websocket",e.PostMessage="postmessage",e.Empty=""}(c||(c={})),function(e){e.Storages="storages_connections_group",e.Webhooks="webhooks_connections_group",e.Unknown="unknown_connections_group",e.Proxy="proxy_connections_group"}(a||(a={})),function(e){e.SSH="ssh_connection",e.YandexDisk="yandex_disk",e.Mail="mail",e.Discord="discord",e.Webdav="webdav_connection",e.Nextcloud="nextcloud_connection",e.NextBox="nextbox_connection",e.HttpProxy="http_proxy_connection",e.S3="s3_connection"}(l||(l={})),function(e){e.App="app",e.File="file",e.WorkDir="work_dir"}(d||(d={})),function(e){e.Read="read",e.ReadAndWrite="read_and_write",e.Write="write"}(h||(h={})),function(e){e.Storage="/storage/element",e.Connection="/connections"}(u||(u={})),function(e){e.CLOSE="",e.READ="r",e.WRITE="rw"}(p||(p={})),function(e){e.WAITING="waiting",e.APPROVED="approved",e.REJECTED="rejected"}(g||(g={})),function(e){e.TRUE="true",e.FALSE="false"}(f||(f={})),function(e){e.User="to_user_id",e.Group="to_user_group_id"}(_||(_={})),function(e){e.Divide="divide",e.Share="share"}(v||(v={})),function(e){e.Free="free",e.Business="business",e.Enterprise="enterprise"}($||($={})),function(e){e.NotActivated="License not activated",e.Blocked="License blocked",e.Expired="License has been expired",e.NotValid="License not valid",e.NotFound="license file not found"}(S||(S={})),function(e){e.Dir="dir",e.File="file",e.User="user",e.Other="other",e.WorkDir="work_dir",e.License="license",e.Extension="extension",e.Connection="connection"}(y||(y={})),function(e){e.OpenSharing="open_sharing",e.ChangeSharing="change_sharing",e.CancelSharing="cancel_sharing",e.DivideDirAddFileToOwner="divide_dir_add_file_to_owner",e.DivideDirAddDirToOwner="divide_dir_add_dir_to_owner",e.DivideDirAddWorkDirToOwner="divide_dir_add_work_dir_to_owner",e.DivideConnectionAddFileToOwner="divide_connection_add_file_to_owner",e.DivideConnectionAddDirToOwner="divide_connection_add_dir_to_owner",e.CancelDivideDir="cancel_divide_dir",e.CancelDivideFile="cancel_divide_file",e.CancelDivideWorkDir="cancel_divide_work_dir",e.CancelDivideConnection="cancel_divide_connection",e.DeleteExtension="delete_extension",e.NewVersionExtension="new_version_extension",e.TransferData="transfer_data",e.AllowInternalAccessUser="allow_internal_access_to_user",e.BlockInternalAccessUser="block_internal_access_to_user",e.WaitInternalAccessUser="wait_internal_access_to_user",e.WaitInternalAccessUserCreate="wait_internal_access_to_user_create",e.AllowInternalAccessGroup="allow_internal_access_to_group",e.BlockInternalAccessGroup="block_internal_access_to_group",e.WaitInternalAccessGroup="wait_internal_access_to_group",e.WaitInternalAccessGroupCreate="wait_internal_access_to_group_create",e.AllowSharing="allow_sharing",e.BlockSharing="block_sharing",e.WaitSharing="wait_sharing",e.WaitSharingCreate="wait_sharing_create",e.Other="other"}(k||(k={})),function(e){e.Read="read",e.Unread="unread",e.Delete="delete"}(m||(m={})),function(e){e.Plain="plain",e.Success="success",e.Info="info",e.Warning="warning",e.Error="error"}(w||(w={})),function(e){e.ArrayBuffer="arraybuffer",e.Blob="blob",e.Json="json",e.Text="text"}(b||(b={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.PATCH="PATCH",e.DELETE="DELETE"}(O||(O={})),function(e){e.Body="body",e.Response="response"}(x||(x={})),function(e){e.NONE="none",e.SOFT="soft",e.HARD="hard"}(N||(N={})),function(e){e.Native="native",e.Ldap="ldap",e.Vk="vk"}(A||(A={})),function(e){e.Registering="registering",e.Activated="activated",e.Blocked="blocked",e.BlockedByLicense="blocked_by_license"}(C||(C={})),function(e){e.User="user",e.Guest="guest",e.Emperor="emperor",e.Anonymous="anonymous"}(T||(T={})),function(e){e.Text="text",e.String="string",e.Number="number",e.CheckBox="checkbox",e.Select="select",e.RadioList="radio_list",e.ConnectionChoose="connection_choose",e.MultiConnectionChoose="multi_connection_choose"}(J||(J={})),function(e){e.Dir="dir",e.File="file",e.WorkDir="work_dir"}(D||(D={})),function(e){e.Any="any",e.Dir="dir",e.Code="code",e.Image="image",e.Audio="audio",e.Video="video",e.Text="text",e.Doc="doc",e.Xls="xls",e.Ppt="ppt"}(U||(U={})),function(e){e.my="my",e.fca="fca",e.divide="divide",e.share="share",e.favorite="favorite"}(P||(P={})),function(e){e.Create="create",e.Update="update",e.Move="move"}(E||(E={})),function(e){e[e.CheckNull=0]="CheckNull",e[e.CheckInProgress=1]="CheckInProgress",e[e.CheckPositive=2]="CheckPositive",e[e.CheckNegative=3]="CheckNegative"}(R||(R={}));const I="/connections",L=`${I}/dashboard`;class j{constructor(e){this.client=e}list(e){return this.client.rest.get(I,e)}get(e){return this.client.rest.get(`${I}/${e}`)}update(e,t){return this.client.rest.put(`${I}/${e}`,JSON.stringify(t))}delete(e){return this.client.rest.delete(`${I}/${e}`)}create(e){const t={[l.SSH]:"/disk/ssh",[l.Webdav]:"/disk/webdav",[l.Nextcloud]:"/disk/nextcloud",[l.NextBox]:"/disk/nextbox",[l.Discord]:"/webhooks/discord",[l.Mail]:"/webhooks/mail",[l.HttpProxy]:"/http_proxy",[l.S3]:"/disk/s3"};return this.client.rest.post(t[e.type]||I,JSON.stringify(e))}dashboard(e){return this.client.rest.get(L,e)}}class W{constructor(e){this.client=e}discovery(e){return this.client.rest.get("/discovery",e)}}const q="/divide",F=`${q}/restrictions`;class H{constructor(e){this.client=e}divideDelete(e,t){return this.client.rest.delete(`${e}/${q}/${t}`)}divideDeleteAll(e,t,s,i){return this.client.rest.delete(`${e}/${q}`,Object.assign(Object.assign({},this.makeParam(e,t)),{is_to_user_group:i,access_mode:s}))}divideChange(e,t,s){return this.client.rest.put(`${e}/divide/${t}`,JSON.stringify({access_mode:s}))}divideCreate(e,t,s,i,n){const r=Object.assign(Object.assign({},this.makeParam(e,t)),{[n]:s,access_mode:i});return this.client.rest.post(`${e}/${q}`,JSON.stringify(r))}divideUsers(e,t,s){return this.client.rest.get(`${e}/${q}/users`,Object.assign(Object.assign({},this.makeParam(e,t)),s))}getRestriction(e){return this.client.rest.get(`${F}/${e}`)}restrictionSize(e,t){return this.client.rest.get(`/${t}/restrictions/${e}/size`)}restrictions(e){return this.client.rest.get(`${F}`,e)}restrictionsChange(e,t){return this.client.rest.put(`${F}/${e}`,JSON.stringify(t))}makeParam(e,t){const s={};return e===u.Connection?s.connection_id=t:s.path=t,s}}function B(e,t,s,i){return new(s||(s=Promise))((function(n,r){function o(e){try{a(i.next(e))}catch(e){r(e)}}function c(e){try{a(i.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?n(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,c)}a((i=i.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class G extends Error{}function M(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return function(e){return decodeURIComponent(atob(e).replace(/(.)/g,((e,t)=>{let s=t.charCodeAt(0).toString(16).toUpperCase();return s.length<2&&(s="0"+s),"%"+s})))}(t)}catch(e){return atob(t)}}function V(e,t){if("string"!=typeof e)throw new G("Invalid token specified: must be a string");t||(t={});const s=!0===t.header?0:1,i=e.split(".")[s];if("string"!=typeof i)throw new G(`Invalid token specified: missing part #${s+1}`);let n;try{n=M(i)}catch(e){throw new G(`Invalid token specified: invalid base64 for part #${s+1} (${e.message})`)}try{return JSON.parse(n)}catch(e){throw new G(`Invalid token specified: invalid json for part #${s+1} (${e.message})`)}}G.prototype.name="InvalidTokenError";const z=(e,t)=>B(void 0,void 0,void 0,(function*(){let s=t;for(const t of e)try{s=yield t.fulfilled(s)}catch(e){if(!t.rejected)throw e;s=yield t.rejected(e)}return s}));function X(e){var t;return null!==(t=Object.fromEntries(document.cookie.split(";").map((e=>e.split("="))).map((([e,t])=>[e.trim(),decodeURIComponent(t||"")])))[e])&&void 0!==t?t:null}const Y=e=>{const t=new URLSearchParams;return Object.keys(e).forEach((s=>{Array.isArray(e[s])?e[s].forEach((e=>{t.append(s,e)})):t.append(s,e[s])})),t};function K(e){return e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):e}const Q="/api/v1",Z="/api/v2",ee=`${window.location.protocol}//${window.location.host}`;class te{constructor(e,t){this.client=e,this.tokenUpdate=t}get state(){return this.client.state}get(e,t,s){return this.request(O.GET,e,Object.assign({params:t,cache:"no-cache"},s))}post(e,t,s){return this.request(O.POST,e,Object.assign({body:t},s))}put(e,t,s){return this.request(O.PUT,e,Object.assign({body:t,cache:"no-cache"},s))}patch(e,t,s){return this.request(O.PATCH,e,Object.assign({body:t},s))}delete(e,t,s){return this.request(O.DELETE,e,Object.assign({params:t},s))}upload(e,t,s){const i=new AbortController,n=i.signal;return{promise:this.request(O.POST,e,Object.assign({body:t,signal:n},s)),abort:()=>i.abort()}}request(e,t,s){return B(this,void 0,void 0,(function*(){return new Promise(((i,n)=>B(this,void 0,void 0,(function*(){var r,o;const c=null!==(r=this.state.skipInterceptors)&&void 0!==r&&r;this.state.skipInterceptors=!1;let a=Object.assign({method:e},s);if((null==s?void 0:s.signal)&&(a.signal=s.signal),c||(s=yield z(this.client.requestInterceptors,a)),this.state.authToken)for(const[e,i]of this.state.authToken.entries()){const n=V(i.access_token);if(n&&n.is_remember&&this.tokenUpdate.isTokenExpire(n.exp)&&!t.includes("/login")&&!t.includes("/assets")){const t=yield this.tokenUpdate.refreshToken(i);t&&(this.state.authToken.set(e,t),s=yield z(this.client.requestInterceptors,a))}}const l=new XMLHttpRequest;(null==s?void 0:s.params)&&0!==Object.keys(s.params).length&&(t+="?"+Y(s.params));const d=`${this.state.clientParams.host}${this.state.clientParams.version}${t}`;if(l.open(e,d,!0),null==s?void 0:s.headers){const e=K(s.headers);for(const[t,s]of Object.entries(e))(this.state.clientParams.host===ee||"content-type"!==t.toLowerCase())&&l.setRequestHeader(t,s)}(null==s?void 0:s.responseType)&&(l.responseType=s.responseType),(null==s?void 0:s.signal)&&s.signal.addEventListener("abort",(()=>{l.abort(),n(new Error("Upload aborted"))})),l.upload&&[O.POST,O.PUT,O.PATCH].includes(e)&&(l.upload.onprogress=e=>{e.lengthComputable&&(null==s?void 0:s.onUploadProgress)&&s.onUploadProgress(e)}),l.onload=()=>B(this,void 0,void 0,(function*(){if((null==s?void 0:s.signal)&&s.signal.aborted)return;let e;switch(null==s?void 0:s.responseType){case b.Text:e=l.responseText;break;case b.Blob:case b.ArrayBuffer:e=l.response;break;default:try{e=JSON.parse(l.responseText)}catch(t){e=l.responseText}}const t=new Headers;l.getAllResponseHeaders().split("\r\n").forEach((e=>{const[s,i]=e.split(": ");s&&i&&t.append(s,i)}));let r={status:l.status,statusText:l.statusText,headers:t,url:l.responseURL};l.status>=200&&l.status<300?(null==s?void 0:s.observe)===x.Response?i(Object.assign(Object.assign({},r),{body:e})):i(e):n(Object.assign(Object.assign({},r),{error:e})),r=yield z(this.client.responseInterceptors,r)})),l.onerror=()=>{n({status:l.status,statusText:l.statusText,url:l.responseURL,error:"Network error"})},l.send(null!==(o=null==s?void 0:s.body)&&void 0!==o?o:null)}))))}))}changeBaseUrlVersion(e,t){return B(this,void 0,void 0,(function*(){const s=this.state.clientParams.version;this.state.clientParams.version=e;try{return yield t()}finally{this.state.clientParams.version=s}}))}changeHost(e,t){return B(this,void 0,void 0,(function*(){this.state.clientParams.host=e,this.state.requestParams.headers={};try{return yield t()}finally{this.state.clientParams.host=ee}}))}}class se{constructor(e){this.authApiService=e,this.isUpdating=!1,this.tokenUpdateResolve=null}isTokenExpire(e){if(!e)return!1;return 1e3*e<=(new Date).getTime()+3e3}refreshToken(e){return B(this,void 0,void 0,(function*(){const{access_token:t,refresh_token:s}=e;return t&&s?this.isUpdating?this.waitForTokenUpdate():(this.isUpdating=!0,new Promise(((e,i)=>{const n=new XMLHttpRequest,r=`${ee}${Q}/login/update`;n.open("POST",r,!0),n.setRequestHeader("Content-Type","application/json"),n.send(JSON.stringify({access_token:t,refresh_token:s})),n.onload=()=>{if(n.status>=200&&n.status<300)try{const t=JSON.parse(n.responseText);if(t&&t.access_token&&t.refresh_token){const s={access_token:t.access_token,refresh_token:t.refresh_token};X("access_token")===s.access_token&&localStorage.setItem("refresh-token",s.refresh_token),this.tokenUpdateResolve&&(this.tokenUpdateResolve(s),this.tokenUpdateResolve=null),e(s)}else e(null)}catch(e){i(new Error("Failed to parse response JSON."))}else i(new Error(`Request failed with status: ${n.status}`))},n.onerror=()=>{i(new Error("Network error occurred"))},n.onloadend=()=>{this.isUpdating=!1}}))):null}))}waitForTokenUpdate(){return B(this,void 0,void 0,(function*(){return new Promise((e=>{const t=setInterval((()=>{this.isUpdating||(clearInterval(t),e())}),100)}))}))}}class ie{constructor(e){this.AuthApiService=new i(this),this.ConnectionsApiService=new j(this),this.DiscoveryApiService=new W(this),this.DivideApiService=new H(this),this.ExtensionsApiService=new oe(this),this.ExtensionsExternalApiService=new ae(this),this.FcaApiService=new he(this),this.GatewayApiService=new pe(this),this.GroupApiService=new fe(this),this.LicenseApiService=new Se(this),this.LinksApiService=new ke(this),this.LogstashApiService=new we(this),this.NotificationApiService=new Ae(this),this.RoleApiService=new De(this),this.ShareApiService=new Ee(this),this.StorageElementApiService=new Fe(this,this.FcaApiService),this.StorageFilesApiService=new Ge(this),this.StorageInstanceApiService=new Me(this),this.StorageShareApiService=new ze(this),this.StorageTrashApiService=new Qe(this),this.UserApiService=new rt(this),this.VersionApiService=new ht(this),this.tokenUpdate=new se(this.AuthApiService),this.rest=new te(this,this.tokenUpdate),this.requestInterceptors=[],this.responseInterceptors=[],this.request={use:(e,t)=>{this.requestInterceptors.push({fulfilled:e,rejected:t})}},this.response={use:(e,t)=>{this.responseInterceptors.push({fulfilled:e,rejected:t})}},this.state={clientParams:{host:(null==e?void 0:e.host)||`${window.location.protocol}//${window.location.host}`,version:(null==e?void 0:e.version)||"/api/v1"},requestParams:{path:"",headers:{},query:{},body:null,cache:"no-cache"},authToken:null,skipInterceptors:!1}}}const ne="/static/extensions",re="/extensions/defaults";class oe{constructor(e){this.client=e}getSetting(e){return this.client.rest.get(`${ne}/${e}/settings`)}setSetting(e,t){return this.client.rest.post(`${ne}/${e}/settings`,JSON.stringify(t))}deleteSetting(e){return this.client.rest.delete(`${ne}/${e}/settings`)}get(e){return this.client.rest.get(`${ne}/${e}`)}getByKey(e){return this.client.rest.get(`${ne}/${e}`)}getDefault(e=[]){return this.client.rest.get(re,{ext_code:e})}setDefault(e,t){return this.client.rest.post(re,JSON.stringify({ext_code:e,ext_uniq_key:t}))}checkUpdates(){return this.client.rest.post(`${ne}/check_updates`)}updateVersion(e,t){return this.client.rest.put(`${ne}/${e}`,JSON.stringify({version:t}))}list(e){return this.client.rest.get(ne,e)}delete(e,t){return this.client.rest.delete(`${ne}/${e}`)}upload(e,t){const s=new FormData;s.set("file",t);const{promise:i,abort:n}=this.client.rest.upload(ne,s,{onUploadProgress:t=>{e(t)}});return{promise:this.client.rest.changeBaseUrlVersion(Z,(()=>i)),abort:n}}install(e,t){return this.client.rest.changeBaseUrlVersion(Z,(()=>this.client.rest.post(`${ne}/site`,JSON.stringify({uniq_key:e,version:t}))))}}const ce="/anons_ext/extensions";class ae{constructor(e){this.client=e}listExtensionsSite(e){return this.client.rest.changeHost("https://next-box.ru",(()=>this.client.rest.get(ce,e)))}extensionDetailSite(e){return this.client.rest.changeHost("https://next-box.ru",(()=>this.client.rest.get(`${ce}/${e}`)))}extensionMarkdown(e,t){return this.client.rest.changeHost("https://next-box.ru",(()=>this.client.rest.get(`${ce}/${e}/readme`,{},t)))}}const le="/disk",de=`${le}/check`;class he{constructor(e){this.client=e}info(e,t){return this.client.rest.get(`${le}/${e}/element`,{path:t})}list(e,t){return this.client.rest.get(`${le}/${e}`,t)}create(e,t){return this.client.rest.post(`${le}/${e}/element`,JSON.stringify(t))}replace(e,t,s){return this.client.rest.put(`${le}/${e}/files?path=${t}`,s)}read(e,t){return this.client.rest.get(`${le}/${e}/files?path=${t}`)}upload(e,t,s,i=""){const n=new FormData;n.set("path",i),n.set("file",s);const{promise:r,abort:o}=this.client.rest.upload(`${le}/${t}/files`,n,{onUploadProgress:t=>{e(t)}});return{promise:r,abort:o}}uploadNet(e,t){return this.client.rest.post(`${le}/${e}/files/net`,JSON.stringify(t))}delete(e,t){return this.client.rest.delete(`${le}/${e}/trash/element`,{path:t})}check(e){return this.client.rest.post(de,JSON.stringify(e))}}const ue="/settings";class pe{constructor(e){this.client=e}settings(){return this.client.rest.get(ue)}changeSettings(e){return this.client.rest.post(ue,JSON.stringify(e))}queryInit(){return this.client.rest.get("/query/init")}}const ge="/groups";class fe{constructor(e){this.client=e}list(e){return this.client.rest.get(ge,e)}listUsers(e){return this.client.rest.get(`${ge}/${e}/users`)}create(e){return this.client.rest.post(ge,JSON.stringify(e))}update(e,t){return this.client.rest.put(`${ge}/${e}`,JSON.stringify(t))}delete(e){return this.client.rest.delete(`${ge}/${e}`)}}const _e="/license",ve=`${_e}/manual-check`,$e=`${_e}/hardware/hash`;class Se{constructor(e){this.client=e}info(){return this.client.rest.get(_e)}create(e){return this.client.rest.post(_e,JSON.stringify(e))}check(){return this.client.rest.post(ve)}delete(){return this.client.rest.delete(_e)}getHash(){return this.client.rest.get($e)}}const ye="/links";class ke{constructor(e){this.client=e}createShortLink(e){return this.client.rest.post(ye,JSON.stringify(e))}updateShortLink(e){return this.client.rest.put(ye,JSON.stringify(e))}}const me="/logs";class we{constructor(e){this.client=e}getUsersLogs(e){return this.client.rest.get(`${me}/users`,e)}getSystemLogs(e,t,s){return this.client.rest.get(`${me}/${e}`,{},{observe:x.Response,responseType:b.Text,headers:{Range:`bytes=${t}-${s}`}})}}const be="/notifications",Oe=`${be}/all`,xe=`${be}/subscription`,Ne=`${be}/permission`;class Ae{constructor(e){this.client=e}list(e){return this.client.rest.get(be,e)}toggleStatus(e,t){return this.client.rest.put(be,JSON.stringify({ids:e,to_status:t}))}toggleAllStatus(e){return this.client.rest.put(Oe,JSON.stringify({to_status:e}))}delete(e){return this.client.rest.delete(be,{id:e})}deleteAll(){return this.client.rest.delete(Oe)}getPermission(){return this.client.rest.get(Ne)}setPermission(e){return this.client.rest.post(Ne,JSON.stringify({enabled:e}))}getSubscription(){return this.client.rest.get(xe)}setSubscription(e){const t={action_groups:Object.assign({},e)};return this.client.rest.post(xe,JSON.stringify(t))}}const Ce="/roles",Te=`${Ce}/default`,Je="/permissions";class De{constructor(e){this.client=e}list(e){return this.client.rest.get(Ce,e)}get(e){return this.client.rest.get(`${Ce}/${e}`)}getDefault(){return this.client.rest.get(`${Te}`)}create(e){return this.client.rest.post(Ce,JSON.stringify(e))}update(e,t){return this.client.rest.put(`${Ce}/${e}`,JSON.stringify(t))}delete(e){return this.client.rest.delete(`${Ce}/${e}`)}permissionList(){return this.client.rest.get(Je)}addPermission(e,t){return this.client.rest.put(`${Ce}/${e}/permissions`,JSON.stringify({ids:t}))}deletePermission(e,t){return this.client.rest.delete(`${Ce}/${e}/${Je}`,{ids:t})}}const Ue="/share",Pe=`${Ue}/restrictions`;class Ee{constructor(e){this.client=e}info(e,t){const s=new URLSearchParams({path:e,share_token:t});return this.client.rest.get(`${Ue}?${s.toString()}`)}checkPassword(e,t){const s=encodeURIComponent(e);return this.client.rest.get(`${Ue}/password?share_token=${t}&share_pass=${s}`)}checkToken(e){return this.client.rest.get(`${Ue}?share_token=${e}`)}getRestriction(e){return this.client.rest.get(`${Pe}/${e}`)}restrictions(e){return this.client.rest.get(Pe,e)}restrictionsChange(e,t){return this.client.rest.put(`${Pe}/${e}`,JSON.stringify(t))}}const Re="/storage",Ie=`${Re}/element`,Le=`${Ie}/move`,je=`${Ie}/copy`,We=`${Ie}/content_type_size`,qe="/disk";class Fe{constructor(e,t){this.client=e,this.fcaApiService=t}list(e){return this.client.rest.get(Re,e)}info(e){var t;return parseInt((null===(t=e.divide_id)||void 0===t?void 0:t.toString())||"")||delete e.divide_id,e.file_version_id||delete e.file_version_id,this.client.rest.get(Ie,e)}combineInfo({root:e,rootId:t,path:s,file_version_id:i}){return e===P.fca&&t?this.fcaApiService.info(t,s):this.info({path:s,divide_id:t,file_version_id:i})}size(e){return this.client.rest.post(`${Ie}/size`,JSON.stringify(e))}move(e,t,s){const{from_divide_id:i,to_divide_id:n}=e;let r=Object.assign(Object.assign({},e),{from_divide_id:null,to_divide_id:null});return t===P.fca&&s===P.fca?this.client.rest.post(`${qe}/${i}/files/move${qe}/${n}`,JSON.stringify(r)):t===P.fca?(i&&(r.from_divide_id=i),this.client.rest.put(`${qe}/${n}/files/from/box`,JSON.stringify(r))):s===P.fca?(n&&(r.to_divide_id=n),this.client.rest.put(`${qe}/${i}/files/to/box`,JSON.stringify(r))):this.client.rest.post(Le,JSON.stringify(e))}copy(e,t,s){const{from_divide_id:i,to_divide_id:n}=e;let r=Object.assign(Object.assign({},e),{from_divide_id:null,to_divide_id:null});return s===P.fca&&t===P.fca?this.client.rest.post(`${qe}/${i}/files/copy${qe}/${n}`,JSON.stringify(r)):s===P.fca?(i&&(r.from_divide_id=i),this.client.rest.post(`${qe}/${n}/files/from/box`,JSON.stringify(r))):t===P.fca?(n&&(r.to_divide_id=n),this.client.rest.post(`${qe}/${i}/files/to/box`,JSON.stringify(r))):this.client.rest.post(je,JSON.stringify(e))}pasteFromShared(e,t,s){const i={from_sharing_token:e,from_sharing_password:s,paths:t};return this.client.rest.post(`${Ie}/copy`,JSON.stringify(i))}create(e){return this.client.rest.post(Ie,JSON.stringify(e))}delete(e,t){const s={path:e};return t&&(s.divide_id=t),this.client.rest.delete(Ie,s)}favorite(e){return this.client.rest.put(`${Ie}?path=${encodeURIComponent(e)}`,JSON.stringify({is_favorite:!0}))}removeFavorite(e){return this.client.rest.put(`${Ie}?path=${encodeURIComponent(e)}`,JSON.stringify({is_favorite:!1}))}createItem(e){return this.client.rest.post(Ie,JSON.stringify(e))}createWorkDir(e){return this.client.rest.post(Ie,JSON.stringify(e))}sizeWithSection(e){return this.client.rest.get(We,e)}}const He="/storage/files",Be=`${He}/net`;class Ge{constructor(e){this.client=e}read(e,t){return t.path=e,this.client.rest.get(He,t)}replace(e,t){const s=new URLSearchParams;return Object.keys(e).forEach((t=>{e[t]&&s.append(t,e[t])})),this.client.rest.put(`${He}?${s.toString()}`,t)}upload(e,t,s,i){const n=new FormData;n.set("path",s),i&&n.set("divide_id",i.toString()),n.set("file",t);const{promise:r,abort:o}=this.client.rest.upload(He,n,{onUploadProgress:t=>{e(t)}});return{promise:r,abort:o}}uploadNet(e){return this.client.rest.post(Be,JSON.stringify(e))}}class Me{constructor(e){this.client=e}instance(){return this.client.rest.get("/storage/instance")}}const Ve="/storage/element/share";class ze{constructor(e){this.client=e}info(e){return this.client.rest.get(Ve,{path:e})}create(e,t){const s={path:e,permissions_type:t};return this.client.rest.post(Ve,JSON.stringify(s))}change(e){return this.client.rest.put(`${Ve}/${e.token}`,JSON.stringify(e))}delete(e){return this.client.rest.delete(Ve,{path:e})}refresh(e){return this.client.rest.put(`${Ve}/${e}/refresh`)}}const Xe="/storage/trash",Ye=`${Xe}/element`,Ke=`${Ye}/all`;class Qe{constructor(e){this.client=e}list(e){return this.client.rest.get(Xe,e)}clear(e){return this.client.rest.delete(Ye,e)}clearAll(){return this.client.rest.delete(Ke)}restore(e){return this.client.rest.patch(Ye,JSON.stringify({del_groups:e}))}}const Ze="/users",et=`${Ze}/me`,tt=`${et}/avatars`,st=`${et}/sessions`,it=`${et}/tokens`,nt=`${et}/change-password`;class rt{constructor(e){this.client=e}list(e){return this.client.rest.get(Ze,e)}get(e){return this.client.rest.get(Ze+`/${e}`)}create(e){return this.client.rest.post(Ze,JSON.stringify(e))}update(e,t){return this.client.rest.put(Ze+`/${e}`,JSON.stringify(t))}delete(e,t){return this.client.rest.delete(`${Ze}/${e}`,t)}restore(e){return this.client.rest.post(`${Ze}/${e}/restore`)}me(){return this.client.rest.get(et)}updateMe(e){return this.client.rest.put(et,JSON.stringify(e))}createToken(e){return this.client.rest.post(it,JSON.stringify(e))}listToken(e){return this.client.rest.get(it,e)}deleteToken(e){return this.client.rest.delete(`${it}/${e}`)}changeMyPassword(e){return this.client.rest.put(nt,JSON.stringify(e))}changeUsersPassword(e,t){return this.client.rest.put(`${Ze}/${e}/change-password`,JSON.stringify(t))}meUploadAvatar(e,t){const s=new FormData;return s.append("file",e,t),this.client.rest.post(tt,s)}meDeleteAvatar(){return this.client.rest.delete(tt)}meListSession(e){return this.client.rest.get(st,e)}meDeleteSession(e){let t=st;return e&&(t+=`/${e}`),this.client.rest.delete(t)}setRole(e,t=null){return this.client.rest.put(`${Ze}/${e}/roles`,JSON.stringify({role_id:t}))}}const ot="/storage/element",ct=`${ot}/history`,at=`${ot}/version`,lt=`${at}/current`,dt=`${at}/size`;class ht{constructor(e){this.client=e}history(e){return this.client.rest.get(ct,e)}versions(e){return this.client.rest.get(at,e)}create(e){return this.client.rest.post(at,JSON.stringify(e))}edit(e){return this.client.rest.put(at,JSON.stringify(e))}delete(e){return this.client.rest.delete(at,e)}size(e){return this.client.rest.get(dt,e)}makeCurrent(e){return this.client.rest.post(lt,JSON.stringify(e))}}export{n as AccessRights,i as AuthApiService,Q as BASE_URL_V1,Z as BASE_URL_V2,r as CONNECTIONS_PERMISSION,ie as Client,a as ConnectionGroup,l as ConnectionType,j as ConnectionsApiService,W as DiscoveryApiService,H as DivideApiService,_ as DivideMode,u as DivideScope,c as EngineType,h as ExtensionFileMode,d as ExtensionType,oe as ExtensionsApiService,ae as ExtensionsExternalApiService,he as FcaApiService,pe as GatewayApiService,fe as GroupApiService,ee as HOST,Se as LicenseApiService,S as LicenseError,ke as LinksApiService,we as LogstashApiService,k as NotificationAction,Ae as NotificationApiService,y as NotificationEntityType,m as NotificationRowAction,w as NotificationStyle,o as OrderDirection,p as PermissionType,O as RequestMethod,x as RequestObserve,b as ResponseType,te as Rest,f as RestrictionBooleanStatus,v as RestrictionModeKey,N as RestrictionSharing,g as RestrictionStatus,De as RoleApiService,J as SettingControlType,Ee as ShareApiService,Fe as StorageElementApiService,R as StorageElementCheckStatus,U as StorageElementContentType,E as StorageElementHistoryAction,D as StorageElementType,Ge as StorageFilesApiService,Me as StorageInstanceApiService,P as StorageRoot,ze as StorageShareApiService,Qe as StorageTrashApiService,$ as Tariff,se as TokenUpdate,rt as UserApiService,A as UserAuthType,C as UserStatus,T as UserType,ht as VersionApiService,z as applyInterceptors,X as getCookieValue,Y as makeUrlParams,K as normalizeHeaders};
package/dist/index.d.ts CHANGED
@@ -17,6 +17,7 @@ interface StorageElement {
17
17
  access_mode?: PermissionType;
18
18
  to_user_group_id?: number;
19
19
  created_by_extension?: string;
20
+ check_status?: StorageElementCheckStatus;
20
21
  }
21
22
  declare enum StorageElementType {
22
23
  Dir = "dir",
@@ -85,6 +86,12 @@ interface HistoryNote {
85
86
  file_version_id: string;
86
87
  path: string;
87
88
  }
89
+ declare enum StorageElementCheckStatus {
90
+ CheckNull = 0,
91
+ CheckInProgress = 1,
92
+ CheckPositive = 2,
93
+ CheckNegative = 3
94
+ }
88
95
  interface RequestVersionsSizeParams {
89
96
  path: string;
90
97
  divide_id?: number;
@@ -1303,4 +1310,4 @@ declare const makeUrlParams: (params: Record<string, any>) => URLSearchParams;
1303
1310
 
1304
1311
  declare function normalizeHeaders(headers: Headers | [string, string][] | Record<string, string>): Record<string, string>;
1305
1312
 
1306
- export { AccessRights, type AccessToken, AuthApiService, type AuthToken, type AuthType, BASE_URL_V1, BASE_URL_V2, CONNECTIONS_PERMISSION, type ChangeLicenseParams, Client, type Connection, type ConnectionCreateParams, ConnectionGroup, ConnectionType, ConnectionsApiService, type CreateStorageElementParams, type CreateUserGroupParams, type CreateUserParams, type CreateUserRoleParams, type CutLinkRequest, type Discovery, DiscoveryApiService, DivideApiService, DivideMode, type DivideResourceType, type DivideResponseList, DivideScope, EngineType, type Extension, type ExtensionDefault, type ExtensionExternal, type ExtensionExternalInList, type ExtensionExternalListParams, ExtensionFileMode, type ExtensionListParams, type ExtensionMetaPayload, ExtensionType, ExtensionsApiService, ExtensionsExternalApiService, FcaApiService, GatewayApiService, GroupApiService, HOST, type HistoryListRequestParams, type HistoryNote, type HistoryRequestParams, type HttpEvent, type HttpResponse, type Lang, type License, LicenseApiService, LicenseError, LinksApiService, type LockScreen, LogstashApiService, type NbAppState, type NbClientParams, type NbRequestParams, NotificationAction, type NotificationActionGroup, NotificationApiService, NotificationEntityType, type NotificationPayload, NotificationRowAction, NotificationStyle, type OnUploadProgress, OrderDirection, type PayloadFile, type Permission, type PermissionItem, PermissionType, type ProgressEvent, type QueryInitResponse, type RequestAuthSettingsParams, type RequestAuthTokenParams, type RequestBaseParams, type RequestConfig, type RequestConnectionParams, RequestMethod, type RequestNotificationListParams, RequestObserve, type RequestStorageListParams, type RequestUserDivideParams, type RequestUserGroupListParams, type RequestUserListParams, type RequestUserRoleListParams, type RequestUsersLogParams, type RequestVersionsSizeParams, type ResponseItem, type ResponseList, type ResponseListNotification, ResponseType, Rest, type Restriction, RestrictionBooleanStatus, RestrictionModeKey, RestrictionSharing, RestrictionStatus, RoleApiService, type Setting, SettingControlType, type SettingField, type SettingFieldView, type SettingLang, type SettingValue, type SettingValueField, type SettingVariant, type SettingViewConnectionChoose, type SettingViewSelect, ShareApiService, type ShareInfo, type ShareModel, type SizeBySection, type StorageElement, StorageElementApiService, StorageElementContentType, type StorageElementHistory, StorageElementHistoryAction, type StorageElementPaste, type StorageElementPasteParams, StorageElementType, type StorageElementVersion, StorageFilesApiService, type StorageInstance, StorageInstanceApiService, type StorageItemSizeParams, type StorageItemSizePathParams, StorageRoot, type StorageRouteData, StorageShareApiService, StorageTrashApiService, type StorageTrashElement, type StorageTrashItem, Tariff, TokenUpdate, type UnionRestriction, type UploadNetRequestParams, type User, UserApiService, UserAuthType, type UserDivide, type UserGroup, type UserLabel, type UserNotification, type UserRole, type UserSession, UserStatus, type UserToken, UserType, type UsersLog, VersionApiService, applyInterceptors, getCookieValue, makeUrlParams, normalizeHeaders };
1313
+ export { AccessRights, type AccessToken, AuthApiService, type AuthToken, type AuthType, BASE_URL_V1, BASE_URL_V2, CONNECTIONS_PERMISSION, type ChangeLicenseParams, Client, type Connection, type ConnectionCreateParams, ConnectionGroup, ConnectionType, ConnectionsApiService, type CreateStorageElementParams, type CreateUserGroupParams, type CreateUserParams, type CreateUserRoleParams, type CutLinkRequest, type Discovery, DiscoveryApiService, DivideApiService, DivideMode, type DivideResourceType, type DivideResponseList, DivideScope, EngineType, type Extension, type ExtensionDefault, type ExtensionExternal, type ExtensionExternalInList, type ExtensionExternalListParams, ExtensionFileMode, type ExtensionListParams, type ExtensionMetaPayload, ExtensionType, ExtensionsApiService, ExtensionsExternalApiService, FcaApiService, GatewayApiService, GroupApiService, HOST, type HistoryListRequestParams, type HistoryNote, type HistoryRequestParams, type HttpEvent, type HttpResponse, type Lang, type License, LicenseApiService, LicenseError, LinksApiService, type LockScreen, LogstashApiService, type NbAppState, type NbClientParams, type NbRequestParams, NotificationAction, type NotificationActionGroup, NotificationApiService, NotificationEntityType, type NotificationPayload, NotificationRowAction, NotificationStyle, type OnUploadProgress, OrderDirection, type PayloadFile, type Permission, type PermissionItem, PermissionType, type ProgressEvent, type QueryInitResponse, type RequestAuthSettingsParams, type RequestAuthTokenParams, type RequestBaseParams, type RequestConfig, type RequestConnectionParams, RequestMethod, type RequestNotificationListParams, RequestObserve, type RequestStorageListParams, type RequestUserDivideParams, type RequestUserGroupListParams, type RequestUserListParams, type RequestUserRoleListParams, type RequestUsersLogParams, type RequestVersionsSizeParams, type ResponseItem, type ResponseList, type ResponseListNotification, ResponseType, Rest, type Restriction, RestrictionBooleanStatus, RestrictionModeKey, RestrictionSharing, RestrictionStatus, RoleApiService, type Setting, SettingControlType, type SettingField, type SettingFieldView, type SettingLang, type SettingValue, type SettingValueField, type SettingVariant, type SettingViewConnectionChoose, type SettingViewSelect, ShareApiService, type ShareInfo, type ShareModel, type SizeBySection, type StorageElement, StorageElementApiService, StorageElementCheckStatus, StorageElementContentType, type StorageElementHistory, StorageElementHistoryAction, type StorageElementPaste, type StorageElementPasteParams, StorageElementType, type StorageElementVersion, StorageFilesApiService, type StorageInstance, StorageInstanceApiService, type StorageItemSizeParams, type StorageItemSizePathParams, StorageRoot, type StorageRouteData, StorageShareApiService, StorageTrashApiService, type StorageTrashElement, type StorageTrashItem, Tariff, TokenUpdate, type UnionRestriction, type UploadNetRequestParams, type User, UserApiService, UserAuthType, type UserDivide, type UserGroup, type UserLabel, type UserNotification, type UserRole, type UserSession, UserStatus, type UserToken, UserType, type UsersLog, VersionApiService, applyInterceptors, getCookieValue, makeUrlParams, normalizeHeaders };
@@ -18,6 +18,7 @@ export interface StorageElement {
18
18
  access_mode?: PermissionType;
19
19
  to_user_group_id?: number;
20
20
  created_by_extension?: string;
21
+ check_status?: StorageElementCheckStatus;
21
22
  }
22
23
  export declare enum StorageElementType {
23
24
  Dir = "dir",
@@ -86,6 +87,12 @@ export interface HistoryNote {
86
87
  file_version_id: string;
87
88
  path: string;
88
89
  }
90
+ export declare enum StorageElementCheckStatus {
91
+ CheckNull = 0,
92
+ CheckInProgress = 1,
93
+ CheckPositive = 2,
94
+ CheckNegative = 3
95
+ }
89
96
  export interface RequestVersionsSizeParams {
90
97
  path: string;
91
98
  divide_id?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nb-js-client",
3
- "version": "0.0.33",
3
+ "version": "0.0.35",
4
4
  "main": "dist/bundle.cjs.js",
5
5
  "module": "dist/bundle.esm.js",
6
6
  "files": [
@@ -31,6 +31,7 @@
31
31
  "typescript": "^5.7.2"
32
32
  },
33
33
  "dependencies": {
34
+ "@babel/core": "^7.26.9",
34
35
  "jwt-decode": "^4.0.0"
35
36
  }
36
37
  }