From 613f572b676365ac80c26f5a3ba3489c2ae0d29a Mon Sep 17 00:00:00 2001 From: Bailey Pearson Date: Mon, 6 Feb 2023 11:16:52 -0500 Subject: [PATCH] fix(NODE-5041): replace `rangeOpts` with `rangeOptions` in Typescript definitions (#557) --- bindings/node/index.d.ts | 4 ++-- bindings/node/test/types/index.test-d.ts | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/bindings/node/index.d.ts b/bindings/node/index.d.ts index d26cde64b..91ef14794 100644 --- a/bindings/node/index.d.ts +++ b/bindings/node/index.d.ts @@ -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. */ @@ -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; } /** diff --git a/bindings/node/test/types/index.test-d.ts b/bindings/node/test/types/index.test-d.ts index 561ece865..c573854f8 100644 --- a/bindings/node/test/types/index.test-d.ts +++ b/bindings/node/test/types/index.test-d.ts @@ -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'] @@ -28,3 +28,9 @@ expectAssignable({ createCollectionOptions: { encryptedFields: {} }, masterKey: { } as AWSEncryptionKeyOptions | AzureEncryptionKeyOptions | GCPEncryptionKeyOptions }); + +{ + // NODE-5041 - incorrect spelling of rangeOpts in typescript definitions + const options = {} as ClientEncryptionEncryptOptions; + expectType(options.rangeOptions) +}