@secrecy/lib 1.74.6 → 1.75.0-feat-groups-identity.2
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/base-client.js +26 -2
- package/dist/lib/client/SecrecyAppClient.js +14 -18
- package/dist/lib/client/SecrecyCloudClient.js +130 -135
- package/dist/lib/client/SecrecyDbClient.js +1 -8
- package/dist/lib/client/SecrecyMailClient.js +38 -48
- package/dist/lib/client/SecrecyOrganizationClient.js +10 -12
- package/dist/lib/client/SecrecyPayClient.js +1 -5
- package/dist/lib/client/SecrecyPseudonymClient.js +4 -8
- package/dist/lib/client/SecrecyUserClient.js +11 -11
- package/dist/lib/client/SecrecyWalletClient.js +0 -2
- package/dist/lib/client/convert/data.js +8 -4
- package/dist/lib/client/convert/mail.js +8 -6
- package/dist/lib/client/convert/node.js +59 -34
- package/dist/lib/client/data-link.js +4 -1
- package/dist/lib/client/helpers.js +17 -7
- package/dist/lib/client/index.js +48 -12
- package/dist/lib/client/storage.js +3 -2
- package/dist/lib/client/types/identity.js +19 -0
- package/dist/lib/client/types/index.js +3 -7
- package/dist/lib/client/upload.js +20 -17
- package/dist/lib/crypto/data.js +4 -4
- package/dist/lib/crypto/domain.js +10 -10
- package/dist/lib/index.js +1 -0
- package/dist/lib/minify/lz4.js +1 -0
- package/dist/lib/utils/links.js +5 -5
- package/dist/lib/utils.js +1 -1
- package/dist/lib/worker/sodium.js +2 -2
- package/dist/types/base-client.d.ts +3 -1
- package/dist/types/client/SecrecyAppClient.d.ts +2 -3
- package/dist/types/client/SecrecyCloudClient.d.ts +19 -19
- package/dist/types/client/SecrecyDbClient.d.ts +1 -4
- package/dist/types/client/SecrecyMailClient.d.ts +2 -3
- package/dist/types/client/SecrecyOrganizationClient.d.ts +2 -3
- package/dist/types/client/SecrecyPayClient.d.ts +1 -3
- package/dist/types/client/SecrecyPseudonymClient.d.ts +2 -3
- package/dist/types/client/SecrecyUserClient.d.ts +2 -3
- package/dist/types/client/convert/data.d.ts +3 -3
- package/dist/types/client/convert/mail.d.ts +3 -5
- package/dist/types/client/convert/node.d.ts +5 -5
- package/dist/types/client/data-link.d.ts +2 -2
- package/dist/types/client/index.d.ts +11 -3
- package/dist/types/client/storage.d.ts +3 -2
- package/dist/types/client/types/identity.d.ts +37 -0
- package/dist/types/client/types/index.d.ts +17 -9
- package/dist/types/client/types/mail.d.ts +2 -1
- package/dist/types/client/types/node.d.ts +12 -9
- package/dist/types/client/types/user.d.ts +15 -0
- package/dist/types/client/upload.d.ts +8 -7
- package/dist/types/client.d.ts +1438 -1050
- package/dist/types/crypto/data.d.ts +2 -2
- package/dist/types/crypto/domain.d.ts +6 -4
- package/dist/types/crypto/index.d.ts +3 -3
- package/dist/types/index.d.ts +2 -1
- package/package.json +21 -21
|
@@ -10,5 +10,5 @@ export interface SecretStreamProgress {
|
|
|
10
10
|
total: number;
|
|
11
11
|
current: number;
|
|
12
12
|
}
|
|
13
|
-
export declare function encryptSecretStream(key: Uint8Array, data: Uint8Array<ArrayBuffer>, progress?: (progress: SecretStreamProgress) => Promise<void>,
|
|
14
|
-
export declare function decryptSecretStream(key: Uint8Array, data: Uint8Array<ArrayBuffer>, progress?: (progress: SecretStreamProgress) => Promise<void>,
|
|
13
|
+
export declare function encryptSecretStream(key: Uint8Array, data: Uint8Array<ArrayBuffer>, progress?: (progress: SecretStreamProgress) => Promise<void>, signal?: AbortSignal): Promise<EncryptedFile>;
|
|
14
|
+
export declare function decryptSecretStream(key: Uint8Array, data: Uint8Array<ArrayBuffer>, progress?: (progress: SecretStreamProgress) => Promise<void>, signal?: AbortSignal): Promise<Uint8Array<ArrayBuffer>>;
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { type Progress } from '../types.js';
|
|
2
|
-
import { ApiExtendedData
|
|
3
|
-
import { ProgressCallback } from '../client/index';
|
|
2
|
+
import { type ApiExtendedData } from '../client/types';
|
|
3
|
+
import { type ProgressCallback } from '../client/index';
|
|
4
4
|
import z from 'zod';
|
|
5
5
|
import { downloadDataLinkSchema } from '../client/data-link.js';
|
|
6
|
+
import type { UserAppIdentity } from '../client/types/identity.js';
|
|
6
7
|
/**
|
|
7
8
|
* Encrypt the dataKey and the data as logged or guest user.
|
|
8
9
|
* If a string is provided as keypair, it should be considered as guest with password case.
|
|
9
10
|
* If keypair is not provided, then we generate a key to be used as password for guest too.
|
|
10
11
|
*/
|
|
11
|
-
export declare function encryptDataAndKey({ data,
|
|
12
|
+
export declare function encryptDataAndKey({ data, uaIdentity, keyPairs, progress, signal, }: {
|
|
12
13
|
data: Uint8Array<ArrayBuffer>;
|
|
13
|
-
|
|
14
|
+
uaIdentity?: UserAppIdentity;
|
|
15
|
+
keyPairs?: Record<string, string>;
|
|
14
16
|
progress?: ProgressCallback;
|
|
15
17
|
signal?: AbortSignal;
|
|
16
18
|
}): Promise<{
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { sodium } from '../sodium.js';
|
|
2
2
|
export declare function encryptCryptoBox(data: Uint8Array, publicKeyBob: string, privateKeyAlice: string): Uint8Array;
|
|
3
|
-
export declare function generateCryptoBoxKeyPair():
|
|
3
|
+
export declare function generateCryptoBoxKeyPair(): sodium.StringKeyPair;
|
|
4
4
|
export declare function decryptCryptoBox(data: Uint8Array, publicKeyAlice: string, privateKeyBob: string): Uint8Array;
|
|
5
5
|
export declare function generateSecretBoxKey(): string;
|
|
6
6
|
export declare function encryptSecretBox(data: Uint8Array, key: string): Uint8Array;
|
|
7
7
|
export declare function decryptSecretBox(data: Uint8Array, key: string): Uint8Array;
|
|
8
8
|
export declare function encryptAnonymous(data: Uint8Array, receiverPublicKey: string): Uint8Array;
|
|
9
|
-
export declare function decryptAnonymous(data: Uint8Array, { privateKey, publicKey }:
|
|
9
|
+
export declare function decryptAnonymous(data: Uint8Array, { privateKey, publicKey }: Omit<sodium.StringKeyPair, 'keyType'>): Uint8Array;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -2,7 +2,8 @@ export * from './client/index.js';
|
|
|
2
2
|
export * from './crypto/index.js';
|
|
3
3
|
export type { SecretStreamProgress } from './crypto/data.js';
|
|
4
4
|
export { BaseClient } from './base-client.js';
|
|
5
|
-
export type { Node, NodeFull, DataMetadata, SecrecyUserApp, BaseMail, ReceivedMail, SentMail, PublicUser, SelfUser, NodeSize, MailData, MailIntegrity, DraftMail, Mail, WaitingReceivedMail,
|
|
5
|
+
export type { Node, NodeFull, DataMetadata, SecrecyUserApp, BaseMail, ReceivedMail, SentMail, PublicUser, SelfUser, NodeSize, MailData, MailIntegrity, DraftMail, Mail, WaitingReceivedMail, } from './client/types/index.js';
|
|
6
|
+
export * from './client/types/identity.js';
|
|
6
7
|
export * from './client/helpers.js';
|
|
7
8
|
export * from './sodium.js';
|
|
8
9
|
export * from './utils/store-buddy.js';
|
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.
|
|
5
|
+
"version": "1.75.0-feat-groups-identity.2",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/anonymize-org/lib.git"
|
|
@@ -49,48 +49,48 @@
|
|
|
49
49
|
"semantic-release": "semantic-release"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@commitlint/cli": "^
|
|
53
|
-
"@commitlint/config-conventional": "^
|
|
54
|
-
"@prisma/client": "6.
|
|
55
|
-
"@types/bun": "^1.
|
|
52
|
+
"@commitlint/cli": "^20.1.0",
|
|
53
|
+
"@commitlint/config-conventional": "^20.0.0",
|
|
54
|
+
"@prisma/client": "6.17.1",
|
|
55
|
+
"@types/bun": "^1.3.0",
|
|
56
56
|
"@types/jsonwebtoken": "^9.0.10",
|
|
57
57
|
"@types/spark-md5": "^3.0.5",
|
|
58
58
|
"@types/streamsaver": "^2.0.5",
|
|
59
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
60
|
-
"@typescript-eslint/parser": "^8.
|
|
61
|
-
"eslint": "^9.
|
|
62
|
-
"eslint-config-love": "^
|
|
59
|
+
"@typescript-eslint/eslint-plugin": "^8.46.1",
|
|
60
|
+
"@typescript-eslint/parser": "^8.46.1",
|
|
61
|
+
"eslint": "^9.37.0",
|
|
62
|
+
"eslint-config-love": "^133.0.0",
|
|
63
63
|
"eslint-config-prettier": "^10.1.8",
|
|
64
64
|
"eslint-plugin-import": "^2.32.0",
|
|
65
|
-
"eslint-plugin-n": "^17.23.
|
|
65
|
+
"eslint-plugin-n": "^17.23.1",
|
|
66
66
|
"eslint-plugin-promise": "^7.2.1",
|
|
67
67
|
"husky": "^9.1.7",
|
|
68
68
|
"npm-run-all": "^4.1.5",
|
|
69
69
|
"prettier": "^3.6.2",
|
|
70
70
|
"rimraf": "^6.0.1",
|
|
71
|
-
"semantic-release": "^24.2.
|
|
72
|
-
"typedoc": "^0.28.
|
|
73
|
-
"typedoc-plugin-markdown": "^4.
|
|
74
|
-
"typedoc-plugin-missing-exports": "^4.1.
|
|
75
|
-
"typescript": "^5.9.
|
|
71
|
+
"semantic-release": "^24.2.9",
|
|
72
|
+
"typedoc": "^0.28.14",
|
|
73
|
+
"typedoc-plugin-markdown": "^4.9.0",
|
|
74
|
+
"typedoc-plugin-missing-exports": "^4.1.2",
|
|
75
|
+
"typescript": "^5.9.3"
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@js-temporal/polyfill": "^0.5.1",
|
|
79
|
-
"@secrecy/trpc-api-types": "1.33.0-feat-
|
|
80
|
-
"@trpc/client": "11.
|
|
81
|
-
"@trpc/server": "^11.
|
|
79
|
+
"@secrecy/trpc-api-types": "1.33.0-feat-groups-identity.22",
|
|
80
|
+
"@trpc/client": "11.6.0",
|
|
81
|
+
"@trpc/server": "^11.6.0",
|
|
82
82
|
"@types/libsodium-wrappers-sumo": "^0.7.8",
|
|
83
83
|
"axios": "^1.11.0",
|
|
84
84
|
"bson": "^6.10.4",
|
|
85
85
|
"ethers": "^6.15.0",
|
|
86
86
|
"file-type": "^21.0.0",
|
|
87
87
|
"jsonwebtoken": "^9.0.2",
|
|
88
|
-
"ky": "^1.
|
|
88
|
+
"ky": "^1.11.0",
|
|
89
89
|
"libsodium-wrappers-sumo": "^0.7.15",
|
|
90
|
-
"lru-cache": "^11.2.
|
|
90
|
+
"lru-cache": "^11.2.2",
|
|
91
91
|
"spark-md5": "^3.0.2",
|
|
92
92
|
"streamsaver": "^2.0.6",
|
|
93
93
|
"superjson": "2.2.2",
|
|
94
|
-
"zod": "4.1.
|
|
94
|
+
"zod": "4.1.12"
|
|
95
95
|
}
|
|
96
96
|
}
|