@@ -591,14 +591,14 @@ export class ClientEncryption {
591
591
field == null || typeof field !== 'object' || field . keyId != null
592
592
? field
593
593
: {
594
- ...field ,
595
- keyId : await this . createDataKey ( provider , {
596
- masterKey,
597
- // clone the timeoutContext
598
- // in order to avoid sharing the same timeout for server selection and connection checkout across different concurrent operations
599
- timeoutContext : timeoutContext ?. csotEnabled ( ) ? timeoutContext ?. clone ( ) : undefined
600
- } )
601
- }
594
+ ...field ,
595
+ keyId : await this . createDataKey ( provider , {
596
+ masterKey,
597
+ // clone the timeoutContext
598
+ // in order to avoid sharing the same timeout for server selection and connection checkout across different concurrent operations
599
+ timeoutContext : timeoutContext ?. csotEnabled ( ) ? timeoutContext ?. clone ( ) : undefined
600
+ } )
601
+ }
602
602
) ;
603
603
const createDataKeyResolutions = await Promise . allSettled ( createDataKeyPromises ) ;
604
604
@@ -784,7 +784,6 @@ export class ClientEncryption {
784
784
}
785
785
786
786
if ( typeof textOptions === 'object' ) {
787
- // @ts -expect-error errors until mongodb-client-encryption release
788
787
contextOptions . textOptions = serialize ( textOptions ) ;
789
788
}
790
789
@@ -814,12 +813,12 @@ export interface ClientEncryptionEncryptOptions {
814
813
* The algorithm to use for encryption.
815
814
*/
816
815
algorithm :
817
- | 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic'
818
- | 'AEAD_AES_256_CBC_HMAC_SHA_512-Random'
819
- | 'Indexed'
820
- | 'Unindexed'
821
- | 'Range'
822
- | 'TextPreview' ;
816
+ | 'AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic'
817
+ | 'AEAD_AES_256_CBC_HMAC_SHA_512-Random'
818
+ | 'Indexed'
819
+ | 'Unindexed'
820
+ | 'Range'
821
+ | 'TextPreview' ;
823
822
824
823
/**
825
824
* The id of the Binary dataKey to use for encryption
@@ -842,26 +841,45 @@ export interface ClientEncryptionEncryptOptions {
842
841
/** The index options for a Queryable Encryption field supporting "range" queries.*/
843
842
rangeOptions ?: RangeOptions ;
844
843
844
+ /**
845
+ * Options for a Queryable Encryption field supporting text queries. Only valid when `algorithm` is `TextPreview`.
846
+ *
847
+ * @experimental Public Technical Preview: `textPreview` is an experimental feature and may break at any time.
848
+ */
845
849
textOptions ?: TextQueryOptions ;
846
850
}
847
851
852
+ /**
853
+ * Options for a Queryable Encryption field supporting text queries.
854
+ *
855
+ * @experimental Public Technical Preview: `textPreview` is an experimental feature and may break at any time.
856
+ */
848
857
interface TextQueryOptions {
858
+ /** Indicates that text indexes for this field are case sensitive */
849
859
caseSensitive : boolean ;
860
+ /** Indicates that text indexes for this field are diacritic sensitive. */
850
861
diacriticSensitive : boolean ;
851
862
852
863
prefix ?: {
864
+ /** The maximum allowed query length. */
853
865
strMaxQueryLength : Int32 | number ;
866
+ /** The minimum allowed query length. */
854
867
strMinQueryLength : Int32 | number ;
855
868
} ;
856
869
857
870
suffix ?: {
871
+ /** The maximum allowed query length. */
858
872
strMaxQueryLength : Int32 | number ;
873
+ /** The minimum allowed query length. */
859
874
strMinQueryLength : Int32 | number ;
860
875
} ;
861
876
862
877
substring ?: {
878
+ /** The maximum allowed length to insert. */
863
879
strMaxLength : Int32 | number ;
880
+ /** The maximum allowed query length. */
864
881
strMaxQueryLength : Int32 | number ;
882
+ /** The minimum allowed query length. */
865
883
strMinQueryLength : Int32 | number ;
866
884
} ;
867
885
}
@@ -873,11 +891,11 @@ interface TextQueryOptions {
873
891
export interface ClientEncryptionRewrapManyDataKeyProviderOptions {
874
892
provider : ClientEncryptionDataKeyProvider ;
875
893
masterKey ?:
876
- | AWSEncryptionKeyOptions
877
- | AzureEncryptionKeyOptions
878
- | GCPEncryptionKeyOptions
879
- | KMIPEncryptionKeyOptions
880
- | undefined ;
894
+ | AWSEncryptionKeyOptions
895
+ | AzureEncryptionKeyOptions
896
+ | GCPEncryptionKeyOptions
897
+ | KMIPEncryptionKeyOptions
898
+ | undefined ;
881
899
}
882
900
883
901
/**
@@ -1066,11 +1084,11 @@ export interface ClientEncryptionCreateDataKeyProviderOptions {
1066
1084
* Identifies a new KMS-specific key used to encrypt the new data key
1067
1085
*/
1068
1086
masterKey ?:
1069
- | AWSEncryptionKeyOptions
1070
- | AzureEncryptionKeyOptions
1071
- | GCPEncryptionKeyOptions
1072
- | KMIPEncryptionKeyOptions
1073
- | undefined ;
1087
+ | AWSEncryptionKeyOptions
1088
+ | AzureEncryptionKeyOptions
1089
+ | GCPEncryptionKeyOptions
1090
+ | KMIPEncryptionKeyOptions
1091
+ | undefined ;
1074
1092
1075
1093
/**
1076
1094
* An optional list of string alternate names used to reference a key.
0 commit comments