nb-js-client 0.0.0

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.
Files changed (50) hide show
  1. package/dist/api/auth-api.service.d.ts +19 -0
  2. package/dist/api/connections-api.service.d.ts +12 -0
  3. package/dist/api/discovery-api.service.d.ts +8 -0
  4. package/dist/api/divide-api.service.d.ts +17 -0
  5. package/dist/api/extensions-api.service.d.ts +21 -0
  6. package/dist/api/extensions-external-api.service.d.ts +9 -0
  7. package/dist/api/fca-api.service.d.ts +14 -0
  8. package/dist/api/gateway-api.service.d.ts +9 -0
  9. package/dist/api/group-api.service.d.ts +11 -0
  10. package/dist/api/index.d.ts +18 -0
  11. package/dist/api/license-api.service.d.ts +13 -0
  12. package/dist/api/logstash-api.service.d.ts +8 -0
  13. package/dist/api/notifications-api.service.d.ts +17 -0
  14. package/dist/api/role-api.service.d.ts +15 -0
  15. package/dist/api/share-api.service.d.ts +14 -0
  16. package/dist/api/storage-element-api.service.d.ts +32 -0
  17. package/dist/api/storage-files-api.service.d.ts +13 -0
  18. package/dist/api/storage-share-api.service.d.ts +11 -0
  19. package/dist/api/storage-trash-api.service.d.ts +10 -0
  20. package/dist/api/user-api.service.d.ts +40 -0
  21. package/dist/bundle.cjs.js +1 -0
  22. package/dist/bundle.esm.js +1 -0
  23. package/dist/classes/client.d.ts +39 -0
  24. package/dist/classes/index.d.ts +2 -0
  25. package/dist/classes/rest.d.ts +13 -0
  26. package/dist/helpers/index.d.ts +1 -0
  27. package/dist/helpers/send-request.d.ts +6 -0
  28. package/dist/index.d.ts +1051 -0
  29. package/dist/types/auth.d.ts +9 -0
  30. package/dist/types/base.d.ts +48 -0
  31. package/dist/types/connection.d.ts +45 -0
  32. package/dist/types/discovery.d.ts +15 -0
  33. package/dist/types/divide.d.ts +72 -0
  34. package/dist/types/extension.d.ts +93 -0
  35. package/dist/types/group.d.ts +23 -0
  36. package/dist/types/index.d.ts +19 -0
  37. package/dist/types/interceptor.d.ts +4 -0
  38. package/dist/types/license.d.ts +23 -0
  39. package/dist/types/lock-screen.d.ts +4 -0
  40. package/dist/types/notification.d.ts +85 -0
  41. package/dist/types/permission.d.ts +10 -0
  42. package/dist/types/query-init.d.ts +23 -0
  43. package/dist/types/restriction.d.ts +9 -0
  44. package/dist/types/role.d.ts +17 -0
  45. package/dist/types/setting.d.ts +57 -0
  46. package/dist/types/storage-trash.d.ts +14 -0
  47. package/dist/types/storage.d.ts +105 -0
  48. package/dist/types/user-log.d.ts +17 -0
  49. package/dist/types/user.d.ts +67 -0
  50. package/package.json +33 -0
