@secrecy/lib 1.29.0-feat-rename-file.2 → 1.29.0-feat-add-manage-user-data.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/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 +25 -25
- package/dist/lib/client/convert/file.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/file.d.ts +4 -0
- package/dist/types/client/index.d.ts +1 -1
- package/dist/types/client/types/file.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 +445 -507
- 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/data.js +0 -29
- package/dist/types/client/convert/data.d.ts +0 -4
- package/dist/types/client/types/data.d.ts +0 -6
- /package/dist/lib/client/types/{data.js → file.js} +0 -0
- /package/dist/lib/crypto/{data.js → file.js} +0 -0
- /package/dist/types/crypto/{data.d.ts → file.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/file.js';
|
|
4
4
|
export { BaseClient } from './base-client.js';
|
|
5
|
-
export type { Node, NodeFull,
|
|
5
|
+
export type { Node, NodeFull, FileMetadata, SecrecyUserApp, BaseMail, ReceivedMail, SentMail, PublicUser, SelfUser, NodeSize, MailFile, 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/file.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-add-manage-user-data.1",
|
|
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-add-manage-user-data.1",
|
|
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 { dataCache } from '../../cache.js';
|
|
2
|
-
import { decryptCryptoBox } from '../../crypto/index.js';
|
|
3
|
-
import { sodium } from '../../sodium.js';
|
|
4
|
-
export function apiDataToInternal(apiData, keyPair) {
|
|
5
|
-
const data = {
|
|
6
|
-
id: apiData.id,
|
|
7
|
-
md5: apiData.md5,
|
|
8
|
-
md5Encrypted: apiData.md5Encrypted,
|
|
9
|
-
createdAt: apiData.createdAt,
|
|
10
|
-
size: apiData.size,
|
|
11
|
-
sizeBefore: apiData.sizeBefore,
|
|
12
|
-
key: sodium.to_hex(decryptCryptoBox(sodium.from_hex(apiData.access.key), apiData.access.sharedByPubKey, keyPair.privateKey)),
|
|
13
|
-
};
|
|
14
|
-
dataCache.set(data.id, data);
|
|
15
|
-
return data;
|
|
16
|
-
}
|
|
17
|
-
export function internalDataToExternalData(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 apiDataToExternal(apiData, keyPair) {
|
|
28
|
-
return internalDataToExternalData(apiDataToInternal(apiData, keyPair));
|
|
29
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { ApiData, InternalData, DataMetadata, KeyPair } from '../types/index.js';
|
|
2
|
-
export declare function apiDataToInternal(apiData: ApiData, keyPair: KeyPair): InternalData;
|
|
3
|
-
export declare function internalDataToExternalData(internal: InternalData): DataMetadata;
|
|
4
|
-
export declare function apiDataToExternal(apiData: ApiData, keyPair: KeyPair): DataMetadata;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { type RouterOutputs } from '../../client.js';
|
|
2
|
-
export type DataMetadata = Pick<ApiData, 'id' | 'size' | 'sizeBefore' | 'md5' | 'md5Encrypted' | 'createdAt'>;
|
|
3
|
-
export type InternalData = DataMetadata & {
|
|
4
|
-
key: string;
|
|
5
|
-
};
|
|
6
|
-
export type ApiData = NonNullable<RouterOutputs['cloud']['dataById']>;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|