@mongosh/browser-repl 1.6.0 → 1.6.2

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 (97) hide show
  1. package/.depcheckrc +8 -2
  2. package/config/webpack.config.base.js +46 -61
  3. package/config/webpack.config.test.js +1 -17
  4. package/config/webpack.config.watch.js +27 -0
  5. package/lib/components/ace-autocompleter-adapter.d.ts +15 -0
  6. package/lib/components/ace-autocompleter-adapter.js +26 -0
  7. package/lib/components/ace-autocompleter-adapter.js.map +1 -0
  8. package/lib/components/editor.d.ts +41 -0
  9. package/lib/components/editor.js +140 -0
  10. package/lib/components/editor.js.map +1 -0
  11. package/lib/components/password-prompt.d.ts +12 -0
  12. package/lib/components/password-prompt.js +67 -0
  13. package/lib/components/password-prompt.js.map +1 -0
  14. package/lib/components/shell-input.d.ts +33 -0
  15. package/lib/components/shell-input.js +127 -0
  16. package/lib/components/shell-input.js.map +1 -0
  17. package/lib/components/shell-loader.d.ts +11 -0
  18. package/lib/components/shell-loader.js +42 -0
  19. package/lib/components/shell-loader.js.map +1 -0
  20. package/lib/components/shell-output-line.d.ts +23 -0
  21. package/lib/components/shell-output-line.js +135 -0
  22. package/lib/components/shell-output-line.js.map +1 -0
  23. package/lib/components/shell-output.d.ts +14 -0
  24. package/lib/components/shell-output.js +48 -0
  25. package/lib/components/shell-output.js.map +1 -0
  26. package/lib/components/shell.d.ts +61 -0
  27. package/lib/components/shell.js +283 -0
  28. package/lib/components/shell.js.map +1 -0
  29. package/lib/components/types/cursor-iteration-result-output.d.ts +19 -0
  30. package/lib/components/types/cursor-iteration-result-output.js +57 -0
  31. package/lib/components/types/cursor-iteration-result-output.js.map +1 -0
  32. package/lib/components/types/cursor-output.d.ts +16 -0
  33. package/lib/components/types/cursor-output.js +45 -0
  34. package/lib/components/types/cursor-output.js.map +1 -0
  35. package/lib/components/types/error-output.d.ts +18 -0
  36. package/lib/components/types/error-output.js +92 -0
  37. package/lib/components/types/error-output.js.map +1 -0
  38. package/lib/components/types/help-output.d.ts +25 -0
  39. package/lib/components/types/help-output.js +102 -0
  40. package/lib/components/types/help-output.js.map +1 -0
  41. package/lib/components/types/object-output.d.ts +12 -0
  42. package/lib/components/types/object-output.js +43 -0
  43. package/lib/components/types/object-output.js.map +1 -0
  44. package/lib/components/types/show-banner-result-output.d.ts +15 -0
  45. package/lib/components/types/show-banner-result-output.js +45 -0
  46. package/lib/components/types/show-banner-result-output.js.map +1 -0
  47. package/lib/components/types/show-collections-output.d.ts +17 -0
  48. package/lib/components/types/show-collections-output.js +81 -0
  49. package/lib/components/types/show-collections-output.js.map +1 -0
  50. package/lib/components/types/show-dbs-output.d.ts +17 -0
  51. package/lib/components/types/show-dbs-output.js +54 -0
  52. package/lib/components/types/show-dbs-output.js.map +1 -0
  53. package/lib/components/types/show-profile-output.d.ts +16 -0
  54. package/lib/components/types/show-profile-output.js +67 -0
  55. package/lib/components/types/show-profile-output.js.map +1 -0
  56. package/lib/components/types/simple-type-output.d.ts +14 -0
  57. package/lib/components/types/simple-type-output.js +45 -0
  58. package/lib/components/types/simple-type-output.js.map +1 -0
  59. package/lib/components/types/stats-result-output.d.ts +12 -0
  60. package/lib/components/types/stats-result-output.js +51 -0
  61. package/lib/components/types/stats-result-output.js.map +1 -0
  62. package/lib/components/utils/expandable.d.ts +12 -0
  63. package/lib/components/utils/expandable.js +53 -0
  64. package/lib/components/utils/expandable.js.map +1 -0
  65. package/lib/components/utils/inspect.d.ts +1 -0
  66. package/lib/components/utils/inspect.js +75 -0
  67. package/lib/components/utils/inspect.js.map +1 -0
  68. package/lib/components/utils/line-with-icon.d.ts +14 -0
  69. package/lib/components/utils/line-with-icon.js +59 -0
  70. package/lib/components/utils/line-with-icon.js.map +1 -0
  71. package/lib/components/utils/syntax-highlight.d.ts +12 -0
  72. package/lib/components/utils/syntax-highlight.js +53 -0
  73. package/lib/components/utils/syntax-highlight.js.map +1 -0
  74. package/lib/iframe-runtime/iframe-interpreter-environment.d.ts +7 -0
  75. package/lib/iframe-runtime/iframe-interpreter-environment.js +17 -0
  76. package/lib/iframe-runtime/iframe-interpreter-environment.js.map +1 -0
  77. package/lib/iframe-runtime/iframe-runtime.d.ts +17 -0
  78. package/lib/iframe-runtime/iframe-runtime.js +68 -0
  79. package/lib/iframe-runtime/iframe-runtime.js.map +1 -0
  80. package/lib/iframe-runtime/index.d.ts +1 -0
  81. package/lib/iframe-runtime/index.js +18 -0
  82. package/lib/iframe-runtime/index.js.map +1 -0
  83. package/lib/index.d.ts +2 -0
  84. package/lib/index.js +8 -0
  85. package/lib/index.js.map +1 -0
  86. package/lib/sandbox.d.ts +1 -0
  87. package/lib/sandbox.js +212 -0
  88. package/lib/sandbox.js.map +1 -0
  89. package/package.json +49 -52
  90. package/.babelrc +0 -11
  91. package/.storybook/main.js +0 -4
  92. package/.storybook/webpack.config.js +0 -12
  93. package/config/plain-url.js +0 -1
  94. package/config/webpack.config.prod.js +0 -21
  95. package/config/webpack.config.stats.js +0 -9
  96. package/lib/mongosh-browser-repl.js +0 -1991
  97. package/lib/mongosh-browser-repl.js.map +0 -1
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.ShowDbsOutput = void 0;
30
+ const react_1 = __importStar(require("react"));
31
+ const numeral_1 = __importDefault(require("numeral"));
32
+ const prop_types_1 = __importDefault(require("prop-types"));
33
+ const text_table_1 = __importDefault(require("text-table"));
34
+ function formatBytes(value) {
35
+ const precision = value <= 1000 ? '0' : '0.00';
36
+ return (0, numeral_1.default)(value).format(precision + ' ib');
37
+ }
38
+ class ShowDbsOutput extends react_1.Component {
39
+ constructor() {
40
+ super(...arguments);
41
+ this.renderTable = (value) => {
42
+ const tableEntries = value.map((db) => [db.name, formatBytes(db.sizeOnDisk)]);
43
+ return (0, text_table_1.default)(tableEntries, { align: ['l', 'r'] });
44
+ };
45
+ }
46
+ render() {
47
+ return react_1.default.createElement("pre", null, this.renderTable(this.props.value));
48
+ }
49
+ }
50
+ exports.ShowDbsOutput = ShowDbsOutput;
51
+ ShowDbsOutput.propTypes = {
52
+ value: prop_types_1.default.any
53
+ };
54
+ //# sourceMappingURL=show-dbs-output.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"show-dbs-output.js","sourceRoot":"","sources":["../../../src/components/types/show-dbs-output.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAyC;AACzC,sDAA8B;AAC9B,4DAAmC;AACnC,4DAAmC;AAWnC,SAAS,WAAW,CAAC,KAAa;IAChC,MAAM,SAAS,GAAG,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC;IAC/C,OAAO,IAAA,iBAAO,EAAC,KAAK,CAAC,CAAC,MAAM,CAAC,SAAS,GAAG,KAAK,CAAC,CAAC;AAClD,CAAC;AAED,MAAa,aAAc,SAAQ,iBAA6B;IAAhE;;QAKE,gBAAW,GAAG,CAAC,KAAqB,EAAU,EAAE;YAC9C,MAAM,YAAY,GAAG,KAAK,CAAC,GAAG,CAC5B,CAAC,EAAO,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CACnD,CAAC;YAEF,OAAO,IAAA,oBAAS,EAAC,YAAY,EAAE,EAAE,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;QACxD,CAAC,CAAC;IAKJ,CAAC;IAHC,MAAM;QACJ,OAAO,2CAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAO,CAAC;IACzD,CAAC;;AAfH,sCAgBC;AAfQ,uBAAS,GAAG;IACjB,KAAK,EAAE,oBAAS,CAAC,GAAG;CACrB,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { Component } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ interface ShowProfileResult {
4
+ count: number;
5
+ result?: any[];
6
+ }
7
+ interface ShowProfileOutputProps {
8
+ value: ShowProfileResult;
9
+ }
10
+ export declare class ShowProfileOutput extends Component<ShowProfileOutputProps> {
11
+ static propTypes: {
12
+ value: PropTypes.Requireable<object>;
13
+ };
14
+ render(): JSX.Element;
15
+ }
16
+ export {};
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.ShowProfileOutput = void 0;
30
+ const react_1 = __importStar(require("react"));
31
+ const prop_types_1 = __importDefault(require("prop-types"));
32
+ const simple_type_output_1 = require("./simple-type-output");
33
+ const inspect_1 = require("../utils/inspect");
34
+ class ShowProfileOutput extends react_1.Component {
35
+ render() {
36
+ if (this.props.value.count === 0) {
37
+ return react_1.default.createElement(simple_type_output_1.SimpleTypeOutput, { value: 'db.system.profile is empty.\\nUse db.setProfilingLevel(2) will enable profiling.\\nUse db.getCollection("system.profile").find() to show raw profile entries.' });
38
+ }
39
+ const toret = this.props.value.result.map((x) => {
40
+ const res = `${x.op} ${x.ns} ${x.millis}ms ${String(x.ts).substring(0, 24)}\n`;
41
+ let l = '';
42
+ for (const z in x) {
43
+ if (z === 'op' || z === 'ns' || z === 'millis' || z === 'ts') {
44
+ continue;
45
+ }
46
+ const val = x[z];
47
+ const mytype = typeof (val);
48
+ if (mytype === 'object') {
49
+ l += z + ':' + (0, inspect_1.inspect)(val) + ' ';
50
+ }
51
+ else if (mytype === 'boolean') {
52
+ l += z + ' ';
53
+ }
54
+ else {
55
+ l += z + ':' + val + ' ';
56
+ }
57
+ }
58
+ return `${res}${l}`;
59
+ });
60
+ return react_1.default.createElement(simple_type_output_1.SimpleTypeOutput, { value: toret });
61
+ }
62
+ }
63
+ exports.ShowProfileOutput = ShowProfileOutput;
64
+ ShowProfileOutput.propTypes = {
65
+ value: prop_types_1.default.object
66
+ };
67
+ //# sourceMappingURL=show-profile-output.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"show-profile-output.js","sourceRoot":"","sources":["../../../src/components/types/show-profile-output.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAyC;AACzC,4DAAmC;AACnC,6DAAwD;AACxD,8CAA2C;AAW3C,MAAa,iBAAkB,SAAQ,iBAAiC;IAKtE,MAAM;QACJ,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,EAAE;YAChC,OAAO,8BAAC,qCAAgB,IAAC,KAAK,EAAC,+JAA6J,GAAE,CAAC;SAChM;QAED,MAAM,KAAK,GAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,MAAc,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE;YAC5D,MAAM,GAAG,GAAG,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,MAAM,MAAM,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC;YAClF,IAAI,CAAC,GAAG,EAAE,CAAC;YACX,KAAK,MAAM,CAAC,IAAI,CAAC,EAAE;gBACjB,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,EAAE;oBAC5D,SAAS;iBACV;gBAED,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;gBACjB,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;gBAE5B,IAAI,MAAM,KAAK,QAAQ,EAAE;oBACvB,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG,IAAA,iBAAO,EAAC,GAAG,CAAC,GAAG,GAAG,CAAC;iBACnC;qBAAM,IAAI,MAAM,KAAK,SAAS,EAAE;oBAC/B,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC;iBACd;qBAAM;oBACL,CAAC,IAAI,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;iBAC1B;aACF;YACD,OAAO,GAAG,GAAG,GAAG,CAAC,EAAE,CAAC;QACtB,CAAC,CAAC,CAAC;QACH,OAAO,8BAAC,qCAAgB,IAAC,KAAK,EAAE,KAAK,GAAG,CAAC;IAC3C,CAAC;;AAhCH,8CAiCC;AAhCQ,2BAAS,GAAG;IACjB,KAAK,EAAE,oBAAS,CAAC,MAAM;CACxB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { Component } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ interface SimpleTypeOutputProps {
4
+ value: any;
5
+ raw?: boolean;
6
+ }
7
+ export declare class SimpleTypeOutput extends Component<SimpleTypeOutputProps> {
8
+ static propTypes: {
9
+ value: PropTypes.Requireable<any>;
10
+ raw: PropTypes.Requireable<boolean>;
11
+ };
12
+ render(): JSX.Element;
13
+ }
14
+ export {};
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.SimpleTypeOutput = void 0;
30
+ const react_1 = __importStar(require("react"));
31
+ const prop_types_1 = __importDefault(require("prop-types"));
32
+ const syntax_highlight_1 = require("../utils/syntax-highlight");
33
+ const inspect_1 = require("../utils/inspect");
34
+ class SimpleTypeOutput extends react_1.Component {
35
+ render() {
36
+ const asString = this.props.raw ? this.props.value : (0, inspect_1.inspect)(this.props.value);
37
+ return (react_1.default.createElement(syntax_highlight_1.SyntaxHighlight, { code: asString }));
38
+ }
39
+ }
40
+ exports.SimpleTypeOutput = SimpleTypeOutput;
41
+ SimpleTypeOutput.propTypes = {
42
+ value: prop_types_1.default.any,
43
+ raw: prop_types_1.default.bool
44
+ };
45
+ //# sourceMappingURL=simple-type-output.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simple-type-output.js","sourceRoot":"","sources":["../../../src/components/types/simple-type-output.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAyC;AACzC,4DAAmC;AACnC,gEAA4D;AAC5D,8CAA2C;AAO3C,MAAa,gBAAiB,SAAQ,iBAAgC;IAMpE,MAAM;QACJ,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,IAAA,iBAAO,EAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC/E,OAAO,CAAC,8BAAC,kCAAe,IAAC,IAAI,EAAE,QAAQ,GAAI,CAAC,CAAC;IAC/C,CAAC;;AATH,4CAUC;AATQ,0BAAS,GAAG;IACjB,KAAK,EAAE,oBAAS,CAAC,GAAG;IACpB,GAAG,EAAE,oBAAS,CAAC,IAAI;CACpB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { Component } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ interface StatsResultOutputProps {
4
+ value: Record<string, any>;
5
+ }
6
+ export declare class StatsResultOutput extends Component<StatsResultOutputProps> {
7
+ static propTypes: {
8
+ value: PropTypes.Requireable<any>;
9
+ };
10
+ render(): JSX.Element;
11
+ }
12
+ export {};
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.StatsResultOutput = void 0;
30
+ const react_1 = __importStar(require("react"));
31
+ const prop_types_1 = __importDefault(require("prop-types"));
32
+ const object_output_1 = require("./object-output");
33
+ class StatsResultOutput extends react_1.Component {
34
+ render() {
35
+ const result = [];
36
+ for (const [key, value] of Object.entries(this.props.value)) {
37
+ if (result.length > 0) {
38
+ result.push(react_1.default.createElement("hr", { key: `${key}-separator` }));
39
+ }
40
+ result.push(react_1.default.createElement("div", { key: key },
41
+ react_1.default.createElement("h4", null, key),
42
+ react_1.default.createElement(object_output_1.ObjectOutput, { value: value })));
43
+ }
44
+ return react_1.default.createElement("div", null, result);
45
+ }
46
+ }
47
+ exports.StatsResultOutput = StatsResultOutput;
48
+ StatsResultOutput.propTypes = {
49
+ value: prop_types_1.default.any
50
+ };
51
+ //# sourceMappingURL=stats-result-output.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stats-result-output.js","sourceRoot":"","sources":["../../../src/components/types/stats-result-output.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAyC;AACzC,4DAAmC;AACnC,mDAA+C;AAM/C,MAAa,iBAAkB,SAAQ,iBAAiC;IAKtE,MAAM;QACJ,MAAM,MAAM,GAAkB,EAAE,CAAC;QACjC,KAAK,MAAM,CAAE,GAAG,EAAE,KAAK,CAAE,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;YAC7D,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;gBACrB,MAAM,CAAC,IAAI,CAAC,sCAAI,GAAG,EAAE,GAAG,GAAG,YAAY,GAAI,CAAC,CAAC;aAC9C;YACD,MAAM,CAAC,IAAI,CAAC,uCAAK,GAAG,EAAE,GAAG;gBACvB,0CAAK,GAAG,CAAM;gBACd,8BAAC,4BAAY,IAAC,KAAK,EAAE,KAAK,GAAI,CAC1B,CAAC,CAAC;SACT;QACD,OAAO,2CAAM,MAAM,CAAO,CAAC;IAC7B,CAAC;;AAjBH,8CAkBC;AAjBQ,2BAAS,GAAG;IACjB,KAAK,EAAE,oBAAS,CAAC,GAAG;CACrB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { Component } from 'react';
2
+ declare type ExpandableProps = {};
3
+ interface ExpandableState {
4
+ expanded: boolean;
5
+ }
6
+ export declare class Expandable extends Component<ExpandableProps, ExpandableState> {
7
+ static propTypes: {};
8
+ state: Readonly<ExpandableState>;
9
+ toggle: () => void;
10
+ render(): JSX.Element;
11
+ }
12
+ export {};
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.Expandable = void 0;
27
+ const react_1 = __importStar(require("react"));
28
+ const compass_components_1 = require("@mongodb-js/compass-components");
29
+ const compass_components_2 = require("@mongodb-js/compass-components");
30
+ const line_with_icon_1 = require("./line-with-icon");
31
+ const expandableCaret = (0, compass_components_1.css)({
32
+ cursor: 'pointer'
33
+ });
34
+ class Expandable extends react_1.Component {
35
+ constructor() {
36
+ super(...arguments);
37
+ this.state = {
38
+ expanded: false
39
+ };
40
+ this.toggle = () => {
41
+ this.setState({ expanded: !this.state.expanded });
42
+ };
43
+ }
44
+ render() {
45
+ const icon = (react_1.default.createElement(compass_components_2.Icon, { size: 12, glyph: this.state.expanded ? 'CaretDown' : 'CaretRight', className: expandableCaret, onClick: this.toggle }));
46
+ return (react_1.default.createElement(line_with_icon_1.LineWithIcon, { icon: icon }, typeof this.props.children === 'function'
47
+ ? this.props.children(this.state.expanded, this.toggle)
48
+ : this.props.children));
49
+ }
50
+ }
51
+ exports.Expandable = Expandable;
52
+ Expandable.propTypes = {};
53
+ //# sourceMappingURL=expandable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expandable.js","sourceRoot":"","sources":["../../../src/components/utils/expandable.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAyC;AACzC,uEAAqD;AAErD,uEAAsD;AAEtD,qDAAgD;AAEhD,MAAM,eAAe,GAAG,IAAA,wBAAG,EAAC;IAC1B,MAAM,EAAE,SAAS;CAClB,CAAC,CAAC;AAqBH,MAAa,UAAW,SAAQ,iBAA2C;IAA3E;;QAGE,UAAK,GAA8B;YACjC,QAAQ,EAAE,KAAK;SAChB,CAAC;QAEF,WAAM,GAAG,GAAS,EAAE;YAClB,IAAI,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;QACpD,CAAC,CAAC;IAiBJ,CAAC;IAfC,MAAM;QACJ,MAAM,IAAI,GAAG,CAAC,8BAAC,yBAAI,IACjB,IAAI,EAAE,EAAE,EACR,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,EACvD,SAAS,EAAE,eAAe,EAC1B,OAAO,EAAE,IAAI,CAAC,MAAM,GACpB,CAAC,CAAC;QAEJ,OAAO,CAAC,8BAAC,6BAAY,IAAC,IAAI,EAAE,IAAI,IAC7B,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,KAAK,UAAU;YACxC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC;YACvD,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAEV,CAAC,CAAC;IACnB,CAAC;;AAzBH,gCA0BC;AAzBQ,oBAAS,GAAG,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function inspect(value: any): string;
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.inspect = void 0;
4
+ const util_1 = require("util");
5
+ const service_provider_core_1 = require("@mongosh/service-provider-core");
6
+ const customInspect = util_1.inspect.custom || 'inspect';
7
+ const visitedObjects = new WeakSet();
8
+ function tryAddInspect(obj, stringifier) {
9
+ try {
10
+ Object.defineProperty(obj, customInspect, {
11
+ writable: true,
12
+ configurable: true,
13
+ enumerable: false,
14
+ value: function (...args) {
15
+ try {
16
+ return stringifier.call(this, ...args);
17
+ }
18
+ catch (err) {
19
+ console.warn('Could not inspect bson object', { obj: this, err });
20
+ return (0, util_1.inspect)(this, { customInspect: false });
21
+ }
22
+ }
23
+ });
24
+ }
25
+ catch (err) {
26
+ console.warn('Could not add inspect key to object', { obj, err });
27
+ }
28
+ }
29
+ function isDate(value) {
30
+ try {
31
+ Date.prototype.getTime.call(value);
32
+ return true;
33
+ }
34
+ catch (_a) {
35
+ return false;
36
+ }
37
+ }
38
+ function attachInspectMethods(obj) {
39
+ if ((typeof obj !== 'object' && typeof obj !== 'function') || obj === null) {
40
+ return;
41
+ }
42
+ if (visitedObjects.has(obj)) {
43
+ return;
44
+ }
45
+ visitedObjects.add(obj);
46
+ attachInspectMethods(Object.getPrototypeOf(obj));
47
+ const properties = Object.getOwnPropertyDescriptors(obj);
48
+ for (const { value } of Object.values(properties)) {
49
+ attachInspectMethods(value);
50
+ }
51
+ const bsontype = obj._bsontype;
52
+ const stringifier = service_provider_core_1.bsonStringifiers[bsontype];
53
+ if (bsontype &&
54
+ stringifier &&
55
+ !properties[customInspect] &&
56
+ !Object.isSealed(obj)) {
57
+ tryAddInspect(obj, stringifier);
58
+ }
59
+ else if (isDate(obj)) {
60
+ tryAddInspect(obj, function () {
61
+ return this.toISOString();
62
+ });
63
+ }
64
+ }
65
+ function inspect(value) {
66
+ attachInspectMethods(value);
67
+ const stringifiedValue = (0, util_1.inspect)(value, {
68
+ customInspect: true,
69
+ depth: 1000,
70
+ breakLength: 0
71
+ });
72
+ return stringifiedValue;
73
+ }
74
+ exports.inspect = inspect;
75
+ //# sourceMappingURL=inspect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspect.js","sourceRoot":"","sources":["../../../src/components/utils/inspect.ts"],"names":[],"mappings":";;;AAAA,+BAA8C;AAC9C,0EAAkE;AAYlE,MAAM,aAAa,GAAG,cAAW,CAAC,MAAM,IAAI,SAAS,CAAC;AACtD,MAAM,cAAc,GAAG,IAAI,OAAO,EAAE,CAAC;AAErC,SAAS,aAAa,CAAC,GAAQ,EAAE,WAA4D;IAC3F,IAAI;QACF,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,aAAa,EAAE;YACxC,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,IAAI;YAClB,UAAU,EAAE,KAAK;YACjB,KAAK,EAAE,UAAS,GAAG,IAAgB;gBACjC,IAAI;oBACF,OAAO,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;iBACxC;gBAAC,OAAO,GAAQ,EAAE;oBACjB,OAAO,CAAC,IAAI,CAAC,+BAA+B,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;oBAClE,OAAO,IAAA,cAAW,EAAC,IAAI,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,CAAC;iBACpD;YACH,CAAC;SACF,CAAC,CAAC;KACJ;IAAC,OAAO,GAAQ,EAAE;QACjB,OAAO,CAAC,IAAI,CAAC,qCAAqC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;KACnE;AACH,CAAC;AAED,SAAS,MAAM,CAAC,KAAU;IACxB,IAAI;QACF,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnC,OAAO,IAAI,CAAC;KACb;IAAC,WAAM;QACN,OAAO,KAAK,CAAC;KACd;AACH,CAAC;AAED,SAAS,oBAAoB,CAAC,GAAQ;IACpC,IAAI,CAAC,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,GAAG,KAAK,UAAU,CAAC,IAAI,GAAG,KAAK,IAAI,EAAE;QAE1E,OAAO;KACR;IAED,IAAI,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;QAC3B,OAAO;KACR;IACD,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAGxB,oBAAoB,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;IACjD,MAAM,UAAU,GAAG,MAAM,CAAC,yBAAyB,CAAC,GAAG,CAAC,CAAC;IACzD,KAAK,MAAM,EAAE,KAAK,EAAE,IAAI,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE;QACjD,oBAAoB,CAAC,KAAK,CAAC,CAAC;KAC7B;IAGD,MAAM,QAAQ,GAAG,GAAG,CAAC,SAAS,CAAC;IAC/B,MAAM,WAAW,GAAG,wCAAgB,CAAC,QAAQ,CAAC,CAAC;IAC/C,IAAI,QAAQ;QACR,WAAW;QACX,CAAE,UAAkB,CAAC,aAAa,CAAC;QACnC,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QACzB,aAAa,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;KACjC;SAAM,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE;QACtB,aAAa,CAAC,GAAG,EAAE;YACjB,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;QAC5B,CAAC,CAAC,CAAC;KACJ;AACH,CAAC;AAED,SAAgB,OAAO,CAAC,KAAU;IAChC,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAE5B,MAAM,gBAAgB,GAAG,IAAA,cAAW,EAAC,KAAK,EAAE;QAC1C,aAAa,EAAE,IAAI;QACnB,KAAK,EAAE,IAAI;QACX,WAAW,EAAE,CAAC;KACf,CAAC,CAAC;IAEH,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAVD,0BAUC"}
@@ -0,0 +1,14 @@
1
+ import { Component } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ interface LineWithIconProps {
4
+ icon: JSX.Element;
5
+ className?: string;
6
+ }
7
+ export declare class LineWithIcon extends Component<LineWithIconProps> {
8
+ static propTypes: {
9
+ icon: PropTypes.Validator<object>;
10
+ className: PropTypes.Requireable<string>;
11
+ };
12
+ render(): JSX.Element;
13
+ }
14
+ export {};
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.LineWithIcon = void 0;
30
+ const react_1 = __importStar(require("react"));
31
+ const compass_components_1 = require("@mongodb-js/compass-components");
32
+ const prop_types_1 = __importDefault(require("prop-types"));
33
+ const lineWithIcon = (0, compass_components_1.css)({
34
+ display: 'flex',
35
+ flexDirection: 'row'
36
+ });
37
+ const lineWithIconIcon = (0, compass_components_1.css)({
38
+ display: 'flex',
39
+ alignItems: 'center',
40
+ marginRight: '3px',
41
+ maxHeight: '24px',
42
+ });
43
+ const lineWithIconContent = (0, compass_components_1.css)({
44
+ flex: 1,
45
+ overflowX: 'auto'
46
+ });
47
+ class LineWithIcon extends react_1.Component {
48
+ render() {
49
+ return (react_1.default.createElement("div", { className: (0, compass_components_1.cx)(this.props.className, lineWithIcon) },
50
+ react_1.default.createElement("span", { className: lineWithIconIcon }, this.props.icon),
51
+ react_1.default.createElement("div", { className: lineWithIconContent }, this.props.children)));
52
+ }
53
+ }
54
+ exports.LineWithIcon = LineWithIcon;
55
+ LineWithIcon.propTypes = {
56
+ icon: prop_types_1.default.object.isRequired,
57
+ className: prop_types_1.default.string
58
+ };
59
+ //# sourceMappingURL=line-with-icon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"line-with-icon.js","sourceRoot":"","sources":["../../../src/components/utils/line-with-icon.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAyC;AACzC,uEAAyD;AACzD,4DAAmC;AAEnC,MAAM,YAAY,GAAG,IAAA,wBAAG,EAAC;IACvB,OAAO,EAAE,MAAM;IACf,aAAa,EAAE,KAAK;CACrB,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAAG,IAAA,wBAAG,EAAC;IAC3B,OAAO,EAAE,MAAM;IACf,UAAU,EAAE,QAAQ;IACpB,WAAW,EAAE,KAAK;IAClB,SAAS,EAAE,MAAM;CAClB,CAAC,CAAC;AAEH,MAAM,mBAAmB,GAAG,IAAA,wBAAG,EAAC;IAC9B,IAAI,EAAE,CAAC;IACP,SAAS,EAAE,MAAM;CAClB,CAAC,CAAC;AAOH,MAAa,YAAa,SAAQ,iBAA4B;IAM5D,MAAM;QACJ,OAAO,CAAC,uCAAK,SAAS,EAAE,IAAA,uBAAE,EAAC,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,YAAY,CAAC;YAC5D,wCAAM,SAAS,EAAE,gBAAgB,IAC9B,IAAI,CAAC,KAAK,CAAC,IAAI,CACX;YACP,uCAAK,SAAS,EAAE,mBAAmB,IAChC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAChB,CACF,CAAC,CAAC;IACV,CAAC;;AAfH,oCAgBC;AAfQ,sBAAS,GAAG;IACjB,IAAI,EAAE,oBAAS,CAAC,MAAM,CAAC,UAAU;IACjC,SAAS,EAAE,oBAAS,CAAC,MAAM;CAC5B,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { Component } from 'react';
2
+ import PropTypes from 'prop-types';
3
+ interface SyntaxHighlightProps {
4
+ code: string;
5
+ }
6
+ export declare class SyntaxHighlight extends Component<SyntaxHighlightProps> {
7
+ static propTypes: {
8
+ code: PropTypes.Validator<string>;
9
+ };
10
+ render(): JSX.Element;
11
+ }
12
+ export {};
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.SyntaxHighlight = void 0;
30
+ const react_1 = __importStar(require("react"));
31
+ const prop_types_1 = __importDefault(require("prop-types"));
32
+ const compass_components_1 = require("@mongodb-js/compass-components");
33
+ const syntaxHighlight = (0, compass_components_1.css)({
34
+ '& *': {
35
+ background: 'transparent',
36
+ border: '0px transparent',
37
+ padding: 0,
38
+ margin: 0,
39
+ fontSize: 'inherit',
40
+ borderRadius: 0,
41
+ color: 'inherit'
42
+ }
43
+ });
44
+ class SyntaxHighlight extends react_1.Component {
45
+ render() {
46
+ return (react_1.default.createElement(compass_components_1.Code, { language: "javascript", className: syntaxHighlight, copyable: false }, this.props.code));
47
+ }
48
+ }
49
+ exports.SyntaxHighlight = SyntaxHighlight;
50
+ SyntaxHighlight.propTypes = {
51
+ code: prop_types_1.default.string.isRequired
52
+ };
53
+ //# sourceMappingURL=syntax-highlight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"syntax-highlight.js","sourceRoot":"","sources":["../../../src/components/utils/syntax-highlight.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAyC;AACzC,4DAAmC;AACnC,uEAA2D;AAE3D,MAAM,eAAe,GAAG,IAAA,wBAAG,EAAC;IAC1B,KAAK,EAAE;QACL,UAAU,EAAE,aAAa;QACzB,MAAM,EAAE,iBAAiB;QACzB,OAAO,EAAE,CAAC;QACV,MAAM,EAAE,CAAC;QACT,QAAQ,EAAE,SAAS;QACnB,YAAY,EAAE,CAAC;QACf,KAAK,EAAE,SAAS;KACjB;CACF,CAAC,CAAC;AAMH,MAAa,eAAgB,SAAQ,iBAA+B;IAKlE,MAAM;QACJ,OAAO,CACL,8BAAC,yBAAI,IACH,QAAQ,EAAC,YAAY,EACrB,SAAS,EAAE,eAAe,EAC1B,QAAQ,EAAE,KAAK,IACf,IAAI,CAAC,KAAK,CAAC,IAAI,CAAQ,CAC1B,CAAC;IACJ,CAAC;;AAbH,0CAcC;AAbQ,yBAAS,GAAG;IACjB,IAAI,EAAE,oBAAS,CAAC,MAAM,CAAC,UAAU;CAClC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { ContextValue, InterpreterEnvironment } from '@mongosh/browser-runtime-core';
2
+ export declare class IframeInterpreterEnvironment implements InterpreterEnvironment {
3
+ private window;
4
+ constructor(window: Window);
5
+ sloppyEval(code: string): ContextValue;
6
+ getContextObject(): ContextValue;
7
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IframeInterpreterEnvironment = void 0;
4
+ class IframeInterpreterEnvironment {
5
+ constructor(window) {
6
+ this.window = window;
7
+ this.sloppyEval('delete window.prompt');
8
+ }
9
+ sloppyEval(code) {
10
+ return this.window.eval(code);
11
+ }
12
+ getContextObject() {
13
+ return this.window;
14
+ }
15
+ }
16
+ exports.IframeInterpreterEnvironment = IframeInterpreterEnvironment;
17
+ //# sourceMappingURL=iframe-interpreter-environment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iframe-interpreter-environment.js","sourceRoot":"","sources":["../../src/iframe-runtime/iframe-interpreter-environment.ts"],"names":[],"mappings":";;;AAKA,MAAa,4BAA4B;IAGvC,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAGrB,IAAI,CAAC,UAAU,CAAC,sBAAsB,CAAC,CAAC;IAC1C,CAAC;IAED,UAAU,CAAC,IAAY;QACrB,OAAQ,IAAI,CAAC,MAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IAED,gBAAgB;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF;AAjBD,oEAiBC"}
@@ -0,0 +1,17 @@
1
+ import { Runtime, RuntimeEvaluationListener, RuntimeEvaluationResult, Completion, OpenContextRuntime } from '@mongosh/browser-runtime-core';
2
+ import { ServiceProvider } from '@mongosh/service-provider-core';
3
+ export declare class IframeRuntime implements Runtime {
4
+ private openContextRuntime;
5
+ private readyPromise;
6
+ private iframe;
7
+ private container;
8
+ private serviceProvider;
9
+ private evaluationListener;
10
+ constructor(serviceProvider: ServiceProvider);
11
+ setEvaluationListener(listener: RuntimeEvaluationListener): RuntimeEvaluationListener | null;
12
+ evaluate(code: string): Promise<RuntimeEvaluationResult>;
13
+ getCompletions(code: string): Promise<Completion[]>;
14
+ getShellPrompt(): Promise<string>;
15
+ initialize(): Promise<OpenContextRuntime>;
16
+ destroy(): Promise<void>;
17
+ }