@qp-mongosh/shell-api 0.0.0-dev.5 → 0.0.0-dev.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/.eslintignore +2 -2
  2. package/.eslintrc.js +1 -1
  3. package/AUTHORS +15 -15
  4. package/LICENSE +200 -200
  5. package/bin/report-missing-help.ts +24 -24
  6. package/bin/report-supported-api.ts +14 -14
  7. package/lib/abstract-cursor.d.ts +33 -33
  8. package/lib/abstract-cursor.js +191 -191
  9. package/lib/aggregation-cursor.d.ts +6 -6
  10. package/lib/aggregation-cursor.js +19 -19
  11. package/lib/bulk.d.ts +43 -43
  12. package/lib/bulk.js +223 -223
  13. package/lib/change-stream-cursor.d.ts +28 -28
  14. package/lib/change-stream-cursor.js +111 -111
  15. package/lib/collection.d.ts +95 -95
  16. package/lib/collection.js +964 -964
  17. package/lib/cursor.d.ts +32 -32
  18. package/lib/cursor.js +215 -215
  19. package/lib/database.d.ts +116 -116
  20. package/lib/database.js +1223 -1223
  21. package/lib/dbquery.d.ts +8 -8
  22. package/lib/dbquery.js +28 -28
  23. package/lib/decorators.d.ts +73 -73
  24. package/lib/decorators.js +395 -395
  25. package/lib/deprecation-warning.d.ts +2 -0
  26. package/lib/deprecation-warning.js +19 -0
  27. package/lib/deprecation-warning.js.map +1 -0
  28. package/lib/enums.d.ts +28 -28
  29. package/lib/enums.js +33 -33
  30. package/lib/error-codes.d.ts +12 -12
  31. package/lib/error-codes.js +19 -19
  32. package/lib/explainable-cursor.d.ts +11 -11
  33. package/lib/explainable-cursor.js +31 -31
  34. package/lib/explainable.d.ts +32 -32
  35. package/lib/explainable.js +166 -166
  36. package/lib/field-level-encryption.d.ts +50 -50
  37. package/lib/field-level-encryption.js +176 -176
  38. package/lib/help.d.ts +22 -22
  39. package/lib/help.js +26 -26
  40. package/lib/helpers.d.ts +71 -71
  41. package/lib/helpers.js +588 -588
  42. package/lib/index.d.ts +16 -16
  43. package/lib/index.js +45 -45
  44. package/lib/interruptor.d.ts +19 -19
  45. package/lib/interruptor.js +62 -62
  46. package/lib/mongo-errors.d.ts +5 -5
  47. package/lib/mongo-errors.js +37 -37
  48. package/lib/mongo.d.ts +75 -75
  49. package/lib/mongo.js +476 -476
  50. package/lib/no-db.d.ts +5 -5
  51. package/lib/no-db.js +28 -28
  52. package/lib/plan-cache.d.ts +16 -16
  53. package/lib/plan-cache.js +70 -70
  54. package/lib/replica-set.d.ts +45 -45
  55. package/lib/replica-set.js +314 -314
  56. package/lib/result.d.ts +61 -61
  57. package/lib/result.js +104 -104
  58. package/lib/session.d.ts +25 -25
  59. package/lib/session.js +88 -88
  60. package/lib/shard.d.ts +42 -42
  61. package/lib/shard.js +414 -414
  62. package/lib/shell-api.d.ts +52 -52
  63. package/lib/shell-api.js +298 -298
  64. package/lib/shell-bson.d.ts +40 -40
  65. package/lib/shell-bson.js +159 -159
  66. package/lib/shell-instance-state.d.ts +77 -77
  67. package/lib/shell-instance-state.js +392 -392
  68. package/lib/shell-internal-state.d.ts +74 -0
  69. package/lib/shell-internal-state.js +364 -0
  70. package/lib/shell-internal-state.js.map +1 -0
  71. package/package.json +47 -47
  72. package/tsconfig.lint.json +8 -8
