Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mongosh/service-provider-core

Package Overview
Dependencies
Maintainers
7
Versions
123
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mongosh/service-provider-core - npm Package Compare versions

Comparing version 0.0.1-alpha.12 to 0.0.1-alpha.13

lib/admin.d.ts

6

lib/index.d.ts

@@ -6,2 +6,6 @@ import ServiceProvider from './service-provider';

import BulkWriteResult from './bulk-write-result';
export { ServiceProvider, BulkWriteResult, Document, Cursor, Result };
import WriteConcern from './write-concern';
import ReadConcern from './read-concern';
import CommandOptions from './command-options';
import DatabaseOptions from './database-options';
export { ServiceProvider, BulkWriteResult, Document, Cursor, Result, ReadConcern, WriteConcern, CommandOptions, DatabaseOptions };

25

lib/readable.d.ts
import Document from './document';
import Cursor from './cursor';
import Result from './result';
import DatabaseOptions from './database-options';
interface Readable {
aggregate(database: string, collection: string, pipeline: Document[], options?: Document, dbOptions?: Document): Cursor;
aggregateDb(database: string, pipeline: Document[], options?: Document, dbOptions?: Document): Cursor;
count(db: string, coll: string, query?: Document, options?: Document, dbOptions?: Document): Promise<Result>;
countDocuments(database: string, collection: string, filter?: Document, options?: Document): Promise<Result>;
distinct(database: string, collection: string, fieldName: string, filter?: Document, options?: Document, dbOptions?: Document): Promise<any>;
estimatedDocumentCount(database: string, collection: string, options?: Document): Promise<Result>;
find(database: string, collection: string, filter?: Document, options?: Document): Cursor;
getServerVersion(): Promise<string>;
aggregate(database: string, collection: string, pipeline: Document[], options?: Document, dbOptions?: DatabaseOptions): Cursor;
aggregateDb(database: string, pipeline: Document[], options?: Document, dbOptions?: DatabaseOptions): Cursor;
count(db: string, coll: string, query?: Document, options?: Document, dbOptions?: DatabaseOptions): Promise<Result>;
countDocuments(database: string, collection: string, filter?: Document, options?: Document, dbOptions?: DatabaseOptions): Promise<Result>;
distinct(database: string, collection: string, fieldName: string, filter?: Document, options?: Document, dbOptions?: DatabaseOptions): Promise<Result>;
estimatedDocumentCount(database: string, collection: string, options?: Document, dbOptions?: DatabaseOptions): Promise<Result>;
find(database: string, collection: string, filter?: Document, options?: Document, dbOptions?: DatabaseOptions): Cursor;
getTopology(): any;
listDatabases(database: string): Promise<Result>;
isCapped(database: string, collection: string): Promise<Result>;
getIndexes(database: string, collection: string, dbOptions?: Document): Promise<Result>;
listCollections(database: string, filter?: Document, options?: Document, dbOptions?: Document): Promise<Result>;
stats(database: string, collection: string, options?: Document, dbOptions?: Document): Promise<Result>;
isCapped(database: string, collection: string, dbOptions?: DatabaseOptions): Promise<Result>;
getIndexes(database: string, collection: string, dbOptions?: DatabaseOptions): Promise<Result>;
listCollections(database: string, filter?: Document, options?: Document, dbOptions?: DatabaseOptions): Promise<Result>;
stats(database: string, collection: string, options?: Document, dbOptions?: DatabaseOptions): Promise<Result>;
}
export default Readable;
import Readable from './readable';
import Writable from './writable';
interface ServiceProvider extends Readable, Writable {
close(boolean: any): Promise<void>;
import Closable from './closable';
import Admin from './admin';
interface ServiceProvider extends Readable, Writable, Closable, Admin {
}
export default ServiceProvider;
import Document from './document';
import Result from './result';
import BulkWriteResult from './bulk-write-result';
import CommandOptions from './command-options';
import WriteConcern from './write-concern';
import DatabaseOptions from './database-options';
interface Writable {
bulkWrite(database: string, collection: string, requests: Document, options?: Document, dbOptions?: Document): Promise<BulkWriteResult>;
deleteMany(database: string, collection: string, filter: Document, options?: Document, dbOptions?: Document): Promise<Result>;
deleteOne(database: string, collection: string, filter: Document, options?: Document, dbOptions?: Document): Promise<Result>;
findOneAndDelete(database: string, collection: string, filter: Document, options?: Document): Promise<Result>;
findOneAndReplace(database: string, collection: string, filter: Document, replacement: Document, options?: Document): Promise<Result>;
findOneAndUpdate(database: string, collection: string, filter: Document, update: Document, options?: Document): Promise<Result>;
insertMany(database: string, collection: string, docs: Document[], options?: Document, dbOptions?: Document): Promise<Result>;
insertOne(database: string, collection: string, doc: Document, options?: Document, dbOptions?: Document): Promise<Result>;
replaceOne(database: string, collection: string, filter: Document, replacement: Document, options?: Document, dbOptions?: Document): Promise<Result>;
updateMany(database: string, collection: string, filter: Document, update: Document, options?: Document, dbOptions?: Document): Promise<Result>;
updateOne(database: string, collection: string, filter: Document, update: Document, options?: Document, dbOptions?: Document): Promise<Result>;
save(database: string, collection: string, doc: Document, options?: Document, dbOptions?: Document): Promise<Result>;
runCommand(db: string, spec: Document, options?: Document): Promise<Result>;
dropDatabase(database: string, writeConcern?: Document): Promise<Result>;
remove(database: string, collection: string, query: Document, options?: Document, dbOptions?: Document): Promise<Result>;
convertToCapped(database: string, collection: string, size: number): Promise<Result>;
createIndexes(database: string, collection: string, indexSpecs: Document[], options?: Document, dbOptions?: Document): Promise<Result>;
dropIndexes(database: string, collection: string, indexes: string | string[] | Document | Document[], options?: Document, dbOptions?: Document): Promise<Result>;
reIndex(database: string, collection: string, options?: Document, dbOptions?: Document): Promise<Result>;
runCommand(db: string, spec: Document, options?: CommandOptions, dbOptions?: DatabaseOptions): Promise<Result>;
dropDatabase(database: string, writeConcern?: WriteConcern, dbOptions?: DatabaseOptions): Promise<Result>;
bulkWrite(database: string, collection: string, requests: Document, options?: Document, dbOptions?: DatabaseOptions): Promise<BulkWriteResult>;
deleteMany(database: string, collection: string, filter: Document, options?: Document, dbOptions?: DatabaseOptions): Promise<Result>;
deleteOne(database: string, collection: string, filter: Document, options?: Document, dbOptions?: DatabaseOptions): Promise<Result>;
findOneAndDelete(database: string, collection: string, filter: Document, options?: Document, dbOptions?: DatabaseOptions): Promise<Result>;
findOneAndReplace(database: string, collection: string, filter: Document, replacement: Document, options?: Document, dbOptions?: DatabaseOptions): Promise<Result>;
findOneAndUpdate(database: string, collection: string, filter: Document, update: Document, options?: Document, dbOptions?: DatabaseOptions): Promise<Result>;
insertMany(database: string, collection: string, docs: Document[], options?: Document, dbOptions?: DatabaseOptions): Promise<Result>;
insertOne(database: string, collection: string, doc: Document, options?: Document, dbOptions?: DatabaseOptions): Promise<Result>;
replaceOne(database: string, collection: string, filter: Document, replacement: Document, options?: Document, dbOptions?: DatabaseOptions): Promise<Result>;
updateMany(database: string, collection: string, filter: Document, update: Document, options?: Document, dbOptions?: DatabaseOptions): Promise<Result>;
findAndModify(database: string, collection: string, query: Document, sort: any[] | Document, update: Document, options?: Document, dbOptions?: DatabaseOptions): any;
updateOne(database: string, collection: string, filter: Document, update: Document, options?: Document, dbOptions?: DatabaseOptions): Promise<Result>;
save(database: string, collection: string, doc: Document, options?: Document, dbOptions?: DatabaseOptions): Promise<Result>;
remove(database: string, collection: string, query: Document, options?: Document, dbOptions?: DatabaseOptions): Promise<Result>;
convertToCapped(database: string, collection: string, size: number, options?: CommandOptions): Promise<Result>;
createIndexes(database: string, collection: string, indexSpecs: Document[], options?: Document, dbOptions?: DatabaseOptions): Promise<Result>;
dropIndexes(database: string, collection: string, indexes: string | string[] | Document | Document[], commandOptions?: CommandOptions, dbOptions?: DatabaseOptions): Promise<Result>;
reIndex(database: string, collection: string, options?: CommandOptions, dbOptions?: DatabaseOptions): Promise<Result>;
dropCollection(database: string, collection: string, dbOptions?: DatabaseOptions): Promise<boolean>;
renameCollection(database: string, oldName: string, newName: string, options?: Document, dbOptions?: DatabaseOptions): Promise<Result>;
}
export default Writable;
{
"name": "@mongosh/service-provider-core",
"version": "0.0.1-alpha.12",
"version": "0.0.1-alpha.13",
"description": "MongoDB Shell Core Service Provider Package",

@@ -37,3 +37,3 @@ "main": "lib/index.js",

},
"gitHead": "a1274954b1ebbc654260b5c0ecf61f9f38b178fc"
"gitHead": "cbd3d640a1a089fd677f7136e3d80f70bce7633f"
}

