@qp-mongosh/shell-api 0.0.0-dev.0 → 0.0.0-dev.3
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/.eslintignore +2 -2
- package/.eslintrc.js +1 -1
- package/AUTHORS +15 -15
- package/LICENSE +200 -200
- package/bin/report-missing-help.ts +24 -24
- package/bin/report-supported-api.ts +14 -14
- package/lib/abstract-cursor.d.ts +33 -33
- package/lib/abstract-cursor.js +191 -191
- package/lib/aggregation-cursor.d.ts +6 -6
- package/lib/aggregation-cursor.js +19 -19
- package/lib/bulk.d.ts +43 -43
- package/lib/bulk.js +223 -223
- package/lib/change-stream-cursor.d.ts +28 -28
- package/lib/change-stream-cursor.js +111 -111
- package/lib/collection.d.ts +95 -95
- package/lib/collection.js +964 -964
- package/lib/cursor.d.ts +32 -32
- package/lib/cursor.js +215 -215
- package/lib/database.d.ts +116 -116
- package/lib/database.js +1223 -1223
- package/lib/dbquery.d.ts +8 -8
- package/lib/dbquery.js +28 -28
- package/lib/decorators.d.ts +73 -73
- package/lib/decorators.js +395 -395
- package/lib/enums.d.ts +28 -28
- package/lib/enums.js +33 -33
- package/lib/error-codes.d.ts +12 -12
- package/lib/error-codes.js +19 -19
- package/lib/explainable-cursor.d.ts +11 -11
- package/lib/explainable-cursor.js +31 -31
- package/lib/explainable.d.ts +32 -32
- package/lib/explainable.js +166 -166
- package/lib/field-level-encryption.d.ts +50 -50
- package/lib/field-level-encryption.js +176 -176
- package/lib/help.d.ts +22 -22
- package/lib/help.js +26 -26
- package/lib/helpers.d.ts +71 -71
- package/lib/helpers.js +588 -588
- package/lib/index.d.ts +16 -16
- package/lib/index.js +45 -45
- package/lib/interruptor.d.ts +19 -19
- package/lib/interruptor.js +62 -62
- package/lib/mongo-errors.d.ts +5 -5
- package/lib/mongo-errors.js +37 -37
- package/lib/mongo.d.ts +75 -75
- package/lib/mongo.js +476 -476
- package/lib/no-db.d.ts +5 -5
- package/lib/no-db.js +28 -28
- package/lib/plan-cache.d.ts +16 -16
- package/lib/plan-cache.js +70 -70
- package/lib/replica-set.d.ts +45 -45
- package/lib/replica-set.js +314 -314
- package/lib/result.d.ts +61 -61
- package/lib/result.js +104 -104
- package/lib/session.d.ts +25 -25
- package/lib/session.js +88 -88
- package/lib/shard.d.ts +42 -42
- package/lib/shard.js +414 -414
- package/lib/shell-api.d.ts +52 -52
- package/lib/shell-api.js +298 -298
- package/lib/shell-bson.d.ts +40 -40
- package/lib/shell-bson.js +159 -159
- package/lib/shell-instance-state.d.ts +77 -77
- package/lib/shell-instance-state.js +392 -392
- package/package.json +47 -47
- package/tsconfig.lint.json +8 -8
package/lib/database.d.ts
CHANGED
|
@@ -1,116 +1,116 @@
|
|
|
1
|
-
import Mongo from './mongo';
|
|
2
|
-
import Collection from './collection';
|
|
3
|
-
import { ShellApiWithMongoClass } from './decorators';
|
|
4
|
-
import { asPrintable } from './enums';
|
|
5
|
-
import type { ChangeStreamOptions, CommandOperationOptions, CreateCollectionOptions, Document, WriteConcern, ListCollectionsOptions } from '@qp-mongosh/service-provider-core';
|
|
6
|
-
import { AggregationCursor, CommandResult } from './index';
|
|
7
|
-
import Session from './session';
|
|
8
|
-
import ChangeStreamCursor from './change-stream-cursor';
|
|
9
|
-
export declare type CollectionNamesWithTypes = {
|
|
10
|
-
name: string;
|
|
11
|
-
badge: string;
|
|
12
|
-
};
|
|
13
|
-
declare type AuthDoc = {
|
|
14
|
-
user: string;
|
|
15
|
-
pwd: string;
|
|
16
|
-
authDb?: string;
|
|
17
|
-
mechanism?: string;
|
|
18
|
-
};
|
|
19
|
-
export default class Database extends ShellApiWithMongoClass {
|
|
20
|
-
_mongo: Mongo;
|
|
21
|
-
_name: string;
|
|
22
|
-
_collections: Record<string, Collection>;
|
|
23
|
-
_session: Session | undefined;
|
|
24
|
-
_cachedCollectionNames: string[];
|
|
25
|
-
_cachedHello: Document | null;
|
|
26
|
-
constructor(mongo: Mongo, name: string, session?: Session);
|
|
27
|
-
_baseOptions(): Promise<CommandOperationOptions>;
|
|
28
|
-
_maybeCachedHello(): Promise<Document>;
|
|
29
|
-
[asPrintable](): string;
|
|
30
|
-
private _emitDatabaseApiCall;
|
|
31
|
-
_runCommand(cmd: Document, options?: CommandOperationOptions): Promise<Document>;
|
|
32
|
-
_runAdminCommand(cmd: Document, options?: CommandOperationOptions): Promise<Document>;
|
|
33
|
-
private _listCollections;
|
|
34
|
-
_getCollectionNames(options?: ListCollectionsOptions): Promise<string[]>;
|
|
35
|
-
_getCollectionNamesWithTypes(options?: ListCollectionsOptions): Promise<CollectionNamesWithTypes[]>;
|
|
36
|
-
_getCollectionNamesForCompletion(): Promise<string[]>;
|
|
37
|
-
_getLastErrorObj(w?: number | string, wTimeout?: number, j?: boolean): Promise<Document>;
|
|
38
|
-
getMongo(): Mongo;
|
|
39
|
-
getName(): string;
|
|
40
|
-
getCollectionNames(): Promise<string[]>;
|
|
41
|
-
getCollectionInfos(filter?: Document, options?: ListCollectionsOptions): Promise<Document[]>;
|
|
42
|
-
runCommand(cmd: string | Document): Promise<Document>;
|
|
43
|
-
adminCommand(cmd: string | Document): Promise<Document>;
|
|
44
|
-
aggregate(pipeline: Document[], options?: Document): Promise<AggregationCursor>;
|
|
45
|
-
getSiblingDB(db: string): Database;
|
|
46
|
-
getCollection(coll: string): Collection;
|
|
47
|
-
dropDatabase(writeConcern?: WriteConcern): Promise<Document>;
|
|
48
|
-
createUser(user: Document, writeConcern?: WriteConcern): Promise<Document>;
|
|
49
|
-
updateUser(username: string, userDoc: Document, writeConcern?: WriteConcern): Promise<Document>;
|
|
50
|
-
changeUserPassword(username: string, password: string, writeConcern?: WriteConcern): Promise<Document>;
|
|
51
|
-
logout(): Promise<Document>;
|
|
52
|
-
dropUser(username: string, writeConcern?: WriteConcern): Promise<Document>;
|
|
53
|
-
dropAllUsers(writeConcern?: WriteConcern): Promise<Document>;
|
|
54
|
-
auth(...args: [AuthDoc] | [string, string] | [string]): Promise<{
|
|
55
|
-
ok: number;
|
|
56
|
-
}>;
|
|
57
|
-
grantRolesToUser(username: string, roles: any[], writeConcern?: WriteConcern): Promise<Document>;
|
|
58
|
-
revokeRolesFromUser(username: string, roles: any[], writeConcern?: WriteConcern): Promise<Document>;
|
|
59
|
-
getUser(username: string, options?: Document): Promise<Document | null>;
|
|
60
|
-
getUsers(options?: Document): Promise<Document>;
|
|
61
|
-
createCollection(name: string, options?: CreateCollectionOptions): Promise<{
|
|
62
|
-
ok: number;
|
|
63
|
-
}>;
|
|
64
|
-
createView(name: string, source: string, pipeline: Document[], options?: CreateCollectionOptions): Promise<{
|
|
65
|
-
ok: number;
|
|
66
|
-
}>;
|
|
67
|
-
createRole(role: Document, writeConcern?: WriteConcern): Promise<Document>;
|
|
68
|
-
updateRole(rolename: string, roleDoc: Document, writeConcern?: WriteConcern): Promise<Document>;
|
|
69
|
-
dropRole(rolename: string, writeConcern?: WriteConcern): Promise<Document>;
|
|
70
|
-
dropAllRoles(writeConcern?: WriteConcern): Promise<Document>;
|
|
71
|
-
grantRolesToRole(rolename: string, roles: any[], writeConcern?: WriteConcern): Promise<Document>;
|
|
72
|
-
revokeRolesFromRole(rolename: string, roles: any[], writeConcern?: WriteConcern): Promise<Document>;
|
|
73
|
-
grantPrivilegesToRole(rolename: string, privileges: any[], writeConcern?: WriteConcern): Promise<Document>;
|
|
74
|
-
revokePrivilegesFromRole(rolename: string, privileges: any[], writeConcern?: WriteConcern): Promise<Document>;
|
|
75
|
-
getRole(rolename: string, options?: Document): Promise<Document | null>;
|
|
76
|
-
getRoles(options?: Document): Promise<Document>;
|
|
77
|
-
currentOp(opts?: Document | boolean): Promise<Document>;
|
|
78
|
-
killOp(opId: number): Promise<Document>;
|
|
79
|
-
shutdownServer(opts?: Document): Promise<Document>;
|
|
80
|
-
fsyncLock(): Promise<Document>;
|
|
81
|
-
fsyncUnlock(): Promise<Document>;
|
|
82
|
-
version(): Promise<string>;
|
|
83
|
-
serverBits(): Promise<Document>;
|
|
84
|
-
isMaster(): Promise<Document>;
|
|
85
|
-
hello(): Promise<Document>;
|
|
86
|
-
serverBuildInfo(): Promise<Document>;
|
|
87
|
-
serverStatus(opts?: {}): Promise<Document>;
|
|
88
|
-
stats(scaleOrOptions?: number | Document): Promise<Document>;
|
|
89
|
-
hostInfo(): Promise<Document>;
|
|
90
|
-
serverCmdLineOpts(): Promise<Document>;
|
|
91
|
-
rotateCertificates(message?: string): Promise<Document>;
|
|
92
|
-
printCollectionStats(scale?: number): Promise<Document>;
|
|
93
|
-
getFreeMonitoringStatus(): Promise<Document>;
|
|
94
|
-
disableFreeMonitoring(): Promise<Document>;
|
|
95
|
-
enableFreeMonitoring(): Promise<Document | string>;
|
|
96
|
-
getProfilingStatus(): Promise<Document>;
|
|
97
|
-
setProfilingLevel(level: number, opts?: number | Document): Promise<Document>;
|
|
98
|
-
setLogLevel(logLevel: number, component?: Document | string): Promise<Document>;
|
|
99
|
-
getLogComponents(): Promise<Document>;
|
|
100
|
-
cloneDatabase(): void;
|
|
101
|
-
cloneCollection(): void;
|
|
102
|
-
copyDatabase(): void;
|
|
103
|
-
commandHelp(name: string): Promise<Document>;
|
|
104
|
-
listCommands(): Promise<CommandResult>;
|
|
105
|
-
getLastErrorObj(w?: number | string, wTimeout?: number, j?: boolean): Promise<Document>;
|
|
106
|
-
getLastError(w?: number | string, wTimeout?: number): Promise<Document | null>;
|
|
107
|
-
printShardingStatus(verbose?: boolean): Promise<CommandResult>;
|
|
108
|
-
printSecondaryReplicationInfo(): Promise<CommandResult>;
|
|
109
|
-
getReplicationInfo(): Promise<Document>;
|
|
110
|
-
printReplicationInfo(): Promise<CommandResult>;
|
|
111
|
-
printSlaveReplicationInfo(): never;
|
|
112
|
-
setSecondaryOk(): Promise<void>;
|
|
113
|
-
watch(pipeline?: Document[] | ChangeStreamOptions, options?: ChangeStreamOptions): Promise<ChangeStreamCursor>;
|
|
114
|
-
sql(sqlString: string, options?: Document): Promise<AggregationCursor>;
|
|
115
|
-
}
|
|
116
|
-
export {};
|
|
1
|
+
import Mongo from './mongo';
|
|
2
|
+
import Collection from './collection';
|
|
3
|
+
import { ShellApiWithMongoClass } from './decorators';
|
|
4
|
+
import { asPrintable } from './enums';
|
|
5
|
+
import type { ChangeStreamOptions, CommandOperationOptions, CreateCollectionOptions, Document, WriteConcern, ListCollectionsOptions } from '@qp-mongosh/service-provider-core';
|
|
6
|
+
import { AggregationCursor, CommandResult } from './index';
|
|
7
|
+
import Session from './session';
|
|
8
|
+
import ChangeStreamCursor from './change-stream-cursor';
|
|
9
|
+
export declare type CollectionNamesWithTypes = {
|
|
10
|
+
name: string;
|
|
11
|
+
badge: string;
|
|
12
|
+
};
|
|
13
|
+
declare type AuthDoc = {
|
|
14
|
+
user: string;
|
|
15
|
+
pwd: string;
|
|
16
|
+
authDb?: string;
|
|
17
|
+
mechanism?: string;
|
|
18
|
+
};
|
|
19
|
+
export default class Database extends ShellApiWithMongoClass {
|
|
20
|
+
_mongo: Mongo;
|
|
21
|
+
_name: string;
|
|
22
|
+
_collections: Record<string, Collection>;
|
|
23
|
+
_session: Session | undefined;
|
|
24
|
+
_cachedCollectionNames: string[];
|
|
25
|
+
_cachedHello: Document | null;
|
|
26
|
+
constructor(mongo: Mongo, name: string, session?: Session);
|
|
27
|
+
_baseOptions(): Promise<CommandOperationOptions>;
|
|
28
|
+
_maybeCachedHello(): Promise<Document>;
|
|
29
|
+
[asPrintable](): string;
|
|
30
|
+
private _emitDatabaseApiCall;
|
|
31
|
+
_runCommand(cmd: Document, options?: CommandOperationOptions): Promise<Document>;
|
|
32
|
+
_runAdminCommand(cmd: Document, options?: CommandOperationOptions): Promise<Document>;
|
|
33
|
+
private _listCollections;
|
|
34
|
+
_getCollectionNames(options?: ListCollectionsOptions): Promise<string[]>;
|
|
35
|
+
_getCollectionNamesWithTypes(options?: ListCollectionsOptions): Promise<CollectionNamesWithTypes[]>;
|
|
36
|
+
_getCollectionNamesForCompletion(): Promise<string[]>;
|
|
37
|
+
_getLastErrorObj(w?: number | string, wTimeout?: number, j?: boolean): Promise<Document>;
|
|
38
|
+
getMongo(): Mongo;
|
|
39
|
+
getName(): string;
|
|
40
|
+
getCollectionNames(): Promise<string[]>;
|
|
41
|
+
getCollectionInfos(filter?: Document, options?: ListCollectionsOptions): Promise<Document[]>;
|
|
42
|
+
runCommand(cmd: string | Document): Promise<Document>;
|
|
43
|
+
adminCommand(cmd: string | Document): Promise<Document>;
|
|
44
|
+
aggregate(pipeline: Document[], options?: Document): Promise<AggregationCursor>;
|
|
45
|
+
getSiblingDB(db: string): Database;
|
|
46
|
+
getCollection(coll: string): Collection;
|
|
47
|
+
dropDatabase(writeConcern?: WriteConcern): Promise<Document>;
|
|
48
|
+
createUser(user: Document, writeConcern?: WriteConcern): Promise<Document>;
|
|
49
|
+
updateUser(username: string, userDoc: Document, writeConcern?: WriteConcern): Promise<Document>;
|
|
50
|
+
changeUserPassword(username: string, password: string, writeConcern?: WriteConcern): Promise<Document>;
|
|
51
|
+
logout(): Promise<Document>;
|
|
52
|
+
dropUser(username: string, writeConcern?: WriteConcern): Promise<Document>;
|
|
53
|
+
dropAllUsers(writeConcern?: WriteConcern): Promise<Document>;
|
|
54
|
+
auth(...args: [AuthDoc] | [string, string] | [string]): Promise<{
|
|
55
|
+
ok: number;
|
|
56
|
+
}>;
|
|
57
|
+
grantRolesToUser(username: string, roles: any[], writeConcern?: WriteConcern): Promise<Document>;
|
|
58
|
+
revokeRolesFromUser(username: string, roles: any[], writeConcern?: WriteConcern): Promise<Document>;
|
|
59
|
+
getUser(username: string, options?: Document): Promise<Document | null>;
|
|
60
|
+
getUsers(options?: Document): Promise<Document>;
|
|
61
|
+
createCollection(name: string, options?: CreateCollectionOptions): Promise<{
|
|
62
|
+
ok: number;
|
|
63
|
+
}>;
|
|
64
|
+
createView(name: string, source: string, pipeline: Document[], options?: CreateCollectionOptions): Promise<{
|
|
65
|
+
ok: number;
|
|
66
|
+
}>;
|
|
67
|
+
createRole(role: Document, writeConcern?: WriteConcern): Promise<Document>;
|
|
68
|
+
updateRole(rolename: string, roleDoc: Document, writeConcern?: WriteConcern): Promise<Document>;
|
|
69
|
+
dropRole(rolename: string, writeConcern?: WriteConcern): Promise<Document>;
|
|
70
|
+
dropAllRoles(writeConcern?: WriteConcern): Promise<Document>;
|
|
71
|
+
grantRolesToRole(rolename: string, roles: any[], writeConcern?: WriteConcern): Promise<Document>;
|
|
72
|
+
revokeRolesFromRole(rolename: string, roles: any[], writeConcern?: WriteConcern): Promise<Document>;
|
|
73
|
+
grantPrivilegesToRole(rolename: string, privileges: any[], writeConcern?: WriteConcern): Promise<Document>;
|
|
74
|
+
revokePrivilegesFromRole(rolename: string, privileges: any[], writeConcern?: WriteConcern): Promise<Document>;
|
|
75
|
+
getRole(rolename: string, options?: Document): Promise<Document | null>;
|
|
76
|
+
getRoles(options?: Document): Promise<Document>;
|
|
77
|
+
currentOp(opts?: Document | boolean): Promise<Document>;
|
|
78
|
+
killOp(opId: number): Promise<Document>;
|
|
79
|
+
shutdownServer(opts?: Document): Promise<Document>;
|
|
80
|
+
fsyncLock(): Promise<Document>;
|
|
81
|
+
fsyncUnlock(): Promise<Document>;
|
|
82
|
+
version(): Promise<string>;
|
|
83
|
+
serverBits(): Promise<Document>;
|
|
84
|
+
isMaster(): Promise<Document>;
|
|
85
|
+
hello(): Promise<Document>;
|
|
86
|
+
serverBuildInfo(): Promise<Document>;
|
|
87
|
+
serverStatus(opts?: {}): Promise<Document>;
|
|
88
|
+
stats(scaleOrOptions?: number | Document): Promise<Document>;
|
|
89
|
+
hostInfo(): Promise<Document>;
|
|
90
|
+
serverCmdLineOpts(): Promise<Document>;
|
|
91
|
+
rotateCertificates(message?: string): Promise<Document>;
|
|
92
|
+
printCollectionStats(scale?: number): Promise<Document>;
|
|
93
|
+
getFreeMonitoringStatus(): Promise<Document>;
|
|
94
|
+
disableFreeMonitoring(): Promise<Document>;
|
|
95
|
+
enableFreeMonitoring(): Promise<Document | string>;
|
|
96
|
+
getProfilingStatus(): Promise<Document>;
|
|
97
|
+
setProfilingLevel(level: number, opts?: number | Document): Promise<Document>;
|
|
98
|
+
setLogLevel(logLevel: number, component?: Document | string): Promise<Document>;
|
|
99
|
+
getLogComponents(): Promise<Document>;
|
|
100
|
+
cloneDatabase(): void;
|
|
101
|
+
cloneCollection(): void;
|
|
102
|
+
copyDatabase(): void;
|
|
103
|
+
commandHelp(name: string): Promise<Document>;
|
|
104
|
+
listCommands(): Promise<CommandResult>;
|
|
105
|
+
getLastErrorObj(w?: number | string, wTimeout?: number, j?: boolean): Promise<Document>;
|
|
106
|
+
getLastError(w?: number | string, wTimeout?: number): Promise<Document | null>;
|
|
107
|
+
printShardingStatus(verbose?: boolean): Promise<CommandResult>;
|
|
108
|
+
printSecondaryReplicationInfo(): Promise<CommandResult>;
|
|
109
|
+
getReplicationInfo(): Promise<Document>;
|
|
110
|
+
printReplicationInfo(): Promise<CommandResult>;
|
|
111
|
+
printSlaveReplicationInfo(): never;
|
|
112
|
+
setSecondaryOk(): Promise<void>;
|
|
113
|
+
watch(pipeline?: Document[] | ChangeStreamOptions, options?: ChangeStreamOptions): Promise<ChangeStreamCursor>;
|
|
114
|
+
sql(sqlString: string, options?: Document): Promise<AggregationCursor>;
|
|
115
|
+
}
|
|
116
|
+
export {};
|