@secrecy/lib 1.0.0-dev.2 → 1.0.0-dev.20
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/README.md +1 -0
- package/lib/BaseClient.d.ts +3 -0
- package/lib/BaseClient.js +132 -88
- package/lib/PopupTools.d.ts +1 -1
- package/lib/PopupTools.js +3 -3
- package/lib/ZeusThunder.js +2 -2
- package/lib/client/admin/index.d.ts +10 -0
- package/lib/client/admin/index.js +152 -0
- package/lib/client/convert/file.js +2 -2
- package/lib/client/convert/folder.d.ts +0 -1
- package/lib/client/convert/folder.js +60 -97
- package/lib/client/convert/vFile.js +2 -2
- package/lib/client/index.d.ts +19 -12
- package/lib/client/index.js +862 -699
- package/lib/client/types/File.js +1 -0
- package/lib/client/types/FilesOnUsersOnApplications.js +1 -0
- package/lib/client/types/Inputs.js +1 -0
- package/lib/client/types/UserAppNotifications.d.ts +6 -0
- package/lib/client/types/UserAppNotifications.js +3 -0
- package/lib/client/types/UserAppSettings.js +1 -0
- package/lib/client/types/index.d.ts +1 -0
- package/lib/client/types/index.js +3 -1
- package/lib/client/types/queries.js +2 -2
- package/lib/index.d.ts +2 -1
- package/lib/index.js +2 -1
- package/lib/worker/__mock__/sodium.worker.js +1 -12
- package/lib/worker/sodium.d.ts +2 -2
- package/lib/worker/sodium.js +19 -5
- package/lib/zeus/const.js +720 -648
- package/lib/zeus/index.d.ts +1330 -31075
- package/lib/zeus/index.js +92 -56
- package/package.json +34 -31
package/lib/client/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import type { MailType } from "./../zeus/index";
|
|
1
2
|
import type { DownloadProgress } from "ky";
|
|
2
|
-
import type { CancelToken } from "axios";
|
|
3
3
|
import { BaseClient } from "../BaseClient.js";
|
|
4
4
|
import type { Progress } from "../crypto/file.js";
|
|
5
|
-
import type { ReceivedMail, SentMail, Folder, VFileWithFolder, FolderFull, UserAppSettings, File as SecrecyFile, WaitingReceivedMail, DraftMail, VFile, Mail } from "./types/index.js";
|
|
5
|
+
import type { ReceivedMail, SentMail, Folder, VFileWithFolder, FolderFull, UserAppSettings, UserAppNotifications, File as SecrecyFile, WaitingReceivedMail, DraftMail, VFile, Mail } from "./types/index.js";
|
|
6
6
|
import type { KeyPair } from "../crypto/index.js";
|
|
7
7
|
import type { SecrecyEnv } from "./helpers.js";
|
|
8
8
|
import type { Rights } from "../zeus/index.js";
|
|
@@ -21,23 +21,24 @@ export declare class SecrecyClient extends BaseClient {
|
|
|
21
21
|
#private;
|
|
22
22
|
jwt: string;
|
|
23
23
|
constructor(uaSession: string, uaKeys: KeyPair, uaJwt: string, env: SecrecyEnv);
|
|
24
|
+
get publicKey(): string;
|
|
24
25
|
addFileToHistory({ fileId, vFileId }: {
|
|
25
26
|
fileId: string;
|
|
26
27
|
vFileId: string;
|
|
27
28
|
}): Promise<VFile>;
|
|
28
|
-
uploadFile({ file, encryptProgress, uploadProgress,
|
|
29
|
+
uploadFile({ file, encryptProgress, uploadProgress, signal }: {
|
|
29
30
|
file: globalThis.File | Uint8Array;
|
|
30
|
-
cancelToken?: CancelToken;
|
|
31
31
|
encryptProgress?: ProgressCallback;
|
|
32
32
|
uploadProgress?: ProgressCallback;
|
|
33
|
+
signal?: AbortSignal;
|
|
33
34
|
}): Promise<string | null>;
|
|
34
|
-
uploadFileInCloud({ file, name, folderId,
|
|
35
|
+
uploadFileInCloud({ file, name, folderId, encryptProgress, uploadProgress, signal }: {
|
|
35
36
|
file: globalThis.File | Uint8Array;
|
|
36
37
|
name: string;
|
|
37
|
-
cancelToken?: CancelToken;
|
|
38
38
|
folderId?: string;
|
|
39
39
|
encryptProgress?: ProgressCallback;
|
|
40
40
|
uploadProgress?: ProgressCallback;
|
|
41
|
+
signal?: AbortSignal;
|
|
41
42
|
}): Promise<VFileWithFolder>;
|
|
42
43
|
logout(sessionId?: string | null | undefined): Promise<void>;
|
|
43
44
|
createFolder({ name, parentFolderId }: {
|
|
@@ -68,6 +69,9 @@ export declare class SecrecyClient extends BaseClient {
|
|
|
68
69
|
sharedFolders(): Promise<Folder[]>;
|
|
69
70
|
foldersSharedWithMe(): Promise<Folder[]>;
|
|
70
71
|
deletedFolders(): Promise<Folder[]>;
|
|
72
|
+
deletedMails({ mailType }: {
|
|
73
|
+
mailType: MailType;
|
|
74
|
+
}): Promise<Mail[]>;
|
|
71
75
|
shareFolder({ folderId, userId, rights }: {
|
|
72
76
|
folderId: string;
|
|
73
77
|
userId: string;
|
|
@@ -79,6 +83,8 @@ export declare class SecrecyClient extends BaseClient {
|
|
|
79
83
|
isFavorite?: boolean | null | undefined;
|
|
80
84
|
deletedAt?: Date | null | undefined;
|
|
81
85
|
}): Promise<FolderFull>;
|
|
86
|
+
updateAppNotifications(notifications: Partial<UserAppNotifications>): Promise<UserAppNotifications | null>;
|
|
87
|
+
appNotifications(): Promise<UserAppNotifications | null>;
|
|
82
88
|
createMail(data: NewMail, customMessage?: string | null | undefined): Promise<boolean>;
|
|
83
89
|
waitingReceivedMails(): Promise<WaitingReceivedMail[]>;
|
|
84
90
|
updateDraftMail(draftId: string, { body, subject, files, recipientsIds, replyTo }: Partial<NewMail>): Promise<DraftMail | null>;
|
|
@@ -91,8 +97,8 @@ export declare class SecrecyClient extends BaseClient {
|
|
|
91
97
|
folderId: string;
|
|
92
98
|
userId: string;
|
|
93
99
|
}): Promise<boolean>;
|
|
94
|
-
duplicateVFile({
|
|
95
|
-
|
|
100
|
+
duplicateVFile({ vFileId, folderId, customName }: {
|
|
101
|
+
vFileId: string;
|
|
96
102
|
folderId?: string | null | undefined;
|
|
97
103
|
customName?: string | null | undefined;
|
|
98
104
|
}): Promise<boolean>;
|
|
@@ -107,8 +113,8 @@ export declare class SecrecyClient extends BaseClient {
|
|
|
107
113
|
}): Promise<boolean>;
|
|
108
114
|
emptyMailTrash(): Promise<boolean>;
|
|
109
115
|
emptyCloudTrash(): Promise<boolean>;
|
|
110
|
-
|
|
111
|
-
|
|
116
|
+
recoverVFile({ vFileId }: {
|
|
117
|
+
vFileId: string;
|
|
112
118
|
}): Promise<boolean>;
|
|
113
119
|
recoverFolder({ id }: {
|
|
114
120
|
id: string;
|
|
@@ -134,11 +140,11 @@ export declare class SecrecyClient extends BaseClient {
|
|
|
134
140
|
sendDraftMail(draftId: string, customMessage?: string | null | undefined): Promise<boolean>;
|
|
135
141
|
sendWaitingEmails(): Promise<boolean>;
|
|
136
142
|
createDraftMail({ body, subject, files, recipientsIds, replyTo }: NewMail): Promise<DraftMail | null>;
|
|
137
|
-
fileContent({ fileId, onDownloadProgress, progressDecrypt,
|
|
143
|
+
fileContent({ fileId, onDownloadProgress, progressDecrypt, signal }: {
|
|
138
144
|
fileId: string;
|
|
139
145
|
onDownloadProgress?: (progress: DownloadProgress) => void;
|
|
140
146
|
progressDecrypt?: ProgressCallback;
|
|
141
|
-
|
|
147
|
+
signal?: AbortSignal;
|
|
142
148
|
}): Promise<Uint8Array>;
|
|
143
149
|
updateFile({ fileId, filename, isFavorite, deletedAt }: {
|
|
144
150
|
fileId: string;
|
|
@@ -159,5 +165,6 @@ export declare class SecrecyClient extends BaseClient {
|
|
|
159
165
|
draftMails(): Promise<DraftMail[]>;
|
|
160
166
|
private perFolder;
|
|
161
167
|
private perVFile;
|
|
168
|
+
unreadReceivedMailsCount(): Promise<number>;
|
|
162
169
|
private _eachUser;
|
|
163
170
|
}
|