@qp-mongosh/shell-api 0.0.0-dev.13 → 0.0.0-dev.14

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 (2) hide show
  1. package/lib/database.d.ts +23 -108
  2. package/package.json +7 -7
package/lib/database.d.ts CHANGED
@@ -2,14 +2,7 @@ import Mongo from './mongo';
2
2
  import Collection from './collection';
3
3
  import { ShellApiWithMongoClass } from './decorators';
4
4
  import { asPrintable } from './enums';
5
- import type {
6
- ChangeStreamOptions,
7
- CommandOperationOptions,
8
- CreateCollectionOptions,
9
- Document,
10
- WriteConcern,
11
- ListCollectionsOptions,
12
- } from '@qp-mongosh/service-provider-core';
5
+ import type { ChangeStreamOptions, CommandOperationOptions, CreateCollectionOptions, Document, WriteConcern, ListCollectionsOptions } from '@qp-mongosh/service-provider-core';
13
6
  import { AggregationCursor, CommandResult } from './index';
14
7
  import Session from './session';
15
8
  import ChangeStreamCursor from './change-stream-cursor';
@@ -35,112 +28,50 @@ export default class Database extends ShellApiWithMongoClass {
35
28
  _maybeCachedHello(): Promise<Document>;
36
29
  [asPrintable](): string;
37
30
  private _emitDatabaseApiCall;
38
- _runCommand(
39
- cmd: Document,
40
- options?: CommandOperationOptions
41
- ): Promise<Document>;
42
- _runAdminCommand(
43
- cmd: Document,
44
- options?: CommandOperationOptions
45
- ): Promise<Document>;
31
+ _runCommand(cmd: Document, options?: CommandOperationOptions): Promise<Document>;
32
+ _runAdminCommand(cmd: Document, options?: CommandOperationOptions): Promise<Document>;
46
33
  private _listCollections;
47
34
  _getCollectionNames(options?: ListCollectionsOptions): Promise<string[]>;
48
- _getCollectionNamesWithTypes(
49
- options?: ListCollectionsOptions
50
- ): Promise<CollectionNamesWithTypes[]>;
35
+ _getCollectionNamesWithTypes(options?: ListCollectionsOptions): Promise<CollectionNamesWithTypes[]>;
51
36
  _getCollectionNamesForCompletion(): Promise<string[]>;
52
- _getLastErrorObj(
53
- w?: number | string,
54
- wTimeout?: number,
55
- j?: boolean
56
- ): Promise<Document>;
37
+ _getLastErrorObj(w?: number | string, wTimeout?: number, j?: boolean): Promise<Document>;
57
38
  getMongo(): Mongo;
58
39
  getName(): string;
59
40
  getCollectionNames(): Promise<string[]>;
60
- getCollectionInfos(
61
- filter?: Document,
62
- options?: ListCollectionsOptions
63
- ): Promise<Document[]>;
41
+ getCollectionInfos(filter?: Document, options?: ListCollectionsOptions): Promise<Document[]>;
64
42
  runCommand(cmd: string | Document): Promise<Document>;
65
43
  adminCommand(cmd: string | Document): Promise<Document>;
66
- aggregate(
67
- pipeline: Document[],
68
- options?: Document
69
- ): Promise<AggregationCursor>;
44
+ aggregate(pipeline: Document[], options?: Document): Promise<AggregationCursor>;
70
45
  getSiblingDB(db: string): Database;
71
46
  getCollection(coll: string): Collection;
72
47
  dropDatabase(writeConcern?: WriteConcern): Promise<Document>;
73
48
  createUser(user: Document, writeConcern?: WriteConcern): Promise<Document>;
74
- updateUser(
75
- username: string,
76
- userDoc: Document,
77
- writeConcern?: WriteConcern
78
- ): Promise<Document>;
79
- changeUserPassword(
80
- username: string,
81
- password: string,
82
- writeConcern?: WriteConcern
83
- ): Promise<Document>;
49
+ updateUser(username: string, userDoc: Document, writeConcern?: WriteConcern): Promise<Document>;
50
+ changeUserPassword(username: string, password: string, writeConcern?: WriteConcern): Promise<Document>;
84
51
  logout(): Promise<Document>;
85
52
  dropUser(username: string, writeConcern?: WriteConcern): Promise<Document>;
86
53
  dropAllUsers(writeConcern?: WriteConcern): Promise<Document>;
87
54
  auth(...args: [AuthDoc] | [string, string] | [string]): Promise<{
88
55
  ok: number;
89
56
  }>;
90
- grantRolesToUser(
91
- username: string,
92
- roles: any[],
93
- writeConcern?: WriteConcern
94
- ): Promise<Document>;
95
- revokeRolesFromUser(
96
- username: string,
97
- roles: any[],
98
- writeConcern?: WriteConcern
99
- ): Promise<Document>;
57
+ grantRolesToUser(username: string, roles: any[], writeConcern?: WriteConcern): Promise<Document>;
58
+ revokeRolesFromUser(username: string, roles: any[], writeConcern?: WriteConcern): Promise<Document>;
100
59
  getUser(username: string, options?: Document): Promise<Document | null>;
101
60
  getUsers(options?: Document): Promise<Document>;
102
- createCollection(
103
- name: string,
104
- options?: CreateCollectionOptions
105
- ): Promise<{
61
+ createCollection(name: string, options?: CreateCollectionOptions): Promise<{
106
62
  ok: number;
107
63
  }>;
108
- createView(
109
- name: string,
110
- source: string,
111
- pipeline: Document[],
112
- options?: CreateCollectionOptions
113
- ): Promise<{
64
+ createView(name: string, source: string, pipeline: Document[], options?: CreateCollectionOptions): Promise<{
114
65
  ok: number;
115
66
  }>;
116
67
  createRole(role: Document, writeConcern?: WriteConcern): Promise<Document>;
117
- updateRole(
118
- rolename: string,
119
- roleDoc: Document,
120
- writeConcern?: WriteConcern
121
- ): Promise<Document>;
68
+ updateRole(rolename: string, roleDoc: Document, writeConcern?: WriteConcern): Promise<Document>;
122
69
  dropRole(rolename: string, writeConcern?: WriteConcern): Promise<Document>;
123
70
  dropAllRoles(writeConcern?: WriteConcern): Promise<Document>;
124
- grantRolesToRole(
125
- rolename: string,
126
- roles: any[],
127
- writeConcern?: WriteConcern
128
- ): Promise<Document>;
129
- revokeRolesFromRole(
130
- rolename: string,
131
- roles: any[],
132
- writeConcern?: WriteConcern
133
- ): Promise<Document>;
134
- grantPrivilegesToRole(
135
- rolename: string,
136
- privileges: any[],
137
- writeConcern?: WriteConcern
138
- ): Promise<Document>;
139
- revokePrivilegesFromRole(
140
- rolename: string,
141
- privileges: any[],
142
- writeConcern?: WriteConcern
143
- ): 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>;
144
75
  getRole(rolename: string, options?: Document): Promise<Document | null>;
145
76
  getRoles(options?: Document): Promise<Document>;
146
77
  currentOp(opts?: Document | boolean): Promise<Document>;
@@ -163,39 +94,23 @@ export default class Database extends ShellApiWithMongoClass {
163
94
  disableFreeMonitoring(): Promise<Document>;
164
95
  enableFreeMonitoring(): Promise<Document | string>;
165
96
  getProfilingStatus(): Promise<Document>;
166
- setProfilingLevel(
167
- level: number,
168
- opts?: number | Document
169
- ): Promise<Document>;
170
- setLogLevel(
171
- logLevel: number,
172
- component?: Document | string
173
- ): Promise<Document>;
97
+ setProfilingLevel(level: number, opts?: number | Document): Promise<Document>;
98
+ setLogLevel(logLevel: number, component?: Document | string): Promise<Document>;
174
99
  getLogComponents(): Promise<Document>;
175
100
  cloneDatabase(): void;
176
101
  cloneCollection(): void;
177
102
  copyDatabase(): void;
178
103
  commandHelp(name: string): Promise<Document>;
179
104
  listCommands(): Promise<CommandResult>;
180
- getLastErrorObj(
181
- w?: number | string,
182
- wTimeout?: number,
183
- j?: boolean
184
- ): Promise<Document>;
185
- getLastError(
186
- w?: number | string,
187
- wTimeout?: number
188
- ): Promise<Document | null>;
105
+ getLastErrorObj(w?: number | string, wTimeout?: number, j?: boolean): Promise<Document>;
106
+ getLastError(w?: number | string, wTimeout?: number): Promise<Document | null>;
189
107
  printShardingStatus(verbose?: boolean): Promise<CommandResult>;
190
108
  printSecondaryReplicationInfo(): Promise<CommandResult>;
191
109
  getReplicationInfo(): Promise<Document>;
192
110
  printReplicationInfo(): Promise<CommandResult>;
193
111
  printSlaveReplicationInfo(): never;
194
112
  setSecondaryOk(): Promise<void>;
195
- watch(
196
- pipeline?: Document[] | ChangeStreamOptions,
197
- options?: ChangeStreamOptions
198
- ): Promise<ChangeStreamCursor>;
113
+ watch(pipeline?: Document[] | ChangeStreamOptions, options?: ChangeStreamOptions): Promise<ChangeStreamCursor>;
199
114
  sql(sqlString: string, options?: Document): Promise<AggregationCursor>;
200
115
  }
201
116
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qp-mongosh/shell-api",
3
- "version": "0.0.0-dev.13",
3
+ "version": "0.0.0-dev.14",
4
4
  "description": "MongoDB Shell API Classes Package",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -34,14 +34,14 @@
34
34
  "build"
35
35
  ],
36
36
  "dependencies": {
37
- "@qp-mongosh/errors": "0.0.0-dev.13",
38
- "@qp-mongosh/history": "0.0.0-dev.13",
39
- "@qp-mongosh/i18n": "0.0.0-dev.13",
40
- "@qp-mongosh/service-provider-core": "0.0.0-dev.13",
41
- "qp-mongodb": "0.0.0-dev.13",
37
+ "@qp-mongosh/errors": "0.0.0-dev.14",
38
+ "@qp-mongosh/history": "0.0.0-dev.14",
39
+ "@qp-mongosh/i18n": "0.0.0-dev.14",
40
+ "@qp-mongosh/service-provider-core": "0.0.0-dev.14",
41
+ "qp-mongodb": "0.0.0-dev.14",
42
42
  "mongodb-redact": "^0.2.2"
43
43
  },
44
44
  "devDependencies": {
45
- "@qp-mongosh/types": "0.0.0-dev.13"
45
+ "@qp-mongosh/types": "0.0.0-dev.14"
46
46
  }
47
47
  }