@secrecy/lib 1.29.0-feat-manage-user-data.2 → 1.29.0-feat-rename-file.3
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/lib/cache.js +2 -2
- package/dist/lib/client/SecrecyAppClient.js +2 -2
- package/dist/lib/client/SecrecyCloudClient.js +91 -91
- package/dist/lib/client/SecrecyMailClient.js +36 -29
- package/dist/lib/client/convert/data.js +29 -0
- package/dist/lib/client/convert/mail.js +4 -4
- package/dist/lib/client/convert/node.js +7 -7
- package/dist/lib/client/index.js +3 -3
- package/dist/types/cache.d.ts +3 -3
- package/dist/types/client/SecrecyCloudClient.d.ts +15 -15
- package/dist/types/client/convert/data.d.ts +4 -0
- package/dist/types/client/index.d.ts +1 -1
- package/dist/types/client/types/data.d.ts +6 -0
- package/dist/types/client/types/index.d.ts +1 -1
- package/dist/types/client/types/mail.d.ts +5 -5
- package/dist/types/client/types/node.d.ts +4 -4
- package/dist/types/client.d.ts +392 -390
- package/dist/types/index.d.ts +2 -2
- package/dist/types/worker/sodium.d.ts +1 -1
- package/package.json +2 -2
- package/dist/lib/client/convert/file.js +0 -29
- package/dist/types/client/convert/file.d.ts +0 -4
- package/dist/types/client/types/file.d.ts +0 -6
- /package/dist/lib/client/types/{file.js → data.js} +0 -0
- /package/dist/lib/crypto/{file.js → data.js} +0 -0
- /package/dist/types/crypto/{file.d.ts → data.d.ts} +0 -0
package/dist/types/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export * from './client/index.js';
|
|
2
2
|
export * from './crypto/index.js';
|
|
3
|
-
export type { Progress } from './crypto/
|
|
3
|
+
export type { Progress } from './crypto/data.js';
|
|
4
4
|
export { BaseClient } from './base-client.js';
|
|
5
|
-
export type { Node, NodeFull,
|
|
5
|
+
export type { Node, NodeFull, DataMetadata, SecrecyUserApp, BaseMail, ReceivedMail, SentMail, PublicUser, SelfUser, NodeSize, MailData, MailIntegrity, DraftMail, Mail, WaitingReceivedMail, KeyPair, } from './client/types/index.js';
|
|
6
6
|
export * from './client/helpers.js';
|
|
7
7
|
export * from './sodium.js';
|
|
8
8
|
export * from './utils/store-buddy.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { EncryptedFile, Progress } from '../crypto/
|
|
1
|
+
import type { EncryptedFile, Progress } from '../crypto/data.js';
|
|
2
2
|
export declare function encrypt(key: Uint8Array, dataToEncrypt: Uint8Array, progress?: (progress: Progress) => Promise<void>, signal?: AbortSignal): Promise<EncryptedFile>;
|
|
3
3
|
export declare function decrypt(key: Uint8Array, dataToDecrypt: Uint8Array, progress?: (progress: Progress) => Promise<void>, signal?: AbortSignal): Promise<Uint8Array>;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@secrecy/lib",
|
|
3
3
|
"author": "Anonymize <anonymize@gmail.com>",
|
|
4
4
|
"description": "Anonymize Secrecy Library",
|
|
5
|
-
"version": "1.29.0-feat-
|
|
5
|
+
"version": "1.29.0-feat-rename-file.3",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/anonymize-org/lib.git"
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
76
|
"@secrecy/lib-utils": "^1.0.18",
|
|
77
|
-
"@secrecy/trpc-api-types": "1.27.0-feat-
|
|
77
|
+
"@secrecy/trpc-api-types": "1.27.0-feat-rename-file.12",
|
|
78
78
|
"@trpc/client": "10.45.2",
|
|
79
79
|
"@trpc/server": "10.45.2",
|
|
80
80
|
"@types/libsodium-wrappers-sumo": "^0.7.8",
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { filesCache } from '../../cache.js';
|
|
2
|
-
import { decryptCryptoBox } from '../../crypto/index.js';
|
|
3
|
-
import { sodium } from '../../sodium.js';
|
|
4
|
-
export function apiFileToInternal(apiFile, keyPair) {
|
|
5
|
-
const file = {
|
|
6
|
-
id: apiFile.id,
|
|
7
|
-
md5: apiFile.md5,
|
|
8
|
-
md5Encrypted: apiFile.md5Encrypted,
|
|
9
|
-
createdAt: apiFile.createdAt,
|
|
10
|
-
size: apiFile.size,
|
|
11
|
-
sizeBefore: apiFile.sizeBefore,
|
|
12
|
-
key: sodium.to_hex(decryptCryptoBox(sodium.from_hex(apiFile.access.key), apiFile.access.sharedByPubKey, keyPair.privateKey)),
|
|
13
|
-
};
|
|
14
|
-
filesCache.set(file.id, file);
|
|
15
|
-
return file;
|
|
16
|
-
}
|
|
17
|
-
export function internalFileToFile(internal) {
|
|
18
|
-
return {
|
|
19
|
-
id: internal.id,
|
|
20
|
-
md5: internal.md5,
|
|
21
|
-
md5Encrypted: internal.md5Encrypted,
|
|
22
|
-
createdAt: internal.createdAt,
|
|
23
|
-
size: internal.size,
|
|
24
|
-
sizeBefore: internal.sizeBefore,
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
export function apiFileToExternal(apiFile, keyPair) {
|
|
28
|
-
return internalFileToFile(apiFileToInternal(apiFile, keyPair));
|
|
29
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { ApiFile, InternalFile, FileMetadata, KeyPair } from '../types/index.js';
|
|
2
|
-
export declare function apiFileToInternal(apiFile: ApiFile, keyPair: KeyPair): InternalFile;
|
|
3
|
-
export declare function internalFileToFile(internal: InternalFile): FileMetadata;
|
|
4
|
-
export declare function apiFileToExternal(apiFile: ApiFile, keyPair: KeyPair): FileMetadata;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { type RouterOutputs } from '../../client.js';
|
|
2
|
-
export type FileMetadata = Pick<ApiFile, 'id' | 'size' | 'sizeBefore' | 'md5' | 'md5Encrypted' | 'createdAt'>;
|
|
3
|
-
export type InternalFile = FileMetadata & {
|
|
4
|
-
key: string;
|
|
5
|
-
};
|
|
6
|
-
export type ApiFile = NonNullable<RouterOutputs['cloud']['fileById']>;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|