@mongosh/shell-api 3.22.0 → 3.24.0

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/lib/api-raw.d.ts CHANGED
@@ -3,26 +3,20 @@
3
3
  import type { Agent } from 'https';
4
4
  import type { AgentConnectOpts } from 'agent-base';
5
5
  import { Binary } from 'bson';
6
+ import type { BSON } from '@mongosh/shell-bson';
6
7
  import { BSONRegExp } from 'bson';
7
- import { BSONSymbol } from 'bson';
8
8
  import { BSONType } from 'bson';
9
- import { calculateObjectSize } from 'bson';
10
9
  import type { ClientRequest } from 'http';
11
- import { Code } from 'bson';
12
10
  import type { ConnectionOptions } from 'tls';
13
- import { DBRef } from 'bson';
14
11
  import { Decimal128 } from 'bson';
15
12
  import type { DeserializeOptions } from 'bson';
16
13
  import { Document as Document_2 } from 'bson';
17
14
  import { Double } from 'bson';
18
15
  import type { Duplex } from 'stream';
19
- import { EJSONOptions } from 'bson';
20
16
  import { EventEmitter } from 'events';
21
17
  import type { IncomingMessage } from 'http';
22
18
  import { Int32 } from 'bson';
23
19
  import { Long } from 'bson';
24
- import { MaxKey } from 'bson';
25
- import { MinKey } from 'bson';
26
20
  import { ObjectId } from 'bson';
27
21
  import type { ObjectIdLike } from 'bson';
28
22
  import { Readable } from 'stream';
@@ -30,6 +24,7 @@ import type { RequestOptions } from 'https';
30
24
  import type { SecureContextOptions } from 'tls';
31
25
  import type { SerializeOptions } from 'bson';
32
26
  import type { ServerResponse } from 'http';
27
+ import { ShellBson } from '@mongosh/shell-bson';
33
28
  import type { SrvRecord } from 'dns';
34
29
  import type { TcpNetConnectOpts } from 'net';
35
30
  import { Timestamp } from 'bson';
@@ -254,33 +249,6 @@ declare abstract class AbstractCursor<TSchema = any, CursorEvents extends Abstra
254
249
  /* Excluded from this release type: throwIfInitialized */
255
250
  }
256
251
 
257
- declare abstract class AbstractCursor_2<CursorType extends ServiceProviderAggregationCursor | ServiceProviderFindCursor | ServiceProviderRunCommandCursor> extends ShellApiWithMongoClass {
258
- _mongo: Mongo;
259
- _cursor: CursorType;
260
- _transform: ((doc: any) => any) | null;
261
- _currentIterationResult: CursorIterationResult | null;
262
- constructor(mongo: Mongo, cursor: CursorType);
263
- [asPrintable](): Promise<CursorIterationResult>;
264
- _it(): Promise<CursorIterationResult>;
265
- batchSize(size: number): this;
266
- close(): Promise<void>;
267
- forEach(f: (doc: Document_2) => void | boolean | Promise<void> | Promise<boolean>): Promise<void>;
268
- hasNext(): Promise<boolean>;
269
- tryNext(): Promise<Document_2 | null>;
270
- _tryNext(): Promise<Document_2 | null>;
271
- _canDelegateIterationToUnderlyingCursor(): boolean;
272
- [Symbol.asyncIterator](): AsyncGenerator<Document_2, void, void>;
273
- isClosed(): boolean;
274
- isExhausted(): boolean;
275
- itcount(): Promise<number>;
276
- toArray(): Promise<Document_2[]>;
277
- pretty(): this;
278
- map(f: (doc: Document_2) => Document_2): this;
279
- maxTimeMS(value: number): this;
280
- next(): Promise<Document_2 | null>;
281
- objsLeftInBatch(): number;
282
- }
283
-
284
252
  /** @public */