@@ -0,0 +1,19 @@
1
+ import { Client } from '../classes';
2
+ import { AuthToken, AuthType } from '../types';
3
+ export declare class AuthApiService {
4
+ private client;
5
+ constructor(client: Client);
6
+ info(): Promise<AuthType>;
7
+ login(data: {
8
+ login: string;
9
+ password: string;
10
+ is_remember: boolean;
11
+ }): Promise<AuthToken>;
12
+ ldapLogin(data: {
13
+ login: string;
14
+ password: string;
15
+ is_remember: boolean;
16
+ }): Promise<AuthToken>;
17
+ updateToken(data: AuthToken): Promise<any>;
18
+ logout(): Promise<void>;
19
+ }
@@ -0,0 +1,12 @@
1
+ import { Client } from '../classes';
2
+ import { Connection, ConnectionCreateParams, RequestConnectionParams, ResponseItem, ResponseList } from '../types';
3
+ export declare class ConnectionsApiService {
4
+ private client;
5
+ constructor(client: Client);
6
+ list(params: RequestConnectionParams): Promise<ResponseList<Connection>>;
7
+ get(id: number): Promise<ResponseItem<Connection>>;
8
+ update(id: number, data: ConnectionCreateParams): Promise<ResponseItem<Connection>>;
9
+ delete(id: number): Promise<void>;
10
+ create(data: ConnectionCreateParams): Promise<ResponseItem<Connection>>;
11
+ dashboard(params: RequestConnectionParams): Promise<ResponseList<Connection>>;
12
+ }
@@ -0,0 +1,8 @@
1
+ import { Client } from '../classes';
2
+ import { ResponseList } from '../types';
3
+ import { Discovery } from '../types/discovery';
4
+ export declare class DiscoveryApiService {
5
+ private client;
6
+ constructor(client: Client);
7
+ discovery(params?: any): Promise<ResponseList<Discovery>>;
8
+ }
@@ -0,0 +1,17 @@
1
+ import { Client } from '../classes';
2
+ import { DivideMode, DivideResourceType, DivideResponseList, DivideScope, PermissionType, RequestUserDivideParams, ResponseItem, ResponseList, UserDivide } from '../types';
3
+ export declare class DivideApiService {
4
+ private client;
5
+ constructor(client: Client);
6
+ divideDelete(service: DivideScope, id: number): Promise<void>;
7
+ divideDeleteAll(service: DivideScope, resource: DivideResourceType, access_mode: PermissionType, is_to_user_group: boolean): Promise<void>;
8
+ divideChange(service: DivideScope, id: number, access_mode: PermissionType): Promise<UserDivide>;
9
+ divideCreate(service: DivideScope, resource: DivideResourceType, id: number, access_mode: PermissionType, key: DivideMode): Promise<ResponseItem<UserDivide>>;
10
+ divideUsers(service: DivideScope, resource: DivideResourceType, params: RequestUserDivideParams): Promise<DivideResponseList>;
11
+ restrictions(params?: any): Promise<ResponseList<UserDivide>>;
12
+ restrictionsChange(token: number, data: {
13
+ status: any;
14
+ comment: string;
15
+ }): Promise<ResponseList<UserDivide>>;
16
+ private makeParam;
17
+ }
@@ -0,0 +1,21 @@
1
+ import { Client } from '../classes';
2
+ import { Extension, ExtensionDefault, ExtensionListParams, ResponseItem, ResponseList, SettingValue } from '../types';
3
+ export declare class ExtensionsApiService {
4
+ private client;
5
+ constructor(client: Client);
6
+ getSetting(uniqKey: string): Promise<SettingValue[]>;
7
+ setSetting(uniqKey: string, params: SettingValue[]): Promise<void>;
8
+ deleteSetting(uniqKey: string): Promise<void>;
9
+ get(id: number): Promise<ResponseItem<Extension>>;
10
+ getByKey(uniqKey: string): Promise<ResponseItem<Extension | null>>;
11
+ getDefault(ext_code?: string[]): Promise<ResponseList<ExtensionDefault>>;
12
+ setDefault(ext_code: string, ext_uniq_key: string): Promise<ExtensionDefault>;
13
+ checkUpdates(): Promise<void>;
14
+ updateVersion(id: number, version: string): Promise<Extension>;
15
+ list(params?: ExtensionListParams): Promise<ResponseList<Extension & {
16
+ with_settings: boolean;
17
+ }>>;
18
+ delete(id: number, name: string): Promise<void>;
19
+ upload(file: File): Promise<ResponseItem<Extension>>;
20
+ install(uniq_key: string, version: string): Promise<any>;
21
+ }
@@ -0,0 +1,9 @@
1
+ import { Client } from '../classes';
2
+ import { ExtensionExternal, ExtensionExternalInList, ExtensionExternalListParams, ResponseList } from '../types';
3
+ export declare class ExtensionsExternalApiService {
4
+ private client;
5
+ constructor(client: Client);
6
+ listExtensionsSite(params: ExtensionExternalListParams): Promise<ResponseList<ExtensionExternalInList>>;
7
+ extensionDetailSite(uniqKey: string): Promise<ExtensionExternal>;
8
+ extensionMarkdown(uniqKey: string): Promise<string>;
9
+ }
@@ -0,0 +1,14 @@
1
+ import { Client } from '../classes';
2
+ import { ConnectionCreateParams, RequestStorageListParams, ResponseItem, ResponseList, StorageElement, CreateStorageElementParams } from '../types';
3
+ export declare class FcaApiService {
4
+ private client;
5
+ constructor(client: Client);
6
+ info(rootID: number, path: string): Promise<StorageElement>;
7
+ list(rootID: number, params?: RequestStorageListParams): Promise<ResponseList<StorageElement>>;
8
+ create(rootID: number, data: CreateStorageElementParams): Promise<any>;
9
+ replace(rootID: number, path: string, data: any): Promise<ResponseItem<StorageElement>>;
10
+ read(id: number, path: string): Promise<ResponseItem<any>>;
11
+ upload(rootID: number, file: File, path?: string): Promise<ResponseItem<StorageElement>>;
12
+ delete(rootID: number, path: string): Promise<void>;
13
+ check(data: ConnectionCreateParams): Promise<void>;
14
+ }
@@ -0,0 +1,9 @@
1
+ import { Client } from '../classes';
2
+ import { QueryInit, Setting, SettingValue } from '../types';
3
+ export declare class GatewayApiService {
4
+ private client;
5
+ constructor(client: Client);
6
+ settings(): Promise<Setting[]>;
7
+ changeSettings(data: SettingValue[]): Promise<void>;
8
+ queryInit(): Promise<QueryInit>;
9
+ }
@@ -0,0 +1,11 @@
1
+ import { Client } from '../classes';
2
+ import { CreateGroupParams, Group, RequestGroupListParams, ResponseItem, ResponseList, User } from '../types';
3
+ export declare class GroupApiService {
4
+ private client;
5
+ constructor(client: Client);
6
+ list(params: RequestGroupListParams): Promise<ResponseList<Group>>;
7
+ listUsers(id: number): Promise<ResponseList<User>>;
8
+ create(data: CreateGroupParams): Promise<ResponseItem<Group>>;
9
+ update(id: number, data: CreateGroupParams): Promise<ResponseItem<Group>>;
10
+ delete(id: number): Promise<void>;
11
+ }
@@ -0,0 +1,18 @@
1
+ export * from './auth-api.service';
2
+ export * from './connections-api.service';
3
+ export * from './discovery-api.service';
4
+ export * from './divide-api.service';
5
+ export * from './extensions-api.service';
6
+ export * from './extensions-external-api.service';
7
+ export * from './fca-api.service';
8
+ export * from './gateway-api.service';
9
+ export * from './group-api.service';
10
+ export * from './license-api.service';
11
+ export * from './logstash-api.service';
12
+ export * from './role-api.service';
13
+ export * from './user-api.service';
14
+ export * from './share-api.service';
15
+ export * from './storage-share-api.service';
16
+ export * from './storage-element-api.service';
17
+ export * from './storage-share-api.service';
18
+ export * from './storage-trash-api.service';
@@ -0,0 +1,13 @@
1
+ import { Client } from '../classes';
2
+ import { ChangeLicenseParams, License } from '../types';
3
+ export declare class LicenseApiService {
4
+ private client;
5
+ constructor(client: Client);
6
+ info(): Promise<License>;
7
+ create(data: ChangeLicenseParams): Promise<License>;
8
+ check(): Promise<License>;
9
+ delete(): Promise<void>;
10
+ getHash(): Promise<{
11
+ hash: string;
12
+ }>;
13
+ }
@@ -0,0 +1,8 @@
1
+ import { Client } from '../classes';
2
+ import { RequestUsersLogParams, ResponseList, UsersLog } from '../types';
3
+ export declare class LogstashApiService {
4
+ private client;
5
+ constructor(client: Client);
6
+ getUsersLogs(params: RequestUsersLogParams): Promise<ResponseList<UsersLog>>;
7
+ getSystemLogs(path: string): Promise<string>;
8
+ }
@@ -0,0 +1,17 @@
1
+ import { Client } from '../classes';
2
+ import { NotificationActionGroup, NotificationRowAction, RequestNotificationListParams, ResponseListNotification } from '../types';
3
+ export declare class NotificationsApiService {
4
+ private client;
5
+ constructor(client: Client);
6
+ list(params?: RequestNotificationListParams): Promise<ResponseListNotification>;
7
+ toggleStatus(ids: number[], to_status: NotificationRowAction): Promise<void>;
8
+ toggleAllStatus(to_status: NotificationRowAction): Promise<void>;
9
+ delete(id: number[]): Promise<void>;
10
+ deleteAll(): Promise<void>;
11
+ getPermission(): Promise<{
12
+ enabled: boolean;
13
+ }>;
14
+ setPermission(permission: boolean): Promise<void>;
15
+ getSubscription(): Promise<NotificationActionGroup>;
16
+ setSubscription(data: NotificationActionGroup): Promise<void>;
17
+ }
@@ -0,0 +1,15 @@
1
+ import { Client } from '../classes';
2
+ import { CreateRoleParams, RequestRoleListParams, ResponseItem, ResponseList, Role, Permission } from '../types';
3
+ export declare class RoleApiService {
4
+ private client;
5
+ constructor(client: Client);
6
+ list(params?: RequestRoleListParams): Promise<ResponseList<Role>>;
7
+ get(id: number): Promise<ResponseItem<Role>>;
8
+ getDefault(): Promise<ResponseItem<Role>>;
9
+ create(data: CreateRoleParams): Promise<ResponseItem<Role>>;
10
+ update(id: number, data: CreateRoleParams): Promise<ResponseItem<Role>>;
11
+ delete(id: number): Promise<void>;
12
+ permissions(): Promise<ResponseList<Permission>>;
13
+ addPermissions(id: number, ids: number[]): Promise<void>;
14
+ deletePermissions(id: number, ids: number[]): Promise<void>;
15
+ }
@@ -0,0 +1,14 @@
1
+ import { Client } from '../classes';
2
+ import { RequestBaseParams, ResponseList, RestrictionStatus, ShareInfo } from '../types';
3
+ export declare class ShareApiService {
4
+ private client;
5
+ constructor(client: Client);
6
+ info(path: string, share_token: string): Promise<ShareInfo>;
7
+ checkPassword(password: string, share_token: string): Promise<any>;
8
+ checkToken(share_token: string): Promise<any>;
9
+ restrictions(params?: RequestBaseParams): Promise<ResponseList<ShareInfo>>;
10
+ restrictionsChange(token: string, data: {
11
+ status: RestrictionStatus;
12
+ comment: string;
13
+ }): Promise<ResponseList<ShareInfo>>;
14
+ }
@@ -0,0 +1,32 @@
1
+ import { Client } from '../classes';
2
+ import { RequestHistoryListParams, StorageElementHistoryNote, StorageElementPasteParams, ResponseItem, ResponseList, CreateStorageElementParams, StorageElementHistory, StorageElementPaste, StorageElementVersion, StorageRoot } from '../types';
3
+ import { RequestStorageListParams, StorageElement } from '../types';
4
+ export declare class StorageElementApiService {
5
+ private client;
6
+ constructor(client: Client);
7
+ list(params?: RequestStorageListParams): Promise<ResponseList<StorageElement>>;
8
+ info(params: {
9
+ path: string;
10
+ divide_id?: number;
11
+ file_version_id?: string;
12
+ }): Promise<StorageElement>;
13
+ size(data: {
14
+ paths: string[];
15
+ divide_id?: number;
16
+ }): Promise<number>;
17
+ move(data: StorageElementPasteParams, hasFCA?: boolean): Promise<void>;
18
+ copy(params: StorageElementPasteParams, from: StorageRoot, to: StorageRoot): Promise<void>;
19
+ pasteFromShared(from_sharing_token: string, paths: StorageElementPaste[], from_sharing_password?: string): Promise<void>;
20
+ create(data: CreateStorageElementParams): Promise<ResponseItem<StorageElement>>;
21
+ delete(path: string, divide_id?: number): Promise<void>;
22
+ favorite(path: string): Promise<void>;
23
+ removeFavorite(path: string): Promise<void>;
24
+ createItem(data: CreateStorageElementParams): Promise<ResponseItem<StorageElement>>;
25
+ createWorkDir(data: CreateStorageElementParams): Promise<ResponseItem<StorageElement>>;
26
+ history(params: RequestHistoryListParams): Promise<ResponseList<StorageElementHistory>>;
27
+ versions(params: RequestHistoryListParams): Promise<ResponseList<StorageElementVersion>>;
28
+ createVersion(data: StorageElementHistoryNote): Promise<ResponseItem<StorageElementVersion>>;
29
+ editVersion(data: StorageElementHistoryNote): Promise<ResponseItem<StorageElementVersion>>;
30
+ deleteVersion(params: RequestHistoryListParams): Promise<void>;
31
+ makeCurrentVersion(data: RequestHistoryListParams): Promise<void>;
32
+ }
@@ -0,0 +1,13 @@
1
+ import { Client } from '../classes';
2
+ import { ResponseItem, StorageElement, UploadNetRequestParams } from '../types';
3
+ export declare class StorageFilesApiService {
4
+ private client;
5
+ constructor(client: Client);
6
+ read(path: string, params: any): Promise<ResponseItem<any>>;
7
+ replace(params: {
8
+ path: string;
9
+ divide_id?: number;
10
+ }, data: any): Promise<ResponseItem<StorageElement>>;
11
+ upload(file: File, path: string, divide_id?: number): Promise<ResponseItem<StorageElement>>;
12
+ uploadNet(data: UploadNetRequestParams): Promise<ResponseItem<StorageElement>>;
13
+ }
@@ -0,0 +1,11 @@
1
+ import { Client } from '../classes';
2
+ import { PermissionType, ShareInfo, ShareModel } from '../types';
3
+ export declare class StorageShareApiService {
4
+ private client;
5
+ constructor(client: Client);
6
+ info(path: string): Promise<ShareInfo>;
7
+ create(path: string, permissions_type: PermissionType): Promise<ShareInfo>;
8
+ change(data: ShareModel): Promise<ShareInfo>;
9
+ delete(path: string): Promise<void>;
10
+ refresh(token: string): Promise<ShareInfo>;
11
+ }
@@ -0,0 +1,10 @@
1
+ import { Client } from '../classes';
2
+ import { RequestStorageListParams, ResponseList, StorageTrashElement, StorageTrashItem } from '../types';
3
+ export declare class StorageTrashApiService {
4
+ private client;
5
+ constructor(client: Client);
6
+ list(params: RequestStorageListParams): Promise<ResponseList<StorageTrashElement>>;
7
+ clear(item: StorageTrashItem): Promise<void>;
8
+ clearAll(): Promise<void>;
9
+ restore(del_groups: StorageTrashItem[]): Promise<void>;
10
+ }
@@ -0,0 +1,40 @@
1
+ import { Client } from '../classes';
2
+ import { CreateUserParams, RequestBaseParams, RequestUserListParams, ResponseItem, ResponseList, User, UserSession, UserToken } from '../types';
3
+ export declare class UserApiService {
4
+ private client;
5
+ constructor(client: Client);
6
+ list(params: RequestUserListParams): Promise<ResponseList<User>>;
7
+ get(id: number): Promise<ResponseItem<User>>;
8
+ create(data: CreateUserParams): Promise<ResponseItem<User>>;
9
+ update(id: number, data: CreateUserParams): Promise<ResponseItem<User>>;
10
+ delete(id: number, params?: {
11
+ hard: boolean;
12
+ }): Promise<void>;
13
+ restore(id: number): Promise<void>;
14
+ me(): Promise<ResponseItem<User>>;
15
+ updateMe(data: CreateUserParams): Promise<ResponseItem<User>>;
16
+ createToken(data: {
17
+ name: string;
18
+ expire_in: string | null;
19
+ }): Promise<UserToken>;
20
+ listToken(params: RequestBaseParams): Promise<ResponseList<UserToken>>;
21
+ deleteToken(id: number): Promise<void>;
22
+ changeMyPassword(data: {
23
+ new_password: string;
24
+ old_password: string;
25
+ }): Promise<{
26
+ success: boolean;
27
+ }>;
28
+ changeUsersPassword(id: number, data: {
29
+ new_password: string;
30
+ }): Promise<{
31
+ success: boolean;
32
+ }>;
33
+ meUploadAvatar(file: Blob, fileName: string): Promise<{
34
+ file_path: string;
35
+ }>;
36
+ meDeleteAvatar(): Promise<void>;
37
+ meListSession(params: RequestBaseParams): Promise<ResponseList<UserSession>>;
38
+ meDeleteSession(id?: number): Promise<void>;
39
+ setRole(id: number, role_id?: number | null): Promise<void>;
40
+ }
@@ -0,0 +1 @@
1
+ "use strict";const e="/login",t=`${e}/ldap`,s=`${e}/update`;class i{constructor(e){this.client=e}info(){return this.client.rest.get(e)}login(t){return this.client.rest.post(e,JSON.stringify(t))}ldapLogin(e){return this.client.rest.post(t,JSON.stringify(e))}updateToken(e){return this.client.rest.post(s,JSON.stringify(e))}logout(){return this.client.rest.post("/logout")}}var r,n,o,c,a,l,d,p,h,u,g,x,y,f,S,v,_,$,m,O,N,w,A,k,T,D;exports.OrderDirection=void 0,(r=exports.OrderDirection||(exports.OrderDirection={})).DEFAULT="",r.ASC="asc",r.DESC="desc",exports.EngineType=void 0,(n=exports.EngineType||(exports.EngineType={})).WebSocket="websocket",n.PostMessage="postmessage",n.Empty="",exports.StorageRoot=void 0,(o=exports.StorageRoot||(exports.StorageRoot={})).my="my",o.fca="fca",o.divide="divide",o.share="share",o.favorite="favorite",exports.ConnectionGroup=void 0,(c=exports.ConnectionGroup||(exports.ConnectionGroup={})).Storages="storages_connections_group",c.Webhooks="webhooks_connections_group",c.Unknown="unknown_connections_group",c.Proxy="proxy_connections_group",exports.ConnectionType=void 0,(a=exports.ConnectionType||(exports.ConnectionType={})).SSH="ssh_connection",a.YandexDisk="yandex_disk",a.Mail="mail",a.Discord="discord",a.Webdav="webdav_connection",a.Nextcloud="nextcloud_connection",a.NextBox="nextbox_connection",a.HttpProxy="http_proxy_connection",a.S3="s3_connection",exports.ExtensionType=void 0,(l=exports.ExtensionType||(exports.ExtensionType={})).App="app",l.File="file",l.WorkDir="work_dir",exports.ExtensionFileMode=void 0,(d=exports.ExtensionFileMode||(exports.ExtensionFileMode={})).Read="read",d.ReadAndWrite="read_and_write",d.Write="write",exports.DivideScope=void 0,(p=exports.DivideScope||(exports.DivideScope={})).Storage="/storage/element",p.Connection="/connections",exports.PermissionType=void 0,(h=exports.PermissionType||(exports.PermissionType={})).CLOSE="",h.READ="r",h.WRITE="rw",exports.RestrictionStatus=void 0,(u=exports.RestrictionStatus||(exports.RestrictionStatus={})).WAITING="waiting",u.APPROVED="approved",u.REJECTED="rejected",exports.RestrictionBooleanStatus=void 0,(g=exports.RestrictionBooleanStatus||(exports.RestrictionBooleanStatus={})).TRUE="true",g.FALSE="false",exports.DivideMode=void 0,(x=exports.DivideMode||(exports.DivideMode={})).User="to_user_id",x.Group="to_user_group_id",exports.Tariff=void 0,(y=exports.Tariff||(exports.Tariff={})).Free="free",y.Business="business",y.Enterprise="enterprise",exports.LicenseError=void 0,(f=exports.LicenseError||(exports.LicenseError={})).NotActivated="License not activated",f.Blocked="License blocked",f.Expired="License has been expired",f.NotValid="License not valid",f.NotFound="license file not found",exports.NotificationEntityType=void 0,(S=exports.NotificationEntityType||(exports.NotificationEntityType={})).Dir="dir",S.File="file",S.User="user",S.Other="other",S.WorkDir="work_dir",S.License="license",S.Extension="extension",S.Connection="connection",exports.NotificationAction=void 0,(v=exports.NotificationAction||(exports.NotificationAction={})).OpenSharing="open_sharing",v.ChangeSharing="change_sharing",v.CancelSharing="cancel_sharing",v.DivideDirAddFileToOwner="divide_dir_add_file_to_owner",v.DivideDirAddDirToOwner="divide_dir_add_dir_to_owner",v.DivideDirAddWorkDirToOwner="divide_dir_add_work_dir_to_owner",v.DivideConnectionAddFileToOwner="divide_connection_add_file_to_owner",v.DivideConnectionAddDirToOwner="divide_connection_add_dir_to_owner",v.CancelDivideDir="cancel_divide_dir",v.CancelDivideFile="cancel_divide_file",v.CancelDivideWorkDir="cancel_divide_work_dir",v.CancelDivideConnection="cancel_divide_connection",v.DeleteExtension="delete_extension",v.NewVersionExtension="new_version_extension",v.Other="other",exports.NotificationRowAction=void 0,(_=exports.NotificationRowAction||(exports.NotificationRowAction={})).Read="read",_.Unread="unread",_.Delete="delete",exports.NotificationStyle=void 0,($=exports.NotificationStyle||(exports.NotificationStyle={})).Plain="plain",$.Success="success",$.Info="info",$.Warning="warning",$.Error="error",exports.RestrictionSharing=void 0,(m=exports.RestrictionSharing||(exports.RestrictionSharing={})).NONE="none",m.SOFT="soft",m.HARD="hard",exports.UserAuthType=void 0,(O=exports.UserAuthType||(exports.UserAuthType={})).Native="native",O.Ldap="ldap",exports.UserStatus=void 0,(N=exports.UserStatus||(exports.UserStatus={})).Registering="registering",N.Activated="activated",N.Blocked="blocked",N.BlockedByLicense="blocked_by_license",exports.UserType=void 0,(w=exports.UserType||(exports.UserType={})).User="user",w.Guest="guest",w.Emperor="emperor",w.Anonymous="anonymous",exports.SettingControlType=void 0,(A=exports.SettingControlType||(exports.SettingControlType={})).Text="text",A.String="string",A.Number="number",A.CheckBox="checkbox",A.Select="select",A.RadioList="radio_list",A.ConnectionChoose="connection_choose",A.MultiConnectionChoose="multi_connection_choose",exports.StorageElementType=void 0,(k=exports.StorageElementType||(exports.StorageElementType={})).Dir="dir",k.File="file",k.WorkDir="work_dir",exports.StorageElementContentType=void 0,(T=exports.StorageElementContentType||(exports.StorageElementContentType={})).Any="any",T.Dir="dir",T.Code="code",T.Image="image",T.Audio="audio",T.Video="video",T.Text="text",T.Doc="doc",T.Xls="xls",T.Ppt="ppt",exports.StorageElementHistoryAction=void 0,(D=exports.StorageElementHistoryAction||(exports.StorageElementHistoryAction={})).Create="create",D.Update="update",D.Move="move";const E="/connections",b=`${E}/dashboard`;class J{constructor(e){this.client=e}list(e){return this.client.rest.get(E,e)}get(e){return this.client.rest.get(`${E}/${e}`)}update(e,t){return this.client.rest.put(`${E}/${e}`,JSON.stringify(t))}delete(e){return this.client.rest.delete(`${E}/${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]||E,JSON.stringify(e))}dashboard(e){return this.client.rest.get(b,e)}}class C{constructor(e){this.client=e}discovery(e){return this.client.rest.get("/discovery",e)}}class R{constructor(e){this.client=e}divideDelete(e,t){return this.client.rest.delete(`${e}/divide/${t}`)}divideDeleteAll(e,t,s,i){return this.client.rest.delete(`${e}/divide`,Object.assign(Object.assign({},this.makeParam(e,t)),{is_to_user_group:i,access_mode:s}))}divideChange(e,t,s){return this.client.rest.put(`${e}/divide/${t}`,JSON.stringify({access_mode:s}))}divideCreate(e,t,s,i,r){const n=Object.assign(Object.assign({},this.makeParam(e,t)),{[r]:s,access_mode:i});return this.client.rest.post(`${e}/divide`,JSON.stringify(n))}divideUsers(e,t,s){return this.client.rest.get(`${e}/divide/users`,Object.assign(Object.assign({},this.makeParam(e,t)),s))}restrictions(e){return this.client.rest.get("/divide/restrictions",e)}restrictionsChange(e,t){return this.client.rest.put(`/divide/restrictions/${e}`,JSON.stringify(t))}makeParam(e,t){const s={};return e===exports.DivideScope.Connection?s.connection_id=t:s.path=t,s}}const P="/static/extensions",q="/extensions/defaults";class U{constructor(e){this.client=e}getSetting(e){return this.client.rest.get(`${P}/${e}/settings`)}setSetting(e,t){return this.client.rest.post(`${P}/${e}/settings`,JSON.stringify(t))}deleteSetting(e){return this.client.rest.delete(`${P}/${e}/settings`)}get(e){return this.client.rest.get(`${P}/${e}`)}getByKey(e){return this.client.rest.get(`${P}/${e}`)}getDefault(e=[]){return this.client.rest.get(q,{ext_code:e})}setDefault(e,t){return this.client.rest.post(q,JSON.stringify({ext_code:e,ext_uniq_key:t}))}checkUpdates(){return this.client.rest.post("/static/extensions/check_updates")}updateVersion(e,t){return this.client.rest.put(`/static/extensions/${e}`,JSON.stringify({version:t}))}list(e){return this.client.rest.get(P,e)}delete(e,t){return this.client.rest.delete(`${P}/${e}`)}upload(e){const t=new FormData;return t.set("file",e),this.client.rest.post(P,t)}install(e,t){return this.client.rest.post("/static/extensions/site",JSON.stringify({uniq_key:e,version:t}))}}class L{constructor(e){this.client=e}listExtensionsSite(e){return this.client.rest.get("/anons_ext/extensions",e)}extensionDetailSite(e){return this.client.rest.get(`/anons_ext/extensions/${e}`)}extensionMarkdown(e){return this.client.rest.get(`/anons_ext/extensions/${e}/readme`)}}const j="/disk",F=`${j}/check`;class I{constructor(e){this.client=e}info(e,t){return this.client.rest.get(`${j}/${e}/element`,{path:t})}list(e,t){return this.client.rest.get(`${j}/${e}`,t)}create(e,t){return this.client.rest.post(`${j}/${e}/element`,JSON.stringify(t))}replace(e,t,s){return this.client.rest.put(`${j}/${e}/files?path=${t}`,s)}read(e,t){return this.client.rest.get(`${j}/${e}/files?path=${t}`)}upload(e,t,s=""){const i=new FormData;return i.set("path",s),i.set("file",t),this.client.rest.post(`${j}/${e}/files`,i)}delete(e,t){return this.client.rest.delete(`${j}/${e}/trash/element`,{path:t})}check(e){return this.client.rest.post(F,JSON.stringify(e))}}class W{constructor(e){this.client=e}settings(){return this.client.rest.get("/settings")}changeSettings(e){return this.client.rest.post("/settings",JSON.stringify(e))}queryInit(){return this.client.rest.get("/query/init")}}const M="/groups";class B{constructor(e){this.client=e}list(e){return this.client.rest.get(M,e)}listUsers(e){return this.client.rest.get(`${M}/${e}/users`)}create(e){return this.client.rest.post(M,JSON.stringify(e))}update(e,t){return this.client.rest.put(`${M}/${e}`,JSON.stringify(t))}delete(e){return this.client.rest.delete(`${M}/${e}`)}}const G="/license",H=`${G}/manual-check`,V=`${G}/hardware/hash`;class z{constructor(e){this.client=e}info(){return this.client.rest.get(G)}create(e){return this.client.rest.post(G,JSON.stringify(e))}check(){return this.client.rest.post(H)}delete(){return this.client.rest.delete(G)}getHash(){return this.client.rest.get(V)}}class K{constructor(e){this.client=e}getUsersLogs(e){return this.client.rest.get("/logs/users",e)}getSystemLogs(e){return this.client.rest.get(e)}}const X="/roles",Y=`${X}/default`;class Q{constructor(e){this.client=e}list(e){return this.client.rest.get(X,e)}get(e){return this.client.rest.get(`${X}/${e}`)}getDefault(){return this.client.rest.get(`${Y}`)}create(e){return this.client.rest.post(X,JSON.stringify(e))}update(e,t){return this.client.rest.put(`${X}/${e}`,JSON.stringify(t))}delete(e){return this.client.rest.delete(`${X}/${e}`)}permissions(){return this.client.rest.get("/permissions")}addPermissions(e,t){return this.client.rest.put(`${X}/${e}/permissions`,JSON.stringify({ids:t}))}deletePermissions(e,t){return this.client.rest.delete(`${X}/${e}/permissions`,{ids:t})}}const Z="/users",ee=`${Z}/me`,te=`${ee}/avatars`,se=`${ee}/sessions`,ie=`${ee}/tokens`,re=`${ee}/change-password`;class ne{constructor(e){this.client=e}list(e){return this.client.rest.get(Z,e)}get(e){return this.client.rest.get(Z+`/${e}`)}create(e){return this.client.rest.post(Z,JSON.stringify(e))}update(e,t){return this.client.rest.put(Z+`/${e}`,JSON.stringify(t))}delete(e,t){return this.client.rest.delete(`${Z}/${e}`,t)}restore(e){return this.client.rest.post(`${Z}/${e}/restore`)}me(){return this.client.rest.get(ee)}updateMe(e){return this.client.rest.put(ee,JSON.stringify(e))}createToken(e){return this.client.rest.post(ie,JSON.stringify(e))}listToken(e){return this.client.rest.get(ie,e)}deleteToken(e){return this.client.rest.delete(`${ie}/${e}`)}changeMyPassword(e){return this.client.rest.put(re,JSON.stringify(e))}changeUsersPassword(e,t){return this.client.rest.put(`${Z}/${e}/change-password`,JSON.stringify(t))}meUploadAvatar(e,t){const s=new FormData;return s.append("file",e,t),this.client.rest.post(te,s)}meDeleteAvatar(){return this.client.rest.delete(te)}meListSession(e){return this.client.rest.get(se,e)}meDeleteSession(e){let t=se;return e&&(t+=`/${e}`),this.client.rest.delete(t)}setRole(e,t=null){return this.client.rest.put(`${Z}/${e}/roles`,JSON.stringify({role_id:t}))}}class oe{constructor(e){this.client=e}info(e,t){const s=new URLSearchParams({path:e,share_token:t});return this.client.rest.get(`/share?${s.toString()}`)}checkPassword(e,t){const s=encodeURIComponent(e);return this.client.rest.get(`share/password?share_token=${t}&share_pass=${s}`)}checkToken(e){return this.client.rest.get(`share?share_token=${e}`)}restrictions(e){return this.client.rest.get("/share/restrictions",e)}restrictionsChange(e,t){return this.client.rest.put(`/share/restrictions/${e}`,JSON.stringify(t))}}const ce="/storage/element/share";class ae{constructor(e){this.client=e}info(e){return this.client.rest.get(ce,{path:e})}create(e,t){const s={path:e,permissions_type:t};return this.client.rest.post(ce,JSON.stringify(s))}change(e){return this.client.rest.put(`${ce}/${e.token}`,JSON.stringify(e))}delete(e){return this.client.rest.delete(ce,{path:e})}refresh(e){return this.client.rest.put(`${ce}/${e}/refresh`)}}const le="/storage",de=`${le}/element`,pe=`${de}/move`,he=`${de}/copy`,ue=`${de}/history`,ge=`${de}/version`,xe=`${ge}/current`;class ye{constructor(e){this.client=e}list(e){return this.client.rest.get(le,e)}info(e){var t;return parseInt((null===(t=e.divide_id)||void 0===t?void 0:t.toString())||"")||delete e.divide_id,e.file_version_id||delete e.file_version_id,this.client.rest.get(de,e)}size(e){var t;return parseInt((null===(t=e.divide_id)||void 0===t?void 0:t.toString())||"")||delete e.divide_id,this.client.rest.post(`${de}/size`,JSON.stringify(e))}move(e,t=!1){const{from_divide_id:s,to_divide_id:i}=e,r=Object.assign(Object.assign({},e),{from_divide_id:null,to_divide_id:null});return t?s?i?this.client.rest.post(`/disk/${s}/files/move/disk/${i}`,JSON.stringify(r)):this.client.rest.put(`/disk/${s}/files/to/box`,JSON.stringify(r)):this.client.rest.put(`/disk/${i}/files/from/box`,JSON.stringify(r)):this.client.rest.post(pe,JSON.stringify(e))}copy(e,t,s){const{from_divide_id:i,to_divide_id:r}=e;let n=Object.assign(Object.assign({},e),{from_divide_id:null,to_divide_id:null});return s===exports.StorageRoot.fca&&t===exports.StorageRoot.fca?this.client.rest.post(`/disk/${i}/files/copy/disk/${r}`,JSON.stringify(n)):s===exports.StorageRoot.fca?(i&&(n.from_divide_id=i),this.client.rest.post(`/disk/${r}/files/from/box`,JSON.stringify(n))):t===exports.StorageRoot.fca?(r&&(n.to_divide_id=r),this.client.rest.post(`/disk/${i}/files/to/box`,JSON.stringify(n))):this.client.rest.post(he,JSON.stringify(e))}pasteFromShared(e,t,s){const i={from_sharing_token:e,from_sharing_password:s,paths:t};return this.client.rest.post("/storage/element/copy",JSON.stringify(i))}create(e){return this.client.rest.post(de,JSON.stringify(e))}delete(e,t){const s={path:e};return t&&(s.divide_id=t),this.client.rest.delete(de,s)}favorite(e){return this.client.rest.put(`${de}?path=${encodeURIComponent(e)}`,JSON.stringify({is_favorite:!0}))}removeFavorite(e){return this.client.rest.put(`${de}?path=${encodeURIComponent(e)}`,JSON.stringify({is_favorite:!1}))}createItem(e){return this.client.rest.post(de,JSON.stringify(e))}createWorkDir(e){return this.client.rest.post(de,JSON.stringify(e))}history(e){return this.client.rest.get(ue,e)}versions(e){return this.client.rest.get(ge,e)}createVersion(e){return this.client.rest.post(ge,JSON.stringify(e))}editVersion(e){return this.client.rest.put(ge,JSON.stringify(e))}deleteVersion(e){return this.client.rest.delete(ge,e)}makeCurrentVersion(e){return this.client.rest.post(xe,JSON.stringify(e))}}const fe="/storage/trash",Se=`${fe}/element`,ve=`${Se}/all`;class _e{constructor(e){this.client=e}list(e){return this.client.rest.get(fe,e)}clear(e){return this.client.rest.delete(Se,e)}clearAll(){return this.client.rest.delete(ve)}restore(e){return this.client.rest.patch(Se,JSON.stringify({del_groups:e}))}}function $e(e,t,s,i){return new(s||(s=Promise))((function(r,n){function o(e){try{a(i.next(e))}catch(e){n(e)}}function c(e){try{a(i.throw(e))}catch(e){n(e)}}function a(e){var t;e.done?r(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,c)}a((i=i.apply(e,t||[])).next())}))}function me(e,t,s,i){return $e(this,void 0,void 0,(function*(){const r=Object.assign({},s.headers);s.query&&(s.path+="?"+Oe(s.query));const n=`${t.host}/api/v${t.version||1}${s.path}`;let o,c={method:e,headers:r,body:s.body,cache:s.cache};for(const e of i.request)try{c=yield e.fulfilled(c)}catch(t){if(!e.rejected)throw t;e.rejected(t)}try{o=yield fetch(n,c)}catch(e){for(const t of i.response){if(!t.rejected)throw e;try{yield t.rejected(e)}catch(e){throw e}}throw e}for(const e of i.response)try{o=yield e.fulfilled(o)}catch(t){if(!e.rejected)throw t;e.rejected(t)}return o}))}"function"==typeof SuppressedError&&SuppressedError;const Oe=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};class Ne{constructor(e){this.client=e}get state(){return this.client.state}get(e,t){return this.request("GET",e,{query:t})}post(e,t){return this.request("POST",e,{body:t})}put(e,t){return this.request("PUT",e,{body:t})}patch(e,t){return this.request("PATCH",e,{body:t})}delete(e,t){return this.request("DELETE",e,{query:t})}request(e,t,s={}){const{query:i,body:r,cache:n}=s;return me(e,this.state.clientParams,{path:t,query:Object.assign(Object.assign({},this.state.requestParams.query),i),body:r,headers:this.state.requestParams.headers,cache:n},{request:this.client.requestInterceptors,response:this.client.responseInterceptors})}}const we="/notifications",Ae=`${we}/all`,ke=`${we}/subscription`,Te=`${we}/permission`;class De{constructor(e){this.client=e}list(e){return this.client.rest.get(we,e)}toggleStatus(e,t){return this.client.rest.put(we,JSON.stringify({ids:e,to_status:t}))}toggleAllStatus(e){return this.client.rest.put(Ae,JSON.stringify({to_status:e}))}delete(e){return this.client.rest.delete(we,{id:e})}deleteAll(){return this.client.rest.delete(Ae)}getPermission(){return this.client.rest.get(Te)}setPermission(e){return this.client.rest.post(Te,JSON.stringify({enabled:e}))}getSubscription(){return this.client.rest.get(ke)}setSubscription(e){const t={action_groups:Object.assign({},e)};return this.client.rest.post(ke,JSON.stringify(t))}}const Ee="/storage/files",be=`${Ee}/net`;class Je{constructor(e){this.client=e}read(e,t){return t.path=e,this.client.rest.get(Ee,t)}replace(e,t){const s=new URLSearchParams;return Object.keys(e).forEach((t=>{e[t]&&s.append(t,e[t])})),this.client.rest.put(`${Ee}?${s.toString()}`,t)}upload(e,t,s){const i=new FormData;return i.set("path",t),i.set("file",e),s&&i.set("divide_id",s.toString()),this.client.rest.post(Ee,i)}uploadNet(e){return this.client.rest.post(be,JSON.stringify(e))}}exports.AuthApiService=i,exports.Client=class{constructor(e){this.rest=new Ne(this),this.AuthApi=new i(this),this.ConnectionsApi=new J(this),this.DiscoveryApi=new C(this),this.DivideApi=new R(this),this.ExtensionsApi=new U(this),this.ExtensionsExternalApi=new L(this),this.FcaApi=new I(this),this.GatewayApi=new W(this),this.GroupApi=new B(this),this.LicenseApi=new z(this),this.LogstashApi=new K(this),this.NotificationsApi=new De(this),this.RoleApi=new Q(this),this.ShareApi=new oe(this),this.StorageElementApi=new ye(this),this.StorageFilesApi=new Je(this),this.StorageShareApi=new ae(this),this.StorageTrashApi=new _e(this),this.UserApi=new ne(this),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:e,requestParams:{path:"",headers:{},query:{},body:null,cache:"no-cache"}}}resetParams(e){const{host:t,version:s}=e,{path:i,headers:r,query:n,body:o,cache:c}=e,{clientParams:a,requestParams:l}=this.state;this.state={clientParams:{host:t||a.host,version:null!=s?s:a.version},requestParams:{path:i||l.path,headers:r||l.headers,query:n||l.query,body:null!=o?o:l.body,cache:c||l.cache}}}},exports.ConnectionsApiService=J,exports.DiscoveryApiService=C,exports.DivideApiService=R,exports.ExtensionsApiService=U,exports.ExtensionsExternalApiService=L,exports.FcaApiService=I,exports.GatewayApiService=W,exports.GroupApiService=B,exports.LicenseApiService=z,exports.LogstashApiService=K,exports.Rest=Ne,exports.RoleApiService=Q,exports.ShareApiService=oe,exports.StorageElementApiService=ye,exports.StorageShareApiService=ae,exports.StorageTrashApiService=_e,exports.UserApiService=ne,exports.sendRequest=me;
@@ -0,0 +1 @@
1
+ const t="/login",e=`${t}/ldap`,s=`${t}/update`;class i{constructor(t){this.client=t}info(){return this.client.rest.get(t)}login(e){return this.client.rest.post(t,JSON.stringify(e))}ldapLogin(t){return this.client.rest.post(e,JSON.stringify(t))}updateToken(t){return this.client.rest.post(s,JSON.stringify(t))}logout(){return this.client.rest.post("/logout")}}var r,n,o,c,l,a,h,d,u,p,g,f,_,y,$,S,v,m,O,w,k,N,x,b,J,D;!function(t){t.DEFAULT="",t.ASC="asc",t.DESC="desc"}(r||(r={})),function(t){t.WebSocket="websocket",t.PostMessage="postmessage",t.Empty=""}(n||(n={})),function(t){t.my="my",t.fca="fca",t.divide="divide",t.share="share",t.favorite="favorite"}(o||(o={})),function(t){t.Storages="storages_connections_group",t.Webhooks="webhooks_connections_group",t.Unknown="unknown_connections_group",t.Proxy="proxy_connections_group"}(c||(c={})),function(t){t.SSH="ssh_connection",t.YandexDisk="yandex_disk",t.Mail="mail",t.Discord="discord",t.Webdav="webdav_connection",t.Nextcloud="nextcloud_connection",t.NextBox="nextbox_connection",t.HttpProxy="http_proxy_connection",t.S3="s3_connection"}(l||(l={})),function(t){t.App="app",t.File="file",t.WorkDir="work_dir"}(a||(a={})),function(t){t.Read="read",t.ReadAndWrite="read_and_write",t.Write="write"}(h||(h={})),function(t){t.Storage="/storage/element",t.Connection="/connections"}(d||(d={})),function(t){t.CLOSE="",t.READ="r",t.WRITE="rw"}(u||(u={})),function(t){t.WAITING="waiting",t.APPROVED="approved",t.REJECTED="rejected"}(p||(p={})),function(t){t.TRUE="true",t.FALSE="false"}(g||(g={})),function(t){t.User="to_user_id",t.Group="to_user_group_id"}(f||(f={})),function(t){t.Free="free",t.Business="business",t.Enterprise="enterprise"}(_||(_={})),function(t){t.NotActivated="License not activated",t.Blocked="License blocked",t.Expired="License has been expired",t.NotValid="License not valid",t.NotFound="license file not found"}(y||(y={})),function(t){t.Dir="dir",t.File="file",t.User="user",t.Other="other",t.WorkDir="work_dir",t.License="license",t.Extension="extension",t.Connection="connection"}($||($={})),function(t){t.OpenSharing="open_sharing",t.ChangeSharing="change_sharing",t.CancelSharing="cancel_sharing",t.DivideDirAddFileToOwner="divide_dir_add_file_to_owner",t.DivideDirAddDirToOwner="divide_dir_add_dir_to_owner",t.DivideDirAddWorkDirToOwner="divide_dir_add_work_dir_to_owner",t.DivideConnectionAddFileToOwner="divide_connection_add_file_to_owner",t.DivideConnectionAddDirToOwner="divide_connection_add_dir_to_owner",t.CancelDivideDir="cancel_divide_dir",t.CancelDivideFile="cancel_divide_file",t.CancelDivideWorkDir="cancel_divide_work_dir",t.CancelDivideConnection="cancel_divide_connection",t.DeleteExtension="delete_extension",t.NewVersionExtension="new_version_extension",t.Other="other"}(S||(S={})),function(t){t.Read="read",t.Unread="unread",t.Delete="delete"}(v||(v={})),function(t){t.Plain="plain",t.Success="success",t.Info="info",t.Warning="warning",t.Error="error"}(m||(m={})),function(t){t.NONE="none",t.SOFT="soft",t.HARD="hard"}(O||(O={})),function(t){t.Native="native",t.Ldap="ldap"}(w||(w={})),function(t){t.Registering="registering",t.Activated="activated",t.Blocked="blocked",t.BlockedByLicense="blocked_by_license"}(k||(k={})),function(t){t.User="user",t.Guest="guest",t.Emperor="emperor",t.Anonymous="anonymous"}(N||(N={})),function(t){t.Text="text",t.String="string",t.Number="number",t.CheckBox="checkbox",t.Select="select",t.RadioList="radio_list",t.ConnectionChoose="connection_choose",t.MultiConnectionChoose="multi_connection_choose"}(x||(x={})),function(t){t.Dir="dir",t.File="file",t.WorkDir="work_dir"}(b||(b={})),function(t){t.Any="any",t.Dir="dir",t.Code="code",t.Image="image",t.Audio="audio",t.Video="video",t.Text="text",t.Doc="doc",t.Xls="xls",t.Ppt="ppt"}(J||(J={})),function(t){t.Create="create",t.Update="update",t.Move="move"}(D||(D={}));const A="/connections",P=`${A}/dashboard`;class E{constructor(t){this.client=t}list(t){return this.client.rest.get(A,t)}get(t){return this.client.rest.get(`${A}/${t}`)}update(t,e){return this.client.rest.put(`${A}/${t}`,JSON.stringify(e))}delete(t){return this.client.rest.delete(`${A}/${t}`)}create(t){const e={[l.SSH]:"/disk/ssh",[l.Webdav]:"/disk/webdav",[l.Nextcloud]:"/disk/nextcloud",[l.NextBox]:"/disk/nextbox",[l.Discord]:"/webhooks/discord",[l.Mail]:"/webhooks/mail",[l.HttpProxy]:"/http_proxy",[l.S3]:"/disk/s3"};return this.client.rest.post(e[t.type]||A,JSON.stringify(t))}dashboard(t){return this.client.rest.get(P,t)}}class C{constructor(t){this.client=t}discovery(t){return this.client.rest.get("/discovery",t)}}class q{constructor(t){this.client=t}divideDelete(t,e){return this.client.rest.delete(`${t}/divide/${e}`)}divideDeleteAll(t,e,s,i){return this.client.rest.delete(`${t}/divide`,Object.assign(Object.assign({},this.makeParam(t,e)),{is_to_user_group:i,access_mode:s}))}divideChange(t,e,s){return this.client.rest.put(`${t}/divide/${e}`,JSON.stringify({access_mode:s}))}divideCreate(t,e,s,i,r){const n=Object.assign(Object.assign({},this.makeParam(t,e)),{[r]:s,access_mode:i});return this.client.rest.post(`${t}/divide`,JSON.stringify(n))}divideUsers(t,e,s){return this.client.rest.get(`${t}/divide/users`,Object.assign(Object.assign({},this.makeParam(t,e)),s))}restrictions(t){return this.client.rest.get("/divide/restrictions",t)}restrictionsChange(t,e){return this.client.rest.put(`/divide/restrictions/${t}`,JSON.stringify(e))}makeParam(t,e){const s={};return t===d.Connection?s.connection_id=e:s.path=e,s}}const j="/static/extensions",T="/extensions/defaults";class U{constructor(t){this.client=t}getSetting(t){return this.client.rest.get(`${j}/${t}/settings`)}setSetting(t,e){return this.client.rest.post(`${j}/${t}/settings`,JSON.stringify(e))}deleteSetting(t){return this.client.rest.delete(`${j}/${t}/settings`)}get(t){return this.client.rest.get(`${j}/${t}`)}getByKey(t){return this.client.rest.get(`${j}/${t}`)}getDefault(t=[]){return this.client.rest.get(T,{ext_code:t})}setDefault(t,e){return this.client.rest.post(T,JSON.stringify({ext_code:t,ext_uniq_key:e}))}checkUpdates(){return this.client.rest.post("/static/extensions/check_updates")}updateVersion(t,e){return this.client.rest.put(`/static/extensions/${t}`,JSON.stringify({version:e}))}list(t){return this.client.rest.get(j,t)}delete(t,e){return this.client.rest.delete(`${j}/${t}`)}upload(t){const e=new FormData;return e.set("file",t),this.client.rest.post(j,e)}install(t,e){return this.client.rest.post("/static/extensions/site",JSON.stringify({uniq_key:t,version:e}))}}class L{constructor(t){this.client=t}listExtensionsSite(t){return this.client.rest.get("/anons_ext/extensions",t)}extensionDetailSite(t){return this.client.rest.get(`/anons_ext/extensions/${t}`)}extensionMarkdown(t){return this.client.rest.get(`/anons_ext/extensions/${t}/readme`)}}const F="/disk",R=`${F}/check`;class I{constructor(t){this.client=t}info(t,e){return this.client.rest.get(`${F}/${t}/element`,{path:e})}list(t,e){return this.client.rest.get(`${F}/${t}`,e)}create(t,e){return this.client.rest.post(`${F}/${t}/element`,JSON.stringify(e))}replace(t,e,s){return this.client.rest.put(`${F}/${t}/files?path=${e}`,s)}read(t,e){return this.client.rest.get(`${F}/${t}/files?path=${e}`)}upload(t,e,s=""){const i=new FormData;return i.set("path",s),i.set("file",e),this.client.rest.post(`${F}/${t}/files`,i)}delete(t,e){return this.client.rest.delete(`${F}/${t}/trash/element`,{path:e})}check(t){return this.client.rest.post(R,JSON.stringify(t))}}class W{constructor(t){this.client=t}settings(){return this.client.rest.get("/settings")}changeSettings(t){return this.client.rest.post("/settings",JSON.stringify(t))}queryInit(){return this.client.rest.get("/query/init")}}const B="/groups";class V{constructor(t){this.client=t}list(t){return this.client.rest.get(B,t)}listUsers(t){return this.client.rest.get(`${B}/${t}/users`)}create(t){return this.client.rest.post(B,JSON.stringify(t))}update(t,e){return this.client.rest.put(`${B}/${t}`,JSON.stringify(e))}delete(t){return this.client.rest.delete(`${B}/${t}`)}}const M="/license",H=`${M}/manual-check`,G=`${M}/hardware/hash`;class z{constructor(t){this.client=t}info(){return this.client.rest.get(M)}create(t){return this.client.rest.post(M,JSON.stringify(t))}check(){return this.client.rest.post(H)}delete(){return this.client.rest.delete(M)}getHash(){return this.client.rest.get(G)}}class K{constructor(t){this.client=t}getUsersLogs(t){return this.client.rest.get("/logs/users",t)}getSystemLogs(t){return this.client.rest.get(t)}}const X="/roles",Y=`${X}/default`;class Q{constructor(t){this.client=t}list(t){return this.client.rest.get(X,t)}get(t){return this.client.rest.get(`${X}/${t}`)}getDefault(){return this.client.rest.get(`${Y}`)}create(t){return this.client.rest.post(X,JSON.stringify(t))}update(t,e){return this.client.rest.put(`${X}/${t}`,JSON.stringify(e))}delete(t){return this.client.rest.delete(`${X}/${t}`)}permissions(){return this.client.rest.get("/permissions")}addPermissions(t,e){return this.client.rest.put(`${X}/${t}/permissions`,JSON.stringify({ids:e}))}deletePermissions(t,e){return this.client.rest.delete(`${X}/${t}/permissions`,{ids:e})}}const Z="/users",tt=`${Z}/me`,et=`${tt}/avatars`,st=`${tt}/sessions`,it=`${tt}/tokens`,rt=`${tt}/change-password`;class nt{constructor(t){this.client=t}list(t){return this.client.rest.get(Z,t)}get(t){return this.client.rest.get(Z+`/${t}`)}create(t){return this.client.rest.post(Z,JSON.stringify(t))}update(t,e){return this.client.rest.put(Z+`/${t}`,JSON.stringify(e))}delete(t,e){return this.client.rest.delete(`${Z}/${t}`,e)}restore(t){return this.client.rest.post(`${Z}/${t}/restore`)}me(){return this.client.rest.get(tt)}updateMe(t){return this.client.rest.put(tt,JSON.stringify(t))}createToken(t){return this.client.rest.post(it,JSON.stringify(t))}listToken(t){return this.client.rest.get(it,t)}deleteToken(t){return this.client.rest.delete(`${it}/${t}`)}changeMyPassword(t){return this.client.rest.put(rt,JSON.stringify(t))}changeUsersPassword(t,e){return this.client.rest.put(`${Z}/${t}/change-password`,JSON.stringify(e))}meUploadAvatar(t,e){const s=new FormData;return s.append("file",t,e),this.client.rest.post(et,s)}meDeleteAvatar(){return this.client.rest.delete(et)}meListSession(t){return this.client.rest.get(st,t)}meDeleteSession(t){let e=st;return t&&(e+=`/${t}`),this.client.rest.delete(e)}setRole(t,e=null){return this.client.rest.put(`${Z}/${t}/roles`,JSON.stringify({role_id:e}))}}class ot{constructor(t){this.client=t}info(t,e){const s=new URLSearchParams({path:t,share_token:e});return this.client.rest.get(`/share?${s.toString()}`)}checkPassword(t,e){const s=encodeURIComponent(t);return this.client.rest.get(`share/password?share_token=${e}&share_pass=${s}`)}checkToken(t){return this.client.rest.get(`share?share_token=${t}`)}restrictions(t){return this.client.rest.get("/share/restrictions",t)}restrictionsChange(t,e){return this.client.rest.put(`/share/restrictions/${t}`,JSON.stringify(e))}}const ct="/storage/element/share";class lt{constructor(t){this.client=t}info(t){return this.client.rest.get(ct,{path:t})}create(t,e){const s={path:t,permissions_type:e};return this.client.rest.post(ct,JSON.stringify(s))}change(t){return this.client.rest.put(`${ct}/${t.token}`,JSON.stringify(t))}delete(t){return this.client.rest.delete(ct,{path:t})}refresh(t){return this.client.rest.put(`${ct}/${t}/refresh`)}}const at="/storage",ht=`${at}/element`,dt=`${ht}/move`,ut=`${ht}/copy`,pt=`${ht}/history`,gt=`${ht}/version`,ft=`${gt}/current`;class _t{constructor(t){this.client=t}list(t){return this.client.rest.get(at,t)}info(t){var e;return parseInt((null===(e=t.divide_id)||void 0===e?void 0:e.toString())||"")||delete t.divide_id,t.file_version_id||delete t.file_version_id,this.client.rest.get(ht,t)}size(t){var e;return parseInt((null===(e=t.divide_id)||void 0===e?void 0:e.toString())||"")||delete t.divide_id,this.client.rest.post(`${ht}/size`,JSON.stringify(t))}move(t,e=!1){const{from_divide_id:s,to_divide_id:i}=t,r=Object.assign(Object.assign({},t),{from_divide_id:null,to_divide_id:null});return e?s?i?this.client.rest.post(`/disk/${s}/files/move/disk/${i}`,JSON.stringify(r)):this.client.rest.put(`/disk/${s}/files/to/box`,JSON.stringify(r)):this.client.rest.put(`/disk/${i}/files/from/box`,JSON.stringify(r)):this.client.rest.post(dt,JSON.stringify(t))}copy(t,e,s){const{from_divide_id:i,to_divide_id:r}=t;let n=Object.assign(Object.assign({},t),{from_divide_id:null,to_divide_id:null});return s===o.fca&&e===o.fca?this.client.rest.post(`/disk/${i}/files/copy/disk/${r}`,JSON.stringify(n)):s===o.fca?(i&&(n.from_divide_id=i),this.client.rest.post(`/disk/${r}/files/from/box`,JSON.stringify(n))):e===o.fca?(r&&(n.to_divide_id=r),this.client.rest.post(`/disk/${i}/files/to/box`,JSON.stringify(n))):this.client.rest.post(ut,JSON.stringify(t))}pasteFromShared(t,e,s){const i={from_sharing_token:t,from_sharing_password:s,paths:e};return this.client.rest.post("/storage/element/copy",JSON.stringify(i))}create(t){return this.client.rest.post(ht,JSON.stringify(t))}delete(t,e){const s={path:t};return e&&(s.divide_id=e),this.client.rest.delete(ht,s)}favorite(t){return this.client.rest.put(`${ht}?path=${encodeURIComponent(t)}`,JSON.stringify({is_favorite:!0}))}removeFavorite(t){return this.client.rest.put(`${ht}?path=${encodeURIComponent(t)}`,JSON.stringify({is_favorite:!1}))}createItem(t){return this.client.rest.post(ht,JSON.stringify(t))}createWorkDir(t){return this.client.rest.post(ht,JSON.stringify(t))}history(t){return this.client.rest.get(pt,t)}versions(t){return this.client.rest.get(gt,t)}createVersion(t){return this.client.rest.post(gt,JSON.stringify(t))}editVersion(t){return this.client.rest.put(gt,JSON.stringify(t))}deleteVersion(t){return this.client.rest.delete(gt,t)}makeCurrentVersion(t){return this.client.rest.post(ft,JSON.stringify(t))}}const yt="/storage/trash",$t=`${yt}/element`,St=`${$t}/all`;class vt{constructor(t){this.client=t}list(t){return this.client.rest.get(yt,t)}clear(t){return this.client.rest.delete($t,t)}clearAll(){return this.client.rest.delete(St)}restore(t){return this.client.rest.patch($t,JSON.stringify({del_groups:t}))}}function mt(t,e,s,i){return new(s||(s=Promise))((function(r,n){function o(t){try{l(i.next(t))}catch(t){n(t)}}function c(t){try{l(i.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(o,c)}l((i=i.apply(t,e||[])).next())}))}function Ot(t,e,s,i){return mt(this,void 0,void 0,(function*(){const r=Object.assign({},s.headers);s.query&&(s.path+="?"+wt(s.query));const n=`${e.host}/api/v${e.version||1}${s.path}`;let o,c={method:t,headers:r,body:s.body,cache:s.cache};for(const t of i.request)try{c=yield t.fulfilled(c)}catch(e){if(!t.rejected)throw e;t.rejected(e)}try{o=yield fetch(n,c)}catch(t){for(const e of i.response){if(!e.rejected)throw t;try{yield e.rejected(t)}catch(t){throw t}}throw t}for(const t of i.response)try{o=yield t.fulfilled(o)}catch(e){if(!t.rejected)throw e;t.rejected(e)}return o}))}"function"==typeof SuppressedError&&SuppressedError;const wt=t=>{const e=new URLSearchParams;return Object.keys(t).forEach((s=>{Array.isArray(t[s])?t[s].forEach((t=>{e.append(s,t)})):e.append(s,t[s])})),e};class kt{constructor(t){this.client=t}get state(){return this.client.state}get(t,e){return this.request("GET",t,{query:e})}post(t,e){return this.request("POST",t,{body:e})}put(t,e){return this.request("PUT",t,{body:e})}patch(t,e){return this.request("PATCH",t,{body:e})}delete(t,e){return this.request("DELETE",t,{query:e})}request(t,e,s={}){const{query:i,body:r,cache:n}=s;return Ot(t,this.state.clientParams,{path:e,query:Object.assign(Object.assign({},this.state.requestParams.query),i),body:r,headers:this.state.requestParams.headers,cache:n},{request:this.client.requestInterceptors,response:this.client.responseInterceptors})}}const Nt="/notifications",xt=`${Nt}/all`,bt=`${Nt}/subscription`,Jt=`${Nt}/permission`;class Dt{constructor(t){this.client=t}list(t){return this.client.rest.get(Nt,t)}toggleStatus(t,e){return this.client.rest.put(Nt,JSON.stringify({ids:t,to_status:e}))}toggleAllStatus(t){return this.client.rest.put(xt,JSON.stringify({to_status:t}))}delete(t){return this.client.rest.delete(Nt,{id:t})}deleteAll(){return this.client.rest.delete(xt)}getPermission(){return this.client.rest.get(Jt)}setPermission(t){return this.client.rest.post(Jt,JSON.stringify({enabled:t}))}getSubscription(){return this.client.rest.get(bt)}setSubscription(t){const e={action_groups:Object.assign({},t)};return this.client.rest.post(bt,JSON.stringify(e))}}const At="/storage/files",Pt=`${At}/net`;class Et{constructor(t){this.client=t}read(t,e){return e.path=t,this.client.rest.get(At,e)}replace(t,e){const s=new URLSearchParams;return Object.keys(t).forEach((e=>{t[e]&&s.append(e,t[e])})),this.client.rest.put(`${At}?${s.toString()}`,e)}upload(t,e,s){const i=new FormData;return i.set("path",e),i.set("file",t),s&&i.set("divide_id",s.toString()),this.client.rest.post(At,i)}uploadNet(t){return this.client.rest.post(Pt,JSON.stringify(t))}}class Ct{constructor(t){this.rest=new kt(this),this.AuthApi=new i(this),this.ConnectionsApi=new E(this),this.DiscoveryApi=new C(this),this.DivideApi=new q(this),this.ExtensionsApi=new U(this),this.ExtensionsExternalApi=new L(this),this.FcaApi=new I(this),this.GatewayApi=new W(this),this.GroupApi=new V(this),this.LicenseApi=new z(this),this.LogstashApi=new K(this),this.NotificationsApi=new Dt(this),this.RoleApi=new Q(this),this.ShareApi=new ot(this),this.StorageElementApi=new _t(this),this.StorageFilesApi=new Et(this),this.StorageShareApi=new lt(this),this.StorageTrashApi=new vt(this),this.UserApi=new nt(this),this.requestInterceptors=[],this.responseInterceptors=[],this.request={use:(t,e)=>{this.requestInterceptors.push({fulfilled:t,rejected:e})}},this.response={use:(t,e)=>{this.responseInterceptors.push({fulfilled:t,rejected:e})}},this.state={clientParams:t,requestParams:{path:"",headers:{},query:{},body:null,cache:"no-cache"}}}resetParams(t){const{host:e,version:s}=t,{path:i,headers:r,query:n,body:o,cache:c}=t,{clientParams:l,requestParams:a}=this.state;this.state={clientParams:{host:e||l.host,version:null!=s?s:l.version},requestParams:{path:i||a.path,headers:r||a.headers,query:n||a.query,body:null!=o?o:a.body,cache:c||a.cache}}}}export{i as AuthApiService,Ct as Client,c as ConnectionGroup,l as ConnectionType,E as ConnectionsApiService,C as DiscoveryApiService,q as DivideApiService,f as DivideMode,d as DivideScope,n as EngineType,h as ExtensionFileMode,a as ExtensionType,U as ExtensionsApiService,L as ExtensionsExternalApiService,I as FcaApiService,W as GatewayApiService,V as GroupApiService,z as LicenseApiService,y as LicenseError,K as LogstashApiService,S as NotificationAction,$ as NotificationEntityType,v as NotificationRowAction,m as NotificationStyle,r as OrderDirection,u as PermissionType,kt as Rest,g as RestrictionBooleanStatus,O as RestrictionSharing,p as RestrictionStatus,Q as RoleApiService,x as SettingControlType,ot as ShareApiService,_t as StorageElementApiService,J as StorageElementContentType,D as StorageElementHistoryAction,b as StorageElementType,o as StorageRoot,lt as StorageShareApiService,vt as StorageTrashApiService,_ as Tariff,nt as UserApiService,w as UserAuthType,k as UserStatus,N as UserType,Ot as sendRequest};
@@ -0,0 +1,39 @@
1
+ import { AuthApiService, ConnectionsApiService, DiscoveryApiService, DivideApiService, ExtensionsApiService, ExtensionsExternalApiService, FcaApiService, GatewayApiService, GroupApiService, LicenseApiService, LogstashApiService, RoleApiService, ShareApiService, StorageElementApiService, StorageShareApiService, StorageTrashApiService, UserApiService } from '../api';
2
+ import { NotificationsApiService } from '../api/notifications-api.service';
3
+ import { StorageFilesApiService } from '../api/storage-files-api.service';
4
+ import { NbAppState, NbClientParams, NbRequestParams } from '../types/base';
5
+ import { Interceptor } from '../types/interceptor';
6
+ import { Rest } from './rest';
7
+ export declare class Client {
8
+ state: NbAppState;
9
+ rest: Rest;
10
+ AuthApi: AuthApiService;
11
+ ConnectionsApi: ConnectionsApiService;
12
+ DiscoveryApi: DiscoveryApiService;
13
+ DivideApi: DivideApiService;
14
+ ExtensionsApi: ExtensionsApiService;
15
+ ExtensionsExternalApi: ExtensionsExternalApiService;
16
+ FcaApi: FcaApiService;
17
+ GatewayApi: GatewayApiService;
18
+ GroupApi: GroupApiService;
19
+ LicenseApi: LicenseApiService;
20
+ LogstashApi: LogstashApiService;
21
+ NotificationsApi: NotificationsApiService;
22
+ RoleApi: RoleApiService;
23
+ ShareApi: ShareApiService;
24
+ StorageElementApi: StorageElementApiService;
25
+ StorageFilesApi: StorageFilesApiService;
26
+ StorageShareApi: StorageShareApiService;
27
+ StorageTrashApi: StorageTrashApiService;
28
+ UserApi: UserApiService;
29
+ requestInterceptors: Interceptor<RequestInit>[];
30
+ responseInterceptors: Interceptor<Response>[];
31
+ constructor(clientParams: NbClientParams);
32
+ request: {
33
+ use: (fulfilled: (config: RequestInit) => RequestInit | Promise<RequestInit>, rejected: (error: any) => any) => void;
34
+ };
35
+ response: {
36
+ use: (fulfilled: (response: Response) => Response | Promise<Response>, rejected: (error: any) => any) => void;
37
+ };
38
+ resetParams(params: Partial<NbClientParams & NbRequestParams>): void;
39
+ }
@@ -0,0 +1,2 @@
1
+ export * from './rest';
2
+ export * from './client';
@@ -0,0 +1,13 @@
1
+ import { Client } from './client';
2
+ import { NbAppState } from '../types';
3
+ export declare class Rest {
4
+ private client;
5
+ constructor(client: Client);
6
+ get state(): NbAppState;
7
+ get(path: string, query?: Record<string, any>): Promise<any>;
8
+ post(path: string, body?: BodyInit | null): Promise<any>;
9
+ put(path: string, body?: BodyInit | null): Promise<any>;
10
+ patch(path: string, body?: BodyInit | null): Promise<any>;
11
+ delete(path: string, query?: Record<string, any>): Promise<any>;
12
+ private request;
13
+ }
@@ -0,0 +1 @@
1
+ export * from './send-request';
@@ -0,0 +1,6 @@
1
+ import { NbClientParams, NbRequestParams } from '../types/base';
2
+ import { Interceptor } from '../types/interceptor';
3
+ export declare function sendRequest(method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE', params: NbClientParams, options: NbRequestParams, interceptors: {
4
+ request: Interceptor<RequestInit>[];
5
+ response: Interceptor<Response>[];
6
+ }): Promise<Response>;