nb-js-client 1.0.16 → 1.0.17
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/notifications-api.service.d.ts +17 -0
- package/dist/api/storage-element-api.service.d.ts +1 -1
- package/dist/classes/http-error-response.d.ts +17 -0
- package/dist/classes/http-event.d.ts +24 -0
- package/dist/classes/http-response.d.ts +14 -0
- package/dist/classes/tokenUpdate.d.ts +12 -0
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/send-request.d.ts +10 -0
- package/dist/index.d.ts +3 -2
- package/dist/types/archive.d.ts +4 -2
- package/dist/types/group.d.ts +23 -0
- package/dist/types/query-init.d.ts +23 -0
- package/dist/types/role.d.ts +17 -0
- package/package.json +1 -1
|
@@ -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
|
+
}
|
|
@@ -17,7 +17,7 @@ export declare class StorageElementApiService {
|
|
|
17
17
|
combineInfo({ root, rootId, path, file_version_id, zip_entry_path, }: StorageRouteData): Promise<StorageElement>;
|
|
18
18
|
size(data: StorageItemSizeParams): Promise<number>;
|
|
19
19
|
move(params: StorageElementPasteParams, to: StorageRoot, from: StorageRoot): Promise<void>;
|
|
20
|
-
copy(params: StorageElementPasteParams, from: StorageRoot, to: StorageRoot): Promise<
|
|
20
|
+
copy(params: StorageElementPasteParams, from: StorageRoot, to: StorageRoot): Promise<void>;
|
|
21
21
|
pasteFromShared(from_sharing_token: string, paths: StorageElementPaste[], from_sharing_password?: string): Promise<void>;
|
|
22
22
|
create(data: CreateStorageElementParams): Promise<ResponseItem<StorageElement>>;
|
|
23
23
|
delete(path: string, divide_id?: number): Promise<void>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare class HttpErrorResponse implements Error {
|
|
2
|
+
readonly name: string;
|
|
3
|
+
readonly message: string;
|
|
4
|
+
readonly error: any | null;
|
|
5
|
+
readonly status: number;
|
|
6
|
+
readonly statusText: string;
|
|
7
|
+
readonly headers: Headers | undefined;
|
|
8
|
+
readonly url: string | undefined;
|
|
9
|
+
readonly ok: boolean;
|
|
10
|
+
constructor(init: {
|
|
11
|
+
error?: any;
|
|
12
|
+
status?: number;
|
|
13
|
+
statusText?: string;
|
|
14
|
+
headers?: Headers;
|
|
15
|
+
url?: string;
|
|
16
|
+
});
|
|
17
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare enum HttpEventType {
|
|
2
|
+
Sent = 0,
|
|
3
|
+
UploadProgress = 1,
|
|
4
|
+
ResponseHeader = 2,
|
|
5
|
+
DownloadProgress = 3,
|
|
6
|
+
Response = 4,
|
|
7
|
+
User = 5
|
|
8
|
+
}
|
|
9
|
+
export declare type HttpEvent<T> = HttpResponse<T> | HttpProgressEvent;
|
|
10
|
+
export declare class HttpResponse<T> {
|
|
11
|
+
body: T | null;
|
|
12
|
+
status: number;
|
|
13
|
+
statusText: string;
|
|
14
|
+
headers: Headers;
|
|
15
|
+
url?: string | undefined;
|
|
16
|
+
readonly type: HttpEventType;
|
|
17
|
+
constructor(body: T | null, status: number, statusText: string, headers: Headers, url?: string | undefined);
|
|
18
|
+
}
|
|
19
|
+
export declare class HttpProgressEvent {
|
|
20
|
+
progress: number;
|
|
21
|
+
headers: Headers;
|
|
22
|
+
readonly type: HttpEventType;
|
|
23
|
+
constructor(progress: number, headers: Headers, isUpload?: boolean);
|
|
24
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare class HttpResponse<T> {
|
|
2
|
+
body: T | null;
|
|
3
|
+
status: number;
|
|
4
|
+
statusText: string;
|
|
5
|
+
headers: Headers;
|
|
6
|
+
url: string;
|
|
7
|
+
constructor(init: {
|
|
8
|
+
body?: T | null;
|
|
9
|
+
status: number;
|
|
10
|
+
statusText: string;
|
|
11
|
+
headers: Headers;
|
|
12
|
+
url: string;
|
|
13
|
+
});
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AuthApiService } from '../api';
|
|
2
|
+
import { AuthToken } from '../types';
|
|
3
|
+
export declare class TokenUpdate {
|
|
4
|
+
private authApiService;
|
|
5
|
+
private isUpdating;
|
|
6
|
+
private tokenUpdatePromise;
|
|
7
|
+
private tokenUpdateResolve;
|
|
8
|
+
constructor(authApiService: AuthApiService);
|
|
9
|
+
isTokenExpire(timestamp: number): boolean;
|
|
10
|
+
refreshToken(authToken: AuthToken): Promise<AuthToken | null>;
|
|
11
|
+
private waitForTokenUpdate;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './send-request';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NbAppState } from '../types/base';
|
|
2
|
+
import { Interceptor } from '../types/interceptor';
|
|
3
|
+
export declare function sendRequest(method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE', path: string, options: {
|
|
4
|
+
query?: Record<string, any>;
|
|
5
|
+
body?: BodyInit | null;
|
|
6
|
+
cache?: RequestCache;
|
|
7
|
+
}, state: NbAppState, interceptors: {
|
|
8
|
+
request: Interceptor<RequestInit>[];
|
|
9
|
+
response: Interceptor<Response>[];
|
|
10
|
+
}): Promise<Response>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1210,7 +1210,7 @@ declare class StorageElementApiService {
|
|
|
1210
1210
|
combineInfo({ root, rootId, path, file_version_id, zip_entry_path, }: StorageRouteData): Promise<StorageElement>;
|
|
1211
1211
|
size(data: StorageItemSizeParams): Promise<number>;
|
|
1212
1212
|
move(params: StorageElementPasteParams, to: StorageRoot, from: StorageRoot): Promise<void>;
|
|
1213
|
-
copy(params: StorageElementPasteParams, from: StorageRoot, to: StorageRoot): Promise<
|
|
1213
|
+
copy(params: StorageElementPasteParams, from: StorageRoot, to: StorageRoot): Promise<void>;
|
|
1214
1214
|
pasteFromShared(from_sharing_token: string, paths: StorageElementPaste[], from_sharing_password?: string): Promise<void>;
|
|
1215
1215
|
create(data: CreateStorageElementParams): Promise<ResponseItem<StorageElement>>;
|
|
1216
1216
|
delete(path: string, divide_id?: number): Promise<void>;
|
|
@@ -1664,4 +1664,5 @@ declare function normalizeHeaders(headers: Headers | [string, string][] | Record
|
|
|
1664
1664
|
|
|
1665
1665
|
declare function prepareRequestBody(body: unknown): XMLHttpRequestBodyInit | Document | null;
|
|
1666
1666
|
|
|
1667
|
-
export { AccessRights,
|
|
1667
|
+
export { AccessRights, AuthApiService, BASE_URL_V1, BASE_URL_V2, CONNECTIONS_PERMISSION, Client, ConnectionGroup, ConnectionType, ConnectionsApiService, DiscoveryApiService, DivideApiService, DivideMode, DivideScope, EngineType, ExtensionFileMode, ExtensionType, ExtensionsApiService, ExtensionsExternalApiService, FcaApiService, GatewayApiService, GroupApiService, LicenseApiService, LicenseError, LimitationSubType, LimitationType, LimitationsApiService, LinksApiService, LogstashApiService, NEED_TOKEN_UPDATE_ERROR, NotificationAction, NotificationApiService, NotificationEntityType, NotificationRowAction, NotificationStyle, OrderDirection, PermissionType, QueryInitViewType, RequestMethod, RequestObserve, ResponseType, Rest, RestrictionBooleanStatus, RestrictionModeKey, RestrictionSharing, RestrictionStatus, RoleApiService, SettingControlType, ShareApiService, StorageCommentApiService, StorageElementApiService, StorageElementCheckStatus, StorageElementContentType, StorageElementHistoryAction, StorageElementType, StorageFilesApiService, StorageInstanceApiService, StorageRoot, StorageShareApiService, StorageTrashApiService, Tariff, TokenUpdate, UserApiService, UserAppType, UserAuthType, UserParamsLabel, UserStatus, UserType, VersionApiService, applyInterceptors, getCookieValue, makeUrlParams, normalizeHeaders, prepareRequestBody };
|
|
1668
|
+
export type { AccessToken, AuthToken, AuthTokenUpdate, AuthType, ChangeLicenseParams, Comment, CommentParams, Connection, ConnectionCreateParams, CopyResponse, CreateCommentParams, CreateLimitationsParams, CreateStorageElementParams, CreateUserGroupParams, CreateUserParams, CreateUserRoleParams, CreateZipRequestParams, CutLinkRequest, DeleteAllCommentParams, DeleteCommentParams, Discovery, DivideResourceParams, DivideResourceType, DivideResponseList, Extension, ExtensionDefault, ExtensionExternal, ExtensionExternalInList, ExtensionExternalListParams, ExtensionExternalReadmeParams, ExtensionListParams, ExtensionMetaPayload, ExtensionTag, ExtensionTagListParams, FileLocking, HistoryListRequestParams, HistoryNote, HistoryRequestParams, HttpEvent, HttpResponse, Lang, License, Limitation, LockScreen, NameExtensionListParams, NbAppState, NbClientParams, NbRequestParams, NotificationActionGroup, NotificationPayload, OnUploadProgress, PayloadArchive, PayloadFile, Permission, PermissionItem, ProgressEvent, QueryInitResponse, Quota, RequestAuthSettingsParams, RequestAuthTfaParams, RequestAuthTokenParams, RequestBaseParams, RequestConfig, RequestConnectionParams, RequestLimitationsListParams, RequestNotificationListParams, RequestShareLoginParams, RequestStorageListParams, RequestUserDivideParams, RequestUserGroupListParams, RequestUserListParams, RequestUserRoleListParams, RequestUsersLogParams, RequestVersionsSizeParams, ResourceAccess, ResponseItem, ResponseList, ResponseListNotification, Restriction, Setting, SettingField, SettingFieldView, SettingLang, SettingValue, SettingValueField, SettingVariant, SettingViewConnectionChoose, SettingViewSelect, ShareInfo, ShareModel, SizeBySection, StorageDivideElement, StorageElement, StorageElementFileInfo, StorageElementHistory, StorageElementPaste, StorageElementPasteParams, StorageElementVersion, StorageElementVersionLock, StorageInstance, StorageItemSizeParams, StorageItemSizePathParams, StorageRouteData, StorageSharingElement, StorageTrashElement, StorageTrashItem, UnZipRequestParams, UnionRestriction, UpdateCommentParams, UploadNetRequestParams, User, UserAppPasswordInfo, UserAppPasswords, UserDivide, UserGroup, UserInfo, UserLabel, UserNamesExtension, UserNotification, UserParams, UserPhone, UserRole, UserSession, UserToken, UsersLog, VersionLockRequestParams };
|
package/dist/types/archive.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NotificationAction } from
|
|
1
|
+
import { NotificationAction } from './notification';
|
|
2
2
|
export interface ArchiveProcess<T extends ArchivePayload | ArchiveEndPayload> {
|
|
3
3
|
create_date: string;
|
|
4
4
|
entity_type: string;
|
|
@@ -16,7 +16,7 @@ export interface ArchiveProcess<T extends ArchivePayload | ArchiveEndPayload> {
|
|
|
16
16
|
}
|
|
17
17
|
export interface ArchivePayload {
|
|
18
18
|
process_id: string;
|
|
19
|
-
src_path: string;
|
|
19
|
+
src_path: string[];
|
|
20
20
|
zip_name: string;
|
|
21
21
|
current_file: string;
|
|
22
22
|
sum_size: number;
|
|
@@ -25,6 +25,8 @@ export interface ArchivePayload {
|
|
|
25
25
|
speed: number;
|
|
26
26
|
seconds_left: number;
|
|
27
27
|
dst_path?: string;
|
|
28
|
+
divide_id?: number;
|
|
29
|
+
dst_divide_id?: number;
|
|
28
30
|
}
|
|
29
31
|
export interface ArchiveEndPayload {
|
|
30
32
|
process_id: string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { RequestBaseParams } from './base';
|
|
2
|
+
import { UserLabel } from './user';
|
|
3
|
+
export interface Group {
|
|
4
|
+
id: number;
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
amount_users: number;
|
|
8
|
+
create_date: string;
|
|
9
|
+
owner_id: number;
|
|
10
|
+
owner: UserLabel;
|
|
11
|
+
update_date: string;
|
|
12
|
+
icon: string;
|
|
13
|
+
icon_color: string;
|
|
14
|
+
}
|
|
15
|
+
export interface RequestGroupListParams extends RequestBaseParams {
|
|
16
|
+
id?: number[];
|
|
17
|
+
name?: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
search_field?: string;
|
|
20
|
+
}
|
|
21
|
+
export type CreateGroupParams = Pick<Group, 'name' | 'description'> & {
|
|
22
|
+
users?: number[];
|
|
23
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ResponseList } from './base';
|
|
2
|
+
import { Extension, ExtensionDefault } from './extension';
|
|
3
|
+
import { License } from './license';
|
|
4
|
+
import { LockScreen } from './lock-screen';
|
|
5
|
+
import { UserNotification } from './notification';
|
|
6
|
+
import { Restriction } from './restriction';
|
|
7
|
+
import { User } from './user';
|
|
8
|
+
export interface QueryInit {
|
|
9
|
+
license?: License;
|
|
10
|
+
unread_notifications?: ResponseList<UserNotification> & {
|
|
11
|
+
total_all: number;
|
|
12
|
+
};
|
|
13
|
+
extensions_apps?: ResponseList<Extension>;
|
|
14
|
+
extensions_defaults: ResponseList<ExtensionDefault>;
|
|
15
|
+
me?: User;
|
|
16
|
+
cache_users: User[];
|
|
17
|
+
lock_screen: LockScreen;
|
|
18
|
+
restrictions?: Restriction;
|
|
19
|
+
open_in_desktop_settings: {
|
|
20
|
+
open_in_desktop_enabled: boolean;
|
|
21
|
+
};
|
|
22
|
+
inject_scripts?: string[];
|
|
23
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RequestBaseParams } from './base';
|
|
2
|
+
export interface Role {
|
|
3
|
+
id: number;
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
create_date: string;
|
|
7
|
+
update_date: string;
|
|
8
|
+
is_default: boolean;
|
|
9
|
+
owner_id: number;
|
|
10
|
+
grant_access_all: boolean;
|
|
11
|
+
permissions_id?: number[];
|
|
12
|
+
}
|
|
13
|
+
export interface RequestRoleListParams extends RequestBaseParams {
|
|
14
|
+
id?: number[];
|
|
15
|
+
search_field?: string;
|
|
16
|
+
}
|
|
17
|
+
export type CreateRoleParams = Pick<Role, 'name' | 'description' | 'grant_access_all' | 'is_default'>;
|