@semics-tech/mongolite 1.2.0 → 1.3.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.
Files changed (38) hide show
  1. package/README.md +14 -1
  2. package/dist/bin/mongolite-debug.d.ts +6 -1
  3. package/dist/bin/mongolite-debug.js +6 -113
  4. package/dist/bin/mongolite-debug.js.map +1 -1
  5. package/dist/bin/mongolite.d.ts +13 -0
  6. package/dist/bin/mongolite.js +172 -0
  7. package/dist/bin/mongolite.js.map +1 -0
  8. package/dist/cjs/bin/mongolite-debug.js +6 -149
  9. package/dist/cjs/bin/mongolite.js +207 -0
  10. package/dist/cjs/cli/discover.js +156 -0
  11. package/dist/cjs/cli/explorer.js +929 -0
  12. package/dist/cjs/cli/filter-builder.js +276 -0
  13. package/dist/cjs/cli/format.js +161 -0
  14. package/dist/cjs/cli/schema.js +211 -0
  15. package/dist/cjs/cli/ui.js +431 -0
  16. package/dist/cjs/cursors/findCursor.js +20 -8
  17. package/dist/cli/discover.d.ts +40 -0
  18. package/dist/cli/discover.js +146 -0
  19. package/dist/cli/discover.js.map +1 -0
  20. package/dist/cli/explorer.d.ts +59 -0
  21. package/dist/cli/explorer.js +923 -0
  22. package/dist/cli/explorer.js.map +1 -0
  23. package/dist/cli/filter-builder.d.ts +52 -0
  24. package/dist/cli/filter-builder.js +268 -0
  25. package/dist/cli/filter-builder.js.map +1 -0
  26. package/dist/cli/format.d.ts +29 -0
  27. package/dist/cli/format.js +153 -0
  28. package/dist/cli/format.js.map +1 -0
  29. package/dist/cli/schema.d.ts +58 -0
  30. package/dist/cli/schema.js +205 -0
  31. package/dist/cli/schema.js.map +1 -0
  32. package/dist/cli/ui.d.ts +71 -0
  33. package/dist/cli/ui.js +379 -0
  34. package/dist/cli/ui.js.map +1 -0
  35. package/dist/cursors/findCursor.d.ts +12 -0
  36. package/dist/cursors/findCursor.js +20 -8
  37. package/dist/cursors/findCursor.js.map +1 -1
  38. package/package.json +2 -1
@@ -0,0 +1,59 @@
1
+ export interface ExplorerOptions {
2
+ database?: string;
3
+ collection?: string;
4
+ verbose?: boolean;
5
+ /** How many documents to sample when inferring the schema. Default 200. */
6
+ sampleSize?: number;
7
+ /** Rows shown per page of results. Default 20. */
8
+ pageSize?: number;
9
+ }
10
+ export declare class Explorer {
11
+ private readonly options;
12
+ private client;
13
+ private dbPath;
14
+ private collectionName;
15
+ private schema;
16
+ private lastSql;
17
+ private lastQuery;
18
+ /**
19
+ * `-d`/`-c` are a starting point, not a preference. Once they have been
20
+ * honoured they are forgotten, otherwise "open a different database" would
21
+ * take you straight back to the one on the command line.
22
+ */
23
+ private startingDatabaseUsed;
24
+ private startingCollectionUsed;
25
+ private readonly sampleSize;
26
+ private readonly pageSize;
27
+ constructor(options?: ExplorerOptions);
28
+ run(): Promise<void>;
29
+ private disconnect;
30
+ private chooseDatabase;
31
+ private connect;
32
+ private chooseCollection;
33
+ private useCollection;
34
+ private collectionMenu;
35
+ private guidedFind;
36
+ /** Collect conditions until the user is done. Returns null when cancelled. */
37
+ private buildConditions;
38
+ private buildOneCondition;
39
+ /**
40
+ * Ask for one value. When the field has few distinct values in the sample we
41
+ * offer them as a menu — no typing, no guessing at spelling or casing.
42
+ */
43
+ private askForValue;
44
+ private chooseSort;
45
+ private runQuery;
46
+ private chooseColumns;
47
+ private exportDocuments;
48
+ private countFlow;
49
+ private distinctFlow;
50
+ private groupFlow;
51
+ private pickField;
52
+ private showSchema;
53
+ private showIndexes;
54
+ private jsonFilterFlow;
55
+ private runRawSql;
56
+ private showLastSql;
57
+ private requireClient;
58
+ private collection;
59
+ }