nb-js-client 1.0.61 → 1.0.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/auth-api.service.d.ts +3 -8
- package/dist/api/connections-api.service.d.ts +1 -1
- package/dist/api/discovery-api.service.d.ts +1 -1
- package/dist/api/divide-api.service.d.ts +1 -1
- package/dist/api/extensions-api.service.d.ts +1 -1
- package/dist/api/extensions-external-api.service.d.ts +1 -1
- package/dist/api/fca-api.service.d.ts +1 -1
- package/dist/api/gateway-api.service.d.ts +1 -1
- package/dist/api/group-api.service.d.ts +1 -1
- package/dist/api/license-api.service.d.ts +1 -1
- package/dist/api/limitation-api.service.d.ts +1 -1
- package/dist/api/links-api.service.d.ts +1 -1
- package/dist/api/logstash-api.service.d.ts +1 -1
- package/dist/api/notification-api.service.d.ts +1 -1
- package/dist/api/platform-version-api.service.d.ts +1 -1
- package/dist/api/role-api.service.d.ts +1 -1
- package/dist/api/share-api.service.d.ts +1 -1
- package/dist/api/space-api.service.d.ts +1 -1
- package/dist/api/space-files-api.service.d.ts +7 -4
- package/dist/api/storage-comment-api.service.d.ts +1 -1
- package/dist/api/storage-element-api.service.d.ts +3 -2
- package/dist/api/storage-files-api.service.d.ts +1 -1
- package/dist/api/storage-instance-api.service.d.ts +1 -1
- package/dist/api/storage-share-api.service.d.ts +1 -1
- package/dist/api/storage-trash-api.service.d.ts +1 -1
- package/dist/api/tags-api.service.d.ts +1 -1
- package/dist/api/user-api.service.d.ts +1 -1
- package/dist/api/users-appeals-api.service.d.ts +1 -1
- package/dist/api/version-api.service.d.ts +1 -1
- package/dist/bundle.cjs.js +1 -1
- package/dist/bundle.esm.js +1 -1
- package/dist/classes/constants.d.ts +2 -0
- package/dist/classes/index.d.ts +1 -0
- package/dist/classes/rest.d.ts +2 -3
- package/dist/classes/token-update.d.ts +1 -1
- package/dist/index.d.ts +86 -81
- package/dist/types/auth.d.ts +6 -0
- package/dist/types/base.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Client } from '../classes';
|
|
2
|
-
import { AuthToken, AuthTokenUpdate, AuthType } from '../types';
|
|
1
|
+
import type { Client } from '../classes/client';
|
|
2
|
+
import { AuthToken, AuthTokenUpdate, AuthType, RequestAuthTokenParams } from '../types';
|
|
3
|
+
export type { RequestAuthTokenParams };
|
|
3
4
|
export declare class AuthApiService {
|
|
4
5
|
private client;
|
|
5
6
|
constructor(client: Client);
|
|
@@ -19,9 +20,3 @@ export interface RequestAuthTfaParams {
|
|
|
19
20
|
code: number;
|
|
20
21
|
temp_token: string;
|
|
21
22
|
}
|
|
22
|
-
export interface RequestAuthTokenParams {
|
|
23
|
-
access_token: string;
|
|
24
|
-
refresh_token: string;
|
|
25
|
-
with_cookie?: boolean;
|
|
26
|
-
path?: string;
|
|
27
|
-
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Client } from '../classes';
|
|
1
|
+
import type { Client } from '../classes/client';
|
|
2
2
|
import { DivideMode, DivideResourceType, DivideResponseList, DivideScope, PermissionType, RequestTagGroupsParams, RequestUserDivideParams, ResponseItem, ResponseList, RestrictionModeKey, TagGroup, UnionRestriction, UserDivide } from '../types';
|
|
3
3
|
export declare class DivideApiService {
|
|
4
4
|
private client;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Client } from '../classes';
|
|
1
|
+
import type { Client } from '../classes/client';
|
|
2
2
|
import { Extension, ExtensionDefault, ExtensionListParams, ExtensionTag, ExtensionTagListParams, HttpEvent, NameExtensionListParams, OnUploadProgress, ResponseItem, ResponseList, SettingValue, UserNamesExtension } from '../types';
|
|
3
3
|
export declare class ExtensionsApiService {
|
|
4
4
|
private client;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Client } from '../classes';
|
|
1
|
+
import type { Client } from '../classes/client';
|
|
2
2
|
import { ExtensionExternal, ExtensionExternalInList, RequestBaseParams, ResponseList, ResponseType } from '../types';
|
|
3
3
|
export declare class ExtensionsExternalApiService {
|
|
4
4
|
private client;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Client } from '../classes';
|
|
1
|
+
import type { Client } from '../classes/client';
|
|
2
2
|
import { HttpEvent, OnUploadProgress, ResponseItem, ResponseList, StorageElement } from '../types';
|
|
3
3
|
import { ConnectionCreateParams } from './connections-api.service';
|
|
4
4
|
import { CreateStorageElementParams, RequestStorageListParams } from './storage-element-api.service';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Client } from '../classes';
|
|
1
|
+
import type { Client } from '../classes/client';
|
|
2
2
|
import { Extension, ExtensionDefault, License, LockScreen, ResponseList, Restriction, Setting, SettingValue, User, UserNotification } from '../types';
|
|
3
3
|
import { FileLocking } from '../types/file-locking';
|
|
4
4
|
import { LdapStrict } from '../types/ldap-strict';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Client } from '../classes';
|
|
1
|
+
import type { Client } from '../classes/client';
|
|
2
2
|
import { RequestBaseParams, ResponseItem, ResponseList } from '../types';
|
|
3
3
|
import { RequestLimitationsListParams, Limitation, CreateLimitationsParams } from '../types/limitation';
|
|
4
4
|
export declare class LimitationsApiService {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Client } from '../classes';
|
|
1
|
+
import type { Client } from '../classes/client';
|
|
2
2
|
import { NotificationActionGroup, NotificationRowAction, RequestBaseParams, ResponseItem, ResponseList, TaskNotification, UserNotification } from '../types';
|
|
3
3
|
export declare class NotificationApiService {
|
|
4
4
|
private client;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Client } from '../classes';
|
|
1
|
+
import type { Client } from '../classes/client';
|
|
2
2
|
import { PermissionType, RequestBaseParams, ResponseList } from '../types';
|
|
3
3
|
import { Space, SpaceAccess, SpaceAccessProvide, SpaceAdmin } from '../types/space';
|
|
4
4
|
export declare class SpaceApiService {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Client } from '../classes';
|
|
2
|
-
import { HttpEvent, OnUploadProgress, ResponseList, SpaceElement,
|
|
1
|
+
import type { Client } from '../classes/client';
|
|
2
|
+
import { HttpEvent, OnUploadProgress, ResponseList, SpaceElement, StorageElementType } from '../types';
|
|
3
3
|
import { RequestStorageListParams } from './storage-element-api.service';
|
|
4
4
|
export declare class SpaceFilesApiService {
|
|
5
5
|
private client;
|
|
@@ -15,6 +15,7 @@ export declare class SpaceFilesApiService {
|
|
|
15
15
|
delete(id: number, params: RequestSpaceDeleteFilesParams): Promise<void>;
|
|
16
16
|
copy(id: number, params: RequestSpaceCopyFileParams): Promise<SpaceElement>;
|
|
17
17
|
download(id: number, params: RequestSpaceDownloadFileParams): Promise<Blob>;
|
|
18
|
+
createZipToDownload(id: number, params: RequestSpaceDownloadDirParams): Promise<Blob>;
|
|
18
19
|
move(id: number, params: RequestSpaceMoveFilesParams): Promise<void>;
|
|
19
20
|
rename(id: number, params: RequestSpaceRenameFileParams): Promise<SpaceElement>;
|
|
20
21
|
upload(onProgress: OnUploadProgress, id: number, file: File, params: RequestSpaceUploadParams): {
|
|
@@ -23,8 +24,7 @@ export declare class SpaceFilesApiService {
|
|
|
23
24
|
};
|
|
24
25
|
uploadNet(id: number, params: RequestSpaceUploadFromUrlParams): Promise<SpaceElement>;
|
|
25
26
|
}
|
|
26
|
-
export type RequestSpaceElementListParams = Pick<RequestStorageListParams, 'is_search_dir' | 'limit' | 'max_size' | 'min_size' | 'offset' | 'order_by' | 'order_direction' | 'search' | 'type'> & {
|
|
27
|
-
content_types?: StorageElementContentType[];
|
|
27
|
+
export type RequestSpaceElementListParams = Pick<RequestStorageListParams, 'is_search_dir' | 'limit' | 'max_size' | 'min_size' | 'offset' | 'order_by' | 'order_direction' | 'search' | 'type' | 'content_types'> & {
|
|
28
28
|
parent_id?: string;
|
|
29
29
|
};
|
|
30
30
|
export interface RequestSpaceGetFileParams {
|
|
@@ -57,6 +57,9 @@ export interface RequestSpaceDownloadFileParams {
|
|
|
57
57
|
last_used_extension?: string;
|
|
58
58
|
with_preview?: boolean;
|
|
59
59
|
}
|
|
60
|
+
export interface RequestSpaceDownloadDirParams {
|
|
61
|
+
file_id: string;
|
|
62
|
+
}
|
|
60
63
|
export interface RequestSpaceMoveItem {
|
|
61
64
|
file_id: string;
|
|
62
65
|
to_parent_id?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Client } from '../classes';
|
|
1
|
+
import type { Client } from '../classes/client';
|
|
2
2
|
import { ResponseItem, ResponseList } from '../types';
|
|
3
3
|
import { CommentParams, Comment, CreateCommentParams, UpdateCommentParams, DeleteCommentParams, DeleteAllCommentParams } from '../types/comment';
|
|
4
4
|
export declare class StorageCommentApiService {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Client } from '../classes';
|
|
2
|
-
import { ResponseItem, ResponseList, StorageElementPaste, StorageRoot, RequestBaseParams, StorageElementType, StorageRouteData, SizeBySection, DivideResourceParams, ResourceAccess, Quota, StorageElementFileInfo } from '../types';
|
|
1
|
+
import type { Client } from '../classes/client';
|
|
2
|
+
import { ResponseItem, ResponseList, StorageElementPaste, StorageRoot, RequestBaseParams, StorageElementType, StorageRouteData, SizeBySection, DivideResourceParams, ResourceAccess, Quota, StorageElementFileInfo, StorageElementContentType } from '../types';
|
|
3
3
|
import { StorageElement } from '../types';
|
|
4
4
|
import { FcaApiService } from './fca-api.service';
|
|
5
5
|
export declare class StorageElementApiService {
|
|
@@ -62,6 +62,7 @@ export interface RequestStorageListParams extends RequestBaseParams {
|
|
|
62
62
|
show_hidden?: boolean;
|
|
63
63
|
without_tags?: boolean;
|
|
64
64
|
tag_ids?: number[];
|
|
65
|
+
content_types?: StorageElementContentType[];
|
|
65
66
|
}
|
|
66
67
|
export interface StorageElementPasteParams {
|
|
67
68
|
paths: StorageElementPaste[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Client } from '../classes';
|
|
1
|
+
import type { Client } from '../classes/client';
|
|
2
2
|
import { AuthToken, RequestBaseParams, ResponseItem, ResponseList, User, UserAppPasswordInfo, UserAppPasswords, UserAppType, UserParams, UserParamsLabel, UserSession, UserStatus, UserToken, UserType } from '../types';
|
|
3
3
|
export declare class UserApiService {
|
|
4
4
|
private client;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Client } from '../classes';
|
|
1
|
+
import type { Client } from '../classes/client';
|
|
2
2
|
import { HistoryNote, RequestBaseParams, ResponseItem, ResponseList, StorageElementHistory, StorageElementVersion, StorageElementVersionLock } from '../types';
|
|
3
3
|
export declare class VersionApiService {
|
|
4
4
|
private client;
|
package/dist/bundle.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e="/login",t=`${e}/ldap`,s=`${e}/update`,r=`${e}/tfa`;class i{constructor(e){this.client=e}info(){return this.client.rest.get(e)}login(t){return this.client.rest.post(e,t)}ldapLogin(e){return this.client.rest.post(t,e)}loginTfa(e){return this.client.rest.post(r,e)}updateToken(e){const t=e.path?`${e.path}/${s}`:s;return e.path&&delete e.path,this.client.rest.post(t,e)}logout(){return this.client.rest.post("/logout")}}var n;exports.AccessRights=void 0,(n=exports.AccessRights||(exports.AccessRights={})).LicenseRead="license_read",n.LicenseManage="license_edit",n.UsersRead="users_read",n.UsersCreate="users_create",n.UsersActivate="users_activate",n.GroupsRead="groups_read",n.GroupsCreate="groups_create",n.RolesRead="roles_read",n.RolesCreate="roles_create",n.Share="share",n.Divide="divide",n.ExtensionsRead="extensions_read",n.ExtensionsManage="extensions_write",n.RestrictionShareRead="restriction_share_read",n.RestrictionShareWrite="restriction_share_write",n.RestrictionDivideRead="restriction_divide_read",n.RestrictionDivideWrite="restriction_divide_write",n.LimitationsRead="limitations_read",n.LimitationsEdit="limitations_edit",n.ReadUserLogs="read_user_logs",n.ConnectionsRead="connections_read",n.ConnectionsDividing="connections_dividing",n.ConnectionsYandexDisk="connections_yandex_disk",n.ConnectionsSsh="connections_ssh",n.ConnectionsMail="connections_mail",n.ConnectionsS3="connections_s3",n.ConnectionsDiscord="connections_discord",n.ConnectionsWebdav="connections_webdav",n.ConnectionsNextcloud="connections_nextcloud",n.ConnectionsNextbox="connections_nextbox",n.ConnectionsHttpProxy="connections_http_proxy",n.SystemInfoServiceList="system_info_service_list",n.SettingsRead="settings_read",n.SettingsWrite="settings_write",n.DemoAdmin="demo_admin",n.SpaceManage="space_manage";const o=[exports.AccessRights.ConnectionsYandexDisk,exports.AccessRights.ConnectionsSsh,exports.AccessRights.ConnectionsMail,exports.AccessRights.ConnectionsS3,exports.AccessRights.ConnectionsS3,exports.AccessRights.ConnectionsDiscord,exports.AccessRights.ConnectionsWebdav,exports.AccessRights.ConnectionsNextcloud,exports.AccessRights.ConnectionsNextbox,exports.AccessRights.ConnectionsHttpProxy];var c,a,l,p,d,u,h,g,_,x,$,v,m,S,y,f,w,A,k,T,b,C,R,E,D,U,P,L,N,I,O,q,z,M,F;exports.OrderDirection=void 0,(c=exports.OrderDirection||(exports.OrderDirection={})).DEFAULT="",c.ASC="asc",c.DESC="desc",exports.EngineType=void 0,(a=exports.EngineType||(exports.EngineType={})).WebSocket="websocket",a.PostMessage="postmessage",a.Empty="",exports.ColorTypes=void 0,(l=exports.ColorTypes||(exports.ColorTypes={})).Yellow="yellow",l.Success="success",l.Critical="critical",l.Warning="warning",l.Brand="brand",l.Purple="purple",l.Primary="primary",l.Gray="gray",exports.ConnectionGroup=void 0,(p=exports.ConnectionGroup||(exports.ConnectionGroup={})).Storages="storages_connections_group",p.Webhooks="webhooks_connections_group",p.Unknown="unknown_connections_group",p.Proxy="proxy_connections_group",exports.ConnectionType=void 0,(d=exports.ConnectionType||(exports.ConnectionType={})).SSH="ssh_connection",d.YandexDisk="yandex_disk",d.Mail="mail",d.Discord="discord",d.Webdav="webdav_connection",d.Nextcloud="nextcloud_connection",d.NextBox="nextbox_connection",d.HttpProxy="http_proxy_connection",d.S3="s3_connection",exports.ExtensionType=void 0,(u=exports.ExtensionType||(exports.ExtensionType={})).App="app",u.File="file",u.WorkDir="work_dir",exports.ExtensionFileMode=void 0,(h=exports.ExtensionFileMode||(exports.ExtensionFileMode={})).Read="read",h.ReadAndWrite="read_and_write",h.Write="write",exports.DivideScope=void 0,(g=exports.DivideScope||(exports.DivideScope={})).Storage="/storage/element",g.Connection="/connections",exports.PermissionType=void 0,(_=exports.PermissionType||(exports.PermissionType={})).Close="",_.Read="r",_.Write="rw",_.Full="rwd",_.SpaceManage="space_manage",exports.RestrictionStatus=void 0,(x=exports.RestrictionStatus||(exports.RestrictionStatus={})).WAITING="waiting",x.APPROVED="approved",x.REJECTED="rejected",exports.RestrictionBooleanStatus=void 0,($=exports.RestrictionBooleanStatus||(exports.RestrictionBooleanStatus={})).TRUE="true",$.FALSE="false",exports.DivideMode=void 0,(v=exports.DivideMode||(exports.DivideMode={})).User="to_user_id",v.Group="to_user_group_id",exports.RestrictionModeKey=void 0,(m=exports.RestrictionModeKey||(exports.RestrictionModeKey={})).Divide="divide",m.Share="share",exports.Tariff=void 0,(S=exports.Tariff||(exports.Tariff={})).Free="free",S.Business="business",S.Enterprise="enterprise",exports.LicenseError=void 0,(y=exports.LicenseError||(exports.LicenseError={})).NotActivated="License not activated",y.Blocked="License blocked",y.Expired="License has been expired",y.NotValid="License not valid",y.NotFound="license file not found",exports.LimitationType=void 0,(f=exports.LimitationType||(exports.LimitationType={})).BySize="size",f.ByExt="extension",f.ByQuota="quota_size",exports.LimitationSubType=void 0,(w=exports.LimitationSubType||(exports.LimitationSubType={})).Size="size",w.White="extension_white",w.Black="extension_black",exports.NotificationEntityType=void 0,(A=exports.NotificationEntityType||(exports.NotificationEntityType={})).Dir="dir",A.File="file",A.User="user",A.Other="other",A.WorkDir="work_dir",A.License="license",A.Extension="extension",A.Connection="connection",exports.NotificationAction=void 0,(k=exports.NotificationAction||(exports.NotificationAction={})).SecurityCheckNegative="action_security_check_negative",k.SecurityCheckPositive="action_security_check_positive",k.CommentVersionMention="action_version_comment_mention",k.OpenSharing="open_sharing",k.ChangeSharing="change_sharing",k.CancelSharing="cancel_sharing",k.DivideDirAddFileToOwner="divide_dir_add_file_to_owner",k.DivideDirAddDirToOwner="divide_dir_add_dir_to_owner",k.DivideDirAddWorkDirToOwner="divide_dir_add_work_dir_to_owner",k.DivideConnectionAddFileToOwner="divide_connection_add_file_to_owner",k.DivideConnectionAddDirToOwner="divide_connection_add_dir_to_owner",k.CancelDivideDir="cancel_divide_dir",k.CancelDivideFile="cancel_divide_file",k.CancelDivideWorkDir="cancel_divide_work_dir",k.CancelDivideConnection="cancel_divide_connection",k.DeleteExtension="delete_extension",k.NewVersionExtension="new_version_extension",k.TransferData="transfer_data",k.AllowInternalAccessUser="allow_internal_access_to_user",k.BlockInternalAccessUser="block_internal_access_to_user",k.WaitInternalAccessUser="wait_internal_access_to_user",k.WaitInternalAccessUserCreate="wait_internal_access_to_user_create",k.AllowInternalAccessGroup="allow_internal_access_to_group",k.BlockInternalAccessGroup="block_internal_access_to_group",k.WaitInternalAccessGroup="wait_internal_access_to_group",k.WaitInternalAccessGroupCreate="wait_internal_access_to_group_create",k.AllowSharing="allow_sharing",k.BlockSharing="block_sharing",k.WaitSharing="wait_sharing",k.WaitSharingCreate="wait_sharing_create",k.StatusCreateZipProcess="status_create_zip_process",k.StatusCreateZipSuccess="status_create_zip_success",k.StatusCreateZipError="status_create_zip_error",k.DownloadZipSuccess="download_zip_success",k.DownloadZipError="download_zip_error",k.StatusUnzipProcess="status_unzip_process",k.StatusUnzipSuccess="status_unzip_success",k.StatusUnzipError="status_unzip_error",k.StatusUnzipSuccessWithLimits="status_unzip_success_with_limits",k.AnonymZipDirAddFileToOwner="anonym_zip_dir_add_file_to_owner",k.GuestZipDirAddFileToOwner="guest_zip_dir_add_file_to_owner",k.DropDocumentOnlyoffice="drop_document_onlyoffice",k.CopyError="copy_error",k.CopySuccess="copy_success",k.StatusCopyProcess="status_copy_process",k.Other="other",k.Application="application",exports.NotificationRowAction=void 0,(T=exports.NotificationRowAction||(exports.NotificationRowAction={})).Read="read",T.Unread="unread",T.Delete="delete",exports.NotificationStyle=void 0,(b=exports.NotificationStyle||(exports.NotificationStyle={})).Plain="plain",b.Success="success",b.Info="info",b.Warning="warning",b.Error="error",exports.ResponseType=void 0,(C=exports.ResponseType||(exports.ResponseType={})).ArrayBuffer="arraybuffer",C.Blob="blob",C.Json="json",C.Text="text",exports.RequestMethod=void 0,(R=exports.RequestMethod||(exports.RequestMethod={})).GET="GET",R.POST="POST",R.PUT="PUT",R.PATCH="PATCH",R.DELETE="DELETE",R.HEAD="HEAD",exports.RequestObserve=void 0,(E=exports.RequestObserve||(exports.RequestObserve={})).Body="body",E.Response="response",exports.RestrictionSharing=void 0,(D=exports.RestrictionSharing||(exports.RestrictionSharing={})).NONE="none",D.SOFT="soft",D.HARD="hard",exports.UserAuthType=void 0,(U=exports.UserAuthType||(exports.UserAuthType={})).Native="native",U.Ldap="ldap",U.Vk="vk",exports.UserStatus=void 0,(P=exports.UserStatus||(exports.UserStatus={})).Registering="registering",P.Activated="activated",P.BlockedByAdmin="blocked_by_admin",P.BlockedByLicense="blocked_by_license",P.BlockedByInactive="blocked_by_inactive",P.BlockedByInactiveChangePassword="blocked_by_inactive_change_password",exports.UserType=void 0,(L=exports.UserType||(exports.UserType={})).User="user",L.Guest="guest",L.Emperor="emperor",L.Anonymous="anonymous",exports.UserParamsLabel=void 0,(N=exports.UserParamsLabel||(exports.UserParamsLabel={})).Theme="theme",N.Lang="lang",N.Sort="sort",N.ViewApps="viewApps",N.WithoutContentWorkDir="withoutContentWorkDir",N.DashboardGrid="dashboardGrid",exports.UserAppType=void 0,(exports.UserAppType||(exports.UserAppType={})).Webdav="webdav",exports.SettingControlType=void 0,(I=exports.SettingControlType||(exports.SettingControlType={})).Text="text",I.String="string",I.Number="number",I.CheckBox="checkbox",I.Select="select",I.RadioList="radio_list",I.ConnectionChoose="connection_choose",I.MultiConnectionChoose="multi_connection_choose",exports.StorageElementType=void 0,(O=exports.StorageElementType||(exports.StorageElementType={})).Dir="dir",O.File="file",O.WorkDir="work_dir",O.App="app",exports.StorageElementContentType=void 0,(q=exports.StorageElementContentType||(exports.StorageElementContentType={})).Any="any",q.Dir="dir",q.Code="code",q.Image="image",q.Audio="audio",q.Video="video",q.Text="text",q.Doc="doc",q.Xls="xls",q.Ppt="ppt",exports.StorageRoot=void 0,(z=exports.StorageRoot||(exports.StorageRoot={})).my="my",z.fca="fca",z.divide="divide",z.share="share",z.favorite="favorite",z.trash="trash",z.spaces="spaces",exports.StorageElementHistoryAction=void 0,(M=exports.StorageElementHistoryAction||(exports.StorageElementHistoryAction={})).Create="create",M.Update="update",M.Move="move",exports.StorageElementCheckStatus=void 0,(F=exports.StorageElementCheckStatus||(exports.StorageElementCheckStatus={}))[F.CheckNull=0]="CheckNull",F[F.CheckInProgress=1]="CheckInProgress",F[F.CheckPositive=2]="CheckPositive",F[F.CheckNegative=3]="CheckNegative";const B="/connections",W=`${B}/dashboard`;class H{constructor(e){this.client=e}list(e){return this.client.rest.get(B,e)}get(e){return this.client.rest.get(`${B}/${e}`)}update(e,t){return this.client.rest.put(`${B}/${e}`,t)}delete(e){return this.client.rest.delete(`${B}/${e}`)}create(e){const t={[exports.ConnectionType.SSH]:"/disk/ssh",[exports.ConnectionType.Webdav]:"/disk/webdav",[exports.ConnectionType.Nextcloud]:"/disk/nextcloud",[exports.ConnectionType.NextBox]:"/disk/nextbox",[exports.ConnectionType.Discord]:"/webhooks/discord",[exports.ConnectionType.Mail]:"/webhooks/mail",[exports.ConnectionType.HttpProxy]:"/http_proxy",[exports.ConnectionType.S3]:"/disk/s3"};return this.client.rest.post(t[e.type]||B,e)}dashboard(e){return this.client.rest.get(W,e)}}class G{constructor(e){this.client=e}discovery(e){return this.client.rest.get("/discovery",e)}}const V="/divide",j=`${V}/restrictions`,Z=`${V}/tag_group`;class J{constructor(e){this.client=e}divideDelete(e,t){return this.client.rest.delete(`${e}${V}/${t}`)}divideDeleteAll(e,t,s,r){return this.client.rest.delete(`${e}${V}`,{...this.makeParam(e,t),is_to_user_group:r,access_mode:s})}divideChange(e,t,s){return this.client.rest.put(`${e}${V}/${t}`,{access_mode:s})}divideCreate(e,t,s,r,i){const n={...this.makeParam(e,t),[i]:s,access_mode:r};return this.client.rest.post(`${e}${V}`,n)}divideUsers(e,t,s){return this.client.rest.get(`${e}${V}/users`,{...this.makeParam(e,t),...s})}divideTagGroupList(e){return this.client.rest.get(`${exports.DivideScope.Storage}${Z}`,e)}getRestriction(e){return this.client.rest.get(`${j}/${e}`)}restrictionSize(e,t){return this.client.rest.get(`/${t}/restrictions/${e}/size`)}restrictions(e){return this.client.rest.get(`${j}`,e)}restrictionsChange(e,t){return this.client.rest.put(`${j}/${e}`,t)}makeParam(e,t){const s={};return e===exports.DivideScope.Connection?s.connection_id=t:s.path=t,s}}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 Y(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 X=async(e,t)=>{let s=t;for(const t of e)try{s=await t.fulfilled(s)}catch(e){if(!t.rejected)throw e;s=await t.rejected(e)}return s};function ee(e){var t;return null!==(t=Object.fromEntries(document.cookie.split(";").map((e=>e.split("="))).map((([e,t])=>[e.trim(),decodeURIComponent(t||"")])))[e])&&void 0!==t?t:null}const te=e=>{const t=new URLSearchParams;return Object.keys(e).forEach((s=>{Array.isArray(e[s])?e[s].forEach((e=>{t.append(s,e)})):t.append(s,e[s])})),t};function se(e){return e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):e}function re(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}async refreshToken(e,t){const{access_token:s,refresh_token:r}=e;return s&&r?this.isUpdating?this.waitForTokenUpdate():(this.isUpdating=!0,new Promise(((e,i)=>{const n=new XMLHttpRequest,o=`${t}${oe}/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};ee("access_token")===s.access_token&&localStorage.setItem("refresh-token",s.refresh_token),this.tokenUpdateResolve&&(this.tokenUpdateResolve(s),this.tokenUpdateResolve=null),e(s)}else e(null)}catch(e){i(new Error("Failed to parse response JSON."))}else e(null)},n.onerror=()=>{i(new Error("Network error occurred"))},n.onloadend=()=>{this.isUpdating=!1}}))):null}async waitForTokenUpdate(){return new Promise((e=>{const t=setInterval((()=>{this.isUpdating||(clearInterval(t),e())}),100)}))}}const oe="/api/v1",ce="/api/v2";class ae{constructor(e,t){this.client=e,this.tokenUpdate=t,this.baseHost=""}get state(){return this.client.state}get(e,t,s){return this.request(exports.RequestMethod.GET,e,{params:t,cache:"no-cache",...s})}post(e,t,s){return this.request(exports.RequestMethod.POST,e,{body:t,...s})}put(e,t,s){return this.request(exports.RequestMethod.PUT,e,{body:t,cache:"no-cache",...s})}patch(e,t,s){return this.request(exports.RequestMethod.PATCH,e,{body:t,...s})}delete(e,t,s){return this.request(exports.RequestMethod.DELETE,e,{params:t,...s})}head(e,t,s){return this.request(exports.RequestMethod.HEAD,e,{params:t,...s})}upload(e,t,s){const r=new AbortController,i=r.signal;return{promise:this.request(exports.RequestMethod.POST,e,{body:t,signal:i,...s}),abort:()=>r.abort()}}request(e,t,s){return new Promise(((r,i)=>{var n;const o=null!==(n=this.state.skipInterceptors)&&void 0!==n&&n;this.state.skipInterceptors=!1;let c={method:e,...s};(null==s?void 0:s.signal)&&(c.signal=s.signal);(async()=>{var s,n,a,l;if(o||(c=null!==(s=await X(this.client.requestInterceptors,c))&&void 0!==s?s:c),this.state.authToken)for(const[e,s]of this.state.authToken.entries()){const r=Y(s.access_token);if(r&&r.is_remember&&this.tokenUpdate.isTokenExpire(r.exp)&&!t.includes("/login")&&!t.includes("/assets")){const t=await this.tokenUpdate.refreshToken(s,this.baseHost);t&&(this.state.authToken.set(e,t),c=null!==(n=await X(this.client.requestInterceptors,c))&&void 0!==n?n:c)}}const p=new XMLHttpRequest;c.params&&Object.keys(c.params).length&&(t+="?"+te(c.params));const d=null!==(a=c.host)&&void 0!==a?a:this.state.clientParams.host,u=`${d}${null!==(l=c.version)&&void 0!==l?l:this.state.clientParams.version}${t}`;if(p.open(e,u,!0),c.headers){const e=se(c.headers);for(const[t,s]of Object.entries(e))(d===this.baseHost||"content-type"!==t.toLowerCase())&&p.setRequestHeader(t,s)}c.responseType&&(p.responseType=c.responseType),c.signal&&c.signal.addEventListener("abort",(()=>{p.abort(),i(new Error("Request aborted"))})),!p.upload||e!==exports.RequestMethod.POST&&e!==exports.RequestMethod.PUT&&e!==exports.RequestMethod.PATCH||(p.upload.onprogress=e=>{e.lengthComputable&&c.onUploadProgress&&c.onUploadProgress(e)}),p.onload=async()=>{if(c.signal&&c.signal.aborted)return;let e;switch(c.responseType){case exports.ResponseType.Text:e=p.responseText;break;case exports.ResponseType.Blob:case exports.ResponseType.ArrayBuffer:e=p.response;break;default:try{e=JSON.parse(p.responseText)}catch{e=p.responseText}}const t=new Headers;p.getAllResponseHeaders().split("\r\n").forEach((e=>{const[s,r]=e.split(": ");s&&r&&t.append(s,r)}));const s={status:p.status,statusText:p.statusText,headers:t,url:p.responseURL};if(p.status>=200&&p.status<300)return await X(this.client.responseInterceptors,s),void(c.observe===exports.RequestObserve.Response?r({...s,body:e}):r(e));if(this.state.authToken&&(null==e?void 0:e.code)===ie){const e=await this.tokenUpdate.refreshToken(this.state.authToken.get(0),this.baseHost);e&&this.state.authToken.set(0,e)}const n={...s,error:e};await X(this.client.responseInterceptors,n),i(n)},p.onerror=()=>{i({status:p.status,statusText:p.statusText,url:p.responseURL,error:"Network error"})},p.send(re(c.body))})().catch(i)}))}}const le="/static/extensions",pe="/extensions/defaults",de=`${le}/names/users`,ue=`${le}/names/system`,he=`${le}/tags`;class ge{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(pe,{ext_code:e})}setDefault(e,t){return this.client.rest.post(pe,{ext_code:e,ext_uniq_key:t})}checkUpdates(){return this.client.rest.post(`${le}/check_updates`)}updateVersion(e,t){return this.client.rest.put(`${le}/${e}`,{version:t})}list(e){return this.client.rest.get(le,e)}listTags(e){return this.client.rest.get(he,e)}delete(e,t){return this.client.rest.delete(`${le}/${e}`)}upload(e,t){const s=new FormData;s.set("file",t);const{promise:r,abort:i}=this.client.rest.upload(le,s,{version:ce,onUploadProgress:t=>{e(t)}});return{promise:r,abort:i}}install(e,t){return this.client.rest.post(`${le}/site`,{uniq_key:e,version:t},{version:ce})}getSystemNameExts(e){return this.client.rest.get(ue,e)}getUserNameExts(e){return this.client.rest.get(de,e)}createUserNameExt(e){return this.client.rest.post(`${de}`,{name:e})}deleteUserNameExt(e){return this.client.rest.delete(`${de}/${e}`)}deleteAllUserNameExts(){return this.client.rest.delete(`${de}`)}}const _e="/anons_ext/extensions";class xe{constructor(e){this.client=e}listExtensionsSite(e){return this.client.rest.get(_e,e,{host:"https://next-box.ru"})}extensionDetailSite(e){return this.client.rest.get(`${_e}/${e}`,{},{host:"https://next-box.ru"})}extensionMarkdown(e,t){return this.client.rest.get(`${_e}/${e.uniqKey}/readme`,{lang:e.lang},{...t,host:"https://next-box.ru"})}}const $e="/disk",ve=`${$e}/check`;class me{constructor(e){this.client=e}info(e,t){return this.client.rest.get(`${$e}/${e}/element`,{path:t})}list(e,t){return this.client.rest.get(`${$e}/${e}`,t)}create(e,t){return this.client.rest.post(`${$e}/${e}/element`,t)}replace(e,t,s){return this.client.rest.put(`${$e}/${e}/files?path=${t}`,s)}read(e,t){return this.client.rest.get(`${$e}/${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(`${$e}/${t}/files`,i,{onUploadProgress:t=>{e(t)}});return{promise:n,abort:o}}uploadNet(e,t){return this.client.rest.post(`${$e}/${e}/files/net`,t)}delete(e,t){return this.client.rest.delete(`${$e}/${e}/trash/element`,{path:t})}check(e){return this.client.rest.post(ve,e)}}const Se="/settings";class ye{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 fe;exports.QueryInitViewType=void 0,(fe=exports.QueryInitViewType||(exports.QueryInitViewType={})).Standard="Standard",fe.Simple="Simple";const we="/groups";class Ae{constructor(e){this.client=e}list(e){return this.client.rest.get(we,e)}get(e){return this.client.rest.get(`${we}/${e}`)}listUsers(e,t){return this.client.rest.get(`${we}/${e}/users`,t)}default(){return this.client.rest.get(`${we}/default`)}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 ke="/license",Te=`${ke}/manual-check`,be=`${ke}/hardware/hash`;class Ce{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 Re="/links";class Ee{constructor(e){this.client=e}createShortLink(e){return this.client.rest.post(Re,e)}updateShortLink(e){return this.client.rest.put(Re,e)}}const De="/limitations";class Ue{constructor(e){this.client=e}me(){return this.client.rest.get("/limitations/user/me")}list(e){return this.client.rest.get(De,e)}listUsers(e,t){return this.client.rest.get(`${De}/${e}/users`,t)}create(e){return this.client.rest.post(De,e)}get(e){return this.client.rest.get(`${De}/${e}`)}update(e,t){return this.client.rest.put(`${De}/${e}`,t)}delete(e){return this.client.rest.delete(`${De}/${e}`)}getLimitationsByUser(e){return this.client.rest.get(`/limitations/user/${e}`)}addUserToLimitation(e,t){return this.client.rest.patch(`${De}/${e}/user`,{id:t})}deleteUserFromLimitation(e,t){return this.client.rest.delete(`${De}/${e}/user/${t}`)}}const Pe="/logs/users",Le=`${Pe}/actions`;class Ne{constructor(e){this.client=e}getUsersLogs(e){return this.client.rest.get(`${Pe}`,e)}getLogsActions(e){return this.client.rest.get(`${Le}`,e)}}const Ie="/notifications",Oe=`${Ie}/all`,qe=`${Ie}/subscription`,ze=`${Ie}/permission`,Me=`${Ie}/task`;class Fe{constructor(e){this.client=e}list(e){return this.client.rest.get(Ie,e)}task(e){return this.client.rest.get(`${Me}/${e}`)}toggleStatus(e,t){return this.client.rest.put(Ie,{ids:e,to_status:t})}toggleAllStatus(e){return this.client.rest.put(Oe,{to_status:e})}delete(e){return this.client.rest.delete(Ie,{id:e})}deleteAll(){return this.client.rest.delete(Oe)}getPermission(){return this.client.rest.get(ze)}setPermission(e){return this.client.rest.post(ze,{enabled:e})}getSubscription(){return this.client.rest.get(qe)}setSubscription(e){const t={action_groups:{...e}};return this.client.rest.post(qe,t)}}const Be="/roles",We=`${Be}/default`,He="/permissions";class Ge{constructor(e){this.client=e}list(e){return this.client.rest.get(Be,e)}get(e){return this.client.rest.get(`${Be}/${e}`)}getDefault(){return this.client.rest.get(`${We}`)}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}`)}permissionList(){return this.client.rest.get(He)}addPermission(e,t){return this.client.rest.put(`${Be}/${e}/permissions`,{ids:t})}deletePermission(e,t){return this.client.rest.delete(`${Be}/${e}/${He}`,{ids:t})}}const Ve="/share",je=`${Ve}/restrictions`,Ze=`${Ve}/login`;class Je{constructor(e){this.client=e}info(e){return this.client.rest.get(`${Ve}?share_token=${e}`)}checkPassword(e,t){const s=encodeURIComponent(e);return this.client.rest.get(`${Ve}/password?share_token=${t}&share_pass=${s}`)}getRestriction(e){return this.client.rest.get(`${je}/${e}`)}restrictions(e){return this.client.rest.get(je,e)}restrictionsChange(e,t){return this.client.rest.put(`${je}/${e}`,t)}login(e){return this.client.rest.post(`${Ze}`,e)}}const Ke="/storage/element/version/comment",Qe=`${Ke}/all`;class Ye{constructor(e){this.client=e}list(e){return this.client.rest.get(`${Ke}`,e)}create(e){return this.client.rest.post(`${Ke}`,e)}update(e){return this.client.rest.put(`${Ke}`,e)}delete(e){return this.client.rest.delete(`${Ke}`,e)}deleteAll(e){return this.client.rest.delete(`${Qe}`,e)}}const Xe="/storage",et=`${Xe}/element`,tt=`${et}/divide`,st=`${tt}/resource`,rt=`${et}/move`,it=`${et}/copy`,nt=`${et}/content_type_size`,ot="/disk";class ct{constructor(e,t){this.client=e,this.fcaApiService=t}list(e){return this.client.rest.get(Xe,e)}info(e){var t;return parseInt((null===(t=e.divide_id)||void 0===t?void 0:t.toString())||"")||delete e.divide_id,e.file_version_id||delete e.file_version_id,e.zip_entry_path||delete e.zip_entry_path,this.client.rest.get(et,e)}fileInfo(e,t){return this.client.rest.get(`${et}/${e}`,t?{file_version_id:t}:{})}combineInfo({root:e,rootId:t,path:s,file_version_id:r,zip_entry_path:i}){return e===exports.StorageRoot.fca&&t?this.fcaApiService.info(t,s):this.info({path:s,divide_id:t,file_version_id:r,zip_entry_path:i})}size(e){return this.client.rest.post(`${et}/size`,e)}move(e,t,s){const{from_divide_id:r,to_divide_id:i}=e;let n={...e,from_divide_id:null,to_divide_id:null};return t===exports.StorageRoot.fca&&s===exports.StorageRoot.fca?this.client.rest.post(`${ot}/${r}/files/move${ot}/${i}`,n):t===exports.StorageRoot.fca?(r&&(n.from_divide_id=r),this.client.rest.put(`${ot}/${i}/files/from/box`,n)):s===exports.StorageRoot.fca?(i&&(n.to_divide_id=i),this.client.rest.put(`${ot}/${r}/files/to/box`,n)):this.client.rest.post(rt,e)}copy(e,t,s){const{from_divide_id:r,to_divide_id:i}=e;let n={...e,from_divide_id:null,to_divide_id:null};return s===exports.StorageRoot.fca&&t===exports.StorageRoot.fca?this.client.rest.post(`${ot}/${r}/files/copy${ot}/${i}`,n):s===exports.StorageRoot.fca?(r&&(n.from_divide_id=r),this.client.rest.post(`${ot}/${i}/files/from/box`,n)):t===exports.StorageRoot.fca?(i&&(n.to_divide_id=i),this.client.rest.post(`${ot}/${r}/files/to/box`,n)):this.client.rest.post(it,e)}pasteFromShared(e,t,s){const r={from_sharing_token:e,from_sharing_password:s,paths:t};return this.client.rest.post(`${et}/copy`,r)}create(e){return this.client.rest.post(et,e)}delete(e,t){const s={path:e};return t&&(s.divide_id=t),this.client.rest.delete(et,s)}favorite(e){return this.client.rest.put(`${et}?path=${encodeURIComponent(e)}`,{is_favorite:!0})}removeFavorite(e){return this.client.rest.put(`${et}?path=${encodeURIComponent(e)}`,{is_favorite:!1})}createItem(e){return this.client.rest.post(et,e)}createWorkDir(e){return this.client.rest.post(et,e)}sizeWithSection(e){return this.client.rest.get(nt,e)}getDivideResources(e){return this.client.rest.get(st,e)}getQuota(e){return this.client.rest.get(`${et}/user_size`,e)}hide(e){return this.client.rest.post(`${tt}/hide`,e)}unhide(e){return this.client.rest.post(`${tt}/unhide`,e)}}const at="/storage/files",lt=`${at}/net`,pt=`${at}/unzip`,dt=`${at}/zip`,ut=`${dt}/download`,ht=`${at}/process`,gt=`${at}/code`;class _t{constructor(e){this.client=e}read(e,t){return t.path=e,this.client.rest.get(at,t)}replace(e,t){const s=Object.fromEntries(Object.entries(e).filter((([,e])=>null!=e)).map((([e,t])=>[e,String(t)])));return this.client.rest.put(at,t,{params:s})}upload(e,t,s,r){const i=new FormData;i.set("path",s),r&&i.set("divide_id",r.toString()),i.set("file",t);const{promise:n,abort:o}=this.client.rest.upload(at,i,{onUploadProgress:t=>{e(t)}});return{promise:n,abort:o}}uploadNet(e){return this.client.rest.post(lt,e)}createZipToDownload(e){var t;const s=-(new Date).getTimezoneOffset()/60;return null!==(t=e.time_zone)&&void 0!==t||(e.time_zone=s),this.client.rest.post(ut,e)}createZip(e){var t;const s=-(new Date).getTimezoneOffset()/60;return null!==(t=e.time_zone)&&void 0!==t||(e.time_zone=s),this.client.rest.post(dt,e)}cancelProcess(e){return this.client.rest.delete(ht,e)}unZip(e){return this.client.rest.post(pt,e)}checkZip(e){return this.client.rest.head(gt,e)}}class xt{constructor(e){this.client=e}instance(){return this.client.rest.get("/storage/instance")}}const $t="/storage/element/share";class vt{constructor(e){this.client=e}info(e){return this.client.rest.get($t,{path:e})}create(e,t){const s={path:e,permissions_type:t};return this.client.rest.post($t,s)}change(e){return this.client.rest.put(`${$t}/${e.token}`,e)}delete(e){return this.client.rest.delete($t,{path:e})}refresh(e){return this.client.rest.put(`${$t}/${e}/refresh`)}}const mt="/storage/trash/element",St=`${mt}/all`;class yt{constructor(e){this.client=e}clear(e){return this.client.rest.delete(mt,e)}clearAll(){return this.client.rest.delete(St)}restore(e){return this.client.rest.patch(mt,{del_groups:e})}restoreAll(){return this.client.rest.patch(St)}}const ft="/users",wt=`${ft}/me`,At=`${wt}/avatars`,kt=`${wt}/sessions`,Tt=`${wt}/tokens`,bt=`${wt}/params`,Ct=`${wt}/app-passwords`,Rt=`${wt}/change-password`,Et=`${ft}/initial`,Dt=`${wt}/phone`,Ut=`${Dt}/confirm`;class Pt{constructor(e){this.client=e}initial(e){return this.client.rest.post(Et,e)}list(e){return this.client.rest.get(ft,e)}get(e){return this.client.rest.get(ft+`/${e}`)}create(e){return this.client.rest.post(ft,e)}update(e,t){return this.client.rest.put(ft+`/${e}`,t)}delete(e,t){return this.client.rest.delete(`${ft}/${e}`,t)}restore(e){return this.client.rest.post(`${ft}/${e}/restore`)}me(){return this.client.rest.get(wt)}updateMe(e){return this.client.rest.put(wt,e)}createToken(e){return this.client.rest.post(Tt,e)}listToken(e){return this.client.rest.get(Tt,e)}deleteToken(e){return this.client.rest.delete(`${Tt}/${e}`)}changeMyPassword(e){return this.client.rest.put(Rt,e)}changeUsersPassword(e,t){return this.client.rest.put(`${ft}/${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(kt,e)}meDeleteSession(e){let t=kt;return e&&(t+=`/${e}`),this.client.rest.delete(t)}setRole(e,t=null){return this.client.rest.put(`${ft}/${e}/roles`,{role_id:t})}meParams(e){return this.client.rest.get(bt,{name:e})}meSetParams(e,t){return this.client.rest.post(`${bt}/${e}`,t)}meListParams(){return this.client.rest.get(bt)}phone(e){return this.client.rest.post(Dt,e)}phoneConfirm(e){return this.client.rest.post(`${Ut}/${e}`)}appPasswordsList(e){return this.client.rest.get(Ct,e)}createAppPasswords(e){return this.client.rest.post(Ct,e)}deleteAppPasswords(e){return this.client.rest.delete(`${Ct}/${e}`)}}const Lt="/users/appeals",Nt=`${Lt}/category`,It=`${Lt}/subcategory`,Ot=`${Lt}/file`;class qt{constructor(e){this.client=e}category(){return this.client.rest.get(Nt)}subcategory(e){return this.client.rest.get(It,{category_code:e})}uploadFile(e){const t=new FormData;return t.append("file",e),this.client.rest.post(Ot,t)}deleteFile(e){return this.client.rest.delete(`${Ot}/${e}`)}createAppeal(e){return this.client.rest.post(Lt,e)}}const zt="/storage/element",Mt=`${zt}/history`,Ft=`${zt}/version`,Bt=`${Ft}/lock`,Wt=`${Ft}/unlock`,Ht=`${Ft}/current`,Gt=`${Ft}/size`;class Vt{constructor(e){this.client=e}history(e){return this.client.rest.get(Mt,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(Gt,e)}makeCurrent(e){return this.client.rest.post(Ht,e)}lock(e){return this.client.rest.post(Bt,e)}unlock(e){return this.client.rest.post(Wt,e)}}const jt="/version",Zt=`${jt}/changelog`;class Jt{constructor(e){this.client=e}getVersions(e){return this.client.rest.get(jt,e)}getChangelog(e){return this.client.rest.get(Zt,{version_number:e})}}const Kt="/tag",Qt=`${Kt}/list`;class Yt{constructor(e){this.client=e}list(e){return this.client.rest.get(Qt,e)}get(e){return this.client.rest.get(`${Kt}/${e}`)}assign(e,t){return this.client.rest.post(`${Kt}/${e}/assign`,{items:t})}unassign(e,t){return this.client.rest.post(`${Kt}/${e}/unassign`,{items:t})}create(e){return this.client.rest.post(Kt,e)}update(e,t){return this.client.rest.put(`${Kt}/${e}`,t)}delete(e){return this.client.rest.delete(`${Kt}/${e}`)}}const Xt="/spaces",es=`${Xt}/access`;class ts{constructor(e){this.client=e}space(e){return this.client.rest.get(`${Xt}/${e}`)}list(e){return this.client.rest.get(Xt,e)}create(e){return this.client.rest.post(Xt,e)}update(e,t){return this.client.rest.put(`${Xt}/${e}`,t)}delete(e){return this.client.rest.delete(`${Xt}/${e}`)}adminsList(e,t){return this.client.rest.get(`${Xt}/${e}/admins`,t)}accessList(e){return this.client.rest.get(es,e)}provideAccess(e){return this.client.rest.post(es,e)}deleteAllAccess(e){return this.client.rest.delete(es,e)}updateAccess(e,t){return this.client.rest.put(`${es}/${e}`,t)}deleteAccess(e,t){return this.client.rest.delete(`${es}/${e}`,{space_id:t})}}const ss="/spaces",rs="/files",is="/files/upload";class ns{constructor(e){this.client=e}list(e,t){return this.client.rest.get(`${ss}/${e}${rs}/list`,t)}get(e,t){return this.client.rest.get(`${ss}/${e}${rs}`,t)}create(e,t){return this.client.rest.post(`${ss}/${e}${rs}`,t)}replace(e,t,s){const r=Object.fromEntries(Object.entries(t).filter((([,e])=>null!=e)).map((([e,t])=>[e,String(t)])));return this.client.rest.put(`${ss}/${e}${rs}`,s,{params:r})}delete(e,t){return this.client.rest.delete(`${ss}/${e}${rs}`,t)}copy(e,t){return this.client.rest.post(`${ss}/${e}${rs}/copy`,t)}download(e,t){return this.client.rest.get(`${ss}/${e}${rs}/download`,t,{responseType:exports.ResponseType.Blob})}move(e,t){return this.client.rest.post(`${ss}/${e}${rs}/move`,t)}rename(e,t){return this.client.rest.post(`${ss}/${e}${rs}/rename`,t)}upload(e,t,s,r){var i;const n=new FormData;n.set("overwrite",String(null!==(i=r.overwrite)&&void 0!==i&&i)),n.set("file",s),r.parent_id&&n.set("parent_id",r.parent_id);const{promise:o,abort:c}=this.client.rest.upload(`${ss}/${t}${is}`,n,{onUploadProgress:t=>{e(t)}});return{promise:o,abort:c}}uploadNet(e,t){return this.client.rest.post(`${ss}/${e}${is}/net`,t)}}exports.AuthApiService=i,exports.BASE_URL_V1=oe,exports.BASE_URL_V2=ce,exports.CONNECTIONS_PERMISSION=o,exports.Client=class{constructor(e){this.AuthApiService=new i(this),this.ConnectionsApiService=new H(this),this.DiscoveryApiService=new G(this),this.DivideApiService=new J(this),this.ExtensionsApiService=new ge(this),this.ExtensionsExternalApiService=new xe(this),this.FcaApiService=new me(this),this.GatewayApiService=new ye(this),this.GroupApiService=new Ae(this),this.LicenseApiService=new Ce(this),this.LinksApiService=new Ee(this),this.LimitationsApiService=new Ue(this),this.LogstashApiService=new Ne(this),this.NotificationApiService=new Fe(this),this.RoleApiService=new Ge(this),this.ShareApiService=new Je(this),this.StorageCommentApiService=new Ye(this),this.StorageElementApiService=new ct(this,this.FcaApiService),this.StorageFilesApiService=new _t(this),this.TagsApiService=new Yt(this),this.StorageInstanceApiService=new xt(this),this.StorageShareApiService=new vt(this),this.StorageTrashApiService=new yt(this),this.UserApiService=new Pt(this),this.UsersAppealsApiService=new qt(this),this.VersionApiService=new Vt(this),this.PlatformVersionApiService=new Jt(this),this.SpaceApiService=new ts(this),this.SpaceFilesApiService=new ns(this),this.tokenUpdate=new ne,this.rest=new ae(this,this.tokenUpdate),this.requestInterceptors=[],this.responseInterceptors=[],this.request={use:(e,t)=>{this.requestInterceptors.push({fulfilled:e,rejected:t})}},this.response={use:(e,t)=>{this.responseInterceptors.push({fulfilled:e,rejected:t})}},this.state={clientParams:{host:null==e?void 0:e.host,version:(null==e?void 0:e.version)||oe},requestParams:{path:"",headers:{},query:{},body:null,cache:"no-cache"},authToken:null,skipInterceptors:!1},this.rest.baseHost=this.state.clientParams.host||""}},exports.ConnectionsApiService=H,exports.DiscoveryApiService=G,exports.DivideApiService=J,exports.ExtensionsApiService=ge,exports.ExtensionsExternalApiService=xe,exports.FcaApiService=me,exports.GatewayApiService=ye,exports.GroupApiService=Ae,exports.LicenseApiService=Ce,exports.LimitationsApiService=Ue,exports.LinksApiService=Ee,exports.LogstashApiService=Ne,exports.NEED_TOKEN_UPDATE_ERROR=ie,exports.NotificationApiService=Fe,exports.PlatformVersionApiService=Jt,exports.Rest=ae,exports.RoleApiService=Ge,exports.ShareApiService=Je,exports.SpaceApiService=ts,exports.SpaceFilesApiService=ns,exports.StorageCommentApiService=Ye,exports.StorageElementApiService=ct,exports.StorageFilesApiService=_t,exports.StorageInstanceApiService=xt,exports.StorageShareApiService=vt,exports.StorageTrashApiService=yt,exports.TagsApiService=Yt,exports.TokenUpdate=ne,exports.UserApiService=Pt,exports.UsersAppealsApiService=qt,exports.VersionApiService=Vt,exports.applyInterceptors=X,exports.getCookieValue=ee,exports.makeUrlParams=te,exports.normalizeHeaders=se,exports.prepareRequestBody=re;
|
|
1
|
+
"use strict";const e="/login",t=`${e}/ldap`,s=`${e}/update`,r=`${e}/tfa`;class i{constructor(e){this.client=e}info(){return this.client.rest.get(e)}login(t){return this.client.rest.post(e,t)}ldapLogin(e){return this.client.rest.post(t,e)}loginTfa(e){return this.client.rest.post(r,e)}updateToken(e){const t=e.path?`${e.path}/${s}`:s;return e.path&&delete e.path,this.client.rest.post(t,e)}logout(){return this.client.rest.post("/logout")}}var n;exports.AccessRights=void 0,(n=exports.AccessRights||(exports.AccessRights={})).LicenseRead="license_read",n.LicenseManage="license_edit",n.UsersRead="users_read",n.UsersCreate="users_create",n.UsersActivate="users_activate",n.GroupsRead="groups_read",n.GroupsCreate="groups_create",n.RolesRead="roles_read",n.RolesCreate="roles_create",n.Share="share",n.Divide="divide",n.ExtensionsRead="extensions_read",n.ExtensionsManage="extensions_write",n.RestrictionShareRead="restriction_share_read",n.RestrictionShareWrite="restriction_share_write",n.RestrictionDivideRead="restriction_divide_read",n.RestrictionDivideWrite="restriction_divide_write",n.LimitationsRead="limitations_read",n.LimitationsEdit="limitations_edit",n.ReadUserLogs="read_user_logs",n.ConnectionsRead="connections_read",n.ConnectionsDividing="connections_dividing",n.ConnectionsYandexDisk="connections_yandex_disk",n.ConnectionsSsh="connections_ssh",n.ConnectionsMail="connections_mail",n.ConnectionsS3="connections_s3",n.ConnectionsDiscord="connections_discord",n.ConnectionsWebdav="connections_webdav",n.ConnectionsNextcloud="connections_nextcloud",n.ConnectionsNextbox="connections_nextbox",n.ConnectionsHttpProxy="connections_http_proxy",n.SystemInfoServiceList="system_info_service_list",n.SettingsRead="settings_read",n.SettingsWrite="settings_write",n.DemoAdmin="demo_admin",n.SpaceManage="space_manage";const o=[exports.AccessRights.ConnectionsYandexDisk,exports.AccessRights.ConnectionsSsh,exports.AccessRights.ConnectionsMail,exports.AccessRights.ConnectionsS3,exports.AccessRights.ConnectionsS3,exports.AccessRights.ConnectionsDiscord,exports.AccessRights.ConnectionsWebdav,exports.AccessRights.ConnectionsNextcloud,exports.AccessRights.ConnectionsNextbox,exports.AccessRights.ConnectionsHttpProxy];var c,a,l,p,d,u,h,g,_,x,$,v,m,S,y,f,w,A,k,T,b,C,R,E,D,U,P,L,N,I,O,q,z,M,B;exports.OrderDirection=void 0,(c=exports.OrderDirection||(exports.OrderDirection={})).DEFAULT="",c.ASC="asc",c.DESC="desc",exports.EngineType=void 0,(a=exports.EngineType||(exports.EngineType={})).WebSocket="websocket",a.PostMessage="postmessage",a.Empty="",exports.ColorTypes=void 0,(l=exports.ColorTypes||(exports.ColorTypes={})).Yellow="yellow",l.Success="success",l.Critical="critical",l.Warning="warning",l.Brand="brand",l.Purple="purple",l.Primary="primary",l.Gray="gray",exports.ConnectionGroup=void 0,(p=exports.ConnectionGroup||(exports.ConnectionGroup={})).Storages="storages_connections_group",p.Webhooks="webhooks_connections_group",p.Unknown="unknown_connections_group",p.Proxy="proxy_connections_group",exports.ConnectionType=void 0,(d=exports.ConnectionType||(exports.ConnectionType={})).SSH="ssh_connection",d.YandexDisk="yandex_disk",d.Mail="mail",d.Discord="discord",d.Webdav="webdav_connection",d.Nextcloud="nextcloud_connection",d.NextBox="nextbox_connection",d.HttpProxy="http_proxy_connection",d.S3="s3_connection",exports.ExtensionType=void 0,(u=exports.ExtensionType||(exports.ExtensionType={})).App="app",u.File="file",u.WorkDir="work_dir",exports.ExtensionFileMode=void 0,(h=exports.ExtensionFileMode||(exports.ExtensionFileMode={})).Read="read",h.ReadAndWrite="read_and_write",h.Write="write",exports.DivideScope=void 0,(g=exports.DivideScope||(exports.DivideScope={})).Storage="/storage/element",g.Connection="/connections",exports.PermissionType=void 0,(_=exports.PermissionType||(exports.PermissionType={})).Close="",_.Read="r",_.Write="rw",_.Full="rwd",_.SpaceManage="space_manage",exports.RestrictionStatus=void 0,(x=exports.RestrictionStatus||(exports.RestrictionStatus={})).WAITING="waiting",x.APPROVED="approved",x.REJECTED="rejected",exports.RestrictionBooleanStatus=void 0,($=exports.RestrictionBooleanStatus||(exports.RestrictionBooleanStatus={})).TRUE="true",$.FALSE="false",exports.DivideMode=void 0,(v=exports.DivideMode||(exports.DivideMode={})).User="to_user_id",v.Group="to_user_group_id",exports.RestrictionModeKey=void 0,(m=exports.RestrictionModeKey||(exports.RestrictionModeKey={})).Divide="divide",m.Share="share",exports.Tariff=void 0,(S=exports.Tariff||(exports.Tariff={})).Free="free",S.Business="business",S.Enterprise="enterprise",exports.LicenseError=void 0,(y=exports.LicenseError||(exports.LicenseError={})).NotActivated="License not activated",y.Blocked="License blocked",y.Expired="License has been expired",y.NotValid="License not valid",y.NotFound="license file not found",exports.LimitationType=void 0,(f=exports.LimitationType||(exports.LimitationType={})).BySize="size",f.ByExt="extension",f.ByQuota="quota_size",exports.LimitationSubType=void 0,(w=exports.LimitationSubType||(exports.LimitationSubType={})).Size="size",w.White="extension_white",w.Black="extension_black",exports.NotificationEntityType=void 0,(A=exports.NotificationEntityType||(exports.NotificationEntityType={})).Dir="dir",A.File="file",A.User="user",A.Other="other",A.WorkDir="work_dir",A.License="license",A.Extension="extension",A.Connection="connection",exports.NotificationAction=void 0,(k=exports.NotificationAction||(exports.NotificationAction={})).SecurityCheckNegative="action_security_check_negative",k.SecurityCheckPositive="action_security_check_positive",k.CommentVersionMention="action_version_comment_mention",k.OpenSharing="open_sharing",k.ChangeSharing="change_sharing",k.CancelSharing="cancel_sharing",k.DivideDirAddFileToOwner="divide_dir_add_file_to_owner",k.DivideDirAddDirToOwner="divide_dir_add_dir_to_owner",k.DivideDirAddWorkDirToOwner="divide_dir_add_work_dir_to_owner",k.DivideConnectionAddFileToOwner="divide_connection_add_file_to_owner",k.DivideConnectionAddDirToOwner="divide_connection_add_dir_to_owner",k.CancelDivideDir="cancel_divide_dir",k.CancelDivideFile="cancel_divide_file",k.CancelDivideWorkDir="cancel_divide_work_dir",k.CancelDivideConnection="cancel_divide_connection",k.DeleteExtension="delete_extension",k.NewVersionExtension="new_version_extension",k.TransferData="transfer_data",k.AllowInternalAccessUser="allow_internal_access_to_user",k.BlockInternalAccessUser="block_internal_access_to_user",k.WaitInternalAccessUser="wait_internal_access_to_user",k.WaitInternalAccessUserCreate="wait_internal_access_to_user_create",k.AllowInternalAccessGroup="allow_internal_access_to_group",k.BlockInternalAccessGroup="block_internal_access_to_group",k.WaitInternalAccessGroup="wait_internal_access_to_group",k.WaitInternalAccessGroupCreate="wait_internal_access_to_group_create",k.AllowSharing="allow_sharing",k.BlockSharing="block_sharing",k.WaitSharing="wait_sharing",k.WaitSharingCreate="wait_sharing_create",k.StatusCreateZipProcess="status_create_zip_process",k.StatusCreateZipSuccess="status_create_zip_success",k.StatusCreateZipError="status_create_zip_error",k.DownloadZipSuccess="download_zip_success",k.DownloadZipError="download_zip_error",k.StatusUnzipProcess="status_unzip_process",k.StatusUnzipSuccess="status_unzip_success",k.StatusUnzipError="status_unzip_error",k.StatusUnzipSuccessWithLimits="status_unzip_success_with_limits",k.AnonymZipDirAddFileToOwner="anonym_zip_dir_add_file_to_owner",k.GuestZipDirAddFileToOwner="guest_zip_dir_add_file_to_owner",k.DropDocumentOnlyoffice="drop_document_onlyoffice",k.CopyError="copy_error",k.CopySuccess="copy_success",k.StatusCopyProcess="status_copy_process",k.Other="other",k.Application="application",exports.NotificationRowAction=void 0,(T=exports.NotificationRowAction||(exports.NotificationRowAction={})).Read="read",T.Unread="unread",T.Delete="delete",exports.NotificationStyle=void 0,(b=exports.NotificationStyle||(exports.NotificationStyle={})).Plain="plain",b.Success="success",b.Info="info",b.Warning="warning",b.Error="error",exports.ResponseType=void 0,(C=exports.ResponseType||(exports.ResponseType={})).ArrayBuffer="arraybuffer",C.Blob="blob",C.Json="json",C.Text="text",exports.RequestMethod=void 0,(R=exports.RequestMethod||(exports.RequestMethod={})).GET="GET",R.POST="POST",R.PUT="PUT",R.PATCH="PATCH",R.DELETE="DELETE",R.HEAD="HEAD",exports.RequestObserve=void 0,(E=exports.RequestObserve||(exports.RequestObserve={})).Body="body",E.Response="response",exports.RestrictionSharing=void 0,(D=exports.RestrictionSharing||(exports.RestrictionSharing={})).NONE="none",D.SOFT="soft",D.HARD="hard",exports.UserAuthType=void 0,(U=exports.UserAuthType||(exports.UserAuthType={})).Native="native",U.Ldap="ldap",U.Vk="vk",exports.UserStatus=void 0,(P=exports.UserStatus||(exports.UserStatus={})).Registering="registering",P.Activated="activated",P.BlockedByAdmin="blocked_by_admin",P.BlockedByLicense="blocked_by_license",P.BlockedByInactive="blocked_by_inactive",P.BlockedByInactiveChangePassword="blocked_by_inactive_change_password",exports.UserType=void 0,(L=exports.UserType||(exports.UserType={})).User="user",L.Guest="guest",L.Emperor="emperor",L.Anonymous="anonymous",exports.UserParamsLabel=void 0,(N=exports.UserParamsLabel||(exports.UserParamsLabel={})).Theme="theme",N.Lang="lang",N.Sort="sort",N.ViewApps="viewApps",N.WithoutContentWorkDir="withoutContentWorkDir",N.DashboardGrid="dashboardGrid",exports.UserAppType=void 0,(exports.UserAppType||(exports.UserAppType={})).Webdav="webdav",exports.SettingControlType=void 0,(I=exports.SettingControlType||(exports.SettingControlType={})).Text="text",I.String="string",I.Number="number",I.CheckBox="checkbox",I.Select="select",I.RadioList="radio_list",I.ConnectionChoose="connection_choose",I.MultiConnectionChoose="multi_connection_choose",exports.StorageElementType=void 0,(O=exports.StorageElementType||(exports.StorageElementType={})).Dir="dir",O.File="file",O.WorkDir="work_dir",O.App="app",exports.StorageElementContentType=void 0,(q=exports.StorageElementContentType||(exports.StorageElementContentType={})).Any="any",q.Dir="dir",q.Code="code",q.Image="image",q.Audio="audio",q.Video="video",q.Text="text",q.Doc="doc",q.Xls="xls",q.Ppt="ppt",exports.StorageRoot=void 0,(z=exports.StorageRoot||(exports.StorageRoot={})).my="my",z.fca="fca",z.divide="divide",z.share="share",z.favorite="favorite",z.trash="trash",z.spaces="spaces",exports.StorageElementHistoryAction=void 0,(M=exports.StorageElementHistoryAction||(exports.StorageElementHistoryAction={})).Create="create",M.Update="update",M.Move="move",exports.StorageElementCheckStatus=void 0,(B=exports.StorageElementCheckStatus||(exports.StorageElementCheckStatus={}))[B.CheckNull=0]="CheckNull",B[B.CheckInProgress=1]="CheckInProgress",B[B.CheckPositive=2]="CheckPositive",B[B.CheckNegative=3]="CheckNegative";const F="/connections",W=`${F}/dashboard`;class H{constructor(e){this.client=e}list(e){return this.client.rest.get(F,e)}get(e){return this.client.rest.get(`${F}/${e}`)}update(e,t){return this.client.rest.put(`${F}/${e}`,t)}delete(e){return this.client.rest.delete(`${F}/${e}`)}create(e){const t={[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]||F,e)}dashboard(e){return this.client.rest.get(W,e)}}class G{constructor(e){this.client=e}discovery(e){return this.client.rest.get("/discovery",e)}}const V="/divide",j=`${V}/restrictions`,Z=`${V}/tag_group`;class J{constructor(e){this.client=e}divideDelete(e,t){return this.client.rest.delete(`${e}${V}/${t}`)}divideDeleteAll(e,t,s,r){return this.client.rest.delete(`${e}${V}`,{...this.makeParam(e,t),is_to_user_group:r,access_mode:s})}divideChange(e,t,s){return this.client.rest.put(`${e}${V}/${t}`,{access_mode:s})}divideCreate(e,t,s,r,i){const n={...this.makeParam(e,t),[i]:s,access_mode:r};return this.client.rest.post(`${e}${V}`,n)}divideUsers(e,t,s){return this.client.rest.get(`${e}${V}/users`,{...this.makeParam(e,t),...s})}divideTagGroupList(e){return this.client.rest.get(`${exports.DivideScope.Storage}${Z}`,e)}getRestriction(e){return this.client.rest.get(`${j}/${e}`)}restrictionSize(e,t){return this.client.rest.get(`/${t}/restrictions/${e}/size`)}restrictions(e){return this.client.rest.get(`${j}`,e)}restrictionsChange(e,t){return this.client.rest.put(`${j}/${e}`,t)}makeParam(e,t){const s={};return e===exports.DivideScope.Connection?s.connection_id=t:s.path=t,s}}const K="/api/v1",Q="/api/v2",Y="/static/extensions",X="/extensions/defaults",ee=`${Y}/names/users`,te=`${Y}/names/system`,se=`${Y}/tags`;class re{constructor(e){this.client=e}getSetting(e){return this.client.rest.get(`${Y}/${e}/settings`)}setSetting(e,t){return this.client.rest.post(`${Y}/${e}/settings`,t)}deleteSetting(e){return this.client.rest.delete(`${Y}/${e}/settings`)}get(e){return this.client.rest.get(`${Y}/${e}`)}getByKey(e){return this.client.rest.get(`${Y}/${e}`)}getDefault(e=[]){return this.client.rest.get(X,{ext_code:e})}setDefault(e,t){return this.client.rest.post(X,{ext_code:e,ext_uniq_key:t})}checkUpdates(){return this.client.rest.post(`${Y}/check_updates`)}updateVersion(e,t){return this.client.rest.put(`${Y}/${e}`,{version:t})}list(e){return this.client.rest.get(Y,e)}listTags(e){return this.client.rest.get(se,e)}delete(e,t){return this.client.rest.delete(`${Y}/${e}`)}upload(e,t){const s=new FormData;s.set("file",t);const{promise:r,abort:i}=this.client.rest.upload(Y,s,{version:Q,onUploadProgress:t=>{e(t)}});return{promise:r,abort:i}}install(e,t){return this.client.rest.post(`${Y}/site`,{uniq_key:e,version:t},{version:Q})}getSystemNameExts(e){return this.client.rest.get(te,e)}getUserNameExts(e){return this.client.rest.get(ee,e)}createUserNameExt(e){return this.client.rest.post(`${ee}`,{name:e})}deleteUserNameExt(e){return this.client.rest.delete(`${ee}/${e}`)}deleteAllUserNameExts(){return this.client.rest.delete(`${ee}`)}}const ie="/anons_ext/extensions";class ne{constructor(e){this.client=e}listExtensionsSite(e){return this.client.rest.get(ie,e,{host:"https://next-box.ru"})}extensionDetailSite(e){return this.client.rest.get(`${ie}/${e}`,{},{host:"https://next-box.ru"})}extensionMarkdown(e,t){return this.client.rest.get(`${ie}/${e.uniqKey}/readme`,{lang:e.lang},{...t,host:"https://next-box.ru"})}}const oe="/disk",ce=`${oe}/check`;class ae{constructor(e){this.client=e}info(e,t){return this.client.rest.get(`${oe}/${e}/element`,{path:t})}list(e,t){return this.client.rest.get(`${oe}/${e}`,t)}create(e,t){return this.client.rest.post(`${oe}/${e}/element`,t)}replace(e,t,s){return this.client.rest.put(`${oe}/${e}/files?path=${t}`,s)}read(e,t){return this.client.rest.get(`${oe}/${e}/files?path=${t}`)}upload(e,t,s,r=""){const i=new FormData;i.set("path",r),i.set("file",s);const{promise:n,abort:o}=this.client.rest.upload(`${oe}/${t}/files`,i,{onUploadProgress:t=>{e(t)}});return{promise:n,abort:o}}uploadNet(e,t){return this.client.rest.post(`${oe}/${e}/files/net`,t)}delete(e,t){return this.client.rest.delete(`${oe}/${e}/trash/element`,{path:t})}check(e){return this.client.rest.post(ce,e)}}const le="/settings";class pe{constructor(e){this.client=e}settings(){return this.client.rest.get(le)}changeSettings(e){return this.client.rest.post(le,e)}queryInit(){return this.client.rest.get("/query/init")}}var de;exports.QueryInitViewType=void 0,(de=exports.QueryInitViewType||(exports.QueryInitViewType={})).Standard="Standard",de.Simple="Simple";const ue="/groups";class he{constructor(e){this.client=e}list(e){return this.client.rest.get(ue,e)}get(e){return this.client.rest.get(`${ue}/${e}`)}listUsers(e,t){return this.client.rest.get(`${ue}/${e}/users`,t)}default(){return this.client.rest.get(`${ue}/default`)}create(e){return this.client.rest.post(ue,e)}update(e,t){return this.client.rest.put(`${ue}/${e}`,t)}delete(e){return this.client.rest.delete(`${ue}/${e}`)}}const ge="/license",_e=`${ge}/manual-check`,xe=`${ge}/hardware/hash`;class $e{constructor(e){this.client=e}info(){return this.client.rest.get(ge)}create(e){return this.client.rest.post(ge,e)}check(){return this.client.rest.post(_e)}delete(){return this.client.rest.delete(ge)}getHash(){return this.client.rest.get(xe)}}const ve="/links";class me{constructor(e){this.client=e}createShortLink(e){return this.client.rest.post(ve,e)}updateShortLink(e){return this.client.rest.put(ve,e)}}const Se="/limitations";class ye{constructor(e){this.client=e}me(){return this.client.rest.get("/limitations/user/me")}list(e){return this.client.rest.get(Se,e)}listUsers(e,t){return this.client.rest.get(`${Se}/${e}/users`,t)}create(e){return this.client.rest.post(Se,e)}get(e){return this.client.rest.get(`${Se}/${e}`)}update(e,t){return this.client.rest.put(`${Se}/${e}`,t)}delete(e){return this.client.rest.delete(`${Se}/${e}`)}getLimitationsByUser(e){return this.client.rest.get(`/limitations/user/${e}`)}addUserToLimitation(e,t){return this.client.rest.patch(`${Se}/${e}/user`,{id:t})}deleteUserFromLimitation(e,t){return this.client.rest.delete(`${Se}/${e}/user/${t}`)}}const fe="/logs/users",we=`${fe}/actions`;class Ae{constructor(e){this.client=e}getUsersLogs(e){return this.client.rest.get(`${fe}`,e)}getLogsActions(e){return this.client.rest.get(`${we}`,e)}}const ke="/notifications",Te=`${ke}/all`,be=`${ke}/subscription`,Ce=`${ke}/permission`,Re=`${ke}/task`;class Ee{constructor(e){this.client=e}list(e){return this.client.rest.get(ke,e)}task(e){return this.client.rest.get(`${Re}/${e}`)}toggleStatus(e,t){return this.client.rest.put(ke,{ids:e,to_status:t})}toggleAllStatus(e){return this.client.rest.put(Te,{to_status:e})}delete(e){return this.client.rest.delete(ke,{id:e})}deleteAll(){return this.client.rest.delete(Te)}getPermission(){return this.client.rest.get(Ce)}setPermission(e){return this.client.rest.post(Ce,{enabled:e})}getSubscription(){return this.client.rest.get(be)}setSubscription(e){const t={action_groups:{...e}};return this.client.rest.post(be,t)}}const De="/roles",Ue=`${De}/default`,Pe="/permissions";class Le{constructor(e){this.client=e}list(e){return this.client.rest.get(De,e)}get(e){return this.client.rest.get(`${De}/${e}`)}getDefault(){return this.client.rest.get(`${Ue}`)}create(e){return this.client.rest.post(De,e)}update(e,t){return this.client.rest.put(`${De}/${e}`,t)}delete(e){return this.client.rest.delete(`${De}/${e}`)}permissionList(){return this.client.rest.get(Pe)}addPermission(e,t){return this.client.rest.put(`${De}/${e}/permissions`,{ids:t})}deletePermission(e,t){return this.client.rest.delete(`${De}/${e}/${Pe}`,{ids:t})}}const Ne="/share",Ie=`${Ne}/restrictions`,Oe=`${Ne}/login`;class qe{constructor(e){this.client=e}info(e){return this.client.rest.get(`${Ne}?share_token=${e}`)}checkPassword(e,t){const s=encodeURIComponent(e);return this.client.rest.get(`${Ne}/password?share_token=${t}&share_pass=${s}`)}getRestriction(e){return this.client.rest.get(`${Ie}/${e}`)}restrictions(e){return this.client.rest.get(Ie,e)}restrictionsChange(e,t){return this.client.rest.put(`${Ie}/${e}`,t)}login(e){return this.client.rest.post(`${Oe}`,e)}}const ze="/storage/element/version/comment",Me=`${ze}/all`;class Be{constructor(e){this.client=e}list(e){return this.client.rest.get(`${ze}`,e)}create(e){return this.client.rest.post(`${ze}`,e)}update(e){return this.client.rest.put(`${ze}`,e)}delete(e){return this.client.rest.delete(`${ze}`,e)}deleteAll(e){return this.client.rest.delete(`${Me}`,e)}}const Fe="/storage",We=`${Fe}/element`,He=`${We}/divide`,Ge=`${He}/resource`,Ve=`${We}/move`,je=`${We}/copy`,Ze=`${We}/content_type_size`,Je="/disk";class Ke{constructor(e,t){this.client=e,this.fcaApiService=t}list(e){return this.client.rest.get(Fe,e)}info(e){var t;return parseInt((null===(t=e.divide_id)||void 0===t?void 0:t.toString())||"")||delete e.divide_id,e.file_version_id||delete e.file_version_id,e.zip_entry_path||delete e.zip_entry_path,this.client.rest.get(We,e)}fileInfo(e,t){return this.client.rest.get(`${We}/${e}`,t?{file_version_id:t}:{})}combineInfo({root:e,rootId:t,path:s,file_version_id:r,zip_entry_path:i}){return e===exports.StorageRoot.fca&&t?this.fcaApiService.info(t,s):this.info({path:s,divide_id:t,file_version_id:r,zip_entry_path:i})}size(e){return this.client.rest.post(`${We}/size`,e)}move(e,t,s){const{from_divide_id:r,to_divide_id:i}=e;let n={...e,from_divide_id:null,to_divide_id:null};return t===exports.StorageRoot.fca&&s===exports.StorageRoot.fca?this.client.rest.post(`${Je}/${r}/files/move${Je}/${i}`,n):t===exports.StorageRoot.fca?(r&&(n.from_divide_id=r),this.client.rest.put(`${Je}/${i}/files/from/box`,n)):s===exports.StorageRoot.fca?(i&&(n.to_divide_id=i),this.client.rest.put(`${Je}/${r}/files/to/box`,n)):this.client.rest.post(Ve,e)}copy(e,t,s){const{from_divide_id:r,to_divide_id:i}=e;let n={...e,from_divide_id:null,to_divide_id:null};return s===exports.StorageRoot.fca&&t===exports.StorageRoot.fca?this.client.rest.post(`${Je}/${r}/files/copy${Je}/${i}`,n):s===exports.StorageRoot.fca?(r&&(n.from_divide_id=r),this.client.rest.post(`${Je}/${i}/files/from/box`,n)):t===exports.StorageRoot.fca?(i&&(n.to_divide_id=i),this.client.rest.post(`${Je}/${r}/files/to/box`,n)):this.client.rest.post(je,e)}pasteFromShared(e,t,s){const r={from_sharing_token:e,from_sharing_password:s,paths:t};return this.client.rest.post(`${We}/copy`,r)}create(e){return this.client.rest.post(We,e)}delete(e,t){const s={path:e};return t&&(s.divide_id=t),this.client.rest.delete(We,s)}favorite(e){return this.client.rest.put(`${We}?path=${encodeURIComponent(e)}`,{is_favorite:!0})}removeFavorite(e){return this.client.rest.put(`${We}?path=${encodeURIComponent(e)}`,{is_favorite:!1})}createItem(e){return this.client.rest.post(We,e)}createWorkDir(e){return this.client.rest.post(We,e)}sizeWithSection(e){return this.client.rest.get(Ze,e)}getDivideResources(e){return this.client.rest.get(Ge,e)}getQuota(e){return this.client.rest.get(`${We}/user_size`,e)}hide(e){return this.client.rest.post(`${He}/hide`,e)}unhide(e){return this.client.rest.post(`${He}/unhide`,e)}}const Qe="/storage/files",Ye=`${Qe}/net`,Xe=`${Qe}/unzip`,et=`${Qe}/zip`,tt=`${et}/download`,st=`${Qe}/process`,rt=`${Qe}/code`;class it{constructor(e){this.client=e}read(e,t){return t.path=e,this.client.rest.get(Qe,t)}replace(e,t){const s=Object.fromEntries(Object.entries(e).filter((([,e])=>null!=e)).map((([e,t])=>[e,String(t)])));return this.client.rest.put(Qe,t,{params:s})}upload(e,t,s,r){const i=new FormData;i.set("path",s),r&&i.set("divide_id",r.toString()),i.set("file",t);const{promise:n,abort:o}=this.client.rest.upload(Qe,i,{onUploadProgress:t=>{e(t)}});return{promise:n,abort:o}}uploadNet(e){return this.client.rest.post(Ye,e)}createZipToDownload(e){var t;const s=-(new Date).getTimezoneOffset()/60;return null!==(t=e.time_zone)&&void 0!==t||(e.time_zone=s),this.client.rest.post(tt,e)}createZip(e){var t;const s=-(new Date).getTimezoneOffset()/60;return null!==(t=e.time_zone)&&void 0!==t||(e.time_zone=s),this.client.rest.post(et,e)}cancelProcess(e){return this.client.rest.delete(st,e)}unZip(e){return this.client.rest.post(Xe,e)}checkZip(e){return this.client.rest.head(rt,e)}}class nt{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 pt{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 dt="/users",ut=`${dt}/me`,ht=`${ut}/avatars`,gt=`${ut}/sessions`,_t=`${ut}/tokens`,xt=`${ut}/params`,$t=`${ut}/app-passwords`,vt=`${ut}/change-password`,mt=`${dt}/initial`,St=`${ut}/phone`,yt=`${St}/confirm`;class ft{constructor(e){this.client=e}initial(e){return this.client.rest.post(mt,e)}list(e){return this.client.rest.get(dt,e)}get(e){return this.client.rest.get(dt+`/${e}`)}create(e){return this.client.rest.post(dt,e)}update(e,t){return this.client.rest.put(dt+`/${e}`,t)}delete(e,t){return this.client.rest.delete(`${dt}/${e}`,t)}restore(e){return this.client.rest.post(`${dt}/${e}/restore`)}me(){return this.client.rest.get(ut)}updateMe(e){return this.client.rest.put(ut,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(vt,e)}changeUsersPassword(e,t){return this.client.rest.put(`${dt}/${e}/change-password`,t)}meUploadAvatar(e,t){const s=new FormData;return s.append("file",e,t),this.client.rest.post(ht,s)}meDeleteAvatar(){return this.client.rest.delete(ht)}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(`${dt}/${e}/roles`,{role_id:t})}meParams(e){return this.client.rest.get(xt,{name:e})}meSetParams(e,t){return this.client.rest.post(`${xt}/${e}`,t)}meListParams(){return this.client.rest.get(xt)}phone(e){return this.client.rest.post(St,e)}phoneConfirm(e){return this.client.rest.post(`${yt}/${e}`)}appPasswordsList(e){return this.client.rest.get($t,e)}createAppPasswords(e){return this.client.rest.post($t,e)}deleteAppPasswords(e){return this.client.rest.delete(`${$t}/${e}`)}}const wt="/users/appeals",At=`${wt}/category`,kt=`${wt}/subcategory`,Tt=`${wt}/file`;class bt{constructor(e){this.client=e}category(){return this.client.rest.get(At)}subcategory(e){return this.client.rest.get(kt,{category_code:e})}uploadFile(e){const t=new FormData;return t.append("file",e),this.client.rest.post(Tt,t)}deleteFile(e){return this.client.rest.delete(`${Tt}/${e}`)}createAppeal(e){return this.client.rest.post(wt,e)}}const Ct="/storage/element",Rt=`${Ct}/history`,Et=`${Ct}/version`,Dt=`${Et}/lock`,Ut=`${Et}/unlock`,Pt=`${Et}/current`,Lt=`${Et}/size`;class Nt{constructor(e){this.client=e}history(e){return this.client.rest.get(Rt,e)}versions(e){return this.client.rest.get(Et,e)}create(e){return this.client.rest.post(Et,e)}edit(e){return this.client.rest.put(Et,e)}delete(e){return this.client.rest.delete(Et,e)}size(e){return this.client.rest.get(Lt,e)}makeCurrent(e){return this.client.rest.post(Pt,e)}lock(e){return this.client.rest.post(Dt,e)}unlock(e){return this.client.rest.post(Ut,e)}}const It="/version",Ot=`${It}/changelog`;class qt{constructor(e){this.client=e}getVersions(e){return this.client.rest.get(It,e)}getChangelog(e){return this.client.rest.get(Ot,{version_number:e})}}const zt="/tag",Mt=`${zt}/list`;class Bt{constructor(e){this.client=e}list(e){return this.client.rest.get(Mt,e)}get(e){return this.client.rest.get(`${zt}/${e}`)}assign(e,t){return this.client.rest.post(`${zt}/${e}/assign`,{items:t})}unassign(e,t){return this.client.rest.post(`${zt}/${e}/unassign`,{items:t})}create(e){return this.client.rest.post(zt,e)}update(e,t){return this.client.rest.put(`${zt}/${e}`,t)}delete(e){return this.client.rest.delete(`${zt}/${e}`)}}const Ft="/spaces",Wt=`${Ft}/access`;class Ht{constructor(e){this.client=e}space(e){return this.client.rest.get(`${Ft}/${e}`)}list(e){return this.client.rest.get(Ft,e)}create(e){return this.client.rest.post(Ft,e)}update(e,t){return this.client.rest.put(`${Ft}/${e}`,t)}delete(e){return this.client.rest.delete(`${Ft}/${e}`)}adminsList(e,t){return this.client.rest.get(`${Ft}/${e}/admins`,t)}accessList(e){return this.client.rest.get(Wt,e)}provideAccess(e){return this.client.rest.post(Wt,e)}deleteAllAccess(e){return this.client.rest.delete(Wt,e)}updateAccess(e,t){return this.client.rest.put(`${Wt}/${e}`,t)}deleteAccess(e,t){return this.client.rest.delete(`${Wt}/${e}`,{space_id:t})}}const Gt="/spaces",Vt="/files",jt=`${Vt}/upload`,Zt=`${`${Vt}/download`}/zip`;class Jt{constructor(e){this.client=e}list(e,t){return this.client.rest.get(`${Gt}/${e}${Vt}/list`,t)}get(e,t){return this.client.rest.get(`${Gt}/${e}${Vt}`,t)}create(e,t){return this.client.rest.post(`${Gt}/${e}${Vt}`,t)}replace(e,t,s){const r=Object.fromEntries(Object.entries(t).filter((([,e])=>null!=e)).map((([e,t])=>[e,String(t)])));return this.client.rest.put(`${Gt}/${e}${Vt}`,s,{params:r})}delete(e,t){return this.client.rest.delete(`${Gt}/${e}${Vt}`,t)}copy(e,t){return this.client.rest.post(`${Gt}/${e}${Vt}/copy`,t)}download(e,t){return this.client.rest.get(`${Gt}/${e}${Vt}/download`,t,{responseType:exports.ResponseType.Blob})}createZipToDownload(e,t){return this.client.rest.get(`${Gt}/${e}${Zt}`,t,{responseType:exports.ResponseType.Blob})}move(e,t){return this.client.rest.post(`${Gt}/${e}${Vt}/move`,t)}rename(e,t){return this.client.rest.post(`${Gt}/${e}${Vt}/rename`,t)}upload(e,t,s,r){var i;const n=new FormData;n.set("overwrite",String(null!==(i=r.overwrite)&&void 0!==i&&i)),r.parent_id&&n.set("parent_id",r.parent_id),n.set("file",s);const{promise:o,abort:c}=this.client.rest.upload(`${Gt}/${t}${jt}`,n,{onUploadProgress:t=>{e(t)}});return{promise:o,abort:c}}uploadNet(e,t){return this.client.rest.post(`${Gt}/${e}${jt}/net`,t)}}class Kt extends Error{}function Qt(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 Yt(e,t){if("string"!=typeof e)throw new Kt("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 Kt(`Invalid token specified: missing part #${s+1}`);let i;try{i=Qt(r)}catch(e){throw new Kt(`Invalid token specified: invalid base64 for part #${s+1} (${e.message})`)}try{return JSON.parse(i)}catch(e){throw new Kt(`Invalid token specified: invalid json for part #${s+1} (${e.message})`)}}Kt.prototype.name="InvalidTokenError";const Xt=async(e,t)=>{let s=t;for(const t of e)try{s=await t.fulfilled(s)}catch(e){if(!t.rejected)throw e;s=await t.rejected(e)}return s};function es(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 ts=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 ss(e){return e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):e}function rs(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 is="update black token";class ns{constructor(){this.isUpdating=!1,this.tokenUpdateResolve=null}isTokenExpire(e){if(!e)return!1;return 1e3*e<=(new Date).getTime()+3e3}async refreshToken(e,t){const{access_token:s,refresh_token:r}=e;return s&&r?this.isUpdating?this.waitForTokenUpdate():(this.isUpdating=!0,new Promise(((e,i)=>{const n=new XMLHttpRequest,o=`${t}${K}/login/update`;n.open("POST",o,!0),n.setRequestHeader("Content-Type","application/json"),n.send(JSON.stringify({access_token:s,refresh_token:r})),n.onload=()=>{if(n.status>=200&&n.status<300)try{const t=JSON.parse(n.responseText);if(t&&t.access_token&&t.refresh_token){const s={access_token:t.access_token,refresh_token:t.refresh_token};es("access_token")===s.access_token&&localStorage.setItem("refresh-token",s.refresh_token),this.tokenUpdateResolve&&(this.tokenUpdateResolve(s),this.tokenUpdateResolve=null),e(s)}else e(null)}catch(e){i(new Error("Failed to parse response JSON."))}else e(null)},n.onerror=()=>{i(new Error("Network error occurred"))},n.onloadend=()=>{this.isUpdating=!1}}))):null}async waitForTokenUpdate(){return new Promise((e=>{const t=setInterval((()=>{this.isUpdating||(clearInterval(t),e())}),100)}))}}class os{constructor(e,t){this.client=e,this.tokenUpdate=t,this.baseHost=""}get state(){return this.client.state}get(e,t,s){return this.request(exports.RequestMethod.GET,e,{params:t,cache:"no-cache",...s})}post(e,t,s){return this.request(exports.RequestMethod.POST,e,{body:t,...s})}put(e,t,s){return this.request(exports.RequestMethod.PUT,e,{body:t,cache:"no-cache",...s})}patch(e,t,s){return this.request(exports.RequestMethod.PATCH,e,{body:t,...s})}delete(e,t,s){return this.request(exports.RequestMethod.DELETE,e,{params:t,...s})}head(e,t,s){return this.request(exports.RequestMethod.HEAD,e,{params:t,...s})}upload(e,t,s){const r=new AbortController,i=r.signal;return{promise:this.request(exports.RequestMethod.POST,e,{body:t,signal:i,...s}),abort:()=>r.abort()}}request(e,t,s){return new Promise(((r,i)=>{var n;const o=null!==(n=this.state.skipInterceptors)&&void 0!==n&&n;this.state.skipInterceptors=!1;let c={method:e,...s};(null==s?void 0:s.signal)&&(c.signal=s.signal);(async()=>{var s,n,a,l;if(o||(c=null!==(s=await Xt(this.client.requestInterceptors,c))&&void 0!==s?s:c),this.state.authToken)for(const[e,s]of this.state.authToken.entries()){const r=Yt(s.access_token);if(r&&r.is_remember&&this.tokenUpdate.isTokenExpire(r.exp)&&!t.includes("/login")&&!t.includes("/assets")){const t=await this.tokenUpdate.refreshToken(s,this.baseHost);t&&(this.state.authToken.set(e,t),c=null!==(n=await Xt(this.client.requestInterceptors,c))&&void 0!==n?n:c)}}const p=new XMLHttpRequest;c.params&&Object.keys(c.params).length&&(t+="?"+ts(c.params));const d=null!==(a=c.host)&&void 0!==a?a:this.state.clientParams.host,u=`${d}${null!==(l=c.version)&&void 0!==l?l:this.state.clientParams.version}${t}`;if(p.open(e,u,!0),c.headers){const e=ss(c.headers);for(const[t,s]of Object.entries(e))(d===this.baseHost||"content-type"!==t.toLowerCase())&&p.setRequestHeader(t,s)}c.responseType&&(p.responseType=c.responseType),c.signal&&c.signal.addEventListener("abort",(()=>{p.abort(),i(new Error("Request aborted"))})),!p.upload||e!==exports.RequestMethod.POST&&e!==exports.RequestMethod.PUT&&e!==exports.RequestMethod.PATCH||(p.upload.onprogress=e=>{e.lengthComputable&&c.onUploadProgress&&c.onUploadProgress(e)}),p.onload=async()=>{if(c.signal&&c.signal.aborted)return;let e;switch(c.responseType){case exports.ResponseType.Text:e=p.responseText;break;case exports.ResponseType.Blob:case exports.ResponseType.ArrayBuffer:e=p.response;break;default:try{e=JSON.parse(p.responseText)}catch{e=p.responseText}}const t=new Headers;p.getAllResponseHeaders().split("\r\n").forEach((e=>{const[s,r]=e.split(": ");s&&r&&t.append(s,r)}));const s={status:p.status,statusText:p.statusText,headers:t,url:p.responseURL};if(p.status>=200&&p.status<300)return await Xt(this.client.responseInterceptors,s),void(c.observe===exports.RequestObserve.Response?r({...s,body:e}):r(e));if(this.state.authToken&&(null==e?void 0:e.code)===is){const e=await this.tokenUpdate.refreshToken(this.state.authToken.get(0),this.baseHost);e&&this.state.authToken.set(0,e)}const n={...s,error:e};await Xt(this.client.responseInterceptors,n),i(n)},p.onerror=()=>{i({status:p.status,statusText:p.statusText,url:p.responseURL,error:"Network error"})},p.send(rs(c.body))})().catch(i)}))}}exports.AuthApiService=i,exports.BASE_URL_V1=K,exports.BASE_URL_V2=Q,exports.CONNECTIONS_PERMISSION=o,exports.Client=class{constructor(e){this.AuthApiService=new i(this),this.ConnectionsApiService=new H(this),this.DiscoveryApiService=new G(this),this.DivideApiService=new J(this),this.ExtensionsApiService=new re(this),this.ExtensionsExternalApiService=new ne(this),this.FcaApiService=new ae(this),this.GatewayApiService=new pe(this),this.GroupApiService=new he(this),this.LicenseApiService=new $e(this),this.LinksApiService=new me(this),this.LimitationsApiService=new ye(this),this.LogstashApiService=new Ae(this),this.NotificationApiService=new Ee(this),this.RoleApiService=new Le(this),this.ShareApiService=new qe(this),this.StorageCommentApiService=new Be(this),this.StorageElementApiService=new Ke(this,this.FcaApiService),this.StorageFilesApiService=new it(this),this.TagsApiService=new Bt(this),this.StorageInstanceApiService=new nt(this),this.StorageShareApiService=new ct(this),this.StorageTrashApiService=new pt(this),this.UserApiService=new ft(this),this.UsersAppealsApiService=new bt(this),this.VersionApiService=new Nt(this),this.PlatformVersionApiService=new qt(this),this.SpaceApiService=new Ht(this),this.SpaceFilesApiService=new Jt(this),this.tokenUpdate=new ns,this.rest=new os(this,this.tokenUpdate),this.requestInterceptors=[],this.responseInterceptors=[],this.request={use:(e,t)=>{this.requestInterceptors.push({fulfilled:e,rejected:t})}},this.response={use:(e,t)=>{this.responseInterceptors.push({fulfilled:e,rejected:t})}},this.state={clientParams:{host:null==e?void 0:e.host,version:(null==e?void 0:e.version)||K},requestParams:{path:"",headers:{},query:{},body:null,cache:"no-cache"},authToken:null,skipInterceptors:!1},this.rest.baseHost=this.state.clientParams.host||""}},exports.ConnectionsApiService=H,exports.DiscoveryApiService=G,exports.DivideApiService=J,exports.ExtensionsApiService=re,exports.ExtensionsExternalApiService=ne,exports.FcaApiService=ae,exports.GatewayApiService=pe,exports.GroupApiService=he,exports.LicenseApiService=$e,exports.LimitationsApiService=ye,exports.LinksApiService=me,exports.LogstashApiService=Ae,exports.NEED_TOKEN_UPDATE_ERROR=is,exports.NotificationApiService=Ee,exports.PlatformVersionApiService=qt,exports.Rest=os,exports.RoleApiService=Le,exports.ShareApiService=qe,exports.SpaceApiService=Ht,exports.SpaceFilesApiService=Jt,exports.StorageCommentApiService=Be,exports.StorageElementApiService=Ke,exports.StorageFilesApiService=it,exports.StorageInstanceApiService=nt,exports.StorageShareApiService=ct,exports.StorageTrashApiService=pt,exports.TagsApiService=Bt,exports.TokenUpdate=ns,exports.UserApiService=ft,exports.UsersAppealsApiService=bt,exports.VersionApiService=Nt,exports.applyInterceptors=Xt,exports.getCookieValue=es,exports.makeUrlParams=ts,exports.normalizeHeaders=ss,exports.prepareRequestBody=rs;
|
package/dist/bundle.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e="/login",t=`${e}/ldap`,s=`${e}/update`,r=`${e}/tfa`;class i{constructor(e){this.client=e}info(){return this.client.rest.get(e)}login(t){return this.client.rest.post(e,t)}ldapLogin(e){return this.client.rest.post(t,e)}loginTfa(e){return this.client.rest.post(r,e)}updateToken(e){const t=e.path?`${e.path}/${s}`:s;return e.path&&delete e.path,this.client.rest.post(t,e)}logout(){return this.client.rest.post("/logout")}}var n;!function(e){e.LicenseRead="license_read",e.LicenseManage="license_edit",e.UsersRead="users_read",e.UsersCreate="users_create",e.UsersActivate="users_activate",e.GroupsRead="groups_read",e.GroupsCreate="groups_create",e.RolesRead="roles_read",e.RolesCreate="roles_create",e.Share="share",e.Divide="divide",e.ExtensionsRead="extensions_read",e.ExtensionsManage="extensions_write",e.RestrictionShareRead="restriction_share_read",e.RestrictionShareWrite="restriction_share_write",e.RestrictionDivideRead="restriction_divide_read",e.RestrictionDivideWrite="restriction_divide_write",e.LimitationsRead="limitations_read",e.LimitationsEdit="limitations_edit",e.ReadUserLogs="read_user_logs",e.ConnectionsRead="connections_read",e.ConnectionsDividing="connections_dividing",e.ConnectionsYandexDisk="connections_yandex_disk",e.ConnectionsSsh="connections_ssh",e.ConnectionsMail="connections_mail",e.ConnectionsS3="connections_s3",e.ConnectionsDiscord="connections_discord",e.ConnectionsWebdav="connections_webdav",e.ConnectionsNextcloud="connections_nextcloud",e.ConnectionsNextbox="connections_nextbox",e.ConnectionsHttpProxy="connections_http_proxy",e.SystemInfoServiceList="system_info_service_list",e.SettingsRead="settings_read",e.SettingsWrite="settings_write",e.DemoAdmin="demo_admin",e.SpaceManage="space_manage"}(n||(n={}));const o=[n.ConnectionsYandexDisk,n.ConnectionsSsh,n.ConnectionsMail,n.ConnectionsS3,n.ConnectionsS3,n.ConnectionsDiscord,n.ConnectionsWebdav,n.ConnectionsNextcloud,n.ConnectionsNextbox,n.ConnectionsHttpProxy];var c,a,l,u,h,d,p,_,g,$,f,m,v,w,k,S,y,b,A,x,C,D,T,U,P,E,R,I,L,z,N,O,W,F,B,H;!function(e){e.DEFAULT="",e.ASC="asc",e.DESC="desc"}(c||(c={})),function(e){e.WebSocket="websocket",e.PostMessage="postmessage",e.Empty=""}(a||(a={})),function(e){e.Yellow="yellow",e.Success="success",e.Critical="critical",e.Warning="warning",e.Brand="brand",e.Purple="purple",e.Primary="primary",e.Gray="gray"}(l||(l={})),function(e){e.Storages="storages_connections_group",e.Webhooks="webhooks_connections_group",e.Unknown="unknown_connections_group",e.Proxy="proxy_connections_group"}(u||(u={})),function(e){e.SSH="ssh_connection",e.YandexDisk="yandex_disk",e.Mail="mail",e.Discord="discord",e.Webdav="webdav_connection",e.Nextcloud="nextcloud_connection",e.NextBox="nextbox_connection",e.HttpProxy="http_proxy_connection",e.S3="s3_connection"}(h||(h={})),function(e){e.App="app",e.File="file",e.WorkDir="work_dir"}(d||(d={})),function(e){e.Read="read",e.ReadAndWrite="read_and_write",e.Write="write"}(p||(p={})),function(e){e.Storage="/storage/element",e.Connection="/connections"}(_||(_={})),function(e){e.Close="",e.Read="r",e.Write="rw",e.Full="rwd",e.SpaceManage="space_manage"}(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"}(m||(m={})),function(e){e.Divide="divide",e.Share="share"}(v||(v={})),function(e){e.Free="free",e.Business="business",e.Enterprise="enterprise"}(w||(w={})),function(e){e.NotActivated="License not activated",e.Blocked="License blocked",e.Expired="License has been expired",e.NotValid="License not valid",e.NotFound="license file not found"}(k||(k={})),function(e){e.BySize="size",e.ByExt="extension",e.ByQuota="quota_size"}(S||(S={})),function(e){e.Size="size",e.White="extension_white",e.Black="extension_black"}(y||(y={})),function(e){e.Dir="dir",e.File="file",e.User="user",e.Other="other",e.WorkDir="work_dir",e.License="license",e.Extension="extension",e.Connection="connection"}(b||(b={})),function(e){e.SecurityCheckNegative="action_security_check_negative",e.SecurityCheckPositive="action_security_check_positive",e.CommentVersionMention="action_version_comment_mention",e.OpenSharing="open_sharing",e.ChangeSharing="change_sharing",e.CancelSharing="cancel_sharing",e.DivideDirAddFileToOwner="divide_dir_add_file_to_owner",e.DivideDirAddDirToOwner="divide_dir_add_dir_to_owner",e.DivideDirAddWorkDirToOwner="divide_dir_add_work_dir_to_owner",e.DivideConnectionAddFileToOwner="divide_connection_add_file_to_owner",e.DivideConnectionAddDirToOwner="divide_connection_add_dir_to_owner",e.CancelDivideDir="cancel_divide_dir",e.CancelDivideFile="cancel_divide_file",e.CancelDivideWorkDir="cancel_divide_work_dir",e.CancelDivideConnection="cancel_divide_connection",e.DeleteExtension="delete_extension",e.NewVersionExtension="new_version_extension",e.TransferData="transfer_data",e.AllowInternalAccessUser="allow_internal_access_to_user",e.BlockInternalAccessUser="block_internal_access_to_user",e.WaitInternalAccessUser="wait_internal_access_to_user",e.WaitInternalAccessUserCreate="wait_internal_access_to_user_create",e.AllowInternalAccessGroup="allow_internal_access_to_group",e.BlockInternalAccessGroup="block_internal_access_to_group",e.WaitInternalAccessGroup="wait_internal_access_to_group",e.WaitInternalAccessGroupCreate="wait_internal_access_to_group_create",e.AllowSharing="allow_sharing",e.BlockSharing="block_sharing",e.WaitSharing="wait_sharing",e.WaitSharingCreate="wait_sharing_create",e.StatusCreateZipProcess="status_create_zip_process",e.StatusCreateZipSuccess="status_create_zip_success",e.StatusCreateZipError="status_create_zip_error",e.DownloadZipSuccess="download_zip_success",e.DownloadZipError="download_zip_error",e.StatusUnzipProcess="status_unzip_process",e.StatusUnzipSuccess="status_unzip_success",e.StatusUnzipError="status_unzip_error",e.StatusUnzipSuccessWithLimits="status_unzip_success_with_limits",e.AnonymZipDirAddFileToOwner="anonym_zip_dir_add_file_to_owner",e.GuestZipDirAddFileToOwner="guest_zip_dir_add_file_to_owner",e.DropDocumentOnlyoffice="drop_document_onlyoffice",e.CopyError="copy_error",e.CopySuccess="copy_success",e.StatusCopyProcess="status_copy_process",e.Other="other",e.Application="application"}(A||(A={})),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"}(D||(D={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.PATCH="PATCH",e.DELETE="DELETE",e.HEAD="HEAD"}(T||(T={})),function(e){e.Body="body",e.Response="response"}(U||(U={})),function(e){e.NONE="none",e.SOFT="soft",e.HARD="hard"}(P||(P={})),function(e){e.Native="native",e.Ldap="ldap",e.Vk="vk"}(E||(E={})),function(e){e.Registering="registering",e.Activated="activated",e.BlockedByAdmin="blocked_by_admin",e.BlockedByLicense="blocked_by_license",e.BlockedByInactive="blocked_by_inactive",e.BlockedByInactiveChangePassword="blocked_by_inactive_change_password"}(R||(R={})),function(e){e.User="user",e.Guest="guest",e.Emperor="emperor",e.Anonymous="anonymous"}(I||(I={})),function(e){e.Theme="theme",e.Lang="lang",e.Sort="sort",e.ViewApps="viewApps",e.WithoutContentWorkDir="withoutContentWorkDir",e.DashboardGrid="dashboardGrid"}(L||(L={})),function(e){e.Webdav="webdav"}(z||(z={})),function(e){e.Text="text",e.String="string",e.Number="number",e.CheckBox="checkbox",e.Select="select",e.RadioList="radio_list",e.ConnectionChoose="connection_choose",e.MultiConnectionChoose="multi_connection_choose"}(N||(N={})),function(e){e.Dir="dir",e.File="file",e.WorkDir="work_dir",e.App="app"}(O||(O={})),function(e){e.Any="any",e.Dir="dir",e.Code="code",e.Image="image",e.Audio="audio",e.Video="video",e.Text="text",e.Doc="doc",e.Xls="xls",e.Ppt="ppt"}(W||(W={})),function(e){e.my="my",e.fca="fca",e.divide="divide",e.share="share",e.favorite="favorite",e.trash="trash",e.spaces="spaces"}(F||(F={})),function(e){e.Create="create",e.Update="update",e.Move="move"}(B||(B={})),function(e){e[e.CheckNull=0]="CheckNull",e[e.CheckInProgress=1]="CheckInProgress",e[e.CheckPositive=2]="CheckPositive",e[e.CheckNegative=3]="CheckNegative"}(H||(H={}));const q="/connections",j=`${q}/dashboard`;class G{constructor(e){this.client=e}list(e){return this.client.rest.get(q,e)}get(e){return this.client.rest.get(`${q}/${e}`)}update(e,t){return this.client.rest.put(`${q}/${e}`,t)}delete(e){return this.client.rest.delete(`${q}/${e}`)}create(e){const t={[h.SSH]:"/disk/ssh",[h.Webdav]:"/disk/webdav",[h.Nextcloud]:"/disk/nextcloud",[h.NextBox]:"/disk/nextbox",[h.Discord]:"/webhooks/discord",[h.Mail]:"/webhooks/mail",[h.HttpProxy]:"/http_proxy",[h.S3]:"/disk/s3"};return this.client.rest.post(t[e.type]||q,e)}dashboard(e){return this.client.rest.get(j,e)}}class M{constructor(e){this.client=e}discovery(e){return this.client.rest.get("/discovery",e)}}const V="/divide",Z=`${V}/restrictions`,J=`${V}/tag_group`;class Y{constructor(e){this.client=e}divideDelete(e,t){return this.client.rest.delete(`${e}${V}/${t}`)}divideDeleteAll(e,t,s,r){return this.client.rest.delete(`${e}${V}`,{...this.makeParam(e,t),is_to_user_group:r,access_mode:s})}divideChange(e,t,s){return this.client.rest.put(`${e}${V}/${t}`,{access_mode:s})}divideCreate(e,t,s,r,i){const n={...this.makeParam(e,t),[i]:s,access_mode:r};return this.client.rest.post(`${e}${V}`,n)}divideUsers(e,t,s){return this.client.rest.get(`${e}${V}/users`,{...this.makeParam(e,t),...s})}divideTagGroupList(e){return this.client.rest.get(`${_.Storage}${J}`,e)}getRestriction(e){return this.client.rest.get(`${Z}/${e}`)}restrictionSize(e,t){return this.client.rest.get(`/${t}/restrictions/${e}/size`)}restrictions(e){return this.client.rest.get(`${Z}`,e)}restrictionsChange(e,t){return this.client.rest.put(`${Z}/${e}`,t)}makeParam(e,t){const s={};return e===_.Connection?s.connection_id=t:s.path=t,s}}class X extends Error{}function K(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return function(e){return decodeURIComponent(atob(e).replace(/(.)/g,((e,t)=>{let s=t.charCodeAt(0).toString(16).toUpperCase();return s.length<2&&(s="0"+s),"%"+s})))}(t)}catch(e){return atob(t)}}function Q(e,t){if("string"!=typeof e)throw new X("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 X(`Invalid token specified: missing part #${s+1}`);let i;try{i=K(r)}catch(e){throw new X(`Invalid token specified: invalid base64 for part #${s+1} (${e.message})`)}try{return JSON.parse(i)}catch(e){throw new X(`Invalid token specified: invalid json for part #${s+1} (${e.message})`)}}X.prototype.name="InvalidTokenError";const ee=async(e,t)=>{let s=t;for(const t of e)try{s=await t.fulfilled(s)}catch(e){if(!t.rejected)throw e;s=await t.rejected(e)}return s};function te(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 se=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 re(e){return e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):e}function ie(e){return e?e instanceof FormData||e instanceof Blob||e instanceof ArrayBuffer||e instanceof URLSearchParams||e instanceof Document||ArrayBuffer.isView(e)?e:"object"==typeof e?JSON.stringify(e):"string"==typeof e?e:null:null}const ne="update black token";class oe{constructor(){this.isUpdating=!1,this.tokenUpdateResolve=null}isTokenExpire(e){if(!e)return!1;return 1e3*e<=(new Date).getTime()+3e3}async refreshToken(e,t){const{access_token:s,refresh_token:r}=e;return s&&r?this.isUpdating?this.waitForTokenUpdate():(this.isUpdating=!0,new Promise(((e,i)=>{const n=new XMLHttpRequest,o=`${t}${ce}/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};te("access_token")===s.access_token&&localStorage.setItem("refresh-token",s.refresh_token),this.tokenUpdateResolve&&(this.tokenUpdateResolve(s),this.tokenUpdateResolve=null),e(s)}else e(null)}catch(e){i(new Error("Failed to parse response JSON."))}else e(null)},n.onerror=()=>{i(new Error("Network error occurred"))},n.onloadend=()=>{this.isUpdating=!1}}))):null}async waitForTokenUpdate(){return new Promise((e=>{const t=setInterval((()=>{this.isUpdating||(clearInterval(t),e())}),100)}))}}const ce="/api/v1",ae="/api/v2";class le{constructor(e,t){this.client=e,this.tokenUpdate=t,this.baseHost=""}get state(){return this.client.state}get(e,t,s){return this.request(T.GET,e,{params:t,cache:"no-cache",...s})}post(e,t,s){return this.request(T.POST,e,{body:t,...s})}put(e,t,s){return this.request(T.PUT,e,{body:t,cache:"no-cache",...s})}patch(e,t,s){return this.request(T.PATCH,e,{body:t,...s})}delete(e,t,s){return this.request(T.DELETE,e,{params:t,...s})}head(e,t,s){return this.request(T.HEAD,e,{params:t,...s})}upload(e,t,s){const r=new AbortController,i=r.signal;return{promise:this.request(T.POST,e,{body:t,signal:i,...s}),abort:()=>r.abort()}}request(e,t,s){return new Promise(((r,i)=>{var n;const o=null!==(n=this.state.skipInterceptors)&&void 0!==n&&n;this.state.skipInterceptors=!1;let c={method:e,...s};(null==s?void 0:s.signal)&&(c.signal=s.signal);(async()=>{var s,n,a,l;if(o||(c=null!==(s=await ee(this.client.requestInterceptors,c))&&void 0!==s?s:c),this.state.authToken)for(const[e,s]of this.state.authToken.entries()){const r=Q(s.access_token);if(r&&r.is_remember&&this.tokenUpdate.isTokenExpire(r.exp)&&!t.includes("/login")&&!t.includes("/assets")){const t=await this.tokenUpdate.refreshToken(s,this.baseHost);t&&(this.state.authToken.set(e,t),c=null!==(n=await ee(this.client.requestInterceptors,c))&&void 0!==n?n:c)}}const u=new XMLHttpRequest;c.params&&Object.keys(c.params).length&&(t+="?"+se(c.params));const h=null!==(a=c.host)&&void 0!==a?a:this.state.clientParams.host,d=`${h}${null!==(l=c.version)&&void 0!==l?l:this.state.clientParams.version}${t}`;if(u.open(e,d,!0),c.headers){const e=re(c.headers);for(const[t,s]of Object.entries(e))(h===this.baseHost||"content-type"!==t.toLowerCase())&&u.setRequestHeader(t,s)}c.responseType&&(u.responseType=c.responseType),c.signal&&c.signal.addEventListener("abort",(()=>{u.abort(),i(new Error("Request aborted"))})),!u.upload||e!==T.POST&&e!==T.PUT&&e!==T.PATCH||(u.upload.onprogress=e=>{e.lengthComputable&&c.onUploadProgress&&c.onUploadProgress(e)}),u.onload=async()=>{if(c.signal&&c.signal.aborted)return;let e;switch(c.responseType){case D.Text:e=u.responseText;break;case D.Blob:case D.ArrayBuffer:e=u.response;break;default:try{e=JSON.parse(u.responseText)}catch{e=u.responseText}}const t=new Headers;u.getAllResponseHeaders().split("\r\n").forEach((e=>{const[s,r]=e.split(": ");s&&r&&t.append(s,r)}));const s={status:u.status,statusText:u.statusText,headers:t,url:u.responseURL};if(u.status>=200&&u.status<300)return await ee(this.client.responseInterceptors,s),void(c.observe===U.Response?r({...s,body:e}):r(e));if(this.state.authToken&&(null==e?void 0:e.code)===ne){const e=await this.tokenUpdate.refreshToken(this.state.authToken.get(0),this.baseHost);e&&this.state.authToken.set(0,e)}const n={...s,error:e};await ee(this.client.responseInterceptors,n),i(n)},u.onerror=()=>{i({status:u.status,statusText:u.statusText,url:u.responseURL,error:"Network error"})},u.send(ie(c.body))})().catch(i)}))}}class ue{constructor(e){this.AuthApiService=new i(this),this.ConnectionsApiService=new G(this),this.DiscoveryApiService=new M(this),this.DivideApiService=new Y(this),this.ExtensionsApiService=new $e(this),this.ExtensionsExternalApiService=new me(this),this.FcaApiService=new ke(this),this.GatewayApiService=new ye(this),this.GroupApiService=new xe(this),this.LicenseApiService=new Ue(this),this.LinksApiService=new Ee(this),this.LimitationsApiService=new Ie(this),this.LogstashApiService=new Ne(this),this.NotificationApiService=new qe(this),this.RoleApiService=new Ve(this),this.ShareApiService=new Xe(this),this.StorageCommentApiService=new et(this),this.StorageElementApiService=new lt(this,this.FcaApiService),this.StorageFilesApiService=new ft(this),this.TagsApiService=new es(this),this.StorageInstanceApiService=new mt(this),this.StorageShareApiService=new wt(this),this.StorageTrashApiService=new yt(this),this.UserApiService=new Lt(this),this.UsersAppealsApiService=new Ft(this),this.VersionApiService=new Zt(this),this.PlatformVersionApiService=new Xt(this),this.SpaceApiService=new rs(this),this.SpaceFilesApiService=new cs(this),this.tokenUpdate=new oe,this.rest=new le(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)||ce},requestParams:{path:"",headers:{},query:{},body:null,cache:"no-cache"},authToken:null,skipInterceptors:!1},this.rest.baseHost=this.state.clientParams.host||""}}const he="/static/extensions",de="/extensions/defaults",pe=`${he}/names/users`,_e=`${he}/names/system`,ge=`${he}/tags`;class $e{constructor(e){this.client=e}getSetting(e){return this.client.rest.get(`${he}/${e}/settings`)}setSetting(e,t){return this.client.rest.post(`${he}/${e}/settings`,t)}deleteSetting(e){return this.client.rest.delete(`${he}/${e}/settings`)}get(e){return this.client.rest.get(`${he}/${e}`)}getByKey(e){return this.client.rest.get(`${he}/${e}`)}getDefault(e=[]){return this.client.rest.get(de,{ext_code:e})}setDefault(e,t){return this.client.rest.post(de,{ext_code:e,ext_uniq_key:t})}checkUpdates(){return this.client.rest.post(`${he}/check_updates`)}updateVersion(e,t){return this.client.rest.put(`${he}/${e}`,{version:t})}list(e){return this.client.rest.get(he,e)}listTags(e){return this.client.rest.get(ge,e)}delete(e,t){return this.client.rest.delete(`${he}/${e}`)}upload(e,t){const s=new FormData;s.set("file",t);const{promise:r,abort:i}=this.client.rest.upload(he,s,{version:ae,onUploadProgress:t=>{e(t)}});return{promise:r,abort:i}}install(e,t){return this.client.rest.post(`${he}/site`,{uniq_key:e,version:t},{version:ae})}getSystemNameExts(e){return this.client.rest.get(_e,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 fe="/anons_ext/extensions";class me{constructor(e){this.client=e}listExtensionsSite(e){return this.client.rest.get(fe,e,{host:"https://next-box.ru"})}extensionDetailSite(e){return this.client.rest.get(`${fe}/${e}`,{},{host:"https://next-box.ru"})}extensionMarkdown(e,t){return this.client.rest.get(`${fe}/${e.uniqKey}/readme`,{lang:e.lang},{...t,host:"https://next-box.ru"})}}const ve="/disk",we=`${ve}/check`;class ke{constructor(e){this.client=e}info(e,t){return this.client.rest.get(`${ve}/${e}/element`,{path:t})}list(e,t){return this.client.rest.get(`${ve}/${e}`,t)}create(e,t){return this.client.rest.post(`${ve}/${e}/element`,t)}replace(e,t,s){return this.client.rest.put(`${ve}/${e}/files?path=${t}`,s)}read(e,t){return this.client.rest.get(`${ve}/${e}/files?path=${t}`)}upload(e,t,s,r=""){const i=new FormData;i.set("path",r),i.set("file",s);const{promise:n,abort:o}=this.client.rest.upload(`${ve}/${t}/files`,i,{onUploadProgress:t=>{e(t)}});return{promise:n,abort:o}}uploadNet(e,t){return this.client.rest.post(`${ve}/${e}/files/net`,t)}delete(e,t){return this.client.rest.delete(`${ve}/${e}/trash/element`,{path:t})}check(e){return this.client.rest.post(we,e)}}const Se="/settings";class ye{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 be;!function(e){e.Standard="Standard",e.Simple="Simple"}(be||(be={}));const Ae="/groups";class xe{constructor(e){this.client=e}list(e){return this.client.rest.get(Ae,e)}get(e){return this.client.rest.get(`${Ae}/${e}`)}listUsers(e,t){return this.client.rest.get(`${Ae}/${e}/users`,t)}default(){return this.client.rest.get(`${Ae}/default`)}create(e){return this.client.rest.post(Ae,e)}update(e,t){return this.client.rest.put(`${Ae}/${e}`,t)}delete(e){return this.client.rest.delete(`${Ae}/${e}`)}}const Ce="/license",De=`${Ce}/manual-check`,Te=`${Ce}/hardware/hash`;class Ue{constructor(e){this.client=e}info(){return this.client.rest.get(Ce)}create(e){return this.client.rest.post(Ce,e)}check(){return this.client.rest.post(De)}delete(){return this.client.rest.delete(Ce)}getHash(){return this.client.rest.get(Te)}}const Pe="/links";class Ee{constructor(e){this.client=e}createShortLink(e){return this.client.rest.post(Pe,e)}updateShortLink(e){return this.client.rest.put(Pe,e)}}const Re="/limitations";class Ie{constructor(e){this.client=e}me(){return this.client.rest.get("/limitations/user/me")}list(e){return this.client.rest.get(Re,e)}listUsers(e,t){return this.client.rest.get(`${Re}/${e}/users`,t)}create(e){return this.client.rest.post(Re,e)}get(e){return this.client.rest.get(`${Re}/${e}`)}update(e,t){return this.client.rest.put(`${Re}/${e}`,t)}delete(e){return this.client.rest.delete(`${Re}/${e}`)}getLimitationsByUser(e){return this.client.rest.get(`/limitations/user/${e}`)}addUserToLimitation(e,t){return this.client.rest.patch(`${Re}/${e}/user`,{id:t})}deleteUserFromLimitation(e,t){return this.client.rest.delete(`${Re}/${e}/user/${t}`)}}const Le="/logs/users",ze=`${Le}/actions`;class Ne{constructor(e){this.client=e}getUsersLogs(e){return this.client.rest.get(`${Le}`,e)}getLogsActions(e){return this.client.rest.get(`${ze}`,e)}}const Oe="/notifications",We=`${Oe}/all`,Fe=`${Oe}/subscription`,Be=`${Oe}/permission`,He=`${Oe}/task`;class qe{constructor(e){this.client=e}list(e){return this.client.rest.get(Oe,e)}task(e){return this.client.rest.get(`${He}/${e}`)}toggleStatus(e,t){return this.client.rest.put(Oe,{ids:e,to_status:t})}toggleAllStatus(e){return this.client.rest.put(We,{to_status:e})}delete(e){return this.client.rest.delete(Oe,{id:e})}deleteAll(){return this.client.rest.delete(We)}getPermission(){return this.client.rest.get(Be)}setPermission(e){return this.client.rest.post(Be,{enabled:e})}getSubscription(){return this.client.rest.get(Fe)}setSubscription(e){const t={action_groups:{...e}};return this.client.rest.post(Fe,t)}}const je="/roles",Ge=`${je}/default`,Me="/permissions";class Ve{constructor(e){this.client=e}list(e){return this.client.rest.get(je,e)}get(e){return this.client.rest.get(`${je}/${e}`)}getDefault(){return this.client.rest.get(`${Ge}`)}create(e){return this.client.rest.post(je,e)}update(e,t){return this.client.rest.put(`${je}/${e}`,t)}delete(e){return this.client.rest.delete(`${je}/${e}`)}permissionList(){return this.client.rest.get(Me)}addPermission(e,t){return this.client.rest.put(`${je}/${e}/permissions`,{ids:t})}deletePermission(e,t){return this.client.rest.delete(`${je}/${e}/${Me}`,{ids:t})}}const Ze="/share",Je=`${Ze}/restrictions`,Ye=`${Ze}/login`;class Xe{constructor(e){this.client=e}info(e){return this.client.rest.get(`${Ze}?share_token=${e}`)}checkPassword(e,t){const s=encodeURIComponent(e);return this.client.rest.get(`${Ze}/password?share_token=${t}&share_pass=${s}`)}getRestriction(e){return this.client.rest.get(`${Je}/${e}`)}restrictions(e){return this.client.rest.get(Je,e)}restrictionsChange(e,t){return this.client.rest.put(`${Je}/${e}`,t)}login(e){return this.client.rest.post(`${Ye}`,e)}}const Ke="/storage/element/version/comment",Qe=`${Ke}/all`;class et{constructor(e){this.client=e}list(e){return this.client.rest.get(`${Ke}`,e)}create(e){return this.client.rest.post(`${Ke}`,e)}update(e){return this.client.rest.put(`${Ke}`,e)}delete(e){return this.client.rest.delete(`${Ke}`,e)}deleteAll(e){return this.client.rest.delete(`${Qe}`,e)}}const tt="/storage",st=`${tt}/element`,rt=`${st}/divide`,it=`${rt}/resource`,nt=`${st}/move`,ot=`${st}/copy`,ct=`${st}/content_type_size`,at="/disk";class lt{constructor(e,t){this.client=e,this.fcaApiService=t}list(e){return this.client.rest.get(tt,e)}info(e){var t;return parseInt((null===(t=e.divide_id)||void 0===t?void 0:t.toString())||"")||delete e.divide_id,e.file_version_id||delete e.file_version_id,e.zip_entry_path||delete e.zip_entry_path,this.client.rest.get(st,e)}fileInfo(e,t){return this.client.rest.get(`${st}/${e}`,t?{file_version_id:t}:{})}combineInfo({root:e,rootId:t,path:s,file_version_id:r,zip_entry_path:i}){return e===F.fca&&t?this.fcaApiService.info(t,s):this.info({path:s,divide_id:t,file_version_id:r,zip_entry_path:i})}size(e){return this.client.rest.post(`${st}/size`,e)}move(e,t,s){const{from_divide_id:r,to_divide_id:i}=e;let n={...e,from_divide_id:null,to_divide_id:null};return t===F.fca&&s===F.fca?this.client.rest.post(`${at}/${r}/files/move${at}/${i}`,n):t===F.fca?(r&&(n.from_divide_id=r),this.client.rest.put(`${at}/${i}/files/from/box`,n)):s===F.fca?(i&&(n.to_divide_id=i),this.client.rest.put(`${at}/${r}/files/to/box`,n)):this.client.rest.post(nt,e)}copy(e,t,s){const{from_divide_id:r,to_divide_id:i}=e;let n={...e,from_divide_id:null,to_divide_id:null};return s===F.fca&&t===F.fca?this.client.rest.post(`${at}/${r}/files/copy${at}/${i}`,n):s===F.fca?(r&&(n.from_divide_id=r),this.client.rest.post(`${at}/${i}/files/from/box`,n)):t===F.fca?(i&&(n.to_divide_id=i),this.client.rest.post(`${at}/${r}/files/to/box`,n)):this.client.rest.post(ot,e)}pasteFromShared(e,t,s){const r={from_sharing_token:e,from_sharing_password:s,paths:t};return this.client.rest.post(`${st}/copy`,r)}create(e){return this.client.rest.post(st,e)}delete(e,t){const s={path:e};return t&&(s.divide_id=t),this.client.rest.delete(st,s)}favorite(e){return this.client.rest.put(`${st}?path=${encodeURIComponent(e)}`,{is_favorite:!0})}removeFavorite(e){return this.client.rest.put(`${st}?path=${encodeURIComponent(e)}`,{is_favorite:!1})}createItem(e){return this.client.rest.post(st,e)}createWorkDir(e){return this.client.rest.post(st,e)}sizeWithSection(e){return this.client.rest.get(ct,e)}getDivideResources(e){return this.client.rest.get(it,e)}getQuota(e){return this.client.rest.get(`${st}/user_size`,e)}hide(e){return this.client.rest.post(`${rt}/hide`,e)}unhide(e){return this.client.rest.post(`${rt}/unhide`,e)}}const ut="/storage/files",ht=`${ut}/net`,dt=`${ut}/unzip`,pt=`${ut}/zip`,_t=`${pt}/download`,gt=`${ut}/process`,$t=`${ut}/code`;class ft{constructor(e){this.client=e}read(e,t){return t.path=e,this.client.rest.get(ut,t)}replace(e,t){const s=Object.fromEntries(Object.entries(e).filter((([,e])=>null!=e)).map((([e,t])=>[e,String(t)])));return this.client.rest.put(ut,t,{params:s})}upload(e,t,s,r){const i=new FormData;i.set("path",s),r&&i.set("divide_id",r.toString()),i.set("file",t);const{promise:n,abort:o}=this.client.rest.upload(ut,i,{onUploadProgress:t=>{e(t)}});return{promise:n,abort:o}}uploadNet(e){return this.client.rest.post(ht,e)}createZipToDownload(e){var t;const s=-(new Date).getTimezoneOffset()/60;return null!==(t=e.time_zone)&&void 0!==t||(e.time_zone=s),this.client.rest.post(_t,e)}createZip(e){var t;const s=-(new Date).getTimezoneOffset()/60;return null!==(t=e.time_zone)&&void 0!==t||(e.time_zone=s),this.client.rest.post(pt,e)}cancelProcess(e){return this.client.rest.delete(gt,e)}unZip(e){return this.client.rest.post(dt,e)}checkZip(e){return this.client.rest.head($t,e)}}class mt{constructor(e){this.client=e}instance(){return this.client.rest.get("/storage/instance")}}const vt="/storage/element/share";class wt{constructor(e){this.client=e}info(e){return this.client.rest.get(vt,{path:e})}create(e,t){const s={path:e,permissions_type:t};return this.client.rest.post(vt,s)}change(e){return this.client.rest.put(`${vt}/${e.token}`,e)}delete(e){return this.client.rest.delete(vt,{path:e})}refresh(e){return this.client.rest.put(`${vt}/${e}/refresh`)}}const kt="/storage/trash/element",St=`${kt}/all`;class yt{constructor(e){this.client=e}clear(e){return this.client.rest.delete(kt,e)}clearAll(){return this.client.rest.delete(St)}restore(e){return this.client.rest.patch(kt,{del_groups:e})}restoreAll(){return this.client.rest.patch(St)}}const bt="/users",At=`${bt}/me`,xt=`${At}/avatars`,Ct=`${At}/sessions`,Dt=`${At}/tokens`,Tt=`${At}/params`,Ut=`${At}/app-passwords`,Pt=`${At}/change-password`,Et=`${bt}/initial`,Rt=`${At}/phone`,It=`${Rt}/confirm`;class Lt{constructor(e){this.client=e}initial(e){return this.client.rest.post(Et,e)}list(e){return this.client.rest.get(bt,e)}get(e){return this.client.rest.get(bt+`/${e}`)}create(e){return this.client.rest.post(bt,e)}update(e,t){return this.client.rest.put(bt+`/${e}`,t)}delete(e,t){return this.client.rest.delete(`${bt}/${e}`,t)}restore(e){return this.client.rest.post(`${bt}/${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(Dt,e)}listToken(e){return this.client.rest.get(Dt,e)}deleteToken(e){return this.client.rest.delete(`${Dt}/${e}`)}changeMyPassword(e){return this.client.rest.put(Pt,e)}changeUsersPassword(e,t){return this.client.rest.put(`${bt}/${e}/change-password`,t)}meUploadAvatar(e,t){const s=new FormData;return s.append("file",e,t),this.client.rest.post(xt,s)}meDeleteAvatar(){return this.client.rest.delete(xt)}meListSession(e){return this.client.rest.get(Ct,e)}meDeleteSession(e){let t=Ct;return e&&(t+=`/${e}`),this.client.rest.delete(t)}setRole(e,t=null){return this.client.rest.put(`${bt}/${e}/roles`,{role_id:t})}meParams(e){return this.client.rest.get(Tt,{name:e})}meSetParams(e,t){return this.client.rest.post(`${Tt}/${e}`,t)}meListParams(){return this.client.rest.get(Tt)}phone(e){return this.client.rest.post(Rt,e)}phoneConfirm(e){return this.client.rest.post(`${It}/${e}`)}appPasswordsList(e){return this.client.rest.get(Ut,e)}createAppPasswords(e){return this.client.rest.post(Ut,e)}deleteAppPasswords(e){return this.client.rest.delete(`${Ut}/${e}`)}}const zt="/users/appeals",Nt=`${zt}/category`,Ot=`${zt}/subcategory`,Wt=`${zt}/file`;class Ft{constructor(e){this.client=e}category(){return this.client.rest.get(Nt)}subcategory(e){return this.client.rest.get(Ot,{category_code:e})}uploadFile(e){const t=new FormData;return t.append("file",e),this.client.rest.post(Wt,t)}deleteFile(e){return this.client.rest.delete(`${Wt}/${e}`)}createAppeal(e){return this.client.rest.post(zt,e)}}const Bt="/storage/element",Ht=`${Bt}/history`,qt=`${Bt}/version`,jt=`${qt}/lock`,Gt=`${qt}/unlock`,Mt=`${qt}/current`,Vt=`${qt}/size`;class Zt{constructor(e){this.client=e}history(e){return this.client.rest.get(Ht,e)}versions(e){return this.client.rest.get(qt,e)}create(e){return this.client.rest.post(qt,e)}edit(e){return this.client.rest.put(qt,e)}delete(e){return this.client.rest.delete(qt,e)}size(e){return this.client.rest.get(Vt,e)}makeCurrent(e){return this.client.rest.post(Mt,e)}lock(e){return this.client.rest.post(jt,e)}unlock(e){return this.client.rest.post(Gt,e)}}const Jt="/version",Yt=`${Jt}/changelog`;class Xt{constructor(e){this.client=e}getVersions(e){return this.client.rest.get(Jt,e)}getChangelog(e){return this.client.rest.get(Yt,{version_number:e})}}const Kt="/tag",Qt=`${Kt}/list`;class es{constructor(e){this.client=e}list(e){return this.client.rest.get(Qt,e)}get(e){return this.client.rest.get(`${Kt}/${e}`)}assign(e,t){return this.client.rest.post(`${Kt}/${e}/assign`,{items:t})}unassign(e,t){return this.client.rest.post(`${Kt}/${e}/unassign`,{items:t})}create(e){return this.client.rest.post(Kt,e)}update(e,t){return this.client.rest.put(`${Kt}/${e}`,t)}delete(e){return this.client.rest.delete(`${Kt}/${e}`)}}const ts="/spaces",ss=`${ts}/access`;class rs{constructor(e){this.client=e}space(e){return this.client.rest.get(`${ts}/${e}`)}list(e){return this.client.rest.get(ts,e)}create(e){return this.client.rest.post(ts,e)}update(e,t){return this.client.rest.put(`${ts}/${e}`,t)}delete(e){return this.client.rest.delete(`${ts}/${e}`)}adminsList(e,t){return this.client.rest.get(`${ts}/${e}/admins`,t)}accessList(e){return this.client.rest.get(ss,e)}provideAccess(e){return this.client.rest.post(ss,e)}deleteAllAccess(e){return this.client.rest.delete(ss,e)}updateAccess(e,t){return this.client.rest.put(`${ss}/${e}`,t)}deleteAccess(e,t){return this.client.rest.delete(`${ss}/${e}`,{space_id:t})}}const is="/spaces",ns="/files",os="/files/upload";class cs{constructor(e){this.client=e}list(e,t){return this.client.rest.get(`${is}/${e}${ns}/list`,t)}get(e,t){return this.client.rest.get(`${is}/${e}${ns}`,t)}create(e,t){return this.client.rest.post(`${is}/${e}${ns}`,t)}replace(e,t,s){const r=Object.fromEntries(Object.entries(t).filter((([,e])=>null!=e)).map((([e,t])=>[e,String(t)])));return this.client.rest.put(`${is}/${e}${ns}`,s,{params:r})}delete(e,t){return this.client.rest.delete(`${is}/${e}${ns}`,t)}copy(e,t){return this.client.rest.post(`${is}/${e}${ns}/copy`,t)}download(e,t){return this.client.rest.get(`${is}/${e}${ns}/download`,t,{responseType:D.Blob})}move(e,t){return this.client.rest.post(`${is}/${e}${ns}/move`,t)}rename(e,t){return this.client.rest.post(`${is}/${e}${ns}/rename`,t)}upload(e,t,s,r){var i;const n=new FormData;n.set("overwrite",String(null!==(i=r.overwrite)&&void 0!==i&&i)),n.set("file",s),r.parent_id&&n.set("parent_id",r.parent_id);const{promise:o,abort:c}=this.client.rest.upload(`${is}/${t}${os}`,n,{onUploadProgress:t=>{e(t)}});return{promise:o,abort:c}}uploadNet(e,t){return this.client.rest.post(`${is}/${e}${os}/net`,t)}}export{n as AccessRights,i as AuthApiService,ce as BASE_URL_V1,ae as BASE_URL_V2,o as CONNECTIONS_PERMISSION,ue as Client,l as ColorTypes,u as ConnectionGroup,h as ConnectionType,G as ConnectionsApiService,M as DiscoveryApiService,Y as DivideApiService,m as DivideMode,_ as DivideScope,a as EngineType,p as ExtensionFileMode,d as ExtensionType,$e as ExtensionsApiService,me as ExtensionsExternalApiService,ke as FcaApiService,ye as GatewayApiService,xe as GroupApiService,Ue as LicenseApiService,k as LicenseError,y as LimitationSubType,S as LimitationType,Ie as LimitationsApiService,Ee as LinksApiService,Ne as LogstashApiService,ne as NEED_TOKEN_UPDATE_ERROR,A as NotificationAction,qe as NotificationApiService,b as NotificationEntityType,x as NotificationRowAction,C as NotificationStyle,c as OrderDirection,g as PermissionType,Xt as PlatformVersionApiService,be as QueryInitViewType,T as RequestMethod,U as RequestObserve,D as ResponseType,le as Rest,f as RestrictionBooleanStatus,v as RestrictionModeKey,P as RestrictionSharing,$ as RestrictionStatus,Ve as RoleApiService,N as SettingControlType,Xe as ShareApiService,rs as SpaceApiService,cs as SpaceFilesApiService,et as StorageCommentApiService,lt as StorageElementApiService,H as StorageElementCheckStatus,W as StorageElementContentType,B as StorageElementHistoryAction,O as StorageElementType,ft as StorageFilesApiService,mt as StorageInstanceApiService,F as StorageRoot,wt as StorageShareApiService,yt as StorageTrashApiService,es as TagsApiService,w as Tariff,oe as TokenUpdate,Lt as UserApiService,z as UserAppType,E as UserAuthType,L as UserParamsLabel,R as UserStatus,I as UserType,Ft as UsersAppealsApiService,Zt as VersionApiService,ee as applyInterceptors,te as getCookieValue,se as makeUrlParams,re as normalizeHeaders,ie as prepareRequestBody};
|
|
1
|
+
const e="/login",t=`${e}/ldap`,s=`${e}/update`,r=`${e}/tfa`;class i{constructor(e){this.client=e}info(){return this.client.rest.get(e)}login(t){return this.client.rest.post(e,t)}ldapLogin(e){return this.client.rest.post(t,e)}loginTfa(e){return this.client.rest.post(r,e)}updateToken(e){const t=e.path?`${e.path}/${s}`:s;return e.path&&delete e.path,this.client.rest.post(t,e)}logout(){return this.client.rest.post("/logout")}}var n;!function(e){e.LicenseRead="license_read",e.LicenseManage="license_edit",e.UsersRead="users_read",e.UsersCreate="users_create",e.UsersActivate="users_activate",e.GroupsRead="groups_read",e.GroupsCreate="groups_create",e.RolesRead="roles_read",e.RolesCreate="roles_create",e.Share="share",e.Divide="divide",e.ExtensionsRead="extensions_read",e.ExtensionsManage="extensions_write",e.RestrictionShareRead="restriction_share_read",e.RestrictionShareWrite="restriction_share_write",e.RestrictionDivideRead="restriction_divide_read",e.RestrictionDivideWrite="restriction_divide_write",e.LimitationsRead="limitations_read",e.LimitationsEdit="limitations_edit",e.ReadUserLogs="read_user_logs",e.ConnectionsRead="connections_read",e.ConnectionsDividing="connections_dividing",e.ConnectionsYandexDisk="connections_yandex_disk",e.ConnectionsSsh="connections_ssh",e.ConnectionsMail="connections_mail",e.ConnectionsS3="connections_s3",e.ConnectionsDiscord="connections_discord",e.ConnectionsWebdav="connections_webdav",e.ConnectionsNextcloud="connections_nextcloud",e.ConnectionsNextbox="connections_nextbox",e.ConnectionsHttpProxy="connections_http_proxy",e.SystemInfoServiceList="system_info_service_list",e.SettingsRead="settings_read",e.SettingsWrite="settings_write",e.DemoAdmin="demo_admin",e.SpaceManage="space_manage"}(n||(n={}));const o=[n.ConnectionsYandexDisk,n.ConnectionsSsh,n.ConnectionsMail,n.ConnectionsS3,n.ConnectionsS3,n.ConnectionsDiscord,n.ConnectionsWebdav,n.ConnectionsNextcloud,n.ConnectionsNextbox,n.ConnectionsHttpProxy];var c,a,l,u,h,d,p,_,g,$,f,m,v,w,k,S,y,b,A,x,C,D,T,U,P,E,R,I,L,z,N,O,W,B,F,H;!function(e){e.DEFAULT="",e.ASC="asc",e.DESC="desc"}(c||(c={})),function(e){e.WebSocket="websocket",e.PostMessage="postmessage",e.Empty=""}(a||(a={})),function(e){e.Yellow="yellow",e.Success="success",e.Critical="critical",e.Warning="warning",e.Brand="brand",e.Purple="purple",e.Primary="primary",e.Gray="gray"}(l||(l={})),function(e){e.Storages="storages_connections_group",e.Webhooks="webhooks_connections_group",e.Unknown="unknown_connections_group",e.Proxy="proxy_connections_group"}(u||(u={})),function(e){e.SSH="ssh_connection",e.YandexDisk="yandex_disk",e.Mail="mail",e.Discord="discord",e.Webdav="webdav_connection",e.Nextcloud="nextcloud_connection",e.NextBox="nextbox_connection",e.HttpProxy="http_proxy_connection",e.S3="s3_connection"}(h||(h={})),function(e){e.App="app",e.File="file",e.WorkDir="work_dir"}(d||(d={})),function(e){e.Read="read",e.ReadAndWrite="read_and_write",e.Write="write"}(p||(p={})),function(e){e.Storage="/storage/element",e.Connection="/connections"}(_||(_={})),function(e){e.Close="",e.Read="r",e.Write="rw",e.Full="rwd",e.SpaceManage="space_manage"}(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"}(m||(m={})),function(e){e.Divide="divide",e.Share="share"}(v||(v={})),function(e){e.Free="free",e.Business="business",e.Enterprise="enterprise"}(w||(w={})),function(e){e.NotActivated="License not activated",e.Blocked="License blocked",e.Expired="License has been expired",e.NotValid="License not valid",e.NotFound="license file not found"}(k||(k={})),function(e){e.BySize="size",e.ByExt="extension",e.ByQuota="quota_size"}(S||(S={})),function(e){e.Size="size",e.White="extension_white",e.Black="extension_black"}(y||(y={})),function(e){e.Dir="dir",e.File="file",e.User="user",e.Other="other",e.WorkDir="work_dir",e.License="license",e.Extension="extension",e.Connection="connection"}(b||(b={})),function(e){e.SecurityCheckNegative="action_security_check_negative",e.SecurityCheckPositive="action_security_check_positive",e.CommentVersionMention="action_version_comment_mention",e.OpenSharing="open_sharing",e.ChangeSharing="change_sharing",e.CancelSharing="cancel_sharing",e.DivideDirAddFileToOwner="divide_dir_add_file_to_owner",e.DivideDirAddDirToOwner="divide_dir_add_dir_to_owner",e.DivideDirAddWorkDirToOwner="divide_dir_add_work_dir_to_owner",e.DivideConnectionAddFileToOwner="divide_connection_add_file_to_owner",e.DivideConnectionAddDirToOwner="divide_connection_add_dir_to_owner",e.CancelDivideDir="cancel_divide_dir",e.CancelDivideFile="cancel_divide_file",e.CancelDivideWorkDir="cancel_divide_work_dir",e.CancelDivideConnection="cancel_divide_connection",e.DeleteExtension="delete_extension",e.NewVersionExtension="new_version_extension",e.TransferData="transfer_data",e.AllowInternalAccessUser="allow_internal_access_to_user",e.BlockInternalAccessUser="block_internal_access_to_user",e.WaitInternalAccessUser="wait_internal_access_to_user",e.WaitInternalAccessUserCreate="wait_internal_access_to_user_create",e.AllowInternalAccessGroup="allow_internal_access_to_group",e.BlockInternalAccessGroup="block_internal_access_to_group",e.WaitInternalAccessGroup="wait_internal_access_to_group",e.WaitInternalAccessGroupCreate="wait_internal_access_to_group_create",e.AllowSharing="allow_sharing",e.BlockSharing="block_sharing",e.WaitSharing="wait_sharing",e.WaitSharingCreate="wait_sharing_create",e.StatusCreateZipProcess="status_create_zip_process",e.StatusCreateZipSuccess="status_create_zip_success",e.StatusCreateZipError="status_create_zip_error",e.DownloadZipSuccess="download_zip_success",e.DownloadZipError="download_zip_error",e.StatusUnzipProcess="status_unzip_process",e.StatusUnzipSuccess="status_unzip_success",e.StatusUnzipError="status_unzip_error",e.StatusUnzipSuccessWithLimits="status_unzip_success_with_limits",e.AnonymZipDirAddFileToOwner="anonym_zip_dir_add_file_to_owner",e.GuestZipDirAddFileToOwner="guest_zip_dir_add_file_to_owner",e.DropDocumentOnlyoffice="drop_document_onlyoffice",e.CopyError="copy_error",e.CopySuccess="copy_success",e.StatusCopyProcess="status_copy_process",e.Other="other",e.Application="application"}(A||(A={})),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"}(D||(D={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.PATCH="PATCH",e.DELETE="DELETE",e.HEAD="HEAD"}(T||(T={})),function(e){e.Body="body",e.Response="response"}(U||(U={})),function(e){e.NONE="none",e.SOFT="soft",e.HARD="hard"}(P||(P={})),function(e){e.Native="native",e.Ldap="ldap",e.Vk="vk"}(E||(E={})),function(e){e.Registering="registering",e.Activated="activated",e.BlockedByAdmin="blocked_by_admin",e.BlockedByLicense="blocked_by_license",e.BlockedByInactive="blocked_by_inactive",e.BlockedByInactiveChangePassword="blocked_by_inactive_change_password"}(R||(R={})),function(e){e.User="user",e.Guest="guest",e.Emperor="emperor",e.Anonymous="anonymous"}(I||(I={})),function(e){e.Theme="theme",e.Lang="lang",e.Sort="sort",e.ViewApps="viewApps",e.WithoutContentWorkDir="withoutContentWorkDir",e.DashboardGrid="dashboardGrid"}(L||(L={})),function(e){e.Webdav="webdav"}(z||(z={})),function(e){e.Text="text",e.String="string",e.Number="number",e.CheckBox="checkbox",e.Select="select",e.RadioList="radio_list",e.ConnectionChoose="connection_choose",e.MultiConnectionChoose="multi_connection_choose"}(N||(N={})),function(e){e.Dir="dir",e.File="file",e.WorkDir="work_dir",e.App="app"}(O||(O={})),function(e){e.Any="any",e.Dir="dir",e.Code="code",e.Image="image",e.Audio="audio",e.Video="video",e.Text="text",e.Doc="doc",e.Xls="xls",e.Ppt="ppt"}(W||(W={})),function(e){e.my="my",e.fca="fca",e.divide="divide",e.share="share",e.favorite="favorite",e.trash="trash",e.spaces="spaces"}(B||(B={})),function(e){e.Create="create",e.Update="update",e.Move="move"}(F||(F={})),function(e){e[e.CheckNull=0]="CheckNull",e[e.CheckInProgress=1]="CheckInProgress",e[e.CheckPositive=2]="CheckPositive",e[e.CheckNegative=3]="CheckNegative"}(H||(H={}));const q="/connections",j=`${q}/dashboard`;class G{constructor(e){this.client=e}list(e){return this.client.rest.get(q,e)}get(e){return this.client.rest.get(`${q}/${e}`)}update(e,t){return this.client.rest.put(`${q}/${e}`,t)}delete(e){return this.client.rest.delete(`${q}/${e}`)}create(e){const t={[h.SSH]:"/disk/ssh",[h.Webdav]:"/disk/webdav",[h.Nextcloud]:"/disk/nextcloud",[h.NextBox]:"/disk/nextbox",[h.Discord]:"/webhooks/discord",[h.Mail]:"/webhooks/mail",[h.HttpProxy]:"/http_proxy",[h.S3]:"/disk/s3"};return this.client.rest.post(t[e.type]||q,e)}dashboard(e){return this.client.rest.get(j,e)}}class M{constructor(e){this.client=e}discovery(e){return this.client.rest.get("/discovery",e)}}const V="/divide",Z=`${V}/restrictions`,J=`${V}/tag_group`;class Y{constructor(e){this.client=e}divideDelete(e,t){return this.client.rest.delete(`${e}${V}/${t}`)}divideDeleteAll(e,t,s,r){return this.client.rest.delete(`${e}${V}`,{...this.makeParam(e,t),is_to_user_group:r,access_mode:s})}divideChange(e,t,s){return this.client.rest.put(`${e}${V}/${t}`,{access_mode:s})}divideCreate(e,t,s,r,i){const n={...this.makeParam(e,t),[i]:s,access_mode:r};return this.client.rest.post(`${e}${V}`,n)}divideUsers(e,t,s){return this.client.rest.get(`${e}${V}/users`,{...this.makeParam(e,t),...s})}divideTagGroupList(e){return this.client.rest.get(`${_.Storage}${J}`,e)}getRestriction(e){return this.client.rest.get(`${Z}/${e}`)}restrictionSize(e,t){return this.client.rest.get(`/${t}/restrictions/${e}/size`)}restrictions(e){return this.client.rest.get(`${Z}`,e)}restrictionsChange(e,t){return this.client.rest.put(`${Z}/${e}`,t)}makeParam(e,t){const s={};return e===_.Connection?s.connection_id=t:s.path=t,s}}const X="/api/v1",K="/api/v2",Q="/static/extensions",ee="/extensions/defaults",te=`${Q}/names/users`,se=`${Q}/names/system`,re=`${Q}/tags`;class ie{constructor(e){this.client=e}getSetting(e){return this.client.rest.get(`${Q}/${e}/settings`)}setSetting(e,t){return this.client.rest.post(`${Q}/${e}/settings`,t)}deleteSetting(e){return this.client.rest.delete(`${Q}/${e}/settings`)}get(e){return this.client.rest.get(`${Q}/${e}`)}getByKey(e){return this.client.rest.get(`${Q}/${e}`)}getDefault(e=[]){return this.client.rest.get(ee,{ext_code:e})}setDefault(e,t){return this.client.rest.post(ee,{ext_code:e,ext_uniq_key:t})}checkUpdates(){return this.client.rest.post(`${Q}/check_updates`)}updateVersion(e,t){return this.client.rest.put(`${Q}/${e}`,{version:t})}list(e){return this.client.rest.get(Q,e)}listTags(e){return this.client.rest.get(re,e)}delete(e,t){return this.client.rest.delete(`${Q}/${e}`)}upload(e,t){const s=new FormData;s.set("file",t);const{promise:r,abort:i}=this.client.rest.upload(Q,s,{version:K,onUploadProgress:t=>{e(t)}});return{promise:r,abort:i}}install(e,t){return this.client.rest.post(`${Q}/site`,{uniq_key:e,version:t},{version:K})}getSystemNameExts(e){return this.client.rest.get(se,e)}getUserNameExts(e){return this.client.rest.get(te,e)}createUserNameExt(e){return this.client.rest.post(`${te}`,{name:e})}deleteUserNameExt(e){return this.client.rest.delete(`${te}/${e}`)}deleteAllUserNameExts(){return this.client.rest.delete(`${te}`)}}const ne="/anons_ext/extensions";class oe{constructor(e){this.client=e}listExtensionsSite(e){return this.client.rest.get(ne,e,{host:"https://next-box.ru"})}extensionDetailSite(e){return this.client.rest.get(`${ne}/${e}`,{},{host:"https://next-box.ru"})}extensionMarkdown(e,t){return this.client.rest.get(`${ne}/${e.uniqKey}/readme`,{lang:e.lang},{...t,host:"https://next-box.ru"})}}const ce="/disk",ae=`${ce}/check`;class le{constructor(e){this.client=e}info(e,t){return this.client.rest.get(`${ce}/${e}/element`,{path:t})}list(e,t){return this.client.rest.get(`${ce}/${e}`,t)}create(e,t){return this.client.rest.post(`${ce}/${e}/element`,t)}replace(e,t,s){return this.client.rest.put(`${ce}/${e}/files?path=${t}`,s)}read(e,t){return this.client.rest.get(`${ce}/${e}/files?path=${t}`)}upload(e,t,s,r=""){const i=new FormData;i.set("path",r),i.set("file",s);const{promise:n,abort:o}=this.client.rest.upload(`${ce}/${t}/files`,i,{onUploadProgress:t=>{e(t)}});return{promise:n,abort:o}}uploadNet(e,t){return this.client.rest.post(`${ce}/${e}/files/net`,t)}delete(e,t){return this.client.rest.delete(`${ce}/${e}/trash/element`,{path:t})}check(e){return this.client.rest.post(ae,e)}}const ue="/settings";class he{constructor(e){this.client=e}settings(){return this.client.rest.get(ue)}changeSettings(e){return this.client.rest.post(ue,e)}queryInit(){return this.client.rest.get("/query/init")}}var de;!function(e){e.Standard="Standard",e.Simple="Simple"}(de||(de={}));const pe="/groups";class _e{constructor(e){this.client=e}list(e){return this.client.rest.get(pe,e)}get(e){return this.client.rest.get(`${pe}/${e}`)}listUsers(e,t){return this.client.rest.get(`${pe}/${e}/users`,t)}default(){return this.client.rest.get(`${pe}/default`)}create(e){return this.client.rest.post(pe,e)}update(e,t){return this.client.rest.put(`${pe}/${e}`,t)}delete(e){return this.client.rest.delete(`${pe}/${e}`)}}const ge="/license",$e=`${ge}/manual-check`,fe=`${ge}/hardware/hash`;class me{constructor(e){this.client=e}info(){return this.client.rest.get(ge)}create(e){return this.client.rest.post(ge,e)}check(){return this.client.rest.post($e)}delete(){return this.client.rest.delete(ge)}getHash(){return this.client.rest.get(fe)}}const ve="/links";class we{constructor(e){this.client=e}createShortLink(e){return this.client.rest.post(ve,e)}updateShortLink(e){return this.client.rest.put(ve,e)}}const ke="/limitations";class Se{constructor(e){this.client=e}me(){return this.client.rest.get("/limitations/user/me")}list(e){return this.client.rest.get(ke,e)}listUsers(e,t){return this.client.rest.get(`${ke}/${e}/users`,t)}create(e){return this.client.rest.post(ke,e)}get(e){return this.client.rest.get(`${ke}/${e}`)}update(e,t){return this.client.rest.put(`${ke}/${e}`,t)}delete(e){return this.client.rest.delete(`${ke}/${e}`)}getLimitationsByUser(e){return this.client.rest.get(`/limitations/user/${e}`)}addUserToLimitation(e,t){return this.client.rest.patch(`${ke}/${e}/user`,{id:t})}deleteUserFromLimitation(e,t){return this.client.rest.delete(`${ke}/${e}/user/${t}`)}}const ye="/logs/users",be=`${ye}/actions`;class Ae{constructor(e){this.client=e}getUsersLogs(e){return this.client.rest.get(`${ye}`,e)}getLogsActions(e){return this.client.rest.get(`${be}`,e)}}const xe="/notifications",Ce=`${xe}/all`,De=`${xe}/subscription`,Te=`${xe}/permission`,Ue=`${xe}/task`;class Pe{constructor(e){this.client=e}list(e){return this.client.rest.get(xe,e)}task(e){return this.client.rest.get(`${Ue}/${e}`)}toggleStatus(e,t){return this.client.rest.put(xe,{ids:e,to_status:t})}toggleAllStatus(e){return this.client.rest.put(Ce,{to_status:e})}delete(e){return this.client.rest.delete(xe,{id:e})}deleteAll(){return this.client.rest.delete(Ce)}getPermission(){return this.client.rest.get(Te)}setPermission(e){return this.client.rest.post(Te,{enabled:e})}getSubscription(){return this.client.rest.get(De)}setSubscription(e){const t={action_groups:{...e}};return this.client.rest.post(De,t)}}const Ee="/roles",Re=`${Ee}/default`,Ie="/permissions";class Le{constructor(e){this.client=e}list(e){return this.client.rest.get(Ee,e)}get(e){return this.client.rest.get(`${Ee}/${e}`)}getDefault(){return this.client.rest.get(`${Re}`)}create(e){return this.client.rest.post(Ee,e)}update(e,t){return this.client.rest.put(`${Ee}/${e}`,t)}delete(e){return this.client.rest.delete(`${Ee}/${e}`)}permissionList(){return this.client.rest.get(Ie)}addPermission(e,t){return this.client.rest.put(`${Ee}/${e}/permissions`,{ids:t})}deletePermission(e,t){return this.client.rest.delete(`${Ee}/${e}/${Ie}`,{ids:t})}}const ze="/share",Ne=`${ze}/restrictions`,Oe=`${ze}/login`;class We{constructor(e){this.client=e}info(e){return this.client.rest.get(`${ze}?share_token=${e}`)}checkPassword(e,t){const s=encodeURIComponent(e);return this.client.rest.get(`${ze}/password?share_token=${t}&share_pass=${s}`)}getRestriction(e){return this.client.rest.get(`${Ne}/${e}`)}restrictions(e){return this.client.rest.get(Ne,e)}restrictionsChange(e,t){return this.client.rest.put(`${Ne}/${e}`,t)}login(e){return this.client.rest.post(`${Oe}`,e)}}const Be="/storage/element/version/comment",Fe=`${Be}/all`;class He{constructor(e){this.client=e}list(e){return this.client.rest.get(`${Be}`,e)}create(e){return this.client.rest.post(`${Be}`,e)}update(e){return this.client.rest.put(`${Be}`,e)}delete(e){return this.client.rest.delete(`${Be}`,e)}deleteAll(e){return this.client.rest.delete(`${Fe}`,e)}}const qe="/storage",je=`${qe}/element`,Ge=`${je}/divide`,Me=`${Ge}/resource`,Ve=`${je}/move`,Ze=`${je}/copy`,Je=`${je}/content_type_size`,Ye="/disk";class Xe{constructor(e,t){this.client=e,this.fcaApiService=t}list(e){return this.client.rest.get(qe,e)}info(e){var t;return parseInt((null===(t=e.divide_id)||void 0===t?void 0:t.toString())||"")||delete e.divide_id,e.file_version_id||delete e.file_version_id,e.zip_entry_path||delete e.zip_entry_path,this.client.rest.get(je,e)}fileInfo(e,t){return this.client.rest.get(`${je}/${e}`,t?{file_version_id:t}:{})}combineInfo({root:e,rootId:t,path:s,file_version_id:r,zip_entry_path:i}){return e===B.fca&&t?this.fcaApiService.info(t,s):this.info({path:s,divide_id:t,file_version_id:r,zip_entry_path:i})}size(e){return this.client.rest.post(`${je}/size`,e)}move(e,t,s){const{from_divide_id:r,to_divide_id:i}=e;let n={...e,from_divide_id:null,to_divide_id:null};return t===B.fca&&s===B.fca?this.client.rest.post(`${Ye}/${r}/files/move${Ye}/${i}`,n):t===B.fca?(r&&(n.from_divide_id=r),this.client.rest.put(`${Ye}/${i}/files/from/box`,n)):s===B.fca?(i&&(n.to_divide_id=i),this.client.rest.put(`${Ye}/${r}/files/to/box`,n)):this.client.rest.post(Ve,e)}copy(e,t,s){const{from_divide_id:r,to_divide_id:i}=e;let n={...e,from_divide_id:null,to_divide_id:null};return s===B.fca&&t===B.fca?this.client.rest.post(`${Ye}/${r}/files/copy${Ye}/${i}`,n):s===B.fca?(r&&(n.from_divide_id=r),this.client.rest.post(`${Ye}/${i}/files/from/box`,n)):t===B.fca?(i&&(n.to_divide_id=i),this.client.rest.post(`${Ye}/${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(`${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(Je,e)}getDivideResources(e){return this.client.rest.get(Me,e)}getQuota(e){return this.client.rest.get(`${je}/user_size`,e)}hide(e){return this.client.rest.post(`${Ge}/hide`,e)}unhide(e){return this.client.rest.post(`${Ge}/unhide`,e)}}const Ke="/storage/files",Qe=`${Ke}/net`,et=`${Ke}/unzip`,tt=`${Ke}/zip`,st=`${tt}/download`,rt=`${Ke}/process`,it=`${Ke}/code`;class nt{constructor(e){this.client=e}read(e,t){return t.path=e,this.client.rest.get(Ke,t)}replace(e,t){const s=Object.fromEntries(Object.entries(e).filter((([,e])=>null!=e)).map((([e,t])=>[e,String(t)])));return this.client.rest.put(Ke,t,{params:s})}upload(e,t,s,r){const i=new FormData;i.set("path",s),r&&i.set("divide_id",r.toString()),i.set("file",t);const{promise:n,abort:o}=this.client.rest.upload(Ke,i,{onUploadProgress:t=>{e(t)}});return{promise:n,abort:o}}uploadNet(e){return this.client.rest.post(Qe,e)}createZipToDownload(e){var t;const s=-(new Date).getTimezoneOffset()/60;return null!==(t=e.time_zone)&&void 0!==t||(e.time_zone=s),this.client.rest.post(st,e)}createZip(e){var t;const s=-(new Date).getTimezoneOffset()/60;return null!==(t=e.time_zone)&&void 0!==t||(e.time_zone=s),this.client.rest.post(tt,e)}cancelProcess(e){return this.client.rest.delete(rt,e)}unZip(e){return this.client.rest.post(et,e)}checkZip(e){return this.client.rest.head(it,e)}}class ot{constructor(e){this.client=e}instance(){return this.client.rest.get("/storage/instance")}}const ct="/storage/element/share";class at{constructor(e){this.client=e}info(e){return this.client.rest.get(ct,{path:e})}create(e,t){const s={path:e,permissions_type:t};return this.client.rest.post(ct,s)}change(e){return this.client.rest.put(`${ct}/${e.token}`,e)}delete(e){return this.client.rest.delete(ct,{path:e})}refresh(e){return this.client.rest.put(`${ct}/${e}/refresh`)}}const lt="/storage/trash/element",ut=`${lt}/all`;class ht{constructor(e){this.client=e}clear(e){return this.client.rest.delete(lt,e)}clearAll(){return this.client.rest.delete(ut)}restore(e){return this.client.rest.patch(lt,{del_groups:e})}restoreAll(){return this.client.rest.patch(ut)}}const dt="/users",pt=`${dt}/me`,_t=`${pt}/avatars`,gt=`${pt}/sessions`,$t=`${pt}/tokens`,ft=`${pt}/params`,mt=`${pt}/app-passwords`,vt=`${pt}/change-password`,wt=`${dt}/initial`,kt=`${pt}/phone`,St=`${kt}/confirm`;class yt{constructor(e){this.client=e}initial(e){return this.client.rest.post(wt,e)}list(e){return this.client.rest.get(dt,e)}get(e){return this.client.rest.get(dt+`/${e}`)}create(e){return this.client.rest.post(dt,e)}update(e,t){return this.client.rest.put(dt+`/${e}`,t)}delete(e,t){return this.client.rest.delete(`${dt}/${e}`,t)}restore(e){return this.client.rest.post(`${dt}/${e}/restore`)}me(){return this.client.rest.get(pt)}updateMe(e){return this.client.rest.put(pt,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(vt,e)}changeUsersPassword(e,t){return this.client.rest.put(`${dt}/${e}/change-password`,t)}meUploadAvatar(e,t){const s=new FormData;return s.append("file",e,t),this.client.rest.post(_t,s)}meDeleteAvatar(){return this.client.rest.delete(_t)}meListSession(e){return this.client.rest.get(gt,e)}meDeleteSession(e){let t=gt;return e&&(t+=`/${e}`),this.client.rest.delete(t)}setRole(e,t=null){return this.client.rest.put(`${dt}/${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(kt,e)}phoneConfirm(e){return this.client.rest.post(`${St}/${e}`)}appPasswordsList(e){return this.client.rest.get(mt,e)}createAppPasswords(e){return this.client.rest.post(mt,e)}deleteAppPasswords(e){return this.client.rest.delete(`${mt}/${e}`)}}const bt="/users/appeals",At=`${bt}/category`,xt=`${bt}/subcategory`,Ct=`${bt}/file`;class Dt{constructor(e){this.client=e}category(){return this.client.rest.get(At)}subcategory(e){return this.client.rest.get(xt,{category_code:e})}uploadFile(e){const t=new FormData;return t.append("file",e),this.client.rest.post(Ct,t)}deleteFile(e){return this.client.rest.delete(`${Ct}/${e}`)}createAppeal(e){return this.client.rest.post(bt,e)}}const Tt="/storage/element",Ut=`${Tt}/history`,Pt=`${Tt}/version`,Et=`${Pt}/lock`,Rt=`${Pt}/unlock`,It=`${Pt}/current`,Lt=`${Pt}/size`;class zt{constructor(e){this.client=e}history(e){return this.client.rest.get(Ut,e)}versions(e){return this.client.rest.get(Pt,e)}create(e){return this.client.rest.post(Pt,e)}edit(e){return this.client.rest.put(Pt,e)}delete(e){return this.client.rest.delete(Pt,e)}size(e){return this.client.rest.get(Lt,e)}makeCurrent(e){return this.client.rest.post(It,e)}lock(e){return this.client.rest.post(Et,e)}unlock(e){return this.client.rest.post(Rt,e)}}const Nt="/version",Ot=`${Nt}/changelog`;class Wt{constructor(e){this.client=e}getVersions(e){return this.client.rest.get(Nt,e)}getChangelog(e){return this.client.rest.get(Ot,{version_number:e})}}const Bt="/tag",Ft=`${Bt}/list`;class Ht{constructor(e){this.client=e}list(e){return this.client.rest.get(Ft,e)}get(e){return this.client.rest.get(`${Bt}/${e}`)}assign(e,t){return this.client.rest.post(`${Bt}/${e}/assign`,{items:t})}unassign(e,t){return this.client.rest.post(`${Bt}/${e}/unassign`,{items:t})}create(e){return this.client.rest.post(Bt,e)}update(e,t){return this.client.rest.put(`${Bt}/${e}`,t)}delete(e){return this.client.rest.delete(`${Bt}/${e}`)}}const qt="/spaces",jt=`${qt}/access`;class Gt{constructor(e){this.client=e}space(e){return this.client.rest.get(`${qt}/${e}`)}list(e){return this.client.rest.get(qt,e)}create(e){return this.client.rest.post(qt,e)}update(e,t){return this.client.rest.put(`${qt}/${e}`,t)}delete(e){return this.client.rest.delete(`${qt}/${e}`)}adminsList(e,t){return this.client.rest.get(`${qt}/${e}/admins`,t)}accessList(e){return this.client.rest.get(jt,e)}provideAccess(e){return this.client.rest.post(jt,e)}deleteAllAccess(e){return this.client.rest.delete(jt,e)}updateAccess(e,t){return this.client.rest.put(`${jt}/${e}`,t)}deleteAccess(e,t){return this.client.rest.delete(`${jt}/${e}`,{space_id:t})}}const Mt="/spaces",Vt="/files",Zt=`${Vt}/upload`,Jt=`${`${Vt}/download`}/zip`;class Yt{constructor(e){this.client=e}list(e,t){return this.client.rest.get(`${Mt}/${e}${Vt}/list`,t)}get(e,t){return this.client.rest.get(`${Mt}/${e}${Vt}`,t)}create(e,t){return this.client.rest.post(`${Mt}/${e}${Vt}`,t)}replace(e,t,s){const r=Object.fromEntries(Object.entries(t).filter((([,e])=>null!=e)).map((([e,t])=>[e,String(t)])));return this.client.rest.put(`${Mt}/${e}${Vt}`,s,{params:r})}delete(e,t){return this.client.rest.delete(`${Mt}/${e}${Vt}`,t)}copy(e,t){return this.client.rest.post(`${Mt}/${e}${Vt}/copy`,t)}download(e,t){return this.client.rest.get(`${Mt}/${e}${Vt}/download`,t,{responseType:D.Blob})}createZipToDownload(e,t){return this.client.rest.get(`${Mt}/${e}${Jt}`,t,{responseType:D.Blob})}move(e,t){return this.client.rest.post(`${Mt}/${e}${Vt}/move`,t)}rename(e,t){return this.client.rest.post(`${Mt}/${e}${Vt}/rename`,t)}upload(e,t,s,r){var i;const n=new FormData;n.set("overwrite",String(null!==(i=r.overwrite)&&void 0!==i&&i)),r.parent_id&&n.set("parent_id",r.parent_id),n.set("file",s);const{promise:o,abort:c}=this.client.rest.upload(`${Mt}/${t}${Zt}`,n,{onUploadProgress:t=>{e(t)}});return{promise:o,abort:c}}uploadNet(e,t){return this.client.rest.post(`${Mt}/${e}${Zt}/net`,t)}}class Xt extends Error{}function Kt(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 Qt(e,t){if("string"!=typeof e)throw new Xt("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 Xt(`Invalid token specified: missing part #${s+1}`);let i;try{i=Kt(r)}catch(e){throw new Xt(`Invalid token specified: invalid base64 for part #${s+1} (${e.message})`)}try{return JSON.parse(i)}catch(e){throw new Xt(`Invalid token specified: invalid json for part #${s+1} (${e.message})`)}}Xt.prototype.name="InvalidTokenError";const es=async(e,t)=>{let s=t;for(const t of e)try{s=await t.fulfilled(s)}catch(e){if(!t.rejected)throw e;s=await t.rejected(e)}return s};function ts(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 ss=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 rs(e){return e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):e}function is(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 ns="update black token";class os{constructor(){this.isUpdating=!1,this.tokenUpdateResolve=null}isTokenExpire(e){if(!e)return!1;return 1e3*e<=(new Date).getTime()+3e3}async refreshToken(e,t){const{access_token:s,refresh_token:r}=e;return s&&r?this.isUpdating?this.waitForTokenUpdate():(this.isUpdating=!0,new Promise(((e,i)=>{const n=new XMLHttpRequest,o=`${t}${X}/login/update`;n.open("POST",o,!0),n.setRequestHeader("Content-Type","application/json"),n.send(JSON.stringify({access_token:s,refresh_token:r})),n.onload=()=>{if(n.status>=200&&n.status<300)try{const t=JSON.parse(n.responseText);if(t&&t.access_token&&t.refresh_token){const s={access_token:t.access_token,refresh_token:t.refresh_token};ts("access_token")===s.access_token&&localStorage.setItem("refresh-token",s.refresh_token),this.tokenUpdateResolve&&(this.tokenUpdateResolve(s),this.tokenUpdateResolve=null),e(s)}else e(null)}catch(e){i(new Error("Failed to parse response JSON."))}else e(null)},n.onerror=()=>{i(new Error("Network error occurred"))},n.onloadend=()=>{this.isUpdating=!1}}))):null}async waitForTokenUpdate(){return new Promise((e=>{const t=setInterval((()=>{this.isUpdating||(clearInterval(t),e())}),100)}))}}class cs{constructor(e,t){this.client=e,this.tokenUpdate=t,this.baseHost=""}get state(){return this.client.state}get(e,t,s){return this.request(T.GET,e,{params:t,cache:"no-cache",...s})}post(e,t,s){return this.request(T.POST,e,{body:t,...s})}put(e,t,s){return this.request(T.PUT,e,{body:t,cache:"no-cache",...s})}patch(e,t,s){return this.request(T.PATCH,e,{body:t,...s})}delete(e,t,s){return this.request(T.DELETE,e,{params:t,...s})}head(e,t,s){return this.request(T.HEAD,e,{params:t,...s})}upload(e,t,s){const r=new AbortController,i=r.signal;return{promise:this.request(T.POST,e,{body:t,signal:i,...s}),abort:()=>r.abort()}}request(e,t,s){return new Promise(((r,i)=>{var n;const o=null!==(n=this.state.skipInterceptors)&&void 0!==n&&n;this.state.skipInterceptors=!1;let c={method:e,...s};(null==s?void 0:s.signal)&&(c.signal=s.signal);(async()=>{var s,n,a,l;if(o||(c=null!==(s=await es(this.client.requestInterceptors,c))&&void 0!==s?s:c),this.state.authToken)for(const[e,s]of this.state.authToken.entries()){const r=Qt(s.access_token);if(r&&r.is_remember&&this.tokenUpdate.isTokenExpire(r.exp)&&!t.includes("/login")&&!t.includes("/assets")){const t=await this.tokenUpdate.refreshToken(s,this.baseHost);t&&(this.state.authToken.set(e,t),c=null!==(n=await es(this.client.requestInterceptors,c))&&void 0!==n?n:c)}}const u=new XMLHttpRequest;c.params&&Object.keys(c.params).length&&(t+="?"+ss(c.params));const h=null!==(a=c.host)&&void 0!==a?a:this.state.clientParams.host,d=`${h}${null!==(l=c.version)&&void 0!==l?l:this.state.clientParams.version}${t}`;if(u.open(e,d,!0),c.headers){const e=rs(c.headers);for(const[t,s]of Object.entries(e))(h===this.baseHost||"content-type"!==t.toLowerCase())&&u.setRequestHeader(t,s)}c.responseType&&(u.responseType=c.responseType),c.signal&&c.signal.addEventListener("abort",(()=>{u.abort(),i(new Error("Request aborted"))})),!u.upload||e!==T.POST&&e!==T.PUT&&e!==T.PATCH||(u.upload.onprogress=e=>{e.lengthComputable&&c.onUploadProgress&&c.onUploadProgress(e)}),u.onload=async()=>{if(c.signal&&c.signal.aborted)return;let e;switch(c.responseType){case D.Text:e=u.responseText;break;case D.Blob:case D.ArrayBuffer:e=u.response;break;default:try{e=JSON.parse(u.responseText)}catch{e=u.responseText}}const t=new Headers;u.getAllResponseHeaders().split("\r\n").forEach((e=>{const[s,r]=e.split(": ");s&&r&&t.append(s,r)}));const s={status:u.status,statusText:u.statusText,headers:t,url:u.responseURL};if(u.status>=200&&u.status<300)return await es(this.client.responseInterceptors,s),void(c.observe===U.Response?r({...s,body:e}):r(e));if(this.state.authToken&&(null==e?void 0:e.code)===ns){const e=await this.tokenUpdate.refreshToken(this.state.authToken.get(0),this.baseHost);e&&this.state.authToken.set(0,e)}const n={...s,error:e};await es(this.client.responseInterceptors,n),i(n)},u.onerror=()=>{i({status:u.status,statusText:u.statusText,url:u.responseURL,error:"Network error"})},u.send(is(c.body))})().catch(i)}))}}class as{constructor(e){this.AuthApiService=new i(this),this.ConnectionsApiService=new G(this),this.DiscoveryApiService=new M(this),this.DivideApiService=new Y(this),this.ExtensionsApiService=new ie(this),this.ExtensionsExternalApiService=new oe(this),this.FcaApiService=new le(this),this.GatewayApiService=new he(this),this.GroupApiService=new _e(this),this.LicenseApiService=new me(this),this.LinksApiService=new we(this),this.LimitationsApiService=new Se(this),this.LogstashApiService=new Ae(this),this.NotificationApiService=new Pe(this),this.RoleApiService=new Le(this),this.ShareApiService=new We(this),this.StorageCommentApiService=new He(this),this.StorageElementApiService=new Xe(this,this.FcaApiService),this.StorageFilesApiService=new nt(this),this.TagsApiService=new Ht(this),this.StorageInstanceApiService=new ot(this),this.StorageShareApiService=new at(this),this.StorageTrashApiService=new ht(this),this.UserApiService=new yt(this),this.UsersAppealsApiService=new Dt(this),this.VersionApiService=new zt(this),this.PlatformVersionApiService=new Wt(this),this.SpaceApiService=new Gt(this),this.SpaceFilesApiService=new Yt(this),this.tokenUpdate=new os,this.rest=new cs(this,this.tokenUpdate),this.requestInterceptors=[],this.responseInterceptors=[],this.request={use:(e,t)=>{this.requestInterceptors.push({fulfilled:e,rejected:t})}},this.response={use:(e,t)=>{this.responseInterceptors.push({fulfilled:e,rejected:t})}},this.state={clientParams:{host:null==e?void 0:e.host,version:(null==e?void 0:e.version)||X},requestParams:{path:"",headers:{},query:{},body:null,cache:"no-cache"},authToken:null,skipInterceptors:!1},this.rest.baseHost=this.state.clientParams.host||""}}export{n as AccessRights,i as AuthApiService,X as BASE_URL_V1,K as BASE_URL_V2,o as CONNECTIONS_PERMISSION,as as Client,l as ColorTypes,u as ConnectionGroup,h as ConnectionType,G as ConnectionsApiService,M as DiscoveryApiService,Y as DivideApiService,m as DivideMode,_ as DivideScope,a as EngineType,p as ExtensionFileMode,d as ExtensionType,ie as ExtensionsApiService,oe as ExtensionsExternalApiService,le as FcaApiService,he as GatewayApiService,_e as GroupApiService,me as LicenseApiService,k as LicenseError,y as LimitationSubType,S as LimitationType,Se as LimitationsApiService,we as LinksApiService,Ae as LogstashApiService,ns as NEED_TOKEN_UPDATE_ERROR,A as NotificationAction,Pe as NotificationApiService,b as NotificationEntityType,x as NotificationRowAction,C as NotificationStyle,c as OrderDirection,g as PermissionType,Wt as PlatformVersionApiService,de as QueryInitViewType,T as RequestMethod,U as RequestObserve,D as ResponseType,cs as Rest,f as RestrictionBooleanStatus,v as RestrictionModeKey,P as RestrictionSharing,$ as RestrictionStatus,Le as RoleApiService,N as SettingControlType,We as ShareApiService,Gt as SpaceApiService,Yt as SpaceFilesApiService,He as StorageCommentApiService,Xe as StorageElementApiService,H as StorageElementCheckStatus,W as StorageElementContentType,F as StorageElementHistoryAction,O as StorageElementType,nt as StorageFilesApiService,ot as StorageInstanceApiService,B as StorageRoot,at as StorageShareApiService,ht as StorageTrashApiService,Ht as TagsApiService,w as Tariff,os as TokenUpdate,yt as UserApiService,z as UserAppType,E as UserAuthType,L as UserParamsLabel,R as UserStatus,I as UserType,Dt as UsersAppealsApiService,zt as VersionApiService,es as applyInterceptors,ts as getCookieValue,ss as makeUrlParams,rs as normalizeHeaders,is as prepareRequestBody};
|
package/dist/classes/index.d.ts
CHANGED
package/dist/classes/rest.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { Client } from './client';
|
|
1
|
+
import type { Client } from './client';
|
|
2
2
|
import { NbAppState, RequestMethod, HttpResponse, RequestConfig, HttpEvent } from '../types';
|
|
3
3
|
import { TokenUpdate } from './token-update';
|
|
4
|
-
export
|
|
5
|
-
export declare const BASE_URL_V2 = "/api/v2";
|
|
4
|
+
export { BASE_URL_V1, BASE_URL_V2 } from './constants';
|
|
6
5
|
export declare class Rest {
|
|
7
6
|
private client;
|
|
8
7
|
private tokenUpdate;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,28 @@
|
|
|
1
|
+
interface AuthToken {
|
|
2
|
+
access_token?: string;
|
|
3
|
+
refresh_token?: string;
|
|
4
|
+
temp_token?: string;
|
|
5
|
+
masked_phone?: string;
|
|
6
|
+
code_ttl?: number;
|
|
7
|
+
tfa_attempts?: number;
|
|
8
|
+
two_factor_auth_required: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface AuthTokenUpdate {
|
|
11
|
+
access_token: string;
|
|
12
|
+
refresh_token: string;
|
|
13
|
+
}
|
|
14
|
+
interface AuthType {
|
|
15
|
+
classic: boolean;
|
|
16
|
+
basic: boolean;
|
|
17
|
+
ldap: boolean;
|
|
18
|
+
}
|
|
19
|
+
interface RequestAuthTokenParams {
|
|
20
|
+
access_token: string;
|
|
21
|
+
refresh_token: string;
|
|
22
|
+
with_cookie?: boolean;
|
|
23
|
+
path?: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
1
26
|
interface Tag {
|
|
2
27
|
create_date?: string;
|
|
3
28
|
id?: number;
|
|
@@ -490,59 +515,6 @@ type Interceptor<T = any> = {
|
|
|
490
515
|
rejected: (error: any) => any;
|
|
491
516
|
};
|
|
492
517
|
|
|
493
|
-
declare const NEED_TOKEN_UPDATE_ERROR = "update black token";
|
|
494
|
-
declare class TokenUpdate {
|
|
495
|
-
isUpdating: boolean;
|
|
496
|
-
private tokenUpdateResolve;
|
|
497
|
-
isTokenExpire(timestamp: number): boolean;
|
|
498
|
-
refreshToken(params: RequestAuthTokenParams, baseHost: string): Promise<any>;
|
|
499
|
-
waitForTokenUpdate(): Promise<void>;
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
declare class Client {
|
|
503
|
-
state: NbAppState;
|
|
504
|
-
AuthApiService: AuthApiService;
|
|
505
|
-
ConnectionsApiService: ConnectionsApiService;
|
|
506
|
-
DiscoveryApiService: DiscoveryApiService;
|
|
507
|
-
DivideApiService: DivideApiService;
|
|
508
|
-
ExtensionsApiService: ExtensionsApiService;
|
|
509
|
-
ExtensionsExternalApiService: ExtensionsExternalApiService;
|
|
510
|
-
FcaApiService: FcaApiService;
|
|
511
|
-
GatewayApiService: GatewayApiService;
|
|
512
|
-
GroupApiService: GroupApiService;
|
|
513
|
-
LicenseApiService: LicenseApiService;
|
|
514
|
-
LinksApiService: LinksApiService;
|
|
515
|
-
LimitationsApiService: LimitationsApiService;
|
|
516
|
-
LogstashApiService: LogstashApiService;
|
|
517
|
-
NotificationApiService: NotificationApiService;
|
|
518
|
-
RoleApiService: RoleApiService;
|
|
519
|
-
ShareApiService: ShareApiService;
|
|
520
|
-
StorageCommentApiService: StorageCommentApiService;
|
|
521
|
-
StorageElementApiService: StorageElementApiService;
|
|
522
|
-
StorageFilesApiService: StorageFilesApiService;
|
|
523
|
-
TagsApiService: TagsApiService;
|
|
524
|
-
StorageInstanceApiService: StorageInstanceApiService;
|
|
525
|
-
StorageShareApiService: StorageShareApiService;
|
|
526
|
-
StorageTrashApiService: StorageTrashApiService;
|
|
527
|
-
UserApiService: UserApiService;
|
|
528
|
-
UsersAppealsApiService: UsersAppealsApiService;
|
|
529
|
-
VersionApiService: VersionApiService;
|
|
530
|
-
PlatformVersionApiService: PlatformVersionApiService;
|
|
531
|
-
SpaceApiService: SpaceApiService;
|
|
532
|
-
SpaceFilesApiService: SpaceFilesApiService;
|
|
533
|
-
tokenUpdate: TokenUpdate;
|
|
534
|
-
rest: Rest;
|
|
535
|
-
requestInterceptors: Interceptor<RequestInit>[];
|
|
536
|
-
responseInterceptors: Interceptor<any>[];
|
|
537
|
-
constructor(clientParams: NbClientParams);
|
|
538
|
-
request: {
|
|
539
|
-
use: (fulfilled: (config: RequestInit) => RequestInit | Promise<RequestInit>, rejected: (error: any) => any) => void;
|
|
540
|
-
};
|
|
541
|
-
response: {
|
|
542
|
-
use: (fulfilled: (response: any) => any | Promise<any>, rejected: (error: any) => any) => void;
|
|
543
|
-
};
|
|
544
|
-
}
|
|
545
|
-
|
|
546
518
|
declare enum AccessRights {
|
|
547
519
|
LicenseRead = "license_read",// Просмотр
|
|
548
520
|
LicenseManage = "license_edit",// Управление лицензией
|
|
@@ -597,25 +569,6 @@ interface AccessToken {
|
|
|
597
569
|
};
|
|
598
570
|
}
|
|
599
571
|
|
|
600
|
-
interface AuthToken {
|
|
601
|
-
access_token?: string;
|
|
602
|
-
refresh_token?: string;
|
|
603
|
-
temp_token?: string;
|
|
604
|
-
masked_phone?: string;
|
|
605
|
-
code_ttl?: number;
|
|
606
|
-
tfa_attempts?: number;
|
|
607
|
-
two_factor_auth_required: boolean;
|
|
608
|
-
}
|
|
609
|
-
interface AuthTokenUpdate {
|
|
610
|
-
access_token: string;
|
|
611
|
-
refresh_token: string;
|
|
612
|
-
}
|
|
613
|
-
interface AuthType {
|
|
614
|
-
classic: boolean;
|
|
615
|
-
basic: boolean;
|
|
616
|
-
ldap: boolean;
|
|
617
|
-
}
|
|
618
|
-
|
|
619
572
|
interface CommentParams extends RequestBaseParams {
|
|
620
573
|
divide_id?: number;
|
|
621
574
|
file_version_id: string;
|
|
@@ -1214,8 +1167,18 @@ type SpaceElement = Pick<StorageElement, 'access_mode' | 'content_type' | 'creat
|
|
|
1214
1167
|
updated_by: number;
|
|
1215
1168
|
};
|
|
1216
1169
|
|
|
1170
|
+
declare const NEED_TOKEN_UPDATE_ERROR = "update black token";
|
|
1171
|
+
declare class TokenUpdate {
|
|
1172
|
+
isUpdating: boolean;
|
|
1173
|
+
private tokenUpdateResolve;
|
|
1174
|
+
isTokenExpire(timestamp: number): boolean;
|
|
1175
|
+
refreshToken(params: RequestAuthTokenParams, baseHost: string): Promise<any>;
|
|
1176
|
+
waitForTokenUpdate(): Promise<void>;
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1217
1179
|
declare const BASE_URL_V1 = "/api/v1";
|
|
1218
1180
|
declare const BASE_URL_V2 = "/api/v2";
|
|
1181
|
+
|
|
1219
1182
|
declare class Rest {
|
|
1220
1183
|
private client;
|
|
1221
1184
|
private tokenUpdate;
|
|
@@ -1235,6 +1198,50 @@ declare class Rest {
|
|
|
1235
1198
|
request<T>(method: RequestMethod, path: string, config?: RequestConfig): Promise<T | HttpResponse<T> | HttpEvent<T>>;
|
|
1236
1199
|
}
|
|
1237
1200
|
|
|
1201
|
+
declare class Client {
|
|
1202
|
+
state: NbAppState;
|
|
1203
|
+
AuthApiService: AuthApiService;
|
|
1204
|
+
ConnectionsApiService: ConnectionsApiService;
|
|
1205
|
+
DiscoveryApiService: DiscoveryApiService;
|
|
1206
|
+
DivideApiService: DivideApiService;
|
|
1207
|
+
ExtensionsApiService: ExtensionsApiService;
|
|
1208
|
+
ExtensionsExternalApiService: ExtensionsExternalApiService;
|
|
1209
|
+
FcaApiService: FcaApiService;
|
|
1210
|
+
GatewayApiService: GatewayApiService;
|
|
1211
|
+
GroupApiService: GroupApiService;
|
|
1212
|
+
LicenseApiService: LicenseApiService;
|
|
1213
|
+
LinksApiService: LinksApiService;
|
|
1214
|
+
LimitationsApiService: LimitationsApiService;
|
|
1215
|
+
LogstashApiService: LogstashApiService;
|
|
1216
|
+
NotificationApiService: NotificationApiService;
|
|
1217
|
+
RoleApiService: RoleApiService;
|
|
1218
|
+
ShareApiService: ShareApiService;
|
|
1219
|
+
StorageCommentApiService: StorageCommentApiService;
|
|
1220
|
+
StorageElementApiService: StorageElementApiService;
|
|
1221
|
+
StorageFilesApiService: StorageFilesApiService;
|
|
1222
|
+
TagsApiService: TagsApiService;
|
|
1223
|
+
StorageInstanceApiService: StorageInstanceApiService;
|
|
1224
|
+
StorageShareApiService: StorageShareApiService;
|
|
1225
|
+
StorageTrashApiService: StorageTrashApiService;
|
|
1226
|
+
UserApiService: UserApiService;
|
|
1227
|
+
UsersAppealsApiService: UsersAppealsApiService;
|
|
1228
|
+
VersionApiService: VersionApiService;
|
|
1229
|
+
PlatformVersionApiService: PlatformVersionApiService;
|
|
1230
|
+
SpaceApiService: SpaceApiService;
|
|
1231
|
+
SpaceFilesApiService: SpaceFilesApiService;
|
|
1232
|
+
tokenUpdate: TokenUpdate;
|
|
1233
|
+
rest: Rest;
|
|
1234
|
+
requestInterceptors: Interceptor<RequestInit>[];
|
|
1235
|
+
responseInterceptors: Interceptor<any>[];
|
|
1236
|
+
constructor(clientParams: NbClientParams);
|
|
1237
|
+
request: {
|
|
1238
|
+
use: (fulfilled: (config: RequestInit) => RequestInit | Promise<RequestInit>, rejected: (error: any) => any) => void;
|
|
1239
|
+
};
|
|
1240
|
+
response: {
|
|
1241
|
+
use: (fulfilled: (response: any) => any | Promise<any>, rejected: (error: any) => any) => void;
|
|
1242
|
+
};
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1238
1245
|
declare class AuthApiService {
|
|
1239
1246
|
private client;
|
|
1240
1247
|
constructor(client: Client);
|
|
@@ -1254,12 +1261,6 @@ interface RequestAuthTfaParams {
|
|
|
1254
1261
|
code: number;
|
|
1255
1262
|
temp_token: string;
|
|
1256
1263
|
}
|
|
1257
|
-
interface RequestAuthTokenParams {
|
|
1258
|
-
access_token: string;
|
|
1259
|
-
refresh_token: string;
|
|
1260
|
-
with_cookie?: boolean;
|
|
1261
|
-
path?: string;
|
|
1262
|
-
}
|
|
1263
1264
|
|
|
1264
1265
|
declare class ConnectionsApiService {
|
|
1265
1266
|
private client;
|
|
@@ -1411,6 +1412,7 @@ interface RequestStorageListParams extends RequestBaseParams {
|
|
|
1411
1412
|
show_hidden?: boolean;
|
|
1412
1413
|
without_tags?: boolean;
|
|
1413
1414
|
tag_ids?: number[];
|
|
1415
|
+
content_types?: StorageElementContentType[];
|
|
1414
1416
|
}
|
|
1415
1417
|
interface StorageElementPasteParams {
|
|
1416
1418
|
paths: StorageElementPaste[];
|
|
@@ -1930,6 +1932,7 @@ declare class SpaceFilesApiService {
|
|
|
1930
1932
|
delete(id: number, params: RequestSpaceDeleteFilesParams): Promise<void>;
|
|
1931
1933
|
copy(id: number, params: RequestSpaceCopyFileParams): Promise<SpaceElement>;
|
|
1932
1934
|
download(id: number, params: RequestSpaceDownloadFileParams): Promise<Blob>;
|
|
1935
|
+
createZipToDownload(id: number, params: RequestSpaceDownloadDirParams): Promise<Blob>;
|
|
1933
1936
|
move(id: number, params: RequestSpaceMoveFilesParams): Promise<void>;
|
|
1934
1937
|
rename(id: number, params: RequestSpaceRenameFileParams): Promise<SpaceElement>;
|
|
1935
1938
|
upload(onProgress: OnUploadProgress, id: number, file: File, params: RequestSpaceUploadParams): {
|
|
@@ -1938,8 +1941,7 @@ declare class SpaceFilesApiService {
|
|
|
1938
1941
|
};
|
|
1939
1942
|
uploadNet(id: number, params: RequestSpaceUploadFromUrlParams): Promise<SpaceElement>;
|
|
1940
1943
|
}
|
|
1941
|
-
type RequestSpaceElementListParams = Pick<RequestStorageListParams, 'is_search_dir' | 'limit' | 'max_size' | 'min_size' | 'offset' | 'order_by' | 'order_direction' | 'search' | 'type'> & {
|
|
1942
|
-
content_types?: StorageElementContentType[];
|
|
1944
|
+
type RequestSpaceElementListParams = Pick<RequestStorageListParams, 'is_search_dir' | 'limit' | 'max_size' | 'min_size' | 'offset' | 'order_by' | 'order_direction' | 'search' | 'type' | 'content_types'> & {
|
|
1943
1945
|
parent_id?: string;
|
|
1944
1946
|
};
|
|
1945
1947
|
interface RequestSpaceGetFileParams {
|
|
@@ -1972,6 +1974,9 @@ interface RequestSpaceDownloadFileParams {
|
|
|
1972
1974
|
last_used_extension?: string;
|
|
1973
1975
|
with_preview?: boolean;
|
|
1974
1976
|
}
|
|
1977
|
+
interface RequestSpaceDownloadDirParams {
|
|
1978
|
+
file_id: string;
|
|
1979
|
+
}
|
|
1975
1980
|
interface RequestSpaceMoveItem {
|
|
1976
1981
|
file_id: string;
|
|
1977
1982
|
to_parent_id?: string;
|
|
@@ -2008,4 +2013,4 @@ declare function normalizeHeaders(headers: Headers | [string, string][] | Record
|
|
|
2008
2013
|
declare function prepareRequestBody(body: unknown): XMLHttpRequestBodyInit | Document | null;
|
|
2009
2014
|
|
|
2010
2015
|
export { AccessRights, AuthApiService, BASE_URL_V1, BASE_URL_V2, CONNECTIONS_PERMISSION, Client, ColorTypes, ConnectionGroup, ConnectionType, ConnectionsApiService, DiscoveryApiService, DivideApiService, DivideMode, DivideScope, EngineType, ExtensionFileMode, ExtensionType, ExtensionsApiService, ExtensionsExternalApiService, FcaApiService, GatewayApiService, GroupApiService, LicenseApiService, LicenseError, LimitationSubType, LimitationType, LimitationsApiService, LinksApiService, LogstashApiService, NEED_TOKEN_UPDATE_ERROR, NotificationAction, NotificationApiService, NotificationEntityType, NotificationRowAction, NotificationStyle, OrderDirection, PermissionType, PlatformVersionApiService, QueryInitViewType, RequestMethod, RequestObserve, ResponseType, Rest, RestrictionBooleanStatus, RestrictionModeKey, RestrictionSharing, RestrictionStatus, RoleApiService, SettingControlType, ShareApiService, SpaceApiService, SpaceFilesApiService, StorageCommentApiService, StorageElementApiService, StorageElementCheckStatus, StorageElementContentType, StorageElementHistoryAction, StorageElementType, StorageFilesApiService, StorageInstanceApiService, StorageRoot, StorageShareApiService, StorageTrashApiService, TagsApiService, Tariff, TokenUpdate, UserApiService, UserAppType, UserAuthType, UserParamsLabel, UserStatus, UserType, UsersAppealsApiService, VersionApiService, applyInterceptors, getCookieValue, makeUrlParams, normalizeHeaders, prepareRequestBody };
|
|
2011
|
-
export type { AccessToken, Appeal, AssignTagItemParam, AuthToken, AuthTokenUpdate, AuthType, Category, ChangeLicenseParams, Comment, CommentParams, Connection, ConnectionCreateParams, CopyResponse, CreateCommentParams, CreateLimitationsParams, CreateStorageElementParams, CreateUserGroupParams, CreateUserParams, CreateUserRoleParams, CreateZipRequestParams, CutLinkRequest, DeleteAllCommentParams, DeleteCommentParams, Discovery, DivideResourceParams, DivideResourceType, DivideResponseList, Extension, ExtensionDefault, ExtensionExternal, ExtensionExternalInList, ExtensionExternalListParams, ExtensionExternalReadmeParams, ExtensionListParams, ExtensionMetaPayload, ExtensionTag, ExtensionTagListParams, FileLocking, HistoryListRequestParams, HistoryNote, HistoryRequestParams, HttpEvent, HttpResponse, Lang, License, Limitation, LockScreen, NameExtensionListParams, NbAppState, NbClientParams, NbRequestParams, NotificationActionGroup, NotificationPayload, OnUploadProgress, PayloadArchive, PayloadFile, Permission, PermissionItem, PlatformVersions, ProgressEvent, QueryInitResponse, Quota, RequestAuthSettingsParams, RequestAuthTfaParams, RequestAuthTokenParams, RequestBaseParams, RequestConfig, RequestConnectionParams, RequestLimitationsListParams, RequestLogsActionsParams, RequestNotificationListParams, RequestProvideSpaceAccessParams, RequestShareLoginParams, RequestSpaceAccessListParams, RequestSpaceAccessParams, RequestSpaceAdminsListParams, RequestSpaceCopyFileParams, RequestSpaceCreateElementParams, RequestSpaceCreateParams, RequestSpaceDeleteFilesParams, RequestSpaceDownloadFileParams, RequestSpaceElementListParams, RequestSpaceGetFileParams, RequestSpaceListParams, RequestSpaceMoveFilesParams, RequestSpaceMoveItem, RequestSpaceRenameFileParams, RequestSpaceReplaceFileParams, RequestSpaceUpdateParams, RequestSpaceUploadFromUrlParams, RequestSpaceUploadParams, RequestStorageListParams, RequestTagGroupsParams, RequestTagParams, RequestUpdateSpaceAccessParams, RequestUserDivideParams, RequestUserGroupListParams, RequestUserListParams, RequestUserRoleListParams, RequestUsersLogParams, RequestVersionsSizeParams, ResourceAccess, ResponseItem, ResponseList, ResponseListNotification, Restriction, Setting, SettingField, SettingFieldView, SettingLang, SettingValue, SettingValueField, SettingVariant, SettingViewConnectionChoose, SettingViewSelect, ShareInfo, ShareModel, SizeBySection, Space, SpaceAccess, SpaceAccessProvide, SpaceAcсessResponseList, SpaceAdmin, SpaceElement, StorageDivideElement, StorageElement, StorageElementFileInfo, StorageElementHistory, StorageElementPaste, StorageElementPasteParams, StorageElementTree, StorageElementVersion, StorageElementVersionLock, StorageInstance, StorageItemSizeParams, StorageItemSizePathParams, StorageRouteData, StorageSharingElement, StorageTrashElement, StorageTrashItem, Tag, TagCreateParams, TagGroup, TagIconExtension, TaskNotification, UnZipRequestParams, UnionRestriction, UpdateCommentParams, UploadNetRequestParams, User, UserAppPasswordInfo, UserAppPasswords, UserDivide, UserGroup, UserInfo, UserLabel, UserNamesExtension, UserNotification, UserParams, UserPhone, UserRole, UserSession, UserToken, UsersLog, Version, VersionLockRequestParams };
|
|
2016
|
+
export type { AccessToken, Appeal, AssignTagItemParam, AuthToken, AuthTokenUpdate, AuthType, Category, ChangeLicenseParams, Comment, CommentParams, Connection, ConnectionCreateParams, CopyResponse, CreateCommentParams, CreateLimitationsParams, CreateStorageElementParams, CreateUserGroupParams, CreateUserParams, CreateUserRoleParams, CreateZipRequestParams, CutLinkRequest, DeleteAllCommentParams, DeleteCommentParams, Discovery, DivideResourceParams, DivideResourceType, DivideResponseList, Extension, ExtensionDefault, ExtensionExternal, ExtensionExternalInList, ExtensionExternalListParams, ExtensionExternalReadmeParams, ExtensionListParams, ExtensionMetaPayload, ExtensionTag, ExtensionTagListParams, FileLocking, HistoryListRequestParams, HistoryNote, HistoryRequestParams, HttpEvent, HttpResponse, Lang, License, Limitation, LockScreen, NameExtensionListParams, NbAppState, NbClientParams, NbRequestParams, NotificationActionGroup, NotificationPayload, OnUploadProgress, PayloadArchive, PayloadFile, Permission, PermissionItem, PlatformVersions, ProgressEvent, QueryInitResponse, Quota, RequestAuthSettingsParams, RequestAuthTfaParams, RequestAuthTokenParams, RequestBaseParams, RequestConfig, RequestConnectionParams, RequestLimitationsListParams, RequestLogsActionsParams, RequestNotificationListParams, RequestProvideSpaceAccessParams, RequestShareLoginParams, RequestSpaceAccessListParams, RequestSpaceAccessParams, RequestSpaceAdminsListParams, RequestSpaceCopyFileParams, RequestSpaceCreateElementParams, RequestSpaceCreateParams, RequestSpaceDeleteFilesParams, RequestSpaceDownloadDirParams, RequestSpaceDownloadFileParams, RequestSpaceElementListParams, RequestSpaceGetFileParams, RequestSpaceListParams, RequestSpaceMoveFilesParams, RequestSpaceMoveItem, RequestSpaceRenameFileParams, RequestSpaceReplaceFileParams, RequestSpaceUpdateParams, RequestSpaceUploadFromUrlParams, RequestSpaceUploadParams, RequestStorageListParams, RequestTagGroupsParams, RequestTagParams, RequestUpdateSpaceAccessParams, RequestUserDivideParams, RequestUserGroupListParams, RequestUserListParams, RequestUserRoleListParams, RequestUsersLogParams, RequestVersionsSizeParams, ResourceAccess, ResponseItem, ResponseList, ResponseListNotification, Restriction, Setting, SettingField, SettingFieldView, SettingLang, SettingValue, SettingValueField, SettingVariant, SettingViewConnectionChoose, SettingViewSelect, ShareInfo, ShareModel, SizeBySection, Space, SpaceAccess, SpaceAccessProvide, SpaceAcсessResponseList, SpaceAdmin, SpaceElement, StorageDivideElement, StorageElement, StorageElementFileInfo, StorageElementHistory, StorageElementPaste, StorageElementPasteParams, StorageElementTree, StorageElementVersion, StorageElementVersionLock, StorageInstance, StorageItemSizeParams, StorageItemSizePathParams, StorageRouteData, StorageSharingElement, StorageTrashElement, StorageTrashItem, Tag, TagCreateParams, TagGroup, TagIconExtension, TaskNotification, UnZipRequestParams, UnionRestriction, UpdateCommentParams, UploadNetRequestParams, User, UserAppPasswordInfo, UserAppPasswords, UserDivide, UserGroup, UserInfo, UserLabel, UserNamesExtension, UserNotification, UserParams, UserPhone, UserRole, UserSession, UserToken, UsersLog, Version, VersionLockRequestParams };
|
package/dist/types/auth.d.ts
CHANGED
package/dist/types/base.d.ts
CHANGED