internxt-crypto 0.0.9-alpha → 0.0.11
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 +3 -4
- package/dist/asymmetric-crypto-BORmLhnx.js +143 -0
- package/dist/asymmetric-crypto-BORmLhnx.js.map +1 -0
- package/dist/asymmetric-crypto-CyXsV4XT.mjs +102 -0
- package/dist/asymmetric-crypto-CyXsV4XT.mjs.map +1 -0
- package/dist/asymmetric-crypto.d.mts +47 -0
- package/dist/asymmetric-crypto.d.ts +47 -0
- package/dist/asymmetric-crypto.js +8 -0
- package/dist/asymmetric-crypto.mjs +3 -0
- package/dist/chunk-DWirmd9C.mjs +18 -0
- package/dist/chunk-Dt-PWiN7.js +60 -0
- package/dist/constants-Ccp21E03.js +208 -0
- package/dist/constants-Ccp21E03.js.map +1 -0
- package/dist/constants-kTeX-2T0.mjs +34 -0
- package/dist/constants-kTeX-2T0.mjs.map +1 -0
- package/dist/constants.d.mts +33 -0
- package/dist/constants.d.ts +33 -0
- package/dist/constants.js +31 -0
- package/dist/constants.mjs +3 -0
- package/dist/derive-key-Be7hS-cN.mjs +751 -0
- package/dist/derive-key-Be7hS-cN.mjs.map +1 -0
- package/dist/derive-key-CBf2WxJd.js +2513 -0
- package/dist/derive-key-CBf2WxJd.js.map +1 -0
- package/dist/derive-key.d.mts +97 -0
- package/dist/derive-key.d.ts +97 -0
- package/dist/derive-key.js +15 -0
- package/dist/derive-key.mjs +6 -0
- package/dist/email-crypto-BrT98taw.js +617 -0
- package/dist/email-crypto-BrT98taw.js.map +1 -0
- package/dist/email-crypto-DJUEjTxA.mjs +534 -0
- package/dist/email-crypto-DJUEjTxA.mjs.map +1 -0
- package/dist/email-crypto.d.mts +86 -0
- package/dist/email-crypto.d.ts +86 -0
- package/dist/email-crypto.js +17 -0
- package/dist/email-crypto.mjs +8 -0
- package/dist/email-search.d.mts +235 -0
- package/dist/email-search.d.ts +235 -0
- package/dist/email-search.js +637 -0
- package/dist/email-search.js.map +1 -0
- package/dist/email-search.mjs +608 -0
- package/dist/email-search.mjs.map +1 -0
- package/dist/hash-BoqwNkcd.js +190 -0
- package/dist/hash-BoqwNkcd.js.map +1 -0
- package/dist/hash-CXeGAwai.mjs +131 -0
- package/dist/hash-CXeGAwai.mjs.map +1 -0
- package/dist/hash.d.mts +65 -0
- package/dist/hash.d.ts +65 -0
- package/dist/hash.js +11 -0
- package/dist/hash.mjs +3 -0
- package/dist/index-CQqgKsbX.d.ts +50 -0
- package/dist/index-CintVUbp.d.ts +97 -0
- package/dist/index-D5pBU_A5.d.mts +50 -0
- package/dist/index-MaOov-ag.d.mts +97 -0
- package/dist/index.d.mts +52 -0
- package/dist/index.d.ts +52 -0
- package/dist/index.js +116 -2055
- package/dist/index.mjs +15 -8712
- package/dist/keystore-crypto-B4yCVo9l.js +182 -0
- package/dist/keystore-crypto-B4yCVo9l.js.map +1 -0
- package/dist/keystore-crypto-Bjgriq9h.mjs +159 -0
- package/dist/keystore-crypto-Bjgriq9h.mjs.map +1 -0
- package/dist/keystore-crypto.d.mts +40 -0
- package/dist/keystore-crypto.d.ts +40 -0
- package/dist/keystore-crypto.js +11 -0
- package/dist/keystore-crypto.mjs +9 -0
- package/dist/keystore-service.d.mts +48 -0
- package/dist/keystore-service.d.ts +48 -0
- package/dist/keystore-service.js +122 -0
- package/dist/keystore-service.js.map +1 -0
- package/dist/keystore-service.mjs +114 -0
- package/dist/keystore-service.mjs.map +1 -0
- package/dist/post-quantum-crypto-CAi-cEkV.js +189 -0
- package/dist/post-quantum-crypto-CAi-cEkV.js.map +1 -0
- package/dist/post-quantum-crypto-Vv34t6gX.mjs +154 -0
- package/dist/post-quantum-crypto-Vv34t6gX.mjs.map +1 -0
- package/dist/post-quantum-crypto.d.mts +2 -0
- package/dist/post-quantum-crypto.d.ts +2 -0
- package/dist/post-quantum-crypto.js +17 -0
- package/dist/post-quantum-crypto.mjs +3 -0
- package/dist/storage-service-BgIK2aYZ.js +82 -0
- package/dist/storage-service-BgIK2aYZ.js.map +1 -0
- package/dist/storage-service-CubCbhY2.mjs +65 -0
- package/dist/storage-service-CubCbhY2.mjs.map +1 -0
- package/dist/storage-service.d.mts +2 -0
- package/dist/storage-service.d.ts +2 -0
- package/dist/storage-service.js +14 -0
- package/dist/storage-service.mjs +3 -0
- package/dist/symmetric-crypto-CrdS1Che.mjs +197 -0
- package/dist/symmetric-crypto-CrdS1Che.mjs.map +1 -0
- package/dist/symmetric-crypto-D65zB396.js +244 -0
- package/dist/symmetric-crypto-D65zB396.js.map +1 -0
- package/dist/symmetric-crypto.d.mts +60 -0
- package/dist/symmetric-crypto.d.ts +60 -0
- package/dist/symmetric-crypto.js +10 -0
- package/dist/symmetric-crypto.mjs +4 -0
- package/dist/types-52g887Zi.js +16 -0
- package/dist/types-52g887Zi.js.map +1 -0
- package/dist/types-BiEoleqw.mjs +10 -0
- package/dist/types-BiEoleqw.mjs.map +1 -0
- package/dist/types-Ds3ivE9W.d.ts +104 -0
- package/dist/types-DwQJtrTx.d.mts +104 -0
- package/dist/types.d.mts +2 -0
- package/dist/types.d.ts +2 -0
- package/dist/types.js +3 -0
- package/dist/types.mjs +3 -0
- package/dist/utils-CNs3cyDj.js +263 -0
- package/dist/utils-CNs3cyDj.js.map +1 -0
- package/dist/utils-DS04iUcX.mjs +173 -0
- package/dist/utils-DS04iUcX.mjs.map +1 -0
- package/dist/utils.d.mts +99 -0
- package/dist/utils.d.ts +99 -0
- package/dist/utils.js +16 -0
- package/dist/utils.mjs +3 -0
- package/package.json +12 -11
- package/dist/__vite-browser-external-Dyvby5gX.js +0 -2
- package/dist/__vite-browser-external-Dyvby5gX.js.map +0 -1
- package/dist/__vite-browser-external-l0sNRNKZ.mjs +0 -2
- package/dist/__vite-browser-external-l0sNRNKZ.mjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { _ as PwdProtectedEmail, b as User, h as PublicKeys, i as EmailKeys, o as EmailPublicParameters, p as PrivateKeys, t as Email, u as HybridEncryptedEmail, x as UserWithPublicKeys } from "./types-DwQJtrTx.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/email-crypto/hybridEncyptedEmail.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Encrypts the email using hybrid encryption.
|
|
6
|
+
*
|
|
7
|
+
* @param email - The email to encrypt.
|
|
8
|
+
* @param recipientPublicKeys - The public keys of the recipient.
|
|
9
|
+
* @param senderPrivateKey - The private key of the sender.
|
|
10
|
+
* @param isSubjectEncrypted - Indicates if the email subject field should be encrypted
|
|
11
|
+
* @returns The encrypted email
|
|
12
|
+
*/
|
|
13
|
+
declare function encryptEmailHybrid(email: Email, recipient: UserWithPublicKeys, senderPrivateKey: PrivateKeys, isSubjectEncrypted?: boolean): Promise<HybridEncryptedEmail>;
|
|
14
|
+
/**
|
|
15
|
+
* Encrypts the email using hybrid encryption for multiple recipients.
|
|
16
|
+
*
|
|
17
|
+
* @param email - The email to encrypt.
|
|
18
|
+
* @param recipients - The recipients with corresponding public keys.
|
|
19
|
+
* @param senderPrivateKey - The private key of the sender.
|
|
20
|
+
* @param isSubjectEncrypted - Indicates if the email subject field should be encrypted
|
|
21
|
+
* @returns The set of encrypted email
|
|
22
|
+
*/
|
|
23
|
+
declare function encryptEmailHybridForMultipleRecipients(email: Email, recipients: UserWithPublicKeys[], senderPrivateKey: PrivateKeys, isSubjectEncrypted?: boolean): Promise<HybridEncryptedEmail[]>;
|
|
24
|
+
/**
|
|
25
|
+
* Decrypts the email using hybrid encryption.
|
|
26
|
+
*
|
|
27
|
+
* @param encryptedEmail - The encrypted email.
|
|
28
|
+
* @param senderPublicKeys - The public key of the sender.
|
|
29
|
+
* @param recipientPrivateKeys - The private key of the recipient.
|
|
30
|
+
* @returns The decrypted email
|
|
31
|
+
*/
|
|
32
|
+
declare function decryptEmailHybrid(encryptedEmail: HybridEncryptedEmail, senderPublicKeys: PublicKeys, recipientPrivateKeys: PrivateKeys): Promise<Email>;
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/email-crypto/pwdProtectedEmail.d.ts
|
|
35
|
+
/**
|
|
36
|
+
* Creates a password-protected email.
|
|
37
|
+
*
|
|
38
|
+
* @param email - The email to password-protect
|
|
39
|
+
* @param password - The secret password shared among recipients
|
|
40
|
+
* @param isSubjectEncrypted - Indicates if the email subject field should be encrypted
|
|
41
|
+
* @returns The password-protected email
|
|
42
|
+
*/
|
|
43
|
+
declare function createPwdProtectedEmail(email: Email, password: string, isSubjectEncrypted?: boolean): Promise<PwdProtectedEmail>;
|
|
44
|
+
/**
|
|
45
|
+
* Opens a password-protected email.
|
|
46
|
+
*
|
|
47
|
+
* @param encryptedEmail - The encrypted email
|
|
48
|
+
* @param password - The secret password shared among recipients.
|
|
49
|
+
* @returns The decrypted email
|
|
50
|
+
*/
|
|
51
|
+
declare function decryptPwdProtectedEmail(encryptedEmail: PwdProtectedEmail, password: string): Promise<Email>;
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/email-crypto/converters.d.ts
|
|
54
|
+
declare function userToBytes(user: User): Uint8Array;
|
|
55
|
+
declare function recipientsToBytes(recipients: User[]): Uint8Array;
|
|
56
|
+
/**
|
|
57
|
+
* Converts an Email type into a Uint8Array array.
|
|
58
|
+
*
|
|
59
|
+
* @param email - The email.
|
|
60
|
+
* @returns The Uint8Array array representation of the Email type.
|
|
61
|
+
*/
|
|
62
|
+
declare function emailToBinary(email: Email): Uint8Array;
|
|
63
|
+
//#endregion
|
|
64
|
+
//#region src/email-crypto/emailKeys.d.ts
|
|
65
|
+
/**
|
|
66
|
+
* Generates public and private keys for email service.
|
|
67
|
+
*
|
|
68
|
+
* @returns The user's private and public keys
|
|
69
|
+
*/
|
|
70
|
+
declare function generateEmailKeys(): Promise<EmailKeys>;
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region src/email-crypto/utils.d.ts
|
|
73
|
+
/**
|
|
74
|
+
* Creates an auxiliary string from public fields of the email.
|
|
75
|
+
*
|
|
76
|
+
* @param params - The email public parameters.
|
|
77
|
+
* @param isSubjectEncrypted - Indicates if the email subject field should be encrypted
|
|
78
|
+
* @returns The resulting auxiliary string
|
|
79
|
+
*/
|
|
80
|
+
declare function getAux(params: EmailPublicParameters, isSubjectEncrypted: boolean): Uint8Array;
|
|
81
|
+
declare namespace index_d_exports {
|
|
82
|
+
export { createPwdProtectedEmail, decryptEmailHybrid, decryptPwdProtectedEmail, emailToBinary, encryptEmailHybrid, encryptEmailHybridForMultipleRecipients, generateEmailKeys, getAux, recipientsToBytes, userToBytes };
|
|
83
|
+
}
|
|
84
|
+
//#endregion
|
|
85
|
+
export { createPwdProtectedEmail, decryptEmailHybrid, decryptPwdProtectedEmail, emailToBinary, encryptEmailHybrid, encryptEmailHybridForMultipleRecipients, generateEmailKeys, getAux, recipientsToBytes, index_d_exports as t, userToBytes };
|
|
86
|
+
//# sourceMappingURL=email-crypto.d.mts.map
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { _ as PwdProtectedEmail, b as User, h as PublicKeys, i as EmailKeys, o as EmailPublicParameters, p as PrivateKeys, t as Email, u as HybridEncryptedEmail, x as UserWithPublicKeys } from "./types-Ds3ivE9W.js";
|
|
2
|
+
|
|
3
|
+
//#region src/email-crypto/hybridEncyptedEmail.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Encrypts the email using hybrid encryption.
|
|
6
|
+
*
|
|
7
|
+
* @param email - The email to encrypt.
|
|
8
|
+
* @param recipientPublicKeys - The public keys of the recipient.
|
|
9
|
+
* @param senderPrivateKey - The private key of the sender.
|
|
10
|
+
* @param isSubjectEncrypted - Indicates if the email subject field should be encrypted
|
|
11
|
+
* @returns The encrypted email
|
|
12
|
+
*/
|
|
13
|
+
declare function encryptEmailHybrid(email: Email, recipient: UserWithPublicKeys, senderPrivateKey: PrivateKeys, isSubjectEncrypted?: boolean): Promise<HybridEncryptedEmail>;
|
|
14
|
+
/**
|
|
15
|
+
* Encrypts the email using hybrid encryption for multiple recipients.
|
|
16
|
+
*
|
|
17
|
+
* @param email - The email to encrypt.
|
|
18
|
+
* @param recipients - The recipients with corresponding public keys.
|
|
19
|
+
* @param senderPrivateKey - The private key of the sender.
|
|
20
|
+
* @param isSubjectEncrypted - Indicates if the email subject field should be encrypted
|
|
21
|
+
* @returns The set of encrypted email
|
|
22
|
+
*/
|
|
23
|
+
declare function encryptEmailHybridForMultipleRecipients(email: Email, recipients: UserWithPublicKeys[], senderPrivateKey: PrivateKeys, isSubjectEncrypted?: boolean): Promise<HybridEncryptedEmail[]>;
|
|
24
|
+
/**
|
|
25
|
+
* Decrypts the email using hybrid encryption.
|
|
26
|
+
*
|
|
27
|
+
* @param encryptedEmail - The encrypted email.
|
|
28
|
+
* @param senderPublicKeys - The public key of the sender.
|
|
29
|
+
* @param recipientPrivateKeys - The private key of the recipient.
|
|
30
|
+
* @returns The decrypted email
|
|
31
|
+
*/
|
|
32
|
+
declare function decryptEmailHybrid(encryptedEmail: HybridEncryptedEmail, senderPublicKeys: PublicKeys, recipientPrivateKeys: PrivateKeys): Promise<Email>;
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/email-crypto/pwdProtectedEmail.d.ts
|
|
35
|
+
/**
|
|
36
|
+
* Creates a password-protected email.
|
|
37
|
+
*
|
|
38
|
+
* @param email - The email to password-protect
|
|
39
|
+
* @param password - The secret password shared among recipients
|
|
40
|
+
* @param isSubjectEncrypted - Indicates if the email subject field should be encrypted
|
|
41
|
+
* @returns The password-protected email
|
|
42
|
+
*/
|
|
43
|
+
declare function createPwdProtectedEmail(email: Email, password: string, isSubjectEncrypted?: boolean): Promise<PwdProtectedEmail>;
|
|
44
|
+
/**
|
|
45
|
+
* Opens a password-protected email.
|
|
46
|
+
*
|
|
47
|
+
* @param encryptedEmail - The encrypted email
|
|
48
|
+
* @param password - The secret password shared among recipients.
|
|
49
|
+
* @returns The decrypted email
|
|
50
|
+
*/
|
|
51
|
+
declare function decryptPwdProtectedEmail(encryptedEmail: PwdProtectedEmail, password: string): Promise<Email>;
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/email-crypto/converters.d.ts
|
|
54
|
+
declare function userToBytes(user: User): Uint8Array;
|
|
55
|
+
declare function recipientsToBytes(recipients: User[]): Uint8Array;
|
|
56
|
+
/**
|
|
57
|
+
* Converts an Email type into a Uint8Array array.
|
|
58
|
+
*
|
|
59
|
+
* @param email - The email.
|
|
60
|
+
* @returns The Uint8Array array representation of the Email type.
|
|
61
|
+
*/
|
|
62
|
+
declare function emailToBinary(email: Email): Uint8Array;
|
|
63
|
+
//#endregion
|
|
64
|
+
//#region src/email-crypto/emailKeys.d.ts
|
|
65
|
+
/**
|
|
66
|
+
* Generates public and private keys for email service.
|
|
67
|
+
*
|
|
68
|
+
* @returns The user's private and public keys
|
|
69
|
+
*/
|
|
70
|
+
declare function generateEmailKeys(): Promise<EmailKeys>;
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region src/email-crypto/utils.d.ts
|
|
73
|
+
/**
|
|
74
|
+
* Creates an auxiliary string from public fields of the email.
|
|
75
|
+
*
|
|
76
|
+
* @param params - The email public parameters.
|
|
77
|
+
* @param isSubjectEncrypted - Indicates if the email subject field should be encrypted
|
|
78
|
+
* @returns The resulting auxiliary string
|
|
79
|
+
*/
|
|
80
|
+
declare function getAux(params: EmailPublicParameters, isSubjectEncrypted: boolean): Uint8Array;
|
|
81
|
+
declare namespace index_d_exports {
|
|
82
|
+
export { createPwdProtectedEmail, decryptEmailHybrid, decryptPwdProtectedEmail, emailToBinary, encryptEmailHybrid, encryptEmailHybridForMultipleRecipients, generateEmailKeys, getAux, recipientsToBytes, userToBytes };
|
|
83
|
+
}
|
|
84
|
+
//#endregion
|
|
85
|
+
export { createPwdProtectedEmail, decryptEmailHybrid, decryptPwdProtectedEmail, emailToBinary, encryptEmailHybrid, encryptEmailHybridForMultipleRecipients, generateEmailKeys, getAux, recipientsToBytes, index_d_exports as t, userToBytes };
|
|
86
|
+
//# sourceMappingURL=email-crypto.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
require('./utils-CNs3cyDj.js');
|
|
2
|
+
require('./hash-BoqwNkcd.js');
|
|
3
|
+
require('./symmetric-crypto-D65zB396.js');
|
|
4
|
+
require('./derive-key-CBf2WxJd.js');
|
|
5
|
+
require('./post-quantum-crypto-CAi-cEkV.js');
|
|
6
|
+
const require_email_crypto = require('./email-crypto-BrT98taw.js');
|
|
7
|
+
|
|
8
|
+
exports.createPwdProtectedEmail = require_email_crypto.createPwdProtectedEmail;
|
|
9
|
+
exports.decryptEmailHybrid = require_email_crypto.decryptEmailHybrid;
|
|
10
|
+
exports.decryptPwdProtectedEmail = require_email_crypto.decryptPwdProtectedEmail;
|
|
11
|
+
exports.emailToBinary = require_email_crypto.emailToBinary;
|
|
12
|
+
exports.encryptEmailHybrid = require_email_crypto.encryptEmailHybrid;
|
|
13
|
+
exports.encryptEmailHybridForMultipleRecipients = require_email_crypto.encryptEmailHybridForMultipleRecipients;
|
|
14
|
+
exports.generateEmailKeys = require_email_crypto.generateEmailKeys;
|
|
15
|
+
exports.getAux = require_email_crypto.getAux;
|
|
16
|
+
exports.recipientsToBytes = require_email_crypto.recipientsToBytes;
|
|
17
|
+
exports.userToBytes = require_email_crypto.userToBytes;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "./utils-DS04iUcX.mjs";
|
|
2
|
+
import "./hash-CXeGAwai.mjs";
|
|
3
|
+
import "./symmetric-crypto-CrdS1Che.mjs";
|
|
4
|
+
import "./derive-key-Be7hS-cN.mjs";
|
|
5
|
+
import "./post-quantum-crypto-Vv34t6gX.mjs";
|
|
6
|
+
import { a as decryptEmailHybrid, d as emailToBinary, f as recipientsToBytes, i as decryptPwdProtectedEmail, n as generateEmailKeys, o as encryptEmailHybrid, p as userToBytes, r as createPwdProtectedEmail, s as encryptEmailHybridForMultipleRecipients, u as getAux } from "./email-crypto-DJUEjTxA.mjs";
|
|
7
|
+
|
|
8
|
+
export { createPwdProtectedEmail, decryptEmailHybrid, decryptPwdProtectedEmail, emailToBinary, encryptEmailHybrid, encryptEmailHybridForMultipleRecipients, generateEmailKeys, getAux, recipientsToBytes, userToBytes };
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { f as MailCache, s as EmailSearchResult, t as Email, y as StoredEmail } from "./types-DwQJtrTx.mjs";
|
|
2
|
+
import { DBSchema, IDBPDatabase } from "idb";
|
|
3
|
+
import { Index } from "flexsearch";
|
|
4
|
+
|
|
5
|
+
//#region src/email-search/indexedDB.d.ts
|
|
6
|
+
type MailDB = IDBPDatabase<EncryptedSearchDB>;
|
|
7
|
+
interface EncryptedSearchDB extends DBSchema {
|
|
8
|
+
email: {
|
|
9
|
+
key: string;
|
|
10
|
+
value: StoredEmail;
|
|
11
|
+
indexes: {
|
|
12
|
+
byTime: number[];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Opens IndexedDB database for the given user
|
|
18
|
+
*
|
|
19
|
+
* @param userID - The user ID
|
|
20
|
+
* @returns The database
|
|
21
|
+
*/
|
|
22
|
+
declare const openDatabase: (userID: string) => Promise<MailDB>;
|
|
23
|
+
/**
|
|
24
|
+
* Closes the IndexedDB database
|
|
25
|
+
*
|
|
26
|
+
* @param esDB - The database
|
|
27
|
+
*/
|
|
28
|
+
declare const closeDatabase: (esDB: MailDB) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Deletes IndexedDB database for the given user
|
|
31
|
+
*
|
|
32
|
+
* @param userID - The user ID
|
|
33
|
+
* @returns The database
|
|
34
|
+
*/
|
|
35
|
+
declare const deleteDatabase: (userID: string) => Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Derives database encryption key for the given user
|
|
38
|
+
*
|
|
39
|
+
* @param userID - The user ID
|
|
40
|
+
* @returns The symmetric CryptoKey for protecting database
|
|
41
|
+
*/
|
|
42
|
+
declare const deriveIndexKey: (baseKey: Uint8Array) => Promise<CryptoKey>;
|
|
43
|
+
/**
|
|
44
|
+
* Encrypts the given email and stores it in the IndexedDB database
|
|
45
|
+
*
|
|
46
|
+
* @param newEmailToStore - The email for storing
|
|
47
|
+
* @param indexKey - The symmetric CryptoKey key for protecting database
|
|
48
|
+
* @param esDB - The database
|
|
49
|
+
*/
|
|
50
|
+
declare const encryptAndStoreEmail: (newEmailToStore: Email, indexKey: CryptoKey, esDB: MailDB) => Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Encrypts the given set of emails and stores it in the IndexedDB database
|
|
53
|
+
*
|
|
54
|
+
* @param newEmailsToStore - The set of emails for storing
|
|
55
|
+
* @param indexKey - The symmetric CryptoKey key for protecting database
|
|
56
|
+
* @param esDB - The database
|
|
57
|
+
*/
|
|
58
|
+
declare const encryptAndStoreManyEmail: (newEmailsToStore: Email[], indexKey: CryptoKey, esDB: MailDB) => Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* Fetches the email from the database and decrypts it
|
|
61
|
+
*
|
|
62
|
+
* @param emailID - The email identifier
|
|
63
|
+
* @param indexKey - The symmetric CryptoKey key for protecting database
|
|
64
|
+
* @param encryptedEmail - The encrypted email
|
|
65
|
+
* @returns The decrypted email
|
|
66
|
+
*/
|
|
67
|
+
declare const getAndDecryptEmail: (emailID: string, indexKey: CryptoKey, esDB: MailDB) => Promise<Email>;
|
|
68
|
+
/**
|
|
69
|
+
* Fetches all email from the database and decrypts them
|
|
70
|
+
*
|
|
71
|
+
* @param indexKey - The symmetric CryptoKey key for protecting database
|
|
72
|
+
* @param esDB - The database
|
|
73
|
+
* @returns The decrypted emails
|
|
74
|
+
*/
|
|
75
|
+
declare const getAndDecryptAllEmails: (indexKey: CryptoKey, esDB: MailDB) => Promise<Email[]>;
|
|
76
|
+
/**
|
|
77
|
+
* Deletes the email from the database
|
|
78
|
+
*
|
|
79
|
+
* @param emailID - The email identifier
|
|
80
|
+
* @param esDB - The database
|
|
81
|
+
*/
|
|
82
|
+
declare const deleteEmail: (emailID: string, esDB: MailDB) => Promise<void>;
|
|
83
|
+
/**
|
|
84
|
+
* Returns the number of stored email
|
|
85
|
+
*
|
|
86
|
+
* @param esDB - The database
|
|
87
|
+
* @returns The number of stored emails
|
|
88
|
+
*/
|
|
89
|
+
declare const getEmailCount: (esDB: MailDB) => Promise<number>;
|
|
90
|
+
/**
|
|
91
|
+
* Removes the given number of oldests emails from the database
|
|
92
|
+
*
|
|
93
|
+
* @param emailsToDelete - The number of emails to delete
|
|
94
|
+
* @param esDB - The database
|
|
95
|
+
*/
|
|
96
|
+
declare const deleteOldestEmails: (emailsToDelete: number, esDB: MailDB) => Promise<void>;
|
|
97
|
+
/**
|
|
98
|
+
* Enforces the maximum email number in the database
|
|
99
|
+
*
|
|
100
|
+
* @param esDB - The database
|
|
101
|
+
* @param max - The maximum allowed number of emails
|
|
102
|
+
*/
|
|
103
|
+
declare const enforceMaxEmailNumber: (esDB: MailDB, max: number) => Promise<void>;
|
|
104
|
+
/**
|
|
105
|
+
* Fetches all emails from the database, decrypts them and sortes the results based on the creation time (newest first)
|
|
106
|
+
*
|
|
107
|
+
* @param esDB - The database
|
|
108
|
+
* @param indexKey - The symmetric CryptoKey key for protecting database
|
|
109
|
+
* @returns The number of stored emails
|
|
110
|
+
*/
|
|
111
|
+
declare const getAllEmailsSortedNewestFirst: (esDB: MailDB, indexKey: CryptoKey) => Promise<Email[]>;
|
|
112
|
+
/**
|
|
113
|
+
* Fetches all emails from the database, decrypts them and sortes the results based on the creation time (oldest first)
|
|
114
|
+
*
|
|
115
|
+
* @param esDB - The database
|
|
116
|
+
* @param indexKey - The symmetric CryptoKey key for protecting database
|
|
117
|
+
* @returns The number of stored emails
|
|
118
|
+
*/
|
|
119
|
+
declare const getAllEmailsSortedOldestFirst: (esDB: MailDB, indexKey: CryptoKey) => Promise<Email[]>;
|
|
120
|
+
/**
|
|
121
|
+
* Fetches a batch of emails from the database, decrypts them and sortes the results based on the creation time (newest first)
|
|
122
|
+
*
|
|
123
|
+
* @param esDB - The database
|
|
124
|
+
* @param indexKey - The symmetric CryptoKey key for protecting database
|
|
125
|
+
* @param batchSize - The size of the batch
|
|
126
|
+
* @param startCursor - The starting point (optional). If not given, starts from the beginning
|
|
127
|
+
* @returns The number of stored emails
|
|
128
|
+
*/
|
|
129
|
+
declare const getEmailBatch: (esDB: MailDB, indexKey: CryptoKey, batchSize: number, startCursor?: IDBValidKey) => Promise<{
|
|
130
|
+
emails: Email[];
|
|
131
|
+
nextCursor?: IDBValidKey;
|
|
132
|
+
}>;
|
|
133
|
+
//#endregion
|
|
134
|
+
//#region src/email-search/mailCache.d.ts
|
|
135
|
+
/**
|
|
136
|
+
* Fetches all emails from the database in batches and cahces them
|
|
137
|
+
*
|
|
138
|
+
* @param indexKey - The symmetric CryptoKey key for protecting database
|
|
139
|
+
* @param esCache - The cache to add emails too
|
|
140
|
+
* @param esDB - The database
|
|
141
|
+
*/
|
|
142
|
+
declare const createCacheFromDB: (indexKey: CryptoKey, esDB: MailDB) => Promise<MailCache<Email>>;
|
|
143
|
+
/**
|
|
144
|
+
* Gets an email from the cache
|
|
145
|
+
*
|
|
146
|
+
* @param emailID - The email identifier
|
|
147
|
+
* @param esCache - The email cache
|
|
148
|
+
* @returns The found email or throws an error
|
|
149
|
+
*/
|
|
150
|
+
declare const getEmailFromCache: (emailID: string, esCache: MailCache<Email>) => Promise<Email>;
|
|
151
|
+
/**
|
|
152
|
+
* Removes the email from cache
|
|
153
|
+
*
|
|
154
|
+
* @param emailID - The email identifier
|
|
155
|
+
* @param esCache - The email cache
|
|
156
|
+
*/
|
|
157
|
+
declare const deleteEmailFromCache: (emailID: string, esCache: MailCache<Email>) => Promise<void>;
|
|
158
|
+
/**
|
|
159
|
+
* Adds emails to the cache
|
|
160
|
+
*
|
|
161
|
+
* @param emails - The emails to add
|
|
162
|
+
* @param esCache - The email cache
|
|
163
|
+
* @returns TRUE if all emails were added sucessfully, or FALSE and error reason.
|
|
164
|
+
*/
|
|
165
|
+
declare function addEmailsToCache(emails: Email[], esCache: MailCache<Email>): {
|
|
166
|
+
success: boolean;
|
|
167
|
+
reason?: string;
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* Adds email to the cache
|
|
171
|
+
*
|
|
172
|
+
* @param email - The email to add
|
|
173
|
+
* @param esCache - The email cache
|
|
174
|
+
* @returns TRUE if the email was added sucessfully, or FALSE and error reason.
|
|
175
|
+
*/
|
|
176
|
+
declare const addEmailToCache: (email: Email, esCache: MailCache<Email>) => {
|
|
177
|
+
success: boolean;
|
|
178
|
+
reason?: string;
|
|
179
|
+
};
|
|
180
|
+
//#endregion
|
|
181
|
+
//#region src/email-search/search.d.ts
|
|
182
|
+
interface EmailSearchIndex {
|
|
183
|
+
subjectIndex: Index;
|
|
184
|
+
bodyIndex: Index;
|
|
185
|
+
fromIndex: Index;
|
|
186
|
+
toIndex: Index;
|
|
187
|
+
isReady: boolean;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Adds the given email to the email search index
|
|
191
|
+
*
|
|
192
|
+
* @param email - The email to add
|
|
193
|
+
* @param searchIndex - The email search index
|
|
194
|
+
*/
|
|
195
|
+
declare const addEmailToSearchIndex: (email: Email, searchIndex: EmailSearchIndex) => void;
|
|
196
|
+
/**
|
|
197
|
+
* Removes the email from the email search index
|
|
198
|
+
*
|
|
199
|
+
* @param emailID - The email identifier
|
|
200
|
+
* @param searchIndex - The email search index
|
|
201
|
+
*/
|
|
202
|
+
declare const removeEmailFromSearchIndex: (emailID: string, searchIndex: EmailSearchIndex) => void;
|
|
203
|
+
/**
|
|
204
|
+
* Buils the email search index from the email cache
|
|
205
|
+
*
|
|
206
|
+
* @param esCache - The email cache
|
|
207
|
+
* @returns The email search index
|
|
208
|
+
*/
|
|
209
|
+
declare const buildSearchIndexFromCache: (esCache: MailCache<Email>) => Promise<EmailSearchIndex>;
|
|
210
|
+
interface SearchOptions {
|
|
211
|
+
fields?: ('subject' | 'body' | 'from' | 'to')[];
|
|
212
|
+
limit?: number;
|
|
213
|
+
boost?: {
|
|
214
|
+
subject?: number;
|
|
215
|
+
body?: number;
|
|
216
|
+
from?: number;
|
|
217
|
+
to?: number;
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Searches in teh
|
|
222
|
+
*
|
|
223
|
+
* @param query - The string to search for
|
|
224
|
+
* @param esCache - The email cache
|
|
225
|
+
* @param searchIndex - The email search index
|
|
226
|
+
* @param opetions - The optional search limitations
|
|
227
|
+
* @returns The result of the email search (emails ans their corresponding result weights)
|
|
228
|
+
*/
|
|
229
|
+
declare const searchEmails: (query: string, esCache: MailCache<Email>, searchIndex: EmailSearchIndex, options?: SearchOptions) => Promise<EmailSearchResult[]>;
|
|
230
|
+
declare namespace index_d_exports {
|
|
231
|
+
export { EmailSearchIndex, EncryptedSearchDB, MailDB, SearchOptions, addEmailToCache, addEmailToSearchIndex, addEmailsToCache, buildSearchIndexFromCache, closeDatabase, createCacheFromDB, deleteDatabase, deleteEmail, deleteEmailFromCache, deleteOldestEmails, deriveIndexKey, encryptAndStoreEmail, encryptAndStoreManyEmail, enforceMaxEmailNumber, getAllEmailsSortedNewestFirst, getAllEmailsSortedOldestFirst, getAndDecryptAllEmails, getAndDecryptEmail, getEmailBatch, getEmailCount, getEmailFromCache, openDatabase, removeEmailFromSearchIndex, searchEmails };
|
|
232
|
+
}
|
|
233
|
+
//#endregion
|
|
234
|
+
export { EmailSearchIndex, EncryptedSearchDB, MailDB, SearchOptions, addEmailToCache, addEmailToSearchIndex, addEmailsToCache, buildSearchIndexFromCache, closeDatabase, createCacheFromDB, deleteDatabase, deleteEmail, deleteEmailFromCache, deleteOldestEmails, deriveIndexKey, encryptAndStoreEmail, encryptAndStoreManyEmail, enforceMaxEmailNumber, getAllEmailsSortedNewestFirst, getAllEmailsSortedOldestFirst, getAndDecryptAllEmails, getAndDecryptEmail, getEmailBatch, getEmailCount, getEmailFromCache, openDatabase, removeEmailFromSearchIndex, searchEmails, index_d_exports as t };
|
|
235
|
+
//# sourceMappingURL=email-search.d.mts.map
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { f as MailCache, s as EmailSearchResult, t as Email, y as StoredEmail } from "./types-Ds3ivE9W.js";
|
|
2
|
+
import { DBSchema, IDBPDatabase } from "idb";
|
|
3
|
+
import { Index } from "flexsearch";
|
|
4
|
+
|
|
5
|
+
//#region src/email-search/indexedDB.d.ts
|
|
6
|
+
type MailDB = IDBPDatabase<EncryptedSearchDB>;
|
|
7
|
+
interface EncryptedSearchDB extends DBSchema {
|
|
8
|
+
email: {
|
|
9
|
+
key: string;
|
|
10
|
+
value: StoredEmail;
|
|
11
|
+
indexes: {
|
|
12
|
+
byTime: number[];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Opens IndexedDB database for the given user
|
|
18
|
+
*
|
|
19
|
+
* @param userID - The user ID
|
|
20
|
+
* @returns The database
|
|
21
|
+
*/
|
|
22
|
+
declare const openDatabase: (userID: string) => Promise<MailDB>;
|
|
23
|
+
/**
|
|
24
|
+
* Closes the IndexedDB database
|
|
25
|
+
*
|
|
26
|
+
* @param esDB - The database
|
|
27
|
+
*/
|
|
28
|
+
declare const closeDatabase: (esDB: MailDB) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Deletes IndexedDB database for the given user
|
|
31
|
+
*
|
|
32
|
+
* @param userID - The user ID
|
|
33
|
+
* @returns The database
|
|
34
|
+
*/
|
|
35
|
+
declare const deleteDatabase: (userID: string) => Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Derives database encryption key for the given user
|
|
38
|
+
*
|
|
39
|
+
* @param userID - The user ID
|
|
40
|
+
* @returns The symmetric CryptoKey for protecting database
|
|
41
|
+
*/
|
|
42
|
+
declare const deriveIndexKey: (baseKey: Uint8Array) => Promise<CryptoKey>;
|
|
43
|
+
/**
|
|
44
|
+
* Encrypts the given email and stores it in the IndexedDB database
|
|
45
|
+
*
|
|
46
|
+
* @param newEmailToStore - The email for storing
|
|
47
|
+
* @param indexKey - The symmetric CryptoKey key for protecting database
|
|
48
|
+
* @param esDB - The database
|
|
49
|
+
*/
|
|
50
|
+
declare const encryptAndStoreEmail: (newEmailToStore: Email, indexKey: CryptoKey, esDB: MailDB) => Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Encrypts the given set of emails and stores it in the IndexedDB database
|
|
53
|
+
*
|
|
54
|
+
* @param newEmailsToStore - The set of emails for storing
|
|
55
|
+
* @param indexKey - The symmetric CryptoKey key for protecting database
|
|
56
|
+
* @param esDB - The database
|
|
57
|
+
*/
|
|
58
|
+
declare const encryptAndStoreManyEmail: (newEmailsToStore: Email[], indexKey: CryptoKey, esDB: MailDB) => Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* Fetches the email from the database and decrypts it
|
|
61
|
+
*
|
|
62
|
+
* @param emailID - The email identifier
|
|
63
|
+
* @param indexKey - The symmetric CryptoKey key for protecting database
|
|
64
|
+
* @param encryptedEmail - The encrypted email
|
|
65
|
+
* @returns The decrypted email
|
|
66
|
+
*/
|
|
67
|
+
declare const getAndDecryptEmail: (emailID: string, indexKey: CryptoKey, esDB: MailDB) => Promise<Email>;
|
|
68
|
+
/**
|
|
69
|
+
* Fetches all email from the database and decrypts them
|
|
70
|
+
*
|
|
71
|
+
* @param indexKey - The symmetric CryptoKey key for protecting database
|
|
72
|
+
* @param esDB - The database
|
|
73
|
+
* @returns The decrypted emails
|
|
74
|
+
*/
|
|
75
|
+
declare const getAndDecryptAllEmails: (indexKey: CryptoKey, esDB: MailDB) => Promise<Email[]>;
|
|
76
|
+
/**
|
|
77
|
+
* Deletes the email from the database
|
|
78
|
+
*
|
|
79
|
+
* @param emailID - The email identifier
|
|
80
|
+
* @param esDB - The database
|
|
81
|
+
*/
|
|
82
|
+
declare const deleteEmail: (emailID: string, esDB: MailDB) => Promise<void>;
|
|
83
|
+
/**
|
|
84
|
+
* Returns the number of stored email
|
|
85
|
+
*
|
|
86
|
+
* @param esDB - The database
|
|
87
|
+
* @returns The number of stored emails
|
|
88
|
+
*/
|
|
89
|
+
declare const getEmailCount: (esDB: MailDB) => Promise<number>;
|
|
90
|
+
/**
|
|
91
|
+
* Removes the given number of oldests emails from the database
|
|
92
|
+
*
|
|
93
|
+
* @param emailsToDelete - The number of emails to delete
|
|
94
|
+
* @param esDB - The database
|
|
95
|
+
*/
|
|
96
|
+
declare const deleteOldestEmails: (emailsToDelete: number, esDB: MailDB) => Promise<void>;
|
|
97
|
+
/**
|
|
98
|
+
* Enforces the maximum email number in the database
|
|
99
|
+
*
|
|
100
|
+
* @param esDB - The database
|
|
101
|
+
* @param max - The maximum allowed number of emails
|
|
102
|
+
*/
|
|
103
|
+
declare const enforceMaxEmailNumber: (esDB: MailDB, max: number) => Promise<void>;
|
|
104
|
+
/**
|
|
105
|
+
* Fetches all emails from the database, decrypts them and sortes the results based on the creation time (newest first)
|
|
106
|
+
*
|
|
107
|
+
* @param esDB - The database
|
|
108
|
+
* @param indexKey - The symmetric CryptoKey key for protecting database
|
|
109
|
+
* @returns The number of stored emails
|
|
110
|
+
*/
|
|
111
|
+
declare const getAllEmailsSortedNewestFirst: (esDB: MailDB, indexKey: CryptoKey) => Promise<Email[]>;
|
|
112
|
+
/**
|
|
113
|
+
* Fetches all emails from the database, decrypts them and sortes the results based on the creation time (oldest first)
|
|
114
|
+
*
|
|
115
|
+
* @param esDB - The database
|
|
116
|
+
* @param indexKey - The symmetric CryptoKey key for protecting database
|
|
117
|
+
* @returns The number of stored emails
|
|
118
|
+
*/
|
|
119
|
+
declare const getAllEmailsSortedOldestFirst: (esDB: MailDB, indexKey: CryptoKey) => Promise<Email[]>;
|
|
120
|
+
/**
|
|
121
|
+
* Fetches a batch of emails from the database, decrypts them and sortes the results based on the creation time (newest first)
|
|
122
|
+
*
|
|
123
|
+
* @param esDB - The database
|
|
124
|
+
* @param indexKey - The symmetric CryptoKey key for protecting database
|
|
125
|
+
* @param batchSize - The size of the batch
|
|
126
|
+
* @param startCursor - The starting point (optional). If not given, starts from the beginning
|
|
127
|
+
* @returns The number of stored emails
|
|
128
|
+
*/
|
|
129
|
+
declare const getEmailBatch: (esDB: MailDB, indexKey: CryptoKey, batchSize: number, startCursor?: IDBValidKey) => Promise<{
|
|
130
|
+
emails: Email[];
|
|
131
|
+
nextCursor?: IDBValidKey;
|
|
132
|
+
}>;
|
|
133
|
+
//#endregion
|
|
134
|
+
//#region src/email-search/mailCache.d.ts
|
|
135
|
+
/**
|
|
136
|
+
* Fetches all emails from the database in batches and cahces them
|
|
137
|
+
*
|
|
138
|
+
* @param indexKey - The symmetric CryptoKey key for protecting database
|
|
139
|
+
* @param esCache - The cache to add emails too
|
|
140
|
+
* @param esDB - The database
|
|
141
|
+
*/
|
|
142
|
+
declare const createCacheFromDB: (indexKey: CryptoKey, esDB: MailDB) => Promise<MailCache<Email>>;
|
|
143
|
+
/**
|
|
144
|
+
* Gets an email from the cache
|
|
145
|
+
*
|
|
146
|
+
* @param emailID - The email identifier
|
|
147
|
+
* @param esCache - The email cache
|
|
148
|
+
* @returns The found email or throws an error
|
|
149
|
+
*/
|
|
150
|
+
declare const getEmailFromCache: (emailID: string, esCache: MailCache<Email>) => Promise<Email>;
|
|
151
|
+
/**
|
|
152
|
+
* Removes the email from cache
|
|
153
|
+
*
|
|
154
|
+
* @param emailID - The email identifier
|
|
155
|
+
* @param esCache - The email cache
|
|
156
|
+
*/
|
|
157
|
+
declare const deleteEmailFromCache: (emailID: string, esCache: MailCache<Email>) => Promise<void>;
|
|
158
|
+
/**
|
|
159
|
+
* Adds emails to the cache
|
|
160
|
+
*
|
|
161
|
+
* @param emails - The emails to add
|
|
162
|
+
* @param esCache - The email cache
|
|
163
|
+
* @returns TRUE if all emails were added sucessfully, or FALSE and error reason.
|
|
164
|
+
*/
|
|
165
|
+
declare function addEmailsToCache(emails: Email[], esCache: MailCache<Email>): {
|
|
166
|
+
success: boolean;
|
|
167
|
+
reason?: string;
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* Adds email to the cache
|
|
171
|
+
*
|
|
172
|
+
* @param email - The email to add
|
|
173
|
+
* @param esCache - The email cache
|
|
174
|
+
* @returns TRUE if the email was added sucessfully, or FALSE and error reason.
|
|
175
|
+
*/
|
|
176
|
+
declare const addEmailToCache: (email: Email, esCache: MailCache<Email>) => {
|
|
177
|
+
success: boolean;
|
|
178
|
+
reason?: string;
|
|
179
|
+
};
|
|
180
|
+
//#endregion
|
|
181
|
+
//#region src/email-search/search.d.ts
|
|
182
|
+
interface EmailSearchIndex {
|
|
183
|
+
subjectIndex: Index;
|
|
184
|
+
bodyIndex: Index;
|
|
185
|
+
fromIndex: Index;
|
|
186
|
+
toIndex: Index;
|
|
187
|
+
isReady: boolean;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Adds the given email to the email search index
|
|
191
|
+
*
|
|
192
|
+
* @param email - The email to add
|
|
193
|
+
* @param searchIndex - The email search index
|
|
194
|
+
*/
|
|
195
|
+
declare const addEmailToSearchIndex: (email: Email, searchIndex: EmailSearchIndex) => void;
|
|
196
|
+
/**
|
|
197
|
+
* Removes the email from the email search index
|
|
198
|
+
*
|
|
199
|
+
* @param emailID - The email identifier
|
|
200
|
+
* @param searchIndex - The email search index
|
|
201
|
+
*/
|
|
202
|
+
declare const removeEmailFromSearchIndex: (emailID: string, searchIndex: EmailSearchIndex) => void;
|
|
203
|
+
/**
|
|
204
|
+
* Buils the email search index from the email cache
|
|
205
|
+
*
|
|
206
|
+
* @param esCache - The email cache
|
|
207
|
+
* @returns The email search index
|
|
208
|
+
*/
|
|
209
|
+
declare const buildSearchIndexFromCache: (esCache: MailCache<Email>) => Promise<EmailSearchIndex>;
|
|
210
|
+
interface SearchOptions {
|
|
211
|
+
fields?: ('subject' | 'body' | 'from' | 'to')[];
|
|
212
|
+
limit?: number;
|
|
213
|
+
boost?: {
|
|
214
|
+
subject?: number;
|
|
215
|
+
body?: number;
|
|
216
|
+
from?: number;
|
|
217
|
+
to?: number;
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Searches in teh
|
|
222
|
+
*
|
|
223
|
+
* @param query - The string to search for
|
|
224
|
+
* @param esCache - The email cache
|
|
225
|
+
* @param searchIndex - The email search index
|
|
226
|
+
* @param opetions - The optional search limitations
|
|
227
|
+
* @returns The result of the email search (emails ans their corresponding result weights)
|
|
228
|
+
*/
|
|
229
|
+
declare const searchEmails: (query: string, esCache: MailCache<Email>, searchIndex: EmailSearchIndex, options?: SearchOptions) => Promise<EmailSearchResult[]>;
|
|
230
|
+
declare namespace index_d_exports {
|
|
231
|
+
export { EmailSearchIndex, EncryptedSearchDB, MailDB, SearchOptions, addEmailToCache, addEmailToSearchIndex, addEmailsToCache, buildSearchIndexFromCache, closeDatabase, createCacheFromDB, deleteDatabase, deleteEmail, deleteEmailFromCache, deleteOldestEmails, deriveIndexKey, encryptAndStoreEmail, encryptAndStoreManyEmail, enforceMaxEmailNumber, getAllEmailsSortedNewestFirst, getAllEmailsSortedOldestFirst, getAndDecryptAllEmails, getAndDecryptEmail, getEmailBatch, getEmailCount, getEmailFromCache, openDatabase, removeEmailFromSearchIndex, searchEmails };
|
|
232
|
+
}
|
|
233
|
+
//#endregion
|
|
234
|
+
export { EmailSearchIndex, EncryptedSearchDB, MailDB, SearchOptions, addEmailToCache, addEmailToSearchIndex, addEmailsToCache, buildSearchIndexFromCache, closeDatabase, createCacheFromDB, deleteDatabase, deleteEmail, deleteEmailFromCache, deleteOldestEmails, deriveIndexKey, encryptAndStoreEmail, encryptAndStoreManyEmail, enforceMaxEmailNumber, getAllEmailsSortedNewestFirst, getAllEmailsSortedOldestFirst, getAndDecryptAllEmails, getAndDecryptEmail, getEmailBatch, getEmailCount, getEmailFromCache, openDatabase, removeEmailFromSearchIndex, searchEmails, index_d_exports as t };
|
|
235
|
+
//# sourceMappingURL=email-search.d.ts.map
|