@sfxcode/nuxt-ui-mongocamp 1.3.5 → 1.5.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 (224) hide show
  1. package/README.md +1 -1
  2. package/dist/module.d.mts +8 -0
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +6 -0
  5. package/dist/runtime/components/MongocampAggregationBuilder.d.vue.ts +1 -0
  6. package/dist/runtime/components/MongocampAggregationBuilder.vue +331 -5
  7. package/dist/runtime/components/MongocampAggregationBuilder.vue.d.ts +1 -0
  8. package/dist/runtime/components/MongocampAggregationChart.d.vue.ts +6 -0
  9. package/dist/runtime/components/MongocampAggregationChart.vue +93 -0
  10. package/dist/runtime/components/MongocampAggregationChart.vue.d.ts +6 -0
  11. package/dist/runtime/components/MongocampAggregationStagePreview.d.vue.ts +10 -0
  12. package/dist/runtime/components/MongocampAggregationStagePreview.vue +149 -0
  13. package/dist/runtime/components/MongocampAggregationStagePreview.vue.d.ts +10 -0
  14. package/dist/runtime/components/MongocampBucketFiles.vue +230 -48
  15. package/dist/runtime/components/MongocampBulkDelete.d.vue.ts +9 -0
  16. package/dist/runtime/components/MongocampBulkDelete.vue +94 -25
  17. package/dist/runtime/components/MongocampBulkDelete.vue.d.ts +9 -0
  18. package/dist/runtime/components/MongocampBulkEdit.d.vue.ts +5 -0
  19. package/dist/runtime/components/MongocampBulkEdit.vue +41 -3
  20. package/dist/runtime/components/MongocampBulkEdit.vue.d.ts +5 -0
  21. package/dist/runtime/components/MongocampChart.d.vue.ts +29 -0
  22. package/dist/runtime/components/MongocampChart.vue +129 -0
  23. package/dist/runtime/components/MongocampChart.vue.d.ts +29 -0
  24. package/dist/runtime/components/MongocampCollectionCharts.d.vue.ts +17 -0
  25. package/dist/runtime/components/MongocampCollectionCharts.vue +200 -0
  26. package/dist/runtime/components/MongocampCollectionCharts.vue.d.ts +17 -0
  27. package/dist/runtime/components/MongocampCollectionCopy.d.vue.ts +23 -0
  28. package/dist/runtime/components/MongocampCollectionCopy.vue +206 -0
  29. package/dist/runtime/components/MongocampCollectionCopy.vue.d.ts +23 -0
  30. package/dist/runtime/components/MongocampCollectionData.d.vue.ts +6 -0
  31. package/dist/runtime/components/MongocampCollectionData.vue +423 -138
  32. package/dist/runtime/components/MongocampCollectionData.vue.d.ts +6 -0
  33. package/dist/runtime/components/MongocampCollectionInfos.vue +106 -238
  34. package/dist/runtime/components/MongocampCollectionRename.d.vue.ts +22 -0
  35. package/dist/runtime/components/MongocampCollectionRename.vue +116 -0
  36. package/dist/runtime/components/MongocampCollectionRename.vue.d.ts +22 -0
  37. package/dist/runtime/components/MongocampCollections.vue +93 -12
  38. package/dist/runtime/components/MongocampCommandPalette.d.vue.ts +40 -0
  39. package/dist/runtime/components/MongocampCommandPalette.vue +135 -0
  40. package/dist/runtime/components/MongocampCommandPalette.vue.d.ts +40 -0
  41. package/dist/runtime/components/MongocampConfirmByName.vue +2 -2
  42. package/dist/runtime/components/MongocampDashboard.d.vue.ts +3 -1
  43. package/dist/runtime/components/MongocampDashboard.vue +39 -5
  44. package/dist/runtime/components/MongocampDashboard.vue.d.ts +3 -1
  45. package/dist/runtime/components/MongocampDatabases.vue +35 -2
  46. package/dist/runtime/components/MongocampDocumentCompare.d.vue.ts +20 -0
  47. package/dist/runtime/components/MongocampDocumentCompare.vue +146 -0
  48. package/dist/runtime/components/MongocampDocumentCompare.vue.d.ts +20 -0
  49. package/dist/runtime/components/MongocampDocumentView.d.vue.ts +22 -0
  50. package/dist/runtime/components/MongocampDocumentView.vue +202 -0
  51. package/dist/runtime/components/MongocampDocumentView.vue.d.ts +22 -0
  52. package/dist/runtime/components/MongocampErrorAlert.vue +12 -4
  53. package/dist/runtime/components/MongocampExportAll.d.vue.ts +18 -0
  54. package/dist/runtime/components/MongocampExportAll.vue +191 -0
  55. package/dist/runtime/components/MongocampExportAll.vue.d.ts +18 -0
  56. package/dist/runtime/components/MongocampFilePreview.d.vue.ts +16 -0
  57. package/dist/runtime/components/MongocampFilePreview.vue +162 -0
  58. package/dist/runtime/components/MongocampFilePreview.vue.d.ts +16 -0
  59. package/dist/runtime/components/MongocampFilterBuilder.vue +11 -0
  60. package/dist/runtime/components/MongocampImport.vue +171 -13
  61. package/dist/runtime/components/MongocampIndexes.d.vue.ts +18 -0
  62. package/dist/runtime/components/MongocampIndexes.vue +496 -0
  63. package/dist/runtime/components/MongocampIndexes.vue.d.ts +18 -0
  64. package/dist/runtime/components/MongocampJobs.d.vue.ts +6 -1
  65. package/dist/runtime/components/MongocampJobs.vue +36 -5
  66. package/dist/runtime/components/MongocampJobs.vue.d.ts +6 -1
  67. package/dist/runtime/components/MongocampPermissionMatrix.d.vue.ts +12 -0
  68. package/dist/runtime/components/MongocampPermissionMatrix.vue +301 -0
  69. package/dist/runtime/components/MongocampPermissionMatrix.vue.d.ts +12 -0
  70. package/dist/runtime/components/MongocampQueryBar.d.vue.ts +26 -0
  71. package/dist/runtime/components/MongocampQueryBar.vue +398 -0
  72. package/dist/runtime/components/MongocampQueryBar.vue.d.ts +26 -0
  73. package/dist/runtime/components/MongocampRoleGrants.vue +18 -5
  74. package/dist/runtime/components/MongocampRoles.vue +16 -5
  75. package/dist/runtime/components/MongocampServerOverview.d.vue.ts +20 -0
  76. package/dist/runtime/components/MongocampServerOverview.vue +420 -0
  77. package/dist/runtime/components/MongocampServerOverview.vue.d.ts +20 -0
  78. package/dist/runtime/components/MongocampSettings.d.vue.ts +28 -1
  79. package/dist/runtime/components/MongocampSettings.vue +83 -10
  80. package/dist/runtime/components/MongocampSettings.vue.d.ts +28 -1
  81. package/dist/runtime/components/MongocampUsers.vue +19 -6
  82. package/dist/runtime/composables/useMongocampAdmin.d.ts +2 -1
  83. package/dist/runtime/composables/useMongocampAdmin.js +6 -1
  84. package/dist/runtime/composables/useMongocampAdminGate.d.ts +12 -0
  85. package/dist/runtime/composables/useMongocampAdminGate.js +12 -0
  86. package/dist/runtime/composables/useMongocampAggregation.d.ts +23 -1
  87. package/dist/runtime/composables/useMongocampAggregation.js +41 -26
  88. package/dist/runtime/composables/useMongocampAutoRefresh.d.ts +26 -0
  89. package/dist/runtime/composables/useMongocampAutoRefresh.js +78 -0
  90. package/dist/runtime/composables/useMongocampBucket.d.ts +13 -1
  91. package/dist/runtime/composables/useMongocampBucket.js +34 -0
  92. package/dist/runtime/composables/useMongocampBulkByFilter.d.ts +15 -0
  93. package/dist/runtime/composables/useMongocampBulkByFilter.js +32 -0
  94. package/dist/runtime/composables/useMongocampClientApi.js +2 -1
  95. package/dist/runtime/composables/useMongocampCollectionCopy.d.ts +45 -0
  96. package/dist/runtime/composables/useMongocampCollectionCopy.js +48 -0
  97. package/dist/runtime/composables/useMongocampCollectionStats.d.ts +10 -0
  98. package/dist/runtime/composables/useMongocampCollectionStats.js +17 -0
  99. package/dist/runtime/composables/useMongocampError.d.ts +2 -1
  100. package/dist/runtime/composables/useMongocampError.js +16 -1
  101. package/dist/runtime/composables/useMongocampExportAll.d.ts +53 -0
  102. package/dist/runtime/composables/useMongocampExportAll.js +57 -0
  103. package/dist/runtime/composables/useMongocampExtendedJson.d.ts +7 -2
  104. package/dist/runtime/composables/useMongocampExtendedJson.js +44 -11
  105. package/dist/runtime/composables/useMongocampFetchAll.d.ts +25 -0
  106. package/dist/runtime/composables/useMongocampFetchAll.js +27 -0
  107. package/dist/runtime/composables/useMongocampFieldTypes.d.ts +24 -0
  108. package/dist/runtime/composables/useMongocampFieldTypes.js +44 -0
  109. package/dist/runtime/composables/useMongocampImport.d.ts +4 -0
  110. package/dist/runtime/composables/useMongocampImport.js +5 -2
  111. package/dist/runtime/composables/useMongocampIndex.d.ts +6 -1
  112. package/dist/runtime/composables/useMongocampIndex.js +7 -1
  113. package/dist/runtime/composables/useMongocampPermissions.d.ts +17 -0
  114. package/dist/runtime/composables/useMongocampPermissions.js +43 -0
  115. package/dist/runtime/composables/useMongocampPersistedState.d.ts +15 -0
  116. package/dist/runtime/composables/useMongocampPersistedState.js +21 -0
  117. package/dist/runtime/composables/useMongocampProxyApi.js +2 -1
  118. package/dist/runtime/composables/useMongocampQuery.d.ts +50 -2
  119. package/dist/runtime/composables/useMongocampQuery.js +72 -1
  120. package/dist/runtime/composables/useMongocampSavedPipelines.d.ts +25 -0
  121. package/dist/runtime/composables/useMongocampSavedPipelines.js +23 -0
  122. package/dist/runtime/composables/useMongocampSavedQueries.d.ts +37 -0
  123. package/dist/runtime/composables/useMongocampSavedQueries.js +50 -0
  124. package/dist/runtime/composables/useMongocampServerOverview.d.ts +35 -0
  125. package/dist/runtime/composables/useMongocampServerOverview.js +51 -0
  126. package/dist/runtime/composables/useMongocampSession.d.ts +2 -0
  127. package/dist/runtime/composables/useMongocampSession.js +16 -2
  128. package/dist/runtime/composables/useMongocampSystem.d.ts +7 -2
  129. package/dist/runtime/composables/useMongocampSystem.js +6 -2
  130. package/dist/runtime/locales/de.json +509 -25
  131. package/dist/runtime/locales/en.json +509 -25
  132. package/dist/runtime/plugin.js +6 -3
  133. package/dist/runtime/utils/aggregationErrors.d.ts +4 -0
  134. package/dist/runtime/utils/aggregationErrors.js +7 -0
  135. package/dist/runtime/utils/aggregationPipeline.d.ts +5 -4
  136. package/dist/runtime/utils/aggregationPipeline.js +23 -9
  137. package/dist/runtime/utils/aggregationPreview.d.ts +13 -0
  138. package/dist/runtime/utils/aggregationPreview.js +10 -0
  139. package/dist/runtime/utils/aggregationResult.d.ts +5 -0
  140. package/dist/runtime/utils/aggregationResult.js +4 -0
  141. package/dist/runtime/utils/aggregationTemplates.d.ts +34 -0
  142. package/dist/runtime/utils/aggregationTemplates.js +47 -0
  143. package/dist/runtime/utils/analyzeSamples.d.ts +1 -0
  144. package/dist/runtime/utils/analyzeSamples.js +1 -1
  145. package/dist/runtime/utils/autoRefresh.d.ts +14 -0
  146. package/dist/runtime/utils/autoRefresh.js +15 -0
  147. package/dist/runtime/utils/batchInsert.d.ts +6 -0
  148. package/dist/runtime/utils/batchInsert.js +31 -3
  149. package/dist/runtime/utils/bigIntJson.d.ts +15 -0
  150. package/dist/runtime/utils/bigIntJson.js +55 -0
  151. package/dist/runtime/utils/bsonTypes.d.ts +10 -0
  152. package/dist/runtime/utils/bsonTypes.js +42 -0
  153. package/dist/runtime/utils/bulkDelete.d.ts +9 -1
  154. package/dist/runtime/utils/bulkDelete.js +15 -3
  155. package/dist/runtime/utils/bulkEdit.d.ts +6 -0
  156. package/dist/runtime/utils/bulkEdit.js +7 -0
  157. package/dist/runtime/utils/chartData.d.ts +11 -0
  158. package/dist/runtime/utils/chartData.js +9 -0
  159. package/dist/runtime/utils/collectionChart.d.ts +36 -0
  160. package/dist/runtime/utils/collectionChart.js +73 -0
  161. package/dist/runtime/utils/collectionCopy.d.ts +24 -0
  162. package/dist/runtime/utils/collectionCopy.js +37 -0
  163. package/dist/runtime/utils/collectionStats.d.ts +31 -0
  164. package/dist/runtime/utils/collectionStats.js +42 -0
  165. package/dist/runtime/utils/commandPalette.d.ts +48 -0
  166. package/dist/runtime/utils/commandPalette.js +39 -0
  167. package/dist/runtime/utils/configRows.d.ts +7 -0
  168. package/dist/runtime/utils/configRows.js +4 -0
  169. package/dist/runtime/utils/documentCompare.d.ts +31 -0
  170. package/dist/runtime/utils/documentCompare.js +71 -0
  171. package/dist/runtime/utils/documentDiff.d.ts +19 -0
  172. package/dist/runtime/utils/documentDiff.js +71 -0
  173. package/dist/runtime/utils/documentPaths.d.ts +41 -0
  174. package/dist/runtime/utils/documentPaths.js +139 -0
  175. package/dist/runtime/utils/documentTree.d.ts +40 -0
  176. package/dist/runtime/utils/documentTree.js +102 -0
  177. package/dist/runtime/utils/exportDocuments.d.ts +33 -0
  178. package/dist/runtime/utils/exportDocuments.js +53 -0
  179. package/dist/runtime/utils/exportRows.d.ts +2 -0
  180. package/dist/runtime/utils/exportRows.js +6 -3
  181. package/dist/runtime/utils/fieldDetails.d.ts +51 -0
  182. package/dist/runtime/utils/fieldDetails.js +113 -0
  183. package/dist/runtime/utils/filePreview.d.ts +27 -0
  184. package/dist/runtime/utils/filePreview.js +50 -0
  185. package/dist/runtime/utils/filterBuilder.d.ts +6 -1
  186. package/dist/runtime/utils/filterBuilder.js +6 -5
  187. package/dist/runtime/utils/formatBytes.d.ts +2 -0
  188. package/dist/runtime/utils/formatBytes.js +11 -0
  189. package/dist/runtime/utils/grantMatching.d.ts +8 -0
  190. package/dist/runtime/utils/grantMatching.js +15 -0
  191. package/dist/runtime/utils/importRows.js +12 -2
  192. package/dist/runtime/utils/indexForm.d.ts +83 -0
  193. package/dist/runtime/utils/indexForm.js +74 -0
  194. package/dist/runtime/utils/luceneExpression.d.ts +15 -0
  195. package/dist/runtime/utils/luceneExpression.js +74 -0
  196. package/dist/runtime/utils/pagedFetch.d.ts +46 -0
  197. package/dist/runtime/utils/pagedFetch.js +58 -0
  198. package/dist/runtime/utils/paginationHeaders.d.ts +4 -0
  199. package/dist/runtime/utils/paginationHeaders.js +4 -0
  200. package/dist/runtime/utils/permissionDenied.d.ts +10 -0
  201. package/dist/runtime/utils/permissionDenied.js +23 -0
  202. package/dist/runtime/utils/permissionMatrix.d.ts +55 -0
  203. package/dist/runtime/utils/permissionMatrix.js +85 -0
  204. package/dist/runtime/utils/persistedState.d.ts +25 -0
  205. package/dist/runtime/utils/persistedState.js +47 -0
  206. package/dist/runtime/utils/queryState.d.ts +45 -0
  207. package/dist/runtime/utils/queryState.js +75 -0
  208. package/dist/runtime/utils/requestLimits.d.ts +2 -0
  209. package/dist/runtime/utils/requestLimits.js +4 -0
  210. package/dist/runtime/utils/resultChart.d.ts +32 -0
  211. package/dist/runtime/utils/resultChart.js +59 -0
  212. package/dist/runtime/utils/savedPipelines.d.ts +22 -0
  213. package/dist/runtime/utils/savedPipelines.js +46 -0
  214. package/dist/runtime/utils/savedQueries.d.ts +60 -0
  215. package/dist/runtime/utils/savedQueries.js +143 -0
  216. package/dist/runtime/utils/schemaAnalysis.d.ts +16 -0
  217. package/dist/runtime/utils/schemaAnalysis.js +57 -0
  218. package/dist/runtime/utils/serverError.d.ts +19 -0
  219. package/dist/runtime/utils/serverError.js +19 -0
  220. package/dist/runtime/utils/serverOverview.d.ts +47 -0
  221. package/dist/runtime/utils/serverOverview.js +40 -0
  222. package/dist/runtime/utils/sessionGuard.d.ts +3 -0
  223. package/dist/runtime/utils/sessionGuard.js +18 -1
  224. package/package.json +15 -14
