Skip to content

Commit

Permalink
fix(NODE-5041): replace rangeOpts with rangeOptions in Typescript…
Browse files Browse the repository at this point in the history
… definitions (#557)
  • Loading branch information
baileympearson authored Feb 6, 2023
1 parent 4dcb3f8 commit 613f572
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions bindings/node/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ export interface ClientEncryptionRewrapManyDataKeyResult {
}

/**
* RangeOpts specifies index options for a Queryable Encryption field supporting "rangePreview" queries.
* RangeOptions specifies index options for a Queryable Encryption field supporting "rangePreview" queries.
* min, max, sparsity, and range must match the values set in the encryptedFields of the destination collection.
* For double and decimal128, min/max/precision must all be set, or all be unset.
*/
Expand Down Expand Up @@ -420,7 +420,7 @@ export interface ClientEncryptionEncryptOptions {
queryType?: 'equality' | 'rangePreview';

/** @experimental Public Technical Preview: The index options for a Queryable Encryption field supporting "rangePreview" queries.*/
rangeOpts?: RangeOptions;
rangeOptions?: RangeOptions;
}

/**
Expand Down
10 changes: 8 additions & 2 deletions bindings/node/test/types/index.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expectAssignable, expectError } from 'tsd';
import { AWSEncryptionKeyOptions, AzureEncryptionKeyOptions, ClientEncryption, GCPEncryptionKeyOptions } from '../..';
import { expectAssignable, expectError, expectType } from 'tsd';
import { RangeOptions, AWSEncryptionKeyOptions, AzureEncryptionKeyOptions, ClientEncryption, GCPEncryptionKeyOptions, ClientEncryptionEncryptOptions } from '../..';

type RequiredCreateEncryptedCollectionSettings = Parameters<
ClientEncryption['createEncryptedCollection']
Expand Down Expand Up @@ -28,3 +28,9 @@ expectAssignable<RequiredCreateEncryptedCollectionSettings>({
createCollectionOptions: { encryptedFields: {} },
masterKey: { } as AWSEncryptionKeyOptions | AzureEncryptionKeyOptions | GCPEncryptionKeyOptions
});

{
// NODE-5041 - incorrect spelling of rangeOpts in typescript definitions
const options = {} as ClientEncryptionEncryptOptions;
expectType<RangeOptions | undefined>(options.rangeOptions)
}

0 comments on commit 613f572

Please sign in to comment.