@@ -6,2 +6,6 @@ import ServiceProvider from './service-provider';

import BulkWriteResult from './bulk-write-result';
import WriteConcern from './write-concern';
import ReadConcern from './read-concern';
import CommandOptions from './command-options';
import DatabaseOptions from './database-options';

@@ -13,3 +17,7 @@ export {

Cursor,
Result
Result,
ReadConcern,
WriteConcern,
CommandOptions,
DatabaseOptions
};
import Document from './document';
import Cursor from './cursor';
import Result from './result';
import DatabaseOptions from './database-options';

@@ -17,3 +18,3 @@ /**

* @param {Document} options - The pipeline options.
*
* @param {DatabaseOptions} dbOptions - The database options
* @returns {Cursor} A cursor.

@@ -26,3 +27,3 @@ */

options?: Document,
dbOptions?: Document) : Cursor;
dbOptions?: DatabaseOptions) : Cursor;

@@ -42,3 +43,4 @@ /**

options?: Document,
dbOptions?: Document) : Cursor;
dbOptions?: DatabaseOptions
) : Cursor;

@@ -55,3 +57,3 @@ /**

* @param options
* @param dbOptions
* @param {DatabaseOptions} dbOptions - The database options
*

@@ -65,3 +67,3 @@ * @returns {Promise} A promise of the result.

options?: Document,
dbOptions?: Document): Promise<Result>;
dbOptions?: DatabaseOptions): Promise<Result>;

@@ -75,2 +77,3 @@ /**

* @param {Document} options - The count options.
* @param {DatabaseOptions} dbOptions - The database options
*

@@ -83,3 +86,4 @@ * @returns {Promise} A promise of the result.

filter?: Document,
options?: Document) : Promise<Result>;
options?: Document,
dbOptions?: DatabaseOptions): Promise<Result>;

@@ -94,2 +98,3 @@ /**

* @param {Document} options - The distinct options.
* @param {DatabaseOptions} dbOptions - The database options
*

@@ -104,3 +109,3 @@ * @returns {Cursor} The cursor.

options?: Document,
dbOptions?: Document) : Promise<any>;
dbOptions?: DatabaseOptions) : Promise<Result>;

@@ -113,2 +118,3 @@ /**

* @param {Document} options - The count options.
* @param {DatabaseOptions} dbOptions - The database options
*

@@ -120,3 +126,4 @@ * @returns {Promise} The promise of the result.

collection: string,
options?: Document) : Promise<Result>;
options?: Document,
dbOptions?: DatabaseOptions) : Promise<Result>;

@@ -130,2 +137,3 @@ /**

* @param {Document} options - The find options.
* @param {DatabaseOptions} dbOptions - The database options
*

@@ -138,3 +146,4 @@ * @returns {Promise} The promise of the cursor.

filter?: Document,
options?: Document) : Cursor;
options?: Document,
dbOptions?: DatabaseOptions) : Cursor;

@@ -146,3 +155,3 @@ /**

*/
getServerVersion(): Promise<string>;
getTopology(): any;

