nb-js-client 0.0.63 → 0.0.65

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.
@@ -14,6 +14,7 @@ export * from './logstash-api.service';
14
14
  export * from './notification-api.service';
15
15
  export * from './role-api.service';
16
16
  export * from './share-api.service';
17
+ export * from './storage-comment-api.service';
17
18
  export * from './storage-element-api.service';
18
19
  export * from './storage-files-api.service';
19
20
  export * from './storage-instance-api.service';
@@ -0,0 +1,12 @@
1
+ import { Client } from '../classes';
2
+ import { ResponseItem, ResponseList } from '../types';
3
+ import { CommentParams, Comment, CreateCommentParams, UpdateCommentParams, DeleteCommentParams, DeleteAllCommentParams } from '../types/comment';
4
+ export declare class StorageCommentApiService {
5
+ private client;
6
+ constructor(client: Client);
7
+ list(params: CommentParams): Promise<ResponseList<Comment>>;
8
+ create(data: CreateCommentParams): Promise<ResponseItem<Comment>>;
9
+ update(data: UpdateCommentParams): Promise<ResponseItem<Comment>>;
10
+ delete(params: DeleteCommentParams): Promise<void>;
11
+ deleteAll(params: DeleteAllCommentParams): Promise<void>;
12
+ }
@@ -1,5 +1,5 @@
1
1
  import { Client } from '../classes';
2
- import { ResponseItem, ResponseList, StorageElementPaste, StorageRoot, RequestBaseParams, StorageElementType, StorageRouteData, SizeBySection } from '../types';
2
+ import { ResponseItem, ResponseList, StorageElementPaste, StorageRoot, RequestBaseParams, StorageElementType, StorageRouteData, SizeBySection, DivideResourceParams, ResourceAccess } from '../types';
3
3
  import { StorageElement } from '../types';
4
4
  import { FcaApiService } from './fca-api.service';
5
5
  export declare class StorageElementApiService {
@@ -27,6 +27,7 @@ export declare class StorageElementApiService {
27
27
  owner_id: number;
28
28
  with_trash: boolean;
29
29
  }): Promise<SizeBySection[] | null>;
30
+ getDivideResources(params: DivideResourceParams): Promise<ResponseList<ResourceAccess>>;
30
31
  }