285
253
  declare type AbstractCursorEvents = {
286
254
  [AbstractCursor.CLOSE](): void;
@@ -364,6 +332,17 @@ declare interface AbstractCursorOptions extends BSONSerializeOptions {
364
332
  /* Excluded from this release type: timeoutContext */
365
333
  }
366
334
 
335
+ declare abstract class AbstractFiniteCursor<CursorType extends ServiceProviderAggregationCursor | ServiceProviderFindCursor | ServiceProviderRunCommandCursor> extends BaseCursor<CursorType> {
336
+ _currentIterationResult: CursorIterationResult | null;
337
+ constructor(mongo: Mongo, cursor: CursorType);
338
+ [asPrintable](): Promise<CursorIterationResult | string>;
339
+ _it(): Promise<CursorIterationResult>;
340
+ batchSize(size: number): this;
341
+ toArray(): Promise<Document_2[]>;
342
+ maxTimeMS(value: number): this;
343
+ objsLeftInBatch(): number;
344
+ }
345
+
367
346
  /** @public */
368
347
  declare type AcceptedFields<TSchema, FieldType, AssignableType> = {
369
348
  readonly [key in KeysOfAType<TSchema, FieldType>]?: AssignableType;
@@ -474,7 +453,8 @@ declare class Admin {
474
453
  declare interface Admin_2 {
475
454
  platform: ReplPlatform;
476
455
  initialDb: string;
477
- bsonLibrary: typeof bson;
456
+ bsonLibrary: BSON;
457
+ computeLegacyHexMD5?(str: string): Promise<string>;
478
458
  listDatabases(database: string, options?: ListDatabasesOptions): Promise<Document_2>;
479
459
  getNewConnection(uri: string, options: MongoClientOptions): Promise<any>;
480
460
  getURI(): string | undefined;
@@ -538,7 +518,7 @@ declare interface AggregateOptions extends Omit<CommandOperationOptions, 'explai
538
518
  /* Excluded from this release type: timeoutMode */
539
519
  }
540
520
 
541
- declare abstract class AggregateOrFindCursor<CursorType extends ServiceProviderAggregationCursor | ServiceProviderFindCursor> extends AbstractCursor_2<CursorType> {
521
+ declare abstract class AggregateOrFindCursor<CursorType extends ServiceProviderAggregationCursor | ServiceProviderFindCursor> extends AbstractFiniteCursor<CursorType> {
542
522
  projection(spec: Document_2): this;
543
523
  skip(value: number): this;
544
524
  sort(spec: Document_2): this;
@@ -1039,6 +1019,33 @@ declare type AzureKMSProviderConfiguration = {
1039
1019
  accessToken: string;
1040
1020
  };
1041
1021
 
1022
+ declare abstract class BaseCursor<CursorType extends ServiceProviderBaseCursor> extends ShellApiWithMongoClass {
1023
+ _mongo: Mongo;
1024
+ _cursor: CursorType;
1025
+ _transform: ((doc: any) => any) | null;
1026
+ _blockingWarningDisabled: boolean;
1027
+ constructor(mongo: Mongo, cursor: CursorType);
1028
+ close(): Promise<void>;
1029
+ forEach(f: (doc: Document_2) => void | boolean | Promise<void> | Promise<boolean>): Promise<void>;
1030
+ hasNext(): Promise<boolean>;
1031
+ tryNext(): Promise<Document_2 | null>;
1032
+ _tryNext(): Promise<Document_2 | null>;
1033
+ _canDelegateIterationToUnderlyingCursor(): boolean;
1034
+ [Symbol.asyncIterator](): AsyncGenerator<Document_2, void, void>;
1035
+ isClosed(): boolean;
1036
+ isExhausted(): boolean;
1037
+ itcount(): Promise<number>;
1038
+ pretty(): this;
1039
+ map(f: (doc: Document_2) => Document_2): this;
1040
+ next(): Promise<Document_2 | null>;
1041
+ disableBlockWarnings(): this;
1042
+ abstract batchSize(size: number): this;
1043
+ abstract toArray(): Promise<Document_2[]>;
1044
+ abstract maxTimeMS(value: number): this;
1045
+ abstract objsLeftInBatch(): number;
1046
+ abstract _it(): Promise<CursorIterationResult>;
1047
+ }
1048
+
1042
1049
  declare interface BaseSocks5RequestMetadata {
1043
1050
  srcAddr: string;
1044
1051
  srcPort: number;
@@ -1076,29 +1083,6 @@ declare type BatchType = (typeof BatchType)[keyof typeof BatchType];
1076
1083
  /** @public */
1077
1084
  declare type BitwiseFilter = number /** numeric bit mask */ | Binary /** BinData bit mask */ | ReadonlyArray<number>;
1078
1085
 
1079
- declare const bson: {
1080
- ObjectId: typeof ObjectId;
1081
- DBRef: typeof DBRef;
1082
- MaxKey: typeof MaxKey;
1083
- MinKey: typeof MinKey;
1084
- Timestamp: typeof Timestamp;
1085
- BSONSymbol: typeof BSONSymbol;
1086
- Code: typeof Code;
1087
- Decimal128: typeof Decimal128;
1088
- Int32: typeof Int32;
1089
- Long: typeof Long;
1090
- Binary: typeof Binary;
1091
- calculateObjectSize: typeof calculateObjectSize;
1092
- Double: typeof Double;
1093
- EJSON: {
1094
- parse: (text: string, options?: EJSONOptions) => any;
1095
- stringify: (value: any, replacer?: (number | string)[] | ((this: any, key: string, value: any) => any) | EJSONOptions, space?: string | number, options?: EJSONOptions) => string;
1096
- serialize: (value: any, options?: EJSONOptions) => Document_2;
1097
- deserialize: (ejson: Document_2, options?: EJSONOptions) => any;
1098
- };
1099
- BSONRegExp: typeof BSONRegExp;
1100
- };
1101
-
1102
1086
  /**
1103
1087
  * BSON Serialization options.
1104
1088
  * @public
@@ -1486,28 +1470,21 @@ declare interface ChangeStreamCreateIndexDocument extends ChangeStreamDocumentCo
1486
1470
  operationType: 'createIndexes';
1487
1471
  }
1488
1472
 
1489
- declare class ChangeStreamCursor extends ShellApiWithMongoClass {
1490
- _mongo: Mongo;
1491
- _cursor: ServiceProviderChangeStream<Document_2>;
1473
+ declare class ChangeStreamCursor extends BaseCursor<ServiceProviderChangeStream> {
1492
1474
  _currentIterationResult: CursorIterationResult | null;
1493
1475
  _on: string;
1494
- constructor(cursor: ServiceProviderChangeStream<Document_2>, on: string, mongo: Mongo);
1476
+ constructor(cursor: ServiceProviderChangeStream, on: string, mongo: Mongo);
1495
1477
  _it(): Promise<CursorIterationResult>;
1496
- [asPrintable](): string;
1497
- close(): Promise<void>;
1478
+ [asPrintable](): Promise<string>;
1498
1479
  hasNext(): Promise<boolean>;
1499
1480
  tryNext(): Promise<Document_2 | null>;
1500
- [Symbol.asyncIterator](): AsyncGenerator<Document_2, void, unknown>;
1501
- isClosed(): boolean;
1502
1481
  isExhausted(): never;
1503
- itcount(): Promise<number>;
1504
1482
  next(): Promise<Document_2>;
1505
1483
  getResumeToken(): ResumeToken;
1506
- map(): ChangeStreamCursor;
1507
- forEach(): Promise<void>;
1508
- toArray(): Promise<Document_2[]>;
1509
- objsLeftInBatch(): void;
1510
- pretty(): ChangeStreamCursor;
1484
+ toArray(): never;
1485
+ batchSize(): never;
1486
+ objsLeftInBatch(): never;
1487
+ maxTimeMS(): never;
1511
1488
  }
1512
1489
 
1513
1490
  /**
@@ -5688,30 +5665,6 @@ declare interface HedgeOptions {
5688
5665
  enabled?: boolean;
5689
5666
  }
5690
5667
 
5691
- declare class Help {
5692
- private help;
5693
- private docs;
5694
- private attr;
5695
- constructor(properties: HelpProperties, options?: HelpOptions);
5696
- [asPrintable](): HelpProperties;
5697
- get [shellApiType](): string;
5698
- }
5699
-
5700
- declare type HelpOptions = {
5701
- translate(key: string): string | undefined;
5702
- };
5703
-
5704
- declare type HelpProperties = {
5705
- help: string;
5706
- docs?: string;
5707
- attr?: HelpPropertiesAttr[];
5708
- };
5709
-
5710
- declare type HelpPropertiesAttr = {
5711
- name?: string;
5712
- description: string;
5713
- };
5714
-
5715
5668
  /** @public */
5716
5669
  declare type Hint = string | Document_2;
5717
5670
 
@@ -6356,8 +6309,6 @@ declare interface LogComponentSeveritiesClientOptions {
6356
6309
  default?: SeverityLevel;
6357
6310
  }
6358
6311
 
6359
- declare type LongWithoutAccidentallyExposedMethods = Omit<typeof bson.Long, 'fromExtendedJSON'>;
6360
-
6361
6312
  declare type MapReduceShellOptions = Document_2 | string;
6362
6313
 
6363
6314
  declare type MasterKey = AWSEncryptionKeyOptions | AzureEncryptionKeyOptions | GCPEncryptionKeyOptions;
@@ -6403,7 +6354,7 @@ export declare class Mongo<M extends GenericServerSideSchema = GenericServerSide
6403
6354
  _listDatabases(opts?: ListDatabasesOptions): Promise<{
6404
6355
  databases: {
6405
6356
  name: string;
6406
- sizeOnDisk: number | ShellBson['Long'];
6357
+ sizeOnDisk: number | BSON['Long']['prototype'];
6407
6358
  empty: boolean;
6408
6359
  }[];
6409
6360
  ok: 1;
@@ -6412,7 +6363,7 @@ export declare class Mongo<M extends GenericServerSideSchema = GenericServerSide
6412
6363
  getDBs(options?: ListDatabasesOptions): Promise<{
6413
6364
  databases: {
6414
6365
  name: string;
6415
- sizeOnDisk: number | ShellBson['Long'];
6366
+ sizeOnDisk: number | BSON['Long']['prototype'];
6416
6367
  empty: boolean;
6417
6368
  }[];
6418
6369
  ok: 1;
@@ -6442,7 +6393,7 @@ export declare class Mongo<M extends GenericServerSideSchema = GenericServerSide
6442
6393
  watch(pipeline?: MQLPipeline | ChangeStreamOptions, options?: ChangeStreamOptions): Promise<ChangeStreamCursor>;
6443
6394
  getClientEncryption(): ClientEncryption_2;
6444
6395
  getKeyVault(): Promise<KeyVault>;
6445
- convertShardKeyToHashed(value: any): Promise<unknown>;
6396
+ convertShardKeyToHashed(value: any): Promise<ShellBson['Long']['prototype']>;
6446
6397
  }
6447
6398
 
6448
6399
  /** @public */
@@ -7071,7 +7022,7 @@ declare interface MongoDBOIDCLogEventsMap {
7071
7022
  }) => void;
7072
7023
  'mongodb-oidc-plugin:skip-auth-attempt': (event: {
7073
7024
  authStateId: string;
7074
- reason: string;
7025
+ reason: 'not-expired' | 'not-expired-refresh-failed' | 'refresh-succeeded';
7075
7026
  }) => void;
7076
7027
  'mongodb-oidc-plugin:auth-failed': (event: {
7077
7028
  authStateId: string;
@@ -8197,7 +8148,7 @@ declare class RunCommandCursor extends AbstractCursor {
8197
8148
  /* Excluded from this release type: getMore */
8198
8149
  }
8199
8150
 
8200
- declare class RunCommandCursor_2 extends AbstractCursor_2<ServiceProviderRunCommandCursor> {
8151
+ declare class RunCommandCursor_2 extends AbstractFiniteCursor<ServiceProviderRunCommandCursor> {
8201
8152
  constructor(mongo: Mongo, cursor: ServiceProviderRunCommandCursor);
8202
8153
  }
8203
8154
 
@@ -8666,6 +8617,9 @@ export declare class Shard<M extends GenericServerSideSchema = GenericServerSide
8666
8617
  balancerCollectionStatus(ns: string): Promise<Document_2>;
8667
8618
  enableBalancing(ns: string): Promise<UpdateResult_2>;
8668
8619
  disableBalancing(ns: string): Promise<UpdateResult_2>;
8620
+ private _setAllowMigrations;
8621
+ enableMigrations(ns: string): Promise<Document_2>;
8622
+ disableMigrations(ns: string): Promise<Document_2>;
8669
8623
  getBalancerState(): Promise<boolean>;
8670
8624
  isBalancerRunning(): Promise<Document_2>;
8671
8625
  startBalancer(timeout?: number): Promise<Document_2>;
@@ -8764,7 +8718,7 @@ export declare class ShellApi extends ShellApiClass {
8764
8718
  api?: ServerApi | ServerApiVersion;
8765
8719
  }): Promise<Mongo>;
8766
8720
  connect(uri: string, user?: string, pwd?: string): Promise<DatabaseWithSchema>;
8767
- it(): Promise<any>;
8721
+ it(): Promise<CursorIterationResult>;
8768
8722
  version(): string;
8769
8723
  load(filename: string): Promise<true>;
8770
8724
  enableTelemetry(): Promise<any>;
@@ -8807,36 +8761,7 @@ declare interface ShellAuthOptions {
8807
8761
  authDb?: string;
8808
8762
  }
8809
8763
 
8810
- export declare type ShellBson = WithHelp<ShellBsonBase>;
8811
-
8812
- declare interface ShellBsonBase {
8813
- DBRef: (namespace: string, oid: any, db?: string, fields?: Document_2) => typeof bson.DBRef.prototype;
8814
- bsonsize: (object: any) => number;
8815
- MaxKey: () => typeof bson.MaxKey.prototype;
8816
- MinKey: () => typeof bson.MinKey.prototype;
8817
- ObjectId: (id?: string | number | typeof bson.ObjectId.prototype | Buffer) => typeof bson.ObjectId.prototype;
8818
- Timestamp: (t?: number | typeof bson.Long.prototype | {
8819
- t: number;
8820
- i: number;
8821
- }, i?: number) => typeof bson.Timestamp.prototype;
8822
- Code: (c?: string | Function, s?: any) => typeof bson.Code.prototype;
8823
- NumberDecimal: (s?: string) => typeof bson.Decimal128.prototype;
8824
- NumberInt: (v?: string) => typeof bson.Int32.prototype;
8825
- NumberLong: (s?: string | number) => typeof bson.Long.prototype;
8826
- ISODate: (input?: string) => Date;
8827
- BinData: (subtype: number, b64string: string) => Binary;
8828
- HexData: (subtype: number, hexstr: string) => Binary;
8829
- UUID: (hexstr?: string) => Binary;
8830
- MD5: (hexstr: string) => Binary;
8831
- Decimal128: typeof bson.Decimal128;
8832
- BSONSymbol: typeof bson.BSONSymbol;
8833
- Int32: typeof bson.Int32;
8834
- Long: LongWithoutAccidentallyExposedMethods;
8835
- Binary: typeof bson.Binary;
8836
- Double: typeof bson.Double;
8837
- EJSON: typeof bson.EJSON;
8838
- BSONRegExp: typeof bson.BSONRegExp;
8839
- }
8764
+ export { ShellBson }
8840
8765
 
8841
8766
  declare interface ShellCliOptions {
8842
8767
  nodb?: boolean;
@@ -8854,7 +8779,7 @@ declare class ShellConfig extends ShellApiClass {
8854
8779
  }
8855
8780
 
8856
8781
  declare class ShellInstanceState {
8857
- currentCursor: Cursor | AggregationCursor_2 | ChangeStreamCursor | RunCommandCursor_2 | null;
8782
+ currentCursor: BaseCursor<ServiceProviderBaseCursor> | null;
8858
8783
  currentDb: DatabaseWithSchema;
8859
8784
  messageBus: MongoshBus;
8860
8785
  initialServiceProvider: ServiceProvider;
@@ -8879,6 +8804,7 @@ declare class ShellInstanceState {
8879
8804
  private alreadyTransformedErrors;
8880
8805
  private preFetchCollectionAndDatabaseNames;
8881
8806
  constructor(initialServiceProvider: ServiceProvider, messageBus?: any, cliOptions?: ShellCliOptions);
8807
+ private constructShellBson;
8882
8808
  fetchConnectionInfo(): Promise<ConnectionInfo_2 | undefined>;
8883
8809
  cachedConnectionInfo(): ConnectionInfo_2 | undefined;
8884
8810
  close(): Promise<void>;
@@ -9579,12 +9505,6 @@ declare interface ValidateCollectionOptions extends CommandOperationOptions {
9579
9505
  /** @public */
9580
9506
  declare type W = number | 'majority';
9581
9507
 
9582
- declare type WithHelp<T> = {
9583
- [prop in keyof T]: T[prop] & {
9584
- help?: () => Help;
9585
- };
9586
- };
9587
-
9588
9508
  /** Add an _id field to an object shaped type @public */
9589
9509
  declare type WithId<TSchema> = EnhancedOmit<TSchema, '_id'> & {
9590
9510
  _id: InferIdType<TSchema>;
package/lib/api.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { CollectionWithSchema } from './collection';
2
- export { ShellBson } from './shell-bson';
2
+ export { ShellBson } from '@mongosh/shell-bson';
3
3
  export { Streams } from './streams';
4
4
  export { DatabaseWithSchema } from './database';
5
5
  import Shard from './shard';
@@ -1,28 +1,21 @@
1
- import { ShellApiWithMongoClass } from './decorators';
2
1
  import type { ServiceProviderChangeStream, Document, ResumeToken } from '@mongosh/service-provider-core';
3
2
  import { CursorIterationResult } from './result';
4
3
  import { asPrintable } from './enums';
5
4
  import type Mongo from './mongo';
6
- export default class ChangeStreamCursor extends ShellApiWithMongoClass {
7
- _mongo: Mongo;
8
- _cursor: ServiceProviderChangeStream<Document>;
5
+ import { BaseCursor } from './abstract-cursor';
6
+ export default class ChangeStreamCursor extends BaseCursor<ServiceProviderChangeStream> {
9
7
  _currentIterationResult: CursorIterationResult | null;
10
8
  _on: string;
11
- constructor(cursor: ServiceProviderChangeStream<Document>, on: string, mongo: Mongo);
9
+ constructor(cursor: ServiceProviderChangeStream, on: string, mongo: Mongo);
12
10
  _it(): Promise<CursorIterationResult>;
13
- [asPrintable](): string;
14
- close(): Promise<void>;
11
+ [asPrintable](): Promise<string>;
15
12
  hasNext(): Promise<boolean>;
16
13
  tryNext(): Promise<Document | null>;
17
- [Symbol.asyncIterator](): AsyncGenerator<Document, void, unknown>;
18
- isClosed(): boolean;
19
14
  isExhausted(): never;
20
- itcount(): Promise<number>;
21
15
  next(): Promise<Document>;
22
16
  getResumeToken(): ResumeToken;
23
- map(): ChangeStreamCursor;
24
- forEach(): Promise<void>;
25
- toArray(): Promise<Document[]>;
26
- objsLeftInBatch(): void;
27
- pretty(): ChangeStreamCursor;
17
+ toArray(): never;
18
+ batchSize(): never;
19
+ objsLeftInBatch(): never;
20
+ maxTimeMS(): never;
28
21
  }
@@ -43,27 +43,22 @@ const result_1 = require("./result");
43
43
  const enums_1 = require("./enums");
44
44
  const errors_1 = require("@mongosh/errors");
45
45
  const helpers_1 = require("./helpers");
46
+ const abstract_cursor_1 = require("./abstract-cursor");
46
47
  let ChangeStreamCursor = (() => {
47
48
  let _classDecorators = [decorators_1.shellApiClassDefault];
48
49
  let _classDescriptor;
49
50
  let _classExtraInitializers = [];
50
51
  let _classThis;
51
- let _classSuper = decorators_1.ShellApiWithMongoClass;
52
+ let _classSuper = abstract_cursor_1.BaseCursor;
52
53
  let _instanceExtraInitializers = [];
53
- let _close_decorators;
54
54
  let _hasNext_decorators;
55
55
  let _tryNext_decorators;
56
- let _itcount_decorators;
57
56
  let _next_decorators;
58
- let _pretty_decorators;
59
57
  var ChangeStreamCursor = _classThis = class extends _classSuper {
60
58
  constructor(cursor, on, mongo) {
61
- super();
62
- this._mongo = __runInitializers(this, _instanceExtraInitializers);
63
- this._currentIterationResult = null;
64
- this._cursor = cursor;
59
+ super(mongo, cursor);
60
+ this._currentIterationResult = (__runInitializers(this, _instanceExtraInitializers), null);
65
61
  this._on = on;
66
- this._mongo = mongo;
67
62
  }
68
63
  async _it() {
69
64
  if (this._cursor.closed) {
@@ -73,81 +68,57 @@ let ChangeStreamCursor = (() => {
73
68
  return (0, helpers_1.iterate)(result, this, await this._mongo._displayBatchSize());
74
69
  }
75
70
  [enums_1.asPrintable]() {
76
- return `ChangeStreamCursor on ${this._on}`;
77
- }
78
- async close() {
79
- await this._cursor.close();
71
+ return Promise.resolve(`ChangeStreamCursor on ${this._on}`);
80
72
  }
81
73
  async hasNext() {
82
- await this._instanceState.printWarning('If there are no documents in the batch, hasNext will block. Use tryNext if you want to check if there ' +
83
- 'are any documents without waiting.');
84
- return this._cursor.hasNext();
74
+ if (!this._blockingWarningDisabled) {
75
+ await this._instanceState.printWarning('If there are no documents in the batch, hasNext will block. Use tryNext if you want to check if there ' +
76
+ 'are any documents without waiting, or cursor.disableBlockWarnings() if you want to disable this warning.');
77
+ }
78
+ return super.hasNext();
85
79
  }
86
80
  async tryNext() {
87
81
  if (this._cursor.closed) {
88
82
  throw new errors_1.MongoshRuntimeError('Cannot call tryNext on closed cursor');
89
83
  }
90
- return this._cursor.tryNext();
91
- }
92
- get [(_close_decorators = [decorators_1.returnsPromise], _hasNext_decorators = [decorators_1.returnsPromise, decorators_1.deprecated], _tryNext_decorators = [decorators_1.returnsPromise], Symbol.for('@@mongosh.syntheticAsyncIterable'))]() {
93
- return true;
94
- }
95
- async *[Symbol.asyncIterator]() {
96
- let doc;
97
- while ((doc = await this.tryNext()) !== null) {
98
- yield doc;
99
- }
100
- }
101
- isClosed() {
102
- return this._cursor.closed;
84
+ return super.tryNext();
103
85
  }
104
86
  isExhausted() {
105
87
  throw new errors_1.MongoshInvalidInputError('isExhausted is not implemented for ChangeStreams because after closing a cursor, the remaining documents in the batch are no longer accessible. If you want to see if the cursor is closed use isClosed. If you want to see if there are documents left in the batch, use tryNext.');
106
88
  }
107
- async itcount() {
108
- let count = 0;
109
- while (await this.tryNext()) {
110
- count++;
111
- }
112
- return count;
113
- }
114
89
  async next() {
115
- await this._instanceState.printWarning('If there are no documents in the batch, next will block. Use tryNext if you want to check if there are ' +
116
- 'any documents without waiting.');
117
- return this._cursor.next();
90
+ if (!this._blockingWarningDisabled) {
91
+ await this._instanceState.printWarning('If there are no documents in the batch, next will block. Use tryNext if you want to check if there are ' +
92
+ 'any documents without waiting, or cursor.disableBlockWarnings() if you want to disable this warning.');
93
+ }
94
+ return (await super.next());
118
95
  }
119
96
  getResumeToken() {
120
97
  return this._cursor.resumeToken;
121
98
  }
122
- map() {
123
- throw new errors_1.MongoshUnimplementedError('Cannot call map on a change stream cursor');
124
- }
125
- forEach() {
126
- throw new errors_1.MongoshUnimplementedError('Cannot call forEach on a change stream cursor');
127
- }
128
99
  toArray() {
129
100
  throw new errors_1.MongoshUnimplementedError('Cannot call toArray on a change stream cursor');
130
101
  }
102
+ batchSize() {
103
+ throw new errors_1.MongoshUnimplementedError('Cannot call batchSize on a change stream cursor');
104
+ }
131
105
  objsLeftInBatch() {
132
106
  throw new errors_1.MongoshUnimplementedError('Cannot call objsLeftInBatch on a change stream cursor');
133
107
  }
134
- pretty() {
135
- return this;
108
+ maxTimeMS() {
109
+ throw new errors_1.MongoshUnimplementedError('Cannot call maxTimeMS on a change stream cursor');
136
110
  }
137
111
  };
138
112
  __setFunctionName(_classThis, "ChangeStreamCursor");
139
113
  (() => {
140
114
  var _a;
141
115
  const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create((_a = _classSuper[Symbol.metadata]) !== null && _a !== void 0 ? _a : null) : void 0;
142
- _itcount_decorators = [decorators_1.returnsPromise];
116
+ _hasNext_decorators = [decorators_1.returnsPromise, decorators_1.deprecated];
117
+ _tryNext_decorators = [decorators_1.returnsPromise];
143
118
  _next_decorators = [decorators_1.returnsPromise];
144
- _pretty_decorators = [(0, decorators_1.returnType)('ChangeStreamCursor')];
145
- __esDecorate(_classThis, null, _close_decorators, { kind: "method", name: "close", static: false, private: false, access: { has: obj => "close" in obj, get: obj => obj.close }, metadata: _metadata }, null, _instanceExtraInitializers);
146
119
  __esDecorate(_classThis, null, _hasNext_decorators, { kind: "method", name: "hasNext", static: false, private: false, access: { has: obj => "hasNext" in obj, get: obj => obj.hasNext }, metadata: _metadata }, null, _instanceExtraInitializers);
147
120
  __esDecorate(_classThis, null, _tryNext_decorators, { kind: "method", name: "tryNext", static: false, private: false, access: { has: obj => "tryNext" in obj, get: obj => obj.tryNext }, metadata: _metadata }, null, _instanceExtraInitializers);
148
- __esDecorate(_classThis, null, _itcount_decorators, { kind: "method", name: "itcount", static: false, private: false, access: { has: obj => "itcount" in obj, get: obj => obj.itcount }, metadata: _metadata }, null, _instanceExtraInitializers);
149
121
  __esDecorate(_classThis, null, _next_decorators, { kind: "method", name: "next", static: false, private: false, access: { has: obj => "next" in obj, get: obj => obj.next }, metadata: _metadata }, null, _instanceExtraInitializers);
150
- __esDecorate(_classThis, null, _pretty_decorators, { kind: "method", name: "pretty", static: false, private: false, access: { has: obj => "pretty" in obj, get: obj => obj.pretty }, metadata: _metadata }, null, _instanceExtraInitializers);
151
122
  __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
152
123
  ChangeStreamCursor = _classThis = _classDescriptor.value;
153
124
  if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
@@ -1 +1 @@
1
- {"version":3,"file":"change-stream-cursor.js","sourceRoot":"","sources":["../src/change-stream-cursor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAMsB;AAMtB,qCAAiD;AACjD,mCAAsC;AACtC,4CAIyB;AACzB,uCAAoC;;4BAGnC,iCAAoB;;;;sBAC2B,mCAAsB;;;;;;;;+CAA9B,SAAQ,WAAsB;QAMpE,YACE,MAA6C,EAC7C,EAAU,EACV,KAAY;YAEZ,KAAK,EAAE,CAAC;YAVV,WAAM,GADa,mDAAkB,CACvB;YAEd,4BAAuB,GAAiC,IAAI,CAAC;YAS3D,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC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115
  async hasNext() {
116
- if (this._tailable) {
116
+ if (this._tailable && !this._blockingWarningDisabled) {
117
117
  await this._instanceState.printWarning('If this is a tailable cursor with awaitData, and there are no documents in the batch, this method ' +
118
- 'will will block. Use tryNext if you want to check if there are any documents without waiting.');
118
+ 'will will block. Use tryNext if you want to check if there are any documents without waiting, or ' +
119
+ 'cursor.disableBlockWarnings() if you want to disable this warning.');
119
120
  }
120
121
  return super.hasNext();
121
122
  }
@@ -140,9 +141,10 @@ let Cursor = (() => {
140
141
  return this;
141
142
  }
142
143
  async next() {
143
- if (this._tailable) {
144
+ if (this._tailable && !this._blockingWarningDisabled) {
144
145
  await this._instanceState.printWarning('If this is a tailable cursor with awaitData, and there are no documents in the batch, this' +
145
- ' method will will block. Use tryNext if you want to check if there are any documents without waiting.');
146
+ ' method will will block. Use tryNext if you want to check if there are any documents without waiting,' +
147
+ ' or cursor.disableBlockWarnings() if you want to disable this warning.');
146
148
  }
147
149
  return super.next();
148
150
  }
package/lib/cursor.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cursor.js","sourceRoot":"","sources":["../src/cursor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAKyB;AACzB,6CAOsB;AACtB,mCAAuD;AAYvD,yEAAmE;;4BAElE,iCAAoB;;;;sBACe,gDAAqB;;;;;;;;;;;;;;;;;;;;;;;;mCAA7B,SAAQ,WAAgD;QAGlF,YAAY,KAAY,EAAE,MAAiC;YACzD,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;YAHvB,cAAS,IADU,mDAAM,EACb,KAAK,EAAC;QAIlB,CAAC;QAUD,MAAM;YACJ,MAAM,IAAI,iCAAwB,CAChC,2EAA2E,EAC3E,qBAAY,CAAC,eAAe,CAC7B,CAAC;QACJ,CAAC;QASO,QAAQ,CAAC,IAAgB;YAC/B,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,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= (() => {
387
387
  if (writeConcern) {
388
388
  command.writeConcern = writeConcern;
389
389
  }
390
- const digestPwd = (0, helpers_1.processDigestPassword)(user.user, user.passwordDigestor, command);
390
+ const digestPwd = await (0, helpers_1.processDigestPassword)(user.user, user.passwordDigestor, command, this._instanceState.currentServiceProvider);
391
391
  const orderedCmd = {
392
392
  createUser: command.createUser,
393
393
  ...command,
@@ -409,7 +409,7 @@ let Database = (() => {
409
409
  if (writeConcern) {
410
410
  command.writeConcern = writeConcern;
411
411
  }
412
- const digestPwd = (0, helpers_1.processDigestPassword)(username, userDoc.passwordDigestor, command);
412
+ const digestPwd = await (0, helpers_1.processDigestPassword)(username, userDoc.passwordDigestor, command, this._instanceState.currentServiceProvider);
413
413
  const orderedCmd = {
414
414
  updateUser: command.updateUser,
415
415
  ...command,