diff --git a/addon/mongocrypt.cc b/addon/mongocrypt.cc index 37c58da..b8242f1 100644 --- a/addon/mongocrypt.cc +++ b/addon/mongocrypt.cc @@ -1,6 +1,7 @@ #include "mongocrypt.h" #include +#include #ifdef _MSC_VER #define strncasecmp _strnicmp @@ -724,6 +725,16 @@ Value MongoCrypt::MakeExplicitEncryptionContextInternal( } } + if (options.Has("textOptions")) { + Uint8Array textOptionsArray = Uint8ArrayFromValue(options["textOptions"], "textOptions"); + + std::unique_ptr binary( + Uint8ArrayToBinary(textOptionsArray)); + if (!mongocrypt_ctx_setopt_algorithm_text(context.get(), binary.get())) { + throw TypeError::New(Env(), errorStringFromStatus(context.get())); + } + } + std::unique_ptr binaryValue( Uint8ArrayToBinary(valueBuffer)); diff --git a/package.json b/package.json index 4910343..a1dc7c3 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ }, "license": "Apache-2.0", "gypfile": true, - "mongodb:libmongocrypt": "1.14.0", + "mongodb:libmongocrypt": "1.15.0", "dependencies": { "node-addon-api": "^4.3.0", "prebuild-install": "^7.1.3" @@ -96,4 +96,4 @@ "moduleResolution": "node" } } -} +} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index ad03fab..e8752da 100644 --- a/src/index.ts +++ b/src/index.ts @@ -87,6 +87,7 @@ export interface MongoCrypt { keyAltName?: Uint8Array; algorithm?: string; rangeOptions?: Uint8Array; + textOptions?: Uint8Array; contentionFactor?: bigint | number; queryType?: string;