@qp-mongosh/service-provider-core 0.0.0-dev.3 → 0.0.0-dev.8

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 (71) hide show
  1. package/.eslintignore +2 -2
  2. package/.eslintrc.js +1 -1
  3. package/AUTHORS +11 -11
  4. package/LICENSE +200 -200
  5. package/package.json +54 -54
  6. package/src/admin.ts +119 -119
  7. package/src/all-fle-types.ts +17 -17
  8. package/src/all-transport-types.ts +80 -80
  9. package/src/cli-options.ts +49 -49
  10. package/src/closable.ts +14 -14
  11. package/src/connect-info.spec.ts +192 -192
  12. package/src/connect-info.ts +57 -57
  13. package/src/index.ts +62 -62
  14. package/src/platform.ts +6 -6
  15. package/src/printable-bson.spec.ts +75 -75
  16. package/src/printable-bson.ts +103 -103
  17. package/src/readable.ts +242 -242
  18. package/src/service-provider.ts +23 -23
  19. package/src/shell-auth-options.ts +7 -7
  20. package/src/textencoder-polyfill.spec.ts +11 -11
  21. package/src/textencoder-polyfill.ts +30 -30
  22. package/src/uri-generator.spec.ts +481 -481
  23. package/src/uri-generator.ts +265 -265
  24. package/src/writable.ts +367 -367
  25. package/tsconfig.json +12 -12
  26. package/tsconfig.lint.json +8 -8
  27. package/lib/admin.d.ts +0 -28
  28. package/lib/admin.js +0 -3
  29. package/lib/admin.js.map +0 -1
  30. package/lib/all-fle-types.d.ts +0 -2
  31. package/lib/all-fle-types.js +0 -3
  32. package/lib/all-fle-types.js.map +0 -1
  33. package/lib/all-transport-types.d.ts +0 -1
  34. package/lib/all-transport-types.js +0 -3
  35. package/lib/all-transport-types.js.map +0 -1
  36. package/lib/cli-options.d.ts +0 -43
  37. package/lib/cli-options.js +0 -3
  38. package/lib/cli-options.js.map +0 -1
  39. package/lib/closable.d.ts +0 -4
  40. package/lib/closable.js +0 -3
  41. package/lib/closable.js.map +0 -1
  42. package/lib/connect-info.d.ts +0 -19
  43. package/lib/connect-info.js +0 -35
  44. package/lib/connect-info.js.map +0 -1
  45. package/lib/index.d.ts +0 -31
  46. package/lib/index.js +0 -56
  47. package/lib/index.js.map +0 -1
  48. package/lib/platform.d.ts +0 -6
  49. package/lib/platform.js +0 -11
  50. package/lib/platform.js.map +0 -1
  51. package/lib/printable-bson.d.ts +0 -3
  52. package/lib/printable-bson.js +0 -82
  53. package/lib/printable-bson.js.map +0 -1
  54. package/lib/readable.d.ts +0 -18
  55. package/lib/readable.js +0 -3
  56. package/lib/readable.js.map +0 -1
  57. package/lib/service-provider.d.ts +0 -11
  58. package/lib/service-provider.js +0 -19
  59. package/lib/service-provider.js.map +0 -1
  60. package/lib/shell-auth-options.d.ts +0 -7
  61. package/lib/shell-auth-options.js +0 -3
  62. package/lib/shell-auth-options.js.map +0 -1
  63. package/lib/textencoder-polyfill.d.ts +0 -2
  64. package/lib/textencoder-polyfill.js +0 -22
  65. package/lib/textencoder-polyfill.js.map +0 -1
  66. package/lib/uri-generator.d.ts +0 -8
  67. package/lib/uri-generator.js +0 -176
  68. package/lib/uri-generator.js.map +0 -1
  69. package/lib/writable.d.ts +0 -22
  70. package/lib/writable.js +0 -3
  71. package/lib/writable.js.map +0 -1
