@secrecy/lib 1.0.0-dev.9 → 1.0.1
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/LICENSE +1 -1
- package/README.md +1 -1
- package/dist/BaseClient.d.ts +111 -0
- package/dist/BaseClient.js +506 -0
- package/{lib → dist}/PopupTools.d.ts +4 -4
- package/dist/PopupTools.js +195 -0
- package/{lib → dist}/ZeusThunder.d.ts +0 -0
- package/dist/ZeusThunder.js +65 -0
- package/dist/cache.d.ts +6 -0
- package/dist/cache.js +4 -0
- package/dist/client/SecrecyAppClient.d.ts +17 -0
- package/dist/client/SecrecyAppClient.js +226 -0
- package/dist/client/SecrecyCloudClient.d.ts +89 -0
- package/dist/client/SecrecyCloudClient.js +1405 -0
- package/dist/client/SecrecyDbClient.d.ts +21 -0
- package/dist/client/SecrecyDbClient.js +177 -0
- package/dist/client/SecrecyMailClient.d.ts +42 -0
- package/dist/client/SecrecyMailClient.js +1022 -0
- package/dist/client/SecrecyPayClient.d.ts +28 -0
- package/dist/client/SecrecyPayClient.js +68 -0
- package/dist/client/SecrecyWalletClient.d.ts +30 -0
- package/dist/client/SecrecyWalletClient.js +73 -0
- package/{lib → dist}/client/convert/file.d.ts +3 -3
- package/dist/client/convert/file.js +33 -0
- package/dist/client/convert/mail.d.ts +3 -0
- package/dist/client/convert/mail.js +42 -0
- package/dist/client/convert/node.d.ts +9 -0
- package/dist/client/convert/node.js +87 -0
- package/{lib → dist}/client/helpers.d.ts +9 -4
- package/dist/client/helpers.js +119 -0
- package/dist/client/index.d.ts +34 -0
- package/dist/client/index.js +46 -0
- package/{lib → dist}/client/storage.d.ts +0 -0
- package/dist/client/storage.js +12 -0
- package/dist/client/types/File.d.ts +14 -0
- package/dist/client/types/File.js +3 -0
- package/dist/client/types/Inputs.d.ts +16 -0
- package/dist/client/types/Inputs.js +3 -0
- package/dist/client/types/Node.d.ts +56 -0
- package/dist/client/types/Node.js +3 -0
- package/dist/client/types/UserAppNotifications.d.ts +6 -0
- package/dist/client/types/UserAppNotifications.js +3 -0
- package/dist/client/types/UserAppSettings.d.ts +5 -0
- package/dist/client/types/UserAppSettings.js +3 -0
- package/{lib → dist}/client/types/index.d.ts +25 -59
- package/dist/client/types/index.js +8 -0
- package/dist/client/types/selectors.d.ts +400 -0
- package/dist/client/types/selectors.js +135 -0
- package/{lib → dist}/crypto/file.d.ts +2 -2
- package/dist/crypto/file.js +195 -0
- package/{lib → dist}/crypto/index.d.ts +0 -0
- package/dist/crypto/index.js +45 -0
- package/dist/error.d.ts +33 -0
- package/dist/error.js +3 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +10 -0
- package/{lib → dist}/minify/index.d.ts +0 -0
- package/dist/minify/index.js +23 -0
- package/{lib → dist}/minify/lz4.d.ts +0 -0
- package/dist/minify/lz4.js +539 -0
- package/{lib → dist}/sodium.d.ts +0 -0
- package/dist/sodium.js +6 -0
- package/{lib → dist}/utils/store-buddy.d.ts +1 -1
- package/dist/utils/store-buddy.js +58 -0
- package/{lib → dist}/utils/time.d.ts +0 -0
- package/dist/utils/time.js +12 -0
- package/{lib → dist/utils}/utils.d.ts +0 -0
- package/dist/utils/utils.js +47 -0
- package/{lib → dist}/worker/md5.d.ts +0 -0
- package/dist/worker/md5.js +24 -0
- package/{lib → dist}/worker/sodium.d.ts +0 -0
- package/dist/worker/sodium.js +118 -0
- package/{lib → dist}/worker/workerCodes.d.ts +0 -0
- package/dist/worker/workerCodes.js +255 -0
- package/{lib → dist}/zeus/const.d.ts +5 -0
- package/dist/zeus/const.js +1679 -0
- package/dist/zeus/index.d.ts +7941 -0
- package/dist/zeus/index.js +599 -0
- package/package.json +64 -54
- package/lib/BaseClient.d.ts +0 -266
- package/lib/BaseClient.js +0 -1332
- package/lib/PopupTools.js +0 -213
- package/lib/ZeusThunder.js +0 -115
- package/lib/cache.d.ts +0 -7
- package/lib/cache.js +0 -5
- package/lib/client/admin/index.d.ts +0 -10
- package/lib/client/admin/index.js +0 -145
- package/lib/client/convert/file.js +0 -39
- package/lib/client/convert/folder.d.ts +0 -8
- package/lib/client/convert/folder.js +0 -264
- package/lib/client/convert/mail.d.ts +0 -3
- package/lib/client/convert/mail.js +0 -46
- package/lib/client/convert/vFile.d.ts +0 -5
- package/lib/client/convert/vFile.js +0 -164
- package/lib/client/helpers.js +0 -116
- package/lib/client/index.d.ts +0 -169
- package/lib/client/index.js +0 -3803
- package/lib/client/storage.js +0 -12
- package/lib/client/types/File.d.ts +0 -21
- package/lib/client/types/File.js +0 -2
- package/lib/client/types/FilesOnUsersOnApplications.d.ts +0 -9
- package/lib/client/types/FilesOnUsersOnApplications.js +0 -2
- package/lib/client/types/Folder.d.ts +0 -68
- package/lib/client/types/Folder.js +0 -7
- package/lib/client/types/Inputs.d.ts +0 -21
- package/lib/client/types/Inputs.js +0 -2
- package/lib/client/types/UserAppNotifications.d.ts +0 -6
- package/lib/client/types/UserAppNotifications.js +0 -2
- package/lib/client/types/UserAppSettings.d.ts +0 -7
- package/lib/client/types/UserAppSettings.js +0 -2
- package/lib/client/types/VFile.d.ts +0 -62
- package/lib/client/types/VFile.js +0 -4
- package/lib/client/types/index.js +0 -9
- package/lib/client/types/queries.d.ts +0 -535
- package/lib/client/types/queries.js +0 -192
- package/lib/crypto/file.js +0 -291
- package/lib/crypto/index.js +0 -37
- package/lib/index.d.ts +0 -12
- package/lib/index.js +0 -41
- package/lib/minify/index.js +0 -28
- package/lib/minify/lz4.js +0 -633
- package/lib/sodium.js +0 -28
- package/lib/utils/store-buddy.js +0 -69
- package/lib/utils/time.js +0 -22
- package/lib/utils.js +0 -188
- package/lib/worker/__mock__/sodium.worker.d.ts +0 -19
- package/lib/worker/__mock__/sodium.worker.js +0 -57
- package/lib/worker/md5.js +0 -43
- package/lib/worker/sodium.js +0 -155
- package/lib/worker/workerCodes.js +0 -3
- package/lib/zeus/const.js +0 -1671
- package/lib/zeus/index.d.ts +0 -33302
- package/lib/zeus/index.js +0 -558
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { DownloadProgress, ProgressCallback, SecrecyClient, SuccessResponse } from "../index.js";
|
|
2
|
+
import type { KeyPair } from "../crypto/index.js";
|
|
3
|
+
import type { ErrorAccessDenied, ErrorBasic, ErrorLimit, ErrorNotExist, ErrorNotFound } from "../error.js";
|
|
4
|
+
import type { NodeType, Rights, Thunder } from "../zeus/index.js";
|
|
5
|
+
import type { FileMetadata, Node, NodeFull } from "./types/index.js";
|
|
6
|
+
export declare class SecrecyCloudClient {
|
|
7
|
+
#private;
|
|
8
|
+
constructor(client: SecrecyClient, keys: KeyPair, thunder: ReturnType<typeof Thunder>);
|
|
9
|
+
addFileToHistory({ fileId, nodeId }: {
|
|
10
|
+
fileId: string;
|
|
11
|
+
nodeId: string;
|
|
12
|
+
}): Promise<SuccessResponse<Node> | ErrorAccessDenied | ErrorNotExist | null>;
|
|
13
|
+
uploadFile({ file, encryptProgress, uploadProgress, signal }: {
|
|
14
|
+
file: globalThis.File | Uint8Array;
|
|
15
|
+
encryptProgress?: ProgressCallback;
|
|
16
|
+
uploadProgress?: ProgressCallback;
|
|
17
|
+
signal?: AbortSignal;
|
|
18
|
+
}): Promise<SuccessResponse<string> | ErrorAccessDenied | ErrorLimit | ErrorNotFound | null>;
|
|
19
|
+
uploadFileInCloud({ file, name, nodeId, encryptProgress, uploadProgress, signal }: {
|
|
20
|
+
file: globalThis.File | Uint8Array;
|
|
21
|
+
name: string;
|
|
22
|
+
nodeId?: string;
|
|
23
|
+
encryptProgress?: ProgressCallback;
|
|
24
|
+
uploadProgress?: ProgressCallback;
|
|
25
|
+
signal?: AbortSignal;
|
|
26
|
+
}): Promise<SuccessResponse<NodeFull> | ErrorAccessDenied | ErrorLimit | ErrorNotFound | ErrorBasic | ErrorNotExist | null>;
|
|
27
|
+
deletedNodes(): Promise<SuccessResponse<Node[]> | ErrorAccessDenied | null>;
|
|
28
|
+
sharedNodes(): Promise<SuccessResponse<Node[]> | ErrorAccessDenied | null>;
|
|
29
|
+
nodesSharedWithMe(type?: NodeType | null | undefined): Promise<SuccessResponse<Node[]> | ErrorAccessDenied | null>;
|
|
30
|
+
deleteNodeSharing({ nodeId, userId }: {
|
|
31
|
+
nodeId: string;
|
|
32
|
+
userId: string;
|
|
33
|
+
}): Promise<SuccessResponse<boolean> | ErrorAccessDenied | null>;
|
|
34
|
+
duplicateNode({ nodeId, folderId, customName }: {
|
|
35
|
+
nodeId: string;
|
|
36
|
+
folderId?: string | null | undefined;
|
|
37
|
+
customName?: string | null | undefined;
|
|
38
|
+
}): Promise<SuccessResponse<boolean> | ErrorAccessDenied | ErrorNotFound | null>;
|
|
39
|
+
deleteNodeCloudTrash({ ids }: {
|
|
40
|
+
ids: Array<string>;
|
|
41
|
+
}): Promise<SuccessResponse<boolean> | ErrorAccessDenied | null>;
|
|
42
|
+
createFolder({ name, parentFolderId }: {
|
|
43
|
+
name: string;
|
|
44
|
+
parentFolderId?: string | null;
|
|
45
|
+
}): Promise<SuccessResponse<NodeFull> | ErrorAccessDenied | ErrorNotExist | null>;
|
|
46
|
+
node({ id, deleted }?: {
|
|
47
|
+
id?: string | null | undefined;
|
|
48
|
+
deleted?: boolean | null | undefined;
|
|
49
|
+
}): Promise<SuccessResponse<NodeFull> | ErrorAccessDenied | null>;
|
|
50
|
+
fileMetadata({ id }: {
|
|
51
|
+
id: string;
|
|
52
|
+
}): Promise<SuccessResponse<FileMetadata> | ErrorAccessDenied | null>;
|
|
53
|
+
shareNode({ nodeId, userId, rights }: {
|
|
54
|
+
nodeId: string;
|
|
55
|
+
userId: string;
|
|
56
|
+
rights: Rights;
|
|
57
|
+
}): Promise<SuccessResponse<boolean> | ErrorAccessDenied | ErrorNotFound | null>;
|
|
58
|
+
updateNode({ nodeId, name, isFavorite, deletedAt }: {
|
|
59
|
+
nodeId: string;
|
|
60
|
+
name?: string | null | undefined;
|
|
61
|
+
isFavorite?: boolean | null | undefined;
|
|
62
|
+
deletedAt?: Date | null | undefined;
|
|
63
|
+
}): Promise<SuccessResponse<NodeFull> | ErrorAccessDenied | ErrorNotExist | null>;
|
|
64
|
+
fileContent({ fileId, onDownloadProgress, progressDecrypt, signal }: {
|
|
65
|
+
fileId: string;
|
|
66
|
+
onDownloadProgress?: (progress: DownloadProgress) => void;
|
|
67
|
+
progressDecrypt?: ProgressCallback;
|
|
68
|
+
signal?: AbortSignal;
|
|
69
|
+
}): Promise<SuccessResponse<Uint8Array> | ErrorAccessDenied | ErrorBasic | null>;
|
|
70
|
+
deleteFile({ fileId, nodeId }: {
|
|
71
|
+
fileId: string;
|
|
72
|
+
nodeId: string;
|
|
73
|
+
}): Promise<SuccessResponse<boolean> | ErrorAccessDenied | ErrorNotExist | null>;
|
|
74
|
+
deleteNode({ nodeId }: {
|
|
75
|
+
nodeId: string;
|
|
76
|
+
}): Promise<SuccessResponse<boolean> | ErrorAccessDenied | null>;
|
|
77
|
+
emptyTrash(): Promise<SuccessResponse<boolean> | ErrorAccessDenied | null>;
|
|
78
|
+
recoverNode(id: string): Promise<SuccessResponse<boolean> | ErrorAccessDenied | ErrorNotExist | null>;
|
|
79
|
+
moveNodes({ nodeIds, parentNodeId }: {
|
|
80
|
+
nodeIds: string[];
|
|
81
|
+
parentNodeId?: string | null | undefined;
|
|
82
|
+
}): Promise<SuccessResponse<boolean> | ErrorAccessDenied | null>;
|
|
83
|
+
saveInCloud({ fileId, name, nodeId }: {
|
|
84
|
+
fileId: string;
|
|
85
|
+
name: string;
|
|
86
|
+
nodeId?: string;
|
|
87
|
+
}): Promise<SuccessResponse<NodeFull> | ErrorAccessDenied | ErrorBasic | ErrorLimit | ErrorNotFound | ErrorNotExist | null>;
|
|
88
|
+
private perNode;
|
|
89
|
+
}
|