@qp-mongosh/shell-api 0.0.0-dev.5 → 0.0.0-dev.9

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 (66) hide show
  1. package/.eslintignore +2 -2
  2. package/.eslintrc.js +1 -1
  3. package/AUTHORS +15 -15
  4. package/LICENSE +200 -200
  5. package/bin/report-missing-help.ts +24 -24
  6. package/bin/report-supported-api.ts +14 -14
  7. package/lib/abstract-cursor.d.ts +33 -33
  8. package/lib/abstract-cursor.js +191 -191
  9. package/lib/aggregation-cursor.d.ts +6 -6
  10. package/lib/aggregation-cursor.js +19 -19
  11. package/lib/bulk.d.ts +43 -43
  12. package/lib/bulk.js +223 -223
  13. package/lib/change-stream-cursor.d.ts +28 -28
  14. package/lib/change-stream-cursor.js +111 -111
  15. package/lib/collection.d.ts +95 -95
  16. package/lib/collection.js +964 -964
  17. package/lib/cursor.d.ts +32 -32
  18. package/lib/cursor.js +215 -215
  19. package/lib/database.d.ts +116 -116
  20. package/lib/database.js +1223 -1223
  21. package/lib/dbquery.d.ts +8 -8
  22. package/lib/dbquery.js +28 -28
  23. package/lib/decorators.d.ts +73 -73
  24. package/lib/decorators.js +395 -395
  25. package/lib/enums.d.ts +28 -28
  26. package/lib/enums.js +33 -33
  27. package/lib/error-codes.d.ts +12 -12
  28. package/lib/error-codes.js +19 -19
  29. package/lib/explainable-cursor.d.ts +11 -11
  30. package/lib/explainable-cursor.js +31 -31
  31. package/lib/explainable.d.ts +32 -32
  32. package/lib/explainable.js +166 -166
  33. package/lib/field-level-encryption.d.ts +50 -50
  34. package/lib/field-level-encryption.js +176 -176
  35. package/lib/help.d.ts +22 -22
  36. package/lib/help.js +26 -26
  37. package/lib/helpers.d.ts +71 -71
  38. package/lib/helpers.js +588 -588
  39. package/lib/index.d.ts +16 -16
  40. package/lib/index.js +45 -45
  41. package/lib/interruptor.d.ts +19 -19
  42. package/lib/interruptor.js +62 -62
  43. package/lib/mongo-errors.d.ts +5 -5
  44. package/lib/mongo-errors.js +37 -37
  45. package/lib/mongo.d.ts +75 -75
  46. package/lib/mongo.js +476 -476
  47. package/lib/no-db.d.ts +5 -5
  48. package/lib/no-db.js +28 -28
  49. package/lib/plan-cache.d.ts +16 -16
  50. package/lib/plan-cache.js +70 -70
  51. package/lib/replica-set.d.ts +45 -45
  52. package/lib/replica-set.js +314 -314
  53. package/lib/result.d.ts +61 -61
  54. package/lib/result.js +104 -104
  55. package/lib/session.d.ts +25 -25
  56. package/lib/session.js +88 -88
  57. package/lib/shard.d.ts +42 -42
  58. package/lib/shard.js +414 -414
  59. package/lib/shell-api.d.ts +52 -52
  60. package/lib/shell-api.js +298 -298
  61. package/lib/shell-bson.d.ts +40 -40
  62. package/lib/shell-bson.js +159 -159
  63. package/lib/shell-instance-state.d.ts +77 -77
  64. package/lib/shell-instance-state.js +392 -392
  65. package/package.json +47 -47
  66. package/tsconfig.lint.json +8 -8
