Skip to content

Commit 04634c9

Browse files
aditi-khare-mongoDBbaileympearson
authored andcommitted
src code changes
1 parent 6dd5406 commit 04634c9

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

types/schematypes.d.ts

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BSON } from 'bson';
1+
import * as BSON from 'bson';
22

33
declare module 'mongoose' {
44

@@ -237,6 +237,28 @@ declare module 'mongoose' {
237237

238238
type ValidatorFunction<DocType = any> = (this: DocType, value: any, validatorProperties?: Validator) => any;
239239

240+
export interface EncryptSchemaTypeOptions {
241+
/** The id of the dataKey to use for encryption */
242+
keyId: BSON.UUID;
243+
244+
/**
245+
* Specifies the type of queries that the field can be queried on for Queryable Encryption.
246+
* Required when `SchemaOptions.encryptionType` is 'queryableEncryption'
247+
*/
248+
queries?: 'equality' | 'range';
249+
250+
/**
251+
* The algorithm to use for encryption.
252+
* Required when `SchemaOptions.encryptionType` is 'csfle'
253+
*/
254+
algorithm?:
255+
| 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic'
256+
| 'AEAD_AES_256_CBC_HMAC_SHA_512-Random'
257+
| 'Indexed'
258+
| 'Unindexed'
259+
| 'Range';
260+
}
261+
240262
class SchemaType<T = any, DocType = any> {
241263
/** SchemaType constructor */
242264
constructor(path: string, options?: AnyObject, instance?: string);

0 commit comments

Comments
 (0)