@mongosh/service-provider-core 2.2.3 → 2.2.5

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/lib/admin.d.ts CHANGED
@@ -1,6 +1,6 @@
1
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
- import type { bson as BSON } from './index';
3
+ import type { bson as BSON, ConnectionExtraInfo } from './index';
4
4
  import type { ReplPlatform } from './platform';
5
5
  import type { AWSEncryptionKeyOptions, AzureEncryptionKeyOptions, ClientEncryption as MongoCryptClientEncryption, ClientEncryptionDataKeyProvider, GCPEncryptionKeyOptions, ClientEncryption, ClientEncryptionOptions } from './all-fle-types';
6
6
  export interface CreateEncryptedCollectionOptions {
@@ -16,6 +16,13 @@ export interface CheckMetadataConsistencyOptions {
16
16
  };
17
17
  checkIndexes?: 1;
18
18
  }
19
+ export interface ConnectionInfo {
20
+ buildInfo: Document | null;
21
+ topology: any | null;
22
+ extraInfo: (ConnectionExtraInfo & {
23
+ fcv?: string;
24
+ }) | null;
25
+ }
19
26
  export default interface Admin {
20
27
  platform: ReplPlatform;
21
28
  initialDb: string;
@@ -23,7 +30,7 @@ export default interface Admin {
23
30
  listDatabases(database: string, options?: ListDatabasesOptions): Promise<Document>;
24
31
  getNewConnection(uri: string, options: MongoClientOptions): Promise<any>;
25
32
  getURI(): string | undefined;
26
- getConnectionInfo(): Promise<Document>;
33
+ getConnectionInfo(): Promise<ConnectionInfo>;
27
34
  authenticate(authDoc: ShellAuthOptions): Promise<{
28
35
  ok: number;
29
36
  }>;
@@ -1,21 +1,21 @@
1
- export interface ConnectInfo {
2
- is_atlas: boolean;
3
- is_localhost: boolean;
4
- is_do: boolean;
5
- server_version: string;
6
- mongosh_version: string;
1
+ export interface ConnectionExtraInfo {
2
+ is_atlas?: boolean;
3
+ is_localhost?: boolean;
4
+ is_do?: boolean;
5
+ server_version?: string;
6
+ mongosh_version?: string;
7
7
  server_os?: string;
8
8
  server_arch?: string;
9
- is_enterprise: boolean;
9
+ is_enterprise?: boolean;
10
10
  auth_type?: string;
11
- is_data_federation: boolean;
12
- is_stream: boolean;
11
+ is_data_federation?: boolean;
12
+ is_stream?: boolean;
13
13
  dl_version?: string;
14
14
  atlas_version?: string;
15
- is_genuine: boolean;
16
- non_genuine_server_name: string;
17
- node_version: string;
15
+ is_genuine?: boolean;
16
+ non_genuine_server_name?: string;
17
+ node_version?: string;
18
18
  uri: string;
19
- is_local_atlas: boolean;
19
+ is_local_atlas?: boolean;
20
20
  }
21
- export default function getConnectInfo(uri: string, mongoshVersion: string, buildInfo: any, atlasVersion: any, topology: any, isLocalAtlas: boolean): ConnectInfo;
21
+ export default function getConnectExtraInfo(uri: string, mongoshVersion: string, buildInfo: any, atlasVersion: any, topology: any, isLocalAtlas: boolean): ConnectionExtraInfo;
@@ -4,7 +4,7 @@ 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, atlasVersion, topology, isLocalAtlas) {
7
+ function getConnectExtraInfo(uri, mongoshVersion, buildInfo, atlasVersion, topology, isLocalAtlas) {
8
8
  var _a;
9
9
  buildInfo !== null && buildInfo !== void 0 ? buildInfo : (buildInfo = {});
10
10
  const { isGenuine: is_genuine, serverName: non_genuine_server_name } = mongodb_build_info_1.default.getGenuineMongoDB(uri);
@@ -34,5 +34,5 @@ function getConnectInfo(uri, mongoshVersion, buildInfo, atlasVersion, topology,
34
34
  is_local_atlas: isLocalAtlas,
35
35
  };
36
36
  }
37
- exports.default = getConnectInfo;
37
+ exports.default = getConnectExtraInfo;
38
38
  //# sourceMappingURL=connect-info.js.map
@@ -1 +1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AC,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,SAAS,EAAE,4BAAY,CAAC,aAAa,CAAC,GAAG,CAAC;QAC1C,UAAU;QACV,aAAa,EAAE,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,YAAY,mCAAI,IAAI;QACjD,UAAU;QACV,uBAAuB;QACvB,cAAc,EAAE,YAAY;KAC7B,CAAC;AACJ,CAAC;AAzCD,sCAyCC"}
package/lib/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import './textencoder-polyfill';
2
2
  import ServiceProvider, { ServiceProviderCore } from './service-provider';
3
- import getConnectInfo, { ConnectInfo } from './connect-info';
3
+ import getConnectExtraInfo, { ConnectionExtraInfo } from './connect-info';
4
4
  import type { ReplPlatform } from './platform';
5
5
  declare const DEFAULT_DB = "test";
6
6
  import { bsonStringifiers } from './printable-bson';
@@ -8,6 +8,6 @@ import ShellAuthOptions from './shell-auth-options';
8
8
  export * from './all-transport-types';
9
9
  export * from './all-fle-types';
10
10
  export { MapReduceOptions, FinalizeFunction } from './map-reduce-options';
11
- export { CreateEncryptedCollectionOptions, CheckMetadataConsistencyOptions, } from './admin';
11
+ export { CreateEncryptedCollectionOptions, CheckMetadataConsistencyOptions, ConnectionInfo, } from './admin';
12
12
  export { bson } from './bson-export';
13
- export { ServiceProvider, ShellAuthOptions, getConnectInfo, ReplPlatform, DEFAULT_DB, ServiceProviderCore, bsonStringifiers, ConnectInfo, };
13
+ export { ServiceProvider, ShellAuthOptions, getConnectExtraInfo, ReplPlatform, DEFAULT_DB, ServiceProviderCore, bsonStringifiers, ConnectionExtraInfo, };
package/lib/index.js CHANGED
@@ -17,12 +17,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
17
17
  return (mod && mod.__esModule) ? mod : { "default": mod };
18
18
  };
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.bsonStringifiers = exports.ServiceProviderCore = exports.DEFAULT_DB = exports.getConnectInfo = exports.bson = void 0;
20
+ exports.bsonStringifiers = exports.ServiceProviderCore = exports.DEFAULT_DB = exports.getConnectExtraInfo = exports.bson = void 0;
21
21
  require("./textencoder-polyfill");
22
22
  const service_provider_1 = require("./service-provider");
23
23
  Object.defineProperty(exports, "ServiceProviderCore", { enumerable: true, get: function () { return service_provider_1.ServiceProviderCore; } });
24
24
  const connect_info_1 = __importDefault(require("./connect-info"));
25
- exports.getConnectInfo = connect_info_1.default;
25
+ exports.getConnectExtraInfo = connect_info_1.default;
26
26
  const DEFAULT_DB = 'test';
27
27
  exports.DEFAULT_DB = DEFAULT_DB;
28
28
  const printable_bson_1 = require("./printable-bson");
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;AAwBxE,oGAxBwB,sCAAmB,OAwBxB;AAvBrB,kEAA6D;AAoB3D,yBApBK,sBAAc,CAoBL;AAlBhB,MAAM,UAAU,GAAG,MAAM,CAAC;AAoBxB,gCAAU;AAnBZ,qDAAoD;AAqBlD,iGArBO,iCAAgB,OAqBP;AAnBlB,wDAAsC;AACtC,kDAAgC;AAShC,6CAAqC;AAA5B,mGAAA,IAAI,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAA0E;AAyBxE,oGAzBwB,sCAAmB,OAyBxB;AAxBrB,kEAA0E;AAqBxE,8BArBK,sBAAmB,CAqBL;AAnBrB,MAAM,UAAU,GAAG,MAAM,CAAC;AAqBxB,gCAAU;AApBZ,qDAAoD;AAsBlD,iGAtBO,iCAAgB,OAsBP;AApBlB,wDAAsC;AACtC,kDAAgC;AAUhC,6CAAqC;AAA5B,mGAAA,IAAI,OAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mongosh/service-provider-core",
3
- "version": "2.2.3",
3
+ "version": "2.2.5",
4
4
  "description": "MongoDB Shell Core Service Provider Package",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -44,7 +44,7 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@aws-sdk/credential-providers": "^3.525.0",
47
- "@mongosh/errors": "2.2.3",
47
+ "@mongosh/errors": "2.2.5",
48
48
  "bson": "^6.5.0",
49
49
  "mongodb": "^6.5.0",
50
50
  "mongodb-build-info": "^1.7.1",
@@ -54,12 +54,12 @@
54
54
  "mongodb-client-encryption": "^6.0.0"
55
55
  },
56
56
  "devDependencies": {
57
- "@mongodb-js/eslint-config-mongosh": "2.2.3",
57
+ "@mongodb-js/eslint-config-mongosh": "2.2.5",
58
58
  "@mongodb-js/prettier-config-devtools": "^1.0.1",
59
- "@mongodb-js/tsconfig-mongosh": "2.2.3",
59
+ "@mongodb-js/tsconfig-mongosh": "2.2.5",
60
60
  "depcheck": "^1.4.3",
61
61
  "eslint": "^7.25.0",
62
62
  "prettier": "^2.8.8"
63
63
  },
64
- "gitHead": "dd8ff1944de2da158c1738357ab0ba667a66404c"
64
+ "gitHead": "3a95f1de5ce644bf6e5453c73b6ccd05a35dcfa5"
65
65
  }
