Skip to content

Commit dabc6bf

Browse files
committed
fix: add all accessor tags to exported symbols
The mongodb.d.ts now only includes the public API. NODE-2783
1 parent 58e4252 commit dabc6bf

24 files changed

+210
-119
lines changed

api-extractor.json

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
},
1010
"dtsRollup": {
1111
"enabled": true,
12-
"untrimmedFilePath": "<projectFolder>/<unscopedPackageName>.d.ts"
12+
"untrimmedFilePath": "<projectFolder>/<unscopedPackageName>-internal.d.ts",
13+
"publicTrimmedFilePath": "<projectFolder>/<unscopedPackageName>.d.ts"
1314
},
1415
"tsdocMetadata": {
1516
"enabled": false
@@ -23,23 +24,11 @@
2324
},
2425
"extractorMessageReporting": {
2526
"default": {
26-
"logLevel": "warning"
27+
"logLevel": "error"
2728
},
2829
"ae-internal-missing-underscore": {
2930
"logLevel": "none",
3031
"addToApiReportFile": false
31-
},
32-
"ae-missing-release-tag": {
33-
"logLevel": "error",
34-
"addToApiReportFile": false
35-
},
36-
"ae-incompatible-release-tags": {
37-
"logLevel": "none",
38-
"addToApiReportFile": false
39-
},
40-
"ae-unresolved-link": {
41-
"addToApiReportFile": false,
42-
"logLevel": "none"
4332
}
4433
},
4534
"tsdocMessageReporting": {

package-lock.json

Lines changed: 58 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"devDependencies": {
3535
"@istanbuljs/nyc-config-typescript": "^1.0.1",
3636
"@microsoft/api-extractor": "^7.12.0",
37-
"@microsoft/tsdoc-config": "^0.13.6",
37+
"@microsoft/tsdoc-config": "^0.13.7",
3838
"@types/aws4": "^1.5.1",
3939
"@types/bl": "^2.1.0",
4040
"@types/bson": "^4.0.2",
@@ -51,10 +51,10 @@
5151
"coveralls": "^3.0.11",
5252
"eslint": "^6.8.0",
5353
"eslint-config-prettier": "^6.11.0",
54-
"eslint-plugin-jsdoc": "^30.3.1",
54+
"eslint-plugin-jsdoc": "^30.7.8",
5555
"eslint-plugin-prettier": "^3.1.3",
5656
"eslint-plugin-promise": "^4.2.1",
57-
"eslint-plugin-tsdoc": "^0.2.6",
57+
"eslint-plugin-tsdoc": "^0.2.8",
5858
"jsdoc": "^3.6.4",
5959
"lodash.camelcase": "^4.3.0",
6060
"madge": "^3.9.0",
@@ -74,7 +74,7 @@
7474
"through2": "^3.0.1",
7575
"ts-node": "^9.0.0",
7676
"typedoc": "^0.19.2",
77-
"typedoc-plugin-pages": "^1.0.1",
77+
"typedoc-plugin-pages": "^1.1.0",
7878
"typescript": "^4.0.5",
7979
"typescript-cached-transpile": "^0.0.6",
8080
"worker-farm": "^1.5.0",

src/bulk/common.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export type AnyBulkWriteOperation =
115115
| { deleteOne: DeleteOneModel }
116116
| { deleteMany: DeleteManyModel };
117117

118-
/** @internal */
118+
/** @public */
119119
export interface BulkResult {
120120
ok: number;
121121
writeErrors: WriteError[];
@@ -348,7 +348,7 @@ export class WriteConcernError {
348348
}
349349
}
350350

351-
/** @internal */
351+
/** @public */
352352
export interface BulkWriteOperationError {
353353
index: number;
354354
code: number;
@@ -1301,7 +1301,7 @@ function shouldForceServerObjectId(bulkOperation: BulkOperationBase): boolean {
13011301
return false;
13021302
}
13031303

1304-
/** @internal */
1304+
/** @public */
13051305
export interface UpdateStatement {
13061306
/** The query that matches documents to update. */
13071307
q: Document;
@@ -1368,7 +1368,7 @@ function isUpdateStatement(model: Document): model is UpdateStatement {
13681368
return 'q' in model;
13691369
}
13701370

1371-
/** @internal */
1371+
/** @public */
13721372
export interface DeleteStatement {
13731373
/** The query that matches documents to delete. */
13741374
q: Document;

src/change_stream.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export interface ResumeOptions {
6565
export type ResumeToken = unknown;
6666

6767
/**
68-
* Represents a specific point in time on a server. Can be retrieved by using {@link Db.command}
68+
* Represents a specific point in time on a server. Can be retrieved by using {@link Db#command}
6969
* @public
7070
* @remarks
7171
* See {@link https://docs.mongodb.com/manual/reference/method/db.runCommand/#response| Run Command Response}
@@ -180,6 +180,7 @@ export class ChangeStream extends EventEmitter {
180180
parent: MongoClient | Db | Collection;
181181
namespace: MongoDBNamespace;
182182
type: symbol;
183+
/** @internal */
183184
cursor?: ChangeStreamCursor;
184185
streamOptions?: CursorStreamOptions;
185186
[kResumeQueue]: Denque;
@@ -206,6 +207,8 @@ export class ChangeStream extends EventEmitter {
206207
static readonly RESUME_TOKEN_CHANGED = 'resumeTokenChanged' as const;
207208

208209
/**
210+
* @internal
211+
*
209212
* @param parent - The parent object that created this change stream
210213
* @param pipeline - An array of {@link https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents
211214
*/
@@ -332,7 +335,7 @@ export class ChangeStream extends EventEmitter {
332335
}
333336
}
334337

335-
/** @public */
338+
/** @internal */
336339
export interface ChangeStreamCursorOptions extends AbstractCursorOptions {
337340
startAtOperationTime?: OperationTime;
338341
resumeAfter?: ResumeToken;

src/cmap/connection.ts

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,23 @@ export class Connection extends EventEmitter {
8383
closed: boolean;
8484
destroyed: boolean;
8585
lastIsMasterMS?: number;
86+
/** @internal */
8687
[kDescription]: StreamDescription;
88+
/** @internal */
8789
[kGeneration]: number;
90+
/** @internal */
8891
[kLastUseTime]: number;
92+
/** @internal */
8993
[kAutoEncrypter]?: unknown;
94+
/** @internal */
9095
[kQueue]: Map<number, OperationDescription>;
96+
/** @internal */
9197
[kMessageStream]: MessageStream;
98+
/** @internal */
9299
[kStream]: Stream;
100+
/** @internal */
93101
[kIsMaster]: Document;
102+
/** @internal */
94103
[kClusterTime]: Document;
95104

96105
/** @event */
@@ -242,7 +251,9 @@ export class Connection extends EventEmitter {
242251
}
243252

244253
// Wire protocol methods
254+
/** @internal */
245255
command(ns: string, cmd: Document, callback: Callback): void;
256+
/** @internal */
246257
command(ns: string, cmd: Document, options: CommandOptions, callback: Callback): void;
247258
command(
248259
ns: string,
@@ -253,34 +264,44 @@ export class Connection extends EventEmitter {
253264
wp.command(makeServerTrampoline(this), ns, cmd, options as CommandOptions, callback);
254265
}
255266

267+
/** @internal */
256268
query(ns: MongoDBNamespace, cmd: Document, options: QueryOptions, callback: Callback): void {
257269
wp.query(makeServerTrampoline(this), ns, cmd, options, callback);
258270
}
259271

272+
/** @internal */
260273
getMore(ns: string, cursorId: Long, options: GetMoreOptions, callback: Callback<Document>): void {
261274
wp.getMore(makeServerTrampoline(this), ns, cursorId, options, callback);
262275
}
263276

277+
/** @internal */
264278
killCursors(ns: string, cursorIds: Long[], options: CommandOptions, callback: Callback): void {
265279
wp.killCursors(makeServerTrampoline(this), ns, cursorIds, options, callback);
266280
}
267281

282+
/** @internal */
268283
insert(ns: string, ops: Document[], options: InsertOptions, callback: Callback): void {
269284
wp.insert(makeServerTrampoline(this), ns, ops, options, callback);
270285
}
271286

287+
/** @internal */
272288
update(ns: string, ops: Document[], options: UpdateOptions, callback: Callback): void {
273289
wp.update(makeServerTrampoline(this), ns, ops, options, callback);
274290
}
275291

292+
/** @internal */
276293
remove(ns: string, ops: Document[], options: RemoveOptions, callback: Callback): void {
277294
wp.remove(makeServerTrampoline(this), ns, ops, options, callback);
278295
}
279296
}
280297

281-
/// This lets us emulate a legacy `Server` instance so we can work with the existing wire
282-
/// protocol methods. Eventually, the operation executor will return a `Connection` to execute
283-
/// against.
298+
/**
299+
* This lets us emulate a legacy `Server` instance so we can work with the existing wire
300+
* protocol methods. Eventually, the operation executor will return a `Connection` to execute
301+
* against.
302+
* @internal
303+
* @deprecated Remove (NODE-2745)
304+
*/
284305
function makeServerTrampoline(connection: Connection): Server {
285306
return ({
286307
description: connection.description,

0 commit comments

Comments
 (0)