@telecrypt-io/storage 0.4.0 → 0.5.8
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 +54 -9
- package/dist/TeleCryptIOStorage.d.ts +86 -45
- package/dist/TeleCryptIOStorage.js +1418 -230
- package/dist/core/constants.d.ts +16 -0
- package/dist/core/constants.js +54 -0
- package/dist/core/errors.d.ts +66 -0
- package/dist/core/errors.js +108 -0
- package/dist/core/http.d.ts +24 -0
- package/dist/core/http.js +199 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +1 -0
- package/dist/core/oidc.d.ts +47 -69
- package/dist/core/oidc.js +1196 -137
- package/dist/core/operations.d.ts +31 -32
- package/dist/core/operations.js +1270 -219
- package/dist/core/poll.d.ts +2 -1
- package/dist/core/poll.js +59 -3
- package/dist/core/types.d.ts +14 -0
- package/dist/core/validation.d.ts +3 -0
- package/dist/core/validation.js +10 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/package.json +11 -9
|
@@ -12,50 +12,49 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import { TeleCryptIOStorage } from "../TeleCryptIOStorage.js";
|
|
14
14
|
import type { DownloadedFile, FolderDetails, FolderInfo, FileDetails, FileInfo, VaultDetails, VaultInfo, DeleteResult, JoinResult, Member, RecoveryRestore, RecoverySetup, RenameResult, ShareResult, UnshareResult } from "./types.js";
|
|
15
|
-
export
|
|
15
|
+
export interface OperationOptions {
|
|
16
|
+
/** Cancels bounded waits and rate-limit backoff before the next mutation. */
|
|
17
|
+
signal?: AbortSignal;
|
|
18
|
+
/** Total wall-clock budget for one mutation, including all descendants. */
|
|
19
|
+
timeoutMs?: number;
|
|
20
|
+
}
|
|
21
|
+
export declare function createVault(storage: TeleCryptIOStorage, name: string, options?: OperationOptions): Promise<VaultInfo>;
|
|
16
22
|
/** Top-level vaults only — excludes subdirectories of an existing tree. */
|
|
17
|
-
export declare function listVaults(storage: TeleCryptIOStorage): Promise<VaultInfo[]>;
|
|
23
|
+
export declare function listVaults(storage: TeleCryptIOStorage, options?: OperationOptions): Promise<VaultInfo[]>;
|
|
18
24
|
/** Current account's effective role for a vault, or null while it is unavailable. */
|
|
19
25
|
export declare function getMyVaultRole(storage: TeleCryptIOStorage, vaultId: string): string | null;
|
|
20
|
-
export declare function joinVault(storage: TeleCryptIOStorage, vaultId: string): Promise<JoinResult>;
|
|
26
|
+
export declare function joinVault(storage: TeleCryptIOStorage, vaultId: string, options?: OperationOptions): Promise<JoinResult>;
|
|
21
27
|
/** Rooms where this account is invited and the room looks like a file tree. */
|
|
22
|
-
export declare function listPendingInvites(storage: TeleCryptIOStorage): Promise<VaultInfo[]>;
|
|
28
|
+
export declare function listPendingInvites(storage: TeleCryptIOStorage, options?: OperationOptions): Promise<VaultInfo[]>;
|
|
23
29
|
/** Decline a vault invite (same as leaving before join). */
|
|
24
|
-
export declare function declineInvite(storage: TeleCryptIOStorage, vaultId: string): Promise<{
|
|
30
|
+
export declare function declineInvite(storage: TeleCryptIOStorage, vaultId: string, options?: OperationOptions): Promise<{
|
|
25
31
|
vaultId: string;
|
|
26
32
|
declined: boolean;
|
|
27
33
|
}>;
|
|
28
|
-
/**
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
* swallowed and the role change still applies. Any other invite failure
|
|
34
|
-
* (e.g. unknown user) propagates.
|
|
35
|
-
*/
|
|
36
|
-
export declare function shareVault(storage: TeleCryptIOStorage, vaultId: string, userId: string, role: string): Promise<ShareResult>;
|
|
37
|
-
export declare function unshareVault(storage: TeleCryptIOStorage, vaultId: string, userId: string): Promise<UnshareResult>;
|
|
38
|
-
export declare function listMembers(storage: TeleCryptIOStorage, vaultId: string): Promise<Member[]>;
|
|
39
|
-
export declare function listFiles(storage: TeleCryptIOStorage, treeId: string): Promise<FileInfo[]>;
|
|
34
|
+
/** Invites `userId` to the vault and applies the requested role. */
|
|
35
|
+
export declare function shareVault(storage: TeleCryptIOStorage, vaultId: string, userId: string, role: string, options?: OperationOptions): Promise<ShareResult>;
|
|
36
|
+
export declare function unshareVault(storage: TeleCryptIOStorage, vaultId: string, userId: string, options?: OperationOptions): Promise<UnshareResult>;
|
|
37
|
+
export declare function listMembers(storage: TeleCryptIOStorage, vaultId: string, options?: OperationOptions): Promise<Member[]>;
|
|
38
|
+
export declare function listFiles(storage: TeleCryptIOStorage, treeId: string, options?: OperationOptions): Promise<FileInfo[]>;
|
|
40
39
|
/** Lists the direct child folders of a vault or folder. */
|
|
41
|
-
export declare function listSubfolders(storage: TeleCryptIOStorage, parentId: string): Promise<FolderInfo[]>;
|
|
42
|
-
export declare function createSubfolder(storage: TeleCryptIOStorage, parentId: string, name: string): Promise<FolderInfo>;
|
|
40
|
+
export declare function listSubfolders(storage: TeleCryptIOStorage, parentId: string, options?: OperationOptions): Promise<FolderInfo[]>;
|
|
41
|
+
export declare function createSubfolder(storage: TeleCryptIOStorage, parentId: string, name: string, options?: OperationOptions): Promise<FolderInfo>;
|
|
43
42
|
/** Renames a top-level Vault. */
|
|
44
|
-
export declare function renameVault(storage: TeleCryptIOStorage, vaultId: string, name: string): Promise<RenameResult>;
|
|
43
|
+
export declare function renameVault(storage: TeleCryptIOStorage, vaultId: string, name: string, options?: OperationOptions): Promise<RenameResult>;
|
|
45
44
|
/** Renames a nested folder. */
|
|
46
|
-
export declare function renameFolder(storage: TeleCryptIOStorage, folderId: string, name: string): Promise<RenameResult>;
|
|
45
|
+
export declare function renameFolder(storage: TeleCryptIOStorage, folderId: string, name: string, options?: OperationOptions): Promise<RenameResult>;
|
|
47
46
|
/** Deletes a top-level Vault. */
|
|
48
|
-
export declare function deleteVault(storage: TeleCryptIOStorage, vaultId: string): Promise<DeleteResult>;
|
|
47
|
+
export declare function deleteVault(storage: TeleCryptIOStorage, vaultId: string, options?: OperationOptions): Promise<DeleteResult>;
|
|
49
48
|
/** Deletes a nested folder. */
|
|
50
|
-
export declare function deleteFolder(storage: TeleCryptIOStorage, folderId: string): Promise<DeleteResult>;
|
|
51
|
-
export declare function renameFile(storage: TeleCryptIOStorage, treeId: string, fileId: string, name: string): Promise<RenameResult>;
|
|
52
|
-
export declare function deleteFile(storage: TeleCryptIOStorage, treeId: string, fileId: string): Promise<DeleteResult>;
|
|
53
|
-
export declare function uploadFile(storage: TeleCryptIOStorage, treeId: string, name: string, bytes: Uint8Array, mimetype: string): Promise<FileInfo>;
|
|
54
|
-
export declare function downloadFile(storage: TeleCryptIOStorage, treeId: string, fileId: string): Promise<DownloadedFile>;
|
|
55
|
-
export declare function setupRecovery(storage: TeleCryptIOStorage): Promise<RecoverySetup>;
|
|
56
|
-
export declare function restoreRecovery(storage: TeleCryptIOStorage, recoveryKey: string): Promise<RecoveryRestore>;
|
|
57
|
-
export declare function getFileDetails(storage: TeleCryptIOStorage, treeId: string, fileId: string): Promise<FileDetails>;
|
|
49
|
+
export declare function deleteFolder(storage: TeleCryptIOStorage, folderId: string, options?: OperationOptions): Promise<DeleteResult>;
|
|
50
|
+
export declare function renameFile(storage: TeleCryptIOStorage, treeId: string, fileId: string, name: string, options?: OperationOptions): Promise<RenameResult>;
|
|
51
|
+
export declare function deleteFile(storage: TeleCryptIOStorage, treeId: string, fileId: string, options?: OperationOptions): Promise<DeleteResult>;
|
|
52
|
+
export declare function uploadFile(storage: TeleCryptIOStorage, treeId: string, name: string, bytes: Uint8Array, mimetype: string, options?: OperationOptions): Promise<FileInfo>;
|
|
53
|
+
export declare function downloadFile(storage: TeleCryptIOStorage, treeId: string, fileId: string, options?: OperationOptions): Promise<DownloadedFile>;
|
|
54
|
+
export declare function setupRecovery(storage: TeleCryptIOStorage, options?: OperationOptions): Promise<RecoverySetup>;
|
|
55
|
+
export declare function restoreRecovery(storage: TeleCryptIOStorage, recoveryKey: string, options?: OperationOptions): Promise<RecoveryRestore>;
|
|
56
|
+
export declare function getFileDetails(storage: TeleCryptIOStorage, treeId: string, fileId: string, options?: OperationOptions): Promise<FileDetails>;
|
|
58
57
|
/** Returns details for a top-level Vault. */
|
|
59
|
-
export declare function getVaultDetails(storage: TeleCryptIOStorage, vaultId: string): Promise<VaultDetails>;
|
|
58
|
+
export declare function getVaultDetails(storage: TeleCryptIOStorage, vaultId: string, options?: OperationOptions): Promise<VaultDetails>;
|
|
60
59
|
/** Returns details for a nested folder. */
|
|
61
|
-
export declare function getFolderDetails(storage: TeleCryptIOStorage, folderId: string): Promise<FolderDetails>;
|
|
60
|
+
export declare function getFolderDetails(storage: TeleCryptIOStorage, folderId: string, options?: OperationOptions): Promise<FolderDetails>;
|