package/lib/dbquery.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { ShellApiClass } from './decorators';
2
- import ShellInstanceState from './shell-instance-state';
3
- export declare class DBQuery extends ShellApiClass {
4
- _instanceState: ShellInstanceState;
5
- constructor(instanceState: ShellInstanceState);
6
- get shellBatchSize(): number | undefined;
7
- set shellBatchSize(value: number | undefined);
8
- }
1
+ import { ShellApiClass } from './decorators';
2
+ import ShellInstanceState from './shell-instance-state';
3
+ export declare class DBQuery extends ShellApiClass {
4
+ _instanceState: ShellInstanceState;
5
+ constructor(instanceState: ShellInstanceState);
6
+ get shellBatchSize(): number | undefined;
7
+ set shellBatchSize(value: number | undefined);
8
+ }
package/lib/dbquery.js CHANGED
@@ -1,29 +1,29 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.DBQuery = void 0;
10
- const decorators_1 = require("./decorators");
11
- let DBQuery = class DBQuery extends decorators_1.ShellApiClass {
12
- constructor(instanceState) {
13
- super();
14
- this._instanceState = instanceState;
15
- }
16
- get shellBatchSize() {
17
- return this._instanceState.displayBatchSizeFromDBQuery;
18
- }
19
- set shellBatchSize(value) {
20
- void this._instanceState.printDeprecationWarning('DBQuery.shellBatchSize is deprecated, please use config.set("displayBatchSize") instead');
21
- this._instanceState.displayBatchSizeFromDBQuery = value;
22
- }
23
- };
24
- DBQuery = __decorate([
25
- decorators_1.shellApiClassDefault,
26
- decorators_1.classDeprecated
27
- ], DBQuery);
28
- exports.DBQuery = DBQuery;
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.DBQuery = void 0;
10
+ const decorators_1 = require("./decorators");
11
+ let DBQuery = class DBQuery extends decorators_1.ShellApiClass {
12
+ constructor(instanceState) {
13
+ super();
14
+ this._instanceState = instanceState;
15
+ }
16
+ get shellBatchSize() {
17
+ return this._instanceState.displayBatchSizeFromDBQuery;
18
+ }
19
+ set shellBatchSize(value) {
20
+ void this._instanceState.printDeprecationWarning('DBQuery.shellBatchSize is deprecated, please use config.set("displayBatchSize") instead');
21
+ this._instanceState.displayBatchSizeFromDBQuery = value;
22
+ }
23
+ };
24
+ DBQuery = __decorate([
25
+ decorators_1.shellApiClassDefault,
26
+ decorators_1.classDeprecated
27
+ ], DBQuery);
28
+ exports.DBQuery = DBQuery;
29
29
  //# sourceMappingURL=dbquery.js.map