31
32
  export interface RequestStorageListParams extends RequestBaseParams {
32
33
  search?: string;
@@ -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.ReadUserLogs="read_user_logs",n.ConnectionsRead="connections_read",n.ConnectionsDividing="connections_dividing",n.ConnectionsYandexDisk="connections_yandex_disk",n.ConnectionsSsh="connections_ssh",n.ConnectionsMail="connections_mail",n.ConnectionsS3="connections_s3",n.ConnectionsDiscord="connections_discord",n.ConnectionsWebdav="connections_webdav",n.ConnectionsNextcloud="connections_nextcloud",n.ConnectionsNextbox="connections_nextbox",n.ConnectionsHttpProxy="connections_http_proxy",n.SystemInfoServiceList="system_info_service_list",n.SettingsRead="settings_read",n.SettingsWrite="settings_write";const o=[exports.AccessRights.ConnectionsYandexDisk,exports.AccessRights.ConnectionsSsh,exports.AccessRights.ConnectionsMail,exports.AccessRights.ConnectionsS3,exports.AccessRights.ConnectionsS3,exports.AccessRights.ConnectionsDiscord,exports.AccessRights.ConnectionsWebdav,exports.AccessRights.ConnectionsNextcloud,exports.AccessRights.ConnectionsNextbox,exports.AccessRights.ConnectionsHttpProxy];var c,a,l,p,d,h,u,g,x,v,_,S,f,$,m,y,k,T,b,A,w,R,C,E,U,D,P,O,L,N,I,j,q,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.ConnectionGroup=void 0,(l=exports.ConnectionGroup||(exports.ConnectionGroup={})).Storages="storages_connections_group",l.Webhooks="webhooks_connections_group",l.Unknown="unknown_connections_group",l.Proxy="proxy_connections_group",exports.ConnectionType=void 0,(p=exports.ConnectionType||(exports.ConnectionType={})).SSH="ssh_connection",p.YandexDisk="yandex_disk",p.Mail="mail",p.Discord="discord",p.Webdav="webdav_connection",p.Nextcloud="nextcloud_connection",p.NextBox="nextbox_connection",p.HttpProxy="http_proxy_connection",p.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,(u=exports.DivideScope||(exports.DivideScope={})).Storage="/storage/element",u.Connection="/connections",exports.PermissionType=void 0,(g=exports.PermissionType||(exports.PermissionType={})).CLOSE="",g.READ="r",g.WRITE="rw",exports.RestrictionStatus=void 0,(x=exports.RestrictionStatus||(exports.RestrictionStatus={})).WAITING="waiting",x.APPROVED="approved",x.REJECTED="rejected",exports.RestrictionBooleanStatus=void 0,(v=exports.RestrictionBooleanStatus||(exports.RestrictionBooleanStatus={})).TRUE="true",v.FALSE="false",exports.DivideMode=void 0,(_=exports.DivideMode||(exports.DivideMode={})).User="to_user_id",_.Group="to_user_group_id",exports.RestrictionModeKey=void 0,(S=exports.RestrictionModeKey||(exports.RestrictionModeKey={})).Divide="divide",S.Share="share",exports.Tariff=void 0,(f=exports.Tariff||(exports.Tariff={})).Free="free",f.Business="business",f.Enterprise="enterprise",exports.LicenseError=void 0,($=exports.LicenseError||(exports.LicenseError={})).NotActivated="License not activated",$.Blocked="License blocked",$.Expired="License has been expired",$.NotValid="License not valid",$.NotFound="license file not found",exports.LimitationType=void 0,(m=exports.LimitationType||(exports.LimitationType={})).BySize="size",m.ByExt="extension",exports.LimitationSubType=void 0,(y=exports.LimitationSubType||(exports.LimitationSubType={})).Size="size",y.White="extension_white",y.Black="extension_black",exports.NotificationEntityType=void 0,(k=exports.NotificationEntityType||(exports.NotificationEntityType={})).Dir="dir",k.File="file",k.User="user",k.Other="other",k.WorkDir="work_dir",k.License="license",k.Extension="extension",k.Connection="connection",exports.NotificationAction=void 0,(T=exports.NotificationAction||(exports.NotificationAction={})).SecurityCheckNegative="action_security_check_negative",T.SecurityCheckPositive="action_security_check_positive",T.OpenSharing="open_sharing",T.ChangeSharing="change_sharing",T.CancelSharing="cancel_sharing",T.DivideDirAddFileToOwner="divide_dir_add_file_to_owner",T.DivideDirAddDirToOwner="divide_dir_add_dir_to_owner",T.DivideDirAddWorkDirToOwner="divide_dir_add_work_dir_to_owner",T.DivideConnectionAddFileToOwner="divide_connection_add_file_to_owner",T.DivideConnectionAddDirToOwner="divide_connection_add_dir_to_owner",T.CancelDivideDir="cancel_divide_dir",T.CancelDivideFile="cancel_divide_file",T.CancelDivideWorkDir="cancel_divide_work_dir",T.CancelDivideConnection="cancel_divide_connection",T.DeleteExtension="delete_extension",T.NewVersionExtension="new_version_extension",T.TransferData="transfer_data",T.AllowInternalAccessUser="allow_internal_access_to_user",T.BlockInternalAccessUser="block_internal_access_to_user",T.WaitInternalAccessUser="wait_internal_access_to_user",T.WaitInternalAccessUserCreate="wait_internal_access_to_user_create",T.AllowInternalAccessGroup="allow_internal_access_to_group",T.BlockInternalAccessGroup="block_internal_access_to_group",T.WaitInternalAccessGroup="wait_internal_access_to_group",T.WaitInternalAccessGroupCreate="wait_internal_access_to_group_create",T.AllowSharing="allow_sharing",T.BlockSharing="block_sharing",T.WaitSharing="wait_sharing",T.WaitSharingCreate="wait_sharing_create",T.Other="other",exports.NotificationRowAction=void 0,(b=exports.NotificationRowAction||(exports.NotificationRowAction={})).Read="read",b.Unread="unread",b.Delete="delete",exports.NotificationStyle=void 0,(A=exports.NotificationStyle||(exports.NotificationStyle={})).Plain="plain",A.Success="success",A.Info="info",A.Warning="warning",A.Error="error",exports.ResponseType=void 0,(w=exports.ResponseType||(exports.ResponseType={})).ArrayBuffer="arraybuffer",w.Blob="blob",w.Json="json",w.Text="text",exports.RequestMethod=void 0,(R=exports.RequestMethod||(exports.RequestMethod={})).GET="GET",R.POST="POST",R.PUT="PUT",R.PATCH="PATCH",R.DELETE="DELETE",exports.RequestObserve=void 0,(C=exports.RequestObserve||(exports.RequestObserve={})).Body="body",C.Response="response",exports.RestrictionSharing=void 0,(E=exports.RestrictionSharing||(exports.RestrictionSharing={})).NONE="none",E.SOFT="soft",E.HARD="hard",exports.UserAuthType=void 0,(U=exports.UserAuthType||(exports.UserAuthType={})).Native="native",U.Ldap="ldap",U.Vk="vk",exports.UserStatus=void 0,(D=exports.UserStatus||(exports.UserStatus={})).Registering="registering",D.Activated="activated",D.Blocked="blocked",D.BlockedByLicense="blocked_by_license",exports.UserType=void 0,(P=exports.UserType||(exports.UserType={})).User="user",P.Guest="guest",P.Emperor="emperor",P.Anonymous="anonymous",exports.UserParamsLabel=void 0,(O=exports.UserParamsLabel||(exports.UserParamsLabel={})).Theme="theme",O.Lang="lang",O.Sort="sort",exports.SettingControlType=void 0,(L=exports.SettingControlType||(exports.SettingControlType={})).Text="text",L.String="string",L.Number="number",L.CheckBox="checkbox",L.Select="select",L.RadioList="radio_list",L.ConnectionChoose="connection_choose",L.MultiConnectionChoose="multi_connection_choose",exports.StorageElementType=void 0,(N=exports.StorageElementType||(exports.StorageElementType={})).Dir="dir",N.File="file",N.WorkDir="work_dir",exports.StorageElementContentType=void 0,(I=exports.StorageElementContentType||(exports.StorageElementContentType={})).Any="any",I.Dir="dir",I.Code="code",I.Image="image",I.Audio="audio",I.Video="video",I.Text="text",I.Doc="doc",I.Xls="xls",I.Ppt="ppt",exports.StorageRoot=void 0,(j=exports.StorageRoot||(exports.StorageRoot={})).my="my",j.fca="fca",j.divide="divide",j.share="share",j.favorite="favorite",j.trash="trash",exports.StorageElementHistoryAction=void 0,(q=exports.StorageElementHistoryAction||(exports.StorageElementHistoryAction={})).Create="create",q.Update="update",q.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",H=`${B}/dashboard`;class F{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(H,e)}}class W{constructor(e){this.client=e}discovery(e){return this.client.rest.get("/discovery",e)}}const G="/divide",V=`${G}/restrictions`;class z{constructor(e){this.client=e}divideDelete(e,t){return this.client.rest.delete(`${e}/${G}/${t}`)}divideDeleteAll(e,t,s,r){return this.client.rest.delete(`${e}/${G}`,Object.assign(Object.assign({},this.makeParam(e,t)),{is_to_user_group:r,access_mode:s}))}divideChange(e,t,s){return this.client.rest.put(`${e}/divide/${t}`,{access_mode:s})}divideCreate(e,t,s,r,i){const n=Object.assign(Object.assign({},this.makeParam(e,t)),{[i]:s,access_mode:r});return this.client.rest.post(`${e}/${G}`,n)}divideUsers(e,t,s){return this.client.rest.get(`${e}/${G}/users`,Object.assign(Object.assign({},this.makeParam(e,t)),s))}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}}function J(e,t,s,r){return new(s||(s=Promise))((function(i,n){function o(e){try{a(r.next(e))}catch(e){n(e)}}function c(e){try{a(r.throw(e))}catch(e){n(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,c)}a((r=r.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class K extends Error{}function Q(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 X(e,t){if("string"!=typeof e)throw new K("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 K(`Invalid token specified: missing part #${s+1}`);let i;try{i=Q(r)}catch(e){throw new K(`Invalid token specified: invalid base64 for part #${s+1} (${e.message})`)}try{return JSON.parse(i)}catch(e){throw new K(`Invalid token specified: invalid json for part #${s+1} (${e.message})`)}}K.prototype.name="InvalidTokenError";const Y=(e,t)=>J(void 0,void 0,void 0,(function*(){let s=t;for(const t of e)try{s=yield t.fulfilled(s)}catch(e){if(!t.rejected)throw e;s=yield t.rejected(e)}return s}));function Z(e){var t;return null!==(t=Object.fromEntries(document.cookie.split(";").map((e=>e.split("="))).map((([e,t])=>[e.trim(),decodeURIComponent(t||"")])))[e])&&void 0!==t?t:null}const ee=e=>{const t=new URLSearchParams;return Object.keys(e).forEach((s=>{Array.isArray(e[s])?e[s].forEach((e=>{t.append(s,e)})):t.append(s,e[s])})),t};function te(e){return e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):e}function se(e){return e?e instanceof FormData||e instanceof Blob||e instanceof ArrayBuffer||e instanceof URLSearchParams||e instanceof Document||ArrayBuffer.isView(e)?e:"object"==typeof e?JSON.stringify(e):"string"==typeof e?e:null:null}const re="update black token";class ie{constructor(){this.isUpdating=!1,this.tokenUpdateResolve=null}isTokenExpire(e){if(!e)return!1;return 1e3*e<=(new Date).getTime()+3e3}refreshToken(e,t){return J(this,void 0,void 0,(function*(){const{access_token:s,refresh_token:r}=e;return s&&r?this.isUpdating?this.waitForTokenUpdate():(this.isUpdating=!0,new Promise(((e,i)=>{const n=new XMLHttpRequest,o=`${t}${ne}/login/update`;n.open("POST",o,!0),n.setRequestHeader("Content-Type","application/json"),n.send(JSON.stringify({access_token:s,refresh_token:r})),n.onload=()=>{if(n.status>=200&&n.status<300)try{const t=JSON.parse(n.responseText);if(t&&t.access_token&&t.refresh_token){const s={access_token:t.access_token,refresh_token:t.refresh_token};Z("access_token")===s.access_token&&localStorage.setItem("refresh-token",s.refresh_token),this.tokenUpdateResolve&&(this.tokenUpdateResolve(s),this.tokenUpdateResolve=null),e(s)}else e(null)}catch(e){i(new Error("Failed to parse response JSON."))}else e(null)},n.onerror=()=>{i(new Error("Network error occurred"))},n.onloadend=()=>{this.isUpdating=!1}}))):null}))}waitForTokenUpdate(){return J(this,void 0,void 0,(function*(){return new Promise((e=>{const t=setInterval((()=>{this.isUpdating||(clearInterval(t),e())}),100)}))}))}}const ne="/api/v1",oe="/api/v2";class ce{constructor(e,t){this.client=e,this.tokenUpdate=t,this.baseHost=""}get state(){return this.client.state}get(e,t,s){return this.request(exports.RequestMethod.GET,e,Object.assign({params:t,cache:"no-cache"},s))}post(e,t,s){return this.request(exports.RequestMethod.POST,e,Object.assign({body:t},s))}put(e,t,s){return this.request(exports.RequestMethod.PUT,e,Object.assign({body:t,cache:"no-cache"},s))}patch(e,t,s){return this.request(exports.RequestMethod.PATCH,e,Object.assign({body:t},s))}delete(e,t,s){return this.request(exports.RequestMethod.DELETE,e,Object.assign({params:t},s))}upload(e,t,s){const r=new AbortController,i=r.signal;return{promise:this.request(exports.RequestMethod.POST,e,Object.assign({body:t,signal:i},s)),abort:()=>r.abort()}}request(e,t,s){return J(this,void 0,void 0,(function*(){return new Promise(((r,i)=>J(this,void 0,void 0,(function*(){var n;const o=null!==(n=this.state.skipInterceptors)&&void 0!==n&&n;this.state.skipInterceptors=!1;let c=Object.assign({method:e},s);if((null==s?void 0:s.signal)&&(c.signal=s.signal),o||(s=yield Y(this.client.requestInterceptors,c)),this.state.authToken)for(const[e,r]of this.state.authToken.entries()){const i=X(r.access_token);if(i&&i.is_remember&&this.tokenUpdate.isTokenExpire(i.exp)&&!t.includes("/login")&&!t.includes("/assets")){const t=yield this.tokenUpdate.refreshToken(r,this.baseHost);t&&(this.state.authToken.set(e,t),s=yield Y(this.client.requestInterceptors,c))}}const a=new XMLHttpRequest;(null==s?void 0:s.params)&&0!==Object.keys(s.params).length&&(t+="?"+ee(s.params));const l=`${this.state.clientParams.host}${this.state.clientParams.version}${t}`;if(a.open(e,l,!0),null==s?void 0:s.headers){const e=te(s.headers);for(const[t,s]of Object.entries(e))(this.state.clientParams.host===this.baseHost||"content-type"!==t.toLowerCase())&&a.setRequestHeader(t,s)}(null==s?void 0:s.responseType)&&(a.responseType=s.responseType),(null==s?void 0:s.signal)&&s.signal.addEventListener("abort",(()=>{a.abort(),i(new Error("Upload aborted"))})),a.upload&&[exports.RequestMethod.POST,exports.RequestMethod.PUT,exports.RequestMethod.PATCH].includes(e)&&(a.upload.onprogress=e=>{e.lengthComputable&&(null==s?void 0:s.onUploadProgress)&&s.onUploadProgress(e)}),a.onload=()=>J(this,void 0,void 0,(function*(){if((null==s?void 0:s.signal)&&s.signal.aborted)return;let e;switch(null==s?void 0:s.responseType){case exports.ResponseType.Text:e=a.responseText;break;case exports.ResponseType.Blob:case exports.ResponseType.ArrayBuffer:e=a.response;break;default:try{e=JSON.parse(a.responseText)}catch(t){e=a.responseText}}const t=new Headers;a.getAllResponseHeaders().split("\r\n").forEach((e=>{const[s,r]=e.split(": ");s&&r&&t.append(s,r)}));let n={status:a.status,statusText:a.statusText,headers:t,url:a.responseURL};if(a.status>=200&&a.status<300)(null==s?void 0:s.observe)===exports.RequestObserve.Response?r(Object.assign(Object.assign({},n),{body:e})):r(e);else{if(this.state.authToken&&e.code===re){const e=yield this.tokenUpdate.refreshToken(this.state.authToken.get(0),this.baseHost);e&&this.state.authToken.set(0,e)}s=yield Y(this.client.responseInterceptors,Object.assign(Object.assign({},n),{error:e})),i(Object.assign(Object.assign({},n),{error:e}))}n=yield Y(this.client.responseInterceptors,n)})),a.onerror=()=>{i({status:a.status,statusText:a.statusText,url:a.responseURL,error:"Network error"})},a.send(se(null==s?void 0:s.body))}))))}))}changeBaseUrlVersion(e,t){return J(this,void 0,void 0,(function*(){const s=this.state.clientParams.version;this.state.clientParams.version=e;try{return yield t()}finally{this.state.clientParams.version=s}}))}changeHost(e,t){return J(this,void 0,void 0,(function*(){this.state.clientParams.host=e,this.state.requestParams.headers={};try{return yield t()}finally{this.state.clientParams.host=this.baseHost}}))}}const ae="/static/extensions",le="/extensions/defaults",pe=`${ae}/names/users`,de=`${ae}/names/system`;class he{constructor(e){this.client=e}getSetting(e){return this.client.rest.get(`${ae}/${e}/settings`)}setSetting(e,t){return this.client.rest.post(`${ae}/${e}/settings`,t)}deleteSetting(e){return this.client.rest.delete(`${ae}/${e}/settings`)}get(e){return this.client.rest.get(`${ae}/${e}`)}getByKey(e){return this.client.rest.get(`${ae}/${e}`)}getDefault(e=[]){return this.client.rest.get(le,{ext_code:e})}setDefault(e,t){return this.client.rest.post(le,{ext_code:e,ext_uniq_key:t})}checkUpdates(){return this.client.rest.post(`${ae}/check_updates`)}updateVersion(e,t){return this.client.rest.put(`${ae}/${e}`,{version:t})}list(e){return this.client.rest.get(ae,e)}delete(e,t){return this.client.rest.delete(`${ae}/${e}`)}upload(e,t){const s=new FormData;s.set("file",t);const{promise:r,abort:i}=this.client.rest.upload(ae,s,{onUploadProgress:t=>{e(t)}});return{promise:this.client.rest.changeBaseUrlVersion(oe,(()=>r)),abort:i}}install(e,t){return this.client.rest.changeBaseUrlVersion(oe,(()=>this.client.rest.post(`${ae}/site`,{uniq_key:e,version:t})))}getSystemNameExts(e){return this.client.rest.get(de,e)}getUserNameExts(e){return this.client.rest.get(pe,e)}createUserNameExt(e){return this.client.rest.post(`${pe}`,{name:e})}deleteUserNameExt(e){return this.client.rest.delete(`${pe}/${e}`)}deleteAllUserNameExts(){return this.client.rest.delete(`${pe}`)}}const ue="/anons_ext/extensions";class ge{constructor(e){this.client=e}listExtensionsSite(e){return this.client.rest.changeHost("https://next-box.ru",(()=>this.client.rest.get(ue,e)))}extensionDetailSite(e){return this.client.rest.changeHost("https://next-box.ru",(()=>this.client.rest.get(`${ue}/${e}`)))}extensionMarkdown(e,t){return this.client.rest.changeHost("https://next-box.ru",(()=>this.client.rest.get(`${ue}/${e}/readme`,{},t)))}}const xe="/disk",ve=`${xe}/check`;class _e{constructor(e){this.client=e}info(e,t){return this.client.rest.get(`${xe}/${e}/element`,{path:t})}list(e,t){return this.client.rest.get(`${xe}/${e}`,t)}create(e,t){return this.client.rest.post(`${xe}/${e}/element`,t)}replace(e,t,s){return this.client.rest.put(`${xe}/${e}/files?path=${t}`,s)}read(e,t){return this.client.rest.get(`${xe}/${e}/files?path=${t}`)}upload(e,t,s,r=""){const i=new FormData;i.set("path",r),i.set("file",s);const{promise:n,abort:o}=this.client.rest.upload(`${xe}/${t}/files`,i,{onUploadProgress:t=>{e(t)}});return{promise:n,abort:o}}uploadNet(e,t){return this.client.rest.post(`${xe}/${e}/files/net`,t)}delete(e,t){return this.client.rest.delete(`${xe}/${e}/trash/element`,{path:t})}check(e){return this.client.rest.post(ve,e)}}const Se="/settings";class fe{constructor(e){this.client=e}settings(){return this.client.rest.get(Se)}changeSettings(e){return this.client.rest.post(Se,e)}queryInit(){return this.client.rest.get("/query/init")}}var $e;exports.QueryInitViewType=void 0,($e=exports.QueryInitViewType||(exports.QueryInitViewType={})).Standard="Standard",$e.Simple="Simple";const me="/groups";class ye{constructor(e){this.client=e}list(e){return this.client.rest.get(me,e)}listUsers(e){return this.client.rest.get(`${me}/${e}/users`)}create(e){return this.client.rest.post(me,e)}update(e,t){return this.client.rest.put(`${me}/${e}`,t)}delete(e){return this.client.rest.delete(`${me}/${e}`)}}const ke="/license",Te=`${ke}/manual-check`,be=`${ke}/hardware/hash`;class Ae{constructor(e){this.client=e}info(){return this.client.rest.get(ke)}create(e){return this.client.rest.post(ke,e)}check(){return this.client.rest.post(Te)}delete(){return this.client.rest.delete(ke)}getHash(){return this.client.rest.get(be)}}const we="/links";class Re{constructor(e){this.client=e}createShortLink(e){return this.client.rest.post(we,e)}updateShortLink(e){return this.client.rest.put(we,e)}}const Ce="/limitations";class Ee{constructor(e){this.client=e}list(e){return this.client.rest.get(Ce,e)}listUsers(e,t){return this.client.rest.get(`${Ce}/${e}/users`,t)}create(e){return this.client.rest.post(Ce,e)}get(e){return this.client.rest.get(`${Ce}/${e}`)}update(e,t){return this.client.rest.put(`${Ce}/${e}`,t)}delete(e){return this.client.rest.delete(`${Ce}/${e}`)}getLimitationsByUser(e){return this.client.rest.get(`/limitations/user/${e}`)}addUserToLimitation(e,t){return this.client.rest.patch(`${Ce}/${e}/user`,{id:t})}deleteUserFromLimitation(e,t){return this.client.rest.delete(`${Ce}/${e}/user/${t}`)}}class Ue{constructor(e){this.client=e}getUsersLogs(e){return this.client.rest.get("/logs/users",e)}}const De="/notifications",Pe=`${De}/all`,Oe=`${De}/subscription`,Le=`${De}/permission`;class Ne{constructor(e){this.client=e}list(e){return this.client.rest.get(De,e)}toggleStatus(e,t){return this.client.rest.put(De,{ids:e,to_status:t})}toggleAllStatus(e){return this.client.rest.put(Pe,{to_status:e})}delete(e){return this.client.rest.delete(De,{id:e})}deleteAll(){return this.client.rest.delete(Pe)}getPermission(){return this.client.rest.get(Le)}setPermission(e){return this.client.rest.post(Le,{enabled:e})}getSubscription(){return this.client.rest.get(Oe)}setSubscription(e){const t={action_groups:Object.assign({},e)};return this.client.rest.post(Oe,t)}}const Ie="/roles",je=`${Ie}/default`,qe="/permissions";class Me{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(`${je}`)}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(qe)}addPermission(e,t){return this.client.rest.put(`${Ie}/${e}/permissions`,{ids:t})}deletePermission(e,t){return this.client.rest.delete(`${Ie}/${e}/${qe}`,{ids:t})}}const Be="/share",He=`${Be}/restrictions`;class Fe{constructor(e){this.client=e}info(e,t){const s=new URLSearchParams({path:e,share_token:t});return this.client.rest.get(`${Be}?${s.toString()}`)}checkPassword(e,t){const s=encodeURIComponent(e);return this.client.rest.get(`${Be}/password?share_token=${t}&share_pass=${s}`)}checkToken(e){return this.client.rest.get(`${Be}?share_token=${e}`)}getRestriction(e){return this.client.rest.get(`${He}/${e}`)}restrictions(e){return this.client.rest.get(He,e)}restrictionsChange(e,t){return this.client.rest.put(`${He}/${e}`,t)}}const We="/storage",Ge=`${We}/element`,Ve=`${Ge}/move`,ze=`${Ge}/copy`,Je=`${Ge}/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){var t;return parseInt((null===(t=e.divide_id)||void 0===t?void 0:t.toString())||"")||delete e.divide_id,e.file_version_id||delete e.file_version_id,this.client.rest.get(Ge,e)}combineInfo({root:e,rootId:t,path:s,file_version_id:r}){return e===exports.StorageRoot.fca&&t?this.fcaApiService.info(t,s):this.info({path:s,divide_id:t,file_version_id:r})}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=Object.assign(Object.assign({},e),{from_divide_id:null,to_divide_id:null});return t===exports.StorageRoot.fca&&s===exports.StorageRoot.fca?this.client.rest.post(`${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=Object.assign(Object.assign({},e),{from_divide_id:null,to_divide_id:null});return s===exports.StorageRoot.fca&&t===exports.StorageRoot.fca?this.client.rest.post(`${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(`${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(Je,e)}}const Xe="/storage/files",Ye=`${Xe}/net`;class Ze{constructor(e){this.client=e}read(e,t){return t.path=e,this.client.rest.get(Xe,t)}replace(e,t){const s=new URLSearchParams;return Object.keys(e).forEach((t=>{e[t]&&s.append(t,e[t])})),this.client.rest.put(`${Xe}?${s.toString()}`,t)}upload(e,t,s,r){const i=new FormData;i.set("path",s),r&&i.set("divide_id",r.toString()),i.set("file",t);const{promise:n,abort:o}=this.client.rest.upload(Xe,i,{onUploadProgress:t=>{e(t)}});return{promise:n,abort:o}}uploadNet(e){return this.client.rest.post(Ye,e)}}class et{constructor(e){this.client=e}instance(){return this.client.rest.get("/storage/instance")}}const tt="/storage/element/share";class st{constructor(e){this.client=e}info(e){return this.client.rest.get(tt,{path:e})}create(e,t){const s={path:e,permissions_type:t};return this.client.rest.post(tt,s)}change(e){return this.client.rest.put(`${tt}/${e.token}`,e)}delete(e){return this.client.rest.delete(tt,{path:e})}refresh(e){return this.client.rest.put(`${tt}/${e}/refresh`)}}const rt="/storage/trash/element",it=`${rt}/all`;class nt{constructor(e){this.client=e}clear(e){return this.client.rest.delete(rt,e)}clearAll(){return this.client.rest.delete(it)}restore(e){return this.client.rest.patch(rt,{del_groups:e})}restoreAll(){return this.client.rest.patch(it)}}const ot="/users",ct=`${ot}/me`,at=`${ct}/avatars`,lt=`${ct}/sessions`,pt=`${ct}/tokens`,dt=`${ct}/params`,ht=`${ct}/change-password`,ut=`${ot}/initial`,gt=`${ct}/phone`,xt=`${gt}/confirm`;class vt{constructor(e){this.client=e}initial(e){return this.client.rest.post(ut,e)}list(e){return this.client.rest.get(ot,e)}get(e){return this.client.rest.get(ot+`/${e}`)}create(e){return this.client.rest.post(ot,e)}update(e,t){return this.client.rest.put(ot+`/${e}`,t)}delete(e,t){return this.client.rest.delete(`${ot}/${e}`,t)}restore(e){return this.client.rest.post(`${ot}/${e}/restore`)}me(){return this.client.rest.get(ct)}updateMe(e){return this.client.rest.put(ct,e)}createToken(e){return this.client.rest.post(pt,e)}listToken(e){return this.client.rest.get(pt,e)}deleteToken(e){return this.client.rest.delete(`${pt}/${e}`)}changeMyPassword(e){return this.client.rest.put(ht,e)}changeUsersPassword(e,t){return this.client.rest.put(`${ot}/${e}/change-password`,t)}meUploadAvatar(e,t){const s=new FormData;return s.append("file",e,t),this.client.rest.post(at,s)}meDeleteAvatar(){return this.client.rest.delete(at)}meListSession(e){return this.client.rest.get(lt,e)}meDeleteSession(e){let t=lt;return e&&(t+=`/${e}`),this.client.rest.delete(t)}setRole(e,t=null){return this.client.rest.put(`${ot}/${e}/roles`,{role_id:t})}meParams(e){return this.client.rest.get(dt,{name:e})}meSetParams(e,t){return this.client.rest.post(`${dt}/${e}`,t)}meListParams(){return this.client.rest.get(dt)}phone(e){return this.client.rest.post(gt,e)}phoneConfirm(e){return this.client.rest.post(`${xt}/${e}`)}}const _t="/storage/element",St=`${_t}/history`,ft=`${_t}/version`,$t=`${ft}/lock`,mt=`${ft}/unlock`,yt=`${ft}/current`,kt=`${ft}/size`;class Tt{constructor(e){this.client=e}history(e){return this.client.rest.get(St,e)}versions(e){return this.client.rest.get(ft,e)}create(e){return this.client.rest.post(ft,e)}edit(e){return this.client.rest.put(ft,e)}delete(e){return this.client.rest.delete(ft,e)}size(e){return this.client.rest.get(kt,e)}makeCurrent(e){return this.client.rest.post(yt,e)}lock(e){return this.client.rest.post($t,e)}unlock(e){return this.client.rest.post(mt,e)}}exports.AuthApiService=i,exports.BASE_URL_V1=ne,exports.BASE_URL_V2=oe,exports.CONNECTIONS_PERMISSION=o,exports.Client=class{constructor(e){this.AuthApiService=new i(this),this.ConnectionsApiService=new F(this),this.DiscoveryApiService=new W(this),this.DivideApiService=new z(this),this.ExtensionsApiService=new he(this),this.ExtensionsExternalApiService=new ge(this),this.FcaApiService=new _e(this),this.GatewayApiService=new fe(this),this.GroupApiService=new ye(this),this.LicenseApiService=new Ae(this),this.LinksApiService=new Re(this),this.LimitationsApiService=new Ee(this),this.LogstashApiService=new Ue(this),this.NotificationApiService=new Ne(this),this.RoleApiService=new Me(this),this.ShareApiService=new Fe(this),this.StorageElementApiService=new Qe(this,this.FcaApiService),this.StorageFilesApiService=new Ze(this),this.StorageInstanceApiService=new et(this),this.StorageShareApiService=new st(this),this.StorageTrashApiService=new nt(this),this.UserApiService=new vt(this),this.VersionApiService=new Tt(this),this.tokenUpdate=new ie,this.rest=new ce(this,this.tokenUpdate),this.requestInterceptors=[],this.responseInterceptors=[],this.request={use:(e,t)=>{this.requestInterceptors.push({fulfilled:e,rejected:t})}},this.response={use:(e,t)=>{this.responseInterceptors.push({fulfilled:e,rejected:t})}},this.state={clientParams:{host:null==e?void 0:e.host,version:(null==e?void 0:e.version)||ne},requestParams:{path:"",headers:{},query:{},body:null,cache:"no-cache"},authToken:null,skipInterceptors:!1},this.rest.baseHost=this.state.clientParams.host||""}},exports.ConnectionsApiService=F,exports.DiscoveryApiService=W,exports.DivideApiService=z,exports.ExtensionsApiService=he,exports.ExtensionsExternalApiService=ge,exports.FcaApiService=_e,exports.GatewayApiService=fe,exports.GroupApiService=ye,exports.LicenseApiService=Ae,exports.LimitationsApiService=Ee,exports.LinksApiService=Re,exports.LogstashApiService=Ue,exports.NEED_TOKEN_UPDATE_ERROR=re,exports.NotificationApiService=Ne,exports.Rest=ce,exports.RoleApiService=Me,exports.ShareApiService=Fe,exports.StorageElementApiService=Qe,exports.StorageFilesApiService=Ze,exports.StorageInstanceApiService=et,exports.StorageShareApiService=st,exports.StorageTrashApiService=nt,exports.TokenUpdate=ie,exports.UserApiService=vt,exports.VersionApiService=Tt,exports.applyInterceptors=Y,exports.getCookieValue=Z,exports.makeUrlParams=ee,exports.normalizeHeaders=te,exports.prepareRequestBody=se;
1
+ "use strict";const e="/login",t=`${e}/ldap`,s=`${e}/update`,r=`${e}/tfa`;class i{constructor(e){this.client=e}info(){return this.client.rest.get(e)}login(t){return this.client.rest.post(e,t)}ldapLogin(e){return this.client.rest.post(t,e)}loginTfa(e){return this.client.rest.post(r,e)}updateToken(e){const t=e.path?`${e.path}/${s}`:s;return e.path&&delete e.path,this.client.rest.post(t,e)}logout(){return this.client.rest.post("/logout")}}var n;exports.AccessRights=void 0,(n=exports.AccessRights||(exports.AccessRights={})).LicenseRead="license_read",n.LicenseManage="license_edit",n.UsersRead="users_read",n.UsersCreate="users_create",n.UsersActivate="users_activate",n.GroupsRead="groups_read",n.GroupsCreate="groups_create",n.RolesRead="roles_read",n.RolesCreate="roles_create",n.Share="share",n.Divide="divide",n.ExtensionsRead="extensions_read",n.ExtensionsManage="extensions_write",n.RestrictionShareRead="restriction_share_read",n.RestrictionShareWrite="restriction_share_write",n.RestrictionDivideRead="restriction_divide_read",n.RestrictionDivideWrite="restriction_divide_write",n.ReadUserLogs="read_user_logs",n.ConnectionsRead="connections_read",n.ConnectionsDividing="connections_dividing",n.ConnectionsYandexDisk="connections_yandex_disk",n.ConnectionsSsh="connections_ssh",n.ConnectionsMail="connections_mail",n.ConnectionsS3="connections_s3",n.ConnectionsDiscord="connections_discord",n.ConnectionsWebdav="connections_webdav",n.ConnectionsNextcloud="connections_nextcloud",n.ConnectionsNextbox="connections_nextbox",n.ConnectionsHttpProxy="connections_http_proxy",n.SystemInfoServiceList="system_info_service_list",n.SettingsRead="settings_read",n.SettingsWrite="settings_write";const o=[exports.AccessRights.ConnectionsYandexDisk,exports.AccessRights.ConnectionsSsh,exports.AccessRights.ConnectionsMail,exports.AccessRights.ConnectionsS3,exports.AccessRights.ConnectionsS3,exports.AccessRights.ConnectionsDiscord,exports.AccessRights.ConnectionsWebdav,exports.AccessRights.ConnectionsNextcloud,exports.AccessRights.ConnectionsNextbox,exports.AccessRights.ConnectionsHttpProxy];var c,a,l,p,d,h,u,g,x,v,_,S,$,m,f,y,k,A,T,b,w,R,C,E,U,D,P,O,L,N,I,j,q,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.ConnectionGroup=void 0,(l=exports.ConnectionGroup||(exports.ConnectionGroup={})).Storages="storages_connections_group",l.Webhooks="webhooks_connections_group",l.Unknown="unknown_connections_group",l.Proxy="proxy_connections_group",exports.ConnectionType=void 0,(p=exports.ConnectionType||(exports.ConnectionType={})).SSH="ssh_connection",p.YandexDisk="yandex_disk",p.Mail="mail",p.Discord="discord",p.Webdav="webdav_connection",p.Nextcloud="nextcloud_connection",p.NextBox="nextbox_connection",p.HttpProxy="http_proxy_connection",p.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,(u=exports.DivideScope||(exports.DivideScope={})).Storage="/storage/element",u.Connection="/connections",exports.PermissionType=void 0,(g=exports.PermissionType||(exports.PermissionType={})).CLOSE="",g.READ="r",g.WRITE="rw",exports.RestrictionStatus=void 0,(x=exports.RestrictionStatus||(exports.RestrictionStatus={})).WAITING="waiting",x.APPROVED="approved",x.REJECTED="rejected",exports.RestrictionBooleanStatus=void 0,(v=exports.RestrictionBooleanStatus||(exports.RestrictionBooleanStatus={})).TRUE="true",v.FALSE="false",exports.DivideMode=void 0,(_=exports.DivideMode||(exports.DivideMode={})).User="to_user_id",_.Group="to_user_group_id",exports.RestrictionModeKey=void 0,(S=exports.RestrictionModeKey||(exports.RestrictionModeKey={})).Divide="divide",S.Share="share",exports.Tariff=void 0,($=exports.Tariff||(exports.Tariff={})).Free="free",$.Business="business",$.Enterprise="enterprise",exports.LicenseError=void 0,(m=exports.LicenseError||(exports.LicenseError={})).NotActivated="License not activated",m.Blocked="License blocked",m.Expired="License has been expired",m.NotValid="License not valid",m.NotFound="license file not found",exports.LimitationType=void 0,(f=exports.LimitationType||(exports.LimitationType={})).BySize="size",f.ByExt="extension",exports.LimitationSubType=void 0,(y=exports.LimitationSubType||(exports.LimitationSubType={})).Size="size",y.White="extension_white",y.Black="extension_black",exports.NotificationEntityType=void 0,(k=exports.NotificationEntityType||(exports.NotificationEntityType={})).Dir="dir",k.File="file",k.User="user",k.Other="other",k.WorkDir="work_dir",k.License="license",k.Extension="extension",k.Connection="connection",exports.NotificationAction=void 0,(A=exports.NotificationAction||(exports.NotificationAction={})).SecurityCheckNegative="action_security_check_negative",A.SecurityCheckPositive="action_security_check_positive",A.CommentVersionMention="action_version_comment_mention",A.OpenSharing="open_sharing",A.ChangeSharing="change_sharing",A.CancelSharing="cancel_sharing",A.DivideDirAddFileToOwner="divide_dir_add_file_to_owner",A.DivideDirAddDirToOwner="divide_dir_add_dir_to_owner",A.DivideDirAddWorkDirToOwner="divide_dir_add_work_dir_to_owner",A.DivideConnectionAddFileToOwner="divide_connection_add_file_to_owner",A.DivideConnectionAddDirToOwner="divide_connection_add_dir_to_owner",A.CancelDivideDir="cancel_divide_dir",A.CancelDivideFile="cancel_divide_file",A.CancelDivideWorkDir="cancel_divide_work_dir",A.CancelDivideConnection="cancel_divide_connection",A.DeleteExtension="delete_extension",A.NewVersionExtension="new_version_extension",A.TransferData="transfer_data",A.AllowInternalAccessUser="allow_internal_access_to_user",A.BlockInternalAccessUser="block_internal_access_to_user",A.WaitInternalAccessUser="wait_internal_access_to_user",A.WaitInternalAccessUserCreate="wait_internal_access_to_user_create",A.AllowInternalAccessGroup="allow_internal_access_to_group",A.BlockInternalAccessGroup="block_internal_access_to_group",A.WaitInternalAccessGroup="wait_internal_access_to_group",A.WaitInternalAccessGroupCreate="wait_internal_access_to_group_create",A.AllowSharing="allow_sharing",A.BlockSharing="block_sharing",A.WaitSharing="wait_sharing",A.WaitSharingCreate="wait_sharing_create",A.Other="other",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,(w=exports.ResponseType||(exports.ResponseType={})).ArrayBuffer="arraybuffer",w.Blob="blob",w.Json="json",w.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",exports.RequestObserve=void 0,(C=exports.RequestObserve||(exports.RequestObserve={})).Body="body",C.Response="response",exports.RestrictionSharing=void 0,(E=exports.RestrictionSharing||(exports.RestrictionSharing={})).NONE="none",E.SOFT="soft",E.HARD="hard",exports.UserAuthType=void 0,(U=exports.UserAuthType||(exports.UserAuthType={})).Native="native",U.Ldap="ldap",U.Vk="vk",exports.UserStatus=void 0,(D=exports.UserStatus||(exports.UserStatus={})).Registering="registering",D.Activated="activated",D.Blocked="blocked",D.BlockedByLicense="blocked_by_license",exports.UserType=void 0,(P=exports.UserType||(exports.UserType={})).User="user",P.Guest="guest",P.Emperor="emperor",P.Anonymous="anonymous",exports.UserParamsLabel=void 0,(O=exports.UserParamsLabel||(exports.UserParamsLabel={})).Theme="theme",O.Lang="lang",O.Sort="sort",O.ViewApps="viewApps",exports.SettingControlType=void 0,(L=exports.SettingControlType||(exports.SettingControlType={})).Text="text",L.String="string",L.Number="number",L.CheckBox="checkbox",L.Select="select",L.RadioList="radio_list",L.ConnectionChoose="connection_choose",L.MultiConnectionChoose="multi_connection_choose",exports.StorageElementType=void 0,(N=exports.StorageElementType||(exports.StorageElementType={})).Dir="dir",N.File="file",N.WorkDir="work_dir",exports.StorageElementContentType=void 0,(I=exports.StorageElementContentType||(exports.StorageElementContentType={})).Any="any",I.Dir="dir",I.Code="code",I.Image="image",I.Audio="audio",I.Video="video",I.Text="text",I.Doc="doc",I.Xls="xls",I.Ppt="ppt",exports.StorageRoot=void 0,(j=exports.StorageRoot||(exports.StorageRoot={})).my="my",j.fca="fca",j.divide="divide",j.share="share",j.favorite="favorite",j.trash="trash",exports.StorageElementHistoryAction=void 0,(q=exports.StorageElementHistoryAction||(exports.StorageElementHistoryAction={})).Create="create",q.Update="update",q.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",H=`${B}/dashboard`;class F{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(H,e)}}class W{constructor(e){this.client=e}discovery(e){return this.client.rest.get("/discovery",e)}}const V="/divide",G=`${V}/restrictions`;class z{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}`,Object.assign(Object.assign({},this.makeParam(e,t)),{is_to_user_group:r,access_mode:s}))}divideChange(e,t,s){return this.client.rest.put(`${e}/divide/${t}`,{access_mode:s})}divideCreate(e,t,s,r,i){const n=Object.assign(Object.assign({},this.makeParam(e,t)),{[i]:s,access_mode:r});return this.client.rest.post(`${e}/${V}`,n)}divideUsers(e,t,s){return this.client.rest.get(`${e}/${V}/users`,Object.assign(Object.assign({},this.makeParam(e,t)),s))}getRestriction(e){return this.client.rest.get(`${G}/${e}`)}restrictionSize(e,t){return this.client.rest.get(`/${t}/restrictions/${e}/size`)}restrictions(e){return this.client.rest.get(`${G}`,e)}restrictionsChange(e,t){return this.client.rest.put(`${G}/${e}`,t)}makeParam(e,t){const s={};return e===exports.DivideScope.Connection?s.connection_id=t:s.path=t,s}}function J(e,t,s,r){return new(s||(s=Promise))((function(i,n){function o(e){try{a(r.next(e))}catch(e){n(e)}}function c(e){try{a(r.throw(e))}catch(e){n(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,c)}a((r=r.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class K extends Error{}function Q(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 X(e,t){if("string"!=typeof e)throw new K("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 K(`Invalid token specified: missing part #${s+1}`);let i;try{i=Q(r)}catch(e){throw new K(`Invalid token specified: invalid base64 for part #${s+1} (${e.message})`)}try{return JSON.parse(i)}catch(e){throw new K(`Invalid token specified: invalid json for part #${s+1} (${e.message})`)}}K.prototype.name="InvalidTokenError";const Y=(e,t)=>J(void 0,void 0,void 0,(function*(){let s=t;for(const t of e)try{s=yield t.fulfilled(s)}catch(e){if(!t.rejected)throw e;s=yield t.rejected(e)}return s}));function Z(e){var t;return null!==(t=Object.fromEntries(document.cookie.split(";").map((e=>e.split("="))).map((([e,t])=>[e.trim(),decodeURIComponent(t||"")])))[e])&&void 0!==t?t:null}const ee=e=>{const t=new URLSearchParams;return Object.keys(e).forEach((s=>{Array.isArray(e[s])?e[s].forEach((e=>{t.append(s,e)})):t.append(s,e[s])})),t};function te(e){return e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):e}function se(e){return e?e instanceof FormData||e instanceof Blob||e instanceof ArrayBuffer||e instanceof URLSearchParams||e instanceof Document||ArrayBuffer.isView(e)?e:"object"==typeof e?JSON.stringify(e):"string"==typeof e?e:null:null}const re="update black token";class ie{constructor(){this.isUpdating=!1,this.tokenUpdateResolve=null}isTokenExpire(e){if(!e)return!1;return 1e3*e<=(new Date).getTime()+3e3}refreshToken(e,t){return J(this,void 0,void 0,(function*(){const{access_token:s,refresh_token:r}=e;return s&&r?this.isUpdating?this.waitForTokenUpdate():(this.isUpdating=!0,new Promise(((e,i)=>{const n=new XMLHttpRequest,o=`${t}${ne}/login/update`;n.open("POST",o,!0),n.setRequestHeader("Content-Type","application/json"),n.send(JSON.stringify({access_token:s,refresh_token:r})),n.onload=()=>{if(n.status>=200&&n.status<300)try{const t=JSON.parse(n.responseText);if(t&&t.access_token&&t.refresh_token){const s={access_token:t.access_token,refresh_token:t.refresh_token};Z("access_token")===s.access_token&&localStorage.setItem("refresh-token",s.refresh_token),this.tokenUpdateResolve&&(this.tokenUpdateResolve(s),this.tokenUpdateResolve=null),e(s)}else e(null)}catch(e){i(new Error("Failed to parse response JSON."))}else e(null)},n.onerror=()=>{i(new Error("Network error occurred"))},n.onloadend=()=>{this.isUpdating=!1}}))):null}))}waitForTokenUpdate(){return J(this,void 0,void 0,(function*(){return new Promise((e=>{const t=setInterval((()=>{this.isUpdating||(clearInterval(t),e())}),100)}))}))}}const ne="/api/v1",oe="/api/v2";class ce{constructor(e,t){this.client=e,this.tokenUpdate=t,this.baseHost=""}get state(){return this.client.state}get(e,t,s){return this.request(exports.RequestMethod.GET,e,Object.assign({params:t,cache:"no-cache"},s))}post(e,t,s){return this.request(exports.RequestMethod.POST,e,Object.assign({body:t},s))}put(e,t,s){return this.request(exports.RequestMethod.PUT,e,Object.assign({body:t,cache:"no-cache"},s))}patch(e,t,s){return this.request(exports.RequestMethod.PATCH,e,Object.assign({body:t},s))}delete(e,t,s){return this.request(exports.RequestMethod.DELETE,e,Object.assign({params:t},s))}upload(e,t,s){const r=new AbortController,i=r.signal;return{promise:this.request(exports.RequestMethod.POST,e,Object.assign({body:t,signal:i},s)),abort:()=>r.abort()}}request(e,t,s){return J(this,void 0,void 0,(function*(){return new Promise(((r,i)=>J(this,void 0,void 0,(function*(){var n;const o=null!==(n=this.state.skipInterceptors)&&void 0!==n&&n;this.state.skipInterceptors=!1;let c=Object.assign({method:e},s);if((null==s?void 0:s.signal)&&(c.signal=s.signal),o||(s=yield Y(this.client.requestInterceptors,c)),this.state.authToken)for(const[e,r]of this.state.authToken.entries()){const i=X(r.access_token);if(i&&i.is_remember&&this.tokenUpdate.isTokenExpire(i.exp)&&!t.includes("/login")&&!t.includes("/assets")){const t=yield this.tokenUpdate.refreshToken(r,this.baseHost);t&&(this.state.authToken.set(e,t),s=yield Y(this.client.requestInterceptors,c))}}const a=new XMLHttpRequest;(null==s?void 0:s.params)&&0!==Object.keys(s.params).length&&(t+="?"+ee(s.params));const l=`${this.state.clientParams.host}${this.state.clientParams.version}${t}`;if(a.open(e,l,!0),null==s?void 0:s.headers){const e=te(s.headers);for(const[t,s]of Object.entries(e))(this.state.clientParams.host===this.baseHost||"content-type"!==t.toLowerCase())&&a.setRequestHeader(t,s)}(null==s?void 0:s.responseType)&&(a.responseType=s.responseType),(null==s?void 0:s.signal)&&s.signal.addEventListener("abort",(()=>{a.abort(),i(new Error("Upload aborted"))})),a.upload&&[exports.RequestMethod.POST,exports.RequestMethod.PUT,exports.RequestMethod.PATCH].includes(e)&&(a.upload.onprogress=e=>{e.lengthComputable&&(null==s?void 0:s.onUploadProgress)&&s.onUploadProgress(e)}),a.onload=()=>J(this,void 0,void 0,(function*(){if((null==s?void 0:s.signal)&&s.signal.aborted)return;let e;switch(null==s?void 0:s.responseType){case exports.ResponseType.Text:e=a.responseText;break;case exports.ResponseType.Blob:case exports.ResponseType.ArrayBuffer:e=a.response;break;default:try{e=JSON.parse(a.responseText)}catch(t){e=a.responseText}}const t=new Headers;a.getAllResponseHeaders().split("\r\n").forEach((e=>{const[s,r]=e.split(": ");s&&r&&t.append(s,r)}));let n={status:a.status,statusText:a.statusText,headers:t,url:a.responseURL};if(a.status>=200&&a.status<300)(null==s?void 0:s.observe)===exports.RequestObserve.Response?r(Object.assign(Object.assign({},n),{body:e})):r(e);else{if(this.state.authToken&&e.code===re){const e=yield this.tokenUpdate.refreshToken(this.state.authToken.get(0),this.baseHost);e&&this.state.authToken.set(0,e)}s=yield Y(this.client.responseInterceptors,Object.assign(Object.assign({},n),{error:e})),i(Object.assign(Object.assign({},n),{error:e}))}n=yield Y(this.client.responseInterceptors,n)})),a.onerror=()=>{i({status:a.status,statusText:a.statusText,url:a.responseURL,error:"Network error"})},a.send(se(null==s?void 0:s.body))}))))}))}changeBaseUrlVersion(e,t){return J(this,void 0,void 0,(function*(){const s=this.state.clientParams.version;this.state.clientParams.version=e;try{return yield t()}finally{this.state.clientParams.version=s}}))}changeHost(e,t){return J(this,void 0,void 0,(function*(){this.state.clientParams.host=e,this.state.requestParams.headers={};try{return yield t()}finally{this.state.clientParams.host=this.baseHost}}))}}const ae="/static/extensions",le="/extensions/defaults",pe=`${ae}/names/users`,de=`${ae}/names/system`;class he{constructor(e){this.client=e}getSetting(e){return this.client.rest.get(`${ae}/${e}/settings`)}setSetting(e,t){return this.client.rest.post(`${ae}/${e}/settings`,t)}deleteSetting(e){return this.client.rest.delete(`${ae}/${e}/settings`)}get(e){return this.client.rest.get(`${ae}/${e}`)}getByKey(e){return this.client.rest.get(`${ae}/${e}`)}getDefault(e=[]){return this.client.rest.get(le,{ext_code:e})}setDefault(e,t){return this.client.rest.post(le,{ext_code:e,ext_uniq_key:t})}checkUpdates(){return this.client.rest.post(`${ae}/check_updates`)}updateVersion(e,t){return this.client.rest.put(`${ae}/${e}`,{version:t})}list(e){return this.client.rest.get(ae,e)}delete(e,t){return this.client.rest.delete(`${ae}/${e}`)}upload(e,t){const s=new FormData;s.set("file",t);const{promise:r,abort:i}=this.client.rest.upload(ae,s,{onUploadProgress:t=>{e(t)}});return{promise:this.client.rest.changeBaseUrlVersion(oe,(()=>r)),abort:i}}install(e,t){return this.client.rest.changeBaseUrlVersion(oe,(()=>this.client.rest.post(`${ae}/site`,{uniq_key:e,version:t})))}getSystemNameExts(e){return this.client.rest.get(de,e)}getUserNameExts(e){return this.client.rest.get(pe,e)}createUserNameExt(e){return this.client.rest.post(`${pe}`,{name:e})}deleteUserNameExt(e){return this.client.rest.delete(`${pe}/${e}`)}deleteAllUserNameExts(){return this.client.rest.delete(`${pe}`)}}const ue="/anons_ext/extensions";class ge{constructor(e){this.client=e}listExtensionsSite(e){return this.client.rest.changeHost("https://next-box.ru",(()=>this.client.rest.get(ue,e)))}extensionDetailSite(e){return this.client.rest.changeHost("https://next-box.ru",(()=>this.client.rest.get(`${ue}/${e}`)))}extensionMarkdown(e,t){return this.client.rest.changeHost("https://next-box.ru",(()=>this.client.rest.get(`${ue}/${e}/readme`,{},t)))}}const xe="/disk",ve=`${xe}/check`;class _e{constructor(e){this.client=e}info(e,t){return this.client.rest.get(`${xe}/${e}/element`,{path:t})}list(e,t){return this.client.rest.get(`${xe}/${e}`,t)}create(e,t){return this.client.rest.post(`${xe}/${e}/element`,t)}replace(e,t,s){return this.client.rest.put(`${xe}/${e}/files?path=${t}`,s)}read(e,t){return this.client.rest.get(`${xe}/${e}/files?path=${t}`)}upload(e,t,s,r=""){const i=new FormData;i.set("path",r),i.set("file",s);const{promise:n,abort:o}=this.client.rest.upload(`${xe}/${t}/files`,i,{onUploadProgress:t=>{e(t)}});return{promise:n,abort:o}}uploadNet(e,t){return this.client.rest.post(`${xe}/${e}/files/net`,t)}delete(e,t){return this.client.rest.delete(`${xe}/${e}/trash/element`,{path:t})}check(e){return this.client.rest.post(ve,e)}}const Se="/settings";class $e{constructor(e){this.client=e}settings(){return this.client.rest.get(Se)}changeSettings(e){return this.client.rest.post(Se,e)}queryInit(){return this.client.rest.get("/query/init")}}var me;exports.QueryInitViewType=void 0,(me=exports.QueryInitViewType||(exports.QueryInitViewType={})).Standard="Standard",me.Simple="Simple";const fe="/groups";class ye{constructor(e){this.client=e}list(e){return this.client.rest.get(fe,e)}listUsers(e){return this.client.rest.get(`${fe}/${e}/users`)}create(e){return this.client.rest.post(fe,e)}update(e,t){return this.client.rest.put(`${fe}/${e}`,t)}delete(e){return this.client.rest.delete(`${fe}/${e}`)}}const ke="/license",Ae=`${ke}/manual-check`,Te=`${ke}/hardware/hash`;class be{constructor(e){this.client=e}info(){return this.client.rest.get(ke)}create(e){return this.client.rest.post(ke,e)}check(){return this.client.rest.post(Ae)}delete(){return this.client.rest.delete(ke)}getHash(){return this.client.rest.get(Te)}}const we="/links";class Re{constructor(e){this.client=e}createShortLink(e){return this.client.rest.post(we,e)}updateShortLink(e){return this.client.rest.put(we,e)}}const Ce="/limitations";class Ee{constructor(e){this.client=e}list(e){return this.client.rest.get(Ce,e)}listUsers(e,t){return this.client.rest.get(`${Ce}/${e}/users`,t)}create(e){return this.client.rest.post(Ce,e)}get(e){return this.client.rest.get(`${Ce}/${e}`)}update(e,t){return this.client.rest.put(`${Ce}/${e}`,t)}delete(e){return this.client.rest.delete(`${Ce}/${e}`)}getLimitationsByUser(e){return this.client.rest.get(`/limitations/user/${e}`)}addUserToLimitation(e,t){return this.client.rest.patch(`${Ce}/${e}/user`,{id:t})}deleteUserFromLimitation(e,t){return this.client.rest.delete(`${Ce}/${e}/user/${t}`)}}class Ue{constructor(e){this.client=e}getUsersLogs(e){return this.client.rest.get("/logs/users",e)}}const De="/notifications",Pe=`${De}/all`,Oe=`${De}/subscription`,Le=`${De}/permission`;class Ne{constructor(e){this.client=e}list(e){return this.client.rest.get(De,e)}toggleStatus(e,t){return this.client.rest.put(De,{ids:e,to_status:t})}toggleAllStatus(e){return this.client.rest.put(Pe,{to_status:e})}delete(e){return this.client.rest.delete(De,{id:e})}deleteAll(){return this.client.rest.delete(Pe)}getPermission(){return this.client.rest.get(Le)}setPermission(e){return this.client.rest.post(Le,{enabled:e})}getSubscription(){return this.client.rest.get(Oe)}setSubscription(e){const t={action_groups:Object.assign({},e)};return this.client.rest.post(Oe,t)}}const Ie="/roles",je=`${Ie}/default`,qe="/permissions";class Me{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(`${je}`)}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(qe)}addPermission(e,t){return this.client.rest.put(`${Ie}/${e}/permissions`,{ids:t})}deletePermission(e,t){return this.client.rest.delete(`${Ie}/${e}/${qe}`,{ids:t})}}const Be="/share",He=`${Be}/restrictions`;class Fe{constructor(e){this.client=e}info(e,t){const s=new URLSearchParams({path:e,share_token:t});return this.client.rest.get(`${Be}?${s.toString()}`)}checkPassword(e,t){const s=encodeURIComponent(e);return this.client.rest.get(`${Be}/password?share_token=${t}&share_pass=${s}`)}checkToken(e){return this.client.rest.get(`${Be}?share_token=${e}`)}getRestriction(e){return this.client.rest.get(`${He}/${e}`)}restrictions(e){return this.client.rest.get(He,e)}restrictionsChange(e,t){return this.client.rest.put(`${He}/${e}`,t)}}const We="/storage/element/version/comment",Ve=`${We}/all`;class Ge{constructor(e){this.client=e}list(e){return this.client.rest.get(`${We}`,e)}create(e){return this.client.rest.post(`${We}`,e)}update(e){return this.client.rest.put(`${We}`,e)}delete(e){return this.client.rest.delete(`${We}`,e)}deleteAll(e){return this.client.rest.delete(`${Ve}`,e)}}const ze="/storage",Je=`${ze}/element`,Ke=`${Je}/divide/resource`,Qe=`${Je}/move`,Xe=`${Je}/copy`,Ye=`${Je}/content_type_size`,Ze="/disk";class et{constructor(e,t){this.client=e,this.fcaApiService=t}list(e){return this.client.rest.get(ze,e)}info(e){var t;return parseInt((null===(t=e.divide_id)||void 0===t?void 0:t.toString())||"")||delete e.divide_id,e.file_version_id||delete e.file_version_id,this.client.rest.get(Je,e)}combineInfo({root:e,rootId:t,path:s,file_version_id:r}){return e===exports.StorageRoot.fca&&t?this.fcaApiService.info(t,s):this.info({path:s,divide_id:t,file_version_id:r})}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=Object.assign(Object.assign({},e),{from_divide_id:null,to_divide_id:null});return t===exports.StorageRoot.fca&&s===exports.StorageRoot.fca?this.client.rest.post(`${Ze}/${r}/files/move${Ze}/${i}`,n):t===exports.StorageRoot.fca?(r&&(n.from_divide_id=r),this.client.rest.put(`${Ze}/${i}/files/from/box`,n)):s===exports.StorageRoot.fca?(i&&(n.to_divide_id=i),this.client.rest.put(`${Ze}/${r}/files/to/box`,n)):this.client.rest.post(Qe,e)}copy(e,t,s){const{from_divide_id:r,to_divide_id:i}=e;let n=Object.assign(Object.assign({},e),{from_divide_id:null,to_divide_id:null});return s===exports.StorageRoot.fca&&t===exports.StorageRoot.fca?this.client.rest.post(`${Ze}/${r}/files/copy${Ze}/${i}`,n):s===exports.StorageRoot.fca?(r&&(n.from_divide_id=r),this.client.rest.post(`${Ze}/${i}/files/from/box`,n)):t===exports.StorageRoot.fca?(i&&(n.to_divide_id=i),this.client.rest.post(`${Ze}/${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(`${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(Ye,e)}getDivideResources(e){return this.client.rest.get(Ke,e)}}const tt="/storage/files",st=`${tt}/net`;class rt{constructor(e){this.client=e}read(e,t){return t.path=e,this.client.rest.get(tt,t)}replace(e,t){const s=new URLSearchParams;return Object.keys(e).forEach((t=>{e[t]&&s.append(t,e[t])})),this.client.rest.put(`${tt}?${s.toString()}`,t)}upload(e,t,s,r){const i=new FormData;i.set("path",s),r&&i.set("divide_id",r.toString()),i.set("file",t);const{promise:n,abort:o}=this.client.rest.upload(tt,i,{onUploadProgress:t=>{e(t)}});return{promise:n,abort:o}}uploadNet(e){return this.client.rest.post(st,e)}}class it{constructor(e){this.client=e}instance(){return this.client.rest.get("/storage/instance")}}const nt="/storage/element/share";class ot{constructor(e){this.client=e}info(e){return this.client.rest.get(nt,{path:e})}create(e,t){const s={path:e,permissions_type:t};return this.client.rest.post(nt,s)}change(e){return this.client.rest.put(`${nt}/${e.token}`,e)}delete(e){return this.client.rest.delete(nt,{path:e})}refresh(e){return this.client.rest.put(`${nt}/${e}/refresh`)}}const ct="/storage/trash/element",at=`${ct}/all`;class lt{constructor(e){this.client=e}clear(e){return this.client.rest.delete(ct,e)}clearAll(){return this.client.rest.delete(at)}restore(e){return this.client.rest.patch(ct,{del_groups:e})}restoreAll(){return this.client.rest.patch(at)}}const pt="/users",dt=`${pt}/me`,ht=`${dt}/avatars`,ut=`${dt}/sessions`,gt=`${dt}/tokens`,xt=`${dt}/params`,vt=`${dt}/change-password`,_t=`${pt}/initial`,St=`${dt}/phone`,$t=`${St}/confirm`;class mt{constructor(e){this.client=e}initial(e){return this.client.rest.post(_t,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(dt)}updateMe(e){return this.client.rest.put(dt,e)}createToken(e){return this.client.rest.post(gt,e)}listToken(e){return this.client.rest.get(gt,e)}deleteToken(e){return this.client.rest.delete(`${gt}/${e}`)}changeMyPassword(e){return this.client.rest.put(vt,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(ht,s)}meDeleteAvatar(){return this.client.rest.delete(ht)}meListSession(e){return this.client.rest.get(ut,e)}meDeleteSession(e){let t=ut;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(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(St,e)}phoneConfirm(e){return this.client.rest.post(`${$t}/${e}`)}}const ft="/storage/element",yt=`${ft}/history`,kt=`${ft}/version`,At=`${kt}/lock`,Tt=`${kt}/unlock`,bt=`${kt}/current`,wt=`${kt}/size`;class Rt{constructor(e){this.client=e}history(e){return this.client.rest.get(yt,e)}versions(e){return this.client.rest.get(kt,e)}create(e){return this.client.rest.post(kt,e)}edit(e){return this.client.rest.put(kt,e)}delete(e){return this.client.rest.delete(kt,e)}size(e){return this.client.rest.get(wt,e)}makeCurrent(e){return this.client.rest.post(bt,e)}lock(e){return this.client.rest.post(At,e)}unlock(e){return this.client.rest.post(Tt,e)}}exports.AuthApiService=i,exports.BASE_URL_V1=ne,exports.BASE_URL_V2=oe,exports.CONNECTIONS_PERMISSION=o,exports.Client=class{constructor(e){this.AuthApiService=new i(this),this.ConnectionsApiService=new F(this),this.DiscoveryApiService=new W(this),this.DivideApiService=new z(this),this.ExtensionsApiService=new he(this),this.ExtensionsExternalApiService=new ge(this),this.FcaApiService=new _e(this),this.GatewayApiService=new $e(this),this.GroupApiService=new ye(this),this.LicenseApiService=new be(this),this.LinksApiService=new Re(this),this.LimitationsApiService=new Ee(this),this.LogstashApiService=new Ue(this),this.NotificationApiService=new Ne(this),this.RoleApiService=new Me(this),this.ShareApiService=new Fe(this),this.StorageCommentApiService=new Ge(this),this.StorageElementApiService=new et(this,this.FcaApiService),this.StorageFilesApiService=new rt(this),this.StorageInstanceApiService=new it(this),this.StorageShareApiService=new ot(this),this.StorageTrashApiService=new lt(this),this.UserApiService=new mt(this),this.VersionApiService=new Rt(this),this.tokenUpdate=new ie,this.rest=new ce(this,this.tokenUpdate),this.requestInterceptors=[],this.responseInterceptors=[],this.request={use:(e,t)=>{this.requestInterceptors.push({fulfilled:e,rejected:t})}},this.response={use:(e,t)=>{this.responseInterceptors.push({fulfilled:e,rejected:t})}},this.state={clientParams:{host:null==e?void 0:e.host,version:(null==e?void 0:e.version)||ne},requestParams:{path:"",headers:{},query:{},body:null,cache:"no-cache"},authToken:null,skipInterceptors:!1},this.rest.baseHost=this.state.clientParams.host||""}},exports.ConnectionsApiService=F,exports.DiscoveryApiService=W,exports.DivideApiService=z,exports.ExtensionsApiService=he,exports.ExtensionsExternalApiService=ge,exports.FcaApiService=_e,exports.GatewayApiService=$e,exports.GroupApiService=ye,exports.LicenseApiService=be,exports.LimitationsApiService=Ee,exports.LinksApiService=Re,exports.LogstashApiService=Ue,exports.NEED_TOKEN_UPDATE_ERROR=re,exports.NotificationApiService=Ne,exports.Rest=ce,exports.RoleApiService=Me,exports.ShareApiService=Fe,exports.StorageCommentApiService=Ge,exports.StorageElementApiService=et,exports.StorageFilesApiService=rt,exports.StorageInstanceApiService=it,exports.StorageShareApiService=ot,exports.StorageTrashApiService=lt,exports.TokenUpdate=ie,exports.UserApiService=mt,exports.VersionApiService=Rt,exports.applyInterceptors=Y,exports.getCookieValue=Z,exports.makeUrlParams=ee,exports.normalizeHeaders=te,exports.prepareRequestBody=se;
@@ -1 +1 @@
1
- const e="/login",t=`${e}/ldap`,s=`${e}/update`,i=`${e}/tfa`;class n{constructor(e){this.client=e}info(){return this.client.rest.get(e)}login(t){return this.client.rest.post(e,t)}ldapLogin(e){return this.client.rest.post(t,e)}loginTfa(e){return this.client.rest.post(i,e)}updateToken(e){const t=e.path?`${e.path}/${s}`:s;return e.path&&delete e.path,this.client.rest.post(t,e)}logout(){return this.client.rest.post("/logout")}}var r;!function(e){e.LicenseRead="license_read",e.LicenseManage="license_edit",e.UsersRead="users_read",e.UsersCreate="users_create",e.UsersActivate="users_activate",e.GroupsRead="groups_read",e.GroupsCreate="groups_create",e.RolesRead="roles_read",e.RolesCreate="roles_create",e.Share="share",e.Divide="divide",e.ExtensionsRead="extensions_read",e.ExtensionsManage="extensions_write",e.RestrictionShareRead="restriction_share_read",e.RestrictionShareWrite="restriction_share_write",e.RestrictionDivideRead="restriction_divide_read",e.RestrictionDivideWrite="restriction_divide_write",e.ReadUserLogs="read_user_logs",e.ConnectionsRead="connections_read",e.ConnectionsDividing="connections_dividing",e.ConnectionsYandexDisk="connections_yandex_disk",e.ConnectionsSsh="connections_ssh",e.ConnectionsMail="connections_mail",e.ConnectionsS3="connections_s3",e.ConnectionsDiscord="connections_discord",e.ConnectionsWebdav="connections_webdav",e.ConnectionsNextcloud="connections_nextcloud",e.ConnectionsNextbox="connections_nextbox",e.ConnectionsHttpProxy="connections_http_proxy",e.SystemInfoServiceList="system_info_service_list",e.SettingsRead="settings_read",e.SettingsWrite="settings_write"}(r||(r={}));const o=[r.ConnectionsYandexDisk,r.ConnectionsSsh,r.ConnectionsMail,r.ConnectionsS3,r.ConnectionsS3,r.ConnectionsDiscord,r.ConnectionsWebdav,r.ConnectionsNextcloud,r.ConnectionsNextbox,r.ConnectionsHttpProxy];var c,a,l,h,u,d,p,g,_,f,v,$,m,k,b,w,S,y,x,C,A,T,U,P,D,E,O,R,I,L,j,N,H,W;!function(e){e.DEFAULT="",e.ASC="asc",e.DESC="desc"}(c||(c={})),function(e){e.WebSocket="websocket",e.PostMessage="postmessage",e.Empty=""}(a||(a={})),function(e){e.Storages="storages_connections_group",e.Webhooks="webhooks_connections_group",e.Unknown="unknown_connections_group",e.Proxy="proxy_connections_group"}(l||(l={})),function(e){e.SSH="ssh_connection",e.YandexDisk="yandex_disk",e.Mail="mail",e.Discord="discord",e.Webdav="webdav_connection",e.Nextcloud="nextcloud_connection",e.NextBox="nextbox_connection",e.HttpProxy="http_proxy_connection",e.S3="s3_connection"}(h||(h={})),function(e){e.App="app",e.File="file",e.WorkDir="work_dir"}(u||(u={})),function(e){e.Read="read",e.ReadAndWrite="read_and_write",e.Write="write"}(d||(d={})),function(e){e.Storage="/storage/element",e.Connection="/connections"}(p||(p={})),function(e){e.CLOSE="",e.READ="r",e.WRITE="rw"}(g||(g={})),function(e){e.WAITING="waiting",e.APPROVED="approved",e.REJECTED="rejected"}(_||(_={})),function(e){e.TRUE="true",e.FALSE="false"}(f||(f={})),function(e){e.User="to_user_id",e.Group="to_user_group_id"}(v||(v={})),function(e){e.Divide="divide",e.Share="share"}($||($={})),function(e){e.Free="free",e.Business="business",e.Enterprise="enterprise"}(m||(m={})),function(e){e.NotActivated="License not activated",e.Blocked="License blocked",e.Expired="License has been expired",e.NotValid="License not valid",e.NotFound="license file not found"}(k||(k={})),function(e){e.BySize="size",e.ByExt="extension"}(b||(b={})),function(e){e.Size="size",e.White="extension_white",e.Black="extension_black"}(w||(w={})),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"}(S||(S={})),function(e){e.SecurityCheckNegative="action_security_check_negative",e.SecurityCheckPositive="action_security_check_positive",e.OpenSharing="open_sharing",e.ChangeSharing="change_sharing",e.CancelSharing="cancel_sharing",e.DivideDirAddFileToOwner="divide_dir_add_file_to_owner",e.DivideDirAddDirToOwner="divide_dir_add_dir_to_owner",e.DivideDirAddWorkDirToOwner="divide_dir_add_work_dir_to_owner",e.DivideConnectionAddFileToOwner="divide_connection_add_file_to_owner",e.DivideConnectionAddDirToOwner="divide_connection_add_dir_to_owner",e.CancelDivideDir="cancel_divide_dir",e.CancelDivideFile="cancel_divide_file",e.CancelDivideWorkDir="cancel_divide_work_dir",e.CancelDivideConnection="cancel_divide_connection",e.DeleteExtension="delete_extension",e.NewVersionExtension="new_version_extension",e.TransferData="transfer_data",e.AllowInternalAccessUser="allow_internal_access_to_user",e.BlockInternalAccessUser="block_internal_access_to_user",e.WaitInternalAccessUser="wait_internal_access_to_user",e.WaitInternalAccessUserCreate="wait_internal_access_to_user_create",e.AllowInternalAccessGroup="allow_internal_access_to_group",e.BlockInternalAccessGroup="block_internal_access_to_group",e.WaitInternalAccessGroup="wait_internal_access_to_group",e.WaitInternalAccessGroupCreate="wait_internal_access_to_group_create",e.AllowSharing="allow_sharing",e.BlockSharing="block_sharing",e.WaitSharing="wait_sharing",e.WaitSharingCreate="wait_sharing_create",e.Other="other"}(y||(y={})),function(e){e.Read="read",e.Unread="unread",e.Delete="delete"}(x||(x={})),function(e){e.Plain="plain",e.Success="success",e.Info="info",e.Warning="warning",e.Error="error"}(C||(C={})),function(e){e.ArrayBuffer="arraybuffer",e.Blob="blob",e.Json="json",e.Text="text"}(A||(A={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.PATCH="PATCH",e.DELETE="DELETE"}(T||(T={})),function(e){e.Body="body",e.Response="response"}(U||(U={})),function(e){e.NONE="none",e.SOFT="soft",e.HARD="hard"}(P||(P={})),function(e){e.Native="native",e.Ldap="ldap",e.Vk="vk"}(D||(D={})),function(e){e.Registering="registering",e.Activated="activated",e.Blocked="blocked",e.BlockedByLicense="blocked_by_license"}(E||(E={})),function(e){e.User="user",e.Guest="guest",e.Emperor="emperor",e.Anonymous="anonymous"}(O||(O={})),function(e){e.Theme="theme",e.Lang="lang",e.Sort="sort"}(R||(R={})),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"}(I||(I={})),function(e){e.Dir="dir",e.File="file",e.WorkDir="work_dir"}(L||(L={})),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"}(j||(j={})),function(e){e.my="my",e.fca="fca",e.divide="divide",e.share="share",e.favorite="favorite",e.trash="trash"}(N||(N={})),function(e){e.Create="create",e.Update="update",e.Move="move"}(H||(H={})),function(e){e[e.CheckNull=0]="CheckNull",e[e.CheckInProgress=1]="CheckInProgress",e[e.CheckPositive=2]="CheckPositive",e[e.CheckNegative=3]="CheckNegative"}(W||(W={}));const B="/connections",F=`${B}/dashboard`;class q{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={[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]||B,e)}dashboard(e){return this.client.rest.get(F,e)}}class G{constructor(e){this.client=e}discovery(e){return this.client.rest.get("/discovery",e)}}const M="/divide",z=`${M}/restrictions`;class V{constructor(e){this.client=e}divideDelete(e,t){return this.client.rest.delete(`${e}/${M}/${t}`)}divideDeleteAll(e,t,s,i){return this.client.rest.delete(`${e}/${M}`,Object.assign(Object.assign({},this.makeParam(e,t)),{is_to_user_group:i,access_mode:s}))}divideChange(e,t,s){return this.client.rest.put(`${e}/divide/${t}`,{access_mode:s})}divideCreate(e,t,s,i,n){const r=Object.assign(Object.assign({},this.makeParam(e,t)),{[n]:s,access_mode:i});return this.client.rest.post(`${e}/${M}`,r)}divideUsers(e,t,s){return this.client.rest.get(`${e}/${M}/users`,Object.assign(Object.assign({},this.makeParam(e,t)),s))}getRestriction(e){return this.client.rest.get(`${z}/${e}`)}restrictionSize(e,t){return this.client.rest.get(`/${t}/restrictions/${e}/size`)}restrictions(e){return this.client.rest.get(`${z}`,e)}restrictionsChange(e,t){return this.client.rest.put(`${z}/${e}`,t)}makeParam(e,t){const s={};return e===p.Connection?s.connection_id=t:s.path=t,s}}function J(e,t,s,i){return new(s||(s=Promise))((function(n,r){function o(e){try{a(i.next(e))}catch(e){r(e)}}function c(e){try{a(i.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?n(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,c)}a((i=i.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class X extends Error{}function Y(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return function(e){return decodeURIComponent(atob(e).replace(/(.)/g,((e,t)=>{let s=t.charCodeAt(0).toString(16).toUpperCase();return s.length<2&&(s="0"+s),"%"+s})))}(t)}catch(e){return atob(t)}}function K(e,t){if("string"!=typeof e)throw new X("Invalid token specified: must be a string");t||(t={});const s=!0===t.header?0:1,i=e.split(".")[s];if("string"!=typeof i)throw new X(`Invalid token specified: missing part #${s+1}`);let n;try{n=Y(i)}catch(e){throw new X(`Invalid token specified: invalid base64 for part #${s+1} (${e.message})`)}try{return JSON.parse(n)}catch(e){throw new X(`Invalid token specified: invalid json for part #${s+1} (${e.message})`)}}X.prototype.name="InvalidTokenError";const Q=(e,t)=>J(void 0,void 0,void 0,(function*(){let s=t;for(const t of e)try{s=yield t.fulfilled(s)}catch(e){if(!t.rejected)throw e;s=yield t.rejected(e)}return s}));function Z(e){var t;return null!==(t=Object.fromEntries(document.cookie.split(";").map((e=>e.split("="))).map((([e,t])=>[e.trim(),decodeURIComponent(t||"")])))[e])&&void 0!==t?t:null}const ee=e=>{const t=new URLSearchParams;return Object.keys(e).forEach((s=>{Array.isArray(e[s])?e[s].forEach((e=>{t.append(s,e)})):t.append(s,e[s])})),t};function te(e){return e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):e}function se(e){return e?e instanceof FormData||e instanceof Blob||e instanceof ArrayBuffer||e instanceof URLSearchParams||e instanceof Document||ArrayBuffer.isView(e)?e:"object"==typeof e?JSON.stringify(e):"string"==typeof e?e:null:null}const ie="update black token";class ne{constructor(){this.isUpdating=!1,this.tokenUpdateResolve=null}isTokenExpire(e){if(!e)return!1;return 1e3*e<=(new Date).getTime()+3e3}refreshToken(e,t){return J(this,void 0,void 0,(function*(){const{access_token:s,refresh_token:i}=e;return s&&i?this.isUpdating?this.waitForTokenUpdate():(this.isUpdating=!0,new Promise(((e,n)=>{const r=new XMLHttpRequest,o=`${t}${re}/login/update`;r.open("POST",o,!0),r.setRequestHeader("Content-Type","application/json"),r.send(JSON.stringify({access_token:s,refresh_token:i})),r.onload=()=>{if(r.status>=200&&r.status<300)try{const t=JSON.parse(r.responseText);if(t&&t.access_token&&t.refresh_token){const s={access_token:t.access_token,refresh_token:t.refresh_token};Z("access_token")===s.access_token&&localStorage.setItem("refresh-token",s.refresh_token),this.tokenUpdateResolve&&(this.tokenUpdateResolve(s),this.tokenUpdateResolve=null),e(s)}else e(null)}catch(e){n(new Error("Failed to parse response JSON."))}else e(null)},r.onerror=()=>{n(new Error("Network error occurred"))},r.onloadend=()=>{this.isUpdating=!1}}))):null}))}waitForTokenUpdate(){return J(this,void 0,void 0,(function*(){return new Promise((e=>{const t=setInterval((()=>{this.isUpdating||(clearInterval(t),e())}),100)}))}))}}const re="/api/v1",oe="/api/v2";class ce{constructor(e,t){this.client=e,this.tokenUpdate=t,this.baseHost=""}get state(){return this.client.state}get(e,t,s){return this.request(T.GET,e,Object.assign({params:t,cache:"no-cache"},s))}post(e,t,s){return this.request(T.POST,e,Object.assign({body:t},s))}put(e,t,s){return this.request(T.PUT,e,Object.assign({body:t,cache:"no-cache"},s))}patch(e,t,s){return this.request(T.PATCH,e,Object.assign({body:t},s))}delete(e,t,s){return this.request(T.DELETE,e,Object.assign({params:t},s))}upload(e,t,s){const i=new AbortController,n=i.signal;return{promise:this.request(T.POST,e,Object.assign({body:t,signal:n},s)),abort:()=>i.abort()}}request(e,t,s){return J(this,void 0,void 0,(function*(){return new Promise(((i,n)=>J(this,void 0,void 0,(function*(){var r;const o=null!==(r=this.state.skipInterceptors)&&void 0!==r&&r;this.state.skipInterceptors=!1;let c=Object.assign({method:e},s);if((null==s?void 0:s.signal)&&(c.signal=s.signal),o||(s=yield Q(this.client.requestInterceptors,c)),this.state.authToken)for(const[e,i]of this.state.authToken.entries()){const n=K(i.access_token);if(n&&n.is_remember&&this.tokenUpdate.isTokenExpire(n.exp)&&!t.includes("/login")&&!t.includes("/assets")){const t=yield this.tokenUpdate.refreshToken(i,this.baseHost);t&&(this.state.authToken.set(e,t),s=yield Q(this.client.requestInterceptors,c))}}const a=new XMLHttpRequest;(null==s?void 0:s.params)&&0!==Object.keys(s.params).length&&(t+="?"+ee(s.params));const l=`${this.state.clientParams.host}${this.state.clientParams.version}${t}`;if(a.open(e,l,!0),null==s?void 0:s.headers){const e=te(s.headers);for(const[t,s]of Object.entries(e))(this.state.clientParams.host===this.baseHost||"content-type"!==t.toLowerCase())&&a.setRequestHeader(t,s)}(null==s?void 0:s.responseType)&&(a.responseType=s.responseType),(null==s?void 0:s.signal)&&s.signal.addEventListener("abort",(()=>{a.abort(),n(new Error("Upload aborted"))})),a.upload&&[T.POST,T.PUT,T.PATCH].includes(e)&&(a.upload.onprogress=e=>{e.lengthComputable&&(null==s?void 0:s.onUploadProgress)&&s.onUploadProgress(e)}),a.onload=()=>J(this,void 0,void 0,(function*(){if((null==s?void 0:s.signal)&&s.signal.aborted)return;let e;switch(null==s?void 0:s.responseType){case A.Text:e=a.responseText;break;case A.Blob:case A.ArrayBuffer:e=a.response;break;default:try{e=JSON.parse(a.responseText)}catch(t){e=a.responseText}}const t=new Headers;a.getAllResponseHeaders().split("\r\n").forEach((e=>{const[s,i]=e.split(": ");s&&i&&t.append(s,i)}));let r={status:a.status,statusText:a.statusText,headers:t,url:a.responseURL};if(a.status>=200&&a.status<300)(null==s?void 0:s.observe)===U.Response?i(Object.assign(Object.assign({},r),{body:e})):i(e);else{if(this.state.authToken&&e.code===ie){const e=yield this.tokenUpdate.refreshToken(this.state.authToken.get(0),this.baseHost);e&&this.state.authToken.set(0,e)}s=yield Q(this.client.responseInterceptors,Object.assign(Object.assign({},r),{error:e})),n(Object.assign(Object.assign({},r),{error:e}))}r=yield Q(this.client.responseInterceptors,r)})),a.onerror=()=>{n({status:a.status,statusText:a.statusText,url:a.responseURL,error:"Network error"})},a.send(se(null==s?void 0:s.body))}))))}))}changeBaseUrlVersion(e,t){return J(this,void 0,void 0,(function*(){const s=this.state.clientParams.version;this.state.clientParams.version=e;try{return yield t()}finally{this.state.clientParams.version=s}}))}changeHost(e,t){return J(this,void 0,void 0,(function*(){this.state.clientParams.host=e,this.state.requestParams.headers={};try{return yield t()}finally{this.state.clientParams.host=this.baseHost}}))}}class ae{constructor(e){this.AuthApiService=new n(this),this.ConnectionsApiService=new q(this),this.DiscoveryApiService=new G(this),this.DivideApiService=new V(this),this.ExtensionsApiService=new pe(this),this.ExtensionsExternalApiService=new _e(this),this.FcaApiService=new $e(this),this.GatewayApiService=new ke(this),this.GroupApiService=new Se(this),this.LicenseApiService=new Ae(this),this.LinksApiService=new Ue(this),this.LimitationsApiService=new De(this),this.LogstashApiService=new Ee(this),this.NotificationApiService=new je(this),this.RoleApiService=new Be(this),this.ShareApiService=new Ge(this),this.StorageElementApiService=new Ke(this,this.FcaApiService),this.StorageFilesApiService=new et(this),this.StorageInstanceApiService=new tt(this),this.StorageShareApiService=new it(this),this.StorageTrashApiService=new ot(this),this.UserApiService=new vt(this),this.VersionApiService=new xt(this),this.tokenUpdate=new ne,this.rest=new ce(this,this.tokenUpdate),this.requestInterceptors=[],this.responseInterceptors=[],this.request={use:(e,t)=>{this.requestInterceptors.push({fulfilled:e,rejected:t})}},this.response={use:(e,t)=>{this.responseInterceptors.push({fulfilled:e,rejected:t})}},this.state={clientParams:{host:null==e?void 0:e.host,version:(null==e?void 0:e.version)||re},requestParams:{path:"",headers:{},query:{},body:null,cache:"no-cache"},authToken:null,skipInterceptors:!1},this.rest.baseHost=this.state.clientParams.host||""}}const le="/static/extensions",he="/extensions/defaults",ue=`${le}/names/users`,de=`${le}/names/system`;class pe{constructor(e){this.client=e}getSetting(e){return this.client.rest.get(`${le}/${e}/settings`)}setSetting(e,t){return this.client.rest.post(`${le}/${e}/settings`,t)}deleteSetting(e){return this.client.rest.delete(`${le}/${e}/settings`)}get(e){return this.client.rest.get(`${le}/${e}`)}getByKey(e){return this.client.rest.get(`${le}/${e}`)}getDefault(e=[]){return this.client.rest.get(he,{ext_code:e})}setDefault(e,t){return this.client.rest.post(he,{ext_code:e,ext_uniq_key:t})}checkUpdates(){return this.client.rest.post(`${le}/check_updates`)}updateVersion(e,t){return this.client.rest.put(`${le}/${e}`,{version:t})}list(e){return this.client.rest.get(le,e)}delete(e,t){return this.client.rest.delete(`${le}/${e}`)}upload(e,t){const s=new FormData;s.set("file",t);const{promise:i,abort:n}=this.client.rest.upload(le,s,{onUploadProgress:t=>{e(t)}});return{promise:this.client.rest.changeBaseUrlVersion(oe,(()=>i)),abort:n}}install(e,t){return this.client.rest.changeBaseUrlVersion(oe,(()=>this.client.rest.post(`${le}/site`,{uniq_key:e,version:t})))}getSystemNameExts(e){return this.client.rest.get(de,e)}getUserNameExts(e){return this.client.rest.get(ue,e)}createUserNameExt(e){return this.client.rest.post(`${ue}`,{name:e})}deleteUserNameExt(e){return this.client.rest.delete(`${ue}/${e}`)}deleteAllUserNameExts(){return this.client.rest.delete(`${ue}`)}}const ge="/anons_ext/extensions";class _e{constructor(e){this.client=e}listExtensionsSite(e){return this.client.rest.changeHost("https://next-box.ru",(()=>this.client.rest.get(ge,e)))}extensionDetailSite(e){return this.client.rest.changeHost("https://next-box.ru",(()=>this.client.rest.get(`${ge}/${e}`)))}extensionMarkdown(e,t){return this.client.rest.changeHost("https://next-box.ru",(()=>this.client.rest.get(`${ge}/${e}/readme`,{},t)))}}const fe="/disk",ve=`${fe}/check`;class $e{constructor(e){this.client=e}info(e,t){return this.client.rest.get(`${fe}/${e}/element`,{path:t})}list(e,t){return this.client.rest.get(`${fe}/${e}`,t)}create(e,t){return this.client.rest.post(`${fe}/${e}/element`,t)}replace(e,t,s){return this.client.rest.put(`${fe}/${e}/files?path=${t}`,s)}read(e,t){return this.client.rest.get(`${fe}/${e}/files?path=${t}`)}upload(e,t,s,i=""){const n=new FormData;n.set("path",i),n.set("file",s);const{promise:r,abort:o}=this.client.rest.upload(`${fe}/${t}/files`,n,{onUploadProgress:t=>{e(t)}});return{promise:r,abort:o}}uploadNet(e,t){return this.client.rest.post(`${fe}/${e}/files/net`,t)}delete(e,t){return this.client.rest.delete(`${fe}/${e}/trash/element`,{path:t})}check(e){return this.client.rest.post(ve,e)}}const me="/settings";class ke{constructor(e){this.client=e}settings(){return this.client.rest.get(me)}changeSettings(e){return this.client.rest.post(me,e)}queryInit(){return this.client.rest.get("/query/init")}}var be;!function(e){e.Standard="Standard",e.Simple="Simple"}(be||(be={}));const we="/groups";class Se{constructor(e){this.client=e}list(e){return this.client.rest.get(we,e)}listUsers(e){return this.client.rest.get(`${we}/${e}/users`)}create(e){return this.client.rest.post(we,e)}update(e,t){return this.client.rest.put(`${we}/${e}`,t)}delete(e){return this.client.rest.delete(`${we}/${e}`)}}const ye="/license",xe=`${ye}/manual-check`,Ce=`${ye}/hardware/hash`;class Ae{constructor(e){this.client=e}info(){return this.client.rest.get(ye)}create(e){return this.client.rest.post(ye,e)}check(){return this.client.rest.post(xe)}delete(){return this.client.rest.delete(ye)}getHash(){return this.client.rest.get(Ce)}}const Te="/links";class Ue{constructor(e){this.client=e}createShortLink(e){return this.client.rest.post(Te,e)}updateShortLink(e){return this.client.rest.put(Te,e)}}const Pe="/limitations";class De{constructor(e){this.client=e}list(e){return this.client.rest.get(Pe,e)}listUsers(e,t){return this.client.rest.get(`${Pe}/${e}/users`,t)}create(e){return this.client.rest.post(Pe,e)}get(e){return this.client.rest.get(`${Pe}/${e}`)}update(e,t){return this.client.rest.put(`${Pe}/${e}`,t)}delete(e){return this.client.rest.delete(`${Pe}/${e}`)}getLimitationsByUser(e){return this.client.rest.get(`/limitations/user/${e}`)}addUserToLimitation(e,t){return this.client.rest.patch(`${Pe}/${e}/user`,{id:t})}deleteUserFromLimitation(e,t){return this.client.rest.delete(`${Pe}/${e}/user/${t}`)}}class Ee{constructor(e){this.client=e}getUsersLogs(e){return this.client.rest.get("/logs/users",e)}}const Oe="/notifications",Re=`${Oe}/all`,Ie=`${Oe}/subscription`,Le=`${Oe}/permission`;class je{constructor(e){this.client=e}list(e){return this.client.rest.get(Oe,e)}toggleStatus(e,t){return this.client.rest.put(Oe,{ids:e,to_status:t})}toggleAllStatus(e){return this.client.rest.put(Re,{to_status:e})}delete(e){return this.client.rest.delete(Oe,{id:e})}deleteAll(){return this.client.rest.delete(Re)}getPermission(){return this.client.rest.get(Le)}setPermission(e){return this.client.rest.post(Le,{enabled:e})}getSubscription(){return this.client.rest.get(Ie)}setSubscription(e){const t={action_groups:Object.assign({},e)};return this.client.rest.post(Ie,t)}}const Ne="/roles",He=`${Ne}/default`,We="/permissions";class Be{constructor(e){this.client=e}list(e){return this.client.rest.get(Ne,e)}get(e){return this.client.rest.get(`${Ne}/${e}`)}getDefault(){return this.client.rest.get(`${He}`)}create(e){return this.client.rest.post(Ne,e)}update(e,t){return this.client.rest.put(`${Ne}/${e}`,t)}delete(e){return this.client.rest.delete(`${Ne}/${e}`)}permissionList(){return this.client.rest.get(We)}addPermission(e,t){return this.client.rest.put(`${Ne}/${e}/permissions`,{ids:t})}deletePermission(e,t){return this.client.rest.delete(`${Ne}/${e}/${We}`,{ids:t})}}const Fe="/share",qe=`${Fe}/restrictions`;class Ge{constructor(e){this.client=e}info(e,t){const s=new URLSearchParams({path:e,share_token:t});return this.client.rest.get(`${Fe}?${s.toString()}`)}checkPassword(e,t){const s=encodeURIComponent(e);return this.client.rest.get(`${Fe}/password?share_token=${t}&share_pass=${s}`)}checkToken(e){return this.client.rest.get(`${Fe}?share_token=${e}`)}getRestriction(e){return this.client.rest.get(`${qe}/${e}`)}restrictions(e){return this.client.rest.get(qe,e)}restrictionsChange(e,t){return this.client.rest.put(`${qe}/${e}`,t)}}const Me="/storage",ze=`${Me}/element`,Ve=`${ze}/move`,Je=`${ze}/copy`,Xe=`${ze}/content_type_size`,Ye="/disk";class Ke{constructor(e,t){this.client=e,this.fcaApiService=t}list(e){return this.client.rest.get(Me,e)}info(e){var t;return parseInt((null===(t=e.divide_id)||void 0===t?void 0:t.toString())||"")||delete e.divide_id,e.file_version_id||delete e.file_version_id,this.client.rest.get(ze,e)}combineInfo({root:e,rootId:t,path:s,file_version_id:i}){return e===N.fca&&t?this.fcaApiService.info(t,s):this.info({path:s,divide_id:t,file_version_id:i})}size(e){return this.client.rest.post(`${ze}/size`,e)}move(e,t,s){const{from_divide_id:i,to_divide_id:n}=e;let r=Object.assign(Object.assign({},e),{from_divide_id:null,to_divide_id:null});return t===N.fca&&s===N.fca?this.client.rest.post(`${Ye}/${i}/files/move${Ye}/${n}`,r):t===N.fca?(i&&(r.from_divide_id=i),this.client.rest.put(`${Ye}/${n}/files/from/box`,r)):s===N.fca?(n&&(r.to_divide_id=n),this.client.rest.put(`${Ye}/${i}/files/to/box`,r)):this.client.rest.post(Ve,e)}copy(e,t,s){const{from_divide_id:i,to_divide_id:n}=e;let r=Object.assign(Object.assign({},e),{from_divide_id:null,to_divide_id:null});return s===N.fca&&t===N.fca?this.client.rest.post(`${Ye}/${i}/files/copy${Ye}/${n}`,r):s===N.fca?(i&&(r.from_divide_id=i),this.client.rest.post(`${Ye}/${n}/files/from/box`,r)):t===N.fca?(n&&(r.to_divide_id=n),this.client.rest.post(`${Ye}/${i}/files/to/box`,r)):this.client.rest.post(Je,e)}pasteFromShared(e,t,s){const i={from_sharing_token:e,from_sharing_password:s,paths:t};return this.client.rest.post(`${ze}/copy`,i)}create(e){return this.client.rest.post(ze,e)}delete(e,t){const s={path:e};return t&&(s.divide_id=t),this.client.rest.delete(ze,s)}favorite(e){return this.client.rest.put(`${ze}?path=${encodeURIComponent(e)}`,{is_favorite:!0})}removeFavorite(e){return this.client.rest.put(`${ze}?path=${encodeURIComponent(e)}`,{is_favorite:!1})}createItem(e){return this.client.rest.post(ze,e)}createWorkDir(e){return this.client.rest.post(ze,e)}sizeWithSection(e){return this.client.rest.get(Xe,e)}}const Qe="/storage/files",Ze=`${Qe}/net`;class et{constructor(e){this.client=e}read(e,t){return t.path=e,this.client.rest.get(Qe,t)}replace(e,t){const s=new URLSearchParams;return Object.keys(e).forEach((t=>{e[t]&&s.append(t,e[t])})),this.client.rest.put(`${Qe}?${s.toString()}`,t)}upload(e,t,s,i){const n=new FormData;n.set("path",s),i&&n.set("divide_id",i.toString()),n.set("file",t);const{promise:r,abort:o}=this.client.rest.upload(Qe,n,{onUploadProgress:t=>{e(t)}});return{promise:r,abort:o}}uploadNet(e){return this.client.rest.post(Ze,e)}}class tt{constructor(e){this.client=e}instance(){return this.client.rest.get("/storage/instance")}}const st="/storage/element/share";class it{constructor(e){this.client=e}info(e){return this.client.rest.get(st,{path:e})}create(e,t){const s={path:e,permissions_type:t};return this.client.rest.post(st,s)}change(e){return this.client.rest.put(`${st}/${e.token}`,e)}delete(e){return this.client.rest.delete(st,{path:e})}refresh(e){return this.client.rest.put(`${st}/${e}/refresh`)}}const nt="/storage/trash/element",rt=`${nt}/all`;class ot{constructor(e){this.client=e}clear(e){return this.client.rest.delete(nt,e)}clearAll(){return this.client.rest.delete(rt)}restore(e){return this.client.rest.patch(nt,{del_groups:e})}restoreAll(){return this.client.rest.patch(rt)}}const ct="/users",at=`${ct}/me`,lt=`${at}/avatars`,ht=`${at}/sessions`,ut=`${at}/tokens`,dt=`${at}/params`,pt=`${at}/change-password`,gt=`${ct}/initial`,_t=`${at}/phone`,ft=`${_t}/confirm`;class vt{constructor(e){this.client=e}initial(e){return this.client.rest.post(gt,e)}list(e){return this.client.rest.get(ct,e)}get(e){return this.client.rest.get(ct+`/${e}`)}create(e){return this.client.rest.post(ct,e)}update(e,t){return this.client.rest.put(ct+`/${e}`,t)}delete(e,t){return this.client.rest.delete(`${ct}/${e}`,t)}restore(e){return this.client.rest.post(`${ct}/${e}/restore`)}me(){return this.client.rest.get(at)}updateMe(e){return this.client.rest.put(at,e)}createToken(e){return this.client.rest.post(ut,e)}listToken(e){return this.client.rest.get(ut,e)}deleteToken(e){return this.client.rest.delete(`${ut}/${e}`)}changeMyPassword(e){return this.client.rest.put(pt,e)}changeUsersPassword(e,t){return this.client.rest.put(`${ct}/${e}/change-password`,t)}meUploadAvatar(e,t){const s=new FormData;return s.append("file",e,t),this.client.rest.post(lt,s)}meDeleteAvatar(){return this.client.rest.delete(lt)}meListSession(e){return this.client.rest.get(ht,e)}meDeleteSession(e){let t=ht;return e&&(t+=`/${e}`),this.client.rest.delete(t)}setRole(e,t=null){return this.client.rest.put(`${ct}/${e}/roles`,{role_id:t})}meParams(e){return this.client.rest.get(dt,{name:e})}meSetParams(e,t){return this.client.rest.post(`${dt}/${e}`,t)}meListParams(){return this.client.rest.get(dt)}phone(e){return this.client.rest.post(_t,e)}phoneConfirm(e){return this.client.rest.post(`${ft}/${e}`)}}const $t="/storage/element",mt=`${$t}/history`,kt=`${$t}/version`,bt=`${kt}/lock`,wt=`${kt}/unlock`,St=`${kt}/current`,yt=`${kt}/size`;class xt{constructor(e){this.client=e}history(e){return this.client.rest.get(mt,e)}versions(e){return this.client.rest.get(kt,e)}create(e){return this.client.rest.post(kt,e)}edit(e){return this.client.rest.put(kt,e)}delete(e){return this.client.rest.delete(kt,e)}size(e){return this.client.rest.get(yt,e)}makeCurrent(e){return this.client.rest.post(St,e)}lock(e){return this.client.rest.post(bt,e)}unlock(e){return this.client.rest.post(wt,e)}}export{r as AccessRights,n as AuthApiService,re as BASE_URL_V1,oe as BASE_URL_V2,o as CONNECTIONS_PERMISSION,ae as Client,l as ConnectionGroup,h as ConnectionType,q as ConnectionsApiService,G as DiscoveryApiService,V as DivideApiService,v as DivideMode,p as DivideScope,a as EngineType,d as ExtensionFileMode,u as ExtensionType,pe as ExtensionsApiService,_e as ExtensionsExternalApiService,$e as FcaApiService,ke as GatewayApiService,Se as GroupApiService,Ae as LicenseApiService,k as LicenseError,w as LimitationSubType,b as LimitationType,De as LimitationsApiService,Ue as LinksApiService,Ee as LogstashApiService,ie as NEED_TOKEN_UPDATE_ERROR,y as NotificationAction,je as NotificationApiService,S as NotificationEntityType,x as NotificationRowAction,C as NotificationStyle,c as OrderDirection,g as PermissionType,be as QueryInitViewType,T as RequestMethod,U as RequestObserve,A as ResponseType,ce as Rest,f as RestrictionBooleanStatus,$ as RestrictionModeKey,P as RestrictionSharing,_ as RestrictionStatus,Be as RoleApiService,I as SettingControlType,Ge as ShareApiService,Ke as StorageElementApiService,W as StorageElementCheckStatus,j as StorageElementContentType,H as StorageElementHistoryAction,L as StorageElementType,et as StorageFilesApiService,tt as StorageInstanceApiService,N as StorageRoot,it as StorageShareApiService,ot as StorageTrashApiService,m as Tariff,ne as TokenUpdate,vt as UserApiService,D as UserAuthType,R as UserParamsLabel,E as UserStatus,O as UserType,xt as VersionApiService,Q as applyInterceptors,Z as getCookieValue,ee as makeUrlParams,te as normalizeHeaders,se as prepareRequestBody};
1
+ const e="/login",t=`${e}/ldap`,s=`${e}/update`,i=`${e}/tfa`;class n{constructor(e){this.client=e}info(){return this.client.rest.get(e)}login(t){return this.client.rest.post(e,t)}ldapLogin(e){return this.client.rest.post(t,e)}loginTfa(e){return this.client.rest.post(i,e)}updateToken(e){const t=e.path?`${e.path}/${s}`:s;return e.path&&delete e.path,this.client.rest.post(t,e)}logout(){return this.client.rest.post("/logout")}}var r;!function(e){e.LicenseRead="license_read",e.LicenseManage="license_edit",e.UsersRead="users_read",e.UsersCreate="users_create",e.UsersActivate="users_activate",e.GroupsRead="groups_read",e.GroupsCreate="groups_create",e.RolesRead="roles_read",e.RolesCreate="roles_create",e.Share="share",e.Divide="divide",e.ExtensionsRead="extensions_read",e.ExtensionsManage="extensions_write",e.RestrictionShareRead="restriction_share_read",e.RestrictionShareWrite="restriction_share_write",e.RestrictionDivideRead="restriction_divide_read",e.RestrictionDivideWrite="restriction_divide_write",e.ReadUserLogs="read_user_logs",e.ConnectionsRead="connections_read",e.ConnectionsDividing="connections_dividing",e.ConnectionsYandexDisk="connections_yandex_disk",e.ConnectionsSsh="connections_ssh",e.ConnectionsMail="connections_mail",e.ConnectionsS3="connections_s3",e.ConnectionsDiscord="connections_discord",e.ConnectionsWebdav="connections_webdav",e.ConnectionsNextcloud="connections_nextcloud",e.ConnectionsNextbox="connections_nextbox",e.ConnectionsHttpProxy="connections_http_proxy",e.SystemInfoServiceList="system_info_service_list",e.SettingsRead="settings_read",e.SettingsWrite="settings_write"}(r||(r={}));const o=[r.ConnectionsYandexDisk,r.ConnectionsSsh,r.ConnectionsMail,r.ConnectionsS3,r.ConnectionsS3,r.ConnectionsDiscord,r.ConnectionsWebdav,r.ConnectionsNextcloud,r.ConnectionsNextbox,r.ConnectionsHttpProxy];var c,a,l,h,u,d,p,g,_,f,$,v,m,k,w,b,S,y,x,A,C,T,U,P,D,E,O,R,I,L,j,N,H,W;!function(e){e.DEFAULT="",e.ASC="asc",e.DESC="desc"}(c||(c={})),function(e){e.WebSocket="websocket",e.PostMessage="postmessage",e.Empty=""}(a||(a={})),function(e){e.Storages="storages_connections_group",e.Webhooks="webhooks_connections_group",e.Unknown="unknown_connections_group",e.Proxy="proxy_connections_group"}(l||(l={})),function(e){e.SSH="ssh_connection",e.YandexDisk="yandex_disk",e.Mail="mail",e.Discord="discord",e.Webdav="webdav_connection",e.Nextcloud="nextcloud_connection",e.NextBox="nextbox_connection",e.HttpProxy="http_proxy_connection",e.S3="s3_connection"}(h||(h={})),function(e){e.App="app",e.File="file",e.WorkDir="work_dir"}(u||(u={})),function(e){e.Read="read",e.ReadAndWrite="read_and_write",e.Write="write"}(d||(d={})),function(e){e.Storage="/storage/element",e.Connection="/connections"}(p||(p={})),function(e){e.CLOSE="",e.READ="r",e.WRITE="rw"}(g||(g={})),function(e){e.WAITING="waiting",e.APPROVED="approved",e.REJECTED="rejected"}(_||(_={})),function(e){e.TRUE="true",e.FALSE="false"}(f||(f={})),function(e){e.User="to_user_id",e.Group="to_user_group_id"}($||($={})),function(e){e.Divide="divide",e.Share="share"}(v||(v={})),function(e){e.Free="free",e.Business="business",e.Enterprise="enterprise"}(m||(m={})),function(e){e.NotActivated="License not activated",e.Blocked="License blocked",e.Expired="License has been expired",e.NotValid="License not valid",e.NotFound="license file not found"}(k||(k={})),function(e){e.BySize="size",e.ByExt="extension"}(w||(w={})),function(e){e.Size="size",e.White="extension_white",e.Black="extension_black"}(b||(b={})),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"}(S||(S={})),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.Other="other"}(y||(y={})),function(e){e.Read="read",e.Unread="unread",e.Delete="delete"}(x||(x={})),function(e){e.Plain="plain",e.Success="success",e.Info="info",e.Warning="warning",e.Error="error"}(A||(A={})),function(e){e.ArrayBuffer="arraybuffer",e.Blob="blob",e.Json="json",e.Text="text"}(C||(C={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.PATCH="PATCH",e.DELETE="DELETE"}(T||(T={})),function(e){e.Body="body",e.Response="response"}(U||(U={})),function(e){e.NONE="none",e.SOFT="soft",e.HARD="hard"}(P||(P={})),function(e){e.Native="native",e.Ldap="ldap",e.Vk="vk"}(D||(D={})),function(e){e.Registering="registering",e.Activated="activated",e.Blocked="blocked",e.BlockedByLicense="blocked_by_license"}(E||(E={})),function(e){e.User="user",e.Guest="guest",e.Emperor="emperor",e.Anonymous="anonymous"}(O||(O={})),function(e){e.Theme="theme",e.Lang="lang",e.Sort="sort",e.ViewApps="viewApps"}(R||(R={})),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"}(I||(I={})),function(e){e.Dir="dir",e.File="file",e.WorkDir="work_dir"}(L||(L={})),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"}(j||(j={})),function(e){e.my="my",e.fca="fca",e.divide="divide",e.share="share",e.favorite="favorite",e.trash="trash"}(N||(N={})),function(e){e.Create="create",e.Update="update",e.Move="move"}(H||(H={})),function(e){e[e.CheckNull=0]="CheckNull",e[e.CheckInProgress=1]="CheckInProgress",e[e.CheckPositive=2]="CheckPositive",e[e.CheckNegative=3]="CheckNegative"}(W||(W={}));const B="/connections",F=`${B}/dashboard`;class q{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={[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]||B,e)}dashboard(e){return this.client.rest.get(F,e)}}class M{constructor(e){this.client=e}discovery(e){return this.client.rest.get("/discovery",e)}}const G="/divide",V=`${G}/restrictions`;class z{constructor(e){this.client=e}divideDelete(e,t){return this.client.rest.delete(`${e}/${G}/${t}`)}divideDeleteAll(e,t,s,i){return this.client.rest.delete(`${e}/${G}`,Object.assign(Object.assign({},this.makeParam(e,t)),{is_to_user_group:i,access_mode:s}))}divideChange(e,t,s){return this.client.rest.put(`${e}/divide/${t}`,{access_mode:s})}divideCreate(e,t,s,i,n){const r=Object.assign(Object.assign({},this.makeParam(e,t)),{[n]:s,access_mode:i});return this.client.rest.post(`${e}/${G}`,r)}divideUsers(e,t,s){return this.client.rest.get(`${e}/${G}/users`,Object.assign(Object.assign({},this.makeParam(e,t)),s))}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===p.Connection?s.connection_id=t:s.path=t,s}}function J(e,t,s,i){return new(s||(s=Promise))((function(n,r){function o(e){try{a(i.next(e))}catch(e){r(e)}}function c(e){try{a(i.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?n(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,c)}a((i=i.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class X extends Error{}function Y(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return function(e){return decodeURIComponent(atob(e).replace(/(.)/g,((e,t)=>{let s=t.charCodeAt(0).toString(16).toUpperCase();return s.length<2&&(s="0"+s),"%"+s})))}(t)}catch(e){return atob(t)}}function K(e,t){if("string"!=typeof e)throw new X("Invalid token specified: must be a string");t||(t={});const s=!0===t.header?0:1,i=e.split(".")[s];if("string"!=typeof i)throw new X(`Invalid token specified: missing part #${s+1}`);let n;try{n=Y(i)}catch(e){throw new X(`Invalid token specified: invalid base64 for part #${s+1} (${e.message})`)}try{return JSON.parse(n)}catch(e){throw new X(`Invalid token specified: invalid json for part #${s+1} (${e.message})`)}}X.prototype.name="InvalidTokenError";const Q=(e,t)=>J(void 0,void 0,void 0,(function*(){let s=t;for(const t of e)try{s=yield t.fulfilled(s)}catch(e){if(!t.rejected)throw e;s=yield t.rejected(e)}return s}));function Z(e){var t;return null!==(t=Object.fromEntries(document.cookie.split(";").map((e=>e.split("="))).map((([e,t])=>[e.trim(),decodeURIComponent(t||"")])))[e])&&void 0!==t?t:null}const ee=e=>{const t=new URLSearchParams;return Object.keys(e).forEach((s=>{Array.isArray(e[s])?e[s].forEach((e=>{t.append(s,e)})):t.append(s,e[s])})),t};function te(e){return e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):e}function se(e){return e?e instanceof FormData||e instanceof Blob||e instanceof ArrayBuffer||e instanceof URLSearchParams||e instanceof Document||ArrayBuffer.isView(e)?e:"object"==typeof e?JSON.stringify(e):"string"==typeof e?e:null:null}const ie="update black token";class ne{constructor(){this.isUpdating=!1,this.tokenUpdateResolve=null}isTokenExpire(e){if(!e)return!1;return 1e3*e<=(new Date).getTime()+3e3}refreshToken(e,t){return J(this,void 0,void 0,(function*(){const{access_token:s,refresh_token:i}=e;return s&&i?this.isUpdating?this.waitForTokenUpdate():(this.isUpdating=!0,new Promise(((e,n)=>{const r=new XMLHttpRequest,o=`${t}${re}/login/update`;r.open("POST",o,!0),r.setRequestHeader("Content-Type","application/json"),r.send(JSON.stringify({access_token:s,refresh_token:i})),r.onload=()=>{if(r.status>=200&&r.status<300)try{const t=JSON.parse(r.responseText);if(t&&t.access_token&&t.refresh_token){const s={access_token:t.access_token,refresh_token:t.refresh_token};Z("access_token")===s.access_token&&localStorage.setItem("refresh-token",s.refresh_token),this.tokenUpdateResolve&&(this.tokenUpdateResolve(s),this.tokenUpdateResolve=null),e(s)}else e(null)}catch(e){n(new Error("Failed to parse response JSON."))}else e(null)},r.onerror=()=>{n(new Error("Network error occurred"))},r.onloadend=()=>{this.isUpdating=!1}}))):null}))}waitForTokenUpdate(){return J(this,void 0,void 0,(function*(){return new Promise((e=>{const t=setInterval((()=>{this.isUpdating||(clearInterval(t),e())}),100)}))}))}}const re="/api/v1",oe="/api/v2";class ce{constructor(e,t){this.client=e,this.tokenUpdate=t,this.baseHost=""}get state(){return this.client.state}get(e,t,s){return this.request(T.GET,e,Object.assign({params:t,cache:"no-cache"},s))}post(e,t,s){return this.request(T.POST,e,Object.assign({body:t},s))}put(e,t,s){return this.request(T.PUT,e,Object.assign({body:t,cache:"no-cache"},s))}patch(e,t,s){return this.request(T.PATCH,e,Object.assign({body:t},s))}delete(e,t,s){return this.request(T.DELETE,e,Object.assign({params:t},s))}upload(e,t,s){const i=new AbortController,n=i.signal;return{promise:this.request(T.POST,e,Object.assign({body:t,signal:n},s)),abort:()=>i.abort()}}request(e,t,s){return J(this,void 0,void 0,(function*(){return new Promise(((i,n)=>J(this,void 0,void 0,(function*(){var r;const o=null!==(r=this.state.skipInterceptors)&&void 0!==r&&r;this.state.skipInterceptors=!1;let c=Object.assign({method:e},s);if((null==s?void 0:s.signal)&&(c.signal=s.signal),o||(s=yield Q(this.client.requestInterceptors,c)),this.state.authToken)for(const[e,i]of this.state.authToken.entries()){const n=K(i.access_token);if(n&&n.is_remember&&this.tokenUpdate.isTokenExpire(n.exp)&&!t.includes("/login")&&!t.includes("/assets")){const t=yield this.tokenUpdate.refreshToken(i,this.baseHost);t&&(this.state.authToken.set(e,t),s=yield Q(this.client.requestInterceptors,c))}}const a=new XMLHttpRequest;(null==s?void 0:s.params)&&0!==Object.keys(s.params).length&&(t+="?"+ee(s.params));const l=`${this.state.clientParams.host}${this.state.clientParams.version}${t}`;if(a.open(e,l,!0),null==s?void 0:s.headers){const e=te(s.headers);for(const[t,s]of Object.entries(e))(this.state.clientParams.host===this.baseHost||"content-type"!==t.toLowerCase())&&a.setRequestHeader(t,s)}(null==s?void 0:s.responseType)&&(a.responseType=s.responseType),(null==s?void 0:s.signal)&&s.signal.addEventListener("abort",(()=>{a.abort(),n(new Error("Upload aborted"))})),a.upload&&[T.POST,T.PUT,T.PATCH].includes(e)&&(a.upload.onprogress=e=>{e.lengthComputable&&(null==s?void 0:s.onUploadProgress)&&s.onUploadProgress(e)}),a.onload=()=>J(this,void 0,void 0,(function*(){if((null==s?void 0:s.signal)&&s.signal.aborted)return;let e;switch(null==s?void 0:s.responseType){case C.Text:e=a.responseText;break;case C.Blob:case C.ArrayBuffer:e=a.response;break;default:try{e=JSON.parse(a.responseText)}catch(t){e=a.responseText}}const t=new Headers;a.getAllResponseHeaders().split("\r\n").forEach((e=>{const[s,i]=e.split(": ");s&&i&&t.append(s,i)}));let r={status:a.status,statusText:a.statusText,headers:t,url:a.responseURL};if(a.status>=200&&a.status<300)(null==s?void 0:s.observe)===U.Response?i(Object.assign(Object.assign({},r),{body:e})):i(e);else{if(this.state.authToken&&e.code===ie){const e=yield this.tokenUpdate.refreshToken(this.state.authToken.get(0),this.baseHost);e&&this.state.authToken.set(0,e)}s=yield Q(this.client.responseInterceptors,Object.assign(Object.assign({},r),{error:e})),n(Object.assign(Object.assign({},r),{error:e}))}r=yield Q(this.client.responseInterceptors,r)})),a.onerror=()=>{n({status:a.status,statusText:a.statusText,url:a.responseURL,error:"Network error"})},a.send(se(null==s?void 0:s.body))}))))}))}changeBaseUrlVersion(e,t){return J(this,void 0,void 0,(function*(){const s=this.state.clientParams.version;this.state.clientParams.version=e;try{return yield t()}finally{this.state.clientParams.version=s}}))}changeHost(e,t){return J(this,void 0,void 0,(function*(){this.state.clientParams.host=e,this.state.requestParams.headers={};try{return yield t()}finally{this.state.clientParams.host=this.baseHost}}))}}class ae{constructor(e){this.AuthApiService=new n(this),this.ConnectionsApiService=new q(this),this.DiscoveryApiService=new M(this),this.DivideApiService=new z(this),this.ExtensionsApiService=new pe(this),this.ExtensionsExternalApiService=new _e(this),this.FcaApiService=new ve(this),this.GatewayApiService=new ke(this),this.GroupApiService=new Se(this),this.LicenseApiService=new Ce(this),this.LinksApiService=new Ue(this),this.LimitationsApiService=new De(this),this.LogstashApiService=new Ee(this),this.NotificationApiService=new je(this),this.RoleApiService=new Be(this),this.ShareApiService=new Me(this),this.StorageCommentApiService=new ze(this),this.StorageElementApiService=new tt(this,this.FcaApiService),this.StorageFilesApiService=new nt(this),this.StorageInstanceApiService=new rt(this),this.StorageShareApiService=new ct(this),this.StorageTrashApiService=new ht(this),this.UserApiService=new wt(this),this.VersionApiService=new Ut(this),this.tokenUpdate=new ne,this.rest=new ce(this,this.tokenUpdate),this.requestInterceptors=[],this.responseInterceptors=[],this.request={use:(e,t)=>{this.requestInterceptors.push({fulfilled:e,rejected:t})}},this.response={use:(e,t)=>{this.responseInterceptors.push({fulfilled:e,rejected:t})}},this.state={clientParams:{host:null==e?void 0:e.host,version:(null==e?void 0:e.version)||re},requestParams:{path:"",headers:{},query:{},body:null,cache:"no-cache"},authToken:null,skipInterceptors:!1},this.rest.baseHost=this.state.clientParams.host||""}}const le="/static/extensions",he="/extensions/defaults",ue=`${le}/names/users`,de=`${le}/names/system`;class pe{constructor(e){this.client=e}getSetting(e){return this.client.rest.get(`${le}/${e}/settings`)}setSetting(e,t){return this.client.rest.post(`${le}/${e}/settings`,t)}deleteSetting(e){return this.client.rest.delete(`${le}/${e}/settings`)}get(e){return this.client.rest.get(`${le}/${e}`)}getByKey(e){return this.client.rest.get(`${le}/${e}`)}getDefault(e=[]){return this.client.rest.get(he,{ext_code:e})}setDefault(e,t){return this.client.rest.post(he,{ext_code:e,ext_uniq_key:t})}checkUpdates(){return this.client.rest.post(`${le}/check_updates`)}updateVersion(e,t){return this.client.rest.put(`${le}/${e}`,{version:t})}list(e){return this.client.rest.get(le,e)}delete(e,t){return this.client.rest.delete(`${le}/${e}`)}upload(e,t){const s=new FormData;s.set("file",t);const{promise:i,abort:n}=this.client.rest.upload(le,s,{onUploadProgress:t=>{e(t)}});return{promise:this.client.rest.changeBaseUrlVersion(oe,(()=>i)),abort:n}}install(e,t){return this.client.rest.changeBaseUrlVersion(oe,(()=>this.client.rest.post(`${le}/site`,{uniq_key:e,version:t})))}getSystemNameExts(e){return this.client.rest.get(de,e)}getUserNameExts(e){return this.client.rest.get(ue,e)}createUserNameExt(e){return this.client.rest.post(`${ue}`,{name:e})}deleteUserNameExt(e){return this.client.rest.delete(`${ue}/${e}`)}deleteAllUserNameExts(){return this.client.rest.delete(`${ue}`)}}const ge="/anons_ext/extensions";class _e{constructor(e){this.client=e}listExtensionsSite(e){return this.client.rest.changeHost("https://next-box.ru",(()=>this.client.rest.get(ge,e)))}extensionDetailSite(e){return this.client.rest.changeHost("https://next-box.ru",(()=>this.client.rest.get(`${ge}/${e}`)))}extensionMarkdown(e,t){return this.client.rest.changeHost("https://next-box.ru",(()=>this.client.rest.get(`${ge}/${e}/readme`,{},t)))}}const fe="/disk",$e=`${fe}/check`;class ve{constructor(e){this.client=e}info(e,t){return this.client.rest.get(`${fe}/${e}/element`,{path:t})}list(e,t){return this.client.rest.get(`${fe}/${e}`,t)}create(e,t){return this.client.rest.post(`${fe}/${e}/element`,t)}replace(e,t,s){return this.client.rest.put(`${fe}/${e}/files?path=${t}`,s)}read(e,t){return this.client.rest.get(`${fe}/${e}/files?path=${t}`)}upload(e,t,s,i=""){const n=new FormData;n.set("path",i),n.set("file",s);const{promise:r,abort:o}=this.client.rest.upload(`${fe}/${t}/files`,n,{onUploadProgress:t=>{e(t)}});return{promise:r,abort:o}}uploadNet(e,t){return this.client.rest.post(`${fe}/${e}/files/net`,t)}delete(e,t){return this.client.rest.delete(`${fe}/${e}/trash/element`,{path:t})}check(e){return this.client.rest.post($e,e)}}const me="/settings";class ke{constructor(e){this.client=e}settings(){return this.client.rest.get(me)}changeSettings(e){return this.client.rest.post(me,e)}queryInit(){return this.client.rest.get("/query/init")}}var we;!function(e){e.Standard="Standard",e.Simple="Simple"}(we||(we={}));const be="/groups";class Se{constructor(e){this.client=e}list(e){return this.client.rest.get(be,e)}listUsers(e){return this.client.rest.get(`${be}/${e}/users`)}create(e){return this.client.rest.post(be,e)}update(e,t){return this.client.rest.put(`${be}/${e}`,t)}delete(e){return this.client.rest.delete(`${be}/${e}`)}}const ye="/license",xe=`${ye}/manual-check`,Ae=`${ye}/hardware/hash`;class Ce{constructor(e){this.client=e}info(){return this.client.rest.get(ye)}create(e){return this.client.rest.post(ye,e)}check(){return this.client.rest.post(xe)}delete(){return this.client.rest.delete(ye)}getHash(){return this.client.rest.get(Ae)}}const Te="/links";class Ue{constructor(e){this.client=e}createShortLink(e){return this.client.rest.post(Te,e)}updateShortLink(e){return this.client.rest.put(Te,e)}}const Pe="/limitations";class De{constructor(e){this.client=e}list(e){return this.client.rest.get(Pe,e)}listUsers(e,t){return this.client.rest.get(`${Pe}/${e}/users`,t)}create(e){return this.client.rest.post(Pe,e)}get(e){return this.client.rest.get(`${Pe}/${e}`)}update(e,t){return this.client.rest.put(`${Pe}/${e}`,t)}delete(e){return this.client.rest.delete(`${Pe}/${e}`)}getLimitationsByUser(e){return this.client.rest.get(`/limitations/user/${e}`)}addUserToLimitation(e,t){return this.client.rest.patch(`${Pe}/${e}/user`,{id:t})}deleteUserFromLimitation(e,t){return this.client.rest.delete(`${Pe}/${e}/user/${t}`)}}class Ee{constructor(e){this.client=e}getUsersLogs(e){return this.client.rest.get("/logs/users",e)}}const Oe="/notifications",Re=`${Oe}/all`,Ie=`${Oe}/subscription`,Le=`${Oe}/permission`;class je{constructor(e){this.client=e}list(e){return this.client.rest.get(Oe,e)}toggleStatus(e,t){return this.client.rest.put(Oe,{ids:e,to_status:t})}toggleAllStatus(e){return this.client.rest.put(Re,{to_status:e})}delete(e){return this.client.rest.delete(Oe,{id:e})}deleteAll(){return this.client.rest.delete(Re)}getPermission(){return this.client.rest.get(Le)}setPermission(e){return this.client.rest.post(Le,{enabled:e})}getSubscription(){return this.client.rest.get(Ie)}setSubscription(e){const t={action_groups:Object.assign({},e)};return this.client.rest.post(Ie,t)}}const Ne="/roles",He=`${Ne}/default`,We="/permissions";class Be{constructor(e){this.client=e}list(e){return this.client.rest.get(Ne,e)}get(e){return this.client.rest.get(`${Ne}/${e}`)}getDefault(){return this.client.rest.get(`${He}`)}create(e){return this.client.rest.post(Ne,e)}update(e,t){return this.client.rest.put(`${Ne}/${e}`,t)}delete(e){return this.client.rest.delete(`${Ne}/${e}`)}permissionList(){return this.client.rest.get(We)}addPermission(e,t){return this.client.rest.put(`${Ne}/${e}/permissions`,{ids:t})}deletePermission(e,t){return this.client.rest.delete(`${Ne}/${e}/${We}`,{ids:t})}}const Fe="/share",qe=`${Fe}/restrictions`;class Me{constructor(e){this.client=e}info(e,t){const s=new URLSearchParams({path:e,share_token:t});return this.client.rest.get(`${Fe}?${s.toString()}`)}checkPassword(e,t){const s=encodeURIComponent(e);return this.client.rest.get(`${Fe}/password?share_token=${t}&share_pass=${s}`)}checkToken(e){return this.client.rest.get(`${Fe}?share_token=${e}`)}getRestriction(e){return this.client.rest.get(`${qe}/${e}`)}restrictions(e){return this.client.rest.get(qe,e)}restrictionsChange(e,t){return this.client.rest.put(`${qe}/${e}`,t)}}const Ge="/storage/element/version/comment",Ve=`${Ge}/all`;class ze{constructor(e){this.client=e}list(e){return this.client.rest.get(`${Ge}`,e)}create(e){return this.client.rest.post(`${Ge}`,e)}update(e){return this.client.rest.put(`${Ge}`,e)}delete(e){return this.client.rest.delete(`${Ge}`,e)}deleteAll(e){return this.client.rest.delete(`${Ve}`,e)}}const Je="/storage",Xe=`${Je}/element`,Ye=`${Xe}/divide/resource`,Ke=`${Xe}/move`,Qe=`${Xe}/copy`,Ze=`${Xe}/content_type_size`,et="/disk";class tt{constructor(e,t){this.client=e,this.fcaApiService=t}list(e){return this.client.rest.get(Je,e)}info(e){var t;return parseInt((null===(t=e.divide_id)||void 0===t?void 0:t.toString())||"")||delete e.divide_id,e.file_version_id||delete e.file_version_id,this.client.rest.get(Xe,e)}combineInfo({root:e,rootId:t,path:s,file_version_id:i}){return e===N.fca&&t?this.fcaApiService.info(t,s):this.info({path:s,divide_id:t,file_version_id:i})}size(e){return this.client.rest.post(`${Xe}/size`,e)}move(e,t,s){const{from_divide_id:i,to_divide_id:n}=e;let r=Object.assign(Object.assign({},e),{from_divide_id:null,to_divide_id:null});return t===N.fca&&s===N.fca?this.client.rest.post(`${et}/${i}/files/move${et}/${n}`,r):t===N.fca?(i&&(r.from_divide_id=i),this.client.rest.put(`${et}/${n}/files/from/box`,r)):s===N.fca?(n&&(r.to_divide_id=n),this.client.rest.put(`${et}/${i}/files/to/box`,r)):this.client.rest.post(Ke,e)}copy(e,t,s){const{from_divide_id:i,to_divide_id:n}=e;let r=Object.assign(Object.assign({},e),{from_divide_id:null,to_divide_id:null});return s===N.fca&&t===N.fca?this.client.rest.post(`${et}/${i}/files/copy${et}/${n}`,r):s===N.fca?(i&&(r.from_divide_id=i),this.client.rest.post(`${et}/${n}/files/from/box`,r)):t===N.fca?(n&&(r.to_divide_id=n),this.client.rest.post(`${et}/${i}/files/to/box`,r)):this.client.rest.post(Qe,e)}pasteFromShared(e,t,s){const i={from_sharing_token:e,from_sharing_password:s,paths:t};return this.client.rest.post(`${Xe}/copy`,i)}create(e){return this.client.rest.post(Xe,e)}delete(e,t){const s={path:e};return t&&(s.divide_id=t),this.client.rest.delete(Xe,s)}favorite(e){return this.client.rest.put(`${Xe}?path=${encodeURIComponent(e)}`,{is_favorite:!0})}removeFavorite(e){return this.client.rest.put(`${Xe}?path=${encodeURIComponent(e)}`,{is_favorite:!1})}createItem(e){return this.client.rest.post(Xe,e)}createWorkDir(e){return this.client.rest.post(Xe,e)}sizeWithSection(e){return this.client.rest.get(Ze,e)}getDivideResources(e){return this.client.rest.get(Ye,e)}}const st="/storage/files",it=`${st}/net`;class nt{constructor(e){this.client=e}read(e,t){return t.path=e,this.client.rest.get(st,t)}replace(e,t){const s=new URLSearchParams;return Object.keys(e).forEach((t=>{e[t]&&s.append(t,e[t])})),this.client.rest.put(`${st}?${s.toString()}`,t)}upload(e,t,s,i){const n=new FormData;n.set("path",s),i&&n.set("divide_id",i.toString()),n.set("file",t);const{promise:r,abort:o}=this.client.rest.upload(st,n,{onUploadProgress:t=>{e(t)}});return{promise:r,abort:o}}uploadNet(e){return this.client.rest.post(it,e)}}class rt{constructor(e){this.client=e}instance(){return this.client.rest.get("/storage/instance")}}const ot="/storage/element/share";class ct{constructor(e){this.client=e}info(e){return this.client.rest.get(ot,{path:e})}create(e,t){const s={path:e,permissions_type:t};return this.client.rest.post(ot,s)}change(e){return this.client.rest.put(`${ot}/${e.token}`,e)}delete(e){return this.client.rest.delete(ot,{path:e})}refresh(e){return this.client.rest.put(`${ot}/${e}/refresh`)}}const at="/storage/trash/element",lt=`${at}/all`;class ht{constructor(e){this.client=e}clear(e){return this.client.rest.delete(at,e)}clearAll(){return this.client.rest.delete(lt)}restore(e){return this.client.rest.patch(at,{del_groups:e})}restoreAll(){return this.client.rest.patch(lt)}}const ut="/users",dt=`${ut}/me`,pt=`${dt}/avatars`,gt=`${dt}/sessions`,_t=`${dt}/tokens`,ft=`${dt}/params`,$t=`${dt}/change-password`,vt=`${ut}/initial`,mt=`${dt}/phone`,kt=`${mt}/confirm`;class wt{constructor(e){this.client=e}initial(e){return this.client.rest.post(vt,e)}list(e){return this.client.rest.get(ut,e)}get(e){return this.client.rest.get(ut+`/${e}`)}create(e){return this.client.rest.post(ut,e)}update(e,t){return this.client.rest.put(ut+`/${e}`,t)}delete(e,t){return this.client.rest.delete(`${ut}/${e}`,t)}restore(e){return this.client.rest.post(`${ut}/${e}/restore`)}me(){return this.client.rest.get(dt)}updateMe(e){return this.client.rest.put(dt,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($t,e)}changeUsersPassword(e,t){return this.client.rest.put(`${ut}/${e}/change-password`,t)}meUploadAvatar(e,t){const s=new FormData;return s.append("file",e,t),this.client.rest.post(pt,s)}meDeleteAvatar(){return this.client.rest.delete(pt)}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(`${ut}/${e}/roles`,{role_id:t})}meParams(e){return this.client.rest.get(ft,{name:e})}meSetParams(e,t){return this.client.rest.post(`${ft}/${e}`,t)}meListParams(){return this.client.rest.get(ft)}phone(e){return this.client.rest.post(mt,e)}phoneConfirm(e){return this.client.rest.post(`${kt}/${e}`)}}const bt="/storage/element",St=`${bt}/history`,yt=`${bt}/version`,xt=`${yt}/lock`,At=`${yt}/unlock`,Ct=`${yt}/current`,Tt=`${yt}/size`;class Ut{constructor(e){this.client=e}history(e){return this.client.rest.get(St,e)}versions(e){return this.client.rest.get(yt,e)}create(e){return this.client.rest.post(yt,e)}edit(e){return this.client.rest.put(yt,e)}delete(e){return this.client.rest.delete(yt,e)}size(e){return this.client.rest.get(Tt,e)}makeCurrent(e){return this.client.rest.post(Ct,e)}lock(e){return this.client.rest.post(xt,e)}unlock(e){return this.client.rest.post(At,e)}}export{r as AccessRights,n as AuthApiService,re as BASE_URL_V1,oe as BASE_URL_V2,o as CONNECTIONS_PERMISSION,ae as Client,l as ConnectionGroup,h as ConnectionType,q as ConnectionsApiService,M as DiscoveryApiService,z as DivideApiService,$ as DivideMode,p as DivideScope,a as EngineType,d as ExtensionFileMode,u as ExtensionType,pe as ExtensionsApiService,_e as ExtensionsExternalApiService,ve as FcaApiService,ke as GatewayApiService,Se as GroupApiService,Ce as LicenseApiService,k as LicenseError,b as LimitationSubType,w as LimitationType,De as LimitationsApiService,Ue as LinksApiService,Ee as LogstashApiService,ie as NEED_TOKEN_UPDATE_ERROR,y as NotificationAction,je as NotificationApiService,S as NotificationEntityType,x as NotificationRowAction,A as NotificationStyle,c as OrderDirection,g as PermissionType,we as QueryInitViewType,T as RequestMethod,U as RequestObserve,C as ResponseType,ce as Rest,f as RestrictionBooleanStatus,v as RestrictionModeKey,P as RestrictionSharing,_ as RestrictionStatus,Be as RoleApiService,I as SettingControlType,Me as ShareApiService,ze as StorageCommentApiService,tt as StorageElementApiService,W as StorageElementCheckStatus,j as StorageElementContentType,H as StorageElementHistoryAction,L as StorageElementType,nt as StorageFilesApiService,rt as StorageInstanceApiService,N as StorageRoot,ct as StorageShareApiService,ht as StorageTrashApiService,m as Tariff,ne as TokenUpdate,wt as UserApiService,D as UserAuthType,R as UserParamsLabel,E as UserStatus,O as UserType,Ut as VersionApiService,Q as applyInterceptors,Z as getCookieValue,ee as makeUrlParams,te as normalizeHeaders,se as prepareRequestBody};
@@ -1,4 +1,4 @@
1
- import { AuthApiService, ConnectionsApiService, DiscoveryApiService, DivideApiService, ExtensionsApiService, ExtensionsExternalApiService, FcaApiService, GatewayApiService, GroupApiService, LicenseApiService, LinksApiService, LimitationsApiService, LogstashApiService, NotificationApiService, RoleApiService, ShareApiService, StorageElementApiService, StorageFilesApiService, StorageInstanceApiService, StorageShareApiService, StorageTrashApiService, UserApiService, VersionApiService } from '../api';
1
+ import { AuthApiService, ConnectionsApiService, DiscoveryApiService, DivideApiService, ExtensionsApiService, ExtensionsExternalApiService, FcaApiService, GatewayApiService, GroupApiService, LicenseApiService, LinksApiService, LimitationsApiService, LogstashApiService, NotificationApiService, RoleApiService, ShareApiService, StorageElementApiService, StorageFilesApiService, StorageInstanceApiService, StorageShareApiService, StorageTrashApiService, UserApiService, VersionApiService, StorageCommentApiService } from '../api';
2
2
  import { NbAppState, NbClientParams } from '../types/base';