@@ -163,2 +172,4 @@ /**

* @param {String} collection - The collection name.
* @param {DatabaseOptions} dbOptions - The database options
*
* @returns {Promise} The promise of the result.

@@ -168,3 +179,4 @@ */

database: string,
collection: string): Promise<Result>;
collection: string,
dbOptions?: DatabaseOptions): Promise<Result>;

@@ -177,4 +189,3 @@ /**

* @param {String} collection - The collection name.
* @param {Object} dbOptions - The database options
* (i.e. readConcern, writeConcern. etc).
* @param {DatabaseOptions} dbOptions - The database options
*

@@ -186,3 +197,3 @@ * @return {Promise}

collection: string,
dbOptions?: Document): Promise<Result>;
dbOptions?: DatabaseOptions): Promise<Result>;

@@ -195,4 +206,3 @@ /**

* @param {Document} options - The command options.
* @param {Object} dbOptions - The database options
* (i.e. readConcern, writeConcern. etc).
* @param {DatabaseOptions} dbOptions - The database options
*

@@ -205,5 +215,5 @@ * @return {Promise}

options?: Document,
dbOptions?: Document): Promise<Result>;
dbOptions?: DatabaseOptions): Promise<Result>;
/*
/**
* Get all the collection statistics.

@@ -214,3 +224,4 @@ *

* @param {Object} options - The count options.
* @param {Object} dbOptions - The database options
* @param {DatabaseOptions} dbOptions - The database options
*
* @return {Promise} returns Promise

@@ -222,3 +233,3 @@ */

