nb-js-client 1.0.79 → 1.0.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.cjs.js +1 -1
- package/dist/bundle.esm.js +1 -1
- package/dist/index.d.ts +13 -2
- package/dist/types/license.d.ts +12 -1
- package/package.json +1 -1
package/dist/bundle.cjs.js
CHANGED
|
@@ -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",n.DemoAdmin="demo_admin",n.SpaceManage="space_manage";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,l,p,u,d,h,g,_,$,x,v,m,S,y,f,w,A,k,T,b,C,R,E,D,U,P,L,N,I,O,q,z,F,M;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.ColorTypes=void 0,(l=exports.ColorTypes||(exports.ColorTypes={})).Yellow="yellow",l.Success="success",l.Critical="critical",l.Warning="warning",l.Brand="brand",l.Purple="purple",l.Primary="primary",l.Gray="gray",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,(u=exports.ConnectionType||(exports.ConnectionType={})).SSH="ssh_connection",u.YandexDisk="yandex_disk",u.Mail="mail",u.Discord="discord",u.Webdav="webdav_connection",u.Nextcloud="nextcloud_connection",u.NextBox="nextbox_connection",u.HttpProxy="http_proxy_connection",u.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,(h=exports.ExtensionFileMode||(exports.ExtensionFileMode={})).Read="read",h.ReadAndWrite="read_and_write",h.Write="write",exports.DivideScope=void 0,(g=exports.DivideScope||(exports.DivideScope={})).Storage="/storage/element",g.Connection="/connections",exports.PermissionType=void 0,(_=exports.PermissionType||(exports.PermissionType={})).Close="",_.Read="r",_.Write="rw",_.Full="rwd",_.SpaceManage="space_manage",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,(m=exports.RestrictionModeKey||(exports.RestrictionModeKey={})).Divide="divide",m.Share="share",exports.Tariff=void 0,(S=exports.Tariff||(exports.Tariff={})).Free="free",S.Business="business",S.Enterprise="enterprise",exports.LicenseError=void 0,(y=exports.LicenseError||(exports.LicenseError={})).NotActivated="License not activated",y.Blocked="License blocked",y.Expired="License has been expired",y.NotValid="License not valid",y.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,(w=exports.LimitationSubType||(exports.LimitationSubType={})).Size="size",w.White="extension_white",w.Black="extension_black",exports.NotificationEntityType=void 0,(A=exports.NotificationEntityType||(exports.NotificationEntityType={})).Dir="dir",A.File="file",A.User="user",A.Other="other",A.WorkDir="work_dir",A.License="license",A.Extension="extension",A.Connection="connection",exports.NotificationAction=void 0,(k=exports.NotificationAction||(exports.NotificationAction={})).SecurityCheckNegative="action_security_check_negative",k.SecurityCheckPositive="action_security_check_positive",k.CommentVersionMention="action_version_comment_mention",k.OpenSharing="open_sharing",k.ChangeSharing="change_sharing",k.CancelSharing="cancel_sharing",k.DivideDirAddFileToOwner="divide_dir_add_file_to_owner",k.DivideDirAddDirToOwner="divide_dir_add_dir_to_owner",k.DivideDirAddWorkDirToOwner="divide_dir_add_work_dir_to_owner",k.DivideConnectionAddFileToOwner="divide_connection_add_file_to_owner",k.DivideConnectionAddDirToOwner="divide_connection_add_dir_to_owner",k.CancelDivideDir="cancel_divide_dir",k.CancelDivideFile="cancel_divide_file",k.CancelDivideWorkDir="cancel_divide_work_dir",k.CancelDivideConnection="cancel_divide_connection",k.DeleteExtension="delete_extension",k.NewVersionExtension="new_version_extension",k.TransferData="transfer_data",k.AllowInternalAccessUser="allow_internal_access_to_user",k.BlockInternalAccessUser="block_internal_access_to_user",k.WaitInternalAccessUser="wait_internal_access_to_user",k.WaitInternalAccessUserCreate="wait_internal_access_to_user_create",k.AllowInternalAccessGroup="allow_internal_access_to_group",k.BlockInternalAccessGroup="block_internal_access_to_group",k.WaitInternalAccessGroup="wait_internal_access_to_group",k.WaitInternalAccessGroupCreate="wait_internal_access_to_group_create",k.AllowSharing="allow_sharing",k.BlockSharing="block_sharing",k.WaitSharing="wait_sharing",k.WaitSharingCreate="wait_sharing_create",k.StatusCreateZipProcess="status_create_zip_process",k.StatusCreateZipSuccess="status_create_zip_success",k.StatusCreateZipError="status_create_zip_error",k.DownloadZipSuccess="download_zip_success",k.DownloadZipError="download_zip_error",k.StatusUnzipProcess="status_unzip_process",k.StatusUnzipSuccess="status_unzip_success",k.StatusUnzipError="status_unzip_error",k.StatusUnzipSuccessWithLimits="status_unzip_success_with_limits",k.AnonymZipDirAddFileToOwner="anonym_zip_dir_add_file_to_owner",k.GuestZipDirAddFileToOwner="guest_zip_dir_add_file_to_owner",k.DropDocumentOnlyoffice="drop_document_onlyoffice",k.CopyError="copy_error",k.CopySuccess="copy_success",k.StatusCopyProcess="status_copy_process",k.Other="other",k.Application="application",exports.NotificationRowAction=void 0,(T=exports.NotificationRowAction||(exports.NotificationRowAction={})).Read="read",T.Unread="unread",T.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,(C=exports.ResponseType||(exports.ResponseType={})).ArrayBuffer="arraybuffer",C.Blob="blob",C.Json="json",C.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,(E=exports.RequestObserve||(exports.RequestObserve={})).Body="body",E.Response="response",exports.RestrictionSharing=void 0,(D=exports.RestrictionSharing||(exports.RestrictionSharing={})).NONE="none",D.SOFT="soft",D.HARD="hard",exports.UserAuthType=void 0,(U=exports.UserAuthType||(exports.UserAuthType={})).Native="native",U.Ldap="ldap",U.Vk="vk",exports.UserStatus=void 0,(P=exports.UserStatus||(exports.UserStatus={})).Registering="registering",P.Activated="activated",P.BlockedByAdmin="blocked_by_admin",P.BlockedByLicense="blocked_by_license",P.BlockedByInactive="blocked_by_inactive",P.BlockedByInactiveChangePassword="blocked_by_inactive_change_password",exports.UserType=void 0,(L=exports.UserType||(exports.UserType={})).User="user",L.Guest="guest",L.Emperor="emperor",L.Anonymous="anonymous",exports.UserParamsLabel=void 0,(N=exports.UserParamsLabel||(exports.UserParamsLabel={})).Theme="theme",N.Lang="lang",N.Sort="sort",N.ViewApps="viewApps",N.WithoutContentWorkDir="withoutContentWorkDir",N.DashboardGrid="dashboardGrid",exports.UserAppType=void 0,(exports.UserAppType||(exports.UserAppType={})).Webdav="webdav",exports.SettingControlType=void 0,(I=exports.SettingControlType||(exports.SettingControlType={})).Text="text",I.String="string",I.Number="number",I.CheckBox="checkbox",I.Select="select",I.RadioList="radio_list",I.ConnectionChoose="connection_choose",I.MultiConnectionChoose="multi_connection_choose",I.ActivitySwitch="activity_switch",exports.StorageElementType=void 0,(O=exports.StorageElementType||(exports.StorageElementType={})).Dir="dir",O.File="file",O.WorkDir="work_dir",O.App="app",exports.StorageElementContentType=void 0,(q=exports.StorageElementContentType||(exports.StorageElementContentType={})).Any="any",q.Dir="dir",q.Code="code",q.Image="image",q.Audio="audio",q.Video="video",q.Text="text",q.Doc="doc",q.Xls="xls",q.Ppt="ppt",exports.StorageRoot=void 0,(z=exports.StorageRoot||(exports.StorageRoot={})).my="my",z.fca="fca",z.divide="divide",z.share="share",z.favorite="favorite",z.trash="trash",z.spaces="spaces",exports.StorageElementHistoryAction=void 0,(F=exports.StorageElementHistoryAction||(exports.StorageElementHistoryAction={})).Create="create",F.Update="update",F.Move="move",exports.StorageElementCheckStatus=void 0,(M=exports.StorageElementCheckStatus||(exports.StorageElementCheckStatus={}))[M.CheckNull=0]="CheckNull",M[M.CheckInProgress=1]="CheckInProgress",M[M.CheckPositive=2]="CheckPositive",M[M.CheckNegative=3]="CheckNegative";const B="/connections",W=`${B}/dashboard`;class H{constructor(e){this.client=e}list(e){return this.client.rest.get(B,e)}get(e){return this.client.rest.get(`${B}/${e}`)}update(e,t){return this.client.rest.put(`${B}/${e}`,t)}delete(e){return this.client.rest.delete(`${B}/${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]||B,e)}dashboard(e){return this.client.rest.get(W,e)}}class G{constructor(e){this.client=e}discovery(e){return this.client.rest.get("/discovery",e)}}const j="/divide",V=`${j}/restrictions`,Z=`${j}/tag_group`;class J{constructor(e){this.client=e}divideDelete(e,t){return this.client.rest.delete(`${e}${j}/${t}`)}divideDeleteAll(e,t,s,r){return this.client.rest.delete(`${e}${j}`,{...this.makeParam(e,t),is_to_user_group:r,access_mode:s})}divideChange(e,t,s){return this.client.rest.put(`${e}${j}/${t}`,{access_mode:s})}divideCreate(e,t,s,r,i){const n={...this.makeParam(e,t),[i]:s,access_mode:r};return this.client.rest.post(`${e}${j}`,n)}divideUsers(e,t,s){return this.client.rest.get(`${e}${j}/users`,{...this.makeParam(e,t),...s})}divideTagGroupList(e){return this.client.rest.get(`${exports.DivideScope.Storage}${Z}`,e)}getRestriction(e){return this.client.rest.get(`${V}/${e}`)}restrictionSize(e,t){return this.client.rest.get(`/${t}/restrictions/${e}/size`)}restrictions(e){return this.client.rest.get(`${V}`,e)}restrictionsChange(e,t){return this.client.rest.put(`${V}/${e}`,t)}makeParam(e,t){const s={};return e===exports.DivideScope.Connection?s.connection_id=t:s.path=t,s}}const K="/api/v1",Q="/api/v2",Y="/static/extensions",X="/extensions/defaults",ee=`${Y}/names/users`,te=`${Y}/names/system`,se=`${Y}/tags`;class re{constructor(e){this.client=e}getSetting(e){return this.client.rest.get(`${Y}/${e}/settings`)}setSetting(e,t){return this.client.rest.post(`${Y}/${e}/settings`,t)}deleteSetting(e){return this.client.rest.delete(`${Y}/${e}/settings`)}get(e){return this.client.rest.get(`${Y}/${e}`)}getByKey(e){return this.client.rest.get(`${Y}/${e}`)}getDefault(e=[]){return this.client.rest.get(X,{ext_code:e})}setDefault(e,t){return this.client.rest.post(X,{ext_code:e,ext_uniq_key:t})}checkUpdates(){return this.client.rest.post(`${Y}/check_updates`)}updateVersion(e,t){return this.client.rest.put(`${Y}/${e}`,{version:t})}list(e){return this.client.rest.get(Y,e)}listTags(e){return this.client.rest.get(se,e)}delete(e,t){return this.client.rest.delete(`${Y}/${e}`)}upload(e,t){const s=new FormData;s.set("file",t);const{promise:r,abort:i}=this.client.rest.upload(Y,s,{version:Q,onUploadProgress:t=>{e(t)}});return{promise:r,abort:i}}install(e,t){return this.client.rest.post(`${Y}/site`,{uniq_key:e,version:t},{version:Q})}getSystemNameExts(e){return this.client.rest.get(te,e)}getUserNameExts(e){return this.client.rest.get(ee,e)}createUserNameExt(e){return this.client.rest.post(`${ee}`,{name:e})}deleteUserNameExt(e){return this.client.rest.delete(`${ee}/${e}`)}deleteAllUserNameExts(){return this.client.rest.delete(`${ee}`)}}const ie="/anons_ext/extensions";class ne{constructor(e){this.client=e}listExtensionsSite(e){return this.client.rest.get(ie,e,{host:"https://next-box.ru"})}extensionDetailSite(e){return this.client.rest.get(`${ie}/${e}`,{},{host:"https://next-box.ru"})}extensionMarkdown(e,t){return this.client.rest.get(`${ie}/${e.uniqKey}/readme`,{lang:e.lang},{...t,host:"https://next-box.ru"})}}const oe="/disk",ce=`${oe}/check`;class ae{constructor(e){this.client=e}info(e,t){return this.client.rest.get(`${oe}/${e}/element`,{path:t})}list(e,t){return this.client.rest.get(`${oe}/${e}`,t)}create(e,t){return this.client.rest.post(`${oe}/${e}/element`,t)}replace(e,t,s){return this.client.rest.put(`${oe}/${e}/files?path=${t}`,s)}read(e,t){return this.client.rest.get(`${oe}/${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(`${oe}/${t}/files`,i,{onUploadProgress:t=>{e(t)}});return{promise:n,abort:o}}uploadNet(e,t){return this.client.rest.post(`${oe}/${e}/files/net`,t)}delete(e,t){return this.client.rest.delete(`${oe}/${e}/trash/element`,{path:t})}check(e){return this.client.rest.post(ce,e)}}const le="/settings";class pe{constructor(e){this.client=e}settings(){return this.client.rest.get(le)}changeSettings(e){return this.client.rest.post(le,e)}queryInit(){return this.client.rest.get("/query/init")}}var ue;exports.QueryInitViewType=void 0,(ue=exports.QueryInitViewType||(exports.QueryInitViewType={})).Standard="Standard",ue.Simple="Simple";const de="/groups";class he{constructor(e){this.client=e}list(e){return this.client.rest.get(de,e)}get(e){return this.client.rest.get(`${de}/${e}`)}listUsers(e,t){return this.client.rest.get(`${de}/${e}/users`,t)}default(){return this.client.rest.get(`${de}/default`)}create(e){return this.client.rest.post(de,e)}update(e,t){return this.client.rest.put(`${de}/${e}`,t)}delete(e){return this.client.rest.delete(`${de}/${e}`)}}const ge="/license",_e=`${ge}/manual-check`,$e=`${ge}/hardware/hash`;class xe{constructor(e){this.client=e}info(){return this.client.rest.get(ge)}create(e){return this.client.rest.post(ge,e)}check(){return this.client.rest.post(_e)}delete(){return this.client.rest.delete(ge)}getHash(){return this.client.rest.get($e)}}const ve="/links";class me{constructor(e){this.client=e}createShortLink(e){return this.client.rest.post(ve,e)}updateShortLink(e){return this.client.rest.put(ve,e)}}const Se="/limitations";class ye{constructor(e){this.client=e}me(){return this.client.rest.get("/limitations/user/me")}list(e){return this.client.rest.get(Se,e)}listUsers(e,t){return this.client.rest.get(`${Se}/${e}/users`,t)}create(e){return this.client.rest.post(Se,e)}get(e){return this.client.rest.get(`${Se}/${e}`)}update(e,t){return this.client.rest.put(`${Se}/${e}`,t)}delete(e){return this.client.rest.delete(`${Se}/${e}`)}getLimitationsByUser(e){return this.client.rest.get(`/limitations/user/${e}`)}addUserToLimitation(e,t){return this.client.rest.patch(`${Se}/${e}/user`,{id:t})}deleteUserFromLimitation(e,t){return this.client.rest.delete(`${Se}/${e}/user/${t}`)}}const fe="/logs/users",we=`${fe}/actions`;class Ae{constructor(e){this.client=e}getUsersLogs(e){return this.client.rest.get(`${fe}`,e)}getLogsActions(e){return this.client.rest.get(`${we}`,e)}}const ke="/notifications",Te=`${ke}/all`,be=`${ke}/subscription`,Ce=`${be}/extension`,Re=`${ke}/permission`,Ee=`${ke}/task`;class De{constructor(e){this.client=e}list(e){return this.client.rest.get(ke,e)}task(e){return this.client.rest.get(`${Ee}/${e}`)}toggleStatus(e,t){return this.client.rest.put(ke,{ids:e,to_status:t})}toggleAllStatus(e){return this.client.rest.put(Te,{to_status:e})}delete(e){return this.client.rest.delete(ke,{id:e})}deleteAll(){return this.client.rest.delete(Te)}getPermission(){return this.client.rest.get(Re)}setPermission(e){return this.client.rest.post(Re,{enabled:e})}getSubscription(){return this.client.rest.get(be)}getSubscriptionExtension(){return this.client.rest.get(Ce)}setSubscription(e){const t={action_groups:{...e}};return this.client.rest.post(be,t)}setSubscriptionExtension(e){const t={application_groups:{...e}};return this.client.rest.post(Ce,t)}}const Ue="/roles",Pe=`${Ue}/default`,Le="/permissions";class Ne{constructor(e){this.client=e}list(e){return this.client.rest.get(Ue,e)}get(e){return this.client.rest.get(`${Ue}/${e}`)}getDefault(){return this.client.rest.get(`${Pe}`)}create(e){return this.client.rest.post(Ue,e)}update(e,t){return this.client.rest.put(`${Ue}/${e}`,t)}delete(e){return this.client.rest.delete(`${Ue}/${e}`)}permissionList(){return this.client.rest.get(Le)}addPermission(e,t){return this.client.rest.put(`${Ue}/${e}/permissions`,{ids:t})}deletePermission(e,t){return this.client.rest.delete(`${Ue}/${e}/${Le}`,{ids:t})}}const Ie="/share",Oe=`${Ie}/restrictions`,qe=`${Ie}/login`;class ze{constructor(e){this.client=e}info(e){return this.client.rest.get(`${Ie}?share_token=${e}`)}checkPassword(e,t){const s=encodeURIComponent(e);return this.client.rest.get(`${Ie}/password?share_token=${t}&share_pass=${s}`)}getRestriction(e){return this.client.rest.get(`${Oe}/${e}`)}restrictions(e){return this.client.rest.get(Oe,e)}restrictionsChange(e,t){return this.client.rest.put(`${Oe}/${e}`,t)}login(e){return this.client.rest.post(`${qe}`,e)}}const Fe="/storage/element/version/comment",Me=`${Fe}/all`;class Be{constructor(e){this.client=e}list(e){return this.client.rest.get(`${Fe}`,e)}create(e){return this.client.rest.post(`${Fe}`,e)}update(e){return this.client.rest.put(`${Fe}`,e)}delete(e){return this.client.rest.delete(`${Fe}`,e)}deleteAll(e){return this.client.rest.delete(`${Me}`,e)}}const We="/storage",He=`${We}/element`,Ge=`${He}/divide`,je=`${Ge}/resource`,Ve=`${He}/move`,Ze=`${He}/copy`,Je=`${He}/content_type_size`,Ke="/disk";class Qe{constructor(e,t){this.client=e,this.fcaApiService=t}list(e){return this.client.rest.get(We,e)}info(e){return Object.keys(e).forEach((t=>{const s=t;e[s]||delete e[s]})),this.client.rest.get(He,e)}fileInfo(e,t){return this.client.rest.get(`${He}/${e}`,t?{file_version_id:t}:{})}combineInfo({root:e,rootId:t,id:s,path:r,file_version_id:i,zip_entry_path:n}){return e===exports.StorageRoot.fca&&t?this.fcaApiService.info(t,r):s?this.info({file_container_id:s,divide_id:t,file_version_id:i,zip_entry_path:n}):this.info({path:r,divide_id:t,file_version_id:i,zip_entry_path:n})}size(e){return this.client.rest.post(`${He}/size`,e)}move(e,t,s){const{from_divide_id:r,to_divide_id:i}=e;let n={...e,from_divide_id:null,to_divide_id:null};return t===exports.StorageRoot.fca&&s===exports.StorageRoot.fca?this.client.rest.post(`${Ke}/${r}/files/move${Ke}/${i}`,n):t===exports.StorageRoot.fca?(r&&(n.from_divide_id=r),this.client.rest.put(`${Ke}/${i}/files/from/box`,n)):s===exports.StorageRoot.fca?(i&&(n.to_divide_id=i),this.client.rest.put(`${Ke}/${r}/files/to/box`,n)):this.client.rest.post(Ve,e)}copy(e,t,s){const{from_divide_id:r,to_divide_id:i}=e;let n={...e,from_divide_id:null,to_divide_id:null};return s===exports.StorageRoot.fca&&t===exports.StorageRoot.fca?this.client.rest.post(`${Ke}/${r}/files/copy${Ke}/${i}`,n):s===exports.StorageRoot.fca?(r&&(n.from_divide_id=r),this.client.rest.post(`${Ke}/${i}/files/from/box`,n)):t===exports.StorageRoot.fca?(i&&(n.to_divide_id=i),this.client.rest.post(`${Ke}/${r}/files/to/box`,n)):this.client.rest.post(Ze,e)}pasteFromShared(e,t,s){const r={from_sharing_token:e,from_sharing_password:s,paths:t};return this.client.rest.post(`${He}/copy`,r)}create(e){return this.client.rest.post(He,e)}delete(e,t){const s={path:e};return t&&(s.divide_id=t),this.client.rest.delete(He,s)}favorite(e){return this.client.rest.put(`${He}?path=${encodeURIComponent(e)}`,{is_favorite:!0})}removeFavorite(e){return this.client.rest.put(`${He}?path=${encodeURIComponent(e)}`,{is_favorite:!1})}createItem(e){return this.client.rest.post(He,e)}createWorkDir(e){return this.client.rest.post(He,e)}sizeWithSection(e){return this.client.rest.get(Je,e)}getDivideResources(e){return this.client.rest.get(je,e)}getQuota(e){return this.client.rest.get(`${He}/user_size`,e)}hide(e){return this.client.rest.post(`${Ge}/hide`,e)}unhide(e){return this.client.rest.post(`${Ge}/unhide`,e)}}const Ye="/storage/files",Xe=`${Ye}/net`,et=`${Ye}/unzip`,tt=`${Ye}/zip`,st=`${tt}/download`,rt=`${Ye}/process`,it=`${Ye}/code`;class nt{constructor(e){this.client=e}read(e,t){return t.path=e,this.client.rest.get(Ye,t)}replace(e,t){const s=Object.fromEntries(Object.entries(e).filter((([,e])=>null!=e)).map((([e,t])=>[e,String(t)])));return this.client.rest.put(Ye,t,{params:s})}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(Ye,i,{onUploadProgress:t=>{e(t)}});return{promise:n,abort:o}}uploadNet(e){return this.client.rest.post(Xe,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(st,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(tt,e)}cancelProcess(e){return this.client.rest.delete(rt,e)}unZip(e){return this.client.rest.post(et,e)}checkZip(e){return this.client.rest.head(it,e)}}class ot{constructor(e){this.client=e}instance(){return this.client.rest.get("/storage/instance")}}const ct="/storage/element/share";class at{constructor(e){this.client=e}info(e){return this.client.rest.get(ct,{path:e})}create(e,t){const s={path:e,permissions_type:t};return this.client.rest.post(ct,s)}change(e){return this.client.rest.put(`${ct}/${e.token}`,e)}delete(e){return this.client.rest.delete(ct,{path:e})}refresh(e){return this.client.rest.put(`${ct}/${e}/refresh`)}}const lt="/storage/trash/element",pt=`${lt}/all`;class ut{constructor(e){this.client=e}clear(e){return this.client.rest.delete(lt,e)}clearAll(){return this.client.rest.delete(pt)}restore(e){return this.client.rest.patch(lt,{del_groups:e})}restoreAll(){return this.client.rest.patch(pt)}}const dt="/users",ht=`${dt}/me`,gt=`${ht}/avatars`,_t=`${ht}/sessions`,$t=`${ht}/tokens`,xt=`${ht}/params`,vt=`${ht}/app-passwords`,mt=`${ht}/change-password`,St=`${dt}/initial`,yt=`${ht}/phone`,ft=`${yt}/confirm`;class wt{constructor(e){this.client=e}initial(e){return this.client.rest.post(St,e)}list(e){return this.client.rest.get(dt,e)}get(e){return this.client.rest.get(dt+`/${e}`)}create(e){return this.client.rest.post(dt,e)}update(e,t){return this.client.rest.put(dt+`/${e}`,t)}delete(e,t){return this.client.rest.delete(`${dt}/${e}`,t)}restore(e){return this.client.rest.post(`${dt}/${e}/restore`)}me(){return this.client.rest.get(ht)}updateMe(e){return this.client.rest.put(ht,e)}createToken(e){return this.client.rest.post($t,e)}listToken(e){return this.client.rest.get($t,e)}deleteToken(e){return this.client.rest.delete(`${$t}/${e}`)}changeMyPassword(e){return this.client.rest.put(mt,e)}changeUsersPassword(e,t){return this.client.rest.put(`${dt}/${e}/change-password`,t)}meUploadAvatar(e,t){const s=new FormData;return s.append("file",e,t),this.client.rest.post(gt,s)}meDeleteAvatar(){return this.client.rest.delete(gt)}meListSession(e){return this.client.rest.get(_t,e)}meDeleteSession(e){let t=_t;return e&&(t+=`/${e}`),this.client.rest.delete(t)}setRole(e,t=null){return this.client.rest.put(`${dt}/${e}/roles`,{role_id:t})}meParams(e){return this.client.rest.get(xt,{name:e})}meSetParams(e,t){return this.client.rest.post(`${xt}/${e}`,t)}meListParams(){return this.client.rest.get(xt)}phone(e){return this.client.rest.post(yt,e)}phoneConfirm(e){return this.client.rest.post(`${ft}/${e}`)}appPasswordsList(e){return this.client.rest.get(vt,e)}createAppPasswords(e){return this.client.rest.post(vt,e)}deleteAppPasswords(e){return this.client.rest.delete(`${vt}/${e}`)}}const At="/users/appeals",kt=`${At}/category`,Tt=`${At}/subcategory`,bt=`${At}/file`;class Ct{constructor(e){this.client=e}category(){return this.client.rest.get(kt)}subcategory(e){return this.client.rest.get(Tt,{category_code:e})}uploadFile(e){const t=new FormData;return t.append("file",e),this.client.rest.post(bt,t)}deleteFile(e){return this.client.rest.delete(`${bt}/${e}`)}createAppeal(e){return this.client.rest.post(At,e)}}const Rt="/storage/element",Et=`${Rt}/history`,Dt=`${Rt}/version`,Ut=`${Dt}/lock`,Pt=`${Dt}/unlock`,Lt=`${Dt}/current`,Nt=`${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(Nt,e)}makeCurrent(e){return this.client.rest.post(Lt,e)}lock(e){return this.client.rest.post(Ut,e)}unlock(e){return this.client.rest.post(Pt,e)}}const Ot="/version",qt=`${Ot}/changelog`;class zt{constructor(e){this.client=e}getVersions(e){return this.client.rest.get(Ot,e)}getChangelog(e){return this.client.rest.get(qt,{version_number:e})}}const Ft="/tag",Mt=`${Ft}/list`;class Bt{constructor(e){this.client=e}list(e){return this.client.rest.get(Mt,e)}get(e){return this.client.rest.get(`${Ft}/${e}`)}assign(e,t){return this.client.rest.post(`${Ft}/${e}/assign`,{items:t})}unassign(e,t){return this.client.rest.post(`${Ft}/${e}/unassign`,{items:t})}create(e){return this.client.rest.post(Ft,e)}update(e,t){return this.client.rest.put(`${Ft}/${e}`,t)}delete(e){return this.client.rest.delete(`${Ft}/${e}`)}}const Wt="/spaces",Ht=`${Wt}/access`;class Gt{constructor(e){this.client=e}space(e){return this.client.rest.get(`${Wt}/${e}`)}list(e){return this.client.rest.get(Wt,e)}create(e){return this.client.rest.post(Wt,e)}update(e,t){return this.client.rest.put(`${Wt}/${e}`,t)}delete(e){return this.client.rest.delete(`${Wt}/${e}`)}adminsList(e,t){return this.client.rest.get(`${Wt}/${e}/admins`,t)}accessList(e){return this.client.rest.get(Ht,e)}provideAccess(e){return this.client.rest.post(Ht,e)}deleteAllAccess(e){return this.client.rest.delete(Ht,e)}updateAccess(e,t){return this.client.rest.put(`${Ht}/${e}`,t)}deleteAccess(e,t){return this.client.rest.delete(`${Ht}/${e}`,{space_id:t})}}const jt="/spaces",Vt="/files",Zt=`${Vt}/copy`,Jt=`${Vt}/upload`,Kt=`${Vt}/lock`,Qt=`${Vt}/unlock`,Yt=`${`${Vt}/download`}/zip`,Xt=`${Vt}/recover`,es=`${Xt}/all`,ts=`${Vt}/trash`,ss=`${ts}/all`;class rs{constructor(e){this.client=e}list(e,t){return this.client.rest.get(`${jt}/${e}${Vt}/list`,t)}get(e,t){return this.client.rest.get(`${jt}/${e}${Vt}`,t)}create(e,t){return this.client.rest.post(`${jt}/${e}${Vt}`,t)}replace(e,t,s){const r=Object.fromEntries(Object.entries(t).filter((([,e])=>null!=e)).map((([e,t])=>[e,String(t)])));return this.client.rest.put(`${jt}/${e}${Vt}`,s,{params:r})}delete(e,t){return this.client.rest.delete(`${jt}/${e}${Vt}`,t)}copy(e,t){return this.client.rest.post(`${jt}/${e}${Zt}`,t)}copyFromNextbox(e,t){return this.client.rest.post(`${jt}/${e}${Zt}/from/nextbox`,t)}copyToNextbox(e,t){return this.client.rest.post(`${jt}/${e}${Zt}/to/nextbox`,t)}download(e,t){return this.client.rest.get(`${jt}/${e}${Vt}/download`,t,{responseType:exports.ResponseType.Blob})}createZipToDownload(e,t){return this.client.rest.get(`${jt}/${e}${Yt}`,t,{responseType:exports.ResponseType.Blob})}move(e,t){return this.client.rest.post(`${jt}/${e}${Vt}/move`,t)}rename(e,t){return this.client.rest.post(`${jt}/${e}${Vt}/rename`,t)}upload(e,t,s,r){var i;const n=new FormData;n.set("overwrite",String(null!==(i=r.overwrite)&&void 0!==i&&i)),r.parent_id&&n.set("parent_id",r.parent_id),n.set("file",s);const{promise:o,abort:c}=this.client.rest.upload(`${jt}/${t}${Jt}`,n,{onUploadProgress:t=>{e(t)}});return{promise:o,abort:c}}uploadNet(e,t){return this.client.rest.post(`${jt}/${e}${Jt}/net`,t)}recover(e,t){return this.client.rest.post(`${jt}/${e}/${Xt}`,{del_group_ids:t})}recoverAll(e){return this.client.rest.post(`${jt}/${e}/${es}`)}trash(e,t){return this.client.rest.delete(`${jt}/${e}/${ts}`,{del_group_id:t})}trashAll(e){return this.client.rest.delete(`${jt}/${e}/${ss}`)}lock(e,t){return this.client.rest.post(`${jt}/${e}/${Kt}`,{file_id:t})}unlock(e,t){return this.client.rest.post(`${jt}/${e}/${Qt}`,{file_id:t})}branch(e,t){return this.client.rest.get(`${jt}/${e}/branch`,{file_id:t})}}class is extends Error{}function ns(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 os(e,t){if("string"!=typeof e)throw new is("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 is(`Invalid token specified: missing part #${s+1}`);let i;try{i=ns(r)}catch(e){throw new is(`Invalid token specified: invalid base64 for part #${s+1} (${e.message})`)}try{return JSON.parse(i)}catch(e){throw new is(`Invalid token specified: invalid json for part #${s+1} (${e.message})`)}}is.prototype.name="InvalidTokenError";const cs=async(e,t)=>{let s=t;for(const t of e)try{s=await t.fulfilled(s)}catch(e){if(!t.rejected)throw e;s=await t.rejected(e)}return s};function as(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 ls=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 ps(e){return e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):e}function us(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 ds="update black token";class hs{constructor(){this.isUpdating=!1,this.tokenUpdateResolve=null}isTokenExpire(e){if(!e)return!1;return 1e3*e<=(new Date).getTime()+3e3}async refreshToken(e,t){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}${K}/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};as("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}async waitForTokenUpdate(){return new Promise((e=>{const t=setInterval((()=>{this.isUpdating||(clearInterval(t),e())}),100)}))}}class gs{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,{params:t,cache:"no-cache",...s})}post(e,t,s){return this.request(exports.RequestMethod.POST,e,{body:t,...s})}put(e,t,s){return this.request(exports.RequestMethod.PUT,e,{body:t,cache:"no-cache",...s})}patch(e,t,s){return this.request(exports.RequestMethod.PATCH,e,{body:t,...s})}delete(e,t,s){return this.request(exports.RequestMethod.DELETE,e,{params:t,...s})}head(e,t,s){return this.request(exports.RequestMethod.HEAD,e,{params:t,...s})}upload(e,t,s){const r=new AbortController,i=r.signal;return{promise:this.request(exports.RequestMethod.POST,e,{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={method:e,...s};(null==s?void 0:s.signal)&&(c.signal=s.signal);(async()=>{var s,n,a,l;if(o||(c=null!==(s=await cs(this.client.requestInterceptors,c))&&void 0!==s?s:c),this.state.authToken)for(const[e,s]of this.state.authToken.entries()){const r=os(s.access_token);if(r&&r.is_remember&&this.tokenUpdate.isTokenExpire(r.exp)&&!t.includes("/login")&&!t.includes("/assets")){const t=await this.tokenUpdate.refreshToken(s,this.baseHost);t&&(this.state.authToken.set(e,t),c=null!==(n=await cs(this.client.requestInterceptors,c))&&void 0!==n?n:c)}}const p=new XMLHttpRequest;c.params&&Object.keys(c.params).length&&(t+="?"+ls(c.params));const u=null!==(a=c.host)&&void 0!==a?a:this.state.clientParams.host,d=`${u}${null!==(l=c.version)&&void 0!==l?l:this.state.clientParams.version}${t}`;if(p.open(e,d,!0),c.headers){const e=ps(c.headers);for(const[t,s]of Object.entries(e))(u===this.baseHost||"content-type"!==t.toLowerCase())&&p.setRequestHeader(t,s)}c.responseType&&(p.responseType=c.responseType),c.signal&&c.signal.addEventListener("abort",(()=>{p.abort(),i(new Error("Request aborted"))})),!p.upload||e!==exports.RequestMethod.POST&&e!==exports.RequestMethod.PUT&&e!==exports.RequestMethod.PATCH||(p.upload.onprogress=e=>{e.lengthComputable&&c.onUploadProgress&&c.onUploadProgress(e)}),p.onload=async()=>{if(c.signal&&c.signal.aborted)return;let e;switch(c.responseType){case exports.ResponseType.Text:e=p.responseText;break;case exports.ResponseType.Blob:case exports.ResponseType.ArrayBuffer:e=p.response;break;default:try{e=JSON.parse(p.responseText)}catch{e=p.responseText}}const t=new Headers;p.getAllResponseHeaders().split("\r\n").forEach((e=>{const[s,r]=e.split(": ");s&&r&&t.append(s,r)}));const s={status:p.status,statusText:p.statusText,headers:t,url:p.responseURL};if(p.status>=200&&p.status<300)return await cs(this.client.responseInterceptors,s),void(c.observe===exports.RequestObserve.Response?r({...s,body:e}):r(e));if(this.state.authToken&&(null==e?void 0:e.code)===ds){const e=await this.tokenUpdate.refreshToken(this.state.authToken.get(0),this.baseHost);e&&this.state.authToken.set(0,e)}const n={...s,error:e};await cs(this.client.responseInterceptors,n),i(n)},p.onerror=()=>{i({status:p.status,statusText:p.statusText,url:p.responseURL,error:"Network error"})},p.send(us(c.body))})().catch(i)}))}}exports.AuthApiService=i,exports.BASE_URL_V1=K,exports.BASE_URL_V2=Q,exports.CONNECTIONS_PERMISSION=o,exports.Client=class{constructor(e){this.AuthApiService=new i(this),this.ConnectionsApiService=new H(this),this.DiscoveryApiService=new G(this),this.DivideApiService=new J(this),this.ExtensionsApiService=new re(this),this.ExtensionsExternalApiService=new ne(this),this.FcaApiService=new ae(this),this.GatewayApiService=new pe(this),this.GroupApiService=new he(this),this.LicenseApiService=new xe(this),this.LinksApiService=new me(this),this.LimitationsApiService=new ye(this),this.LogstashApiService=new Ae(this),this.NotificationApiService=new De(this),this.RoleApiService=new Ne(this),this.ShareApiService=new ze(this),this.StorageCommentApiService=new Be(this),this.StorageElementApiService=new Qe(this,this.FcaApiService),this.StorageFilesApiService=new nt(this),this.TagsApiService=new Bt(this),this.StorageInstanceApiService=new ot(this),this.StorageShareApiService=new at(this),this.StorageTrashApiService=new ut(this),this.UserApiService=new wt(this),this.UsersAppealsApiService=new Ct(this),this.VersionApiService=new It(this),this.PlatformVersionApiService=new zt(this),this.SpaceApiService=new Gt(this),this.SpaceFilesApiService=new rs(this),this.tokenUpdate=new hs,this.rest=new gs(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)||K},requestParams:{path:"",headers:{},query:{},body:null,cache:"no-cache"},authToken:null,skipInterceptors:!1},this.rest.baseHost=this.state.clientParams.host||""}},exports.ConnectionsApiService=H,exports.DiscoveryApiService=G,exports.DivideApiService=J,exports.ExtensionsApiService=re,exports.ExtensionsExternalApiService=ne,exports.FcaApiService=ae,exports.GatewayApiService=pe,exports.GroupApiService=he,exports.LicenseApiService=xe,exports.LimitationsApiService=ye,exports.LinksApiService=me,exports.LogstashApiService=Ae,exports.NEED_TOKEN_UPDATE_ERROR=ds,exports.NotificationApiService=De,exports.PlatformVersionApiService=zt,exports.Rest=gs,exports.RoleApiService=Ne,exports.ShareApiService=ze,exports.SpaceApiService=Gt,exports.SpaceFilesApiService=rs,exports.StorageCommentApiService=Be,exports.StorageElementApiService=Qe,exports.StorageFilesApiService=nt,exports.StorageInstanceApiService=ot,exports.StorageShareApiService=at,exports.StorageTrashApiService=ut,exports.TagsApiService=Bt,exports.TokenUpdate=hs,exports.UserApiService=wt,exports.UsersAppealsApiService=Ct,exports.VersionApiService=It,exports.applyInterceptors=cs,exports.getCookieValue=as,exports.makeUrlParams=ls,exports.normalizeHeaders=ps,exports.prepareRequestBody=us;
|
|
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",n.DemoAdmin="demo_admin",n.SpaceManage="space_manage";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,l,p,d,u,h,g,_,$,x,v,m,S,f,y,w,A,k,T,b,C,R,E,D,U,P,L,N,I,O,q,M,z,F,B,W;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.ColorTypes=void 0,(l=exports.ColorTypes||(exports.ColorTypes={})).Yellow="yellow",l.Success="success",l.Critical="critical",l.Warning="warning",l.Brand="brand",l.Purple="purple",l.Primary="primary",l.Gray="gray",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,(d=exports.ConnectionType||(exports.ConnectionType={})).SSH="ssh_connection",d.YandexDisk="yandex_disk",d.Mail="mail",d.Discord="discord",d.Webdav="webdav_connection",d.Nextcloud="nextcloud_connection",d.NextBox="nextbox_connection",d.HttpProxy="http_proxy_connection",d.S3="s3_connection",exports.ExtensionType=void 0,(u=exports.ExtensionType||(exports.ExtensionType={})).App="app",u.File="file",u.WorkDir="work_dir",exports.ExtensionFileMode=void 0,(h=exports.ExtensionFileMode||(exports.ExtensionFileMode={})).Read="read",h.ReadAndWrite="read_and_write",h.Write="write",exports.DivideScope=void 0,(g=exports.DivideScope||(exports.DivideScope={})).Storage="/storage/element",g.Connection="/connections",exports.PermissionType=void 0,(_=exports.PermissionType||(exports.PermissionType={})).Close="",_.Read="r",_.Write="rw",_.Full="rwd",_.SpaceManage="space_manage",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,(m=exports.RestrictionModeKey||(exports.RestrictionModeKey={})).Divide="divide",m.Share="share",exports.Tariff=void 0,(S=exports.Tariff||(exports.Tariff={})).Free="free",S.Business="business",S.Enterprise="enterprise",exports.LicenseError=void 0,(f=exports.LicenseError||(exports.LicenseError={})).NotActivated="License not activated",f.Blocked="License blocked",f.Expired="License has been expired",f.NotValid="License not valid",f.NotFound="license file not found",exports.LicenseState=void 0,(y=exports.LicenseState||(exports.LicenseState={})).Purchased="purchased",y.Free="free",exports.LicenseMode=void 0,(w=exports.LicenseMode||(exports.LicenseMode={})).Online="online",w.Offline="offline",exports.LimitationType=void 0,(A=exports.LimitationType||(exports.LimitationType={})).BySize="size",A.ByExt="extension",A.ByQuota="quota_size",exports.LimitationSubType=void 0,(k=exports.LimitationSubType||(exports.LimitationSubType={})).Size="size",k.White="extension_white",k.Black="extension_black",exports.NotificationEntityType=void 0,(T=exports.NotificationEntityType||(exports.NotificationEntityType={})).Dir="dir",T.File="file",T.User="user",T.Other="other",T.WorkDir="work_dir",T.License="license",T.Extension="extension",T.Connection="connection",exports.NotificationAction=void 0,(b=exports.NotificationAction||(exports.NotificationAction={})).SecurityCheckNegative="action_security_check_negative",b.SecurityCheckPositive="action_security_check_positive",b.CommentVersionMention="action_version_comment_mention",b.OpenSharing="open_sharing",b.ChangeSharing="change_sharing",b.CancelSharing="cancel_sharing",b.DivideDirAddFileToOwner="divide_dir_add_file_to_owner",b.DivideDirAddDirToOwner="divide_dir_add_dir_to_owner",b.DivideDirAddWorkDirToOwner="divide_dir_add_work_dir_to_owner",b.DivideConnectionAddFileToOwner="divide_connection_add_file_to_owner",b.DivideConnectionAddDirToOwner="divide_connection_add_dir_to_owner",b.CancelDivideDir="cancel_divide_dir",b.CancelDivideFile="cancel_divide_file",b.CancelDivideWorkDir="cancel_divide_work_dir",b.CancelDivideConnection="cancel_divide_connection",b.DeleteExtension="delete_extension",b.NewVersionExtension="new_version_extension",b.TransferData="transfer_data",b.AllowInternalAccessUser="allow_internal_access_to_user",b.BlockInternalAccessUser="block_internal_access_to_user",b.WaitInternalAccessUser="wait_internal_access_to_user",b.WaitInternalAccessUserCreate="wait_internal_access_to_user_create",b.AllowInternalAccessGroup="allow_internal_access_to_group",b.BlockInternalAccessGroup="block_internal_access_to_group",b.WaitInternalAccessGroup="wait_internal_access_to_group",b.WaitInternalAccessGroupCreate="wait_internal_access_to_group_create",b.AllowSharing="allow_sharing",b.BlockSharing="block_sharing",b.WaitSharing="wait_sharing",b.WaitSharingCreate="wait_sharing_create",b.StatusCreateZipProcess="status_create_zip_process",b.StatusCreateZipSuccess="status_create_zip_success",b.StatusCreateZipError="status_create_zip_error",b.DownloadZipSuccess="download_zip_success",b.DownloadZipError="download_zip_error",b.StatusUnzipProcess="status_unzip_process",b.StatusUnzipSuccess="status_unzip_success",b.StatusUnzipError="status_unzip_error",b.StatusUnzipSuccessWithLimits="status_unzip_success_with_limits",b.AnonymZipDirAddFileToOwner="anonym_zip_dir_add_file_to_owner",b.GuestZipDirAddFileToOwner="guest_zip_dir_add_file_to_owner",b.DropDocumentOnlyoffice="drop_document_onlyoffice",b.CopyError="copy_error",b.CopySuccess="copy_success",b.StatusCopyProcess="status_copy_process",b.Other="other",b.Application="application",exports.NotificationRowAction=void 0,(C=exports.NotificationRowAction||(exports.NotificationRowAction={})).Read="read",C.Unread="unread",C.Delete="delete",exports.NotificationStyle=void 0,(R=exports.NotificationStyle||(exports.NotificationStyle={})).Plain="plain",R.Success="success",R.Info="info",R.Warning="warning",R.Error="error",exports.ResponseType=void 0,(E=exports.ResponseType||(exports.ResponseType={})).ArrayBuffer="arraybuffer",E.Blob="blob",E.Json="json",E.Text="text",exports.RequestMethod=void 0,(D=exports.RequestMethod||(exports.RequestMethod={})).GET="GET",D.POST="POST",D.PUT="PUT",D.PATCH="PATCH",D.DELETE="DELETE",D.HEAD="HEAD",exports.RequestObserve=void 0,(U=exports.RequestObserve||(exports.RequestObserve={})).Body="body",U.Response="response",exports.RestrictionSharing=void 0,(P=exports.RestrictionSharing||(exports.RestrictionSharing={})).NONE="none",P.SOFT="soft",P.HARD="hard",exports.UserAuthType=void 0,(L=exports.UserAuthType||(exports.UserAuthType={})).Native="native",L.Ldap="ldap",L.Vk="vk",exports.UserStatus=void 0,(N=exports.UserStatus||(exports.UserStatus={})).Registering="registering",N.Activated="activated",N.BlockedByAdmin="blocked_by_admin",N.BlockedByLicense="blocked_by_license",N.BlockedByInactive="blocked_by_inactive",N.BlockedByInactiveChangePassword="blocked_by_inactive_change_password",exports.UserType=void 0,(I=exports.UserType||(exports.UserType={})).User="user",I.Guest="guest",I.Emperor="emperor",I.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,(q=exports.SettingControlType||(exports.SettingControlType={})).Text="text",q.String="string",q.Number="number",q.CheckBox="checkbox",q.Select="select",q.RadioList="radio_list",q.ConnectionChoose="connection_choose",q.MultiConnectionChoose="multi_connection_choose",q.ActivitySwitch="activity_switch",exports.StorageElementType=void 0,(M=exports.StorageElementType||(exports.StorageElementType={})).Dir="dir",M.File="file",M.WorkDir="work_dir",M.App="app",exports.StorageElementContentType=void 0,(z=exports.StorageElementContentType||(exports.StorageElementContentType={})).Any="any",z.Dir="dir",z.Code="code",z.Image="image",z.Audio="audio",z.Video="video",z.Text="text",z.Doc="doc",z.Xls="xls",z.Ppt="ppt",exports.StorageRoot=void 0,(F=exports.StorageRoot||(exports.StorageRoot={})).my="my",F.fca="fca",F.divide="divide",F.share="share",F.favorite="favorite",F.trash="trash",F.spaces="spaces",exports.StorageElementHistoryAction=void 0,(B=exports.StorageElementHistoryAction||(exports.StorageElementHistoryAction={})).Create="create",B.Update="update",B.Move="move",exports.StorageElementCheckStatus=void 0,(W=exports.StorageElementCheckStatus||(exports.StorageElementCheckStatus={}))[W.CheckNull=0]="CheckNull",W[W.CheckInProgress=1]="CheckInProgress",W[W.CheckPositive=2]="CheckPositive",W[W.CheckNegative=3]="CheckNegative";const H="/connections",G=`${H}/dashboard`;class j{constructor(e){this.client=e}list(e){return this.client.rest.get(H,e)}get(e){return this.client.rest.get(`${H}/${e}`)}update(e,t){return this.client.rest.put(`${H}/${e}`,t)}delete(e){return this.client.rest.delete(`${H}/${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]||H,e)}dashboard(e){return this.client.rest.get(G,e)}}class V{constructor(e){this.client=e}discovery(e){return this.client.rest.get("/discovery",e)}}const Z="/divide",J=`${Z}/restrictions`,K=`${Z}/tag_group`;class Q{constructor(e){this.client=e}divideDelete(e,t){return this.client.rest.delete(`${e}${Z}/${t}`)}divideDeleteAll(e,t,s,r){return this.client.rest.delete(`${e}${Z}`,{...this.makeParam(e,t),is_to_user_group:r,access_mode:s})}divideChange(e,t,s){return this.client.rest.put(`${e}${Z}/${t}`,{access_mode:s})}divideCreate(e,t,s,r,i){const n={...this.makeParam(e,t),[i]:s,access_mode:r};return this.client.rest.post(`${e}${Z}`,n)}divideUsers(e,t,s){return this.client.rest.get(`${e}${Z}/users`,{...this.makeParam(e,t),...s})}divideTagGroupList(e){return this.client.rest.get(`${exports.DivideScope.Storage}${K}`,e)}getRestriction(e){return this.client.rest.get(`${J}/${e}`)}restrictionSize(e,t){return this.client.rest.get(`/${t}/restrictions/${e}/size`)}restrictions(e){return this.client.rest.get(`${J}`,e)}restrictionsChange(e,t){return this.client.rest.put(`${J}/${e}`,t)}makeParam(e,t){const s={};return e===exports.DivideScope.Connection?s.connection_id=t:s.path=t,s}}const Y="/api/v1",X="/api/v2",ee="/static/extensions",te="/extensions/defaults",se=`${ee}/names/users`,re=`${ee}/names/system`,ie=`${ee}/tags`;class ne{constructor(e){this.client=e}getSetting(e){return this.client.rest.get(`${ee}/${e}/settings`)}setSetting(e,t){return this.client.rest.post(`${ee}/${e}/settings`,t)}deleteSetting(e){return this.client.rest.delete(`${ee}/${e}/settings`)}get(e){return this.client.rest.get(`${ee}/${e}`)}getByKey(e){return this.client.rest.get(`${ee}/${e}`)}getDefault(e=[]){return this.client.rest.get(te,{ext_code:e})}setDefault(e,t){return this.client.rest.post(te,{ext_code:e,ext_uniq_key:t})}checkUpdates(){return this.client.rest.post(`${ee}/check_updates`)}updateVersion(e,t){return this.client.rest.put(`${ee}/${e}`,{version:t})}list(e){return this.client.rest.get(ee,e)}listTags(e){return this.client.rest.get(ie,e)}delete(e,t){return this.client.rest.delete(`${ee}/${e}`)}upload(e,t){const s=new FormData;s.set("file",t);const{promise:r,abort:i}=this.client.rest.upload(ee,s,{version:X,onUploadProgress:t=>{e(t)}});return{promise:r,abort:i}}install(e,t){return this.client.rest.post(`${ee}/site`,{uniq_key:e,version:t},{version:X})}getSystemNameExts(e){return this.client.rest.get(re,e)}getUserNameExts(e){return this.client.rest.get(se,e)}createUserNameExt(e){return this.client.rest.post(`${se}`,{name:e})}deleteUserNameExt(e){return this.client.rest.delete(`${se}/${e}`)}deleteAllUserNameExts(){return this.client.rest.delete(`${se}`)}}const oe="/anons_ext/extensions";class ce{constructor(e){this.client=e}listExtensionsSite(e){return this.client.rest.get(oe,e,{host:"https://next-box.ru"})}extensionDetailSite(e){return this.client.rest.get(`${oe}/${e}`,{},{host:"https://next-box.ru"})}extensionMarkdown(e,t){return this.client.rest.get(`${oe}/${e.uniqKey}/readme`,{lang:e.lang},{...t,host:"https://next-box.ru"})}}const ae="/disk",le=`${ae}/check`;class pe{constructor(e){this.client=e}info(e,t){return this.client.rest.get(`${ae}/${e}/element`,{path:t})}list(e,t){return this.client.rest.get(`${ae}/${e}`,t)}create(e,t){return this.client.rest.post(`${ae}/${e}/element`,t)}replace(e,t,s){return this.client.rest.put(`${ae}/${e}/files?path=${t}`,s)}read(e,t){return this.client.rest.get(`${ae}/${e}/files?path=${t}`)}upload(e,t,s,r=""){const i=new FormData;i.set("path",r),i.set("file",s);const{promise:n,abort:o}=this.client.rest.upload(`${ae}/${t}/files`,i,{onUploadProgress:t=>{e(t)}});return{promise:n,abort:o}}uploadNet(e,t){return this.client.rest.post(`${ae}/${e}/files/net`,t)}delete(e,t){return this.client.rest.delete(`${ae}/${e}/trash/element`,{path:t})}check(e){return this.client.rest.post(le,e)}}const de="/settings";class ue{constructor(e){this.client=e}settings(){return this.client.rest.get(de)}changeSettings(e){return this.client.rest.post(de,e)}queryInit(){return this.client.rest.get("/query/init")}}var he;exports.QueryInitViewType=void 0,(he=exports.QueryInitViewType||(exports.QueryInitViewType={})).Standard="Standard",he.Simple="Simple";const ge="/groups";class _e{constructor(e){this.client=e}list(e){return this.client.rest.get(ge,e)}get(e){return this.client.rest.get(`${ge}/${e}`)}listUsers(e,t){return this.client.rest.get(`${ge}/${e}/users`,t)}default(){return this.client.rest.get(`${ge}/default`)}create(e){return this.client.rest.post(ge,e)}update(e,t){return this.client.rest.put(`${ge}/${e}`,t)}delete(e){return this.client.rest.delete(`${ge}/${e}`)}}const $e="/license",xe=`${$e}/manual-check`,ve=`${$e}/hardware/hash`;class me{constructor(e){this.client=e}info(){return this.client.rest.get($e)}create(e){return this.client.rest.post($e,e)}check(){return this.client.rest.post(xe)}delete(){return this.client.rest.delete($e)}getHash(){return this.client.rest.get(ve)}}const Se="/links";class fe{constructor(e){this.client=e}createShortLink(e){return this.client.rest.post(Se,e)}updateShortLink(e){return this.client.rest.put(Se,e)}}const ye="/limitations";class we{constructor(e){this.client=e}me(){return this.client.rest.get("/limitations/user/me")}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)}get(e){return this.client.rest.get(`${ye}/${e}`)}update(e,t){return this.client.rest.put(`${ye}/${e}`,t)}delete(e){return this.client.rest.delete(`${ye}/${e}`)}getLimitationsByUser(e){return this.client.rest.get(`/limitations/user/${e}`)}addUserToLimitation(e,t){return this.client.rest.patch(`${ye}/${e}/user`,{id:t})}deleteUserFromLimitation(e,t){return this.client.rest.delete(`${ye}/${e}/user/${t}`)}}const Ae="/logs/users",ke=`${Ae}/actions`;class Te{constructor(e){this.client=e}getUsersLogs(e){return this.client.rest.get(`${Ae}`,e)}getLogsActions(e){return this.client.rest.get(`${ke}`,e)}}const be="/notifications",Ce=`${be}/all`,Re=`${be}/subscription`,Ee=`${Re}/extension`,De=`${be}/permission`,Ue=`${be}/task`;class Pe{constructor(e){this.client=e}list(e){return this.client.rest.get(be,e)}task(e){return this.client.rest.get(`${Ue}/${e}`)}toggleStatus(e,t){return this.client.rest.put(be,{ids:e,to_status:t})}toggleAllStatus(e){return this.client.rest.put(Ce,{to_status:e})}delete(e){return this.client.rest.delete(be,{id:e})}deleteAll(){return this.client.rest.delete(Ce)}getPermission(){return this.client.rest.get(De)}setPermission(e){return this.client.rest.post(De,{enabled:e})}getSubscription(){return this.client.rest.get(Re)}getSubscriptionExtension(){return this.client.rest.get(Ee)}setSubscription(e){const t={action_groups:{...e}};return this.client.rest.post(Re,t)}setSubscriptionExtension(e){const t={application_groups:{...e}};return this.client.rest.post(Ee,t)}}const Le="/roles",Ne=`${Le}/default`,Ie="/permissions";class Oe{constructor(e){this.client=e}list(e){return this.client.rest.get(Le,e)}get(e){return this.client.rest.get(`${Le}/${e}`)}getDefault(){return this.client.rest.get(`${Ne}`)}create(e){return this.client.rest.post(Le,e)}update(e,t){return this.client.rest.put(`${Le}/${e}`,t)}delete(e){return this.client.rest.delete(`${Le}/${e}`)}permissionList(){return this.client.rest.get(Ie)}addPermission(e,t){return this.client.rest.put(`${Le}/${e}/permissions`,{ids:t})}deletePermission(e,t){return this.client.rest.delete(`${Le}/${e}/${Ie}`,{ids:t})}}const qe="/share",Me=`${qe}/restrictions`,ze=`${qe}/login`;class Fe{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(`${Me}/${e}`)}restrictions(e){return this.client.rest.get(Me,e)}restrictionsChange(e,t){return this.client.rest.put(`${Me}/${e}`,t)}login(e){return this.client.rest.post(`${ze}`,e)}}const Be="/storage/element/version/comment",We=`${Be}/all`;class He{constructor(e){this.client=e}list(e){return this.client.rest.get(`${Be}`,e)}create(e){return this.client.rest.post(`${Be}`,e)}update(e){return this.client.rest.put(`${Be}`,e)}delete(e){return this.client.rest.delete(`${Be}`,e)}deleteAll(e){return this.client.rest.delete(`${We}`,e)}}const Ge="/storage",je=`${Ge}/element`,Ve=`${je}/divide`,Ze=`${Ve}/resource`,Je=`${je}/move`,Ke=`${je}/copy`,Qe=`${je}/content_type_size`,Ye="/disk";class Xe{constructor(e,t){this.client=e,this.fcaApiService=t}list(e){return this.client.rest.get(Ge,e)}info(e){return Object.keys(e).forEach((t=>{const s=t;e[s]||delete e[s]})),this.client.rest.get(je,e)}fileInfo(e,t){return this.client.rest.get(`${je}/${e}`,t?{file_version_id:t}:{})}combineInfo({root:e,rootId:t,id:s,path:r,file_version_id:i,zip_entry_path:n}){return e===exports.StorageRoot.fca&&t?this.fcaApiService.info(t,r):s?this.info({file_container_id:s,divide_id:t,file_version_id:i,zip_entry_path:n}):this.info({path:r,divide_id:t,file_version_id:i,zip_entry_path:n})}size(e){return this.client.rest.post(`${je}/size`,e)}move(e,t,s){const{from_divide_id:r,to_divide_id:i}=e;let n={...e,from_divide_id:null,to_divide_id:null};return t===exports.StorageRoot.fca&&s===exports.StorageRoot.fca?this.client.rest.post(`${Ye}/${r}/files/move${Ye}/${i}`,n):t===exports.StorageRoot.fca?(r&&(n.from_divide_id=r),this.client.rest.put(`${Ye}/${i}/files/from/box`,n)):s===exports.StorageRoot.fca?(i&&(n.to_divide_id=i),this.client.rest.put(`${Ye}/${r}/files/to/box`,n)):this.client.rest.post(Je,e)}copy(e,t,s){const{from_divide_id:r,to_divide_id:i}=e;let n={...e,from_divide_id:null,to_divide_id:null};return s===exports.StorageRoot.fca&&t===exports.StorageRoot.fca?this.client.rest.post(`${Ye}/${r}/files/copy${Ye}/${i}`,n):s===exports.StorageRoot.fca?(r&&(n.from_divide_id=r),this.client.rest.post(`${Ye}/${i}/files/from/box`,n)):t===exports.StorageRoot.fca?(i&&(n.to_divide_id=i),this.client.rest.post(`${Ye}/${r}/files/to/box`,n)):this.client.rest.post(Ke,e)}pasteFromShared(e,t,s){const r={from_sharing_token:e,from_sharing_password:s,paths:t};return this.client.rest.post(`${je}/copy`,r)}create(e){return this.client.rest.post(je,e)}delete(e,t){const s={path:e};return t&&(s.divide_id=t),this.client.rest.delete(je,s)}favorite(e){return this.client.rest.put(`${je}?path=${encodeURIComponent(e)}`,{is_favorite:!0})}removeFavorite(e){return this.client.rest.put(`${je}?path=${encodeURIComponent(e)}`,{is_favorite:!1})}createItem(e){return this.client.rest.post(je,e)}createWorkDir(e){return this.client.rest.post(je,e)}sizeWithSection(e){return this.client.rest.get(Qe,e)}getDivideResources(e){return this.client.rest.get(Ze,e)}getQuota(e){return this.client.rest.get(`${je}/user_size`,e)}hide(e){return this.client.rest.post(`${Ve}/hide`,e)}unhide(e){return this.client.rest.post(`${Ve}/unhide`,e)}}const et="/storage/files",tt=`${et}/net`,st=`${et}/unzip`,rt=`${et}/zip`,it=`${rt}/download`,nt=`${et}/process`,ot=`${et}/code`;class ct{constructor(e){this.client=e}read(e,t){return t.path=e,this.client.rest.get(et,t)}replace(e,t){const s=Object.fromEntries(Object.entries(e).filter((([,e])=>null!=e)).map((([e,t])=>[e,String(t)])));return this.client.rest.put(et,t,{params:s})}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(et,i,{onUploadProgress:t=>{e(t)}});return{promise:n,abort:o}}uploadNet(e){return this.client.rest.post(tt,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(it,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(rt,e)}cancelProcess(e){return this.client.rest.delete(nt,e)}unZip(e){return this.client.rest.post(st,e)}checkZip(e){return this.client.rest.head(ot,e)}}class at{constructor(e){this.client=e}instance(){return this.client.rest.get("/storage/instance")}}const lt="/storage/element/share";class pt{constructor(e){this.client=e}info(e){return this.client.rest.get(lt,{path:e})}create(e,t){const s={path:e,permissions_type:t};return this.client.rest.post(lt,s)}change(e){return this.client.rest.put(`${lt}/${e.token}`,e)}delete(e){return this.client.rest.delete(lt,{path:e})}refresh(e){return this.client.rest.put(`${lt}/${e}/refresh`)}}const dt="/storage/trash/element",ut=`${dt}/all`;class ht{constructor(e){this.client=e}clear(e){return this.client.rest.delete(dt,e)}clearAll(){return this.client.rest.delete(ut)}restore(e){return this.client.rest.patch(dt,{del_groups:e})}restoreAll(){return this.client.rest.patch(ut)}}const gt="/users",_t=`${gt}/me`,$t=`${_t}/avatars`,xt=`${_t}/sessions`,vt=`${_t}/tokens`,mt=`${_t}/params`,St=`${_t}/app-passwords`,ft=`${_t}/change-password`,yt=`${gt}/initial`,wt=`${_t}/phone`,At=`${wt}/confirm`;class kt{constructor(e){this.client=e}initial(e){return this.client.rest.post(yt,e)}list(e){return this.client.rest.get(gt,e)}get(e){return this.client.rest.get(gt+`/${e}`)}create(e){return this.client.rest.post(gt,e)}update(e,t){return this.client.rest.put(gt+`/${e}`,t)}delete(e,t){return this.client.rest.delete(`${gt}/${e}`,t)}restore(e){return this.client.rest.post(`${gt}/${e}/restore`)}me(){return this.client.rest.get(_t)}updateMe(e){return this.client.rest.put(_t,e)}createToken(e){return this.client.rest.post(vt,e)}listToken(e){return this.client.rest.get(vt,e)}deleteToken(e){return this.client.rest.delete(`${vt}/${e}`)}changeMyPassword(e){return this.client.rest.put(ft,e)}changeUsersPassword(e,t){return this.client.rest.put(`${gt}/${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(xt,e)}meDeleteSession(e){let t=xt;return e&&(t+=`/${e}`),this.client.rest.delete(t)}setRole(e,t=null){return this.client.rest.put(`${gt}/${e}/roles`,{role_id:t})}meParams(e){return this.client.rest.get(mt,{name:e})}meSetParams(e,t){return this.client.rest.post(`${mt}/${e}`,t)}meListParams(){return this.client.rest.get(mt)}phone(e){return this.client.rest.post(wt,e)}phoneConfirm(e){return this.client.rest.post(`${At}/${e}`)}appPasswordsList(e){return this.client.rest.get(St,e)}createAppPasswords(e){return this.client.rest.post(St,e)}deleteAppPasswords(e){return this.client.rest.delete(`${St}/${e}`)}}const Tt="/users/appeals",bt=`${Tt}/category`,Ct=`${Tt}/subcategory`,Rt=`${Tt}/file`;class Et{constructor(e){this.client=e}category(){return this.client.rest.get(bt)}subcategory(e){return this.client.rest.get(Ct,{category_code:e})}uploadFile(e){const t=new FormData;return t.append("file",e),this.client.rest.post(Rt,t)}deleteFile(e){return this.client.rest.delete(`${Rt}/${e}`)}createAppeal(e){return this.client.rest.post(Tt,e)}}const Dt="/storage/element",Ut=`${Dt}/history`,Pt=`${Dt}/version`,Lt=`${Pt}/lock`,Nt=`${Pt}/unlock`,It=`${Pt}/current`,Ot=`${Pt}/size`;class qt{constructor(e){this.client=e}history(e){return this.client.rest.get(Ut,e)}versions(e){return this.client.rest.get(Pt,e)}create(e){return this.client.rest.post(Pt,e)}edit(e){return this.client.rest.put(Pt,e)}delete(e){return this.client.rest.delete(Pt,e)}size(e){return this.client.rest.get(Ot,e)}makeCurrent(e){return this.client.rest.post(It,e)}lock(e){return this.client.rest.post(Lt,e)}unlock(e){return this.client.rest.post(Nt,e)}}const Mt="/version",zt=`${Mt}/changelog`;class Ft{constructor(e){this.client=e}getVersions(e){return this.client.rest.get(Mt,e)}getChangelog(e){return this.client.rest.get(zt,{version_number:e})}}const Bt="/tag",Wt=`${Bt}/list`;class Ht{constructor(e){this.client=e}list(e){return this.client.rest.get(Wt,e)}get(e){return this.client.rest.get(`${Bt}/${e}`)}assign(e,t){return this.client.rest.post(`${Bt}/${e}/assign`,{items:t})}unassign(e,t){return this.client.rest.post(`${Bt}/${e}/unassign`,{items:t})}create(e){return this.client.rest.post(Bt,e)}update(e,t){return this.client.rest.put(`${Bt}/${e}`,t)}delete(e){return this.client.rest.delete(`${Bt}/${e}`)}}const Gt="/spaces",jt=`${Gt}/access`;class Vt{constructor(e){this.client=e}space(e){return this.client.rest.get(`${Gt}/${e}`)}list(e){return this.client.rest.get(Gt,e)}create(e){return this.client.rest.post(Gt,e)}update(e,t){return this.client.rest.put(`${Gt}/${e}`,t)}delete(e){return this.client.rest.delete(`${Gt}/${e}`)}adminsList(e,t){return this.client.rest.get(`${Gt}/${e}/admins`,t)}accessList(e){return this.client.rest.get(jt,e)}provideAccess(e){return this.client.rest.post(jt,e)}deleteAllAccess(e){return this.client.rest.delete(jt,e)}updateAccess(e,t){return this.client.rest.put(`${jt}/${e}`,t)}deleteAccess(e,t){return this.client.rest.delete(`${jt}/${e}`,{space_id:t})}}const Zt="/spaces",Jt="/files",Kt=`${Jt}/copy`,Qt=`${Jt}/upload`,Yt=`${Jt}/lock`,Xt=`${Jt}/unlock`,es=`${`${Jt}/download`}/zip`,ts=`${Jt}/recover`,ss=`${ts}/all`,rs=`${Jt}/trash`,is=`${rs}/all`;class ns{constructor(e){this.client=e}list(e,t){return this.client.rest.get(`${Zt}/${e}${Jt}/list`,t)}get(e,t){return this.client.rest.get(`${Zt}/${e}${Jt}`,t)}create(e,t){return this.client.rest.post(`${Zt}/${e}${Jt}`,t)}replace(e,t,s){const r=Object.fromEntries(Object.entries(t).filter((([,e])=>null!=e)).map((([e,t])=>[e,String(t)])));return this.client.rest.put(`${Zt}/${e}${Jt}`,s,{params:r})}delete(e,t){return this.client.rest.delete(`${Zt}/${e}${Jt}`,t)}copy(e,t){return this.client.rest.post(`${Zt}/${e}${Kt}`,t)}copyFromNextbox(e,t){return this.client.rest.post(`${Zt}/${e}${Kt}/from/nextbox`,t)}copyToNextbox(e,t){return this.client.rest.post(`${Zt}/${e}${Kt}/to/nextbox`,t)}download(e,t){return this.client.rest.get(`${Zt}/${e}${Jt}/download`,t,{responseType:exports.ResponseType.Blob})}createZipToDownload(e,t){return this.client.rest.get(`${Zt}/${e}${es}`,t,{responseType:exports.ResponseType.Blob})}move(e,t){return this.client.rest.post(`${Zt}/${e}${Jt}/move`,t)}rename(e,t){return this.client.rest.post(`${Zt}/${e}${Jt}/rename`,t)}upload(e,t,s,r){var i;const n=new FormData;n.set("overwrite",String(null!==(i=r.overwrite)&&void 0!==i&&i)),r.parent_id&&n.set("parent_id",r.parent_id),n.set("file",s);const{promise:o,abort:c}=this.client.rest.upload(`${Zt}/${t}${Qt}`,n,{onUploadProgress:t=>{e(t)}});return{promise:o,abort:c}}uploadNet(e,t){return this.client.rest.post(`${Zt}/${e}${Qt}/net`,t)}recover(e,t){return this.client.rest.post(`${Zt}/${e}/${ts}`,{del_group_ids:t})}recoverAll(e){return this.client.rest.post(`${Zt}/${e}/${ss}`)}trash(e,t){return this.client.rest.delete(`${Zt}/${e}/${rs}`,{del_group_id:t})}trashAll(e){return this.client.rest.delete(`${Zt}/${e}/${is}`)}lock(e,t){return this.client.rest.post(`${Zt}/${e}/${Yt}`,{file_id:t})}unlock(e,t){return this.client.rest.post(`${Zt}/${e}/${Xt}`,{file_id:t})}branch(e,t){return this.client.rest.get(`${Zt}/${e}/branch`,{file_id:t})}}class os extends Error{}function cs(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 as(e,t){if("string"!=typeof e)throw new os("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 os(`Invalid token specified: missing part #${s+1}`);let i;try{i=cs(r)}catch(e){throw new os(`Invalid token specified: invalid base64 for part #${s+1} (${e.message})`)}try{return JSON.parse(i)}catch(e){throw new os(`Invalid token specified: invalid json for part #${s+1} (${e.message})`)}}os.prototype.name="InvalidTokenError";const ls=async(e,t)=>{let s=t;for(const t of e)try{s=await t.fulfilled(s)}catch(e){if(!t.rejected)throw e;s=await t.rejected(e)}return s};function ps(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 ds=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 us(e){return e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):e}function hs(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 gs="update black token";class _s{constructor(){this.isUpdating=!1,this.tokenUpdateResolve=null}isTokenExpire(e){if(!e)return!1;return 1e3*e<=(new Date).getTime()+3e3}async refreshToken(e,t){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}${Y}/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};ps("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}async waitForTokenUpdate(){return new Promise((e=>{const t=setInterval((()=>{this.isUpdating||(clearInterval(t),e())}),100)}))}}class $s{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,{params:t,cache:"no-cache",...s})}post(e,t,s){return this.request(exports.RequestMethod.POST,e,{body:t,...s})}put(e,t,s){return this.request(exports.RequestMethod.PUT,e,{body:t,cache:"no-cache",...s})}patch(e,t,s){return this.request(exports.RequestMethod.PATCH,e,{body:t,...s})}delete(e,t,s){return this.request(exports.RequestMethod.DELETE,e,{params:t,...s})}head(e,t,s){return this.request(exports.RequestMethod.HEAD,e,{params:t,...s})}upload(e,t,s){const r=new AbortController,i=r.signal;return{promise:this.request(exports.RequestMethod.POST,e,{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={method:e,...s};(null==s?void 0:s.signal)&&(c.signal=s.signal);(async()=>{var s,n,a,l;if(o||(c=null!==(s=await ls(this.client.requestInterceptors,c))&&void 0!==s?s:c),this.state.authToken)for(const[e,s]of this.state.authToken.entries()){const r=as(s.access_token);if(r&&r.is_remember&&this.tokenUpdate.isTokenExpire(r.exp)&&!t.includes("/login")&&!t.includes("/assets")){const t=await this.tokenUpdate.refreshToken(s,this.baseHost);t&&(this.state.authToken.set(e,t),c=null!==(n=await ls(this.client.requestInterceptors,c))&&void 0!==n?n:c)}}const p=new XMLHttpRequest;c.params&&Object.keys(c.params).length&&(t+="?"+ds(c.params));const d=null!==(a=c.host)&&void 0!==a?a:this.state.clientParams.host,u=`${d}${null!==(l=c.version)&&void 0!==l?l:this.state.clientParams.version}${t}`;if(p.open(e,u,!0),c.headers){const e=us(c.headers);for(const[t,s]of Object.entries(e))(d===this.baseHost||"content-type"!==t.toLowerCase())&&p.setRequestHeader(t,s)}c.responseType&&(p.responseType=c.responseType),c.signal&&c.signal.addEventListener("abort",(()=>{p.abort(),i(new Error("Request aborted"))})),!p.upload||e!==exports.RequestMethod.POST&&e!==exports.RequestMethod.PUT&&e!==exports.RequestMethod.PATCH||(p.upload.onprogress=e=>{e.lengthComputable&&c.onUploadProgress&&c.onUploadProgress(e)}),p.onload=async()=>{if(c.signal&&c.signal.aborted)return;let e;switch(c.responseType){case exports.ResponseType.Text:e=p.responseText;break;case exports.ResponseType.Blob:case exports.ResponseType.ArrayBuffer:e=p.response;break;default:try{e=JSON.parse(p.responseText)}catch{e=p.responseText}}const t=new Headers;p.getAllResponseHeaders().split("\r\n").forEach((e=>{const[s,r]=e.split(": ");s&&r&&t.append(s,r)}));const s={status:p.status,statusText:p.statusText,headers:t,url:p.responseURL};if(p.status>=200&&p.status<300)return await ls(this.client.responseInterceptors,s),void(c.observe===exports.RequestObserve.Response?r({...s,body:e}):r(e));if(this.state.authToken&&(null==e?void 0:e.code)===gs){const e=await this.tokenUpdate.refreshToken(this.state.authToken.get(0),this.baseHost);e&&this.state.authToken.set(0,e)}const n={...s,error:e};await ls(this.client.responseInterceptors,n),i(n)},p.onerror=()=>{i({status:p.status,statusText:p.statusText,url:p.responseURL,error:"Network error"})},p.send(hs(c.body))})().catch(i)}))}}exports.AuthApiService=i,exports.BASE_URL_V1=Y,exports.BASE_URL_V2=X,exports.CONNECTIONS_PERMISSION=o,exports.Client=class{constructor(e){this.AuthApiService=new i(this),this.ConnectionsApiService=new j(this),this.DiscoveryApiService=new V(this),this.DivideApiService=new Q(this),this.ExtensionsApiService=new ne(this),this.ExtensionsExternalApiService=new ce(this),this.FcaApiService=new pe(this),this.GatewayApiService=new ue(this),this.GroupApiService=new _e(this),this.LicenseApiService=new me(this),this.LinksApiService=new fe(this),this.LimitationsApiService=new we(this),this.LogstashApiService=new Te(this),this.NotificationApiService=new Pe(this),this.RoleApiService=new Oe(this),this.ShareApiService=new Fe(this),this.StorageCommentApiService=new He(this),this.StorageElementApiService=new Xe(this,this.FcaApiService),this.StorageFilesApiService=new ct(this),this.TagsApiService=new Ht(this),this.StorageInstanceApiService=new at(this),this.StorageShareApiService=new pt(this),this.StorageTrashApiService=new ht(this),this.UserApiService=new kt(this),this.UsersAppealsApiService=new Et(this),this.VersionApiService=new qt(this),this.PlatformVersionApiService=new Ft(this),this.SpaceApiService=new Vt(this),this.SpaceFilesApiService=new ns(this),this.tokenUpdate=new _s,this.rest=new $s(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)||Y},requestParams:{path:"",headers:{},query:{},body:null,cache:"no-cache"},authToken:null,skipInterceptors:!1},this.rest.baseHost=this.state.clientParams.host||""}},exports.ConnectionsApiService=j,exports.DiscoveryApiService=V,exports.DivideApiService=Q,exports.ExtensionsApiService=ne,exports.ExtensionsExternalApiService=ce,exports.FcaApiService=pe,exports.GatewayApiService=ue,exports.GroupApiService=_e,exports.LicenseApiService=me,exports.LimitationsApiService=we,exports.LinksApiService=fe,exports.LogstashApiService=Te,exports.NEED_TOKEN_UPDATE_ERROR=gs,exports.NotificationApiService=Pe,exports.PlatformVersionApiService=Ft,exports.Rest=$s,exports.RoleApiService=Oe,exports.ShareApiService=Fe,exports.SpaceApiService=Vt,exports.SpaceFilesApiService=ns,exports.StorageCommentApiService=He,exports.StorageElementApiService=Xe,exports.StorageFilesApiService=ct,exports.StorageInstanceApiService=at,exports.StorageShareApiService=pt,exports.StorageTrashApiService=ht,exports.TagsApiService=Ht,exports.TokenUpdate=_s,exports.UserApiService=kt,exports.UsersAppealsApiService=Et,exports.VersionApiService=qt,exports.applyInterceptors=ls,exports.getCookieValue=ps,exports.makeUrlParams=ds,exports.normalizeHeaders=us,exports.prepareRequestBody=hs;
|
package/dist/bundle.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
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;!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",e.DemoAdmin="demo_admin",e.SpaceManage="space_manage"}(n||(n={}));const o=[n.ConnectionsYandexDisk,n.ConnectionsSsh,n.ConnectionsMail,n.ConnectionsS3,n.ConnectionsS3,n.ConnectionsDiscord,n.ConnectionsWebdav,n.ConnectionsNextcloud,n.ConnectionsNextbox,n.ConnectionsHttpProxy];var c,a,l,u,h,d,p,$,_,g,f,m,v,w,k,S,y,b,x,A,C,D,T,U,E,P,R,L,I,z,N,O,F,W,B,H;!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.Yellow="yellow",e.Success="success",e.Critical="critical",e.Warning="warning",e.Brand="brand",e.Purple="purple",e.Primary="primary",e.Gray="gray"}(l||(l={})),function(e){e.Storages="storages_connections_group",e.Webhooks="webhooks_connections_group",e.Unknown="unknown_connections_group",e.Proxy="proxy_connections_group"}(u||(u={})),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"}(h||(h={})),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"}(p||(p={})),function(e){e.Storage="/storage/element",e.Connection="/connections"}($||($={})),function(e){e.Close="",e.Read="r",e.Write="rw",e.Full="rwd",e.SpaceManage="space_manage"}(_||(_={})),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"}(m||(m={})),function(e){e.Divide="divide",e.Share="share"}(v||(v={})),function(e){e.Free="free",e.Business="business",e.Enterprise="enterprise"}(w||(w={})),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"}(S||(S={})),function(e){e.Size="size",e.White="extension_white",e.Black="extension_black"}(y||(y={})),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",e.Application="application"}(x||(x={})),function(e){e.Read="read",e.Unread="unread",e.Delete="delete"}(A||(A={})),function(e){e.Plain="plain",e.Success="success",e.Info="info",e.Warning="warning",e.Error="error"}(C||(C={})),function(e){e.ArrayBuffer="arraybuffer",e.Blob="blob",e.Json="json",e.Text="text"}(D||(D={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.PATCH="PATCH",e.DELETE="DELETE",e.HEAD="HEAD"}(T||(T={})),function(e){e.Body="body",e.Response="response"}(U||(U={})),function(e){e.NONE="none",e.SOFT="soft",e.HARD="hard"}(E||(E={})),function(e){e.Native="native",e.Ldap="ldap",e.Vk="vk"}(P||(P={})),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"}(R||(R={})),function(e){e.User="user",e.Guest="guest",e.Emperor="emperor",e.Anonymous="anonymous"}(L||(L={})),function(e){e.Theme="theme",e.Lang="lang",e.Sort="sort",e.ViewApps="viewApps",e.WithoutContentWorkDir="withoutContentWorkDir",e.DashboardGrid="dashboardGrid"}(I||(I={})),function(e){e.Webdav="webdav"}(z||(z={})),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",e.ActivitySwitch="activity_switch"}(N||(N={})),function(e){e.Dir="dir",e.File="file",e.WorkDir="work_dir",e.App="app"}(O||(O={})),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"}(F||(F={})),function(e){e.my="my",e.fca="fca",e.divide="divide",e.share="share",e.favorite="favorite",e.trash="trash",e.spaces="spaces"}(W||(W={})),function(e){e.Create="create",e.Update="update",e.Move="move"}(B||(B={})),function(e){e[e.CheckNull=0]="CheckNull",e[e.CheckInProgress=1]="CheckInProgress",e[e.CheckPositive=2]="CheckPositive",e[e.CheckNegative=3]="CheckNegative"}(H||(H={}));const q="/connections",j=`${q}/dashboard`;class G{constructor(e){this.client=e}list(e){return this.client.rest.get(q,e)}get(e){return this.client.rest.get(`${q}/${e}`)}update(e,t){return this.client.rest.put(`${q}/${e}`,t)}delete(e){return this.client.rest.delete(`${q}/${e}`)}create(e){const t={[h.SSH]:"/disk/ssh",[h.Webdav]:"/disk/webdav",[h.Nextcloud]:"/disk/nextcloud",[h.NextBox]:"/disk/nextbox",[h.Discord]:"/webhooks/discord",[h.Mail]:"/webhooks/mail",[h.HttpProxy]:"/http_proxy",[h.S3]:"/disk/s3"};return this.client.rest.post(t[e.type]||q,e)}dashboard(e){return this.client.rest.get(j,e)}}class M{constructor(e){this.client=e}discovery(e){return this.client.rest.get("/discovery",e)}}const V="/divide",Z=`${V}/restrictions`,J=`${V}/tag_group`;class Y{constructor(e){this.client=e}divideDelete(e,t){return this.client.rest.delete(`${e}${V}/${t}`)}divideDeleteAll(e,t,s,r){return this.client.rest.delete(`${e}${V}`,{...this.makeParam(e,t),is_to_user_group:r,access_mode:s})}divideChange(e,t,s){return this.client.rest.put(`${e}${V}/${t}`,{access_mode:s})}divideCreate(e,t,s,r,i){const n={...this.makeParam(e,t),[i]:s,access_mode:r};return this.client.rest.post(`${e}${V}`,n)}divideUsers(e,t,s){return this.client.rest.get(`${e}${V}/users`,{...this.makeParam(e,t),...s})}divideTagGroupList(e){return this.client.rest.get(`${$.Storage}${J}`,e)}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===$.Connection?s.connection_id=t:s.path=t,s}}const X="/api/v1",K="/api/v2",Q="/static/extensions",ee="/extensions/defaults",te=`${Q}/names/users`,se=`${Q}/names/system`,re=`${Q}/tags`;class ie{constructor(e){this.client=e}getSetting(e){return this.client.rest.get(`${Q}/${e}/settings`)}setSetting(e,t){return this.client.rest.post(`${Q}/${e}/settings`,t)}deleteSetting(e){return this.client.rest.delete(`${Q}/${e}/settings`)}get(e){return this.client.rest.get(`${Q}/${e}`)}getByKey(e){return this.client.rest.get(`${Q}/${e}`)}getDefault(e=[]){return this.client.rest.get(ee,{ext_code:e})}setDefault(e,t){return this.client.rest.post(ee,{ext_code:e,ext_uniq_key:t})}checkUpdates(){return this.client.rest.post(`${Q}/check_updates`)}updateVersion(e,t){return this.client.rest.put(`${Q}/${e}`,{version:t})}list(e){return this.client.rest.get(Q,e)}listTags(e){return this.client.rest.get(re,e)}delete(e,t){return this.client.rest.delete(`${Q}/${e}`)}upload(e,t){const s=new FormData;s.set("file",t);const{promise:r,abort:i}=this.client.rest.upload(Q,s,{version:K,onUploadProgress:t=>{e(t)}});return{promise:r,abort:i}}install(e,t){return this.client.rest.post(`${Q}/site`,{uniq_key:e,version:t},{version:K})}getSystemNameExts(e){return this.client.rest.get(se,e)}getUserNameExts(e){return this.client.rest.get(te,e)}createUserNameExt(e){return this.client.rest.post(`${te}`,{name:e})}deleteUserNameExt(e){return this.client.rest.delete(`${te}/${e}`)}deleteAllUserNameExts(){return this.client.rest.delete(`${te}`)}}const ne="/anons_ext/extensions";class oe{constructor(e){this.client=e}listExtensionsSite(e){return this.client.rest.get(ne,e,{host:"https://next-box.ru"})}extensionDetailSite(e){return this.client.rest.get(`${ne}/${e}`,{},{host:"https://next-box.ru"})}extensionMarkdown(e,t){return this.client.rest.get(`${ne}/${e.uniqKey}/readme`,{lang:e.lang},{...t,host:"https://next-box.ru"})}}const ce="/disk",ae=`${ce}/check`;class le{constructor(e){this.client=e}info(e,t){return this.client.rest.get(`${ce}/${e}/element`,{path:t})}list(e,t){return this.client.rest.get(`${ce}/${e}`,t)}create(e,t){return this.client.rest.post(`${ce}/${e}/element`,t)}replace(e,t,s){return this.client.rest.put(`${ce}/${e}/files?path=${t}`,s)}read(e,t){return this.client.rest.get(`${ce}/${e}/files?path=${t}`)}upload(e,t,s,r=""){const i=new FormData;i.set("path",r),i.set("file",s);const{promise:n,abort:o}=this.client.rest.upload(`${ce}/${t}/files`,i,{onUploadProgress:t=>{e(t)}});return{promise:n,abort:o}}uploadNet(e,t){return this.client.rest.post(`${ce}/${e}/files/net`,t)}delete(e,t){return this.client.rest.delete(`${ce}/${e}/trash/element`,{path:t})}check(e){return this.client.rest.post(ae,e)}}const ue="/settings";class he{constructor(e){this.client=e}settings(){return this.client.rest.get(ue)}changeSettings(e){return this.client.rest.post(ue,e)}queryInit(){return this.client.rest.get("/query/init")}}var de;!function(e){e.Standard="Standard",e.Simple="Simple"}(de||(de={}));const pe="/groups";class $e{constructor(e){this.client=e}list(e){return this.client.rest.get(pe,e)}get(e){return this.client.rest.get(`${pe}/${e}`)}listUsers(e,t){return this.client.rest.get(`${pe}/${e}/users`,t)}default(){return this.client.rest.get(`${pe}/default`)}create(e){return this.client.rest.post(pe,e)}update(e,t){return this.client.rest.put(`${pe}/${e}`,t)}delete(e){return this.client.rest.delete(`${pe}/${e}`)}}const _e="/license",ge=`${_e}/manual-check`,fe=`${_e}/hardware/hash`;class me{constructor(e){this.client=e}info(){return this.client.rest.get(_e)}create(e){return this.client.rest.post(_e,e)}check(){return this.client.rest.post(ge)}delete(){return this.client.rest.delete(_e)}getHash(){return this.client.rest.get(fe)}}const ve="/links";class we{constructor(e){this.client=e}createShortLink(e){return this.client.rest.post(ve,e)}updateShortLink(e){return this.client.rest.put(ve,e)}}const ke="/limitations";class Se{constructor(e){this.client=e}me(){return this.client.rest.get("/limitations/user/me")}list(e){return this.client.rest.get(ke,e)}listUsers(e,t){return this.client.rest.get(`${ke}/${e}/users`,t)}create(e){return this.client.rest.post(ke,e)}get(e){return this.client.rest.get(`${ke}/${e}`)}update(e,t){return this.client.rest.put(`${ke}/${e}`,t)}delete(e){return this.client.rest.delete(`${ke}/${e}`)}getLimitationsByUser(e){return this.client.rest.get(`/limitations/user/${e}`)}addUserToLimitation(e,t){return this.client.rest.patch(`${ke}/${e}/user`,{id:t})}deleteUserFromLimitation(e,t){return this.client.rest.delete(`${ke}/${e}/user/${t}`)}}const ye="/logs/users",be=`${ye}/actions`;class xe{constructor(e){this.client=e}getUsersLogs(e){return this.client.rest.get(`${ye}`,e)}getLogsActions(e){return this.client.rest.get(`${be}`,e)}}const Ae="/notifications",Ce=`${Ae}/all`,De=`${Ae}/subscription`,Te=`${De}/extension`,Ue=`${Ae}/permission`,Ee=`${Ae}/task`;class Pe{constructor(e){this.client=e}list(e){return this.client.rest.get(Ae,e)}task(e){return this.client.rest.get(`${Ee}/${e}`)}toggleStatus(e,t){return this.client.rest.put(Ae,{ids:e,to_status:t})}toggleAllStatus(e){return this.client.rest.put(Ce,{to_status:e})}delete(e){return this.client.rest.delete(Ae,{id:e})}deleteAll(){return this.client.rest.delete(Ce)}getPermission(){return this.client.rest.get(Ue)}setPermission(e){return this.client.rest.post(Ue,{enabled:e})}getSubscription(){return this.client.rest.get(De)}getSubscriptionExtension(){return this.client.rest.get(Te)}setSubscription(e){const t={action_groups:{...e}};return this.client.rest.post(De,t)}setSubscriptionExtension(e){const t={application_groups:{...e}};return this.client.rest.post(Te,t)}}const Re="/roles",Le=`${Re}/default`,Ie="/permissions";class ze{constructor(e){this.client=e}list(e){return this.client.rest.get(Re,e)}get(e){return this.client.rest.get(`${Re}/${e}`)}getDefault(){return this.client.rest.get(`${Le}`)}create(e){return this.client.rest.post(Re,e)}update(e,t){return this.client.rest.put(`${Re}/${e}`,t)}delete(e){return this.client.rest.delete(`${Re}/${e}`)}permissionList(){return this.client.rest.get(Ie)}addPermission(e,t){return this.client.rest.put(`${Re}/${e}/permissions`,{ids:t})}deletePermission(e,t){return this.client.rest.delete(`${Re}/${e}/${Ie}`,{ids:t})}}const Ne="/share",Oe=`${Ne}/restrictions`,Fe=`${Ne}/login`;class We{constructor(e){this.client=e}info(e){return this.client.rest.get(`${Ne}?share_token=${e}`)}checkPassword(e,t){const s=encodeURIComponent(e);return this.client.rest.get(`${Ne}/password?share_token=${t}&share_pass=${s}`)}getRestriction(e){return this.client.rest.get(`${Oe}/${e}`)}restrictions(e){return this.client.rest.get(Oe,e)}restrictionsChange(e,t){return this.client.rest.put(`${Oe}/${e}`,t)}login(e){return this.client.rest.post(`${Fe}`,e)}}const Be="/storage/element/version/comment",He=`${Be}/all`;class qe{constructor(e){this.client=e}list(e){return this.client.rest.get(`${Be}`,e)}create(e){return this.client.rest.post(`${Be}`,e)}update(e){return this.client.rest.put(`${Be}`,e)}delete(e){return this.client.rest.delete(`${Be}`,e)}deleteAll(e){return this.client.rest.delete(`${He}`,e)}}const je="/storage",Ge=`${je}/element`,Me=`${Ge}/divide`,Ve=`${Me}/resource`,Ze=`${Ge}/move`,Je=`${Ge}/copy`,Ye=`${Ge}/content_type_size`,Xe="/disk";class Ke{constructor(e,t){this.client=e,this.fcaApiService=t}list(e){return this.client.rest.get(je,e)}info(e){return Object.keys(e).forEach((t=>{const s=t;e[s]||delete e[s]})),this.client.rest.get(Ge,e)}fileInfo(e,t){return this.client.rest.get(`${Ge}/${e}`,t?{file_version_id:t}:{})}combineInfo({root:e,rootId:t,id:s,path:r,file_version_id:i,zip_entry_path:n}){return e===W.fca&&t?this.fcaApiService.info(t,r):s?this.info({file_container_id:s,divide_id:t,file_version_id:i,zip_entry_path:n}):this.info({path:r,divide_id:t,file_version_id:i,zip_entry_path:n})}size(e){return this.client.rest.post(`${Ge}/size`,e)}move(e,t,s){const{from_divide_id:r,to_divide_id:i}=e;let n={...e,from_divide_id:null,to_divide_id:null};return t===W.fca&&s===W.fca?this.client.rest.post(`${Xe}/${r}/files/move${Xe}/${i}`,n):t===W.fca?(r&&(n.from_divide_id=r),this.client.rest.put(`${Xe}/${i}/files/from/box`,n)):s===W.fca?(i&&(n.to_divide_id=i),this.client.rest.put(`${Xe}/${r}/files/to/box`,n)):this.client.rest.post(Ze,e)}copy(e,t,s){const{from_divide_id:r,to_divide_id:i}=e;let n={...e,from_divide_id:null,to_divide_id:null};return s===W.fca&&t===W.fca?this.client.rest.post(`${Xe}/${r}/files/copy${Xe}/${i}`,n):s===W.fca?(r&&(n.from_divide_id=r),this.client.rest.post(`${Xe}/${i}/files/from/box`,n)):t===W.fca?(i&&(n.to_divide_id=i),this.client.rest.post(`${Xe}/${r}/files/to/box`,n)):this.client.rest.post(Je,e)}pasteFromShared(e,t,s){const r={from_sharing_token:e,from_sharing_password:s,paths:t};return this.client.rest.post(`${Ge}/copy`,r)}create(e){return this.client.rest.post(Ge,e)}delete(e,t){const s={path:e};return t&&(s.divide_id=t),this.client.rest.delete(Ge,s)}favorite(e){return this.client.rest.put(`${Ge}?path=${encodeURIComponent(e)}`,{is_favorite:!0})}removeFavorite(e){return this.client.rest.put(`${Ge}?path=${encodeURIComponent(e)}`,{is_favorite:!1})}createItem(e){return this.client.rest.post(Ge,e)}createWorkDir(e){return this.client.rest.post(Ge,e)}sizeWithSection(e){return this.client.rest.get(Ye,e)}getDivideResources(e){return this.client.rest.get(Ve,e)}getQuota(e){return this.client.rest.get(`${Ge}/user_size`,e)}hide(e){return this.client.rest.post(`${Me}/hide`,e)}unhide(e){return this.client.rest.post(`${Me}/unhide`,e)}}const Qe="/storage/files",et=`${Qe}/net`,tt=`${Qe}/unzip`,st=`${Qe}/zip`,rt=`${st}/download`,it=`${Qe}/process`,nt=`${Qe}/code`;class ot{constructor(e){this.client=e}read(e,t){return t.path=e,this.client.rest.get(Qe,t)}replace(e,t){const s=Object.fromEntries(Object.entries(e).filter((([,e])=>null!=e)).map((([e,t])=>[e,String(t)])));return this.client.rest.put(Qe,t,{params:s})}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(Qe,i,{onUploadProgress:t=>{e(t)}});return{promise:n,abort:o}}uploadNet(e){return this.client.rest.post(et,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(rt,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(st,e)}cancelProcess(e){return this.client.rest.delete(it,e)}unZip(e){return this.client.rest.post(tt,e)}checkZip(e){return this.client.rest.head(nt,e)}}class ct{constructor(e){this.client=e}instance(){return this.client.rest.get("/storage/instance")}}const at="/storage/element/share";class lt{constructor(e){this.client=e}info(e){return this.client.rest.get(at,{path:e})}create(e,t){const s={path:e,permissions_type:t};return this.client.rest.post(at,s)}change(e){return this.client.rest.put(`${at}/${e.token}`,e)}delete(e){return this.client.rest.delete(at,{path:e})}refresh(e){return this.client.rest.put(`${at}/${e}/refresh`)}}const ut="/storage/trash/element",ht=`${ut}/all`;class dt{constructor(e){this.client=e}clear(e){return this.client.rest.delete(ut,e)}clearAll(){return this.client.rest.delete(ht)}restore(e){return this.client.rest.patch(ut,{del_groups:e})}restoreAll(){return this.client.rest.patch(ht)}}const pt="/users",$t=`${pt}/me`,_t=`${$t}/avatars`,gt=`${$t}/sessions`,ft=`${$t}/tokens`,mt=`${$t}/params`,vt=`${$t}/app-passwords`,wt=`${$t}/change-password`,kt=`${pt}/initial`,St=`${$t}/phone`,yt=`${St}/confirm`;class bt{constructor(e){this.client=e}initial(e){return this.client.rest.post(kt,e)}list(e){return this.client.rest.get(pt,e)}get(e){return this.client.rest.get(pt+`/${e}`)}create(e){return this.client.rest.post(pt,e)}update(e,t){return this.client.rest.put(pt+`/${e}`,t)}delete(e,t){return this.client.rest.delete(`${pt}/${e}`,t)}restore(e){return this.client.rest.post(`${pt}/${e}/restore`)}me(){return this.client.rest.get($t)}updateMe(e){return this.client.rest.put($t,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(`${pt}/${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(gt,e)}meDeleteSession(e){let t=gt;return e&&(t+=`/${e}`),this.client.rest.delete(t)}setRole(e,t=null){return this.client.rest.put(`${pt}/${e}/roles`,{role_id:t})}meParams(e){return this.client.rest.get(mt,{name:e})}meSetParams(e,t){return this.client.rest.post(`${mt}/${e}`,t)}meListParams(){return this.client.rest.get(mt)}phone(e){return this.client.rest.post(St,e)}phoneConfirm(e){return this.client.rest.post(`${yt}/${e}`)}appPasswordsList(e){return this.client.rest.get(vt,e)}createAppPasswords(e){return this.client.rest.post(vt,e)}deleteAppPasswords(e){return this.client.rest.delete(`${vt}/${e}`)}}const xt="/users/appeals",At=`${xt}/category`,Ct=`${xt}/subcategory`,Dt=`${xt}/file`;class Tt{constructor(e){this.client=e}category(){return this.client.rest.get(At)}subcategory(e){return this.client.rest.get(Ct,{category_code:e})}uploadFile(e){const t=new FormData;return t.append("file",e),this.client.rest.post(Dt,t)}deleteFile(e){return this.client.rest.delete(`${Dt}/${e}`)}createAppeal(e){return this.client.rest.post(xt,e)}}const Ut="/storage/element",Et=`${Ut}/history`,Pt=`${Ut}/version`,Rt=`${Pt}/lock`,Lt=`${Pt}/unlock`,It=`${Pt}/current`,zt=`${Pt}/size`;class Nt{constructor(e){this.client=e}history(e){return this.client.rest.get(Et,e)}versions(e){return this.client.rest.get(Pt,e)}create(e){return this.client.rest.post(Pt,e)}edit(e){return this.client.rest.put(Pt,e)}delete(e){return this.client.rest.delete(Pt,e)}size(e){return this.client.rest.get(zt,e)}makeCurrent(e){return this.client.rest.post(It,e)}lock(e){return this.client.rest.post(Rt,e)}unlock(e){return this.client.rest.post(Lt,e)}}const Ot="/version",Ft=`${Ot}/changelog`;class Wt{constructor(e){this.client=e}getVersions(e){return this.client.rest.get(Ot,e)}getChangelog(e){return this.client.rest.get(Ft,{version_number:e})}}const Bt="/tag",Ht=`${Bt}/list`;class qt{constructor(e){this.client=e}list(e){return this.client.rest.get(Ht,e)}get(e){return this.client.rest.get(`${Bt}/${e}`)}assign(e,t){return this.client.rest.post(`${Bt}/${e}/assign`,{items:t})}unassign(e,t){return this.client.rest.post(`${Bt}/${e}/unassign`,{items:t})}create(e){return this.client.rest.post(Bt,e)}update(e,t){return this.client.rest.put(`${Bt}/${e}`,t)}delete(e){return this.client.rest.delete(`${Bt}/${e}`)}}const jt="/spaces",Gt=`${jt}/access`;class Mt{constructor(e){this.client=e}space(e){return this.client.rest.get(`${jt}/${e}`)}list(e){return this.client.rest.get(jt,e)}create(e){return this.client.rest.post(jt,e)}update(e,t){return this.client.rest.put(`${jt}/${e}`,t)}delete(e){return this.client.rest.delete(`${jt}/${e}`)}adminsList(e,t){return this.client.rest.get(`${jt}/${e}/admins`,t)}accessList(e){return this.client.rest.get(Gt,e)}provideAccess(e){return this.client.rest.post(Gt,e)}deleteAllAccess(e){return this.client.rest.delete(Gt,e)}updateAccess(e,t){return this.client.rest.put(`${Gt}/${e}`,t)}deleteAccess(e,t){return this.client.rest.delete(`${Gt}/${e}`,{space_id:t})}}const Vt="/spaces",Zt="/files",Jt=`${Zt}/copy`,Yt=`${Zt}/upload`,Xt=`${Zt}/lock`,Kt=`${Zt}/unlock`,Qt=`${`${Zt}/download`}/zip`,es=`${Zt}/recover`,ts=`${es}/all`,ss=`${Zt}/trash`,rs=`${ss}/all`;class is{constructor(e){this.client=e}list(e,t){return this.client.rest.get(`${Vt}/${e}${Zt}/list`,t)}get(e,t){return this.client.rest.get(`${Vt}/${e}${Zt}`,t)}create(e,t){return this.client.rest.post(`${Vt}/${e}${Zt}`,t)}replace(e,t,s){const r=Object.fromEntries(Object.entries(t).filter((([,e])=>null!=e)).map((([e,t])=>[e,String(t)])));return this.client.rest.put(`${Vt}/${e}${Zt}`,s,{params:r})}delete(e,t){return this.client.rest.delete(`${Vt}/${e}${Zt}`,t)}copy(e,t){return this.client.rest.post(`${Vt}/${e}${Jt}`,t)}copyFromNextbox(e,t){return this.client.rest.post(`${Vt}/${e}${Jt}/from/nextbox`,t)}copyToNextbox(e,t){return this.client.rest.post(`${Vt}/${e}${Jt}/to/nextbox`,t)}download(e,t){return this.client.rest.get(`${Vt}/${e}${Zt}/download`,t,{responseType:D.Blob})}createZipToDownload(e,t){return this.client.rest.get(`${Vt}/${e}${Qt}`,t,{responseType:D.Blob})}move(e,t){return this.client.rest.post(`${Vt}/${e}${Zt}/move`,t)}rename(e,t){return this.client.rest.post(`${Vt}/${e}${Zt}/rename`,t)}upload(e,t,s,r){var i;const n=new FormData;n.set("overwrite",String(null!==(i=r.overwrite)&&void 0!==i&&i)),r.parent_id&&n.set("parent_id",r.parent_id),n.set("file",s);const{promise:o,abort:c}=this.client.rest.upload(`${Vt}/${t}${Yt}`,n,{onUploadProgress:t=>{e(t)}});return{promise:o,abort:c}}uploadNet(e,t){return this.client.rest.post(`${Vt}/${e}${Yt}/net`,t)}recover(e,t){return this.client.rest.post(`${Vt}/${e}/${es}`,{del_group_ids:t})}recoverAll(e){return this.client.rest.post(`${Vt}/${e}/${ts}`)}trash(e,t){return this.client.rest.delete(`${Vt}/${e}/${ss}`,{del_group_id:t})}trashAll(e){return this.client.rest.delete(`${Vt}/${e}/${rs}`)}lock(e,t){return this.client.rest.post(`${Vt}/${e}/${Xt}`,{file_id:t})}unlock(e,t){return this.client.rest.post(`${Vt}/${e}/${Kt}`,{file_id:t})}branch(e,t){return this.client.rest.get(`${Vt}/${e}/branch`,{file_id:t})}}class ns extends Error{}function os(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 cs(e,t){if("string"!=typeof e)throw new ns("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 ns(`Invalid token specified: missing part #${s+1}`);let i;try{i=os(r)}catch(e){throw new ns(`Invalid token specified: invalid base64 for part #${s+1} (${e.message})`)}try{return JSON.parse(i)}catch(e){throw new ns(`Invalid token specified: invalid json for part #${s+1} (${e.message})`)}}ns.prototype.name="InvalidTokenError";const as=async(e,t)=>{let s=t;for(const t of e)try{s=await t.fulfilled(s)}catch(e){if(!t.rejected)throw e;s=await t.rejected(e)}return s};function ls(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 us=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 hs(e){return e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):e}function ds(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 ps="update black token";class $s{constructor(){this.isUpdating=!1,this.tokenUpdateResolve=null}isTokenExpire(e){if(!e)return!1;return 1e3*e<=(new Date).getTime()+3e3}async refreshToken(e,t){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}${X}/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};ls("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}async waitForTokenUpdate(){return new Promise((e=>{const t=setInterval((()=>{this.isUpdating||(clearInterval(t),e())}),100)}))}}class _s{constructor(e,t){this.client=e,this.tokenUpdate=t,this.baseHost=""}get state(){return this.client.state}get(e,t,s){return this.request(T.GET,e,{params:t,cache:"no-cache",...s})}post(e,t,s){return this.request(T.POST,e,{body:t,...s})}put(e,t,s){return this.request(T.PUT,e,{body:t,cache:"no-cache",...s})}patch(e,t,s){return this.request(T.PATCH,e,{body:t,...s})}delete(e,t,s){return this.request(T.DELETE,e,{params:t,...s})}head(e,t,s){return this.request(T.HEAD,e,{params:t,...s})}upload(e,t,s){const r=new AbortController,i=r.signal;return{promise:this.request(T.POST,e,{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={method:e,...s};(null==s?void 0:s.signal)&&(c.signal=s.signal);(async()=>{var s,n,a,l;if(o||(c=null!==(s=await as(this.client.requestInterceptors,c))&&void 0!==s?s:c),this.state.authToken)for(const[e,s]of this.state.authToken.entries()){const r=cs(s.access_token);if(r&&r.is_remember&&this.tokenUpdate.isTokenExpire(r.exp)&&!t.includes("/login")&&!t.includes("/assets")){const t=await this.tokenUpdate.refreshToken(s,this.baseHost);t&&(this.state.authToken.set(e,t),c=null!==(n=await as(this.client.requestInterceptors,c))&&void 0!==n?n:c)}}const u=new XMLHttpRequest;c.params&&Object.keys(c.params).length&&(t+="?"+us(c.params));const h=null!==(a=c.host)&&void 0!==a?a:this.state.clientParams.host,d=`${h}${null!==(l=c.version)&&void 0!==l?l:this.state.clientParams.version}${t}`;if(u.open(e,d,!0),c.headers){const e=hs(c.headers);for(const[t,s]of Object.entries(e))(h===this.baseHost||"content-type"!==t.toLowerCase())&&u.setRequestHeader(t,s)}c.responseType&&(u.responseType=c.responseType),c.signal&&c.signal.addEventListener("abort",(()=>{u.abort(),i(new Error("Request aborted"))})),!u.upload||e!==T.POST&&e!==T.PUT&&e!==T.PATCH||(u.upload.onprogress=e=>{e.lengthComputable&&c.onUploadProgress&&c.onUploadProgress(e)}),u.onload=async()=>{if(c.signal&&c.signal.aborted)return;let e;switch(c.responseType){case D.Text:e=u.responseText;break;case D.Blob:case D.ArrayBuffer:e=u.response;break;default:try{e=JSON.parse(u.responseText)}catch{e=u.responseText}}const t=new Headers;u.getAllResponseHeaders().split("\r\n").forEach((e=>{const[s,r]=e.split(": ");s&&r&&t.append(s,r)}));const s={status:u.status,statusText:u.statusText,headers:t,url:u.responseURL};if(u.status>=200&&u.status<300)return await as(this.client.responseInterceptors,s),void(c.observe===U.Response?r({...s,body:e}):r(e));if(this.state.authToken&&(null==e?void 0:e.code)===ps){const e=await this.tokenUpdate.refreshToken(this.state.authToken.get(0),this.baseHost);e&&this.state.authToken.set(0,e)}const n={...s,error:e};await as(this.client.responseInterceptors,n),i(n)},u.onerror=()=>{i({status:u.status,statusText:u.statusText,url:u.responseURL,error:"Network error"})},u.send(ds(c.body))})().catch(i)}))}}class gs{constructor(e){this.AuthApiService=new i(this),this.ConnectionsApiService=new G(this),this.DiscoveryApiService=new M(this),this.DivideApiService=new Y(this),this.ExtensionsApiService=new ie(this),this.ExtensionsExternalApiService=new oe(this),this.FcaApiService=new le(this),this.GatewayApiService=new he(this),this.GroupApiService=new $e(this),this.LicenseApiService=new me(this),this.LinksApiService=new we(this),this.LimitationsApiService=new Se(this),this.LogstashApiService=new xe(this),this.NotificationApiService=new Pe(this),this.RoleApiService=new ze(this),this.ShareApiService=new We(this),this.StorageCommentApiService=new qe(this),this.StorageElementApiService=new Ke(this,this.FcaApiService),this.StorageFilesApiService=new ot(this),this.TagsApiService=new qt(this),this.StorageInstanceApiService=new ct(this),this.StorageShareApiService=new lt(this),this.StorageTrashApiService=new dt(this),this.UserApiService=new bt(this),this.UsersAppealsApiService=new Tt(this),this.VersionApiService=new Nt(this),this.PlatformVersionApiService=new Wt(this),this.SpaceApiService=new Mt(this),this.SpaceFilesApiService=new is(this),this.tokenUpdate=new $s,this.rest=new _s(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)||X},requestParams:{path:"",headers:{},query:{},body:null,cache:"no-cache"},authToken:null,skipInterceptors:!1},this.rest.baseHost=this.state.clientParams.host||""}}export{n as AccessRights,i as AuthApiService,X as BASE_URL_V1,K as BASE_URL_V2,o as CONNECTIONS_PERMISSION,gs as Client,l as ColorTypes,u as ConnectionGroup,h as ConnectionType,G as ConnectionsApiService,M as DiscoveryApiService,Y as DivideApiService,m as DivideMode,$ as DivideScope,a as EngineType,p as ExtensionFileMode,d as ExtensionType,ie as ExtensionsApiService,oe as ExtensionsExternalApiService,le as FcaApiService,he as GatewayApiService,$e as GroupApiService,me as LicenseApiService,k as LicenseError,y as LimitationSubType,S as LimitationType,Se as LimitationsApiService,we as LinksApiService,xe as LogstashApiService,ps as NEED_TOKEN_UPDATE_ERROR,x as NotificationAction,Pe as NotificationApiService,b as NotificationEntityType,A as NotificationRowAction,C as NotificationStyle,c as OrderDirection,_ as PermissionType,Wt as PlatformVersionApiService,de as QueryInitViewType,T as RequestMethod,U as RequestObserve,D as ResponseType,_s as Rest,f as RestrictionBooleanStatus,v as RestrictionModeKey,E as RestrictionSharing,g as RestrictionStatus,ze as RoleApiService,N as SettingControlType,We as ShareApiService,Mt as SpaceApiService,is as SpaceFilesApiService,qe as StorageCommentApiService,Ke as StorageElementApiService,H as StorageElementCheckStatus,F as StorageElementContentType,B as StorageElementHistoryAction,O as StorageElementType,ot as StorageFilesApiService,ct as StorageInstanceApiService,W as StorageRoot,lt as StorageShareApiService,dt as StorageTrashApiService,qt as TagsApiService,w as Tariff,$s as TokenUpdate,bt as UserApiService,z as UserAppType,P as UserAuthType,I as UserParamsLabel,R as UserStatus,L as UserType,Tt as UsersAppealsApiService,Nt as VersionApiService,as as applyInterceptors,ls as getCookieValue,us as makeUrlParams,hs as normalizeHeaders,ds as prepareRequestBody};
|
|
1
|
+
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;!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",e.DemoAdmin="demo_admin",e.SpaceManage="space_manage"}(n||(n={}));const o=[n.ConnectionsYandexDisk,n.ConnectionsSsh,n.ConnectionsMail,n.ConnectionsS3,n.ConnectionsS3,n.ConnectionsDiscord,n.ConnectionsWebdav,n.ConnectionsNextcloud,n.ConnectionsNextbox,n.ConnectionsHttpProxy];var c,a,l,u,h,d,p,$,_,g,f,m,v,w,k,S,y,b,x,A,C,D,T,U,P,E,R,L,I,z,N,O,F,W,B,H,q,j;!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.Yellow="yellow",e.Success="success",e.Critical="critical",e.Warning="warning",e.Brand="brand",e.Purple="purple",e.Primary="primary",e.Gray="gray"}(l||(l={})),function(e){e.Storages="storages_connections_group",e.Webhooks="webhooks_connections_group",e.Unknown="unknown_connections_group",e.Proxy="proxy_connections_group"}(u||(u={})),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"}(h||(h={})),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"}(p||(p={})),function(e){e.Storage="/storage/element",e.Connection="/connections"}($||($={})),function(e){e.Close="",e.Read="r",e.Write="rw",e.Full="rwd",e.SpaceManage="space_manage"}(_||(_={})),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"}(m||(m={})),function(e){e.Divide="divide",e.Share="share"}(v||(v={})),function(e){e.Free="free",e.Business="business",e.Enterprise="enterprise"}(w||(w={})),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.Purchased="purchased",e.Free="free"}(S||(S={})),function(e){e.Online="online",e.Offline="offline"}(y||(y={})),function(e){e.BySize="size",e.ByExt="extension",e.ByQuota="quota_size"}(b||(b={})),function(e){e.Size="size",e.White="extension_white",e.Black="extension_black"}(x||(x={})),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"}(A||(A={})),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",e.Application="application"}(C||(C={})),function(e){e.Read="read",e.Unread="unread",e.Delete="delete"}(D||(D={})),function(e){e.Plain="plain",e.Success="success",e.Info="info",e.Warning="warning",e.Error="error"}(T||(T={})),function(e){e.ArrayBuffer="arraybuffer",e.Blob="blob",e.Json="json",e.Text="text"}(U||(U={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.PATCH="PATCH",e.DELETE="DELETE",e.HEAD="HEAD"}(P||(P={})),function(e){e.Body="body",e.Response="response"}(E||(E={})),function(e){e.NONE="none",e.SOFT="soft",e.HARD="hard"}(R||(R={})),function(e){e.Native="native",e.Ldap="ldap",e.Vk="vk"}(L||(L={})),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"}(I||(I={})),function(e){e.User="user",e.Guest="guest",e.Emperor="emperor",e.Anonymous="anonymous"}(z||(z={})),function(e){e.Theme="theme",e.Lang="lang",e.Sort="sort",e.ViewApps="viewApps",e.WithoutContentWorkDir="withoutContentWorkDir",e.DashboardGrid="dashboardGrid"}(N||(N={})),function(e){e.Webdav="webdav"}(O||(O={})),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",e.ActivitySwitch="activity_switch"}(F||(F={})),function(e){e.Dir="dir",e.File="file",e.WorkDir="work_dir",e.App="app"}(W||(W={})),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"}(B||(B={})),function(e){e.my="my",e.fca="fca",e.divide="divide",e.share="share",e.favorite="favorite",e.trash="trash",e.spaces="spaces"}(H||(H={})),function(e){e.Create="create",e.Update="update",e.Move="move"}(q||(q={})),function(e){e[e.CheckNull=0]="CheckNull",e[e.CheckInProgress=1]="CheckInProgress",e[e.CheckPositive=2]="CheckPositive",e[e.CheckNegative=3]="CheckNegative"}(j||(j={}));const G="/connections",M=`${G}/dashboard`;class V{constructor(e){this.client=e}list(e){return this.client.rest.get(G,e)}get(e){return this.client.rest.get(`${G}/${e}`)}update(e,t){return this.client.rest.put(`${G}/${e}`,t)}delete(e){return this.client.rest.delete(`${G}/${e}`)}create(e){const t={[h.SSH]:"/disk/ssh",[h.Webdav]:"/disk/webdav",[h.Nextcloud]:"/disk/nextcloud",[h.NextBox]:"/disk/nextbox",[h.Discord]:"/webhooks/discord",[h.Mail]:"/webhooks/mail",[h.HttpProxy]:"/http_proxy",[h.S3]:"/disk/s3"};return this.client.rest.post(t[e.type]||G,e)}dashboard(e){return this.client.rest.get(M,e)}}class Z{constructor(e){this.client=e}discovery(e){return this.client.rest.get("/discovery",e)}}const J="/divide",Y=`${J}/restrictions`,X=`${J}/tag_group`;class K{constructor(e){this.client=e}divideDelete(e,t){return this.client.rest.delete(`${e}${J}/${t}`)}divideDeleteAll(e,t,s,r){return this.client.rest.delete(`${e}${J}`,{...this.makeParam(e,t),is_to_user_group:r,access_mode:s})}divideChange(e,t,s){return this.client.rest.put(`${e}${J}/${t}`,{access_mode:s})}divideCreate(e,t,s,r,i){const n={...this.makeParam(e,t),[i]:s,access_mode:r};return this.client.rest.post(`${e}${J}`,n)}divideUsers(e,t,s){return this.client.rest.get(`${e}${J}/users`,{...this.makeParam(e,t),...s})}divideTagGroupList(e){return this.client.rest.get(`${$.Storage}${X}`,e)}getRestriction(e){return this.client.rest.get(`${Y}/${e}`)}restrictionSize(e,t){return this.client.rest.get(`/${t}/restrictions/${e}/size`)}restrictions(e){return this.client.rest.get(`${Y}`,e)}restrictionsChange(e,t){return this.client.rest.put(`${Y}/${e}`,t)}makeParam(e,t){const s={};return e===$.Connection?s.connection_id=t:s.path=t,s}}const Q="/api/v1",ee="/api/v2",te="/static/extensions",se="/extensions/defaults",re=`${te}/names/users`,ie=`${te}/names/system`,ne=`${te}/tags`;class oe{constructor(e){this.client=e}getSetting(e){return this.client.rest.get(`${te}/${e}/settings`)}setSetting(e,t){return this.client.rest.post(`${te}/${e}/settings`,t)}deleteSetting(e){return this.client.rest.delete(`${te}/${e}/settings`)}get(e){return this.client.rest.get(`${te}/${e}`)}getByKey(e){return this.client.rest.get(`${te}/${e}`)}getDefault(e=[]){return this.client.rest.get(se,{ext_code:e})}setDefault(e,t){return this.client.rest.post(se,{ext_code:e,ext_uniq_key:t})}checkUpdates(){return this.client.rest.post(`${te}/check_updates`)}updateVersion(e,t){return this.client.rest.put(`${te}/${e}`,{version:t})}list(e){return this.client.rest.get(te,e)}listTags(e){return this.client.rest.get(ne,e)}delete(e,t){return this.client.rest.delete(`${te}/${e}`)}upload(e,t){const s=new FormData;s.set("file",t);const{promise:r,abort:i}=this.client.rest.upload(te,s,{version:ee,onUploadProgress:t=>{e(t)}});return{promise:r,abort:i}}install(e,t){return this.client.rest.post(`${te}/site`,{uniq_key:e,version:t},{version:ee})}getSystemNameExts(e){return this.client.rest.get(ie,e)}getUserNameExts(e){return this.client.rest.get(re,e)}createUserNameExt(e){return this.client.rest.post(`${re}`,{name:e})}deleteUserNameExt(e){return this.client.rest.delete(`${re}/${e}`)}deleteAllUserNameExts(){return this.client.rest.delete(`${re}`)}}const ce="/anons_ext/extensions";class ae{constructor(e){this.client=e}listExtensionsSite(e){return this.client.rest.get(ce,e,{host:"https://next-box.ru"})}extensionDetailSite(e){return this.client.rest.get(`${ce}/${e}`,{},{host:"https://next-box.ru"})}extensionMarkdown(e,t){return this.client.rest.get(`${ce}/${e.uniqKey}/readme`,{lang:e.lang},{...t,host:"https://next-box.ru"})}}const le="/disk",ue=`${le}/check`;class he{constructor(e){this.client=e}info(e,t){return this.client.rest.get(`${le}/${e}/element`,{path:t})}list(e,t){return this.client.rest.get(`${le}/${e}`,t)}create(e,t){return this.client.rest.post(`${le}/${e}/element`,t)}replace(e,t,s){return this.client.rest.put(`${le}/${e}/files?path=${t}`,s)}read(e,t){return this.client.rest.get(`${le}/${e}/files?path=${t}`)}upload(e,t,s,r=""){const i=new FormData;i.set("path",r),i.set("file",s);const{promise:n,abort:o}=this.client.rest.upload(`${le}/${t}/files`,i,{onUploadProgress:t=>{e(t)}});return{promise:n,abort:o}}uploadNet(e,t){return this.client.rest.post(`${le}/${e}/files/net`,t)}delete(e,t){return this.client.rest.delete(`${le}/${e}/trash/element`,{path:t})}check(e){return this.client.rest.post(ue,e)}}const de="/settings";class pe{constructor(e){this.client=e}settings(){return this.client.rest.get(de)}changeSettings(e){return this.client.rest.post(de,e)}queryInit(){return this.client.rest.get("/query/init")}}var $e;!function(e){e.Standard="Standard",e.Simple="Simple"}($e||($e={}));const _e="/groups";class ge{constructor(e){this.client=e}list(e){return this.client.rest.get(_e,e)}get(e){return this.client.rest.get(`${_e}/${e}`)}listUsers(e,t){return this.client.rest.get(`${_e}/${e}/users`,t)}default(){return this.client.rest.get(`${_e}/default`)}create(e){return this.client.rest.post(_e,e)}update(e,t){return this.client.rest.put(`${_e}/${e}`,t)}delete(e){return this.client.rest.delete(`${_e}/${e}`)}}const fe="/license",me=`${fe}/manual-check`,ve=`${fe}/hardware/hash`;class we{constructor(e){this.client=e}info(){return this.client.rest.get(fe)}create(e){return this.client.rest.post(fe,e)}check(){return this.client.rest.post(me)}delete(){return this.client.rest.delete(fe)}getHash(){return this.client.rest.get(ve)}}const ke="/links";class Se{constructor(e){this.client=e}createShortLink(e){return this.client.rest.post(ke,e)}updateShortLink(e){return this.client.rest.put(ke,e)}}const ye="/limitations";class be{constructor(e){this.client=e}me(){return this.client.rest.get("/limitations/user/me")}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)}get(e){return this.client.rest.get(`${ye}/${e}`)}update(e,t){return this.client.rest.put(`${ye}/${e}`,t)}delete(e){return this.client.rest.delete(`${ye}/${e}`)}getLimitationsByUser(e){return this.client.rest.get(`/limitations/user/${e}`)}addUserToLimitation(e,t){return this.client.rest.patch(`${ye}/${e}/user`,{id:t})}deleteUserFromLimitation(e,t){return this.client.rest.delete(`${ye}/${e}/user/${t}`)}}const xe="/logs/users",Ae=`${xe}/actions`;class Ce{constructor(e){this.client=e}getUsersLogs(e){return this.client.rest.get(`${xe}`,e)}getLogsActions(e){return this.client.rest.get(`${Ae}`,e)}}const De="/notifications",Te=`${De}/all`,Ue=`${De}/subscription`,Pe=`${Ue}/extension`,Ee=`${De}/permission`,Re=`${De}/task`;class Le{constructor(e){this.client=e}list(e){return this.client.rest.get(De,e)}task(e){return this.client.rest.get(`${Re}/${e}`)}toggleStatus(e,t){return this.client.rest.put(De,{ids:e,to_status:t})}toggleAllStatus(e){return this.client.rest.put(Te,{to_status:e})}delete(e){return this.client.rest.delete(De,{id:e})}deleteAll(){return this.client.rest.delete(Te)}getPermission(){return this.client.rest.get(Ee)}setPermission(e){return this.client.rest.post(Ee,{enabled:e})}getSubscription(){return this.client.rest.get(Ue)}getSubscriptionExtension(){return this.client.rest.get(Pe)}setSubscription(e){const t={action_groups:{...e}};return this.client.rest.post(Ue,t)}setSubscriptionExtension(e){const t={application_groups:{...e}};return this.client.rest.post(Pe,t)}}const Ie="/roles",ze=`${Ie}/default`,Ne="/permissions";class Oe{constructor(e){this.client=e}list(e){return this.client.rest.get(Ie,e)}get(e){return this.client.rest.get(`${Ie}/${e}`)}getDefault(){return this.client.rest.get(`${ze}`)}create(e){return this.client.rest.post(Ie,e)}update(e,t){return this.client.rest.put(`${Ie}/${e}`,t)}delete(e){return this.client.rest.delete(`${Ie}/${e}`)}permissionList(){return this.client.rest.get(Ne)}addPermission(e,t){return this.client.rest.put(`${Ie}/${e}/permissions`,{ids:t})}deletePermission(e,t){return this.client.rest.delete(`${Ie}/${e}/${Ne}`,{ids:t})}}const Fe="/share",We=`${Fe}/restrictions`,Be=`${Fe}/login`;class He{constructor(e){this.client=e}info(e){return this.client.rest.get(`${Fe}?share_token=${e}`)}checkPassword(e,t){const s=encodeURIComponent(e);return this.client.rest.get(`${Fe}/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(`${Be}`,e)}}const qe="/storage/element/version/comment",je=`${qe}/all`;class Ge{constructor(e){this.client=e}list(e){return this.client.rest.get(`${qe}`,e)}create(e){return this.client.rest.post(`${qe}`,e)}update(e){return this.client.rest.put(`${qe}`,e)}delete(e){return this.client.rest.delete(`${qe}`,e)}deleteAll(e){return this.client.rest.delete(`${je}`,e)}}const Me="/storage",Ve=`${Me}/element`,Ze=`${Ve}/divide`,Je=`${Ze}/resource`,Ye=`${Ve}/move`,Xe=`${Ve}/copy`,Ke=`${Ve}/content_type_size`,Qe="/disk";class et{constructor(e,t){this.client=e,this.fcaApiService=t}list(e){return this.client.rest.get(Me,e)}info(e){return Object.keys(e).forEach((t=>{const s=t;e[s]||delete e[s]})),this.client.rest.get(Ve,e)}fileInfo(e,t){return this.client.rest.get(`${Ve}/${e}`,t?{file_version_id:t}:{})}combineInfo({root:e,rootId:t,id:s,path:r,file_version_id:i,zip_entry_path:n}){return e===H.fca&&t?this.fcaApiService.info(t,r):s?this.info({file_container_id:s,divide_id:t,file_version_id:i,zip_entry_path:n}):this.info({path:r,divide_id:t,file_version_id:i,zip_entry_path:n})}size(e){return this.client.rest.post(`${Ve}/size`,e)}move(e,t,s){const{from_divide_id:r,to_divide_id:i}=e;let n={...e,from_divide_id:null,to_divide_id:null};return t===H.fca&&s===H.fca?this.client.rest.post(`${Qe}/${r}/files/move${Qe}/${i}`,n):t===H.fca?(r&&(n.from_divide_id=r),this.client.rest.put(`${Qe}/${i}/files/from/box`,n)):s===H.fca?(i&&(n.to_divide_id=i),this.client.rest.put(`${Qe}/${r}/files/to/box`,n)):this.client.rest.post(Ye,e)}copy(e,t,s){const{from_divide_id:r,to_divide_id:i}=e;let n={...e,from_divide_id:null,to_divide_id:null};return s===H.fca&&t===H.fca?this.client.rest.post(`${Qe}/${r}/files/copy${Qe}/${i}`,n):s===H.fca?(r&&(n.from_divide_id=r),this.client.rest.post(`${Qe}/${i}/files/from/box`,n)):t===H.fca?(i&&(n.to_divide_id=i),this.client.rest.post(`${Qe}/${r}/files/to/box`,n)):this.client.rest.post(Xe,e)}pasteFromShared(e,t,s){const r={from_sharing_token:e,from_sharing_password:s,paths:t};return this.client.rest.post(`${Ve}/copy`,r)}create(e){return this.client.rest.post(Ve,e)}delete(e,t){const s={path:e};return t&&(s.divide_id=t),this.client.rest.delete(Ve,s)}favorite(e){return this.client.rest.put(`${Ve}?path=${encodeURIComponent(e)}`,{is_favorite:!0})}removeFavorite(e){return this.client.rest.put(`${Ve}?path=${encodeURIComponent(e)}`,{is_favorite:!1})}createItem(e){return this.client.rest.post(Ve,e)}createWorkDir(e){return this.client.rest.post(Ve,e)}sizeWithSection(e){return this.client.rest.get(Ke,e)}getDivideResources(e){return this.client.rest.get(Je,e)}getQuota(e){return this.client.rest.get(`${Ve}/user_size`,e)}hide(e){return this.client.rest.post(`${Ze}/hide`,e)}unhide(e){return this.client.rest.post(`${Ze}/unhide`,e)}}const tt="/storage/files",st=`${tt}/net`,rt=`${tt}/unzip`,it=`${tt}/zip`,nt=`${it}/download`,ot=`${tt}/process`,ct=`${tt}/code`;class at{constructor(e){this.client=e}read(e,t){return t.path=e,this.client.rest.get(tt,t)}replace(e,t){const s=Object.fromEntries(Object.entries(e).filter((([,e])=>null!=e)).map((([e,t])=>[e,String(t)])));return this.client.rest.put(tt,t,{params:s})}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(tt,i,{onUploadProgress:t=>{e(t)}});return{promise:n,abort:o}}uploadNet(e){return this.client.rest.post(st,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(nt,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(it,e)}cancelProcess(e){return this.client.rest.delete(ot,e)}unZip(e){return this.client.rest.post(rt,e)}checkZip(e){return this.client.rest.head(ct,e)}}class lt{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 dt="/storage/trash/element",pt=`${dt}/all`;class $t{constructor(e){this.client=e}clear(e){return this.client.rest.delete(dt,e)}clearAll(){return this.client.rest.delete(pt)}restore(e){return this.client.rest.patch(dt,{del_groups:e})}restoreAll(){return this.client.rest.patch(pt)}}const _t="/users",gt=`${_t}/me`,ft=`${gt}/avatars`,mt=`${gt}/sessions`,vt=`${gt}/tokens`,wt=`${gt}/params`,kt=`${gt}/app-passwords`,St=`${gt}/change-password`,yt=`${_t}/initial`,bt=`${gt}/phone`,xt=`${bt}/confirm`;class At{constructor(e){this.client=e}initial(e){return this.client.rest.post(yt,e)}list(e){return this.client.rest.get(_t,e)}get(e){return this.client.rest.get(_t+`/${e}`)}create(e){return this.client.rest.post(_t,e)}update(e,t){return this.client.rest.put(_t+`/${e}`,t)}delete(e,t){return this.client.rest.delete(`${_t}/${e}`,t)}restore(e){return this.client.rest.post(`${_t}/${e}/restore`)}me(){return this.client.rest.get(gt)}updateMe(e){return this.client.rest.put(gt,e)}createToken(e){return this.client.rest.post(vt,e)}listToken(e){return this.client.rest.get(vt,e)}deleteToken(e){return this.client.rest.delete(`${vt}/${e}`)}changeMyPassword(e){return this.client.rest.put(St,e)}changeUsersPassword(e,t){return this.client.rest.put(`${_t}/${e}/change-password`,t)}meUploadAvatar(e,t){const s=new FormData;return s.append("file",e,t),this.client.rest.post(ft,s)}meDeleteAvatar(){return this.client.rest.delete(ft)}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(`${_t}/${e}/roles`,{role_id:t})}meParams(e){return this.client.rest.get(wt,{name:e})}meSetParams(e,t){return this.client.rest.post(`${wt}/${e}`,t)}meListParams(){return this.client.rest.get(wt)}phone(e){return this.client.rest.post(bt,e)}phoneConfirm(e){return this.client.rest.post(`${xt}/${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="/users/appeals",Dt=`${Ct}/category`,Tt=`${Ct}/subcategory`,Ut=`${Ct}/file`;class Pt{constructor(e){this.client=e}category(){return this.client.rest.get(Dt)}subcategory(e){return this.client.rest.get(Tt,{category_code:e})}uploadFile(e){const t=new FormData;return t.append("file",e),this.client.rest.post(Ut,t)}deleteFile(e){return this.client.rest.delete(`${Ut}/${e}`)}createAppeal(e){return this.client.rest.post(Ct,e)}}const Et="/storage/element",Rt=`${Et}/history`,Lt=`${Et}/version`,It=`${Lt}/lock`,zt=`${Lt}/unlock`,Nt=`${Lt}/current`,Ot=`${Lt}/size`;class Ft{constructor(e){this.client=e}history(e){return this.client.rest.get(Rt,e)}versions(e){return this.client.rest.get(Lt,e)}create(e){return this.client.rest.post(Lt,e)}edit(e){return this.client.rest.put(Lt,e)}delete(e){return this.client.rest.delete(Lt,e)}size(e){return this.client.rest.get(Ot,e)}makeCurrent(e){return this.client.rest.post(Nt,e)}lock(e){return this.client.rest.post(It,e)}unlock(e){return this.client.rest.post(zt,e)}}const Wt="/version",Bt=`${Wt}/changelog`;class Ht{constructor(e){this.client=e}getVersions(e){return this.client.rest.get(Wt,e)}getChangelog(e){return this.client.rest.get(Bt,{version_number:e})}}const qt="/tag",jt=`${qt}/list`;class Gt{constructor(e){this.client=e}list(e){return this.client.rest.get(jt,e)}get(e){return this.client.rest.get(`${qt}/${e}`)}assign(e,t){return this.client.rest.post(`${qt}/${e}/assign`,{items:t})}unassign(e,t){return this.client.rest.post(`${qt}/${e}/unassign`,{items:t})}create(e){return this.client.rest.post(qt,e)}update(e,t){return this.client.rest.put(`${qt}/${e}`,t)}delete(e){return this.client.rest.delete(`${qt}/${e}`)}}const Mt="/spaces",Vt=`${Mt}/access`;class Zt{constructor(e){this.client=e}space(e){return this.client.rest.get(`${Mt}/${e}`)}list(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){return this.client.rest.delete(`${Mt}/${e}`)}adminsList(e,t){return this.client.rest.get(`${Mt}/${e}/admins`,t)}accessList(e){return this.client.rest.get(Vt,e)}provideAccess(e){return this.client.rest.post(Vt,e)}deleteAllAccess(e){return this.client.rest.delete(Vt,e)}updateAccess(e,t){return this.client.rest.put(`${Vt}/${e}`,t)}deleteAccess(e,t){return this.client.rest.delete(`${Vt}/${e}`,{space_id:t})}}const Jt="/spaces",Yt="/files",Xt=`${Yt}/copy`,Kt=`${Yt}/upload`,Qt=`${Yt}/lock`,es=`${Yt}/unlock`,ts=`${`${Yt}/download`}/zip`,ss=`${Yt}/recover`,rs=`${ss}/all`,is=`${Yt}/trash`,ns=`${is}/all`;class os{constructor(e){this.client=e}list(e,t){return this.client.rest.get(`${Jt}/${e}${Yt}/list`,t)}get(e,t){return this.client.rest.get(`${Jt}/${e}${Yt}`,t)}create(e,t){return this.client.rest.post(`${Jt}/${e}${Yt}`,t)}replace(e,t,s){const r=Object.fromEntries(Object.entries(t).filter((([,e])=>null!=e)).map((([e,t])=>[e,String(t)])));return this.client.rest.put(`${Jt}/${e}${Yt}`,s,{params:r})}delete(e,t){return this.client.rest.delete(`${Jt}/${e}${Yt}`,t)}copy(e,t){return this.client.rest.post(`${Jt}/${e}${Xt}`,t)}copyFromNextbox(e,t){return this.client.rest.post(`${Jt}/${e}${Xt}/from/nextbox`,t)}copyToNextbox(e,t){return this.client.rest.post(`${Jt}/${e}${Xt}/to/nextbox`,t)}download(e,t){return this.client.rest.get(`${Jt}/${e}${Yt}/download`,t,{responseType:U.Blob})}createZipToDownload(e,t){return this.client.rest.get(`${Jt}/${e}${ts}`,t,{responseType:U.Blob})}move(e,t){return this.client.rest.post(`${Jt}/${e}${Yt}/move`,t)}rename(e,t){return this.client.rest.post(`${Jt}/${e}${Yt}/rename`,t)}upload(e,t,s,r){var i;const n=new FormData;n.set("overwrite",String(null!==(i=r.overwrite)&&void 0!==i&&i)),r.parent_id&&n.set("parent_id",r.parent_id),n.set("file",s);const{promise:o,abort:c}=this.client.rest.upload(`${Jt}/${t}${Kt}`,n,{onUploadProgress:t=>{e(t)}});return{promise:o,abort:c}}uploadNet(e,t){return this.client.rest.post(`${Jt}/${e}${Kt}/net`,t)}recover(e,t){return this.client.rest.post(`${Jt}/${e}/${ss}`,{del_group_ids:t})}recoverAll(e){return this.client.rest.post(`${Jt}/${e}/${rs}`)}trash(e,t){return this.client.rest.delete(`${Jt}/${e}/${is}`,{del_group_id:t})}trashAll(e){return this.client.rest.delete(`${Jt}/${e}/${ns}`)}lock(e,t){return this.client.rest.post(`${Jt}/${e}/${Qt}`,{file_id:t})}unlock(e,t){return this.client.rest.post(`${Jt}/${e}/${es}`,{file_id:t})}branch(e,t){return this.client.rest.get(`${Jt}/${e}/branch`,{file_id:t})}}class cs extends Error{}function as(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 ls(e,t){if("string"!=typeof e)throw new cs("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 cs(`Invalid token specified: missing part #${s+1}`);let i;try{i=as(r)}catch(e){throw new cs(`Invalid token specified: invalid base64 for part #${s+1} (${e.message})`)}try{return JSON.parse(i)}catch(e){throw new cs(`Invalid token specified: invalid json for part #${s+1} (${e.message})`)}}cs.prototype.name="InvalidTokenError";const us=async(e,t)=>{let s=t;for(const t of e)try{s=await t.fulfilled(s)}catch(e){if(!t.rejected)throw e;s=await t.rejected(e)}return s};function hs(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 ds=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 ps(e){return e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):e}function $s(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 _s="update black token";class gs{constructor(){this.isUpdating=!1,this.tokenUpdateResolve=null}isTokenExpire(e){if(!e)return!1;return 1e3*e<=(new Date).getTime()+3e3}async refreshToken(e,t){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}${Q}/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};hs("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}async waitForTokenUpdate(){return new Promise((e=>{const t=setInterval((()=>{this.isUpdating||(clearInterval(t),e())}),100)}))}}class fs{constructor(e,t){this.client=e,this.tokenUpdate=t,this.baseHost=""}get state(){return this.client.state}get(e,t,s){return this.request(P.GET,e,{params:t,cache:"no-cache",...s})}post(e,t,s){return this.request(P.POST,e,{body:t,...s})}put(e,t,s){return this.request(P.PUT,e,{body:t,cache:"no-cache",...s})}patch(e,t,s){return this.request(P.PATCH,e,{body:t,...s})}delete(e,t,s){return this.request(P.DELETE,e,{params:t,...s})}head(e,t,s){return this.request(P.HEAD,e,{params:t,...s})}upload(e,t,s){const r=new AbortController,i=r.signal;return{promise:this.request(P.POST,e,{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={method:e,...s};(null==s?void 0:s.signal)&&(c.signal=s.signal);(async()=>{var s,n,a,l;if(o||(c=null!==(s=await us(this.client.requestInterceptors,c))&&void 0!==s?s:c),this.state.authToken)for(const[e,s]of this.state.authToken.entries()){const r=ls(s.access_token);if(r&&r.is_remember&&this.tokenUpdate.isTokenExpire(r.exp)&&!t.includes("/login")&&!t.includes("/assets")){const t=await this.tokenUpdate.refreshToken(s,this.baseHost);t&&(this.state.authToken.set(e,t),c=null!==(n=await us(this.client.requestInterceptors,c))&&void 0!==n?n:c)}}const u=new XMLHttpRequest;c.params&&Object.keys(c.params).length&&(t+="?"+ds(c.params));const h=null!==(a=c.host)&&void 0!==a?a:this.state.clientParams.host,d=`${h}${null!==(l=c.version)&&void 0!==l?l:this.state.clientParams.version}${t}`;if(u.open(e,d,!0),c.headers){const e=ps(c.headers);for(const[t,s]of Object.entries(e))(h===this.baseHost||"content-type"!==t.toLowerCase())&&u.setRequestHeader(t,s)}c.responseType&&(u.responseType=c.responseType),c.signal&&c.signal.addEventListener("abort",(()=>{u.abort(),i(new Error("Request aborted"))})),!u.upload||e!==P.POST&&e!==P.PUT&&e!==P.PATCH||(u.upload.onprogress=e=>{e.lengthComputable&&c.onUploadProgress&&c.onUploadProgress(e)}),u.onload=async()=>{if(c.signal&&c.signal.aborted)return;let e;switch(c.responseType){case U.Text:e=u.responseText;break;case U.Blob:case U.ArrayBuffer:e=u.response;break;default:try{e=JSON.parse(u.responseText)}catch{e=u.responseText}}const t=new Headers;u.getAllResponseHeaders().split("\r\n").forEach((e=>{const[s,r]=e.split(": ");s&&r&&t.append(s,r)}));const s={status:u.status,statusText:u.statusText,headers:t,url:u.responseURL};if(u.status>=200&&u.status<300)return await us(this.client.responseInterceptors,s),void(c.observe===E.Response?r({...s,body:e}):r(e));if(this.state.authToken&&(null==e?void 0:e.code)===_s){const e=await this.tokenUpdate.refreshToken(this.state.authToken.get(0),this.baseHost);e&&this.state.authToken.set(0,e)}const n={...s,error:e};await us(this.client.responseInterceptors,n),i(n)},u.onerror=()=>{i({status:u.status,statusText:u.statusText,url:u.responseURL,error:"Network error"})},u.send($s(c.body))})().catch(i)}))}}class ms{constructor(e){this.AuthApiService=new i(this),this.ConnectionsApiService=new V(this),this.DiscoveryApiService=new Z(this),this.DivideApiService=new K(this),this.ExtensionsApiService=new oe(this),this.ExtensionsExternalApiService=new ae(this),this.FcaApiService=new he(this),this.GatewayApiService=new pe(this),this.GroupApiService=new ge(this),this.LicenseApiService=new we(this),this.LinksApiService=new Se(this),this.LimitationsApiService=new be(this),this.LogstashApiService=new Ce(this),this.NotificationApiService=new Le(this),this.RoleApiService=new Oe(this),this.ShareApiService=new He(this),this.StorageCommentApiService=new Ge(this),this.StorageElementApiService=new et(this,this.FcaApiService),this.StorageFilesApiService=new at(this),this.TagsApiService=new Gt(this),this.StorageInstanceApiService=new lt(this),this.StorageShareApiService=new ht(this),this.StorageTrashApiService=new $t(this),this.UserApiService=new At(this),this.UsersAppealsApiService=new Pt(this),this.VersionApiService=new Ft(this),this.PlatformVersionApiService=new Ht(this),this.SpaceApiService=new Zt(this),this.SpaceFilesApiService=new os(this),this.tokenUpdate=new gs,this.rest=new fs(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)||Q},requestParams:{path:"",headers:{},query:{},body:null,cache:"no-cache"},authToken:null,skipInterceptors:!1},this.rest.baseHost=this.state.clientParams.host||""}}export{n as AccessRights,i as AuthApiService,Q as BASE_URL_V1,ee as BASE_URL_V2,o as CONNECTIONS_PERMISSION,ms as Client,l as ColorTypes,u as ConnectionGroup,h as ConnectionType,V as ConnectionsApiService,Z as DiscoveryApiService,K as DivideApiService,m as DivideMode,$ as DivideScope,a as EngineType,p as ExtensionFileMode,d as ExtensionType,oe as ExtensionsApiService,ae as ExtensionsExternalApiService,he as FcaApiService,pe as GatewayApiService,ge as GroupApiService,we as LicenseApiService,k as LicenseError,y as LicenseMode,S as LicenseState,x as LimitationSubType,b as LimitationType,be as LimitationsApiService,Se as LinksApiService,Ce as LogstashApiService,_s as NEED_TOKEN_UPDATE_ERROR,C as NotificationAction,Le as NotificationApiService,A as NotificationEntityType,D as NotificationRowAction,T as NotificationStyle,c as OrderDirection,_ as PermissionType,Ht as PlatformVersionApiService,$e as QueryInitViewType,P as RequestMethod,E as RequestObserve,U as ResponseType,fs as Rest,f as RestrictionBooleanStatus,v as RestrictionModeKey,R as RestrictionSharing,g as RestrictionStatus,Oe as RoleApiService,F as SettingControlType,He as ShareApiService,Zt as SpaceApiService,os as SpaceFilesApiService,Ge as StorageCommentApiService,et as StorageElementApiService,j as StorageElementCheckStatus,B as StorageElementContentType,q as StorageElementHistoryAction,W as StorageElementType,at as StorageFilesApiService,lt as StorageInstanceApiService,H as StorageRoot,ht as StorageShareApiService,$t as StorageTrashApiService,Gt as TagsApiService,w as Tariff,gs as TokenUpdate,At as UserApiService,O as UserAppType,L as UserAuthType,N as UserParamsLabel,I as UserStatus,z as UserType,Pt as UsersAppealsApiService,Ft as VersionApiService,us as applyInterceptors,hs as getCookieValue,ds as makeUrlParams,ps as normalizeHeaders,$s as prepareRequestBody};
|
package/dist/index.d.ts
CHANGED
|
@@ -835,9 +835,12 @@ interface FileLocking {
|
|
|
835
835
|
|
|
836
836
|
interface License {
|
|
837
837
|
custom_max_users_count: number | null;
|
|
838
|
-
expire_in
|
|
838
|
+
expire_in?: string;
|
|
839
|
+
technical_support_expire_in?: string;
|
|
839
840
|
key: string | null;
|
|
840
841
|
plan: Tariff;
|
|
842
|
+
state: LicenseState;
|
|
843
|
+
mode: LicenseMode;
|
|
841
844
|
error?: LicenseError | string;
|
|
842
845
|
}
|
|
843
846
|
interface ChangeLicenseParams {
|
|
@@ -856,6 +859,14 @@ declare enum LicenseError {
|
|
|
856
859
|
NotValid = "License not valid",
|
|
857
860
|
NotFound = "license file not found"
|
|
858
861
|
}
|
|
862
|
+
declare enum LicenseState {
|
|
863
|
+
Purchased = "purchased",
|
|
864
|
+
Free = "free"
|
|
865
|
+
}
|
|
866
|
+
declare enum LicenseMode {
|
|
867
|
+
Online = "online",
|
|
868
|
+
Offline = "offline"
|
|
869
|
+
}
|
|
859
870
|
|
|
860
871
|
interface Limitation extends LimitationBody {
|
|
861
872
|
id: number;
|
|
@@ -2042,5 +2053,5 @@ declare function normalizeHeaders(headers: Headers | [string, string][] | Record
|
|
|
2042
2053
|
|
|
2043
2054
|
declare function prepareRequestBody(body: unknown): XMLHttpRequestBodyInit | Document | null;
|
|
2044
2055
|
|
|
2045
|
-
export { AccessRights, AuthApiService, BASE_URL_V1, BASE_URL_V2, CONNECTIONS_PERMISSION, Client, ColorTypes, 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, PlatformVersionApiService, QueryInitViewType, RequestMethod, RequestObserve, ResponseType, Rest, RestrictionBooleanStatus, RestrictionModeKey, RestrictionSharing, RestrictionStatus, RoleApiService, SettingControlType, ShareApiService, SpaceApiService, SpaceFilesApiService, StorageCommentApiService, StorageElementApiService, StorageElementCheckStatus, StorageElementContentType, StorageElementHistoryAction, StorageElementType, StorageFilesApiService, StorageInstanceApiService, StorageRoot, StorageShareApiService, StorageTrashApiService, TagsApiService, Tariff, TokenUpdate, UserApiService, UserAppType, UserAuthType, UserParamsLabel, UserStatus, UserType, UsersAppealsApiService, VersionApiService, applyInterceptors, getCookieValue, makeUrlParams, normalizeHeaders, prepareRequestBody };
|
|
2056
|
+
export { AccessRights, AuthApiService, BASE_URL_V1, BASE_URL_V2, CONNECTIONS_PERMISSION, Client, ColorTypes, ConnectionGroup, ConnectionType, ConnectionsApiService, DiscoveryApiService, DivideApiService, DivideMode, DivideScope, EngineType, ExtensionFileMode, ExtensionType, ExtensionsApiService, ExtensionsExternalApiService, FcaApiService, GatewayApiService, GroupApiService, LicenseApiService, LicenseError, LicenseMode, LicenseState, LimitationSubType, LimitationType, LimitationsApiService, LinksApiService, LogstashApiService, NEED_TOKEN_UPDATE_ERROR, NotificationAction, NotificationApiService, NotificationEntityType, NotificationRowAction, NotificationStyle, OrderDirection, PermissionType, PlatformVersionApiService, QueryInitViewType, RequestMethod, RequestObserve, ResponseType, Rest, RestrictionBooleanStatus, RestrictionModeKey, RestrictionSharing, RestrictionStatus, RoleApiService, SettingControlType, ShareApiService, SpaceApiService, SpaceFilesApiService, StorageCommentApiService, StorageElementApiService, StorageElementCheckStatus, StorageElementContentType, StorageElementHistoryAction, StorageElementType, StorageFilesApiService, StorageInstanceApiService, StorageRoot, StorageShareApiService, StorageTrashApiService, TagsApiService, Tariff, TokenUpdate, UserApiService, UserAppType, UserAuthType, UserParamsLabel, UserStatus, UserType, UsersAppealsApiService, VersionApiService, applyInterceptors, getCookieValue, makeUrlParams, normalizeHeaders, prepareRequestBody };
|
|
2046
2057
|
export type { AccessToken, Appeal, AssignTagItemParam, AuthToken, AuthTokenUpdate, AuthType, Category, 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, PlatformVersions, ProgressEvent, QueryInitResponse, Quota, RequestAuthSettingsParams, RequestAuthTfaParams, RequestAuthTokenParams, RequestBaseParams, RequestConfig, RequestConnectionParams, RequestCopyFromNextboxParams, RequestCopyToNextboxParams, RequestLimitationsListParams, RequestLogsActionsParams, RequestNotificationListParams, RequestProvideSpaceAccessParams, RequestShareLoginParams, RequestSpaceAccessListParams, RequestSpaceAccessParams, RequestSpaceAdminsListParams, RequestSpaceCopyFileParams, RequestSpaceCreateElementParams, RequestSpaceCreateParams, RequestSpaceDeleteFilesParams, RequestSpaceDownloadDirParams, RequestSpaceDownloadFileParams, RequestSpaceElementListParams, RequestSpaceGetFileParams, RequestSpaceListParams, RequestSpaceMoveFilesParams, RequestSpaceMoveItem, RequestSpaceRenameFileParams, RequestSpaceReplaceFileParams, RequestSpaceUpdateParams, RequestSpaceUploadFromUrlParams, RequestSpaceUploadParams, RequestStorageListItemParams, RequestStorageListParams, RequestTagGroupsParams, RequestTagParams, RequestUpdateSpaceAccessParams, RequestUserDivideParams, RequestUserGroupListParams, RequestUserListParams, RequestUserRoleListParams, RequestUsersLogParams, RequestVersionsSizeParams, ResourceAccess, ResponseItem, ResponseList, ResponseListNotification, Restriction, Setting, SettingField, SettingFieldView, SettingLang, SettingValue, SettingValueField, SettingVariant, SettingViewConnectionChoose, SettingViewSelect, ShareInfo, ShareModel, SizeBySection, Space, SpaceAccess, SpaceAccessProvide, SpaceAcсessResponseList, SpaceAdmin, SpaceElement, StorageDivideElement, StorageElement, StorageElementFileInfo, StorageElementHistory, StorageElementPaste, StorageElementPasteParams, StorageElementTree, StorageElementVersion, StorageElementVersionLock, StorageInstance, StorageItemSizeParams, StorageItemSizePathParams, StorageRouteData, StorageSharingElement, StorageTrashElement, StorageTrashItem, Tag, TagCreateParams, TagGroup, TagIconExtension, TaskNotification, UnZipRequestParams, UnionRestriction, UpdateCommentParams, UploadNetRequestParams, User, UserAppPasswordInfo, UserAppPasswords, UserDivide, UserGroup, UserInfo, UserLabel, UserNamesExtension, UserNotification, UserParams, UserPhone, UserRole, UserSession, UserToken, UsersLog, Version, VersionLockRequestParams };
|
package/dist/types/license.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
export interface License {
|
|
2
2
|
custom_max_users_count: number | null;
|
|
3
|
-
expire_in
|
|
3
|
+
expire_in?: string;
|
|
4
|
+
technical_support_expire_in?: string;
|
|
4
5
|
key: string | null;
|
|
5
6
|
plan: Tariff;
|
|
7
|
+
state: LicenseState;
|
|
8
|
+
mode: LicenseMode;
|
|
6
9
|
error?: LicenseError | string;
|
|
7
10
|
}
|
|
8
11
|
export interface ChangeLicenseParams {
|
|
@@ -21,3 +24,11 @@ export declare enum LicenseError {
|
|
|
21
24
|
NotValid = "License not valid",
|
|
22
25
|
NotFound = "license file not found"
|
|
23
26
|
}
|
|
27
|
+
export declare enum LicenseState {
|
|
28
|
+
Purchased = "purchased",
|
|
29
|
+
Free = "free"
|
|
30
|
+
}
|
|
31
|
+
export declare enum LicenseMode {
|
|
32
|
+
Online = "online",
|
|
33
|
+
Offline = "offline"
|
|
34
|
+
}
|