You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -369,7 +370,7 @@ new ClientEncryption(mongoClient, {
369
370
|[options]| <code>object</code> | Options for creating the data key |
370
371
|[options.masterKey]|[<code>AWSEncryptionKeyOptions</code>](#AWSEncryptionKeyOptions)\|[<code>AzureEncryptionKeyOptions</code>](#AzureEncryptionKeyOptions)\|[<code>GCPEncryptionKeyOptions</code>](#GCPEncryptionKeyOptions)| Idenfities a new KMS-specific key used to encrypt the new data key |
371
372
|[options.keyAltNames]| <code>Array.<string></code> | An optional list of string alternate names used to reference a key. If a key is created with alternate names, then encryption may refer to the key by the unique alternate name instead of by _id. |
372
-
|[callback]|[<code>ClientEncryptionCreateDataKeyCallback</code>](#ClientEncryptionCreateDataKeyCallback)| Optional callback to invoke when key is created |
373
+
|[callback]|[<code>ClientEncryptionCreateDataKeyCallback</code>](#ClientEncryptionCreateDataKeyCallback)|DEPRECATED - Callbacks will be removed in the next major version. Optional callback to invoke when key is created |
373
374
374
375
Creates a data key used for explicit encryption and inserts it into the key vault namespace
375
376
@@ -606,7 +607,7 @@ and then create a new collection with the full set of encryptedFields.
606
607
| --- | --- | --- |
607
608
| value | <code>\*</code> | The value that you wish to serialize. Must be of a type that can be serialized into BSON |
|[callback]|[<code>ClientEncryptionEncryptCallback</code>](#ClientEncryptionEncryptCallback)| Optional callback to invoke when value is encrypted |
610
+
|[callback]|[<code>ClientEncryptionEncryptCallback</code>](#ClientEncryptionEncryptCallback)|DEPRECATED: Callbacks will be removed in the next major version. Optional callback to invoke when value is encrypted |
610
611
611
612
Explicitly encrypt a provided value. Note that either `options.keyId` or `options.keyAltName` must
612
613
be specified. Specifying both `options.keyId` and `options.keyAltName` is considered an error.
@@ -662,7 +663,7 @@ Only supported when queryType is "rangePreview" and algorithm is "RangePreview".
662
663
| Param | Type | Description |
663
664
| --- | --- | --- |
664
665
| value | <code>Buffer</code> \| <code>Binary</code> | An encrypted value |
665
-
| callback |[<code>decryptCallback</code>](#ClientEncryption..decryptCallback)| Optional callback to invoke when value is decrypted |
666
+
| callback |[<code>decryptCallback</code>](#ClientEncryption..decryptCallback)|DEPRECATED - Callbacks will be removed in the next major version. Optional callback to invoke when value is decrypted |
666
667
667
668
Explicitly decrypt a provided encrypted value
668
669
@@ -692,7 +693,9 @@ the original ones.
692
693
693
694
<aname="ClientEncryption..decryptCallback"></a>
694
695
695
-
### *ClientEncryption*~decryptCallback
696
+
### ~~*ClientEncryption*~decryptCallback~~
697
+
***Deprecated***
698
+
696
699
697
700
| Param | Type | Description |
698
701
| --- | --- | --- |
@@ -701,22 +704,30 @@ the original ones.
701
704
702
705
<aname="MongoCryptError"></a>
703
706
704
-
## MongoCryptError
707
+
## ~~MongoCryptError~~
708
+
***Deprecated***
709
+
705
710
An error indicating that something went wrong specifically with MongoDB Client Encryption
706
711
707
712
<aname="MongoCryptCreateDataKeyError"></a>
708
713
709
-
## MongoCryptCreateDataKeyError
714
+
## ~~MongoCryptCreateDataKeyError~~
715
+
***Deprecated***
716
+
710
717
An error indicating that `ClientEncryption.createEncryptedCollection()` failed to create data keys
Copy file name to clipboardExpand all lines: bindings/node/lib/clientEncryption.js
+14-3
Original file line number
Diff line number
Diff line change
@@ -73,6 +73,9 @@ module.exports = function (modules) {
73
73
*/
74
74
75
75
/**
76
+
* @deprecated This class will be moved into the [Node driver](https://github.com/mongodb/node-mongodb-native)
77
+
* in the next major version and in the next major version must be imported from the driver.
78
+
*
76
79
* The public interface for explicit in-use encryption
77
80
*/
78
81
classClientEncryption{
@@ -138,6 +141,8 @@ module.exports = function (modules) {
138
141
*/
139
142
140
143
/**
144
+
* @deprecated Callback overloads are deprecated and will be removed in the next major version. Please
145
+
* use the Promise overloads instead.
141
146
* @callback ClientEncryptionCreateDataKeyCallback
142
147
* @param {Error} [error] If present, indicates an error that occurred in the creation of the data key
143
148
* @param {ClientEncryption~dataKeyId} [dataKeyId] If present, returns the id of the created data key
@@ -174,7 +179,7 @@ module.exports = function (modules) {
174
179
* @param {object} [options] Options for creating the data key
175
180
* @param {AWSEncryptionKeyOptions|AzureEncryptionKeyOptions|GCPEncryptionKeyOptions} [options.masterKey] Idenfities a new KMS-specific key used to encrypt the new data key
176
181
* @param {string[]} [options.keyAltNames] An optional list of string alternate names used to reference a key. If a key is created with alternate names, then encryption may refer to the key by the unique alternate name instead of by _id.
177
-
* @param {ClientEncryptionCreateDataKeyCallback} [callback] Optional callback to invoke when key is created
182
+
* @param {ClientEncryptionCreateDataKeyCallback} [callback] DEPRECATED - Callbacks will be removed in the next major version. Optional callback to invoke when key is created
178
183
* @returns {Promise|void} If no callback is provided, returns a Promise that either resolves with {@link ClientEncryption~dataKeyId the id of the created data key}, or rejects with an error. If a callback is provided, returns nothing.
179
184
* @example
180
185
* // Using callbacks to create a local key
@@ -613,6 +618,9 @@ module.exports = function (modules) {
613
618
}
614
619
615
620
/**
621
+
* @deprecated Callback overloads are deprecated and will be removed in the next major version. Please
622
+
* use the Promise overloads instead.
623
+
*
616
624
* @callback ClientEncryptionEncryptCallback
617
625
* @param {Error} [err] If present, indicates an error that occurred in the process of encryption
618
626
* @param {Buffer} [result] If present, is the encrypted result
@@ -644,7 +652,7 @@ module.exports = function (modules) {
644
652
*
645
653
* @param {*} value The value that you wish to serialize. Must be of a type that can be serialized into BSON
646
654
* @param {EncryptOptions} options
647
-
* @param {ClientEncryptionEncryptCallback} [callback] Optional callback to invoke when value is encrypted
655
+
* @param {ClientEncryptionEncryptCallback} [callback] DEPRECATED: Callbacks will be removed in the next major version. Optional callback to invoke when value is encrypted
648
656
* @returns {Promise|void} If no callback is provided, returns a Promise that either resolves with the encrypted value, or rejects with an error. If a callback is provided, returns nothing.
649
657
*
650
658
* @example
@@ -699,6 +707,9 @@ module.exports = function (modules) {
699
707
}
700
708
701
709
/**
710
+
* @deprecated Callback overloads are deprecated and will be removed in the next major version. Please
711
+
* use the Promise overloads instead.
712
+
*
702
713
* @callback ClientEncryption~decryptCallback
703
714
* @param {Error} [err] If present, indicates an error that occurred in the process of decryption
704
715
* @param {object} [result] If present, is the decrypted result
@@ -708,7 +719,7 @@ module.exports = function (modules) {
708
719
* Explicitly decrypt a provided encrypted value
709
720
*
710
721
* @param {Buffer | Binary} value An encrypted value
711
-
* @param {ClientEncryption~decryptCallback} callback Optional callback to invoke when value is decrypted
722
+
* @param {ClientEncryption~decryptCallback} callback DEPRECATED - Callbacks will be removed in the next major version. Optional callback to invoke when value is decrypted
712
723
* @returns {Promise|void} If no callback is provided, returns a Promise that either resolves with the decrypted value, or rejects with an error. If a callback is provided, returns nothing.
0 commit comments