@@ -1,167 +1,167 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __importDefault = (this && this.__importDefault) || function (mod) {
9
- return (mod && mod.__esModule) ? mod : { "default": mod };
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const explainable_cursor_1 = __importDefault(require("./explainable-cursor"));
13
- const decorators_1 = require("./decorators");
14
- const enums_1 = require("./enums");
15
- const helpers_1 = require("./helpers");
16
- let Explainable = class Explainable extends decorators_1.ShellApiWithMongoClass {
17
- constructor(mongo, collection, verbosity) {
18
- super();
19
- this._mongo = mongo;
20
- this._collection = collection;
21
- this._verbosity = verbosity;
22
- }
23
- [enums_1.asPrintable]() {
24
- return `Explainable(${this._collection.getFullName()})`;
25
- }
26
- _emitExplainableApiCall(methodName, methodArguments = {}) {
27
- this._mongo._instanceState.emitApiCallWithArgs({
28
- method: methodName,
29
- class: 'Explainable',
30
- db: this._collection._database._name,
31
- coll: this._collection._name,
32
- arguments: methodArguments
33
- });
34
- }
35
- getCollection() {
36
- this._emitExplainableApiCall('getCollection');
37
- return this._collection;
38
- }
39
- getVerbosity() {
40
- this._emitExplainableApiCall('getVerbosity');
41
- return this._verbosity;
42
- }
43
- setVerbosity(verbosity) {
44
- verbosity = (0, helpers_1.validateExplainableVerbosity)(verbosity);
45
- this._emitExplainableApiCall('setVerbosity', { verbosity });
46
- this._verbosity = verbosity;
47
- }
48
- async find(query, projection) {
49
- this._emitExplainableApiCall('find', { query, projection });
50
- const cursor = await this._collection.find(query, projection);
51
- return new explainable_cursor_1.default(this._mongo, cursor, this._verbosity);
52
- }
53
- async aggregate(...args) {
54
- var _a;
55
- this._emitExplainableApiCall('aggregate', { args });
56
- let options;
57
- let pipeline;
58
- if (Array.isArray(args[0])) {
59
- pipeline = args[0];
60
- options = (_a = args[1]) !== null && _a !== void 0 ? _a : {};
61
- }
62
- else {
63
- pipeline = args;
64
- options = {};
65
- }
66
- return await this._collection.aggregate(pipeline, {
67
- ...options,
68
- explain: this._verbosity
69
- });
70
- }
71
- async count(query = {}, options = {}) {
72
- this._emitExplainableApiCall('count', { query, options });
73
- return (0, helpers_1.markAsExplainOutput)(await this._collection._database._runCommand({
74
- explain: {
75
- count: `${this._collection._name}`,
76
- query,
77
- ...options
78
- },
79
- verbosity: this._verbosity
80
- }));
81
- }
82
- async distinct(field, query, options = {}) {
83
- this._emitExplainableApiCall('distinct', { field, query, options });
84
- return this._collection.distinct(field, query !== null && query !== void 0 ? query : {}, { ...options, explain: this._verbosity });
85
- }
86
- async findAndModify(options) {
87
- this._emitExplainableApiCall('findAndModify', { options });
88
- return this._collection.findAndModify({ ...options, explain: this._verbosity });
89
- }
90
- async findOneAndDelete(filter, options = {}) {
91
- this._emitExplainableApiCall('findOneAndDelete', { filter, options });
92
- return this._collection.findOneAndDelete(filter, { ...options, explain: this._verbosity });
93
- }
94
- async findOneAndReplace(filter, replacement, options = {}) {
95
- this._emitExplainableApiCall('findOneAndReplace', { filter, options });
96
- return this._collection.findOneAndReplace(filter, replacement, { ...options, explain: this._verbosity });
97
- }
98
- async findOneAndUpdate(filter, update, options = {}) {
99
- this._emitExplainableApiCall('findOneAndUpdate', { filter, options });
100
- return this._collection.findOneAndUpdate(filter, update, { ...options, explain: this._verbosity });
101
- }
102
- async remove(query, options = {}) {
103
- this._emitExplainableApiCall('remove', { query, options });
104
- options = { ...(0, helpers_1.processRemoveOptions)(options), explain: this._verbosity };
105
- return this._collection.remove(query, options);
106
- }
107
- async update(filter, update, options = {}) {
108
- this._emitExplainableApiCall('update', { filter, update, options });
109
- return this._collection.update(filter, update, { ...options, explain: this._verbosity });
110
- }
111
- async mapReduce(map, reduce, optionsOrOutString) {
112
- this._emitExplainableApiCall('mapReduce', { map, reduce, optionsOrOutString });
113
- const options = { ...(0, helpers_1.processMapReduceOptions)(optionsOrOutString), explain: this._verbosity };
114
- return this._collection.mapReduce(map, reduce, options);
115
- }
116
- };
117
- __decorate([
118
- (0, decorators_1.returnType)('ExplainableCursor'),
119
- (0, decorators_1.apiVersions)([1]),
120
- decorators_1.returnsPromise
121
- ], Explainable.prototype, "find", null);
122
- __decorate([
123
- decorators_1.returnsPromise,
124
- (0, decorators_1.apiVersions)([1])
125
- ], Explainable.prototype, "aggregate", null);
126
- __decorate([
127
- decorators_1.returnsPromise,
128
- (0, decorators_1.apiVersions)([1])
129
- ], Explainable.prototype, "count", null);
130
- __decorate([
131
- decorators_1.returnsPromise,
132
- (0, decorators_1.apiVersions)([1])
133
- ], Explainable.prototype, "distinct", null);
134
- __decorate([
135
- decorators_1.returnsPromise,
136
- (0, decorators_1.apiVersions)([1])
137
- ], Explainable.prototype, "findAndModify", null);
138
- __decorate([
139
- decorators_1.returnsPromise,
140
- (0, decorators_1.apiVersions)([1])
141
- ], Explainable.prototype, "findOneAndDelete", null);
142
- __decorate([
143
- decorators_1.returnsPromise,
144
- (0, decorators_1.apiVersions)([1])
145
- ], Explainable.prototype, "findOneAndReplace", null);
146
- __decorate([
147
- decorators_1.returnsPromise,
148
- (0, decorators_1.apiVersions)([1])
149
- ], Explainable.prototype, "findOneAndUpdate", null);
150
- __decorate([
151
- decorators_1.returnsPromise,
152
- (0, decorators_1.apiVersions)([1])
153
- ], Explainable.prototype, "remove", null);
154
- __decorate([
155
- decorators_1.returnsPromise,
156
- (0, decorators_1.apiVersions)([1])
157
- ], Explainable.prototype, "update", null);
158
- __decorate([
159
- decorators_1.returnsPromise,
160
- (0, decorators_1.serverVersions)(['4.4.0', enums_1.ServerVersions.latest]),
161
- (0, decorators_1.apiVersions)([])
162
- ], Explainable.prototype, "mapReduce", null);
163
- Explainable = __decorate([
164
- decorators_1.shellApiClassDefault
165
- ], Explainable);
166
- exports.default = Explainable;
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __importDefault = (this && this.__importDefault) || function (mod) {
9
+ return (mod && mod.__esModule) ? mod : { "default": mod };
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const explainable_cursor_1 = __importDefault(require("./explainable-cursor"));
13
+ const decorators_1 = require("./decorators");
14
+ const enums_1 = require("./enums");
15
+ const helpers_1 = require("./helpers");
16
+ let Explainable = class Explainable extends decorators_1.ShellApiWithMongoClass {
17
+ constructor(mongo, collection, verbosity) {
18
+ super();
19
+ this._mongo = mongo;
20
+ this._collection = collection;
21
+ this._verbosity = verbosity;
22
+ }
23
+ [enums_1.asPrintable]() {
24
+ return `Explainable(${this._collection.getFullName()})`;
25
+ }
26
+ _emitExplainableApiCall(methodName, methodArguments = {}) {
27
+ this._mongo._instanceState.emitApiCallWithArgs({
28
+ method: methodName,
29
+ class: 'Explainable',
30
+ db: this._collection._database._name,
31
+ coll: this._collection._name,
32
+ arguments: methodArguments
33
+ });
34
+ }
35
+ getCollection() {
36
+ this._emitExplainableApiCall('getCollection');
37
+ return this._collection;
38
+ }
39
+ getVerbosity() {
40
+ this._emitExplainableApiCall('getVerbosity');
41
+ return this._verbosity;
42
+ }
43
+ setVerbosity(verbosity) {
44
+ verbosity = (0, helpers_1.validateExplainableVerbosity)(verbosity);
45
+ this._emitExplainableApiCall('setVerbosity', { verbosity });
46
+ this._verbosity = verbosity;
47
+ }
48
+ async find(query, projection) {
49
+ this._emitExplainableApiCall('find', { query, projection });
50
+ const cursor = await this._collection.find(query, projection);
51
+ return new explainable_cursor_1.default(this._mongo, cursor, this._verbosity);
52
+ }
53
+ async aggregate(...args) {
54
+ var _a;
55
+ this._emitExplainableApiCall('aggregate', { args });
56
+ let options;
57
+ let pipeline;
58
+ if (Array.isArray(args[0])) {
59
+ pipeline = args[0];
60
+ options = (_a = args[1]) !== null && _a !== void 0 ? _a : {};
61
+ }
62
+ else {
63
+ pipeline = args;
64
+ options = {};
65
+ }
66
+ return await this._collection.aggregate(pipeline, {
67
+ ...options,
68
+ explain: this._verbosity
69
+ });
70
+ }
71
+ async count(query = {}, options = {}) {
72
+ this._emitExplainableApiCall('count', { query, options });
73
+ return (0, helpers_1.markAsExplainOutput)(await this._collection._database._runCommand({
74
+ explain: {
75
+ count: `${this._collection._name}`,
76
+ query,
77
+ ...options
78
+ },
79
+ verbosity: this._verbosity
80
+ }));
81
+ }
82
+ async distinct(field, query, options = {}) {
83
+ this._emitExplainableApiCall('distinct', { field, query, options });
84
+ return this._collection.distinct(field, query !== null && query !== void 0 ? query : {}, { ...options, explain: this._verbosity });
85
+ }
86
+ async findAndModify(options) {
87
+ this._emitExplainableApiCall('findAndModify', { options });
88
+ return this._collection.findAndModify({ ...options, explain: this._verbosity });
89
+ }
90
+ async findOneAndDelete(filter, options = {}) {
91
+ this._emitExplainableApiCall('findOneAndDelete', { filter, options });
92
+ return this._collection.findOneAndDelete(filter, { ...options, explain: this._verbosity });
93
+ }
94
+ async findOneAndReplace(filter, replacement, options = {}) {
95
+ this._emitExplainableApiCall('findOneAndReplace', { filter, options });
96
+ return this._collection.findOneAndReplace(filter, replacement, { ...options, explain: this._verbosity });
97
+ }
98
+ async findOneAndUpdate(filter, update, options = {}) {
99
+ this._emitExplainableApiCall('findOneAndUpdate', { filter, options });
100
+ return this._collection.findOneAndUpdate(filter, update, { ...options, explain: this._verbosity });
101
+ }
102
+ async remove(query, options = {}) {
103
+ this._emitExplainableApiCall('remove', { query, options });
104
+ options = { ...(0, helpers_1.processRemoveOptions)(options), explain: this._verbosity };
105
+ return this._collection.remove(query, options);
106
+ }
107
+ async update(filter, update, options = {}) {
108
+ this._emitExplainableApiCall('update', { filter, update, options });
109
+ return this._collection.update(filter, update, { ...options, explain: this._verbosity });
110
+ }
111
+ async mapReduce(map, reduce, optionsOrOutString) {
112
+ this._emitExplainableApiCall('mapReduce', { map, reduce, optionsOrOutString });
113
+ const options = { ...(0, helpers_1.processMapReduceOptions)(optionsOrOutString), explain: this._verbosity };
114
+ return this._collection.mapReduce(map, reduce, options);
115
+ }
116
+ };
117
+ __decorate([
118
+ (0, decorators_1.returnType)('ExplainableCursor'),
119
+ (0, decorators_1.apiVersions)([1]),
120
+ decorators_1.returnsPromise
121
+ ], Explainable.prototype, "find", null);
122
+ __decorate([
123
+ decorators_1.returnsPromise,
124
+ (0, decorators_1.apiVersions)([1])
125
+ ], Explainable.prototype, "aggregate", null);
126
+ __decorate([
127
+ decorators_1.returnsPromise,
128
+ (0, decorators_1.apiVersions)([1])
129
+ ], Explainable.prototype, "count", null);
130
+ __decorate([
131
+ decorators_1.returnsPromise,
132
+ (0, decorators_1.apiVersions)([1])
133
+ ], Explainable.prototype, "distinct", null);
134
+ __decorate([
135
+ decorators_1.returnsPromise,
136
+ (0, decorators_1.apiVersions)([1])
137
+ ], Explainable.prototype, "findAndModify", null);
138
+ __decorate([
139
+ decorators_1.returnsPromise,
140
+ (0, decorators_1.apiVersions)([1])
141
+ ], Explainable.prototype, "findOneAndDelete", null);
142
+ __decorate([
143
+ decorators_1.returnsPromise,
144
+ (0, decorators_1.apiVersions)([1])
145
+ ], Explainable.prototype, "findOneAndReplace", null);
146
+ __decorate([
147
+ decorators_1.returnsPromise,
148
+ (0, decorators_1.apiVersions)([1])
149
+ ], Explainable.prototype, "findOneAndUpdate", null);
150
+ __decorate([
151
+ decorators_1.returnsPromise,
152
+ (0, decorators_1.apiVersions)([1])
153
+ ], Explainable.prototype, "remove", null);
154
+ __decorate([
155
+ decorators_1.returnsPromise,
156
+ (0, decorators_1.apiVersions)([1])
157
+ ], Explainable.prototype, "update", null);
158
+ __decorate([
159
+ decorators_1.returnsPromise,
160
+ (0, decorators_1.serverVersions)(['4.4.0', enums_1.ServerVersions.latest]),
161
+ (0, decorators_1.apiVersions)([])
162
+ ], Explainable.prototype, "mapReduce", null);
163
+ Explainable = __decorate([
164
+ decorators_1.shellApiClassDefault
165
+ ], Explainable);
166
+ exports.default = Explainable;
167
167
  //# sourceMappingURL=explainable.js.map
@@ -1,50 +1,50 @@
1
- /// <reference types="node" />
2
- import { ShellApiWithMongoClass } from './decorators';
3
- import { ClientEncryption as MongoCryptClientEncryption, ClientEncryptionDataKeyProvider, ClientEncryptionEncryptOptions, ClientEncryptionTlsOptions, KMSProviders, AWSEncryptionKeyOptions, AzureEncryptionKeyOptions, GCPEncryptionKeyOptions } from '@qp-mongosh/service-provider-core';
4
- import type { Document, BinaryType } from '@qp-mongosh/service-provider-core';
5
- import Cursor from './cursor';
6
- import { DeleteResult } from './result';
7
- import { asPrintable } from './enums';
8
- import type Mongo from './mongo';
9
- import { Binary } from 'qp-mongodb';
10
- export declare type ClientSideFieldLevelEncryptionKmsProvider = Omit<KMSProviders, 'local'> & {
11
- local?: {
12
- key: Buffer | string | BinaryType;
13
- };
14
- };
15
- export interface ClientSideFieldLevelEncryptionOptions {
16
- keyVaultClient?: Mongo;
17
- keyVaultNamespace: string;
18
- kmsProviders: ClientSideFieldLevelEncryptionKmsProvider;
19
- schemaMap?: Document;
20
- bypassAutoEncryption?: boolean;
21
- explicitEncryptionOnly?: boolean;
22
- tlsOptions?: {
23
- [k in keyof ClientSideFieldLevelEncryptionKmsProvider]?: ClientEncryptionTlsOptions;
24
- };
25
- }
26
- export declare class ClientEncryption extends ShellApiWithMongoClass {
27
- _mongo: Mongo;
28
- _libmongocrypt: MongoCryptClientEncryption;
29
- constructor(mongo: Mongo);
30
- [asPrintable](): string;
31
- encrypt(encryptionId: Binary, value: any, encryptionAlgorithm: ClientEncryptionEncryptOptions['algorithm']): Promise<Binary>;
32
- decrypt(encryptedValue: Binary): Promise<any>;
33
- }
34
- export declare class KeyVault extends ShellApiWithMongoClass {
35
- _mongo: Mongo;
36
- _clientEncryption: ClientEncryption;
37
- private _keyColl;
38
- constructor(clientEncryption: ClientEncryption);
39
- [asPrintable](): string;
40
- createKey(kms: 'local', keyAltNames?: string[]): Promise<Document>;
41
- createKey(kms: ClientEncryptionDataKeyProvider, legacyMasterKey: string, keyAltNames?: string[]): Promise<Document>;
42
- createKey(kms: ClientEncryptionDataKeyProvider, options: AWSEncryptionKeyOptions | AzureEncryptionKeyOptions | GCPEncryptionKeyOptions | undefined): Promise<Document>;
43
- createKey(kms: ClientEncryptionDataKeyProvider, options: AWSEncryptionKeyOptions | AzureEncryptionKeyOptions | GCPEncryptionKeyOptions | undefined, keyAltNames: string[]): Promise<Document>;
44
- getKey(keyId: BinaryType): Promise<Cursor>;
45
- getKeyByAltName(keyAltName: string): Promise<Cursor>;
46
- getKeys(): Promise<Cursor>;
47
- deleteKey(keyId: BinaryType): Promise<DeleteResult | Document>;
48
- addKeyAlternateName(keyId: BinaryType, keyAltName: string): Promise<Document>;
49
- removeKeyAlternateName(keyId: BinaryType, keyAltName: string): Promise<Document>;
50
- }
1
+ /// <reference types="node" />
2
+ import { ShellApiWithMongoClass } from './decorators';
3
+ import { ClientEncryption as MongoCryptClientEncryption, ClientEncryptionDataKeyProvider, ClientEncryptionEncryptOptions, ClientEncryptionTlsOptions, KMSProviders, AWSEncryptionKeyOptions, AzureEncryptionKeyOptions, GCPEncryptionKeyOptions } from '@qp-mongosh/service-provider-core';
4
+ import type { Document, BinaryType } from '@qp-mongosh/service-provider-core';
5
+ import Cursor from './cursor';
6
+ import { DeleteResult } from './result';
7
+ import { asPrintable } from './enums';
8
+ import type Mongo from './mongo';
9
+ import { Binary } from 'qp-mongodb';
10
+ export declare type ClientSideFieldLevelEncryptionKmsProvider = Omit<KMSProviders, 'local'> & {
11
+ local?: {
12
+ key: Buffer | string | BinaryType;
13
+ };
14
+ };
15
+ export interface ClientSideFieldLevelEncryptionOptions {
16
+ keyVaultClient?: Mongo;
17
+ keyVaultNamespace: string;
18
+ kmsProviders: ClientSideFieldLevelEncryptionKmsProvider;
19
+ schemaMap?: Document;
20
+ bypassAutoEncryption?: boolean;
21
+ explicitEncryptionOnly?: boolean;
22
+ tlsOptions?: {
23
+ [k in keyof ClientSideFieldLevelEncryptionKmsProvider]?: ClientEncryptionTlsOptions;
24
+ };
25
+ }
26
+ export declare class ClientEncryption extends ShellApiWithMongoClass {
27
+ _mongo: Mongo;
28
+ _libmongocrypt: MongoCryptClientEncryption;
29
+ constructor(mongo: Mongo);
30
+ [asPrintable](): string;
31
+ encrypt(encryptionId: Binary, value: any, encryptionAlgorithm: ClientEncryptionEncryptOptions['algorithm']): Promise<Binary>;
32
+ decrypt(encryptedValue: Binary): Promise<any>;
33
+ }
34
+ export declare class KeyVault extends ShellApiWithMongoClass {
35
+ _mongo: Mongo;
36
+ _clientEncryption: ClientEncryption;
37
+ private _keyColl;
38
+ constructor(clientEncryption: ClientEncryption);
39
+ [asPrintable](): string;
40
+ createKey(kms: 'local', keyAltNames?: string[]): Promise<Document>;
41
+ createKey(kms: ClientEncryptionDataKeyProvider, legacyMasterKey: string, keyAltNames?: string[]): Promise<Document>;
42
+ createKey(kms: ClientEncryptionDataKeyProvider, options: AWSEncryptionKeyOptions | AzureEncryptionKeyOptions | GCPEncryptionKeyOptions | undefined): Promise<Document>;
43
+ createKey(kms: ClientEncryptionDataKeyProvider, options: AWSEncryptionKeyOptions | AzureEncryptionKeyOptions | GCPEncryptionKeyOptions | undefined, keyAltNames: string[]): Promise<Document>;
44
+ getKey(keyId: BinaryType): Promise<Cursor>;
45
+ getKeyByAltName(keyAltName: string): Promise<Cursor>;
46
+ getKeys(): Promise<Cursor>;
47
+ deleteKey(keyId: BinaryType): Promise<DeleteResult | Document>;
48
+ addKeyAlternateName(keyId: BinaryType, keyAltName: string): Promise<Document>;
49
+ removeKeyAlternateName(keyId: BinaryType, keyAltName: string): Promise<Document>;
50
+ }