@@ -1,73 +1,73 @@
1
- import { Mongo, ShellInstanceState } from '.';
2
- import { asPrintable, shellApiType, Topologies } from './enums';
3
- export interface Namespace {
4
- db: string;
5
- collection: string;
6
- }
7
- export interface ShellResultSourceInformation {
8
- namespace: Namespace;
9
- }
10
- export interface ShellResult {
11
- rawValue: any;
12
- printable: any;
13
- type: string | null;
14
- source?: ShellResultSourceInformation;
15
- }
16
- export declare abstract class ShellApiClass {
17
- help: any;
18
- abstract get _instanceState(): ShellInstanceState;
19
- get [shellApiType](): string;
20
- set [shellApiType](value: string);
21
- [asPrintable](): any;
22
- }
23
- export declare abstract class ShellApiWithMongoClass extends ShellApiClass {
24
- abstract get _mongo(): Mongo;
25
- get _instanceState(): ShellInstanceState;
26
- }
27
- export declare abstract class ShellApiValueClass extends ShellApiClass {
28
- get _mongo(): never;
29
- get _instanceState(): never;
30
- }
31
- export declare function getShellApiType(rawValue: any): string | null;
32
- export declare function toShellResult(rawValue: any): Promise<ShellResult>;
33
- export interface ShellCommandAutocompleteParameters {
34
- getCollectionCompletionsForCurrentDb: (collName: string) => string[] | Promise<string[]>;
35
- getDatabaseCompletions: (dbName: string) => string[] | Promise<string[]>;
36
- }
37
- export declare type ShellCommandCompleter = (params: ShellCommandAutocompleteParameters, args: string[]) => Promise<string[] | undefined>;
38
- export interface TypeSignature {
39
- type: string;
40
- serverVersions?: [string, string];
41
- apiVersions?: [number, number];
42
- topologies?: Topologies[];
43
- returnsPromise?: boolean;
44
- deprecated?: boolean;
45
- returnType?: string | TypeSignature;
46
- attributes?: {
47
- [key: string]: TypeSignature;
48
- };
49
- isDirectShellCommand?: boolean;
50
- acceptsRawInput?: boolean;
51
- shellCommandCompleter?: ShellCommandCompleter;
52
- }
53
- interface Signatures {
54
- [key: string]: TypeSignature;
55
- }
56
- declare const signatures: Signatures;
57
- export { signatures };
58
- export declare const toIgnore: string[];
59
- export declare function shellApiClassDefault(constructor: Function): void;
60
- export declare function shellApiClassNoHelp(constructor: Function): void;
61
- export declare function serverVersions(versionArray: [string, string]): Function;
62
- export declare function apiVersions(versionArray: [] | [number] | [number, number]): Function;
63
- export declare function deprecated(_target: any, _propertyKey: string, descriptor: PropertyDescriptor): void;
64
- export declare function topologies(topologiesArray: Topologies[]): Function;
65
- export declare const nonAsyncFunctionsReturningPromises: string[];
66
- export declare function returnsPromise(_target: any, _propertyKey: string, descriptor: PropertyDescriptor): void;
67
- export declare function directShellCommand(_target: any, _propertyKey: string, descriptor: PropertyDescriptor): void;
68
- export declare function shellCommandCompleter(completer: ShellCommandCompleter): Function;
69
- export declare function returnType(type: string): Function;
70
- export declare function classDeprecated(constructor: Function): void;
71
- export declare function platforms(platformsArray: any[]): Function;
72
- export declare function classPlatforms(platformsArray: any[]): Function;
73
- export declare function addSourceToResults(constructor: Function): void;
1
+ import { Mongo, ShellInstanceState } from '.';
2
+ import { asPrintable, shellApiType, Topologies } from './enums';
3
+ export interface Namespace {
4
+ db: string;
5
+ collection: string;
6
+ }
7
+ export interface ShellResultSourceInformation {
8
+ namespace: Namespace;
9
+ }
10
+ export interface ShellResult {
11
+ rawValue: any;
12
+ printable: any;
13
+ type: string | null;
14
+ source?: ShellResultSourceInformation;
15
+ }
16
+ export declare abstract class ShellApiClass {
17
+ help: any;
18
+ abstract get _instanceState(): ShellInstanceState;
19
+ get [shellApiType](): string;
20
+ set [shellApiType](value: string);
21
+ [asPrintable](): any;
22
+ }
23
+ export declare abstract class ShellApiWithMongoClass extends ShellApiClass {
24
+ abstract get _mongo(): Mongo;
25
+ get _instanceState(): ShellInstanceState;
26
+ }
27
+ export declare abstract class ShellApiValueClass extends ShellApiClass {
28
+ get _mongo(): never;
29
+ get _instanceState(): never;
30
+ }
31
+ export declare function getShellApiType(rawValue: any): string | null;
32
+ export declare function toShellResult(rawValue: any): Promise<ShellResult>;
33
+ export interface ShellCommandAutocompleteParameters {
34
+ getCollectionCompletionsForCurrentDb: (collName: string) => string[] | Promise<string[]>;
35
+ getDatabaseCompletions: (dbName: string) => string[] | Promise<string[]>;
36
+ }
37
+ export declare type ShellCommandCompleter = (params: ShellCommandAutocompleteParameters, args: string[]) => Promise<string[] | undefined>;
38
+ export interface TypeSignature {
39
+ type: string;
40
+ serverVersions?: [string, string];
41
+ apiVersions?: [number, number];
42
+ topologies?: Topologies[];
43
+ returnsPromise?: boolean;
44
+ deprecated?: boolean;
45
+ returnType?: string | TypeSignature;
46
+ attributes?: {
47
+ [key: string]: TypeSignature;
48
+ };
49
+ isDirectShellCommand?: boolean;
50
+ acceptsRawInput?: boolean;
51
+ shellCommandCompleter?: ShellCommandCompleter;
52
+ }
53
+ interface Signatures {
54
+ [key: string]: TypeSignature;
55
+ }
56
+ declare const signatures: Signatures;
57
+ export { signatures };
58
+ export declare const toIgnore: string[];
59
+ export declare function shellApiClassDefault(constructor: Function): void;
60
+ export declare function shellApiClassNoHelp(constructor: Function): void;
61
+ export declare function serverVersions(versionArray: [string, string]): Function;
62
+ export declare function apiVersions(versionArray: [] | [number] | [number, number]): Function;
63
+ export declare function deprecated(_target: any, _propertyKey: string, descriptor: PropertyDescriptor): void;
64
+ export declare function topologies(topologiesArray: Topologies[]): Function;
65
+ export declare const nonAsyncFunctionsReturningPromises: string[];
66
+ export declare function returnsPromise(_target: any, _propertyKey: string, descriptor: PropertyDescriptor): void;
67
+ export declare function directShellCommand(_target: any, _propertyKey: string, descriptor: PropertyDescriptor): void;
68
+ export declare function shellCommandCompleter(completer: ShellCommandCompleter): Function;
69
+ export declare function returnType(type: string): Function;
70
+ export declare function classDeprecated(constructor: Function): void;
71
+ export declare function platforms(platformsArray: any[]): Function;
72
+ export declare function classPlatforms(platformsArray: any[]): Function;
73
+ export declare function addSourceToResults(constructor: Function): void;