@@ -0,0 +1,139 @@
1
+ const DEFAULT_MAX_DEPTH = 32;
2
+ const DEFAULT_MAX_ENTRIES = 1e4;
3
+ const FORBIDDEN_SEGMENTS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
4
+ function isPlainObject(value) {
5
+ return typeof value === "object" && value !== null && !Array.isArray(value) && !(value instanceof Date);
6
+ }
7
+ const WRAPPER_TYPES = {
8
+ $oid: "objectId",
9
+ $date: "date",
10
+ $numberLong: "long",
11
+ $numberInt: "int",
12
+ $numberDouble: "double",
13
+ $numberDecimal: "decimal",
14
+ // text that looks like a date, marked as text by the server in a typed read
15
+ $string: "string"
16
+ };
17
+ function wrapperType(value) {
18
+ const keys = Object.keys(value);
19
+ return keys.length === 1 ? WRAPPER_TYPES[keys[0]] : void 0;
20
+ }
21
+ export function typeOf(value) {
22
+ if (value === null || value === void 0) return "null";
23
+ if (Array.isArray(value)) return "array";
24
+ if (value instanceof Date) return "date";
25
+ switch (typeof value) {
26
+ case "string":
27
+ return "string";
28
+ case "boolean":
29
+ return "boolean";
30
+ case "number":
31
+ return "number";
32
+ case "bigint":
33
+ return "long";
34
+ case "object":
35
+ return wrapperType(value) ?? "object";
36
+ default:
37
+ return "string";
38
+ }
39
+ }
40
+ function escapeSegment(key) {
41
+ return key.replace(/[\\.]/g, (m) => `\\${m}`);
42
+ }
43
+ export function splitPath(path) {
44
+ if (path === "") return [];
45
+ const segments = [];
46
+ let current = "";
47
+ for (let i = 0; i < path.length; i++) {
48
+ const char = path[i];
49
+ if (char === "\\" && i + 1 < path.length) {
50
+ current += path[++i];
51
+ } else if (char === ".") {
52
+ segments.push(current);
53
+ current = "";
54
+ } else {
55
+ current += char;
56
+ }
57
+ }
58
+ segments.push(current);
59
+ return segments;
60
+ }
61
+ export function joinPath(segments) {
62
+ return segments.map((s) => escapeSegment(String(s))).join(".");
63
+ }
64
+ export function flattenDocument(doc, options = {}) {
65
+ const maxDepth = options.maxDepth ?? DEFAULT_MAX_DEPTH;
66
+ const maxEntries = options.maxEntries ?? DEFAULT_MAX_ENTRIES;
67
+ const entries = [];
68
+ let truncated = false;
69
+ const visit = (value, segments, depth) => {
70
+ if (truncated) return;
71
+ const type = typeOf(value);
72
+ const container = type === "object" || type === "array";
73
+ const children = container ? Array.isArray(value) ? value.map((v, i) => [String(i), v]) : Object.entries(value) : [];
74
+ if (!container || children.length === 0 || depth >= maxDepth) {
75
+ if (entries.length >= maxEntries) {
76
+ truncated = true;
77
+ return;
78
+ }
79
+ entries.push({ path: joinPath(segments), type, value });
80
+ return;
81
+ }
82
+ for (const [key, child] of children) {
83
+ visit(child, [...segments, key], depth + 1);
84
+ if (truncated) return;
85
+ }
86
+ };
87
+ visit(doc, [], 0);
88
+ return { entries, truncated };
89
+ }
90
+ function childOf(container, segment) {
91
+ if (Array.isArray(container)) {
92
+ if (!/^(?:0|[1-9]\d*)$/.test(segment)) return { found: false };
93
+ const index = Number(segment);
94
+ return index < container.length ? { found: true, value: container[index] } : { found: false };
95
+ }
96
+ if (isPlainObject(container) && Object.hasOwn(container, segment) && !FORBIDDEN_SEGMENTS.has(segment)) {
97
+ return { found: true, value: container[segment] };
98
+ }
99
+ return { found: false };
100
+ }
101
+ export function getPath(doc, path) {
102
+ let current = doc;
103
+ for (const segment of splitPath(path)) {
104
+ const next = childOf(current, segment);
105
+ if (!next.found) return void 0;
106
+ current = next.value;
107
+ }
108
+ return current;
109
+ }
110
+ export function hasPath(doc, path) {
111
+ let current = doc;
112
+ for (const segment of splitPath(path)) {
113
+ const next = childOf(current, segment);
114
+ if (!next.found) return false;
115
+ current = next.value;
116
+ }
117
+ return true;
118
+ }
119
+ function setIn(container, segments, value) {
120
+ const [segment, ...rest] = segments;
121
+ if (segment === void 0) return value;
122
+ if (FORBIDDEN_SEGMENTS.has(segment)) throw new TypeError(`Refusing to set a path through "${segment}"`);
123
+ if (Array.isArray(container)) {
124
+ if (!/^(?:0|[1-9]\d*)$/.test(segment)) throw new TypeError(`"${segment}" is not an array index`);
125
+ const index = Number(segment);
126
+ if (index > container.length) throw new RangeError(`Index ${index} is beyond the end of an array of ${container.length}`);
127
+ const copy = [...container];
128
+ copy[index] = setIn(index < container.length ? container[index] : void 0, rest, value);
129
+ return copy;
130
+ }
131
+ const base = isPlainObject(container) ? container : {};
132
+ const own = Object.hasOwn(base, segment) ? base[segment] : void 0;
133
+ return { ...base, [segment]: setIn(own, rest, value) };
134
+ }
135
+ export function setPath(doc, path, value) {
136
+ const segments = splitPath(path);
137
+ if (segments.length === 0) throw new TypeError("A path is needed");
138
+ return setIn(doc, segments, value);
139
+ }
@@ -0,0 +1,40 @@
1
+ import type { PathValueType } from './documentPaths.js';
2
+ export interface TreeNode {
3
+ /** The key (an array index for an array element). */
4
+ key: string;
5
+ /** Dotted path, as `getPath` reads it. */
6
+ path: string;
7
+ depth: number;
8
+ type: PathValueType;
9
+ value: unknown;
10
+ /** `null` for a leaf (a scalar, a wrapper, or an empty container shown as `[]` / `{}`). */
11
+ children: TreeNode[] | null;
12
+ }
13
+ export interface DocumentTree {
14
+ nodes: TreeNode[];
15
+ /** Nodes built (leaves and containers). */
16
+ total: number;
17
+ /** The document was larger than `maxNodes`; the rest is not in the tree. */
18
+ truncated: boolean;
19
+ }
20
+ export declare const DEFAULT_MAX_NODES = 5000;
21
+ export declare const MAX_TREE_DEPTH = 32;
22
+ /** More nodes than this start fully collapsed; fewer open the first two levels. */
23
+ export declare const COLLAPSE_ABOVE_NODES = 200;
24
+ export declare const AUTO_EXPAND_DEPTH = 2;
25
+ export declare function buildDocumentTree(doc: unknown, options?: {
26
+ maxNodes?: number;
27
+ }): DocumentTree;
28
+ /** Paths of the containers that start open: depth 0 and 1 for a small document, none for a large one. */
29
+ export declare function defaultExpanded(tree: DocumentTree): Set<string>;
30
+ export declare function allContainerPaths(tree: DocumentTree): Set<string>;
31
+ /** The nodes to draw, in order: a node's children follow it only while its path is in `expanded`. */
32
+ export declare function visibleNodes(tree: DocumentTree, expanded: ReadonlySet<string>): TreeNode[];
33
+ /**
34
+ * The text for a node. A wrapper shows its content (`{ $oid }` → the id, `{ $numberLong }` → every digit), a container
35
+ * its size (`[3]`, `{2}`), an empty one `[]` / `{}`. `title` is a longer form where there is one (a date, localised).
36
+ */
37
+ export declare function nodeDisplay(node: TreeNode): {
38
+ text: string;
39
+ title?: string;
40
+ };
@@ -0,0 +1,102 @@
1
+ import { joinPath, typeOf } from "./documentPaths.js";
2
+ export const DEFAULT_MAX_NODES = 5e3;
3
+ export const MAX_TREE_DEPTH = 32;
4
+ export const COLLAPSE_ABOVE_NODES = 200;
5
+ export const AUTO_EXPAND_DEPTH = 2;
6
+ function entriesOf(value) {
7
+ if (Array.isArray(value)) return value.map((v, i) => [String(i), v]);
8
+ return Object.entries(value);
9
+ }
10
+ export function buildDocumentTree(doc, options = {}) {
11
+ const maxNodes = options.maxNodes ?? DEFAULT_MAX_NODES;
12
+ let total = 0;
13
+ let truncated = false;
14
+ const build = (key, value, segments, depth) => {
15
+ if (total >= maxNodes) {
16
+ truncated = true;
17
+ return void 0;
18
+ }
19
+ total++;
20
+ const type = typeOf(value);
21
+ const node = { key, path: joinPath(segments), depth, type, value, children: null };
22
+ const container = (type === "object" || type === "array") && depth < MAX_TREE_DEPTH;
23
+ const entries = container ? entriesOf(value) : [];
24
+ if (entries.length === 0) return node;
25
+ node.children = [];
26
+ for (const [childKey, child] of entries) {
27
+ const built = build(childKey, child, [...segments, childKey], depth + 1);
28
+ if (built) node.children.push(built);
29
+ }
30
+ return node;
31
+ };
32
+ const top = [];
33
+ const root = typeOf(doc) === "object" ? entriesOf(doc) : [["", doc]];
34
+ for (const [key, value] of root) {
35
+ const node = build(key, value, [key], 0);
36
+ if (node) top.push(node);
37
+ }
38
+ return { nodes: top, total, truncated };
39
+ }
40
+ export function defaultExpanded(tree) {
41
+ const open = /* @__PURE__ */ new Set();
42
+ if (tree.total > COLLAPSE_ABOVE_NODES) return open;
43
+ const walk = (nodes) => {
44
+ for (const node of nodes) {
45
+ if (node.children && node.depth < AUTO_EXPAND_DEPTH - 1) {
46
+ open.add(node.path);
47
+ walk(node.children);
48
+ }
49
+ }
50
+ };
51
+ walk(tree.nodes);
52
+ return open;
53
+ }
54
+ export function allContainerPaths(tree) {
55
+ const open = /* @__PURE__ */ new Set();
56
+ const walk = (nodes) => {
57
+ for (const node of nodes) {
58
+ if (node.children) {
59
+ open.add(node.path);
60
+ walk(node.children);
61
+ }
62
+ }
63
+ };
64
+ walk(tree.nodes);
65
+ return open;
66
+ }
67
+ export function visibleNodes(tree, expanded) {
68
+ const out = [];
69
+ const walk = (nodes) => {
70
+ for (const node of nodes) {
71
+ out.push(node);
72
+ if (node.children && expanded.has(node.path)) walk(node.children);
73
+ }
74
+ };
75
+ walk(tree.nodes);
76
+ return out;
77
+ }
78
+ function canonicalDateToIso(raw) {
79
+ const ms = typeof raw === "object" && raw !== null ? raw.$numberLong : void 0;
80
+ if (typeof ms === "string" && /^-?\d+$/.test(ms)) {
81
+ const date = new Date(Number(ms));
82
+ if (!Number.isNaN(date.getTime())) return date.toISOString();
83
+ }
84
+ return raw;
85
+ }
86
+ export function nodeDisplay(node) {
87
+ const { value, type } = node;
88
+ if (type === "null") return { text: "null" };
89
+ if (type === "array") return { text: `[${value.length}]` };
90
+ if (type === "object") return { text: `{${Object.keys(value).length}}` };
91
+ if (type === "date") {
92
+ const raw = value instanceof Date ? value.toISOString() : canonicalDateToIso(value.$date);
93
+ const text = typeof raw === "string" ? raw : JSON.stringify(raw);
94
+ const parsed = typeof raw === "string" ? new Date(raw) : void 0;
95
+ return parsed && !Number.isNaN(parsed.getTime()) ? { text, title: parsed.toLocaleString() } : { text };
96
+ }
97
+ if (typeof value === "object" && value !== null) {
98
+ const inner = Object.values(value)[0];
99
+ return { text: typeof inner === "string" ? inner : JSON.stringify(inner) };
100
+ }
101
+ return { text: String(value) };
102
+ }
@@ -0,0 +1,33 @@
1
+ export type ExportFormat = 'json' | 'ndjson' | 'csv';
2
+ export declare const EXPORT_MIME_TYPES: Record<ExportFormat, string>;
3
+ /**
4
+ * One document as it is written to a file: extended-JSON wrappers become plain values (`$oid` → text, `$date` → ISO text,
5
+ * `$numberInt` → number), and an integer beyond 2^53 is kept exact as a BigInt (a bare number in JSON, digits in CSV).
6
+ * A `$numberDecimal` becomes a JS number, like in the table (rounded past ~15 significant digits).
7
+ */
8
+ export declare function toExportRow(row: Record<string, unknown>): Record<string, unknown>;
9
+ /**
10
+ * Any value of a document (the whole document, a nested object, an array or a scalar) as JSON text the way an export
11
+ * writes it: wrappers become plain values and an integer beyond 2^53 stays exact as a bare number.
12
+ */
13
+ export declare function valueToJson(value: unknown, pretty?: boolean): string;
14
+ /**
15
+ * The columns of a CSV export: the keys of **all** rows in order of first appearance (a later row with a new key is not
16
+ * lost), `_id` first. Nested objects and arrays become one cell of JSON text.
17
+ */
18
+ export declare function exportColumns(rows: Record<string, unknown>[]): string[];
19
+ export interface FormatOptions {
20
+ /** `json` only: 2-space indentation instead of one document per line. */
21
+ pretty?: boolean;
22
+ /** `csv` only: the columns, in this order (default: `exportColumns`). */
23
+ columns?: string[];
24
+ }
25
+ /**
26
+ * The text of an export file for rows already passed through `toExportRow`.
27
+ * - `json`: an array, one document per line (`pretty: true`: indented);
28
+ * - `ndjson`: one compact document per line (what `mongoimport` and most tools read);
29
+ * - `csv`: a header row and one row per document, RFC 4180 quoting, `\r\n` line ends.
30
+ */
31
+ export declare function formatDocuments(rows: Record<string, unknown>[], format: ExportFormat, options?: FormatOptions): string;
32
+ /** `customers-20241231-2359.csv`: the collection name made safe for a file name, a local timestamp and the extension. */
33
+ export declare function exportFilename(collectionName: string, format: ExportFormat, now?: Date): string;
@@ -0,0 +1,53 @@
1
+ import { unwrapExtendedJson } from "../composables/useMongocampExtendedJson.js";
2
+ import { rowsToCsv } from "./exportRows.js";
3
+ export const EXPORT_MIME_TYPES = {
4
+ json: "application/json",
5
+ ndjson: "application/x-ndjson",
6
+ csv: "text/csv"
7
+ };
8
+ const INTEGER_TEXT = /^-?\d+$/;
9
+ function longsToBigInt(value) {
10
+ if (Array.isArray(value)) return value.map(longsToBigInt);
11
+ if (typeof value !== "object" || value === null) return value;
12
+ const entries = Object.entries(value);
13
+ const only = entries.length === 1 ? entries[0] : void 0;
14
+ if (only && only[0] === "$numberLong" && typeof only[1] === "string" && INTEGER_TEXT.test(only[1]) && !Number.isSafeInteger(Number(only[1]))) {
15
+ return BigInt(only[1]);
16
+ }
17
+ return Object.fromEntries(entries.map(([key, inner]) => [key, longsToBigInt(inner)]));
18
+ }
19
+ export function toExportRow(row) {
20
+ return unwrapExtendedJson(longsToBigInt(row));
21
+ }
22
+ function jsonText(value, space) {
23
+ const token = `\0LONG${Math.random().toString(36).slice(2)}:`;
24
+ const text = JSON.stringify(value, (_key, inner) => typeof inner === "bigint" ? `${token}${inner}` : inner, space);
25
+ return text.replaceAll(new RegExp(`"\\\\u0000${token.slice(1)}(-?\\d+)"`, "g"), "$1");
26
+ }
27
+ export function valueToJson(value, pretty = true) {
28
+ return jsonText(unwrapExtendedJson(longsToBigInt(value)), pretty ? 2 : void 0);
29
+ }
30
+ export function exportColumns(rows) {
31
+ const keys = /* @__PURE__ */ new Set();
32
+ for (const row of rows) for (const key of Object.keys(row)) keys.add(key);
33
+ return keys.has("_id") ? ["_id", ...[...keys].filter((key) => key !== "_id")] : [...keys];
34
+ }
35
+ export function formatDocuments(rows, format, options = {}) {
36
+ if (format === "ndjson") return rows.length === 0 ? "" : `${rows.map((row) => jsonText(row)).join("\n")}
37
+ `;
38
+ if (format === "csv") {
39
+ const columns = options.columns ?? exportColumns(rows);
40
+ return columns.length === 0 ? "" : rowsToCsv(rows, columns);
41
+ }
42
+ if (options.pretty) return jsonText(rows, 2);
43
+ return rows.length === 0 ? "[]\n" : `[
44
+ ${rows.map((row) => ` ${jsonText(row)}`).join(",\n")}
45
+ ]
46
+ `;
47
+ }
48
+ export function exportFilename(collectionName, format, now = /* @__PURE__ */ new Date()) {
49
+ const pad = (n) => String(n).padStart(2, "0");
50
+ const stamp = `${now.getFullYear()}${pad(now.getMonth() + 1)}${pad(now.getDate())}-${pad(now.getHours())}${pad(now.getMinutes())}`;
51
+ const safe = collectionName.replace(/[^\w.-]+/g, "_") || "export";
52
+ return `${safe}-${stamp}.${format}`;
53
+ }
@@ -1,2 +1,4 @@
1
1
  export declare function rowsToCsv(rows: Record<string, unknown>[], keys: string[]): string;