package/src/admin.ts CHANGED
@@ -13,7 +13,7 @@ import type {
13
13
  AutoEncryptionOptions,
14
14
  Collection,
15
15
  } from './all-transport-types';
16
- import type { bson as BSON } from './index';
16
+ import type { bson as BSON, ConnectionExtraInfo } from './index';
17
17
  import type { ReplPlatform } from './platform';
18
18
  import type {
19
19
  AWSEncryptionKeyOptions,
@@ -43,6 +43,12 @@ export interface CheckMetadataConsistencyOptions {
43
43
  checkIndexes?: 1;
44
44
  }
45
45
 
46
+ export interface ConnectionInfo {
47
+ buildInfo: Document | null;
48
+ topology: any | null;
49
+ extraInfo: (ConnectionExtraInfo & { fcv?: string }) | null;
50
+ }
51
+
46
52
  export default interface Admin {
47
53
  /**
48
54
  * What platform (Compass/CLI/Browser)
@@ -87,7 +93,7 @@ export default interface Admin {
87
93
  /**
88
94
  * Return connection info
89
95
  */
90
- getConnectionInfo(): Promise<Document>;
96
+ getConnectionInfo(): Promise<ConnectionInfo>;
91
97
 
92
98
  /**
93
99
  * Authenticate
@@ -2,35 +2,35 @@
2
2
 
3
3
  import getBuildInfo from 'mongodb-build-info';
4
4
 
5
- export interface ConnectInfo {
6
- is_atlas: boolean;
7
- is_localhost: boolean;
8
- is_do: boolean;
9
- server_version: string;
10
- mongosh_version: string;
5
+ export interface ConnectionExtraInfo {
6
+ is_atlas?: boolean;
7
+ is_localhost?: boolean;
8
+ is_do?: boolean;
9
+ server_version?: string;
10
+ mongosh_version?: string;
11
11
  server_os?: string;
12
12
  server_arch?: string;
13
- is_enterprise: boolean;
13
+ is_enterprise?: boolean;
14
14
  auth_type?: string;
15
- is_data_federation: boolean;
16
- is_stream: boolean;
15
+ is_data_federation?: boolean;
16
+ is_stream?: boolean;
17
17
  dl_version?: string;
18
18
  atlas_version?: string;
19
- is_genuine: boolean;
20
- non_genuine_server_name: string;
21
- node_version: string;
19
+ is_genuine?: boolean;
20
+ non_genuine_server_name?: string;
21
+ node_version?: string;
22
22
  uri: string;
23
- is_local_atlas: boolean;
23
+ is_local_atlas?: boolean;
24
24
  }
25
25
 
26
- export default function getConnectInfo(
26
+ export default function getConnectExtraInfo(
27
27
  uri: string,
28
28
  mongoshVersion: string,
29
29
  buildInfo: any,
30
30
  atlasVersion: any,
31
31
  topology: any,
32
32
  isLocalAtlas: boolean
33
- ): ConnectInfo {
33
+ ): ConnectionExtraInfo {
34
34
  buildInfo ??= {}; // We're currently not getting buildInfo with --apiStrict.
35
35
  const { isGenuine: is_genuine, serverName: non_genuine_server_name } =
36
36
  getBuildInfo.getGenuineMongoDB(uri);
package/src/index.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import './textencoder-polyfill'; // for mongodb-connection-string-url in the java-shell
2
2
  import ServiceProvider, { ServiceProviderCore } from './service-provider';
3
- import getConnectInfo, { ConnectInfo } from './connect-info';
3
+ import getConnectExtraInfo, { ConnectionExtraInfo } from './connect-info';
4
4
  import type { ReplPlatform } from './platform';
5
5
  const DEFAULT_DB = 'test';
6
6
  import { bsonStringifiers } from './printable-bson';
@@ -13,6 +13,7 @@ export { MapReduceOptions, FinalizeFunction } from './map-reduce-options';
13
13
  export {
14
14
  CreateEncryptedCollectionOptions,
15
15
  CheckMetadataConsistencyOptions,
16
+ ConnectionInfo,
16
17
  } from './admin';
17
18
 
18
19
  export { bson } from './bson-export';
@@ -20,10 +21,10 @@ export { bson } from './bson-export';
20
21
  export {
21
22
  ServiceProvider,
22
23
  ShellAuthOptions,
23
- getConnectInfo,
24
+ getConnectExtraInfo,
24
25
  ReplPlatform,
25
26
  DEFAULT_DB,
26
27
  ServiceProviderCore,
27
28
  bsonStringifiers,
28
- ConnectInfo,
29
+ ConnectionExtraInfo,
29
30
  };