Skip to content

Commit cb522bf

Browse files
authored
fix(NODE-7247): clarify #rewrapManyDataKey() parameter types (#4760)
1 parent ec996e6 commit cb522bf

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
"check:eslint": "npm run build:dts && ESLINT_USE_FLAT_CONFIG=false eslint -v && ESLINT_USE_FLAT_CONFIG=false eslint --max-warnings=0 --ext '.js,.ts' src test",
137137
"check:tsd": "tsd --version && tsd",
138138
"check:dependencies": "mocha test/action/dependency.test.ts",
139-
"check:dts": "node ./node_modules/typescript/bin/tsc --target es2015 --module node16 --noEmit mongodb.d.ts && tsd",
139+
"check:dts": "node ./node_modules/typescript/bin/tsc --target es2023 --module commonjs --noEmit mongodb.d.ts && tsd",
140140
"check:search-indexes": "nyc mocha --config test/mocha_mongodb.js test/manual/search-index-management.prose.test.ts",
141141
"check:test": "mocha --config test/mocha_mongodb.js test/integration",
142142
"check:unit": "nyc mocha test/unit",

src/client-side-encryption/client_encryption.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ export class ClientEncryption {
285285
*/
286286
async rewrapManyDataKey(
287287
filter: Filter<DataKey>,
288-
options: ClientEncryptionRewrapManyDataKeyProviderOptions
288+
options?: ClientEncryptionRewrapManyDataKeyProviderOptions
289289
): Promise<{ bulkWriteResult?: BulkWriteResult }> {
290290
let keyEncryptionKeyBson = undefined;
291291
if (options) {

test/types/client-side-encryption.test-d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,9 @@ expectAssignable<RequiredCreateEncryptedCollectionSettings>({
157157
}
158158
});
159159
}
160+
161+
declare const clientEncryption: ClientEncryption;
162+
{
163+
await clientEncryption.rewrapManyDataKey({});
164+
await clientEncryption.rewrapManyDataKey({}, { provider: 'aws' });
165+
}

0 commit comments

Comments
 (0)