nb-js-client 1.0.14 → 1.0.15

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.
@@ -19,7 +19,7 @@ export declare class StorageFilesApiService {
19
19
  time_zone?: number;
20
20
  }): Promise<void>;
21
21
  createZip(params: CreateZipRequestParams): Promise<void>;
22
- cancelCreateZip(params: {
22
+ cancelProcess(params: {
23
23
  process_id: string;
24
24
  }): Promise<void>;
25
25
  unZip(params: UnZipRequestParams): Promise<void>;
@@ -1 +1 @@
1
- "use strict";const e="/login",t=`${e}/ldap`,s=`${e}/update`,r=`${e}/tfa`;class i{constructor(e){this.client=e}info(){return this.client.rest.get(e)}login(t){return this.client.rest.post(e,t)}ldapLogin(e){return this.client.rest.post(t,e)}loginTfa(e){return this.client.rest.post(r,e)}updateToken(e){const t=e.path?`${e.path}/${s}`:s;return e.path&&delete e.path,this.client.rest.post(t,e)}logout(){return this.client.rest.post("/logout")}}var n;exports.AccessRights=void 0,(n=exports.AccessRights||(exports.AccessRights={})).LicenseRead="license_read",n.LicenseManage="license_edit",n.UsersRead="users_read",n.UsersCreate="users_create",n.UsersActivate="users_activate",n.GroupsRead="groups_read",n.GroupsCreate="groups_create",n.RolesRead="roles_read",n.RolesCreate="roles_create",n.Share="share",n.Divide="divide",n.ExtensionsRead="extensions_read",n.ExtensionsManage="extensions_write",n.RestrictionShareRead="restriction_share_read",n.RestrictionShareWrite="restriction_share_write",n.RestrictionDivideRead="restriction_divide_read",n.RestrictionDivideWrite="restriction_divide_write",n.LimitationsRead="limitations_read",n.LimitationsEdit="limitations_edit",n.ReadUserLogs="read_user_logs",n.ConnectionsRead="connections_read",n.ConnectionsDividing="connections_dividing",n.ConnectionsYandexDisk="connections_yandex_disk",n.ConnectionsSsh="connections_ssh",n.ConnectionsMail="connections_mail",n.ConnectionsS3="connections_s3",n.ConnectionsDiscord="connections_discord",n.ConnectionsWebdav="connections_webdav",n.ConnectionsNextcloud="connections_nextcloud",n.ConnectionsNextbox="connections_nextbox",n.ConnectionsHttpProxy="connections_http_proxy",n.SystemInfoServiceList="system_info_service_list",n.SettingsRead="settings_read",n.SettingsWrite="settings_write";const o=[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 c,a,p,l,d,u,h,g,_,x,v,S,$,m,f,y,k,w,A,b,T,R,C,E,D,U,P,O,L,I,N,q,z,j;exports.OrderDirection=void 0,(c=exports.OrderDirection||(exports.OrderDirection={})).DEFAULT="",c.ASC="asc",c.DESC="desc",exports.EngineType=void 0,(a=exports.EngineType||(exports.EngineType={})).WebSocket="websocket",a.PostMessage="postmessage",a.Empty="",exports.ConnectionGroup=void 0,(p=exports.ConnectionGroup||(exports.ConnectionGroup={})).Storages="storages_connections_group",p.Webhooks="webhooks_connections_group",p.Unknown="unknown_connections_group",p.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,(d=exports.ExtensionType||(exports.ExtensionType={})).App="app",d.File="file",d.WorkDir="work_dir",exports.ExtensionFileMode=void 0,(u=exports.ExtensionFileMode||(exports.ExtensionFileMode={})).Read="read",u.ReadAndWrite="read_and_write",u.Write="write",exports.DivideScope=void 0,(h=exports.DivideScope||(exports.DivideScope={})).Storage="/storage/element",h.Connection="/connections",exports.PermissionType=void 0,(g=exports.PermissionType||(exports.PermissionType={})).CLOSE="",g.READ="r",g.WRITE="rw",exports.RestrictionStatus=void 0,(_=exports.RestrictionStatus||(exports.RestrictionStatus={})).WAITING="waiting",_.APPROVED="approved",_.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,(m=exports.LicenseError||(exports.LicenseError={})).NotActivated="License not activated",m.Blocked="License blocked",m.Expired="License has been expired",m.NotValid="License not valid",m.NotFound="license file not found",exports.LimitationType=void 0,(f=exports.LimitationType||(exports.LimitationType={})).BySize="size",f.ByExt="extension",f.ByQuota="quota_size",exports.LimitationSubType=void 0,(y=exports.LimitationSubType||(exports.LimitationSubType={})).Size="size",y.White="extension_white",y.Black="extension_black",exports.NotificationEntityType=void 0,(k=exports.NotificationEntityType||(exports.NotificationEntityType={})).Dir="dir",k.File="file",k.User="user",k.Other="other",k.WorkDir="work_dir",k.License="license",k.Extension="extension",k.Connection="connection",exports.NotificationAction=void 0,(w=exports.NotificationAction||(exports.NotificationAction={})).SecurityCheckNegative="action_security_check_negative",w.SecurityCheckPositive="action_security_check_positive",w.CommentVersionMention="action_version_comment_mention",w.OpenSharing="open_sharing",w.ChangeSharing="change_sharing",w.CancelSharing="cancel_sharing",w.DivideDirAddFileToOwner="divide_dir_add_file_to_owner",w.DivideDirAddDirToOwner="divide_dir_add_dir_to_owner",w.DivideDirAddWorkDirToOwner="divide_dir_add_work_dir_to_owner",w.DivideConnectionAddFileToOwner="divide_connection_add_file_to_owner",w.DivideConnectionAddDirToOwner="divide_connection_add_dir_to_owner",w.CancelDivideDir="cancel_divide_dir",w.CancelDivideFile="cancel_divide_file",w.CancelDivideWorkDir="cancel_divide_work_dir",w.CancelDivideConnection="cancel_divide_connection",w.DeleteExtension="delete_extension",w.NewVersionExtension="new_version_extension",w.TransferData="transfer_data",w.AllowInternalAccessUser="allow_internal_access_to_user",w.BlockInternalAccessUser="block_internal_access_to_user",w.WaitInternalAccessUser="wait_internal_access_to_user",w.WaitInternalAccessUserCreate="wait_internal_access_to_user_create",w.AllowInternalAccessGroup="allow_internal_access_to_group",w.BlockInternalAccessGroup="block_internal_access_to_group",w.WaitInternalAccessGroup="wait_internal_access_to_group",w.WaitInternalAccessGroupCreate="wait_internal_access_to_group_create",w.AllowSharing="allow_sharing",w.BlockSharing="block_sharing",w.WaitSharing="wait_sharing",w.WaitSharingCreate="wait_sharing_create",w.StatusCreateZipProcess="status_create_zip_process",w.StatusCreateZipSuccess="status_create_zip_success",w.StatusCreateZipError="status_create_zip_error",w.DownloadZipSuccess="download_zip_success",w.DownloadZipError="download_zip_error",w.StatusUnzipProcess="status_unzip_process",w.StatusUnzipSuccess="status_unzip_success",w.StatusUnzipError="status_unzip_error",w.StatusUnzipSuccessWithLimits="status_unzip_success_with_limits",w.AnonymZipDirAddFileToOwner="anonym_zip_dir_add_file_to_owner",w.GuestZipDirAddFileToOwner="guest_zip_dir_add_file_to_owner",w.DropDocumentOnlyoffice="drop_document_onlyoffice",w.CopyError="copy_error",w.CopySuccess="copy_success",w.StatusCopyProcess="status_copy_process",w.Other="other",exports.NotificationRowAction=void 0,(A=exports.NotificationRowAction||(exports.NotificationRowAction={})).Read="read",A.Unread="unread",A.Delete="delete",exports.NotificationStyle=void 0,(b=exports.NotificationStyle||(exports.NotificationStyle={})).Plain="plain",b.Success="success",b.Info="info",b.Warning="warning",b.Error="error",exports.ResponseType=void 0,(T=exports.ResponseType||(exports.ResponseType={})).ArrayBuffer="arraybuffer",T.Blob="blob",T.Json="json",T.Text="text",exports.RequestMethod=void 0,(R=exports.RequestMethod||(exports.RequestMethod={})).GET="GET",R.POST="POST",R.PUT="PUT",R.PATCH="PATCH",R.DELETE="DELETE",R.HEAD="HEAD",exports.RequestObserve=void 0,(C=exports.RequestObserve||(exports.RequestObserve={})).Body="body",C.Response="response",exports.RestrictionSharing=void 0,(E=exports.RestrictionSharing||(exports.RestrictionSharing={})).NONE="none",E.SOFT="soft",E.HARD="hard",exports.UserAuthType=void 0,(D=exports.UserAuthType||(exports.UserAuthType={})).Native="native",D.Ldap="ldap",D.Vk="vk",exports.UserStatus=void 0,(U=exports.UserStatus||(exports.UserStatus={})).Registering="registering",U.Activated="activated",U.BlockedByAdmin="blocked_by_admin",U.BlockedByLicense="blocked_by_license",U.BlockedByInactive="blocked_by_inactive",U.BlockedByInactiveChangePassword="blocked_by_inactive_change_password",exports.UserType=void 0,(P=exports.UserType||(exports.UserType={})).User="user",P.Guest="guest",P.Emperor="emperor",P.Anonymous="anonymous",exports.UserParamsLabel=void 0,(O=exports.UserParamsLabel||(exports.UserParamsLabel={})).Theme="theme",O.Lang="lang",O.Sort="sort",O.ViewApps="viewApps",O.WithoutContentWorkDir="withoutContentWorkDir",O.DashboardGrid="dashboardGrid",exports.UserAppType=void 0,(exports.UserAppType||(exports.UserAppType={})).Webdav="webdav",exports.SettingControlType=void 0,(L=exports.SettingControlType||(exports.SettingControlType={})).Text="text",L.String="string",L.Number="number",L.CheckBox="checkbox",L.Select="select",L.RadioList="radio_list",L.ConnectionChoose="connection_choose",L.MultiConnectionChoose="multi_connection_choose",exports.StorageElementType=void 0,(I=exports.StorageElementType||(exports.StorageElementType={})).Dir="dir",I.File="file",I.WorkDir="work_dir",I.App="app",exports.StorageElementContentType=void 0,(N=exports.StorageElementContentType||(exports.StorageElementContentType={})).Any="any",N.Dir="dir",N.Code="code",N.Image="image",N.Audio="audio",N.Video="video",N.Text="text",N.Doc="doc",N.Xls="xls",N.Ppt="ppt",exports.StorageRoot=void 0,(q=exports.StorageRoot||(exports.StorageRoot={})).my="my",q.fca="fca",q.divide="divide",q.share="share",q.favorite="favorite",q.trash="trash",exports.StorageElementHistoryAction=void 0,(z=exports.StorageElementHistoryAction||(exports.StorageElementHistoryAction={})).Create="create",z.Update="update",z.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 M="/connections",B=`${M}/dashboard`;class W{constructor(e){this.client=e}list(e){return this.client.rest.get(M,e)}get(e){return this.client.rest.get(`${M}/${e}`)}update(e,t){return this.client.rest.put(`${M}/${e}`,t)}delete(e){return this.client.rest.delete(`${M}/${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]||M,e)}dashboard(e){return this.client.rest.get(B,e)}}class F{constructor(e){this.client=e}discovery(e){return this.client.rest.get("/discovery",e)}}const H="/divide",G=`${H}/restrictions`;class V{constructor(e){this.client=e}divideDelete(e,t){return this.client.rest.delete(`${e}${H}/${t}`)}divideDeleteAll(e,t,s,r){return this.client.rest.delete(`${e}${H}`,Object.assign(Object.assign({},this.makeParam(e,t)),{is_to_user_group:r,access_mode:s}))}divideChange(e,t,s){return this.client.rest.put(`${e}${H}/${t}`,{access_mode:s})}divideCreate(e,t,s,r,i){const n=Object.assign(Object.assign({},this.makeParam(e,t)),{[i]:s,access_mode:r});return this.client.rest.post(`${e}${H}`,n)}divideUsers(e,t,s){return this.client.rest.get(`${e}${H}/users`,Object.assign(Object.assign({},this.makeParam(e,t)),s))}getRestriction(e){return this.client.rest.get(`${G}/${e}`)}restrictionSize(e,t){return this.client.rest.get(`/${t}/restrictions/${e}/size`)}restrictions(e){return this.client.rest.get(`${G}`,e)}restrictionsChange(e,t){return this.client.rest.put(`${G}/${e}`,t)}makeParam(e,t){const s={};return e===exports.DivideScope.Connection?s.connection_id=t:s.path=t,s}}function Z(e,t,s,r){return new(s||(s=Promise))((function(i,n){function o(e){try{a(r.next(e))}catch(e){n(e)}}function c(e){try{a(r.throw(e))}catch(e){n(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,c)}a((r=r.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class J extends Error{}function K(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 Q(e,t){if("string"!=typeof e)throw new J("Invalid token specified: must be a string");t||(t={});const s=!0===t.header?0:1,r=e.split(".")[s];if("string"!=typeof r)throw new J(`Invalid token specified: missing part #${s+1}`);let i;try{i=K(r)}catch(e){throw new J(`Invalid token specified: invalid base64 for part #${s+1} (${e.message})`)}try{return JSON.parse(i)}catch(e){throw new J(`Invalid token specified: invalid json for part #${s+1} (${e.message})`)}}J.prototype.name="InvalidTokenError";const X=(e,t)=>Z(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 Y(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 ee=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 te(e){return e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):e}function se(e){return e?e instanceof FormData||e instanceof Blob||e instanceof ArrayBuffer||e instanceof URLSearchParams||e instanceof Document||ArrayBuffer.isView(e)?e:"object"==typeof e?JSON.stringify(e):"string"==typeof e?e:null:null}const re="update black token";class ie{constructor(){this.isUpdating=!1,this.tokenUpdateResolve=null}isTokenExpire(e){if(!e)return!1;return 1e3*e<=(new Date).getTime()+3e3}refreshToken(e,t){return Z(this,void 0,void 0,(function*(){const{access_token:s,refresh_token:r}=e;return s&&r?this.isUpdating?this.waitForTokenUpdate():(this.isUpdating=!0,new Promise(((e,i)=>{const n=new XMLHttpRequest,o=`${t}${ne}/login/update`;n.open("POST",o,!0),n.setRequestHeader("Content-Type","application/json"),n.send(JSON.stringify({access_token:s,refresh_token:r})),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};Y("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 e(null)},n.onerror=()=>{i(new Error("Network error occurred"))},n.onloadend=()=>{this.isUpdating=!1}}))):null}))}waitForTokenUpdate(){return Z(this,void 0,void 0,(function*(){return new Promise((e=>{const t=setInterval((()=>{this.isUpdating||(clearInterval(t),e())}),100)}))}))}}const ne="/api/v1",oe="/api/v2";class ce{constructor(e,t){this.client=e,this.tokenUpdate=t,this.baseHost=""}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))}head(e,t,s){return this.request(exports.RequestMethod.HEAD,e,Object.assign({params:t},s))}upload(e,t,s){const r=new AbortController,i=r.signal;return{promise:this.request(exports.RequestMethod.POST,e,Object.assign({body:t,signal:i},s)),abort:()=>r.abort()}}request(e,t,s){return new Promise(((r,i)=>{var n;const o=null!==(n=this.state.skipInterceptors)&&void 0!==n&&n;this.state.skipInterceptors=!1;let c=Object.assign({method:e},s);(null==s?void 0:s.signal)&&(c.signal=s.signal);(()=>Z(this,void 0,void 0,(function*(){var s,n,a,p;if(o||(c=null!==(s=yield X(this.client.requestInterceptors,c))&&void 0!==s?s:c),this.state.authToken)for(const[e,s]of this.state.authToken.entries()){const r=Q(s.access_token);if(r&&r.is_remember&&this.tokenUpdate.isTokenExpire(r.exp)&&!t.includes("/login")&&!t.includes("/assets")){const t=yield this.tokenUpdate.refreshToken(s,this.baseHost);t&&(this.state.authToken.set(e,t),c=null!==(n=yield X(this.client.requestInterceptors,c))&&void 0!==n?n:c)}}const l=new XMLHttpRequest;c.params&&Object.keys(c.params).length&&(t+="?"+ee(c.params));const d=null!==(a=c.host)&&void 0!==a?a:this.state.clientParams.host,u=`${d}${null!==(p=c.version)&&void 0!==p?p:this.state.clientParams.version}${t}`;if(l.open(e,u,!0),c.headers){const e=te(c.headers);for(const[t,s]of Object.entries(e))(d===this.baseHost||"content-type"!==t.toLowerCase())&&l.setRequestHeader(t,s)}c.responseType&&(l.responseType=c.responseType),c.signal&&c.signal.addEventListener("abort",(()=>{l.abort(),i(new Error("Request aborted"))})),!l.upload||e!==exports.RequestMethod.POST&&e!==exports.RequestMethod.PUT&&e!==exports.RequestMethod.PATCH||(l.upload.onprogress=e=>{e.lengthComputable&&c.onUploadProgress&&c.onUploadProgress(e)}),l.onload=()=>Z(this,void 0,void 0,(function*(){if(c.signal&&c.signal.aborted)return;let e;switch(c.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,r]=e.split(": ");s&&r&&t.append(s,r)}));const s={status:l.status,statusText:l.statusText,headers:t,url:l.responseURL};if(l.status>=200&&l.status<300)return yield X(this.client.responseInterceptors,s),void(c.observe===exports.RequestObserve.Response?r(Object.assign(Object.assign({},s),{body:e})):r(e));if(this.state.authToken&&(null==e?void 0:e.code)===re){const e=yield this.tokenUpdate.refreshToken(this.state.authToken.get(0),this.baseHost);e&&this.state.authToken.set(0,e)}const n=Object.assign(Object.assign({},s),{error:e});yield X(this.client.responseInterceptors,n),i(n)})),l.onerror=()=>{i({status:l.status,statusText:l.statusText,url:l.responseURL,error:"Network error"})},l.send(se(c.body))})))().catch(i)}))}}const ae="/static/extensions",pe="/extensions/defaults",le=`${ae}/names/users`,de=`${ae}/names/system`,ue=`${ae}/tags`;class he{constructor(e){this.client=e}getSetting(e){return this.client.rest.get(`${ae}/${e}/settings`)}setSetting(e,t){return this.client.rest.post(`${ae}/${e}/settings`,t)}deleteSetting(e){return this.client.rest.delete(`${ae}/${e}/settings`)}get(e){return this.client.rest.get(`${ae}/${e}`)}getByKey(e){return this.client.rest.get(`${ae}/${e}`)}getDefault(e=[]){return this.client.rest.get(pe,{ext_code:e})}setDefault(e,t){return this.client.rest.post(pe,{ext_code:e,ext_uniq_key:t})}checkUpdates(){return this.client.rest.post(`${ae}/check_updates`)}updateVersion(e,t){return this.client.rest.put(`${ae}/${e}`,{version:t})}list(e){return this.client.rest.get(ae,e)}listTags(e){return this.client.rest.get(ue,e)}delete(e,t){return this.client.rest.delete(`${ae}/${e}`)}upload(e,t){const s=new FormData;s.set("file",t);const{promise:r,abort:i}=this.client.rest.upload(ae,s,{version:oe,onUploadProgress:t=>{e(t)}});return{promise:r,abort:i}}install(e,t){return this.client.rest.post(`${ae}/site`,{uniq_key:e,version:t},{version:oe})}getSystemNameExts(e){return this.client.rest.get(de,e)}getUserNameExts(e){return this.client.rest.get(le,e)}createUserNameExt(e){return this.client.rest.post(`${le}`,{name:e})}deleteUserNameExt(e){return this.client.rest.delete(`${le}/${e}`)}deleteAllUserNameExts(){return this.client.rest.delete(`${le}`)}}const ge="/anons_ext/extensions";class _e{constructor(e){this.client=e}listExtensionsSite(e){return this.client.rest.get(ge,e,{host:"https://next-box.ru"})}extensionDetailSite(e){return this.client.rest.get(`${ge}/${e}`,{},{host:"https://next-box.ru"})}extensionMarkdown(e,t){return this.client.rest.get(`${ge}/${e.uniqKey}/readme`,{lang:e.lang},Object.assign(Object.assign({},t),{host:"https://next-box.ru"}))}}const xe="/disk",ve=`${xe}/check`;class Se{constructor(e){this.client=e}info(e,t){return this.client.rest.get(`${xe}/${e}/element`,{path:t})}list(e,t){return this.client.rest.get(`${xe}/${e}`,t)}create(e,t){return this.client.rest.post(`${xe}/${e}/element`,t)}replace(e,t,s){return this.client.rest.put(`${xe}/${e}/files?path=${t}`,s)}read(e,t){return this.client.rest.get(`${xe}/${e}/files?path=${t}`)}upload(e,t,s,r=""){const i=new FormData;i.set("path",r),i.set("file",s);const{promise:n,abort:o}=this.client.rest.upload(`${xe}/${t}/files`,i,{onUploadProgress:t=>{e(t)}});return{promise:n,abort:o}}uploadNet(e,t){return this.client.rest.post(`${xe}/${e}/files/net`,t)}delete(e,t){return this.client.rest.delete(`${xe}/${e}/trash/element`,{path:t})}check(e){return this.client.rest.post(ve,e)}}const $e="/settings";class me{constructor(e){this.client=e}settings(){return this.client.rest.get($e)}changeSettings(e){return this.client.rest.post($e,e)}queryInit(){return this.client.rest.get("/query/init")}}var fe;exports.QueryInitViewType=void 0,(fe=exports.QueryInitViewType||(exports.QueryInitViewType={})).Standard="Standard",fe.Simple="Simple";const ye="/groups";class ke{constructor(e){this.client=e}list(e){return this.client.rest.get(ye,e)}listUsers(e,t){return this.client.rest.get(`${ye}/${e}/users`,t)}create(e){return this.client.rest.post(ye,e)}update(e,t){return this.client.rest.put(`${ye}/${e}`,t)}delete(e){return this.client.rest.delete(`${ye}/${e}`)}}const we="/license",Ae=`${we}/manual-check`,be=`${we}/hardware/hash`;class Te{constructor(e){this.client=e}info(){return this.client.rest.get(we)}create(e){return this.client.rest.post(we,e)}check(){return this.client.rest.post(Ae)}delete(){return this.client.rest.delete(we)}getHash(){return this.client.rest.get(be)}}const Re="/links";class Ce{constructor(e){this.client=e}createShortLink(e){return this.client.rest.post(Re,e)}updateShortLink(e){return this.client.rest.put(Re,e)}}const Ee="/limitations";class De{constructor(e){this.client=e}me(){return this.client.rest.get("/limitations/user/me")}list(e){return this.client.rest.get(Ee,e)}listUsers(e,t){return this.client.rest.get(`${Ee}/${e}/users`,t)}create(e){return this.client.rest.post(Ee,e)}get(e){return this.client.rest.get(`${Ee}/${e}`)}update(e,t){return this.client.rest.put(`${Ee}/${e}`,t)}delete(e){return this.client.rest.delete(`${Ee}/${e}`)}getLimitationsByUser(e){return this.client.rest.get(`/limitations/user/${e}`)}addUserToLimitation(e,t){return this.client.rest.patch(`${Ee}/${e}/user`,{id:t})}deleteUserFromLimitation(e,t){return this.client.rest.delete(`${Ee}/${e}/user/${t}`)}}class Ue{constructor(e){this.client=e}getUsersLogs(e){return this.client.rest.get("/logs/users",e)}}const Pe="/notifications",Oe=`${Pe}/all`,Le=`${Pe}/subscription`,Ie=`${Pe}/permission`;class Ne{constructor(e){this.client=e}list(e){return this.client.rest.get(Pe,e)}toggleStatus(e,t){return this.client.rest.put(Pe,{ids:e,to_status:t})}toggleAllStatus(e){return this.client.rest.put(Oe,{to_status:e})}delete(e){return this.client.rest.delete(Pe,{id:e})}deleteAll(){return this.client.rest.delete(Oe)}getPermission(){return this.client.rest.get(Ie)}setPermission(e){return this.client.rest.post(Ie,{enabled:e})}getSubscription(){return this.client.rest.get(Le)}setSubscription(e){const t={action_groups:Object.assign({},e)};return this.client.rest.post(Le,t)}}const qe="/roles",ze=`${qe}/default`,je="/permissions";class Me{constructor(e){this.client=e}list(e){return this.client.rest.get(qe,e)}get(e){return this.client.rest.get(`${qe}/${e}`)}getDefault(){return this.client.rest.get(`${ze}`)}create(e){return this.client.rest.post(qe,e)}update(e,t){return this.client.rest.put(`${qe}/${e}`,t)}delete(e){return this.client.rest.delete(`${qe}/${e}`)}permissionList(){return this.client.rest.get(je)}addPermission(e,t){return this.client.rest.put(`${qe}/${e}/permissions`,{ids:t})}deletePermission(e,t){return this.client.rest.delete(`${qe}/${e}/${je}`,{ids:t})}}const Be="/share",We=`${Be}/restrictions`,Fe=`${Be}/login`;class He{constructor(e){this.client=e}info(e){return this.client.rest.get(`${Be}?share_token=${e}`)}checkPassword(e,t){const s=encodeURIComponent(e);return this.client.rest.get(`${Be}/password?share_token=${t}&share_pass=${s}`)}getRestriction(e){return this.client.rest.get(`${We}/${e}`)}restrictions(e){return this.client.rest.get(We,e)}restrictionsChange(e,t){return this.client.rest.put(`${We}/${e}`,t)}login(e){return this.client.rest.post(`${Fe}`,e)}}const Ge="/storage/element/version/comment",Ve=`${Ge}/all`;class Ze{constructor(e){this.client=e}list(e){return this.client.rest.get(`${Ge}`,e)}create(e){return this.client.rest.post(`${Ge}`,e)}update(e){return this.client.rest.put(`${Ge}`,e)}delete(e){return this.client.rest.delete(`${Ge}`,e)}deleteAll(e){return this.client.rest.delete(`${Ve}`,e)}}const Je="/storage",Ke=`${Je}/element`,Qe=`${Ke}/divide/resource`,Xe=`${Ke}/move`,Ye=`${Ke}/copy`,et=`${Ke}/content_type_size`,tt="/disk";class st{constructor(e,t){this.client=e,this.fcaApiService=t}list(e){return this.client.rest.get(Je,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,e.zip_entry_path||delete e.zip_entry_path,this.client.rest.get(Ke,e)}fileInfo(e,t){return this.client.rest.get(`${Ke}/${e}`,t?{file_version_id:t}:{})}combineInfo({root:e,rootId:t,path:s,file_version_id:r,zip_entry_path:i}){return e===exports.StorageRoot.fca&&t?this.fcaApiService.info(t,s):this.info({path:s,divide_id:t,file_version_id:r,zip_entry_path:i})}size(e){return this.client.rest.post(`${Ke}/size`,e)}move(e,t,s){const{from_divide_id:r,to_divide_id:i}=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(`${tt}/${r}/files/move${tt}/${i}`,n):t===exports.StorageRoot.fca?(r&&(n.from_divide_id=r),this.client.rest.put(`${tt}/${i}/files/from/box`,n)):s===exports.StorageRoot.fca?(i&&(n.to_divide_id=i),this.client.rest.put(`${tt}/${r}/files/to/box`,n)):this.client.rest.post(Xe,e)}copy(e,t,s){const{from_divide_id:r,to_divide_id:i}=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(`${tt}/${r}/files/copy${tt}/${i}`,n):s===exports.StorageRoot.fca?(r&&(n.from_divide_id=r),this.client.rest.post(`${tt}/${i}/files/from/box`,n)):t===exports.StorageRoot.fca?(i&&(n.to_divide_id=i),this.client.rest.post(`${tt}/${r}/files/to/box`,n)):this.client.rest.post(Ye,e)}pasteFromShared(e,t,s){const r={from_sharing_token:e,from_sharing_password:s,paths:t};return this.client.rest.post(`${Ke}/copy`,r)}create(e){return this.client.rest.post(Ke,e)}delete(e,t){const s={path:e};return t&&(s.divide_id=t),this.client.rest.delete(Ke,s)}favorite(e){return this.client.rest.put(`${Ke}?path=${encodeURIComponent(e)}`,{is_favorite:!0})}removeFavorite(e){return this.client.rest.put(`${Ke}?path=${encodeURIComponent(e)}`,{is_favorite:!1})}createItem(e){return this.client.rest.post(Ke,e)}createWorkDir(e){return this.client.rest.post(Ke,e)}sizeWithSection(e){return this.client.rest.get(et,e)}getDivideResources(e){return this.client.rest.get(Qe,e)}getQuota(e){return this.client.rest.get(`${Ke}/user_size`,e)}}const rt="/storage/files",it=`${rt}/net`,nt=`${rt}/unzip`,ot=`${rt}/zip`,ct=`${ot}/download`,at=`${rt}/process`,pt=`${rt}/code`;class lt{constructor(e){this.client=e}read(e,t){return t.path=e,this.client.rest.get(rt,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(`${rt}?${s.toString()}`,t)}upload(e,t,s,r){const i=new FormData;i.set("path",s),r&&i.set("divide_id",r.toString()),i.set("file",t);const{promise:n,abort:o}=this.client.rest.upload(rt,i,{onUploadProgress:t=>{e(t)}});return{promise:n,abort:o}}uploadNet(e){return this.client.rest.post(it,e)}createZipToDownload(e){var t;const s=-(new Date).getTimezoneOffset()/60;return null!==(t=e.time_zone)&&void 0!==t||(e.time_zone=s),this.client.rest.post(ct,e)}createZip(e){var t;const s=-(new Date).getTimezoneOffset()/60;return null!==(t=e.time_zone)&&void 0!==t||(e.time_zone=s),this.client.rest.post(ot,e)}cancelCreateZip(e){return this.client.rest.delete(at,e)}unZip(e){return this.client.rest.post(nt,e)}checkZip(e){return this.client.rest.head(pt,e)}}class dt{constructor(e){this.client=e}instance(){return this.client.rest.get("/storage/instance")}}const ut="/storage/element/share";class ht{constructor(e){this.client=e}info(e){return this.client.rest.get(ut,{path:e})}create(e,t){const s={path:e,permissions_type:t};return this.client.rest.post(ut,s)}change(e){return this.client.rest.put(`${ut}/${e.token}`,e)}delete(e){return this.client.rest.delete(ut,{path:e})}refresh(e){return this.client.rest.put(`${ut}/${e}/refresh`)}}const gt="/storage/trash/element",_t=`${gt}/all`;class xt{constructor(e){this.client=e}clear(e){return this.client.rest.delete(gt,e)}clearAll(){return this.client.rest.delete(_t)}restore(e){return this.client.rest.patch(gt,{del_groups:e})}restoreAll(){return this.client.rest.patch(_t)}}const vt="/users",St=`${vt}/me`,$t=`${St}/avatars`,mt=`${St}/sessions`,ft=`${St}/tokens`,yt=`${St}/params`,kt=`${St}/app-passwords`,wt=`${St}/change-password`,At=`${vt}/initial`,bt=`${St}/phone`,Tt=`${bt}/confirm`;class Rt{constructor(e){this.client=e}initial(e){return this.client.rest.post(At,e)}list(e){return this.client.rest.get(vt,e)}get(e){return this.client.rest.get(vt+`/${e}`)}create(e){return this.client.rest.post(vt,e)}update(e,t){return this.client.rest.put(vt+`/${e}`,t)}delete(e,t){return this.client.rest.delete(`${vt}/${e}`,t)}restore(e){return this.client.rest.post(`${vt}/${e}/restore`)}me(){return this.client.rest.get(St)}updateMe(e){return this.client.rest.put(St,e)}createToken(e){return this.client.rest.post(ft,e)}listToken(e){return this.client.rest.get(ft,e)}deleteToken(e){return this.client.rest.delete(`${ft}/${e}`)}changeMyPassword(e){return this.client.rest.put(wt,e)}changeUsersPassword(e,t){return this.client.rest.put(`${vt}/${e}/change-password`,t)}meUploadAvatar(e,t){const s=new FormData;return s.append("file",e,t),this.client.rest.post($t,s)}meDeleteAvatar(){return this.client.rest.delete($t)}meListSession(e){return this.client.rest.get(mt,e)}meDeleteSession(e){let t=mt;return e&&(t+=`/${e}`),this.client.rest.delete(t)}setRole(e,t=null){return this.client.rest.put(`${vt}/${e}/roles`,{role_id:t})}meParams(e){return this.client.rest.get(yt,{name:e})}meSetParams(e,t){return this.client.rest.post(`${yt}/${e}`,t)}meListParams(){return this.client.rest.get(yt)}phone(e){return this.client.rest.post(bt,e)}phoneConfirm(e){return this.client.rest.post(`${Tt}/${e}`)}appPasswordsList(e){return this.client.rest.get(kt,e)}createAppPasswords(e){return this.client.rest.post(kt,e)}deleteAppPasswords(e){return this.client.rest.delete(`${kt}/${e}`)}}const Ct="/storage/element",Et=`${Ct}/history`,Dt=`${Ct}/version`,Ut=`${Dt}/lock`,Pt=`${Dt}/unlock`,Ot=`${Dt}/current`,Lt=`${Dt}/size`;class It{constructor(e){this.client=e}history(e){return this.client.rest.get(Et,e)}versions(e){return this.client.rest.get(Dt,e)}create(e){return this.client.rest.post(Dt,e)}edit(e){return this.client.rest.put(Dt,e)}delete(e){return this.client.rest.delete(Dt,e)}size(e){return this.client.rest.get(Lt,e)}makeCurrent(e){return this.client.rest.post(Ot,e)}lock(e){return this.client.rest.post(Ut,e)}unlock(e){return this.client.rest.post(Pt,e)}}exports.AuthApiService=i,exports.BASE_URL_V1=ne,exports.BASE_URL_V2=oe,exports.CONNECTIONS_PERMISSION=o,exports.Client=class{constructor(e){this.AuthApiService=new i(this),this.ConnectionsApiService=new W(this),this.DiscoveryApiService=new F(this),this.DivideApiService=new V(this),this.ExtensionsApiService=new he(this),this.ExtensionsExternalApiService=new _e(this),this.FcaApiService=new Se(this),this.GatewayApiService=new me(this),this.GroupApiService=new ke(this),this.LicenseApiService=new Te(this),this.LinksApiService=new Ce(this),this.LimitationsApiService=new De(this),this.LogstashApiService=new Ue(this),this.NotificationApiService=new Ne(this),this.RoleApiService=new Me(this),this.ShareApiService=new He(this),this.StorageCommentApiService=new Ze(this),this.StorageElementApiService=new st(this,this.FcaApiService),this.StorageFilesApiService=new lt(this),this.StorageInstanceApiService=new dt(this),this.StorageShareApiService=new ht(this),this.StorageTrashApiService=new xt(this),this.UserApiService=new Rt(this),this.VersionApiService=new It(this),this.tokenUpdate=new ie,this.rest=new ce(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,version:(null==e?void 0:e.version)||ne},requestParams:{path:"",headers:{},query:{},body:null,cache:"no-cache"},authToken:null,skipInterceptors:!1},this.rest.baseHost=this.state.clientParams.host||""}},exports.ConnectionsApiService=W,exports.DiscoveryApiService=F,exports.DivideApiService=V,exports.ExtensionsApiService=he,exports.ExtensionsExternalApiService=_e,exports.FcaApiService=Se,exports.GatewayApiService=me,exports.GroupApiService=ke,exports.LicenseApiService=Te,exports.LimitationsApiService=De,exports.LinksApiService=Ce,exports.LogstashApiService=Ue,exports.NEED_TOKEN_UPDATE_ERROR=re,exports.NotificationApiService=Ne,exports.Rest=ce,exports.RoleApiService=Me,exports.ShareApiService=He,exports.StorageCommentApiService=Ze,exports.StorageElementApiService=st,exports.StorageFilesApiService=lt,exports.StorageInstanceApiService=dt,exports.StorageShareApiService=ht,exports.StorageTrashApiService=xt,exports.TokenUpdate=ie,exports.UserApiService=Rt,exports.VersionApiService=It,exports.applyInterceptors=X,exports.getCookieValue=Y,exports.makeUrlParams=ee,exports.normalizeHeaders=te,exports.prepareRequestBody=se;
1
+ "use strict";const e="/login",t=`${e}/ldap`,s=`${e}/update`,r=`${e}/tfa`;class i{constructor(e){this.client=e}info(){return this.client.rest.get(e)}login(t){return this.client.rest.post(e,t)}ldapLogin(e){return this.client.rest.post(t,e)}loginTfa(e){return this.client.rest.post(r,e)}updateToken(e){const t=e.path?`${e.path}/${s}`:s;return e.path&&delete e.path,this.client.rest.post(t,e)}logout(){return this.client.rest.post("/logout")}}var n;exports.AccessRights=void 0,(n=exports.AccessRights||(exports.AccessRights={})).LicenseRead="license_read",n.LicenseManage="license_edit",n.UsersRead="users_read",n.UsersCreate="users_create",n.UsersActivate="users_activate",n.GroupsRead="groups_read",n.GroupsCreate="groups_create",n.RolesRead="roles_read",n.RolesCreate="roles_create",n.Share="share",n.Divide="divide",n.ExtensionsRead="extensions_read",n.ExtensionsManage="extensions_write",n.RestrictionShareRead="restriction_share_read",n.RestrictionShareWrite="restriction_share_write",n.RestrictionDivideRead="restriction_divide_read",n.RestrictionDivideWrite="restriction_divide_write",n.LimitationsRead="limitations_read",n.LimitationsEdit="limitations_edit",n.ReadUserLogs="read_user_logs",n.ConnectionsRead="connections_read",n.ConnectionsDividing="connections_dividing",n.ConnectionsYandexDisk="connections_yandex_disk",n.ConnectionsSsh="connections_ssh",n.ConnectionsMail="connections_mail",n.ConnectionsS3="connections_s3",n.ConnectionsDiscord="connections_discord",n.ConnectionsWebdav="connections_webdav",n.ConnectionsNextcloud="connections_nextcloud",n.ConnectionsNextbox="connections_nextbox",n.ConnectionsHttpProxy="connections_http_proxy",n.SystemInfoServiceList="system_info_service_list",n.SettingsRead="settings_read",n.SettingsWrite="settings_write";const o=[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 c,a,p,l,d,u,h,g,_,x,v,S,$,m,f,y,k,w,A,b,T,R,C,E,D,U,P,O,L,I,N,q,z,j;exports.OrderDirection=void 0,(c=exports.OrderDirection||(exports.OrderDirection={})).DEFAULT="",c.ASC="asc",c.DESC="desc",exports.EngineType=void 0,(a=exports.EngineType||(exports.EngineType={})).WebSocket="websocket",a.PostMessage="postmessage",a.Empty="",exports.ConnectionGroup=void 0,(p=exports.ConnectionGroup||(exports.ConnectionGroup={})).Storages="storages_connections_group",p.Webhooks="webhooks_connections_group",p.Unknown="unknown_connections_group",p.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,(d=exports.ExtensionType||(exports.ExtensionType={})).App="app",d.File="file",d.WorkDir="work_dir",exports.ExtensionFileMode=void 0,(u=exports.ExtensionFileMode||(exports.ExtensionFileMode={})).Read="read",u.ReadAndWrite="read_and_write",u.Write="write",exports.DivideScope=void 0,(h=exports.DivideScope||(exports.DivideScope={})).Storage="/storage/element",h.Connection="/connections",exports.PermissionType=void 0,(g=exports.PermissionType||(exports.PermissionType={})).CLOSE="",g.READ="r",g.WRITE="rw",exports.RestrictionStatus=void 0,(_=exports.RestrictionStatus||(exports.RestrictionStatus={})).WAITING="waiting",_.APPROVED="approved",_.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,(m=exports.LicenseError||(exports.LicenseError={})).NotActivated="License not activated",m.Blocked="License blocked",m.Expired="License has been expired",m.NotValid="License not valid",m.NotFound="license file not found",exports.LimitationType=void 0,(f=exports.LimitationType||(exports.LimitationType={})).BySize="size",f.ByExt="extension",f.ByQuota="quota_size",exports.LimitationSubType=void 0,(y=exports.LimitationSubType||(exports.LimitationSubType={})).Size="size",y.White="extension_white",y.Black="extension_black",exports.NotificationEntityType=void 0,(k=exports.NotificationEntityType||(exports.NotificationEntityType={})).Dir="dir",k.File="file",k.User="user",k.Other="other",k.WorkDir="work_dir",k.License="license",k.Extension="extension",k.Connection="connection",exports.NotificationAction=void 0,(w=exports.NotificationAction||(exports.NotificationAction={})).SecurityCheckNegative="action_security_check_negative",w.SecurityCheckPositive="action_security_check_positive",w.CommentVersionMention="action_version_comment_mention",w.OpenSharing="open_sharing",w.ChangeSharing="change_sharing",w.CancelSharing="cancel_sharing",w.DivideDirAddFileToOwner="divide_dir_add_file_to_owner",w.DivideDirAddDirToOwner="divide_dir_add_dir_to_owner",w.DivideDirAddWorkDirToOwner="divide_dir_add_work_dir_to_owner",w.DivideConnectionAddFileToOwner="divide_connection_add_file_to_owner",w.DivideConnectionAddDirToOwner="divide_connection_add_dir_to_owner",w.CancelDivideDir="cancel_divide_dir",w.CancelDivideFile="cancel_divide_file",w.CancelDivideWorkDir="cancel_divide_work_dir",w.CancelDivideConnection="cancel_divide_connection",w.DeleteExtension="delete_extension",w.NewVersionExtension="new_version_extension",w.TransferData="transfer_data",w.AllowInternalAccessUser="allow_internal_access_to_user",w.BlockInternalAccessUser="block_internal_access_to_user",w.WaitInternalAccessUser="wait_internal_access_to_user",w.WaitInternalAccessUserCreate="wait_internal_access_to_user_create",w.AllowInternalAccessGroup="allow_internal_access_to_group",w.BlockInternalAccessGroup="block_internal_access_to_group",w.WaitInternalAccessGroup="wait_internal_access_to_group",w.WaitInternalAccessGroupCreate="wait_internal_access_to_group_create",w.AllowSharing="allow_sharing",w.BlockSharing="block_sharing",w.WaitSharing="wait_sharing",w.WaitSharingCreate="wait_sharing_create",w.StatusCreateZipProcess="status_create_zip_process",w.StatusCreateZipSuccess="status_create_zip_success",w.StatusCreateZipError="status_create_zip_error",w.DownloadZipSuccess="download_zip_success",w.DownloadZipError="download_zip_error",w.StatusUnzipProcess="status_unzip_process",w.StatusUnzipSuccess="status_unzip_success",w.StatusUnzipError="status_unzip_error",w.StatusUnzipSuccessWithLimits="status_unzip_success_with_limits",w.AnonymZipDirAddFileToOwner="anonym_zip_dir_add_file_to_owner",w.GuestZipDirAddFileToOwner="guest_zip_dir_add_file_to_owner",w.DropDocumentOnlyoffice="drop_document_onlyoffice",w.CopyError="copy_error",w.CopySuccess="copy_success",w.StatusCopyProcess="status_copy_process",w.Other="other",exports.NotificationRowAction=void 0,(A=exports.NotificationRowAction||(exports.NotificationRowAction={})).Read="read",A.Unread="unread",A.Delete="delete",exports.NotificationStyle=void 0,(b=exports.NotificationStyle||(exports.NotificationStyle={})).Plain="plain",b.Success="success",b.Info="info",b.Warning="warning",b.Error="error",exports.ResponseType=void 0,(T=exports.ResponseType||(exports.ResponseType={})).ArrayBuffer="arraybuffer",T.Blob="blob",T.Json="json",T.Text="text",exports.RequestMethod=void 0,(R=exports.RequestMethod||(exports.RequestMethod={})).GET="GET",R.POST="POST",R.PUT="PUT",R.PATCH="PATCH",R.DELETE="DELETE",R.HEAD="HEAD",exports.RequestObserve=void 0,(C=exports.RequestObserve||(exports.RequestObserve={})).Body="body",C.Response="response",exports.RestrictionSharing=void 0,(E=exports.RestrictionSharing||(exports.RestrictionSharing={})).NONE="none",E.SOFT="soft",E.HARD="hard",exports.UserAuthType=void 0,(D=exports.UserAuthType||(exports.UserAuthType={})).Native="native",D.Ldap="ldap",D.Vk="vk",exports.UserStatus=void 0,(U=exports.UserStatus||(exports.UserStatus={})).Registering="registering",U.Activated="activated",U.BlockedByAdmin="blocked_by_admin",U.BlockedByLicense="blocked_by_license",U.BlockedByInactive="blocked_by_inactive",U.BlockedByInactiveChangePassword="blocked_by_inactive_change_password",exports.UserType=void 0,(P=exports.UserType||(exports.UserType={})).User="user",P.Guest="guest",P.Emperor="emperor",P.Anonymous="anonymous",exports.UserParamsLabel=void 0,(O=exports.UserParamsLabel||(exports.UserParamsLabel={})).Theme="theme",O.Lang="lang",O.Sort="sort",O.ViewApps="viewApps",O.WithoutContentWorkDir="withoutContentWorkDir",O.DashboardGrid="dashboardGrid",exports.UserAppType=void 0,(exports.UserAppType||(exports.UserAppType={})).Webdav="webdav",exports.SettingControlType=void 0,(L=exports.SettingControlType||(exports.SettingControlType={})).Text="text",L.String="string",L.Number="number",L.CheckBox="checkbox",L.Select="select",L.RadioList="radio_list",L.ConnectionChoose="connection_choose",L.MultiConnectionChoose="multi_connection_choose",exports.StorageElementType=void 0,(I=exports.StorageElementType||(exports.StorageElementType={})).Dir="dir",I.File="file",I.WorkDir="work_dir",I.App="app",exports.StorageElementContentType=void 0,(N=exports.StorageElementContentType||(exports.StorageElementContentType={})).Any="any",N.Dir="dir",N.Code="code",N.Image="image",N.Audio="audio",N.Video="video",N.Text="text",N.Doc="doc",N.Xls="xls",N.Ppt="ppt",exports.StorageRoot=void 0,(q=exports.StorageRoot||(exports.StorageRoot={})).my="my",q.fca="fca",q.divide="divide",q.share="share",q.favorite="favorite",q.trash="trash",exports.StorageElementHistoryAction=void 0,(z=exports.StorageElementHistoryAction||(exports.StorageElementHistoryAction={})).Create="create",z.Update="update",z.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 M="/connections",B=`${M}/dashboard`;class W{constructor(e){this.client=e}list(e){return this.client.rest.get(M,e)}get(e){return this.client.rest.get(`${M}/${e}`)}update(e,t){return this.client.rest.put(`${M}/${e}`,t)}delete(e){return this.client.rest.delete(`${M}/${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]||M,e)}dashboard(e){return this.client.rest.get(B,e)}}class F{constructor(e){this.client=e}discovery(e){return this.client.rest.get("/discovery",e)}}const H="/divide",G=`${H}/restrictions`;class V{constructor(e){this.client=e}divideDelete(e,t){return this.client.rest.delete(`${e}${H}/${t}`)}divideDeleteAll(e,t,s,r){return this.client.rest.delete(`${e}${H}`,Object.assign(Object.assign({},this.makeParam(e,t)),{is_to_user_group:r,access_mode:s}))}divideChange(e,t,s){return this.client.rest.put(`${e}${H}/${t}`,{access_mode:s})}divideCreate(e,t,s,r,i){const n=Object.assign(Object.assign({},this.makeParam(e,t)),{[i]:s,access_mode:r});return this.client.rest.post(`${e}${H}`,n)}divideUsers(e,t,s){return this.client.rest.get(`${e}${H}/users`,Object.assign(Object.assign({},this.makeParam(e,t)),s))}getRestriction(e){return this.client.rest.get(`${G}/${e}`)}restrictionSize(e,t){return this.client.rest.get(`/${t}/restrictions/${e}/size`)}restrictions(e){return this.client.rest.get(`${G}`,e)}restrictionsChange(e,t){return this.client.rest.put(`${G}/${e}`,t)}makeParam(e,t){const s={};return e===exports.DivideScope.Connection?s.connection_id=t:s.path=t,s}}function Z(e,t,s,r){return new(s||(s=Promise))((function(i,n){function o(e){try{a(r.next(e))}catch(e){n(e)}}function c(e){try{a(r.throw(e))}catch(e){n(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,c)}a((r=r.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class J extends Error{}function K(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 Q(e,t){if("string"!=typeof e)throw new J("Invalid token specified: must be a string");t||(t={});const s=!0===t.header?0:1,r=e.split(".")[s];if("string"!=typeof r)throw new J(`Invalid token specified: missing part #${s+1}`);let i;try{i=K(r)}catch(e){throw new J(`Invalid token specified: invalid base64 for part #${s+1} (${e.message})`)}try{return JSON.parse(i)}catch(e){throw new J(`Invalid token specified: invalid json for part #${s+1} (${e.message})`)}}J.prototype.name="InvalidTokenError";const X=(e,t)=>Z(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 Y(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 ee=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 te(e){return e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):e}function se(e){return e?e instanceof FormData||e instanceof Blob||e instanceof ArrayBuffer||e instanceof URLSearchParams||e instanceof Document||ArrayBuffer.isView(e)?e:"object"==typeof e?JSON.stringify(e):"string"==typeof e?e:null:null}const re="update black token";class ie{constructor(){this.isUpdating=!1,this.tokenUpdateResolve=null}isTokenExpire(e){if(!e)return!1;return 1e3*e<=(new Date).getTime()+3e3}refreshToken(e,t){return Z(this,void 0,void 0,(function*(){const{access_token:s,refresh_token:r}=e;return s&&r?this.isUpdating?this.waitForTokenUpdate():(this.isUpdating=!0,new Promise(((e,i)=>{const n=new XMLHttpRequest,o=`${t}${ne}/login/update`;n.open("POST",o,!0),n.setRequestHeader("Content-Type","application/json"),n.send(JSON.stringify({access_token:s,refresh_token:r})),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};Y("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 e(null)},n.onerror=()=>{i(new Error("Network error occurred"))},n.onloadend=()=>{this.isUpdating=!1}}))):null}))}waitForTokenUpdate(){return Z(this,void 0,void 0,(function*(){return new Promise((e=>{const t=setInterval((()=>{this.isUpdating||(clearInterval(t),e())}),100)}))}))}}const ne="/api/v1",oe="/api/v2";class ce{constructor(e,t){this.client=e,this.tokenUpdate=t,this.baseHost=""}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))}head(e,t,s){return this.request(exports.RequestMethod.HEAD,e,Object.assign({params:t},s))}upload(e,t,s){const r=new AbortController,i=r.signal;return{promise:this.request(exports.RequestMethod.POST,e,Object.assign({body:t,signal:i},s)),abort:()=>r.abort()}}request(e,t,s){return new Promise(((r,i)=>{var n;const o=null!==(n=this.state.skipInterceptors)&&void 0!==n&&n;this.state.skipInterceptors=!1;let c=Object.assign({method:e},s);(null==s?void 0:s.signal)&&(c.signal=s.signal);(()=>Z(this,void 0,void 0,(function*(){var s,n,a,p;if(o||(c=null!==(s=yield X(this.client.requestInterceptors,c))&&void 0!==s?s:c),this.state.authToken)for(const[e,s]of this.state.authToken.entries()){const r=Q(s.access_token);if(r&&r.is_remember&&this.tokenUpdate.isTokenExpire(r.exp)&&!t.includes("/login")&&!t.includes("/assets")){const t=yield this.tokenUpdate.refreshToken(s,this.baseHost);t&&(this.state.authToken.set(e,t),c=null!==(n=yield X(this.client.requestInterceptors,c))&&void 0!==n?n:c)}}const l=new XMLHttpRequest;c.params&&Object.keys(c.params).length&&(t+="?"+ee(c.params));const d=null!==(a=c.host)&&void 0!==a?a:this.state.clientParams.host,u=`${d}${null!==(p=c.version)&&void 0!==p?p:this.state.clientParams.version}${t}`;if(l.open(e,u,!0),c.headers){const e=te(c.headers);for(const[t,s]of Object.entries(e))(d===this.baseHost||"content-type"!==t.toLowerCase())&&l.setRequestHeader(t,s)}c.responseType&&(l.responseType=c.responseType),c.signal&&c.signal.addEventListener("abort",(()=>{l.abort(),i(new Error("Request aborted"))})),!l.upload||e!==exports.RequestMethod.POST&&e!==exports.RequestMethod.PUT&&e!==exports.RequestMethod.PATCH||(l.upload.onprogress=e=>{e.lengthComputable&&c.onUploadProgress&&c.onUploadProgress(e)}),l.onload=()=>Z(this,void 0,void 0,(function*(){if(c.signal&&c.signal.aborted)return;let e;switch(c.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,r]=e.split(": ");s&&r&&t.append(s,r)}));const s={status:l.status,statusText:l.statusText,headers:t,url:l.responseURL};if(l.status>=200&&l.status<300)return yield X(this.client.responseInterceptors,s),void(c.observe===exports.RequestObserve.Response?r(Object.assign(Object.assign({},s),{body:e})):r(e));if(this.state.authToken&&(null==e?void 0:e.code)===re){const e=yield this.tokenUpdate.refreshToken(this.state.authToken.get(0),this.baseHost);e&&this.state.authToken.set(0,e)}const n=Object.assign(Object.assign({},s),{error:e});yield X(this.client.responseInterceptors,n),i(n)})),l.onerror=()=>{i({status:l.status,statusText:l.statusText,url:l.responseURL,error:"Network error"})},l.send(se(c.body))})))().catch(i)}))}}const ae="/static/extensions",pe="/extensions/defaults",le=`${ae}/names/users`,de=`${ae}/names/system`,ue=`${ae}/tags`;class he{constructor(e){this.client=e}getSetting(e){return this.client.rest.get(`${ae}/${e}/settings`)}setSetting(e,t){return this.client.rest.post(`${ae}/${e}/settings`,t)}deleteSetting(e){return this.client.rest.delete(`${ae}/${e}/settings`)}get(e){return this.client.rest.get(`${ae}/${e}`)}getByKey(e){return this.client.rest.get(`${ae}/${e}`)}getDefault(e=[]){return this.client.rest.get(pe,{ext_code:e})}setDefault(e,t){return this.client.rest.post(pe,{ext_code:e,ext_uniq_key:t})}checkUpdates(){return this.client.rest.post(`${ae}/check_updates`)}updateVersion(e,t){return this.client.rest.put(`${ae}/${e}`,{version:t})}list(e){return this.client.rest.get(ae,e)}listTags(e){return this.client.rest.get(ue,e)}delete(e,t){return this.client.rest.delete(`${ae}/${e}`)}upload(e,t){const s=new FormData;s.set("file",t);const{promise:r,abort:i}=this.client.rest.upload(ae,s,{version:oe,onUploadProgress:t=>{e(t)}});return{promise:r,abort:i}}install(e,t){return this.client.rest.post(`${ae}/site`,{uniq_key:e,version:t},{version:oe})}getSystemNameExts(e){return this.client.rest.get(de,e)}getUserNameExts(e){return this.client.rest.get(le,e)}createUserNameExt(e){return this.client.rest.post(`${le}`,{name:e})}deleteUserNameExt(e){return this.client.rest.delete(`${le}/${e}`)}deleteAllUserNameExts(){return this.client.rest.delete(`${le}`)}}const ge="/anons_ext/extensions";class _e{constructor(e){this.client=e}listExtensionsSite(e){return this.client.rest.get(ge,e,{host:"https://next-box.ru"})}extensionDetailSite(e){return this.client.rest.get(`${ge}/${e}`,{},{host:"https://next-box.ru"})}extensionMarkdown(e,t){return this.client.rest.get(`${ge}/${e.uniqKey}/readme`,{lang:e.lang},Object.assign(Object.assign({},t),{host:"https://next-box.ru"}))}}const xe="/disk",ve=`${xe}/check`;class Se{constructor(e){this.client=e}info(e,t){return this.client.rest.get(`${xe}/${e}/element`,{path:t})}list(e,t){return this.client.rest.get(`${xe}/${e}`,t)}create(e,t){return this.client.rest.post(`${xe}/${e}/element`,t)}replace(e,t,s){return this.client.rest.put(`${xe}/${e}/files?path=${t}`,s)}read(e,t){return this.client.rest.get(`${xe}/${e}/files?path=${t}`)}upload(e,t,s,r=""){const i=new FormData;i.set("path",r),i.set("file",s);const{promise:n,abort:o}=this.client.rest.upload(`${xe}/${t}/files`,i,{onUploadProgress:t=>{e(t)}});return{promise:n,abort:o}}uploadNet(e,t){return this.client.rest.post(`${xe}/${e}/files/net`,t)}delete(e,t){return this.client.rest.delete(`${xe}/${e}/trash/element`,{path:t})}check(e){return this.client.rest.post(ve,e)}}const $e="/settings";class me{constructor(e){this.client=e}settings(){return this.client.rest.get($e)}changeSettings(e){return this.client.rest.post($e,e)}queryInit(){return this.client.rest.get("/query/init")}}var fe;exports.QueryInitViewType=void 0,(fe=exports.QueryInitViewType||(exports.QueryInitViewType={})).Standard="Standard",fe.Simple="Simple";const ye="/groups";class ke{constructor(e){this.client=e}list(e){return this.client.rest.get(ye,e)}listUsers(e,t){return this.client.rest.get(`${ye}/${e}/users`,t)}create(e){return this.client.rest.post(ye,e)}update(e,t){return this.client.rest.put(`${ye}/${e}`,t)}delete(e){return this.client.rest.delete(`${ye}/${e}`)}}const we="/license",Ae=`${we}/manual-check`,be=`${we}/hardware/hash`;class Te{constructor(e){this.client=e}info(){return this.client.rest.get(we)}create(e){return this.client.rest.post(we,e)}check(){return this.client.rest.post(Ae)}delete(){return this.client.rest.delete(we)}getHash(){return this.client.rest.get(be)}}const Re="/links";class Ce{constructor(e){this.client=e}createShortLink(e){return this.client.rest.post(Re,e)}updateShortLink(e){return this.client.rest.put(Re,e)}}const Ee="/limitations";class De{constructor(e){this.client=e}me(){return this.client.rest.get("/limitations/user/me")}list(e){return this.client.rest.get(Ee,e)}listUsers(e,t){return this.client.rest.get(`${Ee}/${e}/users`,t)}create(e){return this.client.rest.post(Ee,e)}get(e){return this.client.rest.get(`${Ee}/${e}`)}update(e,t){return this.client.rest.put(`${Ee}/${e}`,t)}delete(e){return this.client.rest.delete(`${Ee}/${e}`)}getLimitationsByUser(e){return this.client.rest.get(`/limitations/user/${e}`)}addUserToLimitation(e,t){return this.client.rest.patch(`${Ee}/${e}/user`,{id:t})}deleteUserFromLimitation(e,t){return this.client.rest.delete(`${Ee}/${e}/user/${t}`)}}class Ue{constructor(e){this.client=e}getUsersLogs(e){return this.client.rest.get("/logs/users",e)}}const Pe="/notifications",Oe=`${Pe}/all`,Le=`${Pe}/subscription`,Ie=`${Pe}/permission`;class Ne{constructor(e){this.client=e}list(e){return this.client.rest.get(Pe,e)}toggleStatus(e,t){return this.client.rest.put(Pe,{ids:e,to_status:t})}toggleAllStatus(e){return this.client.rest.put(Oe,{to_status:e})}delete(e){return this.client.rest.delete(Pe,{id:e})}deleteAll(){return this.client.rest.delete(Oe)}getPermission(){return this.client.rest.get(Ie)}setPermission(e){return this.client.rest.post(Ie,{enabled:e})}getSubscription(){return this.client.rest.get(Le)}setSubscription(e){const t={action_groups:Object.assign({},e)};return this.client.rest.post(Le,t)}}const qe="/roles",ze=`${qe}/default`,je="/permissions";class Me{constructor(e){this.client=e}list(e){return this.client.rest.get(qe,e)}get(e){return this.client.rest.get(`${qe}/${e}`)}getDefault(){return this.client.rest.get(`${ze}`)}create(e){return this.client.rest.post(qe,e)}update(e,t){return this.client.rest.put(`${qe}/${e}`,t)}delete(e){return this.client.rest.delete(`${qe}/${e}`)}permissionList(){return this.client.rest.get(je)}addPermission(e,t){return this.client.rest.put(`${qe}/${e}/permissions`,{ids:t})}deletePermission(e,t){return this.client.rest.delete(`${qe}/${e}/${je}`,{ids:t})}}const Be="/share",We=`${Be}/restrictions`,Fe=`${Be}/login`;class He{constructor(e){this.client=e}info(e){return this.client.rest.get(`${Be}?share_token=${e}`)}checkPassword(e,t){const s=encodeURIComponent(e);return this.client.rest.get(`${Be}/password?share_token=${t}&share_pass=${s}`)}getRestriction(e){return this.client.rest.get(`${We}/${e}`)}restrictions(e){return this.client.rest.get(We,e)}restrictionsChange(e,t){return this.client.rest.put(`${We}/${e}`,t)}login(e){return this.client.rest.post(`${Fe}`,e)}}const Ge="/storage/element/version/comment",Ve=`${Ge}/all`;class Ze{constructor(e){this.client=e}list(e){return this.client.rest.get(`${Ge}`,e)}create(e){return this.client.rest.post(`${Ge}`,e)}update(e){return this.client.rest.put(`${Ge}`,e)}delete(e){return this.client.rest.delete(`${Ge}`,e)}deleteAll(e){return this.client.rest.delete(`${Ve}`,e)}}const Je="/storage",Ke=`${Je}/element`,Qe=`${Ke}/divide/resource`,Xe=`${Ke}/move`,Ye=`${Ke}/copy`,et=`${Ke}/content_type_size`,tt="/disk";class st{constructor(e,t){this.client=e,this.fcaApiService=t}list(e){return this.client.rest.get(Je,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,e.zip_entry_path||delete e.zip_entry_path,this.client.rest.get(Ke,e)}fileInfo(e,t){return this.client.rest.get(`${Ke}/${e}`,t?{file_version_id:t}:{})}combineInfo({root:e,rootId:t,path:s,file_version_id:r,zip_entry_path:i}){return e===exports.StorageRoot.fca&&t?this.fcaApiService.info(t,s):this.info({path:s,divide_id:t,file_version_id:r,zip_entry_path:i})}size(e){return this.client.rest.post(`${Ke}/size`,e)}move(e,t,s){const{from_divide_id:r,to_divide_id:i}=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(`${tt}/${r}/files/move${tt}/${i}`,n):t===exports.StorageRoot.fca?(r&&(n.from_divide_id=r),this.client.rest.put(`${tt}/${i}/files/from/box`,n)):s===exports.StorageRoot.fca?(i&&(n.to_divide_id=i),this.client.rest.put(`${tt}/${r}/files/to/box`,n)):this.client.rest.post(Xe,e)}copy(e,t,s){const{from_divide_id:r,to_divide_id:i}=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(`${tt}/${r}/files/copy${tt}/${i}`,n):s===exports.StorageRoot.fca?(r&&(n.from_divide_id=r),this.client.rest.post(`${tt}/${i}/files/from/box`,n)):t===exports.StorageRoot.fca?(i&&(n.to_divide_id=i),this.client.rest.post(`${tt}/${r}/files/to/box`,n)):this.client.rest.post(Ye,e)}pasteFromShared(e,t,s){const r={from_sharing_token:e,from_sharing_password:s,paths:t};return this.client.rest.post(`${Ke}/copy`,r)}create(e){return this.client.rest.post(Ke,e)}delete(e,t){const s={path:e};return t&&(s.divide_id=t),this.client.rest.delete(Ke,s)}favorite(e){return this.client.rest.put(`${Ke}?path=${encodeURIComponent(e)}`,{is_favorite:!0})}removeFavorite(e){return this.client.rest.put(`${Ke}?path=${encodeURIComponent(e)}`,{is_favorite:!1})}createItem(e){return this.client.rest.post(Ke,e)}createWorkDir(e){return this.client.rest.post(Ke,e)}sizeWithSection(e){return this.client.rest.get(et,e)}getDivideResources(e){return this.client.rest.get(Qe,e)}getQuota(e){return this.client.rest.get(`${Ke}/user_size`,e)}}const rt="/storage/files",it=`${rt}/net`,nt=`${rt}/unzip`,ot=`${rt}/zip`,ct=`${ot}/download`,at=`${rt}/process`,pt=`${rt}/code`;class lt{constructor(e){this.client=e}read(e,t){return t.path=e,this.client.rest.get(rt,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(`${rt}?${s.toString()}`,t)}upload(e,t,s,r){const i=new FormData;i.set("path",s),r&&i.set("divide_id",r.toString()),i.set("file",t);const{promise:n,abort:o}=this.client.rest.upload(rt,i,{onUploadProgress:t=>{e(t)}});return{promise:n,abort:o}}uploadNet(e){return this.client.rest.post(it,e)}createZipToDownload(e){var t;const s=-(new Date).getTimezoneOffset()/60;return null!==(t=e.time_zone)&&void 0!==t||(e.time_zone=s),this.client.rest.post(ct,e)}createZip(e){var t;const s=-(new Date).getTimezoneOffset()/60;return null!==(t=e.time_zone)&&void 0!==t||(e.time_zone=s),this.client.rest.post(ot,e)}cancelProcess(e){return this.client.rest.delete(at,e)}unZip(e){return this.client.rest.post(nt,e)}checkZip(e){return this.client.rest.head(pt,e)}}class dt{constructor(e){this.client=e}instance(){return this.client.rest.get("/storage/instance")}}const ut="/storage/element/share";class ht{constructor(e){this.client=e}info(e){return this.client.rest.get(ut,{path:e})}create(e,t){const s={path:e,permissions_type:t};return this.client.rest.post(ut,s)}change(e){return this.client.rest.put(`${ut}/${e.token}`,e)}delete(e){return this.client.rest.delete(ut,{path:e})}refresh(e){return this.client.rest.put(`${ut}/${e}/refresh`)}}const gt="/storage/trash/element",_t=`${gt}/all`;class xt{constructor(e){this.client=e}clear(e){return this.client.rest.delete(gt,e)}clearAll(){return this.client.rest.delete(_t)}restore(e){return this.client.rest.patch(gt,{del_groups:e})}restoreAll(){return this.client.rest.patch(_t)}}const vt="/users",St=`${vt}/me`,$t=`${St}/avatars`,mt=`${St}/sessions`,ft=`${St}/tokens`,yt=`${St}/params`,kt=`${St}/app-passwords`,wt=`${St}/change-password`,At=`${vt}/initial`,bt=`${St}/phone`,Tt=`${bt}/confirm`;class Rt{constructor(e){this.client=e}initial(e){return this.client.rest.post(At,e)}list(e){return this.client.rest.get(vt,e)}get(e){return this.client.rest.get(vt+`/${e}`)}create(e){return this.client.rest.post(vt,e)}update(e,t){return this.client.rest.put(vt+`/${e}`,t)}delete(e,t){return this.client.rest.delete(`${vt}/${e}`,t)}restore(e){return this.client.rest.post(`${vt}/${e}/restore`)}me(){return this.client.rest.get(St)}updateMe(e){return this.client.rest.put(St,e)}createToken(e){return this.client.rest.post(ft,e)}listToken(e){return this.client.rest.get(ft,e)}deleteToken(e){return this.client.rest.delete(`${ft}/${e}`)}changeMyPassword(e){return this.client.rest.put(wt,e)}changeUsersPassword(e,t){return this.client.rest.put(`${vt}/${e}/change-password`,t)}meUploadAvatar(e,t){const s=new FormData;return s.append("file",e,t),this.client.rest.post($t,s)}meDeleteAvatar(){return this.client.rest.delete($t)}meListSession(e){return this.client.rest.get(mt,e)}meDeleteSession(e){let t=mt;return e&&(t+=`/${e}`),this.client.rest.delete(t)}setRole(e,t=null){return this.client.rest.put(`${vt}/${e}/roles`,{role_id:t})}meParams(e){return this.client.rest.get(yt,{name:e})}meSetParams(e,t){return this.client.rest.post(`${yt}/${e}`,t)}meListParams(){return this.client.rest.get(yt)}phone(e){return this.client.rest.post(bt,e)}phoneConfirm(e){return this.client.rest.post(`${Tt}/${e}`)}appPasswordsList(e){return this.client.rest.get(kt,e)}createAppPasswords(e){return this.client.rest.post(kt,e)}deleteAppPasswords(e){return this.client.rest.delete(`${kt}/${e}`)}}const Ct="/storage/element",Et=`${Ct}/history`,Dt=`${Ct}/version`,Ut=`${Dt}/lock`,Pt=`${Dt}/unlock`,Ot=`${Dt}/current`,Lt=`${Dt}/size`;class It{constructor(e){this.client=e}history(e){return this.client.rest.get(Et,e)}versions(e){return this.client.rest.get(Dt,e)}create(e){return this.client.rest.post(Dt,e)}edit(e){return this.client.rest.put(Dt,e)}delete(e){return this.client.rest.delete(Dt,e)}size(e){return this.client.rest.get(Lt,e)}makeCurrent(e){return this.client.rest.post(Ot,e)}lock(e){return this.client.rest.post(Ut,e)}unlock(e){return this.client.rest.post(Pt,e)}}exports.AuthApiService=i,exports.BASE_URL_V1=ne,exports.BASE_URL_V2=oe,exports.CONNECTIONS_PERMISSION=o,exports.Client=class{constructor(e){this.AuthApiService=new i(this),this.ConnectionsApiService=new W(this),this.DiscoveryApiService=new F(this),this.DivideApiService=new V(this),this.ExtensionsApiService=new he(this),this.ExtensionsExternalApiService=new _e(this),this.FcaApiService=new Se(this),this.GatewayApiService=new me(this),this.GroupApiService=new ke(this),this.LicenseApiService=new Te(this),this.LinksApiService=new Ce(this),this.LimitationsApiService=new De(this),this.LogstashApiService=new Ue(this),this.NotificationApiService=new Ne(this),this.RoleApiService=new Me(this),this.ShareApiService=new He(this),this.StorageCommentApiService=new Ze(this),this.StorageElementApiService=new st(this,this.FcaApiService),this.StorageFilesApiService=new lt(this),this.StorageInstanceApiService=new dt(this),this.StorageShareApiService=new ht(this),this.StorageTrashApiService=new xt(this),this.UserApiService=new Rt(this),this.VersionApiService=new It(this),this.tokenUpdate=new ie,this.rest=new ce(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,version:(null==e?void 0:e.version)||ne},requestParams:{path:"",headers:{},query:{},body:null,cache:"no-cache"},authToken:null,skipInterceptors:!1},this.rest.baseHost=this.state.clientParams.host||""}},exports.ConnectionsApiService=W,exports.DiscoveryApiService=F,exports.DivideApiService=V,exports.ExtensionsApiService=he,exports.ExtensionsExternalApiService=_e,exports.FcaApiService=Se,exports.GatewayApiService=me,exports.GroupApiService=ke,exports.LicenseApiService=Te,exports.LimitationsApiService=De,exports.LinksApiService=Ce,exports.LogstashApiService=Ue,exports.NEED_TOKEN_UPDATE_ERROR=re,exports.NotificationApiService=Ne,exports.Rest=ce,exports.RoleApiService=Me,exports.ShareApiService=He,exports.StorageCommentApiService=Ze,exports.StorageElementApiService=st,exports.StorageFilesApiService=lt,exports.StorageInstanceApiService=dt,exports.StorageShareApiService=ht,exports.StorageTrashApiService=xt,exports.TokenUpdate=ie,exports.UserApiService=Rt,exports.VersionApiService=It,exports.applyInterceptors=X,exports.getCookieValue=Y,exports.makeUrlParams=ee,exports.normalizeHeaders=te,exports.prepareRequestBody=se;
@@ -1 +1 @@
1
- const e="/login",t=`${e}/ldap`,s=`${e}/update`,i=`${e}/tfa`;class n{constructor(e){this.client=e}info(){return this.client.rest.get(e)}login(t){return this.client.rest.post(e,t)}ldapLogin(e){return this.client.rest.post(t,e)}loginTfa(e){return this.client.rest.post(i,e)}updateToken(e){const t=e.path?`${e.path}/${s}`:s;return e.path&&delete e.path,this.client.rest.post(t,e)}logout(){return this.client.rest.post("/logout")}}var r;!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.LimitationsRead="limitations_read",e.LimitationsEdit="limitations_edit",e.ReadUserLogs="read_user_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"}(r||(r={}));const o=[r.ConnectionsYandexDisk,r.ConnectionsSsh,r.ConnectionsMail,r.ConnectionsS3,r.ConnectionsS3,r.ConnectionsDiscord,r.ConnectionsWebdav,r.ConnectionsNextcloud,r.ConnectionsNextbox,r.ConnectionsHttpProxy];var c,a,l,u,d,h,p,_,g,f,$,v,m,k,w,S,b,y,x,A,C,D,T,U,E,P,O,R,I,L,j,z,N,W,B;!function(e){e.DEFAULT="",e.ASC="asc",e.DESC="desc"}(c||(c={})),function(e){e.WebSocket="websocket",e.PostMessage="postmessage",e.Empty=""}(a||(a={})),function(e){e.Storages="storages_connections_group",e.Webhooks="webhooks_connections_group",e.Unknown="unknown_connections_group",e.Proxy="proxy_connections_group"}(l||(l={})),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"}(u||(u={})),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"}(p||(p={})),function(e){e.CLOSE="",e.READ="r",e.WRITE="rw"}(_||(_={})),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"}(m||(m={})),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"}(k||(k={})),function(e){e.BySize="size",e.ByExt="extension",e.ByQuota="quota_size"}(w||(w={})),function(e){e.Size="size",e.White="extension_white",e.Black="extension_black"}(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"}(b||(b={})),function(e){e.SecurityCheckNegative="action_security_check_negative",e.SecurityCheckPositive="action_security_check_positive",e.CommentVersionMention="action_version_comment_mention",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.StatusCreateZipProcess="status_create_zip_process",e.StatusCreateZipSuccess="status_create_zip_success",e.StatusCreateZipError="status_create_zip_error",e.DownloadZipSuccess="download_zip_success",e.DownloadZipError="download_zip_error",e.StatusUnzipProcess="status_unzip_process",e.StatusUnzipSuccess="status_unzip_success",e.StatusUnzipError="status_unzip_error",e.StatusUnzipSuccessWithLimits="status_unzip_success_with_limits",e.AnonymZipDirAddFileToOwner="anonym_zip_dir_add_file_to_owner",e.GuestZipDirAddFileToOwner="guest_zip_dir_add_file_to_owner",e.DropDocumentOnlyoffice="drop_document_onlyoffice",e.CopyError="copy_error",e.CopySuccess="copy_success",e.StatusCopyProcess="status_copy_process",e.Other="other"}(y||(y={})),function(e){e.Read="read",e.Unread="unread",e.Delete="delete"}(x||(x={})),function(e){e.Plain="plain",e.Success="success",e.Info="info",e.Warning="warning",e.Error="error"}(A||(A={})),function(e){e.ArrayBuffer="arraybuffer",e.Blob="blob",e.Json="json",e.Text="text"}(C||(C={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.PATCH="PATCH",e.DELETE="DELETE",e.HEAD="HEAD"}(D||(D={})),function(e){e.Body="body",e.Response="response"}(T||(T={})),function(e){e.NONE="none",e.SOFT="soft",e.HARD="hard"}(U||(U={})),function(e){e.Native="native",e.Ldap="ldap",e.Vk="vk"}(E||(E={})),function(e){e.Registering="registering",e.Activated="activated",e.BlockedByAdmin="blocked_by_admin",e.BlockedByLicense="blocked_by_license",e.BlockedByInactive="blocked_by_inactive",e.BlockedByInactiveChangePassword="blocked_by_inactive_change_password"}(P||(P={})),function(e){e.User="user",e.Guest="guest",e.Emperor="emperor",e.Anonymous="anonymous"}(O||(O={})),function(e){e.Theme="theme",e.Lang="lang",e.Sort="sort",e.ViewApps="viewApps",e.WithoutContentWorkDir="withoutContentWorkDir",e.DashboardGrid="dashboardGrid"}(R||(R={})),function(e){e.Webdav="webdav"}(I||(I={})),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"}(L||(L={})),function(e){e.Dir="dir",e.File="file",e.WorkDir="work_dir",e.App="app"}(j||(j={})),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"}(z||(z={})),function(e){e.my="my",e.fca="fca",e.divide="divide",e.share="share",e.favorite="favorite",e.trash="trash"}(N||(N={})),function(e){e.Create="create",e.Update="update",e.Move="move"}(W||(W={})),function(e){e[e.CheckNull=0]="CheckNull",e[e.CheckInProgress=1]="CheckInProgress",e[e.CheckPositive=2]="CheckPositive",e[e.CheckNegative=3]="CheckNegative"}(B||(B={}));const F="/connections",H=`${F}/dashboard`;class q{constructor(e){this.client=e}list(e){return this.client.rest.get(F,e)}get(e){return this.client.rest.get(`${F}/${e}`)}update(e,t){return this.client.rest.put(`${F}/${e}`,t)}delete(e){return this.client.rest.delete(`${F}/${e}`)}create(e){const t={[u.SSH]:"/disk/ssh",[u.Webdav]:"/disk/webdav",[u.Nextcloud]:"/disk/nextcloud",[u.NextBox]:"/disk/nextbox",[u.Discord]:"/webhooks/discord",[u.Mail]:"/webhooks/mail",[u.HttpProxy]:"/http_proxy",[u.S3]:"/disk/s3"};return this.client.rest.post(t[e.type]||F,e)}dashboard(e){return this.client.rest.get(H,e)}}class G{constructor(e){this.client=e}discovery(e){return this.client.rest.get("/discovery",e)}}const M="/divide",Z=`${M}/restrictions`;class V{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}${M}/${t}`,{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}${M}`,r)}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(`${Z}/${e}`)}restrictionSize(e,t){return this.client.rest.get(`/${t}/restrictions/${e}/size`)}restrictions(e){return this.client.rest.get(`${Z}`,e)}restrictionsChange(e,t){return this.client.rest.put(`${Z}/${e}`,t)}makeParam(e,t){const s={};return e===p.Connection?s.connection_id=t:s.path=t,s}}function J(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 X extends Error{}function Y(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 K(e,t){if("string"!=typeof e)throw new X("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 X(`Invalid token specified: missing part #${s+1}`);let n;try{n=Y(i)}catch(e){throw new X(`Invalid token specified: invalid base64 for part #${s+1} (${e.message})`)}try{return JSON.parse(n)}catch(e){throw new X(`Invalid token specified: invalid json for part #${s+1} (${e.message})`)}}X.prototype.name="InvalidTokenError";const Q=(e,t)=>J(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 ee(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 te=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 se(e){return e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):e}function ie(e){return e?e instanceof FormData||e instanceof Blob||e instanceof ArrayBuffer||e instanceof URLSearchParams||e instanceof Document||ArrayBuffer.isView(e)?e:"object"==typeof e?JSON.stringify(e):"string"==typeof e?e:null:null}const ne="update black token";class re{constructor(){this.isUpdating=!1,this.tokenUpdateResolve=null}isTokenExpire(e){if(!e)return!1;return 1e3*e<=(new Date).getTime()+3e3}refreshToken(e,t){return J(this,void 0,void 0,(function*(){const{access_token:s,refresh_token:i}=e;return s&&i?this.isUpdating?this.waitForTokenUpdate():(this.isUpdating=!0,new Promise(((e,n)=>{const r=new XMLHttpRequest,o=`${t}${oe}/login/update`;r.open("POST",o,!0),r.setRequestHeader("Content-Type","application/json"),r.send(JSON.stringify({access_token:s,refresh_token:i})),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};ee("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){n(new Error("Failed to parse response JSON."))}else e(null)},r.onerror=()=>{n(new Error("Network error occurred"))},r.onloadend=()=>{this.isUpdating=!1}}))):null}))}waitForTokenUpdate(){return J(this,void 0,void 0,(function*(){return new Promise((e=>{const t=setInterval((()=>{this.isUpdating||(clearInterval(t),e())}),100)}))}))}}const oe="/api/v1",ce="/api/v2";class ae{constructor(e,t){this.client=e,this.tokenUpdate=t,this.baseHost=""}get state(){return this.client.state}get(e,t,s){return this.request(D.GET,e,Object.assign({params:t,cache:"no-cache"},s))}post(e,t,s){return this.request(D.POST,e,Object.assign({body:t},s))}put(e,t,s){return this.request(D.PUT,e,Object.assign({body:t,cache:"no-cache"},s))}patch(e,t,s){return this.request(D.PATCH,e,Object.assign({body:t},s))}delete(e,t,s){return this.request(D.DELETE,e,Object.assign({params:t},s))}head(e,t,s){return this.request(D.HEAD,e,Object.assign({params:t},s))}upload(e,t,s){const i=new AbortController,n=i.signal;return{promise:this.request(D.POST,e,Object.assign({body:t,signal:n},s)),abort:()=>i.abort()}}request(e,t,s){return new Promise(((i,n)=>{var r;const o=null!==(r=this.state.skipInterceptors)&&void 0!==r&&r;this.state.skipInterceptors=!1;let c=Object.assign({method:e},s);(null==s?void 0:s.signal)&&(c.signal=s.signal);(()=>J(this,void 0,void 0,(function*(){var s,r,a,l;if(o||(c=null!==(s=yield Q(this.client.requestInterceptors,c))&&void 0!==s?s:c),this.state.authToken)for(const[e,s]of this.state.authToken.entries()){const i=K(s.access_token);if(i&&i.is_remember&&this.tokenUpdate.isTokenExpire(i.exp)&&!t.includes("/login")&&!t.includes("/assets")){const t=yield this.tokenUpdate.refreshToken(s,this.baseHost);t&&(this.state.authToken.set(e,t),c=null!==(r=yield Q(this.client.requestInterceptors,c))&&void 0!==r?r:c)}}const u=new XMLHttpRequest;c.params&&Object.keys(c.params).length&&(t+="?"+te(c.params));const d=null!==(a=c.host)&&void 0!==a?a:this.state.clientParams.host,h=`${d}${null!==(l=c.version)&&void 0!==l?l:this.state.clientParams.version}${t}`;if(u.open(e,h,!0),c.headers){const e=se(c.headers);for(const[t,s]of Object.entries(e))(d===this.baseHost||"content-type"!==t.toLowerCase())&&u.setRequestHeader(t,s)}c.responseType&&(u.responseType=c.responseType),c.signal&&c.signal.addEventListener("abort",(()=>{u.abort(),n(new Error("Request aborted"))})),!u.upload||e!==D.POST&&e!==D.PUT&&e!==D.PATCH||(u.upload.onprogress=e=>{e.lengthComputable&&c.onUploadProgress&&c.onUploadProgress(e)}),u.onload=()=>J(this,void 0,void 0,(function*(){if(c.signal&&c.signal.aborted)return;let e;switch(c.responseType){case C.Text:e=u.responseText;break;case C.Blob:case C.ArrayBuffer:e=u.response;break;default:try{e=JSON.parse(u.responseText)}catch(t){e=u.responseText}}const t=new Headers;u.getAllResponseHeaders().split("\r\n").forEach((e=>{const[s,i]=e.split(": ");s&&i&&t.append(s,i)}));const s={status:u.status,statusText:u.statusText,headers:t,url:u.responseURL};if(u.status>=200&&u.status<300)return yield Q(this.client.responseInterceptors,s),void(c.observe===T.Response?i(Object.assign(Object.assign({},s),{body:e})):i(e));if(this.state.authToken&&(null==e?void 0:e.code)===ne){const e=yield this.tokenUpdate.refreshToken(this.state.authToken.get(0),this.baseHost);e&&this.state.authToken.set(0,e)}const r=Object.assign(Object.assign({},s),{error:e});yield Q(this.client.responseInterceptors,r),n(r)})),u.onerror=()=>{n({status:u.status,statusText:u.statusText,url:u.responseURL,error:"Network error"})},u.send(ie(c.body))})))().catch(n)}))}}class le{constructor(e){this.AuthApiService=new n(this),this.ConnectionsApiService=new q(this),this.DiscoveryApiService=new G(this),this.DivideApiService=new V(this),this.ExtensionsApiService=new ge(this),this.ExtensionsExternalApiService=new $e(this),this.FcaApiService=new ke(this),this.GatewayApiService=new Se(this),this.GroupApiService=new xe(this),this.LicenseApiService=new Te(this),this.LinksApiService=new Ee(this),this.LimitationsApiService=new Oe(this),this.LogstashApiService=new Re(this),this.NotificationApiService=new Ne(this),this.RoleApiService=new He(this),this.ShareApiService=new Ze(this),this.StorageCommentApiService=new Xe(this),this.StorageElementApiService=new nt(this,this.FcaApiService),this.StorageFilesApiService=new ht(this),this.StorageInstanceApiService=new pt(this),this.StorageShareApiService=new gt(this),this.StorageTrashApiService=new vt(this),this.UserApiService=new Ut(this),this.VersionApiService=new zt(this),this.tokenUpdate=new re,this.rest=new ae(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,version:(null==e?void 0:e.version)||oe},requestParams:{path:"",headers:{},query:{},body:null,cache:"no-cache"},authToken:null,skipInterceptors:!1},this.rest.baseHost=this.state.clientParams.host||""}}const ue="/static/extensions",de="/extensions/defaults",he=`${ue}/names/users`,pe=`${ue}/names/system`,_e=`${ue}/tags`;class ge{constructor(e){this.client=e}getSetting(e){return this.client.rest.get(`${ue}/${e}/settings`)}setSetting(e,t){return this.client.rest.post(`${ue}/${e}/settings`,t)}deleteSetting(e){return this.client.rest.delete(`${ue}/${e}/settings`)}get(e){return this.client.rest.get(`${ue}/${e}`)}getByKey(e){return this.client.rest.get(`${ue}/${e}`)}getDefault(e=[]){return this.client.rest.get(de,{ext_code:e})}setDefault(e,t){return this.client.rest.post(de,{ext_code:e,ext_uniq_key:t})}checkUpdates(){return this.client.rest.post(`${ue}/check_updates`)}updateVersion(e,t){return this.client.rest.put(`${ue}/${e}`,{version:t})}list(e){return this.client.rest.get(ue,e)}listTags(e){return this.client.rest.get(_e,e)}delete(e,t){return this.client.rest.delete(`${ue}/${e}`)}upload(e,t){const s=new FormData;s.set("file",t);const{promise:i,abort:n}=this.client.rest.upload(ue,s,{version:ce,onUploadProgress:t=>{e(t)}});return{promise:i,abort:n}}install(e,t){return this.client.rest.post(`${ue}/site`,{uniq_key:e,version:t},{version:ce})}getSystemNameExts(e){return this.client.rest.get(pe,e)}getUserNameExts(e){return this.client.rest.get(he,e)}createUserNameExt(e){return this.client.rest.post(`${he}`,{name:e})}deleteUserNameExt(e){return this.client.rest.delete(`${he}/${e}`)}deleteAllUserNameExts(){return this.client.rest.delete(`${he}`)}}const fe="/anons_ext/extensions";class $e{constructor(e){this.client=e}listExtensionsSite(e){return this.client.rest.get(fe,e,{host:"https://next-box.ru"})}extensionDetailSite(e){return this.client.rest.get(`${fe}/${e}`,{},{host:"https://next-box.ru"})}extensionMarkdown(e,t){return this.client.rest.get(`${fe}/${e.uniqKey}/readme`,{lang:e.lang},Object.assign(Object.assign({},t),{host:"https://next-box.ru"}))}}const ve="/disk",me=`${ve}/check`;class ke{constructor(e){this.client=e}info(e,t){return this.client.rest.get(`${ve}/${e}/element`,{path:t})}list(e,t){return this.client.rest.get(`${ve}/${e}`,t)}create(e,t){return this.client.rest.post(`${ve}/${e}/element`,t)}replace(e,t,s){return this.client.rest.put(`${ve}/${e}/files?path=${t}`,s)}read(e,t){return this.client.rest.get(`${ve}/${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(`${ve}/${t}/files`,n,{onUploadProgress:t=>{e(t)}});return{promise:r,abort:o}}uploadNet(e,t){return this.client.rest.post(`${ve}/${e}/files/net`,t)}delete(e,t){return this.client.rest.delete(`${ve}/${e}/trash/element`,{path:t})}check(e){return this.client.rest.post(me,e)}}const we="/settings";class Se{constructor(e){this.client=e}settings(){return this.client.rest.get(we)}changeSettings(e){return this.client.rest.post(we,e)}queryInit(){return this.client.rest.get("/query/init")}}var be;!function(e){e.Standard="Standard",e.Simple="Simple"}(be||(be={}));const ye="/groups";class xe{constructor(e){this.client=e}list(e){return this.client.rest.get(ye,e)}listUsers(e,t){return this.client.rest.get(`${ye}/${e}/users`,t)}create(e){return this.client.rest.post(ye,e)}update(e,t){return this.client.rest.put(`${ye}/${e}`,t)}delete(e){return this.client.rest.delete(`${ye}/${e}`)}}const Ae="/license",Ce=`${Ae}/manual-check`,De=`${Ae}/hardware/hash`;class Te{constructor(e){this.client=e}info(){return this.client.rest.get(Ae)}create(e){return this.client.rest.post(Ae,e)}check(){return this.client.rest.post(Ce)}delete(){return this.client.rest.delete(Ae)}getHash(){return this.client.rest.get(De)}}const Ue="/links";class Ee{constructor(e){this.client=e}createShortLink(e){return this.client.rest.post(Ue,e)}updateShortLink(e){return this.client.rest.put(Ue,e)}}const Pe="/limitations";class Oe{constructor(e){this.client=e}me(){return this.client.rest.get("/limitations/user/me")}list(e){return this.client.rest.get(Pe,e)}listUsers(e,t){return this.client.rest.get(`${Pe}/${e}/users`,t)}create(e){return this.client.rest.post(Pe,e)}get(e){return this.client.rest.get(`${Pe}/${e}`)}update(e,t){return this.client.rest.put(`${Pe}/${e}`,t)}delete(e){return this.client.rest.delete(`${Pe}/${e}`)}getLimitationsByUser(e){return this.client.rest.get(`/limitations/user/${e}`)}addUserToLimitation(e,t){return this.client.rest.patch(`${Pe}/${e}/user`,{id:t})}deleteUserFromLimitation(e,t){return this.client.rest.delete(`${Pe}/${e}/user/${t}`)}}class Re{constructor(e){this.client=e}getUsersLogs(e){return this.client.rest.get("/logs/users",e)}}const Ie="/notifications",Le=`${Ie}/all`,je=`${Ie}/subscription`,ze=`${Ie}/permission`;class Ne{constructor(e){this.client=e}list(e){return this.client.rest.get(Ie,e)}toggleStatus(e,t){return this.client.rest.put(Ie,{ids:e,to_status:t})}toggleAllStatus(e){return this.client.rest.put(Le,{to_status:e})}delete(e){return this.client.rest.delete(Ie,{id:e})}deleteAll(){return this.client.rest.delete(Le)}getPermission(){return this.client.rest.get(ze)}setPermission(e){return this.client.rest.post(ze,{enabled:e})}getSubscription(){return this.client.rest.get(je)}setSubscription(e){const t={action_groups:Object.assign({},e)};return this.client.rest.post(je,t)}}const We="/roles",Be=`${We}/default`,Fe="/permissions";class He{constructor(e){this.client=e}list(e){return this.client.rest.get(We,e)}get(e){return this.client.rest.get(`${We}/${e}`)}getDefault(){return this.client.rest.get(`${Be}`)}create(e){return this.client.rest.post(We,e)}update(e,t){return this.client.rest.put(`${We}/${e}`,t)}delete(e){return this.client.rest.delete(`${We}/${e}`)}permissionList(){return this.client.rest.get(Fe)}addPermission(e,t){return this.client.rest.put(`${We}/${e}/permissions`,{ids:t})}deletePermission(e,t){return this.client.rest.delete(`${We}/${e}/${Fe}`,{ids:t})}}const qe="/share",Ge=`${qe}/restrictions`,Me=`${qe}/login`;class Ze{constructor(e){this.client=e}info(e){return this.client.rest.get(`${qe}?share_token=${e}`)}checkPassword(e,t){const s=encodeURIComponent(e);return this.client.rest.get(`${qe}/password?share_token=${t}&share_pass=${s}`)}getRestriction(e){return this.client.rest.get(`${Ge}/${e}`)}restrictions(e){return this.client.rest.get(Ge,e)}restrictionsChange(e,t){return this.client.rest.put(`${Ge}/${e}`,t)}login(e){return this.client.rest.post(`${Me}`,e)}}const Ve="/storage/element/version/comment",Je=`${Ve}/all`;class Xe{constructor(e){this.client=e}list(e){return this.client.rest.get(`${Ve}`,e)}create(e){return this.client.rest.post(`${Ve}`,e)}update(e){return this.client.rest.put(`${Ve}`,e)}delete(e){return this.client.rest.delete(`${Ve}`,e)}deleteAll(e){return this.client.rest.delete(`${Je}`,e)}}const Ye="/storage",Ke=`${Ye}/element`,Qe=`${Ke}/divide/resource`,et=`${Ke}/move`,tt=`${Ke}/copy`,st=`${Ke}/content_type_size`,it="/disk";class nt{constructor(e,t){this.client=e,this.fcaApiService=t}list(e){return this.client.rest.get(Ye,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,e.zip_entry_path||delete e.zip_entry_path,this.client.rest.get(Ke,e)}fileInfo(e,t){return this.client.rest.get(`${Ke}/${e}`,t?{file_version_id:t}:{})}combineInfo({root:e,rootId:t,path:s,file_version_id:i,zip_entry_path:n}){return e===N.fca&&t?this.fcaApiService.info(t,s):this.info({path:s,divide_id:t,file_version_id:i,zip_entry_path:n})}size(e){return this.client.rest.post(`${Ke}/size`,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===N.fca&&s===N.fca?this.client.rest.post(`${it}/${i}/files/move${it}/${n}`,r):t===N.fca?(i&&(r.from_divide_id=i),this.client.rest.put(`${it}/${n}/files/from/box`,r)):s===N.fca?(n&&(r.to_divide_id=n),this.client.rest.put(`${it}/${i}/files/to/box`,r)):this.client.rest.post(et,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===N.fca&&t===N.fca?this.client.rest.post(`${it}/${i}/files/copy${it}/${n}`,r):s===N.fca?(i&&(r.from_divide_id=i),this.client.rest.post(`${it}/${n}/files/from/box`,r)):t===N.fca?(n&&(r.to_divide_id=n),this.client.rest.post(`${it}/${i}/files/to/box`,r)):this.client.rest.post(tt,e)}pasteFromShared(e,t,s){const i={from_sharing_token:e,from_sharing_password:s,paths:t};return this.client.rest.post(`${Ke}/copy`,i)}create(e){return this.client.rest.post(Ke,e)}delete(e,t){const s={path:e};return t&&(s.divide_id=t),this.client.rest.delete(Ke,s)}favorite(e){return this.client.rest.put(`${Ke}?path=${encodeURIComponent(e)}`,{is_favorite:!0})}removeFavorite(e){return this.client.rest.put(`${Ke}?path=${encodeURIComponent(e)}`,{is_favorite:!1})}createItem(e){return this.client.rest.post(Ke,e)}createWorkDir(e){return this.client.rest.post(Ke,e)}sizeWithSection(e){return this.client.rest.get(st,e)}getDivideResources(e){return this.client.rest.get(Qe,e)}getQuota(e){return this.client.rest.get(`${Ke}/user_size`,e)}}const rt="/storage/files",ot=`${rt}/net`,ct=`${rt}/unzip`,at=`${rt}/zip`,lt=`${at}/download`,ut=`${rt}/process`,dt=`${rt}/code`;class ht{constructor(e){this.client=e}read(e,t){return t.path=e,this.client.rest.get(rt,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(`${rt}?${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(rt,n,{onUploadProgress:t=>{e(t)}});return{promise:r,abort:o}}uploadNet(e){return this.client.rest.post(ot,e)}createZipToDownload(e){var t;const s=-(new Date).getTimezoneOffset()/60;return null!==(t=e.time_zone)&&void 0!==t||(e.time_zone=s),this.client.rest.post(lt,e)}createZip(e){var t;const s=-(new Date).getTimezoneOffset()/60;return null!==(t=e.time_zone)&&void 0!==t||(e.time_zone=s),this.client.rest.post(at,e)}cancelCreateZip(e){return this.client.rest.delete(ut,e)}unZip(e){return this.client.rest.post(ct,e)}checkZip(e){return this.client.rest.head(dt,e)}}class pt{constructor(e){this.client=e}instance(){return this.client.rest.get("/storage/instance")}}const _t="/storage/element/share";class gt{constructor(e){this.client=e}info(e){return this.client.rest.get(_t,{path:e})}create(e,t){const s={path:e,permissions_type:t};return this.client.rest.post(_t,s)}change(e){return this.client.rest.put(`${_t}/${e.token}`,e)}delete(e){return this.client.rest.delete(_t,{path:e})}refresh(e){return this.client.rest.put(`${_t}/${e}/refresh`)}}const ft="/storage/trash/element",$t=`${ft}/all`;class vt{constructor(e){this.client=e}clear(e){return this.client.rest.delete(ft,e)}clearAll(){return this.client.rest.delete($t)}restore(e){return this.client.rest.patch(ft,{del_groups:e})}restoreAll(){return this.client.rest.patch($t)}}const mt="/users",kt=`${mt}/me`,wt=`${kt}/avatars`,St=`${kt}/sessions`,bt=`${kt}/tokens`,yt=`${kt}/params`,xt=`${kt}/app-passwords`,At=`${kt}/change-password`,Ct=`${mt}/initial`,Dt=`${kt}/phone`,Tt=`${Dt}/confirm`;class Ut{constructor(e){this.client=e}initial(e){return this.client.rest.post(Ct,e)}list(e){return this.client.rest.get(mt,e)}get(e){return this.client.rest.get(mt+`/${e}`)}create(e){return this.client.rest.post(mt,e)}update(e,t){return this.client.rest.put(mt+`/${e}`,t)}delete(e,t){return this.client.rest.delete(`${mt}/${e}`,t)}restore(e){return this.client.rest.post(`${mt}/${e}/restore`)}me(){return this.client.rest.get(kt)}updateMe(e){return this.client.rest.put(kt,e)}createToken(e){return this.client.rest.post(bt,e)}listToken(e){return this.client.rest.get(bt,e)}deleteToken(e){return this.client.rest.delete(`${bt}/${e}`)}changeMyPassword(e){return this.client.rest.put(At,e)}changeUsersPassword(e,t){return this.client.rest.put(`${mt}/${e}/change-password`,t)}meUploadAvatar(e,t){const s=new FormData;return s.append("file",e,t),this.client.rest.post(wt,s)}meDeleteAvatar(){return this.client.rest.delete(wt)}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(`${mt}/${e}/roles`,{role_id:t})}meParams(e){return this.client.rest.get(yt,{name:e})}meSetParams(e,t){return this.client.rest.post(`${yt}/${e}`,t)}meListParams(){return this.client.rest.get(yt)}phone(e){return this.client.rest.post(Dt,e)}phoneConfirm(e){return this.client.rest.post(`${Tt}/${e}`)}appPasswordsList(e){return this.client.rest.get(xt,e)}createAppPasswords(e){return this.client.rest.post(xt,e)}deleteAppPasswords(e){return this.client.rest.delete(`${xt}/${e}`)}}const Et="/storage/element",Pt=`${Et}/history`,Ot=`${Et}/version`,Rt=`${Ot}/lock`,It=`${Ot}/unlock`,Lt=`${Ot}/current`,jt=`${Ot}/size`;class zt{constructor(e){this.client=e}history(e){return this.client.rest.get(Pt,e)}versions(e){return this.client.rest.get(Ot,e)}create(e){return this.client.rest.post(Ot,e)}edit(e){return this.client.rest.put(Ot,e)}delete(e){return this.client.rest.delete(Ot,e)}size(e){return this.client.rest.get(jt,e)}makeCurrent(e){return this.client.rest.post(Lt,e)}lock(e){return this.client.rest.post(Rt,e)}unlock(e){return this.client.rest.post(It,e)}}export{r as AccessRights,n as AuthApiService,oe as BASE_URL_V1,ce as BASE_URL_V2,o as CONNECTIONS_PERMISSION,le as Client,l as ConnectionGroup,u as ConnectionType,q as ConnectionsApiService,G as DiscoveryApiService,V as DivideApiService,$ as DivideMode,p as DivideScope,a as EngineType,h as ExtensionFileMode,d as ExtensionType,ge as ExtensionsApiService,$e as ExtensionsExternalApiService,ke as FcaApiService,Se as GatewayApiService,xe as GroupApiService,Te as LicenseApiService,k as LicenseError,S as LimitationSubType,w as LimitationType,Oe as LimitationsApiService,Ee as LinksApiService,Re as LogstashApiService,ne as NEED_TOKEN_UPDATE_ERROR,y as NotificationAction,Ne as NotificationApiService,b as NotificationEntityType,x as NotificationRowAction,A as NotificationStyle,c as OrderDirection,_ as PermissionType,be as QueryInitViewType,D as RequestMethod,T as RequestObserve,C as ResponseType,ae as Rest,f as RestrictionBooleanStatus,v as RestrictionModeKey,U as RestrictionSharing,g as RestrictionStatus,He as RoleApiService,L as SettingControlType,Ze as ShareApiService,Xe as StorageCommentApiService,nt as StorageElementApiService,B as StorageElementCheckStatus,z as StorageElementContentType,W as StorageElementHistoryAction,j as StorageElementType,ht as StorageFilesApiService,pt as StorageInstanceApiService,N as StorageRoot,gt as StorageShareApiService,vt as StorageTrashApiService,m as Tariff,re as TokenUpdate,Ut as UserApiService,I as UserAppType,E as UserAuthType,R as UserParamsLabel,P as UserStatus,O as UserType,zt as VersionApiService,Q as applyInterceptors,ee as getCookieValue,te as makeUrlParams,se as normalizeHeaders,ie as prepareRequestBody};
1
+ const e="/login",t=`${e}/ldap`,s=`${e}/update`,i=`${e}/tfa`;class n{constructor(e){this.client=e}info(){return this.client.rest.get(e)}login(t){return this.client.rest.post(e,t)}ldapLogin(e){return this.client.rest.post(t,e)}loginTfa(e){return this.client.rest.post(i,e)}updateToken(e){const t=e.path?`${e.path}/${s}`:s;return e.path&&delete e.path,this.client.rest.post(t,e)}logout(){return this.client.rest.post("/logout")}}var r;!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.LimitationsRead="limitations_read",e.LimitationsEdit="limitations_edit",e.ReadUserLogs="read_user_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"}(r||(r={}));const o=[r.ConnectionsYandexDisk,r.ConnectionsSsh,r.ConnectionsMail,r.ConnectionsS3,r.ConnectionsS3,r.ConnectionsDiscord,r.ConnectionsWebdav,r.ConnectionsNextcloud,r.ConnectionsNextbox,r.ConnectionsHttpProxy];var c,a,l,u,d,h,p,_,g,f,$,v,m,k,w,S,b,y,x,A,C,D,T,U,E,P,O,R,I,L,j,z,N,W,B;!function(e){e.DEFAULT="",e.ASC="asc",e.DESC="desc"}(c||(c={})),function(e){e.WebSocket="websocket",e.PostMessage="postmessage",e.Empty=""}(a||(a={})),function(e){e.Storages="storages_connections_group",e.Webhooks="webhooks_connections_group",e.Unknown="unknown_connections_group",e.Proxy="proxy_connections_group"}(l||(l={})),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"}(u||(u={})),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"}(p||(p={})),function(e){e.CLOSE="",e.READ="r",e.WRITE="rw"}(_||(_={})),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"}(m||(m={})),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"}(k||(k={})),function(e){e.BySize="size",e.ByExt="extension",e.ByQuota="quota_size"}(w||(w={})),function(e){e.Size="size",e.White="extension_white",e.Black="extension_black"}(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"}(b||(b={})),function(e){e.SecurityCheckNegative="action_security_check_negative",e.SecurityCheckPositive="action_security_check_positive",e.CommentVersionMention="action_version_comment_mention",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.StatusCreateZipProcess="status_create_zip_process",e.StatusCreateZipSuccess="status_create_zip_success",e.StatusCreateZipError="status_create_zip_error",e.DownloadZipSuccess="download_zip_success",e.DownloadZipError="download_zip_error",e.StatusUnzipProcess="status_unzip_process",e.StatusUnzipSuccess="status_unzip_success",e.StatusUnzipError="status_unzip_error",e.StatusUnzipSuccessWithLimits="status_unzip_success_with_limits",e.AnonymZipDirAddFileToOwner="anonym_zip_dir_add_file_to_owner",e.GuestZipDirAddFileToOwner="guest_zip_dir_add_file_to_owner",e.DropDocumentOnlyoffice="drop_document_onlyoffice",e.CopyError="copy_error",e.CopySuccess="copy_success",e.StatusCopyProcess="status_copy_process",e.Other="other"}(y||(y={})),function(e){e.Read="read",e.Unread="unread",e.Delete="delete"}(x||(x={})),function(e){e.Plain="plain",e.Success="success",e.Info="info",e.Warning="warning",e.Error="error"}(A||(A={})),function(e){e.ArrayBuffer="arraybuffer",e.Blob="blob",e.Json="json",e.Text="text"}(C||(C={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.PATCH="PATCH",e.DELETE="DELETE",e.HEAD="HEAD"}(D||(D={})),function(e){e.Body="body",e.Response="response"}(T||(T={})),function(e){e.NONE="none",e.SOFT="soft",e.HARD="hard"}(U||(U={})),function(e){e.Native="native",e.Ldap="ldap",e.Vk="vk"}(E||(E={})),function(e){e.Registering="registering",e.Activated="activated",e.BlockedByAdmin="blocked_by_admin",e.BlockedByLicense="blocked_by_license",e.BlockedByInactive="blocked_by_inactive",e.BlockedByInactiveChangePassword="blocked_by_inactive_change_password"}(P||(P={})),function(e){e.User="user",e.Guest="guest",e.Emperor="emperor",e.Anonymous="anonymous"}(O||(O={})),function(e){e.Theme="theme",e.Lang="lang",e.Sort="sort",e.ViewApps="viewApps",e.WithoutContentWorkDir="withoutContentWorkDir",e.DashboardGrid="dashboardGrid"}(R||(R={})),function(e){e.Webdav="webdav"}(I||(I={})),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"}(L||(L={})),function(e){e.Dir="dir",e.File="file",e.WorkDir="work_dir",e.App="app"}(j||(j={})),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"}(z||(z={})),function(e){e.my="my",e.fca="fca",e.divide="divide",e.share="share",e.favorite="favorite",e.trash="trash"}(N||(N={})),function(e){e.Create="create",e.Update="update",e.Move="move"}(W||(W={})),function(e){e[e.CheckNull=0]="CheckNull",e[e.CheckInProgress=1]="CheckInProgress",e[e.CheckPositive=2]="CheckPositive",e[e.CheckNegative=3]="CheckNegative"}(B||(B={}));const F="/connections",H=`${F}/dashboard`;class q{constructor(e){this.client=e}list(e){return this.client.rest.get(F,e)}get(e){return this.client.rest.get(`${F}/${e}`)}update(e,t){return this.client.rest.put(`${F}/${e}`,t)}delete(e){return this.client.rest.delete(`${F}/${e}`)}create(e){const t={[u.SSH]:"/disk/ssh",[u.Webdav]:"/disk/webdav",[u.Nextcloud]:"/disk/nextcloud",[u.NextBox]:"/disk/nextbox",[u.Discord]:"/webhooks/discord",[u.Mail]:"/webhooks/mail",[u.HttpProxy]:"/http_proxy",[u.S3]:"/disk/s3"};return this.client.rest.post(t[e.type]||F,e)}dashboard(e){return this.client.rest.get(H,e)}}class G{constructor(e){this.client=e}discovery(e){return this.client.rest.get("/discovery",e)}}const M="/divide",Z=`${M}/restrictions`;class V{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}${M}/${t}`,{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}${M}`,r)}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(`${Z}/${e}`)}restrictionSize(e,t){return this.client.rest.get(`/${t}/restrictions/${e}/size`)}restrictions(e){return this.client.rest.get(`${Z}`,e)}restrictionsChange(e,t){return this.client.rest.put(`${Z}/${e}`,t)}makeParam(e,t){const s={};return e===p.Connection?s.connection_id=t:s.path=t,s}}function J(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 X extends Error{}function Y(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 K(e,t){if("string"!=typeof e)throw new X("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 X(`Invalid token specified: missing part #${s+1}`);let n;try{n=Y(i)}catch(e){throw new X(`Invalid token specified: invalid base64 for part #${s+1} (${e.message})`)}try{return JSON.parse(n)}catch(e){throw new X(`Invalid token specified: invalid json for part #${s+1} (${e.message})`)}}X.prototype.name="InvalidTokenError";const Q=(e,t)=>J(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 ee(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 te=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 se(e){return e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):e}function ie(e){return e?e instanceof FormData||e instanceof Blob||e instanceof ArrayBuffer||e instanceof URLSearchParams||e instanceof Document||ArrayBuffer.isView(e)?e:"object"==typeof e?JSON.stringify(e):"string"==typeof e?e:null:null}const ne="update black token";class re{constructor(){this.isUpdating=!1,this.tokenUpdateResolve=null}isTokenExpire(e){if(!e)return!1;return 1e3*e<=(new Date).getTime()+3e3}refreshToken(e,t){return J(this,void 0,void 0,(function*(){const{access_token:s,refresh_token:i}=e;return s&&i?this.isUpdating?this.waitForTokenUpdate():(this.isUpdating=!0,new Promise(((e,n)=>{const r=new XMLHttpRequest,o=`${t}${oe}/login/update`;r.open("POST",o,!0),r.setRequestHeader("Content-Type","application/json"),r.send(JSON.stringify({access_token:s,refresh_token:i})),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};ee("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){n(new Error("Failed to parse response JSON."))}else e(null)},r.onerror=()=>{n(new Error("Network error occurred"))},r.onloadend=()=>{this.isUpdating=!1}}))):null}))}waitForTokenUpdate(){return J(this,void 0,void 0,(function*(){return new Promise((e=>{const t=setInterval((()=>{this.isUpdating||(clearInterval(t),e())}),100)}))}))}}const oe="/api/v1",ce="/api/v2";class ae{constructor(e,t){this.client=e,this.tokenUpdate=t,this.baseHost=""}get state(){return this.client.state}get(e,t,s){return this.request(D.GET,e,Object.assign({params:t,cache:"no-cache"},s))}post(e,t,s){return this.request(D.POST,e,Object.assign({body:t},s))}put(e,t,s){return this.request(D.PUT,e,Object.assign({body:t,cache:"no-cache"},s))}patch(e,t,s){return this.request(D.PATCH,e,Object.assign({body:t},s))}delete(e,t,s){return this.request(D.DELETE,e,Object.assign({params:t},s))}head(e,t,s){return this.request(D.HEAD,e,Object.assign({params:t},s))}upload(e,t,s){const i=new AbortController,n=i.signal;return{promise:this.request(D.POST,e,Object.assign({body:t,signal:n},s)),abort:()=>i.abort()}}request(e,t,s){return new Promise(((i,n)=>{var r;const o=null!==(r=this.state.skipInterceptors)&&void 0!==r&&r;this.state.skipInterceptors=!1;let c=Object.assign({method:e},s);(null==s?void 0:s.signal)&&(c.signal=s.signal);(()=>J(this,void 0,void 0,(function*(){var s,r,a,l;if(o||(c=null!==(s=yield Q(this.client.requestInterceptors,c))&&void 0!==s?s:c),this.state.authToken)for(const[e,s]of this.state.authToken.entries()){const i=K(s.access_token);if(i&&i.is_remember&&this.tokenUpdate.isTokenExpire(i.exp)&&!t.includes("/login")&&!t.includes("/assets")){const t=yield this.tokenUpdate.refreshToken(s,this.baseHost);t&&(this.state.authToken.set(e,t),c=null!==(r=yield Q(this.client.requestInterceptors,c))&&void 0!==r?r:c)}}const u=new XMLHttpRequest;c.params&&Object.keys(c.params).length&&(t+="?"+te(c.params));const d=null!==(a=c.host)&&void 0!==a?a:this.state.clientParams.host,h=`${d}${null!==(l=c.version)&&void 0!==l?l:this.state.clientParams.version}${t}`;if(u.open(e,h,!0),c.headers){const e=se(c.headers);for(const[t,s]of Object.entries(e))(d===this.baseHost||"content-type"!==t.toLowerCase())&&u.setRequestHeader(t,s)}c.responseType&&(u.responseType=c.responseType),c.signal&&c.signal.addEventListener("abort",(()=>{u.abort(),n(new Error("Request aborted"))})),!u.upload||e!==D.POST&&e!==D.PUT&&e!==D.PATCH||(u.upload.onprogress=e=>{e.lengthComputable&&c.onUploadProgress&&c.onUploadProgress(e)}),u.onload=()=>J(this,void 0,void 0,(function*(){if(c.signal&&c.signal.aborted)return;let e;switch(c.responseType){case C.Text:e=u.responseText;break;case C.Blob:case C.ArrayBuffer:e=u.response;break;default:try{e=JSON.parse(u.responseText)}catch(t){e=u.responseText}}const t=new Headers;u.getAllResponseHeaders().split("\r\n").forEach((e=>{const[s,i]=e.split(": ");s&&i&&t.append(s,i)}));const s={status:u.status,statusText:u.statusText,headers:t,url:u.responseURL};if(u.status>=200&&u.status<300)return yield Q(this.client.responseInterceptors,s),void(c.observe===T.Response?i(Object.assign(Object.assign({},s),{body:e})):i(e));if(this.state.authToken&&(null==e?void 0:e.code)===ne){const e=yield this.tokenUpdate.refreshToken(this.state.authToken.get(0),this.baseHost);e&&this.state.authToken.set(0,e)}const r=Object.assign(Object.assign({},s),{error:e});yield Q(this.client.responseInterceptors,r),n(r)})),u.onerror=()=>{n({status:u.status,statusText:u.statusText,url:u.responseURL,error:"Network error"})},u.send(ie(c.body))})))().catch(n)}))}}class le{constructor(e){this.AuthApiService=new n(this),this.ConnectionsApiService=new q(this),this.DiscoveryApiService=new G(this),this.DivideApiService=new V(this),this.ExtensionsApiService=new ge(this),this.ExtensionsExternalApiService=new $e(this),this.FcaApiService=new ke(this),this.GatewayApiService=new Se(this),this.GroupApiService=new xe(this),this.LicenseApiService=new Te(this),this.LinksApiService=new Ee(this),this.LimitationsApiService=new Oe(this),this.LogstashApiService=new Re(this),this.NotificationApiService=new Ne(this),this.RoleApiService=new He(this),this.ShareApiService=new Ze(this),this.StorageCommentApiService=new Xe(this),this.StorageElementApiService=new nt(this,this.FcaApiService),this.StorageFilesApiService=new ht(this),this.StorageInstanceApiService=new pt(this),this.StorageShareApiService=new gt(this),this.StorageTrashApiService=new vt(this),this.UserApiService=new Ut(this),this.VersionApiService=new zt(this),this.tokenUpdate=new re,this.rest=new ae(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,version:(null==e?void 0:e.version)||oe},requestParams:{path:"",headers:{},query:{},body:null,cache:"no-cache"},authToken:null,skipInterceptors:!1},this.rest.baseHost=this.state.clientParams.host||""}}const ue="/static/extensions",de="/extensions/defaults",he=`${ue}/names/users`,pe=`${ue}/names/system`,_e=`${ue}/tags`;class ge{constructor(e){this.client=e}getSetting(e){return this.client.rest.get(`${ue}/${e}/settings`)}setSetting(e,t){return this.client.rest.post(`${ue}/${e}/settings`,t)}deleteSetting(e){return this.client.rest.delete(`${ue}/${e}/settings`)}get(e){return this.client.rest.get(`${ue}/${e}`)}getByKey(e){return this.client.rest.get(`${ue}/${e}`)}getDefault(e=[]){return this.client.rest.get(de,{ext_code:e})}setDefault(e,t){return this.client.rest.post(de,{ext_code:e,ext_uniq_key:t})}checkUpdates(){return this.client.rest.post(`${ue}/check_updates`)}updateVersion(e,t){return this.client.rest.put(`${ue}/${e}`,{version:t})}list(e){return this.client.rest.get(ue,e)}listTags(e){return this.client.rest.get(_e,e)}delete(e,t){return this.client.rest.delete(`${ue}/${e}`)}upload(e,t){const s=new FormData;s.set("file",t);const{promise:i,abort:n}=this.client.rest.upload(ue,s,{version:ce,onUploadProgress:t=>{e(t)}});return{promise:i,abort:n}}install(e,t){return this.client.rest.post(`${ue}/site`,{uniq_key:e,version:t},{version:ce})}getSystemNameExts(e){return this.client.rest.get(pe,e)}getUserNameExts(e){return this.client.rest.get(he,e)}createUserNameExt(e){return this.client.rest.post(`${he}`,{name:e})}deleteUserNameExt(e){return this.client.rest.delete(`${he}/${e}`)}deleteAllUserNameExts(){return this.client.rest.delete(`${he}`)}}const fe="/anons_ext/extensions";class $e{constructor(e){this.client=e}listExtensionsSite(e){return this.client.rest.get(fe,e,{host:"https://next-box.ru"})}extensionDetailSite(e){return this.client.rest.get(`${fe}/${e}`,{},{host:"https://next-box.ru"})}extensionMarkdown(e,t){return this.client.rest.get(`${fe}/${e.uniqKey}/readme`,{lang:e.lang},Object.assign(Object.assign({},t),{host:"https://next-box.ru"}))}}const ve="/disk",me=`${ve}/check`;class ke{constructor(e){this.client=e}info(e,t){return this.client.rest.get(`${ve}/${e}/element`,{path:t})}list(e,t){return this.client.rest.get(`${ve}/${e}`,t)}create(e,t){return this.client.rest.post(`${ve}/${e}/element`,t)}replace(e,t,s){return this.client.rest.put(`${ve}/${e}/files?path=${t}`,s)}read(e,t){return this.client.rest.get(`${ve}/${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(`${ve}/${t}/files`,n,{onUploadProgress:t=>{e(t)}});return{promise:r,abort:o}}uploadNet(e,t){return this.client.rest.post(`${ve}/${e}/files/net`,t)}delete(e,t){return this.client.rest.delete(`${ve}/${e}/trash/element`,{path:t})}check(e){return this.client.rest.post(me,e)}}const we="/settings";class Se{constructor(e){this.client=e}settings(){return this.client.rest.get(we)}changeSettings(e){return this.client.rest.post(we,e)}queryInit(){return this.client.rest.get("/query/init")}}var be;!function(e){e.Standard="Standard",e.Simple="Simple"}(be||(be={}));const ye="/groups";class xe{constructor(e){this.client=e}list(e){return this.client.rest.get(ye,e)}listUsers(e,t){return this.client.rest.get(`${ye}/${e}/users`,t)}create(e){return this.client.rest.post(ye,e)}update(e,t){return this.client.rest.put(`${ye}/${e}`,t)}delete(e){return this.client.rest.delete(`${ye}/${e}`)}}const Ae="/license",Ce=`${Ae}/manual-check`,De=`${Ae}/hardware/hash`;class Te{constructor(e){this.client=e}info(){return this.client.rest.get(Ae)}create(e){return this.client.rest.post(Ae,e)}check(){return this.client.rest.post(Ce)}delete(){return this.client.rest.delete(Ae)}getHash(){return this.client.rest.get(De)}}const Ue="/links";class Ee{constructor(e){this.client=e}createShortLink(e){return this.client.rest.post(Ue,e)}updateShortLink(e){return this.client.rest.put(Ue,e)}}const Pe="/limitations";class Oe{constructor(e){this.client=e}me(){return this.client.rest.get("/limitations/user/me")}list(e){return this.client.rest.get(Pe,e)}listUsers(e,t){return this.client.rest.get(`${Pe}/${e}/users`,t)}create(e){return this.client.rest.post(Pe,e)}get(e){return this.client.rest.get(`${Pe}/${e}`)}update(e,t){return this.client.rest.put(`${Pe}/${e}`,t)}delete(e){return this.client.rest.delete(`${Pe}/${e}`)}getLimitationsByUser(e){return this.client.rest.get(`/limitations/user/${e}`)}addUserToLimitation(e,t){return this.client.rest.patch(`${Pe}/${e}/user`,{id:t})}deleteUserFromLimitation(e,t){return this.client.rest.delete(`${Pe}/${e}/user/${t}`)}}class Re{constructor(e){this.client=e}getUsersLogs(e){return this.client.rest.get("/logs/users",e)}}const Ie="/notifications",Le=`${Ie}/all`,je=`${Ie}/subscription`,ze=`${Ie}/permission`;class Ne{constructor(e){this.client=e}list(e){return this.client.rest.get(Ie,e)}toggleStatus(e,t){return this.client.rest.put(Ie,{ids:e,to_status:t})}toggleAllStatus(e){return this.client.rest.put(Le,{to_status:e})}delete(e){return this.client.rest.delete(Ie,{id:e})}deleteAll(){return this.client.rest.delete(Le)}getPermission(){return this.client.rest.get(ze)}setPermission(e){return this.client.rest.post(ze,{enabled:e})}getSubscription(){return this.client.rest.get(je)}setSubscription(e){const t={action_groups:Object.assign({},e)};return this.client.rest.post(je,t)}}const We="/roles",Be=`${We}/default`,Fe="/permissions";class He{constructor(e){this.client=e}list(e){return this.client.rest.get(We,e)}get(e){return this.client.rest.get(`${We}/${e}`)}getDefault(){return this.client.rest.get(`${Be}`)}create(e){return this.client.rest.post(We,e)}update(e,t){return this.client.rest.put(`${We}/${e}`,t)}delete(e){return this.client.rest.delete(`${We}/${e}`)}permissionList(){return this.client.rest.get(Fe)}addPermission(e,t){return this.client.rest.put(`${We}/${e}/permissions`,{ids:t})}deletePermission(e,t){return this.client.rest.delete(`${We}/${e}/${Fe}`,{ids:t})}}const qe="/share",Ge=`${qe}/restrictions`,Me=`${qe}/login`;class Ze{constructor(e){this.client=e}info(e){return this.client.rest.get(`${qe}?share_token=${e}`)}checkPassword(e,t){const s=encodeURIComponent(e);return this.client.rest.get(`${qe}/password?share_token=${t}&share_pass=${s}`)}getRestriction(e){return this.client.rest.get(`${Ge}/${e}`)}restrictions(e){return this.client.rest.get(Ge,e)}restrictionsChange(e,t){return this.client.rest.put(`${Ge}/${e}`,t)}login(e){return this.client.rest.post(`${Me}`,e)}}const Ve="/storage/element/version/comment",Je=`${Ve}/all`;class Xe{constructor(e){this.client=e}list(e){return this.client.rest.get(`${Ve}`,e)}create(e){return this.client.rest.post(`${Ve}`,e)}update(e){return this.client.rest.put(`${Ve}`,e)}delete(e){return this.client.rest.delete(`${Ve}`,e)}deleteAll(e){return this.client.rest.delete(`${Je}`,e)}}const Ye="/storage",Ke=`${Ye}/element`,Qe=`${Ke}/divide/resource`,et=`${Ke}/move`,tt=`${Ke}/copy`,st=`${Ke}/content_type_size`,it="/disk";class nt{constructor(e,t){this.client=e,this.fcaApiService=t}list(e){return this.client.rest.get(Ye,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,e.zip_entry_path||delete e.zip_entry_path,this.client.rest.get(Ke,e)}fileInfo(e,t){return this.client.rest.get(`${Ke}/${e}`,t?{file_version_id:t}:{})}combineInfo({root:e,rootId:t,path:s,file_version_id:i,zip_entry_path:n}){return e===N.fca&&t?this.fcaApiService.info(t,s):this.info({path:s,divide_id:t,file_version_id:i,zip_entry_path:n})}size(e){return this.client.rest.post(`${Ke}/size`,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===N.fca&&s===N.fca?this.client.rest.post(`${it}/${i}/files/move${it}/${n}`,r):t===N.fca?(i&&(r.from_divide_id=i),this.client.rest.put(`${it}/${n}/files/from/box`,r)):s===N.fca?(n&&(r.to_divide_id=n),this.client.rest.put(`${it}/${i}/files/to/box`,r)):this.client.rest.post(et,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===N.fca&&t===N.fca?this.client.rest.post(`${it}/${i}/files/copy${it}/${n}`,r):s===N.fca?(i&&(r.from_divide_id=i),this.client.rest.post(`${it}/${n}/files/from/box`,r)):t===N.fca?(n&&(r.to_divide_id=n),this.client.rest.post(`${it}/${i}/files/to/box`,r)):this.client.rest.post(tt,e)}pasteFromShared(e,t,s){const i={from_sharing_token:e,from_sharing_password:s,paths:t};return this.client.rest.post(`${Ke}/copy`,i)}create(e){return this.client.rest.post(Ke,e)}delete(e,t){const s={path:e};return t&&(s.divide_id=t),this.client.rest.delete(Ke,s)}favorite(e){return this.client.rest.put(`${Ke}?path=${encodeURIComponent(e)}`,{is_favorite:!0})}removeFavorite(e){return this.client.rest.put(`${Ke}?path=${encodeURIComponent(e)}`,{is_favorite:!1})}createItem(e){return this.client.rest.post(Ke,e)}createWorkDir(e){return this.client.rest.post(Ke,e)}sizeWithSection(e){return this.client.rest.get(st,e)}getDivideResources(e){return this.client.rest.get(Qe,e)}getQuota(e){return this.client.rest.get(`${Ke}/user_size`,e)}}const rt="/storage/files",ot=`${rt}/net`,ct=`${rt}/unzip`,at=`${rt}/zip`,lt=`${at}/download`,ut=`${rt}/process`,dt=`${rt}/code`;class ht{constructor(e){this.client=e}read(e,t){return t.path=e,this.client.rest.get(rt,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(`${rt}?${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(rt,n,{onUploadProgress:t=>{e(t)}});return{promise:r,abort:o}}uploadNet(e){return this.client.rest.post(ot,e)}createZipToDownload(e){var t;const s=-(new Date).getTimezoneOffset()/60;return null!==(t=e.time_zone)&&void 0!==t||(e.time_zone=s),this.client.rest.post(lt,e)}createZip(e){var t;const s=-(new Date).getTimezoneOffset()/60;return null!==(t=e.time_zone)&&void 0!==t||(e.time_zone=s),this.client.rest.post(at,e)}cancelProcess(e){return this.client.rest.delete(ut,e)}unZip(e){return this.client.rest.post(ct,e)}checkZip(e){return this.client.rest.head(dt,e)}}class pt{constructor(e){this.client=e}instance(){return this.client.rest.get("/storage/instance")}}const _t="/storage/element/share";class gt{constructor(e){this.client=e}info(e){return this.client.rest.get(_t,{path:e})}create(e,t){const s={path:e,permissions_type:t};return this.client.rest.post(_t,s)}change(e){return this.client.rest.put(`${_t}/${e.token}`,e)}delete(e){return this.client.rest.delete(_t,{path:e})}refresh(e){return this.client.rest.put(`${_t}/${e}/refresh`)}}const ft="/storage/trash/element",$t=`${ft}/all`;class vt{constructor(e){this.client=e}clear(e){return this.client.rest.delete(ft,e)}clearAll(){return this.client.rest.delete($t)}restore(e){return this.client.rest.patch(ft,{del_groups:e})}restoreAll(){return this.client.rest.patch($t)}}const mt="/users",kt=`${mt}/me`,wt=`${kt}/avatars`,St=`${kt}/sessions`,bt=`${kt}/tokens`,yt=`${kt}/params`,xt=`${kt}/app-passwords`,At=`${kt}/change-password`,Ct=`${mt}/initial`,Dt=`${kt}/phone`,Tt=`${Dt}/confirm`;class Ut{constructor(e){this.client=e}initial(e){return this.client.rest.post(Ct,e)}list(e){return this.client.rest.get(mt,e)}get(e){return this.client.rest.get(mt+`/${e}`)}create(e){return this.client.rest.post(mt,e)}update(e,t){return this.client.rest.put(mt+`/${e}`,t)}delete(e,t){return this.client.rest.delete(`${mt}/${e}`,t)}restore(e){return this.client.rest.post(`${mt}/${e}/restore`)}me(){return this.client.rest.get(kt)}updateMe(e){return this.client.rest.put(kt,e)}createToken(e){return this.client.rest.post(bt,e)}listToken(e){return this.client.rest.get(bt,e)}deleteToken(e){return this.client.rest.delete(`${bt}/${e}`)}changeMyPassword(e){return this.client.rest.put(At,e)}changeUsersPassword(e,t){return this.client.rest.put(`${mt}/${e}/change-password`,t)}meUploadAvatar(e,t){const s=new FormData;return s.append("file",e,t),this.client.rest.post(wt,s)}meDeleteAvatar(){return this.client.rest.delete(wt)}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(`${mt}/${e}/roles`,{role_id:t})}meParams(e){return this.client.rest.get(yt,{name:e})}meSetParams(e,t){return this.client.rest.post(`${yt}/${e}`,t)}meListParams(){return this.client.rest.get(yt)}phone(e){return this.client.rest.post(Dt,e)}phoneConfirm(e){return this.client.rest.post(`${Tt}/${e}`)}appPasswordsList(e){return this.client.rest.get(xt,e)}createAppPasswords(e){return this.client.rest.post(xt,e)}deleteAppPasswords(e){return this.client.rest.delete(`${xt}/${e}`)}}const Et="/storage/element",Pt=`${Et}/history`,Ot=`${Et}/version`,Rt=`${Ot}/lock`,It=`${Ot}/unlock`,Lt=`${Ot}/current`,jt=`${Ot}/size`;class zt{constructor(e){this.client=e}history(e){return this.client.rest.get(Pt,e)}versions(e){return this.client.rest.get(Ot,e)}create(e){return this.client.rest.post(Ot,e)}edit(e){return this.client.rest.put(Ot,e)}delete(e){return this.client.rest.delete(Ot,e)}size(e){return this.client.rest.get(jt,e)}makeCurrent(e){return this.client.rest.post(Lt,e)}lock(e){return this.client.rest.post(Rt,e)}unlock(e){return this.client.rest.post(It,e)}}export{r as AccessRights,n as AuthApiService,oe as BASE_URL_V1,ce as BASE_URL_V2,o as CONNECTIONS_PERMISSION,le as Client,l as ConnectionGroup,u as ConnectionType,q as ConnectionsApiService,G as DiscoveryApiService,V as DivideApiService,$ as DivideMode,p as DivideScope,a as EngineType,h as ExtensionFileMode,d as ExtensionType,ge as ExtensionsApiService,$e as ExtensionsExternalApiService,ke as FcaApiService,Se as GatewayApiService,xe as GroupApiService,Te as LicenseApiService,k as LicenseError,S as LimitationSubType,w as LimitationType,Oe as LimitationsApiService,Ee as LinksApiService,Re as LogstashApiService,ne as NEED_TOKEN_UPDATE_ERROR,y as NotificationAction,Ne as NotificationApiService,b as NotificationEntityType,x as NotificationRowAction,A as NotificationStyle,c as OrderDirection,_ as PermissionType,be as QueryInitViewType,D as RequestMethod,T as RequestObserve,C as ResponseType,ae as Rest,f as RestrictionBooleanStatus,v as RestrictionModeKey,U as RestrictionSharing,g as RestrictionStatus,He as RoleApiService,L as SettingControlType,Ze as ShareApiService,Xe as StorageCommentApiService,nt as StorageElementApiService,B as StorageElementCheckStatus,z as StorageElementContentType,W as StorageElementHistoryAction,j as StorageElementType,ht as StorageFilesApiService,pt as StorageInstanceApiService,N as StorageRoot,gt as StorageShareApiService,vt as StorageTrashApiService,m as Tariff,re as TokenUpdate,Ut as UserApiService,I as UserAppType,E as UserAuthType,R as UserParamsLabel,P as UserStatus,O as UserType,zt as VersionApiService,Q as applyInterceptors,ee as getCookieValue,te as makeUrlParams,se as normalizeHeaders,ie as prepareRequestBody};
package/dist/index.d.ts CHANGED
@@ -5,12 +5,12 @@ interface StorageElement {
5
5
  content_type: StorageElementContentType;
6
6
  create_date: string;
7
7
  created_by_extension?: string;
8
- del_group_id: number;
8
+ del_group_id?: number;
9
9
  divide_id?: number;
10
10
  file_name_ext: string;
11
11
  full_path: string;
12
12
  is_favorite: boolean;
13
- last_used_extension: string;
13
+ last_used_extension?: string;
14
14
  name: string;
15
15
  owner_id: number;
16
16
  path: string;
@@ -111,8 +111,8 @@ interface StorageElementVersion {
111
111
  create_date: string;
112
112
  description: string;
113
113
  id: string;
114
- is_current_version: boolean;
115
- name: string;
114
+ is_current_version?: boolean;
115
+ name: string | null;
116
116
  size: number;
117
117
  user_id: number;
118
118
  update_date: string;
@@ -860,46 +860,6 @@ interface LockScreen {
860
860
  duration: number;
861
861
  }
862
862
 
863
- interface ArchiveProcess<T extends ArchivePayload | ArchiveEndPayload> {
864
- create_date: string;
865
- entity_type: string;
866
- service_name: string;
867
- action: NotificationAction;
868
- title: string;
869
- read: boolean;
870
- style: string;
871
- payload: T;
872
- user_id: number;
873
- event_timestamp: string;
874
- type_message: string;
875
- from_user_id: number | null;
876
- id?: number;
877
- }
878
- interface ArchivePayload {
879
- process_id: string;
880
- src_path: string[];
881
- zip_name: string;
882
- current_file: string;
883
- sum_size: number;
884
- written_size: number;
885
- progress: number;
886
- speed: number;
887
- seconds_left: number;
888
- dst_path?: string;
889
- divide_id?: number;
890
- dst_divide_id?: number;
891
- }
892
- interface ArchiveEndPayload {
893
- process_id: string;
894
- element_path: string;
895
- ref_code: string;
896
- zip_name: string;
897
- error?: string;
898
- divide_id?: number;
899
- dst_divide_id?: number;
900
- zip_size?: number;
901
- }
902
-
903
863
  interface UserNotification {
904
864
  action: NotificationAction;
905
865
  id: number;
@@ -992,7 +952,7 @@ interface NotificationActionEnabledGroup {
992
952
  enabled_system: boolean;
993
953
  enabled_mail: boolean;
994
954
  }
995
- type NotificationPayload = PayloadFile | ArchiveEndPayload | any;
955
+ type NotificationPayload = PayloadFile | PayloadArchive | any;
996
956
  interface PayloadFile {
997
957
  access_mode: PermissionType;
998
958
  create_date: string;
@@ -1004,6 +964,16 @@ interface PayloadFile {
1004
964
  type: StorageElementType;
1005
965
  update_date: string;
1006
966
  }
967
+ interface PayloadArchive {
968
+ process_id: string;
969
+ element_path: string;
970
+ ref_code: string;
971
+ zip_name: string;
972
+ error?: string;
973
+ divide_id?: number;
974
+ dst_divide_id?: number;
975
+ zip_size?: number;
976
+ }
1007
977
 
1008
978
  interface Permission {
1009
979
  group_name: Lang;
@@ -1316,7 +1286,7 @@ declare class StorageFilesApiService {
1316
1286
  time_zone?: number;
1317
1287
  }): Promise<void>;
1318
1288
  createZip(params: CreateZipRequestParams): Promise<void>;
1319
- cancelCreateZip(params: {
1289
+ cancelProcess(params: {
1320
1290
  process_id: string;
1321
1291
  }): Promise<void>;
1322
1292
  unZip(params: UnZipRequestParams): Promise<void>;
@@ -1693,4 +1663,4 @@ declare function normalizeHeaders(headers: Headers | [string, string][] | Record
1693
1663
  declare function prepareRequestBody(body: unknown): XMLHttpRequestBodyInit | Document | null;
1694
1664
 
1695
1665
  export { AccessRights, AuthApiService, BASE_URL_V1, BASE_URL_V2, CONNECTIONS_PERMISSION, Client, ConnectionGroup, ConnectionType, ConnectionsApiService, DiscoveryApiService, DivideApiService, DivideMode, DivideScope, EngineType, ExtensionFileMode, ExtensionType, ExtensionsApiService, ExtensionsExternalApiService, FcaApiService, GatewayApiService, GroupApiService, LicenseApiService, LicenseError, LimitationSubType, LimitationType, LimitationsApiService, LinksApiService, LogstashApiService, NEED_TOKEN_UPDATE_ERROR, NotificationAction, NotificationApiService, NotificationEntityType, NotificationRowAction, NotificationStyle, OrderDirection, PermissionType, QueryInitViewType, RequestMethod, RequestObserve, ResponseType, Rest, RestrictionBooleanStatus, RestrictionModeKey, RestrictionSharing, RestrictionStatus, RoleApiService, SettingControlType, ShareApiService, StorageCommentApiService, StorageElementApiService, StorageElementCheckStatus, StorageElementContentType, StorageElementHistoryAction, StorageElementType, StorageFilesApiService, StorageInstanceApiService, StorageRoot, StorageShareApiService, StorageTrashApiService, Tariff, TokenUpdate, UserApiService, UserAppType, UserAuthType, UserParamsLabel, UserStatus, UserType, VersionApiService, applyInterceptors, getCookieValue, makeUrlParams, normalizeHeaders, prepareRequestBody };
1696
- export type { AccessToken, ArchiveEndPayload, ArchivePayload, ArchiveProcess, AuthToken, AuthTokenUpdate, AuthType, ChangeLicenseParams, Comment, CommentParams, Connection, ConnectionCreateParams, CopyResponse, CreateCommentParams, CreateLimitationsParams, CreateStorageElementParams, CreateUserGroupParams, CreateUserParams, CreateUserRoleParams, CreateZipRequestParams, CutLinkRequest, DeleteAllCommentParams, DeleteCommentParams, Discovery, DivideResourceParams, DivideResourceType, DivideResponseList, Extension, ExtensionDefault, ExtensionExternal, ExtensionExternalInList, ExtensionExternalListParams, ExtensionExternalReadmeParams, ExtensionListParams, ExtensionMetaPayload, ExtensionTag, ExtensionTagListParams, FileLocking, HistoryListRequestParams, HistoryNote, HistoryRequestParams, HttpEvent, HttpResponse, Lang, License, Limitation, LockScreen, NameExtensionListParams, NbAppState, NbClientParams, NbRequestParams, NotificationActionGroup, NotificationPayload, OnUploadProgress, PayloadFile, Permission, PermissionItem, ProgressEvent, QueryInitResponse, Quota, RequestAuthSettingsParams, RequestAuthTfaParams, RequestAuthTokenParams, RequestBaseParams, RequestConfig, RequestConnectionParams, RequestLimitationsListParams, RequestNotificationListParams, RequestShareLoginParams, RequestStorageListParams, RequestUserDivideParams, RequestUserGroupListParams, RequestUserListParams, RequestUserRoleListParams, RequestUsersLogParams, RequestVersionsSizeParams, ResourceAccess, ResponseItem, ResponseList, ResponseListNotification, Restriction, Setting, SettingField, SettingFieldView, SettingLang, SettingValue, SettingValueField, SettingVariant, SettingViewConnectionChoose, SettingViewSelect, ShareInfo, ShareModel, SizeBySection, StorageDivideElement, StorageElement, StorageElementFileInfo, StorageElementHistory, StorageElementPaste, StorageElementPasteParams, StorageElementVersion, StorageElementVersionLock, StorageInstance, StorageItemSizeParams, StorageItemSizePathParams, StorageRouteData, StorageSharingElement, StorageTrashElement, StorageTrashItem, UnZipRequestParams, UnionRestriction, UpdateCommentParams, UploadNetRequestParams, User, UserAppPasswordInfo, UserAppPasswords, UserDivide, UserGroup, UserInfo, UserLabel, UserNamesExtension, UserNotification, UserParams, UserPhone, UserRole, UserSession, UserToken, UsersLog, VersionLockRequestParams };
1666
+ export type { AccessToken, AuthToken, AuthTokenUpdate, AuthType, ChangeLicenseParams, Comment, CommentParams, Connection, ConnectionCreateParams, CopyResponse, CreateCommentParams, CreateLimitationsParams, CreateStorageElementParams, CreateUserGroupParams, CreateUserParams, CreateUserRoleParams, CreateZipRequestParams, CutLinkRequest, DeleteAllCommentParams, DeleteCommentParams, Discovery, DivideResourceParams, DivideResourceType, DivideResponseList, Extension, ExtensionDefault, ExtensionExternal, ExtensionExternalInList, ExtensionExternalListParams, ExtensionExternalReadmeParams, ExtensionListParams, ExtensionMetaPayload, ExtensionTag, ExtensionTagListParams, FileLocking, HistoryListRequestParams, HistoryNote, HistoryRequestParams, HttpEvent, HttpResponse, Lang, License, Limitation, LockScreen, NameExtensionListParams, NbAppState, NbClientParams, NbRequestParams, NotificationActionGroup, NotificationPayload, OnUploadProgress, PayloadArchive, PayloadFile, Permission, PermissionItem, ProgressEvent, QueryInitResponse, Quota, RequestAuthSettingsParams, RequestAuthTfaParams, RequestAuthTokenParams, RequestBaseParams, RequestConfig, RequestConnectionParams, RequestLimitationsListParams, RequestNotificationListParams, RequestShareLoginParams, RequestStorageListParams, RequestUserDivideParams, RequestUserGroupListParams, RequestUserListParams, RequestUserRoleListParams, RequestUsersLogParams, RequestVersionsSizeParams, ResourceAccess, ResponseItem, ResponseList, ResponseListNotification, Restriction, Setting, SettingField, SettingFieldView, SettingLang, SettingValue, SettingValueField, SettingVariant, SettingViewConnectionChoose, SettingViewSelect, ShareInfo, ShareModel, SizeBySection, StorageDivideElement, StorageElement, StorageElementFileInfo, StorageElementHistory, StorageElementPaste, StorageElementPasteParams, StorageElementVersion, StorageElementVersionLock, StorageInstance, StorageItemSizeParams, StorageItemSizePathParams, StorageRouteData, StorageSharingElement, StorageTrashElement, StorageTrashItem, UnZipRequestParams, UnionRestriction, UpdateCommentParams, UploadNetRequestParams, User, UserAppPasswordInfo, UserAppPasswords, UserDivide, UserGroup, UserInfo, UserLabel, UserNamesExtension, UserNotification, UserParams, UserPhone, UserRole, UserSession, UserToken, UsersLog, VersionLockRequestParams };
@@ -20,4 +20,3 @@ export * from './user-log';
20
20
  export * from './setting';
21
21
  export * from './storage';
22
22
  export * from './storage-trash';
23
- export * from './archive';
@@ -1,4 +1,3 @@
1
- import { ArchiveEndPayload } from './archive';
2
1
  import { PermissionType } from './divide';
3
2
  import { StorageElementType } from './storage';
4
3
  import { UserLabel } from './user';
@@ -94,7 +93,7 @@ interface NotificationActionEnabledGroup {
94
93
  enabled_system: boolean;
95
94
  enabled_mail: boolean;
96
95
  }
97
- export type NotificationPayload = PayloadFile | ArchiveEndPayload | any;
96
+ export type NotificationPayload = PayloadFile | PayloadArchive | any;
98
97
  export interface PayloadFile {
99
98
  access_mode: PermissionType;
100
99
  create_date: string;
@@ -106,4 +105,14 @@ export interface PayloadFile {
106
105
  type: StorageElementType;
107
106
  update_date: string;
108
107
  }
108
+ export interface PayloadArchive {
109
+ process_id: string;
110
+ element_path: string;
111
+ ref_code: string;
112
+ zip_name: string;
113
+ error?: string;
114
+ divide_id?: number;
115
+ dst_divide_id?: number;
116
+ zip_size?: number;
117
+ }
109
118
  export {};
@@ -6,12 +6,12 @@ export interface StorageElement {
6
6
  content_type: StorageElementContentType;
7
7
  create_date: string;
8
8
  created_by_extension?: string;
9
- del_group_id: number;
9
+ del_group_id?: number;
10
10
  divide_id?: number;
11
11
  file_name_ext: string;
12
12
  full_path: string;
13
13
  is_favorite: boolean;
14
- last_used_extension: string;
14
+ last_used_extension?: string;
15
15
  name: string;
16
16
  owner_id: number;
17
17
  path: string;
@@ -112,8 +112,8 @@ export interface StorageElementVersion {
112
112
  create_date: string;
113
113
  description: string;
114
114
  id: string;
115
- is_current_version: boolean;
116
- name: string;
115
+ is_current_version?: boolean;
116
+ name: string | null;
117
117
  size: number;
118
118
  user_id: number;
119
119
  update_date: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nb-js-client",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "main": "dist/bundle.cjs.js",
5
5
  "module": "dist/bundle.esm.js",
6
6
  "files": [