options?: Document,
dbOptions?: Document
dbOptions?: DatabaseOptions
): Promise<Result>

@@ -225,0 +236,0 @@ }

import Readable from './readable';
import Writable from './writable';
import Closable from './closable';
import Admin from './admin';

@@ -7,11 +9,4 @@ /**

*/
interface ServiceProvider extends Readable, Writable {
/**
* Close the connection.
*
* @param {boolean} force - Whether to force close.
*/
close(boolean): Promise<void>;
};
interface ServiceProvider extends Readable, Writable, Closable, Admin {};
export default ServiceProvider;
import Document from './document';
import Result from './result';
import BulkWriteResult from './bulk-write-result';
import CommandOptions from './command-options';
import WriteConcern from './write-concern';
import DatabaseOptions from './database-options';

@@ -9,3 +12,31 @@ /**

interface Writable {
/**
* @param {String} db - the db name
* @param spec
* @param options
* @return {any}
*/
runCommand(
db: string,
spec: Document,
options?: CommandOptions,
dbOptions?: DatabaseOptions
): Promise<Result>;
/**
* Drop a database
*
* @param {String} database - The database name.
* @param {WriteConcernDoc} writeConcern - The write concern.
*
* @returns {Promise<Result>} The result of the operation.
*/
dropDatabase(
database: string,
writeConcern?: WriteConcern,
dbOptions?: DatabaseOptions
) : Promise<Result>;
/**
* Execute a mix of write operations.

@@ -17,2 +48,3 @@ *

* @param {Document} options - The bulk write options.
* @param {DatabaseOptions} dbOptions - The database options
*

@@ -26,3 +58,3 @@ * @returns {Promise} The promise of the result.

options?: Document,
dbOptions?: Document) : Promise<BulkWriteResult>;
dbOptions?: DatabaseOptions) : Promise<BulkWriteResult>;

@@ -36,2 +68,3 @@ /**

* @param {Document} options - The delete many options.
* @param {DatabaseOptions} dbOptions - The database options
*

@@ -45,3 +78,3 @@ * @returns {Promise} The promise of the result.

options?: Document,
dbOptions?: Document) : Promise<Result>;
dbOptions?: DatabaseOptions) : Promise<Result>;

@@ -55,2 +88,3 @@ /**

* @param {Document} options - The delete one options.
* @param {DatabaseOptions} dbOptions - The database options
*

@@ -64,3 +98,3 @@ * @returns {Promise} The promise of the result.

options?: Document,
dbOptions?: Document) : Promise<Result>;
dbOptions?: DatabaseOptions) : Promise<Result>;

@@ -74,2 +108,3 @@ /**

* @param {Document} options - The find options.
* @param {DatabaseOptions} dbOptions - The database options
*

@@ -82,3 +117,4 @@ * @returns {Promise} The promise of the result.

filter: Document,
options?: Document) : Promise<Result>;
options?: Document,
dbOptions?: DatabaseOptions) : Promise<Result>;

@@ -93,2 +129,3 @@ /**

* @param {Document} options - The find options.
* @param {DatabaseOptions} dbOptions - The database options
*

@@ -102,3 +139,4 @@ * @returns {Promise} The promise of the result.

replacement: Document,
options?: Document) : Promise<Result>;
options?: Document,
dbOptions?: DatabaseOptions) : Promise<Result>;

@@ -113,2 +151,3 @@ /**

* @param {Document} options - The find options.
* @param {DatabaseOptions} dbOptions - The DB options
*

@@ -122,3 +161,4 @@ * @returns {Promise} The promise of the result.

update: Document,
options?: Document) : Promise<Result>;
options?: Document,
dbOptions?: DatabaseOptions) : Promise<Result>;

@@ -132,2 +172,3 @@ /**

* @param {Document} options - The insert many options.
* @param {DatabaseOptions} dbOptions - The DB options
*

@@ -141,3 +182,3 @@ * @returns {Promise} The promise of the result.

options?: Document,
dbOptions?: Document) : Promise<Result>;
dbOptions?: DatabaseOptions) : Promise<Result>;

@@ -151,2 +192,3 @@ /**

* @param {Document} options - The insert one options.
* @param {DatabaseOptions} dbOptions - The DB options
*

@@ -160,3 +202,3 @@ * @returns {Promise} The promise of the result.

options?: Document,
dbOptions?: Document) : Promise<Result>;
dbOptions?: DatabaseOptions) : Promise<Result>;

@@ -171,2 +213,3 @@ /**

* @param {Document} options - The replace options.
* @param {DatabaseOptions} dbOptions - The DB options
*

@@ -181,3 +224,3 @@ * @returns {Promise} The promise of the result.

options?: Document,
dbOptions?: Document) : Promise<Result>;
dbOptions?: DatabaseOptions) : Promise<Result>;

@@ -192,2 +235,3 @@ /**

* @param {Document} options - The update options.
* @param {DatabaseOptions} dbOptions - The DB options
*

@@ -202,5 +246,28 @@ * @returns {Promise} The promise of the result.

options?: Document,
dbOptions?: Document) : Promise<Result>;
dbOptions?: DatabaseOptions) : Promise<Result>;
/**
* find and update or remove a document.
*
* @param {String} database - The database name.
* @param {String} collection - The collection name.
* @param {Document} query - The filter.
* @param {Document} sort - The sort option.
* @param {Document} update - The update document.
* @param {Document} options - The update options.
* @param {DatabaseOptions} dbOptions - The DB options
*
* @returns {Promise} The promise of the result.
*/
findAndModify(
database: string,
collection: string,
query: Document,
sort: any[] | Document,
update: Document,
options?: Document,
dbOptions?: DatabaseOptions
)
/**
* Update a document.

@@ -213,2 +280,3 @@ *

* @param {Document} options - The update options.
* @param {DatabaseOptions} dbOptions - The DB options
*

@@ -223,3 +291,3 @@ * @returns {Promise} The promise of the result.

options?: Document,
dbOptions?: Document) : Promise<Result>;
dbOptions?: DatabaseOptions) : Promise<Result>;

@@ -233,3 +301,3 @@ /**

* @param {Object} options - The options.
* @param {Object} dbOptions - The DB options
* @param {DatabaseOptions} dbOptions - The DB options
* @return {Promise}

@@ -242,29 +310,5 @@ */