package/tsconfig.json CHANGED
@@ -1,12 +1,12 @@
1
- {
2
- "extends": "../../config/tsconfig.base.json",
3
- "compilerOptions": {
4
- "outDir": "./lib"
5
- },
6
- "include": [
7
- "./src/**/*"
8
- ],
9
- "exclude": [
10
- "./src/**/*.spec.*"
11
- ]
12
- }
1
+ {
2
+ "extends": "../../config/tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "outDir": "./lib"
5
+ },
6
+ "include": [
7
+ "./src/**/*"
8
+ ],
9
+ "exclude": [
10
+ "./src/**/*.spec.*"
11
+ ]
12
+ }
@@ -1,8 +1,8 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "include": [
4
- "./src/**/*",
5
- "./test/**/*"
6
- ],
7
- "exclude": []
8
- }
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "include": [
4
+ "./src/**/*",
5
+ "./test/**/*"
6
+ ],
7
+ "exclude": []
8
+ }
package/lib/admin.d.ts DELETED
@@ -1,28 +0,0 @@
1
- import ShellAuthOptions from './shell-auth-options';
2
- import type { MongoClientOptions, ReadConcern, ReadPreference, WriteConcern, Document, CreateCollectionOptions, ClientSession, DbOptions, ClientSessionOptions, ListDatabasesOptions, AutoEncryptionOptions } from './all-transport-types';
3
- import type { bson as BSON } from './index';
4
- import { ReplPlatform } from './platform';
5
- import { FLE } from './all-fle-types';
6
- export default interface Admin {
7
- platform: ReplPlatform;
8
- initialDb: string;
9
- bsonLibrary: typeof BSON;
10
- listDatabases(database: string, options?: ListDatabasesOptions): Promise<Document>;
11
- getNewConnection(uri: string, options: MongoClientOptions): Promise<any>;
12
- getURI(): string | undefined;
13
- getConnectionInfo(): Promise<Document>;
14
- authenticate(authDoc: ShellAuthOptions): Promise<{
15
- ok: number;
16
- }>;
17
- createCollection(dbName: string, collName: string, options: CreateCollectionOptions, dbOptions?: DbOptions): Promise<{
18
- ok: number;
19
- }>;
20
- getReadPreference(): ReadPreference;
21
- getReadConcern(): ReadConcern | undefined;
22
- getWriteConcern(): WriteConcern | undefined;
23
- resetConnectionOptions(options: MongoClientOptions): Promise<void>;
24
- startSession(options: ClientSessionOptions): ClientSession;
25
- getRawClient(): any;
26
- fle?: FLE | undefined;
27
- getFleOptions?: () => AutoEncryptionOptions | undefined;
28
- }
package/lib/admin.js DELETED
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=admin.js.map
package/lib/admin.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"admin.js","sourceRoot":"","sources":["../src/admin.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export type { AWSEncryptionKeyOptions, AzureEncryptionKeyOptions, GCPEncryptionKeyOptions, ClientEncryption, ClientEncryptionCreateDataKeyCallback, ClientEncryptionCreateDataKeyProviderOptions, ClientEncryptionDataKeyProvider, ClientEncryptionDecryptCallback, ClientEncryptionEncryptCallback, ClientEncryptionEncryptOptions, ClientEncryptionOptions, ClientEncryptionTlsOptions, KMSProviders } from 'mongodb-client-encryption';
2
- export declare type FLE = typeof import('mongodb-client-encryption');
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=all-fle-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"all-fle-types.js","sourceRoot":"","sources":["../src/all-fle-types.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- export type { AggregateOptions, AggregationCursor, AnyBulkWriteOperation, Batch, BulkResult, BulkWriteOptions, BulkWriteResult, ChangeStream, ChangeStreamOptions, ClientSession, CloseOptions, CollationOptions, CollStatsOptions, Collection, CommandOperationOptions, CountDocumentsOptions, CountOptions, CreateCollectionOptions, CreateIndexesOptions, ClientSessionOptions, ClusterTime, FindCursor, CursorFlag, Db, DbOptions, DeleteOptions, DeleteResult, DistinctOptions, Document, DropCollectionOptions, DropDatabaseOptions, EstimatedDocumentCountOptions, ExplainOptions, ExplainVerbosityLike, FindOneAndDeleteOptions, FindOneAndUpdateOptions, FindOneAndReplaceOptions, FindOperators, FindOptions, HedgeOptions, IndexDescription, InsertManyResult, InsertOneOptions, InsertOneResult, ListCollectionsOptions, ListDatabasesOptions, ListIndexesOptions, MapReduceOptions, 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 'qp-mongodb';
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=all-transport-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"all-transport-types.js","sourceRoot":"","sources":["../src/all-transport-types.ts"],"names":[],"mappings":""}
@@ -1,43 +0,0 @@
1
- export default interface CliOptions {
2
- connectionSpecifier?: string;
3
- fileNames?: string[];
4
- apiDeprecationErrors?: boolean;
5
- apiStrict?: boolean;
6
- apiVersion?: string;
7
- authenticationDatabase?: string;
8
- authenticationMechanism?: string;
9
- awsAccessKeyId?: string;
10
- awsIamSessionToken?: string;
11
- awsSecretAccessKey?: string;
12
- awsSessionToken?: string;
13
- db?: string;
14
- eval?: string;
15
- gssapiServiceName?: string;
16
- sspiHostnameCanonicalization?: string;
17
- sspiRealmOverride?: string;
18
- help?: boolean;
19
- host?: string;
20
- ipv6?: boolean;
21
- keyVaultNamespace?: string;
22
- kmsURL?: string;
23
- nodb?: boolean;
24
- norc?: boolean;
25
- password?: string;
26
- port?: string;
27
- quiet?: boolean;
28
- retryWrites?: boolean;
29
- shell?: boolean;
30
- tls?: boolean;
31
- tlsAllowInvalidCertificates?: boolean;
32
- tlsAllowInvalidHostnames?: boolean;
33
- tlsCAFile?: string;
34
- tlsCertificateKeyFile?: string;
35
- tlsCertificateKeyFilePassword?: string;
36
- tlsCertificateSelector?: string;
37
- tlsCRLFile?: string;
38
- tlsDisabledProtocols?: boolean;
39
- tlsFIPSMode?: boolean;
40
- username?: string;
41
- verbose?: boolean;
42
- version?: boolean;
43
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=cli-options.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli-options.js","sourceRoot":"","sources":["../src/cli-options.ts"],"names":[],"mappings":""}
package/lib/closable.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export default interface Closable {
2
- close(force: boolean): Promise<void>;
3
- suspend(): Promise<() => Promise<void>>;
4
- }
package/lib/closable.js DELETED
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=closable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"closable.js","sourceRoot":"","sources":["../src/closable.ts"],"names":[],"mappings":""}
@@ -1,19 +0,0 @@
1
- export interface ConnectInfo {
2
- is_atlas: boolean;
3
- is_localhost: boolean;
4
- is_do: boolean;
5
- server_version: string;
6
- mongosh_version: string;
7
- server_os?: string;
8
- server_arch?: string;
9
- is_enterprise: boolean;
10
- auth_type?: string;
11
- is_data_lake: boolean;
12
- dl_version?: string;
13
- atlas_version?: string;
14
- is_genuine: boolean;
15
- non_genuine_server_name: string;
16
- node_version: string;
17
- uri: string;
18
- }
19
- export default function getConnectInfo(uri: string, mongoshVersion: string, buildInfo: any, cmdLineOpts: any, atlasVersion: any, topology: any): ConnectInfo;
@@ -1,35 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const mongodb_build_info_1 = __importDefault(require("mongodb-build-info"));
7
- function getConnectInfo(uri, mongoshVersion, buildInfo, cmdLineOpts, atlasVersion, topology) {
8
- var _a;
9
- buildInfo !== null && buildInfo !== void 0 ? buildInfo : (buildInfo = {});
10
- const { isGenuine: is_genuine, serverName: non_genuine_server_name } = mongodb_build_info_1.default.getGenuineMongoDB(buildInfo, cmdLineOpts);
11
- const { isDataLake: is_data_lake, dlVersion: dl_version } = mongodb_build_info_1.default.getDataLake(buildInfo);
12
- const auth_type = topology.s.credentials
13
- ? topology.s.credentials.mechanism : null;
14
- const { serverOs: server_os, serverArch: server_arch } = mongodb_build_info_1.default.getBuildEnv(buildInfo);
15
- return {
16
- is_atlas: !!(atlasVersion === null || atlasVersion === void 0 ? void 0 : atlasVersion.atlasVersion) || mongodb_build_info_1.default.isAtlas(uri),
17
- is_localhost: mongodb_build_info_1.default.isLocalhost(uri),
18
- is_do: mongodb_build_info_1.default.isDigitalOcean(uri),
19
- server_version: buildInfo.version,
20
- node_version: process.version,
21
- mongosh_version: mongoshVersion,
22
- server_os,
23
- uri,
24
- server_arch,
25
- is_enterprise: mongodb_build_info_1.default.isEnterprise(buildInfo),
26
- auth_type,
27
- is_data_lake,
28
- dl_version,
29
- atlas_version: (_a = atlasVersion === null || atlasVersion === void 0 ? void 0 : atlasVersion.atlasVersion) !== null && _a !== void 0 ? _a : null,
30
- is_genuine,
31
- non_genuine_server_name
32
- };
33
- }
34
- exports.default = getConnectInfo;
35
- //# sourceMappingURL=connect-info.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"connect-info.js","sourceRoot":"","sources":["../src/connect-info.ts"],"names":[],"mappings":";;;;;AAGA,4EAA8C;AAqB9C,SAAwB,cAAc,CAAC,GAAW,EAAE,cAAsB,EAAE,SAAc,EAAE,WAAgB,EAAE,YAAiB,EAAE,QAAa;;IAC5I,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,SAAS,EAAE,WAAW,CAAC,CAAC;IACzD,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,GACrD,4BAAY,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IAIxC,MAAM,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,WAAW;QACtC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;IAC5C,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,GAClD,4BAAY,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IAExC,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,YAAY;QACZ,UAAU;QACV,aAAa,EAAE,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,YAAY,mCAAI,IAAI;QACjD,UAAU;QACV,uBAAuB;KACxB,CAAC;AACJ,CAAC;AAhCD,iCAgCC"}
package/lib/index.d.ts DELETED
@@ -1,31 +0,0 @@
1
- import './textencoder-polyfill';
2
- import ServiceProvider, { ServiceProviderCore } from './service-provider';
3
- import getConnectInfo, { ConnectInfo } from './connect-info';
4
- import { ReplPlatform } from './platform';
5
- import CliOptions from './cli-options';
6
- import generateUri from './uri-generator';
7
- declare const DEFAULT_DB = "test";
8
- import { ObjectId, DBRef, MaxKey, MinKey, Timestamp, BSONSymbol, Code, Decimal128, Int32, Long, Binary, calculateObjectSize, Double, EJSON, BSONRegExp } from 'bson';
9
- import { bsonStringifiers } from './printable-bson';
10
- import ShellAuthOptions from './shell-auth-options';
11
- export * from './all-transport-types';
12
- export * from './all-fle-types';
13
- declare const bson: {
14
- ObjectId: typeof ObjectId;
15
- DBRef: typeof DBRef;
16
- MaxKey: typeof MaxKey;
17
- MinKey: typeof MinKey;
18
- Timestamp: typeof Timestamp;
19
- BSONSymbol: typeof BSONSymbol;
20
- Code: typeof Code;
21
- Decimal128: typeof Decimal128;
22
- Int32: typeof Int32;
23
- Long: typeof Long;
24
- Binary: typeof Binary;
25
- Map: MapConstructor;
26
- calculateObjectSize: typeof calculateObjectSize;
27
- Double: typeof Double;
28
- EJSON: typeof EJSON;
29
- BSONRegExp: typeof BSONRegExp;
30
- };
31
- export { ServiceProvider, ShellAuthOptions, getConnectInfo, ReplPlatform, CliOptions, generateUri, DEFAULT_DB, ServiceProviderCore, bson, bsonStringifiers, ConnectInfo };
package/lib/index.js DELETED
@@ -1,56 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- var __importDefault = (this && this.__importDefault) || function (mod) {
17
- return (mod && mod.__esModule) ? mod : { "default": mod };
18
- };
19
- Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.bsonStringifiers = exports.bson = exports.ServiceProviderCore = exports.DEFAULT_DB = exports.generateUri = exports.ReplPlatform = exports.getConnectInfo = void 0;
21
- require("./textencoder-polyfill");
22
- const service_provider_1 = require("./service-provider");
23
- Object.defineProperty(exports, "ServiceProviderCore", { enumerable: true, get: function () { return service_provider_1.ServiceProviderCore; } });
24
- const connect_info_1 = __importDefault(require("./connect-info"));
25
- exports.getConnectInfo = connect_info_1.default;
26
- const platform_1 = require("./platform");
27
- Object.defineProperty(exports, "ReplPlatform", { enumerable: true, get: function () { return platform_1.ReplPlatform; } });
28
- const uri_generator_1 = __importDefault(require("./uri-generator"));
29
- exports.generateUri = uri_generator_1.default;
30
- const DEFAULT_DB = 'test';
31
- exports.DEFAULT_DB = DEFAULT_DB;
32
- const bson_1 = require("bson");
33
- const printable_bson_1 = require("./printable-bson");
34
- Object.defineProperty(exports, "bsonStringifiers", { enumerable: true, get: function () { return printable_bson_1.bsonStringifiers; } });
35
- __exportStar(require("./all-transport-types"), exports);
36
- __exportStar(require("./all-fle-types"), exports);
37
- const bson = {
38
- ObjectId: bson_1.ObjectId,
39
- DBRef: bson_1.DBRef,
40
- MaxKey: bson_1.MaxKey,
41
- MinKey: bson_1.MinKey,
42
- Timestamp: bson_1.Timestamp,
43
- BSONSymbol: bson_1.BSONSymbol,
44
- Code: bson_1.Code,
45
- Decimal128: bson_1.Decimal128,
46
- Int32: bson_1.Int32,
47
- Long: bson_1.Long,
48
- Binary: bson_1.Binary,
49
- Map: bson_1.Map,
50
- calculateObjectSize: bson_1.calculateObjectSize,
51
- Double: bson_1.Double,
52
- EJSON: bson_1.EJSON,
53
- BSONRegExp: bson_1.BSONRegExp
54
- };
55
- exports.bson = bson;
56
- //# sourceMappingURL=index.js.map
package/lib/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,kCAAgC;AAChC,yDAA0E;AAwDxE,oGAxDwB,sCAAmB,OAwDxB;AAvDrB,kEAA6D;AAkD3D,yBAlDK,sBAAc,CAkDL;AAjDhB,yCAA0C;AAkDxC,6FAlDO,uBAAY,OAkDP;AAhDd,oEAA0C;AAkDxC,sBAlDK,uBAAW,CAkDL;AAjDb,MAAM,UAAU,GAAG,MAAM,CAAC;AAkDxB,gCAAU;AAjDZ,+BAiBc;AACd,qDAAoD;AAkClD,iGAlCO,iCAAgB,OAkCP;AAhClB,wDAAsC;AACtC,kDAAgC;AAEhC,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,GAAG,EAAH,UAAG;IACH,mBAAmB,EAAnB,0BAAmB;IACnB,MAAM,EAAN,aAAM;IACN,KAAK,EAAL,YAAK;IACL,UAAU,EAAV,iBAAU;CACX,CAAC;AAWA,oBAAI"}
package/lib/platform.d.ts DELETED
@@ -1,6 +0,0 @@
1
- export declare enum ReplPlatform {
2
- Compass = 0,
3
- Browser = 1,
4
- CLI = 2,
5
- JavaShell = 3
6
- }
package/lib/platform.js DELETED
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ReplPlatform = void 0;
4
- var ReplPlatform;
5
- (function (ReplPlatform) {
6
- ReplPlatform[ReplPlatform["Compass"] = 0] = "Compass";
7
- ReplPlatform[ReplPlatform["Browser"] = 1] = "Browser";
8
- ReplPlatform[ReplPlatform["CLI"] = 2] = "CLI";
9
- ReplPlatform[ReplPlatform["JavaShell"] = 3] = "JavaShell";
10
- })(ReplPlatform = exports.ReplPlatform || (exports.ReplPlatform = {}));
11
- //# sourceMappingURL=platform.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"platform.js","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":";;;AAAA,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,qDAAO,CAAA;IACP,qDAAO,CAAA;IACP,6CAAG,CAAA;IACH,yDAAS,CAAA;AACX,CAAC,EALW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAKvB"}
@@ -1,3 +0,0 @@
1
- import { bson as BSON } from './index';
2
- export declare const bsonStringifiers: Record<string, (this: any, depth: any, options: any) => string>;
3
- export default function (bson?: typeof BSON): void;
@@ -1,82 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.bsonStringifiers = void 0;
4
- const index_1 = require("./index");
5
- const util_1 = require("util");
6
- const inspectCustom = Symbol.for('nodejs.util.inspect.custom');
7
- exports.bsonStringifiers = {
8
- ObjectId: function () {
9
- return `ObjectId("${this.toHexString()}")`;
10
- },
11
- DBRef: function (depth, options) {
12
- return `DBRef("${this.namespace}", ` +
13
- (0, util_1.inspect)(this.oid, options) +
14
- (this.db ? `, "${this.db}"` : '') +
15
- ')';
16
- },
17
- MaxKey: function () {
18
- return 'MaxKey()';
19
- },
20
- MinKey: function () {
21
- return 'MinKey()';
22
- },
23
- Timestamp: function () {
24
- return `Timestamp({ t: ${this.getHighBits()}, i: ${this.getLowBits()} })`;
25
- },
26
- BSONSymbol: function () {
27
- return `BSONSymbol("${this.valueOf()}")`;
28
- },
29
- Code: function () {
30
- const j = this.toJSON();
31
- return `Code("${j.code}"${j.scope ? `, ${JSON.stringify(j.scope)}` : ''})`;
32
- },
33
- Decimal128: function () {
34
- return `Decimal128("${this.toString()}")`;
35
- },
36
- Int32: function () {
37
- return `Int32(${this.valueOf()})`;
38
- },
39
- Long: function () {
40
- return `Long("${this.toString()}"${this.unsigned ? ', true' : ''})`;
41
- },
42
- BSONRegExp: function () {
43
- return `BSONRegExp(${JSON.stringify(this.pattern)}, ${JSON.stringify(this.options)})`;
44
- },
45
- Binary: function () {
46
- const asBuffer = this.value(true);
47
- switch (this.sub_type) {
48
- case index_1.bson.Binary.SUBTYPE_MD5:
49
- return `MD5("${asBuffer.toString('hex')}")`;
50
- case index_1.bson.Binary.SUBTYPE_UUID:
51
- if (asBuffer.length === 16) {
52
- const hex = asBuffer.toString('hex');
53
- const asUUID = hex.match(/^(.{8})(.{4})(.{4})(.{4})(.{12})$/)
54
- .slice(1, 6).join('-');
55
- return `UUID("${asUUID}")`;
56
- }
57
- default:
58
- return `Binary(Buffer.from("${asBuffer.toString('hex')}", "hex"), ${this.sub_type})`;
59
- }
60
- },
61
- };
62
- exports.bsonStringifiers.ObjectID = exports.bsonStringifiers.ObjectId;
63
- function default_1(bson) {
64
- if (!bson) {
65
- bson = index_1.bson;
66
- }
67
- for (const [key, stringifier] of Object.entries(exports.bsonStringifiers)) {
68
- if (!(key in bson)) {
69
- continue;
70
- }
71
- const cls = bson[key];
72
- for (const key of [inspectCustom, 'inspect']) {
73
- try {
74
- cls.prototype[key] = stringifier;
75
- }
76
- catch (_a) {
77
- }
78
- }
79
- }
80
- }
81
- exports.default = default_1;
82
- //# sourceMappingURL=printable-bson.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"printable-bson.js","sourceRoot":"","sources":["../src/printable-bson.ts"],"names":[],"mappings":"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"}
package/lib/readable.d.ts DELETED
@@ -1,18 +0,0 @@
1
- import type { Document, AggregateOptions, CountOptions, CountDocumentsOptions, DistinctOptions, EstimatedDocumentCountOptions, FindOptions, ListCollectionsOptions, CollStatsOptions, ListIndexesOptions, AggregationCursor, FindCursor, DbOptions, ReadPreferenceFromOptions, ReadPreferenceLike } from './all-transport-types';
2
- import { ChangeStream, ChangeStreamOptions } from './all-transport-types';
3
- export default interface Readable {
4
- aggregate(database: string, collection: string, pipeline: Document[], options?: AggregateOptions, dbOptions?: DbOptions): AggregationCursor;
5
- aggregateDb(database: string, pipeline: Document[], options?: AggregateOptions, dbOptions?: DbOptions): AggregationCursor;
6
- count(db: string, coll: string, query?: Document, options?: CountOptions, dbOptions?: DbOptions): Promise<number>;
7
- countDocuments(database: string, collection: string, filter?: Document, options?: CountDocumentsOptions, dbOptions?: DbOptions): Promise<number>;
8
- distinct(database: string, collection: string, fieldName: string, filter?: Document, options?: DistinctOptions, dbOptions?: DbOptions): Promise<Document>;
9
- estimatedDocumentCount(database: string, collection: string, options?: EstimatedDocumentCountOptions, dbOptions?: DbOptions): Promise<number>;
10
- find(database: string, collection: string, filter?: Document, options?: FindOptions, dbOptions?: DbOptions): FindCursor;
11
- getTopology(): any;
12
- isCapped(database: string, collection: string, dbOptions?: DbOptions): Promise<boolean>;
13
- getIndexes(database: string, collection: string, options: ListIndexesOptions, dbOptions?: DbOptions): Promise<Document[]>;
14
- listCollections(database: string, filter?: Document, options?: ListCollectionsOptions, dbOptions?: DbOptions): Promise<Document[]>;
15
- readPreferenceFromOptions(options?: Omit<ReadPreferenceFromOptions, 'session'>): ReadPreferenceLike | undefined;
16
- stats(database: string, collection: string, options?: CollStatsOptions, dbOptions?: DbOptions): Promise<Document>;
17
- watch(pipeline: Document[], options: ChangeStreamOptions, dbOptions?: DbOptions, db?: string, coll?: string): ChangeStream<Document>;
18
- }
package/lib/readable.js DELETED
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=readable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"readable.js","sourceRoot":"","sources":["../src/readable.ts"],"names":[],"mappings":""}
@@ -1,11 +0,0 @@
1
- import Admin from './admin';
2
- import Closable from './closable';
3
- import Readable from './readable';
4
- import Writable from './writable';
5
- import type { bson as BSON } from './index';
6
- export default interface ServiceProvider extends Readable, Writable, Closable, Admin {
7
- }
8
- export declare class ServiceProviderCore {
9
- bsonLibrary: typeof BSON;
10
- constructor(bsonLibrary?: typeof BSON);
11
- }
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ServiceProviderCore = void 0;
7
- const errors_1 = require("@qp-mongosh/errors");
8
- const printable_bson_1 = __importDefault(require("./printable-bson"));
9
- class ServiceProviderCore {
10
- constructor(bsonLibrary) {
11
- if (bsonLibrary === undefined) {
12
- throw new errors_1.MongoshInternalError('BSON Library is undefined.');
13
- }
14
- (0, printable_bson_1.default)(bsonLibrary);
15
- this.bsonLibrary = bsonLibrary;
16
- }
17
- }
18
- exports.ServiceProviderCore = ServiceProviderCore;
19
- //# sourceMappingURL=service-provider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"service-provider.js","sourceRoot":"","sources":["../src/service-provider.ts"],"names":[],"mappings":";;;;;;AAAA,+CAA0D;AAG1D,sEAAiD;AAUjD,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 +0,0 @@
1
- export default interface ShellAuthOptions {
2
- user: string;
3
- pwd: string;
4
- mechanism?: string;
5
- digestPassword?: boolean;
6
- authDb?: string;
7
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=shell-auth-options.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shell-auth-options.js","sourceRoot":"","sources":["../src/shell-auth-options.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- declare function textEncodingPolyfill(): any;
2
- export { textEncodingPolyfill };
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.textEncodingPolyfill = void 0;
4
- if (typeof TextDecoder !== 'function' || typeof TextEncoder !== 'function') {
5
- Object.assign(Function('return this')(), textEncodingPolyfill());
6
- }
7
- function textEncodingPolyfill() {
8
- class TextEncoder {
9
- encode(string) {
10
- return Buffer.from(string, 'utf8');
11
- }
12
- }
13
- class TextDecoder {
14
- decode(bytes) {
15
- const str = Buffer.from(bytes).toString('utf8');
16
- return str.slice(+str.startsWith('\ufeff'));
17
- }
18
- }
19
- return { TextDecoder, TextEncoder };
20
- }
21
- exports.textEncodingPolyfill = textEncodingPolyfill;
22
- //# sourceMappingURL=textencoder-polyfill.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"textencoder-polyfill.js","sourceRoot":"","sources":["../src/textencoder-polyfill.ts"],"names":[],"mappings":";;;AAIA,IAGE,OAAO,WAAW,KAAK,UAAU,IAAI,OAAO,WAAW,KAAK,UAAU,EACtE;IAEA,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"}
@@ -1,8 +0,0 @@
1
- import CliOptions from './cli-options';
2
- declare enum Scheme {
3
- Mongo = "mongodb://",
4
- MongoSrv = "mongodb+srv://"
5
- }
6
- declare function generateUri(options: CliOptions): string;
7
- export default generateUri;
8
- export { Scheme };