@mongosh/service-provider-core 1.10.1 → 1.10.2
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.
- package/.depcheckrc +11 -0
- package/.eslintrc.js +10 -1
- package/.prettierignore +6 -0
- package/.prettierrc.json +1 -0
- package/lib/admin.d.ts +2 -2
- package/lib/all-fle-types.d.ts +2 -2
- package/lib/all-transport-types.d.ts +1 -1
- package/lib/connect-info.d.ts +1 -1
- package/lib/connect-info.js +5 -4
- package/lib/connect-info.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/map-reduce-options.d.ts +1 -1
- package/lib/platform.d.ts +1 -1
- package/lib/printable-bson.js +6 -4
- package/lib/printable-bson.js.map +1 -1
- package/lib/readable.d.ts +1 -1
- package/lib/service-provider.d.ts +4 -4
- package/lib/service-provider.js.map +1 -1
- package/lib/textencoder-polyfill.js +2 -1
- package/lib/textencoder-polyfill.js.map +1 -1
- package/lib/writable.d.ts +1 -1
- package/package.json +22 -21
- package/src/admin.ts +22 -13
- package/src/all-fle-types.ts +1 -1
- package/src/all-transport-types.ts +1 -1
- package/src/connect-info.spec.ts +72 -93
- package/src/connect-info.ts +15 -11
- package/src/index.ts +7 -4
- package/src/map-reduce-options.ts +12 -2
- package/src/printable-bson.spec.ts +61 -33
- package/src/printable-bson.ts +35 -22
- package/src/readable.ts +22 -12
- package/src/service-provider.ts +9 -5
- package/src/textencoder-polyfill.spec.ts +5 -3
- package/src/textencoder-polyfill.ts +4 -2
- package/src/writable.ts +35 -24
- package/tsconfig-lint.json +5 -0
- package/tsconfig.json +3 -7
- package/tsconfig.lint.json +0 -8
package/.depcheckrc
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
ignores:
|
|
2
|
+
- '@mongodb-js/eslint-config-mongosh'
|
|
3
|
+
- '@mongodb-js/tsconfig-mongosh'
|
|
4
|
+
- '@mongodb-js/prettier-config-devtools'
|
|
5
|
+
- '@typescript-eslint/parser'
|
|
6
|
+
- '@typescript-eslint/eslint-plugin'
|
|
7
|
+
- chai
|
|
8
|
+
- eslint-plugin-mocha
|
|
9
|
+
- eslint-config-mongodb-js
|
|
10
|
+
ignore-patterns:
|
|
11
|
+
- .eslintrc.js
|
package/.eslintrc.js
CHANGED
|
@@ -1 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
const { fixCygwinPath } = require('@mongodb-js/eslint-config-mongosh/utils');
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
root: true,
|
|
5
|
+
extends: ['@mongodb-js/eslint-config-mongosh'],
|
|
6
|
+
parserOptions: {
|
|
7
|
+
tsconfigRootDir: fixCygwinPath(__dirname),
|
|
8
|
+
project: ['./tsconfig-lint.json'],
|
|
9
|
+
},
|
|
10
|
+
};
|
package/.prettierignore
ADDED
package/.prettierrc.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"@mongodb-js/prettier-config-devtools"
|
package/lib/admin.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import ShellAuthOptions from './shell-auth-options';
|
|
1
|
+
import type ShellAuthOptions from './shell-auth-options';
|
|
2
2
|
import type { MongoClientOptions, ReadConcern, ReadPreference, WriteConcern, Document, CreateCollectionOptions, ClientSession, DbOptions, ClientSessionOptions, ListDatabasesOptions, AutoEncryptionOptions, Collection } from './all-transport-types';
|
|
3
3
|
import type { bson as BSON } from './index';
|
|
4
4
|
import type { ReplPlatform } from './platform';
|
|
5
|
-
import { AWSEncryptionKeyOptions, AzureEncryptionKeyOptions, ClientEncryption as MongoCryptClientEncryption, ClientEncryptionDataKeyProvider, FLE, GCPEncryptionKeyOptions } from './all-fle-types';
|
|
5
|
+
import type { AWSEncryptionKeyOptions, AzureEncryptionKeyOptions, ClientEncryption as MongoCryptClientEncryption, ClientEncryptionDataKeyProvider, FLE, GCPEncryptionKeyOptions } from './all-fle-types';
|
|
6
6
|
export interface CreateEncryptedCollectionOptions {
|
|
7
7
|
provider: ClientEncryptionDataKeyProvider;
|
|
8
8
|
createCollectionOptions: Omit<CreateCollectionOptions, 'encryptedFields'> & {
|
package/lib/all-fle-types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { AWSEncryptionKeyOptions, AzureEncryptionKeyOptions, GCPEncryptionKeyOptions, ClientEncryption, ClientEncryptionCreateDataKeyCallback, ClientEncryptionCreateDataKeyProviderOptions, ClientEncryptionDataKeyProvider, ClientEncryptionDecryptCallback, ClientEncryptionEncryptCallback, ClientEncryptionEncryptOptions, ClientEncryptionOptions, ClientEncryptionTlsOptions, KMSProviders } from 'mongodb-client-encryption';
|
|
2
|
-
export
|
|
1
|
+
export type { AWSEncryptionKeyOptions, AzureEncryptionKeyOptions, GCPEncryptionKeyOptions, ClientEncryption, ClientEncryptionCreateDataKeyCallback, ClientEncryptionCreateDataKeyProviderOptions, ClientEncryptionDataKeyProvider, ClientEncryptionDecryptCallback, ClientEncryptionEncryptCallback, ClientEncryptionEncryptOptions, ClientEncryptionOptions, ClientEncryptionTlsOptions, KMSProviders, } from 'mongodb-client-encryption';
|
|
2
|
+
export type FLE = typeof import('mongodb-client-encryption');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { AggregateOptions, AggregationCursor, AnyBulkWriteOperation, Batch, BulkWriteOptions, BulkWriteResult, ChangeStream, ChangeStreamOptions, ClientSession, CloseOptions, CollationOptions, CollStatsOptions, Collection, CommandOperationOptions, CountDocumentsOptions, CountOptions, CreateCollectionOptions, CreateIndexesOptions, ClientSessionOptions, ClusterTime, FindCursor, CursorFlag, RunCommandCursor, Db, DbOptions, DeleteOptions, DeleteResult, DistinctOptions, Document, DropCollectionOptions, DropDatabaseOptions, EstimatedDocumentCountOptions, ExplainOptions, ExplainVerbosityLike, FindOneAndDeleteOptions, FindOneAndUpdateOptions, FindOneAndReplaceOptions, FindOperators, FindOptions, HedgeOptions, IndexDescription, InsertManyResult, InsertOneOptions, InsertOneResult, ListCollectionsOptions, ListDatabasesOptions, ListIndexesOptions, MongoClientOptions, OrderedBulkOperation, ReadConcern, ReadConcernLike, ReadConcernLevel, ReadPreference, ReadPreferenceLike, ReadPreferenceFromOptions, ReadPreferenceMode, RenameOptions, ReplaceOptions, ResumeToken, RunCommandOptions, ServerSessionId, TagSet, TransactionOptions, UpdateOptions, UpdateResult, UnorderedBulkOperation, WriteConcern, ObjectId as ObjectIdType, Timestamp as TimestampType, Binary as BinaryType, TopologyDescription, TopologyType, ServerType, AutoEncryptionOptions, ServerApi, ServerApiVersion, MongoClient } from 'mongodb';
|
|
1
|
+
export type { AggregateOptions, AggregationCursor, AnyBulkWriteOperation, Batch, BulkWriteOptions, BulkWriteResult, ChangeStream, ChangeStreamOptions, ClientSession, CloseOptions, CollationOptions, CollStatsOptions, Collection, CommandOperationOptions, CountDocumentsOptions, CountOptions, CreateCollectionOptions, CreateIndexesOptions, ClientSessionOptions, ClusterTime, FindCursor, CursorFlag, RunCommandCursor, Db, DbOptions, DeleteOptions, DeleteResult, DistinctOptions, Document, DropCollectionOptions, DropDatabaseOptions, EstimatedDocumentCountOptions, ExplainOptions, ExplainVerbosityLike, FindOneAndDeleteOptions, FindOneAndUpdateOptions, FindOneAndReplaceOptions, FindOperators, FindOptions, HedgeOptions, IndexDescription, InsertManyResult, InsertOneOptions, InsertOneResult, ListCollectionsOptions, ListDatabasesOptions, ListIndexesOptions, MongoClientOptions, OrderedBulkOperation, ReadConcern, ReadConcernLike, ReadConcernLevel, ReadPreference, ReadPreferenceLike, ReadPreferenceFromOptions, ReadPreferenceMode, RenameOptions, ReplaceOptions, ResumeToken, RunCommandOptions, ServerSessionId, TagSet, TransactionOptions, UpdateOptions, UpdateResult, UnorderedBulkOperation, WriteConcern, ObjectId as ObjectIdType, Timestamp as TimestampType, Binary as BinaryType, TopologyDescription, TopologyType, ServerType, AutoEncryptionOptions, ServerApi, ServerApiVersion, MongoClient, } from 'mongodb';
|
package/lib/connect-info.d.ts
CHANGED
|
@@ -16,4 +16,4 @@ export interface ConnectInfo {
|
|
|
16
16
|
node_version: string;
|
|
17
17
|
uri: string;
|
|
18
18
|
}
|
|
19
|
-
export default function getConnectInfo(uri: string, mongoshVersion: string, buildInfo: any,
|
|
19
|
+
export default function getConnectInfo(uri: string, mongoshVersion: string, buildInfo: any, atlasVersion: any, topology: any): ConnectInfo;
|
package/lib/connect-info.js
CHANGED
|
@@ -4,13 +4,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const mongodb_build_info_1 = __importDefault(require("mongodb-build-info"));
|
|
7
|
-
function getConnectInfo(uri, mongoshVersion, buildInfo,
|
|
7
|
+
function getConnectInfo(uri, mongoshVersion, buildInfo, atlasVersion, topology) {
|
|
8
8
|
var _a;
|
|
9
9
|
buildInfo !== null && buildInfo !== void 0 ? buildInfo : (buildInfo = {});
|
|
10
|
-
const { isGenuine: is_genuine, serverName: non_genuine_server_name } = mongodb_build_info_1.default.getGenuineMongoDB(
|
|
10
|
+
const { isGenuine: is_genuine, serverName: non_genuine_server_name } = mongodb_build_info_1.default.getGenuineMongoDB(uri);
|
|
11
11
|
const { isDataLake: is_data_federation, dlVersion: dl_version } = mongodb_build_info_1.default.getDataLake(buildInfo);
|
|
12
12
|
const auth_type = topology.s.credentials
|
|
13
|
-
? topology.s.credentials.mechanism
|
|
13
|
+
? topology.s.credentials.mechanism
|
|
14
|
+
: null;
|
|
14
15
|
const { serverOs: server_os, serverArch: server_arch } = mongodb_build_info_1.default.getBuildEnv(buildInfo);
|
|
15
16
|
return {
|
|
16
17
|
is_atlas: !!(atlasVersion === null || atlasVersion === void 0 ? void 0 : atlasVersion.atlasVersion) || mongodb_build_info_1.default.isAtlas(uri),
|
|
@@ -28,7 +29,7 @@ function getConnectInfo(uri, mongoshVersion, buildInfo, cmdLineOpts, atlasVersio
|
|
|
28
29
|
dl_version,
|
|
29
30
|
atlas_version: (_a = atlasVersion === null || atlasVersion === void 0 ? void 0 : atlasVersion.atlasVersion) !== null && _a !== void 0 ? _a : null,
|
|
30
31
|
is_genuine,
|
|
31
|
-
non_genuine_server_name
|
|
32
|
+
non_genuine_server_name,
|
|
32
33
|
};
|
|
33
34
|
}
|
|
34
35
|
exports.default = getConnectInfo;
|
package/lib/connect-info.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect-info.js","sourceRoot":"","sources":["../src/connect-info.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"connect-info.js","sourceRoot":"","sources":["../src/connect-info.ts"],"names":[],"mappings":";;;;;AAEA,4EAA8C;AAqB9C,SAAwB,cAAc,CACpC,GAAW,EACX,cAAsB,EACtB,SAAc,EACd,YAAiB,EACjB,QAAa;;IAEb,SAAS,aAAT,SAAS,cAAT,SAAS,IAAT,SAAS,GAAK,EAAE,EAAC;IACjB,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,uBAAuB,EAAE,GAClE,4BAAY,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;IAEtC,MAAM,EAAE,UAAU,EAAE,kBAAkB,EAAE,SAAS,EAAE,UAAU,EAAE,GAC7D,4BAAY,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IAEtC,MAAM,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,WAAW;QACtC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,SAAS;QAClC,CAAC,CAAC,IAAI,CAAC;IACT,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,GACpD,4BAAY,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IAEtC,OAAO;QACL,QAAQ,EAAE,CAAC,CAAC,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,YAAY,CAAA,IAAI,4BAAY,CAAC,OAAO,CAAC,GAAG,CAAC;QACnE,YAAY,EAAE,4BAAY,CAAC,WAAW,CAAC,GAAG,CAAC;QAC3C,KAAK,EAAE,4BAAY,CAAC,cAAc,CAAC,GAAG,CAAC;QACvC,cAAc,EAAE,SAAS,CAAC,OAAO;QACjC,YAAY,EAAE,OAAO,CAAC,OAAO;QAC7B,eAAe,EAAE,cAAc;QAC/B,SAAS;QACT,GAAG;QACH,WAAW;QACX,aAAa,EAAE,4BAAY,CAAC,YAAY,CAAC,SAAS,CAAC;QACnD,SAAS;QACT,kBAAkB;QAClB,UAAU;QACV,aAAa,EAAE,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,YAAY,mCAAI,IAAI;QACjD,UAAU;QACV,uBAAuB;KACxB,CAAC;AACJ,CAAC;AAtCD,iCAsCC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import ShellAuthOptions from './shell-auth-options';
|
|
|
9
9
|
export * from './all-transport-types';
|
|
10
10
|
export * from './all-fle-types';
|
|
11
11
|
export { MapReduceOptions, FinalizeFunction } from './map-reduce-options';
|
|
12
|
-
export { CreateEncryptedCollectionOptions, CheckMetadataConsistencyOptions } from './admin';
|
|
12
|
+
export { CreateEncryptedCollectionOptions, CheckMetadataConsistencyOptions, } from './admin';
|
|
13
13
|
declare const bson: {
|
|
14
14
|
ObjectId: typeof ObjectId;
|
|
15
15
|
DBRef: typeof DBRef;
|
|
@@ -32,4 +32,4 @@ declare const bson: {
|
|
|
32
32
|
};
|
|
33
33
|
BSONRegExp: typeof BSONRegExp;
|
|
34
34
|
};
|
|
35
|
-
export { ServiceProvider, ShellAuthOptions, getConnectInfo, ReplPlatform, DEFAULT_DB, ServiceProviderCore, bson, bsonStringifiers, ConnectInfo };
|
|
35
|
+
export { ServiceProvider, ShellAuthOptions, getConnectInfo, ReplPlatform, DEFAULT_DB, ServiceProviderCore, bson, bsonStringifiers, ConnectInfo, };
|
package/lib/index.js
CHANGED
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAA0E;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAA0E;AAyDxE,oGAzDwB,sCAAmB,OAyDxB;AAxDrB,kEAA6D;AAqD3D,yBArDK,sBAAc,CAqDL;AAnDhB,MAAM,UAAU,GAAG,MAAM,CAAC;AAqDxB,gCAAU;AApDZ,+BAgBc;AACd,qDAAoD;AAsClD,iGAtCO,iCAAgB,OAsCP;AApClB,wDAAsC;AACtC,kDAAgC;AAShC,MAAM,IAAI,GAAG;IACX,QAAQ,EAAR,eAAQ;IACR,KAAK,EAAL,YAAK;IACL,MAAM,EAAN,aAAM;IACN,MAAM,EAAN,aAAM;IACN,SAAS,EAAT,gBAAS;IACT,UAAU,EAAV,iBAAU;IACV,IAAI,EAAJ,WAAI;IACJ,UAAU,EAAV,iBAAU;IACV,KAAK,EAAL,YAAK;IACL,IAAI,EAAJ,WAAI;IACJ,MAAM,EAAN,aAAM;IACN,mBAAmB,EAAnB,0BAAmB;IACnB,MAAM,EAAN,aAAM;IACN,KAAK,EAAL,YAAK;IACL,UAAU,EAAV,iBAAU;CACX,CAAC;AASA,oBAAI"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CommandOperationOptions, Document, ObjectId, Sort } from 'mongodb';
|
|
2
|
-
export
|
|
2
|
+
export type FinalizeFunction<TKey = ObjectId, TValue = Document> = (key: TKey, reducedValue: TValue) => TValue;
|
|
3
3
|
export interface MapReduceOptions<TKey = ObjectId, TValue = Document> extends CommandOperationOptions {
|
|
4
4
|
out?: 'inline' | {
|
|
5
5
|
inline: 1;
|
package/lib/platform.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type ReplPlatform = 'CLI' | 'Browser' | 'Compass' | 'JavaShell';
|
package/lib/printable-bson.js
CHANGED
|
@@ -9,10 +9,10 @@ exports.bsonStringifiers = {
|
|
|
9
9
|
return `ObjectId("${this.toHexString()}")`;
|
|
10
10
|
},
|
|
11
11
|
DBRef: function (depth, options) {
|
|
12
|
-
return `DBRef("${this.collection}", ` +
|
|
12
|
+
return (`DBRef("${this.collection}", ` +
|
|
13
13
|
(0, util_1.inspect)(this.oid, options) +
|
|
14
14
|
(this.db ? `, "${this.db}"` : '') +
|
|
15
|
-
')';
|
|
15
|
+
')');
|
|
16
16
|
},
|
|
17
17
|
MaxKey: function () {
|
|
18
18
|
return 'MaxKey()';
|
|
@@ -49,8 +49,10 @@ exports.bsonStringifiers = {
|
|
|
49
49
|
return `MD5("${hexString}")`;
|
|
50
50
|
case index_1.bson.Binary.SUBTYPE_UUID:
|
|
51
51
|
if (hexString.length === 32) {
|
|
52
|
-
const asUUID =
|
|
53
|
-
.
|
|
52
|
+
const asUUID = /^(.{8})(.{4})(.{4})(.{4})(.{12})$/
|
|
53
|
+
.exec(hexString)
|
|
54
|
+
.slice(1, 6)
|
|
55
|
+
.join('-');
|
|
54
56
|
return `UUID("${asUUID}")`;
|
|
55
57
|
}
|
|
56
58
|
default:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"printable-bson.js","sourceRoot":"","sources":["../src/printable-bson.ts"],"names":[],"mappings":";;;AAAA,mCAAuC;AACvC,+BAA+B;AAC/B,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAElD,QAAA,gBAAgB,
|
|
1
|
+
{"version":3,"file":"printable-bson.js","sourceRoot":"","sources":["../src/printable-bson.ts"],"names":[],"mappings":";;;AAAA,mCAAuC;AACvC,+BAA+B;AAC/B,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAElD,QAAA,gBAAgB,GAGzB;I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GAAW,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC;aAC3C;YAAC,WAAM;aAKP;SACF;KACF;AACH,CAAC;AArBD,4BAqBC"}
|
package/lib/readable.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Document, AggregateOptions, CountOptions, CountDocumentsOptions, DistinctOptions, EstimatedDocumentCountOptions, FindOptions, ListCollectionsOptions, ListIndexesOptions, AggregationCursor, FindCursor, DbOptions, ReadPreferenceFromOptions, ReadPreferenceLike } from './all-transport-types';
|
|
2
|
-
import { ChangeStream, ChangeStreamOptions } from './all-transport-types';
|
|
2
|
+
import type { ChangeStream, ChangeStreamOptions } from './all-transport-types';
|
|
3
3
|
export default interface Readable {
|
|
4
4
|
aggregate(database: string, collection: string, pipeline: Document[], options?: AggregateOptions, dbOptions?: DbOptions): AggregationCursor;
|
|
5
5
|
aggregateDb(database: string, pipeline: Document[], options?: AggregateOptions, dbOptions?: DbOptions): AggregationCursor;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import Admin from './admin';
|
|
2
|
-
import Closable from './closable';
|
|
3
|
-
import Readable from './readable';
|
|
4
|
-
import Writable from './writable';
|
|
1
|
+
import type Admin from './admin';
|
|
2
|
+
import type Closable from './closable';
|
|
3
|
+
import type Readable from './readable';
|
|
4
|
+
import type Writable from './writable';
|
|
5
5
|
import type { bson as BSON } from './index';
|
|
6
6
|
export default interface ServiceProvider extends Readable, Writable, Closable, Admin {
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-provider.js","sourceRoot":"","sources":["../src/service-provider.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAuD;AAGvD,sEAAiD;
|
|
1
|
+
{"version":3,"file":"service-provider.js","sourceRoot":"","sources":["../src/service-provider.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAuD;AAGvD,sEAAiD;AAcjD,MAAa,mBAAmB;IAE9B,YAAY,WAAyB;QACnC,IAAI,WAAW,KAAK,SAAS,EAAE;YAC7B,MAAM,IAAI,6BAAoB,CAAC,4BAA4B,CAAC,CAAC;SAC9D;QACD,IAAA,wBAAiB,EAAC,WAAW,CAAC,CAAC;QAC/B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;CACF;AATD,kDASC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.textEncodingPolyfill = void 0;
|
|
4
|
-
if (typeof TextDecoder !== 'function' ||
|
|
4
|
+
if (typeof TextDecoder !== 'function' ||
|
|
5
|
+
typeof TextEncoder !== 'function') {
|
|
5
6
|
Object.assign(Function('return this')(), textEncodingPolyfill());
|
|
6
7
|
}
|
|
7
8
|
function textEncodingPolyfill() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textencoder-polyfill.js","sourceRoot":"","sources":["../src/textencoder-polyfill.ts"],"names":[],"mappings":";;;AAIA,IAGE,OAAO,WAAW,KAAK,UAAU,
|
|
1
|
+
{"version":3,"file":"textencoder-polyfill.js","sourceRoot":"","sources":["../src/textencoder-polyfill.ts"],"names":[],"mappings":";;;AAIA,IAGE,OAAO,WAAW,KAAK,UAAU;IAGjC,OAAO,WAAW,KAAK,UAAU,EACjC;IACA,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,EAAE,oBAAoB,EAAE,CAAC,CAAC;CAClE;AAGD,SAAS,oBAAoB;IAC3B,MAAM,WAAW;QACf,MAAM,CAAC,MAAc;YACnB,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACrC,CAAC;KACF;IACD,MAAM,WAAW;QACf,MAAM,CAAC,KAAiB;YACtB,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAChD,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC9C,CAAC;KACF;IACD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC;AACtC,CAAC;AAEQ,oDAAoB"}
|
package/lib/writable.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RunCommandCursor, RunCursorCommandOptions } from 'mongodb';
|
|
1
|
+
import type { RunCommandCursor, RunCursorCommandOptions } from 'mongodb';
|
|
2
2
|
import type { Document, InsertOneOptions, InsertOneResult, Collection, RenameOptions, FindOneAndDeleteOptions, FindOneAndReplaceOptions, FindOneAndUpdateOptions, BulkWriteOptions, AnyBulkWriteOperation, DeleteOptions, DeleteResult, InsertManyResult, ReplaceOptions, UpdateResult, UpdateOptions, DropDatabaseOptions, CreateIndexesOptions, DropCollectionOptions, BulkWriteResult, RunCommandOptions, DbOptions, OrderedBulkOperation, UnorderedBulkOperation } from './all-transport-types';
|
|
3
3
|
export default interface Writable {
|
|
4
4
|
runCommand(db: string, spec: Document, options: RunCommandOptions, dbOptions?: DbOptions): Promise<Document>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mongosh/service-provider-core",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.2",
|
|
4
4
|
"description": "MongoDB Shell Core Service Provider Package",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -12,12 +12,16 @@
|
|
|
12
12
|
"url": "git://github.com/mongodb-js/mongosh.git"
|
|
13
13
|
},
|
|
14
14
|
"scripts": {
|
|
15
|
-
"compile
|
|
16
|
-
"prepublish": "npm run compile
|
|
15
|
+
"compile": "tsc -p tsconfig.json",
|
|
16
|
+
"prepublish": "npm run compile",
|
|
17
17
|
"test": "mocha -r \"../../scripts/import-expansions.js\" --timeout 60000 -r ts-node/register \"./src/**/*.spec.ts\"",
|
|
18
18
|
"test-ci": "node ../../scripts/run-if-package-requested.js npm test",
|
|
19
|
-
"
|
|
20
|
-
"
|
|
19
|
+
"eslint": "eslint",
|
|
20
|
+
"lint": "npm run eslint . && npm run prettier -- --check .",
|
|
21
|
+
"check": "npm run lint && npm run depcheck",
|
|
22
|
+
"depcheck": "depcheck",
|
|
23
|
+
"prettier": "prettier",
|
|
24
|
+
"reformat": "npm run prettier -- --write . && npm run eslint --fix"
|
|
21
25
|
},
|
|
22
26
|
"license": "Apache-2.0",
|
|
23
27
|
"publishConfig": {
|
|
@@ -38,25 +42,22 @@
|
|
|
38
42
|
},
|
|
39
43
|
"dependencies": {
|
|
40
44
|
"@aws-sdk/credential-providers": "^3.347.1",
|
|
41
|
-
"@mongosh/errors": "1.10.
|
|
42
|
-
"bson": "^5.
|
|
43
|
-
"mongodb": "^5.
|
|
44
|
-
"mongodb-build-info": "^1.
|
|
45
|
+
"@mongosh/errors": "1.10.2",
|
|
46
|
+
"bson": "^5.3.0",
|
|
47
|
+
"mongodb": "^5.7.0",
|
|
48
|
+
"mongodb-build-info": "^1.6.2",
|
|
45
49
|
"mongodb-client-encryption": "^2.8.0"
|
|
46
50
|
},
|
|
47
51
|
"optionalDependencies": {
|
|
48
52
|
"mongodb-client-encryption": "^2.8.0"
|
|
49
53
|
},
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
"
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
]
|
|
60
|
-
},
|
|
61
|
-
"gitHead": "05ad91b4dd40382a13f27abe1ae8c3f9f52a38f7"
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@mongodb-js/eslint-config-mongosh": "1.10.2",
|
|
56
|
+
"@mongodb-js/prettier-config-devtools": "^1.0.1",
|
|
57
|
+
"@mongodb-js/tsconfig-mongosh": "1.10.2",
|
|
58
|
+
"depcheck": "^1.4.3",
|
|
59
|
+
"eslint": "^7.25.0",
|
|
60
|
+
"prettier": "^2.8.8"
|
|
61
|
+
},
|
|
62
|
+
"gitHead": "9351a54cc24def10a97fe7f8c7b455c02fdce62e"
|
|
62
63
|
}
|
package/src/admin.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ShellAuthOptions from './shell-auth-options';
|
|
1
|
+
import type ShellAuthOptions from './shell-auth-options';
|
|
2
2
|
import type {
|
|
3
3
|
MongoClientOptions,
|
|
4
4
|
ReadConcern,
|
|
@@ -11,30 +11,35 @@ import type {
|
|
|
11
11
|
ClientSessionOptions,
|
|
12
12
|
ListDatabasesOptions,
|
|
13
13
|
AutoEncryptionOptions,
|
|
14
|
-
Collection
|
|
14
|
+
Collection,
|
|
15
15
|
} from './all-transport-types';
|
|
16
16
|
import type { bson as BSON } from './index';
|
|
17
17
|
import type { ReplPlatform } from './platform';
|
|
18
|
-
import {
|
|
18
|
+
import type {
|
|
19
19
|
AWSEncryptionKeyOptions,
|
|
20
20
|
AzureEncryptionKeyOptions,
|
|
21
21
|
ClientEncryption as MongoCryptClientEncryption,
|
|
22
22
|
ClientEncryptionDataKeyProvider,
|
|
23
23
|
FLE,
|
|
24
|
-
GCPEncryptionKeyOptions
|
|
24
|
+
GCPEncryptionKeyOptions,
|
|
25
25
|
} from './all-fle-types';
|
|
26
26
|
|
|
27
27
|
export interface CreateEncryptedCollectionOptions {
|
|
28
|
-
provider: ClientEncryptionDataKeyProvider
|
|
29
|
-
createCollectionOptions: Omit<CreateCollectionOptions, 'encryptedFields'> & {
|
|
30
|
-
|
|
28
|
+
provider: ClientEncryptionDataKeyProvider;
|
|
29
|
+
createCollectionOptions: Omit<CreateCollectionOptions, 'encryptedFields'> & {
|
|
30
|
+
encryptedFields: Document;
|
|
31
|
+
};
|
|
32
|
+
masterKey?:
|
|
33
|
+
| AWSEncryptionKeyOptions
|
|
34
|
+
| AzureEncryptionKeyOptions
|
|
35
|
+
| GCPEncryptionKeyOptions;
|
|
31
36
|
}
|
|
32
37
|
|
|
33
38
|
export interface CheckMetadataConsistencyOptions {
|
|
34
39
|
cursor?: {
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
checkIndexes?: 1
|
|
40
|
+
batchSize: number;
|
|
41
|
+
};
|
|
42
|
+
checkIndexes?: 1;
|
|
38
43
|
}
|
|
39
44
|
|
|
40
45
|
export default interface Admin {
|
|
@@ -60,7 +65,10 @@ export default interface Admin {
|
|
|
60
65
|
*
|
|
61
66
|
* @returns {Promise} The promise of command Documents.
|
|
62
67
|
*/
|
|
63
|
-
listDatabases(
|
|
68
|
+
listDatabases(
|
|
69
|
+
database: string,
|
|
70
|
+
options?: ListDatabasesOptions
|
|
71
|
+
): Promise<Document>;
|
|
64
72
|
|
|
65
73
|
/**
|
|
66
74
|
* create a new service provider with a new connection.
|
|
@@ -92,7 +100,8 @@ export default interface Admin {
|
|
|
92
100
|
dbName: string,
|
|
93
101
|
collName: string,
|
|
94
102
|
options: CreateCollectionOptions,
|
|
95
|
-
dbOptions?: DbOptions
|
|
103
|
+
dbOptions?: DbOptions
|
|
104
|
+
): Promise<{ ok: number }>;
|
|
96
105
|
|
|
97
106
|
/**
|
|
98
107
|
* Return read preference for connection.
|
|
@@ -145,5 +154,5 @@ export default interface Admin {
|
|
|
145
154
|
collName: string,
|
|
146
155
|
options: CreateEncryptedCollectionOptions,
|
|
147
156
|
libmongocrypt: MongoCryptClientEncryption
|
|
148
|
-
): Promise<{ collection: Collection
|
|
157
|
+
): Promise<{ collection: Collection; encryptedFields: Document }>;
|
|
149
158
|
}
|
package/src/all-fle-types.ts
CHANGED