@secrecy/lib 1.62.0-feat-node-sharing.12 → 1.62.0
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.
|
@@ -12,6 +12,8 @@ export function apiDataToInternal(apiData, keyPair) {
|
|
|
12
12
|
key: apiData.access.key
|
|
13
13
|
? sodium.to_hex(decryptCryptoBox(sodium.from_hex(apiData.access.key), apiData.access.sharedByPubKey, keyPair.privateKey))
|
|
14
14
|
: null,
|
|
15
|
+
mime: apiData.mime ?? undefined,
|
|
16
|
+
ext: apiData.ext ?? undefined,
|
|
15
17
|
};
|
|
16
18
|
dataCache.set(data.id, data);
|
|
17
19
|
return data;
|
|
@@ -24,6 +26,8 @@ export function internalDataToExternalData(internal) {
|
|
|
24
26
|
createdAt: internal.createdAt,
|
|
25
27
|
size: internal.size,
|
|
26
28
|
sizeEncrypted: internal.sizeEncrypted,
|
|
29
|
+
mime: internal.mime ?? undefined,
|
|
30
|
+
ext: internal.ext ?? undefined,
|
|
27
31
|
};
|
|
28
32
|
}
|
|
29
33
|
export function apiDataToExternal(apiData, keyPair) {
|
|
@@ -11,7 +11,10 @@ export type LocalData = {
|
|
|
11
11
|
mime?: string;
|
|
12
12
|
ext?: string;
|
|
13
13
|
};
|
|
14
|
-
export type DataMetadata = Pick<ApiData, 'id' | 'size' | 'sizeEncrypted' | 'md5' | 'md5Encrypted' | 'createdAt'
|
|
14
|
+
export type DataMetadata = Pick<ApiData, 'id' | 'size' | 'sizeEncrypted' | 'md5' | 'md5Encrypted' | 'createdAt'> & {
|
|
15
|
+
mime?: string;
|
|
16
|
+
ext?: string;
|
|
17
|
+
};
|
|
15
18
|
export type InternalData = DataMetadata & {
|
|
16
19
|
key: string | null;
|
|
17
20
|
};
|
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.62.0
|
|
5
|
+
"version": "1.62.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/anonymize-org/lib.git"
|