3
3
  import { Interceptor } from '../types/interceptor';
4
4
  import { Rest } from './rest';
@@ -21,6 +21,7 @@ export declare class Client {
21
21
  NotificationApiService: NotificationApiService;
22
22
  RoleApiService: RoleApiService;
23
23
  ShareApiService: ShareApiService;
24
+ StorageCommentApiService: StorageCommentApiService;
24
25
  StorageElementApiService: StorageElementApiService;
25
26
  StorageFilesApiService: StorageFilesApiService;
26
27
  StorageInstanceApiService: StorageInstanceApiService;
package/dist/index.d.ts CHANGED
@@ -117,6 +117,95 @@ interface SizeBySection {
117
117
  label: string;
118
118
  }
119
119
 
120
+ interface User {
121
+ id: number;
122
+ create_date: string;
123
+ update_date: string;
124
+ last_login_date: string;
125
+ login: string;
126
+ password: string;
127
+ first_name: string;
128
+ middle_name: string;
129
+ last_name: string;
130
+ email: string;
131
+ auth_type: UserAuthType;
132
+ avatar_path: string;
133
+ home_path: string;
134
+ status: UserStatus;
135
+ type: UserType;
136
+ role_id: number | null;
137
+ phone?: string;
138
+ }
139
+ type UserLabel = Pick<User, 'login' | 'email' | 'first_name' | 'middle_name' | 'last_name' | 'avatar_path'>;
140
+ interface UserInfo extends UserLabel {
141
+ id: number;
142
+ }
143
+ declare enum UserAuthType {
144
+ Native = "native",
145
+ Ldap = "ldap",
146
+ Vk = "vk"
147
+ }
148
+ declare enum UserStatus {
149
+ Registering = "registering",
150
+ Activated = "activated",
151
+ Blocked = "blocked",
152
+ BlockedByLicense = "blocked_by_license"
153
+ }
154
+ declare enum UserType {
155
+ User = "user",
156
+ Guest = "guest",
157
+ Emperor = "emperor",
158
+ Anonymous = "anonymous"
159
+ }
160
+ interface UserSession {
161
+ create_date: string;
162
+ expire_in: string;
163
+ ip: string;
164
+ user_agent: string;
165
+ id: number;
166
+ is_current?: boolean;
167
+ }
168
+ interface UserToken {
169
+ id: number;
170
+ name: string;
171
+ expire_in: string;
172
+ create_date: string;
173
+ token?: string;
174
+ }
175
+ interface UserGroup {
176
+ id: number;
177
+ name: string;
178
+ description: string;
179
+ amount_users: number;
180
+ create_date: string;
181
+ owner_id: number;
182
+ owner: UserLabel;
183
+ update_date: string;
184
+ icon: string;
185
+ icon_color: string;
186
+ }
187
+ interface UserRole {
188
+ id: number;
189
+ name: string;
190
+ description: string;
191
+ create_date: string;
192
+ update_date: string;
193
+ is_default: boolean;
194
+ owner_id: number;
195
+ grant_access_all: boolean;
196
+ permissions_id?: number[];
197
+ }
198
+ interface UserParams {
199
+ name: UserParamsLabel;
200
+ value: any;
201
+ }
202
+ declare enum UserParamsLabel {
203
+ Theme = "theme",
204
+ Lang = "lang",
205
+ Sort = "sort",
206
+ ViewApps = "viewApps"
207
+ }
208
+
120
209
  declare enum DivideScope {
121
210
  Storage = "/storage/element",
122
211
  Connection = "/connections"
@@ -196,6 +285,29 @@ interface ShareModel {
196
285
  password: string | null;
197
286
  expire_delta: number | null;
198
287
  }
288
+ interface DivideResourceParams extends RequestBaseParams {
289
+ path: string;
290
+ access_mode?: PermissionType;
291
+ divide_id?: number;
292
+ search?: string;
293
+ with_owner?: boolean;
294
+ }
295
+ interface ResourceAccess {
296
+ id: number;
297
+ access_mode: string;
298
+ comment: string;
299
+ create_date: string;
300
+ update_date: string;
301
+ moderator_id: number;
302
+ owner_id: number;
303
+ relative_path: string;
304
+ resource: string;
305
+ restriction_status: string;
306
+ to_user_group_id: number;
307
+ to_user_id: number;
308
+ type: string;
309
+ user_info: UserInfo;
310
+ }
199
311
 
200
312
  interface NbClientParams {
201
313
  host?: string;
@@ -276,6 +388,7 @@ declare class Client {
276
388
  NotificationApiService: NotificationApiService;
277
389
  RoleApiService: RoleApiService;
278
390
  ShareApiService: ShareApiService;
391
+ StorageCommentApiService: StorageCommentApiService;
279
392
  StorageElementApiService: StorageElementApiService;
280
393
  StorageFilesApiService: StorageFilesApiService;
281
394
  StorageInstanceApiService: StorageInstanceApiService;
@@ -332,91 +445,6 @@ declare enum AccessRights {
332
445
  }
333
446
  declare const CONNECTIONS_PERMISSION: AccessRights[];
334
447
 
335
- interface User {
336
- id: number;
337
- create_date: string;
338
- update_date: string;
339
- last_login_date: string;
340
- login: string;
341
- password: string;
342
- first_name: string;
343
- middle_name: string;
344
- last_name: string;
345
- email: string;
346
- auth_type: UserAuthType;
347
- avatar_path: string;
348
- home_path: string;
349
- status: UserStatus;
350
- type: UserType;
351
- role_id: number | null;
352
- phone?: string;
353
- }
354
- type UserLabel = Pick<User, 'login' | 'email' | 'first_name' | 'middle_name' | 'last_name' | 'avatar_path'>;
355
- declare enum UserAuthType {
356
- Native = "native",
357
- Ldap = "ldap",
358
- Vk = "vk"
359
- }
360
- declare enum UserStatus {
361
- Registering = "registering",
362
- Activated = "activated",
363
- Blocked = "blocked",
364
- BlockedByLicense = "blocked_by_license"
365
- }
366
- declare enum UserType {
367
- User = "user",
368
- Guest = "guest",
369
- Emperor = "emperor",
370
- Anonymous = "anonymous"
371
- }
372
- interface UserSession {
373
- create_date: string;
374
- expire_in: string;
375
- ip: string;
376
- user_agent: string;
377
- id: number;
378
- is_current?: boolean;
379
- }
380
- interface UserToken {
381
- id: number;
382
- name: string;
383
- expire_in: string;
384
- create_date: string;
385
- token?: string;
386
- }
387
- interface UserGroup {
388
- id: number;
389
- name: string;
390
- description: string;
391
- amount_users: number;
392
- create_date: string;
393
- owner_id: number;
394
- owner: UserLabel;
395
- update_date: string;
396
- icon: string;
397
- icon_color: string;
398
- }
399
- interface UserRole {
400
- id: number;
401
- name: string;
402
- description: string;
403
- create_date: string;
404
- update_date: string;
405
- is_default: boolean;
406
- owner_id: number;
407
- grant_access_all: boolean;
408
- permissions_id?: number[];
409
- }
410
- interface UserParams {
411
- name: UserParamsLabel;
412
- value: any;
413
- }
414
- declare enum UserParamsLabel {
415
- Theme = "theme",
416
- Lang = "lang",
417
- Sort = "sort"
418
- }
419
-
420
448
  interface AccessToken {
421
449
  exp: number;
422
450
  iat: number;
@@ -450,6 +478,44 @@ interface AuthType {
450
478
  ldap: boolean;
451
479
  }
452
480
 
481
+ interface CommentParams extends RequestBaseParams {
482
+ divide_id?: number;
483
+ file_version_id: string;
484
+ path: string;
485
+ }
486
+ interface CreateCommentParams {
487
+ comment: string;
488
+ divide_id?: number;
489
+ file_version_id: string;
490
+ path: string;
491
+ }
492
+ interface UpdateCommentParams {
493
+ comment: string;
494
+ path: string;
495
+ version_comment_id: number;
496
+ divide_id?: number;
497
+ is_decided?: boolean;
498
+ }
499
+ interface DeleteCommentParams {
500
+ path: string;
501
+ version_comment_id: number;
502
+ divide_id?: number;
503
+ }
504
+ interface DeleteAllCommentParams {
505
+ path: string;
506
+ file_version_id: string;
507
+ divide_id?: number;
508
+ }
509
+ interface Comment {
510
+ id: number;
511
+ author_id: number;
512
+ comment: string;
513
+ file_version_id: string;
514
+ is_decided: boolean;
515
+ create_date: string;
516
+ update_date: string;
517
+ }
518
+
453
519
  interface Connection {
454
520
  id: number;
455
521
  name: string;
@@ -749,6 +815,7 @@ declare enum NotificationEntityType {
749
815
  declare enum NotificationAction {
750
816
  SecurityCheckNegative = "action_security_check_negative",
751
817
  SecurityCheckPositive = "action_security_check_positive",
818
+ CommentVersionMention = "action_version_comment_mention",
752
819
  OpenSharing = "open_sharing",
753
820
  ChangeSharing = "change_sharing",
754
821
  CancelSharing = "cancel_sharing",
@@ -1048,6 +1115,7 @@ declare class StorageElementApiService {
1048
1115
  owner_id: number;
1049
1116
  with_trash: boolean;
1050
1117
  }): Promise<SizeBySection[] | null>;
1118
+ getDivideResources(params: DivideResourceParams): Promise<ResponseList<ResourceAccess>>;
1051
1119
  }
1052
1120
  interface RequestStorageListParams extends RequestBaseParams {
1053
1121
  search?: string;
@@ -1285,6 +1353,16 @@ declare class ShareApiService {
1285
1353
  }): Promise<ResponseList<ShareInfo>>;
1286
1354
  }
1287
1355
 
1356
+ declare class StorageCommentApiService {
1357
+ private client;
1358
+ constructor(client: Client);
1359
+ list(params: CommentParams): Promise<ResponseList<Comment>>;
1360
+ create(data: CreateCommentParams): Promise<ResponseItem<Comment>>;
1361
+ update(data: UpdateCommentParams): Promise<ResponseItem<Comment>>;
1362
+ delete(params: DeleteCommentParams): Promise<void>;
1363
+ deleteAll(params: DeleteAllCommentParams): Promise<void>;
1364
+ }
1365
+
1288
1366
  declare class StorageInstanceApiService {
1289
1367
  private client;
1290
1368
  constructor(client: Client);
@@ -1420,4 +1498,5 @@ declare function normalizeHeaders(headers: Headers | [string, string][] | Record
1420
1498
 
1421
1499
  declare function prepareRequestBody(body: unknown): XMLHttpRequestBodyInit | Document | null;
1422
1500
 
1423
- export { AccessRights, type AccessToken, AuthApiService, type AuthToken, type AuthTokenUpdate, type AuthType, BASE_URL_V1, BASE_URL_V2, CONNECTIONS_PERMISSION, type ChangeLicenseParams, Client, type Connection, type ConnectionCreateParams, ConnectionGroup, ConnectionType, ConnectionsApiService, type CreateLimitationsParams, type CreateStorageElementParams, type CreateUserGroupParams, type CreateUserParams, type CreateUserRoleParams, type CutLinkRequest, type Discovery, DiscoveryApiService, DivideApiService, DivideMode, type DivideResourceType, type DivideResponseList, DivideScope, EngineType, type Extension, type ExtensionDefault, type ExtensionExternal, type ExtensionExternalInList, type ExtensionExternalListParams, ExtensionFileMode, type ExtensionListParams, type ExtensionMetaPayload, ExtensionType, ExtensionsApiService, ExtensionsExternalApiService, FcaApiService, type FileLocking, GatewayApiService, GroupApiService, type HistoryListRequestParams, type HistoryNote, type HistoryRequestParams, type HttpEvent, type HttpResponse, type Lang, type License, LicenseApiService, LicenseError, type Limitation, LimitationSubType, LimitationType, LimitationsApiService, LinksApiService, type LockScreen, LogstashApiService, NEED_TOKEN_UPDATE_ERROR, type NameExtensionListParams, type NbAppState, type NbClientParams, type NbRequestParams, NotificationAction, type NotificationActionGroup, NotificationApiService, NotificationEntityType, type NotificationPayload, NotificationRowAction, NotificationStyle, type OnUploadProgress, OrderDirection, type PayloadFile, type Permission, type PermissionItem, PermissionType, type ProgressEvent, type QueryInitResponse, QueryInitViewType, type RequestAuthSettingsParams, type RequestAuthTfaParams, type RequestAuthTokenParams, type RequestBaseParams, type RequestConfig, type RequestConnectionParams, type RequestLimitationsListParams, RequestMethod, type RequestNotificationListParams, RequestObserve, type RequestStorageListParams, type RequestUserDivideParams, type RequestUserGroupListParams, type RequestUserListParams, type RequestUserRoleListParams, type RequestUsersLogParams, type RequestVersionsSizeParams, type ResponseItem, type ResponseList, type ResponseListNotification, ResponseType, Rest, type Restriction, RestrictionBooleanStatus, RestrictionModeKey, RestrictionSharing, RestrictionStatus, RoleApiService, type Setting, SettingControlType, type SettingField, type SettingFieldView, type SettingLang, type SettingValue, type SettingValueField, type SettingVariant, type SettingViewConnectionChoose, type SettingViewSelect, ShareApiService, type ShareInfo, type ShareModel, type SizeBySection, type StorageElement, StorageElementApiService, StorageElementCheckStatus, StorageElementContentType, type StorageElementHistory, StorageElementHistoryAction, type StorageElementPaste, type StorageElementPasteParams, StorageElementType, type StorageElementVersion, type StorageElementVersionLock, StorageFilesApiService, type StorageInstance, StorageInstanceApiService, type StorageItemSizeParams, type StorageItemSizePathParams, StorageRoot, type StorageRouteData, StorageShareApiService, StorageTrashApiService, type StorageTrashElement, type StorageTrashItem, Tariff, TokenUpdate, type UnionRestriction, type UploadNetRequestParams, type User, UserApiService, UserAuthType, type UserDivide, type UserGroup, type UserLabel, type UserNamesExtension, type UserNotification, type UserParams, UserParamsLabel, type UserPhone, type UserRole, type UserSession, UserStatus, type UserToken, UserType, type UsersLog, VersionApiService, type VersionLockRequestParams, applyInterceptors, getCookieValue, makeUrlParams, normalizeHeaders, prepareRequestBody };
1501
+ export { AccessRights, AuthApiService, BASE_URL_V1, BASE_URL_V2, CONNECTIONS_PERMISSION, Client, ConnectionGroup, ConnectionType, ConnectionsApiService, DiscoveryApiService, DivideApiService, DivideMode, DivideScope, EngineType, ExtensionFileMode, ExtensionType, ExtensionsApiService, ExtensionsExternalApiService, FcaApiService, GatewayApiService, GroupApiService, LicenseApiService, LicenseError, LimitationSubType, LimitationType, LimitationsApiService, LinksApiService, LogstashApiService, NEED_TOKEN_UPDATE_ERROR, NotificationAction, NotificationApiService, NotificationEntityType, NotificationRowAction, NotificationStyle, OrderDirection, PermissionType, QueryInitViewType, RequestMethod, RequestObserve, ResponseType, Rest, RestrictionBooleanStatus, RestrictionModeKey, RestrictionSharing, RestrictionStatus, RoleApiService, SettingControlType, ShareApiService, StorageCommentApiService, StorageElementApiService, StorageElementCheckStatus, StorageElementContentType, StorageElementHistoryAction, StorageElementType, StorageFilesApiService, StorageInstanceApiService, StorageRoot, StorageShareApiService, StorageTrashApiService, Tariff, TokenUpdate, UserApiService, UserAuthType, UserParamsLabel, UserStatus, UserType, VersionApiService, applyInterceptors, getCookieValue, makeUrlParams, normalizeHeaders, prepareRequestBody };
1502
+ export type { AccessToken, AuthToken, AuthTokenUpdate, AuthType, ChangeLicenseParams, Comment, CommentParams, Connection, ConnectionCreateParams, CreateCommentParams, CreateLimitationsParams, CreateStorageElementParams, CreateUserGroupParams, CreateUserParams, CreateUserRoleParams, CutLinkRequest, DeleteAllCommentParams, DeleteCommentParams, Discovery, DivideResourceParams, DivideResourceType, DivideResponseList, Extension, ExtensionDefault, ExtensionExternal, ExtensionExternalInList, ExtensionExternalListParams, ExtensionListParams, ExtensionMetaPayload, FileLocking, HistoryListRequestParams, HistoryNote, HistoryRequestParams, HttpEvent, HttpResponse, Lang, License, Limitation, LockScreen, NameExtensionListParams, NbAppState, NbClientParams, NbRequestParams, NotificationActionGroup, NotificationPayload, OnUploadProgress, PayloadFile, Permission, PermissionItem, ProgressEvent, QueryInitResponse, RequestAuthSettingsParams, RequestAuthTfaParams, RequestAuthTokenParams, RequestBaseParams, RequestConfig, RequestConnectionParams, RequestLimitationsListParams, RequestNotificationListParams, RequestStorageListParams, RequestUserDivideParams, RequestUserGroupListParams, RequestUserListParams, RequestUserRoleListParams, RequestUsersLogParams, RequestVersionsSizeParams, ResourceAccess, ResponseItem, ResponseList, ResponseListNotification, Restriction, Setting, SettingField, SettingFieldView, SettingLang, SettingValue, SettingValueField, SettingVariant, SettingViewConnectionChoose, SettingViewSelect, ShareInfo, ShareModel, SizeBySection, StorageElement, StorageElementHistory, StorageElementPaste, StorageElementPasteParams, StorageElementVersion, StorageElementVersionLock, StorageInstance, StorageItemSizeParams, StorageItemSizePathParams, StorageRouteData, StorageTrashElement, StorageTrashItem, UnionRestriction, UpdateCommentParams, UploadNetRequestParams, User, UserDivide, UserGroup, UserInfo, UserLabel, UserNamesExtension, UserNotification, UserParams, UserPhone, UserRole, UserSession, UserToken, UsersLog, VersionLockRequestParams };
@@ -0,0 +1,38 @@
1
+ import { RequestBaseParams } from './base';
2
+ export interface CommentParams extends RequestBaseParams {
3
+ divide_id?: number;
4
+ file_version_id: string;
5
+ path: string;
6
+ }
7
+ export interface CreateCommentParams {
8
+ comment: string;
9
+ divide_id?: number;
10
+ file_version_id: string;
11
+ path: string;
12
+ }
13
+ export interface UpdateCommentParams {
14
+ comment: string;
15
+ path: string;
16
+ version_comment_id: number;
17
+ divide_id?: number;
18
+ is_decided?: boolean;
19
+ }
20
+ export interface DeleteCommentParams {
21
+ path: string;
22
+ version_comment_id: number;
23
+ divide_id?: number;
24
+ }
25
+ export interface DeleteAllCommentParams {
26
+ path: string;
27
+ file_version_id: string;
28
+ divide_id?: number;
29
+ }
30
+ export interface Comment {
31
+ id: number;
32
+ author_id: number;
33
+ comment: string;
34
+ file_version_id: string;
35
+ is_decided: boolean;
36
+ create_date: string;
37
+ update_date: string;
38
+ }
@@ -1,5 +1,6 @@
1
- import { ResponseList } from './base';
1
+ import { RequestBaseParams, ResponseList } from './base';
2
2
  import { StorageElement, StorageElementType } from './storage';
3
+ import { UserInfo } from './user';
3
4
  export declare enum DivideScope {
4
5
  Storage = "/storage/element",
5
6
  Connection = "/connections"
@@ -79,4 +80,27 @@ export interface ShareModel {
79
80
  password: string | null;
80
81
  expire_delta: number | null;
81
82
  }
83
+ export interface DivideResourceParams extends RequestBaseParams {
84
+ path: string;
85
+ access_mode?: PermissionType;
86
+ divide_id?: number;
87
+ search?: string;
88
+ with_owner?: boolean;
89
+ }
90
+ export interface ResourceAccess {
91
+ id: number;
92
+ access_mode: string;
93
+ comment: string;
94
+ create_date: string;
95
+ update_date: string;
96
+ moderator_id: number;
97
+ owner_id: number;
98
+ relative_path: string;
99
+ resource: string;
100
+ restriction_status: string;
101
+ to_user_group_id: number;
102
+ to_user_id: number;
103
+ type: string;
104
+ user_info: UserInfo;
105
+ }
82
106
  export {};
@@ -2,6 +2,7 @@ export * from './access-rights';
2
2
  export * from './access-token';
3
3
  export * from './auth';
4
4
  export * from './base';
5
+ export * from './comment';
5
6
  export * from './connection';
6
7
  export * from './discovery';
7
8
  export * from './extension';
@@ -29,6 +29,7 @@ export declare enum NotificationEntityType {
29
29
  export declare enum NotificationAction {
30
30
  SecurityCheckNegative = "action_security_check_negative",
31
31
  SecurityCheckPositive = "action_security_check_positive",
32
+ CommentVersionMention = "action_version_comment_mention",
32
33
  OpenSharing = "open_sharing",
33
34
  ChangeSharing = "change_sharing",
34
35
  CancelSharing = "cancel_sharing",
@@ -18,6 +18,9 @@ export interface User {
18
18
  phone?: string;
19
19
  }
20
20
  export type UserLabel = Pick<User, 'login' | 'email' | 'first_name' | 'middle_name' | 'last_name' | 'avatar_path'>;
21
+ export interface UserInfo extends UserLabel {
22
+ id: number;
23
+ }
21
24
  export declare enum UserAuthType {
22
25
  Native = "native",
23
26
  Ldap = "ldap",
@@ -80,5 +83,6 @@ export interface UserParams {
80
83
  export declare enum UserParamsLabel {
81
84
  Theme = "theme",
82
85
  Lang = "lang",
83
- Sort = "sort"
86
+ Sort = "sort",
87
+ ViewApps = "viewApps"
84
88
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nb-js-client",
3
- "version": "0.0.63",
3
+ "version": "0.0.65",
4
4
  "main": "dist/bundle.cjs.js",
5
5
  "module": "dist/bundle.esm.js",
6
6
  "files": [