2
+ /** Hands a Blob to the browser as a download. */
3
+ export declare function downloadBlob(filename: string, blob: Blob): void;
2
4
  export declare function downloadTextFile(filename: string, content: string, mimeType: string): void;
@@ -1,6 +1,6 @@
1
1
  function csvCell(value) {
2
2
  if (value === null || value === void 0) return "";
3
- const text = typeof value === "object" ? JSON.stringify(value) : String(value);
3
+ const text = typeof value === "object" ? JSON.stringify(value, (_key, inner) => typeof inner === "bigint" ? inner.toString() : inner) : String(value);
4
4
  return /[",\r\n]/.test(text) ? `"${text.replace(/"/g, '""')}"` : text;
5
5
  }
6
6
  export function rowsToCsv(rows, keys) {
@@ -8,11 +8,14 @@ export function rowsToCsv(rows, keys) {
8
8
  for (const row of rows) lines.push(keys.map((key) => csvCell(row[key])).join(","));
9
9
  return lines.join("\r\n");
10
10
  }
11
- export function downloadTextFile(filename, content, mimeType) {
12
- const url = URL.createObjectURL(new Blob([content], { type: `${mimeType};charset=utf-8` }));
11
+ export function downloadBlob(filename, blob) {
12
+ const url = URL.createObjectURL(blob);
13
13
  const link = document.createElement("a");
14
14
  link.href = url;
15
15
  link.download = filename;
16
16
  link.click();
17
17
  URL.revokeObjectURL(url);
18
18
  }
19
+ export function downloadTextFile(filename, content, mimeType) {
20
+ downloadBlob(filename, new Blob([content], { type: `${mimeType};charset=utf-8` }));
21
+ }
@@ -0,0 +1,51 @@
1
+ import type { ValueKind } from './analyzeSamples.js';
2
+ import type { BsonType, TypeHints } from './bsonTypes.js';
3
+ import type { FilterFieldType } from './filterBuilder.js';
4
+ import type { ImportColumnType } from './importRows.js';
5
+ export interface FieldDetail {
6
+ path: string;
7
+ types?: Array<{
8
+ type: string;
9
+ count: number;
10
+ }>;
11
+ }
12
+ /**
13
+ * The value kind a `$type` name stands for: the numeric types are `number`, `bool` is `boolean`, an `objectId` is shown as
14
+ * text (its values are hex ids), `null` stays `null`. Anything else (`binData`, `regex`, `timestamp`, …) has no chart or
15
+ * filter of its own and gives `undefined`.
16
+ */
17
+ export declare function valueKindOfType(type: string): ValueKind | undefined;
18
+ /**
19
+ * The most frequent kind of one field, ignoring `null` and types without a kind (several `$type` names of one kind add up —
20
+ * `int` and `long` are both numbers). `undefined` for a field the sample did not contain or that only held nulls.
21
+ */
22
+ export declare function dominantKindOfField(details: readonly FieldDetail[], path: string): ValueKind | undefined;
23
+ /** The paths a pipeline stage can name, sorted: the elements of arrays (`tags[]`) are not a path one can type. */
24
+ export declare function fieldPathsOf(details: readonly FieldDetail[]): string[];
25
+ /** What one path of a collection holds, from the server's sample. */
26
+ export interface FieldTypeInfo {
27
+ path: string;
28
+ /** The scalar BSON types found (never `null`), most frequent first; empty for a path that only holds objects/arrays/nulls. */
29
+ types: BsonType[];
30
+ /** The most frequent scalar type. */
31
+ dominant?: BsonType;
32
+ /** `object` / `array` when the path holds containers (a field that is only that has no `types`). */
33
+ container?: 'object' | 'array';
34
+ /** More than one kind of value (text and numbers, say). Several numeric types alone (`int` + `long`) are not "mixed". */
35
+ mixed: boolean;
36
+ /** The path of an array's element (`tags[]`): typed, but not a field one can select or filter on. */
37
+ element: boolean;
38
+ }
39
+ /** The BSON type of a MongoDB `$type` name; `undefined` for object, array and the types without an editor (`binData`, `regex`, …). */
40
+ export declare function bsonOfType(typeName: string): BsonType | undefined;
41
+ /** `fields/detail` as one `FieldTypeInfo` per path, in the server's order. Never throws; a malformed entry is skipped. */
42
+ export declare function toFieldTypeInfos(details: readonly FieldDetail[]): FieldTypeInfo[];
43
+ /** The filter builder's field type of a field, or `undefined` when it has no editor (only nulls, binary data, …). */
44
+ export declare function filterTypeOf(info: FieldTypeInfo): FilterFieldType | undefined;
45
+ /** The import/bulk-edit column type of a field (`json` for containers, `string` when unknown). */
46
+ export declare function columnTypeOf(info: FieldTypeInfo): ImportColumnType;
47
+ /**
48
+ * Write hints for typing a value without an original document: a scalar path with exactly **one** type found. A path with
49
+ * several types (`int` + `long`, or text + numbers) is left unhinted so the server decides as it would for plain JSON.
50
+ */
51
+ export declare function toTypeHints(infos: readonly FieldTypeInfo[]): TypeHints;
@@ -0,0 +1,113 @@
1
+ export function valueKindOfType(type) {
2
+ switch (type) {
3
+ case "string":
4
+ case "objectId":
5
+ return "string";
6
+ case "int":
7
+ case "long":
8
+ case "double":
9
+ case "decimal":
10
+ return "number";
11
+ case "bool":
12
+ return "boolean";
13
+ case "date":
14
+ return "date";
15
+ case "object":
16
+ return "object";
17
+ case "array":
18
+ return "array";
19
+ case "null":
20
+ return "null";
21
+ default:
22
+ return void 0;
23
+ }
24
+ }
25
+ export function dominantKindOfField(details, path) {
26
+ const counts = /* @__PURE__ */ new Map();
27
+ for (const { type, count } of details.find((d) => d.path === path)?.types ?? []) {
28
+ const kind = valueKindOfType(type);
29
+ if (kind && kind !== "null") counts.set(kind, (counts.get(kind) ?? 0) + count);
30
+ }
31
+ return [...counts.entries()].sort((a, b) => b[1] - a[1])[0]?.[0];
32
+ }
33
+ export function fieldPathsOf(details) {
34
+ return [...new Set(details.map((d) => d.path).filter((path) => path !== "" && !path.includes("[")))].sort((a, b) => a.localeCompare(b));
35
+ }
36
+ const BSON_OF_TYPE = {
37
+ string: "string",
38
+ int: "int",
39
+ long: "long",
40
+ double: "double",
41
+ decimal: "decimal",
42
+ bool: "bool",
43
+ date: "date",
44
+ objectId: "objectId",
45
+ null: "null"
46
+ };
47
+ const NUMERIC = ["int", "long", "double", "decimal"];
48
+ const familyOf = (type) => NUMERIC.includes(type) ? "number" : type;
49
+ export function bsonOfType(typeName) {
50
+ return Object.hasOwn(BSON_OF_TYPE, typeName) ? BSON_OF_TYPE[typeName] : void 0;
51
+ }
52
+ export function toFieldTypeInfos(details) {
53
+ const out = [];
54
+ for (const detail of details) {
55
+ if (!detail || typeof detail.path !== "string" || detail.path === "") continue;
56
+ const counts = /* @__PURE__ */ new Map();
57
+ let container;
58
+ for (const { type, count } of detail.types ?? []) {
59
+ if (type === "object" || type === "array") {
60
+ container ??= type;
61
+ continue;
62
+ }
63
+ const bson = bsonOfType(type);
64
+ if (bson && bson !== "null") counts.set(bson, (counts.get(bson) ?? 0) + (Number.isFinite(count) ? count : 0));
65
+ }
66
+ const types = [...counts.entries()].sort((a, b) => b[1] - a[1]).map(([type]) => type);
67
+ out.push({
68
+ path: detail.path,
69
+ types,
70
+ dominant: types[0],
71
+ container,
72
+ mixed: new Set(types.map(familyOf)).size > 1,
73
+ element: detail.path.includes("[")
74
+ });
75
+ }
76
+ return out;
77
+ }
78
+ export function filterTypeOf(info) {
79
+ if (info.path === "_id") return "objectId";
80
+ if (info.dominant === void 0) return info.container;
81
+ switch (familyOf(info.dominant)) {
82
+ case "number":
83
+ return "number";
84
+ case "string":
85
+ return "string";
86
+ case "bool":
87
+ return "boolean";
88
+ case "date":
89
+ return "date-time";
90
+ case "objectId":
91
+ return "objectId";
92
+ default:
93
+ return void 0;
94
+ }
95
+ }
96
+ export function columnTypeOf(info) {
97
+ if (info.dominant === void 0) return info.container ? "json" : "string";
98
+ switch (familyOf(info.dominant)) {
99
+ case "number":
100
+ return "number";
101
+ case "bool":
102
+ return "boolean";
103
+ case "date":
104
+ return "date-time";
105
+ default:
106
+ return "string";
107
+ }
108
+ }
109
+ export function toTypeHints(infos) {
110
+ const hints = {};
111
+ for (const info of infos) if (info.types.length === 1 && info.container === void 0) hints[info.path] = info.types[0];
112
+ return hints;
113
+ }
@@ -0,0 +1,27 @@
1
+ export type PreviewKind = 'image' | 'json' | 'csv' | 'text' | 'pdf' | 'other';
2
+ /** Largest file loaded for an in-page preview, per kind (bytes). Larger files only offer metadata + download. */
3
+ export declare const PREVIEW_LIMITS: Record<Exclude<PreviewKind, 'other'>, number>;
4
+ /** Characters of text shown at most (a 1 MB file is still cut so the page stays responsive). */
5
+ export declare const MAX_PREVIEW_CHARS = 200000;
6
+ /**
7
+ * What a file is, from its name first (the server stores no content type) and the blob's own type second.
8
+ * SVG is deliberately `other`: it can carry script, so it is never rendered inline.
9
+ */
10
+ export declare function previewKind(filename: string, blobType?: string): PreviewKind;
11
+ /** Whether a file of this kind and size may be loaded for preview. */
12
+ export declare function canPreview(kind: PreviewKind, length: number): boolean;
13
+ /** Pretty-prints JSON text; anything that is not valid JSON (e.g. NDJSON) comes back unchanged. */
14
+ export declare function prettyJson(text: string): string;
15
+ export declare function clipText(text: string, max?: number): {
16
+ text: string;
17
+ clipped: boolean;
18
+ };
19
+ export type MetadataParse = {
20
+ ok: true;
21
+ value: Record<string, unknown>;
22
+ } | {
23
+ ok: false;
24
+ reason: 'invalid-json' | 'not-object';
25
+ };
26
+ /** Validates the metadata editor's text: must be one JSON object (empty text = no metadata). */
27
+ export declare function parseMetadataJson(text: string): MetadataParse;
@@ -0,0 +1,50 @@
1
+ export const PREVIEW_LIMITS = {
2
+ image: 10 * 1024 * 1024,
3
+ pdf: 20 * 1024 * 1024,
4
+ json: 1024 * 1024,
5
+ csv: 1024 * 1024,
6
+ text: 1024 * 1024
7
+ };
8
+ export const MAX_PREVIEW_CHARS = 2e5;
9
+ const IMAGE_EXT = /* @__PURE__ */ new Set(["png", "jpg", "jpeg", "gif", "webp", "avif", "bmp", "ico"]);
10
+ const TEXT_EXT = /* @__PURE__ */ new Set(["txt", "md", "log", "xml", "yaml", "yml", "html", "css", "js", "ts", "ini", "toml", "sql", "sh", "conf", "properties"]);
11
+ function extensionOf(filename) {
12
+ const dot = filename.lastIndexOf(".");
13
+ return dot < 0 ? "" : filename.slice(dot + 1).toLowerCase();
14
+ }
15
+ export function previewKind(filename, blobType = "") {
16
+ const ext = extensionOf(filename);
17
+ const type = blobType.split(";")[0].trim().toLowerCase();
18
+ if (ext === "svg" || type === "image/svg+xml") return "other";
19
+ if (IMAGE_EXT.has(ext) || type.startsWith("image/") && !ext) return "image";
20
+ if (ext === "pdf" || type === "application/pdf" && !ext) return "pdf";
21
+ if (ext === "json" || ext === "ndjson" || type === "application/json" && !ext) return "json";
22
+ if (ext === "csv" || ext === "tsv" || type === "text/csv" && !ext) return "csv";
23
+ if (TEXT_EXT.has(ext) || type.startsWith("text/") && !ext) return "text";
24
+ return "other";
25
+ }
26
+ export function canPreview(kind, length) {
27
+ if (kind === "other") return false;
28
+ return length <= PREVIEW_LIMITS[kind];
29
+ }
30
+ export function prettyJson(text) {
31
+ try {
32
+ return JSON.stringify(JSON.parse(text), null, 2);
33
+ } catch {
34
+ return text;
35
+ }
36
+ }
37
+ export function clipText(text, max = MAX_PREVIEW_CHARS) {
38
+ return text.length > max ? { text: text.slice(0, max), clipped: true } : { text, clipped: false };
39
+ }
40
+ export function parseMetadataJson(text) {
41
+ if (!text.trim()) return { ok: true, value: {} };
42
+ let parsed;
43
+ try {
44
+ parsed = JSON.parse(text);
45
+ } catch {
46
+ return { ok: false, reason: "invalid-json" };
47
+ }
48
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) return { ok: false, reason: "not-object" };
49
+ return { ok: true, value: parsed };
50
+ }
@@ -12,6 +12,8 @@ export interface FilterCondition {
12
12
  export interface FilterGroup {
13
13
  match: 'all' | 'any';
14
14
  conditions: FilterCondition[];
15
+ /** Exclude what the combined conditions match (NOT). Written with De Morgan, see `useMongocampQuery().not`. */
16
+ negate?: boolean;
15
17
  }
16
18
  export declare const FILTER_OPERATORS_BY_TYPE: Record<FilterFieldType, FilterOperator[]>;
17
19
  export declare function operatorsFor(type: FilterFieldType): FilterOperator[];
@@ -25,7 +27,10 @@ export declare function conditionValueText(condition: FilterCondition): string;
25
27
  export declare function valueCountFor(operator: FilterOperator): 0 | 1 | 2;
26
28
  /** Lucene for one row, or `''` when the row is incomplete/invalid (so it is simply not applied). */
27
29
  export declare function buildCondition(condition: FilterCondition, type: FilterFieldType): string;
28
- /** Combines every valid row with AND (`match: 'all'`) or OR (`'any'`). `''` means "no filter". */
30
+ /**
31
+ * Combines every valid row with AND (`match: 'all'`) or OR (`'any'`), negated when `negate` is set. `''` means "no
32
+ * filter" — a negated group with no valid row is also no filter, never "match nothing".
33
+ */
29
34
  export declare function buildFilterQuery(group: FilterGroup, fieldTypes: Record<string, FilterFieldType>): string;
30
35
  /** Rows that actually contribute to the query — what a "Filters (n)" badge should show. */
31
36
  export declare function countActiveConditions(group: FilterGroup, fieldTypes: Record<string, FilterFieldType>): number;