options?: Document,
dbOptions?: Document): Promise<Result>
dbOptions?: DatabaseOptions): Promise<Result>
/**
* @param {String} db - the db name
* @param spec
* @param options
* @return {any}
*/
runCommand(
db: string,
spec: Document,
options?: Document): Promise<Result>;
/**
* Drop a database
*
* @param {String} database - The database name.
* @param {WriteConcernDoc} writeConcern - The write concern.
*
* @returns {Promise<Result>} The result of the operation.
*/
dropDatabase(
database: string,
writeConcern?: Document
) : Promise<Result>;
/**
* Deprecated remove command.

@@ -276,2 +320,4 @@ *

* @param {Object} options - The options.
* @param {DatabaseOptions} dbOptions - The database options
*
* @return {Promise}

@@ -284,3 +330,3 @@ */

options?: Document,
dbOptions?: Document): Promise<Result>;
dbOptions?: DatabaseOptions): Promise<Result>;

@@ -294,2 +340,3 @@ /**

* @param {String} size - The maximum size, in bytes, for the capped collection.
* @param {CommandOptions} commandOptions - The command options
*

@@ -301,4 +348,4 @@ * @return {Promise}

collection: string,
size: number
): Promise<Result>
size: number,
options?: CommandOptions): Promise<Result>

@@ -312,3 +359,3 @@ /**

* @param {Object} options - The command options.
* @param {Object} dbOptions - The database options (i.e. readConcern, writeConcern. etc).
* @param {DatabaseOptions} dbOptions - The database options
* @return {Promise}

@@ -321,5 +368,4 @@ */

options?: Document,
dbOptions?: Document): Promise<Result>;
dbOptions?: DatabaseOptions): Promise<Result>;
/**

@@ -331,4 +377,3 @@ * Drop indexes for a collection.

* @param {string|string[]|Object|Object[]} indexes the indexes to be removed.
* @param {Object} options - The command options.
* @param {Object} dbOptions - The database options (i.e. readConcern, writeConcern. etc).
* @param {CommandOptions} commandOptions - The command options.
* @return {Promise}

@@ -340,4 +385,4 @@ */

indexes: string|string[]|Document|Document[],
options?: Document,
dbOptions?: Document): Promise<Result>;
commandOptions?: CommandOptions,
dbOptions?: DatabaseOptions): Promise<Result>;

@@ -349,4 +394,3 @@ /**

* @param {String} collection - The collection name.
* @param {Object} options - The command options.
* @param {Object} dbOptions - The database options (i.e. readConcern, writeConcern. etc).
* @param {CommandOptions} options - The command options.
* @return {Promise}

@@ -357,6 +401,35 @@ */

collection: string,
options?: CommandOptions,
dbOptions?: DatabaseOptions
): Promise<Result>;
/**
* Drops a collection.
*
* @param {String} database - The db name.
* @param {String} collection - The collection name.
* @param {DatabaseOptions} dbOptions - The database options
*
* @return {Promise}
*/
dropCollection(
database: string,
collection: string,
dbOptions?: DatabaseOptions
): Promise<boolean>;
/**
* @param {String} database - The db name.
* @param {String} oldName - The collection name.
* @param {String} newName - The new collection name.
* @param {String} options - The options.
*/
renameCollection(
database: string,
oldName: string,
newName: string,
options?: Document,
dbOptions?: Document): Promise<Result>;
dbOptions?: DatabaseOptions): Promise<Result>;
}
export default Writable;

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc